@reltio/remotes 1.4.1135 → 1.4.1136

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.
Files changed (4) hide show
  1. package/6940.js +1 -1
  2. package/8988.js +1 -1
  3. package/9838.js +1 -1
  4. package/package.json +1 -1
package/6940.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[6940],{16940:(e,t,n)=>{n.d(t,{_:()=>pa,t:()=>Oa});var r=n(24328),o=n.n(r),a=n(52730),l=n(8598),i=n(17440),s=n(36138),c=n(44443),u=n(22664),p=n(39450),d=n(60115),m=n(585),g=n(99493),f=n(87918),b=n.n(f),h=n(3096),y=n.n(h),v=n(87638),x=n(2804),E=n(7718),w=n(3515),C=n(17554),S=n(61756),P=n(57730),O=n(76536),N=n(26481),k=n(49759),Z=n(94150),T=n(26005),R=n(99136),j=n(21077),D=n(67268),I=n(71153),L=n.n(I),A=n(8962);const M=o().createContext(null);M.displayName="SingleAttributeContext";var U=n(60995),z=n(10237),V=n(58662),F=n(94079),H=n(93416),B=n(75512),W=n(30553),q=n(91181),G=n(32152),$=n(36444),_=n(79692);const Q=(0,_.Z)((()=>({triggerButton:{minWidth:0,color:"rgba(0,0,0,0.54)",width:"36px"},popupContent:{paddingTop:"19px",paddingBottom:"23px",paddingLeft:"23px",paddingRight:"23px",maxWidth:"180px",width:"40%"},checkboxControlRoot:{marginTop:"6px",marginLeft:"-12px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"}}))),X=e=>{let{className:t}=e;const n=Q(),a=(0,r.useRef)(),[l,i]=(0,r.useState)(!1),{showInactive:s,toggleShowInactive:c}=(0,r.useContext)(M),u=()=>i((e=>!e));return o().createElement(o().Fragment,null,o().createElement(F.Button,{ref:a,classes:{root:L()(n.triggerButton,t)},onClick:u},o().createElement($.Z,null)),o().createElement(F.Popover,{open:l,classes:{paper:n.popupContent},anchorEl:a.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(F.FormControlLabel,{classes:{root:n.checkboxControlRoot,label:n.checkboxControlLabel},control:o().createElement(F.Checkbox,{className:n.checkboxControlCheckbox,checked:s,onChange:e=>c(e.target.checked)}),label:b().text("Show inactive values")})))},Y=(0,_.Z)((()=>({root:{padding:"0 4px 0 16px"},totalCaption:{lineHeight:"19px",fontSize:"14px",letterSpacing:"0.24px",color:"rgba(0,0,0,0.6)",flexShrink:0,justifyContent:"flex-start",paddingTop:"16px",paddingBottom:"13px"},ovIcon:{marginTop:"2px",marginLeft:"5px"}}))),K=e=>{let{caption:t,totalVisibleValues:n,showInactiveValuesMenu:a}=e;const l=Y(),{searchQuery:i,setSearchQuery:s,setPage:c,totalNonVisibleValues:u,nonVisibleValues:p,attributeType:d}=(0,r.useContext)(M);return o().createElement(H.Z,{title:b().text(t),className:l.root},o().createElement(B.Z,{widthToHide:500},o().createElement(W.Z,{height:24,margin:16}),o().createElement(F.Typography,{className:l.totalCaption,variant:"caption"},b().number(n)," ",1===n?b().text("item"):b().text("items"))),o().createElement(q.Z,{nonOvTotal:u,className:l.ovIcon,nonOvValues:p,attributeType:d}),o().createElement(G.i,{query:i,onChange:e=>{s(e),c(0)}}),a&&o().createElement(X,null))};var J=n(65549),ee=n(93140),te=n(76134),ne=n(96698);const re=(0,_.Z)((e=>({moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},divider:{margin:"0 -16px 8px",backgroundColor:"rgba(0,0,0,0.12)"},ovFalse:e.inactive}))),oe=g.nIW,ae=(e,t)=>"object"==typeof e?Object.values(e).some((e=>e.some((e=>{let{value:n}=e;return ae(n,t)})))):g.P6Y.strings.search(String(e),t),le=async e=>{let{metadata:t,entity:n,attributeTypeUri:r,defaultMaxValues:o=1/0,offset:a=0,searchQuery:l=""}=e;const s=(0,i.pipe)(g.XtP,(0,i.filter)((e=>{let{value:t}=e;return ae(t,l)})))(t,n,r),c=(0,i.filter)(g.OXP,s);return{[(0,g.xy8)(r)]:{[oe(r)]:c.slice(a,a+o),paging:{[r]:{totalOvValues:c.length,totalValues:s.length}}}}};function ie(){return ie=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ie.apply(this,arguments)}function se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ce(e,t,n[t])}))}return e}function ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ue=[],pe=e=>{let{values:t,attributeType:n,parentUri:l,showInactive:s}=e;const c=re(),{uri:u,required:d,cardinality:m,name:f}=n,h=(0,a.useDispatch)(),y=(0,r.useContext)(p.m),x=(0,a.useSelector)(v.ZP.selectors.getEntity),E=(0,a.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,x.uri)||{})),w=(0,a.useSelector)((e=>v.ZP.selectors.getActiveErrorsForAttributesPager(e,l,n))),C=(0,a.useSelector)((e=>(0,g.tQX)(l,n,v.ZP.selectors.getProfileErrors(e)))),S=(0,a.useSelector)(v.ZP.selectors.getMode),P=(0,g.xy8)(n),O=(0,i.pipe)((0,i.pathOr)(ue,[P,f]),(0,i.map)((0,i.prop)("uri")))(x),N=(0,i.pathOr)(ue,[P,f],E),k=N.map((0,i.prop)("uri")),Z=(0,g.ZiX)(x.uri),T=(0,r.useRef)((0,g.gjI)({parentUri:l,attributeType:n})),R=(0,g.O27)(N),j=d&&R,D=j?[T.current]:N.filter((0,i.pipe)((0,i.prop)("uri"),g.ZiX)),I=(0,r.useCallback)((e=>(0,i.pipe)(v.N5.actions.addAttributes,h)(e.map((e=>se({},e,{viewId:y}))))),[y,h]),A=(0,r.useCallback)((e=>(0,i.pipe)(v.N5.actions.modifyAttribute,h)(se({},e,{viewId:y}))),[y,h]),M=(0,r.useCallback)((e=>(0,i.pipe)(v.N5.actions.removeAttribute,h)(se({},e,{viewId:y}))),[y,h]),U=(0,r.useCallback)((0,i.pipe)(v.N5.errors.actions.errorDeactivated,h),[h]),z=(0,r.useCallback)((()=>{const e={parentUri:l,attributeType:n};return I(j&&!(0,g.YkM)(n.type)?[e,e]:[e])}),[I,l,n,j]),V=(0,g.Vg3)({attributeType:n,mode:S}),H={attributeType:n,errors:w,crosswalks:E.crosswalks,mode:S,onAddAttributes:I,onChangeAttribute:A,onDeactivateError:U,showNonOv:s};return o().createElement("div",null,o().createElement(ee.Z,{cardinality:m}),o().createElement(te.Z,{message:C}),V&&o().createElement(F.Button,{color:"primary",onClick:z,className:c.moreButton},o().createElement(J.Z,{classes:{root:c.icon}}),o().createElement("div",{className:c.buttonLabel},b().text("Add"))),D.map(((e,t)=>o().createElement(ne.Z,ie({key:e.uri},H,{attributeValue:e,lazy:j&&!d,showEmptyEditors:Z,ownError:(0,g.ADq)(e,t,u,w),onDeleteAttribute:M})))),D.length>0&&t.length>0&&o().createElement(F.Divider,{className:c.divider}),t.map((e=>{const t=N.find((0,i.propEq)("uri",e.uri)),n=t||e,r=O.includes(n.uri)&&!k.includes(n.uri),a=!r&&t&&!((e,t)=>{const n=(0,i.is)(Object,e.value)||(0,i.is)(Object,t.value)?(0,i.over)((0,i.lensPath)(["value"]),(0,g.vKJ)({valueTransformer:(0,i.unless)(g.OXP,(0,i.omit)(["value"])),deleteEmptyComplex:!0})):i.identity;return(0,i.equals)(n(e),n(t))})(t,e),l=(0,i.cond)([[(0,i.always)(r),(0,i.always)("deleted")],[(0,i.always)(a),(0,i.always)("edited")]])();return o().createElement("div",{key:n.uri,className:L()({[c.ovFalse]:!(0,g.OXP)(n)})},o().createElement(ne.Z,ie({},H,{attributeValue:n,ownError:(0,g.ADq)(n,null,u,w),onDeleteAttribute:M,state:l})))})))};var de=n(81303);const me=(0,_.Z)((e=>({ovFalse:e.inactive}))),ge=e=>{let{values:t,attributeType:n,showInactive:r}=e;const a=me();return o().createElement(o().Fragment,null,t.map((e=>o().createElement("div",{key:e.uri,className:L()({[a.ovFalse]:!(0,g.OXP)(e)})},o().createElement(de.Z,{attributeValue:e,attributeType:n,showNonOv:r})))))},fe=(0,_.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",padding:"4px 16px 9px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"},pagination:{flexGrow:0,flexShrink:0}}))),be=e=>{let{config:t,className:n}=e;const{caption:l,max:i,showInactiveValuesMenu:s}=t,c=fe(),{values:u,totalVisibleValues:p,page:d,setPage:m,isLoading:g,hasPaging:f,attributeType:h,showInactive:y}=(0,r.useContext)(M),x=(0,a.useSelector)(v.ZP.selectors.getEntityUri),E=(0,a.useSelector)(v.ZP.selectors.getIsViewMode),w=(0,a.useSelector)(v.ZP.selectors.getIsEditableMode),C=(0,a.useSelector)(v.ZP.selectors.getPivotingAttributes),S=0!==u.length;return o().createElement(U.J.Provider,{value:C},o().createElement(z.Z,{className:L()(c.root,n)},o().createElement(K,{totalVisibleValues:p,caption:l,showInactiveValuesMenu:s}),o().createElement(F.Box,{className:c.content},(()=>{if(g)return o().createElement(R.Z,null);if(h){if(E&&S){const e={values:u,attributeType:h,showInactive:y};return o().createElement(ge,e)}if(w){const e={values:u,attributeType:h,parentUri:x,showInactive:y};return o().createElement(pe,e)}}return o().createElement(F.Typography,{className:c.noData},b().text("No data"))})()),f&&o().createElement(V.Z,{count:p,page:d,rowsPerPage:i,rowsPerPageOptions:[],onChangePage:m,classes:{root:c.pagination}})))};var he=n(67218),ye=n(20562);function ve(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const xe=(e,t,n)=>{const{attributeUri:o,max:l=15}=e,s=(0,a.useSelector)(v.ZP.selectors.getMetadata),[c,u]=(0,r.useState)([]),[p,d]=(0,r.useState)(null),[m,f]=(0,r.useState)(!1),b=(0,he._)(),h=(0,r.useRef)(null),y=(0,a.useDispatch)(),x=(0,a.useSelector)(v.ZP.selectors.getApiPath),E=(0,a.useSelector)(v.ZP.selectors.getTenant),w=n?v.ZP.selectors.getEntityWithDiff:v.ZP.selectors.getEntityWithoutDiff,C=(0,a.useSelector)(w),S=(0,a.useSelector)(v.ZP.selectors.getIsViewMode),P=(0,a.useSelector)(v.ZP.selectors.getIsHistoryModeEnabled),O=(0,a.useSelector)(v.ZP.selectors.getHistoryDiff),N=C.uri,k=oe(o),Z=(0,g.xy8)(o);h.current=(0,g.JQy)(C,N,k);const T=(0,r.useMemo)((()=>(0,g.zeJ)(s,o)),[s,o]),{globalFilter:R}=(0,a.useSelector)(v.ZP.selectors.getGlobalSearchRequestOptions),{showInactive:j}=t,D=(0,r.useCallback)((()=>{if(T&&(0,g.Uty)(T)&&!(0,g.ZiX)(N)&&(0,g.YOQ)(o)){f(!0);const{page:e,showInactive:n}=t,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["page","showInactive"]),a=(0,g.biM)(C)||P?le:g.KbL;b(a(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ve(e,t,n[t])}))}return e}({metadata:s,entity:C,apiPath:x,tenant:E,parentUri:N,defaultMaxValues:l,attributeTypeUri:o,offset:l*e,globalFilter:R,options:n?"":void 0},r))).then((e=>{const t=(0,i.path)([Z],e),n=(0,i.pathOr)([],[k],t);P||y(v.N5.actions.processNextPageOfAttributeValues({parentUri:N,attributeTypeUri:o,attributeTypeName:k,values:n})),u(n.map((e=>{var t;return(null===(t=h.current)||void 0===t?void 0:t.find((0,i.propEq)("uri",e.uri)))||e}))),d((0,i.path)(["paging",o],t))})).finally((()=>{f(!1)}))}else u([]),d(null)}),[x,N,E,o,l,s,t,R,T,P,O]);(0,r.useEffect)((()=>{D()}),[D]),(0,ye.D)((()=>{S&&D()}),[S]);const I=(0,i.partition)(g.OXP),[,L]=I(h.current||[]),A=j?[]:L,M=j?"totalValues":"totalOvValues",U=(0,i.ifElse)((0,i.has)(M),(0,i.prop)(M),(0,i.always)(c.length))(p),z=l<U,V=null!=p&&p.totalValues?p.totalValues-U:A.length;return{values:c,isLoading:m,hasPaging:z,totalVisibleValues:U,attributeType:T,totalNonVisibleValues:V,nonVisibleValues:A}};function Ee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var we=n(37152),Ce=n(31274),Se=n(79026),Pe=n(8818),Oe=n(90324),Ne=n(70595);const ke=o().createContext(null);ke.displayName="RelationsViewStateContext";const Ze=(0,_.Z)((e=>({button:{color:e.palette.text.secondary,width:"36px",minWidth:"36px"},popupContent:{padding:"19px 23px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"},divider:{backgroundColor:"rgba(0,0,0,0.1)",margin:"19px -23px"},title:{marginBottom:"30px"},sortControls:{display:"flex",alignItems:"center"},sortSelectorRoot:{flex:1,padding:"13px 16px",fontSize:"0.85rem"},sortSelectorMenuItem:{fontSize:"0.85rem"},sortOrderButton:{flexShrink:0,margin:"0 8px 0 7px"}}))),Te=e=>{let{className:t}=e;const n=Ze(),a=(0,r.useRef)(),{showInactive:l,toggleShowInactive:i,sortOrder:s,toggleSortOrder:c,sortOption:u,changeSortOption:p,sortOptions:d}=(0,r.useContext)(ke),[m,f]=(0,r.useState)(!1),h=()=>f((e=>!e)),y=!(0,g.O27)(d),v="asc"===s;return o().createElement(o().Fragment,null,o().createElement(F.Button,{ref:a,classes:{root:L()(n.button,t)},onClick:h},o().createElement($.Z,null)),o().createElement(F.Popover,{open:m,classes:{paper:n.popupContent},anchorEl:a.current,onClose:h,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(F.FormControlLabel,{classes:{label:n.checkboxControlLabel},control:o().createElement(F.Checkbox,{className:n.checkboxControlCheckbox,checked:l||!1,onChange:i}),label:b().text("Show inactive Relationships")}),y&&o().createElement(o().Fragment,null,o().createElement(F.Divider,{className:n.divider}),o().createElement(F.Typography,{className:n.title,variant:"h6"},b().text("Sort by")),o().createElement("div",{className:n.sortControls},o().createElement(Se.Z,{entries:d,TextFieldProps:{variant:"filled"},classes:{root:n.sortSelectorRoot,menuItem:n.sortSelectorMenuItem},fullWidth:!0,disableUnderline:!0,value:u,onChange:p,MenuProps:{getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"left"}}}),o().createElement(Pe.k,{tooltipTitle:v?b().text("Ascending"):b().text("Descending"),icon:v?Oe.Z:Ne.Z,onClick:c,className:n.sortOrderButton,size:"L"})))))};Te.displayName="FilterButton";const Re=Te,je=(0,_.Z)({header:{padding:"0 6px 0 16px"},totalCaption:{lineHeight:"19px",fontSize:"14px",letterSpacing:"0.24px",color:"rgba(0,0,0,0.6)",flexShrink:0,marginRight:"5px",justifyContent:"flex-start",paddingTop:"16px",paddingBottom:"13px"}});var De=n(61932),Ie=n(55847);const Le=o().createContext(null);function Ae(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Me(e,t,n[t])}))}return e}function Me(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ue=Math.pow(2,31)-1,ze=(0,_.Z)((()=>({tenant:{backgroundColor:"#0000EE",cursor:"pointer",position:"absolute",top:"8px",left:"22px",width:"10px",height:"10px",color:"white",fontSize:"10px",fontWeight:"bold",userSelect:"text",zIndex:1,display:"flex",alignItems:"center",justifyContent:"center"},button:{position:"relative"},badge:{fontSize:"10px",height:"14px",minWidth:"14px",width:"14px",fontWeight:"bold",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px",top:"4px"}})));var Ve=n(81137);const Fe=e=>{let{label:t}=e;const n=ze();return o().createElement(F.Badge,{classes:{anchorOriginTopRightRectangle:n.badgePosition,badge:n.badge},badgeContent:t},o().createElement(De.Z,null))},He=()=>{const{tenants:e,selectedTenant:t,onConfirmImport:n,onCancelConfirmation:l,onImportClick:i}=(()=>{var e;const t=(0,a.useSelector)(v.ZP.selectors.getDataTenants),n=(0,a.useDispatch)(),{config:o,reloadRelations:l}=(0,r.useContext)(Le),i=(0,a.useSelector)(v.ZP.selectors.getEntityUri),[s,c]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),d=(0,a.useSelector)(v.ZP.selectors.getDtssPath),m=(0,a.useSelector)(v.ZP.selectors.getTenant),f=[Ae({},o.content,{offset:0,max:null!==(e=o.maxDtssImport)&&void 0!==e?e:Ue})],h=(0,r.useCallback)((()=>{c([]),o.importFromDT&&!(0,g.ZiX)(i)&&Promise.all((t||[]).map((e=>(0,g.QXb)({entityUri:i,content:f,dtssPath:d,customerTenant:m,dataTenant:e.id}).then((t=>{let{hasNonImportedConnections:n}=t;return Ae({},e,{hasNonImportedConnections:n})}))))).then((e=>e.filter((e=>e.hasNonImportedConnections)))).then(c)}),[i,d,m,o,t]),y=(0,r.useCallback)((()=>{(0,g.MOC)({entityUri:i,content:f,dtssPath:d,customerTenant:m,dataTenant:u.id}).then((()=>{l(),h()})).catch((e=>n(v.ui.actions.errorSet((0,g.xU7)(e,b().text("Something went wrong")))))),p(null)}),[i,d,m,o,h,l,u,p]);(0,r.useEffect)((()=>{h()}),[h]);const x=(0,r.useCallback)((()=>p(null)),[]),E=(0,r.useCallback)((e=>p(e)),[]);return{tenants:s,selectedTenant:u,onConfirmImport:y,onCancelConfirmation:x,onImportClick:E}})(),s=ze(),c=1===e.length,u=c?0===e[0].label.indexOf("DT:")?e[0].label[3]:e[0].label[0]:e.length;return o().createElement(o().Fragment,null,!!e.length&&o().createElement(o().Fragment,null,c?o().createElement("div",{className:s.button},o().createElement(Pe.k,{size:"L",icon:De.Z,tooltipTitle:b().text("Import connections from ${label}",{label:e[0].label}),onClick:()=>i(e[0])}),o().createElement("div",{className:L()(s.tenant)},u)):o().createElement(Ie.Z,{menuId:"importDT-table-actions",buttonComponent:Pe.k,buttonProps:{tooltipTitle:b().text("Import connections"),size:"L",icon:()=>o().createElement(Fe,{label:u})},menuItems:e.map((e=>({onClick:()=>{i(e)},text:e.label})))}),o().createElement(Ve.Z,{open:!!t,title:b().text("Confirmation"),content:b().text("Import connections from ${label}?",{label:null==t?void 0:t.label}),discardCaption:b().text("Cancel"),saveCaption:b().text("Import"),onDiscard:l,onSave:n})))},Be=e=>{let{title:t,total:n}=e;const a=je(),{searchQuery:l,changeSearchQuery:i}=(0,r.useContext)(ke);return o().createElement(H.Z,{title:t||"",className:a.header},n>0&&o().createElement(B.Z,{widthToHide:400},o().createElement(W.Z,{height:24,margin:16}),o().createElement(F.Typography,{className:a.totalCaption,variant:"caption"},n>1?b().text("${count} items",{count:n}):b().text("${count} item",{count:n}))),o().createElement(G.i,{query:l,onChange:i}),o().createElement(He,null),o().createElement(Re,null))};var We=n(11013),qe=n(27604),Ge=n(22983),$e=n(31254),_e=n(31039);const Qe=(0,_.Z)((e=>({tooltip:e.tooltip,tooltipContent:{minWidth:"165px",padding:"4px 2px 2px"},label:{fontSize:"11px",lineHeight:"13px",fontWeight:500,margin:0,color:"white"},secondaryLabel:{color:"rgba(255, 255, 255, 0.7)",fontSize:"10px",marginTop:"4px",fontWeight:500,lineHeight:"11px"},progress:{marginTop:"4px",color:"#FFFFFF"}})));function Xe(){return Xe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xe.apply(this,arguments)}const Ye=e=>{let{label:t,entity:n,children:l}=e,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["label","entity","children"]);const c=Qe(),u=(0,he._)(),p=(0,a.useSelector)(v.ZP.selectors.getTenant),d=(0,a.useSelector)(v.ZP.selectors.getDtssPath),[m,f]=(0,r.useState)(!1),[b,h]=(0,r.useState)(null);(0,r.useEffect)((()=>{h(null)}),[n]);const y=(0,r.useCallback)((()=>{if(null!=n&&n.entityUri&&(0,i.isNil)(b)){const e=(0,i.ifElse)(g.biM,(e=>(0,g.vTU)({entityUri:e.entityUri,dataTenant:e.dataTenant,customerTenant:p,dtssPath:d})),(e=>(0,g.XkT)(e.entityUri)));f(!0),u(e(n)).then((e=>{let{secondaryLabel:t}=e;h(t)})).finally((()=>{f(!1)}))}}),[d,n,p,u,b]),x=o().createElement("div",{className:c.tooltipContent},o().createElement("div",{className:c.label},t),m&&o().createElement(F.CircularProgress,{size:16,classes:{colorPrimary:c.progress}}),b&&o().createElement("div",{className:c.secondaryLabel},b));return o().createElement(F.Tooltip,Xe({onOpen:y,title:x,disableFocusListener:!0,classes:{tooltip:c.tooltip}},s),l)},Ke=(e,t)=>{const{entity:n,relation:r}=e;return{entityType:(0,g.nt9)(t,null==n?void 0:n.entityType),entityLabel:(0,g.idV)(null==n?void 0:n.entityLabel),preparedUri:(0,g.wwR)({uri:null==n?void 0:n.entityUri,dataTenant:null==n?void 0:n.dataTenant}),relationLabel:(null==r?void 0:r.relationLabel)||(0,g.Lmx)(t,null==r?void 0:r.relationType)}};var Je=n(77277);const et=(0,_.Z)((()=>({container:{display:"flex"}})));function tt(){return tt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tt.apply(this,arguments)}const nt=e=>{let{acceptRelation:t,ignoreRelation:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["acceptRelation","ignoreRelation"]);const a=et();return o().createElement("div",{className:a.container},o().createElement(Je.Z,tt({onClick:t,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),b().text("Accept")),o().createElement(Je.Z,tt({onClick:n,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),b().text("Ignore")))},rt=(0,_.Z)((e=>({container:{display:"flex",flexDirection:"column",marginBottom:"2px"},row:{display:"flex",alignItems:"center",flexDirection:"row",minHeight:"24px",padding:"0 16px"},rowInactive:{background:e.inactiveBackground},entityAvatar:{height:"12px",width:"12px",fontSize:"11px",marginRight:"8px"},entityLabelContainer:{textDecoration:"none",cursor:"pointer",paddingRight:"8px"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},editButtonsContent:{marginLeft:"auto",flex:"0 0 40px"},editButtons:{padding:0},removed:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary,margin:"0 5px"}}))),ot=(0,r.memo)((e=>{let{connection:t,metadata:n,showControls:a,onRemoveRelation:l,onEditRelation:i,onAcceptRelation:s,onIgnoreRelation:c,renderRelationArrowButton:u}=e;const p=rt(),{entity:d,relation:m}=t,f=(0,g.$qe)(t),h=(0,g.xr3)(t),y=(0,g.iJH)(t),{entityType:v,entityLabel:x,preparedUri:E,relationLabel:w}=Ke(t,n),C=(0,g.Fn9)(m)&&(0,g.Fn9)(d),{canRemove:S,canUpdate:P}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:o,onEditRelation:a}=e;if((n===g.ARY.Editing||n===g.ARY.Suggesting)&&r){const{relation:{relationType:e}}=r,l=(0,g.$qe)(r),i=(0,g.V3K)(t,e);return{canRemove:o&&!l&&(0,g.Edd)(n,i),canUpdate:a&&!l&&(0,g.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:g.ARY.Editing,onRemoveRelation:l,onEditRelation:i,metadata:n,connection:t}),O=(0,r.useCallback)((()=>l(t.relation.relationUri)),[l,t]),N=(0,r.useCallback)((()=>i(t)),[i,t]),k=(0,r.useCallback)((()=>{s(t)}),[s,t]),Z=(0,r.useCallback)((()=>c(t)),[c,t]),T=(S||P)&&a&&!t.suggested?o().createElement(o().Fragment,null,P&&o().createElement(Pe.k,{icon:qe.Z,size:"XS",onClick:N,tooltipTitle:b().text("Edit")}),S&&o().createElement(Pe.k,{icon:Ge.Z,size:"XS",onClick:O,tooltipTitle:b().text("Remove")})):void 0,R=t.suggested?o().createElement(nt,{acceptRelation:k,ignoreRelation:Z,size:"small",disabled:y}):void 0,j=y?b().text("ignored"):b().text("edited");return o().createElement("div",{className:L()(p.container,{[p.rowInactive]:!C},{[p.removed]:f||y})},o().createElement("div",{className:p.row},u&&u(),o().createElement($e.Z,{className:p.entityAvatar,entityType:v}),o().createElement(_e.Z,{value:E,className:p.entityLabelContainer},o().createElement(Ye,{label:x,entity:d},o().createElement("span",{className:p.entityLabel},x)),(h||y)&&o().createElement(F.Typography,{variant:"caption",className:p.editedLabel},"(",j,")"),w&&o().createElement("span",{className:p.relationLabel},`, ${w}`)),o().createElement("div",{className:p.editButtonsContent},T),R))}));ot.displayName="EditableRelationItem";const at=ot,lt=(e,t)=>{const n=(e,t)=>(t?(0,g.VGB)(t):[]).map((t=>({type:t,direction:e===g.Nsj.IN?g.Nsj.IN:g.Nsj.OUT})));return n(g.Nsj.IN,e).concat(n(g.Nsj.OUT,t))[0]};function it(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var st=n(98989),ct=n(83543);const ut=(0,_.Z)({arrowIcon:{fontSize:"16px",marginRight:"6px"}}),pt=e=>{let{onClick:t,connection:n,config:r,showSecondLevel:a}=e;const l=ut(),{parentEntityUri:i}=n,{contentSecondLevel:s}=r,c={onClick:t,className:l.arrowIcon};return i||!s||(0,g.xvW)(n)?null:a?o().createElement(ct.Z,c):o().createElement(st.Z,c)},dt=(0,_.Z)({row:{display:"flex",alignItems:"center",width:"100%"},secondLevelContent:{paddingLeft:"24px"}}),mt=e=>{let{config:t,connection:n,children:l}=e;const i=dt(),{showInactive:s}=(0,r.useContext)(ke),{connections:c,showSecondLevel:u,toggleShowSecondLevel:p,loadRelations:d,loading:m,total:f}=(e=>{let{config:t,connection:n,relationActivityFilter:o}=e;const l=(0,a.useDispatch)(),[i,s]=(0,r.useState)(!1),[c,u]=(0,r.useState)(!1),[p,d]=(0,r.useState)(0),{contentSecondLevel:m}=t,{entity:f}=n,b=(0,a.useSelector)((e=>v.ZP.selectors.getConnectionsWithDraftsByViewId(e,t.id,f.entityUri)))||[],{activityFilter:h}=(0,a.useSelector)(v.ZP.selectors.getGlobalSearchRequestOptions)||{},y=(0,r.useCallback)((()=>{const e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){it(e,t,n[t])}))}return e}({},m,{returnObjects:!0,returnDates:!0,activeness:{relation:o||g.Ng6.ALL,entity:h}});u(!0),(0,g.N6e)(f.entityUri,[e]).then((e=>{const{connections:n,total:r}=e[0];n&&l(v.N5.relations.actions.secondLevelRelationsLoaded({connections:n,parentEntityUri:f.entityUri,id:t.id})),d(r),u(!1)}))}),[t.id,m,l,f.entityUri,h,o]),x=(0,r.useCallback)((()=>{i||n.connections||y(),s((e=>!e))}),[y,n.connections,i]);return{connections:b,showSecondLevel:i,toggleShowSecondLevel:x,loadRelations:y,loading:c,total:p}})({config:t,connection:n,relationActivityFilter:s?g.Ng6.ALL:g.Ng6.ACTIVE_ONLY}),b=(0,r.useMemo)((()=>(0,g.Px$)(c)),[c]);return o().createElement(o().Fragment,null,l((()=>o().createElement(pt,{onClick:p,connection:n,config:t,showSecondLevel:u}))),u&&o().createElement(Ce.X.Provider,{value:b},o().createElement("div",{className:i.secondLevelContent},o().createElement(qt,{isLoading:m,config:t,loadRelations:d,connections:c,total:f,parentEntityUri:n.entity.entityUri}))))},gt=(0,_.Z)((e=>({moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px",marginLeft:"16px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},divider:{margin:"0 0 8px",backgroundColor:"rgba(0,0,0,0.12)"},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),ft=e=>{let{className:t,connections:n=[],config:l,mode:s,noDataText:c,parentEntityUri:u}=e;const p=(0,a.useSelector)(v.ZP.selectors.getMetadata),d=(0,a.useSelector)((e=>v.ZP.selectors.getRelationToAddByViewId(e,l.id))),m=(0,a.useSelector)((e=>v.ZP.selectors.getRelationsToEditByViewId(e,l.id))),f=(0,a.useSelector)(v.ZP.selectors.getEntity),h=(0,a.useSelector)((e=>v.ZP.selectors.getCheckIfCanAddRelations(e,l.content))),y=(0,a.useDispatch)(),x=gt(),E=(0,r.useCallback)((()=>{const e=(0,g.vlo)({config:l,mode:s,metadata:p,parentEntityUri:u});(0,i.pipe)(v.N5.relations.actions.openRelationEditor(l.id),y)(e)}),[l,s,p,y,u]),w=(0,r.useCallback)((e=>{y(v.N5.relations.actions.closeRelationEditor(l.id,e)),y(v.N5.relations.actions.removeRelation(l.id,e));const t=n.find((t=>v.N5.relations.selectors.getRelationUriFromConnection(t)===e)),r=v.N5.relations.selectors.getEntityUriFromConnection(t);(0,g.ZiX)(r)&&y(v.N5.modifiedEntities.actions.entityDeleted(r))}),[l,n,y]),C=l.content,S=lt(C.inRelations,C.outRelations),P=(0,r.useCallback)((e=>{const t=(0,i.pipe)((0,i.omit)(["suggested"]),(0,i.evolve)({relation:{relationType:(0,i.always)(S.type),object:(0,i.evolve)({type:(0,i.always)(S.type),attributes:(0,i.always)(null)})}}))(e);y(v.N5.relations.actions.addRelation(l.id,t))}),[y,l,S]),O=(0,r.useCallback)((e=>{y(v.N5.relations.actions.ignoreRelation(l.id,{relationType:S.type,relationDirection:S.direction,entityUri:e.entity.entityUri,relationUri:e.relation.relationUri}))}),[y,l,S]),[N,k]=(0,i.partition)(g.xvW,n),Z=f&&h,T=0===N.length&&0===k.length,R=e=>{var t,n;const r=m.find((t=>{var n,r;return(null==t||null===(n=t.relation)||void 0===n?void 0:n.relationUri)===(null==e||null===(r=e.relation)||void 0===r?void 0:r.relationUri)})),a=!l.allowOnlyCreateNew||(0,g.xvW)(e),c=`${null==e||null===(t=e.relation)||void 0===t?void 0:t.relationUri}-${null==e||null===(n=e.relation)||void 0===n?void 0:n.direction}`;return o().createElement(mt,{config:l,connection:e,key:c},(t=>r?o().createElement(We.Z,{connection:r,config:l,mode:s,metadata:p}):o().createElement(at,{renderRelationArrowButton:t,connection:e,metadata:p,showControls:a,onRemoveRelation:w,onEditRelation:(0,i.pipe)(v.N5.relations.actions.openRelationEditor(l.id),y),onAcceptRelation:P,onIgnoreRelation:O})))},j=Z&&(!d||d&&d.parentEntityUri===u),D=d&&d.parentEntityUri===u;return o().createElement("div",{className:t},j&&o().createElement(F.Button,{color:"primary",onClick:E,className:x.moreButton},o().createElement(J.Z,{classes:{root:x.icon}}),o().createElement("div",{className:x.buttonLabel},b().text("Add"))),D&&o().createElement(We.Z,{connection:d,config:l,mode:s,metadata:p}),N.map(R),N.length>0&&k.length>0&&o().createElement(F.Divider,{className:x.divider}),k.map(R),T&&o().createElement(F.Typography,{className:x.noData},c))};var bt=n(19603),ht=n(94646),yt=n(78101),vt=n(80931);const xt=(0,_.Z)((e=>({attributesList:{paddingLeft:"46px",paddingRight:"16px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0}})));function Et(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){wt(e,t,n[t])}))}return e}function wt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ct=e=>{let{connection:t,className:n}=e;const l=xt(),{relation:s}=t,c=(0,a.useSelector)(v.ZP.selectors.getEntityUriWithDataTenant),u=(0,a.useSelector)(v.ZP.selectors.getMetadata),p=(0,r.useMemo)((()=>(0,g.xF8)(u,null==s?void 0:s.relationType)),[null==s?void 0:s.relationType,u]),d=(0,r.useMemo)((()=>Et({attributes:Et({},v.N5.relations.selectors.getRelationAttributesFromConnection(t))},(0,g.p2l)((null==t?void 0:t.relation)||{}))),[t]),m=(0,r.useMemo)((()=>(0,g.fyF)(p,d)),[p,d]).filter((e=>{let{values:t}=e;return!(0,g.O27)(t)})).length>0,f=(0,r.useMemo)((()=>(0,g.R$r)(d.attributes)),[d]),{getCommentsCount:h}=(0,r.useContext)(w.h);(0,r.useEffect)((()=>{!(0,i.isEmpty)(f)&&h(f)}),[h,f]);const y=(0,r.useMemo)((()=>(0,g.wp9)(g.q7e.RELATION,{entityUri:c,connection:t})),[t,c]);return m?o().createElement(yt.A.Provider,{value:y},o().createElement(vt.Z,{className:L()(l.attributesList,n),entity:d,attrTypes:p})):o().createElement("div",{className:L()(l.attributesList,n)},b().text("No attributes"))};var St=n(86602),Pt=n(82726);const Ot=e=>{let{show:t,onToggle:n,className:r}=e;return o().createElement(Pe.k,{className:r,tooltipTitle:t?b().text("Hide attributes of the relationship"):b().text("Show attributes of the relationship"),tooltipPlacement:"bottom-end",size:"XXS",icon:t?St.Z:Pt.Z,onClick:n})},Nt=(0,_.Z)((e=>({container:{display:"flex",flexDirection:"column",paddingBottom:"2px"},row:{display:"flex",alignItems:"flex-start",flexDirection:"row",minHeight:"16px",padding:"3px 16px 0 "},rowInactive:{background:e.inactiveBackground},entityAvatar:{height:"12px",width:"12px",fontSize:"11px",marginRight:"8px"},entityLabelContainer:{textDecoration:"none",cursor:"pointer",paddingRight:"8px",wordBreak:"break-all"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},showDetails:{marginLeft:"auto"},attributesList:{paddingLeft:"46px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0},suggestedWrapper:{backgroundColor:e.suggested},commentsContainer:{marginLeft:"auto",alignItems:"center","& + $showDetails":{marginLeft:"4px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex"},suggestedLabelWrapper:{marginTop:"6px"},labelWrapper:{display:"flex"}}))),kt=(0,r.memo)((e=>{let{connection:t,renderRelationArrowButton:n,acceptRelation:l,ignoreRelation:s}=e;const c=Nt(),u=t.suggested,{entity:p,relation:d}=t,[m,f]=(0,r.useState)(!1),b=(0,a.useSelector)(v.ZP.selectors.getMetadata),{entityType:h,entityLabel:y,preparedUri:x,relationLabel:E}=Ke(t,b),w=(0,g.Fn9)(d)&&(0,g.Fn9)(p),C=(0,a.useSelector)(v.ZP.selectors.getEntityUriWithDataTenant),S=p&&d&&(0,g.wp9)(g.q7e.RELATION,{entityUri:C,connection:t})||[];return o().createElement("div",{className:L()(c.container,{[c.rowInactive]:!w},{[c.suggestedWrapper]:u})},o().createElement("div",{className:L()(c.row,bt.U)},n&&n(),o().createElement("div",{className:L()(c.labelWrapper,{[c.suggestedLabelWrapper]:u})},o().createElement($e.Z,{className:c.entityAvatar,entityType:h}),o().createElement(_e.Z,{value:x,className:c.entityLabelContainer},o().createElement(Ye,{label:y,entity:p},o().createElement("span",{className:c.entityLabel},y)),E&&o().createElement("span",{className:c.relationLabel},`, ${E}`))),o().createElement("div",{className:c.additionalButtonsWrapper},!(0,i.isEmpty)(S)&&o().createElement(ht.Z,{className:c.commentsContainer,uri:(0,g.gjS)(d),relatedObjectUris:S,objectType:g.q7e.RELATION,allowOnlyOneComment:!0}),u&&o().createElement(nt,{size:"small",acceptRelation:l(t),ignoreRelation:s(t)}),!u&&o().createElement(Ot,{show:m,onToggle:()=>{f((e=>!e))},className:c.showDetails}))),m&&o().createElement(Ct,{connection:t}))}));kt.displayName="RelationItem";const Zt=kt;var Tt=n(52691),Rt=n(16208);const jt=e=>e.filter((e=>5===e.value)).length,Dt=e=>e.filter((e=>1===e.value)).length,It=e=>0===e.length?"0%":jt(e)/e.length*100+"%",Lt=e=>0===e.length?"0%":Dt(e)/e.length*100+"%",At=(0,_.Z)((e=>({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-end"},averageRating:{marginBottom:"7px",fontSize:"16px",letterSpacing:"0.15px",lineHeight:"19px",color:e.palette.text.primary},scale:{display:"flex",marginBottom:"6px",width:"128px",height:"4px"},likesScale:{height:"100%",backgroundColor:"#8CC152"},dislikesScale:{height:"100%",backgroundColor:"rgb(255, 112, 112)"},counts:{display:"flex"},likesCount:{marginRight:"32px"},count:{display:"flex",alignItems:"center",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},icon:{marginRight:"4px",width:"14px",height:"14px",color:"rgba(0,0,0,0.38)"}}))),Mt=e=>{let{ratings:t,className:n}=e;const r=At();return o().createElement("div",{className:L()(r.wrapper,n)},o().createElement(F.Typography,{className:r.averageRating},(e=>(0,i.pipe)((0,i.pluck)("value"),i.mean,(0,i.defaultTo)(0))(e))(t).toFixed(1)),o().createElement("div",{className:r.scale},o().createElement("div",{className:r.likesScale,style:{width:It(t)}}),o().createElement("div",{className:r.dislikesScale,style:{width:Lt(t)}})),o().createElement("div",{className:r.counts},o().createElement("div",{className:L()(r.likesCount,r.count)},o().createElement(Tt.Z,{className:r.icon}),jt(t)),o().createElement("div",{className:r.count},o().createElement(Rt.Z,{className:r.icon}),Dt(t))))},Ut=(0,_.Z)((e=>({wrapper:{display:"flex"},button:{fontSize:"14px",textTransform:"none",color:e.palette.text.secondary},likeButton:{marginLeft:"-12px",marginRight:"8px"},isActive:{color:e.palette.text.primary}}))),zt=e=>{let{ratings:t,onAgree:n,onDisagree:r}=e;const l=Ut(),i=(0,a.useSelector)(v.ZP.selectors.getUserName),s=t.find((e=>{let{user:t}=e;return t===i})),c=[{text:b().text("Has left the practice"),onClick:()=>r(b().text("Has left the practice"))},{text:b().text("Has moved away"),onClick:()=>r(b().text("Has moved away"))},{text:b().text("Has passed away"),onClick:()=>r(b().text("Has passed away"))},{text:b().text("Has retired"),onClick:()=>r(b().text("Has retired"))},{text:b().text("Other"),onClick:()=>r(b().text("Other"))}];return o().createElement("div",{className:l.wrapper},o().createElement(F.Button,{onClick:n,variant:"text",size:"small",className:L()(l.button,l.likeButton,{[l.isActive]:5===(null==s?void 0:s.value)})},"Agree"),o().createElement(Ie.Z,{buttonProps:{endIcon:o().createElement(ct.Z,null),variant:"text",size:"small",className:L()(l.button,{[l.isActive]:1===(null==s?void 0:s.value)})},buttonContent:1===(null==s?void 0:s.value)?s.comment:"Disagree",menuItems:c,menuId:"disagree-dropdown-menu-button"}))},Vt=(0,_.Z)((e=>({wrapper:{padding:"6px 16px 3px"},entityTypeIcon:{marginRight:"16px"},entityLabel:{color:e.palette.primary.main,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},entityLabelContainer:{textDecoration:"none",wordBreak:"break-all"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},ratings:{marginLeft:"auto"},showDetailsButton:{marginLeft:"16px",marginTop:"18px"},relationAttributes:{paddingLeft:"60px"},suggestedWrapper:{padding:"6px 16px 3px",backgroundColor:e.suggested},commentsContainer:{marginTop:"21px","& + $ratings":{marginLeft:"16px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex"}}))),Ft=e=>{let{connection:t,loadRelations:n,renderRelationArrowButton:l,acceptRelation:s,ignoreRelation:c}=e;const u=Vt(),p=t.suggested,[d,m]=(0,r.useState)(!1),{entity:f,relation:b}=t,h=(0,a.useSelector)(v.ZP.selectors.getMetadata),{entityLabel:y,entityType:x,preparedUri:E,relationLabel:w}=Ke(t,h),C=(null==b?void 0:b.ratings)||[],S=(0,a.useSelector)(v.ZP.selectors.getEntityUriWithDataTenant),P=f&&b&&(0,g.wp9)(g.q7e.RELATION,{entityUri:S,connection:t})||[];return o().createElement("div",{className:L()(u.wrapper,{[u.suggestedWrapper]:p})},o().createElement(F.Box,{display:"flex",minHeight:"62px",className:bt.U},o().createElement(F.Box,{display:"flex",alignItems:"flex-start"},o().createElement(F.Box,{display:"flex",alignItems:"center"},l&&l(),o().createElement($e.Z,{entityType:x,className:u.entityTypeIcon})),o().createElement(F.Box,{display:"flex",flexDirection:"column"},o().createElement(_e.Z,{value:E,className:u.entityLabelContainer},o().createElement(Ye,{label:y,entity:f},o().createElement("span",{className:u.entityLabel},y))),w&&o().createElement("span",{className:u.relationLabel},w),!p&&o().createElement(zt,{ratings:C,onAgree:()=>{(0,g.Buf)(null==b?void 0:b.relationUri,{comment:"",value:5}).then(n)},onDisagree:e=>{(0,g.Buf)(null==b?void 0:b.relationUri,{comment:e,value:1}).then(n)}}))),o().createElement("div",{className:u.additionalButtonsWrapper},!(0,i.isEmpty)(P)&&o().createElement(ht.Z,{className:u.commentsContainer,uri:(0,g.gjS)(b),relatedObjectUris:P,objectType:g.q7e.RELATION,allowOnlyOneComment:!0}),p&&o().createElement(nt,{acceptRelation:s(t),ignoreRelation:c(t)}),!p&&o().createElement(o().Fragment,null,o().createElement(Mt,{ratings:C,className:u.ratings}),o().createElement(Ot,{show:d,onToggle:()=>{m((e=>!e))},className:u.showDetailsButton})))),d&&o().createElement(Ct,{connection:t,className:u.relationAttributes}))},Ht=e=>{let{className:t,connections:n=[],loadRelations:l,config:i,mainEnityUri:s}=e;const{isComplex:c,content:u}=i,{ignoreRelation:p,acceptRelation:d}=((e,t,n)=>{const r=lt(e.inRelations,e.outRelations),o=(0,a.useDispatch)();return{ignoreRelation:e=>()=>{const{entity:a}=e;(0,g.iiD)(n,{relatedEntityUri:a.entityUri,relationType:r.type,relationDirection:r.direction}).then(t).catch((e=>{o(v.ui.actions.errorSet((0,g.xU7)(e,b().text("Something went wrong"))))}))},acceptRelation:e=>()=>{const{entity:a,relation:l}=e,{startDate:i,endDate:s}=l,c=r.direction===g.Nsj.IN,u=c?a.entityUri:n,p=c?n:a.entityUri;(0,g.DsR)({startEntityUri:u,endEntityUri:p,relationType:r.type,attributes:null,startDate:i,endDate:s}).then(t).catch((e=>{o(v.ui.actions.errorSet((0,g.xU7)(e,b().text("Something went wrong"))))}))}}})(u,l,s),m=(0,r.useMemo)((()=>(0,g.w3p)(n)),[n]),{getCommentsCount:f}=(0,r.useContext)(w.h);return(0,r.useEffect)((()=>{f(m)}),[f,m]),o().createElement("div",{className:t},n.map((e=>{var t,n;const r=`${null==e||null===(t=e.relation)||void 0===t?void 0:t.relationUri}-${null==e||null===(n=e.relation)||void 0===n?void 0:n.direction}`;return o().createElement(mt,{config:i,connection:e,key:r},(t=>c?o().createElement(Ft,{loadRelations:l,connection:e,acceptRelation:d,ignoreRelation:p,renderRelationArrowButton:t}):o().createElement(Zt,{acceptRelation:d,ignoreRelation:p,connection:e,renderRelationArrowButton:t})))})))};Ht.displayName="RelationsList";const Bt=Ht,Wt=(0,_.Z)((e=>({list:{paddingTop:"8px",paddingBottom:"10px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),qt=e=>{let{isLoading:t,config:n,loadRelations:r,connections:l,total:i,parentEntityUri:s}=e;const c=Wt(),{selectors:u}=v.ZP,p=(0,a.useSelector)(u.getEntity),d=(0,a.useSelector)(u.getMode),m=n["text-empty"]||b().text("No data found");return t?o().createElement(R.Z,null):(0,g.KIu)(d)?o().createElement(ft,{connections:l,className:c.list,key:null==p?void 0:p.uri,config:n,mode:d,noDataText:m,parentEntityUri:s}):i>0?o().createElement(Bt,{config:n,loadRelations:r,connections:l,className:c.list,key:null==p?void 0:p.uri,mainEnityUri:p.uri}):o().createElement(F.Typography,{className:c.noData},m)},Gt=(0,_.Z)({container:{flexGrow:1,display:"flex",flexDirection:"column",minHeight:0},content:{position:"relative",display:"flex",flexGrow:1,flexDirection:"column",minHeight:0},pagination:{height:"52px",flexGrow:0,flexShrink:0}}),$t=e=>{let{config:t,className:n}=e;const l=Gt(),{page:s,setPage:c,rowsPerPage:u,sortOrder:p,sortOption:d,showInactive:m,searchQuery:f,changeSearchQuery:b}=(0,r.useContext)(ke),{selectors:h}=v.ZP,y=(0,a.useSelector)((e=>h.getConnectionsWithDraftsByViewId(e,t.id))),x=(0,a.useSelector)(h.getEntity),E=(0,a.useSelector)((e=>h.getTotalByViewId(e,t.id))),w=(0,a.useSelector)(h.getMode),C=(0,r.useMemo)((()=>({order:p,field:d})),[p,d]);(0,r.useEffect)((()=>{b("")}),[null==x?void 0:x.uri]);const S=(0,r.useMemo)((()=>(e=>{const t=g.wSh.fromFalsy(e).map(g.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome("");return(new g.MEy).addClause(t).build()})(f)),[f]),{isLoading:P,reload:O}=(0,we.a)({sorting:C,filter:S,page:s,rowsPerPage:u,config:t,entity:x,relationActivityFilter:m?g.Ng6.ALL:g.Ng6.ACTIVE_ONLY,mode:w}),N=(0,r.useMemo)((()=>(0,g.Px$)(y)),[y]),k=(0,r.useMemo)((()=>({reloadRelations:O,config:(0,i.pick)(["content","importFromDT","maxDtssImport"],t)})),[O,t]);return o().createElement(Ce.X.Provider,{value:N},o().createElement(z.Z,{className:n},o().createElement("div",{className:l.container},o().createElement(Le.Provider,{value:k},o().createElement(Be,{title:t.caption,total:E})),o().createElement("div",{className:l.content},o().createElement(qt,{isLoading:P,config:t,loadRelations:O,connections:y,total:E}),E>u&&o().createElement(V.Z,{classes:{root:l.pagination},count:E,rowsPerPageOptions:[],rowsPerPage:u,page:s,onChangePage:c})))))};$t.displayName="RelationsView";const _t=o().createContext(null);_t.displayName="SingleAttributeContext";var Qt=n(86361),Xt=n(26180),Yt=n(31276);function Kt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Jt(e,t,n[t])}))}return e}function Jt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const en="CHANGE_SEARCH_QUERY",tn=Kt({},Xt.ZP.actions,{changeSearchQuery:(0,Yt.zD)(en)}),nn=(e,t)=>t.type===en?Kt({},e,{searchQuery:t.payload,page:0}):Xt.ZP.reducer(e,t);var rn=n(92332),on=n(67353);const an={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},ln=(0,_.Z)((()=>({tableContainer:{height:"477px",display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},rowCell:{fontSize:"13px",overflow:"hidden"},"row-cell--sorted":{color:"rgba(0,0,0,0.87)"},"row-cell__buttons-container":{position:"absolute"},"row-cell__buttons-wrapper":{display:"flex",paddingLeft:"10px","& > button":{marginLeft:"-10px",transform:"scale(0.9)"}},headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"12px"},"row-cell--removed":{pointerEvents:"none","& > div":an}}))),sn=(0,on.Z)((e=>{const t=ln();return o().createElement("div",{className:t.headCell},o().createElement(rn.default,e))}));var cn=n(64091);function un(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const pn=(0,i.pipe)((0,i.map)((e=>({id:(0,g.Tde)(e.uri),label:e.label,dataTypeDefinition:(0,g.PFL)(e)}))),(0,i.uniqBy)((0,i.prop)("id"))),dn=(0,i.pipe)(g.DK$,pn),mn=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),gn=e=>{if((0,g.vZp)(e)){const t=mn(e);return t.length>1?t.slice(0,-1):null}return null},fn=(0,i.map)((e=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){un(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:gn(e.id),headCellRenderer:sn,rowCellValueRenderer:cn.Z})));var bn=n(99341);function hn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var yn=n(52016),vn=n(1876),xn=n(60894);const En=(0,_.Z)((()=>({header:{padding:"0 4px 0 16px"}}))),wn=e=>{let{title:t,searchQuery:n,onChangeSearchQuery:r,filtersEnabled:a,onToggleFilters:l,columnsData:i,selectedColumns:s,onChangeColumns:c}=e;const u=En();return o().createElement(H.Z,{title:t,className:u.header},o().createElement(G.i,{query:n,onChange:r}),o().createElement(vn.Z,{enabled:a,onClick:l}),o().createElement(W.Z,{height:24,margin:4}),o().createElement(xn.Z,{columnsData:i,selectedColumns:s,onChangeColumns:c}))};function Cn(){return Cn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Cn.apply(this,arguments)}const Sn=(0,n(32528).Z)(((e,t)=>{let{deletedUris:n}=e,{rowValue:{value:r}}=t;return{isRemoved:Boolean(n.find((e=>r.uri===e)))}}))((e=>{let{cell:t,CellValueRenderer:n,isRemoved:r,isSorted:a}=e,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["cell","CellValueRenderer","isRemoved","isSorted"]);const i=ln();return o().createElement("div",{className:L()({[i["row-cell--sorted"]]:a,[i["row-cell--removed"]]:r},i.rowCell)},t.values.map(((e,t)=>o().createElement(n,Cn({key:t,value:e},l)))))}));var Pn=n(85709);const On=e=>{let{onEdit:t,onRemove:n}=e;return o().createElement(o().Fragment,null,t&&o().createElement(Pe.k,{tooltipTitle:b().text("Edit"),icon:qe.Z,size:"L",onClick:t}),n&&o().createElement(Pe.k,{tooltipTitle:b().text("Remove"),icon:Ge.Z,size:"L",onClick:n}))};function Nn(){return Nn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nn.apply(this,arguments)}const kn=e=>{let{columnsData:t,values:n,sorting:l,onSort:s,filters:c,onFilter:u,config:p,onEdit:d,onDeleteAttribute:m,deletedUris:f}=e;const b=(0,r.useMemo)((()=>((e,t)=>e.map((e=>(0,i.pipe)((0,i.reduce)(((t,n)=>{let{id:r}=n;return(0,i.assoc)(r,((e,t)=>((e,t)=>(0,i.pipe)((0,i.path)(["value"]),(0,g.tT_)(e))(t))(mn(e),t))(r,e),t)}),{}),(0,i.assoc)("value",e))(t))))(n,t)),[n,t]),h=(0,r.useMemo)((()=>fn(t)),[t]),y=ln(),x=(0,a.useSelector)(v.ZP.selectors.getMode),E=(0,g.KIu)(x),w=(0,a.useSelector)(v.ZP.selectors.getMetadata),C=(0,a.useSelector)(v.ZP.selectors.getEntityUri),S=(0,a.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,C)||{})),{attributeType:P}=(0,r.useContext)(_t),O=(0,r.useCallback)((e=>o().createElement(Sn,Nn({},e,{isSorted:!!l&&l.field===e.columnData.id}))),[l]),[N,k]=(0,r.useState)(null),{canUpdate:Z,canDelete:T}=(0,yn.l)(),R=(0,r.useMemo)((()=>"number"!=typeof N||!E||f.includes((0,i.pipe)((0,i.path)([N]),(0,i.prop)("uri"))(n))),[N,f,n,E]),j="number"==typeof N&&(D=(0,i.path)([N],n),T(p)&&(0,g.xv5)({attributeType:P,mode:x,attributeValue:D,metadata:w,isReltioCrosswalk:(0,g.KVV)(S.crosswalks,D)}));var D;const I="number"==typeof N&&(e=>Z(p)&&(0,g.yv0)({attributeType:P,mode:x,attributeValue:e,isReltioCrosswalk:(0,g.KVV)(S.crosswalks,e)}))((0,i.path)([N],n)),L=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);I&&d(e)}),[d,N,n,I]),A=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);if(!j)return;const t={parentUri:C,attributeType:P,uri:e.uri,value:e};m(t),k(null)}),[N,n,m,j,P,C]),M=R||!j&&!I?void 0:o().createElement(On,{onEdit:I?L:void 0,onRemove:j?A:void 0}),U=(0,r.useMemo)((()=>({deletedUris:f})),[f]);return o().createElement("div",{className:y.tableContainer},o().createElement(Pn.Z,{columnsData:h,rowsData:b,sorting:l,onSort:s,filters:c,onFilter:u,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,renderRowCell:O,onRowHover:k,hoverRowIndex:N,hoveredRowRightContent:M,context:U,classes:{hoveredRowRightContentWrapper:y["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:y["row-cell__buttons-container"]}}))},Zn=(0,_.Z)((()=>({actionButtons:{display:"flex",justifyContent:"flex-end",margin:"0 8px 10px","& > button":{fontSize:"14px",lineHeight:"16px",marginLeft:"8px",padding:"10px 8px",backgroundColor:"rgba(98, 2, 238, 0)"}}})));function Tn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Rn=e=>{let{onChangeAttribute:t,onCancel:n,onApply:l,onDeleteAttribute:s,hasChanges:c,attributeValue:u}=e;const d=Zn(),m=(0,a.useSelector)(v.ZP.selectors.getEntityUri),{attributeType:f}=(0,r.useContext)(_t),h=(0,a.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,m)||{})),y=(0,a.useSelector)(v.ZP.selectors.getMode),x=(0,a.useDispatch)(),E=(0,r.useContext)(p.m),w=(0,r.useCallback)((e=>(0,i.pipe)(v.N5.actions.addAttributes,x)(e.map((e=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Tn(e,t,n[t])}))}return e}({},e,{viewId:E}))))),[E,x]),C=(0,g.ZiX)(m),S=(0,a.useSelector)((e=>v.ZP.selectors.getActiveErrorsForAttributesPager(e,m,f))),P=(0,r.useCallback)((0,i.pipe)(v.N5.errors.actions.errorDeactivated,x),[x]);return o().createElement(o().Fragment,null,o().createElement(ne.Z,{expanded:!0,attributeValue:u,showEmptyEditors:C,onDeleteAttribute:s,onDeactivateError:P,onChangeAttribute:t,onAddAttributes:w,mode:y,crosswalks:h.crosswalks,errors:S,attributeType:f,ownError:(0,g.ADq)(u,null,f.uri,S)}),o().createElement("div",{className:d.actionButtons},o().createElement(F.Button,{onClick:()=>{n(u)}},b().text("Cancel")),o().createElement(F.Button,{color:"primary",disabled:!c,onClick:()=>{l(u)}},b().text("Apply"))))},jn=(0,_.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",padding:"4px 16px 9px",flex:1,overflow:"auto"},noData:{fontSize:"13px",paddingLeft:"20px",color:"rgba(0,0,0,0.54)"},tableContainer:{height:"477px",display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},header:{padding:"0 4px 0 16px"},addButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},editor:{padding:"4px 16px"}})));function Dn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){In(e,t,n[t])}))}return e}function In(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ln=[],An=e=>{let{config:t,className:n}=e;const{caption:l,max:s}=t,c=jn(),{values:u,page:d,setPage:m,isLoading:f,searchQuery:h,setSearchQuery:y,visibleColumns:x,onFilter:E,onSort:w,onToggleFilters:C,onChangeColumns:S,filters:P,sorting:O,totalVisibleValues:N,hasPaging:k,attributeType:Z,showTable:T}=(0,r.useContext)(_t),j=(0,r.useMemo)((()=>dn(Z)),[Z]),{checkHasChanges:D,onChangeAttribute:I,onDeleteAttribute:A,onAdd:M,onCancel:U,onApply:B,onStartEditing:W,modifiedValues:q,editingValues:G,deletedUris:$}=(()=>{const[e,t]=(0,r.useState)(),[n,o]=(0,r.useState)([]),l=(0,a.useSelector)(v.ZP.selectors.getMode);(0,r.useEffect)((()=>{o([]),t(null)}),[l]);const s=(0,a.useDispatch)(),c=(0,r.useContext)(p.m),{attributeType:u,values:d}=(0,r.useContext)(_t),m=(0,a.useSelector)(v.ZP.selectors.getEntityUri),f=(0,a.useSelector)(v.ZP.selectors.getMetadata),b=(0,r.useCallback)((e=>{(0,i.pipe)(v.N5.actions.modifyAttribute,s)(Dn({},e,{viewId:c}))}),[c,s]),h=(0,r.useCallback)((e=>(0,i.pipe)(v.N5.actions.removeAttribute,s)(Dn({},e,{viewId:c}))),[c,s]),y=(0,r.useCallback)((()=>{const e=(0,g.gjI)({parentUri:m,attributeType:u});t(e.uri),b(Dn({},e,{value:(0,g.GPx)({attributeTypes:u.attributes,parentUri:e.uri,mode:l,metadata:f}),attributeType:u}))}),[m,u]),x=(0,r.useCallback)((e=>{o((t=>t.find((0,i.propEq)("uri",e.uri))?t:[...t,e]))}),[o]),E=(0,r.useCallback)((e=>{const r=n.find((0,i.propEq)("uri",e.uri));if(r){const t=Dn({},e,{value:r,attributeType:u,uri:e.uri});o((e=>(0,i.without)([r],e))),b(t)}else{const n={value:e,attributeType:u,uri:e.uri};t(null),h(n)}}),[h,b,o,n]),w=(0,r.useCallback)((e=>{t(null),o((t=>{const n=t.find((0,i.propEq)("uri",e.uri));return n?(0,i.without)([n],t):t}))}),[o,t]),C=(0,a.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,m)||{})),S=(0,g.KIu)(l),P=(0,g.xy8)(u),O=(0,i.pathOr)(Ln,[P,null==u?void 0:u.name],C),N=(0,r.useMemo)((()=>[...O.filter((0,i.pipe)((0,i.prop)("uri"),(0,i.both)(g.ZiX,(0,i.pipe)((0,i.equals)(e),i.not)))),...(0,i.map)((e=>O.find((0,i.propEq)("uri",e.uri))||e))(d)].map((e=>{var t;return null!==(t=n.find((0,i.propEq)("uri",e.uri)))&&void 0!==t?t:e}))),[O,n,e,d]),k=(0,r.useMemo)((()=>S?(0,i.pipe)((0,i.map)((0,i.prop)("uri")),(0,i.filter)((e=>!O.find((0,i.propEq)("uri",e)))))(d):[]),[O,d]),Z=O.filter((t=>{let{uri:r}=t;return r===e||n.find((0,i.propEq)("uri",r))}));return{checkHasChanges:e=>n.find((0,i.propEq)("uri",e.uri))!==e,onChangeAttribute:b,onDeleteAttribute:h,onAdd:y,onCancel:E,onApply:w,onStartEditing:x,modifiedValues:N,editingValues:Z,deletedUris:k}})(),_=(0,a.useSelector)(v.ZP.selectors.getMode),Q=(0,g.KIu)(_),X=Q?q:u,{canCreate:Y}=(0,yn.l)(),K=Y(t)&&Z&&(0,g.Vg3)({attributeType:Z,mode:_})&&!G.length,ee=(0,r.useMemo)((()=>x.map((e=>j.find((0,i.propEq)("id",e))))),[x,j]);return o().createElement(z.Z,{className:L()(c.root,n)},T?o().createElement(o().Fragment,null,o().createElement(wn,{title:l,total:N,columnsData:j,selectedColumns:x,onChangeColumns:S,searchQuery:h,onChangeSearchQuery:y,filtersEnabled:!!P,onToggleFilters:C}),o().createElement("div",{style:{position:"relative"}},Q&&o().createElement("div",{className:c.editor},K&&o().createElement(F.Button,{color:"primary",onClick:M,className:c.addButton},o().createElement(J.Z,{classes:{root:c.icon}}),o().createElement("div",{className:c.buttonLabel},b().text("Add"))),G.map((e=>o().createElement(Rn,{key:e.uri,attributeValue:e,onChangeAttribute:I,onDeleteAttribute:A,onCancel:U,onApply:B,hasChanges:D(e)})))),o().createElement(kn,{columnsData:ee,config:t,values:X,filters:P,onFilter:E,sorting:O,onSort:w,onEdit:W,onDeleteAttribute:A,deletedUris:$}),k&&o().createElement(V.Z,{count:N,rowsPerPageOptions:[],rowsPerPage:s,page:d,onChangePage:m}),f&&o().createElement(R.Z,null))):o().createElement(o().Fragment,null,o().createElement(H.Z,{title:l,className:c.header}),o().createElement(F.Typography,{className:c.noData},b().text("No data"))))};var Mn=n(58600);let Un=0;const zn=()=>Un++,Vn=e=>{const t={children:[],nodeId:zn()};if(e.parentPaths)for(let n=0;n<e.parentPaths.length;n++){const r=e.parentPaths[n];let o=t;for(let t=r.length-1;t>=0;t--){const a=r[t],l=e.entities[a.entityUri],i=t===r.length-1,s={entity:l,children:[],nodeId:zn(),expanded:!0,rootIndex:i?n+1:void 0};i&&(s.root=i),o.children.push(s),o=s}}return t.children},Fn=(0,_.Z)((e=>({container:{fontSize:"13px",display:"flex",paddingTop:"6px",position:"relative"},title:{flexGrow:1,minHeight:"15px",color:e.palette.secondary.main,lineHeight:"15px"},link:{cursor:"pointer",color:e.palette.secondary.main,lineHeight:"15px"},selected:{fontWeight:"bold"},wrapper:{width:"100%"},avatar:{height:"16px",width:"16px",marginRight:"8px",marginLeft:"8px"},header:{padding:"0 4px 0 16px"},treeContainer:{flexGrow:1,display:"flex",flexDirection:"column",height:"100%",minHeight:"372px",maxHeight:"507px",overflow:"auto"},tree:{flexGrow:1,height:0},buttonsContainer:{flexShrink:0,marginLeft:"auto","& > * + *":{marginLeft:"-4px"}},button:{padding:"8px"}})));var Hn=n(1242);const Bn=o().createContext(null);var Wn=n(55400);const qn=e=>{e.target.src=Hn},Gn=e=>{let{node:t}=e;const n=Fn(),l=(0,a.useDispatch)(),i=t.entity.uri,s=(0,a.useSelector)(v.ZP.selectors.getAbsoluteImagePath),c=(0,a.useSelector)(v.ZP.selectors.getMetadata),u=(0,r.useContext)(Bn),p=(0,a.useSelector)(v.ZP.selectors.getUIPath),{uri:d}=(0,a.useSelector)(v.ZP.selectors.getEntity),m=(0,g.ChB)({uiPath:p,uri:i}),f=i===d,b=(0,r.useCallback)((()=>{l(v.ui.actions.openEntity({uri:i,viewId:u.id}))}),[l,u,i]),{entity:{label:h},nodeId:y}=t,x=(0,g.nt9)(c,t.entity.type)||{},E=(0,g.VD3)(c,x,"typeGraphIcon"),w=E&&(0,g.vPL)(s,E);return o().createElement("div",{className:n.wrapper,"data-node-id":y},o().createElement("div",{className:n.container},o().createElement(F.Avatar,{className:L()(n.avatar),src:w||Hn,onError:qn}),o().createElement("span",{className:L()(n.link,{[n.selected]:f})},o().createElement(Wn.Z,{to:m,onClick:b},h))))},$n=((0,r.memo)(Gn),e=>{let{node:t}=e;return t.nodeId}),_n=(0,_.Z)((()=>({lineBlock:{height:"100%",position:"relative",display:"inline-block"},lineChildren:{height:"100%",position:"absolute",display:"inline-block"},rootIndex:{display:"flex",alignItems:"center",color:"rgba(0,0,0,0.54)",height:"100%"},verticalLine:{width:"1px",left:"50%",top:0,height:"50%",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},horizontalLineRight:{height:"1px",top:"14px",left:"50%",width:"24%",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},node:{minWidth:"100%",position:"relative",textAlign:"left",padding:"0 24px 0 18px",boxSizing:"border-box",whiteSpace:"normal","&:hover":{backgroundColor:"rgba(0,0,0,0.06)"}},nodeContent:{position:"absolute",top:0,bottom:0,paddingLeft:"18px",boxSizing:"border-box"},row:{display:"flex"},rowContents:{position:"relative",borderLeft:"none",paddingLeft:"4px",flex:"1 1 auto",width:0,display:"flex",verticalAlign:"middle",boxSizing:"border-box"},buttonWrapper:{display:"flex",paddingTop:"13px",width:"12px",cursor:"pointer"},collapsedButton:{transform:"rotate(-90deg)"},expandedButton:{transform:"rotate(0deg)"},button:{transition:"transform .15s ease",width:0,height:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid rgba(0, 0, 0, 0.54)"},rowTitle:{flex:"1 1 auto",width:0,paddingRight:"11px"}})));function Qn(){return Qn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qn.apply(this,arguments)}function Xn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yn(){return Yn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yn.apply(this,arguments)}const Kn={nodeContentRenderer:e=>{const t=(0,i.omit)(["connectDragPreview","connectDragSource","isDragging","canDrop","canDrag","draggedNode","isSearchMatch","isSearchFocus","buttons","didDrop","children","treeId","isOver","parentNode","rowDirection"],e),{scaffoldBlockPxWidth:n,toggleChildrenVisibility:r,node:a,title:l,path:s,treeIndex:c,style:u}=t,p=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["scaffoldBlockPxWidth","toggleChildrenVisibility","node","title","path","treeIndex","style"]),d=l,m=r&&!a.root&&a.children&&a.children.length>0,g=_n();return o().createElement("div",Yn({style:{height:"100%"}},p,{key:a.nodeId}),m&&a.expanded&&o().createElement("div",{style:{width:n-2},className:g.lineChildren}),o().createElement("div",{className:g.row,style:u},o().createElement("div",{className:g.rowContents},m&&o().createElement("div",{className:g.buttonWrapper,onClick:()=>{r({node:a,path:s,treeIndex:c})}},o().createElement("div",{"aria-label":a.expanded?"Collapse":"Expand",className:L()(g.button,a.expanded?g.expandedButton:g.collapsedButton)})),o().createElement("div",{className:g.rowTitle},"function"==typeof d?d({node:a,path:s,treeIndex:c}):d))))},treeNodeRenderer:e=>{const t=(0,i.omit)(["listIndex","swapFrom","swapLength","swapDepth","draggedNode","getPrevRow","connectDropTarget","isOver","canDrop","treeIndex","treeId","path","rowDirection"],e),{children:n,scaffoldBlockPxWidth:r,lowerSiblingCounts:a,node:l}=t,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["children","scaffoldBlockPxWidth","lowerSiblingCounts","node"]),c=_n(),u=a.length,p=[];a.forEach(((e,t)=>{p.push(o().createElement("div",{key:`pre_${1+t}`,style:{width:r},className:c.lineBlock},l.root&&o().createElement("div",{className:c.rootIndex},l.rootIndex,"."),t===u-1&&0!==t&&o().createElement(o().Fragment,null,o().createElement("div",{className:c.verticalLine}),o().createElement("div",{className:c.horizontalLineRight}))))}));const d=l.root?r-4:0,m=r*u-d,g={left:m,width:`calc(100% - ${m}px`},f=`${m+250}px`,b=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Xn(e,t,n[t])}))}return e}({},s.style,{width:f});return o().createElement("div",Qn({},s,{className:c.node,style:b}),p,o().createElement("div",{className:c.nodeContent,style:g},n))},scaffoldBlockPxWidth:16,rowHeight:28,slideRegionSize:50};function Jn(){return Jn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jn.apply(this,arguments)}const er=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",Jn({width:"20",height:"20",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",fillOpacity:".54"},o().createElement("path",{d:"M14.5 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm4 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm-17 1a1.5 1.5 0 110-3 1.5 1.5 0 010 3zM4 4a2 2 0 110-4 2 2 0 010 4zm1 16a2 2 0 110-4 2 2 0 010 4zm4.5-6a4.5 4.5 0 110-9 4.5 4.5 0 010 9zm0-2a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm6 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3z",fill:"#000"})))},tr=e=>{let{title:t,onGraphOpen:n}=e;const r=Fn();return o().createElement(H.Z,{title:t,className:r.header},o().createElement("div",{className:r.buttonsContainer},o().createElement(Pe.k,{className:r.button,tooltipTitle:b().text("Show Graph"),icon:er,onClick:n,size:"L"})))};var nr=n(33165),rr=n(59601);const or=(0,_.Z)((()=>({root:{position:"relative"},bodyWrapper:{paddingTop:"21px"}})));function ar(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){lr(e,t,n[t])}))}return e}function lr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ir=n(14940);const sr=(0,_.Z)({resizableHandleContainer:{position:"relative",width:"100%",height:"inherit"},resizableHandleVisibilityArea:{position:"absolute",top:0,left:0,width:"100%",height:"24px",zIndex:11,"&:hover $resizableHandle":{visibility:"visible"},".react-grid-item.static &:hover $resizableHandle":{visibility:"hidden"}},resizableHandle:{position:"absolute",width:"100%",display:"flex",justifyContent:"center",top:"-3px",zIndex:11,cursor:"move",visibility:"hidden"},dragIcon:{transform:"translateX(-50%) rotate(90deg)",color:"rgba(0, 0, 0, 0.3)"}}),cr=e=>{const t=t=>{const n=sr();return o().createElement("div",{className:n.resizableHandleContainer},o().createElement("div",{className:n.resizableHandleVisibilityArea},o().createElement("div",{className:L()("viewDraggableHandle",n.resizableHandle)},o().createElement(ir.Z,{className:n.dragIcon}))),o().createElement(e,t))};return t.displayName="WithResizableHandle",t},ur=(0,_.Z)({stubView:{padding:"20px"},fullHeight:{height:"100%"},component:{boxSizing:"border-box",overflow:"auto",boxShadow:"none",borderRadius:"unset"}});var pr=n(29103),dr=n(83911),mr=n(79485),gr=n(22385);const fr=(0,i.pipe)((0,i.path)(["point","lat"]),(0,i.both)((0,i.gt)(90),(0,i.lt)(-90))),br=(0,_.Z)((()=>({root:{height:"100%",display:"flex",flexDirection:"column"},fullHeight:{height:"100%"},fullscreenBtn:{position:"absolute",right:"5px",top:"5px",zIndex:100}})));var hr=n(13074),yr=n(24338);const vr=(0,_.Z)((e=>({caption:{color:e.palette.text.secondary,fontSize:"13px"}}))),xr=vr,Er=e=>{let{totalImages:t}=e;const n=xr(),r=t>1?b().text("photos"):b().text("photo");return o().createElement(F.Typography,{variant:"caption",className:n.caption},`${t} ${r}`)};function wr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Cr(e,t,n[t])}))}return e}function Cr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Sr=e=>{let{config:t,attributeType:n,paging:r,requestNextPageOfAttributeValues:l}=e;const s=(0,a.useDispatch)(),c=(0,a.useSelector)(v.ZP.selectors.getEntity),u=(0,a.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,c.uri)||{})),p=(0,i.pathOr)([],["attributes",n.name],u),d=t.id;return o().createElement(o().Fragment,null,o().createElement(yr.Z,{attributeValues:p,attributeType:n,onDeleteAttribute:e=>(0,i.pipe)(v.N5.actions.removeAttribute,s)(wr({},e,{viewId:d})),parentUri:u.uri,onChangeAttribute:e=>(0,i.pipe)(v.N5.actions.modifyAttribute,s)(wr({},e,{viewId:d})),imageSize:Nr,paging:r,requestNextPageOfAttributeValues:l}),o().createElement(Er,{totalImages:p.length}))},Pr=(0,_.Z)((e=>({container:{padding:"8px 16px"},noData:{fontSize:"13px",color:e.palette.text.secondary}}))),Or=Pr,Nr={imageMargin:4,imageWidth:162,imageHeight:162};var kr=n(28741);const Zr=(0,_.Z)((e=>({root:{display:"flex",flexDirection:"column"},matchesContainer:{position:"relative"},footer:{display:"flex",alignItems:"end",flexGrow:1,justifyContent:"flex-start",borderTop:"1px solid rgba(0,0,0, 0.12)",padding:"8px 16px",color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px"},noData:{paddingLeft:"16px",paddingBottom:"16px",fontSize:"13px",color:"rgba(0,0,0,0.54)"}})));var Tr=n(49734),Rr=n(98808),jr=n(93428),Dr=n(30885);function Ir(){return Ir=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ir.apply(this,arguments)}const Lr=e=>{let{config:t,match:n,onStartRequest:l,onFinishRequest:i}=e;const s=(0,a.useDispatch)(),c=(0,a.useSelector)(v.ZP.selectors.getMetadata),u=(0,a.useSelector)(v.ZP.selectors.getEntity),{canMerge:d,canMark:m}=(0,g.hXd)(c,t,n.object,u,n.matchRules),f=(0,r.useMemo)((()=>[n.object]),[n.object]),b={entity:u,entities:f,mode:Rr.N.iconButton,onStartRequest:l},h=(0,r.useContext)(p.m),y=(0,r.useCallback)((()=>{i(),s(v.N5.entity.actions.loadEntity({viewId:h,uri:u.uri}))}),[s,u.uri,i,h]);return o().createElement(o().Fragment,null,d&&o().createElement(jr.H,Ir({},b,{onFinishRequest:y})),m&&o().createElement(Dr.i,Ir({},b,{onFinishRequest:i})))},Ar=e=>{let{config:t,entitiesMap:n,match:r,onFinishRequest:l,onStartRequest:i}=e;const s=(0,a.useSelector)(v.ZP.selectors.getMetadata),c=(0,a.useSelector)(v.ZP.selectors.getEntity);return o().createElement(Tr.M,{match:r,entity:c,entitiesMap:n,metadata:s,className:bt.U},o().createElement(ht.Z,{uri:(0,g.E_P)(c.uri,r.object.uri),relatedObjectUris:(0,g.wp9)(g.q7e.POTENTIAL_MATCH,{entityUri:c.uri,matchEntityUri:r.object.uri}),objectType:g.q7e.POTENTIAL_MATCH}),o().createElement(Lr,{match:r,config:t,onStartRequest:i,onFinishRequest:l}))},Mr={showTransitiveMatches:!0,showInactiveEntities:!1},Ur={order:"asc",field:"score"};var zr;!function(e){e[e.Loading=0]="Loading",e[e.NoData=1]="NoData",e[e.Loaded=2]="Loaded"}(zr||(zr={}));const Vr=cr((e=>{let{className:t}=e;const n=ur();return o().createElement(z.Z,{className:L()(n.stubView,"viewDraggableHandle",t)},"NOT IMPLEMENTED")})),Fr=cr((e=>{let{className:t,config:n}=e;return o().createElement(A.Z,{className:t,caption:n.caption,excludeUris:n.excludeUris,includeUris:n.includeUris,attributesCount:n.attributesCount,pinnedAttributes:n.pinnedAttributes})})),Hr=cr((e=>{let{className:t,config:n}=e;const a=(e=>{const[t,n]=(0,r.useState)(""),[o,a]=(0,r.useState)(0),[l,i]=(0,r.useState)(!1),s=(0,r.useMemo)((()=>({page:o,searchQuery:t,showInactive:l})),[o,t,l]),c=xe(e,s,!0),u=(0,r.useCallback)((()=>{a(0),i((e=>!e))}),[]);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ee(e,t,n[t])}))}return e}({setSearchQuery:n,searchQuery:t,setPage:a,page:o,toggleShowInactive:u,showInactive:l},c)})(n);return o().createElement(M.Provider,{value:a},o().createElement(be,{config:n,className:t}))})),Br=cr((e=>{let{config:t,className:n}=e;const l=(e=>{var t;const{attributeUri:n}=e,o=(0,a.useSelector)(v.ZP.selectors.getMetadata),l=(0,r.useMemo)((()=>(0,g.zeJ)(o,n)),[o,n]),s=(0,r.useMemo)((()=>dn(l)),[l]),c=(0,r.useMemo)((()=>({searchQuery:"",filters:null,sorting:void 0,visibleColumns:s.filter((0,i.pipe)((0,i.prop)("dataTypeDefinition"),g.YkM,i.not)).map((e=>{let{id:t}=e;return t})).slice(0,5),page:0})),[s]),[u,p]=(0,r.useReducer)(nn,c),{searchQuery:d,filters:m,sorting:f,page:b}=u,h=(0,a.useSelector)(v.ZP.selectors.getIsEditableMode),y=(0,r.useMemo)((()=>{const e=((e,t)=>g.wSh.fromNull(t).map((t=>Object.entries(t).map((t=>{let[n,r]=t;const o=e.find((0,i.propEq)("id",n));return(0,bn.su)(o,r)})))).orSome([]))(s,m);return e.length?e:null}),[m,s]),x=(0,r.useMemo)((()=>(0,i.reject)(i.isNil,{filters:y,page:b,sorting:f,searchQuery:d})),[y,b,f,d]),{changeSearchQuery:E,changePage:w,toggleSort:C,changeFilter:S,toggleFilters:P,changeColumns:O}=(0,Qt.o)({actions:tn,dispatch:p}),N=xe(e,x,!1);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){hn(e,t,n[t])}))}return e}({},u,{setSearchQuery:E,setPage:w,onSort:C,onFilter:S,onToggleFilters:P,onChangeColumns:O,showTable:Boolean(((null==N||null===(t=N.values)||void 0===t?void 0:t.length)||y||d||h)&&l&&!l.hidden)},N)})(t);return o().createElement(_t.Provider,{value:l},t&&o().createElement(An,{config:t,className:n}))})),Wr=cr((e=>{let{config:t,className:n}=e;const a=(e=>{var t;const n=(0,r.useMemo)((()=>Object.entries(e.sortOptions||{}).map((e=>{let[t,n]=e;return{value:t,label:n}}))),[e.sortOptions]),o=e.max||15,[a,l]=(0,r.useState)(0),[i,s]=(0,r.useState)(e.sortOrder||"asc"),[c,u]=(0,r.useState)(null===(t=n[0])||void 0===t?void 0:t.value),[p,d]=(0,r.useState)(""),[m,g]=(0,r.useState)(!1),f=(0,r.useCallback)((()=>{l(0),g((e=>!e))}),[]),b=(0,r.useCallback)((()=>{l(0),s((e=>"asc"===e?"desc":"asc"))}),[]),h=(0,r.useCallback)((e=>{l(0),u(e)}),[]);return{searchQuery:p,changeSearchQuery:(0,r.useCallback)((e=>{l(0),d(e)}),[]),sortOrder:i,toggleSortOrder:b,sortOption:c,changeSortOption:h,sortOptions:n,page:a,setPage:l,rowsPerPage:o,showInactive:m,toggleShowInactive:f}})(t);return o().createElement(ke.Provider,{value:a},o().createElement($t,{config:t,className:n}))})),qr=cr((e=>{let{config:t,className:n}=e;const a=(0,r.useRef)(),[l,s]=(0,r.useState)(null),{height:c,width:u,tooltip:p}=t,{html:d,visible:m,tooltip:g,customStyles:f,onClosePopup:b,message:h}=(0,nr.E)(t),y=or(),v=g||p;if((0,r.useEffect)((()=>{a.current&&d&&(a.current.innerHTML="",d.childNodes.forEach((e=>{a.current.appendChild(e)})),s(a.current))}),[d]),!m)return null;const x=(0,i.reject)(i.isNil,{width:u,height:c}),E=o().createElement("div",{ref:a,style:ar({},x,f),className:L()(y.root,n)});return o().createElement("div",{className:y.bodyWrapper},v?o().createElement(F.Tooltip,{title:v},E):E,o().createElement(rr.Z,{placement:"bottom",anchorEl:l,open:!!h,onClose:b},h))})),Gr=cr((e=>{let{config:t,className:n}=e;const l=(0,a.useSelector)(v.ZP.selectors.getEntityUri),{treeData:i,setTreeData:s}=((e,t)=>{const n=(0,he._)(),[o,a]=(0,r.useState)([]);return(0,r.useEffect)((()=>((0,g.ZiX)(e)||n((0,g.RFJ)({uri:e,graphUri:t})).then(Vn).then(a).catch((e=>{console.warn(e)})),()=>{a([])})),[e,t,n]),{treeData:o,setTreeData:a}})(l,t.graph.type),c=Fn(),u=(0,a.useDispatch)(),{id:p,graph:d}=t,m=(0,r.useCallback)((()=>{u(v.ui.actions.openGraph({viewId:p,graphType:d.type}))}),[u,p,d]),f=(0,r.useCallback)((e=>({title:o().createElement(Gn,{node:e.node})})),[]);return o().createElement(z.Z,{className:n},o().createElement(tr,{onGraphOpen:m,title:t.caption}),o().createElement(Bn.Provider,{value:t},o().createElement("div",{className:c.treeContainer},o().createElement("div",{className:c.tree},o().createElement(Mn.ZP,{isVirtualized:!1,treeData:i,canDrag:!1,theme:Kn,generateNodeProps:f,onChange:s,getNodeKey:$n})))))})),$r=cr((e=>{let{config:t,className:n}=e;const l=Zr(),s=(0,a.useSelector)(v.ZP.selectors.getEntity),c=(0,g.wwR)(s),[u,d]=(0,r.useState)(!1),m=(0,r.useCallback)((()=>{d(!0)}),[]),f=(0,r.useCallback)((()=>{d(!1)}),[]),{matches:h,entitiesMap:y,loadMatches:x,total:E}=(0,kr.s)({enabled:!!c,entity:s,options:Mr,filter:"",page:0,sorting:Ur,rowsPerPage:3,onStartLoading:m,onFinishLoading:f}),C=(0,r.useCallback)((()=>{x()}),[x]),S=(0,a.useDispatch)(),P=(0,r.useContext)(p.m),O=(0,r.useCallback)((()=>{S(v.ui.actions.openPerspective({perspectiveId:"potentialMatches",viewId:P}))}),[S,P]),N=(0,r.useMemo)((()=>(0,g.NVY)(c,(0,i.map)(g.ev7,h))),[c,h]),{getCommentsCount:k}=(0,r.useContext)(w.h);(0,r.useEffect)((()=>{k(N)}),[k,N]);const Z=E>3&&!(0,i.isEmpty)(h),T=u?zr.Loading:(0,i.isEmpty)(h)?zr.NoData:zr.Loaded;return o().createElement(Ce.X.Provider,{value:y},o().createElement(z.Z,{className:L()(l.root,n)},o().createElement(H.Z,{title:t.caption}),o().createElement("div",{className:l.matchesContainer},T===zr.Loading&&o().createElement(R.Z,null),T===zr.NoData&&o().createElement(F.Typography,{className:l.noData},b().text("No matches found")),T===zr.Loaded&&h.map((e=>o().createElement(Ar,{config:t,entitiesMap:y,match:e,onFinishRequest:C,onStartRequest:m,key:e.object.uri})))),Z&&o().createElement(o().Fragment,null,o().createElement("div",{className:l.footer},o().createElement(F.Link,{component:"button",variant:"caption",onClick:O,underline:"none"},b().text("See all"))))))})),_r=(0,r.lazy)((()=>n.e(6596).then(n.bind(n,46596)).then((e=>({default:cr(e.HierarchyTreeView)}))))),Qr=(0,r.lazy)((()=>n.e(4361).then(n.bind(n,14361)).then((e=>({default:cr(e.RelationshipsTableView)}))))),Xr=cr((e=>{let{config:t,isFullscreen:n,onToggleFullscreen:l,className:i}=e;const s=br(),c=(0,a.useSelector)(v.ZP.selectors.getMetadata),u=(0,a.useSelector)(v.ZP.selectors.getEntity),p=(0,a.useSelector)(v.ZP.selectors.getGoogleMapKey),{markers:d,loading:m}=((e,t,n)=>{const[o,a]=(0,r.useState)([]),[l,i]=(0,r.useState)(!0),s=(0,he._)();return(0,r.useEffect)((()=>{i(!0),s((0,g.DBr)(t,[e],n)).then((e=>{a(e.filter(fr))})).catch((()=>{a([])})).finally((()=>{i(!1)}))}),[e,t,n,s]),{markers:o,loading:l}})(u,c,p),f=(0,r.useMemo)((()=>o().createElement("div",{className:s.fullHeight},o().createElement(R.Z,null))),[s]),b=(0,r.useMemo)((()=>({lat:0,lng:0})),[]);return p&&o().createElement(z.Z,{className:L()(s.root,i)},m&&o().createElement(R.Z,null),o().createElement(gr.Z,{size:"S",icon:n?dr.Z:pr.Z,onClick:()=>l(t.id),className:s.fullscreenBtn}),o().createElement(mr.Z,{loadingElement:f,defaultZoom:1,defaultCenter:b,markers:d,mapContainerClassName:s.fullHeight,mapKey:p}))})),Yr=cr((e=>{let{config:t,className:n}=e;const{attributeUri:l}=t,s=Or(),c=(0,a.useDispatch)(),u=(0,a.useSelector)(v.ZP.selectors.getMode),p=(0,a.useSelector)(v.ZP.selectors.getEntityWithDiff),d=(0,a.useSelector)(v.ZP.selectors.getMetadata),m=(0,g.zeJ)(d,l),f=(0,i.pathOr)([],["attributes",null==m?void 0:m.name],p),h=(0,i.path)(["attributes","paging",l],p),y=f.length,x=t["text-empty"]||b().text("No data found"),E=(0,r.useCallback)((e=>c(v.N5.actions.requestNextPageOfAttributeValues(e))),[c]);return o().createElement(z.Z,{className:n},o().createElement(H.Z,{title:t.caption}),o().createElement("div",{className:s.container},(()=>{if(m){if((0,g.KIu)(u)){const e={attributeType:m,config:t,paging:h,requestNextPageOfAttributeValues:E};return o().createElement(Sr,e)}if(y>0){const e={attributeValues:f,attributeType:m,imageSize:Nr,paging:h,parentUri:p.uri,requestNextPageOfAttributeValues:E};return o().createElement(o().Fragment,null,o().createElement(hr.Z,e),o().createElement(Er,{totalImages:y}))}}return o().createElement(F.Typography,{className:s.noData},x)})()))}));class Kr{}Kr.ViewTypes=g.ZIY,Kr.getComponentBy=(e,t)=>{let{store:n,config:r,className:a,isFullscreen:l,onToggleFullscreen:i}=t;switch(r[e]){case Kr.ViewTypes.HierarchyTree:return o().createElement(_r,{config:r,store:n,className:a});case Kr.ViewTypes.HierarchyPaths:return o().createElement(Gr,{config:r,className:a});case Kr.ViewTypes.RelationsTable:return o().createElement(Qr,{config:r,store:n,className:a});case Kr.ViewTypes.Relations:return o().createElement(Wr,{config:r,className:a});case Kr.ViewTypes.Attributes:return o().createElement(Fr,{className:a,config:r});case Kr.ViewTypes.SingleAttributeView:return o().createElement(Hr,{config:r,className:a});case Kr.ViewTypes.TableAttributeView:return o().createElement(Br,{config:r,className:a});case Kr.ViewTypes.MapView:return o().createElement(Xr,{config:r,isFullscreen:l,onToggleFullscreen:i,className:a});case Kr.ViewTypes.CustomView:return o().createElement(qr,{config:r,className:a});case Kr.ViewTypes.ImageAttributeView:return o().createElement(Yr,{config:r,className:a});case Kr.ViewTypes.PotentialMatchesView:return o().createElement($r,{config:r,className:a})}},Kr.getComponent=e=>Kr.getComponentBy("class",e)||Kr.getComponentBy("react-class",e)||o().createElement(Vr,{className:e.className});const Jr=Kr,eo=()=>null,to=(0,r.memo)((e=>{let{config:t,store:n,isFullscreen:a,isAutosize:l,onToggleFullscreen:i}=e;const s=ur();return o().createElement(r.Suspense,{fallback:o().createElement(eo,null)},Jr.getComponent({config:t,store:n,className:L()(s.component,{[s.fullHeight]:!l}),isFullscreen:a,onToggleFullscreen:i}))}));to.displayName="ViewComponent";const no=(0,_.Z)((e=>({item:e.basicView,fixedSizeContainer:{height:"100%"}})));function ro(){return ro=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ro.apply(this,arguments)}const oo=["onConfigChanged","onRemove"],ao=e=>{let{layoutItemConfig:t,views:n,className:l,children:s,style:c,isFullscreen:u,onToggleFullscreen:p,AutosizeComponent:d}=e,m=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["layoutItemConfig","views","className","children","style","isFullscreen","onToggleFullscreen","AutosizeComponent"]);const g=n.find((e=>{let{id:n}=e;return t.i===n})),f=no(),{store:b}=(0,r.useContext)(a.ReactReduxContext);if(!g)return null;const h=g.class===Jr.ViewTypes.CustomView;return o().createElement("div",ro({},(0,i.omit)(oo,m),{style:c,className:L()(l,{[f.item]:!h})}),o().createElement("div",{className:L()({[f.fixedSizeContainer]:!d})},d,o().createElement(to,{store:b,config:g,isFullscreen:u,onToggleFullscreen:p,isAutosize:Boolean(d)})),s)},lo=e=>{let{views:t,layout:n,layoutOptions:r,onLayoutChanged:a}=e;return o().createElement(D.Z,{LayoutItem:ao,views:t,layout:n,layoutOptions:r,onLayoutChanged:a,draggableHandle:".viewDraggableHandle"})};var io=n(57304),so=n(3409),co=n(93873),uo=n(22860),po=n(72753),mo=n(43576);function go(){return go=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},go.apply(this,arguments)}const fo=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",go({width:"19",height:"17",viewBox:"0 0 19 17",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),o().createElement("defs",null,o().createElement("path",{d:"M14 17v2H4v-2h10zm6-4v2H4v-2l12.884.001H17l.116-.002L20 13zm-8.457-2H4V9h5.82a8.465 8.465 0 001.723 2zM9.139 6.178l-.289.733.035.088L4 7V5l5.713-.002c-.22.375-.412.768-.574 1.18zM17 2.82a6.451 6.451 0 00-6 4.09 6.451 6.451 0 006 4.092 6.451 6.451 0 006-4.091 6.451 6.451 0 00-6-4.091zm0 6.815a2.728 2.728 0 010-5.455 2.728 2.728 0 010 5.455zm0-4.365c-.905 0-1.636.73-1.636 1.636 0 .906.73 1.637 1.636 1.637.905 0 1.636-.731 1.636-1.637 0-.905-.73-1.636-1.636-1.636z",id:"svg1467685497a"})),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},o().createElement("g",{transform:"translate(-4 -2.5)"},o().createElement("mask",{id:"svg1467685497b",fill:"#fff"},o().createElement("use",{xlinkHref:"#svg1467685497a"})),o().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg1467685497b)",d:"M0 0h24v24H0z"}))))},bo=(0,_.Z)({editingButtons:{display:"flex","& button + button":{width:"88px",marginLeft:"8px"}},searchResults:{width:"150px",height:"25px",backgroundColor:"#ccc"},comments:{display:"flex",justifyContent:"flex-end",marginTop:"10px"}}),ho=e=>o().createElement(F.SvgIcon,e,o().createElement(fo,null)),yo=(e,t,n,r,o)=>e.filter((e=>{let{value:a,permission:l}=e;return!(n&&!(0,g.KIu)(a))&&!!(r&&o||!(0,g.fnZ)(a))&&(0,g.uGe)(l,t)})),vo=e=>{let{className:t}=e;const n=bo(),l=(0,a.useDispatch)(),i=(0,a.useSelector)(v.ZP.selectors.getCanUserStartProcessFromQuery),s=(0,a.useSelector)(v.ZP.selectors.getEntityWithoutDiff),c=(0,a.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,s.uri))),u=(0,a.useSelector)(v.ZP.selectors.getMetadata),p=(0,a.useSelector)(v.ZP.selectors.isWorkflowEnabled),d=(0,a.useSelector)(v.ZP.selectors.getMode),m=(0,a.useSelector)(v.ZP.selectors.getIsEditableMode),f=(0,a.useSelector)(v.ZP.selectors.getIsViewMode),h=(0,a.useSelector)(v.ZP.selectors.getIsHistoryModeEnabled),y=(0,a.useSelector)(v.ZP.selectors.getProfileOperation)===g.OXy.Saving,x=null==s?void 0:s.type,E=(0,r.useMemo)((()=>[{label:b().text("Editing"),value:g.fO_.EDITING,description:b().text("Edit profile directly"),icon:mo.Z,permission:"UPDATE"},{label:b().text("Suggesting"),value:g.fO_.SUGGESTING,description:b().text("Suggest changes and initiate a workflow review"),icon:ho,permission:"INITIATE_CHANGE_REQUEST"},{label:b().text("Viewing"),value:g.fO_.VIEWING,description:b().text("Suggest changes and initiate a workflow review"),icon:po.Z,permission:"READ"}]),[]),w=(0,r.useMemo)((()=>[{label:b().text("Delete"),value:"Delete",description:b().text("Permanently delete profile"),icon:Ge.Z,onClick:()=>{window.confirm(b().text("Are you sure you want to delete this?"))&&l(v.N5.entity.actions.entityRemoveRequested({entityUri:s.uri}))},permission:"DELETE"}]),[l,s.uri]),C=(0,r.useMemo)((()=>(0,g.nt9)(u,x)||{}),[u,x]),S=!h&&!(0,g.biM)(s)&&!(e=>(0,g.uGe)(g.BDP.READ,e)&&!(0,g.uGe)(g.BDP.UPDATE,e)&&!(0,g.uGe)(g.BDP.DELETE,e)&&!(0,g.uGe)(g.BDP.INITIATE_CHANGE_REQUEST,e))(C),P=(0,g.ZiX)(null==s?void 0:s.uri),O=(0,r.useMemo)((()=>yo(E,C,P,p,i)),[E,C,p,i,P]),N=(0,r.useMemo)((()=>yo(w,C,P,p,i)),[w,C,p,i,P]),k=(0,r.useCallback)((e=>{l(v.N5.mode.actions.modeUpdated(e))}),[l]),Z=(0,r.useCallback)((()=>{l(v.N5.mode.actions.modeCancelEditing())}),[l]),T=(0,r.useCallback)((()=>{l(v.N5.actions.saveProfile())}),[l]);return o().createElement(io.Z,{className:L()(t,bt.U),entity:m&&c?c:s},o().createElement(F.Box,{display:"flex",alignItems:"center"},o().createElement(F.Box,{mr:3},m&&o().createElement(F.Box,{className:n.editingButtons},o().createElement(F.Button,{variant:"outlined",onClick:Z,"data-reltio-id":"reltio-profile-cancel-editing",disabled:y},b().text("Cancel")),o().createElement(F.Button,{variant:"contained",color:"primary","data-reltio-id":"reltio-profile-save-profile",onClick:T,disabled:y},(0,g.fnZ)(d)?b().text("Suggest"):b().text("Save"))),h&&f?o().createElement(so.Z,null):f&&o().createElement(co.a,null)),S&&o().createElement(uo.T,{optionsGroup:O,buttonsGroup:N,value:d,onChange:k,disabled:y})),o().createElement(F.Box,{className:n.comments},o().createElement(ht.Z,{uri:s.uri,relatedObjectUris:(0,g.wp9)(g.q7e.ENTITY,{entityUri:s.uri}),objectType:g.q7e.ENTITY})))};var xo=n(71820),Eo=n(85890),wo=n(26789),Co=n(54362),So=n(6674),Po=n(91515),Oo=n(52043),No=n(17308),ko=n(39827),Zo=n(80147),To=n(76569);const Ro=(0,_.Z)({wrapper:{display:"flex",overflow:"hidden",marginLeft:"auto",flexShrink:0},badge:{fontSize:"12px",height:"18px",minWidth:"18px",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px"}}),jo=()=>{const{total:e}=(0,r.useContext)(Z.O),t=Ro();return o().createElement(F.Badge,{badgeContent:e,classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(To.Z,null))};var Do=n(26313),Io=n(9371),Lo=n(4426);const Ao=(0,_.Z)({wrapper:{overflow:"auto",paddingRight:"12px"},showMoreLink:{display:"flex",margin:"16px"},showMoreIcon:{fontSize:"1rem"}}),Mo=()=>{const e=Ao(),{getComments:t,comments:n,pageToken:l}=(0,r.useContext)(w.h),i=(0,a.useSelector)(v.ZP.selectors.getEntityUriWithDataTenant);(0,r.useEffect)((()=>{t(i)}),[t,i]);const s=(0,Do.Q)(n);return o().createElement(Ce.X.Provider,{value:s},o().createElement(F.Box,{className:e.wrapper},n.map((e=>{const{objectId:t,relatedObjectUris:n,objectType:r,commentId:a}=e;return o().createElement(Io.J,{key:a,uri:t,relatedObjectUris:n,objectType:r,comment:e})})),l&&o().createElement(F.Link,{component:"button",variant:"caption",className:e.showMoreLink,onClick:()=>{t(i,l)},underline:"none"},o().createElement(Lo.Z,{className:e.showMoreIcon}),b().text("Show more"))))};var Uo=n(34120);const zo=(0,_.Z)({wrapper:{overflow:"auto",position:"relative",height:"100%"}}),Vo=()=>{const e=zo(),{tasks:t,loading:n}=(0,r.useContext)(Z.O);return o().createElement("div",{className:e.wrapper},n&&o().createElement(R.Z,null),t&&t.map((e=>o().createElement(Uo.s,{key:e.taskId,task:e}))))};function Fo(){return Fo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fo.apply(this,arguments)}const Ho=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",Fo({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"},n),o().createElement("defs",null,o().createElement("path",{d:"M4 17.17L5.17 16H20V4H4v13.17zM20 2c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H6l-4 4V4c0-1.1.9-2 2-2h16zm-3 9H7v2h10v-2zm0-4H7v2h10V7z",id:"svg2697213709a"})),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},o().createElement("g",null,o().createElement("g",{transform:"translate(-2 -2)"},o().createElement("mask",{id:"svg2697213709b",fill:"#fff"},o().createElement("use",{xlinkHref:"#svg2697213709a"})),o().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2697213709b)",d:"M0 0h24v24H0z"})))))},Bo=()=>{const{commentsMap:e}=(0,r.useContext)(w.h),t=Ro();return o().createElement(F.Badge,{badgeContent:(0,g.mdt)(e),classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(Ho,null))};var Wo=n(10159);const qo=()=>o().createElement(Wo.Z,{text:b().text("Ready to go with the flow?"),secondaryText:b().text("Suggest a change or submit a match review, and we’ll kick off a workflow task to get things going.")}),Go=()=>o().createElement(Wo.Z,{text:b().text("Care to join the conversation?"),secondaryText:b().text("Leave comments for team members anywhere in the Profile page, and we’ll record it here.")});function $o(){return $o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$o.apply(this,arguments)}let _o;!function(e){e[e.Workflow=0]="Workflow",e[e.Collaboration=1]="Collaboration",e[e.History=2]="History"}(_o||(_o={}));const Qo=e=>{if(e)return 1===e?b().text("${total} item",{total:e}):b().text("${total} items",{total:e})},Xo=()=>{var e,t,n;const l=Ro(),s=(0,a.useSelector)(v.ZP.selectors.isWorkflowSideViewEnabled),c=(0,a.useSelector)(v.ZP.selectors.isWorkflowEnabled),u=(0,a.useSelector)(v.ZP.selectors.isCollaborationSideViewEnabled),p=(0,a.useSelector)(v.ZP.selectors.isCollaborationEnabled),d=(0,a.useSelector)(v.ZP.selectors.getHistoryEvent),m=(0,a.useSelector)(v.ZP.selectors.getMetadata),f=(0,a.useSelector)(v.ZP.selectors.getEntity),h=(0,r.useContext)(Z.O),y=(0,r.useContext)(w.h),[x,E]=(0,r.useState)(null),C=(0,r.useCallback)((e=>{E((t=>t===e?null:e))}),[]),S=(0,r.useCallback)((()=>{E(null)}),[]),P=null!==x,O=x===_o.History,{isHistoryEnabled:N,isProfilePersisted:k}=(0,xo.C)({isHistoryTabActive:O,entity:f}),{historyFilter:T,onApplyFilter:R,onClearFilter:j,isLoading:D,historicUris:I,historyWithTotal:L,canLoadMore:A,onLoadMore:M}=(0,Eo.k)({entity:f,enabled:N}),U=s&&c&&!(0,g.ZiX)(null==f?void 0:f.uri),z=u&&p,V=(0,g.mdt)(null==y?void 0:y.commentsMap),F=[{buttonProps:{id:_o.Workflow,icon:jo,tooltipTitle:b().text("Workflow")},content:null!=h&&h.total?o().createElement(Vo,null):o().createElement(qo,null),headerProps:{mainTitle:b().text("Workflow"),secondTitle:Qo(null==h?void 0:h.total),rightContent:o().createElement(wo.G,null)},hidden:!U},{buttonProps:{id:_o.Collaboration,icon:Bo,tooltipTitle:b().text("Collaboration")},content:V?o().createElement(Mo,null):o().createElement(Go,null),headerProps:{mainTitle:b().text("Collaboration"),secondTitle:Qo(V)},hidden:!z},{buttonProps:{id:_o.History,icon:Zo.Z,tooltipTitle:b().text("History")},content:k?o().createElement(Co.Z,{isLoading:D,historyWithTotal:L,contributorsUris:I,entityUri:null==f?void 0:f.uri,historyEvent:d,onLoadMore:M,canLoadMore:A}):o().createElement(So.Z,null),headerProps:{content:o().createElement(Po.Z,{total:k?((null==I?void 0:I.length)||0)+1:void 0,entityType:(0,g.nt9)(m,null==f?void 0:f.type),filter:T,onApplyFilter:R,onClearFilter:j})}}],H=(0,i.reject)((0,i.propEq)("hidden",!0))(F);return(0,r.useEffect)((()=>{var e;null!==(e=F[x])&&void 0!==e&&e.hidden&&S()}),[x,F,S,H]),o().createElement("div",{className:l.wrapper},o().createElement(Oo.h,{open:P,width:480},!(null!==(e=F[x])&&void 0!==e&&e.hidden)&&o().createElement(o().Fragment,null,o().createElement(No.P,$o({},null===(t=F[x])||void 0===t?void 0:t.headerProps,{onClose:S})),null===(n=F[x])||void 0===n?void 0:n.content)),o().createElement(ko.G,{buttonsProps:(0,i.pipe)((0,i.reject)((0,i.propEq)("hidden",!0)),(0,i.pluck)("buttonProps"))(F),onButtonClick:C,activeIndexId:x}))};var Yo=n(39781),Ko=n(16715);const Jo="48px",ea="1px solid rgba(0, 0, 0, .125)",ta=(0,_.Z)((e=>({accordion:{borderTop:ea,borderBottom:ea,fontSize:"13px",boxShadow:"none","&:not(:first-child)":{borderTop:0},"&:before":{display:"none"},"&$accordionExpanded":{margin:"auto"}},accordionExpanded:{},accordionSummary:{display:"flex",alignItems:"center",height:Jo,minHeight:Jo,"&$accordionSummaryExpanded":{height:Jo,minHeight:Jo}},accordionSummaryHeading:{flex:1,fontSize:e.typography.pxToRem(13),fontWeight:e.typography.fontWeightRegular},accordionSummaryExpanded:{},accordionSummaryContent:{display:"flex",alignItems:"center"},accordionDetails:{maxHeight:"21vh",overflow:"auto",paddingTop:0,paddingBottom:0,"& ul":{paddingLeft:"23px",marginTop:"3px"},"& li":{paddingLeft:"9px",paddingBottom:"8px"}},parents:{color:e.palette.text.primary},errorsAccordion:{backgroundColor:"#FFF4F6",borderColor:"#FFB8B3"},errorsAccordionDetails:{color:"#DD2C00"},warningsAccordion:{backgroundColor:"#FFF9ED",borderColor:"#FFDD91"},warningsAccordionDetails:{color:"#CC7500"},icon:{marginRight:"8px"},errorIcon:{fill:"#FF1744"},warningIcon:{fill:"#F9A825"}}))),na=ta;var ra=n(38016);const oa=(0,r.memo)((e=>{let{panels:t,expandedPanelId:n,onToggle:r,ErrorComponent:a}=e;const l=na();return t.length>0?o().createElement("div",null,t.map((e=>{let{id:t,icon:i,title:s,items:c,accordionClassName:u,accordionDetailsClassName:p}=e;return o().createElement(F.Accordion,{key:t,square:!0,expanded:n===t,onChange:r(t),className:u,classes:{root:l.accordion,expanded:l.accordionExpanded}},o().createElement(F.AccordionSummary,{classes:{root:l.accordionSummary,expanded:l.accordionSummaryExpanded,content:l.accordionSummaryContent},expandIcon:o().createElement(ra.Z,null)},i,o().createElement(F.Typography,{className:l.accordionSummaryHeading},s)),o().createElement(F.AccordionDetails,{className:L()(l.accordionDetails,p)},o().createElement("ul",null,c.map(((e,t)=>o().createElement(a,{key:t,error:e}))))))}))):null}));oa.displayName="ErrorsPanel";const aa=(0,i.omit)(["deactivated","path"]),la=(0,r.memo)((e=>{let{error:t}=e;const n=na(),r=((e,t)=>{let{type:n,source:r,message:o,attributeTypeUri:a="",attributeType:l}=t;if(n===g.NIO.missed&&r===g.zHr.local){const t=l||(0,g.zeJ)(e,a);return t?b().text("${attribute} is required",{attribute:t.label}):o}return o})((0,a.useSelector)(v.ZP.selectors.getMetadata),t),l=(e=>{let{path:t,uri:n}=e;return null==t?void 0:t.slice(0,n?t.length-1:t.length).filter((e=>{let{type:t}=e;return[g.HAc.attributeValue,g.HAc.relationConnection].includes(t)})).map((e=>{let{label:t}=e;return t})).filter(i.identity).join(" / ")})(t);return o().createElement("li",null,o().createElement("span",null,r),l&&o().createElement(o().Fragment,null,o().createElement("br",null),o().createElement("span",{className:n.parents},l)))}));la.displayName="Error";const ia=()=>{const e=na(),t=(e=>{const t=(0,r.useRef)(e);return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length===t.length&&(0,i.equals)(e.map(aa),t.map(aa))}(e,t.current)||(t.current=e),t.current})((0,a.useSelector)(v.ZP.selectors.getProfileErrors)),[n,l]=(0,r.useMemo)((()=>(0,i.partition)(g.IT0,t)),[t]),[s,c]=(0,r.useState)(null),u=(0,r.useMemo)((()=>[{id:"errors",title:b().text("${number} ${errors}",{number:n.length,errors:1===n.length?b().text("error"):b().text("errors")}),icon:o().createElement(Yo.Z,{className:L()(e.icon,e.errorIcon)}),items:n,accordionClassName:e.errorsAccordion,accordionDetailsClassName:e.errorsAccordionDetails},{id:"warnings",title:b().text("${number} ${warnings}",{number:l.length,warnings:1===l.length?b().text("warning"):b().text("warnings")}),icon:o().createElement(Ko.Z,{className:L()(e.icon,e.warningIcon)}),items:l,accordionClassName:e.warningsAccordion,accordionDetailsClassName:e.warningsAccordionDetails}].filter((e=>{let{items:t}=e;return t.length>0}))),[n,l,e]);(0,r.useEffect)((()=>{c("errors")}),[n]);const p=(0,r.useCallback)((e=>(t,n)=>{c(n?e:null)}),[]);return u.length>0?o().createElement(oa,{panels:u,expandedPanelId:s,onToggle:p,ErrorComponent:la}):null},sa=(0,_.Z)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflowX:"hidden",overflowY:"auto",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},scrollWrapper:{flexGrow:1,overflowY:"auto"},emptyState:{backgroundColor:"#FAFAFA",height:"100%"},profileWrapper:e=>{let{maxWidth:t}=e;return{display:"flex",flexDirection:"column",overflow:"hidden",flexGrow:1,maxWidth:t?`${t}px`:"100%"}},profileContainer:{display:"flex",overflow:"hidden",flexGrow:1},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"}}))),ca=(0,r.memo)((e=>{let{config:t,saveState:n,getSavedState:l}=e;const i=sa({maxWidth:null==t?void 0:t.maxWidth}),s=(0,a.useDispatch)(),c=(0,r.useRef)(),u=(0,r.useCallback)((0,g.DsO)(n,5e3),[n]),{isLoaded:p,savedState:d}=(0,x.a)(l),[m,f]=(0,r.useState)([]),[h,D]=(0,r.useState)([]),I=(0,r.useMemo)((()=>y()(t)),[t]),L=(0,a.useSelector)(v.ZP.selectors.getEntity),A=(0,a.useSelector)(v.ZP.selectors.getIsHistoryModeEnabled),M=(0,r.useMemo)((()=>(0,g.dvH)(L)),[L]),U=(0,E.C)({objectIds:M}),z=(0,r.useContext)(w.h),V=(0,C.U)(),F=(0,S.v)(null==t?void 0:t.workflow),H=(0,a.useSelector)(v.ZP.selectors.getHistoryEvent);(0,P.a)({entity:L,historyEvent:H});const B=(0,O.u)();(0,r.useEffect)((()=>{if(p){const e=I!==d.configHash,{views:n,layout:r}=(0,g.Mfk)({views:e||!d.views?t.views:d.views,layout:e?t.layout:d.layout});D(n),f(r)}}),[p]),(0,r.useEffect)((()=>{s(v.N5.views.actions.profileViewsSet(h))}),[s,h]),(0,r.useEffect)((()=>{t.sidePanelViews&&s(v.N5.sidePanelViews.actions.sidePanelViewsLoaded(t.sidePanelViews))}),[t]),(0,r.useEffect)((()=>{c.current&&(c.current.scrollTop=0)}),[null==L?void 0:L.uri]),(()=>{const e=(0,a.useDispatch)(),t=(0,a.useSelector)(v.ZP.selectors.getValidateReadMode),n=(0,a.useSelector)(v.ZP.selectors.getEntity)||{},{uri:o,updatedTime:l}=n,i=(0,g.biM)(n),s=(0,a.useSelector)(v.ZP.selectors.getMode),c=(0,a.useSelector)(v.ZP.selectors.getProfileViews),u=c&&c.length>0,p=(0,r.useCallback)((0,g.DsO)((t=>{t&&e(v.N5.actions.validateProfile())}),500),[e]);(0,r.useEffect)((()=>{const e=t&&!i&&o&&!(0,g.ZiX)(o)&&s===g.ARY.Viewing&&u;p(e)}),[p,i,t,l,o,s,u])})();const W=(0,r.useCallback)((e=>{u({layout:e,views:h,configHash:I}),f(e)}),[u,I,h]);return o().createElement(N.j.Provider,{value:!0},o().createElement(k.s.Provider,{value:V},o().createElement(w.h.Provider,{value:A?z:U},o().createElement(Z.O.Provider,{value:F},o().createElement(T.m.Provider,{value:B},o().createElement("div",{className:i.perspectiveView},(!p||!(null!=L&&L.uri))&&o().createElement(R.Z,null),p&&null!=L&&L.uri?o().createElement("div",{className:i.profileContainer},o().createElement("div",{className:i.profileWrapper},o().createElement(vo,null),!A&&o().createElement(ia,null),o().createElement("div",{ref:c,className:i.scrollWrapper},o().createElement(lo,{layout:m,onLayoutChanged:W,views:h}))),o().createElement(Xo,null)):o().createElement("div",{className:i.emptyState},o().createElement(j.ZP,{LogoRenderer:j.B9.NO_DATA,text:b().text("No data to display."),variant:j.tC.embedded}))))))))}));ca.displayName="ProfilePerspectiveView";const ua=(0,s.createGenerateClassName)({productionPrefix:"profilePerspective",disableGlobal:!0}),pa=e=>{let{config:t,store:n,onResize:f=i.identity,saveState:b,getSavedState:h,qxSandboxApi:y}=e;const v=(0,r.useCallback)((0,g.aYu)(h),[h]),x=(0,r.useMemo)((()=>(0,g.Vr9)(t)),[t]);return o().createElement(a.Provider,{store:n},o().createElement(p.m.Provider,{value:x.id},o().createElement(d.Y.Provider,{value:y},o().createElement(s.StylesProvider,{generateClassName:ua},o().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},o().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>f(Math.floor(e),Math.floor(t))}),x&&o().createElement(ca,{config:x,saveState:b,getSavedState:v}),o().createElement(m.Z,{showErrorFromStore:!0}))))))};var da=n(82842),ma=n(51229),ga=n(91131);const fa=(0,_.Z)((e=>({titleContainer:{overflow:"hidden",fontSize:"16px",fontWeight:"normal",whiteSpace:"nowrap",textOverflow:"ellipsis",alignItems:"center",display:"flex",minHeight:"48px",color:e.palette.text.secondary},link:{fontSize:"16px",fontWeight:"normal"},icon:{height:"18px",color:e.palette.text.secondary},totalCaption:{lineHeight:"inherit",fontSize:"14px",color:"rgba(0,0,0,0.6)",flexShrink:0,marginRight:"5px"},totalNumber:{fontSize:"16px",color:"rgba(0,0,0,0.87)",marginRight:"5px",fontWeight:500}}))),ba=e=>{let{total:t=0}=e;const n=fa(),l=(0,a.useDispatch)(),i=(0,r.useContext)(p.m),s=(0,r.useCallback)((()=>{l(v.ui.actions.openPerspective({perspectiveId:"profile",viewId:i}))}),[l,i]);return o().createElement(H.Z,{title:""},o().createElement("div",{className:n.titleContainer},o().createElement(F.Link,{component:"button",variant:"caption",className:n.link,onClick:s,underline:"none"},b().text("Profile")),o().createElement(ga.Z,{className:n.icon}),b().text("Tags")),o().createElement(ma.Z,null),o().createElement(F.Typography,{className:n.totalCaption,variant:"caption"},o().createElement("span",{className:n.totalNumber},b().number(t,"0,0")),b().text("total profiles")))};var ha=n(20404);const ya=(0,_.Z)((e=>({toolbar:{display:"flex",flexShrink:0,background:"white",borderBottom:"1px solid rgba(0,0,0,0.1)",boxSizing:"border-box",paddingLeft:"16px"},avatar:{color:"rgba(0, 0, 0, 0.38)",marginRight:"12px"},label:{fontSize:"20px",letterSpacing:"0.25px",lineHeight:"1.2",fontWeight:500,color:e.palette.text.primary,wordBreak:"break-word"}}))),va=e=>{let{label:t}=e;const n=ya();return o().createElement(F.Toolbar,{className:n.toolbar},o().createElement(ha.Z,{className:n.avatar}),o().createElement(F.Typography,{variant:"h6",className:n.label},t))};function xa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ea(e,t,n[t])}))}return e}function Ea(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const wa=(0,_.Z)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflow:"hidden",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},tagsContainer:{display:"flex"},fullHeight:{flexGrow:1,height:0},tagsView:{margin:"16px",width:"100%",paddingTop:"4px"},listContainer:{flex:1,display:"flex",overflow:"hidden",position:"relative",flexDirection:"column",minHeight:"4px"},entitiesList:{overflowY:"auto",flexGrow:1},pagination:{flexGrow:0}}))),Ca=[25,50,100],Sa=(0,r.memo)((e=>{let{tag:t,entityUri:n}=e;const l=wa(),[s,c]=(0,r.useState)(Ca[0]),[u,p]=(0,r.useState)(0),d=(0,a.useSelector)(v.ZP.selectors.getGlobalSearchRequestOptions);(0,r.useEffect)((()=>{p(0)}),[t,n,d]);const{isLoading:m,total:f,entities:h}=(e=>{let{tag:t,entityUri:n,page:o=0,rowsPerPage:l=50}=e;const s=(0,a.useDispatch)(),c=(0,he._)(),u=(0,he._)(),[p,d]=(0,r.useState)(!1),[m,f]=(0,r.useState)(0),[h,y]=(0,r.useState)([]),{requestEntities:x,requestTotal:E}=(e=>{let{entityUri:t,tag:n}=e;const o=(0,a.useSelector)(v.ZP.selectors.getGlobalSearchRequestOptions),l=(0,a.useSelector)(v.ZP.selectors.getTenant),s=(0,a.useSelector)(v.ZP.selectors.getDtssPath),c=(0,r.useMemo)((()=>(0,g.Do$)(t)),[t]),u=(0,r.useMemo)((()=>[{filter:"equals",fieldName:"tags",values:[n]}]),[n]),p=!!c,d=(0,r.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=xa({select:"uri,label,type,secondaryLabel,defaultProfilePicValue,startDate,endDate"},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return p?(0,g.uqV)({filters:e,options:t,customerTenant:l,dataTenant:c,dtssPath:s}).then((0,i.map)((0,i.assoc)("dataTenant",c))):(0,g.ZOr)(e,t)}),[p,c,l,s]);return{requestEntities:(0,r.useCallback)(((e,t)=>d(u,xa({offset:t,max:e},o))),[u,o,d]),requestTotal:(0,r.useCallback)((()=>{const e=o;return(p?(0,g.J$m)({filters:u,options:e,customerTenant:l,dataTenant:c,dtssPath:s}):(0,g.j_Q)(u,e)).then((e=>e.total))}),[u,o,p,c,l,s])}})({entityUri:n,tag:t}),w=(0,r.useCallback)((e=>{s(v.ui.actions.errorSet((0,g.xU7)(e,b().text("Something went wrong")))),f(0)}),[s]);return(0,r.useEffect)((()=>{c(E()).then(f).catch(w)}),[E,c,w]),(0,r.useEffect)((()=>{d(!0),u(x(l,o*l)).then(y).catch(w).finally((()=>d(!1)))}),[o,l,x,u,w]),{isLoading:p,total:m,entities:h}})({tag:t,entityUri:n,page:u,rowsPerPage:s}),y=(0,r.useRef)(null);(0,r.useEffect)((()=>{y.current&&(y.current.scrollTop=0)}),[h]);const x=f>Ca[0];return o().createElement("div",{className:l.perspectiveView},o().createElement(va,{label:t}),o().createElement("div",{className:L()(l.tagsContainer,{[l.fullHeight]:x})},o().createElement(z.Z,{className:l.tagsView},o().createElement(ba,{total:f}),o().createElement("div",{className:l.listContainer},m&&o().createElement(R.Z,null),f>0&&o().createElement("div",{className:l.entitiesList,ref:y},o().createElement(da.Z,{entities:h})),x&&o().createElement("div",{className:l.pagination},o().createElement(V.Z,{count:f,rowsPerPageOptions:Ca,rowsPerPage:s,page:u,onChangePage:p,onChangeRowsPerPage:c}))))))}));Sa.displayName="TagPerspectiveView";const Pa=(0,s.createGenerateClassName)({productionPrefix:"tagPerspective",disableGlobal:!0}),Oa=e=>{let{config:t,tag:n,entityUri:r,store:l,onResize:u=i.identity}=e;return o().createElement(a.Provider,{store:l},o().createElement(p.m.Provider,{value:t.id},o().createElement(s.StylesProvider,{generateClassName:Pa},o().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>u(Math.floor(e),Math.floor(t))}),t&&o().createElement(Sa,{tag:n,entityUri:r}),o().createElement(m.Z,{showErrorFromStore:!0}))))}},1242:(e,t,n)=>{e.exports=n.p+"5271a9e7b6651c852e93.png"}}]);
1
+ "use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[6940],{16940:(e,t,n)=>{n.d(t,{_:()=>da,t:()=>Na});var r=n(24328),o=n.n(r),a=n(52730),l=n(8598),i=n(17440),s=n(36138),c=n(44443),u=n(22664),p=n(39450),d=n(60115),m=n(585),g=n(99493),f=n(87918),b=n.n(f),h=n(3096),y=n.n(h),v=n(87638),x=n(2804),E=n(7718),w=n(3515),C=n(17554),S=n(61756),P=n(57730),O=n(76536),N=n(26481),k=n(49759),Z=n(94150),T=n(26005),R=n(99136),j=n(30268),D=n(21077),I=n(67268),L=n(71153),A=n.n(L),M=n(8962);const U=o().createContext(null);U.displayName="SingleAttributeContext";var z=n(60995),V=n(10237),F=n(58662),H=n(94079),B=n(93416),W=n(75512),q=n(30553),G=n(91181),$=n(32152),_=n(36444),Q=n(79692);const X=(0,Q.Z)((()=>({triggerButton:{minWidth:0,color:"rgba(0,0,0,0.54)",width:"36px"},popupContent:{paddingTop:"19px",paddingBottom:"23px",paddingLeft:"23px",paddingRight:"23px",maxWidth:"180px",width:"40%"},checkboxControlRoot:{marginTop:"6px",marginLeft:"-12px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"}}))),Y=e=>{let{className:t}=e;const n=X(),a=(0,r.useRef)(),[l,i]=(0,r.useState)(!1),{showInactive:s,toggleShowInactive:c}=(0,r.useContext)(U),u=()=>i((e=>!e));return o().createElement(o().Fragment,null,o().createElement(H.Button,{ref:a,classes:{root:A()(n.triggerButton,t)},onClick:u},o().createElement(_.Z,null)),o().createElement(H.Popover,{open:l,classes:{paper:n.popupContent},anchorEl:a.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(H.FormControlLabel,{classes:{root:n.checkboxControlRoot,label:n.checkboxControlLabel},control:o().createElement(H.Checkbox,{className:n.checkboxControlCheckbox,checked:s,onChange:e=>c(e.target.checked)}),label:b().text("Show inactive values")})))},K=(0,Q.Z)((()=>({root:{padding:"0 4px 0 16px"},totalCaption:{lineHeight:"19px",fontSize:"14px",letterSpacing:"0.24px",color:"rgba(0,0,0,0.6)",flexShrink:0,justifyContent:"flex-start",paddingTop:"16px",paddingBottom:"13px"},ovIcon:{marginTop:"2px",marginLeft:"5px"}}))),J=e=>{let{caption:t,totalVisibleValues:n,showInactiveValuesMenu:a}=e;const l=K(),{searchQuery:i,setSearchQuery:s,setPage:c,totalNonVisibleValues:u,nonVisibleValues:p,attributeType:d}=(0,r.useContext)(U);return o().createElement(B.Z,{title:b().text(t),className:l.root},o().createElement(W.Z,{widthToHide:500},o().createElement(q.Z,{height:24,margin:16}),o().createElement(H.Typography,{className:l.totalCaption,variant:"caption"},b().number(n)," ",1===n?b().text("item"):b().text("items"))),o().createElement(G.Z,{nonOvTotal:u,className:l.ovIcon,nonOvValues:p,attributeType:d}),o().createElement($.i,{query:i,onChange:e=>{s(e),c(0)}}),a&&o().createElement(Y,null))};var ee=n(65549),te=n(93140),ne=n(76134),re=n(96698);const oe=(0,Q.Z)((e=>({moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},divider:{margin:"0 -16px 8px",backgroundColor:"rgba(0,0,0,0.12)"},ovFalse:e.inactive}))),ae=g.nIW,le=(e,t)=>"object"==typeof e?Object.values(e).some((e=>e.some((e=>{let{value:n}=e;return le(n,t)})))):g.P6Y.strings.search(String(e),t),ie=async e=>{let{metadata:t,entity:n,attributeTypeUri:r,defaultMaxValues:o=1/0,offset:a=0,searchQuery:l=""}=e;const s=(0,i.pipe)(g.XtP,(0,i.filter)((e=>{let{value:t}=e;return le(t,l)})))(t,n,r),c=(0,i.filter)(g.OXP,s);return{[(0,g.xy8)(r)]:{[ae(r)]:c.slice(a,a+o),paging:{[r]:{totalOvValues:c.length,totalValues:s.length}}}}};function se(){return se=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},se.apply(this,arguments)}function ce(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ue(e,t,n[t])}))}return e}function ue(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const pe=[],de=e=>{let{values:t,attributeType:n,parentUri:l,showInactive:s}=e;const c=oe(),{uri:u,required:d,cardinality:m,name:f}=n,h=(0,a.useDispatch)(),y=(0,r.useContext)(p.m),x=(0,a.useSelector)(v.ZP.selectors.getEntity),E=(0,a.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,x.uri)||{})),w=(0,a.useSelector)((e=>v.ZP.selectors.getActiveErrorsForAttributesPager(e,l,n))),C=(0,a.useSelector)((e=>(0,g.tQX)(l,n,v.ZP.selectors.getProfileErrors(e)))),S=(0,a.useSelector)(v.ZP.selectors.getMode),P=(0,g.xy8)(n),O=(0,i.pipe)((0,i.pathOr)(pe,[P,f]),(0,i.map)((0,i.prop)("uri")))(x),N=(0,i.pathOr)(pe,[P,f],E),k=N.map((0,i.prop)("uri")),Z=(0,g.ZiX)(x.uri),T=(0,r.useRef)((0,g.gjI)({parentUri:l,attributeType:n})),R=(0,g.O27)(N),j=d&&R,D=j?[T.current]:N.filter((0,i.pipe)((0,i.prop)("uri"),g.ZiX)),I=(0,r.useCallback)((e=>(0,i.pipe)(v.N5.actions.addAttributes,h)(e.map((e=>ce({},e,{viewId:y}))))),[y,h]),L=(0,r.useCallback)((e=>(0,i.pipe)(v.N5.actions.modifyAttribute,h)(ce({},e,{viewId:y}))),[y,h]),M=(0,r.useCallback)((e=>(0,i.pipe)(v.N5.actions.removeAttribute,h)(ce({},e,{viewId:y}))),[y,h]),U=(0,r.useCallback)((0,i.pipe)(v.N5.errors.actions.errorDeactivated,h),[h]),z=(0,r.useCallback)((()=>{const e={parentUri:l,attributeType:n};return I(j&&!(0,g.YkM)(n.type)?[e,e]:[e])}),[I,l,n,j]),V=(0,g.Vg3)({attributeType:n,mode:S}),F={attributeType:n,errors:w,crosswalks:E.crosswalks,mode:S,onAddAttributes:I,onChangeAttribute:L,onDeactivateError:U,showNonOv:s};return o().createElement("div",null,o().createElement(te.Z,{cardinality:m}),o().createElement(ne.Z,{message:C}),V&&o().createElement(H.Button,{color:"primary",onClick:z,className:c.moreButton},o().createElement(ee.Z,{classes:{root:c.icon}}),o().createElement("div",{className:c.buttonLabel},b().text("Add"))),D.map(((e,t)=>o().createElement(re.Z,se({key:e.uri},F,{attributeValue:e,lazy:j&&!d,showEmptyEditors:Z,ownError:(0,g.ADq)(e,t,u,w),onDeleteAttribute:M})))),D.length>0&&t.length>0&&o().createElement(H.Divider,{className:c.divider}),t.map((e=>{const t=N.find((0,i.propEq)("uri",e.uri)),n=t||e,r=O.includes(n.uri)&&!k.includes(n.uri),a=!r&&t&&!((e,t)=>{const n=(0,i.is)(Object,e.value)||(0,i.is)(Object,t.value)?(0,i.over)((0,i.lensPath)(["value"]),(0,g.vKJ)({valueTransformer:(0,i.unless)(g.OXP,(0,i.omit)(["value"])),deleteEmptyComplex:!0})):i.identity;return(0,i.equals)(n(e),n(t))})(t,e),l=(0,i.cond)([[(0,i.always)(r),(0,i.always)("deleted")],[(0,i.always)(a),(0,i.always)("edited")]])();return o().createElement("div",{key:n.uri,className:A()({[c.ovFalse]:!(0,g.OXP)(n)})},o().createElement(re.Z,se({},F,{attributeValue:n,ownError:(0,g.ADq)(n,null,u,w),onDeleteAttribute:M,state:l})))})))};var me=n(81303);const ge=(0,Q.Z)((e=>({ovFalse:e.inactive}))),fe=e=>{let{values:t,attributeType:n,showInactive:r}=e;const a=ge();return o().createElement(o().Fragment,null,t.map((e=>o().createElement("div",{key:e.uri,className:A()({[a.ovFalse]:!(0,g.OXP)(e)})},o().createElement(me.Z,{attributeValue:e,attributeType:n,showNonOv:r})))))},be=(0,Q.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",padding:"4px 16px 9px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"},pagination:{flexGrow:0,flexShrink:0}}))),he=e=>{let{config:t,className:n}=e;const{caption:l,max:i,showInactiveValuesMenu:s}=t,c=be(),{values:u,totalVisibleValues:p,page:d,setPage:m,isLoading:g,hasPaging:f,attributeType:h,showInactive:y}=(0,r.useContext)(U),x=(0,a.useSelector)(v.ZP.selectors.getEntityUri),E=(0,a.useSelector)(v.ZP.selectors.getIsViewMode),w=(0,a.useSelector)(v.ZP.selectors.getIsEditableMode),C=(0,a.useSelector)(v.ZP.selectors.getPivotingAttributes),S=0!==u.length;return o().createElement(z.J.Provider,{value:C},o().createElement(V.Z,{className:A()(c.root,n)},o().createElement(J,{totalVisibleValues:p,caption:l,showInactiveValuesMenu:s}),o().createElement(H.Box,{className:c.content},(()=>{if(g)return o().createElement(R.Z,null);if(h){if(E&&S){const e={values:u,attributeType:h,showInactive:y};return o().createElement(fe,e)}if(w){const e={values:u,attributeType:h,parentUri:x,showInactive:y};return o().createElement(de,e)}}return o().createElement(H.Typography,{className:c.noData},b().text("No data"))})()),f&&o().createElement(F.Z,{count:p,page:d,rowsPerPage:i,rowsPerPageOptions:[],onChangePage:m,classes:{root:c.pagination}})))};var ye=n(67218),ve=n(20562);function xe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ee=(e,t,n)=>{const{attributeUri:o,max:l=15}=e,s=(0,a.useSelector)(v.ZP.selectors.getMetadata),[c,u]=(0,r.useState)([]),[p,d]=(0,r.useState)(null),[m,f]=(0,r.useState)(!1),b=(0,ye._)(),h=(0,r.useRef)(null),y=(0,a.useDispatch)(),x=(0,a.useSelector)(v.ZP.selectors.getApiPath),E=(0,a.useSelector)(v.ZP.selectors.getTenant),w=n?v.ZP.selectors.getEntityWithDiff:v.ZP.selectors.getEntityWithoutDiff,C=(0,a.useSelector)(w),S=(0,a.useSelector)(v.ZP.selectors.getIsViewMode),P=(0,a.useSelector)(v.ZP.selectors.getIsHistoryModeEnabled),O=(0,a.useSelector)(v.ZP.selectors.getHistoryDiff),N=C.uri,k=ae(o),Z=(0,g.xy8)(o);h.current=(0,g.JQy)(C,N,k);const T=(0,r.useMemo)((()=>(0,g.zeJ)(s,o)),[s,o]),{globalFilter:R}=(0,a.useSelector)(v.ZP.selectors.getGlobalSearchRequestOptions),{showInactive:j}=t,D=(0,r.useCallback)((()=>{if(T&&(0,g.Uty)(T)&&!(0,g.ZiX)(N)&&(0,g.YOQ)(o)){f(!0);const{page:e,showInactive:n}=t,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["page","showInactive"]),a=(0,g.biM)(C)||P?ie:g.KbL;b(a(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){xe(e,t,n[t])}))}return e}({metadata:s,entity:C,apiPath:x,tenant:E,parentUri:N,defaultMaxValues:l,attributeTypeUri:o,offset:l*e,globalFilter:R,options:n?"":void 0},r))).then((e=>{const t=(0,i.path)([Z],e),n=(0,i.pathOr)([],[k],t);P||y(v.N5.actions.processNextPageOfAttributeValues({parentUri:N,attributeTypeUri:o,attributeTypeName:k,values:n})),u(n.map((e=>{var t;return(null===(t=h.current)||void 0===t?void 0:t.find((0,i.propEq)("uri",e.uri)))||e}))),d((0,i.path)(["paging",o],t))})).finally((()=>{f(!1)}))}else u([]),d(null)}),[x,N,E,o,l,s,t,R,T,P,O]);(0,r.useEffect)((()=>{D()}),[D]),(0,ve.D)((()=>{S&&D()}),[S]);const I=(0,i.partition)(g.OXP),[,L]=I(h.current||[]),A=j?[]:L,M=j?"totalValues":"totalOvValues",U=(0,i.ifElse)((0,i.has)(M),(0,i.prop)(M),(0,i.always)(c.length))(p),z=l<U,V=null!=p&&p.totalValues?p.totalValues-U:A.length;return{values:c,isLoading:m,hasPaging:z,totalVisibleValues:U,attributeType:T,totalNonVisibleValues:V,nonVisibleValues:A}};function we(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ce=n(37152),Se=n(31274),Pe=n(79026),Oe=n(8818),Ne=n(90324),ke=n(70595);const Ze=o().createContext(null);Ze.displayName="RelationsViewStateContext";const Te=(0,Q.Z)((e=>({button:{color:e.palette.text.secondary,width:"36px",minWidth:"36px"},popupContent:{padding:"19px 23px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"},divider:{backgroundColor:"rgba(0,0,0,0.1)",margin:"19px -23px"},title:{marginBottom:"30px"},sortControls:{display:"flex",alignItems:"center"},sortSelectorRoot:{flex:1,padding:"13px 16px",fontSize:"0.85rem"},sortSelectorMenuItem:{fontSize:"0.85rem"},sortOrderButton:{flexShrink:0,margin:"0 8px 0 7px"}}))),Re=e=>{let{className:t}=e;const n=Te(),a=(0,r.useRef)(),{showInactive:l,toggleShowInactive:i,sortOrder:s,toggleSortOrder:c,sortOption:u,changeSortOption:p,sortOptions:d}=(0,r.useContext)(Ze),[m,f]=(0,r.useState)(!1),h=()=>f((e=>!e)),y=!(0,g.O27)(d),v="asc"===s;return o().createElement(o().Fragment,null,o().createElement(H.Button,{ref:a,classes:{root:A()(n.button,t)},onClick:h},o().createElement(_.Z,null)),o().createElement(H.Popover,{open:m,classes:{paper:n.popupContent},anchorEl:a.current,onClose:h,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(H.FormControlLabel,{classes:{label:n.checkboxControlLabel},control:o().createElement(H.Checkbox,{className:n.checkboxControlCheckbox,checked:l||!1,onChange:i}),label:b().text("Show inactive Relationships")}),y&&o().createElement(o().Fragment,null,o().createElement(H.Divider,{className:n.divider}),o().createElement(H.Typography,{className:n.title,variant:"h6"},b().text("Sort by")),o().createElement("div",{className:n.sortControls},o().createElement(Pe.Z,{entries:d,TextFieldProps:{variant:"filled"},classes:{root:n.sortSelectorRoot,menuItem:n.sortSelectorMenuItem},fullWidth:!0,disableUnderline:!0,value:u,onChange:p,MenuProps:{getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"left"}}}),o().createElement(Oe.k,{tooltipTitle:v?b().text("Ascending"):b().text("Descending"),icon:v?Ne.Z:ke.Z,onClick:c,className:n.sortOrderButton,size:"L"})))))};Re.displayName="FilterButton";const je=Re,De=(0,Q.Z)({header:{padding:"0 6px 0 16px"},totalCaption:{lineHeight:"19px",fontSize:"14px",letterSpacing:"0.24px",color:"rgba(0,0,0,0.6)",flexShrink:0,marginRight:"5px",justifyContent:"flex-start",paddingTop:"16px",paddingBottom:"13px"}});var Ie=n(61932),Le=n(55847);const Ae=o().createContext(null);function Me(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ue(e,t,n[t])}))}return e}function Ue(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ze=Math.pow(2,31)-1,Ve=(0,Q.Z)((()=>({tenant:{backgroundColor:"#0000EE",cursor:"pointer",position:"absolute",top:"8px",left:"22px",width:"10px",height:"10px",color:"white",fontSize:"10px",fontWeight:"bold",userSelect:"text",zIndex:1,display:"flex",alignItems:"center",justifyContent:"center"},button:{position:"relative"},badge:{fontSize:"10px",height:"14px",minWidth:"14px",width:"14px",fontWeight:"bold",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px",top:"4px"}})));var Fe=n(81137);const He=e=>{let{label:t}=e;const n=Ve();return o().createElement(H.Badge,{classes:{anchorOriginTopRightRectangle:n.badgePosition,badge:n.badge},badgeContent:t},o().createElement(Ie.Z,null))},Be=()=>{const{tenants:e,selectedTenant:t,onConfirmImport:n,onCancelConfirmation:l,onImportClick:i}=(()=>{var e;const t=(0,a.useSelector)(v.ZP.selectors.getDataTenants),n=(0,a.useDispatch)(),{config:o,reloadRelations:l}=(0,r.useContext)(Ae),i=(0,a.useSelector)(v.ZP.selectors.getEntityUri),[s,c]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),d=(0,a.useSelector)(v.ZP.selectors.getDtssPath),m=(0,a.useSelector)(v.ZP.selectors.getTenant),f=[Me({},o.content,{offset:0,max:null!==(e=o.maxDtssImport)&&void 0!==e?e:ze})],h=(0,r.useCallback)((()=>{c([]),o.importFromDT&&!(0,g.ZiX)(i)&&Promise.all((t||[]).map((e=>(0,g.QXb)({entityUri:i,content:f,dtssPath:d,customerTenant:m,dataTenant:e.id}).then((t=>{let{hasNonImportedConnections:n}=t;return Me({},e,{hasNonImportedConnections:n})}))))).then((e=>e.filter((e=>e.hasNonImportedConnections)))).then(c)}),[i,d,m,o,t]),y=(0,r.useCallback)((()=>{(0,g.MOC)({entityUri:i,content:f,dtssPath:d,customerTenant:m,dataTenant:u.id}).then((()=>{l(),h()})).catch((e=>n(v.ui.actions.errorSet((0,g.xU7)(e,b().text("Something went wrong")))))),p(null)}),[i,d,m,o,h,l,u,p]);(0,r.useEffect)((()=>{h()}),[h]);const x=(0,r.useCallback)((()=>p(null)),[]),E=(0,r.useCallback)((e=>p(e)),[]);return{tenants:s,selectedTenant:u,onConfirmImport:y,onCancelConfirmation:x,onImportClick:E}})(),s=Ve(),c=1===e.length,u=c?0===e[0].label.indexOf("DT:")?e[0].label[3]:e[0].label[0]:e.length;return o().createElement(o().Fragment,null,!!e.length&&o().createElement(o().Fragment,null,c?o().createElement("div",{className:s.button},o().createElement(Oe.k,{size:"L",icon:Ie.Z,tooltipTitle:b().text("Import connections from ${label}",{label:e[0].label}),onClick:()=>i(e[0])}),o().createElement("div",{className:A()(s.tenant)},u)):o().createElement(Le.Z,{menuId:"importDT-table-actions",buttonComponent:Oe.k,buttonProps:{tooltipTitle:b().text("Import connections"),size:"L",icon:()=>o().createElement(He,{label:u})},menuItems:e.map((e=>({onClick:()=>{i(e)},text:e.label})))}),o().createElement(Fe.Z,{open:!!t,title:b().text("Confirmation"),content:b().text("Import connections from ${label}?",{label:null==t?void 0:t.label}),discardCaption:b().text("Cancel"),saveCaption:b().text("Import"),onDiscard:l,onSave:n})))},We=e=>{let{title:t,total:n}=e;const a=De(),{searchQuery:l,changeSearchQuery:i}=(0,r.useContext)(Ze);return o().createElement(B.Z,{title:t||"",className:a.header},n>0&&o().createElement(W.Z,{widthToHide:400},o().createElement(q.Z,{height:24,margin:16}),o().createElement(H.Typography,{className:a.totalCaption,variant:"caption"},n>1?b().text("${count} items",{count:n}):b().text("${count} item",{count:n}))),o().createElement($.i,{query:l,onChange:i}),o().createElement(Be,null),o().createElement(je,null))};var qe=n(11013),Ge=n(27604),$e=n(22983),_e=n(31254),Qe=n(31039);const Xe=(0,Q.Z)((e=>({tooltip:e.tooltip,tooltipContent:{minWidth:"165px",padding:"4px 2px 2px"},label:{fontSize:"11px",lineHeight:"13px",fontWeight:500,margin:0,color:"white"},secondaryLabel:{color:"rgba(255, 255, 255, 0.7)",fontSize:"10px",marginTop:"4px",fontWeight:500,lineHeight:"11px"},progress:{marginTop:"4px",color:"#FFFFFF"}})));function Ye(){return Ye=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ye.apply(this,arguments)}const Ke=e=>{let{label:t,entity:n,children:l}=e,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["label","entity","children"]);const c=Xe(),u=(0,ye._)(),p=(0,a.useSelector)(v.ZP.selectors.getTenant),d=(0,a.useSelector)(v.ZP.selectors.getDtssPath),[m,f]=(0,r.useState)(!1),[b,h]=(0,r.useState)(null);(0,r.useEffect)((()=>{h(null)}),[n]);const y=(0,r.useCallback)((()=>{if(null!=n&&n.entityUri&&(0,i.isNil)(b)){const e=(0,i.ifElse)(g.biM,(e=>(0,g.vTU)({entityUri:e.entityUri,dataTenant:e.dataTenant,customerTenant:p,dtssPath:d})),(e=>(0,g.XkT)(e.entityUri)));f(!0),u(e(n)).then((e=>{let{secondaryLabel:t}=e;h(t)})).finally((()=>{f(!1)}))}}),[d,n,p,u,b]),x=o().createElement("div",{className:c.tooltipContent},o().createElement("div",{className:c.label},t),m&&o().createElement(H.CircularProgress,{size:16,classes:{colorPrimary:c.progress}}),b&&o().createElement("div",{className:c.secondaryLabel},b));return o().createElement(H.Tooltip,Ye({onOpen:y,title:x,disableFocusListener:!0,classes:{tooltip:c.tooltip}},s),l)},Je=(e,t)=>{const{entity:n,relation:r}=e;return{entityType:(0,g.nt9)(t,null==n?void 0:n.entityType),entityLabel:(0,g.idV)(null==n?void 0:n.entityLabel),preparedUri:(0,g.wwR)({uri:null==n?void 0:n.entityUri,dataTenant:null==n?void 0:n.dataTenant}),relationLabel:(null==r?void 0:r.relationLabel)||(0,g.Lmx)(t,null==r?void 0:r.relationType)}};var et=n(77277);const tt=(0,Q.Z)((()=>({container:{display:"flex"}})));function nt(){return nt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nt.apply(this,arguments)}const rt=e=>{let{acceptRelation:t,ignoreRelation:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["acceptRelation","ignoreRelation"]);const a=tt();return o().createElement("div",{className:a.container},o().createElement(et.Z,nt({onClick:t,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),b().text("Accept")),o().createElement(et.Z,nt({onClick:n,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),b().text("Ignore")))},ot=(0,Q.Z)((e=>({container:{display:"flex",flexDirection:"column",marginBottom:"2px"},row:{display:"flex",alignItems:"center",flexDirection:"row",minHeight:"24px",padding:"0 16px"},rowInactive:{background:e.inactiveBackground},entityAvatar:{height:"12px",width:"12px",fontSize:"11px",marginRight:"8px"},entityLabelContainer:{textDecoration:"none",cursor:"pointer",paddingRight:"8px"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},editButtonsContent:{marginLeft:"auto",flex:"0 0 40px"},editButtons:{padding:0},removed:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary,margin:"0 5px"}}))),at=(0,r.memo)((e=>{let{connection:t,metadata:n,showControls:a,onRemoveRelation:l,onEditRelation:i,onAcceptRelation:s,onIgnoreRelation:c,renderRelationArrowButton:u}=e;const p=ot(),{entity:d,relation:m}=t,f=(0,g.$qe)(t),h=(0,g.xr3)(t),y=(0,g.iJH)(t),{entityType:v,entityLabel:x,preparedUri:E,relationLabel:w}=Je(t,n),C=(0,g.Fn9)(m)&&(0,g.Fn9)(d),{canRemove:S,canUpdate:P}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:o,onEditRelation:a}=e;if((n===g.ARY.Editing||n===g.ARY.Suggesting)&&r){const{relation:{relationType:e}}=r,l=(0,g.$qe)(r),i=(0,g.V3K)(t,e);return{canRemove:o&&!l&&(0,g.Edd)(n,i),canUpdate:a&&!l&&(0,g.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:g.ARY.Editing,onRemoveRelation:l,onEditRelation:i,metadata:n,connection:t}),O=(0,r.useCallback)((()=>l(t.relation.relationUri)),[l,t]),N=(0,r.useCallback)((()=>i(t)),[i,t]),k=(0,r.useCallback)((()=>{s(t)}),[s,t]),Z=(0,r.useCallback)((()=>c(t)),[c,t]),T=(S||P)&&a&&!t.suggested?o().createElement(o().Fragment,null,P&&o().createElement(Oe.k,{icon:Ge.Z,size:"XS",onClick:N,tooltipTitle:b().text("Edit")}),S&&o().createElement(Oe.k,{icon:$e.Z,size:"XS",onClick:O,tooltipTitle:b().text("Remove")})):void 0,R=t.suggested?o().createElement(rt,{acceptRelation:k,ignoreRelation:Z,size:"small",disabled:y}):void 0,j=y?b().text("ignored"):b().text("edited");return o().createElement("div",{className:A()(p.container,{[p.rowInactive]:!C},{[p.removed]:f||y})},o().createElement("div",{className:p.row},u&&u(),o().createElement(_e.Z,{className:p.entityAvatar,entityType:v}),o().createElement(Qe.Z,{value:E,className:p.entityLabelContainer},o().createElement(Ke,{label:x,entity:d},o().createElement("span",{className:p.entityLabel},x)),(h||y)&&o().createElement(H.Typography,{variant:"caption",className:p.editedLabel},"(",j,")"),w&&o().createElement("span",{className:p.relationLabel},`, ${w}`)),o().createElement("div",{className:p.editButtonsContent},T),R))}));at.displayName="EditableRelationItem";const lt=at,it=(e,t)=>{const n=(e,t)=>(t?(0,g.VGB)(t):[]).map((t=>({type:t,direction:e===g.Nsj.IN?g.Nsj.IN:g.Nsj.OUT})));return n(g.Nsj.IN,e).concat(n(g.Nsj.OUT,t))[0]};function st(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ct=n(98989),ut=n(83543);const pt=(0,Q.Z)({arrowIcon:{fontSize:"16px",marginRight:"6px"}}),dt=e=>{let{onClick:t,connection:n,config:r,showSecondLevel:a}=e;const l=pt(),{parentEntityUri:i}=n,{contentSecondLevel:s}=r,c={onClick:t,className:l.arrowIcon};return i||!s||(0,g.xvW)(n)?null:a?o().createElement(ut.Z,c):o().createElement(ct.Z,c)},mt=(0,Q.Z)({row:{display:"flex",alignItems:"center",width:"100%"},secondLevelContent:{paddingLeft:"24px"}}),gt=e=>{let{config:t,connection:n,children:l}=e;const i=mt(),{showInactive:s}=(0,r.useContext)(Ze),{connections:c,showSecondLevel:u,toggleShowSecondLevel:p,loadRelations:d,loading:m,total:f}=(e=>{let{config:t,connection:n,relationActivityFilter:o}=e;const l=(0,a.useDispatch)(),[i,s]=(0,r.useState)(!1),[c,u]=(0,r.useState)(!1),[p,d]=(0,r.useState)(0),{contentSecondLevel:m}=t,{entity:f}=n,b=(0,a.useSelector)((e=>v.ZP.selectors.getConnectionsWithDraftsByViewId(e,t.id,f.entityUri)))||[],{activityFilter:h}=(0,a.useSelector)(v.ZP.selectors.getGlobalSearchRequestOptions)||{},y=(0,r.useCallback)((()=>{const e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){st(e,t,n[t])}))}return e}({},m,{returnObjects:!0,returnDates:!0,activeness:{relation:o||g.Ng6.ALL,entity:h}});u(!0),(0,g.N6e)(f.entityUri,[e]).then((e=>{const{connections:n,total:r}=e[0];n&&l(v.N5.relations.actions.secondLevelRelationsLoaded({connections:n,parentEntityUri:f.entityUri,id:t.id})),d(r),u(!1)}))}),[t.id,m,l,f.entityUri,h,o]),x=(0,r.useCallback)((()=>{i||n.connections||y(),s((e=>!e))}),[y,n.connections,i]);return{connections:b,showSecondLevel:i,toggleShowSecondLevel:x,loadRelations:y,loading:c,total:p}})({config:t,connection:n,relationActivityFilter:s?g.Ng6.ALL:g.Ng6.ACTIVE_ONLY}),b=(0,r.useMemo)((()=>(0,g.Px$)(c)),[c]);return o().createElement(o().Fragment,null,l((()=>o().createElement(dt,{onClick:p,connection:n,config:t,showSecondLevel:u}))),u&&o().createElement(Se.X.Provider,{value:b},o().createElement("div",{className:i.secondLevelContent},o().createElement(Gt,{isLoading:m,config:t,loadRelations:d,connections:c,total:f,parentEntityUri:n.entity.entityUri}))))},ft=(0,Q.Z)((e=>({moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px",marginLeft:"16px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},divider:{margin:"0 0 8px",backgroundColor:"rgba(0,0,0,0.12)"},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),bt=e=>{let{className:t,connections:n=[],config:l,mode:s,noDataText:c,parentEntityUri:u}=e;const p=(0,a.useSelector)(v.ZP.selectors.getMetadata),d=(0,a.useSelector)((e=>v.ZP.selectors.getRelationToAddByViewId(e,l.id))),m=(0,a.useSelector)((e=>v.ZP.selectors.getRelationsToEditByViewId(e,l.id))),f=(0,a.useSelector)(v.ZP.selectors.getEntity),h=(0,a.useSelector)((e=>v.ZP.selectors.getCheckIfCanAddRelations(e,l.content))),y=(0,a.useDispatch)(),x=ft(),E=(0,r.useCallback)((()=>{const e=(0,g.vlo)({config:l,mode:s,metadata:p,parentEntityUri:u});(0,i.pipe)(v.N5.relations.actions.openRelationEditor(l.id),y)(e)}),[l,s,p,y,u]),w=(0,r.useCallback)((e=>{y(v.N5.relations.actions.closeRelationEditor(l.id,e)),y(v.N5.relations.actions.removeRelation(l.id,e));const t=n.find((t=>v.N5.relations.selectors.getRelationUriFromConnection(t)===e)),r=v.N5.relations.selectors.getEntityUriFromConnection(t);(0,g.ZiX)(r)&&y(v.N5.modifiedEntities.actions.entityDeleted(r))}),[l,n,y]),C=l.content,S=it(C.inRelations,C.outRelations),P=(0,r.useCallback)((e=>{const t=(0,i.pipe)((0,i.omit)(["suggested"]),(0,i.evolve)({relation:{relationType:(0,i.always)(S.type),object:(0,i.evolve)({type:(0,i.always)(S.type),attributes:(0,i.always)(null)})}}))(e);y(v.N5.relations.actions.addRelation(l.id,t))}),[y,l,S]),O=(0,r.useCallback)((e=>{y(v.N5.relations.actions.ignoreRelation(l.id,{relationType:S.type,relationDirection:S.direction,entityUri:e.entity.entityUri,relationUri:e.relation.relationUri}))}),[y,l,S]),[N,k]=(0,i.partition)(g.xvW,n),Z=f&&h,T=0===N.length&&0===k.length,R=e=>{var t,n;const r=m.find((t=>{var n,r;return(null==t||null===(n=t.relation)||void 0===n?void 0:n.relationUri)===(null==e||null===(r=e.relation)||void 0===r?void 0:r.relationUri)})),a=!l.allowOnlyCreateNew||(0,g.xvW)(e),c=`${null==e||null===(t=e.relation)||void 0===t?void 0:t.relationUri}-${null==e||null===(n=e.relation)||void 0===n?void 0:n.direction}`;return o().createElement(gt,{config:l,connection:e,key:c},(t=>r?o().createElement(qe.Z,{connection:r,config:l,mode:s,metadata:p}):o().createElement(lt,{renderRelationArrowButton:t,connection:e,metadata:p,showControls:a,onRemoveRelation:w,onEditRelation:(0,i.pipe)(v.N5.relations.actions.openRelationEditor(l.id),y),onAcceptRelation:P,onIgnoreRelation:O})))},j=Z&&(!d||d&&d.parentEntityUri===u),D=d&&d.parentEntityUri===u;return o().createElement("div",{className:t},j&&o().createElement(H.Button,{color:"primary",onClick:E,className:x.moreButton},o().createElement(ee.Z,{classes:{root:x.icon}}),o().createElement("div",{className:x.buttonLabel},b().text("Add"))),D&&o().createElement(qe.Z,{connection:d,config:l,mode:s,metadata:p}),N.map(R),N.length>0&&k.length>0&&o().createElement(H.Divider,{className:x.divider}),k.map(R),T&&o().createElement(H.Typography,{className:x.noData},c))};var ht=n(19603),yt=n(94646),vt=n(78101),xt=n(80931);const Et=(0,Q.Z)((e=>({attributesList:{paddingLeft:"46px",paddingRight:"16px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0}})));function wt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ct(e,t,n[t])}))}return e}function Ct(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const St=e=>{let{connection:t,className:n}=e;const l=Et(),{relation:s}=t,c=(0,a.useSelector)(v.ZP.selectors.getEntityUriWithDataTenant),u=(0,a.useSelector)(v.ZP.selectors.getMetadata),p=(0,r.useMemo)((()=>(0,g.xF8)(u,null==s?void 0:s.relationType)),[null==s?void 0:s.relationType,u]),d=(0,r.useMemo)((()=>wt({attributes:wt({},v.N5.relations.selectors.getRelationAttributesFromConnection(t))},(0,g.p2l)((null==t?void 0:t.relation)||{}))),[t]),m=(0,r.useMemo)((()=>(0,g.fyF)(p,d)),[p,d]).filter((e=>{let{values:t}=e;return!(0,g.O27)(t)})).length>0,f=(0,r.useMemo)((()=>(0,g.R$r)(d.attributes)),[d]),{getCommentsCount:h}=(0,r.useContext)(w.h);(0,r.useEffect)((()=>{!(0,i.isEmpty)(f)&&h(f)}),[h,f]);const y=(0,r.useMemo)((()=>(0,g.wp9)(g.q7e.RELATION,{entityUri:c,connection:t})),[t,c]);return m?o().createElement(vt.A.Provider,{value:y},o().createElement(xt.Z,{className:A()(l.attributesList,n),entity:d,attrTypes:p})):o().createElement("div",{className:A()(l.attributesList,n)},b().text("No attributes"))};var Pt=n(86602),Ot=n(82726);const Nt=e=>{let{show:t,onToggle:n,className:r}=e;return o().createElement(Oe.k,{className:r,tooltipTitle:t?b().text("Hide attributes of the relationship"):b().text("Show attributes of the relationship"),tooltipPlacement:"bottom-end",size:"XXS",icon:t?Pt.Z:Ot.Z,onClick:n})},kt=(0,Q.Z)((e=>({container:{display:"flex",flexDirection:"column",paddingBottom:"2px"},row:{display:"flex",alignItems:"flex-start",flexDirection:"row",minHeight:"16px",padding:"3px 16px 0 "},rowInactive:{background:e.inactiveBackground},entityAvatar:{height:"12px",width:"12px",fontSize:"11px",marginRight:"8px"},entityLabelContainer:{textDecoration:"none",cursor:"pointer",paddingRight:"8px",wordBreak:"break-all"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},showDetails:{marginLeft:"auto"},attributesList:{paddingLeft:"46px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0},suggestedWrapper:{backgroundColor:e.suggested},commentsContainer:{marginLeft:"auto",alignItems:"center","& + $showDetails":{marginLeft:"4px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex"},suggestedLabelWrapper:{marginTop:"6px"},labelWrapper:{display:"flex"}}))),Zt=(0,r.memo)((e=>{let{connection:t,renderRelationArrowButton:n,acceptRelation:l,ignoreRelation:s}=e;const c=kt(),u=t.suggested,{entity:p,relation:d}=t,[m,f]=(0,r.useState)(!1),b=(0,a.useSelector)(v.ZP.selectors.getMetadata),{entityType:h,entityLabel:y,preparedUri:x,relationLabel:E}=Je(t,b),w=(0,g.Fn9)(d)&&(0,g.Fn9)(p),C=(0,a.useSelector)(v.ZP.selectors.getEntityUriWithDataTenant),S=p&&d&&(0,g.wp9)(g.q7e.RELATION,{entityUri:C,connection:t})||[];return o().createElement("div",{className:A()(c.container,{[c.rowInactive]:!w},{[c.suggestedWrapper]:u})},o().createElement("div",{className:A()(c.row,ht.U)},n&&n(),o().createElement("div",{className:A()(c.labelWrapper,{[c.suggestedLabelWrapper]:u})},o().createElement(_e.Z,{className:c.entityAvatar,entityType:h}),o().createElement(Qe.Z,{value:x,className:c.entityLabelContainer},o().createElement(Ke,{label:y,entity:p},o().createElement("span",{className:c.entityLabel},y)),E&&o().createElement("span",{className:c.relationLabel},`, ${E}`))),o().createElement("div",{className:c.additionalButtonsWrapper},!(0,i.isEmpty)(S)&&o().createElement(yt.Z,{className:c.commentsContainer,uri:(0,g.gjS)(d),relatedObjectUris:S,objectType:g.q7e.RELATION,allowOnlyOneComment:!0}),u&&o().createElement(rt,{size:"small",acceptRelation:l(t),ignoreRelation:s(t)}),!u&&o().createElement(Nt,{show:m,onToggle:()=>{f((e=>!e))},className:c.showDetails}))),m&&o().createElement(St,{connection:t}))}));Zt.displayName="RelationItem";const Tt=Zt;var Rt=n(52691),jt=n(16208);const Dt=e=>e.filter((e=>5===e.value)).length,It=e=>e.filter((e=>1===e.value)).length,Lt=e=>0===e.length?"0%":Dt(e)/e.length*100+"%",At=e=>0===e.length?"0%":It(e)/e.length*100+"%",Mt=(0,Q.Z)((e=>({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-end"},averageRating:{marginBottom:"7px",fontSize:"16px",letterSpacing:"0.15px",lineHeight:"19px",color:e.palette.text.primary},scale:{display:"flex",marginBottom:"6px",width:"128px",height:"4px"},likesScale:{height:"100%",backgroundColor:"#8CC152"},dislikesScale:{height:"100%",backgroundColor:"rgb(255, 112, 112)"},counts:{display:"flex"},likesCount:{marginRight:"32px"},count:{display:"flex",alignItems:"center",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},icon:{marginRight:"4px",width:"14px",height:"14px",color:"rgba(0,0,0,0.38)"}}))),Ut=e=>{let{ratings:t,className:n}=e;const r=Mt();return o().createElement("div",{className:A()(r.wrapper,n)},o().createElement(H.Typography,{className:r.averageRating},(e=>(0,i.pipe)((0,i.pluck)("value"),i.mean,(0,i.defaultTo)(0))(e))(t).toFixed(1)),o().createElement("div",{className:r.scale},o().createElement("div",{className:r.likesScale,style:{width:Lt(t)}}),o().createElement("div",{className:r.dislikesScale,style:{width:At(t)}})),o().createElement("div",{className:r.counts},o().createElement("div",{className:A()(r.likesCount,r.count)},o().createElement(Rt.Z,{className:r.icon}),Dt(t)),o().createElement("div",{className:r.count},o().createElement(jt.Z,{className:r.icon}),It(t))))},zt=(0,Q.Z)((e=>({wrapper:{display:"flex"},button:{fontSize:"14px",textTransform:"none",color:e.palette.text.secondary},likeButton:{marginLeft:"-12px",marginRight:"8px"},isActive:{color:e.palette.text.primary}}))),Vt=e=>{let{ratings:t,onAgree:n,onDisagree:r}=e;const l=zt(),i=(0,a.useSelector)(v.ZP.selectors.getUserName),s=t.find((e=>{let{user:t}=e;return t===i})),c=[{text:b().text("Has left the practice"),onClick:()=>r(b().text("Has left the practice"))},{text:b().text("Has moved away"),onClick:()=>r(b().text("Has moved away"))},{text:b().text("Has passed away"),onClick:()=>r(b().text("Has passed away"))},{text:b().text("Has retired"),onClick:()=>r(b().text("Has retired"))},{text:b().text("Other"),onClick:()=>r(b().text("Other"))}];return o().createElement("div",{className:l.wrapper},o().createElement(H.Button,{onClick:n,variant:"text",size:"small",className:A()(l.button,l.likeButton,{[l.isActive]:5===(null==s?void 0:s.value)})},"Agree"),o().createElement(Le.Z,{buttonProps:{endIcon:o().createElement(ut.Z,null),variant:"text",size:"small",className:A()(l.button,{[l.isActive]:1===(null==s?void 0:s.value)})},buttonContent:1===(null==s?void 0:s.value)?s.comment:"Disagree",menuItems:c,menuId:"disagree-dropdown-menu-button"}))},Ft=(0,Q.Z)((e=>({wrapper:{padding:"6px 16px 3px"},entityTypeIcon:{marginRight:"16px"},entityLabel:{color:e.palette.primary.main,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},entityLabelContainer:{textDecoration:"none",wordBreak:"break-all"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},ratings:{marginLeft:"auto"},showDetailsButton:{marginLeft:"16px",marginTop:"18px"},relationAttributes:{paddingLeft:"60px"},suggestedWrapper:{padding:"6px 16px 3px",backgroundColor:e.suggested},commentsContainer:{marginTop:"21px","& + $ratings":{marginLeft:"16px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex"}}))),Ht=e=>{let{connection:t,loadRelations:n,renderRelationArrowButton:l,acceptRelation:s,ignoreRelation:c}=e;const u=Ft(),p=t.suggested,[d,m]=(0,r.useState)(!1),{entity:f,relation:b}=t,h=(0,a.useSelector)(v.ZP.selectors.getMetadata),{entityLabel:y,entityType:x,preparedUri:E,relationLabel:w}=Je(t,h),C=(null==b?void 0:b.ratings)||[],S=(0,a.useSelector)(v.ZP.selectors.getEntityUriWithDataTenant),P=f&&b&&(0,g.wp9)(g.q7e.RELATION,{entityUri:S,connection:t})||[];return o().createElement("div",{className:A()(u.wrapper,{[u.suggestedWrapper]:p})},o().createElement(H.Box,{display:"flex",minHeight:"62px",className:ht.U},o().createElement(H.Box,{display:"flex",alignItems:"flex-start"},o().createElement(H.Box,{display:"flex",alignItems:"center"},l&&l(),o().createElement(_e.Z,{entityType:x,className:u.entityTypeIcon})),o().createElement(H.Box,{display:"flex",flexDirection:"column"},o().createElement(Qe.Z,{value:E,className:u.entityLabelContainer},o().createElement(Ke,{label:y,entity:f},o().createElement("span",{className:u.entityLabel},y))),w&&o().createElement("span",{className:u.relationLabel},w),!p&&o().createElement(Vt,{ratings:C,onAgree:()=>{(0,g.Buf)(null==b?void 0:b.relationUri,{comment:"",value:5}).then(n)},onDisagree:e=>{(0,g.Buf)(null==b?void 0:b.relationUri,{comment:e,value:1}).then(n)}}))),o().createElement("div",{className:u.additionalButtonsWrapper},!(0,i.isEmpty)(P)&&o().createElement(yt.Z,{className:u.commentsContainer,uri:(0,g.gjS)(b),relatedObjectUris:P,objectType:g.q7e.RELATION,allowOnlyOneComment:!0}),p&&o().createElement(rt,{acceptRelation:s(t),ignoreRelation:c(t)}),!p&&o().createElement(o().Fragment,null,o().createElement(Ut,{ratings:C,className:u.ratings}),o().createElement(Nt,{show:d,onToggle:()=>{m((e=>!e))},className:u.showDetailsButton})))),d&&o().createElement(St,{connection:t,className:u.relationAttributes}))},Bt=e=>{let{className:t,connections:n=[],loadRelations:l,config:i,mainEnityUri:s}=e;const{isComplex:c,content:u}=i,{ignoreRelation:p,acceptRelation:d}=((e,t,n)=>{const r=it(e.inRelations,e.outRelations),o=(0,a.useDispatch)();return{ignoreRelation:e=>()=>{const{entity:a}=e;(0,g.iiD)(n,{relatedEntityUri:a.entityUri,relationType:r.type,relationDirection:r.direction}).then(t).catch((e=>{o(v.ui.actions.errorSet((0,g.xU7)(e,b().text("Something went wrong"))))}))},acceptRelation:e=>()=>{const{entity:a,relation:l}=e,{startDate:i,endDate:s}=l,c=r.direction===g.Nsj.IN,u=c?a.entityUri:n,p=c?n:a.entityUri;(0,g.DsR)({startEntityUri:u,endEntityUri:p,relationType:r.type,attributes:null,startDate:i,endDate:s}).then(t).catch((e=>{o(v.ui.actions.errorSet((0,g.xU7)(e,b().text("Something went wrong"))))}))}}})(u,l,s),m=(0,r.useMemo)((()=>(0,g.w3p)(n)),[n]),{getCommentsCount:f}=(0,r.useContext)(w.h);return(0,r.useEffect)((()=>{f(m)}),[f,m]),o().createElement("div",{className:t},n.map((e=>{var t,n;const r=`${null==e||null===(t=e.relation)||void 0===t?void 0:t.relationUri}-${null==e||null===(n=e.relation)||void 0===n?void 0:n.direction}`;return o().createElement(gt,{config:i,connection:e,key:r},(t=>c?o().createElement(Ht,{loadRelations:l,connection:e,acceptRelation:d,ignoreRelation:p,renderRelationArrowButton:t}):o().createElement(Tt,{acceptRelation:d,ignoreRelation:p,connection:e,renderRelationArrowButton:t})))})))};Bt.displayName="RelationsList";const Wt=Bt,qt=(0,Q.Z)((e=>({list:{paddingTop:"8px",paddingBottom:"10px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),Gt=e=>{let{isLoading:t,config:n,loadRelations:r,connections:l,total:i,parentEntityUri:s}=e;const c=qt(),{selectors:u}=v.ZP,p=(0,a.useSelector)(u.getEntity),d=(0,a.useSelector)(u.getMode),m=n["text-empty"]||b().text("No data found");return t?o().createElement(R.Z,null):(0,g.KIu)(d)?o().createElement(bt,{connections:l,className:c.list,key:null==p?void 0:p.uri,config:n,mode:d,noDataText:m,parentEntityUri:s}):i>0?o().createElement(Wt,{config:n,loadRelations:r,connections:l,className:c.list,key:null==p?void 0:p.uri,mainEnityUri:p.uri}):o().createElement(H.Typography,{className:c.noData},m)},$t=(0,Q.Z)({container:{flexGrow:1,display:"flex",flexDirection:"column",minHeight:0},content:{position:"relative",display:"flex",flexGrow:1,flexDirection:"column",minHeight:0},pagination:{height:"52px",flexGrow:0,flexShrink:0}}),_t=e=>{let{config:t,className:n}=e;const l=$t(),{page:s,setPage:c,rowsPerPage:u,sortOrder:p,sortOption:d,showInactive:m,searchQuery:f,changeSearchQuery:b}=(0,r.useContext)(Ze),{selectors:h}=v.ZP,y=(0,a.useSelector)((e=>h.getConnectionsWithDraftsByViewId(e,t.id))),x=(0,a.useSelector)(h.getEntity),E=(0,a.useSelector)((e=>h.getTotalByViewId(e,t.id))),w=(0,a.useSelector)(h.getMode),C=(0,r.useMemo)((()=>({order:p,field:d})),[p,d]);(0,r.useEffect)((()=>{b("")}),[null==x?void 0:x.uri]);const S=(0,r.useMemo)((()=>(e=>{const t=g.wSh.fromFalsy(e).map(g.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome("");return(new g.MEy).addClause(t).build()})(f)),[f]),{isLoading:P,reload:O}=(0,Ce.a)({sorting:C,filter:S,page:s,rowsPerPage:u,config:t,entity:x,relationActivityFilter:m?g.Ng6.ALL:g.Ng6.ACTIVE_ONLY,mode:w}),N=(0,r.useMemo)((()=>(0,g.Px$)(y)),[y]),k=(0,r.useMemo)((()=>({reloadRelations:O,config:(0,i.pick)(["content","importFromDT","maxDtssImport"],t)})),[O,t]);return o().createElement(Se.X.Provider,{value:N},o().createElement(V.Z,{className:n},o().createElement("div",{className:l.container},o().createElement(Ae.Provider,{value:k},o().createElement(We,{title:t.caption,total:E})),o().createElement("div",{className:l.content},o().createElement(Gt,{isLoading:P,config:t,loadRelations:O,connections:y,total:E}),E>u&&o().createElement(F.Z,{classes:{root:l.pagination},count:E,rowsPerPageOptions:[],rowsPerPage:u,page:s,onChangePage:c})))))};_t.displayName="RelationsView";const Qt=o().createContext(null);Qt.displayName="SingleAttributeContext";var Xt=n(86361),Yt=n(26180),Kt=n(31276);function Jt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){en(e,t,n[t])}))}return e}function en(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const tn="CHANGE_SEARCH_QUERY",nn=Jt({},Yt.ZP.actions,{changeSearchQuery:(0,Kt.zD)(tn)}),rn=(e,t)=>t.type===tn?Jt({},e,{searchQuery:t.payload,page:0}):Yt.ZP.reducer(e,t);var on=n(92332),an=n(67353);const ln={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},sn=(0,Q.Z)((()=>({tableContainer:{height:"477px",display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},rowCell:{fontSize:"13px",overflow:"hidden"},"row-cell--sorted":{color:"rgba(0,0,0,0.87)"},"row-cell__buttons-container":{position:"absolute"},"row-cell__buttons-wrapper":{display:"flex",paddingLeft:"10px","& > button":{marginLeft:"-10px",transform:"scale(0.9)"}},headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"12px"},"row-cell--removed":{pointerEvents:"none","& > div":ln}}))),cn=(0,an.Z)((e=>{const t=sn();return o().createElement("div",{className:t.headCell},o().createElement(on.default,e))}));var un=n(64091);function pn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const dn=(0,i.pipe)((0,i.map)((e=>({id:(0,g.Tde)(e.uri),label:e.label,dataTypeDefinition:(0,g.PFL)(e)}))),(0,i.uniqBy)((0,i.prop)("id"))),mn=(0,i.pipe)(g.DK$,dn),gn=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),fn=e=>{if((0,g.vZp)(e)){const t=gn(e);return t.length>1?t.slice(0,-1):null}return null},bn=(0,i.map)((e=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){pn(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:fn(e.id),headCellRenderer:cn,rowCellValueRenderer:un.Z})));var hn=n(99341);function yn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var vn=n(52016),xn=n(1876),En=n(60894);const wn=(0,Q.Z)((()=>({header:{padding:"0 4px 0 16px"}}))),Cn=e=>{let{title:t,searchQuery:n,onChangeSearchQuery:r,filtersEnabled:a,onToggleFilters:l,columnsData:i,selectedColumns:s,onChangeColumns:c}=e;const u=wn();return o().createElement(B.Z,{title:t,className:u.header},o().createElement($.i,{query:n,onChange:r}),o().createElement(xn.Z,{enabled:a,onClick:l}),o().createElement(q.Z,{height:24,margin:4}),o().createElement(En.Z,{columnsData:i,selectedColumns:s,onChangeColumns:c}))};function Sn(){return Sn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Sn.apply(this,arguments)}const Pn=(0,n(32528).Z)(((e,t)=>{let{deletedUris:n}=e,{rowValue:{value:r}}=t;return{isRemoved:Boolean(n.find((e=>r.uri===e)))}}))((e=>{let{cell:t,CellValueRenderer:n,isRemoved:r,isSorted:a}=e,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["cell","CellValueRenderer","isRemoved","isSorted"]);const i=sn();return o().createElement("div",{className:A()({[i["row-cell--sorted"]]:a,[i["row-cell--removed"]]:r},i.rowCell)},t.values.map(((e,t)=>o().createElement(n,Sn({key:t,value:e},l)))))}));var On=n(85709);const Nn=e=>{let{onEdit:t,onRemove:n}=e;return o().createElement(o().Fragment,null,t&&o().createElement(Oe.k,{tooltipTitle:b().text("Edit"),icon:Ge.Z,size:"L",onClick:t}),n&&o().createElement(Oe.k,{tooltipTitle:b().text("Remove"),icon:$e.Z,size:"L",onClick:n}))};function kn(){return kn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kn.apply(this,arguments)}const Zn=e=>{let{columnsData:t,values:n,sorting:l,onSort:s,filters:c,onFilter:u,config:p,onEdit:d,onDeleteAttribute:m,deletedUris:f}=e;const b=(0,r.useMemo)((()=>((e,t)=>e.map((e=>(0,i.pipe)((0,i.reduce)(((t,n)=>{let{id:r}=n;return(0,i.assoc)(r,((e,t)=>((e,t)=>(0,i.pipe)((0,i.path)(["value"]),(0,g.tT_)(e))(t))(gn(e),t))(r,e),t)}),{}),(0,i.assoc)("value",e))(t))))(n,t)),[n,t]),h=(0,r.useMemo)((()=>bn(t)),[t]),y=sn(),x=(0,a.useSelector)(v.ZP.selectors.getMode),E=(0,g.KIu)(x),w=(0,a.useSelector)(v.ZP.selectors.getMetadata),C=(0,a.useSelector)(v.ZP.selectors.getEntityUri),S=(0,a.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,C)||{})),{attributeType:P}=(0,r.useContext)(Qt),O=(0,r.useCallback)((e=>o().createElement(Pn,kn({},e,{isSorted:!!l&&l.field===e.columnData.id}))),[l]),[N,k]=(0,r.useState)(null),{canUpdate:Z,canDelete:T}=(0,vn.l)(),R=(0,r.useMemo)((()=>"number"!=typeof N||!E||f.includes((0,i.pipe)((0,i.path)([N]),(0,i.prop)("uri"))(n))),[N,f,n,E]),j="number"==typeof N&&(D=(0,i.path)([N],n),T(p)&&(0,g.xv5)({attributeType:P,mode:x,attributeValue:D,metadata:w,isReltioCrosswalk:(0,g.KVV)(S.crosswalks,D)}));var D;const I="number"==typeof N&&(e=>Z(p)&&(0,g.yv0)({attributeType:P,mode:x,attributeValue:e,isReltioCrosswalk:(0,g.KVV)(S.crosswalks,e)}))((0,i.path)([N],n)),L=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);I&&d(e)}),[d,N,n,I]),A=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);if(!j)return;const t={parentUri:C,attributeType:P,uri:e.uri,value:e};m(t),k(null)}),[N,n,m,j,P,C]),M=R||!j&&!I?void 0:o().createElement(Nn,{onEdit:I?L:void 0,onRemove:j?A:void 0}),U=(0,r.useMemo)((()=>({deletedUris:f})),[f]);return o().createElement("div",{className:y.tableContainer},o().createElement(On.Z,{columnsData:h,rowsData:b,sorting:l,onSort:s,filters:c,onFilter:u,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,renderRowCell:O,onRowHover:k,hoverRowIndex:N,hoveredRowRightContent:M,context:U,classes:{hoveredRowRightContentWrapper:y["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:y["row-cell__buttons-container"]}}))},Tn=(0,Q.Z)((()=>({actionButtons:{display:"flex",justifyContent:"flex-end",margin:"0 8px 10px","& > button":{fontSize:"14px",lineHeight:"16px",marginLeft:"8px",padding:"10px 8px",backgroundColor:"rgba(98, 2, 238, 0)"}}})));function Rn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const jn=e=>{let{onChangeAttribute:t,onCancel:n,onApply:l,onDeleteAttribute:s,hasChanges:c,attributeValue:u}=e;const d=Tn(),m=(0,a.useSelector)(v.ZP.selectors.getEntityUri),{attributeType:f}=(0,r.useContext)(Qt),h=(0,a.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,m)||{})),y=(0,a.useSelector)(v.ZP.selectors.getMode),x=(0,a.useDispatch)(),E=(0,r.useContext)(p.m),w=(0,r.useCallback)((e=>(0,i.pipe)(v.N5.actions.addAttributes,x)(e.map((e=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Rn(e,t,n[t])}))}return e}({},e,{viewId:E}))))),[E,x]),C=(0,g.ZiX)(m),S=(0,a.useSelector)((e=>v.ZP.selectors.getActiveErrorsForAttributesPager(e,m,f))),P=(0,r.useCallback)((0,i.pipe)(v.N5.errors.actions.errorDeactivated,x),[x]);return o().createElement(o().Fragment,null,o().createElement(re.Z,{expanded:!0,attributeValue:u,showEmptyEditors:C,onDeleteAttribute:s,onDeactivateError:P,onChangeAttribute:t,onAddAttributes:w,mode:y,crosswalks:h.crosswalks,errors:S,attributeType:f,ownError:(0,g.ADq)(u,null,f.uri,S)}),o().createElement("div",{className:d.actionButtons},o().createElement(H.Button,{onClick:()=>{n(u)}},b().text("Cancel")),o().createElement(H.Button,{color:"primary",disabled:!c,onClick:()=>{l(u)}},b().text("Apply"))))},Dn=(0,Q.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",padding:"4px 16px 9px",flex:1,overflow:"auto"},noData:{fontSize:"13px",paddingLeft:"20px",color:"rgba(0,0,0,0.54)"},tableContainer:{height:"477px",display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},header:{padding:"0 4px 0 16px"},addButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},editor:{padding:"4px 16px"}})));function In(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ln(e,t,n[t])}))}return e}function Ln(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const An=[],Mn=e=>{let{config:t,className:n}=e;const{caption:l,max:s}=t,c=Dn(),{values:u,page:d,setPage:m,isLoading:f,searchQuery:h,setSearchQuery:y,visibleColumns:x,onFilter:E,onSort:w,onToggleFilters:C,onChangeColumns:S,filters:P,sorting:O,totalVisibleValues:N,hasPaging:k,attributeType:Z,showTable:T}=(0,r.useContext)(Qt),j=(0,r.useMemo)((()=>mn(Z)),[Z]),{checkHasChanges:D,onChangeAttribute:I,onDeleteAttribute:L,onAdd:M,onCancel:U,onApply:z,onStartEditing:W,modifiedValues:q,editingValues:G,deletedUris:$}=(()=>{const[e,t]=(0,r.useState)(),[n,o]=(0,r.useState)([]),l=(0,a.useSelector)(v.ZP.selectors.getMode);(0,r.useEffect)((()=>{o([]),t(null)}),[l]);const s=(0,a.useDispatch)(),c=(0,r.useContext)(p.m),{attributeType:u,values:d}=(0,r.useContext)(Qt),m=(0,a.useSelector)(v.ZP.selectors.getEntityUri),f=(0,a.useSelector)(v.ZP.selectors.getMetadata),b=(0,r.useCallback)((e=>{(0,i.pipe)(v.N5.actions.modifyAttribute,s)(In({},e,{viewId:c}))}),[c,s]),h=(0,r.useCallback)((e=>(0,i.pipe)(v.N5.actions.removeAttribute,s)(In({},e,{viewId:c}))),[c,s]),y=(0,r.useCallback)((()=>{const e=(0,g.gjI)({parentUri:m,attributeType:u});t(e.uri),b(In({},e,{value:(0,g.GPx)({attributeTypes:u.attributes,parentUri:e.uri,mode:l,metadata:f}),attributeType:u}))}),[m,u]),x=(0,r.useCallback)((e=>{o((t=>t.find((0,i.propEq)("uri",e.uri))?t:[...t,e]))}),[o]),E=(0,r.useCallback)((e=>{const r=n.find((0,i.propEq)("uri",e.uri));if(r){const t=In({},e,{value:r,attributeType:u,uri:e.uri});o((e=>(0,i.without)([r],e))),b(t)}else{const n={value:e,attributeType:u,uri:e.uri};t(null),h(n)}}),[h,b,o,n]),w=(0,r.useCallback)((e=>{t(null),o((t=>{const n=t.find((0,i.propEq)("uri",e.uri));return n?(0,i.without)([n],t):t}))}),[o,t]),C=(0,a.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,m)||{})),S=(0,g.KIu)(l),P=(0,g.xy8)(u),O=(0,i.pathOr)(An,[P,null==u?void 0:u.name],C),N=(0,r.useMemo)((()=>[...O.filter((0,i.pipe)((0,i.prop)("uri"),(0,i.both)(g.ZiX,(0,i.pipe)((0,i.equals)(e),i.not)))),...(0,i.map)((e=>O.find((0,i.propEq)("uri",e.uri))||e))(d)].map((e=>{var t;return null!==(t=n.find((0,i.propEq)("uri",e.uri)))&&void 0!==t?t:e}))),[O,n,e,d]),k=(0,r.useMemo)((()=>S?(0,i.pipe)((0,i.map)((0,i.prop)("uri")),(0,i.filter)((e=>!O.find((0,i.propEq)("uri",e)))))(d):[]),[O,d]),Z=O.filter((t=>{let{uri:r}=t;return r===e||n.find((0,i.propEq)("uri",r))}));return{checkHasChanges:e=>n.find((0,i.propEq)("uri",e.uri))!==e,onChangeAttribute:b,onDeleteAttribute:h,onAdd:y,onCancel:E,onApply:w,onStartEditing:x,modifiedValues:N,editingValues:Z,deletedUris:k}})(),_=(0,a.useSelector)(v.ZP.selectors.getMode),Q=(0,g.KIu)(_),X=Q?q:u,{canCreate:Y}=(0,vn.l)(),K=Y(t)&&Z&&(0,g.Vg3)({attributeType:Z,mode:_})&&!G.length,J=(0,r.useMemo)((()=>x.map((e=>j.find((0,i.propEq)("id",e))))),[x,j]);return o().createElement(V.Z,{className:A()(c.root,n)},T?o().createElement(o().Fragment,null,o().createElement(Cn,{title:l,total:N,columnsData:j,selectedColumns:x,onChangeColumns:S,searchQuery:h,onChangeSearchQuery:y,filtersEnabled:!!P,onToggleFilters:C}),o().createElement("div",{style:{position:"relative"}},Q&&o().createElement("div",{className:c.editor},K&&o().createElement(H.Button,{color:"primary",onClick:M,className:c.addButton},o().createElement(ee.Z,{classes:{root:c.icon}}),o().createElement("div",{className:c.buttonLabel},b().text("Add"))),G.map((e=>o().createElement(jn,{key:e.uri,attributeValue:e,onChangeAttribute:I,onDeleteAttribute:L,onCancel:U,onApply:z,hasChanges:D(e)})))),o().createElement(Zn,{columnsData:J,config:t,values:X,filters:P,onFilter:E,sorting:O,onSort:w,onEdit:W,onDeleteAttribute:L,deletedUris:$}),k&&o().createElement(F.Z,{count:N,rowsPerPageOptions:[],rowsPerPage:s,page:d,onChangePage:m}),f&&o().createElement(R.Z,null))):o().createElement(o().Fragment,null,o().createElement(B.Z,{title:l,className:c.header}),o().createElement(H.Typography,{className:c.noData},b().text("No data"))))};var Un=n(58600);let zn=0;const Vn=()=>zn++,Fn=e=>{const t={children:[],nodeId:Vn()};if(e.parentPaths)for(let n=0;n<e.parentPaths.length;n++){const r=e.parentPaths[n];let o=t;for(let t=r.length-1;t>=0;t--){const a=r[t],l=e.entities[a.entityUri],i=t===r.length-1,s={entity:l,children:[],nodeId:Vn(),expanded:!0,rootIndex:i?n+1:void 0};i&&(s.root=i),o.children.push(s),o=s}}return t.children},Hn=(0,Q.Z)((e=>({container:{fontSize:"13px",display:"flex",paddingTop:"6px",position:"relative"},title:{flexGrow:1,minHeight:"15px",color:e.palette.secondary.main,lineHeight:"15px"},link:{cursor:"pointer",color:e.palette.secondary.main,lineHeight:"15px"},selected:{fontWeight:"bold"},wrapper:{width:"100%"},avatar:{height:"16px",width:"16px",marginRight:"8px",marginLeft:"8px"},header:{padding:"0 4px 0 16px"},treeContainer:{flexGrow:1,display:"flex",flexDirection:"column",height:"100%",minHeight:"372px",maxHeight:"507px",overflow:"auto"},tree:{flexGrow:1,height:0},buttonsContainer:{flexShrink:0,marginLeft:"auto","& > * + *":{marginLeft:"-4px"}},button:{padding:"8px"}})));var Bn=n(1242);const Wn=o().createContext(null);var qn=n(55400);const Gn=e=>{e.target.src=Bn},$n=e=>{let{node:t}=e;const n=Hn(),l=(0,a.useDispatch)(),i=t.entity.uri,s=(0,a.useSelector)(v.ZP.selectors.getAbsoluteImagePath),c=(0,a.useSelector)(v.ZP.selectors.getMetadata),u=(0,r.useContext)(Wn),p=(0,a.useSelector)(v.ZP.selectors.getUIPath),{uri:d}=(0,a.useSelector)(v.ZP.selectors.getEntity),m=(0,g.ChB)({uiPath:p,uri:i}),f=i===d,b=(0,r.useCallback)((()=>{l(v.ui.actions.openEntity({uri:i,viewId:u.id}))}),[l,u,i]),{entity:{label:h},nodeId:y}=t,x=(0,g.nt9)(c,t.entity.type)||{},E=(0,g.VD3)(c,x,"typeGraphIcon"),w=E&&(0,g.vPL)(s,E);return o().createElement("div",{className:n.wrapper,"data-node-id":y},o().createElement("div",{className:n.container},o().createElement(H.Avatar,{className:A()(n.avatar),src:w||Bn,onError:Gn}),o().createElement("span",{className:A()(n.link,{[n.selected]:f})},o().createElement(qn.Z,{to:m,onClick:b},h))))},_n=((0,r.memo)($n),e=>{let{node:t}=e;return t.nodeId}),Qn=(0,Q.Z)((()=>({lineBlock:{height:"100%",position:"relative",display:"inline-block"},lineChildren:{height:"100%",position:"absolute",display:"inline-block"},rootIndex:{display:"flex",alignItems:"center",color:"rgba(0,0,0,0.54)",height:"100%"},verticalLine:{width:"1px",left:"50%",top:0,height:"50%",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},horizontalLineRight:{height:"1px",top:"14px",left:"50%",width:"24%",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},node:{minWidth:"100%",position:"relative",textAlign:"left",padding:"0 24px 0 18px",boxSizing:"border-box",whiteSpace:"normal","&:hover":{backgroundColor:"rgba(0,0,0,0.06)"}},nodeContent:{position:"absolute",top:0,bottom:0,paddingLeft:"18px",boxSizing:"border-box"},row:{display:"flex"},rowContents:{position:"relative",borderLeft:"none",paddingLeft:"4px",flex:"1 1 auto",width:0,display:"flex",verticalAlign:"middle",boxSizing:"border-box"},buttonWrapper:{display:"flex",paddingTop:"13px",width:"12px",cursor:"pointer"},collapsedButton:{transform:"rotate(-90deg)"},expandedButton:{transform:"rotate(0deg)"},button:{transition:"transform .15s ease",width:0,height:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid rgba(0, 0, 0, 0.54)"},rowTitle:{flex:"1 1 auto",width:0,paddingRight:"11px"}})));function Xn(){return Xn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xn.apply(this,arguments)}function Yn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kn(){return Kn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kn.apply(this,arguments)}const Jn={nodeContentRenderer:e=>{const t=(0,i.omit)(["connectDragPreview","connectDragSource","isDragging","canDrop","canDrag","draggedNode","isSearchMatch","isSearchFocus","buttons","didDrop","children","treeId","isOver","parentNode","rowDirection"],e),{scaffoldBlockPxWidth:n,toggleChildrenVisibility:r,node:a,title:l,path:s,treeIndex:c,style:u}=t,p=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["scaffoldBlockPxWidth","toggleChildrenVisibility","node","title","path","treeIndex","style"]),d=l,m=r&&!a.root&&a.children&&a.children.length>0,g=Qn();return o().createElement("div",Kn({style:{height:"100%"}},p,{key:a.nodeId}),m&&a.expanded&&o().createElement("div",{style:{width:n-2},className:g.lineChildren}),o().createElement("div",{className:g.row,style:u},o().createElement("div",{className:g.rowContents},m&&o().createElement("div",{className:g.buttonWrapper,onClick:()=>{r({node:a,path:s,treeIndex:c})}},o().createElement("div",{"aria-label":a.expanded?"Collapse":"Expand",className:A()(g.button,a.expanded?g.expandedButton:g.collapsedButton)})),o().createElement("div",{className:g.rowTitle},"function"==typeof d?d({node:a,path:s,treeIndex:c}):d))))},treeNodeRenderer:e=>{const t=(0,i.omit)(["listIndex","swapFrom","swapLength","swapDepth","draggedNode","getPrevRow","connectDropTarget","isOver","canDrop","treeIndex","treeId","path","rowDirection"],e),{children:n,scaffoldBlockPxWidth:r,lowerSiblingCounts:a,node:l}=t,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["children","scaffoldBlockPxWidth","lowerSiblingCounts","node"]),c=Qn(),u=a.length,p=[];a.forEach(((e,t)=>{p.push(o().createElement("div",{key:`pre_${1+t}`,style:{width:r},className:c.lineBlock},l.root&&o().createElement("div",{className:c.rootIndex},l.rootIndex,"."),t===u-1&&0!==t&&o().createElement(o().Fragment,null,o().createElement("div",{className:c.verticalLine}),o().createElement("div",{className:c.horizontalLineRight}))))}));const d=l.root?r-4:0,m=r*u-d,g={left:m,width:`calc(100% - ${m}px`},f=`${m+250}px`,b=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Yn(e,t,n[t])}))}return e}({},s.style,{width:f});return o().createElement("div",Xn({},s,{className:c.node,style:b}),p,o().createElement("div",{className:c.nodeContent,style:g},n))},scaffoldBlockPxWidth:16,rowHeight:28,slideRegionSize:50};function er(){return er=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},er.apply(this,arguments)}const tr=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",er({width:"20",height:"20",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",fillOpacity:".54"},o().createElement("path",{d:"M14.5 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm4 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm-17 1a1.5 1.5 0 110-3 1.5 1.5 0 010 3zM4 4a2 2 0 110-4 2 2 0 010 4zm1 16a2 2 0 110-4 2 2 0 010 4zm4.5-6a4.5 4.5 0 110-9 4.5 4.5 0 010 9zm0-2a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm6 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3z",fill:"#000"})))},nr=e=>{let{title:t,onGraphOpen:n}=e;const r=Hn();return o().createElement(B.Z,{title:t,className:r.header},o().createElement("div",{className:r.buttonsContainer},o().createElement(Oe.k,{className:r.button,tooltipTitle:b().text("Show Graph"),icon:tr,onClick:n,size:"L"})))};var rr=n(33165),or=n(59601);const ar=(0,Q.Z)((()=>({root:{position:"relative"},bodyWrapper:{paddingTop:"21px"}})));function lr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ir(e,t,n[t])}))}return e}function ir(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var sr=n(14940);const cr=(0,Q.Z)({resizableHandleContainer:{position:"relative",width:"100%",height:"inherit"},resizableHandleVisibilityArea:{position:"absolute",top:0,left:0,width:"100%",height:"24px",zIndex:11,"&:hover $resizableHandle":{visibility:"visible"},".react-grid-item.static &:hover $resizableHandle":{visibility:"hidden"}},resizableHandle:{position:"absolute",width:"100%",display:"flex",justifyContent:"center",top:"-3px",zIndex:11,cursor:"move",visibility:"hidden"},dragIcon:{transform:"translateX(-50%) rotate(90deg)",color:"rgba(0, 0, 0, 0.3)"}}),ur=e=>{const t=t=>{const n=cr();return o().createElement("div",{className:n.resizableHandleContainer},o().createElement("div",{className:n.resizableHandleVisibilityArea},o().createElement("div",{className:A()("viewDraggableHandle",n.resizableHandle)},o().createElement(sr.Z,{className:n.dragIcon}))),o().createElement(e,t))};return t.displayName="WithResizableHandle",t},pr=(0,Q.Z)({stubView:{padding:"20px"},fullHeight:{height:"100%"},component:{boxSizing:"border-box",overflow:"auto",boxShadow:"none",borderRadius:"unset"}});var dr=n(29103),mr=n(83911),gr=n(79485),fr=n(22385);const br=(0,i.pipe)((0,i.path)(["point","lat"]),(0,i.both)((0,i.gt)(90),(0,i.lt)(-90))),hr=(0,Q.Z)((()=>({root:{height:"100%",display:"flex",flexDirection:"column"},fullHeight:{height:"100%"},fullscreenBtn:{position:"absolute",right:"5px",top:"5px",zIndex:100}})));var yr=n(13074),vr=n(24338);const xr=(0,Q.Z)((e=>({caption:{color:e.palette.text.secondary,fontSize:"13px"}}))),Er=xr,wr=e=>{let{totalImages:t}=e;const n=Er(),r=t>1?b().text("photos"):b().text("photo");return o().createElement(H.Typography,{variant:"caption",className:n.caption},`${t} ${r}`)};function Cr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Sr(e,t,n[t])}))}return e}function Sr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Pr=e=>{let{config:t,attributeType:n,paging:r,requestNextPageOfAttributeValues:l}=e;const s=(0,a.useDispatch)(),c=(0,a.useSelector)(v.ZP.selectors.getEntity),u=(0,a.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,c.uri)||{})),p=(0,i.pathOr)([],["attributes",n.name],u),d=t.id;return o().createElement(o().Fragment,null,o().createElement(vr.Z,{attributeValues:p,attributeType:n,onDeleteAttribute:e=>(0,i.pipe)(v.N5.actions.removeAttribute,s)(Cr({},e,{viewId:d})),parentUri:u.uri,onChangeAttribute:e=>(0,i.pipe)(v.N5.actions.modifyAttribute,s)(Cr({},e,{viewId:d})),imageSize:kr,paging:r,requestNextPageOfAttributeValues:l}),o().createElement(wr,{totalImages:p.length}))},Or=(0,Q.Z)((e=>({container:{padding:"8px 16px"},noData:{fontSize:"13px",color:e.palette.text.secondary}}))),Nr=Or,kr={imageMargin:4,imageWidth:162,imageHeight:162};var Zr=n(28741);const Tr=(0,Q.Z)((e=>({root:{display:"flex",flexDirection:"column"},matchesContainer:{position:"relative"},footer:{display:"flex",alignItems:"end",flexGrow:1,justifyContent:"flex-start",borderTop:"1px solid rgba(0,0,0, 0.12)",padding:"8px 16px",color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px"},noData:{paddingLeft:"16px",paddingBottom:"16px",fontSize:"13px",color:"rgba(0,0,0,0.54)"}})));var Rr=n(49734),jr=n(98808),Dr=n(93428),Ir=n(30885);function Lr(){return Lr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lr.apply(this,arguments)}const Ar=e=>{let{config:t,match:n,onStartRequest:l,onFinishRequest:i}=e;const s=(0,a.useDispatch)(),c=(0,a.useSelector)(v.ZP.selectors.getMetadata),u=(0,a.useSelector)(v.ZP.selectors.getEntity),{canMerge:d,canMark:m}=(0,g.hXd)(c,t,n.object,u,n.matchRules),f=(0,r.useMemo)((()=>[n.object]),[n.object]),b={entity:u,entities:f,mode:jr.N.iconButton,onStartRequest:l},h=(0,r.useContext)(p.m),y=(0,r.useCallback)((()=>{i(),s(v.N5.entity.actions.loadEntity({viewId:h,uri:u.uri}))}),[s,u.uri,i,h]);return o().createElement(o().Fragment,null,d&&o().createElement(Dr.H,Lr({},b,{onFinishRequest:y})),m&&o().createElement(Ir.i,Lr({},b,{onFinishRequest:i})))},Mr=e=>{let{config:t,entitiesMap:n,match:r,onFinishRequest:l,onStartRequest:i}=e;const s=(0,a.useSelector)(v.ZP.selectors.getMetadata),c=(0,a.useSelector)(v.ZP.selectors.getEntity);return o().createElement(Rr.M,{match:r,entity:c,entitiesMap:n,metadata:s,className:ht.U},o().createElement(yt.Z,{uri:(0,g.E_P)(c.uri,r.object.uri),relatedObjectUris:(0,g.wp9)(g.q7e.POTENTIAL_MATCH,{entityUri:c.uri,matchEntityUri:r.object.uri}),objectType:g.q7e.POTENTIAL_MATCH}),o().createElement(Ar,{match:r,config:t,onStartRequest:i,onFinishRequest:l}))},Ur={showTransitiveMatches:!0,showInactiveEntities:!1},zr={order:"asc",field:"score"};var Vr;!function(e){e[e.Loading=0]="Loading",e[e.NoData=1]="NoData",e[e.Loaded=2]="Loaded"}(Vr||(Vr={}));const Fr=ur((e=>{let{className:t}=e;const n=pr();return o().createElement(V.Z,{className:A()(n.stubView,"viewDraggableHandle",t)},"NOT IMPLEMENTED")})),Hr=ur((e=>{let{className:t,config:n}=e;return o().createElement(M.Z,{className:t,caption:n.caption,excludeUris:n.excludeUris,includeUris:n.includeUris,attributesCount:n.attributesCount,pinnedAttributes:n.pinnedAttributes})})),Br=ur((e=>{let{className:t,config:n}=e;const a=(e=>{const[t,n]=(0,r.useState)(""),[o,a]=(0,r.useState)(0),[l,i]=(0,r.useState)(!1),s=(0,r.useMemo)((()=>({page:o,searchQuery:t,showInactive:l})),[o,t,l]),c=Ee(e,s,!0),u=(0,r.useCallback)((()=>{a(0),i((e=>!e))}),[]);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){we(e,t,n[t])}))}return e}({setSearchQuery:n,searchQuery:t,setPage:a,page:o,toggleShowInactive:u,showInactive:l},c)})(n);return o().createElement(U.Provider,{value:a},o().createElement(he,{config:n,className:t}))})),Wr=ur((e=>{let{config:t,className:n}=e;const l=(e=>{var t;const{attributeUri:n}=e,o=(0,a.useSelector)(v.ZP.selectors.getMetadata),l=(0,r.useMemo)((()=>(0,g.zeJ)(o,n)),[o,n]),s=(0,r.useMemo)((()=>mn(l)),[l]),c=(0,r.useMemo)((()=>({searchQuery:"",filters:null,sorting:void 0,visibleColumns:s.filter((0,i.pipe)((0,i.prop)("dataTypeDefinition"),g.YkM,i.not)).map((e=>{let{id:t}=e;return t})).slice(0,5),page:0})),[s]),[u,p]=(0,r.useReducer)(rn,c),{searchQuery:d,filters:m,sorting:f,page:b}=u,h=(0,a.useSelector)(v.ZP.selectors.getIsEditableMode),y=(0,r.useMemo)((()=>{const e=((e,t)=>g.wSh.fromNull(t).map((t=>Object.entries(t).map((t=>{let[n,r]=t;const o=e.find((0,i.propEq)("id",n));return(0,hn.su)(o,r)})))).orSome([]))(s,m);return e.length?e:null}),[m,s]),x=(0,r.useMemo)((()=>(0,i.reject)(i.isNil,{filters:y,page:b,sorting:f,searchQuery:d})),[y,b,f,d]),{changeSearchQuery:E,changePage:w,toggleSort:C,changeFilter:S,toggleFilters:P,changeColumns:O}=(0,Xt.o)({actions:nn,dispatch:p}),N=Ee(e,x,!1);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){yn(e,t,n[t])}))}return e}({},u,{setSearchQuery:E,setPage:w,onSort:C,onFilter:S,onToggleFilters:P,onChangeColumns:O,showTable:Boolean(((null==N||null===(t=N.values)||void 0===t?void 0:t.length)||y||d||h)&&l&&!l.hidden)},N)})(t);return o().createElement(Qt.Provider,{value:l},t&&o().createElement(Mn,{config:t,className:n}))})),qr=ur((e=>{let{config:t,className:n}=e;const a=(e=>{var t;const n=(0,r.useMemo)((()=>Object.entries(e.sortOptions||{}).map((e=>{let[t,n]=e;return{value:t,label:n}}))),[e.sortOptions]),o=e.max||15,[a,l]=(0,r.useState)(0),[i,s]=(0,r.useState)(e.sortOrder||"asc"),[c,u]=(0,r.useState)(null===(t=n[0])||void 0===t?void 0:t.value),[p,d]=(0,r.useState)(""),[m,g]=(0,r.useState)(!1),f=(0,r.useCallback)((()=>{l(0),g((e=>!e))}),[]),b=(0,r.useCallback)((()=>{l(0),s((e=>"asc"===e?"desc":"asc"))}),[]),h=(0,r.useCallback)((e=>{l(0),u(e)}),[]);return{searchQuery:p,changeSearchQuery:(0,r.useCallback)((e=>{l(0),d(e)}),[]),sortOrder:i,toggleSortOrder:b,sortOption:c,changeSortOption:h,sortOptions:n,page:a,setPage:l,rowsPerPage:o,showInactive:m,toggleShowInactive:f}})(t);return o().createElement(Ze.Provider,{value:a},o().createElement(_t,{config:t,className:n}))})),Gr=ur((e=>{let{config:t,className:n}=e;const a=(0,r.useRef)(),[l,s]=(0,r.useState)(null),{height:c,width:u,tooltip:p}=t,{html:d,visible:m,tooltip:g,customStyles:f,onClosePopup:b,message:h}=(0,rr.E)(t),y=ar(),v=g||p;if((0,r.useEffect)((()=>{a.current&&d&&(a.current.innerHTML="",d.childNodes.forEach((e=>{a.current.appendChild(e)})),s(a.current))}),[d]),!m)return null;const x=(0,i.reject)(i.isNil,{width:u,height:c}),E=o().createElement("div",{ref:a,style:lr({},x,f),className:A()(y.root,n)});return o().createElement("div",{className:y.bodyWrapper},v?o().createElement(H.Tooltip,{title:v},E):E,o().createElement(or.Z,{placement:"bottom",anchorEl:l,open:!!h,onClose:b},h))})),$r=ur((e=>{let{config:t,className:n}=e;const l=(0,a.useSelector)(v.ZP.selectors.getEntityUri),{treeData:i,setTreeData:s}=((e,t)=>{const n=(0,ye._)(),[o,a]=(0,r.useState)([]);return(0,r.useEffect)((()=>((0,g.ZiX)(e)||n((0,g.RFJ)({uri:e,graphUri:t})).then(Fn).then(a).catch((e=>{console.warn(e)})),()=>{a([])})),[e,t,n]),{treeData:o,setTreeData:a}})(l,t.graph.type),c=Hn(),u=(0,a.useDispatch)(),{id:p,graph:d}=t,m=(0,r.useCallback)((()=>{u(v.ui.actions.openGraph({viewId:p,graphType:d.type}))}),[u,p,d]),f=(0,r.useCallback)((e=>({title:o().createElement($n,{node:e.node})})),[]);return o().createElement(V.Z,{className:n},o().createElement(nr,{onGraphOpen:m,title:t.caption}),o().createElement(Wn.Provider,{value:t},o().createElement("div",{className:c.treeContainer},o().createElement("div",{className:c.tree},o().createElement(Un.ZP,{isVirtualized:!1,treeData:i,canDrag:!1,theme:Jn,generateNodeProps:f,onChange:s,getNodeKey:_n})))))})),_r=ur((e=>{let{config:t,className:n}=e;const l=Tr(),s=(0,a.useSelector)(v.ZP.selectors.getEntity),c=(0,g.wwR)(s),[u,d]=(0,r.useState)(!1),m=(0,r.useCallback)((()=>{d(!0)}),[]),f=(0,r.useCallback)((()=>{d(!1)}),[]),{matches:h,entitiesMap:y,loadMatches:x,total:E}=(0,Zr.s)({enabled:!!c,entity:s,options:Ur,filter:"",page:0,sorting:zr,rowsPerPage:3,onStartLoading:m,onFinishLoading:f}),C=(0,r.useCallback)((()=>{x()}),[x]),S=(0,a.useDispatch)(),P=(0,r.useContext)(p.m),O=(0,r.useCallback)((()=>{S(v.ui.actions.openPerspective({perspectiveId:"potentialMatches",viewId:P}))}),[S,P]),N=(0,r.useMemo)((()=>(0,g.NVY)(c,(0,i.map)(g.ev7,h))),[c,h]),{getCommentsCount:k}=(0,r.useContext)(w.h);(0,r.useEffect)((()=>{k(N)}),[k,N]);const Z=E>3&&!(0,i.isEmpty)(h),T=u?Vr.Loading:(0,i.isEmpty)(h)?Vr.NoData:Vr.Loaded;return o().createElement(Se.X.Provider,{value:y},o().createElement(V.Z,{className:A()(l.root,n)},o().createElement(B.Z,{title:t.caption}),o().createElement("div",{className:l.matchesContainer},T===Vr.Loading&&o().createElement(R.Z,null),T===Vr.NoData&&o().createElement(H.Typography,{className:l.noData},b().text("No matches found")),T===Vr.Loaded&&h.map((e=>o().createElement(Mr,{config:t,entitiesMap:y,match:e,onFinishRequest:C,onStartRequest:m,key:e.object.uri})))),Z&&o().createElement(o().Fragment,null,o().createElement("div",{className:l.footer},o().createElement(H.Link,{component:"button",variant:"caption",onClick:O,underline:"none"},b().text("See all"))))))})),Qr=(0,r.lazy)((()=>n.e(6596).then(n.bind(n,46596)).then((e=>({default:ur(e.HierarchyTreeView)}))))),Xr=(0,r.lazy)((()=>n.e(4361).then(n.bind(n,14361)).then((e=>({default:ur(e.RelationshipsTableView)}))))),Yr=ur((e=>{let{config:t,isFullscreen:n,onToggleFullscreen:l,className:i}=e;const s=hr(),c=(0,a.useSelector)(v.ZP.selectors.getMetadata),u=(0,a.useSelector)(v.ZP.selectors.getEntity),p=(0,a.useSelector)(v.ZP.selectors.getGoogleMapKey),{markers:d,loading:m}=((e,t,n)=>{const[o,a]=(0,r.useState)([]),[l,i]=(0,r.useState)(!0),s=(0,ye._)();return(0,r.useEffect)((()=>{i(!0),s((0,g.DBr)(t,[e],n)).then((e=>{a(e.filter(br))})).catch((()=>{a([])})).finally((()=>{i(!1)}))}),[e,t,n,s]),{markers:o,loading:l}})(u,c,p),f=(0,r.useMemo)((()=>o().createElement("div",{className:s.fullHeight},o().createElement(R.Z,null))),[s]),b=(0,r.useMemo)((()=>({lat:0,lng:0})),[]);return p&&o().createElement(V.Z,{className:A()(s.root,i)},m&&o().createElement(R.Z,null),o().createElement(fr.Z,{size:"S",icon:n?mr.Z:dr.Z,onClick:()=>l(t.id),className:s.fullscreenBtn}),o().createElement(gr.Z,{loadingElement:f,defaultZoom:1,defaultCenter:b,markers:d,mapContainerClassName:s.fullHeight,mapKey:p}))})),Kr=ur((e=>{let{config:t,className:n}=e;const{attributeUri:l}=t,s=Nr(),c=(0,a.useDispatch)(),u=(0,a.useSelector)(v.ZP.selectors.getMode),p=(0,a.useSelector)(v.ZP.selectors.getEntityWithDiff),d=(0,a.useSelector)(v.ZP.selectors.getMetadata),m=(0,g.zeJ)(d,l),f=(0,i.pathOr)([],["attributes",null==m?void 0:m.name],p),h=(0,i.path)(["attributes","paging",l],p),y=f.length,x=t["text-empty"]||b().text("No data found"),E=(0,r.useCallback)((e=>c(v.N5.actions.requestNextPageOfAttributeValues(e))),[c]);return o().createElement(V.Z,{className:n},o().createElement(B.Z,{title:t.caption}),o().createElement("div",{className:s.container},(()=>{if(m){if((0,g.KIu)(u)){const e={attributeType:m,config:t,paging:h,requestNextPageOfAttributeValues:E};return o().createElement(Pr,e)}if(y>0){const e={attributeValues:f,attributeType:m,imageSize:kr,paging:h,parentUri:p.uri,requestNextPageOfAttributeValues:E};return o().createElement(o().Fragment,null,o().createElement(yr.Z,e),o().createElement(wr,{totalImages:y}))}}return o().createElement(H.Typography,{className:s.noData},x)})()))}));class Jr{}Jr.ViewTypes=g.ZIY,Jr.getComponentBy=(e,t)=>{let{store:n,config:r,className:a,isFullscreen:l,onToggleFullscreen:i}=t;switch(r[e]){case Jr.ViewTypes.HierarchyTree:return o().createElement(Qr,{config:r,store:n,className:a});case Jr.ViewTypes.HierarchyPaths:return o().createElement($r,{config:r,className:a});case Jr.ViewTypes.RelationsTable:return o().createElement(Xr,{config:r,store:n,className:a});case Jr.ViewTypes.Relations:return o().createElement(qr,{config:r,className:a});case Jr.ViewTypes.Attributes:return o().createElement(Hr,{className:a,config:r});case Jr.ViewTypes.SingleAttributeView:return o().createElement(Br,{config:r,className:a});case Jr.ViewTypes.TableAttributeView:return o().createElement(Wr,{config:r,className:a});case Jr.ViewTypes.MapView:return o().createElement(Yr,{config:r,isFullscreen:l,onToggleFullscreen:i,className:a});case Jr.ViewTypes.CustomView:return o().createElement(Gr,{config:r,className:a});case Jr.ViewTypes.ImageAttributeView:return o().createElement(Kr,{config:r,className:a});case Jr.ViewTypes.PotentialMatchesView:return o().createElement(_r,{config:r,className:a})}},Jr.getComponent=e=>Jr.getComponentBy("class",e)||Jr.getComponentBy("react-class",e)||o().createElement(Fr,{className:e.className});const eo=Jr,to=()=>null,no=(0,r.memo)((e=>{let{config:t,store:n,isFullscreen:a,isAutosize:l,onToggleFullscreen:i}=e;const s=pr();return o().createElement(r.Suspense,{fallback:o().createElement(to,null)},eo.getComponent({config:t,store:n,className:A()(s.component,{[s.fullHeight]:!l}),isFullscreen:a,onToggleFullscreen:i}))}));no.displayName="ViewComponent";const ro=(0,Q.Z)((e=>({item:e.basicView,fixedSizeContainer:{height:"100%"}})));function oo(){return oo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oo.apply(this,arguments)}const ao=["onConfigChanged","onRemove"],lo=e=>{let{layoutItemConfig:t,views:n,className:l,children:s,style:c,isFullscreen:u,onToggleFullscreen:p,AutosizeComponent:d}=e,m=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["layoutItemConfig","views","className","children","style","isFullscreen","onToggleFullscreen","AutosizeComponent"]);const g=n.find((e=>{let{id:n}=e;return t.i===n})),f=ro(),{store:b}=(0,r.useContext)(a.ReactReduxContext);if(!g)return null;const h=g.class===eo.ViewTypes.CustomView;return o().createElement("div",oo({},(0,i.omit)(ao,m),{style:c,className:A()(l,{[f.item]:!h})}),o().createElement("div",{className:A()({[f.fixedSizeContainer]:!d})},d,o().createElement(no,{store:b,config:g,isFullscreen:u,onToggleFullscreen:p,isAutosize:Boolean(d)})),s)},io=e=>{let{views:t,layout:n,layoutOptions:r,onLayoutChanged:a}=e;return o().createElement(I.Z,{LayoutItem:lo,views:t,layout:n,layoutOptions:r,onLayoutChanged:a,draggableHandle:".viewDraggableHandle"})};var so=n(57304),co=n(3409),uo=n(93873),po=n(22860),mo=n(72753),go=n(43576);function fo(){return fo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fo.apply(this,arguments)}const bo=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",fo({width:"19",height:"17",viewBox:"0 0 19 17",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),o().createElement("defs",null,o().createElement("path",{d:"M14 17v2H4v-2h10zm6-4v2H4v-2l12.884.001H17l.116-.002L20 13zm-8.457-2H4V9h5.82a8.465 8.465 0 001.723 2zM9.139 6.178l-.289.733.035.088L4 7V5l5.713-.002c-.22.375-.412.768-.574 1.18zM17 2.82a6.451 6.451 0 00-6 4.09 6.451 6.451 0 006 4.092 6.451 6.451 0 006-4.091 6.451 6.451 0 00-6-4.091zm0 6.815a2.728 2.728 0 010-5.455 2.728 2.728 0 010 5.455zm0-4.365c-.905 0-1.636.73-1.636 1.636 0 .906.73 1.637 1.636 1.637.905 0 1.636-.731 1.636-1.637 0-.905-.73-1.636-1.636-1.636z",id:"svg1467685497a"})),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},o().createElement("g",{transform:"translate(-4 -2.5)"},o().createElement("mask",{id:"svg1467685497b",fill:"#fff"},o().createElement("use",{xlinkHref:"#svg1467685497a"})),o().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg1467685497b)",d:"M0 0h24v24H0z"}))))},ho=(0,Q.Z)({editingButtons:{display:"flex","& button + button":{width:"88px",marginLeft:"8px"}},searchResults:{width:"150px",height:"25px",backgroundColor:"#ccc"},comments:{display:"flex",justifyContent:"flex-end",marginTop:"10px"}}),yo=e=>o().createElement(H.SvgIcon,e,o().createElement(bo,null)),vo=(e,t,n,r,o)=>e.filter((e=>{let{value:a,permission:l}=e;return!(n&&!(0,g.KIu)(a))&&!!(r&&o||!(0,g.fnZ)(a))&&(0,g.uGe)(l,t)})),xo=e=>{let{className:t}=e;const n=ho(),l=(0,a.useDispatch)(),i=(0,a.useSelector)(v.ZP.selectors.getCanUserStartProcessFromQuery),s=(0,a.useSelector)(v.ZP.selectors.getEntityWithoutDiff),c=(0,a.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,s.uri))),u=(0,a.useSelector)(v.ZP.selectors.getMetadata),p=(0,a.useSelector)(v.ZP.selectors.isWorkflowEnabled),d=(0,a.useSelector)(v.ZP.selectors.getMode),m=(0,a.useSelector)(v.ZP.selectors.getIsEditableMode),f=(0,a.useSelector)(v.ZP.selectors.getIsViewMode),h=(0,a.useSelector)(v.ZP.selectors.getIsHistoryModeEnabled),y=(0,a.useSelector)(v.ZP.selectors.getProfileOperation)===g.OXy.Saving,x=null==s?void 0:s.type,E=(0,r.useMemo)((()=>[{label:b().text("Editing"),value:g.fO_.EDITING,description:b().text("Edit profile directly"),icon:go.Z,permission:"UPDATE"},{label:b().text("Suggesting"),value:g.fO_.SUGGESTING,description:b().text("Suggest changes and initiate a workflow review"),icon:yo,permission:"INITIATE_CHANGE_REQUEST"},{label:b().text("Viewing"),value:g.fO_.VIEWING,description:b().text("Suggest changes and initiate a workflow review"),icon:mo.Z,permission:"READ"}]),[]),w=(0,r.useMemo)((()=>[{label:b().text("Delete"),value:"Delete",description:b().text("Permanently delete profile"),icon:$e.Z,onClick:()=>{window.confirm(b().text("Are you sure you want to delete this?"))&&l(v.N5.entity.actions.entityRemoveRequested({entityUri:s.uri}))},permission:"DELETE"}]),[l,s.uri]),C=(0,r.useMemo)((()=>(0,g.nt9)(u,x)||{}),[u,x]),S=!h&&!(0,g.biM)(s)&&!(e=>(0,g.uGe)(g.BDP.READ,e)&&!(0,g.uGe)(g.BDP.UPDATE,e)&&!(0,g.uGe)(g.BDP.DELETE,e)&&!(0,g.uGe)(g.BDP.INITIATE_CHANGE_REQUEST,e))(C),P=(0,g.ZiX)(null==s?void 0:s.uri),O=(0,r.useMemo)((()=>vo(E,C,P,p,i)),[E,C,p,i,P]),N=(0,r.useMemo)((()=>vo(w,C,P,p,i)),[w,C,p,i,P]),k=(0,r.useCallback)((e=>{l(v.N5.mode.actions.modeUpdated(e))}),[l]),Z=(0,r.useCallback)((()=>{l(v.N5.mode.actions.modeCancelEditing())}),[l]),T=(0,r.useCallback)((()=>{l(v.N5.actions.saveProfile())}),[l]);return o().createElement(so.Z,{className:A()(t,ht.U),entity:m&&c?c:s},o().createElement(H.Box,{display:"flex",alignItems:"center"},o().createElement(H.Box,{mr:3},m&&o().createElement(H.Box,{className:n.editingButtons},o().createElement(H.Button,{variant:"outlined",onClick:Z,"data-reltio-id":"reltio-profile-cancel-editing",disabled:y},b().text("Cancel")),o().createElement(H.Button,{variant:"contained",color:"primary","data-reltio-id":"reltio-profile-save-profile",onClick:T,disabled:y},(0,g.fnZ)(d)?b().text("Suggest"):b().text("Save"))),h&&f?o().createElement(co.Z,null):f&&o().createElement(uo.a,null)),S&&o().createElement(po.T,{optionsGroup:O,buttonsGroup:N,value:d,onChange:k,disabled:y})),o().createElement(H.Box,{className:n.comments},o().createElement(yt.Z,{uri:s.uri,relatedObjectUris:(0,g.wp9)(g.q7e.ENTITY,{entityUri:s.uri}),objectType:g.q7e.ENTITY})))};var Eo=n(71820),wo=n(85890),Co=n(26789),So=n(54362),Po=n(6674),Oo=n(91515),No=n(52043),ko=n(17308),Zo=n(39827),To=n(80147),Ro=n(76569);const jo=(0,Q.Z)({wrapper:{display:"flex",overflow:"hidden",marginLeft:"auto",flexShrink:0},badge:{fontSize:"12px",height:"18px",minWidth:"18px",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px"}}),Do=()=>{const{total:e}=(0,r.useContext)(Z.O),t=jo();return o().createElement(H.Badge,{badgeContent:e,classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(Ro.Z,null))};var Io=n(26313),Lo=n(9371),Ao=n(4426);const Mo=(0,Q.Z)({wrapper:{overflow:"auto",paddingRight:"12px"},showMoreLink:{display:"flex",margin:"16px"},showMoreIcon:{fontSize:"1rem"}}),Uo=()=>{const e=Mo(),{getComments:t,comments:n,pageToken:l}=(0,r.useContext)(w.h),i=(0,a.useSelector)(v.ZP.selectors.getEntityUriWithDataTenant);(0,r.useEffect)((()=>{t(i)}),[t,i]);const s=(0,Io.Q)(n);return o().createElement(Se.X.Provider,{value:s},o().createElement(H.Box,{className:e.wrapper},n.map((e=>{const{objectId:t,relatedObjectUris:n,objectType:r,commentId:a}=e;return o().createElement(Lo.J,{key:a,uri:t,relatedObjectUris:n,objectType:r,comment:e})})),l&&o().createElement(H.Link,{component:"button",variant:"caption",className:e.showMoreLink,onClick:()=>{t(i,l)},underline:"none"},o().createElement(Ao.Z,{className:e.showMoreIcon}),b().text("Show more"))))};var zo=n(34120);const Vo=(0,Q.Z)({wrapper:{overflow:"auto",position:"relative",height:"100%"}}),Fo=()=>{const e=Vo(),{tasks:t,loading:n}=(0,r.useContext)(Z.O);return o().createElement("div",{className:e.wrapper},n&&o().createElement(R.Z,null),t&&t.map((e=>o().createElement(zo.s,{key:e.taskId,task:e}))))};function Ho(){return Ho=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ho.apply(this,arguments)}const Bo=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",Ho({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"},n),o().createElement("defs",null,o().createElement("path",{d:"M4 17.17L5.17 16H20V4H4v13.17zM20 2c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H6l-4 4V4c0-1.1.9-2 2-2h16zm-3 9H7v2h10v-2zm0-4H7v2h10V7z",id:"svg2697213709a"})),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},o().createElement("g",null,o().createElement("g",{transform:"translate(-2 -2)"},o().createElement("mask",{id:"svg2697213709b",fill:"#fff"},o().createElement("use",{xlinkHref:"#svg2697213709a"})),o().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2697213709b)",d:"M0 0h24v24H0z"})))))},Wo=()=>{const{commentsMap:e}=(0,r.useContext)(w.h),t=jo();return o().createElement(H.Badge,{badgeContent:(0,g.mdt)(e),classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(Bo,null))};var qo=n(10159);const Go=()=>o().createElement(qo.Z,{text:b().text("Ready to go with the flow?"),secondaryText:b().text("Suggest a change or submit a match review, and we’ll kick off a workflow task to get things going.")}),$o=()=>o().createElement(qo.Z,{text:b().text("Care to join the conversation?"),secondaryText:b().text("Leave comments for team members anywhere in the Profile page, and we’ll record it here.")});function _o(){return _o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_o.apply(this,arguments)}let Qo;!function(e){e[e.Workflow=0]="Workflow",e[e.Collaboration=1]="Collaboration",e[e.History=2]="History"}(Qo||(Qo={}));const Xo=e=>{if(e)return 1===e?b().text("${total} item",{total:e}):b().text("${total} items",{total:e})},Yo=()=>{var e,t,n;const l=jo(),s=(0,a.useSelector)(v.ZP.selectors.isWorkflowSideViewEnabled),c=(0,a.useSelector)(v.ZP.selectors.isWorkflowEnabled),u=(0,a.useSelector)(v.ZP.selectors.isCollaborationSideViewEnabled),p=(0,a.useSelector)(v.ZP.selectors.isCollaborationEnabled),d=(0,a.useSelector)(v.ZP.selectors.getHistoryEvent),m=(0,a.useSelector)(v.ZP.selectors.getMetadata),f=(0,a.useSelector)(v.ZP.selectors.getEntity),h=(0,r.useContext)(Z.O),y=(0,r.useContext)(w.h),[x,E]=(0,r.useState)(null),C=(0,r.useCallback)((e=>{E((t=>t===e?null:e))}),[]),S=(0,r.useCallback)((()=>{E(null)}),[]),P=null!==x,O=x===Qo.History,{isHistoryEnabled:N,isProfilePersisted:k}=(0,Eo.C)({isHistoryTabActive:O,entity:f}),{historyFilter:T,onApplyFilter:R,onClearFilter:j,isLoading:D,historicUris:I,historyWithTotal:L,canLoadMore:A,onLoadMore:M}=(0,wo.k)({entity:f,enabled:N}),U=s&&c&&!(0,g.ZiX)(null==f?void 0:f.uri),z=u&&p,V=(0,g.mdt)(null==y?void 0:y.commentsMap),F=[{buttonProps:{id:Qo.Workflow,icon:Do,tooltipTitle:b().text("Workflow")},content:null!=h&&h.total?o().createElement(Fo,null):o().createElement(Go,null),headerProps:{mainTitle:b().text("Workflow"),secondTitle:Xo(null==h?void 0:h.total),rightContent:o().createElement(Co.G,null)},hidden:!U},{buttonProps:{id:Qo.Collaboration,icon:Wo,tooltipTitle:b().text("Collaboration")},content:V?o().createElement(Uo,null):o().createElement($o,null),headerProps:{mainTitle:b().text("Collaboration"),secondTitle:Xo(V)},hidden:!z},{buttonProps:{id:Qo.History,icon:To.Z,tooltipTitle:b().text("History")},content:k?o().createElement(So.Z,{isLoading:D,historyWithTotal:L,contributorsUris:I,entityUri:null==f?void 0:f.uri,historyEvent:d,onLoadMore:M,canLoadMore:A}):o().createElement(Po.Z,null),headerProps:{content:o().createElement(Oo.Z,{total:k?((null==I?void 0:I.length)||0)+1:void 0,entityType:(0,g.nt9)(m,null==f?void 0:f.type),filter:T,onApplyFilter:R,onClearFilter:j})}}],H=(0,i.reject)((0,i.propEq)("hidden",!0))(F);return(0,r.useEffect)((()=>{var e;null!==(e=F[x])&&void 0!==e&&e.hidden&&S()}),[x,F,S,H]),o().createElement("div",{className:l.wrapper},o().createElement(No.h,{open:P,width:480},!(null!==(e=F[x])&&void 0!==e&&e.hidden)&&o().createElement(o().Fragment,null,o().createElement(ko.P,_o({},null===(t=F[x])||void 0===t?void 0:t.headerProps,{onClose:S})),null===(n=F[x])||void 0===n?void 0:n.content)),o().createElement(Zo.G,{buttonsProps:(0,i.pipe)((0,i.reject)((0,i.propEq)("hidden",!0)),(0,i.pluck)("buttonProps"))(F),onButtonClick:C,activeIndexId:x}))};var Ko=n(39781),Jo=n(16715);const ea="48px",ta="1px solid rgba(0, 0, 0, .125)",na=(0,Q.Z)((e=>({accordion:{borderTop:ta,borderBottom:ta,fontSize:"13px",boxShadow:"none","&:not(:first-child)":{borderTop:0},"&:before":{display:"none"},"&$accordionExpanded":{margin:"auto"}},accordionExpanded:{},accordionSummary:{display:"flex",alignItems:"center",height:ea,minHeight:ea,"&$accordionSummaryExpanded":{height:ea,minHeight:ea}},accordionSummaryHeading:{flex:1,fontSize:e.typography.pxToRem(13),fontWeight:e.typography.fontWeightRegular},accordionSummaryExpanded:{},accordionSummaryContent:{display:"flex",alignItems:"center"},accordionDetails:{maxHeight:"21vh",overflow:"auto",paddingTop:0,paddingBottom:0,"& ul":{paddingLeft:"23px",marginTop:"3px"},"& li":{paddingLeft:"9px",paddingBottom:"8px"}},parents:{color:e.palette.text.primary},errorsAccordion:{backgroundColor:"#FFF4F6",borderColor:"#FFB8B3"},errorsAccordionDetails:{color:"#DD2C00"},warningsAccordion:{backgroundColor:"#FFF9ED",borderColor:"#FFDD91"},warningsAccordionDetails:{color:"#CC7500"},icon:{marginRight:"8px"},errorIcon:{fill:"#FF1744"},warningIcon:{fill:"#F9A825"}}))),ra=na;var oa=n(38016);const aa=(0,r.memo)((e=>{let{panels:t,expandedPanelId:n,onToggle:r,ErrorComponent:a}=e;const l=ra();return t.length>0?o().createElement("div",null,t.map((e=>{let{id:t,icon:i,title:s,items:c,accordionClassName:u,accordionDetailsClassName:p}=e;return o().createElement(H.Accordion,{key:t,square:!0,expanded:n===t,onChange:r(t),className:u,classes:{root:l.accordion,expanded:l.accordionExpanded}},o().createElement(H.AccordionSummary,{classes:{root:l.accordionSummary,expanded:l.accordionSummaryExpanded,content:l.accordionSummaryContent},expandIcon:o().createElement(oa.Z,null)},i,o().createElement(H.Typography,{className:l.accordionSummaryHeading},s)),o().createElement(H.AccordionDetails,{className:A()(l.accordionDetails,p)},o().createElement("ul",null,c.map(((e,t)=>o().createElement(a,{key:t,error:e}))))))}))):null}));aa.displayName="ErrorsPanel";const la=(0,i.omit)(["deactivated","path"]),ia=(0,r.memo)((e=>{let{error:t}=e;const n=ra(),r=((e,t)=>{let{type:n,source:r,message:o,attributeTypeUri:a="",attributeType:l}=t;if(n===g.NIO.missed&&r===g.zHr.local){const t=l||(0,g.zeJ)(e,a);return t?b().text("${attribute} is required",{attribute:t.label}):o}return o})((0,a.useSelector)(v.ZP.selectors.getMetadata),t),l=(e=>{let{path:t,uri:n}=e;return null==t?void 0:t.slice(0,n?t.length-1:t.length).filter((e=>{let{type:t}=e;return[g.HAc.attributeValue,g.HAc.relationConnection].includes(t)})).map((e=>{let{label:t}=e;return t})).filter(i.identity).join(" / ")})(t);return o().createElement("li",null,o().createElement("span",null,r),l&&o().createElement(o().Fragment,null,o().createElement("br",null),o().createElement("span",{className:n.parents},l)))}));ia.displayName="Error";const sa=()=>{const e=ra(),t=(e=>{const t=(0,r.useRef)(e);return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length===t.length&&(0,i.equals)(e.map(la),t.map(la))}(e,t.current)||(t.current=e),t.current})((0,a.useSelector)(v.ZP.selectors.getProfileErrors)),[n,l]=(0,r.useMemo)((()=>(0,i.partition)(g.IT0,t)),[t]),[s,c]=(0,r.useState)(null),u=(0,r.useMemo)((()=>[{id:"errors",title:b().text("${number} ${errors}",{number:n.length,errors:1===n.length?b().text("error"):b().text("errors")}),icon:o().createElement(Ko.Z,{className:A()(e.icon,e.errorIcon)}),items:n,accordionClassName:e.errorsAccordion,accordionDetailsClassName:e.errorsAccordionDetails},{id:"warnings",title:b().text("${number} ${warnings}",{number:l.length,warnings:1===l.length?b().text("warning"):b().text("warnings")}),icon:o().createElement(Jo.Z,{className:A()(e.icon,e.warningIcon)}),items:l,accordionClassName:e.warningsAccordion,accordionDetailsClassName:e.warningsAccordionDetails}].filter((e=>{let{items:t}=e;return t.length>0}))),[n,l,e]);(0,r.useEffect)((()=>{c("errors")}),[n]);const p=(0,r.useCallback)((e=>(t,n)=>{c(n?e:null)}),[]);return u.length>0?o().createElement(aa,{panels:u,expandedPanelId:s,onToggle:p,ErrorComponent:ia}):null},ca=(0,Q.Z)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflowX:"hidden",overflowY:"auto",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},scrollWrapper:{flexGrow:1,overflowY:"auto"},emptyState:{backgroundColor:"#FAFAFA",height:"100%"},profileWrapper:e=>{let{maxWidth:t}=e;return{display:"flex",flexDirection:"column",overflow:"hidden",flexGrow:1,maxWidth:t?`${t}px`:"100%"}},profileContainer:{display:"flex",overflow:"hidden",flexGrow:1},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"}}))),ua=(0,r.memo)((e=>{let{config:t,saveState:n,getSavedState:l}=e;const i=ca({maxWidth:null==t?void 0:t.maxWidth}),s=(0,a.useDispatch)(),c=(0,r.useRef)(),u=(0,r.useCallback)((0,g.DsO)(n,5e3),[n]),{isLoaded:p,savedState:d}=(0,x.a)(l),[m,f]=(0,r.useState)([]),[h,I]=(0,r.useState)([]),L=(0,r.useMemo)((()=>y()(t)),[t]),A=(0,a.useSelector)(v.ZP.selectors.getEntity),M=(0,a.useSelector)(v.ZP.selectors.getIsHistoryModeEnabled),U=(0,r.useMemo)((()=>(0,g.dvH)(A)),[A]),z=(0,E.C)({objectIds:U}),V=(0,r.useContext)(w.h),F=(0,C.U)(),H=(0,S.v)(null==t?void 0:t.workflow),B=(0,a.useSelector)(v.ZP.selectors.getHistoryEvent);(0,P.a)({entity:A,historyEvent:B});const W=(0,O.u)();(0,r.useEffect)((()=>{if(p){const e=L!==d.configHash,{views:n,layout:r}=(0,g.Mfk)({views:e||!d.views?t.views:d.views,layout:e?t.layout:d.layout});I(n),f(r)}}),[p]),(0,r.useEffect)((()=>{s(v.N5.views.actions.profileViewsSet(h))}),[s,h]),(0,r.useEffect)((()=>{t.sidePanelViews&&s(v.N5.sidePanelViews.actions.sidePanelViewsLoaded(t.sidePanelViews))}),[t]),(0,r.useEffect)((()=>{c.current&&(c.current.scrollTop=0)}),[null==A?void 0:A.uri]),(()=>{const e=(0,a.useDispatch)(),t=(0,a.useSelector)(v.ZP.selectors.getValidateReadMode),n=(0,a.useSelector)(v.ZP.selectors.getEntity)||{},{uri:o,updatedTime:l}=n,i=(0,g.biM)(n),s=(0,a.useSelector)(v.ZP.selectors.getMode),c=(0,a.useSelector)(v.ZP.selectors.getProfileViews),u=c&&c.length>0,p=(0,r.useCallback)((0,g.DsO)((t=>{t&&e(v.N5.actions.validateProfile())}),500),[e]);(0,r.useEffect)((()=>{const e=t&&!i&&o&&!(0,g.ZiX)(o)&&s===g.ARY.Viewing&&u;p(e)}),[p,i,t,l,o,s,u])})();const q=(0,r.useCallback)((e=>{u({layout:e,views:h,configHash:L}),f(e)}),[u,L,h]),G=c.current,$=(0,r.useMemo)((()=>({element:G,priority:["top","bottom"]})),[G]);return o().createElement(N.j.Provider,{value:!0},o().createElement(k.s.Provider,{value:F},o().createElement(w.h.Provider,{value:M?V:z},o().createElement(Z.O.Provider,{value:H},o().createElement(T.m.Provider,{value:W},o().createElement("div",{className:i.perspectiveView},(!p||!(null!=A&&A.uri))&&o().createElement(R.Z,null),p&&null!=A&&A.uri?o().createElement("div",{className:i.profileContainer},o().createElement("div",{className:i.profileWrapper},o().createElement(xo,null),!M&&o().createElement(sa,null),o().createElement("div",{ref:c,className:i.scrollWrapper},o().createElement(j.p.Provider,{value:$},o().createElement(io,{layout:m,onLayoutChanged:q,views:h})))),o().createElement(Yo,null)):o().createElement("div",{className:i.emptyState},o().createElement(D.ZP,{LogoRenderer:D.B9.NO_DATA,text:b().text("No data to display."),variant:D.tC.embedded}))))))))}));ua.displayName="ProfilePerspectiveView";const pa=(0,s.createGenerateClassName)({productionPrefix:"profilePerspective",disableGlobal:!0}),da=e=>{let{config:t,store:n,onResize:f=i.identity,saveState:b,getSavedState:h,qxSandboxApi:y}=e;const v=(0,r.useCallback)((0,g.aYu)(h),[h]),x=(0,r.useMemo)((()=>(0,g.Vr9)(t)),[t]);return o().createElement(a.Provider,{store:n},o().createElement(p.m.Provider,{value:x.id},o().createElement(d.Y.Provider,{value:y},o().createElement(s.StylesProvider,{generateClassName:pa},o().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},o().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>f(Math.floor(e),Math.floor(t))}),x&&o().createElement(ua,{config:x,saveState:b,getSavedState:v}),o().createElement(m.Z,{showErrorFromStore:!0}))))))};var ma=n(82842),ga=n(51229),fa=n(91131);const ba=(0,Q.Z)((e=>({titleContainer:{overflow:"hidden",fontSize:"16px",fontWeight:"normal",whiteSpace:"nowrap",textOverflow:"ellipsis",alignItems:"center",display:"flex",minHeight:"48px",color:e.palette.text.secondary},link:{fontSize:"16px",fontWeight:"normal"},icon:{height:"18px",color:e.palette.text.secondary},totalCaption:{lineHeight:"inherit",fontSize:"14px",color:"rgba(0,0,0,0.6)",flexShrink:0,marginRight:"5px"},totalNumber:{fontSize:"16px",color:"rgba(0,0,0,0.87)",marginRight:"5px",fontWeight:500}}))),ha=e=>{let{total:t=0}=e;const n=ba(),l=(0,a.useDispatch)(),i=(0,r.useContext)(p.m),s=(0,r.useCallback)((()=>{l(v.ui.actions.openPerspective({perspectiveId:"profile",viewId:i}))}),[l,i]);return o().createElement(B.Z,{title:""},o().createElement("div",{className:n.titleContainer},o().createElement(H.Link,{component:"button",variant:"caption",className:n.link,onClick:s,underline:"none"},b().text("Profile")),o().createElement(fa.Z,{className:n.icon}),b().text("Tags")),o().createElement(ga.Z,null),o().createElement(H.Typography,{className:n.totalCaption,variant:"caption"},o().createElement("span",{className:n.totalNumber},b().number(t,"0,0")),b().text("total profiles")))};var ya=n(20404);const va=(0,Q.Z)((e=>({toolbar:{display:"flex",flexShrink:0,background:"white",borderBottom:"1px solid rgba(0,0,0,0.1)",boxSizing:"border-box",paddingLeft:"16px"},avatar:{color:"rgba(0, 0, 0, 0.38)",marginRight:"12px"},label:{fontSize:"20px",letterSpacing:"0.25px",lineHeight:"1.2",fontWeight:500,color:e.palette.text.primary,wordBreak:"break-word"}}))),xa=e=>{let{label:t}=e;const n=va();return o().createElement(H.Toolbar,{className:n.toolbar},o().createElement(ya.Z,{className:n.avatar}),o().createElement(H.Typography,{variant:"h6",className:n.label},t))};function Ea(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){wa(e,t,n[t])}))}return e}function wa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ca=(0,Q.Z)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflow:"hidden",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},tagsContainer:{display:"flex"},fullHeight:{flexGrow:1,height:0},tagsView:{margin:"16px",width:"100%",paddingTop:"4px"},listContainer:{flex:1,display:"flex",overflow:"hidden",position:"relative",flexDirection:"column",minHeight:"4px"},entitiesList:{overflowY:"auto",flexGrow:1},pagination:{flexGrow:0}}))),Sa=[25,50,100],Pa=(0,r.memo)((e=>{let{tag:t,entityUri:n}=e;const l=Ca(),[s,c]=(0,r.useState)(Sa[0]),[u,p]=(0,r.useState)(0),d=(0,a.useSelector)(v.ZP.selectors.getGlobalSearchRequestOptions);(0,r.useEffect)((()=>{p(0)}),[t,n,d]);const{isLoading:m,total:f,entities:h}=(e=>{let{tag:t,entityUri:n,page:o=0,rowsPerPage:l=50}=e;const s=(0,a.useDispatch)(),c=(0,ye._)(),u=(0,ye._)(),[p,d]=(0,r.useState)(!1),[m,f]=(0,r.useState)(0),[h,y]=(0,r.useState)([]),{requestEntities:x,requestTotal:E}=(e=>{let{entityUri:t,tag:n}=e;const o=(0,a.useSelector)(v.ZP.selectors.getGlobalSearchRequestOptions),l=(0,a.useSelector)(v.ZP.selectors.getTenant),s=(0,a.useSelector)(v.ZP.selectors.getDtssPath),c=(0,r.useMemo)((()=>(0,g.Do$)(t)),[t]),u=(0,r.useMemo)((()=>[{filter:"equals",fieldName:"tags",values:[n]}]),[n]),p=!!c,d=(0,r.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=Ea({select:"uri,label,type,secondaryLabel,defaultProfilePicValue,startDate,endDate"},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return p?(0,g.uqV)({filters:e,options:t,customerTenant:l,dataTenant:c,dtssPath:s}).then((0,i.map)((0,i.assoc)("dataTenant",c))):(0,g.ZOr)(e,t)}),[p,c,l,s]);return{requestEntities:(0,r.useCallback)(((e,t)=>d(u,Ea({offset:t,max:e},o))),[u,o,d]),requestTotal:(0,r.useCallback)((()=>{const e=o;return(p?(0,g.J$m)({filters:u,options:e,customerTenant:l,dataTenant:c,dtssPath:s}):(0,g.j_Q)(u,e)).then((e=>e.total))}),[u,o,p,c,l,s])}})({entityUri:n,tag:t}),w=(0,r.useCallback)((e=>{s(v.ui.actions.errorSet((0,g.xU7)(e,b().text("Something went wrong")))),f(0)}),[s]);return(0,r.useEffect)((()=>{c(E()).then(f).catch(w)}),[E,c,w]),(0,r.useEffect)((()=>{d(!0),u(x(l,o*l)).then(y).catch(w).finally((()=>d(!1)))}),[o,l,x,u,w]),{isLoading:p,total:m,entities:h}})({tag:t,entityUri:n,page:u,rowsPerPage:s}),y=(0,r.useRef)(null);(0,r.useEffect)((()=>{y.current&&(y.current.scrollTop=0)}),[h]);const x=f>Sa[0];return o().createElement("div",{className:l.perspectiveView},o().createElement(xa,{label:t}),o().createElement("div",{className:A()(l.tagsContainer,{[l.fullHeight]:x})},o().createElement(V.Z,{className:l.tagsView},o().createElement(ha,{total:f}),o().createElement("div",{className:l.listContainer},m&&o().createElement(R.Z,null),f>0&&o().createElement("div",{className:l.entitiesList,ref:y},o().createElement(ma.Z,{entities:h})),x&&o().createElement("div",{className:l.pagination},o().createElement(F.Z,{count:f,rowsPerPageOptions:Sa,rowsPerPage:s,page:u,onChangePage:p,onChangeRowsPerPage:c}))))))}));Pa.displayName="TagPerspectiveView";const Oa=(0,s.createGenerateClassName)({productionPrefix:"tagPerspective",disableGlobal:!0}),Na=e=>{let{config:t,tag:n,entityUri:r,store:l,onResize:u=i.identity}=e;return o().createElement(a.Provider,{store:l},o().createElement(p.m.Provider,{value:t.id},o().createElement(s.StylesProvider,{generateClassName:Oa},o().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>u(Math.floor(e),Math.floor(t))}),t&&o().createElement(Pa,{tag:n,entityUri:r}),o().createElement(m.Z,{showErrorFromStore:!0}))))}},1242:(e,t,n)=>{e.exports=n.p+"5271a9e7b6651c852e93.png"}}]);