@reltio/remotes 1.4.1476 → 1.4.1477
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/8213.js +1 -1
- package/8213.js.map +1 -1
- package/package.json +1 -1
package/8213.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[8213],{8213:(e,t,n)=>{n.d(t,{vC:()=>Cl,_n:()=>Ja,tM:()=>gl});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(39450),g=n(97094),f=n(60115),h=n(585),b=n(47401),y=n(49885),v=n(87918),x=n.n(v),E=n(76536),w=n(41564),C=n(7718),S=n(57730),O=n(26481),P=n(94150),N=n(26005),k=n(72249),Z=n(47137),T=n(99136),R=n(21077),j=n(30268),D=n(67268),I=n(71153),L=n.n(I),M=n(8962);const A=o().createContext(null);A.displayName="SingleAttributeContext";var z=n(60995),H=n(10237),U=n(58662),F=n(94079),V=n(93416),B=n(98448),W=n(75512),q=n(30553),G=n(66410),_=n(32152),$=n(36444),Q=n(79692);const X=(0,Q.Z)((()=>({triggerButton:{minWidth:0,color:"rgba(0,0,0,0.54)",width:"36px"},popupContent:{paddingTop:"19px",paddingBottom:"23px",paddingLeft:"23px",paddingRight:"23px",maxWidth:"180px",width:"40%"},checkboxControlRoot:{marginTop:"6px",marginLeft:"-12px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"}}))),Y=e=>{let{className:t}=e;const n=X(),a=(0,r.useRef)(),[l,i]=(0,r.useState)(!1),{showInactive:c,toggleShowInactive:s}=(0,r.useContext)(A),u=()=>i((e=>!e));return o().createElement(o().Fragment,null,o().createElement(F.Button,{ref:a,classes:{root:L()(n.triggerButton,t)},onClick:u},o().createElement($.Z,null)),o().createElement(F.Popover,{open:l,classes:{paper:n.popupContent},anchorEl:a.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(F.FormControlLabel,{classes:{root:n.checkboxControlRoot,label:n.checkboxControlLabel},control:o().createElement(F.Checkbox,{className:n.checkboxControlCheckbox,checked:c,onChange:e=>s(e.target.checked)}),label:x().text("Show inactive values")})))},K=(0,Q.Z)((()=>({root:{padding:"0 4px 0 16px"},totalCaption:{lineHeight:"19px",fontSize:"14px",letterSpacing:"0.24px",color:"rgba(0,0,0,0.6)",flexShrink:0,justifyContent:"flex-start",paddingTop:"16px",paddingBottom:"13px"},ovIcon:{marginTop:"2px",marginLeft:"5px"}}))),J=e=>{let{caption:t,totalVisibleValues:n,showInactiveValuesMenu:a}=e;const l=K(),{searchQuery:i,setSearchQuery:c,setPage:s,totalNonVisibleValues:u,nonVisibleValues:p,attributeType:d}=(0,r.useContext)(A);return o().createElement(V.Z,{title:t,className:l.root},o().createElement(B.Z,{description:null==d?void 0:d.description}),o().createElement(W.Z,{widthToHide:500},o().createElement(q.Z,{height:24,margin:16}),o().createElement(F.Typography,{className:l.totalCaption,variant:"caption"},x().number(n)," ",1===n?x().text("item"):x().text("items"))),o().createElement(G.Z,{nonOvTotal:u,className:l.ovIcon,nonOvValues:p,attributeType:d}),o().createElement(_.i,{query:i,onChange:e=>{c(e),s(0)}}),a&&o().createElement(Y,null))};var ee=n(65549),te=n(11564),ne=n(93140),re=n(76134),oe=n(96698),ae=n(48852);const le=b.nIW,ie=(e,t)=>"object"==typeof e?Object.values(e).some((e=>e.some((e=>{let{value:n}=e;return ie(n,t)})))):b.P6Y.strings.search(String(e),t),ce=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 ie(t,l)})))(t,n,r),s=(0,i.filter)(b.OXP,c);return{[(0,b.xy8)(r)]:{[le(r)]:s.slice(a,a+o),paging:{[r]:{totalOvValues:s.length,totalValues:c.length}}}}},se=(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 ue(){return ue=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},ue.apply(this,arguments)}function pe(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){de(e,t,n[t])}))}return e}function de(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=[],ge=(0,ae.l)(Z.M,((e,t)=>{let{parentUri:n,attributeType:r}=t;const{error:o}=e||{};return{highlightedError:(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=se(),{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)(me,[N,h]),(0,i.map)((0,i.prop)("uri")))(w),Z=(0,i.pathOr)(me,[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,te.B)({highlightedError:u,isSimple:!0}),M=(0,b.O27)(Z),A=g&&M,z=A?[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=>pe({},e,{viewId:E}))))),[E,v]),U=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.modifyAttribute,v)(pe({},e,{viewId:E}))),[E,v]),V=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.removeAttribute,v)(pe({},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(A&&!(0,b.YkM)(n.type)?[e,e]:[e])}),[H,l,n,A]),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(ne.Z,{cardinality:f}),o().createElement(re.Z,{message:O}),q&&o().createElement(F.Button,{color:"primary",onClick:W,className:p.moreButton},o().createElement(ee.Z,{classes:{root:p.icon}}),o().createElement("div",{className:p.buttonLabel},x().text("Add"))),z.map(((e,t)=>o().createElement(oe.Z,ue({key:e.uri},G,{attributeValue:e,lazy:A&&!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:L()({[p.ovFalse]:!(0,b.OXP)(n)})},o().createElement(oe.Z,ue({},G,{attributeValue:n,ownError:(0,b.ADq)(n,null,d,S),onDeleteAttribute:V,state:l})))})),_&&o().createElement(F.Typography,{className:p.noData},s))}));var fe=n(81303);const he=e=>{let{values:t,attributeType:n,showInactive:r}=e;return o().createElement(o().Fragment,null,t.map((e=>o().createElement(fe.Z,{key:e.uri,attributeValue:e,attributeType:n,showNonOv:r}))))},be=(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}}))),ye=15,ve=e=>{let{config:t,className:n}=e;const{caption:l,max:i=ye,showInactiveValuesMenu:c}=t,s=be(),{values:u,totalVisibleValues:p,page:d,setPage:m,isLoading:g,hasPaging:f,attributeType:h,showInactive:b}=(0,r.useContext)(A),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(z.J.Provider,{value:C},o().createElement(H.Z,{className:L()(s.root,n)},o().createElement(J,{totalVisibleValues:p,caption:l,showInactiveValuesMenu:c}),o().createElement(F.Box,{className:s.content},(()=>{if(g)return o().createElement(T.Z,null);if(h){if(E&&S){const e={values:u,attributeType:h,showInactive:b};return o().createElement(he,e)}if(w){const e={values:u,attributeType:h,parentUri:v,showInactive:b,noDataText:O};return o().createElement(ge,e)}}return o().createElement(F.Typography,{className:s.noData},O)})()),f&&o().createElement(U.Z,{count:p,page:d,rowsPerPage:i,rowsPerPageOptions:[],onChangePage:m,classes:{root:s.pagination}})))};var xe=n(85229),Ee=n(20562);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 Ce=(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,xe._)(),f=(0,r.useRef)(null),h=(0,a.useDispatch)(),v=(0,a.useSelector)(y.ZP.selectors.getApiPath),x=(0,a.useSelector)(y.ZP.selectors.getTenant),E=(0,a.useSelector)(y.ZP.selectors.getEntityWithDiff),w=(0,a.useSelector)(y.ZP.selectors.getIsViewMode),C=(0,a.useSelector)(y.ZP.selectors.getIsHistoryModeEnabled),S=(0,a.useSelector)(y.ZP.selectors.getHistoryDiff),O=E.uri,P=le(n),N=(0,b.xy8)(n);f.current=(0,b.JQy)(E,O,P);const k=(0,r.useMemo)((()=>(0,b.zeJ)(l,n)),[l,n]),{globalFilter:Z}=(0,a.useSelector)(y.ZP.selectors.getGlobalSearchRequestOptions),{showInactive:T}=t,R=(0,r.useCallback)((()=>{if(k&&(0,b.Uty)(k)&&!(0,b.ZiX)(O)&&(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)(E)||C?ce: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){we(e,t,n[t])}))}return e}({metadata:l,entity:E,apiPath:v,tenant:x,parentUri:O,defaultMaxValues:o,attributeTypeUri:n,offset:o*e,globalFilter:Z,options:r?"":void 0},a))).then((e=>{const t=(0,i.path)([N],e),r=(0,i.pathOr)([],[P],t);C||h(y.N5.actions.processNextPageOfAttributeValues({parentUri:O,attributeTypeUri:n,attributeTypeName:P,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))})).finally((()=>{m(!1)}))}else s([]),p(null)}),[v,O,x,n,o,l,t,Z,k,C,S]);(0,r.useEffect)((()=>{R()}),[R]),(0,Ee.D)((()=>{w&&R()}),[w]);const j=(0,i.partition)(b.OXP),[,D]=j(f.current||[]),I=T?[]:D,L=T?"totalValues":"totalOvValues",M=(0,i.ifElse)((0,i.has)(L),(0,i.prop)(L),(0,i.always)(c.length))(u),A=o<M,z=null!=u&&u.totalValues?u.totalValues-M:I.length;return{values:c,isLoading:d,hasPaging:A,totalVisibleValues:M,attributeType:k,totalNonVisibleValues:z,nonVisibleValues:I}};function Se(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Oe=n(37152),Pe=n(3185),Ne=n(31274),ke=n(79026),Ze=n(8818),Te=n(90324),Re=n(70595);const je=o().createContext(null);je.displayName="RelationsViewStateContext";const De=(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"}}))),Ie=e=>{let{className:t}=e;const n=De(),a=(0,r.useRef)(),{showInactive:l,toggleShowInactive:i,sortOrder:c,toggleSortOrder:s,sortOption:u,changeSortOption:p,sortOptions:d}=(0,r.useContext)(je),[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:L()(n.button,t)},onClick:f},o().createElement($.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(ke.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(Ze.k,{tooltipTitle:y?x().text("Ascending"):x().text("Descending"),icon:y?Te.Z:Re.Z,onClick:s,className:n.sortOrderButton,size:"L"})))))};Ie.displayName="FilterButton";const Le=Ie,Me=(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 Ae=n(61932),ze=n(55847);const He=o().createContext(null);function Ue(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 Ve=Math.pow(2,31)-1,Be=(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 We=n(81137);const qe=e=>{let{label:t}=e;const n=Be();return o().createElement(F.Badge,{classes:{anchorOriginTopRightRectangle:n.badgePosition,badge:n.badge},badgeContent:t},o().createElement(Ae.Z,null))},Ge=()=>{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)(He),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=[Ue({},o.content,{offset:0,max:null!==(e=o.maxDtssImport)&&void 0!==e?e:Ve})],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 Ue({},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=Be(),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(Ze.k,{size:"L",icon:Ae.Z,tooltipTitle:x().text("Import connections from ${label}",{label:e[0].label}),onClick:()=>i(e[0])}),o().createElement("div",{className:L()(c.tenant)},u)):o().createElement(ze.Z,{menuId:"importDT-table-actions",buttonComponent:Ze.k,buttonProps:{tooltipTitle:x().text("Import connections"),size:"L",icon:()=>o().createElement(qe,{label:u})},menuItems:e.map((e=>({onClick:()=>{i(e)},text:e.label})))}),o().createElement(We.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})))},_e=e=>{let{title:t,total:n}=e;const a=Me(),{searchQuery:l,changeSearchQuery:i}=(0,r.useContext)(je);return o().createElement(V.Z,{title:t||"",className:a.header},n>0&&o().createElement(W.Z,{widthToHide:400},o().createElement(q.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(_.i,{query:l,onChange:i}),o().createElement(Ge,null),o().createElement(Le,null))};var $e=n(11013),Qe=n(27604),Xe=n(22983),Ye=n(34e3),Ke=n(31039);const Je=(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 et(){return et=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},et.apply(this,arguments)}const tt=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=Je(),u=(0,xe._)(),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,et({onOpen:v,title:x,disableFocusListener:!0,classes:{tooltip:s.tooltip}},c),l)},nt=(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 rt=n(77277);const ot=(0,Q.Z)((()=>({container:{display:"flex"}})));function at(){return at=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},at.apply(this,arguments)}const lt=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=ot();return o().createElement("div",{className:a.container},o().createElement(rt.Z,at({onClick:t,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),x().text("Accept")),o().createElement(rt.Z,at({onClick:n,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),x().text("Ignore")))},it=(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"}}))),ct=(0,r.memo)((e=>{let{connection:t,metadata:n,showControls:l,onRemoveRelation:i,onEditRelation:c,onAcceptRelation:s,onIgnoreRelation:u,renderRelationArrowButton:p}=e;const d=it(),{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}=nt(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(Ze.k,{icon:Qe.Z,size:"XS",onClick:T,tooltipTitle:x().text("Edit")}),N&&o().createElement(Ze.k,{icon:Xe.Z,size:"XS",onClick:Z,tooltipTitle:x().text("Remove")})):void 0,I=t.suggested?o().createElement(lt,{acceptRelation:R,ignoreRelation:j,size:"small",disabled:v}):void 0,M=v?x().text("ignored"):x().text("edited");return o().createElement("div",{className:L()(d.container,{[d.rowInactive]:!O},{[d.removed]:f||v})},o().createElement("div",{className:d.row},p&&p(),o().createElement(Ye.Z,{className:d.entityAvatar,entityType:E}),o().createElement(Ke.Z,{value:C,className:d.entityLabelContainer},o().createElement(tt,{label:w,entity:m},o().createElement("span",{className:d.entityLabel},w)),(h||v)&&o().createElement(F.Typography,{variant:"caption",className:d.editedLabel},"(",M,")"),S&&o().createElement("span",{className:d.relationLabel},`, ${S}`)),o().createElement("div",{className:d.editButtonsContent},D),I))}));ct.displayName="EditableRelationItem";const st=ct,ut=(0,i.when)(b.Kn2,(0,i.prop)("uri")),pt=(e,t)=>{const n=(e,t)=>(t?(0,b.VGB)(t):[]).map((t=>({type:ut(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 dt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var mt=n(98989),gt=n(83543);const ft=(0,Q.Z)({arrowIcon:{fontSize:"16px",marginRight:"6px"}}),ht=e=>{let{onClick:t,connection:n,config:r,showSecondLevel:a}=e;const l=ft(),{parentEntityUri:i}=n,{contentSecondLevel:c}=r,s={onClick:t,className:l.arrowIcon};return i||!c||(0,b.xvW)(n)?null:a?o().createElement(gt.Z,s):o().createElement(mt.Z,s)},bt=(0,Q.Z)({row:{display:"flex",alignItems:"center",width:"100%"},secondLevelContent:{paddingLeft:"24px"}}),yt=e=>{let{config:t,connection:n,children:l}=e;const i=bt(),{showInactive:c}=(0,r.useContext)(je),{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){dt(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(ht,{onClick:p,connection:n,config:t,showSecondLevel:u}))),u&&o().createElement(Ne.X.Provider,{value:f},o().createElement("div",{className:i.secondLevelContent},o().createElement(Xt,{isLoading:m,config:t,loadRelations:d,connections:s,total:g,parentEntityUri:n.entity.entityUri}))))},vt=(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"}}))),xt=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=vt(),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=pt(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(yt,{config:l,connection:e,key:s},(t=>r?o().createElement($e.Z,{connection:r,config:l,mode:c,metadata:p}):o().createElement(st,{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(ee.Z,{classes:{root:v.icon}}),o().createElement("div",{className:v.buttonLabel},x().text("Add"))),D&&o().createElement($e.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 Et=n(19603),wt=n(94646),Ct=n(78101),St=n(80931);const Ot=(0,Q.Z)((e=>({attributesList:{paddingLeft:"46px",paddingRight:"16px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0}})));function Pt(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){Nt(e,t,n[t])}))}return e}function Nt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const kt=e=>{let{connection:t,className:n}=e;const l=Ot(),{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)((()=>Pt({attributes:Pt({},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)(w.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(Ct.A.Provider,{value:h},o().createElement(St.Z,{className:L()(l.attributesList,n),entity:d,attrTypes:p})):o().createElement("div",{className:L()(l.attributesList,n)},x().text("No attributes"))};var Zt=n(86602),Tt=n(82726);const Rt=e=>{let{show:t,onToggle:n,className:r}=e;return o().createElement(Ze.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?Zt.Z:Tt.Z,onClick:n})},jt=(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"}}))),Dt=(0,r.memo)((e=>{let{connection:t,renderRelationArrowButton:n,acceptRelation:l,ignoreRelation:c}=e;const s=jt(),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}=nt(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:L()(s.container,{[s.rowInactive]:!w},{[s.suggestedWrapper]:u})},o().createElement("div",{className:L()(s.row,Et.U)},n&&n(),o().createElement("div",{className:s.labelWrapper},o().createElement(Ye.Z,{className:s.entityAvatar,entityType:h}),o().createElement(Ke.Z,{value:x,className:s.entityLabelContainer},o().createElement(tt,{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(wt.Z,{className:s.commentsContainer,uri:(0,b.gjS)(d),relatedObjectUris:S,objectType:b.q7e.RELATION,allowOnlyOneComment:!0}),u&&o().createElement(lt,{size:"small",acceptRelation:l(t),ignoreRelation:c(t)}),!u&&o().createElement(Rt,{show:m,onToggle:()=>{g((e=>!e))},className:s.showDetails}))),m&&o().createElement(kt,{connection:t}))}));Dt.displayName="RelationItem";const It=Dt;var Lt=n(52691),Mt=n(16208);const At=e=>e.filter((e=>5===e.value)).length,zt=e=>e.filter((e=>1===e.value)).length,Ht=e=>0===e.length?"0%":At(e)/e.length*100+"%",Ut=e=>0===e.length?"0%":zt(e)/e.length*100+"%",Ft=(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)"}}))),Vt=e=>{let{ratings:t,className:n}=e;const r=Ft();return o().createElement("div",{className:L()(r.wrapper,n)},o().createElement(F.Typography,{className:r.averageRating},(e=>(0,i.pipe)((0,i.pluck)("value"),i.mean,(0,i.defaultTo)(0))(e))(t).toFixed(1)),o().createElement("div",{className:r.scale},o().createElement("div",{className:r.likesScale,style:{width:Ht(t)}}),o().createElement("div",{className:r.dislikesScale,style:{width:Ut(t)}})),o().createElement("div",{className:r.counts},o().createElement("div",{className:L()(r.likesCount,r.count)},o().createElement(Lt.Z,{className:r.icon}),At(t)),o().createElement("div",{className:r.count},o().createElement(Mt.Z,{className:r.icon}),zt(t))))},Bt=(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}}))),Wt=e=>{let{ratings:t,onAgree:n,onDisagree:r}=e;const l=Bt(),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:L()(l.button,l.likeButton,{[l.isActive]:5===(null==c?void 0:c.value)})},"Agree"),o().createElement(ze.Z,{buttonProps:{endIcon:o().createElement(gt.Z,null),variant:"text",size:"small",className:L()(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"}))},qt=(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"}}))),Gt=e=>{let{connection:t,loadRelations:n,renderRelationArrowButton:l,acceptRelation:c,ignoreRelation:s}=e;const u=qt(),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}=nt(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:L()(u.wrapper,{[u.suggestedWrapper]:p})},o().createElement(F.Box,{display:"flex",minHeight:"44px",className:Et.U},o().createElement(F.Box,{display:"flex",alignItems:"center"},o().createElement(F.Box,{display:"flex",alignItems:"center"},l&&l(),o().createElement(Ye.Z,{entityType:x,className:u.entityTypeIcon})),o().createElement(F.Box,{display:"flex",flexDirection:"column"},o().createElement(Ke.Z,{value:E,className:u.entityLabelContainer},o().createElement(tt,{label:v,entity:g},o().createElement("span",{className:u.entityLabel},v))),w&&o().createElement("span",{className:u.relationLabel},w),!p&&o().createElement(Wt,{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(wt.Z,{className:u.commentsContainer,uri:(0,b.gjS)(f),relatedObjectUris:O,objectType:b.q7e.RELATION,allowOnlyOneComment:!0}),p&&o().createElement(lt,{acceptRelation:c(t),ignoreRelation:s(t)}),!p&&o().createElement(o().Fragment,null,o().createElement(Vt,{ratings:C,className:u.ratings}),o().createElement(Rt,{show:d,onToggle:()=>{m((e=>!e))},className:u.showDetailsButton})))),d&&o().createElement(kt,{connection:t,className:u.relationAttributes}))},_t=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=pt(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)(w.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(yt,{config:i,connection:e,key:r},(t=>s?o().createElement(Gt,{loadRelations:l,connection:e,acceptRelation:d,ignoreRelation:p,renderRelationArrowButton:t}):o().createElement(It,{acceptRelation:d,ignoreRelation:p,connection:e,renderRelationArrowButton:t})))})))};_t.displayName="RelationsList";const $t=_t,Qt=(0,Q.Z)((e=>({list:{paddingTop:"8px",paddingBottom:"10px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),Xt=e=>{let{isLoading:t,config:n,loadRelations:r,connections:l,total:i,parentEntityUri:c}=e;const s=Qt(),{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(T.Z,null):(0,b.KIu)(d)?o().createElement(xt,{connections:l,className:s.list,key:null==p?void 0:p.uri,config:n,mode:d,noDataText:m,parentEntityUri:c}):i>0?o().createElement($t,{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)},Yt=(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}}),Kt=e=>{let{config:t,className:n}=e;const l=Yt(),{page:c,setPage:s,rowsPerPage:u,sortOrder:p,sortOption:d,showInactive:m,searchQuery:g,changeSearchQuery:f}=(0,r.useContext)(je),{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,Oe.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(Pe.u.Provider,{value:x},o().createElement(Ne.X.Provider,{value:N},o().createElement(H.Z,{className:n},o().createElement("div",{className:l.container},o().createElement(He.Provider,{value:k},o().createElement(_e,{title:t.caption,total:E})),o().createElement("div",{className:l.content},o().createElement(Xt,{isLoading:O,config:t,loadRelations:P,connections:v,total:E}),E>u&&o().createElement(U.Z,{classes:{root:l.pagination},count:E,rowsPerPageOptions:[],rowsPerPage:u,page:c,onChangePage:s}))))))};Kt.displayName="RelationsView";const Jt=o().createContext(null);Jt.displayName="TableAttributeContext";var en=n(86361),tn=n(26180),nn=n(31276);function rn(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){on(e,t,n[t])}))}return e}function on(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const an="CHANGE_SEARCH_QUERY",ln=rn({},tn.ZP.actions,{changeSearchQuery:(0,nn.zD)(an)}),cn=(e,t)=>t.type===an?rn({},e,{searchQuery:t.payload,page:0}):tn.ZP.reducer(e,t);var sn=n(92332),un=n(67353);function pn(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){dn(e,t,n[t])}))}return e}function dn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const mn={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},gn=(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:pn({padding:"0 4px",marginLeft:"-4px"},b.zXF[b.Y1q.updateAttribute]),insertAttribute:pn({},b.zXF[b.Y1q.insertAttribute]),deleteAttribute:pn({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":mn}}))),fn=(0,un.Z)((e=>{const t=gn(),{description:n}=(null==e?void 0:e.headCellData)||{};return o().createElement("div",{className:t.headCell},o().createElement(sn.default,e),o().createElement(B.Z,{description:n,className:t.description}))}));var hn=n(72768),bn=n(95613);const yn=e=>{let{value:t,historyClassName:n}=e;const r=gn();return o().createElement("div",{className:r.blobWrapper,onScroll:nn.UW},o().createElement("span",{className:r[n]},t))},vn=e=>{let{value:t,columnData:{dataTypeDefinition:n}}=e;const a=gn(),{value:l,uri:c}=t,{appearance:s}=(0,r.useContext)(N.m),u=(0,i.pipe)(b.IFm,b.o_F)(c,s);if(n.type===b.oS0.TYPE_BLOB)return o().createElement(yn,{value:l,historyClassName:u});{const e=o().createElement(hn.Z,{value:l,dataTypeDefinition:n});return o().createElement(bn.Z,{value:e},o().createElement("div",{className:a.defaultWrapper},o().createElement("span",{className:a[u]},e)))}};function xn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const En=(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=>En(e,t.concat({name:a}))))})},wn=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),Cn=e=>{if((0,b.vZp)(e)){const t=wn(e);return t.length>1?t.slice(0,-1):null}return null},Sn=(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){xn(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:Cn(e.id),headCellRenderer:fn,rowCellValueRenderer:vn})));var On=n(99341);function Pn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Nn=n(52016),kn=n(1876),Zn=n(60894);const Tn=(0,Q.Z)((()=>({header:{padding:"0 4px 0 16px"}}))),Rn=e=>{let{title:t,searchQuery:n,onChangeSearchQuery:a,filtersEnabled:l,onToggleFilters:i,columnsData:c,selectedColumns:s,onChangeColumns:u}=e;const p=Tn(),{attributeType:d}=(0,r.useContext)(Jt);return o().createElement(V.Z,{title:t,className:p.header},o().createElement(B.Z,{description:null==d?void 0:d.description}),o().createElement(_.i,{query:n,onChange:a}),o().createElement(kn.Z,{enabled:l,onClick:i}),o().createElement(q.Z,{height:24,margin:4}),o().createElement(Zn.Z,{columnsData:c,selectedColumns:s,onChangeColumns:u}))};function jn(){return jn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jn.apply(this,arguments)}const Dn=(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=gn();return o().createElement("div",{className:L()({[i["row-cell--sorted"]]:a,[i["row-cell--removed"]]:r},i.rowCell)},t.values.map(((e,t)=>o().createElement(n,jn({key:t,value:e},l)))))}));var In=n(85709);const Ln=(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)"}}}))),Mn=e=>{let{onEdit:t,onRemove:n}=e;return o().createElement(o().Fragment,null,t&&o().createElement(Ze.k,{tooltipTitle:x().text("Edit"),icon:Qe.Z,size:"L",onClick:t}),n&&o().createElement(Ze.k,{tooltipTitle:x().text("Remove"),icon:Xe.Z,size:"L",onClick:n}))};function An(){return An=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},An.apply(this,arguments)}const zn=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))(wn(e),t))(r,e),t)}),{}),(0,i.assoc)("value",e))(t))))(n,t)),[n,t]),h=(0,r.useMemo)((()=>Sn(t)),[t]),v=Ln(),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)(Jt),P=(0,r.useCallback)((e=>o().createElement(Dn,An({},e,{isSorted:!!l&&l.field===e.columnData.id}))),[l]),[N,k]=(0,r.useState)(null),{canUpdate:Z,canDelete:T}=(0,Nn.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)),L=(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]),A=R||!j&&!I?void 0:o().createElement(Mn,{onEdit:I?L:void 0,onRemove:j?M:void 0}),z=(0,r.useMemo)((()=>({deletedUris:g})),[g]);return o().createElement("div",{className:v.tableContainer},o().createElement(In.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:A,context:z,classes:{hoveredRowRightContentWrapper:v["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:v["row-cell__buttons-container"]}}))},Hn=(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 Un(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Fn=e=>{let{onChangeAttribute:t,onCancel:n,onApply:l,onDeleteAttribute:c,hasChanges:s,attributeValue:u}=e;const p=Hn(),d=(0,a.useSelector)(y.ZP.selectors.getEntityUri),{attributeType:g}=(0,r.useContext)(Jt),f=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,d)||{})),h=(0,a.useSelector)(y.ZP.selectors.getMode),v=(0,a.useDispatch)(),E=(0,r.useContext)(m.m),w=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.addAttributes,v)(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){Un(e,t,n[t])}))}return e}({},e,{viewId:E}))))),[E,v]),C=(0,b.ZiX)(d),S=(0,a.useSelector)((e=>y.ZP.selectors.getActiveErrorsForAttributesPager(e,d,g))),O=(0,r.useCallback)((0,i.pipe)(y.N5.errors.actions.errorDeactivated,v),[v]);return o().createElement(o().Fragment,null,o().createElement(oe.Z,{expanded:!0,attributeValue:u,showEmptyEditors:C,onDeleteAttribute:c,onDeactivateError:O,onChangeAttribute:t,onAddAttributes:w,mode:h,crosswalks:f.crosswalks,errors:S,attributeType:g,ownError:(0,b.ADq)(u,null,g.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)}},x().text("Apply"))))},Vn=(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)"},tableContainer:{height:"477px",display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},header:{padding:"0 4px 0 16px"},addButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},editor:{padding:"4px 16px"}})));function Bn(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){Wn(e,t,n[t])}))}return e}function Wn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const qn=[],Gn=15,_n=e=>{let{config:t,className:n}=e;const{caption:l,max:c=Gn}=t,s=Vn(),{values:u,page:p,setPage:d,isLoading:g,searchQuery:f,setSearchQuery:h,visibleColumns:v,onFilter:E,onSort:w,onToggleFilters:C,onChangeColumns:S,filters:O,sorting:P,totalVisibleValues:N,hasPaging:k,attributeType:Z,showTable:R,allColumnsData:j}=(0,r.useContext)(Jt),{checkHasChanges:D,onChangeAttribute:I,onDeleteAttribute:M,onAdd:A,onCancel:z,onApply:W,onStartEditing:q,modifiedValues:G,editingValues:_,deletedUris:$}=(()=>{const[e,t]=(0,r.useState)(),[n,o]=(0,r.useState)([]),l=(0,a.useSelector)(y.ZP.selectors.getMode);(0,r.useEffect)((()=>{o([]),t(null)}),[l]);const c=(0,a.useDispatch)(),s=(0,r.useContext)(m.m),{attributeType:u,values:p}=(0,r.useContext)(Jt),d=(0,a.useSelector)(y.ZP.selectors.getEntityUri),g=(0,a.useSelector)(y.ZP.selectors.getMetadata),f=(0,r.useCallback)((e=>{(0,i.pipe)(y.N5.actions.modifyAttribute,c)(Bn({},e,{viewId:s}))}),[s,c]),h=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.removeAttribute,c)(Bn({},e,{viewId:s}))),[s,c]),v=(0,r.useCallback)((()=>{const e=(0,b.gjI)({parentUri:d,attributeType:u});t(e.uri),f(Bn({},e,{value:(0,b.GPx)({attributeTypes:u.attributes,parentUri:e.uri,mode:l,metadata:g}),attributeType:u}))}),[d,u]),x=(0,r.useCallback)((e=>{o((t=>t.find((0,i.propEq)("uri",e.uri))?t:[...t,e]))}),[o]),E=(0,r.useCallback)((e=>{const r=n.find((0,i.propEq)("uri",e.uri));if(r){const t=Bn({},e,{value:r,attributeType:u,uri:e.uri});o((e=>(0,i.without)([r],e))),f(t)}else{const n={value:e,attributeType:u,uri:e.uri};t(null),h(n)}}),[h,f,o,n]),w=(0,r.useCallback)((e=>{t(null),o((t=>{const n=t.find((0,i.propEq)("uri",e.uri));return n?(0,i.without)([n],t):t}))}),[o,t]),C=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,d)||{})),S=(0,b.KIu)(l),O=(0,b.xy8)(u),P=(0,i.pathOr)(qn,[O,null==u?void 0:u.name],C),N=(0,r.useMemo)((()=>[...P.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=>P.find((0,i.propEq)("uri",e.uri))||e))(p)].map((e=>{var t;return null!==(t=n.find((0,i.propEq)("uri",e.uri)))&&void 0!==t?t:e}))),[P,n,e,p]),k=(0,r.useMemo)((()=>S?(0,i.pipe)((0,i.map)((0,i.prop)("uri")),(0,i.filter)((e=>!P.find((0,i.propEq)("uri",e)))))(p):[]),[P,p]),Z=P.filter((t=>{let{uri:r}=t;return r===e||n.find((0,i.propEq)("uri",r))}));return{checkHasChanges:e=>n.find((0,i.propEq)("uri",e.uri))!==e,onChangeAttribute:f,onDeleteAttribute:h,onAdd:v,onCancel:E,onApply:w,onStartEditing:x,modifiedValues:N,editingValues:Z,deletedUris:k}})(),Q=(0,a.useSelector)(y.ZP.selectors.getMode),X=(0,b.KIu)(Q),Y=X?G:u,{canCreate:K}=(0,Nn.l)(),J=K(t)&&Z&&(0,b.Vg3)({attributeType:Z,mode:Q})&&!_.length,te=(0,r.useMemo)((()=>v.map((e=>j.find((0,i.propEq)("id",e))))),[v,j]);return o().createElement(H.Z,{className:L()(s.root,n)},R?o().createElement(o().Fragment,null,o().createElement(Rn,{title:l,total:N,columnsData:j,selectedColumns:v,onChangeColumns:S,searchQuery:f,onChangeSearchQuery:h,filtersEnabled:!!O,onToggleFilters:C}),o().createElement("div",{className:s.content},X&&o().createElement("div",{className:s.editor},J&&o().createElement(F.Button,{color:"primary",onClick:A,className:s.addButton},o().createElement(ee.Z,{classes:{root:s.icon}}),o().createElement("div",{className:s.buttonLabel},x().text("Add"))),_.map((e=>o().createElement(Fn,{key:e.uri,attributeValue:e,onChangeAttribute:I,onDeleteAttribute:M,onCancel:z,onApply:W,hasChanges:D(e)})))),te.length>0&&o().createElement(zn,{columnsData:te,config:t,values:Y,filters:O,onFilter:E,sorting:P,onSort:w,onEdit:q,onDeleteAttribute:M,deletedUris:$}),k&&o().createElement(U.Z,{count:N,rowsPerPageOptions:[],rowsPerPage:c,page:p,onChangePage:d}),g&&o().createElement(T.Z,null))):o().createElement(o().Fragment,null,o().createElement(V.Z,{title:l,className:s.header},o().createElement(B.Z,{description:null==Z?void 0:Z.description})),o().createElement(F.Typography,{className:s.noData},x().text("No data"))))};var $n=n(58600);function Qn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Xn=0;const Yn=()=>Xn++,Kn=e=>{const t={children:[],nodeId:Yn()};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:Yn(),expanded:!0,rootIndex:i?n+1:void 0};i&&(c.root=i),o.children.push(c),o=c}}return t.children},Jn=(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"},link:{cursor:"pointer",color:e.palette.primary.main,lineHeight:"15px",wordBreak:"break-word"},selected:{fontWeight:"bold"},wrapper:{width:"100%"},avatar:{height:"16px",width:"16px",marginRight:"8px",marginLeft:"8px"},header:{padding:"0 4px 0 16px"},treeContainer:{flexGrow:1,display:"flex",flexDirection:"column",height:"100%",minHeight:"372px",maxHeight:"507px",overflow:"auto"},tree:{flexGrow:1,height:0},buttonsContainer:{flexShrink:0,marginLeft:"auto","& > * + *":{marginLeft:"-4px"}},button:{padding:"8px"},errorMessage:{fontSize:"13px",margin:"0 16px 0",lineHeight:"1.4",color:e.palette.text.secondary}})));var er=n(1242);const tr=o().createContext(null);var nr=n(72383),rr=n(55400);const or=e=>{e.target.src=er},ar=e=>{let{node:t}=e;const{entity:{label:n,uri:l},nodeId:i}=t,c=Jn(),s=(0,a.useDispatch)(),u=(0,a.useSelector)(y.ZP.selectors.getAbsoluteImagePath),p=(0,a.useSelector)(y.ZP.selectors.getMetadata),d=(0,a.useSelector)(y.ZP.selectors.getUIPath),{uri:m}=(0,a.useSelector)(y.ZP.selectors.getEntity),g=(0,r.useContext)(tr),{generateEntityUrl:f}=(0,r.useContext)(nr.v),h=f({uiPath:d,uri:l}),v=l===m,x=(0,b.nt9)(p,t.entity.type)||{},E=(0,b.VD3)(p,x,"typeGraphIcon"),w=E&&(0,b.vPL)(u,E),C=(0,r.useCallback)((()=>{s(y.ui.actions.openEntity({uri:l,viewId:g.id}))}),[s,g,l]);return o().createElement("div",{className:c.wrapper,"data-node-id":i},o().createElement("div",{className:c.container},o().createElement(F.Avatar,{className:L()(c.avatar),src:w||er,onError:or}),o().createElement("span",{className:L()(c.link,{[c.selected]:v})},o().createElement(rr.Z,{to:h,onClick:C},n))))},lr=((0,r.memo)(ar),e=>{let{node:t}=e;return t.nodeId}),ir=(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% - ${pr.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:pr.rowHeight/2+"px",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},horizontalLineRight:{height:"1px",top:pr.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 cr(){return cr=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},cr.apply(this,arguments)}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}function ur(){return ur=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},ur.apply(this,arguments)}const pr={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=ir();return o().createElement("div",ur({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:L()(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=ir(),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){sr(e,t,n[t])}))}return e}({},c.style,{width:f});return o().createElement("div",cr({},c,{className:s.node,style:h}),p,o().createElement("div",{className:s.nodeContent,style:g},n))},scaffoldBlockPxWidth:16,rowHeight:28,slideRegionSize:50};function dr(){return dr=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},dr.apply(this,arguments)}const mr=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",dr({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"})))},gr=e=>{let{title:t,onGraphOpen:n}=e;const r=Jn();return o().createElement(V.Z,{title:t,className:r.header},o().createElement("div",{className:r.buttonsContainer},o().createElement(Ze.k,{className:r.button,tooltipTitle:x().text("Show Graph"),icon:mr,onClick:n,size:"L"})))},fr=e=>lr({node:e});var hr=n(9757);const br=(0,Q.Z)((()=>({root:{position:"relative"},bodyWrapper:{paddingTop:"21px"}})));function yr(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){vr(e,t,n[t])}))}return e}function vr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const xr=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,hr.E)(t),y=br(),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:yr({},x,h),className:L()(y.root,n)}))):null};var Er=n(14940);const wr=(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)"}}),Cr=e=>{const t=t=>{const n=wr();return o().createElement("div",{className:n.dragHandleContainer},o().createElement("div",{className:n.dragHandleVisibilityArea},o().createElement("div",{className:L()("viewDraggableHandle",n.dragHandle)},o().createElement(Er.Z,{className:n.dragIcon}))),o().createElement(e,t))};return t.displayName="WithDragHandle",t};var Sr=n(2256);const Or=e=>{const t=t=>o().createElement(Sr.Z,{error:o().createElement(R.ZP,{LogoRenderer:R.B9.ERROR,text:"",secondaryText:x().text("Something went wrong"),variant:R.tC.small})},o().createElement(e,t));return t.displayName="WithErrorBoundary",t},Pr=(0,Q.Z)({stubView:{padding:"20px"},fullHeight:{height:"100%"},component:{boxSizing:"border-box",overflow:"auto",boxShadow:"none",borderRadius:"unset"}});var Nr=n(29103),kr=n(83911),Zr=n(95299),Tr=n(22385);const Rr=(0,i.pipe)((0,i.path)(["point","lat"]),(0,i.both)((0,i.gt)(90),(0,i.lt)(-90))),jr=(0,Q.Z)((()=>({root:{height:"100%",display:"flex",flexDirection:"column"},fullHeight:{height:"100%"},fullscreenBtn:{position:"absolute",right:"5px",top:"5px",zIndex:100}})));var Dr=n(13074),Ir=n(24338);const Lr=(0,Q.Z)((e=>({caption:{color:e.palette.text.secondary,fontSize:"13px"}}))),Mr=Lr,Ar=e=>{let{totalImages:t}=e;const n=Mr(),r=t>1?x().text("photos"):x().text("photo");return o().createElement(F.Typography,{variant:"caption",className:n.caption},`${t} ${r}`)};function zr(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){Hr(e,t,n[t])}))}return e}function Hr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ur=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(Ir.Z,{attributeValues:p,attributeType:n,onDeleteAttribute:e=>(0,i.pipe)(y.N5.actions.removeAttribute,c)(zr({},e,{viewId:d})),parentUri:u.uri,onChangeAttribute:e=>(0,i.pipe)(y.N5.actions.modifyAttribute,c)(zr({},e,{viewId:d})),imageSize:Br,paging:r,requestNextPageOfAttributeValues:l}),o().createElement(Ar,{totalImages:p.length}))},Fr=(0,Q.Z)((e=>({container:{padding:"8px 16px"},noData:{fontSize:"13px",color:e.palette.text.secondary}}))),Vr=Fr,Br={imageMargin:4,imageWidth:162,imageHeight:162};var Wr=n(28741),qr=n(49734),Gr=n(98808),_r=n(93428),$r=n(30885);function Qr(){return Qr=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},Qr.apply(this,arguments)}const Xr=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:Gr.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(_r.H,Qr({},f,{onFinishRequest:v})),d&&o().createElement($r.i,Qr({},f,{onFinishRequest:i})))},Yr=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(qr.M,{match:r,entity:s,entitiesMap:n,metadata:c,className:Et.U},o().createElement(wt.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(Xr,{match:r,config:t,onStartRequest:i,onFinishRequest:l}))},Kr=(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)"}}))),Jr={showTransitiveMatches:!0,showInactiveEntities:!1},eo={order:b.KM9.asc,field:"score"};var to;!function(e){e[e.Loading=0]="Loading",e[e.NoData=1]="NoData",e[e.Loaded=2]="Loaded"}(to||(to={}));const no=e=>(0,i.pipe)(Or,Cr)(e),ro=no((e=>{let{className:t}=e;const n=Pr();return o().createElement(H.Z,{className:L()(n.stubView,"viewDraggableHandle",t)},"NOT IMPLEMENTED")})),oo=no((e=>{let{className:t,config:n}=e;return o().createElement(M.Z,{className:t,caption:n.caption,excludeUris:n.excludeUris,includeUris:n.includeUris,attributesCount:n.attributesCount,pinnedAttributes:n.pinnedAttributes})})),ao=no((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=Ce(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){Se(e,t,n[t])}))}return e}({setSearchQuery:n,searchQuery:t,setPage:a,page:o,toggleShowInactive:u,showInactive:l},s)})(n);return o().createElement(A.Provider,{value:a},o().createElement(ve,{config:n,className:t}))})),lo=no((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=>En(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)(cn,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,On.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,en.o)({actions:ln,dispatch:p}),N=Ce(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){Pn(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(Jt.Provider,{value:l},t&&o().createElement(_n,{config:t,className:n}))})),io=no((e=>{let{config:t,className:n}=e;const l=(0,a.useSelector)(y.ZP.selectors.getMetadata),c=(0,b.fS6)(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(je.Provider,{value:s},o().createElement(Kt,{config:c,className:n}))})),co=no(xr),so=no((e=>{let{config:t,className:n}=e;const{id:l,caption:c,graph:u}=t,p=null==u?void 0:u.type,d=Jn(),m=(0,a.useDispatch)(),g=(0,a.useSelector)(y.ZP.selectors.getEntityUri),{treeData:f,setTreeData:h,errorMessage:v}=((e,t)=>{const n=(0,xe._)(),[o,l]=(0,r.useState)([]),[c,s]=(0,r.useState)(null),u=(0,a.useSelector)(y.ZP.selectors.getEntity);return(0,Ee.D)((()=>{const e=o.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){Qn(e,t,n[t])}))}return e}({},e,{[t.index]:{root:t.tree}})),{}),t=(0,b.XTh)((0,i.pick)(["uri","label","secondaryLabel","type"],u),e);l(t.map((0,i.prop)("root")))}),[null==u?void 0:u.updatedTime]),(0,r.useEffect)((()=>((0,b.ZiX)(e)||(s(null),n((0,b.RFJ)({uri:e,graphUri:t})).then(Kn).then(l).catch((e=>{console.warn(e),s((0,b.xU7)(e,x().text("Something went wrong")))}))),()=>{l([])})),[e,t,n]),{treeData:o,setTreeData:l,errorMessage:c}})(g,p),{onResize:E,getRowHeight:w,clearHeightsCache:C}=(()=>{const[e,t]=(0,r.useState)({}),n=(0,r.useCallback)((()=>{t({})}),[]);return{onResize:(0,r.useCallback)((e=>(n,r)=>{t((t=>t[fr(e)]!==r?(0,i.assoc)(fr(e),r,t):t))}),[]),getRowHeight:(0,r.useCallback)((t=>{let{node:n}=t;return e[fr(n)]?Math.max(e[fr(n)],pr.rowHeight):pr.rowHeight}),[e]),clearHeightsCache:n}})(),S=(0,r.useCallback)((()=>{m(y.ui.actions.openGraph({viewId:l,graphType:p,entityUri:g}))}),[m,l,p,g]),O=(0,r.useCallback)((e=>({title:o().createElement(s.Z,{handleHeight:!0,refreshMode:"debounce",refreshRate:100,onResize:E(e.node)},o().createElement(ar,{node:e.node}))})),[E]);return(0,r.useEffect)((()=>{C()}),[C,g]),o().createElement(H.Z,{className:n},o().createElement(gr,{onGraphOpen:S,title:c}),o().createElement(tr.Provider,{value:t},o().createElement("div",{className:d.treeContainer},o().createElement("div",{className:d.tree},v?o().createElement(F.Typography,{className:d.errorMessage},v):o().createElement($n.ZP,{isVirtualized:!1,treeData:f,canDrag:!1,theme:pr,generateNodeProps:O,onChange:h,getNodeKey:lr,rowHeight:w})))))})),uo=no((e=>{let{config:t,className:n}=e;const l=Kr(),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,Wr.s)({enabled:!!s,entity:c,options:Jr,filter:"",page:0,sorting:eo,rowsPerPage:3,onStartLoading:d,onFinishLoading:g}),E=(0,r.useCallback)((()=>{v()}),[v]),C=(0,a.useDispatch)(),S=(0,r.useContext)(m.m),O=(0,r.useCallback)((()=>{C(y.ui.actions.openPerspective({perspectiveId:"potentialMatches",viewId:S}))}),[C,S]),P=(0,r.useMemo)((()=>(0,b.NVY)(s,(0,i.map)(b.ev7,f))),[s,f]),{getCommentsCount:N}=(0,r.useContext)(w.h);(0,r.useEffect)((()=>{N(P)}),[N,P]);const k=!(0,i.isEmpty)(f),Z=u?to.Loading:(0,i.isEmpty)(f)?to.NoData:to.Loaded;return o().createElement(Ne.X.Provider,{value:h},o().createElement(H.Z,{className:L()(l.root,n)},o().createElement(V.Z,{title:t.caption}),o().createElement("div",{className:l.matchesContainer},Z===to.Loading&&o().createElement(T.Z,null),Z===to.NoData&&o().createElement(F.Typography,{className:l.noData},x().text("No matches found")),Z===to.Loaded&&f.map((e=>o().createElement(Yr,{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"))))))})),po=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,96617)).then((e=>({default:no(e.HierarchyTreeView)}))))),mo=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,79417)).then((e=>({default:no(e.RelationshipsTableView)}))))),go=no((e=>{let{config:t,isFullscreen:n,onToggleFullscreen:l,className:i}=e;const c=jr(),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,xe._)();return(0,r.useEffect)((()=>{i(!0),c((0,b.DBr)(t,[e],n)).then((e=>{a(e.filter(Rr))})).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(T.Z,null))),[c]),f=(0,r.useMemo)((()=>({lat:0,lng:0})),[]),h=(0,r.useMemo)((()=>({mapTypeControl:!0})),[]);return p&&o().createElement(H.Z,{className:L()(c.root,i)},m&&o().createElement(T.Z,null),o().createElement(Tr.Z,{size:"S",icon:n?kr.Z:Nr.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}))})),fo=no((e=>{let{config:t,className:n}=e;const{attributeUri:l}=t,c=Vr(),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=(0,b.zeJ)(d,l),g=(0,i.pathOr)([],["attributes",null==m?void 0:m.name],p),f=(0,i.path)(["attributes","paging",l],p),h=g.length,v=t["text-empty"]||x().text("No data found"),E=(0,r.useCallback)((e=>s(y.N5.actions.requestNextPageOfAttributeValues(e))),[s]);return o().createElement(H.Z,{className:n},o().createElement(V.Z,{title:t.caption},o().createElement(B.Z,{description:null==m?void 0:m.description})),o().createElement("div",{className:c.container},(()=>{if(m){if((0,b.KIu)(u)){const e={attributeType:m,config:t,paging:f,requestNextPageOfAttributeValues:E};return o().createElement(Ur,e)}if(h>0){const e={attributeValues:g,attributeType:m,imageSize:Br,paging:f,parentUri:p.uri,requestNextPageOfAttributeValues:E};return o().createElement(o().Fragment,null,o().createElement(Dr.Z,e),o().createElement(Ar,{totalImages:h}))}}return o().createElement(F.Typography,{className:c.noData},v)})()))}));class ho{}ho.ViewTypes=b.ZIY,ho.getComponentBy=(e,t)=>{let{store:n,config:r,className:a,isFullscreen:l,onToggleFullscreen:i}=t;switch(r[e]){case ho.ViewTypes.HierarchyTree:return o().createElement(po,{config:r,store:n,className:a});case ho.ViewTypes.HierarchyPaths:return o().createElement(so,{config:r,className:a});case ho.ViewTypes.RelationsTable:return o().createElement(mo,{config:r,store:n,className:a});case ho.ViewTypes.Relations:return o().createElement(io,{config:r,className:a});case ho.ViewTypes.Attributes:return o().createElement(oo,{className:a,config:r});case ho.ViewTypes.SingleAttribute:return o().createElement(ao,{config:r,className:a});case ho.ViewTypes.AttributeTable:return o().createElement(lo,{config:r,className:a});case ho.ViewTypes.Map:return o().createElement(go,{config:r,isFullscreen:l,onToggleFullscreen:i,className:a});case ho.ViewTypes.Custom:return o().createElement(co,{config:r,className:a});case ho.ViewTypes.ImageAttribute:return o().createElement(fo,{config:r,className:a});case ho.ViewTypes.PotentialMatches:return o().createElement(uo,{config:r,className:a})}},ho.getComponent=e=>ho.getComponentBy("class",e)||ho.getComponentBy("react-class",e)||o().createElement(ro,{className:e.className});const bo=ho,yo=()=>null,vo=(0,r.memo)((e=>{let{config:t,store:n,isFullscreen:a,isAutosize:l,onToggleFullscreen:i}=e;const c=Pr();return o().createElement(r.Suspense,{fallback:o().createElement(yo,null)},bo.getComponent({config:t,store:n,className:L()(c.component,{[c.fullHeight]:!l}),isFullscreen:a,onToggleFullscreen:i}))}));vo.displayName="ViewComponent";const xo=(0,Q.Z)((e=>({item:e.basicView,fixedSizeContainer:{height:"100%"}})));function Eo(){return Eo=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},Eo.apply(this,arguments)}const wo=["onConfigChanged","onRemove"],Co=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=xo(),v=(0,a.useSelector)(y.ZP.selectors.getGoogleMapKey),{store:x}=(0,r.useContext)(a.ReactReduxContext);if(!f)return null;const E=f.class===bo.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===bo.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",Eo({},(0,i.omit)(wo,g),{"data-reltio-id":f.id,"data-reltio-class":w||"",style:u,className:L()(c,{[h.item]:!E})}),o().createElement("div",{className:L()({[h.fixedSizeContainer]:!m})},m,o().createElement(vo,{store:x,config:f,isFullscreen:p,onToggleFullscreen:d,isAutosize:Boolean(m)})),s)},So=(0,Q.Z)({scrollWrapper:{flexGrow:1,overflow:"auto"},scrollableContent:e=>{let{maxWidth:t,scrollbarWidth:n}=e;return{minWidth:t&&t<1024?t-n:1024}}}),Oo=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=So({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},o().createElement(j.p.Provider,{value:m},o().createElement(D.Z,{LayoutItem:Co,views:t,layout:n,onLayoutChanged:i,draggableHandle:".viewDraggableHandle"}))))};var Po=n(87685);const No=(0,Q.Z)((()=>({closeIcon:{paddingRight:"12px",boxSizing:"content-box","& path":{fill:"#fff"}},snackbar:{"& > div":{flexWrap:"nowrap",alignItems:"baseline"}}}))),ko=e=>{let{notification:t}=e;const n=No({}),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(Tr.Z,{className:n.closeIcon,size:"S",icon:Po.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(We.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(ko,{key:e.id,notification:e})))):null};var To=n(72753),Ro=n(43576),jo=n(64459),Do=n(3409),Io=n(93873),Lo=n(22860);function Mo(){return Mo=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},Mo.apply(this,arguments)}const Ao=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",Mo({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 zo(){return zo=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},zo.apply(this,arguments)}const Ho=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",zo({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"})))},Uo=(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 Fo(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){Vo(e,t,n[t])}))}return e}function Vo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Bo=e=>o().createElement(F.SvgIcon,e,o().createElement(Ao,null)),Wo=e=>o().createElement(F.SvgIcon,e,o().createElement(Ho,null)),qo=(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)})),Go=e=>{let{className:t,profileBandConfig:n}=e;const l=Uo(),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:Fo({},(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:Ro.Z,permission:"UPDATE"},{label:x().text("Suggesting"),value:b.fO_.SUGGESTING,description:x().text("Suggest changes and initiate a workflow review"),icon:Bo,permission:"INITIATE_CHANGE_REQUEST"},{label:x().text("Viewing"),value:b.fO_.VIEWING,description:x().text("Read or print profile"),icon:To.Z,permission:"READ"}]),[]),R=(0,r.useMemo)((()=>[...Z?[{label:x().text("Clone"),value:"Clone",description:x().text("Create a copy of the profile"),icon:Wo,onClick:()=>N(!0),permission:"CREATE"}]:[],{label:x().text("Delete"),value:"Delete",description:x().text("Permanently delete profile"),icon:Xe.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)((()=>qo(T,C,D,m,s)),[T,C,m,s,D]),M=(0,r.useMemo)((()=>qo(R,C,D,m,s)),[R,C,m,s,D]),A=(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(jo.Z,{className:L()(t,Et.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(Do.Z,null):h&&o().createElement(Io.a,null)),j&&o().createElement(Lo.T,{optionsGroup:I,buttonsGroup:M,value:g,onChange:A,disabled:O})),o().createElement(F.Box,{className:l.comments},o().createElement(wt.Z,{uri:u.uri,relatedObjectUris:(0,b.wp9)(b.q7e.ENTITY,{entityUri:u.uri}),objectType:b.q7e.ENTITY}))),!!Z&&o().createElement(We.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 _o=n(71820),$o=n(44021),Qo=n(26789),Xo=n(54362),Yo=n(6674),Ko=n(91515),Jo=n(52043),ea=n(17308),ta=n(39827),na=n(80147),ra=n(76569);const oa=(0,Q.Z)({wrapper:{display:"flex",overflow:"hidden",marginLeft:"auto",flexShrink:0},badge:{fontSize:"12px",height:"18px",minWidth:"18px",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px"}}),aa=()=>{const{total:e}=(0,r.useContext)(P.O),t=oa();return o().createElement(F.Badge,{badgeContent:e,classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(ra.Z,null))};var la=n(26313),ia=n(9371),ca=n(4426);const sa=(0,Q.Z)({wrapper:{overflow:"auto",paddingRight:"12px"},showMoreLink:{display:"flex",margin:"16px"},showMoreIcon:{fontSize:"1rem"}}),ua=()=>{const e=sa(),{getComments:t,comments:n,pageToken:l}=(0,r.useContext)(w.h),i=(0,a.useSelector)(y.ZP.selectors.getEntityUriWithDataTenant);(0,r.useEffect)((()=>{t(i)}),[t,i]);const c=(0,la.Q)(n);return o().createElement(Ne.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(ia.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(ca.Z,{className:e.showMoreIcon}),x().text("Show more"))))};var pa=n(46626);const da=(0,Q.Z)({wrapper:{overflow:"auto",position:"relative",height:"100%"}}),ma=()=>{const e=da(),{tasks:t,loading:n}=(0,r.useContext)(P.O);return o().createElement("div",{className:e.wrapper},n&&o().createElement(T.Z,null),t&&t.map((e=>o().createElement(pa.s,{key:e.taskId,task:e}))))};function ga(){return ga=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},ga.apply(this,arguments)}const fa=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",ga({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"})))))},ha=()=>{const{commentsMap:e}=(0,r.useContext)(w.h),t=oa();return o().createElement(F.Badge,{badgeContent:(0,b.mdt)(e),classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(fa,null))};var ba=n(10159);const ya=()=>o().createElement(ba.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.")}),va=()=>o().createElement(ba.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.")});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:"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"}))},wa=(0,Q.Z)({wrapper:{display:"flex",flexDirection:"column"},itemWrapper:{paddingLeft:"19px",paddingRight:"19px"}}),Ca=()=>{const e=wa(),t=(0,a.useSelector)(y.ZP.selectors.getDBConnectorSideViews);return o().createElement("div",{className:e.wrapper},t.map((t=>o().createElement(xr,{key:t.id,config:t,className:e.itemWrapper}))))};function Sa(){return Sa=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},Sa.apply(this,arguments)}let Oa;!function(e){e[e.Workflow=0]="Workflow",e[e.Collaboration=1]="Collaboration",e[e.History=2]="History",e[e.DBConnector=3]="DBConnector"}(Oa||(Oa={}));const Pa=e=>{if(e)return 1===e?x().text("${total} item",{total:e}):x().text("${total} items",{total:e})},Na=e=>{var t,n,l;let{commentId:c}=e;const s=oa(),u=(0,a.useSelector)(y.ZP.selectors.isWorkflowSideViewEnabled),p=(0,a.useSelector)(y.ZP.selectors.isWorkflowEnabled),d=(0,a.useSelector)(y.ZP.selectors.isCollaborationSideViewEnabled),m=(0,a.useSelector)(y.ZP.selectors.isDBConnectorSideViewEnabled),g=(0,a.useSelector)(y.ZP.selectors.isCollaborationEnabled),f=(0,a.useSelector)(y.ZP.selectors.getHistoryEvent),h=(0,a.useSelector)(y.ZP.selectors.getMetadata),v=(0,a.useSelector)(y.ZP.selectors.getEntity),E=(0,r.useContext)(P.O),C=(0,r.useContext)(w.h),[S,O]=(0,r.useState)(c?Oa.Collaboration:null),N=(0,r.useCallback)((e=>{O((t=>t===e?null:e))}),[]),k=(0,r.useCallback)((()=>{O(null)}),[]),Z=null!==S,T=S===Oa.History,{isHistoryEnabled:R,isProfilePersisted:j}=(0,_o.C)({isHistoryTabActive:T,entity:v}),{historyFilter:D,onApplyFilter:I,isLoading:L,historicUris:M,historyWithTotal:A,canLoadMore:z,onLoadMore:H}=(0,$o.k6)({entity:v,enabled:R}),U=u&&p&&!(0,b.ZiX)(null==v?void 0:v.uri),F=d&&g,V=(0,b.mdt)(null==C?void 0:C.commentsMap),B=[{buttonProps:{id:Oa.Workflow,icon:aa,tooltipTitle:x().text("Workflow")},content:null!=E&&E.total?o().createElement(ma,null):o().createElement(ya,null),headerProps:{mainTitle:x().text("Workflow"),secondTitle:Pa(null==E?void 0:E.total),rightContent:o().createElement(Qo.G,null)},hidden:!U},{buttonProps:{id:Oa.Collaboration,icon:ha,tooltipTitle:x().text("Collaboration")},content:V?o().createElement(ua,null):o().createElement(va,null),headerProps:{mainTitle:x().text("Collaboration"),secondTitle:Pa(V)},hidden:!F},{buttonProps:{id:Oa.History,icon:na.Z,tooltipTitle:x().text("History")},content:j?o().createElement(Xo.Z,{isLoading:L,historyWithTotal:A,contributorsUris:M,entityUri:null==v?void 0:v.uri,historyEvent:f,onLoadMore:H,canLoadMore:z}):o().createElement(Yo.Z,null),headerProps:{content:o().createElement(Ko.Z,{total:j?((null==M?void 0:M.length)||0)+1:void 0,entityType:(0,b.nt9)(h,null==v?void 0:v.type),filter:D,onApplyFilter:I})}},{buttonProps:{id:Oa.DBConnector,icon:Ea,tooltipTitle:x().text("D&B Connector")},content:o().createElement(Ca,null),headerProps:{mainTitle:x().text("D&B Connector")},hidden:!m}],W=(0,i.reject)((0,i.propEq)("hidden",!0))(B);return(0,r.useEffect)((()=>{var e;null!==(e=B[S])&&void 0!==e&&e.hidden&&k()}),[S,B,k,W]),o().createElement("div",{className:s.wrapper},o().createElement(Jo.h,{open:Z,width:480},!(null!==(t=B[S])&&void 0!==t&&t.hidden)&&o().createElement(o().Fragment,null,o().createElement(ea.P,Sa({},null===(n=B[S])||void 0===n?void 0:n.headerProps,{onClose:k})),null===(l=B[S])||void 0===l?void 0:l.content)),o().createElement(ta.G,{buttonsProps:(0,i.pipe)((0,i.reject)((0,i.propEq)("hidden",!0)),(0,i.pluck)("buttonProps"))(B),onButtonClick:N,activeIndexId:S}))};var ka=n(39781),Za=n(16715);const Ta="48px",Ra="1px solid rgba(0, 0, 0, .125)",ja=(0,Q.Z)((e=>({accordion:{borderTop:Ra,borderBottom:Ra,fontSize:"13px",boxShadow:"none","&:not(:first-child)":{borderTop:0},"&:before":{display:"none"},"&$accordionExpanded":{margin:"auto"}},accordionExpanded:{},accordionSummary:{display:"flex",alignItems:"center",height:Ta,minHeight:Ta,"&$accordionSummaryExpanded":{height:Ta,minHeight:Ta}},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"},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"}}))),Da=ja;var Ia=n(38016);const La=(0,r.memo)((e=>{let{panels:t,expandedPanelId:n,onToggle:r,ErrorComponent:a}=e;const l=Da();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(Ia.Z,null)},i,o().createElement(F.Typography,{className:l.accordionSummaryHeading},c)),o().createElement(F.AccordionDetails,{className:L()(l.accordionDetails,p)},o().createElement("ul",null,s.map(((e,t)=>o().createElement(a,{key:t,error:e}))))))}))):null}));function Ma(){return Ma=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},Ma.apply(this,arguments)}La.displayName="ErrorsPanel";const Aa=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",Ma({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"}))},za=(0,i.omit)(["deactivated","path"]),Ha=(0,r.memo)((e=>{let{error:t}=e;const n=Da(),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),{highlightError:p}=(0,r.useContext)(Z.M),d=t.uri||t.parentUri&&t.attributeTypeUri;return o().createElement("li",null,o().createElement("div",{className:n.errorWrapper},o().createElement("span",{className:n.errorTitle},s,d&&c&&o().createElement(Ze.k,{icon:Aa,size:"XXS",onClick:()=>p(t),tooltipTitle:x().text("Go to error"),className:n.goToIcon})),u&&o().createElement("span",{className:n.parents},u)))}));Ha.displayName="Error";const Ua=()=>{const e=Da(),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(za),t.map(za))}(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(ka.Z,{className:L()(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(Za.Z,{className:L()(e.icon,e.warningIcon)}),items:l,accordionClassName:e.warningsAccordion,accordionDetailsClassName:e.warningsAccordionDetails}].filter((e=>{let{items:t}=e;return t.length>0}))),[n,l,e]);(0,r.useEffect)((()=>{s("errors")}),[n]);const p=(0,r.useCallback)((e=>(t,n)=>{s(n?e:null)}),[]);return u.length>0?o().createElement(La,{panels:u,expandedPanelId:c,onToggle:p,ErrorComponent:Ha}):null};var Fa=n(3096),Va=n.n(Fa),Ba=n(60641);function Wa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const qa={};var Ga=n(61756),_a=n(4109);function $a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Qa=(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%"}},profileContainer:{display:"flex",overflow:"hidden",flexGrow:1},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"}}))),Xa=(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=Qa({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.useDispatch)(),j=(0,E.u)(),D=(e=>{const t=(0,Ga.v)(e),n=(0,_a.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){$a(e,t,n[t])}))}return e}({},t,{onActionSuccess:n})),[t,n])})(p),{type:I,uri:L}=m||{},M=(0,r.useMemo)((()=>(0,b.dvH)(m)),[m]),A=(0,r.useContext)(w.h),z=(0,C.C)({objectIds:M}),{views:H,layout:U,isLoaded:F,handleLayoutChange:V}=(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,Nn.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){Wa(e,t,n[t])}))}return e}({},t,{views:e,layout:n})}),[t,u]),d=(0,r.useMemo)((()=>Va()(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=qa,updateSavedState:x}=(0,Ba.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:I,saveState:l,getSavedState:i});return(0,S.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)((()=>{v(y.N5.views.actions.profileViewsSet(H))}),[v,H]),(0,r.useEffect)((()=>{n.sidePanelViews&&v(y.N5.sidePanelViews.actions.sidePanelViewsLoaded(n.sidePanelViews))}),[n]),o().createElement(O.j.Provider,{value:!0},o().createElement(w.e,{collaboration:f?A:z},o().createElement(P.O.Provider,{value:D},o().createElement(N.m.Provider,{value:j},o().createElement(k.l.Provider,{value:h},o().createElement(Z.R,null,o().createElement("div",{className:d.perspectiveView},(!F||!L)&&o().createElement(T.Z,null),F&&L?o().createElement("div",{className:d.profileContainer},o().createElement("div",{className:d.profileWrapper},o().createElement(Go,{profileBandConfig:u}),!f&&o().createElement(Ua,null),o().createElement(Oo,{maxWidth:s,views:H,layout:U,entityUri:L,onLayoutChanged:V})),o().createElement(Na,{commentId:c})):o().createElement("div",{className:d.emptyState},o().createElement(R.ZP,{LogoRenderer:R.B9.NO_DATA,text:x().text("No data to display."),variant:R.tC.embedded})),o().createElement(Zo,null))))))))}));function Ya(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Xa.displayName="ProfilePerspectiveView";const Ka=(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 Ja=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){Ya(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:Ka},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(Xa,{config:N,saveState:x,getSavedState:S,commentId:C}),o().createElement(h.Z,{showErrorFromStore:!0}),o().createElement(O,null)))))))))};var el=n(82842),tl=n(51229),nl=n(91131);const rl=(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}}))),ol=e=>{let{total:t=0}=e;const n=rl(),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(V.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(nl.Z,{className:n.icon}),x().text("Tags")),o().createElement(tl.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 al=n(20404);const ll=(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"}}))),il=e=>{let{label:t}=e;const n=ll();return o().createElement(F.Toolbar,{className:n.toolbar},o().createElement(al.Z,{className:n.avatar}),o().createElement(F.Typography,{variant:"h6",className:n.label},t))};function cl(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){sl(e,t,n[t])}))}return e}function sl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ul=(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}}))),pl=[25,50,100],dl=(0,r.memo)((e=>{let{tag:t,entityUri:n}=e;const l=ul(),[c,s]=(0,r.useState)(pl[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,xe._)(),u=(0,xe._)(),[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=cl({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,cl({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>pl[0];return o().createElement("div",{className:l.perspectiveView},o().createElement(il,{label:t}),o().createElement("div",{className:L()(l.tagsContainer,{[l.fullHeight]:v})},o().createElement(H.Z,{className:l.tagsView},o().createElement(ol,{total:g}),o().createElement("div",{className:l.listContainer},m&&o().createElement(T.Z,null),g>0&&o().createElement("div",{className:l.entitiesList,ref:h},o().createElement(el.Z,{entities:f})),v&&o().createElement("div",{className:l.pagination},o().createElement(U.Z,{count:g,rowsPerPageOptions:pl,rowsPerPage:c,page:u,onChangePage:p,onChangeRowsPerPage:s}))))))}));dl.displayName="TagPerspectiveView";const ml=(0,c.createGenerateClassName)({productionPrefix:"tagPerspective",disableGlobal:!0}),gl=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:ml},o().createElement(s.Z,{handleHeight:!0,onResize:(e,t)=>u(Math.floor(e),Math.floor(t))}),t&&o().createElement(dl,{tag:n,entityUri:r}),o().createElement(h.Z,{showErrorFromStore:!0}))))};var fl=n(65321);const hl=(0,Q.Z)((()=>({actionsWrapper:{display:"flex","& button + button":{width:"88px",marginLeft:"8px"}}}))),bl=()=>{const e=hl(),t=(0,a.useSelector)(y.ZP.selectors.getEntity),{tasks:n}=(0,r.useContext)(P.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(jo.Z,{entity:t},o().createElement("div",{className:e.actionsWrapper},l&&o().createElement(fl.o,{task:l})))},yl=(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}})));function vl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const xl={processTypes:["dataChangeRequestReview"]},El=(0,r.memo)((()=>{const e=yl(),t=(0,a.useDispatch)(),n=(e=>{const t=(0,a.useDispatch)(),n=(0,a.useSelector)(y.ZP.selectors.getEntityUri),o=(0,Ga.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){vl(e,t,n[t])}))}return e}({},o,{onActionSuccess:l})),[o,l])})(xl),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(P.O.Provider,{value:n},o().createElement("div",{className:e.perspectiveView},!i&&o().createElement(T.Z,null),o().createElement("div",{className:e.perspectiveContainer},i?o().createElement(o().Fragment,null,o().createElement("div",{className:e.contentWrapper},o().createElement(bl,null),o().createElement("div",{className:e.attributesWrapper},o().createElement(M.Z,null))),o().createElement(Na,null)):o().createElement(R.ZP,{LogoRenderer:R.B9.NO_DATA,text:x().text("No data to display."),variant:R.tC.embedded}))))}));El.displayName="DCRReviewPerspectiveView";const wl=(0,c.createGenerateClassName)({productionPrefix:"dcrReviewPerspective",disableGlobal:!0}),Cl=e=>{let{config:t,store:n,onResize:r=i.identity}=e;return o().createElement(a.Provider,{store:n},o().createElement(m.m.Provider,{value:t.id},o().createElement(c.StylesProvider,{generateClassName:wl},o().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},o().createElement(o().Fragment,null,o().createElement(s.Z,{handleHeight:!0,onResize:(e,t)=>r(Math.floor(e),Math.floor(t))}),o().createElement(El,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(47401),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(39450),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 L=I;var M=n(92332),A=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(A.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 F(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const V=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),B=e=>{if(e.startsWith("relation.attributes")){const t=V(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){F(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:B(e.id),headCellRenderer:z,rowCellValueRenderer:(t=e.id,"entity.label"===t?L: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 Q=$;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 Y=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))(V(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(Q,{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}))};Y.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=Y;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(99341);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 Le(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),[Ae]=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||Ae},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){Le(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:L,page:M,rowsPerPage:A,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]),F=(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:V}=(0,we.a)({sorting:L,filter:F,page:M,rowsPerPage:A,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,Q=f?[f,...b]:b,{canUpdate:X,canDelete:Y}=(0,Ce.l)(),J=X(n)&&!E,ee=Y(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})),Q.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:L,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:A,onChangeRowsPerPage:W,page:M,onChangePage:q,basicTableRef:te}):a().createElement(d.Typography,{className:C.noData},h().text("No data found")),V&&a().createElement(Ne.Z,null))))}));var Fe=n(36138),Ve=n(22664),Be=n(585);const We=(0,Fe.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(Fe.StylesProvider,{generateClassName:We},a().createElement(Ve.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([[8213],{8213:(e,t,n)=>{n.d(t,{vC:()=>Cl,_n:()=>Ja,tM:()=>gl});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(39450),g=n(97094),f=n(60115),h=n(585),b=n(47401),y=n(49885),v=n(87918),x=n.n(v),E=n(76536),w=n(41564),C=n(7718),S=n(57730),O=n(26481),P=n(94150),N=n(26005),k=n(72249),Z=n(47137),T=n(99136),R=n(21077),j=n(30268),D=n(67268),I=n(71153),L=n.n(I),A=n(8962);const M=o().createContext(null);M.displayName="SingleAttributeContext";var z=n(60995),H=n(10237),U=n(58662),F=n(94079),V=n(93416),B=n(98448),W=n(75512),q=n(30553),G=n(66410),_=n(32152),$=n(36444),Q=n(79692);const X=(0,Q.Z)((()=>({triggerButton:{minWidth:0,color:"rgba(0,0,0,0.54)",width:"36px"},popupContent:{paddingTop:"19px",paddingBottom:"23px",paddingLeft:"23px",paddingRight:"23px",maxWidth:"180px",width:"40%"},checkboxControlRoot:{marginTop:"6px",marginLeft:"-12px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"}}))),Y=e=>{let{className:t}=e;const n=X(),a=(0,r.useRef)(),[l,i]=(0,r.useState)(!1),{showInactive:c,toggleShowInactive:s}=(0,r.useContext)(M),u=()=>i((e=>!e));return o().createElement(o().Fragment,null,o().createElement(F.Button,{ref:a,classes:{root:L()(n.triggerButton,t)},onClick:u},o().createElement($.Z,null)),o().createElement(F.Popover,{open:l,classes:{paper:n.popupContent},anchorEl:a.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(F.FormControlLabel,{classes:{root:n.checkboxControlRoot,label:n.checkboxControlLabel},control:o().createElement(F.Checkbox,{className:n.checkboxControlCheckbox,checked:c,onChange:e=>s(e.target.checked)}),label:x().text("Show inactive values")})))},K=(0,Q.Z)((()=>({root:{padding:"0 4px 0 16px"},totalCaption:{lineHeight:"19px",fontSize:"14px",letterSpacing:"0.24px",color:"rgba(0,0,0,0.6)",flexShrink:0,justifyContent:"flex-start",paddingTop:"16px",paddingBottom:"13px"},ovIcon:{marginTop:"2px",marginLeft:"5px"}}))),J=e=>{let{caption:t,totalVisibleValues:n,showInactiveValuesMenu:a}=e;const l=K(),{searchQuery:i,setSearchQuery:c,setPage:s,totalNonVisibleValues:u,nonVisibleValues:p,attributeType:d}=(0,r.useContext)(M);return o().createElement(V.Z,{title:t,className:l.root},o().createElement(B.Z,{description:null==d?void 0:d.description}),o().createElement(W.Z,{widthToHide:500},o().createElement(q.Z,{height:24,margin:16}),o().createElement(F.Typography,{className:l.totalCaption,variant:"caption"},x().number(n)," ",1===n?x().text("item"):x().text("items"))),o().createElement(G.Z,{nonOvTotal:u,className:l.ovIcon,nonOvValues:p,attributeType:d}),o().createElement(_.i,{query:i,onChange:e=>{c(e),s(0)}}),a&&o().createElement(Y,null))};var ee=n(65549),te=n(11564),ne=n(93140),re=n(76134),oe=n(96698),ae=n(48852);const le=b.nIW,ie=(e,t)=>"object"==typeof e?Object.values(e).some((e=>e.some((e=>{let{value:n}=e;return ie(n,t)})))):b.P6Y.strings.search(String(e),t),ce=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 ie(t,l)})))(t,n,r),s=(0,i.filter)(b.OXP,c);return{[(0,b.xy8)(r)]:{[le(r)]:s.slice(a,a+o),paging:{[r]:{totalOvValues:s.length,totalValues:c.length}}}}},se=(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 ue(){return ue=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},ue.apply(this,arguments)}function pe(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){de(e,t,n[t])}))}return e}function de(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=[],ge=(0,ae.l)(Z.M,((e,t)=>{let{parentUri:n,attributeType:r}=t;const{error:o}=e||{};return{highlightedError:(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=se(),{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)(me,[N,h]),(0,i.map)((0,i.prop)("uri")))(w),Z=(0,i.pathOr)(me,[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,te.B)({highlightedError:u,isSimple:!0}),A=(0,b.O27)(Z),M=g&&A,z=M?[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=>pe({},e,{viewId:E}))))),[E,v]),U=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.modifyAttribute,v)(pe({},e,{viewId:E}))),[E,v]),V=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.removeAttribute,v)(pe({},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(M&&!(0,b.YkM)(n.type)?[e,e]:[e])}),[H,l,n,M]),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(ne.Z,{cardinality:f}),o().createElement(re.Z,{message:O}),q&&o().createElement(F.Button,{color:"primary",onClick:W,className:p.moreButton},o().createElement(ee.Z,{classes:{root:p.icon}}),o().createElement("div",{className:p.buttonLabel},x().text("Add"))),z.map(((e,t)=>o().createElement(oe.Z,ue({key:e.uri},G,{attributeValue:e,lazy:M&&!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:L()({[p.ovFalse]:!(0,b.OXP)(n)})},o().createElement(oe.Z,ue({},G,{attributeValue:n,ownError:(0,b.ADq)(n,null,d,S),onDeleteAttribute:V,state:l})))})),_&&o().createElement(F.Typography,{className:p.noData},s))}));var fe=n(81303);const he=e=>{let{values:t,attributeType:n,showInactive:r}=e;return o().createElement(o().Fragment,null,t.map((e=>o().createElement(fe.Z,{key:e.uri,attributeValue:e,attributeType:n,showNonOv:r}))))},be=(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}}))),ye=15,ve=e=>{let{config:t,className:n}=e;const{caption:l,max:i=ye,showInactiveValuesMenu:c}=t,s=be(),{values:u,totalVisibleValues:p,page:d,setPage:m,isLoading:g,hasPaging:f,attributeType:h,showInactive:b}=(0,r.useContext)(M),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(z.J.Provider,{value:C},o().createElement(H.Z,{className:L()(s.root,n)},o().createElement(J,{totalVisibleValues:p,caption:l,showInactiveValuesMenu:c}),o().createElement(F.Box,{className:s.content},(()=>{if(g)return o().createElement(T.Z,null);if(h){if(E&&S){const e={values:u,attributeType:h,showInactive:b};return o().createElement(he,e)}if(w){const e={values:u,attributeType:h,parentUri:v,showInactive:b,noDataText:O};return o().createElement(ge,e)}}return o().createElement(F.Typography,{className:s.noData},O)})()),f&&o().createElement(U.Z,{count:p,page:d,rowsPerPage:i,rowsPerPageOptions:[],onChangePage:m,classes:{root:s.pagination}})))};var xe=n(85229),Ee=n(20562);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 Ce=(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,xe._)(),f=(0,r.useRef)(null),h=(0,a.useDispatch)(),v=(0,a.useSelector)(y.ZP.selectors.getApiPath),x=(0,a.useSelector)(y.ZP.selectors.getTenant),E=(0,a.useSelector)(y.ZP.selectors.getEntityWithDiff),w=(0,a.useSelector)(y.ZP.selectors.getIsViewMode),C=(0,a.useSelector)(y.ZP.selectors.getIsHistoryModeEnabled),S=(0,a.useSelector)(y.ZP.selectors.getHistoryDiff),O=E.uri,P=le(n),N=(0,b.xy8)(n);f.current=(0,b.JQy)(E,O,P);const k=(0,r.useMemo)((()=>(0,b.zeJ)(l,n)),[l,n]),{globalFilter:Z}=(0,a.useSelector)(y.ZP.selectors.getGlobalSearchRequestOptions),{showInactive:T}=t,R=(0,r.useCallback)((()=>{if(k&&(0,b.Uty)(k)&&!(0,b.ZiX)(O)&&(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)(E)||C?ce: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){we(e,t,n[t])}))}return e}({metadata:l,entity:E,apiPath:v,tenant:x,parentUri:O,defaultMaxValues:o,attributeTypeUri:n,offset:o*e,globalFilter:Z,options:r?"":void 0},a))).then((e=>{const t=(0,i.path)([N],e),r=(0,i.pathOr)([],[P],t);C||h(y.N5.actions.processNextPageOfAttributeValues({parentUri:O,attributeTypeUri:n,attributeTypeName:P,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))})).finally((()=>{m(!1)}))}else s([]),p(null)}),[v,O,x,n,o,l,t,Z,k,C,S]);(0,r.useEffect)((()=>{R()}),[R]),(0,Ee.D)((()=>{w&&R()}),[w]);const j=(0,i.partition)(b.OXP),[,D]=j(f.current||[]),I=T?[]:D,L=T?"totalValues":"totalOvValues",A=(0,i.ifElse)((0,i.has)(L),(0,i.prop)(L),(0,i.always)(c.length))(u),M=o<A,z=null!=u&&u.totalValues?u.totalValues-A:I.length;return{values:c,isLoading:d,hasPaging:M,totalVisibleValues:A,attributeType:k,totalNonVisibleValues:z,nonVisibleValues:I}};function Se(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Oe=n(37152),Pe=n(3185),Ne=n(31274),ke=n(79026),Ze=n(8818),Te=n(90324),Re=n(70595);const je=o().createContext(null);je.displayName="RelationsViewStateContext";const De=(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"}}))),Ie=e=>{let{className:t}=e;const n=De(),a=(0,r.useRef)(),{showInactive:l,toggleShowInactive:i,sortOrder:c,toggleSortOrder:s,sortOption:u,changeSortOption:p,sortOptions:d}=(0,r.useContext)(je),[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:L()(n.button,t)},onClick:f},o().createElement($.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(ke.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(Ze.k,{tooltipTitle:y?x().text("Ascending"):x().text("Descending"),icon:y?Te.Z:Re.Z,onClick:s,className:n.sortOrderButton,size:"L"})))))};Ie.displayName="FilterButton";const Le=Ie,Ae=(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 Me=n(61932),ze=n(55847);const He=o().createContext(null);function Ue(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 Ve=Math.pow(2,31)-1,Be=(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 We=n(81137);const qe=e=>{let{label:t}=e;const n=Be();return o().createElement(F.Badge,{classes:{anchorOriginTopRightRectangle:n.badgePosition,badge:n.badge},badgeContent:t},o().createElement(Me.Z,null))},Ge=()=>{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)(He),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=[Ue({},o.content,{offset:0,max:null!==(e=o.maxDtssImport)&&void 0!==e?e:Ve})],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 Ue({},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=Be(),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(Ze.k,{size:"L",icon:Me.Z,tooltipTitle:x().text("Import connections from ${label}",{label:e[0].label}),onClick:()=>i(e[0])}),o().createElement("div",{className:L()(c.tenant)},u)):o().createElement(ze.Z,{menuId:"importDT-table-actions",buttonComponent:Ze.k,buttonProps:{tooltipTitle:x().text("Import connections"),size:"L",icon:()=>o().createElement(qe,{label:u})},menuItems:e.map((e=>({onClick:()=>{i(e)},text:e.label})))}),o().createElement(We.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})))},_e=e=>{let{title:t,total:n}=e;const a=Ae(),{searchQuery:l,changeSearchQuery:i}=(0,r.useContext)(je);return o().createElement(V.Z,{title:t||"",className:a.header},n>0&&o().createElement(W.Z,{widthToHide:400},o().createElement(q.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(_.i,{query:l,onChange:i}),o().createElement(Ge,null),o().createElement(Le,null))};var $e=n(11013),Qe=n(27604),Xe=n(22983),Ye=n(34e3),Ke=n(31039);const Je=(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 et(){return et=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},et.apply(this,arguments)}const tt=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=Je(),u=(0,xe._)(),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,et({onOpen:v,title:x,disableFocusListener:!0,classes:{tooltip:s.tooltip}},c),l)},nt=(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 rt=n(77277);const ot=(0,Q.Z)((()=>({container:{display:"flex"}})));function at(){return at=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},at.apply(this,arguments)}const lt=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=ot();return o().createElement("div",{className:a.container},o().createElement(rt.Z,at({onClick:t,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),x().text("Accept")),o().createElement(rt.Z,at({onClick:n,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),x().text("Ignore")))},it=(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"}}))),ct=(0,r.memo)((e=>{let{connection:t,metadata:n,showControls:l,onRemoveRelation:i,onEditRelation:c,onAcceptRelation:s,onIgnoreRelation:u,renderRelationArrowButton:p}=e;const d=it(),{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}=nt(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(Ze.k,{icon:Qe.Z,size:"XS",onClick:T,tooltipTitle:x().text("Edit")}),N&&o().createElement(Ze.k,{icon:Xe.Z,size:"XS",onClick:Z,tooltipTitle:x().text("Remove")})):void 0,I=t.suggested?o().createElement(lt,{acceptRelation:R,ignoreRelation:j,size:"small",disabled:v}):void 0,A=v?x().text("ignored"):x().text("edited");return o().createElement("div",{className:L()(d.container,{[d.rowInactive]:!O},{[d.removed]:f||v})},o().createElement("div",{className:d.row},p&&p(),o().createElement(Ye.Z,{className:d.entityAvatar,entityType:E}),o().createElement(Ke.Z,{value:C,className:d.entityLabelContainer},o().createElement(tt,{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))}));ct.displayName="EditableRelationItem";const st=ct,ut=(0,i.when)(b.Kn2,(0,i.prop)("uri")),pt=(e,t)=>{const n=(e,t)=>(t?(0,b.VGB)(t):[]).map((t=>({type:ut(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 dt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var mt=n(98989),gt=n(83543);const ft=(0,Q.Z)({arrowIcon:{fontSize:"16px",marginRight:"6px"}}),ht=e=>{let{onClick:t,connection:n,config:r,showSecondLevel:a}=e;const l=ft(),{parentEntityUri:i}=n,{contentSecondLevel:c}=r,s={onClick:t,className:l.arrowIcon};return i||!c||(0,b.xvW)(n)?null:a?o().createElement(gt.Z,s):o().createElement(mt.Z,s)},bt=(0,Q.Z)({row:{display:"flex",alignItems:"center",width:"100%"},secondLevelContent:{paddingLeft:"24px"}}),yt=e=>{let{config:t,connection:n,children:l}=e;const i=bt(),{showInactive:c}=(0,r.useContext)(je),{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){dt(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(ht,{onClick:p,connection:n,config:t,showSecondLevel:u}))),u&&o().createElement(Ne.X.Provider,{value:f},o().createElement("div",{className:i.secondLevelContent},o().createElement(Xt,{isLoading:m,config:t,loadRelations:d,connections:s,total:g,parentEntityUri:n.entity.entityUri}))))},vt=(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"}}))),xt=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=vt(),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=pt(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(yt,{config:l,connection:e,key:s},(t=>r?o().createElement($e.Z,{connection:r,config:l,mode:c,metadata:p}):o().createElement(st,{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(ee.Z,{classes:{root:v.icon}}),o().createElement("div",{className:v.buttonLabel},x().text("Add"))),D&&o().createElement($e.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 Et=n(19603),wt=n(94646),Ct=n(78101),St=n(80931);const Ot=(0,Q.Z)((e=>({attributesList:{paddingLeft:"46px",paddingRight:"16px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0}})));function Pt(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){Nt(e,t,n[t])}))}return e}function Nt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const kt=e=>{let{connection:t,className:n}=e;const l=Ot(),{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)((()=>Pt({attributes:Pt({},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)(w.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(Ct.A.Provider,{value:h},o().createElement(St.Z,{className:L()(l.attributesList,n),entity:d,attrTypes:p})):o().createElement("div",{className:L()(l.attributesList,n)},x().text("No attributes"))};var Zt=n(86602),Tt=n(82726);const Rt=e=>{let{show:t,onToggle:n,className:r}=e;return o().createElement(Ze.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?Zt.Z:Tt.Z,onClick:n})},jt=(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"}}))),Dt=(0,r.memo)((e=>{let{connection:t,renderRelationArrowButton:n,acceptRelation:l,ignoreRelation:c}=e;const s=jt(),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}=nt(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:L()(s.container,{[s.rowInactive]:!w},{[s.suggestedWrapper]:u})},o().createElement("div",{className:L()(s.row,Et.U)},n&&n(),o().createElement("div",{className:s.labelWrapper},o().createElement(Ye.Z,{className:s.entityAvatar,entityType:h}),o().createElement(Ke.Z,{value:x,className:s.entityLabelContainer},o().createElement(tt,{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(wt.Z,{className:s.commentsContainer,uri:(0,b.gjS)(d),relatedObjectUris:S,objectType:b.q7e.RELATION,allowOnlyOneComment:!0}),u&&o().createElement(lt,{size:"small",acceptRelation:l(t),ignoreRelation:c(t)}),!u&&o().createElement(Rt,{show:m,onToggle:()=>{g((e=>!e))},className:s.showDetails}))),m&&o().createElement(kt,{connection:t}))}));Dt.displayName="RelationItem";const It=Dt;var Lt=n(52691),At=n(16208);const Mt=e=>e.filter((e=>5===e.value)).length,zt=e=>e.filter((e=>1===e.value)).length,Ht=e=>0===e.length?"0%":Mt(e)/e.length*100+"%",Ut=e=>0===e.length?"0%":zt(e)/e.length*100+"%",Ft=(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)"}}))),Vt=e=>{let{ratings:t,className:n}=e;const r=Ft();return o().createElement("div",{className:L()(r.wrapper,n)},o().createElement(F.Typography,{className:r.averageRating},(e=>(0,i.pipe)((0,i.pluck)("value"),i.mean,(0,i.defaultTo)(0))(e))(t).toFixed(1)),o().createElement("div",{className:r.scale},o().createElement("div",{className:r.likesScale,style:{width:Ht(t)}}),o().createElement("div",{className:r.dislikesScale,style:{width:Ut(t)}})),o().createElement("div",{className:r.counts},o().createElement("div",{className:L()(r.likesCount,r.count)},o().createElement(Lt.Z,{className:r.icon}),Mt(t)),o().createElement("div",{className:r.count},o().createElement(At.Z,{className:r.icon}),zt(t))))},Bt=(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}}))),Wt=e=>{let{ratings:t,onAgree:n,onDisagree:r}=e;const l=Bt(),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:L()(l.button,l.likeButton,{[l.isActive]:5===(null==c?void 0:c.value)})},"Agree"),o().createElement(ze.Z,{buttonProps:{endIcon:o().createElement(gt.Z,null),variant:"text",size:"small",className:L()(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"}))},qt=(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"}}))),Gt=e=>{let{connection:t,loadRelations:n,renderRelationArrowButton:l,acceptRelation:c,ignoreRelation:s}=e;const u=qt(),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}=nt(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:L()(u.wrapper,{[u.suggestedWrapper]:p})},o().createElement(F.Box,{display:"flex",minHeight:"44px",className:Et.U},o().createElement(F.Box,{display:"flex",alignItems:"center"},o().createElement(F.Box,{display:"flex",alignItems:"center"},l&&l(),o().createElement(Ye.Z,{entityType:x,className:u.entityTypeIcon})),o().createElement(F.Box,{display:"flex",flexDirection:"column"},o().createElement(Ke.Z,{value:E,className:u.entityLabelContainer},o().createElement(tt,{label:v,entity:g},o().createElement("span",{className:u.entityLabel},v))),w&&o().createElement("span",{className:u.relationLabel},w),!p&&o().createElement(Wt,{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(wt.Z,{className:u.commentsContainer,uri:(0,b.gjS)(f),relatedObjectUris:O,objectType:b.q7e.RELATION,allowOnlyOneComment:!0}),p&&o().createElement(lt,{acceptRelation:c(t),ignoreRelation:s(t)}),!p&&o().createElement(o().Fragment,null,o().createElement(Vt,{ratings:C,className:u.ratings}),o().createElement(Rt,{show:d,onToggle:()=>{m((e=>!e))},className:u.showDetailsButton})))),d&&o().createElement(kt,{connection:t,className:u.relationAttributes}))},_t=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=pt(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)(w.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(yt,{config:i,connection:e,key:r},(t=>s?o().createElement(Gt,{loadRelations:l,connection:e,acceptRelation:d,ignoreRelation:p,renderRelationArrowButton:t}):o().createElement(It,{acceptRelation:d,ignoreRelation:p,connection:e,renderRelationArrowButton:t})))})))};_t.displayName="RelationsList";const $t=_t,Qt=(0,Q.Z)((e=>({list:{paddingTop:"8px",paddingBottom:"10px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),Xt=e=>{let{isLoading:t,config:n,loadRelations:r,connections:l,total:i,parentEntityUri:c}=e;const s=Qt(),{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(T.Z,null):(0,b.KIu)(d)?o().createElement(xt,{connections:l,className:s.list,key:null==p?void 0:p.uri,config:n,mode:d,noDataText:m,parentEntityUri:c}):i>0?o().createElement($t,{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)},Yt=(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}}),Kt=e=>{let{config:t,className:n}=e;const l=Yt(),{page:c,setPage:s,rowsPerPage:u,sortOrder:p,sortOption:d,showInactive:m,searchQuery:g,changeSearchQuery:f}=(0,r.useContext)(je),{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,Oe.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(Pe.u.Provider,{value:x},o().createElement(Ne.X.Provider,{value:N},o().createElement(H.Z,{className:n},o().createElement("div",{className:l.container},o().createElement(He.Provider,{value:k},o().createElement(_e,{title:t.caption,total:E})),o().createElement("div",{className:l.content},o().createElement(Xt,{isLoading:O,config:t,loadRelations:P,connections:v,total:E}),E>u&&o().createElement(U.Z,{classes:{root:l.pagination},count:E,rowsPerPageOptions:[],rowsPerPage:u,page:c,onChangePage:s}))))))};Kt.displayName="RelationsView";const Jt=o().createContext(null);Jt.displayName="TableAttributeContext";var en=n(86361),tn=n(26180),nn=n(31276);function rn(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){on(e,t,n[t])}))}return e}function on(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const an="CHANGE_SEARCH_QUERY",ln=rn({},tn.ZP.actions,{changeSearchQuery:(0,nn.zD)(an)}),cn=(e,t)=>t.type===an?rn({},e,{searchQuery:t.payload,page:0}):tn.ZP.reducer(e,t);var sn=n(92332),un=n(67353);function pn(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){dn(e,t,n[t])}))}return e}function dn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const mn={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},gn=(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:pn({padding:"0 4px",marginLeft:"-4px"},b.zXF[b.Y1q.updateAttribute]),insertAttribute:pn({},b.zXF[b.Y1q.insertAttribute]),deleteAttribute:pn({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":mn}}))),fn=(0,un.Z)((e=>{const t=gn(),{description:n}=(null==e?void 0:e.headCellData)||{};return o().createElement("div",{className:t.headCell},o().createElement(sn.default,e),o().createElement(B.Z,{description:n,className:t.description}))}));var hn=n(72768),bn=n(95613);const yn=e=>{let{value:t,historyClassName:n}=e;const r=gn();return o().createElement("div",{className:r.blobWrapper,onScroll:nn.UW},o().createElement("span",{className:r[n]},t))},vn=e=>{let{value:t,columnData:{dataTypeDefinition:n}}=e;const a=gn(),{value:l,uri:c}=t,{appearance:s}=(0,r.useContext)(N.m),u=(0,i.pipe)(b.IFm,b.o_F)(c,s);if(n.type===b.oS0.TYPE_BLOB)return o().createElement(yn,{value:l,historyClassName:u});{const e=o().createElement(hn.Z,{value:l,dataTypeDefinition:n});return o().createElement(bn.Z,{value:e},o().createElement("div",{className:a.defaultWrapper},o().createElement("span",{className:a[u]},e)))}};function xn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const En=(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=>En(e,t.concat({name:a}))))})},wn=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),Cn=e=>{if((0,b.vZp)(e)){const t=wn(e);return t.length>1?t.slice(0,-1):null}return null},Sn=(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){xn(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:Cn(e.id),headCellRenderer:fn,rowCellValueRenderer:vn})));var On=n(99341);function Pn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Nn=n(52016),kn=n(1876),Zn=n(60894);const Tn=(0,Q.Z)((()=>({header:{padding:"0 4px 0 16px"}}))),Rn=e=>{let{title:t,searchQuery:n,onChangeSearchQuery:a,filtersEnabled:l,onToggleFilters:i,columnsData:c,selectedColumns:s,onChangeColumns:u}=e;const p=Tn(),{attributeType:d}=(0,r.useContext)(Jt);return o().createElement(V.Z,{title:t,className:p.header},o().createElement(B.Z,{description:null==d?void 0:d.description}),o().createElement(_.i,{query:n,onChange:a}),o().createElement(kn.Z,{enabled:l,onClick:i}),o().createElement(q.Z,{height:24,margin:4}),o().createElement(Zn.Z,{columnsData:c,selectedColumns:s,onChangeColumns:u}))};function jn(){return jn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jn.apply(this,arguments)}const Dn=(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=gn();return o().createElement("div",{className:L()({[i["row-cell--sorted"]]:a,[i["row-cell--removed"]]:r},i.rowCell)},t.values.map(((e,t)=>o().createElement(n,jn({key:t,value:e},l)))))}));var In=n(85709);const Ln=(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)"}}}))),An=e=>{let{onEdit:t,onRemove:n}=e;return o().createElement(o().Fragment,null,t&&o().createElement(Ze.k,{tooltipTitle:x().text("Edit"),icon:Qe.Z,size:"L",onClick:t}),n&&o().createElement(Ze.k,{tooltipTitle:x().text("Remove"),icon:Xe.Z,size:"L",onClick:n}))};function Mn(){return Mn=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},Mn.apply(this,arguments)}const zn=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))(wn(e),t))(r,e),t)}),{}),(0,i.assoc)("value",e))(t))))(n,t)),[n,t]),h=(0,r.useMemo)((()=>Sn(t)),[t]),v=Ln(),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)(Jt),P=(0,r.useCallback)((e=>o().createElement(Dn,Mn({},e,{isSorted:!!l&&l.field===e.columnData.id}))),[l]),[N,k]=(0,r.useState)(null),{canUpdate:Z,canDelete:T}=(0,Nn.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)),L=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);I&&d(e)}),[d,N,n,I]),A=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);if(!j)return;const t={parentUri:C,attributeType:O,uri:e.uri,value:e};m(t),k(null)}),[N,n,m,j,O,C]),M=R||!j&&!I?void 0:o().createElement(An,{onEdit:I?L:void 0,onRemove:j?A:void 0}),z=(0,r.useMemo)((()=>({deletedUris:g})),[g]);return o().createElement("div",{className:v.tableContainer},o().createElement(In.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:M,context:z,classes:{hoveredRowRightContentWrapper:v["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:v["row-cell__buttons-container"]}}))},Hn=(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 Un(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Fn=e=>{let{onChangeAttribute:t,onCancel:n,onApply:l,onDeleteAttribute:c,hasChanges:s,attributeValue:u}=e;const p=Hn(),d=(0,a.useSelector)(y.ZP.selectors.getEntityUri),{attributeType:g}=(0,r.useContext)(Jt),f=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,d)||{})),h=(0,a.useSelector)(y.ZP.selectors.getMode),v=(0,a.useDispatch)(),E=(0,r.useContext)(m.m),w=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.addAttributes,v)(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){Un(e,t,n[t])}))}return e}({},e,{viewId:E}))))),[E,v]),C=(0,b.ZiX)(d),S=(0,a.useSelector)((e=>y.ZP.selectors.getActiveErrorsForAttributesPager(e,d,g))),O=(0,r.useCallback)((0,i.pipe)(y.N5.errors.actions.errorDeactivated,v),[v]);return o().createElement(o().Fragment,null,o().createElement(oe.Z,{expanded:!0,attributeValue:u,showEmptyEditors:C,onDeleteAttribute:c,onDeactivateError:O,onChangeAttribute:t,onAddAttributes:w,mode:h,crosswalks:f.crosswalks,errors:S,attributeType:g,ownError:(0,b.ADq)(u,null,g.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)}},x().text("Apply"))))},Vn=(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)"},tableContainer:{height:"477px",display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},header:{padding:"0 4px 0 16px"},addButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},editor:{padding:"4px 16px"}})));function Bn(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){Wn(e,t,n[t])}))}return e}function Wn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const qn=[],Gn=15,_n=e=>{let{config:t,className:n}=e;const{caption:l,max:c=Gn}=t,s=Vn(),{values:u,page:p,setPage:d,isLoading:g,searchQuery:f,setSearchQuery:h,visibleColumns:v,onFilter:E,onSort:w,onToggleFilters:C,onChangeColumns:S,filters:O,sorting:P,totalVisibleValues:N,hasPaging:k,attributeType:Z,showTable:R,allColumnsData:j}=(0,r.useContext)(Jt),{checkHasChanges:D,onChangeAttribute:I,onDeleteAttribute:A,onAdd:M,onCancel:z,onApply:W,onStartEditing:q,modifiedValues:G,editingValues:_,deletedUris:$}=(()=>{const[e,t]=(0,r.useState)(),[n,o]=(0,r.useState)([]),l=(0,a.useSelector)(y.ZP.selectors.getMode);(0,r.useEffect)((()=>{o([]),t(null)}),[l]);const c=(0,a.useDispatch)(),s=(0,r.useContext)(m.m),{attributeType:u,values:p}=(0,r.useContext)(Jt),d=(0,a.useSelector)(y.ZP.selectors.getEntityUri),g=(0,a.useSelector)(y.ZP.selectors.getMetadata),f=(0,r.useCallback)((e=>{(0,i.pipe)(y.N5.actions.modifyAttribute,c)(Bn({},e,{viewId:s}))}),[s,c]),h=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.removeAttribute,c)(Bn({},e,{viewId:s}))),[s,c]),v=(0,r.useCallback)((()=>{const e=(0,b.gjI)({parentUri:d,attributeType:u});t(e.uri),f(Bn({},e,{value:(0,b.GPx)({attributeTypes:u.attributes,parentUri:e.uri,mode:l,metadata:g}),attributeType:u}))}),[d,u]),x=(0,r.useCallback)((e=>{o((t=>t.find((0,i.propEq)("uri",e.uri))?t:[...t,e]))}),[o]),E=(0,r.useCallback)((e=>{const r=n.find((0,i.propEq)("uri",e.uri));if(r){const t=Bn({},e,{value:r,attributeType:u,uri:e.uri});o((e=>(0,i.without)([r],e))),f(t)}else{const n={value:e,attributeType:u,uri:e.uri};t(null),h(n)}}),[h,f,o,n]),w=(0,r.useCallback)((e=>{t(null),o((t=>{const n=t.find((0,i.propEq)("uri",e.uri));return n?(0,i.without)([n],t):t}))}),[o,t]),C=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,d)||{})),S=(0,b.KIu)(l),O=(0,b.xy8)(u),P=(0,i.pathOr)(qn,[O,null==u?void 0:u.name],C),N=(0,r.useMemo)((()=>[...P.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=>P.find((0,i.propEq)("uri",e.uri))||e))(p)].map((e=>{var t;return null!==(t=n.find((0,i.propEq)("uri",e.uri)))&&void 0!==t?t:e}))),[P,n,e,p]),k=(0,r.useMemo)((()=>S?(0,i.pipe)((0,i.map)((0,i.prop)("uri")),(0,i.filter)((e=>!P.find((0,i.propEq)("uri",e)))))(p):[]),[P,p]),Z=P.filter((t=>{let{uri:r}=t;return r===e||n.find((0,i.propEq)("uri",r))}));return{checkHasChanges:e=>n.find((0,i.propEq)("uri",e.uri))!==e,onChangeAttribute:f,onDeleteAttribute:h,onAdd:v,onCancel:E,onApply:w,onStartEditing:x,modifiedValues:N,editingValues:Z,deletedUris:k}})(),Q=(0,a.useSelector)(y.ZP.selectors.getMode),X=(0,b.KIu)(Q),Y=X?G:u,{canCreate:K}=(0,Nn.l)(),J=K(t)&&Z&&(0,b.Vg3)({attributeType:Z,mode:Q})&&!_.length,te=(0,r.useMemo)((()=>v.map((e=>j.find((0,i.propEq)("id",e))))),[v,j]);return o().createElement(H.Z,{className:L()(s.root,n)},R?o().createElement(o().Fragment,null,o().createElement(Rn,{title:l,total:N,columnsData:j,selectedColumns:v,onChangeColumns:S,searchQuery:f,onChangeSearchQuery:h,filtersEnabled:!!O,onToggleFilters:C}),o().createElement("div",{className:s.content},X&&o().createElement("div",{className:s.editor},J&&o().createElement(F.Button,{color:"primary",onClick:M,className:s.addButton},o().createElement(ee.Z,{classes:{root:s.icon}}),o().createElement("div",{className:s.buttonLabel},x().text("Add"))),_.map((e=>o().createElement(Fn,{key:e.uri,attributeValue:e,onChangeAttribute:I,onDeleteAttribute:A,onCancel:z,onApply:W,hasChanges:D(e)})))),te.length>0&&o().createElement(zn,{columnsData:te,config:t,values:Y,filters:O,onFilter:E,sorting:P,onSort:w,onEdit:q,onDeleteAttribute:A,deletedUris:$}),k&&o().createElement(U.Z,{count:N,rowsPerPageOptions:[],rowsPerPage:c,page:p,onChangePage:d}),g&&o().createElement(T.Z,null))):o().createElement(o().Fragment,null,o().createElement(V.Z,{title:l,className:s.header},o().createElement(B.Z,{description:null==Z?void 0:Z.description})),o().createElement(F.Typography,{className:s.noData},x().text("No data"))))};var $n=n(58600);function Qn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Xn=0;const Yn=()=>Xn++,Kn=e=>{const t={children:[],nodeId:Yn()};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:Yn(),expanded:!0,rootIndex:i?n+1:void 0};i&&(c.root=i),o.children.push(c),o=c}}return t.children},Jn=(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"},link:{cursor:"pointer",color:e.palette.primary.main,lineHeight:"15px",wordBreak:"break-word"},selected:{fontWeight:"bold"},wrapper:{width:"100%"},avatar:{height:"16px",width:"16px",marginRight:"8px",marginLeft:"8px"},header:{padding:"0 4px 0 16px"},treeContainer:{flexGrow:1,display:"flex",flexDirection:"column",height:"100%",minHeight:"372px",maxHeight:"507px",overflow:"auto"},tree:{flexGrow:1,height:0},buttonsContainer:{flexShrink:0,marginLeft:"auto","& > * + *":{marginLeft:"-4px"}},button:{padding:"8px"},errorMessage:{fontSize:"13px",margin:"0 16px 0",lineHeight:"1.4",color:e.palette.text.secondary}})));var er=n(1242);const tr=o().createContext(null);var nr=n(72383),rr=n(55400);const or=e=>{e.target.src=er},ar=e=>{let{node:t}=e;const{entity:{label:n,uri:l},nodeId:i}=t,c=Jn(),s=(0,a.useDispatch)(),u=(0,a.useSelector)(y.ZP.selectors.getAbsoluteImagePath),p=(0,a.useSelector)(y.ZP.selectors.getMetadata),d=(0,a.useSelector)(y.ZP.selectors.getUIPath),{uri:m}=(0,a.useSelector)(y.ZP.selectors.getEntity),g=(0,r.useContext)(tr),{generateEntityUrl:f}=(0,r.useContext)(nr.v),h=f({uiPath:d,uri:l}),v=l===m,x=(0,b.nt9)(p,t.entity.type)||{},E=(0,b.VD3)(p,x,"typeGraphIcon"),w=E&&(0,b.vPL)(u,E),C=(0,r.useCallback)((()=>{s(y.ui.actions.openEntity({uri:l,viewId:g.id}))}),[s,g,l]);return o().createElement("div",{className:c.wrapper,"data-node-id":i},o().createElement("div",{className:c.container},o().createElement(F.Avatar,{className:L()(c.avatar),src:w||er,onError:or}),o().createElement("span",{className:L()(c.link,{[c.selected]:v})},o().createElement(rr.Z,{to:h,onClick:C},n))))},lr=((0,r.memo)(ar),e=>{let{node:t}=e;return t.nodeId}),ir=(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% - ${pr.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:pr.rowHeight/2+"px",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},horizontalLineRight:{height:"1px",top:pr.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 cr(){return cr=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},cr.apply(this,arguments)}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}function ur(){return ur=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},ur.apply(this,arguments)}const pr={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=ir();return o().createElement("div",ur({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:L()(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=ir(),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){sr(e,t,n[t])}))}return e}({},c.style,{width:f});return o().createElement("div",cr({},c,{className:s.node,style:h}),p,o().createElement("div",{className:s.nodeContent,style:g},n))},scaffoldBlockPxWidth:16,rowHeight:28,slideRegionSize:50};function dr(){return dr=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},dr.apply(this,arguments)}const mr=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",dr({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"})))},gr=e=>{let{title:t,onGraphOpen:n}=e;const r=Jn();return o().createElement(V.Z,{title:t,className:r.header},o().createElement("div",{className:r.buttonsContainer},o().createElement(Ze.k,{className:r.button,tooltipTitle:x().text("Show Graph"),icon:mr,onClick:n,size:"L"})))},fr=e=>lr({node:e});var hr=n(9757);const br=(0,Q.Z)((()=>({root:{position:"relative"},bodyWrapper:{paddingTop:"21px"}})));function yr(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){vr(e,t,n[t])}))}return e}function vr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const xr=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,hr.E)(t),y=br(),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:yr({},x,h),className:L()(y.root,n)}))):null};var Er=n(14940);const wr=(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)"}}),Cr=e=>{const t=t=>{const n=wr();return o().createElement("div",{className:n.dragHandleContainer},o().createElement("div",{className:n.dragHandleVisibilityArea},o().createElement("div",{className:L()("viewDraggableHandle",n.dragHandle)},o().createElement(Er.Z,{className:n.dragIcon}))),o().createElement(e,t))};return t.displayName="WithDragHandle",t};var Sr=n(2256);const Or=e=>{const t=t=>o().createElement(Sr.Z,{error:o().createElement(R.ZP,{LogoRenderer:R.B9.ERROR,text:"",secondaryText:x().text("Something went wrong"),variant:R.tC.small})},o().createElement(e,t));return t.displayName="WithErrorBoundary",t},Pr=(0,Q.Z)({stubView:{padding:"20px"},fullHeight:{height:"100%"},component:{boxSizing:"border-box",overflow:"auto",boxShadow:"none",borderRadius:"unset"}});var Nr=n(29103),kr=n(83911),Zr=n(95299),Tr=n(22385);const Rr=(0,i.pipe)((0,i.path)(["point","lat"]),(0,i.both)((0,i.gt)(90),(0,i.lt)(-90))),jr=(0,Q.Z)((()=>({root:{height:"100%",display:"flex",flexDirection:"column"},fullHeight:{height:"100%"},fullscreenBtn:{position:"absolute",right:"5px",top:"5px",zIndex:100}})));var Dr=n(13074),Ir=n(24338);const Lr=(0,Q.Z)((e=>({caption:{color:e.palette.text.secondary,fontSize:"13px"}}))),Ar=Lr,Mr=e=>{let{totalImages:t}=e;const n=Ar(),r=t>1?x().text("photos"):x().text("photo");return o().createElement(F.Typography,{variant:"caption",className:n.caption},`${t} ${r}`)};function zr(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){Hr(e,t,n[t])}))}return e}function Hr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ur=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(Ir.Z,{attributeValues:p,attributeType:n,onDeleteAttribute:e=>(0,i.pipe)(y.N5.actions.removeAttribute,c)(zr({},e,{viewId:d})),parentUri:u.uri,onChangeAttribute:e=>(0,i.pipe)(y.N5.actions.modifyAttribute,c)(zr({},e,{viewId:d})),imageSize:Br,paging:r,requestNextPageOfAttributeValues:l}),o().createElement(Mr,{totalImages:p.length}))},Fr=(0,Q.Z)((e=>({container:{padding:"8px 16px"},noData:{fontSize:"13px",color:e.palette.text.secondary}}))),Vr=Fr,Br={imageMargin:4,imageWidth:162,imageHeight:162};var Wr=n(28741),qr=n(49734),Gr=n(98808),_r=n(93428),$r=n(30885);function Qr(){return Qr=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},Qr.apply(this,arguments)}const Xr=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:Gr.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(_r.H,Qr({},f,{onFinishRequest:v})),d&&o().createElement($r.i,Qr({},f,{onFinishRequest:i})))},Yr=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(qr.M,{match:r,entity:s,entitiesMap:n,metadata:c,className:Et.U},o().createElement(wt.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(Xr,{match:r,config:t,onStartRequest:i,onFinishRequest:l}))},Kr=(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)"}}))),Jr={showTransitiveMatches:!0,showInactiveEntities:!1},eo={order:b.KM9.asc,field:"score"};var to;!function(e){e[e.Loading=0]="Loading",e[e.NoData=1]="NoData",e[e.Loaded=2]="Loaded"}(to||(to={}));const no=e=>(0,i.pipe)(Or,Cr)(e),ro=no((e=>{let{className:t}=e;const n=Pr();return o().createElement(H.Z,{className:L()(n.stubView,"viewDraggableHandle",t)},"NOT IMPLEMENTED")})),oo=no((e=>{let{className:t,config:n}=e;return o().createElement(A.Z,{className:t,caption:n.caption,excludeUris:n.excludeUris,includeUris:n.includeUris,attributesCount:n.attributesCount,pinnedAttributes:n.pinnedAttributes})})),ao=no((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=Ce(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){Se(e,t,n[t])}))}return e}({setSearchQuery:n,searchQuery:t,setPage:a,page:o,toggleShowInactive:u,showInactive:l},s)})(n);return o().createElement(M.Provider,{value:a},o().createElement(ve,{config:n,className:t}))})),lo=no((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=>En(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)(cn,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,On.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,en.o)({actions:ln,dispatch:p}),N=Ce(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){Pn(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(Jt.Provider,{value:l},t&&o().createElement(_n,{config:t,className:n}))})),io=no((e=>{let{config:t,className:n}=e;const l=(0,a.useSelector)(y.ZP.selectors.getMetadata),c=(0,b.fS6)(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(je.Provider,{value:s},o().createElement(Kt,{config:c,className:n}))})),co=no(xr),so=no((e=>{let{config:t,className:n}=e;const{id:l,caption:c,graph:u}=t,p=null==u?void 0:u.type,d=Jn(),m=(0,a.useDispatch)(),g=(0,a.useSelector)(y.ZP.selectors.getEntityUri),{treeData:f,setTreeData:h,errorMessage:v}=((e,t)=>{const n=(0,xe._)(),[o,l]=(0,r.useState)([]),[c,s]=(0,r.useState)(null),u=(0,a.useSelector)(y.ZP.selectors.getEntity);return(0,Ee.D)((()=>{const e=o.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){Qn(e,t,n[t])}))}return e}({},e,{[t.index]:{root:t.tree}})),{}),t=(0,b.XTh)((0,i.pick)(["uri","label","secondaryLabel","type"],u),e);l(t.map((0,i.prop)("root")))}),[null==u?void 0:u.updatedTime]),(0,r.useEffect)((()=>((0,b.ZiX)(e)||(s(null),n((0,b.RFJ)({uri:e,graphUri:t})).then(Kn).then(l).catch((e=>{console.warn(e),s((0,b.xU7)(e,x().text("Something went wrong")))}))),()=>{l([])})),[e,t,n]),{treeData:o,setTreeData:l,errorMessage:c}})(g,p),{onResize:E,getRowHeight:w,clearHeightsCache:C}=(()=>{const[e,t]=(0,r.useState)({}),n=(0,r.useCallback)((()=>{t({})}),[]);return{onResize:(0,r.useCallback)((e=>(n,r)=>{t((t=>t[fr(e)]!==r?(0,i.assoc)(fr(e),r,t):t))}),[]),getRowHeight:(0,r.useCallback)((t=>{let{node:n}=t;return e[fr(n)]?Math.max(e[fr(n)],pr.rowHeight):pr.rowHeight}),[e]),clearHeightsCache:n}})(),S=(0,r.useCallback)((()=>{m(y.ui.actions.openGraph({viewId:l,graphType:p,entityUri:g}))}),[m,l,p,g]),O=(0,r.useCallback)((e=>({title:o().createElement(s.Z,{handleHeight:!0,refreshMode:"debounce",refreshRate:100,onResize:E(e.node)},o().createElement(ar,{node:e.node}))})),[E]);return(0,r.useEffect)((()=>{C()}),[C,g]),o().createElement(H.Z,{className:n},o().createElement(gr,{onGraphOpen:S,title:c}),o().createElement(tr.Provider,{value:t},o().createElement("div",{className:d.treeContainer},o().createElement("div",{className:d.tree},v?o().createElement(F.Typography,{className:d.errorMessage},v):o().createElement($n.ZP,{isVirtualized:!1,treeData:f,canDrag:!1,theme:pr,generateNodeProps:O,onChange:h,getNodeKey:lr,rowHeight:w})))))})),uo=no((e=>{let{config:t,className:n}=e;const l=Kr(),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,Wr.s)({enabled:!!s,entity:c,options:Jr,filter:"",page:0,sorting:eo,rowsPerPage:3,onStartLoading:d,onFinishLoading:g}),E=(0,r.useCallback)((()=>{v()}),[v]),C=(0,a.useDispatch)(),S=(0,r.useContext)(m.m),O=(0,r.useCallback)((()=>{C(y.ui.actions.openPerspective({perspectiveId:"potentialMatches",viewId:S}))}),[C,S]),P=(0,r.useMemo)((()=>(0,b.NVY)(s,(0,i.map)(b.ev7,f))),[s,f]),{getCommentsCount:N}=(0,r.useContext)(w.h);(0,r.useEffect)((()=>{N(P)}),[N,P]);const k=!(0,i.isEmpty)(f),Z=u?to.Loading:(0,i.isEmpty)(f)?to.NoData:to.Loaded;return o().createElement(Ne.X.Provider,{value:h},o().createElement(H.Z,{className:L()(l.root,n)},o().createElement(V.Z,{title:t.caption}),o().createElement("div",{className:l.matchesContainer},Z===to.Loading&&o().createElement(T.Z,null),Z===to.NoData&&o().createElement(F.Typography,{className:l.noData},x().text("No matches found")),Z===to.Loaded&&f.map((e=>o().createElement(Yr,{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"))))))})),po=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,96617)).then((e=>({default:no(e.HierarchyTreeView)}))))),mo=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,79417)).then((e=>({default:no(e.RelationshipsTableView)}))))),go=no((e=>{let{config:t,isFullscreen:n,onToggleFullscreen:l,className:i}=e;const c=jr(),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,xe._)();return(0,r.useEffect)((()=>{i(!0),c((0,b.DBr)(t,[e],n)).then((e=>{a(e.filter(Rr))})).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(T.Z,null))),[c]),f=(0,r.useMemo)((()=>({lat:0,lng:0})),[]),h=(0,r.useMemo)((()=>({mapTypeControl:!0})),[]);return p&&o().createElement(H.Z,{className:L()(c.root,i)},m&&o().createElement(T.Z,null),o().createElement(Tr.Z,{size:"S",icon:n?kr.Z:Nr.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}))})),fo=no((e=>{let{config:t,className:n}=e;const{attributeUri:l}=t,c=Vr(),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=(0,b.zeJ)(d,l),g=(0,i.pathOr)([],["attributes",null==m?void 0:m.name],p),f=(0,i.path)(["attributes","paging",l],p),h=g.length,v=t["text-empty"]||x().text("No data found"),E=(0,r.useCallback)((e=>s(y.N5.actions.requestNextPageOfAttributeValues(e))),[s]);return o().createElement(H.Z,{className:n},o().createElement(V.Z,{title:t.caption},o().createElement(B.Z,{description:null==m?void 0:m.description})),o().createElement("div",{className:c.container},(()=>{if(m){if((0,b.KIu)(u)){const e={attributeType:m,config:t,paging:f,requestNextPageOfAttributeValues:E};return o().createElement(Ur,e)}if(h>0){const e={attributeValues:g,attributeType:m,imageSize:Br,paging:f,parentUri:p.uri,requestNextPageOfAttributeValues:E};return o().createElement(o().Fragment,null,o().createElement(Dr.Z,e),o().createElement(Mr,{totalImages:h}))}}return o().createElement(F.Typography,{className:c.noData},v)})()))}));class ho{}ho.ViewTypes=b.ZIY,ho.getComponentBy=(e,t)=>{let{store:n,config:r,className:a,isFullscreen:l,onToggleFullscreen:i}=t;switch(r[e]){case ho.ViewTypes.HierarchyTree:return o().createElement(po,{config:r,store:n,className:a});case ho.ViewTypes.HierarchyPaths:return o().createElement(so,{config:r,className:a});case ho.ViewTypes.RelationsTable:return o().createElement(mo,{config:r,store:n,className:a});case ho.ViewTypes.Relations:return o().createElement(io,{config:r,className:a});case ho.ViewTypes.Attributes:return o().createElement(oo,{className:a,config:r});case ho.ViewTypes.SingleAttribute:return o().createElement(ao,{config:r,className:a});case ho.ViewTypes.AttributeTable:return o().createElement(lo,{config:r,className:a});case ho.ViewTypes.Map:return o().createElement(go,{config:r,isFullscreen:l,onToggleFullscreen:i,className:a});case ho.ViewTypes.Custom:return o().createElement(co,{config:r,className:a});case ho.ViewTypes.ImageAttribute:return o().createElement(fo,{config:r,className:a});case ho.ViewTypes.PotentialMatches:return o().createElement(uo,{config:r,className:a})}},ho.getComponent=e=>ho.getComponentBy("class",e)||ho.getComponentBy("react-class",e)||o().createElement(ro,{className:e.className});const bo=ho,yo=()=>null,vo=(0,r.memo)((e=>{let{config:t,store:n,isFullscreen:a,isAutosize:l,onToggleFullscreen:i}=e;const c=Pr();return o().createElement(r.Suspense,{fallback:o().createElement(yo,null)},bo.getComponent({config:t,store:n,className:L()(c.component,{[c.fullHeight]:!l}),isFullscreen:a,onToggleFullscreen:i}))}));vo.displayName="ViewComponent";const xo=(0,Q.Z)((e=>({item:e.basicView,fixedSizeContainer:{height:"100%"}})));function Eo(){return Eo=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},Eo.apply(this,arguments)}const wo=["onConfigChanged","onRemove"],Co=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=xo(),v=(0,a.useSelector)(y.ZP.selectors.getGoogleMapKey),{store:x}=(0,r.useContext)(a.ReactReduxContext);if(!f)return null;const E=f.class===bo.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===bo.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",Eo({},(0,i.omit)(wo,g),{"data-reltio-id":f.id,"data-reltio-class":w||"",style:u,className:L()(c,{[h.item]:!E})}),o().createElement("div",{className:L()({[h.fixedSizeContainer]:!m})},m,o().createElement(vo,{store:x,config:f,isFullscreen:p,onToggleFullscreen:d,isAutosize:Boolean(m)})),s)},So=(0,Q.Z)({scrollWrapper:{flexGrow:1,overflow:"auto"},scrollableContent:e=>{let{maxWidth:t,scrollbarWidth:n}=e;return{minWidth:t&&t<1024?t-n:1024}}}),Oo=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=So({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},o().createElement(j.p.Provider,{value:m},o().createElement(D.Z,{LayoutItem:Co,views:t,layout:n,onLayoutChanged:i,draggableHandle:".viewDraggableHandle"}))))};var Po=n(87685);const No=(0,Q.Z)((()=>({closeIcon:{paddingRight:"12px",boxSizing:"content-box","& path":{fill:"#fff"}},snackbar:{"& > div":{flexWrap:"nowrap",alignItems:"baseline"}}}))),ko=e=>{let{notification:t}=e;const n=No({}),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(Tr.Z,{className:n.closeIcon,size:"S",icon:Po.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(We.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(ko,{key:e.id,notification:e})))):null};var To=n(72753),Ro=n(43576),jo=n(64459),Do=n(3409),Io=n(93873),Lo=n(22860);function Ao(){return Ao=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},Ao.apply(this,arguments)}const Mo=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",Ao({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 zo(){return zo=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},zo.apply(this,arguments)}const Ho=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",zo({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"})))},Uo=(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 Fo(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){Vo(e,t,n[t])}))}return e}function Vo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Bo=e=>o().createElement(F.SvgIcon,e,o().createElement(Mo,null)),Wo=e=>o().createElement(F.SvgIcon,e,o().createElement(Ho,null)),qo=(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)})),Go=e=>{let{className:t,profileBandConfig:n}=e;const l=Uo(),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:Fo({},(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:Ro.Z,permission:"UPDATE"},{label:x().text("Suggesting"),value:b.fO_.SUGGESTING,description:x().text("Suggest changes and initiate a workflow review"),icon:Bo,permission:"INITIATE_CHANGE_REQUEST"},{label:x().text("Viewing"),value:b.fO_.VIEWING,description:x().text("Read or print profile"),icon:To.Z,permission:"READ"}]),[]),R=(0,r.useMemo)((()=>[...Z?[{label:x().text("Clone"),value:"Clone",description:x().text("Create a copy of the profile"),icon:Wo,onClick:()=>N(!0),permission:"CREATE"}]:[],{label:x().text("Delete"),value:"Delete",description:x().text("Permanently delete profile"),icon:Xe.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)((()=>qo(T,C,D,m,s)),[T,C,m,s,D]),A=(0,r.useMemo)((()=>qo(R,C,D,m,s)),[R,C,m,s,D]),M=(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(jo.Z,{className:L()(t,Et.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(Do.Z,null):h&&o().createElement(Io.a,null)),j&&o().createElement(Lo.T,{optionsGroup:I,buttonsGroup:A,value:g,onChange:M,disabled:O})),o().createElement(F.Box,{className:l.comments},o().createElement(wt.Z,{uri:u.uri,relatedObjectUris:(0,b.wp9)(b.q7e.ENTITY,{entityUri:u.uri}),objectType:b.q7e.ENTITY}))),!!Z&&o().createElement(We.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 _o=n(71820),$o=n(44021),Qo=n(26789),Xo=n(54362),Yo=n(6674),Ko=n(91515),Jo=n(52043),ea=n(17308),ta=n(39827),na=n(80147),ra=n(76569);const oa=(0,Q.Z)({wrapper:{display:"flex",overflow:"hidden",marginLeft:"auto",flexShrink:0},badge:{fontSize:"12px",height:"18px",minWidth:"18px",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px"}}),aa=()=>{const{total:e}=(0,r.useContext)(P.O),t=oa();return o().createElement(F.Badge,{badgeContent:e,classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(ra.Z,null))};var la=n(26313),ia=n(9371),ca=n(4426);const sa=(0,Q.Z)({wrapper:{overflow:"auto",paddingRight:"12px"},showMoreLink:{display:"flex",margin:"16px"},showMoreIcon:{fontSize:"1rem"}}),ua=()=>{const e=sa(),{getComments:t,comments:n,pageToken:l}=(0,r.useContext)(w.h),i=(0,a.useSelector)(y.ZP.selectors.getEntityUriWithDataTenant);(0,r.useEffect)((()=>{t(i)}),[t,i]);const c=(0,la.Q)(n);return o().createElement(Ne.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(ia.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(ca.Z,{className:e.showMoreIcon}),x().text("Show more"))))};var pa=n(46626);const da=(0,Q.Z)({wrapper:{overflow:"auto",position:"relative",height:"100%"}}),ma=()=>{const e=da(),{tasks:t,loading:n}=(0,r.useContext)(P.O);return o().createElement("div",{className:e.wrapper},n&&o().createElement(T.Z,null),t&&t.map((e=>o().createElement(pa.s,{key:e.taskId,task:e}))))};function ga(){return ga=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},ga.apply(this,arguments)}const fa=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",ga({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"})))))},ha=()=>{const{commentsMap:e}=(0,r.useContext)(w.h),t=oa();return o().createElement(F.Badge,{badgeContent:(0,b.mdt)(e),classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(fa,null))};var ba=n(10159);const ya=()=>o().createElement(ba.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.")}),va=()=>o().createElement(ba.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.")});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:"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"}))},wa=(0,Q.Z)({wrapper:{display:"flex",flexDirection:"column"},itemWrapper:{paddingLeft:"19px",paddingRight:"19px"}}),Ca=()=>{const e=wa(),t=(0,a.useSelector)(y.ZP.selectors.getDBConnectorSideViews);return o().createElement("div",{className:e.wrapper},t.map((t=>o().createElement(xr,{key:t.id,config:t,className:e.itemWrapper}))))};function Sa(){return Sa=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},Sa.apply(this,arguments)}let Oa;!function(e){e[e.Workflow=0]="Workflow",e[e.Collaboration=1]="Collaboration",e[e.History=2]="History",e[e.DBConnector=3]="DBConnector"}(Oa||(Oa={}));const Pa=e=>{if(e)return 1===e?x().text("${total} item",{total:e}):x().text("${total} items",{total:e})},Na=e=>{var t,n,l;let{commentId:c}=e;const s=oa(),u=(0,a.useSelector)(y.ZP.selectors.isWorkflowSideViewEnabled),p=(0,a.useSelector)(y.ZP.selectors.isWorkflowEnabled),d=(0,a.useSelector)(y.ZP.selectors.isCollaborationSideViewEnabled),m=(0,a.useSelector)(y.ZP.selectors.isDBConnectorSideViewEnabled),g=(0,a.useSelector)(y.ZP.selectors.isCollaborationEnabled),f=(0,a.useSelector)(y.ZP.selectors.getHistoryEvent),h=(0,a.useSelector)(y.ZP.selectors.getMetadata),v=(0,a.useSelector)(y.ZP.selectors.getEntity),E=(0,r.useContext)(P.O),C=(0,r.useContext)(w.h),[S,O]=(0,r.useState)(c?Oa.Collaboration:null),N=(0,r.useCallback)((e=>{O((t=>t===e?null:e))}),[]),k=(0,r.useCallback)((()=>{O(null)}),[]),Z=null!==S,T=S===Oa.History,{isHistoryEnabled:R,isProfilePersisted:j}=(0,_o.C)({isHistoryTabActive:T,entity:v}),{historyFilter:D,onApplyFilter:I,isLoading:L,historicUris:A,historyWithTotal:M,canLoadMore:z,onLoadMore:H}=(0,$o.k6)({entity:v,enabled:R}),U=u&&p&&!(0,b.ZiX)(null==v?void 0:v.uri),F=d&&g,V=(0,b.mdt)(null==C?void 0:C.commentsMap),B=[{buttonProps:{id:Oa.Workflow,icon:aa,tooltipTitle:x().text("Workflow")},content:null!=E&&E.total?o().createElement(ma,null):o().createElement(ya,null),headerProps:{mainTitle:x().text("Workflow"),secondTitle:Pa(null==E?void 0:E.total),rightContent:o().createElement(Qo.G,null)},hidden:!U},{buttonProps:{id:Oa.Collaboration,icon:ha,tooltipTitle:x().text("Collaboration")},content:V?o().createElement(ua,null):o().createElement(va,null),headerProps:{mainTitle:x().text("Collaboration"),secondTitle:Pa(V)},hidden:!F},{buttonProps:{id:Oa.History,icon:na.Z,tooltipTitle:x().text("History")},content:j?o().createElement(Xo.Z,{isLoading:L,historyWithTotal:M,contributorsUris:A,entityUri:null==v?void 0:v.uri,historyEvent:f,onLoadMore:H,canLoadMore:z}):o().createElement(Yo.Z,null),headerProps:{content:o().createElement(Ko.Z,{total:j?((null==A?void 0:A.length)||0)+1:void 0,entityType:(0,b.nt9)(h,null==v?void 0:v.type),filter:D,onApplyFilter:I})}},{buttonProps:{id:Oa.DBConnector,icon:Ea,tooltipTitle:x().text("D&B Connector")},content:o().createElement(Ca,null),headerProps:{mainTitle:x().text("D&B Connector")},hidden:!m}],W=(0,i.reject)((0,i.propEq)("hidden",!0))(B);return(0,r.useEffect)((()=>{var e;null!==(e=B[S])&&void 0!==e&&e.hidden&&k()}),[S,B,k,W]),o().createElement("div",{className:s.wrapper},o().createElement(Jo.h,{open:Z,width:480},!(null!==(t=B[S])&&void 0!==t&&t.hidden)&&o().createElement(o().Fragment,null,o().createElement(ea.P,Sa({},null===(n=B[S])||void 0===n?void 0:n.headerProps,{onClose:k})),null===(l=B[S])||void 0===l?void 0:l.content)),o().createElement(ta.G,{buttonsProps:(0,i.pipe)((0,i.reject)((0,i.propEq)("hidden",!0)),(0,i.pluck)("buttonProps"))(B),onButtonClick:N,activeIndexId:S}))};var ka=n(39781),Za=n(16715);const Ta="48px",Ra="1px solid rgba(0, 0, 0, .125)",ja=(0,Q.Z)((e=>({accordion:{borderTop:Ra,borderBottom:Ra,fontSize:"13px",boxShadow:"none","&:not(:first-child)":{borderTop:0},"&:before":{display:"none"},"&$accordionExpanded":{margin:"auto"}},accordionExpanded:{},accordionSummary:{display:"flex",alignItems:"center",height:Ta,minHeight:Ta,"&$accordionSummaryExpanded":{height:Ta,minHeight:Ta}},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"}}))),Da=ja;var Ia=n(38016);const La=(0,r.memo)((e=>{let{panels:t,expandedPanelId:n,onToggle:r,ErrorComponent:a}=e;const l=Da();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(Ia.Z,null)},i,o().createElement(F.Typography,{className:l.accordionSummaryHeading},c)),o().createElement(F.AccordionDetails,{className:L()(l.accordionDetails,p)},o().createElement("ul",null,s.map(((e,t)=>o().createElement(a,{key:t,error:e}))))))}))):null}));function Aa(){return Aa=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},Aa.apply(this,arguments)}La.displayName="ErrorsPanel";const Ma=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",Aa({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"}))},za=(0,i.omit)(["deactivated","path"]),Ha=(0,r.memo)((e=>{let{error:t}=e;const n=Da(),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)(Z.M),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(Ze.k,{icon:Ma,size:"XXS",onClick:()=>d(t),tooltipTitle:x().text("Go to error"),className:n.goToIcon})),u&&o().createElement("span",{className:n.parents},u)))}));Ha.displayName="Error";const Ua=()=>{const e=Da(),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(za),t.map(za))}(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(ka.Z,{className:L()(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(Za.Z,{className:L()(e.icon,e.warningIcon)}),items:l,accordionClassName:e.warningsAccordion,accordionDetailsClassName:e.warningsAccordionDetails}].filter((e=>{let{items:t}=e;return t.length>0}))),[n,l,e]);(0,r.useEffect)((()=>{s("errors")}),[n]);const p=(0,r.useCallback)((e=>(t,n)=>{s(n?e:null)}),[]);return u.length>0?o().createElement(La,{panels:u,expandedPanelId:c,onToggle:p,ErrorComponent:Ha}):null};var Fa=n(3096),Va=n.n(Fa),Ba=n(60641);function Wa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const qa={};var Ga=n(61756),_a=n(4109);function $a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Qa=(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%"}},profileContainer:{display:"flex",overflow:"hidden",flexGrow:1},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"}}))),Xa=(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=Qa({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.useDispatch)(),j=(0,E.u)(),D=(e=>{const t=(0,Ga.v)(e),n=(0,_a.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){$a(e,t,n[t])}))}return e}({},t,{onActionSuccess:n})),[t,n])})(p),{type:I,uri:L}=m||{},A=(0,r.useMemo)((()=>(0,b.dvH)(m)),[m]),M=(0,r.useContext)(w.h),z=(0,C.C)({objectIds:A}),{views:H,layout:U,isLoaded:F,handleLayoutChange:V}=(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,Nn.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){Wa(e,t,n[t])}))}return e}({},t,{views:e,layout:n})}),[t,u]),d=(0,r.useMemo)((()=>Va()(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=qa,updateSavedState:x}=(0,Ba.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:I,saveState:l,getSavedState:i});return(0,S.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)((()=>{v(y.N5.views.actions.profileViewsSet(H))}),[v,H]),(0,r.useEffect)((()=>{n.sidePanelViews&&v(y.N5.sidePanelViews.actions.sidePanelViewsLoaded(n.sidePanelViews))}),[n]),o().createElement(O.j.Provider,{value:!0},o().createElement(w.e,{collaboration:f?M:z},o().createElement(P.O.Provider,{value:D},o().createElement(N.m.Provider,{value:j},o().createElement(k.l.Provider,{value:h},o().createElement(Z.R,null,o().createElement("div",{className:d.perspectiveView},(!F||!L)&&o().createElement(T.Z,null),F&&L?o().createElement("div",{className:d.profileContainer},o().createElement("div",{className:d.profileWrapper},o().createElement(Go,{profileBandConfig:u}),!f&&o().createElement(Ua,null),o().createElement(Oo,{maxWidth:s,views:H,layout:U,entityUri:L,onLayoutChanged:V})),o().createElement(Na,{commentId:c})):o().createElement("div",{className:d.emptyState},o().createElement(R.ZP,{LogoRenderer:R.B9.NO_DATA,text:x().text("No data to display."),variant:R.tC.embedded})),o().createElement(Zo,null))))))))}));function Ya(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Xa.displayName="ProfilePerspectiveView";const Ka=(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 Ja=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){Ya(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:Ka},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(Xa,{config:N,saveState:x,getSavedState:S,commentId:C}),o().createElement(h.Z,{showErrorFromStore:!0}),o().createElement(O,null)))))))))};var el=n(82842),tl=n(51229),nl=n(91131);const rl=(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}}))),ol=e=>{let{total:t=0}=e;const n=rl(),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(V.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(nl.Z,{className:n.icon}),x().text("Tags")),o().createElement(tl.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 al=n(20404);const ll=(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"}}))),il=e=>{let{label:t}=e;const n=ll();return o().createElement(F.Toolbar,{className:n.toolbar},o().createElement(al.Z,{className:n.avatar}),o().createElement(F.Typography,{variant:"h6",className:n.label},t))};function cl(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){sl(e,t,n[t])}))}return e}function sl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ul=(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}}))),pl=[25,50,100],dl=(0,r.memo)((e=>{let{tag:t,entityUri:n}=e;const l=ul(),[c,s]=(0,r.useState)(pl[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,xe._)(),u=(0,xe._)(),[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=cl({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,cl({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>pl[0];return o().createElement("div",{className:l.perspectiveView},o().createElement(il,{label:t}),o().createElement("div",{className:L()(l.tagsContainer,{[l.fullHeight]:v})},o().createElement(H.Z,{className:l.tagsView},o().createElement(ol,{total:g}),o().createElement("div",{className:l.listContainer},m&&o().createElement(T.Z,null),g>0&&o().createElement("div",{className:l.entitiesList,ref:h},o().createElement(el.Z,{entities:f})),v&&o().createElement("div",{className:l.pagination},o().createElement(U.Z,{count:g,rowsPerPageOptions:pl,rowsPerPage:c,page:u,onChangePage:p,onChangeRowsPerPage:s}))))))}));dl.displayName="TagPerspectiveView";const ml=(0,c.createGenerateClassName)({productionPrefix:"tagPerspective",disableGlobal:!0}),gl=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:ml},o().createElement(s.Z,{handleHeight:!0,onResize:(e,t)=>u(Math.floor(e),Math.floor(t))}),t&&o().createElement(dl,{tag:n,entityUri:r}),o().createElement(h.Z,{showErrorFromStore:!0}))))};var fl=n(65321);const hl=(0,Q.Z)((()=>({actionsWrapper:{display:"flex","& button + button":{width:"88px",marginLeft:"8px"}}}))),bl=()=>{const e=hl(),t=(0,a.useSelector)(y.ZP.selectors.getEntity),{tasks:n}=(0,r.useContext)(P.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(jo.Z,{entity:t},o().createElement("div",{className:e.actionsWrapper},l&&o().createElement(fl.o,{task:l})))},yl=(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}})));function vl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const xl={processTypes:["dataChangeRequestReview"]},El=(0,r.memo)((()=>{const e=yl(),t=(0,a.useDispatch)(),n=(e=>{const t=(0,a.useDispatch)(),n=(0,a.useSelector)(y.ZP.selectors.getEntityUri),o=(0,Ga.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){vl(e,t,n[t])}))}return e}({},o,{onActionSuccess:l})),[o,l])})(xl),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(P.O.Provider,{value:n},o().createElement("div",{className:e.perspectiveView},!i&&o().createElement(T.Z,null),o().createElement("div",{className:e.perspectiveContainer},i?o().createElement(o().Fragment,null,o().createElement("div",{className:e.contentWrapper},o().createElement(bl,null),o().createElement("div",{className:e.attributesWrapper},o().createElement(A.Z,null))),o().createElement(Na,null)):o().createElement(R.ZP,{LogoRenderer:R.B9.NO_DATA,text:x().text("No data to display."),variant:R.tC.embedded}))))}));El.displayName="DCRReviewPerspectiveView";const wl=(0,c.createGenerateClassName)({productionPrefix:"dcrReviewPerspective",disableGlobal:!0}),Cl=e=>{let{config:t,store:n,onResize:r=i.identity}=e;return o().createElement(a.Provider,{store:n},o().createElement(m.m.Provider,{value:t.id},o().createElement(c.StylesProvider,{generateClassName:wl},o().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},o().createElement(o().Fragment,null,o().createElement(s.Z,{handleHeight:!0,onResize:(e,t)=>r(Math.floor(e),Math.floor(t))}),o().createElement(El,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(47401),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(39450),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 L=I;var A=n(92332),M=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(A.default,e),a().createElement(M.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 F(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const V=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),B=e=>{if(e.startsWith("relation.attributes")){const t=V(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){F(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:B(e.id),headCellRenderer:z,rowCellValueRenderer:(t=e.id,"entity.label"===t?L: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 Q=$;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 Y=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))(V(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(Q,{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}))};Y.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=Y;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(99341);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 Le(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ae=(0,i.pluck)("id",Ze),[Me]=Ae;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:Ae,sorting:{order:n.sortOrder||"asc",field:n.sortColumn||Me},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){Le(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:L,page:A,rowsPerPage:M,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]),F=(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:V}=(0,we.a)({sorting:L,filter:F,page:A,rowsPerPage:M,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,Q=f?[f,...b]:b,{canUpdate:X,canDelete:Y}=(0,Ce.l)(),J=X(n)&&!E,ee=Y(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})),Q.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:L,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:M,onChangeRowsPerPage:W,page:A,onChangePage:q,basicTableRef:te}):a().createElement(d.Typography,{className:C.noData},h().text("No data found")),V&&a().createElement(Ne.Z,null))))}));var Fe=n(36138),Ve=n(22664),Be=n(585);const We=(0,Fe.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(Fe.StylesProvider,{generateClassName:We},a().createElement(Ve.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=8213.js.map
|