@reltio/segmentation 1.4.117 → 1.4.2042-hf
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/210.bundle.js +1 -1
- package/bundle.js +1 -1
- package/package.json +5 -5
package/210.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_reltio_segmentation=self.webpackChunk_reltio_segmentation||[]).push([[210],{39210:(e,t,r)=>{r.r(t),r.d(t,{ConfigureColumnsButton:()=>wd,DEFAULT_SEARCH_SELECT:()=>Z.Tv,EntitiesTableWithConfigurableColumns:()=>of,EntityAvatar:()=>A,ROWS_PER_PAGE_OPTIONS:()=>Z.Tu,buildQueryForAdvancedSearchGroups:()=>Ua.Jk,buildSelectFromColumns:()=>Ai.vw,collectSpecialColumns:()=>Ai.oX,createRecentSearch:()=>Es,default:()=>wq,getActiveEntityTypeTab:()=>Ri.tB,getAdditionalColumns:()=>Ai.oq,getDataTenant:()=>ai.lF,getEntityTypeLabel:()=>S.getEntityTypeLabel,getEntityTypeTab:()=>Ri.o4,getModule:()=>up,getPage:()=>ai.fx,getRowsPerPage:()=>ai.Uz,getSearchResultsMode:()=>Ri.XM,getSearchUrlQuery:()=>ho.Cc,getSerializedSearchState:()=>bo.Z,getTotal:()=>ai.NU,needRequestAfterColumnsChanges:()=>Ai.tU,parseSearchState:()=>Ss.Z,queryBuilderHelpers:()=>n,queryBuilderSagas:()=>a,replaceSearchResultsColumns:()=>Ss.f,showMoreResultsForEntityTypeAction:()=>qa,showSavedSearchesDialogAction:()=>yi});var n={};r.r(n),r.d(n,{PROP_NAME_FILTER:()=>bt,PROP_NAME_OPERATOR:()=>ht,PROP_NAME_VALUES:()=>Et,addAttributeAfter:()=>It,changeAttributeData:()=>Nt,createGetAttributeIndex:()=>wt,createGetAttributeLens:()=>At,createGetAttributeProp:()=>_t,createGetAttributesLens:()=>Ct,createGetGroupLens:()=>xt,createSetAttributeProp:()=>Rt,defaultFindGroupPath:()=>St,deleteAttribute:()=>Dt,duplicateAttribute:()=>kt,getAttributeData:()=>Ot,getAttributeObject:()=>Tt,getEmptyAttributeObject:()=>vt,setAttributeOperator:()=>Pt,setFilter:()=>Lt,setValues:()=>Ut});var a={};r.r(a),r.d(a,{toggleQueryBuilderAttributeSelect:()=>el});var i={};r.r(i),r.d(i,{addAttributes:()=>ab,addDefaultValuesAction:()=>ib,addNextPageOfAttributeValues:()=>sb,modifyAttribute:()=>ob,processNextPageOfAttributeValues:()=>cb,profileSaved:()=>fb,removeAttribute:()=>lb,requestNextPageOfAttributeValues:()=>ub,runAuthoringTaskAction:()=>db,saveDraft:()=>mb,saveProfile:()=>pb,validateProfile:()=>yb});var o={};r.r(o),r.d(o,{dependentLookupsEditorTouched:()=>vb,dependentLookupsEditorsBlocked:()=>bb,dependentLookupsInitedTypeUrisAdded:()=>Eb,dependentLookupsStructureSet:()=>hb});var l={};r.r(l),r.d(l,{activityFilterUpdated:()=>Mb,globalFilterUpdated:()=>Vb,keywordUpdated:()=>Ub,saveState:()=>Fb,searchResultsSet:()=>Lb,setSearchNavigationData:()=>Yb,setSearchOptionsConfig:()=>zb,setSearchProviderData:()=>Hb,updateSearchNavigationDataFields:()=>Wb,updateSearchNavigationDataOnMerge:()=>Gb,updateSearchOptions:()=>Bb,updateState:()=>jb});var s={};r.r(s),r.d(s,{addDashboardExternalView:()=>Dv,autocloseIntervalLoaded:()=>fv,clearNotifications:()=>sv,closeNotification:()=>lv,dateMaskUpdated:()=>Tv,dateTimeMaskUpdated:()=>Ov,documentationSet:()=>Pv,entityDeletionFinished:()=>av,errorSet:()=>Nv,keysSet:()=>_v,localeAttributePresentationLoaded:()=>mv,localizationLoaded:()=>vv,navigateTo:()=>Rv,newEntityShown:()=>nv,newUiConfigLoaded:()=>dv,numberFormatUpdated:()=>gv,openAppFromChocolateBar:()=>Ev,openConsoleApp:()=>hv,openDashboard:()=>xv,openEntity:()=>rv,openGraph:()=>bv,openHistoryEvent:()=>Cv,openNewEntityWithAuthoring:()=>wv,openPerspective:()=>iv,openPivotingPerspective:()=>Iv,openPreviousPage:()=>Av,openSearch:()=>Sv,pathsSet:()=>cv,setPreferReact:()=>yv,setUseSharedPreferences:()=>kv,showNotification:()=>ov,uiConfigLoaded:()=>pv,uiPathSet:()=>uv});var c={};r.r(c),r.d(c,{getAbsoluteImagePath:()=>US,getActiveErrorsForAttributesPager:()=>jO,getActivityFilter:()=>yS,getAdminToolsPath:()=>YO,getAiAssistantEnabled:()=>sS,getAiAssistantHistoryBufferSize:()=>pS,getAiAssistantLimitPerDay:()=>cS,getAiAssistantSkills:()=>uS,getAllRelationsToAddAndEdit:()=>NS,getAllRelationsToSave:()=>PS,getAllServicesPaths:()=>nx,getAllTreesEditingConnections:()=>WS,getApiPath:()=>MO,getAttributeTypeErrors:()=>LO,getAttributesErrors:()=>UO,getAttributesPresentation:()=>WO,getAttributesSortingStrategy:()=>fC,getAuthoringByEntityType:()=>gC,getAutoCloseInterval:()=>ZO,getCanSuggestAuthoring:()=>OC,getCanUserCreateWorkflowConfigJar:()=>px,getCanUserCreateWorkflowEnvironmentConfigJar:()=>dx,getCanUserDeleteProfiles:()=>kx,getCanUserExecuteWorkflowJobs:()=>mx,getCanUserExecuteWorkflowJobsSyncBusinessProcessData:()=>fx,getCanUserExecuteWorkflowJobsTerminateProcessInstance:()=>yx,getCanUserExecuteWorkflowJobsUpdateTasks:()=>gx,getCanUserExecuteWorkflowJobsValidateTasks:()=>hx,getCanUserGetDQStatistic:()=>Ux,getCanUserImportEntitiesFromDT:()=>Ix,getCanUserMakeActivitiesExport:()=>_x,getCanUserMakeBulkUpdate:()=>Dx,getCanUserMakeExport:()=>Rx,getCanUserManageWorkflowDefinition:()=>Ex,getCanUserManageWorkflowEnvironmentDefinition:()=>bx,getCanUserOpenDataLoader:()=>Lx,getCanUserReadDVF:()=>jx,getCanUserReadEntitiesFromDT:()=>Nx,getCanUserReadWorkflowDataTask:()=>vx,getCanUserRegisterConfigEnvironments:()=>ux,getCanUserStartProcessFromQuery:()=>Px,getCanUserUpdateProcessInstance:()=>Tx,getCanUserUpdateWorkflowDataTask:()=>Ox,getCanUserViewProcessInstanceSearchQuery:()=>Sx,getCanUserViewWorkflowConfigJar:()=>xx,getCanUserViewWorkflowDefinition:()=>Cx,getCanUserViewWorkflowEnvironmentConfigJar:()=>wx,getCanUserViewWorkflowJobs:()=>Ax,getCheckIfCanAddRelations:()=>eC,getCleanseByEntityType:()=>hC,getCollaborationPath:()=>ox,getConnectionsByViewId:()=>gO,getConnectionsTemporaryUrisForCreation:()=>TO,getConnectionsWithDraftsByViewId:()=>bO,getControlAttributes:()=>TC,getDBConnectorSideViews:()=>Gx,getDVFPath:()=>lx,getDataTenants:()=>aO,getDateMask:()=>$O,getDateTimeMask:()=>KO,getDependentLookupEditorState:()=>Qx,getDependentLookupEditorsState:()=>Xx,getDependentLookups:()=>qx,getDependentLookupsInitedTypeUris:()=>Kx,getDependentLookupsStructure:()=>Zx,getDependentLookupsStructureNode:()=>$x,getDocReleaseNotes:()=>cC,getDraftsForSaveByViewId:()=>vO,getDtssPath:()=>ex,getEditingOrAddingConnectionByViewIdAndRelationUri:()=>hO,getEditingOrAddingConnectionRelationObjectByViewIdAndRelationUri:()=>EO,getEntity:()=>mO,getEntityRelatedAttributesByAttributeTypeUri:()=>kO,getEntityUri:()=>fO,getEntityUriWithDataTenant:()=>yO,getEntityWithDiff:()=>tC,getEntityWithoutDiff:()=>rC,getEnvironment:()=>QS,getEnvironmentAlias:()=>JS,getEnvironmentObject:()=>sO,getExportDQPath:()=>tx,getExportPath:()=>VO,getGlobalFilter:()=>TS,getGlobalFilterQuery:()=>OS,getGlobalFilterSavedSearchesUris:()=>SS,getGlobalSearchRequestOptions:()=>bS,getGoogleMapKey:()=>rS,getHeaderColor:()=>pC,getHiddenAttributes:()=>vC,getHistoryDiff:()=>wO,getHistoryEvent:()=>AO,getHistoryMode:()=>IO,getHistorySlice:()=>RO,getIcpLicenseKey:()=>nS,getImageAttributesFieldsOrder:()=>eS,getImagePath:()=>FO,getImageServicePath:()=>HO,getInitialConnection:()=>kS,getInitialConnectionTempEntity:()=>DS,getIsAuthoringMode:()=>EC,getIsEditableMode:()=>CS,getIsHistoryModeEnabled:()=>_O,getIsSuggestMode:()=>AS,getIsViewMode:()=>wS,getLogo:()=>uC,getLookupAutocomplete:()=>tS,getLookups:()=>SO,getMaxValuesInResponse:()=>qO,getMetadata:()=>oO,getMlDqPath:()=>cx,getMode:()=>xS,getModifiedEntities:()=>DO,getModifiedEntity:()=>NO,getModifiedEntityDefaultProfilePic:()=>PO,getNotifications:()=>QO,getPivotingAttributes:()=>JO,getProfile:()=>pO,getProfileCancelNeedConfirm:()=>$S,getProfileCheckUpdate:()=>yC,getProfileErrors:()=>xO,getProfileLastLoadedTime:()=>GS,getProfileOperation:()=>qS,getProfileViews:()=>ZS,getQueryEstimatorEnabled:()=>bC,getRelationToAddByViewId:()=>_S,getRelations:()=>RS,getRelationsToEditByViewId:()=>IS,getRelationsViewIds:()=>CO,getReleaseVersion:()=>sC,getReltioPath:()=>zO,getRequestProviderConfiguration:()=>XO,getSearch:()=>dO,getSearchKeyword:()=>fS,getSearchNavigationData:()=>ES,getSearchOptions:()=>gS,getSearchProviderData:()=>hS,getSearchResults:()=>mS,getServicesPath:()=>nC,getSharedPreferencesEnabled:()=>dS,getShowAttributeDescription:()=>mC,getShowEntityId:()=>lC,getShowSearchByOv:()=>dC,getStringifiedSearchOptions:()=>vS,getTenant:()=>KS,getTenantName:()=>XS,getTenantObject:()=>lO,getTenants:()=>iO,getTotalByViewId:()=>OO,getTree:()=>VS,getTreeCommands:()=>HS,getTreeEditingConnection:()=>YS,getTreeRoot:()=>BS,getTreeTotal:()=>zS,getTrees:()=>MS,getUIConfig:()=>aC,getUIConfigLayout:()=>iC,getUIConfigProfile:()=>oC,getUIPath:()=>BO,getUi:()=>uO,getUiError:()=>Jx,getUiNumberFormat:()=>GO,getUser:()=>cO,getUserName:()=>jS,getUserRoles:()=>FS,getValidateReadMode:()=>iS,getValidateReferenceEntityInReadMode:()=>lS,getValidateRelations:()=>oS,getValidationServicePath:()=>sx,getValidationServiceSeverityLevels:()=>aS,getViewIdsForOpenRelation:()=>LS,getWorkflowConfigurationEnabled:()=>ix,getWorkflowEnvironmentUrl:()=>ax,getWorkflowPath:()=>rx,isCollaborationEnabled:()=>Fx,isCollaborationSideViewEnabled:()=>Hx,isDBConnectorSideViewEnabled:()=>Wx,isHistorySideViewEnabled:()=>Yx,isWorkflowEnabled:()=>Mx,isWorkflowSideViewEnabled:()=>zx});var u={};r.r(u),r.d(u,{authoringDcrResolved:()=>JC,authoringDraftEntitiesLoaded:()=>QC,clearEntity:()=>rw,entityCloneRequested:()=>tw,entityCreationRequested:()=>KC,entityCreationWithAuthoringRequested:()=>XC,entityLoaded:()=>qC,entityRemoveRequested:()=>ew,loadEntity:()=>$C,setDefaultProfilePic:()=>ZC});var p={};r.r(p),r.d(p,{errorDeactivated:()=>sw,errorsSet:()=>cw});var d={};r.r(d),r.d(d,{clearHistoryDiff:()=>fw,clearHistoryEvent:()=>gw,setHistoryDiff:()=>mw,setHistoryEvent:()=>yw,setHistoryMode:()=>Ew,setHistorySlice:()=>hw});var m={};r.r(m),r.d(m,{lookupsForTypeResolved:()=>Cw,lookupsListResolved:()=>ww,lookupsLoaded:()=>xw});var f={};r.r(f),r.d(f,{modeEditingCanceled:()=>Pw,modeUpdateRequested:()=>Nw,modeUpdated:()=>Iw});var y={};r.r(y),r.d(y,{cleanseLoading:()=>Bw,entityCreated:()=>jw,entityDeleted:()=>Fw,modifiedEntitiesReset:()=>Vw,setDefaultProfilePic:()=>Mw});var g={};r.r(g),r.d(g,{addRelation:()=>rA,closeRelationEditor:()=>oA,editRelation:()=>nA,ignoreRelation:()=>tA,openRelationEditor:()=>iA,relationsLoaded:()=>Qw,removeRelation:()=>eA,secondLevelRelationsLoaded:()=>Jw,setInitialInfo:()=>cA,setRelationEntity:()=>sA,setRelationType:()=>lA,updateRelationRating:()=>aA});var h={};r.r(h),r.d(h,{hiddenAttributesReset:()=>J_,hiddenAttributesUpdated:()=>Q_});var E={};r.r(E),r.d(E,{controlAttributesUpdated:()=>rI}),r(69448);var b=r(8156),v=r.n(b),T=r(78310),O=r.n(T),S=r(2396),x=r(55743),C=r.n(x),w=r(13639);const A=({entity:e,avatarClassName:t,imageClassName:r})=>{const n=(0,w.AH)(),a=(0,w.$H)()||"",i=(0,S.getEntityImage)(n,a,e),o=(0,S.getAbsoluteImageUrl)(a,(0,S.getEntityTypeImage)(n,e.type)),l=e=>{e.target.onError=null,e.target.src=(0,S.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 v().createElement(C(),{className:O()(t,r),src:i,imgProps:{onError:l}},v().createElement("img",{className:r,src:o,alt:"fallback entity avatar",onError:l}))};var R=r(75580),_=r(73288),I=r(62391),N=r(9400),P=r(8523),D=r(42308),k=r.n(D),L=r(61882),U=r(26040),j=r(5950);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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const V={facetsConfigs:[],facetsData:{},recommendedFacets:[],addedFacets:[]},B=(0,I.Ic)("facetsConfigs"),z=(0,I.Ic)("facetsData"),H=(0,I.Ic)("recommendedFacets"),Y=(0,I.Ic)("addedFacets"),W=(e,t,r)=>Object.keys(e).reduce(((t,n)=>(0,_.prop)(n,t)?(0,I.ET)(n,r).set(t,e[n]):t),F({},t)),G=({state:e,facetsConfigs:t,addToEnd:r=!1,facetsData:n={}})=>{const a=t.filter((e=>e.fieldName)),i=B.get(e),o=B.set(e,r?i.concat(a):a.concat(i)),l=z.get(e),s=a.reduce(((e,t)=>F({},e,{[t.fieldName]:(0,N.DV)(t.fieldName,n[t.fieldName])})),F({},l));return z.set(o,s)},q=(e=V,t)=>{switch(t.type){case L.k.CREATE_FACETS:{const{facetsConfigs:r,addToEnd:n}=t.payload;return G({state:e,facetsConfigs:r,addToEnd:n})}case D.search.constants.UPDATE_STATE:{const{facetsConfigs:e=[],facetsData:r={}}=t.payload.facets||{facetsConfigs:[]};return G({state:V,facetsConfigs:e,facetsData:r})}case L.k.DESTROY_FACETS:return((e,t)=>{const r=z.get(e),n=B.get(e),a=F({},r);t.forEach((e=>{delete a[e]}));const i=z.set(e,a);return B.set(i,n.filter((e=>!t.includes(e.fieldName))))})(e,t.payload||[]);case L.k.CHANGE_VALUES:{const{facetFieldName:r,values:n}=t.payload;return(({facetFieldName:e,values:t,state:r})=>{const n=[...(0,P.jK)(e),"values"];return(0,I.ET)(...n).set(r,t)})({facetFieldName:r,values:n,state:e})}case L.k.SHOW_MORE_ENTITY_TYPES:{const{show:r}=t.payload,n="type",a=(0,P.jK)(n);if(r)return(0,I.ET)(...a,"showAllItems").set(e,r);{const t=(0,I.ET)(...a);return t.set(e,(0,_.omit)(["showAllItems"],t.get(e)))}}case L.k.CLEAR_ALL_VALUES:case U.Z.CLEAR_ALL:{const t=z.get(e),r=Object.keys(t).reduce(((e,t)=>F({},e,{[t]:[]})),{}),n=W(r,t,"values");return z.set(e,n)}case L.k.UPDATE_DATA:{const r=t.payload||{},n=z.get(e),a=W(r,n,"data");return z.set(e,a)}case L.k.UPDATE_FILTERED_DATA:{const r=t.payload||{},n=z.get(e),a=W(r,n,"filteredData");return z.set(e,a)}case L.k.DESTROY_FILTERED_DATA:{const r=t.payload||{},n=(0,P.jK)(r);if((0,_.path)(n,e)){const t=(0,I.ET)(...n),r=F({},t.get(e));if(r.filteredData)return delete r.filteredData,t.set(e,r)}break}case L.k.SET_RECOMMENDED_FACETS_LIST:return H.set(e,t.payload||[]);case L.k.HIGHLIGHT_ADDED_FACETS:return Y.set(e,t.payload);case L.k.CLEAR_HIGHLIGHT_ADDED_FACETS:return Y.set(e,[]);case"UI_RESET":return F({},V);case U.Z.CHANGE_CURRENT_TENANT:{const{isDataTenant:r,tenantObject:n}=t.payload;if(r){const t=B.get(e),r=z.get(e),a=(0,j.ci)(n,t),i=(0,_.pluck)("fieldName",a),o=(0,_.pipe)((0,_.pick)(i),(0,j.AZ)(n))(r);return z.set(B.set(e,a),o)}return e}}return e};var Z=r(33950);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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(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,I.Ic)("searchResults"),J=(0,I.Ic)("total"),ee=(0,I.Ic)("page"),te=(0,I.Ic)("rowsPerPage"),re=(0,I.Ic)("sortField"),ne=(0,I.Ic)("sortOrder"),ae=(0,I.Ic)("loading"),ie=(0,I.ET)("searchParams","mapSearch","values"),oe=(0,I.ET)("searchParams","mapSearch","type"),le=(0,I.ET)("searchParams","mapSearch","fieldName"),se=(0,I.Ic)("searchResultsByEntityTypes"),ce=e=>se.compose((0,I.ET)(e,"page")),ue=({entityTypeUri:e,field:t,order:r},n)=>{if(e){const a=se.compose((0,I.ET)(e,"sortField")),i=se.compose((0,I.ET)(e,"sortOrder")),o=a.set(n,t);return i.set(o,r)}{const e=re.set(n,t);return ne.set(e,r)}},pe=(e=X,t)=>{switch(t.type){case U.Z.UPDATE_ENTITIES:{const{searchResults:r,entityTypeUri:n}=t.payload;return n?se.compose((0,I.ET)(n,"searchResults")).set(e,r):Q.set(e,r)}case U.Z.UPDATE_TOTAL:return J.set(e,t.payload);case U.Z.CHANGE_PAGE:{const{entityTypeUri:r,pageNumber:n}=t.payload;return r?ce(r).set(e,n):ee.set(e,n)}case U.Z.RESET_PAGE:{const{entityTypeUri:r}=t.payload,n=ee.set(e,0);return r?ce(r).set(n,0):n}case U.Z.CHANGE_ROWS_PER_PAGE:{const{entityTypeUri:r,number:n}=t.payload;if(r){const t=se.compose((0,I.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 U.Z.CHANGE_SORT:return ue(t.payload,e);case U.Z.CHANGE_LOADING:return ae.set(e,t.payload);case D.search.constants.UPDATE_STATE:{const{values:r=[],searchType:n=S.MapSearch.geoPolygon}=t.payload.map||{};let a=ie.set(X,r);if(a=oe.set(a,n),a=le.set(a,(0,S.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 U.Z.MAP_CHANGE_VALUE:{const{value:r,searchType:n}=t.payload;let a=oe.set(e,n);return a=le.set(a,(0,S.mapSearchTypeToFieldName)(n)),ie.set(a,r?[r]:[])}case U.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 U.Z.CLEAR_ALL:return ie.set(e,[]);case U.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",fe="UI_SHOW_SAVE_SEARCH_DIALOG",ye="UI_SHOW_ADVANCED_SEARCH",ge="UI_SHOW_BULK_UPDATE",he="UI_SET_MARKER",Ee="UI_SET_HOVERED_ENTITY_URI",be="UI_SET_SEARCH_RESULTS_COLUMNS",ve="UI_CHANGE_SEARCH_RESULTS_COLUMNS",Te="UI_SET_ENTITY_TYPE_TAB",Oe="UI_UPDATE_TABLE_VIEW_TABS",Se="UI_CHANGE_ORDER_SEARCH_RESULTS_COLUMNS",xe="UI_CHANGE_SIZES_SEARCH_RESULTS_COLUMNS",Ce="UI_CLEAR_NOTIFICATION",we="UI_SET_NOTIFICATION",Ae="UI_SET_SEARCH_RESULTS_MODE",Re="UI_SET_PREVIEW_PANEL_MODE",_e={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},Ie=(0,I.Ic)("showMoreFacetsPopup"),Ne=(0,I.Ic)("showSavedSearchesDialog"),Pe=(0,I.Ic)("showSaveSearchDialog"),De=(0,I.Ic)("showAdvancedSearch"),ke=(0,I.Ic)("showBulkUpdate"),Le=(0,I.Ic)("activeAdditionalSearch"),Ue=(0,I.Ic)("activeMarker"),je=(0,I.Ic)("hoveredEntityUri"),Fe=(0,I.Ic)("searchResultsMode"),Me=(0,I.Ic)("previewPanelMode"),Ve=(0,I.Ic)("searchResultsColumns"),Be=(0,I.Ic)("entityTypeTab"),ze=(0,I.Ic)("tableViewTabs"),He=(0,I.Ic)("loading"),Ye=(0,I.Ic)("notification"),We=(e=_e,t)=>{switch(t.type){case de:return Ie.set(e,t.payload);case me:return Ne.set(e,t.payload);case fe:return Pe.set(e,t.payload.show);case ye:return De.set(e,t.payload);case ge:return ke.set(e,t.payload);case"UI_SET_ACTIVE_ADDITIONAL_SEARCH":{const r=Le.get(e)===t.payload?null:t.payload;return Le.set(e,r)}case he:return Ue.set(e,t.payload);case Ee:return je.set(e,t.payload);case Ae:return Fe.set(e,t.payload);case be:return Ve.set(e,t.payload);case ve:{const{entityTypeUri:r,columns:n}=t.payload;return Ve.compose((0,I.Ic)(r)).set(e,n)}case xe:{const{entityTypeUri:r,columns:n}=t.payload;return Ve.compose((0,I.Ic)(r)).set(e,n)}case Se:{const{entityTypeUri:r,columns:n}=t.payload;return Ve.compose((0,I.Ic)(r)).set(e,n)}case Re:return Me.set(e,t.payload);case Te:return Be.set(e,t.payload.entityTypeUri);case Oe:return ze.set(e,t.payload);case L.k.UPDATE_DATA:if((0,_.has)("type",t.payload))return ze.set(e,t.payload.type);break;case L.k.CHANGE_VALUES:{const{facetFieldName:r,values:n}=t.payload;if("type"===r&&n.length){const t=Be.get(e);if(!n.includes(t))return Be.set(e,n[0])}break}case"UI_RESET":return _e;case"UI_SET_LOADING":return He.set(e,t.payload);case we:return Ye.set(e,t.payload);case Ce:return Ye.set(e,null);case D.search.constants.UPDATE_STATE:{let r=De.set(e,(0,_.has)("advanced",t.payload));if(t.payload.view){const{searchResultsMode:e,entityTypeTab:n,searchResultsColumns:a,previewPanelMode:i}=t.payload.view;r=Fe.set(r,e),r=Be.set(r,n),(0,S.isEmptyValue)(a)||(r=Ve.set(r,a)),r=Me.set(r,i)}return t.payload.showSavedSearchesDialog&&(r=Ne.set(r,t.payload.showSavedSearchesDialog)),r}}return e};var Ge=r(37164);const qe="ADVANCED_SEARCH_SET_GROUP_ENTITY_TYPES",Ze="ADVANCED_SEARCH_VERIFY_GROUP_ENTITY_TYPES",$e="ADVANCED_SEARCH_SET_GROUP_OPERATOR",Ke="ADVANCED_SEARCH_DELETE_GROUP",Xe="ADVANCED_SEARCH_ADD_GROUP",Qe="ADVANCED_SEARCH_DUPLICATE_GROUP",Je="ADVANCED_SEARCH_ADD_ATTRIBUTE_AFTER",et="ADVANCED_SEARCH_CHANGE_ATTRIBUTE_DATA",tt="ADVANCED_SEARCH_TOGGLE_ATTRIBUTE_SELECT",rt="ADVANCED_SEARCH_SET_ATTRIBUTE_OPERATOR",nt="ADVANCED_SEARCH_DELETE_ATTRIBUTE",at="ADVANCED_DELETE_ATTRIBUTE_AND_VERIFY_GROUP_ENTITY_TYPES",it="ADVANCED_SEARCH_DUPLICATE_ATTRIBUTE",ot="ADVANCED_SEARCH_SET_FILTER",lt="ADVANCED_SEARCH_SET_VALUES",st="ADVANCED_SEARCH_ATTRIBUTE_SET_VALUES",ct="ADVANCED_SEARCH_ATTRIBUTE_FILTER_VALUES",ut="ADVANCED_SEARCH_ATTRIBUTE_SET_FILTERED_VALUES",pt="ADVANCED_SEARCH_ATTRIBUTE_UPDATE_VALUES",dt="ADVANCED_SEARCH_UPDATE",mt="ADVANCED_SEARCH_CONVERT_FROM_FACETS";var ft=r(81253);function yt(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){gt(e,t,r[t])}))}return e}function gt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ht="operator",Et="values",bt="filter",vt=(e=(0,Ge.x0)())=>({[ht]:Z.YL.value,id:e}),Tt=(e,t=(0,Ge.x0)())=>{const r=Ot(e);return{data:r,[ht]:Z.YL.value,[bt]:(0,_.pathOr)("",["filterOptions",0],r),id:t}},Ot=e=>yt({},e,{filterOptions:e.enforcedFilterOptions||(0,S.getFilterOptionsForQueryBuilder)(e.attrType,e.fieldName,!0)}),St=(0,_.curry)(((e,t)=>{const r=t.findIndex((t=>t.id===e));return r>-1?[r]:null})),xt=(e,t=St)=>(r,n)=>{const a=(0,I.ET)(...e).get(r),i=t(n,a);return!!i&&(0,I.ET)(...e,...i)},Ct=(e,t)=>(r,n)=>{const a=e(r,n);return a&&a.compose((0,I.Ic)(t))},wt=e=>(t,r,n)=>{const a=e(t,r);return a?a.get(t).findIndex((e=>e.id===n)):-1},At=e=>(t,r,n)=>{const a=e(t,r),i=wt(e)(t,r,n);return-1!==i?a.compose((0,I.ET)(i)):null},Rt=e=>(t,r,n,a,i)=>{const o=e(t,r,n);if(o){const e=yt({},o.get(t));return e[a]=i,o.set(t,e)}return t},_t=e=>(t,r,n,a)=>{const i=e(t,r,n);if(i)return i.get(t)[a]},It=({state:e,groupId:t,attributeId:r,attribute:n,getAttributesLens:a,getAttributeIndex:i})=>{const o=a(e,t);if(o){let a=[...o.get(e)];const l=i(e,t,r),s=!a[l+1];return-1!==l&&s?a.splice(l+1,0,n):-1!==l?(a.splice(l+1,0,yt({},n,{operator:a[l].operator})),a[l]=yt({},a[l],{operator:Z.YL.value})):a.push(n),o.set(e,a)}return e},Nt=({state:e,groupId:t,attributeId:r,attributeData:n,setAttributeProp:a,getAttributeLens:i})=>{let o=e;if(n)return((e,t,r,n,a)=>{const i=a(e,t,r);let o;return i&&(o=i.get(e).filter),n.filterOptions.length&&(!o||!n.filterOptions.includes(o))})(e,t,r,n,i)&&(o=a(e,t,r,bt,n.filterOptions[0])),o=a(o,t,r,Et,[]),a(o,t,r,"data",n);{const n=i(e,t,r);return n&&(o=n.set(o,vt(r))),o}},Pt=({state:e,groupId:t,attributeId:r,operator:n,setAttributeProp:a})=>a(e,t,r,ht,n),Dt=({state:e,groupId:t,attributeId:r,getAttributesLens:n})=>{const a=n(e,t);if(a){const t=[...a.get(e)],n=t.findIndex((e=>e.id===r));if(n>-1){const r=(0,_.remove)(n,1,t),i=r[n-1],o=t[n];return i&&(r[n-1]=yt({},i,{operator:o.operator})),a.set(e,r)}}return e},kt=({state:e,groupId:t,attributeId:r,id:n,getAttributesLens:a})=>{const i=a(e,t);if(i){const t=[...i.get(e)],a=t.findIndex((e=>e.id===r));if(a>-1)return t.push(yt({},t[a],{id:n})),i.set(e,t)}return e},Lt=({state:e,groupId:t,attributeId:r,filter:n,getAttributeProp:a,setAttributeProp:i})=>{const o=a(e,t,r,bt),l=(0,S.isCompatibleFilters)(o,n)?e:i(e,t,r,Et,[]);return i(l,t,r,bt,n)},Ut=({state:e,groupId:t,attributeId:r,values:n,setAttributeProp:a})=>a(e,t,r,Et,n);function jt(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Ft(e,t,r[t])}))}return e}function Ft(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Mt={groups:[]},Vt={},Bt="entityTypes",zt="attributes",Ht=["groups"],Yt=(0,I.ET)(...Ht),Wt=xt(Ht),Gt=Ct(Wt,zt),qt=wt(Gt),Zt=At(Gt),$t=Rt(Zt),Kt=_t(Zt),Xt=(e,t=[],r=(0,Ge.x0)())=>({[zt]:e.map((e=>Tt(e))),[ht]:Z.qx.value,[Bt]:t,id:r}),Qt=(e=Vt,t)=>{switch(t.type){case ut:{const{groupId:r,attributeId:n,values:a}=t.payload;return(0,_.assocPath)([r,n,"filtered"],a,e)}case Ke:{const{groupId:r}=t.payload;return(0,_.dissoc)(r,e)}case nt:{const{groupId:r,attributeId:n}=t.payload;return(0,_.dissocPath)([r,n],e)}case Qe:{const{groupId:r,id:n}=t.payload,a=e[r];return a?(0,_.assoc)(n,a,e):e}case it:{const{groupId:r,attributeId:n,id:a}=t.payload,i=(0,_.path)([r,n],e);return i?(0,_.assocPath)([r,a],i,e):e}case U.Z.CLEAR_ALL:case D.search.constants.UPDATE_STATE:return Vt;default:return e}},Jt=(e=Mt,t)=>{switch(t.type){case Xe:{const{group:r}=t.payload,n=[...Yt.get(e)];return n.push(r),Yt.set(e,n)}case $e:{const{groupId:r,operator:n}=t.payload,a=Wt(e,r);if(a){const t=jt({},a.get(e));return t[ht]=n,a.set(e,t)}return e}case qe:{const{groupId:r,entityTypes:n}=t.payload,a=Wt(e,r);if(a){const t=jt({},a.get(e));return t.entityTypes=n,t.autoAddedEntityTypes=[],t.attributes=[],a.set(e,t)}return e}case Ze:{const{groupId:r}=t.payload,n=Wt(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,jt({},t,{[Bt]:r,autoAddedEntityTypes:a}))}return e}case Ke:{const{groupId:r}=t.payload,n=[...Yt.get(e)],a=n.findIndex((e=>e.id===r));if(a>-1){const t=(0,_.remove)(a,1,n),r=t[a-1],i=n[a];return r&&(t[a-1]=jt({},r,{operator:i.operator})),Yt.set(e,t)}return e}case Qe:{const{groupId:r,id:n}=t.payload,a=[...Yt.get(e)],i=a.findIndex((e=>e.id===r));return i>-1?(a.push(jt({},a[i],{id:n})),Yt.set(e,a)):e}case Je:{const{groupId:r,attributeId:n,attribute:a}=t.payload;return It({state:e,groupId:r,attributeId:n,attribute:a,getAttributesLens:Gt,getAttributeIndex:qt})}case et:{const{groupId:r,attributeId:n,attributeData:a}=t.payload;return Nt({state:e,groupId:r,attributeId:n,attributeData:a,setAttributeProp:$t,getAttributeLens:Zt})}case rt:{const{groupId:r,attributeId:n,operator:a}=t.payload;return Pt({state:e,groupId:r,attributeId:n,operator:a,setAttributeProp:$t})}case nt:{const{groupId:r,attributeId:n}=t.payload;return Dt({state:e,groupId:r,attributeId:n,getAttributesLens:Gt})}case it:{const{groupId:r,attributeId:n,id:a}=t.payload;return kt({state:e,groupId:r,attributeId:n,id:a,getAttributesLens:Gt})}case ot:{const{groupId:r,attributeId:n,filter:a}=t.payload;return Lt({state:e,groupId:r,attributeId:n,filter:a,getAttributeProp:Kt,setAttributeProp:$t})}case lt:{const{groupId:r,attributeId:n,values:a}=t.payload;return Ut({state:e,groupId:r,attributeId:n,values:a,setAttributeProp:$t})}case U.Z.CLEAR_ALL:return Mt;case D.search.constants.UPDATE_STATE:{const{advanced:e=[]}=t.payload;return Yt.set(Mt,e)}default:return e}},er=(e,t)=>{const r=((e,t)=>{if(t.type===st){var r;const{groupId:n,attributeId:a,values:i}=t.payload;return((null===(r=[...Yt.get(e.searchParams)].find((e=>e.id===n)))||void 0===r?void 0:r.attributes)||[]).some((({id:e})=>e===a))?(0,_.assocPath)(["attributesData",n,a,"default"],i,e):e}return e})((0,R.combineReducers)({searchParams:Jt,attributesData:Qt})(e,t),t);return r},tr="SAVED_SEARCHES_CREATE",rr="SAVED_SEARCHES_SET_CURRENT",nr="SAVED_SEARCHES_SET_CHANGE_INDICATOR",ar="SAVED_SEARCHES_UPDATE",ir="SAVED_SEARCHES_LOAD",or="SAVED_SEARCHES_SET_TOTAL",lr="SAVED_SEARCHES_SET_ITEMS",sr="SAVED_SEARCHES_SET_ITEM_TOTAL",cr="SAVED_SEARCHES_SET_PAGE",ur="SAVED_SEARCHES_SET_ROWS_PER_PAGE",pr="SAVED_SEARCHES_SET_FILTERS",dr="SAVED_SEARCHES_SELECT_ITEM",mr="SAVED_SEARCHES_SELECT_ALL_ITEMS",fr="SAVED_SEARCHES_DESELECT_ALL_ITEMS",yr="SAVED_SEARCHES_MARK_PUBLIC_REQUEST",gr="SAVED_SEARCHES_MARK_PUBLIC",hr="SAVED_SEARCHES_MARK_FAVORITE_REQUEST",Er="SAVED_SEARCHES_MARK_FAVORITE",br="SAVED_SEARCHES_MARK_GLOBAL_FILTER_REQUEST",vr="SAVED_SEARCHES_CHANGE_ITEM_NAME_REQUEST",Tr="SAVED_SEARCHES_CHANGE_ITEM_NAME",Or="SAVED_SEARCHES_SET_EDITING",Sr="SAVED_SEARCHES_DELETE_SELECTED_ITEMS_REQUEST",xr="SAVED_SEARCHES_DELETE_ITEM_REQUEST",Cr="SAVED_SEARCHES_DELETE_ITEMS",wr="SAVED_SEARCHES_SET_LOADING",Ar="SAVED_SEARCHES_SET_SEARCH_VALUE",Rr="SAVED_SEARCHES_APPLY_ITEM",_r="SAVED_SEARCHES_SET_TOTAL_LOADING",Ir="SAVED_SEARCHES_LOAD_TOTAL",Nr="SAVED_SEARCHES_TOGGLE_SORT",Pr="RECENT_SEARCHES_CREATE",Dr="RECENT_SEARCHES_LOAD",kr="RECENT_SEARCHES_SET_ITEMS",Lr="RECENT_SEARCHES_SET_ITEM_TOTAL",Ur="RECENT_SEARCHES_SELECT_ITEM",jr="RECENT_SEARCHES_SELECT_ALL_ITEMS",Fr="RECENT_SEARCHES_DESELECT_ALL_ITEMS",Mr="RECENT_SEARCHES_DELETE_SELECTED_ITEMS_REQUEST",Vr="RECENT_SEARCHES_DELETE_ITEMS",Br="RECENT_SEARCHES_DELETE_ITEM_REQUEST",zr="RECENT_SEARCHES_SET_LOADING",Hr="RECENT_SEARCHES_SET_SEARCH_VALUE",Yr="RECENT_SEARCHES_SET_LAST_SAVED",Wr="RECENT_SEARCHES_SET_TOTAL_LOADING",Gr="RECENT_SEARCHES_LOAD_TOTAL",qr="RECENT_SEARCHES_APPLY_ITEM";function Zr(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){$r(e,t,r[t])}))}return e}function $r(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Kr={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}},Xr=(0,I.Ic)("changeIndicator"),Qr=(0,I.Ic)("items"),Jr=(0,I.Ic)("total"),en=(0,I.Ic)("page"),tn=(0,I.Ic)("loading"),rn=(0,I.Ic)("postSavingAction"),nn=(0,I.Ic)("sorting"),an=(e,t,r)=>{const n=Qr.get(r).findIndex((e=>e.uri===t)),a=Qr.compose((0,I.ET)([n])),i=a.get(r);return a.set(r,e(i))},on=(e,t,r)=>(0,_.evolve)({page:(0,_.always)(0),[e]:(0,_.always)(t)},r),ln=(e=Kr,t)=>{switch(t.type){case rr:return(0,_.evolve)({currentSearch:(0,_.always)(t.payload),changeIndicator:null===t.payload?(0,_.always)(!1):_.identity},e);case U.Z.CLEAR_ALL:return(0,_.evolve)({currentSearch:(0,_.always)(null),changeIndicator:(0,_.always)(!1)},e);case nr:return Xr.set(e,t.payload);case or:return Jr.set(e,t.payload);case cr:return en.set(e,t.payload);case ur:return on("rowsPerPage",t.payload,e);case pr:{const{findPublic:r,favoriteOnly:n}=t.payload;return(0,_.evolve)({page:(0,_.always)(0),findPublic:(0,_.always)(r),favoriteOnly:(0,_.always)(n)},e)}case lr:return Qr.set(e,t.payload);case dr:{const{uri:r,checked:n}=t.payload;return an((e=>Zr({},e,{checked:n})),r,e)}case fr:{const t=Qr.get(e);return Qr.set(e,t.map((0,_.omit)(["checked"])))}case mr:{const t=Qr.get(e);return Qr.set(e,t.map((0,_.ifElse)((0,_.prop)("isOwnSearch"),(0,_.assoc)("checked",!0),_.identity)))}case Cr:{const r=t.payload,n=Qr.get(e),a=Jr.set(e,Jr.get(e)-r.length);return Qr.set(a,n.filter((e=>!r.includes(e.uri))))}case gr:{const{uri:r,isPublic:n}=t.payload;return an((e=>Zr({},e,{isPublic:n})),r,e)}case Er:{const{uri:r,isFavorite:n}=t.payload;return an((e=>Zr({},e,{isFavorite:n})),r,e)}case sr:{const{uri:r,total:n}=t.payload;return an((e=>Zr({},e,{total:n})),r,e)}case Or:{const{uri:r,isEditing:n}=t.payload;return an((e=>Zr({},e,{isEditing:n})),r,e)}case vr:{const{uri:r}=t.payload;return an((0,_.omit)(["isEditing"]),r,e)}case Tr:{const{uri:r,name:n}=t.payload;return an((e=>Zr({},e,{name:n})),r,e)}case wr:return tn.set(e,t.payload);case Hr:case Ar:return on("searchValue",t.payload,e);case ir:return Zr({},e,{page:0,findPublic:!0,favoriteOnly:!1});case Nr:{const n=t.payload,a=(0,_.path)(["sorting","field"],e),i=(0,_.path)(["sorting","order"],e);return nn.set(e,{field:n,order:(r=n===a?i:null,r===Z.rX.DESC?Z.rX.ASC:Z.rX.DESC)})}case _r:{const{uri:r,isLoading:n}=t.payload;return an((e=>Zr({},e,{isTotalLoading:n})),r,e)}case fe:return rn.set(e,t.payload.postSavingAction);case me:return on("searchValue",Kr.searchValue,e)}var r;return e};function sn(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){cn(e,t,r[t])}))}return e}function cn(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const un={items:[],filterWord:null,loading:!1,lastSavedRecentSearch:null},pn=(0,I.Ic)("items"),dn=(0,I.Ic)("loading"),mn=(0,I.Ic)("filterWord"),fn=(0,I.Ic)("lastSavedRecentSearch"),yn=(e,t,r)=>{const n=pn.get(r).findIndex((e=>e.createdDate===t)),a=pn.compose((0,I.ET)([n])),i=a.get(r);return a.set(r,e(i))},gn=(e=un,t)=>{switch(t.type){case Ar:case Hr:return mn.set(e,t.payload);case kr:return pn.set(e,t.payload);case Ur:{const{searchCreatedDate:r,checked:n}=t.payload;return yn((e=>sn({},e,{checked:n})),r,e)}case Fr:{const t=pn.get(e);return pn.set(e,t.map((0,_.omit)(["checked"])))}case jr:{const t=pn.get(e);return pn.set(e,t.map((0,_.assoc)("checked",!0)))}case Vr:{const r=(t.payload||[]).map((0,_.prop)("createdDate")),n=pn.get(e);return pn.set(e,n.filter((e=>!r.includes(e.createdDate))))}case Lr:{const{searchCreatedDate:r,total:n}=t.payload;return yn((e=>sn({},e,{total:n})),r,e)}case zr:return dn.set(e,t.payload);case Yr:return fn.set(e,t.payload);case Wr:{const{searchCreatedDate:r,isLoading:n}=t.payload;return yn((e=>sn({},e,{isTotalLoading:n})),r,e)}case me:return mn.set(e,un.filterWord)}return e},hn="ENTITY_SET_LOADING",En="ENTITY_LOAD_ENTITY_REQUEST",bn="ENTITY_SET_SELECTED_ENTITY_URI",vn="ENTITY_SET_ENTITY",Tn={loading:!1,selectedEntityUri:null,entity:null},On=(0,I.Ic)("loading"),Sn=(0,I.Ic)("selectedEntityUri"),xn=(0,I.Ic)("entity"),Cn=(e=Tn,t)=>{switch(t.type){case hn:return On.set(e,t.payload);case bn:return Sn.set(e,t.payload);case vn:return xn.set(e,t.payload);case D.profile.constants.ProfileActions.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:i}=t.payload,o=(0,S.getAttributeSource)(a);if(e.entity&&r===e.entity.uri){const t=(0,_.lensPath)(["entity",o,n]);return(0,_.over)(t,(0,_.pipe)((0,_.defaultTo)([]),(0,_.concat)(_.__,i)),e)}return e}case D.search.constants.SEARCH_RESULTS_SET:if((0,S.isEmptyValue)(t.payload)){const t=xn.set(e,Tn.entity);return Sn.set(t,Tn.selectedEntityUri)}return e}return e},wn="BULK_UPDATE_SET_ACTIVE_STEP",An="BULK_UPDATE_INIT",Rn="BULK_UPDATE_TOGGLE_SELECTION_MODE",_n="BULK_UPDATE_SELECT_ENTITY",In="BULK_UPDATE_SELECT_ALL_ENTITIES_ON_PAGE",Nn="BULK_UPDATE_SET_LOADING",Pn="BULK_UPDATE_CHANGE_ROWS_PER_PAGE",Dn="BULK_UPDATE_CHANGE_PAGE",kn="BULK_UPDATE_CHANGE_SORT",Ln="BULK_UPDATE_CHANGE_COLUMNS",Un="BULK_UPDATE_UPDATE_ENTITIES",jn="BULK_UPDATE_SET_FILTER_TEXT",Fn="BULK_UPDATE_SET_TOTAL",Mn="UPDATE_BULK_UPDATE_CURRENT_ENTITIES",Vn="BULK_UPDATE_SET_OPERATION",Bn="BULK_UPDATE_SET_ACTION_ATTRIBUTE",zn="BULK_UPDATE_SET_ACTION_OPERATION",Hn="BULK_UPDATE_ADD_OPERATION_PARAMETERS",Yn="BULK_UPDATE_DELETE_ACTION",Wn="BULK_UPDATE_TOGGLE_CONDITIONS",Gn="BULK_UPDATE_ADD_CONDITION_AFTER",qn="BULK_UPDATE_CHANGE_CONDITION_DATA",Zn="BULK_UPDATE_TOGGLE_CONDITION_SELECT",$n="BULK_UPDATE_DELETE_CONDITION",Kn="BULK_UPDATE_SET_CONDITION_FILTER",Xn="BULK_UPDATE_SET_CONDITION_VALUES",Qn="BULK_UPDATE_TOGGLE_ACTION_PIN",Jn="BULK_UPDATE_TOGGLE_ACTION_ADD_NESTED",ea="BULK_UPDATE_CONFIRM",ta="BULK_UPDATE_SET_REQUEST_PENDING";var ra=r(39705);function na(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){aa(e,t,r[t])}))}return e}function aa(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ia={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},oa=(0,I.Ic)("activeStep"),la=(0,I.Ic)("operation"),sa=(0,I.Ic)("loading"),ca=(0,I.Ic)("requestPending"),ua=(0,I.ET)("objects","total"),pa=(0,I.ET)("objects","page"),da=(0,I.ET)("objects","rowsPerPage"),ma=(0,I.ET)("objects","selectionMode"),fa=(0,I.ET)("objects","entities"),ya=(0,I.ET)("objects","selectedEntities"),ga=(0,I.ET)("objects","filterText"),ha=e=>ma.get(e)===Z.v6.include,Ea=(0,I.ET)("objects","sortOrder"),ba=(0,I.ET)("objects","sortField"),va=(0,I.ET)("objects","selectedColumns"),Ta=["actions"],Oa=(0,I.ET)(...Ta),Sa=({groupId:e,state:t})=>{if(e){const r=Oa.get(t).findIndex((t=>t.id===e));if(-1!==r)return[...Ta,r,"actions"]}return Ta},xa=(e,t)=>({id:(0,Ge.x0)(),operation:e,operationParameters:t}),Ca=e=>((0,_.path)(["attributeTypeData","fieldName"],e)||"").split(".").slice(0,2).join("."),wa=(e,t)=>({id:(0,Ge.x0)(),fieldName:Ca(t),actions:[xa(e,t)]}),Aa=({state:e,id:t,groupId:r,operation:n,operationParameters:a,togglePin:i,toggleAddNested:o})=>{const l=Sa({state:e,groupId:r}),s=(0,I.ET)(...l).get(e),c=!r&&(0,_.prop)("attributeTypeData",a)&&(({attributeType:e,fieldName:t=""})=>(0,S.isComplexAttribute)(e)||t.split(".").length>2)(a.attributeTypeData);if(t){const r=s.findIndex((e=>e.id===t)),p=(0,I.ET)(...l,r),d=na({},p.get(e));if(n&&d.operation!==n){if(d.operationParameters){const e=[d.operation,n].includes(ra.d.RepointReference)?[]:Z.KJ[n];d.operationParameters=(0,_.omit)((0,_.without)(e,["attributeValue","attributeValueToFind"]),d.operationParameters)}d.operation=n}return a&&(d.operationParameters=(0,_.reject)(_.isNil,na({},d.operationParameters,a))),i&&(d.operationParameters=na({},d.operationParameters,{pin:!(0,_.path)(["operationParameters","pin"],d)})),o&&(d.operationParameters=na({},d.operationParameters,{addNestedAttribute:!(0,_.path)(["operationParameters","addNestedAttribute"],d)})),p.set(e,c?wa((u=d).operation,u.operationParameters):d)}{const t=(0,_.reject)(_.isNil,a),r=c?wa(n,t):xa(n,t);return(0,I.ET)(...l,s.length).set(e,r)}var u},Ra=xt(Ta),_a=Ct(Ra,"conditions"),Ia=wt(_a),Na=At(_a),Pa=Rt(Na),Da=_t(Na),ka=(e=ia,t)=>{switch(t.type){case wn:return oa.set(e,t.payload);case An:return na({},ia,{objects:na({},ia.objects,t.payload)});case Un:return fa.set(e,t.payload);case Rn:{const t=ma.set(e,ha(e)?Z.v6.exclude:Z.v6.include);return ya.set(t,[])}case _n:{const{uri:r,checked:n}=t.payload,a=ya.get(e),i=ha(e);return ya.set(e,!!n==!!i?(0,_.uniq)(a.concat(r)):(0,_.without)(r,a))}case In:{const r=t.payload,n=ha(e),a=ya.get(e),i=fa.get(e).map((0,_.prop)("uri"));return ya.set(e,!!r==!!n?(0,_.uniq)(a.concat(i)):(0,_.without)(i,a))}case Nn:return sa.set(e,t.payload);case Dn:return pa.set(e,t.payload);case Pn:{const r=pa.set(e,0);return da.set(r,t.payload)}case kn:{const{order:r,field:n}=t.payload,a=ba.set(e,n);return Ea.set(a,r)}case Ln:return va.set(e,t.payload);case Fn:return ua.set(e,t.payload);case jn:{const{filterText:r}=t.payload;return ga.set(e,r)}case Vn:return la.set(e,t.payload);case Bn:{const{id:r,groupId:n,attribute:a}=t.payload;return Aa({state:e,id:r,groupId:n,operationParameters:{attributeTypeData:a,attributeValue:null,attributeValueToFind:null,pin:null,addNestedAttribute:null}})}case zn:{const{id:r,groupId:n,operation:a}=t.payload;return Aa({state:e,id:r,groupId:n,operation:a})}case Hn:{const{id:r,groupId:n,operationParameters:a}=t.payload;return Aa({state:e,id:r,groupId:n,operationParameters:a})}case Qn:{const{id:r,groupId:n}=t.payload;return Aa({state:e,id:r,groupId:n,togglePin:!0})}case Jn:{const{id:r,groupId:n}=t.payload;return Aa({state:e,id:r,groupId:n,toggleAddNested:!0})}case Yn:{const{id:r,groupId:n}=t.payload,a=Sa({state:e,groupId:n}),i=(0,I.ET)(...a),o=i.get(e);return i.set(e,o.filter((e=>e.id!==r)))}case Wn:{const r=t.payload,n=Oa.get(e).findIndex((e=>e.id===r)),a=(0,I.ET)(...Ta,n),i=a.get(e);return a.set(e,i.conditions?(0,_.omit)(["conditions"],i):(0,_.assoc)("conditions",[],i))}case Gn:{const{groupId:r,attributeId:n,attribute:a}=t.payload;return It({state:e,groupId:r,attributeId:n,attribute:a,getAttributesLens:_a,getAttributeIndex:Ia})}case qn:{const{groupId:r,attributeId:n,attributeData:a}=t.payload;return Nt({state:e,groupId:r,attributeId:n,attributeData:a,setAttributeProp:Pa,getAttributeLens:Na})}case $n:{const{groupId:r,attributeId:n}=t.payload;return Dt({state:e,groupId:r,attributeId:n,getAttributesLens:_a})}case Kn:{const{groupId:r,attributeId:n,filter:a}=t.payload;return Lt({state:e,groupId:r,attributeId:n,filter:a,getAttributeProp:Da,setAttributeProp:Pa})}case Xn:{const{groupId:r,attributeId:n,values:a}=t.payload;return Ut({state:e,groupId:r,attributeId:n,values:a,setAttributeProp:Pa})}case ta:return ca.set(e,t.payload)}return e};var La=r(85383),Ua=r(82349),ja=r(12848),Fa=r(33192),Ma=r.n(Fa),Va=r(43717);const Ba=(e,t,r)=>{const n=za(t);if(n.length){const i=Ya(e,t,r),o=Ha(e,t,r),l=o.every((e=>(0,S.isTypeSearchGroupAttribute)({data:e})||i.some((0,_.eqProps)("fieldName",e)))),s=(0,S.areAllOperatorsAnd)(t),c=(0,S.areAllOperatorsAnd)(n),u=n.every((({filter:e,data:{attrType:t={}}})=>[S.FilterOptions.EQUALS,S.FilterOptions.IN_RANGE,S.FilterOptions.FULL_TEXT,S.FilterOptions.ON,S.FilterOptions.WITHIN].includes(e)||S.FilterOptions.EXISTS===e&&(0,S.isBooleanType)(t.type))),p=(a=n,!Object.values(a.reduce(((e,{data:{fieldName:t},filter:r,values:n})=>(r===S.FilterOptions.EQUALS&&(0,_.path)([0,"length"],n)&&(e[t]=e[t]&&e[t]+1||1),e)),{})).some((e=>e>1)));return o.length&&s&&c&&u&&n.every((e=>e.data.attrType.faceted))&&l&&p}var a;return!0},za=e=>e.flatMap((e=>e.attributes)).filter((0,_.has)("data")),Ha=(e,t,r)=>{const n=za(t).map((({data:{fieldName:e,entityTypeUri:t},filter:r,values:n})=>({entityTypeUri:t,fieldName:e,filter:r,values:n}))).reduce(((t,{entityTypeUri:n,fieldName:a,filter:i,values:o})=>{const{attrType:l}=n?(0,N.eC)(e,[n],[],r).find((e=>e.fieldName===a))||{}:(0,Va.zH)(a,r)||{},s=!(0,_.isNil)(l)&&l.faceted?((e,t,r,n)=>{if(![S.FilterOptions.EQUALS,S.FilterOptions.IN_RANGE].includes(t)&&![S.FilterOptions.ON,S.FilterOptions.WITHIN].includes(t)||!Array.isArray(e)||(0,S.isEmptyValue)(e[0]))return(0,S.isBooleanType)(n)&&t===S.FilterOptions.EXISTS?[!0,!1]:e&&!(0,S.isEmptyValue)(e[0])?[e[0]]:[];switch(r){case S.FACET_TYPES.NUMERIC_RANGE_FACET:return((e,t)=>{switch(t){case S.FilterOptions.EQUALS:return e.map((e=>[e,e]));case S.FilterOptions.IN_RANGE:return e.some(S.isEmptyValue)?[]:[e]}})(e[0],t);case S.FACET_TYPES.DATE_RANGE_FACET:return((e,t)=>{switch(t){case S.FilterOptions.ON:{const t=Ma()(e),r=!(0,S.isTimestampBasedType)(n);return[[S.utils.dates.getStartOfDay(t,r),S.utils.dates.getEndOfDay(t,r)]]}case S.FilterOptions.WITHIN:return(0,S.isDateRangeValue)(e)?[(0,S.getDateRangeByValue)(e)]:e.some(S.isEmptyValue)?[]:[e]}})(e[0],t);default:return e[0]}})(o,i,(0,S.getFacetTypeForAttrType)(l),l.type):o;return(0,_.isNil)(s)||(t[a]=(0,_.uniq)((t[a]||[]).concat(s))),t}),{}),a=Object.keys(n).map((e=>({fieldName:e,values:n[e]})));return a.some((({values:e})=>e&&Array.isArray(e[0])&&e.length>1))?[]:a},Ya=(e,t,r)=>{const n=(0,ft.VO)(t);return(0,N.eC)(e,n,[],r)},Wa=(e,t)=>({type:U.Z.UPDATE_ENTITIES,payload:{searchResults:e,entityTypeUri:t}}),Ga=({silent:e})=>({type:U.Z.CLEAR_ALL,payload:{silent:e}}),qa=({entityTypeUri:e,keywordValue:t})=>({type:U.Z.SHOW_MORE_RESULTS_FOR_ENTITY_TYPE,payload:{entityTypeUri:e,keywordValue:t}}),Za=e=>({type:U.Z.UPDATE_TOTAL,payload:e}),$a=e=>({type:U.Z.CHANGE_LOADING,payload:e}),Ka=(e,t=null,r=!1)=>({type:U.Z.MAP_CHANGE_VALUE,payload:{value:e,searchType:t,silent:r}}),Xa=(e,t)=>({type:L.k.CREATE_FACETS,payload:{facetsConfigs:e,addToEnd:t}}),Qa=e=>({type:L.k.DESTROY_FACETS,payload:e}),Ja=(e,t,r=!1)=>({type:L.k.CHANGE_VALUES,payload:{facetFieldName:e,values:t,silent:r}}),ei=e=>({type:L.k.UPDATE_DATA,payload:e}),ti=e=>({type:L.k.UPDATE_FILTERED_DATA,payload:e}),ri=({facetsToAdd:e,fieldNamesToDelete:t,changedEntityTypes:r,addToEnd:n})=>({type:L.k.HANDLE_CONFIGS_CHANGES,payload:{facetsToAdd:e,fieldNamesToDelete:t,changedEntityTypes:r,addToEnd:n}});var ni=r(5236),ai=r(54145),ii=r(55443),oi=r(65751),li=r.n(oi);const si=e=>{(0,ii.U)(e,{title:li().text("Server Error"),defaultMessage:li().text("Something went wrong...")})};var ci=r(21430);const ui=(e,t,r)=>`${e}/recommend/${r}/${t}`,pi=e=>e&&1===e.length?e[0]:null,di=e=>[e].filter((0,_.complement)(S.isComplexAttribute)).map((0,_.compose)(Ua.$9,(0,_.prop)("uri"))).concat((e.children||[]).map(di)).flat(1/0);function*mi(){const e=yield(0,La.RE)(Wl),t=yield(0,La.Ys)(k().selectors.getTenant),r=yield(0,La.Ys)(k().selectors.getEnvironment),n=((e,t,r,n,a)=>{const i=e.map((({fieldName:e,values:t})=>({fieldName:e,values:t.map((e=>Array.isArray(e)?JSON.stringify(e):e))}))),o={facets:(0,Ua._e)(i).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:ui(r,n,a),options:{method:"POST",body:JSON.stringify(o),headers:{"Content-Type":"application/json"}}}})(e,0,yield(0,La.Ys)(k().selectors.getServicesPath),t,r);let a;try{a=yield(0,La.RE)(S.rawRequest,n.url,n.options),a=a.filter((e=>"type"!==e)).slice(0,5)}catch(e){a=[]}const i=yield(0,La.Ys)(k().selectors.getMetadata),o=yield(0,La.Ys)(P.DX);a=((e,t=[],r)=>{const n=pi(r),a=n&&(0,S.getEntityType)(e,n),i=(0,ci.vf)(e,a||{}).map(di).flat(1/0);return t.filter((e=>n||!e.startsWith("attributes."))).filter((e=>!e.startsWith("attributes.")||i.includes(e)))})(i,a,o);const l=((e,t,r,n)=>{const a=e=>!t.includes(e);let i=[];const o=Math.max(0,5-t.length);if(o){const t=pi(n);if(t){const r=((0,S.getEntityType)(e,t).defaultFacetedAttributes||[]).map((r=>(0,S.findAttributeTypeByUri)(e,r,t))).filter((e=>e&&(0,S.isReadableAttribute)(e)&&!(0,S.isComplexAttribute)(e))).map((0,_.prop)("uri")).map(Ua.$9).filter(a);i=i.concat(r)}if(i.length<o){const e=(0,N.Xk)().map((e=>e.fieldName)).filter(a);i=i.concat(e)}}return i.slice(0,o)})(i,a,0,o);var s;a=a.concat(l),yield(0,La.gz)((s=a,{type:L.k.SET_RECOMMENDED_FACETS_LIST,payload:s}))}const fi=e=>({type:de,payload:e}),yi=e=>({type:me,payload:e}),gi=(e,t)=>({type:fe,payload:{show:e,postSavingAction:t}}),hi=e=>({type:ye,payload:e}),Ei=(e,t,r)=>({type:ve,payload:{entityTypeUri:e,columns:t,prevColumns:r}}),bi=(e,t=!1)=>({type:Te,payload:{entityTypeUri:e,silent:t}}),vi=e=>({type:Oe,payload:e}),Ti=()=>({type:Ce}),Oi=e=>({type:we,payload:e}),Si=e=>Oi({payload:{message:e,action:null},type:Z.GT.info}),xi=({message:e,actionLabel:t,actionToDispatch:r,autoHideDuration:n})=>Oi({payload:{message:e,action:{actionLabel:t,actionToDispatch:r},autoHideDuration:n},type:Z.GT.info}),Ci=e=>({type:Re,payload:e}),wi=e=>({type:ge,payload:e});var Ai=r(90503),Ri=r(82877);const _i=(e={},t="")=>Object.keys(e).filter((r=>S.utils.strings.search(r,t)||S.utils.strings.search(e[r].displayName,t))),Ii=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)}},Ni=(e,t)=>e===t,Pi=new class{constructor(){this.isLookupValueResolveTaskRunning=(0,_.curry)(((e,t)=>(0,_.hasPath)([e,t],this._lookupValuesResolveTasks))),this._lookupValuesResolveTasks=Object.create(null)}addTask(e,t){e.forEach((({type:e,codeValues:r})=>{!this._lookupValuesResolveTasks[e]&&(this._lookupValuesResolveTasks[e]={}),r.forEach((r=>{this._lookupValuesResolveTasks[e][r]=t}))}))}deleteTask(e){e.forEach((({type:e,codeValues:t})=>{this._lookupValuesResolveTasks[e]&&t.forEach((t=>{delete this._lookupValuesResolveTasks[e][t]})),(0,_.isEmpty)(this._lookupValuesResolveTasks[e])&&delete this._lookupValuesResolveTasks[e]}))}getRunningTasks(e){const t=e.flatMap((({type:e,codeValues:t})=>this._lookupValuesResolveTasks[e]?t.reduce(((t,r)=>{const n=this._lookupValuesResolveTasks[e][r];return n&&t.push(n),t}),[]):[]));return(0,_.uniqWith)(Ni,t)}clearTasks(){this._lookupValuesResolveTasks=Object.create(null)}};function*Di(e){const t=Pi.getRunningTasks(e);t.length>0&&(yield(0,La.v_)(t))}function*ki(e){try{const t=e.flatMap((({type:e,codeValues:t})=>t.map((t=>({type:e,codeValue:t}))))),r=yield(0,La.rM)(S.resolveLookupsList,t);Pi.addTask(e,r);const n=(yield(0,La.v_)(r)).reduce(((e,t)=>{const[r]=Object.keys(t),[n]=Object.keys(t[r]),a=(0,_.lensPath)([r,n]),i=(0,_.path)([r,n],t);return(0,_.set)(a,i,e)}),{});for(const e in n)yield(0,La.gz)(D.profile.lookups.actions.lookupsForTypeResolved({type:e,values:n[e]}))}catch(e){console.warn(e)}finally{Pi.deleteTask(e)}}function*Li(e){if((0,_.isEmpty)(e))return;const t=e.map((({type:e,codeValues:t})=>{const r=Pi.isLookupValueResolveTaskRunning(e);return{type:e,codeValues:t.filter((0,_.complement)(r))}})).filter((({codeValues:e})=>e.length>0));t.length>0&&(yield(0,La.RE)(ki,t)),yield(0,La.RE)(Di,e)}function*Ui(e,t,r=Z.cu,n=1){const a=!t&&1===n,i=`${e}${r}`,o=a&&Ii.getRunningTask(i);if(o)yield(0,La.v_)(o);else try{const o=yield(0,La.rM)(S.getDependentLookups,{type:e,displayNamePrefix:t,max:r,offset:r*(n-1)});a&&Ii.addTask(i,o);const l=yield(0,La.v_)(o);yield(0,La.gz)(D.profile.lookups.actions.lookupsForTypeResolved({type:e,values:l.codeValues[e]}))}catch(e){console.warn(e)}finally{a&&Ii.deleteTask(i)}}const ji=(e,t,r)=>e.slice((r-1)*t,t*r);function*Fi(e,t,r,n=1){const a=yield(0,La.Ys)(k().selectors.getLookups),i=_i(a[e],t);if(i.length>=r*n)return ji(i,r,n);yield(0,La.RE)(Ui,e,t,r,n);const o=yield(0,La.Ys)(k().selectors.getLookups);return ji(_i(o[e],t),r,n)}const Mi=(e,t)=>Object.keys(e).filter((e=>(0,ja.iL)(e,t))).reduce(((r,n)=>(r[(0,ja.iL)(n,t).fieldName]=e[n],r)),{});function Vi(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Bi(e,t,r[t])}))}return e}function Bi(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*zi(e,t,r){if((0,_.isEmpty)(e))return;const n=yield(0,La.Ys)(k().selectors.getLookups),a=yield(0,La.Ys)(k().selectors.getMetadata),i=Mi(r,e),o=yield(0,La.Ys)(Ri.Xf);yield(0,La.gz)(t((0,ja.HC)(a,i,e,n,{allowedEntityTypes:o})))}function*Hi(e,t,r){try{const n=yield(0,La.RE)(Nl,e.url,e.options),[a,i]=(0,_.partition)(N._H,t);yield(0,La.rM)(zi,i,r,n),yield(0,La.RE)($i,a,n),yield(0,La.RE)(zi,a,r,n)}catch(e){console.warn(e)}}function*Yi(e,t,r){e=Vi({},e,{includeFilter:[]});const n=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),a=(0,Ua.aw)([e],t,[e.fieldName],n);yield(0,La.RE)(Hi,a,[e],r)}const Wi=(e,t=[])=>t.filter((({label:t})=>S.utils.strings.search(t,e))),Gi=(e,t)=>Wi(t,e).map((0,_.prop)("value"));function*qi(e,t,r,n){const a=Vi({},e),i=[...t];if((0,N._H)(a)){const t=(0,S.getAttrTypeLookupCode)(e.attrType);a.includeFilter=yield(0,La.RE)(Fi,t,r,(0,_.propOr)(Z.cu,"pageSize",a),a.pageNumber)}else if("sourceSystems"===a.fieldName){const{sources:e}=yield(0,La.Ys)(k().selectors.getMetadata);a.includeFilter=((e,t)=>Wi(t,e).map((({uri:e})=>(0,S.getLastUriPart)(e))))(e,r)}else if((0,N.S9)(a)){const t=yield(0,La.Ys)(k().selectors.getMetadata),n=(0,S.getEntityType)(t,a.entityTypeUri)||{},i=(0,_.pipe)((0,_.propOr)([],"displayedItems"),(0,_.filter)((0,_.propEq)("isRaw",!0)))(e);a.includeFilter=[...(o=n.matchGroups,l=r,Wi(l,o).map((0,_.prop)("uri"))),...Gi(i,r)]}else a.disableIncludeFilter=!0,i.push({values:[r],fieldName:e.fieldName,filter:"containsWordStartingWith",forceInclude:!0});var o,l;const s=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),c=(0,Ua.aw)([a],i,[e.fieldName],s);yield(0,La.RE)(Zi,c,e,a.includeFilter,n)}function*Zi(e,t,r,n){try{const a=yield(0,La.RE)(Nl,e.url,e.options),i=yield(0,La.Ys)(k().selectors.getLookups),o=Mi(a,[t]);if(r){const e=t.fieldName;o[e]=(0,ja.AX)(o[e],r)}const l=yield(0,La.Ys)(k().selectors.getMetadata),s=yield(0,La.Ys)(Ri.Xf);yield(0,La.gz)(n((0,ja.HC)(l,o,[t],i,{allowedEntityTypes:s})))}catch(e){console.warn(e)}}function*$i(e,t){const r=yield(0,La.Ys)(k().selectors.getLookups),n=(0,ja.U4)(e,r),a=((e,t,r)=>{const n=((e,t)=>(0,_.pipe)(Object.entries,(0,_.reduce)(((e,[r,n])=>{const a=t.find((0,_.propEq)("fieldName",r));if(!a)return e;const{attrType:i}=a,o=(0,S.getAttrTypeLookupCode)(i);return e[o]={type:o,codeValues:(0,_.uniq)([...(0,_.pathOr)([],[o,"codeValues"],e),...Object.keys(n)])},e}),{}),_.values)(e))(e,t);return(0,S.getUnresolvedLookupsList)(r,n)})(t,e,r),i=(0,S.mergeLookupsLists)(n,a);i.length&&(yield(0,La.RE)(Li,i))}var Ki=r(59295);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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Ji(){const e=yield(0,La.Ys)(k().selectors.getMetadata),t=yield(0,La.Ys)(Ri.Xf),r=yield(0,La.Ys)(Ri.sl);return(0,Ai.wM)(e,t,r)}const eo=e=>({value:t})=>!e.length||e.includes(t);function*to(e){e=e||(yield(0,La.Ys)(ai.FR));const t=yield(0,La.Ys)(Ri.XM);if((0,Ai.gj)(t)){const t=yield(0,La.Ys)(k().selectors.getMetadata),r=yield(0,La.Ys)(Ki.V6),n=(0,N.$t)(t),a=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),i=(0,Ua.aw)([n],e,[n.fieldName],a),o=({type:e=[]})=>{const t=e.filter(eo(r));return vi(t)};yield(0,La.RE)(Hi,i,[n],o)}else yield(0,La.gz)(vi([]))}function*ro(){const e=yield(0,La.Ys)(k().selectors.getMetadata),t=yield(0,La.Ys)(Ri.Xf),r=yield(0,La.Ys)(Ki.V6);return(0,ja.wW)(e,{},t).filter(eo(r))}function*no(){const e=yield(0,La.Ys)(k().selectors.getMetadata),t=yield(0,La.RE)(Ji),r=yield(0,La.Ys)(Ri.uJ),n=(0,Ai.oX)().map((0,_.prop)("id")),a=(0,_.pipe)((0,_.map)((0,_.filter)((0,_.pipe)((0,_.prop)("id"),(0,_.cond)([[(0,_.includes)("."),_.T],[(0,_.includes)(_.__,n),_.T],[_.T,_.F]])))),_.toPairs,(0,_.map)((([t,r])=>[t,(0,Ai.Wh)(e,t,(0,_.map)((0,_.prop)("id"),r)).map(((e,t)=>{const n=r.find((0,_.propEq)("id",e.id)),{size:a,autoResize:i=0!==t&&!a}=n||{};return(0,_.reject)(_.isNil,Xi({},e,{size:a,autoResize:i}))}))])),_.fromPairs)(r),i=!(0,_.equals)(r,a),o=Object.keys(t),l=Object.keys(a);var s;!i&&(0,_.equals)(new Set(o),new Set(l))||(yield(0,La.gz)((s=Xi({},t,(0,_.pick)(o,a)),{type:be,payload:s})))}function*ao(){const e=yield(0,La.Ys)(k().selectors.getMetadata),t=yield(0,La.Ys)(P.DX),r=(yield(0,La.Ys)(Ri.IJ))?yield(0,La.RE)(ro):yield(0,La.RE)(rs),n=(0,Ai.nx)(e,r,t).map((0,_.prop)("value")),a=yield(0,La.Ys)(Ri.o4);n.includes(a)||(yield(0,La.gz)(bi(n[0],!0)))}function*io(e={}){const{silent:t}=e.payload||{};if(!t){const e=yield(0,La.Ys)(Ri.tB),t=yield(0,La.Ys)(ai.t9);if((0,S.isAvailableEntityTypeForDataTenant)(t,e)){const t=yield(0,La.Ys)(ai.BP,{entityTypeUri:e});(0,_.isNil)(t)&&(yield(0,La.gz)({type:U.Z.REFRESH_DISPLAYED_ENTITIES}))}else yield(0,La.gz)(Wa([],e))}}function*oo(e){const t=e.payload;yield(0,La.RE)(io,e);const r=yield(0,La.Ys)(Ri.gu);if((0,Ai.gj)(t)&&0===r.length){const e=yield(0,La.RE)(ro);yield(0,La.gz)(vi(e)),yield(0,La.RE)(to)}}function*lo(){const e=yield(0,La.Ys)(Ri.qx),t=yield(0,La.Ys)(ai.Qy);e!==Z.om.MAP&&t.length&&(yield(0,La.gz)(Ka(null)))}function*so(e){const t=(0,S.removeDtssPrefixFromEntityUri)(e.payload.uri),r=yield(0,La.Ys)(Ri.tB),n=((yield(0,La.Ys)(ai.BP,{entityTypeUri:r}))||[]).map((0,_.prop)("uri")),a=(yield(0,La.Ys)(ai.fx,{entityTypeUri:r}))||0,i=(yield(0,La.Ys)(ai.Uz,{entityTypeUri:r}))||Z.Tu[0],o=n.indexOf(t)+a*i,l=yield(0,La.Ys)(ai.NU,{entityTypeUri:r}),s=yield(0,La.Ys)(k().selectors.getTenant),c=yield(0,La.Ys)(ai.lF);yield(0,La.gz)(D.search.actions.setSearchNavigationData({uri:t,index:o,total:l,tenant:c||s,cache:n}))}const co=[function*(){yield(0,La.Fm)(Te,io)},function*(){yield(0,La.Fm)(Ae,oo)},function*(){yield(0,La.Fm)([qe,Ze,Ke],ao)},function*(){yield(0,La.Fm)(Re,lo)},function*(){yield(0,La.Fm)(D.ui.constants.UIActions.OPEN_ENTITY,so)}],uo=e=>({type:rr,payload:e}),po=e=>({type:nr,payload:e}),mo=()=>({type:fr}),fo=e=>({type:Cr,payload:e}),yo=e=>({type:wr,payload:e}),go=(e,t)=>({type:_r,payload:{uri:e,isLoading:t}});var ho=r(90533),Eo=r(86374),bo=r(4898);function vo(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){To(e,t,r[t])}))}return e}function To(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Oo(){yield(0,La.gz)(yo(!0));try{const t=yield(0,La.Ys)(k().selectors.getUserName),r=e=>vo({},e,{isOwnSearch:t===e.owner}),n=yield(0,La.RE)(So),{result:a=[],total:i}=yield(0,La.RE)(S.getSavedSearches,n);yield(0,La.gz)((e=>({type:or,payload:e}))(i));const o=yield(0,La.Ys)(k().selectors.getMetadata),l=yield(0,La.Ys)(k().selectors.getDataTenants),s=yield(0,La.Ys)(k().selectors.getCanUserReadWorkflowDataTask);yield(0,La.gz)((e=a.map(r).map((0,Eo.z7)(o,l,s)),{type:lr,payload:e})),yield(0,La.gz)(yo(!1)),yield(0,La.RE)(wo,a)}catch(e){yield(0,La.gz)(yo(!1))}var e}function*So(){const e=yield(0,La.Ys)(ho.s6),t=yield(0,La.Ys)(ho.wH),r=yield(0,La.Ys)(ho.U3),n=yield(0,La.Ys)(ho.VS),a=yield(0,La.Ys)(ho.kU),{field:i,order:o}=yield(0,La.Ys)(ho.rT);return{offset:e*t,max:e,containsWordStartingWith:r,favoriteOnly:n,findPublic:a,countResults:!1,sortBy:Z.PW[i],sortOrder:o}}function*xo(e){const t=yield(0,La.Ys)(ho.EH,e.payload);yield(0,La.RE)(Co,t)}function*Co(e,t){yield(0,La.gz)(go(e.uri,!0));try{const{total:r}=yield(0,La.RE)(S.getTotalsForQuery,(0,S.replacePlaceholdersInQuery)(e.query),Boolean(t));yield(0,La.gz)(((e,t)=>({type:sr,payload:{uri:e,total:t}}))(e.uri,r))}catch(e){si(e)}yield(0,La.gz)(go(e.uri,!1))}function*wo(e){const t=yield(0,La.Ys)(k().selectors.getQueryEstimatorEnabled);return yield(0,La.$6)(e.map((e=>(0,La.RE)(Co,e,t))))}function*Ao(e){const{uri:t,isPublic:r}=e.payload,n=yield(0,La.Ys)(ho.EH,t);if(n){yield(0,La.gz)(yo(!0));try{yield(0,La.RE)(S.markSavedSearchAsPublic,(0,Eo.Tp)(n),r),yield(0,La.gz)(((e,t)=>({type:gr,payload:{uri:e,isPublic:t}}))(t,r))}catch(e){si(e)}yield(0,La.gz)(yo(!1))}}function*Ro(e){const{uri:t,isFavorite:r}=e.payload,n=yield(0,La.Ys)(ho.EH,t);if(n){yield(0,La.gz)(yo(!0));try{yield(0,La.RE)(S.markSavedSearchAsFavorite,(0,Eo.Tp)(n),r),yield(0,La.gz)(((e,t)=>({type:Er,payload:{uri:e,isFavorite:t}}))(t,r))}catch(e){si(e)}yield(0,La.gz)(yo(!1))}}function*_o(e){const{uri:t,isGlobalFilter:r}=e.payload,n=yield(0,La.Ys)(ho.EH,t);if(n){const e=(0,Eo.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["uiState"]);(0,S.isObject)("2.0"===t.version?t:t.state)||!r?yield(0,La.gz)(((e,t)=>({type:"SAVED_SEARCHES_MARK_GLOBAL_FILTER",payload:{savedSearch:e,isGlobalFilter:t}}))(vo({},a,{uiState:t,query:(0,S.replacePlaceholdersInQuery)((0,_.propOr)("","query",a))}),r)):(0,ii.U)({errorMessage:"Saved Search is incorrect"},{title:li().text("Saved Search can't be mark as global")})}}function*Io(e){const{uri:t,name:r}=e.payload,n=yield(0,La.Ys)(ho.EH,t);if(n&&r!==n.name){yield(0,La.gz)(yo(!0));try{yield(0,La.RE)(S.updateSavedSearch,vo({},(0,Eo.Tp)(n),{name:r})),yield(0,La.gz)(((e,t)=>({type:Tr,payload:{uri:e,name:t}}))(t,r))}catch(e){si(e)}yield(0,La.gz)(yo(!1))}}function*No(){const e=yield(0,La.Ys)(ho.Kh);yield(0,La.gz)(yo(!0));try{yield(0,La.$6)(e.map((e=>(0,La.RE)(S.deleteSavedSearch,e)))),yield(0,La.gz)(fo(e.map((0,_.prop)("uri"))))}catch(e){si(e)}yield(0,La.gz)(yo(!1))}function*Po(e){const t=e.payload;yield(0,La.gz)(yo(!0));try{yield(0,La.RE)(S.deleteSavedSearch,{uri:t}),yield(0,La.gz)(fo([t]))}catch(e){si(e)}yield(0,La.gz)(yo(!1))}function*Do(e=!1,t=!1){return{query:yield(0,La.Ys)(ho.Cc,e),uiState:yield(0,La.Ys)(bo.Z,t)}}function*ko({payload:{name:e,share:t}}){const{query:r,uiState:n}=yield(0,La.RE)(Do,!0),a={isFavorite:!1,isPublic:t===Z.ib.public,name:e,query:r,uiState:n},i=yield(0,La.Ys)(ho.tp);yield(0,La.gz)(gi(!1));try{yield(0,La.gz)(Si(li().text("Saving search...")));const e=yield(0,La.RE)(S.createSavedSearch,[a]);e[0].successful?(yield(0,La.gz)(uo(e[0].object)),yield(0,La.gz)(po(!1)),yield(0,La.gz)(Si(li().text("Search saved successfully"))),i&&(yield(0,La.gz)(i))):si(e)}catch(e){si(e)}}function*Lo(e){const{uri:t,debounceTime:r}=e.payload;yield(0,La.gz)(yi(!1));const n=yield(0,La.Ys)(ho.EH,t),a=(0,ho.In)(n)||{},{errors:i}=a;i&&i.length?((e=[])=>{(0,ii.U)(e,{message:li().text("Saved Search can't be applied")})})(i):(yield(0,La.gz)(uo(n)),(yield(0,La.Ys)(ai.lF))&&(a.currentTenant=yield(0,La.Ys)(k().selectors.getTenant)),yield(0,La.gz)(D.search.actions.updateState(vo({},a,{debounceTime:r}))),yield(0,La.qn)(U.Z.STATE_UPDATED))}const Uo=[function*(){yield(0,La.Fm)([ir,cr,ur,Ar,pr,Nr],Oo)},function*(){const e={[yr]:Ao,[hr]:Ro,[xr]:Po,[Sr]:No,[vr]:Io,[br]:_o},t=yield(0,La.ZO)(Object.keys(e));for(;;){const r=yield(0,La.qn)(t);yield(0,La.RE)(e[r.type],r)}},function*(){yield(0,La.Fm)([tr],ko)},function*(){yield(0,La.Fm)([Rr],Lo)},function*(){yield(0,La.ib)([Ir],xo)}];function*jo(e){try{yield(0,La.RE)(S.createActivity,{label:S.ACTIVITY_TYPES.userSearch,description:JSON.stringify({activity:e,version:"2.0"})})}catch(e){console.warn(e)}}const Fo=e=>({type:Ze,payload:{groupId:e}}),Mo=(e,t)=>({type:Je,payload:{groupId:e,attributeId:t,attribute:vt()}}),Vo=(e,t,r)=>({type:Je,payload:{groupId:e,attributeId:t,attribute:Tt(r)}}),Bo=(e,t,r)=>({type:et,payload:{groupId:e,attributeId:t,attributeData:Ot(r)}}),zo=(e,t)=>({type:et,payload:{groupId:e,attributeId:t,attributeData:null}}),Ho=(e,t,r)=>({type:tt,payload:{groupId:e,attributeId:t,selectInfo:r}}),Yo=(e,t,r)=>({type:rt,payload:{groupId:e,attributeId:t,operator:r}}),Wo=(e,t)=>({type:nt,payload:{groupId:e,attributeId:t}}),Go=(e,t)=>({type:at,payload:{groupId:e,attributeId:t}}),qo=(e,t)=>({type:it,payload:{groupId:e,attributeId:t,id:(0,Ge.x0)()}}),Zo=(e,t,r)=>({type:ot,payload:{groupId:e,attributeId:t,filter:r}}),$o=(e,t,r)=>({type:lt,payload:{groupId:e,attributeId:t,values:r}}),Ko=(e,{attribute:t,value:r,debounceTime:n=0,pageNumber:a=1,currentOptions:i})=>({type:ct,payload:{groupId:e,attribute:t,value:r,debounceTime:n,pageNumber:a,currentOptions:i}}),Xo=(e,t,r)=>({type:ut,payload:{groupId:e,attributeId:t,values:r}}),Qo=(e,t)=>({type:pt,payload:{groupId:e,attribute:t}});var Jo=r(44006);function*el({groups:e,findGroupPath:t=St,attributesPropName:r,groupId:n,attributeId:a,selectInfo:i,actions:o}){const{checked:l,attribute:s,index:c,selectedAttributes:u}=i,{addAttributeAfter:p,changeAttribute:d,clearAttribute:m,deleteAttribute:f}=o,y=(0,_.pipe)(t(n),(0,_.path)(_.__,e),(0,_.propOr)([],r))(e),g=e=>(0,_.path)([e,"id"],y),h=y.findIndex((0,_.propEq)("id",a));if(a&&0===c)if(l)yield(0,La.gz)(d(n,a,s));else{let e=u[c+1];e?(yield(0,La.gz)(d(n,a,e)),yield(0,La.gz)(f(n,g(h+1)))):yield(0,La.gz)(m(n,a))}else{const e=u.length-c,t=a?h+c:y.length-e;l?yield(0,La.gz)(p(n,g(t-1),s)):yield(0,La.gz)(f(n,g(t)))}}function tl(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){rl(e,t,r[t])}))}return e}function rl(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*nl(e){const{groupId:t,attributeId:r,selectInfo:n}=e.payload,a=yield(0,La.Ys)(Ki.go),i={addAttributeAfter:Vo,changeAttribute:Bo,clearAttribute:zo,deleteAttribute:Wo};yield(0,La.RE)(el,{groups:a,attributesPropName:"attributes",groupId:t,attributeId:r,selectInfo:n,actions:i}),yield(0,La.gz)(Fo(t))}function*al(e){const{attribute:t,groupId:r}=e.payload,n=yield(0,La.Ys)(Ki._7,r),a=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),{data:{fieldName:i},values:o}=t,l=yield(0,La.Ys)(ai.L7,n,i),s=tl({},t.data,{values:o?(0,_.flatten)(o):void 0,pageSize:t.data.pageSize+1}),c=(0,Ua.aw)([s],l,[],a);yield(0,La.RE)(Hi,c,[s],(e=>((e,t,r)=>({type:st,payload:{groupId:e,attributeId:t,values:r}}))(r,t.id,e[i])))}function*il(e){const{attribute:t,value:r,pageNumber:n=1,debounceTime:a,groupId:i,currentOptions:o=[]}=e.payload,{entityTypeUri:l,fieldName:s}=t.data;if(""===r&&1===n)yield(0,La.gz)(Xo(i,t.id,void 0));else{a&&(yield(0,La.gw)(a));const e=yield(0,La.Ys)(Ki.ad,i,t.id),c=e=>Xo(i,t.id,o.concat(e[s]));if(r){const a=l?[{values:[l],fieldName:"type",filter:"equals"}]:[],i=yield(0,La.Ys)(ai.L7,a,s);yield(0,La.rM)(qi,tl({},t.data,{displayedItems:e,pageNumber:n,pageSize:t.data.pageSize+1}),i,r,c)}else{const r=yield(0,La.Ys)(Ki._7,i),a=yield(0,La.Ys)(ai.L7,r,s);yield(0,La.rM)(Yi,tl({},t.data,{displayedItems:e,pageNumber:n,pageSize:t.data.pageSize+1}),a,c)}}}function*ol(){const e=yield(0,La.Ys)(k().selectors.getSearchKeyword),t=yield(0,La.Ys)(ai.vH),r=yield(0,La.RE)(Wl),n=yield(0,La.Ys)(k().selectors.getMetadata),a=yield(0,La.Ys)(k().selectors.getDataTenants),i=(0,Jo.h)(n,a,r);yield(0,La.gz)(D.search.actions.updateState({advanced:i,keyword:e,map:t}))}function*ll(e){const{groupId:t,attributeId:r}=e.payload;yield(0,La.gz)(Wo(t,r)),yield(0,La.gz)(Fo(t))}function*sl(){if(yield(0,La.Ys)(Ri.IJ)){const e=yield(0,La.Ys)(Ki.go),t=yield(0,La.Ys)(Ri.Xf);for(const r of e){const e=r.entityTypes||[];if((t?e.filter((e=>t.includes(e))):e).length!==e.length){yield(0,La.gz)(Ga({silent:!0}));break}}}}const cl=[function*(){yield(0,La.ib)([tt],nl)},function*(){yield(0,La.Fm)([ct],il)},function*(){yield(0,La.ib)(mt,ol)},function*(){yield(0,La.ib)(pt,al)},function*(){yield(0,La.ib)([at],ll)}];function ul(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){pl(e,t,r[t])}))}return e}function pl(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*dl(){const e=yield(0,La.Ys)(ai.FR);yield(0,La.RE)(fl);const t=yield(0,La.Ys)(Ri.tB);var r;yield(0,La.gz)((r=t,{type:U.Z.RESET_PAGE,payload:{entityTypeUri:r}})),yield(0,La.rM)(Gl,e),yield(0,La.rM)(Tl,e),(yield(0,La.Ys)(Ri.IJ))?yield(0,La.rM)(to,e):yield(0,La.rM)(mi)}function*ml(e){const{debounceTime:t}=e.payload||{};t&&(yield(0,La.gw)(t));const r=yield(0,La.Ys)(ai.FR);yield(0,La.rM)(yl,r)}function*fl(){const e=yield(0,La.Ys)(Ri.tB);var t;yield(0,La.gz)((t=e,{type:U.Z.CLEAR_RESULTS,payload:t}))}function*yl(e){const t=yield(0,La.Ys)(k().selectors.getMetadata),r=yield(0,La.Ys)(Ri.tB),n=yield(0,La.Ys)(ai.fx,{entityTypeUri:r}),a=yield(0,La.Ys)(ai.Uz,{entityTypeUri:r}),i=yield(0,La.Ys)(ai.L9,{entityTypeUri:r}),o=yield(0,La.Ys)(ai.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,La.RE)(vl,r);c=(0,_.uniq)(c.concat(a).concat((0,Ua.kx)(t,s,[Ua.cI]))),l=!0}else c=(0,_.uniq)(c.concat((0,Ua.kx)(t,s,[Ua.Bo,Ua.cI]))),l=!1;const u=ul({page:n,rowsPerPage:a,sortOrder:i,sortField:o,forceOvOnly:l},yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),{select:c}),p=(0,Ua.XP)(s,u),d=yield(0,La.Ys)(ai.lF);yield(0,La.gz)($a(!0));try{let e;if(d){const t=(0,Ua.kH)(s,u);e=yield(0,La.RE)(Nl,t)}else{const t=(0,Ua.Lv)(s,u);e=yield(0,La.RE)(Nl,Z.NV,t)}Array.isArray(e)||(e=[]),yield(0,La.RE)(gl,(0,_.reject)(_.isNil,{query:p,sortField:o,sortOrder:i,dataTenant:d})),e=yield(0,La.RE)(Il,e),yield(0,La.gz)(Wa(e,r))}catch(e){yield(0,La.gz)(Wa([],r))}yield(0,La.gz)($a(!1))}function*gl(e){var t;yield(0,La.gz)((t=e.query,{type:U.Z.UPDATE_URL,payload:t}));const r=yield(0,La.Ys)(k().selectors.getSearchProviderData);(0,_.equals)(null==r?void 0:r.data,e)||(yield(0,La.gz)(D.search.actions.setSearchNavigationData(null))),yield(0,La.gz)(D.search.actions.setSearchProviderData({type:"search",data:e}))}function*hl(e){const{columns:t,prevColumns:r}=e.payload;if((0,Ai.tU)(t,r)){const e=yield(0,La.Ys)(Ri.o4),t=(yield(0,La.Ys)(ai.BP,{entityTypeUri:e})).map((e=>e.uri)),r=yield(0,La.RE)(vl,e),n=yield(0,La.Ys)(ai.FR),a=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),i=(0,Ua.aG)(t,n,ul({select:r},a));yield(0,La.gz)($a(!0));try{let t=yield(0,La.RE)(Nl,i.url,i.options);t=yield(0,La.RE)(Il,t),yield(0,La.gz)(Wa(t,e))}catch(t){yield(0,La.gz)(Wa([],e)),si(t)}yield(0,La.gz)($a(!1))}}function*El(){const e=yield(0,La.Ys)(Ri.tB),t=yield(0,La.Ys)(ai.BP,{entityTypeUri:e});t&&(yield(0,La.gz)(D.search.actions.searchResultsSet(t)))}function*bl(e){const{entityTypeUri:t,keywordValue:r}=e.payload;yield(0,La.gz)(((e=!1)=>({type:L.k.CLEAR_ALL_VALUES,payload:{silent:e}}))(!0)),yield(0,La.gz)(Ja("type",[t],!0)),yield(0,La.gz)(D.search.actions.keywordUpdated({value:r,isRawFilter:!1}))}function*vl(e){const t=yield(0,La.Ys)(Ri.Gv,e);return(0,Ai.vw)(t)}function*Tl(e){const t=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),r=(0,Ua.Vg)(e,[],t);try{const e=yield(0,La.RE)(Nl,Z.jS,{method:"POST",body:JSON.stringify(r)});yield(0,La.gz)(Za(e.total))}catch(e){yield(0,La.gz)(Za(0))}}function*Ol(){yield(0,La.RE)(xl);const e=yield(0,La.RE)(Do,!0);(0,_.isEmpty)(e.query)||(yield(0,La.RE)(jo,e))}const Sl=[st];function*xl(){for(;yield(0,La.Ys)(Ki.UM);)yield(0,La.qn)(Sl)}function*Cl(e){const{debounceTime:t}=e.payload||{};t&&(yield(0,La.gw)(t)),(0,ja.$L)(e)&&(yield(0,La.RE)(Ql)),(0,_.pathOr)(!1,["payload","silent"],e)||(yield(0,La.RE)(dl),yield(0,La.RE)(Ol))}function*wl(e){var t;const r=(0,_.path)(["payload","searchOptions"],e),n=(0,_.path)(["payload","errors"],e),a=(0,_.pathOr)(0,["payload","debounceTime"],e);n&&n.length&&((e=[])=>{(0,ii.U)(e,{message:li().text("Can't apply search state")})})(n),!(null!==(t=yield(0,La.Ys)(k().selectors.getShowSearchByOv))&&void 0!==t?t:yield(0,La.Ys)(Ri.cC))&&r&&r.searchByOv&&(yield(0,La.gz)(D.search.actions.updateSearchOptions({searchByOv:!1,ovOnly:!1}))),yield(0,La.RE)(ts),yield(0,La.RE)(sl),yield(0,La.RE)(no),yield(0,La.RE)(ao),yield(0,La.RE)(Al),yield(0,La.gz)(((e=0)=>({type:U.Z.STATE_UPDATED,payload:{debounceTime:e}}))(a))}function*Al(){const e=yield(0,La.Ys)(Ri.d7),t=yield(0,La.Ys)(ai.Qy);!e&&t.length&&(yield(0,La.gz)(Ka(null,null,!0)))}function*Rl(){const e=yield(0,La.Ys)(ai.A7),{activityFilter:t,globalFilter:r}=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),n=yield(0,La.Ys)(k().selectors.getSearchOptions),a=n&&n.searchByOv,i=[(0,Ua.s4)(e,[],{globalFilter:r})];a&&i.push("options=searchByOv"),t&&i.push(`activeness=${t}`);const o=i.filter(_.identity).join("&"),l=new URLSearchParams(o);if(yield(0,La.Ys)(k().selectors.getSharedPreferencesEnabled)){const e=yield(0,La.Ys)(k().selectors.getServicesPath),t=yield(0,La.Ys)(k().selectors.getTenant),r=yield(0,La.Ys)(k().selectors.getEnvironment),n=yield(0,La.Ys)(k().selectors.getUserName),a=yield(0,La.Ys)(Ri.XM),i=yield(0,La.Ys)(Ri.uJ),o=(0,_.pipe)((0,_.map)((0,_.pipe)((0,_.map)((0,_.path)(["attrType","uri"])),(0,_.reject)(S.isEmptyValue))),(0,_.reject)(_.isEmpty)),s="searchExportData",c={name:s,tenant:t,environment:r,user:n,servicesPath:e,value:{searchResultsColumnsUris:(0,Ai.gj)(a)?o(i):void 0}};try{yield(0,La.RE)(S.setSharedPreferences,c),l.set("sharedPreferenceName",s)}catch(e){si(e)}}yield(0,La.gz)(D.ui.actions.openConsoleApp("Export","entities",l.toString()))}function*_l(){yield(0,La.gz)(D.ui.actions.openConsoleApp("Data Loader","projects"))}function*Il(e){const t=yield(0,La.Ys)(ai.lF);return e&&t?e.map((0,S.enrichEntityWithDataTenant)(t)):e}function*Nl(e,t){const r=yield(0,La.Ys)(k().selectors.getTenant),n=yield(0,La.Ys)(ai.lF),a=yield(0,La.Ys)(k().selectors.getDtssPath);return yield(0,La.RE)(Ua.Es,{url:e,options:t,customerTenant:r,dataTenant:n,dtssPath:a})}const Pl=[L.k.CHANGE_VALUES,D.search.constants.KEYWORD_UPDATED,U.Z.REFRESH,L.k.CLEAR_ALL_VALUES,U.Z.MAP_CHANGE_VALUE,U.Z.CLEAR_ALL,U.Z.STATE_UPDATED,dt,D.search.constants.SEARCH_OPTIONS_UPDATED,D.search.constants.ACTIVITY_FILTER_UPDATED,D.search.constants.GLOBAL_FILTER_UPDATED,U.Z.CHANGE_CURRENT_TENANT],Dl=[function*(){yield(0,La.Fm)(Pl,Cl)},function*(){yield(0,La.Fm)([U.Z.CHANGE_PAGE,U.Z.RESET_PAGE,U.Z.CHANGE_ROWS_PER_PAGE,U.Z.REFRESH_DISPLAYED_ENTITIES,U.Z.CHANGE_SORT],ml)},function*(){yield(0,La.Fm)(ve,hl)},function*(){yield(0,La.Fm)([U.Z.UPDATE_ENTITIES,Te,Ae],El)},function*(){yield(0,La.Fm)(U.Z.SHOW_MORE_RESULTS_FOR_ENTITY_TYPE,bl)},function*(){yield(0,La.Fm)(D.search.constants.UPDATE_STATE,wl)},function*(){yield(0,La.Fm)(U.Z.EXPORT_RESULTS,Rl)},function*(){yield(0,La.Fm)(U.Z.OPEN_DATA_LOADER,_l)}];var kl=r(56906);function Ll(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Ul(e,t){try{const[r,n]=yield(0,La.RE)(jl,e,[]);if((0,_.isNil)(r)||(0,_.isNil)(n))yield(0,La.gz)(ei({[e.fieldName]:[]}));else{const[a,i]=(0,ja.dG)(e.type),o=(0,ja.q7)(a,r),l=(0,ja.q7)(i,n),s=(0,ni.Oz)(e.attrType&&e.attrType.type),[c,u]=s.greaterThan(o,l)?[l,o]:[o,l],p=yield(0,La.RE)(Fl,e,c,u,t),d={[e.fieldName]:p};yield(0,La.gz)(ei(d))}}catch(e){console.warn(e)}}function*jl(e,t){const r=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),n=(0,Ua.rN)(e,t,[e.fieldName],r),a=yield(0,La.RE)(Nl,n.url,n.options),i=Mi(a,[e]),{min:o,max:l,count:s}=(0,ja.Kn)(i,[e])[e.fieldName];return s?[(0,N.bB)(e)?0:o,l]:[]}function*Fl(e,t,r,n){const a=e.attrType&&e.attrType.type,i=(0,kl.C)(a),o=i.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Ll(e,t,r[t])}))}return e}({interval:o,offset:t},yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions)),s=(0,Ua.ti)(e,n,[e.fieldName],l),c=yield(0,La.RE)(Nl,s.url,s.options),u=yield(0,La.Ys)(k().selectors.getMetadata),p=Mi(c,[e]),d=(0,ja.HC)(u,p,[e]);return i.addRanges(d[e.fieldName],t,r,o).map(((e,t,n)=>({value:[e.value,t<n.length-1?n[t+1].value:r],number:e.number})))}function Ml(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vl={matches:Ua.dW,"dtPotentialMatches.matches":Ua.dW,"potentialMatches.matchScore":Ua._9};function*Bl(e,t){try{const[r,n]=yield(0,La.RE)(jl,e,[]);if((0,_.isNil)(r)||(0,_.isNil)(n))yield(0,La.gz)(ei({[e.fieldName]:[]}));else{const[a,i]=(0,ja.dG)(e.type),o=(0,ja.q7)(a,r),l=(0,ja.q7)(i,n),s=yield(0,La.RE)(zl,e,o,l,t),c={[e.fieldName]:s};yield(0,La.gz)(ei(c))}}catch(e){console.warn(e)}}function*zl(e,t,r,n){const a=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),i=Math.min(5,r-t+1),o=yield(0,La.RE)(S.rawRequest,Vl[e.fieldNameForRequest||e.fieldName](t,r,i,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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Ml(e,t,r[t])}))}return e}({},a,{dataTenant:e.dataTenant})));return o.map((e=>({number:e.count,value:[e.from,e.to]})))}function Hl(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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Wl(){const e=yield(0,La.Ys)(P.X0),t=yield(0,La.Ys)(P.Mp);return Object.values((0,ja.t8)(e,t))}function*Gl(e){const t=yield(0,La.RE)(Wl),[r,n]=(0,_.partition)(N.bB,t);let[a,i]=(0,_.partition)(S.isRangeFacet,n);for(let t=0;t<r.length;t++)yield(0,La.rM)(Bl,r[t],e);for(let t=0;t<a.length;t++)yield(0,La.rM)(Ul,a[t],e);const[o,l]=(0,_.partition)((e=>e.values&&e.values.length),i);for(let t=0;t<o.length;t++)yield(0,La.rM)(Zl,o[t],e);const[s,c]=(0,_.partition)(N.DT,l);for(const t of s)yield(0,La.rM)($l,[t],e);c.length&&(yield(0,La.rM)($l,c,e))}function*ql(e){const t=yield(0,La.Ys)(ai.FR),[r,n]=(0,_.partition)(N.bB,e.payload),[a,i]=(0,_.partition)(S.isRangeFacet,n),[o,l]=(0,_.partition)(N.DT,i);for(let e=0;e<r.length;e++)yield(0,La.rM)(Bl,r[e],t);for(let e=0;e<a.length;e++)yield(0,La.rM)(Ul,a[e],t);for(const e of o)yield(0,La.rM)($l,[e],t);l.length&&(yield(0,La.rM)($l,l,t))}function*Zl(e,t,r){const n=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),a=(0,Ua.aw)([Hl({},e,{pageSize:e.pageSize+1})],t,[e.fieldName],n,r);yield(0,La.RE)(Kl,a,[e])}function*$l(e,t,r){const n=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),a=(0,Ua.aw)(e.map((e=>Hl({},e,{pageSize:e.pageSize+1}))),t,[],n,r);yield(0,La.RE)(Kl,a,e)}function*Kl(e,t){yield(0,La.RE)(Hi,e,t,ei)}function*Xl(e){const{facetFieldName:t,value:r,debounceTime:n,pageNumber:a=1,currentOptions:i=[]}=e.payload;if(""===r&&1===a)yield(0,La.gz)((e=>({type:L.k.DESTROY_FILTERED_DATA,payload:e}))(t));else{const e=yield(0,La.Ys)(P.X0),o=yield(0,La.Ys)(P.Mp),l=Hl({},(0,ja.t8)(e,o)[t]);if("type"===t){const e={[t]:[...l.data.filter((e=>e.label.toLowerCase().includes(r.toLowerCase())))]};yield(0,La.gz)(ti(e))}else{n&&(yield(0,La.gw)(n));const e=yield(0,La.Ys)(ai.FR),o=yield(0,La.Ys)(P.rM,t),s=e=>ti({[t]:i.concat(e[t])});r?yield(0,La.rM)(qi,Hl({},l,{displayedItems:o,pageNumber:a,pageSize:l.pageSize+1}),e,r,s):yield(0,La.rM)(Yi,Hl({},l,{pageNumber:a,pageSize:l.pageSize+1}),e,s)}}}function*Ql(){const e=yield(0,La.Ys)(P.DX),t=t=>t.entityTypeUri&&t.entityTypeUri!==e[0],r=yield(0,La.Ys)(P.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,La.gz)(Qa(n)))}}function*Jl(e){const{facetsToAdd:t=[],fieldNamesToDelete:r=[],changedEntityTypes:n,addToEnd:a=!1}=e.payload;if(t.length||r.length){t.length&&(yield(0,La.gz)(Xa(t,a)));const e=yield(0,La.RE)(Wl);let o=!1;if(r.length){const t=e.filter((e=>e.values&&e.values.length));o=r.some((e=>t.some((t=>{var r;return null===(r=t.fieldName)||void 0===r?void 0:r.startsWith(e)})))),yield(0,La.gz)(Qa(r))}if(null!=n)yield(0,La.gz)(Ja("type",n));else if(o)yield(0,La.gz)((({debounceTime:e}={})=>({type:U.Z.REFRESH,payload:{debounceTime:e}}))());else if(t.length){const r=e.filter((e=>t.some((t=>e.fieldName.startsWith(t.fieldName)))));yield(0,La.gz)((i=r,{type:L.k.REQUEST_GIVEN_FACETS_DATA,payload:i}))}}var i}function*es(){const e=yield(0,La.Ys)(k().selectors.getSearchKeyword),t=yield(0,La.Ys)(ai.vH),r=yield(0,La.Ys)(Ki.go),n=yield(0,La.Ys)(k().selectors.getMetadata),a=yield(0,La.Ys)(k().selectors.getDataTenants);if(Ba(n,r,a)){const i=((e,t,r)=>{const n=Ya(e,t,r),a=Ha(e,t,r),i=(0,_.pipe)(_.flatten,_.uniq)((0,ft.VO)(t)),o=(0,N.$t)(e);return a.reduce(((e,{fieldName:t,values:r})=>{const a=n.find((e=>e.fieldName===t));return a&&(e.facetsConfigs.push(a),e.facetsData[t]={values:r}),e}),{facetsConfigs:[o],facetsData:{[o.fieldName]:(l=i,(0,ja.Kk)({values:l})?{values:l,showAllItems:!0}:{values:l})}});var l})(n,r,a);yield(0,La.gz)(D.search.actions.updateState({facets:i,keyword:e,map:t}))}}function*ts(){if(!(yield(0,La.Ys)(Ri.IJ))){const e=yield(0,La.Ys)(k().selectors.getMetadata);if((yield(0,La.Ys)(P.Mp)).some(S.isTypeFacet)){const e=yield(0,La.Ys)(Ri.Xf),t=yield(0,La.Ys)(P.DX);(e?t.filter((t=>e.includes(t))):t).length!==t.length&&(yield(0,La.gz)(Ga({silent:!0})))}else{const t=[(0,N.$t)(e)];yield(0,La.gz)(Xa(t))}}}function*rs(){const e=yield(0,La.Ys)(k().selectors.getMetadata),t=yield(0,La.Ys)(P.X0),r=(0,ja.t8)({type:t.type},[(0,N.$t)(e)]).type.data.reduce(((e,t)=>(e[(0,S.getLastUriPart)(t.value)]=t.number,e)),{}),n=yield(0,La.Ys)(Ri.Xf);return(0,ja.wW)(e,r,n)}const ns=[function*(){yield(0,La.Fm)([L.k.FILTER_FACET_DATA],Xl)},function*(){yield(0,La.ib)(L.k.REQUEST_GIVEN_FACETS_DATA,ql)},function*(){yield(0,La.ib)(L.k.HANDLE_CONFIGS_CHANGES,Jl)},function*(){yield(0,La.ib)(L.k.CONVERT_FROM_ADVANCED_SEARCH,es)}];function as(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const is=e=>{const t=["view","searchResultsColumns"],r=(0,_.pathOr)({},t,e),n=(0,_.map)((0,_.map)((0,_.pipe)((0,_.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){as(e,t,r[t])}))}return e}({},e,{attrType:{uri:(0,_.pathOr)("",["attrType","uri"],e)}}):e))),r),a=(0,_.lensPath)(t),i=(0,_.omit)(["sortField","sortOrder","entityTypeTab"],e.view),o=(0,_.lensPath)(["view"]),l=["keyword"],s=(0,_.pathOr)("",l,e),c=(0,_.lensPath)(l),u=["map"],p=(0,_.pathOr)("",u,e),d=(0,_.lensPath)(u);return(0,_.pipe)((0,_.omit)(["searchOptions"]),(0,_.set)(o,i),(0,_.set)(a,n),(0,_.set)(c,s),(0,_.set)(d,p))(e)};function os(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ls(e,t,r[t])}))}return e}function ls(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*ss({payload:{share:e}}){const{query:t,uiState:r}=yield(0,La.RE)(Do,!0),n=os({},yield(0,La.Ys)(ho.LA),{isPublic:e===Z.ib.public,query:t,uiState:r}),a=yield(0,La.Ys)(ho.tp);yield(0,La.gz)(gi(!1));try{yield(0,La.gz)(Si(li().text("Updating search..."))),yield(0,La.RE)(S.updateSavedSearch,n),yield(0,La.gz)(po(!1)),yield(0,La.gz)(Si(li().text("Search updated successfully"))),a&&(yield(0,La.gz)(a))}catch(e){si(e)}}function*cs(){const e=yield(0,La.Ys)(ho.LA);if(!e)return void(yield(0,La.gz)(po(!1)));const t=yield(0,La.Ys)(k().selectors.getMetadata),r=yield(0,La.Ys)(k().selectors.getDataTenants),n=yield(0,La.Ys)(k().selectors.getCanUserReadWorkflowDataTask),{uiState:a}=(0,Eo.z7)(t,r,n,yield(0,La.RE)(Do)),i=(({savedUiState:e,actualUiState:t})=>{const r=is(e),n=is(t);if(!(0,_.equals)(r,n))return!1;if((0,_.path)(["view","searchResultsMode"],e)===Z.ll.TABLE){const r=["view","sortField"],n=["view","sortOrder"],a=["view","entityTypeTab"],i=(0,_.path)(r,e),o=(0,_.path)(r,t),l=(0,_.path)(n,e),s=(0,_.path)(n,t),c=(0,_.path)(a,e),u=(0,_.path)(a,t);if(!(0,_.equals)(i,o)||!(0,_.equals)(l,s)||!(0,_.equals)(c,u))return!1}const a=["searchOptions"],i=(0,_.pathOr)(null,a,e),o=(0,_.pathOr)(null,a,t);return!!((0,_.isNil)(i)||(0,_.isNil)(o)||(0,_.equals)(i,o))})({savedUiState:e.uiState,actualUiState:a});yield(0,La.gz)(po(!i))}function*us(e){const t=yield(0,La.Ys)(ho.LA);if(t)switch(e.type){case Tr:case gr:case Er:t.uri===e.payload.uri&&(yield(0,La.gz)(uo(os({},t,e.payload))));break;case Cr:(0,_.includes)(t.uri,e.payload)&&(yield(0,La.gz)(uo(null)));break;case ar:yield(0,La.gz)(uo(os({},t,{isPublic:e.payload.share===Z.ib.public})));break;default:(yield(0,La.Ys)(ai.kw))&&(yield(0,La.gz)(uo(null)))}}function*ps(e){const t=yield(0,La.Ys)(ho.EH,e);if(t)return t;const r=yield(0,La.Ys)(k().selectors.getMetadata),n=yield(0,La.Ys)(k().selectors.getDataTenants),a=yield(0,La.Ys)(k().selectors.getCanUserReadWorkflowDataTask);try{const t=yield(0,La.RE)(S.getSavedSearch,(0,Eo.tk)(e));return(0,Eo.z7)(r,n,a,t)}catch(e){return si(e),null}}function*ds(e){const t=(0,_.path)(["payload","currentSavedSearchUri"],e);if(!t)return;const r=yield(0,La.Ys)(ho.LA);if((0,_.prop)("uri",r)===t)return;const n=yield(0,La.RE)(ps,t);n&&(yield(0,La.gz)(uo(n)),yield(0,La.RE)(cs))}const ms=[...Pl,Te,U.Z.CHANGE_SORT,Ae,ve,xe,Se,Re,L.k.CREATE_FACETS,L.k.DESTROY_FACETS,L.k.SHOW_MORE_ENTITY_TYPES],fs=[function*(){yield(0,La.Fm)(ms,cs)},function*(){yield(0,La.Fm)([ar],ss)},function*(){yield(0,La.Fm)([Tr,gr,Er,Cr,ar,...Pl],us)},function*(){yield(0,La.Fm)(D.search.constants.UPDATE_STATE,ds)}];function ys(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*gs(){yield(0,La.gw)(500);const{uiState:e,query:t}=yield(0,La.RE)(Do,!1,!0),r=yield(0,La.Ys)(ho.LA);yield(0,La.gz)(D.search.actions.saveState(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ys(e,t,r[t])}))}return e}({},e,{query:t,currentSavedSearchUri:(0,_.path)(["uri"],r)})))}function*hs(){yield(0,La.qn)(D.search.constants.UPDATE_STATE);const e=(0,_.reject)((0,_.includes)(_.__,[U.Z.REFRESH]),ms);yield(0,La.Fm)([rr,...e],gs)}const Es=e=>({type:Pr,payload:e}),bs=()=>({type:Fr}),vs=e=>({type:Vr,payload:e}),Ts=e=>({type:zr,payload:e}),Os=(e,t)=>({type:Wr,payload:{searchCreatedDate:e,isLoading:t}});var Ss=r(97010),xs=r(73667);const Cs=(0,_.path)([Z.Jf,"recentSearches"]),ws=e=>Cs(e).items,As=e=>Cs(e).filterWord,Rs=(0,_.curry)(((e,t)=>!e||t&&t.name.toLocaleLowerCase().includes(e.toLocaleLowerCase()))),_s=e=>(0,_.pipe)(ws,(0,_.filter)(Rs(As(e))))(e),Is=e=>Cs(e).loading,Ns=(0,xs.Rm)(ws),Ps=(0,xs.d1)(ws),Ds=(0,xs.Ky)(ws),ks=(0,xs.$y)(ws),Ls=e=>Cs(e).lastSavedRecentSearch,Us=(e,t)=>ws(e).find((0,_.propEq)("createdDate",t)),js=(0,_.path)(["advancedSearch","searchParams","groups"]);function Fs(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Ms(e,t,r[t])}))}return e}function Ms(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Vs(){yield(0,La.gz)(Ts(!0));try{const t=yield(0,La.Ys)(k().selectors.getTenant),r=yield(0,La.Ys)(k().selectors.getEnvironment),n=yield(0,La.Ys)(k().selectors.getServicesPath),{result:a=[]}=yield(0,La.RE)(S.getRecentSearches,{environment:r,tenant:t,servicesPath:n}),i=(0,_.sort)((0,_.descend)((0,_.prop)("createdDate")))(a);yield(0,La.gz)((e=i,{type:kr,payload:e})),yield(0,La.gz)(Ts(!1)),yield(0,La.RE)(Hs,i)}catch(e){si(e),yield(0,La.gz)(Ts(!1))}var e}function*Bs(e){const t=yield(0,La.Ys)(Us,e.payload);yield(0,La.RE)(zs,t)}function*zs(e,t){yield(0,La.gz)(Os(e.createdDate,!0));try{const{total:r}=yield(0,La.RE)(S.getTotalsForQuery,(0,S.replacePlaceholdersInQuery)(e.query),Boolean(t));yield(0,La.gz)(((e,t)=>({type:Lr,payload:{searchCreatedDate:e,total:t}}))(e.createdDate,r))}catch(e){si(e)}yield(0,La.gz)(Os(e.createdDate,!1))}function*Hs(e){const t=yield(0,La.Ys)(k().selectors.getQueryEstimatorEnabled);return yield(0,La.$6)(e.map((e=>(0,La.RE)(zs,e,t))))}function*Ys(){const e=yield(0,La.Ys)(ks),t=yield(0,La.Ys)(k().selectors.getServicesPath);yield(0,La.gz)(Ts(!0));try{yield(0,La.$6)(e.map((e=>(0,La.RE)(S.deleteRecentSearch,Fs({},e,{servicesPath:t}))))),yield(0,La.gz)(vs(e))}catch(e){si(e)}yield(0,La.gz)(Ts(!1))}function*Ws(e){const t=e.payload,r=yield(0,La.Ys)(k().selectors.getServicesPath);yield(0,La.gz)(Ts(!0));try{yield(0,La.RE)(S.deleteRecentSearch,Fs({},t,{servicesPath:r})),yield(0,La.gz)(vs([t]))}catch(e){si(e)}yield(0,La.gz)(Ts(!1))}function*Gs(e){const{debounceTime:t}=e.payload;t&&(yield(0,La.gw)(t));const{query:r,uiState:n}=yield(0,La.RE)(Do,!0),a=yield(0,La.Ys)(Ri.$s),i=yield(0,La.Ys)(Ls),o=yield(0,La.Ys)(ai.kw),l=yield(0,La.Ys)(k().selectors.getTenant),s=yield(0,La.Ys)(k().selectors.getEnvironment),c=yield(0,La.Ys)(k().selectors.getServicesPath),u=((e={})=>{const t=js(e);return t&&t.length>0?((e={})=>{const t=(0,_.chain)((0,_.prop)("attributes")),r=(0,_.filter)((0,_.has)("values")),n=(0,_.pipe)(js,t,r),a=(0,_.pipe)((0,_.prop)("values"),(0,_.map)((0,_.prop)("label")),(0,_.join)(", ")),i=(0,_.path)(["data","title"]),o=(0,_.pathEq)(["data","fieldName"],"type"),l=(0,_.find)(o),s=(0,_.pipe)(l,(0,_.when)(_.identity,a)),c=(0,_.pipe)((0,_.reject)(o),(0,_.map)(i),(0,_.reject)(_.isNil),(0,_.join)(", "));return[s(u=n(e)),c(u)].filter(_.identity).join(" - ");var u})(e):((e={})=>{const t=(0,_.prop)("facets"),r=(0,_.prop)("facetsData"),n=(0,_.prop)("facetsConfigs"),a=(0,_.prop)("values"),i=(0,_.prop)("label"),o=(0,_.prop)("title"),l=(0,_.pipe)(a,(e=>e&&e.length>0)),s=(0,_.curry)(((e,r)=>(0,_.pipe)(t,n,(0,_.find)((0,_.propEq)("fieldName",r)),(0,_.defaultTo)({}),o)(e))),c=(0,ja.XK)(e),u=[];c&&u.push(a(c).map((e=>(0,_.pipe)((0,_.propOr)([],"data"),(0,_.find)((0,_.propEq)("value",e)),(0,_.defaultTo)({}),i))).map((e=>e(c))).join(", "));const p=(0,_.pipe)(t,r,_.values,(0,_.reject)(S.isTypeFacet),(0,_.filter)(l),(0,_.map)((0,_.prop)("fieldName"))),d=(0,_.pipe)(p,(0,_.map)(s(e)))(e);return d.length>0&&u.push(d.join(", ")),u.filter(_.identity).join(" - ")})(e)})(a),p=(0,S.getHash)(r),d={query:r,state:n,name:u,environment:s,tenant:l};try{if(i!==p&&!o){const e=yield(0,La.RE)(S.createRecentSearch,d,c);e.success?yield(0,La.gz)((e=>({type:Yr,payload:e}))(p)):si(e)}}catch(e){si(e)}}function*qs(e){const{search:t,debounceTime:r}=e.payload;yield(0,La.gz)(yi(!1));const n=yield(0,La.Ys)(k().selectors.getMetadata),a=yield(0,La.Ys)(k().selectors.getDataTenants),i=yield(0,La.Ys)(k().selectors.getCanUserReadWorkflowDataTask);let o={};try{o=(0,_.pipe)(Ss.Z,(0,Ss.f)(null))(n,JSON.parse(t.state),{},a,i)}catch(e){o={}}(yield(0,La.Ys)(ai.lF))&&(o.currentTenant=yield(0,La.Ys)(k().selectors.getTenant)),yield(0,La.gz)(D.search.actions.updateState(Fs({},o,{debounceTime:r})))}const Zs=({type:e,payload:t={}})=>e===D.search.constants.KEYWORD_UPDATED&&!(null==t||!t.saveToRecent),$s=[function*(){yield(0,La.Fm)([Dr],Vs)},function*(){yield(0,La.ib)(Mr,Ys)},function*(){yield(0,La.Fm)([D.ui.constants.UIActions.OPEN_ENTITY,tr,ar,Pr,U.Z.CHANGE_PAGE,U.Z.CHANGE_ROWS_PER_PAGE,U.Z.EXPORT_RESULTS,Zs],Gs)},function*(){yield(0,La.Fm)([qr],qs)},function*(){yield(0,La.ib)([Gr],Bs)},function*(){yield(0,La.ib)(Br,Ws)}],Ks=e=>e[Z.Jf].entity.loading,Xs=e=>e[Z.Jf].entity.selectedEntityUri,Qs=e=>e[Z.Jf].entity.entity,Js=e=>({type:hn,payload:e}),ec=e=>({type:En,payload:e}),tc=e=>({type:bn,payload:e}),rc=e=>({type:vn,payload:e});function*nc(e){if(yield(0,La.Ys)(ai.lF)){const t=yield(0,La.RE)(Nl,(0,S.getDtssEntityUrl)(e));return(yield(0,La.RE)(Il,t))[0]}{const t=yield(0,La.Ys)(k().selectors.getMetadata),r=(0,S.addMetadataSpecificGetEntityOptions)(t);return yield(0,La.RE)(S.getEntity,e,r)}}function*ac(e){const t=e.payload;(yield(0,La.Ys)(Xs))!==t&&(yield(0,La.gz)(tc(t)));const r=yield(0,La.Ys)(Qs);if(yield(0,La.gz)(Js(!0)),(0,_.isNil)(t))yield(0,La.gz)(rc(null));else if(!r||r.uri!==t)try{const e=yield(0,La.RE)(nc,t);yield(0,La.gz)(rc(e))}catch(e){n=e,(0,ii.U)(n,{defaultMessage:li().text("Can't load entity")}),yield(0,La.gz)(rc(null))}var n;yield(0,La.gz)(Js(!1))}const ic=[function*(){yield(0,La.Fm)(En,ac)}];function*oc(e){const t="type"===(0,_.path)(["payload","facetFieldName"],e),r=(0,_.path)(["payload","values"],e);if(!t||1!==(0,_.length)(r))return;const n=yield(0,La.Ys)(k().selectors.getMetadata),a=(0,S.getEntityType)(n,r[0]),i=a.defaultFacetedAttributes||[];if(i.length>0){const e=yield(0,La.Ys)(P.Mp),t=({fieldName:t})=>(0,_.none)((0,_.propEq)("fieldName",t),e),r=(0,ci.vf)(n,a).map((e=>(0,ci.NG)(n,e,a.uri,"",N.u7))),o=i.reduce(((e,n)=>{const a=(0,S.attributeUriToSearchUri)(n),i=(0,N.zy)(r,a);return i&&t(i)?e.concat(i.children?(0,ci.jj)(i).filter(t):i):e}),[]);o.length>0&&(yield(0,La.gz)(Xa(o,!0)))}}const lc=[function*(){yield(0,La.Fm)(L.k.CHANGE_VALUES,oc)}],sc=e=>({type:Un,payload:e}),cc=()=>({type:Mn}),uc=()=>({type:Rn}),pc=e=>({type:Nn,payload:e}),dc=e=>({type:Dn,payload:e}),mc=e=>({type:Ln,payload:e}),fc=e=>({type:Fn,payload:e}),yc=e=>({type:Vn,payload:e}),gc=({id:e,groupId:t})=>({type:Yn,payload:{id:e,groupId:t}}),hc=({id:e,groupId:t,operationParameters:r})=>({type:Hn,payload:{id:e,groupId:t,operationParameters:r}}),Ec=(e,t,r)=>({type:Gn,payload:{groupId:e,attributeId:t,attribute:Tt(r)}}),bc=(e,t,r)=>({type:qn,payload:{groupId:e,attributeId:t,attributeData:Ot(r)}}),vc=(e,t)=>({type:qn,payload:{groupId:e,attributeId:t,attributeData:null}}),Tc=(e,t,r)=>({type:Zn,payload:{groupId:e,attributeId:t,selectInfo:r}}),Oc=(e,t)=>({type:$n,payload:{groupId:e,attributeId:t}}),Sc=(e,t,r)=>({type:Kn,payload:{groupId:e,attributeId:t,filter:r}}),xc=(e,t,r)=>({type:Xn,payload:{groupId:e,attributeId:t,values:r}}),Cc=e=>({type:ta,payload:e});var wc=r(97698);const Ac=(0,_.has)("actions"),Rc=e=>e.actions.map((0,_.assocPath)(["operationParameters","conditions"],e.conditions)),_c=(0,_.path)(["operationParameters","attributeTypeData","attributeType"]),Ic=(0,_.path)(["operationParameters","attributeTypeData","fieldName"]),Nc=(0,_.path)(["operationParameters","pin"]),Pc=(0,_.path)(["operationParameters","addNestedAttribute"]),Dc=(0,_.path)(["operationParameters","attributeValue"]),kc=(0,_.path)(["operationParameters","attributeValueToFind"]),Lc=(0,_.anyPass)([(0,_.equals)(ra.d.AddNew),(0,_.equals)(ra.d.ReplaceAllWith)]),Uc=(0,_.anyPass)([(0,_.equals)(ra.d.AddNew),(0,_.equals)(ra.d.ReplaceAllWith),(0,_.equals)(ra.d.FindAndReplace)]),jc=(0,_.equals)(ra.d.AddNew),Fc=(0,_.both)((0,_.pipe)(_c,S.isNested),(0,_.pipe)((0,_.prop)("operation"),Lc)),Mc=(0,_.both)((0,_.pipe)(_c,S.isReference),(0,_.pipe)((0,_.prop)("operation"),jc)),Vc=(0,_.both)((0,_.pipe)(Dc,S.isLookupAttrType),(0,_.pipe)((0,_.prop)("operation"),Uc)),Bc=(0,_.pipe)(_c,S.isLookupAttrType),zc=e=>{switch(e){case ra.d.AddNew:case ra.d.RepointReference:case ra.d.ReplaceAllWith:return["attributeValue"];case ra.d.FindAndReplace:return["attributeValueToFind","attributeValue"];case ra.d.FindAndRemove:return["attributeValueToFind"];default:return[]}},Hc=e=>{if(!e.operation||!e.operationParameters)return!1;const t=Fc(e),r=Mc(e),n=Bc(e),a=zc(e.operation);for(let i of a){const a=e.operationParameters[i];if((0,S.isEmptyValue)(a)||n&&(0,S.isEmptyValue)((0,S.getAttrTypeLookupCode)(a))||r&&(0,S.isEmptyValue)((0,S.getReferencedEntityFromAttrValue)(a))||t&&(0,S.isEmptyValue)((0,S.cleanAttributesWith)({deleteEmptyComplex:!0})(a.value)))return!1}return!0},Yc=e=>{const t=Fc(e),r=Mc(e);return t||r?zc(e.operation).reduce(((e,t)=>{const r=["operationParameters",t,"value"];if((0,_.path)(r,e)){const t=(0,_.lensPath)(r);return(0,_.over)(t,(0,S.cleanAttributesWith)({deleteEmptyComplex:!0}),e)}return e}),e):e},Wc=e=>e[Z.Jf].bulkUpdate.operation,Gc=e=>e[Z.Jf].bulkUpdate.activeStep,qc=e=>e[Z.Jf].bulkUpdate.loading,Zc=e=>{const t=(0,Ri.IJ)(e)?(0,Ki.V6)(e):(0,P.DX)(e),r=(0,Ri.tB)(e);return r||1===t.length?r||t[0]:null},$c=(0,_.path)([Z.Jf,"bulkUpdate","objects"]),Kc=e=>$c(e).total,Xc=e=>$c(e).selectionMode,Qc=e=>$c(e).entities,Jc=e=>$c(e).selectedEntities,eu=e=>$c(e).page,tu=e=>$c(e).rowsPerPage,ru=e=>$c(e).sortField,nu=e=>$c(e).sortOrder,au=e=>$c(e).selectedColumns,iu=e=>$c(e).filterText,ou=(0,_.pipe)(Xc,(0,_.equals)(Z.v6.include)),lu=(0,_.ifElse)(ou,(0,_.pipe)(Jc,_.length),(e=>{const t=Jc(e).length;return(0,ai.hX)(e)-t})),su=(0,_.pipe)(lu,(0,_.gt)(_.__,0)),cu=e=>e[Z.Jf].bulkUpdate.actions,uu=(0,wc.createSelector)(cu,(0,_.pipe)((0,_.map)((0,_.ifElse)(Ac,(0,_.evolve)({actions:(0,_.pipe)((0,_.map)(Yc),(0,_.filter)(Hc))}),Yc)),(0,_.filter)((0,_.ifElse)(Ac,(0,_.pipe)((0,_.path)(["actions","length"]),(0,_.gt)(_.__,0)),Hc)))),pu=(0,wc.createSelector)(cu,(0,_.pipe)((0,_.map)((0,_.when)(Ac,(0,_.prop)("actions"))),_.flatten)),du=e=>{const t=pu(e);return 0!==t.length&&t.every(Hc)},mu=e=>e[Z.Jf].bulkUpdate.requestPending,fu=(0,S.getUrisForSaving)((e=>(0,_.equals)(e.slice(-3),["operationParameters","attributeValue","entityUri"]))),yu=(0,_.curry)(((e,t,r)=>{const n=(0,_.pipe)(fu,(0,_.find)((t=>(0,_.pathSatisfies)((t=>t===e),t,r))))(r);return n?(0,_.set)((0,_.lensPath)(n),t,r):r})),gu=(e,t,r)=>(0,_.pipe)(yu(e,t),(0,_.when)((e=>e===r),(0,S.replaceTemporaryRefEntityURI)(e,t)))(r),hu=(0,_.pathEq)(["data","fieldName"],Z.E_),Eu=(0,_.pipe)((0,_.path)(["values",0,"entityUri"]),(0,_.objOf)("uri"),S.getEntityId,S.wrapInQuotes),bu=e=>[{attributes:e,operator:"or"}],vu=(0,_.curry)(((e,t,r)=>r.map((r=>{const{data:{fieldName:n}}=r,a=n.split(".");let[i,o]=((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=o.length;t===Z.Vp.AddAttribute&&l--,i.length||(i=a.slice(-1),l++);const s=`${(0,_.repeat)("parent.",Math.max(0,l)).join("")}attributes.${i.join(".")}`;return(0,_.assocPath)(["data","fieldName"],s,r)})))),Tu=(0,_.curry)(((e,t,r)=>{const n=((e,t,r)=>{const[n,a]=(0,_.partition)(hu,e),i=(0,_.pipe)(vu(t,r),bu,Ua.Jk)(a),o=n.length?(e=>`in(${Z.E_}, ${e.map(Eu).join(",")})`)(n):"";return i&&o?`${i} and ${o}`:i||o})(e,t,r.operation);return(0,_.isEmpty)(n)?r:(0,_.ifElse)((0,_.pipe)((0,_.path)(["operationParameters","valueFilter"]),S.isEmptyValue),(0,_.assocPath)(["operationParameters","valueFilter"],n),(0,_.evolve)({operationParameters:{valueFilter:(0,_.concat)(_.__,` and (${n})`)}}))(r)}));var Ou=r(9828);function Su(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){xu(e,t,r[t])}))}return e}function xu(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cu=e=>{const t=(0,_.pipe)((0,_.pick)(["pin"]),(0,_.assoc)("value",wu(e)))(e);return(0,Ou.Kn)(t.value)?Object.keys(t.value).reduce(((e,r)=>(e.value=Su({},e.value,{[r]:t.value[r].map(Cu)}),e)),t):t},wu=(0,_.when)(Ou.Kn,(0,_.ifElse)((0,_.has)("lookupCode"),(0,_.prop)("lookupCode"),(0,_.prop)("value"))),Au=(0,_.cond)([[Fc,(0,_.pipe)(Dc,Cu)],[Mc,(0,_.pipe)(Dc,(e=>{const{refEntity:t=[],refRelation:r=[]}=e;return Su({refEntity:(0,_.pipe)(_.head,(0,_.pick)(["objectURI"]))(t),refRelation:(0,_.pipe)(_.head,(0,_.pick)(["type"]))(r)},Cu(e))}))],[Vc,(0,_.pipe)(Dc,wu)],[_.T,Dc]]),Ru=(0,_.pipe)(Au,(0,_.assocPath)(["operationParameters","attributeValue"])),_u=(0,_.ifElse)(Nc,(()=>(0,_.assocPath)(["operationParameters","pin"],!0)),(()=>_.identity)),Iu=(0,_.ifElse)(Pc,(()=>(0,_.assocPath)(["operationParameters","addNestedAttribute"],!0)),(()=>_.identity)),Nu=(0,_.pipe)(kc,(0,_.ifElse)(_.isNil,(()=>_.identity),(0,_.pipe)(((e="")=>`equals(value, '${wu(e)}')`),(0,_.assocPath)(["operationParameters","valueFilter"])))),Pu=(0,_.pipe)(Dc,(0,_.prop)("entityUri"),(0,_.assocPath)(["operationParameters","referencedEntity","uri"])),Du=(e,t)=>({operationParameters:{attributeURI:e},operation:t}),ku=(e,t)=>(0,_.pipe)(Du,Ru(e),_u(e),Iu(e))(t,Z.Vp.AddAttribute),Lu=(e,t)=>(0,_.pipe)(Du,Nu(e))(t,Z.Vp.DeleteAttribute),Uu=(e,t)=>(0,_.pipe)(Du,Ru(e),_u(e),Nu(e))(t,Z.Vp.UpdateAttribute),ju=(e,t)=>(0,_.pipe)(Du,Pu(e))(t,Z.Vp.RepointReferencedEntity),Fu=(e,t)=>(0,_.reject)(_.isNil,{operationParameters:e,operation:t}),Mu=e=>Fu({tags:[Dc(e)]},Z.Vp.AddTags),Vu=e=>Fu({newValue:Dc(e),oldValue:kc(e)},Z.Vp.ReplaceTag),Bu=e=>Fu({tags:[kc(e)]},Z.Vp.DeleteTags),zu=()=>Fu(null,Z.Vp.ClearTags),Hu=(e,t=[],r={})=>{const{selectionMode:n,selectedEntities:a=[]}=e,{searchOptions:i,activityFilter:o,globalFilter:l}=r;return n===Z.v6.include?{list:a,activeness:o}:{filter:(0,_.pipe)(Ua.XP,(0,S.addGlobalFilterToQuery)(l))(t),excludeList:a,options:i,activeness:o}},Yu=(0,_.curry)(((e,t)=>(0,_.chain)((0,_.ifElse)(Ac,(0,_.pipe)(Rc,Yu(e)),Wu(e)))(t))),Wu=(0,_.curry)(((e,t)=>{const r=(0,_.pathOr)([],["operationParameters","conditions"],t),n=Ic(t);return(0,_.pipe)(qu(e),(0,_.map)(Tu(r,n)))(t)})),Gu=(0,_.curry)((e=>(0,_.propEq)("operation",e))),qu=(0,_.curry)(((e,t)=>{const r=Ic(t),n=r.includes(".")?(0,S.searchUriToAttrUri)(r,e):r,a=r===S.EntityAttrTypes.tags.uri;return(0,_.cond)([[(0,_.both)((0,_.always)(a),Gu(ra.d.AddNew)),()=>[Mu(t)]],[(0,_.both)((0,_.always)(a),Gu(ra.d.Clear)),()=>[zu()]],[(0,_.both)((0,_.always)(a),Gu(ra.d.ReplaceAllWith)),()=>[zu(),Mu(t)]],[(0,_.both)((0,_.always)(a),Gu(ra.d.FindAndReplace)),()=>[Vu(t)]],[(0,_.both)((0,_.always)(a),Gu(ra.d.FindAndRemove)),()=>[Bu(t)]],[Gu(ra.d.AddNew),()=>[ku(t,n)]],[Gu(ra.d.Clear),()=>[Lu(t,n)]],[Gu(ra.d.ReplaceAllWith),()=>[Lu(t,n),ku(t,n)]],[Gu(ra.d.FindAndReplace),()=>[Uu(t,n)]],[Gu(ra.d.FindAndRemove),()=>[Lu(t,n)]],[Gu(ra.d.RepointReference),()=>[ju(t,n)]]])(t)}));function Zu(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){$u(e,t,r[t])}))}return e}function $u(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Ku(e){if(e.payload){const e=yield(0,La.Ys)(Ri.tB);let r;do{if(r=yield(0,La.Ys)(ai.BP,{entityTypeUri:e}),r)break;yield(0,La.qn)(U.Z.UPDATE_ENTITIES)}while(!r);const n=yield(0,La.Ys)(Zc),a=yield(0,La.Ys)(ai.fx,{entityTypeUri:e}),i=yield(0,La.Ys)(ai.Uz,{entityTypeUri:e}),o=(yield(0,La.Ys)(ai.L9,{entityTypeUri:e}))||void 0,l=yield(0,La.Ys)(ai.NW,{entityTypeUri:e}),s=(yield(0,La.RE)(Ji))[n].filter((0,_.pipe)((0,_.prop)("id"),S.isAttributeSearchUri,_.not)),c=e?yield(0,La.Ys)(Ri.Gv,e):s,u=yield(0,La.Ys)(ai.NU,{entityTypeUri:e});yield(0,La.gz)((t={page:a,rowsPerPage:i,sortOrder:o,sortField:l,selectedColumns:c,total:u,entities:r},{type:An,payload:t}))}var t}function*Xu(e){const t=yield(0,La.Ys)(k().selectors.getMetadata),r=yield(0,La.Ys)(eu),n=yield(0,La.Ys)(tu),a=yield(0,La.Ys)(nu),i=yield(0,La.Ys)(ru),o=yield(0,La.RE)(lp),l=(0,_.uniq)(o.concat((0,Ua.kx)(t,e))),s=Zu({page:r,rowsPerPage:n,sortOrder:a,sortField:i,forceOvOnly:!0},yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),{select:l}),c=(0,Ua.Lv)(e,s);yield(0,La.gz)(pc(!0));try{const e=yield(0,La.RE)(S.rawRequest,Z.NV,c);yield(0,La.gz)(sc(e))}catch(e){console.warn(e),yield(0,La.gz)(sc([]))}yield(0,La.gz)(pc(!1))}function*Qu(){const e=yield(0,La.Ys)(iu),t=yield(0,La.RE)(op,e);yield(0,La.rM)(Xu,t)}function*Ju(e={}){const{debounceTime:t}=e.payload||{};t&&(yield(0,La.gw)(t));const r=yield(0,La.Ys)(iu),n=yield(0,La.RE)(op,r);yield(0,La.gz)(dc(0)),yield(0,La.rM)(ep,n)}function*ep(e){const t=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),r=(0,Ua.Vg)(e,[],t);try{const e=yield(0,La.RE)(S.rawRequest,Z.jS,{method:"POST",body:JSON.stringify(r)});yield(0,La.gz)(fc(e.total))}catch(e){console.warn(e),yield(0,La.gz)(fc(0))}}function*tp(){const e=(yield(0,La.Ys)(Qc)).map((e=>e.uri)),t=yield(0,La.RE)(lp),r=yield(0,La.Ys)(iu),n=yield(0,La.RE)(op,r),a=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),i=(0,Ua.aG)(e,n,Zu({select:t},a));yield(0,La.gz)(pc(!0));try{const e=yield(0,La.RE)(S.rawRequest,i.url,i.options);yield(0,La.gz)(sc(e))}catch(e){console.warn(e),yield(0,La.gz)(sc([]))}yield(0,La.gz)(pc(!1))}function*rp(e){try{yield(0,La.RE)(S.rawRequest,e.url,e.options),yield(0,La.gz)(wi(!1)),yield(0,La.gz)(xi({message:li().text("Bulk update is currently in progress. You'll receive an email notification once completed.\nGo to Tenant Management to view the status."),actionLabel:li().text("Tenant Management"),actionToDispatch:D.ui.actions.openConsoleApp("Tenant Management","jobs/pending"),autoHideDuration:1e4}))}catch(e){let r=e;e&&"object"==typeof e&&(r="errorCode"in e&&441===e.errorCode?li().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||li().text("Something went wrong...")),yield(0,La.gz)((t=r,Oi({payload:{message:t,action:{actionToDispatch:Ti()}},type:Z.GT.error})))}var t}function*np(){const e=yield(0,La.Ys)(Wc);e===Z.dV.UpdateProfiles?yield(0,La.RE)(ap):e===Z.dV.DeleteProfiles&&(yield(0,La.RE)(ip))}function*ap(){yield(0,La.gz)(Cc(!0));const e=yield(0,La.Ys)(Zc),t=yield(0,La.Ys)($c);let r=yield(0,La.Ys)(uu);const n=yield(0,La.RE)(op),a=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),i=yield(0,La.Ys)(k().selectors.getModifiedEntities),o=((e,t)=>{const r=(0,S.findAllTemporaryRefEntityURI)(t),n=(a=t,(0,_.pipe)(fu,(0,S.getPathsWithTempUri)(a),(0,_.map)((e=>(0,_.path)(e,a))))(a));var a;return r.concat(n).filter((t=>e[t]))})(i,r);if(o.length>0){const e=yield(0,La.RE)(S.saveTemporaryEntities,i,o);for(const[t,n]of Object.entries(e))r=gu(t,n,r)}const l=function(e,t,r,n,a){const i=((e,t={},r=[],n=[],a={})=>({objects:Hu(t,n,a),actions:Yu(e,r)}))(e,t,r,n,a);return{url:"/entities/_update?sendMail=true",options:{method:"POST",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}}}}(e,t,r,n,a);yield(0,La.RE)(rp,l),yield(0,La.gz)(Cc(!1))}function*ip(){yield(0,La.gz)(Cc(!0));const e=function(e,t,r){const n={objects:Hu(e,t,r)};return{url:"/entities/_delete?sendMail=true",options:{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}}}}(yield(0,La.Ys)($c),yield(0,La.RE)(op),yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions));yield(0,La.RE)(rp,e),yield(0,La.gz)(Cc(!1))}function*op(e){const t=yield(0,La.Ys)(ai.FR),r={fieldName:"type",filter:"equals",values:[yield(0,La.Ys)(Zc)]};let n=t.filter((e=>"type"!==e.fieldName)).concat(r);return e&&(n=n.concat({fieldName:"attributes",filter:"containsWordStartingWith",values:[e]})),n}function*lp(){const e=yield(0,La.Ys)(au);return(0,Ai.vw)(e)}function*sp(e){const{groupId:t,attributeId:r,selectInfo:n}=e.payload,a=yield(0,La.Ys)(cu),i={addAttributeAfter:Ec,changeAttribute:bc,clearAttribute:vc,deleteAttribute:Oc};yield(0,La.RE)(el,{groups:a,attributesPropName:"conditions",groupId:t,attributeId:r,selectInfo:n,actions:i})}const cp=[function*(){yield(0,La.Fm)(ge,Ku)},function*(){yield(0,La.Fm)([Dn,Pn,kn],Qu)},function*(){yield(0,La.Fm)(jn,Ju)},function*(){yield(0,La.Fm)(Mn,tp)},function*(){yield(0,La.ib)(Zn,sp)},function*(){yield(0,La.ib)(ea,np)}],up=()=>({id:Z.Jf,reducerMap:{[Z.Jf]:(0,R.combineReducers)({ui:We,search:pe,facets:q,advancedSearch:er,savedSearches:ln,recentSearches:gn,entity:Cn,bulkUpdate:ka})},sagas:[...Dl,...ns,...co,...cl,...Uo,...$s,...fs,hs,...ic,...lc,...cp]});var pp=r(95099),dp=r.n(pp),mp=r(34756),fp=r(23625),yp=r.n(fp),gp=r(53732),hp=r.n(gp),Ep=r(88214),bp=r.n(Ep),vp=r(14294),Tp=r.n(vp),Op=r(4501),Sp=r.n(Op),xp=r(87925),Cp=r(18538),wp=r(42950);const Ap=(0,wp.Z)((()=>({container:({height:e=36})=>({height:e,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 Rp(){return Rp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Rp.apply(null,arguments)}function _p(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Ip(e,t,r[t])}))}return e}function Ip(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Np=(0,b.memo)((e=>{let{value:t,autofocus:r,onSearch:n=_.identity,rootRef:a,classes:i={},height:o,placeholder:l=li().text("Search")}=e,s=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["value","autofocus","onSearch","rootRef","classes","height","placeholder"]);const c=Ap({height:o}),[u,p]=(0,b.useState)(""),d=(0,_.pipe)((0,_.tap)(n),p),m=(0,_.isNil)(t)?u:t;return v().createElement(hp(),Rp({startAdornment:v().createElement(bp(),{position:"start"},v().createElement(Sp(),{className:c.icon})),endAdornment:v().createElement(bp(),{position:"end"},m.length>0&&v().createElement(Cp.T,{icon:Tp(),className:c.clearButton,onClick:()=>d("")})),autoFocus:r,classes:_p({},i,{input:O()(c.input,i.input),root:O()(c.container,i.root)}),placeholder:l,value:m,onChange:(0,_.pipe)(xp.NA,d),disableUnderline:!0,ref:a},s))})),Pp=(0,wp.Z)((()=>({container:({containerHeight:e=553,containerWidth:t})=>({display:"flex",flexDirection:"column",height:e,width:t,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}}})));function Dp(){return Dp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Dp.apply(null,arguments)}const kp=e=>{let{title:t,className:r,onSearch:n,hideTitle:a,hideSearchInput:i,headerPlacement:o="top",containerWidth:l,containerHeight:s,searchInputOnKeyDown:c,children:u,searchInputRef:p,anchorOrigin:d={vertical:"top",horizontal:"right"},transformOrigin:m={vertical:"top",horizontal:"right"}}=e,f=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.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 y=Pp({containerWidth:l,containerHeight:s}),g=v().createElement(v().Fragment,null,!a&&v().createElement("div",{className:y.header},t),!i&&v().createElement(Np,{onSearch:n,autofocus:!0,onKeyDown:c,inputRef:p,classes:{root:y.searchInputContainer},placeholder:li().text("Search & add attributes"),height:40}));return v().createElement(yp(),Dp({anchorOrigin:d,transformOrigin:m},f),v().createElement("div",{className:O()(y.container,r),style:{width:l}},"top"===o&&g,v().createElement("div",{className:y.list},u),"bottom"===o&&g))},Lp=e=>{const t=e=>(0,_.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})))},Up=e=>e.titleItemIndex===e.index;var jp=r(50166),Fp=r(88267);const Mp=(0,wp.Z)({stickyTitlesWrapper:{position:"absolute",top:0,"& > div":{zIndex:1,position:"absolute",top:0,width:"100%",visibility:"hidden"}}}),Vp=({items:e,getItemSize:t,renderItem:r,renderGroupTitle:n,width:a="100%",height:i,fixedTitle:o=!0,itemKey:l=(e=>e),disableHorizontalScrollbar:s,hideSubtitles:c,focusIndex:u=null,onInnerContainerResize:p})=>{const d=Mp(),m=(0,b.useRef)(null),f=(0,b.useRef)(null),y=(0,b.useRef)(null),g=(0,b.useRef)([0]),h={topMargin:0},E=(0,b.useMemo)((()=>!c||(e||[]).some((e=>null!==e.titleItemIndex))),[e,c]),T=(0,b.useCallback)((r=>{const n=g.current.length;let a=0;e.slice(n-1,r+1).forEach(((e,r)=>{const i=n+r-1;r>0&&(g.current[i]=g.current[i-1]+a),a=t(i,e.item)}))}),[t,e]),O=(0,b.useCallback)((t=>e[t].titleItemIndex),[e]),S=(0,b.useCallback)((t=>e[t]),[e]);(0,b.useEffect)((()=>{requestAnimationFrame((()=>{m.current&&m.current.scrollTo(0)}))}),[e.length]),(0,b.useEffect)((()=>{m.current&&m.current.resetAfterIndex(0),x();const r=(e=>{const r=e.findIndex((e=>e.item.moveTo));if(r>-1){T(r);const e=O(r);return{offset:g.current[r],titleHeight:t(e,S(e).item)}}})(e);if(r&&r.offset&&m.current){const{titleHeight:e}=r,t=r.offset-e;(t<m.current.state.scrollOffset||t>m.current.state.scrollOffset+i)&&requestAnimationFrame((()=>{m.current&&m.current.scrollTo(t-(i-e)/2)}))}}),[T,S,t,O,i,g,e,m]);const x=()=>{y.current&&f.current&&(y.current.style.width=f.current.offsetWidth+"px")},C=(0,b.useCallback)((t=>{let r=null,n=0;return e.some(((e,a)=>{T(a+10);const i=g.current[a+1];return t>=n&&t<i&&(r={index:a,offset:n,listItem:e}),n=i,r})),r}),[T,g,e]),w=(0,b.useCallback)((e=>t(e,S(e).item)),[S,t]),A=(0,b.useCallback)((({index:e,style:t,data:a})=>{const i=S(e);return i.item&&(Up(i)&&n(t,i.item)||r(t,i.item,e,a))}),[S,n,r]),{handleOnItemsRendered:R}=(({focusIndex:e,listRef:t,items:r})=>{const n=(0,b.useRef)(null),a=(0,b.useRef)(null),i=(0,b.useCallback)((({visibleStartIndex:e,visibleStopIndex:t})=>{n.current=e,a.current=t}),[]);return(0,b.useEffect)((()=>{t.current&&null!==e&&0!==r.length&&(e<Math.max(n.current+3,0)?t.current.scrollToItem(Math.max(e-3,0),"start"):e>Math.min(a.current-3,r.length-1)&&t.current.scrollToItem(Math.min(e+3,r.length-1),"end"))}),[e,r.length,t]),{handleOnItemsRendered:i}})({items:e,focusIndex:u,listRef:m}),_=(0,b.useCallback)((()=>e.filter((e=>Up(e))).map((e=>(e=>v().createElement("div",{className:"stickyTitleItem",style:{visibility:"hidden"},"data-index":e.index,key:e.index},n({height:t(e.index,e.item)},e.item)))(e)))),[t,e,n]);return v().createElement(v().Fragment,null,v().createElement("div",{ref:y,className:d.stickyTitlesWrapper},o&&_()),p&&f.current&&v().createElement(Fp.Z,{handleHeight:!0,onResize:p,targetDomEl:f.current}),v().createElement(jp.VariableSizeList,{ref:m,itemCount:e.length,itemSize:w,width:a,height:i,itemKey:l,innerRef:f,onScroll:({scrollOffset:r,scrollDirection:n})=>{if(!o||!E)return;const a=C(r),i=a&&O(a.index);var l;null!==i&&(l=i,y.current&&[...y.current.querySelectorAll(".stickyTitleItem")].forEach((e=>{e.dataset.index===l.toString()?(e.style.visibility="visible",h.index=l):e.style.visibility="hidden"}))),x();const s=null!==i&&t(i,S(i).item),c=C(r+s+h.topMargin);let u=0;if(c){switch(n){case"forward":c.offset-r>0&&Up(c.listItem)&&(u=s-(c.offset-r));break;case"backward":{const t=i>-1&&(p=i,e.findIndex(((e,t)=>Up(e)&&p<t))),n=(e=>(T(e),g.current[e]))(t);t>-1&&r<n&&s>=n-r&&(u=s-(n-r))}}(e=>{y.current&&(h.topMargin=-e,y.current.style.top=-e+"px")})(u)}var p},style:s?{overflowX:"hidden"}:void 0,overscanCount:5,onItemsRendered:R},A))};Vp.propTypes={items:dp().arrayOf(dp().object).isRequired,getItemSize:dp().func.isRequired,renderItem:dp().func.isRequired,width:dp().oneOfType([dp().number,dp().string]),height:dp().number.isRequired,renderGroupTitle:dp().func,fixedTitle:dp().bool,hideSubtitles:dp().bool,itemKey:dp().func,disableHorizontalScrollbar:dp().bool,focusIndex:dp().number,onInnerContainerResize:dp().func};const Bp=({items:e,open:t,onSelectFocusedItem:r,selectedItems:n,onClose:a})=>{const[i,o]=(0,b.useState)(null),l=(0,b.useRef)(!1),s=(0,b.useCallback)((t=>{let r=null===t?s(-1):t;for(;null!==t&&r<e.length&&(r<=t||r>=0&&Up(e[r]));)r+=1;return r!==e.length?r:s(-1)}),[e]),c=(0,b.useCallback)((t=>{let r=null===t?e.length-1:t;for(;null!==t&&r>=0&&(r>=t||Up(e[r]));)r-=1;return r<0?e.length-1:r}),[e]),u=(0,b.useCallback)((()=>{if(!(0,_.isNil)(i)){const t=e[i].item;!t.item.notSelectable&&r({item:t.item,groupData:t})}}),[r,e,i]),p=(0,b.useCallback)((t=>{if(0!==e.length)switch(t.key){case"Down":case"ArrowDown":return o(s),t.preventDefault(),!1;case"Up":case"ArrowUp":return o(c),t.preventDefault(),!1;case"Enter":l.current=!0,u();break;case"Tab":a&&a(t);break;default:return}}),[e,s,c,u,a]);return(0,b.useEffect)((()=>{if(l.current){l.current=!1;const t=e.findIndex((e=>e.item.moveTo));t>-1&&o(t)}else o(null)}),[e,t,n]),{focusIndex:i,handleKeyDown:p}};var zp=r(85746),Hp=r.n(zp),Yp=r(22811),Wp=r.n(Yp),Gp=r(93222),qp=r.n(Gp);function Zp(){return Zp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zp.apply(null,arguments)}function $p(){return $p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$p.apply(null,arguments)}const Kp=e=>v().createElement("svg",$p({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgNestedAttribute"},e),v().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 Xp(){return Xp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xp.apply(null,arguments)}const Qp=e=>v().createElement("svg",Xp({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgReferenceAttribute"},e),v().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 Jp(){return Jp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jp.apply(null,arguments)}const ed=e=>v().createElement("svg",Jp({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgSimpleAttribute"},e),v().createElement("rect",{fill:"#000",x:9,y:9,width:6,height:6,rx:1,stroke:"none",strokeWidth:1,fillRule:"evenodd"})),td=(0,wp.Z)({icon:{opacity:.29,width:"16px",height:"16px",flexShrink:0,marginRight:"6px",marginLeft:"8px"}}),rd=({attrType:e={}})=>{const t=td(),r=(e=>{switch(e.type){case S.DataTypes.TYPE_IMAGE:case S.DataTypes.TYPE_NESTED:return Kp;case S.DataTypes.TYPE_REFERENCE:return Qp;default:return ed}})(e);return v().createElement(r,{className:t.icon})},nd=(0,wp.Z)({mark:{color:"red"}}),ad=()=>{const e=nd();return v().createElement("span",{className:e.mark},"*")},id=({margin:e,level:t,className:r,children:n})=>null!=t?v().createElement("div",{style:{marginLeft:t*e},className:r},n):n;var od=r(1063),ld=r(85740);const sd=(0,wp.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"}}),cd=(0,ld.T)((e=>v().createElement("svg",Zp({width:13,height:18,viewBox:"0 0 13 18",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgRecommended"},e),v().createElement("g",{transform:"translate(-3 -1)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("path",{fill:"#FF4081",d:"M5.833 10h3.75v6.667l-3.75 1.666z"}),v().createElement("path",{fill:"#CE0C4E",d:"M13.333 10v8.333l-3.75-1.666V10z"}),v().createElement("circle",{fill:"#FFC058",cx:9.583,cy:7.917,r:6.25}),v().createElement("circle",{fill:"#FFCD7B",cx:9.583,cy:7.917,r:5.417}),v().createElement("path",{fill:"#FFFBB5",d:"M8.333 11.667L5 8.462l.933-.898 2.4 2.308L13.4 5l.933.897z"}))))),ud=({groupId:e,data:t,checked:r=!1,isFocused:n=!1,isRequired:a=!1,label:i,labelInText:o,level:l,onClick:s=_.identity,hideCheckBox:c=!1,hideIcon:u=!1,notSelectable:p=!1,disableHorizontalScrollbar:d=!1,style:m={},subItemMargin:f=20,LogoIcon:y,className:g,disableNonSelectable:h,disableGutters:E})=>{const b=sd(),{attrType:T}=t||{},x=!(c&&(0,S.isNested)(T)||p),C=!!y;return v().createElement(od.Y,{value:o||i,className:b.itemTooltip,placement:"bottom-end"},v().createElement(qp(),{className:O()(b.container,b.listItem,{[b.defaultCursor]:!x},g),onClick:x?()=>s(t,!r,e):void 0,style:m,dense:!0,disabled:h&&p,classes:{focusVisible:b.listItemFocus,selected:b.listItemFocus},selected:n,tabIndex:-1,disableGutters:E},!c&&v().createElement(Wp(),{checked:r,disableRipple:!0,disabled:!x,className:O()(b.checkbox,{[b.checked]:r}),tabIndex:-1}),v().createElement(id,{margin:f,level:l,className:b.marginWrapper},v().createElement(v().Fragment,null,!u&&(t=>"recommended"===e?v().createElement(cd,{className:b.recommendedIcon,tooltipTitle:li().text("Recommended"),showForDisabled:!0}):v().createElement(rd,{attrType:t}))(T),v().createElement("div",{className:O()(b.itemTextWrapper,{[b.marginText]:u})},C&&v().createElement(y,{className:b.logoIcon}),v().createElement(Hp(),{primary:v().createElement(v().Fragment,null,i,a&&v().createElement(ad,null)),className:b.itemText})))),x&&d&&v().createElement("div",{className:b.itemAfter})))};ud.defaultName="AttributeListItem";const pd=(0,b.memo)(ud);var dd=r(49940);const md=(0,wp.Z)({popupContainer:{},container:{"&$popupContainer":{height:"408px",minWidth:"200px"}}});function fd(){return fd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fd.apply(null,arguments)}function yd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){gd(e,t,r[t])}))}return e}function gd(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hd=e=>{let{open:t,anchorEl:r,data:n,onSearch:a,onClose:i,titleText:o,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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.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,b.useCallback)((e=>e.label.toLowerCase().includes(l.toLowerCase())),[l]),f=(0,b.useCallback)((e=>m(e)||(e.children||[]).some(f)),[m]),y=(0,b.useMemo)((()=>{const e=(0,_.curry)(((e,r,n,a)=>[{item:yd({},r,{filterText:l}),level:e,groupId:n,groupName:a},...t(r.children||[],n,a,e+1)])),t=(t,r,n,a=0)=>{const i=t.filter(f);return(p?_.map:_.chain)((t=>e(a,t,r,n)),i)};return t}),[l,p,f]),g=(0,b.useCallback)((e=>e.map((e=>({item:e,items:y(e.attributes,e.id,e.label)}))).filter((e=>e.items.length))),[y]),h=(0,b.useCallback)((({item:e})=>{s(e,!c.find((t=>t.id===e.id||t.id.includes(`${e.id}.`))))}),[s,c]),E=(0,b.useMemo)((()=>(p?g:y)(n)),[n,p,g,y]),T=(0,b.useMemo)((()=>Lp(E)),[E]),{focusIndex:x,handleKeyDown:C}=Bp({items:T,open:t,onSelectFocusedItem:h,selectedItems:c}),w=(0,b.useRef)(null);w.current=x;const A=(0,b.useCallback)(((e,{item:t,level:r=0},n)=>{const a=!!c.find((e=>e.id===t.id||e.id.includes(`${t.id}.`))),i=w.current===n;return v().createElement(pd,{key:t.id,onClick:s,checked:a,level:r,data:t,label:v().createElement(dd.o,{text:t.label,highlight:t.filterText}),labelInText:t.label,style:e,hideCheckBox:u,isFocused:i,notSelectable:t.notSelectable,LogoIcon:t.LogoIcon})}),[u,s,c]),R=(0,S.getMaxItemWidth)("label")(E)||308,I=md();return v().createElement(kp,fd({open:t,className:O()(I.container,I.popupContainer),anchorEl:r,onClose:i,onSearch:a,title:o,containerWidth:R,searchInputOnKeyDown:C},d),v().createElement(Vp,{height:300,renderItem:A,items:T,hideSubtitles:!0,getItemSize:()=>32,containerWidth:R,focusIndex:x,renderGroupTitle:p}))};hd.propTypes={open:dp().bool,hideCheckBox:dp().bool,anchorEl:dp().any,selected:dp().array,data:dp().array,filterText:dp().string,titleText:dp().string,onClose:dp().func,onListItemClick:dp().func,onSearch:dp().func,renderGroupTitle:dp().func},hd.defaultProps={data:[],selected:[],titleText:li().text("Show/hide columns"),filterText:""};var Ed=r(97179);function bd(){return bd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bd.apply(null,arguments)}const vd=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",bd({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},r),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",opacity:".54"},v().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"})))},Td="Headers-styles-container--Zbdka",Od="Headers-styles-actionsBar--RXMy4",Sd="Headers-styles-previewSwitcher--Ppqem";function xd(){return xd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xd.apply(null,arguments)}const Cd=e=>{let{entityTypeUri:t,headColumns:r=[],onSelectColumns:n=_.identity}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entityTypeUri","headColumns","onSelectColumns"]);const[i,o]=(0,b.useState)(null),[l,s]=(0,b.useState)(""),c=(0,mp.useSelector)(k().selectors.getMetadata),u=()=>{o(null),s("")},p=(0,b.useCallback)(((e,a)=>{const i=(0,Ai.kF)(c,t),o=(0,Ai.m5)(i,e.id);let l;l=o.length?a?r.concat(o):r.filter((e=>!o.find((t=>t.id===e.id)))):a?r.concat(e):r.filter((t=>t.id!==e.id)),n(l)}),[c,t,r,n]);return v().createElement(v().Fragment,null,v().createElement(Ed.k,xd({tooltipTitle:li().text("Show/hide columns"),size:"M",icon:vd,onClick:e=>o(e.currentTarget),className:"Headers-styles-headerIcon--c2qe7"},a)),(()=>{const e=(0,Ai.kF)(c,t);return v().createElement(hd,{open:!!i,anchorEl:i,data:e,onListItemClick:p,selected:r,filterText:l,onClose:u,onSearch:s})})())};Cd.propTypes={entityTypeUri:dp().string,headColumns:dp().array,onSelectColumns:dp().func};const wd=Cd;var Ad=r(45053),Rd=r(72897),_d=r(27618),Id=r.n(_d),Nd=r(98515),Pd=r.n(Nd),Dd=r(29289);const kd=({headCellData:e,headIndex:t,sortOrder:r,sortField:n,sortHandler:a,canCheck:i,onCheck:o,headerCheckboxState:l,openConfigColumnPopup:s})=>v().createElement("div",{className:O()("HeadCellRenderer-styles-headCellContentWrapper--L6RrQ",(0,_.path)(["wrapperClassName"],e))},e&&i&&v().createElement(Wp(),{className:"HeadCellRenderer-styles-checkbox--qQEHg",checked:l||!1,indeterminate:null===l,onChange:()=>o()}),v().createElement("div",{className:"HeadCellRenderer-styles-labelWrapper--cmclk"},e&&(e.sortable?v().createElement(Id(),{active:Boolean(r&&n===e.id),direction:r,onClick:a,classes:{root:"HeadCellRenderer-styles-sortLabel--NZx3o"},component:"div"},e.label):e.label)),s&&v().createElement("div",{className:"HeadCellRenderer-styles-menuButtonWrapper--aBNeR"},v().createElement(Cp.T,{icon:Pd(),onClick:s,size:"S","data-column-index":t})));kd.propTypes={headCellData:dp().shape({id:dp().string,label:dp().oneOfType([dp().string,dp().node]),sortable:dp().bool}),headIndex:dp().number,sortOrder:dp().string,sortField:dp().string,sortHandler:dp().func,canCheck:dp().bool,onCheck:dp().func,headerCheckboxState:dp().oneOf([!0,!1,null]),openConfigColumnPopup:dp().func};const Ld=(0,Dd.q)((0,_.pick)(["openConfigColumnPopup"]))(kd),Ud=(0,Dd.q)((0,_.pick)(["openConfigColumnPopup","canCheck","onCheck","headerCheckboxState"]))(kd),jd=v().createContext({generateEntityUrl:S.generateEntityUrlForOldMode,generatePivotingUrl:S.generatePivotingUrlForOldMode,generateTagUrl:S.generateTagUrlForOldMode});function Fd(){return Fd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fd.apply(null,arguments)}jd.displayName="UrlGeneratorsContext";const Md=(0,b.forwardRef)(((e,t)=>{let{value:r,children:n,screen:a,className:i,shouldOpenInNewTab:o=!1}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["value","children","screen","className","shouldOpenInNewTab"]);const{generateEntityUrl:s}=(0,b.useContext)(jd),c=(0,w.ax)("openEntity"),u=(0,w.Qh)(),p=(0,b.useCallback)((e=>{(0,xp.rR)(e)||(c({uri:r,screen:a}),e.preventDefault()),e.stopPropagation()}),[c,a,r]);return v().createElement("a",Fd({ref:t,href:(d=r,s({uiPath:u,uri:d,screen:a})),onClick:o?void 0:p,target:o?"_blank":"_self",rel:"noreferrer",className:i},l),n);var d}));Md.displayName="EntityUriLink";const Vd={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"},Bd=({value:e={}})=>{const t=(0,S.getLabel)(e.label);return v().createElement("div",{className:O()(Vd.defaultWrapper,Vd.profileWrapper)},v().createElement(A,{avatarClassName:Vd.entityAvatar,imageClassName:Vd.entityAvatarImage,entity:e}),v().createElement(Md,{value:(0,S.getEntityUriForLink)(e),className:Vd.entityLabel},t))};Bd.propTypes={value:dp().object};const zd=Bd;var Hd=r(56755);const Yd=({value:e,columnData:{dataTypeDefinition:t}})=>v().createElement("div",{className:Vd.defaultWrapper},t?v().createElement(Hd.x,{value:e,dataTypeDefinition:t}):e);Yd.propTypes={value:dp().any,columnData:dp().object};const Wd=Yd,Gd=(e,t,r)=>{const n=(0,S.getEntityTypeGraphIcon)(e,{type:t});return(0,S.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 Zd(){return Zd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zd.apply(null,arguments)}const $d=e=>{let{className:t,icon:r,avatarText:n,rootClasses:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","icon","avatarText","rootClasses"]);const[o,l]=(0,b.useState)(null);(0,b.useEffect)((()=>{l(r?qd.ICON_MODE:qd.TEXT_MODE)}),[r,n]);const s=()=>{l(qd.ERROR_MODE)};switch(o){case qd.ICON_MODE:return v().createElement(C(),Zd({className:O()(t,null==a?void 0:a.iconRoot),src:r,onError:s},i));case qd.TEXT_MODE:case qd.ERROR_MODE:return v().createElement(C(),Zd({className:O()(t,null==a?void 0:a.textRoot)},i),n);default:return null}},Kd=({value:e})=>{const t=(0,mp.useSelector)(k().selectors.getMetadata),r=(0,mp.useSelector)(k().selectors.getApiPath),n=(0,mp.useSelector)(k().selectors.getImagePath);return e&&v().createElement("div",{className:O()(Vd.defaultWrapper,Vd.referenceWrapper)},v().createElement($d,{className:Vd.referenceIcon,icon:Gd(t,e.refEntity.type,n||r)}),v().createElement(Md,{value:e.refEntity.objectURI,className:Vd.referenceContent},(0,S.getLabel)(e.label)))};Kd.propTypes={value:dp().object};const Xd=Kd,Qd=e=>{e.stopPropagation()},Jd=e=>{const{value:t}=e;return v().createElement("div",{className:Vd.blobWrapper,onScroll:Qd},t)};Jd.propTypes={value:dp().any};const em=Jd,tm=({value:e})=>{const t=(0,S.getImageAttributeOvThumbnailUrl)({value:e});return t&&v().createElement("div",{className:Vd.imageWrapper},v().createElement("img",{src:t}))};tm.propTypes={value:dp().object};const rm=tm,nm=e=>{if("label"===e.id)return zd;switch((0,_.path)(["attrType","type"],e)){case"Reference":return Xd;case"Blob":return em;case"Image":return rm}return Wd};function am(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){im(e,t,r[t])}))}return e}function im(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const om=(0,_.split)("."),lm=["entityId"],sm=e=>!lm.includes(e.id),cm=e=>{if((0,S.isAttributeSearchUri)(e)){const[,...t]=om(e);return t.length>1?t.slice(0,-1):null}return null};var um=r(39034),pm=r(57526),dm=r.n(pm),mm=r(18567),fm=r.n(mm),ym=r(99272),gm=r.n(ym);const hm=(0,wp.Z)({root:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px"},check:{color:"#8CC152"}}),Em=({classes:e={},tooltip:t="",onClick:r=_.identity,mode:n=um.Eh.Init})=>{const a=hm();return v().createElement("div",{className:O()(a.root,e.root)},(()=>{switch(n){case um.Eh.Init:return v().createElement(Ed.k,{className:e.button,size:"M",tooltipTitle:t,icon:fm(),onClick:r});case um.Eh.Progress:return v().createElement(dm(),{className:e.spinner,size:24});case um.Eh.Success:return v().createElement(gm(),{className:O()(a.check,e.check)});default:return null}})())};function bm(){return bm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bm.apply(null,arguments)}const vm=e=>{let{entity:t,importStatus:r,onImportStatusChange:n,hideDelay:a=3e3}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entity","importStatus","onImportStatusChange","hideDelay"]);const o=(0,mp.useSelector)(k().selectors.getDtssPath),l=(0,mp.useSelector)(k().selectors.getTenant);return v().createElement(Em,bm({},i,{mode:r,tooltip:li().text("Import this record"),onClick:e=>{e.stopPropagation(),n(um.Eh.Progress),(0,S.importEntityFromDataTenant)({dtssPath:o,customerTenant:l,entity:t}).then((({success:e,uris:r})=>{if(!e)throw new Error("Failed to import entity");t.ctSubscribedUris=r,n(um.Eh.Success),setTimeout((()=>n(um.Eh.Done)),a)})).catch((()=>{n(um.Eh.Init),(0,ii.U)(undefined,{title:li().text("Import Error"),message:li().text("Record can't be imported")})}))}}))},Tm=(0,wp.Z)({importButtonPlaceholder:{display:"flex",alignItems:"center",padding:"0 10px",width:"24px",flexShrink:0,position:"relative"}}),Om=({entity:e,entityImportStatus:t,onEntityImportStatusChange:r})=>{const n=Tm(),a=(0,mp.useSelector)(k().selectors.getMetadata),i=(0,mp.useSelector)(k().selectors.getCanUserImportEntitiesFromDT),o=(0,S.isDataTenantEntity)(e)&&i,l=(0,S.getEntityType)(a,e.type),s=(0,S.checkCanImportEntityOfType)(l)&&!(0,S.isEntityImportedToCT)(e),c=t&&t!==um.Eh.Done||s;return v().createElement(v().Fragment,null,o&&v().createElement("div",{className:n.importButtonPlaceholder},c&&v().createElement(vm,{entity:e,importStatus:t,onImportStatusChange:t=>r(e.uri,t)})))},Sm=({entity:e,isSelectedEntity:t,isHighlightedEntity:r,entityImportStatus:n,onEntityImportStatusChange:a})=>v().createElement("div",{className:O()(Vd.entityButtons,{[Vd.selectedEntityButtons]:t,[Vd.justImportedEntityButtons]:n===um.Eh.Success,[Vd.highlightedEntityButtons]:r})},v().createElement(Om,{entity:e,entityImportStatus:n,onEntityImportStatusChange:a}));Sm.propTypes={entity:dp().object,isSelectedEntity:dp().bool,isHighlightedEntity:dp().bool,entityImportStatus:dp().oneOf(Object.values(um.Eh)),onEntityImportStatusChange:dp().func};const xm=(0,Dd.q)((({entitiesImportStatus:e,onEntityImportStatusChange:t,selectedEntityUri:r,highlightedEntityIndex:n},{entity:a,rowIndex:i})=>({entityImportStatus:a&&e[a.uri],onEntityImportStatusChange:t,isSelectedEntity:r===a.uri,isHighlightedEntity:n===i})))(Sm);var Cm=r(72326),wm=r(67655);function Am(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Rm(e,t,r[t])}))}return e}function Rm(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _m={height:"100%",display:"flex",flexDirection:"column"},Im=(0,wp.Z)((e=>({inactiveCell:Am({background:e.inactiveBackground},_m,{"&$selectedRowCell":{background:e.inactiveSelectedBackground}}),selectedRowCell:Am({background:(0,wm.lighten)(e.palette.primary.main,.88)},_m),clickable:Am({cursor:"pointer"},_m),justImported:Am({backgroundColor:"#FFFBEB !important"},_m)}))),Nm={entity:dp().object,isSelected:dp().bool,onEntityClick:dp().func,isJustImported:dp().bool},Pm=(0,wp.Z)({checkboxWrapper:{display:"flex",alignItems:"center"},checkbox:{marginRight:"-8px",marginLeft:"11px"}}),Dm={onCheck:dp().func,isChecked:dp().bool,hasCheckbox:dp().bool},km=(0,wp.Z)({collapser:{marginLeft:"-2px"}});var Lm=r(18021),Um=r(8835),jm=r.n(Um);const Fm=(0,wp.Z)({collapseButton:{cursor:"pointer"},expandLess:{transform:"rotate( -180deg )"}});function Mm(){return Mm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Mm.apply(null,arguments)}const Vm=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isOpen","tooltipTitle"]);const a=Fm(),i={icon:jm(),className:a.collapseButton,iconClassName:O()({[a.expandLess]:t})},o={tooltipTitle:r};return v().createElement(Ed.k,Mm({"data-reltio-id":"collapse-button"},i,o,n))},Bm=(0,wp.Z)((()=>({hidden:{visibility:"hidden"}}))),zm=({rowIndex:e,rowValue:t,className:r})=>{const n=Bm(),{toggleRowCollapse:a,getIsRowCollapsible:i,getIsRowCollapsed:o}=(0,b.useContext)(Lm.x),l=i(t),s=o(e);return v().createElement(Vm,{className:O()(r,{[n.hidden]:!l}),isOpen:!s,onClick:t=>{a(e),t.stopPropagation()}})},Hm={hasCollapseButton:dp().bool},Ym=(0,_.pipe)((e=>{const t=t=>{const r=km(),{hasCollapseButton:n}=t,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["hasCollapseButton"]),{rowValue:i,rowIndex:o}=a;return n?v().createElement("div",{className:"cellWithCollapser"},v().createElement(zm,{className:r.collapser,rowIndex:o,rowValue:i}),v().createElement(e,a)):v().createElement(e,a)};return t.propTypes=Hm,t}),(e=>{const t=t=>{const r=Pm(),{onCheck:n,isChecked:a,hasCheckbox:i}=t,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["onCheck","isChecked","hasCheckbox"]),{rowValue:{rawValue:l}}=o;return i?v().createElement("div",{className:O()(r.checkboxWrapper,"cellWithCheckbox")},v().createElement(Wp(),{className:r.checkbox,checked:a,onClick:e=>e.stopPropagation(),onChange:e=>n(l.uri,e.target.checked)}),v().createElement(e,o)):v().createElement(e,o)};return t.propTypes=Dm,t}),(e=>{const t=t=>{const r=Im(),{rowValue:{rawValue:n},isSelected:a,onEntityClick:i,isJustImported:o}=t,l=i?()=>i(n.uri):void 0,s=n&&!(0,S.isActiveObject)(n);return l||s||a||o?v().createElement("div",{className:O()({[r.inactiveCell]:s},{inactiveCell:s},{[r.selectedRowCell]:a},{selectedRowCell:a},{[r.clickable]:!!l},{[r.justImported]:o},{justImported:o}),onClick:l},v().createElement(e,t)):v().createElement(e,t)};return t.propTypes=Nm,t}),(0,Dd.q)((({onEntityClick:e,selectedEntityUri:t,entitiesImportStatus:r,canCheck:n,onCheck:a,checkedEntitiesUris:i},{rowValue:o,columnIndex:l})=>{const{rawValue:s}=o,c=0===l;return{onCheck:a,isChecked:i&&i.includes(s.uri),hasCheckbox:n&&c,hasCollapseButton:c,isSelected:t===s.uri,isJustImported:r[s.uri]===um.Eh.Success,onEntityClick:e}})))(Cm.DN),Wm=({columnData:e,cell:t})=>{const r=t.values.length,n=28*Math.max(r,1)+20;if(!r)return n;switch((0,_.path)(["dataTypeDefinition","type"],e)){case"Reference":return 28*r+17;case"Blob":return 100*r;case"Image":return 76*r+17;default:return n}},Gm=(0,b.forwardRef)((({headColumns:e,entities:t,entityToHighlight:r,selectedEntityUri:n,onReorderingColumn:a,dndColumnReorderingEnabled:i,columnsSize:o,onChangeColumnsSize:l,onScroll:s,onSort:c,sortField:u,sortOrder:p,onEntityHover:d,onEntityClick:m,entitiesImportStatus:f,onEntityImportStatusChange:y,logger:g,canCheck:h,checkedEntitiesUris:E,headerCheckboxState:T,onCheck:O,openConfigColumnPopup:x,resizeDebounceDelay:C},w)=>{const A=(0,b.useMemo)((()=>({highlightRow:"highlightedSelector",dragColumnHead:Vd.dragColumnHead,dragColumnBody:Vd.dragColumnBody,draggableHeadCell:Vd.draggableHeadCell,cellWrapper:Vd.cellWrapper})),[]),R=(0,mp.useSelector)(k().selectors.getMetadata),[I,N]=(0,b.useState)(null),P=(0,b.useCallback)((e=>{N(e),d&&d((0,_.path)([e,"uri"],t))}),[d,t]),D=(0,b.useRef)();(0,b.useImperativeHandle)(w,(()=>({resetScrollbarPosition:()=>{D.current&&D.current.resetScrollbarPosition({resetLeft:!1})}})));const L=(0,b.useCallback)((e=>{p&&e===u?p===Ad.oy?c({field:e,order:Ad.U9}):c({field:e}):c({field:e,order:Ad.oy})}),[c,u,p]),U=(0,b.useCallback)((e=>{const r=(0,_.prop)(e,t);return r?v().createElement(xm,{entity:r,rowIndex:e}):null}),[t]),j=(0,b.useCallback)((e=>v().createElement(Ym,e)),[]),F=!!d,M=!!c,V=(0,b.useMemo)((()=>((e,t=!0)=>e.map(((e,r)=>{var n;let{attrType:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attrType"]);const o=0===r;return am({},i,{dataTypeDefinition:a&&(0,S.getAttrDataTypeDefinition)(a),resizable:!0,autoResize:null!==(n=i.autoResize)&&void 0!==n?n:!o,draggable:!o,sortable:t&&sm(i),nestedPath:cm(i.id),headCellRenderer:o?Ud:Ld,rowCellValueRenderer:nm(am({},i,{attrType:a}))})})))(e,M)),[e,M]),B=(0,b.useMemo)((()=>((e,t,r)=>(r||[]).map((e=>(0,_.pipe)((0,_.reduce)(((t,r)=>(0,_.assoc)(r.id,((e,t,r)=>{switch(t.id){case"label":return r;case"entityId":return(0,S.getEntityId)(r);default:{const[e,...n]=om(t.id);return(0,_.pipe)((0,_.prop)(e),(0,S.getOvAttributeValuesByPath)(n))(r)}}})(0,r,e),t)),{}),(0,_.assoc)("rawValue",e))(t))))(0,e,t)),[R,e,t]),z=r?t.findIndex((0,_.propEq)("uri",r)):-1,H=(0,b.useMemo)((()=>({onEntityClick:m,selectedEntityUri:n,highlightedEntityIndex:z,entitiesImportStatus:f,onEntityImportStatusChange:y,canCheck:h,checkedEntitiesUris:E,headerCheckboxState:T,onCheck:O,openConfigColumnPopup:x})),[E,f,T,z,h,O,m,y,n,x]);return v().createElement(Rd.M,{fixFirstColumn:!0,onScroll:s,rowsData:B,columnsData:V,onSort:L,highlightRow:-1!==z?z:null,ref:D,sortFieldClassName:Vd.sortableCell,containerClassName:Vd.table,classes:A,defaultColumnWidth:250,headRowHeight:50,defaultColumnMinWidth:100,defaultRowHeight:48,sorting:{field:u,order:p},dndColumnReorderingHandler:a,dndColumnReorderingEnabled:i,onChangeColumnsSize:l,columnsSize:o,resizeDebounceDelay:null!=C?C:150,onRowHover:F?P:void 0,hoverStateEnabled:F,hoverRowIndex:I,renderRowOverlay:U,logger:g,context:H,maxRowValuesCount:2,renderRowCell:j,getRowCellHeight:Wm})}));Gm.propTypes={entities:dp().array,entityToHighlight:dp().string,selectedEntityUri:dp().string,headColumns:dp().array,columnsSize:dp().array,onScroll:dp().func,onSort:dp().func,onReorderingColumn:dp().func,onChangeColumnsSize:dp().func,dndColumnReorderingEnabled:dp().bool,onEntityClick:dp().func,onEntityHover:dp().func,sortField:dp().string,sortOrder:dp().oneOf([Ad.oy,Ad.U9]),entitiesImportStatus:dp().object,onEntityImportStatusChange:dp().func,logger:dp().func,canCheck:dp().bool,checkedEntitiesUris:dp().arrayOf(dp().string),headerCheckboxState:dp().oneOf([!0,!1,null]),onCheck:dp().func,openConfigColumnPopup:dp().func,resizeDebounceDelay:dp().number},Gm.defaultProps={entities:[],headColumns:[]},Gm.displayName="EntitiesTable";const qm=(0,b.memo)(Gm);var Zm=r(4437),$m=r.n(Zm),Km=r(5106),Xm=r.n(Km);const Qm="left",Jm="right",ef="hide",tf={[Qm]:li().text("Insert 1 left"),[Jm]:li().text("Insert 1 right"),[ef]:li().text("Hide column")},rf=({open:e,anchorEl:t,onClick:r,onClose:n,actions:a})=>v().createElement(yp(),{open:e,anchorEl:t,onClose:n},v().createElement($m(),{component:"div"},a.map(((e,t)=>((e,t,r)=>v().createElement(Xm(),{button:!0,component:"div",key:r,onClick:t},v().createElement(Hp(),{primary:tf[e],primaryTypographyProps:{variant:"body2"}})))(e,(e=>()=>{r(e)})(e),t)))));rf.propTypes={open:dp().bool,anchorEl:dp().any,onClick:dp().func,onClose:dp().func,actions:dp().array};const nf=rf;class af extends v().PureComponent{constructor(...e){super(...e),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=({newColumnPlaceIndex:e})=>{this.setState({newColumnPlaceIndex:e,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 Qm:this.openAddColumnPopup({newColumnPlaceIndex:t});break;case Jm:this.openAddColumnPopup({newColumnPlaceIndex:t+1});break;case ef: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,S.memoizeWith)(af.getMemoIdForColumnSize,af.getColumnSizeFromHeadColumns)}static getColumnSizeFromHeadColumns(e){return e.map((e=>({id:e.id,size:e.size})))}static getMemoIdForColumnSize(e,t){return`${t}${(0,_.toString)(e.map((e=>(0,_.pick)(["id","size"],e))))}`}render(){const{entities:e,entityToHighlight:t,selectedEntityUri:r,onScroll:n,headColumns:a,sortField:i,sortOrder:o,dndColumnReorderingEnabled:l,onEntityClick:s,onEntityHover:c,entitiesTableRef:u,additionalColumns:p,onChangeColumnsList:d,onReorderingColumn:m,onSort:f,onChangeColumnsSize:y,entityTypeUri:g,entitiesImportStatus:h={},onEntityImportStatusChange:E,logger:b,canCheck:T,checkedEntitiesUris:O,headerCheckboxState:S,onCheck:x,resizeDebounceDelay:C}=this.props,{addColumnPopupOpen:w,configColumnPopupOpen:A,popupAnchor:R,filterText:_,configurableColumnIndex:I}=this.state,N=this.memoizedGetColumnSize(a,g);return v().createElement(v().Fragment,null,v().createElement(qm,{entities:e,entityToHighlight:t,selectedEntityUri:r,onScroll:n,onSort:f,onEntityClick:s,onEntityHover:c,headColumns:a,sortField:i,sortOrder:o,onReorderingColumn:m,ref:u,onChangeColumnsList:d,dndColumnReorderingEnabled:l,onChangeColumnsSize:y,columnsSize:N,entitiesImportStatus:h,onEntityImportStatusChange:E,logger:b,canCheck:T,checkedEntitiesUris:O,headerCheckboxState:S,onCheck:x,openConfigColumnPopup:this.openConfigColumnPopup,resizeDebounceDelay:C}),v().createElement(hd,{open:w,anchorEl:R,data:p,onListItemClick:this.addColumnHandler,filterText:_,onClose:this.closeAddColumnPopup,onSearch:this.setFilterText,hideCheckBox:!0,titleText:oi.text("Add column")}),v().createElement(nf,{onClick:this.configColumnHandler,onClose:this.closeConfigColumnPopup,anchorEl:R,open:A,actions:I>0?[Qm,Jm,ef]:[Jm]}))}}af.propTypes={entities:dp().array,entityToHighlight:dp().string,selectedEntityUri:dp().string,entityTypeUri:dp().string,headColumns:dp().array,dndColumnReorderingEnabled:dp().bool,onScroll:dp().func,onSort:dp().func,onReorderingColumn:dp().func,onChangeColumnsSize:dp().func,onChangeColumnsList:dp().func,onEntityClick:dp().func,onEntityHover:dp().func,sortField:dp().string,sortOrder:dp().oneOf([Ad.oy,Ad.U9]),entitiesTableRef:dp().shape({current:dp().shape({resetScrollbarPosition:dp().func})}),additionalColumns:dp().arrayOf(dp().shape({id:dp().string,label:dp().string})),entitiesImportStatus:dp().object,onEntityImportStatusChange:dp().func,logger:dp().func,canCheck:dp().bool,checkedEntitiesUris:dp().arrayOf(dp().string),headerCheckboxState:dp().oneOf([!0,!1,null]),onCheck:dp().func};const of=af;var lf=r(66780),sf=r(9366),cf=r(41633),uf=r(79881),pf=r.n(uf),df=r(93962),mf=r.n(df),ff=r(45995),yf=r.n(ff);function gf(){return gf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gf.apply(null,arguments)}const hf=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["open","children"]);const[a,i]=(0,b.useState)(t),o=(0,wm.useTheme)().transitions.duration.leavingScreen;return(0,b.useEffect)((()=>{if(t!==a){if(!t){const e=setTimeout((()=>{i(!1)}),o);return()=>clearTimeout(e)}i(!0)}}),[t,o,a]),v().createElement(yf(),gf({open:t},n),a&&r)};hf.displayName="Drawer";var Ef=r(18759),bf=r.n(Ef),vf=r(30122),Tf=r.n(vf),Of=r(43410),Sf=r.n(Of),xf=r(93416),Cf=r.n(xf),wf=r(66825),Af=r.n(wf),Rf=r(17698);const _f=(0,_.allPass)([(0,_.propSatisfies)(_.isEmpty,"configs"),(0,_.pathEq)(["group","hasCollapseButton"],!0)]),If=(0,_.reject)(_f),Nf=(0,wp.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"}}),Pf=({title:e="",iconSrc:t="",isOpen:r=!0,hasCollapseButton:n=!0,leftIcon:a,onCollapse:i})=>{const o=Nf();return v().createElement("div",{className:o.titleBox},v().createElement("div",{className:o.title},a&&v().createElement("div",{className:o.leftIcon},a),t&&v().createElement(C(),{src:t,className:o.avatar}),v().createElement(od.Y,{value:e},v().createElement("span",{className:o.text},e))),n&&v().createElement(Vm,{isOpen:r,onClick:i,className:o.collapseIcon,size:"S"}))};var Df=r(1230),kf=r.n(Df),Lf=r(36631);const Uf=({facet:e,selectedFacets:t})=>!!t.find((t=>t.fieldName===e.fieldName||t.fieldName.includes(`${e.fieldName}.`))),jf=({facet:e,selectedFacets:t})=>Uf({facet:e,selectedFacets:t})||(0,N.OP)(e)&&e.children&&e.children.some((e=>Uf({facet:e,selectedFacets:t}))),Ff=(0,wp.Z)({icon:{maxHeight:"25px",maxWidth:"25px",marginRight:"16px"}}),Mf=({group:e,metadata:t})=>{const r=Ff(),n=(0,w.$H)(),a=(0,S.getEntityTypeGraphIcon)(t,{type:e.id}),i=(0,S.getAbsoluteImageUrl)(n,a);return v().createElement($d,{className:r.icon,icon:i,avatarText:e.title[0]})};function Vf(){return Vf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vf.apply(null,arguments)}const Bf=e=>{let{onListItemClick:t,focusIndex:r,selectedFacets:n,metadata:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onListItemClick","focusIndex","selectedFacets","metadata"]);const o=(0,b.useRef)(null);o.current=n;const l=(0,b.useRef)(null);l.current=r;const s=(0,b.useCallback)(((e,{item:r,level:n,groupId:a},i)=>{const s=jf({facet:r,selectedFacets:o.current}),c=l.current===i;return v().createElement(pd,{key:`item-${a}-${r.fieldName}`,onClick:t,data:r,label:v().createElement(dd.o,{text:r.title,highlight:r.filterText}),labelInText:r.title,level:n,style:e,checked:s,isFocused:c,groupId:a,LogoIcon:r.LogoIcon})}),[t]),c=(0,b.useCallback)(((e,t)=>v().createElement(Xm(),{component:"div",className:"MoreFacetsPopup-styles-subHeader--h1vGz",style:e,key:`group-${t.item.id}`},t.item.needGroupIcon&&v().createElement(Mf,{metadata:a,group:t.item}),t.item.title)),[a]),u=(0,b.useCallback)(((e,t)=>t.items?40:28),[]);return v().createElement(Vp,Vf({getItemSize:u,renderGroupTitle:c,renderItem:s,focusIndex:r},i,{disableHorizontalScrollbar:!0}))};function zf(){return zf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zf.apply(null,arguments)}const Hf=574,Yf={},Wf=e=>{let{metadata:t,open:r,selectedFacets:n,data:a=[],onListItemClick:i,lastFacetClicked:o=Yf,width:l,height:s=Hf}=e,c=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["metadata","open","selectedFacets","data","onListItemClick","lastFacetClicked","width","height"]);const[u,p]=(0,b.useState)(464),d=s-110;(0,b.useEffect)((()=>{p(d)}),[d]);const m=(0,b.useCallback)(((e,t)=>p((0,_.clamp)(56,d,t))),[d]),f=(0,b.useRef)();(0,b.useEffect)((()=>{const e=(0,_.path)(["current","updatePosition"],f);e&&e()}),[u]);const y=(0,b.useCallback)(((e,t,r=0)=>[{type:"item",item:e,moveTo:(0,_.has)("facetConfig")(o)&&o.facetConfig.fieldName===e.fieldName&&t===o.groupId,level:r,groupId:t}].concat(e.children?e.children.flatMap((e=>y(e,t,r+1))):[]).flat().filter((e=>!e.item.hide))),[o]),g=(0,b.useCallback)((e=>e.map((e=>({type:"group",item:e,items:e.facets.filter((e=>!e.hide)).map((t=>y(t,e.id)))}))).filter((e=>e.items.length))),[y]),h=(0,b.useMemo)((()=>g(a)),[a,g]),E=(0,b.useMemo)((()=>(0,ci.LG)(h)),[h]),T=(0,b.useCallback)((({item:e,groupData:t})=>{i(e,!jf({facet:e,selectedFacets:n}),t.groupId)}),[i,n]),{focusIndex:O,handleKeyDown:x}=Bp({items:E,open:r,onSelectFocusedItem:T,selectedItems:n}),C=Math.max(l||(0,S.getMaxItemWidth)("title")(h),240);return v().createElement(kp,zf({open:r,action:f,title:li().text("Select attribute"),containerWidth:C,searchInputOnKeyDown:x,containerHeight:110+u},c),v().createElement(Bf,{focusIndex:O,selectedFacets:n,onListItemClick:i,metadata:t,items:E,height:u,onInnerContainerResize:m}),0===E.length&&v().createElement("div",{className:"MoreFacetsPopup-styles-noResultsCaptionContainer--ChfND"},v().createElement(bf(),{variant:"caption",display:"block",gutterBottom:!0},li().text("No results found"))))};function Gf(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){qf(e,t,r[t])}))}return e}function qf(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Zf extends b.PureComponent{constructor(e){super(e),this.state={filterText:"",lastFacetClicked:null,addedFacets:[]},this.searchInputRootRef=v().createRef(),this.showSearchInput=()=>this.searchInputRootRef.current.scrollIntoView(!0),this.openPopup=()=>this.props.dispatch(fi(!0)),this.closePopup=()=>{this.props.dispatch(fi(!1)),this.props.dispatch(((e=[])=>({type:L.k.HIGHLIGHT_ADDED_FACETS,payload:e}))(this.state.addedFacets)),this.setState({addedFacets:[]}),setTimeout((()=>{this.props.dispatch({type:L.k.CLEAR_HIGHLIGHT_ADDED_FACETS})}),3e3)},this.setFilterText=e=>this.setState({filterText:e,lastFacetClicked:null}),this.clearFilterText=()=>this.setFilterText(""),this.setLastFacetClicked=e=>this.setState({lastFacetClicked:e}),this.resetLastFacetClicked=()=>this.setLastFacetClicked(null),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=>Gf({},e,{hide:!this.filterItemsTree(e),filterText:this.state.filterText}))).map((e=>{const t=this.getFilteredFacets(e.children);return(0,_.isEmpty)(t)?e:Gf({},e,{children:t})})),this.filterItemsInGroups=e=>e.map((e=>Gf({},e,{facets:this.getFilteredFacets(e.facets)}))),this.rejectNotAllowedEntityTypes=e=>t=>t.filter((({id:t})=>!(0,S.isEntityTypeUri)(t)||e.includes(t))),this.toggleSelectedFacet=(e,t)=>{const{facetsConfigs:r,selectedEntityTypes:n,dispatch:a}=this.props,i=(0,ci.jj)(e),o=t?r.concat(e).concat(i):r.filter((t=>t.fieldName!==e.fieldName)).filter((e=>!i.find((t=>t.fieldName===e.fieldName)))),l=(0,_.uniq)(o.filter((e=>e.entityTypeUri)).map((e=>e.entityTypeUri)).concat(n)),s=o.filter((0,_.complement)(N.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,_.prop)("fieldName")),u),a(ri({facetsToAdd:c,fieldNamesToDelete:u,changedEntityTypes:(0,_.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,Lf.Z)(N.tI),this.handleInputFocus=()=>{this.showSearchInput(),this.openPopup()}}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:i,selectedEntityTypes:o,facetsConfigs:l,dataTenantObject:s,allowedEntityTypes:c,dataTenants:u}=this.props,p=l.map((e=>({fieldName:e.fieldName,uri:e.uri}))),d=this.memoizedCollectFacetsList(i,o,n,u),m=(0,_.pipe)((0,_.when)((0,_.always)(e),this.filterItemsInGroups),(0,_.when)((0,_.always)(c),this.rejectNotAllowedEntityTypes(c)),(0,j.Eb)(s))(d),{verticalOrigin:f,popupHeight:y}=((e,t,r=16)=>{let n="top";if(e){const a=e.getBoundingClientRect(),i=r,o=window.innerHeight-r;if(a.top+t>o)if(a.bottom-t<i){const e=a.bottom-i,r=o-a.top;t=Math.max(e,r),n=e>r?"bottom":"top"}else n="bottom"}return{verticalOrigin:n,popupHeight:t}})(this.searchInputRootRef.current,Hf),g={vertical:f,horizontal:"right"};return v().createElement(b.Fragment,null,v().createElement(Np,{classes:{root:a.inputContainer},onSearch:this.setFilterText,onFocus:this.handleInputFocus,rootRef:this.searchInputRootRef,value:e,placeholder:li().text("Search & add attributes"),height:40,"data-reltio-id":"reltio-search-more-facets-search-input"}),v().createElement(Wf,{open:r,anchorEl:this.searchInputRootRef.current,metadata:i,selectedFacets:p,data:m,onClose:this.handlePopupClose,onListItemClick:this.handleItemClick,lastFacetClicked:t,width:this.inputWidth,height:y,onSearch:this.setFilterText,headerPlacement:"bottom"===f?"bottom":"top",anchorOrigin:g,transformOrigin:g,disableRestoreFocus:!0}))}}Zf.defaultProps={selectedEntityTypes:[],facetsConfigs:[]};const $f=(0,mp.connect)((e=>({metadata:k().selectors.getMetadata(e),open:(0,Ri.ds)(e),facetsConfigs:(0,P.Mp)(e),recommendedFacets:(0,P.ER)(e),selectedEntityTypes:(0,P.DX)(e),dataTenantObject:(0,ai.t9)(e),allowedEntityTypes:(0,Ri.Xf)(e),dataTenants:k().selectors.getDataTenants(e)})))(kf()((()=>({inputContainer:{margin:"4px 16px 16px",flexShrink:"0"}})))(Zf)),Kf=(0,wp.Z)({facetGroupContainer:{display:"flex",flexShrink:0,flexDirection:"column","& + hr":{marginTop:8},"& + &":{marginTop:"8px"}}});function Xf(){return Xf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xf.apply(null,arguments)}const Qf=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["hasSearchAttributesField","children"]);const a=Kf(),[i,o]=(0,b.useState)(!0);return v().createElement("div",{className:a.facetGroupContainer},v().createElement(Pf,Xf({isOpen:i,onCollapse:e=>{o(!i)}},n)),t&&v().createElement(v().Fragment,null,v().createElement($f,null),v().createElement(Af(),null)),i&&r)};function Jf(){return Jf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jf.apply(null,arguments)}var ey=r(52004),ty=r.n(ey),ry=r(58282),ny=r.n(ry);const ay=(0,wp.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)"}}))),iy=({active:e,onClick:t,className:r})=>{const n=ay();return v().createElement(ty(),{className:O()(n.viewMoreLessLink,r),onClick:t,underline:"none"},v().createElement(ny(),{"data-reltio-id":"more-arrow-icon",className:O()(n.arrow,{[n.rotated]:e})}),e?li().text("View less"):li().text("View more"))};var oy=r(50592),ly=r(23888),sy=r.n(ly);const cy=(0,wp.Z)((e=>({bar:{backgroundColor:e.palette.secondary.main,opacity:.12,position:"absolute",minHeight:"20px",minWidth:"5px",borderRadius:"2px",top:0,left:0,height:"100%"}}))),uy=e=>(0,_.is)(Number,e),py=({className:e,width:t=0,maxWidth:r})=>{const n=cy(),a=(0,b.useCallback)((e=>(r?100*e/r:0)+"%"),[r]);return t?v().createElement("div",{className:O()(n.bar,e),style:{width:uy(t)?a(t):t}}):null},dy=(0,wp.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 my(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fy={showColorBar:!0,hasOnlyButton:!1},yy=({config:e,data:t=[],values:r=[],onChange:n=_.identity})=>{const a=dy();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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){my(e,t,r[t])}))}return e}({},fy,e);const i=e=>()=>{const t=r.includes(e)?r.filter((t=>t!==e)):r.concat(e);n(t)},o=Math.max(...t.map((e=>e.number)));return v().createElement("div",{className:a.listContainer},t.map((t=>v().createElement("div",{key:t.value,className:O()(a.item,{[a.disabled]:!t.number&&!r.includes(t.value)}),"data-reltio-id":"search-facets-list-row"},(e=>v().createElement(Wp(),{className:O()(a.checkbox,{[a.checked]:r.includes(e.value)}),checked:r.includes(e.value),onChange:i(e.value),value:e.value,color:"primary"}))(t),v().createElement("div",{className:a.info,onClick:i(t.value)},(e=>v().createElement(py,{className:O()({[a.checkedBar]:r.includes(e.value)}),width:e.number,maxWidth:o}))(t),v().createElement("div",{className:O()(a.textInfo)},v().createElement("div",{className:a.text},t.label),v().createElement("div",{className:a.count},void 0===t.number?li().text("N/A"):(0,ni.k7)(t.number,5e3))),e.hasOnlyButton&&(e=>{return v().createElement(sy(),{className:a.buttonONLY,onClick:(t=e.value,e=>{e.stopPropagation(),n([t])})},li().text("ONLY"));var t})(t))))))};var gy=r(1441);const hy=(0,wp.Z)((()=>({container:{overflow:"hidden",display:"flex",flexGrow:1,flexDirection:"column",fontSize:"13px"},noData:{marginLeft:"16px"},viewMoreLess:{paddingLeft:"20px"}}))),Ey=({config:e,data:t=[],values:r=[],onChange:n})=>{const a=hy(),i=(0,mp.useDispatch)(),o=(0,b.useCallback)((({show:e})=>{i((({show:e,silent:t})=>({type:L.k.SHOW_MORE_ENTITY_TYPES,payload:{show:e,silent:t}}))({show:e}))}),[i]),l=(0,mp.useSelector)((t=>(0,P.jC)(e,t))),s=(0,mp.useSelector)(ai.t9),c=t.length>Z.wP,u=(0,b.useCallback)((()=>{o({show:!l})}),[o,l]),p=(0,b.useMemo)((()=>{const e=l?t:t.slice(0,Z.wP);return(0,gy.ZK)(e,s)}),[t,l,s]);return v().createElement("div",{className:a.container},t.length>0?v().createElement(v().Fragment,null,v().createElement(yy,{data:p,values:r,onChange:n,config:e}),c&&v().createElement(iy,{active:l,onClick:u,className:a.viewMoreLess})):v().createElement(oy.K,{variant:"noData",className:a.noData}))};var by=r(70347),vy=r(94852);const Ty=(0,vy.M)(by.ZP);var Oy=r(75237),Sy=r(27308);const xy=(0,vy.M)(Sy.ZP);var Cy=r(22507),wy=r(14658);function Ay(){return Ay=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ay.apply(null,arguments)}const Ry={Option:({innerProps:e,innerRef:t,children:r,isFocused:n,isSelected:a,selectProps:{classes:i},label:o})=>v().createElement(qp(),Ay({className:O()(i.option,{[i["option--selected"]]:a}),ref:t,selected:n,component:"div"},e),v().createElement(Wp(),{color:"primary",checked:a}),v().createElement(od.Y,{value:o},v().createElement("div",{className:i["option--item"]},r)))},_y=(0,wp.Z)((e=>({label:{top:6,left:16},placeholder:({placeholder:e,label:t})=>({display:!e||t?"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)}})));function Iy(){return Iy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Iy.apply(null,arguments)}function Ny(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Py(e,t,r[t])}))}return e}function Py(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let Dy=0;const ky=e=>{const{label:t,creatable:r,getOptions:n,loadingIndicator:a,components:i,classes:o,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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","creatable","getOptions","loadingIndicator","components","classes","styles","onChange","onInputChange","menuPlacement"]),d=r?Ty:n?xy:Oy.J,[m,f]=(0,b.useState)(""),y=_y((0,_.omit)(["classes"],e)),g="custom-select-"+Dy++,h=(0,b.useRef)();((e=[],t)=>{const r=(0,wy.D)(null==e?void 0:e.length);(0,b.useEffect)((()=>{const n=setTimeout((()=>{const n=(e=>{let t=null==e?void 0:e.parentElement;for(;t;){if(t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null})(null==t?void 0:t.current);var a;n&&((e,t,r,n)=>e&&t<e&&n.getBoundingClientRect().bottom>r.getBoundingClientRect().bottom)(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,_.either)((0,_.path)(["select","controlRef"]),(0,_.path)(["select","select","controlRef"]))(e.current)),t})(h));const E=Ny({},Ry,i),T=(0,Cy.z)(y,o),O=Ny({indicatorSeparator:e=>Ny({},e,{margin:"10px 0"}),loadingIndicator:e=>Ny({},e,{display:a?e.display:"none"}),loadingMessage:e=>Ny({},e,{fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif'})},l),S=t?{inputId:g,TextFieldProps:Ny({label:t,InputLabelProps:{htmlFor:g,shrink:!(!e.value||!e.value.length)||void 0,className:T.label}},e.TextFieldProps)}:{};return v().createElement(d,Iy({isMulti:!0,inputId:g,inputValue:m,onChange:function(e,t){s(e,t),"create-option"===t.action&&(f(""),c("",{action:"input-change"}))},onInputChange:function(e,{action:t}){c(e,{action:t}),"set-value"!==t&&f(e)},closeMenuOnSelect:!1,hideSelectedOptions:!1,classes:T,components:E,styles:O,menuPlacement:u,loadOptions:n,innerRef:h},S,p))};ky.defaultProps={creatable:!1,cacheOptions:!0,components:{},classes:{},placeholder:"",loadingIndicator:!1,onInputChange:()=>{},onChange:()=>{}},ky.propTypes={creatable:dp().bool,cacheOptions:dp().bool,defaultOptions:dp().bool,value:dp().arrayOf(dp().shape({label:dp().string.isRequired,value:dp().any})),options:dp().arrayOf(dp().shape({label:dp().string.isRequired,value:dp().any})),onChange:dp().func,onInputChange:dp().func,placeholder:dp().string,label:dp().string,loadingIndicator:dp().bool,components:dp().shape({ClearIndicator:dp().func,Control:dp().func,DropdownIndicator:dp().func,DownChevron:dp().func,CrossIcon:dp().func,Group:dp().func,GroupHeading:dp().func,IndicatorsContainer:dp().func,IndicatorSeparator:dp().func,Input:dp().func,LoadingIndicator:dp().func,Menu:dp().func,MenuList:dp().func,MenuPortal:dp().func,LoadingMessage:dp().func,NoOptionsMessage:dp().func,MultiValue:dp().func,MultiValueContainer:dp().func,MultiValueLabel:dp().func,MultiValueRemove:dp().func,Option:dp().func,Placeholder:dp().func,SelectContainer:dp().func,SingleValue:dp().func,ValueContainer:dp().func}),classes:dp().shape({control:dp().string,valueContainer:dp().string,multiValue:dp().string,noOptionsMessage:dp().string,singleValue:dp().string,placeholder:dp().string,menu:dp().string,clearIndicator:dp().string,dropdownIndicator:dp().string,option:dp().string,"option--selected":dp().string,label:dp().string}),styles:dp().shape({clearIndicator:dp().func,container:dp().func,control:dp().func,dropdownIndicator:dp().func,group:dp().func,groupHeading:dp().func,indicatorsContainer:dp().func,indicatorSeparator:dp().func,input:dp().func,loadingIndicator:dp().func,loadingMessage:dp().func,menu:dp().func,menuList:dp().func,menuPortal:dp().func,multiValue:dp().func,multiValueLabel:dp().func,multiValueRemove:dp().func,noOptionsMessage:dp().func,option:dp().func,placeholder:dp().func,singleValue:dp().func,valueContainer:dp().func}),TextFieldProps:dp().object,getOptions:dp().func,menuPlacement:dp().string,menuPortalTarget:dp().object,menuShouldBlockScroll:dp().bool,captureMenuScroll:dp().bool,getOptionValue:dp().func,isSearchable:dp().bool,inputRef:dp().shape({current:dp().object})};var Ly=r(80959),Uy=r(88640),jy=r(25386),Fy=r(59428),My=r(47823);const Vy=(0,wp.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 By(){return By=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},By.apply(null,arguments)}const zy=e=>{const{innerProps:t,innerRef:r,data:n,isSelected:a,isFocused:i,selectProps:{classes:o}}=e,l=Vy(),s=(0,_.has)("width",n),c=(0,_.has)("number",n);return v().createElement(qp(),By({className:o.option,classes:{root:l.item,selected:l.itemSelected},ref:r,component:"div",selected:i,disableGutters:!0},t),v().createElement(Wp(),{checked:a,color:"primary",disableRipple:!0,classes:{root:l.checkbox}}),v().createElement("div",{className:l.infobox},v().createElement("div",{className:l.textbox},v().createElement(od.Y,{value:n.label},v().createElement("div",{className:l.text},n.label)),c&&v().createElement("div",{className:l.number},(0,ni.k7)(n.number,5e3))),s&&v().createElement(py,{className:O()(l.colorBar,{[l.selectedColorBar]:a}),width:n.width})))};zy.propTypes={innerProps:dp().shape({id:dp().string.isRequired,key:dp().string,onClick:dp().func.isRequired,onMouseMove:dp().func.isRequired,onMouseOver:dp().func.isRequired,tabIndex:dp().number.isRequired}).isRequired,innerRef:dp().oneOfType([dp().oneOf([null]),dp().func,dp().shape({current:dp().any.isRequired})]),isSelected:dp().bool.isRequired,isFocused:dp().bool.isRequired,selectProps:dp().shape({classes:dp().shape({option:dp().string})}),data:dp().shape({value:dp().string,label:dp().string.isRequired,number:dp().number}).isRequired};const Hy=zy,Yy=e=>{const{selectProps:{classes:t}}=e;return v().createElement(oy.K,{variant:"noData",className:t.noOptionsMessage})};Yy.propTypes={selectProps:dp().object.isRequired};const Wy=Yy;function Gy(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){qy(e,t,r[t])}))}return e}function qy(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zy={container:e=>Gy({},e,{width:"100%"}),menuList:e=>Gy({},e,{maxHeight:"240px",padding:"8px 0"}),menu:e=>Gy({},e,{maxHeight:"240px"})},$y=(0,wp.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)"}}))),Ky=dp().shape({value:dp().string.isRequired,label:dp().string.isRequired,number:dp().number});function Xy(){return Xy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xy.apply(null,arguments)}function Qy(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Jy=e=>{let{values:t=[],defaultOptions:r=[],filteredOptions:n,onChange:a=_.identity,getSuggestions:i,showBar:o=!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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["values","defaultOptions","filteredOptions","onChange","getSuggestions","showBar","showNumberInValue","classes","styles","canLoadMore","max"]);const m=$y(),[f,y]=(0,b.useState)(""),[g,h]=(0,b.useState)(1),[E,T]=(0,b.useState)(!1),O=(0,b.useRef)(null),x=(0,b.useRef)(!1),C=(0,b.useRef)(!1),w=(n||[]).concat(r),A=e=>w.find((t=>t.value===e))||{value:e,label:e},R=e=>l&&(0,_.has)("number",e)?(0,_.assoc)("formattedNumber",(0,S.formatNumberAsMetric)((0,_.prop)("number",e),5e3),e):e,I=(0,_.pipe)((e=>{if(o&&e.length&&(0,_.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Qy(e,t,r[t])}))}return e}({},e,{width:N(e.number,t)})))}return e}),(0,_.uniqBy)((0,_.prop)("value"))),N=(e,t)=>(t?100*e/t:0)+"%",P=(0,S.debounce)(((e,{action:t})=>{e!==f&&"set-value"!==t&&(y(e),h(1),x.current=!1,T(!0),i({value:e,pageNumber:1}))}),250),D=n||r,k=(0,b.useCallback)((()=>{T(!0),i({value:f,pageNumber:g+1,currentOptions:D}),x.current=!0}),[f,g,i,D]);(0,b.useEffect)((()=>{T(!1),x.current&&(h((e=>e+1)),x.current=!1)}),[n]),(0,b.useEffect)((()=>{C.current||(T(!1),h(1),x.current=!1,i({value:"",pageNumber:1})),C.current=!1}),[r]);const L=(0,b.useMemo)((()=>D.slice(0,g*p)),[D,g,p]),U=u&&D.length>L.length;return v().createElement(ky,Xy({filterOption:({label:e,value:t},r)=>S.utils.strings.search(e,r)||S.utils.strings.search(t,r),value:(e=>(0,S.wrapInArrayIfNeeded)(e).map(A).map(R))(t),onChange:(0,_.pipe)((0,_.tap)((()=>{C.current=!0})),(0,_.defaultTo)([]),(0,_.pluck)("value"),a),options:I(L),onInputChange:P,classes:(0,_.mergeRight)(m,s),styles:(0,_.mergeRight)(Zy,c),TextFieldProps:{InputProps:{disableUnderline:!0},ref:O},inputRef:O,components:{Option:Hy,NoOptionsMessage:Wy,Menu:Ly.h,DropdownIndicator:Uy.K,MultiValue:jy._,MenuList:Fy.d},menuPlacement:"bottom",menuListFooter:U&&v().createElement(My.X,{loading:E,onClick:k})},d))};Jy.propTypes={values:dp().array,defaultOptions:dp().arrayOf(Ky),filteredOptions:dp().arrayOf(Ky),onChange:dp().func.isRequired,getSuggestions:dp().func.isRequired,showBar:dp().bool,showNumberInValue:dp().bool,classes:dp().object,styles:dp().object,canLoadMore:dp().bool,max:dp().number};const eg=(0,b.memo)(Jy);var tg=r(43627),rg=r.n(tg);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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ag(e,t,r[t])}))}return e}function ag(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ig=(0,_.range)(2,10).reduce(((e,t)=>ng({},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)"}}})),{}),og=(0,wp.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":ng({fontSize:"10px",lineHeight:"11px",fontWeight:500,color:"rgba(255, 255, 255, 0.7)",marginTop:"4px"},ig,{"&:last-child":{color:"white"}}),"& li + li":{marginTop:"2px"}}}})));function lg(){return lg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lg.apply(null,arguments)}const sg=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["pathToTitle","children"]);const a=og(),i=null!=t&&t.length?v().createElement("div",{className:a.tooltipContent},v().createElement("p",null,(0,_.last)(t)),t.length>2&&v().createElement("ul",null,t.map((e=>v().createElement("li",{key:e},e))))):"";return v().createElement(rg(),lg({title:i,disableFocusListener:!0,classes:{tooltip:a.tooltip}},n),r)};var cg=r(96091),ug=r.n(cg),pg=r(35635),dg=r.n(pg);const mg=(0,wp.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 fg(){return fg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fg.apply(null,arguments)}const yg=(0,ld.T)(dg()),gg=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","onDelete"]);const a=mg();return v().createElement(ug(),fg({className:a.root,label:li().number(t),onDelete:r,variant:"outlined",classes:{root:a.root,outlined:a.outlined,deleteIcon:a.deleteIcon,label:a.label},deleteIcon:v().createElement(yg,{tooltipTitle:li().text("Clear")})},n))},hg=(0,wp.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 Eg(){return Eg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Eg.apply(null,arguments)}const bg=({title:e="",chipLabel:t=0,onDelete:r,pathToTitle:n,onClick:a})=>{const i=hg(),o=Boolean(n&&n.length>2),l=o?sg:od.Y,s=o?{pathToTitle:n}:{value:e};return v().createElement("div",{className:i.container,onClick:a},o&&v().createElement(sg,Eg({placement:"bottom-start"},s),v().createElement("div",{className:i.parent},n[n.length-2])),v().createElement("div",{className:i.titleContainer},v().createElement(l,Eg({placement:"bottom-start"},s),v().createElement("span",{className:i.title},e)),0!==t&&v().createElement("div",{className:i.chip},v().createElement(gg,{label:t,onDelete:r}))))};function vg(){return vg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vg.apply(null,arguments)}const Tg=(0,wp.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}}))),Og=(0,ld.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",vg({width:"13",height:"18",viewBox:"0 0 13 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},r),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("g",null,v().createElement("g",null,v().createElement("g",null,v().createElement("g",{transform:"translate(-3 -1)"},v().createElement("g",null,v().createElement("path",{fill:"#FF4081",d:"M5.833 10h3.75v6.667l-3.75 1.666z"}),v().createElement("path",{fill:"#CE0C4E",d:"M13.333 10v8.333l-3.75-1.666V10z"})),v().createElement("circle",{fill:"#FFC058",cx:"9.583",cy:"7.917",r:"6.25"}),v().createElement("circle",{fill:"#FFCD7B",cx:"9.583",cy:"7.917",r:"5.417"}),v().createElement("path",{fill:"#FFFBB5",d:"M8.333 11.667L5 8.462l.933-.898 2.4 2.308L13.4 5l.933.897z"})))))))})),Sg=({title:e,chipLabel:t,onDeleteChip:r,pathToTitle:n,onClose:a,children:i,isOpenByDefault:o=!0,isHighlighted:l=!1,isRecommended:s=!1})=>{const c=Tg(),[u,p]=(0,b.useState)(o),d=()=>{p(!u)};return v().createElement("div",{className:O()(c.facetContainer,{[c.openedFacetContainer]:u,[c.closedFacetContainer]:!u,[c.highlighted]:l}),"data-reltio-id":`search-facet-container-${e}`},v().createElement("div",{className:c.titleContainer},v().createElement(Ed.k,{tooltipTitle:li().text("Remove"),icon:Tp(),onClick:a,className:c.iconButton,size:"XXS"}),s&&v().createElement(Og,{className:c.recommendedIcon,tooltipTitle:li().text("Recommended"),showForDisabled:!0}),v().createElement(bg,{title:e,pathToTitle:n,chipLabel:t,onDelete:r,onClick:d}),v().createElement(Vm,{onClick:d,isOpen:u,className:c.iconButton,size:"S",tooltipTitle:u?li().text("Collapse attribute"):li().text("Expand attribute"),tooltipPlacement:"bottom-end"})),u?i:null)},xg=(0,wp.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"}}))),Cg=({config:e,data:t=[],filteredData:r,values:n=[],isHighlighted:a,isRecommended:i,onSearch:o=_.identity,onChange:l,onClose:s})=>{const c=xg();return v().createElement(Sg,{title:e.title,pathToTitle:e.pathToTitle,onClose:s,chipLabel:n.length,onDeleteChip:()=>l([]),isHighlighted:a,isRecommended:i},v().createElement(eg,{values:n,defaultOptions:t,filteredOptions:r,onChange:l,getSuggestions:o,isClearable:!1,showBar:!1,showNumberInValue:!0,classes:c,placeholder:li().text("All values"),canLoadMore:!(0,ja.tW)(e)}))};var wg=r(32015),Ag=r(15608),Rg=r.n(Ag);const _g=(0,wp.Z)((e=>({root:{borderRadius:4,padding:"15px 0"},rail:{backgroundColor:(0,wm.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,wm.alpha)(e.palette.primary.main,.12)}`,"@media (hover: none)":{boxShadow:"none"}},"&$active":{boxShadow:`0px 0px 0px 9px ${(0,wm.alpha)(e.palette.primary.main,.12)}`},"&::after":{left:-10,top:-10,right:-10,bottom:-10}},focusVisible:{},active:{},track:{borderRadius:4}}))),Ig=(0,wp.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"}}))),Ng=({children:e,open:t,value:r})=>{const n=Ig();return v().createElement(rg(),{open:t,enterTouchDelay:0,placement:"top",title:r,classes:{tooltipPlacementTop:n.tooltipPlacementTop,tooltip:n.tooltip}},e)};function Pg(){return Pg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pg.apply(null,arguments)}Ng.propTypes={children:dp().element.isRequired,open:dp().bool.isRequired,value:dp().string.isRequired};const Dg=e=>{let{min:t,max:r,range:n,onChange:a,onAfterChange:i,className:o}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["min","max","range","onChange","onAfterChange","className"]);const s=_g();return v().createElement("div",{className:o},v().createElement(Rg(),Pg({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)=>{i&&i(t)},valueLabelDisplay:"auto","aria-labelledby":"range-slider",components:{ValueLabel:Ng},size:"small",component:"div"},l)))};Dg.propTypes={min:dp().oneOfType([dp().number,dp().string]).isRequired,max:dp().oneOfType([dp().number,dp().string]).isRequired,range:dp().array.isRequired,onChange:dp().func,onAfterChange:dp().func,className:dp().string};const kg=Dg;var Lg=r(18205),Ug=r(19406),jg=r(55484),Fg=r(25556),Mg=r(3131),Vg=r(27741),Bg=r(42400),zg=r(11011);const Hg=(0,wp.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"}}))),Yg=({payload:e,formatter:t,active:r})=>{const n=Hg();if(r){const{payload:{label:r},value:a}=e[0];return v().createElement("div",{className:n.tooltip},v().createElement("div",{className:n.number},t(a)),v().createElement("div",{className:n.value},r))}return null},Wg=(0,wp.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 Gg(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qg=({data:e=[],range:t=[],domain:r,color:n=S.theme.palette.primary.main,tickFormatterX:a,tickFormatterY:i})=>{const o=Wg(),[l,s]=(0,b.useState)(null),c=(e,r)=>(l===r?.2:0)+((({value:e})=>e[0]>=t[0]&&e[1]<=t[1])(e)?.6:.2),u=e.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Gg(e,t,r[t])}))}return e}({},e,{value:t<r.length-1?e.value[0]:e.value[1]}))),p=e=>{e.isTooltipActive?s(e.activeTooltipIndex):s(null)};return v().createElement(Lg.h,null,v().createElement(Ug.v,{data:u,margin:{top:12,right:0,left:0,bottom:0},onMouseEnter:p,onMouseLeave:p,onMouseMove:p,className:o.barChart},v().createElement(jg.q,{vertical:!1,stroke:"#f2f2f2"}),v().createElement(Fg.K,{dataKey:"value",interval:0,padding:{left:4,right:4},height:15,tickLine:!1,ticks:r,tick:e=>{const{x:t,y:r,index:n,payload:{value:i,offset:o}}=e;return v().createElement("text",{x:0===n?t-o:t+o,y:r+4,textAnchor:0===n?"start":"end"},`${a(i)}`)}}),v().createElement(Mg.B,{width:38,domain:[0,"auto"],axisLine:!1,tickLine:!1,tickSize:0,tickMargin:4,tickCount:6,tickFormatter:i}),v().createElement(Vg.u,{cursor:{fill:"rgb(255,255,255)"},content:v().createElement(Yg,{formatter:i}),isAnimationActive:!1}),v().createElement(Bg.$,{dataKey:"number",isAnimationActive:!1},e.map(((e,t)=>v().createElement(zg.b,{key:`cell-${t}`,fill:n,fillOpacity:c(e,t)}))))))},Zg="NumericRangeFacet-styles-numberEditorInputRoot--djW3k",$g="NumericRangeFacet-styles-numberEditorRoot--DVXqx",Kg="NumericRangeFacet-styles-input--Nl2tx";function Xg(){return Xg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xg.apply(null,arguments)}class Qg extends b.PureComponent{constructor(...e){super(...e),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,i]=n.getBarDomain(t),o=n.adjustRange(e,a,i);0!==r.length&&n.equals(o[0],(0,_.path)([0,0],r))&&n.equals(o[1],(0,_.path)([0,1],r))||this.props.onChange([o])},this.onLowerBoundChanged=e=>{const{range:t,NumMath:r,isFloating:n}=this.state;this.setState({lowerBound:n?e:r.toFixed(e,0)},(()=>{const a=(0,_.head)(this.props.data).value[0],i=""===e||isNaN(e)?a:e,o=r.clamp(a,t[1],n?i:r.floor(i));this.setState((e=>({lowerBound:o.toString(),range:[o,e.range[1]]}))),this.handleOnChangeValue([o,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,_.last)(this.props.data).value[1],i=""===e||isNaN(e)?a:e,o=r.clamp(t[0],a,n?i:r.ceil(i));this.setState((e=>({upperBound:o.toString(),range:[e.range[0],o]}))),this.handleOnChangeValue([t[0],o])}))},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,i="Long"===a,o=(0,kl.C)(a),l=(0,ni.Oz)(a),s=o.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:o,isScaled:i,isFloating:(0,S.isFloatingType)(a),scale:n.length>0?o.calcScale(...o.getBarDomain(n)):{ratio:1,offset:0}}}return null}render(){const{config:e,data:t,isHighlighted:r,isRecommended:n,onClose:a,numberFormat:i}=this.props,{isScaled:o,scale:l,range:s,lowerBound:c,upperBound:u,rangeService:p,isFloating:d}=this.state,m=o?p.bigNumbersTickFormatterX(p.formatNumberForRangeFacet,l):p.formatNumberForRangeFacet,f=t.map((e=>({value:e.value.map(this.applyScale),label:e.value.map(p.formatNumberForRangeFacet).join(" - "),number:e.number}))),y=s.map((e=>+this.applyScale(e))),[g,h]=p.getBarDomain(t).map((e=>this.applyScale(e)));return v().createElement(Sg,{title:e.title,pathToTitle:e.pathToTitle,onClose:a,isHighlighted:r,isRecommended:n},v().createElement("div",{className:"NumericRangeFacet-styles-data--kL9q5"},f.length>0?v().createElement(v().Fragment,null,v().createElement("div",{className:"NumericRangeFacet-styles-barChartContainer--t9NkG","data-reltio-id":"search-bar-chart-with-selection"},v().createElement(qg,{data:f,range:y,tickFormatterX:m,tickFormatterY:p.formatNumberForRangeFacet,domain:[g,h]})),v().createElement(kg,{min:g,max:h,range:y,onAfterChange:this.onRevertedChange,onChange:this.onChangeRange,className:"NumericRangeFacet-styles-slider--XbmKe",valueLabelFormat:m,step:d?(h-g)/200:1}),v().createElement("div",{className:"NumericRangeFacet-styles-inputsContainer--mU0_m"},v().createElement(wg.c,{value:c,onChange:this.onLowerBoundChanged,onFocus:this.onFocus,integer:!d,format:i,variant:"filled",classes:{root:$g},InputProps:{classes:{root:Zg,input:Kg}}}),v().createElement(wg.c,{value:u,onChange:this.onUpperBoundChanged,onFocus:this.onFocus,integer:!d,format:i,variant:"filled",classes:{root:$g},InputProps:{classes:{root:Zg,input:Kg}}}))):v().createElement(oy.K,{variant:"noData"})))}}Qg.propTypes={data:dp().array,values:dp().array,config:dp().object,isHighlighted:dp().bool,isRecommended:dp().bool,onClose:dp().func,onChange:dp().func,numberFormat:dp().shape({decimalSeparator:dp().string,thousandSeparator:dp().string,prefix:dp().string,suffix:dp().string,decimalScale:dp().number})},Qg.defaultProps={config:{},data:[],values:[]};const Jg=(0,mp.connect)((e=>({numberFormat:k().selectors.getUiNumberFormat(e)})))((e=>{const t=t=>{let{config:r,values:n,data:a,onChange:i,numberFormat:o}=t,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["config","values","data","onChange","numberFormat"]);const s=(0,mp.useSelector)(k().selectors.getAttributesPresentation),{strategy:c}=(0,S.getNumberFormat)((0,S.getAttrDataTypeDefinition)(r.attrType),s,S.intl.getLocale()),u=(0,b.useMemo)((()=>null==a?void 0:a.map((0,_.evolve)({value:(0,_.map)((0,S.applyPresentationStrategyToValue)(c))}))),[a,c]),p=(0,b.useMemo)((()=>null==n?void 0:n.map((0,S.mapFilterValue)((0,S.applyPresentationStrategyToValue)(c)))),[n,c]),d=(0,b.useCallback)((e=>{const t=null==e?void 0:e.map((0,S.mapFilterValue)((0,S.revertPresentationStrategyForValue)(c)));i(t)}),[c,i]);return v().createElement(e,Xg({data:u,values:p,onChange:d,config:r,numberFormat:o&&(0,_.omit)(["strategy",o])},l))};return t.displayName="WithCustomizedData",t})(Qg));var eh=r(21669);const th=(0,wp.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 rh(){return rh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rh.apply(null,arguments)}const nh=(e,t)=>(0,_.pathOr)(null,[t],e),ah=e=>e&&new Date(e),ih=e=>e&&e.getTime(),oh=({values:e,minDate:t,maxDate:r,onChange:n})=>{const[a,i]=(0,b.useState)(null),[o,l]=(0,b.useState)(null),s=(0,b.useRef)((0,Ge.x0)()),c=(0,b.useRef)((0,Ge.x0)()),u=th();v().useEffect((()=>{i(nh(e,0)),l(nh(e,1))}),[e]);const p=(e,t)=>{(0,_.isNil)(e)||(0,_.isNil)(t)||n(e>t?[[t,e]]:[[e,t]])},d={minDate:ah(t),maxDate:ah(r)};return v().createElement("div",{className:u.container},v().createElement(eh.Q,rh({label:li().text("Start Date"),value:ah(a),onChange:e=>{const t=ih(e);i(t),p(t,o)},slotProps:{textField:{id:s.current,className:u.dateEditor}}},d)),v().createElement(eh.Q,rh({label:li().text("End Date"),value:ah(o),onChange:e=>{const t=ih(e);l(t),p(a,t)},slotProps:{textField:{id:c.current,className:u.dateEditor},popper:{placement:"bottom-end"}}},d)))};function lh(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sh=e=>t=>e===S.DataTypes.TYPE_DATE?S.utils.dates.toLocalDate(t).getTime():t,ch=(0,wp.Z)({barChartContainer:{position:"relative",height:"190px",paddingTop:"6px",width:"100%",overflow:"hidden"},dateRangeChooserWrapper:{display:"flex",flexDirection:"column",alignItems:"center",marginTop:"12px",width:"100%"}}),uh=(0,kl.C)(),ph=({data:e=[],values:t=[],config:r,onChange:n,isHighlighted:a,isRecommended:i,onClose:o})=>{const l=ch(),s=(0,_.path)(["attrType","type"],r),c=(0,b.useCallback)((r=>{const a=r.map((0,S.mapFilterValue)((i=s,e=>i===S.DataTypes.TYPE_DATE?S.utils.dates.toUtcDate(e).getTime():e)));var i;if(!(0,_.equals)(t,a)){const[t,r]=uh.getBarDomain(e),i=s===S.DataTypes.TYPE_DATE,o=a.map((e=>[S.utils.dates.getStartOfDay(e[0],i),S.utils.dates.getEndOfDay(e[1],i)])),l=uh.getRange(o,e);n([l.length?l:[t,r]])}}),[e,n,s,t]),u=(0,b.useMemo)((()=>{return e.map((t=s,e=>{if(Array.isArray(e.value)){const r=e.value.map(sh(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){lh(e,t,r[t])}))}return e}({},e,{value:r,label:r.map(S.formatDate).join(" - ")})}}));var t}),[e,s]),[p,d]=(0,b.useMemo)((()=>[uh.getBarDomain(u),uh.getRange(t.map((0,S.mapFilterValue)(sh(s))),u)]),[u,s,t]);return v().createElement(Sg,{title:r.title,pathToTitle:r.pathToTitle,onClose:o,isHighlighted:a,isRecommended:i},e.length>0?v().createElement(v().Fragment,null,v().createElement("div",{className:l.barChartContainer},v().createElement(qg,{data:u,range:d,tickFormatterX:S.formatDate,tickFormatterY:uh.formatNumberForRangeFacet,domain:p})),v().createElement("div",{className:l.dateRangeChooserWrapper},v().createElement(oh,{values:d,onChange:c}))):v().createElement(oy.K,{variant:"noData"}))};function dh(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class mh{static getWidget(e){switch(e.type){case S.FACET_TYPES.ENTITY_TYPE_FACET:return Ey;case S.FACET_TYPES.WITH_DROPDOWN_CHECKBOXES_FACET:return Cg;case S.FACET_TYPES.NUMERIC_RANGE_FACET:return Jg;case S.FACET_TYPES.DATE_RANGE_FACET:return ph;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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){dh(e,t,r[t])}))}return e}({},mh.getDefaultConfig(),e),r=mh.getWidget(t);return r?(e=>{const r=((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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(r,["dispatch"]);return v().createElement(e,Jf({config:t,onChange:(i=t.fieldName,e=>{n(Ja(i,e))}),onClose:t.showDeleteButton?(e=>()=>{n(ri({fieldNamesToDelete:[e]}))})(t.fieldName):()=>{},onSearch:(e=>({value:t,pageNumber:r,currentOptions:a})=>{n((({facetFieldName:e,value:t,debounceTime:r=0,pageNumber:n=1,currentOptions:a})=>({type:L.k.FILTER_FACET_DATA,payload:{facetFieldName:e,value:t,debounceTime:r,pageNumber:n,currentOptions:a}}))({facetFieldName:e,value:t,debounceTime:250,pageNumber:r,currentOptions:a}))})(t.fieldName)},a));var i};return r.propTypes={dispatch:dp().func,isRecommended:dp().bool},r})(e,t);return mh.connectData(r,t)})(r):null}}mh.getDefaultConfig=()=>({autofocus:!1,showDeleteButton:!0}),mh.connectData=(e,t)=>(0,mp.connect)((e=>({data:(0,P.X7)(t,e),values:(0,P.N1)(t,e),filteredData:(0,P.VP)(t,e),isHighlighted:(0,P.$t)(t.fieldName,e),isRecommended:(0,P.TH)(t.fieldName,e)})))(e);var fh=r(64927),yh=r.n(fh),gh=r(73707),hh=r.n(gh),Eh=r(93463),bh=r.n(Eh);const vh=(0,wp.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 Th=r(44244);const Oh=({tenantObject:e,isDataTenant:t,className:r})=>{const n=(({tenantObject:e,isDataTenant:t})=>{const r=(0,Th._)(),[n,a]=(0,b.useState)(0),i=(0,mp.useSelector)(k().selectors.getGlobalSearchRequestOptions),o=t?e:null,l=(0,mp.useSelector)((e=>(0,ai.E2)(e,[],o))),s=JSON.stringify((0,Ua.Vg)(l,[],i)),c=(0,mp.useSelector)(k().selectors.getDtssPath),u=(0,mp.useSelector)(k().selectors.getTenant);return(0,b.useEffect)((()=>{r((0,Ua.Es)({url:Z.jS,options:{method:"POST",body:s},customerTenant:u,dataTenant:(0,_.prop)("id",o),dtssPath:c})).then((({total:e})=>{a(e)})).catch((e=>{console.warn(e)}))}),[o,u,c,s]),n})({tenantObject:e,isDataTenant:t});return v().createElement("div",{className:r},(0,ni.k7)(n))};Oh.propTypes={className:dp().string,tenantObject:dp().object.isRequired,isDataTenant:dp().bool};const Sh=Oh;function xh(){return xh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xh.apply(null,arguments)}const Ch={changeCurrentTenant:({tenantObject:e,isDataTenant:t})=>({type:U.Z.CHANGE_CURRENT_TENANT,payload:{tenantObject:e,isDataTenant:t}})},wh=(0,mp.connect)((e=>({dataTenants:k().selectors.getDataTenants(e),customerTenantObject:k().selectors.getTenantObject(e),currentTenant:(0,ai.RO)(e),openAdvancedSearch:(0,Ri.IJ)(e)})),Ch)((({customerTenantObject:e,currentTenant:t,dataTenants:r,changeCurrentTenant:n,openAdvancedSearch:a})=>{const i=vh(),o=(0,_.pipe)((0,_.map)((({id:e,label:t})=>({value:e,label:t}))),(0,_.prepend)({value:e.id,label:e.name}))(r),l=t=>{const n=t!==e.id;return{isDataTenant:n,tenantObject:n?r.find((0,_.propEq)("id",t)):e}},s=t||e.id;return v().createElement("div",{className:i.tenantFacet},v().createElement(Pf,{title:li().text("Tenants"),hasCollapseButton:!1}),v().createElement(hh(),{className:i.radioGroup,value:s,onChange:(0,_.pipe)(xp.NA,l,n)},o.map((({value:e,label:t})=>v().createElement("div",{className:i.tenantContainer,key:e},v().createElement(bh(),{classes:{root:i.radioLabelRoot,label:i.radioLabel},value:e,label:t||e,control:v().createElement(yh(),{className:i.radioButton,color:"primary"})}),!a&&v().createElement(Sh,xh({className:i.total},l(e))))))))})),Ah=(0,wp.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}}),Rh=({variant:e="facetsPanel",searchOptions:t={},dispatch:r})=>{const{root:n,labelRoot:a,checkboxRoot:i,checkboxRootQueryGroups:o}=Ah(),l=t.searchByOv,s=(0,b.useCallback)((()=>{r(D.search.actions.updateSearchOptions({searchByOv:!l,ovOnly:!l}))}),[l,r]),c=li().text("Search by OV only");return v().createElement("div",{className:n,onClick:s},v().createElement(Wp(),{classes:{root:O()(i,{[o]:"queryGroups"===e})},checked:l,color:"primary"}),v().createElement(od.Y,{value:c},v().createElement(bf(),{variant:"body2",classes:{root:a}},c)))};Rh.propTypes={searchOptions:dp().shape({searchByOv:dp().bool,ovOnly:dp().bool}),variant:dp().oneOf(["facetsPanel","queryGroups"]),dispatch:dp().func};const _h=(0,mp.connect)((e=>({searchOptions:k().selectors.getSearchOptions(e)})))(Rh),Ih=(0,wp.Z)({root:{display:"flex",flexDirection:"column",overflow:"auto",height:"100%"}});function Nh(){return Nh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Nh.apply(null,arguments)}const Ph=(0,S.memoizeWith)((e=>e.fieldName),mh.build),Dh=({group:e,configs:t})=>v().createElement(Qf,Nh({},e,{key:e.title}),(e=>e.map((e=>({Facet:Ph(e),id:e.fieldName}))).filter((({Facet:e})=>e)).map((({Facet:e,id:t})=>v().createElement(e,{key:t}))))(t)),kh=(0,mp.connect)((e=>{var t;const r=k().selectors.getDataTenants(e);return{metadata:k().selectors.getMetadata(e),facetsConfigs:(0,P.Mp)(e),uiConfigShowSearchByOv:null!==(t=k().selectors.getShowSearchByOv(e))&&void 0!==t?t:(0,Ri.cC)(e),showTenantFacet:r&&r.length>0,tenant:k().selectors.getTenant(e)}}))((({facetsConfigs:e=[],metadata:t,onScroll:r,uiConfigShowSearchByOv:n,showTenantFacet:a})=>{const{root:i}=Ih(),o=(0,b.useRef)(null),l=(0,b.useCallback)((e=>{r(o.current.scrollTop,e)}),[r]),s=((e,t)=>{const[r,n]=(0,_.partition)(S.isTypeFacet,t),a=[{group:{title:li().text("Entity types"),hasCollapseButton:!1},configs:r},{group:{title:li().text("Attributes"),hasCollapseButton:!1,hasSearchAttributesField:!0},configs:n}];return If(a)})(0,e),c=(0,_.head)(s),u=(0,_.tail)(s),p=o.current,d=(0,b.useMemo)((()=>({element:p,priority:["top","bottom"]})),[p]);return v().createElement("div",{ref:o,className:i,onScroll:l},v().createElement(Rf.p.Provider,{value:d},n&&v().createElement(_h,null),a&&v().createElement(v().Fragment,null,v().createElement(wh,null),v().createElement(Af(),null)),c&&Dh(c),v().createElement(Af(),null),u.map(((e,t)=>v().createElement(Dh,Nh({},e,{key:t}))))))})),Lh=({children:e,className:t})=>v().createElement("div",{className:O()("MainContent-styles-mainContent--Ha5me",t)},e);Lh.propTypes={children:dp().node,className:dp().string};const Uh=Lh;var jh=r(33788);const Fh=(0,wp.Z)({container:{backgroundColor:"#fff",opacity:.37,position:"fixed",width:"100%",height:"100%",top:0,left:0,display:"flex",justifyContent:"center",alignItems:"center"}}),Mh=()=>{const e=(0,mp.useSelector)(Ri.Kv),{container:t}=Fh();return e?v().createElement("div",{className:t},v().createElement(jh.Z,{size:160})):null};var Vh=r(54596),Bh=r.n(Vh),zh=r(49233),Hh=r.n(zh),Yh=r(35206),Wh=r.n(Yh),Gh=r(81733),qh=r.n(Gh),Zh=r(68290),$h=r.n(Zh);const Kh=(0,wp.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 Xh(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qh=()=>{const e=(0,mp.useDispatch)(),t=(0,mp.useSelector)(Ri.v6),r=(0,mp.useSelector)(k().selectors.getAutoCloseInterval),n=t&&t.payload.autoHideDuration||r&&1e3*r||5e3,a=Kh(),i=(0,b.useRef)(null),o=(0,b.useCallback)((()=>{e(Ti())}),[e]);t&&(i.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Xh(e,t,r[t])}))}return e}({},t));const{type:l,payload:s}=i.current||{},{message:c,action:u}=s||{},p=u&&u.actionToDispatch,d=(0,b.useCallback)((()=>{p&&e(p)}),[p,e]),m=(0,b.useMemo)((()=>l===Z.GT.error?v().createElement(Hh(),{key:"close","aria-label":"Close",color:"inherit",className:a.close,onClick:d,size:"large"},v().createElement(Tp(),null)):u?v().createElement(Wh(),{color:"primary",size:"small",onClick:d},u.actionLabel):null),[a,l,u,d]);return v().createElement(qh(),{container:document.body},v().createElement(Bh(),{key:c+l,anchorOrigin:{vertical:"bottom",horizontal:"center"},autoHideDuration:n,open:Boolean(t),onClose:o,ContentProps:{classes:{root:O()(a.snackbar,a[l]),message:a.message}},message:v().createElement("div",{className:a.messageContent},l===Z.GT.error&&v().createElement($h(),{className:a.icon}),c),classes:{anchorOriginBottomCenter:a.anchorSnackBar},action:m}))},Jh=(0,wp.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 eE=r(95641);const tE=(0,wp.Z)((()=>({container:{position:"relative"},panel:{position:"relative"},horizontal:{},vertical:{},disabled:{},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:"ns-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","&$disabled":{background:"transparent"},"&:not($disabled):hover":{cursor:"ew-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%"}}}})));function rE(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){nE(e,t,r[t])}))}return e}function nE(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const aE=e=>"horizontal"===e,iE=(e,t)=>e.toFixed(2)===t.toFixed(2),oE=({className:e,children:t,orientation:r="vertical",primary:n="first",size:a,minSize:i,maxSize:o,allowResize:l,debounceInterval:s=250,onChange:c})=>{const u=tE(),p=(0,wm.useTheme)(),d=(0,b.useRef)(),[m,f]=(0,b.useState)(null),[y,g]=(0,b.useState)(0),[h,E]=(0,b.useState)(0),[T,x]=(0,b.useState)(!0),C=(0,b.useCallback)((()=>x(!0)),[]),w=(0,b.useCallback)((()=>x(!1)),[]),A=(0,b.useCallback)((()=>aE(r)?null==m?void 0:m.clientHeight:null==m?void 0:m.clientWidth),[m,r]);"number"==typeof a&&a<0&&(a=(A()||0)+a);const R=(0,b.useCallback)((e=>"string"==typeof e&&e.endsWith("%")?+e.replace("%",""):("string"==typeof e&&e.endsWith("px")&&(e=e.replace("px","")),isNaN(+e)?null:+e/A()*100)),[A]),_=(0,b.useCallback)(((e,t)=>0===e||100===e?0:R(t)||0),[R]),I=(0,b.useCallback)((()=>{if(m&&d.current){const e=R(a);null==e||isNaN(e)||(E(_(e,o)),g(_(e,i)),d.current.resize(e))}}),[R,_,i,o,a,m]);(0,b.useEffect)((()=>{I()}),[I,h,y]);const N=(0,b.useCallback)((0,S.debounce)((e=>{if(void 0===e)return;const t=A();c({percentageSize:e+"%",isMaxSize:iE(e,+h>0?h:100+h),isMinSize:iE(e,y),size:Math.round(e*t/100)})}),s),[c,h,y,A]),P=(0,b.useCallback)((e=>{e?(N(),w()):(N(d.current.getSize()),C())}),[w,C,N]),D=(0,b.useMemo)((()=>({transition:p.transitions.create("flex",{easing:p.transitions.easing.sharp,duration:p.transitions.duration.leavingScreen})})),[p]),k=rE({className:u.panel,minSize:y},h>0?{maxSize:h}:{},{ref:d,style:T?D:void 0}),L=rE({className:u.panel,style:T?D:void 0},h<0?{minSize:-h}:{});return v().createElement("div",{ref:f,className:O()(u.container,e)},v().createElement(Fp.Z,{handleHeight:aE(r),handleWidth:!aE(r),onResize:I,refreshMode:"debounce",refreshRate:50}),v().createElement(eE.eh,{direction:aE(r)?"vertical":"horizontal"},v().createElement(eE.s_,"first"===n?k:L,t[0]),v().createElement(eE.OT,{className:O()(u.resizer,u[r],{[u.disabled]:!l}),disabled:!l,hitAreaMargins:{coarse:0,fine:0},onDragging:P}),v().createElement(eE.s_,"second"===n?k:L,t[1])))};oE.displayName="ResizablePanes";const lE=(0,wp.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 7px",borderRadius:"2px",fontSize:"13px",fontWeight:500,lineHeight:"16px",marginRight:"16px",flexShrink:0}}),sE=({entity:e,className:t,size:r="small"})=>{const n=lE(),a=(0,w.AH)(),i=(0,S.getEntityType)(a,e.type),o=(i?(0,S.getPropWithInheritance)(a,i,"typeColor"):null)||S.theme.palette.primary.main,l=(0,S.getEntityTypeLabel)(a,e);return v().createElement(od.Y,{value:l,placement:"top"},v().createElement(bf(),{style:{backgroundColor:o,color:S.utils.Colors.getColor(o)?"#FFFFFF":"#212121"},className:O()(n[`entityType-${r}`],n["entityType-overflow"],t),component:"div"},l))},cE=e=>e&&e.scrollIntoView({block:"end",behavior:"smooth"}),uE=e=>{e&&clearTimeout(e)},pE=(e,t)=>{if(e&&t){const r=e.offsetTop,n=e.offsetTop+e.clientHeight,{clientHeight:a,scrollTop:i}=t;return r>=0&&n>i&&n<i+a}};var dE=r(600);const mE=(0,wp.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,wm.alpha)(e.palette.primary.main,.12),"&:hover":{background:(0,wm.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"}}))),fE=({entities:e,entityToHighlight:t,selectedEntityUri:r,onEntityClick:n,onEntityHover:a,entitiesImportStatus:i,entityButtonsRenderer:o})=>{const l=mE(),s=(0,b.useRef)(null),c=(0,b.useRef)(null),u=(0,w.AH)();return(0,dE.D)((()=>{if(t){var e;const n=null===(e=s.current)||void 0===e?void 0:e.querySelectorAll(`[data-entity-uri='${t}']`);if(uE(c.current),(null==n?void 0:n.length)>0){var r;const e=null===(r=s.current)||void 0===r?void 0:r.parentElement;pE(n[0],e)||(cE(n[0]),c.current=setTimeout((()=>{pE(n[0],e)||cE(n[0])}),1e3))}}return()=>{uE(c.current)}}),[t]),v().createElement("div",{ref:s},(e||[]).map((e=>{const s=(0,S.getLabel)(e.label),c=e.secondaryLabel,p=(0,S.getBusinessCardAttributesText)(u,e),d=(0,S.isActiveObject)(e),m=e.uri,f=(0,S.getEntityUriForLink)(e),y=(0,_.prop)(m,i);return v().createElement("div",{key:m,className:O()(l.item,{[l.clickable]:!!n,[l.selected]:m===r,[l.highlighted]:m===t,[l.inactive]:!d,[l.justImported]:y===um.Eh.Success}),onClick:n?()=>n(m):void 0,onMouseEnter:a?()=>a(m):void 0,onMouseLeave:a?()=>a(null):void 0,"data-entity-uri":m},v().createElement(A,{entity:e,avatarClassName:l.avatar,imageClassName:l.image}),v().createElement("div",{className:l.info},v().createElement("div",null,v().createElement(Md,{value:f,className:l.label},s),c&&v().createElement("span",{className:l.secondaryLabel},c," "),p&&v().createElement("span",{className:l.businessCard},p)),v().createElement("div",{className:l.secondRow},v().createElement(sE,{entity:e}),v().createElement("div",null,(0,S.getEntityId)(e)))),o&&o(e))})))};var yE=r(92255);function gE(){return gE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gE.apply(null,arguments)}function hE(){return hE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hE.apply(null,arguments)}function EE(){return EE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},EE.apply(null,arguments)}function bE(){return bE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bE.apply(null,arguments)}const vE=(0,wp.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 TE(){return TE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},TE.apply(null,arguments)}let OE=function(e){return e.full="full",e.embedded="embedded",e.small="small",e}({});const SE={SEARCH_RESULTS:e=>v().createElement("svg",gE({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgEmptySearchResults"},e),v().createElement("defs",null,v().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"},v().createElement("stop",{stopColor:"#00BFFF",stopOpacity:.5,offset:"0%"}),v().createElement("stop",{stopColor:"#9EE8FF",stopOpacity:0,offset:"100%"})),v().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"},v().createElement("stop",{stopColor:"#91F8E5",stopOpacity:.6,offset:"0%"}),v().createElement("stop",{stopColor:"#14F7FF",stopOpacity:0,offset:"100%"})),v().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"},v().createElement("stop",{stopColor:"#FFF",offset:"0%"}),v().createElement("stop",{stopColor:"#73FAFF",stopOpacity:.21,offset:"59.38%"}),v().createElement("stop",{stopColor:"#14F7FF",stopOpacity:0,offset:"100%"})),v().createElement("linearGradient",{x1:"50%",y1:"170.771%",x2:"50%",y2:"10.303%",id:"EmptySearchResults_svg__e"},v().createElement("stop",{stopColor:"#91F8E5",offset:"0%"}),v().createElement("stop",{stopColor:"#99FCFF",stopOpacity:0,offset:"100%"})),v().createElement("filter",{x:"-25.9%",y:"-26.2%",width:"151.8%",height:"152.3%",filterUnits:"objectBoundingBox",id:"EmptySearchResults_svg__d"},v().createElement("feGaussianBlur",{stdDeviation:15,in:"SourceGraphic"})),v().createElement("circle",{id:"EmptySearchResults_svg__a",cx:128,cy:128,r:128})),v().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"EmptySearchResults_svg__b",fill:"#fff"},v().createElement("use",{xlinkHref:"#EmptySearchResults_svg__a"})),v().createElement("use",{fillOpacity:.2,fill:"#A792CD",xlinkHref:"#EmptySearchResults_svg__a"}),v().createElement("g",{mask:"url(#EmptySearchResults_svg__b)"},v().createElement("g",{transform:"translate(56 34)"},v().createElement("g",{opacity:.9,strokeWidth:1,fill:"#FFF"},v().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"}),v().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})),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 45.833)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),v().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"}),v().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}),v().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}),v().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})),v().createElement("rect",{fill:"#645F6D",opacity:.5,x:21.756,y:17.46,width:87.022,height:12.004,rx:6.002}),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 87.302)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),v().createElement("rect",{fill:"#E3EBF4",x:0,y:1.091,width:20.668,height:20.734,rx:10.334}),v().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}),v().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}),v().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})),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 128.77)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),v().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"}),v().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}),v().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}),v().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})))),v().createElement("g",{mask:"url(#EmptySearchResults_svg__b)"},v().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"}),v().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"}),v().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"}),v().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}),v().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"}),v().createElement("g",null,v().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)"}),v().createElement("path",{fill:"url(#EmptySearchResults_svg__e)",opacity:.3,d:"M4 9h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),v().createElement("path",{fill:"url(#EmptySearchResults_svg__f)",opacity:.3,d:"M4 2h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),v().createElement("path",{fill:"url(#EmptySearchResults_svg__g)",d:"M4 9h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),v().createElement("path",{fill:"#FFF",opacity:.196,d:"M212.363 205.344l-1 1.732L60.418 124.52l4.977-8.62z"})),v().createElement("path",{fill:"#76A2B5",d:"M73.112 84.533l-35.5 61.488-.866-.5 35.5-61.488z"}),v().createElement("path",{fill:"#F3F3F3",d:"M80.906 89.033l-35.5 61.488-.866-.5 35.5-61.488z"}),v().createElement("path",{fill:"#538196",d:"M55.112 115.71l-17.5 30.311-.866-.5 17.5-30.31z"})))),SELECT_ATTRIBUTES:e=>v().createElement("svg",hE({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgSelectAttributes"},e),v().createElement("circle",{cx:128,cy:128,r:128,fill:"#0072CE",fillOpacity:.1}),v().createElement("mask",{id:"SelectAttributes_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:256,height:256},v().createElement("circle",{cx:128,cy:128,r:128,fill:"#fff"})),v().createElement("g",{mask:"url(#SelectAttributes_svg__a)"},v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-16 9h256v247H-16V9z",fill:"url(#SelectAttributes_svg__paint0_linear_0_19219)"}),v().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)"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),v().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),v().createElement("circle",{cx:120,cy:106,r:6,fill:"#B6C7DB"}),v().createElement("circle",{cx:120,cy:136,r:6,fill:"#B6C7DB"}),v().createElement("circle",{cx:67,cy:169,r:9,fill:"#B6C7DB"}),v().createElement("circle",{cx:67,cy:199,r:9,fill:"#B6C7DB"}),v().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"}),v().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"}),v().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"}),v().createElement("path",{opacity:.54,fillRule:"evenodd",clipRule:"evenodd",d:"M95.071 77l-3.535 3.535L88 77h7.071z",fill:"#000"}),v().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"}),v().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"})),v().createElement("defs",null,v().createElement("linearGradient",{id:"SelectAttributes_svg__paint0_linear_0_19219",x1:-16,y1:9,x2:-16,y2:256,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:.01}),v().createElement("stop",{offset:1,stopColor:"#F4F4F4"})),v().createElement("linearGradient",{id:"SelectAttributes_svg__paint1_linear_0_19219",x1:266.117,y1:181.111,x2:154.882,y2:77.681,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})))),NO_DATA:e=>v().createElement("svg",EE({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgNoData"},e),v().createElement("defs",null,v().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"NoData_svg__b"},v().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:0,offset:"0%"}),v().createElement("stop",{stopColor:"#F4F4F4",offset:"100%"})),v().createElement("linearGradient",{x1:"69.573%",y1:"86.747%",x2:"38.144%",y2:"33.403%",id:"NoData_svg__d"},v().createElement("stop",{stopColor:"#000",stopOpacity:0,offset:"0%"}),v().createElement("stop",{stopColor:"#000",offset:"100%"})),v().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"NoData_svg__e"},v().createElement("stop",{stopColor:"#EEFBFF",offset:"0%"}),v().createElement("stop",{stopColor:"#0072CE",offset:"100%"})),v().createElement("filter",{x:"-7.7%",y:"-7.5%",width:"115.3%",height:"115%",filterUnits:"objectBoundingBox",id:"NoData_svg__f"},v().createElement("feOffset",{dx:0,dy:2,in:"SourceAlpha",result:"shadowOffsetOuter1"}),v().createElement("feGaussianBlur",{stdDeviation:2,in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),v().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"}),v().createElement("feMerge",null,v().createElement("feMergeNode",{in:"shadowMatrixOuter1"}),v().createElement("feMergeNode",{in:"SourceGraphic"}))),v().createElement("circle",{id:"NoData_svg__a",cx:128,cy:128,r:128})),v().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"NoData_svg__c",fill:"#fff"},v().createElement("use",{xlinkHref:"#NoData_svg__a"})),v().createElement("use",{fillOpacity:.1,fill:"#0072CE",xlinkHref:"#NoData_svg__a"}),v().createElement("path",{fill:"url(#NoData_svg__b)",mask:"url(#NoData_svg__c)",d:"M0 9h256v247H0z"}),v().createElement("g",{mask:"url(#NoData_svg__c)"},v().createElement("g",{transform:"translate(29 37)"},v().createElement("g",{opacity:.9,strokeWidth:1,fill:"#FFF"},v().createElement("path",{fillOpacity:.8,opacity:.5,d:"M14.565 8h228.144v176.476H14.565z"}),v().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"})),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 42.105)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),v().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"}),v().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}),v().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}),v().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})),v().createElement("rect",{fill:"#645F6D",opacity:.5,x:19.986,y:16.04,width:79.944,height:11.028,rx:5.514}),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 80.2)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),v().createElement("rect",{fill:"#E3EBF4",x:0,y:1.003,width:18.987,height:19.048,rx:9.493}),v().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}),v().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}),v().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})),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 118.296)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),v().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"}),v().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}),v().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}),v().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})))),v().createElement("g",{mask:"url(#NoData_svg__c)"},v().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)"}),v().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)"}),v().createElement("g",{filter:"url(#NoData_svg__f)",strokeWidth:1,fill:"none",transform:"translate(70 86)"},v().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"}),v().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"})),v().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"}}),v().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"}}),v().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=>v().createElement("svg",bE({width:88,height:88,viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgError"},e),v().createElement("mask",{id:"Error_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:88,height:88},v().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"})),v().createElement("g",{mask:"url(#Error_svg__a)"},v().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}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().createElement("path",{d:"M21.036 40.178h-5.09a.636.636 0 000 1.272h5.09a.636.636 0 100-1.272z",fill:"#ACACAC"}),v().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"}),v().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"}),v().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"}),v().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"}),v().createElement("path",{d:"M18.915 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#9C6CF0"}),v().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"}),v().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"}),v().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"}),v().createElement("path",{d:"M41.82 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#4DBEE9"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().createElement("path",{d:"M54.968 67.324h-5.09a.636.636 0 000 1.273h5.09a.636.636 0 000-1.273z",fill:"#E9E9E9"}),v().createElement("g",{filter:"url(#Error_svg__filter0_d)"},v().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"})),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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)"}),v().createElement("g",{filter:"url(#Error_svg__filter1_d)"},v().createElement("path",{d:"M57.406 68.063a1.719 1.719 0 100-3.438 1.719 1.719 0 000 3.438z",fill:"#000"})),v().createElement("path",{d:"M57.406 68.063a1.719 1.719 0 100-3.438 1.719 1.719 0 000 3.438z",fill:"#fff"}),v().createElement("g",{filter:"url(#Error_svg__filter2_d)"},v().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"})),v().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"})),v().createElement("defs",null,v().createElement("filter",{id:"Error_svg__filter0_d",x:36.219,y:37.875,width:42.375,height:42.375,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().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"}),v().createElement("feOffset",{dy:2}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().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"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),v().createElement("filter",{id:"Error_svg__filter1_d",x:51.688,y:62.625,width:11.438,height:11.438,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().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"}),v().createElement("feOffset",{dy:2}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().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"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),v().createElement("filter",{id:"Error_svg__filter2_d",x:51.688,y:44.063,width:11.438,height:23.813,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().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"}),v().createElement("feOffset",{dy:2}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().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"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),v().createElement("linearGradient",{id:"Error_svg__paint0_linear",x1:68.438,y1:71.571,x2:60.119,y2:58.801,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:0}),v().createElement("stop",{offset:1})))),LOADING:e=>v().createElement("svg",TE({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgEmptyLoading"},e),v().createElement("circle",{cx:128,cy:128,r:128,fill:"#0072CE",fillOpacity:.03}),v().createElement("mask",{id:"EmptyLoading_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:256,height:256},v().createElement("circle",{cx:128,cy:128,r:128,fill:"#fff"})),v().createElement("g",{mask:"url(#EmptyLoading_svg__a)"},v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-16 9h256v247H-16V9z",fill:"url(#EmptyLoading_svg__paint0_linear_2978_41880)"}),v().createElement("g",{fillRule:"evenodd",clipRule:"evenodd"},v().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"}),v().createElement("path",{d:"M50.371 43.106h255.685V195.71H50.371V43.106z",fill:"url(#EmptyLoading_svg__paint1_linear_2978_41880)"}),v().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"}),v().createElement("path",{d:"M339.015 204.883v4.966H15v-4.966h324.015z",fill:"#D4DCDF"}),v().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)"})),v().createElement("g",{filter:"url(#EmptyLoading_svg__filter0_d_2978_41880)"},v().createElement("rect",{x:81.703,y:99,width:170,height:26,rx:8,fill:"#D1E6FF"}),v().createElement("rect",{x:84.703,y:102,width:164,height:20,rx:5,stroke:"#fff",strokeWidth:6})),v().createElement("g",{filter:"url(#EmptyLoading_svg__filter1_d_2978_41880)"},v().createElement("mask",{id:"EmptyLoading_svg__b",fill:"#fff"},v().createElement("rect",{x:81,y:105,width:108,height:14,rx:2})),v().createElement("rect",{x:81,y:105,width:108,height:14,rx:2,fill:"#61A3F1"}),v().createElement("rect",{x:81,y:105,width:108,height:14,rx:2,stroke:"#4A90E2",strokeWidth:8,mask:"url(#EmptyLoading_svg__b)"})),v().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"}),v().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"}),v().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"}),v().createElement("g",{filter:"url(#EmptyLoading_svg__filter2_ddd_2978_41880)"},v().createElement("path",{fill:"#A0C1D7",d:"M70.703 64h11v8h-11z"}),v().createElement("rect",{x:62,y:59,width:28,height:8,rx:1,fill:"#BDD4E3"}),v().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"}),v().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"}),v().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)"}),v().createElement("circle",{cx:75.94,cy:123.237,r:44.723,fill:"#91B0C2"}),v().createElement("g",{filter:"url(#EmptyLoading_svg__filter3_d_2978_41880)"},v().createElement("circle",{r:42.793,transform:"matrix(-1 0 0 1 75.94 123.237)",fill:"#F7F4FF"})),v().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)"}),v().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)"}),v().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"}),v().createElement("circle",{cx:75.94,cy:123.237,r:2.896,fill:"#EEEBF6"}),v().createElement("circle",{cx:96.211,cy:148.655,r:2.574,fill:"#A0C3D7"}),v().createElement("circle",{cx:107.15,cy:131.924,r:2.574,fill:"#A0C3D7"}),v().createElement("rect",{x:62.427,y:135.592,width:27.027,height:10.039,rx:3,fill:"#A0C3D7"}),v().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)"}),v().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)"}),v().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)"}),v().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)"}),v().createElement("circle",{cx:75.618,cy:155.734,r:2.574,fill:"#A0C3D7"}),v().createElement("circle",{cx:55.026,cy:148.655,r:2.574,fill:"#A0C3D7"}),v().createElement("circle",{cx:44.73,cy:131.924,r:2.574,fill:"#A0C3D7"}),v().createElement("g",{fill:"#A0C3D7"},v().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 96.21 97.363)"}),v().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 107.149 114.094)"}),v().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 75.618 90.284)"}),v().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 55.026 97.363)"}),v().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 44.73 114.094)"})))),v().createElement("defs",null,v().createElement("linearGradient",{id:"EmptyLoading_svg__paint0_linear_2978_41880",x1:-16,y1:9,x2:-16,y2:256,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:.01}),v().createElement("stop",{offset:1,stopColor:"#F4F4F4"})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint1_linear_2978_41880",x1:178.214,y1:43.106,x2:178.214,y2:195.709,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopColor:"#F2F9FB"}),v().createElement("stop",{offset:1,stopColor:"#fff"})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint2_linear_2978_41880",x1:178.497,y1:204.542,x2:178.497,y2:213.991,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopColor:"#90AABF"}),v().createElement("stop",{offset:1,stopColor:"#869DAE"})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint3_linear_2978_41880",x1:154.275,y1:146.574,x2:96.683,y2:91.352,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint4_linear_2978_41880",x1:60.762,y1:143.327,x2:114.747,y2:176.019,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.87}),v().createElement("stop",{offset:1,stopOpacity:.01})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint6_linear_2978_41880",x1:90.287,y1:154.267,x2:68.53,y2:131.301,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint7_linear_2978_41880",x1:100.735,y1:120.288,x2:78.978,y2:97.322,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint8_linear_2978_41880",x1:121.119,y1:112.739,x2:99.362,y2:89.773,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint9_linear_2978_41880",x1:90.166,y1:136.143,x2:68.409,y2:113.177,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})),v().createElement("filter",{id:"EmptyLoading_svg__filter0_d_2978_41880",x:77.703,y:96,width:178,height:34,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().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"}),v().createElement("feOffset",{dy:1}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().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"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),v().createElement("filter",{id:"EmptyLoading_svg__filter1_d_2978_41880",x:77,y:102,width:116,height:22,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().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"}),v().createElement("feOffset",{dy:1}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().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"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),v().createElement("filter",{id:"EmptyLoading_svg__filter2_ddd_2978_41880",x:-13.297,y:28,width:181.534,height:189.17,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().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"}),v().createElement("feMorphology",{radius:4,operator:"erode",in:"SourceAlpha",result:"effect1_dropShadow_2978_41880"}),v().createElement("feOffset",{dy:7}),v().createElement("feGaussianBlur",{stdDeviation:4}),v().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"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),v().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"}),v().createElement("feMorphology",{radius:4,operator:"dilate",in:"SourceAlpha",result:"effect2_dropShadow_2978_41880"}),v().createElement("feOffset",{dy:5}),v().createElement("feGaussianBlur",{stdDeviation:16}),v().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"}),v().createElement("feBlend",{mode:"normal",in2:"effect1_dropShadow_2978_41880",result:"effect2_dropShadow_2978_41880"}),v().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"}),v().createElement("feMorphology",{radius:2,operator:"dilate",in:"SourceAlpha",result:"effect3_dropShadow_2978_41880"}),v().createElement("feOffset",{dy:12}),v().createElement("feGaussianBlur",{stdDeviation:8.5}),v().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"}),v().createElement("feBlend",{mode:"normal",in2:"effect2_dropShadow_2978_41880",result:"effect3_dropShadow_2978_41880"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect3_dropShadow_2978_41880",result:"shape"})),v().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"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().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"}),v().createElement("feOffset",{dy:2}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().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"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),v().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)"},v().createElement("stop",{stopColor:"#CFE8FF"}),v().createElement("stop",{offset:.599,stopColor:"#D1F2F9",stopOpacity:0}))))},xE=({variant:e=OE.full,LogoRenderer:t=SE.SEARCH_RESULTS,text:r,secondaryText:n,buttonTitle:a,onClick:i=_.identity,access:o})=>{const l=vE(),s=o&&a;return v().createElement("div",{className:O()(l.root,l[`root_${e}`])},v().createElement(t,{className:l[`${e}`]}),v().createElement("div",{className:l.textBox},v().createElement(bf(),{variant:"h5",classes:{h5:l.text}},r),n&&v().createElement(bf(),{variant:"subtitle1",classes:{subtitle1:l.secondaryText}},n)),s&&v().createElement(Wh(),{className:l.button,variant:"contained",color:"primary",onClick:i},a))};var CE=r(15503);class wE extends v().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 AE=(0,wp.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 RE=r(46089),_E=r.n(RE);const IE=(0,wp.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,wm.alpha)(e.palette.primary.main,.12),fill:e.palette.primary.main,color:e.palette.primary.main,"&:hover":{backgroundColor:(0,wm.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:{}}))),NE=(0,ld.T)(Wh()),PE=({className:e,classes:t={},modes:r=[],modeId:n,onChange:a})=>{const i=IE();return v().createElement(_E(),{className:e},r.map((({id:e,title:r,tooltipTitle:o,Icon:l,disabled:s})=>{return v().createElement(NE,{disabled:s,showForDisabled:s&&!!o,key:String(e),className:O()(i.button,{[i.current]:n===e},t.button),tooltipTitle:o,onClick:(c=e,()=>a(c)),"data-reltio-id":`reltio-search-mode-${e}`},l&&v().createElement(l,{className:i.icon}),r&&v().createElement("div",{className:i.title},r));var c})))},DE=(0,wp.Z)((()=>({button:{"&.MuiButtonGroup-grouped":{minWidth:"90px",padding:"8px 12px"}}})));function kE(){return kE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kE.apply(null,arguments)}const LE=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",kE({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),v().createElement("defs",null,v().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"})),v().createElement("g",{stroke:"none",strokeWidth:"1"},v().createElement("g",{transform:"translate(.2)"},v().createElement("mask",{id:"svg3365802068b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg3365802068a"})),v().createElement("g",{mask:"url(#svg3365802068b)"},v().createElement("g",null,v().createElement("g",null,v().createElement("path",{d:"M0 0h24v24H0z"})))))))};function UE(){return UE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},UE.apply(null,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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",UE({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),v().createElement("defs",null,v().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"})),v().createElement("g",{stroke:"none",strokeWidth:"1"},v().createElement("g",{transform:"translate(.2)"},v().createElement("mask",{id:"svg4195527304b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg4195527304a"})),v().createElement("g",{mask:"url(#svg4195527304b)"},v().createElement("path",{d:"M0 0h24v24H0z"})))))},FE=e=>{switch(e){case Z.ll.TABLE:return LE;case Z.ll.LIST:return jE;default:return $h()}},ME=[{id:Z.ll.TABLE,tooltipTitle:li().text("Table view"),title:li().text("Table"),Icon:FE(Z.ll.TABLE)},{id:Z.ll.LIST,tooltipTitle:li().text("List view"),title:li().text("List"),Icon:FE(Z.ll.LIST)}],VE=({className:e})=>{const t=DE(),r=(0,mp.useDispatch)(),n=(0,mp.useSelector)(Ri.XM);return v().createElement(PE,{className:e,classes:{button:t.button},modes:ME,modeId:n,onChange:e=>{n!==e&&r((e=>({type:Ae,payload:e}))(e))}})};VE.propTypes={className:dp().string};const BE=VE;var zE=r(81085),HE=r.n(zE),YE=r(48139),WE=r.n(YE);const GE="DATA_TENANTS_UPDATED",qE=e=>t=>({type:e,payload:t}),ZE=(qE(GE),(e=null,t)=>t.type===GE?t.payload||null:e),$E="TENANTS_UPDATED",KE=(qE($E),(e=null,t)=>t.type===$E?t.payload||null:e);let XE=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 QE(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const JE={},eb=(0,_.pipe)(S.normalizeMetadata,S.parseMetadata,S.localizeMetadata),tb=(0,_.map)(S.localizeMetadata),rb=(e=JE,t)=>{switch(t.type){case"METADATA_LOADED":{const{tenant:r,metadata:n}=t.payload;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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){QE(e,t,r[t])}))}return e}({},e,{[r]:eb(n)})}case XE.LOCALIZATION_LOADED:return tb(e);default:return e}};let nb=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.RUN_AUTHORING_TASK_ACTION="RUN_AUTHORING_TASK_ACTION",e}({});const ab=qE(nb.ADD_ATTRIBUTES),ib=qE(nb.ADD_DEFAULT_VALUES),ob=qE(nb.MODIFY_ATTRIBUTE),lb=qE(nb.REMOVE_ATTRIBUTE),sb=qE(nb.ADD_NEXT_PAGE_ATTRIBUTE_VALUES),cb=qE(nb.PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES),ub=qE(nb.REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES),pb=qE(nb.SAVE_PROFILE),db=qE(nb.RUN_AUTHORING_TASK_ACTION),mb=qE(nb.SAVE_DRAFT),fb=qE(nb.PROFILE_SAVED),yb=qE(nb.VALIDATE_PROFILE);let gb=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 hb=qE(gb.DEPENDENT_LOOKUPS_STRUCTURE_SET),Eb=qE(gb.DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED),bb=qE(gb.DEPENDENT_LOOKUPS_EDITORS_BLOCKED),vb=qE(gb.DEPENDENT_LOOKUPS_EDITOR_TOUCHED);let Tb=function(e){return e.MODE_UPDATED="MODE_UPDATED",e.MODE_EDITING_CANCELED="MODE_EDITING_CANCELED",e.MODE_UPDATE_REQUESTED="MODE_UPDATE_REQUESTED",e}({});function Ob(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Sb(e,t,r[t])}))}return e}function Sb(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xb={structure:{},editors:{},initedTypeUris:[]},Cb="SEARCH_RESULTS_SET",wb="KEYWORD_UPDATED",Ab="UPDATE_STATE",Rb="ACTIVITY_FILTER_UPDATED",_b="GLOBAL_FILTER_UPDATED",Ib="SEARCH_OPTIONS_UPDATED",Nb="SET_SEARCH_OPTIONS_CONFIG",Pb="SET_SEARCH_PROVIDER_DATA",Db="SET_SEARCH_NAVIGATION_DATA",kb="UPDATE_SEARCH_NAVIGATION_DATA_FIELDS",Lb=qE(Cb),Ub=qE(wb),jb=qE(Ab),Fb=qE("SAVE_STATE"),Mb=qE(Rb),Vb=qE(_b),Bb=qE(Ib),zb=qE(Nb),Hb=qE(Pb),Yb=qE(Db),Wb=qE(kb),Gb=qE("UPDATE_SEARCH_NAVIGATION_DATA_ON_MERGE"),qb=(0,_.path)(["globalFilter","savedSearchesUris"]),Zb="searchNavigation";function*$b(){const e=yield(0,La.Ys)(iI.selectors.getSearchNavigationData),t=yield(0,La.Ys)(iI.selectors.getSearchProviderData);sessionStorage.setItem(Zb,JSON.stringify({searchNavigationData:e,searchProviderData:t}))}function*Kb(){let e;try{e=JSON.parse(sessionStorage.getItem(Zb))||{}}catch(t){e={}}const{searchNavigationData:t,searchProviderData:r}=e;t&&r&&(yield(0,La.gz)(Hb(r)),yield(0,La.gz)(Yb(t)))}const Xb=[function*(){yield(0,La.Fm)([Db,kb,XE.OPEN_ENTITY],$b)},function*(){yield(0,La.RE)(Kb)}];function Qb(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Jb(e,t,r[t])}))}return e}function Jb(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ev={searchResults:[],keyword:null,searchOptions:{searchByOv:!1,ovOnly:!1},activityFilter:"active",globalFilter:{query:null,savedSearchesUris:[],isMuted:!0},searchProviderData:null,searchNavigationData:null},tv=(e=ev,t)=>{switch(t.type){case Cb:return Qb({},e,{searchResults:t.payload});case wb:{const r=(0,_.pick)(["value","isRawFilter"],t.payload||{});return Qb({},e,{keyword:(0,_.isEmpty)(r)?null:r})}case Ab:return Qb({},ev,{keyword:(0,_.isNil)(t.payload.keyword)||(0,_.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 Rb:return Qb({},e,{activityFilter:t.payload});case _b:return Qb({},e,{globalFilter:(0,S.isEmptyValue)(t.payload)?ev.globalFilter:t.payload});case Ib:return Qb({},e,{searchOptions:Qb({},e.searchOptions,t.payload)});case Nb:{const r=!!t.payload.showSearchByOv;return Qb({},e,{searchOptions:{searchByOv:r,ovOnly:r}})}case Pb:return Qb({},e,{searchProviderData:t.payload});case Db:return Qb({},e,{searchNavigationData:t.payload});case kb:return Qb({},e,{searchNavigationData:Qb({},e.searchNavigationData,t.payload)});case XE.OPEN_ENTITY:{var r;const n=(0,S.removeDtssPrefixFromEntityUri)(t.payload.uri);return"navigation"===t.payload.source||n===(null===(r=e.searchNavigationData)||void 0===r?void 0:r.uri)?e:Qb({},e,{searchNavigationData:null})}default:return e}},rv=({uri:e,source:t=null,screen:r="profile"})=>({type:XE.OPEN_ENTITY,payload:{uri:e,source:t,screen:r}}),nv=({entity:e})=>({type:XE.NEW_ENTITY_SHOWN,payload:{entity:e}}),av=qE(XE.ENTITY_DELETION_FINISHED),iv=qE(XE.OPEN_PERSPECTIVE),ov=e=>({type:XE.SHOW_NOTIFICATION,payload:e}),lv=e=>({type:XE.CLOSE_NOTIFICATION,payload:e}),sv=qE(XE.CLEAR_NOTIFICATIONS),cv=qE(XE.PATHS_SET),uv=qE(XE.UI_PATH_SET),pv=qE(XE.UI_CONFIG_LOADED),dv=qE(XE.NEW_UI_CONFIG_LOADED),mv=qE(XE.LOCALE_ATTRIBUTE_PRESENTATION_LOADED),fv=qE(XE.AUTOCLOSE_INTERVAL_LOADED),yv=qE(XE.SET_PREFER_REACT),gv=qE(XE.NUMBER_FORMAT_UPDATED),hv=(e,t,r)=>({type:XE.OPEN_CONSOLE_APP,payload:{name:e,path:t,query:r}}),Ev=qE(XE.OPEN_APP_FROM_CHOCOLATE_BAR),bv=qE(XE.OPEN_GRAPH),vv=qE(XE.LOCALIZATION_LOADED),Tv=qE(XE.DATE_MASK_UPDATED),Ov=qE(XE.DATE_TIME_MASK_UPDATED),Sv=e=>({type:XE.OPEN_SEARCH,payload:"searchState"in e?e:{searchState:e}}),xv=e=>({type:XE.OPEN_DASHBOARD,payload:e}),Cv=qE(XE.OPEN_HISTORY_EVENT),wv=qE(XE.OPEN_NEW_ENTITY_WITH_AUTHORING),Av=qE(XE.OPEN_PREVIOUS_PAGE),Rv=qE(XE.NAVIGATE),_v=qE(XE.KEYS_SET),Iv=qE(XE.OPEN_PIVOTING_PERSPECTIVE),Nv=qE(XE.ERROR_SET),Pv=qE(XE.DOCUMENTATION_SET),Dv=qE(XE.ADD_DASHBOARD_EXTERNAL_VIEW),kv=qE(XE.SET_USE_SHARED_PREFERENCES);function Lv(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Uv=(0,_.path)(["paths","imagePath"]),jv=(0,_.path)(["paths","exportPath"]),Fv=(0,_.path)(["paths","apiPath"]),Mv=(0,_.path)(["paths","uiPath"]),Vv=(0,_.path)(["paths","reltioPath"]),Bv=(0,_.path)(["paths","dtssPath"]),zv=(0,_.path)(["paths","exportDQPath"]),Hv=(0,_.either)((0,_.path)(["newConfig","properties","workflow","path"]),(0,_.path)(["paths","workflowPath"])),Yv=(0,_.prop)("paths"),Wv=(0,_.path)(["paths","workflowEnvironmentURL"]),Gv=(0,_.path)(["paths","collaborationPath"]),qv=(0,_.path)(["paths","imageServicePath"]),Zv=(0,_.path)(["paths","dvfPath"]),$v=(0,_.path)(["paths","validationServicePath"]),Kv=(0,_.path)(["paths","adminToolsPath"]),Xv=(0,_.path)(["paths","mlDqPath"]),Qv=(0,wc.createSelector)((e=>(0,_.path)(["newConfig","properties","attributes","presentation"])(e)),(()=>S.intl.getLocale()),((e={},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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Lv(e,t,r[t])}))}return e}({},e,(0,S.getSpecialAttributesPresentation)(e,t)))),Jv=(0,_.either)((0,_.path)(["config","com.reltio.plugins.entity.EntityRequestSettings","defaultMaxValues"]),(0,_.path)(["newConfig","properties","entity","maxValuesInResponse"])),eT=(0,_.path)(["numberFormat"]),tT=(0,_.either)((0,_.path)(["newConfig","properties","masks","dateMask"]),(0,_.path)(["dateMask"])),rT=(0,_.path)(["notifications"]),nT=(0,_.either)((0,_.path)(["newConfig","properties","masks","dateTimeMask"]),(0,_.path)(["dateTimeMask"])),aT=(0,_.path)(["newConfig","properties","requestProvider"]),iT=["config","com.reltio.plugins.pivoting.PivotingSettings","pivotingAttributes"],oT=(0,_.chain)((0,_.prop)("attributeTypes")),lT=(0,_.ifElse)((0,_.hasPath)(iT),(0,_.path)(iT),(0,_.pipe)((0,_.pathOr)([],["newConfig","pivoting"]),oT)),sT=(0,_.either)((0,_.path)(["config","com.reltio.plugins.imageattribute.fieldsorder"]),(0,_.path)(["newConfig","properties","image","attributeFieldsOrder"])),cT=(0,_.either)((0,_.path)(["config","com.reltio.plugins.ui.LookupAutocomplete"]),(0,_.path)(["newConfig","properties","lookups","autocomplete"])),uT=(0,_.path)(["keys","googleMapKey"]),pT=(0,_.path)(["keys","icpLicenseKey"]),dT=(0,_.pathOr)("",["documentation","releaseNotes"]),mT=["config","com.reltio.plugins.entity.ValidationServiceLevels","levels"],fT=(0,_.ifElse)((0,_.hasPath)(mT),(0,_.path)(mT),(0,_.path)(["newConfig","properties","validation","levels"])),yT=(0,_.ifElse)((0,_.hasPath)(["config","com.reltio.plugins.entity.Validation","validateReadMode"]),(0,_.path)(["config","com.reltio.plugins.entity.Validation","validateReadMode"]),(0,_.pathOr)(!0,["newConfig","properties","validation","validateReadMode"])),gT=(0,_.pathOr)(!1,["newConfig","properties","validation","validateRelations"]),hT=(0,_.pathOr)(!1,["newConfig","properties","validation","validateReferenceEntityInReadMode"]),ET=(0,_.either)((0,_.path)(["config","com.reltio.plugins.workflow.configuration","enabled"]),(0,_.path)(["newConfig","properties","workflow","enabled"])),bT=(0,_.path)(["error"]),vT=(0,_.path)(["paths","servicesPath"]),TT=(0,_.path)(["newConfig"]),OT=(0,_.path)(["newConfig","layout"]),ST=(0,_.path)(["newConfig","profile"]),xT=(0,_.pathOr)(!0,["newConfig","properties","showEntityId"]),CT=(0,_.path)(["newConfig","properties","release"]),wT=(0,_.path)(["newConfig","properties","logo"]),AT=(0,_.path)(["newConfig","properties","headerColor"]),RT=(0,_.path)(["newConfig","properties","showSearchByOv"]),_T=(0,_.path)(["newConfig","properties","showAttributeDescription"]),IT=(0,_.path)(["newConfig","properties","attributes","sorting"]),NT=(0,_.path)(["newConfig","properties","profileCheckUpdate"]),PT=(0,_.pathOr)(!1,["newConfig","properties","aiAssistant","enabled"]),DT=(0,_.pathOr)(500,["newConfig","properties","aiAssistant","messagesPerDay"]),kT=(0,_.path)(["newConfig","properties","aiAssistant","skills"]),LT=(0,_.path)(["newConfig","properties","aiAssistant","historyBufferSize"]),UT=(0,_.pathOr)(!1,["newConfig","properties","queryEstimator","enabled"]),jT=(0,_.pathOr)(!1,["newConfig","properties","sharedPreferences","enabled"]);function FT(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){MT(e,t,r[t])}))}return e}function MT(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const VT={},BT=(e=VT,t)=>{switch(t.type){case XE.PATHS_SET:return FT({},e,{paths:t.payload});case XE.UI_PATH_SET:return(0,_.evolve)({paths:(0,_.assoc)("uiPath",t.payload)},e);case XE.UI_CONFIG_LOADED:return FT({},e,{config:t.payload});case XE.NEW_UI_CONFIG_LOADED:return FT({},e,{newConfig:t.payload});case XE.LOCALE_ATTRIBUTE_PRESENTATION_LOADED:return(0,_.evolve)({newConfig:{properties:{attributes:{presentation:(0,_.assoc)(S.LOCALE_ATTRIBUTE_PRESENTATION,t.payload)}}}},e);case XE.AUTOCLOSE_INTERVAL_LOADED:return FT({},e,{autoCloseInterval:t.payload});case XE.NUMBER_FORMAT_UPDATED:return FT({},e,{numberFormat:t.payload});case XE.DATE_MASK_UPDATED:return FT({},e,{dateMask:t.payload});case XE.DATE_TIME_MASK_UPDATED:return FT({},e,{dateTimeMask:t.payload});case XE.KEYS_SET:return FT({},e,{keys:t.payload});case XE.ERROR_SET:return FT({},e,{error:t.payload});case XE.DOCUMENTATION_SET:return FT({},e,{documentation:t.payload});case XE.SHOW_NOTIFICATION:return FT({},e,{notifications:[...e.notifications||[],t.payload]});case XE.CLOSE_NOTIFICATION:return(0,_.evolve)({notifications:(0,_.reject)((0,_.propEq)("id",t.payload))},e);case XE.CLEAR_NOTIFICATIONS:return FT({},e,{notifications:[]});case XE.SET_USE_SHARED_PREFERENCES:return FT({},e,{useSharedPreferences:t.payload});default:return e}},zT="USER_UPDATED",HT=(qE(zT),(e=null,t)=>t.type===zT?t.payload||null:e),YT="TENANT_UPDATED",WT="TENANT_NAME_UPDATED",GT=(qE(YT),qE(WT),(0,_.prop)("id")),qT=(0,_.prop)("name");function ZT(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){$T(e,t,r[t])}))}return e}function $T(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const KT=(e=null,t)=>{switch(t.type){case YT:return ZT({},e,{id:t.payload});case WT:return ZT({},e,{name:t.payload});default:return e}},XT="ENVIRONMENT_UPDATED",QT="ENVIRONMENT_ALIAS_UPDATED",JT=(qE(XT),qE(QT),(0,_.prop)("id")),eO=(0,_.prop)("alias");function tO(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){rO(e,t,r[t])}))}return e}function rO(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nO=(e=null,t)=>{switch(t.type){case XT:return tO({},e,{id:t.payload});case QT:return tO({},e,{alias:t.payload});default:return e}},aO=e=>e.dataTenants,iO=e=>e.tenants,oO=(e,t=KS(e))=>e.metadata&&e.metadata[t],lO=e=>e.tenant,sO=e=>e.environment,cO=e=>e.user,uO=e=>e.ui,pO=e=>e.profile,dO=e=>e.search,mO=e=>qA(pO(e)),fO=e=>sR(pO(e)),yO=e=>cR(pO(e)),gO=(e,t)=>hR(pO(e),t),hO=(e,t,r)=>fR(pO(e),t,r),EO=(e,t,r)=>yR(pO(e),t,r),bO=(e,t,r)=>mR(pO(e),t,r),vO=(e,t)=>ER(pO(e),t),TO=e=>bR(pO(e)),OO=(e,t,r)=>gR(pO(e),t,r),SO=e=>QA(pO(e)),xO=e=>$A(pO(e)),CO=e=>dR(pO(e)),wO=e=>YR(pO(e)),AO=e=>WR(pO(e)),RO=e=>GR(pO(e)),_O=e=>qR(pO(e)),IO=e=>ZR(pO(e)),NO=(e,t)=>uR(pO(e),t),PO=(e,t)=>pR(pO(e),t),DO=e=>ZA(pO(e)),kO=(e,t)=>$R(pO(e),t),LO=(e,t,{uri:r})=>IR(pO(e),t,r),UO=(e,t,{uri:r})=>NR(pO(e),t,r),jO=(e,t,r)=>PR(pO(e),t,r),FO=e=>Uv(uO(e)),MO=e=>Fv(uO(e)),VO=e=>jv(uO(e)),BO=e=>Mv(uO(e)),zO=e=>Vv(uO(e)),HO=e=>qv(uO(e)),YO=e=>Kv(uO(e)),WO=e=>Qv(uO(e)),GO=e=>eT(uO(e)),qO=e=>Jv(uO(e)),ZO=e=>(e=>e.autoCloseInterval)(uO(e)),$O=e=>tT(uO(e)),KO=e=>nT(uO(e)),XO=e=>aT(uO(e)),QO=e=>rT(uO(e)),JO=e=>lT(uO(e)),eS=e=>sT(uO(e)),tS=e=>cT(uO(e)),rS=e=>uT(uO(e)),nS=e=>pT(uO(e)),aS=e=>fT(uO(e)),iS=e=>yT(uO(e)),oS=e=>gT(uO(e)),lS=e=>hT(uO(e)),sS=e=>PT(uO(e)),cS=e=>DT(uO(e)),uS=e=>kT(uO(e)),pS=e=>LT(uO(e)),dS=e=>jT(uO(e)),mS=e=>(e=>e.searchResults)(dO(e)),fS=e=>(e=>e.keyword)(dO(e)),yS=e=>S.getActivityFilter(dO(e)),gS=e=>S.getSearchOptions(dO(e)),hS=e=>(e=>e.searchProviderData)(dO(e)),ES=e=>(e=>e.searchNavigationData)(dO(e)),bS=(e,t)=>S.getGlobalSearchRequestOptions(dO(e),t),vS=e=>S.getStringifiedSearchOptions(dO(e)),TS=e=>(e=>e.globalFilter)(dO(e)),OS=e=>S.getGlobalFilterQuery(dO(e)),SS=e=>qb(dO(e)),xS=e=>eR(pO(e)),CS=e=>vR(pO(e)),wS=e=>TR(pO(e)),AS=e=>OR(pO(e)),RS=e=>KA(pO(e)),_S=(e,t)=>SR(pO(e),t),IS=(e,t)=>xR(pO(e),t),NS=(e,t)=>CR(pO(e),t),PS=(e,t,r)=>wR(pO(e),t,r),DS=(e,t,r)=>AR(pO(e),t,r),kS=(e,t,r)=>RR(pO(e),t,r),LS=(e,t)=>_R(pO(e),t),US=e=>Uv(uO(e))||Fv(uO(e)),jS=e=>(e=>null==e?void 0:e.username)(cO(e)),FS=e=>(e=>null==e?void 0:e.roles)(cO(e)),MS=e=>XA(pO(e)),VS=(e,t)=>DR(pO(e),t),BS=(e,t)=>kR(pO(e),t),zS=(e,t)=>LR(pO(e),t),HS=e=>UR(pO(e)),YS=(e,t,r)=>jR(pO(e),t,r),WS=(e,t)=>FR(pO(e),t),GS=e=>tR(pO(e)),qS=e=>nR(pO(e)),ZS=e=>aR(pO(e)),$S=e=>e_(pO(e),EC(e)),KS=e=>GT(lO(e)),XS=e=>qT(lO(e)),QS=e=>JT(sO(e)),JS=e=>eO(sO(e)),ex=e=>Bv(uO(e)),tx=e=>zv(uO(e)),rx=e=>Hv(uO(e)),nx=e=>Yv(uO(e)),ax=e=>Wv(uO(e)),ix=e=>ET(uO(e)),ox=e=>Gv(uO(e)),lx=e=>Zv(uO(e)),sx=e=>$v(uO(e)),cx=e=>Xv(uO(e)),ux=(0,wc.createSelector)(cO,KS,S.canUserRegisterConfigEnvironments),px=(0,wc.createSelector)(cO,KS,S.canUserCreateWorkflowConfigJar),dx=(0,wc.createSelector)(cO,KS,S.canUserCreateWorkflowEnvironmentConfigJar),mx=(0,wc.createSelector)(cO,KS,S.canUserExecuteWorkflowJobs),fx=(0,wc.createSelector)(cO,KS,S.canUserExecuteWorkflowJobsSyncBusinessProcessData),yx=(0,wc.createSelector)(cO,KS,S.canUserExecuteWorkflowJobsTerminateProcessInstance),gx=(0,wc.createSelector)(cO,KS,S.canUserExecuteWorkflowJobsUpdateTasks),hx=(0,wc.createSelector)(cO,KS,S.canUserExecuteWorkflowJobsValidateTasks),Ex=(0,wc.createSelector)(cO,KS,S.canUserManageWorkflowDefinition),bx=(0,wc.createSelector)(cO,KS,S.canUserManageWorkflowEnvironmentDefinition),vx=(0,wc.createSelector)(cO,KS,S.canUserReadWorkflowDataTask),Tx=(0,wc.createSelector)(cO,KS,S.canUserUpdateProcessInstance),Ox=(0,wc.createSelector)(cO,KS,S.canUserUpdateWorkflowDataTask),Sx=(0,wc.createSelector)(cO,KS,S.canUserViewProcessInstanceSearchQuery),xx=(0,wc.createSelector)(cO,KS,S.canUserViewWorkflowConfigJar),Cx=(0,wc.createSelector)(cO,KS,S.canUserViewWorkflowDefinition),wx=(0,wc.createSelector)(cO,KS,S.canUserViewWorkflowEnvironmentConfigJar),Ax=(0,wc.createSelector)(cO,KS,S.canUserViewWorkflowJobs),Rx=(0,wc.createSelector)(cO,KS,S.canUserMakeExport),_x=(0,wc.createSelector)(cO,KS,S.canUserMakeActivitiesExport),Ix=(0,wc.createSelector)(cO,KS,S.canUserImportEntitiesFromDT),Nx=(0,wc.createSelector)(cO,KS,S.canUserReadEntitiesFromDT),Px=(0,wc.createSelector)(cO,KS,S.canUserStartProcessInstanceFromQuery),Dx=(0,wc.createSelector)(cO,KS,S.canUserMakeBulkUpdate),kx=(0,wc.createSelector)(cO,KS,S.canUserDeleteProfiles),Lx=(0,wc.createSelector)(cO,KS,S.canUserOpenDataLoader),Ux=(0,wc.createSelector)(cO,KS,S.canUserGetDQStatistic),jx=(0,wc.createSelector)(cO,KS,S.canUserReadDVF),Fx=(0,wc.createSelector)(ox,_O,((e,t)=>!!e&&!t)),Mx=(0,wc.createSelector)(rx,ix,((e,t)=>!!e&&!!t)),Vx=(e,t)=>{var r;return null===(r=iR(pO(e)))||void 0===r?void 0:r.find((0,_.propEq)("id",t))},Bx=(e,t)=>Boolean(Vx(e,t)),zx=e=>Bx(e,S.SidePanelViewId.Workflow),Hx=e=>Bx(e,S.SidePanelViewId.Discussion),Yx=e=>Bx(e,S.SidePanelViewId.History),Wx=e=>Bx(e,S.SidePanelViewId.DB),Gx=e=>{var t,r;return null!==(t=null===(r=Vx(e,S.SidePanelViewId.DB))||void 0===r?void 0:r.views)&&void 0!==t?t:[]},qx=e=>JA(pO(e)),Zx=e=>MR(pO(e)),$x=(e,t)=>VR(pO(e),t),Kx=e=>BR(pO(e)),Xx=e=>zR(pO(e)),Qx=(e,t)=>HR(pO(e),t),Jx=e=>bT(uO(e)),eC=(e,t)=>{const r=oO(e),n=xS(e),a=mO(e),{nextEntry:i,inRelations:o=[],outRelations:l=[]}=t,s=n===S.Mode.Editing||n===S.Mode.Suggesting,c=n===S.Mode.Suggesting&&(0,S.isTempUri)(null==a?void 0:a.uri),u=EC(e);if(!s||c&&!u||i||!a)return!1;{const e=(0,S.checkMetadataForUpdate)(n,(0,S.getEntityType)(r,a.type)),t=o.concat(l).map((e=>(0,S.getRelationType)(r,e.uri||e))).some((0,_.both)((0,S.checkMetadataForCreate)(n),(0,S.checkMetadataForUpdate)(n)));return e&&t}},tC=(0,wc.createSelector)(mO,wS,RO,wO,S.getProfileEntityWithHistoryDiff),rC=(0,wc.createSelector)(mO,wS,RO,S.getProfileEntityWithoutHistoryDiff),nC=e=>vT(uO(e)),aC=e=>TT(uO(e)),iC=e=>OT(uO(e)),oC=e=>ST(uO(e)),lC=e=>xT(uO(e)),sC=e=>CT(uO(e)),cC=e=>dT(uO(e)),uC=e=>wT(uO(e)),pC=e=>AT(uO(e)),dC=e=>RT(uO(e)),mC=e=>_T(uO(e)),fC=e=>IT(uO(e)),yC=e=>NT(uO(e)),gC=(e,t)=>((e,t)=>(0,S.getAuthoringItemsFromLayoutByEntityType)(ST(e),t))(uO(e),t),hC=(e,t)=>((e,t)=>(0,_.path)(["newConfig","properties","cleanse",t])(e))(uO(e),t),EC=e=>{const t=mO(e),r=gC(e,null==t?void 0:t.type);return!(0,S.isEmptyValue)(r)},bC=e=>UT(uO(e)),vC=e=>oR(pO(e)),TC=e=>lR(pO(e)),OC=(e,t)=>Mx(e)&&Px(e)&&(0,S.checkMetadataPermission)(S.MetadataPermissions.INITIATE_CHANGE_REQUEST,t);let SC=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}({}),xC=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.UPDATE_RELATION_RATING="UPDATE_RELATION_RATING",e}({});var CC=r(51095);const wC=(e,t)=>e.find((0,_.pipe)(S.getRelationUriFromConnection,(0,_.equals)(t))),AC=(e,t)=>(0,_.path)([t,"connections"],e),RC=r.n(CC)()(AC,((e,t)=>(0,_.path)([t,"drafts"],e)),((e,t,r)=>r),((e=[],t={},r)=>{var n;const{addedConnections:a=[],editedConnections:i=[],removedUris:o=[],ignoredRelationData:l=[]}=t,s=(0,_.pipe)(S.getRelationUriFromConnection,_.equals,(0,_.find)(_.__,o)),c=l.map((e=>e.relationUri)),u=(0,_.pipe)(S.getRelationUriFromConnection,_.equals,(0,_.find)(_.__,c)),p=r?(null===(n=e.find((e=>e.entity.entityUri===r)))||void 0===n?void 0:n.connections)||[]:e,d=a.filter((0,_.propEq)("parentEntityUri",r));return d.map(S.markNew).concat(p.filter((e=>!d.some((0,_.pipe)(S.getRelationUriFromConnection,(0,_.equals)((0,S.getRelationUriFromConnection)(e)))))).map((0,_.pipe)((0,_.either)((e=>(0,_.pipe)((0,_.eqBy)(S.getRelationUriFromConnection),(0,_.find)(_.__,i),(0,_.unless)(_.isNil,S.markEdited))(e)),_.identity),(0,_.when)(s,S.markRemoved),(0,_.when)(u,S.markIgnored))))}))(((e,t,r)=>t+r)),_C=(e,t,r)=>{const n=(0,S.getTempRelations)(e,t);return wC(n,r)};function*IC(e){yield(0,La.gw)(0);const t=e.payload,r=yield(0,La.Ys)(oO),n=yield(0,La.Ys)(Zx),a=[t.type],i=yield(0,La.Ys)(Kx),o=(0,S.initDependentLookups)({structure:n,metadata:r,typeUris:a,alreadyAddedTypeUris:i}),l=(0,S.populateDependentLookupsFromEntity)({structure:o,metadata:r,entityOrRelation:t});yield(0,La.gz)(hb(l)),yield(0,La.gz)(Eb(a))}function*NC(e,t){const r=(0,S.getBaseUri)(e);return(0,S.isRelationUri)(r)?yield(0,La.Ys)(EO,t,r):yield(0,La.Ys)(NO,r)}function*PC(e){const{attributeType:t,metadata:r,parentUri:n,viewId:a}=e.payload,i=yield(0,La.RE)(NC,n,a),o=yield(0,La.Ys)(Zx);if(i)if(t){const e=(0,S.findAttributeValuesByTypeUri)(r,i,t.uri).filter((({uri:e})=>e.startsWith(n)))[0],a=(0,S.addValueToDependentLookups)({structure:o,attributeValue:e});yield(0,La.gz)(hb(a))}else{const e=[i.type],t=yield(0,La.Ys)(Kx),n=(0,S.initDependentLookups)({structure:o,metadata:r,typeUris:e,alreadyAddedTypeUris:t}),a=(0,S.populateDependentLookupsFromEntity)({structure:n,metadata:r,entityOrRelation:i});yield(0,La.gz)(hb(a)),yield(0,La.gz)(Eb(e))}}function*DC(e){const t=e.payload,r=yield(0,La.Ys)(oO),n=yield(0,La.Ys)(Zx);let a=n;for(const e of t){const{attributeType:t,parentUri:i,viewId:o}=e;if((0,S.isAttributeTypeInDependentLookups)(n,t.uri)){const e=yield(0,La.RE)(NC,i,o);e&&(a=(0,S.syncAttributeTypeWithDependentLookups)({structure:a,entityOrRelation:e,attrTypeUri:t.uri,metadata:r}))}}a!==n&&(yield(0,La.gz)(hb(a)))}function*kC({structure:e,attributeType:t,value:r}){if((0,S.isReference)(t)&&r){const t=(0,S.getReferencedEntityUriFromAttrValue)(r);if((0,S.isTempUri)(t))return yield(0,La.RE)(FC,e,t)}return e}function*LC({structure:e,uri:t,attributeType:r,value:n}){let a=(0,S.removeValuesFromDependentLookups)({structure:e,uri:t});if(a=yield(0,La.RE)(kC,{structure:a,attributeType:r,value:n}),a=(0,S.addValueToDependentLookups)({structure:a,attributeValue:n}),(0,S.isReference)(r)&&n){const e=(0,S.getReferencedEntityUriFromAttrValue)(n);(0,S.isTempUri)(e)&&(a=yield(0,La.RE)(jC,a,e))}a!==e&&(yield(0,La.gz)(hb(a)))}function*UC(e){yield(0,La.gw)(0);const{attributeType:t,uri:r,viewId:n,silent:a,value:i}=e.payload,o=yield(0,La.Ys)(Zx),l=yield(0,La.RE)(NC,r,n);if(l&&(0,S.isAttributeTypeInDependentLookups)(o,t.uri)){const{value:n,lookupCode:i}=e.payload.value,l=i||n;a||(yield(0,La.rM)(BC,o,{type:t.uri,uri:r,lookupValue:l}));const s=(0,S.addValueToDependentLookups)({structure:o,attributeValue:{type:t.uri,value:l,uri:r}});yield(0,La.gz)(hb(s))}l&&(0,S.isComplexAttribute)(t.type)&&(yield(0,La.RE)(LC,{structure:o,uri:r,attributeType:t,value:i}))}function*jC(e,t){const r=yield(0,La.Ys)(oO),n=yield(0,La.Ys)(NO,t);if(!n)return e;const a=yield(0,La.Ys)(DO),i=(0,S.findRelatedTemporaryEntities)(a,n);let o=e;for(const e of[n,...i])o=(0,S.populateDependentLookupsFromEntity)({structure:o,metadata:r,entityOrRelation:e});return o}function*FC(e,t){const r=yield(0,La.Ys)(NO,t),n=yield(0,La.Ys)(DO),a=(0,S.findRelatedTemporaryEntities)(n,r).map((0,_.prop)("uri"));let i=e;for(const e of[t,...a])i=(0,S.removeValuesFromDependentLookups)({structure:i,uri:e});return i}function*MC(e){const{attributeType:t,uri:r,attributeValue:n,viewId:a}=e.payload,i=yield(0,La.Ys)(Zx),o=(0,S.isAttributeTypeInDependentLookups)(i,t.uri);if(yield(0,La.RE)(NC,r,a)){o&&(yield(0,La.rM)(BC,i,{type:t.uri,uri:r,lookupValue:""}));let e=o||(0,S.isComplexAttribute)(t)?(0,S.removeValuesFromDependentLookups)({structure:i,uri:r}):i;e=yield(0,La.RE)(kC,{structure:e,attributeType:t,value:n}),e!==i&&(yield(0,La.gz)(hb(e)))}}function*VC(e){yield(0,La.gw)(0);const t=yield(0,La.Ys)(Zx),r=yield(0,La.RE)(FC,t,e.payload);yield(0,La.gz)(hb(r))}function*BC(e,t){var r;const n=yield(0,La.Ys)(oO),a=yield(0,La.Ys)(DO),i=yield(0,La.Ys)(NS),o=yield(0,La.Ys)(fO),l=yield(0,La.Ys)(tS),s=yield(0,La.Ys)(Xx),c=yield(0,La.Ys)(vC),u=(0,S.getDependentLookupStateForValueUri)({structure:e,typeUri:t.type,valueUri:t.uri,modifiedEntities:a,connections:i,entityUri:o,config:l,editorsState:s,hiddenAttributes:null!==(r=c[o])&&void 0!==r?r:[]});if(u.length>0){const e=u.map((e=>e.uri));yield(0,La.gz)(bb({uris:e,isBlocked:!0}));try{const e=yield(0,La.RE)(S.cascadeUpdate,u,t);for(const r of e){const{type:e,uri:a,lookupValue:i,displayName:o}=r,l=(yield(0,La.Ys)(LS,(0,S.getBaseUri)(a)))[0],s=yield(0,La.RE)(NC,a,l);s&&(0,S.findAttributeValueByUri)(s,a)&&a!==t.uri&&(yield(0,La.gz)(ob({attributeType:(0,S.findAttributeTypeByUri)(n,e),uri:a,value:{value:o||"",lookupCode:i||""},silent:!0,viewId:l})))}}catch(e){console.warn(e)}yield(0,La.gz)(bb({uris:e,isBlocked:!1}))}}function*zC(e){const t=e.payload.connection,r=(0,S.getEntityUriFromConnection)(t);if((0,S.isTempUri)(r)&&(yield(0,La.Ys)(NO,r))){yield(0,La.qn)(gb.DEPENDENT_LOOKUPS_STRUCTURE_SET);const e=yield(0,La.Ys)(Zx),t=yield(0,La.RE)(jC,e,r);yield(0,La.gz)(hb(t))}}function*HC(e){const t=e.payload.relationUri,r=yield(0,La.Ys)(Zx),n=(0,S.removeValuesFromDependentLookups)({structure:r,uri:t});yield(0,La.gz)(hb(n))}function*YC(e){const t=e.payload.id,r=e.payload.relationUri;if(0===(yield(0,La.Ys)(LS,r)).length){const e=yield(0,La.Ys)(Zx);let n=(0,S.removeValuesFromDependentLookups)({structure:e,uri:r});const a=yield(0,La.Ys)(bO,t),i=wC(a,r),o=(0,S.getEntityUriFromConnection)(i);(0,S.isTempUri)(o)&&(n=yield(0,La.RE)(FC,n,o)),yield(0,La.gz)(hb(n))}}const WC=[function*(){yield(0,La.ib)(SC.MODIFIED_ENTITY_CREATED,IC)},function*(){yield(0,La.ib)(SC.MODIFIED_ENTITY_DELETED,VC)},function*(){yield(0,La.ib)(nb.ADD_DEFAULT_VALUES,PC)},function*(){yield(0,La.ib)(nb.ADD_ATTRIBUTES,DC)},function*(){yield(0,La.ib)(nb.MODIFY_ATTRIBUTE,UC)},function*(){yield(0,La.ib)(nb.REMOVE_ATTRIBUTE,MC)},function*(){yield(0,La.ib)(xC.OPEN_RELATION_EDITOR,zC)},function*(){yield(0,La.ib)(xC.SET_RELATION_TYPE,HC)},function*(){yield(0,La.ib)(xC.CLOSE_RELATION_EDITOR,YC)}];let GC=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.AUTHORING_DCR_RESOLVED="AUTHORING_DCR_RESOLVED",e}({});const qC=(e,t)=>({type:GC.ENTITY_LOADED,payload:{entity:e,silent:t}}),ZC=qE(GC.DEFAULT_PROFILE_PIC_SET),$C=qE(GC.LOAD_ENTITY),KC=qE(GC.ENTITY_CREATION_REQUESTED),XC=qE(GC.ENTITY_CREATION_WITH_AUTHORING_REQUESTED),QC=qE(GC.ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED),JC=qE(GC.AUTHORING_DCR_RESOLVED),ew=qE(GC.ENTITY_REMOVE_REQUESTED),tw=qE(GC.CLONE_ENTITY),rw=qE(GC.CLEAR_ENTITY),nw=e=>null==e?void 0:e.uri,aw=(0,wc.createSelector)((e=>null==e?void 0:e.dataTenant),nw,((e,t)=>(0,S.getEntityUriForLink)({dataTenant:e,uri:t})));function iw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ow={};let lw=function(e){return e.ERRORS_SET="ERRORS_SET",e.REMOVE_ERROR="REMOVE_ERROR",e.ERROR_DEACTIVATED="ERROR_DEACTIVATED",e}({});const sw=qE(lw.ERROR_DEACTIVATED),cw=qE(lw.ERRORS_SET);function uw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pw=[];let dw=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 mw=qE(dw.HISTORY_DIFF_SET),fw=qE(dw.HISTORY_DIFF_CLEARED),yw=qE(dw.HISTORY_EVENT_SET),gw=qE(dw.HISTORY_EVENT_CLEARED),hw=qE(dw.HISTORY_SLICE_SET),Ew=qE(dw.HISTORY_MODE_SET);function bw(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){vw(e,t,r[t])}))}return e}function vw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Tw={mode:S.HistoryMode.Current};let Ow=function(e){return e.PROFILE_LAST_LOADED_TIME_UPDATE="PROFILE_LAST_LOADED_TIME_UPDATE",e}({});qE(Ow.PROFILE_LAST_LOADED_TIME_UPDATE);let Sw=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 xw=qE(Sw.LOOKUPS_LOADED),Cw=qE(Sw.LOOKUPS_FOR_TYPE_RESOLVED),ww=qE(Sw.LOOKUPS_LIST_RESOLVED);function Aw(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Rw(e,t,r[t])}))}return e}function Rw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _w={},Iw=(e,t)=>({type:Tb.MODE_UPDATED,payload:{mode:e,silent:t}}),Nw=qE(Tb.MODE_UPDATE_REQUESTED),Pw=qE(Tb.MODE_EDITING_CANCELED),Dw=S.isSuggestMode,kw=(S.isEditMode,S.isViewMode),Lw=S.isEditableMode,Uw=S.Mode.Viewing,jw=qE(SC.MODIFIED_ENTITY_CREATED),Fw=qE(SC.MODIFIED_ENTITY_DELETED),Mw=qE(SC.MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET),Vw=qE(SC.MODIFIED_ENTITIES_RESET),Bw=qE(SC.CLEANSE_LOADING);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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Hw(e,t,r[t])}))}return e}function Hw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Yw={};function Ww(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Gw(e,t,r[t])}))}return e}function Gw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*qw(e){const{values:t,parentUri:r,attributeTypeUri:n,attributeTypeName:a}=e.payload;let i=t;const o=yield(0,La.Ys)(mO);if(r===o.uri){const e=(0,S.getAttributeSource)(n),r=(0,_.pipe)((0,_.pathOr)([],[e,a]),(0,_.map)((0,_.prop)("uri")))(o),l=(0,_.intersection)(r,t.map((0,_.prop)("uri")));i=t.filter((e=>!l.includes(e.uri)))}i.length&&(yield(0,La.gz)(sb(Ww({},e.payload,{values:i}))))}function*Zw(){return{apiPath:yield(0,La.Ys)(MO),tenant:yield(0,La.Ys)(KS)}}function*$w(e){const{attributeTypeName:t,attributeTypeUri:r}=e.payload,n=yield(0,La.RE)(Zw);try{const a=yield(0,La.RE)(S.getPagedEntity,Ww({},e.payload,n)),i=(0,S.getAttributeSource)(r),o=(0,_.pathOr)([],[i,t],a);yield(0,La.gz)(cb(Ww({},e.payload,{values:o})))}catch(e){console.warn(e),yield(0,La.gz)(Nv((0,S.getRequestErrorMessage)(e,li().text("Something went wrong"))))}}function*Kw(e){var t;const{attributeType:r,value:n,uri:a}=e.payload,i=r.uri,o=(0,S.getBaseUri)(i),l=yield(0,La.Ys)(hC,o);if(!l)return;const s=yield(0,La.Ys)(oO),c=(0,S.getEntityType)(s,o),u=null==c||null===(t=c.cleanseConfig)||void 0===t?void 0:t.infos;if(!u)return;const p=(0,S.getCleanseType)(l,i);if(!(0,S.hasCleanseTypeInEntityType)(p,u))return;const d=(0,S.getCleanseAttributes)(l);if(null!=d&&d.includes(i)){yield(0,La.gz)(Bw({isLoading:!0}));try{const e=yield(0,La.RE)(S.cleanseData,{cleanseType:p.split("/cleanse/infos/")[1],type:o,attributes:{[r.name]:[{type:i,value:n}]}}),t=(0,S.getBaseUri)(a),l=yield(0,La.Ys)(NO,t);if((0,S.hasCleanseStatus)(e))if((0,S.isUnverifiedCleanse)(e))yield(0,La.gz)(Nv((0,_.path)(S.CLEANSE_STATUS_ERROR_PATH,e)));else if(l){const{attributes:r}=e,n=(0,S.prepareCleansedAttributes)(t,r);yield(0,La.gz)(jw(Ww({},l,{attributes:Ww({},l.attributes,n)})))}}catch(e){console.warn(e),yield(0,La.gz)(Nv((0,S.getRequestErrorMessage)(e,li().text("Something went wrong"))))}yield(0,La.gz)(Bw({isLoading:!1}))}}const Xw=[function*(){yield(0,La.ib)(nb.REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES,$w)},function*(){yield(0,La.ib)(nb.PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES,qw)},function*(){yield(0,La.ib)(nb.MODIFY_ATTRIBUTE,Kw)}],Qw=qE(xC.RELATIONS_LOADED),Jw=qE(xC.SECOND_LEVEL_RELATIONS_LOADED),eA=(0,_.curry)(((e,t)=>({type:xC.REMOVE_RELATION,payload:{id:e,relationUri:t}}))),tA=(0,_.curry)(((e,t)=>({type:xC.IGNORE_RELATION,payload:{id:e,ignoredRelationData:t}}))),rA=(0,_.curry)(((e,t)=>({type:xC.ADD_RELATION,payload:{id:e,connection:t}}))),nA=(0,_.curry)(((e,t)=>({type:xC.EDIT_RELATION,payload:{id:e,connection:t}}))),aA=(0,_.curry)(((e,t,r,n)=>({type:xC.UPDATE_RELATION_RATING,payload:{id:e,connection:t,rating:r,user:n}}))),iA=(0,_.curry)(((e,t)=>({type:xC.OPEN_RELATION_EDITOR,payload:{id:e,connection:t}}))),oA=(0,_.curry)(((e,t)=>({type:xC.CLOSE_RELATION_EDITOR,payload:{id:e,relationUri:t}}))),lA=(0,_.curry)(((e,t,r)=>({type:xC.SET_RELATION_TYPE,payload:{id:e,relationUri:t,relationType:r}}))),sA=(0,_.curry)(((e,t,r)=>({type:xC.SET_RELATION_ENTITY,payload:{id:e,relationUri:t,entityInfo:r}}))),cA=(0,_.curry)(((e,t,r)=>({type:xC.SET_INITIAL_INFO,payload:{id:e,relationUri:t,tempEntity:r}})));function uA(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){pA(e,t,r[t])}))}return e}function pA(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const dA={},mA={removedUris:[],addedConnections:[],editedConnections:[],ignoredRelationData:[]},fA=(e,t,r)=>{if((0,_.pathEq)([...(0,S.getRelationToAddPath)(e),"relation","relationUri"],t,r))return(0,S.getRelationToAddPath)(e);{const n=((0,_.path)((0,S.getRelationsToEditPath)(e),r)||[]).findIndex((0,_.pathEq)(["relation","relationUri"],t));return n>=0?[...(0,S.getRelationsToEditPath)(e),n]:null}},yA=(e,t,r)=>{const n=fA(e,t,r);return n?(0,_.lensPath)([...n,"relation"]):null},gA=(0,_.pipe)(yA,(e=>(0,_.compose)(e,(0,_.lensProp)("object"))));let hA=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}({});qE(hA.TREE_LOADED),qE(hA.TREE_LOADED_WITH_ERROR),qE(hA.TREE_LOADING),qE(hA.TREE_SCROLL_TO_NODE_RESET);const EA=qE(hA.TREE_COMMANDS_CLEARED),bA=(qE(hA.TREE_CHILDREN_LOADING),qE(hA.TREE_CURRENT_ENTITY_SHOWN),qE(hA.TREE_REFRESHED),qE(hA.TREE_NODE_EXPANDED),qE(hA.TREE_RELATION_REMOVED),qE(hA.TREE_NODE_REMOVED),qE(hA.TREE_SECONDARY_LABEL_SHOWN),qE(hA.TREE_ENTITIES_MAPPING_LOADED),qE(hA.TREE_CHANGED)),vA=(qE(hA.TREE_NODE_EDITED),qE(hA.TREE_ACTIVENESS_DATE_CHANGED),qE(hA.TREE_RELATION_REPOINTED),qE(hA.TREE_RELATION_CREATED),qE(hA.TREE_NODE_CREATED),qE(hA.TREE_RELATION_EDITED),qE(hA.TREE_NODE_EDITED),qE(hA.TREE_NODE_EDITING_STARTED),qE(hA.TREE_NODE_EDITING_APPLIED),qE(hA.TREE_NODE_EDITING_CANCELED),qE(hA.TREE_NODE_NEW_PARENT_EDITING_STARTED),qE(hA.TREE_NODE_NEW_PARENT_EDITING_APPLIED),qE(hA.TREE_NODE_NEW_PARENT_EDITING_CANCELED),qE(hA.TREE_NODE_NEW_CHILD_EDITING_STARTED),qE(hA.TREE_NODE_NEW_CHILD_EDITING_APPLIED),qE(hA.TREE_NODE_NEW_CHILD_EDITING_CANCELED),qE(hA.TREE_NODE_RELATION_TYPE_CHANGED),qE(hA.TREE_NODE_ENTITY_CHANGED),qE(hA.TREE_SORTED),qE(hA.TREES_STATE_SAVED),qE(hA.TREES_STATE_RESTORED),qE(hA.TREE_CHILDREN_LOADED),qE(hA.TREES_RESTORE_FROM_INITIAL_TREES)),TA=qE(hA.TREES_RESET_INITIAL_TREES),OA=(qE(hA.TREE_CANCEL_CHILDREN_LOADING),(0,_.path)(["common","commands"]));var SA=r(76665);function xA(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){CA(e,t,r[t])}))}return e}function CA(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wA=(e,t,r=[])=>{if((0,_.path)(["entity","uri"],e)===t)return r.forEach((e=>e.expanded=!0)),e;if(e.children)for(const n of e.children){const a=wA(n,t,r.concat(e));if(a)return a}},AA=(e,t)=>{const r=Object.keys(e).reduce(((r,n)=>{const a=e[n];return t[n]&&(a.parent=(0,_.uniq)([].concat(a.parent).concat(t[n].parent).filter(_.identity))),r[n]=a,r}),{});return Object.keys(t).forEach((e=>{r[e]||(r[e]=t[e])})),r},RA=(e,t)=>{if(e&&e.children){const r=e.children.findIndex((({nodeId:e})=>e===t));r>-1&&e.children.splice(r,1)}},_A=(e,t,r=0)=>{e&&e.children&&e.children.splice(r,0,t)},IA=({path:e,value:t,object:r})=>{let n=r;for(let r=0;r<e.length;r++){const a=e[r];r===e.length-1?n[a]="function"==typeof t?t(n[a]):t:(n[a]=n[a]||("number"==typeof a?[]:{}),n=n[a])}},NA=(e={},t,r)=>{e[t]=r,e.children&&e.children.forEach((e=>NA(e,t,r)))},PA=e=>({entity:e.entity,relation:e.relation}),DA=({id:e,draft:t,node:r})=>{IA({path:["editingConnections",r.relation.uri],object:t[e],value:PA(r)})},kA=({id:e,draft:t,node:r,entity:n})=>{IA({path:["editingConnections",r.relation.uri,"entity"],object:t[e],value:n})},LA=({id:e,draft:t,relationUri:r})=>{delete t[e].editingConnections[r]},UA=({id:e,draft:t,relationUri:r})=>t[e].editingConnections[r],jA=e=>{delete e.editingMode,delete e.relatedEntity,delete e.initialConnection},FA=({id:e,draft:t,currentNode:r})=>{const n=t[e].root;if(n===r)t[e].root=r.children[0],t[e].root.children=t[e].root.children||[],t[e].root.children.push(...r.children.slice(1));else{const e=(0,S.findParentNodeById)(n,r.nodeId);RA(e,r.nodeId)}},MA=(e,t,r)=>{const n=[e,"editingConnections",t,"relation"];return(0,_.path)(n,r)?(0,_.lensPath)(n):null},VA=(0,_.pick)(["showSecondaryLabel","sortField","sortOrder"]),BA=e=>({entity:(0,_.pick)(["uri","type","label","secondaryLabel"],e.entity),parent:[],relations:[(0,_.pick)(["uri","type"],e.relation)]});function zA(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){HA(e,t,r[t])}))}return e}function HA(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const YA={common:{commands:[]},trees:{},initialTrees:{}};let WA=function(e){return e.ENTITY_RELATED_ATTRIBUTES_ADDED="ENTITY_RELATED_ATTRIBUTES_ADDED",e}({});qE(WA.ENTITY_RELATED_ATTRIBUTES_ADDED);const GA={},qA=e=>e.entity,ZA=e=>e.modifiedEntities,$A=e=>e.errors,KA=e=>e.relations,XA=e=>e.trees,QA=e=>e.lookups,JA=e=>e.dependentLookups,eR=e=>e.mode,tR=e=>e.lastLoadedTime,rR=e=>e.history,nR=e=>e.operation,aR=e=>e.views,iR=e=>e.sidePanelViews,oR=e=>e.hiddenAttributes,lR=e=>e.controlAttributes,sR=e=>nw(qA(e)),cR=e=>aw(qA(e)),uR=(e,t)=>((e,t)=>t&&e[t])(ZA(e),t),pR=(e,t)=>((e,t)=>t&&e[t]&&e[t].defaultProfilePic)(ZA(e),t),dR=e=>(0,_.keys)(KA(e)),mR=(e,t,r)=>RC(KA(e),t,r),fR=(e,t,r)=>_C(KA(e),t,r),yR=(e,t,r)=>((e,t,r)=>{const n=_C(e,t,r);return(0,S.getRelationObjectFromConnection)(n)})(KA(e),t,r),gR=(e,t,r)=>((e,t,r)=>{const n=(0,_.pipe)((0,_.pathOr)([],[t,"drafts","addedConnections"]),(0,_.filter)((0,_.pipe)(S.getRelationUriFromConnection,S.isTempUri)),(0,_.when)((0,_.always)(r),(0,_.filter)((0,_.propEq)("parentEntityUri",r))),_.length)(e);return((e,t,r)=>r?(0,_.pipe)((0,_.path)([t,"connections"]),(0,_.find)((({entity:e})=>e.entityUri===r)),(0,_.pathOr)(0,["total"]))(e):(0,_.pathOr)(0,[t,"total"],e))(e,t,r)+n})(KA(e),t,r),hR=(e,t)=>AC(KA(e),t),ER=(e,t)=>S.getDraftsForSaveByViewId(KA(e),t),bR=e=>(e=>(0,_.keys)(e).reduce(((t,r)=>{const{addedConnections:n,editedConnections:a}=(0,S.getDraftsForSaveByViewId)(e,r);return(0,_.pipe)(_.concat,(0,_.map)(S.getEntityUriFromConnection),(0,_.filter)(S.isTempUri),(0,_.concat)(t))(n,a)}),[]))(KA(e)),vR=e=>Lw(eR(e)),TR=e=>kw(eR(e)),OR=e=>Dw(eR(e)),SR=(e,t)=>S.getRelationToAddByViewId(KA(e),t),xR=(e,t)=>S.getRelationsToEditByViewId(KA(e),t),CR=(e,t)=>S.getAllRelationsToAddAndEdit(KA(e),t),wR=(e,t,r)=>S.getAllRelationsToSave(KA(e),t,r),AR=(e,t,r)=>S.getInitialConnectionTempEntity(e.relations,t,r),RR=(e,t,r)=>S.getInitialConnection(e.relations,t,r),_R=(e,t)=>((e,t)=>Object.keys(e).filter((r=>{const n=(0,S.getTempRelations)(e,r);return!!wC(n,t)})))(KA(e),t),IR=(e,t,r)=>((e,t,r)=>(0,_.pipe)((0,_.filter)((0,_.allPass)([(0,_.propEq)("parentUri",t),(0,_.propEq)("attributeTypeUri",r),(0,_.pipe)((0,_.prop)("uri"),_.isEmpty)])),(0,_.map)((0,_.prop)("message")),(0,_.join)(". "))(e))($A(e),t,r),NR=(e,t,r)=>((e,t,r)=>(0,_.filter)((0,_.allPass)([(0,_.propEq)("parentUri",t),(0,_.propEq)("attributeTypeUri",r),(0,_.pipe)((0,_.prop)("uri"),_.isEmpty,_.not)]))(e))($A(e),t,r),PR=(e,t,r)=>S.getCachedActiveErrorsForAttributesPager($A(e),t,r),DR=(e,t)=>((e,t)=>e.trees[t])(XA(e),t),kR=(e,t)=>((e,t)=>(0,_.path)(["trees",t,"root"],e))(XA(e),t),LR=(e,t)=>((e,t)=>(0,_.path)(["trees",t,"total"],e))(XA(e),t),UR=e=>OA(XA(e)),jR=(e,t,r)=>((e,t,r)=>(0,_.path)(["trees",t,"editingConnections",r],e))(XA(e),t,r),FR=(e,t)=>((e,t)=>(0,_.pipe)((0,_.prop)("trees"),(0,_.when)((0,_.always)(t),(0,_.pick)(t)),_.values,(0,_.map)((0,_.pipe)((0,_.prop)("editingConnections"),_.values)),_.flatten,(0,_.reject)(_.isNil))(e))(XA(e),t),MR=e=>(e=>e.structure)(JA(e)),VR=(e,t)=>S.getDependentLookupsStructureNode(JA(e),t),BR=e=>(e=>e.initedTypeUris)(JA(e)),zR=e=>(e=>e.editors)(JA(e)),HR=(e,t)=>S.getDependentLookupEditorState(JA(e),t),YR=e=>(e=>e.diff)(rR(e)),WR=e=>(e=>e.event)(rR(e)),GR=e=>(e=>e.slice)(rR(e)),qR=e=>(e=>!(0,S.isEmptyValue)(e.slice))(rR(e)),ZR=e=>(e=>e.mode)(rR(e)),$R=(e,t)=>((e,t)=>e[t])((e=>e.entityRelatedAttributes)(e),t),KR=(0,wc.createSelector)(qA,(e=>uR(e,sR(e))),((e,t)=>!(!e||!t||(0,S.isEmptyValue)((0,S.collectAllDiffs)(e,t,!0))))),XR=(0,wc.createSelector)(XA,(e=>{const t=OA(e),r=(0,S.getNotAppliedTreeCommands)((0,_.reject)((0,_.propSatisfies)(S.isEmptyValue,"root"),e.trees));return!(0,S.isEmptyValue)(t)||!(0,S.isEmptyValue)(r)})),QR=(0,wc.createSelector)(KA,(e=>(0,_.keys)(e).reduce(((t,r)=>t||!(0,_.all)(S.isEmptyValue)((0,_.values)(S.getDraftsForSaveByViewId(e,r)))),!1))),JR=(0,wc.createSelector)(KR,QR,XR,((e,t,r)=>e||t||r)),e_=(0,wc.createSelector)(eR,qA,JR,((e,t)=>t),((e,t,r,n)=>!(e===S.Mode.Viewing||!t)&&((0,S.isTempUri)(t.uri)&&!n||r)));let t_=function(e){return e.PROFILE_OPERATION_UPDATE="PROFILE_OPERATION_UPDATE",e}({});const r_=qE(t_.PROFILE_OPERATION_UPDATE),n_=({metadata:e,modifiedEntities:t,connections:r=[],errors:n})=>n.filter((({attributeType:e,type:t})=>e&&!(0,S.isRequired)(e)&&t===S.ErrorType.missed)).filter((({attributeType:n,parentUri:a})=>{const i=(0,S.getBaseUri)(a),o=(0,S.isEntityUri)(a)?t[i]:(0,S.findConnectionRelationObjectByRelationUri)(r,i),l=o&&(0,S.findAttributeValuesByTypeUri)(e,o,n.uri,!0);return null==l?void 0:l.some((({parent:e,attrValues:t})=>e.uri===a&&0===t.length))})).map((({attributeType:e,parentUri:t})=>({attributeType:e,parentUri:t}))),a_=e=>(0,S.getProfileViewsIdsByTypes)(e,[S.ProfileViewType.Relations,S.ProfileViewType.RelationsTable]);function i_(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){o_(e,t,r[t])}))}return e}function o_(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*l_(){const e=yield(0,La.Ys)(iI.selectors.getEntity),t=yield(0,La.Ys)(iI.selectors.getMode),r=yield(0,La.Ys)(iI.selectors.getEntityUri),n=yield(0,La.Ys)(iI.selectors.getMetadata),a=yield(0,La.Ys)(iI.selectors.getModifiedEntity,r),i=yield(0,La.Ys)(iI.selectors.getModifiedEntities),o=yield(0,La.Ys)(iI.selectors.getProfileViews);return{entity:e,modifiedEntity:t===S.Mode.Viewing?e:a,entityUri:r,metadata:n,modifiedEntities:t===S.Mode.Viewing?{[r]:e}:i,profileViews:o,mode:t}}function*s_(){return i_({},yield(0,La.RE)(l_),{validationServicePath:yield(0,La.Ys)(iI.selectors.getValidationServicePath),tenant:yield(0,La.Ys)(iI.selectors.getTenant),severity:yield(0,La.Ys)(iI.selectors.getValidationServiceSeverityLevels)})}function*c_(){const{entityUri:e,metadata:t,modifiedEntities:r,modifiedEntity:n,profileViews:a}=yield(0,La.RE)(l_);if(!e)return[];const i=a_(a),o=(0,S.getProfileViewsIdsByTypes)(a,[S.ProfileViewType.HierarchyTree]),l=yield(0,La.Ys)(PS,i,!0),s=yield(0,La.Ys)(iI.selectors.getRelations),c=yield(0,La.Ys)(iI.selectors.getAllTreesEditingConnections,o);return[...(0,S.validateEntityLocally)(t,r,n,(0,S.isAvailableAttributeTypeForProfile)(a)),...l.flatMap((e=>(0,S.validateConnection)(t,r,e))),...c.flatMap((e=>(0,S.validateHierarchyConnection)(t,e)))].map((n=>i_({},n,{path:(0,S.evaluateErrorPath)({entityUri:e,metadata:t,connections:l,entitiesMap:r,relationsState:s,relationViewsIds:i},n.uri||n.parentUri)})))}function*u_(){const{entityUri:e,metadata:t,modifiedEntity:r,mode:n,validationServicePath:a}=yield(0,La.RE)(s_);if(a&&e&&(0,S.shouldUseValidationService)(t,null==r?void 0:r.type)){const r=yield(0,La.RE)((0,S.isTempUri)(e)?d_:m_),{modifiedEntities:a}=yield(0,La.RE)(l_),i=(0,_.pipe)(S.convertValidationServiceErrors,(0,_.uniqBy)(S.getErrorUniqKey))(r,{entityUri:e,metadata:t,entitiesMap:a});if(n!==S.Mode.Viewing){const e=n_({metadata:t,modifiedEntities:a,errors:i});e.length&&(yield(0,La.gz)(ab(e)))}return i}return[]}function p_(e){return console.warn("Validation service error",e),[]}function*d_(){const{mode:e,modifiedEntity:t,modifiedEntities:r,validationServicePath:n,tenant:a,severity:i}=yield(0,La.RE)(s_),o=(0,S.prepareEntityForValidation)(t,r);try{return yield(0,La.RE)(S.validateEntity,{validationServicePath:n,entity:o,tenant:a,severity:i,options:(0,_.reject)(_.isNil,[S.ValidationServiceOption.preserveURIs,e===S.Mode.Editing?S.ValidationServiceOption.validateDataPermissions:null])})}catch(e){return p_(e)}}function*m_(){var e;const{entityUri:t,mode:r,entity:n,modifiedEntity:a,modifiedEntities:i,validationServicePath:o,metadata:l,tenant:s,severity:c}=yield(0,La.RE)(s_),u=yield(0,La.Ys)(iI.selectors.getValidateReferenceEntityInReadMode),p=(0,S.getEntityType)(l,n.type),d=null===(e=null==p?void 0:p.forceOvForUiUpdates)||void 0===e||e,m=r===S.Mode.Viewing?[]:(0,S.collectDiffForValidation)(n,a,i,d);try{return yield(0,La.RE)(S.validateEntityChanges,{validationServicePath:o,uri:t,diff:m,tenant:s,severity:c,options:(0,_.reject)(_.isNil,[S.ValidationServiceOption.preserveURIs,S.ValidationServiceOption.updateAttributeUpdateDates,r===S.Mode.Editing?S.ValidationServiceOption.validateDataPermissions:null,r===S.Mode.Viewing&&u?S.ValidationServiceOption.validateReferenceEntityAttribute:null])})}catch(e){return p_(e)}}function*f_(){const{entityUri:e,metadata:t,mode:r,modifiedEntity:n,modifiedEntities:a,validationServicePath:i,tenant:o,severity:l,profileViews:s}=yield(0,La.RE)(s_),c=yield(0,La.Ys)(iI.selectors.getValidateRelations);if(i&&c){const c=a_(s),u=(yield(0,La.Ys)(PS,c)).filter((e=>(0,S.shouldUseValidationService)(t,e.relation.relationType)));if(u.length>0){let s=[];const p=(0,S.prepareConnectionsForValidation)(u,n,a,t);try{const e=yield(0,La.RE)(S.validateRelations,{validationServicePath:i,body:p,tenant:o,severity:l,options:(0,_.reject)(_.isNil,[S.ValidationServiceOption.preserveURIs,r===S.Mode.Editing?S.ValidationServiceOption.validateDataPermissions:null])});s=Object.values(e.validated).flat()}catch(e){return p_(e)}const d=yield(0,La.Ys)(iI.selectors.getModifiedEntities),m=yield(0,La.Ys)(iI.selectors.getRelations),f=(0,_.pipe)(S.convertValidationServiceErrors,(0,_.uniqBy)(S.getErrorUniqKey))(s,{entityUri:e,metadata:t,entitiesMap:d,connections:u,relationsState:m,relationViewsIds:c}),y=n_({metadata:t,modifiedEntities:d,connections:u,errors:f});return y.length&&(yield(0,La.gz)(ab(y))),f}}return[]}function*y_(){const e=yield(0,La.RE)(c_),[t,r]=yield(0,La.$6)([(0,La.RE)(u_),(0,La.RE)(f_)]),n=(0,_.uniqBy)(S.getErrorUniqKey,[...e,...t,...r]),a=yield(0,La.Ys)(iI.selectors.getEntityUri),i=yield(0,La.Ys)(iI.selectors.getHiddenAttributes),o=(null==i?void 0:i[a])||[],l=(0,S.filterErrorsForHiddenAttributes)(n,o);return yield(0,La.gz)(cw(n)),0===l.filter(S.isCriticalError).length}let g_=function(e){return e.PROFILE_VIEWS_SET="PROFILE_VIEWS_SET",e}({});const h_=qE(g_.PROFILE_VIEWS_SET);function E_(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){b_(e,t,r[t])}))}return e}function b_(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(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,La.Ys)(iI.selectors.getMetadata),r=yield(0,La.Ys)(iI.selectors.getMode);switch(e.type){case xC.OPEN_RELATION_EDITOR:{const{id:n,connection:a}=e.payload;a.relation.relationType&&(yield(0,La.gz)(ib({viewId:n,metadata:t,mode:r,parentUri:a.relation.object.uri})));break}case nb.ADD_ATTRIBUTES:{const n=e.payload;for(const e of n){const{attributeType:n,parentUri:a,viewId:i}=e;(0,S.isComplexAttribute)(n)&&(yield(0,La.gz)(ib({viewId:i,attributeType:n,parentUri:a,metadata:t,mode:r})))}break}case xC.SET_RELATION_TYPE:{const{id:n,relationUri:a}=e.payload;yield(0,La.gz)(ib({viewId:n,metadata:t,mode:r,parentUri:a}));break}case hA.TREE_NODE_RELATION_TYPE_CHANGED:{var n;const{id:a,node:i}=e.payload;yield(0,La.gz)(ib({viewId:a,metadata:t,mode:r,parentUri:null==i||null===(n=i.relation)||void 0===n?void 0:n.uri}));break}}}function*T_(e,t=null){const r=yield(0,La.Ys)(MS),n=(0,S.getNotAppliedTreeCommands)(null==r?void 0:r.trees),a=yield(0,La.Ys)(HS),i=(0,S.optimizeCommands)([...a,...n]);if(null!=i&&i.length){const r=(0,_.when)((0,_.always)(t),(0,S.replaceTempUriInCommands)(t))(i);yield(0,La.RE)(e,r),yield(0,La.gz)(EA())}}function*O_(e){var t;const r=yield(0,La.Ys)(mO),n=yield(0,La.Ys)(fO),a=yield(0,La.Ys)(NO,n),i=yield(0,La.Ys)(oO),o=(0,S.getEntityType)(i,r.type),l=null===(t=null==o?void 0:o.forceOvForUiUpdates)||void 0===t||t,s=(0,S.collectAllDiffs)(r,a,l);return(0,S.prepareAttrDiff)(e,s)}function*S_(e){const t=yield(0,La.Ys)(TO),r=yield(0,La.Ys)(DO),n=yield(0,La.Ys)(fO),a=yield(0,La.Ys)(NO,n),i=(0,S.findAllTemporaryRefEntityURI)(a),o=(0,_.concat)(i,t);return yield(0,La.RE)(S.saveTemporaryEntities,r,o,e)}function*x_(e,t,r){const n=e.getDCRObjectUris(),a=yield(0,La.Ys)(rx),i=yield(0,La.Ys)(ax),o=yield(0,La.Ys)(KS);if(null!=n&&n.length){const l=yield(0,La.RE)(S.startProcessInstance,{workflowPath:a,processType:t?"authoring":"dataChangeRequestReview",objectURIs:(0,_.uniq)([r,...n,e.getDCRUri()]).filter((0,_.complement)(_.isNil)),tenant:o,environment:i});"OK"!==(null==l?void 0:l.status)&&console.warn(l)}}function*C_(e,t,r,n){const a=yield(0,La.Ys)(vO,r),i=yield(0,La.Ys)(iI.selectors.getUserName),o=(0,S.createRelationsCommandsFromConnections)(a,n,t,i);o.length&&(yield(0,La.RE)(e,o))}function*w_(e,t,r){const n=yield(0,La.Ys)(CO),a=yield(0,La.Ys)(fO);for(const i of n)yield(0,La.rM)(C_,e,r||a,i,t)}function*A_(e){if(!e.hasNewUri())return;const t=yield(0,La.Ys)(MS);for(const[r,n]of Object.entries(t.trees))if(n.root){const t=t=>(0,_.when)((0,_.prop)("uri"),(0,_.assoc)("uri",e.getUri(null==t?void 0:t.uri)))(t),a=(0,S.mapTree)(n.root,{nodeProcessing:e=>(0,_.pipe)((e=>E_({},e)),(0,_.unless)((0,_.has)("editingMode"),(0,_.evolve)({relation:t,relations:(0,_.map)(t)})))(e)});(0,_.equals)(n.root,a)||(yield(0,La.gz)(bA({id:r,tree:a})))}}function*R_(){try{var e;const t=yield(0,La.Ys)(AS),{commandExecutor:r,dcrProcessor:n,relationUriProcessor:a}=(0,S.createCommandExecutor)({alwaysCreateDCR:t,dcrUri:null}),i=yield(0,La.RE)(S_,n);yield(0,La.$6)([(0,La.RE)(T_,r),(0,La.RE)(w_,r,i)]),yield(0,La.RE)(A_,a);const o=yield(0,La.RE)(O_,i),l=yield(0,La.Ys)(fO),s=yield(0,La.Ys)(iI.selectors.getMetadata),c=(0,S.hasAttributeMasking)(s);let u;if(null!=o&&o.length&&(u=yield(0,La.RE)(S.entityCumulativeUpdate,{uri:l,diff:o,uriPreprocessor:n.enhanceUriWithDCR,sendMasked:c})),t||(0,S.isChangeRequestUri)(null===(e=u)||void 0===e?void 0:e.uri))u&&n.updateDCRUriFromResponse(u),yield(0,La.RE)(x_,n,!1,l),yield(0,La.gz)(vA()),c&&(yield(0,La.RE)(j_,!0)),window.alert(li().text("Your changes are saved as pending and have been sent for review"));else if(u){yield(0,La.gz)(qC(u));const{trees:e}=yield(0,La.Ys)(iI.selectors.getTrees),t=(0,S.updateTreesWithNewEntity)((0,_.pick)(["uri","label","secondaryLabel","type"],u),e);for(const e of t)yield(0,La.gz)(bA({id:e.id,tree:e.root}))}else!u&&c&&(yield(0,La.RE)(j_,!0));yield(0,La.gz)(Iw(S.Mode.Viewing)),yield(0,La.gz)(fb())}catch(e){yield(0,La.gz)(Nv((0,S.getRequestErrorMessage)(e,li().text("Something went wrong"))))}}function*__(){yield(0,La.qn)(GC.ENTITY_LOADED),yield(0,La.gz)(fb())}function*I_(e,t){const r=yield(0,La.Ys)(fO),n=yield(0,La.Ys)(iI.selectors.getModifiedEntity,r),{commandExecutor:a,dcrProcessor:i}=(0,S.createCommandExecutor)({alwaysCreateDCR:t,dcrUri:e}),o=yield(0,La.RE)(S_,i),l=yield(0,La.RE)(S.saveTemporaryEntity,n,o,i);return yield(0,La.$6)([(0,La.RE)(T_,a,{[r]:l}),(0,La.RE)(w_,a,o,l)]),{savedEntityUri:l,dcrProcessor:i}}function*N_(){const e=yield(0,La.Ys)(fO),t=yield(0,La.Ys)(iI.selectors.getModifiedEntity,e);if((0,S.isEmptyEntity)(t)){const e=(0,Ge.x0)();return yield(0,La.gz)(ov({id:e,text:li().text("Please fill out some fields."),actions:[]})),!1}return!0}function*P_(){try{const e=yield(0,La.Ys)(AS);if(!(yield(0,La.RE)(N_)))return;const{dcrProcessor:t,savedEntityUri:r}=yield(0,La.RE)(I_,null,e);e&&(yield(0,La.RE)(x_,t),window.alert(li().text("Your changes are saved as pending and have been sent for review"))),yield(0,La.gz)(Iw(S.Mode.Viewing)),e?(yield(0,La.gz)(iv()),yield(0,La.gz)(rw())):(yield(0,La.gz)(rv({uri:r})),yield(0,La.rM)(__))}catch(e){yield(0,La.gz)(Nv((0,S.getRequestErrorMessage)(e,li().text("Something went wrong"))))}}function*D_(e){const t=yield(0,La.RE)(S.getDataChangeRequest,e),r=(0,_.pipe)((0,_.prop)("changes"),_.values,_.flatten,(0,_.pluck)("id"))(t);try{yield(0,La.$6)(r.map((t=>(0,La.RE)(S.deleteChangeRequestItem,{dcrUri:e,changeItemId:t}))))}catch(e){yield(0,La.gz)(Nv((0,S.getRequestErrorMessage)(e,li().text("Something went wrong"))))}}function*k_(e){const{dcrUri:t,action:r,taskId:n}=e.payload;try{if(!(yield(0,La.RE)(N_)))return;if(yield(0,La.gz)(r_(S.Operation.Saving)),yield(0,La.RE)(D_,t),yield(0,La.RE)(I_,t,!0),"Approve"!==r||(yield(0,La.RE)(y_))){const e=yield(0,La.Ys)(rx),t=yield(0,La.Ys)(ax),a=yield(0,La.Ys)(KS);yield(0,La.RE)(S.runTaskAction,{workflowPath:e,environment:t,tenant:a,taskId:n,action:r}),yield(0,La.gz)(JC())}}catch(e){const t=null==e?void 0:e.error;if((null==t?void 0:t.errorCode)===S.ApiErrorCode.WORKFLOW_IS_NOT_REGISTERED_ERROR)return;yield(0,La.gz)(Nv((0,S.getRequestErrorMessage)(t||e,li().text("Something went wrong"))))}yield(0,La.gz)(r_(null))}function*L_(e){const{dcrUri:t,userAction:r}=e.payload,n=yield(0,La.Ys)(xS);try{if(!(yield(0,La.RE)(N_)))return;yield(0,La.gz)(Iw("saveDraft"===r?S.Mode.Suggesting:S.Mode.Editing,!0)),yield(0,La.gz)(r_(S.Operation.Saving));const e=yield(0,La.RE)(y_);if("saveDraft"===r){if(t)yield(0,La.RE)(D_,t),yield(0,La.RE)(I_,t,!0);else{const{dcrProcessor:e}=yield(0,La.RE)(I_,null,!0);yield(0,La.RE)(x_,e,!0);const t=e.getDCRUri();yield(0,La.gz)(Rv({url:"../authoring",searchParams:{entityUri:`${t}`},options:{replace:!0,state:{keepErrors:!0}}}))}window.alert(li().text("Your changes are saved as pending and have been sent for review"))}else if(e){const{savedEntityUri:e}=yield(0,La.RE)(I_,null,!1);yield(0,La.gz)(Iw(S.Mode.Viewing)),yield(0,La.gz)(rv({uri:e})),yield(0,La.rM)(__)}else e||(yield(0,La.gz)(Iw(n,!0)))}catch(e){yield(0,La.gz)(Iw(n,!0)),yield(0,La.gz)(Nv((0,S.getRequestErrorMessage)(e,li().text("Something went wrong"))))}yield(0,La.gz)(r_(null))}function*U_(){if(yield(0,La.gz)(r_(S.Operation.Saving)),yield(0,La.RE)(y_)){const e=yield(0,La.Ys)(fO);(0,S.isTempUri)(e)?yield(0,La.RE)(P_):yield(0,La.RE)(R_)}yield(0,La.gz)(r_(null))}function*j_(e){try{let t;if(e){const e=yield(0,La.Ys)(iI.selectors.getMetadata);t=(0,S.addMetadataSpecificGetEntityOptions)(e)}yield(0,La.gz)(r_(S.Operation.Fetching));const r=yield(0,La.Ys)(fO),n=yield(0,La.RE)(S.getEntity,r,t);if(!n)throw new Error("Failed to request entity");return yield(0,La.gz)(qC(n,!0)),n}catch(e){throw yield(0,La.gz)(Nv((0,S.getRequestErrorMessage)(e,li().text("Something went wrong")))),e}finally{yield(0,La.gz)(r_(null))}}function*F_(e){const{mode:t,silent:r}=e.payload;r||(yield M_({mode:t}))}function*M_({mode:e,overwrite:t=!1}){const r=yield(0,La.Ys)(iI.selectors.getEntity),n=yield(0,La.Ys)(iI.selectors.getMetadata),a=yield(0,La.Ys)(iI.selectors.getModifiedEntity,null==r?void 0:r.uri);if((t||!a)&&e!==S.Mode.Viewing&&r&&n){const t=yield(0,La.Ys)(iI.selectors.getProfileViews),a=yield(0,La.Ys)(iI.selectors.getUIConfig),i=yield(0,La.Ys)(iI.selectors.getUserRoles),o=(0,S.addToEntityRequiredAttributes)({entity:r,metadata:n,mode:e,attrTypeFilter:(0,_.both)((0,S.isAvailableAttributeTypeForProfile)(t||[]),(0,S.getProfileAttributeConfigPermissionsChecker)(a,r.type,i,[S.ConfigPermissions.READ,S.ConfigPermissions.CREATE]))});yield(0,La.gz)(jw(o));const l=yield(0,La.Ys)(iI.selectors.getModifiedEntities),s=yield(0,La.Ys)(iI.selectors.getProfileErrors),c=n_({metadata:n,modifiedEntities:l,errors:s});c.length&&(yield(0,La.gz)(ab(c)))}}function*V_(e){const{entity:t,silent:r}=e.payload,n=yield(0,La.Ys)(iI.selectors.getMode);r||(0,S.isTempUri)(t.uri)||(yield M_({mode:n,overwrite:!0}))}function*B_(e){const{entityTypeUri:t}=e.payload,r=yield(0,La.Ys)(iI.selectors.getMetadata),n=(0,S.getEntityType)(r,t),a=yield(0,La.Ys)(iI.selectors.getUIConfig),i=yield(0,La.Ys)(iI.selectors.getUserRoles),o=(0,S.getProfileAttributeConfigPermissionsChecker)(a,t,i,[S.ConfigPermissions.READ,S.ConfigPermissions.CREATE]),l=((null==n?void 0:n.attributes)||[]).filter((e=>o(e))),s=(0,S.checkMetadataForCreate)(S.Mode.Editing,n)?S.Mode.Editing:S.Mode.Suggesting,c=(0,S.createTemporaryEntity)({entityTypeUri:t,attributeTypes:l,metadata:r,mode:s});yield(0,La.gz)(nv({entity:c})),yield(0,La.gz)(qC(c)),yield(0,La.gz)(Iw(S.Mode.Viewing)),yield(0,La.gw)(0),(yield(0,La.Ys)(iI.selectors.getProfileViews))||(yield(0,La.qn)(g_.PROFILE_VIEWS_SET)),yield(0,La.gz)(Iw(s)),yield(0,La.gz)(TA())}function*z_(e){const t=yield(0,La.Ys)(iI.selectors.getMetadata),r=yield(0,La.Ys)(iI.selectors.getAuthoringByEntityType,e),n=(0,S.getPreparedAuthoringItems)(t,r,e).map((({views:e})=>e)).flat();yield(0,La.gz)(h_(n))}function*H_(e){const{entityTypeUri:t}=e.payload,r=yield(0,La.Ys)(iI.selectors.getMetadata),n=(0,S.getEntityType)(r,t),a=(0,_.prop)("attributes",n),i=(yield(0,La.Ys)(iI.selectors.getCanSuggestAuthoring,n))?S.Mode.Suggesting:S.Mode.Editing,o=(0,S.createTemporaryEntity)({entityTypeUri:t,attributeTypes:a,metadata:r,mode:i});yield(0,La.gz)(wv({entity:o})),yield(0,La.gz)(qC(o)),yield(0,La.RE)(z_,o.type),yield(0,La.gz)(Iw(i))}function*Y_(e){const{mainEntityUri:t,tempEntities:r,keepErrors:n}=e.payload,[[a],i]=(0,_.partition)((0,_.propEq)("uri",t),r);yield(0,La.gz)(qC(a,n)),yield(0,La.RE)(z_,a.type),yield(0,La.gz)(Iw(S.Mode.Suggesting));for(const e of i)yield(0,La.gz)(jw(e))}function*W_(e){const{payload:{entityUri:t,data:r}}=e;yield(0,La.gz)(r_(S.Operation.Cloning));try{const e=yield(0,La.RE)(S.cloneEntity,t,r);yield(0,La.gz)(nv({entity:e})),yield(0,La.gz)(qC(e)),yield(0,La.gz)(Iw(S.Mode.Editing)),yield(0,La.gz)(TA());const n=(0,Ge.x0)(),a=yield(0,La.Ys)(iI.selectors.getMetadata),i=(0,S.getEntityType)(a,e.type),o=(0,S.checkMetadataForDelete)(S.Mode.Editing,i);yield(0,La.gz)(ov({id:n,type:"cloneAction",autoHideDuration:1e4,text:li().text("Profile is cloned successfully. You can modify the attributes if required."),actions:o?[{label:li().text("Undo"),needConfirmation:!0,confirmationText:li().text("Are you sure you want to undo the cloning process?"),confirmationDescription:li().text("Undoing the cloning process will delete the cloned profile. Are you sure you want to proceed?"),applyAction:ew({entityUri:e.uri}),cancelAction:lv(n)}]:[]}))}catch(e){yield(0,La.gz)(Nv((0,S.getRequestErrorMessage)(e,li().text("Something went wrong"))))}yield(0,La.gz)(r_(null))}function*G_(e){const{entityUri:t}=e.payload;if(!(0,S.isTempUri)(t))try{yield(0,La.RE)(S.removeEntity,t),yield(0,La.gz)(av())}catch(e){yield(0,La.gz)(Nv((0,S.getRequestErrorMessage)(e,li().text("Something went wrong"))))}}function*q_(e){const t=e.payload;try{if((yield(0,La.Ys)($S))&&!confirm(li().text("Are you sure you want to cancel changes for this Profile?")))return;const e=yield(0,La.Ys)(xS),r=yield(0,La.Ys)(iI.selectors.getMetadata),n=yield(0,La.Ys)(fO),a=(0,S.hasAttributeMasking)(r),i=(0,S.isTempUri)(n),o=(0,S.isViewMode)(t),l=(0,S.isEditableMode)(e)&&(0,S.isViewMode)(t),s=(0,S.isViewMode)(e)&&(0,S.isEditableMode)(t);n&&(l||s)&&a&&!i&&(yield(0,La.RE)(j_,o)),yield(0,La.gz)(Iw(t)),l&&(yield(0,La.gz)(Pw()))}catch{}}const Z_=[function*(){yield(0,La.A7)([Tb.MODE_UPDATE_REQUESTED],q_)},function*(){yield(0,La.A7)([nb.RUN_AUTHORING_TASK_ACTION],k_)},function*(){yield(0,La.ib)([xC.OPEN_RELATION_EDITOR,nb.ADD_ATTRIBUTES,xC.SET_RELATION_TYPE,hA.TREE_NODE_RELATION_TYPE_CHANGED],v_)},function*(){yield(0,La.A7)([nb.SAVE_PROFILE],U_)},function*(){yield(0,La.ib)([Tb.MODE_UPDATED],F_)},function*(){yield(0,La.ib)([GC.ENTITY_CREATION_REQUESTED],B_)},function*(){yield(0,La.Fm)([nb.VALIDATE_PROFILE],y_)},function*(){yield(0,La.ib)([GC.ENTITY_REMOVE_REQUESTED],G_)},function*(){yield(0,La.ib)([GC.CLONE_ENTITY],W_)},function*(){yield(0,La.ib)([GC.ENTITY_CREATION_WITH_AUTHORING_REQUESTED],H_)},function*(){yield(0,La.ib)([GC.ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED],Y_)},function*(){yield(0,La.A7)([nb.SAVE_DRAFT],L_)},function*(){yield(0,La.ib)([GC.ENTITY_LOADED],V_)}];let $_=function(e){return e.SIDE_PANEL_VIEWS_LOADED="SIDE_PANEL_VIEWS_LOADED",e}({});qE($_.SIDE_PANEL_VIEWS_LOADED);const K_=[];let X_=function(e){return e.HIDDEN_ATTRIBUTES_UPDATED="HIDDEN_ATTRIBUTES_UPDATED",e.HIDDEN_ATTRIBUTES_RESET="HIDDEN_ATTRIBUTES_RESET",e}({});const Q_=qE(X_.HIDDEN_ATTRIBUTES_UPDATED),J_=qE(X_.HIDDEN_ATTRIBUTES_RESET),eI={};let tI=function(e){return e.CONTROL_ATTRIBUTES_UPDATED="CONTROL_ATTRIBUTES_UPDATED",e}({});const rI=qE(tI.CONTROL_ATTRIBUTES_UPDATED),nI=[],aI=(0,R.combineReducers)({dependentLookups:(e=xb,t)=>{switch(t.type){case Tb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,S.isViewMode)(r)&&!n?xb:e}case gb.DEPENDENT_LOOKUPS_STRUCTURE_SET:return Ob({},e,{structure:t.payload});case gb.DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED:{const r=t.payload;return Ob({},e,{initedTypeUris:(0,_.uniq)(e.initedTypeUris.concat(r))})}case gb.DEPENDENT_LOOKUPS_EDITORS_BLOCKED:{const{uris:r,isBlocked:n}=t.payload,a=e.editors,i=r.reduce(((e,t)=>Ob({},e,{[t]:Ob({},e[t],{isBlocked:n})})),a);return Ob({},e,{editors:i})}case gb.DEPENDENT_LOOKUPS_EDITOR_TOUCHED:{const{uri:r,isTouched:n}=t.payload;return(0,_.assocPath)(["editors",r,"isTouched"],n,e)}default:return e}},entity:(e=ow,t)=>{switch(t.type){case GC.ENTITY_LOADED:return t.payload.entity;case GC.DEFAULT_PROFILE_PIC_SET:return"object"==typeof t.payload&&null!==t.payload?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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){iw(e,t,r[t])}))}return e}({},e,{defaultProfilePic:t.payload.uri,defaultProfilePicValue:t.payload}):e;case nb.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:i}=t.payload,o=(0,S.getAttributeSource)(a);if(r===e.uri){const t=(0,_.lensPath)([o,n]);return(0,_.over)(t,(0,_.pipe)((0,_.defaultTo)([]),(0,_.concat)(_.__,i)),e)}return e}case GC.CLEAR_ENTITY:return ow;default:return e}},errors:(e=pw,t)=>{switch(t.type){case lw.ERRORS_SET:return t.payload;case lw.ERROR_DEACTIVATED:{const r=t.payload,n=e.findIndex((e=>(0,S.getErrorId)(e)===r)),a=(0,_.lensPath)([n]);return(0,_.over)(a,(0,_.assoc)("deactivated",!0),e)}case nb.REMOVE_ATTRIBUTE:{const{uri:r}=t.payload;return e.map((e=>e.uri===r||(0,S.areOneHierarchyUris)(e.parentUri,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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){uw(e,t,r[t])}))}return e}({},e,{deactivated:!0}):e))}case Tb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,S.isViewMode)(r)&&!n?pw:e}case GC.ENTITY_LOADED:{const{silent:r}=t.payload;return r?e:pw}default:return e}},history:(e=Tw,t)=>{switch(t.type){case dw.HISTORY_DIFF_SET:return bw({},e,{diff:t.payload});case dw.HISTORY_DIFF_CLEARED:return bw({},e,{diff:Tw.diff});case dw.HISTORY_EVENT_SET:return bw({},e,{event:t.payload});case XE.NEW_ENTITY_SHOWN:case XE.OPEN_ENTITY:case dw.HISTORY_EVENT_CLEARED:return bw({},Tw,{mode:e.mode});case dw.HISTORY_SLICE_SET:return bw({},e,{slice:t.payload});case dw.HISTORY_MODE_SET:return bw({},e,{mode:t.payload});default:return e}},lastLoadedTime:(e=null,t)=>{switch(t.type){case Ow.PROFILE_LAST_LOADED_TIME_UPDATE:case GC.ENTITY_LOADED:return Date.now();default:return e}},lookups:(e=_w,t)=>{switch(t.type){case Sw.LOOKUPS_LOADED:return t.payload;case Sw.LOOKUPS_FOR_TYPE_RESOLVED:{const{type:r,values:n}=t.payload;return Aw({},e,{[r]:Aw({},e[r],n)})}case Sw.LOOKUPS_LIST_RESOLVED:return t.payload.reduce(((e,t)=>Object.keys(t).reduce(((e,r)=>Aw({},e,{[r]:Aw({},e[r],t[r])})),e)),e);case"UI_RESET":return Aw({},_w);default:return e}},mode:(e=Uw,t)=>t.type===Tb.MODE_UPDATED?t.payload.mode:e,modifiedEntities:(e=Yw,t)=>{switch(t.type){case SC.MODIFIED_ENTITY_CREATED:{const r=t.payload;return zw({},e,{[r.uri]:r})}case SC.MODIFIED_ENTITY_DELETED:{const r=t.payload;return(0,_.omit)([r],e)}case SC.MODIFIED_ENTITIES_RESET:return Yw;case Tb.MODE_UPDATED:{const{silent:r}=t.payload;return r?e:Yw}case SC.MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET:{const{entityUri:r,value:n}=t.payload;return r?zw({},e,{[r]:zw({},e[r],{defaultProfilePic:n.uri,defaultProfilePicValue:n})}):e}case nb.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t,i=(0,S.getBaseUri)(n);if((0,S.isEntityUri)(i)){const t=e[i];return e[i]||console.error(`ADD_ATTRIBUTES. parentUri - ${n}, state: ${JSON.stringify(e)}`),(0,S.isEntitySpecialAttrType)(r)?zw({},e,{[i]:(0,S.addEntitySpecialAttribute)({entity:t,attributeType:r})}):zw({},e,{[i]:(0,S.addAttribute)({entity:t,attributeType:r,parentUri:n,index:a})})}return e}),e);case nb.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:i}=t.payload,o=(0,S.getAttributeSource)(a);if((0,S.isEntityUri)(r)&&r in e){const t=(0,_.lensPath)([r,o,n]);return(0,_.over)(t,(0,_.pipe)((0,_.defaultTo)([]),(0,_.concat)(_.__,i)),e)}return e}case nb.MODIFY_ATTRIBUTE:{const{attributeType:r,uri:n,value:a}=t.payload,i=(0,S.getBaseUri)(n);if((0,S.isEntityUri)(i)){const t=e[i];return e[i]&&e[i].attributes||console.error(`MODIFY_ATTRIBUTE. uri - ${n}, state: ${JSON.stringify(e)}`),(0,S.isEntitySpecialAttrType)(r)?zw({},e,{[i]:(0,S.editEntitySpecialAttribute)({entity:t,attributeType:r,value:a})}):zw({},e,{[i]:(0,S.editAttribute)({entity:t,attributeType:r,uri:n,value:a})})}return e}case nb.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n}=t.payload,a=(0,S.getBaseUri)(n);if((0,S.isEntityUri)(n)){const t=e[a];return e[a]||console.error(`REMOVE_ATTRIBUTE. uri - ${n}, state: ${JSON.stringify(e)}`),(0,S.isEntitySpecialAttrType)(r)?zw({},e,{[a]:(0,S.removeEntitySpecialAttribute)({entity:t,attributeType:r})}):zw({},e,{[a]:(0,S.removeAttribute)({entity:t,attributeType:r,uri:n})})}return e}case nb.ADD_DEFAULT_VALUES:{const{attributeType:r,parentUri:n,metadata:a,mode:i}=t.payload,o=(0,S.getBaseUri)(n);if((0,S.isEntityUri)(o)){const t=(0,S.getEditableAttributeTypeSubAttributes)(a,r);return(0,_.over)((0,_.lensProp)(o),(0,S.addDefaultValuesToComplexAttribute)({attributeType:r,subAttributes:t,metadata:a,mode:i,parentUri:n}),e)}return e}default:return e}},relations:(e=dA,t)=>{switch(t.type){case GC.ENTITY_LOADED:{const{silent:r}=t.payload;return r?e:dA}case xC.RELATIONS_LOADED:{const{id:r,connections:n=[],total:a,mode:i}=t.payload;return(0,_.pipe)((0,_.assocPath)([r,"connections"],n),(0,_.assocPath)([r,"total"],a),(0,_.when)((0,_.both)((0,_.complement)((0,_.hasPath)([r,"drafts"])),(0,_.always)((0,S.isEditableMode)(i))),(0,_.assocPath)([r,"drafts"],mA)))(e)}case xC.SECOND_LEVEL_RELATIONS_LOADED:{const{id:r,connections:n,parentEntityUri:a,total:i}=t.payload,o=(0,_.path)([r,"connections"],e).map((e=>{const{entityUri:t}=e.entity;return t===a?uA({},e,{total:i,connections:n.map((e=>uA({},e,{parentEntityUri:a})))}):e}));return(0,_.assocPath)([r,"connections"],o,e)}case Tb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return n?e:(0,_.map)(kw(r)?(0,_.omit)(["drafts","relationsToEdit","relationToAdd"]):(0,_.assoc)("drafts",mA),e)}case xC.REMOVE_RELATION:{const{id:r,relationUri:n}=t.payload,a=(0,_.pipe)(S.getRelationUriFromConnection,(0,_.equals)(n)),i=(0,_.path)([r,"connections"],e),o=!((0,S.isTempUri)(n)||null!=i&&i.some((e=>e.suggested&&e.relation.relationUri===n)));return(0,_.evolve)({[r]:{drafts:(0,_.evolve)({removedUris:o?(0,_.append)(n):_.identity,addedConnections:(0,_.reject)(a),editedConnections:(0,_.reject)(a)})}},e)}case xC.IGNORE_RELATION:{const{id:r,ignoredRelationData:n}=t.payload;return(0,_.evolve)({[r]:{drafts:(0,_.evolve)({ignoredRelationData:(0,_.append)(n)})}},e)}case xC.ADD_RELATION:{const{id:r,connection:n}=t.payload,a=(0,_.omit)(["isNew"],n);return(0,_.evolve)({[r]:(0,_.pipe)((0,_.when)((0,_.propSatisfies)(_.isNil,"drafts"),(0,_.assocPath)(["drafts"],mA)),(0,_.evolve)({drafts:{addedConnections:(0,_.prepend)(a)}}))},e)}case xC.EDIT_RELATION:{const{id:r,connection:n}=t.payload,a=(0,_.eqBy)(S.getRelationUriFromConnection,n);if((0,S.isTempUri)((0,S.getRelationUriFromConnection)(n))){const t=e=>{const t=e.findIndex(a);return t>=0?(0,_.update)(t,n,e):e};return(0,_.evolve)({[r]:{drafts:(0,_.evolve)({addedConnections:t})}},e)}{const t=e=>{const t=e.findIndex(a);return t>=0?(0,_.update)(t,n,e):[...e,n]};return(0,_.evolve)({[r]:{drafts:(0,_.evolve)({editedConnections:t})}},e)}}case xC.UPDATE_RELATION_RATING:{const{id:r,connection:n,rating:a,user:i}=t.payload,o=n.initial?n:uA({},n,{initial:{connection:n}}),l=(0,S.isTempUri)((0,S.getRelationUriFromConnection)(o)),s=(0,_.eqBy)(S.getRelationUriFromConnection,o),c=e=>{const t=null==e?void 0:e.findIndex((e=>e.user===i));return!a&&t>=0?e.filter((e=>e.user!==i)):t>=0?(0,_.update)(t,a,e):[...e,a]},u=e=>{const t=e.findIndex(s);return t>=0?(0,_.update)(t,p,e):[...e,p]},p=(0,_.evolve)({relation:e=>uA({},e,{ratings:c((0,_.defaultTo)([],e.ratings))})},o);return(0,_.evolve)({[r]:{drafts:(0,_.evolve)({[l?"addedConnections":"editedConnections"]:u})}},e)}case xC.OPEN_RELATION_EDITOR:{const{id:r,connection:n}=t.payload,a=n.initial?n:uA({},n,{initial:{connection:n}});if(a.isNew){const t=(0,S.getRelationToAddPath)(r);return(0,_.path)(t,e)?e:(0,_.assocPath)(t,a,e)}{const t=(0,_.lensPath)((0,S.getRelationsToEditPath)(r)),n=(0,_.eqBy)((0,_.path)(["relation","relationUri"]),a);return(0,_.over)(t,(0,_.pipe)((0,_.defaultTo)([]),(0,_.unless)((0,_.find)(n),(0,_.append)(a))),e)}}case xC.SET_INITIAL_INFO:{const{id:r,relationUri:n,tempEntity:a}=t.payload,i=fA(r,n,e);return(0,_.assocPath)([...i,"initial","modifiedEntity"],a,e)}case xC.CLOSE_RELATION_EDITOR:{const{id:r,relationUri:n}=t.payload,a=(0,_.pathEq)(["relation","relationUri"],n);return(0,_.evolve)({[r]:{relationToAdd:(0,_.when)(a,(0,_.always)(null)),relationsToEdit:(0,_.reject)(a)}},e)}case xC.SET_RELATION_TYPE:{const{id:r,relationUri:n,relationType:a}=t.payload,i=fA(r,n,e);if(i){const t=[...i,"relation"],r=(0,_.lensPath)(t);return(0,_.over)(r,(0,S.applyRelationTypeObject)(a),e)}return e}case nb.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a,viewId:i}=t,o=(0,S.getBaseUri)(n),l=yA(i,o,e);if(l&&(0,S.isRelationUri)(o)){if((0,S.isActivenessAttrType)(r)){const t=(0,_.view)(l,e),n=(0,S.addEntitySpecialAttribute)({entity:t,attributeType:r});return(0,_.set)(l,n,e)}{const t=gA(i,o,e),l=(0,_.view)(t,e);l||console.error(`relations.ADD_ATTRIBUTES. viewId - ${i}, relationUri - ${o}, state: ${JSON.stringify(e)}`);const s=(0,S.addAttribute)({entity:l,attributeType:r,parentUri:n,index:a});return(0,_.set)(t,s,e)}}return e}),e);case nb.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,values:a,viewId:i}=t.payload;if(!(0,S.isRelationUri)(r))return e;const o=(0,S.getBaseUri)(r),l=fA(i,o,e),s=(0,_.lensPath)([...l,"relation","object","attributes",n]);return(0,_.over)(s,(0,_.pipe)((0,_.defaultTo)([]),(0,_.append)(a)),e)}case nb.MODIFY_ATTRIBUTE:{const{attributeType:r,viewId:n,uri:a,value:i}=t.payload,o=(0,S.getBaseUri)(a),l=yA(n,o,e);if(l&&(0,S.isRelationUri)(o)){if((0,S.isActivenessAttrType)(r)){const t=(0,_.view)(l,e),n=(0,S.editEntitySpecialAttribute)({entity:t,attributeType:r,value:i});return(0,_.set)(l,n,e)}{const t=gA(n,o,e),l=(0,_.view)(t,e);l||console.error(`relations.MODIFY_ATTRIBUTE. viewId - ${n}, relationUri - ${o}, state: ${JSON.stringify(e)}`);const s=(0,S.editAttribute)({entity:l,attributeType:r,uri:a,value:i});return(0,_.set)(t,s,e)}}return e}case nb.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n,viewId:a}=t.payload,i=(0,S.getBaseUri)(n),o=yA(a,i,e);if(o&&(0,S.isRelationUri)(i)){if((0,S.isActivenessAttrType)(r)){const t=(0,_.view)(o,e),n=(0,S.removeEntitySpecialAttribute)({entity:t,attributeType:r});return(0,_.set)(o,n,e)}{const t=gA(a,i,e),o=(0,_.view)(t,e);o||console.error(`relations.REMOVE_ATTRIBUTE. viewId - ${a}, relationUri - ${i}, state: ${JSON.stringify(e)}`);const l=(0,S.removeAttribute)({entity:o,attributeType:r,uri:n});return(0,_.set)(t,l,e)}}return e}case xC.SET_RELATION_ENTITY:{const{id:r,relationUri:n,entityInfo:a}=t.payload,i=fA(r,n,e);if(i){const t=[...i,"entity"],r=(0,_.lensPath)(t),{uri:n,label:o,type:l}=a,s=(0,_.isEmpty)(a)?{}:{entityUri:n,entityLabel:o,entityType:l,object:{uri:n,label:o,type:l}};return(0,_.set)(r,s,e)}return e}case nb.ADD_DEFAULT_VALUES:{const{viewId:r,attributeType:n,parentUri:a,metadata:i,mode:o}=t.payload,l=(0,S.getBaseUri)(a);if((0,S.isRelationUri)(l)){const t=fA(r,l,e);if(t){if(n){const r=[...t,"relation","object"],l=(0,S.getAttributeTypeSubAttributes)(i,n);return(0,_.over)((0,_.lensPath)(r),(0,S.addDefaultValuesToComplexAttribute)({attributeType:n,subAttributes:l,metadata:i,mode:o,parentUri:a}),e)}{const r=[...t,"relation","object","attributes"],n=[...t,"relation","object","type"],l=(0,_.view)((0,_.lensPath)(n),e),{attributes:s=[]}=(0,S.getRelationType)(i,l);return(0,_.over)((0,_.lensPath)(r),(0,S.addDefaultValuesToAttributes)({metadata:i,mode:o,attributeTypes:s,parentUri:a}),e)}}return e}return e}default:return e}},trees:(e=YA,t)=>(0,SA.ZP)(e,(r=>{switch(t.type){case Tb.MODE_UPDATED:{const{mode:e,silent:n}=t.payload;if(n)break;Object.keys(null==r?void 0:r.trees).forEach((e=>{NA(r.trees[e].root,"showDetails",!1)})),(0,S.isViewMode)(e)?(r.common.commands=[],r.initialTrees={}):(0,S.isEditableMode)(e)&&((0,S.isEmptyValue)(r.initialTrees)?r.initialTrees=zA({},r.trees):(r.common.commands=[],r.trees=zA({},r.initialTrees)));break}case Tb.MODE_EDITING_CANCELED:case hA.TREES_RESTORE_FROM_INITIAL_TREES:r.trees=zA({},r.initialTrees);break;case hA.TREES_RESET_INITIAL_TREES:r.initialTrees={};break;case GC.ENTITY_LOADED:{const{silent:r}=t.payload;return r?e:YA}case hA.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 hA.TREE_LOADING:{const e=t.payload;r.trees[e]=r.trees[e]||{},r.trees[e].loading=!0;break}case hA.TREE_CHILDREN_LOADING:{const{id:e,parentId:n,nodeId:a}=t.payload,i=r.trees[e].root,o=(0,S.findNodeById)(i,n);o.pending=!1,o.children=(o.children||[]).concat({entity:{},loading:!0,nodeId:a});break}case hA.TREE_CHILDREN_LOADED:{const{children:e,id:n,parentId:a}=t.payload,i=r.trees[n].root,o=(0,S.findNodeById)(i,a);o&&(o.children=((e=[],t=[])=>{const r=(0,_.reject)((0,_.prop)("loading"))(e);return t.forEach((t=>{e.find((e=>(0,_.path)(["entity","uri"],e)===t.entity.uri))||r.push(t)})),r})(o.children,e),delete o.pending);break}case hA.TREE_NODE_REMOVED:{const{id:e,nodeId:n}=t.payload,a=r.trees[e].root,i=(0,S.findParentNodeById)(a,n);RA(i||a,n);break}case hA.TREE_NODE_CREATED:{const{id:e,parentId:n,node:a}=t.payload,i=r.trees[e].root,o=(0,S.findNodeById)(i,n)||i,l=o.children.length;_A(o,a,l);break}case hA.TREE_NODE_EDITED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,S.findNodeById)(a,n.nodeId),o=Object.keys(n);for(const e of o)i[e]=n[e];break}case hA.TREE_NODE_EDITING_STARTED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,S.findNodeById)(a,n.nodeId),o=(0,S.findParentNodeById)(a,n.nodeId);i&&o&&(i.editingMode=S.NODE_EDITING_MODES.editing,i.relatedEntity=o.entity,delete i.loading,i.initialConnection=PA(i),DA({id:e,draft:r.trees,node:i}));break}case hA.TREE_NODE_EDITING_APPLIED:{const{id:e,node:a}=t.payload,i=r.trees[e].root,o=(0,S.findNodeById)(i,a.nodeId),l=UA({id:e,draft:r.trees,relationUri:a.relation.uri});var n;o&&l&&(jA(o),o.entity.uri!==l.entity.uri&&null!==(n=o.children)&&void 0!==n&&n.length&&(delete o.children,o.pending=!0),o.entity=l.entity,o.relation=l.relation,LA({id:e,draft:r.trees,relationUri:a.relation.uri}));break}case hA.TREE_NODE_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,S.findNodeById)(a,n.nodeId);i&&(jA(i),LA({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case hA.TREE_NODE_NEW_PARENT_EDITING_STARTED:{const{id:e,node:n,newNode:a}=t.payload,i=r.trees[e].root,o=(0,S.findNodeById)(i,n.nodeId);if(a.relatedEntity=o.entity,a.relatedNodeId=o.nodeId,a.editingMode=S.NODE_EDITING_MODES.addingParent,i===o)a.children=[i],r.trees[e].root=a;else{const e=(0,S.findParentNodeById)(i,n.nodeId),t=e.children.findIndex((e=>o===e));_A(e,a,t)}a.initialConnection=PA(a),DA({id:e,draft:r.trees,node:a});break}case hA.TREE_NODE_NEW_PARENT_EDITING_APPLIED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,S.findNodeById)(a,n.nodeId),o=(0,S.findNodeById)(a,n.relatedNodeId),l=UA({id:e,draft:r.trees,relationUri:n.relation.uri});i&&l&&(FA({id:e,draft:r.trees,currentNode:i}),o.parent=o.parent||[],o.parent.push(l.entity.uri),o.relations=o.relations||[],o.relations.push(l.relation),r.trees[e].entitiesMap=((e,t=[])=>AA(e,t.reduce(((e,t)=>xA({},e,{[t.entity.uri]:(0,_.pick)(["entity","parent","relations"],t)})),{})))(r.trees[e].entitiesMap,[o,BA(l)]),LA({id:e,draft:r.trees,relationUri:i.relation.uri}));break}case hA.TREE_NODE_NEW_PARENT_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,S.findNodeById)(a,n.nodeId);i&&(FA({id:e,draft:r.trees,currentNode:i}),LA({id:e,draft:r.trees,relationUri:i.relation.uri}));break}case hA.TREE_NODE_NEW_CHILD_EDITING_STARTED:{const{id:e,node:n,newNode:a}=t.payload,i=r.trees[e].root,o=(0,S.findNodeById)(i,n.nodeId);a.relatedEntity=o.entity,a.editingMode=S.NODE_EDITING_MODES.addingChild,a.parent=[o.entity.uri],a.directParentUri=o.entity.uri,o.children=o.children||[],o.children.unshift(a),o.expanded=!0,a.initialConnection=PA(a),DA({id:e,draft:r.trees,node:a});break}case hA.TREE_NODE_NEW_CHILD_EDITING_APPLIED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,S.findParentNodeById)(a,n.nodeId),o=(0,S.findNodeById)(i,n.nodeId),l=UA({id:e,draft:r.trees,relationUri:n.relation.uri});i&&o&&l&&(jA(o),o.entity=l.entity,o.relation=l.relation,o.relations=[l.relation],LA({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case hA.TREE_NODE_NEW_CHILD_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,S.findParentNodeById)(a,n.nodeId);i&&(RA(i,n.nodeId),LA({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case hA.TREE_NODE_RELATION_TYPE_CHANGED:{const{id:e,node:n,relationTypeUri:a}=t.payload,i=UA({id:e,draft:r.trees,relationUri:n.relation.uri}).relation.type;i!==a&&(i&&kA({id:e,draft:r.trees,node:n,entity:null}),(({id:e,draft:t,node:r,relationTypeUri:n})=>{IA({path:["editingConnections",r.relation.uri,"relation"],object:t[e],value:e=>xA({},e,{type:n,attributes:{}})})})({id:e,draft:r.trees,node:n,relationTypeUri:a}));break}case hA.TREE_NODE_ENTITY_CHANGED:{const{id:e,node:n,entity:a}=t.payload;kA({id:e,draft:r.trees,node:n,entity:a});break}case nb.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a,viewId:i}=t,o=(0,S.getBaseUri)(n),l=MA(i,o,e.trees);if(l&&(0,S.isRelationUri)(o)){const t=(0,_.view)(l,e.trees);if((0,S.isActivenessAttrType)(r)){const n=(0,S.addEntitySpecialAttribute)({entity:t,attributeType:r});return zA({},e,{trees:(0,_.set)(l,n,e.trees)})}{const i=(0,S.addAttribute)({entity:t,attributeType:r,parentUri:n,index:a});return zA({},e,{trees:(0,_.set)(l,i,e.trees)})}}return e}),e);case nb.MODIFY_ATTRIBUTE:{const{attributeType:r,viewId:n,uri:a,value:i}=t.payload,o=(0,S.getBaseUri)(a),l=MA(n,o,e.trees);if(l&&(0,S.isRelationUri)(o)){const t=(0,_.view)(l,e.trees);if((0,S.isActivenessAttrType)(r)){const n=(0,S.editEntitySpecialAttribute)({entity:t,attributeType:r,value:i});return zA({},e,{trees:(0,_.set)(l,n,e.trees)})}{const n=(0,S.editAttribute)({entity:t,attributeType:r,uri:a,value:i});return zA({},e,{trees:(0,_.set)(l,n,e.trees)})}}return e}case nb.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n,viewId:a}=t.payload,i=(0,S.getBaseUri)(n),o=MA(a,i,e.trees);if(o&&(0,S.isRelationUri)(i)){const t=(0,_.view)(o,e.trees);if((0,S.isActivenessAttrType)(r)){const n=(0,S.removeEntitySpecialAttribute)({entity:t,attributeType:r});return zA({},e,{trees:(0,_.set)(o,n,e.trees)})}{const a=(0,S.removeAttribute)({entity:t,attributeType:r,uri:n});return zA({},e,{trees:(0,_.set)(o,a,e.trees)})}}return e}case nb.ADD_DEFAULT_VALUES:{const{viewId:r,attributeType:n,parentUri:a,metadata:i,mode:o}=t.payload,l=(0,S.getBaseUri)(a),s=MA(r,l,e.trees);if((0,S.isRelationUri)(l)&&s){if(n){const t=(0,S.getAttributeTypeSubAttributes)(i,n);return zA({},e,{trees:(0,_.over)(s,(0,S.addDefaultValuesToComplexAttribute)({attributeType:n,subAttributes:t,metadata:i,mode:o,parentUri:a}),e.trees)})}{const t=(0,_.compose)(s,(0,_.lensPath)(["attributes"])),r=(0,_.compose)(s,(0,_.lensPath)(["type"])),n=(0,_.view)(r,e.trees),{attributes:l=[]}=(0,S.getRelationType)(i,n);return zA({},e,{trees:(0,_.over)(t,(0,S.addDefaultValuesToAttributes)({metadata:i,mode:o,attributeTypes:l,parentUri:a}),e.trees)})}}return e}case hA.TREE_ENTITIES_MAPPING_LOADED:{const{id:e,entitiesSubMap:n}=t.payload,a=r.trees[e].entitiesMap;r.trees[e].entitiesMap=AA(a,n);break}case hA.TREE_LOADED:{const{tree:e,id:n,graphTypes:a,activenessDate:i,isReversed:o}=t.payload,l=VA(r.trees[n]||{});r.trees[n]=zA({},l,e,{graphTypes:a,activenessDate:i,isReversed:o}),delete r.trees[n].errorMessage,r.trees[n].loading=!1;break}case hA.TREE_SORTED:{const{id:e,typesLabelsMap:n={},sortField:a,sortOrder:i}=t.payload;r.trees[e]=r.trees[e]||{},r.trees[e].sortField=a,r.trees[e].sortOrder=i,r.trees[e].root&&(r.trees[e].root=(0,S.mapTree)(r.trees[e].root,{childrenProcessing:(0,S.sortTreeChildren)({sortField:a,sortOrder:i,typesLabelsMap:n})}));break}case hA.TREE_SECONDARY_LABEL_SHOWN:{const{id:e,show:n}=t.payload;r.trees[e].showSecondaryLabel=n,r.trees[e].root=zA({},r.trees[e].root);break}case hA.TREES_STATE_RESTORED:{const e=t.payload;Object.keys(e).forEach((t=>{r.trees[t]=r.trees[t]||{},r.trees[t]=zA({},r.trees[t],e[t]),r.trees[t].root&&(r.trees[t].root=zA({},r.trees[t].root))}));break}case hA.TREE_CHANGED:{const{id:e,tree:n}=t.payload;r.trees[e].root=n;break}case hA.TREE_REFRESHED:{const e=t.payload;r.trees[e].root=zA({},r.trees[e].root);break}case hA.TREE_NODE_EXPANDED:{const{id:e,nodeId:n}=t.payload,a=r.trees[e].root;(0,S.findNodeById)(a,n).expanded=!0;break}case hA.TREE_CURRENT_ENTITY_SHOWN:{const{id:n,uri:a=(0,_.path)(["entity","uri"],e)}=t.payload;if(r.trees[n]){const e=wA(r.trees[n].root,a);r.trees[n].scrollTo=e}break}case hA.TREE_SCROLL_TO_NODE_RESET:{const e=t.payload;r.trees[e]&&(r.trees[e].scrollTo=null);break}case hA.TREE_ACTIVENESS_DATE_CHANGED:{const{id:e,activenessDate:n}=t.payload;r.trees[e].activenessDate=n;break}case hA.TREE_RELATION_REPOINTED:{const{entity:e,relation:n,newParent:a,isReversed:i}=t.payload,o=(0,_.prop)("uri"),l=o(e),s=o(a),c=(0,S.createRelationRepointCommand)({entityUri:l,relation:n,newEntityUri:s,isReversed:i});r.common.commands.push(c);break}case hA.TREE_RELATION_REMOVED:{const{relationUri:e}=t.payload;if((0,S.isTempUri)(e))r.common.commands=(0,_.reject)((0,S.isRelationCommandForUri)(e),r.common.commands);else{const t=(0,S.createRelationDeleteCommand)({relationUri:e});r.common.commands.push(t)}break}case hA.TREE_RELATION_CREATED:{const{entityUri:e,relation:n,parentEntityUri:a}=t.payload,i=(0,S.createRelationCreateCommand)({parentUri:a,relation:n,entityUri:e});r.common.commands.push(i);break}case hA.TREE_RELATION_EDITED:{const{oldRelation:e,newRelation:n,entityUri:a,newEntityUri:i,isReversed:o}=t.payload,l=i?(0,S.createRelationRepointCommand)({entityUri:a,newEntityUri:i,relation:n,isReversed:o}):(0,S.createRelationUpdateCommand)({oldRelation:e,newRelation:n});r.common.commands.push(l);break}case hA.TREE_COMMANDS_CLEARED:r.common.commands=[];break;case hA.TREE_CANCEL_CHILDREN_LOADING:{const{id:e,parentId:n}=t.payload,a=r.trees[e].root,i=(0,S.findNodeById)(a,n);i&&(i.pending=!0,delete i.expanded,delete i.children);break}}})),operation:(e=null,t)=>t.type===t_.PROFILE_OPERATION_UPDATE?t.payload:e,views:(e=null,t)=>t.type===g_.PROFILE_VIEWS_SET?t.payload:e,sidePanelViews:(e=K_,t)=>t.type===$_.SIDE_PANEL_VIEWS_LOADED?t.payload:e,entityRelatedAttributes:(e=GA,t)=>{switch(t.type){case WA.ENTITY_RELATED_ATTRIBUTES_ADDED:{const{attributeTypeUri:r,entityUri:n,attributes:a}=t.payload;return(0,_.assocPath)([r,n],a,e)}case Tb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,S.isViewMode)(r)&&!n?GA:e}default:return e}},hiddenAttributes:(e=eI,t)=>{switch(t.type){case X_.HIDDEN_ATTRIBUTES_UPDATED:{const{uri:r,hiddenAttributes:n}=t.payload;return(0,_.assoc)(r,n,e)}case X_.HIDDEN_ATTRIBUTES_RESET:return(0,_.dissoc)(t.payload,e);default:return e}},controlAttributes:(e=nI,t)=>t.type===tI.CONTROL_ATTRIBUTES_UPDATED?t.payload:e}),iI={getModule:()=>({id:"mdm",reducerMap:{dataTenants:ZE,tenants:KE,metadata:rb,profile:aI,tenant:KT,environment:nO,user:HT,ui:BT,search:tv},sagas:[...Xw,...WC,...Z_,...Xb]}),selectors:c},oI=iI,lI=({className:e})=>{const t=(0,mp.useDispatch)(),r=(0,mp.useSelector)(Ri.qx),n=(0,mp.useSelector)(oI.selectors.getGoogleMapKey),a=(0,b.useMemo)((()=>((e,t)=>(0,_.when)((0,_.always)(!t),(0,_.reject)((0,_.propEq)("id",Z.om.MAP)))(e))([{id:Z.om.MAP,tooltipTitle:li().text("View map"),Icon:WE()},{id:Z.om.PROFILE,tooltipTitle:li().text("View entity details"),Icon:HE()}],n)),[n]);return v().createElement(PE,{className:e,modes:a,modeId:r,onChange:e=>{t(Ci(r!==e?e:null))}})};lI.propTypes={className:dp().string};const sI=lI,cI=()=>v().createElement("div",{className:Td},v().createElement("div",{className:"Headers-styles-title--TvsMA"},li().text("Profiles")),v().createElement("div",{className:Od},v().createElement(BE,null),v().createElement(sI,{className:Sd})));var uI=r(12932),pI=r.n(uI),dI=r(83754),mI=r.n(dI);const fI=(0,wp.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 yI(){return yI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yI.apply(null,arguments)}function gI(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const hI=e=>{let{value:t,tabs:r=[],onChange:n,tabClasses:a}=e,i=gI(e,["value","tabs","onChange","tabClasses"]);const o=fI(),l=(e,t)=>v().createElement("span",{className:o.labelWrapper},v().createElement(od.Y,{value:e},v().createElement("span",{className:o.label},e)),t);return v().createElement(pI(),yI({value:t,onChange:(e,t)=>n(t),classes:{root:o.tabsRoot,scrollButtons:o.tabsScrollButton},indicatorColor:"primary",textColor:"primary",variant:"scrollable",scrollButtons:!0},i,{allowScrollButtonsMobile:!0}),r.map((e=>{let{label:t,value:r,additionalLabel:n,dataReltioId:i}=e,s=gI(e,["label","value","additionalLabel","dataReltioId"]);return v().createElement(mI(),yI({classes:a||{root:o.tabRoot,disabled:o.disabled},key:r,value:r,label:l(t,n),"data-reltio-id":i},s))})))};function EI(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class bI extends b.PureComponent{constructor(...e){super(...e),this.getTabsData=()=>{const{tenantObject:e,tableViewTabs:t,selectedEntityTypes:r,metadata:n}=this.props,a=(0,gy.ZK)(t,e);return(0,Ai.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){EI(e,t,r[t])}))}return e}({},e,{additionalLabel:v().createElement("span",{className:"Headers-styles-number--trErH"},"(",void 0===e.number?li().text("N/A"):(0,ni.k7)(e.number),")")})))},this.onTabChange=e=>{this.props.dispatch(bi(e))},this.onSelectColumns=e=>{const{dispatch:t,entityTypeTab:r,columnsForEntityType:n}=this.props;return t(Ei(r,e,n))},this.renderTabs=()=>{const{entityTypeTab:e}=this.props;return v().createElement("div",{className:"Headers-styles-tabsContainer--lhDXc"},v().createElement(hI,{value:e,tabs:this.getTabsData(),onChange:this.onTabChange}))}}render(){const{entityTypeTab:e,columnsForEntityType:t}=this.props;return v().createElement("div",{className:Td},this.renderTabs(),v().createElement("div",{className:Od},v().createElement(wd,{entityTypeUri:e,headColumns:t,onSelectColumns:this.onSelectColumns,"data-reltio-id":"reltio-search-table-add-remove-column",disabled:!e,showForDisabled:!0}),v().createElement(Af(),{orientation:"vertical",className:"Headers-styles-splitter--sCvn6"}),v().createElement(BE,null),v().createElement(sI,{className:Sd})))}}const vI=(0,mp.connect)((e=>{const t=(0,Ri.o4)(e);return{metadata:k().selectors.getMetadata(e),selectedEntityTypes:(0,P.DX)(e),tableViewTabs:(0,Ri.gu)(e),entityTypeTab:t,columnsForEntityType:(0,Ri.Gv)(e,t),tenantObject:(0,ai.t9)(e)}}))(bI);function TI(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class OI extends v().PureComponent{constructor(...e){super(...e),this.entitiesTableRef=this.props.basicTableRef||v().createRef(),this.state={resizeDebounceDelay:void 0},this.sortHandle=({field:e,order:t})=>{this.props.dispatch((({field:e,order:t,entityTypeUri:r})=>({type:U.Z.CHANGE_SORT,payload:{field:e,order:t,entityTypeUri:r}}))({field:t?e:null,order:t,entityTypeUri:this.props.entityTypeUri}))},this.reorderingHandle=({what:e,where:t})=>{const{entityTypeUri:r,dispatch:n,headColumns:a}=this.props;n(((e,t)=>({type:Se,payload:{entityTypeUri:e,columns:t}}))(r,(0,_.move)(e.columnIndex,t.columnIndex,a)))},this.changeColumnsListHandle=({columns:e})=>{const{entityTypeUri:t,dispatch:r,headColumns:n}=this.props;r(Ei(t,e,n))},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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){TI(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:xe,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:i}=this.props;this.entitiesTableRef.current&&(t.length!==(0,_.path)(["headColumns","length"],e)||(0,_.difference)((0,_.omit)(["size"],t),(0,_.omit)(["size"],e.headColumns)).length>0||r!==e.sortField||n!==e.sortOrder||a!==e.entities)&&this.entitiesTableRef.current.resetScrollbarPosition(),e.entityTypeUri!==i&&this.setState({resizeDebounceDelay:0})}render(){const{entities:e,entityToHighlight:t,onScroll:r,entityTypeUri:n,headColumns:a,sortField:i,sortOrder:o,additionalColumns:l,selectedEntityUri:s,dndColumnReorderingEnabled:c,onEntityClick:u,onEntityHover:p,entitiesImportStatus:d,onEntityImportStatusChange:m}=this.props;return v().createElement(of,{entities:e,entityToHighlight:t,selectedEntityUri:s,onScroll:r,onSort:this.sortHandle,onEntityClick:u,onEntityHover:p,entityTypeUri:n,headColumns:a,sortField:i,sortOrder:o,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})}}OI.propTypes={entities:dp().array,entityToHighlight:dp().string,selectedEntityUri:dp().string,headColumns:dp().array,onScroll:dp().func,entityTypeUri:dp().string,sortField:dp().string,sortOrder:dp().oneOf([Ad.oy,Ad.U9]),dndColumnReorderingEnabled:dp().bool,dispatch:dp().func,additionalColumns:dp().arrayOf(dp().shape({id:dp().string,label:dp().string})),onEntityClick:dp().func,onEntityHover:dp().func,entitiesImportStatus:dp().object,onEntityImportStatusChange:dp().func,basicTableRef:dp().shape({current:dp().object})},OI.defaultProps={entities:[],headColumns:[]};const SI=(0,Lf.Z)(Ai.oq),xI=(0,mp.connect)((e=>{const t=(0,Ri.tB)(e),r=(0,Ri.Gv)(e,t),n=k().selectors.getMetadata(e),a=SI(n,t,r);return{sortField:(0,ai.NW)(e,{entityTypeUri:(0,Ri.o4)(e)}),sortOrder:(0,ai.L9)(e,{entityTypeUri:(0,Ri.o4)(e)}),dndColumnReorderingEnabled:!(0,Ri.Ue)(e),headColumns:r,entityTypeUri:t,additionalColumns:a}}))(OI);var CI=r(14058),wI=r.n(CI);const AI=(0,wp.Z)((()=>({container:{position:"relative",height:"100%",width:"100%"},closeButton:{position:"absolute",top:"7px",left:"7px",zIndex:1}}))),RI=(0,wp.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"}}}))),_I=({className:e,entity:t,children:r,classes:n,renderLabel:a=_.identity})=>{const i=RI({classes:n}),o=(0,w.AH)(),l=(0,w.QQ)(),s=(0,b.useCallback)((()=>{navigator.clipboard.writeText((0,S.getEntityId)(t))}),[t]);if((0,_.isNil)(t))return null;const c=(0,S.getLabel)(t.label),u=t.secondaryLabel,p=(0,S.getBusinessCardAttributesText)(o,t),d=(0,S.isActiveObject)(t),m=t.uri,f=(0,S.getEntityId)(t);return v().createElement("div",{className:O()(i.profileBandWrapper,e),"data-reltio-id":"reltio-profile-band"},v().createElement("div",{className:O()(i.profileBand,{[i.inactive]:!d}),"data-entity-uri":m},v().createElement(A,{key:t.uri,entity:t,avatarClassName:i.profileIcon,imageClassName:i.imageProfileIcon}),v().createElement("div",{className:i.profileInfo},v().createElement("div",null,v().createElement(bf(),{variant:"h6",className:i.label},a(c)),u&&v().createElement(bf(),{variant:"subtitle2",className:i.secondaryLabel},u),p&&v().createElement(bf(),{variant:"subtitle1",className:i.businessCard},p)),v().createElement("div",{className:i.specialInfo},v().createElement("div",{className:i.entityType},v().createElement(sE,{entity:t,size:"medium",className:i.badge}),!(0,S.isTempUri)(m)&&l&&v().createElement(rg(),{title:li().text("Copy to clipboard")},v().createElement(bf(),{display:"inline",variant:"body2",className:i.entityId,onClick:s},li().text("Entity ID"),": ",f))))),r&&v().createElement("div",null,r)))},II=v().createContext(!1);II.displayName="BlockImageGalleryDialogContext";var NI=r(31574),PI=r.n(NI);const DI=v().createContext([]);var kI=r(24436),LI=r.n(kI);function UI(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){jI(e,t,r[t])}))}return e}function jI(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const FI=(0,wp.Z)((e=>({basicViewPaper:UI({display:"flex",flexDirection:"column"},e.basicView)})));function MI(){return MI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},MI.apply(null,arguments)}const VI=(0,b.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","className"]);const i=FI();return v().createElement(LI(),MI({ref:t,className:n,classes:{root:i.basicViewPaper}},a),r)}));VI.displayName="BasicView";var BI=r(52574);const zI="1px solid #AFD4E9",HI=(0,wp.Z)({decorator:{marginLeft:8,borderLeft:zI,"&:last-child":{borderLeft:"none","&:before":{borderLeft:zI}},"&:before":{top:0,height:14,width:5,borderBottom:zI,content:'""',display:"block",left:"0"},"&$plain":{"&:before":{width:0}}},plain:{},wrapper:{marginLeft:16,marginTop:-8}}),YI=({className:e,children:t,plain:r=!1,enabled:n=!1})=>{const a=HI();return n?v().createElement("div",{"data-reltio-id":"branch-decorator",className:O()(a.decorator,{[a.plain]:r},e)},v().createElement("div",{className:a.wrapper},t)):v().createElement(v().Fragment,null,t)},WI="commentsContainerVisibilityArea",GI=v().createContext([]);GI.displayName="RelatedObjectUrisContext";const qI={comments:[],commentsMap:null,currentComment:null,updateCommentState:_.identity,clearCommentState:_.identity,getCommentState:()=>({}),getComment:_.identity,getComments:()=>new Promise(_.identity),getCommentsCount:_.identity,createComment:()=>new Promise(_.identity),editComment:()=>new Promise(_.identity),createReply:()=>new Promise(_.identity),resolveThread:_.identity,reOpenThread:_.identity,clearCurrentComment:_.identity,deleteComment:_.identity,sending:!1,loading:!1,pageToken:null,deleteReply:_.identity,editReply:()=>new Promise(_.identity)},ZI=v().createContext(qI);function $I(){return $I=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$I.apply(null,arguments)}ZI.displayName="CollaborationContext";const KI=e=>v().createElement("svg",$I({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgCommentBubble"},e),v().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"})),XI=(0,wp.Z)((()=>({root:{position:"relative",height:"18px",display:"flex",alignItems:"center",justifyContent:"center",marginLeft:"4px",cursor:"pointer"},icon:{"&:hover":{fillOpacity:.7}}})));function QI(){return QI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},QI.apply(null,arguments)}const JI=v().forwardRef(((e,t)=>{let{children:r,tooltipTitle:n,icon:a,onClick:i,className:o}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","tooltipTitle","icon","onClick","className"]);const s=XI();return v().createElement(rg(),{title:n},v().createElement("div",QI({ref:t,className:O()(s.root,o),onClick:i},l),v().createElement(a,{className:s.icon}),r))}));JI.displayName="BasicCommentButton";const eN=(0,wp.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"}}),tN=v().forwardRef((({children:e,onClick:t},r)=>{const n=eN();return v().createElement(JI,{ref:r,tooltipTitle:li().text("Show comment"),icon:KI,onClick:t,"data-reltio-id":"reltio-comment-button"},v().createElement("div",{className:n.childrenWrapper},e))}));function rN(){return rN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rN.apply(null,arguments)}tN.displayName="CommentButton";const nN=e=>v().createElement("svg",rN({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgAddComment"},e),v().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"})),aN=({className:e,onClick:t})=>v().createElement(JI,{className:e,onClick:t,tooltipTitle:li().text("Add comment"),icon:nN});var iN=r(94511),oN=r.n(iN),lN=r(59674);const sN=(0,wp.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 cN(){return cN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cN.apply(null,arguments)}const uN=e=>{let{children:t,className:r,classes:n,transition:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","className","classes","transition"]);const o=sN(),l=a?oN():v().Fragment,[s,c]=(0,b.useState)(null);return v().createElement(lN.r,cN({className:O()(o.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},i),(({TransitionProps:e})=>v().createElement(l,e,v().createElement(LI(),{className:O()(o.paper,null==n?void 0:n.root)},v().createElement("span",{className:O()(o.arrow,null==n?void 0:n.arrow),ref:c}),t))))};var pN=r(93526),dN=r.n(pN);const mN=(0,wp.Z)((e=>({menuItem:{minHeight:"32px"},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0}}))),fN=(0,ld.T)(qp()),yN=(0,b.forwardRef)((({item:e,onMenuClose:t=_.identity},r)=>{const n=mN(),{disabled:a,text:i,tooltip:o,onClick:l,id:s="",selectable:c,selected:u}=e;return v().createElement(fN,{tooltipTitle:o,showForDisabled:!0,classes:{root:n.menuItem},onClick:e=>{t(e),l(e)},disabled:a,ref:r,"data-modal":!0,"data-reltio-id":`reltio-search-menu-item${s}`},c&&v().createElement(Wp(),{checked:u,color:"primary"}),v().createElement(bf(),{classes:{root:n.menuText}},i))}));yN.displayName="DefaultMenuItemRenderer";const gN=(0,wp.Z)((e=>({buttonRoot:{"&$selected":{color:e.palette.action.active,backgroundColor:(0,wm.alpha)(e.palette.action.active,.12),"&:hover":{backgroundColor:(0,wm.alpha)(e.palette.action.active,.15)}}},selected:{},paper:{minWidth:"112px"}})));function hN(){return hN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hN.apply(null,arguments)}function EN({className:e,menuId:t,buttonComponent:r=Wh(),buttonContent:n,menuItems:a=[],buttonProps:i={},popoverProps:o={},onMenuOpen:l=_.identity,onMenuClose:s=_.identity,MenuItemRenderer:c=yN}){const u=r,p=gN(),d=(0,b.useRef)(),[m,f]=(0,b.useState)(!1);(0,dE.D)((()=>{m?l():s()}),[m]);const y=(0,b.useCallback)((e=>{null==e||e.stopPropagation(),f((e=>!e))}),[]);return v().createElement(v().Fragment,null,v().createElement(u,hN({"data-reltio-id":"drop-down-menu-button",ref:d,className:O()(p.buttonRoot,{[p.selected]:m},e),onClick:y,"aria-pressed":m,"aria-controls":m?t:void 0,"aria-haspopup":"true"},i),n),v().createElement(dN(),hN({id:t,variant:"menu",open:m,autoFocus:!1,classes:{paper:p.paper},anchorEl:d.current,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},elevation:2,MenuListProps:{autoFocusItem:m}},o),a.map(((e,t)=>v().createElement(c,{item:e,key:t,onMenuClose:y})))))}const bN=(e,t)=>{(0,b.useEffect)((()=>{if(t){var r,n,a,i;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===(i=e.current)||void 0===i||i.setSelectionRange(t,t)}}),[e,t])},vN=(e,t)=>{const r=e.relatedObjectUris.indexOf(t);if(r>=0)return e.relatedObjectUris[1-r]},TN=e=>`${li().date(e,"LT")} ${li().date(e,"LL")}`,ON=e=>`comment/${e.commentId}`,SN=(e,t)=>`comment/${e.commentId}/reply/${t.replyId}`,xN=(e,t)=>{let r=e;for(const e of t)r=r.split(`+${e}`).join(`@[${e}](${e})`);return r},CN=v().createContext({});CN.displayName="EntitiesMapContext";const wN=(0,wp.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 AN(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const RN=({comment:e,className:t})=>{const r=wN(),n=(0,b.useContext)(CN),a=(0,w.AH)(),i=(0,w.eh)();return v().createElement(PI(),{className:t},(()=>{switch(e.objectType){case S.CollaborationObjectTypes.ENTITY_ATTRIBUTE:{const t=(0,S.getAttributeTypeUriByValueUri)(e.objectId,i.type),n=(0,S.findAttributeTypeByUri)(a,t);return v().createElement(v().Fragment,null,v().createElement(bf(),{className:r.title},li().text("Selected attribute:")),v().createElement(bf(),{className:r.label},null==n?void 0:n.label))}case S.CollaborationObjectTypes.RELATION_ATTRIBUTE:{const t=e.relatedObjectUris.find((0,_.startsWith)("configuration/relationTypes")),n=t&&(0,S.getAttributeTypeUriByValueUri)(e.objectId,t),i=n&&(0,S.findAttributeTypeByUri)(a,n);return v().createElement(v().Fragment,null,v().createElement(bf(),{className:r.title},li().text("Selected attribute:")),v().createElement(bf(),{className:r.label},null==i?void 0:i.label))}case S.CollaborationObjectTypes.ENTITY:return v().createElement(v().Fragment,null,v().createElement(bf(),{className:r.title},li().text("Selected profile:")),v().createElement(Md,{className:O()(r.label,r.link),value:(0,S.getEntityUriForLink)(i)},(0,S.getLabel)(i.label)));case S.CollaborationObjectTypes.RELATION:{const t=vN(e,i.uri),a=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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){AN(e,t,r[t])}))}return e}({},n[t]||{},{uri:t});return v().createElement(v().Fragment,null,v().createElement(bf(),{className:r.title},li().text("Selected relation:")),v().createElement(bf(),{className:r.label},v().createElement(Md,{className:r.link,value:(0,S.getEntityUriForLink)(i)},(0,S.getLabel)(i.label)),t&&v().createElement(v().Fragment,null,` ${li().text("to")} `,v().createElement(Md,{className:r.link,value:(0,S.getEntityUriForLink)(a)},a.label?(0,S.getLabel)(a.label):(0,S.getEntityId)(a)))))}case S.CollaborationObjectTypes.POTENTIAL_MATCH:{var t;const a=vN(e,i.uri),o={uri:a,label:null===(t=n[a])||void 0===t?void 0:t.label};return v().createElement(v().Fragment,null,v().createElement(bf(),{className:r.title},li().text("Selected potential match:")),v().createElement(bf(),{className:r.label},v().createElement(Md,{className:r.link,value:(0,S.getEntityUriForLink)(i)},(0,S.getLabel)(i.label)),a&&v().createElement(v().Fragment,null,` ${li().text("and")} `,v().createElement(Md,{className:r.link,value:(0,S.getEntityUriForLink)(o)},o.label?(0,S.getLabel)(o.label):(0,S.getEntityId)(o)))))}default:return null}})())},_N=v().createContext([]);_N.displayName="UsersContext";const IN=(0,wp.Z)((e=>({root:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",wordBreak:"break-word"}}))),NN=({comment:e,className:t})=>{const r=IN(),n=(0,b.useContext)(_N);return v().createElement(bf(),{className:O()(r.root,t)},((e,t,r=(e=>e),n="+")=>{const a=[];let i="",o=!1;for(let l=0;l<=e.length;l++){const s=e[l],c=e[l+1],u=l===e.length-1;i+=s,s===n&&0===l&&(o=!0),o&&t.includes(i.slice(n.length))&&(o=!1,a.push(r(i)),i=""),c===n&&(o=!0,a.push(i),i=""),u&&a.push(i)}return a})(e.content,e.namedUsers,(e=>{const t=n.find((t=>t.username===e.slice(1)));return t?v().createElement(ty(),{href:`mailto:${t.email}`,underline:"hover"},e):e})).map(((e,t)=>v().createElement(b.Fragment,{key:t},e))))},PN=(0,wp.Z)((e=>({root:{width:"32px",height:"32px",fontSize:"12px",color:e.palette.text.secondary,backgroundColor:"rgba(144, 164, 174, 0.2)"}})));function DN(){return DN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},DN.apply(null,arguments)}const kN=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","children"]);const a=PN();return v().createElement(C(),DN({},n,{className:O()(a.root,t)}),r.split(".").map((e=>e[0].toUpperCase())).join(""))};var LN=r(2271);const UN=r(47503).$+1,jN=(0,wp.Z)((e=>({root:{backgroundColor:"#fff",fontFamily:"Roboto"},mentionsControl:{fontSize:"13px"},mentionsHighlighter:{padding:"10px 22px",border:"1px solid transparent !important","&::before":{content:({placeholder:e})=>e&&`"${e}"`}},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:UN+"!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)"},mentionsSuggestionsList:{maxHeight:"200px",overflowY:"scroll"},mentionsSuggestionsItem:{padding:"6px 12px",color:e.palette.text.primary,fontSize:"13px",transition:e.transitions.create(["background-color"]),"&:hover":{backgroundColor:"rgba(0,0,0,0.04)"}},mentionsSuggestionsItemFocused:{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 FN(){return FN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},FN.apply(null,arguments)}const MN=e=>{let{onChange:t,className:r,value:n,placeholder:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onChange","className","value","placeholder"]);const o=jN({placeholder:n?"":a}),l=(0,b.useContext)(_N);return v().createElement("div",{className:O()(o.root,r)},v().createElement(LN.r,FN({},i,{value:n,placeholder:a,onChange:(e,r,n,a)=>{t(r,n,(0,_.uniq)(a.map((({display:e})=>e.slice(1)))))},className:"mentionsTextArea",suggestionsPortalHost:document.body,allowSuggestionsAboveCursor:!0,classNames:{mentionsTextArea__input:o.mentionsInput,mentionsTextArea__highlighter:o.mentionsHighlighter,mentionsTextArea__control:o.mentionsControl,mentionsTextArea__suggestions:o.mentionsSuggestions,mentionsTextArea__suggestions__list:o.mentionsSuggestionsList,mentionsTextArea__suggestions__item:o.mentionsSuggestionsItem,"mentionsTextArea__suggestions__item--focused":o.mentionsSuggestionsItemFocused}}),v().createElement(LN.p,{trigger:"+",data:l.map((({username:e})=>({id:e,display:e}))),displayTransform:(e,t)=>`+${t}`,appendSpaceOnAdd:!0,className:o.mention})))},VN=(0,wp.Z)({root:({isEditing:e})=>({padding:e?"6px 6px 6px 0":" 6px 6px 6px 8px",borderRadius:"4px",backgroundColor:e?"transparent":"rgba(0,114,206,0.06)"}),textField:({isEditing:e})=>({width:e?"100%":"calc(100% - 40px)"}),form:{marginBottom:0},main:{display:"flex",alignItems:"center"},avatar:{marginRight:"8px"},buttons:({isEditing:e})=>({marginLeft:e?"0":"40px",marginTop:"8px"}),button:{"& + $button":{marginLeft:"8px"}}}),BN=e=>{switch(e){case"open":return li().text("Reply...");case"resolved":return li().text("Adding a comment will re-open this");default:return""}},zN=({inputRef:e,className:t,uri:r,relatedObjectUris:n,objectType:a,popperRef:i,comment:o,reply:l,isEditingComment:s,isEditingReply:c,onCancel:u})=>{const p=s||c,d=VN({isEditing:p}),[m,f]=(0,b.useState)(!1),{createReply:y,createComment:g,sending:h,editComment:E,editReply:T,getCommentState:S,updateCommentState:x,clearCommentState:C}=(0,b.useContext)(ZI),A=(0,w.qg)(),R=(({comment:e,reply:t,isEditingComment:r,isEditingReply:n})=>(0,_.isNil)(e)?"comment/new":r?ON(e):n?SN(e,t):(e=>`comment/${e.commentId}/reply/new`)(e))({comment:o,reply:l,isEditingComment:s,isEditingReply:c}),I=(({comment:e,reply:t,isEditingComment:r,isEditingReply:n})=>{const a=r?e:n?t:null,{content:i="",namedUsers:o=[]}=a||{};return{value:xN(i,o),plainTextValue:i,mentions:o}})({comment:o,reply:l,isEditingComment:s,isEditingReply:c}),{value:N=I.value,plainTextValue:P=I.plainTextValue,mentions:D=I.mentions}=S(r,R),k=""!==I.value.trim(),L=""!==N.trim(),U=m||L||k,j=null==o?void 0:o.status,F=()=>{null==u||u(),C(r,R)};(0,b.useEffect)((()=>{i&&i.current.forceUpdate()}),[i,U]);const M=p?"small":"medium";return v().createElement(PI(),{className:O()(d.root,t)},v().createElement("form",{onSubmit:e=>(e.preventDefault(),(0,_.cond)([[(0,_.always)(!o),()=>g({content:P,namedUsers:D,objectType:a,uri:r,relatedObjectUris:n})],[(0,_.always)(s),()=>E({content:P,namedUsers:D,commentId:o.commentId,objectType:a,replies:o.replies,relatedObjectUris:n,uri:r})],[(0,_.always)(c),()=>T({content:P,namedUsers:D,commentId:o.commentId,replyId:l.replyId})],[_.T,()=>y({content:P,namedUsers:D,commentId:o.commentId,action:"open"===o.status?"none":"reopen",uri:r})]])().then(F).catch(console.log)),className:d.form},v().createElement(PI(),{className:d.main},!p&&v().createElement(kN,{classes:{root:d.avatar}},A),v().createElement(MN,{className:d.textField,disabled:h,onChange:(e,t,n)=>x(r,R,{value:e,plainTextValue:t,mentions:n}),inputRef:e,value:N,onFocus:()=>f(!0),onBlur:()=>f(!1),placeholder:BN(j)})),U&&v().createElement(PI(),{className:d.buttons},v().createElement(Wh(),{className:d.button,variant:"contained",color:"primary",disabled:!L||h,type:"submit",size:M},((e,t,r)=>t||r?li().text("Edit"):"open"===e||"resolved"===e?li().text("Reply"):li().text("Comment"))(j,s,c)),v().createElement(Wh(),{disabled:h,onClick:()=>F(),className:d.button,variant:"outlined",color:"primary",size:M},li().text("Cancel")))))},HN=(0,wp.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"}}))),YN=({onReply:e,className:t,uri:r,comment:n,relatedObjectUris:a,objectType:i})=>{const o=HN(),l=(0,b.useRef)(),s=(0,w.qg)(),{commentId:c,createdBy:u,createdTime:p,status:d}=n,m="resolved"===d,f=u===s,{resolveThread:y,reOpenThread:g,sending:h,deleteComment:E,updateCommentState:T,getCommentState:O}=(0,b.useContext)(ZI),S=ON(n),{isEditing:x}=O(r,S),C=(0,b.useCallback)((e=>T(r,S,{isEditing:e})),[S,T,r]);bN(l,x);const A=(0,b.useMemo)((()=>m?[{text:li().text("Delete"),onClick:()=>E({uri:r,commentId:c})}]:[{text:li().text("Edit"),onClick:()=>C(!0)},{text:li().text("Delete"),onClick:()=>E({uri:r,commentId:c})}]),[c,E,m,C,r]),R=v().createElement(zN,{inputRef:l,uri:r,relatedObjectUris:a,objectType:i,onCancel:()=>C(!1),isEditingComment:x,comment:n});return v().createElement(PI(),{className:t},v().createElement(PI(),{className:o.header},v().createElement(kN,{classes:{root:o.avatar}},u),v().createElement(PI(),{width:"100%"},v().createElement(bf(),{className:o.username},u)),v().createElement(bf(),{className:o.createdAt},TN(p)),f&&v().createElement(EN,{buttonComponent:Ed.k,buttonProps:{icon:Pd(),tooltipTitle:li().text("Open menu")},popoverProps:{PopoverClasses:{root:o.dropdownMenu}},menuItems:A,menuId:"collaboration-comment-menu"})),v().createElement(PI(),{className:o.body},v().createElement(RN,{comment:n,className:o.commentTarget}),x?R:v().createElement(NN,{comment:n,className:o.message}),v().createElement(PI(),{className:o.buttons},v().createElement(ty(),{className:o.button,onClick:e,component:"button",underline:"hover"},li().text("Reply")),!m&&v().createElement(ty(),{disabled:h,className:o.button,onClick:()=>{y({commentId:c,uri:r})},component:"button",underline:"hover"},li().text("Resolve")),m&&v().createElement(ty(),{disabled:h,className:o.button,onClick:()=>{g({commentId:c,uri:r})},component:"button",underline:"hover"},li().text("Re-open")))))},WN=(0,wp.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"}}))),GN=({className:e,reply:t,uri:r,comment:n,popperRef:a})=>{const i=(0,b.useRef)(),o=(0,w.qg)(),{createdBy:l,action:s,createdTime:c}=t,u=l===o&&"resolved"!==n.status,{deleteReply:p,updateCommentState:d,getCommentState:m}=(0,b.useContext)(ZI),f=SN(n,t),{isEditing:y}=m(r,f),g=(0,b.useCallback)((e=>d(r,f,{isEditing:e})),[f,d,r]);bN(i,y);const h=WN(),E=(0,b.useMemo)((()=>[{text:li().text("Edit"),onClick:()=>g(!0)},{text:li().text("Delete"),onClick:()=>p({uri:r,commentId:n.commentId,reply:t})}]),[p,r,n.commentId,t,g]),T=v().createElement(zN,{inputRef:i,popperRef:a,uri:r,onCancel:()=>g(!1),isEditingReply:y,reply:t,comment:n});return v().createElement(PI(),{className:O()(h.root,e)},v().createElement(kN,{classes:{root:h.avatar}},l),v().createElement(PI(),{className:h.replyArea},v().createElement(PI(),{className:h.header},v().createElement(bf(),{className:h.username},l),"resolve"===s&&v().createElement(bf(),{className:h.marked},li().text("Marked as resolved")),"reopen"===s&&v().createElement(bf(),{className:h.marked},li().text("Re-opened"))),"resolve"!==s&&(y?T:v().createElement(NN,{className:h.message,comment:t})),v().createElement(bf(),{className:h.createdAt},TN(c))),u&&v().createElement(EN,{buttonComponent:Ed.k,buttonProps:{icon:Pd(),tooltipTitle:li().text("Open menu")},menuItems:E,menuId:"collaboration-comment-menu"}))},qN=(0,wp.Z)((()=>({root:{maxWidth:"100%",padding:"8px 4px 10px 16px"},messages:{},repliedComment:{marginBottom:"2px"},replies:{marginLeft:"40px"},sendMessageArea:{marginLeft:"40px"},comment:{}}))),ZN=(0,b.memo)((({uri:e,relatedObjectUris:t,objectType:r,classes:n,popperRef:a,messagesRef:i,comment:o})=>{const l=(0,b.useRef)(),s=qN({classes:n}),c=v().createElement(zN,{className:s.sendMessageArea,inputRef:l,popperRef:a,uri:e,relatedObjectUris:t,objectType:r,comment:o});return v().createElement(PI(),{className:s.root},o&&v().createElement(v().Fragment,null,v().createElement("div",{className:s.messages,ref:i},v().createElement(YN,{comment:o,uri:e,onReply:()=>{l.current.focus()},className:s.comment,relatedObjectUris:t,objectType:r}),v().createElement(PI(),{className:s.replies},o.replies.map((t=>v().createElement(GN,{key:t.replyId,className:s.repliedComment,reply:t,uri:e,comment:o}))))),c),!o&&c)})),$N=(0,wp.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:({hasScroll:e})=>({marginLeft:"16px",marginRight:e?"2px":"8px"}),replies:({hasScroll:e})=>({marginLeft:"8px",marginRight:e?"2px":"8px"}),sendMessageArea:({hasScroll:e,scrollWidth:t})=>({marginLeft:"8px",marginRight:e?t+2:"8px"}),messages:{maxHeight:"400px",overflowY:"auto"}}))),KN=({uri:e,relatedObjectUris:t,objectType:r,anchorEl:n,onClose:a,open:i,comment:o})=>{const[l,s]=(0,b.useState)(0),c=$N({scrollWidth:l,hasScroll:0!==l}),u=(0,b.useRef)(null),{resolveThread:p,loading:d,sending:m}=(0,b.useContext)(ZI),f=1+(null==o?void 0:o.replies.length);return v().createElement(uN,{popperRef:u,anchorEl:n,open:i,placement:"right-start",onClose:a,className:c.popper},v().createElement(PI(),{className:c.header},v().createElement(PI(),{className:c.headerInfo},v().createElement(bf(),{className:c.title},li().text("Comments")),o&&!d&&v().createElement(bf(),{className:c.counter},li().number(f)," ",1===f?li().text("item"):li().text("items"))),o&&!d&&v().createElement(Ed.k,{className:c.resolveButton,size:"S",onClick:()=>{p({commentId:o.commentId,uri:e})},disabled:m,showForDisabled:!0,tooltipTitle:li().text("Resolve"),icon:gm(),color:"primary"})),!d&&v().createElement(ZN,{popperRef:u,messagesRef:e=>{e&&s(e.offsetWidth-e.clientWidth)},classes:{root:c.collaborationItem,replies:c.replies,sendMessageArea:c.sendMessageArea,messages:c.messages,comment:c.comment},uri:e,relatedObjectUris:t,objectType:r,comment:o}))},XN=(0,wp.Z)((()=>({root:{display:"flex",alignItems:"start"},addButton:{visibility:"hidden","&$showAlways":{visibility:"visible"},".commentsContainerVisibilityArea:hover &":{visibility:"visible"}},showAlways:{}}))),QN=({className:e,uri:t,objectType:r,relatedObjectUris:n,onChangePopupVisibility:a,allowOnlyOneComment:i=!1,showAlways:o=!1})=>{const l=XN(),[s,c]=(0,b.useState)(null),[u,p]=(0,b.useState)(!1),d=u&&Boolean(s),{currentComment:m,commentsMap:f,getComment:y,clearCurrentComment:g,objectTypes:h}=(0,b.useContext)(ZI),E=!!f&&(!h||h.includes(r)),T=((null==f?void 0:f[t])||[]).filter((({status:e})=>"resolved"!==e)).reverse(),S=!i||i&&0===T.length,x=null===m&&d;(0,dE.D)((()=>{a&&a(d)}),[d]);const C=(0,b.useContext)(GI),w=(0,b.useMemo)((()=>C?[...n,...C]:n),[C,n]);return E&&v().createElement("div",{className:O()(l.root,e)},S&&v().createElement(aN,{className:O()(l.addButton,{[l.showAlways]:o||x}),onClick:e=>{c(e.currentTarget),p(!0)}}),T.map((({replies:e,commentId:t})=>v().createElement(tN,{ref:t===(null==m?void 0:m.commentId)?c:null,key:t,onClick:()=>(e=>{y(e),p(!0)})(t)},1+e))),v().createElement(KN,{anchorEl:s,open:d,onClose:()=>{c(null),g(),p(!1)},uri:t,relatedObjectUris:w,objectType:r,comment:m}))},JN=(0,wp.Z)({label:{color:"rgba(0,0,0,0.6)",fontSize:"13px",lineHeight:"16px"}});function eP(){return eP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},eP.apply(null,arguments)}const tP=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","isRequired","className"]);const i=JN();return v().createElement(bf(),eP({className:O()(i.label,n),component:"span"},a),t,r&&v().createElement(ad,null))},rP=v().createContext(null);rP.displayName="EntityContext";const nP=(0,wp.Z)((e=>({container:{height:"16px",borderColor:(0,wm.alpha)(e.palette.primary.main,.54)},label:{paddingLeft:"4px",paddingRight:"4px",fontSize:"10px",lineHeight:"11px",color:e.palette.primary.main}}))),aP=(0,ld.T)(ug()),iP=({className:e,attributeType:t,nonOvValues:r=[],nonOvTotal:n})=>{const a=nP(),i=(0,w.ax)("openEntity"),o=((e,t,r)=>{var n;const a=null==t||null===(n=t[0])||void 0===n?void 0:n.uri,i=a?(0,S.getEntityUriFromAttributeUri)(a):null;if(i&&(0,S.isEntityUri)(i)){const t=(0,S.getEntityUriFromAttributeUri)(r.uri);if(!e||e.type===t)return{uri:i,type:t};const n=(0,S.getParentUri)(a),o=(0,S.findAttributeValueByUri)(e,n);return{uri:(0,S.getReferencedEntityUriFromAttrValue)(o),type:t}}return e?{uri:e.uri,type:e.type}:null})((0,b.useContext)(rP),r,t),l=(0,w.fC)(null==o?void 0:o.type),s=(0,b.useCallback)((()=>{i({uri:o.uri,screen:"sources"})}),[i,o]);if(!n)return null;const c=r.length?r.map(((e,r)=>v().createElement("div",{key:r},(0,S.isComplexAttribute)(t)?(0,S.getLabel)(e.label):v().createElement(Hd.x,{value:(0,S.getAttributeValue)(e),dataTypeDefinition:(0,S.getAttrDataTypeDefinition)(t),rich:!1})))):null;return v().createElement(aP,{tooltipTitle:c,tooltipPlacement:"bottom",label:`+ ${n}`,variant:"outlined",onClick:null!=o&&o.uri&&l?s:void 0,classes:{root:O()(a.container,e),label:a.label}})};function oP(){return oP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},oP.apply(null,arguments)}const lP=e=>v().createElement("svg",oP({width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgDescription"},e),v().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})),sP=v().createContext({showDescription:!1,showNavigateToGraph:!0});sP.displayName="FeaturesContext";const cP=(0,wp.Z)((()=>({icon:{display:"inline-flex",marginLeft:"8px",verticalAlign:"middle"}}))),uP=({className:e,description:t})=>{const{showDescription:r}=(0,b.useContext)(sP),n=cP();return t&&r?v().createElement(rg(),{title:t,placement:"bottom"},v().createElement("span",{"data-reltio-id":"reltio-description-icon",className:O()(n.icon,e)},v().createElement(lP,null))):null};var pP=r(87558);const dP=(0,r(87171).k)({unmaskedAttributes:{},unmaskAttributeValue:void 0,maskAttributeValue:void 0}),mP=e=>(0,pP.S)(dP,e),fP=v().createContext({appearance:void 0,attributes:void 0,roles:void 0,tags:void 0});fP.displayName="HistoryDiffContext";const yP=v().createContext({highlightedValuesUris:[],highlightedClassName:""});function gP(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}yP.displayName="HighlightedValuesContext";const hP=(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 i=(null==e?void 0:e.attributes)||(null==e?void 0:e.analyticsAttributes)||[];return a.length&&(i=i.filter((e=>a.includes(e.uri)))),i.reduce(((e,a)=>{const i=EP(t[a.name],n,r);return i&&i.length&&(Array.isArray(i[0])?e.push({[a.uri]:i[0]}):e.push({[a.uri]:i})),e}),[])},EP=(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,i=(0,S.findAttributeTypeByUri)(t,n.type);a&&"object"!=typeof a&&(0,S.isOv)(n)?e.push(bP(a,i)):a&&"object"==typeof a&&!Array.isArray(a)&&e.push(hP(i,a,r,t))}return e}),[])},bP=(e,t)=>{switch(null==t?void 0:t.type){case S.DataTypes.TYPE_DATE:return new Date(e).getTime();case S.DataTypes.TYPE_TIMESTAMP:return isNaN(Number(e))?new Date(e).getTime():new Date(Number(e)).getTime();default:return e}};function vP(){return vP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vP.apply(null,arguments)}const TP=e=>v().createElement("svg",vP({width:11,height:11,viewBox:"0 0 11 11","data-reltio-id":"SvgPivotingIcon"},e),v().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"})),OP=(0,wp.Z)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}}))),SP=(0,b.forwardRef)((({value:e,attributeType:t,children:r,className:n,onClick:a},i)=>{const o=OP(),{generatePivotingUrl:l}=(0,b.useContext)(jd),s=l({uiPath:(0,w.Qh)(),uri:t.uri,value:JSON.stringify(e)}),c=(0,b.useCallback)((e=>{(0,xp.rR)(e)||(a(),e.preventDefault()),e.stopPropagation()}),[a]);return v().createElement("a",{ref:i,href:s,onClick:c,className:O()(o.link,n)},r)}));SP.displayName="PivotingUriLink";const xP=(0,wp.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"}}))),CP=({attributeType:e,label:t,entities:r,generatedValue:n,onSeeAllClick:a,total:i})=>{const o=xP(),l=i>6,s=Boolean(t);return v().createElement("div",{className:o.container},v().createElement("div",{className:o.header},v().createElement("div",{className:o.title},li().text("Pivot profiles")),v().createElement("div",{className:o.divider}),v().createElement("div",{className:o.headerCount},li().number(i,"0,0")+" "+(1===i?li().text("item"):li().text("items")))),s&&v().createElement("div",{className:o.entityTypeLabel},t),v().createElement("div",{className:o.body},r.map((e=>v().createElement("div",{key:e.uri,className:o.entityContainer},v().createElement(A,{entity:e,avatarClassName:o.profileIcon}),v().createElement(Md,{className:o.entityLabel,value:(0,S.getEntityUriForLink)(e)},(0,S.getLabel)(e.label)))))),l&&v().createElement("div",{className:o.footer},v().createElement(SP,{value:n,attributeType:e,className:o.seeAllButton,onClick:a},li().text("See all"))))},wP=(0,wp.Z)((e=>({icon:{marginRight:"8px",verticalAlign:"middle",width:"12px",height:"12px"},content:{color:e.palette.primary.main,cursor:"pointer",lineHeight:"16px"}}))),AP=(0,wp.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"}}}),RP=({value:e,attributeType:t,children:r,className:n})=>{const a=AP(),i=wP(),o=(0,b.useContext)(DI)||[],l=(0,w.ax)("openPivotingPerspective"),s=(0,w.AH)()||{},c=(0,S.isNested)(t)?hP(t,e.value,o,s):bP(e.lookupCode||e.value,t),u=o.some((({uri:e})=>e===t.uri))&&(Array.isArray(c)&&c.length||!Array.isArray(c)&&!(0,_.isNil)(c)),p=o.find((({uri:e})=>e===t.uri)),d=null==p?void 0:p.popup,m=u?Array.isArray(c)?c.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[(0,S.getLastUriPart)(e),t]))))):((e,t)=>[{[e.name]:t}])(t,c):void 0,f=()=>{l({value:m,attributeType:t})},{entities:y,total:g,loadPivotingData:h}=(({value:e,attributeType:t,entityType:r})=>{const[n,a]=(0,b.useState)([]),[i,o]=(0,b.useState)(0),l=(0,Th._)(),s=(0,w.eh)(),c=(0,w.mU)(),u=r||(null==s?void 0:s.type),p=(0,b.useMemo)((()=>(0,S.convertPivotingValueToSearchFilters)({value:e,attributeType:t,entityType:u})),[t,u,e]),d=(0,b.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){gP(e,t,r[t])}))}return e}({max:6,sort:"label"},c||{})),[c]),m=(0,b.useCallback)((()=>{l(Promise.all([(0,S.getFilteredEntities)({filters:p,options:d}),(0,S.getTotals)({filters:p,options:d})])).then((e=>{const[t,{total:r}]=e;a(Array.isArray(t)?t:[]),o(r)})).catch((()=>{a([]),o(0)}))}),[p,d,l]);return{entities:n,total:i,loadPivotingData:m}})({attributeType:t,value:c,entityType:null==d?void 0:d.entityType});return u?v().createElement(rg(),{arrow:!0,placement:"right-start",classes:a,disableInteractive:!1,onOpen:h,title:v().createElement(CP,{generatedValue:m,attributeType:t,label:null==d?void 0:d.label,onSeeAllClick:f,entities:y,total:g})},v().createElement("span",{className:n},v().createElement(TP,{className:i.icon}),v().createElement(SP,{onClick:f,className:i.content,value:m,attributeType:t},r))):v().createElement(v().Fragment,null,r)};var _P=r(78577),IP=r.n(_P),NP=r(46157),PP=r.n(NP);const DP=(0,wp.Z)((e=>({icon:{color:e.palette.text.secondary,fontSize:18},switcherWrapper:{verticalAlign:"middle",marginLeft:8,width:"16px",height:"16px"}}))),kP=({className:e,isMasked:t,isUnmasking:r,onToggleMasking:n})=>{const a=DP(),i=t?li().text("Show"):li().text("Hide");return r?v().createElement(dm(),{size:16,className:O()(e,a.switcherWrapper)}):v().createElement(rg(),{key:String(t),title:i},v().createElement(Hh(),{"aria-label":i,onClick:n,className:O()(e,a.switcherWrapper)},t?v().createElement(PP(),{className:a.icon}):v().createElement(IP(),{className:a.icon})))};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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){UP(e,t,r[t])}))}return e}function UP(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jP=(0,wp.Z)((e=>({root:{display:"flex",alignItems:"start",justifyContent:"space-between"},commentsContainer:{height:"15px",marginRight:"-4px"},attributeValue:{verticalAlign:"middle",wordBreak:"break-all"},updateAttribute:LP({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},S.historyPalettes[S.HistoryOperations.updateAttribute],{"& > a":{color:S.historyPalettes[S.HistoryOperations.updateAttribute].color}}),insertAttribute:LP({width:"fit-content"},S.historyPalettes[S.HistoryOperations.insertAttribute],{"& > a":{color:S.historyPalettes[S.HistoryOperations.insertAttribute].color}}),deleteAttribute:LP({width:"fit-content",padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},S.historyPalettes[S.HistoryOperations.deleteAttribute],{"& > a":{color:S.historyPalettes[S.HistoryOperations.deleteAttribute].color}}),multilineAttribute:{width:"fit-content"},ovFalse:e.inactive}))),FP=({className:e,attributeType:t=null,attributeValue:r,inlined:n})=>{const{isUnmaskingNeeded:a,isMasked:i,toggleMasking:o,attributeValue:l,isUnmasking:s}=(({attributeType:e,attributeValue:t})=>{const r=mP((({unmaskAttributeValue:e})=>e)),n=mP((({maskAttributeValue:e})=>e)),{attributeValue:a,isUnmasked:i=!1,loading:o=!1}=(l=t.uri,mP((({unmaskedAttributes:e})=>e[l]))||{});var l;const s=r&&n&&!!e.masking,c=(0,b.useCallback)((()=>s?r(t.uri):Promise.resolve()),[r,t.uri,s]),u=(0,b.useCallback)((()=>{i?n(t.uri):c()}),[t.uri,i,n,c]);return{isUnmaskingNeeded:s,isMasked:!i,toggleMasking:u,isUnmasking:o,unmask:c,attributeValue:s&&i&&a||t}})({attributeType:t,attributeValue:r}),c=jP(),{highlightedValuesUris:u=[],highlightedClassName:p}=(0,b.useContext)(yP),{appearance:d}=(0,b.useContext)(fP),m=(0,S.getHistoryAppearanceByUri)(l.uri,d),f=(0,S.getHistoryAttributeClassName)(m),y=(0,b.useMemo)((()=>v().createElement(Hd.x,{value:(0,S.getAttributeValue)(l),dataTypeDefinition:(0,S.getAttrDataTypeDefinition)(t)})),[l,t]),g=(0,S.getObjectTypeByAttributeUri)(l.uri),h=a&&v().createElement(kP,{isMasked:i,onToggleMasking:o,isUnmasking:s});return n||f?v().createElement("div",{className:O()(e,{[p]:u.includes(l.uri)})},v().createElement(RP,{value:l,attributeType:t,key:l.uri,className:O()({[c.multilineAttribute]:!n})},v().createElement("span",{className:O()(c.attributeValue,c[f],{[c.ovFalse]:!(0,S.isOv)(l)}),"data-reltio-id":"reltio-attribute-value"},y,h))):v().createElement("div",{className:O()(e,c.root,WI,{[p]:u.includes(l.uri)})},v().createElement(RP,{value:l,attributeType:t,key:l.uri},v().createElement("span",{className:O()(c.attributeValue,{[c.ovFalse]:!(0,S.isOv)(l)}),"data-reltio-id":"reltio-attribute-value"},y,h)),v().createElement(QN,{className:c.commentsContainer,uri:l.uri,relatedObjectUris:(0,S.createRelatedObjectUris)(g,{uri:l.uri}),objectType:g}))};var MP=r(84419),VP=r.n(MP);const BP=(0,wp.Z)({expandButton:{"&:hover":{backgroundColor:"transparent"}},expandIcon:{transition:"transform .15s ease"},expanded:{transform:"rotate(90deg)"}});function zP(){return zP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zP.apply(null,arguments)}const HP=e=>{const t=BP(),{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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["expanded","className"]);return v().createElement(Cp.T,zP({icon:VP(),size:"XXS",disableRipple:!0,iconClassName:O()(t.expandIcon,{[t.expanded]:r}),className:O()(n,t.expandButton),"data-reltio-id":"arrow-expand-button"},a))},YP=(0,wp.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 WP(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const GP=({attributeTypesList:e,attributeValue:t,label:r,expanded:n=!1,children:a,showNonOv:i,attributeType:o,classes:l,LabelRenderer:s,RightSlot:c})=>{const u=YP(),p=t.uri,[d,m]=(0,b.useState)(!1),{highlightedValuesUris:f=[],highlightedClassName:y}=(0,b.useContext)(yP);(0,b.useEffect)((()=>{m(n)}),[n]);const g=(e||[]).some((e=>(0,S.isAnalyticAttribute)(e))),h=(0,b.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){WP(e,t,r[t])}))}return e}({attributes:g?null:t.value,analyticsAttributes:g?t.value:null},(0,S.isSpecialAttribute)(o)?t.value:{})),[t,g,o]),E=(0,S.getObjectTypeByAttributeUri)(t.uri);return v().createElement("div",{className:u.complexContainer},v().createElement("div",{className:O()(u.labelContainer,WI)},v().createElement(HP,{onClick:()=>m((e=>!e)),expanded:d}),s?v().createElement(s,{attributeType:o,attributeValue:t}):v().createElement(v().Fragment,null,v().createElement(bf(),{component:"span",variant:"body2",classes:{body2:u.label},className:O()({[y]:f.includes(t.uri),[u.ovFalse]:!(0,S.isOv)(t)}),"data-reltio-id":"reltio-attribute-complex-label"},r),v().createElement("div",{className:u.spacer}),c&&v().createElement(c,{attributeType:o,attributeValue:t}),v().createElement(QN,{uri:t.uri,relatedObjectUris:(0,S.createRelatedObjectUris)(E,{uri:t.uri}),objectType:E}))),d&&v().createElement(kF,{attrTypes:e,entity:h,drawLines:!0,parentUri:p,showNonOv:i,classes:l},a))};var qP=r(29195);function ZP(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){$P(e,t,r[t])}))}return e}function $P(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const KP=(0,wp.Z)({label:{textDecoration:"none",verticalAlign:"middle"},updateAttribute:ZP({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},S.historyPalettes[S.HistoryOperations.updateAttribute]),insertAttribute:ZP({width:"fit-content"},S.historyPalettes[S.HistoryOperations.insertAttribute]),deleteAttribute:ZP({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},S.historyPalettes[S.HistoryOperations.deleteAttribute]),pivotingTooltip:{marginLeft:"4px"}});function XP(){return XP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},XP.apply(null,arguments)}const QP=(0,b.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=KP(),{appearance:i}=(0,b.useContext)(fP),o=(0,b.useMemo)((()=>{const e=(0,S.getHistoryAppearanceByUri)(t.uri,i),n=(0,S.getHistoryAttributeClassName)(e),o=t.label?t.label:(0,S.evaluateDeepEntityLabel)(t,r.dataLabelPattern);return v().createElement(RP,{className:a.pivotingTooltip,value:t,attributeType:r},v().createElement(PI(),{component:"span",className:O()(a[n],a.label)},v().createElement(qP.b,{text:(0,S.getLabel)(o)})))}),[i,a,t,r]);return v().createElement(GP,XP({label:o,attributeValue:t,attributeTypesList:(0,S.getAttributeTypeSubAttributes)({},r),attributeType:r},n))}));var JP=r(24217),eD=r(16782);const tD=(0,wp.Z)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}})));function rD(){return rD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rD.apply(null,arguments)}const nD=e=>{const t=tD(),r=(0,eD.GV)(),{href:n,className:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["href","className"]),o=O()(t.link,a);return r&&n?v().createElement(JP.rU,rD({to:n.replace(window.location.origin,""),className:o},i)):v().createElement("a",rD({href:n,className:o},i))};function aD(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){iD(e,t,r[t])}))}return e}function iD(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const oD=(0,wp.Z)((e=>({relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary},updateAttribute:aD({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},S.historyPalettes[S.HistoryOperations.updateAttribute]),insertAttribute:aD({width:"fit-content"},S.historyPalettes[S.HistoryOperations.insertAttribute]),deleteAttribute:aD({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},S.historyPalettes[S.HistoryOperations.deleteAttribute]),ovFalse:e.inactive})));function lD(){return lD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lD.apply(null,arguments)}const sD=(0,b.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=oD(),i=(0,w.AH)(),o=(0,w.Qh)(),l=(0,S.getReferencedEntityUriFromAttrValue)(t),s=(0,b.useMemo)((()=>(0,S.getAttributeTypeSubAttributes)(i,r)),[r,i]),{appearance:c}=(0,b.useContext)(fP),{generateEntityUrl:u}=(0,b.useContext)(jd),p=(0,b.useMemo)((()=>{const e=(0,S.getHistoryAppearanceByUri)(t.uri,c),r=(0,S.getHistoryAttributeClassName)(e),n=null!=l&&l.startsWith("changeRequests")?"dcrReview":"profile";return v().createElement(nD,{href:(0,S.isEmptyValue)(c)?u({uiPath:o,uri:l,screen:n}):void 0,className:O()(a[r],{[a.ovFalse]:!(0,S.isOv)(t)})},v().createElement(qP.b,{text:(0,S.getLabel)(t.label)}),t.relationshipLabel&&v().createElement("span",{className:a.relationshipLabel},v().createElement(qP.b,{text:t.relationshipLabel})))}),[t,c,o,l,a,u]);return v().createElement(GP,lD({attributeTypesList:s,attributeValue:t,label:p,attributeType:r},n))}));sD.displayName="ReferenceAttribute";const cD=e=>{const{attributeType:t}=e;return class{static build(e,t={}){switch(e.type){case S.DataTypes.TYPE_NESTED:return v().createElement(QP,t);case S.DataTypes.TYPE_REFERENCE:return v().createElement(sD,t);default:return v().createElement(FP,t)}}}.build(t,e)};function uD(){return uD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},uD.apply(null,arguments)}const pD=e=>v().createElement("svg",uD({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgControlAttribute"},e),v().createElement("mask",{id:"ControlAttribute_svg__a",fill:"#fff"},v().createElement("path",{d:"M10.966 9.203a3.2 3.2 0 11-.018-2.449l-1.375.581a1.707 1.707 0 10.01 1.307l1.383.561z"})),v().createElement("path",{d:"M10.966 9.203a3.2 3.2 0 11-.018-2.449l-1.375.581a1.707 1.707 0 10.01 1.307l1.383.561z",stroke:"#72828B",strokeWidth:4,mask:"url(#ControlAttribute_svg__a)"}),v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.297 8.965a4.804 4.804 0 004.068 3.793v1.61a6.403 6.403 0 01-5.693-5.403h1.625zm4.068-5.724a4.803 4.803 0 00-4.124 4.124h-1.61a6.402 6.402 0 015.734-5.734v1.61zm5.393 4.124a4.804 4.804 0 00-3.793-4.068V1.672a6.403 6.403 0 015.404 5.693h-1.61zm-.055 1.6a4.806 4.806 0 01-3.738 3.738v1.625a6.405 6.405 0 005.363-5.363h-1.625z",fill:"#72828B"})),dD=(0,wp.Z)({icon:{display:"inline-flex",marginLeft:"8px",verticalAlign:"middle"}});function mD(){return mD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mD.apply(null,arguments)}const fD=(0,b.forwardRef)(((e,t)=>v().createElement("span",mD({},e,{ref:t}),v().createElement(pD,null))));fD.displayName="ControlAttributeForwarded";const yD=(0,ld.T)(fD),gD=()=>{const e=dD();return v().createElement(yD,{"data-reltio-id":"reltio-control-attribute-icon",tooltipTitle:li().text("This is a control attribute. Changing this value will affect availability of other conditional attributes."),className:e.icon})};function hD(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ED(e,t,r[t])}))}return e}function ED(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bD="13px",vD="16px",TD={titleRow:{display:"inline-block",minHeight:"16px"},title:{wordBreak:"break-all",verticalAlign:"middle"},ovIcon:{marginLeft:"8px",textIndent:0},descriptionIcon:{textIndent:0}},OD=(0,wp.Z)({paddingWrapper:{paddingTop:"3px",paddingBottom:"5px","&:last-child":{paddingBottom:"2px"}},paddingWrapperWithLines:{paddingBottom:"1px","&:last-child":{paddingBottom:"2px"}}}),SD=(0,wp.Z)(hD({wrapper:{fontSize:bD,lineHeight:vD},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"}},TD)),xD=(0,wp.Z)(hD({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start",fontSize:bD,lineHeight:vD},attribute:{"&:last-child":{marginBottom:0},paddingLeft:"4px",paddingRight:"4px",marginLeft:"5px",marginBottom:"4px",whiteSpace:"pre-wrap",wordBreak:"break-word"},attributes:{alignSelf:"stretch"},titleRow:hD({},TD.titleRow,{marginBottom:"3px"})},TD)),CD=({value:e,nonVisibleValues:t,attributeType:r,showNonOv:n,totalNonVisibleValues:a,classes:i})=>{const o=SD(),{label:l,description:s}=r,c=(0,w.Ws)(),u=(0,b.useMemo)((()=>c.includes(r.uri)),[c,r.uri]),p=(0,S.getObjectTypeByAttributeUri)(e.uri);return v().createElement("div",{"data-reltio-id":"one-line-renderer",className:O()(o.collaborationWrapper,WI)},v().createElement("div",{className:O()(o.titleRow,o.wrapper)},v().createElement(tP,{label:l,className:O()(o.title,null==i?void 0:i.title),"data-reltio-id":"reltio-attribute-label"}),v().createElement(uP,{description:s,className:o.descriptionIcon}),u&&v().createElement(gD,null),v().createElement(iP,{nonOvValues:t,attributeType:r,className:o.ovIcon,nonOvTotal:a}),v().createElement(cD,{className:O()(o.attribute,null==i?void 0:i.content),attributeValue:e,attributeType:r,showNonOv:n,inlined:!0,classes:i})),v().createElement(QN,{uri:e.uri,relatedObjectUris:(0,S.createRelatedObjectUris)(p,{uri:e.uri}),objectType:p}))};var wD=r(33062),AD=r.n(wD);const RD=(0,wp.Z)({link:{display:"flex",marginTop:4},icon:{fontSize:"1rem"}}),_D=({moreNumber:e,valueNumber:t,onClick:r})=>{const n=RD();return v().createElement(ty(),{"data-reltio-id":"show-more",component:"button",variant:"caption",className:n.link,onClick:r,underline:"none"},v().createElement(AD(),{className:n.icon}),e&&t?li().text("Show ${moreNumber} more of remaining ${valueNumber} value",{moreNumber:e,valueNumber:t}):li().text("Show more"))};var ID=r(86800),ND=r.n(ID);const PD=(0,wp.Z)({link:{display:"flex",marginTop:4},icon:{fontSize:"1rem"}}),DD=({onClick:e})=>{const t=PD();return v().createElement(ty(),{component:"button",variant:"caption",className:t.link,onClick:e,underline:"none"},v().createElement(ND(),{className:t.icon}),li().text("Show less"))},kD=({max:e,values:t,nonVisibleValues:r,totalVisibleValues:n,attributeType:a,parentUri:i,requestNextPageOfAttributeValues:o,showNonOv:l,totalNonVisibleValues:s,classes:c})=>{const u=xD(),[p,d]=(0,b.useState)(e),m=(0,w.Ws)(),f=(0,b.useMemo)((()=>m.includes(a.uri)),[m,a.uri]),y=e<n,g=y&&p<n,h=y&&p>=n,{label:E,description:T}=a,S=t.slice(0,p),x=n-p;return v().createElement("div",{"data-reltio-id":"multi-line-renderer",className:u.wrapper},v().createElement("div",{className:u.titleRow},v().createElement(tP,{label:E,className:O()(u.title,null==c?void 0:c.title),"data-reltio-id":"reltio-attribute-label"}),v().createElement(uP,{description:T}),f&&v().createElement(gD,null),v().createElement(iP,{nonOvValues:r,attributeType:a,className:u.ovIcon,nonOvTotal:s})),v().createElement("div",{className:u.attributes},S.map((e=>v().createElement(cD,{key:e.uri,className:O()(u.attribute,null==c?void 0:c.content),attributeValue:e,attributeType:a,showNonOv:l,classes:c})))),g&&v().createElement(_D,{moreNumber:(0,_.min)(e,x),valueNumber:x,onClick:()=>{t.length<n&&o({parentUri:i,attributeTypeUri:a.uri,attributeTypeName:a.name,values:t,defaultMaxValues:e}),d(p+e)}}),h&&v().createElement(DD,{onClick:()=>{d(e)}}))};var LD=r(88941),UD=r.n(LD);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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const MD=(0,wp.Z)({attributeValue:{verticalAlign:"middle"},insertAttribute:jD({width:"fit-content"},S.historyPalettes[S.HistoryOperations.insertAttribute]),deleteAttribute:jD({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},S.historyPalettes[S.HistoryOperations.deleteAttribute])}),VD=({value:e})=>{const t=MD(),{appearance:r}=(0,b.useContext)(fP),n=(0,w.AH)(),a=(0,S.getHistoryAppearanceBySpecialAttributeValue)("roles",e,r),i=(0,S.getHistoryAttributeClassName)(a);return v().createElement("span",{className:O()(t.attributeValue,t[i])},(0,S.getRoleLabel)(n,e))},BD=({className:e,values:t,Component:r,dataReltioId:n})=>v().createElement("div",{className:e,"data-reltio-id":n},t.map(((e,n)=>v().createElement(b.Fragment,{key:e},v().createElement(r,{value:e}),n<t.length-1&&", ")))),zD=({className:e,values:t})=>v().createElement(BD,{values:t,className:e,dataReltioId:"reltio-attribute-value",Component:VD});function HD(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){YD(e,t,r[t])}))}return e}function YD(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const WD=(0,wp.Z)({attributeValue:{verticalAlign:"middle"},insertAttribute:HD({width:"fit-content"},S.historyPalettes[S.HistoryOperations.insertAttribute]),deleteAttribute:HD({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},S.historyPalettes[S.HistoryOperations.deleteAttribute])}),GD=({value:e})=>{const t=WD(),r=(0,b.useContext)(rP),{appearance:n}=(0,b.useContext)(fP),{generateTagUrl:a}=(0,b.useContext)(jd),i=(0,w.eh)(),o=(0,w.Qh)(),l=(0,S.getHistoryAppearanceBySpecialAttributeValue)("tags",e,n),s=(0,S.getHistoryAttributeClassName)(l),c=r||i;return v().createElement(nD,{className:O()(t.attributeValue,t[s]),href:a({uiPath:o,tag:e,entityUri:c.dataTenant?(0,S.getDataTenantEntityUri)(c):c.uri})},e)},qD=({className:e,values:t})=>v().createElement(BD,{values:t,className:e,dataReltioId:"reltio-attribute-value",Component:GD}),ZD=({values:e,attributeType:t,classes:r})=>{const n=SD(),{label:a}=t;return v().createElement("div",{"data-reltio-id":"special-renderer",className:O()(n.titleRow,n.wrapper)},(i=n.titleIcon,t.uri===S.EntityAttrTypes.tags.uri?v().createElement(UD(),{className:i}):null),v().createElement(tP,{label:a,className:O()(n.title,null==r?void 0:r.title),"data-reltio-id":"reltio-attribute-label"}),(n=>{switch(t.uri){case S.EntityAttrTypes.tags.uri:return v().createElement(qD,{className:n,values:e});case S.EntityAttrTypes.roles.uri:return v().createElement(zD,{className:n,values:e});default:return v().createElement(cD,{className:n,attributeValue:{value:e[0],uri:""},attributeType:t,inlined:!0,classes:r})}})(O()(n.attribute,null==r?void 0:r.content)));var i};var $D=r(97986),KD=r.n($D);function XD(){return XD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},XD.apply(null,arguments)}const QD=e=>v().createElement("svg",XD({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgDefaultImage"},e),v().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("path",{d:"M0 0h24v24H0z"}),v().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"}))),JD={SMALL:{imageWidth:114,imageHeight:114},MEDIUM:{imageWidth:162,imageHeight:162},LARGE:{imageWidth:192,imageHeight:192},OVERRIDE:{imageWidth:"unset",imageHeight:"unset"}},ek=(0,wp.Z)((e=>({root:{position:"relative"},image:({imageWidth:e,imageHeight:t})=>({width:e,height:t,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 tk(){return tk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tk.apply(null,arguments)}const rk=(0,b.memo)((e=>{const{src:t,className:r,containerClassName:n,size:a=JD.SMALL,overlay:i=null}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["src","className","containerClassName","size","overlay"]),l=a||JD.SMALL,s=ek(l),[c,u]=(0,b.useState)(um.oA.LOADING);(0,b.useEffect)((()=>{u(um.oA.LOADING)}),[t]);const p=c===um.oA.LOADING,d=c===um.oA.LOADED;return c===um.oA.ERROR?v().createElement("div",tk({className:O()(s.defaultContainer,s.image,r)},o),v().createElement(KD(),{className:s.defaultImage})):v().createElement("div",{className:O()(s.root,n)},!(0,S.isEmptyValue)(t)&&v().createElement("img",tk({src:t,className:O()(s.image,r,{[s.hideImage]:p}),onLoad:()=>{u(um.oA.LOADED)},onError:()=>{u(um.oA.ERROR)},alt:"image"},o)),p&&v().createElement("div",tk({className:O()(s.defaultContainer,s.image,r)},o),v().createElement(QD,{className:s.defaultImage})),d&&i)})),nk={imageMargin:4,imageWidth:JD.SMALL.imageWidth,imageHeight:JD.SMALL.imageHeight};var ak=r(59849),ik=r.n(ak),ok=r(47867),lk=r.n(ok),sk=r(93643),ck=r.n(sk);const uk=(0,wp.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)"}}))),pk=({attributeValues:e,setAttributeValueIndex:t,attributeValueIndex:r})=>{const n=uk(),a=(0,b.useRef)(null);return(0,b.useEffect)((()=>{if(null!=a&&a.current){const e=a.current.scrollLeft,t=a.current.offsetWidth+e,n=96*r+16*r+12;t<n?a.current.scroll&&(n>t+96+16?a.current.scroll(n,0):a.current.scroll(112+e,0)):e+96>n&&a.current.scroll&&a.current.scroll(n-96,0)}}),[r,a]),v().createElement("div",{ref:a,className:n.thumbnails},v().createElement(ck(),{container:!0,wrap:"nowrap",direction:"row",spacing:1,className:n.gridContainer},e.map((({uri:e,value:a},i)=>v().createElement(ck(),{item:!0,key:e},v().createElement(rk,{onClick:()=>t(i),className:O()(n.thumb,{[n.inactiveThumb]:r!==i}),src:(0,S.getImageAttributeOvThumbnailUrl)({value:a})}))))))},dk=(0,wp.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%)"}}))),mk=({className:e,attributeValues:t,attributeValueIndex:r,setAttributeValueIndex:n})=>{const a=dk(),i=t[r],o=(0,S.getImageAttributeOvPreviewUrl)(i);return v().createElement("div",{className:O()(a.root,e)},v().createElement("div",{className:a.main},r>0&&v().createElement(Cp.T,{icon:ik(),className:O()(a.arrowButton,a.arrowButtonPrev),onClick:()=>{n(r-1)},size:"XL"}),v().createElement(rk,{containerClassName:a.mainImageContainer,className:a.mainImage,size:o&&JD.OVERRIDE,src:o}),r!==t.length-1&&v().createElement(Cp.T,{icon:lk(),className:O()(a.arrowButton,a.arrowButtonNext),onClick:()=>{n(r+1)},size:"XL"})),v().createElement(pk,{attributeValues:t,attributeValueIndex:r,setAttributeValueIndex:n}))};var fk=r(71884),yk=r.n(fk);const gk=(0,_.curry)(((e,t)=>(0,_.filter)((t=>(t.label||t.name).toLowerCase().includes(e.toLowerCase())))(t))),hk=({attrTypes:e,filter:t="",sortingFn:r})=>(0,_.pipe)(gk(t),(0,_.sort)(r),(0,_.map)((e=>({item:{id:e.uri,label:e.label||e.name,attrType:e}}))))(e);var Ek=function(e){return e.parent="parent",e.attributes="attributes",e}(Ek||{});const bk=(0,wp.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"}}),vk=({label:e,popupTitle:t=e,data:r,parent:n,dense:a,onApply:i})=>{const o=bk(),l=(0,b.useRef)(),[s,c]=(0,b.useState)(!1),[u,p]=(0,b.useState)(""),[d,m]=(0,b.useState)([]),{items:f,hasGroups:y,parentGroupLength:g,attributesGroupLength:h}=(({data:e,parent:t,filter:r})=>{const n=(0,w.mT)(),a=Boolean(t),i=(0,b.useMemo)((()=>n===S.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),[n]),o=(0,b.useMemo)((()=>a?hk({attrTypes:[t],filter:r,sortingFn:i}):[]),[a,t,r,i]),l=(0,b.useMemo)((()=>a&&null!=o&&o.length?[{item:{id:Ek.parent,label:li().text("Parent")},items:o}]:[]),[a,o]),s=(0,b.useMemo)((()=>hk({attrTypes:e,filter:r,sortingFn:i})),[e,r,i]),c=(0,b.useMemo)((()=>a&&null!=s&&s.length?[{item:{id:Ek.attributes,label:li().text("Attributes")},items:s}]:s),[a,s]),u=(0,b.useMemo)((()=>Lp((l||[]).concat(c))),[l,c]),p=l.length,d=c.length;return{items:u,hasGroups:a,parentGroupLength:p,attributesGroupLength:d}})({data:r,parent:n,filter:u}),E=(0,b.useCallback)(((e,t)=>{m((0,_.ifElse)((0,_.always)(t),(0,_.append)(e),(0,_.reject)((0,_.propEq)("id",e.id)))(d))}),[d]),T=(0,b.useCallback)(((e,t)=>t.items?40:28),[]),x=(0,b.useCallback)((({item:e})=>{E(e,(0,_.not)((0,_.any)((0,_.propEq)("id",e.id))(d)))}),[E,d]),{focusIndex:C,handleKeyDown:A}=Bp({items:f,open:s,onSelectFocusedItem:x,selectedItems:d}),R=(0,b.useRef)(null);R.current=C;const I=y?(g?1:0)+(h?1:0):0,N=f.length-I,P=Math.min(255,28*N+40*I),D=Math.max(140,P+112),k=(0,b.useCallback)(((e,{item:t,level:r=0},n)=>{var a;const i=(0,_.any)((0,_.propEq)("id",t.id))(d),o=R.current===n;return v().createElement(pd,{key:t.uri,onClick:E,checked:i,level:r,data:t,label:v().createElement(dd.o,{text:t.label,highlight:u}),labelInText:t.label,style:e,isFocused:o,isRequired:!(null===(a=t.attrType)||void 0===a||!a.required),LogoIcon:t.LogoIcon})}),[u,E,d]),L=(0,b.useCallback)(((e,t)=>v().createElement(Xm(),{component:"div",className:o.subHeader,style:e,key:`group-${t.item.id}`},t.item.label)),[]);return v().createElement("div",{className:O()(o.moreAttributes,{[o.dense]:a})},v().createElement(Wh(),{color:"primary",onClick:()=>c(!s),ref:l,className:o.moreButton},v().createElement(yk(),{classes:{root:o.icon}}),v().createElement("div",{className:o.buttonLabel},e)),v().createElement(kp,{open:s,className:O()(o.moreAttributesPopup,o.popupContainer),anchorEl:l.current,onClose:(0,_.pipe)((()=>{d.length>0&&i((0,_.pluck)("attrType",d))}),(()=>c(!1)),(()=>p("")),(()=>m([]))),onSearch:p,containerHeight:D,title:t,containerWidth:320,searchInputOnKeyDown:A},v().createElement(Vp,{getItemSize:T,renderItem:k,renderGroupTitle:L,disableHorizontalScrollbar:!0,items:f,height:P,focusIndex:C}),0===f.length&&v().createElement("div",{className:o.noResultsCaptionContainer},v().createElement(bf(),{variant:"caption",display:"block",gutterBottom:!0},li().text("No results found")))))},Tk=v().createContext({canCreate:!0,canUpdate:!0,canDelete:!0});Tk.displayName="ConfigPermissionsContext";const Ok=e=>{const{canCreate:t,canUpdate:r,canDelete:n}=(0,b.useContext)(Tk),a=(0,S.isTempUri)(e);return(0,b.useMemo)((()=>({canCreate:t,canUpdate:a||r,canDelete:a||n})),[a,t,r,n])},Sk={get CreationTime(){return li().text("Creation Time")},get CreationDate(){return li().text("Creation Date")},get Dimensions(){return li().text("Dimensions")},get MimeType(){return li().text("Mime Type")},get Size(){return li().text("Size")},get Url(){return li().text("Full image URL (S3)")},get UrlPreview(){return li().text("Preview image URL (S3)")},get UrlThumbnail(){return li().text("Small image URL (S3)")},get CdnUrl(){return li().text("Full image URL (CDN)")},get CdnUrlPreview(){return li().text("Preview image URL (CDN)")},get CdnUrlThumbnail(){return li().text("Small image URL (CDN)")}},xk=({value:e}={},t)=>["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail","MimeType"].includes(t)?(0,_.path)([t,0,"value"],e):"CreationDate"===t&&(0,_.path)(["CreationTimestamp",0,"value"],e)?Ma()(e.CreationTimestamp[0].value).format("MM-DD-YYYY"):"CreationTime"===t&&(0,_.path)(["CreationTimestamp",0,"value"],e)?Ma()(e.CreationTimestamp[0].value).format("HH:mm:ss"):"Dimensions"===t&&(0,_.path)(["Height",0,"value"],e)&&(0,_.path)(["Width",0,"value"],e)?`${e.Height[0].value} x ${e.Width[0].value} ${li().text("pixels")}`:"Size"===t&&(0,_.path)(["Size",0,"value"],e)?`${(Number(e.Size[0].value)/1e3).toFixed(2)} KB`:void 0,Ck=(e=[])=>e.filter((({system:e})=>!e)),wk=(e,t)=>{const{includeNames:r=[],excludeNames:n=[],order:a=[]}=t,i=r.length?e.filter((e=>r.includes(e))):e.filter((e=>!n.includes(e)));return 0===a.length?i:i.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}))},Ak=(e={},t,r)=>{const n=Ck(t.attributes);return wk(Object.keys(e.value||{}),r).reduce(((t,r)=>{const a=n.find((({name:e})=>e===r));return a?[...t,{attrType:a,values:e.value[r]}]:t}),[])},Rk=e=>["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail"].includes(e),_k=(0,wp.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:{}}),Ik=({attributeType:e,onAddAttributes:t,uri:r})=>{const n=_k(),a=Ck(e.attributes),{canCreate:i}=(0,b.useContext)(Tk),o=i&&Boolean(t);return v().createElement(PI(),null,v().createElement(bf(),{className:O()(n.title,{[n.canAdd]:o})},li().text("Meta info")),o&&v().createElement(b.Fragment,null,v().createElement(vk,{label:li().text("Attributes"),data:a,dense:!1,onApply:e=>{t&&t(e.map((e=>({attributeType:e,parentUri:r}))))}}),v().createElement(Af(),{className:n.divider})))},Nk=(0,wp.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"}}))),Pk=({title:e,content:t,isLink:r,children:n})=>{const a=Nk();return v().createElement("div",{className:a.root},v().createElement("span",{className:a.title},e),r?v().createElement("a",{className:a.link,href:t},li().text("link")):v().createElement("span",{className:a.content},t||n))},Dk=(0,wp.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"}}),kk=({attributeValue:e,attributeType:t,imageAttributeFieldsOrder:r})=>{const n=Dk(),a=(0,w.xH)(),i=(o=e,l=r,wk(Object.keys(Sk),l).map((e=>xk(o,e)?{title:Sk[e],value:xk(o,e),isLink:Rk(e)}:null)).filter(Boolean));var o,l;const s=Ak(e,t,r),c=(0,b.useMemo)((()=>({title:n.title,content:n.content})),[n]);return v().createElement(PI(),{className:n.root},i.map((({title:e,value:t,isLink:r})=>v().createElement(Pk,{key:e,isLink:r,title:e,content:t}))),a&&s.map((({attrType:t,values:r})=>v().createElement(PF,{key:t.uri,attributeType:t,drawLines:!1,values:r,classes:c,parentUri:e.uri}))))},Lk=(0,wp.Z)((e=>({caption:{display:"flex",color:e.palette.error.main,fontSize:"12px",lineHeight:"16px"}}))),Uk=({className:e,message:t})=>{const r=Lk();return t?v().createElement(bf(),{variant:"caption",className:O()(r.caption,e)},t):null};var jk=r(66826),Fk=r.n(jk),Mk=r(95210),Vk=r(70485),Bk=r.n(Vk),zk=r(53167),Hk=r.n(zk);const Yk=(0,wp.Z)({wrapper:{width:"100%"},helperText:{margin:"3px 0 1px 12px"}});function Wk(){return Wk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wk.apply(null,arguments)}const Gk=(0,b.memo)((e=>{let{errorMessage:t,children:r,className:n,classes:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["errorMessage","children","className","classes"]);const o=Yk(),l=!!t;return v().createElement(Bk(),Wk({variant:"standard",className:O()(o.wrapper,n,null==a?void 0:a.root),error:!0},i),r,l&&v().createElement(Hk(),{className:O()(o.helperText,null==a?void 0:a.helperText)},v().createElement(Uk,{message:t})))}));Gk.displayName="ErrorWrapper";const qk=(e,t,r,n)=>{const a=(0,_.pipe)(S.getEntityType,(0,_.defaultTo)({}),(0,_.props)(["attributes","analyticsAttributes"]),(0,_.reject)(_.isNil),_.flatten,(0,_.concat)(_.__,(0,_.pipe)(_.values,(0,_.reject)((0,_.propEq)("uri",S.EntityAttrTypes.id.uri)))(S.EntityAttrTypes)))(e,t);return r.length?a.filter((({uri:e})=>r.includes(e))):a.filter((({uri:e})=>!n.includes(e)))},Zk=(e,t)=>(0,_.partition)((0,_.pipe)((0,_.path)(["attrType","uri"]),(0,_.includes)(_.__,e)),t),$k=(0,_.eqBy)((0,_.pick)(["fieldName","uri","entityTypeUri"])),Kk=(e,t)=>t&&!!t.find($k(e)),Xk=(0,_.curry)(((e,t,r)=>{const n=((e,t)=>{const{type:r}=(0,S.getAttrDataTypeDefinition)(e);switch(r){case S.DataTypes.TYPE_BOOLEAN:case S.DataTypes.TYPE_BOOLEAN_RADIO:case S.DataTypes.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t.toString();case S.DataTypes.TYPE_DATE:return t&&Ma()(t).format("YYYY-MM-DD")||"";case S.DataTypes.TYPE_TIMESTAMP:return t&&Ma()(t).utc().format()||"";case S.DataTypes.TYPE_ACTIVENESS_DATE:case S.DataTypes.TYPE_LOCAL_DATE:return t&&t.valueOf();default:return t||""}})(t,r);return{value:n,uri:e.uri,attributeType:t}})),Qk=v().createContext({enabled:!1,queueSizeThreshold:0});Qk.displayName="AsyncMountContext";let Jk=0;function eL(){return eL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},eL.apply(null,arguments)}var tL=r(50548);const rL=v().createContext(!1);rL.displayName="ProfilePerspectiveViewContext";let nL=function(e){return e.Error="Error",e.NewAttribute="NewAttribute",e.NewView="NewView",e}({});const aL=e=>e===nL.Error,iL=v().createContext({element:null,type:null,highlightView:_.identity,highlightError:_.identity,highlightAttribute:_.identity,scrollIntoRef:_.identity});function oL(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){lL(e,t,r[t])}))}return e}function lL(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sL={content:'""',position:"absolute",left:"-1000px",top:"0px",width:"5000px",height:"calc(100% - 10px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},cL=(0,wp.Z)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlightError:{"&::before":oL({},sL,{background:"rgba(255, 0, 0, 0.06)"})},highlightWarning:{"&::before":oL({},sL,{background:"rgba(228, 151, 0, 0.08)"})},simpleAttribute:{position:"relative","&::before":{top:"-4px",height:"calc(100% + 8px)"}}}))),uL=({highlightedError:e,isSimple:t=!1})=>{const r=cL(),n=(0,b.useRef)(null),a=(0,_.pathOr)(S.ErrorSeverity.ERROR,["element","severity"])(e),i=O()({[r.highlightError]:a===S.ErrorSeverity.ERROR,[r.highlightWarning]:a===S.ErrorSeverity.WARNING,[r.simpleAttribute]:t});return(0,b.useEffect)((()=>{e&&e.scrollIntoRef(n)}),[e]),e?{ref:n,errorClassName:i}:{ref:n}};var pL=r(51894);const dL=(0,wp.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 mL(){return mL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mL.apply(null,arguments)}const fL=(0,tL.l)(iL,((e,{attributeValue:t})=>{const{element:r,type:n}=e||{};return{highlightedError:aL(n)&&(null==r?void 0:r.uri)===t.uri?e:null}}),(e=>{let{className:t,attributeValue:r,attributeType:n,isReltioCrosswalk:a,ownError:i,mode:o,onAddOneMore:l,onDeleteAttribute:s,onChangeAttribute:c,onDeactivateError:u,additionalControlsRenderer:p,state:d,highlightedError:m,isEmptyEditor:f=!1}=e,y=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.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 g=dL(),h="deleted"===d,E="edited"===d,T=(0,S.isEditableMode)(o),{canCreate:x,canEdit:C,canDelete:A}=(({attributeType:e,attributeValue:t,isReltioCrosswalk:r,mode:n})=>{const{canCreate:a,canUpdate:i,canDelete:o}=Ok(t.uri);return{canCreate:a&&(0,S.checkCanCreateAttribute)({attributeType:e,mode:n}),canEdit:i&&(0,S.checkCanEditAttribute)({attributeType:e,attributeValue:t,mode:n,isReltioCrosswalk:r}),canDelete:o&&(0,S.checkCanDeleteAttribute)({attributeType:e,attributeValue:t,mode:n,isReltioCrosswalk:r})}})({attributeValue:r,attributeType:n,mode:o,isReltioCrosswalk:a}),R=C&&T,I=(0,S.getErrorMessage)(i),N=(0,w.ZI)(r,n),{ref:P,errorClassName:D}=uL({highlightedError:m,isSimple:!0});(0,b.useEffect)((()=>{f&&(0,S.isDependentLookupAttrType)(n)&&!(0,_.has)("lookupCode",r)&&c({attributeType:n,uri:r.uri,value:r.value,silent:!0})}),[f]);const k=(0,b.useMemo)((()=>(0,S.getAttrDataTypeDefinition)(n)),[n]),L=(0,b.useMemo)((()=>((e,{type:t})=>{const{value:r,lookupCode:n}=e||{};switch(t){case S.DataTypes.TYPE_BOOLEAN:case S.DataTypes.TYPE_BOOLEAN_RADIO:case S.DataTypes.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,S.parseBoolean)(r);case S.DataTypes.TYPE_DATE:return r&&S.utils.dates.toLocalDate(r)||null;case S.DataTypes.TYPE_LOCAL_DATE:case S.DataTypes.TYPE_TIMESTAMP:case S.DataTypes.TYPE_ACTIVENESS_DATE:return r&&new Date(r)||null;case S.DataTypes.TYPE_DEPENDENT_LOOKUP:case S.DataTypes.TYPE_LOOKUP:return{value:r,lookupCode:n};default:return r}})(r,k)),[r,k]),U=(0,b.useCallback)((()=>{i&&u((0,S.getErrorId)(i))}),[i,u]),j=(0,b.useCallback)((0,_.pipe)(Xk(r,n),c,U),[r,n,c,U]),F=!!l&&x&&!n.singleValue,M=!h&&!!s&&A,V=!!I,B=h?{disabled:!0,isCrossedOut:!0}:{},z=(0,b.useContext)(rL),{autopopulationContextValue:H}=(({enabled:e,attributeTypeUri:t,valueUri:r})=>{const n=(0,w.ax)("dependentLookupsEditorTouched"),a=(0,w.Pl)(),i=(0,w.h0)(r),o=e&&(0,S.isAutopopulationEnabled)(a,t),l=o?r:null,{isTouched:s=!1}=o&&i||{},c=(0,b.useCallback)((e=>{n({uri:e,isTouched:!0})}),[n]);return{autopopulationContextValue:(0,b.useMemo)((()=>l?{id:l,isTouched:s,onTouch:c}:null),[l,s,c])}})({enabled:z&&(0,S.isDependentLookupAttrType)(n),attributeTypeUri:null==n?void 0:n.uri,valueUri:r.uri});return v().createElement("div",{ref:P,className:O()(g.editor,t,D)},v().createElement(Gk,{errorMessage:I,className:g.errorWrapper},v().createElement("div",{className:O()(g["editor-value"],{[g.deleted]:h},{[g["editor-read-only-value"]]:!R}),"data-reltio-id":"reltio-attribute-value"},R?v().createElement(pL.m.Provider,{value:H},v().createElement(Mk.Z,mL({fieldName:(0,S.attributeUriToSearchUri)(n.uri),value:L,dataTypeDefinition:k,error:V,onChange:j,fullWidth:!0},N,y,B))):v().createElement(Hd.x,{value:(0,S.getAttributeValue)(r),dataTypeDefinition:k}))),v().createElement("div",{className:g["editor-actions"]},E&&v().createElement(bf(),{variant:"caption",className:g.editedLabel},"(",li().text("edited"),")"),F&&v().createElement(Cp.T,{icon:yk(),onClick:l,size:"L",className:O()(g.addButton,g.button),"data-reltio-id":"reltio-add-one-more-simple-attribute-button"}),p&&p({attributeType:n,attributeValue:r}),M&&v().createElement(Cp.T,{className:g.button,icon:Fk(),onClick:()=>{s({uri:r.uri,attributeType:n}),(0,S.getErrorType)(i)!==S.ErrorType.missed&&U()},size:"L","data-reltio-id":"reltio-delete-simple-attribute-button"})))})),yL=((e,t=null)=>{const r=(0,b.forwardRef)(((r,n)=>(()=>{const e=(0,b.useRef)(!0),{enabled:t,queueSizeThreshold:r=0}=(0,b.useContext)(Qk),[n,a]=(0,b.useState)(!t||t&&Jk<r);e.current&&Jk++;const i=(0,b.useRef)();return(0,b.useEffect)((()=>{if(Jk--,!n)return i.current=setTimeout((()=>{a(!0)}),0),()=>clearTimeout(i.current)}),[]),e.current=!1,n})()?v().createElement(e,eL({},r,{ref:n})):t&&v().createElement(t,eL({},r,{ref:n}))));return r.displayName="WithAsyncMount",r})(fL,(()=>{const e=dL();return v().createElement("div",{className:e.placeholder})})),gL=[S.EntityAttrTypes.roles.uri,S.EntityAttrTypes.tags.uri],hL=v().createContext(null),EL=v().createContext(null),bL=(0,b.createContext)({});function vL(){return vL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vL.apply(null,arguments)}function TL(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const OL=(0,tL.l)(iL,(e=>{const{highlightAttribute:t}=e||{};return{highlightAttribute:t}}),(({parentAttributeType:e,attrTypes:t,entity:r,parentUri:n,showEmptyEditors:a,mode:i,crosswalks:o,drawLines:l,children:s,className:c,alwaysVisibleTypeUris:u=gL,onAddAttributes:p,onChangeAttribute:d,onDeleteAttribute:m,additionalControlsRenderer:f,showNonOv:y,highlightAttribute:g})=>{const h=(0,b.useContext)(bL),E=n&&(0,S.getBaseUri)(n),T=(0,b.useMemo)((()=>h[E]||[]),[h,E]),O=(0,b.useMemo)((()=>t.filter((e=>!T.includes(e.uri)))),[t,T]),{attributes:x={}}=r,[C,w]=(0,b.useState)({}),A=(0,b.useCallback)(((e,t)=>{w((r=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){TL(e,t,r[t])}))}return e}({},r,{[e]:t})))}),[]);(0,b.useEffect)((()=>{w({})}),[n]);const{canCreate:R}=(0,b.useContext)(Tk),I=(0,b.useMemo)((()=>R&&e&&(0,S.checkCanCreateAttribute)({attributeType:e,mode:i})),[e,i,R]),N=((e,t,r,n)=>e.filter((e=>{const a=((e,t)=>{const{attributes:r={},analyticsAttributes:n={}}=t;return(0,_.cond)([[S.isSpecialAttribute,(0,_.always)(t)],[(0,_.both)(S.isAnalyticAttribute,(0,_.always)(n)),(0,_.always)(n)],[_.T,(0,_.always)(r)]])(e)})(e,t),i=(e=>(0,S.isSpecialAttribute)(e)?"uri":"name")(e);return!((e.singleValue||(0,S.isRoleAttrType)(e)||(0,S.isTagAttrType)(e))&&((0,_.has)(e[i])(a)||r&&(null==n||!n[e.uri])))})))((0,b.useMemo)((()=>R?(0,S.getCreatableAttributeTypes)(i,O):[]),[O,i,R]),r,a,C),P=(0,b.useContext)(hL),D=(0,b.useMemo)((()=>(0,S.getAttributesListForEditMode)(O,i,r,a,y,P,R)),[O,i,r,a,y,P,R]),[k,L]=(0,b.useMemo)((()=>Zk(u,D)),[D,u]),U=(0,b.useCallback)((t=>{p(t.map((t=>({attributeType:t,parentUri:t===e?(0,S.getParentUri)(n):n})))),g((0,_.last)(t),nL.NewAttribute)}),[p,n,e]),j={enabled:l},F=(0,b.useMemo)((()=>({hasDeletionsMap:C,setHasDeletions:A})),[C,A]);return v().createElement("div",{className:c},s&&v().createElement(YI,j,s),v().createElement(YI,vL({},j,{plain:!0}),N.length>0&&v().createElement(vk,{label:li().text("More attributes"),onApply:U,dense:l,data:N,parent:I&&e})),v().createElement(EL.Provider,{value:F},L.concat(k).map((({attrType:e,values:t})=>v().createElement(zj,{key:`${e.uri}_${n}`,attributeType:e,drawLines:l,values:t,paging:(0,_.path)(["paging",e.uri],x),parentUri:n,showEmptyEditors:a,mode:i,crosswalks:o,onAddAttributes:p,onChangeAttribute:d,onDeleteAttribute:m,additionalControlsRenderer:f,showNonOv:y})))))})),SL=(0,wp.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}}))),xL=(0,tL.l)(iL,((e,{attributeValue:t})=>{const{element:r,type:n}=e||{},a=aL(n);return{highlightedError:a&&(null==r?void 0:r.uri)===t.uri?e:null,isHighlightedPath:a&&(0,_.pipe)((0,_.propOr)([],"path"),(0,_.any)((0,_.pathEq)(["value","uri"],t.uri)))(r)}}),(({label:e,attributeTypesList:t,attributeType:r,attributeValue:n,children:a,errors:i,ownError:o,mode:l,metadata:s,crosswalks:c,lazy:u,showEmptyEditors:p,onAddOneMore:d,onAddAttributes:m,onDeleteAttribute:f,onChangeAttribute:y,additionalControlsRenderer:g,hideDeleteButton:h,state:E,showNonOv:T,isHighlightedPath:x,highlightedError:C,expanded:w=!1})=>{const A=SL(),R="deleted"===E,_="edited"===E,I=n.uri,N=(0,S.isTempUri)(I),P=N||w,[D,k]=(0,b.useState)(P),{ref:L,errorClassName:U}=uL({highlightedError:C});(0,b.useEffect)((()=>{x&&k(!0)}),[x]),(0,b.useEffect)((()=>{k(P)}),[P]);const{canDelete:j}=Ok(n.uri),F=(0,b.useMemo)((()=>j&&(0,S.checkCanDeleteAttribute)({attributeType:r,attributeValue:n,mode:l,metadata:s,isReltioCrosswalk:(0,S.isReltioCrosswalk)(c,n)})),[r,n,l,s,c,j]),M=!R&&!h&&!!f&&F,V=(0,b.useMemo)((()=>(0,S.hasAttributeDescendantsWithErrors)(n,i)),[i,n]);(0,b.useEffect)((()=>{V&&k(!0)}),[i,V]),(0,b.useEffect)((()=>{R&&k(!1)}),[R]);const B=(t||[]).some((e=>(0,S.isAnalyticAttribute)(e))),z=(0,b.useMemo)((()=>({attributes:B?null:n.value,analyticsAttributes:B?n.value:null})),[n,B]),H=(0,S.getErrorMessage)(o)||V&&li().text("Has an incorrect value")||"";return u?v().createElement(Wh(),{variant:"text",color:"primary",onClick:d},"Create attribute"):v().createElement("div",{ref:L,"data-reltio-id":"reltio-edit-mode-complex-attribute",className:O()(A.complexWrapper,U)},v().createElement("div",{className:A.editor},v().createElement("div",{className:A.titleContainer},v().createElement(HP,{onClick:()=>k((e=>!e)),expanded:D,className:A.expandButton,disabled:R}),v().createElement(Gk,{errorMessage:H,classes:{helperText:A.errorWrapperHelperText}},v().createElement("div",{className:O()(A.label,{[A.deleted]:R}),"data-reltio-id":"reltio-attribute-complex-label"},e))),v().createElement("div",{className:A.actions},_&&v().createElement(bf(),{variant:"caption",className:A.editedLabel},"(",li().text("edited"),")"),g&&g({attributeType:r,attributeValue:n}),M&&v().createElement(Cp.T,{icon:Fk(),onClick:()=>f({uri:I,attributeType:r,attributeValue:n}),size:"L","data-reltio-id":"reltio-delete-complex-attribute-button"}))),D&&v().createElement(OL,{parentAttributeType:r,attrTypes:t,entity:z,showEmptyEditors:p||N,drawLines:!0,parentUri:I,mode:l,crosswalks:c,onAddAttributes:m,onChangeAttribute:y,onDeleteAttribute:f,additionalControlsRenderer:g,showNonOv:T},a))}));function CL(){return CL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},CL.apply(null,arguments)}const wL=(0,b.memo)((e=>{const{attributeValue:t,attributeType:r}=e,n=(0,S.evaluateDeepEntityLabel)(t,r.dataLabelPattern);return v().createElement(xL,CL({label:(0,S.getLabel)(n),attributeTypesList:r.attributes||r.analyticsAttributes},e))}));wL.displayName="NestedAttributeEditor";var AL=r(84199),RL=r(62880);const _L=(0,wp.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"}}))),IL=e=>{const{selectProps:{onCreate:t,createLabel:r,inputValue:n,components:a},children:i}=e,o=_L();return v().createElement(Ly.h,e,i,r&&!(0,_.prop)("Group",a)&&v().createElement("span",{className:o.addLabel,onClick:()=>t(n)},v().createElement(yk(),{className:o.addIcon}),r))};IL.propTypes={children:dp().element.isRequired,selectProps:dp().object.isRequired};const NL=(0,wp.Z)({singleValue:{fontSize:"14px",lineHeight:"16px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginTop:"17px"}});function PL(){return PL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},PL.apply(null,arguments)}const DL=e=>{const{selectProps:{menuIsOpen:t},innerProps:r,children:n}=e,a=NL();return!t&&v().createElement(bf(),PL({className:a.singleValue},r),n)};function kL(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){LL(e,t,r[t])}))}return e}function LL(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}DL.propTypes={children:dp().node,innerProps:dp().object};const UL=(0,wp.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"}}}),jL={menu:e=>kL({},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=>kL({},e,{maxHeight:"208px",padding:"8px 0"}),group:e=>kL({},e,{padding:"0 0 8px 0"}),input:e=>kL({},e,{height:"16px",color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",lineHeight:"16px",margin:"16px 0 0",padding:0}),option:e=>kL({},e,{fontSize:"13px",lineHeight:"15px",height:"32px"})},FL={menuList:e=>kL({},e,{padding:0})},ML={input:e=>kL({},e,{height:"16px",color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",lineHeight:"16px",margin:0,padding:0})};function VL(){return VL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},VL.apply(null,arguments)}function BL(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){zL(e,t,r[t])}))}return e}function zL(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const HL=e=>{let{value:t,label:r,createLabel:n,getOptions:a,options:i,height:o=46,onChange:l=_.identity,onCreate:s,onClear:c=_.identity,components:u,textFieldInputRef:p,TextFieldProps:d,classes:m}=e,f=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.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 y=UL({height:o}),[g,h]=(0,b.useState)(!1),E=(0,b.useRef)(null),T=a?xy:Oy.J,x=(0,_.prop)("ClearIndicator",u)?{}:{IndicatorSeparator:AL.V,ClearIndicator:AL.V},C=s?(e,t)=>{s(e,t),h(!1)}:void 0,w=(0,_.prop)("Group",u)?FL:{},A=(0,_.isEmpty)(r)?ML:{},R=BL({},jL,w,A),I=BL({},y,m);return v().createElement(T,VL({placeholder:"",defaultOptions:!0},f,{value:(0,_.defaultTo)(null,t),loadOptions:a,options:i,cacheOptions:!0,onChange:l,onCreate:C,onClear:c,createLabel:n,classes:I,styles:R,components:BL({DropdownIndicator:RL.G,LoadingIndicator:AL.V,SingleValue:DL,Menu:IL},x,u),menuPlacement:"auto",TextFieldProps:BL({},d,{label:r,variant:"filled",size:"small",classes:BL({},(0,_.prop)("classes",d),{root:O()(y.formControl,(0,_.path)(["classes","root"],d))}),inputProps:BL({},(0,_.prop)("inputProps",d)),InputProps:BL({},(0,_.prop)("InputProps",d),{classes:BL({},(0,_.path)(["InputProps","classes"],d),{root:O()(y.filledInputRoot,(0,_.path)(["InputProps","classes","root"],d)),underline:O()({[y.filledInputUnderline]:(0,S.isEmptyValue)(t)},(0,_.path)(["InputProps","classes","underline"],d)),focused:O()("focused",(0,_.path)(["InputProps","classes","focused"],d))})}),InputLabelProps:BL({},(0,_.prop)("InputLabelProps",d),{classes:BL({},(0,_.path)(["InputLabelProps","classes"],d),{root:O()(y.inputLabel,(0,_.path)(["InputLabelProps","classes","root"],d)),shrink:O()("shrink",(0,_.path)(["InputLabelProps","classes","shrink"],d))}),shrink:!(0,S.isEmptyValue)(t)||void 0}),ref:p||E}),inputRef:p||E,menuIsOpen:g,onMenuOpen:()=>h(!0),onMenuClose:()=>h(!1)}))},YL={value:dp().oneOfType([dp().object,dp().array]),label:dp().string.isRequired,getOptions:dp().func,options:dp().array,onChange:dp().func,onCreate:dp().func,onClear:dp().func,createLabel:dp().string,components:dp().object,textFieldInputRef:dp().object,TextFieldProps:dp().object,height:dp().number,classes:dp().object};HL.propTypes=YL;var WL=r(98018);function GL(){return GL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},GL.apply(null,arguments)}const qL=e=>{const t=(0,w.$H)()||"";return v().createElement(WL.ZP,GL({},e,{storagePath:(r=t,r.endsWith("/")?r:r+"/")}));var r},ZL=(0,wp.Z)({entityContainer:{display:"flex",alignItems:"center",height:"32px",minHeight:"32px",padding:0,"&.focused":{backgroundColor:"rgba(0,0,0,0.04)"}},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 $L(){return $L=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$L.apply(null,arguments)}const KL=({innerRef:e,innerProps:t,selectOption:r,data:n,isFocused:a})=>{const i=ZL(),{uri:o,entityType:l,label:s,secondaryLabel:c}=n;return""!==o?v().createElement(qp(),$L({className:O()(i.entityContainer,{focused:a}),ref:e,key:o,onClick:()=>r({label:s,uri:o,entityType:l})},t),v().createElement(qL,{className:i.entityAvatar,entityType:l}),v().createElement(od.Y,{value:`${s}${c?", "+c:""}`},v().createElement("span",{className:i.entityLabel},s,c&&v().createElement("span",{className:i.entitySecondaryLabel},", ",c)))):v().createElement(qp(),$L({className:i.entityContainer,ref:e,key:o},t,{disabled:!0}),v().createElement("span",{className:i.emptyEntityLabel},li().text("No results found")))},XL=(0,wp.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"}}))),QL=({selectProps:{currentEntityType:e,menuIsOpen:t,disableLinkClick:r},children:n,data:a})=>{const i=XL(),o=(0,w.ax)("openEntity"),l=(0,w.Qh)(),{generateEntityUrl:s}=(0,b.useContext)(jd),c=(0,S.isTempUri)(a.entityUri)?{className:i.singleValue,component:"span"}:{className:O()(i.singleValue,i.linkValue),onMouseDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation(),r?e.preventDefault():(0,xp.rR)(e)||(o({uri:a.entityUri}),e.preventDefault())},href:s({uiPath:l,uri:a.entityUri}),component:"a"};return t?null:v().createElement(bf(),c,(0,S.isTempUri)(a.entityUri)?li().text(`New ${e.label} will be created`):(0,S.getLabel)(n))},JL=(0,wp.Z)({clearIcon:{cursor:"pointer",height:"20px",width:"20px"}}),eU=e=>{const{selectProps:{onClear:t}}=e,r=JL();return v().createElement(Hh(),{onClick:t,size:"large"},v().createElement(wI(),{className:r.clearIcon}))};eU.propTypes={selectProps:dp().object.isRequired};var tU=r(81997);const rU=(0,wp.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:nU}=tU.F,aU=e=>{const{selectProps:{inputValue:t,onCreate:r},data:n,children:a}=e,i=rU();return v().createElement(nU,e,v().createElement("div",{className:i.groupHeading},v().createElement("span",null,n.label),r&&v().createElement("span",{onClick:()=>r(t,n.entityType),className:i.addLabel},v().createElement(yk(),{className:i.addIcon}),li().text(`Create ${t?`"${t}" as `:""}new ${n.label}`))),a)};aU.propTypes={selectProps:dp().object.isRequired,data:dp().object,children:dp().array};const iU=e=>e&&e.attributes,oU=({entityUri:e,entityType:t,mode:r,attributeTypesSelectionStrategy:n=iU})=>{const a=(0,w.ax)("addAttributes"),i=(0,w.ax)("removeAttribute"),o=(0,w.ax)("modifyAttribute"),l=(0,w.vc)(e),s=(0,b.useMemo)((()=>n(t)),[n,t]);return l?v().createElement(OL,{key:l.uri,attrTypes:s,entity:l,showEmptyEditors:!0,drawLines:!0,parentUri:l.uri,mode:r,crosswalks:l.crosswalks,onAddAttributes:a,onChangeAttribute:o,onDeleteAttribute:i}):null};function lU(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sU=(0,wp.Z)({creatorWrapper:{marginTop:"20px"}});function cU(){return cU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cU.apply(null,arguments)}function uU(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){pU(e,t,r[t])}))}return e}function pU(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dU(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const mU=20,fU=e=>{let{entity:t={},entityTypesUris:r=[],mode:n,max:a=mU,onChange:i,onCreate:o,metadata:l,globalSearchRequestOptions:s,attributeTypesSelectionStrategy:c,disableLinkClick:u=!1}=e,p=dU(e,["entity","entityTypesUris","mode","max","onChange","onCreate","metadata","globalSearchRequestOptions","attributeTypesSelectionStrategy","disableLinkClick"]);const d=sU(),[m,f]=(0,b.useState)(""),y=(0,b.useMemo)((()=>r.map((e=>(0,S.getEntityType)(l,e))).filter(S.isAvailableEntityType)),[r,l]),g=uU({},s,{max:a}),h=o?(e,t)=>{o(t||r[0],e),f("")}:void 0,E=e=>{null!==e&&(f(""),i(e))},T=(0,b.useMemo)((()=>1!==y.length),[y]),O=((0,_.isEmpty)(t)?y[0]:(0,S.getEntityType)(l,t.entityType))||{},x=o&&li().text(`Create ${m?`"${m}" as `:""}new ${O.label}`),C=li().text(`Select ${1===y.length?`${y[0].label} `:""}profile`),w=!(0,_.isEmpty)(t)&&(0,S.isTempUri)(t.entityUri),A=T?{Group:aU,GroupHeading:AL.V}:{},R=w?{ClearIndicator:eU}:{},{TextFieldProps:I}=p,N=dU(p,["TextFieldProps"]),P=(0,b.useMemo)((()=>uU({},I||{},{"data-reltio-id":"reltio-entity-selector"})),[I]);return v().createElement(v().Fragment,null,v().createElement(HL,cU({value:(0,_.isEmpty)(t)?void 0:t,inputValue:m,onInputChange:e=>{f(e)},getOptions:e=>(0,S.typeAheadSearch)(y,e,g).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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){lU(e,t,r[t])}))}return e}({},t,{label:(0,S.getLabel)(t.label),entityType:e.find((({uri:e})=>e===t.type))}))),a=e=>(0,_.isEmpty)(e)?[{label:"",uri:"",entityType:{}}]:e,i=t?e:e.filter((e=>n.some((t=>t.type===e.uri))));return i.length>1?i.map((e=>({label:e.label,entityType:e.uri,options:a(n.filter((t=>t.type===e.uri)))}))):a(n)})(y,o)),getOptionLabel:(0,_.prop)("entityLabel"),onChange:E,onCreate:h,onClear:()=>{E({})},label:C,createLabel:x,components:uU({Option:KL,SingleValue:QL},A,R),currentEntityType:O,isClearable:!0,disableLinkClick:u,TextFieldProps:P},N)),w&&v().createElement("div",{className:d.creatorWrapper},v().createElement(oU,{mode:n,attributeTypesSelectionStrategy:c,entityType:O,entityUri:t.entityUri})))},yU=(0,wp.Z)({item:{marginBottom:"20px"},dense:{marginBottom:0}});function gU(){return gU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gU.apply(null,arguments)}function hU(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const EU=(0,tL.l)(iL,((e,{attributeValue:t,attributeType:r})=>{const{element:n,type:a}=e||{};return{highlightedError:aL(a)&&(0,S.isAttributeTypeError)(n,t.uri,r.uri)?e:null}}),(e=>{const t=yU(),{highlightedError:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["highlightedError"]),{attributeValue:a,attributeType:i,mode:o,crosswalks:l,errors:s,onChangeAttribute:c}=n,u=(0,b.useRef)(a),{ref:p,errorClassName:d}=uL({highlightedError:r,isSimple:!0}),m=(0,S.getReferencedEntityUriFromAttrValue)(a),f=(0,w.ax)("entityDeleted"),y=(0,w.ax)("entityCreated"),g=(0,w.ax)("errorDeactivated"),h=(0,w.vc)(m),E=(0,S.isTempUri)(m)?h:null,T=(0,w.AH)(),x=(0,w.mU)(["ovOnly"]),C=(0,S.getReferencedEntityFromAttrValue)(a),A=(0,S.getReferencedRelationFromAttrValue)(a),R=(0,S.getReferencedEntityTypeUriFromAttrType)(i),I=(0,S.getEntityType)(T,R),N=E?(0,S.evaluateDeepEntityLabel)(E,I.dataLabelPattern):a.label,P=(0,b.useMemo)((()=>[R]),[R]),D=(0,b.useMemo)((()=>(0,S.addReferencedRelationCrosswalks)(l,A)),[l,A]),k=(0,b.useMemo)((()=>(0,S.getReferencedEntityActiveError)(a,s)),[a,s]),L=(0,b.useMemo)((()=>C&&{entityUri:(0,S.getReferencedEntityUri)(C),entityType:(0,S.getReferencedEntityTypeUri)(C),entityLabel:a.label}),[C,a.label]),U=(0,b.useMemo)((()=>(0,S.getReferencedRelationAttrTypesUris)(i).map((e=>(0,S.findAttributeTypeByUri)(T,e))).filter(_.identity)),[i,T]),j=(0,b.useCallback)((e=>(0,S.referencedEntityAttributeTypesSelectionStrategy)(i,e)),[i]),F=(0,b.useCallback)((e=>{E&&f(E.uri);const t=u.current,r=!(0,_.isEmpty)(e)&&e.uri===(0,S.getReferencedEntityUriFromAttrValue)(t),n=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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){hU(e,t,r[t])}))}return e}({},a,{label:e.label,refEntity:r?t.refEntity:(0,S.convertReferencedEntityForAttrValue)(e),refRelation:r?t.refRelation:(0,S.createReferencedRelationForAttrValue)(a)});c({value:n,attributeType:i,uri:a.uri}),k&&g((0,S.getErrorId)(k))}),[a,i,E,c,f,g,k]),M=(0,b.useCallback)(((e,t)=>{const r=(0,_.pipe)(j,(0,S.getCreatableAttributeTypes)(o))(I),n=(0,S.createTemporaryEntity)({entityTypeUri:e,initValue:t,attributeTypes:r,metadata:T,mode:o});F(n),y(n)}),[j,o,I,T,F,y]),{canCreate:V,canUpdate:B}=Ok(a.uri),z=(0,b.useMemo)((()=>B&&(0,S.checkCanEditAttribute)({attributeType:i,attributeValue:a,mode:o,isReltioCrosswalk:(0,S.isReltioCrosswalk)(l,a)})),[i,a,o,l,B]),H=(0,b.useMemo)((()=>V&&(0,S.checkMetadataForCreate)(o,I)),[o,I,V]),Y=(0,S.getErrorMessage)(k);return v().createElement(xL,gU({},n,{label:(0,S.getLabel)(N),attributeTypesList:U,crosswalks:D,metadata:T}),v().createElement("div",{ref:p,className:d},v().createElement(Gk,{errorMessage:Y},v().createElement(fU,{className:O()(t.item,{[t.dense]:Y||L&&(0,S.isTempUri)(L.entityUri)}),entity:L||{},entityTypesUris:P,globalSearchRequestOptions:x,mode:o,isDisabled:!z,onChange:F,onCreate:H?M:void 0,metadata:T,attributeTypesSelectionStrategy:j}))))}));function bU(){return bU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bU.apply(null,arguments)}const vU=(0,b.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className"]);return v().createElement("div",{ref:t,"data-reltio-id":"reltio-edit-attribute",className:r},class{static build(e,t={}){switch(e.type){case S.DataTypes.TYPE_NESTED:return v().createElement(wL,t);case S.DataTypes.TYPE_REFERENCE:return v().createElement(EU,t);default:{const e=(0,_.omit)(["showEmptyEditors","onAddAttributes","lazy","errors","crosswalks","showNonOv","expanded"],t);return v().createElement(yL,bU({isReltioCrosswalk:(0,S.isReltioCrosswalk)(t.crosswalks,t.attributeValue)},e))}}}}.build(e.attributeType,n))}));vU.displayName="EditModeAttribute";const TU=e=>li().text("${value}",{value:1===e?li().text("value"):li().text("values")}),OU=(0,_.has)("minValue"),SU=(0,_.has)("maxValue"),xU=(0,_.pipe)(SU,_.not),CU=(0,_.propSatisfies)((e=>1===e),"minValue"),wU=({minValue:e})=>li().text("This attribute can have minimum ${minValue} ${minValueCaption}",{minValue:li().number(e,"0"),minValueCaption:TU(e)}),AU=({maxValue:e})=>li().text("This attribute can have maximum ${maxValue} ${maxValueCaption}",{maxValue:li().number(e,"0"),maxValueCaption:TU(e)}),RU=(0,_.cond)([[_.isNil,(0,_.always)("")],[({minValue:e,maxValue:t})=>e&&e===t,({minValue:e})=>li().text("This attribute should have ${minValue} ${minValueCaption}",{minValue:li().number(e,"0"),minValueCaption:TU(e)})],[(0,_.allPass)([CU,SU]),AU],[(0,_.allPass)([CU,xU]),(0,_.always)("")],[(0,_.allPass)([OU,SU]),({minValue:e,maxValue:t})=>li().text("${minCardinality} and maximum ${maxValue} ${maxValueCaption}",{minCardinality:wU({minValue:e}),maxValue:li().number(t,"0"),maxValueCaption:TU(t)})],[SU,AU],[OU,wU],[_.T,(0,_.always)("")]]),_U=(0,wp.Z)((()=>({caption:{fontSize:"0.7rem",opacity:.54}}))),IU=({cardinality:e})=>{const t=_U(),r=RU(e);return r?v().createElement(bf(),{variant:"caption",className:t.caption},r):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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){PU(e,t,r[t])}))}return e}function PU(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const DU={content:'""',position:"absolute",left:"-1000px",top:"-4px",width:"5000px",height:"calc(100% + 8px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},kU=(0,wp.Z)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlighted:{"&::before":NU({},DU,{background:"rgba(228, 151, 0, 0.08)"}),position:"relative"}}))),LU=e=>{const t=kU(),r=(0,b.useRef)(null);return(0,b.useEffect)((()=>{e&&e.scrollIntoRef(r)}),[e]),e?{ref:r,highlightedClassName:t.highlighted}:{ref:r}},UU=(0,_.filter)((0,_.propSatisfies)(S.isTempUri,"uri")),jU=(0,wp.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=({max:e,values:t,attributeType:r,parentUri:n,mode:a,drawLines:i,showEmptyEditors:o,errorMessage:l,errors:s,paging:c,crosswalks:u,showNonOv:p,nonVisibleValues:d,highlightedError:m,highlightedAttribute:f,onAddAttributes:y,onDeleteAttribute:g,onChangeAttribute:h,onDeactivateError:E,additionalControlsRenderer:T,requestNextPageOfAttributeValues:x})=>{const C=jU(),[A,R]=(0,b.useState)(e),[I,N]=(0,b.useState)(!1),{label:P,required:D,cardinality:k,name:L,uri:U,description:j}=r,F=(0,S.isEditableMode)(a),{ref:M,errorClassName:V}=uL({highlightedError:m}),{ref:B,highlightedClassName:z}=LU(f),H=(0,b.useContext)(hL),Y=(0,b.useMemo)((()=>null==H?void 0:H.includes(U)),[U,H]),W=(0,S.isEmptyValue)(t),G=(!I&&o||D||Y)&&W,q=(0,w.Ws)(),Z=(0,b.useMemo)((()=>q.includes(r.uri)),[q,r.uri]),$=(0,b.useRef)((0,S.createNewAttribute)({parentUri:n,attributeType:(0,_.omit)(["defaultValue"],r)})),K=(0,b.useCallback)((()=>{R(A+1);const e=e=>({parentUri:n,index:A,attributeType:e});if(G&&!(0,S.isComplexAttribute)(r.type)){const t=[e((0,_.omit)(["defaultValue"],r)),e(r)];return y(t)}return y([e(r)])}),[A,y,n,r,G]),X=(0,b.useCallback)((0,_.pipe)(g,_.T,N),[g,N]);if(W&&!G)return null;if(G&&W&&(t=[$.current]),(0,S.isEmptyValue)(t))return null;const Q=(UU(t)||[]).length,J=p?"totalValues":"totalOvValues",ee=(0,_.ifElse)((0,_.has)(J),(0,_.pipe)((0,_.prop)(J),(0,_.add)(Q)),(0,_.always)(t.length))(c),te=null!=c&&c.totalValues?c.totalValues-ee:null==d?void 0:d.length,re=e<ee,ne=re&&A<ee,ae=re&&A>=ee,ie=t.slice(0,A),oe=ie?ie.length-1:0,le=ee-A;return v().createElement(YI,{enabled:i},v().createElement("div",{ref:M,className:O()(C.wrapper,V)},v().createElement("div",{className:C.titleWrapper},v().createElement(tP,{label:P,isRequired:D,className:C.title,"data-reltio-id":"reltio-attribute-label"}),v().createElement(uP,{description:j}),Z&&v().createElement(gD,null),v().createElement(iP,{nonOvValues:d,attributeType:r,className:C.ovIcon,nonOvTotal:te})),F&&v().createElement(IU,{cardinality:k}),F&&v().createElement(Uk,{message:l,className:C.typeError}),v().createElement("div",{className:C.attributesWrapper},ie.map(((e,t)=>v().createElement(vU,{key:e.uri,attributeValue:e,attributeType:r,lazy:G&&!D,showEmptyEditors:o,errors:s,ownError:(0,S.getAttributeOwnError)(e,t,r.uri,s),mode:a,crosswalks:u,onAddOneMore:oe===t?K:null,onAddAttributes:y,onDeleteAttribute:X,onChangeAttribute:h,onDeactivateError:E,additionalControlsRenderer:T,className:0===t?z:null,ref:0===t?B:null,isEmptyEditor:G}))),ne&&v().createElement(_D,{moreNumber:(0,_.min)(e,le),valueNumber:le,onClick:()=>{t.length<ee&&x({parentUri:n,attributeTypeUri:U,attributeTypeName:L,values:t,defaultMaxValues:e}),R(A+e)}}),ae&&v().createElement(DD,{onClick:()=>{R(e)}}))))};FU.displayName="AttributeRenderer";const MU=(0,b.memo)(FU),VU=(0,wp.Z)({value:{color:"rgba(0, 0, 0, 0.87)"}}),BU=(0,wp.Z)({placeholder:{color:"rgba(0, 0, 0, 0.38)",fontSize:"14px !important"}});function zU(){return zU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zU.apply(null,arguments)}function HU(){return HU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},HU.apply(null,arguments)}const YU={SingleValue:({selectProps:{menuIsOpen:e},data:{label:t}})=>{const r=VU();return!e&&v().createElement(bf(),{variant:"body2",classes:{root:r.value}},t)},Placeholder:({innerProps:e,children:t})=>{const r=BU();return v().createElement(bf(),zU({className:r.placeholder},e),t)}},WU=(0,b.memo)((e=>v().createElement(HL,HU({components:YU},e)))),GU=(0,wp.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},roleContainer:{width:"100%"},valueContainer:{marginLeft:"8px",width:0},deleteButton:{marginLeft:"8px"}}),qU={MultiValue:jy._},ZU=({values:e,onChange:t,onDelete:r})=>{const n=GU(),a=(0,w.AH)(),i=(0,w.eh)(),o=i.uri,l=(0,S.getRolesForEntityType)(a,i.type).map((e=>({value:e.uri,label:e.label}))),s=(e||[]).map((e=>{var t;return{value:e,label:(null===(t=l.find((0,_.propEq)("value",e)))||void 0===t?void 0:t.label)||(0,S.getLastUriPart)(e)}})),c=(0,b.useCallback)((e=>{const r=(null==e?void 0:e.map((0,_.prop)("value")))||[];t({value:r,attributeType:S.EntityAttrTypes.roles,uri:o})}),[o,t]),u=(0,b.useCallback)((()=>{r({uri:o,attributeType:S.EntityAttrTypes.roles})}),[o,r]);return v().createElement("div",{className:n.container,"data-reltio-id":"reltio-attribute-value"},v().createElement(WU,{label:"",height:40,isMulti:!0,options:l,value:s,onChange:c,components:qU,classes:n,className:n.roleContainer}),!!r&&v().createElement(Cp.T,{"data-reltio-id":"reltio-roles-delete-button",className:n.deleteButton,icon:Fk(),onClick:u,size:"L"}))};var $U=r(56333);const KU=(0,wp.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},deleteButton:{marginLeft:"8px"}});function XU(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){QU(e,t,r[t])}))}return e}function QU(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const JU=({className:e,values:t,onChange:r,onDelete:n})=>{const a=KU(),i=(0,w.lG)(),o=(0,w.mU)(),l=(0,b.useCallback)((async(e,t,r)=>{const n=await(0,S.getFacetedAttributeData)({fieldName:"tags",searchValue:e,options:XU({},o,{max:t,pageNo:r})});return Object.keys(n.tags)}),[o]),s=(0,b.useCallback)((e=>{r({value:e,attributeType:S.EntityAttrTypes.tags,uri:i})}),[r,i]),c=(0,b.useCallback)((()=>{n({uri:i,attributeType:S.EntityAttrTypes.tags})}),[i,n]);return v().createElement("div",{className:a.container,"data-reltio-id":"reltio-attribute-value"},v().createElement($U.p,{fullWidth:!0,multiple:!0,variant:"filled",className:e,value:t||[],onChange:s,getSuggestions:l}),!!n&&v().createElement(Cp.T,{"data-reltio-id":"reltio-tags-delete-button",className:a.deleteButton,icon:Fk(),onClick:c,size:"L"}))};function ej(){return ej=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ej.apply(null,arguments)}function tj(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rj=(0,tL.l)(EL,((e,{attributeType:t})=>{const{hasDeletionsMap:r,setHasDeletions:n}=e||{};return{hasDeletions:r?Boolean(r[null==t?void 0:t.uri]):void 0,setHasDeletions:n}}),(e=>{let{values:t,attributeType:r,parentUri:n,mode:a,errorMessage:i,onDeleteAttribute:o,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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.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:f,required:y,cardinality:g}=r,h=(0,S.isEditableMode)(a),[E,T]=(0,b.useState)(!1),x=(0,b.useCallback)((e=>{T(e),null==u||u(r.uri,e)}),[r.uri,u]),C=void 0!==c?c:E,w=(0,b.useCallback)((0,_.pipe)(o,_.T,x),[o,x]),A=(0,S.isEmptyValue)(t),R=!C&&s&&A,I=(0,b.useRef)((0,S.createNewAttribute)({parentUri:n,attributeType:r})),{ref:N,highlightedClassName:P}=LU(p);return(0,S.isActivenessAttrType)(r)&&A&&!R?null:v().createElement("div",{ref:N,className:O()(P,m.wrapper)},v().createElement(tP,{label:f,isRequired:y,className:O()(m.title,m.titleWrapper),"data-reltio-id":"reltio-attribute-label"}),h&&v().createElement(IU,{cardinality:g}),h&&v().createElement(Uk,{message:i}),v().createElement(PI(),{className:m.attributesWrapper},(()=>{switch(r.uri){case S.EntityAttrTypes.tags.uri:return v().createElement(JU,{values:t,onDelete:w,onChange:l});case S.EntityAttrTypes.roles.uri:return v().createElement(ZU,{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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){tj(e,t,r[t])}))}return e}({},I.current,{value:t[0]||""});return v().createElement(vU,ej({attributeValue:e,attributeType:r,mode:a,onDeleteAttribute:w,onChangeAttribute:l},d))}}})()))}));var nj=r(57517),aj=r.n(nj);function ij(){return ij=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ij.apply(null,arguments)}const oj=e=>v().createElement("svg",ij({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgDownload"},e),v().createElement("defs",null,v().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"})),v().createElement("g",{transform:"translate(-3 -3)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"Download_svg__b",fill:"#fff"},v().createElement("use",{xlinkHref:"#Download_svg__a"})),v().createElement("path",{fillOpacity:.54,fill:"#fff",mask:"url(#Download_svg__b)",d:"M0 0h24v24H0z"})));var lj=r(76550),sj=r.n(lj),cj=r(29367),uj=r.n(cj);const pj=(0,wp.Z)((()=>({root:{fontSize:"24px",color:"#fff"}}))),dj=({checked:e,className:t,onClick:r})=>{const n=pj(),a=e?uj():sj();return v().createElement(a,{className:O()(n.root,t),onClick:r})},mj=(0,wp.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,b.memo)((e=>{const{id:t,canBeSelected:r=!1,selected:n=!1,selectionMode:a=!1,onDeselect:i=_.identity,onSelect:o=_.identity,onShareLink:l,onSetAsDefault:s,onDelete:c,onDownload:u=_.identity,onClick:p}=e,d=mj(),[m,f]=(0,b.useState)(!1),{canDelete:y}=Ok(t),g=(0,b.useMemo)((()=>[{text:li().text("Share link"),onClick:l},{text:li().text("Set as default"),onClick:s},{text:li().text("Delete"),onClick:y&&c}].filter((0,_.prop)("onClick"))),[l,s,c,y]),h=e=>()=>(0,_.ifElse)((0,_.equals)(!0),i,o)(e),E=r&&(n||m||a),T=!a&&!n&&m,S=r&&n;return v().createElement("div",{className:O()(d.overlay,{[d.selected]:n,[d.selectionMode]:a}),onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onClick:a?h(n):e=>{e.currentTarget===e.target&&p()},"data-reltio-id":"image-actions-overlay"},E&&v().createElement(dj,{className:d.checkedIcon,checked:n,onClick:h(n)}),T&&v().createElement("div",{className:d.actions},v().createElement(Cp.T,{onClick:u,className:d.actionButton,icon:oj}),v().createElement(EN,{menuId:`image-overlay-actions-${t}`,buttonComponent:Cp.T,buttonProps:{icon:Pd(),className:O()(d.actionButton,d.dropDownMenuButton)},menuItems:g})),S&&v().createElement(Wh(),{className:d.button,variant:"outlined",onClick:i},li().text("Deselect")))}));var yj=r(70251),gj=r.n(yj),hj=r(1937),Ej=r.n(hj);const bj=(0,wp.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}}))),vj=e=>0===e.trim().length,Tj=({onSend:e})=>{const t=bj(),[r,n]=(0,b.useState)(""),[a,i]=(0,b.useState)(null);return v().createElement(PI(),{className:t.root},v().createElement(LI(),{className:t.paper},v().createElement(Ej(),{value:r,onChange:e=>{const t=e.target.value,r=new RegExp(/^(ftp|http|https):\/\/[^ "]+$/).test(t);n(t),r||vj(t)?i(null):i(li().text("URL is not correct"))},classes:{root:t.inputRoot,input:t.input},placeholder:li().text("Paste an image URL here")}),v().createElement(Wh(),{disabled:Boolean(a)||vj(r),variant:"outlined",color:"primary",onClick:()=>{e(r),n(""),i(null)}},li().text("Send"))),a&&v().createElement(bf(),{className:t.errorMessage},a))};var Oj=r(65680),Sj=r(83997);const xj=["image/png","image/jpeg","image/tiff","image/gif","image/bmp"],Cj=({className:e,onAppendFile:t})=>v().createElement(v().Fragment,null,v().createElement("input",{onInput:e=>{t&&t(e.currentTarget.files[0])},style:{display:"none"},accept:xj.join(","),id:"upload-image-button","data-reltio-id":"upload-image-button",type:"file"}),v().createElement("label",{htmlFor:"upload-image-button"},v().createElement(Wh(),{className:e,variant:"contained",color:"primary",component:"span"},li().text("Select image"))));function wj(){return wj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wj.apply(null,arguments)}const Aj=e=>v().createElement("svg",wj({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgUploadIcon"},e),v().createElement("defs",null,v().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__c"},v().createElement("stop",{stopColor:"#FFF",offset:"0%"}),v().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),v().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__d"},v().createElement("stop",{stopColor:"#FFF",offset:"0%"}),v().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),v().createElement("linearGradient",{x1:"67.572%",y1:"54.952%",x2:"15.212%",y2:"13.907%",id:"UploadIcon_svg__e"},v().createElement("stop",{stopColor:"#000",stopOpacity:0,offset:"0%"}),v().createElement("stop",{stopColor:"#000",offset:"100%"})),v().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__f"},v().createElement("stop",{stopColor:"#B8EDFF",offset:"0%"}),v().createElement("stop",{stopColor:"#53ACDE",offset:"100%"})),v().createElement("circle",{id:"UploadIcon_svg__a",cx:128,cy:128,r:128})),v().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"UploadIcon_svg__b",fill:"#fff"},v().createElement("use",{xlinkHref:"#UploadIcon_svg__a"})),v().createElement("use",{fillOpacity:.1,fill:"#0072CE",xlinkHref:"#UploadIcon_svg__a"}),v().createElement("g",{mask:"url(#UploadIcon_svg__b)"},v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(-1 9)"},v().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}),v().createElement("ellipse",{fill:"url(#UploadIcon_svg__c)",opacity:.4,cx:64.553,cy:107.664,rx:61.43,ry:62.336}),v().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})),v().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)"}),v().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)"})))),Rj=(0,wp.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"}}))),_j=({onAppendFile:e,className:t})=>{const r=Rj(),[{canDrop:n,isOver:a},i]=(0,Oj.useDrop)({accept:[Sj.FILE],drop:t=>{t&&e(t.files[0])},collect:e=>({isOver:e.isOver(),canDrop:e.canDrop()})}),o=n&&a;return v().createElement("div",{ref:i,className:O()(r.root,{[r.isActive]:o},t)},v().createElement(Aj,{className:r.icon}),v().createElement(bf(),{className:r.title},li().text("Drag an image here")),v().createElement(bf(),{className:r.description},li().text("Acceptable image types would include JPG, PNG, TIFF, GIF, BMP. Maximum image size: ${MAX_IMAGE_SIZE}Mb",{MAX_IMAGE_SIZE:20})),v().createElement(Cj,{onAppendFile:e}))},Ij=(0,wp.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"}}))),Nj=({children:e,className:t})=>{const r=Ij();return v().createElement(PI(),{className:O()(r.root,t)},v().createElement(PI(),{className:r.border}),v().createElement(bf(),{className:r.text},e),v().createElement(PI(),{className:r.border}))},Pj=(0,wp.Z)({closeIcon:{color:"#fff"}}),Dj=({error:e,onClose:t})=>{const r=Pj();return v().createElement(Bh(),{open:Boolean(e),onClose:t,message:e,action:v().createElement(Ed.k,{className:r.closeIcon,tooltipTitle:li().text("Close"),icon:Tp(),onClick:t})})},kj=(0,wp.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"}}))),Lj=({open:e,onClose:t,onUpload:r})=>{const n=kj(),[a,i]=(0,b.useState)(!1),[o,l]=(0,b.useState)(null),s=(0,w.qD)(),c=(0,w.fN)(),u=(0,w.Uv)(),p=e=>{i(!0),(0,S.uploadImage)({image:e,imageServicePath:s,environment:c,tenant:u}).then((e=>{r(e),t()})).catch((e=>{l((0,S.getRequestErrorMessage)(e,li().text("Something went wrong")))})).finally((()=>i(!1)))};return v().createElement(gj(),{open:e,onClose:t,classes:{paper:n.dialogPaper}},v().createElement(bf(),{className:n.title},li().text("Add new image")),v().createElement(PI(),{className:n.body},v().createElement(_j,{className:n.targetBox,onAppendFile:e=>{if(!e)return l(li().text("No image selected."));const t=Number((e.size/1024/1024).toFixed(2)),r=xj.includes(e.type);t>20?l(li().text("File size exceeds configured max file size.")):r?p(e):l(li().text("File format is not supported."))}}),v().createElement(Nj,{className:n.divider},li().text("or")),v().createElement(Tj,{onSend:e=>{p(e)}})),a&&v().createElement(CE.z,null),v().createElement(Dj,{error:o,onClose:()=>l(null)}))},Uj=(0,wp.Z)((()=>({root:{width:"100%"},image:({imageMargin:e})=>({marginRight:e,cursor:"pointer","&:last-child":{marginRight:0}}),uploadContainer:({imageMargin:e,imageWidth:t,imageHeight:r})=>({backgroundColor:"white",width:t,height:r,cursor:"pointer",border:"1px dashed #0072CE",boxSizing:"border-box",marginRight:e,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}),uploadButton:{width:"50px",height:"50px"},uploadIcon:{fontSize:"36px"}}))),jj={},Fj=({attributeType:e={},attributeValues:t=[],onDeleteAttribute:r,onChangeAttribute:n,requestNextPageOfAttributeValues:a,parentUri:i,paging:o,showNonOv:l,imageSize:s=nk})=>{const c=Uj(s),[u,p]=(0,b.useState)(!1),d=(0,w.ax)("setDefaultProfilePicForModifiedEntity"),m=(0,w.eh)()||jj,f=(0,w.AU)(m.uri),{canCreate:y}=(0,b.useContext)(Tk),g=(0,b.useCallback)((()=>{p((e=>!e))}),[]),h=(0,b.useCallback)((t=>{const r=(0,S.generateUri)(i,e.name),a={};for(const n in t){const i=(e.attributes||[]).find((({name:e})=>e===n));i&&(a[n]=[{uri:(0,S.generateUri)(r,i.name),ov:!0,value:t[n],type:i.uri}])}n({attributeType:e,uri:r,value:a})}),[n,i,e]),E=(0,b.useCallback)((e=>{if(r(e),f===e.uri){var n;const r=(null===(n=t[0])||void 0===n?void 0:n.uri)===e.uri?t[1]:t[0];d({entityUri:m.uri,value:r||{}})}}),[r,m,f,t,d]),T=(t,r)=>{const{onOpenImageGalleryDialog:n,onDownload:a,onShareLink:i,onSetAsDefault:o}=t,l=(0,S.getImageAttributeOvUrl)(r),{uri:s}=r;return v().createElement(fj,{id:s,onShareLink:()=>i(l),onSetAsDefault:()=>o(r),onDelete:()=>E({uri:s,attributeType:e}),onDownload:()=>a([l]),onClick:()=>n(s)})};return v().createElement("div",{className:c.root,"data-reltio-id":"image-line-edit-mode"},v().createElement(OF,{attributeValues:t,attributeType:e,renderImage:e=>(t={})=>{const r=(0,S.getImageAttributeOvThumbnailUrl)(t),{uri:n}=t,{onOpenImageGalleryDialog:a}=e;return v().createElement("div",{className:c.image,key:n},v().createElement(rk,{src:r,overlay:T(e,t),onClick:()=>a(n),size:{imageWidth:s.imageWidth,imageHeight:s.imageHeight},"data-reltio-id":"reltio-attribute-value"}))},overlay:!0,countFixedItems:y?1:0,onUpload:g,onDeleteAttribute:E,imageSize:s,requestNextPageOfAttributeValues:a,paging:o,parentUri:i,showNonOv:l},y&&v().createElement("div",{className:c.uploadContainer,onClick:g},v().createElement(Cp.T,{className:c.uploadButton,iconClassName:c.uploadIcon,icon:aj(),"data-reltio-id":"reltio-upload-image-button"}))),v().createElement(Lj,{open:u,onUpload:h,onClose:g}))},Mj=({attributeType:e,attributeValues:t,paging:r,parentUri:n,showNonOv:a,onDeleteAttribute:i,onChangeAttribute:o,requestNextPageOfAttributeValues:l,highlightedAttribute:s,error:c,highlightedError:u,onDeactivateError:p})=>{const d=jU(),{label:m,description:f,required:y}=e,{ref:g,highlightedClassName:h}=LU(s),{ref:E,errorClassName:T}=uL({highlightedError:u}),x=(0,b.useCallback)((()=>{c&&p&&p((0,S.getErrorId)(c))}),[c,p]);return v().createElement("div",{ref:g,className:O()(d.wrapper,h)},v().createElement("div",{ref:E,className:O()(d.imagesWrapper,T)},v().createElement("div",{className:d.titleWrapper},v().createElement(tP,{className:d.title,label:m,"data-reltio-id":"reltio-attribute-label",isRequired:y}),v().createElement(uP,{description:f})),v().createElement(Gk,{errorMessage:null==c?void 0:c.message,className:d.errorWrapper},v().createElement(Fj,{attributeValues:t,attributeType:e,paging:r,onDeleteAttribute:i,parentUri:n,onChangeAttribute:(0,_.pipe)(o,x),requestNextPageOfAttributeValues:l,showNonOv:a}))))};let Vj=function(e){return e.imageLine="imageLine",e.special="special",e.default="default",e}({});function Bj(){return Bj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bj.apply(null,arguments)}const zj=(0,tL.l)(iL,((e,{attributeType:t,parentUri:r})=>{const{element:n,type:a}=e||{},i=(e=>e===nL.NewAttribute)(a)&&n.uri===t.uri;return{highlightedAttribute:i?e:null,highlightedError:aL(a)&&(0,S.isAttributeTypeError)(n,r,t.uri)?e:null}}),(({values:e,attributeType:t,mode:r=S.Mode.Viewing,crosswalks:n,drawLines:a,paging:i={},parentUri:o,max:l,showEmptyEditors:s,showNonOv:c,highlightedError:u,highlightedAttribute:p,onAddAttributes:d,onDeleteAttribute:m,onChangeAttribute:f,additionalControlsRenderer:y})=>{var g;const h=(0,w.ax)("errorDeactivated"),E=(0,w.ax)("requestNextPageOfAttributeValues"),T=(0,b.useContext)(bL),O=o&&(0,S.getBaseUri)(o),x=(0,b.useMemo)((()=>T[O]||[]),[T,O]),C=(0,w.Jz)(o,t),A=(0,b.useMemo)((()=>(0,S.filterErrorsForHiddenAttributes)(C,x)),[C,x]),R=(0,w.Xj)(),I=(0,w.vd)(),N=(0,S.getAttributePagerActiveTypeErrorMessage)(o,t,R),P=null!==(g=null!=l?l:I)&&void 0!==g?g:1/0,D=(0,_.partition)(S.isOv),[k,L]=D(e),U=c?e:k,j=c?[]:L,F={errorMessage:N,errors:A,mode:r,parentUri:o,onAddAttributes:d,onDeleteAttribute:m,onChangeAttribute:f,onDeactivateError:h,additionalControlsRenderer:y,showEmptyEditors:s,highlightedError:u,highlightedAttribute:p};return(()=>{switch((0,_.cond)([[S.isSpecialAttribute,(0,_.always)(Vj.special)],[S.isImage,(0,_.always)(Vj.imageLine)],[_.T,(0,_.always)(Vj.default)]])(t)){case Vj.special:return v().createElement(YI,{enabled:a},v().createElement(rj,Bj({values:U,attributeType:t},F)));case Vj.imageLine:return v().createElement(YI,{enabled:a},v().createElement(Mj,{attributeValues:U,attributeType:t,paging:i,onDeleteAttribute:m,parentUri:o,onChangeAttribute:f,requestNextPageOfAttributeValues:E,showNonOv:c,highlightedAttribute:p,error:(0,S.getAttributeErrorByTypeUri)(t.uri,A),highlightedError:u,onDeactivateError:h}));default:return v().createElement(MU,Bj({values:U,attributeType:t,max:P,paging:i,crosswalks:n,drawLines:a,requestNextPageOfAttributeValues:E,showNonOv:c,nonVisibleValues:j},F))}})()})),Hj=(0,wp.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"}}),Yj=({attributeType:e,imageAttributeFieldsOrder:t,attributeValue:r,hasChanges:n,onDeleteAttribute:a,onChangeAttribute:i,onAddAttributes:o,onCancel:l,onApply:s,mode:c})=>{const u=Hj(),p=Ak(r,e,t),d=0!==p.length||0===p.length&&n;return v().createElement(PI(),{className:u.root},v().createElement(PI(),{className:u.form},p.map((({attrType:e,values:t})=>v().createElement(zj,{key:e.uri,parentUri:r.uri,attributeType:e,values:t,showEmptyEditors:(0,S.isTempUri)(r.uri),mode:c,drawLines:!1,onDeleteAttribute:a,onChangeAttribute:i,onAddAttributes:o})))),d&&v().createElement(v().Fragment,null,v().createElement(Af(),{className:u.divider}),v().createElement(PI(),{className:u.actions},v().createElement(Wh(),{disabled:!n,onClick:l,className:u.cancelButton},li().text("Cancel")),v().createElement(Wh(),{disabled:!n,onClick:s,color:"primary"},li().text("Apply")))))},Wj={palette:{mode:"dark",primary:S.theme.palette.primary,secondary:S.theme.palette.secondary}},Gj=(0,wm.createTheme)(Wj),qj=({imageAttributeFieldsOrder:e,attributeType:t,attributeValue:r})=>{const n=(0,w.YA)(),a=(0,w.o_)(),{addAttributes:i,changeAttribute:o,deleteAttribute:l,clearLocalChanges:s,applyLocalChanges:c,attributeValue:u,hasChanges:p}=(({initialAttributeValue:e,attributeType:t})=>{const r=(0,w.ax)("modifyAttribute"),[n,a]=(0,b.useState)(e);(0,b.useEffect)((()=>{a(e)}),[e]);const i=!(0,_.equals)(n,e),o=(0,b.useCallback)((e=>{a((t=>e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,S.addAttribute)({entity:e,attributeType:r,parentUri:n,index:a,nestingLevel:1})}),t)))}),[]),l=(0,b.useCallback)((({value:e,attributeType:t,uri:r})=>{a((n=>(0,S.editAttribute)({entity:n,attributeType:t,uri:r,value:e,nestingLevel:1})))}),[]),s=(0,b.useCallback)((({attributeType:e,uri:t})=>{a((r=>(0,S.removeAttribute)({entity:r,attributeType:e,uri:t,nestingLevel:1})))}),[]);return{addAttributes:o,changeAttribute:l,deleteAttribute:s,clearLocalChanges:(0,b.useCallback)((()=>{a(e)}),[e]),applyLocalChanges:(0,b.useCallback)((()=>{r({value:n,attributeType:t,uri:n.uri})}),[n,t,r]),attributeValue:n,hasChanges:i}})({attributeType:t,initialAttributeValue:r});return v().createElement(wm.ThemeProvider,{theme:Gj},v().createElement(PI(),null,v().createElement(Ik,{attributeType:t,uri:null==u?void 0:u.uri,onAddAttributes:a?i:void 0}),v().createElement(kk,{attributeType:t,attributeValue:u,imageAttributeFieldsOrder:e}),a&&v().createElement(Yj,{mode:n,imageAttributeFieldsOrder:e,attributeType:t,attributeValue:u,hasChanges:p,onDeleteAttribute:l,onChangeAttribute:o,onAddAttributes:i,onCancel:s,onApply:c})))},Zj=(0,wp.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}}))),$j=({className:e,attributeValue:t,handleSetAsDefault:r,attributeType:n})=>{const a=Zj(),[i,o]=(0,b.useState)(!1),l=(0,w.eh)()||{},s=(0,w.vc)(null==l?void 0:l.uri)||{},c=(0,w.xH)(),u=(0,w.uO)()||{},p=c?l:s,d=u[null==l?void 0:l.type]||(null==u?void 0:u.default)||{};(0,b.useEffect)((()=>{o((null==p?void 0:p.defaultProfilePic)===(null==t?void 0:t.uri))}),[null==t?void 0:t.uri,p]);const m=(0,b.useCallback)((()=>{r(t.uri)}),[null==t?void 0:t.uri]);return v().createElement(PI(),{className:O()(a.root,e)},v().createElement(PI(),{className:a.header},v().createElement(bf(),{className:a.headerTitle},li().text("Details"))),v().createElement(PI(),{className:a.bodyWrapper},v().createElement(PI(),{className:a.body},v().createElement(bh(),{classes:{root:a.formControlLabel,label:a.checkboxLabel},control:v().createElement(Wp(),{className:a.checkbox,checked:i,onChange:m}),label:li().text("Set as default")}),v().createElement(qj,{attributeType:n,imageAttributeFieldsOrder:d,attributeValue:t}))))},Kj=(0,wp.Z)((()=>({root:{display:"flex",width:"100%",overflowY:"auto",height:"calc(100vh - 64px)"},main:{flex:"1 0 auto"},details:{width:"340px"}}))),Xj=({attributeValues:e=[],currentAttributeValueUri:t,setCurrentAttributeValueUri:r,handleSetAsDefault:n,attributeType:a})=>{const[i,o]=(0,b.useState)(0);(0,b.useEffect)((()=>{l(t?e.findIndex((e=>e.uri===t)):0)}),[t,e]);const l=(0,b.useCallback)((t=>{var n;o(t),r(null===(n=e[t])||void 0===n?void 0:n.uri)}),[e]),s=Kj();return v().createElement(PI(),{className:s.root},v().createElement(mk,{attributeValueIndex:i,setAttributeValueIndex:l,attributeValues:e,className:s.main}),v().createElement($j,{handleSetAsDefault:n,attributeValue:e[i],className:s.details,attributeType:a}))};let Qj=function(e){return e.Gallery="gallery",e.Details="details",e}({});var Jj=r(60480),eF=r.n(Jj),tF=r(54886),rF=r.n(tF),nF=r(86038),aF=r.n(nF),iF=r(39178),oF=r.n(iF);function lF(){return lF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lF.apply(null,arguments)}const sF=e=>v().createElement("svg",lF({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgDetails"},e),v().createElement("defs",null,v().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"})),v().createElement("g",{stroke:"none",strokeWidth:1,fillRule:"evenodd"},v().createElement("mask",{id:"Details_svg__b",fill:"#fff"},v().createElement("use",{xlinkHref:"#Details_svg__a"})),v().createElement("path",{mask:"url(#Details_svg__b)",d:"M0 0h24v24H0z"}))),cF=(0,wp.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}}))),uF=({open:e,mode:t,children:r,header:n,onClose:a,onChangeMode:i})=>{const o=cF(),l=(0,b.useMemo)((()=>[{id:Qj.Gallery,title:li().text("Gallery"),Icon:oF()},{id:Qj.Details,title:li().text("Details"),Icon:sF}]),[]);return v().createElement(gj(),{classes:{paper:o.paper},open:e,BackdropProps:{className:o.backdrop},fullScreen:!0},v().createElement(rF(),{classes:{colorPrimary:o.appBar}},v().createElement(aF(),{className:o.toolbar},v().createElement(PI(),{className:o.headerLeft},v().createElement(Ed.k,{tooltipTitle:li().text("Close"),onClick:a,className:o.closeButton,iconClassName:o.closeIcon,icon:Tp()}),null==n?void 0:n.left),v().createElement(PI(),{className:o.headerCenter},v().createElement(PE,{modes:l,modeId:t,onChange:i,className:o.modeSwitcher})),v().createElement(PI(),{className:o.headerRight},null==n?void 0:n.right))),v().createElement(eF(),{className:o.content},r))},pF=(0,wp.Z)((()=>({root:{padding:"0 24px",overflowY:"auto",height:"calc(100vh - 64px)"},item:{padding:"2px"}}))),dF=({items:e,selectedItems:t,onSelectImage:r,onDeselectImage:n,onShareLink:a,onSetAsDefault:i,onDownload:o,onClickImage:l,onDelete:s})=>{const c=pF(),u=e=>v().createElement(fj,{id:e,selected:t.includes(e),selectionMode:0!==t.length,onSelect:()=>r(e),onDeselect:()=>n(e),onShareLink:()=>a(e),onSetAsDefault:()=>i(e),onDownload:()=>o(e),onClick:()=>l(e),onDelete:s?()=>s(e):void 0,canBeSelected:!0});return v().createElement(PI(),{className:c.root},v().createElement(ck(),{container:!0},e.map((({id:e,src:t})=>v().createElement(ck(),{key:e,classes:{item:c.item},item:!0},v().createElement(rk,{size:JD.LARGE,onClick:()=>l(e),src:t,overlay:u(e)}))))))},mF=(0,wp.Z)((e=>({selectButton:{fontSize:"14px",fontWeight:500,color:e.palette.primary.main,textTransform:"uppercase"}}))),fF=({selectedItems:e,items:t,onSelectAll:r,onClearAll:n})=>{const a=mF(),i=e.length===t.length;return v().createElement(ty(),{component:"button",underline:"none",classes:{button:a.selectButton},onClick:i?n:r},i?li().text("Clear selection"):li().text("Select all images"))};var yF=r(70997),gF=r.n(yF);const hF=(0,wp.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)"}}))),EF=({onDownload:e,onShare:t,onUpload:r,onDelete:n})=>{const a=hF();return v().createElement(v().Fragment,null,r&&v().createElement(Wh(),{variant:"contained",color:"primary",onClick:r,startIcon:v().createElement(aj(),null)},li().text("Upload")),e&&r&&v().createElement("div",{className:a.divider}),e&&v().createElement(Ed.k,{className:a.downloadButton,tooltipTitle:li().text("Download selected items"),icon:oj,onClick:e}),t&&v().createElement(Ed.k,{className:a.shareButton,tooltipTitle:li().text("Copy link"),icon:gF(),onClick:t}),n&&v().createElement(Ed.k,{className:a.deleteButton,tooltipTitle:li().text("Delete selected items"),icon:Fk(),onClick:n}))},bF=({attributeValues:e,open:t,onClose:r,currentAttributeValueUri:n,setCurrentAttributeValueUri:a,attributeType:i,onDownload:o,onShareLink:l,onSetAsDefault:s,onUpload:c,onDeleteAttribute:u})=>{const[p,d]=(0,b.useState)([]),[m,f]=(0,b.useState)(Qj.Gallery),y=(0,w.xH)();(0,b.useEffect)((()=>{f(n?Qj.Details:Qj.Gallery)}),[n]);const g=e.map((e=>({src:(0,S.getImageAttributeOvThumbnailUrl)(e),downloadURL:(0,S.getImageAttributeOvUrl)(e),id:e.uri}))),h=e=>{l(g.find((0,_.propEq)("id",e)).downloadURL)},E=t=>{const r=e.find((({uri:e})=>e===t));s(r)},T=e=>{u({uri:e,attributeType:i})},{canCreate:O,canDelete:x}=(0,b.useContext)(Tk),C=m===Qj.Gallery,A=m===Qj.Details,R=p.length>0,I=A||C&&R,N=()=>C?p:[n],P=N().every((e=>(0,S.isTempUri)(e)||x)),D=!y&&I&&P,k=!y&&O&&(A||C&&!R),L=C&&R&&v().createElement(fF,{items:g,selectedItems:p,onClearAll:()=>{d([])},onSelectAll:()=>{d((0,_.pluck)("id",g))}}),U=v().createElement(EF,{onDelete:D?()=>{N().forEach((e=>{T(e)})),p.length&&d([])}:void 0,onDownload:I?()=>{const e=C?(0,_.pipe)((0,_.filter)((({id:e})=>p.includes(e))),(0,_.pluck)("downloadURL"))(g):[g.find((0,_.propEq)("id",n)).downloadURL];o(e)}:void 0,onShare:A?()=>{h(n)}:void 0,onUpload:k?c:void 0});return v().createElement(uF,{mode:m,open:t,onChangeMode:f,header:{left:L,right:U},onClose:r},C&&v().createElement(dF,{items:g,selectedItems:p,onSelectImage:e=>{d((t=>[...t,e]))},onDeselectImage:e=>{d((t=>t.filter((t=>t!==e))))},onShareLink:h,onSetAsDefault:E,onDownload:e=>{o([g.find((0,_.propEq)("id",e)).downloadURL])},onClickImage:e=>{a(e),f(Qj.Details)},onDelete:y?void 0:T}),A&&v().createElement(Xj,{handleSetAsDefault:E,setCurrentAttributeValueUri:a,currentAttributeValueUri:n,attributeValues:e,attributeType:i}))},vF=(0,wp.Z)((e=>({imageBox:{position:"relative",display:"flex",width:"100%",flexGrow:1,flexShrink:0,flexWrap:"nowrap",marginTop:"2px",overflow:"hidden"},moreButtonContainer:({imageWidth:e,imageHeight:t})=>({backgroundColor:"white",width:e,height:t,position:"absolute",right:0,cursor:"pointer"}),moreButton:({imageWidth:t,imageHeight:r})=>({display:"flex",justifyContent:"center",alignItems:"center",width:t,height:r,backgroundColor:(0,wm.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 TF(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const OF=({attributeType:e,attributeValues:t=[],renderImage:r,overlay:n=!1,countFixedItems:a=0,children:i,onUpload:o,onDeleteAttribute:l,imageSize:s=nk,paging:c,parentUri:u,showNonOv:p,requestNextPageOfAttributeValues:d})=>{const m=vF(s);(0,b.useEffect)((()=>{if(c&&d){const r=p?c.totalOvValues:c.totalValues;r>t.length&&d({parentUri:u,attributeTypeUri:e.uri,attributeTypeName:e.name,values:[],defaultMaxValues:r})}}),[c,d,e,u,t.length,p]);const f=(0,b.useRef)(),[y,g]=(0,b.useState)(0),[h,E]=(0,b.useState)(0),T=(0,b.useContext)(II),[O,x]=(0,b.useState)(!1),[C,A]=(0,b.useState)(),R=(0,w.ax)("setDefaultProfilePicForEntity"),_=(0,w.ax)("setDefaultProfilePicForModifiedEntity"),I=(0,w.eh)()||{},N=(0,w.xH)(),P=(0,b.useCallback)((e=>{const{imageMargin:r,imageWidth:n}=s,i=Math.floor((e+r)/(n+r))-a,o=e+r-(i+a)*(n+r)<8;g(i),t.length>i?E(t.length-i+(o?1:0)):E(0)}),[t.length,a,s]),D=(0,b.useCallback)((e=>{P(e),f.current=e}),[P]);(0,b.useEffect)((()=>{f.current&&P(f.current)}),[t.length,P]);const k=(0,b.useCallback)((e=>{T||(A(e),x(!0))}),[T]),L=(0,b.useCallback)((()=>{x(!1)}),[]),U=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),j=e=>navigator.clipboard.writeText(e),F=(0,b.useCallback)((e=>{N?(0,S.insertDefaultImageByAttrUri)(I.uri,e.uri).then((({status:t})=>{"success"===t&&R(e)})):_({entityUri:I.uri,value:e})}),[N,I.uri,R,_]),M=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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){TF(e,t,r[t])}))}return e}({onOpenImageGalleryDialog:k},n&&{onDownload:U,onShareLink:j,onSetAsDefault:F});return v().createElement(v().Fragment,null,v().createElement(Fp.Z,{handleWidth:!0,onResize:D}),v().createElement(bF,{attributeValues:t,open:O,onClose:L,setCurrentAttributeValueUri:A,currentAttributeValueUri:C,attributeType:e,onDownload:U,onShareLink:j,onSetAsDefault:F,onUpload:o,onDeleteAttribute:l}),v().createElement("div",{className:m.imageBox},i,t.slice(0,y).map(r(M)),h>0&&v().createElement("div",{className:m.moreButtonContainer},v().createElement("div",{className:m.moreButton,onClick:()=>k()},v().createElement(bf(),{className:m.number},`+${h}`)))))},SF=(0,wp.Z)((e=>({image:({imageMargin:e,imageHeight:t,imageWidth:r})=>({marginRight:e,width:r,height:t,cursor:"pointer","&:last-child":{marginRight:0}}),deleteAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,background:`url('${(0,S.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:S.historyPalettes[S.HistoryOperations.deleteAttribute].backgroundColor,pointerEvents:"none"}},updateAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:S.historyPalettes[S.HistoryOperations.updateAttribute].backgroundColor,pointerEvents:"none"}},deleteAttribute:({imageWidth:e,imageHeight:t})=>({width:e,height:t,boxSizing:"border-box",outline:`3px solid ${S.historyPalettes[S.HistoryOperations.deleteAttribute].color}`,outlineOffset:"-3px"}),insertAttribute:({imageWidth:e,imageHeight:t})=>({width:e,height:t,boxSizing:"border-box",outline:`3px solid ${S.historyPalettes[S.HistoryOperations.insertAttribute].color}`,outlineOffset:"-3px"}),updateAttribute:({imageWidth:e,imageHeight:t})=>({width:e,height:t,boxSizing:"border-box",outline:`3px solid ${S.historyPalettes[S.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"}}))),xF=({attributeType:e,attributeValues:t=[],paging:r,parentUri:n,requestNextPageOfAttributeValues:a,showNonOv:i,imageSize:o=nk})=>{const l=SF(o),{appearance:s}=(0,b.useContext)(fP);return v().createElement(OF,{attributeValues:t,attributeType:e,renderImage:({onOpenImageGalleryDialog:e})=>t=>{const r=(0,S.getImageAttributeOvThumbnailUrl)(t),{uri:n}=t,a=(0,S.getHistoryAppearanceByUri)(n,s),i=(0,S.getHistoryAttributeClassName)(a);return v().createElement("div",{className:O()(l.image,{[l[i+"Image"]]:i}),key:n,"data-reltio-id":"reltio-attribute-value"},v().createElement(rk,{onClick:()=>e(n),className:l[i],src:r,size:{imageWidth:o.imageWidth,imageHeight:o.imageHeight}}))},imageSize:o,requestNextPageOfAttributeValues:a,paging:r,parentUri:n,showNonOv:i})},CF=({attributeType:e,attributeValues:t,paging:r,parentUri:n,showNonOv:a,requestNextPageOfAttributeValues:i})=>{const o=xD(),{label:l,description:s}=e;return v().createElement(v().Fragment,null,v().createElement("div",{className:o.titleRow},v().createElement(tP,{className:o.title,label:l,"data-reltio-id":"reltio-attribute-label"}),v().createElement(uP,{className:o.descriptionIcon,description:s})),v().createElement(xF,{attributeValues:t,attributeType:e,paging:r,parentUri:n,requestNextPageOfAttributeValues:i,showNonOv:a}))};function wF(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){AF(e,t,r[t])}))}return e}function AF(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const RF="oneLine",_F="multiLine",IF="imageLine",NF="special",PF=(0,b.memo)((({values:e,attributeType:t,drawLines:r,paging:n={},parentUri:a,max:i,showNonOv:o,classes:l})=>{var s;const c=OD(),u=(0,w.ax)("requestNextPageOfAttributeValues"),p=(0,w.vd)(),d=null!==(s=null!=i?i:p)&&void 0!==s?s:1/0,m=(0,_.partition)(S.isOv);if(!e||!e.length)return null;const[f,y]=m(e),g=o?e:f,h=o?[]:y,E=o?"totalValues":"totalOvValues",b=(0,_.ifElse)((0,_.has)(E),(0,_.prop)(E),(0,_.always)(g.length))(n),T=null!=n&&n.totalValues?n.totalValues-b:h.length,x=1===b&&!(0,S.isComplexAttribute)(t);return v().createElement(YI,{enabled:r,className:O()(wF({[c.paddingWrapperWithLines]:r},null!=l&&l.wrapperWithLines?{[null==l?void 0:l.wrapperWithLines]:r}:{}))},v().createElement("div",{className:O()(wF({[c.paddingWrapper]:!r},null!=l&&l.wrapper?{[null==l?void 0:l.wrapper]:!r}:{}))},(()=>{switch((0,_.cond)([[S.isSpecialAttribute,(0,_.always)(NF)],[S.isImage,(0,_.always)(IF)],[(0,_.always)(x),(0,_.always)(RF)],[_.T,(0,_.always)(_F)]])(t)){case RF:return v().createElement(CD,{value:g[0],nonVisibleValues:h,totalNonVisibleValues:T,attributeType:t,showNonOv:o,classes:l});case _F:return v().createElement(kD,{values:g,nonVisibleValues:h,totalVisibleValues:b,totalNonVisibleValues:T,attributeType:t,parentUri:a,max:d,requestNextPageOfAttributeValues:u,showNonOv:o,classes:l});case IF:return v().createElement(CF,{attributeValues:g,attributeType:t,paging:n,parentUri:a,requestNextPageOfAttributeValues:u,showNonOv:o});case NF:return v().createElement(ZD,{values:g,attributeType:t,classes:l})}})()))})),DF=({attrTypes:e=[],entity:t,parentUri:r,drawLines:n,children:a,className:i,max:o,alwaysVisibleTypeUris:l=gL,showNonOv:s,classes:c})=>{const u=(0,b.useContext)(bL),p=r&&(0,S.getBaseUri)(r),d=(0,b.useMemo)((()=>u[p]||[]),[u,p]),m=(0,b.useMemo)((()=>(e||[]).filter((e=>!d.includes(e.uri)))),[e,d]),[f,y]=(0,b.useState)(o||1/0),g=(0,b.useMemo)((()=>(0,S.getAttributesListForReadMode)(m,t,s)),[m,t,s]),[h,E]=(0,b.useMemo)((()=>Zk(l,g)),[g,l]),T=E.slice(0,f),O=o&&T.length<E.length,x=o&&T.length>=E.length&&o<T.length,C={enabled:n};return v().createElement("div",{className:i},a&&v().createElement(YI,C,a),T.concat(h).map((({attrType:e,values:a})=>v().createElement(PF,{key:e.uri,attributeType:e,drawLines:n,values:a,paging:(0,_.path)(["paging",e.uri],t.attributes),parentUri:r,showNonOv:s,classes:c}))),O&&v().createElement(_D,{onClick:()=>{y(1/0)}}),x&&v().createElement(DD,{onClick:()=>{y(o)}}))};DF.displayName="ReadOnlyAttributesList";const kF=(0,b.memo)(DF),LF=(0,wp.Z)({attributesContainer:{padding:"8px 16px"},noCaption:{paddingTop:"16px"},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"}}),UF=({className:e,entity:t={},caption:r="",excludeUris:n=[],includeUris:a=[],attributesCount:i})=>{const o=LF(),l=(0,w.AH)(),s=(0,w.xK)(),c=(0,b.useMemo)((()=>qk(l,t.type,a,n)),[n,a,l,t]),u=i||16,p=(0,S.getAttributesListForReadMode)(c,t).filter((({values:e})=>!(0,S.isEmptyValue)(e))).length>0;return p||!(0,S.isEmptyValue)(r)?v().createElement(DI.Provider,{value:s},v().createElement(VI,{className:e},r&&v().createElement(BI.I,{title:r}),v().createElement(PI(),{className:O()(o.attributesContainer,{[o.noCaption]:!r})},p?v().createElement(kF,{entity:t,attrTypes:c,parentUri:t.uri,drawLines:!1,max:u}):v().createElement(bf(),{className:o.noData},li().text("No data found"))))):null},jF=(0,wp.Z)({attributesContainer:{overflow:"hidden",padding:"8px 16px"},noCaption:{paddingTop:"16px"}}),FF=({className:e,mode:t,entity:r,caption:n="",excludeUris:a=[],includeUris:i=[],pinnedAttributes:o})=>{const l=jF(),s=(0,w.ax)("addAttributes"),c=(0,w.ax)("modifyAttribute"),u=(0,w.ax)("removeAttribute"),p=(0,w.AH)(),d=(0,w.R2)(),m=(0,w.vc)(r.uri)||{},f=(0,b.useMemo)((()=>(0,S.getPinnedAttributesForUser)(o,d)),[o,d]),y=(0,b.useMemo)((()=>qk(p,m.type,i,a)),[a,i,p,m.type]);return v().createElement(VI,{className:e},n&&v().createElement(BI.I,{title:n}),v().createElement(PI(),{className:O()(l.attributesContainer,{[l.noCaption]:!n})},v().createElement(hL.Provider,{value:f},v().createElement(OL,{entity:m,attrTypes:y,parentUri:m.uri,drawLines:!1,mode:t,showEmptyEditors:(0,S.isTempUri)(m.uri),crosswalks:m.crosswalks,onAddAttributes:s,onChangeAttribute:c,onDeleteAttribute:u}))))};function MF(){return MF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},MF.apply(null,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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributesCount","pinnedAttributes"]);const a=(0,w.Fr)(),i=(0,w.YA)(),o=n.entity||a,l=n.mode||i;return v().createElement(rP.Provider,{value:o},(0,S.isViewMode)(l)?v().createElement(UF,MF({},n,{attributesCount:t,entity:o})):v().createElement(FF,MF({},n,{mode:l,pinnedAttributes:r,entity:o})))},BF=(0,wp.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,mp.useSelector)(Qs),r=(0,mp.useSelector)(Ks);return v().createElement(v().Fragment,null,r&&v().createElement(CE.z,null),t?v().createElement("div",{className:e.container},v().createElement(_I,{entity:t,classes:{profileBand:e.profileBand}}),v().createElement("div",{className:e.scrollWrapper},v().createElement(II.Provider,{value:!0},v().createElement(VF,{className:e.attributesView,entity:t,mode:S.Mode.Viewing})))):v().createElement("div",{className:e.emptyState},v().createElement(xE,{LogoRenderer:SE.NO_DATA,text:li().text("No data to display."),secondaryText:li().text("Select a profile and view preview details here."),variant:OE.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=v().createContext({});ZF.displayName="EntityMarkerContext";var $F=r(17871);const KF=(0,wp.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"}}}}))),XF=({entity:e,classes:t={}})=>{const r=KF(),{secondaryLabel:n,label:a}=t,i=(0,S.getLabel)(e.label),{secondaryLabel:o}=e,l=(0,b.useCallback)((()=>{navigator.clipboard.writeText((0,S.getEntityId)(e))}),[e]);return v().createElement(v().Fragment,null,v().createElement(A,{entity:e,imageClassName:r.image}),v().createElement("div",{className:r.info},v().createElement(Md,{value:(0,S.getEntityUriForLink)(e),className:r.link},v().createElement(od.Y,{value:i,placement:"top",showOnExceededHeight:!0},v().createElement("div",{className:O()(r.label,a)},i))),o&&v().createElement(od.Y,{value:o,placement:"top",showOnExceededHeight:!0},v().createElement("div",{className:O()(r.secondaryLabel,n)},o)),v().createElement("div",{className:r.thirdRow},v().createElement(sE,{entity:e,size:"medium"}),v().createElement("div",{className:r.entityId,onClick:l},v().createElement("div",{className:r.entityIdLabel},li().text("ID:")),v().createElement(od.Y,{value:`Copy to clipboard ${(0,S.getEntityId)(e)}`,placement:"top"},v().createElement("div",{className:r.entityIdValue},(0,S.getEntityId)(e)))))))},QF=(0,wp.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)"}}),JF=()=>{const e=QF();return v().createElement(v().Fragment,null,v().createElement("div",{className:O()(e.avatar,e.wave)}),v().createElement("div",{className:e.info},v().createElement("div",{className:O()(e.label,e.wave)}),v().createElement("div",{className:O()(e.secondaryLabel,e.wave)}),v().createElement("div",{className:O()(e.thirdRow,e.wave)})))},eM=(0,wp.Z)({container:{display:"flex",padding:"16px",overflow:"hidden"}});function tM(){return tM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tM.apply(null,arguments)}const rM=(0,b.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entity","classes","variant"]);const i=eM(),{container:o}=r;return v().createElement("div",tM({className:O()(i.container,o)},a),"normal"===n?v().createElement(XF,{entity:t,classes:r}):v().createElement(JF,null))})),nM=(0,wp.Z)({popper:{maxWidth:"263px",minWidth:"150px",boxShadow:"0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.2)",backgroundColor:"white",borderRadius:"2px"}});function aM(){return aM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aM.apply(null,arguments)}const iM=(0,S.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,S.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>'),lM=(0,b.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["marker","onClick"]);const a=nM(),i=(0,b.useRef)(),[o,l]=(0,b.useState)(!1),{activeEntityUri:s}=(0,b.useContext)(ZF),c=(0,_.pathEq)(["entity","uri"],s,t),u={lat:t.point.lat,lng:t.point.lng},p=(0,b.useCallback)((0,S.debounce)(l,50),[]),d=(0,b.useCallback)((()=>p(!0)),[p]),m=(0,b.useCallback)((()=>p(!1)),[p]),f=(0,b.useCallback)((()=>r(t)),[r,t]);return v().createElement(v().Fragment,null,v().createElement(lN.r,{anchorEl:i.current,open:o,className:a.popper,modal:!1,placement:"top"},v().createElement(rM,{entity:t.entity,onMouseOver:d,onMouseOut:m})),v().createElement($F.Jx,aM({icon:{url:o||c?iM:oM,scaledSize:new google.maps.Size(22,32)},position:u,onClick:f,visible:!1!==t.visible,onMouseOver:d,onMouseOut:m},n)),v().createElement($F.vD,{options:{alignBottom:!0,pane:"mapPane",pixelOffset:new google.maps.Size(0,-40),closeBoxURL:"",enableEventPropagation:!0,disableAutoPan:!0},position:u},v().createElement("span",{ref:i})))}));var sM=r(47111);const cM=({children:e,className:t,position:r,map:n})=>{const[a,i]=(0,b.useState)(null);return(0,b.useEffect)((()=>{const e=document.createElement("div"),t=n.controls[r].length;return n.controls[r].push(e),i(e),()=>{n.controls[r].removeAt(t)}}),[n,r]),(0,b.useEffect)((()=>{a&&t&&a.classList.add(t)}),[t,a]),a?(0,sM.createPortal)(e,a):null};var uM=r(518),pM=r.n(uM);function dM(){return dM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dM.apply(null,arguments)}const mM=e=>v().createElement("svg",dM({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgRadius"},e),v().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 fM(){return fM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fM.apply(null,arguments)}const yM=e=>v().createElement("svg",fM({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgDraw"},e),v().createElement("defs",null,v().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"})),v().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"Draw_svg__b",fill:"#fff"},v().createElement("use",{xlinkHref:"#Draw_svg__a"})),v().createElement("g",{mask:"url(#Draw_svg__b)",fill:"#000",fillOpacity:.54},v().createElement("path",{d:"M0 0h24v24H0z"})))),gM=(0,wp.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"}}),hM=(0,ld.T)(Wh()),EM=({drawingMode:e,drawingModes:t=[],hasActiveOverlay:r,onDrawingModeChanged:n,onClearOverlay:a})=>{const i=gM(),o=e=>()=>{n(e)};return v().createElement("div",{className:i.container},e||r?v().createElement(hM,{tooltipTitle:li().text("Clear area"),className:i.button,onClick:r?a:o(null)},v().createElement(pM(),{className:i.icon})):t.map((e=>{const t=(e=>{switch(e){case HF:return mM;case YF:return yM;default:return null}})(e);return v().createElement(hM,{tooltipTitle:li().text("Draw area"),key:e,className:i.button,onClick:o(e)},v().createElement(t,{className:i.icon}))})))},bM=(0,wp.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"}}}),vM=({isSearchOnMapMove:e,onChangeIsSearchOnMapMove:t})=>{const r=bM();return v().createElement(bh(),{classes:{root:r.container,label:r.label},control:v().createElement(Wp(),{checked:e,onChange:e=>{t(e.target.checked)},className:r.checkbox}),label:li().text("Search as I move the map")})},TM=e=>{const t=e.getBounds(),r=t.getNorthEast(),n=t.getSouthWest(),a=r.lat(),i=r.lng(),o=n.lat(),l=n.lng(),s=[],c=[];if(!(180===i&&-180===l||-180===i&&180===l)){const e=t.getCenter();s.push([a,e.lng()]),c.push([o,e.lng()])}return[[a,i],...s,[a,l],[o,l],...c,[o,i]]},OM=e=>{switch(e){case HF:return window.google.maps.drawing.OverlayType.CIRCLE;case YF:return window.google.maps.drawing.OverlayType.POLYGON;default:return null}},SM=(e,t,r)=>{if(t.path){const n=r||new window.google.maps.LatLngBounds;t.path.forEach((({lat:e,lng:t})=>n.extend(new window.google.maps.LatLng(e,t)))),e.fitBounds(n)}},xM=(0,wp.Z)({mapControlContainer:{borderRadius:"2px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.15)",margin:"10px"}});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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const AM=["drawing"],RM=({markers:e=[],mapKey:t,defaultZoom:r,defaultCenter:n,loadingElement:a,isSearchOnMapMove:i,isSearchEnabled:o,activeOverlay:l,overlayOptions:s={},drawingModes:c=[],markerClusterer:u,markerClustererOptions:p,mapOptions:d={},mapContainerClassName:m,onMapBoundsChanged:f=_.identity,onOverlayUpdated:y=_.identity,onMarkerClicked:g=_.identity})=>{const h=xM(),{isLoaded:E,loadError:T}=(0,$F.Ji)({googleMapsApiKey:t,libraries:AM}),O=(0,b.useRef)(null),[S,x]=(0,b.useState)(null),[C,w]=(0,b.useState)(null),[A,R]=(0,b.useState)(null);(({markers:e,activeOverlay:t,isSearchOnMapMove:r,map:n})=>{const a=Boolean(n&&window.google),i=(0,wy.D)(e),o=(0,wy.D)(t),l=(0,wy.D)(a);(0,b.useEffect)((()=>{const s=i!==e,c=l!==a,u=a&&t&&(o!==t||c);a&&!r&&e.length&&(s||c)?((e,t,r)=>{const n=new window.google.maps.LatLngBounds;if(e.forEach((e=>n.extend(e.point))),1===e.length){const t=e[0].point;n.extend(new window.google.maps.LatLng(t.lat+qF,t.lng+qF)),n.extend(new window.google.maps.LatLng(t.lat-qF,t.lng-qF))}t.fitBounds(n),r&&SM(t,r,n)})(e,n,t):u&&SM(n,t)}),[a,e,t])})({markers:e,activeOverlay:l,map:S,isSearchOnMapMove:i});const I=(0,b.useMemo)((()=>CM({},WF,s)),[s]),N=(0,b.useMemo)((()=>CM({},GF,d)),[d]),P=(0,b.useCallback)((e=>{f(e?TM(S):null),R(null),clearTimeout(O.current)}),[S,f]),D=(0,b.useCallback)((()=>{clearTimeout(O.current)}),[]),k=(0,b.useCallback)((()=>{i&&f(TM(S))}),[i,S,f]),L=(0,b.useCallback)((()=>{i&&(clearTimeout(O.current),O.current=setTimeout(k,1e3))}),[k,i]),U=(0,b.useCallback)(((e,t)=>{var r;const n=t||C&&{type:YF,overlay:C};if((0,_.isEmpty)(n))return;const{overlay:a,type:i}=n,o={[YF]:()=>a.getPath().getArray().map((e=>[e.lat(),e.lng()])),[HF]:()=>({radius:a.getRadius()/1e3,center:a.getCenter()})},l=null===(r=o[i])||void 0===r?void 0:r.call(o);l&&y({data:l,type:i})}),[y,C]),j=(0,b.useCallback)((e=>t=>{U(null,{type:e,overlay:t}),t.setMap(null),R(null)}),[U]),F=(0,b.useCallback)((()=>{y(null)}),[y]),M=t=>e.filter((0,_.prop)("point")).map((e=>v().createElement(lM,{key:e.id,marker:e,clusterer:t,onClick:g})));if(T)return null;if(!E)return a;const V=o&&Boolean(c.length),B=S&&o&&Boolean(c.length),z=S&&o,H=!OM(A)&&l&&(0,_.propEq)("type",YF,l);return v().createElement($F.b6,{mapTypeId:window.google.maps.MapTypeId.ROADMAP,options:N,onLoad:x,zoom:r,center:n,onZoomChanged:D,onDragStart:D,onIdle:L,mapContainerClassName:m},B&&v().createElement(cM,{className:h.mapControlContainer,position:window.google.maps.ControlPosition.TOP_RIGHT,map:S},v().createElement(EM,{hasActiveOverlay:!!l,drawingModes:c,drawingMode:A,onDrawingModeChanged:R,onClearOverlay:F})),z&&v().createElement(cM,{className:h.mapControlContainer,position:window.google.maps.ControlPosition.TOP_CENTER,map:S},v().createElement(vM,{onChangeIsSearchOnMapMove:P,isSearchOnMapMove:i})),u?(Y=p,v().createElement($F.XL,{options:Y},M)):M(),H&&v().createElement($F.mg,{onLoad:w,path:l.path,editable:!0,options:I,onMouseUp:U,onDragEnd:U}),V&&v().createElement($F.j_,{onPolygonComplete:j(YF),onCircleComplete:j(HF),drawingMode:OM(A),options:{drawingControl:!1,circleOptions:I,polygonOptions:I}}));var Y},_M=(e,t)=>Math.abs(e-t)<1,IM=(0,_.curry)(((e,t,r)=>{const n=t.map((({position:t})=>{const r=e.find((({point:e})=>_M(t.lat(),e.lat)&&_M(t.lng(),e.lng)));return(0,_.propOr)("","label",r)})),a=(n.length>2?n.slice(0,2).concat("..."):n).join("\n");let i=0;const o=t.length.toString();let l=o;for(;0!==l;)l=parseInt(l/10,10),i++;return i=Math.min(i,r),{text:o,index:i,title:a}})),NM=[],PM=(0,_.pipe)((0,_.path)(["point","lat"]),(0,_.both)((0,_.gt)(90),(0,_.lt)(-90))),DM={[S.MapSearch.geoPolygon]:YF,[S.MapSearch.geoLocation]:HF},kM=e=>e&&e.length?[...e,e[0]]:e,LM=e=>e[0].map((([e,t])=>({lat:e,lng:t}))).slice(0,-1),UM=(0,wp.Z)((()=>({container:{height:"100%",width:"100%",position:"relative"},fullHeight:{height:"100%"}}))),jM=()=>{const e=UM(),t=(0,mp.useSelector)(k().selectors.getMetadata),r=(0,mp.useSelector)(ai.Qr),n=(0,mp.useSelector)(Ri.AO),a=(0,mp.useSelector)(k().selectors.getGoogleMapKey),{markers:i,loading:o,onMarkerClicked:l}=(({searchResults:e,metadata:t,mapKey:r})=>{e=e||NM;const n=(0,mp.useDispatch)(),[a,i]=(0,b.useState)([]),[o,l]=(0,b.useState)(!1),s=(0,b.useRef)(),c=(0,b.useRef)(),u=(0,b.useCallback)((e=>{n({type:he,payload:e||null})}),[n]),p=(0,b.useCallback)((()=>{clearTimeout(c.current),clearTimeout(s.current)}),[]);return(0,b.useEffect)((()=>{l(!0),(0,S.resolve)(t,e,r).then((e=>{l(!1),i(e.filter(PM))})).catch((()=>{l(!1),i([])}))}),[e,t,r]),{markers:a,loading:o,onMarkerClicked:(0,b.useCallback)((e=>{const t=(0,_.path)(["entity","uri"],e);p(),u(),s.current=setTimeout((()=>u(t)),0),c.current=setTimeout(u,3e3)}),[p,u])}})({searchResults:r,metadata:t,mapKey:a}),{isSearchEnabled:s,activeOverlay:c,onOverlayUpdated:u,isSearchOnMapMove:p,onMapBoundsChanged:d}=(()=>{const e=(0,mp.useDispatch)(),t=(0,mp.useSelector)(ai.Qy),r=(0,mp.useSelector)(ai.bt),n=(0,mp.useSelector)(Ri.d7),[a,i]=(0,b.useState)(!1),o=(0,b.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=S.MapSearch.geoLocation;break}case YF:r=kM(e),n=S.MapSearch.geoPolygon}}i(!1),e(Ka(r,n))}),[e]),l=(0,b.useCallback)((t=>{i(!!t),e(Ka(kM(t),t&&S.MapSearch.onMapMove))}),[e]),s=DM[r],c=(0,b.useMemo)((()=>n&&s&&t.length?{path:s===YF?LM(t):null,type:s}:null),[n,t,s]);return(0,b.useEffect)((()=>{(c||0===t.length)&&i(!1)}),[t,c]),{isSearchEnabled:n,onOverlayUpdated:o,activeOverlay:c,isSearchOnMapMove:a,onMapBoundsChanged:l}})(),m=(0,b.useMemo)((()=>v().createElement("div",{className:e.fullHeight},v().createElement(CE.z,null))),[e]),f=(0,b.useMemo)((()=>({gridSize:60,maxZoom:9,calculator:IM(i)})),[i]),y=(0,b.useMemo)((()=>({activeEntityUri:n})),[n]),g=(0,b.useMemo)((()=>({lat:0,lng:0})),[]),h=(0,b.useMemo)((()=>[YF]),[]);return a?v().createElement("div",{className:e.container},o&&v().createElement(CE.z,null),v().createElement(ZF.Provider,{value:y},v().createElement(RM,{loadingElement:m,defaultZoom:1,defaultCenter:g,onOverlayUpdated:u,onMarkerClicked:l,activeOverlay:c,markers:i,fullscreenControl:!1,markerClusterer:!0,markerClustererOptions:f,drawingModes:h,isSearchOnMapMove:p,onMapBoundsChanged:d,isSearchEnabled:s,mapContainerClassName:e.fullHeight,mapKey:a}))):null},FM=(0,ld.T)(Cp.T),MM=e=>{switch(e){case Z.om.PROFILE:return li().text("Hide entity details");case Z.om.MAP:return li().text("Hide map")}},VM=()=>{const e=AI(),t=(0,mp.useDispatch)(),r=(0,mp.useSelector)(Ri.qx),n=r===Z.om.MAP,a=(0,mp.useSelector)(k().selectors.getGoogleMapKey),i=(0,b.useCallback)((()=>t(Ci(null))),[t]);return(0,b.useEffect)((()=>{!a&&n&&i()}),[a,n,i]),v().createElement("div",{className:e.container},v().createElement(FM,{tooltipTitle:MM(r),tooltipPlacement:"bottom-start",size:"L",icon:wI(),className:e.closeButton,onClick:i}),(e=>{switch(e){case Z.om.PROFILE:return v().createElement(zF,null);case Z.om.MAP:return v().createElement(jM,null)}})(r))},BM=({className:e,loading:t,entities:r,entityTypeTab:n,quantity:a,rowsPerPage:i,page:o,entityToHighlight:l,selectedEntityUri:s,mode:c,previewPanelMode:u,isPreviewPanelOpen:p,dispatch:d})=>{const m=AE(),f=(0,b.useRef)(),[y,g]=(0,b.useState)("50%"),h=(0,Ai.gj)(c),E=u===Z.om.PROFILE,T=u===Z.om.MAP,[x,C]=(0,b.useState)({}),w=(0,b.useCallback)(((e,t)=>{C((0,_.assoc)(e,t))}),[]);(0,b.useEffect)((()=>{f.current&&(f.current.scrollTop=0)}),[r]),(0,b.useEffect)((()=>{E&&((0,S.isEmptyValue)(r)?d(ec(null)):!(0,_.prop)(0,r)||s&&r.map((0,_.prop)("uri")).includes(s)||d(ec(r[0].uri)))}),[d,E,s,r]),(0,b.useEffect)((()=>{!E&&s&&d(tc(null))}),[d,s,E]);const A=(0,b.useCallback)((e=>d(((e,t=0,r)=>({type:U.Z.CHANGE_PAGE,payload:{pageNumber:e,debounceTime:t,entityTypeUri:r}}))(e,250,n))),[d,n]),R=(0,b.useCallback)((e=>d(((e,t)=>({type:U.Z.CHANGE_ROWS_PER_PAGE,payload:{number:e,entityTypeUri:t}}))(e,n))),[d,n]),I=(0,b.useCallback)((e=>d(ec(e))),[d]),N=(0,b.useCallback)((0,S.debounce)((e=>d({type:Ee,payload:e})),50),[d]),P=(0,b.useCallback)((({percentageSize:e})=>g(e)),[]),D=e=>{const t=(0,_.prop)(e.uri,x);return v().createElement(Om,{entity:e,entityImportStatus:t,onEntityImportStatusChange:w})},k=(0,b.useRef)(null);return v().createElement("div",{className:O()(m.container,e)},t&&v().createElement(CE.z,null),(0,Ai.gj)(c)?v().createElement(vI,{quantity:a}):v().createElement(cI,null),v().createElement(oE,{className:m.resizablePanesWrapper,orientation:"vertical",size:p?y:"100%",minSize:480,maxSize:-480,allowResize:p,onChange:P},v().createElement("div",{className:m.pane},v().createElement(wE,{error:v().createElement(xE,{LogoRenderer:SE.ERROR,text:li().text("Something went wrong."),variant:OE.embedded})},(()=>{const e=l||null;return a?v().createElement("div",{className:h?m.tableContainer:m.listContainer,ref:f},h?v().createElement(xI,{entities:r,entityToHighlight:e,selectedEntityUri:s,entityTypeUri:n,onEntityClick:E?I:void 0,onEntityHover:T?N:void 0,entitiesImportStatus:x,onEntityImportStatusChange:w,basicTableRef:k}):v().createElement(fE,{entities:r,entityToHighlight:e,selectedEntityUri:s,onEntityClick:E?I:void 0,onEntityHover:T?N:void 0,entitiesImportStatus:x,entityButtonsRenderer:D}),a>Z.Tu[0]&&v().createElement("div",{className:m.pagination},v().createElement(yE.Z,{count:a,rowsPerPageOptions:Z.Tu,rowsPerPage:i||Z.Tu[0],page:o||0,onChangePage:A,onChangeRowsPerPage:R,basicTableRef:k}))):v().createElement(xE,{LogoRenderer:SE.SEARCH_RESULTS,text:li().text("No results found."),secondaryText:li().text("Try adjusting your search or filter to find what you're looking for."),variant:OE.embedded})})())),v().createElement("div",{className:m.pane},v().createElement(VM,null))))};BM.propTypes={page:dp().number,quantity:dp().number,rowsPerPage:dp().number,entities:dp().array,loading:dp().bool,dispatch:dp().func,entityToHighlight:dp().string,mode:dp().string,entityTypeTab:dp().string,className:dp().string,isPreviewPanelOpen:dp().bool,previewPanelMode:dp().oneOf(Object.values(Z.om)),selectedEntityUri:dp().string},BM.defaultProps={quantity:0,entities:[]};const zM=(0,mp.connect)((e=>{const t=(0,Ri.tB)(e);return{quantity:(0,ai.NU)(e,{entityTypeUri:t}),page:(0,ai.fx)(e,{entityTypeUri:t}),rowsPerPage:(0,ai.Uz)(e,{entityTypeUri:t}),entities:(0,ai.BP)(e,{entityTypeUri:t}),loading:(0,ai.gP)(e),entityToHighlight:(0,Ri.Dn)(e),mode:(0,Ri.XM)(e),entityTypeTab:t,previewPanelMode:(0,Ri.qx)(e),isPreviewPanelOpen:(0,Ri.jr)(e),selectedEntityUri:Xs(e)}}))(BM);var HM=r(4539),YM=r.n(HM),WM=r(4494);const GM=(0,wp.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 v().createElement(ug(),{label:v().createElement("div",{className:t.labelContainer},e.title&&v().createElement("div",{className:t.title},e.title,": "),e.values&&v().createElement(od.Y,{value:r},v().createElement("div",{className:t.values},r))),onDelete:e.onDelete,variant:"outlined",deleteIcon:v().createElement(dg(),{"data-reltio-id":"facet-bar-chip-delete"}),classes:{root:t.root,deleteIcon:t.deleteIcon,label:t.label}})};qM.propTypes={classes:dp().object,title:dp().string,values:dp().array,onDelete:dp().func};const ZM=qM;class $M extends b.PureComponent{constructor(...e){super(...e),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 v().createElement(b.Fragment,null,v().createElement(Wh(),{"aria-describedby":a,color:"primary",variant:"contained",classes:{root:e.root,label:e.label},onClick:this.handleClick},li().text(`+ ${t.length}`)),v().createElement(lN.r,{id:a,open:n,onClose:this.handleClose,anchorEl:r,placement:"bottom-start"},v().createElement(LI(),{elevation:2,classes:{root:e.popperContent}},this.props.items)))}}$M.propTypes={classes:dp().object,items:dp().array},$M.defaultProps={items:[]};const KM=kf()((()=>({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(60904),eV=r(96177),tV=r.n(eV),rV=r(34319);const nV=(0,wp.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){iV(e,t,r[t])}))}return e}function iV(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oV(){return oV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},oV.apply(null,arguments)}const lV=({isOpen:e,isAvailableUpdate:t,isChangedSavedSearch:r,currentSavedSearch:n,onClose:a,onSave:i,onUpdate:o})=>{const l=nV(),[s,c]=(0,b.useState)(""),[u,p]=(0,b.useState)(Z.ib.private),d=t&&n&&s===n.name,m=d&&n.isPublic===(u===Z.ib.public)&&!r,f=(0,b.useCallback)((e=>{c(e.target.value)}),[]),y=(0,b.useCallback)((e=>{p(e)}),[]),g=(0,b.useCallback)((()=>d?o({share:u}):i({name:s,share:u})),[s,i,o,u,d]),h={InputProps:{classes:{input:O()(l.dialogInput,l.dialogFont)}},InputLabelProps:{classes:{root:l.dialogFont}}};return(0,b.useEffect)((()=>{if(e){const e=t?n.name:"",r=t&&n.isPublic?Z.ib.public:Z.ib.private;c(e),p(r)}}),[e,t,n]),v().createElement(gj(),{onClose:a,open:e,PaperProps:{classes:{root:l.dialogRoot}}},v().createElement(QM(),{classes:{root:l.dialogTitle}},li().text("Save search")),v().createElement(eF(),{classes:{root:l.dialogContentRoot}},v().createElement(JM.H,oV({classes:{root:l.dialogField},label:li().text("Name"),required:!0,variant:"filled",value:s,onInput:f,size:"small",autoFocus:!0},h)),v().createElement(rV.k,{entries:Z.m2,TextFieldProps:aV({classes:{root:l.dialogField},required:!0,label:li().text("Share with"),variant:"filled",size:"small"},h),value:u,onChange:y})),v().createElement(tV(),{classes:{root:l.dialogActions},disableSpacing:!0},v().createElement(Wh(),{onClick:a},li().text("Cancel")),v().createElement(Wh(),{color:"primary",onClick:g,disabled:d?m:0===s.length},d?li().text("Save"):li().text("Save as"))))};lV.propTypes={isOpen:dp().bool,isAvailableUpdate:dp().bool,isChangedSavedSearch:dp().bool,currentSavedSearch:dp().object,onClose:dp().func.isRequired,onSave:dp().func.isRequired,onUpdate:dp().func.isRequired};const sV=(0,mp.connect)((e=>{const t=(0,ho.LA)(e);return{isOpen:(0,Ri.jd)(e),isAvailableUpdate:!(0,_.isNil)(t)&&(0,ho.Jv)(e),isChangedSavedSearch:(0,ho.WH)(e),currentSavedSearch:t}}),{onClose:()=>gi(!1),onSave:e=>({type:tr,payload:e}),onUpdate:e=>({type:ar,payload:e})})(lV);var cV=r(11400);function uV(){return uV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},uV.apply(null,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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",uV({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},r),v().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,wp.Z)({button:{marginRight:"-4px"},dialogRoot:{minWidth:"600px",minHeight:"280px"},dialogContentRoot:{display:"flex",flexDirection:"column",gap:"20px"}}),mV=()=>{const e=dV(),t=(0,mp.useStore)(),[r,n]=(0,b.useState)(!1),[a,i]=(0,b.useState)(!1),o=(0,b.useCallback)((()=>n(!1)),[]),l=(0,b.useCallback)((()=>n(!0)),[]),s=(0,b.useCallback)((async(e,r,n)=>{const a=t.getState(),l=(0,bo.Z)(a),s=(0,ho.Cc)(a,!0);i(!0);try{await(0,S.createSavedSearch)([{name:e,description:r,isPublic:n,query:s,uiState:l,type:S.SavedSearchType.SEGMENTATION}]),i(!1),o()}catch(e){(0,ii.U)(e,{defaultMessage:li().text("Something went wrong while saving of the segment")}),i(!1)}}),[t,o]);return v().createElement(v().Fragment,null,v().createElement(Ed.k,{icon:pV,size:"L",onClick:l,tooltipTitle:li().text("Save as segment"),className:e.button}),v().createElement(cV.L,{isOpen:r,isSaving:a,onClose:o,onSave:s}))};function fV(){return fV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fV.apply(null,arguments)}const yV=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",fV({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),v().createElement("g",null,v().createElement("path",{fill:"none",d:"M0 0h24v24H0z"})),v().createElement("g",null,v().createElement("path",{fillOpacity:".54",d:"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"})))};function gV(){return gV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gV.apply(null,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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",gV({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),v().createElement("defs",null,v().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"})),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"svg1966704254b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg1966704254a"})),v().createElement("g",{mask:"url(#svg1966704254b)",fill:"#000",fillOpacity:".54"},v().createElement("path",{d:"M0 0h24v24H0z"}))))};function EV(){return EV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},EV.apply(null,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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",EV({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),v().createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),v().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?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vV.apply(null,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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().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),v().createElement("defs",null,v().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"})),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"svg2486556319b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg2486556319a"})),v().createElement("g",{mask:"url(#svg2486556319b)",fill:"#000",fillOpacity:".54"},v().createElement("path",{d:"M0 0h12v24H0z"}))))};var OV=r(69199),SV=r.n(OV),xV=r(37290),CV=r.n(xV);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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _V=(0,wp.Z)({title:{marginBottom:"-10px"},linkField:{margin:"10px 0"},linkInput:{textOverflow:"ellipsis",fontSize:"14px"}}),IV=({open:e,onClose:t=_.identity})=>{const r=_V(),n=(({enabled:e})=>{const[t,r]=(0,b.useState)(""),n=(0,mp.useSelector)(bo.Z),a=(0,mp.useSelector)(ai.RO),i=(0,mp.useSelector)(k().selectors.getServicesPath),o=(0,mp.useSelector)(k().selectors.getUIPath);return(0,b.useEffect)((()=>{e?(0,S.rawRequest)(`${i}/searchLink`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(AV({},n,{currentTenant:a}))}).then((0,_.pipe)((0,_.prop)("link"),(0,S.getSearchLink)(o),r)).catch(si):r("")}),[e]),t})({enabled:e});return v().createElement(gj(),{open:e,onClose:t},v().createElement(QM(),{className:r.title},li().text("Share link with search results")),v().createElement(eF(),null,v().createElement(SV(),null,li().text("With the URL link, anyone can view these search results. Paste this link in email or IM for testing, analyze, sharing and more.")),v().createElement(CV(),{className:r.linkField,InputProps:{classes:{input:r.linkInput}},label:n?"URL":"",placeholder:li().text("Loading URL..."),value:n,variant:"filled",fullWidth:!0,size:"small"})),v().createElement(tV(),null,v().createElement(Wh(),{onClick:t},li().text("Cancel")),v().createElement(Wh(),{disabled:!n,onClick:(0,_.pipe)((()=>wV(n)),t),color:"primary",autoFocus:!0},li().text("Copy link"))))};IV.propTypes={open:dp().bool,onClose:dp().func};const NV=IV,PV=(0,wp.Z)((()=>({button:{marginRight:"-4px"},exportButtonDisabled:{opacity:"0.54"}}))),DV=({customActions:e=[]})=>{const t=PV(),r=(0,mp.useDispatch)(),n=(0,mp.useSelector)(k().selectors.getUIConfig),a=(0,mp.useSelector)(k().selectors.getCanUserMakeExport),i=(0,mp.useSelector)(k().selectors.getCanUserOpenDataLoader),o=!!(0,S.findPerspectiveConfig)(S.ScreenType.Segmentation,n),l=!!(0,mp.useSelector)(ai.lF),{canExport:s}=(0,mp.useSelector)(Ri.MO),c=s&&a,u=(0,b.useCallback)((()=>{r({type:U.Z.EXPORT_RESULTS})}),[r]),p=(0,b.useCallback)((()=>{r({type:U.Z.OPEN_DATA_LOADER})}),[r]),d=(0,mp.useSelector)(ai.ai),m=(0,b.useCallback)((()=>{r(gi(!0))}),[r]),f=[],[y]=(()=>{const e=(0,mp.useSelector)(k().selectors.getCanUserStartProcessFromQuery),t=(0,mp.useSelector)(k().selectors.getWorkflowPath),r=(0,mp.useSelector)(k().selectors.getWorkflowEnvironmentUrl),n=(0,mp.useSelector)(Ri.FH),a=(0,mp.useSelector)(k().selectors.getTenant),i=(0,mp.useDispatch)(),o=(0,mp.useSelector)(ai.FR),{globalFilter:l}=(0,mp.useSelector)(k().selectors.getGlobalSearchRequestOptions),s=(0,Ua._k)(o,[],l),c=(0,b.useCallback)((()=>{const{processType:e}=n;(0,S.startProcessFromQuery)({workflowPath:t,processType:e,searchString:s,tenant:a,environment:r}).then((()=>{i(xi({message:li().text("Match reviews successfully submitted. Go to Inbox to view their status."),actionToDispatch:D.ui.actions.openAppFromChocolateBar("Inbox"),actionLabel:li().text("Go to inbox"),autoHideDuration:null}))})).catch((e=>{si(e)}))}),[n,t,s,a,r,i]),u=s.includes("matches")||s.includes("matchRules");return[e&&t&&n?{disabled:!u,text:li().text("Request Match Review"),tooltip:li().text("Filter on match rules or potential matches to enable Potential Match Review"),onClick:c,id:"-request-match-review"}:null]})();y&&f.push(y);const[g]=(()=>{const e={NO_ENTITY_TYPE:li().text("Please select exactly one entity type or switch to table mode")},t=(0,mp.useDispatch)(),r=(0,mp.useSelector)(Ri.MO),n=(0,mp.useSelector)(k().selectors.getCanUserMakeBulkUpdate),a=!!(0,mp.useSelector)(ai.lF),i=(0,mp.useSelector)(Zc),o=!!i,l=Boolean(null==r?void 0:r.bulkUpdate),s=(0,mp.useSelector)(k().selectors.getMetadata),c=(0,mp.useSelector)(Ri.Xf),u=l&&n&&!a?{disabled:!o||!(e=>(0,ja.wW)(s,{},c).some((t=>t.value===e)))(i),text:li().text("Bulk update"),tooltip:o?null:e.NO_ENTITY_TYPE,onClick:()=>t(wi(!0)),id:"-bulk-update"}:null;return[u]})();g&&f.push(g);const[h,E]=(0,b.useState)(!1);return f.push({text:li().text("Share link"),onClick:()=>E(!0),id:"-share-link"}),f.push(...e),v().createElement(v().Fragment,null,i&&v().createElement(Ed.k,{icon:bV,size:"L",onClick:p,tooltipTitle:li().text("Load data"),className:t.button,"data-reltio-id":"reltio-search-actions-menu-load-data"}),c&&v().createElement(Ed.k,{icon:yV,size:"L",onClick:u,tooltipTitle:li().text("Export"),showForDisabled:!0,classes:{disabled:t.exportButtonDisabled},className:t.button,disabled:l,"data-reltio-id":"reltio-search-actions-menu-export"}),v().createElement(Ed.k,{tooltipTitle:li().text("Save"),showForDisabled:!0,className:O()({[t.button]:f.length>0}),disabled:!d,onClick:m,icon:hV,size:"L","data-reltio-id":"reltio-search-actions-menu-save"}),o&&v().createElement(mV,null),f.length>0&&v().createElement(EN,{buttonComponent:Cp.T,buttonProps:{icon:TV,size:"L","data-reltio-id":"reltio-search-actions-menu"},menuId:"custom-actions",menuItems:f}),v().createElement(sV,null),v().createElement(NV,{open:h,onClose:()=>E(!1)}))},kV="#FF1744",LV=(0,wp.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,mp.useSelector)(ho.LA),t=(0,mp.useSelector)(ho.WH),r=(0,b.useContext)(WM._),n=LV();if(!e)return null;const a=e.name,i=r?li().text("Segment has changed"):li().text("Saved search has changed");return v().createElement(v().Fragment,null,v().createElement("div",{className:n.wrapper},v().createElement(bf(),{variant:"body2",component:"span",classes:{root:n.for}},li().text("for")),v().createElement(od.Y,{value:a},v().createElement(bf(),{variant:"body2",classes:{root:n.label}},a))),t&&v().createElement(rg(),{title:i,placement:"bottom"},v().createElement("div",{className:n.indicatorWrapper,"data-reltio-id":"changed-indicator"},v().createElement("div",{className:n.indicator}),v().createElement("div",{className:n.indicatorTooltipArea}))))},jV=(0,wp.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,mp.useSelector)(k().selectors.getDataTenants),r=t&&t.length>0,n=(0,mp.useSelector)(ai.t9),a=(0,mp.useSelector)(k().selectors.getTenantName),i=n?n.label:a;return r&&v().createElement("div",{className:e.wrapper},v().createElement(bf(),{variant:"body2",component:"span",classes:{root:e.in}},li().text("in")),v().createElement(od.Y,{value:a},v().createElement(bf(),{variant:"body2",classes:{root:e.label}},i)))};var MV=r(81877),VV=r.n(MV);const BV=(0,wp.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,wp.Z)((e=>({container:{display:"flex",alignItems:"center",paddingTop:17,paddingBottom:11,paddingLeft:15,paddingRight:15},selected:{backgroundColor:(0,wm.alpha)(e.palette.primary.main,.12)}}))),HV=(0,wp.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,wp.Z)({closeButton:{marginRight:"10px"}}),WV=({onClose:e})=>{const t=YV();return v().createElement(Cp.T,{size:"L",icon:Tp(),className:t.closeButton,onClick:e})};WV.propTypes={onClose:dp().func};const GV=WV,qV=({selectedNumber:e,onDelete:t,onClose:r})=>{const n=HV();return v().createElement(v().Fragment,null,v().createElement("div",{className:O()(n.title,n.flex1)},v().createElement(GV,{onClose:r}),v().createElement(bf(),{color:"primary"},li().text("Selected: ${count}",{count:e}))),v().createElement(Ed.k,{tooltipTitle:li().text("Delete"),size:"L",icon:Fk(),className:n.deleteButton,onClick:t}))};qV.propTypes={selectedNumber:dp().number,onClose:dp().func,onDelete:dp().func};const ZV=qV,$V=(0,wp.Z)((()=>({white:{backgroundColor:"rgb(255, 255, 255)",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.24)"}})));function KV(){return KV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},KV.apply(null,arguments)}function XV(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){QV(e,t,r[t])}))}return e}function QV(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const JV=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["classes"]);const n=$V({});return v().createElement(Np,KV({classes:XV({},t,{focused:n.white})},r))};var eB=r(34480),tB=r.n(eB);const rB=(0,wp.Z)((e=>({changedFiltersIndicator:{backgroundColor:(0,wm.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"}}))),nB=e=>e?Z.ib.public:Z.ib.private,aB=e=>e===Z.ib.public,iB=({className:e,findPublic:t,favoriteOnly:r,onChangeFilters:n})=>{const a=rB(),i=(0,b.useRef)(),[o,l]=(0,b.useState)(!1),[s,c]=(0,b.useState)(t),[u,p]=(0,b.useState)(r);(0,b.useEffect)((()=>{c(t),p(r)}),[t,r]);const d=(0,b.useCallback)((()=>l((e=>!e))),[]),m=(0,b.useCallback)((e=>p(e.target.checked)),[]),f=(0,b.useCallback)((()=>{n({findPublic:s,favoriteOnly:u}),d()}),[d,n,s,u]),y=(0,b.useCallback)((()=>{c(t),p(r),d()}),[d,t,r]),g=(0,b.useCallback)((()=>{c(!0),p(!1)}),[]),h=!0===s&&!1===u;return v().createElement(v().Fragment,null,v().createElement(Wh(),{ref:i,color:h?"inherit":"primary",classes:{root:e,textPrimary:a.changedFiltersIndicator},onClick:d},v().createElement(tB(),null)),v().createElement(yp(),{open:o,classes:{paper:a.popupContent},anchorEl:i.current,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},v().createElement(bf(),{className:a.title,variant:"h6"},li().text("Filter")),v().createElement(rV.k,{entries:Z.m2,TextFieldProps:{InputLabelProps:{classes:{root:a.shareWithLabel}},label:li().text("Shared with"),variant:"filled"},classes:{root:a.shareWithRoot,menuItem:a.shareWithMenuItem},fullWidth:!0,value:nB(s),onChange:(0,_.pipe)(aB,c)}),v().createElement(bh(),{classes:{root:a.favoriteOnlyControlRoot,label:a.favoriteOnlyControlLabel},control:v().createElement(Wp(),{className:a.favoriteOnlyCheckbox,checked:u,onChange:m}),label:li().text("Show favorites only")}),v().createElement("div",{className:a.buttonsGroup},v().createElement(Wh(),{onClick:g,disabled:h},li().text("Clear all")),v().createElement("div",null,v().createElement(Wh(),{onClick:y,className:a.cancelButton},li().text("Cancel")),v().createElement(Wh(),{onClick:f,color:"primary"},li().text("Apply"))))))};iB.propTypes={className:dp().string,findPublic:dp().bool,favoriteOnly:dp().bool,onChangeFilters:dp().func,onChangeFavoriteOnly:dp().func};const oB=(0,mp.connect)((e=>({findPublic:(0,ho.kU)(e),favoriteOnly:(0,ho.VS)(e)})),{onChangeFilters:({findPublic:e,favoriteOnly:t})=>({type:pr,payload:{findPublic:e,favoriteOnly:t}})})(iB),lB=({type:e,onSearch:t,placeholder:r,onClose:n})=>{const a=HV();return v().createElement(v().Fragment,null,v().createElement("div",{className:a.main},v().createElement("div",{className:a.title},v().createElement(GV,{onClose:n}),v().createElement(bf(),{variant:"h6"},li().text("Saved & recent searches"))),v().createElement("div",{className:a.searchBox},v().createElement(JV,{fullWidth:!0,onSearch:t,placeholder:r}))),e===Z.uJ.saved&&v().createElement(oB,{className:a.filterButton}))};lB.propTypes={type:dp().oneOf(Object.values(Z.uJ)),onClose:dp().func,onSearch:dp().func,placeholder:dp().string};const sB=lB,cB=({type:e,selectedNumber:t,onClose:r,dispatch:n})=>{const a=zV(),i=(0,b.useCallback)((()=>{const t=e===Z.uJ.saved?{type:Sr}:{type:Mr};n(t)}),[e,n]),o=(0,b.useCallback)((0,S.debounce)((t=>{const r=e===Z.uJ.saved?{type:Ar,payload:t}:{type:Hr,payload:t};n(r)}),500),[e,n]),l=(0,_.cond)([[(0,_.equals)(Z.uJ.saved),(0,_.always)(li().text("Search name"))],[(0,_.equals)(Z.uJ.recent),(0,_.always)(li().text("Search for filtered entity types and attributes"))]])(e);return v().createElement(QM(),{className:O()(a.container,{[a.selected]:t})},t?v().createElement(ZV,{selectedNumber:t,onDelete:i,onClose:r}):v().createElement(sB,{type:e,onSearch:o,onClose:r,placeholder:l}))};cB.propTypes={type:dp().oneOf(Object.values(Z.uJ)).isRequired,selectedNumber:dp().number,onClose:dp().func,dispatch:dp().func};const uB=(0,mp.connect)(((e,t)=>({selectedNumber:t.type===Z.uJ.saved?(0,ho.g2)(e):Ns(e)})))(cB),pB="0.75rem",dB=(0,wp.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:pB},paginationCaption:{fontSize:pB}});var mB=r(54622);const fB=dp().shape({field:dp().string,order:dp().oneOf(["asc","desc"])}),yB=dp().shape({label:dp().string,name:dp().string,description:dp().string,type:dp().string,hidden:dp().bool,faceted:dp().bool,searchable:dp().bool,uri:dp().string,access:dp().arrayOf(dp().string),cardinality:dp().shape({minValue:dp().number,maxValue:dp().number})}),gB=dp().shape({title:dp().string,pathToTitle:dp().arrayOf(dp().string),fieldName:dp().string,entityTypeUri:dp().string,attrType:yB,uri:dp().string,groupName:dp().string}),hB=dp().shape({id:dp().oneOfType([dp().number,dp().string]),values:dp().array,data:gB,filter:dp().string,operator:dp().string}),EB="0.8rem",bB=(0,wp.Z)((e=>{const t=(0,wm.lighten)(e.palette.primary.main,.88),r=(0,wm.alpha)(t,0),n=(0,wm.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,wm.alpha)(n,0)}, ${n} 100%)`}};return{defaultWrapper:{whiteSpace:"nowrap",overflow:"hidden",padding:"0 22px",fontSize:EB,display:"flex",alignItems:"center",height:"100%","&:after":a},numberWrapper:{whiteSpace:"nowrap",overflow:"hidden",padding:"0 24px 0 22px",fontSize:EB,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:EB,"&::-ms-clear":{display:"none"}},nameContainer:{flex:1,overflow:"hidden"},editing:{},editNameButton:{},searchName:{cursor:"pointer",lineHeight:"29px",position:"relative",whiteSpace:"nowrap",overflow:"hidden",fontSize:EB,"&: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:EB},sharingMenuItem:{fontSize:EB,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"}}})),vB=({mode:e})=>{const t=bB(),r=(0,mp.useDispatch)(),n=e===Z.uJ.saved?ho.tc:Ps,a=(0,mp.useSelector)(n),i=e===Z.uJ.saved?ho.hY:Ds,o=(0,mp.useSelector)(i),l=(0,b.useCallback)((()=>{e===Z.uJ.saved?r(o?mo():{type:mr}):r(o?bs():{type:jr})}),[r,o,e]);return v().createElement("div",{className:O()(t.headCell,t.checkbox)},v().createElement(Wp(),{indeterminate:!a&&o,checked:a,onChange:l}))};vB.propTypes={mode:dp().string};const TB=(0,Dd.q)((0,_.pick)(["mode"]))(vB),OB=e=>{const t=t=>{const r=bB(),{rowValue:{checked:n}}=t;return v().createElement("div",{className:O()(r.rowCell,{[r.checkedRowCell]:n})},v().createElement(e,t))};return t.propTypes={rowValue:dp().shape({checked:dp().bool})},t},SB=(0,ld.T)(Wp()),xB=({value:e=!1,rowValue:{uri:t,isOwnSearch:r},onClick:n})=>{const a=bB(),i=!r;return v().createElement("div",{className:O()(a.headCell,a.checkbox)},v().createElement(SB,{showForDisabled:!0,tooltipTitle:i&&li().text("Cannot edit because you're not the owner"),tooltipPlacement:"bottom-start",disabled:i,checked:e,onChange:e=>n(t,e.target.checked)}))};xB.propTypes={value:dp().bool,rowValue:dp().shape({uri:dp().string,isOwnSearch:dp().bool}),onClick:dp().func};const CB=(0,Dd.q)((({onSelectItem:e})=>({onClick:e})))(OB(xB));var wB=r(92332);function AB(){return AB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},AB.apply(null,arguments)}function RB(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){_B(e,t,r[t])}))}return e}function _B(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const IB=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className"]);const n=bB(),{headCellData:a}=r;return v().createElement("div",{className:O()(n.headCell,t)},v().createElement(wB.default,AB({},r,{headCellData:RB({},a,{label:v().createElement(od.Y,{value:a.label},v().createElement("div",{className:n.headLabel},a.label))})})))};IB.propTypes={className:dp().string,headCellData:dp().shape({id:dp().string,label:dp().oneOfType([dp().string,dp().node]),sortable:dp().bool,resizable:dp().bool,className:dp().string,initialWidth:dp().number,minWidth:dp().number,autoResize:dp().bool,renderer:dp().func})};const NB=IB;function PB(){return PB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},PB.apply(null,arguments)}const DB=e=>{const t=bB();return v().createElement(NB,PB({className:t.nameHeadCell},e))};DB.propTypes={headCellData:dp().shape({id:dp().string,label:dp().oneOfType([dp().string,dp().node]),sortable:dp().bool,resizable:dp().bool,className:dp().string,initialWidth:dp().number,minWidth:dp().number,autoResize:dp().bool,renderer:dp().func})};const kB=DB;var LB=r(18122),UB=r.n(LB),jB=r(62839),FB=r.n(jB);function MB(){return MB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},MB.apply(null,arguments)}const VB=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",MB({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),v().createElement("g",null,v().createElement("path",{d:"M0 0h24m0 24H0",fill:"none"}),v().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"}),v().createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"})))};function BB(){return BB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},BB.apply(null,arguments)}const zB=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",BB({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),v().createElement("g",null,v().createElement("path",{d:"M0 0h24m0 24H0",fill:"none"}),v().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"}),v().createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"})))};var HB=r(74492),YB=r.n(HB),WB=r(72246),GB=r.n(WB);const qB=({value:e,rowValue:{uri:t,isFavorite:r,isOwnSearch:n,isEditing:a,isGlobalFilter:i},onStarClick:o,onGlobalClick:l,onApply:s,onChangeName:c,onSetEditing:u})=>{const p=bB(),d=n&&!a,[m,f]=(0,b.useState)(e);(0,b.useEffect)((()=>{f(e)}),[e]);const y=(0,b.useCallback)((()=>{c(t,m)}),[t,m,c]),g=(0,b.useCallback)((()=>o(t,!r)),[o,t,r]),h=(0,b.useCallback)((()=>l(t,!i)),[l,t,i]),E=(0,b.useCallback)((()=>u(t,!0)),[u,t]),T=(0,b.useCallback)((()=>s(t)),[s,t]),S=(0,_.cond)([[(0,_.always)(n),(0,_.always)(li().text("Mark as favorite"))],[(0,_.always)(r),(0,_.always)(li().text("Cannot ummark because you're not the owner"))],[_.T,(0,_.always)("")]])();return v().createElement("div",{className:O()(p.nameWithStar,{[p.editing]:a})},v().createElement(Ed.k,{showForDisabled:!0,tooltipTitle:S,tooltipPlacement:n?"bottom":"bottom-start",disabled:!n,className:O()(p.starButton,{[p.checkedStarButton]:r},{[p.enabledButton]:n}),size:"M",icon:r?UB():FB(),onClick:g}),v().createElement(Ed.k,{tooltipTitle:i?li().text("Remove Global filter"):li().text("Set as Global filter"),className:O()(p.filterButton,p.enabledButton,{[p.checkedFilterButton]:i}),size:"M",icon:i?VB:zB,onClick:h}),v().createElement("div",{className:p.nameContainer},a?v().createElement(GB(),{onClickAway:y},v().createElement("div",null,v().createElement(JM.H,{variant:"filled",hiddenLabel:!0,size:"small",fullWidth:!0,autoFocus:!0,classes:{root:p.nameTextEditorRoot},InputProps:{classes:{input:p.nameInput}},value:m,onInput:e=>f(e.target.value),onKeyDown:(0,_.when)((0,_.propEq)("keyCode",13),y)}))):v().createElement(od.Y,{value:e},v().createElement("div",{className:p.searchName,onClick:T},e))),d&&v().createElement(Ed.k,{tooltipTitle:li().text("Edit"),className:p.editNameButton,size:"M",icon:YB(),onClick:E}))};qB.propTypes={value:dp().string,rowValue:dp().shape({uri:dp().string,isFavorite:dp().bool,isOwnSearch:dp().bool,isEditing:dp().bool,isGlobalFilter:dp().bool}),onStarClick:dp().func,onGlobalClick:dp().func,onApply:dp().func,onChangeName:dp().func,onSetEditing:dp().func};const ZB=(0,Dd.q)((({onChangeIsFavorite:e,onChangeIsGlobal:t,onSearchApply:r,onSetItemEditing:n,onChangeItemName:a})=>({onStarClick:e,onGlobalClick:t,onApply:r,onSetEditing:n,onChangeName:a})))(OB(qB)),$B=({value:e,rowValue:{uri:t,isOwnSearch:r},onChange:n})=>{const a=bB(),i=(0,b.useCallback)((r=>{const a=aB(r);a!==e&&n(t,a)}),[t,e,n]);return v().createElement("div",{className:a.sharingWrapper},v().createElement(rV.k,{entries:Z.m2,value:nB(e),onChange:i,disableUnderline:!0,disabled:!r,MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},elevation:3},TextFieldProps:{classes:{root:a.sharingRoot}},classes:{root:a.sharingInput,menuItem:a.sharingMenuItem,disabled:a.sharingDisabled,icon:O()({[a.sharingIconDisabled]:!r})}}))};$B.propTypes={value:dp().bool,rowValue:dp().shape({uri:dp().string,isOwnSearch:dp().bool}),onChange:dp().func};const KB=(0,Dd.q)((({onChangeIsPublic:e})=>({onChange:e})))(OB($B)),XB=({value:e,rowValue:t,onClick:r})=>{const n=bB(),a=r?()=>r(t):()=>{};return v().createElement(od.Y,{value:e},v().createElement("div",{className:O()(n.defaultWrapper,{[n.clickableArea]:r}),onClick:a},e))};XB.propTypes={value:dp().any,rowValue:dp().object,onClick:dp().func};const QB=OB(XB);function JB(){return JB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},JB.apply(null,arguments)}const ez=e=>{const{rowValue:{updateDate:t,createDate:r}}=e,n=t||r;return v().createElement(QB,JB({},e,{value:n&&li().date(n,"L")}))};ez.propTypes={rowValue:dp().shape({updateDate:dp().number,createDate:dp().number})};const tz=ez,rz=({values:e})=>(0,_.pipe)((0,_.cond)([[_.isNil,_.T],[Array.isArray,(0,_.pipe)(_.flatten,_.isEmpty)],[_.T,_.isEmpty]]),_.not)(e),nz=(0,_.curry)(((e,t)=>(0,_.path)(["facetsData",t.fieldName,"values","length"],e)>0)),az=e=>e&&e.slice(1).join(" / "),iz=(e,t,r)=>(e[t]||(e[t]={title:t,attributes:[]}),e[t].attributes=(0,_.uniq)(e[t].attributes.concat(r)),e),oz=({rowValue:{uiState:e}})=>{const t=bB(),r=(0,b.useMemo)((()=>(({facets:e,advanced:t}={})=>{try{const r=t?((e=[])=>e.flatMap((e=>e.attributes)).filter(rz).reduce(((e,{data:{title:t,groupName:r,pathToTitle:n}})=>{const a=az(n)||t;return iz(e,r,a)}),{}))(t):((e={})=>(e.facetsConfigs||[]).filter((0,_.pipe)(S.isTypeFacet,_.not)).filter(nz(e)).reduce(((e,t)=>{const r=(0,_.path)(["pathToTitle",0],t)||li().text("Special"),n=az(t.pathToTitle)||t.title;return iz(e,r,n)}),{}))(e);return Object.values(r)}catch(e){return[]}})(e)),[e]),n=(0,b.useMemo)((()=>(e=>e.flatMap((e=>e.attributes)).length)(r)),[r]),a=!!r.length&&v().createElement("div",null,r.map((({title:e,attributes:r})=>v().createElement("div",{key:e,className:t.tooltipSection},v().createElement("h6",{className:t.tooltipSectionHeader},e),r.map((e=>v().createElement("div",{key:e,className:t.tooltipText},e)))))));return v().createElement("div",{className:t.numberWrapper},(i=n,a?v().createElement(rg(),{title:a,classes:{tooltip:t.tooltip},disableFocusListener:!0,disableTouchListener:!0},v().createElement("span",null,i)):i));var i};oz.propTypes={rowValue:dp().shape({uiState:dp().shape({facets:dp().object,advanced:dp().array})})};const lz=OB(oz);function sz(){return sz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sz.apply(null,arguments)}const cz=e=>{const t=bB();return v().createElement(NB,sz({className:t.totalHeadCell},e))};cz.propTypes={headCellData:dp().shape({id:dp().string,label:dp().oneOfType([dp().string,dp().node]),sortable:dp().bool,resizable:dp().bool,className:dp().string,initialWidth:dp().number,minWidth:dp().number,autoResize:dp().bool,renderer:dp().func})};const uz=cz;var pz=r(67520),dz=r.n(pz);const mz=({value:e})=>{const t=bB();return v().createElement(od.Y,{value:e},v().createElement("div",{className:t.numberWrapper},li().number(e)))};mz.propTypes={value:dp().number};const fz=OB(mz),yz=e=>{const t=bB(),{rowValue:{isTotalLoading:r,isOwnSearch:n,uri:a},onDeleteItem:i,onLoadTotalForItem:o,value:l}=e,s=(0,b.useCallback)((()=>{i(a)}),[i,a]),c=n?li().text("Delete"):li().text("Cannot delete because you're not the owner"),u=r?li().text("Loading data"):li().text("Load data"),p=(0,b.useCallback)((()=>{o(a)}),[o,a]),d=r||-1===l;return v().createElement("div",{className:t.totalWithButtonsWrapper},d?v().createElement(Ed.k,{showForDisabled:!0,tooltipTitle:u,tooltipPlacement:"bottom-end",disabled:r,size:"L",icon:dz(),onClick:p}):v().createElement(fz,e),v().createElement(Ed.k,{showForDisabled:!0,className:t.deleteButton,tooltipTitle:c,tooltipPlacement:"bottom-end",disabled:!n,size:"L",icon:Fk(),onClick:s}))};yz.propTypes={value:dp().number,rowIndex:dp().number,rowValue:dp().shape({isOwnSearch:dp().bool,isTotalLoading:dp().bool,uri:dp().string}),onDeleteItem:dp().func,onLoadTotalForItem:dp().func};const gz=(0,Dd.q)((({onDeleteItem:e,onLoadTotalForItem:t})=>({onDeleteItem:e,onLoadTotalForItem:t})))(OB(yz));function hz(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ez={rowCellValueRenderer:QB,headCellRenderer:NB,autoResize:!1},bz=[{id:"checked",label:"",initialWidth:55,headCellRenderer:TB,rowCellValueRenderer:CB},{id:"name",get label(){return li().text("Name")},autoResize:!0,headCellRenderer:kB,rowCellValueRenderer:ZB,sortable:!0},{id:"isPublic",get label(){return li().text("Shared with")},rowCellValueRenderer:KB},{id:"owner",get label(){return li().text("Created by")},initialWidth:260},{id:"updateDate",get label(){return li().text("Last modified")},rowCellValueRenderer:tz,sortable:!0},{id:"attributes",get label(){return li().text("Filtered attributes")},rowCellValueRenderer:lz},{id:"total",get label(){return li().text("Number of profiles")},headCellRenderer:uz,rowCellValueRenderer:gz,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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){hz(e,t,r[t])}))}return e}({},Ez,e)));function vz(){return vz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vz.apply(null,arguments)}function Tz(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Oz=({items:e,total:t,sorting:r,page:n,rowsPerPage:a,loading:i,searchValue:o,globalFilterSavedSearchesUris:l=[],onSearchApply:s,onChangeIsFavorite:c,onChangeIsPublic:u,onChangeIsGlobal:p,onChangeRowsPerPage:d,onChangePage:m,onSelectItem:f,onDeselectAllItems:y,onDeleteItem:g,onChangeItemName:h,onSetItemEditing:E,onLoadTotalForItem:T,onSort:O})=>{const x=dB(),C=(0,b.useMemo)((()=>({cellBorder:x.cellBorder})),[x]),[w,A]=(0,b.useState)(null),[R,_]=(0,b.useState)(null),I=(0,b.useRef)(null);(0,b.useEffect)((()=>y),[y]);const N=(0,b.useCallback)((e=>{l.includes(e)?_(e):g(e)}),[l,g]),P=(0,b.useMemo)((()=>({mode:Z.uJ.saved,onSelectItem:f,onChangeIsFavorite:c,onChangeIsGlobal:p,onSearchApply:s,onSetItemEditing:E,onChangeItemName:h,onDeleteItem:N,onLoadTotalForItem:T,onChangeIsPublic:u})),[N,f,c,p,T,s,E,h,u]),D=(0,b.useMemo)((()=>(0,S.isEmptyValue)(o)?{LogoRenderer:SE.SELECT_ATTRIBUTES,text:li().text("No saved searches."),secondaryText:li().text("Save time by creating saved searches for queries you regularly search for.")}:{LogoRenderer:SE.SEARCH_RESULTS,text:li().text("No results found."),secondaryText:li().text("Try adjusting your search or filter to find what you're looking for.")}),[o]),k=(0,b.useMemo)((()=>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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Tz(e,t,r[t])}))}return e}({},e,{isGlobalFilter:l.includes(e.uri)})))),[e,l]);return v().createElement("div",{className:x.tableWrapper},t>0?v().createElement(v().Fragment,null,v().createElement(Rd.M,{columnsData:bz,rowsData:k,context:P,sorting:r,getRowCellHeight:null,defaultColumnWidth:140,defaultColumnMinWidth:140,defaultRowHeight:48,headRowHeight:47,hoverStateEnabled:!0,onSort:O,hoverRowIndex:w,onRowHover:A,classes:C,ref:I}),v().createElement(yE.Z,{classes:{root:x.paginationRoot,caption:x.paginationCaption},count:t,rowsPerPageOptions:Z.Tu,rowsPerPage:a,onChangeRowsPerPage:d,page:n,onChangePage:m,basicTableRef:I}),v().createElement(mB.U,{open:!!R,title:li().text("Keep the global filter?"),content:li().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:li().text("NO, remove it"),saveCaption:li().text("YES, KEEP GLOBAL FILTER"),onCancel:()=>_(null),onDiscard:()=>{p(R,!1),g(R),_(null)},onSave:()=>{g(R),_(null)}})):v().createElement(xE,vz({},D,{variant:OE.embedded})),i&&v().createElement(CE.z,null))};Oz.propTypes={items:dp().arrayOf(dp().shape({uri:dp().string,name:dp().string,isPublic:dp().bool,isFavorite:dp().bool,isOwnSearch:dp().bool,isEditing:dp().bool,checked:dp().bool,owner:dp().string,updateDate:dp().number,query:dp().string})),total:dp().number,sorting:fB,page:dp().number,rowsPerPage:dp().number,loading:dp().bool,searchValue:dp().string,globalFilterSavedSearchesUris:dp().arrayOf(dp().string),onSearchApply:dp().func,onChangeIsFavorite:dp().func,onChangeIsPublic:dp().func,onChangeIsGlobal:dp().func,onChangeRowsPerPage:dp().func,onChangePage:dp().func,onSelectItem:dp().func,onDeselectAllItems:dp().func,onDeleteItem:dp().func,onChangeItemName:dp().func,onSetItemEditing:dp().func,onSort:dp().func};const Sz=(0,mp.connect)((e=>({items:(0,ho.gg)(e),total:(0,ho.Yi)(e),sorting:(0,ho.rT)(e),page:(0,ho.wH)(e),rowsPerPage:(0,ho.s6)(e),loading:(0,ho.w7)(e),searchValue:(0,ho.U3)(e),globalFilterSavedSearchesUris:k().selectors.getGlobalFilterSavedSearchesUris(e)})),{onSearchApply:(e,t=Z.XU)=>({type:Rr,payload:{uri:e,debounceTime:t}}),onChangeIsFavorite:(e,t)=>({type:hr,payload:{uri:e,isFavorite:t}}),onChangeIsPublic:(e,t)=>({type:yr,payload:{uri:e,isPublic:t}}),onChangeIsGlobal:(e,t)=>({type:br,payload:{uri:e,isGlobalFilter:t}}),onChangeRowsPerPage:e=>({type:ur,payload:e}),onChangePage:e=>({type:cr,payload:e}),onSelectItem:(e,t)=>({type:dr,payload:{uri:e,checked:t}}),onDeselectAllItems:mo,onDeleteItem:e=>({type:xr,payload:e}),onChangeItemName:(e,t)=>({type:vr,payload:{uri:e,name:t}}),onSetItemEditing:(e,t)=>({type:Or,payload:{uri:e,isEditing:t}}),onLoadTotalForItem:e=>({type:Ir,payload:e}),onSort:e=>({type:Nr,payload:e})})(Oz),xz=({value:e=!1,rowValue:{createdDate:t},onClick:r})=>{const n=bB();return v().createElement("div",{className:O()(n.headCell,n.checkbox)},v().createElement(Wp(),{checked:e,onChange:e=>r(t,e.target.checked)}))};xz.propTypes={value:dp().bool,rowValue:dp().shape({createdDate:dp().number}),onClick:dp().func};const Cz=(0,Dd.q)((({onSelectItem:e})=>({onClick:e})))(OB(xz));function wz(){return wz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wz.apply(null,arguments)}const Az=e=>{const{rowValue:{createdDate:t}}=e,r=t;return v().createElement(QB,wz({},e,{value:r&&li().date(r,"L LT")}))};Az.propTypes={rowValue:dp().shape({createdDate:dp().number}),onClick:dp().func};const Rz=(0,Dd.q)((({onSearchApply:e})=>({onClick:e})))(Az),_z=e=>{const t=bB(),{rowValue:r,onDeleteItem:n,onLoadTotalForItem:a,value:i}=e,{isTotalLoading:o,createdDate:l}=r,s=(0,b.useCallback)((()=>{n(r)}),[n,r]),c=o?li().text("Loading data"):li().text("Load data"),u=(0,b.useCallback)((()=>{a(l)}),[a,l]),p=o||-1===i;return v().createElement("div",{className:t.totalWithButtonsWrapper},p?v().createElement(Ed.k,{showForDisabled:!0,tooltipTitle:c,tooltipPlacement:"bottom-end",disabled:o,size:"L",icon:dz(),onClick:u}):v().createElement(fz,e),v().createElement(Ed.k,{className:t.deleteButton,tooltipTitle:li().text("Delete"),tooltipPlacement:"bottom-end",size:"L",icon:Fk(),onClick:s}))};_z.propTypes={value:dp().number,rowValue:dp().shape({isTotalLoading:dp().bool,createdDate:dp().number}),onDeleteItem:dp().func,onLoadTotalForItem:dp().func};const Iz=(0,Dd.q)((({onDeleteItem:e,onLoadTotalForItem:t})=>({onDeleteItem:e,onLoadTotalForItem:t})))(OB(_z)),Nz=(0,Dd.q)((({onSearchApply:e})=>({onClick:e})))(QB);function Pz(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Dz={rowCellValueRenderer:QB,headCellRenderer:NB,autoResize:!1},kz=[{id:"checked",label:"",initialWidth:55,headCellRenderer:TB,rowCellValueRenderer:Cz},{id:"createdDate",get label(){return li().text("Created")},rowCellValueRenderer:Rz,initialWidth:256},{id:"name",get label(){return li().text("Query")},autoResize:!0,rowCellValueRenderer:Nz,minWidth:150},{id:"total",get label(){return li().text("Record count")},rowCellValueRenderer:Iz,headCellRenderer:uz,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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Pz(e,t,r[t])}))}return e}({},Dz,e)));function Lz(){return Lz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Lz.apply(null,arguments)}const Uz=({items:e,loading:t,filterWord:r,onSelectItem:n,onDeselectAllItems:a,onSearchApply:i,onDeleteItem:o,onLoadTotalForItem:l})=>{const s=dB(),c=(0,b.useMemo)((()=>({cellBorder:s.cellBorder})),[s]),[u,p]=(0,b.useState)(null);(0,b.useEffect)((()=>a),[a]);const d=(0,b.useMemo)((()=>({mode:Z.uJ.recent,onSelectItem:n,onSearchApply:i,onDeleteItem:o,onLoadTotalForItem:l})),[o,l,n,i]),m=(0,b.useMemo)((()=>(0,S.isEmptyValue)(r)?{LogoRenderer:SE.SELECT_ATTRIBUTES,text:li().text("No recent searches."),secondaryText:li().text("Your recent search history will appear here.")}:{LogoRenderer:SE.SEARCH_RESULTS,text:li().text("No results found."),secondaryText:li().text("Try adjusting your search or filter to find what you're looking for.")}),[r]);return v().createElement("div",{className:s.tableWrapper},e.length>0?v().createElement(Rd.M,{columnsData:kz,rowsData:e,context:d,getRowCellHeight:null,defaultColumnWidth:50,defaultColumnMinWidth:50,defaultRowHeight:48,headRowHeight:47,hoverStateEnabled:!0,hoverRowIndex:u,onRowHover:p,classes:c}):v().createElement(xE,Lz({},m,{variant:OE.embedded})),t&&v().createElement(CE.z,null))};Uz.propTypes={items:dp().arrayOf(dp().shape({uri:dp().string,name:dp().string,isPublic:dp().bool,isFavorite:dp().bool,isOwnSearch:dp().bool,checked:dp().bool,owner:dp().string,createdDate:dp().number,query:dp().string})),loading:dp().bool,filterWord:dp().string,onSelectItem:dp().func,onSearchApply:dp().func,onDeselectAllItems:dp().func,onDeleteItem:dp().func};const jz=(0,mp.connect)((e=>({items:_s(e),loading:Is(e),filterWord:As(e)})),{onSearchApply:(e,t=Z.XU)=>({type:qr,payload:{search:e,debounceTime:t}}),onSelectItem:(e,t)=>({type:Ur,payload:{searchCreatedDate:e,checked:t}}),onDeselectAllItems:bs,onDeleteItem:e=>({type:Br,payload:e}),onLoadTotalForItem:e=>({type:Gr,payload:e})})(Uz),Fz=({open:e,onClose:t})=>{const r=BV(),n=(0,mp.useDispatch)(),a=(0,b.useMemo)((()=>[{value:Z.uJ.saved,label:li().text("Saved searches"),content:v().createElement(Sz,null),dataReltioId:"reltio-search-saved-searches"},{value:Z.uJ.recent,label:li().text("Recent searches"),content:v().createElement(jz,null),dataReltioId:"reltio-search-recent-searches"}]),[]),[i,o]=(0,b.useState)(a[0].value);return(0,b.useEffect)((()=>{e&&(i===Z.uJ.saved?n({type:ir}):n({type:Dr}))}),[e,n,i]),v().createElement(gj(),{classes:{paper:r.dialogPaper},fullWidth:!0,maxWidth:"lg",open:e,onClose:t},v().createElement(uB,{type:i,onClose:t}),v().createElement(eF(),{classes:{root:r.contentRoot}},v().createElement("div",{className:r.tabsWrapper},v().createElement(hI,{value:i,tabs:a,onChange:o,scrollButtons:"auto"})),v().createElement("div",{className:r.tabContent},a.find((0,_.propEq)("value",i)).content)))};Fz.propTypes={open:dp().bool,onClose:dp().func};const Mz=Fz,Vz=(0,wp.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"}}))),Bz=({showTypography:e})=>{const t=Vz(),r=(0,mp.useDispatch)(),n=(0,mp.useSelector)(Ri.tm),a=li().text("Saved & recent searches"),i=(0,b.useCallback)((()=>r(yi(!0))),[r]),o=(0,b.useCallback)((()=>r(yi(!1))),[r]);return v().createElement(v().Fragment,null,v().createElement(rg(),{title:e?"":a},v().createElement(Wh(),{className:t.button,variant:"outlined",startIcon:v().createElement(VV(),{className:O()({[t.compact]:!e}),color:"action"}),onClick:i,"data-reltio-id":"reltio-search-saved-and-recent-search"},e&&v().createElement(bf(),{variant:"button",color:"textPrimary",className:t.buttonText},a))),v().createElement(Mz,{open:n,onClose:o}))},zz=(0,wp.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"}}))),Hz="search",Yz="geoLocation",Wz={},Gz=()=>{const e=zz(),t=(0,mp.useDispatch)(),r=(0,mp.useSelector)(P.Mp),n=(0,mp.useSelector)(P.X0),a=(0,mp.useSelector)(ai.Qw)||Wz,i=(0,mp.useSelector)(k().selectors.getSearchKeyword),o=(0,mp.useSelector)(k().selectors.getDateMask),l=(0,mp.useSelector)(k().selectors.getDateTimeMask),s=(0,mp.useSelector)(k().selectors.getAttributesPresentation)||Wz,c=(0,mp.useSelector)(Ri.IJ),u=(0,mp.useSelector)((e=>(0,ai.NU)(e,{entityTypeUri:void 0}))),p=(0,mp.useSelector)(Ki.go),d=(0,b.useContext)(WM._),[m,f]=(0,b.useState)([]),[y,g]=(0,b.useState)(0),[h,E]=(0,b.useState)(!1),T=(0,b.useRef)(null),[O,x]=(0,b.useState)(!0);(0,b.useEffect)((()=>{f(C())}),[r,n,a,i]),(0,b.useEffect)((()=>{g(m.length),E(!0)}),[m]),(0,b.useEffect)((()=>{if(h){const e=R();g(e),E(!1)}}),[h,n]);const C=(0,b.useCallback)((()=>{const e=Object.values((0,ja.t8)(n,r)).filter((e=>e.values&&e.values.length)).map((e=>{const t=e.title||e.hiddenTitle,r=(0,ja.MI)([...e.data||[],...e.filteredData||[]],(0,_.path)(["attrType","type"],e)===S.DataTypes.TYPE_DATE?e.values.map((e=>e.map((e=>S.utils.dates.toLocalDate(e).getTime())))):e.values.map((0,S.mapFilterValue)((0,S.applyPresentationStrategyToValue)((e=>(0,S.getNumberFormat)((0,S.getAttrDataTypeDefinition)(e.attrType),s,S.intl.getLocale()).strategy)(e)))),e.type,{dateMask:o,dateTimeMask:l});return{fieldName:e.fieldName,title:t,values:r}}));i&&e.push({fieldName:Hz,title:li().text("Search"),values:[i.value]});const{values:[t]=[],type:c}=(0,_.pathOr)({},["mapSearch"],a);return t&&e.push({fieldName:Yz,values:(0,S.getMapSearchValues)(c,t),title:(0,S.getMapSearchLabel)(c)}),e}),[r,n,a,i,s,o,l]),w=(0,b.useCallback)((()=>{g(m.length),E(!0)}),[m]),A=(0,b.useCallback)((e=>{x(e>=410)}),[]),R=(0,b.useCallback)((()=>{if(!T.current)return 0;const{firstChild:e,offsetLeft:t,offsetWidth:r}=T.current,n=t+r;return([...e.childNodes]||[]).filter((a=n,e=>e.offsetLeft+e.offsetWidth<=a)).length;var a}),[T]),I=(0,b.useCallback)((e=>r=>{switch(r.stopPropagation(),e){case Hz:t(D.search.actions.keywordUpdated(null));break;case Yz:t(Ka(null));break;default:t(Ja(e,[]))}}),[t]),N=(0,b.useCallback)((()=>{t(Ga({silent:!0})),t(D.search.actions.keywordUpdated({debounceTime:Z.XU}))}),[t]),L=(0,b.useMemo)((()=>m.map((e=>v().createElement(ZM,{key:e.fieldName,title:e.title,values:e.values,onDelete:I(e.fieldName)})))),[m,I]),U=L.slice(0,y),j=L.slice(y),F=(0,_.when)((0,_.propEq)("length",1),(0,_.reject)(S.isEmptySearchGroup))(p),M=0===L.length&&0===F.length;return v().createElement("div",{className:e.container,"data-reltio-id":"search-bar"},v().createElement("div",{className:e.header},v().createElement("div",{className:e.captionWrapper,"data-reltio-id":"search-bar-total-profiles"},v().createElement(bf(),{component:"span",classes:{body1:e.profileNumber}},li().number(u,"0,0")),v().createElement(bf(),{variant:"body2",component:"span",classes:{root:e.profileText}},li().text("total profiles"))),v().createElement(FV,null),v().createElement(UV,null),v().createElement(Wh(),{color:"primary",className:e.clearButton,onClick:N,disabled:M,"data-reltio-id":"reltio-search-clear"},li().text("clear")),!d&&v().createElement("div",{className:e.searchBarControls,"data-reltio-id":"search-bar-controls"},v().createElement(Fp.Z,{handleWidth:!0,onResize:A}),v().createElement(DV,null),v().createElement(Af(),{orientation:"vertical",className:e.splitter}),v().createElement(Bz,{showTypography:O}))),v().createElement(Fp.Z,{handleWidth:!0,onResize:w}),v().createElement(YM(),{in:!c&&y>0,timeout:500},v().createElement("div",{ref:T,className:e.facetsBar,"data-reltio-id":"search-facets-bar"},v().createElement("div",{className:e.showBar},U),j.length>0&&v().createElement(KM,{items:j}))))},qz=(0,wp.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"}}),Zz=({onBackBtnClick:e})=>{const t=qz();return v().createElement(aF(),{disableGutters:!0,classes:{root:t.toolBar}},v().createElement(Ed.k,{tooltipTitle:li().text("Switch to basic mode"),size:"L",icon:wI(),className:t.backButtonContainer,onClick:e}),v().createElement(bf(),{variant:"subtitle1",className:t.title},li().text("Advanced search")))};Zz.propTypes={onBackBtnClick:dp().func};const $z=Zz,Kz=(0,wp.Z)((e=>({query:{color:e.palette.text.secondary,fontSize:"12px",letterSpacing:0,lineHeight:"16px"},[S.READABLE_QUERY_PRIMITIVE_TYPES.entityTypeLabel]:{color:"#03904A"},[S.READABLE_QUERY_PRIMITIVE_TYPES.attributeLabel]:{color:"#059BEA"},[S.READABLE_QUERY_PRIMITIVE_TYPES.specialAttributeLabel]:{color:"#EA05CF"},[S.READABLE_QUERY_PRIMITIVE_TYPES.attributeFilter]:{color:"#7F00FF"},[S.READABLE_QUERY_PRIMITIVE_TYPES.attributeValue]:{color:"#000000"}})));function Xz(){return Xz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xz.apply(null,arguments)}const Qz=(0,b.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["readableQuery","className"]);const i=Kz();return v().createElement("span",Xz({ref:t,className:O()(i.query,n),"data-reltio-id":"search-readable-query"},a),r.map((({type:e,text:t},r)=>v().createElement("span",{key:r,className:i[e]},t))))}));Qz.displayName="ReadableSearchQuery";var Jz=r(82466),eH=r.n(Jz);const tH=(0,wp.Z)({collapseIcon:{transform:"rotate(0deg)",transition:"transform 0.35s ease"},"collapseIcon--inverted":{transform:"rotate(-180deg)"}});function rH(){return rH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rH.apply(null,arguments)}const nH=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["collapseBtnActive","onCollapseBtnClick"]);const a=tH();return v().createElement(Ed.k,rH({size:"L",icon:eH(),tooltipTitle:t?li().text("Collapse panel"):li().text("Expand panel"),onClick:r,iconClassName:O()(a.collapseIcon,{[a["collapseIcon--inverted"]]:!t}),"data-reltio-id":"reltio-search-advanced-search-collapse-panel"},n))};nH.propTypes={backBtnDisabled:dp().bool,onBackBtnClick:dp().func,collapseBtnActive:dp().bool,onCollapseBtnClick:dp().func};const aH=nH;var iH=r(89808),oH=r.n(iH),lH=r(19820),sH=r.n(lH);function cH(){return cH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cH.apply(null,arguments)}const uH=e=>{let{isFullscreen:t=!1,onClick:r=_.identity}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isFullscreen","onClick"]);return v().createElement(Ed.k,cH({size:"L",icon:t?sH():oH(),tooltipTitle:t?li().text("Exit full screen"):li().text("Full screen"),onClick:r,"data-reltio-id":"reltio-search-advanced-search-full-screen"},n))};uH.propTypes={isFullscreen:dp().bool,onClick:dp().func};const pH=uH,dH=(0,wp.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"}}),mH=({groups:e,hasMinSize:t,lookups:r,metadata:n,attributesPresentation:a,collapseBtnActive:i,isFullscreen:o,onCollapseBtnClick:l,onFullScreenBtnClick:s,keyword:c,map:u,dispatch:p})=>{const d=dH(),[m,f]=(0,b.useState)(0),[y,g]=(0,b.useState)(0),h=(0,b.useMemo)((()=>(0,Ua.Jk)((0,ft.P0)(n,e))),[n,e]),E=(0,S.buildReadableQuery)(n,a,r,e,c,u),T=li().text("Copy to clipboard"),[x,C]=(0,b.useState)(T),w=(0,b.useCallback)((0,S.debounce)((()=>{p({type:dt})}),500),[p]),A=(0,b.useCallback)((()=>{wV((0,S.buildReadableQueryToString)(n,a,r,e,c,u)).then((()=>C(li().text("Query was copied")))).catch((()=>C(li().text("Error"))))}),[e,a,r,n,c,u]),R=(0,b.useCallback)((()=>{C(T)}),[T]),_=(0,b.useCallback)((e=>{f(e.clientX),g(e.clientY)}),[]);(0,dE.D)(w,[w,h]);const I=(0,b.useMemo)((()=>({anchorEl:{clientWidth:1,clientHeight:1,getBoundingClientRect:()=>({left:m,bottom:y,height:1,right:m,width:1,top:y})}})),[m,y]);return v().createElement("div",{className:d.resultQueryPanel},v().createElement("div",{className:d.resultQuery},li().text("Search query"),v().createElement("div",{className:O()(d.queryContainer,{[d.queryContainerMinHeight]:t})},E.length>0?v().createElement(rg(),{key:x,title:x,onClose:R,PopperProps:I},v().createElement(Qz,{readableQuery:E,onMouseEnter:_,onClick:A,className:d.query})):v().createElement("span",{className:d.noQuery},li().text("Build your search and view your search query here")))),v().createElement("div",{className:d.actionsPanel},v().createElement(aH,{collapseBtnActive:i,onCollapseBtnClick:l,className:d.collapseButton}),v().createElement(pH,{isFullscreen:o,onClick:s})))};var fH=r(28345),yH=r.n(fH),gH=r(68157);const hH=(0,wp.Z)((e=>({readOnlyLogicOperatorContainer:{display:"flex",alignItems:"center",marginRight:"40px",width:"76px",fontSize:"14px",color:e.palette.text.secondary,maxHeight:"46px"}}))),EH=({className:e,rowData:t})=>{const r=hH();return v().createElement("div",{className:O()(r.readOnlyLogicOperatorContainer,e)},t&&t.operator?(0,gH.capitalize)(t.operator):li().text("Where"))},bH=(0,wp.Z)((e=>({readOnlyFilter:{display:"flex",alignItems:"center",fontSize:"14px",color:e.palette.text.secondary,width:"50px",marginLeft:"12px",maxHeight:"46px"}}))),vH=({className:e,rowData:t})=>{const r=bH();return v().createElement("div",{className:O()(r.readOnlyFilter,e)},t&&t.filter?(0,S.getFilterOptionLabel)(t.filter):li().text("equals"))},TH=(0,wp.Z)((()=>({row:{display:"flex",marginBottom:"12px"},rowItem:{paddingRight:"10px",display:"flex"},fullWidth:{flexGrow:"1",flexBasis:"0",overflow:"hidden"},hidden:{visibility:"hidden"}}))),OH=(0,b.memo)((e=>{let{classes:t={},rowData:r,previousRowData:n,LogicOperatorComponent:a=EH,AttributeSelectorComponent:i,FilterSelectorComponent:o=vH,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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["classes","rowData","previousRowData","LogicOperatorComponent","AttributeSelectorComponent","FilterSelectorComponent","ValuesEditorComponent","ActionsComponent","filterSelectorRef","attributeSelectorProps"]);const d=TH();return v().createElement("div",{className:O()(d.row,t.root),"data-reltio-id":"query-builder-row"},v().createElement(a,{className:t.logicOperatorContainer,rowContext:p,rowData:n}),v().createElement("div",{className:O()(d.rowItem,t.attributeSelectorContainer),"data-reltio-id":"query-builder-row-attribute-selector"},v().createElement(i,{attributeSelectorProps:u,rowContext:p,rowData:r})),v().createElement("div",{className:O()(d.rowItem,t.filterSelectorContainer),"data-reltio-id":"query-builder-row-filter-selector"},v().createElement(o,{textFieldInputRef:c,rowContext:p,rowData:r})),v().createElement("div",{className:O()(d.rowItem,d.fullWidth,t.valuesEditorContainer),"data-reltio-id":"query-builder-row-values-editor"},v().createElement(l,{rowContext:p,rowData:r})),v().createElement("div",{className:O()(d.rowItem,t.actionsContainer,{[d.hidden]:!r}),"data-reltio-id":"query-builder-row-actions"},v().createElement(s,{rowContext:p,rowData:r})))}));function SH(){return SH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},SH.apply(null,arguments)}const xH=(0,v().memo)((e=>{let{className:t,rowClasses:r,rowsData:n,lastRowAttributeSelectorProps:a,filterSelectorRef:i,filterSelectorRefIndex:o}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.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,_.path)([t-1],n):null,c=t===n.length?{attributeSelectorProps:a}:{};return v().createElement(OH,SH({key:e&&e.id,rowData:e,previousRowData:s,classes:r,filterSelectorRef:t===o?i:void 0},l,c))};return v().createElement("div",{"data-reltio-id":"reltio-query-builder-rows-group",className:t},n.map(s),s(null,n.length,n))})),CH=(0,wp.Z)((()=>({select:{padding:"6px 16px 7px"},dropDown:{width:"100px","&:before":{content:"none !important"}}}))),wH=({className:e,value:t,onChange:r})=>{const n=CH();return v().createElement(rV.k,{className:O()(n.dropDown,e),classes:n,value:t,entries:S.operatorOptions,onChange:r})},AH={position:"absolute",width:1,background:"rgba(43, 152, 240, 0.3)",height:16,left:36};function RH(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){_H(e,t,r[t])}))}return e}function _H(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const IH=(0,wp.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:RH({},AH),upperLine:{marginTop:-18},lowerLine:{marginBottom:-16,bottom:0}}))),NH="46px",PH=(0,wp.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:NH},filterSelect:{width:"190px"},valuesWrapper:{width:"100%",display:"flex",minHeight:NH,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:{}}))),DH=e=>e.join(", "),kH=e=>`calc(${(0,_.isNil)(e)?"100%":`${e}px`} - 35px)`,LH=(0,wp.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)"}}),UH=({list:e,maxWidth:t})=>{const r=LH(),n=(0,b.useRef)(),[a,i]=(0,b.useState)(0);(0,b.useEffect)((()=>{i(((e,t)=>{const r=e.length,n=((e,t)=>{if(t){const r=((e,t)=>{const{childNodes:r,clientLeft:n,clientWidth:a}=t;if(r.length>0){const[t]=Array.from(r),i=document.createRange();i.setStart(t,0);for(let r=0;r<e.length;r++){i.setEnd(t,i.endOffset+e[r].length);const{width:o}=i.getBoundingClientRect();if(n+o>a)return r;r!==e.length-1&&i.setEnd(t,i.endOffset+", ".length)}}return-1})(e,t);return-1===r?0:e.length-r}return 0})(e,t);return r-Math.max(1,r-n)})(e,n.current))}),[e]);const o=DH(e),l=a>0,s=l?DH(e.slice(0,-a)):o;return v().createElement(rg(),{title:l?o:""},v().createElement("div",{className:r.listLabelContainer},v().createElement("div",{style:{width:kH(t)},className:r.listLabel,ref:n},o),v().createElement("div",{className:r.visibleItemsLabel},s),l&&v().createElement("div",{className:r.hiddenCount},`+${a}`)))};function jH(){return jH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jH.apply(null,arguments)}const FH=(0,_.always)(32),MH=(0,b.memo)((e=>{let{selectedItems:t,onItemClick:r,focusIndex:n,width:a,height:i}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["selectedItems","onItemClick","focusIndex","width","height"]);return v().createElement(Vp,jH({getItemSize:FH,renderItem:(e,{item:a},i)=>{const o=!!t.find((e=>a.uri===e)),l=i===n;return v().createElement(pd,{key:a.uri,onClick:r,checked:o,data:a,label:v().createElement(dd.o,{text:a.label,highlight:a.filterText}),labelInText:a.label,style:e,isFocused:l,hideIcon:!0,LogoIcon:a.LogoIcon})},focusIndex:n,fixedTitle:!1,disableHorizontalScrollbar:!0,width:a,height:i},o))}));MH.displayName="SelectMetadataTypesList";const VH=(0,wp.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 BH(){return BH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},BH.apply(null,arguments)}function zH(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){HH(e,t,r[t])}))}return e}function HH(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const YH=(0,b.memo)((({placeholder:e,classes:t={},items:r,selectedItemsUris:n,onChange:a,ListLabelProps:i={},disabled:o,enableEmptyValueUnderline:l,single:s,label:c,dataReltioId:u,selectionPopupTitle:p})=>{const d=VH(),[m,f]=(0,b.useState)(!1),y=(0,b.useCallback)((()=>f(!0)),[]),g=(0,b.useCallback)((()=>f(!1)),[]),[h,E]=(0,b.useState)(""),T=(0,b.useCallback)((()=>E("")),[]),x=(0,b.useCallback)((0,_.pipe)(T,g),[g,T]),C=r.filter((({label:e})=>S.utils.strings.search(e,h))).map(((e,t)=>({item:{item:zH({},e,{filterText:h})},index:t}))),w=(0,b.useMemo)((()=>(0,_.pipe)((0,_.map)((e=>r.find((0,_.propEq)("uri",e)))),(0,_.reject)(_.isNil),(0,_.pluck)("label"))(n)),[n,r]),A=(0,b.useCallback)(((e,t)=>{s?(a(t?[e.uri]:[]),x()):a(t?n.concat(e.uri):n.filter((t=>t!==e.uri)))}),[n,a,s,x]),R=(0,b.useCallback)((({item:e})=>{const t=!n.includes(e.uri);A(e,t)}),[n,A]),{focusIndex:I,handleKeyDown:N}=Bp({items:C,open:m,onSelectFocusedItem:R,selectedItems:n,onClose:x}),P=(0,b.useRef)(),D=P.current?P.current.getBoundingClientRect().width:0,k=Math.max(D,255),L=0===n.length;return v().createElement(v().Fragment,null,v().createElement(CV(),{label:c,ref:P,InputProps:{startAdornment:L&&!e?null:v().createElement("div",{className:O()(d.inputText,t.inputText)},L?v().createElement("div",null,e):v().createElement(UH,BH({},i,{list:w}))),classes:{root:d.inputRoot,input:O()(d.input,t.input,{[d.emptyInput]:L&&!e}),disabled:O()(d.disabledInput,{[d.disabledPointer]:o}),underline:d.disabledUnderline},endAdornment:v().createElement(Cp.T,{size:"L",icon:ny(),iconClassName:O()(d.icon,{[d["popup-opened-icon"]]:m}),disabled:o}),readOnly:!0,disableUnderline:L&&!l},inputProps:{tabIndex:-1},InputLabelProps:{classes:{root:O()(d.inputLabel,t.label)}},value:"",onClick:o?void 0:y,classes:{root:O()(d.root,t.root)},size:"small",variant:"filled",disabled:o,"data-reltio-id":u}),v().createElement(kp,{open:m,anchorEl:P.current,onClose:x,onSearch:E,title:p,containerWidth:k,containerHeight:355,searchInputOnKeyDown:N,transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"left",vertical:"bottom"},PaperProps:{"data-reltio-id":`${u}-popup`}},v().createElement(MH,{items:C,onItemClick:A,selectedItems:n,width:k,height:245,focusIndex:I})))}));YH.displayName="MetadataTypesSelector";const WH=(0,b.memo)((({entityTypes:e,selectedEntityTypes:t,single:r,placeholder:n,enableEmptyValueUnderline:a,onChange:i,classes:o={},ListLabelProps:l={},disabled:s=!1})=>{const c=(0,b.useMemo)((()=>e.filter(S.isAvailableEntityType)),[e]);return v().createElement(YH,{items:c,selectedItemsUris:t,single:r,placeholder:n,enableEmptyValueUnderline:a,onChange:i,classes:o,ListLabelProps:l,disabled:s,label:li().text("Entity type"),dataReltioId:"entity-type-selector",selectionPopupTitle:li().text("Select entity types")})}));WH.displayName="EntityTypesSelector";const GH=({selectedEntityTypes:e,onChange:t,classes:r={},ListLabelProps:n={}})=>{const a=(0,mp.useSelector)(k().selectors.getMetadata),i=(0,mp.useSelector)(ai.t9),o=(0,mp.useSelector)(Ri.Xf),l=(0,b.useCallback)(o?({uri:e})=>o.includes(e):_.identity,[o]),s=(0,b.useMemo)((()=>a.entityTypes.filter(l).sort(o?(0,S.orderByArrayComparator)(o,"uri"):e=>0).filter((({uri:e})=>(0,S.isAvailableEntityTypeForDataTenant)(i,e)))),[a,i,l,o]);return v().createElement(WH,{classes:r,entityTypes:s,onChange:t,selectedEntityTypes:e,ListLabelProps:n,placeholder:li().text("All"),enableEmptyValueUnderline:!0})};GH.propTypes={selectedEntityTypes:dp().arrayOf(dp().string).isRequired,onChange:dp().func.isRequired,classes:dp().shape({root:dp().string,label:dp().string}),ListLabelProps:dp().shape({maxWidth:dp().number})};const qH=GH,ZH=(0,wp.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)"}}}}),$H=(0,_.either)((0,_.prop)("title"),(0,_.prop)("fieldName")),KH=({value:e,getLabel:t=$H,onSelectAttributeClick:r,disabled:n=!1})=>{const a=ZH(),i=e&&t(e);return v().createElement("div",{onClick:n?void 0:r,className:O()(a.attribute,{[a.attributeWithValue]:!!i},{[a.disabled]:n})},v().createElement(od.Y,{value:i},v().createElement("div",{className:O()(a.name,{[a.disabled]:n})},i||v().createElement("span",{className:a.noSelect},li().text("Select attribute")))),v().createElement(Cp.T,{size:"M",icon:ny(),disabled:n}))},XH=(0,wp.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 QH(){return QH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},QH.apply(null,arguments)}function JH(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){eY(e,t,r[t])}))}return e}function eY(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tY=(0,b.memo)((e=>{let{selectedAttributes:t,onItemClick:r,focusIndex:n,hideCheckBox:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["selectedAttributes","onItemClick","focusIndex","hideCheckBox"]);const o=XH(),l=(0,w.AH)();return v().createElement(Vp,QH({getItemSize:(e,t)=>t.items?40:28,renderItem:(e,{item:i,level:o,groupId:l,groupName:s},c)=>{const u=Kk(i,t),p=c===n;return v().createElement(pd,{key:`item-${l}-${i.fieldName}`,onClick:r,checked:u,data:JH({},i,{groupName:s}),notSelectable:i.notSelectable,hideCheckBox:a,label:v().createElement(dd.o,{text:i.title,highlight:i.filterText}),labelInText:i.title,level:o,style:e,isFocused:p,groupId:l,LogoIcon:i.LogoIcon})},renderGroupTitle:(e,t)=>v().createElement(Xm(),{component:"div",className:o.subHeader,style:e,key:`group-${t.item.id}`},t.item.needGroupIcon&&v().createElement(Mf,{group:t.item,metadata:l}),t.item.title),focusIndex:n},i))}));function rY(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){nY(e,t,r[t])}))}return e}function nY(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const aY=(e,t)=>e.title.toLowerCase().includes(t.toLowerCase()),iY=(e,t)=>aY(e,t)||(e.children||[]).some((e=>iY(e,t))),oY=(e,t)=>e.findIndex($k(t)),lY=(0,S.getMaxItemWidth)("title"),sY=(e,t,r,n,a=0,i=!1)=>{const o=aY(e,n);return[{item:n?rY({},e,{filterText:n}):e,level:a,groupId:t,groupName:r}].concat(e.children?e.children.filter((e=>i||o||iY(e,n))).flatMap((e=>sY(e,t,r,n,a+1,i||o))):[]).flat()},cY=(0,_.curry)(((e,t)=>t.map((t=>({item:t,items:t.attributes.filter((t=>iY(t,e))).map((r=>sY(r,t.id,t.title,e)))}))).filter((e=>e.items.length)))),uY=(0,wp.Z)({selector:{minWidth:"200px",width:"100%",alignItems:"stretch",background:"rgba(0,0,0, 0.0267)",boxSizing:"border-box",borderRadius:"4px",display:"flex"}}),pY=(0,b.memo)((({className:e,itemsGroups:t,value:r,getLabel:n,onSelect:a,onRestoreFocus:i=_.identity,onOpenPopup:o=_.identity,disableRestoreFocus:l=!1,disableEnforceFocus:s=!1,single:c=!1,ungroup:u=!1,disabled:p=!1,hideCheckBox:d=!1})=>{const m=uY(),[f,y]=(0,b.useState)(null),g=(0,b.useCallback)((()=>y(null)),[]),h=!!f,[E,T]=(0,b.useState)(""),S=(0,b.useCallback)((()=>T("")),[]),[x,C]=(0,b.useState)([]),w=(0,b.useCallback)((()=>C([])),[]),A=(0,b.useMemo)((()=>cY(E,t)),[t,E]),R=(0,b.useMemo)((()=>(0,_.pipe)((0,_.when)((0,_.always)(u),(0,_.chain)((0,_.pipe)((0,_.prop)("items"),_.flatten,(0,_.map)((0,_.pick)(["item","level"]))))),Lp)(A)),[u,A]),I=(0,b.useMemo)((()=>Math.max(lY(A),308)),[A]),N=(0,_.pipe)((0,_.tap)((0,_.pipe)(w,S,g)),i),P=(0,b.useRef)(),D=(0,b.useCallback)(((e,t)=>{a({checked:t,attribute:e,index:t?x.length:oY(x,e),selectedAttributes:x}),c?(C(t?[e]:[]),N({})):(C((({attribute:e,selectedAttributes:t,checked:r})=>r?t.concat(e):t.filter((t=>!$k(e,t))))({selectedAttributes:x,attribute:e,checked:t})),P.current&&P.current.focus())}),[x,a,c,N,P]),k=(0,b.useCallback)((({onListItemClick:e,selectedAttributes:t})=>({item:r,groupData:n})=>{const a=Kk(r,t);e(rY({},r,{groupName:n.groupName}),!a)})({onListItemClick:D,selectedAttributes:x}),[D,x]),{focusIndex:L,handleKeyDown:U}=Bp({items:R,open:h,onSelectFocusedItem:k,selectedItems:x,onClose:N});return v().createElement("div",{className:O()(m.selector,e),"data-reltio-id":"attribute-selector"},v().createElement(KH,{value:r,getLabel:n,onSelectAttributeClick:e=>{o(),y(e.currentTarget)},disabled:p}),v().createElement(kp,{open:h,anchorEl:f,onClose:N,onSearch:T,title:li().text("Select attribute"),containerWidth:I,containerHeight:507,searchInputOnKeyDown:U,anchorOrigin:{horizontal:"right",vertical:"bottom"},searchInputRef:P,disableRestoreFocus:l,disableEnforceFocus:s},v().createElement(tY,{items:R,onItemClick:D,selectedAttributes:x,width:I,height:400,focusIndex:L,hideCheckBox:d})))}));var dY=r(80349);function mY(){return mY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mY.apply(null,arguments)}const fY=(0,b.memo)((e=>{let{entityTypes:t,recommendedAttributes:r,showReferencedEntityAttributes:n=!0,firstLevelAttributesFilter:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entityTypes","recommendedAttributes","showReferencedEntityAttributes","firstLevelAttributesFilter"]);const o=(0,mp.useSelector)(k().selectors.getMetadata),l=(0,mp.useSelector)(ai.t9),s=(0,mp.useSelector)(k().selectors.getCanUserReadWorkflowDataTask),c=(0,mp.useSelector)(Ri.Xf),u=(0,mp.useSelector)(k().selectors.getDataTenants),p=(0,b.useMemo)((()=>(0,_.pipe)(dY.s1,(0,_.when)((0,_.always)(!n),dY.a),(0,j.ED)(l))({allowedEntityTypes:c,firstLevelAttributesFilter:a},o,t,r,u,s)),[t,o,l,c,a,r,n,u,s]);return v().createElement(pY,mY({},i,{itemsGroups:p}))})),yY=({rowData:e,rowContext:{entityTypes:t,dispatchGroupAction:r},attributeSelectorProps:n={}})=>{const a=PH(),i=e&&e.id,o=(0,b.useCallback)((e=>{r(Ho,i,e)}),[i,r]),l=(0,b.useCallback)((e=>(0,S.getSearchGroupAttributeLabel)({data:e})),[]);return v().createElement(fY,{className:a.attributeSelect,value:e&&e.data,getLabel:l,entityTypes:t,onSelect:o,onRestoreFocus:n.onRestoreFocus,onOpenPopup:n.onOpen,disableRestoreFocus:n.disablePopoverRestoreFocus,disableEnforceFocus:n.disablePopoverRestoreFocus})};yY.propTypes={rowData:hB,rowContext:dp().shape({entityTypes:dp().arrayOf(dp().string),dispatchGroupAction:dp().func}),attributeSelectorProps:dp().shape({onRestoreFocus:dp().func,onOpen:dp().func,disablePopoverRestoreFocus:dp().bool})};const gY=(0,b.memo)(yY);function hY(){return hY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hY.apply(null,arguments)}const EY=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",hY({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),v().createElement("defs",null,v().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"})),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("g",null,v().createElement("g",{transform:"translate(-2 -2)"},v().createElement("mask",{id:"svg397942461b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg397942461a"})),v().createElement("g",{mask:"url(#svg397942461b)",fill:"#000",fillOpacity:".54"},v().createElement("path",{d:"M0 0h24v24H0z"}))))))},bY=e=>!(e&&e.data),vY=({rowData:e,rowContext:{dispatchGroupAction:t}})=>{const r=PH(),n=e&&e.id,a=(0,b.useCallback)((()=>t(Go,n)),[n,t]),i=(0,b.useCallback)((()=>t(qo,n)),[n,t]),o=(0,b.useCallback)((()=>t(Mo,n)),[n,t]);return e&&v().createElement("div",{className:O()(r.actions)},v().createElement(rg(),{title:li().text("Add"),placement:"bottom"},v().createElement(yH(),{className:r.actionIcon,onClick:o})),!bY(e)&&v().createElement(rg(),{title:li().text("Duplicate"),placement:"bottom"},v().createElement("div",{className:r.actionIcon,tabIndex:-1},v().createElement(EY,{onClick:i,tabIndex:-1}))),v().createElement(rg(),{title:li().text("Delete"),placement:"bottom"},v().createElement(Tp(),{onClick:a,className:r.actionIcon})))};vY.propTypes={rowData:hB,rowContext:dp().shape({dispatchGroupAction:dp().func})};const TY=(0,b.memo)(vY),OY={BY_LABEL:(0,r(51774).c)({stringify:(0,_.prop)("label")})},SY=({className:e,attribute:t,textFieldInputRef:r,isDisabled:n,height:a,onChange:i})=>{const o=(0,_.pipe)(S.getFilterOptionLabel,gH.capitalize);return v().createElement(WU,{label:"",placeholder:li().text("Equals"),className:e,value:n?void 0:{value:t.filter,label:o(t.filter)},options:t&&t.data&&t.data.filterOptions.map((e=>({value:e,label:o(e)})))||[],height:a,onChange:i,isDisabled:n,filterOption:OY.BY_LABEL,textFieldInputRef:r})};SY.propTypes={className:dp().string,attribute:hB,textFieldInputRef:dp().object,isDisabled:dp().bool,onChange:dp().func,height:dp().number};const xY=(0,b.memo)(SY),CY=({rowData:e,rowContext:{dispatchGroupAction:t},textFieldInputRef:r})=>{const n=PH(),a=e&&e.id,i=(0,b.useCallback)((e=>t(Zo,a,e.value)),[t,a]);return v().createElement(xY,{className:n.filterSelect,attribute:e,textFieldInputRef:r,isDisabled:bY(e),onChange:i})};CY.propTypes={rowData:hB,rowContext:dp().shape({dispatchGroupAction:dp().func}),textFieldInputRef:dp().object};const wY=(0,b.memo)(CY);var AY=r(23821);const RY=(0,wp.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"}}),_Y=({attribute:e,groupId:t,onChange:r,updateValues:n,filterValues:a})=>{const{values:i,data:{attrType:o,fieldName:l}={},id:s}=e,c=(0,mp.useSelector)((e=>(0,Ki.Sw)(e,t,s)))||{},u=(0,mp.useSelector)((e=>(0,Ki.Ly)(e))),p=(0,mp.useSelector)((e=>(0,ai.Sg)(e,l)));(0,b.useEffect)((()=>{u&&n()}),[i,u,p]),(0,b.useEffect)((()=>{u||n()}),[i,u]);const d=(0,b.useMemo)((()=>(0,_.propOr)([],0,i)),[i]),m=(0,b.useCallback)((0,_.pipe)(S.wrapInArray,r),[r]),{default:f,filtered:y}=c;return!f&&o?v().createElement("div",{className:"ValuesEditor-styles-loadingWrapper--_rOmn"},v().createElement(dm(),{size:20,className:"ValuesEditor-styles-loading--mLFVu"})):v().createElement(eg,{values:d,defaultOptions:f,filteredOptions:y,onChange:m,getSuggestions:a,tabSelectsValue:!1,canLoadMore:!(0,ja.tW)(e.data)})};_Y.propTypes={attribute:hB.isRequired,groupId:dp().string,onChange:dp().func,updateValues:dp().func,filterValues:dp().func};const IY=_Y,NY=({attribute:e,dispatchGroupAction:t,groupId:r})=>{const{values:n,data:{attrType:a,fieldName:i}={},filter:o}=e,l=RY(),s=(0,S.isTypeaheadAttrType)(a)||(0,_.allPass)([(0,_.propSatisfies)((0,_.either)(_.isNil,S.isEntityTypeUri),"uri"),(0,_.prop)("faceted"),(0,_.propEq)("type",S.DataTypes.TYPE_BLOB)])(a),c=(0,S.isEnumAttrType)(a)||(0,S.isLookupAttrType)(a),u=r=>t($o,e.id,r);if((s||c)&&(0,S.isMultiValueOption)(o)){const n=()=>t(Qo,e),a=({value:r,pageNumber:n,currentOptions:a})=>t(Ko,{attribute:e,value:r,debounceTime:500,pageNumber:n,currentOptions:a});return v().createElement(IY,{attribute:e,groupId:r,onChange:u,filterValues:a,updateValues:n})}{const e=c?{type:S.DataTypes.TYPE_STRING}:(0,S.getAttrDataTypeDefinition)(a),t=(0,S.getDataTypeDefinitionForFilterValue)(e,o),r=(0,S.isDateType)(t.type)&&!(0,S.isDateRangeFilterOption)(o)&&l.dateRoot||(0,S.isBooleanType)(t.type)&&l.boolRoot||l.root;return v().createElement(AY.n,{filter:{filter:o,fieldName:i,values:n||[]},onChange:u,dataTypeDefinition:t,fullWidth:!0,TextFieldProps:{InputProps:{classes:{root:l.input},disableUnderline:(0,_.isNil)(n)||(0,_.isEmpty)((0,_.flatten)(n))}},color:"primary",booleanRadioEditorClassName:l.booleanRadioEditor,classes:{root:r},orientation:"horizontal"})}};NY.propTypes={attribute:hB.isRequired,groupId:dp().string,dispatchGroupAction:dp().func};const PY=(0,b.memo)(NY),DY=({rowData:e,rowContext:{dispatchGroupAction:t,groupId:r}})=>{const n=PH(),a=e&&(0,S.checkIfOptionHasValues)(e.filter);return v().createElement("div",{className:n.valuesWrapper,"data-reltio-id":"advanced-search-values-editor-wrapper"},!bY(e)&&a&&v().createElement(PY,{attribute:e,dispatchGroupAction:t,groupId:r}))};DY.propTypes={rowData:hB,rowContext:dp().shape({dispatchGroupAction:dp().func,groupId:dp().string})};const kY=(0,b.memo)(DY),LY=({rowData:e,rowContext:{dispatchGroupAction:t}})=>{const r=PH(),n=e&&e.id,a=e&&e.operator,i=(0,b.useCallback)((e=>t(Yo,n,e)),[t,n]);return v().createElement("div",{className:r.logicOperatorContainer},a?v().createElement(wH,{className:r.logicOperator,value:a,onChange:i}):v().createElement("div",{className:O()(r.logicOperator,r.logicOperatorPlaceholder)},li().text("Where")))};LY.propTypes={rowData:hB,rowContext:dp().shape({dispatchGroupAction:dp().func})};const UY=(0,b.memo)(LY);function jY(){return jY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jY.apply(null,arguments)}const FY=e=>{let{showLogicOperator:t,group:{id:r,attributes:n,operator:a,entityTypes:i=[]},dispatch:o,onAddEmptyGroup:l}=e,s=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["showLogicOperator","group","dispatch","onAddEmptyGroup"]);const c=IH(),u=PH(),p=(0,b.useCallback)((()=>o({type:Qe,payload:{groupId:r,id:(0,Ge.x0)()}})),[r,o]),d=(0,b.useCallback)((()=>o({type:Ke,payload:{groupId:r}})),[r,o]),m=(0,b.useCallback)((e=>o(((e,t)=>({type:$e,payload:{groupId:e,operator:t}}))(r,e))),[r,o]),f=(0,b.useCallback)((e=>o(((e,t)=>({type:qe,payload:{groupId:e,entityTypes:t}}))(r,e))),[r,o]),y=(0,b.useCallback)(((e,...t)=>o(e(r,...t))),[r,o]),g=(0,b.useRef)(null),h=(0,b.useRef)(null),E=(0,b.useRef)(null);E.current=n.length;const T=(0,b.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),g.current&&h.current!==E.current&&(g.current.querySelector("input").focus(),h.current=null)}),[]),S=(0,b.useCallback)((()=>{h.current=n.length}),[n.length]),x=(0,b.useMemo)((()=>[{text:li().text("Add set"),onClick:l,id:"-group-add-set"},{text:li().text("Duplicate set"),onClick:p,id:"-group-duplicate-set"},{text:li().text("Delete set"),onClick:d,id:"-group-delete-set"}]),[l,p,d]),C=(0,b.useMemo)((()=>({root:u.row})),[u]),w=(0,b.useMemo)((()=>({onRestoreFocus:T,onOpen:S,disablePopoverRestoreFocus:!!T})),[T,S]);return v().createElement(v().Fragment,null,v().createElement("div",jY({className:c.container},s),v().createElement("div",{className:c.title},li().text("Set")),v().createElement("div",{className:c.entityTypeSelectorContainer},v().createElement(qH,{classes:{root:c.entityTypeSelector},selectedEntityTypes:i,onChange:f})),v().createElement("div",{className:c.rows},v().createElement(xH,{rowClasses:C,rowsData:n,AttributeSelectorComponent:gY,FilterSelectorComponent:wY,ValuesEditorComponent:kY,ActionsComponent:TY,LogicOperatorComponent:UY,filterSelectorRefIndex:h.current,filterSelectorRef:g,lastRowAttributeSelectorProps:w,entityTypes:i,groupId:r,dispatchGroupAction:y}),v().createElement("div",{className:c.actions},v().createElement(EN,{menuId:`query-builder-group-actions-${r}`,buttonComponent:Cp.T,buttonProps:{icon:Pd(),size:"L","data-reltio-id":"reltio-search-query-builder-group-actions"},menuItems:x})))),t&&v().createElement("div",{className:c.logicOperator},v().createElement("div",{className:O()(c.verticalOperatorLine,c.upperLine)}),v().createElement("div",{className:O()(c.verticalOperatorLine,c.lowerLine)}),v().createElement(wH,{value:a,onChange:m})))};FY.propTypes={showLogicOperator:dp().bool,group:dp().shape({id:dp().string,attributes:dp().arrayOf(hB),entityTypes:dp().arrayOf(dp().string),operator:dp().string}),onAddEmptyGroup:dp().func,dispatch:dp().func};const MY=(0,b.memo)(FY);function VY(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){BY(e,t,r[t])}))}return e}function BY(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zY=(0,wp.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:VY({},AH),upperLine:{marginTop:-18},searchByOvContainer:{marginLeft:-6,marginBottom:-14}}))),HY=({groups:e,uiConfigShowSearchByOv:t,dispatch:r})=>{const n=zY(),a=(0,b.useRef)(null),i=(0,b.useRef)(null),o=(0,b.useCallback)((()=>r({type:Xe,payload:{group:Xt([])}})),[r]);return(0,b.useEffect)((()=>{if(0===e.length)o();else if(!(0,_.isNil)(i.current)&&i.current<e.length&&a.current){const e=a.current.childNodes;e[e.length-2].scrollIntoView({behavior:"smooth"})}i.current=e.length}),[e.length,o]),v().createElement("div",{className:n.scrollWrapper},v().createElement("div",{className:n.groupsContainer,ref:a},t&&v().createElement("div",{className:n.searchByOvContainer},v().createElement(_h,{variant:"queryGroups"})),e.map(((e,t,n)=>v().createElement(MY,{key:e.id,group:e,dispatch:r,showLogicOperator:t!==n.length-1,onAddEmptyGroup:o,"data-reltio-id":`reltio-search-advansed-search-group-builder-${t}`}))),v().createElement("div",{className:n.button},v().createElement("div",{className:O()(n.verticalOperatorLine,n.upperLine)}),v().createElement(Wh(),{onClick:o,color:"primary",size:"small","data-reltio-id":"reltio-search-advanced-search-add-set-button"},v().createElement(yH(),{color:"primary",className:n.icon,fontSize:"small"}),li().text("ADD SET")))))};HY.propTypes={groups:dp().array,dispatch:dp().func,uiConfigShowSearchByOv:dp().bool};const YY=(0,mp.connect)((e=>{var t;return{groups:(0,Ki.go)(e),uiConfigShowSearchByOv:null!==(t=k().selectors.getShowSearchByOv(e))&&void 0!==t?t:(0,Ri.cC)(e)}}))(HY),WY=D.search.actions.updateState({}),GY=({open:e,onClose:t})=>{const r=(0,mp.useDispatch)(),n=(0,b.useCallback)((()=>{t(),r(WY)}),[r,t]),a=(0,b.useCallback)((()=>{t(),r(gi(!0,WY))}),[r,t]),i=(0,mp.useSelector)(ho.LA),o=(0,mp.useSelector)(ai.ai),l=(0,mp.useSelector)(ho.WH),s=(0,mp.useSelector)(ho.Jv),c=i?s&&!l:!o;return v().createElement(mB.U,{open:e,title:li().text("Search filters cannot be displayed in Quick filters"),content:li().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:li().text("Clear search"),saveCaption:li().text("Save search"),disabledSave:c,onCancel:t,onDiscard:n,onSave:a})};GY.propTypes={open:dp().bool,onClose:dp().func};const qY=GY,ZY=(0,mp.connect)((e=>({metadata:k().selectors.getMetadata(e),attributesPresentation:k().selectors.getAttributesPresentation(e),groups:(0,Ki.go)(e),lookups:k().selectors.getLookups(e),keyword:k().selectors.getSearchKeyword(e),map:(0,ai.vH)(e),dataTenants:k().selectors.getDataTenants(e)})))((({metadata:e,attributesPresentation:t,lookups:r,groups:n,keyword:a,map:i,onClose:o,collapsed:l,isFullscreen:s,onCollapse:c,onExpand:u,onFullscreen:p,dataTenants:d,dispatch:m})=>{const f=zY(),[y,g]=(0,b.useState)(!1),h=(0,_.ifElse)((0,_.always)(Ba(e,n,d)),(0,_.pipe)(o,u),(()=>g(!0)));return v().createElement("div",{className:f.container},v().createElement($z,{onBackBtnClick:h}),v().createElement(YY,null),v().createElement(mH,{groups:n,lookups:r,dispatch:m,metadata:e,attributesPresentation:t,hasMinSize:l,collapseBtnActive:!l,isFullscreen:s,onCollapseBtnClick:l?u:c,onFullScreenBtnClick:s?u:p,keyword:a,map:i}),v().createElement(qY,{open:y,onClose:()=>g(!1)}))})),$Y=({isOpenAdvancedSearch:e,onCloseAdvancedSearch:t})=>{const r=Jh(),[n,a]=(0,b.useState)(!1),[i,o]=(0,b.useState)("50%"),l=(0,b.useCallback)((()=>{a(!0),o("120px")}),[]),s=(0,b.useCallback)((()=>{a(!1),o("50%")}),[]),c=(0,b.useCallback)((({percentageSize:e,isMaxSize:t,isMinSize:r})=>{a(r),o(t?-53:e)}),[]),u=(0,b.useCallback)((()=>{a(!1),o(-53)}),[]),p=v().createElement(v().Fragment,null,v().createElement(Gz,null),v().createElement(Af(),{className:r.divider})),d=v().createElement(v().Fragment,null,p,v().createElement(ZY,{collapsed:n,isFullscreen:-53===i,onClose:t,onCollapse:l,onExpand:s,onFullscreen:u}));return v().createElement(oE,{className:r.resizablePanesWrapper,orientation:"horizontal",size:e?i:0,minSize:120,maxSize:-53,allowResize:e,onChange:c},v().createElement("div",{className:r.pane},e&&d),v().createElement("div",{className:r.pane},!e&&p,v().createElement(zM,null)))};$Y.propTypes={isOpenAdvancedSearch:dp().bool,onCloseAdvancedSearch:dp().func};const KY=$Y;function XY(){return XY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},XY.apply(null,arguments)}const QY=e=>v().createElement("svg",XY({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgTenant"},e),v().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"})),JY=(0,wp.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)"}}))),eW=({className:e})=>{const t=JY(),r=(0,w.xz)(),n=(0,w.fN)(),a=`${r}${n?" - "+n.toUpperCase():""}`;return v().createElement("div",{className:O()(t.labelWrapper,e)},v().createElement(QY,{className:t.tenantIcon,"data-reltio-id":"reltio-tenant-icon"}),v().createElement(bf(),{className:t.tenantLabel},a))},tW=(0,wp.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)"}}))),rW=()=>{const e=tW(),t=(0,mp.useSelector)(k().selectors.getMetadata),r=(0,mp.useSelector)(Zc),n=(0,mp.useSelector)(Gc),a=(0,mp.useSelector)(ou),i=(0,mp.useSelector)(ai.hX),o=(0,mp.useSelector)(lu),l=(0,mp.useSelector)(au),s=(0,S.getEntityTypeLabel)(t,{type:r}),c=(0,mp.useSelector)(iu),u=(0,mp.useDispatch)(),p=(()=>{const e=(0,mp.useSelector)(k().selectors.getMetadata),t=(0,mp.useSelector)(k().selectors.getLookups),r=(0,mp.useSelector)(k().selectors.getAttributesPresentation),n=(0,mp.useSelector)(Ki.go),a=(0,mp.useSelector)(k().selectors.getSearchKeyword),i=(0,mp.useSelector)(ai.vH),o=(0,mp.useSelector)(k().selectors.getDataTenants),l=(0,mp.useSelector)(P.X0),s=(0,mp.useSelector)(P.Mp),c=(0,b.useMemo)((()=>Object.values((0,ja.t8)(l,s))),[l,s]);return(0,b.useMemo)((()=>{const l=(0,_.isEmpty)(n)?(0,Jo.h)(e,o,c):n;return(e=>!(1===e.length&&(0,_.isEmpty)(e[0].attributes)&&1===e[0].entityTypes.length))(l)||i||a?(0,S.buildReadableQuery)(e,r,t,l,a,i):[]}),[a,i,e,o,r,n,c,t])})();(0,b.useEffect)((()=>{0!==i&&(a&&o>=i||!a&&o<=0)&&u(uc())}),[a,i,o,u]);const d=(0,b.useCallback)((e=>u(((e,t)=>({type:jn,payload:{filterText:e,debounceTime:t}}))(e,Z.XU))),[u]);return v().createElement(v().Fragment,null,v().createElement(aF(),{className:O()(e.container,{[e.borderBottom]:n>0})},v().createElement(bf(),{component:"span",className:e.entityTypeTitle},s),v().createElement(Af(),{orientation:"vertical",className:e.splitter}),v().createElement(bf(),{component:"span",className:e.profileNumber},li().number(o,"0,0")),v().createElement(bf(),{variant:"body2",component:"span",className:e.profileText},li().text(" profiles are selected for bulk edit.")),0===n&&v().createElement(v().Fragment,null,v().createElement(Wh(),{color:"primary",className:e.clearButton,onClick:()=>{u(uc())},"data-reltio-id":"reltio-search-bulk-update-"+(a?"select-all-profiles":"clear-selection")},a?`${li().text("Select all")} ${li().number(i,"0,0")} ${li().text("profiles")}`:li().text("Clear selection")),v().createElement(Np,{classes:{root:e.searchBox},value:c,onSearch:d,"data-reltio-id":"reltio-search-bulk-update-search-input"}),v().createElement(Af(),{orientation:"vertical",className:e.splitter}),v().createElement(wd,{entityTypeUri:r,headColumns:l,onSelectColumns:e=>{const t=(0,Ai.tU)(e,l);u(mc(e)),t&&u(cc())},"data-reltio-id":"reltio-search-bulk-update-add-remove-columns"}))),0===n&&!(0,_.isEmpty)(p)&&v().createElement(aF(),{className:e.searchQueryContainer},li().text("Search query"),v().createElement(Qz,{readableQuery:p,className:e.searchQuery})))};function nW(){return nW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nW.apply(null,arguments)}const aW=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",nW({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),v().createElement("defs",null,v().createElement("path",{id:"svg3533951039a",d:"M15 6v5l2 2v2h-4v4l-.992 1L11 19v-4H7v-2l2-2V6H8V4h8v2z"})),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"svg3533951039b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg3533951039a"})),v().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg3533951039b)",d:"M0 0h24v24H0z"})))};function iW(){return iW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},iW.apply(null,arguments)}const oW=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",iW({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),v().createElement("defs",null,v().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"})),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"svg1464898421b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg1464898421a"})),v().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg1464898421b)",d:"M0 0h24v24H0z"})))},lW=(0,wp.Z)({editor:{marginBottom:0},editorValue:{width:"100%",marginRight:"8px"}}),sW=({valueProperty:e,emptyEditorValue:t,attributeType:r,value:n,fieldName:a,onChangeValue:i})=>{const o=lW(),l=!r.uri,s=(0,_.pipe)((0,_.ifElse)((0,_.has)("lookupCode"),_.identity,(0,_.objOf)("value")),(0,_.filter)((e=>void 0!==e)),(0,_.mergeRight)(t))(n);return(0,b.useEffect)((()=>{(0,S.isLookupAttrType)(r)||""===t.value||i(e)(t)}),[]),l?v().createElement("div",{key:e,className:O()(o.editor,o.editorValue),"data-reltio-id":"bulk-update-special-attribute-change-editor"},v().createElement(Mk.Z,{fieldName:a,value:n,dataTypeDefinition:(0,S.getAttrDataTypeDefinition)(r),onChange:(0,_.pipe)((0,_.objOf)("value"),i(e)),fullWidth:!0})):v().createElement(yL,{key:e,className:o.editor,mode:S.Mode.Editing,attributeType:r,attributeValue:s,onChangeAttribute:i(e)})},cW={flex:"0 0 auto"},uW=(0,wp.Z)({container:{flexGrow:1,display:"flex",alignItems:"center",margin:0},singleEditor:{marginRight:5,maxWidth:334},to:{color:"#696969",padding:"0 16px 0 7px"},type_Timestamp:cW,type_Boolean:cW,type_Date:cW}),pW=(0,b.memo)((({id:e,groupId:t,operation:r,operationParameters:n})=>{const a=uW(),i=(0,mp.useDispatch)(),{attributeType:o,fieldName:l}=n.attributeTypeData,s=(0,b.useMemo)((()=>(0,S.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType:o})),[o]),c=(0,b.useCallback)((r=>n=>{const{value:a}=n,l=""===a&&(0,S.isLookupAttrType)(o)?{lookupCode:"",value:""}:a;i(hc({id:e,groupId:t,operationParameters:{[r]:l}}))}),[e,t,o,i]),u=zc(r).map((e=>v().createElement(sW,{key:e,valueProperty:e,value:n[e],emptyEditorValue:s,fieldName:l,attributeType:o,onChangeValue:c})));if(!u.length)return null;const p=v().createElement("div",{key:"to",className:a.to},li().text("with"));return v().createElement("div",{className:O()(a.container,a[`type_${o.type}`],{[a.singleEditor]:1===u.length})},2===u.length?(0,_.insert)(1,p,u):u)}));pW.displayName="ChangeEditor";const dW=(0,wp.Z)((()=>({entitySelector:{marginTop:"10px",width:"100%",maxWidth:"452px"},label:{"&:not($labelShrink)":{transform:"translate(12px, 10px)"}},labelShrink:{}}))),mW=({attributeType:e,value:t,onChange:r})=>{const n=dW(),a=(0,mp.useDispatch)(),i=(0,mp.useSelector)(k().selectors.getMetadata),o=(0,mp.useSelector)((e=>k().selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),l=S.Mode.Editing,s=null==t?void 0:t.entityUri,c=(0,S.getReferencedEntityTypeUriFromAttrType)(e),u=(0,b.useCallback)((t=>(0,S.referencedEntityAttributeTypesSelectionStrategy)(e,t)),[e]),p=(0,b.useCallback)((e=>{const{uri:t,type:n,label:i}=e;(0,S.isTempUri)(s)&&a(D.profile.modifiedEntities.actions.entityDeleted(s)),r((0,_.isEmpty)(e)?null:{entityUri:t,entityType:n,entityLabel:i})}),[a,r,s]),d=(0,b.useCallback)(((e,t)=>{const r=(0,S.getEntityType)(i,c),n=(0,_.pipe)(u,(0,S.getCreatableAttributeTypes)(l))(r),o=(0,S.createTemporaryEntity)({entityTypeUri:e,initValue:t,attributeTypes:n,metadata:i,mode:l});p(o),a(D.profile.modifiedEntities.actions.entityCreated(o))}),[a,p,u,i,l,c]);return v().createElement(fU,{className:n.entitySelector,entity:t,entityTypesUris:(0,ni.l0)(c),metadata:i,globalSearchRequestOptions:o,onChange:p,onCreate:d,height:40,disableLinkClick:!0,attributeTypesSelectionStrategy:u,mode:l,TextFieldProps:{InputLabelProps:{classes:{root:n.label,shrink:n.labelShrink}}}})},fW=e=>(0,_.last)(e.type.split("/")),yW=e=>({attributes:{[fW(e)]:[e]}}),gW=(e,t)=>{const r=fW(e);return t.attributes[r][0]},hW=({attributeValue:e,onChange:t})=>{const r=(0,b.useRef)(e);r.current=e;return{onChangeAttribute:(0,b.useCallback)((({value:e,attributeType:n,uri:a})=>{const i=yW(r.current),o=(0,S.editAttribute)({entity:i,attributeType:n,uri:a,value:e});t(gW(r.current,o))}),[t]),onDeleteAttribute:(0,b.useCallback)((({attributeType:e,uri:n})=>{const a=yW(r.current),i=(0,S.removeAttribute)({entity:a,attributeType:e,uri:n});t(gW(r.current,i))}),[t]),onAddAttributes:(0,b.useCallback)((e=>{const n=yW(r.current),a=e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,S.addAttribute)({entity:e,attributeType:r,parentUri:n,index:a})}),n);t(gW(r.current,a))}),[t]),onTogglePin:(0,b.useCallback)((e=>{const n=(({parentAttributeValue:e,uri:t})=>{const r=t.split(e.uri+"/")[1].split("/"),n=[];for(;r.length;){n.push("value");const t=r.shift(),a=r.shift();n.push(t);const i=(0,_.view)((0,_.lensPath)(n),e);if(!i)return null;const o=i.findIndex((({uri:e})=>e.endsWith("/"+a)));n.push(o)}return n.length?(n.push("pin"),(0,_.over)((0,_.lensPath)(n),_.not,e)):null})({parentAttributeValue:r.current,uri:e});n&&t(n)}),[t])}},EW=(0,wp.Z)((e=>({pinIcon:{marginRight:"-8px"},pinIconActive:{"& svg > g > path":{fill:e.palette.primary.main,fillOpacity:1}}}))),bW=({onTogglePin:e,subAttributeValue:t})=>{const r=EW();return v().createElement(Ed.k,{icon:aW,onClick:()=>e(t.uri),size:"L",className:O()(r.pinIcon,t.pin&&r.pinIconActive)})},vW=(0,_.curry)(((e,t,{attributeValue:r})=>r.uri===e?null:v().createElement(bW,{onTogglePin:t,subAttributeValue:r})));function TW(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const OW=({attributeType:e,attributeValue:t,onChange:r})=>{const n=(0,mp.useSelector)(k().selectors.getMetadata),a=(0,b.useMemo)((()=>{const t=(0,S.getAttributeTypeSubAttributes)(n,e),r=(0,S.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType: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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){TW(e,t,r[t])}))}return e}({},r,{value:(0,S.createDefaultValues)({attributeTypes:t,parentUri:r.uri,metadata:n,mode:S.Mode.Editing})})}),[e,n]),i=t||a,{onChangeAttribute:o,onDeleteAttribute:l,onAddAttributes:s,onTogglePin:c}=hW({attributeValue:i,onChange:r}),u=(0,b.useCallback)(vW(i.uri,c),[i.uri,c]);return v().createElement(wL,{attributeType:e,attributeValue:i,showEmptyEditors:!0,mode:S.Mode.Editing,metadata:n,onAddAttributes:s,onDeleteAttribute:l,onChangeAttribute:o,hideDeleteButton:!0,additionalControlsRenderer:u})};function SW(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xW=({attributeType:e,attributeValue:t,onChange:r})=>{const n=(0,mp.useSelector)(k().selectors.getMetadata),a=(0,b.useMemo)((()=>{const t=(0,S.getEditableAttributeTypeSubAttributes)(n,e),r=(0,S.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType: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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){SW(e,t,r[t])}))}return e}({},r,{value:(0,S.createDefaultValues)({attributeTypes:t,parentUri:r.uri,metadata:n,mode:S.Mode.Editing})})}),[e,n]),i=t||a,{onChangeAttribute:o,onDeleteAttribute:l,onAddAttributes:s,onTogglePin:c}=hW({attributeValue:i,onChange:r}),u=(0,b.useCallback)(vW(i.uri,c),[i.uri,c]);return v().createElement(EU,{attributeType:e,attributeValue:i,showEmptyEditors:!0,mode:S.Mode.Editing,metadata:n,onAddAttributes:s,onDeleteAttribute:l,onChangeAttribute:o,hideDeleteButton:!0,additionalControlsRenderer:u})},CW=({operation:e,attributeType:t,attributeValue:r,onChange:n})=>e===ra.d.RepointReference?v().createElement(mW,{attributeType:t,value:r,onChange:n}):(0,S.isNested)(t)?v().createElement(OW,{attributeType:t,attributeValue:r,onChange:n}):(0,S.isReference)(t)?v().createElement(xW,{attributeType:t,attributeValue:r,onChange:n}):null,wW=(0,_.curry)(((e,t,r)=>(0,_.assoc)(t,(0,_.prop)(e,r),(0,_.dissoc)(e,r)))),AW=(0,_.pipe)((0,_.pick)(["fieldName","title","pathToTitle","attrType"]),wW("attrType","attributeType")),RW=(0,_.unless)(_.isNil,wW("attributeType","attrType")),_W="1px solid #e4e4e4",IW=(0,wp.Z)((e=>({mainRowContent:{display:"flex",alignItems:"center","&>*":{marginRight:8}},row:{borderBottom:_W,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}}}))),NW={enabled:!0,queueSizeThreshold:5},PW=(0,b.memo)((({id:e,operation:t,operationParameters:r,groupId:n,groupAttributeType:a,hasConditions:i})=>{const o=IW(),l=(0,mp.useDispatch)(),s=(0,mp.useSelector)(Zc),c=(0,ni.l0)(s),{pin:u,addNestedAttribute:p,attributeTypeData:d}=r||{},{attributeType:m}=d||{},f=t&&d,y=(0,b.useCallback)((({attribute:t,checked:r})=>{r&&l((({id:e,groupId:t,attribute:r})=>({type:Bn,payload:{id:e,groupId:t,attribute:r}}))({id:e,groupId:n,attribute:AW(t)}))}),[e,n,l]),g=(0,b.useCallback)((t=>{l(hc({id:e,groupId:n,operationParameters:{attributeValue:t}}))}),[l,e,n]),h=(0,b.useCallback)((()=>{l((({id:e,groupId:t})=>({type:Qn,payload:{id:e,groupId:t}}))({id:e,groupId:n}))}),[e,n,l]),E=(0,b.useCallback)((()=>{l((({id:e,groupId:t})=>({type:Jn,payload:{id:e,groupId:t}}))({id:e,groupId:n}))}),[e,n,l]),T=(0,b.useCallback)((()=>{l(gc({id:e,groupId:n}))}),[e,n,l]),x=(0,b.useCallback)((t=>{l((({id:e,groupId:t,operation:r})=>({type:zn,payload:{id:e,groupId:t,operation:r}}))({id:e,groupId:n,operation:t.value}))}),[e,n,l]),C=(0,S.isComplexAttribute)(m)&&[ra.d.AddNew,ra.d.ReplaceAllWith,ra.d.RepointReference].includes(t),w=[ra.d.AddNew,ra.d.ReplaceAllWith,ra.d.FindAndReplace].includes(t)&&!(null==m||!m.uri),A=a&&m&&m.uri===a.uri,R=n&&!A&&t===ra.d.AddNew&&!(0,S.isReference)(a),I=(0,b.useMemo)((()=>{return m?(e=m,t=i&&A,(0,_.cond)([[(0,_.both)(S.isNested,(0,_.always)(t)),(0,_.always)((0,_.without)([ra.d.AddNew,ra.d.ReplaceAllWith],Z.DY))],[S.isNested,(0,_.always)(Z.DY)],[(0,_.both)(S.isReference,(0,_.always)(t)),(0,_.always)((0,_.without)([ra.d.AddNew],Z.hS))],[S.isReference,(0,_.always)(Z.hS)],[_.T,(0,_.always)(Z.pG)]])(e)).map((e=>({value:ra.d[e],label:Z.WN[e]}))):[];var e,t}),[i,m,A]),N=(0,b.useMemo)((()=>I.find((e=>e.value===t))),[t,I]),P=(0,b.useMemo)((()=>RW(d)),[d]),D=(0,b.useCallback)(a?(0,dY.xM)(a):(0,_.ifElse)(dY.XF,(0,_.pipe)((0,_.pathEq)(["fieldName"],"tags")),(0,_.pipe)((0,_.prop)("attrType"),(0,_.both)((0,_.complement)(S.isImage),(0,_.complement)(S.isAnalyticAttribute)))),[a]),k=(0,b.useCallback)((e=>(0,S.getSearchGroupAttributeLabel)({data:e})),[]);return(0,b.useEffect)((()=>{!N&&I[0]&&d&&x(I[0])}),[I,N,d,x]),(0,b.useEffect)((()=>{u&&!w&&h()}),[w,u,h]),(0,b.useEffect)((()=>{p&&!R&&E()}),[R,p,E]),v().createElement("div",{"data-reltio-id":"bulk-update-dialog-action-row",className:O()(o.row,{[o.withoutLine]:!!n})},v().createElement("div",{className:o.mainRowContent},v().createElement(fY,{className:o.attrSelector,single:!0,showReferencedEntityAttributes:!1,entityTypes:c,value:P,onSelect:y,firstLevelAttributesFilter:D,ungroup:!!n,getLabel:k}),v().createElement(WU,{label:"",isDisabled:!P,placeholder:li().text("Select operation"),className:o.operationSelector,value:N,options:I,height:40,onChange:x}),f&&v().createElement(v().Fragment,null,!C&&v().createElement(pW,{id:e,groupId:n,operation:t,operationParameters:r}),v().createElement("div",{className:o.icons},w&&v().createElement(Ed.k,{className:O()(o.actionIcon,{[o.actionIconActive]:u}),size:"M",tooltipTitle:li().text("Make this Operational Value"),icon:aW,onClick:h}),R&&v().createElement(Ed.k,{className:O()(o.actionIcon,{[o.actionIconActive]:p}),size:"M",tooltipTitle:li().text("Create parent attribute if none exists"),icon:oW,onClick:E}),v().createElement(Ed.k,{size:"M",tooltipTitle:li().text("Delete"),icon:Tp(),onClick:T})))),f&&C&&v().createElement(Qk.Provider,{value:NW},v().createElement(CW,{operation:t,attributeType:m,attributeValue:r.attributeValue,onChange:g})))}));var DW=r(80510),kW=r.n(DW);function LW(){return LW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},LW.apply(null,arguments)}const UW=(0,b.memo)((e=>{let{attributeType:t,showReferencedEntityAttributes:r,subattributesGroupTitle:n,additionalItemsGroups:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeType","showReferencedEntityAttributes","subattributesGroupTitle","additionalItemsGroups"]);const o=(0,mp.useSelector)(k().selectors.getMetadata),l=t.uri.split("/").slice(0,3).join("/"),s=(0,ni.l0)(l),c=(0,b.useCallback)((0,dY.xM)(t),[t]),u=(0,b.useMemo)((()=>(0,_.pipe)(dY.s1,(0,_.when)((0,_.always)(!r),dY.a),(0,_.map)((0,_.evolve)({attributes:(0,_.pathOr)([],[0,"children"]),title:(0,_.when)((0,_.always)(n),(0,_.always)(n))})),(0,_.when)((0,_.always)(a),(0,_.concat)(a)))({firstLevelAttributesFilter:c},o,s)),[a,n,r,s,o,c]);return v().createElement(pY,LW({},i,{ungroup:!a,itemsGroups:u}))}));function jW(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){FW(e,t,r[t])}))}return e}function FW(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const MW=(e,t)=>(0,Va.nT)(`${Z.E_}_group`,li().text("Profile"),[jW({},(0,Va.o)(jW({title:(0,S.getEntityTypeLabel)(t,{type:(0,S.getReferencedEntityTypeUriFromAttrType)(e)}),fieldName:Z.E_},e)),{enforcedFilterOptions:[S.FilterOptions.EQUALS]})]),VW=(0,wp.Z)({selector:{width:"254px",height:"40px"}}),BW=(0,b.memo)((({rowData:e,rowContext:{attributeType:t,dispatchGroupAction:r},attributeSelectorProps:n={}})=>{const a=VW(),i=(0,mp.useSelector)(k().selectors.getMetadata),o=e&&e.id,l=(0,b.useMemo)((()=>(0,S.isReference)(t)?[MW(t,i)]:null),[t,i]),s=(0,b.useCallback)((e=>{r(Tc,o,e)}),[o,r]);return v().createElement(UW,{className:a.selector,value:e&&e.data,attributeType:t,additionalItemsGroups:l,subattributesGroupTitle:(0,S.isReference)(t)?li().text("Reference attributes"):"",onSelect:s,onRestoreFocus:n.onRestoreFocus,onOpenPopup:n.onOpen,disableRestoreFocus:n.disablePopoverRestoreFocus,disableEnforceFocus:n.disablePopoverRestoreFocus})}));BW.displayName="ConditionAttributeSelector";const zW=e=>!(e&&e.data),HW=(0,_.pathEq)(["data","fieldName"],Z.E_),YW=(0,wp.Z)({selector:{width:"190px"}}),WW=(0,b.memo)((({rowData:e,rowContext:{dispatchGroupAction:t},textFieldInputRef:r})=>{const n=YW(),a=e&&e.id,i=(0,b.useCallback)((e=>t(Sc,a,e.value)),[t,a]);return v().createElement(xY,{height:40,className:n.selector,attribute:e,textFieldInputRef:r,isDisabled:zW(e),onChange:i})}));WW.displayName="ConditionFilterSelector";const GW=(0,wp.Z)({input:{margin:0,borderRadius:"4px"},root:{borderRadius:"4px 4px 0 0",padding:0,display:"flex",alignItems:"center",margin:0},entitySelector:{width:"100%"},entitySelectorLabel:{"&:not($entitySelectorLabelShrink)":{transform:"translate(12px, 10px)"}},entitySelectorLabelShrink:{}}),qW=(0,b.memo)((({condition:e,dispatchGroupAction:t})=>{const{values:r=[],data:{attrType:n,fieldName:a}={},filter:i}=e,o=GW(),l=(0,mp.useSelector)(k().selectors.getMetadata),s=(0,mp.useSelector)((e=>k().selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),c=(0,b.useCallback)((r=>t(xc,e.id,r)),[t,e.id]),u=(0,b.useCallback)((({uri:e,type:t,label:r})=>{c([{entityUri:e,entityType:t,entityLabel:r}])}),[c]),p=(0,S.getAttrDataTypeDefinition)(n),d=(0,S.getDataTypeDefinitionForFilterValue)(p,i);return HW(e)?v().createElement(fU,{className:o.entitySelector,entity:r[0],entityTypesUris:(0,ni.l0)((0,S.getReferencedEntityTypeUriFromAttrType)(n)),metadata:l,mode:S.Mode.Editing,globalSearchRequestOptions:s,onChange:u,height:40,disableLinkClick:!0,TextFieldProps:{InputLabelProps:{classes:{root:o.entitySelectorLabel,shrink:o.entitySelectorLabelShrink}}}}):v().createElement(AY.n,{filter:{filter:i,fieldName:a,values:r||[]},onChange:c,dataTypeDefinition:d,fullWidth:!0,TextFieldProps:{InputProps:{classes:{root:o.input}}},color:"primary",classes:{root:o.root},orientation:"horizontal"})}));qW.displayName="ConditionValuesEditor";const ZW=(0,wp.Z)({root:{width:"100%",display:"flex",minHeight:"40px",alignItems:"flex-start",boxSizing:"border-box"}}),$W=(0,b.memo)((({rowData:e,rowContext:{dispatchGroupAction:t}})=>{const r=ZW(),n=zW(e),a=e&&(0,S.checkIfOptionHasValues)(e.filter);return v().createElement("div",{className:r.root},!n&&a&&v().createElement(qW,{condition:e,dispatchGroupAction:t}))}));$W.displayName="ConditionValuesEditorWrapper";const KW=(0,wp.Z)({root:{paddingTop:"8px",height:"24px",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:"0"}}),XW=(0,b.memo)((({rowData:e,rowContext:{dispatchGroupAction:t}})=>{const r=KW(),n=e&&e.id,a=(0,b.useCallback)((()=>t(Oc,n)),[n,t]);return e?v().createElement("div",{className:r.root},v().createElement(Ed.k,{tooltipTitle:li().text("Delete"),tooltipPlacement:"bottom",icon:Tp(),size:"M",onClick:a})):null}));XW.displayName="ConditionActions";const QW=(0,wp.Z)((e=>({row:{"&:hover $actions":{opacity:1}},logicOperatorContainer:{maxHeight:"40px"},caption:{color:e.palette.text.secondary},conditions:{backgroundColor:"rgba(0,0,0,0.032)",padding:"20px 15px",margin:"7px 0"},actions:{opacity:"0",transition:"opacity 0.3s"}}))),JW=({attributeType:e,conditions:t,groupId:r})=>{const n=QW(),a=(0,mp.useDispatch)(),i=(0,b.useCallback)(((e,...t)=>a(e(r,...t))),[r,a]),o=(0,b.useMemo)((()=>({root:n.row,logicOperatorContainer:n.logicOperatorContainer,actionsContainer:n.actions})),[n]);return v().createElement(v().Fragment,null,v().createElement(bf(),{variant:"caption",component:"div",className:n.caption},li().text("If the following conditions are met")),v().createElement(xH,{className:n.conditions,rowClasses:o,rowsData:t,AttributeSelectorComponent:BW,FilterSelectorComponent:WW,ValuesEditorComponent:$W,ActionsComponent:XW,attributeType:e,dispatchGroupAction:i}),v().createElement(bf(),{variant:"caption",component:"div",className:n.caption},li().text("Then perform the change")))},eG=(0,wp.Z)((e=>({complexRow:{borderBottom:_W,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"}})));function tG(){return tG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tG.apply(null,arguments)}const rG=(0,b.memo)((({id:e,fieldName:t,actions:r,conditions:n})=>{const a=eG(),i=(0,mp.useDispatch)(),o=(0,mp.useSelector)(Zc),l=(0,mp.useSelector)(k().selectors.getMetadata),s=(0,b.useMemo)((()=>{const e=(0,S.searchUriToAttrUri)(t,o);return(0,S.findAttributeTypeByUri)(l,e,o)}),[l,t,o]),c=!!n,u=((e,t)=>(0,_.any)((0,_.both)((0,_.pipe)((0,_.prop)("operation"),(0,_.includes)(_.__,[ra.d.AddNew,ra.d.ReplaceAllWith])),(0,_.pathEq)(["operationParameters","attributeTypeData","attributeType","uri"],t.uri)))(e))(r,s),p=(0,b.useCallback)((()=>i({type:Wn,payload:e})),[e,i]),d=(t={})=>v().createElement(PW,tG({key:t.id},t,{groupId:e,groupAttributeType:s,hasConditions:c}));return(0,b.useEffect)((()=>{c||0!==r.length||i(gc({id:e,groupId:void 0}))}),[e,c,r.length,i]),v().createElement("div",{className:a.complexRow},v().createElement("div",{className:a.header},v().createElement("div",{className:a.attributeLabel},s.label),v().createElement(Wh(),{disabled:u,color:"primary",className:a.conditionsToggleButton,onClick:p},c?v().createElement(v().Fragment,null,v().createElement(kW(),{className:a.conditionsToggleIcon}),li().text("Remove")," "):v().createElement(v().Fragment,null,v().createElement(yH(),{className:a.conditionsToggleIcon}),li().text("Add")," "),li().text("conditions"))),n&&v().createElement(JW,{attributeType:s,conditions:n,groupId:e}),v().createElement("div",{className:a.actionsBlock},r.map(d),d()))}));rG.displayName="ComplexActionRow";const nG=(0,wp.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"}});function aG(){return aG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aG.apply(null,arguments)}const iG=e=>"actions"in e?v().createElement(rG,aG({key:e.id},e)):v().createElement(PW,aG({key:e.id},e)),oG=()=>{const e=nG(),t=(0,mp.useSelector)(cu);return v().createElement("div",{className:e.wrapper},v().createElement("div",{className:e.container},t.map(iG),v().createElement(PW,null)))};var lG=r(99261),sG=r.n(lG),cG=r(26518),uG=r.n(cG),pG=r(60158),dG=r.n(pG),mG=r(61887),fG=r.n(mG);const yG=(0,wp.Z)((()=>({buttonWrapper:{position:"relative"},progress:{position:"absolute",left:"calc(50% - 12px)",top:"calc(50% - 12px)"}})));function gG(){return gG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gG.apply(null,arguments)}const hG=e=>{let{isInProgress:t,disabled:r,circularColor:n="primary",className:a,children:i}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isInProgress","disabled","circularColor","className","children"]);const l=yG();return v().createElement(Wh(),gG({},o,{className:O()(l.buttonWrapper,a),disabled:r||t}),i,t&&v().createElement("div",{className:l.progress,"data-reltio-id":"reltio-circular-load-indicator"},v().createElement(dm(),{size:24,color:n})))},EG=(0,wp.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)"},errorLabel:{color:"#dd2c00 !important"},warningLabel:{color:"#f9a825 !important"}}))),bG=({activeStep:e,steps:t,isPending:r=!1,shouldCompleteSteps:n=!0,onConfirm:a,onChangeStep:i})=>{const o=EG(),l=e===t.length-1,s=t=>{t!==e&&i(t)},c=(0,_.propOr)(!0,"enabled"),u=e=>{if(e>0){const r=e-1;c(t[r])?s(r):u(r)}},p=e=>{if(e<t.length-1){const r=e+1;c(t[r])?s(r):p(r)}},d=l&&!!a,m=d||(0,_.any)(c,(0,_.drop)(e+1,t));return v().createElement("div",{className:o.container},v().createElement("div",{className:o.placeholder}),v().createElement(sG(),{nonLinear:!0,activeStep:e,className:o.stepper},t.map((({label:t,enabled:a=!0,hasError:i,hasWarning:l},c)=>{const u=!a||r,p=n&&!u&&c<e;return v().createElement(uG(),{key:t,completed:p,disabled:u},v().createElement(dG(),{className:o.stepButton,onClick:()=>s(c),"data-reltio-id":`reltio-search-bulk-update-${c}`},v().createElement(fG(),{error:i||l,classes:{error:i?o.errorLabel:o.warningLabel}},t)))}))),v().createElement("div",{className:o.buttons},e>0&&v().createElement(Wh(),{variant:"outlined",className:o.backButton,onClick:()=>u(e),disabled:r,"data-reltio-id":"reltio-search-bulk-update-back"},li().text("Back")),v().createElement(hG,{variant:"contained",color:"primary",disabled:!m,isInProgress:r,onClick:l?a:()=>p(e),"data-reltio-id":"reltio-search-bulk-update-"+(l?"confirm":"continue")},d?li().text("Confirm"):li().text("Continue"))))},vG=()=>{const e=(0,mp.useDispatch)(),t=(0,mp.useSelector)(Gc),r=(0,mp.useSelector)(su),n=(0,mp.useSelector)(Wc),a=!(0,_.isNil)(n),i=(0,mp.useSelector)(du),o=(0,mp.useSelector)(mu),l=[{label:li().text("Select profiles")},{label:li().text("Select operation"),enabled:r},{label:li().text("Define changes"),enabled:r&&a&&n===Z.dV.UpdateProfiles},{label:li().text("Review changes"),enabled:r&&a&&(i||n===Z.dV.DeleteProfiles)}];return v().createElement(bG,{activeStep:t,steps:l,isPending:o,onChangeStep:t=>e((e=>({type:wn,payload:e}))(t)),onConfirm:()=>e({type:ea})})},TG=(0,wp.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"}}))),OG=({children:e,onClose:t})=>{const r=TG();return v().createElement(rF(),{position:"static",color:"default",className:r.appBar},v().createElement(aF(),{className:r.toolbar},v().createElement(Ed.k,{edge:"start",tooltipTitle:li().text("Close"),"aria-label":li().text("Close"),icon:Tp(),onClick:t,className:r.closeButton,size:"L","data-reltio-id":"reltio-search-bulk-update-close"}),v().createElement(bf(),{variant:"h6",className:r.title},e)),v().createElement(aF(),{className:r.toolbar},v().createElement(vG,null)))};OG.propTypes={children:dp().node,onClose:dp().func};const SG=OG,xG=(0,wp.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"}}))),CG=(0,_.equals)(Z.v6.include);function wG(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const AG=()=>{const e=xG(),t=(0,mp.useDispatch)(),r=(0,mp.useSelector)(k().selectors.getMetadata),n=(0,mp.useSelector)(Zc),a=(0,mp.useSelector)(au),i=(0,mp.useSelector)(Qc),o=(0,mp.useSelector)(ru),l=(0,mp.useSelector)(nu),s=(0,mp.useSelector)(Kc),c=(0,mp.useSelector)(eu),u=(0,mp.useSelector)(tu),p=(0,mp.useSelector)(qc),d=(0,mp.useSelector)(Jc),m=(0,mp.useSelector)(Xc),f=(0,b.useMemo)((()=>((e,t,r)=>(0,_.pipe)((0,_.map)((0,_.prop)("uri")),CG(e)?(0,_.intersection)(t):(0,_.without)(t))(r))(m,d,i)),[m,d,i]),y=((e,t)=>0!==e.length&&(e.length===t.length||null))(f,i),g=(0,b.useMemo)((()=>(0,Ai.oq)(r,n,a)),[r,n,a]),h=(0,b.useCallback)((({field:e,order:r})=>t((({field:e,order:t})=>({type:kn,payload:{field:e,order:t}}))({field:r?e:null,order:r}))),[t]),E=(0,b.useCallback)((({what:e,where:r})=>{const n=(0,_.move)(e.columnIndex,r.columnIndex,a);t(mc(n))}),[t,a]),T=(0,b.useCallback)((({columns:e})=>{const r=(0,Ai.tU)(e,a);t(mc(e)),r&&t(cc())}),[t,a]),O=(0,b.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){wG(e,t,r[t])}))}return e}({},t,{size:e[r].size})));t(mc(r))}),[t,a]),S=(0,b.useCallback)(((e,r)=>{t(e?((e,t)=>({type:_n,payload:{uri:e,checked:t}}))(e,r):{type:In,payload:!y})}),[y,t]),x=(0,b.useRef)(null);return v().createElement("div",{className:e.tableContainer},p&&v().createElement(CE.z,null),v().createElement(of,{entities:i,entityTypeUri:n,headColumns:a,additionalColumns:g,canCheck:!0,onCheck:S,checkedEntitiesUris:f,headerCheckboxState:y,dndColumnReorderingEnabled:!0,sortField:o,sortOrder:l,onSort:h,onReorderingColumn:E,onChangeColumnsList:T,onChangeColumnsSize:O,entitiesTableRef:x}),s>Z.Tu[0]&&v().createElement("div",{className:e.pagination},v().createElement(yE.Z,{count:s,rowsPerPageOptions:Z.Tu,rowsPerPage:u||Z.Tu[0],page:c||0,onChangePage:e=>t(dc(e)),onChangeRowsPerPage:e=>t((e=>({type:Pn,payload:e}))(e)),basicTableRef:x})))},RG=(0,wp.Z)((e=>({tableContainer:{display:"flex",flexDirection:"column",backgroundColor:"#fff",width:"100%",margin:"30px 60px",padding:"24px"},title:{fontSize:"14px",fontWeight:500,letterSpacing:"0.1px",lineHeight:"24px",color:e.palette.text.secondary,marginBottom:"6px"},label:{color:e.palette.text.secondary,fontSize:"14px",letterSpacing:0,lineHeight:"32px",paddingLeft:"7px"},radioButton:{padding:"0 9px"}}))),_G=()=>{const e=RG(),t=(0,mp.useDispatch)(),r=(0,mp.useSelector)(Wc),n=(0,mp.useSelector)(k().selectors.getCanUserDeleteProfiles);(0,b.useEffect)((()=>{(0,_.isNil)(r)&&t(yc(Z.dV.UpdateProfiles))}),[r,t]);const a=(0,_.pipe)(xp.NA,yc,t);return v().createElement("div",{className:e.tableContainer},v().createElement(bf(),{className:e.title},li().text("Choose Bulk Update Operation")),v().createElement(hh(),{value:r,onChange:a},v().createElement(bh(),{classes:{label:e.label},value:Z.dV.UpdateProfiles,control:v().createElement(yh(),{className:e.radioButton}),label:li().text("Update Profiles - Update attribute values of selected profiles")}),v().createElement(bh(),{disabled:!n,classes:{label:e.label},value:Z.dV.DeleteProfiles,control:v().createElement(yh(),{className:e.radioButton}),label:li().text("Delete Profiles - Delete selected profiles")})))};var IG=r(49850),NG=r.n(IG),PG=r(28012),DG=r.n(PG),kG=r(18878),LG=r.n(kG),UG=r(70918),jG=r.n(UG),FG=r(51159),MG=r.n(FG),VG=r(35681),BG=r.n(VG);const zG=({value:e,attributeType:t,lookups:r})=>((0,S.isLookupAttrType)(t)&&"string"==typeof e&&(e={lookupCode:e,value:(0,S.getResolvedLookupValue)(r,(0,S.getAttrTypeLookupCode)(t),e)}),v().createElement(Hd.x,{dataTypeDefinition:(0,S.getAttrDataTypeDefinition)(t),value:e})),HG=({operation:e})=>v().createElement(v().Fragment,null,Z.WN[e]),YG=({conditions:e,attributesPresentation:t,metadata:r,lookups:n})=>{if((0,S.isEmptyValue)(e))return v().createElement(v().Fragment,null,"-");const a=(0,S.buildAttributesReadableQuery)(r,t,n,e,!1);return v().createElement(Qz,{readableQuery:a})},WG="8px",GG="1px",qG="1px solid #AFD4E9",ZG=(0,wp.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:GG,left:WG,top:0,borderLeft:qG}},scaffoldHalfVert:{"&:before":{content:'""',position:"absolute",display:"block",boxSizing:"border-box",height:"50%",width:GG,left:WG,top:0,borderLeft:qG}},scaffoldHor:{"&:after":{content:'""',position:"absolute",display:"block",boxSizing:"border-box",height:GG,width:"5px",left:WG,top:"50%",borderBottom:qG}},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%"}}))),$G=({attributeTypeData:{pathToTitle:e,title:t}})=>{const r=ZG();return Boolean(e&&e.length>2)?v().createElement(sg,{placement:"bottom-start",pathToTitle:e},v().createElement("span",{className:r.nestedLabel},t)):v().createElement(v().Fragment,null,t)};function KG(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function XG(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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const JG={EMPTY:"empty",FULL_VERT:"full_vert",FULL_VERT_HOR:"full_vert_hor",HALF_VERT_HOR:"half_vert_hor"},eq=e=>e.map(((t,r)=>(({hasLowerSubAttrs:e,isFirstValue:t,isLastScaffold:r})=>{const n=r&&t;return e?n?JG.FULL_VERT_HOR:JG.FULL_VERT:n?JG.HALF_VERT_HOR:JG.EMPTY})(XG({},t,{isLastScaffold:r===e.length-1})))),tq=({operation:e,operationParameters:t})=>(0,S.wrapInArrayIfNeeded)(XG({},t,{operation:e})),rq=(e,t,r=[],n=[])=>{const a=(0,S.findAttributeTypeByUri)(e,t.type),i=a.label||a.name,o={attributeTypeData:{attributeType:a,title:i,pathToTitle:[...r,i]},scaffolds:eq(n),pin:t.pin};if((0,S.isComplexAttribute)(a)){const a=Object.values(t.value),l=a.flatMap(((t,o)=>t.flatMap(((t,l)=>{const s={hasLowerSubAttrs:a.length-o-1>0,isFirstValue:0===l};return rq(e,t,[...r,i],[...n,s])}))));return[o,...l]}return[XG({},o,{attributeValue:(0,S.getAttributeValue)(t)})]},nq=(0,_.curry)(((e,{operation:t,operationParameters:r})=>{const{attributeValue:n,attributeTypeData:a}=r,i=KG(r,["attributeValue","attributeTypeData"]),[o,...l]=rq(e,n,a.pathToTitle.slice(0,-1));return[XG({},o,{operation:t},i),...l]})),aq=(0,_.curry)(((e,{operation:t,operationParameters:r})=>{const{attributeValue:n,attributeTypeData:a}=r,i=KG(r,["attributeValue","attributeTypeData"]),[o,...l]=rq(e,n,a.pathToTitle.slice(0,-1)),{label:s,refEntity:c}=n,[{objectURI:u,type:p}]=c;return[XG({},o,{operation:t},i,{attributeValue:{entityUri:u,entityLabel:s,entityType:p}}),...l]})),iq=(0,_.curry)(((e,t)=>(0,_.cond)([[Fc,nq(e)],[Mc,aq(e)],[_.T,tq]])(t))),oq=(0,_.curry)(((e,t)=>(0,_.pipe)((0,_.defaultTo)([]),(0,_.chain)((0,_.ifElse)(Ac,(0,_.pipe)(Rc,oq(e)),iq(e))))(t))),lq=({scaffold:e})=>{const t=ZG();return v().createElement("div",{className:O()(t.scaffold,{[t.scaffoldFullVert]:e===JG.FULL_VERT||e===JG.FULL_VERT_HOR,[t.scaffoldHalfVert]:e===JG.HALF_VERT_HOR,[t.scaffoldHor]:e===JG.FULL_VERT_HOR||e===JG.HALF_VERT_HOR})})};lq.propTypes={scaffold:dp().oneOf((0,_.values)(JG))};const sq=({scaffolds:e})=>{const t=ZG();return v().createElement("div",{className:t.scaffoldsContainer},e.map(((e,t)=>v().createElement(lq,{key:t,scaffold:e}))))};sq.propTypes={scaffolds:dp().arrayOf(lq.propTypes.scaffold)};const cq=sq,uq=({children:e})=>{const t=ZG();return v().createElement("div",{className:t.noWrapContainer},e)};uq.propTypes={children:dp().node};const pq=uq,dq=({pin:e,addParent:t})=>{const r=ZG();return v().createElement(pq,null,v().createElement("div",{className:O()(r.optionContainer,{[r.opaque]:!e})},v().createElement(aW,null)),v().createElement("div",{className:O()(r.optionContainer,{[r.opaque]:!t})},v().createElement(oW,null)))};dq.propTypes={pin:dp().bool,addParent:dp().bool};const mq=dq,fq=({entity:{entityLabel:e,entityUri:t},attributeType:r})=>{const n=ZG(),a=(0,mp.useSelector)((e=>k().selectors.getModifiedEntity(e,t)))||null,i=(0,mp.useSelector)(k().selectors.getMetadata),o=(0,b.useCallback)((()=>{const e=(0,S.getReferencedEntityTypeUriFromAttrType)(r),t=(0,S.getEntityType)(i,e);return(0,S.evaluateDeepEntityLabel)(a,t.dataLabelPattern)}),[r,i,a]),l=a?o():e;return v().createElement(pq,null,(0,S.getLabel)(l),(0,S.isTempUri)(t)&&v().createElement("div",{className:n.newIcon},li().text("New")))},yq=(0,wp.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%"}}))),gq=()=>{const e=yq(),t=(0,mp.useSelector)(uu),r=(0,mp.useSelector)(k().selectors.getMetadata),n=(0,mp.useSelector)(k().selectors.getAttributesPresentation),a=(0,mp.useSelector)(k().selectors.getLookups),i=(0,b.useMemo)((()=>oq(r,t)),[t,r]);return v().createElement(jG(),{className:e.tableContainer,component:LI()},v().createElement(NG(),{className:e.table},v().createElement(MG(),null,v().createElement(BG(),null,v().createElement(LG(),{className:e.attributeColumn},li().text("Attribute")),v().createElement(LG(),{className:e.conditionColumn},li().text("Condition")),v().createElement(LG(),{className:e.operatorColumn},li().text("Operator")),v().createElement(LG(),{className:e.valueColumn,colSpan:2}),v().createElement(LG(),{className:e.valueColumn}),v().createElement(LG(),{className:e.optionsColumn}))),v().createElement(DG(),null,i.map((({scaffolds:e,attributeTypeData:t,conditions:i,operation:o,attributeValueToFind:l,attributeValue:s,pin:c,addNestedAttribute:u},p)=>{const d=!(0,_.isNil)(s),m=!(0,_.isNil)(l);return v().createElement(BG(),{key:p},v().createElement(LG(),null,v().createElement(pq,null,e&&v().createElement(cq,{scaffolds:e}),v().createElement($G,{attributeTypeData:t}))),v().createElement(LG(),null,v().createElement(YG,{attributesPresentation:n,metadata:r,lookups:a,conditions:i})),v().createElement(LG(),null,o&&v().createElement(HG,{operation:o})),v().createElement(LG(),null,m&&v().createElement(zG,{lookups:a,attributeType:t.attributeType,value:l})),v().createElement(LG(),{align:"right"},m&&d&&v().createElement(pq,null,v().createElement("span",null,li().text("with")))),v().createElement(LG(),null,d&&((0,S.isReference)(t.attributeType)?v().createElement(fq,{entity:s,attributeType:t.attributeType}):v().createElement(zG,{lookups:a,attributeType:t.attributeType,value:s}))),v().createElement(LG(),{align:"right"},v().createElement(mq,{pin:c,addParent:u})))})))))},hq=(0,wp.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}}}))),Eq=()=>{const e=hq(),t=(0,mp.useSelector)(Wc),r=(0,mp.useSelector)(lu);return t===Z.dV.UpdateProfiles?v().createElement(gq,null):v().createElement("div",{className:e.tableContainer},v().createElement("div",{className:e.text},v().createElement("p",null,`${li().text("Please confirm that you wish to start deletion of the selected")}`,v().createElement("b",null,` ${li().number(r,"0,0")} `),li().text(" profiles.")),v().createElement("p",null,li().text("Click on Confirm to proceed."))))},bq=(0,wp.Z)((()=>({contentRoot:{padding:"0 0 5px",position:"relative",backgroundColor:"#FAFAFA"},tenantLabel:{marginLeft:"23px"}}))),vq=()=>{const e=bq(),t=(0,mp.useSelector)(Ri.Ue),r=(0,mp.useSelector)(Gc),n=(0,mp.useDispatch)(),a=()=>n(wi(!1));return v().createElement(gj(),{fullScreen:!0,open:t,onClose:a,disableEnforceFocus:!0},v().createElement(SG,{onClose:a},li().text("Bulk update"),v().createElement(eW,{className:e.tenantLabel})),v().createElement(rW,null),v().createElement(eF(),{classes:{root:e.contentRoot}},(()=>{switch(r){case 0:return v().createElement(AG,null);case 1:return v().createElement(_G,null);case 2:return v().createElement(oG,null);case 3:return v().createElement(Eq,null)}})()))},Tq="1px solid rgba(0, 0, 0, 0.33)",Oq=(0,wp.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:Tq},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:Tq,boxShadow:"0 1px 3px 0 rgba(0,0,0,0.12)"}}))),Sq=(0,ld.T)(Tf()),xq=(0,mp.connect)((e=>({isReadyAppData:!!(0,Ri.$s)(e),openAdvancedSearch:(0,Ri.IJ)(e),tenant:k().selectors.getTenant(e)})))((({openAdvancedSearch:e,isReadyAppData:t,tenant:r,dispatch:n})=>{const a=(0,b.useCallback)((()=>{n({type:L.k.CONVERT_FROM_ADVANCED_SEARCH}),n(hi(!1))}),[n]),i=(0,b.useCallback)((()=>{n(hi(!0)),n({type:mt})}),[n]),[o,l]=(0,b.useState)(!0),s=(0,b.useCallback)((e=>{l(e<=0)}),[]),c=Oq(),u=!e;return(0,b.useEffect)((()=>()=>S.memoizeWith.clearCache()),[r]),t?v().createElement(v().Fragment,null,v().createElement("div",{className:c.root},v().createElement(hf,{variant:"persistent",anchor:"left",open:u,classes:{root:c.drawer,paper:c.drawerPaper,docked:c.docked},"data-reltio-id":"reltio-search-facet-search-panel"},v().createElement(Sq,{tooltipTitle:li().text("Switch to Advanced search"),tooltipPlacement:"bottom-end",variant:"extended",classes:{root:c.buttonRoot,extended:c.buttonExtended},onClick:i,"data-reltio-id":"reltio-search-advanced-search-button"},v().createElement(Sf(),{color:"primary",className:c.menuIcon}),v().createElement("span",{className:c.buttonLabel},li().text("Advanced search")),v().createElement(Cf(),{color:"action",className:c.goToActionIcon})),v().createElement(bf(),{variant:"button",classes:{root:O()(c.quickFilterRoot,{[c.withBottomBorder]:!o})}},li().text("Quick filters")),v().createElement(kh,{onScroll:s})),v().createElement(Uh,{className:O()(c.mainContent,{[c["mainContent--shifted"]]:u})},v().createElement(KY,{isOpenAdvancedSearch:e,onCloseAdvancedSearch:a}))),v().createElement(Mh,null),v().createElement(Qh,null),v().createElement(vq,null)):null})),Cq=pf()({productionPrefix:"searchTable",disableGlobal:!0,seed:"srch"});S.userPreferencesComparator.register("searchState",((e,t)=>(0,S.looseEquals)((0,_.omit)(["query"],e),(0,_.omit)(["query"],t))));const wq=()=>v().createElement(lf.DynamicModuleLoader,{modules:[up()]},v().createElement(mf(),{generateClassName:Cq},v().createElement(cf._,{dateAdapter:sf.Q},v().createElement(xq,null))))}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_reltio_segmentation=self.webpackChunk_reltio_segmentation||[]).push([[210],{39210:(e,t,r)=>{r.r(t),r.d(t,{ConfigureColumnsButton:()=>wd,DEFAULT_SEARCH_SELECT:()=>Z.Tv,EntitiesTableWithConfigurableColumns:()=>of,EntityAvatar:()=>A,ROWS_PER_PAGE_OPTIONS:()=>Z.Tu,buildQueryForAdvancedSearchGroups:()=>Ua.Jk,buildSelectFromColumns:()=>Ai.vw,collectSpecialColumns:()=>Ai.oX,createRecentSearch:()=>Es,default:()=>wq,getActiveEntityTypeTab:()=>Ri.tB,getAdditionalColumns:()=>Ai.oq,getDataTenant:()=>ai.lF,getEntityTypeLabel:()=>S.getEntityTypeLabel,getEntityTypeTab:()=>Ri.o4,getModule:()=>up,getPage:()=>ai.fx,getRowsPerPage:()=>ai.Uz,getSearchResultsMode:()=>Ri.XM,getSearchUrlQuery:()=>ho.Cc,getSerializedSearchState:()=>bo.Z,getTotal:()=>ai.NU,needRequestAfterColumnsChanges:()=>Ai.tU,parseSearchState:()=>Ss.Z,queryBuilderHelpers:()=>n,queryBuilderSagas:()=>a,replaceSearchResultsColumns:()=>Ss.f,showMoreResultsForEntityTypeAction:()=>qa,showSavedSearchesDialogAction:()=>yi});var n={};r.r(n),r.d(n,{PROP_NAME_FILTER:()=>bt,PROP_NAME_OPERATOR:()=>ht,PROP_NAME_VALUES:()=>Et,addAttributeAfter:()=>It,changeAttributeData:()=>Nt,createGetAttributeIndex:()=>wt,createGetAttributeLens:()=>At,createGetAttributeProp:()=>_t,createGetAttributesLens:()=>Ct,createGetGroupLens:()=>xt,createSetAttributeProp:()=>Rt,defaultFindGroupPath:()=>St,deleteAttribute:()=>Dt,duplicateAttribute:()=>kt,getAttributeData:()=>Ot,getAttributeObject:()=>Tt,getEmptyAttributeObject:()=>vt,setAttributeOperator:()=>Pt,setFilter:()=>Lt,setValues:()=>Ut});var a={};r.r(a),r.d(a,{toggleQueryBuilderAttributeSelect:()=>el});var i={};r.r(i),r.d(i,{addAttributes:()=>ab,addDefaultValuesAction:()=>ib,addNextPageOfAttributeValues:()=>sb,modifyAttribute:()=>ob,processNextPageOfAttributeValues:()=>cb,profileSaved:()=>fb,removeAttribute:()=>lb,requestNextPageOfAttributeValues:()=>ub,runAuthoringTaskAction:()=>db,saveDraft:()=>mb,saveProfile:()=>pb,validateProfile:()=>yb});var o={};r.r(o),r.d(o,{dependentLookupsEditorTouched:()=>vb,dependentLookupsEditorsBlocked:()=>bb,dependentLookupsInitedTypeUrisAdded:()=>Eb,dependentLookupsStructureSet:()=>hb});var l={};r.r(l),r.d(l,{activityFilterUpdated:()=>Mb,globalFilterUpdated:()=>Vb,keywordUpdated:()=>Ub,saveState:()=>Fb,searchResultsSet:()=>Lb,setSearchNavigationData:()=>Yb,setSearchOptionsConfig:()=>zb,setSearchProviderData:()=>Hb,updateSearchNavigationDataFields:()=>Wb,updateSearchNavigationDataOnMerge:()=>Gb,updateSearchOptions:()=>Bb,updateState:()=>jb});var s={};r.r(s),r.d(s,{addDashboardExternalView:()=>Dv,autocloseIntervalLoaded:()=>fv,clearNotifications:()=>sv,closeNotification:()=>lv,dateMaskUpdated:()=>Tv,dateTimeMaskUpdated:()=>Ov,documentationSet:()=>Pv,entityDeletionFinished:()=>av,errorSet:()=>Nv,keysSet:()=>_v,localeAttributePresentationLoaded:()=>mv,localizationLoaded:()=>vv,navigateTo:()=>Rv,newEntityShown:()=>nv,newUiConfigLoaded:()=>dv,numberFormatUpdated:()=>gv,openAppFromChocolateBar:()=>Ev,openConsoleApp:()=>hv,openDashboard:()=>xv,openEntity:()=>rv,openGraph:()=>bv,openHistoryEvent:()=>Cv,openNewEntityWithAuthoring:()=>wv,openPerspective:()=>iv,openPivotingPerspective:()=>Iv,openPreviousPage:()=>Av,openSearch:()=>Sv,pathsSet:()=>cv,setPreferReact:()=>yv,setUseSharedPreferences:()=>kv,showNotification:()=>ov,uiConfigLoaded:()=>pv,uiPathSet:()=>uv});var c={};r.r(c),r.d(c,{getAbsoluteImagePath:()=>US,getActiveErrorsForAttributesPager:()=>jO,getActivityFilter:()=>yS,getAdminToolsPath:()=>YO,getAiAssistantEnabled:()=>sS,getAiAssistantHistoryBufferSize:()=>pS,getAiAssistantLimitPerDay:()=>cS,getAiAssistantSkills:()=>uS,getAllRelationsToAddAndEdit:()=>NS,getAllRelationsToSave:()=>PS,getAllServicesPaths:()=>nx,getAllTreesEditingConnections:()=>WS,getApiPath:()=>MO,getAttributeTypeErrors:()=>LO,getAttributesErrors:()=>UO,getAttributesPresentation:()=>WO,getAttributesSortingStrategy:()=>fC,getAuthoringByEntityType:()=>gC,getAutoCloseInterval:()=>ZO,getCanSuggestAuthoring:()=>OC,getCanUserCreateWorkflowConfigJar:()=>px,getCanUserCreateWorkflowEnvironmentConfigJar:()=>dx,getCanUserDeleteProfiles:()=>kx,getCanUserExecuteWorkflowJobs:()=>mx,getCanUserExecuteWorkflowJobsSyncBusinessProcessData:()=>fx,getCanUserExecuteWorkflowJobsTerminateProcessInstance:()=>yx,getCanUserExecuteWorkflowJobsUpdateTasks:()=>gx,getCanUserExecuteWorkflowJobsValidateTasks:()=>hx,getCanUserGetDQStatistic:()=>Ux,getCanUserImportEntitiesFromDT:()=>Ix,getCanUserMakeActivitiesExport:()=>_x,getCanUserMakeBulkUpdate:()=>Dx,getCanUserMakeExport:()=>Rx,getCanUserManageWorkflowDefinition:()=>Ex,getCanUserManageWorkflowEnvironmentDefinition:()=>bx,getCanUserOpenDataLoader:()=>Lx,getCanUserReadDVF:()=>jx,getCanUserReadEntitiesFromDT:()=>Nx,getCanUserReadWorkflowDataTask:()=>vx,getCanUserRegisterConfigEnvironments:()=>ux,getCanUserStartProcessFromQuery:()=>Px,getCanUserUpdateProcessInstance:()=>Tx,getCanUserUpdateWorkflowDataTask:()=>Ox,getCanUserViewProcessInstanceSearchQuery:()=>Sx,getCanUserViewWorkflowConfigJar:()=>xx,getCanUserViewWorkflowDefinition:()=>Cx,getCanUserViewWorkflowEnvironmentConfigJar:()=>wx,getCanUserViewWorkflowJobs:()=>Ax,getCheckIfCanAddRelations:()=>eC,getCleanseByEntityType:()=>hC,getCollaborationPath:()=>ox,getConnectionsByViewId:()=>gO,getConnectionsTemporaryUrisForCreation:()=>TO,getConnectionsWithDraftsByViewId:()=>bO,getControlAttributes:()=>TC,getDBConnectorSideViews:()=>Gx,getDVFPath:()=>lx,getDataTenants:()=>aO,getDateMask:()=>$O,getDateTimeMask:()=>KO,getDependentLookupEditorState:()=>Qx,getDependentLookupEditorsState:()=>Xx,getDependentLookups:()=>qx,getDependentLookupsInitedTypeUris:()=>Kx,getDependentLookupsStructure:()=>Zx,getDependentLookupsStructureNode:()=>$x,getDocReleaseNotes:()=>cC,getDraftsForSaveByViewId:()=>vO,getDtssPath:()=>ex,getEditingOrAddingConnectionByViewIdAndRelationUri:()=>hO,getEditingOrAddingConnectionRelationObjectByViewIdAndRelationUri:()=>EO,getEntity:()=>mO,getEntityRelatedAttributesByAttributeTypeUri:()=>kO,getEntityUri:()=>fO,getEntityUriWithDataTenant:()=>yO,getEntityWithDiff:()=>tC,getEntityWithoutDiff:()=>rC,getEnvironment:()=>QS,getEnvironmentAlias:()=>JS,getEnvironmentObject:()=>sO,getExportDQPath:()=>tx,getExportPath:()=>VO,getGlobalFilter:()=>TS,getGlobalFilterQuery:()=>OS,getGlobalFilterSavedSearchesUris:()=>SS,getGlobalSearchRequestOptions:()=>bS,getGoogleMapKey:()=>rS,getHeaderColor:()=>pC,getHiddenAttributes:()=>vC,getHistoryDiff:()=>wO,getHistoryEvent:()=>AO,getHistoryMode:()=>IO,getHistorySlice:()=>RO,getIcpLicenseKey:()=>nS,getImageAttributesFieldsOrder:()=>eS,getImagePath:()=>FO,getImageServicePath:()=>HO,getInitialConnection:()=>kS,getInitialConnectionTempEntity:()=>DS,getIsAuthoringMode:()=>EC,getIsEditableMode:()=>CS,getIsHistoryModeEnabled:()=>_O,getIsSuggestMode:()=>AS,getIsViewMode:()=>wS,getLogo:()=>uC,getLookupAutocomplete:()=>tS,getLookups:()=>SO,getMaxValuesInResponse:()=>qO,getMetadata:()=>oO,getMlDqPath:()=>cx,getMode:()=>xS,getModifiedEntities:()=>DO,getModifiedEntity:()=>NO,getModifiedEntityDefaultProfilePic:()=>PO,getNotifications:()=>QO,getPivotingAttributes:()=>JO,getProfile:()=>pO,getProfileCancelNeedConfirm:()=>$S,getProfileCheckUpdate:()=>yC,getProfileErrors:()=>xO,getProfileLastLoadedTime:()=>GS,getProfileOperation:()=>qS,getProfileViews:()=>ZS,getQueryEstimatorEnabled:()=>bC,getRelationToAddByViewId:()=>_S,getRelations:()=>RS,getRelationsToEditByViewId:()=>IS,getRelationsViewIds:()=>CO,getReleaseVersion:()=>sC,getReltioPath:()=>zO,getRequestProviderConfiguration:()=>XO,getSearch:()=>dO,getSearchKeyword:()=>fS,getSearchNavigationData:()=>ES,getSearchOptions:()=>gS,getSearchProviderData:()=>hS,getSearchResults:()=>mS,getServicesPath:()=>nC,getSharedPreferencesEnabled:()=>dS,getShowAttributeDescription:()=>mC,getShowEntityId:()=>lC,getShowSearchByOv:()=>dC,getStringifiedSearchOptions:()=>vS,getTenant:()=>KS,getTenantName:()=>XS,getTenantObject:()=>lO,getTenants:()=>iO,getTotalByViewId:()=>OO,getTree:()=>VS,getTreeCommands:()=>HS,getTreeEditingConnection:()=>YS,getTreeRoot:()=>BS,getTreeTotal:()=>zS,getTrees:()=>MS,getUIConfig:()=>aC,getUIConfigLayout:()=>iC,getUIConfigProfile:()=>oC,getUIPath:()=>BO,getUi:()=>uO,getUiError:()=>Jx,getUiNumberFormat:()=>GO,getUser:()=>cO,getUserName:()=>jS,getUserRoles:()=>FS,getValidateReadMode:()=>iS,getValidateReferenceEntityInReadMode:()=>lS,getValidateRelations:()=>oS,getValidationServicePath:()=>sx,getValidationServiceSeverityLevels:()=>aS,getViewIdsForOpenRelation:()=>LS,getWorkflowConfigurationEnabled:()=>ix,getWorkflowEnvironmentUrl:()=>ax,getWorkflowPath:()=>rx,isCollaborationEnabled:()=>Fx,isCollaborationSideViewEnabled:()=>Hx,isDBConnectorSideViewEnabled:()=>Wx,isHistorySideViewEnabled:()=>Yx,isWorkflowEnabled:()=>Mx,isWorkflowSideViewEnabled:()=>zx});var u={};r.r(u),r.d(u,{authoringDcrResolved:()=>JC,authoringDraftEntitiesLoaded:()=>QC,clearEntity:()=>rw,entityCloneRequested:()=>tw,entityCreationRequested:()=>KC,entityCreationWithAuthoringRequested:()=>XC,entityLoaded:()=>qC,entityRemoveRequested:()=>ew,loadEntity:()=>$C,setDefaultProfilePic:()=>ZC});var p={};r.r(p),r.d(p,{errorDeactivated:()=>sw,errorsSet:()=>cw});var d={};r.r(d),r.d(d,{clearHistoryDiff:()=>fw,clearHistoryEvent:()=>gw,setHistoryDiff:()=>mw,setHistoryEvent:()=>yw,setHistoryMode:()=>Ew,setHistorySlice:()=>hw});var m={};r.r(m),r.d(m,{lookupsForTypeResolved:()=>Cw,lookupsListResolved:()=>ww,lookupsLoaded:()=>xw});var f={};r.r(f),r.d(f,{modeEditingCanceled:()=>Pw,modeUpdateRequested:()=>Nw,modeUpdated:()=>Iw});var y={};r.r(y),r.d(y,{cleanseLoading:()=>Bw,entityCreated:()=>jw,entityDeleted:()=>Fw,modifiedEntitiesReset:()=>Vw,setDefaultProfilePic:()=>Mw});var g={};r.r(g),r.d(g,{addRelation:()=>rA,closeRelationEditor:()=>oA,editRelation:()=>nA,ignoreRelation:()=>tA,openRelationEditor:()=>iA,relationsLoaded:()=>Qw,removeRelation:()=>eA,secondLevelRelationsLoaded:()=>Jw,setInitialInfo:()=>cA,setRelationEntity:()=>sA,setRelationType:()=>lA,updateRelationRating:()=>aA});var h={};r.r(h),r.d(h,{hiddenAttributesReset:()=>J_,hiddenAttributesUpdated:()=>Q_});var E={};r.r(E),r.d(E,{controlAttributesUpdated:()=>rI}),r(69448);var b=r(8156),v=r.n(b),T=r(78310),O=r.n(T),S=r(2396),x=r(55743),C=r.n(x),w=r(13639);const A=({entity:e,avatarClassName:t,imageClassName:r})=>{const n=(0,w.AH)(),a=(0,w.$H)()||"",i=(0,S.getEntityImage)(n,a,e),o=(0,S.getAbsoluteImageUrl)(a,(0,S.getEntityTypeImage)(n,e.type)),l=e=>{e.target.onError=null,e.target.src=(0,S.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 v().createElement(C(),{className:O()(t,r),src:i,imgProps:{onError:l}},v().createElement("img",{className:r,src:o,alt:"fallback entity avatar",onError:l}))};var R=r(75580),_=r(73288),I=r(62391),N=r(9400),P=r(8523),D=r(42308),k=r.n(D),L=r(61882),U=r(26040),j=r(5950);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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const V={facetsConfigs:[],facetsData:{},recommendedFacets:[],addedFacets:[]},B=(0,I.Ic)("facetsConfigs"),z=(0,I.Ic)("facetsData"),H=(0,I.Ic)("recommendedFacets"),Y=(0,I.Ic)("addedFacets"),W=(e,t,r)=>Object.keys(e).reduce(((t,n)=>(0,_.prop)(n,t)?(0,I.ET)(n,r).set(t,e[n]):t),F({},t)),G=({state:e,facetsConfigs:t,addToEnd:r=!1,facetsData:n={}})=>{const a=t.filter((e=>e.fieldName)),i=B.get(e),o=B.set(e,r?i.concat(a):a.concat(i)),l=z.get(e),s=a.reduce(((e,t)=>F({},e,{[t.fieldName]:(0,N.DV)(t.fieldName,n[t.fieldName])})),F({},l));return z.set(o,s)},q=(e=V,t)=>{switch(t.type){case L.k.CREATE_FACETS:{const{facetsConfigs:r,addToEnd:n}=t.payload;return G({state:e,facetsConfigs:r,addToEnd:n})}case D.search.constants.UPDATE_STATE:{const{facetsConfigs:e=[],facetsData:r={}}=t.payload.facets||{facetsConfigs:[]};return G({state:V,facetsConfigs:e,facetsData:r})}case L.k.DESTROY_FACETS:return((e,t)=>{const r=z.get(e),n=B.get(e),a=F({},r);t.forEach((e=>{delete a[e]}));const i=z.set(e,a);return B.set(i,n.filter((e=>!t.includes(e.fieldName))))})(e,t.payload||[]);case L.k.CHANGE_VALUES:{const{facetFieldName:r,values:n}=t.payload;return(({facetFieldName:e,values:t,state:r})=>{const n=[...(0,P.jK)(e),"values"];return(0,I.ET)(...n).set(r,t)})({facetFieldName:r,values:n,state:e})}case L.k.SHOW_MORE_ENTITY_TYPES:{const{show:r}=t.payload,n="type",a=(0,P.jK)(n);if(r)return(0,I.ET)(...a,"showAllItems").set(e,r);{const t=(0,I.ET)(...a);return t.set(e,(0,_.omit)(["showAllItems"],t.get(e)))}}case L.k.CLEAR_ALL_VALUES:case U.Z.CLEAR_ALL:{const t=z.get(e),r=Object.keys(t).reduce(((e,t)=>F({},e,{[t]:[]})),{}),n=W(r,t,"values");return z.set(e,n)}case L.k.UPDATE_DATA:{const r=t.payload||{},n=z.get(e),a=W(r,n,"data");return z.set(e,a)}case L.k.UPDATE_FILTERED_DATA:{const r=t.payload||{},n=z.get(e),a=W(r,n,"filteredData");return z.set(e,a)}case L.k.DESTROY_FILTERED_DATA:{const r=t.payload||{},n=(0,P.jK)(r);if((0,_.path)(n,e)){const t=(0,I.ET)(...n),r=F({},t.get(e));if(r.filteredData)return delete r.filteredData,t.set(e,r)}break}case L.k.SET_RECOMMENDED_FACETS_LIST:return H.set(e,t.payload||[]);case L.k.HIGHLIGHT_ADDED_FACETS:return Y.set(e,t.payload);case L.k.CLEAR_HIGHLIGHT_ADDED_FACETS:return Y.set(e,[]);case"UI_RESET":return F({},V);case U.Z.CHANGE_CURRENT_TENANT:{const{isDataTenant:r,tenantObject:n}=t.payload;if(r){const t=B.get(e),r=z.get(e),a=(0,j.ci)(n,t),i=(0,_.pluck)("fieldName",a),o=(0,_.pipe)((0,_.pick)(i),(0,j.AZ)(n))(r);return z.set(B.set(e,a),o)}return e}}return e};var Z=r(33950);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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(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,I.Ic)("searchResults"),J=(0,I.Ic)("total"),ee=(0,I.Ic)("page"),te=(0,I.Ic)("rowsPerPage"),re=(0,I.Ic)("sortField"),ne=(0,I.Ic)("sortOrder"),ae=(0,I.Ic)("loading"),ie=(0,I.ET)("searchParams","mapSearch","values"),oe=(0,I.ET)("searchParams","mapSearch","type"),le=(0,I.ET)("searchParams","mapSearch","fieldName"),se=(0,I.Ic)("searchResultsByEntityTypes"),ce=e=>se.compose((0,I.ET)(e,"page")),ue=({entityTypeUri:e,field:t,order:r},n)=>{if(e){const a=se.compose((0,I.ET)(e,"sortField")),i=se.compose((0,I.ET)(e,"sortOrder")),o=a.set(n,t);return i.set(o,r)}{const e=re.set(n,t);return ne.set(e,r)}},pe=(e=X,t)=>{switch(t.type){case U.Z.UPDATE_ENTITIES:{const{searchResults:r,entityTypeUri:n}=t.payload;return n?se.compose((0,I.ET)(n,"searchResults")).set(e,r):Q.set(e,r)}case U.Z.UPDATE_TOTAL:return J.set(e,t.payload);case U.Z.CHANGE_PAGE:{const{entityTypeUri:r,pageNumber:n}=t.payload;return r?ce(r).set(e,n):ee.set(e,n)}case U.Z.RESET_PAGE:{const{entityTypeUri:r}=t.payload,n=ee.set(e,0);return r?ce(r).set(n,0):n}case U.Z.CHANGE_ROWS_PER_PAGE:{const{entityTypeUri:r,number:n}=t.payload;if(r){const t=se.compose((0,I.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 U.Z.CHANGE_SORT:return ue(t.payload,e);case U.Z.CHANGE_LOADING:return ae.set(e,t.payload);case D.search.constants.UPDATE_STATE:{const{values:r=[],searchType:n=S.MapSearch.geoPolygon}=t.payload.map||{};let a=ie.set(X,r);if(a=oe.set(a,n),a=le.set(a,(0,S.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 U.Z.MAP_CHANGE_VALUE:{const{value:r,searchType:n}=t.payload;let a=oe.set(e,n);return a=le.set(a,(0,S.mapSearchTypeToFieldName)(n)),ie.set(a,r?[r]:[])}case U.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 U.Z.CLEAR_ALL:return ie.set(e,[]);case U.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",fe="UI_SHOW_SAVE_SEARCH_DIALOG",ye="UI_SHOW_ADVANCED_SEARCH",ge="UI_SHOW_BULK_UPDATE",he="UI_SET_MARKER",Ee="UI_SET_HOVERED_ENTITY_URI",be="UI_SET_SEARCH_RESULTS_COLUMNS",ve="UI_CHANGE_SEARCH_RESULTS_COLUMNS",Te="UI_SET_ENTITY_TYPE_TAB",Oe="UI_UPDATE_TABLE_VIEW_TABS",Se="UI_CHANGE_ORDER_SEARCH_RESULTS_COLUMNS",xe="UI_CHANGE_SIZES_SEARCH_RESULTS_COLUMNS",Ce="UI_CLEAR_NOTIFICATION",we="UI_SET_NOTIFICATION",Ae="UI_SET_SEARCH_RESULTS_MODE",Re="UI_SET_PREVIEW_PANEL_MODE",_e={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},Ie=(0,I.Ic)("showMoreFacetsPopup"),Ne=(0,I.Ic)("showSavedSearchesDialog"),Pe=(0,I.Ic)("showSaveSearchDialog"),De=(0,I.Ic)("showAdvancedSearch"),ke=(0,I.Ic)("showBulkUpdate"),Le=(0,I.Ic)("activeAdditionalSearch"),Ue=(0,I.Ic)("activeMarker"),je=(0,I.Ic)("hoveredEntityUri"),Fe=(0,I.Ic)("searchResultsMode"),Me=(0,I.Ic)("previewPanelMode"),Ve=(0,I.Ic)("searchResultsColumns"),Be=(0,I.Ic)("entityTypeTab"),ze=(0,I.Ic)("tableViewTabs"),He=(0,I.Ic)("loading"),Ye=(0,I.Ic)("notification"),We=(e=_e,t)=>{switch(t.type){case de:return Ie.set(e,t.payload);case me:return Ne.set(e,t.payload);case fe:return Pe.set(e,t.payload.show);case ye:return De.set(e,t.payload);case ge:return ke.set(e,t.payload);case"UI_SET_ACTIVE_ADDITIONAL_SEARCH":{const r=Le.get(e)===t.payload?null:t.payload;return Le.set(e,r)}case he:return Ue.set(e,t.payload);case Ee:return je.set(e,t.payload);case Ae:return Fe.set(e,t.payload);case be:return Ve.set(e,t.payload);case ve:{const{entityTypeUri:r,columns:n}=t.payload;return Ve.compose((0,I.Ic)(r)).set(e,n)}case xe:{const{entityTypeUri:r,columns:n}=t.payload;return Ve.compose((0,I.Ic)(r)).set(e,n)}case Se:{const{entityTypeUri:r,columns:n}=t.payload;return Ve.compose((0,I.Ic)(r)).set(e,n)}case Re:return Me.set(e,t.payload);case Te:return Be.set(e,t.payload.entityTypeUri);case Oe:return ze.set(e,t.payload);case L.k.UPDATE_DATA:if((0,_.has)("type",t.payload))return ze.set(e,t.payload.type);break;case L.k.CHANGE_VALUES:{const{facetFieldName:r,values:n}=t.payload;if("type"===r&&n.length){const t=Be.get(e);if(!n.includes(t))return Be.set(e,n[0])}break}case"UI_RESET":return _e;case"UI_SET_LOADING":return He.set(e,t.payload);case we:return Ye.set(e,t.payload);case Ce:return Ye.set(e,null);case D.search.constants.UPDATE_STATE:{let r=De.set(e,(0,_.has)("advanced",t.payload));if(t.payload.view){const{searchResultsMode:e,entityTypeTab:n,searchResultsColumns:a,previewPanelMode:i}=t.payload.view;r=Fe.set(r,e),r=Be.set(r,n),(0,S.isEmptyValue)(a)||(r=Ve.set(r,a)),r=Me.set(r,i)}return t.payload.showSavedSearchesDialog&&(r=Ne.set(r,t.payload.showSavedSearchesDialog)),r}}return e};var Ge=r(37164);const qe="ADVANCED_SEARCH_SET_GROUP_ENTITY_TYPES",Ze="ADVANCED_SEARCH_VERIFY_GROUP_ENTITY_TYPES",$e="ADVANCED_SEARCH_SET_GROUP_OPERATOR",Ke="ADVANCED_SEARCH_DELETE_GROUP",Xe="ADVANCED_SEARCH_ADD_GROUP",Qe="ADVANCED_SEARCH_DUPLICATE_GROUP",Je="ADVANCED_SEARCH_ADD_ATTRIBUTE_AFTER",et="ADVANCED_SEARCH_CHANGE_ATTRIBUTE_DATA",tt="ADVANCED_SEARCH_TOGGLE_ATTRIBUTE_SELECT",rt="ADVANCED_SEARCH_SET_ATTRIBUTE_OPERATOR",nt="ADVANCED_SEARCH_DELETE_ATTRIBUTE",at="ADVANCED_DELETE_ATTRIBUTE_AND_VERIFY_GROUP_ENTITY_TYPES",it="ADVANCED_SEARCH_DUPLICATE_ATTRIBUTE",ot="ADVANCED_SEARCH_SET_FILTER",lt="ADVANCED_SEARCH_SET_VALUES",st="ADVANCED_SEARCH_ATTRIBUTE_SET_VALUES",ct="ADVANCED_SEARCH_ATTRIBUTE_FILTER_VALUES",ut="ADVANCED_SEARCH_ATTRIBUTE_SET_FILTERED_VALUES",pt="ADVANCED_SEARCH_ATTRIBUTE_UPDATE_VALUES",dt="ADVANCED_SEARCH_UPDATE",mt="ADVANCED_SEARCH_CONVERT_FROM_FACETS";var ft=r(81253);function yt(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){gt(e,t,r[t])}))}return e}function gt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ht="operator",Et="values",bt="filter",vt=(e=(0,Ge.x0)())=>({[ht]:Z.YL.value,id:e}),Tt=(e,t=(0,Ge.x0)())=>{const r=Ot(e);return{data:r,[ht]:Z.YL.value,[bt]:(0,_.pathOr)("",["filterOptions",0],r),id:t}},Ot=e=>yt({},e,{filterOptions:e.enforcedFilterOptions||(0,S.getFilterOptionsForQueryBuilder)(e.attrType,e.fieldName,!0)}),St=(0,_.curry)(((e,t)=>{const r=t.findIndex((t=>t.id===e));return r>-1?[r]:null})),xt=(e,t=St)=>(r,n)=>{const a=(0,I.ET)(...e).get(r),i=t(n,a);return!!i&&(0,I.ET)(...e,...i)},Ct=(e,t)=>(r,n)=>{const a=e(r,n);return a&&a.compose((0,I.Ic)(t))},wt=e=>(t,r,n)=>{const a=e(t,r);return a?a.get(t).findIndex((e=>e.id===n)):-1},At=e=>(t,r,n)=>{const a=e(t,r),i=wt(e)(t,r,n);return-1!==i?a.compose((0,I.ET)(i)):null},Rt=e=>(t,r,n,a,i)=>{const o=e(t,r,n);if(o){const e=yt({},o.get(t));return e[a]=i,o.set(t,e)}return t},_t=e=>(t,r,n,a)=>{const i=e(t,r,n);if(i)return i.get(t)[a]},It=({state:e,groupId:t,attributeId:r,attribute:n,getAttributesLens:a,getAttributeIndex:i})=>{const o=a(e,t);if(o){let a=[...o.get(e)];const l=i(e,t,r),s=!a[l+1];return-1!==l&&s?a.splice(l+1,0,n):-1!==l?(a.splice(l+1,0,yt({},n,{operator:a[l].operator})),a[l]=yt({},a[l],{operator:Z.YL.value})):a.push(n),o.set(e,a)}return e},Nt=({state:e,groupId:t,attributeId:r,attributeData:n,setAttributeProp:a,getAttributeLens:i})=>{let o=e;if(n)return((e,t,r,n,a)=>{const i=a(e,t,r);let o;return i&&(o=i.get(e).filter),n.filterOptions.length&&(!o||!n.filterOptions.includes(o))})(e,t,r,n,i)&&(o=a(e,t,r,bt,n.filterOptions[0])),o=a(o,t,r,Et,[]),a(o,t,r,"data",n);{const n=i(e,t,r);return n&&(o=n.set(o,vt(r))),o}},Pt=({state:e,groupId:t,attributeId:r,operator:n,setAttributeProp:a})=>a(e,t,r,ht,n),Dt=({state:e,groupId:t,attributeId:r,getAttributesLens:n})=>{const a=n(e,t);if(a){const t=[...a.get(e)],n=t.findIndex((e=>e.id===r));if(n>-1){const r=(0,_.remove)(n,1,t),i=r[n-1],o=t[n];return i&&(r[n-1]=yt({},i,{operator:o.operator})),a.set(e,r)}}return e},kt=({state:e,groupId:t,attributeId:r,id:n,getAttributesLens:a})=>{const i=a(e,t);if(i){const t=[...i.get(e)],a=t.findIndex((e=>e.id===r));if(a>-1)return t.push(yt({},t[a],{id:n})),i.set(e,t)}return e},Lt=({state:e,groupId:t,attributeId:r,filter:n,getAttributeProp:a,setAttributeProp:i})=>{const o=a(e,t,r,bt),l=(0,S.isCompatibleFilters)(o,n)?e:i(e,t,r,Et,[]);return i(l,t,r,bt,n)},Ut=({state:e,groupId:t,attributeId:r,values:n,setAttributeProp:a})=>a(e,t,r,Et,n);function jt(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Ft(e,t,r[t])}))}return e}function Ft(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Mt={groups:[]},Vt={},Bt="entityTypes",zt="attributes",Ht=["groups"],Yt=(0,I.ET)(...Ht),Wt=xt(Ht),Gt=Ct(Wt,zt),qt=wt(Gt),Zt=At(Gt),$t=Rt(Zt),Kt=_t(Zt),Xt=(e,t=[],r=(0,Ge.x0)())=>({[zt]:e.map((e=>Tt(e))),[ht]:Z.qx.value,[Bt]:t,id:r}),Qt=(e=Vt,t)=>{switch(t.type){case ut:{const{groupId:r,attributeId:n,values:a}=t.payload;return(0,_.assocPath)([r,n,"filtered"],a,e)}case Ke:{const{groupId:r}=t.payload;return(0,_.dissoc)(r,e)}case nt:{const{groupId:r,attributeId:n}=t.payload;return(0,_.dissocPath)([r,n],e)}case Qe:{const{groupId:r,id:n}=t.payload,a=e[r];return a?(0,_.assoc)(n,a,e):e}case it:{const{groupId:r,attributeId:n,id:a}=t.payload,i=(0,_.path)([r,n],e);return i?(0,_.assocPath)([r,a],i,e):e}case U.Z.CLEAR_ALL:case D.search.constants.UPDATE_STATE:return Vt;default:return e}},Jt=(e=Mt,t)=>{switch(t.type){case Xe:{const{group:r}=t.payload,n=[...Yt.get(e)];return n.push(r),Yt.set(e,n)}case $e:{const{groupId:r,operator:n}=t.payload,a=Wt(e,r);if(a){const t=jt({},a.get(e));return t[ht]=n,a.set(e,t)}return e}case qe:{const{groupId:r,entityTypes:n}=t.payload,a=Wt(e,r);if(a){const t=jt({},a.get(e));return t.entityTypes=n,t.autoAddedEntityTypes=[],t.attributes=[],a.set(e,t)}return e}case Ze:{const{groupId:r}=t.payload,n=Wt(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,jt({},t,{[Bt]:r,autoAddedEntityTypes:a}))}return e}case Ke:{const{groupId:r}=t.payload,n=[...Yt.get(e)],a=n.findIndex((e=>e.id===r));if(a>-1){const t=(0,_.remove)(a,1,n),r=t[a-1],i=n[a];return r&&(t[a-1]=jt({},r,{operator:i.operator})),Yt.set(e,t)}return e}case Qe:{const{groupId:r,id:n}=t.payload,a=[...Yt.get(e)],i=a.findIndex((e=>e.id===r));return i>-1?(a.push(jt({},a[i],{id:n})),Yt.set(e,a)):e}case Je:{const{groupId:r,attributeId:n,attribute:a}=t.payload;return It({state:e,groupId:r,attributeId:n,attribute:a,getAttributesLens:Gt,getAttributeIndex:qt})}case et:{const{groupId:r,attributeId:n,attributeData:a}=t.payload;return Nt({state:e,groupId:r,attributeId:n,attributeData:a,setAttributeProp:$t,getAttributeLens:Zt})}case rt:{const{groupId:r,attributeId:n,operator:a}=t.payload;return Pt({state:e,groupId:r,attributeId:n,operator:a,setAttributeProp:$t})}case nt:{const{groupId:r,attributeId:n}=t.payload;return Dt({state:e,groupId:r,attributeId:n,getAttributesLens:Gt})}case it:{const{groupId:r,attributeId:n,id:a}=t.payload;return kt({state:e,groupId:r,attributeId:n,id:a,getAttributesLens:Gt})}case ot:{const{groupId:r,attributeId:n,filter:a}=t.payload;return Lt({state:e,groupId:r,attributeId:n,filter:a,getAttributeProp:Kt,setAttributeProp:$t})}case lt:{const{groupId:r,attributeId:n,values:a}=t.payload;return Ut({state:e,groupId:r,attributeId:n,values:a,setAttributeProp:$t})}case U.Z.CLEAR_ALL:return Mt;case D.search.constants.UPDATE_STATE:{const{advanced:e=[]}=t.payload;return Yt.set(Mt,e)}default:return e}},er=(e,t)=>{const r=((e,t)=>{if(t.type===st){var r;const{groupId:n,attributeId:a,values:i}=t.payload;return((null===(r=[...Yt.get(e.searchParams)].find((e=>e.id===n)))||void 0===r?void 0:r.attributes)||[]).some((({id:e})=>e===a))?(0,_.assocPath)(["attributesData",n,a,"default"],i,e):e}return e})((0,R.combineReducers)({searchParams:Jt,attributesData:Qt})(e,t),t);return r},tr="SAVED_SEARCHES_CREATE",rr="SAVED_SEARCHES_SET_CURRENT",nr="SAVED_SEARCHES_SET_CHANGE_INDICATOR",ar="SAVED_SEARCHES_UPDATE",ir="SAVED_SEARCHES_LOAD",or="SAVED_SEARCHES_SET_TOTAL",lr="SAVED_SEARCHES_SET_ITEMS",sr="SAVED_SEARCHES_SET_ITEM_TOTAL",cr="SAVED_SEARCHES_SET_PAGE",ur="SAVED_SEARCHES_SET_ROWS_PER_PAGE",pr="SAVED_SEARCHES_SET_FILTERS",dr="SAVED_SEARCHES_SELECT_ITEM",mr="SAVED_SEARCHES_SELECT_ALL_ITEMS",fr="SAVED_SEARCHES_DESELECT_ALL_ITEMS",yr="SAVED_SEARCHES_MARK_PUBLIC_REQUEST",gr="SAVED_SEARCHES_MARK_PUBLIC",hr="SAVED_SEARCHES_MARK_FAVORITE_REQUEST",Er="SAVED_SEARCHES_MARK_FAVORITE",br="SAVED_SEARCHES_MARK_GLOBAL_FILTER_REQUEST",vr="SAVED_SEARCHES_CHANGE_ITEM_NAME_REQUEST",Tr="SAVED_SEARCHES_CHANGE_ITEM_NAME",Or="SAVED_SEARCHES_SET_EDITING",Sr="SAVED_SEARCHES_DELETE_SELECTED_ITEMS_REQUEST",xr="SAVED_SEARCHES_DELETE_ITEM_REQUEST",Cr="SAVED_SEARCHES_DELETE_ITEMS",wr="SAVED_SEARCHES_SET_LOADING",Ar="SAVED_SEARCHES_SET_SEARCH_VALUE",Rr="SAVED_SEARCHES_APPLY_ITEM",_r="SAVED_SEARCHES_SET_TOTAL_LOADING",Ir="SAVED_SEARCHES_LOAD_TOTAL",Nr="SAVED_SEARCHES_TOGGLE_SORT",Pr="RECENT_SEARCHES_CREATE",Dr="RECENT_SEARCHES_LOAD",kr="RECENT_SEARCHES_SET_ITEMS",Lr="RECENT_SEARCHES_SET_ITEM_TOTAL",Ur="RECENT_SEARCHES_SELECT_ITEM",jr="RECENT_SEARCHES_SELECT_ALL_ITEMS",Fr="RECENT_SEARCHES_DESELECT_ALL_ITEMS",Mr="RECENT_SEARCHES_DELETE_SELECTED_ITEMS_REQUEST",Vr="RECENT_SEARCHES_DELETE_ITEMS",Br="RECENT_SEARCHES_DELETE_ITEM_REQUEST",zr="RECENT_SEARCHES_SET_LOADING",Hr="RECENT_SEARCHES_SET_SEARCH_VALUE",Yr="RECENT_SEARCHES_SET_LAST_SAVED",Wr="RECENT_SEARCHES_SET_TOTAL_LOADING",Gr="RECENT_SEARCHES_LOAD_TOTAL",qr="RECENT_SEARCHES_APPLY_ITEM";function Zr(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){$r(e,t,r[t])}))}return e}function $r(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Kr={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}},Xr=(0,I.Ic)("changeIndicator"),Qr=(0,I.Ic)("items"),Jr=(0,I.Ic)("total"),en=(0,I.Ic)("page"),tn=(0,I.Ic)("loading"),rn=(0,I.Ic)("postSavingAction"),nn=(0,I.Ic)("sorting"),an=(e,t,r)=>{const n=Qr.get(r).findIndex((e=>e.uri===t)),a=Qr.compose((0,I.ET)([n])),i=a.get(r);return a.set(r,e(i))},on=(e,t,r)=>(0,_.evolve)({page:(0,_.always)(0),[e]:(0,_.always)(t)},r),ln=(e=Kr,t)=>{switch(t.type){case rr:return(0,_.evolve)({currentSearch:(0,_.always)(t.payload),changeIndicator:null===t.payload?(0,_.always)(!1):_.identity},e);case U.Z.CLEAR_ALL:return(0,_.evolve)({currentSearch:(0,_.always)(null),changeIndicator:(0,_.always)(!1)},e);case nr:return Xr.set(e,t.payload);case or:return Jr.set(e,t.payload);case cr:return en.set(e,t.payload);case ur:return on("rowsPerPage",t.payload,e);case pr:{const{findPublic:r,favoriteOnly:n}=t.payload;return(0,_.evolve)({page:(0,_.always)(0),findPublic:(0,_.always)(r),favoriteOnly:(0,_.always)(n)},e)}case lr:return Qr.set(e,t.payload);case dr:{const{uri:r,checked:n}=t.payload;return an((e=>Zr({},e,{checked:n})),r,e)}case fr:{const t=Qr.get(e);return Qr.set(e,t.map((0,_.omit)(["checked"])))}case mr:{const t=Qr.get(e);return Qr.set(e,t.map((0,_.ifElse)((0,_.prop)("isOwnSearch"),(0,_.assoc)("checked",!0),_.identity)))}case Cr:{const r=t.payload,n=Qr.get(e),a=Jr.set(e,Jr.get(e)-r.length);return Qr.set(a,n.filter((e=>!r.includes(e.uri))))}case gr:{const{uri:r,isPublic:n}=t.payload;return an((e=>Zr({},e,{isPublic:n})),r,e)}case Er:{const{uri:r,isFavorite:n}=t.payload;return an((e=>Zr({},e,{isFavorite:n})),r,e)}case sr:{const{uri:r,total:n}=t.payload;return an((e=>Zr({},e,{total:n})),r,e)}case Or:{const{uri:r,isEditing:n}=t.payload;return an((e=>Zr({},e,{isEditing:n})),r,e)}case vr:{const{uri:r}=t.payload;return an((0,_.omit)(["isEditing"]),r,e)}case Tr:{const{uri:r,name:n}=t.payload;return an((e=>Zr({},e,{name:n})),r,e)}case wr:return tn.set(e,t.payload);case Hr:case Ar:return on("searchValue",t.payload,e);case ir:return Zr({},e,{page:0,findPublic:!0,favoriteOnly:!1});case Nr:{const n=t.payload,a=(0,_.path)(["sorting","field"],e),i=(0,_.path)(["sorting","order"],e);return nn.set(e,{field:n,order:(r=n===a?i:null,r===Z.rX.DESC?Z.rX.ASC:Z.rX.DESC)})}case _r:{const{uri:r,isLoading:n}=t.payload;return an((e=>Zr({},e,{isTotalLoading:n})),r,e)}case fe:return rn.set(e,t.payload.postSavingAction);case me:return on("searchValue",Kr.searchValue,e)}var r;return e};function sn(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){cn(e,t,r[t])}))}return e}function cn(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const un={items:[],filterWord:null,loading:!1,lastSavedRecentSearch:null},pn=(0,I.Ic)("items"),dn=(0,I.Ic)("loading"),mn=(0,I.Ic)("filterWord"),fn=(0,I.Ic)("lastSavedRecentSearch"),yn=(e,t,r)=>{const n=pn.get(r).findIndex((e=>e.createdDate===t)),a=pn.compose((0,I.ET)([n])),i=a.get(r);return a.set(r,e(i))},gn=(e=un,t)=>{switch(t.type){case Ar:case Hr:return mn.set(e,t.payload);case kr:return pn.set(e,t.payload);case Ur:{const{searchCreatedDate:r,checked:n}=t.payload;return yn((e=>sn({},e,{checked:n})),r,e)}case Fr:{const t=pn.get(e);return pn.set(e,t.map((0,_.omit)(["checked"])))}case jr:{const t=pn.get(e);return pn.set(e,t.map((0,_.assoc)("checked",!0)))}case Vr:{const r=(t.payload||[]).map((0,_.prop)("createdDate")),n=pn.get(e);return pn.set(e,n.filter((e=>!r.includes(e.createdDate))))}case Lr:{const{searchCreatedDate:r,total:n}=t.payload;return yn((e=>sn({},e,{total:n})),r,e)}case zr:return dn.set(e,t.payload);case Yr:return fn.set(e,t.payload);case Wr:{const{searchCreatedDate:r,isLoading:n}=t.payload;return yn((e=>sn({},e,{isTotalLoading:n})),r,e)}case me:return mn.set(e,un.filterWord)}return e},hn="ENTITY_SET_LOADING",En="ENTITY_LOAD_ENTITY_REQUEST",bn="ENTITY_SET_SELECTED_ENTITY_URI",vn="ENTITY_SET_ENTITY",Tn={loading:!1,selectedEntityUri:null,entity:null},On=(0,I.Ic)("loading"),Sn=(0,I.Ic)("selectedEntityUri"),xn=(0,I.Ic)("entity"),Cn=(e=Tn,t)=>{switch(t.type){case hn:return On.set(e,t.payload);case bn:return Sn.set(e,t.payload);case vn:return xn.set(e,t.payload);case D.profile.constants.ProfileActions.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:i}=t.payload,o=(0,S.getAttributeSource)(a);if(e.entity&&r===e.entity.uri){const t=(0,_.lensPath)(["entity",o,n]);return(0,_.over)(t,(0,_.pipe)((0,_.defaultTo)([]),(0,_.concat)(_.__,i)),e)}return e}case D.search.constants.SEARCH_RESULTS_SET:if((0,S.isEmptyValue)(t.payload)){const t=xn.set(e,Tn.entity);return Sn.set(t,Tn.selectedEntityUri)}return e}return e},wn="BULK_UPDATE_SET_ACTIVE_STEP",An="BULK_UPDATE_INIT",Rn="BULK_UPDATE_TOGGLE_SELECTION_MODE",_n="BULK_UPDATE_SELECT_ENTITY",In="BULK_UPDATE_SELECT_ALL_ENTITIES_ON_PAGE",Nn="BULK_UPDATE_SET_LOADING",Pn="BULK_UPDATE_CHANGE_ROWS_PER_PAGE",Dn="BULK_UPDATE_CHANGE_PAGE",kn="BULK_UPDATE_CHANGE_SORT",Ln="BULK_UPDATE_CHANGE_COLUMNS",Un="BULK_UPDATE_UPDATE_ENTITIES",jn="BULK_UPDATE_SET_FILTER_TEXT",Fn="BULK_UPDATE_SET_TOTAL",Mn="UPDATE_BULK_UPDATE_CURRENT_ENTITIES",Vn="BULK_UPDATE_SET_OPERATION",Bn="BULK_UPDATE_SET_ACTION_ATTRIBUTE",zn="BULK_UPDATE_SET_ACTION_OPERATION",Hn="BULK_UPDATE_ADD_OPERATION_PARAMETERS",Yn="BULK_UPDATE_DELETE_ACTION",Wn="BULK_UPDATE_TOGGLE_CONDITIONS",Gn="BULK_UPDATE_ADD_CONDITION_AFTER",qn="BULK_UPDATE_CHANGE_CONDITION_DATA",Zn="BULK_UPDATE_TOGGLE_CONDITION_SELECT",$n="BULK_UPDATE_DELETE_CONDITION",Kn="BULK_UPDATE_SET_CONDITION_FILTER",Xn="BULK_UPDATE_SET_CONDITION_VALUES",Qn="BULK_UPDATE_TOGGLE_ACTION_PIN",Jn="BULK_UPDATE_TOGGLE_ACTION_ADD_NESTED",ea="BULK_UPDATE_CONFIRM",ta="BULK_UPDATE_SET_REQUEST_PENDING";var ra=r(39705);function na(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){aa(e,t,r[t])}))}return e}function aa(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ia={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},oa=(0,I.Ic)("activeStep"),la=(0,I.Ic)("operation"),sa=(0,I.Ic)("loading"),ca=(0,I.Ic)("requestPending"),ua=(0,I.ET)("objects","total"),pa=(0,I.ET)("objects","page"),da=(0,I.ET)("objects","rowsPerPage"),ma=(0,I.ET)("objects","selectionMode"),fa=(0,I.ET)("objects","entities"),ya=(0,I.ET)("objects","selectedEntities"),ga=(0,I.ET)("objects","filterText"),ha=e=>ma.get(e)===Z.v6.include,Ea=(0,I.ET)("objects","sortOrder"),ba=(0,I.ET)("objects","sortField"),va=(0,I.ET)("objects","selectedColumns"),Ta=["actions"],Oa=(0,I.ET)(...Ta),Sa=({groupId:e,state:t})=>{if(e){const r=Oa.get(t).findIndex((t=>t.id===e));if(-1!==r)return[...Ta,r,"actions"]}return Ta},xa=(e,t)=>({id:(0,Ge.x0)(),operation:e,operationParameters:t}),Ca=e=>((0,_.path)(["attributeTypeData","fieldName"],e)||"").split(".").slice(0,2).join("."),wa=(e,t)=>({id:(0,Ge.x0)(),fieldName:Ca(t),actions:[xa(e,t)]}),Aa=({state:e,id:t,groupId:r,operation:n,operationParameters:a,togglePin:i,toggleAddNested:o})=>{const l=Sa({state:e,groupId:r}),s=(0,I.ET)(...l).get(e),c=!r&&(0,_.prop)("attributeTypeData",a)&&(({attributeType:e,fieldName:t=""})=>(0,S.isComplexAttribute)(e)||t.split(".").length>2)(a.attributeTypeData);if(t){const r=s.findIndex((e=>e.id===t)),p=(0,I.ET)(...l,r),d=na({},p.get(e));if(n&&d.operation!==n){if(d.operationParameters){const e=[d.operation,n].includes(ra.d.RepointReference)?[]:Z.KJ[n];d.operationParameters=(0,_.omit)((0,_.without)(e,["attributeValue","attributeValueToFind"]),d.operationParameters)}d.operation=n}return a&&(d.operationParameters=(0,_.reject)(_.isNil,na({},d.operationParameters,a))),i&&(d.operationParameters=na({},d.operationParameters,{pin:!(0,_.path)(["operationParameters","pin"],d)})),o&&(d.operationParameters=na({},d.operationParameters,{addNestedAttribute:!(0,_.path)(["operationParameters","addNestedAttribute"],d)})),p.set(e,c?wa((u=d).operation,u.operationParameters):d)}{const t=(0,_.reject)(_.isNil,a),r=c?wa(n,t):xa(n,t);return(0,I.ET)(...l,s.length).set(e,r)}var u},Ra=xt(Ta),_a=Ct(Ra,"conditions"),Ia=wt(_a),Na=At(_a),Pa=Rt(Na),Da=_t(Na),ka=(e=ia,t)=>{switch(t.type){case wn:return oa.set(e,t.payload);case An:return na({},ia,{objects:na({},ia.objects,t.payload)});case Un:return fa.set(e,t.payload);case Rn:{const t=ma.set(e,ha(e)?Z.v6.exclude:Z.v6.include);return ya.set(t,[])}case _n:{const{uri:r,checked:n}=t.payload,a=ya.get(e),i=ha(e);return ya.set(e,!!n==!!i?(0,_.uniq)(a.concat(r)):(0,_.without)(r,a))}case In:{const r=t.payload,n=ha(e),a=ya.get(e),i=fa.get(e).map((0,_.prop)("uri"));return ya.set(e,!!r==!!n?(0,_.uniq)(a.concat(i)):(0,_.without)(i,a))}case Nn:return sa.set(e,t.payload);case Dn:return pa.set(e,t.payload);case Pn:{const r=pa.set(e,0);return da.set(r,t.payload)}case kn:{const{order:r,field:n}=t.payload,a=ba.set(e,n);return Ea.set(a,r)}case Ln:return va.set(e,t.payload);case Fn:return ua.set(e,t.payload);case jn:{const{filterText:r}=t.payload;return ga.set(e,r)}case Vn:return la.set(e,t.payload);case Bn:{const{id:r,groupId:n,attribute:a}=t.payload;return Aa({state:e,id:r,groupId:n,operationParameters:{attributeTypeData:a,attributeValue:null,attributeValueToFind:null,pin:null,addNestedAttribute:null}})}case zn:{const{id:r,groupId:n,operation:a}=t.payload;return Aa({state:e,id:r,groupId:n,operation:a})}case Hn:{const{id:r,groupId:n,operationParameters:a}=t.payload;return Aa({state:e,id:r,groupId:n,operationParameters:a})}case Qn:{const{id:r,groupId:n}=t.payload;return Aa({state:e,id:r,groupId:n,togglePin:!0})}case Jn:{const{id:r,groupId:n}=t.payload;return Aa({state:e,id:r,groupId:n,toggleAddNested:!0})}case Yn:{const{id:r,groupId:n}=t.payload,a=Sa({state:e,groupId:n}),i=(0,I.ET)(...a),o=i.get(e);return i.set(e,o.filter((e=>e.id!==r)))}case Wn:{const r=t.payload,n=Oa.get(e).findIndex((e=>e.id===r)),a=(0,I.ET)(...Ta,n),i=a.get(e);return a.set(e,i.conditions?(0,_.omit)(["conditions"],i):(0,_.assoc)("conditions",[],i))}case Gn:{const{groupId:r,attributeId:n,attribute:a}=t.payload;return It({state:e,groupId:r,attributeId:n,attribute:a,getAttributesLens:_a,getAttributeIndex:Ia})}case qn:{const{groupId:r,attributeId:n,attributeData:a}=t.payload;return Nt({state:e,groupId:r,attributeId:n,attributeData:a,setAttributeProp:Pa,getAttributeLens:Na})}case $n:{const{groupId:r,attributeId:n}=t.payload;return Dt({state:e,groupId:r,attributeId:n,getAttributesLens:_a})}case Kn:{const{groupId:r,attributeId:n,filter:a}=t.payload;return Lt({state:e,groupId:r,attributeId:n,filter:a,getAttributeProp:Da,setAttributeProp:Pa})}case Xn:{const{groupId:r,attributeId:n,values:a}=t.payload;return Ut({state:e,groupId:r,attributeId:n,values:a,setAttributeProp:Pa})}case ta:return ca.set(e,t.payload)}return e};var La=r(85383),Ua=r(82349),ja=r(12848),Fa=r(33192),Ma=r.n(Fa),Va=r(43717);const Ba=(e,t,r)=>{const n=za(t);if(n.length){const i=Ya(e,t,r),o=Ha(e,t,r),l=o.every((e=>(0,S.isTypeSearchGroupAttribute)({data:e})||i.some((0,_.eqProps)("fieldName",e)))),s=(0,S.areAllOperatorsAnd)(t),c=(0,S.areAllOperatorsAnd)(n),u=n.every((({filter:e,data:{attrType:t={}}})=>[S.FilterOptions.EQUALS,S.FilterOptions.IN_RANGE,S.FilterOptions.FULL_TEXT,S.FilterOptions.ON,S.FilterOptions.WITHIN].includes(e)||S.FilterOptions.EXISTS===e&&(0,S.isBooleanType)(t.type))),p=(a=n,!Object.values(a.reduce(((e,{data:{fieldName:t},filter:r,values:n})=>(r===S.FilterOptions.EQUALS&&(0,_.path)([0,"length"],n)&&(e[t]=e[t]&&e[t]+1||1),e)),{})).some((e=>e>1)));return o.length&&s&&c&&u&&n.every((e=>e.data.attrType.faceted))&&l&&p}var a;return!0},za=e=>e.flatMap((e=>e.attributes)).filter((0,_.has)("data")),Ha=(e,t,r)=>{const n=za(t).map((({data:{fieldName:e,entityTypeUri:t},filter:r,values:n})=>({entityTypeUri:t,fieldName:e,filter:r,values:n}))).reduce(((t,{entityTypeUri:n,fieldName:a,filter:i,values:o})=>{const{attrType:l}=n?(0,N.eC)(e,[n],[],r).find((e=>e.fieldName===a))||{}:(0,Va.zH)(a,r)||{},s=!(0,_.isNil)(l)&&l.faceted?((e,t,r,n)=>{if(![S.FilterOptions.EQUALS,S.FilterOptions.IN_RANGE].includes(t)&&![S.FilterOptions.ON,S.FilterOptions.WITHIN].includes(t)||!Array.isArray(e)||(0,S.isEmptyValue)(e[0]))return(0,S.isBooleanType)(n)&&t===S.FilterOptions.EXISTS?[!0,!1]:e&&!(0,S.isEmptyValue)(e[0])?[e[0]]:[];switch(r){case S.FACET_TYPES.NUMERIC_RANGE_FACET:return((e,t)=>{switch(t){case S.FilterOptions.EQUALS:return e.map((e=>[e,e]));case S.FilterOptions.IN_RANGE:return e.some(S.isEmptyValue)?[]:[e]}})(e[0],t);case S.FACET_TYPES.DATE_RANGE_FACET:return((e,t)=>{switch(t){case S.FilterOptions.ON:{const t=Ma()(e),r=!(0,S.isTimestampBasedType)(n);return[[S.utils.dates.getStartOfDay(t,r),S.utils.dates.getEndOfDay(t,r)]]}case S.FilterOptions.WITHIN:return(0,S.isDateRangeValue)(e)?[(0,S.getDateRangeByValue)(e)]:e.some(S.isEmptyValue)?[]:[e]}})(e[0],t);default:return e[0]}})(o,i,(0,S.getFacetTypeForAttrType)(l),l.type):o;return(0,_.isNil)(s)||(t[a]=(0,_.uniq)((t[a]||[]).concat(s))),t}),{}),a=Object.keys(n).map((e=>({fieldName:e,values:n[e]})));return a.some((({values:e})=>e&&Array.isArray(e[0])&&e.length>1))?[]:a},Ya=(e,t,r)=>{const n=(0,ft.VO)(t);return(0,N.eC)(e,n,[],r)},Wa=(e,t)=>({type:U.Z.UPDATE_ENTITIES,payload:{searchResults:e,entityTypeUri:t}}),Ga=({silent:e})=>({type:U.Z.CLEAR_ALL,payload:{silent:e}}),qa=({entityTypeUri:e,keywordValue:t})=>({type:U.Z.SHOW_MORE_RESULTS_FOR_ENTITY_TYPE,payload:{entityTypeUri:e,keywordValue:t}}),Za=e=>({type:U.Z.UPDATE_TOTAL,payload:e}),$a=e=>({type:U.Z.CHANGE_LOADING,payload:e}),Ka=(e,t=null,r=!1)=>({type:U.Z.MAP_CHANGE_VALUE,payload:{value:e,searchType:t,silent:r}}),Xa=(e,t)=>({type:L.k.CREATE_FACETS,payload:{facetsConfigs:e,addToEnd:t}}),Qa=e=>({type:L.k.DESTROY_FACETS,payload:e}),Ja=(e,t,r=!1)=>({type:L.k.CHANGE_VALUES,payload:{facetFieldName:e,values:t,silent:r}}),ei=e=>({type:L.k.UPDATE_DATA,payload:e}),ti=e=>({type:L.k.UPDATE_FILTERED_DATA,payload:e}),ri=({facetsToAdd:e,fieldNamesToDelete:t,changedEntityTypes:r,addToEnd:n})=>({type:L.k.HANDLE_CONFIGS_CHANGES,payload:{facetsToAdd:e,fieldNamesToDelete:t,changedEntityTypes:r,addToEnd:n}});var ni=r(5236),ai=r(54145),ii=r(55443),oi=r(65751),li=r.n(oi);const si=e=>{(0,ii.U)(e,{title:li().text("Server Error"),defaultMessage:li().text("Something went wrong...")})};var ci=r(21430);const ui=(e,t,r)=>`${e}/recommend/${r}/${t}`,pi=e=>e&&1===e.length?e[0]:null,di=e=>[e].filter((0,_.complement)(S.isComplexAttribute)).map((0,_.compose)(Ua.$9,(0,_.prop)("uri"))).concat((e.children||[]).map(di)).flat(1/0);function*mi(){const e=yield(0,La.RE)(Wl),t=yield(0,La.Ys)(k().selectors.getTenant),r=yield(0,La.Ys)(k().selectors.getEnvironment),n=((e,t,r,n,a)=>{const i=e.map((({fieldName:e,values:t})=>({fieldName:e,values:t.map((e=>Array.isArray(e)?JSON.stringify(e):e))}))),o={facets:(0,Ua._e)(i).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:ui(r,n,a),options:{method:"POST",body:JSON.stringify(o),headers:{"Content-Type":"application/json"}}}})(e,0,yield(0,La.Ys)(k().selectors.getServicesPath),t,r);let a;try{a=yield(0,La.RE)(S.rawRequest,n.url,n.options),a=a.filter((e=>"type"!==e)).slice(0,5)}catch(e){a=[]}const i=yield(0,La.Ys)(k().selectors.getMetadata),o=yield(0,La.Ys)(P.DX);a=((e,t=[],r)=>{const n=pi(r),a=n&&(0,S.getEntityType)(e,n),i=(0,ci.vf)(e,a||{}).map(di).flat(1/0);return t.filter((e=>n||!e.startsWith("attributes."))).filter((e=>!e.startsWith("attributes.")||i.includes(e)))})(i,a,o);const l=((e,t,r,n)=>{const a=e=>!t.includes(e);let i=[];const o=Math.max(0,5-t.length);if(o){const t=pi(n);if(t){const r=((0,S.getEntityType)(e,t).defaultFacetedAttributes||[]).map((r=>(0,S.findAttributeTypeByUri)(e,r,t))).filter((e=>e&&(0,S.isReadableAttribute)(e)&&!(0,S.isComplexAttribute)(e))).map((0,_.prop)("uri")).map(Ua.$9).filter(a);i=i.concat(r)}if(i.length<o){const e=(0,N.Xk)().map((e=>e.fieldName)).filter(a);i=i.concat(e)}}return i.slice(0,o)})(i,a,0,o);var s;a=a.concat(l),yield(0,La.gz)((s=a,{type:L.k.SET_RECOMMENDED_FACETS_LIST,payload:s}))}const fi=e=>({type:de,payload:e}),yi=e=>({type:me,payload:e}),gi=(e,t)=>({type:fe,payload:{show:e,postSavingAction:t}}),hi=e=>({type:ye,payload:e}),Ei=(e,t,r)=>({type:ve,payload:{entityTypeUri:e,columns:t,prevColumns:r}}),bi=(e,t=!1)=>({type:Te,payload:{entityTypeUri:e,silent:t}}),vi=e=>({type:Oe,payload:e}),Ti=()=>({type:Ce}),Oi=e=>({type:we,payload:e}),Si=e=>Oi({payload:{message:e,action:null},type:Z.GT.info}),xi=({message:e,actionLabel:t,actionToDispatch:r,autoHideDuration:n})=>Oi({payload:{message:e,action:{actionLabel:t,actionToDispatch:r},autoHideDuration:n},type:Z.GT.info}),Ci=e=>({type:Re,payload:e}),wi=e=>({type:ge,payload:e});var Ai=r(90503),Ri=r(82877);const _i=(e={},t="")=>Object.keys(e).filter((r=>S.utils.strings.search(r,t)||S.utils.strings.search(e[r].displayName,t))),Ii=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)}},Ni=(e,t)=>e===t,Pi=new class{constructor(){this.isLookupValueResolveTaskRunning=(0,_.curry)(((e,t)=>(0,_.hasPath)([e,t],this._lookupValuesResolveTasks))),this._lookupValuesResolveTasks=Object.create(null)}addTask(e,t){e.forEach((({type:e,codeValues:r})=>{!this._lookupValuesResolveTasks[e]&&(this._lookupValuesResolveTasks[e]={}),r.forEach((r=>{this._lookupValuesResolveTasks[e][r]=t}))}))}deleteTask(e){e.forEach((({type:e,codeValues:t})=>{this._lookupValuesResolveTasks[e]&&t.forEach((t=>{delete this._lookupValuesResolveTasks[e][t]})),(0,_.isEmpty)(this._lookupValuesResolveTasks[e])&&delete this._lookupValuesResolveTasks[e]}))}getRunningTasks(e){const t=e.flatMap((({type:e,codeValues:t})=>this._lookupValuesResolveTasks[e]?t.reduce(((t,r)=>{const n=this._lookupValuesResolveTasks[e][r];return n&&t.push(n),t}),[]):[]));return(0,_.uniqWith)(Ni,t)}clearTasks(){this._lookupValuesResolveTasks=Object.create(null)}};function*Di(e){const t=Pi.getRunningTasks(e);t.length>0&&(yield(0,La.v_)(t))}function*ki(e){try{const t=e.flatMap((({type:e,codeValues:t})=>t.map((t=>({type:e,codeValue:t}))))),r=yield(0,La.rM)(S.resolveLookupsList,t);Pi.addTask(e,r);const n=(yield(0,La.v_)(r)).reduce(((e,t)=>{const[r]=Object.keys(t),[n]=Object.keys(t[r]),a=(0,_.lensPath)([r,n]),i=(0,_.path)([r,n],t);return(0,_.set)(a,i,e)}),{});for(const e in n)yield(0,La.gz)(D.profile.lookups.actions.lookupsForTypeResolved({type:e,values:n[e]}))}catch(e){console.warn(e)}finally{Pi.deleteTask(e)}}function*Li(e){if((0,_.isEmpty)(e))return;const t=e.map((({type:e,codeValues:t})=>{const r=Pi.isLookupValueResolveTaskRunning(e);return{type:e,codeValues:t.filter((0,_.complement)(r))}})).filter((({codeValues:e})=>e.length>0));t.length>0&&(yield(0,La.RE)(ki,t)),yield(0,La.RE)(Di,e)}function*Ui(e,t,r=Z.cu,n=1){const a=!t&&1===n,i=`${e}${r}`,o=a&&Ii.getRunningTask(i);if(o)yield(0,La.v_)(o);else try{const o=yield(0,La.rM)(S.getDependentLookups,{type:e,displayNamePrefix:t,max:r,offset:r*(n-1)});a&&Ii.addTask(i,o);const l=yield(0,La.v_)(o);yield(0,La.gz)(D.profile.lookups.actions.lookupsForTypeResolved({type:e,values:l.codeValues[e]}))}catch(e){console.warn(e)}finally{a&&Ii.deleteTask(i)}}const ji=(e,t,r)=>e.slice((r-1)*t,t*r);function*Fi(e,t,r,n=1){const a=yield(0,La.Ys)(k().selectors.getLookups),i=_i(a[e],t);if(i.length>=r*n)return ji(i,r,n);yield(0,La.RE)(Ui,e,t,r,n);const o=yield(0,La.Ys)(k().selectors.getLookups);return ji(_i(o[e],t),r,n)}const Mi=(e,t)=>Object.keys(e).filter((e=>(0,ja.iL)(e,t))).reduce(((r,n)=>(r[(0,ja.iL)(n,t).fieldName]=e[n],r)),{});function Vi(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Bi(e,t,r[t])}))}return e}function Bi(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*zi(e,t,r){if((0,_.isEmpty)(e))return;const n=yield(0,La.Ys)(k().selectors.getLookups),a=yield(0,La.Ys)(k().selectors.getMetadata),i=Mi(r,e),o=yield(0,La.Ys)(Ri.Xf);yield(0,La.gz)(t((0,ja.HC)(a,i,e,n,{allowedEntityTypes:o})))}function*Hi(e,t,r){try{const n=yield(0,La.RE)(Nl,e.url,e.options),[a,i]=(0,_.partition)(N._H,t);yield(0,La.rM)(zi,i,r,n),yield(0,La.RE)($i,a,n),yield(0,La.RE)(zi,a,r,n)}catch(e){console.warn(e)}}function*Yi(e,t,r){e=Vi({},e,{includeFilter:[]});const n=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),a=(0,Ua.aw)([e],t,[e.fieldName],n);yield(0,La.RE)(Hi,a,[e],r)}const Wi=(e,t=[])=>t.filter((({label:t})=>S.utils.strings.search(t,e))),Gi=(e,t)=>Wi(t,e).map((0,_.prop)("value"));function*qi(e,t,r,n){const a=Vi({},e),i=[...t];if((0,N._H)(a)){const t=(0,S.getAttrTypeLookupCode)(e.attrType);a.includeFilter=yield(0,La.RE)(Fi,t,r,(0,_.propOr)(Z.cu,"pageSize",a),a.pageNumber)}else if("sourceSystems"===a.fieldName){const{sources:e}=yield(0,La.Ys)(k().selectors.getMetadata);a.includeFilter=((e,t)=>Wi(t,e).map((({uri:e})=>(0,S.getLastUriPart)(e))))(e,r)}else if((0,N.S9)(a)){const t=yield(0,La.Ys)(k().selectors.getMetadata),n=(0,S.getEntityType)(t,a.entityTypeUri)||{},i=(0,_.pipe)((0,_.propOr)([],"displayedItems"),(0,_.filter)((0,_.propEq)("isRaw",!0)))(e);a.includeFilter=[...(o=n.matchGroups,l=r,Wi(l,o).map((0,_.prop)("uri"))),...Gi(i,r)]}else a.disableIncludeFilter=!0,i.push({values:[r],fieldName:e.fieldName,filter:"containsWordStartingWith",forceInclude:!0});var o,l;const s=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),c=(0,Ua.aw)([a],i,[e.fieldName],s);yield(0,La.RE)(Zi,c,e,a.includeFilter,n)}function*Zi(e,t,r,n){try{const a=yield(0,La.RE)(Nl,e.url,e.options),i=yield(0,La.Ys)(k().selectors.getLookups),o=Mi(a,[t]);if(r){const e=t.fieldName;o[e]=(0,ja.AX)(o[e],r)}const l=yield(0,La.Ys)(k().selectors.getMetadata),s=yield(0,La.Ys)(Ri.Xf);yield(0,La.gz)(n((0,ja.HC)(l,o,[t],i,{allowedEntityTypes:s})))}catch(e){console.warn(e)}}function*$i(e,t){const r=yield(0,La.Ys)(k().selectors.getLookups),n=(0,ja.U4)(e,r),a=((e,t,r)=>{const n=((e,t)=>(0,_.pipe)(Object.entries,(0,_.reduce)(((e,[r,n])=>{const a=t.find((0,_.propEq)("fieldName",r));if(!a)return e;const{attrType:i}=a,o=(0,S.getAttrTypeLookupCode)(i);return e[o]={type:o,codeValues:(0,_.uniq)([...(0,_.pathOr)([],[o,"codeValues"],e),...Object.keys(n)])},e}),{}),_.values)(e))(e,t);return(0,S.getUnresolvedLookupsList)(r,n)})(t,e,r),i=(0,S.mergeLookupsLists)(n,a);i.length&&(yield(0,La.RE)(Li,i))}var Ki=r(59295);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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Ji(){const e=yield(0,La.Ys)(k().selectors.getMetadata),t=yield(0,La.Ys)(Ri.Xf),r=yield(0,La.Ys)(Ri.sl);return(0,Ai.wM)(e,t,r)}const eo=e=>({value:t})=>!e.length||e.includes(t);function*to(e){e=e||(yield(0,La.Ys)(ai.FR));const t=yield(0,La.Ys)(Ri.XM);if((0,Ai.gj)(t)){const t=yield(0,La.Ys)(k().selectors.getMetadata),r=yield(0,La.Ys)(Ki.V6),n=(0,N.$t)(t),a=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),i=(0,Ua.aw)([n],e,[n.fieldName],a),o=({type:e=[]})=>{const t=e.filter(eo(r));return vi(t)};yield(0,La.RE)(Hi,i,[n],o)}else yield(0,La.gz)(vi([]))}function*ro(){const e=yield(0,La.Ys)(k().selectors.getMetadata),t=yield(0,La.Ys)(Ri.Xf),r=yield(0,La.Ys)(Ki.V6);return(0,ja.wW)(e,{},t).filter(eo(r))}function*no(){const e=yield(0,La.Ys)(k().selectors.getMetadata),t=yield(0,La.RE)(Ji),r=yield(0,La.Ys)(Ri.uJ),n=(0,Ai.oX)().map((0,_.prop)("id")),a=(0,_.pipe)((0,_.map)((0,_.filter)((0,_.pipe)((0,_.prop)("id"),(0,_.cond)([[(0,_.includes)("."),_.T],[(0,_.includes)(_.__,n),_.T],[_.T,_.F]])))),_.toPairs,(0,_.map)((([t,r])=>[t,(0,Ai.Wh)(e,t,(0,_.map)((0,_.prop)("id"),r)).map(((e,t)=>{const n=r.find((0,_.propEq)("id",e.id)),{size:a,autoResize:i=0!==t&&!a}=n||{};return(0,_.reject)(_.isNil,Xi({},e,{size:a,autoResize:i}))}))])),_.fromPairs)(r),i=!(0,_.equals)(r,a),o=Object.keys(t),l=Object.keys(a);var s;!i&&(0,_.equals)(new Set(o),new Set(l))||(yield(0,La.gz)((s=Xi({},t,(0,_.pick)(o,a)),{type:be,payload:s})))}function*ao(){const e=yield(0,La.Ys)(k().selectors.getMetadata),t=yield(0,La.Ys)(P.DX),r=(yield(0,La.Ys)(Ri.IJ))?yield(0,La.RE)(ro):yield(0,La.RE)(rs),n=(0,Ai.nx)(e,r,t).map((0,_.prop)("value")),a=yield(0,La.Ys)(Ri.o4);n.includes(a)||(yield(0,La.gz)(bi(n[0],!0)))}function*io(e={}){const{silent:t}=e.payload||{};if(!t){const e=yield(0,La.Ys)(Ri.tB),t=yield(0,La.Ys)(ai.t9);if((0,S.isAvailableEntityTypeForDataTenant)(t,e)){const t=yield(0,La.Ys)(ai.BP,{entityTypeUri:e});(0,_.isNil)(t)&&(yield(0,La.gz)({type:U.Z.REFRESH_DISPLAYED_ENTITIES}))}else yield(0,La.gz)(Wa([],e))}}function*oo(e){const t=e.payload;yield(0,La.RE)(io,e);const r=yield(0,La.Ys)(Ri.gu);if((0,Ai.gj)(t)&&0===r.length){const e=yield(0,La.RE)(ro);yield(0,La.gz)(vi(e)),yield(0,La.RE)(to)}}function*lo(){const e=yield(0,La.Ys)(Ri.qx),t=yield(0,La.Ys)(ai.Qy);e!==Z.om.MAP&&t.length&&(yield(0,La.gz)(Ka(null)))}function*so(e){const t=(0,S.removeDtssPrefixFromEntityUri)(e.payload.uri),r=yield(0,La.Ys)(Ri.tB),n=((yield(0,La.Ys)(ai.BP,{entityTypeUri:r}))||[]).map((0,_.prop)("uri")),a=(yield(0,La.Ys)(ai.fx,{entityTypeUri:r}))||0,i=(yield(0,La.Ys)(ai.Uz,{entityTypeUri:r}))||Z.Tu[0],o=n.indexOf(t)+a*i,l=yield(0,La.Ys)(ai.NU,{entityTypeUri:r}),s=yield(0,La.Ys)(k().selectors.getTenant),c=yield(0,La.Ys)(ai.lF);yield(0,La.gz)(D.search.actions.setSearchNavigationData({uri:t,index:o,total:l,tenant:c||s,cache:n}))}const co=[function*(){yield(0,La.Fm)(Te,io)},function*(){yield(0,La.Fm)(Ae,oo)},function*(){yield(0,La.Fm)([qe,Ze,Ke],ao)},function*(){yield(0,La.Fm)(Re,lo)},function*(){yield(0,La.Fm)(D.ui.constants.UIActions.OPEN_ENTITY,so)}],uo=e=>({type:rr,payload:e}),po=e=>({type:nr,payload:e}),mo=()=>({type:fr}),fo=e=>({type:Cr,payload:e}),yo=e=>({type:wr,payload:e}),go=(e,t)=>({type:_r,payload:{uri:e,isLoading:t}});var ho=r(90533),Eo=r(86374),bo=r(4898);function vo(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){To(e,t,r[t])}))}return e}function To(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Oo(){yield(0,La.gz)(yo(!0));try{const t=yield(0,La.Ys)(k().selectors.getUserName),r=e=>vo({},e,{isOwnSearch:t===e.owner}),n=yield(0,La.RE)(So),{result:a=[],total:i}=yield(0,La.RE)(S.getSavedSearches,n);yield(0,La.gz)((e=>({type:or,payload:e}))(i));const o=yield(0,La.Ys)(k().selectors.getMetadata),l=yield(0,La.Ys)(k().selectors.getDataTenants),s=yield(0,La.Ys)(k().selectors.getCanUserReadWorkflowDataTask);yield(0,La.gz)((e=a.map(r).map((0,Eo.z7)(o,l,s)),{type:lr,payload:e})),yield(0,La.gz)(yo(!1)),yield(0,La.RE)(wo,a)}catch(e){yield(0,La.gz)(yo(!1))}var e}function*So(){const e=yield(0,La.Ys)(ho.s6),t=yield(0,La.Ys)(ho.wH),r=yield(0,La.Ys)(ho.U3),n=yield(0,La.Ys)(ho.VS),a=yield(0,La.Ys)(ho.kU),{field:i,order:o}=yield(0,La.Ys)(ho.rT);return{offset:e*t,max:e,containsWordStartingWith:r,favoriteOnly:n,findPublic:a,countResults:!1,sortBy:Z.PW[i],sortOrder:o}}function*xo(e){const t=yield(0,La.Ys)(ho.EH,e.payload);yield(0,La.RE)(Co,t)}function*Co(e,t){yield(0,La.gz)(go(e.uri,!0));try{const{total:r}=yield(0,La.RE)(S.getTotalsForQuery,(0,S.replacePlaceholdersInQuery)(e.query),Boolean(t));yield(0,La.gz)(((e,t)=>({type:sr,payload:{uri:e,total:t}}))(e.uri,r))}catch(e){si(e)}yield(0,La.gz)(go(e.uri,!1))}function*wo(e){const t=yield(0,La.Ys)(k().selectors.getQueryEstimatorEnabled);return yield(0,La.$6)(e.map((e=>(0,La.RE)(Co,e,t))))}function*Ao(e){const{uri:t,isPublic:r}=e.payload,n=yield(0,La.Ys)(ho.EH,t);if(n){yield(0,La.gz)(yo(!0));try{yield(0,La.RE)(S.markSavedSearchAsPublic,(0,Eo.Tp)(n),r),yield(0,La.gz)(((e,t)=>({type:gr,payload:{uri:e,isPublic:t}}))(t,r))}catch(e){si(e)}yield(0,La.gz)(yo(!1))}}function*Ro(e){const{uri:t,isFavorite:r}=e.payload,n=yield(0,La.Ys)(ho.EH,t);if(n){yield(0,La.gz)(yo(!0));try{yield(0,La.RE)(S.markSavedSearchAsFavorite,(0,Eo.Tp)(n),r),yield(0,La.gz)(((e,t)=>({type:Er,payload:{uri:e,isFavorite:t}}))(t,r))}catch(e){si(e)}yield(0,La.gz)(yo(!1))}}function*_o(e){const{uri:t,isGlobalFilter:r}=e.payload,n=yield(0,La.Ys)(ho.EH,t);if(n){const e=(0,Eo.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["uiState"]);(0,S.isObject)("2.0"===t.version?t:t.state)||!r?yield(0,La.gz)(((e,t)=>({type:"SAVED_SEARCHES_MARK_GLOBAL_FILTER",payload:{savedSearch:e,isGlobalFilter:t}}))(vo({},a,{uiState:t,query:(0,S.replacePlaceholdersInQuery)((0,_.propOr)("","query",a))}),r)):(0,ii.U)({errorMessage:"Saved Search is incorrect"},{title:li().text("Saved Search can't be mark as global")})}}function*Io(e){const{uri:t,name:r}=e.payload,n=yield(0,La.Ys)(ho.EH,t);if(n&&r!==n.name){yield(0,La.gz)(yo(!0));try{yield(0,La.RE)(S.updateSavedSearch,vo({},(0,Eo.Tp)(n),{name:r})),yield(0,La.gz)(((e,t)=>({type:Tr,payload:{uri:e,name:t}}))(t,r))}catch(e){si(e)}yield(0,La.gz)(yo(!1))}}function*No(){const e=yield(0,La.Ys)(ho.Kh);yield(0,La.gz)(yo(!0));try{yield(0,La.$6)(e.map((e=>(0,La.RE)(S.deleteSavedSearch,e)))),yield(0,La.gz)(fo(e.map((0,_.prop)("uri"))))}catch(e){si(e)}yield(0,La.gz)(yo(!1))}function*Po(e){const t=e.payload;yield(0,La.gz)(yo(!0));try{yield(0,La.RE)(S.deleteSavedSearch,{uri:t}),yield(0,La.gz)(fo([t]))}catch(e){si(e)}yield(0,La.gz)(yo(!1))}function*Do(e=!1,t=!1){return{query:yield(0,La.Ys)(ho.Cc,e),uiState:yield(0,La.Ys)(bo.Z,t)}}function*ko({payload:{name:e,share:t}}){const{query:r,uiState:n}=yield(0,La.RE)(Do,!0),a={isFavorite:!1,isPublic:t===Z.ib.public,name:e,query:r,uiState:n},i=yield(0,La.Ys)(ho.tp);yield(0,La.gz)(gi(!1));try{yield(0,La.gz)(Si(li().text("Saving search...")));const e=yield(0,La.RE)(S.createSavedSearch,[a]);e[0].successful?(yield(0,La.gz)(uo(e[0].object)),yield(0,La.gz)(po(!1)),yield(0,La.gz)(Si(li().text("Search saved successfully"))),i&&(yield(0,La.gz)(i))):si(e)}catch(e){si(e)}}function*Lo(e){const{uri:t,debounceTime:r}=e.payload;yield(0,La.gz)(yi(!1));const n=yield(0,La.Ys)(ho.EH,t),a=(0,ho.In)(n)||{},{errors:i}=a;i&&i.length?((e=[])=>{(0,ii.U)(e,{message:li().text("Saved Search can't be applied")})})(i):(yield(0,La.gz)(uo(n)),(yield(0,La.Ys)(ai.lF))&&(a.currentTenant=yield(0,La.Ys)(k().selectors.getTenant)),yield(0,La.gz)(D.search.actions.updateState(vo({},a,{debounceTime:r}))),yield(0,La.qn)(U.Z.STATE_UPDATED))}const Uo=[function*(){yield(0,La.Fm)([ir,cr,ur,Ar,pr,Nr],Oo)},function*(){const e={[yr]:Ao,[hr]:Ro,[xr]:Po,[Sr]:No,[vr]:Io,[br]:_o},t=yield(0,La.ZO)(Object.keys(e));for(;;){const r=yield(0,La.qn)(t);yield(0,La.RE)(e[r.type],r)}},function*(){yield(0,La.Fm)([tr],ko)},function*(){yield(0,La.Fm)([Rr],Lo)},function*(){yield(0,La.ib)([Ir],xo)}];function*jo(e){try{yield(0,La.RE)(S.createActivity,{label:S.ACTIVITY_TYPES.userSearch,description:JSON.stringify({activity:e,version:"2.0"})})}catch(e){console.warn(e)}}const Fo=e=>({type:Ze,payload:{groupId:e}}),Mo=(e,t)=>({type:Je,payload:{groupId:e,attributeId:t,attribute:vt()}}),Vo=(e,t,r)=>({type:Je,payload:{groupId:e,attributeId:t,attribute:Tt(r)}}),Bo=(e,t,r)=>({type:et,payload:{groupId:e,attributeId:t,attributeData:Ot(r)}}),zo=(e,t)=>({type:et,payload:{groupId:e,attributeId:t,attributeData:null}}),Ho=(e,t,r)=>({type:tt,payload:{groupId:e,attributeId:t,selectInfo:r}}),Yo=(e,t,r)=>({type:rt,payload:{groupId:e,attributeId:t,operator:r}}),Wo=(e,t)=>({type:nt,payload:{groupId:e,attributeId:t}}),Go=(e,t)=>({type:at,payload:{groupId:e,attributeId:t}}),qo=(e,t)=>({type:it,payload:{groupId:e,attributeId:t,id:(0,Ge.x0)()}}),Zo=(e,t,r)=>({type:ot,payload:{groupId:e,attributeId:t,filter:r}}),$o=(e,t,r)=>({type:lt,payload:{groupId:e,attributeId:t,values:r}}),Ko=(e,{attribute:t,value:r,debounceTime:n=0,pageNumber:a=1,currentOptions:i})=>({type:ct,payload:{groupId:e,attribute:t,value:r,debounceTime:n,pageNumber:a,currentOptions:i}}),Xo=(e,t,r)=>({type:ut,payload:{groupId:e,attributeId:t,values:r}}),Qo=(e,t)=>({type:pt,payload:{groupId:e,attribute:t}});var Jo=r(44006);function*el({groups:e,findGroupPath:t=St,attributesPropName:r,groupId:n,attributeId:a,selectInfo:i,actions:o}){const{checked:l,attribute:s,index:c,selectedAttributes:u}=i,{addAttributeAfter:p,changeAttribute:d,clearAttribute:m,deleteAttribute:f}=o,y=(0,_.pipe)(t(n),(0,_.path)(_.__,e),(0,_.propOr)([],r))(e),g=e=>(0,_.path)([e,"id"],y),h=y.findIndex((0,_.propEq)("id",a));if(a&&0===c)if(l)yield(0,La.gz)(d(n,a,s));else{let e=u[c+1];e?(yield(0,La.gz)(d(n,a,e)),yield(0,La.gz)(f(n,g(h+1)))):yield(0,La.gz)(m(n,a))}else{const e=u.length-c,t=a?h+c:y.length-e;l?yield(0,La.gz)(p(n,g(t-1),s)):yield(0,La.gz)(f(n,g(t)))}}function tl(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){rl(e,t,r[t])}))}return e}function rl(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*nl(e){const{groupId:t,attributeId:r,selectInfo:n}=e.payload,a=yield(0,La.Ys)(Ki.go),i={addAttributeAfter:Vo,changeAttribute:Bo,clearAttribute:zo,deleteAttribute:Wo};yield(0,La.RE)(el,{groups:a,attributesPropName:"attributes",groupId:t,attributeId:r,selectInfo:n,actions:i}),yield(0,La.gz)(Fo(t))}function*al(e){const{attribute:t,groupId:r}=e.payload,n=yield(0,La.Ys)(Ki._7,r),a=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),{data:{fieldName:i},values:o}=t,l=yield(0,La.Ys)(ai.L7,n,i),s=tl({},t.data,{values:o?(0,_.flatten)(o):void 0,pageSize:t.data.pageSize+1}),c=(0,Ua.aw)([s],l,[],a);yield(0,La.RE)(Hi,c,[s],(e=>((e,t,r)=>({type:st,payload:{groupId:e,attributeId:t,values:r}}))(r,t.id,e[i])))}function*il(e){const{attribute:t,value:r,pageNumber:n=1,debounceTime:a,groupId:i,currentOptions:o=[]}=e.payload,{entityTypeUri:l,fieldName:s}=t.data;if(""===r&&1===n)yield(0,La.gz)(Xo(i,t.id,void 0));else{a&&(yield(0,La.gw)(a));const e=yield(0,La.Ys)(Ki.ad,i,t.id),c=e=>Xo(i,t.id,o.concat(e[s]));if(r){const a=l?[{values:[l],fieldName:"type",filter:"equals"}]:[],i=yield(0,La.Ys)(ai.L7,a,s);yield(0,La.rM)(qi,tl({},t.data,{displayedItems:e,pageNumber:n,pageSize:t.data.pageSize+1}),i,r,c)}else{const r=yield(0,La.Ys)(Ki._7,i),a=yield(0,La.Ys)(ai.L7,r,s);yield(0,La.rM)(Yi,tl({},t.data,{displayedItems:e,pageNumber:n,pageSize:t.data.pageSize+1}),a,c)}}}function*ol(){const e=yield(0,La.Ys)(k().selectors.getSearchKeyword),t=yield(0,La.Ys)(ai.vH),r=yield(0,La.RE)(Wl),n=yield(0,La.Ys)(k().selectors.getMetadata),a=yield(0,La.Ys)(k().selectors.getDataTenants),i=(0,Jo.h)(n,a,r);yield(0,La.gz)(D.search.actions.updateState({advanced:i,keyword:e,map:t}))}function*ll(e){const{groupId:t,attributeId:r}=e.payload;yield(0,La.gz)(Wo(t,r)),yield(0,La.gz)(Fo(t))}function*sl(){if(yield(0,La.Ys)(Ri.IJ)){const e=yield(0,La.Ys)(Ki.go),t=yield(0,La.Ys)(Ri.Xf);for(const r of e){const e=r.entityTypes||[];if((t?e.filter((e=>t.includes(e))):e).length!==e.length){yield(0,La.gz)(Ga({silent:!0}));break}}}}const cl=[function*(){yield(0,La.ib)([tt],nl)},function*(){yield(0,La.Fm)([ct],il)},function*(){yield(0,La.ib)(mt,ol)},function*(){yield(0,La.ib)(pt,al)},function*(){yield(0,La.ib)([at],ll)}];function ul(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){pl(e,t,r[t])}))}return e}function pl(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*dl(){const e=yield(0,La.Ys)(ai.FR);yield(0,La.RE)(fl);const t=yield(0,La.Ys)(Ri.tB);var r;yield(0,La.gz)((r=t,{type:U.Z.RESET_PAGE,payload:{entityTypeUri:r}})),yield(0,La.rM)(Gl,e),yield(0,La.rM)(Tl,e),(yield(0,La.Ys)(Ri.IJ))?yield(0,La.rM)(to,e):yield(0,La.rM)(mi)}function*ml(e){const{debounceTime:t}=e.payload||{};t&&(yield(0,La.gw)(t));const r=yield(0,La.Ys)(ai.FR);yield(0,La.rM)(yl,r)}function*fl(){const e=yield(0,La.Ys)(Ri.tB);var t;yield(0,La.gz)((t=e,{type:U.Z.CLEAR_RESULTS,payload:t}))}function*yl(e){const t=yield(0,La.Ys)(k().selectors.getMetadata),r=yield(0,La.Ys)(Ri.tB),n=yield(0,La.Ys)(ai.fx,{entityTypeUri:r}),a=yield(0,La.Ys)(ai.Uz,{entityTypeUri:r}),i=yield(0,La.Ys)(ai.L9,{entityTypeUri:r}),o=yield(0,La.Ys)(ai.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,La.RE)(vl,r);c=(0,_.uniq)(c.concat(a).concat((0,Ua.kx)(t,s,[Ua.cI]))),l=!0}else c=(0,_.uniq)(c.concat((0,Ua.kx)(t,s,[Ua.Bo,Ua.cI]))),l=!1;const u=ul({page:n,rowsPerPage:a,sortOrder:i,sortField:o,forceOvOnly:l},yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),{select:c}),p=(0,Ua.XP)(s,u),d=yield(0,La.Ys)(ai.lF);yield(0,La.gz)($a(!0));try{let e;if(d){const t=(0,Ua.kH)(s,u);e=yield(0,La.RE)(Nl,t)}else{const t=(0,Ua.Lv)(s,u);e=yield(0,La.RE)(Nl,Z.NV,t)}Array.isArray(e)||(e=[]),yield(0,La.RE)(gl,(0,_.reject)(_.isNil,{query:p,sortField:o,sortOrder:i,dataTenant:d})),e=yield(0,La.RE)(Il,e),yield(0,La.gz)(Wa(e,r))}catch(e){yield(0,La.gz)(Wa([],r))}yield(0,La.gz)($a(!1))}function*gl(e){var t;yield(0,La.gz)((t=e.query,{type:U.Z.UPDATE_URL,payload:t}));const r=yield(0,La.Ys)(k().selectors.getSearchProviderData);(0,_.equals)(null==r?void 0:r.data,e)||(yield(0,La.gz)(D.search.actions.setSearchNavigationData(null))),yield(0,La.gz)(D.search.actions.setSearchProviderData({type:"search",data:e}))}function*hl(e){const{columns:t,prevColumns:r}=e.payload;if((0,Ai.tU)(t,r)){const e=yield(0,La.Ys)(Ri.o4),t=(yield(0,La.Ys)(ai.BP,{entityTypeUri:e})).map((e=>e.uri)),r=yield(0,La.RE)(vl,e),n=yield(0,La.Ys)(ai.FR),a=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),i=(0,Ua.aG)(t,n,ul({select:r},a));yield(0,La.gz)($a(!0));try{let t=yield(0,La.RE)(Nl,i.url,i.options);t=yield(0,La.RE)(Il,t),yield(0,La.gz)(Wa(t,e))}catch(t){yield(0,La.gz)(Wa([],e)),si(t)}yield(0,La.gz)($a(!1))}}function*El(){const e=yield(0,La.Ys)(Ri.tB),t=yield(0,La.Ys)(ai.BP,{entityTypeUri:e});t&&(yield(0,La.gz)(D.search.actions.searchResultsSet(t)))}function*bl(e){const{entityTypeUri:t,keywordValue:r}=e.payload;yield(0,La.gz)(((e=!1)=>({type:L.k.CLEAR_ALL_VALUES,payload:{silent:e}}))(!0)),yield(0,La.gz)(Ja("type",[t],!0)),yield(0,La.gz)(D.search.actions.keywordUpdated({value:r,isRawFilter:!1}))}function*vl(e){const t=yield(0,La.Ys)(Ri.Gv,e);return(0,Ai.vw)(t)}function*Tl(e){const t=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),r=(0,Ua.Vg)(e,[],t);try{const e=yield(0,La.RE)(Nl,Z.jS,{method:"POST",body:JSON.stringify(r)});yield(0,La.gz)(Za(e.total))}catch(e){yield(0,La.gz)(Za(0))}}function*Ol(){yield(0,La.RE)(xl);const e=yield(0,La.RE)(Do,!0);(0,_.isEmpty)(e.query)||(yield(0,La.RE)(jo,e))}const Sl=[st];function*xl(){for(;yield(0,La.Ys)(Ki.UM);)yield(0,La.qn)(Sl)}function*Cl(e){const{debounceTime:t}=e.payload||{};t&&(yield(0,La.gw)(t)),(0,ja.$L)(e)&&(yield(0,La.RE)(Ql)),(0,_.pathOr)(!1,["payload","silent"],e)||(yield(0,La.RE)(dl),yield(0,La.RE)(Ol))}function*wl(e){var t;const r=(0,_.path)(["payload","searchOptions"],e),n=(0,_.path)(["payload","errors"],e),a=(0,_.pathOr)(0,["payload","debounceTime"],e);n&&n.length&&((e=[])=>{(0,ii.U)(e,{message:li().text("Can't apply search state")})})(n),!(null!==(t=yield(0,La.Ys)(k().selectors.getShowSearchByOv))&&void 0!==t?t:yield(0,La.Ys)(Ri.cC))&&r&&r.searchByOv&&(yield(0,La.gz)(D.search.actions.updateSearchOptions({searchByOv:!1,ovOnly:!1}))),yield(0,La.RE)(ts),yield(0,La.RE)(sl),yield(0,La.RE)(no),yield(0,La.RE)(ao),yield(0,La.RE)(Al),yield(0,La.gz)(((e=0)=>({type:U.Z.STATE_UPDATED,payload:{debounceTime:e}}))(a))}function*Al(){const e=yield(0,La.Ys)(Ri.d7),t=yield(0,La.Ys)(ai.Qy);!e&&t.length&&(yield(0,La.gz)(Ka(null,null,!0)))}function*Rl(){const e=yield(0,La.Ys)(ai.A7),{activityFilter:t,globalFilter:r}=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),n=yield(0,La.Ys)(k().selectors.getSearchOptions),a=n&&n.searchByOv,i=[(0,Ua.s4)(e,[],{globalFilter:r})];a&&i.push("options=searchByOv"),t&&i.push(`activeness=${t}`);const o=i.filter(_.identity).join("&"),l=new URLSearchParams(o);if(yield(0,La.Ys)(k().selectors.getSharedPreferencesEnabled)){const e=yield(0,La.Ys)(k().selectors.getServicesPath),t=yield(0,La.Ys)(k().selectors.getTenant),r=yield(0,La.Ys)(k().selectors.getEnvironment),n=yield(0,La.Ys)(k().selectors.getUserName),a=yield(0,La.Ys)(Ri.XM),i=yield(0,La.Ys)(Ri.uJ),o=(0,_.pipe)((0,_.map)((0,_.pipe)((0,_.map)((0,_.path)(["attrType","uri"])),(0,_.reject)(S.isEmptyValue))),(0,_.reject)(_.isEmpty)),s="searchExportData",c={name:s,tenant:t,environment:r,user:n,servicesPath:e,value:{searchResultsColumnsUris:(0,Ai.gj)(a)?o(i):void 0}};try{yield(0,La.RE)(S.setSharedPreferences,c),l.set("sharedPreferenceName",s)}catch(e){si(e)}}yield(0,La.gz)(D.ui.actions.openConsoleApp("Export","entities",l.toString()))}function*_l(){yield(0,La.gz)(D.ui.actions.openConsoleApp("Data Loader","projects"))}function*Il(e){const t=yield(0,La.Ys)(ai.lF);return e&&t?e.map((0,S.enrichEntityWithDataTenant)(t)):e}function*Nl(e,t){const r=yield(0,La.Ys)(k().selectors.getTenant),n=yield(0,La.Ys)(ai.lF),a=yield(0,La.Ys)(k().selectors.getDtssPath);return yield(0,La.RE)(Ua.Es,{url:e,options:t,customerTenant:r,dataTenant:n,dtssPath:a})}const Pl=[L.k.CHANGE_VALUES,D.search.constants.KEYWORD_UPDATED,U.Z.REFRESH,L.k.CLEAR_ALL_VALUES,U.Z.MAP_CHANGE_VALUE,U.Z.CLEAR_ALL,U.Z.STATE_UPDATED,dt,D.search.constants.SEARCH_OPTIONS_UPDATED,D.search.constants.ACTIVITY_FILTER_UPDATED,D.search.constants.GLOBAL_FILTER_UPDATED,U.Z.CHANGE_CURRENT_TENANT],Dl=[function*(){yield(0,La.Fm)(Pl,Cl)},function*(){yield(0,La.Fm)([U.Z.CHANGE_PAGE,U.Z.RESET_PAGE,U.Z.CHANGE_ROWS_PER_PAGE,U.Z.REFRESH_DISPLAYED_ENTITIES,U.Z.CHANGE_SORT],ml)},function*(){yield(0,La.Fm)(ve,hl)},function*(){yield(0,La.Fm)([U.Z.UPDATE_ENTITIES,Te,Ae],El)},function*(){yield(0,La.Fm)(U.Z.SHOW_MORE_RESULTS_FOR_ENTITY_TYPE,bl)},function*(){yield(0,La.Fm)(D.search.constants.UPDATE_STATE,wl)},function*(){yield(0,La.Fm)(U.Z.EXPORT_RESULTS,Rl)},function*(){yield(0,La.Fm)(U.Z.OPEN_DATA_LOADER,_l)}];var kl=r(56906);function Ll(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Ul(e,t){try{const[r,n]=yield(0,La.RE)(jl,e,[]);if((0,_.isNil)(r)||(0,_.isNil)(n))yield(0,La.gz)(ei({[e.fieldName]:[]}));else{const[a,i]=(0,ja.dG)(e.type),o=(0,ja.q7)(a,r),l=(0,ja.q7)(i,n),s=(0,ni.Oz)(e.attrType&&e.attrType.type),[c,u]=s.greaterThan(o,l)?[l,o]:[o,l],p=yield(0,La.RE)(Fl,e,c,u,t),d={[e.fieldName]:p};yield(0,La.gz)(ei(d))}}catch(e){console.warn(e)}}function*jl(e,t){const r=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),n=(0,Ua.rN)(e,t,[e.fieldName],r),a=yield(0,La.RE)(Nl,n.url,n.options),i=Mi(a,[e]),{min:o,max:l,count:s}=(0,ja.Kn)(i,[e])[e.fieldName];return s?[(0,N.bB)(e)?0:o,l]:[]}function*Fl(e,t,r,n){const a=e.attrType&&e.attrType.type,i=(0,kl.C)(a),o=i.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Ll(e,t,r[t])}))}return e}({interval:o,offset:t},yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions)),s=(0,Ua.ti)(e,n,[e.fieldName],l),c=yield(0,La.RE)(Nl,s.url,s.options),u=yield(0,La.Ys)(k().selectors.getMetadata),p=Mi(c,[e]),d=(0,ja.HC)(u,p,[e]);return i.addRanges(d[e.fieldName],t,r,o).map(((e,t,n)=>({value:[e.value,t<n.length-1?n[t+1].value:r],number:e.number})))}function Ml(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vl={matches:Ua.dW,"dtPotentialMatches.matches":Ua.dW,"potentialMatches.matchScore":Ua._9};function*Bl(e,t){try{const[r,n]=yield(0,La.RE)(jl,e,[]);if((0,_.isNil)(r)||(0,_.isNil)(n))yield(0,La.gz)(ei({[e.fieldName]:[]}));else{const[a,i]=(0,ja.dG)(e.type),o=(0,ja.q7)(a,r),l=(0,ja.q7)(i,n),s=yield(0,La.RE)(zl,e,o,l,t),c={[e.fieldName]:s};yield(0,La.gz)(ei(c))}}catch(e){console.warn(e)}}function*zl(e,t,r,n){const a=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),i=Math.min(5,r-t+1),o=yield(0,La.RE)(S.rawRequest,Vl[e.fieldNameForRequest||e.fieldName](t,r,i,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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Ml(e,t,r[t])}))}return e}({},a,{dataTenant:e.dataTenant})));return o.map((e=>({number:e.count,value:[e.from,e.to]})))}function Hl(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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Wl(){const e=yield(0,La.Ys)(P.X0),t=yield(0,La.Ys)(P.Mp);return Object.values((0,ja.t8)(e,t))}function*Gl(e){const t=yield(0,La.RE)(Wl),[r,n]=(0,_.partition)(N.bB,t);let[a,i]=(0,_.partition)(S.isRangeFacet,n);for(let t=0;t<r.length;t++)yield(0,La.rM)(Bl,r[t],e);for(let t=0;t<a.length;t++)yield(0,La.rM)(Ul,a[t],e);const[o,l]=(0,_.partition)((e=>e.values&&e.values.length),i);for(let t=0;t<o.length;t++)yield(0,La.rM)(Zl,o[t],e);const[s,c]=(0,_.partition)(N.DT,l);for(const t of s)yield(0,La.rM)($l,[t],e);c.length&&(yield(0,La.rM)($l,c,e))}function*ql(e){const t=yield(0,La.Ys)(ai.FR),[r,n]=(0,_.partition)(N.bB,e.payload),[a,i]=(0,_.partition)(S.isRangeFacet,n),[o,l]=(0,_.partition)(N.DT,i);for(let e=0;e<r.length;e++)yield(0,La.rM)(Bl,r[e],t);for(let e=0;e<a.length;e++)yield(0,La.rM)(Ul,a[e],t);for(const e of o)yield(0,La.rM)($l,[e],t);l.length&&(yield(0,La.rM)($l,l,t))}function*Zl(e,t,r){const n=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),a=(0,Ua.aw)([Hl({},e,{pageSize:e.pageSize+1})],t,[e.fieldName],n,r);yield(0,La.RE)(Kl,a,[e])}function*$l(e,t,r){const n=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),a=(0,Ua.aw)(e.map((e=>Hl({},e,{pageSize:e.pageSize+1}))),t,[],n,r);yield(0,La.RE)(Kl,a,e)}function*Kl(e,t){yield(0,La.RE)(Hi,e,t,ei)}function*Xl(e){const{facetFieldName:t,value:r,debounceTime:n,pageNumber:a=1,currentOptions:i=[]}=e.payload;if(""===r&&1===a)yield(0,La.gz)((e=>({type:L.k.DESTROY_FILTERED_DATA,payload:e}))(t));else{const e=yield(0,La.Ys)(P.X0),o=yield(0,La.Ys)(P.Mp),l=Hl({},(0,ja.t8)(e,o)[t]);if("type"===t){const e={[t]:[...l.data.filter((e=>e.label.toLowerCase().includes(r.toLowerCase())))]};yield(0,La.gz)(ti(e))}else{n&&(yield(0,La.gw)(n));const e=yield(0,La.Ys)(ai.FR),o=yield(0,La.Ys)(P.rM,t),s=e=>ti({[t]:i.concat(e[t])});r?yield(0,La.rM)(qi,Hl({},l,{displayedItems:o,pageNumber:a,pageSize:l.pageSize+1}),e,r,s):yield(0,La.rM)(Yi,Hl({},l,{pageNumber:a,pageSize:l.pageSize+1}),e,s)}}}function*Ql(){const e=yield(0,La.Ys)(P.DX),t=t=>t.entityTypeUri&&t.entityTypeUri!==e[0],r=yield(0,La.Ys)(P.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,La.gz)(Qa(n)))}}function*Jl(e){const{facetsToAdd:t=[],fieldNamesToDelete:r=[],changedEntityTypes:n,addToEnd:a=!1}=e.payload;if(t.length||r.length){t.length&&(yield(0,La.gz)(Xa(t,a)));const e=yield(0,La.RE)(Wl);let o=!1;if(r.length){const t=e.filter((e=>e.values&&e.values.length));o=r.some((e=>t.some((t=>{var r;return null===(r=t.fieldName)||void 0===r?void 0:r.startsWith(e)})))),yield(0,La.gz)(Qa(r))}if(null!=n)yield(0,La.gz)(Ja("type",n));else if(o)yield(0,La.gz)((({debounceTime:e}={})=>({type:U.Z.REFRESH,payload:{debounceTime:e}}))());else if(t.length){const r=e.filter((e=>t.some((t=>e.fieldName.startsWith(t.fieldName)))));yield(0,La.gz)((i=r,{type:L.k.REQUEST_GIVEN_FACETS_DATA,payload:i}))}}var i}function*es(){const e=yield(0,La.Ys)(k().selectors.getSearchKeyword),t=yield(0,La.Ys)(ai.vH),r=yield(0,La.Ys)(Ki.go),n=yield(0,La.Ys)(k().selectors.getMetadata),a=yield(0,La.Ys)(k().selectors.getDataTenants);if(Ba(n,r,a)){const i=((e,t,r)=>{const n=Ya(e,t,r),a=Ha(e,t,r),i=(0,_.pipe)(_.flatten,_.uniq)((0,ft.VO)(t)),o=(0,N.$t)(e);return a.reduce(((e,{fieldName:t,values:r})=>{const a=n.find((e=>e.fieldName===t));return a&&(e.facetsConfigs.push(a),e.facetsData[t]={values:r}),e}),{facetsConfigs:[o],facetsData:{[o.fieldName]:(l=i,(0,ja.Kk)({values:l})?{values:l,showAllItems:!0}:{values:l})}});var l})(n,r,a);yield(0,La.gz)(D.search.actions.updateState({facets:i,keyword:e,map:t}))}}function*ts(){if(!(yield(0,La.Ys)(Ri.IJ))){const e=yield(0,La.Ys)(k().selectors.getMetadata);if((yield(0,La.Ys)(P.Mp)).some(S.isTypeFacet)){const e=yield(0,La.Ys)(Ri.Xf),t=yield(0,La.Ys)(P.DX);(e?t.filter((t=>e.includes(t))):t).length!==t.length&&(yield(0,La.gz)(Ga({silent:!0})))}else{const t=[(0,N.$t)(e)];yield(0,La.gz)(Xa(t))}}}function*rs(){const e=yield(0,La.Ys)(k().selectors.getMetadata),t=yield(0,La.Ys)(P.X0),r=(0,ja.t8)({type:t.type},[(0,N.$t)(e)]).type.data.reduce(((e,t)=>(e[(0,S.getLastUriPart)(t.value)]=t.number,e)),{}),n=yield(0,La.Ys)(Ri.Xf);return(0,ja.wW)(e,r,n)}const ns=[function*(){yield(0,La.Fm)([L.k.FILTER_FACET_DATA],Xl)},function*(){yield(0,La.ib)(L.k.REQUEST_GIVEN_FACETS_DATA,ql)},function*(){yield(0,La.ib)(L.k.HANDLE_CONFIGS_CHANGES,Jl)},function*(){yield(0,La.ib)(L.k.CONVERT_FROM_ADVANCED_SEARCH,es)}];function as(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const is=e=>{const t=["view","searchResultsColumns"],r=(0,_.pathOr)({},t,e),n=(0,_.map)((0,_.map)((0,_.pipe)((0,_.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){as(e,t,r[t])}))}return e}({},e,{attrType:{uri:(0,_.pathOr)("",["attrType","uri"],e)}}):e))),r),a=(0,_.lensPath)(t),i=(0,_.omit)(["sortField","sortOrder","entityTypeTab"],e.view),o=(0,_.lensPath)(["view"]),l=["keyword"],s=(0,_.pathOr)("",l,e),c=(0,_.lensPath)(l),u=["map"],p=(0,_.pathOr)("",u,e),d=(0,_.lensPath)(u);return(0,_.pipe)((0,_.omit)(["searchOptions"]),(0,_.set)(o,i),(0,_.set)(a,n),(0,_.set)(c,s),(0,_.set)(d,p))(e)};function os(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ls(e,t,r[t])}))}return e}function ls(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*ss({payload:{share:e}}){const{query:t,uiState:r}=yield(0,La.RE)(Do,!0),n=os({},yield(0,La.Ys)(ho.LA),{isPublic:e===Z.ib.public,query:t,uiState:r}),a=yield(0,La.Ys)(ho.tp);yield(0,La.gz)(gi(!1));try{yield(0,La.gz)(Si(li().text("Updating search..."))),yield(0,La.RE)(S.updateSavedSearch,n),yield(0,La.gz)(po(!1)),yield(0,La.gz)(Si(li().text("Search updated successfully"))),a&&(yield(0,La.gz)(a))}catch(e){si(e)}}function*cs(){const e=yield(0,La.Ys)(ho.LA);if(!e)return void(yield(0,La.gz)(po(!1)));const t=yield(0,La.Ys)(k().selectors.getMetadata),r=yield(0,La.Ys)(k().selectors.getDataTenants),n=yield(0,La.Ys)(k().selectors.getCanUserReadWorkflowDataTask),{uiState:a}=(0,Eo.z7)(t,r,n,yield(0,La.RE)(Do)),i=(({savedUiState:e,actualUiState:t})=>{const r=is(e),n=is(t);if(!(0,_.equals)(r,n))return!1;if((0,_.path)(["view","searchResultsMode"],e)===Z.ll.TABLE){const r=["view","sortField"],n=["view","sortOrder"],a=["view","entityTypeTab"],i=(0,_.path)(r,e),o=(0,_.path)(r,t),l=(0,_.path)(n,e),s=(0,_.path)(n,t),c=(0,_.path)(a,e),u=(0,_.path)(a,t);if(!(0,_.equals)(i,o)||!(0,_.equals)(l,s)||!(0,_.equals)(c,u))return!1}const a=["searchOptions"],i=(0,_.pathOr)(null,a,e),o=(0,_.pathOr)(null,a,t);return!!((0,_.isNil)(i)||(0,_.isNil)(o)||(0,_.equals)(i,o))})({savedUiState:e.uiState,actualUiState:a});yield(0,La.gz)(po(!i))}function*us(e){const t=yield(0,La.Ys)(ho.LA);if(t)switch(e.type){case Tr:case gr:case Er:t.uri===e.payload.uri&&(yield(0,La.gz)(uo(os({},t,e.payload))));break;case Cr:(0,_.includes)(t.uri,e.payload)&&(yield(0,La.gz)(uo(null)));break;case ar:yield(0,La.gz)(uo(os({},t,{isPublic:e.payload.share===Z.ib.public})));break;default:(yield(0,La.Ys)(ai.kw))&&(yield(0,La.gz)(uo(null)))}}function*ps(e){const t=yield(0,La.Ys)(ho.EH,e);if(t)return t;const r=yield(0,La.Ys)(k().selectors.getMetadata),n=yield(0,La.Ys)(k().selectors.getDataTenants),a=yield(0,La.Ys)(k().selectors.getCanUserReadWorkflowDataTask);try{const t=yield(0,La.RE)(S.getSavedSearch,(0,Eo.tk)(e));return(0,Eo.z7)(r,n,a,t)}catch(e){return si(e),null}}function*ds(e){const t=(0,_.path)(["payload","currentSavedSearchUri"],e);if(!t)return;const r=yield(0,La.Ys)(ho.LA);if((0,_.prop)("uri",r)===t)return;const n=yield(0,La.RE)(ps,t);n&&(yield(0,La.gz)(uo(n)),yield(0,La.RE)(cs))}const ms=[...Pl,Te,U.Z.CHANGE_SORT,Ae,ve,xe,Se,Re,L.k.CREATE_FACETS,L.k.DESTROY_FACETS,L.k.SHOW_MORE_ENTITY_TYPES],fs=[function*(){yield(0,La.Fm)(ms,cs)},function*(){yield(0,La.Fm)([ar],ss)},function*(){yield(0,La.Fm)([Tr,gr,Er,Cr,ar,...Pl],us)},function*(){yield(0,La.Fm)(D.search.constants.UPDATE_STATE,ds)}];function ys(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*gs(){yield(0,La.gw)(500);const{uiState:e,query:t}=yield(0,La.RE)(Do,!1,!0),r=yield(0,La.Ys)(ho.LA);yield(0,La.gz)(D.search.actions.saveState(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ys(e,t,r[t])}))}return e}({},e,{query:t,currentSavedSearchUri:(0,_.path)(["uri"],r)})))}function*hs(){yield(0,La.qn)(D.search.constants.UPDATE_STATE);const e=(0,_.reject)((0,_.includes)(_.__,[U.Z.REFRESH]),ms);yield(0,La.Fm)([rr,...e],gs)}const Es=e=>({type:Pr,payload:e}),bs=()=>({type:Fr}),vs=e=>({type:Vr,payload:e}),Ts=e=>({type:zr,payload:e}),Os=(e,t)=>({type:Wr,payload:{searchCreatedDate:e,isLoading:t}});var Ss=r(97010),xs=r(73667);const Cs=(0,_.path)([Z.Jf,"recentSearches"]),ws=e=>Cs(e).items,As=e=>Cs(e).filterWord,Rs=(0,_.curry)(((e,t)=>!e||t&&t.name.toLocaleLowerCase().includes(e.toLocaleLowerCase()))),_s=e=>(0,_.pipe)(ws,(0,_.filter)(Rs(As(e))))(e),Is=e=>Cs(e).loading,Ns=(0,xs.Rm)(ws),Ps=(0,xs.d1)(ws),Ds=(0,xs.Ky)(ws),ks=(0,xs.$y)(ws),Ls=e=>Cs(e).lastSavedRecentSearch,Us=(e,t)=>ws(e).find((0,_.propEq)("createdDate",t)),js=(0,_.path)(["advancedSearch","searchParams","groups"]);function Fs(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Ms(e,t,r[t])}))}return e}function Ms(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Vs(){yield(0,La.gz)(Ts(!0));try{const t=yield(0,La.Ys)(k().selectors.getTenant),r=yield(0,La.Ys)(k().selectors.getEnvironment),n=yield(0,La.Ys)(k().selectors.getServicesPath),{result:a=[]}=yield(0,La.RE)(S.getRecentSearches,{environment:r,tenant:t,servicesPath:n}),i=(0,_.sort)((0,_.descend)((0,_.prop)("createdDate")))(a);yield(0,La.gz)((e=i,{type:kr,payload:e})),yield(0,La.gz)(Ts(!1)),yield(0,La.RE)(Hs,i)}catch(e){si(e),yield(0,La.gz)(Ts(!1))}var e}function*Bs(e){const t=yield(0,La.Ys)(Us,e.payload);yield(0,La.RE)(zs,t)}function*zs(e,t){yield(0,La.gz)(Os(e.createdDate,!0));try{const{total:r}=yield(0,La.RE)(S.getTotalsForQuery,(0,S.replacePlaceholdersInQuery)(e.query),Boolean(t));yield(0,La.gz)(((e,t)=>({type:Lr,payload:{searchCreatedDate:e,total:t}}))(e.createdDate,r))}catch(e){si(e)}yield(0,La.gz)(Os(e.createdDate,!1))}function*Hs(e){const t=yield(0,La.Ys)(k().selectors.getQueryEstimatorEnabled);return yield(0,La.$6)(e.map((e=>(0,La.RE)(zs,e,t))))}function*Ys(){const e=yield(0,La.Ys)(ks),t=yield(0,La.Ys)(k().selectors.getServicesPath);yield(0,La.gz)(Ts(!0));try{yield(0,La.$6)(e.map((e=>(0,La.RE)(S.deleteRecentSearch,Fs({},e,{servicesPath:t}))))),yield(0,La.gz)(vs(e))}catch(e){si(e)}yield(0,La.gz)(Ts(!1))}function*Ws(e){const t=e.payload,r=yield(0,La.Ys)(k().selectors.getServicesPath);yield(0,La.gz)(Ts(!0));try{yield(0,La.RE)(S.deleteRecentSearch,Fs({},t,{servicesPath:r})),yield(0,La.gz)(vs([t]))}catch(e){si(e)}yield(0,La.gz)(Ts(!1))}function*Gs(e){const{debounceTime:t}=e.payload;t&&(yield(0,La.gw)(t));const{query:r,uiState:n}=yield(0,La.RE)(Do,!0),a=yield(0,La.Ys)(Ri.$s),i=yield(0,La.Ys)(Ls),o=yield(0,La.Ys)(ai.kw),l=yield(0,La.Ys)(k().selectors.getTenant),s=yield(0,La.Ys)(k().selectors.getEnvironment),c=yield(0,La.Ys)(k().selectors.getServicesPath),u=((e={})=>{const t=js(e);return t&&t.length>0?((e={})=>{const t=(0,_.chain)((0,_.prop)("attributes")),r=(0,_.filter)((0,_.has)("values")),n=(0,_.pipe)(js,t,r),a=(0,_.pipe)((0,_.prop)("values"),(0,_.map)((0,_.prop)("label")),(0,_.join)(", ")),i=(0,_.path)(["data","title"]),o=(0,_.pathEq)(["data","fieldName"],"type"),l=(0,_.find)(o),s=(0,_.pipe)(l,(0,_.when)(_.identity,a)),c=(0,_.pipe)((0,_.reject)(o),(0,_.map)(i),(0,_.reject)(_.isNil),(0,_.join)(", "));return[s(u=n(e)),c(u)].filter(_.identity).join(" - ");var u})(e):((e={})=>{const t=(0,_.prop)("facets"),r=(0,_.prop)("facetsData"),n=(0,_.prop)("facetsConfigs"),a=(0,_.prop)("values"),i=(0,_.prop)("label"),o=(0,_.prop)("title"),l=(0,_.pipe)(a,(e=>e&&e.length>0)),s=(0,_.curry)(((e,r)=>(0,_.pipe)(t,n,(0,_.find)((0,_.propEq)("fieldName",r)),(0,_.defaultTo)({}),o)(e))),c=(0,ja.XK)(e),u=[];c&&u.push(a(c).map((e=>(0,_.pipe)((0,_.propOr)([],"data"),(0,_.find)((0,_.propEq)("value",e)),(0,_.defaultTo)({}),i))).map((e=>e(c))).join(", "));const p=(0,_.pipe)(t,r,_.values,(0,_.reject)(S.isTypeFacet),(0,_.filter)(l),(0,_.map)((0,_.prop)("fieldName"))),d=(0,_.pipe)(p,(0,_.map)(s(e)))(e);return d.length>0&&u.push(d.join(", ")),u.filter(_.identity).join(" - ")})(e)})(a),p=(0,S.getHash)(r),d={query:r,state:n,name:u,environment:s,tenant:l};try{if(i!==p&&!o){const e=yield(0,La.RE)(S.createRecentSearch,d,c);e.success?yield(0,La.gz)((e=>({type:Yr,payload:e}))(p)):si(e)}}catch(e){si(e)}}function*qs(e){const{search:t,debounceTime:r}=e.payload;yield(0,La.gz)(yi(!1));const n=yield(0,La.Ys)(k().selectors.getMetadata),a=yield(0,La.Ys)(k().selectors.getDataTenants),i=yield(0,La.Ys)(k().selectors.getCanUserReadWorkflowDataTask);let o={};try{o=(0,_.pipe)(Ss.Z,(0,Ss.f)(null))(n,JSON.parse(t.state),{},a,i)}catch(e){o={}}(yield(0,La.Ys)(ai.lF))&&(o.currentTenant=yield(0,La.Ys)(k().selectors.getTenant)),yield(0,La.gz)(D.search.actions.updateState(Fs({},o,{debounceTime:r})))}const Zs=({type:e,payload:t={}})=>e===D.search.constants.KEYWORD_UPDATED&&!(null==t||!t.saveToRecent),$s=[function*(){yield(0,La.Fm)([Dr],Vs)},function*(){yield(0,La.ib)(Mr,Ys)},function*(){yield(0,La.Fm)([D.ui.constants.UIActions.OPEN_ENTITY,tr,ar,Pr,U.Z.CHANGE_PAGE,U.Z.CHANGE_ROWS_PER_PAGE,U.Z.EXPORT_RESULTS,Zs],Gs)},function*(){yield(0,La.Fm)([qr],qs)},function*(){yield(0,La.ib)([Gr],Bs)},function*(){yield(0,La.ib)(Br,Ws)}],Ks=e=>e[Z.Jf].entity.loading,Xs=e=>e[Z.Jf].entity.selectedEntityUri,Qs=e=>e[Z.Jf].entity.entity,Js=e=>({type:hn,payload:e}),ec=e=>({type:En,payload:e}),tc=e=>({type:bn,payload:e}),rc=e=>({type:vn,payload:e});function*nc(e){if(yield(0,La.Ys)(ai.lF)){const t=yield(0,La.RE)(Nl,(0,S.getDtssEntityUrl)(e));return(yield(0,La.RE)(Il,t))[0]}{const t=yield(0,La.Ys)(k().selectors.getMetadata),r=(0,S.addMetadataSpecificGetEntityOptions)(t);return yield(0,La.RE)(S.getEntity,e,r)}}function*ac(e){const t=e.payload;(yield(0,La.Ys)(Xs))!==t&&(yield(0,La.gz)(tc(t)));const r=yield(0,La.Ys)(Qs);if(yield(0,La.gz)(Js(!0)),(0,_.isNil)(t))yield(0,La.gz)(rc(null));else if(!r||r.uri!==t)try{const e=yield(0,La.RE)(nc,t);yield(0,La.gz)(rc(e))}catch(e){n=e,(0,ii.U)(n,{defaultMessage:li().text("Can't load entity")}),yield(0,La.gz)(rc(null))}var n;yield(0,La.gz)(Js(!1))}const ic=[function*(){yield(0,La.Fm)(En,ac)}];function*oc(e){const t="type"===(0,_.path)(["payload","facetFieldName"],e),r=(0,_.path)(["payload","values"],e);if(!t||1!==(0,_.length)(r))return;const n=yield(0,La.Ys)(k().selectors.getMetadata),a=(0,S.getEntityType)(n,r[0]),i=a.defaultFacetedAttributes||[];if(i.length>0){const e=yield(0,La.Ys)(P.Mp),t=({fieldName:t})=>(0,_.none)((0,_.propEq)("fieldName",t),e),r=(0,ci.vf)(n,a).map((e=>(0,ci.NG)(n,e,a.uri,"",N.u7))),o=i.reduce(((e,n)=>{const a=(0,S.attributeUriToSearchUri)(n),i=(0,N.zy)(r,a);return i&&t(i)?e.concat(i.children?(0,ci.jj)(i).filter(t):i):e}),[]);o.length>0&&(yield(0,La.gz)(Xa(o,!0)))}}const lc=[function*(){yield(0,La.Fm)(L.k.CHANGE_VALUES,oc)}],sc=e=>({type:Un,payload:e}),cc=()=>({type:Mn}),uc=()=>({type:Rn}),pc=e=>({type:Nn,payload:e}),dc=e=>({type:Dn,payload:e}),mc=e=>({type:Ln,payload:e}),fc=e=>({type:Fn,payload:e}),yc=e=>({type:Vn,payload:e}),gc=({id:e,groupId:t})=>({type:Yn,payload:{id:e,groupId:t}}),hc=({id:e,groupId:t,operationParameters:r})=>({type:Hn,payload:{id:e,groupId:t,operationParameters:r}}),Ec=(e,t,r)=>({type:Gn,payload:{groupId:e,attributeId:t,attribute:Tt(r)}}),bc=(e,t,r)=>({type:qn,payload:{groupId:e,attributeId:t,attributeData:Ot(r)}}),vc=(e,t)=>({type:qn,payload:{groupId:e,attributeId:t,attributeData:null}}),Tc=(e,t,r)=>({type:Zn,payload:{groupId:e,attributeId:t,selectInfo:r}}),Oc=(e,t)=>({type:$n,payload:{groupId:e,attributeId:t}}),Sc=(e,t,r)=>({type:Kn,payload:{groupId:e,attributeId:t,filter:r}}),xc=(e,t,r)=>({type:Xn,payload:{groupId:e,attributeId:t,values:r}}),Cc=e=>({type:ta,payload:e});var wc=r(97698);const Ac=(0,_.has)("actions"),Rc=e=>e.actions.map((0,_.assocPath)(["operationParameters","conditions"],e.conditions)),_c=(0,_.path)(["operationParameters","attributeTypeData","attributeType"]),Ic=(0,_.path)(["operationParameters","attributeTypeData","fieldName"]),Nc=(0,_.path)(["operationParameters","pin"]),Pc=(0,_.path)(["operationParameters","addNestedAttribute"]),Dc=(0,_.path)(["operationParameters","attributeValue"]),kc=(0,_.path)(["operationParameters","attributeValueToFind"]),Lc=(0,_.anyPass)([(0,_.equals)(ra.d.AddNew),(0,_.equals)(ra.d.ReplaceAllWith)]),Uc=(0,_.anyPass)([(0,_.equals)(ra.d.AddNew),(0,_.equals)(ra.d.ReplaceAllWith),(0,_.equals)(ra.d.FindAndReplace)]),jc=(0,_.equals)(ra.d.AddNew),Fc=(0,_.both)((0,_.pipe)(_c,S.isNested),(0,_.pipe)((0,_.prop)("operation"),Lc)),Mc=(0,_.both)((0,_.pipe)(_c,S.isReference),(0,_.pipe)((0,_.prop)("operation"),jc)),Vc=(0,_.both)((0,_.pipe)(Dc,S.isLookupAttrType),(0,_.pipe)((0,_.prop)("operation"),Uc)),Bc=(0,_.pipe)(_c,S.isLookupAttrType),zc=e=>{switch(e){case ra.d.AddNew:case ra.d.RepointReference:case ra.d.ReplaceAllWith:return["attributeValue"];case ra.d.FindAndReplace:return["attributeValueToFind","attributeValue"];case ra.d.FindAndRemove:return["attributeValueToFind"];default:return[]}},Hc=e=>{if(!e.operation||!e.operationParameters)return!1;const t=Fc(e),r=Mc(e),n=Bc(e),a=zc(e.operation);for(let i of a){const a=e.operationParameters[i];if((0,S.isEmptyValue)(a)||n&&(0,S.isEmptyValue)((0,S.getAttrTypeLookupCode)(a))||r&&(0,S.isEmptyValue)((0,S.getReferencedEntityFromAttrValue)(a))||t&&(0,S.isEmptyValue)((0,S.cleanAttributesWith)({deleteEmptyComplex:!0})(a.value)))return!1}return!0},Yc=e=>{const t=Fc(e),r=Mc(e);return t||r?zc(e.operation).reduce(((e,t)=>{const r=["operationParameters",t,"value"];if((0,_.path)(r,e)){const t=(0,_.lensPath)(r);return(0,_.over)(t,(0,S.cleanAttributesWith)({deleteEmptyComplex:!0}),e)}return e}),e):e},Wc=e=>e[Z.Jf].bulkUpdate.operation,Gc=e=>e[Z.Jf].bulkUpdate.activeStep,qc=e=>e[Z.Jf].bulkUpdate.loading,Zc=e=>{const t=(0,Ri.IJ)(e)?(0,Ki.V6)(e):(0,P.DX)(e),r=(0,Ri.tB)(e);return r||1===t.length?r||t[0]:null},$c=(0,_.path)([Z.Jf,"bulkUpdate","objects"]),Kc=e=>$c(e).total,Xc=e=>$c(e).selectionMode,Qc=e=>$c(e).entities,Jc=e=>$c(e).selectedEntities,eu=e=>$c(e).page,tu=e=>$c(e).rowsPerPage,ru=e=>$c(e).sortField,nu=e=>$c(e).sortOrder,au=e=>$c(e).selectedColumns,iu=e=>$c(e).filterText,ou=(0,_.pipe)(Xc,(0,_.equals)(Z.v6.include)),lu=(0,_.ifElse)(ou,(0,_.pipe)(Jc,_.length),(e=>{const t=Jc(e).length;return(0,ai.hX)(e)-t})),su=(0,_.pipe)(lu,(0,_.gt)(_.__,0)),cu=e=>e[Z.Jf].bulkUpdate.actions,uu=(0,wc.createSelector)(cu,(0,_.pipe)((0,_.map)((0,_.ifElse)(Ac,(0,_.evolve)({actions:(0,_.pipe)((0,_.map)(Yc),(0,_.filter)(Hc))}),Yc)),(0,_.filter)((0,_.ifElse)(Ac,(0,_.pipe)((0,_.path)(["actions","length"]),(0,_.gt)(_.__,0)),Hc)))),pu=(0,wc.createSelector)(cu,(0,_.pipe)((0,_.map)((0,_.when)(Ac,(0,_.prop)("actions"))),_.flatten)),du=e=>{const t=pu(e);return 0!==t.length&&t.every(Hc)},mu=e=>e[Z.Jf].bulkUpdate.requestPending,fu=(0,S.getUrisForSaving)((e=>(0,_.equals)(e.slice(-3),["operationParameters","attributeValue","entityUri"]))),yu=(0,_.curry)(((e,t,r)=>{const n=(0,_.pipe)(fu,(0,_.find)((t=>(0,_.pathSatisfies)((t=>t===e),t,r))))(r);return n?(0,_.set)((0,_.lensPath)(n),t,r):r})),gu=(e,t,r)=>(0,_.pipe)(yu(e,t),(0,_.when)((e=>e===r),(0,S.replaceTemporaryRefEntityURI)(e,t)))(r),hu=(0,_.pathEq)(["data","fieldName"],Z.E_),Eu=(0,_.pipe)((0,_.path)(["values",0,"entityUri"]),(0,_.objOf)("uri"),S.getEntityId,S.wrapInQuotes),bu=e=>[{attributes:e,operator:"or"}],vu=(0,_.curry)(((e,t,r)=>r.map((r=>{const{data:{fieldName:n}}=r,a=n.split(".");let[i,o]=((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=o.length;t===Z.Vp.AddAttribute&&l--,i.length||(i=a.slice(-1),l++);const s=`${(0,_.repeat)("parent.",Math.max(0,l)).join("")}attributes.${i.join(".")}`;return(0,_.assocPath)(["data","fieldName"],s,r)})))),Tu=(0,_.curry)(((e,t,r)=>{const n=((e,t,r)=>{const[n,a]=(0,_.partition)(hu,e),i=(0,_.pipe)(vu(t,r),bu,Ua.Jk)(a),o=n.length?(e=>`in(${Z.E_}, ${e.map(Eu).join(",")})`)(n):"";return i&&o?`${i} and ${o}`:i||o})(e,t,r.operation);return(0,_.isEmpty)(n)?r:(0,_.ifElse)((0,_.pipe)((0,_.path)(["operationParameters","valueFilter"]),S.isEmptyValue),(0,_.assocPath)(["operationParameters","valueFilter"],n),(0,_.evolve)({operationParameters:{valueFilter:(0,_.concat)(_.__,` and (${n})`)}}))(r)}));var Ou=r(9828);function Su(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){xu(e,t,r[t])}))}return e}function xu(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cu=e=>{const t=(0,_.pipe)((0,_.pick)(["pin"]),(0,_.assoc)("value",wu(e)))(e);return(0,Ou.Kn)(t.value)?Object.keys(t.value).reduce(((e,r)=>(e.value=Su({},e.value,{[r]:t.value[r].map(Cu)}),e)),t):t},wu=(0,_.when)(Ou.Kn,(0,_.ifElse)((0,_.has)("lookupCode"),(0,_.prop)("lookupCode"),(0,_.prop)("value"))),Au=(0,_.cond)([[Fc,(0,_.pipe)(Dc,Cu)],[Mc,(0,_.pipe)(Dc,(e=>{const{refEntity:t=[],refRelation:r=[]}=e;return Su({refEntity:(0,_.pipe)(_.head,(0,_.pick)(["objectURI"]))(t),refRelation:(0,_.pipe)(_.head,(0,_.pick)(["type"]))(r)},Cu(e))}))],[Vc,(0,_.pipe)(Dc,wu)],[_.T,Dc]]),Ru=(0,_.pipe)(Au,(0,_.assocPath)(["operationParameters","attributeValue"])),_u=(0,_.ifElse)(Nc,(()=>(0,_.assocPath)(["operationParameters","pin"],!0)),(()=>_.identity)),Iu=(0,_.ifElse)(Pc,(()=>(0,_.assocPath)(["operationParameters","addNestedAttribute"],!0)),(()=>_.identity)),Nu=(0,_.pipe)(kc,(0,_.ifElse)(_.isNil,(()=>_.identity),(0,_.pipe)(((e="")=>`equals(value, '${wu(e)}')`),(0,_.assocPath)(["operationParameters","valueFilter"])))),Pu=(0,_.pipe)(Dc,(0,_.prop)("entityUri"),(0,_.assocPath)(["operationParameters","referencedEntity","uri"])),Du=(e,t)=>({operationParameters:{attributeURI:e},operation:t}),ku=(e,t)=>(0,_.pipe)(Du,Ru(e),_u(e),Iu(e))(t,Z.Vp.AddAttribute),Lu=(e,t)=>(0,_.pipe)(Du,Nu(e))(t,Z.Vp.DeleteAttribute),Uu=(e,t)=>(0,_.pipe)(Du,Ru(e),_u(e),Nu(e))(t,Z.Vp.UpdateAttribute),ju=(e,t)=>(0,_.pipe)(Du,Pu(e))(t,Z.Vp.RepointReferencedEntity),Fu=(e,t)=>(0,_.reject)(_.isNil,{operationParameters:e,operation:t}),Mu=e=>Fu({tags:[Dc(e)]},Z.Vp.AddTags),Vu=e=>Fu({newValue:Dc(e),oldValue:kc(e)},Z.Vp.ReplaceTag),Bu=e=>Fu({tags:[kc(e)]},Z.Vp.DeleteTags),zu=()=>Fu(null,Z.Vp.ClearTags),Hu=(e,t=[],r={})=>{const{selectionMode:n,selectedEntities:a=[]}=e,{searchOptions:i,activityFilter:o,globalFilter:l}=r;return n===Z.v6.include?{list:a,activeness:o}:{filter:(0,_.pipe)(Ua.XP,(0,S.addGlobalFilterToQuery)(l))(t),excludeList:a,options:i,activeness:o}},Yu=(0,_.curry)(((e,t)=>(0,_.chain)((0,_.ifElse)(Ac,(0,_.pipe)(Rc,Yu(e)),Wu(e)))(t))),Wu=(0,_.curry)(((e,t)=>{const r=(0,_.pathOr)([],["operationParameters","conditions"],t),n=Ic(t);return(0,_.pipe)(qu(e),(0,_.map)(Tu(r,n)))(t)})),Gu=(0,_.curry)((e=>(0,_.propEq)("operation",e))),qu=(0,_.curry)(((e,t)=>{const r=Ic(t),n=r.includes(".")?(0,S.searchUriToAttrUri)(r,e):r,a=r===S.EntityAttrTypes.tags.uri;return(0,_.cond)([[(0,_.both)((0,_.always)(a),Gu(ra.d.AddNew)),()=>[Mu(t)]],[(0,_.both)((0,_.always)(a),Gu(ra.d.Clear)),()=>[zu()]],[(0,_.both)((0,_.always)(a),Gu(ra.d.ReplaceAllWith)),()=>[zu(),Mu(t)]],[(0,_.both)((0,_.always)(a),Gu(ra.d.FindAndReplace)),()=>[Vu(t)]],[(0,_.both)((0,_.always)(a),Gu(ra.d.FindAndRemove)),()=>[Bu(t)]],[Gu(ra.d.AddNew),()=>[ku(t,n)]],[Gu(ra.d.Clear),()=>[Lu(t,n)]],[Gu(ra.d.ReplaceAllWith),()=>[Lu(t,n),ku(t,n)]],[Gu(ra.d.FindAndReplace),()=>[Uu(t,n)]],[Gu(ra.d.FindAndRemove),()=>[Lu(t,n)]],[Gu(ra.d.RepointReference),()=>[ju(t,n)]]])(t)}));function Zu(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){$u(e,t,r[t])}))}return e}function $u(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Ku(e){if(e.payload){const e=yield(0,La.Ys)(Ri.tB);let r;do{if(r=yield(0,La.Ys)(ai.BP,{entityTypeUri:e}),r)break;yield(0,La.qn)(U.Z.UPDATE_ENTITIES)}while(!r);const n=yield(0,La.Ys)(Zc),a=yield(0,La.Ys)(ai.fx,{entityTypeUri:e}),i=yield(0,La.Ys)(ai.Uz,{entityTypeUri:e}),o=(yield(0,La.Ys)(ai.L9,{entityTypeUri:e}))||void 0,l=yield(0,La.Ys)(ai.NW,{entityTypeUri:e}),s=(yield(0,La.RE)(Ji))[n].filter((0,_.pipe)((0,_.prop)("id"),S.isAttributeSearchUri,_.not)),c=e?yield(0,La.Ys)(Ri.Gv,e):s,u=yield(0,La.Ys)(ai.NU,{entityTypeUri:e});yield(0,La.gz)((t={page:a,rowsPerPage:i,sortOrder:o,sortField:l,selectedColumns:c,total:u,entities:r},{type:An,payload:t}))}var t}function*Xu(e){const t=yield(0,La.Ys)(k().selectors.getMetadata),r=yield(0,La.Ys)(eu),n=yield(0,La.Ys)(tu),a=yield(0,La.Ys)(nu),i=yield(0,La.Ys)(ru),o=yield(0,La.RE)(lp),l=(0,_.uniq)(o.concat((0,Ua.kx)(t,e))),s=Zu({page:r,rowsPerPage:n,sortOrder:a,sortField:i,forceOvOnly:!0},yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),{select:l}),c=(0,Ua.Lv)(e,s);yield(0,La.gz)(pc(!0));try{const e=yield(0,La.RE)(S.rawRequest,Z.NV,c);yield(0,La.gz)(sc(e))}catch(e){console.warn(e),yield(0,La.gz)(sc([]))}yield(0,La.gz)(pc(!1))}function*Qu(){const e=yield(0,La.Ys)(iu),t=yield(0,La.RE)(op,e);yield(0,La.rM)(Xu,t)}function*Ju(e={}){const{debounceTime:t}=e.payload||{};t&&(yield(0,La.gw)(t));const r=yield(0,La.Ys)(iu),n=yield(0,La.RE)(op,r);yield(0,La.gz)(dc(0)),yield(0,La.rM)(ep,n)}function*ep(e){const t=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),r=(0,Ua.Vg)(e,[],t);try{const e=yield(0,La.RE)(S.rawRequest,Z.jS,{method:"POST",body:JSON.stringify(r)});yield(0,La.gz)(fc(e.total))}catch(e){console.warn(e),yield(0,La.gz)(fc(0))}}function*tp(){const e=(yield(0,La.Ys)(Qc)).map((e=>e.uri)),t=yield(0,La.RE)(lp),r=yield(0,La.Ys)(iu),n=yield(0,La.RE)(op,r),a=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),i=(0,Ua.aG)(e,n,Zu({select:t},a));yield(0,La.gz)(pc(!0));try{const e=yield(0,La.RE)(S.rawRequest,i.url,i.options);yield(0,La.gz)(sc(e))}catch(e){console.warn(e),yield(0,La.gz)(sc([]))}yield(0,La.gz)(pc(!1))}function*rp(e){try{yield(0,La.RE)(S.rawRequest,e.url,e.options),yield(0,La.gz)(wi(!1)),yield(0,La.gz)(xi({message:li().text("Bulk update is currently in progress. You'll receive an email notification once completed.\nGo to Tenant Management to view the status."),actionLabel:li().text("Tenant Management"),actionToDispatch:D.ui.actions.openConsoleApp("Tenant Management","jobs/pending"),autoHideDuration:1e4}))}catch(e){let r=e;e&&"object"==typeof e&&(r="errorCode"in e&&441===e.errorCode?li().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||li().text("Something went wrong...")),yield(0,La.gz)((t=r,Oi({payload:{message:t,action:{actionToDispatch:Ti()}},type:Z.GT.error})))}var t}function*np(){const e=yield(0,La.Ys)(Wc);e===Z.dV.UpdateProfiles?yield(0,La.RE)(ap):e===Z.dV.DeleteProfiles&&(yield(0,La.RE)(ip))}function*ap(){yield(0,La.gz)(Cc(!0));const e=yield(0,La.Ys)(Zc),t=yield(0,La.Ys)($c);let r=yield(0,La.Ys)(uu);const n=yield(0,La.RE)(op),a=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),i=yield(0,La.Ys)(k().selectors.getModifiedEntities),o=((e,t)=>{const r=(0,S.findAllTemporaryRefEntityURI)(t),n=(a=t,(0,_.pipe)(fu,(0,S.getPathsWithTempUri)(a),(0,_.map)((e=>(0,_.path)(e,a))))(a));var a;return r.concat(n).filter((t=>e[t]))})(i,r);if(o.length>0){const e=yield(0,La.RE)(S.saveTemporaryEntities,i,o);for(const[t,n]of Object.entries(e))r=gu(t,n,r)}const l=function(e,t,r,n,a){const i=((e,t={},r=[],n=[],a={})=>({objects:Hu(t,n,a),actions:Yu(e,r)}))(e,t,r,n,a);return{url:"/entities/_update?sendMail=true",options:{method:"POST",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}}}}(e,t,r,n,a);yield(0,La.RE)(rp,l),yield(0,La.gz)(Cc(!1))}function*ip(){yield(0,La.gz)(Cc(!0));const e=function(e,t,r){const n={objects:Hu(e,t,r)};return{url:"/entities/_delete?sendMail=true",options:{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}}}}(yield(0,La.Ys)($c),yield(0,La.RE)(op),yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions));yield(0,La.RE)(rp,e),yield(0,La.gz)(Cc(!1))}function*op(e){const t=yield(0,La.Ys)(ai.FR),r={fieldName:"type",filter:"equals",values:[yield(0,La.Ys)(Zc)]};let n=t.filter((e=>"type"!==e.fieldName)).concat(r);return e&&(n=n.concat({fieldName:"attributes",filter:"containsWordStartingWith",values:[e]})),n}function*lp(){const e=yield(0,La.Ys)(au);return(0,Ai.vw)(e)}function*sp(e){const{groupId:t,attributeId:r,selectInfo:n}=e.payload,a=yield(0,La.Ys)(cu),i={addAttributeAfter:Ec,changeAttribute:bc,clearAttribute:vc,deleteAttribute:Oc};yield(0,La.RE)(el,{groups:a,attributesPropName:"conditions",groupId:t,attributeId:r,selectInfo:n,actions:i})}const cp=[function*(){yield(0,La.Fm)(ge,Ku)},function*(){yield(0,La.Fm)([Dn,Pn,kn],Qu)},function*(){yield(0,La.Fm)(jn,Ju)},function*(){yield(0,La.Fm)(Mn,tp)},function*(){yield(0,La.ib)(Zn,sp)},function*(){yield(0,La.ib)(ea,np)}],up=()=>({id:Z.Jf,reducerMap:{[Z.Jf]:(0,R.combineReducers)({ui:We,search:pe,facets:q,advancedSearch:er,savedSearches:ln,recentSearches:gn,entity:Cn,bulkUpdate:ka})},sagas:[...Dl,...ns,...co,...cl,...Uo,...$s,...fs,hs,...ic,...lc,...cp]});var pp=r(95099),dp=r.n(pp),mp=r(34756),fp=r(23625),yp=r.n(fp),gp=r(53732),hp=r.n(gp),Ep=r(88214),bp=r.n(Ep),vp=r(14294),Tp=r.n(vp),Op=r(4501),Sp=r.n(Op),xp=r(87925),Cp=r(18538),wp=r(42950);const Ap=(0,wp.Z)((()=>({container:({height:e=36})=>({height:e,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 Rp(){return Rp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Rp.apply(null,arguments)}function _p(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Ip(e,t,r[t])}))}return e}function Ip(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Np=(0,b.memo)((e=>{let{value:t,autofocus:r,onSearch:n=_.identity,rootRef:a,classes:i={},height:o,placeholder:l=li().text("Search")}=e,s=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["value","autofocus","onSearch","rootRef","classes","height","placeholder"]);const c=Ap({height:o}),[u,p]=(0,b.useState)(""),d=(0,_.pipe)((0,_.tap)(n),p),m=(0,_.isNil)(t)?u:t;return v().createElement(hp(),Rp({startAdornment:v().createElement(bp(),{position:"start"},v().createElement(Sp(),{className:c.icon})),endAdornment:v().createElement(bp(),{position:"end"},m.length>0&&v().createElement(Cp.T,{icon:Tp(),className:c.clearButton,onClick:()=>d("")})),autoFocus:r,classes:_p({},i,{input:O()(c.input,i.input),root:O()(c.container,i.root)}),placeholder:l,value:m,onChange:(0,_.pipe)(xp.NA,d),disableUnderline:!0,ref:a},s))})),Pp=(0,wp.Z)((()=>({container:({containerHeight:e=553,containerWidth:t})=>({display:"flex",flexDirection:"column",height:e,width:t,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}}})));function Dp(){return Dp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Dp.apply(null,arguments)}const kp=e=>{let{title:t,className:r,onSearch:n,hideTitle:a,hideSearchInput:i,headerPlacement:o="top",containerWidth:l,containerHeight:s,searchInputOnKeyDown:c,children:u,searchInputRef:p,anchorOrigin:d={vertical:"top",horizontal:"right"},transformOrigin:m={vertical:"top",horizontal:"right"}}=e,f=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.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 y=Pp({containerWidth:l,containerHeight:s}),g=v().createElement(v().Fragment,null,!a&&v().createElement("div",{className:y.header},t),!i&&v().createElement(Np,{onSearch:n,autofocus:!0,onKeyDown:c,inputRef:p,classes:{root:y.searchInputContainer},placeholder:li().text("Search & add attributes"),height:40}));return v().createElement(yp(),Dp({anchorOrigin:d,transformOrigin:m},f),v().createElement("div",{className:O()(y.container,r),style:{width:l}},"top"===o&&g,v().createElement("div",{className:y.list},u),"bottom"===o&&g))},Lp=e=>{const t=e=>(0,_.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})))},Up=e=>e.titleItemIndex===e.index;var jp=r(50166),Fp=r(88267);const Mp=(0,wp.Z)({stickyTitlesWrapper:{position:"absolute",top:0,"& > div":{zIndex:1,position:"absolute",top:0,width:"100%",visibility:"hidden"}}}),Vp=({items:e,getItemSize:t,renderItem:r,renderGroupTitle:n,width:a="100%",height:i,fixedTitle:o=!0,itemKey:l=(e=>e),disableHorizontalScrollbar:s,hideSubtitles:c,focusIndex:u=null,onInnerContainerResize:p})=>{const d=Mp(),m=(0,b.useRef)(null),f=(0,b.useRef)(null),y=(0,b.useRef)(null),g=(0,b.useRef)([0]),h={topMargin:0},E=(0,b.useMemo)((()=>!c||(e||[]).some((e=>null!==e.titleItemIndex))),[e,c]),T=(0,b.useCallback)((r=>{const n=g.current.length;let a=0;e.slice(n-1,r+1).forEach(((e,r)=>{const i=n+r-1;r>0&&(g.current[i]=g.current[i-1]+a),a=t(i,e.item)}))}),[t,e]),O=(0,b.useCallback)((t=>e[t].titleItemIndex),[e]),S=(0,b.useCallback)((t=>e[t]),[e]);(0,b.useEffect)((()=>{requestAnimationFrame((()=>{m.current&&m.current.scrollTo(0)}))}),[e.length]),(0,b.useEffect)((()=>{m.current&&m.current.resetAfterIndex(0),x();const r=(e=>{const r=e.findIndex((e=>e.item.moveTo));if(r>-1){T(r);const e=O(r);return{offset:g.current[r],titleHeight:t(e,S(e).item)}}})(e);if(r&&r.offset&&m.current){const{titleHeight:e}=r,t=r.offset-e;(t<m.current.state.scrollOffset||t>m.current.state.scrollOffset+i)&&requestAnimationFrame((()=>{m.current&&m.current.scrollTo(t-(i-e)/2)}))}}),[T,S,t,O,i,g,e,m]);const x=()=>{y.current&&f.current&&(y.current.style.width=f.current.offsetWidth+"px")},C=(0,b.useCallback)((t=>{let r=null,n=0;return e.some(((e,a)=>{T(a+10);const i=g.current[a+1];return t>=n&&t<i&&(r={index:a,offset:n,listItem:e}),n=i,r})),r}),[T,g,e]),w=(0,b.useCallback)((e=>t(e,S(e).item)),[S,t]),A=(0,b.useCallback)((({index:e,style:t,data:a})=>{const i=S(e);return i.item&&(Up(i)&&n(t,i.item)||r(t,i.item,e,a))}),[S,n,r]),{handleOnItemsRendered:R}=(({focusIndex:e,listRef:t,items:r})=>{const n=(0,b.useRef)(null),a=(0,b.useRef)(null),i=(0,b.useCallback)((({visibleStartIndex:e,visibleStopIndex:t})=>{n.current=e,a.current=t}),[]);return(0,b.useEffect)((()=>{t.current&&null!==e&&0!==r.length&&(e<Math.max(n.current+3,0)?t.current.scrollToItem(Math.max(e-3,0),"start"):e>Math.min(a.current-3,r.length-1)&&t.current.scrollToItem(Math.min(e+3,r.length-1),"end"))}),[e,r.length,t]),{handleOnItemsRendered:i}})({items:e,focusIndex:u,listRef:m}),_=(0,b.useCallback)((()=>e.filter((e=>Up(e))).map((e=>(e=>v().createElement("div",{className:"stickyTitleItem",style:{visibility:"hidden"},"data-index":e.index,key:e.index},n({height:t(e.index,e.item)},e.item)))(e)))),[t,e,n]);return v().createElement(v().Fragment,null,v().createElement("div",{ref:y,className:d.stickyTitlesWrapper},o&&_()),p&&f.current&&v().createElement(Fp.Z,{handleHeight:!0,onResize:p,targetDomEl:f.current}),v().createElement(jp.VariableSizeList,{ref:m,itemCount:e.length,itemSize:w,width:a,height:i,itemKey:l,innerRef:f,onScroll:({scrollOffset:r,scrollDirection:n})=>{if(!o||!E)return;const a=C(r),i=a&&O(a.index);var l;null!==i&&(l=i,y.current&&[...y.current.querySelectorAll(".stickyTitleItem")].forEach((e=>{e.dataset.index===l.toString()?(e.style.visibility="visible",h.index=l):e.style.visibility="hidden"}))),x();const s=null!==i&&t(i,S(i).item),c=C(r+s+h.topMargin);let u=0;if(c){switch(n){case"forward":c.offset-r>0&&Up(c.listItem)&&(u=s-(c.offset-r));break;case"backward":{const t=i>-1&&(p=i,e.findIndex(((e,t)=>Up(e)&&p<t))),n=(e=>(T(e),g.current[e]))(t);t>-1&&r<n&&s>=n-r&&(u=s-(n-r))}}(e=>{y.current&&(h.topMargin=-e,y.current.style.top=-e+"px")})(u)}var p},style:s?{overflowX:"hidden"}:void 0,overscanCount:5,onItemsRendered:R},A))};Vp.propTypes={items:dp().arrayOf(dp().object).isRequired,getItemSize:dp().func.isRequired,renderItem:dp().func.isRequired,width:dp().oneOfType([dp().number,dp().string]),height:dp().number.isRequired,renderGroupTitle:dp().func,fixedTitle:dp().bool,hideSubtitles:dp().bool,itemKey:dp().func,disableHorizontalScrollbar:dp().bool,focusIndex:dp().number,onInnerContainerResize:dp().func};const Bp=({items:e,open:t,onSelectFocusedItem:r,selectedItems:n,onClose:a})=>{const[i,o]=(0,b.useState)(null),l=(0,b.useRef)(!1),s=(0,b.useCallback)((t=>{let r=null===t?s(-1):t;for(;null!==t&&r<e.length&&(r<=t||r>=0&&Up(e[r]));)r+=1;return r!==e.length?r:s(-1)}),[e]),c=(0,b.useCallback)((t=>{let r=null===t?e.length-1:t;for(;null!==t&&r>=0&&(r>=t||Up(e[r]));)r-=1;return r<0?e.length-1:r}),[e]),u=(0,b.useCallback)((()=>{if(!(0,_.isNil)(i)){const t=e[i].item;!t.item.notSelectable&&r({item:t.item,groupData:t})}}),[r,e,i]),p=(0,b.useCallback)((t=>{if(0!==e.length)switch(t.key){case"Down":case"ArrowDown":return o(s),t.preventDefault(),!1;case"Up":case"ArrowUp":return o(c),t.preventDefault(),!1;case"Enter":l.current=!0,u();break;case"Tab":a&&a(t);break;default:return}}),[e,s,c,u,a]);return(0,b.useEffect)((()=>{if(l.current){l.current=!1;const t=e.findIndex((e=>e.item.moveTo));t>-1&&o(t)}else o(null)}),[e,t,n]),{focusIndex:i,handleKeyDown:p}};var zp=r(85746),Hp=r.n(zp),Yp=r(22811),Wp=r.n(Yp),Gp=r(93222),qp=r.n(Gp);function Zp(){return Zp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zp.apply(null,arguments)}function $p(){return $p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$p.apply(null,arguments)}const Kp=e=>v().createElement("svg",$p({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgNestedAttribute"},e),v().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 Xp(){return Xp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xp.apply(null,arguments)}const Qp=e=>v().createElement("svg",Xp({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgReferenceAttribute"},e),v().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 Jp(){return Jp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jp.apply(null,arguments)}const ed=e=>v().createElement("svg",Jp({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgSimpleAttribute"},e),v().createElement("rect",{fill:"#000",x:9,y:9,width:6,height:6,rx:1,stroke:"none",strokeWidth:1,fillRule:"evenodd"})),td=(0,wp.Z)({icon:{opacity:.29,width:"16px",height:"16px",flexShrink:0,marginRight:"6px",marginLeft:"8px"}}),rd=({attrType:e={}})=>{const t=td(),r=(e=>{switch(e.type){case S.DataTypes.TYPE_IMAGE:case S.DataTypes.TYPE_NESTED:return Kp;case S.DataTypes.TYPE_REFERENCE:return Qp;default:return ed}})(e);return v().createElement(r,{className:t.icon})},nd=(0,wp.Z)({mark:{color:"red"}}),ad=()=>{const e=nd();return v().createElement("span",{className:e.mark},"*")},id=({margin:e,level:t,className:r,children:n})=>null!=t?v().createElement("div",{style:{marginLeft:t*e},className:r},n):n;var od=r(1063),ld=r(85740);const sd=(0,wp.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"}}),cd=(0,ld.T)((e=>v().createElement("svg",Zp({width:13,height:18,viewBox:"0 0 13 18",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgRecommended"},e),v().createElement("g",{transform:"translate(-3 -1)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("path",{fill:"#FF4081",d:"M5.833 10h3.75v6.667l-3.75 1.666z"}),v().createElement("path",{fill:"#CE0C4E",d:"M13.333 10v8.333l-3.75-1.666V10z"}),v().createElement("circle",{fill:"#FFC058",cx:9.583,cy:7.917,r:6.25}),v().createElement("circle",{fill:"#FFCD7B",cx:9.583,cy:7.917,r:5.417}),v().createElement("path",{fill:"#FFFBB5",d:"M8.333 11.667L5 8.462l.933-.898 2.4 2.308L13.4 5l.933.897z"}))))),ud=({groupId:e,data:t,checked:r=!1,isFocused:n=!1,isRequired:a=!1,label:i,labelInText:o,level:l,onClick:s=_.identity,hideCheckBox:c=!1,hideIcon:u=!1,notSelectable:p=!1,disableHorizontalScrollbar:d=!1,style:m={},subItemMargin:f=20,LogoIcon:y,className:g,disableNonSelectable:h,disableGutters:E})=>{const b=sd(),{attrType:T}=t||{},x=!(c&&(0,S.isNested)(T)||p),C=!!y;return v().createElement(od.Y,{value:o||i,className:b.itemTooltip,placement:"bottom-end"},v().createElement(qp(),{className:O()(b.container,b.listItem,{[b.defaultCursor]:!x},g),onClick:x?()=>s(t,!r,e):void 0,style:m,dense:!0,disabled:h&&p,classes:{focusVisible:b.listItemFocus,selected:b.listItemFocus},selected:n,tabIndex:-1,disableGutters:E},!c&&v().createElement(Wp(),{checked:r,disableRipple:!0,disabled:!x,className:O()(b.checkbox,{[b.checked]:r}),tabIndex:-1}),v().createElement(id,{margin:f,level:l,className:b.marginWrapper},v().createElement(v().Fragment,null,!u&&(t=>"recommended"===e?v().createElement(cd,{className:b.recommendedIcon,tooltipTitle:li().text("Recommended"),showForDisabled:!0}):v().createElement(rd,{attrType:t}))(T),v().createElement("div",{className:O()(b.itemTextWrapper,{[b.marginText]:u})},C&&v().createElement(y,{className:b.logoIcon}),v().createElement(Hp(),{primary:v().createElement(v().Fragment,null,i,a&&v().createElement(ad,null)),className:b.itemText})))),x&&d&&v().createElement("div",{className:b.itemAfter})))};ud.defaultName="AttributeListItem";const pd=(0,b.memo)(ud);var dd=r(49940);const md=(0,wp.Z)({popupContainer:{},container:{"&$popupContainer":{height:"408px",minWidth:"200px"}}});function fd(){return fd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fd.apply(null,arguments)}function yd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){gd(e,t,r[t])}))}return e}function gd(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hd=e=>{let{open:t,anchorEl:r,data:n,onSearch:a,onClose:i,titleText:o,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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.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,b.useCallback)((e=>e.label.toLowerCase().includes(l.toLowerCase())),[l]),f=(0,b.useCallback)((e=>m(e)||(e.children||[]).some(f)),[m]),y=(0,b.useMemo)((()=>{const e=(0,_.curry)(((e,r,n,a)=>[{item:yd({},r,{filterText:l}),level:e,groupId:n,groupName:a},...t(r.children||[],n,a,e+1)])),t=(t,r,n,a=0)=>{const i=t.filter(f);return(p?_.map:_.chain)((t=>e(a,t,r,n)),i)};return t}),[l,p,f]),g=(0,b.useCallback)((e=>e.map((e=>({item:e,items:y(e.attributes,e.id,e.label)}))).filter((e=>e.items.length))),[y]),h=(0,b.useCallback)((({item:e})=>{s(e,!c.find((t=>t.id===e.id||t.id.includes(`${e.id}.`))))}),[s,c]),E=(0,b.useMemo)((()=>(p?g:y)(n)),[n,p,g,y]),T=(0,b.useMemo)((()=>Lp(E)),[E]),{focusIndex:x,handleKeyDown:C}=Bp({items:T,open:t,onSelectFocusedItem:h,selectedItems:c}),w=(0,b.useRef)(null);w.current=x;const A=(0,b.useCallback)(((e,{item:t,level:r=0},n)=>{const a=!!c.find((e=>e.id===t.id||e.id.includes(`${t.id}.`))),i=w.current===n;return v().createElement(pd,{key:t.id,onClick:s,checked:a,level:r,data:t,label:v().createElement(dd.o,{text:t.label,highlight:t.filterText}),labelInText:t.label,style:e,hideCheckBox:u,isFocused:i,notSelectable:t.notSelectable,LogoIcon:t.LogoIcon})}),[u,s,c]),R=(0,S.getMaxItemWidth)("label")(E)||308,I=md();return v().createElement(kp,fd({open:t,className:O()(I.container,I.popupContainer),anchorEl:r,onClose:i,onSearch:a,title:o,containerWidth:R,searchInputOnKeyDown:C},d),v().createElement(Vp,{height:300,renderItem:A,items:T,hideSubtitles:!0,getItemSize:()=>32,containerWidth:R,focusIndex:x,renderGroupTitle:p}))};hd.propTypes={open:dp().bool,hideCheckBox:dp().bool,anchorEl:dp().any,selected:dp().array,data:dp().array,filterText:dp().string,titleText:dp().string,onClose:dp().func,onListItemClick:dp().func,onSearch:dp().func,renderGroupTitle:dp().func},hd.defaultProps={data:[],selected:[],titleText:li().text("Show/hide columns"),filterText:""};var Ed=r(97179);function bd(){return bd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bd.apply(null,arguments)}const vd=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",bd({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},r),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",opacity:".54"},v().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"})))},Td="Headers-styles-container--Zbdka",Od="Headers-styles-actionsBar--RXMy4",Sd="Headers-styles-previewSwitcher--Ppqem";function xd(){return xd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xd.apply(null,arguments)}const Cd=e=>{let{entityTypeUri:t,headColumns:r=[],onSelectColumns:n=_.identity}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entityTypeUri","headColumns","onSelectColumns"]);const[i,o]=(0,b.useState)(null),[l,s]=(0,b.useState)(""),c=(0,mp.useSelector)(k().selectors.getMetadata),u=()=>{o(null),s("")},p=(0,b.useCallback)(((e,a)=>{const i=(0,Ai.kF)(c,t),o=(0,Ai.m5)(i,e.id);let l;l=o.length?a?r.concat(o):r.filter((e=>!o.find((t=>t.id===e.id)))):a?r.concat(e):r.filter((t=>t.id!==e.id)),n(l)}),[c,t,r,n]);return v().createElement(v().Fragment,null,v().createElement(Ed.k,xd({tooltipTitle:li().text("Show/hide columns"),size:"M",icon:vd,onClick:e=>o(e.currentTarget),className:"Headers-styles-headerIcon--c2qe7"},a)),(()=>{const e=(0,Ai.kF)(c,t);return v().createElement(hd,{open:!!i,anchorEl:i,data:e,onListItemClick:p,selected:r,filterText:l,onClose:u,onSearch:s})})())};Cd.propTypes={entityTypeUri:dp().string,headColumns:dp().array,onSelectColumns:dp().func};const wd=Cd;var Ad=r(45053),Rd=r(72897),_d=r(27618),Id=r.n(_d),Nd=r(98515),Pd=r.n(Nd),Dd=r(29289);const kd=({headCellData:e,headIndex:t,sortOrder:r,sortField:n,sortHandler:a,canCheck:i,onCheck:o,headerCheckboxState:l,openConfigColumnPopup:s})=>v().createElement("div",{className:O()("HeadCellRenderer-styles-headCellContentWrapper--L6RrQ",(0,_.path)(["wrapperClassName"],e))},e&&i&&v().createElement(Wp(),{className:"HeadCellRenderer-styles-checkbox--qQEHg",checked:l||!1,indeterminate:null===l,onChange:()=>o()}),v().createElement("div",{className:"HeadCellRenderer-styles-labelWrapper--cmclk"},e&&(e.sortable?v().createElement(Id(),{active:Boolean(r&&n===e.id),direction:r,onClick:a,classes:{root:"HeadCellRenderer-styles-sortLabel--NZx3o"},component:"div"},e.label):e.label)),s&&v().createElement("div",{className:"HeadCellRenderer-styles-menuButtonWrapper--aBNeR"},v().createElement(Cp.T,{icon:Pd(),onClick:s,size:"S","data-column-index":t})));kd.propTypes={headCellData:dp().shape({id:dp().string,label:dp().oneOfType([dp().string,dp().node]),sortable:dp().bool}),headIndex:dp().number,sortOrder:dp().string,sortField:dp().string,sortHandler:dp().func,canCheck:dp().bool,onCheck:dp().func,headerCheckboxState:dp().oneOf([!0,!1,null]),openConfigColumnPopup:dp().func};const Ld=(0,Dd.q)((0,_.pick)(["openConfigColumnPopup"]))(kd),Ud=(0,Dd.q)((0,_.pick)(["openConfigColumnPopup","canCheck","onCheck","headerCheckboxState"]))(kd),jd=v().createContext({generateEntityUrl:S.generateEntityUrlForOldMode,generatePivotingUrl:S.generatePivotingUrlForOldMode,generateTagUrl:S.generateTagUrlForOldMode});function Fd(){return Fd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fd.apply(null,arguments)}jd.displayName="UrlGeneratorsContext";const Md=(0,b.forwardRef)(((e,t)=>{let{value:r,children:n,screen:a,className:i,shouldOpenInNewTab:o=!1}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["value","children","screen","className","shouldOpenInNewTab"]);const{generateEntityUrl:s}=(0,b.useContext)(jd),c=(0,w.ax)("openEntity"),u=(0,w.Qh)(),p=(0,b.useCallback)((e=>{(0,xp.rR)(e)||(c({uri:r,screen:a}),e.preventDefault()),e.stopPropagation()}),[c,a,r]);return v().createElement("a",Fd({ref:t,href:(d=r,s({uiPath:u,uri:d,screen:a})),onClick:o?void 0:p,target:o?"_blank":"_self",rel:"noreferrer",className:i},l),n);var d}));Md.displayName="EntityUriLink";const Vd={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"},Bd=({value:e={}})=>{const t=(0,S.getLabel)(e.label);return v().createElement("div",{className:O()(Vd.defaultWrapper,Vd.profileWrapper)},v().createElement(A,{avatarClassName:Vd.entityAvatar,imageClassName:Vd.entityAvatarImage,entity:e}),v().createElement(Md,{value:(0,S.getEntityUriForLink)(e),className:Vd.entityLabel},t))};Bd.propTypes={value:dp().object};const zd=Bd;var Hd=r(56755);const Yd=({value:e,columnData:{dataTypeDefinition:t}})=>v().createElement("div",{className:Vd.defaultWrapper},t?v().createElement(Hd.x,{value:e,dataTypeDefinition:t}):e);Yd.propTypes={value:dp().any,columnData:dp().object};const Wd=Yd,Gd=(e,t,r)=>{const n=(0,S.getEntityTypeGraphIcon)(e,{type:t});return(0,S.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 Zd(){return Zd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zd.apply(null,arguments)}const $d=e=>{let{className:t,icon:r,avatarText:n,rootClasses:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","icon","avatarText","rootClasses"]);const[o,l]=(0,b.useState)(null);(0,b.useEffect)((()=>{l(r?qd.ICON_MODE:qd.TEXT_MODE)}),[r,n]);const s=()=>{l(qd.ERROR_MODE)};switch(o){case qd.ICON_MODE:return v().createElement(C(),Zd({className:O()(t,null==a?void 0:a.iconRoot),src:r,onError:s},i));case qd.TEXT_MODE:case qd.ERROR_MODE:return v().createElement(C(),Zd({className:O()(t,null==a?void 0:a.textRoot)},i),n);default:return null}},Kd=({value:e})=>{const t=(0,mp.useSelector)(k().selectors.getMetadata),r=(0,mp.useSelector)(k().selectors.getApiPath),n=(0,mp.useSelector)(k().selectors.getImagePath);return e&&v().createElement("div",{className:O()(Vd.defaultWrapper,Vd.referenceWrapper)},v().createElement($d,{className:Vd.referenceIcon,icon:Gd(t,e.refEntity.type,n||r)}),v().createElement(Md,{value:e.refEntity.objectURI,className:Vd.referenceContent},(0,S.getLabel)(e.label)))};Kd.propTypes={value:dp().object};const Xd=Kd,Qd=e=>{e.stopPropagation()},Jd=e=>{const{value:t}=e;return v().createElement("div",{className:Vd.blobWrapper,onScroll:Qd},t)};Jd.propTypes={value:dp().any};const em=Jd,tm=({value:e})=>{const t=(0,S.getImageAttributeOvThumbnailUrl)({value:e});return t&&v().createElement("div",{className:Vd.imageWrapper},v().createElement("img",{src:t}))};tm.propTypes={value:dp().object};const rm=tm,nm=e=>{if("label"===e.id)return zd;switch((0,_.path)(["attrType","type"],e)){case"Reference":return Xd;case"Blob":return em;case"Image":return rm}return Wd};function am(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){im(e,t,r[t])}))}return e}function im(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const om=(0,_.split)("."),lm=["entityId"],sm=e=>!lm.includes(e.id),cm=e=>{if((0,S.isAttributeSearchUri)(e)){const[,...t]=om(e);return t.length>1?t.slice(0,-1):null}return null};var um=r(39034),pm=r(57526),dm=r.n(pm),mm=r(18567),fm=r.n(mm),ym=r(99272),gm=r.n(ym);const hm=(0,wp.Z)({root:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px"},check:{color:"#8CC152"}}),Em=({classes:e={},tooltip:t="",onClick:r=_.identity,mode:n=um.Eh.Init})=>{const a=hm();return v().createElement("div",{className:O()(a.root,e.root)},(()=>{switch(n){case um.Eh.Init:return v().createElement(Ed.k,{className:e.button,size:"M",tooltipTitle:t,icon:fm(),onClick:r});case um.Eh.Progress:return v().createElement(dm(),{className:e.spinner,size:24});case um.Eh.Success:return v().createElement(gm(),{className:O()(a.check,e.check)});default:return null}})())};function bm(){return bm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bm.apply(null,arguments)}const vm=e=>{let{entity:t,importStatus:r,onImportStatusChange:n,hideDelay:a=3e3}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entity","importStatus","onImportStatusChange","hideDelay"]);const o=(0,mp.useSelector)(k().selectors.getDtssPath),l=(0,mp.useSelector)(k().selectors.getTenant);return v().createElement(Em,bm({},i,{mode:r,tooltip:li().text("Import this record"),onClick:e=>{e.stopPropagation(),n(um.Eh.Progress),(0,S.importEntityFromDataTenant)({dtssPath:o,customerTenant:l,entity:t}).then((({success:e,uris:r})=>{if(!e)throw new Error("Failed to import entity");t.ctSubscribedUris=r,n(um.Eh.Success),setTimeout((()=>n(um.Eh.Done)),a)})).catch((()=>{n(um.Eh.Init),(0,ii.U)(undefined,{title:li().text("Import Error"),message:li().text("Record can't be imported")})}))}}))},Tm=(0,wp.Z)({importButtonPlaceholder:{display:"flex",alignItems:"center",padding:"0 10px",width:"24px",flexShrink:0,position:"relative"}}),Om=({entity:e,entityImportStatus:t,onEntityImportStatusChange:r})=>{const n=Tm(),a=(0,mp.useSelector)(k().selectors.getMetadata),i=(0,mp.useSelector)(k().selectors.getCanUserImportEntitiesFromDT),o=(0,S.isDataTenantEntity)(e)&&i,l=(0,S.getEntityType)(a,e.type),s=(0,S.checkCanImportEntityOfType)(l)&&!(0,S.isEntityImportedToCT)(e),c=t&&t!==um.Eh.Done||s;return v().createElement(v().Fragment,null,o&&v().createElement("div",{className:n.importButtonPlaceholder},c&&v().createElement(vm,{entity:e,importStatus:t,onImportStatusChange:t=>r(e.uri,t)})))},Sm=({entity:e,isSelectedEntity:t,isHighlightedEntity:r,entityImportStatus:n,onEntityImportStatusChange:a})=>v().createElement("div",{className:O()(Vd.entityButtons,{[Vd.selectedEntityButtons]:t,[Vd.justImportedEntityButtons]:n===um.Eh.Success,[Vd.highlightedEntityButtons]:r})},v().createElement(Om,{entity:e,entityImportStatus:n,onEntityImportStatusChange:a}));Sm.propTypes={entity:dp().object,isSelectedEntity:dp().bool,isHighlightedEntity:dp().bool,entityImportStatus:dp().oneOf(Object.values(um.Eh)),onEntityImportStatusChange:dp().func};const xm=(0,Dd.q)((({entitiesImportStatus:e,onEntityImportStatusChange:t,selectedEntityUri:r,highlightedEntityIndex:n},{entity:a,rowIndex:i})=>({entityImportStatus:a&&e[a.uri],onEntityImportStatusChange:t,isSelectedEntity:r===a.uri,isHighlightedEntity:n===i})))(Sm);var Cm=r(72326),wm=r(67655);function Am(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Rm(e,t,r[t])}))}return e}function Rm(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _m={height:"100%",display:"flex",flexDirection:"column"},Im=(0,wp.Z)((e=>({inactiveCell:Am({background:e.inactiveBackground},_m,{"&$selectedRowCell":{background:e.inactiveSelectedBackground}}),selectedRowCell:Am({background:(0,wm.lighten)(e.palette.primary.main,.88)},_m),clickable:Am({cursor:"pointer"},_m),justImported:Am({backgroundColor:"#FFFBEB !important"},_m)}))),Nm={entity:dp().object,isSelected:dp().bool,onEntityClick:dp().func,isJustImported:dp().bool},Pm=(0,wp.Z)({checkboxWrapper:{display:"flex",alignItems:"center"},checkbox:{marginRight:"-8px",marginLeft:"11px"}}),Dm={onCheck:dp().func,isChecked:dp().bool,hasCheckbox:dp().bool},km=(0,wp.Z)({collapser:{marginLeft:"-2px"}});var Lm=r(18021),Um=r(8835),jm=r.n(Um);const Fm=(0,wp.Z)({collapseButton:{cursor:"pointer"},expandLess:{transform:"rotate( -180deg )"}});function Mm(){return Mm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Mm.apply(null,arguments)}const Vm=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isOpen","tooltipTitle"]);const a=Fm(),i={icon:jm(),className:a.collapseButton,iconClassName:O()({[a.expandLess]:t})},o={tooltipTitle:r};return v().createElement(Ed.k,Mm({"data-reltio-id":"collapse-button"},i,o,n))},Bm=(0,wp.Z)((()=>({hidden:{visibility:"hidden"}}))),zm=({rowIndex:e,rowValue:t,className:r})=>{const n=Bm(),{toggleRowCollapse:a,getIsRowCollapsible:i,getIsRowCollapsed:o}=(0,b.useContext)(Lm.x),l=i(t),s=o(e);return v().createElement(Vm,{className:O()(r,{[n.hidden]:!l}),isOpen:!s,onClick:t=>{a(e),t.stopPropagation()}})},Hm={hasCollapseButton:dp().bool},Ym=(0,_.pipe)((e=>{const t=t=>{const r=km(),{hasCollapseButton:n}=t,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["hasCollapseButton"]),{rowValue:i,rowIndex:o}=a;return n?v().createElement("div",{className:"cellWithCollapser"},v().createElement(zm,{className:r.collapser,rowIndex:o,rowValue:i}),v().createElement(e,a)):v().createElement(e,a)};return t.propTypes=Hm,t}),(e=>{const t=t=>{const r=Pm(),{onCheck:n,isChecked:a,hasCheckbox:i}=t,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["onCheck","isChecked","hasCheckbox"]),{rowValue:{rawValue:l}}=o;return i?v().createElement("div",{className:O()(r.checkboxWrapper,"cellWithCheckbox")},v().createElement(Wp(),{className:r.checkbox,checked:a,onClick:e=>e.stopPropagation(),onChange:e=>n(l.uri,e.target.checked)}),v().createElement(e,o)):v().createElement(e,o)};return t.propTypes=Dm,t}),(e=>{const t=t=>{const r=Im(),{rowValue:{rawValue:n},isSelected:a,onEntityClick:i,isJustImported:o}=t,l=i?()=>i(n.uri):void 0,s=n&&!(0,S.isActiveObject)(n);return l||s||a||o?v().createElement("div",{className:O()({[r.inactiveCell]:s},{inactiveCell:s},{[r.selectedRowCell]:a},{selectedRowCell:a},{[r.clickable]:!!l},{[r.justImported]:o},{justImported:o}),onClick:l},v().createElement(e,t)):v().createElement(e,t)};return t.propTypes=Nm,t}),(0,Dd.q)((({onEntityClick:e,selectedEntityUri:t,entitiesImportStatus:r,canCheck:n,onCheck:a,checkedEntitiesUris:i},{rowValue:o,columnIndex:l})=>{const{rawValue:s}=o,c=0===l;return{onCheck:a,isChecked:i&&i.includes(s.uri),hasCheckbox:n&&c,hasCollapseButton:c,isSelected:t===s.uri,isJustImported:r[s.uri]===um.Eh.Success,onEntityClick:e}})))(Cm.DN),Wm=({columnData:e,cell:t})=>{const r=t.values.length,n=28*Math.max(r,1)+20;if(!r)return n;switch((0,_.path)(["dataTypeDefinition","type"],e)){case"Reference":return 28*r+17;case"Blob":return 100*r;case"Image":return 76*r+17;default:return n}},Gm=(0,b.forwardRef)((({headColumns:e,entities:t,entityToHighlight:r,selectedEntityUri:n,onReorderingColumn:a,dndColumnReorderingEnabled:i,columnsSize:o,onChangeColumnsSize:l,onScroll:s,onSort:c,sortField:u,sortOrder:p,onEntityHover:d,onEntityClick:m,entitiesImportStatus:f,onEntityImportStatusChange:y,logger:g,canCheck:h,checkedEntitiesUris:E,headerCheckboxState:T,onCheck:O,openConfigColumnPopup:x,resizeDebounceDelay:C},w)=>{const A=(0,b.useMemo)((()=>({highlightRow:"highlightedSelector",dragColumnHead:Vd.dragColumnHead,dragColumnBody:Vd.dragColumnBody,draggableHeadCell:Vd.draggableHeadCell,cellWrapper:Vd.cellWrapper})),[]),R=(0,mp.useSelector)(k().selectors.getMetadata),[I,N]=(0,b.useState)(null),P=(0,b.useCallback)((e=>{N(e),d&&d((0,_.path)([e,"uri"],t))}),[d,t]),D=(0,b.useRef)();(0,b.useImperativeHandle)(w,(()=>({resetScrollbarPosition:()=>{D.current&&D.current.resetScrollbarPosition({resetLeft:!1})}})));const L=(0,b.useCallback)((e=>{p&&e===u?p===Ad.oy?c({field:e,order:Ad.U9}):c({field:e}):c({field:e,order:Ad.oy})}),[c,u,p]),U=(0,b.useCallback)((e=>{const r=(0,_.prop)(e,t);return r?v().createElement(xm,{entity:r,rowIndex:e}):null}),[t]),j=(0,b.useCallback)((e=>v().createElement(Ym,e)),[]),F=!!d,M=!!c,V=(0,b.useMemo)((()=>((e,t=!0)=>e.map(((e,r)=>{var n;let{attrType:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attrType"]);const o=0===r;return am({},i,{dataTypeDefinition:a&&(0,S.getAttrDataTypeDefinition)(a),resizable:!0,autoResize:null!==(n=i.autoResize)&&void 0!==n?n:!o,draggable:!o,sortable:t&&sm(i),nestedPath:cm(i.id),headCellRenderer:o?Ud:Ld,rowCellValueRenderer:nm(am({},i,{attrType:a}))})})))(e,M)),[e,M]),B=(0,b.useMemo)((()=>((e,t,r)=>(r||[]).map((e=>(0,_.pipe)((0,_.reduce)(((t,r)=>(0,_.assoc)(r.id,((e,t,r)=>{switch(t.id){case"label":return r;case"entityId":return(0,S.getEntityId)(r);default:{const[e,...n]=om(t.id);return(0,_.pipe)((0,_.prop)(e),(0,S.getOvAttributeValuesByPath)(n))(r)}}})(0,r,e),t)),{}),(0,_.assoc)("rawValue",e))(t))))(0,e,t)),[R,e,t]),z=r?t.findIndex((0,_.propEq)("uri",r)):-1,H=(0,b.useMemo)((()=>({onEntityClick:m,selectedEntityUri:n,highlightedEntityIndex:z,entitiesImportStatus:f,onEntityImportStatusChange:y,canCheck:h,checkedEntitiesUris:E,headerCheckboxState:T,onCheck:O,openConfigColumnPopup:x})),[E,f,T,z,h,O,m,y,n,x]);return v().createElement(Rd.M,{fixFirstColumn:!0,onScroll:s,rowsData:B,columnsData:V,onSort:L,highlightRow:-1!==z?z:null,ref:D,sortFieldClassName:Vd.sortableCell,containerClassName:Vd.table,classes:A,defaultColumnWidth:250,headRowHeight:50,defaultColumnMinWidth:100,defaultRowHeight:48,sorting:{field:u,order:p},dndColumnReorderingHandler:a,dndColumnReorderingEnabled:i,onChangeColumnsSize:l,columnsSize:o,resizeDebounceDelay:null!=C?C:150,onRowHover:F?P:void 0,hoverStateEnabled:F,hoverRowIndex:I,renderRowOverlay:U,logger:g,context:H,maxRowValuesCount:2,renderRowCell:j,getRowCellHeight:Wm})}));Gm.propTypes={entities:dp().array,entityToHighlight:dp().string,selectedEntityUri:dp().string,headColumns:dp().array,columnsSize:dp().array,onScroll:dp().func,onSort:dp().func,onReorderingColumn:dp().func,onChangeColumnsSize:dp().func,dndColumnReorderingEnabled:dp().bool,onEntityClick:dp().func,onEntityHover:dp().func,sortField:dp().string,sortOrder:dp().oneOf([Ad.oy,Ad.U9]),entitiesImportStatus:dp().object,onEntityImportStatusChange:dp().func,logger:dp().func,canCheck:dp().bool,checkedEntitiesUris:dp().arrayOf(dp().string),headerCheckboxState:dp().oneOf([!0,!1,null]),onCheck:dp().func,openConfigColumnPopup:dp().func,resizeDebounceDelay:dp().number},Gm.defaultProps={entities:[],headColumns:[]},Gm.displayName="EntitiesTable";const qm=(0,b.memo)(Gm);var Zm=r(4437),$m=r.n(Zm),Km=r(5106),Xm=r.n(Km);const Qm="left",Jm="right",ef="hide",tf={[Qm]:li().text("Insert 1 left"),[Jm]:li().text("Insert 1 right"),[ef]:li().text("Hide column")},rf=({open:e,anchorEl:t,onClick:r,onClose:n,actions:a})=>v().createElement(yp(),{open:e,anchorEl:t,onClose:n},v().createElement($m(),{component:"div"},a.map(((e,t)=>((e,t,r)=>v().createElement(Xm(),{button:!0,component:"div",key:r,onClick:t},v().createElement(Hp(),{primary:tf[e],primaryTypographyProps:{variant:"body2"}})))(e,(e=>()=>{r(e)})(e),t)))));rf.propTypes={open:dp().bool,anchorEl:dp().any,onClick:dp().func,onClose:dp().func,actions:dp().array};const nf=rf;class af extends v().PureComponent{constructor(...e){super(...e),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=({newColumnPlaceIndex:e})=>{this.setState({newColumnPlaceIndex:e,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 Qm:this.openAddColumnPopup({newColumnPlaceIndex:t});break;case Jm:this.openAddColumnPopup({newColumnPlaceIndex:t+1});break;case ef: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,S.memoizeWith)(af.getMemoIdForColumnSize,af.getColumnSizeFromHeadColumns)}static getColumnSizeFromHeadColumns(e){return e.map((e=>({id:e.id,size:e.size})))}static getMemoIdForColumnSize(e,t){return`${t}${(0,_.toString)(e.map((e=>(0,_.pick)(["id","size"],e))))}`}render(){const{entities:e,entityToHighlight:t,selectedEntityUri:r,onScroll:n,headColumns:a,sortField:i,sortOrder:o,dndColumnReorderingEnabled:l,onEntityClick:s,onEntityHover:c,entitiesTableRef:u,additionalColumns:p,onChangeColumnsList:d,onReorderingColumn:m,onSort:f,onChangeColumnsSize:y,entityTypeUri:g,entitiesImportStatus:h={},onEntityImportStatusChange:E,logger:b,canCheck:T,checkedEntitiesUris:O,headerCheckboxState:S,onCheck:x,resizeDebounceDelay:C}=this.props,{addColumnPopupOpen:w,configColumnPopupOpen:A,popupAnchor:R,filterText:_,configurableColumnIndex:I}=this.state,N=this.memoizedGetColumnSize(a,g);return v().createElement(v().Fragment,null,v().createElement(qm,{entities:e,entityToHighlight:t,selectedEntityUri:r,onScroll:n,onSort:f,onEntityClick:s,onEntityHover:c,headColumns:a,sortField:i,sortOrder:o,onReorderingColumn:m,ref:u,onChangeColumnsList:d,dndColumnReorderingEnabled:l,onChangeColumnsSize:y,columnsSize:N,entitiesImportStatus:h,onEntityImportStatusChange:E,logger:b,canCheck:T,checkedEntitiesUris:O,headerCheckboxState:S,onCheck:x,openConfigColumnPopup:this.openConfigColumnPopup,resizeDebounceDelay:C}),v().createElement(hd,{open:w,anchorEl:R,data:p,onListItemClick:this.addColumnHandler,filterText:_,onClose:this.closeAddColumnPopup,onSearch:this.setFilterText,hideCheckBox:!0,titleText:oi.text("Add column")}),v().createElement(nf,{onClick:this.configColumnHandler,onClose:this.closeConfigColumnPopup,anchorEl:R,open:A,actions:I>0?[Qm,Jm,ef]:[Jm]}))}}af.propTypes={entities:dp().array,entityToHighlight:dp().string,selectedEntityUri:dp().string,entityTypeUri:dp().string,headColumns:dp().array,dndColumnReorderingEnabled:dp().bool,onScroll:dp().func,onSort:dp().func,onReorderingColumn:dp().func,onChangeColumnsSize:dp().func,onChangeColumnsList:dp().func,onEntityClick:dp().func,onEntityHover:dp().func,sortField:dp().string,sortOrder:dp().oneOf([Ad.oy,Ad.U9]),entitiesTableRef:dp().shape({current:dp().shape({resetScrollbarPosition:dp().func})}),additionalColumns:dp().arrayOf(dp().shape({id:dp().string,label:dp().string})),entitiesImportStatus:dp().object,onEntityImportStatusChange:dp().func,logger:dp().func,canCheck:dp().bool,checkedEntitiesUris:dp().arrayOf(dp().string),headerCheckboxState:dp().oneOf([!0,!1,null]),onCheck:dp().func};const of=af;var lf=r(66780),sf=r(9366),cf=r(41633),uf=r(79881),pf=r.n(uf),df=r(93962),mf=r.n(df),ff=r(45995),yf=r.n(ff);function gf(){return gf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gf.apply(null,arguments)}const hf=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["open","children"]);const[a,i]=(0,b.useState)(t),o=(0,wm.useTheme)().transitions.duration.leavingScreen;return(0,b.useEffect)((()=>{if(t!==a){if(!t){const e=setTimeout((()=>{i(!1)}),o);return()=>clearTimeout(e)}i(!0)}}),[t,o,a]),v().createElement(yf(),gf({open:t},n),a&&r)};hf.displayName="Drawer";var Ef=r(18759),bf=r.n(Ef),vf=r(30122),Tf=r.n(vf),Of=r(43410),Sf=r.n(Of),xf=r(93416),Cf=r.n(xf),wf=r(66825),Af=r.n(wf),Rf=r(17698);const _f=(0,_.allPass)([(0,_.propSatisfies)(_.isEmpty,"configs"),(0,_.pathEq)(["group","hasCollapseButton"],!0)]),If=(0,_.reject)(_f),Nf=(0,wp.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"}}),Pf=({title:e="",iconSrc:t="",isOpen:r=!0,hasCollapseButton:n=!0,leftIcon:a,onCollapse:i})=>{const o=Nf();return v().createElement("div",{className:o.titleBox},v().createElement("div",{className:o.title},a&&v().createElement("div",{className:o.leftIcon},a),t&&v().createElement(C(),{src:t,className:o.avatar}),v().createElement(od.Y,{value:e},v().createElement("span",{className:o.text},e))),n&&v().createElement(Vm,{isOpen:r,onClick:i,className:o.collapseIcon,size:"S"}))};var Df=r(1230),kf=r.n(Df),Lf=r(36631);const Uf=({facet:e,selectedFacets:t})=>!!t.find((t=>t.fieldName===e.fieldName||t.fieldName.includes(`${e.fieldName}.`))),jf=({facet:e,selectedFacets:t})=>Uf({facet:e,selectedFacets:t})||(0,N.OP)(e)&&e.children&&e.children.some((e=>Uf({facet:e,selectedFacets:t}))),Ff=(0,wp.Z)({icon:{maxHeight:"25px",maxWidth:"25px",marginRight:"16px"}}),Mf=({group:e,metadata:t})=>{const r=Ff(),n=(0,w.$H)(),a=(0,S.getEntityTypeGraphIcon)(t,{type:e.id}),i=(0,S.getAbsoluteImageUrl)(n,a);return v().createElement($d,{className:r.icon,icon:i,avatarText:e.title[0]})};function Vf(){return Vf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vf.apply(null,arguments)}const Bf=e=>{let{onListItemClick:t,focusIndex:r,selectedFacets:n,metadata:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onListItemClick","focusIndex","selectedFacets","metadata"]);const o=(0,b.useRef)(null);o.current=n;const l=(0,b.useRef)(null);l.current=r;const s=(0,b.useCallback)(((e,{item:r,level:n,groupId:a},i)=>{const s=jf({facet:r,selectedFacets:o.current}),c=l.current===i;return v().createElement(pd,{key:`item-${a}-${r.fieldName}`,onClick:t,data:r,label:v().createElement(dd.o,{text:r.title,highlight:r.filterText}),labelInText:r.title,level:n,style:e,checked:s,isFocused:c,groupId:a,LogoIcon:r.LogoIcon})}),[t]),c=(0,b.useCallback)(((e,t)=>v().createElement(Xm(),{component:"div",className:"MoreFacetsPopup-styles-subHeader--h1vGz",style:e,key:`group-${t.item.id}`},t.item.needGroupIcon&&v().createElement(Mf,{metadata:a,group:t.item}),t.item.title)),[a]),u=(0,b.useCallback)(((e,t)=>t.items?40:28),[]);return v().createElement(Vp,Vf({getItemSize:u,renderGroupTitle:c,renderItem:s,focusIndex:r},i,{disableHorizontalScrollbar:!0}))};function zf(){return zf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zf.apply(null,arguments)}const Hf=574,Yf={},Wf=e=>{let{metadata:t,open:r,selectedFacets:n,data:a=[],onListItemClick:i,lastFacetClicked:o=Yf,width:l,height:s=Hf}=e,c=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["metadata","open","selectedFacets","data","onListItemClick","lastFacetClicked","width","height"]);const[u,p]=(0,b.useState)(464),d=s-110;(0,b.useEffect)((()=>{p(d)}),[d]);const m=(0,b.useCallback)(((e,t)=>p((0,_.clamp)(56,d,t))),[d]),f=(0,b.useRef)();(0,b.useEffect)((()=>{const e=(0,_.path)(["current","updatePosition"],f);e&&e()}),[u]);const y=(0,b.useCallback)(((e,t,r=0)=>[{type:"item",item:e,moveTo:(0,_.has)("facetConfig")(o)&&o.facetConfig.fieldName===e.fieldName&&t===o.groupId,level:r,groupId:t}].concat(e.children?e.children.flatMap((e=>y(e,t,r+1))):[]).flat().filter((e=>!e.item.hide))),[o]),g=(0,b.useCallback)((e=>e.map((e=>({type:"group",item:e,items:e.facets.filter((e=>!e.hide)).map((t=>y(t,e.id)))}))).filter((e=>e.items.length))),[y]),h=(0,b.useMemo)((()=>g(a)),[a,g]),E=(0,b.useMemo)((()=>(0,ci.LG)(h)),[h]),T=(0,b.useCallback)((({item:e,groupData:t})=>{i(e,!jf({facet:e,selectedFacets:n}),t.groupId)}),[i,n]),{focusIndex:O,handleKeyDown:x}=Bp({items:E,open:r,onSelectFocusedItem:T,selectedItems:n}),C=Math.max(l||(0,S.getMaxItemWidth)("title")(h),240);return v().createElement(kp,zf({open:r,action:f,title:li().text("Select attribute"),containerWidth:C,searchInputOnKeyDown:x,containerHeight:110+u},c),v().createElement(Bf,{focusIndex:O,selectedFacets:n,onListItemClick:i,metadata:t,items:E,height:u,onInnerContainerResize:m}),0===E.length&&v().createElement("div",{className:"MoreFacetsPopup-styles-noResultsCaptionContainer--ChfND"},v().createElement(bf(),{variant:"caption",display:"block",gutterBottom:!0},li().text("No results found"))))};function Gf(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){qf(e,t,r[t])}))}return e}function qf(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Zf extends b.PureComponent{constructor(e){super(e),this.state={filterText:"",lastFacetClicked:null,addedFacets:[]},this.searchInputRootRef=v().createRef(),this.showSearchInput=()=>this.searchInputRootRef.current.scrollIntoView(!0),this.openPopup=()=>this.props.dispatch(fi(!0)),this.closePopup=()=>{this.props.dispatch(fi(!1)),this.props.dispatch(((e=[])=>({type:L.k.HIGHLIGHT_ADDED_FACETS,payload:e}))(this.state.addedFacets)),this.setState({addedFacets:[]}),setTimeout((()=>{this.props.dispatch({type:L.k.CLEAR_HIGHLIGHT_ADDED_FACETS})}),3e3)},this.setFilterText=e=>this.setState({filterText:e,lastFacetClicked:null}),this.clearFilterText=()=>this.setFilterText(""),this.setLastFacetClicked=e=>this.setState({lastFacetClicked:e}),this.resetLastFacetClicked=()=>this.setLastFacetClicked(null),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=>Gf({},e,{hide:!this.filterItemsTree(e),filterText:this.state.filterText}))).map((e=>{const t=this.getFilteredFacets(e.children);return(0,_.isEmpty)(t)?e:Gf({},e,{children:t})})),this.filterItemsInGroups=e=>e.map((e=>Gf({},e,{facets:this.getFilteredFacets(e.facets)}))),this.rejectNotAllowedEntityTypes=e=>t=>t.filter((({id:t})=>!(0,S.isEntityTypeUri)(t)||e.includes(t))),this.toggleSelectedFacet=(e,t)=>{const{facetsConfigs:r,selectedEntityTypes:n,dispatch:a}=this.props,i=(0,ci.jj)(e),o=t?r.concat(e).concat(i):r.filter((t=>t.fieldName!==e.fieldName)).filter((e=>!i.find((t=>t.fieldName===e.fieldName)))),l=(0,_.uniq)(o.filter((e=>e.entityTypeUri)).map((e=>e.entityTypeUri)).concat(n)),s=o.filter((0,_.complement)(N.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,_.prop)("fieldName")),u),a(ri({facetsToAdd:c,fieldNamesToDelete:u,changedEntityTypes:(0,_.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,Lf.Z)(N.tI),this.handleInputFocus=()=>{this.showSearchInput(),this.openPopup()}}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:i,selectedEntityTypes:o,facetsConfigs:l,dataTenantObject:s,allowedEntityTypes:c,dataTenants:u}=this.props,p=l.map((e=>({fieldName:e.fieldName,uri:e.uri}))),d=this.memoizedCollectFacetsList(i,o,n,u),m=(0,_.pipe)((0,_.when)((0,_.always)(e),this.filterItemsInGroups),(0,_.when)((0,_.always)(c),this.rejectNotAllowedEntityTypes(c)),(0,j.Eb)(s))(d),{verticalOrigin:f,popupHeight:y}=((e,t,r=16)=>{let n="top";if(e){const a=e.getBoundingClientRect(),i=r,o=window.innerHeight-r;if(a.top+t>o)if(a.bottom-t<i){const e=a.bottom-i,r=o-a.top;t=Math.max(e,r),n=e>r?"bottom":"top"}else n="bottom"}return{verticalOrigin:n,popupHeight:t}})(this.searchInputRootRef.current,Hf),g={vertical:f,horizontal:"right"};return v().createElement(b.Fragment,null,v().createElement(Np,{classes:{root:a.inputContainer},onSearch:this.setFilterText,onFocus:this.handleInputFocus,rootRef:this.searchInputRootRef,value:e,placeholder:li().text("Search & add attributes"),height:40,"data-reltio-id":"reltio-search-more-facets-search-input"}),v().createElement(Wf,{open:r,anchorEl:this.searchInputRootRef.current,metadata:i,selectedFacets:p,data:m,onClose:this.handlePopupClose,onListItemClick:this.handleItemClick,lastFacetClicked:t,width:this.inputWidth,height:y,onSearch:this.setFilterText,headerPlacement:"bottom"===f?"bottom":"top",anchorOrigin:g,transformOrigin:g,disableRestoreFocus:!0}))}}Zf.defaultProps={selectedEntityTypes:[],facetsConfigs:[]};const $f=(0,mp.connect)((e=>({metadata:k().selectors.getMetadata(e),open:(0,Ri.ds)(e),facetsConfigs:(0,P.Mp)(e),recommendedFacets:(0,P.ER)(e),selectedEntityTypes:(0,P.DX)(e),dataTenantObject:(0,ai.t9)(e),allowedEntityTypes:(0,Ri.Xf)(e),dataTenants:k().selectors.getDataTenants(e)})))(kf()((()=>({inputContainer:{margin:"4px 16px 16px",flexShrink:"0"}})))(Zf)),Kf=(0,wp.Z)({facetGroupContainer:{display:"flex",flexShrink:0,flexDirection:"column","& + hr":{marginTop:8},"& + &":{marginTop:"8px"}}});function Xf(){return Xf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xf.apply(null,arguments)}const Qf=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["hasSearchAttributesField","children"]);const a=Kf(),[i,o]=(0,b.useState)(!0);return v().createElement("div",{className:a.facetGroupContainer},v().createElement(Pf,Xf({isOpen:i,onCollapse:e=>{o(!i)}},n)),t&&v().createElement(v().Fragment,null,v().createElement($f,null),v().createElement(Af(),null)),i&&r)};function Jf(){return Jf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jf.apply(null,arguments)}var ey=r(52004),ty=r.n(ey),ry=r(58282),ny=r.n(ry);const ay=(0,wp.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)"}}))),iy=({active:e,onClick:t,className:r})=>{const n=ay();return v().createElement(ty(),{className:O()(n.viewMoreLessLink,r),onClick:t,underline:"none"},v().createElement(ny(),{"data-reltio-id":"more-arrow-icon",className:O()(n.arrow,{[n.rotated]:e})}),e?li().text("View less"):li().text("View more"))};var oy=r(50592),ly=r(23888),sy=r.n(ly);const cy=(0,wp.Z)((e=>({bar:{backgroundColor:e.palette.secondary.main,opacity:.12,position:"absolute",minHeight:"20px",minWidth:"5px",borderRadius:"2px",top:0,left:0,height:"100%"}}))),uy=e=>(0,_.is)(Number,e),py=({className:e,width:t=0,maxWidth:r})=>{const n=cy(),a=(0,b.useCallback)((e=>(r?100*e/r:0)+"%"),[r]);return t?v().createElement("div",{className:O()(n.bar,e),style:{width:uy(t)?a(t):t}}):null},dy=(0,wp.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 my(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fy={showColorBar:!0,hasOnlyButton:!1},yy=({config:e,data:t=[],values:r=[],onChange:n=_.identity})=>{const a=dy();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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){my(e,t,r[t])}))}return e}({},fy,e);const i=e=>()=>{const t=r.includes(e)?r.filter((t=>t!==e)):r.concat(e);n(t)},o=Math.max(...t.map((e=>e.number)));return v().createElement("div",{className:a.listContainer},t.map((t=>v().createElement("div",{key:t.value,className:O()(a.item,{[a.disabled]:!t.number&&!r.includes(t.value)}),"data-reltio-id":"search-facets-list-row"},(e=>v().createElement(Wp(),{className:O()(a.checkbox,{[a.checked]:r.includes(e.value)}),checked:r.includes(e.value),onChange:i(e.value),value:e.value,color:"primary"}))(t),v().createElement("div",{className:a.info,onClick:i(t.value)},(e=>v().createElement(py,{className:O()({[a.checkedBar]:r.includes(e.value)}),width:e.number,maxWidth:o}))(t),v().createElement("div",{className:O()(a.textInfo)},v().createElement("div",{className:a.text},t.label),v().createElement("div",{className:a.count},void 0===t.number?li().text("N/A"):(0,ni.k7)(t.number,5e3))),e.hasOnlyButton&&(e=>{return v().createElement(sy(),{className:a.buttonONLY,onClick:(t=e.value,e=>{e.stopPropagation(),n([t])})},li().text("ONLY"));var t})(t))))))};var gy=r(1441);const hy=(0,wp.Z)((()=>({container:{overflow:"hidden",display:"flex",flexGrow:1,flexDirection:"column",fontSize:"13px"},noData:{marginLeft:"16px"},viewMoreLess:{paddingLeft:"20px"}}))),Ey=({config:e,data:t=[],values:r=[],onChange:n})=>{const a=hy(),i=(0,mp.useDispatch)(),o=(0,b.useCallback)((({show:e})=>{i((({show:e,silent:t})=>({type:L.k.SHOW_MORE_ENTITY_TYPES,payload:{show:e,silent:t}}))({show:e}))}),[i]),l=(0,mp.useSelector)((t=>(0,P.jC)(e,t))),s=(0,mp.useSelector)(ai.t9),c=t.length>Z.wP,u=(0,b.useCallback)((()=>{o({show:!l})}),[o,l]),p=(0,b.useMemo)((()=>{const e=l?t:t.slice(0,Z.wP);return(0,gy.ZK)(e,s)}),[t,l,s]);return v().createElement("div",{className:a.container},t.length>0?v().createElement(v().Fragment,null,v().createElement(yy,{data:p,values:r,onChange:n,config:e}),c&&v().createElement(iy,{active:l,onClick:u,className:a.viewMoreLess})):v().createElement(oy.K,{variant:"noData",className:a.noData}))};var by=r(70347),vy=r(94852);const Ty=(0,vy.M)(by.ZP);var Oy=r(75237),Sy=r(27308);const xy=(0,vy.M)(Sy.ZP);var Cy=r(22507),wy=r(14658);function Ay(){return Ay=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ay.apply(null,arguments)}const Ry={Option:({innerProps:e,innerRef:t,children:r,isFocused:n,isSelected:a,selectProps:{classes:i},label:o})=>v().createElement(qp(),Ay({className:O()(i.option,{[i["option--selected"]]:a}),ref:t,selected:n,component:"div"},e),v().createElement(Wp(),{color:"primary",checked:a}),v().createElement(od.Y,{value:o},v().createElement("div",{className:i["option--item"]},r)))},_y=(0,wp.Z)((e=>({label:{top:6,left:16},placeholder:({placeholder:e,label:t})=>({display:!e||t?"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)}})));function Iy(){return Iy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Iy.apply(null,arguments)}function Ny(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Py(e,t,r[t])}))}return e}function Py(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let Dy=0;const ky=e=>{const{label:t,creatable:r,getOptions:n,loadingIndicator:a,components:i,classes:o,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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","creatable","getOptions","loadingIndicator","components","classes","styles","onChange","onInputChange","menuPlacement"]),d=r?Ty:n?xy:Oy.J,[m,f]=(0,b.useState)(""),y=_y((0,_.omit)(["classes"],e)),g="custom-select-"+Dy++,h=(0,b.useRef)();((e=[],t)=>{const r=(0,wy.D)(null==e?void 0:e.length);(0,b.useEffect)((()=>{const n=setTimeout((()=>{const n=(e=>{let t=null==e?void 0:e.parentElement;for(;t;){if(t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null})(null==t?void 0:t.current);var a;n&&((e,t,r,n)=>e&&t<e&&n.getBoundingClientRect().bottom>r.getBoundingClientRect().bottom)(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,_.either)((0,_.path)(["select","controlRef"]),(0,_.path)(["select","select","controlRef"]))(e.current)),t})(h));const E=Ny({},Ry,i),T=(0,Cy.z)(y,o),O=Ny({indicatorSeparator:e=>Ny({},e,{margin:"10px 0"}),loadingIndicator:e=>Ny({},e,{display:a?e.display:"none"}),loadingMessage:e=>Ny({},e,{fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif'})},l),S=t?{inputId:g,TextFieldProps:Ny({label:t,InputLabelProps:{htmlFor:g,shrink:!(!e.value||!e.value.length)||void 0,className:T.label}},e.TextFieldProps)}:{};return v().createElement(d,Iy({isMulti:!0,inputId:g,inputValue:m,onChange:function(e,t){s(e,t),"create-option"===t.action&&(f(""),c("",{action:"input-change"}))},onInputChange:function(e,{action:t}){c(e,{action:t}),"set-value"!==t&&f(e)},closeMenuOnSelect:!1,hideSelectedOptions:!1,classes:T,components:E,styles:O,menuPlacement:u,loadOptions:n,innerRef:h},S,p))};ky.defaultProps={creatable:!1,cacheOptions:!0,components:{},classes:{},placeholder:"",loadingIndicator:!1,onInputChange:()=>{},onChange:()=>{}},ky.propTypes={creatable:dp().bool,cacheOptions:dp().bool,defaultOptions:dp().bool,value:dp().arrayOf(dp().shape({label:dp().string.isRequired,value:dp().any})),options:dp().arrayOf(dp().shape({label:dp().string.isRequired,value:dp().any})),onChange:dp().func,onInputChange:dp().func,placeholder:dp().string,label:dp().string,loadingIndicator:dp().bool,components:dp().shape({ClearIndicator:dp().func,Control:dp().func,DropdownIndicator:dp().func,DownChevron:dp().func,CrossIcon:dp().func,Group:dp().func,GroupHeading:dp().func,IndicatorsContainer:dp().func,IndicatorSeparator:dp().func,Input:dp().func,LoadingIndicator:dp().func,Menu:dp().func,MenuList:dp().func,MenuPortal:dp().func,LoadingMessage:dp().func,NoOptionsMessage:dp().func,MultiValue:dp().func,MultiValueContainer:dp().func,MultiValueLabel:dp().func,MultiValueRemove:dp().func,Option:dp().func,Placeholder:dp().func,SelectContainer:dp().func,SingleValue:dp().func,ValueContainer:dp().func}),classes:dp().shape({control:dp().string,valueContainer:dp().string,multiValue:dp().string,noOptionsMessage:dp().string,singleValue:dp().string,placeholder:dp().string,menu:dp().string,clearIndicator:dp().string,dropdownIndicator:dp().string,option:dp().string,"option--selected":dp().string,label:dp().string}),styles:dp().shape({clearIndicator:dp().func,container:dp().func,control:dp().func,dropdownIndicator:dp().func,group:dp().func,groupHeading:dp().func,indicatorsContainer:dp().func,indicatorSeparator:dp().func,input:dp().func,loadingIndicator:dp().func,loadingMessage:dp().func,menu:dp().func,menuList:dp().func,menuPortal:dp().func,multiValue:dp().func,multiValueLabel:dp().func,multiValueRemove:dp().func,noOptionsMessage:dp().func,option:dp().func,placeholder:dp().func,singleValue:dp().func,valueContainer:dp().func}),TextFieldProps:dp().object,getOptions:dp().func,menuPlacement:dp().string,menuPortalTarget:dp().object,menuShouldBlockScroll:dp().bool,captureMenuScroll:dp().bool,getOptionValue:dp().func,isSearchable:dp().bool,inputRef:dp().shape({current:dp().object})};var Ly=r(80959),Uy=r(88640),jy=r(25386),Fy=r(59428),My=r(47823);const Vy=(0,wp.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 By(){return By=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},By.apply(null,arguments)}const zy=e=>{const{innerProps:t,innerRef:r,data:n,isSelected:a,isFocused:i,selectProps:{classes:o}}=e,l=Vy(),s=(0,_.has)("width",n),c=(0,_.has)("number",n);return v().createElement(qp(),By({className:o.option,classes:{root:l.item,selected:l.itemSelected},ref:r,component:"div",selected:i,disableGutters:!0},t),v().createElement(Wp(),{checked:a,color:"primary",disableRipple:!0,classes:{root:l.checkbox}}),v().createElement("div",{className:l.infobox},v().createElement("div",{className:l.textbox},v().createElement(od.Y,{value:n.label},v().createElement("div",{className:l.text},n.label)),c&&v().createElement("div",{className:l.number},(0,ni.k7)(n.number,5e3))),s&&v().createElement(py,{className:O()(l.colorBar,{[l.selectedColorBar]:a}),width:n.width})))};zy.propTypes={innerProps:dp().shape({id:dp().string.isRequired,key:dp().string,onClick:dp().func.isRequired,onMouseMove:dp().func.isRequired,onMouseOver:dp().func.isRequired,tabIndex:dp().number.isRequired}).isRequired,innerRef:dp().oneOfType([dp().oneOf([null]),dp().func,dp().shape({current:dp().any.isRequired})]),isSelected:dp().bool.isRequired,isFocused:dp().bool.isRequired,selectProps:dp().shape({classes:dp().shape({option:dp().string})}),data:dp().shape({value:dp().string,label:dp().string.isRequired,number:dp().number}).isRequired};const Hy=zy,Yy=e=>{const{selectProps:{classes:t}}=e;return v().createElement(oy.K,{variant:"noData",className:t.noOptionsMessage})};Yy.propTypes={selectProps:dp().object.isRequired};const Wy=Yy;function Gy(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){qy(e,t,r[t])}))}return e}function qy(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zy={container:e=>Gy({},e,{width:"100%"}),menuList:e=>Gy({},e,{maxHeight:"240px",padding:"8px 0"}),menu:e=>Gy({},e,{maxHeight:"240px"})},$y=(0,wp.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)"}}))),Ky=dp().shape({value:dp().string.isRequired,label:dp().string.isRequired,number:dp().number});function Xy(){return Xy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xy.apply(null,arguments)}function Qy(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Jy=e=>{let{values:t=[],defaultOptions:r=[],filteredOptions:n,onChange:a=_.identity,getSuggestions:i,showBar:o=!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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["values","defaultOptions","filteredOptions","onChange","getSuggestions","showBar","showNumberInValue","classes","styles","canLoadMore","max"]);const m=$y(),[f,y]=(0,b.useState)(""),[g,h]=(0,b.useState)(1),[E,T]=(0,b.useState)(!1),O=(0,b.useRef)(null),x=(0,b.useRef)(!1),C=(0,b.useRef)(!1),w=(n||[]).concat(r),A=e=>w.find((t=>t.value===e))||{value:e,label:e},R=e=>l&&(0,_.has)("number",e)?(0,_.assoc)("formattedNumber",(0,S.formatNumberAsMetric)((0,_.prop)("number",e),5e3),e):e,I=(0,_.pipe)((e=>{if(o&&e.length&&(0,_.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Qy(e,t,r[t])}))}return e}({},e,{width:N(e.number,t)})))}return e}),(0,_.uniqBy)((0,_.prop)("value"))),N=(e,t)=>(t?100*e/t:0)+"%",P=(0,S.debounce)(((e,{action:t})=>{e!==f&&"set-value"!==t&&(y(e),h(1),x.current=!1,T(!0),i({value:e,pageNumber:1}))}),250),D=n||r,k=(0,b.useCallback)((()=>{T(!0),i({value:f,pageNumber:g+1,currentOptions:D}),x.current=!0}),[f,g,i,D]);(0,b.useEffect)((()=>{T(!1),x.current&&(h((e=>e+1)),x.current=!1)}),[n]),(0,b.useEffect)((()=>{C.current||(T(!1),h(1),x.current=!1,i({value:"",pageNumber:1})),C.current=!1}),[r]);const L=(0,b.useMemo)((()=>D.slice(0,g*p)),[D,g,p]),U=u&&D.length>L.length;return v().createElement(ky,Xy({filterOption:({label:e,value:t},r)=>S.utils.strings.search(e,r)||S.utils.strings.search(t,r),value:(e=>(0,S.wrapInArrayIfNeeded)(e).map(A).map(R))(t),onChange:(0,_.pipe)((0,_.tap)((()=>{C.current=!0})),(0,_.defaultTo)([]),(0,_.pluck)("value"),a),options:I(L),onInputChange:P,classes:(0,_.mergeRight)(m,s),styles:(0,_.mergeRight)(Zy,c),TextFieldProps:{InputProps:{disableUnderline:!0},ref:O},inputRef:O,components:{Option:Hy,NoOptionsMessage:Wy,Menu:Ly.h,DropdownIndicator:Uy.K,MultiValue:jy._,MenuList:Fy.d},menuPlacement:"bottom",menuListFooter:U&&v().createElement(My.X,{loading:E,onClick:k})},d))};Jy.propTypes={values:dp().array,defaultOptions:dp().arrayOf(Ky),filteredOptions:dp().arrayOf(Ky),onChange:dp().func.isRequired,getSuggestions:dp().func.isRequired,showBar:dp().bool,showNumberInValue:dp().bool,classes:dp().object,styles:dp().object,canLoadMore:dp().bool,max:dp().number};const eg=(0,b.memo)(Jy);var tg=r(43627),rg=r.n(tg);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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ag(e,t,r[t])}))}return e}function ag(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ig=(0,_.range)(2,10).reduce(((e,t)=>ng({},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)"}}})),{}),og=(0,wp.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":ng({fontSize:"10px",lineHeight:"11px",fontWeight:500,color:"rgba(255, 255, 255, 0.7)",marginTop:"4px"},ig,{"&:last-child":{color:"white"}}),"& li + li":{marginTop:"2px"}}}})));function lg(){return lg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lg.apply(null,arguments)}const sg=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["pathToTitle","children"]);const a=og(),i=null!=t&&t.length?v().createElement("div",{className:a.tooltipContent},v().createElement("p",null,(0,_.last)(t)),t.length>2&&v().createElement("ul",null,t.map((e=>v().createElement("li",{key:e},e))))):"";return v().createElement(rg(),lg({title:i,disableFocusListener:!0,classes:{tooltip:a.tooltip}},n),r)};var cg=r(96091),ug=r.n(cg),pg=r(35635),dg=r.n(pg);const mg=(0,wp.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 fg(){return fg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fg.apply(null,arguments)}const yg=(0,ld.T)(dg()),gg=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","onDelete"]);const a=mg();return v().createElement(ug(),fg({className:a.root,label:li().number(t),onDelete:r,variant:"outlined",classes:{root:a.root,outlined:a.outlined,deleteIcon:a.deleteIcon,label:a.label},deleteIcon:v().createElement(yg,{tooltipTitle:li().text("Clear")})},n))},hg=(0,wp.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 Eg(){return Eg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Eg.apply(null,arguments)}const bg=({title:e="",chipLabel:t=0,onDelete:r,pathToTitle:n,onClick:a})=>{const i=hg(),o=Boolean(n&&n.length>2),l=o?sg:od.Y,s=o?{pathToTitle:n}:{value:e};return v().createElement("div",{className:i.container,onClick:a},o&&v().createElement(sg,Eg({placement:"bottom-start"},s),v().createElement("div",{className:i.parent},n[n.length-2])),v().createElement("div",{className:i.titleContainer},v().createElement(l,Eg({placement:"bottom-start"},s),v().createElement("span",{className:i.title},e)),0!==t&&v().createElement("div",{className:i.chip},v().createElement(gg,{label:t,onDelete:r}))))};function vg(){return vg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vg.apply(null,arguments)}const Tg=(0,wp.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}}))),Og=(0,ld.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",vg({width:"13",height:"18",viewBox:"0 0 13 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},r),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("g",null,v().createElement("g",null,v().createElement("g",null,v().createElement("g",{transform:"translate(-3 -1)"},v().createElement("g",null,v().createElement("path",{fill:"#FF4081",d:"M5.833 10h3.75v6.667l-3.75 1.666z"}),v().createElement("path",{fill:"#CE0C4E",d:"M13.333 10v8.333l-3.75-1.666V10z"})),v().createElement("circle",{fill:"#FFC058",cx:"9.583",cy:"7.917",r:"6.25"}),v().createElement("circle",{fill:"#FFCD7B",cx:"9.583",cy:"7.917",r:"5.417"}),v().createElement("path",{fill:"#FFFBB5",d:"M8.333 11.667L5 8.462l.933-.898 2.4 2.308L13.4 5l.933.897z"})))))))})),Sg=({title:e,chipLabel:t,onDeleteChip:r,pathToTitle:n,onClose:a,children:i,isOpenByDefault:o=!0,isHighlighted:l=!1,isRecommended:s=!1})=>{const c=Tg(),[u,p]=(0,b.useState)(o),d=()=>{p(!u)};return v().createElement("div",{className:O()(c.facetContainer,{[c.openedFacetContainer]:u,[c.closedFacetContainer]:!u,[c.highlighted]:l}),"data-reltio-id":`search-facet-container-${e}`},v().createElement("div",{className:c.titleContainer},v().createElement(Ed.k,{tooltipTitle:li().text("Remove"),icon:Tp(),onClick:a,className:c.iconButton,size:"XXS"}),s&&v().createElement(Og,{className:c.recommendedIcon,tooltipTitle:li().text("Recommended"),showForDisabled:!0}),v().createElement(bg,{title:e,pathToTitle:n,chipLabel:t,onDelete:r,onClick:d}),v().createElement(Vm,{onClick:d,isOpen:u,className:c.iconButton,size:"S",tooltipTitle:u?li().text("Collapse attribute"):li().text("Expand attribute"),tooltipPlacement:"bottom-end"})),u?i:null)},xg=(0,wp.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"}}))),Cg=({config:e,data:t=[],filteredData:r,values:n=[],isHighlighted:a,isRecommended:i,onSearch:o=_.identity,onChange:l,onClose:s})=>{const c=xg();return v().createElement(Sg,{title:e.title,pathToTitle:e.pathToTitle,onClose:s,chipLabel:n.length,onDeleteChip:()=>l([]),isHighlighted:a,isRecommended:i},v().createElement(eg,{values:n,defaultOptions:t,filteredOptions:r,onChange:l,getSuggestions:o,isClearable:!1,showBar:!1,showNumberInValue:!0,classes:c,placeholder:li().text("All values"),canLoadMore:!(0,ja.tW)(e)}))};var wg=r(19014),Ag=r(15608),Rg=r.n(Ag);const _g=(0,wp.Z)((e=>({root:{borderRadius:4,padding:"15px 0"},rail:{backgroundColor:(0,wm.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,wm.alpha)(e.palette.primary.main,.12)}`,"@media (hover: none)":{boxShadow:"none"}},"&$active":{boxShadow:`0px 0px 0px 9px ${(0,wm.alpha)(e.palette.primary.main,.12)}`},"&::after":{left:-10,top:-10,right:-10,bottom:-10}},focusVisible:{},active:{},track:{borderRadius:4}}))),Ig=(0,wp.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"}}))),Ng=({children:e,open:t,value:r})=>{const n=Ig();return v().createElement(rg(),{open:t,enterTouchDelay:0,placement:"top",title:r,classes:{tooltipPlacementTop:n.tooltipPlacementTop,tooltip:n.tooltip}},e)};function Pg(){return Pg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pg.apply(null,arguments)}Ng.propTypes={children:dp().element.isRequired,open:dp().bool.isRequired,value:dp().string.isRequired};const Dg=e=>{let{min:t,max:r,range:n,onChange:a,onAfterChange:i,className:o}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["min","max","range","onChange","onAfterChange","className"]);const s=_g();return v().createElement("div",{className:o},v().createElement(Rg(),Pg({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)=>{i&&i(t)},valueLabelDisplay:"auto","aria-labelledby":"range-slider",components:{ValueLabel:Ng},size:"small",component:"div"},l)))};Dg.propTypes={min:dp().oneOfType([dp().number,dp().string]).isRequired,max:dp().oneOfType([dp().number,dp().string]).isRequired,range:dp().array.isRequired,onChange:dp().func,onAfterChange:dp().func,className:dp().string};const kg=Dg;var Lg=r(18205),Ug=r(19406),jg=r(55484),Fg=r(25556),Mg=r(3131),Vg=r(27741),Bg=r(42400),zg=r(11011);const Hg=(0,wp.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"}}))),Yg=({payload:e,formatter:t,active:r})=>{const n=Hg();if(r){const{payload:{label:r},value:a}=e[0];return v().createElement("div",{className:n.tooltip},v().createElement("div",{className:n.number},t(a)),v().createElement("div",{className:n.value},r))}return null},Wg=(0,wp.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 Gg(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qg=({data:e=[],range:t=[],domain:r,color:n=S.theme.palette.primary.main,tickFormatterX:a,tickFormatterY:i})=>{const o=Wg(),[l,s]=(0,b.useState)(null),c=(e,r)=>(l===r?.2:0)+((({value:e})=>e[0]>=t[0]&&e[1]<=t[1])(e)?.6:.2),u=e.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Gg(e,t,r[t])}))}return e}({},e,{value:t<r.length-1?e.value[0]:e.value[1]}))),p=e=>{e.isTooltipActive?s(e.activeTooltipIndex):s(null)};return v().createElement(Lg.h,null,v().createElement(Ug.v,{data:u,margin:{top:12,right:0,left:0,bottom:0},onMouseEnter:p,onMouseLeave:p,onMouseMove:p,className:o.barChart},v().createElement(jg.q,{vertical:!1,stroke:"#f2f2f2"}),v().createElement(Fg.K,{dataKey:"value",interval:0,padding:{left:4,right:4},height:15,tickLine:!1,ticks:r,tick:e=>{const{x:t,y:r,index:n,payload:{value:i,offset:o}}=e;return v().createElement("text",{x:0===n?t-o:t+o,y:r+4,textAnchor:0===n?"start":"end"},`${a(i)}`)}}),v().createElement(Mg.B,{width:38,domain:[0,"auto"],axisLine:!1,tickLine:!1,tickSize:0,tickMargin:4,tickCount:6,tickFormatter:i}),v().createElement(Vg.u,{cursor:{fill:"rgb(255,255,255)"},content:v().createElement(Yg,{formatter:i}),isAnimationActive:!1}),v().createElement(Bg.$,{dataKey:"number",isAnimationActive:!1},e.map(((e,t)=>v().createElement(zg.b,{key:`cell-${t}`,fill:n,fillOpacity:c(e,t)}))))))},Zg="NumericRangeFacet-styles-numberEditorInputRoot--djW3k",$g="NumericRangeFacet-styles-numberEditorRoot--DVXqx",Kg="NumericRangeFacet-styles-input--Nl2tx";function Xg(){return Xg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xg.apply(null,arguments)}class Qg extends b.PureComponent{constructor(...e){super(...e),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,i]=n.getBarDomain(t),o=n.adjustRange(e,a,i);0!==r.length&&n.equals(o[0],(0,_.path)([0,0],r))&&n.equals(o[1],(0,_.path)([0,1],r))||this.props.onChange([o])},this.onLowerBoundChanged=e=>{const{range:t,NumMath:r,isFloating:n}=this.state;this.setState({lowerBound:n?e:r.toFixed(e,0)},(()=>{const a=(0,_.head)(this.props.data).value[0],i=""===e||isNaN(e)?a:e,o=r.clamp(a,t[1],n?i:r.floor(i));this.setState((e=>({lowerBound:o.toString(),range:[o,e.range[1]]}))),this.handleOnChangeValue([o,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,_.last)(this.props.data).value[1],i=""===e||isNaN(e)?a:e,o=r.clamp(t[0],a,n?i:r.ceil(i));this.setState((e=>({upperBound:o.toString(),range:[e.range[0],o]}))),this.handleOnChangeValue([t[0],o])}))},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,i="Long"===a,o=(0,kl.C)(a),l=(0,ni.Oz)(a),s=o.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:o,isScaled:i,isFloating:(0,S.isFloatingType)(a),scale:n.length>0?o.calcScale(...o.getBarDomain(n)):{ratio:1,offset:0}}}return null}render(){const{config:e,data:t,isHighlighted:r,isRecommended:n,onClose:a,numberFormat:i}=this.props,{isScaled:o,scale:l,range:s,lowerBound:c,upperBound:u,rangeService:p,isFloating:d}=this.state,m=o?p.bigNumbersTickFormatterX(p.formatNumberForRangeFacet,l):p.formatNumberForRangeFacet,f=t.map((e=>({value:e.value.map(this.applyScale),label:e.value.map(p.formatNumberForRangeFacet).join(" - "),number:e.number}))),y=s.map((e=>+this.applyScale(e))),[g,h]=p.getBarDomain(t).map((e=>this.applyScale(e)));return v().createElement(Sg,{title:e.title,pathToTitle:e.pathToTitle,onClose:a,isHighlighted:r,isRecommended:n},v().createElement("div",{className:"NumericRangeFacet-styles-data--kL9q5"},f.length>0?v().createElement(v().Fragment,null,v().createElement("div",{className:"NumericRangeFacet-styles-barChartContainer--t9NkG","data-reltio-id":"search-bar-chart-with-selection"},v().createElement(qg,{data:f,range:y,tickFormatterX:m,tickFormatterY:p.formatNumberForRangeFacet,domain:[g,h]})),v().createElement(kg,{min:g,max:h,range:y,onAfterChange:this.onRevertedChange,onChange:this.onChangeRange,className:"NumericRangeFacet-styles-slider--XbmKe",valueLabelFormat:m,step:d?(h-g)/200:1}),v().createElement("div",{className:"NumericRangeFacet-styles-inputsContainer--mU0_m"},v().createElement(wg.c,{value:c,onChange:this.onLowerBoundChanged,onFocus:this.onFocus,integer:!d,format:i,variant:"filled",classes:{root:$g},InputProps:{classes:{root:Zg,input:Kg}}}),v().createElement(wg.c,{value:u,onChange:this.onUpperBoundChanged,onFocus:this.onFocus,integer:!d,format:i,variant:"filled",classes:{root:$g},InputProps:{classes:{root:Zg,input:Kg}}}))):v().createElement(oy.K,{variant:"noData"})))}}Qg.propTypes={data:dp().array,values:dp().array,config:dp().object,isHighlighted:dp().bool,isRecommended:dp().bool,onClose:dp().func,onChange:dp().func,numberFormat:dp().shape({decimalSeparator:dp().string,thousandSeparator:dp().string,prefix:dp().string,suffix:dp().string,decimalScale:dp().number})},Qg.defaultProps={config:{},data:[],values:[]};const Jg=(0,mp.connect)((e=>({numberFormat:k().selectors.getUiNumberFormat(e)})))((e=>{const t=t=>{let{config:r,values:n,data:a,onChange:i,numberFormat:o}=t,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["config","values","data","onChange","numberFormat"]);const s=(0,mp.useSelector)(k().selectors.getAttributesPresentation),{strategy:c}=(0,S.getNumberFormat)((0,S.getAttrDataTypeDefinition)(r.attrType),s,S.intl.getLocale()),u=(0,b.useMemo)((()=>null==a?void 0:a.map((0,_.evolve)({value:(0,_.map)((0,S.applyPresentationStrategyToValue)(c))}))),[a,c]),p=(0,b.useMemo)((()=>null==n?void 0:n.map((0,S.mapFilterValue)((0,S.applyPresentationStrategyToValue)(c)))),[n,c]),d=(0,b.useCallback)((e=>{const t=null==e?void 0:e.map((0,S.mapFilterValue)((0,S.revertPresentationStrategyForValue)(c)));i(t)}),[c,i]);return v().createElement(e,Xg({data:u,values:p,onChange:d,config:r,numberFormat:o&&(0,_.omit)(["strategy",o])},l))};return t.displayName="WithCustomizedData",t})(Qg));var eh=r(21669);const th=(0,wp.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 rh(){return rh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rh.apply(null,arguments)}const nh=(e,t)=>(0,_.pathOr)(null,[t],e),ah=e=>e&&new Date(e),ih=e=>e&&e.getTime(),oh=({values:e,minDate:t,maxDate:r,onChange:n})=>{const[a,i]=(0,b.useState)(null),[o,l]=(0,b.useState)(null),s=(0,b.useRef)((0,Ge.x0)()),c=(0,b.useRef)((0,Ge.x0)()),u=th();v().useEffect((()=>{i(nh(e,0)),l(nh(e,1))}),[e]);const p=(e,t)=>{(0,_.isNil)(e)||(0,_.isNil)(t)||n(e>t?[[t,e]]:[[e,t]])},d={minDate:ah(t),maxDate:ah(r)};return v().createElement("div",{className:u.container},v().createElement(eh.Q,rh({label:li().text("Start Date"),value:ah(a),onChange:e=>{const t=ih(e);i(t),p(t,o)},slotProps:{textField:{id:s.current,className:u.dateEditor}}},d)),v().createElement(eh.Q,rh({label:li().text("End Date"),value:ah(o),onChange:e=>{const t=ih(e);l(t),p(a,t)},slotProps:{textField:{id:c.current,className:u.dateEditor},popper:{placement:"bottom-end"}}},d)))};function lh(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sh=e=>t=>e===S.DataTypes.TYPE_DATE?S.utils.dates.toLocalDate(t).getTime():t,ch=(0,wp.Z)({barChartContainer:{position:"relative",height:"190px",paddingTop:"6px",width:"100%",overflow:"hidden"},dateRangeChooserWrapper:{display:"flex",flexDirection:"column",alignItems:"center",marginTop:"12px",width:"100%"}}),uh=(0,kl.C)(),ph=({data:e=[],values:t=[],config:r,onChange:n,isHighlighted:a,isRecommended:i,onClose:o})=>{const l=ch(),s=(0,_.path)(["attrType","type"],r),c=(0,b.useCallback)((r=>{const a=r.map((0,S.mapFilterValue)((i=s,e=>i===S.DataTypes.TYPE_DATE?S.utils.dates.toUtcDate(e).getTime():e)));var i;if(!(0,_.equals)(t,a)){const[t,r]=uh.getBarDomain(e),i=s===S.DataTypes.TYPE_DATE,o=a.map((e=>[S.utils.dates.getStartOfDay(e[0],i),S.utils.dates.getEndOfDay(e[1],i)])),l=uh.getRange(o,e);n([l.length?l:[t,r]])}}),[e,n,s,t]),u=(0,b.useMemo)((()=>{return e.map((t=s,e=>{if(Array.isArray(e.value)){const r=e.value.map(sh(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){lh(e,t,r[t])}))}return e}({},e,{value:r,label:r.map(S.formatDate).join(" - ")})}}));var t}),[e,s]),[p,d]=(0,b.useMemo)((()=>[uh.getBarDomain(u),uh.getRange(t.map((0,S.mapFilterValue)(sh(s))),u)]),[u,s,t]);return v().createElement(Sg,{title:r.title,pathToTitle:r.pathToTitle,onClose:o,isHighlighted:a,isRecommended:i},e.length>0?v().createElement(v().Fragment,null,v().createElement("div",{className:l.barChartContainer},v().createElement(qg,{data:u,range:d,tickFormatterX:S.formatDate,tickFormatterY:uh.formatNumberForRangeFacet,domain:p})),v().createElement("div",{className:l.dateRangeChooserWrapper},v().createElement(oh,{values:d,onChange:c}))):v().createElement(oy.K,{variant:"noData"}))};function dh(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class mh{static getWidget(e){switch(e.type){case S.FACET_TYPES.ENTITY_TYPE_FACET:return Ey;case S.FACET_TYPES.WITH_DROPDOWN_CHECKBOXES_FACET:return Cg;case S.FACET_TYPES.NUMERIC_RANGE_FACET:return Jg;case S.FACET_TYPES.DATE_RANGE_FACET:return ph;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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){dh(e,t,r[t])}))}return e}({},mh.getDefaultConfig(),e),r=mh.getWidget(t);return r?(e=>{const r=((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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(r,["dispatch"]);return v().createElement(e,Jf({config:t,onChange:(i=t.fieldName,e=>{n(Ja(i,e))}),onClose:t.showDeleteButton?(e=>()=>{n(ri({fieldNamesToDelete:[e]}))})(t.fieldName):()=>{},onSearch:(e=>({value:t,pageNumber:r,currentOptions:a})=>{n((({facetFieldName:e,value:t,debounceTime:r=0,pageNumber:n=1,currentOptions:a})=>({type:L.k.FILTER_FACET_DATA,payload:{facetFieldName:e,value:t,debounceTime:r,pageNumber:n,currentOptions:a}}))({facetFieldName:e,value:t,debounceTime:250,pageNumber:r,currentOptions:a}))})(t.fieldName)},a));var i};return r.propTypes={dispatch:dp().func,isRecommended:dp().bool},r})(e,t);return mh.connectData(r,t)})(r):null}}mh.getDefaultConfig=()=>({autofocus:!1,showDeleteButton:!0}),mh.connectData=(e,t)=>(0,mp.connect)((e=>({data:(0,P.X7)(t,e),values:(0,P.N1)(t,e),filteredData:(0,P.VP)(t,e),isHighlighted:(0,P.$t)(t.fieldName,e),isRecommended:(0,P.TH)(t.fieldName,e)})))(e);var fh=r(64927),yh=r.n(fh),gh=r(73707),hh=r.n(gh),Eh=r(93463),bh=r.n(Eh);const vh=(0,wp.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 Th=r(44244);const Oh=({tenantObject:e,isDataTenant:t,className:r})=>{const n=(({tenantObject:e,isDataTenant:t})=>{const r=(0,Th._)(),[n,a]=(0,b.useState)(0),i=(0,mp.useSelector)(k().selectors.getGlobalSearchRequestOptions),o=t?e:null,l=(0,mp.useSelector)((e=>(0,ai.E2)(e,[],o))),s=JSON.stringify((0,Ua.Vg)(l,[],i)),c=(0,mp.useSelector)(k().selectors.getDtssPath),u=(0,mp.useSelector)(k().selectors.getTenant);return(0,b.useEffect)((()=>{r((0,Ua.Es)({url:Z.jS,options:{method:"POST",body:s},customerTenant:u,dataTenant:(0,_.prop)("id",o),dtssPath:c})).then((({total:e})=>{a(e)})).catch((e=>{console.warn(e)}))}),[o,u,c,s]),n})({tenantObject:e,isDataTenant:t});return v().createElement("div",{className:r},(0,ni.k7)(n))};Oh.propTypes={className:dp().string,tenantObject:dp().object.isRequired,isDataTenant:dp().bool};const Sh=Oh;function xh(){return xh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xh.apply(null,arguments)}const Ch={changeCurrentTenant:({tenantObject:e,isDataTenant:t})=>({type:U.Z.CHANGE_CURRENT_TENANT,payload:{tenantObject:e,isDataTenant:t}})},wh=(0,mp.connect)((e=>({dataTenants:k().selectors.getDataTenants(e),customerTenantObject:k().selectors.getTenantObject(e),currentTenant:(0,ai.RO)(e),openAdvancedSearch:(0,Ri.IJ)(e)})),Ch)((({customerTenantObject:e,currentTenant:t,dataTenants:r,changeCurrentTenant:n,openAdvancedSearch:a})=>{const i=vh(),o=(0,_.pipe)((0,_.map)((({id:e,label:t})=>({value:e,label:t}))),(0,_.prepend)({value:e.id,label:e.name}))(r),l=t=>{const n=t!==e.id;return{isDataTenant:n,tenantObject:n?r.find((0,_.propEq)("id",t)):e}},s=t||e.id;return v().createElement("div",{className:i.tenantFacet},v().createElement(Pf,{title:li().text("Tenants"),hasCollapseButton:!1}),v().createElement(hh(),{className:i.radioGroup,value:s,onChange:(0,_.pipe)(xp.NA,l,n)},o.map((({value:e,label:t})=>v().createElement("div",{className:i.tenantContainer,key:e},v().createElement(bh(),{classes:{root:i.radioLabelRoot,label:i.radioLabel},value:e,label:t||e,control:v().createElement(yh(),{className:i.radioButton,color:"primary"})}),!a&&v().createElement(Sh,xh({className:i.total},l(e))))))))})),Ah=(0,wp.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}}),Rh=({variant:e="facetsPanel",searchOptions:t={},dispatch:r})=>{const{root:n,labelRoot:a,checkboxRoot:i,checkboxRootQueryGroups:o}=Ah(),l=t.searchByOv,s=(0,b.useCallback)((()=>{r(D.search.actions.updateSearchOptions({searchByOv:!l,ovOnly:!l}))}),[l,r]),c=li().text("Search by OV only");return v().createElement("div",{className:n,onClick:s},v().createElement(Wp(),{classes:{root:O()(i,{[o]:"queryGroups"===e})},checked:l,color:"primary"}),v().createElement(od.Y,{value:c},v().createElement(bf(),{variant:"body2",classes:{root:a}},c)))};Rh.propTypes={searchOptions:dp().shape({searchByOv:dp().bool,ovOnly:dp().bool}),variant:dp().oneOf(["facetsPanel","queryGroups"]),dispatch:dp().func};const _h=(0,mp.connect)((e=>({searchOptions:k().selectors.getSearchOptions(e)})))(Rh),Ih=(0,wp.Z)({root:{display:"flex",flexDirection:"column",overflow:"auto",height:"100%"}});function Nh(){return Nh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Nh.apply(null,arguments)}const Ph=(0,S.memoizeWith)((e=>e.fieldName),mh.build),Dh=({group:e,configs:t})=>v().createElement(Qf,Nh({},e,{key:e.title}),(e=>e.map((e=>({Facet:Ph(e),id:e.fieldName}))).filter((({Facet:e})=>e)).map((({Facet:e,id:t})=>v().createElement(e,{key:t}))))(t)),kh=(0,mp.connect)((e=>{var t;const r=k().selectors.getDataTenants(e);return{metadata:k().selectors.getMetadata(e),facetsConfigs:(0,P.Mp)(e),uiConfigShowSearchByOv:null!==(t=k().selectors.getShowSearchByOv(e))&&void 0!==t?t:(0,Ri.cC)(e),showTenantFacet:r&&r.length>0,tenant:k().selectors.getTenant(e)}}))((({facetsConfigs:e=[],metadata:t,onScroll:r,uiConfigShowSearchByOv:n,showTenantFacet:a})=>{const{root:i}=Ih(),o=(0,b.useRef)(null),l=(0,b.useCallback)((e=>{r(o.current.scrollTop,e)}),[r]),s=((e,t)=>{const[r,n]=(0,_.partition)(S.isTypeFacet,t),a=[{group:{title:li().text("Entity types"),hasCollapseButton:!1},configs:r},{group:{title:li().text("Attributes"),hasCollapseButton:!1,hasSearchAttributesField:!0},configs:n}];return If(a)})(0,e),c=(0,_.head)(s),u=(0,_.tail)(s),p=o.current,d=(0,b.useMemo)((()=>({element:p,priority:["top","bottom"]})),[p]);return v().createElement("div",{ref:o,className:i,onScroll:l},v().createElement(Rf.p.Provider,{value:d},n&&v().createElement(_h,null),a&&v().createElement(v().Fragment,null,v().createElement(wh,null),v().createElement(Af(),null)),c&&Dh(c),v().createElement(Af(),null),u.map(((e,t)=>v().createElement(Dh,Nh({},e,{key:t}))))))})),Lh=({children:e,className:t})=>v().createElement("div",{className:O()("MainContent-styles-mainContent--Ha5me",t)},e);Lh.propTypes={children:dp().node,className:dp().string};const Uh=Lh;var jh=r(33788);const Fh=(0,wp.Z)({container:{backgroundColor:"#fff",opacity:.37,position:"fixed",width:"100%",height:"100%",top:0,left:0,display:"flex",justifyContent:"center",alignItems:"center"}}),Mh=()=>{const e=(0,mp.useSelector)(Ri.Kv),{container:t}=Fh();return e?v().createElement("div",{className:t},v().createElement(jh.Z,{size:160})):null};var Vh=r(54596),Bh=r.n(Vh),zh=r(49233),Hh=r.n(zh),Yh=r(35206),Wh=r.n(Yh),Gh=r(81733),qh=r.n(Gh),Zh=r(68290),$h=r.n(Zh);const Kh=(0,wp.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 Xh(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qh=()=>{const e=(0,mp.useDispatch)(),t=(0,mp.useSelector)(Ri.v6),r=(0,mp.useSelector)(k().selectors.getAutoCloseInterval),n=t&&t.payload.autoHideDuration||r&&1e3*r||5e3,a=Kh(),i=(0,b.useRef)(null),o=(0,b.useCallback)((()=>{e(Ti())}),[e]);t&&(i.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Xh(e,t,r[t])}))}return e}({},t));const{type:l,payload:s}=i.current||{},{message:c,action:u}=s||{},p=u&&u.actionToDispatch,d=(0,b.useCallback)((()=>{p&&e(p)}),[p,e]),m=(0,b.useMemo)((()=>l===Z.GT.error?v().createElement(Hh(),{key:"close","aria-label":"Close",color:"inherit",className:a.close,onClick:d,size:"large"},v().createElement(Tp(),null)):u?v().createElement(Wh(),{color:"primary",size:"small",onClick:d},u.actionLabel):null),[a,l,u,d]);return v().createElement(qh(),{container:document.body},v().createElement(Bh(),{key:c+l,anchorOrigin:{vertical:"bottom",horizontal:"center"},autoHideDuration:n,open:Boolean(t),onClose:o,ContentProps:{classes:{root:O()(a.snackbar,a[l]),message:a.message}},message:v().createElement("div",{className:a.messageContent},l===Z.GT.error&&v().createElement($h(),{className:a.icon}),c),classes:{anchorOriginBottomCenter:a.anchorSnackBar},action:m}))},Jh=(0,wp.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 eE=r(95641);const tE=(0,wp.Z)((()=>({container:{position:"relative"},panel:{position:"relative"},horizontal:{},vertical:{},disabled:{},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:"ns-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","&$disabled":{background:"transparent"},"&:not($disabled):hover":{cursor:"ew-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%"}}}})));function rE(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){nE(e,t,r[t])}))}return e}function nE(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const aE=e=>"horizontal"===e,iE=(e,t)=>e.toFixed(2)===t.toFixed(2),oE=({className:e,children:t,orientation:r="vertical",primary:n="first",size:a,minSize:i,maxSize:o,allowResize:l,debounceInterval:s=250,onChange:c})=>{const u=tE(),p=(0,wm.useTheme)(),d=(0,b.useRef)(),[m,f]=(0,b.useState)(null),[y,g]=(0,b.useState)(0),[h,E]=(0,b.useState)(0),[T,x]=(0,b.useState)(!0),C=(0,b.useCallback)((()=>x(!0)),[]),w=(0,b.useCallback)((()=>x(!1)),[]),A=(0,b.useCallback)((()=>aE(r)?null==m?void 0:m.clientHeight:null==m?void 0:m.clientWidth),[m,r]);"number"==typeof a&&a<0&&(a=(A()||0)+a);const R=(0,b.useCallback)((e=>"string"==typeof e&&e.endsWith("%")?+e.replace("%",""):("string"==typeof e&&e.endsWith("px")&&(e=e.replace("px","")),isNaN(+e)?null:+e/A()*100)),[A]),_=(0,b.useCallback)(((e,t)=>0===e||100===e?0:R(t)||0),[R]),I=(0,b.useCallback)((()=>{if(m&&d.current){const e=R(a);null==e||isNaN(e)||(E(_(e,o)),g(_(e,i)),d.current.resize(e))}}),[R,_,i,o,a,m]);(0,b.useEffect)((()=>{I()}),[I,h,y]);const N=(0,b.useCallback)((0,S.debounce)((e=>{if(void 0===e)return;const t=A();c({percentageSize:e+"%",isMaxSize:iE(e,+h>0?h:100+h),isMinSize:iE(e,y),size:Math.round(e*t/100)})}),s),[c,h,y,A]),P=(0,b.useCallback)((e=>{e?(N(),w()):(N(d.current.getSize()),C())}),[w,C,N]),D=(0,b.useMemo)((()=>({transition:p.transitions.create("flex",{easing:p.transitions.easing.sharp,duration:p.transitions.duration.leavingScreen})})),[p]),k=rE({className:u.panel,minSize:y},h>0?{maxSize:h}:{},{ref:d,style:T?D:void 0}),L=rE({className:u.panel,style:T?D:void 0},h<0?{minSize:-h}:{});return v().createElement("div",{ref:f,className:O()(u.container,e)},v().createElement(Fp.Z,{handleHeight:aE(r),handleWidth:!aE(r),onResize:I,refreshMode:"debounce",refreshRate:50}),v().createElement(eE.eh,{direction:aE(r)?"vertical":"horizontal"},v().createElement(eE.s_,"first"===n?k:L,t[0]),v().createElement(eE.OT,{className:O()(u.resizer,u[r],{[u.disabled]:!l}),disabled:!l,hitAreaMargins:{coarse:0,fine:0},onDragging:P}),v().createElement(eE.s_,"second"===n?k:L,t[1])))};oE.displayName="ResizablePanes";const lE=(0,wp.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 7px",borderRadius:"2px",fontSize:"13px",fontWeight:500,lineHeight:"16px",marginRight:"16px",flexShrink:0}}),sE=({entity:e,className:t,size:r="small"})=>{const n=lE(),a=(0,w.AH)(),i=(0,S.getEntityType)(a,e.type),o=(i?(0,S.getPropWithInheritance)(a,i,"typeColor"):null)||S.theme.palette.primary.main,l=(0,S.getEntityTypeLabel)(a,e);return v().createElement(od.Y,{value:l,placement:"top"},v().createElement(bf(),{style:{backgroundColor:o,color:S.utils.Colors.getColor(o)?"#FFFFFF":"#212121"},className:O()(n[`entityType-${r}`],n["entityType-overflow"],t),component:"div"},l))},cE=e=>e&&e.scrollIntoView({block:"end",behavior:"smooth"}),uE=e=>{e&&clearTimeout(e)},pE=(e,t)=>{if(e&&t){const r=e.offsetTop,n=e.offsetTop+e.clientHeight,{clientHeight:a,scrollTop:i}=t;return r>=0&&n>i&&n<i+a}};var dE=r(600);const mE=(0,wp.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,wm.alpha)(e.palette.primary.main,.12),"&:hover":{background:(0,wm.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"}}))),fE=({entities:e,entityToHighlight:t,selectedEntityUri:r,onEntityClick:n,onEntityHover:a,entitiesImportStatus:i,entityButtonsRenderer:o})=>{const l=mE(),s=(0,b.useRef)(null),c=(0,b.useRef)(null),u=(0,w.AH)();return(0,dE.D)((()=>{if(t){var e;const n=null===(e=s.current)||void 0===e?void 0:e.querySelectorAll(`[data-entity-uri='${t}']`);if(uE(c.current),(null==n?void 0:n.length)>0){var r;const e=null===(r=s.current)||void 0===r?void 0:r.parentElement;pE(n[0],e)||(cE(n[0]),c.current=setTimeout((()=>{pE(n[0],e)||cE(n[0])}),1e3))}}return()=>{uE(c.current)}}),[t]),v().createElement("div",{ref:s},(e||[]).map((e=>{const s=(0,S.getLabel)(e.label),c=e.secondaryLabel,p=(0,S.getBusinessCardAttributesText)(u,e),d=(0,S.isActiveObject)(e),m=e.uri,f=(0,S.getEntityUriForLink)(e),y=(0,_.prop)(m,i);return v().createElement("div",{key:m,className:O()(l.item,{[l.clickable]:!!n,[l.selected]:m===r,[l.highlighted]:m===t,[l.inactive]:!d,[l.justImported]:y===um.Eh.Success}),onClick:n?()=>n(m):void 0,onMouseEnter:a?()=>a(m):void 0,onMouseLeave:a?()=>a(null):void 0,"data-entity-uri":m},v().createElement(A,{entity:e,avatarClassName:l.avatar,imageClassName:l.image}),v().createElement("div",{className:l.info},v().createElement("div",null,v().createElement(Md,{value:f,className:l.label},s),c&&v().createElement("span",{className:l.secondaryLabel},c," "),p&&v().createElement("span",{className:l.businessCard},p)),v().createElement("div",{className:l.secondRow},v().createElement(sE,{entity:e}),v().createElement("div",null,(0,S.getEntityId)(e)))),o&&o(e))})))};var yE=r(92255);function gE(){return gE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gE.apply(null,arguments)}function hE(){return hE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hE.apply(null,arguments)}function EE(){return EE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},EE.apply(null,arguments)}function bE(){return bE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bE.apply(null,arguments)}const vE=(0,wp.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 TE(){return TE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},TE.apply(null,arguments)}let OE=function(e){return e.full="full",e.embedded="embedded",e.small="small",e}({});const SE={SEARCH_RESULTS:e=>v().createElement("svg",gE({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgEmptySearchResults"},e),v().createElement("defs",null,v().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"},v().createElement("stop",{stopColor:"#00BFFF",stopOpacity:.5,offset:"0%"}),v().createElement("stop",{stopColor:"#9EE8FF",stopOpacity:0,offset:"100%"})),v().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"},v().createElement("stop",{stopColor:"#91F8E5",stopOpacity:.6,offset:"0%"}),v().createElement("stop",{stopColor:"#14F7FF",stopOpacity:0,offset:"100%"})),v().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"},v().createElement("stop",{stopColor:"#FFF",offset:"0%"}),v().createElement("stop",{stopColor:"#73FAFF",stopOpacity:.21,offset:"59.38%"}),v().createElement("stop",{stopColor:"#14F7FF",stopOpacity:0,offset:"100%"})),v().createElement("linearGradient",{x1:"50%",y1:"170.771%",x2:"50%",y2:"10.303%",id:"EmptySearchResults_svg__e"},v().createElement("stop",{stopColor:"#91F8E5",offset:"0%"}),v().createElement("stop",{stopColor:"#99FCFF",stopOpacity:0,offset:"100%"})),v().createElement("filter",{x:"-25.9%",y:"-26.2%",width:"151.8%",height:"152.3%",filterUnits:"objectBoundingBox",id:"EmptySearchResults_svg__d"},v().createElement("feGaussianBlur",{stdDeviation:15,in:"SourceGraphic"})),v().createElement("circle",{id:"EmptySearchResults_svg__a",cx:128,cy:128,r:128})),v().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"EmptySearchResults_svg__b",fill:"#fff"},v().createElement("use",{xlinkHref:"#EmptySearchResults_svg__a"})),v().createElement("use",{fillOpacity:.2,fill:"#A792CD",xlinkHref:"#EmptySearchResults_svg__a"}),v().createElement("g",{mask:"url(#EmptySearchResults_svg__b)"},v().createElement("g",{transform:"translate(56 34)"},v().createElement("g",{opacity:.9,strokeWidth:1,fill:"#FFF"},v().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"}),v().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})),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 45.833)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),v().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"}),v().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}),v().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}),v().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})),v().createElement("rect",{fill:"#645F6D",opacity:.5,x:21.756,y:17.46,width:87.022,height:12.004,rx:6.002}),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 87.302)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),v().createElement("rect",{fill:"#E3EBF4",x:0,y:1.091,width:20.668,height:20.734,rx:10.334}),v().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}),v().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}),v().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})),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 128.77)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),v().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"}),v().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}),v().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}),v().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})))),v().createElement("g",{mask:"url(#EmptySearchResults_svg__b)"},v().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"}),v().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"}),v().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"}),v().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}),v().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"}),v().createElement("g",null,v().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)"}),v().createElement("path",{fill:"url(#EmptySearchResults_svg__e)",opacity:.3,d:"M4 9h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),v().createElement("path",{fill:"url(#EmptySearchResults_svg__f)",opacity:.3,d:"M4 2h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),v().createElement("path",{fill:"url(#EmptySearchResults_svg__g)",d:"M4 9h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),v().createElement("path",{fill:"#FFF",opacity:.196,d:"M212.363 205.344l-1 1.732L60.418 124.52l4.977-8.62z"})),v().createElement("path",{fill:"#76A2B5",d:"M73.112 84.533l-35.5 61.488-.866-.5 35.5-61.488z"}),v().createElement("path",{fill:"#F3F3F3",d:"M80.906 89.033l-35.5 61.488-.866-.5 35.5-61.488z"}),v().createElement("path",{fill:"#538196",d:"M55.112 115.71l-17.5 30.311-.866-.5 17.5-30.31z"})))),SELECT_ATTRIBUTES:e=>v().createElement("svg",hE({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgSelectAttributes"},e),v().createElement("circle",{cx:128,cy:128,r:128,fill:"#0072CE",fillOpacity:.1}),v().createElement("mask",{id:"SelectAttributes_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:256,height:256},v().createElement("circle",{cx:128,cy:128,r:128,fill:"#fff"})),v().createElement("g",{mask:"url(#SelectAttributes_svg__a)"},v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-16 9h256v247H-16V9z",fill:"url(#SelectAttributes_svg__paint0_linear_0_19219)"}),v().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)"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),v().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),v().createElement("circle",{cx:120,cy:106,r:6,fill:"#B6C7DB"}),v().createElement("circle",{cx:120,cy:136,r:6,fill:"#B6C7DB"}),v().createElement("circle",{cx:67,cy:169,r:9,fill:"#B6C7DB"}),v().createElement("circle",{cx:67,cy:199,r:9,fill:"#B6C7DB"}),v().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"}),v().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"}),v().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"}),v().createElement("path",{opacity:.54,fillRule:"evenodd",clipRule:"evenodd",d:"M95.071 77l-3.535 3.535L88 77h7.071z",fill:"#000"}),v().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"}),v().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"})),v().createElement("defs",null,v().createElement("linearGradient",{id:"SelectAttributes_svg__paint0_linear_0_19219",x1:-16,y1:9,x2:-16,y2:256,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:.01}),v().createElement("stop",{offset:1,stopColor:"#F4F4F4"})),v().createElement("linearGradient",{id:"SelectAttributes_svg__paint1_linear_0_19219",x1:266.117,y1:181.111,x2:154.882,y2:77.681,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})))),NO_DATA:e=>v().createElement("svg",EE({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgNoData"},e),v().createElement("defs",null,v().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"NoData_svg__b"},v().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:0,offset:"0%"}),v().createElement("stop",{stopColor:"#F4F4F4",offset:"100%"})),v().createElement("linearGradient",{x1:"69.573%",y1:"86.747%",x2:"38.144%",y2:"33.403%",id:"NoData_svg__d"},v().createElement("stop",{stopColor:"#000",stopOpacity:0,offset:"0%"}),v().createElement("stop",{stopColor:"#000",offset:"100%"})),v().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"NoData_svg__e"},v().createElement("stop",{stopColor:"#EEFBFF",offset:"0%"}),v().createElement("stop",{stopColor:"#0072CE",offset:"100%"})),v().createElement("filter",{x:"-7.7%",y:"-7.5%",width:"115.3%",height:"115%",filterUnits:"objectBoundingBox",id:"NoData_svg__f"},v().createElement("feOffset",{dx:0,dy:2,in:"SourceAlpha",result:"shadowOffsetOuter1"}),v().createElement("feGaussianBlur",{stdDeviation:2,in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),v().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"}),v().createElement("feMerge",null,v().createElement("feMergeNode",{in:"shadowMatrixOuter1"}),v().createElement("feMergeNode",{in:"SourceGraphic"}))),v().createElement("circle",{id:"NoData_svg__a",cx:128,cy:128,r:128})),v().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"NoData_svg__c",fill:"#fff"},v().createElement("use",{xlinkHref:"#NoData_svg__a"})),v().createElement("use",{fillOpacity:.1,fill:"#0072CE",xlinkHref:"#NoData_svg__a"}),v().createElement("path",{fill:"url(#NoData_svg__b)",mask:"url(#NoData_svg__c)",d:"M0 9h256v247H0z"}),v().createElement("g",{mask:"url(#NoData_svg__c)"},v().createElement("g",{transform:"translate(29 37)"},v().createElement("g",{opacity:.9,strokeWidth:1,fill:"#FFF"},v().createElement("path",{fillOpacity:.8,opacity:.5,d:"M14.565 8h228.144v176.476H14.565z"}),v().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"})),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 42.105)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),v().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"}),v().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}),v().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}),v().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})),v().createElement("rect",{fill:"#645F6D",opacity:.5,x:19.986,y:16.04,width:79.944,height:11.028,rx:5.514}),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 80.2)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),v().createElement("rect",{fill:"#E3EBF4",x:0,y:1.003,width:18.987,height:19.048,rx:9.493}),v().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}),v().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}),v().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})),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 118.296)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),v().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"}),v().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}),v().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}),v().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})))),v().createElement("g",{mask:"url(#NoData_svg__c)"},v().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)"}),v().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)"}),v().createElement("g",{filter:"url(#NoData_svg__f)",strokeWidth:1,fill:"none",transform:"translate(70 86)"},v().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"}),v().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"})),v().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"}}),v().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"}}),v().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=>v().createElement("svg",bE({width:88,height:88,viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgError"},e),v().createElement("mask",{id:"Error_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:88,height:88},v().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"})),v().createElement("g",{mask:"url(#Error_svg__a)"},v().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}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().createElement("path",{d:"M21.036 40.178h-5.09a.636.636 0 000 1.272h5.09a.636.636 0 100-1.272z",fill:"#ACACAC"}),v().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"}),v().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"}),v().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"}),v().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"}),v().createElement("path",{d:"M18.915 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#9C6CF0"}),v().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"}),v().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"}),v().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"}),v().createElement("path",{d:"M41.82 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#4DBEE9"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().createElement("path",{d:"M54.968 67.324h-5.09a.636.636 0 000 1.273h5.09a.636.636 0 000-1.273z",fill:"#E9E9E9"}),v().createElement("g",{filter:"url(#Error_svg__filter0_d)"},v().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"})),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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)"}),v().createElement("g",{filter:"url(#Error_svg__filter1_d)"},v().createElement("path",{d:"M57.406 68.063a1.719 1.719 0 100-3.438 1.719 1.719 0 000 3.438z",fill:"#000"})),v().createElement("path",{d:"M57.406 68.063a1.719 1.719 0 100-3.438 1.719 1.719 0 000 3.438z",fill:"#fff"}),v().createElement("g",{filter:"url(#Error_svg__filter2_d)"},v().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"})),v().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"})),v().createElement("defs",null,v().createElement("filter",{id:"Error_svg__filter0_d",x:36.219,y:37.875,width:42.375,height:42.375,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().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"}),v().createElement("feOffset",{dy:2}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().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"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),v().createElement("filter",{id:"Error_svg__filter1_d",x:51.688,y:62.625,width:11.438,height:11.438,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().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"}),v().createElement("feOffset",{dy:2}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().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"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),v().createElement("filter",{id:"Error_svg__filter2_d",x:51.688,y:44.063,width:11.438,height:23.813,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().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"}),v().createElement("feOffset",{dy:2}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().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"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),v().createElement("linearGradient",{id:"Error_svg__paint0_linear",x1:68.438,y1:71.571,x2:60.119,y2:58.801,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:0}),v().createElement("stop",{offset:1})))),LOADING:e=>v().createElement("svg",TE({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgEmptyLoading"},e),v().createElement("circle",{cx:128,cy:128,r:128,fill:"#0072CE",fillOpacity:.03}),v().createElement("mask",{id:"EmptyLoading_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:256,height:256},v().createElement("circle",{cx:128,cy:128,r:128,fill:"#fff"})),v().createElement("g",{mask:"url(#EmptyLoading_svg__a)"},v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-16 9h256v247H-16V9z",fill:"url(#EmptyLoading_svg__paint0_linear_2978_41880)"}),v().createElement("g",{fillRule:"evenodd",clipRule:"evenodd"},v().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"}),v().createElement("path",{d:"M50.371 43.106h255.685V195.71H50.371V43.106z",fill:"url(#EmptyLoading_svg__paint1_linear_2978_41880)"}),v().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"}),v().createElement("path",{d:"M339.015 204.883v4.966H15v-4.966h324.015z",fill:"#D4DCDF"}),v().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)"})),v().createElement("g",{filter:"url(#EmptyLoading_svg__filter0_d_2978_41880)"},v().createElement("rect",{x:81.703,y:99,width:170,height:26,rx:8,fill:"#D1E6FF"}),v().createElement("rect",{x:84.703,y:102,width:164,height:20,rx:5,stroke:"#fff",strokeWidth:6})),v().createElement("g",{filter:"url(#EmptyLoading_svg__filter1_d_2978_41880)"},v().createElement("mask",{id:"EmptyLoading_svg__b",fill:"#fff"},v().createElement("rect",{x:81,y:105,width:108,height:14,rx:2})),v().createElement("rect",{x:81,y:105,width:108,height:14,rx:2,fill:"#61A3F1"}),v().createElement("rect",{x:81,y:105,width:108,height:14,rx:2,stroke:"#4A90E2",strokeWidth:8,mask:"url(#EmptyLoading_svg__b)"})),v().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"}),v().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"}),v().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"}),v().createElement("g",{filter:"url(#EmptyLoading_svg__filter2_ddd_2978_41880)"},v().createElement("path",{fill:"#A0C1D7",d:"M70.703 64h11v8h-11z"}),v().createElement("rect",{x:62,y:59,width:28,height:8,rx:1,fill:"#BDD4E3"}),v().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"}),v().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"}),v().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)"}),v().createElement("circle",{cx:75.94,cy:123.237,r:44.723,fill:"#91B0C2"}),v().createElement("g",{filter:"url(#EmptyLoading_svg__filter3_d_2978_41880)"},v().createElement("circle",{r:42.793,transform:"matrix(-1 0 0 1 75.94 123.237)",fill:"#F7F4FF"})),v().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)"}),v().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)"}),v().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"}),v().createElement("circle",{cx:75.94,cy:123.237,r:2.896,fill:"#EEEBF6"}),v().createElement("circle",{cx:96.211,cy:148.655,r:2.574,fill:"#A0C3D7"}),v().createElement("circle",{cx:107.15,cy:131.924,r:2.574,fill:"#A0C3D7"}),v().createElement("rect",{x:62.427,y:135.592,width:27.027,height:10.039,rx:3,fill:"#A0C3D7"}),v().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)"}),v().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)"}),v().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)"}),v().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)"}),v().createElement("circle",{cx:75.618,cy:155.734,r:2.574,fill:"#A0C3D7"}),v().createElement("circle",{cx:55.026,cy:148.655,r:2.574,fill:"#A0C3D7"}),v().createElement("circle",{cx:44.73,cy:131.924,r:2.574,fill:"#A0C3D7"}),v().createElement("g",{fill:"#A0C3D7"},v().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 96.21 97.363)"}),v().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 107.149 114.094)"}),v().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 75.618 90.284)"}),v().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 55.026 97.363)"}),v().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 44.73 114.094)"})))),v().createElement("defs",null,v().createElement("linearGradient",{id:"EmptyLoading_svg__paint0_linear_2978_41880",x1:-16,y1:9,x2:-16,y2:256,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:.01}),v().createElement("stop",{offset:1,stopColor:"#F4F4F4"})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint1_linear_2978_41880",x1:178.214,y1:43.106,x2:178.214,y2:195.709,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopColor:"#F2F9FB"}),v().createElement("stop",{offset:1,stopColor:"#fff"})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint2_linear_2978_41880",x1:178.497,y1:204.542,x2:178.497,y2:213.991,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopColor:"#90AABF"}),v().createElement("stop",{offset:1,stopColor:"#869DAE"})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint3_linear_2978_41880",x1:154.275,y1:146.574,x2:96.683,y2:91.352,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint4_linear_2978_41880",x1:60.762,y1:143.327,x2:114.747,y2:176.019,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.87}),v().createElement("stop",{offset:1,stopOpacity:.01})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint6_linear_2978_41880",x1:90.287,y1:154.267,x2:68.53,y2:131.301,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint7_linear_2978_41880",x1:100.735,y1:120.288,x2:78.978,y2:97.322,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint8_linear_2978_41880",x1:121.119,y1:112.739,x2:99.362,y2:89.773,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint9_linear_2978_41880",x1:90.166,y1:136.143,x2:68.409,y2:113.177,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})),v().createElement("filter",{id:"EmptyLoading_svg__filter0_d_2978_41880",x:77.703,y:96,width:178,height:34,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().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"}),v().createElement("feOffset",{dy:1}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().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"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),v().createElement("filter",{id:"EmptyLoading_svg__filter1_d_2978_41880",x:77,y:102,width:116,height:22,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().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"}),v().createElement("feOffset",{dy:1}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().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"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),v().createElement("filter",{id:"EmptyLoading_svg__filter2_ddd_2978_41880",x:-13.297,y:28,width:181.534,height:189.17,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().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"}),v().createElement("feMorphology",{radius:4,operator:"erode",in:"SourceAlpha",result:"effect1_dropShadow_2978_41880"}),v().createElement("feOffset",{dy:7}),v().createElement("feGaussianBlur",{stdDeviation:4}),v().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"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),v().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"}),v().createElement("feMorphology",{radius:4,operator:"dilate",in:"SourceAlpha",result:"effect2_dropShadow_2978_41880"}),v().createElement("feOffset",{dy:5}),v().createElement("feGaussianBlur",{stdDeviation:16}),v().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"}),v().createElement("feBlend",{mode:"normal",in2:"effect1_dropShadow_2978_41880",result:"effect2_dropShadow_2978_41880"}),v().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"}),v().createElement("feMorphology",{radius:2,operator:"dilate",in:"SourceAlpha",result:"effect3_dropShadow_2978_41880"}),v().createElement("feOffset",{dy:12}),v().createElement("feGaussianBlur",{stdDeviation:8.5}),v().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"}),v().createElement("feBlend",{mode:"normal",in2:"effect2_dropShadow_2978_41880",result:"effect3_dropShadow_2978_41880"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect3_dropShadow_2978_41880",result:"shape"})),v().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"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().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"}),v().createElement("feOffset",{dy:2}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().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"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),v().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)"},v().createElement("stop",{stopColor:"#CFE8FF"}),v().createElement("stop",{offset:.599,stopColor:"#D1F2F9",stopOpacity:0}))))},xE=({variant:e=OE.full,LogoRenderer:t=SE.SEARCH_RESULTS,text:r,secondaryText:n,buttonTitle:a,onClick:i=_.identity,access:o})=>{const l=vE(),s=o&&a;return v().createElement("div",{className:O()(l.root,l[`root_${e}`])},v().createElement(t,{className:l[`${e}`]}),v().createElement("div",{className:l.textBox},v().createElement(bf(),{variant:"h5",classes:{h5:l.text}},r),n&&v().createElement(bf(),{variant:"subtitle1",classes:{subtitle1:l.secondaryText}},n)),s&&v().createElement(Wh(),{className:l.button,variant:"contained",color:"primary",onClick:i},a))};var CE=r(15503);class wE extends v().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 AE=(0,wp.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 RE=r(46089),_E=r.n(RE);const IE=(0,wp.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,wm.alpha)(e.palette.primary.main,.12),fill:e.palette.primary.main,color:e.palette.primary.main,"&:hover":{backgroundColor:(0,wm.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:{}}))),NE=(0,ld.T)(Wh()),PE=({className:e,classes:t={},modes:r=[],modeId:n,onChange:a})=>{const i=IE();return v().createElement(_E(),{className:e},r.map((({id:e,title:r,tooltipTitle:o,Icon:l,disabled:s})=>{return v().createElement(NE,{disabled:s,showForDisabled:s&&!!o,key:String(e),className:O()(i.button,{[i.current]:n===e},t.button),tooltipTitle:o,onClick:(c=e,()=>a(c)),"data-reltio-id":`reltio-search-mode-${e}`},l&&v().createElement(l,{className:i.icon}),r&&v().createElement("div",{className:i.title},r));var c})))},DE=(0,wp.Z)((()=>({button:{"&.MuiButtonGroup-grouped":{minWidth:"90px",padding:"8px 12px"}}})));function kE(){return kE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kE.apply(null,arguments)}const LE=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",kE({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),v().createElement("defs",null,v().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"})),v().createElement("g",{stroke:"none",strokeWidth:"1"},v().createElement("g",{transform:"translate(.2)"},v().createElement("mask",{id:"svg3365802068b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg3365802068a"})),v().createElement("g",{mask:"url(#svg3365802068b)"},v().createElement("g",null,v().createElement("g",null,v().createElement("path",{d:"M0 0h24v24H0z"})))))))};function UE(){return UE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},UE.apply(null,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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",UE({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),v().createElement("defs",null,v().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"})),v().createElement("g",{stroke:"none",strokeWidth:"1"},v().createElement("g",{transform:"translate(.2)"},v().createElement("mask",{id:"svg4195527304b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg4195527304a"})),v().createElement("g",{mask:"url(#svg4195527304b)"},v().createElement("path",{d:"M0 0h24v24H0z"})))))},FE=e=>{switch(e){case Z.ll.TABLE:return LE;case Z.ll.LIST:return jE;default:return $h()}},ME=[{id:Z.ll.TABLE,tooltipTitle:li().text("Table view"),title:li().text("Table"),Icon:FE(Z.ll.TABLE)},{id:Z.ll.LIST,tooltipTitle:li().text("List view"),title:li().text("List"),Icon:FE(Z.ll.LIST)}],VE=({className:e})=>{const t=DE(),r=(0,mp.useDispatch)(),n=(0,mp.useSelector)(Ri.XM);return v().createElement(PE,{className:e,classes:{button:t.button},modes:ME,modeId:n,onChange:e=>{n!==e&&r((e=>({type:Ae,payload:e}))(e))}})};VE.propTypes={className:dp().string};const BE=VE;var zE=r(81085),HE=r.n(zE),YE=r(48139),WE=r.n(YE);const GE="DATA_TENANTS_UPDATED",qE=e=>t=>({type:e,payload:t}),ZE=(qE(GE),(e=null,t)=>t.type===GE?t.payload||null:e),$E="TENANTS_UPDATED",KE=(qE($E),(e=null,t)=>t.type===$E?t.payload||null:e);let XE=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 QE(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const JE={},eb=(0,_.pipe)(S.normalizeMetadata,S.parseMetadata,S.localizeMetadata),tb=(0,_.map)(S.localizeMetadata),rb=(e=JE,t)=>{switch(t.type){case"METADATA_LOADED":{const{tenant:r,metadata:n}=t.payload;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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){QE(e,t,r[t])}))}return e}({},e,{[r]:eb(n)})}case XE.LOCALIZATION_LOADED:return tb(e);default:return e}};let nb=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.RUN_AUTHORING_TASK_ACTION="RUN_AUTHORING_TASK_ACTION",e}({});const ab=qE(nb.ADD_ATTRIBUTES),ib=qE(nb.ADD_DEFAULT_VALUES),ob=qE(nb.MODIFY_ATTRIBUTE),lb=qE(nb.REMOVE_ATTRIBUTE),sb=qE(nb.ADD_NEXT_PAGE_ATTRIBUTE_VALUES),cb=qE(nb.PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES),ub=qE(nb.REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES),pb=qE(nb.SAVE_PROFILE),db=qE(nb.RUN_AUTHORING_TASK_ACTION),mb=qE(nb.SAVE_DRAFT),fb=qE(nb.PROFILE_SAVED),yb=qE(nb.VALIDATE_PROFILE);let gb=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 hb=qE(gb.DEPENDENT_LOOKUPS_STRUCTURE_SET),Eb=qE(gb.DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED),bb=qE(gb.DEPENDENT_LOOKUPS_EDITORS_BLOCKED),vb=qE(gb.DEPENDENT_LOOKUPS_EDITOR_TOUCHED);let Tb=function(e){return e.MODE_UPDATED="MODE_UPDATED",e.MODE_EDITING_CANCELED="MODE_EDITING_CANCELED",e.MODE_UPDATE_REQUESTED="MODE_UPDATE_REQUESTED",e}({});function Ob(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Sb(e,t,r[t])}))}return e}function Sb(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xb={structure:{},editors:{},initedTypeUris:[]},Cb="SEARCH_RESULTS_SET",wb="KEYWORD_UPDATED",Ab="UPDATE_STATE",Rb="ACTIVITY_FILTER_UPDATED",_b="GLOBAL_FILTER_UPDATED",Ib="SEARCH_OPTIONS_UPDATED",Nb="SET_SEARCH_OPTIONS_CONFIG",Pb="SET_SEARCH_PROVIDER_DATA",Db="SET_SEARCH_NAVIGATION_DATA",kb="UPDATE_SEARCH_NAVIGATION_DATA_FIELDS",Lb=qE(Cb),Ub=qE(wb),jb=qE(Ab),Fb=qE("SAVE_STATE"),Mb=qE(Rb),Vb=qE(_b),Bb=qE(Ib),zb=qE(Nb),Hb=qE(Pb),Yb=qE(Db),Wb=qE(kb),Gb=qE("UPDATE_SEARCH_NAVIGATION_DATA_ON_MERGE"),qb=(0,_.path)(["globalFilter","savedSearchesUris"]),Zb="searchNavigation";function*$b(){const e=yield(0,La.Ys)(iI.selectors.getSearchNavigationData),t=yield(0,La.Ys)(iI.selectors.getSearchProviderData);sessionStorage.setItem(Zb,JSON.stringify({searchNavigationData:e,searchProviderData:t}))}function*Kb(){let e;try{e=JSON.parse(sessionStorage.getItem(Zb))||{}}catch(t){e={}}const{searchNavigationData:t,searchProviderData:r}=e;t&&r&&(yield(0,La.gz)(Hb(r)),yield(0,La.gz)(Yb(t)))}const Xb=[function*(){yield(0,La.Fm)([Db,kb,XE.OPEN_ENTITY],$b)},function*(){yield(0,La.RE)(Kb)}];function Qb(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Jb(e,t,r[t])}))}return e}function Jb(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ev={searchResults:[],keyword:null,searchOptions:{searchByOv:!1,ovOnly:!1},activityFilter:"active",globalFilter:{query:null,savedSearchesUris:[],isMuted:!0},searchProviderData:null,searchNavigationData:null},tv=(e=ev,t)=>{switch(t.type){case Cb:return Qb({},e,{searchResults:t.payload});case wb:{const r=(0,_.pick)(["value","isRawFilter"],t.payload||{});return Qb({},e,{keyword:(0,_.isEmpty)(r)?null:r})}case Ab:return Qb({},ev,{keyword:(0,_.isNil)(t.payload.keyword)||(0,_.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 Rb:return Qb({},e,{activityFilter:t.payload});case _b:return Qb({},e,{globalFilter:(0,S.isEmptyValue)(t.payload)?ev.globalFilter:t.payload});case Ib:return Qb({},e,{searchOptions:Qb({},e.searchOptions,t.payload)});case Nb:{const r=!!t.payload.showSearchByOv;return Qb({},e,{searchOptions:{searchByOv:r,ovOnly:r}})}case Pb:return Qb({},e,{searchProviderData:t.payload});case Db:return Qb({},e,{searchNavigationData:t.payload});case kb:return Qb({},e,{searchNavigationData:Qb({},e.searchNavigationData,t.payload)});case XE.OPEN_ENTITY:{var r;const n=(0,S.removeDtssPrefixFromEntityUri)(t.payload.uri);return"navigation"===t.payload.source||n===(null===(r=e.searchNavigationData)||void 0===r?void 0:r.uri)?e:Qb({},e,{searchNavigationData:null})}default:return e}},rv=({uri:e,source:t=null,screen:r="profile"})=>({type:XE.OPEN_ENTITY,payload:{uri:e,source:t,screen:r}}),nv=({entity:e})=>({type:XE.NEW_ENTITY_SHOWN,payload:{entity:e}}),av=qE(XE.ENTITY_DELETION_FINISHED),iv=qE(XE.OPEN_PERSPECTIVE),ov=e=>({type:XE.SHOW_NOTIFICATION,payload:e}),lv=e=>({type:XE.CLOSE_NOTIFICATION,payload:e}),sv=qE(XE.CLEAR_NOTIFICATIONS),cv=qE(XE.PATHS_SET),uv=qE(XE.UI_PATH_SET),pv=qE(XE.UI_CONFIG_LOADED),dv=qE(XE.NEW_UI_CONFIG_LOADED),mv=qE(XE.LOCALE_ATTRIBUTE_PRESENTATION_LOADED),fv=qE(XE.AUTOCLOSE_INTERVAL_LOADED),yv=qE(XE.SET_PREFER_REACT),gv=qE(XE.NUMBER_FORMAT_UPDATED),hv=(e,t,r)=>({type:XE.OPEN_CONSOLE_APP,payload:{name:e,path:t,query:r}}),Ev=qE(XE.OPEN_APP_FROM_CHOCOLATE_BAR),bv=qE(XE.OPEN_GRAPH),vv=qE(XE.LOCALIZATION_LOADED),Tv=qE(XE.DATE_MASK_UPDATED),Ov=qE(XE.DATE_TIME_MASK_UPDATED),Sv=e=>({type:XE.OPEN_SEARCH,payload:"searchState"in e?e:{searchState:e}}),xv=e=>({type:XE.OPEN_DASHBOARD,payload:e}),Cv=qE(XE.OPEN_HISTORY_EVENT),wv=qE(XE.OPEN_NEW_ENTITY_WITH_AUTHORING),Av=qE(XE.OPEN_PREVIOUS_PAGE),Rv=qE(XE.NAVIGATE),_v=qE(XE.KEYS_SET),Iv=qE(XE.OPEN_PIVOTING_PERSPECTIVE),Nv=qE(XE.ERROR_SET),Pv=qE(XE.DOCUMENTATION_SET),Dv=qE(XE.ADD_DASHBOARD_EXTERNAL_VIEW),kv=qE(XE.SET_USE_SHARED_PREFERENCES);function Lv(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Uv=(0,_.path)(["paths","imagePath"]),jv=(0,_.path)(["paths","exportPath"]),Fv=(0,_.path)(["paths","apiPath"]),Mv=(0,_.path)(["paths","uiPath"]),Vv=(0,_.path)(["paths","reltioPath"]),Bv=(0,_.path)(["paths","dtssPath"]),zv=(0,_.path)(["paths","exportDQPath"]),Hv=(0,_.either)((0,_.path)(["newConfig","properties","workflow","path"]),(0,_.path)(["paths","workflowPath"])),Yv=(0,_.prop)("paths"),Wv=(0,_.path)(["paths","workflowEnvironmentURL"]),Gv=(0,_.path)(["paths","collaborationPath"]),qv=(0,_.path)(["paths","imageServicePath"]),Zv=(0,_.path)(["paths","dvfPath"]),$v=(0,_.path)(["paths","validationServicePath"]),Kv=(0,_.path)(["paths","adminToolsPath"]),Xv=(0,_.path)(["paths","mlDqPath"]),Qv=(0,wc.createSelector)((e=>(0,_.path)(["newConfig","properties","attributes","presentation"])(e)),(()=>S.intl.getLocale()),((e={},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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Lv(e,t,r[t])}))}return e}({},e,(0,S.getSpecialAttributesPresentation)(e,t)))),Jv=(0,_.either)((0,_.path)(["config","com.reltio.plugins.entity.EntityRequestSettings","defaultMaxValues"]),(0,_.path)(["newConfig","properties","entity","maxValuesInResponse"])),eT=(0,_.path)(["numberFormat"]),tT=(0,_.either)((0,_.path)(["newConfig","properties","masks","dateMask"]),(0,_.path)(["dateMask"])),rT=(0,_.path)(["notifications"]),nT=(0,_.either)((0,_.path)(["newConfig","properties","masks","dateTimeMask"]),(0,_.path)(["dateTimeMask"])),aT=(0,_.path)(["newConfig","properties","requestProvider"]),iT=["config","com.reltio.plugins.pivoting.PivotingSettings","pivotingAttributes"],oT=(0,_.chain)((0,_.prop)("attributeTypes")),lT=(0,_.ifElse)((0,_.hasPath)(iT),(0,_.path)(iT),(0,_.pipe)((0,_.pathOr)([],["newConfig","pivoting"]),oT)),sT=(0,_.either)((0,_.path)(["config","com.reltio.plugins.imageattribute.fieldsorder"]),(0,_.path)(["newConfig","properties","image","attributeFieldsOrder"])),cT=(0,_.either)((0,_.path)(["config","com.reltio.plugins.ui.LookupAutocomplete"]),(0,_.path)(["newConfig","properties","lookups","autocomplete"])),uT=(0,_.path)(["keys","googleMapKey"]),pT=(0,_.path)(["keys","icpLicenseKey"]),dT=(0,_.pathOr)("",["documentation","releaseNotes"]),mT=["config","com.reltio.plugins.entity.ValidationServiceLevels","levels"],fT=(0,_.ifElse)((0,_.hasPath)(mT),(0,_.path)(mT),(0,_.path)(["newConfig","properties","validation","levels"])),yT=(0,_.ifElse)((0,_.hasPath)(["config","com.reltio.plugins.entity.Validation","validateReadMode"]),(0,_.path)(["config","com.reltio.plugins.entity.Validation","validateReadMode"]),(0,_.pathOr)(!0,["newConfig","properties","validation","validateReadMode"])),gT=(0,_.pathOr)(!1,["newConfig","properties","validation","validateRelations"]),hT=(0,_.pathOr)(!1,["newConfig","properties","validation","validateReferenceEntityInReadMode"]),ET=(0,_.either)((0,_.path)(["config","com.reltio.plugins.workflow.configuration","enabled"]),(0,_.path)(["newConfig","properties","workflow","enabled"])),bT=(0,_.path)(["error"]),vT=(0,_.path)(["paths","servicesPath"]),TT=(0,_.path)(["newConfig"]),OT=(0,_.path)(["newConfig","layout"]),ST=(0,_.path)(["newConfig","profile"]),xT=(0,_.pathOr)(!0,["newConfig","properties","showEntityId"]),CT=(0,_.path)(["newConfig","properties","release"]),wT=(0,_.path)(["newConfig","properties","logo"]),AT=(0,_.path)(["newConfig","properties","headerColor"]),RT=(0,_.path)(["newConfig","properties","showSearchByOv"]),_T=(0,_.path)(["newConfig","properties","showAttributeDescription"]),IT=(0,_.path)(["newConfig","properties","attributes","sorting"]),NT=(0,_.path)(["newConfig","properties","profileCheckUpdate"]),PT=(0,_.pathOr)(!1,["newConfig","properties","aiAssistant","enabled"]),DT=(0,_.pathOr)(500,["newConfig","properties","aiAssistant","messagesPerDay"]),kT=(0,_.path)(["newConfig","properties","aiAssistant","skills"]),LT=(0,_.path)(["newConfig","properties","aiAssistant","historyBufferSize"]),UT=(0,_.pathOr)(!1,["newConfig","properties","queryEstimator","enabled"]),jT=(0,_.pathOr)(!1,["newConfig","properties","sharedPreferences","enabled"]);function FT(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){MT(e,t,r[t])}))}return e}function MT(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const VT={},BT=(e=VT,t)=>{switch(t.type){case XE.PATHS_SET:return FT({},e,{paths:t.payload});case XE.UI_PATH_SET:return(0,_.evolve)({paths:(0,_.assoc)("uiPath",t.payload)},e);case XE.UI_CONFIG_LOADED:return FT({},e,{config:t.payload});case XE.NEW_UI_CONFIG_LOADED:return FT({},e,{newConfig:t.payload});case XE.LOCALE_ATTRIBUTE_PRESENTATION_LOADED:return(0,_.evolve)({newConfig:{properties:{attributes:{presentation:(0,_.assoc)(S.LOCALE_ATTRIBUTE_PRESENTATION,t.payload)}}}},e);case XE.AUTOCLOSE_INTERVAL_LOADED:return FT({},e,{autoCloseInterval:t.payload});case XE.NUMBER_FORMAT_UPDATED:return FT({},e,{numberFormat:t.payload});case XE.DATE_MASK_UPDATED:return FT({},e,{dateMask:t.payload});case XE.DATE_TIME_MASK_UPDATED:return FT({},e,{dateTimeMask:t.payload});case XE.KEYS_SET:return FT({},e,{keys:t.payload});case XE.ERROR_SET:return FT({},e,{error:t.payload});case XE.DOCUMENTATION_SET:return FT({},e,{documentation:t.payload});case XE.SHOW_NOTIFICATION:return FT({},e,{notifications:[...e.notifications||[],t.payload]});case XE.CLOSE_NOTIFICATION:return(0,_.evolve)({notifications:(0,_.reject)((0,_.propEq)("id",t.payload))},e);case XE.CLEAR_NOTIFICATIONS:return FT({},e,{notifications:[]});case XE.SET_USE_SHARED_PREFERENCES:return FT({},e,{useSharedPreferences:t.payload});default:return e}},zT="USER_UPDATED",HT=(qE(zT),(e=null,t)=>t.type===zT?t.payload||null:e),YT="TENANT_UPDATED",WT="TENANT_NAME_UPDATED",GT=(qE(YT),qE(WT),(0,_.prop)("id")),qT=(0,_.prop)("name");function ZT(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){$T(e,t,r[t])}))}return e}function $T(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const KT=(e=null,t)=>{switch(t.type){case YT:return ZT({},e,{id:t.payload});case WT:return ZT({},e,{name:t.payload});default:return e}},XT="ENVIRONMENT_UPDATED",QT="ENVIRONMENT_ALIAS_UPDATED",JT=(qE(XT),qE(QT),(0,_.prop)("id")),eO=(0,_.prop)("alias");function tO(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){rO(e,t,r[t])}))}return e}function rO(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nO=(e=null,t)=>{switch(t.type){case XT:return tO({},e,{id:t.payload});case QT:return tO({},e,{alias:t.payload});default:return e}},aO=e=>e.dataTenants,iO=e=>e.tenants,oO=(e,t=KS(e))=>e.metadata&&e.metadata[t],lO=e=>e.tenant,sO=e=>e.environment,cO=e=>e.user,uO=e=>e.ui,pO=e=>e.profile,dO=e=>e.search,mO=e=>qA(pO(e)),fO=e=>sR(pO(e)),yO=e=>cR(pO(e)),gO=(e,t)=>hR(pO(e),t),hO=(e,t,r)=>fR(pO(e),t,r),EO=(e,t,r)=>yR(pO(e),t,r),bO=(e,t,r)=>mR(pO(e),t,r),vO=(e,t)=>ER(pO(e),t),TO=e=>bR(pO(e)),OO=(e,t,r)=>gR(pO(e),t,r),SO=e=>QA(pO(e)),xO=e=>$A(pO(e)),CO=e=>dR(pO(e)),wO=e=>YR(pO(e)),AO=e=>WR(pO(e)),RO=e=>GR(pO(e)),_O=e=>qR(pO(e)),IO=e=>ZR(pO(e)),NO=(e,t)=>uR(pO(e),t),PO=(e,t)=>pR(pO(e),t),DO=e=>ZA(pO(e)),kO=(e,t)=>$R(pO(e),t),LO=(e,t,{uri:r})=>IR(pO(e),t,r),UO=(e,t,{uri:r})=>NR(pO(e),t,r),jO=(e,t,r)=>PR(pO(e),t,r),FO=e=>Uv(uO(e)),MO=e=>Fv(uO(e)),VO=e=>jv(uO(e)),BO=e=>Mv(uO(e)),zO=e=>Vv(uO(e)),HO=e=>qv(uO(e)),YO=e=>Kv(uO(e)),WO=e=>Qv(uO(e)),GO=e=>eT(uO(e)),qO=e=>Jv(uO(e)),ZO=e=>(e=>e.autoCloseInterval)(uO(e)),$O=e=>tT(uO(e)),KO=e=>nT(uO(e)),XO=e=>aT(uO(e)),QO=e=>rT(uO(e)),JO=e=>lT(uO(e)),eS=e=>sT(uO(e)),tS=e=>cT(uO(e)),rS=e=>uT(uO(e)),nS=e=>pT(uO(e)),aS=e=>fT(uO(e)),iS=e=>yT(uO(e)),oS=e=>gT(uO(e)),lS=e=>hT(uO(e)),sS=e=>PT(uO(e)),cS=e=>DT(uO(e)),uS=e=>kT(uO(e)),pS=e=>LT(uO(e)),dS=e=>jT(uO(e)),mS=e=>(e=>e.searchResults)(dO(e)),fS=e=>(e=>e.keyword)(dO(e)),yS=e=>S.getActivityFilter(dO(e)),gS=e=>S.getSearchOptions(dO(e)),hS=e=>(e=>e.searchProviderData)(dO(e)),ES=e=>(e=>e.searchNavigationData)(dO(e)),bS=(e,t)=>S.getGlobalSearchRequestOptions(dO(e),t),vS=e=>S.getStringifiedSearchOptions(dO(e)),TS=e=>(e=>e.globalFilter)(dO(e)),OS=e=>S.getGlobalFilterQuery(dO(e)),SS=e=>qb(dO(e)),xS=e=>eR(pO(e)),CS=e=>vR(pO(e)),wS=e=>TR(pO(e)),AS=e=>OR(pO(e)),RS=e=>KA(pO(e)),_S=(e,t)=>SR(pO(e),t),IS=(e,t)=>xR(pO(e),t),NS=(e,t)=>CR(pO(e),t),PS=(e,t,r)=>wR(pO(e),t,r),DS=(e,t,r)=>AR(pO(e),t,r),kS=(e,t,r)=>RR(pO(e),t,r),LS=(e,t)=>_R(pO(e),t),US=e=>Uv(uO(e))||Fv(uO(e)),jS=e=>(e=>null==e?void 0:e.username)(cO(e)),FS=e=>(e=>null==e?void 0:e.roles)(cO(e)),MS=e=>XA(pO(e)),VS=(e,t)=>DR(pO(e),t),BS=(e,t)=>kR(pO(e),t),zS=(e,t)=>LR(pO(e),t),HS=e=>UR(pO(e)),YS=(e,t,r)=>jR(pO(e),t,r),WS=(e,t)=>FR(pO(e),t),GS=e=>tR(pO(e)),qS=e=>nR(pO(e)),ZS=e=>aR(pO(e)),$S=e=>e_(pO(e),EC(e)),KS=e=>GT(lO(e)),XS=e=>qT(lO(e)),QS=e=>JT(sO(e)),JS=e=>eO(sO(e)),ex=e=>Bv(uO(e)),tx=e=>zv(uO(e)),rx=e=>Hv(uO(e)),nx=e=>Yv(uO(e)),ax=e=>Wv(uO(e)),ix=e=>ET(uO(e)),ox=e=>Gv(uO(e)),lx=e=>Zv(uO(e)),sx=e=>$v(uO(e)),cx=e=>Xv(uO(e)),ux=(0,wc.createSelector)(cO,KS,S.canUserRegisterConfigEnvironments),px=(0,wc.createSelector)(cO,KS,S.canUserCreateWorkflowConfigJar),dx=(0,wc.createSelector)(cO,KS,S.canUserCreateWorkflowEnvironmentConfigJar),mx=(0,wc.createSelector)(cO,KS,S.canUserExecuteWorkflowJobs),fx=(0,wc.createSelector)(cO,KS,S.canUserExecuteWorkflowJobsSyncBusinessProcessData),yx=(0,wc.createSelector)(cO,KS,S.canUserExecuteWorkflowJobsTerminateProcessInstance),gx=(0,wc.createSelector)(cO,KS,S.canUserExecuteWorkflowJobsUpdateTasks),hx=(0,wc.createSelector)(cO,KS,S.canUserExecuteWorkflowJobsValidateTasks),Ex=(0,wc.createSelector)(cO,KS,S.canUserManageWorkflowDefinition),bx=(0,wc.createSelector)(cO,KS,S.canUserManageWorkflowEnvironmentDefinition),vx=(0,wc.createSelector)(cO,KS,S.canUserReadWorkflowDataTask),Tx=(0,wc.createSelector)(cO,KS,S.canUserUpdateProcessInstance),Ox=(0,wc.createSelector)(cO,KS,S.canUserUpdateWorkflowDataTask),Sx=(0,wc.createSelector)(cO,KS,S.canUserViewProcessInstanceSearchQuery),xx=(0,wc.createSelector)(cO,KS,S.canUserViewWorkflowConfigJar),Cx=(0,wc.createSelector)(cO,KS,S.canUserViewWorkflowDefinition),wx=(0,wc.createSelector)(cO,KS,S.canUserViewWorkflowEnvironmentConfigJar),Ax=(0,wc.createSelector)(cO,KS,S.canUserViewWorkflowJobs),Rx=(0,wc.createSelector)(cO,KS,S.canUserMakeExport),_x=(0,wc.createSelector)(cO,KS,S.canUserMakeActivitiesExport),Ix=(0,wc.createSelector)(cO,KS,S.canUserImportEntitiesFromDT),Nx=(0,wc.createSelector)(cO,KS,S.canUserReadEntitiesFromDT),Px=(0,wc.createSelector)(cO,KS,S.canUserStartProcessInstanceFromQuery),Dx=(0,wc.createSelector)(cO,KS,S.canUserMakeBulkUpdate),kx=(0,wc.createSelector)(cO,KS,S.canUserDeleteProfiles),Lx=(0,wc.createSelector)(cO,KS,S.canUserOpenDataLoader),Ux=(0,wc.createSelector)(cO,KS,S.canUserGetDQStatistic),jx=(0,wc.createSelector)(cO,KS,S.canUserReadDVF),Fx=(0,wc.createSelector)(ox,_O,((e,t)=>!!e&&!t)),Mx=(0,wc.createSelector)(rx,ix,((e,t)=>!!e&&!!t)),Vx=(e,t)=>{var r;return null===(r=iR(pO(e)))||void 0===r?void 0:r.find((0,_.propEq)("id",t))},Bx=(e,t)=>Boolean(Vx(e,t)),zx=e=>Bx(e,S.SidePanelViewId.Workflow),Hx=e=>Bx(e,S.SidePanelViewId.Discussion),Yx=e=>Bx(e,S.SidePanelViewId.History),Wx=e=>Bx(e,S.SidePanelViewId.DB),Gx=e=>{var t,r;return null!==(t=null===(r=Vx(e,S.SidePanelViewId.DB))||void 0===r?void 0:r.views)&&void 0!==t?t:[]},qx=e=>JA(pO(e)),Zx=e=>MR(pO(e)),$x=(e,t)=>VR(pO(e),t),Kx=e=>BR(pO(e)),Xx=e=>zR(pO(e)),Qx=(e,t)=>HR(pO(e),t),Jx=e=>bT(uO(e)),eC=(e,t)=>{const r=oO(e),n=xS(e),a=mO(e),{nextEntry:i,inRelations:o=[],outRelations:l=[]}=t,s=n===S.Mode.Editing||n===S.Mode.Suggesting,c=n===S.Mode.Suggesting&&(0,S.isTempUri)(null==a?void 0:a.uri),u=EC(e);if(!s||c&&!u||i||!a)return!1;{const e=(0,S.checkMetadataForUpdate)(n,(0,S.getEntityType)(r,a.type)),t=o.concat(l).map((e=>(0,S.getRelationType)(r,e.uri||e))).some((0,_.both)((0,S.checkMetadataForCreate)(n),(0,S.checkMetadataForUpdate)(n)));return e&&t}},tC=(0,wc.createSelector)(mO,wS,RO,wO,S.getProfileEntityWithHistoryDiff),rC=(0,wc.createSelector)(mO,wS,RO,S.getProfileEntityWithoutHistoryDiff),nC=e=>vT(uO(e)),aC=e=>TT(uO(e)),iC=e=>OT(uO(e)),oC=e=>ST(uO(e)),lC=e=>xT(uO(e)),sC=e=>CT(uO(e)),cC=e=>dT(uO(e)),uC=e=>wT(uO(e)),pC=e=>AT(uO(e)),dC=e=>RT(uO(e)),mC=e=>_T(uO(e)),fC=e=>IT(uO(e)),yC=e=>NT(uO(e)),gC=(e,t)=>((e,t)=>(0,S.getAuthoringItemsFromLayoutByEntityType)(ST(e),t))(uO(e),t),hC=(e,t)=>((e,t)=>(0,_.path)(["newConfig","properties","cleanse",t])(e))(uO(e),t),EC=e=>{const t=mO(e),r=gC(e,null==t?void 0:t.type);return!(0,S.isEmptyValue)(r)},bC=e=>UT(uO(e)),vC=e=>oR(pO(e)),TC=e=>lR(pO(e)),OC=(e,t)=>Mx(e)&&Px(e)&&(0,S.checkMetadataPermission)(S.MetadataPermissions.INITIATE_CHANGE_REQUEST,t);let SC=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}({}),xC=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.UPDATE_RELATION_RATING="UPDATE_RELATION_RATING",e}({});var CC=r(51095);const wC=(e,t)=>e.find((0,_.pipe)(S.getRelationUriFromConnection,(0,_.equals)(t))),AC=(e,t)=>(0,_.path)([t,"connections"],e),RC=r.n(CC)()(AC,((e,t)=>(0,_.path)([t,"drafts"],e)),((e,t,r)=>r),((e=[],t={},r)=>{var n;const{addedConnections:a=[],editedConnections:i=[],removedUris:o=[],ignoredRelationData:l=[]}=t,s=(0,_.pipe)(S.getRelationUriFromConnection,_.equals,(0,_.find)(_.__,o)),c=l.map((e=>e.relationUri)),u=(0,_.pipe)(S.getRelationUriFromConnection,_.equals,(0,_.find)(_.__,c)),p=r?(null===(n=e.find((e=>e.entity.entityUri===r)))||void 0===n?void 0:n.connections)||[]:e,d=a.filter((0,_.propEq)("parentEntityUri",r));return d.map(S.markNew).concat(p.filter((e=>!d.some((0,_.pipe)(S.getRelationUriFromConnection,(0,_.equals)((0,S.getRelationUriFromConnection)(e)))))).map((0,_.pipe)((0,_.either)((e=>(0,_.pipe)((0,_.eqBy)(S.getRelationUriFromConnection),(0,_.find)(_.__,i),(0,_.unless)(_.isNil,S.markEdited))(e)),_.identity),(0,_.when)(s,S.markRemoved),(0,_.when)(u,S.markIgnored))))}))(((e,t,r)=>t+r)),_C=(e,t,r)=>{const n=(0,S.getTempRelations)(e,t);return wC(n,r)};function*IC(e){yield(0,La.gw)(0);const t=e.payload,r=yield(0,La.Ys)(oO),n=yield(0,La.Ys)(Zx),a=[t.type],i=yield(0,La.Ys)(Kx),o=(0,S.initDependentLookups)({structure:n,metadata:r,typeUris:a,alreadyAddedTypeUris:i}),l=(0,S.populateDependentLookupsFromEntity)({structure:o,metadata:r,entityOrRelation:t});yield(0,La.gz)(hb(l)),yield(0,La.gz)(Eb(a))}function*NC(e,t){const r=(0,S.getBaseUri)(e);return(0,S.isRelationUri)(r)?yield(0,La.Ys)(EO,t,r):yield(0,La.Ys)(NO,r)}function*PC(e){const{attributeType:t,metadata:r,parentUri:n,viewId:a}=e.payload,i=yield(0,La.RE)(NC,n,a),o=yield(0,La.Ys)(Zx);if(i)if(t){const e=(0,S.findAttributeValuesByTypeUri)(r,i,t.uri).filter((({uri:e})=>e.startsWith(n)))[0],a=(0,S.addValueToDependentLookups)({structure:o,attributeValue:e});yield(0,La.gz)(hb(a))}else{const e=[i.type],t=yield(0,La.Ys)(Kx),n=(0,S.initDependentLookups)({structure:o,metadata:r,typeUris:e,alreadyAddedTypeUris:t}),a=(0,S.populateDependentLookupsFromEntity)({structure:n,metadata:r,entityOrRelation:i});yield(0,La.gz)(hb(a)),yield(0,La.gz)(Eb(e))}}function*DC(e){const t=e.payload,r=yield(0,La.Ys)(oO),n=yield(0,La.Ys)(Zx);let a=n;for(const e of t){const{attributeType:t,parentUri:i,viewId:o}=e;if((0,S.isAttributeTypeInDependentLookups)(n,t.uri)){const e=yield(0,La.RE)(NC,i,o);e&&(a=(0,S.syncAttributeTypeWithDependentLookups)({structure:a,entityOrRelation:e,attrTypeUri:t.uri,metadata:r}))}}a!==n&&(yield(0,La.gz)(hb(a)))}function*kC({structure:e,attributeType:t,value:r}){if((0,S.isReference)(t)&&r){const t=(0,S.getReferencedEntityUriFromAttrValue)(r);if((0,S.isTempUri)(t))return yield(0,La.RE)(FC,e,t)}return e}function*LC({structure:e,uri:t,attributeType:r,value:n}){let a=(0,S.removeValuesFromDependentLookups)({structure:e,uri:t});if(a=yield(0,La.RE)(kC,{structure:a,attributeType:r,value:n}),a=(0,S.addValueToDependentLookups)({structure:a,attributeValue:n}),(0,S.isReference)(r)&&n){const e=(0,S.getReferencedEntityUriFromAttrValue)(n);(0,S.isTempUri)(e)&&(a=yield(0,La.RE)(jC,a,e))}a!==e&&(yield(0,La.gz)(hb(a)))}function*UC(e){yield(0,La.gw)(0);const{attributeType:t,uri:r,viewId:n,silent:a,value:i}=e.payload,o=yield(0,La.Ys)(Zx),l=yield(0,La.RE)(NC,r,n);if(l&&(0,S.isAttributeTypeInDependentLookups)(o,t.uri)){const{value:n,lookupCode:i}=e.payload.value,l=i||n;a||(yield(0,La.rM)(BC,o,{type:t.uri,uri:r,lookupValue:l}));const s=(0,S.addValueToDependentLookups)({structure:o,attributeValue:{type:t.uri,value:l,uri:r}});yield(0,La.gz)(hb(s))}l&&(0,S.isComplexAttribute)(t.type)&&(yield(0,La.RE)(LC,{structure:o,uri:r,attributeType:t,value:i}))}function*jC(e,t){const r=yield(0,La.Ys)(oO),n=yield(0,La.Ys)(NO,t);if(!n)return e;const a=yield(0,La.Ys)(DO),i=(0,S.findRelatedTemporaryEntities)(a,n);let o=e;for(const e of[n,...i])o=(0,S.populateDependentLookupsFromEntity)({structure:o,metadata:r,entityOrRelation:e});return o}function*FC(e,t){const r=yield(0,La.Ys)(NO,t),n=yield(0,La.Ys)(DO),a=(0,S.findRelatedTemporaryEntities)(n,r).map((0,_.prop)("uri"));let i=e;for(const e of[t,...a])i=(0,S.removeValuesFromDependentLookups)({structure:i,uri:e});return i}function*MC(e){const{attributeType:t,uri:r,attributeValue:n,viewId:a}=e.payload,i=yield(0,La.Ys)(Zx),o=(0,S.isAttributeTypeInDependentLookups)(i,t.uri);if(yield(0,La.RE)(NC,r,a)){o&&(yield(0,La.rM)(BC,i,{type:t.uri,uri:r,lookupValue:""}));let e=o||(0,S.isComplexAttribute)(t)?(0,S.removeValuesFromDependentLookups)({structure:i,uri:r}):i;e=yield(0,La.RE)(kC,{structure:e,attributeType:t,value:n}),e!==i&&(yield(0,La.gz)(hb(e)))}}function*VC(e){yield(0,La.gw)(0);const t=yield(0,La.Ys)(Zx),r=yield(0,La.RE)(FC,t,e.payload);yield(0,La.gz)(hb(r))}function*BC(e,t){var r;const n=yield(0,La.Ys)(oO),a=yield(0,La.Ys)(DO),i=yield(0,La.Ys)(NS),o=yield(0,La.Ys)(fO),l=yield(0,La.Ys)(tS),s=yield(0,La.Ys)(Xx),c=yield(0,La.Ys)(vC),u=(0,S.getDependentLookupStateForValueUri)({structure:e,typeUri:t.type,valueUri:t.uri,modifiedEntities:a,connections:i,entityUri:o,config:l,editorsState:s,hiddenAttributes:null!==(r=c[o])&&void 0!==r?r:[]});if(u.length>0){const e=u.map((e=>e.uri));yield(0,La.gz)(bb({uris:e,isBlocked:!0}));try{const e=yield(0,La.RE)(S.cascadeUpdate,u,t);for(const r of e){const{type:e,uri:a,lookupValue:i,displayName:o}=r,l=(yield(0,La.Ys)(LS,(0,S.getBaseUri)(a)))[0],s=yield(0,La.RE)(NC,a,l);s&&(0,S.findAttributeValueByUri)(s,a)&&a!==t.uri&&(yield(0,La.gz)(ob({attributeType:(0,S.findAttributeTypeByUri)(n,e),uri:a,value:{value:o||"",lookupCode:i||""},silent:!0,viewId:l})))}}catch(e){console.warn(e)}yield(0,La.gz)(bb({uris:e,isBlocked:!1}))}}function*zC(e){const t=e.payload.connection,r=(0,S.getEntityUriFromConnection)(t);if((0,S.isTempUri)(r)&&(yield(0,La.Ys)(NO,r))){yield(0,La.qn)(gb.DEPENDENT_LOOKUPS_STRUCTURE_SET);const e=yield(0,La.Ys)(Zx),t=yield(0,La.RE)(jC,e,r);yield(0,La.gz)(hb(t))}}function*HC(e){const t=e.payload.relationUri,r=yield(0,La.Ys)(Zx),n=(0,S.removeValuesFromDependentLookups)({structure:r,uri:t});yield(0,La.gz)(hb(n))}function*YC(e){const t=e.payload.id,r=e.payload.relationUri;if(0===(yield(0,La.Ys)(LS,r)).length){const e=yield(0,La.Ys)(Zx);let n=(0,S.removeValuesFromDependentLookups)({structure:e,uri:r});const a=yield(0,La.Ys)(bO,t),i=wC(a,r),o=(0,S.getEntityUriFromConnection)(i);(0,S.isTempUri)(o)&&(n=yield(0,La.RE)(FC,n,o)),yield(0,La.gz)(hb(n))}}const WC=[function*(){yield(0,La.ib)(SC.MODIFIED_ENTITY_CREATED,IC)},function*(){yield(0,La.ib)(SC.MODIFIED_ENTITY_DELETED,VC)},function*(){yield(0,La.ib)(nb.ADD_DEFAULT_VALUES,PC)},function*(){yield(0,La.ib)(nb.ADD_ATTRIBUTES,DC)},function*(){yield(0,La.ib)(nb.MODIFY_ATTRIBUTE,UC)},function*(){yield(0,La.ib)(nb.REMOVE_ATTRIBUTE,MC)},function*(){yield(0,La.ib)(xC.OPEN_RELATION_EDITOR,zC)},function*(){yield(0,La.ib)(xC.SET_RELATION_TYPE,HC)},function*(){yield(0,La.ib)(xC.CLOSE_RELATION_EDITOR,YC)}];let GC=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.AUTHORING_DCR_RESOLVED="AUTHORING_DCR_RESOLVED",e}({});const qC=(e,t)=>({type:GC.ENTITY_LOADED,payload:{entity:e,silent:t}}),ZC=qE(GC.DEFAULT_PROFILE_PIC_SET),$C=qE(GC.LOAD_ENTITY),KC=qE(GC.ENTITY_CREATION_REQUESTED),XC=qE(GC.ENTITY_CREATION_WITH_AUTHORING_REQUESTED),QC=qE(GC.ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED),JC=qE(GC.AUTHORING_DCR_RESOLVED),ew=qE(GC.ENTITY_REMOVE_REQUESTED),tw=qE(GC.CLONE_ENTITY),rw=qE(GC.CLEAR_ENTITY),nw=e=>null==e?void 0:e.uri,aw=(0,wc.createSelector)((e=>null==e?void 0:e.dataTenant),nw,((e,t)=>(0,S.getEntityUriForLink)({dataTenant:e,uri:t})));function iw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ow={};let lw=function(e){return e.ERRORS_SET="ERRORS_SET",e.REMOVE_ERROR="REMOVE_ERROR",e.ERROR_DEACTIVATED="ERROR_DEACTIVATED",e}({});const sw=qE(lw.ERROR_DEACTIVATED),cw=qE(lw.ERRORS_SET);function uw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pw=[];let dw=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 mw=qE(dw.HISTORY_DIFF_SET),fw=qE(dw.HISTORY_DIFF_CLEARED),yw=qE(dw.HISTORY_EVENT_SET),gw=qE(dw.HISTORY_EVENT_CLEARED),hw=qE(dw.HISTORY_SLICE_SET),Ew=qE(dw.HISTORY_MODE_SET);function bw(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){vw(e,t,r[t])}))}return e}function vw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Tw={mode:S.HistoryMode.Current};let Ow=function(e){return e.PROFILE_LAST_LOADED_TIME_UPDATE="PROFILE_LAST_LOADED_TIME_UPDATE",e}({});qE(Ow.PROFILE_LAST_LOADED_TIME_UPDATE);let Sw=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 xw=qE(Sw.LOOKUPS_LOADED),Cw=qE(Sw.LOOKUPS_FOR_TYPE_RESOLVED),ww=qE(Sw.LOOKUPS_LIST_RESOLVED);function Aw(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Rw(e,t,r[t])}))}return e}function Rw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _w={},Iw=(e,t)=>({type:Tb.MODE_UPDATED,payload:{mode:e,silent:t}}),Nw=qE(Tb.MODE_UPDATE_REQUESTED),Pw=qE(Tb.MODE_EDITING_CANCELED),Dw=S.isSuggestMode,kw=(S.isEditMode,S.isViewMode),Lw=S.isEditableMode,Uw=S.Mode.Viewing,jw=qE(SC.MODIFIED_ENTITY_CREATED),Fw=qE(SC.MODIFIED_ENTITY_DELETED),Mw=qE(SC.MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET),Vw=qE(SC.MODIFIED_ENTITIES_RESET),Bw=qE(SC.CLEANSE_LOADING);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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Hw(e,t,r[t])}))}return e}function Hw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Yw={};function Ww(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Gw(e,t,r[t])}))}return e}function Gw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*qw(e){const{values:t,parentUri:r,attributeTypeUri:n,attributeTypeName:a}=e.payload;let i=t;const o=yield(0,La.Ys)(mO);if(r===o.uri){const e=(0,S.getAttributeSource)(n),r=(0,_.pipe)((0,_.pathOr)([],[e,a]),(0,_.map)((0,_.prop)("uri")))(o),l=(0,_.intersection)(r,t.map((0,_.prop)("uri")));i=t.filter((e=>!l.includes(e.uri)))}i.length&&(yield(0,La.gz)(sb(Ww({},e.payload,{values:i}))))}function*Zw(){return{apiPath:yield(0,La.Ys)(MO),tenant:yield(0,La.Ys)(KS)}}function*$w(e){const{attributeTypeName:t,attributeTypeUri:r}=e.payload,n=yield(0,La.RE)(Zw);try{const a=yield(0,La.RE)(S.getPagedEntity,Ww({},e.payload,n)),i=(0,S.getAttributeSource)(r),o=(0,_.pathOr)([],[i,t],a);yield(0,La.gz)(cb(Ww({},e.payload,{values:o})))}catch(e){console.warn(e),yield(0,La.gz)(Nv((0,S.getRequestErrorMessage)(e,li().text("Something went wrong"))))}}function*Kw(e){var t;const{attributeType:r,value:n,uri:a}=e.payload,i=r.uri,o=(0,S.getBaseUri)(i),l=yield(0,La.Ys)(hC,o);if(!l)return;const s=yield(0,La.Ys)(oO),c=(0,S.getEntityType)(s,o),u=null==c||null===(t=c.cleanseConfig)||void 0===t?void 0:t.infos;if(!u)return;const p=(0,S.getCleanseType)(l,i);if(!(0,S.hasCleanseTypeInEntityType)(p,u))return;const d=(0,S.getCleanseAttributes)(l);if(null!=d&&d.includes(i)){yield(0,La.gz)(Bw({isLoading:!0}));try{const e=yield(0,La.RE)(S.cleanseData,{cleanseType:p.split("/cleanse/infos/")[1],type:o,attributes:{[r.name]:[{type:i,value:n}]}}),t=(0,S.getBaseUri)(a),l=yield(0,La.Ys)(NO,t);if((0,S.hasCleanseStatus)(e))if((0,S.isUnverifiedCleanse)(e))yield(0,La.gz)(Nv((0,_.path)(S.CLEANSE_STATUS_ERROR_PATH,e)));else if(l){const{attributes:r}=e,n=(0,S.prepareCleansedAttributes)(t,r);yield(0,La.gz)(jw(Ww({},l,{attributes:Ww({},l.attributes,n)})))}}catch(e){console.warn(e),yield(0,La.gz)(Nv((0,S.getRequestErrorMessage)(e,li().text("Something went wrong"))))}yield(0,La.gz)(Bw({isLoading:!1}))}}const Xw=[function*(){yield(0,La.ib)(nb.REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES,$w)},function*(){yield(0,La.ib)(nb.PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES,qw)},function*(){yield(0,La.ib)(nb.MODIFY_ATTRIBUTE,Kw)}],Qw=qE(xC.RELATIONS_LOADED),Jw=qE(xC.SECOND_LEVEL_RELATIONS_LOADED),eA=(0,_.curry)(((e,t)=>({type:xC.REMOVE_RELATION,payload:{id:e,relationUri:t}}))),tA=(0,_.curry)(((e,t)=>({type:xC.IGNORE_RELATION,payload:{id:e,ignoredRelationData:t}}))),rA=(0,_.curry)(((e,t)=>({type:xC.ADD_RELATION,payload:{id:e,connection:t}}))),nA=(0,_.curry)(((e,t)=>({type:xC.EDIT_RELATION,payload:{id:e,connection:t}}))),aA=(0,_.curry)(((e,t,r,n)=>({type:xC.UPDATE_RELATION_RATING,payload:{id:e,connection:t,rating:r,user:n}}))),iA=(0,_.curry)(((e,t)=>({type:xC.OPEN_RELATION_EDITOR,payload:{id:e,connection:t}}))),oA=(0,_.curry)(((e,t)=>({type:xC.CLOSE_RELATION_EDITOR,payload:{id:e,relationUri:t}}))),lA=(0,_.curry)(((e,t,r)=>({type:xC.SET_RELATION_TYPE,payload:{id:e,relationUri:t,relationType:r}}))),sA=(0,_.curry)(((e,t,r)=>({type:xC.SET_RELATION_ENTITY,payload:{id:e,relationUri:t,entityInfo:r}}))),cA=(0,_.curry)(((e,t,r)=>({type:xC.SET_INITIAL_INFO,payload:{id:e,relationUri:t,tempEntity:r}})));function uA(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){pA(e,t,r[t])}))}return e}function pA(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const dA={},mA={removedUris:[],addedConnections:[],editedConnections:[],ignoredRelationData:[]},fA=(e,t,r)=>{if((0,_.pathEq)([...(0,S.getRelationToAddPath)(e),"relation","relationUri"],t,r))return(0,S.getRelationToAddPath)(e);{const n=((0,_.path)((0,S.getRelationsToEditPath)(e),r)||[]).findIndex((0,_.pathEq)(["relation","relationUri"],t));return n>=0?[...(0,S.getRelationsToEditPath)(e),n]:null}},yA=(e,t,r)=>{const n=fA(e,t,r);return n?(0,_.lensPath)([...n,"relation"]):null},gA=(0,_.pipe)(yA,(e=>(0,_.compose)(e,(0,_.lensProp)("object"))));let hA=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}({});qE(hA.TREE_LOADED),qE(hA.TREE_LOADED_WITH_ERROR),qE(hA.TREE_LOADING),qE(hA.TREE_SCROLL_TO_NODE_RESET);const EA=qE(hA.TREE_COMMANDS_CLEARED),bA=(qE(hA.TREE_CHILDREN_LOADING),qE(hA.TREE_CURRENT_ENTITY_SHOWN),qE(hA.TREE_REFRESHED),qE(hA.TREE_NODE_EXPANDED),qE(hA.TREE_RELATION_REMOVED),qE(hA.TREE_NODE_REMOVED),qE(hA.TREE_SECONDARY_LABEL_SHOWN),qE(hA.TREE_ENTITIES_MAPPING_LOADED),qE(hA.TREE_CHANGED)),vA=(qE(hA.TREE_NODE_EDITED),qE(hA.TREE_ACTIVENESS_DATE_CHANGED),qE(hA.TREE_RELATION_REPOINTED),qE(hA.TREE_RELATION_CREATED),qE(hA.TREE_NODE_CREATED),qE(hA.TREE_RELATION_EDITED),qE(hA.TREE_NODE_EDITED),qE(hA.TREE_NODE_EDITING_STARTED),qE(hA.TREE_NODE_EDITING_APPLIED),qE(hA.TREE_NODE_EDITING_CANCELED),qE(hA.TREE_NODE_NEW_PARENT_EDITING_STARTED),qE(hA.TREE_NODE_NEW_PARENT_EDITING_APPLIED),qE(hA.TREE_NODE_NEW_PARENT_EDITING_CANCELED),qE(hA.TREE_NODE_NEW_CHILD_EDITING_STARTED),qE(hA.TREE_NODE_NEW_CHILD_EDITING_APPLIED),qE(hA.TREE_NODE_NEW_CHILD_EDITING_CANCELED),qE(hA.TREE_NODE_RELATION_TYPE_CHANGED),qE(hA.TREE_NODE_ENTITY_CHANGED),qE(hA.TREE_SORTED),qE(hA.TREES_STATE_SAVED),qE(hA.TREES_STATE_RESTORED),qE(hA.TREE_CHILDREN_LOADED),qE(hA.TREES_RESTORE_FROM_INITIAL_TREES)),TA=qE(hA.TREES_RESET_INITIAL_TREES),OA=(qE(hA.TREE_CANCEL_CHILDREN_LOADING),(0,_.path)(["common","commands"]));var SA=r(76665);function xA(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){CA(e,t,r[t])}))}return e}function CA(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wA=(e,t,r=[])=>{if((0,_.path)(["entity","uri"],e)===t)return r.forEach((e=>e.expanded=!0)),e;if(e.children)for(const n of e.children){const a=wA(n,t,r.concat(e));if(a)return a}},AA=(e,t)=>{const r=Object.keys(e).reduce(((r,n)=>{const a=e[n];return t[n]&&(a.parent=(0,_.uniq)([].concat(a.parent).concat(t[n].parent).filter(_.identity))),r[n]=a,r}),{});return Object.keys(t).forEach((e=>{r[e]||(r[e]=t[e])})),r},RA=(e,t)=>{if(e&&e.children){const r=e.children.findIndex((({nodeId:e})=>e===t));r>-1&&e.children.splice(r,1)}},_A=(e,t,r=0)=>{e&&e.children&&e.children.splice(r,0,t)},IA=({path:e,value:t,object:r})=>{let n=r;for(let r=0;r<e.length;r++){const a=e[r];r===e.length-1?n[a]="function"==typeof t?t(n[a]):t:(n[a]=n[a]||("number"==typeof a?[]:{}),n=n[a])}},NA=(e={},t,r)=>{e[t]=r,e.children&&e.children.forEach((e=>NA(e,t,r)))},PA=e=>({entity:e.entity,relation:e.relation}),DA=({id:e,draft:t,node:r})=>{IA({path:["editingConnections",r.relation.uri],object:t[e],value:PA(r)})},kA=({id:e,draft:t,node:r,entity:n})=>{IA({path:["editingConnections",r.relation.uri,"entity"],object:t[e],value:n})},LA=({id:e,draft:t,relationUri:r})=>{delete t[e].editingConnections[r]},UA=({id:e,draft:t,relationUri:r})=>t[e].editingConnections[r],jA=e=>{delete e.editingMode,delete e.relatedEntity,delete e.initialConnection},FA=({id:e,draft:t,currentNode:r})=>{const n=t[e].root;if(n===r)t[e].root=r.children[0],t[e].root.children=t[e].root.children||[],t[e].root.children.push(...r.children.slice(1));else{const e=(0,S.findParentNodeById)(n,r.nodeId);RA(e,r.nodeId)}},MA=(e,t,r)=>{const n=[e,"editingConnections",t,"relation"];return(0,_.path)(n,r)?(0,_.lensPath)(n):null},VA=(0,_.pick)(["showSecondaryLabel","sortField","sortOrder"]),BA=e=>({entity:(0,_.pick)(["uri","type","label","secondaryLabel"],e.entity),parent:[],relations:[(0,_.pick)(["uri","type"],e.relation)]});function zA(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){HA(e,t,r[t])}))}return e}function HA(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const YA={common:{commands:[]},trees:{},initialTrees:{}};let WA=function(e){return e.ENTITY_RELATED_ATTRIBUTES_ADDED="ENTITY_RELATED_ATTRIBUTES_ADDED",e}({});qE(WA.ENTITY_RELATED_ATTRIBUTES_ADDED);const GA={},qA=e=>e.entity,ZA=e=>e.modifiedEntities,$A=e=>e.errors,KA=e=>e.relations,XA=e=>e.trees,QA=e=>e.lookups,JA=e=>e.dependentLookups,eR=e=>e.mode,tR=e=>e.lastLoadedTime,rR=e=>e.history,nR=e=>e.operation,aR=e=>e.views,iR=e=>e.sidePanelViews,oR=e=>e.hiddenAttributes,lR=e=>e.controlAttributes,sR=e=>nw(qA(e)),cR=e=>aw(qA(e)),uR=(e,t)=>((e,t)=>t&&e[t])(ZA(e),t),pR=(e,t)=>((e,t)=>t&&e[t]&&e[t].defaultProfilePic)(ZA(e),t),dR=e=>(0,_.keys)(KA(e)),mR=(e,t,r)=>RC(KA(e),t,r),fR=(e,t,r)=>_C(KA(e),t,r),yR=(e,t,r)=>((e,t,r)=>{const n=_C(e,t,r);return(0,S.getRelationObjectFromConnection)(n)})(KA(e),t,r),gR=(e,t,r)=>((e,t,r)=>{const n=(0,_.pipe)((0,_.pathOr)([],[t,"drafts","addedConnections"]),(0,_.filter)((0,_.pipe)(S.getRelationUriFromConnection,S.isTempUri)),(0,_.when)((0,_.always)(r),(0,_.filter)((0,_.propEq)("parentEntityUri",r))),_.length)(e);return((e,t,r)=>r?(0,_.pipe)((0,_.path)([t,"connections"]),(0,_.find)((({entity:e})=>e.entityUri===r)),(0,_.pathOr)(0,["total"]))(e):(0,_.pathOr)(0,[t,"total"],e))(e,t,r)+n})(KA(e),t,r),hR=(e,t)=>AC(KA(e),t),ER=(e,t)=>S.getDraftsForSaveByViewId(KA(e),t),bR=e=>(e=>(0,_.keys)(e).reduce(((t,r)=>{const{addedConnections:n,editedConnections:a}=(0,S.getDraftsForSaveByViewId)(e,r);return(0,_.pipe)(_.concat,(0,_.map)(S.getEntityUriFromConnection),(0,_.filter)(S.isTempUri),(0,_.concat)(t))(n,a)}),[]))(KA(e)),vR=e=>Lw(eR(e)),TR=e=>kw(eR(e)),OR=e=>Dw(eR(e)),SR=(e,t)=>S.getRelationToAddByViewId(KA(e),t),xR=(e,t)=>S.getRelationsToEditByViewId(KA(e),t),CR=(e,t)=>S.getAllRelationsToAddAndEdit(KA(e),t),wR=(e,t,r)=>S.getAllRelationsToSave(KA(e),t,r),AR=(e,t,r)=>S.getInitialConnectionTempEntity(e.relations,t,r),RR=(e,t,r)=>S.getInitialConnection(e.relations,t,r),_R=(e,t)=>((e,t)=>Object.keys(e).filter((r=>{const n=(0,S.getTempRelations)(e,r);return!!wC(n,t)})))(KA(e),t),IR=(e,t,r)=>((e,t,r)=>(0,_.pipe)((0,_.filter)((0,_.allPass)([(0,_.propEq)("parentUri",t),(0,_.propEq)("attributeTypeUri",r),(0,_.pipe)((0,_.prop)("uri"),_.isEmpty)])),(0,_.map)((0,_.prop)("message")),(0,_.join)(". "))(e))($A(e),t,r),NR=(e,t,r)=>((e,t,r)=>(0,_.filter)((0,_.allPass)([(0,_.propEq)("parentUri",t),(0,_.propEq)("attributeTypeUri",r),(0,_.pipe)((0,_.prop)("uri"),_.isEmpty,_.not)]))(e))($A(e),t,r),PR=(e,t,r)=>S.getCachedActiveErrorsForAttributesPager($A(e),t,r),DR=(e,t)=>((e,t)=>e.trees[t])(XA(e),t),kR=(e,t)=>((e,t)=>(0,_.path)(["trees",t,"root"],e))(XA(e),t),LR=(e,t)=>((e,t)=>(0,_.path)(["trees",t,"total"],e))(XA(e),t),UR=e=>OA(XA(e)),jR=(e,t,r)=>((e,t,r)=>(0,_.path)(["trees",t,"editingConnections",r],e))(XA(e),t,r),FR=(e,t)=>((e,t)=>(0,_.pipe)((0,_.prop)("trees"),(0,_.when)((0,_.always)(t),(0,_.pick)(t)),_.values,(0,_.map)((0,_.pipe)((0,_.prop)("editingConnections"),_.values)),_.flatten,(0,_.reject)(_.isNil))(e))(XA(e),t),MR=e=>(e=>e.structure)(JA(e)),VR=(e,t)=>S.getDependentLookupsStructureNode(JA(e),t),BR=e=>(e=>e.initedTypeUris)(JA(e)),zR=e=>(e=>e.editors)(JA(e)),HR=(e,t)=>S.getDependentLookupEditorState(JA(e),t),YR=e=>(e=>e.diff)(rR(e)),WR=e=>(e=>e.event)(rR(e)),GR=e=>(e=>e.slice)(rR(e)),qR=e=>(e=>!(0,S.isEmptyValue)(e.slice))(rR(e)),ZR=e=>(e=>e.mode)(rR(e)),$R=(e,t)=>((e,t)=>e[t])((e=>e.entityRelatedAttributes)(e),t),KR=(0,wc.createSelector)(qA,(e=>uR(e,sR(e))),((e,t)=>!(!e||!t||(0,S.isEmptyValue)((0,S.collectAllDiffs)(e,t,!0))))),XR=(0,wc.createSelector)(XA,(e=>{const t=OA(e),r=(0,S.getNotAppliedTreeCommands)((0,_.reject)((0,_.propSatisfies)(S.isEmptyValue,"root"),e.trees));return!(0,S.isEmptyValue)(t)||!(0,S.isEmptyValue)(r)})),QR=(0,wc.createSelector)(KA,(e=>(0,_.keys)(e).reduce(((t,r)=>t||!(0,_.all)(S.isEmptyValue)((0,_.values)(S.getDraftsForSaveByViewId(e,r)))),!1))),JR=(0,wc.createSelector)(KR,QR,XR,((e,t,r)=>e||t||r)),e_=(0,wc.createSelector)(eR,qA,JR,((e,t)=>t),((e,t,r,n)=>!(e===S.Mode.Viewing||!t)&&((0,S.isTempUri)(t.uri)&&!n||r)));let t_=function(e){return e.PROFILE_OPERATION_UPDATE="PROFILE_OPERATION_UPDATE",e}({});const r_=qE(t_.PROFILE_OPERATION_UPDATE),n_=({metadata:e,modifiedEntities:t,connections:r=[],errors:n})=>n.filter((({attributeType:e,type:t})=>e&&!(0,S.isRequired)(e)&&t===S.ErrorType.missed)).filter((({attributeType:n,parentUri:a})=>{const i=(0,S.getBaseUri)(a),o=(0,S.isEntityUri)(a)?t[i]:(0,S.findConnectionRelationObjectByRelationUri)(r,i),l=o&&(0,S.findAttributeValuesByTypeUri)(e,o,n.uri,!0);return null==l?void 0:l.some((({parent:e,attrValues:t})=>e.uri===a&&0===t.length))})).map((({attributeType:e,parentUri:t})=>({attributeType:e,parentUri:t}))),a_=e=>(0,S.getProfileViewsIdsByTypes)(e,[S.ProfileViewType.Relations,S.ProfileViewType.RelationsTable]);function i_(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){o_(e,t,r[t])}))}return e}function o_(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*l_(){const e=yield(0,La.Ys)(iI.selectors.getEntity),t=yield(0,La.Ys)(iI.selectors.getMode),r=yield(0,La.Ys)(iI.selectors.getEntityUri),n=yield(0,La.Ys)(iI.selectors.getMetadata),a=yield(0,La.Ys)(iI.selectors.getModifiedEntity,r),i=yield(0,La.Ys)(iI.selectors.getModifiedEntities),o=yield(0,La.Ys)(iI.selectors.getProfileViews);return{entity:e,modifiedEntity:t===S.Mode.Viewing?e:a,entityUri:r,metadata:n,modifiedEntities:t===S.Mode.Viewing?{[r]:e}:i,profileViews:o,mode:t}}function*s_(){return i_({},yield(0,La.RE)(l_),{validationServicePath:yield(0,La.Ys)(iI.selectors.getValidationServicePath),tenant:yield(0,La.Ys)(iI.selectors.getTenant),severity:yield(0,La.Ys)(iI.selectors.getValidationServiceSeverityLevels)})}function*c_(){const{entityUri:e,metadata:t,modifiedEntities:r,modifiedEntity:n,profileViews:a}=yield(0,La.RE)(l_);if(!e)return[];const i=a_(a),o=(0,S.getProfileViewsIdsByTypes)(a,[S.ProfileViewType.HierarchyTree]),l=yield(0,La.Ys)(PS,i,!0),s=yield(0,La.Ys)(iI.selectors.getRelations),c=yield(0,La.Ys)(iI.selectors.getAllTreesEditingConnections,o);return[...(0,S.validateEntityLocally)(t,r,n,(0,S.isAvailableAttributeTypeForProfile)(a)),...l.flatMap((e=>(0,S.validateConnection)(t,r,e))),...c.flatMap((e=>(0,S.validateHierarchyConnection)(t,e)))].map((n=>i_({},n,{path:(0,S.evaluateErrorPath)({entityUri:e,metadata:t,connections:l,entitiesMap:r,relationsState:s,relationViewsIds:i},n.uri||n.parentUri)})))}function*u_(){const{entityUri:e,metadata:t,modifiedEntity:r,mode:n,validationServicePath:a}=yield(0,La.RE)(s_);if(a&&e&&(0,S.shouldUseValidationService)(t,null==r?void 0:r.type)){const r=yield(0,La.RE)((0,S.isTempUri)(e)?d_:m_),{modifiedEntities:a}=yield(0,La.RE)(l_),i=(0,_.pipe)(S.convertValidationServiceErrors,(0,_.uniqBy)(S.getErrorUniqKey))(r,{entityUri:e,metadata:t,entitiesMap:a});if(n!==S.Mode.Viewing){const e=n_({metadata:t,modifiedEntities:a,errors:i});e.length&&(yield(0,La.gz)(ab(e)))}return i}return[]}function p_(e){return console.warn("Validation service error",e),[]}function*d_(){const{mode:e,modifiedEntity:t,modifiedEntities:r,validationServicePath:n,tenant:a,severity:i}=yield(0,La.RE)(s_),o=(0,S.prepareEntityForValidation)(t,r);try{return yield(0,La.RE)(S.validateEntity,{validationServicePath:n,entity:o,tenant:a,severity:i,options:(0,_.reject)(_.isNil,[S.ValidationServiceOption.preserveURIs,e===S.Mode.Editing?S.ValidationServiceOption.validateDataPermissions:null])})}catch(e){return p_(e)}}function*m_(){var e;const{entityUri:t,mode:r,entity:n,modifiedEntity:a,modifiedEntities:i,validationServicePath:o,metadata:l,tenant:s,severity:c}=yield(0,La.RE)(s_),u=yield(0,La.Ys)(iI.selectors.getValidateReferenceEntityInReadMode),p=(0,S.getEntityType)(l,n.type),d=null===(e=null==p?void 0:p.forceOvForUiUpdates)||void 0===e||e,m=r===S.Mode.Viewing?[]:(0,S.collectDiffForValidation)(n,a,i,d);try{return yield(0,La.RE)(S.validateEntityChanges,{validationServicePath:o,uri:t,diff:m,tenant:s,severity:c,options:(0,_.reject)(_.isNil,[S.ValidationServiceOption.preserveURIs,S.ValidationServiceOption.updateAttributeUpdateDates,r===S.Mode.Editing?S.ValidationServiceOption.validateDataPermissions:null,r===S.Mode.Viewing&&u?S.ValidationServiceOption.validateReferenceEntityAttribute:null])})}catch(e){return p_(e)}}function*f_(){const{entityUri:e,metadata:t,mode:r,modifiedEntity:n,modifiedEntities:a,validationServicePath:i,tenant:o,severity:l,profileViews:s}=yield(0,La.RE)(s_),c=yield(0,La.Ys)(iI.selectors.getValidateRelations);if(i&&c){const c=a_(s),u=(yield(0,La.Ys)(PS,c)).filter((e=>(0,S.shouldUseValidationService)(t,e.relation.relationType)));if(u.length>0){let s=[];const p=(0,S.prepareConnectionsForValidation)(u,n,a,t);try{const e=yield(0,La.RE)(S.validateRelations,{validationServicePath:i,body:p,tenant:o,severity:l,options:(0,_.reject)(_.isNil,[S.ValidationServiceOption.preserveURIs,r===S.Mode.Editing?S.ValidationServiceOption.validateDataPermissions:null])});s=Object.values(e.validated).flat()}catch(e){return p_(e)}const d=yield(0,La.Ys)(iI.selectors.getModifiedEntities),m=yield(0,La.Ys)(iI.selectors.getRelations),f=(0,_.pipe)(S.convertValidationServiceErrors,(0,_.uniqBy)(S.getErrorUniqKey))(s,{entityUri:e,metadata:t,entitiesMap:d,connections:u,relationsState:m,relationViewsIds:c}),y=n_({metadata:t,modifiedEntities:d,connections:u,errors:f});return y.length&&(yield(0,La.gz)(ab(y))),f}}return[]}function*y_(){const e=yield(0,La.RE)(c_),[t,r]=yield(0,La.$6)([(0,La.RE)(u_),(0,La.RE)(f_)]),n=(0,_.uniqBy)(S.getErrorUniqKey,[...e,...t,...r]),a=yield(0,La.Ys)(iI.selectors.getEntityUri),i=yield(0,La.Ys)(iI.selectors.getHiddenAttributes),o=(null==i?void 0:i[a])||[],l=(0,S.filterErrorsForHiddenAttributes)(n,o);return yield(0,La.gz)(cw(n)),0===l.filter(S.isCriticalError).length}let g_=function(e){return e.PROFILE_VIEWS_SET="PROFILE_VIEWS_SET",e}({});const h_=qE(g_.PROFILE_VIEWS_SET);function E_(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){b_(e,t,r[t])}))}return e}function b_(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(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,La.Ys)(iI.selectors.getMetadata),r=yield(0,La.Ys)(iI.selectors.getMode);switch(e.type){case xC.OPEN_RELATION_EDITOR:{const{id:n,connection:a}=e.payload;a.relation.relationType&&(yield(0,La.gz)(ib({viewId:n,metadata:t,mode:r,parentUri:a.relation.object.uri})));break}case nb.ADD_ATTRIBUTES:{const n=e.payload;for(const e of n){const{attributeType:n,parentUri:a,viewId:i}=e;(0,S.isComplexAttribute)(n)&&(yield(0,La.gz)(ib({viewId:i,attributeType:n,parentUri:a,metadata:t,mode:r})))}break}case xC.SET_RELATION_TYPE:{const{id:n,relationUri:a}=e.payload;yield(0,La.gz)(ib({viewId:n,metadata:t,mode:r,parentUri:a}));break}case hA.TREE_NODE_RELATION_TYPE_CHANGED:{var n;const{id:a,node:i}=e.payload;yield(0,La.gz)(ib({viewId:a,metadata:t,mode:r,parentUri:null==i||null===(n=i.relation)||void 0===n?void 0:n.uri}));break}}}function*T_(e,t=null){const r=yield(0,La.Ys)(MS),n=(0,S.getNotAppliedTreeCommands)(null==r?void 0:r.trees),a=yield(0,La.Ys)(HS),i=(0,S.optimizeCommands)([...a,...n]);if(null!=i&&i.length){const r=(0,_.when)((0,_.always)(t),(0,S.replaceTempUriInCommands)(t))(i);yield(0,La.RE)(e,r),yield(0,La.gz)(EA())}}function*O_(e){var t;const r=yield(0,La.Ys)(mO),n=yield(0,La.Ys)(fO),a=yield(0,La.Ys)(NO,n),i=yield(0,La.Ys)(oO),o=(0,S.getEntityType)(i,r.type),l=null===(t=null==o?void 0:o.forceOvForUiUpdates)||void 0===t||t,s=(0,S.collectAllDiffs)(r,a,l);return(0,S.prepareAttrDiff)(e,s)}function*S_(e){const t=yield(0,La.Ys)(TO),r=yield(0,La.Ys)(DO),n=yield(0,La.Ys)(fO),a=yield(0,La.Ys)(NO,n),i=(0,S.findAllTemporaryRefEntityURI)(a),o=(0,_.concat)(i,t);return yield(0,La.RE)(S.saveTemporaryEntities,r,o,e)}function*x_(e,t,r){const n=e.getDCRObjectUris(),a=yield(0,La.Ys)(rx),i=yield(0,La.Ys)(ax),o=yield(0,La.Ys)(KS);if(null!=n&&n.length){const l=yield(0,La.RE)(S.startProcessInstance,{workflowPath:a,processType:t?"authoring":"dataChangeRequestReview",objectURIs:(0,_.uniq)([r,...n,e.getDCRUri()]).filter((0,_.complement)(_.isNil)),tenant:o,environment:i});"OK"!==(null==l?void 0:l.status)&&console.warn(l)}}function*C_(e,t,r,n){const a=yield(0,La.Ys)(vO,r),i=yield(0,La.Ys)(iI.selectors.getUserName),o=(0,S.createRelationsCommandsFromConnections)(a,n,t,i);o.length&&(yield(0,La.RE)(e,o))}function*w_(e,t,r){const n=yield(0,La.Ys)(CO),a=yield(0,La.Ys)(fO);for(const i of n)yield(0,La.rM)(C_,e,r||a,i,t)}function*A_(e){if(!e.hasNewUri())return;const t=yield(0,La.Ys)(MS);for(const[r,n]of Object.entries(t.trees))if(n.root){const t=t=>(0,_.when)((0,_.prop)("uri"),(0,_.assoc)("uri",e.getUri(null==t?void 0:t.uri)))(t),a=(0,S.mapTree)(n.root,{nodeProcessing:e=>(0,_.pipe)((e=>E_({},e)),(0,_.unless)((0,_.has)("editingMode"),(0,_.evolve)({relation:t,relations:(0,_.map)(t)})))(e)});(0,_.equals)(n.root,a)||(yield(0,La.gz)(bA({id:r,tree:a})))}}function*R_(){try{var e;const t=yield(0,La.Ys)(AS),{commandExecutor:r,dcrProcessor:n,relationUriProcessor:a}=(0,S.createCommandExecutor)({alwaysCreateDCR:t,dcrUri:null}),i=yield(0,La.RE)(S_,n);yield(0,La.$6)([(0,La.RE)(T_,r),(0,La.RE)(w_,r,i)]),yield(0,La.RE)(A_,a);const o=yield(0,La.RE)(O_,i),l=yield(0,La.Ys)(fO),s=yield(0,La.Ys)(iI.selectors.getMetadata),c=(0,S.hasAttributeMasking)(s);let u;if(null!=o&&o.length&&(u=yield(0,La.RE)(S.entityCumulativeUpdate,{uri:l,diff:o,uriPreprocessor:n.enhanceUriWithDCR,sendMasked:c})),t||(0,S.isChangeRequestUri)(null===(e=u)||void 0===e?void 0:e.uri))u&&n.updateDCRUriFromResponse(u),yield(0,La.RE)(x_,n,!1,l),yield(0,La.gz)(vA()),c&&(yield(0,La.RE)(j_,!0)),window.alert(li().text("Your changes are saved as pending and have been sent for review"));else if(u){yield(0,La.gz)(qC(u));const{trees:e}=yield(0,La.Ys)(iI.selectors.getTrees),t=(0,S.updateTreesWithNewEntity)((0,_.pick)(["uri","label","secondaryLabel","type"],u),e);for(const e of t)yield(0,La.gz)(bA({id:e.id,tree:e.root}))}else!u&&c&&(yield(0,La.RE)(j_,!0));yield(0,La.gz)(Iw(S.Mode.Viewing)),yield(0,La.gz)(fb())}catch(e){yield(0,La.gz)(Nv((0,S.getRequestErrorMessage)(e,li().text("Something went wrong"))))}}function*__(){yield(0,La.qn)(GC.ENTITY_LOADED),yield(0,La.gz)(fb())}function*I_(e,t){const r=yield(0,La.Ys)(fO),n=yield(0,La.Ys)(iI.selectors.getModifiedEntity,r),{commandExecutor:a,dcrProcessor:i}=(0,S.createCommandExecutor)({alwaysCreateDCR:t,dcrUri:e}),o=yield(0,La.RE)(S_,i),l=yield(0,La.RE)(S.saveTemporaryEntity,n,o,i);return yield(0,La.$6)([(0,La.RE)(T_,a,{[r]:l}),(0,La.RE)(w_,a,o,l)]),{savedEntityUri:l,dcrProcessor:i}}function*N_(){const e=yield(0,La.Ys)(fO),t=yield(0,La.Ys)(iI.selectors.getModifiedEntity,e);if((0,S.isEmptyEntity)(t)){const e=(0,Ge.x0)();return yield(0,La.gz)(ov({id:e,text:li().text("Please fill out some fields."),actions:[]})),!1}return!0}function*P_(){try{const e=yield(0,La.Ys)(AS);if(!(yield(0,La.RE)(N_)))return;const{dcrProcessor:t,savedEntityUri:r}=yield(0,La.RE)(I_,null,e);e&&(yield(0,La.RE)(x_,t),window.alert(li().text("Your changes are saved as pending and have been sent for review"))),yield(0,La.gz)(Iw(S.Mode.Viewing)),e?(yield(0,La.gz)(iv()),yield(0,La.gz)(rw())):(yield(0,La.gz)(rv({uri:r})),yield(0,La.rM)(__))}catch(e){yield(0,La.gz)(Nv((0,S.getRequestErrorMessage)(e,li().text("Something went wrong"))))}}function*D_(e){const t=yield(0,La.RE)(S.getDataChangeRequest,e),r=(0,_.pipe)((0,_.prop)("changes"),_.values,_.flatten,(0,_.pluck)("id"))(t);try{yield(0,La.$6)(r.map((t=>(0,La.RE)(S.deleteChangeRequestItem,{dcrUri:e,changeItemId:t}))))}catch(e){yield(0,La.gz)(Nv((0,S.getRequestErrorMessage)(e,li().text("Something went wrong"))))}}function*k_(e){const{dcrUri:t,action:r,taskId:n}=e.payload;try{if(!(yield(0,La.RE)(N_)))return;if(yield(0,La.gz)(r_(S.Operation.Saving)),yield(0,La.RE)(D_,t),yield(0,La.RE)(I_,t,!0),"Approve"!==r||(yield(0,La.RE)(y_))){const e=yield(0,La.Ys)(rx),t=yield(0,La.Ys)(ax),a=yield(0,La.Ys)(KS);yield(0,La.RE)(S.runTaskAction,{workflowPath:e,environment:t,tenant:a,taskId:n,action:r}),yield(0,La.gz)(JC())}}catch(e){const t=null==e?void 0:e.error;if((null==t?void 0:t.errorCode)===S.ApiErrorCode.WORKFLOW_IS_NOT_REGISTERED_ERROR)return;yield(0,La.gz)(Nv((0,S.getRequestErrorMessage)(t||e,li().text("Something went wrong"))))}yield(0,La.gz)(r_(null))}function*L_(e){const{dcrUri:t,userAction:r}=e.payload,n=yield(0,La.Ys)(xS);try{if(!(yield(0,La.RE)(N_)))return;yield(0,La.gz)(Iw("saveDraft"===r?S.Mode.Suggesting:S.Mode.Editing,!0)),yield(0,La.gz)(r_(S.Operation.Saving));const e=yield(0,La.RE)(y_);if("saveDraft"===r){if(t)yield(0,La.RE)(D_,t),yield(0,La.RE)(I_,t,!0);else{const{dcrProcessor:e}=yield(0,La.RE)(I_,null,!0);yield(0,La.RE)(x_,e,!0);const t=e.getDCRUri();yield(0,La.gz)(Rv({url:"../authoring",searchParams:{entityUri:`${t}`},options:{replace:!0,state:{keepErrors:!0}}}))}window.alert(li().text("Your changes are saved as pending and have been sent for review"))}else if(e){const{savedEntityUri:e}=yield(0,La.RE)(I_,null,!1);yield(0,La.gz)(Iw(S.Mode.Viewing)),yield(0,La.gz)(rv({uri:e})),yield(0,La.rM)(__)}else e||(yield(0,La.gz)(Iw(n,!0)))}catch(e){yield(0,La.gz)(Iw(n,!0)),yield(0,La.gz)(Nv((0,S.getRequestErrorMessage)(e,li().text("Something went wrong"))))}yield(0,La.gz)(r_(null))}function*U_(){if(yield(0,La.gz)(r_(S.Operation.Saving)),yield(0,La.RE)(y_)){const e=yield(0,La.Ys)(fO);(0,S.isTempUri)(e)?yield(0,La.RE)(P_):yield(0,La.RE)(R_)}yield(0,La.gz)(r_(null))}function*j_(e){try{let t;if(e){const e=yield(0,La.Ys)(iI.selectors.getMetadata);t=(0,S.addMetadataSpecificGetEntityOptions)(e)}yield(0,La.gz)(r_(S.Operation.Fetching));const r=yield(0,La.Ys)(fO),n=yield(0,La.RE)(S.getEntity,r,t);if(!n)throw new Error("Failed to request entity");return yield(0,La.gz)(qC(n,!0)),n}catch(e){throw yield(0,La.gz)(Nv((0,S.getRequestErrorMessage)(e,li().text("Something went wrong")))),e}finally{yield(0,La.gz)(r_(null))}}function*F_(e){const{mode:t,silent:r}=e.payload;r||(yield M_({mode:t}))}function*M_({mode:e,overwrite:t=!1}){const r=yield(0,La.Ys)(iI.selectors.getEntity),n=yield(0,La.Ys)(iI.selectors.getMetadata),a=yield(0,La.Ys)(iI.selectors.getModifiedEntity,null==r?void 0:r.uri);if((t||!a)&&e!==S.Mode.Viewing&&r&&n){const t=yield(0,La.Ys)(iI.selectors.getProfileViews),a=yield(0,La.Ys)(iI.selectors.getUIConfig),i=yield(0,La.Ys)(iI.selectors.getUserRoles),o=(0,S.addToEntityRequiredAttributes)({entity:r,metadata:n,mode:e,attrTypeFilter:(0,_.both)((0,S.isAvailableAttributeTypeForProfile)(t||[]),(0,S.getProfileAttributeConfigPermissionsChecker)(a,r.type,i,[S.ConfigPermissions.READ,S.ConfigPermissions.CREATE]))});yield(0,La.gz)(jw(o));const l=yield(0,La.Ys)(iI.selectors.getModifiedEntities),s=yield(0,La.Ys)(iI.selectors.getProfileErrors),c=n_({metadata:n,modifiedEntities:l,errors:s});c.length&&(yield(0,La.gz)(ab(c)))}}function*V_(e){const{entity:t,silent:r}=e.payload,n=yield(0,La.Ys)(iI.selectors.getMode);r||(0,S.isTempUri)(t.uri)||(yield M_({mode:n,overwrite:!0}))}function*B_(e){const{entityTypeUri:t}=e.payload,r=yield(0,La.Ys)(iI.selectors.getMetadata),n=(0,S.getEntityType)(r,t),a=yield(0,La.Ys)(iI.selectors.getUIConfig),i=yield(0,La.Ys)(iI.selectors.getUserRoles),o=(0,S.getProfileAttributeConfigPermissionsChecker)(a,t,i,[S.ConfigPermissions.READ,S.ConfigPermissions.CREATE]),l=((null==n?void 0:n.attributes)||[]).filter((e=>o(e))),s=(0,S.checkMetadataForCreate)(S.Mode.Editing,n)?S.Mode.Editing:S.Mode.Suggesting,c=(0,S.createTemporaryEntity)({entityTypeUri:t,attributeTypes:l,metadata:r,mode:s});yield(0,La.gz)(nv({entity:c})),yield(0,La.gz)(qC(c)),yield(0,La.gz)(Iw(S.Mode.Viewing)),yield(0,La.gw)(0),(yield(0,La.Ys)(iI.selectors.getProfileViews))||(yield(0,La.qn)(g_.PROFILE_VIEWS_SET)),yield(0,La.gz)(Iw(s)),yield(0,La.gz)(TA())}function*z_(e){const t=yield(0,La.Ys)(iI.selectors.getMetadata),r=yield(0,La.Ys)(iI.selectors.getAuthoringByEntityType,e),n=(0,S.getPreparedAuthoringItems)(t,r,e).map((({views:e})=>e)).flat();yield(0,La.gz)(h_(n))}function*H_(e){const{entityTypeUri:t}=e.payload,r=yield(0,La.Ys)(iI.selectors.getMetadata),n=(0,S.getEntityType)(r,t),a=(0,_.prop)("attributes",n),i=(yield(0,La.Ys)(iI.selectors.getCanSuggestAuthoring,n))?S.Mode.Suggesting:S.Mode.Editing,o=(0,S.createTemporaryEntity)({entityTypeUri:t,attributeTypes:a,metadata:r,mode:i});yield(0,La.gz)(wv({entity:o})),yield(0,La.gz)(qC(o)),yield(0,La.RE)(z_,o.type),yield(0,La.gz)(Iw(i))}function*Y_(e){const{mainEntityUri:t,tempEntities:r,keepErrors:n}=e.payload,[[a],i]=(0,_.partition)((0,_.propEq)("uri",t),r);yield(0,La.gz)(qC(a,n)),yield(0,La.RE)(z_,a.type),yield(0,La.gz)(Iw(S.Mode.Suggesting));for(const e of i)yield(0,La.gz)(jw(e))}function*W_(e){const{payload:{entityUri:t,data:r}}=e;yield(0,La.gz)(r_(S.Operation.Cloning));try{const e=yield(0,La.RE)(S.cloneEntity,t,r);yield(0,La.gz)(nv({entity:e})),yield(0,La.gz)(qC(e)),yield(0,La.gz)(Iw(S.Mode.Editing)),yield(0,La.gz)(TA());const n=(0,Ge.x0)(),a=yield(0,La.Ys)(iI.selectors.getMetadata),i=(0,S.getEntityType)(a,e.type),o=(0,S.checkMetadataForDelete)(S.Mode.Editing,i);yield(0,La.gz)(ov({id:n,type:"cloneAction",autoHideDuration:1e4,text:li().text("Profile is cloned successfully. You can modify the attributes if required."),actions:o?[{label:li().text("Undo"),needConfirmation:!0,confirmationText:li().text("Are you sure you want to undo the cloning process?"),confirmationDescription:li().text("Undoing the cloning process will delete the cloned profile. Are you sure you want to proceed?"),applyAction:ew({entityUri:e.uri}),cancelAction:lv(n)}]:[]}))}catch(e){yield(0,La.gz)(Nv((0,S.getRequestErrorMessage)(e,li().text("Something went wrong"))))}yield(0,La.gz)(r_(null))}function*G_(e){const{entityUri:t}=e.payload;if(!(0,S.isTempUri)(t))try{yield(0,La.RE)(S.removeEntity,t),yield(0,La.gz)(av())}catch(e){yield(0,La.gz)(Nv((0,S.getRequestErrorMessage)(e,li().text("Something went wrong"))))}}function*q_(e){const t=e.payload;try{if((yield(0,La.Ys)($S))&&!confirm(li().text("Are you sure you want to cancel changes for this Profile?")))return;const e=yield(0,La.Ys)(xS),r=yield(0,La.Ys)(iI.selectors.getMetadata),n=yield(0,La.Ys)(fO),a=(0,S.hasAttributeMasking)(r),i=(0,S.isTempUri)(n),o=(0,S.isViewMode)(t),l=(0,S.isEditableMode)(e)&&(0,S.isViewMode)(t),s=(0,S.isViewMode)(e)&&(0,S.isEditableMode)(t);n&&(l||s)&&a&&!i&&(yield(0,La.RE)(j_,o)),yield(0,La.gz)(Iw(t)),l&&(yield(0,La.gz)(Pw()))}catch{}}const Z_=[function*(){yield(0,La.A7)([Tb.MODE_UPDATE_REQUESTED],q_)},function*(){yield(0,La.A7)([nb.RUN_AUTHORING_TASK_ACTION],k_)},function*(){yield(0,La.ib)([xC.OPEN_RELATION_EDITOR,nb.ADD_ATTRIBUTES,xC.SET_RELATION_TYPE,hA.TREE_NODE_RELATION_TYPE_CHANGED],v_)},function*(){yield(0,La.A7)([nb.SAVE_PROFILE],U_)},function*(){yield(0,La.ib)([Tb.MODE_UPDATED],F_)},function*(){yield(0,La.ib)([GC.ENTITY_CREATION_REQUESTED],B_)},function*(){yield(0,La.Fm)([nb.VALIDATE_PROFILE],y_)},function*(){yield(0,La.ib)([GC.ENTITY_REMOVE_REQUESTED],G_)},function*(){yield(0,La.ib)([GC.CLONE_ENTITY],W_)},function*(){yield(0,La.ib)([GC.ENTITY_CREATION_WITH_AUTHORING_REQUESTED],H_)},function*(){yield(0,La.ib)([GC.ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED],Y_)},function*(){yield(0,La.A7)([nb.SAVE_DRAFT],L_)},function*(){yield(0,La.ib)([GC.ENTITY_LOADED],V_)}];let $_=function(e){return e.SIDE_PANEL_VIEWS_LOADED="SIDE_PANEL_VIEWS_LOADED",e}({});qE($_.SIDE_PANEL_VIEWS_LOADED);const K_=[];let X_=function(e){return e.HIDDEN_ATTRIBUTES_UPDATED="HIDDEN_ATTRIBUTES_UPDATED",e.HIDDEN_ATTRIBUTES_RESET="HIDDEN_ATTRIBUTES_RESET",e}({});const Q_=qE(X_.HIDDEN_ATTRIBUTES_UPDATED),J_=qE(X_.HIDDEN_ATTRIBUTES_RESET),eI={};let tI=function(e){return e.CONTROL_ATTRIBUTES_UPDATED="CONTROL_ATTRIBUTES_UPDATED",e}({});const rI=qE(tI.CONTROL_ATTRIBUTES_UPDATED),nI=[],aI=(0,R.combineReducers)({dependentLookups:(e=xb,t)=>{switch(t.type){case Tb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,S.isViewMode)(r)&&!n?xb:e}case gb.DEPENDENT_LOOKUPS_STRUCTURE_SET:return Ob({},e,{structure:t.payload});case gb.DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED:{const r=t.payload;return Ob({},e,{initedTypeUris:(0,_.uniq)(e.initedTypeUris.concat(r))})}case gb.DEPENDENT_LOOKUPS_EDITORS_BLOCKED:{const{uris:r,isBlocked:n}=t.payload,a=e.editors,i=r.reduce(((e,t)=>Ob({},e,{[t]:Ob({},e[t],{isBlocked:n})})),a);return Ob({},e,{editors:i})}case gb.DEPENDENT_LOOKUPS_EDITOR_TOUCHED:{const{uri:r,isTouched:n}=t.payload;return(0,_.assocPath)(["editors",r,"isTouched"],n,e)}default:return e}},entity:(e=ow,t)=>{switch(t.type){case GC.ENTITY_LOADED:return t.payload.entity;case GC.DEFAULT_PROFILE_PIC_SET:return"object"==typeof t.payload&&null!==t.payload?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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){iw(e,t,r[t])}))}return e}({},e,{defaultProfilePic:t.payload.uri,defaultProfilePicValue:t.payload}):e;case nb.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:i}=t.payload,o=(0,S.getAttributeSource)(a);if(r===e.uri){const t=(0,_.lensPath)([o,n]);return(0,_.over)(t,(0,_.pipe)((0,_.defaultTo)([]),(0,_.concat)(_.__,i)),e)}return e}case GC.CLEAR_ENTITY:return ow;default:return e}},errors:(e=pw,t)=>{switch(t.type){case lw.ERRORS_SET:return t.payload;case lw.ERROR_DEACTIVATED:{const r=t.payload,n=e.findIndex((e=>(0,S.getErrorId)(e)===r)),a=(0,_.lensPath)([n]);return(0,_.over)(a,(0,_.assoc)("deactivated",!0),e)}case nb.REMOVE_ATTRIBUTE:{const{uri:r}=t.payload;return e.map((e=>e.uri===r||(0,S.areOneHierarchyUris)(e.parentUri,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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){uw(e,t,r[t])}))}return e}({},e,{deactivated:!0}):e))}case Tb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,S.isViewMode)(r)&&!n?pw:e}case GC.ENTITY_LOADED:{const{silent:r}=t.payload;return r?e:pw}default:return e}},history:(e=Tw,t)=>{switch(t.type){case dw.HISTORY_DIFF_SET:return bw({},e,{diff:t.payload});case dw.HISTORY_DIFF_CLEARED:return bw({},e,{diff:Tw.diff});case dw.HISTORY_EVENT_SET:return bw({},e,{event:t.payload});case XE.NEW_ENTITY_SHOWN:case XE.OPEN_ENTITY:case dw.HISTORY_EVENT_CLEARED:return bw({},Tw,{mode:e.mode});case dw.HISTORY_SLICE_SET:return bw({},e,{slice:t.payload});case dw.HISTORY_MODE_SET:return bw({},e,{mode:t.payload});default:return e}},lastLoadedTime:(e=null,t)=>{switch(t.type){case Ow.PROFILE_LAST_LOADED_TIME_UPDATE:case GC.ENTITY_LOADED:return Date.now();default:return e}},lookups:(e=_w,t)=>{switch(t.type){case Sw.LOOKUPS_LOADED:return t.payload;case Sw.LOOKUPS_FOR_TYPE_RESOLVED:{const{type:r,values:n}=t.payload;return Aw({},e,{[r]:Aw({},e[r],n)})}case Sw.LOOKUPS_LIST_RESOLVED:return t.payload.reduce(((e,t)=>Object.keys(t).reduce(((e,r)=>Aw({},e,{[r]:Aw({},e[r],t[r])})),e)),e);case"UI_RESET":return Aw({},_w);default:return e}},mode:(e=Uw,t)=>t.type===Tb.MODE_UPDATED?t.payload.mode:e,modifiedEntities:(e=Yw,t)=>{switch(t.type){case SC.MODIFIED_ENTITY_CREATED:{const r=t.payload;return zw({},e,{[r.uri]:r})}case SC.MODIFIED_ENTITY_DELETED:{const r=t.payload;return(0,_.omit)([r],e)}case SC.MODIFIED_ENTITIES_RESET:return Yw;case Tb.MODE_UPDATED:{const{silent:r}=t.payload;return r?e:Yw}case SC.MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET:{const{entityUri:r,value:n}=t.payload;return r?zw({},e,{[r]:zw({},e[r],{defaultProfilePic:n.uri,defaultProfilePicValue:n})}):e}case nb.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t,i=(0,S.getBaseUri)(n);if((0,S.isEntityUri)(i)){const t=e[i];return e[i]||console.error(`ADD_ATTRIBUTES. parentUri - ${n}, state: ${JSON.stringify(e)}`),(0,S.isEntitySpecialAttrType)(r)?zw({},e,{[i]:(0,S.addEntitySpecialAttribute)({entity:t,attributeType:r})}):zw({},e,{[i]:(0,S.addAttribute)({entity:t,attributeType:r,parentUri:n,index:a})})}return e}),e);case nb.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:i}=t.payload,o=(0,S.getAttributeSource)(a);if((0,S.isEntityUri)(r)&&r in e){const t=(0,_.lensPath)([r,o,n]);return(0,_.over)(t,(0,_.pipe)((0,_.defaultTo)([]),(0,_.concat)(_.__,i)),e)}return e}case nb.MODIFY_ATTRIBUTE:{const{attributeType:r,uri:n,value:a}=t.payload,i=(0,S.getBaseUri)(n);if((0,S.isEntityUri)(i)){const t=e[i];return e[i]&&e[i].attributes||console.error(`MODIFY_ATTRIBUTE. uri - ${n}, state: ${JSON.stringify(e)}`),(0,S.isEntitySpecialAttrType)(r)?zw({},e,{[i]:(0,S.editEntitySpecialAttribute)({entity:t,attributeType:r,value:a})}):zw({},e,{[i]:(0,S.editAttribute)({entity:t,attributeType:r,uri:n,value:a})})}return e}case nb.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n}=t.payload,a=(0,S.getBaseUri)(n);if((0,S.isEntityUri)(n)){const t=e[a];return e[a]||console.error(`REMOVE_ATTRIBUTE. uri - ${n}, state: ${JSON.stringify(e)}`),(0,S.isEntitySpecialAttrType)(r)?zw({},e,{[a]:(0,S.removeEntitySpecialAttribute)({entity:t,attributeType:r})}):zw({},e,{[a]:(0,S.removeAttribute)({entity:t,attributeType:r,uri:n})})}return e}case nb.ADD_DEFAULT_VALUES:{const{attributeType:r,parentUri:n,metadata:a,mode:i}=t.payload,o=(0,S.getBaseUri)(n);if((0,S.isEntityUri)(o)){const t=(0,S.getEditableAttributeTypeSubAttributes)(a,r);return(0,_.over)((0,_.lensProp)(o),(0,S.addDefaultValuesToComplexAttribute)({attributeType:r,subAttributes:t,metadata:a,mode:i,parentUri:n}),e)}return e}default:return e}},relations:(e=dA,t)=>{switch(t.type){case GC.ENTITY_LOADED:{const{silent:r}=t.payload;return r?e:dA}case xC.RELATIONS_LOADED:{const{id:r,connections:n=[],total:a,mode:i}=t.payload;return(0,_.pipe)((0,_.assocPath)([r,"connections"],n),(0,_.assocPath)([r,"total"],a),(0,_.when)((0,_.both)((0,_.complement)((0,_.hasPath)([r,"drafts"])),(0,_.always)((0,S.isEditableMode)(i))),(0,_.assocPath)([r,"drafts"],mA)))(e)}case xC.SECOND_LEVEL_RELATIONS_LOADED:{const{id:r,connections:n,parentEntityUri:a,total:i}=t.payload,o=(0,_.path)([r,"connections"],e).map((e=>{const{entityUri:t}=e.entity;return t===a?uA({},e,{total:i,connections:n.map((e=>uA({},e,{parentEntityUri:a})))}):e}));return(0,_.assocPath)([r,"connections"],o,e)}case Tb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return n?e:(0,_.map)(kw(r)?(0,_.omit)(["drafts","relationsToEdit","relationToAdd"]):(0,_.assoc)("drafts",mA),e)}case xC.REMOVE_RELATION:{const{id:r,relationUri:n}=t.payload,a=(0,_.pipe)(S.getRelationUriFromConnection,(0,_.equals)(n)),i=(0,_.path)([r,"connections"],e),o=!((0,S.isTempUri)(n)||null!=i&&i.some((e=>e.suggested&&e.relation.relationUri===n)));return(0,_.evolve)({[r]:{drafts:(0,_.evolve)({removedUris:o?(0,_.append)(n):_.identity,addedConnections:(0,_.reject)(a),editedConnections:(0,_.reject)(a)})}},e)}case xC.IGNORE_RELATION:{const{id:r,ignoredRelationData:n}=t.payload;return(0,_.evolve)({[r]:{drafts:(0,_.evolve)({ignoredRelationData:(0,_.append)(n)})}},e)}case xC.ADD_RELATION:{const{id:r,connection:n}=t.payload,a=(0,_.omit)(["isNew"],n);return(0,_.evolve)({[r]:(0,_.pipe)((0,_.when)((0,_.propSatisfies)(_.isNil,"drafts"),(0,_.assocPath)(["drafts"],mA)),(0,_.evolve)({drafts:{addedConnections:(0,_.prepend)(a)}}))},e)}case xC.EDIT_RELATION:{const{id:r,connection:n}=t.payload,a=(0,_.eqBy)(S.getRelationUriFromConnection,n);if((0,S.isTempUri)((0,S.getRelationUriFromConnection)(n))){const t=e=>{const t=e.findIndex(a);return t>=0?(0,_.update)(t,n,e):e};return(0,_.evolve)({[r]:{drafts:(0,_.evolve)({addedConnections:t})}},e)}{const t=e=>{const t=e.findIndex(a);return t>=0?(0,_.update)(t,n,e):[...e,n]};return(0,_.evolve)({[r]:{drafts:(0,_.evolve)({editedConnections:t})}},e)}}case xC.UPDATE_RELATION_RATING:{const{id:r,connection:n,rating:a,user:i}=t.payload,o=n.initial?n:uA({},n,{initial:{connection:n}}),l=(0,S.isTempUri)((0,S.getRelationUriFromConnection)(o)),s=(0,_.eqBy)(S.getRelationUriFromConnection,o),c=e=>{const t=null==e?void 0:e.findIndex((e=>e.user===i));return!a&&t>=0?e.filter((e=>e.user!==i)):t>=0?(0,_.update)(t,a,e):[...e,a]},u=e=>{const t=e.findIndex(s);return t>=0?(0,_.update)(t,p,e):[...e,p]},p=(0,_.evolve)({relation:e=>uA({},e,{ratings:c((0,_.defaultTo)([],e.ratings))})},o);return(0,_.evolve)({[r]:{drafts:(0,_.evolve)({[l?"addedConnections":"editedConnections"]:u})}},e)}case xC.OPEN_RELATION_EDITOR:{const{id:r,connection:n}=t.payload,a=n.initial?n:uA({},n,{initial:{connection:n}});if(a.isNew){const t=(0,S.getRelationToAddPath)(r);return(0,_.path)(t,e)?e:(0,_.assocPath)(t,a,e)}{const t=(0,_.lensPath)((0,S.getRelationsToEditPath)(r)),n=(0,_.eqBy)((0,_.path)(["relation","relationUri"]),a);return(0,_.over)(t,(0,_.pipe)((0,_.defaultTo)([]),(0,_.unless)((0,_.find)(n),(0,_.append)(a))),e)}}case xC.SET_INITIAL_INFO:{const{id:r,relationUri:n,tempEntity:a}=t.payload,i=fA(r,n,e);return(0,_.assocPath)([...i,"initial","modifiedEntity"],a,e)}case xC.CLOSE_RELATION_EDITOR:{const{id:r,relationUri:n}=t.payload,a=(0,_.pathEq)(["relation","relationUri"],n);return(0,_.evolve)({[r]:{relationToAdd:(0,_.when)(a,(0,_.always)(null)),relationsToEdit:(0,_.reject)(a)}},e)}case xC.SET_RELATION_TYPE:{const{id:r,relationUri:n,relationType:a}=t.payload,i=fA(r,n,e);if(i){const t=[...i,"relation"],r=(0,_.lensPath)(t);return(0,_.over)(r,(0,S.applyRelationTypeObject)(a),e)}return e}case nb.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a,viewId:i}=t,o=(0,S.getBaseUri)(n),l=yA(i,o,e);if(l&&(0,S.isRelationUri)(o)){if((0,S.isActivenessAttrType)(r)){const t=(0,_.view)(l,e),n=(0,S.addEntitySpecialAttribute)({entity:t,attributeType:r});return(0,_.set)(l,n,e)}{const t=gA(i,o,e),l=(0,_.view)(t,e);l||console.error(`relations.ADD_ATTRIBUTES. viewId - ${i}, relationUri - ${o}, state: ${JSON.stringify(e)}`);const s=(0,S.addAttribute)({entity:l,attributeType:r,parentUri:n,index:a});return(0,_.set)(t,s,e)}}return e}),e);case nb.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,values:a,viewId:i}=t.payload;if(!(0,S.isRelationUri)(r))return e;const o=(0,S.getBaseUri)(r),l=fA(i,o,e),s=(0,_.lensPath)([...l,"relation","object","attributes",n]);return(0,_.over)(s,(0,_.pipe)((0,_.defaultTo)([]),(0,_.append)(a)),e)}case nb.MODIFY_ATTRIBUTE:{const{attributeType:r,viewId:n,uri:a,value:i}=t.payload,o=(0,S.getBaseUri)(a),l=yA(n,o,e);if(l&&(0,S.isRelationUri)(o)){if((0,S.isActivenessAttrType)(r)){const t=(0,_.view)(l,e),n=(0,S.editEntitySpecialAttribute)({entity:t,attributeType:r,value:i});return(0,_.set)(l,n,e)}{const t=gA(n,o,e),l=(0,_.view)(t,e);l||console.error(`relations.MODIFY_ATTRIBUTE. viewId - ${n}, relationUri - ${o}, state: ${JSON.stringify(e)}`);const s=(0,S.editAttribute)({entity:l,attributeType:r,uri:a,value:i});return(0,_.set)(t,s,e)}}return e}case nb.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n,viewId:a}=t.payload,i=(0,S.getBaseUri)(n),o=yA(a,i,e);if(o&&(0,S.isRelationUri)(i)){if((0,S.isActivenessAttrType)(r)){const t=(0,_.view)(o,e),n=(0,S.removeEntitySpecialAttribute)({entity:t,attributeType:r});return(0,_.set)(o,n,e)}{const t=gA(a,i,e),o=(0,_.view)(t,e);o||console.error(`relations.REMOVE_ATTRIBUTE. viewId - ${a}, relationUri - ${i}, state: ${JSON.stringify(e)}`);const l=(0,S.removeAttribute)({entity:o,attributeType:r,uri:n});return(0,_.set)(t,l,e)}}return e}case xC.SET_RELATION_ENTITY:{const{id:r,relationUri:n,entityInfo:a}=t.payload,i=fA(r,n,e);if(i){const t=[...i,"entity"],r=(0,_.lensPath)(t),{uri:n,label:o,type:l}=a,s=(0,_.isEmpty)(a)?{}:{entityUri:n,entityLabel:o,entityType:l,object:{uri:n,label:o,type:l}};return(0,_.set)(r,s,e)}return e}case nb.ADD_DEFAULT_VALUES:{const{viewId:r,attributeType:n,parentUri:a,metadata:i,mode:o}=t.payload,l=(0,S.getBaseUri)(a);if((0,S.isRelationUri)(l)){const t=fA(r,l,e);if(t){if(n){const r=[...t,"relation","object"],l=(0,S.getAttributeTypeSubAttributes)(i,n);return(0,_.over)((0,_.lensPath)(r),(0,S.addDefaultValuesToComplexAttribute)({attributeType:n,subAttributes:l,metadata:i,mode:o,parentUri:a}),e)}{const r=[...t,"relation","object","attributes"],n=[...t,"relation","object","type"],l=(0,_.view)((0,_.lensPath)(n),e),{attributes:s=[]}=(0,S.getRelationType)(i,l);return(0,_.over)((0,_.lensPath)(r),(0,S.addDefaultValuesToAttributes)({metadata:i,mode:o,attributeTypes:s,parentUri:a}),e)}}return e}return e}default:return e}},trees:(e=YA,t)=>(0,SA.ZP)(e,(r=>{switch(t.type){case Tb.MODE_UPDATED:{const{mode:e,silent:n}=t.payload;if(n)break;Object.keys(null==r?void 0:r.trees).forEach((e=>{NA(r.trees[e].root,"showDetails",!1)})),(0,S.isViewMode)(e)?(r.common.commands=[],r.initialTrees={}):(0,S.isEditableMode)(e)&&((0,S.isEmptyValue)(r.initialTrees)?r.initialTrees=zA({},r.trees):(r.common.commands=[],r.trees=zA({},r.initialTrees)));break}case Tb.MODE_EDITING_CANCELED:case hA.TREES_RESTORE_FROM_INITIAL_TREES:r.trees=zA({},r.initialTrees);break;case hA.TREES_RESET_INITIAL_TREES:r.initialTrees={};break;case GC.ENTITY_LOADED:{const{silent:r}=t.payload;return r?e:YA}case hA.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 hA.TREE_LOADING:{const e=t.payload;r.trees[e]=r.trees[e]||{},r.trees[e].loading=!0;break}case hA.TREE_CHILDREN_LOADING:{const{id:e,parentId:n,nodeId:a}=t.payload,i=r.trees[e].root,o=(0,S.findNodeById)(i,n);o.pending=!1,o.children=(o.children||[]).concat({entity:{},loading:!0,nodeId:a});break}case hA.TREE_CHILDREN_LOADED:{const{children:e,id:n,parentId:a}=t.payload,i=r.trees[n].root,o=(0,S.findNodeById)(i,a);o&&(o.children=((e=[],t=[])=>{const r=(0,_.reject)((0,_.prop)("loading"))(e);return t.forEach((t=>{e.find((e=>(0,_.path)(["entity","uri"],e)===t.entity.uri))||r.push(t)})),r})(o.children,e),delete o.pending);break}case hA.TREE_NODE_REMOVED:{const{id:e,nodeId:n}=t.payload,a=r.trees[e].root,i=(0,S.findParentNodeById)(a,n);RA(i||a,n);break}case hA.TREE_NODE_CREATED:{const{id:e,parentId:n,node:a}=t.payload,i=r.trees[e].root,o=(0,S.findNodeById)(i,n)||i,l=o.children.length;_A(o,a,l);break}case hA.TREE_NODE_EDITED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,S.findNodeById)(a,n.nodeId),o=Object.keys(n);for(const e of o)i[e]=n[e];break}case hA.TREE_NODE_EDITING_STARTED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,S.findNodeById)(a,n.nodeId),o=(0,S.findParentNodeById)(a,n.nodeId);i&&o&&(i.editingMode=S.NODE_EDITING_MODES.editing,i.relatedEntity=o.entity,delete i.loading,i.initialConnection=PA(i),DA({id:e,draft:r.trees,node:i}));break}case hA.TREE_NODE_EDITING_APPLIED:{const{id:e,node:a}=t.payload,i=r.trees[e].root,o=(0,S.findNodeById)(i,a.nodeId),l=UA({id:e,draft:r.trees,relationUri:a.relation.uri});var n;o&&l&&(jA(o),o.entity.uri!==l.entity.uri&&null!==(n=o.children)&&void 0!==n&&n.length&&(delete o.children,o.pending=!0),o.entity=l.entity,o.relation=l.relation,LA({id:e,draft:r.trees,relationUri:a.relation.uri}));break}case hA.TREE_NODE_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,S.findNodeById)(a,n.nodeId);i&&(jA(i),LA({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case hA.TREE_NODE_NEW_PARENT_EDITING_STARTED:{const{id:e,node:n,newNode:a}=t.payload,i=r.trees[e].root,o=(0,S.findNodeById)(i,n.nodeId);if(a.relatedEntity=o.entity,a.relatedNodeId=o.nodeId,a.editingMode=S.NODE_EDITING_MODES.addingParent,i===o)a.children=[i],r.trees[e].root=a;else{const e=(0,S.findParentNodeById)(i,n.nodeId),t=e.children.findIndex((e=>o===e));_A(e,a,t)}a.initialConnection=PA(a),DA({id:e,draft:r.trees,node:a});break}case hA.TREE_NODE_NEW_PARENT_EDITING_APPLIED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,S.findNodeById)(a,n.nodeId),o=(0,S.findNodeById)(a,n.relatedNodeId),l=UA({id:e,draft:r.trees,relationUri:n.relation.uri});i&&l&&(FA({id:e,draft:r.trees,currentNode:i}),o.parent=o.parent||[],o.parent.push(l.entity.uri),o.relations=o.relations||[],o.relations.push(l.relation),r.trees[e].entitiesMap=((e,t=[])=>AA(e,t.reduce(((e,t)=>xA({},e,{[t.entity.uri]:(0,_.pick)(["entity","parent","relations"],t)})),{})))(r.trees[e].entitiesMap,[o,BA(l)]),LA({id:e,draft:r.trees,relationUri:i.relation.uri}));break}case hA.TREE_NODE_NEW_PARENT_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,S.findNodeById)(a,n.nodeId);i&&(FA({id:e,draft:r.trees,currentNode:i}),LA({id:e,draft:r.trees,relationUri:i.relation.uri}));break}case hA.TREE_NODE_NEW_CHILD_EDITING_STARTED:{const{id:e,node:n,newNode:a}=t.payload,i=r.trees[e].root,o=(0,S.findNodeById)(i,n.nodeId);a.relatedEntity=o.entity,a.editingMode=S.NODE_EDITING_MODES.addingChild,a.parent=[o.entity.uri],a.directParentUri=o.entity.uri,o.children=o.children||[],o.children.unshift(a),o.expanded=!0,a.initialConnection=PA(a),DA({id:e,draft:r.trees,node:a});break}case hA.TREE_NODE_NEW_CHILD_EDITING_APPLIED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,S.findParentNodeById)(a,n.nodeId),o=(0,S.findNodeById)(i,n.nodeId),l=UA({id:e,draft:r.trees,relationUri:n.relation.uri});i&&o&&l&&(jA(o),o.entity=l.entity,o.relation=l.relation,o.relations=[l.relation],LA({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case hA.TREE_NODE_NEW_CHILD_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,S.findParentNodeById)(a,n.nodeId);i&&(RA(i,n.nodeId),LA({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case hA.TREE_NODE_RELATION_TYPE_CHANGED:{const{id:e,node:n,relationTypeUri:a}=t.payload,i=UA({id:e,draft:r.trees,relationUri:n.relation.uri}).relation.type;i!==a&&(i&&kA({id:e,draft:r.trees,node:n,entity:null}),(({id:e,draft:t,node:r,relationTypeUri:n})=>{IA({path:["editingConnections",r.relation.uri,"relation"],object:t[e],value:e=>xA({},e,{type:n,attributes:{}})})})({id:e,draft:r.trees,node:n,relationTypeUri:a}));break}case hA.TREE_NODE_ENTITY_CHANGED:{const{id:e,node:n,entity:a}=t.payload;kA({id:e,draft:r.trees,node:n,entity:a});break}case nb.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a,viewId:i}=t,o=(0,S.getBaseUri)(n),l=MA(i,o,e.trees);if(l&&(0,S.isRelationUri)(o)){const t=(0,_.view)(l,e.trees);if((0,S.isActivenessAttrType)(r)){const n=(0,S.addEntitySpecialAttribute)({entity:t,attributeType:r});return zA({},e,{trees:(0,_.set)(l,n,e.trees)})}{const i=(0,S.addAttribute)({entity:t,attributeType:r,parentUri:n,index:a});return zA({},e,{trees:(0,_.set)(l,i,e.trees)})}}return e}),e);case nb.MODIFY_ATTRIBUTE:{const{attributeType:r,viewId:n,uri:a,value:i}=t.payload,o=(0,S.getBaseUri)(a),l=MA(n,o,e.trees);if(l&&(0,S.isRelationUri)(o)){const t=(0,_.view)(l,e.trees);if((0,S.isActivenessAttrType)(r)){const n=(0,S.editEntitySpecialAttribute)({entity:t,attributeType:r,value:i});return zA({},e,{trees:(0,_.set)(l,n,e.trees)})}{const n=(0,S.editAttribute)({entity:t,attributeType:r,uri:a,value:i});return zA({},e,{trees:(0,_.set)(l,n,e.trees)})}}return e}case nb.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n,viewId:a}=t.payload,i=(0,S.getBaseUri)(n),o=MA(a,i,e.trees);if(o&&(0,S.isRelationUri)(i)){const t=(0,_.view)(o,e.trees);if((0,S.isActivenessAttrType)(r)){const n=(0,S.removeEntitySpecialAttribute)({entity:t,attributeType:r});return zA({},e,{trees:(0,_.set)(o,n,e.trees)})}{const a=(0,S.removeAttribute)({entity:t,attributeType:r,uri:n});return zA({},e,{trees:(0,_.set)(o,a,e.trees)})}}return e}case nb.ADD_DEFAULT_VALUES:{const{viewId:r,attributeType:n,parentUri:a,metadata:i,mode:o}=t.payload,l=(0,S.getBaseUri)(a),s=MA(r,l,e.trees);if((0,S.isRelationUri)(l)&&s){if(n){const t=(0,S.getAttributeTypeSubAttributes)(i,n);return zA({},e,{trees:(0,_.over)(s,(0,S.addDefaultValuesToComplexAttribute)({attributeType:n,subAttributes:t,metadata:i,mode:o,parentUri:a}),e.trees)})}{const t=(0,_.compose)(s,(0,_.lensPath)(["attributes"])),r=(0,_.compose)(s,(0,_.lensPath)(["type"])),n=(0,_.view)(r,e.trees),{attributes:l=[]}=(0,S.getRelationType)(i,n);return zA({},e,{trees:(0,_.over)(t,(0,S.addDefaultValuesToAttributes)({metadata:i,mode:o,attributeTypes:l,parentUri:a}),e.trees)})}}return e}case hA.TREE_ENTITIES_MAPPING_LOADED:{const{id:e,entitiesSubMap:n}=t.payload,a=r.trees[e].entitiesMap;r.trees[e].entitiesMap=AA(a,n);break}case hA.TREE_LOADED:{const{tree:e,id:n,graphTypes:a,activenessDate:i,isReversed:o}=t.payload,l=VA(r.trees[n]||{});r.trees[n]=zA({},l,e,{graphTypes:a,activenessDate:i,isReversed:o}),delete r.trees[n].errorMessage,r.trees[n].loading=!1;break}case hA.TREE_SORTED:{const{id:e,typesLabelsMap:n={},sortField:a,sortOrder:i}=t.payload;r.trees[e]=r.trees[e]||{},r.trees[e].sortField=a,r.trees[e].sortOrder=i,r.trees[e].root&&(r.trees[e].root=(0,S.mapTree)(r.trees[e].root,{childrenProcessing:(0,S.sortTreeChildren)({sortField:a,sortOrder:i,typesLabelsMap:n})}));break}case hA.TREE_SECONDARY_LABEL_SHOWN:{const{id:e,show:n}=t.payload;r.trees[e].showSecondaryLabel=n,r.trees[e].root=zA({},r.trees[e].root);break}case hA.TREES_STATE_RESTORED:{const e=t.payload;Object.keys(e).forEach((t=>{r.trees[t]=r.trees[t]||{},r.trees[t]=zA({},r.trees[t],e[t]),r.trees[t].root&&(r.trees[t].root=zA({},r.trees[t].root))}));break}case hA.TREE_CHANGED:{const{id:e,tree:n}=t.payload;r.trees[e].root=n;break}case hA.TREE_REFRESHED:{const e=t.payload;r.trees[e].root=zA({},r.trees[e].root);break}case hA.TREE_NODE_EXPANDED:{const{id:e,nodeId:n}=t.payload,a=r.trees[e].root;(0,S.findNodeById)(a,n).expanded=!0;break}case hA.TREE_CURRENT_ENTITY_SHOWN:{const{id:n,uri:a=(0,_.path)(["entity","uri"],e)}=t.payload;if(r.trees[n]){const e=wA(r.trees[n].root,a);r.trees[n].scrollTo=e}break}case hA.TREE_SCROLL_TO_NODE_RESET:{const e=t.payload;r.trees[e]&&(r.trees[e].scrollTo=null);break}case hA.TREE_ACTIVENESS_DATE_CHANGED:{const{id:e,activenessDate:n}=t.payload;r.trees[e].activenessDate=n;break}case hA.TREE_RELATION_REPOINTED:{const{entity:e,relation:n,newParent:a,isReversed:i}=t.payload,o=(0,_.prop)("uri"),l=o(e),s=o(a),c=(0,S.createRelationRepointCommand)({entityUri:l,relation:n,newEntityUri:s,isReversed:i});r.common.commands.push(c);break}case hA.TREE_RELATION_REMOVED:{const{relationUri:e}=t.payload;if((0,S.isTempUri)(e))r.common.commands=(0,_.reject)((0,S.isRelationCommandForUri)(e),r.common.commands);else{const t=(0,S.createRelationDeleteCommand)({relationUri:e});r.common.commands.push(t)}break}case hA.TREE_RELATION_CREATED:{const{entityUri:e,relation:n,parentEntityUri:a}=t.payload,i=(0,S.createRelationCreateCommand)({parentUri:a,relation:n,entityUri:e});r.common.commands.push(i);break}case hA.TREE_RELATION_EDITED:{const{oldRelation:e,newRelation:n,entityUri:a,newEntityUri:i,isReversed:o}=t.payload,l=i?(0,S.createRelationRepointCommand)({entityUri:a,newEntityUri:i,relation:n,isReversed:o}):(0,S.createRelationUpdateCommand)({oldRelation:e,newRelation:n});r.common.commands.push(l);break}case hA.TREE_COMMANDS_CLEARED:r.common.commands=[];break;case hA.TREE_CANCEL_CHILDREN_LOADING:{const{id:e,parentId:n}=t.payload,a=r.trees[e].root,i=(0,S.findNodeById)(a,n);i&&(i.pending=!0,delete i.expanded,delete i.children);break}}})),operation:(e=null,t)=>t.type===t_.PROFILE_OPERATION_UPDATE?t.payload:e,views:(e=null,t)=>t.type===g_.PROFILE_VIEWS_SET?t.payload:e,sidePanelViews:(e=K_,t)=>t.type===$_.SIDE_PANEL_VIEWS_LOADED?t.payload:e,entityRelatedAttributes:(e=GA,t)=>{switch(t.type){case WA.ENTITY_RELATED_ATTRIBUTES_ADDED:{const{attributeTypeUri:r,entityUri:n,attributes:a}=t.payload;return(0,_.assocPath)([r,n],a,e)}case Tb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,S.isViewMode)(r)&&!n?GA:e}default:return e}},hiddenAttributes:(e=eI,t)=>{switch(t.type){case X_.HIDDEN_ATTRIBUTES_UPDATED:{const{uri:r,hiddenAttributes:n}=t.payload;return(0,_.assoc)(r,n,e)}case X_.HIDDEN_ATTRIBUTES_RESET:return(0,_.dissoc)(t.payload,e);default:return e}},controlAttributes:(e=nI,t)=>t.type===tI.CONTROL_ATTRIBUTES_UPDATED?t.payload:e}),iI={getModule:()=>({id:"mdm",reducerMap:{dataTenants:ZE,tenants:KE,metadata:rb,profile:aI,tenant:KT,environment:nO,user:HT,ui:BT,search:tv},sagas:[...Xw,...WC,...Z_,...Xb]}),selectors:c},oI=iI,lI=({className:e})=>{const t=(0,mp.useDispatch)(),r=(0,mp.useSelector)(Ri.qx),n=(0,mp.useSelector)(oI.selectors.getGoogleMapKey),a=(0,b.useMemo)((()=>((e,t)=>(0,_.when)((0,_.always)(!t),(0,_.reject)((0,_.propEq)("id",Z.om.MAP)))(e))([{id:Z.om.MAP,tooltipTitle:li().text("View map"),Icon:WE()},{id:Z.om.PROFILE,tooltipTitle:li().text("View entity details"),Icon:HE()}],n)),[n]);return v().createElement(PE,{className:e,modes:a,modeId:r,onChange:e=>{t(Ci(r!==e?e:null))}})};lI.propTypes={className:dp().string};const sI=lI,cI=()=>v().createElement("div",{className:Td},v().createElement("div",{className:"Headers-styles-title--TvsMA"},li().text("Profiles")),v().createElement("div",{className:Od},v().createElement(BE,null),v().createElement(sI,{className:Sd})));var uI=r(12932),pI=r.n(uI),dI=r(83754),mI=r.n(dI);const fI=(0,wp.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 yI(){return yI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yI.apply(null,arguments)}function gI(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const hI=e=>{let{value:t,tabs:r=[],onChange:n,tabClasses:a}=e,i=gI(e,["value","tabs","onChange","tabClasses"]);const o=fI(),l=(e,t)=>v().createElement("span",{className:o.labelWrapper},v().createElement(od.Y,{value:e},v().createElement("span",{className:o.label},e)),t);return v().createElement(pI(),yI({value:t,onChange:(e,t)=>n(t),classes:{root:o.tabsRoot,scrollButtons:o.tabsScrollButton},indicatorColor:"primary",textColor:"primary",variant:"scrollable",scrollButtons:!0},i,{allowScrollButtonsMobile:!0}),r.map((e=>{let{label:t,value:r,additionalLabel:n,dataReltioId:i}=e,s=gI(e,["label","value","additionalLabel","dataReltioId"]);return v().createElement(mI(),yI({classes:a||{root:o.tabRoot,disabled:o.disabled},key:r,value:r,label:l(t,n),"data-reltio-id":i},s))})))};function EI(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class bI extends b.PureComponent{constructor(...e){super(...e),this.getTabsData=()=>{const{tenantObject:e,tableViewTabs:t,selectedEntityTypes:r,metadata:n}=this.props,a=(0,gy.ZK)(t,e);return(0,Ai.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){EI(e,t,r[t])}))}return e}({},e,{additionalLabel:v().createElement("span",{className:"Headers-styles-number--trErH"},"(",void 0===e.number?li().text("N/A"):(0,ni.k7)(e.number),")")})))},this.onTabChange=e=>{this.props.dispatch(bi(e))},this.onSelectColumns=e=>{const{dispatch:t,entityTypeTab:r,columnsForEntityType:n}=this.props;return t(Ei(r,e,n))},this.renderTabs=()=>{const{entityTypeTab:e}=this.props;return v().createElement("div",{className:"Headers-styles-tabsContainer--lhDXc"},v().createElement(hI,{value:e,tabs:this.getTabsData(),onChange:this.onTabChange}))}}render(){const{entityTypeTab:e,columnsForEntityType:t}=this.props;return v().createElement("div",{className:Td},this.renderTabs(),v().createElement("div",{className:Od},v().createElement(wd,{entityTypeUri:e,headColumns:t,onSelectColumns:this.onSelectColumns,"data-reltio-id":"reltio-search-table-add-remove-column",disabled:!e,showForDisabled:!0}),v().createElement(Af(),{orientation:"vertical",className:"Headers-styles-splitter--sCvn6"}),v().createElement(BE,null),v().createElement(sI,{className:Sd})))}}const vI=(0,mp.connect)((e=>{const t=(0,Ri.o4)(e);return{metadata:k().selectors.getMetadata(e),selectedEntityTypes:(0,P.DX)(e),tableViewTabs:(0,Ri.gu)(e),entityTypeTab:t,columnsForEntityType:(0,Ri.Gv)(e,t),tenantObject:(0,ai.t9)(e)}}))(bI);function TI(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class OI extends v().PureComponent{constructor(...e){super(...e),this.entitiesTableRef=this.props.basicTableRef||v().createRef(),this.state={resizeDebounceDelay:void 0},this.sortHandle=({field:e,order:t})=>{this.props.dispatch((({field:e,order:t,entityTypeUri:r})=>({type:U.Z.CHANGE_SORT,payload:{field:e,order:t,entityTypeUri:r}}))({field:t?e:null,order:t,entityTypeUri:this.props.entityTypeUri}))},this.reorderingHandle=({what:e,where:t})=>{const{entityTypeUri:r,dispatch:n,headColumns:a}=this.props;n(((e,t)=>({type:Se,payload:{entityTypeUri:e,columns:t}}))(r,(0,_.move)(e.columnIndex,t.columnIndex,a)))},this.changeColumnsListHandle=({columns:e})=>{const{entityTypeUri:t,dispatch:r,headColumns:n}=this.props;r(Ei(t,e,n))},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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){TI(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:xe,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:i}=this.props;this.entitiesTableRef.current&&(t.length!==(0,_.path)(["headColumns","length"],e)||(0,_.difference)((0,_.omit)(["size"],t),(0,_.omit)(["size"],e.headColumns)).length>0||r!==e.sortField||n!==e.sortOrder||a!==e.entities)&&this.entitiesTableRef.current.resetScrollbarPosition(),e.entityTypeUri!==i&&this.setState({resizeDebounceDelay:0})}render(){const{entities:e,entityToHighlight:t,onScroll:r,entityTypeUri:n,headColumns:a,sortField:i,sortOrder:o,additionalColumns:l,selectedEntityUri:s,dndColumnReorderingEnabled:c,onEntityClick:u,onEntityHover:p,entitiesImportStatus:d,onEntityImportStatusChange:m}=this.props;return v().createElement(of,{entities:e,entityToHighlight:t,selectedEntityUri:s,onScroll:r,onSort:this.sortHandle,onEntityClick:u,onEntityHover:p,entityTypeUri:n,headColumns:a,sortField:i,sortOrder:o,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})}}OI.propTypes={entities:dp().array,entityToHighlight:dp().string,selectedEntityUri:dp().string,headColumns:dp().array,onScroll:dp().func,entityTypeUri:dp().string,sortField:dp().string,sortOrder:dp().oneOf([Ad.oy,Ad.U9]),dndColumnReorderingEnabled:dp().bool,dispatch:dp().func,additionalColumns:dp().arrayOf(dp().shape({id:dp().string,label:dp().string})),onEntityClick:dp().func,onEntityHover:dp().func,entitiesImportStatus:dp().object,onEntityImportStatusChange:dp().func,basicTableRef:dp().shape({current:dp().object})},OI.defaultProps={entities:[],headColumns:[]};const SI=(0,Lf.Z)(Ai.oq),xI=(0,mp.connect)((e=>{const t=(0,Ri.tB)(e),r=(0,Ri.Gv)(e,t),n=k().selectors.getMetadata(e),a=SI(n,t,r);return{sortField:(0,ai.NW)(e,{entityTypeUri:(0,Ri.o4)(e)}),sortOrder:(0,ai.L9)(e,{entityTypeUri:(0,Ri.o4)(e)}),dndColumnReorderingEnabled:!(0,Ri.Ue)(e),headColumns:r,entityTypeUri:t,additionalColumns:a}}))(OI);var CI=r(14058),wI=r.n(CI);const AI=(0,wp.Z)((()=>({container:{position:"relative",height:"100%",width:"100%"},closeButton:{position:"absolute",top:"7px",left:"7px",zIndex:1}}))),RI=(0,wp.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"}}}))),_I=({className:e,entity:t,children:r,classes:n,renderLabel:a=_.identity})=>{const i=RI({classes:n}),o=(0,w.AH)(),l=(0,w.QQ)(),s=(0,b.useCallback)((()=>{navigator.clipboard.writeText((0,S.getEntityId)(t))}),[t]);if((0,_.isNil)(t))return null;const c=(0,S.getLabel)(t.label),u=t.secondaryLabel,p=(0,S.getBusinessCardAttributesText)(o,t),d=(0,S.isActiveObject)(t),m=t.uri,f=(0,S.getEntityId)(t);return v().createElement("div",{className:O()(i.profileBandWrapper,e),"data-reltio-id":"reltio-profile-band"},v().createElement("div",{className:O()(i.profileBand,{[i.inactive]:!d}),"data-entity-uri":m},v().createElement(A,{key:t.uri,entity:t,avatarClassName:i.profileIcon,imageClassName:i.imageProfileIcon}),v().createElement("div",{className:i.profileInfo},v().createElement("div",null,v().createElement(bf(),{variant:"h6",className:i.label},a(c)),u&&v().createElement(bf(),{variant:"subtitle2",className:i.secondaryLabel},u),p&&v().createElement(bf(),{variant:"subtitle1",className:i.businessCard},p)),v().createElement("div",{className:i.specialInfo},v().createElement("div",{className:i.entityType},v().createElement(sE,{entity:t,size:"medium",className:i.badge}),!(0,S.isTempUri)(m)&&l&&v().createElement(rg(),{title:li().text("Copy to clipboard")},v().createElement(bf(),{display:"inline",variant:"body2",className:i.entityId,onClick:s},li().text("Entity ID"),": ",f))))),r&&v().createElement("div",null,r)))},II=v().createContext(!1);II.displayName="BlockImageGalleryDialogContext";var NI=r(31574),PI=r.n(NI);const DI=v().createContext([]);var kI=r(24436),LI=r.n(kI);function UI(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){jI(e,t,r[t])}))}return e}function jI(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const FI=(0,wp.Z)((e=>({basicViewPaper:UI({display:"flex",flexDirection:"column"},e.basicView)})));function MI(){return MI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},MI.apply(null,arguments)}const VI=(0,b.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","className"]);const i=FI();return v().createElement(LI(),MI({ref:t,className:n,classes:{root:i.basicViewPaper}},a),r)}));VI.displayName="BasicView";var BI=r(52574);const zI="1px solid #AFD4E9",HI=(0,wp.Z)({decorator:{marginLeft:8,borderLeft:zI,"&:last-child":{borderLeft:"none","&:before":{borderLeft:zI}},"&:before":{top:0,height:14,width:5,borderBottom:zI,content:'""',display:"block",left:"0"},"&$plain":{"&:before":{width:0}}},plain:{},wrapper:{marginLeft:16,marginTop:-8}}),YI=({className:e,children:t,plain:r=!1,enabled:n=!1})=>{const a=HI();return n?v().createElement("div",{"data-reltio-id":"branch-decorator",className:O()(a.decorator,{[a.plain]:r},e)},v().createElement("div",{className:a.wrapper},t)):v().createElement(v().Fragment,null,t)},WI="commentsContainerVisibilityArea",GI=v().createContext([]);GI.displayName="RelatedObjectUrisContext";const qI={comments:[],commentsMap:null,currentComment:null,updateCommentState:_.identity,clearCommentState:_.identity,getCommentState:()=>({}),getComment:_.identity,getComments:()=>new Promise(_.identity),getCommentsCount:_.identity,createComment:()=>new Promise(_.identity),editComment:()=>new Promise(_.identity),createReply:()=>new Promise(_.identity),resolveThread:_.identity,reOpenThread:_.identity,clearCurrentComment:_.identity,deleteComment:_.identity,sending:!1,loading:!1,pageToken:null,deleteReply:_.identity,editReply:()=>new Promise(_.identity)},ZI=v().createContext(qI);function $I(){return $I=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$I.apply(null,arguments)}ZI.displayName="CollaborationContext";const KI=e=>v().createElement("svg",$I({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgCommentBubble"},e),v().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"})),XI=(0,wp.Z)((()=>({root:{position:"relative",height:"18px",display:"flex",alignItems:"center",justifyContent:"center",marginLeft:"4px",cursor:"pointer"},icon:{"&:hover":{fillOpacity:.7}}})));function QI(){return QI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},QI.apply(null,arguments)}const JI=v().forwardRef(((e,t)=>{let{children:r,tooltipTitle:n,icon:a,onClick:i,className:o}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","tooltipTitle","icon","onClick","className"]);const s=XI();return v().createElement(rg(),{title:n},v().createElement("div",QI({ref:t,className:O()(s.root,o),onClick:i},l),v().createElement(a,{className:s.icon}),r))}));JI.displayName="BasicCommentButton";const eN=(0,wp.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"}}),tN=v().forwardRef((({children:e,onClick:t},r)=>{const n=eN();return v().createElement(JI,{ref:r,tooltipTitle:li().text("Show comment"),icon:KI,onClick:t,"data-reltio-id":"reltio-comment-button"},v().createElement("div",{className:n.childrenWrapper},e))}));function rN(){return rN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rN.apply(null,arguments)}tN.displayName="CommentButton";const nN=e=>v().createElement("svg",rN({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgAddComment"},e),v().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"})),aN=({className:e,onClick:t})=>v().createElement(JI,{className:e,onClick:t,tooltipTitle:li().text("Add comment"),icon:nN});var iN=r(94511),oN=r.n(iN),lN=r(59674);const sN=(0,wp.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 cN(){return cN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cN.apply(null,arguments)}const uN=e=>{let{children:t,className:r,classes:n,transition:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","className","classes","transition"]);const o=sN(),l=a?oN():v().Fragment,[s,c]=(0,b.useState)(null);return v().createElement(lN.r,cN({className:O()(o.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},i),(({TransitionProps:e})=>v().createElement(l,e,v().createElement(LI(),{className:O()(o.paper,null==n?void 0:n.root)},v().createElement("span",{className:O()(o.arrow,null==n?void 0:n.arrow),ref:c}),t))))};var pN=r(93526),dN=r.n(pN);const mN=(0,wp.Z)((e=>({menuItem:{minHeight:"32px"},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0}}))),fN=(0,ld.T)(qp()),yN=(0,b.forwardRef)((({item:e,onMenuClose:t=_.identity},r)=>{const n=mN(),{disabled:a,text:i,tooltip:o,onClick:l,id:s="",selectable:c,selected:u}=e;return v().createElement(fN,{tooltipTitle:o,showForDisabled:!0,classes:{root:n.menuItem},onClick:e=>{t(e),l(e)},disabled:a,ref:r,"data-modal":!0,"data-reltio-id":`reltio-search-menu-item${s}`},c&&v().createElement(Wp(),{checked:u,color:"primary"}),v().createElement(bf(),{classes:{root:n.menuText}},i))}));yN.displayName="DefaultMenuItemRenderer";const gN=(0,wp.Z)((e=>({buttonRoot:{"&$selected":{color:e.palette.action.active,backgroundColor:(0,wm.alpha)(e.palette.action.active,.12),"&:hover":{backgroundColor:(0,wm.alpha)(e.palette.action.active,.15)}}},selected:{},paper:{minWidth:"112px"}})));function hN(){return hN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hN.apply(null,arguments)}function EN({className:e,menuId:t,buttonComponent:r=Wh(),buttonContent:n,menuItems:a=[],buttonProps:i={},popoverProps:o={},onMenuOpen:l=_.identity,onMenuClose:s=_.identity,MenuItemRenderer:c=yN}){const u=r,p=gN(),d=(0,b.useRef)(),[m,f]=(0,b.useState)(!1);(0,dE.D)((()=>{m?l():s()}),[m]);const y=(0,b.useCallback)((e=>{null==e||e.stopPropagation(),f((e=>!e))}),[]);return v().createElement(v().Fragment,null,v().createElement(u,hN({"data-reltio-id":"drop-down-menu-button",ref:d,className:O()(p.buttonRoot,{[p.selected]:m},e),onClick:y,"aria-pressed":m,"aria-controls":m?t:void 0,"aria-haspopup":"true"},i),n),v().createElement(dN(),hN({id:t,variant:"menu",open:m,autoFocus:!1,classes:{paper:p.paper},anchorEl:d.current,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},elevation:2,MenuListProps:{autoFocusItem:m}},o),a.map(((e,t)=>v().createElement(c,{item:e,key:t,onMenuClose:y})))))}const bN=(e,t)=>{(0,b.useEffect)((()=>{if(t){var r,n,a,i;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===(i=e.current)||void 0===i||i.setSelectionRange(t,t)}}),[e,t])},vN=(e,t)=>{const r=e.relatedObjectUris.indexOf(t);if(r>=0)return e.relatedObjectUris[1-r]},TN=e=>`${li().date(e,"LT")} ${li().date(e,"LL")}`,ON=e=>`comment/${e.commentId}`,SN=(e,t)=>`comment/${e.commentId}/reply/${t.replyId}`,xN=(e,t)=>{let r=e;for(const e of t)r=r.split(`+${e}`).join(`@[${e}](${e})`);return r},CN=v().createContext({});CN.displayName="EntitiesMapContext";const wN=(0,wp.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 AN(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const RN=({comment:e,className:t})=>{const r=wN(),n=(0,b.useContext)(CN),a=(0,w.AH)(),i=(0,w.eh)();return v().createElement(PI(),{className:t},(()=>{switch(e.objectType){case S.CollaborationObjectTypes.ENTITY_ATTRIBUTE:{const t=(0,S.getAttributeTypeUriByValueUri)(e.objectId,i.type),n=(0,S.findAttributeTypeByUri)(a,t);return v().createElement(v().Fragment,null,v().createElement(bf(),{className:r.title},li().text("Selected attribute:")),v().createElement(bf(),{className:r.label},null==n?void 0:n.label))}case S.CollaborationObjectTypes.RELATION_ATTRIBUTE:{const t=e.relatedObjectUris.find((0,_.startsWith)("configuration/relationTypes")),n=t&&(0,S.getAttributeTypeUriByValueUri)(e.objectId,t),i=n&&(0,S.findAttributeTypeByUri)(a,n);return v().createElement(v().Fragment,null,v().createElement(bf(),{className:r.title},li().text("Selected attribute:")),v().createElement(bf(),{className:r.label},null==i?void 0:i.label))}case S.CollaborationObjectTypes.ENTITY:return v().createElement(v().Fragment,null,v().createElement(bf(),{className:r.title},li().text("Selected profile:")),v().createElement(Md,{className:O()(r.label,r.link),value:(0,S.getEntityUriForLink)(i)},(0,S.getLabel)(i.label)));case S.CollaborationObjectTypes.RELATION:{const t=vN(e,i.uri),a=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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){AN(e,t,r[t])}))}return e}({},n[t]||{},{uri:t});return v().createElement(v().Fragment,null,v().createElement(bf(),{className:r.title},li().text("Selected relation:")),v().createElement(bf(),{className:r.label},v().createElement(Md,{className:r.link,value:(0,S.getEntityUriForLink)(i)},(0,S.getLabel)(i.label)),t&&v().createElement(v().Fragment,null,` ${li().text("to")} `,v().createElement(Md,{className:r.link,value:(0,S.getEntityUriForLink)(a)},a.label?(0,S.getLabel)(a.label):(0,S.getEntityId)(a)))))}case S.CollaborationObjectTypes.POTENTIAL_MATCH:{var t;const a=vN(e,i.uri),o={uri:a,label:null===(t=n[a])||void 0===t?void 0:t.label};return v().createElement(v().Fragment,null,v().createElement(bf(),{className:r.title},li().text("Selected potential match:")),v().createElement(bf(),{className:r.label},v().createElement(Md,{className:r.link,value:(0,S.getEntityUriForLink)(i)},(0,S.getLabel)(i.label)),a&&v().createElement(v().Fragment,null,` ${li().text("and")} `,v().createElement(Md,{className:r.link,value:(0,S.getEntityUriForLink)(o)},o.label?(0,S.getLabel)(o.label):(0,S.getEntityId)(o)))))}default:return null}})())},_N=v().createContext([]);_N.displayName="UsersContext";const IN=(0,wp.Z)((e=>({root:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",wordBreak:"break-word"}}))),NN=({comment:e,className:t})=>{const r=IN(),n=(0,b.useContext)(_N);return v().createElement(bf(),{className:O()(r.root,t)},((e,t,r=(e=>e),n="+")=>{const a=[];let i="",o=!1;for(let l=0;l<=e.length;l++){const s=e[l],c=e[l+1],u=l===e.length-1;i+=s,s===n&&0===l&&(o=!0),o&&t.includes(i.slice(n.length))&&(o=!1,a.push(r(i)),i=""),c===n&&(o=!0,a.push(i),i=""),u&&a.push(i)}return a})(e.content,e.namedUsers,(e=>{const t=n.find((t=>t.username===e.slice(1)));return t?v().createElement(ty(),{href:`mailto:${t.email}`,underline:"hover"},e):e})).map(((e,t)=>v().createElement(b.Fragment,{key:t},e))))},PN=(0,wp.Z)((e=>({root:{width:"32px",height:"32px",fontSize:"12px",color:e.palette.text.secondary,backgroundColor:"rgba(144, 164, 174, 0.2)"}})));function DN(){return DN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},DN.apply(null,arguments)}const kN=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","children"]);const a=PN();return v().createElement(C(),DN({},n,{className:O()(a.root,t)}),r.split(".").map((e=>e[0].toUpperCase())).join(""))};var LN=r(2271);const UN=r(47503).$+1,jN=(0,wp.Z)((e=>({root:{backgroundColor:"#fff",fontFamily:"Roboto"},mentionsControl:{fontSize:"13px"},mentionsHighlighter:{padding:"10px 22px",border:"1px solid transparent !important","&::before":{content:({placeholder:e})=>e&&`"${e}"`}},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:UN+"!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)"},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 FN(){return FN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},FN.apply(null,arguments)}const MN=e=>{let{onChange:t,className:r,value:n,placeholder:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onChange","className","value","placeholder"]);const o=jN({placeholder:n?"":a}),l=(0,b.useContext)(_N);return v().createElement("div",{className:O()(o.root,r)},v().createElement(LN.r,FN({},i,{value:n,placeholder:a,onChange:(e,r,n,a)=>{t(r,n,(0,_.uniq)(a.map((({display:e})=>e.slice(1)))))},className:"mentionsTextArea",suggestionsPortalHost:document.body,allowSuggestionsAboveCursor:!0,classNames:{mentionsTextArea__input:o.mentionsInput,mentionsTextArea__highlighter:o.mentionsHighlighter,mentionsTextArea__control:o.mentionsControl,mentionsTextArea__suggestions:o.mentionsSuggestions,mentionsTextArea__suggestions__list:o.mentionsSuggestionsList,mentionsTextArea__suggestions__item:o.mentionsSuggestionsItem}}),v().createElement(LN.p,{trigger:"+",data:l.map((({username:e})=>({id:e,display:e}))),displayTransform:(e,t)=>`+${t}`,appendSpaceOnAdd:!0,className:o.mention})))},VN=(0,wp.Z)({root:({isEditing:e})=>({padding:e?"6px 6px 6px 0":" 6px 6px 6px 8px",borderRadius:"4px",backgroundColor:e?"transparent":"rgba(0,114,206,0.06)"}),textField:({isEditing:e})=>({width:e?"100%":"calc(100% - 40px)"}),form:{marginBottom:0},main:{display:"flex",alignItems:"center"},avatar:{marginRight:"8px"},buttons:({isEditing:e})=>({marginLeft:e?"0":"40px",marginTop:"8px"}),button:{"& + $button":{marginLeft:"8px"}}}),BN=e=>{switch(e){case"open":return li().text("Reply...");case"resolved":return li().text("Adding a comment will re-open this");default:return""}},zN=({inputRef:e,className:t,uri:r,relatedObjectUris:n,objectType:a,popperRef:i,comment:o,reply:l,isEditingComment:s,isEditingReply:c,onCancel:u})=>{const p=s||c,d=VN({isEditing:p}),[m,f]=(0,b.useState)(!1),{createReply:y,createComment:g,sending:h,editComment:E,editReply:T,getCommentState:S,updateCommentState:x,clearCommentState:C}=(0,b.useContext)(ZI),A=(0,w.qg)(),R=(({comment:e,reply:t,isEditingComment:r,isEditingReply:n})=>(0,_.isNil)(e)?"comment/new":r?ON(e):n?SN(e,t):(e=>`comment/${e.commentId}/reply/new`)(e))({comment:o,reply:l,isEditingComment:s,isEditingReply:c}),I=(({comment:e,reply:t,isEditingComment:r,isEditingReply:n})=>{const a=r?e:n?t:null,{content:i="",namedUsers:o=[]}=a||{};return{value:xN(i,o),plainTextValue:i,mentions:o}})({comment:o,reply:l,isEditingComment:s,isEditingReply:c}),{value:N=I.value,plainTextValue:P=I.plainTextValue,mentions:D=I.mentions}=S(r,R),k=""!==I.value.trim(),L=""!==N.trim(),U=m||L||k,j=null==o?void 0:o.status,F=()=>{null==u||u(),C(r,R)};(0,b.useEffect)((()=>{i&&i.current.forceUpdate()}),[i,U]);const M=p?"small":"medium";return v().createElement(PI(),{className:O()(d.root,t)},v().createElement("form",{onSubmit:e=>(e.preventDefault(),(0,_.cond)([[(0,_.always)(!o),()=>g({content:P,namedUsers:D,objectType:a,uri:r,relatedObjectUris:n})],[(0,_.always)(s),()=>E({content:P,namedUsers:D,commentId:o.commentId,objectType:a,replies:o.replies,relatedObjectUris:n,uri:r})],[(0,_.always)(c),()=>T({content:P,namedUsers:D,commentId:o.commentId,replyId:l.replyId})],[_.T,()=>y({content:P,namedUsers:D,commentId:o.commentId,action:"open"===o.status?"none":"reopen",uri:r})]])().then(F).catch(console.log)),className:d.form},v().createElement(PI(),{className:d.main},!p&&v().createElement(kN,{classes:{root:d.avatar}},A),v().createElement(MN,{className:d.textField,disabled:h,onChange:(e,t,n)=>x(r,R,{value:e,plainTextValue:t,mentions:n}),inputRef:e,value:N,onFocus:()=>f(!0),onBlur:()=>f(!1),placeholder:BN(j)})),U&&v().createElement(PI(),{className:d.buttons},v().createElement(Wh(),{className:d.button,variant:"contained",color:"primary",disabled:!L||h,type:"submit",size:M},((e,t,r)=>t||r?li().text("Edit"):"open"===e||"resolved"===e?li().text("Reply"):li().text("Comment"))(j,s,c)),v().createElement(Wh(),{disabled:h,onClick:()=>F(),className:d.button,variant:"outlined",color:"primary",size:M},li().text("Cancel")))))},HN=(0,wp.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"}}))),YN=({onReply:e,className:t,uri:r,comment:n,relatedObjectUris:a,objectType:i})=>{const o=HN(),l=(0,b.useRef)(),s=(0,w.qg)(),{commentId:c,createdBy:u,createdTime:p,status:d}=n,m="resolved"===d,f=u===s,{resolveThread:y,reOpenThread:g,sending:h,deleteComment:E,updateCommentState:T,getCommentState:O}=(0,b.useContext)(ZI),S=ON(n),{isEditing:x}=O(r,S),C=(0,b.useCallback)((e=>T(r,S,{isEditing:e})),[S,T,r]);bN(l,x);const A=(0,b.useMemo)((()=>m?[{text:li().text("Delete"),onClick:()=>E({uri:r,commentId:c})}]:[{text:li().text("Edit"),onClick:()=>C(!0)},{text:li().text("Delete"),onClick:()=>E({uri:r,commentId:c})}]),[c,E,m,C,r]),R=v().createElement(zN,{inputRef:l,uri:r,relatedObjectUris:a,objectType:i,onCancel:()=>C(!1),isEditingComment:x,comment:n});return v().createElement(PI(),{className:t},v().createElement(PI(),{className:o.header},v().createElement(kN,{classes:{root:o.avatar}},u),v().createElement(PI(),{width:"100%"},v().createElement(bf(),{className:o.username},u)),v().createElement(bf(),{className:o.createdAt},TN(p)),f&&v().createElement(EN,{buttonComponent:Ed.k,buttonProps:{icon:Pd(),tooltipTitle:li().text("Open menu")},popoverProps:{PopoverClasses:{root:o.dropdownMenu}},menuItems:A,menuId:"collaboration-comment-menu"})),v().createElement(PI(),{className:o.body},v().createElement(RN,{comment:n,className:o.commentTarget}),x?R:v().createElement(NN,{comment:n,className:o.message}),v().createElement(PI(),{className:o.buttons},v().createElement(ty(),{className:o.button,onClick:e,component:"button",underline:"hover"},li().text("Reply")),!m&&v().createElement(ty(),{disabled:h,className:o.button,onClick:()=>{y({commentId:c,uri:r})},component:"button",underline:"hover"},li().text("Resolve")),m&&v().createElement(ty(),{disabled:h,className:o.button,onClick:()=>{g({commentId:c,uri:r})},component:"button",underline:"hover"},li().text("Re-open")))))},WN=(0,wp.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"}}))),GN=({className:e,reply:t,uri:r,comment:n,popperRef:a})=>{const i=(0,b.useRef)(),o=(0,w.qg)(),{createdBy:l,action:s,createdTime:c}=t,u=l===o&&"resolved"!==n.status,{deleteReply:p,updateCommentState:d,getCommentState:m}=(0,b.useContext)(ZI),f=SN(n,t),{isEditing:y}=m(r,f),g=(0,b.useCallback)((e=>d(r,f,{isEditing:e})),[f,d,r]);bN(i,y);const h=WN(),E=(0,b.useMemo)((()=>[{text:li().text("Edit"),onClick:()=>g(!0)},{text:li().text("Delete"),onClick:()=>p({uri:r,commentId:n.commentId,reply:t})}]),[p,r,n.commentId,t,g]),T=v().createElement(zN,{inputRef:i,popperRef:a,uri:r,onCancel:()=>g(!1),isEditingReply:y,reply:t,comment:n});return v().createElement(PI(),{className:O()(h.root,e)},v().createElement(kN,{classes:{root:h.avatar}},l),v().createElement(PI(),{className:h.replyArea},v().createElement(PI(),{className:h.header},v().createElement(bf(),{className:h.username},l),"resolve"===s&&v().createElement(bf(),{className:h.marked},li().text("Marked as resolved")),"reopen"===s&&v().createElement(bf(),{className:h.marked},li().text("Re-opened"))),"resolve"!==s&&(y?T:v().createElement(NN,{className:h.message,comment:t})),v().createElement(bf(),{className:h.createdAt},TN(c))),u&&v().createElement(EN,{buttonComponent:Ed.k,buttonProps:{icon:Pd(),tooltipTitle:li().text("Open menu")},menuItems:E,menuId:"collaboration-comment-menu"}))},qN=(0,wp.Z)((()=>({root:{maxWidth:"100%",padding:"8px 4px 10px 16px"},messages:{},repliedComment:{marginBottom:"2px"},replies:{marginLeft:"40px"},sendMessageArea:{marginLeft:"40px"},comment:{}}))),ZN=(0,b.memo)((({uri:e,relatedObjectUris:t,objectType:r,classes:n,popperRef:a,messagesRef:i,comment:o})=>{const l=(0,b.useRef)(),s=qN({classes:n}),c=v().createElement(zN,{className:s.sendMessageArea,inputRef:l,popperRef:a,uri:e,relatedObjectUris:t,objectType:r,comment:o});return v().createElement(PI(),{className:s.root},o&&v().createElement(v().Fragment,null,v().createElement("div",{className:s.messages,ref:i},v().createElement(YN,{comment:o,uri:e,onReply:()=>{l.current.focus()},className:s.comment,relatedObjectUris:t,objectType:r}),v().createElement(PI(),{className:s.replies},o.replies.map((t=>v().createElement(GN,{key:t.replyId,className:s.repliedComment,reply:t,uri:e,comment:o}))))),c),!o&&c)})),$N=(0,wp.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:({hasScroll:e})=>({marginLeft:"16px",marginRight:e?"2px":"8px"}),replies:({hasScroll:e})=>({marginLeft:"8px",marginRight:e?"2px":"8px"}),sendMessageArea:({hasScroll:e,scrollWidth:t})=>({marginLeft:"8px",marginRight:e?t+2:"8px"}),messages:{maxHeight:"400px",overflowY:"auto"}}))),KN=({uri:e,relatedObjectUris:t,objectType:r,anchorEl:n,onClose:a,open:i,comment:o})=>{const[l,s]=(0,b.useState)(0),c=$N({scrollWidth:l,hasScroll:0!==l}),u=(0,b.useRef)(null),{resolveThread:p,loading:d,sending:m}=(0,b.useContext)(ZI),f=1+(null==o?void 0:o.replies.length);return v().createElement(uN,{popperRef:u,anchorEl:n,open:i,placement:"right-start",onClose:a,className:c.popper},v().createElement(PI(),{className:c.header},v().createElement(PI(),{className:c.headerInfo},v().createElement(bf(),{className:c.title},li().text("Comments")),o&&!d&&v().createElement(bf(),{className:c.counter},li().number(f)," ",1===f?li().text("item"):li().text("items"))),o&&!d&&v().createElement(Ed.k,{className:c.resolveButton,size:"S",onClick:()=>{p({commentId:o.commentId,uri:e})},disabled:m,showForDisabled:!0,tooltipTitle:li().text("Resolve"),icon:gm(),color:"primary"})),!d&&v().createElement(ZN,{popperRef:u,messagesRef:e=>{e&&s(e.offsetWidth-e.clientWidth)},classes:{root:c.collaborationItem,replies:c.replies,sendMessageArea:c.sendMessageArea,messages:c.messages,comment:c.comment},uri:e,relatedObjectUris:t,objectType:r,comment:o}))},XN=(0,wp.Z)((()=>({root:{display:"flex",alignItems:"start"},addButton:{visibility:"hidden","&$showAlways":{visibility:"visible"},".commentsContainerVisibilityArea:hover &":{visibility:"visible"}},showAlways:{}}))),QN=({className:e,uri:t,objectType:r,relatedObjectUris:n,onChangePopupVisibility:a,allowOnlyOneComment:i=!1,showAlways:o=!1})=>{const l=XN(),[s,c]=(0,b.useState)(null),[u,p]=(0,b.useState)(!1),d=u&&Boolean(s),{currentComment:m,commentsMap:f,getComment:y,clearCurrentComment:g,objectTypes:h}=(0,b.useContext)(ZI),E=!!f&&(!h||h.includes(r)),T=((null==f?void 0:f[t])||[]).filter((({status:e})=>"resolved"!==e)).reverse(),S=!i||i&&0===T.length,x=null===m&&d;(0,dE.D)((()=>{a&&a(d)}),[d]);const C=(0,b.useContext)(GI),w=(0,b.useMemo)((()=>C?[...n,...C]:n),[C,n]);return E&&v().createElement("div",{className:O()(l.root,e)},S&&v().createElement(aN,{className:O()(l.addButton,{[l.showAlways]:o||x}),onClick:e=>{c(e.currentTarget),p(!0)}}),T.map((({replies:e,commentId:t})=>v().createElement(tN,{ref:t===(null==m?void 0:m.commentId)?c:null,key:t,onClick:()=>(e=>{y(e),p(!0)})(t)},1+e))),v().createElement(KN,{anchorEl:s,open:d,onClose:()=>{c(null),g(),p(!1)},uri:t,relatedObjectUris:w,objectType:r,comment:m}))},JN=(0,wp.Z)({label:{color:"rgba(0,0,0,0.6)",fontSize:"13px",lineHeight:"16px"}});function eP(){return eP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},eP.apply(null,arguments)}const tP=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","isRequired","className"]);const i=JN();return v().createElement(bf(),eP({className:O()(i.label,n),component:"span"},a),t,r&&v().createElement(ad,null))},rP=v().createContext(null);rP.displayName="EntityContext";const nP=(0,wp.Z)((e=>({container:{height:"16px",borderColor:(0,wm.alpha)(e.palette.primary.main,.54)},label:{paddingLeft:"4px",paddingRight:"4px",fontSize:"10px",lineHeight:"11px",color:e.palette.primary.main}}))),aP=(0,ld.T)(ug()),iP=({className:e,attributeType:t,nonOvValues:r=[],nonOvTotal:n})=>{const a=nP(),i=(0,w.ax)("openEntity"),o=((e,t,r)=>{var n;const a=null==t||null===(n=t[0])||void 0===n?void 0:n.uri,i=a?(0,S.getEntityUriFromAttributeUri)(a):null;if(i&&(0,S.isEntityUri)(i)){const t=(0,S.getEntityUriFromAttributeUri)(r.uri);if(!e||e.type===t)return{uri:i,type:t};const n=(0,S.getParentUri)(a),o=(0,S.findAttributeValueByUri)(e,n);return{uri:(0,S.getReferencedEntityUriFromAttrValue)(o),type:t}}return e?{uri:e.uri,type:e.type}:null})((0,b.useContext)(rP),r,t),l=(0,w.fC)(null==o?void 0:o.type),s=(0,b.useCallback)((()=>{i({uri:o.uri,screen:"sources"})}),[i,o]);if(!n)return null;const c=r.length?r.map(((e,r)=>v().createElement("div",{key:r},(0,S.isComplexAttribute)(t)?(0,S.getLabel)(e.label):v().createElement(Hd.x,{value:(0,S.getAttributeValue)(e),dataTypeDefinition:(0,S.getAttrDataTypeDefinition)(t),rich:!1})))):null;return v().createElement(aP,{tooltipTitle:c,tooltipPlacement:"bottom",label:`+ ${n}`,variant:"outlined",onClick:null!=o&&o.uri&&l?s:void 0,classes:{root:O()(a.container,e),label:a.label}})};function oP(){return oP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},oP.apply(null,arguments)}const lP=e=>v().createElement("svg",oP({width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgDescription"},e),v().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})),sP=v().createContext({showDescription:!1,showNavigateToGraph:!0});sP.displayName="FeaturesContext";const cP=(0,wp.Z)((()=>({icon:{display:"inline-flex",marginLeft:"8px",verticalAlign:"middle"}}))),uP=({className:e,description:t})=>{const{showDescription:r}=(0,b.useContext)(sP),n=cP();return t&&r?v().createElement(rg(),{title:t,placement:"bottom"},v().createElement("span",{"data-reltio-id":"reltio-description-icon",className:O()(n.icon,e)},v().createElement(lP,null))):null};var pP=r(87558);const dP=(0,r(87171).k)({unmaskedAttributes:{},unmaskAttributeValue:void 0,maskAttributeValue:void 0}),mP=e=>(0,pP.S)(dP,e),fP=v().createContext({appearance:void 0,attributes:void 0,roles:void 0,tags:void 0});fP.displayName="HistoryDiffContext";const yP=v().createContext({highlightedValuesUris:[],highlightedClassName:""});function gP(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}yP.displayName="HighlightedValuesContext";const hP=(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 i=(null==e?void 0:e.attributes)||(null==e?void 0:e.analyticsAttributes)||[];return a.length&&(i=i.filter((e=>a.includes(e.uri)))),i.reduce(((e,a)=>{const i=EP(t[a.name],n,r);return i&&i.length&&(Array.isArray(i[0])?e.push({[a.uri]:i[0]}):e.push({[a.uri]:i})),e}),[])},EP=(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,i=(0,S.findAttributeTypeByUri)(t,n.type);a&&"object"!=typeof a&&(0,S.isOv)(n)?e.push(bP(a,i)):a&&"object"==typeof a&&!Array.isArray(a)&&e.push(hP(i,a,r,t))}return e}),[])},bP=(e,t)=>{switch(null==t?void 0:t.type){case S.DataTypes.TYPE_DATE:return new Date(e).getTime();case S.DataTypes.TYPE_TIMESTAMP:return isNaN(Number(e))?new Date(e).getTime():new Date(Number(e)).getTime();default:return e}};function vP(){return vP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vP.apply(null,arguments)}const TP=e=>v().createElement("svg",vP({width:11,height:11,viewBox:"0 0 11 11","data-reltio-id":"SvgPivotingIcon"},e),v().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"})),OP=(0,wp.Z)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}}))),SP=(0,b.forwardRef)((({value:e,attributeType:t,children:r,className:n,onClick:a},i)=>{const o=OP(),{generatePivotingUrl:l}=(0,b.useContext)(jd),s=l({uiPath:(0,w.Qh)(),uri:t.uri,value:JSON.stringify(e)}),c=(0,b.useCallback)((e=>{(0,xp.rR)(e)||(a(),e.preventDefault()),e.stopPropagation()}),[a]);return v().createElement("a",{ref:i,href:s,onClick:c,className:O()(o.link,n)},r)}));SP.displayName="PivotingUriLink";const xP=(0,wp.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"}}))),CP=({attributeType:e,label:t,entities:r,generatedValue:n,onSeeAllClick:a,total:i})=>{const o=xP(),l=i>6,s=Boolean(t);return v().createElement("div",{className:o.container},v().createElement("div",{className:o.header},v().createElement("div",{className:o.title},li().text("Pivot profiles")),v().createElement("div",{className:o.divider}),v().createElement("div",{className:o.headerCount},li().number(i,"0,0")+" "+(1===i?li().text("item"):li().text("items")))),s&&v().createElement("div",{className:o.entityTypeLabel},t),v().createElement("div",{className:o.body},r.map((e=>v().createElement("div",{key:e.uri,className:o.entityContainer},v().createElement(A,{entity:e,avatarClassName:o.profileIcon}),v().createElement(Md,{className:o.entityLabel,value:(0,S.getEntityUriForLink)(e)},(0,S.getLabel)(e.label)))))),l&&v().createElement("div",{className:o.footer},v().createElement(SP,{value:n,attributeType:e,className:o.seeAllButton,onClick:a},li().text("See all"))))},wP=(0,wp.Z)((e=>({icon:{marginRight:"8px",verticalAlign:"middle",width:"12px",height:"12px"},content:{color:e.palette.primary.main,cursor:"pointer",lineHeight:"16px"}}))),AP=(0,wp.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"}}}),RP=({value:e,attributeType:t,children:r,className:n})=>{const a=AP(),i=wP(),o=(0,b.useContext)(DI)||[],l=(0,w.ax)("openPivotingPerspective"),s=(0,w.AH)()||{},c=(0,S.isNested)(t)?hP(t,e.value,o,s):bP(e.lookupCode||e.value,t),u=o.some((({uri:e})=>e===t.uri))&&(Array.isArray(c)&&c.length||!Array.isArray(c)&&!(0,_.isNil)(c)),p=o.find((({uri:e})=>e===t.uri)),d=null==p?void 0:p.popup,m=u?Array.isArray(c)?c.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[(0,S.getLastUriPart)(e),t]))))):((e,t)=>[{[e.name]:t}])(t,c):void 0,f=()=>{l({value:m,attributeType:t})},{entities:y,total:g,loadPivotingData:h}=(({value:e,attributeType:t,entityType:r})=>{const[n,a]=(0,b.useState)([]),[i,o]=(0,b.useState)(0),l=(0,Th._)(),s=(0,w.eh)(),c=(0,w.mU)(),u=r||(null==s?void 0:s.type),p=(0,b.useMemo)((()=>(0,S.convertPivotingValueToSearchFilters)({value:e,attributeType:t,entityType:u})),[t,u,e]),d=(0,b.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){gP(e,t,r[t])}))}return e}({max:6,sort:"label"},c||{})),[c]),m=(0,b.useCallback)((()=>{l(Promise.all([(0,S.getFilteredEntities)({filters:p,options:d}),(0,S.getTotals)({filters:p,options:d})])).then((e=>{const[t,{total:r}]=e;a(Array.isArray(t)?t:[]),o(r)})).catch((()=>{a([]),o(0)}))}),[p,d,l]);return{entities:n,total:i,loadPivotingData:m}})({attributeType:t,value:c,entityType:null==d?void 0:d.entityType});return u?v().createElement(rg(),{arrow:!0,placement:"right-start",classes:a,disableInteractive:!1,onOpen:h,title:v().createElement(CP,{generatedValue:m,attributeType:t,label:null==d?void 0:d.label,onSeeAllClick:f,entities:y,total:g})},v().createElement("span",{className:n},v().createElement(TP,{className:i.icon}),v().createElement(SP,{onClick:f,className:i.content,value:m,attributeType:t},r))):v().createElement(v().Fragment,null,r)};var _P=r(78577),IP=r.n(_P),NP=r(46157),PP=r.n(NP);const DP=(0,wp.Z)((e=>({icon:{color:e.palette.text.secondary,fontSize:18},switcherWrapper:{verticalAlign:"middle",marginLeft:8,width:"16px",height:"16px"}}))),kP=({className:e,isMasked:t,isUnmasking:r,onToggleMasking:n})=>{const a=DP(),i=t?li().text("Show"):li().text("Hide");return r?v().createElement(dm(),{size:16,className:O()(e,a.switcherWrapper)}):v().createElement(rg(),{key:String(t),title:i},v().createElement(Hh(),{"aria-label":i,onClick:n,className:O()(e,a.switcherWrapper)},t?v().createElement(PP(),{className:a.icon}):v().createElement(IP(),{className:a.icon})))};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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){UP(e,t,r[t])}))}return e}function UP(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jP=(0,wp.Z)((e=>({root:{display:"flex",alignItems:"start",justifyContent:"space-between"},commentsContainer:{height:"15px",marginRight:"-4px"},attributeValue:{verticalAlign:"middle",wordBreak:"break-all"},updateAttribute:LP({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},S.historyPalettes[S.HistoryOperations.updateAttribute],{"& > a":{color:S.historyPalettes[S.HistoryOperations.updateAttribute].color}}),insertAttribute:LP({width:"fit-content"},S.historyPalettes[S.HistoryOperations.insertAttribute],{"& > a":{color:S.historyPalettes[S.HistoryOperations.insertAttribute].color}}),deleteAttribute:LP({width:"fit-content",padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},S.historyPalettes[S.HistoryOperations.deleteAttribute],{"& > a":{color:S.historyPalettes[S.HistoryOperations.deleteAttribute].color}}),multilineAttribute:{width:"fit-content"},ovFalse:e.inactive}))),FP=({className:e,attributeType:t=null,attributeValue:r,inlined:n})=>{const{isUnmaskingNeeded:a,isMasked:i,toggleMasking:o,attributeValue:l,isUnmasking:s}=(({attributeType:e,attributeValue:t})=>{const r=mP((({unmaskAttributeValue:e})=>e)),n=mP((({maskAttributeValue:e})=>e)),{attributeValue:a,isUnmasked:i=!1,loading:o=!1}=(l=t.uri,mP((({unmaskedAttributes:e})=>e[l]))||{});var l;const s=r&&n&&!!e.masking,c=(0,b.useCallback)((()=>s?r(t.uri):Promise.resolve()),[r,t.uri,s]),u=(0,b.useCallback)((()=>{i?n(t.uri):c()}),[t.uri,i,n,c]);return{isUnmaskingNeeded:s,isMasked:!i,toggleMasking:u,isUnmasking:o,unmask:c,attributeValue:s&&i&&a||t}})({attributeType:t,attributeValue:r}),c=jP(),{highlightedValuesUris:u=[],highlightedClassName:p}=(0,b.useContext)(yP),{appearance:d}=(0,b.useContext)(fP),m=(0,S.getHistoryAppearanceByUri)(l.uri,d),f=(0,S.getHistoryAttributeClassName)(m),y=(0,b.useMemo)((()=>v().createElement(Hd.x,{value:(0,S.getAttributeValue)(l),dataTypeDefinition:(0,S.getAttrDataTypeDefinition)(t)})),[l,t]),g=(0,S.isRelationUri)(l.uri)?S.CollaborationObjectTypes.RELATION_ATTRIBUTE:S.CollaborationObjectTypes.ENTITY_ATTRIBUTE,h=a&&v().createElement(kP,{isMasked:i,onToggleMasking:o,isUnmasking:s});return n||f?v().createElement("div",{className:O()(e,{[p]:u.includes(l.uri)})},v().createElement(RP,{value:l,attributeType:t,key:l.uri,className:O()({[c.multilineAttribute]:!n})},v().createElement("span",{className:O()(c.attributeValue,c[f],{[c.ovFalse]:!(0,S.isOv)(l)}),"data-reltio-id":"reltio-attribute-value"},y,h))):v().createElement("div",{className:O()(e,c.root,WI,{[p]:u.includes(l.uri)})},v().createElement(RP,{value:l,attributeType:t,key:l.uri},v().createElement("span",{className:O()(c.attributeValue,{[c.ovFalse]:!(0,S.isOv)(l)}),"data-reltio-id":"reltio-attribute-value"},y,h)),v().createElement(QN,{className:c.commentsContainer,uri:l.uri,relatedObjectUris:(0,S.createRelatedObjectUris)(g,{uri:l.uri}),objectType:g}))};var MP=r(84419),VP=r.n(MP);const BP=(0,wp.Z)({expandButton:{"&:hover":{backgroundColor:"transparent"}},expandIcon:{transition:"transform .15s ease"},expanded:{transform:"rotate(90deg)"}});function zP(){return zP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zP.apply(null,arguments)}const HP=e=>{const t=BP(),{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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["expanded","className"]);return v().createElement(Cp.T,zP({icon:VP(),size:"XXS",disableRipple:!0,iconClassName:O()(t.expandIcon,{[t.expanded]:r}),className:O()(n,t.expandButton),"data-reltio-id":"arrow-expand-button"},a))},YP=(0,wp.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 WP(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const GP=({attributeTypesList:e,attributeValue:t,label:r,expanded:n=!1,children:a,showNonOv:i,attributeType:o,classes:l,LabelRenderer:s,RightSlot:c})=>{const u=YP(),p=t.uri,[d,m]=(0,b.useState)(!1),{highlightedValuesUris:f=[],highlightedClassName:y}=(0,b.useContext)(yP);(0,b.useEffect)((()=>{m(n)}),[n]);const g=(e||[]).some((e=>(0,S.isAnalyticAttribute)(e))),h=(0,b.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){WP(e,t,r[t])}))}return e}({attributes:g?null:t.value,analyticsAttributes:g?t.value:null},(0,S.isSpecialAttribute)(o)?t.value:{})),[t,g,o]),E=(0,S.isRelationUri)(t.uri)?S.CollaborationObjectTypes.RELATION_ATTRIBUTE:S.CollaborationObjectTypes.ENTITY_ATTRIBUTE;return v().createElement("div",{className:u.complexContainer},v().createElement("div",{className:O()(u.labelContainer,WI)},v().createElement(HP,{onClick:()=>m((e=>!e)),expanded:d}),s?v().createElement(s,{attributeType:o,attributeValue:t}):v().createElement(v().Fragment,null,v().createElement(bf(),{component:"span",variant:"body2",classes:{body2:u.label},className:O()({[y]:f.includes(t.uri),[u.ovFalse]:!(0,S.isOv)(t)}),"data-reltio-id":"reltio-attribute-complex-label"},r),v().createElement("div",{className:u.spacer}),c&&v().createElement(c,{attributeType:o,attributeValue:t}),v().createElement(QN,{uri:t.uri,relatedObjectUris:(0,S.createRelatedObjectUris)(E,{uri:t.uri}),objectType:E}))),d&&v().createElement(kF,{attrTypes:e,entity:h,drawLines:!0,parentUri:p,showNonOv:i,classes:l},a))};var qP=r(29195);function ZP(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){$P(e,t,r[t])}))}return e}function $P(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const KP=(0,wp.Z)({label:{textDecoration:"none",verticalAlign:"middle"},updateAttribute:ZP({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},S.historyPalettes[S.HistoryOperations.updateAttribute]),insertAttribute:ZP({width:"fit-content"},S.historyPalettes[S.HistoryOperations.insertAttribute]),deleteAttribute:ZP({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},S.historyPalettes[S.HistoryOperations.deleteAttribute]),pivotingTooltip:{marginLeft:"4px"}});function XP(){return XP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},XP.apply(null,arguments)}const QP=(0,b.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=KP(),{appearance:i}=(0,b.useContext)(fP),o=(0,b.useMemo)((()=>{const e=(0,S.getHistoryAppearanceByUri)(t.uri,i),n=(0,S.getHistoryAttributeClassName)(e),o=t.label?t.label:(0,S.evaluateDeepEntityLabel)(t,r.dataLabelPattern);return v().createElement(RP,{className:a.pivotingTooltip,value:t,attributeType:r},v().createElement(PI(),{component:"span",className:O()(a[n],a.label)},v().createElement(qP.b,{text:(0,S.getLabel)(o)})))}),[i,a,t,r]);return v().createElement(GP,XP({label:o,attributeValue:t,attributeTypesList:(0,S.getAttributeTypeSubAttributes)({},r),attributeType:r},n))}));var JP=r(24217),eD=r(16782);const tD=(0,wp.Z)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}})));function rD(){return rD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rD.apply(null,arguments)}const nD=e=>{const t=tD(),r=(0,eD.GV)(),{href:n,className:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["href","className"]),o=O()(t.link,a);return r&&n?v().createElement(JP.rU,rD({to:n.replace(window.location.origin,""),className:o},i)):v().createElement("a",rD({href:n,className:o},i))};function aD(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){iD(e,t,r[t])}))}return e}function iD(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const oD=(0,wp.Z)((e=>({relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary},updateAttribute:aD({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},S.historyPalettes[S.HistoryOperations.updateAttribute]),insertAttribute:aD({width:"fit-content"},S.historyPalettes[S.HistoryOperations.insertAttribute]),deleteAttribute:aD({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},S.historyPalettes[S.HistoryOperations.deleteAttribute]),ovFalse:e.inactive})));function lD(){return lD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lD.apply(null,arguments)}const sD=(0,b.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=oD(),i=(0,w.AH)(),o=(0,w.Qh)(),l=(0,S.getReferencedEntityUriFromAttrValue)(t),s=(0,b.useMemo)((()=>(0,S.getAttributeTypeSubAttributes)(i,r)),[r,i]),{appearance:c}=(0,b.useContext)(fP),{generateEntityUrl:u}=(0,b.useContext)(jd),p=(0,b.useMemo)((()=>{const e=(0,S.getHistoryAppearanceByUri)(t.uri,c),r=(0,S.getHistoryAttributeClassName)(e),n=null!=l&&l.startsWith("changeRequests")?"dcrReview":"profile";return v().createElement(nD,{href:(0,S.isEmptyValue)(c)?u({uiPath:o,uri:l,screen:n}):void 0,className:O()(a[r],{[a.ovFalse]:!(0,S.isOv)(t)})},v().createElement(qP.b,{text:(0,S.getLabel)(t.label)}),t.relationshipLabel&&v().createElement("span",{className:a.relationshipLabel},v().createElement(qP.b,{text:t.relationshipLabel})))}),[t,c,o,l,a,u]);return v().createElement(GP,lD({attributeTypesList:s,attributeValue:t,label:p,attributeType:r},n))}));sD.displayName="ReferenceAttribute";const cD=e=>{const{attributeType:t}=e;return class{static build(e,t={}){switch(e.type){case S.DataTypes.TYPE_NESTED:return v().createElement(QP,t);case S.DataTypes.TYPE_REFERENCE:return v().createElement(sD,t);default:return v().createElement(FP,t)}}}.build(t,e)};function uD(){return uD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},uD.apply(null,arguments)}const pD=e=>v().createElement("svg",uD({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgControlAttribute"},e),v().createElement("mask",{id:"ControlAttribute_svg__a",fill:"#fff"},v().createElement("path",{d:"M10.966 9.203a3.2 3.2 0 11-.018-2.449l-1.375.581a1.707 1.707 0 10.01 1.307l1.383.561z"})),v().createElement("path",{d:"M10.966 9.203a3.2 3.2 0 11-.018-2.449l-1.375.581a1.707 1.707 0 10.01 1.307l1.383.561z",stroke:"#72828B",strokeWidth:4,mask:"url(#ControlAttribute_svg__a)"}),v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.297 8.965a4.804 4.804 0 004.068 3.793v1.61a6.403 6.403 0 01-5.693-5.403h1.625zm4.068-5.724a4.803 4.803 0 00-4.124 4.124h-1.61a6.402 6.402 0 015.734-5.734v1.61zm5.393 4.124a4.804 4.804 0 00-3.793-4.068V1.672a6.403 6.403 0 015.404 5.693h-1.61zm-.055 1.6a4.806 4.806 0 01-3.738 3.738v1.625a6.405 6.405 0 005.363-5.363h-1.625z",fill:"#72828B"})),dD=(0,wp.Z)({icon:{display:"inline-flex",marginLeft:"8px",verticalAlign:"middle"}});function mD(){return mD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mD.apply(null,arguments)}const fD=(0,b.forwardRef)(((e,t)=>v().createElement("span",mD({},e,{ref:t}),v().createElement(pD,null))));fD.displayName="ControlAttributeForwarded";const yD=(0,ld.T)(fD),gD=()=>{const e=dD();return v().createElement(yD,{"data-reltio-id":"reltio-control-attribute-icon",tooltipTitle:li().text("This is a control attribute. Changing this value will affect availability of other conditional attributes."),className:e.icon})};function hD(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ED(e,t,r[t])}))}return e}function ED(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bD="13px",vD="16px",TD={titleRow:{display:"inline-block",minHeight:"16px"},title:{wordBreak:"break-all",verticalAlign:"middle"},ovIcon:{marginLeft:"8px",textIndent:0},descriptionIcon:{textIndent:0}},OD=(0,wp.Z)({paddingWrapper:{paddingTop:"3px",paddingBottom:"5px","&:last-child":{paddingBottom:"2px"}},paddingWrapperWithLines:{paddingBottom:"1px","&:last-child":{paddingBottom:"2px"}}}),SD=(0,wp.Z)(hD({wrapper:{fontSize:bD,lineHeight:vD},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"}},TD)),xD=(0,wp.Z)(hD({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start",fontSize:bD,lineHeight:vD},attribute:{"&:last-child":{marginBottom:0},paddingLeft:"4px",paddingRight:"4px",marginLeft:"5px",marginBottom:"4px",whiteSpace:"pre-wrap",wordBreak:"break-word"},attributes:{alignSelf:"stretch"},titleRow:hD({},TD.titleRow,{marginBottom:"3px"})},TD)),CD=({value:e,nonVisibleValues:t,attributeType:r,showNonOv:n,totalNonVisibleValues:a,classes:i})=>{const o=SD(),{label:l,description:s}=r,c=(0,w.Ws)(),u=(0,b.useMemo)((()=>c.includes(r.uri)),[c,r.uri]),p=(0,S.isRelationUri)(e.uri)?S.CollaborationObjectTypes.RELATION_ATTRIBUTE:S.CollaborationObjectTypes.ENTITY_ATTRIBUTE;return v().createElement("div",{"data-reltio-id":"one-line-renderer",className:O()(o.collaborationWrapper,WI)},v().createElement("div",{className:O()(o.titleRow,o.wrapper)},v().createElement(tP,{label:l,className:O()(o.title,null==i?void 0:i.title),"data-reltio-id":"reltio-attribute-label"}),v().createElement(uP,{description:s,className:o.descriptionIcon}),u&&v().createElement(gD,null),v().createElement(iP,{nonOvValues:t,attributeType:r,className:o.ovIcon,nonOvTotal:a}),v().createElement(cD,{className:O()(o.attribute,null==i?void 0:i.content),attributeValue:e,attributeType:r,showNonOv:n,inlined:!0,classes:i})),v().createElement(QN,{uri:e.uri,relatedObjectUris:(0,S.createRelatedObjectUris)(p,{uri:e.uri}),objectType:p}))};var wD=r(33062),AD=r.n(wD);const RD=(0,wp.Z)({link:{display:"flex",marginTop:4},icon:{fontSize:"1rem"}}),_D=({moreNumber:e,valueNumber:t,onClick:r})=>{const n=RD();return v().createElement(ty(),{"data-reltio-id":"show-more",component:"button",variant:"caption",className:n.link,onClick:r,underline:"none"},v().createElement(AD(),{className:n.icon}),e&&t?li().text("Show ${moreNumber} more of remaining ${valueNumber} value",{moreNumber:e,valueNumber:t}):li().text("Show more"))};var ID=r(86800),ND=r.n(ID);const PD=(0,wp.Z)({link:{display:"flex",marginTop:4},icon:{fontSize:"1rem"}}),DD=({onClick:e})=>{const t=PD();return v().createElement(ty(),{component:"button",variant:"caption",className:t.link,onClick:e,underline:"none"},v().createElement(ND(),{className:t.icon}),li().text("Show less"))},kD=({max:e,values:t,nonVisibleValues:r,totalVisibleValues:n,attributeType:a,parentUri:i,requestNextPageOfAttributeValues:o,showNonOv:l,totalNonVisibleValues:s,classes:c})=>{const u=xD(),[p,d]=(0,b.useState)(e),m=(0,w.Ws)(),f=(0,b.useMemo)((()=>m.includes(a.uri)),[m,a.uri]),y=e<n,g=y&&p<n,h=y&&p>=n,{label:E,description:T}=a,S=t.slice(0,p),x=n-p;return v().createElement("div",{"data-reltio-id":"multi-line-renderer",className:u.wrapper},v().createElement("div",{className:u.titleRow},v().createElement(tP,{label:E,className:O()(u.title,null==c?void 0:c.title),"data-reltio-id":"reltio-attribute-label"}),v().createElement(uP,{description:T}),f&&v().createElement(gD,null),v().createElement(iP,{nonOvValues:r,attributeType:a,className:u.ovIcon,nonOvTotal:s})),v().createElement("div",{className:u.attributes},S.map((e=>v().createElement(cD,{key:e.uri,className:O()(u.attribute,null==c?void 0:c.content),attributeValue:e,attributeType:a,showNonOv:l,classes:c})))),g&&v().createElement(_D,{moreNumber:(0,_.min)(e,x),valueNumber:x,onClick:()=>{t.length<n&&o({parentUri:i,attributeTypeUri:a.uri,attributeTypeName:a.name,values:t,defaultMaxValues:e}),d(p+e)}}),h&&v().createElement(DD,{onClick:()=>{d(e)}}))};var LD=r(88941),UD=r.n(LD);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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const MD=(0,wp.Z)({attributeValue:{verticalAlign:"middle"},insertAttribute:jD({width:"fit-content"},S.historyPalettes[S.HistoryOperations.insertAttribute]),deleteAttribute:jD({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},S.historyPalettes[S.HistoryOperations.deleteAttribute])}),VD=({value:e})=>{const t=MD(),{appearance:r}=(0,b.useContext)(fP),n=(0,w.AH)(),a=(0,S.getHistoryAppearanceBySpecialAttributeValue)("roles",e,r),i=(0,S.getHistoryAttributeClassName)(a);return v().createElement("span",{className:O()(t.attributeValue,t[i])},(0,S.getRoleLabel)(n,e))},BD=({className:e,values:t,Component:r,dataReltioId:n})=>v().createElement("div",{className:e,"data-reltio-id":n},t.map(((e,n)=>v().createElement(b.Fragment,{key:e},v().createElement(r,{value:e}),n<t.length-1&&", ")))),zD=({className:e,values:t})=>v().createElement(BD,{values:t,className:e,dataReltioId:"reltio-attribute-value",Component:VD});function HD(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){YD(e,t,r[t])}))}return e}function YD(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const WD=(0,wp.Z)({attributeValue:{verticalAlign:"middle"},insertAttribute:HD({width:"fit-content"},S.historyPalettes[S.HistoryOperations.insertAttribute]),deleteAttribute:HD({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},S.historyPalettes[S.HistoryOperations.deleteAttribute])}),GD=({value:e})=>{const t=WD(),r=(0,b.useContext)(rP),{appearance:n}=(0,b.useContext)(fP),{generateTagUrl:a}=(0,b.useContext)(jd),i=(0,w.eh)(),o=(0,w.Qh)(),l=(0,S.getHistoryAppearanceBySpecialAttributeValue)("tags",e,n),s=(0,S.getHistoryAttributeClassName)(l),c=r||i;return v().createElement(nD,{className:O()(t.attributeValue,t[s]),href:a({uiPath:o,tag:e,entityUri:c.dataTenant?(0,S.getDataTenantEntityUri)(c):c.uri})},e)},qD=({className:e,values:t})=>v().createElement(BD,{values:t,className:e,dataReltioId:"reltio-attribute-value",Component:GD}),ZD=({values:e,attributeType:t,classes:r})=>{const n=SD(),{label:a}=t;return v().createElement("div",{"data-reltio-id":"special-renderer",className:O()(n.titleRow,n.wrapper)},(i=n.titleIcon,t.uri===S.EntityAttrTypes.tags.uri?v().createElement(UD(),{className:i}):null),v().createElement(tP,{label:a,className:O()(n.title,null==r?void 0:r.title),"data-reltio-id":"reltio-attribute-label"}),(n=>{switch(t.uri){case S.EntityAttrTypes.tags.uri:return v().createElement(qD,{className:n,values:e});case S.EntityAttrTypes.roles.uri:return v().createElement(zD,{className:n,values:e});default:return v().createElement(cD,{className:n,attributeValue:{value:e[0],uri:""},attributeType:t,inlined:!0,classes:r})}})(O()(n.attribute,null==r?void 0:r.content)));var i};var $D=r(97986),KD=r.n($D);function XD(){return XD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},XD.apply(null,arguments)}const QD=e=>v().createElement("svg",XD({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgDefaultImage"},e),v().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("path",{d:"M0 0h24v24H0z"}),v().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"}))),JD={SMALL:{imageWidth:114,imageHeight:114},MEDIUM:{imageWidth:162,imageHeight:162},LARGE:{imageWidth:192,imageHeight:192},OVERRIDE:{imageWidth:"unset",imageHeight:"unset"}},ek=(0,wp.Z)((e=>({root:{position:"relative"},image:({imageWidth:e,imageHeight:t})=>({width:e,height:t,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 tk(){return tk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tk.apply(null,arguments)}const rk=(0,b.memo)((e=>{const{src:t,className:r,containerClassName:n,size:a=JD.SMALL,overlay:i=null}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["src","className","containerClassName","size","overlay"]),l=a||JD.SMALL,s=ek(l),[c,u]=(0,b.useState)(um.oA.LOADING);(0,b.useEffect)((()=>{u(um.oA.LOADING)}),[t]);const p=c===um.oA.LOADING,d=c===um.oA.LOADED;return c===um.oA.ERROR?v().createElement("div",tk({className:O()(s.defaultContainer,s.image,r)},o),v().createElement(KD(),{className:s.defaultImage})):v().createElement("div",{className:O()(s.root,n)},!(0,S.isEmptyValue)(t)&&v().createElement("img",tk({src:t,className:O()(s.image,r,{[s.hideImage]:p}),onLoad:()=>{u(um.oA.LOADED)},onError:()=>{u(um.oA.ERROR)},alt:"image"},o)),p&&v().createElement("div",tk({className:O()(s.defaultContainer,s.image,r)},o),v().createElement(QD,{className:s.defaultImage})),d&&i)})),nk={imageMargin:4,imageWidth:JD.SMALL.imageWidth,imageHeight:JD.SMALL.imageHeight};var ak=r(59849),ik=r.n(ak),ok=r(47867),lk=r.n(ok),sk=r(93643),ck=r.n(sk);const uk=(0,wp.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)"}}))),pk=({attributeValues:e,setAttributeValueIndex:t,attributeValueIndex:r})=>{const n=uk(),a=(0,b.useRef)(null);return(0,b.useEffect)((()=>{if(null!=a&&a.current){const e=a.current.scrollLeft,t=a.current.offsetWidth+e,n=96*r+16*r+12;t<n?a.current.scroll&&(n>t+96+16?a.current.scroll(n,0):a.current.scroll(112+e,0)):e+96>n&&a.current.scroll&&a.current.scroll(n-96,0)}}),[r,a]),v().createElement("div",{ref:a,className:n.thumbnails},v().createElement(ck(),{container:!0,wrap:"nowrap",direction:"row",spacing:1,className:n.gridContainer},e.map((({uri:e,value:a},i)=>v().createElement(ck(),{item:!0,key:e},v().createElement(rk,{onClick:()=>t(i),className:O()(n.thumb,{[n.inactiveThumb]:r!==i}),src:(0,S.getImageAttributeOvThumbnailUrl)({value:a})}))))))},dk=(0,wp.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%)"}}))),mk=({className:e,attributeValues:t,attributeValueIndex:r,setAttributeValueIndex:n})=>{const a=dk(),i=t[r],o=(0,S.getImageAttributeOvPreviewUrl)(i);return v().createElement("div",{className:O()(a.root,e)},v().createElement("div",{className:a.main},r>0&&v().createElement(Cp.T,{icon:ik(),className:O()(a.arrowButton,a.arrowButtonPrev),onClick:()=>{n(r-1)},size:"XL"}),v().createElement(rk,{containerClassName:a.mainImageContainer,className:a.mainImage,size:o&&JD.OVERRIDE,src:o}),r!==t.length-1&&v().createElement(Cp.T,{icon:lk(),className:O()(a.arrowButton,a.arrowButtonNext),onClick:()=>{n(r+1)},size:"XL"})),v().createElement(pk,{attributeValues:t,attributeValueIndex:r,setAttributeValueIndex:n}))};var fk=r(71884),yk=r.n(fk);const gk=(0,_.curry)(((e,t)=>(0,_.filter)((t=>(t.label||t.name).toLowerCase().includes(e.toLowerCase())))(t))),hk=({attrTypes:e,filter:t="",sortingFn:r})=>(0,_.pipe)(gk(t),(0,_.sort)(r),(0,_.map)((e=>({item:{id:e.uri,label:e.label||e.name,attrType:e}}))))(e);var Ek=function(e){return e.parent="parent",e.attributes="attributes",e}(Ek||{});const bk=(0,wp.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"}}),vk=({label:e,popupTitle:t=e,data:r,parent:n,dense:a,onApply:i})=>{const o=bk(),l=(0,b.useRef)(),[s,c]=(0,b.useState)(!1),[u,p]=(0,b.useState)(""),[d,m]=(0,b.useState)([]),{items:f,hasGroups:y,parentGroupLength:g,attributesGroupLength:h}=(({data:e,parent:t,filter:r})=>{const n=(0,w.mT)(),a=Boolean(t),i=(0,b.useMemo)((()=>n===S.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),[n]),o=(0,b.useMemo)((()=>a?hk({attrTypes:[t],filter:r,sortingFn:i}):[]),[a,t,r,i]),l=(0,b.useMemo)((()=>a&&null!=o&&o.length?[{item:{id:Ek.parent,label:li().text("Parent")},items:o}]:[]),[a,o]),s=(0,b.useMemo)((()=>hk({attrTypes:e,filter:r,sortingFn:i})),[e,r,i]),c=(0,b.useMemo)((()=>a&&null!=s&&s.length?[{item:{id:Ek.attributes,label:li().text("Attributes")},items:s}]:s),[a,s]),u=(0,b.useMemo)((()=>Lp((l||[]).concat(c))),[l,c]),p=l.length,d=c.length;return{items:u,hasGroups:a,parentGroupLength:p,attributesGroupLength:d}})({data:r,parent:n,filter:u}),E=(0,b.useCallback)(((e,t)=>{m((0,_.ifElse)((0,_.always)(t),(0,_.append)(e),(0,_.reject)((0,_.propEq)("id",e.id)))(d))}),[d]),T=(0,b.useCallback)(((e,t)=>t.items?40:28),[]),x=(0,b.useCallback)((({item:e})=>{E(e,(0,_.not)((0,_.any)((0,_.propEq)("id",e.id))(d)))}),[E,d]),{focusIndex:C,handleKeyDown:A}=Bp({items:f,open:s,onSelectFocusedItem:x,selectedItems:d}),R=(0,b.useRef)(null);R.current=C;const I=y?(g?1:0)+(h?1:0):0,N=f.length-I,P=Math.min(255,28*N+40*I),D=Math.max(140,P+112),k=(0,b.useCallback)(((e,{item:t,level:r=0},n)=>{var a;const i=(0,_.any)((0,_.propEq)("id",t.id))(d),o=R.current===n;return v().createElement(pd,{key:t.uri,onClick:E,checked:i,level:r,data:t,label:v().createElement(dd.o,{text:t.label,highlight:u}),labelInText:t.label,style:e,isFocused:o,isRequired:!(null===(a=t.attrType)||void 0===a||!a.required),LogoIcon:t.LogoIcon})}),[u,E,d]),L=(0,b.useCallback)(((e,t)=>v().createElement(Xm(),{component:"div",className:o.subHeader,style:e,key:`group-${t.item.id}`},t.item.label)),[]);return v().createElement("div",{className:O()(o.moreAttributes,{[o.dense]:a})},v().createElement(Wh(),{color:"primary",onClick:()=>c(!s),ref:l,className:o.moreButton},v().createElement(yk(),{classes:{root:o.icon}}),v().createElement("div",{className:o.buttonLabel},e)),v().createElement(kp,{open:s,className:O()(o.moreAttributesPopup,o.popupContainer),anchorEl:l.current,onClose:(0,_.pipe)((()=>{d.length>0&&i((0,_.pluck)("attrType",d))}),(()=>c(!1)),(()=>p("")),(()=>m([]))),onSearch:p,containerHeight:D,title:t,containerWidth:320,searchInputOnKeyDown:A},v().createElement(Vp,{getItemSize:T,renderItem:k,renderGroupTitle:L,disableHorizontalScrollbar:!0,items:f,height:P,focusIndex:C}),0===f.length&&v().createElement("div",{className:o.noResultsCaptionContainer},v().createElement(bf(),{variant:"caption",display:"block",gutterBottom:!0},li().text("No results found")))))},Tk=v().createContext({canCreate:!0,canUpdate:!0,canDelete:!0});Tk.displayName="ConfigPermissionsContext";const Ok=e=>{const{canCreate:t,canUpdate:r,canDelete:n}=(0,b.useContext)(Tk),a=(0,S.isTempUri)(e);return(0,b.useMemo)((()=>({canCreate:t,canUpdate:a||r,canDelete:a||n})),[a,t,r,n])},Sk={get CreationTime(){return li().text("Creation Time")},get CreationDate(){return li().text("Creation Date")},get Dimensions(){return li().text("Dimensions")},get MimeType(){return li().text("Mime Type")},get Size(){return li().text("Size")},get Url(){return li().text("Full image URL (S3)")},get UrlPreview(){return li().text("Preview image URL (S3)")},get UrlThumbnail(){return li().text("Small image URL (S3)")},get CdnUrl(){return li().text("Full image URL (CDN)")},get CdnUrlPreview(){return li().text("Preview image URL (CDN)")},get CdnUrlThumbnail(){return li().text("Small image URL (CDN)")}},xk=({value:e}={},t)=>["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail","MimeType"].includes(t)?(0,_.path)([t,0,"value"],e):"CreationDate"===t&&(0,_.path)(["CreationTimestamp",0,"value"],e)?Ma()(e.CreationTimestamp[0].value).format("MM-DD-YYYY"):"CreationTime"===t&&(0,_.path)(["CreationTimestamp",0,"value"],e)?Ma()(e.CreationTimestamp[0].value).format("HH:mm:ss"):"Dimensions"===t&&(0,_.path)(["Height",0,"value"],e)&&(0,_.path)(["Width",0,"value"],e)?`${e.Height[0].value} x ${e.Width[0].value} ${li().text("pixels")}`:"Size"===t&&(0,_.path)(["Size",0,"value"],e)?`${(Number(e.Size[0].value)/1e3).toFixed(2)} KB`:void 0,Ck=(e=[])=>e.filter((({system:e})=>!e)),wk=(e,t)=>{const{includeNames:r=[],excludeNames:n=[],order:a=[]}=t,i=r.length?e.filter((e=>r.includes(e))):e.filter((e=>!n.includes(e)));return 0===a.length?i:i.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}))},Ak=(e={},t,r)=>{const n=Ck(t.attributes);return wk(Object.keys(e.value||{}),r).reduce(((t,r)=>{const a=n.find((({name:e})=>e===r));return a?[...t,{attrType:a,values:e.value[r]}]:t}),[])},Rk=e=>["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail"].includes(e),_k=(0,wp.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:{}}),Ik=({attributeType:e,onAddAttributes:t,uri:r})=>{const n=_k(),a=Ck(e.attributes),{canCreate:i}=(0,b.useContext)(Tk),o=i&&Boolean(t);return v().createElement(PI(),null,v().createElement(bf(),{className:O()(n.title,{[n.canAdd]:o})},li().text("Meta info")),o&&v().createElement(b.Fragment,null,v().createElement(vk,{label:li().text("Attributes"),data:a,dense:!1,onApply:e=>{t&&t(e.map((e=>({attributeType:e,parentUri:r}))))}}),v().createElement(Af(),{className:n.divider})))},Nk=(0,wp.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"}}))),Pk=({title:e,content:t,isLink:r,children:n})=>{const a=Nk();return v().createElement("div",{className:a.root},v().createElement("span",{className:a.title},e),r?v().createElement("a",{className:a.link,href:t},li().text("link")):v().createElement("span",{className:a.content},t||n))},Dk=(0,wp.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"}}),kk=({attributeValue:e,attributeType:t,imageAttributeFieldsOrder:r})=>{const n=Dk(),a=(0,w.xH)(),i=(o=e,l=r,wk(Object.keys(Sk),l).map((e=>xk(o,e)?{title:Sk[e],value:xk(o,e),isLink:Rk(e)}:null)).filter(Boolean));var o,l;const s=Ak(e,t,r),c=(0,b.useMemo)((()=>({title:n.title,content:n.content})),[n]);return v().createElement(PI(),{className:n.root},i.map((({title:e,value:t,isLink:r})=>v().createElement(Pk,{key:e,isLink:r,title:e,content:t}))),a&&s.map((({attrType:t,values:r})=>v().createElement(PF,{key:t.uri,attributeType:t,drawLines:!1,values:r,classes:c,parentUri:e.uri}))))},Lk=(0,wp.Z)((e=>({caption:{display:"flex",color:e.palette.error.main,fontSize:"12px",lineHeight:"16px"}}))),Uk=({className:e,message:t})=>{const r=Lk();return t?v().createElement(bf(),{variant:"caption",className:O()(r.caption,e)},t):null};var jk=r(66826),Fk=r.n(jk),Mk=r(95210),Vk=r(70485),Bk=r.n(Vk),zk=r(53167),Hk=r.n(zk);const Yk=(0,wp.Z)({wrapper:{width:"100%"},helperText:{margin:"3px 0 1px 12px"}});function Wk(){return Wk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wk.apply(null,arguments)}const Gk=(0,b.memo)((e=>{let{errorMessage:t,children:r,className:n,classes:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["errorMessage","children","className","classes"]);const o=Yk(),l=!!t;return v().createElement(Bk(),Wk({variant:"standard",className:O()(o.wrapper,n,null==a?void 0:a.root),error:!0},i),r,l&&v().createElement(Hk(),{className:O()(o.helperText,null==a?void 0:a.helperText)},v().createElement(Uk,{message:t})))}));Gk.displayName="ErrorWrapper";const qk=(e,t,r,n)=>{const a=(0,_.pipe)(S.getEntityType,(0,_.defaultTo)({}),(0,_.props)(["attributes","analyticsAttributes"]),(0,_.reject)(_.isNil),_.flatten,(0,_.concat)(_.__,(0,_.pipe)(_.values,(0,_.reject)((0,_.propEq)("uri",S.EntityAttrTypes.id.uri)))(S.EntityAttrTypes)))(e,t);return r.length?a.filter((({uri:e})=>r.includes(e))):a.filter((({uri:e})=>!n.includes(e)))},Zk=(e,t)=>(0,_.partition)((0,_.pipe)((0,_.path)(["attrType","uri"]),(0,_.includes)(_.__,e)),t),$k=(0,_.eqBy)((0,_.pick)(["fieldName","uri","entityTypeUri"])),Kk=(e,t)=>t&&!!t.find($k(e)),Xk=(0,_.curry)(((e,t,r)=>{const n=((e,t)=>{const{type:r}=(0,S.getAttrDataTypeDefinition)(e);switch(r){case S.DataTypes.TYPE_BOOLEAN:case S.DataTypes.TYPE_BOOLEAN_RADIO:case S.DataTypes.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t.toString();case S.DataTypes.TYPE_DATE:return t&&Ma()(t).format("YYYY-MM-DD")||"";case S.DataTypes.TYPE_TIMESTAMP:return t&&Ma()(t).utc().format()||"";case S.DataTypes.TYPE_ACTIVENESS_DATE:case S.DataTypes.TYPE_LOCAL_DATE:return t&&t.valueOf();default:return t||""}})(t,r);return{value:n,uri:e.uri,attributeType:t}})),Qk=v().createContext({enabled:!1,queueSizeThreshold:0});Qk.displayName="AsyncMountContext";let Jk=0;function eL(){return eL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},eL.apply(null,arguments)}var tL=r(50548);const rL=v().createContext(!1);rL.displayName="ProfilePerspectiveViewContext";let nL=function(e){return e.Error="Error",e.NewAttribute="NewAttribute",e.NewView="NewView",e}({});const aL=e=>e===nL.Error,iL=v().createContext({element:null,type:null,highlightView:_.identity,highlightError:_.identity,highlightAttribute:_.identity,scrollIntoRef:_.identity});function oL(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){lL(e,t,r[t])}))}return e}function lL(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sL={content:'""',position:"absolute",left:"-1000px",top:"0px",width:"5000px",height:"calc(100% - 10px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},cL=(0,wp.Z)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlightError:{"&::before":oL({},sL,{background:"rgba(255, 0, 0, 0.06)"})},highlightWarning:{"&::before":oL({},sL,{background:"rgba(228, 151, 0, 0.08)"})},simpleAttribute:{position:"relative","&::before":{top:"-4px",height:"calc(100% + 8px)"}}}))),uL=({highlightedError:e,isSimple:t=!1})=>{const r=cL(),n=(0,b.useRef)(null),a=(0,_.pathOr)(S.ErrorSeverity.ERROR,["element","severity"])(e),i=O()({[r.highlightError]:a===S.ErrorSeverity.ERROR,[r.highlightWarning]:a===S.ErrorSeverity.WARNING,[r.simpleAttribute]:t});return(0,b.useEffect)((()=>{e&&e.scrollIntoRef(n)}),[e]),e?{ref:n,errorClassName:i}:{ref:n}};var pL=r(51894);const dL=(0,wp.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 mL(){return mL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mL.apply(null,arguments)}const fL=(0,tL.l)(iL,((e,{attributeValue:t})=>{const{element:r,type:n}=e||{};return{highlightedError:aL(n)&&(null==r?void 0:r.uri)===t.uri?e:null}}),(e=>{let{className:t,attributeValue:r,attributeType:n,isReltioCrosswalk:a,ownError:i,mode:o,onAddOneMore:l,onDeleteAttribute:s,onChangeAttribute:c,onDeactivateError:u,additionalControlsRenderer:p,state:d,highlightedError:m,isEmptyEditor:f=!1}=e,y=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.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 g=dL(),h="deleted"===d,E="edited"===d,T=(0,S.isEditableMode)(o),{canCreate:x,canEdit:C,canDelete:A}=(({attributeType:e,attributeValue:t,isReltioCrosswalk:r,mode:n})=>{const{canCreate:a,canUpdate:i,canDelete:o}=Ok(t.uri);return{canCreate:a&&(0,S.checkCanCreateAttribute)({attributeType:e,mode:n}),canEdit:i&&(0,S.checkCanEditAttribute)({attributeType:e,attributeValue:t,mode:n,isReltioCrosswalk:r}),canDelete:o&&(0,S.checkCanDeleteAttribute)({attributeType:e,attributeValue:t,mode:n,isReltioCrosswalk:r})}})({attributeValue:r,attributeType:n,mode:o,isReltioCrosswalk:a}),R=C&&T,I=(0,S.getErrorMessage)(i),N=(0,w.ZI)(r,n),{ref:P,errorClassName:D}=uL({highlightedError:m,isSimple:!0});(0,b.useEffect)((()=>{f&&(0,S.isDependentLookupAttrType)(n)&&!(0,_.has)("lookupCode",r)&&c({attributeType:n,uri:r.uri,value:r.value,silent:!0})}),[f]);const k=(0,b.useMemo)((()=>(0,S.getAttrDataTypeDefinition)(n)),[n]),L=(0,b.useMemo)((()=>((e,{type:t})=>{const{value:r,lookupCode:n}=e||{};switch(t){case S.DataTypes.TYPE_BOOLEAN:case S.DataTypes.TYPE_BOOLEAN_RADIO:case S.DataTypes.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,S.parseBoolean)(r);case S.DataTypes.TYPE_DATE:return r&&S.utils.dates.toLocalDate(r)||null;case S.DataTypes.TYPE_LOCAL_DATE:case S.DataTypes.TYPE_TIMESTAMP:case S.DataTypes.TYPE_ACTIVENESS_DATE:return r&&new Date(r)||null;case S.DataTypes.TYPE_DEPENDENT_LOOKUP:case S.DataTypes.TYPE_LOOKUP:return{value:r,lookupCode:n};default:return r}})(r,k)),[r,k]),U=(0,b.useCallback)((()=>{i&&u((0,S.getErrorId)(i))}),[i,u]),j=(0,b.useCallback)((0,_.pipe)(Xk(r,n),c,U),[r,n,c,U]),F=!!l&&x&&!n.singleValue,M=!h&&!!s&&A,V=!!I,B=h?{disabled:!0,isCrossedOut:!0}:{},z=(0,b.useContext)(rL),{autopopulationContextValue:H}=(({enabled:e,attributeTypeUri:t,valueUri:r})=>{const n=(0,w.ax)("dependentLookupsEditorTouched"),a=(0,w.Pl)(),i=(0,w.h0)(r),o=e&&(0,S.isAutopopulationEnabled)(a,t),l=o?r:null,{isTouched:s=!1}=o&&i||{},c=(0,b.useCallback)((e=>{n({uri:e,isTouched:!0})}),[n]);return{autopopulationContextValue:(0,b.useMemo)((()=>l?{id:l,isTouched:s,onTouch:c}:null),[l,s,c])}})({enabled:z&&(0,S.isDependentLookupAttrType)(n),attributeTypeUri:null==n?void 0:n.uri,valueUri:r.uri});return v().createElement("div",{ref:P,className:O()(g.editor,t,D)},v().createElement(Gk,{errorMessage:I,className:g.errorWrapper},v().createElement("div",{className:O()(g["editor-value"],{[g.deleted]:h},{[g["editor-read-only-value"]]:!R}),"data-reltio-id":"reltio-attribute-value"},R?v().createElement(pL.m.Provider,{value:H},v().createElement(Mk.Z,mL({fieldName:(0,S.attributeUriToSearchUri)(n.uri),value:L,dataTypeDefinition:k,error:V,onChange:j,fullWidth:!0},N,y,B))):v().createElement(Hd.x,{value:(0,S.getAttributeValue)(r),dataTypeDefinition:k}))),v().createElement("div",{className:g["editor-actions"]},E&&v().createElement(bf(),{variant:"caption",className:g.editedLabel},"(",li().text("edited"),")"),F&&v().createElement(Cp.T,{icon:yk(),onClick:l,size:"L",className:O()(g.addButton,g.button),"data-reltio-id":"reltio-add-one-more-simple-attribute-button"}),p&&p({attributeType:n,attributeValue:r}),M&&v().createElement(Cp.T,{className:g.button,icon:Fk(),onClick:()=>{s({uri:r.uri,attributeType:n}),(0,S.getErrorType)(i)!==S.ErrorType.missed&&U()},size:"L","data-reltio-id":"reltio-delete-simple-attribute-button"})))})),yL=((e,t=null)=>{const r=(0,b.forwardRef)(((r,n)=>(()=>{const e=(0,b.useRef)(!0),{enabled:t,queueSizeThreshold:r=0}=(0,b.useContext)(Qk),[n,a]=(0,b.useState)(!t||t&&Jk<r);e.current&&Jk++;const i=(0,b.useRef)();return(0,b.useEffect)((()=>{if(Jk--,!n)return i.current=setTimeout((()=>{a(!0)}),0),()=>clearTimeout(i.current)}),[]),e.current=!1,n})()?v().createElement(e,eL({},r,{ref:n})):t&&v().createElement(t,eL({},r,{ref:n}))));return r.displayName="WithAsyncMount",r})(fL,(()=>{const e=dL();return v().createElement("div",{className:e.placeholder})})),gL=[S.EntityAttrTypes.roles.uri,S.EntityAttrTypes.tags.uri],hL=v().createContext(null),EL=v().createContext(null),bL=(0,b.createContext)({});function vL(){return vL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vL.apply(null,arguments)}function TL(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const OL=(0,tL.l)(iL,(e=>{const{highlightAttribute:t}=e||{};return{highlightAttribute:t}}),(({parentAttributeType:e,attrTypes:t,entity:r,parentUri:n,showEmptyEditors:a,mode:i,crosswalks:o,drawLines:l,children:s,className:c,alwaysVisibleTypeUris:u=gL,onAddAttributes:p,onChangeAttribute:d,onDeleteAttribute:m,additionalControlsRenderer:f,showNonOv:y,highlightAttribute:g})=>{const h=(0,b.useContext)(bL),E=n&&(0,S.getBaseUri)(n),T=(0,b.useMemo)((()=>h[E]||[]),[h,E]),O=(0,b.useMemo)((()=>t.filter((e=>!T.includes(e.uri)))),[t,T]),{attributes:x={}}=r,[C,w]=(0,b.useState)({}),A=(0,b.useCallback)(((e,t)=>{w((r=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){TL(e,t,r[t])}))}return e}({},r,{[e]:t})))}),[]);(0,b.useEffect)((()=>{w({})}),[n]);const{canCreate:R}=(0,b.useContext)(Tk),I=(0,b.useMemo)((()=>R&&e&&(0,S.checkCanCreateAttribute)({attributeType:e,mode:i})),[e,i,R]),N=((e,t,r,n)=>e.filter((e=>{const a=((e,t)=>{const{attributes:r={},analyticsAttributes:n={}}=t;return(0,_.cond)([[S.isSpecialAttribute,(0,_.always)(t)],[(0,_.both)(S.isAnalyticAttribute,(0,_.always)(n)),(0,_.always)(n)],[_.T,(0,_.always)(r)]])(e)})(e,t),i=(e=>(0,S.isSpecialAttribute)(e)?"uri":"name")(e);return!((e.singleValue||(0,S.isRoleAttrType)(e)||(0,S.isTagAttrType)(e))&&((0,_.has)(e[i])(a)||r&&(null==n||!n[e.uri])))})))((0,b.useMemo)((()=>R?(0,S.getCreatableAttributeTypes)(i,O):[]),[O,i,R]),r,a,C),P=(0,b.useContext)(hL),D=(0,b.useMemo)((()=>(0,S.getAttributesListForEditMode)(O,i,r,a,y,P,R)),[O,i,r,a,y,P,R]),[k,L]=(0,b.useMemo)((()=>Zk(u,D)),[D,u]),U=(0,b.useCallback)((t=>{p(t.map((t=>({attributeType:t,parentUri:t===e?(0,S.getParentUri)(n):n})))),g((0,_.last)(t),nL.NewAttribute)}),[p,n,e]),j={enabled:l},F=(0,b.useMemo)((()=>({hasDeletionsMap:C,setHasDeletions:A})),[C,A]);return v().createElement("div",{className:c},s&&v().createElement(YI,j,s),v().createElement(YI,vL({},j,{plain:!0}),N.length>0&&v().createElement(vk,{label:li().text("More attributes"),onApply:U,dense:l,data:N,parent:I&&e})),v().createElement(EL.Provider,{value:F},L.concat(k).map((({attrType:e,values:t})=>v().createElement(zj,{key:`${e.uri}_${n}`,attributeType:e,drawLines:l,values:t,paging:(0,_.path)(["paging",e.uri],x),parentUri:n,showEmptyEditors:a,mode:i,crosswalks:o,onAddAttributes:p,onChangeAttribute:d,onDeleteAttribute:m,additionalControlsRenderer:f,showNonOv:y})))))})),SL=(0,wp.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}}))),xL=(0,tL.l)(iL,((e,{attributeValue:t})=>{const{element:r,type:n}=e||{},a=aL(n);return{highlightedError:a&&(null==r?void 0:r.uri)===t.uri?e:null,isHighlightedPath:a&&(0,_.pipe)((0,_.propOr)([],"path"),(0,_.any)((0,_.pathEq)(["value","uri"],t.uri)))(r)}}),(({label:e,attributeTypesList:t,attributeType:r,attributeValue:n,children:a,errors:i,ownError:o,mode:l,metadata:s,crosswalks:c,lazy:u,showEmptyEditors:p,onAddOneMore:d,onAddAttributes:m,onDeleteAttribute:f,onChangeAttribute:y,additionalControlsRenderer:g,hideDeleteButton:h,state:E,showNonOv:T,isHighlightedPath:x,highlightedError:C,expanded:w=!1})=>{const A=SL(),R="deleted"===E,_="edited"===E,I=n.uri,N=(0,S.isTempUri)(I),P=N||w,[D,k]=(0,b.useState)(P),{ref:L,errorClassName:U}=uL({highlightedError:C});(0,b.useEffect)((()=>{x&&k(!0)}),[x]),(0,b.useEffect)((()=>{k(P)}),[P]);const{canDelete:j}=Ok(n.uri),F=(0,b.useMemo)((()=>j&&(0,S.checkCanDeleteAttribute)({attributeType:r,attributeValue:n,mode:l,metadata:s,isReltioCrosswalk:(0,S.isReltioCrosswalk)(c,n)})),[r,n,l,s,c,j]),M=!R&&!h&&!!f&&F,V=(0,b.useMemo)((()=>(0,S.hasAttributeDescendantsWithErrors)(n,i)),[i,n]);(0,b.useEffect)((()=>{V&&k(!0)}),[i,V]),(0,b.useEffect)((()=>{R&&k(!1)}),[R]);const B=(t||[]).some((e=>(0,S.isAnalyticAttribute)(e))),z=(0,b.useMemo)((()=>({attributes:B?null:n.value,analyticsAttributes:B?n.value:null})),[n,B]),H=(0,S.getErrorMessage)(o)||V&&li().text("Has an incorrect value")||"";return u?v().createElement(Wh(),{variant:"text",color:"primary",onClick:d},"Create attribute"):v().createElement("div",{ref:L,"data-reltio-id":"reltio-edit-mode-complex-attribute",className:O()(A.complexWrapper,U)},v().createElement("div",{className:A.editor},v().createElement("div",{className:A.titleContainer},v().createElement(HP,{onClick:()=>k((e=>!e)),expanded:D,className:A.expandButton,disabled:R}),v().createElement(Gk,{errorMessage:H,classes:{helperText:A.errorWrapperHelperText}},v().createElement("div",{className:O()(A.label,{[A.deleted]:R}),"data-reltio-id":"reltio-attribute-complex-label"},e))),v().createElement("div",{className:A.actions},_&&v().createElement(bf(),{variant:"caption",className:A.editedLabel},"(",li().text("edited"),")"),g&&g({attributeType:r,attributeValue:n}),M&&v().createElement(Cp.T,{icon:Fk(),onClick:()=>f({uri:I,attributeType:r,attributeValue:n}),size:"L","data-reltio-id":"reltio-delete-complex-attribute-button"}))),D&&v().createElement(OL,{parentAttributeType:r,attrTypes:t,entity:z,showEmptyEditors:p||N,drawLines:!0,parentUri:I,mode:l,crosswalks:c,onAddAttributes:m,onChangeAttribute:y,onDeleteAttribute:f,additionalControlsRenderer:g,showNonOv:T},a))}));function CL(){return CL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},CL.apply(null,arguments)}const wL=(0,b.memo)((e=>{const{attributeValue:t,attributeType:r}=e,n=(0,S.evaluateDeepEntityLabel)(t,r.dataLabelPattern);return v().createElement(xL,CL({label:(0,S.getLabel)(n),attributeTypesList:r.attributes||r.analyticsAttributes},e))}));wL.displayName="NestedAttributeEditor";var AL=r(84199),RL=r(62880);const _L=(0,wp.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"}}))),IL=e=>{const{selectProps:{onCreate:t,createLabel:r,inputValue:n,components:a},children:i}=e,o=_L();return v().createElement(Ly.h,e,i,r&&!(0,_.prop)("Group",a)&&v().createElement("span",{className:o.addLabel,onClick:()=>t(n)},v().createElement(yk(),{className:o.addIcon}),r))};IL.propTypes={children:dp().element.isRequired,selectProps:dp().object.isRequired};const NL=(0,wp.Z)({singleValue:{fontSize:"14px",lineHeight:"16px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginTop:"17px"}});function PL(){return PL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},PL.apply(null,arguments)}const DL=e=>{const{selectProps:{menuIsOpen:t},innerProps:r,children:n}=e,a=NL();return!t&&v().createElement(bf(),PL({className:a.singleValue},r),n)};function kL(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){LL(e,t,r[t])}))}return e}function LL(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}DL.propTypes={children:dp().node,innerProps:dp().object};const UL=(0,wp.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"}}}),jL={menu:e=>kL({},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=>kL({},e,{maxHeight:"208px",padding:"8px 0"}),group:e=>kL({},e,{padding:"0 0 8px 0"}),input:e=>kL({},e,{height:"16px",color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",lineHeight:"16px",margin:"16px 0 0",padding:0}),option:e=>kL({},e,{fontSize:"13px",lineHeight:"15px",height:"32px"})},FL={menuList:e=>kL({},e,{padding:0})},ML={input:e=>kL({},e,{height:"16px",color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",lineHeight:"16px",margin:0,padding:0})};function VL(){return VL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},VL.apply(null,arguments)}function BL(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){zL(e,t,r[t])}))}return e}function zL(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const HL=e=>{let{value:t,label:r,createLabel:n,getOptions:a,options:i,height:o=46,onChange:l=_.identity,onCreate:s,onClear:c=_.identity,components:u,textFieldInputRef:p,TextFieldProps:d,classes:m}=e,f=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.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 y=UL({height:o}),[g,h]=(0,b.useState)(!1),E=(0,b.useRef)(null),T=a?xy:Oy.J,x=(0,_.prop)("ClearIndicator",u)?{}:{IndicatorSeparator:AL.V,ClearIndicator:AL.V},C=s?(e,t)=>{s(e,t),h(!1)}:void 0,w=(0,_.prop)("Group",u)?FL:{},A=(0,_.isEmpty)(r)?ML:{},R=BL({},jL,w,A),I=BL({},y,m);return v().createElement(T,VL({placeholder:"",defaultOptions:!0},f,{value:(0,_.defaultTo)(null,t),loadOptions:a,options:i,cacheOptions:!0,onChange:l,onCreate:C,onClear:c,createLabel:n,classes:I,styles:R,components:BL({DropdownIndicator:RL.G,LoadingIndicator:AL.V,SingleValue:DL,Menu:IL},x,u),menuPlacement:"auto",TextFieldProps:BL({},d,{label:r,variant:"filled",size:"small",classes:BL({},(0,_.prop)("classes",d),{root:O()(y.formControl,(0,_.path)(["classes","root"],d))}),inputProps:BL({},(0,_.prop)("inputProps",d)),InputProps:BL({},(0,_.prop)("InputProps",d),{classes:BL({},(0,_.path)(["InputProps","classes"],d),{root:O()(y.filledInputRoot,(0,_.path)(["InputProps","classes","root"],d)),underline:O()({[y.filledInputUnderline]:(0,S.isEmptyValue)(t)},(0,_.path)(["InputProps","classes","underline"],d)),focused:O()("focused",(0,_.path)(["InputProps","classes","focused"],d))})}),InputLabelProps:BL({},(0,_.prop)("InputLabelProps",d),{classes:BL({},(0,_.path)(["InputLabelProps","classes"],d),{root:O()(y.inputLabel,(0,_.path)(["InputLabelProps","classes","root"],d)),shrink:O()("shrink",(0,_.path)(["InputLabelProps","classes","shrink"],d))}),shrink:!(0,S.isEmptyValue)(t)||void 0}),ref:p||E}),inputRef:p||E,menuIsOpen:g,onMenuOpen:()=>h(!0),onMenuClose:()=>h(!1)}))},YL={value:dp().oneOfType([dp().object,dp().array]),label:dp().string.isRequired,getOptions:dp().func,options:dp().array,onChange:dp().func,onCreate:dp().func,onClear:dp().func,createLabel:dp().string,components:dp().object,textFieldInputRef:dp().object,TextFieldProps:dp().object,height:dp().number,classes:dp().object};HL.propTypes=YL;var WL=r(98018);function GL(){return GL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},GL.apply(null,arguments)}const qL=e=>{const t=(0,w.$H)()||"";return v().createElement(WL.ZP,GL({},e,{storagePath:(r=t,r.endsWith("/")?r:r+"/")}));var r},ZL=(0,wp.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 $L(){return $L=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$L.apply(null,arguments)}const KL=({innerRef:e,innerProps:t,selectOption:r,data:n})=>{const a=ZL(),{uri:i,entityType:o,label:l,secondaryLabel:s}=n;return""!==i?v().createElement(qp(),$L({className:a.entityContainer,ref:e,key:i,onClick:()=>r({label:l,uri:i,entityType:o})},t),v().createElement(qL,{className:a.entityAvatar,entityType:o}),v().createElement(od.Y,{value:`${l}${s?", "+s:""}`},v().createElement("span",{className:a.entityLabel},l,s&&v().createElement("span",{className:a.entitySecondaryLabel},", ",s)))):v().createElement(qp(),$L({className:a.entityContainer,ref:e,key:i},t,{disabled:!0}),v().createElement("span",{className:a.emptyEntityLabel},li().text("No results found")))},XL=(0,wp.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"}}))),QL=({selectProps:{currentEntityType:e,menuIsOpen:t,disableLinkClick:r},children:n,data:a})=>{const i=XL(),o=(0,w.ax)("openEntity"),l=(0,w.Qh)(),{generateEntityUrl:s}=(0,b.useContext)(jd),c=(0,S.isTempUri)(a.entityUri)?{className:i.singleValue,component:"span"}:{className:O()(i.singleValue,i.linkValue),onMouseDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation(),r?e.preventDefault():(0,xp.rR)(e)||(o({uri:a.entityUri}),e.preventDefault())},href:s({uiPath:l,uri:a.entityUri}),component:"a"};return t?null:v().createElement(bf(),c,(0,S.isTempUri)(a.entityUri)?li().text(`New ${e.label} will be created`):(0,S.getLabel)(n))},JL=(0,wp.Z)({clearIcon:{cursor:"pointer",height:"20px",width:"20px"}}),eU=e=>{const{selectProps:{onClear:t}}=e,r=JL();return v().createElement(Hh(),{onClick:t,size:"large"},v().createElement(wI(),{className:r.clearIcon}))};eU.propTypes={selectProps:dp().object.isRequired};var tU=r(81997);const rU=(0,wp.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:nU}=tU.F,aU=e=>{const{selectProps:{inputValue:t,onCreate:r},data:n,children:a}=e,i=rU();return v().createElement(nU,e,v().createElement("div",{className:i.groupHeading},v().createElement("span",null,n.label),r&&v().createElement("span",{onClick:()=>r(t,n.entityType),className:i.addLabel},v().createElement(yk(),{className:i.addIcon}),li().text(`Create ${t?`"${t}" as `:""}new ${n.label}`))),a)};aU.propTypes={selectProps:dp().object.isRequired,data:dp().object,children:dp().array};const iU=e=>e&&e.attributes,oU=({entityUri:e,entityType:t,mode:r,attributeTypesSelectionStrategy:n=iU})=>{const a=(0,w.ax)("addAttributes"),i=(0,w.ax)("removeAttribute"),o=(0,w.ax)("modifyAttribute"),l=(0,w.vc)(e),s=(0,b.useMemo)((()=>n(t)),[n,t]);return l?v().createElement(OL,{key:l.uri,attrTypes:s,entity:l,showEmptyEditors:!0,drawLines:!0,parentUri:l.uri,mode:r,crosswalks:l.crosswalks,onAddAttributes:a,onChangeAttribute:o,onDeleteAttribute:i}):null};function lU(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sU=(0,wp.Z)({creatorWrapper:{marginTop:"20px"}});function cU(){return cU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cU.apply(null,arguments)}function uU(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){pU(e,t,r[t])}))}return e}function pU(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dU(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const mU=20,fU=e=>{let{entity:t={},entityTypesUris:r=[],mode:n,max:a=mU,onChange:i,onCreate:o,metadata:l,globalSearchRequestOptions:s,attributeTypesSelectionStrategy:c,disableLinkClick:u=!1}=e,p=dU(e,["entity","entityTypesUris","mode","max","onChange","onCreate","metadata","globalSearchRequestOptions","attributeTypesSelectionStrategy","disableLinkClick"]);const d=sU(),[m,f]=(0,b.useState)(""),y=(0,b.useMemo)((()=>r.map((e=>(0,S.getEntityType)(l,e))).filter(S.isAvailableEntityType)),[r,l]),g=uU({},s,{max:a}),h=o?(e,t)=>{o(t||r[0],e),f("")}:void 0,E=e=>{null!==e&&(f(""),i(e))},T=(0,b.useMemo)((()=>1!==y.length),[y]),O=((0,_.isEmpty)(t)?y[0]:(0,S.getEntityType)(l,t.entityType))||{},x=o&&li().text(`Create ${m?`"${m}" as `:""}new ${O.label}`),C=li().text(`Select ${1===y.length?`${y[0].label} `:""}profile`),w=!(0,_.isEmpty)(t)&&(0,S.isTempUri)(t.entityUri),A=T?{Group:aU,GroupHeading:AL.V}:{},R=w?{ClearIndicator:eU}:{},{TextFieldProps:I}=p,N=dU(p,["TextFieldProps"]),P=(0,b.useMemo)((()=>uU({},I||{},{"data-reltio-id":"reltio-entity-selector"})),[I]);return v().createElement(v().Fragment,null,v().createElement(HL,cU({value:(0,_.isEmpty)(t)?void 0:t,inputValue:m,onInputChange:e=>{f(e)},getOptions:e=>(0,S.typeAheadSearch)(y,e,g).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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){lU(e,t,r[t])}))}return e}({},t,{label:(0,S.getLabel)(t.label),entityType:e.find((({uri:e})=>e===t.type))}))),a=e=>(0,_.isEmpty)(e)?[{label:"",uri:"",entityType:{}}]:e,i=t?e:e.filter((e=>n.some((t=>t.type===e.uri))));return i.length>1?i.map((e=>({label:e.label,entityType:e.uri,options:a(n.filter((t=>t.type===e.uri)))}))):a(n)})(y,o)),getOptionLabel:(0,_.prop)("entityLabel"),onChange:E,onCreate:h,onClear:()=>{E({})},label:C,createLabel:x,components:uU({Option:KL,SingleValue:QL},A,R),currentEntityType:O,isClearable:!0,disableLinkClick:u,TextFieldProps:P},N)),w&&v().createElement("div",{className:d.creatorWrapper},v().createElement(oU,{mode:n,attributeTypesSelectionStrategy:c,entityType:O,entityUri:t.entityUri})))},yU=(0,wp.Z)({item:{marginBottom:"20px"},dense:{marginBottom:0}});function gU(){return gU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gU.apply(null,arguments)}function hU(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const EU=(0,tL.l)(iL,((e,{attributeValue:t,attributeType:r})=>{const{element:n,type:a}=e||{};return{highlightedError:aL(a)&&(0,S.isAttributeTypeError)(n,t.uri,r.uri)?e:null}}),(e=>{const t=yU(),{highlightedError:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["highlightedError"]),{attributeValue:a,attributeType:i,mode:o,crosswalks:l,errors:s,onChangeAttribute:c}=n,u=(0,b.useRef)(a),{ref:p,errorClassName:d}=uL({highlightedError:r,isSimple:!0}),m=(0,S.getReferencedEntityUriFromAttrValue)(a),f=(0,w.ax)("entityDeleted"),y=(0,w.ax)("entityCreated"),g=(0,w.ax)("errorDeactivated"),h=(0,w.vc)(m),E=(0,S.isTempUri)(m)?h:null,T=(0,w.AH)(),x=(0,w.mU)(["ovOnly"]),C=(0,S.getReferencedEntityFromAttrValue)(a),A=(0,S.getReferencedRelationFromAttrValue)(a),R=(0,S.getReferencedEntityTypeUriFromAttrType)(i),I=(0,S.getEntityType)(T,R),N=E?(0,S.evaluateDeepEntityLabel)(E,I.dataLabelPattern):a.label,P=(0,b.useMemo)((()=>[R]),[R]),D=(0,b.useMemo)((()=>(0,S.addReferencedRelationCrosswalks)(l,A)),[l,A]),k=(0,b.useMemo)((()=>(0,S.getReferencedEntityActiveError)(a,s)),[a,s]),L=(0,b.useMemo)((()=>C&&{entityUri:(0,S.getReferencedEntityUri)(C),entityType:(0,S.getReferencedEntityTypeUri)(C),entityLabel:a.label}),[C,a.label]),U=(0,b.useMemo)((()=>(0,S.getReferencedRelationAttrTypesUris)(i).map((e=>(0,S.findAttributeTypeByUri)(T,e))).filter(_.identity)),[i,T]),j=(0,b.useCallback)((e=>(0,S.referencedEntityAttributeTypesSelectionStrategy)(i,e)),[i]),F=(0,b.useCallback)((e=>{E&&f(E.uri);const t=u.current,r=!(0,_.isEmpty)(e)&&e.uri===(0,S.getReferencedEntityUriFromAttrValue)(t),n=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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){hU(e,t,r[t])}))}return e}({},a,{label:e.label,refEntity:r?t.refEntity:(0,S.convertReferencedEntityForAttrValue)(e),refRelation:r?t.refRelation:(0,S.createReferencedRelationForAttrValue)(a)});c({value:n,attributeType:i,uri:a.uri}),k&&g((0,S.getErrorId)(k))}),[a,i,E,c,f,g,k]),M=(0,b.useCallback)(((e,t)=>{const r=(0,_.pipe)(j,(0,S.getCreatableAttributeTypes)(o))(I),n=(0,S.createTemporaryEntity)({entityTypeUri:e,initValue:t,attributeTypes:r,metadata:T,mode:o});F(n),y(n)}),[j,o,I,T,F,y]),{canCreate:V,canUpdate:B}=Ok(a.uri),z=(0,b.useMemo)((()=>B&&(0,S.checkCanEditAttribute)({attributeType:i,attributeValue:a,mode:o,isReltioCrosswalk:(0,S.isReltioCrosswalk)(l,a)})),[i,a,o,l,B]),H=(0,b.useMemo)((()=>V&&(0,S.checkMetadataForCreate)(o,I)),[o,I,V]),Y=(0,S.getErrorMessage)(k);return v().createElement(xL,gU({},n,{label:(0,S.getLabel)(N),attributeTypesList:U,crosswalks:D,metadata:T}),v().createElement("div",{ref:p,className:d},v().createElement(Gk,{errorMessage:Y},v().createElement(fU,{className:O()(t.item,{[t.dense]:Y||L&&(0,S.isTempUri)(L.entityUri)}),entity:L||{},entityTypesUris:P,globalSearchRequestOptions:x,mode:o,isDisabled:!z,onChange:F,onCreate:H?M:void 0,metadata:T,attributeTypesSelectionStrategy:j}))))}));function bU(){return bU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bU.apply(null,arguments)}const vU=(0,b.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className"]);return v().createElement("div",{ref:t,"data-reltio-id":"reltio-edit-attribute",className:r},class{static build(e,t={}){switch(e.type){case S.DataTypes.TYPE_NESTED:return v().createElement(wL,t);case S.DataTypes.TYPE_REFERENCE:return v().createElement(EU,t);default:{const e=(0,_.omit)(["showEmptyEditors","onAddAttributes","lazy","errors","crosswalks","showNonOv","expanded"],t);return v().createElement(yL,bU({isReltioCrosswalk:(0,S.isReltioCrosswalk)(t.crosswalks,t.attributeValue)},e))}}}}.build(e.attributeType,n))}));vU.displayName="EditModeAttribute";const TU=e=>li().text("${value}",{value:1===e?li().text("value"):li().text("values")}),OU=(0,_.has)("minValue"),SU=(0,_.has)("maxValue"),xU=(0,_.pipe)(SU,_.not),CU=(0,_.propSatisfies)((e=>1===e),"minValue"),wU=({minValue:e})=>li().text("This attribute can have minimum ${minValue} ${minValueCaption}",{minValue:li().number(e,"0"),minValueCaption:TU(e)}),AU=({maxValue:e})=>li().text("This attribute can have maximum ${maxValue} ${maxValueCaption}",{maxValue:li().number(e,"0"),maxValueCaption:TU(e)}),RU=(0,_.cond)([[_.isNil,(0,_.always)("")],[({minValue:e,maxValue:t})=>e&&e===t,({minValue:e})=>li().text("This attribute should have ${minValue} ${minValueCaption}",{minValue:li().number(e,"0"),minValueCaption:TU(e)})],[(0,_.allPass)([CU,SU]),AU],[(0,_.allPass)([CU,xU]),(0,_.always)("")],[(0,_.allPass)([OU,SU]),({minValue:e,maxValue:t})=>li().text("${minCardinality} and maximum ${maxValue} ${maxValueCaption}",{minCardinality:wU({minValue:e}),maxValue:li().number(t,"0"),maxValueCaption:TU(t)})],[SU,AU],[OU,wU],[_.T,(0,_.always)("")]]),_U=(0,wp.Z)((()=>({caption:{fontSize:"0.7rem",opacity:.54}}))),IU=({cardinality:e})=>{const t=_U(),r=RU(e);return r?v().createElement(bf(),{variant:"caption",className:t.caption},r):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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){PU(e,t,r[t])}))}return e}function PU(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const DU={content:'""',position:"absolute",left:"-1000px",top:"-4px",width:"5000px",height:"calc(100% + 8px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},kU=(0,wp.Z)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlighted:{"&::before":NU({},DU,{background:"rgba(228, 151, 0, 0.08)"}),position:"relative"}}))),LU=e=>{const t=kU(),r=(0,b.useRef)(null);return(0,b.useEffect)((()=>{e&&e.scrollIntoRef(r)}),[e]),e?{ref:r,highlightedClassName:t.highlighted}:{ref:r}},UU=(0,_.filter)((0,_.propSatisfies)(S.isTempUri,"uri")),jU=(0,wp.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=({max:e,values:t,attributeType:r,parentUri:n,mode:a,drawLines:i,showEmptyEditors:o,errorMessage:l,errors:s,paging:c,crosswalks:u,showNonOv:p,nonVisibleValues:d,highlightedError:m,highlightedAttribute:f,onAddAttributes:y,onDeleteAttribute:g,onChangeAttribute:h,onDeactivateError:E,additionalControlsRenderer:T,requestNextPageOfAttributeValues:x})=>{const C=jU(),[A,R]=(0,b.useState)(e),[I,N]=(0,b.useState)(!1),{label:P,required:D,cardinality:k,name:L,uri:U,description:j}=r,F=(0,S.isEditableMode)(a),{ref:M,errorClassName:V}=uL({highlightedError:m}),{ref:B,highlightedClassName:z}=LU(f),H=(0,b.useContext)(hL),Y=(0,b.useMemo)((()=>null==H?void 0:H.includes(U)),[U,H]),W=(0,S.isEmptyValue)(t),G=(!I&&o||D||Y)&&W,q=(0,w.Ws)(),Z=(0,b.useMemo)((()=>q.includes(r.uri)),[q,r.uri]),$=(0,b.useRef)((0,S.createNewAttribute)({parentUri:n,attributeType:(0,_.omit)(["defaultValue"],r)})),K=(0,b.useCallback)((()=>{R(A+1);const e=e=>({parentUri:n,index:A,attributeType:e});if(G&&!(0,S.isComplexAttribute)(r.type)){const t=[e((0,_.omit)(["defaultValue"],r)),e(r)];return y(t)}return y([e(r)])}),[A,y,n,r,G]),X=(0,b.useCallback)((0,_.pipe)(g,_.T,N),[g,N]);if(W&&!G)return null;if(G&&W&&(t=[$.current]),(0,S.isEmptyValue)(t))return null;const Q=(UU(t)||[]).length,J=p?"totalValues":"totalOvValues",ee=(0,_.ifElse)((0,_.has)(J),(0,_.pipe)((0,_.prop)(J),(0,_.add)(Q)),(0,_.always)(t.length))(c),te=null!=c&&c.totalValues?c.totalValues-ee:null==d?void 0:d.length,re=e<ee,ne=re&&A<ee,ae=re&&A>=ee,ie=t.slice(0,A),oe=ie?ie.length-1:0,le=ee-A;return v().createElement(YI,{enabled:i},v().createElement("div",{ref:M,className:O()(C.wrapper,V)},v().createElement("div",{className:C.titleWrapper},v().createElement(tP,{label:P,isRequired:D,className:C.title,"data-reltio-id":"reltio-attribute-label"}),v().createElement(uP,{description:j}),Z&&v().createElement(gD,null),v().createElement(iP,{nonOvValues:d,attributeType:r,className:C.ovIcon,nonOvTotal:te})),F&&v().createElement(IU,{cardinality:k}),F&&v().createElement(Uk,{message:l,className:C.typeError}),v().createElement("div",{className:C.attributesWrapper},ie.map(((e,t)=>v().createElement(vU,{key:e.uri,attributeValue:e,attributeType:r,lazy:G&&!D,showEmptyEditors:o,errors:s,ownError:(0,S.getAttributeOwnError)(e,t,r.uri,s),mode:a,crosswalks:u,onAddOneMore:oe===t?K:null,onAddAttributes:y,onDeleteAttribute:X,onChangeAttribute:h,onDeactivateError:E,additionalControlsRenderer:T,className:0===t?z:null,ref:0===t?B:null,isEmptyEditor:G}))),ne&&v().createElement(_D,{moreNumber:(0,_.min)(e,le),valueNumber:le,onClick:()=>{t.length<ee&&x({parentUri:n,attributeTypeUri:U,attributeTypeName:L,values:t,defaultMaxValues:e}),R(A+e)}}),ae&&v().createElement(DD,{onClick:()=>{R(e)}}))))};FU.displayName="AttributeRenderer";const MU=(0,b.memo)(FU),VU=(0,wp.Z)({value:{color:"rgba(0, 0, 0, 0.87)"}}),BU=(0,wp.Z)({placeholder:{color:"rgba(0, 0, 0, 0.38)",fontSize:"14px !important"}});function zU(){return zU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zU.apply(null,arguments)}function HU(){return HU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},HU.apply(null,arguments)}const YU={SingleValue:({selectProps:{menuIsOpen:e},data:{label:t}})=>{const r=VU();return!e&&v().createElement(bf(),{variant:"body2",classes:{root:r.value}},t)},Placeholder:({innerProps:e,children:t})=>{const r=BU();return v().createElement(bf(),zU({className:r.placeholder},e),t)}},WU=(0,b.memo)((e=>v().createElement(HL,HU({components:YU},e)))),GU=(0,wp.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},roleContainer:{width:"100%"},valueContainer:{marginLeft:"8px",width:0},deleteButton:{marginLeft:"8px"}}),qU={MultiValue:jy._},ZU=({values:e,onChange:t,onDelete:r})=>{const n=GU(),a=(0,w.AH)(),i=(0,w.eh)(),o=i.uri,l=(0,S.getRolesForEntityType)(a,i.type).map((e=>({value:e.uri,label:e.label}))),s=(e||[]).map((e=>{var t;return{value:e,label:(null===(t=l.find((0,_.propEq)("value",e)))||void 0===t?void 0:t.label)||(0,S.getLastUriPart)(e)}})),c=(0,b.useCallback)((e=>{const r=(null==e?void 0:e.map((0,_.prop)("value")))||[];t({value:r,attributeType:S.EntityAttrTypes.roles,uri:o})}),[o,t]),u=(0,b.useCallback)((()=>{r({uri:o,attributeType:S.EntityAttrTypes.roles})}),[o,r]);return v().createElement("div",{className:n.container,"data-reltio-id":"reltio-attribute-value"},v().createElement(WU,{label:"",height:40,isMulti:!0,options:l,value:s,onChange:c,components:qU,classes:n,className:n.roleContainer}),!!r&&v().createElement(Cp.T,{"data-reltio-id":"reltio-roles-delete-button",className:n.deleteButton,icon:Fk(),onClick:u,size:"L"}))};var $U=r(56333);const KU=(0,wp.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},deleteButton:{marginLeft:"8px"}});function XU(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){QU(e,t,r[t])}))}return e}function QU(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const JU=({className:e,values:t,onChange:r,onDelete:n})=>{const a=KU(),i=(0,w.lG)(),o=(0,w.mU)(),l=(0,b.useCallback)((async(e,t,r)=>{const n=await(0,S.getFacetedAttributeData)({fieldName:"tags",searchValue:e,options:XU({},o,{max:t,pageNo:r})});return Object.keys(n.tags)}),[o]),s=(0,b.useCallback)((e=>{r({value:e,attributeType:S.EntityAttrTypes.tags,uri:i})}),[r,i]),c=(0,b.useCallback)((()=>{n({uri:i,attributeType:S.EntityAttrTypes.tags})}),[i,n]);return v().createElement("div",{className:a.container,"data-reltio-id":"reltio-attribute-value"},v().createElement($U.p,{fullWidth:!0,multiple:!0,variant:"filled",className:e,value:t||[],onChange:s,getSuggestions:l}),!!n&&v().createElement(Cp.T,{"data-reltio-id":"reltio-tags-delete-button",className:a.deleteButton,icon:Fk(),onClick:c,size:"L"}))};function ej(){return ej=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ej.apply(null,arguments)}function tj(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rj=(0,tL.l)(EL,((e,{attributeType:t})=>{const{hasDeletionsMap:r,setHasDeletions:n}=e||{};return{hasDeletions:r?Boolean(r[null==t?void 0:t.uri]):void 0,setHasDeletions:n}}),(e=>{let{values:t,attributeType:r,parentUri:n,mode:a,errorMessage:i,onDeleteAttribute:o,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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.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:f,required:y,cardinality:g}=r,h=(0,S.isEditableMode)(a),[E,T]=(0,b.useState)(!1),x=(0,b.useCallback)((e=>{T(e),null==u||u(r.uri,e)}),[r.uri,u]),C=void 0!==c?c:E,w=(0,b.useCallback)((0,_.pipe)(o,_.T,x),[o,x]),A=(0,S.isEmptyValue)(t),R=!C&&s&&A,I=(0,b.useRef)((0,S.createNewAttribute)({parentUri:n,attributeType:r})),{ref:N,highlightedClassName:P}=LU(p);return(0,S.isActivenessAttrType)(r)&&A&&!R?null:v().createElement("div",{ref:N,className:O()(P,m.wrapper)},v().createElement(tP,{label:f,isRequired:y,className:O()(m.title,m.titleWrapper),"data-reltio-id":"reltio-attribute-label"}),h&&v().createElement(IU,{cardinality:g}),h&&v().createElement(Uk,{message:i}),v().createElement(PI(),{className:m.attributesWrapper},(()=>{switch(r.uri){case S.EntityAttrTypes.tags.uri:return v().createElement(JU,{values:t,onDelete:w,onChange:l});case S.EntityAttrTypes.roles.uri:return v().createElement(ZU,{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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){tj(e,t,r[t])}))}return e}({},I.current,{value:t[0]||""});return v().createElement(vU,ej({attributeValue:e,attributeType:r,mode:a,onDeleteAttribute:w,onChangeAttribute:l},d))}}})()))}));var nj=r(57517),aj=r.n(nj);function ij(){return ij=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ij.apply(null,arguments)}const oj=e=>v().createElement("svg",ij({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgDownload"},e),v().createElement("defs",null,v().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"})),v().createElement("g",{transform:"translate(-3 -3)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"Download_svg__b",fill:"#fff"},v().createElement("use",{xlinkHref:"#Download_svg__a"})),v().createElement("path",{fillOpacity:.54,fill:"#fff",mask:"url(#Download_svg__b)",d:"M0 0h24v24H0z"})));var lj=r(76550),sj=r.n(lj),cj=r(29367),uj=r.n(cj);const pj=(0,wp.Z)((()=>({root:{fontSize:"24px",color:"#fff"}}))),dj=({checked:e,className:t,onClick:r})=>{const n=pj(),a=e?uj():sj();return v().createElement(a,{className:O()(n.root,t),onClick:r})},mj=(0,wp.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,b.memo)((e=>{const{id:t,canBeSelected:r=!1,selected:n=!1,selectionMode:a=!1,onDeselect:i=_.identity,onSelect:o=_.identity,onShareLink:l,onSetAsDefault:s,onDelete:c,onDownload:u=_.identity,onClick:p}=e,d=mj(),[m,f]=(0,b.useState)(!1),{canDelete:y}=Ok(t),g=(0,b.useMemo)((()=>[{text:li().text("Share link"),onClick:l},{text:li().text("Set as default"),onClick:s},{text:li().text("Delete"),onClick:y&&c}].filter((0,_.prop)("onClick"))),[l,s,c,y]),h=e=>()=>(0,_.ifElse)((0,_.equals)(!0),i,o)(e),E=r&&(n||m||a),T=!a&&!n&&m,S=r&&n;return v().createElement("div",{className:O()(d.overlay,{[d.selected]:n,[d.selectionMode]:a}),onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onClick:a?h(n):e=>{e.currentTarget===e.target&&p()},"data-reltio-id":"image-actions-overlay"},E&&v().createElement(dj,{className:d.checkedIcon,checked:n,onClick:h(n)}),T&&v().createElement("div",{className:d.actions},v().createElement(Cp.T,{onClick:u,className:d.actionButton,icon:oj}),v().createElement(EN,{menuId:`image-overlay-actions-${t}`,buttonComponent:Cp.T,buttonProps:{icon:Pd(),className:O()(d.actionButton,d.dropDownMenuButton)},menuItems:g})),S&&v().createElement(Wh(),{className:d.button,variant:"outlined",onClick:i},li().text("Deselect")))}));var yj=r(70251),gj=r.n(yj),hj=r(1937),Ej=r.n(hj);const bj=(0,wp.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}}))),vj=e=>0===e.trim().length,Tj=({onSend:e})=>{const t=bj(),[r,n]=(0,b.useState)(""),[a,i]=(0,b.useState)(null);return v().createElement(PI(),{className:t.root},v().createElement(LI(),{className:t.paper},v().createElement(Ej(),{value:r,onChange:e=>{const t=e.target.value,r=new RegExp(/^(ftp|http|https):\/\/[^ "]+$/).test(t);n(t),r||vj(t)?i(null):i(li().text("URL is not correct"))},classes:{root:t.inputRoot,input:t.input},placeholder:li().text("Paste an image URL here")}),v().createElement(Wh(),{disabled:Boolean(a)||vj(r),variant:"outlined",color:"primary",onClick:()=>{e(r),n(""),i(null)}},li().text("Send"))),a&&v().createElement(bf(),{className:t.errorMessage},a))};var Oj=r(65680),Sj=r(83997);const xj=["image/png","image/jpeg","image/tiff","image/gif","image/bmp"],Cj=({className:e,onAppendFile:t})=>v().createElement(v().Fragment,null,v().createElement("input",{onInput:e=>{t&&t(e.currentTarget.files[0])},style:{display:"none"},accept:xj.join(","),id:"upload-image-button","data-reltio-id":"upload-image-button",type:"file"}),v().createElement("label",{htmlFor:"upload-image-button"},v().createElement(Wh(),{className:e,variant:"contained",color:"primary",component:"span"},li().text("Select image"))));function wj(){return wj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wj.apply(null,arguments)}const Aj=e=>v().createElement("svg",wj({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgUploadIcon"},e),v().createElement("defs",null,v().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__c"},v().createElement("stop",{stopColor:"#FFF",offset:"0%"}),v().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),v().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__d"},v().createElement("stop",{stopColor:"#FFF",offset:"0%"}),v().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),v().createElement("linearGradient",{x1:"67.572%",y1:"54.952%",x2:"15.212%",y2:"13.907%",id:"UploadIcon_svg__e"},v().createElement("stop",{stopColor:"#000",stopOpacity:0,offset:"0%"}),v().createElement("stop",{stopColor:"#000",offset:"100%"})),v().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__f"},v().createElement("stop",{stopColor:"#B8EDFF",offset:"0%"}),v().createElement("stop",{stopColor:"#53ACDE",offset:"100%"})),v().createElement("circle",{id:"UploadIcon_svg__a",cx:128,cy:128,r:128})),v().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"UploadIcon_svg__b",fill:"#fff"},v().createElement("use",{xlinkHref:"#UploadIcon_svg__a"})),v().createElement("use",{fillOpacity:.1,fill:"#0072CE",xlinkHref:"#UploadIcon_svg__a"}),v().createElement("g",{mask:"url(#UploadIcon_svg__b)"},v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(-1 9)"},v().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}),v().createElement("ellipse",{fill:"url(#UploadIcon_svg__c)",opacity:.4,cx:64.553,cy:107.664,rx:61.43,ry:62.336}),v().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})),v().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)"}),v().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)"})))),Rj=(0,wp.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"}}))),_j=({onAppendFile:e,className:t})=>{const r=Rj(),[{canDrop:n,isOver:a},i]=(0,Oj.useDrop)({accept:[Sj.FILE],drop:t=>{t&&e(t.files[0])},collect:e=>({isOver:e.isOver(),canDrop:e.canDrop()})}),o=n&&a;return v().createElement("div",{ref:i,className:O()(r.root,{[r.isActive]:o},t)},v().createElement(Aj,{className:r.icon}),v().createElement(bf(),{className:r.title},li().text("Drag an image here")),v().createElement(bf(),{className:r.description},li().text("Acceptable image types would include JPG, PNG, TIFF, GIF, BMP. Maximum image size: ${MAX_IMAGE_SIZE}Mb",{MAX_IMAGE_SIZE:20})),v().createElement(Cj,{onAppendFile:e}))},Ij=(0,wp.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"}}))),Nj=({children:e,className:t})=>{const r=Ij();return v().createElement(PI(),{className:O()(r.root,t)},v().createElement(PI(),{className:r.border}),v().createElement(bf(),{className:r.text},e),v().createElement(PI(),{className:r.border}))},Pj=(0,wp.Z)({closeIcon:{color:"#fff"}}),Dj=({error:e,onClose:t})=>{const r=Pj();return v().createElement(Bh(),{open:Boolean(e),onClose:t,message:e,action:v().createElement(Ed.k,{className:r.closeIcon,tooltipTitle:li().text("Close"),icon:Tp(),onClick:t})})},kj=(0,wp.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"}}))),Lj=({open:e,onClose:t,onUpload:r})=>{const n=kj(),[a,i]=(0,b.useState)(!1),[o,l]=(0,b.useState)(null),s=(0,w.qD)(),c=(0,w.fN)(),u=(0,w.Uv)(),p=e=>{i(!0),(0,S.uploadImage)({image:e,imageServicePath:s,environment:c,tenant:u}).then((e=>{r(e),t()})).catch((e=>{l((0,S.getRequestErrorMessage)(e,li().text("Something went wrong")))})).finally((()=>i(!1)))};return v().createElement(gj(),{open:e,onClose:t,classes:{paper:n.dialogPaper}},v().createElement(bf(),{className:n.title},li().text("Add new image")),v().createElement(PI(),{className:n.body},v().createElement(_j,{className:n.targetBox,onAppendFile:e=>{if(!e)return l(li().text("No image selected."));const t=Number((e.size/1024/1024).toFixed(2)),r=xj.includes(e.type);t>20?l(li().text("File size exceeds configured max file size.")):r?p(e):l(li().text("File format is not supported."))}}),v().createElement(Nj,{className:n.divider},li().text("or")),v().createElement(Tj,{onSend:e=>{p(e)}})),a&&v().createElement(CE.z,null),v().createElement(Dj,{error:o,onClose:()=>l(null)}))},Uj=(0,wp.Z)((()=>({root:{width:"100%"},image:({imageMargin:e})=>({marginRight:e,cursor:"pointer","&:last-child":{marginRight:0}}),uploadContainer:({imageMargin:e,imageWidth:t,imageHeight:r})=>({backgroundColor:"white",width:t,height:r,cursor:"pointer",border:"1px dashed #0072CE",boxSizing:"border-box",marginRight:e,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}),uploadButton:{width:"50px",height:"50px"},uploadIcon:{fontSize:"36px"}}))),jj={},Fj=({attributeType:e={},attributeValues:t=[],onDeleteAttribute:r,onChangeAttribute:n,requestNextPageOfAttributeValues:a,parentUri:i,paging:o,showNonOv:l,imageSize:s=nk})=>{const c=Uj(s),[u,p]=(0,b.useState)(!1),d=(0,w.ax)("setDefaultProfilePicForModifiedEntity"),m=(0,w.eh)()||jj,f=(0,w.AU)(m.uri),{canCreate:y}=(0,b.useContext)(Tk),g=(0,b.useCallback)((()=>{p((e=>!e))}),[]),h=(0,b.useCallback)((t=>{const r=(0,S.generateUri)(i,e.name),a={};for(const n in t){const i=(e.attributes||[]).find((({name:e})=>e===n));i&&(a[n]=[{uri:(0,S.generateUri)(r,i.name),ov:!0,value:t[n],type:i.uri}])}n({attributeType:e,uri:r,value:a})}),[n,i,e]),E=(0,b.useCallback)((e=>{if(r(e),f===e.uri){var n;const r=(null===(n=t[0])||void 0===n?void 0:n.uri)===e.uri?t[1]:t[0];d({entityUri:m.uri,value:r||{}})}}),[r,m,f,t,d]),T=(t,r)=>{const{onOpenImageGalleryDialog:n,onDownload:a,onShareLink:i,onSetAsDefault:o}=t,l=(0,S.getImageAttributeOvUrl)(r),{uri:s}=r;return v().createElement(fj,{id:s,onShareLink:()=>i(l),onSetAsDefault:()=>o(r),onDelete:()=>E({uri:s,attributeType:e}),onDownload:()=>a([l]),onClick:()=>n(s)})};return v().createElement("div",{className:c.root,"data-reltio-id":"image-line-edit-mode"},v().createElement(OF,{attributeValues:t,attributeType:e,renderImage:e=>(t={})=>{const r=(0,S.getImageAttributeOvThumbnailUrl)(t),{uri:n}=t,{onOpenImageGalleryDialog:a}=e;return v().createElement("div",{className:c.image,key:n},v().createElement(rk,{src:r,overlay:T(e,t),onClick:()=>a(n),size:{imageWidth:s.imageWidth,imageHeight:s.imageHeight},"data-reltio-id":"reltio-attribute-value"}))},overlay:!0,countFixedItems:y?1:0,onUpload:g,onDeleteAttribute:E,imageSize:s,requestNextPageOfAttributeValues:a,paging:o,parentUri:i,showNonOv:l},y&&v().createElement("div",{className:c.uploadContainer,onClick:g},v().createElement(Cp.T,{className:c.uploadButton,iconClassName:c.uploadIcon,icon:aj(),"data-reltio-id":"reltio-upload-image-button"}))),v().createElement(Lj,{open:u,onUpload:h,onClose:g}))},Mj=({attributeType:e,attributeValues:t,paging:r,parentUri:n,showNonOv:a,onDeleteAttribute:i,onChangeAttribute:o,requestNextPageOfAttributeValues:l,highlightedAttribute:s,error:c,highlightedError:u,onDeactivateError:p})=>{const d=jU(),{label:m,description:f,required:y}=e,{ref:g,highlightedClassName:h}=LU(s),{ref:E,errorClassName:T}=uL({highlightedError:u}),x=(0,b.useCallback)((()=>{c&&p&&p((0,S.getErrorId)(c))}),[c,p]);return v().createElement("div",{ref:g,className:O()(d.wrapper,h)},v().createElement("div",{ref:E,className:O()(d.imagesWrapper,T)},v().createElement("div",{className:d.titleWrapper},v().createElement(tP,{className:d.title,label:m,"data-reltio-id":"reltio-attribute-label",isRequired:y}),v().createElement(uP,{description:f})),v().createElement(Gk,{errorMessage:null==c?void 0:c.message,className:d.errorWrapper},v().createElement(Fj,{attributeValues:t,attributeType:e,paging:r,onDeleteAttribute:i,parentUri:n,onChangeAttribute:(0,_.pipe)(o,x),requestNextPageOfAttributeValues:l,showNonOv:a}))))};let Vj=function(e){return e.imageLine="imageLine",e.special="special",e.default="default",e}({});function Bj(){return Bj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bj.apply(null,arguments)}const zj=(0,tL.l)(iL,((e,{attributeType:t,parentUri:r})=>{const{element:n,type:a}=e||{},i=(e=>e===nL.NewAttribute)(a)&&n.uri===t.uri;return{highlightedAttribute:i?e:null,highlightedError:aL(a)&&(0,S.isAttributeTypeError)(n,r,t.uri)?e:null}}),(({values:e,attributeType:t,mode:r=S.Mode.Viewing,crosswalks:n,drawLines:a,paging:i={},parentUri:o,max:l,showEmptyEditors:s,showNonOv:c,highlightedError:u,highlightedAttribute:p,onAddAttributes:d,onDeleteAttribute:m,onChangeAttribute:f,additionalControlsRenderer:y})=>{var g;const h=(0,w.ax)("errorDeactivated"),E=(0,w.ax)("requestNextPageOfAttributeValues"),T=(0,b.useContext)(bL),O=o&&(0,S.getBaseUri)(o),x=(0,b.useMemo)((()=>T[O]||[]),[T,O]),C=(0,w.Jz)(o,t),A=(0,b.useMemo)((()=>(0,S.filterErrorsForHiddenAttributes)(C,x)),[C,x]),R=(0,w.Xj)(),I=(0,w.vd)(),N=(0,S.getAttributePagerActiveTypeErrorMessage)(o,t,R),P=null!==(g=null!=l?l:I)&&void 0!==g?g:1/0,D=(0,_.partition)(S.isOv),[k,L]=D(e),U=c?e:k,j=c?[]:L,F={errorMessage:N,errors:A,mode:r,parentUri:o,onAddAttributes:d,onDeleteAttribute:m,onChangeAttribute:f,onDeactivateError:h,additionalControlsRenderer:y,showEmptyEditors:s,highlightedError:u,highlightedAttribute:p};return(()=>{switch((0,_.cond)([[S.isSpecialAttribute,(0,_.always)(Vj.special)],[S.isImage,(0,_.always)(Vj.imageLine)],[_.T,(0,_.always)(Vj.default)]])(t)){case Vj.special:return v().createElement(YI,{enabled:a},v().createElement(rj,Bj({values:U,attributeType:t},F)));case Vj.imageLine:return v().createElement(YI,{enabled:a},v().createElement(Mj,{attributeValues:U,attributeType:t,paging:i,onDeleteAttribute:m,parentUri:o,onChangeAttribute:f,requestNextPageOfAttributeValues:E,showNonOv:c,highlightedAttribute:p,error:(0,S.getAttributeErrorByTypeUri)(t.uri,A),highlightedError:u,onDeactivateError:h}));default:return v().createElement(MU,Bj({values:U,attributeType:t,max:P,paging:i,crosswalks:n,drawLines:a,requestNextPageOfAttributeValues:E,showNonOv:c,nonVisibleValues:j},F))}})()})),Hj=(0,wp.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"}}),Yj=({attributeType:e,imageAttributeFieldsOrder:t,attributeValue:r,hasChanges:n,onDeleteAttribute:a,onChangeAttribute:i,onAddAttributes:o,onCancel:l,onApply:s,mode:c})=>{const u=Hj(),p=Ak(r,e,t),d=0!==p.length||0===p.length&&n;return v().createElement(PI(),{className:u.root},v().createElement(PI(),{className:u.form},p.map((({attrType:e,values:t})=>v().createElement(zj,{key:e.uri,parentUri:r.uri,attributeType:e,values:t,showEmptyEditors:(0,S.isTempUri)(r.uri),mode:c,drawLines:!1,onDeleteAttribute:a,onChangeAttribute:i,onAddAttributes:o})))),d&&v().createElement(v().Fragment,null,v().createElement(Af(),{className:u.divider}),v().createElement(PI(),{className:u.actions},v().createElement(Wh(),{disabled:!n,onClick:l,className:u.cancelButton},li().text("Cancel")),v().createElement(Wh(),{disabled:!n,onClick:s,color:"primary"},li().text("Apply")))))},Wj={palette:{mode:"dark",primary:S.theme.palette.primary,secondary:S.theme.palette.secondary}},Gj=(0,wm.createTheme)(Wj),qj=({imageAttributeFieldsOrder:e,attributeType:t,attributeValue:r})=>{const n=(0,w.YA)(),a=(0,w.o_)(),{addAttributes:i,changeAttribute:o,deleteAttribute:l,clearLocalChanges:s,applyLocalChanges:c,attributeValue:u,hasChanges:p}=(({initialAttributeValue:e,attributeType:t})=>{const r=(0,w.ax)("modifyAttribute"),[n,a]=(0,b.useState)(e);(0,b.useEffect)((()=>{a(e)}),[e]);const i=!(0,_.equals)(n,e),o=(0,b.useCallback)((e=>{a((t=>e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,S.addAttribute)({entity:e,attributeType:r,parentUri:n,index:a,nestingLevel:1})}),t)))}),[]),l=(0,b.useCallback)((({value:e,attributeType:t,uri:r})=>{a((n=>(0,S.editAttribute)({entity:n,attributeType:t,uri:r,value:e,nestingLevel:1})))}),[]),s=(0,b.useCallback)((({attributeType:e,uri:t})=>{a((r=>(0,S.removeAttribute)({entity:r,attributeType:e,uri:t,nestingLevel:1})))}),[]);return{addAttributes:o,changeAttribute:l,deleteAttribute:s,clearLocalChanges:(0,b.useCallback)((()=>{a(e)}),[e]),applyLocalChanges:(0,b.useCallback)((()=>{r({value:n,attributeType:t,uri:n.uri})}),[n,t,r]),attributeValue:n,hasChanges:i}})({attributeType:t,initialAttributeValue:r});return v().createElement(wm.ThemeProvider,{theme:Gj},v().createElement(PI(),null,v().createElement(Ik,{attributeType:t,uri:null==u?void 0:u.uri,onAddAttributes:a?i:void 0}),v().createElement(kk,{attributeType:t,attributeValue:u,imageAttributeFieldsOrder:e}),a&&v().createElement(Yj,{mode:n,imageAttributeFieldsOrder:e,attributeType:t,attributeValue:u,hasChanges:p,onDeleteAttribute:l,onChangeAttribute:o,onAddAttributes:i,onCancel:s,onApply:c})))},Zj=(0,wp.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}}))),$j=({className:e,attributeValue:t,handleSetAsDefault:r,attributeType:n})=>{const a=Zj(),[i,o]=(0,b.useState)(!1),l=(0,w.eh)()||{},s=(0,w.vc)(null==l?void 0:l.uri)||{},c=(0,w.xH)(),u=(0,w.uO)()||{},p=c?l:s,d=u[null==l?void 0:l.type]||(null==u?void 0:u.default)||{};(0,b.useEffect)((()=>{o((null==p?void 0:p.defaultProfilePic)===(null==t?void 0:t.uri))}),[null==t?void 0:t.uri,p]);const m=(0,b.useCallback)((()=>{r(t.uri)}),[null==t?void 0:t.uri]);return v().createElement(PI(),{className:O()(a.root,e)},v().createElement(PI(),{className:a.header},v().createElement(bf(),{className:a.headerTitle},li().text("Details"))),v().createElement(PI(),{className:a.bodyWrapper},v().createElement(PI(),{className:a.body},v().createElement(bh(),{classes:{root:a.formControlLabel,label:a.checkboxLabel},control:v().createElement(Wp(),{className:a.checkbox,checked:i,onChange:m}),label:li().text("Set as default")}),v().createElement(qj,{attributeType:n,imageAttributeFieldsOrder:d,attributeValue:t}))))},Kj=(0,wp.Z)((()=>({root:{display:"flex",width:"100%",overflowY:"auto",height:"calc(100vh - 64px)"},main:{flex:"1 0 auto"},details:{width:"340px"}}))),Xj=({attributeValues:e=[],currentAttributeValueUri:t,setCurrentAttributeValueUri:r,handleSetAsDefault:n,attributeType:a})=>{const[i,o]=(0,b.useState)(0);(0,b.useEffect)((()=>{l(t?e.findIndex((e=>e.uri===t)):0)}),[t,e]);const l=(0,b.useCallback)((t=>{var n;o(t),r(null===(n=e[t])||void 0===n?void 0:n.uri)}),[e]),s=Kj();return v().createElement(PI(),{className:s.root},v().createElement(mk,{attributeValueIndex:i,setAttributeValueIndex:l,attributeValues:e,className:s.main}),v().createElement($j,{handleSetAsDefault:n,attributeValue:e[i],className:s.details,attributeType:a}))};let Qj=function(e){return e.Gallery="gallery",e.Details="details",e}({});var Jj=r(60480),eF=r.n(Jj),tF=r(54886),rF=r.n(tF),nF=r(86038),aF=r.n(nF),iF=r(39178),oF=r.n(iF);function lF(){return lF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lF.apply(null,arguments)}const sF=e=>v().createElement("svg",lF({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgDetails"},e),v().createElement("defs",null,v().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"})),v().createElement("g",{stroke:"none",strokeWidth:1,fillRule:"evenodd"},v().createElement("mask",{id:"Details_svg__b",fill:"#fff"},v().createElement("use",{xlinkHref:"#Details_svg__a"})),v().createElement("path",{mask:"url(#Details_svg__b)",d:"M0 0h24v24H0z"}))),cF=(0,wp.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}}))),uF=({open:e,mode:t,children:r,header:n,onClose:a,onChangeMode:i})=>{const o=cF(),l=(0,b.useMemo)((()=>[{id:Qj.Gallery,title:li().text("Gallery"),Icon:oF()},{id:Qj.Details,title:li().text("Details"),Icon:sF}]),[]);return v().createElement(gj(),{classes:{paper:o.paper},open:e,BackdropProps:{className:o.backdrop},fullScreen:!0},v().createElement(rF(),{classes:{colorPrimary:o.appBar}},v().createElement(aF(),{className:o.toolbar},v().createElement(PI(),{className:o.headerLeft},v().createElement(Ed.k,{tooltipTitle:li().text("Close"),onClick:a,className:o.closeButton,iconClassName:o.closeIcon,icon:Tp()}),null==n?void 0:n.left),v().createElement(PI(),{className:o.headerCenter},v().createElement(PE,{modes:l,modeId:t,onChange:i,className:o.modeSwitcher})),v().createElement(PI(),{className:o.headerRight},null==n?void 0:n.right))),v().createElement(eF(),{className:o.content},r))},pF=(0,wp.Z)((()=>({root:{padding:"0 24px",overflowY:"auto",height:"calc(100vh - 64px)"},item:{padding:"2px"}}))),dF=({items:e,selectedItems:t,onSelectImage:r,onDeselectImage:n,onShareLink:a,onSetAsDefault:i,onDownload:o,onClickImage:l,onDelete:s})=>{const c=pF(),u=e=>v().createElement(fj,{id:e,selected:t.includes(e),selectionMode:0!==t.length,onSelect:()=>r(e),onDeselect:()=>n(e),onShareLink:()=>a(e),onSetAsDefault:()=>i(e),onDownload:()=>o(e),onClick:()=>l(e),onDelete:s?()=>s(e):void 0,canBeSelected:!0});return v().createElement(PI(),{className:c.root},v().createElement(ck(),{container:!0},e.map((({id:e,src:t})=>v().createElement(ck(),{key:e,classes:{item:c.item},item:!0},v().createElement(rk,{size:JD.LARGE,onClick:()=>l(e),src:t,overlay:u(e)}))))))},mF=(0,wp.Z)((e=>({selectButton:{fontSize:"14px",fontWeight:500,color:e.palette.primary.main,textTransform:"uppercase"}}))),fF=({selectedItems:e,items:t,onSelectAll:r,onClearAll:n})=>{const a=mF(),i=e.length===t.length;return v().createElement(ty(),{component:"button",underline:"none",classes:{button:a.selectButton},onClick:i?n:r},i?li().text("Clear selection"):li().text("Select all images"))};var yF=r(70997),gF=r.n(yF);const hF=(0,wp.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)"}}))),EF=({onDownload:e,onShare:t,onUpload:r,onDelete:n})=>{const a=hF();return v().createElement(v().Fragment,null,r&&v().createElement(Wh(),{variant:"contained",color:"primary",onClick:r,startIcon:v().createElement(aj(),null)},li().text("Upload")),e&&r&&v().createElement("div",{className:a.divider}),e&&v().createElement(Ed.k,{className:a.downloadButton,tooltipTitle:li().text("Download selected items"),icon:oj,onClick:e}),t&&v().createElement(Ed.k,{className:a.shareButton,tooltipTitle:li().text("Copy link"),icon:gF(),onClick:t}),n&&v().createElement(Ed.k,{className:a.deleteButton,tooltipTitle:li().text("Delete selected items"),icon:Fk(),onClick:n}))},bF=({attributeValues:e,open:t,onClose:r,currentAttributeValueUri:n,setCurrentAttributeValueUri:a,attributeType:i,onDownload:o,onShareLink:l,onSetAsDefault:s,onUpload:c,onDeleteAttribute:u})=>{const[p,d]=(0,b.useState)([]),[m,f]=(0,b.useState)(Qj.Gallery),y=(0,w.xH)();(0,b.useEffect)((()=>{f(n?Qj.Details:Qj.Gallery)}),[n]);const g=e.map((e=>({src:(0,S.getImageAttributeOvThumbnailUrl)(e),downloadURL:(0,S.getImageAttributeOvUrl)(e),id:e.uri}))),h=e=>{l(g.find((0,_.propEq)("id",e)).downloadURL)},E=t=>{const r=e.find((({uri:e})=>e===t));s(r)},T=e=>{u({uri:e,attributeType:i})},{canCreate:O,canDelete:x}=(0,b.useContext)(Tk),C=m===Qj.Gallery,A=m===Qj.Details,R=p.length>0,I=A||C&&R,N=()=>C?p:[n],P=N().every((e=>(0,S.isTempUri)(e)||x)),D=!y&&I&&P,k=!y&&O&&(A||C&&!R),L=C&&R&&v().createElement(fF,{items:g,selectedItems:p,onClearAll:()=>{d([])},onSelectAll:()=>{d((0,_.pluck)("id",g))}}),U=v().createElement(EF,{onDelete:D?()=>{N().forEach((e=>{T(e)})),p.length&&d([])}:void 0,onDownload:I?()=>{const e=C?(0,_.pipe)((0,_.filter)((({id:e})=>p.includes(e))),(0,_.pluck)("downloadURL"))(g):[g.find((0,_.propEq)("id",n)).downloadURL];o(e)}:void 0,onShare:A?()=>{h(n)}:void 0,onUpload:k?c:void 0});return v().createElement(uF,{mode:m,open:t,onChangeMode:f,header:{left:L,right:U},onClose:r},C&&v().createElement(dF,{items:g,selectedItems:p,onSelectImage:e=>{d((t=>[...t,e]))},onDeselectImage:e=>{d((t=>t.filter((t=>t!==e))))},onShareLink:h,onSetAsDefault:E,onDownload:e=>{o([g.find((0,_.propEq)("id",e)).downloadURL])},onClickImage:e=>{a(e),f(Qj.Details)},onDelete:y?void 0:T}),A&&v().createElement(Xj,{handleSetAsDefault:E,setCurrentAttributeValueUri:a,currentAttributeValueUri:n,attributeValues:e,attributeType:i}))},vF=(0,wp.Z)((e=>({imageBox:{position:"relative",display:"flex",width:"100%",flexGrow:1,flexShrink:0,flexWrap:"nowrap",marginTop:"2px",overflow:"hidden"},moreButtonContainer:({imageWidth:e,imageHeight:t})=>({backgroundColor:"white",width:e,height:t,position:"absolute",right:0,cursor:"pointer"}),moreButton:({imageWidth:t,imageHeight:r})=>({display:"flex",justifyContent:"center",alignItems:"center",width:t,height:r,backgroundColor:(0,wm.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 TF(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const OF=({attributeType:e,attributeValues:t=[],renderImage:r,overlay:n=!1,countFixedItems:a=0,children:i,onUpload:o,onDeleteAttribute:l,imageSize:s=nk,paging:c,parentUri:u,showNonOv:p,requestNextPageOfAttributeValues:d})=>{const m=vF(s);(0,b.useEffect)((()=>{if(c&&d){const r=p?c.totalOvValues:c.totalValues;r>t.length&&d({parentUri:u,attributeTypeUri:e.uri,attributeTypeName:e.name,values:[],defaultMaxValues:r})}}),[c,d,e,u,t.length,p]);const f=(0,b.useRef)(),[y,g]=(0,b.useState)(0),[h,E]=(0,b.useState)(0),T=(0,b.useContext)(II),[O,x]=(0,b.useState)(!1),[C,A]=(0,b.useState)(),R=(0,w.ax)("setDefaultProfilePicForEntity"),_=(0,w.ax)("setDefaultProfilePicForModifiedEntity"),I=(0,w.eh)()||{},N=(0,w.xH)(),P=(0,b.useCallback)((e=>{const{imageMargin:r,imageWidth:n}=s,i=Math.floor((e+r)/(n+r))-a,o=e+r-(i+a)*(n+r)<8;g(i),t.length>i?E(t.length-i+(o?1:0)):E(0)}),[t.length,a,s]),D=(0,b.useCallback)((e=>{P(e),f.current=e}),[P]);(0,b.useEffect)((()=>{f.current&&P(f.current)}),[t.length,P]);const k=(0,b.useCallback)((e=>{T||(A(e),x(!0))}),[T]),L=(0,b.useCallback)((()=>{x(!1)}),[]),U=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),j=e=>navigator.clipboard.writeText(e),F=(0,b.useCallback)((e=>{N?(0,S.insertDefaultImageByAttrUri)(I.uri,e.uri).then((({status:t})=>{"success"===t&&R(e)})):_({entityUri:I.uri,value:e})}),[N,I.uri,R,_]),M=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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){TF(e,t,r[t])}))}return e}({onOpenImageGalleryDialog:k},n&&{onDownload:U,onShareLink:j,onSetAsDefault:F});return v().createElement(v().Fragment,null,v().createElement(Fp.Z,{handleWidth:!0,onResize:D}),v().createElement(bF,{attributeValues:t,open:O,onClose:L,setCurrentAttributeValueUri:A,currentAttributeValueUri:C,attributeType:e,onDownload:U,onShareLink:j,onSetAsDefault:F,onUpload:o,onDeleteAttribute:l}),v().createElement("div",{className:m.imageBox},i,t.slice(0,y).map(r(M)),h>0&&v().createElement("div",{className:m.moreButtonContainer},v().createElement("div",{className:m.moreButton,onClick:()=>k()},v().createElement(bf(),{className:m.number},`+${h}`)))))},SF=(0,wp.Z)((e=>({image:({imageMargin:e,imageHeight:t,imageWidth:r})=>({marginRight:e,width:r,height:t,cursor:"pointer","&:last-child":{marginRight:0}}),deleteAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,background:`url('${(0,S.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:S.historyPalettes[S.HistoryOperations.deleteAttribute].backgroundColor,pointerEvents:"none"}},updateAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:S.historyPalettes[S.HistoryOperations.updateAttribute].backgroundColor,pointerEvents:"none"}},deleteAttribute:({imageWidth:e,imageHeight:t})=>({width:e,height:t,boxSizing:"border-box",outline:`3px solid ${S.historyPalettes[S.HistoryOperations.deleteAttribute].color}`,outlineOffset:"-3px"}),insertAttribute:({imageWidth:e,imageHeight:t})=>({width:e,height:t,boxSizing:"border-box",outline:`3px solid ${S.historyPalettes[S.HistoryOperations.insertAttribute].color}`,outlineOffset:"-3px"}),updateAttribute:({imageWidth:e,imageHeight:t})=>({width:e,height:t,boxSizing:"border-box",outline:`3px solid ${S.historyPalettes[S.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"}}))),xF=({attributeType:e,attributeValues:t=[],paging:r,parentUri:n,requestNextPageOfAttributeValues:a,showNonOv:i,imageSize:o=nk})=>{const l=SF(o),{appearance:s}=(0,b.useContext)(fP);return v().createElement(OF,{attributeValues:t,attributeType:e,renderImage:({onOpenImageGalleryDialog:e})=>t=>{const r=(0,S.getImageAttributeOvThumbnailUrl)(t),{uri:n}=t,a=(0,S.getHistoryAppearanceByUri)(n,s),i=(0,S.getHistoryAttributeClassName)(a);return v().createElement("div",{className:O()(l.image,{[l[i+"Image"]]:i}),key:n,"data-reltio-id":"reltio-attribute-value"},v().createElement(rk,{onClick:()=>e(n),className:l[i],src:r,size:{imageWidth:o.imageWidth,imageHeight:o.imageHeight}}))},imageSize:o,requestNextPageOfAttributeValues:a,paging:r,parentUri:n,showNonOv:i})},CF=({attributeType:e,attributeValues:t,paging:r,parentUri:n,showNonOv:a,requestNextPageOfAttributeValues:i})=>{const o=xD(),{label:l,description:s}=e;return v().createElement(v().Fragment,null,v().createElement("div",{className:o.titleRow},v().createElement(tP,{className:o.title,label:l,"data-reltio-id":"reltio-attribute-label"}),v().createElement(uP,{className:o.descriptionIcon,description:s})),v().createElement(xF,{attributeValues:t,attributeType:e,paging:r,parentUri:n,requestNextPageOfAttributeValues:i,showNonOv:a}))};function wF(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){AF(e,t,r[t])}))}return e}function AF(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const RF="oneLine",_F="multiLine",IF="imageLine",NF="special",PF=(0,b.memo)((({values:e,attributeType:t,drawLines:r,paging:n={},parentUri:a,max:i,showNonOv:o,classes:l})=>{var s;const c=OD(),u=(0,w.ax)("requestNextPageOfAttributeValues"),p=(0,w.vd)(),d=null!==(s=null!=i?i:p)&&void 0!==s?s:1/0,m=(0,_.partition)(S.isOv);if(!e||!e.length)return null;const[f,y]=m(e),g=o?e:f,h=o?[]:y,E=o?"totalValues":"totalOvValues",b=(0,_.ifElse)((0,_.has)(E),(0,_.prop)(E),(0,_.always)(g.length))(n),T=null!=n&&n.totalValues?n.totalValues-b:h.length,x=1===b&&!(0,S.isComplexAttribute)(t);return v().createElement(YI,{enabled:r,className:O()(wF({[c.paddingWrapperWithLines]:r},null!=l&&l.wrapperWithLines?{[null==l?void 0:l.wrapperWithLines]:r}:{}))},v().createElement("div",{className:O()(wF({[c.paddingWrapper]:!r},null!=l&&l.wrapper?{[null==l?void 0:l.wrapper]:!r}:{}))},(()=>{switch((0,_.cond)([[S.isSpecialAttribute,(0,_.always)(NF)],[S.isImage,(0,_.always)(IF)],[(0,_.always)(x),(0,_.always)(RF)],[_.T,(0,_.always)(_F)]])(t)){case RF:return v().createElement(CD,{value:g[0],nonVisibleValues:h,totalNonVisibleValues:T,attributeType:t,showNonOv:o,classes:l});case _F:return v().createElement(kD,{values:g,nonVisibleValues:h,totalVisibleValues:b,totalNonVisibleValues:T,attributeType:t,parentUri:a,max:d,requestNextPageOfAttributeValues:u,showNonOv:o,classes:l});case IF:return v().createElement(CF,{attributeValues:g,attributeType:t,paging:n,parentUri:a,requestNextPageOfAttributeValues:u,showNonOv:o});case NF:return v().createElement(ZD,{values:g,attributeType:t,classes:l})}})()))})),DF=({attrTypes:e=[],entity:t,parentUri:r,drawLines:n,children:a,className:i,max:o,alwaysVisibleTypeUris:l=gL,showNonOv:s,classes:c})=>{const u=(0,b.useContext)(bL),p=r&&(0,S.getBaseUri)(r),d=(0,b.useMemo)((()=>u[p]||[]),[u,p]),m=(0,b.useMemo)((()=>(e||[]).filter((e=>!d.includes(e.uri)))),[e,d]),[f,y]=(0,b.useState)(o||1/0),g=(0,b.useMemo)((()=>(0,S.getAttributesListForReadMode)(m,t,s)),[m,t,s]),[h,E]=(0,b.useMemo)((()=>Zk(l,g)),[g,l]),T=E.slice(0,f),O=o&&T.length<E.length,x=o&&T.length>=E.length&&o<T.length,C={enabled:n};return v().createElement("div",{className:i},a&&v().createElement(YI,C,a),T.concat(h).map((({attrType:e,values:a})=>v().createElement(PF,{key:e.uri,attributeType:e,drawLines:n,values:a,paging:(0,_.path)(["paging",e.uri],t.attributes),parentUri:r,showNonOv:s,classes:c}))),O&&v().createElement(_D,{onClick:()=>{y(1/0)}}),x&&v().createElement(DD,{onClick:()=>{y(o)}}))};DF.displayName="ReadOnlyAttributesList";const kF=(0,b.memo)(DF),LF=(0,wp.Z)({attributesContainer:{padding:"8px 16px"},noCaption:{paddingTop:"16px"},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"}}),UF=({className:e,entity:t={},caption:r="",excludeUris:n=[],includeUris:a=[],attributesCount:i})=>{const o=LF(),l=(0,w.AH)(),s=(0,w.xK)(),c=(0,b.useMemo)((()=>qk(l,t.type,a,n)),[n,a,l,t]),u=i||16,p=(0,S.getAttributesListForReadMode)(c,t).filter((({values:e})=>!(0,S.isEmptyValue)(e))).length>0;return p||!(0,S.isEmptyValue)(r)?v().createElement(DI.Provider,{value:s},v().createElement(VI,{className:e},r&&v().createElement(BI.I,{title:r}),v().createElement(PI(),{className:O()(o.attributesContainer,{[o.noCaption]:!r})},p?v().createElement(kF,{entity:t,attrTypes:c,parentUri:t.uri,drawLines:!1,max:u}):v().createElement(bf(),{className:o.noData},li().text("No data found"))))):null},jF=(0,wp.Z)({attributesContainer:{overflow:"hidden",padding:"8px 16px"},noCaption:{paddingTop:"16px"}}),FF=({className:e,mode:t,entity:r,caption:n="",excludeUris:a=[],includeUris:i=[],pinnedAttributes:o})=>{const l=jF(),s=(0,w.ax)("addAttributes"),c=(0,w.ax)("modifyAttribute"),u=(0,w.ax)("removeAttribute"),p=(0,w.AH)(),d=(0,w.R2)(),m=(0,w.vc)(r.uri)||{},f=(0,b.useMemo)((()=>(0,S.getPinnedAttributesForUser)(o,d)),[o,d]),y=(0,b.useMemo)((()=>qk(p,m.type,i,a)),[a,i,p,m.type]);return v().createElement(VI,{className:e},n&&v().createElement(BI.I,{title:n}),v().createElement(PI(),{className:O()(l.attributesContainer,{[l.noCaption]:!n})},v().createElement(hL.Provider,{value:f},v().createElement(OL,{entity:m,attrTypes:y,parentUri:m.uri,drawLines:!1,mode:t,showEmptyEditors:(0,S.isTempUri)(m.uri),crosswalks:m.crosswalks,onAddAttributes:s,onChangeAttribute:c,onDeleteAttribute:u}))))};function MF(){return MF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},MF.apply(null,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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributesCount","pinnedAttributes"]);const a=(0,w.Fr)(),i=(0,w.YA)(),o=n.entity||a,l=n.mode||i;return v().createElement(rP.Provider,{value:o},(0,S.isViewMode)(l)?v().createElement(UF,MF({},n,{attributesCount:t,entity:o})):v().createElement(FF,MF({},n,{mode:l,pinnedAttributes:r,entity:o})))},BF=(0,wp.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,mp.useSelector)(Qs),r=(0,mp.useSelector)(Ks);return v().createElement(v().Fragment,null,r&&v().createElement(CE.z,null),t?v().createElement("div",{className:e.container},v().createElement(_I,{entity:t,classes:{profileBand:e.profileBand}}),v().createElement("div",{className:e.scrollWrapper},v().createElement(II.Provider,{value:!0},v().createElement(VF,{className:e.attributesView,entity:t,mode:S.Mode.Viewing})))):v().createElement("div",{className:e.emptyState},v().createElement(xE,{LogoRenderer:SE.NO_DATA,text:li().text("No data to display."),secondaryText:li().text("Select a profile and view preview details here."),variant:OE.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=v().createContext({});ZF.displayName="EntityMarkerContext";var $F=r(17871);const KF=(0,wp.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"}}}}))),XF=({entity:e,classes:t={}})=>{const r=KF(),{secondaryLabel:n,label:a}=t,i=(0,S.getLabel)(e.label),{secondaryLabel:o}=e,l=(0,b.useCallback)((()=>{navigator.clipboard.writeText((0,S.getEntityId)(e))}),[e]);return v().createElement(v().Fragment,null,v().createElement(A,{entity:e,imageClassName:r.image}),v().createElement("div",{className:r.info},v().createElement(Md,{value:(0,S.getEntityUriForLink)(e),className:r.link},v().createElement(od.Y,{value:i,placement:"top",showOnExceededHeight:!0},v().createElement("div",{className:O()(r.label,a)},i))),o&&v().createElement(od.Y,{value:o,placement:"top",showOnExceededHeight:!0},v().createElement("div",{className:O()(r.secondaryLabel,n)},o)),v().createElement("div",{className:r.thirdRow},v().createElement(sE,{entity:e,size:"medium"}),v().createElement("div",{className:r.entityId,onClick:l},v().createElement("div",{className:r.entityIdLabel},li().text("ID:")),v().createElement(od.Y,{value:`Copy to clipboard ${(0,S.getEntityId)(e)}`,placement:"top"},v().createElement("div",{className:r.entityIdValue},(0,S.getEntityId)(e)))))))},QF=(0,wp.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)"}}),JF=()=>{const e=QF();return v().createElement(v().Fragment,null,v().createElement("div",{className:O()(e.avatar,e.wave)}),v().createElement("div",{className:e.info},v().createElement("div",{className:O()(e.label,e.wave)}),v().createElement("div",{className:O()(e.secondaryLabel,e.wave)}),v().createElement("div",{className:O()(e.thirdRow,e.wave)})))},eM=(0,wp.Z)({container:{display:"flex",padding:"16px",overflow:"hidden"}});function tM(){return tM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tM.apply(null,arguments)}const rM=(0,b.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entity","classes","variant"]);const i=eM(),{container:o}=r;return v().createElement("div",tM({className:O()(i.container,o)},a),"normal"===n?v().createElement(XF,{entity:t,classes:r}):v().createElement(JF,null))})),nM=(0,wp.Z)({popper:{maxWidth:"263px",minWidth:"150px",boxShadow:"0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.2)",backgroundColor:"white",borderRadius:"2px"}});function aM(){return aM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aM.apply(null,arguments)}const iM=(0,S.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,S.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>'),lM=(0,b.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["marker","onClick"]);const a=nM(),i=(0,b.useRef)(),[o,l]=(0,b.useState)(!1),{activeEntityUri:s}=(0,b.useContext)(ZF),c=(0,_.pathEq)(["entity","uri"],s,t),u={lat:t.point.lat,lng:t.point.lng},p=(0,b.useCallback)((0,S.debounce)(l,50),[]),d=(0,b.useCallback)((()=>p(!0)),[p]),m=(0,b.useCallback)((()=>p(!1)),[p]),f=(0,b.useCallback)((()=>r(t)),[r,t]);return v().createElement(v().Fragment,null,v().createElement(lN.r,{anchorEl:i.current,open:o,className:a.popper,modal:!1,placement:"top"},v().createElement(rM,{entity:t.entity,onMouseOver:d,onMouseOut:m})),v().createElement($F.Jx,aM({icon:{url:o||c?iM:oM,scaledSize:new google.maps.Size(22,32)},position:u,onClick:f,visible:!1!==t.visible,onMouseOver:d,onMouseOut:m},n)),v().createElement($F.vD,{options:{alignBottom:!0,pane:"mapPane",pixelOffset:new google.maps.Size(0,-40),closeBoxURL:"",enableEventPropagation:!0,disableAutoPan:!0},position:u},v().createElement("span",{ref:i})))}));var sM=r(47111);const cM=({children:e,className:t,position:r,map:n})=>{const[a,i]=(0,b.useState)(null);return(0,b.useEffect)((()=>{const e=document.createElement("div"),t=n.controls[r].length;return n.controls[r].push(e),i(e),()=>{n.controls[r].removeAt(t)}}),[n,r]),(0,b.useEffect)((()=>{a&&t&&a.classList.add(t)}),[t,a]),a?(0,sM.createPortal)(e,a):null};var uM=r(518),pM=r.n(uM);function dM(){return dM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dM.apply(null,arguments)}const mM=e=>v().createElement("svg",dM({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgRadius"},e),v().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 fM(){return fM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fM.apply(null,arguments)}const yM=e=>v().createElement("svg",fM({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgDraw"},e),v().createElement("defs",null,v().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"})),v().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"Draw_svg__b",fill:"#fff"},v().createElement("use",{xlinkHref:"#Draw_svg__a"})),v().createElement("g",{mask:"url(#Draw_svg__b)",fill:"#000",fillOpacity:.54},v().createElement("path",{d:"M0 0h24v24H0z"})))),gM=(0,wp.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"}}),hM=(0,ld.T)(Wh()),EM=({drawingMode:e,drawingModes:t=[],hasActiveOverlay:r,onDrawingModeChanged:n,onClearOverlay:a})=>{const i=gM(),o=e=>()=>{n(e)};return v().createElement("div",{className:i.container},e||r?v().createElement(hM,{tooltipTitle:li().text("Clear area"),className:i.button,onClick:r?a:o(null)},v().createElement(pM(),{className:i.icon})):t.map((e=>{const t=(e=>{switch(e){case HF:return mM;case YF:return yM;default:return null}})(e);return v().createElement(hM,{tooltipTitle:li().text("Draw area"),key:e,className:i.button,onClick:o(e)},v().createElement(t,{className:i.icon}))})))},bM=(0,wp.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"}}}),vM=({isSearchOnMapMove:e,onChangeIsSearchOnMapMove:t})=>{const r=bM();return v().createElement(bh(),{classes:{root:r.container,label:r.label},control:v().createElement(Wp(),{checked:e,onChange:e=>{t(e.target.checked)},className:r.checkbox}),label:li().text("Search as I move the map")})},TM=e=>{const t=e.getBounds(),r=t.getNorthEast(),n=t.getSouthWest(),a=r.lat(),i=r.lng(),o=n.lat(),l=n.lng(),s=[],c=[];if(!(180===i&&-180===l||-180===i&&180===l)){const e=t.getCenter();s.push([a,e.lng()]),c.push([o,e.lng()])}return[[a,i],...s,[a,l],[o,l],...c,[o,i]]},OM=e=>{switch(e){case HF:return window.google.maps.drawing.OverlayType.CIRCLE;case YF:return window.google.maps.drawing.OverlayType.POLYGON;default:return null}},SM=(e,t,r)=>{if(t.path){const n=r||new window.google.maps.LatLngBounds;t.path.forEach((({lat:e,lng:t})=>n.extend(new window.google.maps.LatLng(e,t)))),e.fitBounds(n)}},xM=(0,wp.Z)({mapControlContainer:{borderRadius:"2px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.15)",margin:"10px"}});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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const AM=["drawing"],RM=({markers:e=[],mapKey:t,defaultZoom:r,defaultCenter:n,loadingElement:a,isSearchOnMapMove:i,isSearchEnabled:o,activeOverlay:l,overlayOptions:s={},drawingModes:c=[],markerClusterer:u,markerClustererOptions:p,mapOptions:d={},mapContainerClassName:m,onMapBoundsChanged:f=_.identity,onOverlayUpdated:y=_.identity,onMarkerClicked:g=_.identity})=>{const h=xM(),{isLoaded:E,loadError:T}=(0,$F.Ji)({googleMapsApiKey:t,libraries:AM}),O=(0,b.useRef)(null),[S,x]=(0,b.useState)(null),[C,w]=(0,b.useState)(null),[A,R]=(0,b.useState)(null);(({markers:e,activeOverlay:t,isSearchOnMapMove:r,map:n})=>{const a=Boolean(n&&window.google),i=(0,wy.D)(e),o=(0,wy.D)(t),l=(0,wy.D)(a);(0,b.useEffect)((()=>{const s=i!==e,c=l!==a,u=a&&t&&(o!==t||c);a&&!r&&e.length&&(s||c)?((e,t,r)=>{const n=new window.google.maps.LatLngBounds;if(e.forEach((e=>n.extend(e.point))),1===e.length){const t=e[0].point;n.extend(new window.google.maps.LatLng(t.lat+qF,t.lng+qF)),n.extend(new window.google.maps.LatLng(t.lat-qF,t.lng-qF))}t.fitBounds(n),r&&SM(t,r,n)})(e,n,t):u&&SM(n,t)}),[a,e,t])})({markers:e,activeOverlay:l,map:S,isSearchOnMapMove:i});const I=(0,b.useMemo)((()=>CM({},WF,s)),[s]),N=(0,b.useMemo)((()=>CM({},GF,d)),[d]),P=(0,b.useCallback)((e=>{f(e?TM(S):null),R(null),clearTimeout(O.current)}),[S,f]),D=(0,b.useCallback)((()=>{clearTimeout(O.current)}),[]),k=(0,b.useCallback)((()=>{i&&f(TM(S))}),[i,S,f]),L=(0,b.useCallback)((()=>{i&&(clearTimeout(O.current),O.current=setTimeout(k,1e3))}),[k,i]),U=(0,b.useCallback)(((e,t)=>{var r;const n=t||C&&{type:YF,overlay:C};if((0,_.isEmpty)(n))return;const{overlay:a,type:i}=n,o={[YF]:()=>a.getPath().getArray().map((e=>[e.lat(),e.lng()])),[HF]:()=>({radius:a.getRadius()/1e3,center:a.getCenter()})},l=null===(r=o[i])||void 0===r?void 0:r.call(o);l&&y({data:l,type:i})}),[y,C]),j=(0,b.useCallback)((e=>t=>{U(null,{type:e,overlay:t}),t.setMap(null),R(null)}),[U]),F=(0,b.useCallback)((()=>{y(null)}),[y]),M=t=>e.filter((0,_.prop)("point")).map((e=>v().createElement(lM,{key:e.id,marker:e,clusterer:t,onClick:g})));if(T)return null;if(!E)return a;const V=o&&Boolean(c.length),B=S&&o&&Boolean(c.length),z=S&&o,H=!OM(A)&&l&&(0,_.propEq)("type",YF,l);return v().createElement($F.b6,{mapTypeId:window.google.maps.MapTypeId.ROADMAP,options:N,onLoad:x,zoom:r,center:n,onZoomChanged:D,onDragStart:D,onIdle:L,mapContainerClassName:m},B&&v().createElement(cM,{className:h.mapControlContainer,position:window.google.maps.ControlPosition.TOP_RIGHT,map:S},v().createElement(EM,{hasActiveOverlay:!!l,drawingModes:c,drawingMode:A,onDrawingModeChanged:R,onClearOverlay:F})),z&&v().createElement(cM,{className:h.mapControlContainer,position:window.google.maps.ControlPosition.TOP_CENTER,map:S},v().createElement(vM,{onChangeIsSearchOnMapMove:P,isSearchOnMapMove:i})),u?(Y=p,v().createElement($F.XL,{options:Y},M)):M(),H&&v().createElement($F.mg,{onLoad:w,path:l.path,editable:!0,options:I,onMouseUp:U,onDragEnd:U}),V&&v().createElement($F.j_,{onPolygonComplete:j(YF),onCircleComplete:j(HF),drawingMode:OM(A),options:{drawingControl:!1,circleOptions:I,polygonOptions:I}}));var Y},_M=(e,t)=>Math.abs(e-t)<1,IM=(0,_.curry)(((e,t,r)=>{const n=t.map((({position:t})=>{const r=e.find((({point:e})=>_M(t.lat(),e.lat)&&_M(t.lng(),e.lng)));return(0,_.propOr)("","label",r)})),a=(n.length>2?n.slice(0,2).concat("..."):n).join("\n");let i=0;const o=t.length.toString();let l=o;for(;0!==l;)l=parseInt(l/10,10),i++;return i=Math.min(i,r),{text:o,index:i,title:a}})),NM=[],PM=(0,_.pipe)((0,_.path)(["point","lat"]),(0,_.both)((0,_.gt)(90),(0,_.lt)(-90))),DM={[S.MapSearch.geoPolygon]:YF,[S.MapSearch.geoLocation]:HF},kM=e=>e&&e.length?[...e,e[0]]:e,LM=e=>e[0].map((([e,t])=>({lat:e,lng:t}))).slice(0,-1),UM=(0,wp.Z)((()=>({container:{height:"100%",width:"100%",position:"relative"},fullHeight:{height:"100%"}}))),jM=()=>{const e=UM(),t=(0,mp.useSelector)(k().selectors.getMetadata),r=(0,mp.useSelector)(ai.Qr),n=(0,mp.useSelector)(Ri.AO),a=(0,mp.useSelector)(k().selectors.getGoogleMapKey),{markers:i,loading:o,onMarkerClicked:l}=(({searchResults:e,metadata:t,mapKey:r})=>{e=e||NM;const n=(0,mp.useDispatch)(),[a,i]=(0,b.useState)([]),[o,l]=(0,b.useState)(!1),s=(0,b.useRef)(),c=(0,b.useRef)(),u=(0,b.useCallback)((e=>{n({type:he,payload:e||null})}),[n]),p=(0,b.useCallback)((()=>{clearTimeout(c.current),clearTimeout(s.current)}),[]);return(0,b.useEffect)((()=>{l(!0),(0,S.resolve)(t,e,r).then((e=>{l(!1),i(e.filter(PM))})).catch((()=>{l(!1),i([])}))}),[e,t,r]),{markers:a,loading:o,onMarkerClicked:(0,b.useCallback)((e=>{const t=(0,_.path)(["entity","uri"],e);p(),u(),s.current=setTimeout((()=>u(t)),0),c.current=setTimeout(u,3e3)}),[p,u])}})({searchResults:r,metadata:t,mapKey:a}),{isSearchEnabled:s,activeOverlay:c,onOverlayUpdated:u,isSearchOnMapMove:p,onMapBoundsChanged:d}=(()=>{const e=(0,mp.useDispatch)(),t=(0,mp.useSelector)(ai.Qy),r=(0,mp.useSelector)(ai.bt),n=(0,mp.useSelector)(Ri.d7),[a,i]=(0,b.useState)(!1),o=(0,b.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=S.MapSearch.geoLocation;break}case YF:r=kM(e),n=S.MapSearch.geoPolygon}}i(!1),e(Ka(r,n))}),[e]),l=(0,b.useCallback)((t=>{i(!!t),e(Ka(kM(t),t&&S.MapSearch.onMapMove))}),[e]),s=DM[r],c=(0,b.useMemo)((()=>n&&s&&t.length?{path:s===YF?LM(t):null,type:s}:null),[n,t,s]);return(0,b.useEffect)((()=>{(c||0===t.length)&&i(!1)}),[t,c]),{isSearchEnabled:n,onOverlayUpdated:o,activeOverlay:c,isSearchOnMapMove:a,onMapBoundsChanged:l}})(),m=(0,b.useMemo)((()=>v().createElement("div",{className:e.fullHeight},v().createElement(CE.z,null))),[e]),f=(0,b.useMemo)((()=>({gridSize:60,maxZoom:9,calculator:IM(i)})),[i]),y=(0,b.useMemo)((()=>({activeEntityUri:n})),[n]),g=(0,b.useMemo)((()=>({lat:0,lng:0})),[]),h=(0,b.useMemo)((()=>[YF]),[]);return a?v().createElement("div",{className:e.container},o&&v().createElement(CE.z,null),v().createElement(ZF.Provider,{value:y},v().createElement(RM,{loadingElement:m,defaultZoom:1,defaultCenter:g,onOverlayUpdated:u,onMarkerClicked:l,activeOverlay:c,markers:i,fullscreenControl:!1,markerClusterer:!0,markerClustererOptions:f,drawingModes:h,isSearchOnMapMove:p,onMapBoundsChanged:d,isSearchEnabled:s,mapContainerClassName:e.fullHeight,mapKey:a}))):null},FM=(0,ld.T)(Cp.T),MM=e=>{switch(e){case Z.om.PROFILE:return li().text("Hide entity details");case Z.om.MAP:return li().text("Hide map")}},VM=()=>{const e=AI(),t=(0,mp.useDispatch)(),r=(0,mp.useSelector)(Ri.qx),n=r===Z.om.MAP,a=(0,mp.useSelector)(k().selectors.getGoogleMapKey),i=(0,b.useCallback)((()=>t(Ci(null))),[t]);return(0,b.useEffect)((()=>{!a&&n&&i()}),[a,n,i]),v().createElement("div",{className:e.container},v().createElement(FM,{tooltipTitle:MM(r),tooltipPlacement:"bottom-start",size:"L",icon:wI(),className:e.closeButton,onClick:i}),(e=>{switch(e){case Z.om.PROFILE:return v().createElement(zF,null);case Z.om.MAP:return v().createElement(jM,null)}})(r))},BM=({className:e,loading:t,entities:r,entityTypeTab:n,quantity:a,rowsPerPage:i,page:o,entityToHighlight:l,selectedEntityUri:s,mode:c,previewPanelMode:u,isPreviewPanelOpen:p,dispatch:d})=>{const m=AE(),f=(0,b.useRef)(),[y,g]=(0,b.useState)("50%"),h=(0,Ai.gj)(c),E=u===Z.om.PROFILE,T=u===Z.om.MAP,[x,C]=(0,b.useState)({}),w=(0,b.useCallback)(((e,t)=>{C((0,_.assoc)(e,t))}),[]);(0,b.useEffect)((()=>{f.current&&(f.current.scrollTop=0)}),[r]),(0,b.useEffect)((()=>{E&&((0,S.isEmptyValue)(r)?d(ec(null)):!(0,_.prop)(0,r)||s&&r.map((0,_.prop)("uri")).includes(s)||d(ec(r[0].uri)))}),[d,E,s,r]),(0,b.useEffect)((()=>{!E&&s&&d(tc(null))}),[d,s,E]);const A=(0,b.useCallback)((e=>d(((e,t=0,r)=>({type:U.Z.CHANGE_PAGE,payload:{pageNumber:e,debounceTime:t,entityTypeUri:r}}))(e,250,n))),[d,n]),R=(0,b.useCallback)((e=>d(((e,t)=>({type:U.Z.CHANGE_ROWS_PER_PAGE,payload:{number:e,entityTypeUri:t}}))(e,n))),[d,n]),I=(0,b.useCallback)((e=>d(ec(e))),[d]),N=(0,b.useCallback)((0,S.debounce)((e=>d({type:Ee,payload:e})),50),[d]),P=(0,b.useCallback)((({percentageSize:e})=>g(e)),[]),D=e=>{const t=(0,_.prop)(e.uri,x);return v().createElement(Om,{entity:e,entityImportStatus:t,onEntityImportStatusChange:w})},k=(0,b.useRef)(null);return v().createElement("div",{className:O()(m.container,e)},t&&v().createElement(CE.z,null),(0,Ai.gj)(c)?v().createElement(vI,{quantity:a}):v().createElement(cI,null),v().createElement(oE,{className:m.resizablePanesWrapper,orientation:"vertical",size:p?y:"100%",minSize:480,maxSize:-480,allowResize:p,onChange:P},v().createElement("div",{className:m.pane},v().createElement(wE,{error:v().createElement(xE,{LogoRenderer:SE.ERROR,text:li().text("Something went wrong."),variant:OE.embedded})},(()=>{const e=l||null;return a?v().createElement("div",{className:h?m.tableContainer:m.listContainer,ref:f},h?v().createElement(xI,{entities:r,entityToHighlight:e,selectedEntityUri:s,entityTypeUri:n,onEntityClick:E?I:void 0,onEntityHover:T?N:void 0,entitiesImportStatus:x,onEntityImportStatusChange:w,basicTableRef:k}):v().createElement(fE,{entities:r,entityToHighlight:e,selectedEntityUri:s,onEntityClick:E?I:void 0,onEntityHover:T?N:void 0,entitiesImportStatus:x,entityButtonsRenderer:D}),a>Z.Tu[0]&&v().createElement("div",{className:m.pagination},v().createElement(yE.Z,{count:a,rowsPerPageOptions:Z.Tu,rowsPerPage:i||Z.Tu[0],page:o||0,onChangePage:A,onChangeRowsPerPage:R,basicTableRef:k}))):v().createElement(xE,{LogoRenderer:SE.SEARCH_RESULTS,text:li().text("No results found."),secondaryText:li().text("Try adjusting your search or filter to find what you're looking for."),variant:OE.embedded})})())),v().createElement("div",{className:m.pane},v().createElement(VM,null))))};BM.propTypes={page:dp().number,quantity:dp().number,rowsPerPage:dp().number,entities:dp().array,loading:dp().bool,dispatch:dp().func,entityToHighlight:dp().string,mode:dp().string,entityTypeTab:dp().string,className:dp().string,isPreviewPanelOpen:dp().bool,previewPanelMode:dp().oneOf(Object.values(Z.om)),selectedEntityUri:dp().string},BM.defaultProps={quantity:0,entities:[]};const zM=(0,mp.connect)((e=>{const t=(0,Ri.tB)(e);return{quantity:(0,ai.NU)(e,{entityTypeUri:t}),page:(0,ai.fx)(e,{entityTypeUri:t}),rowsPerPage:(0,ai.Uz)(e,{entityTypeUri:t}),entities:(0,ai.BP)(e,{entityTypeUri:t}),loading:(0,ai.gP)(e),entityToHighlight:(0,Ri.Dn)(e),mode:(0,Ri.XM)(e),entityTypeTab:t,previewPanelMode:(0,Ri.qx)(e),isPreviewPanelOpen:(0,Ri.jr)(e),selectedEntityUri:Xs(e)}}))(BM);var HM=r(4539),YM=r.n(HM),WM=r(4494);const GM=(0,wp.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 v().createElement(ug(),{label:v().createElement("div",{className:t.labelContainer},e.title&&v().createElement("div",{className:t.title},e.title,": "),e.values&&v().createElement(od.Y,{value:r},v().createElement("div",{className:t.values},r))),onDelete:e.onDelete,variant:"outlined",deleteIcon:v().createElement(dg(),{"data-reltio-id":"facet-bar-chip-delete"}),classes:{root:t.root,deleteIcon:t.deleteIcon,label:t.label}})};qM.propTypes={classes:dp().object,title:dp().string,values:dp().array,onDelete:dp().func};const ZM=qM;class $M extends b.PureComponent{constructor(...e){super(...e),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 v().createElement(b.Fragment,null,v().createElement(Wh(),{"aria-describedby":a,color:"primary",variant:"contained",classes:{root:e.root,label:e.label},onClick:this.handleClick},li().text(`+ ${t.length}`)),v().createElement(lN.r,{id:a,open:n,onClose:this.handleClose,anchorEl:r,placement:"bottom-start"},v().createElement(LI(),{elevation:2,classes:{root:e.popperContent}},this.props.items)))}}$M.propTypes={classes:dp().object,items:dp().array},$M.defaultProps={items:[]};const KM=kf()((()=>({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(60904),eV=r(96177),tV=r.n(eV),rV=r(34319);const nV=(0,wp.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){iV(e,t,r[t])}))}return e}function iV(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oV(){return oV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},oV.apply(null,arguments)}const lV=({isOpen:e,isAvailableUpdate:t,isChangedSavedSearch:r,currentSavedSearch:n,onClose:a,onSave:i,onUpdate:o})=>{const l=nV(),[s,c]=(0,b.useState)(""),[u,p]=(0,b.useState)(Z.ib.private),d=t&&n&&s===n.name,m=d&&n.isPublic===(u===Z.ib.public)&&!r,f=(0,b.useCallback)((e=>{c(e.target.value)}),[]),y=(0,b.useCallback)((e=>{p(e)}),[]),g=(0,b.useCallback)((()=>d?o({share:u}):i({name:s,share:u})),[s,i,o,u,d]),h={InputProps:{classes:{input:O()(l.dialogInput,l.dialogFont)}},InputLabelProps:{classes:{root:l.dialogFont}}};return(0,b.useEffect)((()=>{if(e){const e=t?n.name:"",r=t&&n.isPublic?Z.ib.public:Z.ib.private;c(e),p(r)}}),[e,t,n]),v().createElement(gj(),{onClose:a,open:e,PaperProps:{classes:{root:l.dialogRoot}}},v().createElement(QM(),{classes:{root:l.dialogTitle}},li().text("Save search")),v().createElement(eF(),{classes:{root:l.dialogContentRoot}},v().createElement(JM.H,oV({classes:{root:l.dialogField},label:li().text("Name"),required:!0,variant:"filled",value:s,onInput:f,size:"small",autoFocus:!0},h)),v().createElement(rV.k,{entries:Z.m2,TextFieldProps:aV({classes:{root:l.dialogField},required:!0,label:li().text("Share with"),variant:"filled",size:"small"},h),value:u,onChange:y})),v().createElement(tV(),{classes:{root:l.dialogActions},disableSpacing:!0},v().createElement(Wh(),{onClick:a},li().text("Cancel")),v().createElement(Wh(),{color:"primary",onClick:g,disabled:d?m:0===s.length},d?li().text("Save"):li().text("Save as"))))};lV.propTypes={isOpen:dp().bool,isAvailableUpdate:dp().bool,isChangedSavedSearch:dp().bool,currentSavedSearch:dp().object,onClose:dp().func.isRequired,onSave:dp().func.isRequired,onUpdate:dp().func.isRequired};const sV=(0,mp.connect)((e=>{const t=(0,ho.LA)(e);return{isOpen:(0,Ri.jd)(e),isAvailableUpdate:!(0,_.isNil)(t)&&(0,ho.Jv)(e),isChangedSavedSearch:(0,ho.WH)(e),currentSavedSearch:t}}),{onClose:()=>gi(!1),onSave:e=>({type:tr,payload:e}),onUpdate:e=>({type:ar,payload:e})})(lV);var cV=r(11400);function uV(){return uV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},uV.apply(null,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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",uV({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},r),v().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,wp.Z)({button:{marginRight:"-4px"},dialogRoot:{minWidth:"600px",minHeight:"280px"},dialogContentRoot:{display:"flex",flexDirection:"column",gap:"20px"}}),mV=()=>{const e=dV(),t=(0,mp.useStore)(),[r,n]=(0,b.useState)(!1),[a,i]=(0,b.useState)(!1),o=(0,b.useCallback)((()=>n(!1)),[]),l=(0,b.useCallback)((()=>n(!0)),[]),s=(0,b.useCallback)((async(e,r,n)=>{const a=t.getState(),l=(0,bo.Z)(a),s=(0,ho.Cc)(a,!0);i(!0);try{await(0,S.createSavedSearch)([{name:e,description:r,isPublic:n,query:s,uiState:l,type:S.SavedSearchType.SEGMENTATION}]),i(!1),o()}catch(e){(0,ii.U)(e,{defaultMessage:li().text("Something went wrong while saving of the segment")}),i(!1)}}),[t,o]);return v().createElement(v().Fragment,null,v().createElement(Ed.k,{icon:pV,size:"L",onClick:l,tooltipTitle:li().text("Save as segment"),className:e.button}),v().createElement(cV.L,{isOpen:r,isSaving:a,onClose:o,onSave:s}))};function fV(){return fV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fV.apply(null,arguments)}const yV=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",fV({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),v().createElement("g",null,v().createElement("path",{fill:"none",d:"M0 0h24v24H0z"})),v().createElement("g",null,v().createElement("path",{fillOpacity:".54",d:"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"})))};function gV(){return gV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gV.apply(null,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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",gV({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),v().createElement("defs",null,v().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"})),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"svg1966704254b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg1966704254a"})),v().createElement("g",{mask:"url(#svg1966704254b)",fill:"#000",fillOpacity:".54"},v().createElement("path",{d:"M0 0h24v24H0z"}))))};function EV(){return EV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},EV.apply(null,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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",EV({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),v().createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),v().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?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vV.apply(null,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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().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),v().createElement("defs",null,v().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"})),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"svg2486556319b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg2486556319a"})),v().createElement("g",{mask:"url(#svg2486556319b)",fill:"#000",fillOpacity:".54"},v().createElement("path",{d:"M0 0h12v24H0z"}))))};var OV=r(69199),SV=r.n(OV),xV=r(37290),CV=r.n(xV);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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _V=(0,wp.Z)({title:{marginBottom:"-10px"},linkField:{margin:"10px 0"},linkInput:{textOverflow:"ellipsis",fontSize:"14px"}}),IV=({open:e,onClose:t=_.identity})=>{const r=_V(),n=(({enabled:e})=>{const[t,r]=(0,b.useState)(""),n=(0,mp.useSelector)(bo.Z),a=(0,mp.useSelector)(ai.RO),i=(0,mp.useSelector)(k().selectors.getServicesPath),o=(0,mp.useSelector)(k().selectors.getUIPath);return(0,b.useEffect)((()=>{e?(0,S.rawRequest)(`${i}/searchLink`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(AV({},n,{currentTenant:a}))}).then((0,_.pipe)((0,_.prop)("link"),(0,S.getSearchLink)(o),r)).catch(si):r("")}),[e]),t})({enabled:e});return v().createElement(gj(),{open:e,onClose:t},v().createElement(QM(),{className:r.title},li().text("Share link with search results")),v().createElement(eF(),null,v().createElement(SV(),null,li().text("With the URL link, anyone can view these search results. Paste this link in email or IM for testing, analyze, sharing and more.")),v().createElement(CV(),{className:r.linkField,InputProps:{classes:{input:r.linkInput}},label:n?"URL":"",placeholder:li().text("Loading URL..."),value:n,variant:"filled",fullWidth:!0,size:"small"})),v().createElement(tV(),null,v().createElement(Wh(),{onClick:t},li().text("Cancel")),v().createElement(Wh(),{disabled:!n,onClick:(0,_.pipe)((()=>wV(n)),t),color:"primary",autoFocus:!0},li().text("Copy link"))))};IV.propTypes={open:dp().bool,onClose:dp().func};const NV=IV,PV=(0,wp.Z)((()=>({button:{marginRight:"-4px"},exportButtonDisabled:{opacity:"0.54"}}))),DV=({customActions:e=[]})=>{const t=PV(),r=(0,mp.useDispatch)(),n=(0,mp.useSelector)(k().selectors.getUIConfig),a=(0,mp.useSelector)(k().selectors.getCanUserMakeExport),i=(0,mp.useSelector)(k().selectors.getCanUserOpenDataLoader),o=!!(0,S.findPerspectiveConfig)(S.ScreenType.Segmentation,n),l=!!(0,mp.useSelector)(ai.lF),{canExport:s}=(0,mp.useSelector)(Ri.MO),c=s&&a,u=(0,b.useCallback)((()=>{r({type:U.Z.EXPORT_RESULTS})}),[r]),p=(0,b.useCallback)((()=>{r({type:U.Z.OPEN_DATA_LOADER})}),[r]),d=(0,mp.useSelector)(ai.ai),m=(0,b.useCallback)((()=>{r(gi(!0))}),[r]),f=[],[y]=(()=>{const e=(0,mp.useSelector)(k().selectors.getCanUserStartProcessFromQuery),t=(0,mp.useSelector)(k().selectors.getWorkflowPath),r=(0,mp.useSelector)(k().selectors.getWorkflowEnvironmentUrl),n=(0,mp.useSelector)(Ri.FH),a=(0,mp.useSelector)(k().selectors.getTenant),i=(0,mp.useDispatch)(),o=(0,mp.useSelector)(ai.FR),{globalFilter:l}=(0,mp.useSelector)(k().selectors.getGlobalSearchRequestOptions),s=(0,Ua._k)(o,[],l),c=(0,b.useCallback)((()=>{const{processType:e}=n;(0,S.startProcessFromQuery)({workflowPath:t,processType:e,searchString:s,tenant:a,environment:r}).then((()=>{i(xi({message:li().text("Match reviews successfully submitted. Go to Inbox to view their status."),actionToDispatch:D.ui.actions.openAppFromChocolateBar("Inbox"),actionLabel:li().text("Go to inbox"),autoHideDuration:null}))})).catch((e=>{si(e)}))}),[n,t,s,a,r,i]),u=s.includes("matches")||s.includes("matchRules");return[e&&t&&n?{disabled:!u,text:li().text("Request Match Review"),tooltip:li().text("Filter on match rules or potential matches to enable Potential Match Review"),onClick:c,id:"-request-match-review"}:null]})();y&&f.push(y);const[g]=(()=>{const e={NO_ENTITY_TYPE:li().text("Please select exactly one entity type or switch to table mode")},t=(0,mp.useDispatch)(),r=(0,mp.useSelector)(Ri.MO),n=(0,mp.useSelector)(k().selectors.getCanUserMakeBulkUpdate),a=!!(0,mp.useSelector)(ai.lF),i=(0,mp.useSelector)(Zc),o=!!i,l=Boolean(null==r?void 0:r.bulkUpdate),s=(0,mp.useSelector)(k().selectors.getMetadata),c=(0,mp.useSelector)(Ri.Xf),u=l&&n&&!a?{disabled:!o||!(e=>(0,ja.wW)(s,{},c).some((t=>t.value===e)))(i),text:li().text("Bulk update"),tooltip:o?null:e.NO_ENTITY_TYPE,onClick:()=>t(wi(!0)),id:"-bulk-update"}:null;return[u]})();g&&f.push(g);const[h,E]=(0,b.useState)(!1);return f.push({text:li().text("Share link"),onClick:()=>E(!0),id:"-share-link"}),f.push(...e),v().createElement(v().Fragment,null,i&&v().createElement(Ed.k,{icon:bV,size:"L",onClick:p,tooltipTitle:li().text("Load data"),className:t.button,"data-reltio-id":"reltio-search-actions-menu-load-data"}),c&&v().createElement(Ed.k,{icon:yV,size:"L",onClick:u,tooltipTitle:li().text("Export"),showForDisabled:!0,classes:{disabled:t.exportButtonDisabled},className:t.button,disabled:l,"data-reltio-id":"reltio-search-actions-menu-export"}),v().createElement(Ed.k,{tooltipTitle:li().text("Save"),showForDisabled:!0,className:O()({[t.button]:f.length>0}),disabled:!d,onClick:m,icon:hV,size:"L","data-reltio-id":"reltio-search-actions-menu-save"}),o&&v().createElement(mV,null),f.length>0&&v().createElement(EN,{buttonComponent:Cp.T,buttonProps:{icon:TV,size:"L","data-reltio-id":"reltio-search-actions-menu"},menuId:"custom-actions",menuItems:f}),v().createElement(sV,null),v().createElement(NV,{open:h,onClose:()=>E(!1)}))},kV="#FF1744",LV=(0,wp.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,mp.useSelector)(ho.LA),t=(0,mp.useSelector)(ho.WH),r=(0,b.useContext)(WM._),n=LV();if(!e)return null;const a=e.name,i=r?li().text("Segment has changed"):li().text("Saved search has changed");return v().createElement(v().Fragment,null,v().createElement("div",{className:n.wrapper},v().createElement(bf(),{variant:"body2",component:"span",classes:{root:n.for}},li().text("for")),v().createElement(od.Y,{value:a},v().createElement(bf(),{variant:"body2",classes:{root:n.label}},a))),t&&v().createElement(rg(),{title:i,placement:"bottom"},v().createElement("div",{className:n.indicatorWrapper,"data-reltio-id":"changed-indicator"},v().createElement("div",{className:n.indicator}),v().createElement("div",{className:n.indicatorTooltipArea}))))},jV=(0,wp.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,mp.useSelector)(k().selectors.getDataTenants),r=t&&t.length>0,n=(0,mp.useSelector)(ai.t9),a=(0,mp.useSelector)(k().selectors.getTenantName),i=n?n.label:a;return r&&v().createElement("div",{className:e.wrapper},v().createElement(bf(),{variant:"body2",component:"span",classes:{root:e.in}},li().text("in")),v().createElement(od.Y,{value:a},v().createElement(bf(),{variant:"body2",classes:{root:e.label}},i)))};var MV=r(81877),VV=r.n(MV);const BV=(0,wp.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,wp.Z)((e=>({container:{display:"flex",alignItems:"center",paddingTop:17,paddingBottom:11,paddingLeft:15,paddingRight:15},selected:{backgroundColor:(0,wm.alpha)(e.palette.primary.main,.12)}}))),HV=(0,wp.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,wp.Z)({closeButton:{marginRight:"10px"}}),WV=({onClose:e})=>{const t=YV();return v().createElement(Cp.T,{size:"L",icon:Tp(),className:t.closeButton,onClick:e})};WV.propTypes={onClose:dp().func};const GV=WV,qV=({selectedNumber:e,onDelete:t,onClose:r})=>{const n=HV();return v().createElement(v().Fragment,null,v().createElement("div",{className:O()(n.title,n.flex1)},v().createElement(GV,{onClose:r}),v().createElement(bf(),{color:"primary"},li().text("Selected: ${count}",{count:e}))),v().createElement(Ed.k,{tooltipTitle:li().text("Delete"),size:"L",icon:Fk(),className:n.deleteButton,onClick:t}))};qV.propTypes={selectedNumber:dp().number,onClose:dp().func,onDelete:dp().func};const ZV=qV,$V=(0,wp.Z)((()=>({white:{backgroundColor:"rgb(255, 255, 255)",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.24)"}})));function KV(){return KV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},KV.apply(null,arguments)}function XV(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){QV(e,t,r[t])}))}return e}function QV(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const JV=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["classes"]);const n=$V({});return v().createElement(Np,KV({classes:XV({},t,{focused:n.white})},r))};var eB=r(34480),tB=r.n(eB);const rB=(0,wp.Z)((e=>({changedFiltersIndicator:{backgroundColor:(0,wm.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"}}))),nB=e=>e?Z.ib.public:Z.ib.private,aB=e=>e===Z.ib.public,iB=({className:e,findPublic:t,favoriteOnly:r,onChangeFilters:n})=>{const a=rB(),i=(0,b.useRef)(),[o,l]=(0,b.useState)(!1),[s,c]=(0,b.useState)(t),[u,p]=(0,b.useState)(r);(0,b.useEffect)((()=>{c(t),p(r)}),[t,r]);const d=(0,b.useCallback)((()=>l((e=>!e))),[]),m=(0,b.useCallback)((e=>p(e.target.checked)),[]),f=(0,b.useCallback)((()=>{n({findPublic:s,favoriteOnly:u}),d()}),[d,n,s,u]),y=(0,b.useCallback)((()=>{c(t),p(r),d()}),[d,t,r]),g=(0,b.useCallback)((()=>{c(!0),p(!1)}),[]),h=!0===s&&!1===u;return v().createElement(v().Fragment,null,v().createElement(Wh(),{ref:i,color:h?"inherit":"primary",classes:{root:e,textPrimary:a.changedFiltersIndicator},onClick:d},v().createElement(tB(),null)),v().createElement(yp(),{open:o,classes:{paper:a.popupContent},anchorEl:i.current,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},v().createElement(bf(),{className:a.title,variant:"h6"},li().text("Filter")),v().createElement(rV.k,{entries:Z.m2,TextFieldProps:{InputLabelProps:{classes:{root:a.shareWithLabel}},label:li().text("Shared with"),variant:"filled"},classes:{root:a.shareWithRoot,menuItem:a.shareWithMenuItem},fullWidth:!0,value:nB(s),onChange:(0,_.pipe)(aB,c)}),v().createElement(bh(),{classes:{root:a.favoriteOnlyControlRoot,label:a.favoriteOnlyControlLabel},control:v().createElement(Wp(),{className:a.favoriteOnlyCheckbox,checked:u,onChange:m}),label:li().text("Show favorites only")}),v().createElement("div",{className:a.buttonsGroup},v().createElement(Wh(),{onClick:g,disabled:h},li().text("Clear all")),v().createElement("div",null,v().createElement(Wh(),{onClick:y,className:a.cancelButton},li().text("Cancel")),v().createElement(Wh(),{onClick:f,color:"primary"},li().text("Apply"))))))};iB.propTypes={className:dp().string,findPublic:dp().bool,favoriteOnly:dp().bool,onChangeFilters:dp().func,onChangeFavoriteOnly:dp().func};const oB=(0,mp.connect)((e=>({findPublic:(0,ho.kU)(e),favoriteOnly:(0,ho.VS)(e)})),{onChangeFilters:({findPublic:e,favoriteOnly:t})=>({type:pr,payload:{findPublic:e,favoriteOnly:t}})})(iB),lB=({type:e,onSearch:t,placeholder:r,onClose:n})=>{const a=HV();return v().createElement(v().Fragment,null,v().createElement("div",{className:a.main},v().createElement("div",{className:a.title},v().createElement(GV,{onClose:n}),v().createElement(bf(),{variant:"h6"},li().text("Saved & recent searches"))),v().createElement("div",{className:a.searchBox},v().createElement(JV,{fullWidth:!0,onSearch:t,placeholder:r}))),e===Z.uJ.saved&&v().createElement(oB,{className:a.filterButton}))};lB.propTypes={type:dp().oneOf(Object.values(Z.uJ)),onClose:dp().func,onSearch:dp().func,placeholder:dp().string};const sB=lB,cB=({type:e,selectedNumber:t,onClose:r,dispatch:n})=>{const a=zV(),i=(0,b.useCallback)((()=>{const t=e===Z.uJ.saved?{type:Sr}:{type:Mr};n(t)}),[e,n]),o=(0,b.useCallback)((0,S.debounce)((t=>{const r=e===Z.uJ.saved?{type:Ar,payload:t}:{type:Hr,payload:t};n(r)}),500),[e,n]),l=(0,_.cond)([[(0,_.equals)(Z.uJ.saved),(0,_.always)(li().text("Search name"))],[(0,_.equals)(Z.uJ.recent),(0,_.always)(li().text("Search for filtered entity types and attributes"))]])(e);return v().createElement(QM(),{className:O()(a.container,{[a.selected]:t})},t?v().createElement(ZV,{selectedNumber:t,onDelete:i,onClose:r}):v().createElement(sB,{type:e,onSearch:o,onClose:r,placeholder:l}))};cB.propTypes={type:dp().oneOf(Object.values(Z.uJ)).isRequired,selectedNumber:dp().number,onClose:dp().func,dispatch:dp().func};const uB=(0,mp.connect)(((e,t)=>({selectedNumber:t.type===Z.uJ.saved?(0,ho.g2)(e):Ns(e)})))(cB),pB="0.75rem",dB=(0,wp.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:pB},paginationCaption:{fontSize:pB}});var mB=r(54622);const fB=dp().shape({field:dp().string,order:dp().oneOf(["asc","desc"])}),yB=dp().shape({label:dp().string,name:dp().string,description:dp().string,type:dp().string,hidden:dp().bool,faceted:dp().bool,searchable:dp().bool,uri:dp().string,access:dp().arrayOf(dp().string),cardinality:dp().shape({minValue:dp().number,maxValue:dp().number})}),gB=dp().shape({title:dp().string,pathToTitle:dp().arrayOf(dp().string),fieldName:dp().string,entityTypeUri:dp().string,attrType:yB,uri:dp().string,groupName:dp().string}),hB=dp().shape({id:dp().oneOfType([dp().number,dp().string]),values:dp().array,data:gB,filter:dp().string,operator:dp().string}),EB="0.8rem",bB=(0,wp.Z)((e=>{const t=(0,wm.lighten)(e.palette.primary.main,.88),r=(0,wm.alpha)(t,0),n=(0,wm.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,wm.alpha)(n,0)}, ${n} 100%)`}};return{defaultWrapper:{whiteSpace:"nowrap",overflow:"hidden",padding:"0 22px",fontSize:EB,display:"flex",alignItems:"center",height:"100%","&:after":a},numberWrapper:{whiteSpace:"nowrap",overflow:"hidden",padding:"0 24px 0 22px",fontSize:EB,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:EB,"&::-ms-clear":{display:"none"}},nameContainer:{flex:1,overflow:"hidden"},editing:{},editNameButton:{},searchName:{cursor:"pointer",lineHeight:"29px",position:"relative",whiteSpace:"nowrap",overflow:"hidden",fontSize:EB,"&: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:EB},sharingMenuItem:{fontSize:EB,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"}}})),vB=({mode:e})=>{const t=bB(),r=(0,mp.useDispatch)(),n=e===Z.uJ.saved?ho.tc:Ps,a=(0,mp.useSelector)(n),i=e===Z.uJ.saved?ho.hY:Ds,o=(0,mp.useSelector)(i),l=(0,b.useCallback)((()=>{e===Z.uJ.saved?r(o?mo():{type:mr}):r(o?bs():{type:jr})}),[r,o,e]);return v().createElement("div",{className:O()(t.headCell,t.checkbox)},v().createElement(Wp(),{indeterminate:!a&&o,checked:a,onChange:l}))};vB.propTypes={mode:dp().string};const TB=(0,Dd.q)((0,_.pick)(["mode"]))(vB),OB=e=>{const t=t=>{const r=bB(),{rowValue:{checked:n}}=t;return v().createElement("div",{className:O()(r.rowCell,{[r.checkedRowCell]:n})},v().createElement(e,t))};return t.propTypes={rowValue:dp().shape({checked:dp().bool})},t},SB=(0,ld.T)(Wp()),xB=({value:e=!1,rowValue:{uri:t,isOwnSearch:r},onClick:n})=>{const a=bB(),i=!r;return v().createElement("div",{className:O()(a.headCell,a.checkbox)},v().createElement(SB,{showForDisabled:!0,tooltipTitle:i&&li().text("Cannot edit because you're not the owner"),tooltipPlacement:"bottom-start",disabled:i,checked:e,onChange:e=>n(t,e.target.checked)}))};xB.propTypes={value:dp().bool,rowValue:dp().shape({uri:dp().string,isOwnSearch:dp().bool}),onClick:dp().func};const CB=(0,Dd.q)((({onSelectItem:e})=>({onClick:e})))(OB(xB));var wB=r(92332);function AB(){return AB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},AB.apply(null,arguments)}function RB(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){_B(e,t,r[t])}))}return e}function _B(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const IB=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className"]);const n=bB(),{headCellData:a}=r;return v().createElement("div",{className:O()(n.headCell,t)},v().createElement(wB.default,AB({},r,{headCellData:RB({},a,{label:v().createElement(od.Y,{value:a.label},v().createElement("div",{className:n.headLabel},a.label))})})))};IB.propTypes={className:dp().string,headCellData:dp().shape({id:dp().string,label:dp().oneOfType([dp().string,dp().node]),sortable:dp().bool,resizable:dp().bool,className:dp().string,initialWidth:dp().number,minWidth:dp().number,autoResize:dp().bool,renderer:dp().func})};const NB=IB;function PB(){return PB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},PB.apply(null,arguments)}const DB=e=>{const t=bB();return v().createElement(NB,PB({className:t.nameHeadCell},e))};DB.propTypes={headCellData:dp().shape({id:dp().string,label:dp().oneOfType([dp().string,dp().node]),sortable:dp().bool,resizable:dp().bool,className:dp().string,initialWidth:dp().number,minWidth:dp().number,autoResize:dp().bool,renderer:dp().func})};const kB=DB;var LB=r(18122),UB=r.n(LB),jB=r(62839),FB=r.n(jB);function MB(){return MB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},MB.apply(null,arguments)}const VB=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",MB({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),v().createElement("g",null,v().createElement("path",{d:"M0 0h24m0 24H0",fill:"none"}),v().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"}),v().createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"})))};function BB(){return BB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},BB.apply(null,arguments)}const zB=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",BB({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),v().createElement("g",null,v().createElement("path",{d:"M0 0h24m0 24H0",fill:"none"}),v().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"}),v().createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"})))};var HB=r(74492),YB=r.n(HB),WB=r(72246),GB=r.n(WB);const qB=({value:e,rowValue:{uri:t,isFavorite:r,isOwnSearch:n,isEditing:a,isGlobalFilter:i},onStarClick:o,onGlobalClick:l,onApply:s,onChangeName:c,onSetEditing:u})=>{const p=bB(),d=n&&!a,[m,f]=(0,b.useState)(e);(0,b.useEffect)((()=>{f(e)}),[e]);const y=(0,b.useCallback)((()=>{c(t,m)}),[t,m,c]),g=(0,b.useCallback)((()=>o(t,!r)),[o,t,r]),h=(0,b.useCallback)((()=>l(t,!i)),[l,t,i]),E=(0,b.useCallback)((()=>u(t,!0)),[u,t]),T=(0,b.useCallback)((()=>s(t)),[s,t]),S=(0,_.cond)([[(0,_.always)(n),(0,_.always)(li().text("Mark as favorite"))],[(0,_.always)(r),(0,_.always)(li().text("Cannot ummark because you're not the owner"))],[_.T,(0,_.always)("")]])();return v().createElement("div",{className:O()(p.nameWithStar,{[p.editing]:a})},v().createElement(Ed.k,{showForDisabled:!0,tooltipTitle:S,tooltipPlacement:n?"bottom":"bottom-start",disabled:!n,className:O()(p.starButton,{[p.checkedStarButton]:r},{[p.enabledButton]:n}),size:"M",icon:r?UB():FB(),onClick:g}),v().createElement(Ed.k,{tooltipTitle:i?li().text("Remove Global filter"):li().text("Set as Global filter"),className:O()(p.filterButton,p.enabledButton,{[p.checkedFilterButton]:i}),size:"M",icon:i?VB:zB,onClick:h}),v().createElement("div",{className:p.nameContainer},a?v().createElement(GB(),{onClickAway:y},v().createElement("div",null,v().createElement(JM.H,{variant:"filled",hiddenLabel:!0,size:"small",fullWidth:!0,autoFocus:!0,classes:{root:p.nameTextEditorRoot},InputProps:{classes:{input:p.nameInput}},value:m,onInput:e=>f(e.target.value),onKeyDown:(0,_.when)((0,_.propEq)("keyCode",13),y)}))):v().createElement(od.Y,{value:e},v().createElement("div",{className:p.searchName,onClick:T},e))),d&&v().createElement(Ed.k,{tooltipTitle:li().text("Edit"),className:p.editNameButton,size:"M",icon:YB(),onClick:E}))};qB.propTypes={value:dp().string,rowValue:dp().shape({uri:dp().string,isFavorite:dp().bool,isOwnSearch:dp().bool,isEditing:dp().bool,isGlobalFilter:dp().bool}),onStarClick:dp().func,onGlobalClick:dp().func,onApply:dp().func,onChangeName:dp().func,onSetEditing:dp().func};const ZB=(0,Dd.q)((({onChangeIsFavorite:e,onChangeIsGlobal:t,onSearchApply:r,onSetItemEditing:n,onChangeItemName:a})=>({onStarClick:e,onGlobalClick:t,onApply:r,onSetEditing:n,onChangeName:a})))(OB(qB)),$B=({value:e,rowValue:{uri:t,isOwnSearch:r},onChange:n})=>{const a=bB(),i=(0,b.useCallback)((r=>{const a=aB(r);a!==e&&n(t,a)}),[t,e,n]);return v().createElement("div",{className:a.sharingWrapper},v().createElement(rV.k,{entries:Z.m2,value:nB(e),onChange:i,disableUnderline:!0,disabled:!r,MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},elevation:3},TextFieldProps:{classes:{root:a.sharingRoot}},classes:{root:a.sharingInput,menuItem:a.sharingMenuItem,disabled:a.sharingDisabled,icon:O()({[a.sharingIconDisabled]:!r})}}))};$B.propTypes={value:dp().bool,rowValue:dp().shape({uri:dp().string,isOwnSearch:dp().bool}),onChange:dp().func};const KB=(0,Dd.q)((({onChangeIsPublic:e})=>({onChange:e})))(OB($B)),XB=({value:e,rowValue:t,onClick:r})=>{const n=bB(),a=r?()=>r(t):()=>{};return v().createElement(od.Y,{value:e},v().createElement("div",{className:O()(n.defaultWrapper,{[n.clickableArea]:r}),onClick:a},e))};XB.propTypes={value:dp().any,rowValue:dp().object,onClick:dp().func};const QB=OB(XB);function JB(){return JB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},JB.apply(null,arguments)}const ez=e=>{const{rowValue:{updateDate:t,createDate:r}}=e,n=t||r;return v().createElement(QB,JB({},e,{value:n&&li().date(n,"L")}))};ez.propTypes={rowValue:dp().shape({updateDate:dp().number,createDate:dp().number})};const tz=ez,rz=({values:e})=>(0,_.pipe)((0,_.cond)([[_.isNil,_.T],[Array.isArray,(0,_.pipe)(_.flatten,_.isEmpty)],[_.T,_.isEmpty]]),_.not)(e),nz=(0,_.curry)(((e,t)=>(0,_.path)(["facetsData",t.fieldName,"values","length"],e)>0)),az=e=>e&&e.slice(1).join(" / "),iz=(e,t,r)=>(e[t]||(e[t]={title:t,attributes:[]}),e[t].attributes=(0,_.uniq)(e[t].attributes.concat(r)),e),oz=({rowValue:{uiState:e}})=>{const t=bB(),r=(0,b.useMemo)((()=>(({facets:e,advanced:t}={})=>{try{const r=t?((e=[])=>e.flatMap((e=>e.attributes)).filter(rz).reduce(((e,{data:{title:t,groupName:r,pathToTitle:n}})=>{const a=az(n)||t;return iz(e,r,a)}),{}))(t):((e={})=>(e.facetsConfigs||[]).filter((0,_.pipe)(S.isTypeFacet,_.not)).filter(nz(e)).reduce(((e,t)=>{const r=(0,_.path)(["pathToTitle",0],t)||li().text("Special"),n=az(t.pathToTitle)||t.title;return iz(e,r,n)}),{}))(e);return Object.values(r)}catch(e){return[]}})(e)),[e]),n=(0,b.useMemo)((()=>(e=>e.flatMap((e=>e.attributes)).length)(r)),[r]),a=!!r.length&&v().createElement("div",null,r.map((({title:e,attributes:r})=>v().createElement("div",{key:e,className:t.tooltipSection},v().createElement("h6",{className:t.tooltipSectionHeader},e),r.map((e=>v().createElement("div",{key:e,className:t.tooltipText},e)))))));return v().createElement("div",{className:t.numberWrapper},(i=n,a?v().createElement(rg(),{title:a,classes:{tooltip:t.tooltip},disableFocusListener:!0,disableTouchListener:!0},v().createElement("span",null,i)):i));var i};oz.propTypes={rowValue:dp().shape({uiState:dp().shape({facets:dp().object,advanced:dp().array})})};const lz=OB(oz);function sz(){return sz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sz.apply(null,arguments)}const cz=e=>{const t=bB();return v().createElement(NB,sz({className:t.totalHeadCell},e))};cz.propTypes={headCellData:dp().shape({id:dp().string,label:dp().oneOfType([dp().string,dp().node]),sortable:dp().bool,resizable:dp().bool,className:dp().string,initialWidth:dp().number,minWidth:dp().number,autoResize:dp().bool,renderer:dp().func})};const uz=cz;var pz=r(67520),dz=r.n(pz);const mz=({value:e})=>{const t=bB();return v().createElement(od.Y,{value:e},v().createElement("div",{className:t.numberWrapper},li().number(e)))};mz.propTypes={value:dp().number};const fz=OB(mz),yz=e=>{const t=bB(),{rowValue:{isTotalLoading:r,isOwnSearch:n,uri:a},onDeleteItem:i,onLoadTotalForItem:o,value:l}=e,s=(0,b.useCallback)((()=>{i(a)}),[i,a]),c=n?li().text("Delete"):li().text("Cannot delete because you're not the owner"),u=r?li().text("Loading data"):li().text("Load data"),p=(0,b.useCallback)((()=>{o(a)}),[o,a]),d=r||-1===l;return v().createElement("div",{className:t.totalWithButtonsWrapper},d?v().createElement(Ed.k,{showForDisabled:!0,tooltipTitle:u,tooltipPlacement:"bottom-end",disabled:r,size:"L",icon:dz(),onClick:p}):v().createElement(fz,e),v().createElement(Ed.k,{showForDisabled:!0,className:t.deleteButton,tooltipTitle:c,tooltipPlacement:"bottom-end",disabled:!n,size:"L",icon:Fk(),onClick:s}))};yz.propTypes={value:dp().number,rowIndex:dp().number,rowValue:dp().shape({isOwnSearch:dp().bool,isTotalLoading:dp().bool,uri:dp().string}),onDeleteItem:dp().func,onLoadTotalForItem:dp().func};const gz=(0,Dd.q)((({onDeleteItem:e,onLoadTotalForItem:t})=>({onDeleteItem:e,onLoadTotalForItem:t})))(OB(yz));function hz(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ez={rowCellValueRenderer:QB,headCellRenderer:NB,autoResize:!1},bz=[{id:"checked",label:"",initialWidth:55,headCellRenderer:TB,rowCellValueRenderer:CB},{id:"name",get label(){return li().text("Name")},autoResize:!0,headCellRenderer:kB,rowCellValueRenderer:ZB,sortable:!0},{id:"isPublic",get label(){return li().text("Shared with")},rowCellValueRenderer:KB},{id:"owner",get label(){return li().text("Created by")},initialWidth:260},{id:"updateDate",get label(){return li().text("Last modified")},rowCellValueRenderer:tz,sortable:!0},{id:"attributes",get label(){return li().text("Filtered attributes")},rowCellValueRenderer:lz},{id:"total",get label(){return li().text("Number of profiles")},headCellRenderer:uz,rowCellValueRenderer:gz,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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){hz(e,t,r[t])}))}return e}({},Ez,e)));function vz(){return vz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vz.apply(null,arguments)}function Tz(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Oz=({items:e,total:t,sorting:r,page:n,rowsPerPage:a,loading:i,searchValue:o,globalFilterSavedSearchesUris:l=[],onSearchApply:s,onChangeIsFavorite:c,onChangeIsPublic:u,onChangeIsGlobal:p,onChangeRowsPerPage:d,onChangePage:m,onSelectItem:f,onDeselectAllItems:y,onDeleteItem:g,onChangeItemName:h,onSetItemEditing:E,onLoadTotalForItem:T,onSort:O})=>{const x=dB(),C=(0,b.useMemo)((()=>({cellBorder:x.cellBorder})),[x]),[w,A]=(0,b.useState)(null),[R,_]=(0,b.useState)(null),I=(0,b.useRef)(null);(0,b.useEffect)((()=>y),[y]);const N=(0,b.useCallback)((e=>{l.includes(e)?_(e):g(e)}),[l,g]),P=(0,b.useMemo)((()=>({mode:Z.uJ.saved,onSelectItem:f,onChangeIsFavorite:c,onChangeIsGlobal:p,onSearchApply:s,onSetItemEditing:E,onChangeItemName:h,onDeleteItem:N,onLoadTotalForItem:T,onChangeIsPublic:u})),[N,f,c,p,T,s,E,h,u]),D=(0,b.useMemo)((()=>(0,S.isEmptyValue)(o)?{LogoRenderer:SE.SELECT_ATTRIBUTES,text:li().text("No saved searches."),secondaryText:li().text("Save time by creating saved searches for queries you regularly search for.")}:{LogoRenderer:SE.SEARCH_RESULTS,text:li().text("No results found."),secondaryText:li().text("Try adjusting your search or filter to find what you're looking for.")}),[o]),k=(0,b.useMemo)((()=>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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Tz(e,t,r[t])}))}return e}({},e,{isGlobalFilter:l.includes(e.uri)})))),[e,l]);return v().createElement("div",{className:x.tableWrapper},t>0?v().createElement(v().Fragment,null,v().createElement(Rd.M,{columnsData:bz,rowsData:k,context:P,sorting:r,getRowCellHeight:null,defaultColumnWidth:140,defaultColumnMinWidth:140,defaultRowHeight:48,headRowHeight:47,hoverStateEnabled:!0,onSort:O,hoverRowIndex:w,onRowHover:A,classes:C,ref:I}),v().createElement(yE.Z,{classes:{root:x.paginationRoot,caption:x.paginationCaption},count:t,rowsPerPageOptions:Z.Tu,rowsPerPage:a,onChangeRowsPerPage:d,page:n,onChangePage:m,basicTableRef:I}),v().createElement(mB.U,{open:!!R,title:li().text("Keep the global filter?"),content:li().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:li().text("NO, remove it"),saveCaption:li().text("YES, KEEP GLOBAL FILTER"),onCancel:()=>_(null),onDiscard:()=>{p(R,!1),g(R),_(null)},onSave:()=>{g(R),_(null)}})):v().createElement(xE,vz({},D,{variant:OE.embedded})),i&&v().createElement(CE.z,null))};Oz.propTypes={items:dp().arrayOf(dp().shape({uri:dp().string,name:dp().string,isPublic:dp().bool,isFavorite:dp().bool,isOwnSearch:dp().bool,isEditing:dp().bool,checked:dp().bool,owner:dp().string,updateDate:dp().number,query:dp().string})),total:dp().number,sorting:fB,page:dp().number,rowsPerPage:dp().number,loading:dp().bool,searchValue:dp().string,globalFilterSavedSearchesUris:dp().arrayOf(dp().string),onSearchApply:dp().func,onChangeIsFavorite:dp().func,onChangeIsPublic:dp().func,onChangeIsGlobal:dp().func,onChangeRowsPerPage:dp().func,onChangePage:dp().func,onSelectItem:dp().func,onDeselectAllItems:dp().func,onDeleteItem:dp().func,onChangeItemName:dp().func,onSetItemEditing:dp().func,onSort:dp().func};const Sz=(0,mp.connect)((e=>({items:(0,ho.gg)(e),total:(0,ho.Yi)(e),sorting:(0,ho.rT)(e),page:(0,ho.wH)(e),rowsPerPage:(0,ho.s6)(e),loading:(0,ho.w7)(e),searchValue:(0,ho.U3)(e),globalFilterSavedSearchesUris:k().selectors.getGlobalFilterSavedSearchesUris(e)})),{onSearchApply:(e,t=Z.XU)=>({type:Rr,payload:{uri:e,debounceTime:t}}),onChangeIsFavorite:(e,t)=>({type:hr,payload:{uri:e,isFavorite:t}}),onChangeIsPublic:(e,t)=>({type:yr,payload:{uri:e,isPublic:t}}),onChangeIsGlobal:(e,t)=>({type:br,payload:{uri:e,isGlobalFilter:t}}),onChangeRowsPerPage:e=>({type:ur,payload:e}),onChangePage:e=>({type:cr,payload:e}),onSelectItem:(e,t)=>({type:dr,payload:{uri:e,checked:t}}),onDeselectAllItems:mo,onDeleteItem:e=>({type:xr,payload:e}),onChangeItemName:(e,t)=>({type:vr,payload:{uri:e,name:t}}),onSetItemEditing:(e,t)=>({type:Or,payload:{uri:e,isEditing:t}}),onLoadTotalForItem:e=>({type:Ir,payload:e}),onSort:e=>({type:Nr,payload:e})})(Oz),xz=({value:e=!1,rowValue:{createdDate:t},onClick:r})=>{const n=bB();return v().createElement("div",{className:O()(n.headCell,n.checkbox)},v().createElement(Wp(),{checked:e,onChange:e=>r(t,e.target.checked)}))};xz.propTypes={value:dp().bool,rowValue:dp().shape({createdDate:dp().number}),onClick:dp().func};const Cz=(0,Dd.q)((({onSelectItem:e})=>({onClick:e})))(OB(xz));function wz(){return wz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wz.apply(null,arguments)}const Az=e=>{const{rowValue:{createdDate:t}}=e,r=t;return v().createElement(QB,wz({},e,{value:r&&li().date(r,"L LT")}))};Az.propTypes={rowValue:dp().shape({createdDate:dp().number}),onClick:dp().func};const Rz=(0,Dd.q)((({onSearchApply:e})=>({onClick:e})))(Az),_z=e=>{const t=bB(),{rowValue:r,onDeleteItem:n,onLoadTotalForItem:a,value:i}=e,{isTotalLoading:o,createdDate:l}=r,s=(0,b.useCallback)((()=>{n(r)}),[n,r]),c=o?li().text("Loading data"):li().text("Load data"),u=(0,b.useCallback)((()=>{a(l)}),[a,l]),p=o||-1===i;return v().createElement("div",{className:t.totalWithButtonsWrapper},p?v().createElement(Ed.k,{showForDisabled:!0,tooltipTitle:c,tooltipPlacement:"bottom-end",disabled:o,size:"L",icon:dz(),onClick:u}):v().createElement(fz,e),v().createElement(Ed.k,{className:t.deleteButton,tooltipTitle:li().text("Delete"),tooltipPlacement:"bottom-end",size:"L",icon:Fk(),onClick:s}))};_z.propTypes={value:dp().number,rowValue:dp().shape({isTotalLoading:dp().bool,createdDate:dp().number}),onDeleteItem:dp().func,onLoadTotalForItem:dp().func};const Iz=(0,Dd.q)((({onDeleteItem:e,onLoadTotalForItem:t})=>({onDeleteItem:e,onLoadTotalForItem:t})))(OB(_z)),Nz=(0,Dd.q)((({onSearchApply:e})=>({onClick:e})))(QB);function Pz(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Dz={rowCellValueRenderer:QB,headCellRenderer:NB,autoResize:!1},kz=[{id:"checked",label:"",initialWidth:55,headCellRenderer:TB,rowCellValueRenderer:Cz},{id:"createdDate",get label(){return li().text("Created")},rowCellValueRenderer:Rz,initialWidth:256},{id:"name",get label(){return li().text("Query")},autoResize:!0,rowCellValueRenderer:Nz,minWidth:150},{id:"total",get label(){return li().text("Record count")},rowCellValueRenderer:Iz,headCellRenderer:uz,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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Pz(e,t,r[t])}))}return e}({},Dz,e)));function Lz(){return Lz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Lz.apply(null,arguments)}const Uz=({items:e,loading:t,filterWord:r,onSelectItem:n,onDeselectAllItems:a,onSearchApply:i,onDeleteItem:o,onLoadTotalForItem:l})=>{const s=dB(),c=(0,b.useMemo)((()=>({cellBorder:s.cellBorder})),[s]),[u,p]=(0,b.useState)(null);(0,b.useEffect)((()=>a),[a]);const d=(0,b.useMemo)((()=>({mode:Z.uJ.recent,onSelectItem:n,onSearchApply:i,onDeleteItem:o,onLoadTotalForItem:l})),[o,l,n,i]),m=(0,b.useMemo)((()=>(0,S.isEmptyValue)(r)?{LogoRenderer:SE.SELECT_ATTRIBUTES,text:li().text("No recent searches."),secondaryText:li().text("Your recent search history will appear here.")}:{LogoRenderer:SE.SEARCH_RESULTS,text:li().text("No results found."),secondaryText:li().text("Try adjusting your search or filter to find what you're looking for.")}),[r]);return v().createElement("div",{className:s.tableWrapper},e.length>0?v().createElement(Rd.M,{columnsData:kz,rowsData:e,context:d,getRowCellHeight:null,defaultColumnWidth:50,defaultColumnMinWidth:50,defaultRowHeight:48,headRowHeight:47,hoverStateEnabled:!0,hoverRowIndex:u,onRowHover:p,classes:c}):v().createElement(xE,Lz({},m,{variant:OE.embedded})),t&&v().createElement(CE.z,null))};Uz.propTypes={items:dp().arrayOf(dp().shape({uri:dp().string,name:dp().string,isPublic:dp().bool,isFavorite:dp().bool,isOwnSearch:dp().bool,checked:dp().bool,owner:dp().string,createdDate:dp().number,query:dp().string})),loading:dp().bool,filterWord:dp().string,onSelectItem:dp().func,onSearchApply:dp().func,onDeselectAllItems:dp().func,onDeleteItem:dp().func};const jz=(0,mp.connect)((e=>({items:_s(e),loading:Is(e),filterWord:As(e)})),{onSearchApply:(e,t=Z.XU)=>({type:qr,payload:{search:e,debounceTime:t}}),onSelectItem:(e,t)=>({type:Ur,payload:{searchCreatedDate:e,checked:t}}),onDeselectAllItems:bs,onDeleteItem:e=>({type:Br,payload:e}),onLoadTotalForItem:e=>({type:Gr,payload:e})})(Uz),Fz=({open:e,onClose:t})=>{const r=BV(),n=(0,mp.useDispatch)(),a=(0,b.useMemo)((()=>[{value:Z.uJ.saved,label:li().text("Saved searches"),content:v().createElement(Sz,null),dataReltioId:"reltio-search-saved-searches"},{value:Z.uJ.recent,label:li().text("Recent searches"),content:v().createElement(jz,null),dataReltioId:"reltio-search-recent-searches"}]),[]),[i,o]=(0,b.useState)(a[0].value);return(0,b.useEffect)((()=>{e&&(i===Z.uJ.saved?n({type:ir}):n({type:Dr}))}),[e,n,i]),v().createElement(gj(),{classes:{paper:r.dialogPaper},fullWidth:!0,maxWidth:"lg",open:e,onClose:t},v().createElement(uB,{type:i,onClose:t}),v().createElement(eF(),{classes:{root:r.contentRoot}},v().createElement("div",{className:r.tabsWrapper},v().createElement(hI,{value:i,tabs:a,onChange:o,scrollButtons:"auto"})),v().createElement("div",{className:r.tabContent},a.find((0,_.propEq)("value",i)).content)))};Fz.propTypes={open:dp().bool,onClose:dp().func};const Mz=Fz,Vz=(0,wp.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"}}))),Bz=({showTypography:e})=>{const t=Vz(),r=(0,mp.useDispatch)(),n=(0,mp.useSelector)(Ri.tm),a=li().text("Saved & recent searches"),i=(0,b.useCallback)((()=>r(yi(!0))),[r]),o=(0,b.useCallback)((()=>r(yi(!1))),[r]);return v().createElement(v().Fragment,null,v().createElement(rg(),{title:e?"":a},v().createElement(Wh(),{className:t.button,variant:"outlined",startIcon:v().createElement(VV(),{className:O()({[t.compact]:!e}),color:"action"}),onClick:i,"data-reltio-id":"reltio-search-saved-and-recent-search"},e&&v().createElement(bf(),{variant:"button",color:"textPrimary",className:t.buttonText},a))),v().createElement(Mz,{open:n,onClose:o}))},zz=(0,wp.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"}}))),Hz="search",Yz="geoLocation",Wz={},Gz=()=>{const e=zz(),t=(0,mp.useDispatch)(),r=(0,mp.useSelector)(P.Mp),n=(0,mp.useSelector)(P.X0),a=(0,mp.useSelector)(ai.Qw)||Wz,i=(0,mp.useSelector)(k().selectors.getSearchKeyword),o=(0,mp.useSelector)(k().selectors.getDateMask),l=(0,mp.useSelector)(k().selectors.getDateTimeMask),s=(0,mp.useSelector)(k().selectors.getAttributesPresentation)||Wz,c=(0,mp.useSelector)(Ri.IJ),u=(0,mp.useSelector)((e=>(0,ai.NU)(e,{entityTypeUri:void 0}))),p=(0,mp.useSelector)(Ki.go),d=(0,b.useContext)(WM._),[m,f]=(0,b.useState)([]),[y,g]=(0,b.useState)(0),[h,E]=(0,b.useState)(!1),T=(0,b.useRef)(null),[O,x]=(0,b.useState)(!0);(0,b.useEffect)((()=>{f(C())}),[r,n,a,i]),(0,b.useEffect)((()=>{g(m.length),E(!0)}),[m]),(0,b.useEffect)((()=>{if(h){const e=R();g(e),E(!1)}}),[h,n]);const C=(0,b.useCallback)((()=>{const e=Object.values((0,ja.t8)(n,r)).filter((e=>e.values&&e.values.length)).map((e=>{const t=e.title||e.hiddenTitle,r=(0,ja.MI)([...e.data||[],...e.filteredData||[]],(0,_.path)(["attrType","type"],e)===S.DataTypes.TYPE_DATE?e.values.map((e=>e.map((e=>S.utils.dates.toLocalDate(e).getTime())))):e.values.map((0,S.mapFilterValue)((0,S.applyPresentationStrategyToValue)((e=>(0,S.getNumberFormat)((0,S.getAttrDataTypeDefinition)(e.attrType),s,S.intl.getLocale()).strategy)(e)))),e.type,{dateMask:o,dateTimeMask:l});return{fieldName:e.fieldName,title:t,values:r}}));i&&e.push({fieldName:Hz,title:li().text("Search"),values:[i.value]});const{values:[t]=[],type:c}=(0,_.pathOr)({},["mapSearch"],a);return t&&e.push({fieldName:Yz,values:(0,S.getMapSearchValues)(c,t),title:(0,S.getMapSearchLabel)(c)}),e}),[r,n,a,i,s,o,l]),w=(0,b.useCallback)((()=>{g(m.length),E(!0)}),[m]),A=(0,b.useCallback)((e=>{x(e>=410)}),[]),R=(0,b.useCallback)((()=>{if(!T.current)return 0;const{firstChild:e,offsetLeft:t,offsetWidth:r}=T.current,n=t+r;return([...e.childNodes]||[]).filter((a=n,e=>e.offsetLeft+e.offsetWidth<=a)).length;var a}),[T]),I=(0,b.useCallback)((e=>r=>{switch(r.stopPropagation(),e){case Hz:t(D.search.actions.keywordUpdated(null));break;case Yz:t(Ka(null));break;default:t(Ja(e,[]))}}),[t]),N=(0,b.useCallback)((()=>{t(Ga({silent:!0})),t(D.search.actions.keywordUpdated({debounceTime:Z.XU}))}),[t]),L=(0,b.useMemo)((()=>m.map((e=>v().createElement(ZM,{key:e.fieldName,title:e.title,values:e.values,onDelete:I(e.fieldName)})))),[m,I]),U=L.slice(0,y),j=L.slice(y),F=(0,_.when)((0,_.propEq)("length",1),(0,_.reject)(S.isEmptySearchGroup))(p),M=0===L.length&&0===F.length;return v().createElement("div",{className:e.container,"data-reltio-id":"search-bar"},v().createElement("div",{className:e.header},v().createElement("div",{className:e.captionWrapper,"data-reltio-id":"search-bar-total-profiles"},v().createElement(bf(),{component:"span",classes:{body1:e.profileNumber}},li().number(u,"0,0")),v().createElement(bf(),{variant:"body2",component:"span",classes:{root:e.profileText}},li().text("total profiles"))),v().createElement(FV,null),v().createElement(UV,null),v().createElement(Wh(),{color:"primary",className:e.clearButton,onClick:N,disabled:M,"data-reltio-id":"reltio-search-clear"},li().text("clear")),!d&&v().createElement("div",{className:e.searchBarControls,"data-reltio-id":"search-bar-controls"},v().createElement(Fp.Z,{handleWidth:!0,onResize:A}),v().createElement(DV,null),v().createElement(Af(),{orientation:"vertical",className:e.splitter}),v().createElement(Bz,{showTypography:O}))),v().createElement(Fp.Z,{handleWidth:!0,onResize:w}),v().createElement(YM(),{in:!c&&y>0,timeout:500},v().createElement("div",{ref:T,className:e.facetsBar,"data-reltio-id":"search-facets-bar"},v().createElement("div",{className:e.showBar},U),j.length>0&&v().createElement(KM,{items:j}))))},qz=(0,wp.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"}}),Zz=({onBackBtnClick:e})=>{const t=qz();return v().createElement(aF(),{disableGutters:!0,classes:{root:t.toolBar}},v().createElement(Ed.k,{tooltipTitle:li().text("Switch to basic mode"),size:"L",icon:wI(),className:t.backButtonContainer,onClick:e}),v().createElement(bf(),{variant:"subtitle1",className:t.title},li().text("Advanced search")))};Zz.propTypes={onBackBtnClick:dp().func};const $z=Zz,Kz=(0,wp.Z)((e=>({query:{color:e.palette.text.secondary,fontSize:"12px",letterSpacing:0,lineHeight:"16px"},[S.READABLE_QUERY_PRIMITIVE_TYPES.entityTypeLabel]:{color:"#03904A"},[S.READABLE_QUERY_PRIMITIVE_TYPES.attributeLabel]:{color:"#059BEA"},[S.READABLE_QUERY_PRIMITIVE_TYPES.specialAttributeLabel]:{color:"#EA05CF"},[S.READABLE_QUERY_PRIMITIVE_TYPES.attributeFilter]:{color:"#7F00FF"},[S.READABLE_QUERY_PRIMITIVE_TYPES.attributeValue]:{color:"#000000"}})));function Xz(){return Xz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xz.apply(null,arguments)}const Qz=(0,b.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["readableQuery","className"]);const i=Kz();return v().createElement("span",Xz({ref:t,className:O()(i.query,n),"data-reltio-id":"search-readable-query"},a),r.map((({type:e,text:t},r)=>v().createElement("span",{key:r,className:i[e]},t))))}));Qz.displayName="ReadableSearchQuery";var Jz=r(82466),eH=r.n(Jz);const tH=(0,wp.Z)({collapseIcon:{transform:"rotate(0deg)",transition:"transform 0.35s ease"},"collapseIcon--inverted":{transform:"rotate(-180deg)"}});function rH(){return rH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rH.apply(null,arguments)}const nH=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["collapseBtnActive","onCollapseBtnClick"]);const a=tH();return v().createElement(Ed.k,rH({size:"L",icon:eH(),tooltipTitle:t?li().text("Collapse panel"):li().text("Expand panel"),onClick:r,iconClassName:O()(a.collapseIcon,{[a["collapseIcon--inverted"]]:!t}),"data-reltio-id":"reltio-search-advanced-search-collapse-panel"},n))};nH.propTypes={backBtnDisabled:dp().bool,onBackBtnClick:dp().func,collapseBtnActive:dp().bool,onCollapseBtnClick:dp().func};const aH=nH;var iH=r(89808),oH=r.n(iH),lH=r(19820),sH=r.n(lH);function cH(){return cH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cH.apply(null,arguments)}const uH=e=>{let{isFullscreen:t=!1,onClick:r=_.identity}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isFullscreen","onClick"]);return v().createElement(Ed.k,cH({size:"L",icon:t?sH():oH(),tooltipTitle:t?li().text("Exit full screen"):li().text("Full screen"),onClick:r,"data-reltio-id":"reltio-search-advanced-search-full-screen"},n))};uH.propTypes={isFullscreen:dp().bool,onClick:dp().func};const pH=uH,dH=(0,wp.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"}}),mH=({groups:e,hasMinSize:t,lookups:r,metadata:n,attributesPresentation:a,collapseBtnActive:i,isFullscreen:o,onCollapseBtnClick:l,onFullScreenBtnClick:s,keyword:c,map:u,dispatch:p})=>{const d=dH(),[m,f]=(0,b.useState)(0),[y,g]=(0,b.useState)(0),h=(0,b.useMemo)((()=>(0,Ua.Jk)((0,ft.P0)(n,e))),[n,e]),E=(0,S.buildReadableQuery)(n,a,r,e,c,u),T=li().text("Copy to clipboard"),[x,C]=(0,b.useState)(T),w=(0,b.useCallback)((0,S.debounce)((()=>{p({type:dt})}),500),[p]),A=(0,b.useCallback)((()=>{wV((0,S.buildReadableQueryToString)(n,a,r,e,c,u)).then((()=>C(li().text("Query was copied")))).catch((()=>C(li().text("Error"))))}),[e,a,r,n,c,u]),R=(0,b.useCallback)((()=>{C(T)}),[T]),_=(0,b.useCallback)((e=>{f(e.clientX),g(e.clientY)}),[]);(0,dE.D)(w,[w,h]);const I=(0,b.useMemo)((()=>({anchorEl:{clientWidth:1,clientHeight:1,getBoundingClientRect:()=>({left:m,bottom:y,height:1,right:m,width:1,top:y})}})),[m,y]);return v().createElement("div",{className:d.resultQueryPanel},v().createElement("div",{className:d.resultQuery},li().text("Search query"),v().createElement("div",{className:O()(d.queryContainer,{[d.queryContainerMinHeight]:t})},E.length>0?v().createElement(rg(),{key:x,title:x,onClose:R,PopperProps:I},v().createElement(Qz,{readableQuery:E,onMouseEnter:_,onClick:A,className:d.query})):v().createElement("span",{className:d.noQuery},li().text("Build your search and view your search query here")))),v().createElement("div",{className:d.actionsPanel},v().createElement(aH,{collapseBtnActive:i,onCollapseBtnClick:l,className:d.collapseButton}),v().createElement(pH,{isFullscreen:o,onClick:s})))};var fH=r(28345),yH=r.n(fH),gH=r(68157);const hH=(0,wp.Z)((e=>({readOnlyLogicOperatorContainer:{display:"flex",alignItems:"center",marginRight:"40px",width:"76px",fontSize:"14px",color:e.palette.text.secondary,maxHeight:"46px"}}))),EH=({className:e,rowData:t})=>{const r=hH();return v().createElement("div",{className:O()(r.readOnlyLogicOperatorContainer,e)},t&&t.operator?(0,gH.capitalize)(t.operator):li().text("Where"))},bH=(0,wp.Z)((e=>({readOnlyFilter:{display:"flex",alignItems:"center",fontSize:"14px",color:e.palette.text.secondary,width:"50px",marginLeft:"12px",maxHeight:"46px"}}))),vH=({className:e,rowData:t})=>{const r=bH();return v().createElement("div",{className:O()(r.readOnlyFilter,e)},t&&t.filter?(0,S.getFilterOptionLabel)(t.filter):li().text("equals"))},TH=(0,wp.Z)((()=>({row:{display:"flex",marginBottom:"12px"},rowItem:{paddingRight:"10px",display:"flex"},fullWidth:{flexGrow:"1",flexBasis:"0",overflow:"hidden"},hidden:{visibility:"hidden"}}))),OH=(0,b.memo)((e=>{let{classes:t={},rowData:r,previousRowData:n,LogicOperatorComponent:a=EH,AttributeSelectorComponent:i,FilterSelectorComponent:o=vH,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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["classes","rowData","previousRowData","LogicOperatorComponent","AttributeSelectorComponent","FilterSelectorComponent","ValuesEditorComponent","ActionsComponent","filterSelectorRef","attributeSelectorProps"]);const d=TH();return v().createElement("div",{className:O()(d.row,t.root),"data-reltio-id":"query-builder-row"},v().createElement(a,{className:t.logicOperatorContainer,rowContext:p,rowData:n}),v().createElement("div",{className:O()(d.rowItem,t.attributeSelectorContainer),"data-reltio-id":"query-builder-row-attribute-selector"},v().createElement(i,{attributeSelectorProps:u,rowContext:p,rowData:r})),v().createElement("div",{className:O()(d.rowItem,t.filterSelectorContainer),"data-reltio-id":"query-builder-row-filter-selector"},v().createElement(o,{textFieldInputRef:c,rowContext:p,rowData:r})),v().createElement("div",{className:O()(d.rowItem,d.fullWidth,t.valuesEditorContainer),"data-reltio-id":"query-builder-row-values-editor"},v().createElement(l,{rowContext:p,rowData:r})),v().createElement("div",{className:O()(d.rowItem,t.actionsContainer,{[d.hidden]:!r}),"data-reltio-id":"query-builder-row-actions"},v().createElement(s,{rowContext:p,rowData:r})))}));function SH(){return SH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},SH.apply(null,arguments)}const xH=(0,v().memo)((e=>{let{className:t,rowClasses:r,rowsData:n,lastRowAttributeSelectorProps:a,filterSelectorRef:i,filterSelectorRefIndex:o}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.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,_.path)([t-1],n):null,c=t===n.length?{attributeSelectorProps:a}:{};return v().createElement(OH,SH({key:e&&e.id,rowData:e,previousRowData:s,classes:r,filterSelectorRef:t===o?i:void 0},l,c))};return v().createElement("div",{"data-reltio-id":"reltio-query-builder-rows-group",className:t},n.map(s),s(null,n.length,n))})),CH=(0,wp.Z)((()=>({select:{padding:"6px 16px 7px"},dropDown:{width:"100px","&:before":{content:"none !important"}}}))),wH=({className:e,value:t,onChange:r})=>{const n=CH();return v().createElement(rV.k,{className:O()(n.dropDown,e),classes:n,value:t,entries:S.operatorOptions,onChange:r})},AH={position:"absolute",width:1,background:"rgba(43, 152, 240, 0.3)",height:16,left:36};function RH(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){_H(e,t,r[t])}))}return e}function _H(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const IH=(0,wp.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:RH({},AH),upperLine:{marginTop:-18},lowerLine:{marginBottom:-16,bottom:0}}))),NH="46px",PH=(0,wp.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:NH},filterSelect:{width:"190px"},valuesWrapper:{width:"100%",display:"flex",minHeight:NH,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:{}}))),DH=e=>e.join(", "),kH=e=>`calc(${(0,_.isNil)(e)?"100%":`${e}px`} - 35px)`,LH=(0,wp.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)"}}),UH=({list:e,maxWidth:t})=>{const r=LH(),n=(0,b.useRef)(),[a,i]=(0,b.useState)(0);(0,b.useEffect)((()=>{i(((e,t)=>{const r=e.length,n=((e,t)=>{if(t){const r=((e,t)=>{const{childNodes:r,clientLeft:n,clientWidth:a}=t;if(r.length>0){const[t]=Array.from(r),i=document.createRange();i.setStart(t,0);for(let r=0;r<e.length;r++){i.setEnd(t,i.endOffset+e[r].length);const{width:o}=i.getBoundingClientRect();if(n+o>a)return r;r!==e.length-1&&i.setEnd(t,i.endOffset+", ".length)}}return-1})(e,t);return-1===r?0:e.length-r}return 0})(e,t);return r-Math.max(1,r-n)})(e,n.current))}),[e]);const o=DH(e),l=a>0,s=l?DH(e.slice(0,-a)):o;return v().createElement(rg(),{title:l?o:""},v().createElement("div",{className:r.listLabelContainer},v().createElement("div",{style:{width:kH(t)},className:r.listLabel,ref:n},o),v().createElement("div",{className:r.visibleItemsLabel},s),l&&v().createElement("div",{className:r.hiddenCount},`+${a}`)))};function jH(){return jH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jH.apply(null,arguments)}const FH=(0,_.always)(32),MH=(0,b.memo)((e=>{let{selectedItems:t,onItemClick:r,focusIndex:n,width:a,height:i}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["selectedItems","onItemClick","focusIndex","width","height"]);return v().createElement(Vp,jH({getItemSize:FH,renderItem:(e,{item:a},i)=>{const o=!!t.find((e=>a.uri===e)),l=i===n;return v().createElement(pd,{key:a.uri,onClick:r,checked:o,data:a,label:v().createElement(dd.o,{text:a.label,highlight:a.filterText}),labelInText:a.label,style:e,isFocused:l,hideIcon:!0,LogoIcon:a.LogoIcon})},focusIndex:n,fixedTitle:!1,disableHorizontalScrollbar:!0,width:a,height:i},o))}));MH.displayName="SelectMetadataTypesList";const VH=(0,wp.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 BH(){return BH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},BH.apply(null,arguments)}function zH(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){HH(e,t,r[t])}))}return e}function HH(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const YH=(0,b.memo)((({placeholder:e,classes:t={},items:r,selectedItemsUris:n,onChange:a,ListLabelProps:i={},disabled:o,enableEmptyValueUnderline:l,single:s,label:c,dataReltioId:u,selectionPopupTitle:p})=>{const d=VH(),[m,f]=(0,b.useState)(!1),y=(0,b.useCallback)((()=>f(!0)),[]),g=(0,b.useCallback)((()=>f(!1)),[]),[h,E]=(0,b.useState)(""),T=(0,b.useCallback)((()=>E("")),[]),x=(0,b.useCallback)((0,_.pipe)(T,g),[g,T]),C=r.filter((({label:e})=>S.utils.strings.search(e,h))).map(((e,t)=>({item:{item:zH({},e,{filterText:h})},index:t}))),w=(0,b.useMemo)((()=>(0,_.pipe)((0,_.map)((e=>r.find((0,_.propEq)("uri",e)))),(0,_.reject)(_.isNil),(0,_.pluck)("label"))(n)),[n,r]),A=(0,b.useCallback)(((e,t)=>{s?(a(t?[e.uri]:[]),x()):a(t?n.concat(e.uri):n.filter((t=>t!==e.uri)))}),[n,a,s,x]),R=(0,b.useCallback)((({item:e})=>{const t=!n.includes(e.uri);A(e,t)}),[n,A]),{focusIndex:I,handleKeyDown:N}=Bp({items:C,open:m,onSelectFocusedItem:R,selectedItems:n,onClose:x}),P=(0,b.useRef)(),D=P.current?P.current.getBoundingClientRect().width:0,k=Math.max(D,255),L=0===n.length;return v().createElement(v().Fragment,null,v().createElement(CV(),{label:c,ref:P,InputProps:{startAdornment:L&&!e?null:v().createElement("div",{className:O()(d.inputText,t.inputText)},L?v().createElement("div",null,e):v().createElement(UH,BH({},i,{list:w}))),classes:{root:d.inputRoot,input:O()(d.input,t.input,{[d.emptyInput]:L&&!e}),disabled:O()(d.disabledInput,{[d.disabledPointer]:o}),underline:d.disabledUnderline},endAdornment:v().createElement(Cp.T,{size:"L",icon:ny(),iconClassName:O()(d.icon,{[d["popup-opened-icon"]]:m}),disabled:o}),readOnly:!0,disableUnderline:L&&!l},inputProps:{tabIndex:-1},InputLabelProps:{classes:{root:O()(d.inputLabel,t.label)}},value:"",onClick:o?void 0:y,classes:{root:O()(d.root,t.root)},size:"small",variant:"filled",disabled:o,"data-reltio-id":u}),v().createElement(kp,{open:m,anchorEl:P.current,onClose:x,onSearch:E,title:p,containerWidth:k,containerHeight:355,searchInputOnKeyDown:N,transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"left",vertical:"bottom"},PaperProps:{"data-reltio-id":`${u}-popup`}},v().createElement(MH,{items:C,onItemClick:A,selectedItems:n,width:k,height:245,focusIndex:I})))}));YH.displayName="MetadataTypesSelector";const WH=(0,b.memo)((({entityTypes:e,selectedEntityTypes:t,single:r,placeholder:n,enableEmptyValueUnderline:a,onChange:i,classes:o={},ListLabelProps:l={},disabled:s=!1})=>{const c=(0,b.useMemo)((()=>e.filter(S.isAvailableEntityType)),[e]);return v().createElement(YH,{items:c,selectedItemsUris:t,single:r,placeholder:n,enableEmptyValueUnderline:a,onChange:i,classes:o,ListLabelProps:l,disabled:s,label:li().text("Entity type"),dataReltioId:"entity-type-selector",selectionPopupTitle:li().text("Select entity types")})}));WH.displayName="EntityTypesSelector";const GH=({selectedEntityTypes:e,onChange:t,classes:r={},ListLabelProps:n={}})=>{const a=(0,mp.useSelector)(k().selectors.getMetadata),i=(0,mp.useSelector)(ai.t9),o=(0,mp.useSelector)(Ri.Xf),l=(0,b.useCallback)(o?({uri:e})=>o.includes(e):_.identity,[o]),s=(0,b.useMemo)((()=>a.entityTypes.filter(l).sort(o?(0,S.orderByArrayComparator)(o,"uri"):e=>0).filter((({uri:e})=>(0,S.isAvailableEntityTypeForDataTenant)(i,e)))),[a,i,l,o]);return v().createElement(WH,{classes:r,entityTypes:s,onChange:t,selectedEntityTypes:e,ListLabelProps:n,placeholder:li().text("All"),enableEmptyValueUnderline:!0})};GH.propTypes={selectedEntityTypes:dp().arrayOf(dp().string).isRequired,onChange:dp().func.isRequired,classes:dp().shape({root:dp().string,label:dp().string}),ListLabelProps:dp().shape({maxWidth:dp().number})};const qH=GH,ZH=(0,wp.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)"}}}}),$H=(0,_.either)((0,_.prop)("title"),(0,_.prop)("fieldName")),KH=({value:e,getLabel:t=$H,onSelectAttributeClick:r,disabled:n=!1})=>{const a=ZH(),i=e&&t(e);return v().createElement("div",{onClick:n?void 0:r,className:O()(a.attribute,{[a.attributeWithValue]:!!i},{[a.disabled]:n})},v().createElement(od.Y,{value:i},v().createElement("div",{className:O()(a.name,{[a.disabled]:n})},i||v().createElement("span",{className:a.noSelect},li().text("Select attribute")))),v().createElement(Cp.T,{size:"M",icon:ny(),disabled:n}))},XH=(0,wp.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 QH(){return QH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},QH.apply(null,arguments)}function JH(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){eY(e,t,r[t])}))}return e}function eY(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tY=(0,b.memo)((e=>{let{selectedAttributes:t,onItemClick:r,focusIndex:n,hideCheckBox:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["selectedAttributes","onItemClick","focusIndex","hideCheckBox"]);const o=XH(),l=(0,w.AH)();return v().createElement(Vp,QH({getItemSize:(e,t)=>t.items?40:28,renderItem:(e,{item:i,level:o,groupId:l,groupName:s},c)=>{const u=Kk(i,t),p=c===n;return v().createElement(pd,{key:`item-${l}-${i.fieldName}`,onClick:r,checked:u,data:JH({},i,{groupName:s}),notSelectable:i.notSelectable,hideCheckBox:a,label:v().createElement(dd.o,{text:i.title,highlight:i.filterText}),labelInText:i.title,level:o,style:e,isFocused:p,groupId:l,LogoIcon:i.LogoIcon})},renderGroupTitle:(e,t)=>v().createElement(Xm(),{component:"div",className:o.subHeader,style:e,key:`group-${t.item.id}`},t.item.needGroupIcon&&v().createElement(Mf,{group:t.item,metadata:l}),t.item.title),focusIndex:n},i))}));function rY(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){nY(e,t,r[t])}))}return e}function nY(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const aY=(e,t)=>e.title.toLowerCase().includes(t.toLowerCase()),iY=(e,t)=>aY(e,t)||(e.children||[]).some((e=>iY(e,t))),oY=(e,t)=>e.findIndex($k(t)),lY=(0,S.getMaxItemWidth)("title"),sY=(e,t,r,n,a=0,i=!1)=>{const o=aY(e,n);return[{item:n?rY({},e,{filterText:n}):e,level:a,groupId:t,groupName:r}].concat(e.children?e.children.filter((e=>i||o||iY(e,n))).flatMap((e=>sY(e,t,r,n,a+1,i||o))):[]).flat()},cY=(0,_.curry)(((e,t)=>t.map((t=>({item:t,items:t.attributes.filter((t=>iY(t,e))).map((r=>sY(r,t.id,t.title,e)))}))).filter((e=>e.items.length)))),uY=(0,wp.Z)({selector:{minWidth:"200px",width:"100%",alignItems:"stretch",background:"rgba(0,0,0, 0.0267)",boxSizing:"border-box",borderRadius:"4px",display:"flex"}}),pY=(0,b.memo)((({className:e,itemsGroups:t,value:r,getLabel:n,onSelect:a,onRestoreFocus:i=_.identity,onOpenPopup:o=_.identity,disableRestoreFocus:l=!1,disableEnforceFocus:s=!1,single:c=!1,ungroup:u=!1,disabled:p=!1,hideCheckBox:d=!1})=>{const m=uY(),[f,y]=(0,b.useState)(null),g=(0,b.useCallback)((()=>y(null)),[]),h=!!f,[E,T]=(0,b.useState)(""),S=(0,b.useCallback)((()=>T("")),[]),[x,C]=(0,b.useState)([]),w=(0,b.useCallback)((()=>C([])),[]),A=(0,b.useMemo)((()=>cY(E,t)),[t,E]),R=(0,b.useMemo)((()=>(0,_.pipe)((0,_.when)((0,_.always)(u),(0,_.chain)((0,_.pipe)((0,_.prop)("items"),_.flatten,(0,_.map)((0,_.pick)(["item","level"]))))),Lp)(A)),[u,A]),I=(0,b.useMemo)((()=>Math.max(lY(A),308)),[A]),N=(0,_.pipe)((0,_.tap)((0,_.pipe)(w,S,g)),i),P=(0,b.useRef)(),D=(0,b.useCallback)(((e,t)=>{a({checked:t,attribute:e,index:t?x.length:oY(x,e),selectedAttributes:x}),c?(C(t?[e]:[]),N({})):(C((({attribute:e,selectedAttributes:t,checked:r})=>r?t.concat(e):t.filter((t=>!$k(e,t))))({selectedAttributes:x,attribute:e,checked:t})),P.current&&P.current.focus())}),[x,a,c,N,P]),k=(0,b.useCallback)((({onListItemClick:e,selectedAttributes:t})=>({item:r,groupData:n})=>{const a=Kk(r,t);e(rY({},r,{groupName:n.groupName}),!a)})({onListItemClick:D,selectedAttributes:x}),[D,x]),{focusIndex:L,handleKeyDown:U}=Bp({items:R,open:h,onSelectFocusedItem:k,selectedItems:x,onClose:N});return v().createElement("div",{className:O()(m.selector,e),"data-reltio-id":"attribute-selector"},v().createElement(KH,{value:r,getLabel:n,onSelectAttributeClick:e=>{o(),y(e.currentTarget)},disabled:p}),v().createElement(kp,{open:h,anchorEl:f,onClose:N,onSearch:T,title:li().text("Select attribute"),containerWidth:I,containerHeight:507,searchInputOnKeyDown:U,anchorOrigin:{horizontal:"right",vertical:"bottom"},searchInputRef:P,disableRestoreFocus:l,disableEnforceFocus:s},v().createElement(tY,{items:R,onItemClick:D,selectedAttributes:x,width:I,height:400,focusIndex:L,hideCheckBox:d})))}));var dY=r(80349);function mY(){return mY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mY.apply(null,arguments)}const fY=(0,b.memo)((e=>{let{entityTypes:t,recommendedAttributes:r,showReferencedEntityAttributes:n=!0,firstLevelAttributesFilter:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entityTypes","recommendedAttributes","showReferencedEntityAttributes","firstLevelAttributesFilter"]);const o=(0,mp.useSelector)(k().selectors.getMetadata),l=(0,mp.useSelector)(ai.t9),s=(0,mp.useSelector)(k().selectors.getCanUserReadWorkflowDataTask),c=(0,mp.useSelector)(Ri.Xf),u=(0,mp.useSelector)(k().selectors.getDataTenants),p=(0,b.useMemo)((()=>(0,_.pipe)(dY.s1,(0,_.when)((0,_.always)(!n),dY.a),(0,j.ED)(l))({allowedEntityTypes:c,firstLevelAttributesFilter:a},o,t,r,u,s)),[t,o,l,c,a,r,n,u,s]);return v().createElement(pY,mY({},i,{itemsGroups:p}))})),yY=({rowData:e,rowContext:{entityTypes:t,dispatchGroupAction:r},attributeSelectorProps:n={}})=>{const a=PH(),i=e&&e.id,o=(0,b.useCallback)((e=>{r(Ho,i,e)}),[i,r]),l=(0,b.useCallback)((e=>(0,S.getSearchGroupAttributeLabel)({data:e})),[]);return v().createElement(fY,{className:a.attributeSelect,value:e&&e.data,getLabel:l,entityTypes:t,onSelect:o,onRestoreFocus:n.onRestoreFocus,onOpenPopup:n.onOpen,disableRestoreFocus:n.disablePopoverRestoreFocus,disableEnforceFocus:n.disablePopoverRestoreFocus})};yY.propTypes={rowData:hB,rowContext:dp().shape({entityTypes:dp().arrayOf(dp().string),dispatchGroupAction:dp().func}),attributeSelectorProps:dp().shape({onRestoreFocus:dp().func,onOpen:dp().func,disablePopoverRestoreFocus:dp().bool})};const gY=(0,b.memo)(yY);function hY(){return hY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hY.apply(null,arguments)}const EY=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",hY({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),v().createElement("defs",null,v().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"})),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("g",null,v().createElement("g",{transform:"translate(-2 -2)"},v().createElement("mask",{id:"svg397942461b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg397942461a"})),v().createElement("g",{mask:"url(#svg397942461b)",fill:"#000",fillOpacity:".54"},v().createElement("path",{d:"M0 0h24v24H0z"}))))))},bY=e=>!(e&&e.data),vY=({rowData:e,rowContext:{dispatchGroupAction:t}})=>{const r=PH(),n=e&&e.id,a=(0,b.useCallback)((()=>t(Go,n)),[n,t]),i=(0,b.useCallback)((()=>t(qo,n)),[n,t]),o=(0,b.useCallback)((()=>t(Mo,n)),[n,t]);return e&&v().createElement("div",{className:O()(r.actions)},v().createElement(rg(),{title:li().text("Add"),placement:"bottom"},v().createElement(yH(),{className:r.actionIcon,onClick:o})),!bY(e)&&v().createElement(rg(),{title:li().text("Duplicate"),placement:"bottom"},v().createElement("div",{className:r.actionIcon,tabIndex:-1},v().createElement(EY,{onClick:i,tabIndex:-1}))),v().createElement(rg(),{title:li().text("Delete"),placement:"bottom"},v().createElement(Tp(),{onClick:a,className:r.actionIcon})))};vY.propTypes={rowData:hB,rowContext:dp().shape({dispatchGroupAction:dp().func})};const TY=(0,b.memo)(vY),OY={BY_LABEL:(0,r(51774).c)({stringify:(0,_.prop)("label")})},SY=({className:e,attribute:t,textFieldInputRef:r,isDisabled:n,height:a,onChange:i})=>{const o=(0,_.pipe)(S.getFilterOptionLabel,gH.capitalize);return v().createElement(WU,{label:"",placeholder:li().text("Equals"),className:e,value:n?void 0:{value:t.filter,label:o(t.filter)},options:t&&t.data&&t.data.filterOptions.map((e=>({value:e,label:o(e)})))||[],height:a,onChange:i,isDisabled:n,filterOption:OY.BY_LABEL,textFieldInputRef:r})};SY.propTypes={className:dp().string,attribute:hB,textFieldInputRef:dp().object,isDisabled:dp().bool,onChange:dp().func,height:dp().number};const xY=(0,b.memo)(SY),CY=({rowData:e,rowContext:{dispatchGroupAction:t},textFieldInputRef:r})=>{const n=PH(),a=e&&e.id,i=(0,b.useCallback)((e=>t(Zo,a,e.value)),[t,a]);return v().createElement(xY,{className:n.filterSelect,attribute:e,textFieldInputRef:r,isDisabled:bY(e),onChange:i})};CY.propTypes={rowData:hB,rowContext:dp().shape({dispatchGroupAction:dp().func}),textFieldInputRef:dp().object};const wY=(0,b.memo)(CY);var AY=r(23821);const RY=(0,wp.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"}}),_Y=({attribute:e,groupId:t,onChange:r,updateValues:n,filterValues:a})=>{const{values:i,data:{attrType:o,fieldName:l}={},id:s}=e,c=(0,mp.useSelector)((e=>(0,Ki.Sw)(e,t,s)))||{},u=(0,mp.useSelector)((e=>(0,Ki.Ly)(e))),p=(0,mp.useSelector)((e=>(0,ai.Sg)(e,l)));(0,b.useEffect)((()=>{u&&n()}),[i,u,p]),(0,b.useEffect)((()=>{u||n()}),[i,u]);const d=(0,b.useMemo)((()=>(0,_.propOr)([],0,i)),[i]),m=(0,b.useCallback)((0,_.pipe)(S.wrapInArray,r),[r]),{default:f,filtered:y}=c;return!f&&o?v().createElement("div",{className:"ValuesEditor-styles-loadingWrapper--_rOmn"},v().createElement(dm(),{size:20,className:"ValuesEditor-styles-loading--mLFVu"})):v().createElement(eg,{values:d,defaultOptions:f,filteredOptions:y,onChange:m,getSuggestions:a,tabSelectsValue:!1,canLoadMore:!(0,ja.tW)(e.data)})};_Y.propTypes={attribute:hB.isRequired,groupId:dp().string,onChange:dp().func,updateValues:dp().func,filterValues:dp().func};const IY=_Y,NY=({attribute:e,dispatchGroupAction:t,groupId:r})=>{const{values:n,data:{attrType:a,fieldName:i}={},filter:o}=e,l=RY(),s=(0,S.isTypeaheadAttrType)(a)||(0,_.allPass)([(0,_.propSatisfies)((0,_.either)(_.isNil,S.isEntityTypeUri),"uri"),(0,_.prop)("faceted"),(0,_.propEq)("type",S.DataTypes.TYPE_BLOB)])(a),c=(0,S.isEnumAttrType)(a)||(0,S.isLookupAttrType)(a),u=r=>t($o,e.id,r);if((s||c)&&(0,S.isMultiValueOption)(o)){const n=()=>t(Qo,e),a=({value:r,pageNumber:n,currentOptions:a})=>t(Ko,{attribute:e,value:r,debounceTime:500,pageNumber:n,currentOptions:a});return v().createElement(IY,{attribute:e,groupId:r,onChange:u,filterValues:a,updateValues:n})}{const e=c?{type:S.DataTypes.TYPE_STRING}:(0,S.getAttrDataTypeDefinition)(a),t=(0,S.getDataTypeDefinitionForFilterValue)(e,o),r=(0,S.isDateType)(t.type)&&!(0,S.isDateRangeFilterOption)(o)&&l.dateRoot||(0,S.isBooleanType)(t.type)&&l.boolRoot||l.root;return v().createElement(AY.n,{filter:{filter:o,fieldName:i,values:n||[]},onChange:u,dataTypeDefinition:t,fullWidth:!0,TextFieldProps:{InputProps:{classes:{root:l.input},disableUnderline:(0,_.isNil)(n)||(0,_.isEmpty)((0,_.flatten)(n))}},color:"primary",booleanRadioEditorClassName:l.booleanRadioEditor,classes:{root:r},orientation:"horizontal"})}};NY.propTypes={attribute:hB.isRequired,groupId:dp().string,dispatchGroupAction:dp().func};const PY=(0,b.memo)(NY),DY=({rowData:e,rowContext:{dispatchGroupAction:t,groupId:r}})=>{const n=PH(),a=e&&(0,S.checkIfOptionHasValues)(e.filter);return v().createElement("div",{className:n.valuesWrapper,"data-reltio-id":"advanced-search-values-editor-wrapper"},!bY(e)&&a&&v().createElement(PY,{attribute:e,dispatchGroupAction:t,groupId:r}))};DY.propTypes={rowData:hB,rowContext:dp().shape({dispatchGroupAction:dp().func,groupId:dp().string})};const kY=(0,b.memo)(DY),LY=({rowData:e,rowContext:{dispatchGroupAction:t}})=>{const r=PH(),n=e&&e.id,a=e&&e.operator,i=(0,b.useCallback)((e=>t(Yo,n,e)),[t,n]);return v().createElement("div",{className:r.logicOperatorContainer},a?v().createElement(wH,{className:r.logicOperator,value:a,onChange:i}):v().createElement("div",{className:O()(r.logicOperator,r.logicOperatorPlaceholder)},li().text("Where")))};LY.propTypes={rowData:hB,rowContext:dp().shape({dispatchGroupAction:dp().func})};const UY=(0,b.memo)(LY);function jY(){return jY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jY.apply(null,arguments)}const FY=e=>{let{showLogicOperator:t,group:{id:r,attributes:n,operator:a,entityTypes:i=[]},dispatch:o,onAddEmptyGroup:l}=e,s=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["showLogicOperator","group","dispatch","onAddEmptyGroup"]);const c=IH(),u=PH(),p=(0,b.useCallback)((()=>o({type:Qe,payload:{groupId:r,id:(0,Ge.x0)()}})),[r,o]),d=(0,b.useCallback)((()=>o({type:Ke,payload:{groupId:r}})),[r,o]),m=(0,b.useCallback)((e=>o(((e,t)=>({type:$e,payload:{groupId:e,operator:t}}))(r,e))),[r,o]),f=(0,b.useCallback)((e=>o(((e,t)=>({type:qe,payload:{groupId:e,entityTypes:t}}))(r,e))),[r,o]),y=(0,b.useCallback)(((e,...t)=>o(e(r,...t))),[r,o]),g=(0,b.useRef)(null),h=(0,b.useRef)(null),E=(0,b.useRef)(null);E.current=n.length;const T=(0,b.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),g.current&&h.current!==E.current&&(g.current.querySelector("input").focus(),h.current=null)}),[]),S=(0,b.useCallback)((()=>{h.current=n.length}),[n.length]),x=(0,b.useMemo)((()=>[{text:li().text("Add set"),onClick:l,id:"-group-add-set"},{text:li().text("Duplicate set"),onClick:p,id:"-group-duplicate-set"},{text:li().text("Delete set"),onClick:d,id:"-group-delete-set"}]),[l,p,d]),C=(0,b.useMemo)((()=>({root:u.row})),[u]),w=(0,b.useMemo)((()=>({onRestoreFocus:T,onOpen:S,disablePopoverRestoreFocus:!!T})),[T,S]);return v().createElement(v().Fragment,null,v().createElement("div",jY({className:c.container},s),v().createElement("div",{className:c.title},li().text("Set")),v().createElement("div",{className:c.entityTypeSelectorContainer},v().createElement(qH,{classes:{root:c.entityTypeSelector},selectedEntityTypes:i,onChange:f})),v().createElement("div",{className:c.rows},v().createElement(xH,{rowClasses:C,rowsData:n,AttributeSelectorComponent:gY,FilterSelectorComponent:wY,ValuesEditorComponent:kY,ActionsComponent:TY,LogicOperatorComponent:UY,filterSelectorRefIndex:h.current,filterSelectorRef:g,lastRowAttributeSelectorProps:w,entityTypes:i,groupId:r,dispatchGroupAction:y}),v().createElement("div",{className:c.actions},v().createElement(EN,{menuId:`query-builder-group-actions-${r}`,buttonComponent:Cp.T,buttonProps:{icon:Pd(),size:"L","data-reltio-id":"reltio-search-query-builder-group-actions"},menuItems:x})))),t&&v().createElement("div",{className:c.logicOperator},v().createElement("div",{className:O()(c.verticalOperatorLine,c.upperLine)}),v().createElement("div",{className:O()(c.verticalOperatorLine,c.lowerLine)}),v().createElement(wH,{value:a,onChange:m})))};FY.propTypes={showLogicOperator:dp().bool,group:dp().shape({id:dp().string,attributes:dp().arrayOf(hB),entityTypes:dp().arrayOf(dp().string),operator:dp().string}),onAddEmptyGroup:dp().func,dispatch:dp().func};const MY=(0,b.memo)(FY);function VY(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){BY(e,t,r[t])}))}return e}function BY(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zY=(0,wp.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:VY({},AH),upperLine:{marginTop:-18},searchByOvContainer:{marginLeft:-6,marginBottom:-14}}))),HY=({groups:e,uiConfigShowSearchByOv:t,dispatch:r})=>{const n=zY(),a=(0,b.useRef)(null),i=(0,b.useRef)(null),o=(0,b.useCallback)((()=>r({type:Xe,payload:{group:Xt([])}})),[r]);return(0,b.useEffect)((()=>{if(0===e.length)o();else if(!(0,_.isNil)(i.current)&&i.current<e.length&&a.current){const e=a.current.childNodes;e[e.length-2].scrollIntoView({behavior:"smooth"})}i.current=e.length}),[e.length,o]),v().createElement("div",{className:n.scrollWrapper},v().createElement("div",{className:n.groupsContainer,ref:a},t&&v().createElement("div",{className:n.searchByOvContainer},v().createElement(_h,{variant:"queryGroups"})),e.map(((e,t,n)=>v().createElement(MY,{key:e.id,group:e,dispatch:r,showLogicOperator:t!==n.length-1,onAddEmptyGroup:o,"data-reltio-id":`reltio-search-advansed-search-group-builder-${t}`}))),v().createElement("div",{className:n.button},v().createElement("div",{className:O()(n.verticalOperatorLine,n.upperLine)}),v().createElement(Wh(),{onClick:o,color:"primary",size:"small","data-reltio-id":"reltio-search-advanced-search-add-set-button"},v().createElement(yH(),{color:"primary",className:n.icon,fontSize:"small"}),li().text("ADD SET")))))};HY.propTypes={groups:dp().array,dispatch:dp().func,uiConfigShowSearchByOv:dp().bool};const YY=(0,mp.connect)((e=>{var t;return{groups:(0,Ki.go)(e),uiConfigShowSearchByOv:null!==(t=k().selectors.getShowSearchByOv(e))&&void 0!==t?t:(0,Ri.cC)(e)}}))(HY),WY=D.search.actions.updateState({}),GY=({open:e,onClose:t})=>{const r=(0,mp.useDispatch)(),n=(0,b.useCallback)((()=>{t(),r(WY)}),[r,t]),a=(0,b.useCallback)((()=>{t(),r(gi(!0,WY))}),[r,t]),i=(0,mp.useSelector)(ho.LA),o=(0,mp.useSelector)(ai.ai),l=(0,mp.useSelector)(ho.WH),s=(0,mp.useSelector)(ho.Jv),c=i?s&&!l:!o;return v().createElement(mB.U,{open:e,title:li().text("Search filters cannot be displayed in Quick filters"),content:li().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:li().text("Clear search"),saveCaption:li().text("Save search"),disabledSave:c,onCancel:t,onDiscard:n,onSave:a})};GY.propTypes={open:dp().bool,onClose:dp().func};const qY=GY,ZY=(0,mp.connect)((e=>({metadata:k().selectors.getMetadata(e),attributesPresentation:k().selectors.getAttributesPresentation(e),groups:(0,Ki.go)(e),lookups:k().selectors.getLookups(e),keyword:k().selectors.getSearchKeyword(e),map:(0,ai.vH)(e),dataTenants:k().selectors.getDataTenants(e)})))((({metadata:e,attributesPresentation:t,lookups:r,groups:n,keyword:a,map:i,onClose:o,collapsed:l,isFullscreen:s,onCollapse:c,onExpand:u,onFullscreen:p,dataTenants:d,dispatch:m})=>{const f=zY(),[y,g]=(0,b.useState)(!1),h=(0,_.ifElse)((0,_.always)(Ba(e,n,d)),(0,_.pipe)(o,u),(()=>g(!0)));return v().createElement("div",{className:f.container},v().createElement($z,{onBackBtnClick:h}),v().createElement(YY,null),v().createElement(mH,{groups:n,lookups:r,dispatch:m,metadata:e,attributesPresentation:t,hasMinSize:l,collapseBtnActive:!l,isFullscreen:s,onCollapseBtnClick:l?u:c,onFullScreenBtnClick:s?u:p,keyword:a,map:i}),v().createElement(qY,{open:y,onClose:()=>g(!1)}))})),$Y=({isOpenAdvancedSearch:e,onCloseAdvancedSearch:t})=>{const r=Jh(),[n,a]=(0,b.useState)(!1),[i,o]=(0,b.useState)("50%"),l=(0,b.useCallback)((()=>{a(!0),o("120px")}),[]),s=(0,b.useCallback)((()=>{a(!1),o("50%")}),[]),c=(0,b.useCallback)((({percentageSize:e,isMaxSize:t,isMinSize:r})=>{a(r),o(t?-53:e)}),[]),u=(0,b.useCallback)((()=>{a(!1),o(-53)}),[]),p=v().createElement(v().Fragment,null,v().createElement(Gz,null),v().createElement(Af(),{className:r.divider})),d=v().createElement(v().Fragment,null,p,v().createElement(ZY,{collapsed:n,isFullscreen:-53===i,onClose:t,onCollapse:l,onExpand:s,onFullscreen:u}));return v().createElement(oE,{className:r.resizablePanesWrapper,orientation:"horizontal",size:e?i:0,minSize:120,maxSize:-53,allowResize:e,onChange:c},v().createElement("div",{className:r.pane},e&&d),v().createElement("div",{className:r.pane},!e&&p,v().createElement(zM,null)))};$Y.propTypes={isOpenAdvancedSearch:dp().bool,onCloseAdvancedSearch:dp().func};const KY=$Y;function XY(){return XY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},XY.apply(null,arguments)}const QY=e=>v().createElement("svg",XY({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgTenant"},e),v().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"})),JY=(0,wp.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)"}}))),eW=({className:e})=>{const t=JY(),r=(0,w.xz)(),n=(0,w.fN)(),a=`${r}${n?" - "+n.toUpperCase():""}`;return v().createElement("div",{className:O()(t.labelWrapper,e)},v().createElement(QY,{className:t.tenantIcon,"data-reltio-id":"reltio-tenant-icon"}),v().createElement(bf(),{className:t.tenantLabel},a))},tW=(0,wp.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)"}}))),rW=()=>{const e=tW(),t=(0,mp.useSelector)(k().selectors.getMetadata),r=(0,mp.useSelector)(Zc),n=(0,mp.useSelector)(Gc),a=(0,mp.useSelector)(ou),i=(0,mp.useSelector)(ai.hX),o=(0,mp.useSelector)(lu),l=(0,mp.useSelector)(au),s=(0,S.getEntityTypeLabel)(t,{type:r}),c=(0,mp.useSelector)(iu),u=(0,mp.useDispatch)(),p=(()=>{const e=(0,mp.useSelector)(k().selectors.getMetadata),t=(0,mp.useSelector)(k().selectors.getLookups),r=(0,mp.useSelector)(k().selectors.getAttributesPresentation),n=(0,mp.useSelector)(Ki.go),a=(0,mp.useSelector)(k().selectors.getSearchKeyword),i=(0,mp.useSelector)(ai.vH),o=(0,mp.useSelector)(k().selectors.getDataTenants),l=(0,mp.useSelector)(P.X0),s=(0,mp.useSelector)(P.Mp),c=(0,b.useMemo)((()=>Object.values((0,ja.t8)(l,s))),[l,s]);return(0,b.useMemo)((()=>{const l=(0,_.isEmpty)(n)?(0,Jo.h)(e,o,c):n;return(e=>!(1===e.length&&(0,_.isEmpty)(e[0].attributes)&&1===e[0].entityTypes.length))(l)||i||a?(0,S.buildReadableQuery)(e,r,t,l,a,i):[]}),[a,i,e,o,r,n,c,t])})();(0,b.useEffect)((()=>{0!==i&&(a&&o>=i||!a&&o<=0)&&u(uc())}),[a,i,o,u]);const d=(0,b.useCallback)((e=>u(((e,t)=>({type:jn,payload:{filterText:e,debounceTime:t}}))(e,Z.XU))),[u]);return v().createElement(v().Fragment,null,v().createElement(aF(),{className:O()(e.container,{[e.borderBottom]:n>0})},v().createElement(bf(),{component:"span",className:e.entityTypeTitle},s),v().createElement(Af(),{orientation:"vertical",className:e.splitter}),v().createElement(bf(),{component:"span",className:e.profileNumber},li().number(o,"0,0")),v().createElement(bf(),{variant:"body2",component:"span",className:e.profileText},li().text(" profiles are selected for bulk edit.")),0===n&&v().createElement(v().Fragment,null,v().createElement(Wh(),{color:"primary",className:e.clearButton,onClick:()=>{u(uc())},"data-reltio-id":"reltio-search-bulk-update-"+(a?"select-all-profiles":"clear-selection")},a?`${li().text("Select all")} ${li().number(i,"0,0")} ${li().text("profiles")}`:li().text("Clear selection")),v().createElement(Np,{classes:{root:e.searchBox},value:c,onSearch:d,"data-reltio-id":"reltio-search-bulk-update-search-input"}),v().createElement(Af(),{orientation:"vertical",className:e.splitter}),v().createElement(wd,{entityTypeUri:r,headColumns:l,onSelectColumns:e=>{const t=(0,Ai.tU)(e,l);u(mc(e)),t&&u(cc())},"data-reltio-id":"reltio-search-bulk-update-add-remove-columns"}))),0===n&&!(0,_.isEmpty)(p)&&v().createElement(aF(),{className:e.searchQueryContainer},li().text("Search query"),v().createElement(Qz,{readableQuery:p,className:e.searchQuery})))};function nW(){return nW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nW.apply(null,arguments)}const aW=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",nW({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),v().createElement("defs",null,v().createElement("path",{id:"svg3533951039a",d:"M15 6v5l2 2v2h-4v4l-.992 1L11 19v-4H7v-2l2-2V6H8V4h8v2z"})),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"svg3533951039b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg3533951039a"})),v().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg3533951039b)",d:"M0 0h24v24H0z"})))};function iW(){return iW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},iW.apply(null,arguments)}const oW=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",iW({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),v().createElement("defs",null,v().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"})),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"svg1464898421b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg1464898421a"})),v().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg1464898421b)",d:"M0 0h24v24H0z"})))},lW=(0,wp.Z)({editor:{marginBottom:0},editorValue:{width:"100%",marginRight:"8px"}}),sW=({valueProperty:e,emptyEditorValue:t,attributeType:r,value:n,fieldName:a,onChangeValue:i})=>{const o=lW(),l=!r.uri,s=(0,_.pipe)((0,_.ifElse)((0,_.has)("lookupCode"),_.identity,(0,_.objOf)("value")),(0,_.filter)((e=>void 0!==e)),(0,_.mergeRight)(t))(n);return(0,b.useEffect)((()=>{(0,S.isLookupAttrType)(r)||""===t.value||i(e)(t)}),[]),l?v().createElement("div",{key:e,className:O()(o.editor,o.editorValue),"data-reltio-id":"bulk-update-special-attribute-change-editor"},v().createElement(Mk.Z,{fieldName:a,value:n,dataTypeDefinition:(0,S.getAttrDataTypeDefinition)(r),onChange:(0,_.pipe)((0,_.objOf)("value"),i(e)),fullWidth:!0})):v().createElement(yL,{key:e,className:o.editor,mode:S.Mode.Editing,attributeType:r,attributeValue:s,onChangeAttribute:i(e)})},cW={flex:"0 0 auto"},uW=(0,wp.Z)({container:{flexGrow:1,display:"flex",alignItems:"center",margin:0},singleEditor:{marginRight:5,maxWidth:334},to:{color:"#696969",padding:"0 16px 0 7px"},type_Timestamp:cW,type_Boolean:cW,type_Date:cW}),pW=(0,b.memo)((({id:e,groupId:t,operation:r,operationParameters:n})=>{const a=uW(),i=(0,mp.useDispatch)(),{attributeType:o,fieldName:l}=n.attributeTypeData,s=(0,b.useMemo)((()=>(0,S.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType:o})),[o]),c=(0,b.useCallback)((r=>n=>{const{value:a}=n,l=""===a&&(0,S.isLookupAttrType)(o)?{lookupCode:"",value:""}:a;i(hc({id:e,groupId:t,operationParameters:{[r]:l}}))}),[e,t,o,i]),u=zc(r).map((e=>v().createElement(sW,{key:e,valueProperty:e,value:n[e],emptyEditorValue:s,fieldName:l,attributeType:o,onChangeValue:c})));if(!u.length)return null;const p=v().createElement("div",{key:"to",className:a.to},li().text("with"));return v().createElement("div",{className:O()(a.container,a[`type_${o.type}`],{[a.singleEditor]:1===u.length})},2===u.length?(0,_.insert)(1,p,u):u)}));pW.displayName="ChangeEditor";const dW=(0,wp.Z)((()=>({entitySelector:{marginTop:"10px",width:"100%",maxWidth:"452px"},label:{"&:not($labelShrink)":{transform:"translate(12px, 10px)"}},labelShrink:{}}))),mW=({attributeType:e,value:t,onChange:r})=>{const n=dW(),a=(0,mp.useDispatch)(),i=(0,mp.useSelector)(k().selectors.getMetadata),o=(0,mp.useSelector)((e=>k().selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),l=S.Mode.Editing,s=null==t?void 0:t.entityUri,c=(0,S.getReferencedEntityTypeUriFromAttrType)(e),u=(0,b.useCallback)((t=>(0,S.referencedEntityAttributeTypesSelectionStrategy)(e,t)),[e]),p=(0,b.useCallback)((e=>{const{uri:t,type:n,label:i}=e;(0,S.isTempUri)(s)&&a(D.profile.modifiedEntities.actions.entityDeleted(s)),r((0,_.isEmpty)(e)?null:{entityUri:t,entityType:n,entityLabel:i})}),[a,r,s]),d=(0,b.useCallback)(((e,t)=>{const r=(0,S.getEntityType)(i,c),n=(0,_.pipe)(u,(0,S.getCreatableAttributeTypes)(l))(r),o=(0,S.createTemporaryEntity)({entityTypeUri:e,initValue:t,attributeTypes:n,metadata:i,mode:l});p(o),a(D.profile.modifiedEntities.actions.entityCreated(o))}),[a,p,u,i,l,c]);return v().createElement(fU,{className:n.entitySelector,entity:t,entityTypesUris:(0,ni.l0)(c),metadata:i,globalSearchRequestOptions:o,onChange:p,onCreate:d,height:40,disableLinkClick:!0,attributeTypesSelectionStrategy:u,mode:l,TextFieldProps:{InputLabelProps:{classes:{root:n.label,shrink:n.labelShrink}}}})},fW=e=>(0,_.last)(e.type.split("/")),yW=e=>({attributes:{[fW(e)]:[e]}}),gW=(e,t)=>{const r=fW(e);return t.attributes[r][0]},hW=({attributeValue:e,onChange:t})=>{const r=(0,b.useRef)(e);r.current=e;return{onChangeAttribute:(0,b.useCallback)((({value:e,attributeType:n,uri:a})=>{const i=yW(r.current),o=(0,S.editAttribute)({entity:i,attributeType:n,uri:a,value:e});t(gW(r.current,o))}),[t]),onDeleteAttribute:(0,b.useCallback)((({attributeType:e,uri:n})=>{const a=yW(r.current),i=(0,S.removeAttribute)({entity:a,attributeType:e,uri:n});t(gW(r.current,i))}),[t]),onAddAttributes:(0,b.useCallback)((e=>{const n=yW(r.current),a=e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,S.addAttribute)({entity:e,attributeType:r,parentUri:n,index:a})}),n);t(gW(r.current,a))}),[t]),onTogglePin:(0,b.useCallback)((e=>{const n=(({parentAttributeValue:e,uri:t})=>{const r=t.split(e.uri+"/")[1].split("/"),n=[];for(;r.length;){n.push("value");const t=r.shift(),a=r.shift();n.push(t);const i=(0,_.view)((0,_.lensPath)(n),e);if(!i)return null;const o=i.findIndex((({uri:e})=>e.endsWith("/"+a)));n.push(o)}return n.length?(n.push("pin"),(0,_.over)((0,_.lensPath)(n),_.not,e)):null})({parentAttributeValue:r.current,uri:e});n&&t(n)}),[t])}},EW=(0,wp.Z)((e=>({pinIcon:{marginRight:"-8px"},pinIconActive:{"& svg > g > path":{fill:e.palette.primary.main,fillOpacity:1}}}))),bW=({onTogglePin:e,subAttributeValue:t})=>{const r=EW();return v().createElement(Ed.k,{icon:aW,onClick:()=>e(t.uri),size:"L",className:O()(r.pinIcon,t.pin&&r.pinIconActive)})},vW=(0,_.curry)(((e,t,{attributeValue:r})=>r.uri===e?null:v().createElement(bW,{onTogglePin:t,subAttributeValue:r})));function TW(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const OW=({attributeType:e,attributeValue:t,onChange:r})=>{const n=(0,mp.useSelector)(k().selectors.getMetadata),a=(0,b.useMemo)((()=>{const t=(0,S.getAttributeTypeSubAttributes)(n,e),r=(0,S.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType: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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){TW(e,t,r[t])}))}return e}({},r,{value:(0,S.createDefaultValues)({attributeTypes:t,parentUri:r.uri,metadata:n,mode:S.Mode.Editing})})}),[e,n]),i=t||a,{onChangeAttribute:o,onDeleteAttribute:l,onAddAttributes:s,onTogglePin:c}=hW({attributeValue:i,onChange:r}),u=(0,b.useCallback)(vW(i.uri,c),[i.uri,c]);return v().createElement(wL,{attributeType:e,attributeValue:i,showEmptyEditors:!0,mode:S.Mode.Editing,metadata:n,onAddAttributes:s,onDeleteAttribute:l,onChangeAttribute:o,hideDeleteButton:!0,additionalControlsRenderer:u})};function SW(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xW=({attributeType:e,attributeValue:t,onChange:r})=>{const n=(0,mp.useSelector)(k().selectors.getMetadata),a=(0,b.useMemo)((()=>{const t=(0,S.getEditableAttributeTypeSubAttributes)(n,e),r=(0,S.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType: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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){SW(e,t,r[t])}))}return e}({},r,{value:(0,S.createDefaultValues)({attributeTypes:t,parentUri:r.uri,metadata:n,mode:S.Mode.Editing})})}),[e,n]),i=t||a,{onChangeAttribute:o,onDeleteAttribute:l,onAddAttributes:s,onTogglePin:c}=hW({attributeValue:i,onChange:r}),u=(0,b.useCallback)(vW(i.uri,c),[i.uri,c]);return v().createElement(EU,{attributeType:e,attributeValue:i,showEmptyEditors:!0,mode:S.Mode.Editing,metadata:n,onAddAttributes:s,onDeleteAttribute:l,onChangeAttribute:o,hideDeleteButton:!0,additionalControlsRenderer:u})},CW=({operation:e,attributeType:t,attributeValue:r,onChange:n})=>e===ra.d.RepointReference?v().createElement(mW,{attributeType:t,value:r,onChange:n}):(0,S.isNested)(t)?v().createElement(OW,{attributeType:t,attributeValue:r,onChange:n}):(0,S.isReference)(t)?v().createElement(xW,{attributeType:t,attributeValue:r,onChange:n}):null,wW=(0,_.curry)(((e,t,r)=>(0,_.assoc)(t,(0,_.prop)(e,r),(0,_.dissoc)(e,r)))),AW=(0,_.pipe)((0,_.pick)(["fieldName","title","pathToTitle","attrType"]),wW("attrType","attributeType")),RW=(0,_.unless)(_.isNil,wW("attributeType","attrType")),_W="1px solid #e4e4e4",IW=(0,wp.Z)((e=>({mainRowContent:{display:"flex",alignItems:"center","&>*":{marginRight:8}},row:{borderBottom:_W,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}}}))),NW={enabled:!0,queueSizeThreshold:5},PW=(0,b.memo)((({id:e,operation:t,operationParameters:r,groupId:n,groupAttributeType:a,hasConditions:i})=>{const o=IW(),l=(0,mp.useDispatch)(),s=(0,mp.useSelector)(Zc),c=(0,ni.l0)(s),{pin:u,addNestedAttribute:p,attributeTypeData:d}=r||{},{attributeType:m}=d||{},f=t&&d,y=(0,b.useCallback)((({attribute:t,checked:r})=>{r&&l((({id:e,groupId:t,attribute:r})=>({type:Bn,payload:{id:e,groupId:t,attribute:r}}))({id:e,groupId:n,attribute:AW(t)}))}),[e,n,l]),g=(0,b.useCallback)((t=>{l(hc({id:e,groupId:n,operationParameters:{attributeValue:t}}))}),[l,e,n]),h=(0,b.useCallback)((()=>{l((({id:e,groupId:t})=>({type:Qn,payload:{id:e,groupId:t}}))({id:e,groupId:n}))}),[e,n,l]),E=(0,b.useCallback)((()=>{l((({id:e,groupId:t})=>({type:Jn,payload:{id:e,groupId:t}}))({id:e,groupId:n}))}),[e,n,l]),T=(0,b.useCallback)((()=>{l(gc({id:e,groupId:n}))}),[e,n,l]),x=(0,b.useCallback)((t=>{l((({id:e,groupId:t,operation:r})=>({type:zn,payload:{id:e,groupId:t,operation:r}}))({id:e,groupId:n,operation:t.value}))}),[e,n,l]),C=(0,S.isComplexAttribute)(m)&&[ra.d.AddNew,ra.d.ReplaceAllWith,ra.d.RepointReference].includes(t),w=[ra.d.AddNew,ra.d.ReplaceAllWith,ra.d.FindAndReplace].includes(t)&&!(null==m||!m.uri),A=a&&m&&m.uri===a.uri,R=n&&!A&&t===ra.d.AddNew&&!(0,S.isReference)(a),I=(0,b.useMemo)((()=>{return m?(e=m,t=i&&A,(0,_.cond)([[(0,_.both)(S.isNested,(0,_.always)(t)),(0,_.always)((0,_.without)([ra.d.AddNew,ra.d.ReplaceAllWith],Z.DY))],[S.isNested,(0,_.always)(Z.DY)],[(0,_.both)(S.isReference,(0,_.always)(t)),(0,_.always)((0,_.without)([ra.d.AddNew],Z.hS))],[S.isReference,(0,_.always)(Z.hS)],[_.T,(0,_.always)(Z.pG)]])(e)).map((e=>({value:ra.d[e],label:Z.WN[e]}))):[];var e,t}),[i,m,A]),N=(0,b.useMemo)((()=>I.find((e=>e.value===t))),[t,I]),P=(0,b.useMemo)((()=>RW(d)),[d]),D=(0,b.useCallback)(a?(0,dY.xM)(a):(0,_.ifElse)(dY.XF,(0,_.pipe)((0,_.pathEq)(["fieldName"],"tags")),(0,_.pipe)((0,_.prop)("attrType"),(0,_.both)((0,_.complement)(S.isImage),(0,_.complement)(S.isAnalyticAttribute)))),[a]),k=(0,b.useCallback)((e=>(0,S.getSearchGroupAttributeLabel)({data:e})),[]);return(0,b.useEffect)((()=>{!N&&I[0]&&d&&x(I[0])}),[I,N,d,x]),(0,b.useEffect)((()=>{u&&!w&&h()}),[w,u,h]),(0,b.useEffect)((()=>{p&&!R&&E()}),[R,p,E]),v().createElement("div",{"data-reltio-id":"bulk-update-dialog-action-row",className:O()(o.row,{[o.withoutLine]:!!n})},v().createElement("div",{className:o.mainRowContent},v().createElement(fY,{className:o.attrSelector,single:!0,showReferencedEntityAttributes:!1,entityTypes:c,value:P,onSelect:y,firstLevelAttributesFilter:D,ungroup:!!n,getLabel:k}),v().createElement(WU,{label:"",isDisabled:!P,placeholder:li().text("Select operation"),className:o.operationSelector,value:N,options:I,height:40,onChange:x}),f&&v().createElement(v().Fragment,null,!C&&v().createElement(pW,{id:e,groupId:n,operation:t,operationParameters:r}),v().createElement("div",{className:o.icons},w&&v().createElement(Ed.k,{className:O()(o.actionIcon,{[o.actionIconActive]:u}),size:"M",tooltipTitle:li().text("Make this Operational Value"),icon:aW,onClick:h}),R&&v().createElement(Ed.k,{className:O()(o.actionIcon,{[o.actionIconActive]:p}),size:"M",tooltipTitle:li().text("Create parent attribute if none exists"),icon:oW,onClick:E}),v().createElement(Ed.k,{size:"M",tooltipTitle:li().text("Delete"),icon:Tp(),onClick:T})))),f&&C&&v().createElement(Qk.Provider,{value:NW},v().createElement(CW,{operation:t,attributeType:m,attributeValue:r.attributeValue,onChange:g})))}));var DW=r(80510),kW=r.n(DW);function LW(){return LW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},LW.apply(null,arguments)}const UW=(0,b.memo)((e=>{let{attributeType:t,showReferencedEntityAttributes:r,subattributesGroupTitle:n,additionalItemsGroups:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeType","showReferencedEntityAttributes","subattributesGroupTitle","additionalItemsGroups"]);const o=(0,mp.useSelector)(k().selectors.getMetadata),l=t.uri.split("/").slice(0,3).join("/"),s=(0,ni.l0)(l),c=(0,b.useCallback)((0,dY.xM)(t),[t]),u=(0,b.useMemo)((()=>(0,_.pipe)(dY.s1,(0,_.when)((0,_.always)(!r),dY.a),(0,_.map)((0,_.evolve)({attributes:(0,_.pathOr)([],[0,"children"]),title:(0,_.when)((0,_.always)(n),(0,_.always)(n))})),(0,_.when)((0,_.always)(a),(0,_.concat)(a)))({firstLevelAttributesFilter:c},o,s)),[a,n,r,s,o,c]);return v().createElement(pY,LW({},i,{ungroup:!a,itemsGroups:u}))}));function jW(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){FW(e,t,r[t])}))}return e}function FW(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const MW=(e,t)=>(0,Va.nT)(`${Z.E_}_group`,li().text("Profile"),[jW({},(0,Va.o)(jW({title:(0,S.getEntityTypeLabel)(t,{type:(0,S.getReferencedEntityTypeUriFromAttrType)(e)}),fieldName:Z.E_},e)),{enforcedFilterOptions:[S.FilterOptions.EQUALS]})]),VW=(0,wp.Z)({selector:{width:"254px",height:"40px"}}),BW=(0,b.memo)((({rowData:e,rowContext:{attributeType:t,dispatchGroupAction:r},attributeSelectorProps:n={}})=>{const a=VW(),i=(0,mp.useSelector)(k().selectors.getMetadata),o=e&&e.id,l=(0,b.useMemo)((()=>(0,S.isReference)(t)?[MW(t,i)]:null),[t,i]),s=(0,b.useCallback)((e=>{r(Tc,o,e)}),[o,r]);return v().createElement(UW,{className:a.selector,value:e&&e.data,attributeType:t,additionalItemsGroups:l,subattributesGroupTitle:(0,S.isReference)(t)?li().text("Reference attributes"):"",onSelect:s,onRestoreFocus:n.onRestoreFocus,onOpenPopup:n.onOpen,disableRestoreFocus:n.disablePopoverRestoreFocus,disableEnforceFocus:n.disablePopoverRestoreFocus})}));BW.displayName="ConditionAttributeSelector";const zW=e=>!(e&&e.data),HW=(0,_.pathEq)(["data","fieldName"],Z.E_),YW=(0,wp.Z)({selector:{width:"190px"}}),WW=(0,b.memo)((({rowData:e,rowContext:{dispatchGroupAction:t},textFieldInputRef:r})=>{const n=YW(),a=e&&e.id,i=(0,b.useCallback)((e=>t(Sc,a,e.value)),[t,a]);return v().createElement(xY,{height:40,className:n.selector,attribute:e,textFieldInputRef:r,isDisabled:zW(e),onChange:i})}));WW.displayName="ConditionFilterSelector";const GW=(0,wp.Z)({input:{margin:0,borderRadius:"4px"},root:{borderRadius:"4px 4px 0 0",padding:0,display:"flex",alignItems:"center",margin:0},entitySelector:{width:"100%"},entitySelectorLabel:{"&:not($entitySelectorLabelShrink)":{transform:"translate(12px, 10px)"}},entitySelectorLabelShrink:{}}),qW=(0,b.memo)((({condition:e,dispatchGroupAction:t})=>{const{values:r=[],data:{attrType:n,fieldName:a}={},filter:i}=e,o=GW(),l=(0,mp.useSelector)(k().selectors.getMetadata),s=(0,mp.useSelector)((e=>k().selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),c=(0,b.useCallback)((r=>t(xc,e.id,r)),[t,e.id]),u=(0,b.useCallback)((({uri:e,type:t,label:r})=>{c([{entityUri:e,entityType:t,entityLabel:r}])}),[c]),p=(0,S.getAttrDataTypeDefinition)(n),d=(0,S.getDataTypeDefinitionForFilterValue)(p,i);return HW(e)?v().createElement(fU,{className:o.entitySelector,entity:r[0],entityTypesUris:(0,ni.l0)((0,S.getReferencedEntityTypeUriFromAttrType)(n)),metadata:l,mode:S.Mode.Editing,globalSearchRequestOptions:s,onChange:u,height:40,disableLinkClick:!0,TextFieldProps:{InputLabelProps:{classes:{root:o.entitySelectorLabel,shrink:o.entitySelectorLabelShrink}}}}):v().createElement(AY.n,{filter:{filter:i,fieldName:a,values:r||[]},onChange:c,dataTypeDefinition:d,fullWidth:!0,TextFieldProps:{InputProps:{classes:{root:o.input}}},color:"primary",classes:{root:o.root},orientation:"horizontal"})}));qW.displayName="ConditionValuesEditor";const ZW=(0,wp.Z)({root:{width:"100%",display:"flex",minHeight:"40px",alignItems:"flex-start",boxSizing:"border-box"}}),$W=(0,b.memo)((({rowData:e,rowContext:{dispatchGroupAction:t}})=>{const r=ZW(),n=zW(e),a=e&&(0,S.checkIfOptionHasValues)(e.filter);return v().createElement("div",{className:r.root},!n&&a&&v().createElement(qW,{condition:e,dispatchGroupAction:t}))}));$W.displayName="ConditionValuesEditorWrapper";const KW=(0,wp.Z)({root:{paddingTop:"8px",height:"24px",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:"0"}}),XW=(0,b.memo)((({rowData:e,rowContext:{dispatchGroupAction:t}})=>{const r=KW(),n=e&&e.id,a=(0,b.useCallback)((()=>t(Oc,n)),[n,t]);return e?v().createElement("div",{className:r.root},v().createElement(Ed.k,{tooltipTitle:li().text("Delete"),tooltipPlacement:"bottom",icon:Tp(),size:"M",onClick:a})):null}));XW.displayName="ConditionActions";const QW=(0,wp.Z)((e=>({row:{"&:hover $actions":{opacity:1}},logicOperatorContainer:{maxHeight:"40px"},caption:{color:e.palette.text.secondary},conditions:{backgroundColor:"rgba(0,0,0,0.032)",padding:"20px 15px",margin:"7px 0"},actions:{opacity:"0",transition:"opacity 0.3s"}}))),JW=({attributeType:e,conditions:t,groupId:r})=>{const n=QW(),a=(0,mp.useDispatch)(),i=(0,b.useCallback)(((e,...t)=>a(e(r,...t))),[r,a]),o=(0,b.useMemo)((()=>({root:n.row,logicOperatorContainer:n.logicOperatorContainer,actionsContainer:n.actions})),[n]);return v().createElement(v().Fragment,null,v().createElement(bf(),{variant:"caption",component:"div",className:n.caption},li().text("If the following conditions are met")),v().createElement(xH,{className:n.conditions,rowClasses:o,rowsData:t,AttributeSelectorComponent:BW,FilterSelectorComponent:WW,ValuesEditorComponent:$W,ActionsComponent:XW,attributeType:e,dispatchGroupAction:i}),v().createElement(bf(),{variant:"caption",component:"div",className:n.caption},li().text("Then perform the change")))},eG=(0,wp.Z)((e=>({complexRow:{borderBottom:_W,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"}})));function tG(){return tG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tG.apply(null,arguments)}const rG=(0,b.memo)((({id:e,fieldName:t,actions:r,conditions:n})=>{const a=eG(),i=(0,mp.useDispatch)(),o=(0,mp.useSelector)(Zc),l=(0,mp.useSelector)(k().selectors.getMetadata),s=(0,b.useMemo)((()=>{const e=(0,S.searchUriToAttrUri)(t,o);return(0,S.findAttributeTypeByUri)(l,e,o)}),[l,t,o]),c=!!n,u=((e,t)=>(0,_.any)((0,_.both)((0,_.pipe)((0,_.prop)("operation"),(0,_.includes)(_.__,[ra.d.AddNew,ra.d.ReplaceAllWith])),(0,_.pathEq)(["operationParameters","attributeTypeData","attributeType","uri"],t.uri)))(e))(r,s),p=(0,b.useCallback)((()=>i({type:Wn,payload:e})),[e,i]),d=(t={})=>v().createElement(PW,tG({key:t.id},t,{groupId:e,groupAttributeType:s,hasConditions:c}));return(0,b.useEffect)((()=>{c||0!==r.length||i(gc({id:e,groupId:void 0}))}),[e,c,r.length,i]),v().createElement("div",{className:a.complexRow},v().createElement("div",{className:a.header},v().createElement("div",{className:a.attributeLabel},s.label),v().createElement(Wh(),{disabled:u,color:"primary",className:a.conditionsToggleButton,onClick:p},c?v().createElement(v().Fragment,null,v().createElement(kW(),{className:a.conditionsToggleIcon}),li().text("Remove")," "):v().createElement(v().Fragment,null,v().createElement(yH(),{className:a.conditionsToggleIcon}),li().text("Add")," "),li().text("conditions"))),n&&v().createElement(JW,{attributeType:s,conditions:n,groupId:e}),v().createElement("div",{className:a.actionsBlock},r.map(d),d()))}));rG.displayName="ComplexActionRow";const nG=(0,wp.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"}});function aG(){return aG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aG.apply(null,arguments)}const iG=e=>"actions"in e?v().createElement(rG,aG({key:e.id},e)):v().createElement(PW,aG({key:e.id},e)),oG=()=>{const e=nG(),t=(0,mp.useSelector)(cu);return v().createElement("div",{className:e.wrapper},v().createElement("div",{className:e.container},t.map(iG),v().createElement(PW,null)))};var lG=r(99261),sG=r.n(lG),cG=r(26518),uG=r.n(cG),pG=r(60158),dG=r.n(pG),mG=r(61887),fG=r.n(mG);const yG=(0,wp.Z)((()=>({buttonWrapper:{position:"relative"},progress:{position:"absolute",left:"calc(50% - 12px)",top:"calc(50% - 12px)"}})));function gG(){return gG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gG.apply(null,arguments)}const hG=e=>{let{isInProgress:t,disabled:r,circularColor:n="primary",className:a,children:i}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isInProgress","disabled","circularColor","className","children"]);const l=yG();return v().createElement(Wh(),gG({},o,{className:O()(l.buttonWrapper,a),disabled:r||t}),i,t&&v().createElement("div",{className:l.progress,"data-reltio-id":"reltio-circular-load-indicator"},v().createElement(dm(),{size:24,color:n})))},EG=(0,wp.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)"},errorLabel:{color:"#dd2c00 !important"},warningLabel:{color:"#f9a825 !important"}}))),bG=({activeStep:e,steps:t,isPending:r=!1,shouldCompleteSteps:n=!0,onConfirm:a,onChangeStep:i})=>{const o=EG(),l=e===t.length-1,s=t=>{t!==e&&i(t)},c=(0,_.propOr)(!0,"enabled"),u=e=>{if(e>0){const r=e-1;c(t[r])?s(r):u(r)}},p=e=>{if(e<t.length-1){const r=e+1;c(t[r])?s(r):p(r)}},d=l&&!!a,m=d||(0,_.any)(c,(0,_.drop)(e+1,t));return v().createElement("div",{className:o.container},v().createElement("div",{className:o.placeholder}),v().createElement(sG(),{nonLinear:!0,activeStep:e,className:o.stepper},t.map((({label:t,enabled:a=!0,hasError:i,hasWarning:l},c)=>{const u=!a||r,p=n&&!u&&c<e;return v().createElement(uG(),{key:t,completed:p,disabled:u},v().createElement(dG(),{className:o.stepButton,onClick:()=>s(c),"data-reltio-id":`reltio-search-bulk-update-${c}`},v().createElement(fG(),{error:i||l,classes:{error:i?o.errorLabel:o.warningLabel}},t)))}))),v().createElement("div",{className:o.buttons},e>0&&v().createElement(Wh(),{variant:"outlined",className:o.backButton,onClick:()=>u(e),disabled:r,"data-reltio-id":"reltio-search-bulk-update-back"},li().text("Back")),v().createElement(hG,{variant:"contained",color:"primary",disabled:!m,isInProgress:r,onClick:l?a:()=>p(e),"data-reltio-id":"reltio-search-bulk-update-"+(l?"confirm":"continue")},d?li().text("Confirm"):li().text("Continue"))))},vG=()=>{const e=(0,mp.useDispatch)(),t=(0,mp.useSelector)(Gc),r=(0,mp.useSelector)(su),n=(0,mp.useSelector)(Wc),a=!(0,_.isNil)(n),i=(0,mp.useSelector)(du),o=(0,mp.useSelector)(mu),l=[{label:li().text("Select profiles")},{label:li().text("Select operation"),enabled:r},{label:li().text("Define changes"),enabled:r&&a&&n===Z.dV.UpdateProfiles},{label:li().text("Review changes"),enabled:r&&a&&(i||n===Z.dV.DeleteProfiles)}];return v().createElement(bG,{activeStep:t,steps:l,isPending:o,onChangeStep:t=>e((e=>({type:wn,payload:e}))(t)),onConfirm:()=>e({type:ea})})},TG=(0,wp.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"}}))),OG=({children:e,onClose:t})=>{const r=TG();return v().createElement(rF(),{position:"static",color:"default",className:r.appBar},v().createElement(aF(),{className:r.toolbar},v().createElement(Ed.k,{edge:"start",tooltipTitle:li().text("Close"),"aria-label":li().text("Close"),icon:Tp(),onClick:t,className:r.closeButton,size:"L","data-reltio-id":"reltio-search-bulk-update-close"}),v().createElement(bf(),{variant:"h6",className:r.title},e)),v().createElement(aF(),{className:r.toolbar},v().createElement(vG,null)))};OG.propTypes={children:dp().node,onClose:dp().func};const SG=OG,xG=(0,wp.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"}}))),CG=(0,_.equals)(Z.v6.include);function wG(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const AG=()=>{const e=xG(),t=(0,mp.useDispatch)(),r=(0,mp.useSelector)(k().selectors.getMetadata),n=(0,mp.useSelector)(Zc),a=(0,mp.useSelector)(au),i=(0,mp.useSelector)(Qc),o=(0,mp.useSelector)(ru),l=(0,mp.useSelector)(nu),s=(0,mp.useSelector)(Kc),c=(0,mp.useSelector)(eu),u=(0,mp.useSelector)(tu),p=(0,mp.useSelector)(qc),d=(0,mp.useSelector)(Jc),m=(0,mp.useSelector)(Xc),f=(0,b.useMemo)((()=>((e,t,r)=>(0,_.pipe)((0,_.map)((0,_.prop)("uri")),CG(e)?(0,_.intersection)(t):(0,_.without)(t))(r))(m,d,i)),[m,d,i]),y=((e,t)=>0!==e.length&&(e.length===t.length||null))(f,i),g=(0,b.useMemo)((()=>(0,Ai.oq)(r,n,a)),[r,n,a]),h=(0,b.useCallback)((({field:e,order:r})=>t((({field:e,order:t})=>({type:kn,payload:{field:e,order:t}}))({field:r?e:null,order:r}))),[t]),E=(0,b.useCallback)((({what:e,where:r})=>{const n=(0,_.move)(e.columnIndex,r.columnIndex,a);t(mc(n))}),[t,a]),T=(0,b.useCallback)((({columns:e})=>{const r=(0,Ai.tU)(e,a);t(mc(e)),r&&t(cc())}),[t,a]),O=(0,b.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){wG(e,t,r[t])}))}return e}({},t,{size:e[r].size})));t(mc(r))}),[t,a]),S=(0,b.useCallback)(((e,r)=>{t(e?((e,t)=>({type:_n,payload:{uri:e,checked:t}}))(e,r):{type:In,payload:!y})}),[y,t]),x=(0,b.useRef)(null);return v().createElement("div",{className:e.tableContainer},p&&v().createElement(CE.z,null),v().createElement(of,{entities:i,entityTypeUri:n,headColumns:a,additionalColumns:g,canCheck:!0,onCheck:S,checkedEntitiesUris:f,headerCheckboxState:y,dndColumnReorderingEnabled:!0,sortField:o,sortOrder:l,onSort:h,onReorderingColumn:E,onChangeColumnsList:T,onChangeColumnsSize:O,entitiesTableRef:x}),s>Z.Tu[0]&&v().createElement("div",{className:e.pagination},v().createElement(yE.Z,{count:s,rowsPerPageOptions:Z.Tu,rowsPerPage:u||Z.Tu[0],page:c||0,onChangePage:e=>t(dc(e)),onChangeRowsPerPage:e=>t((e=>({type:Pn,payload:e}))(e)),basicTableRef:x})))},RG=(0,wp.Z)((e=>({tableContainer:{display:"flex",flexDirection:"column",backgroundColor:"#fff",width:"100%",margin:"30px 60px",padding:"24px"},title:{fontSize:"14px",fontWeight:500,letterSpacing:"0.1px",lineHeight:"24px",color:e.palette.text.secondary,marginBottom:"6px"},label:{color:e.palette.text.secondary,fontSize:"14px",letterSpacing:0,lineHeight:"32px",paddingLeft:"7px"},radioButton:{padding:"0 9px"}}))),_G=()=>{const e=RG(),t=(0,mp.useDispatch)(),r=(0,mp.useSelector)(Wc),n=(0,mp.useSelector)(k().selectors.getCanUserDeleteProfiles);(0,b.useEffect)((()=>{(0,_.isNil)(r)&&t(yc(Z.dV.UpdateProfiles))}),[r,t]);const a=(0,_.pipe)(xp.NA,yc,t);return v().createElement("div",{className:e.tableContainer},v().createElement(bf(),{className:e.title},li().text("Choose Bulk Update Operation")),v().createElement(hh(),{value:r,onChange:a},v().createElement(bh(),{classes:{label:e.label},value:Z.dV.UpdateProfiles,control:v().createElement(yh(),{className:e.radioButton}),label:li().text("Update Profiles - Update attribute values of selected profiles")}),v().createElement(bh(),{disabled:!n,classes:{label:e.label},value:Z.dV.DeleteProfiles,control:v().createElement(yh(),{className:e.radioButton}),label:li().text("Delete Profiles - Delete selected profiles")})))};var IG=r(49850),NG=r.n(IG),PG=r(28012),DG=r.n(PG),kG=r(18878),LG=r.n(kG),UG=r(70918),jG=r.n(UG),FG=r(51159),MG=r.n(FG),VG=r(35681),BG=r.n(VG);const zG=({value:e,attributeType:t,lookups:r})=>((0,S.isLookupAttrType)(t)&&"string"==typeof e&&(e={lookupCode:e,value:(0,S.getResolvedLookupValue)(r,(0,S.getAttrTypeLookupCode)(t),e)}),v().createElement(Hd.x,{dataTypeDefinition:(0,S.getAttrDataTypeDefinition)(t),value:e})),HG=({operation:e})=>v().createElement(v().Fragment,null,Z.WN[e]),YG=({conditions:e,attributesPresentation:t,metadata:r,lookups:n})=>{if((0,S.isEmptyValue)(e))return v().createElement(v().Fragment,null,"-");const a=(0,S.buildAttributesReadableQuery)(r,t,n,e,!1);return v().createElement(Qz,{readableQuery:a})},WG="8px",GG="1px",qG="1px solid #AFD4E9",ZG=(0,wp.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:GG,left:WG,top:0,borderLeft:qG}},scaffoldHalfVert:{"&:before":{content:'""',position:"absolute",display:"block",boxSizing:"border-box",height:"50%",width:GG,left:WG,top:0,borderLeft:qG}},scaffoldHor:{"&:after":{content:'""',position:"absolute",display:"block",boxSizing:"border-box",height:GG,width:"5px",left:WG,top:"50%",borderBottom:qG}},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%"}}))),$G=({attributeTypeData:{pathToTitle:e,title:t}})=>{const r=ZG();return Boolean(e&&e.length>2)?v().createElement(sg,{placement:"bottom-start",pathToTitle:e},v().createElement("span",{className:r.nestedLabel},t)):v().createElement(v().Fragment,null,t)};function KG(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function XG(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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const JG={EMPTY:"empty",FULL_VERT:"full_vert",FULL_VERT_HOR:"full_vert_hor",HALF_VERT_HOR:"half_vert_hor"},eq=e=>e.map(((t,r)=>(({hasLowerSubAttrs:e,isFirstValue:t,isLastScaffold:r})=>{const n=r&&t;return e?n?JG.FULL_VERT_HOR:JG.FULL_VERT:n?JG.HALF_VERT_HOR:JG.EMPTY})(XG({},t,{isLastScaffold:r===e.length-1})))),tq=({operation:e,operationParameters:t})=>(0,S.wrapInArrayIfNeeded)(XG({},t,{operation:e})),rq=(e,t,r=[],n=[])=>{const a=(0,S.findAttributeTypeByUri)(e,t.type),i=a.label||a.name,o={attributeTypeData:{attributeType:a,title:i,pathToTitle:[...r,i]},scaffolds:eq(n),pin:t.pin};if((0,S.isComplexAttribute)(a)){const a=Object.values(t.value),l=a.flatMap(((t,o)=>t.flatMap(((t,l)=>{const s={hasLowerSubAttrs:a.length-o-1>0,isFirstValue:0===l};return rq(e,t,[...r,i],[...n,s])}))));return[o,...l]}return[XG({},o,{attributeValue:(0,S.getAttributeValue)(t)})]},nq=(0,_.curry)(((e,{operation:t,operationParameters:r})=>{const{attributeValue:n,attributeTypeData:a}=r,i=KG(r,["attributeValue","attributeTypeData"]),[o,...l]=rq(e,n,a.pathToTitle.slice(0,-1));return[XG({},o,{operation:t},i),...l]})),aq=(0,_.curry)(((e,{operation:t,operationParameters:r})=>{const{attributeValue:n,attributeTypeData:a}=r,i=KG(r,["attributeValue","attributeTypeData"]),[o,...l]=rq(e,n,a.pathToTitle.slice(0,-1)),{label:s,refEntity:c}=n,[{objectURI:u,type:p}]=c;return[XG({},o,{operation:t},i,{attributeValue:{entityUri:u,entityLabel:s,entityType:p}}),...l]})),iq=(0,_.curry)(((e,t)=>(0,_.cond)([[Fc,nq(e)],[Mc,aq(e)],[_.T,tq]])(t))),oq=(0,_.curry)(((e,t)=>(0,_.pipe)((0,_.defaultTo)([]),(0,_.chain)((0,_.ifElse)(Ac,(0,_.pipe)(Rc,oq(e)),iq(e))))(t))),lq=({scaffold:e})=>{const t=ZG();return v().createElement("div",{className:O()(t.scaffold,{[t.scaffoldFullVert]:e===JG.FULL_VERT||e===JG.FULL_VERT_HOR,[t.scaffoldHalfVert]:e===JG.HALF_VERT_HOR,[t.scaffoldHor]:e===JG.FULL_VERT_HOR||e===JG.HALF_VERT_HOR})})};lq.propTypes={scaffold:dp().oneOf((0,_.values)(JG))};const sq=({scaffolds:e})=>{const t=ZG();return v().createElement("div",{className:t.scaffoldsContainer},e.map(((e,t)=>v().createElement(lq,{key:t,scaffold:e}))))};sq.propTypes={scaffolds:dp().arrayOf(lq.propTypes.scaffold)};const cq=sq,uq=({children:e})=>{const t=ZG();return v().createElement("div",{className:t.noWrapContainer},e)};uq.propTypes={children:dp().node};const pq=uq,dq=({pin:e,addParent:t})=>{const r=ZG();return v().createElement(pq,null,v().createElement("div",{className:O()(r.optionContainer,{[r.opaque]:!e})},v().createElement(aW,null)),v().createElement("div",{className:O()(r.optionContainer,{[r.opaque]:!t})},v().createElement(oW,null)))};dq.propTypes={pin:dp().bool,addParent:dp().bool};const mq=dq,fq=({entity:{entityLabel:e,entityUri:t},attributeType:r})=>{const n=ZG(),a=(0,mp.useSelector)((e=>k().selectors.getModifiedEntity(e,t)))||null,i=(0,mp.useSelector)(k().selectors.getMetadata),o=(0,b.useCallback)((()=>{const e=(0,S.getReferencedEntityTypeUriFromAttrType)(r),t=(0,S.getEntityType)(i,e);return(0,S.evaluateDeepEntityLabel)(a,t.dataLabelPattern)}),[r,i,a]),l=a?o():e;return v().createElement(pq,null,(0,S.getLabel)(l),(0,S.isTempUri)(t)&&v().createElement("div",{className:n.newIcon},li().text("New")))},yq=(0,wp.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%"}}))),gq=()=>{const e=yq(),t=(0,mp.useSelector)(uu),r=(0,mp.useSelector)(k().selectors.getMetadata),n=(0,mp.useSelector)(k().selectors.getAttributesPresentation),a=(0,mp.useSelector)(k().selectors.getLookups),i=(0,b.useMemo)((()=>oq(r,t)),[t,r]);return v().createElement(jG(),{className:e.tableContainer,component:LI()},v().createElement(NG(),{className:e.table},v().createElement(MG(),null,v().createElement(BG(),null,v().createElement(LG(),{className:e.attributeColumn},li().text("Attribute")),v().createElement(LG(),{className:e.conditionColumn},li().text("Condition")),v().createElement(LG(),{className:e.operatorColumn},li().text("Operator")),v().createElement(LG(),{className:e.valueColumn,colSpan:2}),v().createElement(LG(),{className:e.valueColumn}),v().createElement(LG(),{className:e.optionsColumn}))),v().createElement(DG(),null,i.map((({scaffolds:e,attributeTypeData:t,conditions:i,operation:o,attributeValueToFind:l,attributeValue:s,pin:c,addNestedAttribute:u},p)=>{const d=!(0,_.isNil)(s),m=!(0,_.isNil)(l);return v().createElement(BG(),{key:p},v().createElement(LG(),null,v().createElement(pq,null,e&&v().createElement(cq,{scaffolds:e}),v().createElement($G,{attributeTypeData:t}))),v().createElement(LG(),null,v().createElement(YG,{attributesPresentation:n,metadata:r,lookups:a,conditions:i})),v().createElement(LG(),null,o&&v().createElement(HG,{operation:o})),v().createElement(LG(),null,m&&v().createElement(zG,{lookups:a,attributeType:t.attributeType,value:l})),v().createElement(LG(),{align:"right"},m&&d&&v().createElement(pq,null,v().createElement("span",null,li().text("with")))),v().createElement(LG(),null,d&&((0,S.isReference)(t.attributeType)?v().createElement(fq,{entity:s,attributeType:t.attributeType}):v().createElement(zG,{lookups:a,attributeType:t.attributeType,value:s}))),v().createElement(LG(),{align:"right"},v().createElement(mq,{pin:c,addParent:u})))})))))},hq=(0,wp.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}}}))),Eq=()=>{const e=hq(),t=(0,mp.useSelector)(Wc),r=(0,mp.useSelector)(lu);return t===Z.dV.UpdateProfiles?v().createElement(gq,null):v().createElement("div",{className:e.tableContainer},v().createElement("div",{className:e.text},v().createElement("p",null,`${li().text("Please confirm that you wish to start deletion of the selected")}`,v().createElement("b",null,` ${li().number(r,"0,0")} `),li().text(" profiles.")),v().createElement("p",null,li().text("Click on Confirm to proceed."))))},bq=(0,wp.Z)((()=>({contentRoot:{padding:"0 0 5px",position:"relative",backgroundColor:"#FAFAFA"},tenantLabel:{marginLeft:"23px"}}))),vq=()=>{const e=bq(),t=(0,mp.useSelector)(Ri.Ue),r=(0,mp.useSelector)(Gc),n=(0,mp.useDispatch)(),a=()=>n(wi(!1));return v().createElement(gj(),{fullScreen:!0,open:t,onClose:a,disableEnforceFocus:!0},v().createElement(SG,{onClose:a},li().text("Bulk update"),v().createElement(eW,{className:e.tenantLabel})),v().createElement(rW,null),v().createElement(eF(),{classes:{root:e.contentRoot}},(()=>{switch(r){case 0:return v().createElement(AG,null);case 1:return v().createElement(_G,null);case 2:return v().createElement(oG,null);case 3:return v().createElement(Eq,null)}})()))},Tq="1px solid rgba(0, 0, 0, 0.33)",Oq=(0,wp.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:Tq},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:Tq,boxShadow:"0 1px 3px 0 rgba(0,0,0,0.12)"}}))),Sq=(0,ld.T)(Tf()),xq=(0,mp.connect)((e=>({isReadyAppData:!!(0,Ri.$s)(e),openAdvancedSearch:(0,Ri.IJ)(e),tenant:k().selectors.getTenant(e)})))((({openAdvancedSearch:e,isReadyAppData:t,tenant:r,dispatch:n})=>{const a=(0,b.useCallback)((()=>{n({type:L.k.CONVERT_FROM_ADVANCED_SEARCH}),n(hi(!1))}),[n]),i=(0,b.useCallback)((()=>{n(hi(!0)),n({type:mt})}),[n]),[o,l]=(0,b.useState)(!0),s=(0,b.useCallback)((e=>{l(e<=0)}),[]),c=Oq(),u=!e;return(0,b.useEffect)((()=>()=>S.memoizeWith.clearCache()),[r]),t?v().createElement(v().Fragment,null,v().createElement("div",{className:c.root},v().createElement(hf,{variant:"persistent",anchor:"left",open:u,classes:{root:c.drawer,paper:c.drawerPaper,docked:c.docked},"data-reltio-id":"reltio-search-facet-search-panel"},v().createElement(Sq,{tooltipTitle:li().text("Switch to Advanced search"),tooltipPlacement:"bottom-end",variant:"extended",classes:{root:c.buttonRoot,extended:c.buttonExtended},onClick:i,"data-reltio-id":"reltio-search-advanced-search-button"},v().createElement(Sf(),{color:"primary",className:c.menuIcon}),v().createElement("span",{className:c.buttonLabel},li().text("Advanced search")),v().createElement(Cf(),{color:"action",className:c.goToActionIcon})),v().createElement(bf(),{variant:"button",classes:{root:O()(c.quickFilterRoot,{[c.withBottomBorder]:!o})}},li().text("Quick filters")),v().createElement(kh,{onScroll:s})),v().createElement(Uh,{className:O()(c.mainContent,{[c["mainContent--shifted"]]:u})},v().createElement(KY,{isOpenAdvancedSearch:e,onCloseAdvancedSearch:a}))),v().createElement(Mh,null),v().createElement(Qh,null),v().createElement(vq,null)):null})),Cq=pf()({productionPrefix:"searchTable",disableGlobal:!0,seed:"srch"});S.userPreferencesComparator.register("searchState",((e,t)=>(0,S.looseEquals)((0,_.omit)(["query"],e),(0,_.omit)(["query"],t))));const wq=()=>v().createElement(lf.DynamicModuleLoader,{modules:[up()]},v().createElement(mf(),{generateClassName:Cq},v().createElement(cf._,{dateAdapter:sf.Q},v().createElement(xq,null))))}}]);
|