@reltio/remotes 1.4.1534 → 1.4.1535
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/6578.js +1 -1
- package/6578.js.map +1 -1
- package/package.json +1 -1
package/6578.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[6578],{66578:(e,t,n)=>{n.d(t,{vC:()=>Al,_n:()=>ul,tM:()=>Ol});var r=n(24328),o=n.n(r),a=n(52730),l=n(8598),i=n(17440),c=n(36138),s=n(44443),u=n(22664),p=n(24605),d=n(87451),m=n(47898),g=n(97094),f=n(60115),h=n(585),b=n(50757),y=n(49885),v=n(87918),x=n.n(v),E=n(76536),w=n(94622),C=n(41564),S=n(7718),O=n(57730),P=n(21077),N=n(26481),k=n(94150),Z=n(26005),T=n(72249),R=n(94773),j=n(99136),D=n(30268),I=n(67268),A=n(71153),M=n.n(A),L=n(8962);const z=o().createContext(null);z.displayName="SingleAttributeContext";var H=n(60995),U=n(10237),V=n(58662),F=n(94079),B=n(93416),W=n(55299),q=n(98448),G=n(75512),_=n(30553),$=n(66410),Y=n(32152),X=n(36444),Q=n(79692);const K=(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"}}))),J=e=>{let{className:t}=e;const n=K(),a=(0,r.useRef)(),[l,i]=(0,r.useState)(!1),{showInactive:c,toggleShowInactive:s}=(0,r.useContext)(z),u=()=>i((e=>!e));return o().createElement(o().Fragment,null,o().createElement(F.Button,{ref:a,classes:{root:M()(n.triggerButton,t)},onClick:u},o().createElement(X.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:c,onChange:e=>s(e.target.checked)}),label:x().text("Show inactive values")})))},ee=(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"}}))),te=e=>{let{caption:t,totalVisibleValues:n,showInactiveValuesMenu:a,isEditableMode:l}=e;const i=ee(),{searchQuery:c,setSearchQuery:s,setPage:u,totalNonVisibleValues:p,nonVisibleValues:d,attributeType:m}=(0,r.useContext)(z),g=l&&(null==m?void 0:m.required);return o().createElement(B.Z,{title:t,className:i.root},g&&o().createElement(W.Z,null),o().createElement(q.Z,{description:null==m?void 0:m.description}),o().createElement(G.Z,{widthToHide:500},o().createElement(_.Z,{height:24,margin:16}),o().createElement(F.Typography,{className:i.totalCaption,variant:"caption"},x().number(n)," ",1===n?x().text("item"):x().text("items"))),o().createElement($.Z,{nonOvTotal:p,className:i.ovIcon,nonOvValues:d,attributeType:m}),o().createElement(Y.i,{query:c,onChange:e=>{s(e),u(0)}}),a&&o().createElement(J,null))};var ne=n(65549),re=n(11564),oe=n(93140),ae=n(76134),le=n(96811),ie=n(48852);const ce=b.nIW,se=(e,t)=>"object"==typeof e?Object.values(e).some((e=>e.some((e=>{let{value:n}=e;return se(n,t)})))):b.P6Y.strings.search(String(e),t),ue=async e=>{let{metadata:t,entity:n,attributeTypeUri:r,defaultMaxValues:o=1/0,offset:a=0,searchQuery:l=""}=e;const c=(0,i.pipe)(b.XtP,(0,i.filter)((e=>{let{value:t}=e;return se(t,l)})))(t,n,r),s=(0,i.filter)(b.OXP,c);return{[(0,b.xy8)(r)]:{[ce(r)]:s.slice(a,a+o),paging:{[r]:{totalOvValues:s.length,totalValues:c.length}}}}},pe=(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,noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px 8px 0"}})));function de(){return de=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},de.apply(this,arguments)}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){ge(e,t,n[t])}))}return e}function ge(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const fe=[],he=(0,ie.l)(R.NY,((e,t)=>{let{parentUri:n,attributeType:r}=t;const{element:o,type:a}=e||{};return{highlightedError:(0,R.Ie)(a)&&(0,b.Wah)(o,n,r.uri)?e:null}}),(e=>{let{values:t,attributeType:n,parentUri:l,showInactive:c,noDataText:s,highlightedError:u}=e;const p=pe(),{uri:d,required:g,cardinality:f,name:h}=n,v=(0,a.useDispatch)(),E=(0,r.useContext)(m.m),w=(0,a.useSelector)(y.ZP.selectors.getEntity),C=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,w.uri)||{})),S=(0,a.useSelector)((e=>y.ZP.selectors.getActiveErrorsForAttributesPager(e,l,n))),O=(0,a.useSelector)((e=>(0,b.tQX)(l,n,y.ZP.selectors.getProfileErrors(e)))),P=(0,a.useSelector)(y.ZP.selectors.getMode),N=(0,b.xy8)(n),k=(0,i.pipe)((0,i.pathOr)(fe,[N,h]),(0,i.map)((0,i.prop)("uri")))(w),Z=(0,i.pathOr)(fe,[N,h],C),T=Z.map((0,i.prop)("uri")),R=(0,b.ZiX)(w.uri),j=(0,r.useMemo)((()=>(0,b.gjI)({parentUri:l,attributeType:n})),[l,n]),{ref:D,errorClassName:I}=(0,re.B)({highlightedError:u,isSimple:!0}),A=(0,b.O27)(Z),L=g&&A,z=L?[j]:Z.filter((0,i.pipe)((0,i.prop)("uri"),b.ZiX)),H=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.addAttributes,v)(e.map((e=>me({},e,{viewId:E}))))),[E,v]),U=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.modifyAttribute,v)(me({},e,{viewId:E}))),[E,v]),V=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.removeAttribute,v)(me({},e,{viewId:E}))),[E,v]),B=(0,r.useCallback)((0,i.pipe)(y.N5.errors.actions.errorDeactivated,v),[v]),W=(0,r.useCallback)((()=>{const e={parentUri:l,attributeType:n};return H(L&&!(0,b.YkM)(n.type)?[e,e]:[e])}),[H,l,n,L]),q=(0,b.Vg3)({attributeType:n,mode:P}),G={attributeType:n,errors:S,crosswalks:C.crosswalks,mode:P,onAddAttributes:H,onChangeAttribute:U,onDeactivateError:B,showNonOv:c},_=0===z.length&&0===t.length;return!(0,i.isEmpty)(C)&&o().createElement("div",{ref:D,className:I},o().createElement(oe.Z,{cardinality:f}),o().createElement(ae.Z,{message:O}),q&&o().createElement(F.Button,{color:"primary",onClick:W,className:p.moreButton},o().createElement(ne.Z,{classes:{root:p.icon}}),o().createElement("div",{className:p.buttonLabel},x().text("Add"))),z.map(((e,t)=>o().createElement(le.Z,de({key:e.uri},G,{attributeValue:e,lazy:L&&!g,showEmptyEditors:R,ownError:(0,b.ADq)(e,t,d,S),onDeleteAttribute:V})))),z.length>0&&t.length>0&&o().createElement(F.Divider,{className:p.divider}),t.map((e=>{const t=Z.find((0,i.propEq)("uri",e.uri)),n=t||e,r=k.includes(n.uri)&&!T.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,b.vKJ)({valueTransformer:(0,i.unless)(b.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:M()({[p.ovFalse]:!(0,b.OXP)(n)})},o().createElement(le.Z,de({},G,{attributeValue:n,ownError:(0,b.ADq)(n,null,d,S),onDeleteAttribute:V,state:l})))})),_&&o().createElement(F.Typography,{className:p.noData},s))}));var be=n(81303);const ye=(0,Q.Z)((()=>({simpleAttribute:{fontSize:"13px",lineHeight:"15px",marginBottom:"4px"}}))),ve=e=>{let{values:t,attributeType:n,showInactive:r}=e;const a=ye(),l=!(0,b.YkM)(n);return o().createElement(o().Fragment,null,t.map((e=>o().createElement(be.Z,{key:e.uri,attributeValue:e,attributeType:n,showNonOv:r,className:M()({[a.simpleAttribute]:l})}))))},xe=(0,Q.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",padding:"4px 16px 9px",overflow:"hidden",flexGrow:1},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"},pagination:{flexGrow:0,flexShrink:0}}))),Ee=15,we=e=>{let{config:t,className:n}=e;const{caption:l,max:i=Ee,showInactiveValuesMenu:c}=t,s=xe(),{values:u,totalVisibleValues:p,page:d,setPage:m,isLoading:g,hasPaging:f,attributeType:h,showInactive:b}=(0,r.useContext)(z),v=(0,a.useSelector)(y.ZP.selectors.getEntityUri),E=(0,a.useSelector)(y.ZP.selectors.getIsViewMode),w=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),C=(0,a.useSelector)(y.ZP.selectors.getPivotingAttributes),S=0!==u.length,O=t["text-empty"]||x().text("No data found");return o().createElement(H.J.Provider,{value:C},o().createElement(U.Z,{className:M()(s.root,n)},o().createElement(te,{totalVisibleValues:p,caption:l,showInactiveValuesMenu:c,isEditableMode:w}),o().createElement(F.Box,{className:s.content},(()=>{if(g)return o().createElement(j.Z,null);if(h){if(E&&S){const e={values:u,attributeType:h,showInactive:b};return o().createElement(ve,e)}if(w){const e={values:u,attributeType:h,parentUri:v,showInactive:b,noDataText:O};return o().createElement(he,e)}}return o().createElement(F.Typography,{className:s.noData},O)})()),f&&o().createElement(V.Z,{count:p,page:d,rowsPerPage:i,rowsPerPageOptions:[],onChangePage:m,classes:{root:s.pagination}})))};var Ce=n(85229),Se=n(20562);function Oe(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=(e,t)=>{const{attributeUri:n,max:o=15}=e,l=(0,a.useSelector)(y.ZP.selectors.getMetadata),[c,s]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),[d,m]=(0,r.useState)(!1),g=(0,Ce._)(),f=(0,r.useRef)(null),h=(0,a.useDispatch)(),v=(0,a.useSelector)(y.ZP.selectors.getApiPath),E=(0,a.useSelector)(y.ZP.selectors.getTenant),w=(0,a.useSelector)(y.ZP.selectors.getEntityWithDiff),C=(0,a.useSelector)(y.ZP.selectors.getIsViewMode),S=(0,a.useSelector)(y.ZP.selectors.getIsHistoryModeEnabled),O=(0,a.useSelector)(y.ZP.selectors.getHistoryDiff),P=w.uri,N=ce(n),k=(0,b.xy8)(n);f.current=(0,b.JQy)(w,P,N);const Z=(0,r.useMemo)((()=>(0,b.zeJ)(l,n)),[l,n]),{globalFilter:T}=(0,a.useSelector)(y.ZP.selectors.getGlobalSearchRequestOptions),{showInactive:R}=t,j=(0,r.useCallback)((()=>{if(Z&&(0,b.Uty)(Z)&&!(0,b.ZiX)(P)&&(0,b.YOQ)(n)){m(!0);const{page:e,showInactive:r}=t,a=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"]),c=(0,b.biM)(w)||S?ue:b.KbL;g(c(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){Oe(e,t,n[t])}))}return e}({metadata:l,entity:w,apiPath:v,tenant:E,parentUri:P,defaultMaxValues:o,attributeTypeUri:n,offset:o*e,globalFilter:T,options:r?"":void 0},a))).then((e=>{const t=(0,i.path)([k],e),r=(0,i.pathOr)([],[N],t);S||h(y.N5.actions.processNextPageOfAttributeValues({parentUri:P,attributeTypeUri:n,attributeTypeName:N,values:r})),s(r.map((e=>{var t;return(null===(t=f.current)||void 0===t?void 0:t.find((0,i.propEq)("uri",e.uri)))||e}))),p((0,i.path)(["paging",n],t))})).catch((e=>{console.error(e),s([]),h(y.ui.actions.errorSet((0,b.xU7)(e,x().text("Something went wrong"))))})).finally((()=>{m(!1)}))}else s([]),p(null)}),[v,P,E,n,o,l,t,T,Z,S,O]);(0,r.useEffect)((()=>{j()}),[j]),(0,Se.D)((()=>{C&&j()}),[C]);const D=(0,i.partition)(b.OXP),[,I]=D(f.current||[]),A=R?[]:I,M=R?"totalValues":"totalOvValues",L=(0,i.ifElse)((0,i.has)(M),(0,i.prop)(M),(0,i.always)(c.length))(u),z=o<L,H=null!=u&&u.totalValues?u.totalValues-L:A.length;return{values:c,isLoading:d,hasPaging:z,totalVisibleValues:L,attributeType:Z,totalNonVisibleValues:H,nonVisibleValues:A}};function Ne(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ke=n(37152),Ze=n(3185),Te=n(31274),Re=n(79026),je=n(8818),De=n(90324),Ie=n(70595);const Ae=o().createContext(null);Ae.displayName="RelationsViewStateContext";const Me=(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"}}))),Le=e=>{let{className:t}=e;const n=Me(),a=(0,r.useRef)(),{showInactive:l,toggleShowInactive:i,sortOrder:c,toggleSortOrder:s,sortOption:u,changeSortOption:p,sortOptions:d}=(0,r.useContext)(Ae),[m,g]=(0,r.useState)(!1),f=()=>g((e=>!e)),h=!(0,b.O27)(d),y="asc"===c;return o().createElement(o().Fragment,null,o().createElement(F.Button,{ref:a,classes:{root:M()(n.button,t)},onClick:f},o().createElement(X.Z,null)),o().createElement(F.Popover,{open:m,classes:{paper:n.popupContent},anchorEl:a.current,onClose:f,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:x().text("Show inactive Relationships")}),h&&o().createElement(o().Fragment,null,o().createElement(F.Divider,{className:n.divider}),o().createElement(F.Typography,{className:n.title,variant:"h6"},x().text("Sort by")),o().createElement("div",{className:n.sortControls},o().createElement(Re.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(je.k,{tooltipTitle:y?x().text("Ascending"):x().text("Descending"),icon:y?De.Z:Ie.Z,onClick:s,className:n.sortOrderButton,size:"L"})))))};Le.displayName="FilterButton";const ze=Le,He=(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 Ue=n(61932),Ve=n(55847);const Fe=o().createContext(null);function Be(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}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}const qe=Math.pow(2,31)-1,Ge=(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 _e=n(81137);const $e=e=>{let{label:t}=e;const n=Ge();return o().createElement(F.Badge,{classes:{anchorOriginTopRightRectangle:n.badgePosition,badge:n.badge},badgeContent:t},o().createElement(Ue.Z,null))},Ye=()=>{const{tenants:e,selectedTenant:t,onConfirmImport:n,onCancelConfirmation:l,onImportClick:i}=(()=>{var e;const t=(0,a.useSelector)(y.ZP.selectors.getDataTenants),n=(0,a.useDispatch)(),{config:o,reloadRelations:l}=(0,r.useContext)(Fe),i=(0,a.useSelector)(y.ZP.selectors.getEntityUri),[c,s]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),d=(0,a.useSelector)(y.ZP.selectors.getDtssPath),m=(0,a.useSelector)(y.ZP.selectors.getTenant),g=[Be({},o.content,{offset:0,max:null!==(e=o.maxDtssImport)&&void 0!==e?e:qe})],f=(0,r.useCallback)((()=>{s([]),o.importFromDT&&!(0,b.ZiX)(i)&&Promise.all((t||[]).map((e=>(0,b.QXb)({entityUri:i,content:g,dtssPath:d,customerTenant:m,dataTenant:e.id}).then((t=>{let{hasNonImportedConnections:n}=t;return Be({},e,{hasNonImportedConnections:n})}))))).then((e=>e.filter((e=>e.hasNonImportedConnections)))).then(s)}),[i,d,m,o,t]),h=(0,r.useCallback)((()=>{(0,b.MOC)({entityUri:i,content:g,dtssPath:d,customerTenant:m,dataTenant:u.id}).then((()=>{l(),f()})).catch((e=>n(y.ui.actions.errorSet((0,b.xU7)(e,x().text("Something went wrong")))))),p(null)}),[i,d,m,o,f,l,u,p]);(0,r.useEffect)((()=>{f()}),[f]);const v=(0,r.useCallback)((()=>p(null)),[]),E=(0,r.useCallback)((e=>p(e)),[]);return{tenants:c,selectedTenant:u,onConfirmImport:h,onCancelConfirmation:v,onImportClick:E}})(),c=Ge(),s=1===e.length,u=s?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,s?o().createElement("div",{className:c.button},o().createElement(je.k,{size:"L",icon:Ue.Z,tooltipTitle:x().text("Import connections from ${label}",{label:e[0].label}),onClick:()=>i(e[0])}),o().createElement("div",{className:M()(c.tenant)},u)):o().createElement(Ve.Z,{menuId:"importDT-table-actions",buttonComponent:je.k,buttonProps:{tooltipTitle:x().text("Import connections"),size:"L",icon:()=>o().createElement($e,{label:u})},menuItems:e.map((e=>({onClick:()=>{i(e)},text:e.label})))}),o().createElement(_e.Z,{open:!!t,title:x().text("Confirmation"),content:x().text("Import connections from ${label}?",{label:null==t?void 0:t.label}),discardCaption:x().text("Cancel"),saveCaption:x().text("Import"),onDiscard:l,onSave:n})))},Xe=e=>{let{title:t,total:n}=e;const a=He(),{searchQuery:l,changeSearchQuery:i}=(0,r.useContext)(Ae);return o().createElement(B.Z,{title:t||"",className:a.header},n>0&&o().createElement(G.Z,{widthToHide:400},o().createElement(_.Z,{height:24,margin:16}),o().createElement(F.Typography,{className:a.totalCaption,variant:"caption"},n>1?x().text("${count} items",{count:n}):x().text("${count} item",{count:n}))),o().createElement(Y.i,{query:l,onChange:i}),o().createElement(Ye,null),o().createElement(ze,null))};var Qe=n(11013),Ke=n(27604),Je=n(22983),et=n(34e3),tt=n(31039);const nt=(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 rt(){return rt=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},rt.apply(this,arguments)}const ot=e=>{let{label:t,entity:n,children:l}=e,c=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 s=nt(),u=(0,Ce._)(),p=(0,a.useSelector)(y.ZP.selectors.getTenant),d=(0,a.useSelector)(y.ZP.selectors.getDtssPath),[m,g]=(0,r.useState)(!1),[f,h]=(0,r.useState)(null);(0,r.useEffect)((()=>{h(null)}),[n]);const v=(0,r.useCallback)((()=>{if(null!=n&&n.entityUri&&!(0,b.ZiX)(null==n?void 0:n.entityUri)&&(0,i.isNil)(f)){const e=(0,i.ifElse)(b.biM,(e=>(0,b.vTU)({entityUri:e.entityUri,dataTenant:e.dataTenant,customerTenant:p,dtssPath:d})),(e=>(0,b.XkT)(e.entityUri)));g(!0),u(e(n)).then((e=>{let{secondaryLabel:t}=e;h(t)})).finally((()=>{g(!1)}))}}),[d,n,p,u,f]),x=o().createElement("div",{className:s.tooltipContent},o().createElement("div",{className:s.label},t),m&&o().createElement(F.CircularProgress,{size:16,classes:{colorPrimary:s.progress}}),f&&o().createElement("div",{className:s.secondaryLabel},f));return o().createElement(F.Tooltip,rt({onOpen:v,title:x,disableFocusListener:!0,classes:{tooltip:s.tooltip}},c),l)},at=(e,t)=>{const{entity:n,relation:r}=e;return{entityType:(0,b.nt9)(t,null==n?void 0:n.entityType),entityLabel:(0,b.idV)(null==n?void 0:n.entityLabel),preparedUri:(0,b.wwR)({uri:null==n?void 0:n.entityUri,dataTenant:null==n?void 0:n.dataTenant}),relationLabel:(null==r?void 0:r.relationLabel)||(0,b.Lmx)(t,null==r?void 0:r.relationType)}};var lt=n(77277);const it=(0,Q.Z)((()=>({container:{display:"flex"}})));function ct(){return ct=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},ct.apply(this,arguments)}const st=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=it();return o().createElement("div",{className:a.container},o().createElement(lt.Z,ct({onClick:t,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),x().text("Accept")),o().createElement(lt.Z,ct({onClick:n,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),x().text("Ignore")))},ut=(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"}}))),pt=(0,r.memo)((e=>{let{connection:t,metadata:n,showControls:l,onRemoveRelation:i,onEditRelation:c,onAcceptRelation:s,onIgnoreRelation:u,renderRelationArrowButton:p}=e;const d=ut(),{entity:m,relation:g}=t,f=(0,b.$qe)(t),h=(0,b.xr3)(t),v=(0,b.iJH)(t),{entityType:E,entityLabel:w,preparedUri:C,relationLabel:S}=at(t,n),O=(0,b.Fn9)(g)&&(0,b.Fn9)(m),P=(0,a.useSelector)(y.ZP.selectors.getMode),{canRemove:N,canUpdate:k}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:o,onEditRelation:a}=e;if((n===b.ARY.Editing||n===b.ARY.Suggesting)&&r){const{relation:{relationType:e}}=r,l=(0,b.$qe)(r),i=(0,b.V3K)(t,e);return{canRemove:o&&!l&&(0,b.Edd)(n,i),canUpdate:a&&!l&&(0,b.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:P,onRemoveRelation:i,onEditRelation:c,metadata:n,connection:t}),Z=(0,r.useCallback)((()=>i(t.relation.relationUri)),[i,t]),T=(0,r.useCallback)((()=>c(t)),[c,t]),R=(0,r.useCallback)((()=>{s(t)}),[s,t]),j=(0,r.useCallback)((()=>u(t)),[u,t]),D=(N||k)&&l&&!t.suggested?o().createElement(o().Fragment,null,k&&o().createElement(je.k,{icon:Ke.Z,size:"XS",onClick:T,tooltipTitle:x().text("Edit")}),N&&o().createElement(je.k,{icon:Je.Z,size:"XS",onClick:Z,tooltipTitle:x().text("Remove")})):void 0,I=t.suggested?o().createElement(st,{acceptRelation:R,ignoreRelation:j,size:"small",disabled:v}):void 0,A=v?x().text("ignored"):x().text("edited");return o().createElement("div",{className:M()(d.container,{[d.rowInactive]:!O},{[d.removed]:f||v})},o().createElement("div",{className:d.row},p&&p(),o().createElement(et.Z,{className:d.entityAvatar,entityType:E}),o().createElement(tt.Z,{value:C,className:d.entityLabelContainer},o().createElement(ot,{label:w,entity:m},o().createElement("span",{className:d.entityLabel},w)),(h||v)&&o().createElement(F.Typography,{variant:"caption",className:d.editedLabel},"(",A,")"),S&&o().createElement("span",{className:d.relationLabel},`, ${S}`)),o().createElement("div",{className:d.editButtonsContent},D),I))}));pt.displayName="EditableRelationItem";const dt=pt,mt=(0,i.when)(b.Kn2,(0,i.prop)("uri")),gt=(e,t)=>{const n=(e,t)=>(t?(0,b.VGB)(t):[]).map((t=>({type:mt(t),direction:e===b.Nsj.IN?b.Nsj.IN:b.Nsj.OUT})));return n(b.Nsj.IN,e).concat(n(b.Nsj.OUT,t))[0]};function ft(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ht=n(98989),bt=n(83543);const yt=(0,Q.Z)({arrowIcon:{fontSize:"16px",marginRight:"6px"}}),vt=e=>{let{onClick:t,connection:n,config:r,showSecondLevel:a}=e;const l=yt(),{parentEntityUri:i}=n,{contentSecondLevel:c}=r,s={onClick:t,className:l.arrowIcon};return i||!c||(0,b.xvW)(n)?null:a?o().createElement(bt.Z,s):o().createElement(ht.Z,s)},xt=(0,Q.Z)({row:{display:"flex",alignItems:"center",width:"100%"},secondLevelContent:{paddingLeft:"24px"}}),Et=e=>{let{config:t,connection:n,children:l}=e;const i=xt(),{showInactive:c}=(0,r.useContext)(Ae),{connections:s,showSecondLevel:u,toggleShowSecondLevel:p,loadRelations:d,loading:m,total:g}=(e=>{let{config:t,connection:n,relationActivityFilter:o}=e;const l=(0,a.useDispatch)(),[i,c]=(0,r.useState)(!1),[s,u]=(0,r.useState)(!1),{contentSecondLevel:p}=t,{entity:d}=n,m=(0,a.useSelector)((e=>y.ZP.selectors.getConnectionsWithDraftsByViewId(e,t.id,d.entityUri)))||[],g=(0,a.useSelector)((e=>y.ZP.selectors.getTotalByViewId(e,t.id,d.entityUri))),{activityFilter:f}=(0,a.useSelector)(y.ZP.selectors.getGlobalSearchRequestOptions)||{},h=(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){ft(e,t,n[t])}))}return e}({},p,{returnObjects:!0,returnDates:!0,activeness:{relation:o||b.Ng6.ALL,entity:f}});u(!0),(0,b.N6e)(d.entityUri,[e]).then((e=>{const{connections:n,total:r}=e[0];n&&l(y.N5.relations.actions.secondLevelRelationsLoaded({connections:n,parentEntityUri:d.entityUri,id:t.id,total:r})),u(!1)}))}),[t.id,p,l,d.entityUri,f,o]),v=(0,r.useCallback)((()=>{i||n.connections||h(),c((e=>!e))}),[h,n.connections,i]);return{connections:m,showSecondLevel:i,toggleShowSecondLevel:v,loadRelations:h,loading:s,total:g}})({config:t,connection:n,relationActivityFilter:c?b.Ng6.ALL:b.Ng6.ACTIVE_ONLY}),f=(0,r.useMemo)((()=>(0,b.Px$)(s)),[s]);return o().createElement(o().Fragment,null,l((()=>o().createElement(vt,{onClick:p,connection:n,config:t,showSecondLevel:u}))),u&&o().createElement(Te.X.Provider,{value:f},o().createElement("div",{className:i.secondLevelContent},o().createElement(Jt,{isLoading:m,config:t,loadRelations:d,connections:s,total:g,parentEntityUri:n.entity.entityUri}))))},wt=(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"}}))),Ct=e=>{let{className:t,connections:n=[],config:l,mode:c,noDataText:s,parentEntityUri:u}=e;const p=(0,a.useSelector)(y.ZP.selectors.getMetadata),d=(0,a.useSelector)((e=>y.ZP.selectors.getRelationToAddByViewId(e,l.id))),m=(0,a.useSelector)((e=>y.ZP.selectors.getRelationsToEditByViewId(e,l.id))),g=(0,a.useSelector)(y.ZP.selectors.getEntity),f=(0,a.useSelector)((e=>y.ZP.selectors.getCheckIfCanAddRelations(e,l.content))),h=(0,a.useDispatch)(),v=wt(),E=(0,r.useCallback)((()=>{const e=(0,b.vlo)({config:l,mode:c,metadata:p,parentEntityUri:u});(0,i.pipe)(y.N5.relations.actions.openRelationEditor(l.id),h)(e)}),[l,c,p,h,u]),w=(0,r.useCallback)((e=>{h(y.N5.relations.actions.closeRelationEditor(l.id,e)),h(y.N5.relations.actions.removeRelation(l.id,e));const t=n.find((t=>y.N5.relations.selectors.getRelationUriFromConnection(t)===e)),r=y.N5.relations.selectors.getEntityUriFromConnection(t);(0,b.ZiX)(r)&&h(y.N5.modifiedEntities.actions.entityDeleted(r))}),[l,n,h]),C=l.content,S=gt(C.inRelations,C.outRelations),O=(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);h(y.N5.relations.actions.addRelation(l.id,t))}),[h,l,S]),P=(0,r.useCallback)((e=>{h(y.N5.relations.actions.ignoreRelation(l.id,{relationType:S.type,relationDirection:S.direction,entityUri:e.entity.entityUri,relationUri:e.relation.relationUri}))}),[h,l,S]),[N,k]=(0,i.partition)(b.xvW,n),Z=g&&f,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,b.xvW)(e),s=`${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(Et,{config:l,connection:e,key:s},(t=>r?o().createElement(Qe.Z,{connection:r,config:l,mode:c,metadata:p}):o().createElement(dt,{renderRelationArrowButton:t,connection:e,metadata:p,showControls:a,onRemoveRelation:w,onEditRelation:(0,i.pipe)(y.N5.relations.actions.openRelationEditor(l.id),h),onAcceptRelation:O,onIgnoreRelation:P})))},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:v.moreButton},o().createElement(ne.Z,{classes:{root:v.icon}}),o().createElement("div",{className:v.buttonLabel},x().text("Add"))),D&&o().createElement(Qe.Z,{connection:d,config:l,mode:c,metadata:p}),N.map(R),N.length>0&&k.length>0&&o().createElement(F.Divider,{className:v.divider}),k.map(R),T&&o().createElement(F.Typography,{className:v.noData},s))};var St=n(19603),Ot=n(94646),Pt=n(78101),Nt=n(80931);const kt=(0,Q.Z)((e=>({attributesList:{paddingLeft:"46px",paddingRight:"16px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0}})));function Zt(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){Tt(e,t,n[t])}))}return e}function Tt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Rt=e=>{let{connection:t,className:n}=e;const l=kt(),{relation:c}=t,s=(0,a.useSelector)(y.ZP.selectors.getEntityUriWithDataTenant),u=(0,a.useSelector)(y.ZP.selectors.getMetadata),p=(0,r.useMemo)((()=>(0,b.xF8)(u,null==c?void 0:c.relationType)),[null==c?void 0:c.relationType,u]),d=(0,r.useMemo)((()=>Zt({attributes:Zt({},y.N5.relations.selectors.getRelationAttributesFromConnection(t))},(0,b.p2l)((null==t?void 0:t.relation)||{}))),[t]),m=(0,r.useMemo)((()=>(0,b.fyF)(p,d)),[p,d]).filter((e=>{let{values:t}=e;return!(0,b.O27)(t)})).length>0,g=(0,r.useMemo)((()=>(0,b.R$r)(d.attributes)),[d]),{getCommentsCount:f}=(0,r.useContext)(C.h);(0,r.useEffect)((()=>{!(0,i.isEmpty)(g)&&f(g)}),[f,g]);const h=(0,r.useMemo)((()=>(0,b.wp9)(b.q7e.RELATION,{entityUri:s,connection:t})),[t,s]);return m?o().createElement(Pt.A.Provider,{value:h},o().createElement(Nt.Z,{className:M()(l.attributesList,n),entity:d,attrTypes:p})):o().createElement("div",{className:M()(l.attributesList,n)},x().text("No attributes"))};var jt=n(86602),Dt=n(82726);const It=e=>{let{show:t,onToggle:n,className:r}=e;return o().createElement(je.k,{className:r,tooltipTitle:t?x().text("Hide attributes of the relationship"):x().text("Show attributes of the relationship"),tooltipPlacement:"bottom-end",size:"XXS",icon:t?jt.Z:Dt.Z,onClick:n})},At=(0,Q.Z)((e=>({container:{display:"flex",flexDirection:"column",paddingBottom:"2px"},row:{display:"flex",alignItems:"center",flexDirection:"row",minHeight:"16px",padding:"3px 11px 3px 16px"},rowInactive:{background:e.inactiveBackground},entityAvatar:{height:"12px",width:"12px",fontSize:"11px",marginRight:"8px"},entityLabelContainer:{textDecoration:"none",cursor:"pointer",wordBreak:"break-all",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"},showDetails:{marginLeft:"auto",paddingRight:"5px"},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"},labelWrapper:{display:"flex",alignItems:"center"}}))),Mt=(0,r.memo)((e=>{let{connection:t,renderRelationArrowButton:n,acceptRelation:l,ignoreRelation:c}=e;const s=At(),u=t.suggested,{entity:p,relation:d}=t,[m,g]=(0,r.useState)(!1),f=(0,a.useSelector)(y.ZP.selectors.getMetadata),{entityType:h,entityLabel:v,preparedUri:x,relationLabel:E}=at(t,f),w=(0,b.Fn9)(d)&&(0,b.Fn9)(p),C=(0,a.useSelector)(y.ZP.selectors.getEntityUriWithDataTenant),S=p&&d&&(0,b.wp9)(b.q7e.RELATION,{entityUri:C,connection:t})||[];return o().createElement("div",{className:M()(s.container,{[s.rowInactive]:!w},{[s.suggestedWrapper]:u})},o().createElement("div",{className:M()(s.row,St.U)},n&&n(),o().createElement("div",{className:s.labelWrapper},o().createElement(et.Z,{className:s.entityAvatar,entityType:h}),o().createElement(tt.Z,{value:x,className:s.entityLabelContainer},o().createElement(ot,{label:v,entity:p},o().createElement("span",{className:s.entityLabel},v)),E&&o().createElement("span",{className:s.relationLabel},`, ${E}`))),o().createElement("div",{className:s.additionalButtonsWrapper},!(0,i.isEmpty)(S)&&o().createElement(Ot.Z,{className:s.commentsContainer,uri:(0,b.gjS)(d),relatedObjectUris:S,objectType:b.q7e.RELATION,allowOnlyOneComment:!0}),u&&o().createElement(st,{size:"small",acceptRelation:l(t),ignoreRelation:c(t)}),!u&&o().createElement(It,{show:m,onToggle:()=>{g((e=>!e))},className:s.showDetails}))),m&&o().createElement(Rt,{connection:t}))}));Mt.displayName="RelationItem";const Lt=Mt;var zt=n(52691),Ht=n(16208);const Ut=e=>e.filter((e=>5===e.value)).length,Vt=e=>e.filter((e=>1===e.value)).length,Ft=e=>0===e.length?"0%":Ut(e)/e.length*100+"%",Bt=e=>0===e.length?"0%":Vt(e)/e.length*100+"%",Wt=(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)"}}))),qt=e=>{let{ratings:t,className:n}=e;const r=Wt();return o().createElement("div",{className:M()(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:Ft(t)}}),o().createElement("div",{className:r.dislikesScale,style:{width:Bt(t)}})),o().createElement("div",{className:r.counts},o().createElement("div",{className:M()(r.likesCount,r.count)},o().createElement(zt.Z,{className:r.icon}),Ut(t)),o().createElement("div",{className:r.count},o().createElement(Ht.Z,{className:r.icon}),Vt(t))))},Gt=(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}}))),_t=e=>{let{ratings:t,onAgree:n,onDisagree:r}=e;const l=Gt(),i=(0,a.useSelector)(y.ZP.selectors.getUserName),c=t.find((e=>{let{user:t}=e;return t===i})),s=[{text:x().text("Has left the practice"),onClick:()=>r(x().text("Has left the practice"))},{text:x().text("Has moved away"),onClick:()=>r(x().text("Has moved away"))},{text:x().text("Has passed away"),onClick:()=>r(x().text("Has passed away"))},{text:x().text("Has retired"),onClick:()=>r(x().text("Has retired"))},{text:x().text("Other"),onClick:()=>r(x().text("Other"))}];return o().createElement("div",{className:l.wrapper},o().createElement(F.Button,{onClick:n,variant:"text",size:"small",className:M()(l.button,l.likeButton,{[l.isActive]:5===(null==c?void 0:c.value)})},"Agree"),o().createElement(Ve.Z,{buttonProps:{endIcon:o().createElement(bt.Z,null),variant:"text",size:"small",className:M()(l.button,{[l.isActive]:1===(null==c?void 0:c.value)})},buttonContent:1===(null==c?void 0:c.value)?c.comment:"Disagree",menuItems:s,menuId:"disagree-dropdown-menu-button"}))},$t=(0,Q.Z)((e=>({wrapper:{padding:"6px 16px 6px"},entityTypeIcon:{marginRight:"16px"},entityLabel:{color:e.palette.primary.main,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},entityLabelContainer:{wordBreak:"break-all",textDecoration:"none"},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 8px 6px 16px",backgroundColor:e.suggested},commentsContainer:{alignSelf:"center","& + $ratings":{marginLeft:"16px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex"}}))),Yt=e=>{let{connection:t,loadRelations:n,renderRelationArrowButton:l,acceptRelation:c,ignoreRelation:s}=e;const u=$t(),p=t.suggested,[d,m]=(0,r.useState)(!1),{entity:g,relation:f}=t,h=(0,a.useSelector)(y.ZP.selectors.getMetadata),{entityLabel:v,entityType:x,preparedUri:E,relationLabel:w}=at(t,h),C=(null==f?void 0:f.ratings)||[],S=(0,a.useSelector)(y.ZP.selectors.getEntityUriWithDataTenant),O=g&&f&&(0,b.wp9)(b.q7e.RELATION,{entityUri:S,connection:t})||[];return o().createElement("div",{className:M()(u.wrapper,{[u.suggestedWrapper]:p})},o().createElement(F.Box,{display:"flex",minHeight:"44px",className:St.U},o().createElement(F.Box,{display:"flex",alignItems:"center"},o().createElement(F.Box,{display:"flex",alignItems:"center"},l&&l(),o().createElement(et.Z,{entityType:x,className:u.entityTypeIcon})),o().createElement(F.Box,{display:"flex",flexDirection:"column"},o().createElement(tt.Z,{value:E,className:u.entityLabelContainer},o().createElement(ot,{label:v,entity:g},o().createElement("span",{className:u.entityLabel},v))),w&&o().createElement("span",{className:u.relationLabel},w),!p&&o().createElement(_t,{ratings:C,onAgree:()=>{(0,b.Buf)(null==f?void 0:f.relationUri,{comment:"",value:5}).then(n)},onDisagree:e=>{(0,b.Buf)(null==f?void 0:f.relationUri,{comment:e,value:1}).then(n)}}))),o().createElement("div",{className:u.additionalButtonsWrapper},!(0,i.isEmpty)(O)&&o().createElement(Ot.Z,{className:u.commentsContainer,uri:(0,b.gjS)(f),relatedObjectUris:O,objectType:b.q7e.RELATION,allowOnlyOneComment:!0}),p&&o().createElement(st,{acceptRelation:c(t),ignoreRelation:s(t)}),!p&&o().createElement(o().Fragment,null,o().createElement(qt,{ratings:C,className:u.ratings}),o().createElement(It,{show:d,onToggle:()=>{m((e=>!e))},className:u.showDetailsButton})))),d&&o().createElement(Rt,{connection:t,className:u.relationAttributes}))},Xt=e=>{let{className:t,connections:n=[],loadRelations:l,config:i,mainEnityUri:c}=e;const{isComplex:s,content:u}=i,{ignoreRelation:p,acceptRelation:d}=((e,t,n)=>{const r=gt(e.inRelations,e.outRelations),o=(0,a.useDispatch)();return{ignoreRelation:e=>()=>{const{entity:a}=e;(0,b.iiD)(n,{relatedEntityUri:a.entityUri,relationType:r.type,relationDirection:r.direction}).then(t).catch((e=>{o(y.ui.actions.errorSet((0,b.xU7)(e,x().text("Something went wrong"))))}))},acceptRelation:e=>()=>{const{entity:a,relation:l}=e,{startDate:i,endDate:c}=l,s=r.direction===b.Nsj.IN,u=s?a.entityUri:n,p=s?n:a.entityUri;(0,b.DsR)({startEntityUri:u,endEntityUri:p,relationType:r.type,attributes:null,startDate:i,endDate:c}).then(t).catch((e=>{o(y.ui.actions.errorSet((0,b.xU7)(e,x().text("Something went wrong"))))}))}}})(u,l,c),m=(0,r.useMemo)((()=>(0,b.w3p)(n)),[n]),{getCommentsCount:g}=(0,r.useContext)(C.h);return(0,r.useEffect)((()=>{g(m)}),[g,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(Et,{config:i,connection:e,key:r},(t=>s?o().createElement(Yt,{loadRelations:l,connection:e,acceptRelation:d,ignoreRelation:p,renderRelationArrowButton:t}):o().createElement(Lt,{acceptRelation:d,ignoreRelation:p,connection:e,renderRelationArrowButton:t})))})))};Xt.displayName="RelationsList";const Qt=Xt,Kt=(0,Q.Z)((e=>({list:{paddingTop:"8px",paddingBottom:"10px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),Jt=e=>{let{isLoading:t,config:n,loadRelations:r,connections:l,total:i,parentEntityUri:c}=e;const s=Kt(),{selectors:u}=y.ZP,p=(0,a.useSelector)(u.getEntity),d=(0,a.useSelector)(u.getMode),m=n["text-empty"]||x().text("No data found");return t?o().createElement(j.Z,null):(0,b.KIu)(d)?o().createElement(Ct,{connections:l,className:s.list,key:null==p?void 0:p.uri,config:n,mode:d,noDataText:m,parentEntityUri:c}):i>0?o().createElement(Qt,{config:n,loadRelations:r,connections:l,className:s.list,key:null==p?void 0:p.uri,mainEnityUri:p.uri}):o().createElement(F.Typography,{className:s.noData},m)},en=(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}}),tn=e=>{let{config:t,className:n}=e;const l=en(),{page:c,setPage:s,rowsPerPage:u,sortOrder:p,sortOption:d,showInactive:m,searchQuery:g,changeSearchQuery:f}=(0,r.useContext)(Ae),{selectors:h}=y.ZP,v=(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)((()=>{f("")}),[null==x?void 0:x.uri]);const S=(0,r.useMemo)((()=>(e=>{const t=b.wSh.fromFalsy(e).map(b.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome("");return(new b.MEy).addClause(t).build()})(g)),[g]),{isLoading:O,reload:P}=(0,ke.a)({sorting:C,filter:S,page:c,rowsPerPage:u,config:t,entity:x,relationActivityFilter:m?b.Ng6.ALL:b.Ng6.ACTIVE_ONLY,mode:w}),N=(0,r.useMemo)((()=>(0,b.Px$)(v)),[v]),k=(0,r.useMemo)((()=>({reloadRelations:P,config:(0,i.pick)(["content","importFromDT","maxDtssImport"],t)})),[P,t]);return o().createElement(Ze.u.Provider,{value:x},o().createElement(Te.X.Provider,{value:N},o().createElement(U.Z,{className:n},o().createElement("div",{className:l.container},o().createElement(Fe.Provider,{value:k},o().createElement(Xe,{title:t.caption,total:E})),o().createElement("div",{className:l.content},o().createElement(Jt,{isLoading:O,config:t,loadRelations:P,connections:v,total:E}),E>u&&o().createElement(V.Z,{classes:{root:l.pagination},count:E,rowsPerPageOptions:[],rowsPerPage:u,page:c,onChangePage:s}))))))};tn.displayName="RelationsView";const nn=o().createContext(null);nn.displayName="TableAttributeContext";var rn=n(86361),on=n(26180),an=n(31276);function ln(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){cn(e,t,n[t])}))}return e}function cn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const sn="CHANGE_SEARCH_QUERY",un=ln({},on.ZP.actions,{changeSearchQuery:(0,an.zD)(sn)}),pn=(e,t)=>t.type===sn?ln({},e,{searchQuery:t.payload,page:0}):on.ZP.reducer(e,t);var dn=n(92332),mn=n(67353);function gn(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){fn(e,t,n[t])}))}return e}function fn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const hn={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},bn=(0,Q.Z)((()=>({headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"12px"},rowCell:{fontSize:"13px",overflow:"hidden"},blobWrapper:{position:"relative",overflowY:"auto",overflowX:"hidden",whiteSpace:"pre",maxHeight:"100px",boxSizing:"border-box",padding:"15px 25px 0 25px"},defaultWrapper:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",padding:"15px 25px 0 25px"},updateAttribute:gn({padding:"0 4px",marginLeft:"-4px"},b.zXF[b.Y1q.updateAttribute]),insertAttribute:gn({},b.zXF[b.Y1q.insertAttribute]),deleteAttribute:gn({padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},b.zXF[b.Y1q.deleteAttribute]),description:{marginLeft:"-22px"},"row-cell--sorted":{color:"rgba(0,0,0,0.87)"},"row-cell--removed":{pointerEvents:"none","& > div":hn}}))),yn=(0,mn.Z)((e=>{const t=bn(),{description:n}=(null==e?void 0:e.headCellData)||{};return o().createElement("div",{className:t.headCell},o().createElement(dn.default,e),o().createElement(q.Z,{description:n,className:t.description}))}));var vn=n(72768),xn=n(95613);const En=e=>{let{value:t,historyClassName:n}=e;const r=bn();return o().createElement("div",{className:r.blobWrapper,onScroll:an.UW},o().createElement("span",{className:r[n]},t))},wn=e=>{let{value:t,columnData:{dataTypeDefinition:n}}=e;const a=bn(),{value:l,uri:c}=t,{appearance:s}=(0,r.useContext)(Z.m),u=(0,i.pipe)(b.IFm,b.o_F)(c,s);if(n.type===b.oS0.TYPE_BLOB)return o().createElement(En,{value:l,historyClassName:u});{const e=o().createElement(vn.Z,{value:l,dataTypeDefinition:n});return o().createElement(xn.Z,{value:e},o().createElement("div",{className:a.defaultWrapper},o().createElement("span",{className:a[u]},e)))}};function Cn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Sn=(e,t)=>{const{uri:n,label:r,children:o,name:a,description:l}=e;return(0,i.reject)(i.isNil,{id:(0,b.Tde)(n,t),label:r,description:l,dataTypeDefinition:(0,b.PFL)(e),children:null==o?void 0:o.map((e=>Sn(e,t.concat({name:a}))))})},On=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),Pn=e=>{if((0,b.vZp)(e)){const t=On(e);return t.length>1?t.slice(0,-1):null}return null},Nn=(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){Cn(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:Pn(e.id),headCellRenderer:yn,rowCellValueRenderer:wn})));var kn=n(37754);function Zn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Tn=n(1876),Rn=n(60894);const jn=(0,Q.Z)((()=>({header:{padding:"0 4px 0 16px"}}))),Dn=e=>{let{title:t}=e;const n=jn(),l=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),{attributeType:i,searchQuery:c,setSearchQuery:s,filters:u,onToggleFilters:p,allColumnsData:d,visibleColumns:m,onChangeColumns:g}=(0,r.useContext)(nn),f=l&&(null==i?void 0:i.required);return o().createElement(B.Z,{title:t,className:n.header},f&&o().createElement(W.Z,null),o().createElement(q.Z,{description:null==i?void 0:i.description}),o().createElement(Y.i,{query:c,onChange:s}),o().createElement(Tn.Z,{enabled:!!u,onClick:p}),o().createElement(_.Z,{height:24,margin:4}),o().createElement(Rn.Z,{columnsData:d,selectedColumns:m,onChangeColumns:g}))};function In(){return In=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},In.apply(this,arguments)}const An=(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=bn();return o().createElement("div",{className:M()({[i["row-cell--sorted"]]:a,[i["row-cell--removed"]]:r},i.rowCell)},t.values.map(((e,t)=>o().createElement(n,In({key:t,value:e},l)))))}));var Mn=n(52016),Ln=n(85709);const zn=(0,Q.Z)((()=>({tableContainer:{display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)",marginBottom:"15px"},"row-cell__buttons-container":{position:"absolute"},"row-cell__buttons-wrapper":{display:"flex",paddingLeft:"10px","& > button":{marginLeft:"-10px",transform:"scale(0.9)"}}}))),Hn=e=>{let{onEdit:t,onRemove:n}=e;return o().createElement(o().Fragment,null,t&&o().createElement(je.k,{tooltipTitle:x().text("Edit"),icon:Ke.Z,size:"L",onClick:t}),n&&o().createElement(je.k,{tooltipTitle:x().text("Remove"),icon:Je.Z,size:"L",onClick:n}))};function Un(){return Un=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},Un.apply(this,arguments)}const Vn=e=>{let{columnsData:t,values:n,sorting:l,onSort:c,filters:s,onFilter:u,config:p,onEdit:d,onDeleteAttribute:m,deletedUris:g}=e;const f=(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,b.xIV)(e))(t))(On(e),t))(r,e),t)}),{}),(0,i.assoc)("value",e))(t))))(n,t)),[n,t]),h=(0,r.useMemo)((()=>Nn(t)),[t]),v=zn(),x=(0,a.useSelector)(y.ZP.selectors.getMode),E=(0,b.KIu)(x),w=(0,a.useSelector)(y.ZP.selectors.getMetadata),C=(0,a.useSelector)(y.ZP.selectors.getEntityUri),S=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,C)||{})),{attributeType:O}=(0,r.useContext)(nn),P=(0,r.useCallback)((e=>o().createElement(An,Un({},e,{isSorted:!!l&&l.field===e.columnData.id}))),[l]),[N,k]=(0,r.useState)(null),{canUpdate:Z,canDelete:T}=(0,Mn.l)(),R=(0,r.useMemo)((()=>"number"!=typeof N||!E||g.includes((0,i.pipe)((0,i.path)([N]),(0,i.prop)("uri"))(n))),[N,g,n,E]),j="number"==typeof N&&(D=(0,i.path)([N],n),T(p)&&(0,b.xv5)({attributeType:O,mode:x,attributeValue:D,metadata:w,isReltioCrosswalk:(0,b.KVV)(S.crosswalks,D)}));var D;const I="number"==typeof N&&(e=>Z(p)&&(0,b.yv0)({attributeType:O,mode:x,attributeValue:e,isReltioCrosswalk:(0,b.KVV)(S.crosswalks,e)}))((0,i.path)([N],n)),A=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);I&&d(e)}),[d,N,n,I]),M=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);if(!j)return;const t={parentUri:C,attributeType:O,uri:e.uri,value:e};m(t),k(null)}),[N,n,m,j,O,C]),L=R||!j&&!I?void 0:o().createElement(Hn,{onEdit:I?A:void 0,onRemove:j?M:void 0}),z=(0,r.useMemo)((()=>({deletedUris:g})),[g]);return o().createElement("div",{className:v.tableContainer},o().createElement(Ln.Z,{autosizing:!0,maxHeight:477,columnsData:h,rowsData:f,sorting:l,onSort:c,filters:s,onFilter:u,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,resizeDebounceDelay:150,renderRowCell:P,onRowHover:k,hoverRowIndex:N,hoveredRowRightContent:L,context:z,classes:{hoveredRowRightContentWrapper:v["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:v["row-cell__buttons-container"]}}))};function Fn(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){Bn(e,t,n[t])}))}return e}function Bn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Wn=[],qn=(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 Gn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const _n=e=>{let{onChangeAttribute:t,onCancel:n,onApply:l,onDeleteAttribute:c,hasChanges:s,attributeValue:u}=e;const p=qn(),d=(0,a.useDispatch)(),g=(0,r.useContext)(m.m),{attributeType:f}=(0,r.useContext)(nn),h=(0,a.useSelector)(y.ZP.selectors.getEntityUri),v=(0,a.useSelector)(y.ZP.selectors.getMode),E=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,h)||{})),w=(0,b.YkG)(f)&&(0,b.ZiX)((0,b.bwT)(u)),C=(0,a.useSelector)((e=>w?y.ZP.selectors.getModifiedEntities(e):void 0)),S=(0,a.useSelector)((e=>y.ZP.selectors.getActiveErrorsForAttributesPager(e,h,f))),O=(0,b.ZiX)(h),P=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.addAttributes,d)(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){Gn(e,t,n[t])}))}return e}({},e,{viewId:g}))))),[g,d]),N=(0,r.useCallback)((0,i.pipe)(y.N5.errors.actions.errorDeactivated,d),[d]);return o().createElement(o().Fragment,null,o().createElement(le.Z,{expanded:!0,attributeValue:u,showEmptyEditors:O,onDeleteAttribute:c,onDeactivateError:N,onChangeAttribute:t,onAddAttributes:P,mode:v,crosswalks:E.crosswalks,errors:S,attributeType:f,ownError:(0,b.ADq)(u,null,f.uri,S)}),o().createElement("div",{className:p.actionButtons},o().createElement(F.Button,{onClick:()=>n(u)},x().text("Cancel")),o().createElement(F.Button,{color:"primary",disabled:!s,onClick:()=>l(u,C)},x().text("Apply"))))};var $n=n(54198);const Yn=e=>(null==e?void 0:e.type)===b.NIO.missed,Xn=(0,i.curry)(((e,t)=>e.find((0,i.pipe)((0,i.prop)("uri"),(0,i.either)((0,b.sOy)(t.parentUri),(0,i.equals)(t.uri)))))),Qn=(0,Q.Z)((()=>({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"}}))),Kn=e=>{let{config:t,editingValues:n,modifiedValues:l,onChangeAttribute:c,onDeleteAttribute:s,onAdd:u,onCancel:p,onApply:d,onStartEditing:m,onReset:g,checkHasChanges:f,highlightedError:h,highlightedAttributeError:v}=e;const E=Qn(),{attributeType:w}=(0,r.useContext)(nn),C=(0,a.useSelector)(y.ZP.selectors.getMode),{canCreate:S}=(0,Mn.l)();(e=>{let{onStartEditing:t,modifiedValues:n,highlightedError:o,highlightedAttributeError:l}=e;const{attributeType:c}=(0,r.useContext)(nn),s=(0,a.useSelector)(y.ZP.selectors.getEntityUri),u=(0,a.useSelector)((e=>y.ZP.selectors.getActiveErrorsForAttributesPager(e,s,c))),p=(0,r.useRef)(!0),d=(0,$n.u)(),m=(0,r.useMemo)((()=>u.find((0,i.both)(Yn,(e=>(0,b.Wah)(e,s,c.uri))))),[u,s,c.uri]);(0,r.useEffect)((()=>{m&&1===n.length&&t(n[0])}),[m]),(0,r.useEffect)((()=>{p.current&&u.length&&((0,i.pipe)((0,i.map)(Xn(n)),(0,i.reject)(i.isNil),(0,i.forEach)(t))(u),p.current=!1)}),[u]),(0,r.useEffect)((()=>{Yn(o)&&1===n.length&&t(n[0])}),[o]),(0,r.useEffect)((()=>{if(l){const e=Xn(n,l);e&&t(e)}}),[l]),(0,r.useEffect)((()=>{const e=d((e=>{e.type===y.N5.constants.ProfileActions.SAVE_PROFILE&&(p.current=!0)}));return()=>e()}),[d])})({onStartEditing:m,modifiedValues:l,highlightedError:h,highlightedAttributeError:v});const O=S(t)&&w&&(0,b.Vg3)({attributeType:w,mode:C})&&!n.length;return(0,r.useEffect)((()=>()=>g()),[g]),o().createElement("div",{className:E.editor},O&&o().createElement(F.Button,{color:"primary",onClick:u,className:E.addButton},o().createElement(ne.Z,{classes:{root:E.icon}}),o().createElement("div",{className:E.buttonLabel},x().text("Add"))),n.map((e=>o().createElement(_n,{key:e.uri,attributeValue:e,onChangeAttribute:c,onDeleteAttribute:s,onCancel:p,onApply:d,hasChanges:f(e)}))))},Jn=(0,ie.l)(R.NY,((e,t)=>{let{entityUri:n,attributeType:r}=t;const{element:o,type:a}=e||{},l=(0,R.Ie)(a),i=l&&(0,b.Wah)(o,n,r.uri);return{highlightedError:i?e:null,highlightedAttributeError:o&&l&&!i&&(0,b.nsY)(r,o)&&(0,b.vyG)(n,o)?e:null}}),(e=>{let{config:t,highlightedError:n,highlightedAttributeError:l}=e;const c=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),{values:s,visibleColumns:u,onFilter:p,onSort:d,filters:g,sorting:f,allColumnsData:h}=(0,r.useContext)(nn),{onDeleteAttribute:v,onStartEditing:x,onChangeAttribute:E,onAdd:w,onCancel:C,onApply:S,onReset:O,checkHasChanges:P,modifiedValues:N,editingValues:k,deletedUris:Z}=(()=>{const[e,t]=(0,r.useState)(),[n,o]=(0,r.useState)([]),l=(0,a.useDispatch)(),c=(0,a.useSelector)(y.ZP.selectors.getMode),s=(0,a.useSelector)(y.ZP.selectors.getEntityUri),u=(0,a.useSelector)(y.ZP.selectors.getMetadata),p=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,s)||{})),d=(0,r.useContext)(m.m),{attributeType:g,values:f}=(0,r.useContext)(nn),h=(0,b.KIu)(c),v=(0,b.xy8)(g),x=(0,i.pathOr)(Wn,[v,null==g?void 0:g.name],p),E=(0,r.useMemo)((()=>(0,b.gjI)({parentUri:s,attributeType:g})),[s,g]),w=(0,b.O27)(x),C=g.required&&w,S=(0,r.useMemo)((()=>C?[E]:x),[E,x,C]),O=(0,r.useMemo)((()=>[...S.filter((0,i.pipe)((0,i.prop)("uri"),(0,i.both)(b.ZiX,(0,i.pipe)((0,i.equals)(e),i.not)))),...(0,i.map)((e=>S.find((0,i.propEq)("uri",e.uri))||e))(f)].map((e=>{var t;return null!==(t=n.find((0,i.propEq)("uri",e.uri)))&&void 0!==t?t:e}))),[S,n,e,f]),P=(0,r.useMemo)((()=>(0,i.pipe)((0,i.map)((0,i.prop)("uri")),(0,i.filter)((e=>!S.find((0,i.propEq)("uri",e)))))(h?f:[])),[S,f,h]),N=S.filter((t=>{let{uri:r}=t;return r===e||n.find((0,i.propEq)("uri",r))})),k=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.modifyAttribute,l)(Fn({},e,{viewId:d}))),[d,l]),Z=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.removeAttribute,l)(Fn({},e,{viewId:d}))),[d,l]),T=(0,r.useCallback)((()=>{const e=(0,b.gjI)({parentUri:s,attributeType:g});t(e.uri),k(Fn({},e,{value:(0,b.GPx)({attributeTypes:(0,b.BoX)(u,g),parentUri:e.uri,mode:c,metadata:u}),attributeType:g}))}),[s,g,u,c,k]),R=(0,r.useCallback)((e=>{o((t=>t.find((0,i.propEq)("uri",e.uri))?t:[...t,e]))}),[o]),j=(0,r.useCallback)((e=>{const r=n.find((0,i.propEq)("uri",e.uri));if(r){const t={attributeType:g,value:r,uri:e.uri};o((e=>(0,i.without)([r],e))),w||k(t)}else{const n={value:e,attributeType:g,uri:e.uri};t(null),Z(n)}l(y.N5.errors.actions.errorsSet([]))}),[Z,k,o,w,n,g,l]),D=(0,r.useCallback)(((e,t)=>{const n=(0,b.q5j)(u,g,e,t).map((n=>Fn({},n,{path:(0,b.Z9i)({entityUri:s,metadata:u,entitiesMap:t||{[s]:(0,b.PeS)(g,e)}},n.uri||n.parentUri)})));return l(y.N5.errors.actions.errorsSet(n)),0===n.length}),[l,s,g,u]),I=(0,r.useCallback)(((e,n)=>{D(e,n)&&(t(null),o((t=>{const n=t.find((0,i.propEq)("uri",e.uri));return n?(0,i.without)([n],t):t})))}),[o,t,D]),A=(0,r.useCallback)((()=>{o([]),t(null)}),[]);return{checkHasChanges:e=>n.find((0,i.propEq)("uri",e.uri))!==e,onChangeAttribute:k,onDeleteAttribute:Z,onAdd:T,onCancel:j,onApply:I,onStartEditing:R,onReset:A,modifiedValues:O,editingValues:N,deletedUris:P}})(),{ref:T,errorClassName:R}=(0,re.B)({highlightedError:n,isSimple:!0}),j=c?N:s,D=(0,r.useMemo)((()=>u.map((e=>h.find((0,i.propEq)("id",e))))),[u,h]);return o().createElement("div",{ref:T,className:R},c&&o().createElement(Kn,{config:t,editingValues:k,modifiedValues:N,onChangeAttribute:E,onDeleteAttribute:v,onAdd:w,onReset:O,onCancel:C,onApply:S,onStartEditing:x,checkHasChanges:P,highlightedError:null==n?void 0:n.element,highlightedAttributeError:null==l?void 0:l.element}),D.length>0&&o().createElement(Vn,{columnsData:D,config:t,values:j,filters:g,onFilter:p,sorting:f,onSort:d,onEdit:x,onDeleteAttribute:v,deletedUris:Z}))})),er=(0,Q.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",overflow:"hidden"},noData:{fontSize:"13px",paddingLeft:"20px",color:"rgba(0,0,0,0.54)"},header:{padding:"0 4px 0 16px"}}))),tr=15,nr=e=>{let{config:t,className:n}=e;const{caption:l,max:i=tr}=t,c=er(),s=(0,a.useSelector)(y.ZP.selectors.getEntityUri),{totalVisibleValues:u,attributeType:p,showTable:d,hasPaging:m,isLoading:g,page:f,setPage:h}=(0,r.useContext)(nn);return o().createElement(U.Z,{className:M()(c.root,n)},d?o().createElement(o().Fragment,null,o().createElement(Dn,{title:l}),o().createElement("div",{className:c.content},o().createElement(Jn,{config:t,attributeType:p,entityUri:s}),m&&o().createElement(V.Z,{count:u,rowsPerPageOptions:[],rowsPerPage:i,page:f,onChangePage:h}),g&&o().createElement(j.Z,null))):o().createElement(o().Fragment,null,o().createElement(B.Z,{title:l,className:c.header},o().createElement(q.Z,{description:null==p?void 0:p.description})),o().createElement(F.Typography,{className:c.noData},x().text("No data"))))};var rr=n(58600);function or(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let ar=0;const lr=()=>ar++,ir=e=>{const t={children:[],nodeId:lr()};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,c={entity:l,children:[],nodeId:lr(),expanded:!0,rootIndex:i?n+1:void 0};i&&(c.root=i),o.children.push(c),o=c}}return t.children};var cr=n(5598);const sr=(0,Q.Z)((e=>({container:{fontSize:"13px",display:"flex",paddingTop:"6px",position:"relative"},title:{flexGrow:1,minHeight:"15px",color:e.palette.primary.main,lineHeight:"15px"},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"},errorMessage:{fontSize:"13px",margin:"0 16px 0",lineHeight:"1.4",color:e.palette.text.secondary},linearIndicator:{top:"42px"}})));var ur=n(1242);const pr=o().createContext(null),dr=e=>{e.target.src=ur},mr=e=>{let{node:t}=e;const{entity:{uri:n},nodeId:l}=t,i=(0,b.idV)(t.entity.label),c=sr(),s=(0,a.useSelector)(y.ZP.selectors.getAbsoluteImagePath),u=(0,a.useSelector)(y.ZP.selectors.getMetadata),{uri:p}=(0,a.useSelector)(y.ZP.selectors.getEntity),[d,m]=(0,r.useState)(),g=(0,r.useContext)(pr),f=n===p,h=(0,b.nt9)(u,t.entity.type)||{},v=(0,b.VD3)(u,h,"typeGraphIcon"),x=v&&(0,b.vPL)(s,v);return o().createElement("div",{className:c.wrapper,"data-node-id":l},o().createElement("div",{ref:m,className:c.container},o().createElement(F.Avatar,{alt:"Node icon",className:M()(c.avatar),src:x||ur,onError:dr}),o().createElement(cr.Z,{isSelected:f,title:i,entityUri:n,viewId:g.id,anchorEl:d})))},gr=((0,r.memo)(mr),e=>{let{node:t}=e;return t.nodeId}),fr=(0,Q.Z)((()=>({lineBlock:{height:"100%",position:"relative",display:"inline-block"},lineChildren:{height:"100%",position:"absolute",display:"inline-block","&:after":{content:"''",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)",width:"1px",left:"50%",bottom:"0",height:`calc(100% - ${vr.rowHeight}px)`}},rootIndex:{display:"flex",alignItems:"center",color:"rgba(0,0,0,0.54)",height:"100%"},verticalLine:{width:"1px",left:"calc(50% - 1px)",top:0,height:vr.rowHeight/2+"px",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},horizontalLineRight:{height:"1px",top:vr.rowHeight/2+"px",left:"calc(50% - 1px)",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 hr(){return hr=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},hr.apply(this,arguments)}function br(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yr(){return yr=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},yr.apply(this,arguments)}const vr={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:c,treeIndex:s,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=fr();return o().createElement("div",yr({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:c,treeIndex:s})}},o().createElement("div",{"aria-label":a.expanded?"Collapse":"Expand",className:M()(g.button,a.expanded?g.expandedButton:g.collapsedButton)})),o().createElement("div",{className:g.rowTitle},"function"==typeof d?d({node:a,path:c,treeIndex:s}):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,c=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"]),s=fr(),u=a.length,p=[];a.forEach(((e,t)=>{p.push(o().createElement("div",{key:`pre_${1+t}`,style:{width:r},className:s.lineBlock},l.root&&o().createElement("div",{className:s.rootIndex},l.rootIndex,"."),t===u-1&&0!==t&&o().createElement(o().Fragment,null,o().createElement("div",{className:s.verticalLine}),o().createElement("div",{className:s.horizontalLineRight}))))}));const d=l.root?r-4:0,m=r*u-d,g={left:m,width:`calc(100% - ${m}px`},f=`${m+250}px`,h=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){br(e,t,n[t])}))}return e}({},c.style,{width:f});return o().createElement("div",hr({},c,{className:s.node,style:h}),p,o().createElement("div",{className:s.nodeContent,style:g},n))},scaffoldBlockPxWidth:16,rowHeight:28,slideRegionSize:50};function xr(){return xr=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},xr.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",xr({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"})))},wr=e=>{let{title:t,onGraphOpen:n}=e;const a=sr(),{showNavigateToGraph:l}=(0,r.useContext)(d.Y);return o().createElement(B.Z,{title:t,className:a.header},l&&o().createElement("div",{className:a.buttonsContainer},o().createElement(je.k,{className:a.button,tooltipTitle:x().text("Show Graph"),icon:Er,onClick:n,size:"L"})))},Cr=e=>gr({node: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}var Or=n(9757);const Pr=(0,Q.Z)((()=>({root:{position:"relative"},bodyWrapper:{paddingTop:"21px"}})));function Nr(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){kr(e,t,n[t])}))}return e}function kr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Zr=e=>{let{config:t,className:n}=e;const a=(0,r.useRef)(),l=(0,r.useRef)(),[c,s]=(0,r.useState)(!1),{height:u,width:p,tooltip:d}=t,{html:m,visible:g,tooltip:f,customStyles:h,popup:b}=(0,Or.E)(t),y=Pr(),v=f||d;(0,r.useEffect)((()=>{a.current&&m&&(a.current.innerHTML="",Array.from(m.childNodes).forEach((e=>{a.current.appendChild(e)})))}),[m]),(0,r.useEffect)((()=>{s(!!b)}),[b]),(0,r.useEffect)((()=>{c&&l.current&&(l.current.innerHTML="",b&&Array.from(b.childNodes).forEach((e=>{l.current.appendChild(e)})))}),[c,b]);const x=(0,i.reject)(i.isNil,{width:p,height:u});return g?o().createElement("div",{className:y.bodyWrapper},o().createElement(F.Dialog,{ref:l,open:!!b}),o().createElement(F.Tooltip,{title:v||""},o().createElement("div",{ref:a,style:Nr({},x,h),className:M()(y.root,n)}))):null};var Tr=n(14940);const Rr=(0,Q.Z)({dragHandleContainer:{position:"relative",width:"100%",height:"inherit"},dragHandleVisibilityArea:{position:"absolute",top:0,left:0,width:"100%",height:"24px",zIndex:11,"&:hover $dragHandle":{visibility:"visible"},".react-grid-item.static &:hover $dragHandle":{visibility:"hidden"}},dragHandle:{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)"}}),jr=e=>{const t=t=>{const n=Rr();return o().createElement("div",{className:n.dragHandleContainer},o().createElement("div",{className:n.dragHandleVisibilityArea},o().createElement("div",{className:M()("viewDraggableHandle",n.dragHandle)},o().createElement(Tr.Z,{className:n.dragIcon}))),o().createElement(e,t))};return t.displayName="WithDragHandle",t};var Dr=n(2256);const Ir=e=>{const t=t=>o().createElement(Dr.Z,{error:o().createElement(P.ZP,{LogoRenderer:P.B9.ERROR,text:"",secondaryText:x().text("Something went wrong"),variant:P.tC.small})},o().createElement(e,t));return t.displayName="WithErrorBoundary",t},Ar=(0,Q.Z)({stubView:{padding:"20px"},fullHeight:{height:"100%"},component:{boxSizing:"border-box",overflow:"auto",boxShadow:"none",borderRadius:"unset"}});var Mr=n(29103),Lr=n(83911),zr=n(95299),Hr=n(22385);const Ur=(0,i.pipe)((0,i.path)(["point","lat"]),(0,i.both)((0,i.gt)(90),(0,i.lt)(-90))),Vr=(0,Q.Z)((()=>({root:{height:"100%",display:"flex",flexDirection:"column"},fullHeight:{height:"100%"},fullscreenBtn:{position:"absolute",right:"5px",top:"5px",zIndex:100}})));var Fr=n(13074),Br=n(24338);const Wr=(0,Q.Z)((e=>({caption:{color:e.palette.text.secondary,fontSize:"13px"}}))),qr=Wr,Gr=e=>{let{totalImages:t}=e;const n=qr(),r=t>1?x().text("photos"):x().text("photo");return o().createElement(F.Typography,{variant:"caption",className:n.caption},`${t} ${r}`)};function _r(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){$r(e,t,n[t])}))}return e}function $r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Yr=e=>{let{config:t,attributeType:n,paging:r,requestNextPageOfAttributeValues:l}=e;const c=(0,a.useDispatch)(),s=(0,a.useSelector)(y.ZP.selectors.getEntity),u=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,s.uri)||{})),p=(0,i.pathOr)([],["attributes",n.name],u),d=t.id;return o().createElement(o().Fragment,null,o().createElement(Br.Z,{attributeValues:p,attributeType:n,onDeleteAttribute:e=>(0,i.pipe)(y.N5.actions.removeAttribute,c)(_r({},e,{viewId:d})),parentUri:u.uri,onChangeAttribute:e=>(0,i.pipe)(y.N5.actions.modifyAttribute,c)(_r({},e,{viewId:d})),imageSize:Kr,paging:r,requestNextPageOfAttributeValues:l}),o().createElement(Gr,{totalImages:p.length}))},Xr=(0,Q.Z)((e=>({container:{padding:"8px 16px"},noData:{fontSize:"13px",color:e.palette.text.secondary}}))),Qr=Xr,Kr={imageMargin:4,imageWidth:162,imageHeight:162};var Jr=n(28741),eo=n(49734),to=n(98808),no=n(93428),ro=n(30885);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=e=>{let{config:t,match:n,onStartRequest:l,onFinishRequest:i}=e;const c=(0,a.useDispatch)(),s=(0,a.useSelector)(y.ZP.selectors.getMetadata),u=(0,a.useSelector)(y.ZP.selectors.getEntity),{canMerge:p,canMark:d}=(0,b.hXd)(s,t,n.object,u,n.matchRules),g=(0,r.useMemo)((()=>[n.object]),[n.object]),f={entity:u,entities:g,mode:to.N.iconButton,onStartRequest:l},h=(0,r.useContext)(m.m),v=(0,r.useCallback)((()=>{i(),c(y.N5.entity.actions.loadEntity({viewId:h,uri:u.uri}))}),[c,u.uri,i,h]);return o().createElement(o().Fragment,null,p&&o().createElement(no.H,oo({},f,{onFinishRequest:v})),d&&o().createElement(ro.i,oo({},f,{onFinishRequest:i})))},lo=e=>{let{config:t,entitiesMap:n,match:r,onFinishRequest:l,onStartRequest:i}=e;const c=(0,a.useSelector)(y.ZP.selectors.getMetadata),s=(0,a.useSelector)(y.ZP.selectors.getEntity);return o().createElement(eo.M,{match:r,entity:s,entitiesMap:n,metadata:c,className:St.U},o().createElement(Ot.Z,{uri:(0,b.E_P)(s.uri,r.object.uri),relatedObjectUris:(0,b.wp9)(b.q7e.POTENTIAL_MATCH,{entityUri:s.uri,matchEntityUri:r.object.uri}),objectType:b.q7e.POTENTIAL_MATCH}),o().createElement(ao,{match:r,config:t,onStartRequest:i,onFinishRequest:l}))},io=(0,Q.Z)((e=>({root:{display:"flex",flexDirection:"column",minHeight:"52px"},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)"}}))),co={showTransitiveMatches:!0,showInactiveEntities:!1},so={order:b.KM9.asc,field:"score"};var uo;!function(e){e[e.Loading=0]="Loading",e[e.NoData=1]="NoData",e[e.Loaded=2]="Loaded"}(uo||(uo={}));const po=e=>(0,i.pipe)(Ir,jr)(e),mo=po((e=>{let{className:t}=e;const n=Ar();return o().createElement(U.Z,{className:M()(n.stubView,"viewDraggableHandle",t)},"NOT IMPLEMENTED")})),go=po((e=>{let{className:t,config:n}=e;return o().createElement(L.Z,{className:t,caption:n.caption,excludeUris:n.excludeUris,includeUris:n.includeUris,attributesCount:n.attributesCount,pinnedAttributes:n.pinnedAttributes})})),fo=po((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),c=(0,r.useMemo)((()=>({page:o,searchQuery:t,showInactive:l})),[o,t,l]),s=Pe(e,c),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){Ne(e,t,n[t])}))}return e}({setSearchQuery:n,searchQuery:t,setPage:a,page:o,toggleShowInactive:u,showInactive:l},s)})(n);return o().createElement(z.Provider,{value:a},o().createElement(we,{config:n,className:t}))})),ho=po((e=>{let{config:t,className:n}=e;const l=(e=>{var t;const{attributeUri:n}=e,o=(0,a.useSelector)(y.ZP.selectors.getMetadata),l=(0,r.useMemo)((()=>(0,b.zeJ)(o,n)),[o,n]),c=(0,r.useMemo)((()=>l?((e,t)=>(0,i.pipe)(((e,t)=>(0,b.WN0)(e,t)),(0,i.map)((e=>Sn(e,[t]))),(0,i.chain)(b.HQx),(0,i.uniqBy)((0,i.prop)("id")))(e,t))(o,l):[]),[o,l]),s=(0,r.useMemo)((()=>({searchQuery:"",filters:null,sorting:void 0,visibleColumns:c.filter((0,i.pipe)((0,i.prop)("dataTypeDefinition"),b.YkM,i.not)).map((e=>{let{id:t}=e;return t})).slice(0,5),page:0})),[c]),[u,p]=(0,r.useReducer)(pn,s),{searchQuery:d,filters:m,sorting:g,page:f}=u,h=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),v=(0,r.useMemo)((()=>{const e=((e,t)=>b.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,kn.su)(o,r)})))).orSome([]))(c,m);return e.length?e:null}),[m,c]),x=(0,r.useMemo)((()=>(0,i.reject)(i.isNil,{filters:v,page:f,sorting:g,searchQuery:d})),[v,f,g,d]),{changeSearchQuery:E,changePage:w,toggleSort:C,changeFilter:S,toggleFilters:O,changeColumns:P}=(0,rn.o)({actions:un,dispatch:p}),N=Pe(e,x);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){Zn(e,t,n[t])}))}return e}({},u,{setSearchQuery:E,setPage:w,onSort:C,onFilter:S,onToggleFilters:O,onChangeColumns:P,showTable:Boolean(((null==N||null===(t=N.values)||void 0===t?void 0:t.length)||v||d||h)&&l&&!l.hidden),allColumnsData:c},N)})(t);return o().createElement(nn.Provider,{value:l},t&&o().createElement(nr,{config:t,className:n}))})),bo=po((e=>{let{config:t,className:n}=e;const l=(0,a.useSelector)(y.ZP.selectors.getMetadata),c=(0,r.useMemo)((()=>(0,b.fS6)(l,t)),[l,t]),s=(e=>{var t;const n=(0,r.useMemo)((()=>(0,i.pipe)(Object.entries,(0,i.map)((e=>{let[t,n]=e;return{value:t,label:n}})),(0,i.unless)((e=>(0,b.O27)(e)||e.some((0,i.propEq)("value","name"))),(0,i.append)({label:x().text("Name"),value:"name"})))(e.sortOptions||{})),[e.sortOptions]),o=Number(e.max)||15,[a,l]=(0,r.useState)(0),[c,s]=(0,r.useState)(e.sortOrder||"asc"),[u,p]=(0,r.useState)(null===(t=n[0])||void 0===t?void 0:t.value),[d,m]=(0,r.useState)(""),[g,f]=(0,r.useState)(!1),h=(0,r.useCallback)((()=>{l(0),f((e=>!e))}),[]),y=(0,r.useCallback)((()=>{l(0),s((e=>"asc"===e?"desc":"asc"))}),[]),v=(0,r.useCallback)((e=>{l(0),p(e)}),[]);return{searchQuery:d,changeSearchQuery:(0,r.useCallback)((e=>{l(0),m(e)}),[]),sortOrder:c,toggleSortOrder:y,sortOption:u,changeSortOption:v,sortOptions:n,page:a,setPage:l,rowsPerPage:o,showInactive:g,toggleShowInactive:h}})(c);return o().createElement(Ae.Provider,{value:s},o().createElement(tn,{config:c,className:n}))})),yo=po(Zr),vo=po((e=>{let{config:t,className:n}=e;const{id:l,caption:c,graph:u,_showNavigateToGraph:p}=t,m=null==u?void 0:u.type,g=sr(),f=(0,a.useDispatch)(),h=(0,a.useSelector)(y.ZP.selectors.getEntityUri),{treeData:v,setTreeData:E,errorMessage:w,isLoading:C}=((e,t)=>{const n=(0,Ce._)(),[o,l]=(0,r.useState)(!1),[c,s]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),d=(0,a.useSelector)(y.ZP.selectors.getEntity);return(0,Se.D)((()=>{const e=c.map(((e,t)=>({tree:e,index:t}))).reduce(((e,t)=>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){or(e,t,n[t])}))}return e}({},e,{[t.index]:{root:t.tree}})),{}),t=(0,b.XTh)((0,i.pick)(["uri","label","secondaryLabel","type"],d),e);s(t.map((0,i.prop)("root")))}),[null==d?void 0:d.updatedTime]),(0,r.useEffect)((()=>((0,b.ZiX)(e)||(p(null),l(!0),n((0,b.RFJ)({uri:e,graphUri:t})).then(ir).then(s).catch((e=>{console.warn(e),p((0,b.xU7)(e,x().text("Something went wrong")))})).finally((()=>{l(!1)}))),()=>{s([])})),[e,t,n]),{isLoading:o,treeData:c,setTreeData:s,errorMessage:u}})(h,m),{onResize:S,getRowHeight:O,clearHeightsCache:P}=(()=>{const[e,t]=(0,r.useState)({}),n=(0,r.useCallback)((()=>{t({})}),[]);return{onResize:(0,r.useCallback)((e=>(n,r)=>{t((t=>t[Cr(e)]!==r?(0,i.assoc)(Cr(e),r,t):t))}),[]),getRowHeight:(0,r.useCallback)((t=>{let{node:n}=t;return e[Cr(n)]?Math.max(e[Cr(n)],vr.rowHeight):vr.rowHeight}),[e]),clearHeightsCache:n}})(),N=(0,r.useContext)(d.Y),k=void 0!==p?p:N.showNavigateToGraph,Z=(0,r.useMemo)((()=>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){Sr(e,t,n[t])}))}return e}({},N,{showNavigateToGraph:k})),[k,N]),T=(0,r.useCallback)((()=>{f(y.ui.actions.openGraph({viewId:l,graphType:m,entityUri:h}))}),[f,l,m,h]),R=(0,r.useCallback)((e=>({title:o().createElement(s.Z,{handleHeight:!0,refreshMode:"debounce",refreshRate:100,onResize:S(e.node)},o().createElement(mr,{node:e.node}))})),[S]);return(0,r.useEffect)((()=>{P()}),[P,h]),o().createElement(d.Y.Provider,{value:Z},o().createElement(U.Z,{className:n},o().createElement(wr,{onGraphOpen:T,title:c}),C&&o().createElement(j.Z,{className:g.linearIndicator}),o().createElement(pr.Provider,{value:t},o().createElement("div",{className:g.treeContainer},o().createElement("div",{className:g.tree},w?o().createElement(F.Typography,{className:g.errorMessage},w):o().createElement(rr.ZP,{isVirtualized:!1,treeData:v,canDrag:!1,theme:vr,generateNodeProps:R,onChange:E,getNodeKey:gr,rowHeight:O}))))))})),xo=po((e=>{let{config:t,className:n}=e;const l=io(),c=(0,a.useSelector)(y.ZP.selectors.getEntity),s=(0,b.wwR)(c),[u,p]=(0,r.useState)(!1),d=(0,r.useCallback)((()=>{p(!0)}),[]),g=(0,r.useCallback)((()=>{p(!1)}),[]),{matches:f,entitiesMap:h,loadMatches:v}=(0,Jr.s)({enabled:!!s,entity:c,options:co,filter:"",page:0,sorting:so,rowsPerPage:3,onStartLoading:d,onFinishLoading:g}),E=(0,r.useCallback)((()=>{v()}),[v]),w=(0,a.useDispatch)(),S=(0,r.useContext)(m.m),O=(0,r.useCallback)((()=>{w(y.ui.actions.openPerspective({perspectiveId:"potentialMatches",viewId:S}))}),[w,S]),P=(0,r.useMemo)((()=>(0,b.NVY)(s,(0,i.map)(b.ev7,f))),[s,f]),{getCommentsCount:N}=(0,r.useContext)(C.h);(0,r.useEffect)((()=>{N(P)}),[N,P]);const k=!(0,i.isEmpty)(f),Z=u?uo.Loading:(0,i.isEmpty)(f)?uo.NoData:uo.Loaded;return o().createElement(Te.X.Provider,{value:h},o().createElement(U.Z,{className:M()(l.root,n)},o().createElement(B.Z,{title:t.caption}),o().createElement("div",{className:l.matchesContainer},Z===uo.Loading&&o().createElement(j.Z,null),Z===uo.NoData&&o().createElement(F.Typography,{className:l.noData},x().text("No matches found")),Z===uo.Loaded&&f.map((e=>o().createElement(lo,{config:t,entitiesMap:h,match:e,onFinishRequest:E,onStartRequest:d,key:e.object.uri})))),k&&o().createElement(o().Fragment,null,o().createElement("div",{className:l.footer},o().createElement(F.Link,{component:"button",variant:"caption",onClick:O,underline:"none"},x().text("See all"))))))})),Eo=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,91032)).then((e=>({default:po(e.HierarchyTreeView)}))))),wo=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,79417)).then((e=>({default:po(e.RelationshipsTableView)}))))),Co=po((e=>{let{config:t,isFullscreen:n,onToggleFullscreen:l,className:i}=e;const c=Vr(),s=(0,a.useSelector)(y.ZP.selectors.getMetadata),u=(0,a.useSelector)(y.ZP.selectors.getEntity),p=(0,a.useSelector)(y.ZP.selectors.getGoogleMapKey),{markers:d,loading:m}=((e,t,n)=>{const[o,a]=(0,r.useState)([]),[l,i]=(0,r.useState)(!0),c=(0,Ce._)();return(0,r.useEffect)((()=>{i(!0),c((0,b.DBr)(t,[e],n)).then((e=>{a(e.filter(Ur))})).catch((()=>{a([])})).finally((()=>{i(!1)}))}),[e,t,n,c]),{markers:o,loading:l}})(u,s,p),g=(0,r.useMemo)((()=>o().createElement("div",{className:c.fullHeight},o().createElement(j.Z,null))),[c]),f=(0,r.useMemo)((()=>({lat:0,lng:0})),[]),h=(0,r.useMemo)((()=>({mapTypeControl:!0})),[]);return p&&o().createElement(U.Z,{className:M()(c.root,i)},m&&o().createElement(j.Z,null),o().createElement(Hr.Z,{size:"S",icon:n?Lr.Z:Mr.Z,onClick:()=>l(t.id),className:c.fullscreenBtn}),o().createElement(zr.Z,{loadingElement:g,defaultZoom:1,defaultCenter:f,markers:d,mapContainerClassName:c.fullHeight,mapKey:p,mapOptions:h}))})),So=po((e=>{let{config:t,className:n}=e;const{attributeUri:l}=t,c=Qr(),s=(0,a.useDispatch)(),u=(0,a.useSelector)(y.ZP.selectors.getMode),p=(0,a.useSelector)(y.ZP.selectors.getEntityWithDiff),d=(0,a.useSelector)(y.ZP.selectors.getMetadata),m=l?(0,b.zeJ)(d,l):null,g=t["text-empty"]||x().text("No data found"),f=(0,r.useCallback)((e=>s(y.N5.actions.requestNextPageOfAttributeValues(e))),[s]);return o().createElement(U.Z,{className:n},o().createElement(B.Z,{title:t.caption},o().createElement(q.Z,{description:null==m?void 0:m.description})),o().createElement("div",{className:c.container},(()=>{if(m){const e=(0,i.pathOr)([],["attributes",m.name],p),n=(0,i.path)(["attributes","paging",l],p),r=e.length;if((0,b.KIu)(u)){const e={attributeType:m,config:t,paging:n,requestNextPageOfAttributeValues:f};return o().createElement(Yr,e)}if(r>0){const t={attributeValues:e,attributeType:m,imageSize:Kr,paging:n,parentUri:p.uri,requestNextPageOfAttributeValues:f};return o().createElement(o().Fragment,null,o().createElement(Fr.Z,t),o().createElement(Gr,{totalImages:r}))}}return o().createElement(F.Typography,{className:c.noData},g)})()))}));class Oo{}Oo.ViewTypes=b.ZIY,Oo.getComponentBy=(e,t)=>{let{store:n,config:r,className:a,isFullscreen:l,onToggleFullscreen:i}=t;switch(r[e]){case Oo.ViewTypes.HierarchyTree:return o().createElement(Eo,{config:r,store:n,className:a});case Oo.ViewTypes.HierarchyPaths:return o().createElement(vo,{config:r,className:a});case Oo.ViewTypes.RelationsTable:return o().createElement(wo,{config:r,store:n,className:a});case Oo.ViewTypes.Relations:return o().createElement(bo,{config:r,className:a});case Oo.ViewTypes.Attributes:return o().createElement(go,{className:a,config:r});case Oo.ViewTypes.SingleAttribute:return o().createElement(fo,{config:r,className:a});case Oo.ViewTypes.AttributeTable:return o().createElement(ho,{config:r,className:a});case Oo.ViewTypes.Map:return o().createElement(Co,{config:r,isFullscreen:l,onToggleFullscreen:i,className:a});case Oo.ViewTypes.Custom:return o().createElement(yo,{config:r,className:a});case Oo.ViewTypes.ImageAttribute:return o().createElement(So,{config:r,className:a});case Oo.ViewTypes.PotentialMatches:return o().createElement(xo,{config:r,className:a})}},Oo.getComponent=e=>Oo.getComponentBy("class",e)||Oo.getComponentBy("react-class",e)||o().createElement(mo,{className:e.className});const Po=Oo,No=()=>null,ko=(0,r.memo)((e=>{let{config:t,store:n,isFullscreen:a,isAutosize:l,onToggleFullscreen:i}=e;const c=Ar();return o().createElement(r.Suspense,{fallback:o().createElement(No,null)},Po.getComponent({config:t,store:n,className:M()(c.component,{[c.fullHeight]:!l}),isFullscreen:a,onToggleFullscreen:i}))}));ko.displayName="ViewComponent";const Zo=(0,Q.Z)((e=>({item:e.basicView,fixedSizeContainer:{height:"100%"}})));function To(){return To=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},To.apply(this,arguments)}const Ro=["onConfigChanged","onRemove"],jo=e=>{var t;let{layoutItemConfig:n,views:l,className:c,children:s,style:u,isFullscreen:p,onToggleFullscreen:d,AutosizeComponent:m}=e,g=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 f=l.find((e=>{let{id:t}=e;return n.i===t})),h=Zo(),v=(0,a.useSelector)(y.ZP.selectors.getGoogleMapKey),{store:x}=(0,r.useContext)(a.ReactReduxContext);if(!f)return null;const E=f.class===Po.ViewTypes.Custom;if(E&&(null==f||null===(t=f.action)||void 0===t?void 0:t.platform)===b.X1H.CLASSIC)return null;if(f.class===Po.ViewTypes.Map&&!v)return null;const w=(e=>{var t;return null===(t=Object.entries(b.ZIY).find((t=>{let[n,r]=t;return e===r})))||void 0===t?void 0:t[0]})(f.class);return o().createElement("div",To({},(0,i.omit)(Ro,g),{"data-reltio-id":f.id,"data-reltio-class":w||"",style:u,className:M()(c,{[h.item]:!E})}),o().createElement("div",{className:M()({[h.fixedSizeContainer]:!m})},m,o().createElement(ko,{store:x,config:f,isFullscreen:p,onToggleFullscreen:d,isAutosize:Boolean(m)})),s)},Do=(0,Q.Z)({scrollWrapper:{flexGrow:1,overflow:"auto"},scrollableContent:e=>{let{maxWidth:t,scrollbarWidth:n}=e;return{minWidth:t&&t<1024?t-n:1024,height:"100%"}}}),Io=e=>{let{views:t,layout:n,entityUri:a,maxWidth:l,onLayoutChanged:i}=e;const c=(0,r.useRef)(),s=(u=c.current)?u.offsetWidth-u.clientWidth:0;var u;const p=c.current,d=Do({maxWidth:l,scrollbarWidth:s}),m=(0,r.useMemo)((()=>({element:p,priority:["left","right","top","bottom"]})),[p]);return(0,r.useEffect)((()=>{c.current&&(c.current.scrollTop=0)}),[a]),o().createElement("div",{ref:c,className:d.scrollWrapper},o().createElement("div",{className:d.scrollableContent,"data-reltio-id":"reltio-profile-grid"},o().createElement(D.p.Provider,{value:m},o().createElement(I.Z,{LayoutItem:jo,views:t,layout:n,onLayoutChanged:i,draggableHandle:".viewDraggableHandle"}))))};var Ao=n(87685);const Mo=(0,Q.Z)((()=>({closeIcon:{paddingRight:"12px",boxSizing:"content-box","& path":{fill:"#fff"}},snackbar:{"& > div":{flexWrap:"nowrap",alignItems:"baseline"}}}))),Lo=e=>{let{notification:t}=e;const n=Mo({}),l=(0,a.useDispatch)(),i=(0,a.useSelector)(y.ZP.selectors.getAutoCloseInterval),c=t.autoHideDuration||i&&1e3*i||5e3,[s,u]=(0,r.useState)(),[p,d]=(0,r.useState)(!0),m=(0,r.useCallback)(((e,n)=>{"clickaway"!==n&&(l(y.ui.actions.closeNotification(t.id)),d(!1))}),[t]),g=(0,r.useCallback)((()=>{s.cancelAction&&l(s.cancelAction),u(void 0)}),[s]),f=(0,r.useCallback)((()=>{l(s.applyAction),u(void 0),l(y.ui.actions.closeNotification(t.id))}),[s,t]),h=o().createElement(o().Fragment,null,t.actions.map((e=>o().createElement(F.Button,{key:e.label,color:"primary",size:"small",onClick:()=>{e.needConfirmation?u(e):l(e.applyAction),d(!1)}},e.label)))),b=o().createElement(o().Fragment,null,o().createElement(Hr.Z,{className:n.closeIcon,size:"S",icon:Ao.default,onClick:m}),t.text);return o().createElement(o().Fragment,null,o().createElement(F.Portal,{container:document.body},o().createElement(F.Snackbar,{autoHideDuration:c,open:p,classes:{root:n.snackbar},action:h,onClose:m,anchorOrigin:{vertical:"bottom",horizontal:"center"},message:b})),o().createElement(_e.Z,{open:!!s,title:null==s?void 0:s.confirmationText,content:null==s?void 0:s.confirmationDescription,onSave:f,onDiscard:g,saveCaption:x().text("Proceed"),discardCaption:x().text("Cancel")}))},zo=()=>{const e=(0,a.useSelector)(y.ZP.selectors.getNotifications);return e?o().createElement(o().Fragment,null,e.slice(-1).map((e=>o().createElement(Lo,{key:e.id,notification:e})))):null};var Ho=n(72753),Uo=n(43576),Vo=n(64459),Fo=n(3409),Bo=n(79618),Wo=n(22860);function qo(){return qo=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},qo.apply(this,arguments)}const Go=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",qo({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"}))))};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)}const $o=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",_o({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),o().createElement("defs",null,o().createElement("path",{d:"M20.222 6C21.21 6 22 6.8 22 7.778v12.444C22 21.2 21.209 22 20.222 22H7.778C6.79 22 6 21.2 6 20.222V7.778C6 6.8 6.791 6 7.778 6h12.444zM20 8H8v12h12V8zM4 18H2V4c0-1.1.9-2 2-2h14v2H4v14z",id:"svg2383396984a"})),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},o().createElement("mask",{id:"svg2383396984b",fill:"#fff"},o().createElement("use",{xlinkHref:"#svg2383396984a"})),o().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2383396984b)",d:"M0 0h24v24H0z"})))},Yo=(0,Q.Z)({editingButtons:{display:"flex","& button + button":{minWidth:"88px",marginLeft:"8px"}},searchResults:{width:"150px",height:"25px",backgroundColor:"#ccc"},comments:{display:"flex",justifyContent:"flex-end",marginTop:"10px"}});function Xo(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){Qo(e,t,n[t])}))}return e}function Qo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ko=e=>o().createElement(F.SvgIcon,e,o().createElement(Go,null)),Jo=e=>o().createElement(F.SvgIcon,e,o().createElement($o,null)),ea=(e,t,n,r,o)=>e.filter((e=>{let{value:a,permission:l}=e;return!(n&&!(0,b.KIu)(a))&&!!(r&&o||!(0,b.fnZ)(a))&&(0,b.uGe)(l,t)})),ta=e=>{let{className:t,profileBandConfig:n}=e;const l=Yo(),c=(0,a.useDispatch)(),s=(0,a.useSelector)(y.ZP.selectors.getCanUserStartProcessFromQuery),u=(0,a.useSelector)(y.ZP.selectors.getEntityWithoutDiff),p=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,u.uri))),d=(0,a.useSelector)(y.ZP.selectors.getMetadata),m=(0,a.useSelector)(y.ZP.selectors.isWorkflowEnabled),g=(0,a.useSelector)(y.ZP.selectors.getMode),f=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),h=(0,a.useSelector)(y.ZP.selectors.getIsViewMode),v=(0,a.useSelector)(y.ZP.selectors.getIsHistoryModeEnabled),E=(0,a.useSelector)(y.ZP.selectors.getProfileOperation),w=null==u?void 0:u.type,C=(0,r.useMemo)((()=>(0,b.nt9)(d,w)),[w,d]),S=E===b.OXy.Saving,O=E===b.OXy.Cloning||S,[P,N]=(0,r.useState)(!1),k=(0,r.useCallback)((()=>{N(!1)}),[]),Z=(e=>{let{cloneAction:t,onCloneDiscard:n}=e;const o=(0,a.useSelector)(y.ZP.selectors.getEntityWithoutDiff),l=(0,a.useSelector)(y.ZP.selectors.getMetadata),c=(0,a.useDispatch)(),s=null==o?void 0:o.type,u=l.relationTypes,p=(0,r.useCallback)((0,b.Ian)(l,s),[l,s]),d=(0,b.nt9)(l,s),m=(0,r.useMemo)((()=>(0,i.when)((0,i.complement)(i.isNil),(0,i.pipe)((0,i.find)((0,i.pipe)((0,i.propOr)([],"entityTypeUris"),(0,i.either)((0,i.includes)(s),(0,i.includes)("*")))),(0,i.when)((0,i.complement)(i.isNil),(0,i.omit)(["entityTypeUris"]))))(t)),[t,s]),g=(0,r.useCallback)((()=>{if(m){const e=(0,i.pipe)((0,i.prop)("relationshipTypesToCopy"),(0,i.cond)([[i.isNil,(0,i.pipe)((0,i.always)(d),(0,i.propOr)([],"attributes"),(0,i.filter)(b.YkG),(0,i.map)(b.ZaZ))],[(0,i.includes)("*"),(0,i.pipe)((0,i.always)(u||[]),(0,i.map)((0,i.prop)("uri")),(0,i.filter)(p))],[i.T,i.identity]]))(m);c(y.N5.entity.actions.entityCloneRequested({data:Xo({},(0,i.pick)(["attributeReplacementMapping"],m),{relationshipTypesToCopy:e}),entityUri:o.uri}))}n()}),[m,n,d,u,o.uri,p]);return m?g:void 0})({cloneAction:null==n?void 0:n.cloneAction,onCloneDiscard:k}),T=(0,r.useMemo)((()=>[{label:x().text("Editing"),value:b.fO_.EDITING,description:x().text("Edit profile directly"),icon:Uo.Z,permission:"UPDATE"},{label:x().text("Suggesting"),value:b.fO_.SUGGESTING,description:x().text("Suggest changes and initiate a workflow review"),icon:Ko,permission:"INITIATE_CHANGE_REQUEST"},{label:x().text("Viewing"),value:b.fO_.VIEWING,description:x().text("Read or print profile"),icon:Ho.Z,permission:"READ"}]),[]),R=(0,r.useMemo)((()=>[...Z?[{label:x().text("Clone"),value:"Clone",description:x().text("Create a copy of the profile"),icon:Jo,onClick:()=>N(!0),permission:"CREATE"}]:[],{label:x().text("Delete"),value:"Delete",description:x().text("Permanently delete profile"),icon:Je.Z,onClick:()=>{window.confirm(x().text("Are you sure you want to delete this?"))&&c(y.N5.entity.actions.entityRemoveRequested({entityUri:u.uri}))},permission:"DELETE"}]),[c,u.uri,Z]),j=!v&&!(0,b.biM)(u)&&!(e=>(0,b.uGe)(b.BDP.READ,e)&&!(0,b.uGe)(b.BDP.UPDATE,e)&&!(0,b.uGe)(b.BDP.DELETE,e)&&!(0,b.uGe)(b.BDP.INITIATE_CHANGE_REQUEST,e))(C),D=(0,b.ZiX)(null==u?void 0:u.uri),I=(0,r.useMemo)((()=>ea(T,C,D,m,s)),[T,C,m,s,D]),A=(0,r.useMemo)((()=>ea(R,C,D,m,s)),[R,C,m,s,D]),L=(0,r.useCallback)((e=>{c(y.N5.mode.actions.modeUpdated(e))}),[c]),z=(0,r.useCallback)((()=>{c(y.N5.mode.actions.modeCancelEditing())}),[c]),H=(0,r.useCallback)((()=>{c(y.N5.actions.saveProfile())}),[c]);return o().createElement(o().Fragment,null,o().createElement(Vo.Z,{className:M()(t,St.U),entity:f&&p?p:u},o().createElement(F.Box,{display:"flex",alignItems:"center"},o().createElement(F.Box,{mr:3},f&&o().createElement(F.Box,{className:l.editingButtons},o().createElement(F.Button,{variant:"outlined",onClick:z,"data-reltio-id":"reltio-profile-cancel-editing",disabled:O},x().text("Cancel")),o().createElement(F.Button,{variant:"contained",color:"primary","data-reltio-id":"reltio-profile-save-profile",onClick:H,disabled:O},(0,b.fnZ)(g)?x().text("Suggest"):x().text("Save"))),v&&h?o().createElement(Fo.Z,null):h&&o().createElement(Bo.a,null)),j&&o().createElement(Wo.T,{optionsGroup:I,buttonsGroup:A,value:g,onChange:L,disabled:O})),o().createElement(F.Box,{className:l.comments},o().createElement(Ot.Z,{uri:u.uri,relatedObjectUris:(0,b.wp9)(b.q7e.ENTITY,{entityUri:u.uri}),objectType:b.q7e.ENTITY}))),!!Z&&o().createElement(_e.Z,{open:P,title:x().text("Do you want to create a clone of the profile?"),content:x().text("Cloning will create a copy of the current profile. You can modify the cloned profile in the next step. Are you sure you want to proceed?"),onSave:Z,onDiscard:k,saveCaption:x().text("Proceed"),discardCaption:x().text("Cancel")}))};var na=n(97499),ra=n(52043),oa=n(17308);const aa=(0,Q.Z)({wrapper:{display:"flex",overflow:"hidden",flexShrink:0,marginLeft:"3px",height:"100%"},badge:{fontSize:"12px",height:"18px",minWidth:"18px",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px"}});function la(){return la=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},la.apply(this,arguments)}let ia;!function(e){e[e.Workflow=0]="Workflow",e[e.Collaboration=1]="Collaboration",e[e.History=2]="History",e[e.DBConnector=3]="DBConnector"}(ia||(ia={}));const ca=e=>{let{active:t,tabs:n,onClose:a}=e;const l=aa(),c=!(0,i.isNil)(t),{content:s,headerProps:u,hidden:p}=n[t]||{};return(0,r.useEffect)((()=>{p&&a()}),[t,p,a]),o().createElement("div",{className:l.wrapper},o().createElement(ra.h,{open:c},!p&&o().createElement(o().Fragment,null,o().createElement(oa.P,la({},u,{onClose:a})),s)))};var sa=n(71820),ua=n(44021),pa=n(26789),da=n(54362),ma=n(6674),ga=n(91515),fa=n(80147);const ha=(0,Q.Z)({wrapper:{display:"flex",flexDirection:"column"},itemWrapper:{paddingLeft:"19px",paddingRight:"19px"}}),ba=()=>{const e=ha(),t=(0,a.useSelector)(y.ZP.selectors.getDBConnectorSideViews);return o().createElement("div",{className:e.wrapper},t.map((t=>o().createElement(Zr,{key:t.id,config:t,className:e.itemWrapper}))))};var ya=n(76569);const va=()=>{const{total:e}=(0,r.useContext)(k.O),t=aa();return o().createElement(F.Badge,{badgeContent:e,classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(ya.Z,null))};function xa(){return xa=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},xa.apply(this,arguments)}const Ea=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",xa({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"})))))},wa=()=>{const{commentsMap:e}=(0,r.useContext)(C.h),t=aa();return o().createElement(F.Badge,{badgeContent:(0,b.mdt)(e),classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(Ea,null))};function Ca(){return Ca=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},Ca.apply(this,arguments)}const Sa=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",Ca({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),o().createElement("path",{d:"M14.101 16A5.003 5.003 0 0016 18.987V20H2v-4h12.101zM22 18.987V20v-1.013zM4 17v2h2v-2H4zM16 4v1.013A5.004 5.004 0 0014.101 8H2V4h14zm6 0v1.013V4zM6 7V5H4v2h2zm8 3v4H2v-4h12zM4 11v2h2v-2H4zm12 4v-2h6v2c0 1.3-.84 2.4-2 2.82V22h-2v-4.18c-1.16-.42-2-1.52-2-2.82zm0-6c0-1.3.84-2.4 2-2.82V2h2v4.18c1.16.42 2 1.52 2 2.82v2h-6V9z",fill:"#000",fillOpacity:".54"}))};var Oa=n(46626);const Pa=(0,Q.Z)({wrapper:{overflow:"auto",position:"relative",height:"100%"}}),Na=()=>{const e=Pa(),{tasks:t,loading:n}=(0,r.useContext)(k.O);return o().createElement("div",{className:e.wrapper},n&&o().createElement(j.Z,null),t&&t.map((e=>o().createElement(Oa.s,{key:e.taskId,task:e}))))};var ka=n(10159);const Za=()=>o().createElement(ka.Z,{text:x().text("Ready to go with the flow?"),secondaryText:x().text("Suggest a change or submit a match review, and we’ll kick off a workflow task to get things going.")});var Ta=n(26313),Ra=n(9371),ja=n(4426);const Da=(0,Q.Z)({wrapper:{overflow:"auto",paddingRight:"12px"},showMoreLink:{display:"flex",margin:"16px"},showMoreIcon:{fontSize:"1rem"}}),Ia=()=>{const e=Da(),{getComments:t,comments:n,pageToken:l}=(0,r.useContext)(C.h),i=(0,a.useSelector)(y.ZP.selectors.getEntityUriWithDataTenant);(0,r.useEffect)((()=>{t(i)}),[t,i]);const c=(0,Ta.Q)(n);return o().createElement(Te.X.Provider,{value:c},o().createElement(F.Box,{className:e.wrapper},n.map((e=>{const{objectId:t,relatedObjectUris:n,objectType:r,commentId:a}=e;return o().createElement(Ra.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(ja.Z,{className:e.showMoreIcon}),x().text("Show more"))))},Aa=()=>o().createElement(ka.Z,{text:x().text("Care to join the conversation?"),secondaryText:x().text("Leave comments for team members anywhere in the Profile page, and we’ll record it here.")}),Ma=e=>{if(e)return 1===e?x().text("${total} item",{total:e}):x().text("${total} items",{total:e})},La=(0,Q.Z)((()=>({profileContainer:{display:"flex",overflow:"hidden",flexGrow:1}}))),za=(0,r.memo)((e=>{let{perspectiveId:t,commentId:n,hideHistory:l,children:c}=e;const s=La(),{defaultTab:u,tabs:p}=(e=>{let{commentId:t,hideHistory:n,perspectiveId:l}=e;const i=(0,a.useSelector)(y.ZP.selectors.isWorkflowSideViewEnabled),c=(0,a.useSelector)(y.ZP.selectors.isWorkflowEnabled),s=(0,a.useSelector)(y.ZP.selectors.isCollaborationSideViewEnabled),u=(0,a.useSelector)(y.ZP.selectors.isDBConnectorSideViewEnabled),p=(0,a.useSelector)(y.ZP.selectors.isCollaborationEnabled),d=t?ia.Collaboration:void 0,m=(0,a.useSelector)(y.ZP.selectors.getHistoryEvent),g=(0,a.useSelector)(y.ZP.selectors.getMetadata),f=(0,a.useSelector)(y.ZP.selectors.getEntity),h=(0,r.useContext)(k.O),v=(0,r.useContext)(C.h),{isHistoryEnabled:E,isProfilePersisted:w}=(0,sa.C)({perspectiveId:l,entity:f,historyButtonId:ia.History}),{historyFilter:S,onApplyFilter:O,isLoading:P,historicUris:N,historyWithTotal:Z,canLoadMore:T,onLoadMore:R}=(0,ua.k6)({entity:f,enabled:E}),j=i&&c&&!(0,b.ZiX)(null==f?void 0:f.uri),D=s&&p,I=(0,b.mdt)(null==v?void 0:v.commentsMap);return{tabs:(0,r.useMemo)((()=>[{buttonProps:{id:ia.Workflow,icon:va,tooltipTitle:x().text("Workflow")},content:null!=h&&h.total?o().createElement(Na,null):o().createElement(Za,null),headerProps:{mainTitle:x().text("Workflow"),secondTitle:Ma(null==h?void 0:h.total),rightContent:o().createElement(pa.G,null)},hidden:!j},{buttonProps:{id:ia.Collaboration,icon:wa,tooltipTitle:x().text("Collaboration")},content:I?o().createElement(Ia,null):o().createElement(Aa,null),headerProps:{mainTitle:x().text("Collaboration"),secondTitle:Ma(I)},hidden:!D},{buttonProps:{id:ia.History,icon:fa.Z,tooltipTitle:x().text("History")},content:w?o().createElement(da.Z,{isLoading:P,historyWithTotal:Z,contributorsUris:N,entityUri:null==f?void 0:f.uri,historyEvent:m,onLoadMore:R,canLoadMore:T}):o().createElement(ma.Z,null),headerProps:{content:o().createElement(ga.Z,{total:w?((null==N?void 0:N.length)||0)+1:void 0,entityType:(0,b.nt9)(g,null==f?void 0:f.type),filter:S,onApplyFilter:O})},hidden:n},{buttonProps:{id:ia.DBConnector,icon:Sa,tooltipTitle:x().text("D&B Connector")},content:o().createElement(ba,null),headerProps:{mainTitle:x().text("D&B Connector")},hidden:!u}]),[null==h?void 0:h.total,j,I,D,w,P,Z,N,null==f?void 0:f.uri,null==f?void 0:f.type,m,R,T,g,S,O,u]),defaultTab:d}})({commentId:n,hideHistory:l,perspectiveId:t});return o().createElement("div",{className:s.profileContainer},o().createElement(na.n,{defaultTab:u,perspectiveId:t,buttonsProps:(0,i.pipe)((0,i.reject)((0,i.propEq)("hidden",!0)),(0,i.pluck)("buttonProps"))(p)},c,o().createElement(ca,{tabs:p})))}));za.displayName="ProfilePerspectiveView";var Ha=n(39781),Ua=n(16715);const Va="48px",Fa="1px solid rgba(0, 0, 0, .125)",Ba=(0,Q.Z)((e=>({accordion:{borderTop:Fa,borderBottom:Fa,fontSize:"13px",boxShadow:"none","&:not(:first-child)":{borderTop:0},"&:before":{display:"none"},"&$accordionExpanded":{margin:"auto"}},accordionExpanded:{},accordionSummary:{display:"flex",alignItems:"center",height:Va,minHeight:Va,"&$accordionSummaryExpanded":{height:Va,minHeight:Va}},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},errorWrapper:{lineHeight:"18px",display:"flex",flexDirection:"column"},errorTitle:{display:"flex",alignItems:"center"},attributeTypesPath:{color:e.palette.text.secondary},goToIcon:{marginLeft:"4px"},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"}}))),Wa=Ba;var qa=n(38016);const Ga=(0,r.memo)((e=>{let{panels:t,expandedPanelId:n,onToggle:r,ErrorComponent:a}=e;const l=Wa();return t.length>0?o().createElement("div",null,t.map((e=>{let{id:t,icon:i,title:c,items:s,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(qa.Z,null)},i,o().createElement(F.Typography,{className:l.accordionSummaryHeading},c)),o().createElement(F.AccordionDetails,{className:M()(l.accordionDetails,p)},o().createElement("ul",null,s.map(((e,t)=>o().createElement(a,{key:t,error:e}))))))}))):null}));function _a(){return _a=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},_a.apply(this,arguments)}Ga.displayName="ErrorsPanel";const $a=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",_a({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),o().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.245 12.75c0 .825-.467 1.5-1.045 1.5H4.8c-.583 0-1.05-.675-1.05-1.5v-7.5c0-.832.467-1.5 1.05-1.5h8.4c.578 0 1.05.668 1.05 1.5l-.005 7.5zM9.75 9.96v1.642l3-2.805L9.75 6v1.598c-2.918.404-4.08 2.4-4.5 4.402 1.043-1.402 2.415-2.04 4.5-2.04z",fill:"#000",fillOpacity:".54"}))},Ya=(0,i.omit)(["deactivated","path"]),Xa=(0,r.memo)((e=>{let{error:t}=e;const n=Wa(),l=(0,a.useSelector)(y.ZP.selectors.getMetadata),c=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),s=((e,t)=>{let{type:n,source:r,message:o,attributeTypeUri:a="",attributeType:l}=t;if(n===b.NIO.missed&&r===b.zHr.local){const t=l||(0,b.zeJ)(e,a);return t?x().text("${attribute} is required",{attribute:t.label}):o}return o})(l,t),u=(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[b.HAc.attributeValue,b.HAc.relationConnection].includes(t)})).map((e=>{let{label:t}=e;return t})).filter(i.identity).join(" / ")})(t),p=(e=>{let{path:t}=e;return null==t?void 0:t.filter((e=>{let{type:t}=e;return t===b.HAc.attributeValue})).map((0,i.either)((0,i.path)(["valueType","label"]),(0,i.path)(["valueType","name"]))).filter(i.identity).join(" > ")})(t),{highlightError:d}=(0,r.useContext)(R.NY),m=t.uri||t.parentUri&&t.attributeTypeUri;return o().createElement("li",null,o().createElement("div",{className:n.errorWrapper},p&&o().createElement("span",{className:n.attributeTypesPath},p),o().createElement("span",{className:n.errorTitle},s,m&&c&&o().createElement(je.k,{icon:$a,size:"XXS",onClick:()=>d(t),tooltipTitle:x().text("Go to error"),className:n.goToIcon})),u&&o().createElement("span",{className:n.parents},u)))}));Xa.displayName="Error";const Qa=()=>{const e=Wa(),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(Ya),t.map(Ya))}(e,t.current)||(t.current=e),t.current})((0,a.useSelector)(y.ZP.selectors.getProfileErrors)),[n,l]=(0,r.useMemo)((()=>(0,i.partition)(b.IT0,t)),[t]),[c,s]=(0,r.useState)(null),u=(0,r.useMemo)((()=>[{id:"errors",title:x().text("${number} ${errors}",{number:n.length,errors:1===n.length?x().text("error"):x().text("errors")}),icon:o().createElement(Ha.Z,{className:M()(e.icon,e.errorIcon)}),items:n,accordionClassName:e.errorsAccordion,accordionDetailsClassName:e.errorsAccordionDetails},{id:"warnings",title:x().text("${number} ${warnings}",{number:l.length,warnings:1===l.length?x().text("warning"):x().text("warnings")}),icon:o().createElement(Ua.Z,{className:M()(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)((()=>{s("errors")}),[n]);const p=(0,r.useCallback)((e=>(t,n)=>{s(n?e:null)}),[]);return u.length>0?o().createElement(Ga,{panels:u,expandedPanelId:c,onToggle:p,ErrorComponent:Xa}):null};var Ka=n(3096),Ja=n.n(Ka),el=n(60641);function tl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const nl={};var rl=n(61756),ol=n(4109);function al(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ll=(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},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%"}},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"}}))),il=(0,r.memo)((e=>{var t;let{config:n,saveState:l,getSavedState:i,commentId:c}=e;const{maxWidth:s,profileBand:u,workflow:p}=n||{},d=ll({maxWidth:s}),m=(0,a.useSelector)(y.ZP.selectors.getEntity),g=(0,a.useSelector)(y.ZP.selectors.getHistoryEvent),f=(0,a.useSelector)(y.ZP.selectors.getIsHistoryModeEnabled),h=(null===(t=(0,a.useSelector)(y.ZP.selectors.getSearchKeyword))||void 0===t?void 0:t.value)||"",v=(0,a.useSelector)(y.ZP.selectors.getMode),D=(0,a.useDispatch)(),I=(0,E.u)(),A=(e=>{const t=(0,rl.v)(e),n=(0,ol.b)();return(0,r.useMemo)((()=>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){al(e,t,n[t])}))}return e}({},t,{onActionSuccess:n})),[t,n])})(p),{isLoading:M}=(0,w.M)(),{type:L,uri:z}=m||{},H=(0,r.useMemo)((()=>(0,b.dvH)(m)),[m]),U=(0,r.useContext)(C.h),V=(0,S.C)({objectIds:H}),{views:F,layout:B,isLoaded:W,handleLayoutChange:q}=(e=>{let{config:t,entityTypeUri:n,saveState:o,getSavedState:a}=e;const[l,i]=(0,r.useState)([]),[c,s]=(0,r.useState)([]),{canRead:u}=(0,Mn.l)(),p=(0,r.useMemo)((()=>{const e=t.views.filter(u),n=(0,b.sFD)(t.layout,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){tl(e,t,n[t])}))}return e}({},t,{views:e,layout:n})}),[t,u]),d=(0,r.useMemo)((()=>Ja()(p)),[p]),m=null!=p&&p.nestedRoute?`/${p.nestedRoute}`:"",g=n&&p?n+m:null,f=(0,r.useCallback)((()=>a().then((e=>e.layout?{}:e))),[a]),h=(0,r.useCallback)((0,b.DsO)(o,1e3),[o]),{isLoaded:y,savedState:v=nl,updateSavedState:x}=(0,el.w)({getSavedState:f,saveState:h,entityTypeUri:g}),E=(0,r.useCallback)((e=>{x({layout:e,views:c,configHash:d}),i(e)}),[x,d,c]);return(0,r.useEffect)((()=>{if(y){const e=d!==v.configHash,{views:t,layout:n}=(0,b.Mfk)({views:e||!v.views?p.views:v.views,layout:e?p.layout:v.layout});s(t),i(n)}}),[y,v,g]),{views:c,layout:l,isLoaded:y,handleLayoutChange:E}})({config:n,entityTypeUri:L,saveState:l,getSavedState:i});(0,O.a)({entity:m,historyEvent:g}),(()=>{const e=(0,a.useDispatch)(),t=(0,a.useSelector)(y.ZP.selectors.getValidateReadMode),n=(0,a.useSelector)(y.ZP.selectors.getEntity)||{},{uri:o,updatedTime:l}=n,i=(0,b.biM)(n),c=(0,a.useSelector)(y.ZP.selectors.getMode),s=(0,a.useSelector)(y.ZP.selectors.getProfileViews),u=s&&s.length>0,p=(0,r.useCallback)((0,b.DsO)((t=>{t&&e(y.N5.actions.validateProfile())}),500),[e]);(0,r.useEffect)((()=>{const e=t&&!i&&o&&!(0,b.ZiX)(o)&&c===b.ARY.Viewing&&u;p(e)}),[p,i,t,l,o,c,u])})(),(0,r.useEffect)((()=>{D(y.N5.views.actions.profileViewsSet(F))}),[D,F]),(0,r.useEffect)((()=>{n.sidePanelViews&&D(y.N5.sidePanelViews.actions.sidePanelViewsLoaded(n.sidePanelViews))}),[n]);const G=v===b.ARY.Viewing&&(0,b.ZiX)(z),_=e=>o().createElement("div",{className:d.emptyState},o().createElement(P.ZP,{LogoRenderer:P.B9.NO_DATA,text:e,variant:P.tC.embedded}));return o().createElement(N.j.Provider,{value:!0},o().createElement(C.e,{collaboration:f?U:V},o().createElement(k.O.Provider,{value:A},o().createElement(Z.m.Provider,{value:I},o().createElement(T.l.Provider,{value:h},o().createElement(R.fy,null,o().createElement("div",{className:d.perspectiveView},W&&z?o().createElement(za,{commentId:c,perspectiveId:"profile"},o().createElement("div",{className:d.profileWrapper},o().createElement(ta,{profileBandConfig:u}),M?_(x().text("Loading")):o().createElement(o().Fragment,null,!f&&o().createElement(Qa,null),!G&&o().createElement(Io,{maxWidth:s,views:F,layout:B,entityUri:z,onLayoutChanged:q})))):o().createElement(o().Fragment,null,o().createElement(j.Z,null),_(x().text("No data to display."))),o().createElement(zo,null))))))))}));function cl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}il.displayName="ProfilePerspectiveView";const sl=(0,c.createGenerateClassName)({productionPrefix:"profilePerspective",disableGlobal:!0});b.oss.register("profile",((e,t)=>{const n=e=>(0,i.sort)(((e,t)=>e.x>t.x||e.x===t.x&&e.y>t.y?1:-1),e),r=(0,i.map)((e=>(0,i.evolve)({layout:(0,i.pipe)(n,(0,i.map)((0,i.ifElse)((0,i.propEq)("autosizing",!0),(0,i.omit)(["y","height","minHeight","maxHeight"]),(0,i.omit)(["y","minHeight","maxHeight"]))))},e)));return(0,b.l22)(r(e),r(t))}));const ul=e=>{let{config:t,store:n,onResize:v=i.identity,saveState:x,getSavedState:E,qxSandboxApi:w,commentId:C}=e;const S=(0,r.useCallback)((0,b.aYu)(E),[E]),{SnackbarRenderer:O,showSnackbarMessage:P}=(0,p.D)(),N=(0,r.useMemo)((()=>t&&(0,b.Vr9)(t)),[t]),k=(0,r.useContext)(d.Y),Z=y.ZP.selectors.getShowAttributeDescription(n.getState()),T=(0,r.useMemo)((()=>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){cl(e,t,n[t])}))}return e}({},k,{showDescription:Z})),[k,Z]);return o().createElement(a.Provider,{store:n},o().createElement(m.m.Provider,{value:null==N?void 0:N.id},o().createElement(g.S.Provider,{value:P},o().createElement(f.Y.Provider,{value:w},o().createElement(c.StylesProvider,{generateClassName:sl},o().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},o().createElement(d.Y.Provider,{value:T},o().createElement(o().Fragment,null,o().createElement(s.Z,{handleHeight:!0,onResize:(e,t)=>v(Math.floor(e),Math.floor(t))}),N&&o().createElement(il,{config:N,saveState:x,getSavedState:S,commentId:C}),o().createElement(h.Z,{showErrorFromStore:!0}),o().createElement(O,null)))))))))};var pl=n(82842),dl=n(51229),ml=n(91131);const gl=(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}}))),fl=e=>{let{total:t=0}=e;const n=gl(),l=(0,a.useDispatch)(),i=(0,r.useContext)(m.m),c=(0,r.useCallback)((()=>{l(y.ui.actions.openPerspective({perspectiveId:"profile",viewId:i}))}),[l,i]);return o().createElement(B.Z,{title:""},o().createElement("div",{className:n.titleContainer},o().createElement(F.Link,{component:"button",variant:"caption",className:n.link,onClick:c,underline:"none"},x().text("Profile")),o().createElement(ml.Z,{className:n.icon}),x().text("Tags")),o().createElement(dl.Z,null),o().createElement(F.Typography,{className:n.totalCaption,variant:"caption"},o().createElement("span",{className:n.totalNumber},x().number(t,"0,0")),x().text("total profiles")))};var hl=n(20404);const bl=(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"}}))),yl=e=>{let{label:t}=e;const n=bl();return o().createElement(F.Toolbar,{className:n.toolbar},o().createElement(hl.Z,{className:n.avatar}),o().createElement(F.Typography,{variant:"h6",className:n.label},t))};function vl(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){xl(e,t,n[t])}))}return e}function xl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const El=(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}}))),wl=[25,50,100],Cl=(0,r.memo)((e=>{let{tag:t,entityUri:n}=e;const l=El(),[c,s]=(0,r.useState)(wl[0]),[u,p]=(0,r.useState)(0),d=(0,a.useSelector)(y.ZP.selectors.getGlobalSearchRequestOptions);(0,r.useEffect)((()=>{p(0)}),[t,n,d]);const{isLoading:m,total:g,entities:f}=(e=>{let{tag:t,entityUri:n,page:o=0,rowsPerPage:l=50}=e;const c=(0,a.useDispatch)(),s=(0,Ce._)(),u=(0,Ce._)(),[p,d]=(0,r.useState)(!1),[m,g]=(0,r.useState)(0),[f,h]=(0,r.useState)([]),{requestEntities:v,requestTotal:E}=(e=>{let{entityUri:t,tag:n}=e;const o=(0,a.useSelector)(y.ZP.selectors.getGlobalSearchRequestOptions),l=(0,a.useSelector)(y.ZP.selectors.getTenant),c=(0,a.useSelector)(y.ZP.selectors.getDtssPath),s=(0,r.useMemo)((()=>(0,b.Do$)(t)),[t]),u=(0,r.useMemo)((()=>[{filter:"equals",fieldName:"tags",values:[n]}]),[n]),p=!!s,d=(0,r.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=vl({select:"uri,label,type,secondaryLabel,defaultProfilePicValue,startDate,endDate"},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return p?(0,b.uqV)({filters:e,options:t,customerTenant:l,dataTenant:s,dtssPath:c}).then((0,i.map)((0,b.E7G)(s))):(0,b.ZOr)(e,t)}),[p,s,l,c]);return{requestEntities:(0,r.useCallback)(((e,t)=>d(u,vl({offset:t,max:e},o))),[u,o,d]),requestTotal:(0,r.useCallback)((()=>{const e=o;return(p?(0,b.J$m)({filters:u,options:e,customerTenant:l,dataTenant:s,dtssPath:c}):(0,b.j_Q)(u,e)).then((e=>e.total))}),[u,o,p,s,l,c])}})({entityUri:n,tag:t}),w=(0,r.useCallback)((e=>{c(y.ui.actions.errorSet((0,b.xU7)(e,x().text("Something went wrong")))),g(0)}),[c]);return(0,r.useEffect)((()=>{s(E()).then(g).catch(w)}),[E,s,w]),(0,r.useEffect)((()=>{d(!0),u(v(l,o*l)).then(h).catch(w).finally((()=>d(!1)))}),[o,l,v,u,w]),{isLoading:p,total:m,entities:f}})({tag:t,entityUri:n,page:u,rowsPerPage:c}),h=(0,r.useRef)(null);(0,r.useEffect)((()=>{h.current&&(h.current.scrollTop=0)}),[f]);const v=g>wl[0];return o().createElement("div",{className:l.perspectiveView},o().createElement(yl,{label:t}),o().createElement("div",{className:M()(l.tagsContainer,{[l.fullHeight]:v})},o().createElement(U.Z,{className:l.tagsView},o().createElement(fl,{total:g}),o().createElement("div",{className:l.listContainer},m&&o().createElement(j.Z,null),g>0&&o().createElement("div",{className:l.entitiesList,ref:h},o().createElement(pl.Z,{entities:f})),v&&o().createElement("div",{className:l.pagination},o().createElement(V.Z,{count:g,rowsPerPageOptions:wl,rowsPerPage:c,page:u,onChangePage:p,onChangeRowsPerPage:s}))))))}));Cl.displayName="TagPerspectiveView";const Sl=(0,c.createGenerateClassName)({productionPrefix:"tagPerspective",disableGlobal:!0}),Ol=e=>{let{config:t,tag:n,entityUri:r,store:l,onResize:u=i.identity}=e;return o().createElement(a.Provider,{store:l},o().createElement(m.m.Provider,{value:t.id},o().createElement(c.StylesProvider,{generateClassName:Sl},o().createElement(s.Z,{handleHeight:!0,onResize:(e,t)=>u(Math.floor(e),Math.floor(t))}),t&&o().createElement(Cl,{tag:n,entityUri:r}),o().createElement(h.Z,{showErrorFromStore:!0}))))};var Pl=n(65321);const Nl=(0,Q.Z)((()=>({actionsWrapper:{display:"flex","& button + button":{width:"88px",marginLeft:"8px"}}}))),kl=()=>{const e=Nl(),t=(0,a.useSelector)(y.ZP.selectors.getEntity),{tasks:n}=(0,r.useContext)(k.O),l=(0,r.useMemo)((()=>null==n?void 0:n.find((e=>e.objectURIs.includes((0,b.$Rg)(t.uri))))),[t.uri,n]);return o().createElement(Vo.Z,{entity:t},o().createElement("div",{className:e.actionsWrapper},l&&o().createElement(Pl.o,{task:l})))};function Zl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Tl=(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},perspectiveContainer:{display:"flex",flexGrow:1,overflow:"hidden"},attributesWrapper:{margin:"15px",flexGrow:1,overflowY:"auto",backgroundColor:"#FAFAFA"},contentWrapper:{display:"flex",flexDirection:"column",overflow:"hidden",flexGrow:1}}))),Rl={processTypes:["dataChangeRequestReview"]},jl=(0,r.memo)((()=>{const e=Tl(),t=(0,a.useDispatch)(),n=(e=>{const t=(0,a.useDispatch)(),n=(0,a.useSelector)(y.ZP.selectors.getEntityUri),o=(0,rl.v)(e),l=(0,r.useCallback)((e=>{"Reject"===e&&t(y.ui.actions.openPerspective({perspectiveId:null,viewId:null})),"Approve"===e&&t(y.ui.actions.openEntity({uri:(0,b.$Rg)(n),viewId:null}))}),[t,n]);return(0,r.useMemo)((()=>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){Zl(e,t,n[t])}))}return e}({},o,{onActionSuccess:l})),[o,l])})(Rl),l=(0,a.useSelector)(y.ZP.selectors.getEntity);(0,r.useEffect)((()=>{t(y.N5.sidePanelViews.actions.sidePanelViewsLoaded([{id:"common",views:[{point:"com.reltio.plugins.ui.view",id:"com.reltio.plugins.entity.side.WorkflowsView",class:"com.reltio.plugins.entity.side.WorkflowsView"}]}]))}),[t]);const i=!n.loading&&!!l.uri;return o().createElement(k.O.Provider,{value:n},o().createElement("div",{className:e.perspectiveView},!i&&o().createElement(j.Z,null),o().createElement("div",{className:e.perspectiveContainer},i?o().createElement(za,{hideHistory:!0,perspectiveId:"dcrCard"},o().createElement("div",{className:e.contentWrapper},o().createElement(kl,null),o().createElement("div",{className:e.attributesWrapper},o().createElement(L.Z,null)))):o().createElement(P.ZP,{LogoRenderer:P.B9.NO_DATA,text:x().text("No data to display."),variant:P.tC.embedded}))))}));function Dl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}jl.displayName="DCRReviewPerspectiveView";const Il=(0,c.createGenerateClassName)({productionPrefix:"dcrReviewPerspective",disableGlobal:!0}),Al=e=>{let{config:t,store:n,onResize:p=i.identity}=e;const g=(0,r.useContext)(d.Y),f=y.ZP.selectors.getShowAttributeDescription(n.getState()),b=(0,r.useMemo)((()=>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){Dl(e,t,n[t])}))}return e}({},g,{showDescription:f})),[g,f]);return o().createElement(a.Provider,{store:n},o().createElement(m.m.Provider,{value:t.id},o().createElement(c.StylesProvider,{generateClassName:Il},o().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},o().createElement(d.Y.Provider,{value:b},o().createElement(s.Z,{handleHeight:!0,onResize:(e,t)=>p(Math.floor(e),Math.floor(t))}),o().createElement(jl,null),o().createElement(h.Z,{showErrorFromStore:!0}))))))}},79417:(e,t,n)=>{n.r(t),n.d(t,{RelationshipsTableView:()=>qe});var r=n(8598),o=n(24328),a=n.n(o),l=n(44443),i=n(17440),c=n(52730),s=n(49885),u=n(50757),p=n(65549),d=n(94079),m=n(13980),g=n.n(m),f=n(87918),h=n.n(f),b=n(79692);const y=(0,b.Z)({addButton:{marginLeft:"12px",padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)"},label:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"}}),v=e=>{let{onClick:t}=e;const n=y();return a().createElement(d.Button,{color:"primary",className:n.addButton,onClick:t},a().createElement(p.Z,{classes:{root:n.icon}}),a().createElement("div",{className:n.label},h().text("Add")))};v.propTypes={onClick:g().func};const x=v;var E=n(71153),w=n.n(E);const C={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},S={color:"rgba(0,0,0,.54)"},O=(0,b.Z)((e=>({headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"12px"},entityCell:{display:"flex",alignItems:"center",height:"100%"},entityLabel:{fontSize:"15px",color:e.palette.primary.main,cursor:"pointer",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap","$row-cell--removed &":C,"$row-cell--inactive &":S},entityAvatar:{transform:"scale(0.7)",margin:"0 10px"},rowCell:{fontSize:"13px",overflow:"hidden"},description:{marginLeft:"-22px"},"row-cell--sorted":{color:"rgba(0,0,0,0.87)"},"row-cell--removed":{pointerEvents:"none","& > :not($entityCell)":C},"row-cell--inactive":S})));function P(){return P=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},P.apply(this,arguments)}const N=e=>{let{cell:t,CellValueRenderer:n,rowValue:{connection:r},isSorted:o}=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","rowValue","isSorted"]);const i=O(),c=(0,u.$qe)(r),s=(0,u.Fn9)(r.relation)&&(0,u.Fn9)(r.entity);return a().createElement("div",{className:w()({[i["row-cell--sorted"]]:o,[i["row-cell--removed"]]:c,[i["row-cell--inactive"]]:!s},i.rowCell)},t.values.map(((e,t)=>a().createElement(n,P({key:t,value:e},l)))))};N.propTypes={rowValue:g().object,cell:g().object,CellValueRenderer:g().elementType,isSorted:g().bool};const k=N;var Z=n(85709),T=n(94656),R=n(47898),j=n(34e3),D=n(95613);const I=e=>{let{value:{entityType:t,entity:n}}=e;const r=(0,c.useDispatch)(),l=(0,o.useContext)(R.m),p=O(),d=(0,u.idV)(n.entityLabel),m=(0,u.wwR)({uri:n.entityUri,dataTenant:n.dataTenant});return a().createElement("div",{className:p.entityCell},a().createElement(j.Z,{className:p.entityAvatar,entityType:t}),a().createElement(D.Z,{value:d},a().createElement("span",{className:p.entityLabel,onClick:(0,i.pipe)((0,i.always)({uri:m,viewId:l}),s.ui.actions.openEntity,r)},d)))};I.propTypes={value:g().shape({entity:g().shape({entityUri:g().string,entityLabel:g().string}),entityType:u.p8l})};const A=I;var M=n(92332),L=n(98448);const z=(0,n(67353).Z)((e=>{const t=O(),{description:n}=(null==e?void 0:e.headCellData)||{};return a().createElement("div",{className:t.headCell},a().createElement(M.default,e),a().createElement(L.Z,{description:n,className:t.description}))}));var H=n(64091);const U=(0,i.pipe)((0,i.map)((e=>e.uri||e)),i.uniq);function V(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const F=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),B=e=>{if(e.startsWith("relation.attributes")){const t=F(e);return t.length>1?t.slice(0,-1):null}return null},W=(0,i.map)((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){V(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:B(e.id),headCellRenderer:z,rowCellValueRenderer:(t=e.id,"entity.label"===t?A:H.Z)});var t})),q=(0,b.Z)({tableContainer:{display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},emptyData:{marginBottom:"30px"},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"row-cell__buttons-container":{position:"absolute"},"row-cell__buttons-wrapper":{display:"flex",paddingLeft:"10px","& > button":{marginLeft:"-10px",transform:"scale(0.9)"}}});var G=n(27604),_=n(22983);const $=e=>{let{canUpdate:t,canRemove:n,handleEditRelation:r,handleRemoveRelation:o}=e;return a().createElement(a().Fragment,null,t&&a().createElement(d.Tooltip,{title:h().text("Edit")},a().createElement(d.IconButton,{onClick:r},a().createElement(G.Z,null))),n&&a().createElement(d.Tooltip,{title:h().text("Remove")},a().createElement(d.IconButton,{onClick:o},a().createElement(_.Z,null))))};$.propTypes={canUpdate:g().bool,canRemove:g().bool,handleEditRelation:g().func,handleRemoveRelation:g().func};const Y=$;function X(){return X=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},X.apply(this,arguments)}const Q=e=>{let{mode:t,columnsData:n,connections:r,metadata:l,sorting:c,onSort:p,filters:d,onFilter:m,onEditRelation:g,onRemoveRelation:f,basicTableRef:h,allowOnlyCreateNew:b}=e;const y=(0,o.useMemo)((()=>((e,t,n)=>e.map((e=>(0,i.pipe)((0,i.reduce)(((t,r)=>{let{id:o}=r;return(0,i.assoc)(o,((e,t,n)=>{let{entity:r,relation:o}=t;switch(e){case"entity.label":return{entity:r,entityType:(0,u.nt9)(n,r.entityType)};case"relation.label":return o.relationLabel||(0,u.Lmx)(n,o.relationType);case"relation.activeness.startDate":return o.startDate;case"relation.activeness.endDate":return o.endDate;default:return((e,t)=>(0,i.pipe)((0,i.path)(["object","attributes"]),(0,u.tT_)(e))(t))(F(e),o)}})(o,e,n),t)}),{}),(0,i.assoc)("connection",e))(t))))(r,n,l)),[r,n,l]),v=(0,o.useMemo)((()=>W(n)),[n]),x=q(),E=(0,o.useCallback)((e=>a().createElement(k,X({},e,{isSorted:!!c&&c.field===e.columnData.id}))),[c]),[w,C]=(0,o.useState)(null),{canRemove:S,canUpdate:O}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:o,onEditRelation:a,allowOnlyCreateNew:l}=e;const i=(0,u.xvW)(r);if(s.N5.mode.selectors.getIsEditableMode(n)&&r&&(!l||i)){const{relation:{relationType:e}}=r,l=(0,u.$qe)(r),i=(0,u.V3K)(t,e);return{canRemove:o&&!l&&(0,u.Edd)(n,i),canUpdate:a&&!l&&(0,u.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:t,onRemoveRelation:f,onEditRelation:g,metadata:l,allowOnlyCreateNew:b,connection:(0,i.path)([w,"connection"],y)}),P=(0,o.useCallback)((e=>C(e)),[]),N=(0,o.useCallback)((()=>g((0,i.path)([w,"connection"],y))),[w,g,y]),T=(0,o.useCallback)((()=>f((0,i.path)([w,"connection","relation","relationUri"],y))),[w,f,y]),R=S||O?a().createElement(Y,{handleEditRelation:N,handleRemoveRelation:T,canRemove:S,canUpdate:O}):void 0;return a().createElement("div",{className:x.tableContainer},a().createElement(Z.Z,{autosizing:!0,maxHeight:477,columnsData:v,rowsData:y,sorting:c,onSort:p,filters:d,onFilter:m,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,renderRowCell:E,onRowHover:P,hoverRowIndex:w,hoveredRowRightContent:R,classes:{hoveredRowRightContentWrapper:x["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:x["row-cell__buttons-container"]},ref:h,resizeDebounceDelay:150}))};Q.propTypes={mode:g().string,columnsData:T.uz,connections:g().arrayOf(u.Rjq),metadata:u.pGS,filters:g().objectOf(T.Dq),onFilter:g().func,sorting:T.nI,onSort:g().func,onEditRelation:g().func,onRemoveRelation:g().func,basicTableRef:g().shape({current:g().object}),allowOnlyCreateNew:g().bool};const K=Q;var J=n(93416),ee=n(75512),te=n(30553),ne=n(32152),re=n(1876),oe=n(60894),ae=n(43054),le=n(8818);const ie=(0,b.Z)((()=>({popupContent:{padding:"19px 23px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"}}))),ce=e=>{let{className:t,showInactive:n,onShowInactiveChange:r}=e;const l=ie(),i=(0,o.useRef)(),[c,s]=(0,o.useState)(!1),u=()=>s((e=>!e));return a().createElement(a().Fragment,null,a().createElement(le.k,{className:t,ref:i,tooltipTitle:h().text("More"),icon:ae.Z,onClick:u,size:"L"}),a().createElement(d.Popover,{open:c,classes:{paper:l.popupContent},anchorEl:i.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},a().createElement(d.FormControlLabel,{classes:{label:l.checkboxControlLabel},control:a().createElement(d.Checkbox,{className:l.checkboxControlCheckbox,checked:n||!1,onChange:e=>r(e.target.checked)}),label:h().text("Show inactive Relationships")})))},se=(0,b.Z)({header:{padding:"0 4px 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"},moreButton:{marginLeft:"-6px"}}),ue=e=>{let{title:t,total:n,searchQuery:r,onChangeSearchQuery:o,filtersEnabled:l,onToggleFilters:i,columnsData:c,selectedColumns:s,onChangeColumns:u,showInactive:p,onChangeShowInactive:m}=e;const g=se();return a().createElement(J.Z,{title:t,className:g.header},a().createElement(ee.Z,{widthToHide:500},a().createElement(te.Z,{height:24,margin:16}),a().createElement(d.Typography,{className:g.totalCaption,variant:"caption"},n>1?h().text("${count} entities",{count:n}):h().text("${count} entity",{count:n}))),a().createElement(ne.i,{query:r,onChange:o}),a().createElement(re.Z,{enabled:l,onClick:i}),a().createElement(te.Z,{height:24,margin:4}),a().createElement(oe.Z,{columnsData:c,selectedColumns:s,onChangeColumns:u}),a().createElement(ce,{className:g.moreButton,showInactive:p,onShowInactiveChange:m}))};ue.propTypes={title:g().string,total:g().number,columnsData:T.uz,selectedColumns:g().arrayOf(g().string),onChangeColumns:g().func,searchQuery:g().string,onChangeSearchQuery:g().func,filtersEnabled:g().bool,onToggleFilters:g().func,showInactive:g().bool,onChangeShowInactive:g().func};const pe=ue;var de=n(26180),me=n(31276);function ge(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){fe(e,t,n[t])}))}return e}function fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const he="CHANGE_SEARCH_QUERY",be="CHANGE_SHOW_INACTIVE",ye=ge({},de.ZP.actions,{changeSearchQuery:(0,me.zD)(he),changeShowInactive:(0,me.zD)(be)}),ve=(e,t)=>{switch(t.type){case he:return ge({},e,{searchQuery:t.payload,page:0});case be:return ge({},e,{showInactive:t.payload});default:return de.ZP.reducer(e,t)}};var xe=n(26481),Ee=n(87451),we=n(37152),Ce=n(52016),Se=n(10237),Oe=n(11013),Pe=n(58662),Ne=n(99136);const ke=[10,25,50,100],Ze=[{id:"entity.label",get label(){return h().text("Entity label")},dataTypeDefinition:{type:u.oS0.TYPE_STRING},hideable:!1},{id:"relation.label",get label(){return h().text("Directional label")},dataTypeDefinition:{type:u.oS0.TYPE_STRING}},{id:"relation.activeness.startDate",get label(){return h().text("Start date")},dataTypeDefinition:u.PY2.startDate},{id:"relation.activeness.endDate",get label(){return h().text("End date")},dataTypeDefinition:u.PY2.endDate}],Te=(0,i.pipe)(u.Tde,(0,i.concat)("relation.")),Re=(0,i.pipe)((0,i.map)((e=>({id:Te(e.uri),label:e.label,description:e.description,dataTypeDefinition:(0,u.PFL)(e)}))),(0,i.uniqBy)((0,i.prop)("id"))),je=(0,i.pipe)(((e,t)=>{let{content:{inRelations:n=[],outRelations:r=[]}}=e,{relationTypes:o}=t;return(0,i.pipe)(U,(0,i.chain)((e=>(0,i.pipe)((0,i.find)((0,i.propEq)("uri",e)),u.DK$)(o))))([...n,...r])}),Re,(0,i.concat)(Ze));var De=n(37754);const Ie=(0,b.Z)({addArea:{display:"flex",alignItems:"center",height:"48px",borderBottom:"1px solid rgba(0, 0, 0, 0.12)"},noData:{fontSize:"13px",paddingLeft:"20px",marginBottom:"20px",marginTop:"10px",color:"rgba(0,0,0,0.54)"}});function Ae(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Me=(0,i.pluck)("id",Ze),[Le]=Me;function ze(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const He=(0,i.memoizeWith)(((e,t)=>t.id),u.fS6),Ue=(0,c.connect)(((e,t)=>{const{config:n}=t;return{connections:s.ZP.selectors.getConnectionsWithDraftsByViewId(e,n.id),total:s.ZP.selectors.getTotalByViewId(e,n.id),entity:s.ZP.selectors.getEntity(e),metadata:s.ZP.selectors.getMetadata(e),mode:s.ZP.selectors.getMode(e),relationToAdd:s.ZP.selectors.getRelationToAddByViewId(e,n.id),relationsToEdit:s.ZP.selectors.getRelationsToEditByViewId(e,n.id),checkIfCanAddRelations:s.ZP.selectors.getCheckIfCanAddRelations(e,n.content)}}),void 0,((e,t,n)=>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){ze(e,t,n[t])}))}return e}({},e,t,n,{config:He(e.metadata,n.config)})))((e=>{let{className:t,config:n,entity:r,metadata:l,connections:p=[],total:m=0,mode:g,relationToAdd:f,relationsToEdit:b=[],checkIfCanAddRelations:y,dispatch:v,readOnlyMode:E}=e;const w={searchQuery:"",filters:null,visibleColumns:Me,sorting:{order:n.sortOrder||"asc",field:n.sortColumn||Le},page:0,rowsPerPage:n.max||15,showInactive:!1},C=Ie(),S=(0,o.useContext)(xe.j)?g:u.fO_.VIEWING,[O,P]=(0,o.useReducer)(ve,w),N=(0,i.pipe)(ye.changeSearchQuery,P),k=(0,i.pipe)(ye.changeShowInactive,P),Z=(0,o.useContext)(Ee.Y),T=(0,c.useSelector)(s.ZP.selectors.getShowAttributeDescription),R=(0,o.useMemo)((()=>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){Ae(e,t,n[t])}))}return e}({},Z,{showDescription:T})),[Z,T]);(0,o.useEffect)((()=>{N("")}),[null==r?void 0:r.uri]);const{visibleColumns:j,searchQuery:D,filters:I,sorting:A,page:M,rowsPerPage:L,showInactive:z}=O,H=(0,o.useMemo)((()=>je(n,l)),[n,l]),U=(0,o.useMemo)((()=>j.map((e=>H.find((0,i.propEq)("id",e))))),[j,H]),V=(0,o.useMemo)((()=>((e,t,n)=>{const r=u.wSh.fromFalsy(e).map(u.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome(""),o=(0,De.Tz)(n,t);return(new u.MEy).addClause(r).addClause(o).build()})(D,I,U)),[I,D]),{isLoading:F}=(0,we.a)({sorting:A,filter:V,page:M,rowsPerPage:L,config:n,entity:r,relationActivityFilter:z?u.Ng6.ALL:u.Ng6.ACTIVE_ONLY,mode:g}),B=(0,o.useMemo)((()=>{return e=w.rowsPerPage,ke.filter((t=>t!==e)).concat(e).sort(i.subtract);var e}),[]),{handleRowsPerPageChange:W,handlePageChange:q}=(0,o.useMemo)((()=>({handleRowsPerPageChange:(0,i.pipe)(ye.changeRowsPerPage,P),handlePageChange:(0,i.pipe)(ye.changePage,P)})),[]),G=(0,o.useCallback)((()=>{const e=(0,u.vlo)({config:n,mode:S,metadata:l,parentEntityUri:void 0});(0,i.pipe)(s.N5.relations.actions.openRelationEditor(n.id),v)(e)}),[n,S,l,v]),_=(0,o.useCallback)((e=>{v(s.N5.relations.actions.closeRelationEditor(n.id,e)),v(s.N5.relations.actions.removeRelation(n.id,e));const t=p.find((t=>s.N5.relations.selectors.getRelationUriFromConnection(t)===e)),r=s.N5.relations.selectors.getEntityUriFromConnection(t);(0,u.ZiX)(r)&&v(s.N5.modifiedEntities.actions.entityDeleted(r))}),[n,p,v]),$=r&&y&&!E,Y=f?[f,...b]:b,{canUpdate:X,canDelete:Q}=(0,Ce.l)(),J=X(n)&&!E,ee=Q(n)&&!E,te=(0,o.useRef)(null);return a().createElement(Ee.Y.Provider,{value:R},a().createElement(Se.Z,{className:t},a().createElement(pe,{title:n.caption,total:m,columnsData:H,selectedColumns:j,onChangeColumns:(0,i.pipe)(ye.changeColumns,P),searchQuery:D,onChangeSearchQuery:N,filtersEnabled:!!I,onToggleFilters:(0,i.pipe)(ye.toggleFilters,P),showInactive:z,onChangeShowInactive:k}),$&&a().createElement("div",{className:C.addArea},a().createElement(x,{onClick:G})),Y.map((e=>a().createElement(Oe.Z,{key:s.N5.relations.selectors.getRelationUriFromConnection(e),connection:e,config:n,mode:S,metadata:l}))),a().createElement("div",{style:{position:"relative"}},a().createElement(K,{mode:S,columnsData:U,connections:p,metadata:l,filters:I,onFilter:(0,i.pipe)(ye.changeFilter,P),sorting:A,onSort:(0,i.pipe)(ye.toggleSort,P),onEditRelation:J?(0,i.pipe)(s.N5.relations.actions.openRelationEditor(n.id),v):null,onRemoveRelation:ee?_:null,basicTableRef:te,allowOnlyCreateNew:n.allowOnlyCreateNew}),p.length?a().createElement(Pe.Z,{count:m,rowsPerPageOptions:B,rowsPerPage:L,onChangeRowsPerPage:W,page:M,onChangePage:q,basicTableRef:te}):a().createElement(d.Typography,{className:C.noData},h().text("No data found")),F&&a().createElement(Ne.Z,null))))}));var Ve=n(36138),Fe=n(22664),Be=n(585);const We=(0,Ve.createGenerateClassName)({productionPrefix:"relTable",disableGlobal:!0}),qe=e=>{let{config:t,store:n,onResize:o=i.identity,className:s,readOnlyMode:u}=e;return a().createElement(c.Provider,{store:n},a().createElement(R.m.Provider,{value:t.id},a().createElement(Ve.StylesProvider,{generateClassName:We},a().createElement(Fe.MuiPickersUtilsProvider,{utils:r.Z},a().createElement(l.Z,{handleHeight:!0,onResize:(e,t)=>o(Math.floor(e),Math.floor(t))}),t&&a().createElement(Ue,{config:t,className:s,readOnlyMode:u}),a().createElement(Be.Z,null)))))}},1242:(e,t,n)=>{e.exports=n.p+"5271a9e7b6651c852e93.png"}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[6578],{66578:(e,t,n)=>{n.d(t,{vC:()=>Al,_n:()=>ul,tM:()=>Ol});var r=n(24328),o=n.n(r),a=n(52730),l=n(8598),i=n(17440),c=n(36138),s=n(44443),u=n(22664),p=n(24605),d=n(87451),m=n(47898),g=n(97094),f=n(60115),h=n(585),b=n(50757),y=n(49885),v=n(87918),x=n.n(v),E=n(76536),w=n(94622),C=n(41564),S=n(7718),O=n(57730),P=n(21077),N=n(26481),k=n(94150),Z=n(26005),T=n(72249),R=n(94773),j=n(99136),D=n(30268),I=n(67268),A=n(71153),M=n.n(A),L=n(8962);const z=o().createContext(null);z.displayName="SingleAttributeContext";var H=n(60995),U=n(10237),V=n(58662),F=n(94079),B=n(93416),W=n(55299),q=n(98448),G=n(75512),_=n(30553),$=n(66410),Y=n(32152),X=n(36444),Q=n(79692);const K=(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"}}))),J=e=>{let{className:t}=e;const n=K(),a=(0,r.useRef)(),[l,i]=(0,r.useState)(!1),{showInactive:c,toggleShowInactive:s}=(0,r.useContext)(z),u=()=>i((e=>!e));return o().createElement(o().Fragment,null,o().createElement(F.Button,{ref:a,classes:{root:M()(n.triggerButton,t)},onClick:u},o().createElement(X.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:c,onChange:e=>s(e.target.checked)}),label:x().text("Show inactive values")})))},ee=(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"}}))),te=e=>{let{caption:t,totalVisibleValues:n,showInactiveValuesMenu:a,isEditableMode:l}=e;const i=ee(),{searchQuery:c,setSearchQuery:s,setPage:u,totalNonVisibleValues:p,nonVisibleValues:d,attributeType:m}=(0,r.useContext)(z),g=l&&(null==m?void 0:m.required);return o().createElement(B.Z,{title:t,className:i.root},g&&o().createElement(W.Z,null),o().createElement(q.Z,{description:null==m?void 0:m.description}),o().createElement(G.Z,{widthToHide:500},o().createElement(_.Z,{height:24,margin:16}),o().createElement(F.Typography,{className:i.totalCaption,variant:"caption"},x().number(n)," ",1===n?x().text("item"):x().text("items"))),o().createElement($.Z,{nonOvTotal:p,className:i.ovIcon,nonOvValues:d,attributeType:m}),o().createElement(Y.i,{query:c,onChange:e=>{s(e),u(0)}}),a&&o().createElement(J,null))};var ne=n(65549),re=n(11564),oe=n(93140),ae=n(76134),le=n(96811),ie=n(48852);const ce=b.nIW,se=(e,t)=>"object"==typeof e?Object.values(e).some((e=>e.some((e=>{let{value:n}=e;return se(n,t)})))):b.P6Y.strings.search(String(e),t),ue=async e=>{let{metadata:t,entity:n,attributeTypeUri:r,defaultMaxValues:o=1/0,offset:a=0,searchQuery:l=""}=e;const c=(0,i.pipe)(b.XtP,(0,i.filter)((e=>{let{value:t}=e;return se(t,l)})))(t,n,r),s=(0,i.filter)(b.OXP,c);return{[(0,b.xy8)(r)]:{[ce(r)]:s.slice(a,a+o),paging:{[r]:{totalOvValues:s.length,totalValues:c.length}}}}},pe=(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,noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px 8px 0"}})));function de(){return de=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},de.apply(this,arguments)}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){ge(e,t,n[t])}))}return e}function ge(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const fe=[],he=(0,ie.l)(R.NY,((e,t)=>{let{parentUri:n,attributeType:r}=t;const{element:o,type:a}=e||{};return{highlightedError:(0,R.Ie)(a)&&(0,b.Wah)(o,n,r.uri)?e:null}}),(e=>{let{values:t,attributeType:n,parentUri:l,showInactive:c,noDataText:s,highlightedError:u}=e;const p=pe(),{uri:d,required:g,cardinality:f,name:h}=n,v=(0,a.useDispatch)(),E=(0,r.useContext)(m.m),w=(0,a.useSelector)(y.ZP.selectors.getEntity),C=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,w.uri)||{})),S=(0,a.useSelector)((e=>y.ZP.selectors.getActiveErrorsForAttributesPager(e,l,n))),O=(0,a.useSelector)((e=>(0,b.tQX)(l,n,y.ZP.selectors.getProfileErrors(e)))),P=(0,a.useSelector)(y.ZP.selectors.getMode),N=(0,b.xy8)(n),k=(0,i.pipe)((0,i.pathOr)(fe,[N,h]),(0,i.map)((0,i.prop)("uri")))(w),Z=(0,i.pathOr)(fe,[N,h],C),T=Z.map((0,i.prop)("uri")),R=(0,b.ZiX)(w.uri),j=(0,r.useMemo)((()=>(0,b.gjI)({parentUri:l,attributeType:n})),[l,n]),{ref:D,errorClassName:I}=(0,re.B)({highlightedError:u,isSimple:!0}),A=(0,b.O27)(Z),L=g&&A,z=L?[j]:Z.filter((0,i.pipe)((0,i.prop)("uri"),b.ZiX)),H=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.addAttributes,v)(e.map((e=>me({},e,{viewId:E}))))),[E,v]),U=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.modifyAttribute,v)(me({},e,{viewId:E}))),[E,v]),V=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.removeAttribute,v)(me({},e,{viewId:E}))),[E,v]),B=(0,r.useCallback)((0,i.pipe)(y.N5.errors.actions.errorDeactivated,v),[v]),W=(0,r.useCallback)((()=>{const e={parentUri:l,attributeType:n};return H(L&&!(0,b.YkM)(n.type)?[e,e]:[e])}),[H,l,n,L]),q=(0,b.Vg3)({attributeType:n,mode:P}),G={attributeType:n,errors:S,crosswalks:C.crosswalks,mode:P,onAddAttributes:H,onChangeAttribute:U,onDeactivateError:B,showNonOv:c},_=0===z.length&&0===t.length;return!(0,i.isEmpty)(C)&&o().createElement("div",{ref:D,className:I},o().createElement(oe.Z,{cardinality:f}),o().createElement(ae.Z,{message:O}),q&&o().createElement(F.Button,{color:"primary",onClick:W,className:p.moreButton},o().createElement(ne.Z,{classes:{root:p.icon}}),o().createElement("div",{className:p.buttonLabel},x().text("Add"))),z.map(((e,t)=>o().createElement(le.Z,de({key:e.uri},G,{attributeValue:e,lazy:L&&!g,showEmptyEditors:R,ownError:(0,b.ADq)(e,t,d,S),onDeleteAttribute:V})))),z.length>0&&t.length>0&&o().createElement(F.Divider,{className:p.divider}),t.map((e=>{const t=Z.find((0,i.propEq)("uri",e.uri)),n=t||e,r=k.includes(n.uri)&&!T.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,b.vKJ)({valueTransformer:(0,i.unless)(b.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:M()({[p.ovFalse]:!(0,b.OXP)(n)})},o().createElement(le.Z,de({},G,{attributeValue:n,ownError:(0,b.ADq)(n,null,d,S),onDeleteAttribute:V,state:l})))})),_&&o().createElement(F.Typography,{className:p.noData},s))}));var be=n(81303);const ye=(0,Q.Z)((()=>({simpleAttribute:{fontSize:"13px",lineHeight:"15px",marginBottom:"4px"}}))),ve=e=>{let{values:t,attributeType:n,showInactive:r}=e;const a=ye(),l=!(0,b.YkM)(n);return o().createElement(o().Fragment,null,t.map((e=>o().createElement(be.Z,{key:e.uri,attributeValue:e,attributeType:n,showNonOv:r,className:M()({[a.simpleAttribute]:l})}))))},xe=(0,Q.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",padding:"4px 16px 9px",overflow:"hidden",flexGrow:1},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"},pagination:{flexGrow:0,flexShrink:0}}))),Ee=15,we=e=>{let{config:t,className:n}=e;const{caption:l,max:i=Ee,showInactiveValuesMenu:c}=t,s=xe(),{values:u,totalVisibleValues:p,page:d,setPage:m,isLoading:g,hasPaging:f,attributeType:h,showInactive:b}=(0,r.useContext)(z),v=(0,a.useSelector)(y.ZP.selectors.getEntityUri),E=(0,a.useSelector)(y.ZP.selectors.getIsViewMode),w=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),C=(0,a.useSelector)(y.ZP.selectors.getPivotingAttributes),S=0!==u.length,O=t["text-empty"]||x().text("No data found");return o().createElement(H.J.Provider,{value:C},o().createElement(U.Z,{className:M()(s.root,n)},o().createElement(te,{totalVisibleValues:p,caption:l,showInactiveValuesMenu:c,isEditableMode:w}),o().createElement(F.Box,{className:s.content},(()=>{if(g)return o().createElement(j.Z,null);if(h){if(E&&S){const e={values:u,attributeType:h,showInactive:b};return o().createElement(ve,e)}if(w){const e={values:u,attributeType:h,parentUri:v,showInactive:b,noDataText:O};return o().createElement(he,e)}}return o().createElement(F.Typography,{className:s.noData},O)})()),f&&o().createElement(V.Z,{count:p,page:d,rowsPerPage:i,rowsPerPageOptions:[],onChangePage:m,classes:{root:s.pagination}})))};var Ce=n(85229),Se=n(20562);function Oe(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=(e,t)=>{const{attributeUri:n,max:o=15}=e,l=(0,a.useSelector)(y.ZP.selectors.getMetadata),[c,s]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),[d,m]=(0,r.useState)(!1),g=(0,Ce._)(),f=(0,r.useRef)(null),h=(0,a.useDispatch)(),v=(0,a.useSelector)(y.ZP.selectors.getApiPath),E=(0,a.useSelector)(y.ZP.selectors.getTenant),w=(0,a.useSelector)(y.ZP.selectors.getEntityWithDiff),C=(0,a.useSelector)(y.ZP.selectors.getIsViewMode),S=(0,a.useSelector)(y.ZP.selectors.getIsHistoryModeEnabled),O=(0,a.useSelector)(y.ZP.selectors.getHistoryDiff),P=w.uri,N=ce(n),k=(0,b.xy8)(n);f.current=(0,b.JQy)(w,P,N);const Z=(0,r.useMemo)((()=>(0,b.zeJ)(l,n)),[l,n]),{globalFilter:T}=(0,a.useSelector)(y.ZP.selectors.getGlobalSearchRequestOptions),{showInactive:R}=t,j=(0,r.useCallback)((()=>{if(Z&&(0,b.Uty)(Z)&&!(0,b.ZiX)(P)&&(0,b.YOQ)(n)){m(!0);const{page:e,showInactive:r}=t,a=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"]),c=(0,b.biM)(w)||S?ue:b.KbL;g(c(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){Oe(e,t,n[t])}))}return e}({metadata:l,entity:w,apiPath:v,tenant:E,parentUri:P,defaultMaxValues:o,attributeTypeUri:n,offset:o*e,globalFilter:T,options:r?"":void 0},a))).then((e=>{const t=(0,i.path)([k],e),r=(0,i.pathOr)([],[N],t);S||h(y.N5.actions.processNextPageOfAttributeValues({parentUri:P,attributeTypeUri:n,attributeTypeName:N,values:r})),s(r.map((e=>{var t;return(null===(t=f.current)||void 0===t?void 0:t.find((0,i.propEq)("uri",e.uri)))||e}))),p((0,i.path)(["paging",n],t))})).catch((e=>{console.error(e),s([]),h(y.ui.actions.errorSet((0,b.xU7)(e,x().text("Something went wrong"))))})).finally((()=>{m(!1)}))}else s([]),p(null)}),[v,P,E,n,o,l,t,T,Z,S,O]);(0,r.useEffect)((()=>{j()}),[j]),(0,Se.D)((()=>{C&&j()}),[C]);const D=(0,i.partition)(b.OXP),[,I]=D(f.current||[]),A=R?[]:I,M=R?"totalValues":"totalOvValues",L=(0,i.ifElse)((0,i.has)(M),(0,i.prop)(M),(0,i.always)(c.length))(u),z=o<L,H=null!=u&&u.totalValues?u.totalValues-L:A.length;return{values:c,isLoading:d,hasPaging:z,totalVisibleValues:L,attributeType:Z,totalNonVisibleValues:H,nonVisibleValues:A}};function Ne(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ke=n(37152),Ze=n(3185),Te=n(31274),Re=n(79026),je=n(8818),De=n(90324),Ie=n(70595);const Ae=o().createContext(null);Ae.displayName="RelationsViewStateContext";const Me=(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"}}))),Le=e=>{let{className:t}=e;const n=Me(),a=(0,r.useRef)(),{showInactive:l,toggleShowInactive:i,sortOrder:c,toggleSortOrder:s,sortOption:u,changeSortOption:p,sortOptions:d}=(0,r.useContext)(Ae),[m,g]=(0,r.useState)(!1),f=()=>g((e=>!e)),h=!(0,b.O27)(d),y="asc"===c;return o().createElement(o().Fragment,null,o().createElement(F.Button,{ref:a,classes:{root:M()(n.button,t)},onClick:f},o().createElement(X.Z,null)),o().createElement(F.Popover,{open:m,classes:{paper:n.popupContent},anchorEl:a.current,onClose:f,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:x().text("Show inactive Relationships")}),h&&o().createElement(o().Fragment,null,o().createElement(F.Divider,{className:n.divider}),o().createElement(F.Typography,{className:n.title,variant:"h6"},x().text("Sort by")),o().createElement("div",{className:n.sortControls},o().createElement(Re.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(je.k,{tooltipTitle:y?x().text("Ascending"):x().text("Descending"),icon:y?De.Z:Ie.Z,onClick:s,className:n.sortOrderButton,size:"L"})))))};Le.displayName="FilterButton";const ze=Le,He=(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 Ue=n(61932),Ve=n(55847);const Fe=o().createContext(null);function Be(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}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}const qe=Math.pow(2,31)-1,Ge=(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 _e=n(81137);const $e=e=>{let{label:t}=e;const n=Ge();return o().createElement(F.Badge,{classes:{anchorOriginTopRightRectangle:n.badgePosition,badge:n.badge},badgeContent:t},o().createElement(Ue.Z,null))},Ye=()=>{const{tenants:e,selectedTenant:t,onConfirmImport:n,onCancelConfirmation:l,onImportClick:i}=(()=>{var e;const t=(0,a.useSelector)(y.ZP.selectors.getDataTenants),n=(0,a.useDispatch)(),{config:o,reloadRelations:l}=(0,r.useContext)(Fe),i=(0,a.useSelector)(y.ZP.selectors.getEntityUri),[c,s]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),d=(0,a.useSelector)(y.ZP.selectors.getDtssPath),m=(0,a.useSelector)(y.ZP.selectors.getTenant),g=[Be({},o.content,{offset:0,max:null!==(e=o.maxDtssImport)&&void 0!==e?e:qe})],f=(0,r.useCallback)((()=>{s([]),o.importFromDT&&!(0,b.ZiX)(i)&&Promise.all((t||[]).map((e=>(0,b.QXb)({entityUri:i,content:g,dtssPath:d,customerTenant:m,dataTenant:e.id}).then((t=>{let{hasNonImportedConnections:n}=t;return Be({},e,{hasNonImportedConnections:n})}))))).then((e=>e.filter((e=>e.hasNonImportedConnections)))).then(s)}),[i,d,m,o,t]),h=(0,r.useCallback)((()=>{(0,b.MOC)({entityUri:i,content:g,dtssPath:d,customerTenant:m,dataTenant:u.id}).then((()=>{l(),f()})).catch((e=>n(y.ui.actions.errorSet((0,b.xU7)(e,x().text("Something went wrong")))))),p(null)}),[i,d,m,o,f,l,u,p]);(0,r.useEffect)((()=>{f()}),[f]);const v=(0,r.useCallback)((()=>p(null)),[]),E=(0,r.useCallback)((e=>p(e)),[]);return{tenants:c,selectedTenant:u,onConfirmImport:h,onCancelConfirmation:v,onImportClick:E}})(),c=Ge(),s=1===e.length,u=s?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,s?o().createElement("div",{className:c.button},o().createElement(je.k,{size:"L",icon:Ue.Z,tooltipTitle:x().text("Import connections from ${label}",{label:e[0].label}),onClick:()=>i(e[0])}),o().createElement("div",{className:M()(c.tenant)},u)):o().createElement(Ve.Z,{menuId:"importDT-table-actions",buttonComponent:je.k,buttonProps:{tooltipTitle:x().text("Import connections"),size:"L",icon:()=>o().createElement($e,{label:u})},menuItems:e.map((e=>({onClick:()=>{i(e)},text:e.label})))}),o().createElement(_e.Z,{open:!!t,title:x().text("Confirmation"),content:x().text("Import connections from ${label}?",{label:null==t?void 0:t.label}),discardCaption:x().text("Cancel"),saveCaption:x().text("Import"),onDiscard:l,onSave:n})))},Xe=e=>{let{title:t,total:n}=e;const a=He(),{searchQuery:l,changeSearchQuery:i}=(0,r.useContext)(Ae);return o().createElement(B.Z,{title:t||"",className:a.header},n>0&&o().createElement(G.Z,{widthToHide:400},o().createElement(_.Z,{height:24,margin:16}),o().createElement(F.Typography,{className:a.totalCaption,variant:"caption"},n>1?x().text("${count} items",{count:n}):x().text("${count} item",{count:n}))),o().createElement(Y.i,{query:l,onChange:i}),o().createElement(Ye,null),o().createElement(ze,null))};var Qe=n(11013),Ke=n(27604),Je=n(22983),et=n(34e3),tt=n(31039);const nt=(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 rt(){return rt=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},rt.apply(this,arguments)}const ot=e=>{let{label:t,entity:n,children:l}=e,c=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 s=nt(),u=(0,Ce._)(),p=(0,a.useSelector)(y.ZP.selectors.getTenant),d=(0,a.useSelector)(y.ZP.selectors.getDtssPath),[m,g]=(0,r.useState)(!1),[f,h]=(0,r.useState)(null);(0,r.useEffect)((()=>{h(null)}),[n]);const v=(0,r.useCallback)((()=>{if(null!=n&&n.entityUri&&!(0,b.ZiX)(null==n?void 0:n.entityUri)&&(0,i.isNil)(f)){const e=(0,i.ifElse)(b.biM,(e=>(0,b.vTU)({entityUri:e.entityUri,dataTenant:e.dataTenant,customerTenant:p,dtssPath:d})),(e=>(0,b.XkT)(e.entityUri)));g(!0),u(e(n)).then((e=>{let{secondaryLabel:t}=e;h(t)})).finally((()=>{g(!1)}))}}),[d,n,p,u,f]),x=o().createElement("div",{className:s.tooltipContent},o().createElement("div",{className:s.label},t),m&&o().createElement(F.CircularProgress,{size:16,classes:{colorPrimary:s.progress}}),f&&o().createElement("div",{className:s.secondaryLabel},f));return o().createElement(F.Tooltip,rt({onOpen:v,title:x,disableFocusListener:!0,classes:{tooltip:s.tooltip}},c),l)},at=(e,t)=>{const{entity:n,relation:r}=e;return{entityType:(0,b.nt9)(t,null==n?void 0:n.entityType),entityLabel:(0,b.idV)(null==n?void 0:n.entityLabel),preparedUri:(0,b.wwR)({uri:null==n?void 0:n.entityUri,dataTenant:null==n?void 0:n.dataTenant}),relationLabel:(null==r?void 0:r.relationLabel)||(0,b.Lmx)(t,null==r?void 0:r.relationType)}};var lt=n(77277);const it=(0,Q.Z)((()=>({container:{display:"flex"}})));function ct(){return ct=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},ct.apply(this,arguments)}const st=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=it();return o().createElement("div",{className:a.container},o().createElement(lt.Z,ct({onClick:t,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),x().text("Accept")),o().createElement(lt.Z,ct({onClick:n,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),x().text("Ignore")))},ut=(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"}}))),pt=(0,r.memo)((e=>{let{connection:t,metadata:n,showControls:l,onRemoveRelation:i,onEditRelation:c,onAcceptRelation:s,onIgnoreRelation:u,renderRelationArrowButton:p}=e;const d=ut(),{entity:m,relation:g}=t,f=(0,b.$qe)(t),h=(0,b.xr3)(t),v=(0,b.iJH)(t),{entityType:E,entityLabel:w,preparedUri:C,relationLabel:S}=at(t,n),O=(0,b.Fn9)(g)&&(0,b.Fn9)(m),P=(0,a.useSelector)(y.ZP.selectors.getMode),{canRemove:N,canUpdate:k}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:o,onEditRelation:a}=e;if((n===b.ARY.Editing||n===b.ARY.Suggesting)&&r){const{relation:{relationType:e}}=r,l=(0,b.$qe)(r),i=(0,b.V3K)(t,e);return{canRemove:o&&!l&&(0,b.Edd)(n,i),canUpdate:a&&!l&&(0,b.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:P,onRemoveRelation:i,onEditRelation:c,metadata:n,connection:t}),Z=(0,r.useCallback)((()=>i(t.relation.relationUri)),[i,t]),T=(0,r.useCallback)((()=>c(t)),[c,t]),R=(0,r.useCallback)((()=>{s(t)}),[s,t]),j=(0,r.useCallback)((()=>u(t)),[u,t]),D=(N||k)&&l&&!t.suggested?o().createElement(o().Fragment,null,k&&o().createElement(je.k,{icon:Ke.Z,size:"XS",onClick:T,tooltipTitle:x().text("Edit")}),N&&o().createElement(je.k,{icon:Je.Z,size:"XS",onClick:Z,tooltipTitle:x().text("Remove")})):void 0,I=t.suggested?o().createElement(st,{acceptRelation:R,ignoreRelation:j,size:"small",disabled:v}):void 0,A=v?x().text("ignored"):x().text("edited");return o().createElement("div",{className:M()(d.container,{[d.rowInactive]:!O},{[d.removed]:f||v})},o().createElement("div",{className:d.row},p&&p(),o().createElement(et.Z,{className:d.entityAvatar,entityType:E}),o().createElement(tt.Z,{value:C,className:d.entityLabelContainer},o().createElement(ot,{label:w,entity:m},o().createElement("span",{className:d.entityLabel},w)),(h||v)&&o().createElement(F.Typography,{variant:"caption",className:d.editedLabel},"(",A,")"),S&&o().createElement("span",{className:d.relationLabel},`, ${S}`)),o().createElement("div",{className:d.editButtonsContent},D),I))}));pt.displayName="EditableRelationItem";const dt=pt,mt=(0,i.when)(b.Kn2,(0,i.prop)("uri")),gt=(e,t)=>{const n=(e,t)=>(t?(0,b.VGB)(t):[]).map((t=>({type:mt(t),direction:e===b.Nsj.IN?b.Nsj.IN:b.Nsj.OUT})));return n(b.Nsj.IN,e).concat(n(b.Nsj.OUT,t))[0]};function ft(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ht=n(98989),bt=n(83543);const yt=(0,Q.Z)({arrowIcon:{fontSize:"16px",marginRight:"6px"}}),vt=e=>{let{onClick:t,connection:n,config:r,showSecondLevel:a}=e;const l=yt(),{parentEntityUri:i}=n,{contentSecondLevel:c}=r,s={onClick:t,className:l.arrowIcon};return i||!c||(0,b.xvW)(n)?null:a?o().createElement(bt.Z,s):o().createElement(ht.Z,s)},xt=(0,Q.Z)({row:{display:"flex",alignItems:"center",width:"100%"},secondLevelContent:{paddingLeft:"24px"}}),Et=e=>{let{config:t,connection:n,children:l}=e;const i=xt(),{showInactive:c}=(0,r.useContext)(Ae),{connections:s,showSecondLevel:u,toggleShowSecondLevel:p,loadRelations:d,loading:m,total:g}=(e=>{let{config:t,connection:n,relationActivityFilter:o}=e;const l=(0,a.useDispatch)(),[i,c]=(0,r.useState)(!1),[s,u]=(0,r.useState)(!1),{contentSecondLevel:p}=t,{entity:d}=n,m=(0,a.useSelector)((e=>y.ZP.selectors.getConnectionsWithDraftsByViewId(e,t.id,d.entityUri)))||[],g=(0,a.useSelector)((e=>y.ZP.selectors.getTotalByViewId(e,t.id,d.entityUri))),{activityFilter:f}=(0,a.useSelector)(y.ZP.selectors.getGlobalSearchRequestOptions)||{},h=(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){ft(e,t,n[t])}))}return e}({},p,{returnObjects:!0,returnDates:!0,activeness:{relation:o||b.Ng6.ALL,entity:f}});u(!0),(0,b.N6e)(d.entityUri,[e]).then((e=>{const{connections:n,total:r}=e[0];n&&l(y.N5.relations.actions.secondLevelRelationsLoaded({connections:n,parentEntityUri:d.entityUri,id:t.id,total:r})),u(!1)}))}),[t.id,p,l,d.entityUri,f,o]),v=(0,r.useCallback)((()=>{i||n.connections||h(),c((e=>!e))}),[h,n.connections,i]);return{connections:m,showSecondLevel:i,toggleShowSecondLevel:v,loadRelations:h,loading:s,total:g}})({config:t,connection:n,relationActivityFilter:c?b.Ng6.ALL:b.Ng6.ACTIVE_ONLY}),f=(0,r.useMemo)((()=>(0,b.Px$)(s)),[s]);return o().createElement(o().Fragment,null,l((()=>o().createElement(vt,{onClick:p,connection:n,config:t,showSecondLevel:u}))),u&&o().createElement(Te.X.Provider,{value:f},o().createElement("div",{className:i.secondLevelContent},o().createElement(Jt,{isLoading:m,config:t,loadRelations:d,connections:s,total:g,parentEntityUri:n.entity.entityUri}))))},wt=(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"}}))),Ct=e=>{let{className:t,connections:n=[],config:l,mode:c,noDataText:s,parentEntityUri:u}=e;const p=(0,a.useSelector)(y.ZP.selectors.getMetadata),d=(0,a.useSelector)((e=>y.ZP.selectors.getRelationToAddByViewId(e,l.id))),m=(0,a.useSelector)((e=>y.ZP.selectors.getRelationsToEditByViewId(e,l.id))),g=(0,a.useSelector)(y.ZP.selectors.getEntity),f=(0,a.useSelector)((e=>y.ZP.selectors.getCheckIfCanAddRelations(e,l.content))),h=(0,a.useDispatch)(),v=wt(),E=(0,r.useCallback)((()=>{const e=(0,b.vlo)({config:l,mode:c,metadata:p,parentEntityUri:u});(0,i.pipe)(y.N5.relations.actions.openRelationEditor(l.id),h)(e)}),[l,c,p,h,u]),w=(0,r.useCallback)((e=>{h(y.N5.relations.actions.closeRelationEditor(l.id,e)),h(y.N5.relations.actions.removeRelation(l.id,e));const t=n.find((t=>y.N5.relations.selectors.getRelationUriFromConnection(t)===e)),r=y.N5.relations.selectors.getEntityUriFromConnection(t);(0,b.ZiX)(r)&&h(y.N5.modifiedEntities.actions.entityDeleted(r))}),[l,n,h]),C=l.content,S=gt(C.inRelations,C.outRelations),O=(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);h(y.N5.relations.actions.addRelation(l.id,t))}),[h,l,S]),P=(0,r.useCallback)((e=>{h(y.N5.relations.actions.ignoreRelation(l.id,{relationType:S.type,relationDirection:S.direction,entityUri:e.entity.entityUri,relationUri:e.relation.relationUri}))}),[h,l,S]),[N,k]=(0,i.partition)(b.xvW,n),Z=g&&f,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,b.xvW)(e),s=`${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(Et,{config:l,connection:e,key:s},(t=>r?o().createElement(Qe.Z,{connection:r,config:l,mode:c,metadata:p}):o().createElement(dt,{renderRelationArrowButton:t,connection:e,metadata:p,showControls:a,onRemoveRelation:w,onEditRelation:(0,i.pipe)(y.N5.relations.actions.openRelationEditor(l.id),h),onAcceptRelation:O,onIgnoreRelation:P})))},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:v.moreButton},o().createElement(ne.Z,{classes:{root:v.icon}}),o().createElement("div",{className:v.buttonLabel},x().text("Add"))),D&&o().createElement(Qe.Z,{connection:d,config:l,mode:c,metadata:p}),N.map(R),N.length>0&&k.length>0&&o().createElement(F.Divider,{className:v.divider}),k.map(R),T&&o().createElement(F.Typography,{className:v.noData},s))};var St=n(19603),Ot=n(94646),Pt=n(78101),Nt=n(80931);const kt=(0,Q.Z)((e=>({attributesList:{paddingLeft:"46px",paddingRight:"16px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0}})));function Zt(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){Tt(e,t,n[t])}))}return e}function Tt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Rt=e=>{let{connection:t,className:n}=e;const l=kt(),{relation:c}=t,s=(0,a.useSelector)(y.ZP.selectors.getEntityUriWithDataTenant),u=(0,a.useSelector)(y.ZP.selectors.getMetadata),p=(0,r.useMemo)((()=>(0,b.xF8)(u,null==c?void 0:c.relationType)),[null==c?void 0:c.relationType,u]),d=(0,r.useMemo)((()=>Zt({attributes:Zt({},y.N5.relations.selectors.getRelationAttributesFromConnection(t))},(0,b.p2l)((null==t?void 0:t.relation)||{}))),[t]),m=(0,r.useMemo)((()=>(0,b.fyF)(p,d)),[p,d]).filter((e=>{let{values:t}=e;return!(0,b.O27)(t)})).length>0,g=(0,r.useMemo)((()=>(0,b.R$r)(d.attributes)),[d]),{getCommentsCount:f}=(0,r.useContext)(C.h);(0,r.useEffect)((()=>{!(0,i.isEmpty)(g)&&f(g)}),[f,g]);const h=(0,r.useMemo)((()=>(0,b.wp9)(b.q7e.RELATION,{entityUri:s,connection:t})),[t,s]);return m?o().createElement(Pt.A.Provider,{value:h},o().createElement(Nt.Z,{className:M()(l.attributesList,n),entity:d,attrTypes:p})):o().createElement("div",{className:M()(l.attributesList,n)},x().text("No attributes"))};var jt=n(86602),Dt=n(82726);const It=e=>{let{show:t,onToggle:n,className:r}=e;return o().createElement(je.k,{className:r,tooltipTitle:t?x().text("Hide attributes of the relationship"):x().text("Show attributes of the relationship"),tooltipPlacement:"bottom-end",size:"XXS",icon:t?jt.Z:Dt.Z,onClick:n})},At=(0,Q.Z)((e=>({container:{display:"flex",flexDirection:"column",paddingBottom:"2px"},row:{display:"flex",alignItems:"center",flexDirection:"row",minHeight:"16px",padding:"3px 11px 3px 16px"},rowInactive:{background:e.inactiveBackground},entityAvatar:{height:"12px",width:"12px",fontSize:"11px",marginRight:"8px"},entityLabelContainer:{textDecoration:"none",cursor:"pointer",wordBreak:"break-all",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"},showDetails:{marginLeft:"auto",paddingRight:"5px"},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"},labelWrapper:{display:"flex",alignItems:"center"}}))),Mt=(0,r.memo)((e=>{let{connection:t,renderRelationArrowButton:n,acceptRelation:l,ignoreRelation:c}=e;const s=At(),u=t.suggested,{entity:p,relation:d}=t,[m,g]=(0,r.useState)(!1),f=(0,a.useSelector)(y.ZP.selectors.getMetadata),{entityType:h,entityLabel:v,preparedUri:x,relationLabel:E}=at(t,f),w=(0,b.Fn9)(d)&&(0,b.Fn9)(p),C=(0,a.useSelector)(y.ZP.selectors.getEntityUriWithDataTenant),S=p&&d&&(0,b.wp9)(b.q7e.RELATION,{entityUri:C,connection:t})||[];return o().createElement("div",{className:M()(s.container,{[s.rowInactive]:!w},{[s.suggestedWrapper]:u})},o().createElement("div",{className:M()(s.row,St.U)},n&&n(),o().createElement("div",{className:s.labelWrapper},o().createElement(et.Z,{className:s.entityAvatar,entityType:h}),o().createElement(tt.Z,{value:x,className:s.entityLabelContainer},o().createElement(ot,{label:v,entity:p},o().createElement("span",{className:s.entityLabel},v)),E&&o().createElement("span",{className:s.relationLabel},`, ${E}`))),o().createElement("div",{className:s.additionalButtonsWrapper},!(0,i.isEmpty)(S)&&o().createElement(Ot.Z,{className:s.commentsContainer,uri:(0,b.gjS)(d),relatedObjectUris:S,objectType:b.q7e.RELATION,allowOnlyOneComment:!0}),u&&o().createElement(st,{size:"small",acceptRelation:l(t),ignoreRelation:c(t)}),!u&&o().createElement(It,{show:m,onToggle:()=>{g((e=>!e))},className:s.showDetails}))),m&&o().createElement(Rt,{connection:t}))}));Mt.displayName="RelationItem";const Lt=Mt;var zt=n(52691),Ht=n(16208);const Ut=e=>e.filter((e=>5===e.value)).length,Vt=e=>e.filter((e=>1===e.value)).length,Ft=e=>0===e.length?"0%":Ut(e)/e.length*100+"%",Bt=e=>0===e.length?"0%":Vt(e)/e.length*100+"%",Wt=(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)"}}))),qt=e=>{let{ratings:t,className:n}=e;const r=Wt();return o().createElement("div",{className:M()(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:Ft(t)}}),o().createElement("div",{className:r.dislikesScale,style:{width:Bt(t)}})),o().createElement("div",{className:r.counts},o().createElement("div",{className:M()(r.likesCount,r.count)},o().createElement(zt.Z,{className:r.icon}),Ut(t)),o().createElement("div",{className:r.count},o().createElement(Ht.Z,{className:r.icon}),Vt(t))))},Gt=(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}}))),_t=e=>{let{ratings:t,onAgree:n,onDisagree:r}=e;const l=Gt(),i=(0,a.useSelector)(y.ZP.selectors.getUserName),c=t.find((e=>{let{user:t}=e;return t===i})),s=[{text:x().text("Has left the practice"),onClick:()=>r(x().text("Has left the practice"))},{text:x().text("Has moved away"),onClick:()=>r(x().text("Has moved away"))},{text:x().text("Has passed away"),onClick:()=>r(x().text("Has passed away"))},{text:x().text("Has retired"),onClick:()=>r(x().text("Has retired"))},{text:x().text("Other"),onClick:()=>r(x().text("Other"))}];return o().createElement("div",{className:l.wrapper},o().createElement(F.Button,{onClick:n,variant:"text",size:"small",className:M()(l.button,l.likeButton,{[l.isActive]:5===(null==c?void 0:c.value)})},"Agree"),o().createElement(Ve.Z,{buttonProps:{endIcon:o().createElement(bt.Z,null),variant:"text",size:"small",className:M()(l.button,{[l.isActive]:1===(null==c?void 0:c.value)})},buttonContent:1===(null==c?void 0:c.value)?c.comment:"Disagree",menuItems:s,menuId:"disagree-dropdown-menu-button"}))},$t=(0,Q.Z)((e=>({wrapper:{padding:"6px 16px 6px"},entityTypeIcon:{marginRight:"16px"},entityLabel:{color:e.palette.primary.main,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},entityLabelContainer:{wordBreak:"break-all",textDecoration:"none"},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 8px 6px 16px",backgroundColor:e.suggested},commentsContainer:{alignSelf:"center","& + $ratings":{marginLeft:"16px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex"}}))),Yt=e=>{let{connection:t,loadRelations:n,renderRelationArrowButton:l,acceptRelation:c,ignoreRelation:s}=e;const u=$t(),p=t.suggested,[d,m]=(0,r.useState)(!1),{entity:g,relation:f}=t,h=(0,a.useSelector)(y.ZP.selectors.getMetadata),{entityLabel:v,entityType:x,preparedUri:E,relationLabel:w}=at(t,h),C=(null==f?void 0:f.ratings)||[],S=(0,a.useSelector)(y.ZP.selectors.getEntityUriWithDataTenant),O=g&&f&&(0,b.wp9)(b.q7e.RELATION,{entityUri:S,connection:t})||[];return o().createElement("div",{className:M()(u.wrapper,{[u.suggestedWrapper]:p})},o().createElement(F.Box,{display:"flex",minHeight:"44px",className:St.U},o().createElement(F.Box,{display:"flex",alignItems:"center"},o().createElement(F.Box,{display:"flex",alignItems:"center"},l&&l(),o().createElement(et.Z,{entityType:x,className:u.entityTypeIcon})),o().createElement(F.Box,{display:"flex",flexDirection:"column"},o().createElement(tt.Z,{value:E,className:u.entityLabelContainer},o().createElement(ot,{label:v,entity:g},o().createElement("span",{className:u.entityLabel},v))),w&&o().createElement("span",{className:u.relationLabel},w),!p&&o().createElement(_t,{ratings:C,onAgree:()=>{(0,b.Buf)(null==f?void 0:f.relationUri,{comment:"",value:5}).then(n)},onDisagree:e=>{(0,b.Buf)(null==f?void 0:f.relationUri,{comment:e,value:1}).then(n)}}))),o().createElement("div",{className:u.additionalButtonsWrapper},!(0,i.isEmpty)(O)&&o().createElement(Ot.Z,{className:u.commentsContainer,uri:(0,b.gjS)(f),relatedObjectUris:O,objectType:b.q7e.RELATION,allowOnlyOneComment:!0}),p&&o().createElement(st,{acceptRelation:c(t),ignoreRelation:s(t)}),!p&&o().createElement(o().Fragment,null,o().createElement(qt,{ratings:C,className:u.ratings}),o().createElement(It,{show:d,onToggle:()=>{m((e=>!e))},className:u.showDetailsButton})))),d&&o().createElement(Rt,{connection:t,className:u.relationAttributes}))},Xt=e=>{let{className:t,connections:n=[],loadRelations:l,config:i,mainEnityUri:c}=e;const{isComplex:s,content:u}=i,{ignoreRelation:p,acceptRelation:d}=((e,t,n)=>{const r=gt(e.inRelations,e.outRelations),o=(0,a.useDispatch)();return{ignoreRelation:e=>()=>{const{entity:a}=e;(0,b.iiD)(n,{relatedEntityUri:a.entityUri,relationType:r.type,relationDirection:r.direction}).then(t).catch((e=>{o(y.ui.actions.errorSet((0,b.xU7)(e,x().text("Something went wrong"))))}))},acceptRelation:e=>()=>{const{entity:a,relation:l}=e,{startDate:i,endDate:c}=l,s=r.direction===b.Nsj.IN,u=s?a.entityUri:n,p=s?n:a.entityUri;(0,b.DsR)({startEntityUri:u,endEntityUri:p,relationType:r.type,attributes:null,startDate:i,endDate:c}).then(t).catch((e=>{o(y.ui.actions.errorSet((0,b.xU7)(e,x().text("Something went wrong"))))}))}}})(u,l,c),m=(0,r.useMemo)((()=>(0,b.w3p)(n)),[n]),{getCommentsCount:g}=(0,r.useContext)(C.h);return(0,r.useEffect)((()=>{g(m)}),[g,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(Et,{config:i,connection:e,key:r},(t=>s?o().createElement(Yt,{loadRelations:l,connection:e,acceptRelation:d,ignoreRelation:p,renderRelationArrowButton:t}):o().createElement(Lt,{acceptRelation:d,ignoreRelation:p,connection:e,renderRelationArrowButton:t})))})))};Xt.displayName="RelationsList";const Qt=Xt,Kt=(0,Q.Z)((e=>({list:{paddingTop:"8px",paddingBottom:"10px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),Jt=e=>{let{isLoading:t,config:n,loadRelations:r,connections:l,total:i,parentEntityUri:c}=e;const s=Kt(),{selectors:u}=y.ZP,p=(0,a.useSelector)(u.getEntity),d=(0,a.useSelector)(u.getMode),m=n["text-empty"]||x().text("No data found");return t?o().createElement(j.Z,null):(0,b.KIu)(d)?o().createElement(Ct,{connections:l,className:s.list,key:null==p?void 0:p.uri,config:n,mode:d,noDataText:m,parentEntityUri:c}):i>0?o().createElement(Qt,{config:n,loadRelations:r,connections:l,className:s.list,key:null==p?void 0:p.uri,mainEnityUri:p.uri}):o().createElement(F.Typography,{className:s.noData},m)},en=(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}}),tn=e=>{let{config:t,className:n}=e;const l=en(),{page:c,setPage:s,rowsPerPage:u,sortOrder:p,sortOption:d,showInactive:m,searchQuery:g,changeSearchQuery:f}=(0,r.useContext)(Ae),{selectors:h}=y.ZP,v=(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)((()=>{f("")}),[null==x?void 0:x.uri]);const S=(0,r.useMemo)((()=>(e=>{const t=b.wSh.fromFalsy(e).map(b.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome("");return(new b.MEy).addClause(t).build()})(g)),[g]),{isLoading:O,reload:P}=(0,ke.a)({sorting:C,filter:S,page:c,rowsPerPage:u,config:t,entity:x,relationActivityFilter:m?b.Ng6.ALL:b.Ng6.ACTIVE_ONLY,mode:w}),N=(0,r.useMemo)((()=>(0,b.Px$)(v)),[v]),k=(0,r.useMemo)((()=>({reloadRelations:P,config:(0,i.pick)(["content","importFromDT","maxDtssImport"],t)})),[P,t]);return o().createElement(Ze.u.Provider,{value:x},o().createElement(Te.X.Provider,{value:N},o().createElement(U.Z,{className:n},o().createElement("div",{className:l.container},o().createElement(Fe.Provider,{value:k},o().createElement(Xe,{title:t.caption,total:E})),o().createElement("div",{className:l.content},o().createElement(Jt,{isLoading:O,config:t,loadRelations:P,connections:v,total:E}),E>u&&o().createElement(V.Z,{classes:{root:l.pagination},count:E,rowsPerPageOptions:[],rowsPerPage:u,page:c,onChangePage:s}))))))};tn.displayName="RelationsView";const nn=o().createContext(null);nn.displayName="TableAttributeContext";var rn=n(86361),on=n(26180),an=n(31276);function ln(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){cn(e,t,n[t])}))}return e}function cn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const sn="CHANGE_SEARCH_QUERY",un=ln({},on.ZP.actions,{changeSearchQuery:(0,an.zD)(sn)}),pn=(e,t)=>t.type===sn?ln({},e,{searchQuery:t.payload,page:0}):on.ZP.reducer(e,t);var dn=n(92332),mn=n(67353);function gn(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){fn(e,t,n[t])}))}return e}function fn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const hn={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},bn=(0,Q.Z)((()=>({headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"12px"},rowCell:{fontSize:"13px",overflow:"hidden"},blobWrapper:{position:"relative",overflowY:"auto",overflowX:"hidden",whiteSpace:"pre",maxHeight:"100px",boxSizing:"border-box",padding:"15px 25px 0 25px"},defaultWrapper:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",padding:"15px 25px 0 25px"},updateAttribute:gn({padding:"0 4px",marginLeft:"-4px"},b.zXF[b.Y1q.updateAttribute]),insertAttribute:gn({},b.zXF[b.Y1q.insertAttribute]),deleteAttribute:gn({padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},b.zXF[b.Y1q.deleteAttribute]),description:{marginLeft:"-22px"},"row-cell--sorted":{color:"rgba(0,0,0,0.87)"},"row-cell--removed":{pointerEvents:"none","& > div":hn}}))),yn=(0,mn.Z)((e=>{const t=bn(),{description:n}=(null==e?void 0:e.headCellData)||{};return o().createElement("div",{className:t.headCell},o().createElement(dn.default,e),o().createElement(q.Z,{description:n,className:t.description}))}));var vn=n(72768),xn=n(95613);const En=e=>{let{value:t,historyClassName:n}=e;const r=bn();return o().createElement("div",{className:r.blobWrapper,onScroll:an.UW},o().createElement("span",{className:r[n]},t))},wn=e=>{let{value:t,columnData:{dataTypeDefinition:n}}=e;const a=bn(),{value:l,uri:c}=t,{appearance:s}=(0,r.useContext)(Z.m),u=(0,i.pipe)(b.IFm,b.o_F)(c,s);if(n.type===b.oS0.TYPE_BLOB)return o().createElement(En,{value:l,historyClassName:u});{const e=o().createElement(vn.Z,{value:l,dataTypeDefinition:n});return o().createElement(xn.Z,{value:e},o().createElement("div",{className:a.defaultWrapper},o().createElement("span",{className:a[u]},e)))}};function Cn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Sn=(e,t)=>{const{uri:n,label:r,children:o,name:a,description:l}=e;return(0,i.reject)(i.isNil,{id:(0,b.Tde)(n,t),label:r,description:l,dataTypeDefinition:(0,b.PFL)(e),children:null==o?void 0:o.map((e=>Sn(e,t.concat({name:a}))))})},On=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),Pn=e=>{if((0,b.vZp)(e)){const t=On(e);return t.length>1?t.slice(0,-1):null}return null},Nn=(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){Cn(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:Pn(e.id),headCellRenderer:yn,rowCellValueRenderer:wn})));var kn=n(37754);function Zn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Tn=n(1876),Rn=n(60894);const jn=(0,Q.Z)((()=>({header:{padding:"0 4px 0 16px"}}))),Dn=e=>{let{title:t}=e;const n=jn(),l=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),{attributeType:i,searchQuery:c,setSearchQuery:s,filters:u,onToggleFilters:p,allColumnsData:d,visibleColumns:m,onChangeColumns:g}=(0,r.useContext)(nn),f=l&&(null==i?void 0:i.required);return o().createElement(B.Z,{title:t,className:n.header},f&&o().createElement(W.Z,null),o().createElement(q.Z,{description:null==i?void 0:i.description}),o().createElement(Y.i,{query:c,onChange:s}),o().createElement(Tn.Z,{enabled:!!u,onClick:p}),o().createElement(_.Z,{height:24,margin:4}),o().createElement(Rn.Z,{columnsData:d,selectedColumns:m,onChangeColumns:g}))};function In(){return In=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},In.apply(this,arguments)}const An=(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=bn();return o().createElement("div",{className:M()({[i["row-cell--sorted"]]:a,[i["row-cell--removed"]]:r},i.rowCell)},t.values.map(((e,t)=>o().createElement(n,In({key:t,value:e},l)))))}));var Mn=n(52016),Ln=n(85709);const zn=(0,Q.Z)((()=>({tableContainer:{display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)",marginBottom:"15px"},"row-cell__buttons-container":{position:"absolute"},"row-cell__buttons-wrapper":{display:"flex",paddingLeft:"10px","& > button":{marginLeft:"-10px",transform:"scale(0.9)"}}}))),Hn=e=>{let{onEdit:t,onRemove:n}=e;return o().createElement(o().Fragment,null,t&&o().createElement(je.k,{tooltipTitle:x().text("Edit"),icon:Ke.Z,size:"L",onClick:t}),n&&o().createElement(je.k,{tooltipTitle:x().text("Remove"),icon:Je.Z,size:"L",onClick:n}))};function Un(){return Un=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},Un.apply(this,arguments)}const Vn=e=>{let{columnsData:t,values:n,sorting:l,onSort:c,filters:s,onFilter:u,config:p,onEdit:d,onDeleteAttribute:m,deletedUris:g}=e;const f=(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,b.xIV)(e))(t))(On(e),t))(r,e),t)}),{}),(0,i.assoc)("value",e))(t))))(n,t)),[n,t]),h=(0,r.useMemo)((()=>Nn(t)),[t]),v=zn(),x=(0,a.useSelector)(y.ZP.selectors.getMode),E=(0,b.KIu)(x),w=(0,a.useSelector)(y.ZP.selectors.getMetadata),C=(0,a.useSelector)(y.ZP.selectors.getEntityUri),S=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,C)||{})),{attributeType:O}=(0,r.useContext)(nn),P=(0,r.useCallback)((e=>o().createElement(An,Un({},e,{isSorted:!!l&&l.field===e.columnData.id}))),[l]),[N,k]=(0,r.useState)(null),{canUpdate:Z,canDelete:T}=(0,Mn.l)(),R=(0,r.useMemo)((()=>"number"!=typeof N||!E||g.includes((0,i.pipe)((0,i.path)([N]),(0,i.prop)("uri"))(n))),[N,g,n,E]),j="number"==typeof N&&(D=(0,i.path)([N],n),T(p)&&(0,b.xv5)({attributeType:O,mode:x,attributeValue:D,metadata:w,isReltioCrosswalk:(0,b.KVV)(S.crosswalks,D)}));var D;const I="number"==typeof N&&(e=>Z(p)&&(0,b.yv0)({attributeType:O,mode:x,attributeValue:e,isReltioCrosswalk:(0,b.KVV)(S.crosswalks,e)}))((0,i.path)([N],n)),A=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);I&&d(e)}),[d,N,n,I]),M=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);if(!j)return;const t={parentUri:C,attributeType:O,uri:e.uri,value:e};m(t),k(null)}),[N,n,m,j,O,C]),L=R||!j&&!I?void 0:o().createElement(Hn,{onEdit:I?A:void 0,onRemove:j?M:void 0}),z=(0,r.useMemo)((()=>({deletedUris:g})),[g]);return o().createElement("div",{className:v.tableContainer},o().createElement(Ln.Z,{autosizing:!0,maxHeight:477,columnsData:h,rowsData:f,sorting:l,onSort:c,filters:s,onFilter:u,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,resizeDebounceDelay:150,renderRowCell:P,onRowHover:k,hoverRowIndex:N,hoveredRowRightContent:L,context:z,classes:{hoveredRowRightContentWrapper:v["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:v["row-cell__buttons-container"]}}))};function Fn(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){Bn(e,t,n[t])}))}return e}function Bn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Wn=[],qn=(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 Gn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const _n=e=>{let{onChangeAttribute:t,onCancel:n,onApply:l,onDeleteAttribute:c,hasChanges:s,attributeValue:u}=e;const p=qn(),d=(0,a.useDispatch)(),g=(0,r.useContext)(m.m),{attributeType:f}=(0,r.useContext)(nn),h=(0,a.useSelector)(y.ZP.selectors.getEntityUri),v=(0,a.useSelector)(y.ZP.selectors.getMode),E=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,h)||{})),w=(0,b.YkG)(f)&&(0,b.ZiX)((0,b.bwT)(u)),C=(0,a.useSelector)((e=>w?y.ZP.selectors.getModifiedEntities(e):void 0)),S=(0,a.useSelector)((e=>y.ZP.selectors.getActiveErrorsForAttributesPager(e,h,f))),O=(0,b.ZiX)(h),P=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.addAttributes,d)(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){Gn(e,t,n[t])}))}return e}({},e,{viewId:g}))))),[g,d]),N=(0,r.useCallback)((0,i.pipe)(y.N5.errors.actions.errorDeactivated,d),[d]);return o().createElement(o().Fragment,null,o().createElement(le.Z,{expanded:!0,attributeValue:u,showEmptyEditors:O,onDeleteAttribute:c,onDeactivateError:N,onChangeAttribute:t,onAddAttributes:P,mode:v,crosswalks:E.crosswalks,errors:S,attributeType:f,ownError:(0,b.ADq)(u,null,f.uri,S)}),o().createElement("div",{className:p.actionButtons},o().createElement(F.Button,{onClick:()=>n(u)},x().text("Cancel")),o().createElement(F.Button,{color:"primary",disabled:!s,onClick:()=>l(u,C),"data-reltio-id":"table-attribute-view-apply-button"},x().text("Apply"))))};var $n=n(54198);const Yn=e=>(null==e?void 0:e.type)===b.NIO.missed,Xn=(0,i.curry)(((e,t)=>e.find((0,i.pipe)((0,i.prop)("uri"),(0,i.either)((0,b.sOy)(t.parentUri),(0,i.equals)(t.uri)))))),Qn=(0,Q.Z)((()=>({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"}}))),Kn=e=>{let{config:t,editingValues:n,modifiedValues:l,onChangeAttribute:c,onDeleteAttribute:s,onAdd:u,onCancel:p,onApply:d,onStartEditing:m,onReset:g,checkHasChanges:f,highlightedError:h,highlightedAttributeError:v}=e;const E=Qn(),{attributeType:w}=(0,r.useContext)(nn),C=(0,a.useSelector)(y.ZP.selectors.getMode),{canCreate:S}=(0,Mn.l)();(e=>{let{onStartEditing:t,modifiedValues:n,highlightedError:o,highlightedAttributeError:l}=e;const{attributeType:c}=(0,r.useContext)(nn),s=(0,a.useSelector)(y.ZP.selectors.getEntityUri),u=(0,a.useSelector)((e=>y.ZP.selectors.getActiveErrorsForAttributesPager(e,s,c))),p=(0,r.useRef)(!0),d=(0,$n.u)(),m=(0,r.useMemo)((()=>u.find((0,i.both)(Yn,(e=>(0,b.Wah)(e,s,c.uri))))),[u,s,c.uri]);(0,r.useEffect)((()=>{m&&1===n.length&&t(n[0])}),[m]),(0,r.useEffect)((()=>{p.current&&u.length&&((0,i.pipe)((0,i.map)(Xn(n)),(0,i.reject)(i.isNil),(0,i.forEach)(t))(u),p.current=!1)}),[u]),(0,r.useEffect)((()=>{Yn(o)&&1===n.length&&t(n[0])}),[o]),(0,r.useEffect)((()=>{if(l){const e=Xn(n,l);e&&t(e)}}),[l]),(0,r.useEffect)((()=>{const e=d((e=>{e.type===y.N5.constants.ProfileActions.SAVE_PROFILE&&(p.current=!0)}));return()=>e()}),[d])})({onStartEditing:m,modifiedValues:l,highlightedError:h,highlightedAttributeError:v});const O=S(t)&&w&&(0,b.Vg3)({attributeType:w,mode:C})&&!n.length;return(0,r.useEffect)((()=>()=>g()),[g]),o().createElement("div",{className:E.editor},O&&o().createElement(F.Button,{color:"primary",onClick:u,className:E.addButton,"data-reltio-id":"table-attribute-view-add-button"},o().createElement(ne.Z,{classes:{root:E.icon}}),o().createElement("div",{className:E.buttonLabel},x().text("Add"))),n.map((e=>o().createElement(_n,{key:e.uri,attributeValue:e,onChangeAttribute:c,onDeleteAttribute:s,onCancel:p,onApply:d,hasChanges:f(e)}))))},Jn=(0,ie.l)(R.NY,((e,t)=>{let{entityUri:n,attributeType:r}=t;const{element:o,type:a}=e||{},l=(0,R.Ie)(a),i=l&&(0,b.Wah)(o,n,r.uri);return{highlightedError:i?e:null,highlightedAttributeError:o&&l&&!i&&(0,b.nsY)(r,o)&&(0,b.vyG)(n,o)?e:null}}),(e=>{let{config:t,highlightedError:n,highlightedAttributeError:l}=e;const c=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),{values:s,visibleColumns:u,onFilter:p,onSort:d,filters:g,sorting:f,allColumnsData:h}=(0,r.useContext)(nn),{onDeleteAttribute:v,onStartEditing:x,onChangeAttribute:E,onAdd:w,onCancel:C,onApply:S,onReset:O,checkHasChanges:P,modifiedValues:N,editingValues:k,deletedUris:Z}=(()=>{const[e,t]=(0,r.useState)(),[n,o]=(0,r.useState)([]),l=(0,a.useDispatch)(),c=(0,a.useSelector)(y.ZP.selectors.getMode),s=(0,a.useSelector)(y.ZP.selectors.getEntityUri),u=(0,a.useSelector)(y.ZP.selectors.getMetadata),p=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,s)||{})),d=(0,r.useContext)(m.m),{attributeType:g,values:f}=(0,r.useContext)(nn),h=(0,b.KIu)(c),v=(0,b.xy8)(g),x=(0,i.pathOr)(Wn,[v,null==g?void 0:g.name],p),E=(0,r.useMemo)((()=>(0,b.gjI)({parentUri:s,attributeType:g})),[s,g]),w=(0,b.O27)(x),C=g.required&&w,S=(0,r.useMemo)((()=>C?[E]:x),[E,x,C]),O=(0,r.useMemo)((()=>[...S.filter((0,i.pipe)((0,i.prop)("uri"),(0,i.both)(b.ZiX,(0,i.pipe)((0,i.equals)(e),i.not)))),...(0,i.map)((e=>S.find((0,i.propEq)("uri",e.uri))||e))(f)].map((e=>{var t;return null!==(t=n.find((0,i.propEq)("uri",e.uri)))&&void 0!==t?t:e}))),[S,n,e,f]),P=(0,r.useMemo)((()=>(0,i.pipe)((0,i.map)((0,i.prop)("uri")),(0,i.filter)((e=>!S.find((0,i.propEq)("uri",e)))))(h?f:[])),[S,f,h]),N=S.filter((t=>{let{uri:r}=t;return r===e||n.find((0,i.propEq)("uri",r))})),k=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.modifyAttribute,l)(Fn({},e,{viewId:d}))),[d,l]),Z=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.removeAttribute,l)(Fn({},e,{viewId:d}))),[d,l]),T=(0,r.useCallback)((()=>{const e=(0,b.gjI)({parentUri:s,attributeType:g});t(e.uri),k(Fn({},e,{value:(0,b.GPx)({attributeTypes:(0,b.BoX)(u,g),parentUri:e.uri,mode:c,metadata:u}),attributeType:g}))}),[s,g,u,c,k]),R=(0,r.useCallback)((e=>{o((t=>t.find((0,i.propEq)("uri",e.uri))?t:[...t,e]))}),[o]),j=(0,r.useCallback)((e=>{const r=n.find((0,i.propEq)("uri",e.uri));if(r){const t={attributeType:g,value:r,uri:e.uri};o((e=>(0,i.without)([r],e))),w||k(t)}else{const n={value:e,attributeType:g,uri:e.uri};t(null),Z(n)}l(y.N5.errors.actions.errorsSet([]))}),[Z,k,o,w,n,g,l]),D=(0,r.useCallback)(((e,t)=>{const n=(0,b.q5j)(u,g,e,t).map((n=>Fn({},n,{path:(0,b.Z9i)({entityUri:s,metadata:u,entitiesMap:t||{[s]:(0,b.PeS)(g,e)}},n.uri||n.parentUri)})));return l(y.N5.errors.actions.errorsSet(n)),0===n.length}),[l,s,g,u]),I=(0,r.useCallback)(((e,n)=>{D(e,n)&&(t(null),o((t=>{const n=t.find((0,i.propEq)("uri",e.uri));return n?(0,i.without)([n],t):t})))}),[o,t,D]),A=(0,r.useCallback)((()=>{o([]),t(null)}),[]);return{checkHasChanges:e=>n.find((0,i.propEq)("uri",e.uri))!==e,onChangeAttribute:k,onDeleteAttribute:Z,onAdd:T,onCancel:j,onApply:I,onStartEditing:R,onReset:A,modifiedValues:O,editingValues:N,deletedUris:P}})(),{ref:T,errorClassName:R}=(0,re.B)({highlightedError:n,isSimple:!0}),j=c?N:s,D=(0,r.useMemo)((()=>u.map((e=>h.find((0,i.propEq)("id",e))))),[u,h]);return o().createElement("div",{ref:T,className:R},c&&o().createElement(Kn,{config:t,editingValues:k,modifiedValues:N,onChangeAttribute:E,onDeleteAttribute:v,onAdd:w,onReset:O,onCancel:C,onApply:S,onStartEditing:x,checkHasChanges:P,highlightedError:null==n?void 0:n.element,highlightedAttributeError:null==l?void 0:l.element}),D.length>0&&o().createElement(Vn,{columnsData:D,config:t,values:j,filters:g,onFilter:p,sorting:f,onSort:d,onEdit:x,onDeleteAttribute:v,deletedUris:Z}))})),er=(0,Q.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",overflow:"hidden"},noData:{fontSize:"13px",paddingLeft:"20px",color:"rgba(0,0,0,0.54)"},header:{padding:"0 4px 0 16px"}}))),tr=15,nr=e=>{let{config:t,className:n}=e;const{caption:l,max:i=tr}=t,c=er(),s=(0,a.useSelector)(y.ZP.selectors.getEntityUri),{totalVisibleValues:u,attributeType:p,showTable:d,hasPaging:m,isLoading:g,page:f,setPage:h}=(0,r.useContext)(nn);return o().createElement(U.Z,{className:M()(c.root,n)},d?o().createElement(o().Fragment,null,o().createElement(Dn,{title:l}),o().createElement("div",{className:c.content},o().createElement(Jn,{config:t,attributeType:p,entityUri:s}),m&&o().createElement(V.Z,{count:u,rowsPerPageOptions:[],rowsPerPage:i,page:f,onChangePage:h}),g&&o().createElement(j.Z,null))):o().createElement(o().Fragment,null,o().createElement(B.Z,{title:l,className:c.header},o().createElement(q.Z,{description:null==p?void 0:p.description})),o().createElement(F.Typography,{className:c.noData},x().text("No data"))))};var rr=n(58600);function or(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let ar=0;const lr=()=>ar++,ir=e=>{const t={children:[],nodeId:lr()};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,c={entity:l,children:[],nodeId:lr(),expanded:!0,rootIndex:i?n+1:void 0};i&&(c.root=i),o.children.push(c),o=c}}return t.children};var cr=n(5598);const sr=(0,Q.Z)((e=>({container:{fontSize:"13px",display:"flex",paddingTop:"6px",position:"relative"},title:{flexGrow:1,minHeight:"15px",color:e.palette.primary.main,lineHeight:"15px"},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"},errorMessage:{fontSize:"13px",margin:"0 16px 0",lineHeight:"1.4",color:e.palette.text.secondary},linearIndicator:{top:"42px"}})));var ur=n(1242);const pr=o().createContext(null),dr=e=>{e.target.src=ur},mr=e=>{let{node:t}=e;const{entity:{uri:n},nodeId:l}=t,i=(0,b.idV)(t.entity.label),c=sr(),s=(0,a.useSelector)(y.ZP.selectors.getAbsoluteImagePath),u=(0,a.useSelector)(y.ZP.selectors.getMetadata),{uri:p}=(0,a.useSelector)(y.ZP.selectors.getEntity),[d,m]=(0,r.useState)(),g=(0,r.useContext)(pr),f=n===p,h=(0,b.nt9)(u,t.entity.type)||{},v=(0,b.VD3)(u,h,"typeGraphIcon"),x=v&&(0,b.vPL)(s,v);return o().createElement("div",{className:c.wrapper,"data-node-id":l},o().createElement("div",{ref:m,className:c.container},o().createElement(F.Avatar,{alt:"Node icon",className:M()(c.avatar),src:x||ur,onError:dr}),o().createElement(cr.Z,{isSelected:f,title:i,entityUri:n,viewId:g.id,anchorEl:d})))},gr=((0,r.memo)(mr),e=>{let{node:t}=e;return t.nodeId}),fr=(0,Q.Z)((()=>({lineBlock:{height:"100%",position:"relative",display:"inline-block"},lineChildren:{height:"100%",position:"absolute",display:"inline-block","&:after":{content:"''",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)",width:"1px",left:"50%",bottom:"0",height:`calc(100% - ${vr.rowHeight}px)`}},rootIndex:{display:"flex",alignItems:"center",color:"rgba(0,0,0,0.54)",height:"100%"},verticalLine:{width:"1px",left:"calc(50% - 1px)",top:0,height:vr.rowHeight/2+"px",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},horizontalLineRight:{height:"1px",top:vr.rowHeight/2+"px",left:"calc(50% - 1px)",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 hr(){return hr=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},hr.apply(this,arguments)}function br(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yr(){return yr=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},yr.apply(this,arguments)}const vr={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:c,treeIndex:s,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=fr();return o().createElement("div",yr({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:c,treeIndex:s})}},o().createElement("div",{"aria-label":a.expanded?"Collapse":"Expand",className:M()(g.button,a.expanded?g.expandedButton:g.collapsedButton)})),o().createElement("div",{className:g.rowTitle},"function"==typeof d?d({node:a,path:c,treeIndex:s}):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,c=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"]),s=fr(),u=a.length,p=[];a.forEach(((e,t)=>{p.push(o().createElement("div",{key:`pre_${1+t}`,style:{width:r},className:s.lineBlock},l.root&&o().createElement("div",{className:s.rootIndex},l.rootIndex,"."),t===u-1&&0!==t&&o().createElement(o().Fragment,null,o().createElement("div",{className:s.verticalLine}),o().createElement("div",{className:s.horizontalLineRight}))))}));const d=l.root?r-4:0,m=r*u-d,g={left:m,width:`calc(100% - ${m}px`},f=`${m+250}px`,h=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){br(e,t,n[t])}))}return e}({},c.style,{width:f});return o().createElement("div",hr({},c,{className:s.node,style:h}),p,o().createElement("div",{className:s.nodeContent,style:g},n))},scaffoldBlockPxWidth:16,rowHeight:28,slideRegionSize:50};function xr(){return xr=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},xr.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",xr({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"})))},wr=e=>{let{title:t,onGraphOpen:n}=e;const a=sr(),{showNavigateToGraph:l}=(0,r.useContext)(d.Y);return o().createElement(B.Z,{title:t,className:a.header},l&&o().createElement("div",{className:a.buttonsContainer},o().createElement(je.k,{className:a.button,tooltipTitle:x().text("Show Graph"),icon:Er,onClick:n,size:"L"})))},Cr=e=>gr({node: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}var Or=n(9757);const Pr=(0,Q.Z)((()=>({root:{position:"relative"},bodyWrapper:{paddingTop:"21px"}})));function Nr(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){kr(e,t,n[t])}))}return e}function kr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Zr=e=>{let{config:t,className:n}=e;const a=(0,r.useRef)(),l=(0,r.useRef)(),[c,s]=(0,r.useState)(!1),{height:u,width:p,tooltip:d}=t,{html:m,visible:g,tooltip:f,customStyles:h,popup:b}=(0,Or.E)(t),y=Pr(),v=f||d;(0,r.useEffect)((()=>{a.current&&m&&(a.current.innerHTML="",Array.from(m.childNodes).forEach((e=>{a.current.appendChild(e)})))}),[m]),(0,r.useEffect)((()=>{s(!!b)}),[b]),(0,r.useEffect)((()=>{c&&l.current&&(l.current.innerHTML="",b&&Array.from(b.childNodes).forEach((e=>{l.current.appendChild(e)})))}),[c,b]);const x=(0,i.reject)(i.isNil,{width:p,height:u});return g?o().createElement("div",{className:y.bodyWrapper},o().createElement(F.Dialog,{ref:l,open:!!b}),o().createElement(F.Tooltip,{title:v||""},o().createElement("div",{ref:a,style:Nr({},x,h),className:M()(y.root,n)}))):null};var Tr=n(14940);const Rr=(0,Q.Z)({dragHandleContainer:{position:"relative",width:"100%",height:"inherit"},dragHandleVisibilityArea:{position:"absolute",top:0,left:0,width:"100%",height:"24px",zIndex:11,"&:hover $dragHandle":{visibility:"visible"},".react-grid-item.static &:hover $dragHandle":{visibility:"hidden"}},dragHandle:{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)"}}),jr=e=>{const t=t=>{const n=Rr();return o().createElement("div",{className:n.dragHandleContainer},o().createElement("div",{className:n.dragHandleVisibilityArea},o().createElement("div",{className:M()("viewDraggableHandle",n.dragHandle)},o().createElement(Tr.Z,{className:n.dragIcon}))),o().createElement(e,t))};return t.displayName="WithDragHandle",t};var Dr=n(2256);const Ir=e=>{const t=t=>o().createElement(Dr.Z,{error:o().createElement(P.ZP,{LogoRenderer:P.B9.ERROR,text:"",secondaryText:x().text("Something went wrong"),variant:P.tC.small})},o().createElement(e,t));return t.displayName="WithErrorBoundary",t},Ar=(0,Q.Z)({stubView:{padding:"20px"},fullHeight:{height:"100%"},component:{boxSizing:"border-box",overflow:"auto",boxShadow:"none",borderRadius:"unset"}});var Mr=n(29103),Lr=n(83911),zr=n(95299),Hr=n(22385);const Ur=(0,i.pipe)((0,i.path)(["point","lat"]),(0,i.both)((0,i.gt)(90),(0,i.lt)(-90))),Vr=(0,Q.Z)((()=>({root:{height:"100%",display:"flex",flexDirection:"column"},fullHeight:{height:"100%"},fullscreenBtn:{position:"absolute",right:"5px",top:"5px",zIndex:100}})));var Fr=n(13074),Br=n(24338);const Wr=(0,Q.Z)((e=>({caption:{color:e.palette.text.secondary,fontSize:"13px"}}))),qr=Wr,Gr=e=>{let{totalImages:t}=e;const n=qr(),r=t>1?x().text("photos"):x().text("photo");return o().createElement(F.Typography,{variant:"caption",className:n.caption},`${t} ${r}`)};function _r(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){$r(e,t,n[t])}))}return e}function $r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Yr=e=>{let{config:t,attributeType:n,paging:r,requestNextPageOfAttributeValues:l}=e;const c=(0,a.useDispatch)(),s=(0,a.useSelector)(y.ZP.selectors.getEntity),u=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,s.uri)||{})),p=(0,i.pathOr)([],["attributes",n.name],u),d=t.id;return o().createElement(o().Fragment,null,o().createElement(Br.Z,{attributeValues:p,attributeType:n,onDeleteAttribute:e=>(0,i.pipe)(y.N5.actions.removeAttribute,c)(_r({},e,{viewId:d})),parentUri:u.uri,onChangeAttribute:e=>(0,i.pipe)(y.N5.actions.modifyAttribute,c)(_r({},e,{viewId:d})),imageSize:Kr,paging:r,requestNextPageOfAttributeValues:l}),o().createElement(Gr,{totalImages:p.length}))},Xr=(0,Q.Z)((e=>({container:{padding:"8px 16px"},noData:{fontSize:"13px",color:e.palette.text.secondary}}))),Qr=Xr,Kr={imageMargin:4,imageWidth:162,imageHeight:162};var Jr=n(28741),eo=n(49734),to=n(98808),no=n(93428),ro=n(30885);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=e=>{let{config:t,match:n,onStartRequest:l,onFinishRequest:i}=e;const c=(0,a.useDispatch)(),s=(0,a.useSelector)(y.ZP.selectors.getMetadata),u=(0,a.useSelector)(y.ZP.selectors.getEntity),{canMerge:p,canMark:d}=(0,b.hXd)(s,t,n.object,u,n.matchRules),g=(0,r.useMemo)((()=>[n.object]),[n.object]),f={entity:u,entities:g,mode:to.N.iconButton,onStartRequest:l},h=(0,r.useContext)(m.m),v=(0,r.useCallback)((()=>{i(),c(y.N5.entity.actions.loadEntity({viewId:h,uri:u.uri}))}),[c,u.uri,i,h]);return o().createElement(o().Fragment,null,p&&o().createElement(no.H,oo({},f,{onFinishRequest:v})),d&&o().createElement(ro.i,oo({},f,{onFinishRequest:i})))},lo=e=>{let{config:t,entitiesMap:n,match:r,onFinishRequest:l,onStartRequest:i}=e;const c=(0,a.useSelector)(y.ZP.selectors.getMetadata),s=(0,a.useSelector)(y.ZP.selectors.getEntity);return o().createElement(eo.M,{match:r,entity:s,entitiesMap:n,metadata:c,className:St.U},o().createElement(Ot.Z,{uri:(0,b.E_P)(s.uri,r.object.uri),relatedObjectUris:(0,b.wp9)(b.q7e.POTENTIAL_MATCH,{entityUri:s.uri,matchEntityUri:r.object.uri}),objectType:b.q7e.POTENTIAL_MATCH}),o().createElement(ao,{match:r,config:t,onStartRequest:i,onFinishRequest:l}))},io=(0,Q.Z)((e=>({root:{display:"flex",flexDirection:"column",minHeight:"52px"},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)"}}))),co={showTransitiveMatches:!0,showInactiveEntities:!1},so={order:b.KM9.asc,field:"score"};var uo;!function(e){e[e.Loading=0]="Loading",e[e.NoData=1]="NoData",e[e.Loaded=2]="Loaded"}(uo||(uo={}));const po=e=>(0,i.pipe)(Ir,jr)(e),mo=po((e=>{let{className:t}=e;const n=Ar();return o().createElement(U.Z,{className:M()(n.stubView,"viewDraggableHandle",t)},"NOT IMPLEMENTED")})),go=po((e=>{let{className:t,config:n}=e;return o().createElement(L.Z,{className:t,caption:n.caption,excludeUris:n.excludeUris,includeUris:n.includeUris,attributesCount:n.attributesCount,pinnedAttributes:n.pinnedAttributes})})),fo=po((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),c=(0,r.useMemo)((()=>({page:o,searchQuery:t,showInactive:l})),[o,t,l]),s=Pe(e,c),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){Ne(e,t,n[t])}))}return e}({setSearchQuery:n,searchQuery:t,setPage:a,page:o,toggleShowInactive:u,showInactive:l},s)})(n);return o().createElement(z.Provider,{value:a},o().createElement(we,{config:n,className:t}))})),ho=po((e=>{let{config:t,className:n}=e;const l=(e=>{var t;const{attributeUri:n}=e,o=(0,a.useSelector)(y.ZP.selectors.getMetadata),l=(0,r.useMemo)((()=>(0,b.zeJ)(o,n)),[o,n]),c=(0,r.useMemo)((()=>l?((e,t)=>(0,i.pipe)(((e,t)=>(0,b.WN0)(e,t)),(0,i.map)((e=>Sn(e,[t]))),(0,i.chain)(b.HQx),(0,i.uniqBy)((0,i.prop)("id")))(e,t))(o,l):[]),[o,l]),s=(0,r.useMemo)((()=>({searchQuery:"",filters:null,sorting:void 0,visibleColumns:c.filter((0,i.pipe)((0,i.prop)("dataTypeDefinition"),b.YkM,i.not)).map((e=>{let{id:t}=e;return t})).slice(0,5),page:0})),[c]),[u,p]=(0,r.useReducer)(pn,s),{searchQuery:d,filters:m,sorting:g,page:f}=u,h=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),v=(0,r.useMemo)((()=>{const e=((e,t)=>b.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,kn.su)(o,r)})))).orSome([]))(c,m);return e.length?e:null}),[m,c]),x=(0,r.useMemo)((()=>(0,i.reject)(i.isNil,{filters:v,page:f,sorting:g,searchQuery:d})),[v,f,g,d]),{changeSearchQuery:E,changePage:w,toggleSort:C,changeFilter:S,toggleFilters:O,changeColumns:P}=(0,rn.o)({actions:un,dispatch:p}),N=Pe(e,x);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){Zn(e,t,n[t])}))}return e}({},u,{setSearchQuery:E,setPage:w,onSort:C,onFilter:S,onToggleFilters:O,onChangeColumns:P,showTable:Boolean(((null==N||null===(t=N.values)||void 0===t?void 0:t.length)||v||d||h)&&l&&!l.hidden),allColumnsData:c},N)})(t);return o().createElement(nn.Provider,{value:l},t&&o().createElement(nr,{config:t,className:n}))})),bo=po((e=>{let{config:t,className:n}=e;const l=(0,a.useSelector)(y.ZP.selectors.getMetadata),c=(0,r.useMemo)((()=>(0,b.fS6)(l,t)),[l,t]),s=(e=>{var t;const n=(0,r.useMemo)((()=>(0,i.pipe)(Object.entries,(0,i.map)((e=>{let[t,n]=e;return{value:t,label:n}})),(0,i.unless)((e=>(0,b.O27)(e)||e.some((0,i.propEq)("value","name"))),(0,i.append)({label:x().text("Name"),value:"name"})))(e.sortOptions||{})),[e.sortOptions]),o=Number(e.max)||15,[a,l]=(0,r.useState)(0),[c,s]=(0,r.useState)(e.sortOrder||"asc"),[u,p]=(0,r.useState)(null===(t=n[0])||void 0===t?void 0:t.value),[d,m]=(0,r.useState)(""),[g,f]=(0,r.useState)(!1),h=(0,r.useCallback)((()=>{l(0),f((e=>!e))}),[]),y=(0,r.useCallback)((()=>{l(0),s((e=>"asc"===e?"desc":"asc"))}),[]),v=(0,r.useCallback)((e=>{l(0),p(e)}),[]);return{searchQuery:d,changeSearchQuery:(0,r.useCallback)((e=>{l(0),m(e)}),[]),sortOrder:c,toggleSortOrder:y,sortOption:u,changeSortOption:v,sortOptions:n,page:a,setPage:l,rowsPerPage:o,showInactive:g,toggleShowInactive:h}})(c);return o().createElement(Ae.Provider,{value:s},o().createElement(tn,{config:c,className:n}))})),yo=po(Zr),vo=po((e=>{let{config:t,className:n}=e;const{id:l,caption:c,graph:u,_showNavigateToGraph:p}=t,m=null==u?void 0:u.type,g=sr(),f=(0,a.useDispatch)(),h=(0,a.useSelector)(y.ZP.selectors.getEntityUri),{treeData:v,setTreeData:E,errorMessage:w,isLoading:C}=((e,t)=>{const n=(0,Ce._)(),[o,l]=(0,r.useState)(!1),[c,s]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),d=(0,a.useSelector)(y.ZP.selectors.getEntity);return(0,Se.D)((()=>{const e=c.map(((e,t)=>({tree:e,index:t}))).reduce(((e,t)=>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){or(e,t,n[t])}))}return e}({},e,{[t.index]:{root:t.tree}})),{}),t=(0,b.XTh)((0,i.pick)(["uri","label","secondaryLabel","type"],d),e);s(t.map((0,i.prop)("root")))}),[null==d?void 0:d.updatedTime]),(0,r.useEffect)((()=>((0,b.ZiX)(e)||(p(null),l(!0),n((0,b.RFJ)({uri:e,graphUri:t})).then(ir).then(s).catch((e=>{console.warn(e),p((0,b.xU7)(e,x().text("Something went wrong")))})).finally((()=>{l(!1)}))),()=>{s([])})),[e,t,n]),{isLoading:o,treeData:c,setTreeData:s,errorMessage:u}})(h,m),{onResize:S,getRowHeight:O,clearHeightsCache:P}=(()=>{const[e,t]=(0,r.useState)({}),n=(0,r.useCallback)((()=>{t({})}),[]);return{onResize:(0,r.useCallback)((e=>(n,r)=>{t((t=>t[Cr(e)]!==r?(0,i.assoc)(Cr(e),r,t):t))}),[]),getRowHeight:(0,r.useCallback)((t=>{let{node:n}=t;return e[Cr(n)]?Math.max(e[Cr(n)],vr.rowHeight):vr.rowHeight}),[e]),clearHeightsCache:n}})(),N=(0,r.useContext)(d.Y),k=void 0!==p?p:N.showNavigateToGraph,Z=(0,r.useMemo)((()=>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){Sr(e,t,n[t])}))}return e}({},N,{showNavigateToGraph:k})),[k,N]),T=(0,r.useCallback)((()=>{f(y.ui.actions.openGraph({viewId:l,graphType:m,entityUri:h}))}),[f,l,m,h]),R=(0,r.useCallback)((e=>({title:o().createElement(s.Z,{handleHeight:!0,refreshMode:"debounce",refreshRate:100,onResize:S(e.node)},o().createElement(mr,{node:e.node}))})),[S]);return(0,r.useEffect)((()=>{P()}),[P,h]),o().createElement(d.Y.Provider,{value:Z},o().createElement(U.Z,{className:n},o().createElement(wr,{onGraphOpen:T,title:c}),C&&o().createElement(j.Z,{className:g.linearIndicator}),o().createElement(pr.Provider,{value:t},o().createElement("div",{className:g.treeContainer},o().createElement("div",{className:g.tree},w?o().createElement(F.Typography,{className:g.errorMessage},w):o().createElement(rr.ZP,{isVirtualized:!1,treeData:v,canDrag:!1,theme:vr,generateNodeProps:R,onChange:E,getNodeKey:gr,rowHeight:O}))))))})),xo=po((e=>{let{config:t,className:n}=e;const l=io(),c=(0,a.useSelector)(y.ZP.selectors.getEntity),s=(0,b.wwR)(c),[u,p]=(0,r.useState)(!1),d=(0,r.useCallback)((()=>{p(!0)}),[]),g=(0,r.useCallback)((()=>{p(!1)}),[]),{matches:f,entitiesMap:h,loadMatches:v}=(0,Jr.s)({enabled:!!s,entity:c,options:co,filter:"",page:0,sorting:so,rowsPerPage:3,onStartLoading:d,onFinishLoading:g}),E=(0,r.useCallback)((()=>{v()}),[v]),w=(0,a.useDispatch)(),S=(0,r.useContext)(m.m),O=(0,r.useCallback)((()=>{w(y.ui.actions.openPerspective({perspectiveId:"potentialMatches",viewId:S}))}),[w,S]),P=(0,r.useMemo)((()=>(0,b.NVY)(s,(0,i.map)(b.ev7,f))),[s,f]),{getCommentsCount:N}=(0,r.useContext)(C.h);(0,r.useEffect)((()=>{N(P)}),[N,P]);const k=!(0,i.isEmpty)(f),Z=u?uo.Loading:(0,i.isEmpty)(f)?uo.NoData:uo.Loaded;return o().createElement(Te.X.Provider,{value:h},o().createElement(U.Z,{className:M()(l.root,n)},o().createElement(B.Z,{title:t.caption}),o().createElement("div",{className:l.matchesContainer},Z===uo.Loading&&o().createElement(j.Z,null),Z===uo.NoData&&o().createElement(F.Typography,{className:l.noData},x().text("No matches found")),Z===uo.Loaded&&f.map((e=>o().createElement(lo,{config:t,entitiesMap:h,match:e,onFinishRequest:E,onStartRequest:d,key:e.object.uri})))),k&&o().createElement(o().Fragment,null,o().createElement("div",{className:l.footer},o().createElement(F.Link,{component:"button",variant:"caption",onClick:O,underline:"none"},x().text("See all"))))))})),Eo=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,91032)).then((e=>({default:po(e.HierarchyTreeView)}))))),wo=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,79417)).then((e=>({default:po(e.RelationshipsTableView)}))))),Co=po((e=>{let{config:t,isFullscreen:n,onToggleFullscreen:l,className:i}=e;const c=Vr(),s=(0,a.useSelector)(y.ZP.selectors.getMetadata),u=(0,a.useSelector)(y.ZP.selectors.getEntity),p=(0,a.useSelector)(y.ZP.selectors.getGoogleMapKey),{markers:d,loading:m}=((e,t,n)=>{const[o,a]=(0,r.useState)([]),[l,i]=(0,r.useState)(!0),c=(0,Ce._)();return(0,r.useEffect)((()=>{i(!0),c((0,b.DBr)(t,[e],n)).then((e=>{a(e.filter(Ur))})).catch((()=>{a([])})).finally((()=>{i(!1)}))}),[e,t,n,c]),{markers:o,loading:l}})(u,s,p),g=(0,r.useMemo)((()=>o().createElement("div",{className:c.fullHeight},o().createElement(j.Z,null))),[c]),f=(0,r.useMemo)((()=>({lat:0,lng:0})),[]),h=(0,r.useMemo)((()=>({mapTypeControl:!0})),[]);return p&&o().createElement(U.Z,{className:M()(c.root,i)},m&&o().createElement(j.Z,null),o().createElement(Hr.Z,{size:"S",icon:n?Lr.Z:Mr.Z,onClick:()=>l(t.id),className:c.fullscreenBtn}),o().createElement(zr.Z,{loadingElement:g,defaultZoom:1,defaultCenter:f,markers:d,mapContainerClassName:c.fullHeight,mapKey:p,mapOptions:h}))})),So=po((e=>{let{config:t,className:n}=e;const{attributeUri:l}=t,c=Qr(),s=(0,a.useDispatch)(),u=(0,a.useSelector)(y.ZP.selectors.getMode),p=(0,a.useSelector)(y.ZP.selectors.getEntityWithDiff),d=(0,a.useSelector)(y.ZP.selectors.getMetadata),m=l?(0,b.zeJ)(d,l):null,g=t["text-empty"]||x().text("No data found"),f=(0,r.useCallback)((e=>s(y.N5.actions.requestNextPageOfAttributeValues(e))),[s]);return o().createElement(U.Z,{className:n},o().createElement(B.Z,{title:t.caption},o().createElement(q.Z,{description:null==m?void 0:m.description})),o().createElement("div",{className:c.container},(()=>{if(m){const e=(0,i.pathOr)([],["attributes",m.name],p),n=(0,i.path)(["attributes","paging",l],p),r=e.length;if((0,b.KIu)(u)){const e={attributeType:m,config:t,paging:n,requestNextPageOfAttributeValues:f};return o().createElement(Yr,e)}if(r>0){const t={attributeValues:e,attributeType:m,imageSize:Kr,paging:n,parentUri:p.uri,requestNextPageOfAttributeValues:f};return o().createElement(o().Fragment,null,o().createElement(Fr.Z,t),o().createElement(Gr,{totalImages:r}))}}return o().createElement(F.Typography,{className:c.noData},g)})()))}));class Oo{}Oo.ViewTypes=b.ZIY,Oo.getComponentBy=(e,t)=>{let{store:n,config:r,className:a,isFullscreen:l,onToggleFullscreen:i}=t;switch(r[e]){case Oo.ViewTypes.HierarchyTree:return o().createElement(Eo,{config:r,store:n,className:a});case Oo.ViewTypes.HierarchyPaths:return o().createElement(vo,{config:r,className:a});case Oo.ViewTypes.RelationsTable:return o().createElement(wo,{config:r,store:n,className:a});case Oo.ViewTypes.Relations:return o().createElement(bo,{config:r,className:a});case Oo.ViewTypes.Attributes:return o().createElement(go,{className:a,config:r});case Oo.ViewTypes.SingleAttribute:return o().createElement(fo,{config:r,className:a});case Oo.ViewTypes.AttributeTable:return o().createElement(ho,{config:r,className:a});case Oo.ViewTypes.Map:return o().createElement(Co,{config:r,isFullscreen:l,onToggleFullscreen:i,className:a});case Oo.ViewTypes.Custom:return o().createElement(yo,{config:r,className:a});case Oo.ViewTypes.ImageAttribute:return o().createElement(So,{config:r,className:a});case Oo.ViewTypes.PotentialMatches:return o().createElement(xo,{config:r,className:a})}},Oo.getComponent=e=>Oo.getComponentBy("class",e)||Oo.getComponentBy("react-class",e)||o().createElement(mo,{className:e.className});const Po=Oo,No=()=>null,ko=(0,r.memo)((e=>{let{config:t,store:n,isFullscreen:a,isAutosize:l,onToggleFullscreen:i}=e;const c=Ar();return o().createElement(r.Suspense,{fallback:o().createElement(No,null)},Po.getComponent({config:t,store:n,className:M()(c.component,{[c.fullHeight]:!l}),isFullscreen:a,onToggleFullscreen:i}))}));ko.displayName="ViewComponent";const Zo=(0,Q.Z)((e=>({item:e.basicView,fixedSizeContainer:{height:"100%"}})));function To(){return To=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},To.apply(this,arguments)}const Ro=["onConfigChanged","onRemove"],jo=e=>{var t;let{layoutItemConfig:n,views:l,className:c,children:s,style:u,isFullscreen:p,onToggleFullscreen:d,AutosizeComponent:m}=e,g=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 f=l.find((e=>{let{id:t}=e;return n.i===t})),h=Zo(),v=(0,a.useSelector)(y.ZP.selectors.getGoogleMapKey),{store:x}=(0,r.useContext)(a.ReactReduxContext);if(!f)return null;const E=f.class===Po.ViewTypes.Custom;if(E&&(null==f||null===(t=f.action)||void 0===t?void 0:t.platform)===b.X1H.CLASSIC)return null;if(f.class===Po.ViewTypes.Map&&!v)return null;const w=(e=>{var t;return null===(t=Object.entries(b.ZIY).find((t=>{let[n,r]=t;return e===r})))||void 0===t?void 0:t[0]})(f.class);return o().createElement("div",To({},(0,i.omit)(Ro,g),{"data-reltio-id":f.id,"data-reltio-class":w||"",style:u,className:M()(c,{[h.item]:!E})}),o().createElement("div",{className:M()({[h.fixedSizeContainer]:!m})},m,o().createElement(ko,{store:x,config:f,isFullscreen:p,onToggleFullscreen:d,isAutosize:Boolean(m)})),s)},Do=(0,Q.Z)({scrollWrapper:{flexGrow:1,overflow:"auto"},scrollableContent:e=>{let{maxWidth:t,scrollbarWidth:n}=e;return{minWidth:t&&t<1024?t-n:1024,height:"100%"}}}),Io=e=>{let{views:t,layout:n,entityUri:a,maxWidth:l,onLayoutChanged:i}=e;const c=(0,r.useRef)(),s=(u=c.current)?u.offsetWidth-u.clientWidth:0;var u;const p=c.current,d=Do({maxWidth:l,scrollbarWidth:s}),m=(0,r.useMemo)((()=>({element:p,priority:["left","right","top","bottom"]})),[p]);return(0,r.useEffect)((()=>{c.current&&(c.current.scrollTop=0)}),[a]),o().createElement("div",{ref:c,className:d.scrollWrapper},o().createElement("div",{className:d.scrollableContent,"data-reltio-id":"reltio-profile-grid"},o().createElement(D.p.Provider,{value:m},o().createElement(I.Z,{LayoutItem:jo,views:t,layout:n,onLayoutChanged:i,draggableHandle:".viewDraggableHandle"}))))};var Ao=n(87685);const Mo=(0,Q.Z)((()=>({closeIcon:{paddingRight:"12px",boxSizing:"content-box","& path":{fill:"#fff"}},snackbar:{"& > div":{flexWrap:"nowrap",alignItems:"baseline"}}}))),Lo=e=>{let{notification:t}=e;const n=Mo({}),l=(0,a.useDispatch)(),i=(0,a.useSelector)(y.ZP.selectors.getAutoCloseInterval),c=t.autoHideDuration||i&&1e3*i||5e3,[s,u]=(0,r.useState)(),[p,d]=(0,r.useState)(!0),m=(0,r.useCallback)(((e,n)=>{"clickaway"!==n&&(l(y.ui.actions.closeNotification(t.id)),d(!1))}),[t]),g=(0,r.useCallback)((()=>{s.cancelAction&&l(s.cancelAction),u(void 0)}),[s]),f=(0,r.useCallback)((()=>{l(s.applyAction),u(void 0),l(y.ui.actions.closeNotification(t.id))}),[s,t]),h=o().createElement(o().Fragment,null,t.actions.map((e=>o().createElement(F.Button,{key:e.label,color:"primary",size:"small",onClick:()=>{e.needConfirmation?u(e):l(e.applyAction),d(!1)}},e.label)))),b=o().createElement(o().Fragment,null,o().createElement(Hr.Z,{className:n.closeIcon,size:"S",icon:Ao.default,onClick:m}),t.text);return o().createElement(o().Fragment,null,o().createElement(F.Portal,{container:document.body},o().createElement(F.Snackbar,{autoHideDuration:c,open:p,classes:{root:n.snackbar},action:h,onClose:m,anchorOrigin:{vertical:"bottom",horizontal:"center"},message:b})),o().createElement(_e.Z,{open:!!s,title:null==s?void 0:s.confirmationText,content:null==s?void 0:s.confirmationDescription,onSave:f,onDiscard:g,saveCaption:x().text("Proceed"),discardCaption:x().text("Cancel")}))},zo=()=>{const e=(0,a.useSelector)(y.ZP.selectors.getNotifications);return e?o().createElement(o().Fragment,null,e.slice(-1).map((e=>o().createElement(Lo,{key:e.id,notification:e})))):null};var Ho=n(72753),Uo=n(43576),Vo=n(64459),Fo=n(3409),Bo=n(79618),Wo=n(22860);function qo(){return qo=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},qo.apply(this,arguments)}const Go=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",qo({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"}))))};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)}const $o=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",_o({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),o().createElement("defs",null,o().createElement("path",{d:"M20.222 6C21.21 6 22 6.8 22 7.778v12.444C22 21.2 21.209 22 20.222 22H7.778C6.79 22 6 21.2 6 20.222V7.778C6 6.8 6.791 6 7.778 6h12.444zM20 8H8v12h12V8zM4 18H2V4c0-1.1.9-2 2-2h14v2H4v14z",id:"svg2383396984a"})),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},o().createElement("mask",{id:"svg2383396984b",fill:"#fff"},o().createElement("use",{xlinkHref:"#svg2383396984a"})),o().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2383396984b)",d:"M0 0h24v24H0z"})))},Yo=(0,Q.Z)({editingButtons:{display:"flex","& button + button":{minWidth:"88px",marginLeft:"8px"}},searchResults:{width:"150px",height:"25px",backgroundColor:"#ccc"},comments:{display:"flex",justifyContent:"flex-end",marginTop:"10px"}});function Xo(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){Qo(e,t,n[t])}))}return e}function Qo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ko=e=>o().createElement(F.SvgIcon,e,o().createElement(Go,null)),Jo=e=>o().createElement(F.SvgIcon,e,o().createElement($o,null)),ea=(e,t,n,r,o)=>e.filter((e=>{let{value:a,permission:l}=e;return!(n&&!(0,b.KIu)(a))&&!!(r&&o||!(0,b.fnZ)(a))&&(0,b.uGe)(l,t)})),ta=e=>{let{className:t,profileBandConfig:n}=e;const l=Yo(),c=(0,a.useDispatch)(),s=(0,a.useSelector)(y.ZP.selectors.getCanUserStartProcessFromQuery),u=(0,a.useSelector)(y.ZP.selectors.getEntityWithoutDiff),p=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,u.uri))),d=(0,a.useSelector)(y.ZP.selectors.getMetadata),m=(0,a.useSelector)(y.ZP.selectors.isWorkflowEnabled),g=(0,a.useSelector)(y.ZP.selectors.getMode),f=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),h=(0,a.useSelector)(y.ZP.selectors.getIsViewMode),v=(0,a.useSelector)(y.ZP.selectors.getIsHistoryModeEnabled),E=(0,a.useSelector)(y.ZP.selectors.getProfileOperation),w=null==u?void 0:u.type,C=(0,r.useMemo)((()=>(0,b.nt9)(d,w)),[w,d]),S=E===b.OXy.Saving,O=E===b.OXy.Cloning||S,[P,N]=(0,r.useState)(!1),k=(0,r.useCallback)((()=>{N(!1)}),[]),Z=(e=>{let{cloneAction:t,onCloneDiscard:n}=e;const o=(0,a.useSelector)(y.ZP.selectors.getEntityWithoutDiff),l=(0,a.useSelector)(y.ZP.selectors.getMetadata),c=(0,a.useDispatch)(),s=null==o?void 0:o.type,u=l.relationTypes,p=(0,r.useCallback)((0,b.Ian)(l,s),[l,s]),d=(0,b.nt9)(l,s),m=(0,r.useMemo)((()=>(0,i.when)((0,i.complement)(i.isNil),(0,i.pipe)((0,i.find)((0,i.pipe)((0,i.propOr)([],"entityTypeUris"),(0,i.either)((0,i.includes)(s),(0,i.includes)("*")))),(0,i.when)((0,i.complement)(i.isNil),(0,i.omit)(["entityTypeUris"]))))(t)),[t,s]),g=(0,r.useCallback)((()=>{if(m){const e=(0,i.pipe)((0,i.prop)("relationshipTypesToCopy"),(0,i.cond)([[i.isNil,(0,i.pipe)((0,i.always)(d),(0,i.propOr)([],"attributes"),(0,i.filter)(b.YkG),(0,i.map)(b.ZaZ))],[(0,i.includes)("*"),(0,i.pipe)((0,i.always)(u||[]),(0,i.map)((0,i.prop)("uri")),(0,i.filter)(p))],[i.T,i.identity]]))(m);c(y.N5.entity.actions.entityCloneRequested({data:Xo({},(0,i.pick)(["attributeReplacementMapping"],m),{relationshipTypesToCopy:e}),entityUri:o.uri}))}n()}),[m,n,d,u,o.uri,p]);return m?g:void 0})({cloneAction:null==n?void 0:n.cloneAction,onCloneDiscard:k}),T=(0,r.useMemo)((()=>[{label:x().text("Editing"),value:b.fO_.EDITING,description:x().text("Edit profile directly"),icon:Uo.Z,permission:"UPDATE"},{label:x().text("Suggesting"),value:b.fO_.SUGGESTING,description:x().text("Suggest changes and initiate a workflow review"),icon:Ko,permission:"INITIATE_CHANGE_REQUEST"},{label:x().text("Viewing"),value:b.fO_.VIEWING,description:x().text("Read or print profile"),icon:Ho.Z,permission:"READ"}]),[]),R=(0,r.useMemo)((()=>[...Z?[{label:x().text("Clone"),value:"Clone",description:x().text("Create a copy of the profile"),icon:Jo,onClick:()=>N(!0),permission:"CREATE"}]:[],{label:x().text("Delete"),value:"Delete",description:x().text("Permanently delete profile"),icon:Je.Z,onClick:()=>{window.confirm(x().text("Are you sure you want to delete this?"))&&c(y.N5.entity.actions.entityRemoveRequested({entityUri:u.uri}))},permission:"DELETE"}]),[c,u.uri,Z]),j=!v&&!(0,b.biM)(u)&&!(e=>(0,b.uGe)(b.BDP.READ,e)&&!(0,b.uGe)(b.BDP.UPDATE,e)&&!(0,b.uGe)(b.BDP.DELETE,e)&&!(0,b.uGe)(b.BDP.INITIATE_CHANGE_REQUEST,e))(C),D=(0,b.ZiX)(null==u?void 0:u.uri),I=(0,r.useMemo)((()=>ea(T,C,D,m,s)),[T,C,m,s,D]),A=(0,r.useMemo)((()=>ea(R,C,D,m,s)),[R,C,m,s,D]),L=(0,r.useCallback)((e=>{c(y.N5.mode.actions.modeUpdated(e))}),[c]),z=(0,r.useCallback)((()=>{c(y.N5.mode.actions.modeCancelEditing())}),[c]),H=(0,r.useCallback)((()=>{c(y.N5.actions.saveProfile())}),[c]);return o().createElement(o().Fragment,null,o().createElement(Vo.Z,{className:M()(t,St.U),entity:f&&p?p:u},o().createElement(F.Box,{display:"flex",alignItems:"center"},o().createElement(F.Box,{mr:3},f&&o().createElement(F.Box,{className:l.editingButtons},o().createElement(F.Button,{variant:"outlined",onClick:z,"data-reltio-id":"reltio-profile-cancel-editing",disabled:O},x().text("Cancel")),o().createElement(F.Button,{variant:"contained",color:"primary","data-reltio-id":"reltio-profile-save-profile",onClick:H,disabled:O},(0,b.fnZ)(g)?x().text("Suggest"):x().text("Save"))),v&&h?o().createElement(Fo.Z,null):h&&o().createElement(Bo.a,null)),j&&o().createElement(Wo.T,{optionsGroup:I,buttonsGroup:A,value:g,onChange:L,disabled:O})),o().createElement(F.Box,{className:l.comments},o().createElement(Ot.Z,{uri:u.uri,relatedObjectUris:(0,b.wp9)(b.q7e.ENTITY,{entityUri:u.uri}),objectType:b.q7e.ENTITY}))),!!Z&&o().createElement(_e.Z,{open:P,title:x().text("Do you want to create a clone of the profile?"),content:x().text("Cloning will create a copy of the current profile. You can modify the cloned profile in the next step. Are you sure you want to proceed?"),onSave:Z,onDiscard:k,saveCaption:x().text("Proceed"),discardCaption:x().text("Cancel")}))};var na=n(97499),ra=n(52043),oa=n(17308);const aa=(0,Q.Z)({wrapper:{display:"flex",overflow:"hidden",flexShrink:0,marginLeft:"3px",height:"100%"},badge:{fontSize:"12px",height:"18px",minWidth:"18px",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px"}});function la(){return la=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},la.apply(this,arguments)}let ia;!function(e){e[e.Workflow=0]="Workflow",e[e.Collaboration=1]="Collaboration",e[e.History=2]="History",e[e.DBConnector=3]="DBConnector"}(ia||(ia={}));const ca=e=>{let{active:t,tabs:n,onClose:a}=e;const l=aa(),c=!(0,i.isNil)(t),{content:s,headerProps:u,hidden:p}=n[t]||{};return(0,r.useEffect)((()=>{p&&a()}),[t,p,a]),o().createElement("div",{className:l.wrapper},o().createElement(ra.h,{open:c},!p&&o().createElement(o().Fragment,null,o().createElement(oa.P,la({},u,{onClose:a})),s)))};var sa=n(71820),ua=n(44021),pa=n(26789),da=n(54362),ma=n(6674),ga=n(91515),fa=n(80147);const ha=(0,Q.Z)({wrapper:{display:"flex",flexDirection:"column"},itemWrapper:{paddingLeft:"19px",paddingRight:"19px"}}),ba=()=>{const e=ha(),t=(0,a.useSelector)(y.ZP.selectors.getDBConnectorSideViews);return o().createElement("div",{className:e.wrapper},t.map((t=>o().createElement(Zr,{key:t.id,config:t,className:e.itemWrapper}))))};var ya=n(76569);const va=()=>{const{total:e}=(0,r.useContext)(k.O),t=aa();return o().createElement(F.Badge,{badgeContent:e,classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(ya.Z,null))};function xa(){return xa=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},xa.apply(this,arguments)}const Ea=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",xa({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"})))))},wa=()=>{const{commentsMap:e}=(0,r.useContext)(C.h),t=aa();return o().createElement(F.Badge,{badgeContent:(0,b.mdt)(e),classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(Ea,null))};function Ca(){return Ca=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},Ca.apply(this,arguments)}const Sa=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",Ca({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),o().createElement("path",{d:"M14.101 16A5.003 5.003 0 0016 18.987V20H2v-4h12.101zM22 18.987V20v-1.013zM4 17v2h2v-2H4zM16 4v1.013A5.004 5.004 0 0014.101 8H2V4h14zm6 0v1.013V4zM6 7V5H4v2h2zm8 3v4H2v-4h12zM4 11v2h2v-2H4zm12 4v-2h6v2c0 1.3-.84 2.4-2 2.82V22h-2v-4.18c-1.16-.42-2-1.52-2-2.82zm0-6c0-1.3.84-2.4 2-2.82V2h2v4.18c1.16.42 2 1.52 2 2.82v2h-6V9z",fill:"#000",fillOpacity:".54"}))};var Oa=n(46626);const Pa=(0,Q.Z)({wrapper:{overflow:"auto",position:"relative",height:"100%"}}),Na=()=>{const e=Pa(),{tasks:t,loading:n}=(0,r.useContext)(k.O);return o().createElement("div",{className:e.wrapper},n&&o().createElement(j.Z,null),t&&t.map((e=>o().createElement(Oa.s,{key:e.taskId,task:e}))))};var ka=n(10159);const Za=()=>o().createElement(ka.Z,{text:x().text("Ready to go with the flow?"),secondaryText:x().text("Suggest a change or submit a match review, and we’ll kick off a workflow task to get things going.")});var Ta=n(26313),Ra=n(9371),ja=n(4426);const Da=(0,Q.Z)({wrapper:{overflow:"auto",paddingRight:"12px"},showMoreLink:{display:"flex",margin:"16px"},showMoreIcon:{fontSize:"1rem"}}),Ia=()=>{const e=Da(),{getComments:t,comments:n,pageToken:l}=(0,r.useContext)(C.h),i=(0,a.useSelector)(y.ZP.selectors.getEntityUriWithDataTenant);(0,r.useEffect)((()=>{t(i)}),[t,i]);const c=(0,Ta.Q)(n);return o().createElement(Te.X.Provider,{value:c},o().createElement(F.Box,{className:e.wrapper},n.map((e=>{const{objectId:t,relatedObjectUris:n,objectType:r,commentId:a}=e;return o().createElement(Ra.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(ja.Z,{className:e.showMoreIcon}),x().text("Show more"))))},Aa=()=>o().createElement(ka.Z,{text:x().text("Care to join the conversation?"),secondaryText:x().text("Leave comments for team members anywhere in the Profile page, and we’ll record it here.")}),Ma=e=>{if(e)return 1===e?x().text("${total} item",{total:e}):x().text("${total} items",{total:e})},La=(0,Q.Z)((()=>({profileContainer:{display:"flex",overflow:"hidden",flexGrow:1}}))),za=(0,r.memo)((e=>{let{perspectiveId:t,commentId:n,hideHistory:l,children:c}=e;const s=La(),{defaultTab:u,tabs:p}=(e=>{let{commentId:t,hideHistory:n,perspectiveId:l}=e;const i=(0,a.useSelector)(y.ZP.selectors.isWorkflowSideViewEnabled),c=(0,a.useSelector)(y.ZP.selectors.isWorkflowEnabled),s=(0,a.useSelector)(y.ZP.selectors.isCollaborationSideViewEnabled),u=(0,a.useSelector)(y.ZP.selectors.isDBConnectorSideViewEnabled),p=(0,a.useSelector)(y.ZP.selectors.isCollaborationEnabled),d=t?ia.Collaboration:void 0,m=(0,a.useSelector)(y.ZP.selectors.getHistoryEvent),g=(0,a.useSelector)(y.ZP.selectors.getMetadata),f=(0,a.useSelector)(y.ZP.selectors.getEntity),h=(0,r.useContext)(k.O),v=(0,r.useContext)(C.h),{isHistoryEnabled:E,isProfilePersisted:w}=(0,sa.C)({perspectiveId:l,entity:f,historyButtonId:ia.History}),{historyFilter:S,onApplyFilter:O,isLoading:P,historicUris:N,historyWithTotal:Z,canLoadMore:T,onLoadMore:R}=(0,ua.k6)({entity:f,enabled:E}),j=i&&c&&!(0,b.ZiX)(null==f?void 0:f.uri),D=s&&p,I=(0,b.mdt)(null==v?void 0:v.commentsMap);return{tabs:(0,r.useMemo)((()=>[{buttonProps:{id:ia.Workflow,icon:va,tooltipTitle:x().text("Workflow")},content:null!=h&&h.total?o().createElement(Na,null):o().createElement(Za,null),headerProps:{mainTitle:x().text("Workflow"),secondTitle:Ma(null==h?void 0:h.total),rightContent:o().createElement(pa.G,null)},hidden:!j},{buttonProps:{id:ia.Collaboration,icon:wa,tooltipTitle:x().text("Collaboration")},content:I?o().createElement(Ia,null):o().createElement(Aa,null),headerProps:{mainTitle:x().text("Collaboration"),secondTitle:Ma(I)},hidden:!D},{buttonProps:{id:ia.History,icon:fa.Z,tooltipTitle:x().text("History")},content:w?o().createElement(da.Z,{isLoading:P,historyWithTotal:Z,contributorsUris:N,entityUri:null==f?void 0:f.uri,historyEvent:m,onLoadMore:R,canLoadMore:T}):o().createElement(ma.Z,null),headerProps:{content:o().createElement(ga.Z,{total:w?((null==N?void 0:N.length)||0)+1:void 0,entityType:(0,b.nt9)(g,null==f?void 0:f.type),filter:S,onApplyFilter:O})},hidden:n},{buttonProps:{id:ia.DBConnector,icon:Sa,tooltipTitle:x().text("D&B Connector")},content:o().createElement(ba,null),headerProps:{mainTitle:x().text("D&B Connector")},hidden:!u}]),[null==h?void 0:h.total,j,I,D,w,P,Z,N,null==f?void 0:f.uri,null==f?void 0:f.type,m,R,T,g,S,O,u]),defaultTab:d}})({commentId:n,hideHistory:l,perspectiveId:t});return o().createElement("div",{className:s.profileContainer},o().createElement(na.n,{defaultTab:u,perspectiveId:t,buttonsProps:(0,i.pipe)((0,i.reject)((0,i.propEq)("hidden",!0)),(0,i.pluck)("buttonProps"))(p)},c,o().createElement(ca,{tabs:p})))}));za.displayName="ProfilePerspectiveView";var Ha=n(39781),Ua=n(16715);const Va="48px",Fa="1px solid rgba(0, 0, 0, .125)",Ba=(0,Q.Z)((e=>({accordion:{borderTop:Fa,borderBottom:Fa,fontSize:"13px",boxShadow:"none","&:not(:first-child)":{borderTop:0},"&:before":{display:"none"},"&$accordionExpanded":{margin:"auto"}},accordionExpanded:{},accordionSummary:{display:"flex",alignItems:"center",height:Va,minHeight:Va,"&$accordionSummaryExpanded":{height:Va,minHeight:Va}},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},errorWrapper:{lineHeight:"18px",display:"flex",flexDirection:"column"},errorTitle:{display:"flex",alignItems:"center"},attributeTypesPath:{color:e.palette.text.secondary},goToIcon:{marginLeft:"4px"},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"}}))),Wa=Ba;var qa=n(38016);const Ga=(0,r.memo)((e=>{let{panels:t,expandedPanelId:n,onToggle:r,ErrorComponent:a}=e;const l=Wa();return t.length>0?o().createElement("div",null,t.map((e=>{let{id:t,icon:i,title:c,items:s,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(qa.Z,null)},i,o().createElement(F.Typography,{className:l.accordionSummaryHeading},c)),o().createElement(F.AccordionDetails,{className:M()(l.accordionDetails,p)},o().createElement("ul",null,s.map(((e,t)=>o().createElement(a,{key:t,error:e}))))))}))):null}));function _a(){return _a=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},_a.apply(this,arguments)}Ga.displayName="ErrorsPanel";const $a=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",_a({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),o().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.245 12.75c0 .825-.467 1.5-1.045 1.5H4.8c-.583 0-1.05-.675-1.05-1.5v-7.5c0-.832.467-1.5 1.05-1.5h8.4c.578 0 1.05.668 1.05 1.5l-.005 7.5zM9.75 9.96v1.642l3-2.805L9.75 6v1.598c-2.918.404-4.08 2.4-4.5 4.402 1.043-1.402 2.415-2.04 4.5-2.04z",fill:"#000",fillOpacity:".54"}))},Ya=(0,i.omit)(["deactivated","path"]),Xa=(0,r.memo)((e=>{let{error:t}=e;const n=Wa(),l=(0,a.useSelector)(y.ZP.selectors.getMetadata),c=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),s=((e,t)=>{let{type:n,source:r,message:o,attributeTypeUri:a="",attributeType:l}=t;if(n===b.NIO.missed&&r===b.zHr.local){const t=l||(0,b.zeJ)(e,a);return t?x().text("${attribute} is required",{attribute:t.label}):o}return o})(l,t),u=(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[b.HAc.attributeValue,b.HAc.relationConnection].includes(t)})).map((e=>{let{label:t}=e;return t})).filter(i.identity).join(" / ")})(t),p=(e=>{let{path:t}=e;return null==t?void 0:t.filter((e=>{let{type:t}=e;return t===b.HAc.attributeValue})).map((0,i.either)((0,i.path)(["valueType","label"]),(0,i.path)(["valueType","name"]))).filter(i.identity).join(" > ")})(t),{highlightError:d}=(0,r.useContext)(R.NY),m=t.uri||t.parentUri&&t.attributeTypeUri;return o().createElement("li",null,o().createElement("div",{className:n.errorWrapper},p&&o().createElement("span",{className:n.attributeTypesPath},p),o().createElement("span",{className:n.errorTitle},s,m&&c&&o().createElement(je.k,{icon:$a,size:"XXS",onClick:()=>d(t),tooltipTitle:x().text("Go to error"),className:n.goToIcon})),u&&o().createElement("span",{className:n.parents},u)))}));Xa.displayName="Error";const Qa=()=>{const e=Wa(),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(Ya),t.map(Ya))}(e,t.current)||(t.current=e),t.current})((0,a.useSelector)(y.ZP.selectors.getProfileErrors)),[n,l]=(0,r.useMemo)((()=>(0,i.partition)(b.IT0,t)),[t]),[c,s]=(0,r.useState)(null),u=(0,r.useMemo)((()=>[{id:"errors",title:x().text("${number} ${errors}",{number:n.length,errors:1===n.length?x().text("error"):x().text("errors")}),icon:o().createElement(Ha.Z,{className:M()(e.icon,e.errorIcon)}),items:n,accordionClassName:e.errorsAccordion,accordionDetailsClassName:e.errorsAccordionDetails},{id:"warnings",title:x().text("${number} ${warnings}",{number:l.length,warnings:1===l.length?x().text("warning"):x().text("warnings")}),icon:o().createElement(Ua.Z,{className:M()(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)((()=>{s("errors")}),[n]);const p=(0,r.useCallback)((e=>(t,n)=>{s(n?e:null)}),[]);return u.length>0?o().createElement(Ga,{panels:u,expandedPanelId:c,onToggle:p,ErrorComponent:Xa}):null};var Ka=n(3096),Ja=n.n(Ka),el=n(60641);function tl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const nl={};var rl=n(61756),ol=n(4109);function al(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ll=(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},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%"}},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"}}))),il=(0,r.memo)((e=>{var t;let{config:n,saveState:l,getSavedState:i,commentId:c}=e;const{maxWidth:s,profileBand:u,workflow:p}=n||{},d=ll({maxWidth:s}),m=(0,a.useSelector)(y.ZP.selectors.getEntity),g=(0,a.useSelector)(y.ZP.selectors.getHistoryEvent),f=(0,a.useSelector)(y.ZP.selectors.getIsHistoryModeEnabled),h=(null===(t=(0,a.useSelector)(y.ZP.selectors.getSearchKeyword))||void 0===t?void 0:t.value)||"",v=(0,a.useSelector)(y.ZP.selectors.getMode),D=(0,a.useDispatch)(),I=(0,E.u)(),A=(e=>{const t=(0,rl.v)(e),n=(0,ol.b)();return(0,r.useMemo)((()=>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){al(e,t,n[t])}))}return e}({},t,{onActionSuccess:n})),[t,n])})(p),{isLoading:M}=(0,w.M)(),{type:L,uri:z}=m||{},H=(0,r.useMemo)((()=>(0,b.dvH)(m)),[m]),U=(0,r.useContext)(C.h),V=(0,S.C)({objectIds:H}),{views:F,layout:B,isLoaded:W,handleLayoutChange:q}=(e=>{let{config:t,entityTypeUri:n,saveState:o,getSavedState:a}=e;const[l,i]=(0,r.useState)([]),[c,s]=(0,r.useState)([]),{canRead:u}=(0,Mn.l)(),p=(0,r.useMemo)((()=>{const e=t.views.filter(u),n=(0,b.sFD)(t.layout,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){tl(e,t,n[t])}))}return e}({},t,{views:e,layout:n})}),[t,u]),d=(0,r.useMemo)((()=>Ja()(p)),[p]),m=null!=p&&p.nestedRoute?`/${p.nestedRoute}`:"",g=n&&p?n+m:null,f=(0,r.useCallback)((()=>a().then((e=>e.layout?{}:e))),[a]),h=(0,r.useCallback)((0,b.DsO)(o,1e3),[o]),{isLoaded:y,savedState:v=nl,updateSavedState:x}=(0,el.w)({getSavedState:f,saveState:h,entityTypeUri:g}),E=(0,r.useCallback)((e=>{x({layout:e,views:c,configHash:d}),i(e)}),[x,d,c]);return(0,r.useEffect)((()=>{if(y){const e=d!==v.configHash,{views:t,layout:n}=(0,b.Mfk)({views:e||!v.views?p.views:v.views,layout:e?p.layout:v.layout});s(t),i(n)}}),[y,v,g]),{views:c,layout:l,isLoaded:y,handleLayoutChange:E}})({config:n,entityTypeUri:L,saveState:l,getSavedState:i});(0,O.a)({entity:m,historyEvent:g}),(()=>{const e=(0,a.useDispatch)(),t=(0,a.useSelector)(y.ZP.selectors.getValidateReadMode),n=(0,a.useSelector)(y.ZP.selectors.getEntity)||{},{uri:o,updatedTime:l}=n,i=(0,b.biM)(n),c=(0,a.useSelector)(y.ZP.selectors.getMode),s=(0,a.useSelector)(y.ZP.selectors.getProfileViews),u=s&&s.length>0,p=(0,r.useCallback)((0,b.DsO)((t=>{t&&e(y.N5.actions.validateProfile())}),500),[e]);(0,r.useEffect)((()=>{const e=t&&!i&&o&&!(0,b.ZiX)(o)&&c===b.ARY.Viewing&&u;p(e)}),[p,i,t,l,o,c,u])})(),(0,r.useEffect)((()=>{D(y.N5.views.actions.profileViewsSet(F))}),[D,F]),(0,r.useEffect)((()=>{n.sidePanelViews&&D(y.N5.sidePanelViews.actions.sidePanelViewsLoaded(n.sidePanelViews))}),[n]);const G=v===b.ARY.Viewing&&(0,b.ZiX)(z),_=e=>o().createElement("div",{className:d.emptyState},o().createElement(P.ZP,{LogoRenderer:P.B9.NO_DATA,text:e,variant:P.tC.embedded}));return o().createElement(N.j.Provider,{value:!0},o().createElement(C.e,{collaboration:f?U:V},o().createElement(k.O.Provider,{value:A},o().createElement(Z.m.Provider,{value:I},o().createElement(T.l.Provider,{value:h},o().createElement(R.fy,null,o().createElement("div",{className:d.perspectiveView},W&&z?o().createElement(za,{commentId:c,perspectiveId:"profile"},o().createElement("div",{className:d.profileWrapper},o().createElement(ta,{profileBandConfig:u}),M?_(x().text("Loading")):o().createElement(o().Fragment,null,!f&&o().createElement(Qa,null),!G&&o().createElement(Io,{maxWidth:s,views:F,layout:B,entityUri:z,onLayoutChanged:q})))):o().createElement(o().Fragment,null,o().createElement(j.Z,null),_(x().text("No data to display."))),o().createElement(zo,null))))))))}));function cl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}il.displayName="ProfilePerspectiveView";const sl=(0,c.createGenerateClassName)({productionPrefix:"profilePerspective",disableGlobal:!0});b.oss.register("profile",((e,t)=>{const n=e=>(0,i.sort)(((e,t)=>e.x>t.x||e.x===t.x&&e.y>t.y?1:-1),e),r=(0,i.map)((e=>(0,i.evolve)({layout:(0,i.pipe)(n,(0,i.map)((0,i.ifElse)((0,i.propEq)("autosizing",!0),(0,i.omit)(["y","height","minHeight","maxHeight"]),(0,i.omit)(["y","minHeight","maxHeight"]))))},e)));return(0,b.l22)(r(e),r(t))}));const ul=e=>{let{config:t,store:n,onResize:v=i.identity,saveState:x,getSavedState:E,qxSandboxApi:w,commentId:C}=e;const S=(0,r.useCallback)((0,b.aYu)(E),[E]),{SnackbarRenderer:O,showSnackbarMessage:P}=(0,p.D)(),N=(0,r.useMemo)((()=>t&&(0,b.Vr9)(t)),[t]),k=(0,r.useContext)(d.Y),Z=y.ZP.selectors.getShowAttributeDescription(n.getState()),T=(0,r.useMemo)((()=>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){cl(e,t,n[t])}))}return e}({},k,{showDescription:Z})),[k,Z]);return o().createElement(a.Provider,{store:n},o().createElement(m.m.Provider,{value:null==N?void 0:N.id},o().createElement(g.S.Provider,{value:P},o().createElement(f.Y.Provider,{value:w},o().createElement(c.StylesProvider,{generateClassName:sl},o().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},o().createElement(d.Y.Provider,{value:T},o().createElement(o().Fragment,null,o().createElement(s.Z,{handleHeight:!0,onResize:(e,t)=>v(Math.floor(e),Math.floor(t))}),N&&o().createElement(il,{config:N,saveState:x,getSavedState:S,commentId:C}),o().createElement(h.Z,{showErrorFromStore:!0}),o().createElement(O,null)))))))))};var pl=n(82842),dl=n(51229),ml=n(91131);const gl=(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}}))),fl=e=>{let{total:t=0}=e;const n=gl(),l=(0,a.useDispatch)(),i=(0,r.useContext)(m.m),c=(0,r.useCallback)((()=>{l(y.ui.actions.openPerspective({perspectiveId:"profile",viewId:i}))}),[l,i]);return o().createElement(B.Z,{title:""},o().createElement("div",{className:n.titleContainer},o().createElement(F.Link,{component:"button",variant:"caption",className:n.link,onClick:c,underline:"none"},x().text("Profile")),o().createElement(ml.Z,{className:n.icon}),x().text("Tags")),o().createElement(dl.Z,null),o().createElement(F.Typography,{className:n.totalCaption,variant:"caption"},o().createElement("span",{className:n.totalNumber},x().number(t,"0,0")),x().text("total profiles")))};var hl=n(20404);const bl=(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"}}))),yl=e=>{let{label:t}=e;const n=bl();return o().createElement(F.Toolbar,{className:n.toolbar},o().createElement(hl.Z,{className:n.avatar}),o().createElement(F.Typography,{variant:"h6",className:n.label},t))};function vl(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){xl(e,t,n[t])}))}return e}function xl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const El=(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}}))),wl=[25,50,100],Cl=(0,r.memo)((e=>{let{tag:t,entityUri:n}=e;const l=El(),[c,s]=(0,r.useState)(wl[0]),[u,p]=(0,r.useState)(0),d=(0,a.useSelector)(y.ZP.selectors.getGlobalSearchRequestOptions);(0,r.useEffect)((()=>{p(0)}),[t,n,d]);const{isLoading:m,total:g,entities:f}=(e=>{let{tag:t,entityUri:n,page:o=0,rowsPerPage:l=50}=e;const c=(0,a.useDispatch)(),s=(0,Ce._)(),u=(0,Ce._)(),[p,d]=(0,r.useState)(!1),[m,g]=(0,r.useState)(0),[f,h]=(0,r.useState)([]),{requestEntities:v,requestTotal:E}=(e=>{let{entityUri:t,tag:n}=e;const o=(0,a.useSelector)(y.ZP.selectors.getGlobalSearchRequestOptions),l=(0,a.useSelector)(y.ZP.selectors.getTenant),c=(0,a.useSelector)(y.ZP.selectors.getDtssPath),s=(0,r.useMemo)((()=>(0,b.Do$)(t)),[t]),u=(0,r.useMemo)((()=>[{filter:"equals",fieldName:"tags",values:[n]}]),[n]),p=!!s,d=(0,r.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=vl({select:"uri,label,type,secondaryLabel,defaultProfilePicValue,startDate,endDate"},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return p?(0,b.uqV)({filters:e,options:t,customerTenant:l,dataTenant:s,dtssPath:c}).then((0,i.map)((0,b.E7G)(s))):(0,b.ZOr)(e,t)}),[p,s,l,c]);return{requestEntities:(0,r.useCallback)(((e,t)=>d(u,vl({offset:t,max:e},o))),[u,o,d]),requestTotal:(0,r.useCallback)((()=>{const e=o;return(p?(0,b.J$m)({filters:u,options:e,customerTenant:l,dataTenant:s,dtssPath:c}):(0,b.j_Q)(u,e)).then((e=>e.total))}),[u,o,p,s,l,c])}})({entityUri:n,tag:t}),w=(0,r.useCallback)((e=>{c(y.ui.actions.errorSet((0,b.xU7)(e,x().text("Something went wrong")))),g(0)}),[c]);return(0,r.useEffect)((()=>{s(E()).then(g).catch(w)}),[E,s,w]),(0,r.useEffect)((()=>{d(!0),u(v(l,o*l)).then(h).catch(w).finally((()=>d(!1)))}),[o,l,v,u,w]),{isLoading:p,total:m,entities:f}})({tag:t,entityUri:n,page:u,rowsPerPage:c}),h=(0,r.useRef)(null);(0,r.useEffect)((()=>{h.current&&(h.current.scrollTop=0)}),[f]);const v=g>wl[0];return o().createElement("div",{className:l.perspectiveView},o().createElement(yl,{label:t}),o().createElement("div",{className:M()(l.tagsContainer,{[l.fullHeight]:v})},o().createElement(U.Z,{className:l.tagsView},o().createElement(fl,{total:g}),o().createElement("div",{className:l.listContainer},m&&o().createElement(j.Z,null),g>0&&o().createElement("div",{className:l.entitiesList,ref:h},o().createElement(pl.Z,{entities:f})),v&&o().createElement("div",{className:l.pagination},o().createElement(V.Z,{count:g,rowsPerPageOptions:wl,rowsPerPage:c,page:u,onChangePage:p,onChangeRowsPerPage:s}))))))}));Cl.displayName="TagPerspectiveView";const Sl=(0,c.createGenerateClassName)({productionPrefix:"tagPerspective",disableGlobal:!0}),Ol=e=>{let{config:t,tag:n,entityUri:r,store:l,onResize:u=i.identity}=e;return o().createElement(a.Provider,{store:l},o().createElement(m.m.Provider,{value:t.id},o().createElement(c.StylesProvider,{generateClassName:Sl},o().createElement(s.Z,{handleHeight:!0,onResize:(e,t)=>u(Math.floor(e),Math.floor(t))}),t&&o().createElement(Cl,{tag:n,entityUri:r}),o().createElement(h.Z,{showErrorFromStore:!0}))))};var Pl=n(65321);const Nl=(0,Q.Z)((()=>({actionsWrapper:{display:"flex","& button + button":{width:"88px",marginLeft:"8px"}}}))),kl=()=>{const e=Nl(),t=(0,a.useSelector)(y.ZP.selectors.getEntity),{tasks:n}=(0,r.useContext)(k.O),l=(0,r.useMemo)((()=>null==n?void 0:n.find((e=>e.objectURIs.includes((0,b.$Rg)(t.uri))))),[t.uri,n]);return o().createElement(Vo.Z,{entity:t},o().createElement("div",{className:e.actionsWrapper},l&&o().createElement(Pl.o,{task:l})))};function Zl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Tl=(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},perspectiveContainer:{display:"flex",flexGrow:1,overflow:"hidden"},attributesWrapper:{margin:"15px",flexGrow:1,overflowY:"auto",backgroundColor:"#FAFAFA"},contentWrapper:{display:"flex",flexDirection:"column",overflow:"hidden",flexGrow:1}}))),Rl={processTypes:["dataChangeRequestReview"]},jl=(0,r.memo)((()=>{const e=Tl(),t=(0,a.useDispatch)(),n=(e=>{const t=(0,a.useDispatch)(),n=(0,a.useSelector)(y.ZP.selectors.getEntityUri),o=(0,rl.v)(e),l=(0,r.useCallback)((e=>{"Reject"===e&&t(y.ui.actions.openPerspective({perspectiveId:null,viewId:null})),"Approve"===e&&t(y.ui.actions.openEntity({uri:(0,b.$Rg)(n),viewId:null}))}),[t,n]);return(0,r.useMemo)((()=>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){Zl(e,t,n[t])}))}return e}({},o,{onActionSuccess:l})),[o,l])})(Rl),l=(0,a.useSelector)(y.ZP.selectors.getEntity);(0,r.useEffect)((()=>{t(y.N5.sidePanelViews.actions.sidePanelViewsLoaded([{id:"common",views:[{point:"com.reltio.plugins.ui.view",id:"com.reltio.plugins.entity.side.WorkflowsView",class:"com.reltio.plugins.entity.side.WorkflowsView"}]}]))}),[t]);const i=!n.loading&&!!l.uri;return o().createElement(k.O.Provider,{value:n},o().createElement("div",{className:e.perspectiveView},!i&&o().createElement(j.Z,null),o().createElement("div",{className:e.perspectiveContainer},i?o().createElement(za,{hideHistory:!0,perspectiveId:"dcrCard"},o().createElement("div",{className:e.contentWrapper},o().createElement(kl,null),o().createElement("div",{className:e.attributesWrapper},o().createElement(L.Z,null)))):o().createElement(P.ZP,{LogoRenderer:P.B9.NO_DATA,text:x().text("No data to display."),variant:P.tC.embedded}))))}));function Dl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}jl.displayName="DCRReviewPerspectiveView";const Il=(0,c.createGenerateClassName)({productionPrefix:"dcrReviewPerspective",disableGlobal:!0}),Al=e=>{let{config:t,store:n,onResize:p=i.identity}=e;const g=(0,r.useContext)(d.Y),f=y.ZP.selectors.getShowAttributeDescription(n.getState()),b=(0,r.useMemo)((()=>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){Dl(e,t,n[t])}))}return e}({},g,{showDescription:f})),[g,f]);return o().createElement(a.Provider,{store:n},o().createElement(m.m.Provider,{value:t.id},o().createElement(c.StylesProvider,{generateClassName:Il},o().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},o().createElement(d.Y.Provider,{value:b},o().createElement(s.Z,{handleHeight:!0,onResize:(e,t)=>p(Math.floor(e),Math.floor(t))}),o().createElement(jl,null),o().createElement(h.Z,{showErrorFromStore:!0}))))))}},79417:(e,t,n)=>{n.r(t),n.d(t,{RelationshipsTableView:()=>qe});var r=n(8598),o=n(24328),a=n.n(o),l=n(44443),i=n(17440),c=n(52730),s=n(49885),u=n(50757),p=n(65549),d=n(94079),m=n(13980),g=n.n(m),f=n(87918),h=n.n(f),b=n(79692);const y=(0,b.Z)({addButton:{marginLeft:"12px",padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)"},label:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"}}),v=e=>{let{onClick:t}=e;const n=y();return a().createElement(d.Button,{color:"primary",className:n.addButton,onClick:t},a().createElement(p.Z,{classes:{root:n.icon}}),a().createElement("div",{className:n.label},h().text("Add")))};v.propTypes={onClick:g().func};const x=v;var E=n(71153),w=n.n(E);const C={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},S={color:"rgba(0,0,0,.54)"},O=(0,b.Z)((e=>({headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"12px"},entityCell:{display:"flex",alignItems:"center",height:"100%"},entityLabel:{fontSize:"15px",color:e.palette.primary.main,cursor:"pointer",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap","$row-cell--removed &":C,"$row-cell--inactive &":S},entityAvatar:{transform:"scale(0.7)",margin:"0 10px"},rowCell:{fontSize:"13px",overflow:"hidden"},description:{marginLeft:"-22px"},"row-cell--sorted":{color:"rgba(0,0,0,0.87)"},"row-cell--removed":{pointerEvents:"none","& > :not($entityCell)":C},"row-cell--inactive":S})));function P(){return P=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},P.apply(this,arguments)}const N=e=>{let{cell:t,CellValueRenderer:n,rowValue:{connection:r},isSorted:o}=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","rowValue","isSorted"]);const i=O(),c=(0,u.$qe)(r),s=(0,u.Fn9)(r.relation)&&(0,u.Fn9)(r.entity);return a().createElement("div",{className:w()({[i["row-cell--sorted"]]:o,[i["row-cell--removed"]]:c,[i["row-cell--inactive"]]:!s},i.rowCell)},t.values.map(((e,t)=>a().createElement(n,P({key:t,value:e},l)))))};N.propTypes={rowValue:g().object,cell:g().object,CellValueRenderer:g().elementType,isSorted:g().bool};const k=N;var Z=n(85709),T=n(94656),R=n(47898),j=n(34e3),D=n(95613);const I=e=>{let{value:{entityType:t,entity:n}}=e;const r=(0,c.useDispatch)(),l=(0,o.useContext)(R.m),p=O(),d=(0,u.idV)(n.entityLabel),m=(0,u.wwR)({uri:n.entityUri,dataTenant:n.dataTenant});return a().createElement("div",{className:p.entityCell},a().createElement(j.Z,{className:p.entityAvatar,entityType:t}),a().createElement(D.Z,{value:d},a().createElement("span",{className:p.entityLabel,onClick:(0,i.pipe)((0,i.always)({uri:m,viewId:l}),s.ui.actions.openEntity,r)},d)))};I.propTypes={value:g().shape({entity:g().shape({entityUri:g().string,entityLabel:g().string}),entityType:u.p8l})};const A=I;var M=n(92332),L=n(98448);const z=(0,n(67353).Z)((e=>{const t=O(),{description:n}=(null==e?void 0:e.headCellData)||{};return a().createElement("div",{className:t.headCell},a().createElement(M.default,e),a().createElement(L.Z,{description:n,className:t.description}))}));var H=n(64091);const U=(0,i.pipe)((0,i.map)((e=>e.uri||e)),i.uniq);function V(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const F=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),B=e=>{if(e.startsWith("relation.attributes")){const t=F(e);return t.length>1?t.slice(0,-1):null}return null},W=(0,i.map)((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){V(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:B(e.id),headCellRenderer:z,rowCellValueRenderer:(t=e.id,"entity.label"===t?A:H.Z)});var t})),q=(0,b.Z)({tableContainer:{display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},emptyData:{marginBottom:"30px"},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"row-cell__buttons-container":{position:"absolute"},"row-cell__buttons-wrapper":{display:"flex",paddingLeft:"10px","& > button":{marginLeft:"-10px",transform:"scale(0.9)"}}});var G=n(27604),_=n(22983);const $=e=>{let{canUpdate:t,canRemove:n,handleEditRelation:r,handleRemoveRelation:o}=e;return a().createElement(a().Fragment,null,t&&a().createElement(d.Tooltip,{title:h().text("Edit")},a().createElement(d.IconButton,{onClick:r},a().createElement(G.Z,null))),n&&a().createElement(d.Tooltip,{title:h().text("Remove")},a().createElement(d.IconButton,{onClick:o},a().createElement(_.Z,null))))};$.propTypes={canUpdate:g().bool,canRemove:g().bool,handleEditRelation:g().func,handleRemoveRelation:g().func};const Y=$;function X(){return X=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},X.apply(this,arguments)}const Q=e=>{let{mode:t,columnsData:n,connections:r,metadata:l,sorting:c,onSort:p,filters:d,onFilter:m,onEditRelation:g,onRemoveRelation:f,basicTableRef:h,allowOnlyCreateNew:b}=e;const y=(0,o.useMemo)((()=>((e,t,n)=>e.map((e=>(0,i.pipe)((0,i.reduce)(((t,r)=>{let{id:o}=r;return(0,i.assoc)(o,((e,t,n)=>{let{entity:r,relation:o}=t;switch(e){case"entity.label":return{entity:r,entityType:(0,u.nt9)(n,r.entityType)};case"relation.label":return o.relationLabel||(0,u.Lmx)(n,o.relationType);case"relation.activeness.startDate":return o.startDate;case"relation.activeness.endDate":return o.endDate;default:return((e,t)=>(0,i.pipe)((0,i.path)(["object","attributes"]),(0,u.tT_)(e))(t))(F(e),o)}})(o,e,n),t)}),{}),(0,i.assoc)("connection",e))(t))))(r,n,l)),[r,n,l]),v=(0,o.useMemo)((()=>W(n)),[n]),x=q(),E=(0,o.useCallback)((e=>a().createElement(k,X({},e,{isSorted:!!c&&c.field===e.columnData.id}))),[c]),[w,C]=(0,o.useState)(null),{canRemove:S,canUpdate:O}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:o,onEditRelation:a,allowOnlyCreateNew:l}=e;const i=(0,u.xvW)(r);if(s.N5.mode.selectors.getIsEditableMode(n)&&r&&(!l||i)){const{relation:{relationType:e}}=r,l=(0,u.$qe)(r),i=(0,u.V3K)(t,e);return{canRemove:o&&!l&&(0,u.Edd)(n,i),canUpdate:a&&!l&&(0,u.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:t,onRemoveRelation:f,onEditRelation:g,metadata:l,allowOnlyCreateNew:b,connection:(0,i.path)([w,"connection"],y)}),P=(0,o.useCallback)((e=>C(e)),[]),N=(0,o.useCallback)((()=>g((0,i.path)([w,"connection"],y))),[w,g,y]),T=(0,o.useCallback)((()=>f((0,i.path)([w,"connection","relation","relationUri"],y))),[w,f,y]),R=S||O?a().createElement(Y,{handleEditRelation:N,handleRemoveRelation:T,canRemove:S,canUpdate:O}):void 0;return a().createElement("div",{className:x.tableContainer},a().createElement(Z.Z,{autosizing:!0,maxHeight:477,columnsData:v,rowsData:y,sorting:c,onSort:p,filters:d,onFilter:m,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,renderRowCell:E,onRowHover:P,hoverRowIndex:w,hoveredRowRightContent:R,classes:{hoveredRowRightContentWrapper:x["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:x["row-cell__buttons-container"]},ref:h,resizeDebounceDelay:150}))};Q.propTypes={mode:g().string,columnsData:T.uz,connections:g().arrayOf(u.Rjq),metadata:u.pGS,filters:g().objectOf(T.Dq),onFilter:g().func,sorting:T.nI,onSort:g().func,onEditRelation:g().func,onRemoveRelation:g().func,basicTableRef:g().shape({current:g().object}),allowOnlyCreateNew:g().bool};const K=Q;var J=n(93416),ee=n(75512),te=n(30553),ne=n(32152),re=n(1876),oe=n(60894),ae=n(43054),le=n(8818);const ie=(0,b.Z)((()=>({popupContent:{padding:"19px 23px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"}}))),ce=e=>{let{className:t,showInactive:n,onShowInactiveChange:r}=e;const l=ie(),i=(0,o.useRef)(),[c,s]=(0,o.useState)(!1),u=()=>s((e=>!e));return a().createElement(a().Fragment,null,a().createElement(le.k,{className:t,ref:i,tooltipTitle:h().text("More"),icon:ae.Z,onClick:u,size:"L"}),a().createElement(d.Popover,{open:c,classes:{paper:l.popupContent},anchorEl:i.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},a().createElement(d.FormControlLabel,{classes:{label:l.checkboxControlLabel},control:a().createElement(d.Checkbox,{className:l.checkboxControlCheckbox,checked:n||!1,onChange:e=>r(e.target.checked)}),label:h().text("Show inactive Relationships")})))},se=(0,b.Z)({header:{padding:"0 4px 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"},moreButton:{marginLeft:"-6px"}}),ue=e=>{let{title:t,total:n,searchQuery:r,onChangeSearchQuery:o,filtersEnabled:l,onToggleFilters:i,columnsData:c,selectedColumns:s,onChangeColumns:u,showInactive:p,onChangeShowInactive:m}=e;const g=se();return a().createElement(J.Z,{title:t,className:g.header},a().createElement(ee.Z,{widthToHide:500},a().createElement(te.Z,{height:24,margin:16}),a().createElement(d.Typography,{className:g.totalCaption,variant:"caption"},n>1?h().text("${count} entities",{count:n}):h().text("${count} entity",{count:n}))),a().createElement(ne.i,{query:r,onChange:o}),a().createElement(re.Z,{enabled:l,onClick:i}),a().createElement(te.Z,{height:24,margin:4}),a().createElement(oe.Z,{columnsData:c,selectedColumns:s,onChangeColumns:u}),a().createElement(ce,{className:g.moreButton,showInactive:p,onShowInactiveChange:m}))};ue.propTypes={title:g().string,total:g().number,columnsData:T.uz,selectedColumns:g().arrayOf(g().string),onChangeColumns:g().func,searchQuery:g().string,onChangeSearchQuery:g().func,filtersEnabled:g().bool,onToggleFilters:g().func,showInactive:g().bool,onChangeShowInactive:g().func};const pe=ue;var de=n(26180),me=n(31276);function ge(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){fe(e,t,n[t])}))}return e}function fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const he="CHANGE_SEARCH_QUERY",be="CHANGE_SHOW_INACTIVE",ye=ge({},de.ZP.actions,{changeSearchQuery:(0,me.zD)(he),changeShowInactive:(0,me.zD)(be)}),ve=(e,t)=>{switch(t.type){case he:return ge({},e,{searchQuery:t.payload,page:0});case be:return ge({},e,{showInactive:t.payload});default:return de.ZP.reducer(e,t)}};var xe=n(26481),Ee=n(87451),we=n(37152),Ce=n(52016),Se=n(10237),Oe=n(11013),Pe=n(58662),Ne=n(99136);const ke=[10,25,50,100],Ze=[{id:"entity.label",get label(){return h().text("Entity label")},dataTypeDefinition:{type:u.oS0.TYPE_STRING},hideable:!1},{id:"relation.label",get label(){return h().text("Directional label")},dataTypeDefinition:{type:u.oS0.TYPE_STRING}},{id:"relation.activeness.startDate",get label(){return h().text("Start date")},dataTypeDefinition:u.PY2.startDate},{id:"relation.activeness.endDate",get label(){return h().text("End date")},dataTypeDefinition:u.PY2.endDate}],Te=(0,i.pipe)(u.Tde,(0,i.concat)("relation.")),Re=(0,i.pipe)((0,i.map)((e=>({id:Te(e.uri),label:e.label,description:e.description,dataTypeDefinition:(0,u.PFL)(e)}))),(0,i.uniqBy)((0,i.prop)("id"))),je=(0,i.pipe)(((e,t)=>{let{content:{inRelations:n=[],outRelations:r=[]}}=e,{relationTypes:o}=t;return(0,i.pipe)(U,(0,i.chain)((e=>(0,i.pipe)((0,i.find)((0,i.propEq)("uri",e)),u.DK$)(o))))([...n,...r])}),Re,(0,i.concat)(Ze));var De=n(37754);const Ie=(0,b.Z)({addArea:{display:"flex",alignItems:"center",height:"48px",borderBottom:"1px solid rgba(0, 0, 0, 0.12)"},noData:{fontSize:"13px",paddingLeft:"20px",marginBottom:"20px",marginTop:"10px",color:"rgba(0,0,0,0.54)"}});function Ae(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Me=(0,i.pluck)("id",Ze),[Le]=Me;function ze(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const He=(0,i.memoizeWith)(((e,t)=>t.id),u.fS6),Ue=(0,c.connect)(((e,t)=>{const{config:n}=t;return{connections:s.ZP.selectors.getConnectionsWithDraftsByViewId(e,n.id),total:s.ZP.selectors.getTotalByViewId(e,n.id),entity:s.ZP.selectors.getEntity(e),metadata:s.ZP.selectors.getMetadata(e),mode:s.ZP.selectors.getMode(e),relationToAdd:s.ZP.selectors.getRelationToAddByViewId(e,n.id),relationsToEdit:s.ZP.selectors.getRelationsToEditByViewId(e,n.id),checkIfCanAddRelations:s.ZP.selectors.getCheckIfCanAddRelations(e,n.content)}}),void 0,((e,t,n)=>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){ze(e,t,n[t])}))}return e}({},e,t,n,{config:He(e.metadata,n.config)})))((e=>{let{className:t,config:n,entity:r,metadata:l,connections:p=[],total:m=0,mode:g,relationToAdd:f,relationsToEdit:b=[],checkIfCanAddRelations:y,dispatch:v,readOnlyMode:E}=e;const w={searchQuery:"",filters:null,visibleColumns:Me,sorting:{order:n.sortOrder||"asc",field:n.sortColumn||Le},page:0,rowsPerPage:n.max||15,showInactive:!1},C=Ie(),S=(0,o.useContext)(xe.j)?g:u.fO_.VIEWING,[O,P]=(0,o.useReducer)(ve,w),N=(0,i.pipe)(ye.changeSearchQuery,P),k=(0,i.pipe)(ye.changeShowInactive,P),Z=(0,o.useContext)(Ee.Y),T=(0,c.useSelector)(s.ZP.selectors.getShowAttributeDescription),R=(0,o.useMemo)((()=>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){Ae(e,t,n[t])}))}return e}({},Z,{showDescription:T})),[Z,T]);(0,o.useEffect)((()=>{N("")}),[null==r?void 0:r.uri]);const{visibleColumns:j,searchQuery:D,filters:I,sorting:A,page:M,rowsPerPage:L,showInactive:z}=O,H=(0,o.useMemo)((()=>je(n,l)),[n,l]),U=(0,o.useMemo)((()=>j.map((e=>H.find((0,i.propEq)("id",e))))),[j,H]),V=(0,o.useMemo)((()=>((e,t,n)=>{const r=u.wSh.fromFalsy(e).map(u.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome(""),o=(0,De.Tz)(n,t);return(new u.MEy).addClause(r).addClause(o).build()})(D,I,U)),[I,D]),{isLoading:F}=(0,we.a)({sorting:A,filter:V,page:M,rowsPerPage:L,config:n,entity:r,relationActivityFilter:z?u.Ng6.ALL:u.Ng6.ACTIVE_ONLY,mode:g}),B=(0,o.useMemo)((()=>{return e=w.rowsPerPage,ke.filter((t=>t!==e)).concat(e).sort(i.subtract);var e}),[]),{handleRowsPerPageChange:W,handlePageChange:q}=(0,o.useMemo)((()=>({handleRowsPerPageChange:(0,i.pipe)(ye.changeRowsPerPage,P),handlePageChange:(0,i.pipe)(ye.changePage,P)})),[]),G=(0,o.useCallback)((()=>{const e=(0,u.vlo)({config:n,mode:S,metadata:l,parentEntityUri:void 0});(0,i.pipe)(s.N5.relations.actions.openRelationEditor(n.id),v)(e)}),[n,S,l,v]),_=(0,o.useCallback)((e=>{v(s.N5.relations.actions.closeRelationEditor(n.id,e)),v(s.N5.relations.actions.removeRelation(n.id,e));const t=p.find((t=>s.N5.relations.selectors.getRelationUriFromConnection(t)===e)),r=s.N5.relations.selectors.getEntityUriFromConnection(t);(0,u.ZiX)(r)&&v(s.N5.modifiedEntities.actions.entityDeleted(r))}),[n,p,v]),$=r&&y&&!E,Y=f?[f,...b]:b,{canUpdate:X,canDelete:Q}=(0,Ce.l)(),J=X(n)&&!E,ee=Q(n)&&!E,te=(0,o.useRef)(null);return a().createElement(Ee.Y.Provider,{value:R},a().createElement(Se.Z,{className:t},a().createElement(pe,{title:n.caption,total:m,columnsData:H,selectedColumns:j,onChangeColumns:(0,i.pipe)(ye.changeColumns,P),searchQuery:D,onChangeSearchQuery:N,filtersEnabled:!!I,onToggleFilters:(0,i.pipe)(ye.toggleFilters,P),showInactive:z,onChangeShowInactive:k}),$&&a().createElement("div",{className:C.addArea},a().createElement(x,{onClick:G})),Y.map((e=>a().createElement(Oe.Z,{key:s.N5.relations.selectors.getRelationUriFromConnection(e),connection:e,config:n,mode:S,metadata:l}))),a().createElement("div",{style:{position:"relative"}},a().createElement(K,{mode:S,columnsData:U,connections:p,metadata:l,filters:I,onFilter:(0,i.pipe)(ye.changeFilter,P),sorting:A,onSort:(0,i.pipe)(ye.toggleSort,P),onEditRelation:J?(0,i.pipe)(s.N5.relations.actions.openRelationEditor(n.id),v):null,onRemoveRelation:ee?_:null,basicTableRef:te,allowOnlyCreateNew:n.allowOnlyCreateNew}),p.length?a().createElement(Pe.Z,{count:m,rowsPerPageOptions:B,rowsPerPage:L,onChangeRowsPerPage:W,page:M,onChangePage:q,basicTableRef:te}):a().createElement(d.Typography,{className:C.noData},h().text("No data found")),F&&a().createElement(Ne.Z,null))))}));var Ve=n(36138),Fe=n(22664),Be=n(585);const We=(0,Ve.createGenerateClassName)({productionPrefix:"relTable",disableGlobal:!0}),qe=e=>{let{config:t,store:n,onResize:o=i.identity,className:s,readOnlyMode:u}=e;return a().createElement(c.Provider,{store:n},a().createElement(R.m.Provider,{value:t.id},a().createElement(Ve.StylesProvider,{generateClassName:We},a().createElement(Fe.MuiPickersUtilsProvider,{utils:r.Z},a().createElement(l.Z,{handleHeight:!0,onResize:(e,t)=>o(Math.floor(e),Math.floor(t))}),t&&a().createElement(Ue,{config:t,className:s,readOnlyMode:u}),a().createElement(Be.Z,null)))))}},1242:(e,t,n)=>{e.exports=n.p+"5271a9e7b6651c852e93.png"}}]);
|
|
2
2
|
//# sourceMappingURL=6578.js.map
|