@reltio/remotes 1.4.1620 → 1.4.1621

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/1039.js +1 -1
  2. package/1146.js +1 -1
  3. package/1148.js +1 -1
  4. package/1334.js +1 -1
  5. package/1425.js +1 -1
  6. package/1572.js +1 -1
  7. package/1664.js +1 -1
  8. package/1707.js +1 -1
  9. package/1790.js +1 -1
  10. package/1840.js +1 -1
  11. package/1925.js +1 -1
  12. package/2049.js +1 -1
  13. package/2066.js +1 -1
  14. package/2201.js +1 -1
  15. package/2400.js +1 -1
  16. package/2404.js +1 -1
  17. package/2463.js +1 -1
  18. package/2641.js +1 -1
  19. package/3096.js +1 -1
  20. package/3348.js +1 -1
  21. package/3358.js +1 -1
  22. package/3373.js +1 -1
  23. package/3381.js +1 -1
  24. package/3383.js +1 -1
  25. package/3463.js +1 -1
  26. package/3469.js +1 -1
  27. package/3538.js +1 -1
  28. package/356.js +1 -1
  29. package/3727.js +1 -1
  30. package/3727.js.map +1 -1
  31. package/3875.js +1 -1
  32. package/3902.js +1 -1
  33. package/3926.js +1 -1
  34. package/415.js +1 -1
  35. package/4212.js +1 -1
  36. package/4390.js +1 -1
  37. package/4481.js +1 -1
  38. package/4703.js +1 -1
  39. package/4780.js +1 -1
  40. package/4806.js +1 -1
  41. package/4838.js +1 -1
  42. package/50.js +1 -1
  43. package/5034.js +1 -1
  44. package/5039.js +1 -1
  45. package/5039.js.map +1 -1
  46. package/5053.js +1 -1
  47. package/5108.js +1 -1
  48. package/5163.js +1 -1
  49. package/5617.js +1 -1
  50. package/6020.js +1 -1
  51. package/6173.js +2 -0
  52. package/6173.js.map +1 -0
  53. package/6228.js +1 -1
  54. package/6280.js +76 -0
  55. package/{2966.js.LICENSE.txt → 6280.js.LICENSE.txt} +0 -10
  56. package/6280.js.map +1 -0
  57. package/6287.js +1 -1
  58. package/6531.js +2 -0
  59. package/6531.js.map +1 -0
  60. package/6606.js +1 -1
  61. package/673.js +1 -1
  62. package/673.js.map +1 -1
  63. package/6799.js +1 -1
  64. package/6844.js +1 -1
  65. package/6853.js +1 -1
  66. package/6860.js +1 -1
  67. package/6903.js +1 -1
  68. package/7340.js +1 -1
  69. package/735.js +1 -1
  70. package/7422.js +1 -1
  71. package/7626.js +1 -1
  72. package/764.js +1 -1
  73. package/7896.js +1 -1
  74. package/8168.js +56 -0
  75. package/8168.js.LICENSE.txt +9 -0
  76. package/8168.js.map +1 -0
  77. package/820.js +1 -1
  78. package/8207.js +1 -1
  79. package/8322.js +1 -1
  80. package/8565.js +1 -1
  81. package/8741.js +1 -1
  82. package/9016.js +1 -1
  83. package/9028.js +1 -1
  84. package/9283.js +1 -1
  85. package/9309.js +1 -1
  86. package/9328.js +1 -1
  87. package/9387.js +1 -1
  88. package/9719.js +1 -1
  89. package/9736.js +1 -1
  90. package/9861.js +1 -1
  91. package/987.js +1 -1
  92. package/99.js +1 -1
  93. package/9960.js +1 -1
  94. package/main.js +1 -1
  95. package/main.js.map +1 -1
  96. package/package.json +1 -1
  97. package/remoteEntry.js +1 -1
  98. package/remoteEntry.js.map +1 -1
  99. package/1488.js +0 -2
  100. package/1488.js.map +0 -1
  101. package/281.js +0 -2
  102. package/281.js.map +0 -1
  103. package/2966.js +0 -129
  104. package/2966.js.map +0 -1
package/9028.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6c90f965-084a-477c-b39f-1614e3eb4480",e._sentryDebugIdIdentifier="sentry-dbid-6c90f965-084a-477c-b39f-1614e3eb4480")}catch(e){}}();var _global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};_global.SENTRY_RELEASE={id:"1.4.1621"},(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[9028],{67462:(e,t,r)=>{r.d(t,{Z:()=>i});var n=r(24328),a=r.n(n),l=r(27536);function o(){return o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o.apply(this,arguments)}const i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r=(0,n.forwardRef)(((r,n)=>(0,l.S)()?a().createElement(e,o({},r,{ref:n})):t&&a().createElement(t,o({},r,{ref:n}))));return r.displayName="WithAsyncMount",r}},85777:(e,t,r)=>{r.d(t,{Z:()=>p});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(40435),s=r(89507);const c=(0,r(72342).makeStyles)({expandButton:{"&:hover":{backgroundColor:"transparent"}},expandIcon:{transition:"transform .15s ease"},expanded:{transform:"rotate(90deg)"}});function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}const p=e=>{const t=c(),{expanded:r,className:n}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["expanded","className"]);return a().createElement(i.Z,u({icon:s.Z,size:"XXS",disableRipple:!0,iconClassName:o()(t.expandIcon,{[t.expanded]:r}),className:o()(n,t.expandButton),"data-reltio-id":"arrow-expand-button"},l))}},17998:(e,t,r)=>{r.d(t,{Z:()=>p});var n=r(24328),a=r.n(n),l=r(2507),o=r.n(l),i=r(26482),s=r(79312);const c=(0,r(72342).makeStyles)({toolbar:{minHeight:"48px",padding:"8px 24px",lineHeight:"28px"},title:{fontSize:"18px",minWidth:"50px",fontWeight:"normal",lineHeight:"inherit",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}});function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}const p=e=>{let{title:t="",children:r=null,classes:n={}}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["title","children","classes"]);const p=c();return a().createElement(i.Z,u({className:n.root,classes:{root:p.toolbar}},l),a().createElement(s.Z,{className:n.title,classes:{root:p.title},variant:"h6"},o().text(t)),r)}},89925:(e,t,r)=>{r.d(t,{J:()=>K});var n=r(24328),a=r.n(n),l=r(83422),o=r(52730),i=r(2507),s=r.n(i),c=r(55485),u=r(79312),p=r(50985),m=r(50673),d=r(98538),g=r(39475),b=r(71153),f=r.n(b),h=r(50914),y=r(17512),x=r(63929),v=r(18527);const E=(e,t)=>{const r=e.relatedObjectUris.indexOf(t);if(r>=0)return e.relatedObjectUris[1-r]},w=e=>`${s().date(e,"LT")} ${s().date(e,"LL")}`,O=e=>`comment/${e.commentId}`,C=(e,t)=>`comment/${e.commentId}/reply/${t.replyId}`,N=(e,t)=>{let r=e;for(const e of t)r=r.split(`+${e}`).join(`@[${e}](${e})`);return r};var S=r(72342);const k=(0,S.makeStyles)((e=>({title:{marginBottom:"10px",color:e.palette.divider,fontSize:"12px",lineHeight:"14px"},label:{paddingLeft:"9px",borderLeft:"1px solid #D8D8D8",fontSize:"13px",color:e.palette.text.primary,lineHeight:"15px"},link:{color:e.palette.primary.main,textDecoration:"none"}})));function T(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const A=e=>{let{comment:t,className:r}=e;const i=k(),c=(0,o.useSelector)(m.ZP.selectors.getEntity),p=(0,o.useSelector)(m.ZP.selectors.getMetadata),d=(0,n.useContext)(x.X);return a().createElement(l.Z,{className:r},(()=>{switch(t.objectType){case y.q7e.ENTITY_ATTRIBUTE:{const e=(0,y.AFK)(t.objectId,c.type),r=(0,y.zeJ)(p,e);return a().createElement(a().Fragment,null,a().createElement(u.Z,{className:i.title},s().text("Selected attribute:")),a().createElement(u.Z,{className:i.label},null==r?void 0:r.label))}case y.q7e.RELATION_ATTRIBUTE:{const e=t.relatedObjectUris.find((0,h.startsWith)("configuration/relationTypes")),r=(0,y.AFK)(t.objectId,e),n=(0,y.zeJ)(p,r);return a().createElement(a().Fragment,null,a().createElement(u.Z,{className:i.title},s().text("Selected attribute:")),a().createElement(u.Z,{className:i.label},null==n?void 0:n.label))}case y.q7e.ENTITY:return a().createElement(a().Fragment,null,a().createElement(u.Z,{className:i.title},s().text("Selected profile:")),a().createElement(v.Z,{className:f()(i.label,i.link),value:(0,y.wwR)(c)},(0,y.idV)(c.label)));case y.q7e.RELATION:{const e=E(t,c.uri),r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){T(e,t,r[t])}))}return e}({},d[e]||{},{uri:e});return a().createElement(a().Fragment,null,a().createElement(u.Z,{className:i.title},s().text("Selected relation:")),a().createElement(u.Z,{className:i.label},a().createElement(v.Z,{className:i.link,value:(0,y.wwR)(c)},(0,y.idV)(c.label)),e&&a().createElement(a().Fragment,null,` ${s().text("to")} `,a().createElement(v.Z,{className:i.link,value:(0,y.wwR)(r)},r.label?(0,y.idV)(r.label):(0,y.BTI)(r)))))}case y.q7e.POTENTIAL_MATCH:{var e;const r=E(t,c.uri),n={uri:r,label:null===(e=d[r])||void 0===e?void 0:e.label};return a().createElement(a().Fragment,null,a().createElement(u.Z,{className:i.title},s().text("Selected potential match:")),a().createElement(u.Z,{className:i.label},a().createElement(v.Z,{className:i.link,value:(0,y.wwR)(c)},(0,y.idV)(c.label)),r&&a().createElement(a().Fragment,null,` ${s().text("and")} `,a().createElement(v.Z,{className:i.link,value:(0,y.wwR)(n)},n.label?(0,y.idV)(n.label):(0,y.BTI)(n)))))}default:return null}})())};var Z=r(89575);const P=(0,S.makeStyles)((e=>({root:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",wordBreak:"break-word"}}))),j=e=>{let{comment:t,className:r}=e;const l=P(),o=(0,n.useContext)(Z.s);return a().createElement(u.Z,{className:f()(l.root,r)},function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e=>e,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"+";const a=[];let l="",o=!1;for(let i=0;i<=e.length;i++){const s=e[i],c=e[i+1],u=i===e.length-1;l+=s,s===n&&0===i&&(o=!0),o&&t.includes(l.slice(n.length))&&(o=!1,a.push(r(l)),l=""),c===n&&(o=!0,a.push(l),l=""),u&&a.push(l)}return a}(t.content,t.namedUsers,(e=>{const t=o.find((t=>t.username===e.slice(1)));return t?a().createElement(c.Z,{href:`mailto:${t.email}`,underline:"hover"},e):e})).map(((e,t)=>a().createElement(n.Fragment,{key:t},e))))};var I=r(65439);const D=(0,S.makeStyles)((e=>({root:{width:"32px",height:"32px",fontSize:"12px",color:e.palette.text.secondary,backgroundColor:"rgba(144, 164, 174, 0.2)"}})));function V(){return V=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},V.apply(this,arguments)}const L=e=>{let{className:t,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","children"]);const l=D();return a().createElement(I.Z,V({},n,{className:f()(l.root,t)}),r.split(".").map((e=>e[0].toUpperCase())).join(""))};var R=r(1824),U=r(38677),M=r(2271);const _=(0,S.makeStyles)((e=>({root:{width:"100%",backgroundColor:"#fff",fontFamily:"Roboto","&__control":{fontSize:"13px"},"&__highlighter":{padding:"10px 22px",border:"1px solid transparent !important"},"&__input":{borderRadius:"2px",border:"1px solid rgba(0,0,0,0.12)",padding:"10px 22px",outline:0,overflow:"auto !important"},"&__suggestions":{padding:"8px 0",borderRadius:"4px",backgroundColor:"#fafafa !important",boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)",transform:"translateY(-100%)"},"&__suggestions__list":{maxHeight:"200px",overflowY:"scroll"},"&__suggestions__item":{padding:"6px 12px",color:e.palette.text.primary,fontSize:"13px",transition:e.transitions.create(["background-color"]),"&:hover, &--focused":{backgroundColor:"rgba(0,0,0,0.04)"}}},mention:{position:"relative",zIndex:1,color:e.palette.primary.main,textShadow:"1px 1px 1px white, 1px -1px 1px white, -1px 1px 1px white, -1px -1px 1px white",pointerEvents:"none"}})));function z(){return z=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},z.apply(this,arguments)}const B=e=>{let{onChange:t,className:r}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onChange","className"]);const o=_(),i=(0,n.useContext)(Z.s);return a().createElement(M.r,z({},l,{onChange:(e,r,n,a)=>{t(r,n,(0,h.uniq)(a.map((e=>{let{display:t}=e;return t.slice(1)}))))},className:f()(o.root,r)}),a().createElement(M.p,{trigger:"+",data:i.map((e=>{let{username:t}=e;return{id:t,display:t}})),displayTransform:(e,t)=>`+${t}`,appendSpaceOnAdd:!0,className:o.mention}))},F=(0,S.makeStyles)({root:e=>{let{isEditing:t}=e;return{padding:t?"6px 6px 6px 0":" 6px 6px 6px 8px",borderRadius:"4px",backgroundColor:t?"transparent":"rgba(0,114,206,0.06)"}},textField:e=>{let{isEditing:t}=e;return{maxWidth:t?"100%":"calc(100% - 40px)"}},form:{marginBottom:0},main:{display:"flex",alignItems:"center"},avatar:{marginRight:"8px"},buttons:e=>{let{isEditing:t}=e;return{marginLeft:t?"0":"40px",marginTop:"8px"}},button:{"& + $button":{marginLeft:"8px"}}}),H=e=>{switch(e){case"open":return s().text("Reply...");case"resolved":return s().text("Adding a comment will re-open this");default:return""}},q=e=>{let{inputRef:t,className:r,uri:i,relatedObjectUris:c,objectType:u,popperRef:p,comment:d,reply:g,isEditingComment:b,isEditingReply:y,onCancel:x}=e;const v=b||y,E=F({isEditing:v}),[w,S]=(0,n.useState)(!1),k=(0,o.useSelector)(m.ZP.selectors.getUserName),{createReply:T,createComment:A,sending:Z,editComment:P,editReply:j,getCommentState:I,updateCommentState:D,clearCommentState:V}=(0,n.useContext)(R.h),M=(e=>{let{comment:t,reply:r,isEditingComment:n,isEditingReply:a}=e;return(0,h.isNil)(t)?"comment/new":n?O(t):a?C(t,r):(e=>`comment/${e.commentId}/reply/new`)(t)})({comment:d,reply:g,isEditingComment:b,isEditingReply:y}),_=(e=>{let{comment:t,reply:r,isEditingComment:n,isEditingReply:a}=e;const l=n?t:a?r:null,{content:o="",namedUsers:i=[]}=l||{};return{value:N(o,i),plainTextValue:o,mentions:i}})({comment:d,reply:g,isEditingComment:b,isEditingReply:y}),{value:z=_.value,plainTextValue:q=_.plainTextValue,mentions:W=_.mentions}=I(i,M),$=""!==z.trim(),Y=w||$,X=null==d?void 0:d.status,G=()=>{null==x||x(),V(i,M)};(0,n.useEffect)((()=>{p&&p.current.forceUpdate()}),[p,Y]);const K=v?"small":"medium";return a().createElement(l.Z,{className:f()(E.root,r)},a().createElement("form",{onSubmit:e=>(e.preventDefault(),(0,h.cond)([[(0,h.always)(!d),()=>A({content:q,namedUsers:W,objectType:u,uri:i,relatedObjectUris:c})],[(0,h.always)(b),()=>P({content:q,namedUsers:W,commentId:d.commentId,objectType:u,replies:d.replies,relatedObjectUris:c,uri:i})],[(0,h.always)(y),()=>j({content:q,namedUsers:W,commentId:d.commentId,replyId:g.replyId})],[h.T,()=>T({content:q,namedUsers:W,commentId:d.commentId,action:"open"===d.status?"none":"reopen",uri:i})]])().then(G).catch(console.log)),className:E.form},a().createElement(l.Z,{className:E.main},!v&&a().createElement(L,{classes:{root:E.avatar}},k),a().createElement(B,{className:E.textField,disabled:Z,onChange:(e,t,r)=>D(i,M,{value:e,plainTextValue:t,mentions:r}),inputRef:t,value:z,onFocus:()=>S(!0),onBlur:()=>S(!1),placeholder:H(X)})),Y&&a().createElement(l.Z,{className:E.buttons},a().createElement(U.Z,{className:E.button,variant:"contained",color:"primary",disabled:!$||Z,type:"submit",size:K},((e,t,r)=>t||r?s().text("Edit"):"open"===e||"resolved"===e?s().text("Reply"):s().text("Comment"))(X,b,y)),a().createElement(U.Z,{disabled:Z,onClick:()=>G(),className:E.button,variant:"outlined",color:"primary",size:K},s().text("Cancel")))))},W=(0,S.makeStyles)((e=>({header:{display:"flex"},avatar:{marginRight:"8px"},username:{marginBottom:"1px",color:e.palette.text.primary,fontSize:"13px",fontWeight:500,lineHeight:"15px"},createdAt:{marginTop:"3px",marginRight:"4px",color:e.palette.text.secondary,fontSize:"11px",lineHeight:"13px",whiteSpace:"nowrap"},body:{marginLeft:"40px"},commentTarget:{marginTop:"-15px"},message:{marginTop:"12px"},dropdownMenu:{zIndex:"3000 !important"},buttons:{marginTop:"15px",marginBottom:"12px",display:"flex","& $button + $button":{marginLeft:"10px"}},button:{fontSize:"13px",lineHeight:"15px"}}))),$=e=>{let{onReply:t,className:r,uri:i,comment:b,relatedObjectUris:f,objectType:h}=e;const y=W(),x=(0,n.useRef)(),v=(0,o.useSelector)(m.ZP.selectors.getUserName),{commentId:E,createdBy:C,createdTime:N,status:S}=b,k="resolved"===S,T=C===v,{resolveThread:Z,reOpenThread:P,sending:I,deleteComment:D,updateCommentState:V,getCommentState:U}=(0,n.useContext)(R.h),M=O(b),{isEditing:_}=U(i,M),z=(0,n.useCallback)((e=>V(i,M,{isEditing:e})),[M,V,i]);(0,n.useEffect)((()=>{_&&x.current.focus()}),[_]);const B=(0,n.useMemo)((()=>k?[{text:s().text("Delete"),onClick:()=>D({uri:i,commentId:E})}]:[{text:s().text("Edit"),onClick:()=>z(!0)},{text:s().text("Delete"),onClick:()=>D({uri:i,commentId:E})}]),[E,D,k,z,i]),F=a().createElement(q,{inputRef:x,uri:i,relatedObjectUris:f,objectType:h,onCancel:()=>z(!1),isEditingComment:_,comment:b});return a().createElement(l.Z,{className:r},a().createElement(l.Z,{className:y.header},a().createElement(L,{classes:{root:y.avatar}},C),a().createElement(l.Z,{width:"100%"},a().createElement(u.Z,{className:y.username},C)),a().createElement(u.Z,{className:y.createdAt},w(N)),T&&a().createElement(d.Z,{buttonComponent:g.k,buttonProps:{icon:p.Z,tooltipTitle:s().text("Open menu")},popoverProps:{PopoverClasses:{root:y.dropdownMenu}},menuItems:B,menuId:"collaboration-comment-menu"})),a().createElement(l.Z,{className:y.body},a().createElement(A,{comment:b,className:y.commentTarget}),_?F:a().createElement(j,{comment:b,className:y.message}),a().createElement(l.Z,{className:y.buttons},a().createElement(c.Z,{className:y.button,onClick:t,component:"button",underline:"hover"},s().text("Reply")),!k&&a().createElement(c.Z,{disabled:I,className:y.button,onClick:()=>{Z({commentId:E,uri:i})},component:"button",underline:"hover"},s().text("Resolve")),k&&a().createElement(c.Z,{disabled:I,className:y.button,onClick:()=>{P({commentId:E,uri:i})},component:"button",underline:"hover"},s().text("Re-open")))))},Y=(0,S.makeStyles)((e=>({root:{display:"flex",padding:"8px",borderRadius:"4px",backgroundColor:"rgba(0,114,206,0.06)"},avatar:{marginRight:"8px"},header:{display:"flex",marginBottom:"8px"},username:{color:e.palette.text.primary,fontSize:"13px",fontWeight:500,lineHeight:"15px"},message:{marginBottom:"8px",color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px"},createdAt:{color:e.palette.text.secondary,fontSize:"11px",lineHeight:"13px",whiteSpace:"nowrap"},marked:{marginLeft:"8px",color:e.palette.text.secondary,fontSize:"13px",fontStyle:"italic",lineHeight:"15px"}}))),X=e=>{let{className:t,reply:r,uri:i,comment:c,popperRef:b}=e;const h=(0,n.useRef)(),{createdBy:y,action:x,createdTime:v}=r,E=y===(0,o.useSelector)(m.ZP.selectors.getUserName)&&"resolved"!==c.status,{deleteReply:O,updateCommentState:N,getCommentState:S}=(0,n.useContext)(R.h),k=C(c,r),{isEditing:T}=S(i,k),A=(0,n.useCallback)((e=>N(i,k,{isEditing:e})),[k,N,i]);(0,n.useEffect)((()=>{T&&h.current.focus()}),[T]);const Z=Y(),P=(0,n.useMemo)((()=>[{text:s().text("Edit"),onClick:()=>A(!0)},{text:s().text("Delete"),onClick:()=>O({uri:i,commentId:c.commentId,reply:r})}]),[O,i,c.commentId,r,A]),I=a().createElement(q,{inputRef:h,popperRef:b,uri:i,onCancel:()=>A(!1),isEditingReply:T,reply:r,comment:c});return a().createElement(l.Z,{className:f()(Z.root,t)},a().createElement(L,{classes:{root:Z.avatar}},y),a().createElement(l.Z,{flexGrow:1},a().createElement(l.Z,{className:Z.header},a().createElement(u.Z,{className:Z.username},y),"resolve"===x&&a().createElement(u.Z,{className:Z.marked},s().text("Marked as resolved")),"reopen"===x&&a().createElement(u.Z,{className:Z.marked},s().text("Re-opened"))),"resolve"!==x&&(T?I:a().createElement(j,{className:Z.message,comment:r})),a().createElement(u.Z,{className:Z.createdAt},w(v))),E&&a().createElement(d.Z,{buttonComponent:g.k,buttonProps:{icon:p.Z,tooltipTitle:s().text("Open menu")},menuItems:P,menuId:"collaboration-comment-menu"}))},G=(0,S.makeStyles)((()=>({root:{maxWidth:"100%",padding:"8px 4px 10px 16px"},messages:{},repliedComment:{marginBottom:"2px"},replies:{marginLeft:"40px"},sendMessageArea:{marginLeft:"40px"},comment:{}}))),K=(0,n.memo)((e=>{let{uri:t,relatedObjectUris:r,objectType:o,classes:i,popperRef:s,messagesRef:c,comment:u}=e;const p=(0,n.useRef)(),m=G({classes:i}),d=a().createElement(q,{className:m.sendMessageArea,inputRef:p,popperRef:s,uri:t,relatedObjectUris:r,objectType:o,comment:u});return a().createElement(l.Z,{className:m.root},u&&a().createElement(a().Fragment,null,a().createElement("div",{className:m.messages,ref:c},a().createElement($,{comment:u,uri:t,onReply:()=>{p.current.focus()},className:m.comment,relatedObjectUris:r,objectType:o}),a().createElement(l.Z,{className:m.replies},u.replies.map((e=>a().createElement(X,{key:e.replyId,className:m.repliedComment,reply:e,uri:t,comment:u}))))),d),!u&&d)}))},72316:(e,t,r)=>{r.d(t,{Z:()=>j});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(72342),s=r(62901);const c=(0,i.makeStyles)((()=>({root:{display:"flex",alignItems:"start"},addButton:{visibility:"hidden","&$showAlways":{visibility:"visible"},[`.${s.U}:hover &`]:{visibility:"visible"}},showAlways:{}})));var u=r(55962),p=r(1824),m=r(38309),d=r(2507),g=r.n(d),b=r(23883);function f(){return f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},f.apply(this,arguments)}const h=e=>a().createElement("svg",f({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},e),a().createElement("path",{d:"M2.8 1h14.4c.99 0 1.8.81 1.8 1.8v10.8c0 .99-.81 1.8-1.8 1.8H4.6L1 19V2.8C1 1.81 1.81 1 2.8 1z"})),y=(0,i.makeStyles)((()=>({root:{position:"relative",height:"18px",display:"flex",alignItems:"center",justifyContent:"center",marginLeft:"4px",cursor:"pointer"},icon:{"&:hover":{fillOpacity:.7}},childrenWrapper:{position:"absolute",width:"100%",height:"100%",lineHeight:"15px",display:"flex",alignItems:"center",justifyContent:"center",top:"-2px",left:0,right:0,bottom:0,color:"white",fontSize:"10px",pointerEvents:"none"}}))),x=a().forwardRef(((e,t)=>{let{children:r,onClick:n}=e;const l=y();return a().createElement(b.Z,{title:g().text("Show comment")},a().createElement("div",{ref:t,className:l.root,onClick:n},a().createElement(h,{className:l.icon}),a().createElement("div",{className:l.childrenWrapper},r)))}));x.displayName="CommentButton";const v=x;function E(){return E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},E.apply(this,arguments)}const w=e=>a().createElement("svg",E({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},e),a().createElement("path",{d:"M2.8 14.653L3.853 13.6H17.2V2.8H2.8v11.853zM17.2 1c.99 0 1.8.81 1.8 1.8v10.8c0 .99-.81 1.8-1.8 1.8H4.6L1 19V2.8C1 1.81 1.81 1 2.8 1h14.4zm-6.3 3.6H9.1v2.699L6.4 7.3v1.8l2.7-.001V11.8h1.8V9.099l2.7.001V7.3l-2.7-.001V4.6z"})),O=e=>{let{className:t,onClick:r}=e;const n=y();return a().createElement(b.Z,{title:g().text("Add comment")},a().createElement("div",{className:o()(n.root,t),onClick:r},a().createElement(w,{className:n.icon})))};var C=r(83422),N=r(79312),S=r(711),k=r(89925),T=r(39475),A=r(80233);const Z=(0,i.makeStyles)((e=>({root:{},header:{display:"flex",alignItems:"center",height:"48px",paddingLeft:"16px",paddingRight:"8px"},headerInfo:{marginRight:"auto",display:"flex",alignItems:"center"},title:{marginRight:"15px",color:e.palette.text.primary,fontSize:"16px"},counter:{paddingLeft:"15px",borderLeft:"1px solid rgba(0,0,0,0.12)",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"24px"},resolveButton:{zIndex:3e3,"&:hover":{backgroundColor:"transparent"}},popper:{width:"424px",borderRadius:"0 0 4px 4px"},collaborationItem:{padding:"0 0 10px 0"},comment:e=>{let{hasScroll:t}=e;return{marginLeft:"16px",marginRight:t?"2px":"8px"}},replies:e=>{let{hasScroll:t}=e;return{marginLeft:"8px",marginRight:t?"2px":"8px"}},sendMessageArea:e=>{let{hasScroll:t,scrollWidth:r}=e;return{marginLeft:"8px",marginRight:t?r+2:"8px"}},messages:{maxHeight:"400px",overflowY:"auto"}}))),P=e=>{let{uri:t,relatedObjectUris:r,objectType:l,anchorEl:o,onClose:i,open:s,comment:c}=e;const[u,m]=(0,n.useState)(0),d=Z({scrollWidth:u,hasScroll:0!==u}),b=(0,n.useRef)(null),{resolveThread:f,loading:h,sending:y}=(0,n.useContext)(p.h),x=1+(null==c?void 0:c.replies.length);return a().createElement(A.Z,{popperRef:b,anchorEl:o,open:s,placement:"right-start",onClose:i,className:d.popper},a().createElement(C.Z,{className:d.header},a().createElement(C.Z,{className:d.headerInfo},a().createElement(N.Z,{className:d.title},g().text("Comments")),c&&!h&&a().createElement(N.Z,{className:d.counter},g().number(x)," ",1===x?g().text("item"):g().text("items"))),c&&!h&&a().createElement(T.k,{className:d.resolveButton,size:"S",onClick:()=>{f({commentId:c.commentId,uri:t})},disabled:y,showForDisabled:!0,tooltipTitle:g().text("Resolve"),icon:S.Z,color:"primary"})),!h&&a().createElement(k.J,{popperRef:b,messagesRef:e=>{e&&m(e.offsetWidth-e.clientWidth)},classes:{root:d.collaborationItem,replies:d.replies,sendMessageArea:d.sendMessageArea,messages:d.messages,comment:d.comment},uri:t,relatedObjectUris:r,objectType:l,comment:c}))},j=e=>{let{className:t,uri:r,objectType:l,relatedObjectUris:i,onChangePopupVisibility:s,allowOnlyOneComment:d=!1,showAlways:g=!1}=e;const b=c(),[f,h]=(0,n.useState)(null),[y,x]=(0,n.useState)(!1),E=y&&Boolean(f),{currentComment:w,commentsMap:C,getComment:N,clearCurrentComment:S,objectTypes:k}=(0,n.useContext)(p.h),T=!!C&&(!k||k.includes(l)),A=((null==C?void 0:C[r])||[]).filter((e=>{let{status:t}=e;return"resolved"!==t})).reverse(),Z=!d||d&&0===A.length,j=null===w&&E;(0,u.D)((()=>{s&&s(E)}),[E]);const I=(0,n.useContext)(m.A),D=(0,n.useMemo)((()=>I?[...i,...I]:i),[I,i]);return T&&a().createElement("div",{className:o()(b.root,t)},Z&&a().createElement(O,{className:o()(b.addButton,{[b.showAlways]:g||j}),onClick:e=>{h(e.currentTarget),x(!0)}}),A.map((e=>{let{replies:t,commentId:r}=e;return a().createElement(v,{ref:r===(null==w?void 0:w.commentId)?h:null,key:r,onClick:()=>(e=>{N(e),x(!0)})(r)},1+t)})),a().createElement(P,{anchorEl:f,open:E,onClose:()=>{h(null),S(),x(!1)},uri:r,relatedObjectUris:D,objectType:l,comment:w}))}},30936:(e,t,r)=>{r.d(t,{l:()=>s});var n=r(13896),a=r(58651),l=r(24328),o=r.n(l);const i=(0,n.createDndContext)(a.default),s=e=>{const t=(e=>{const t=(0,l.useRef)(i);return e.children?o().createElement(n.DndProvider,{manager:t.current.dragDropManager},e.children):null})(e);return o().createElement(o().Fragment,null,t)}},98538:(e,t,r)=>{r.d(t,{Z:()=>w});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(50914),s=r(38677),c=r(18960),u=r(55962),p=r(80852),m=r(95341),d=r(79312),g=r(78223),b=r(47591);const f=(0,r(72342).makeStyles)((e=>({buttonRoot:{"&$selected":{color:e.palette.action.active,backgroundColor:(0,b.Fq)(e.palette.action.active,.12),"&:hover":{backgroundColor:(0,b.Fq)(e.palette.action.active,.15)}}},selected:{},paper:{minWidth:"112px"},menuItem:{minHeight:"32px"},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0}}))),h=(0,g.Z)(m.Z),y=(0,n.forwardRef)(((e,t)=>{let{item:r,onMenuClose:n=i.identity}=e;const l=f(),{disabled:o,text:s,tooltip:c,onClick:u,id:m="",selectable:g,selected:b}=r;return a().createElement(h,{tooltipTitle:c,showForDisabled:!0,classes:{root:l.menuItem},onClick:e=>{n(e),u(e)},disabled:o,ref:t,"data-modal":!0,"data-reltio-id":`reltio-search-menu-item${m}`},g&&a().createElement(p.Z,{checked:b,color:"primary"}),a().createElement(d.Z,{classes:{root:l.menuText}},s))}));y.displayName="MenuItemRenderer";const x=y;function v(){return v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},v.apply(this,arguments)}function E(e){let{className:t,menuId:r,buttonComponent:l=s.Z,buttonContent:p,menuItems:m=[],buttonProps:d={},popoverProps:g={},onMenuOpen:b=i.identity,onMenuClose:h=i.identity,MenuItemRenderer:y=x}=e;const E=l,w=f(),O=(0,n.useRef)(),[C,N]=(0,n.useState)(!1);(0,u.D)((()=>{C?b():h()}),[C]);const S=(0,n.useCallback)((e=>{null==e||e.stopPropagation(),N((e=>!e))}),[]);return a().createElement(a().Fragment,null,a().createElement(E,v({"data-reltio-id":"drop-down-menu-button",ref:O,className:o()(w.buttonRoot,{[w.selected]:C},t),onClick:S,"aria-pressed":C,"aria-controls":C?r:void 0,"aria-haspopup":"true"},d),p),a().createElement(c.Z,v({id:r,variant:"menu",open:C,autoFocus:!1,classes:{paper:w.paper},anchorEl:O.current,onClose:S,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},elevation:2,MenuListProps:{autoFocusItem:C}},g),m.map(((e,t)=>a().createElement(y,{item:e,key:t,onMenuClose:S})))))}E.displayName="DropDownMenuButton";const w=E},55401:(e,t,r)=>{r.d(t,{Z:()=>c});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(79312),s=r(95063);const c=e=>{let{className:t,message:r}=e;const n=(0,s.y)();return r?a().createElement(i.Z,{variant:"caption",className:o()(n.caption,t)},r):null}},93555:(e,t,r)=>{r.d(t,{Z:()=>m});var n=r(71153),a=r.n(n),l=r(55401),o=r(73074),i=r(95512),s=r(24328),c=r.n(s),u=r(95063);function p(){return p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},p.apply(this,arguments)}const m=(0,s.memo)((e=>{let{errorMessage:t,children:r,className:n,classes:s}=e,m=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["errorMessage","children","className","classes"]);const d=(0,u.y)(),g=!!t;return c().createElement(o.Z,p({variant:"standard",className:a()(d.wrapper,n,null==s?void 0:s.root),error:!0},m),r,g&&c().createElement(i.Z,{className:a()(d.helperText,null==s?void 0:s.helperText)},c().createElement(l.Z,{message:t})))}))},95063:(e,t,r)=>{r.d(t,{y:()=>n});const n=(0,r(72342).makeStyles)((e=>({wrapper:{width:"100%"},helperText:{margin:"3px 0 1px 12px"},caption:{display:"flex",color:e.palette.error.main,fontSize:"12px",lineHeight:"16px"}})))},26729:(e,t,r)=>{r.d(t,{f:()=>f,Z:()=>h});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(4836);function s(){return s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s.apply(this,arguments)}const c=e=>a().createElement("svg",s({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),a().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a().createElement("path",{d:"M0 0h24v24H0z"}),a().createElement("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zm-4.5-9l2.5 3.096V18H5l4.5-5.5 2.5 3.01L16.5 10zm-8-4a1.5 1.5 0 110 3 1.5 1.5 0 010-3z",fillOpacity:.12,fill:"#000",fillRule:"nonzero"})));var u=r(17512);const p=(0,r(72342).makeStyles)((e=>({root:{position:"relative"},image:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,objectFit:"cover",verticalAlign:"bottom"}},defaultContainer:{display:"flex",alignItems:"center",backgroundColor:"rgb(247, 247, 247)"},defaultImage:{width:"40px",height:"40px",marginLeft:"auto",marginRight:"auto",color:e.palette.text.secondary},hideImage:{display:"none"}})));function m(){return m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},m.apply(this,arguments)}const d="loading",g="loaded",b="error",f={SMALL:{imageWidth:114,imageHeight:114},MEDIUM:{imageWidth:162,imageHeight:162},LARGE:{imageWidth:192,imageHeight:192},OVERRIDE:{imageWidth:"unset",imageHeight:"unset"}},h=(0,n.memo)((e=>{const{src:t,className:r,containerClassName:l,size:s=f.SMALL,overlay:h=null}=e,y=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["src","className","containerClassName","size","overlay"]),x=s||f.SMALL,v=p(x),[E,w]=(0,n.useState)(d);(0,n.useEffect)((()=>{w(d)}),[t]);const O=E===d,C=E===g;return E===b?a().createElement("div",m({className:o()(v.defaultContainer,v.image,r)},y),a().createElement(i.Z,{className:v.defaultImage})):a().createElement("div",{className:o()(v.root,l)},!(0,u.O27)(t)&&a().createElement("img",m({src:t,className:o()(v.image,r,{[v.hideImage]:O}),onLoad:()=>{w(g)},onError:()=>{w(b)},alt:"image"},y)),O&&a().createElement("div",m({className:o()(v.defaultContainer,v.image,r)},y),a().createElement(c,{className:v.defaultImage})),C&&h)}))},22349:(e,t,r)=>{r.d(t,{Z:()=>w});var n=r(24328),a=r.n(n),l=r(2507),o=r.n(l),i=r(50914),s=r(71153),c=r.n(s),u=r(38677),p=r(50985),m=r(40435),d=r(98538),g=r(11376),b=r(43589),f=r(72342);const h=(0,f.makeStyles)((()=>({root:{fontSize:"24px",color:"#fff"}}))),y=e=>{let{checked:t,className:r,onClick:n}=e;const l=h(),o=t?b.Z:g.Z;return a().createElement(o,{className:c()(l.root,r),onClick:n})};var x=r(36746),v=r(79573);const E=(0,f.makeStyles)((()=>({overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",transition:"0.2s linear all","&:not($selected):not($selectionMode):hover":{backgroundColor:"rgba(0,0,0,0.6)"},userSelect:"none"},selected:{backgroundColor:"rgba(0,114,206,0.6)"},selectionMode:{cursor:"pointer","&:not($selected)":{backgroundColor:"rgba(0,0,0,0.6)"}},button:{padding:0,width:"100px",height:"36px",color:"#fff",fontSize:"14px",fontWeight:500,lineHeight:"16px",border:"1px solid rgba(255,255,255,0.25)",backgroundColor:"rgba(98,2,238,0)"},checkedIcon:{position:"absolute",left:"4px",top:"4px",cursor:"pointer"},actions:{display:"flex",alignItems:"center",position:"absolute",top:"4px",right:"4px"},actionButton:{color:"#fff",fontSize:"24px"},dropDownMenuButton:{margin:"0 2px 0 8px"}}))),w=(0,n.memo)((e=>{const{id:t,canBeSelected:r=!1,selected:l=!1,selectionMode:s=!1,onDeselect:g=v.ZT,onSelect:b=v.ZT,onShareLink:f,onSetAsDefault:h,onDelete:w,onDownload:O=v.ZT,onClick:C}=e,N=E(),[S,k]=(0,n.useState)(!1),T=(0,n.useMemo)((()=>[{text:o().text("Share link"),onClick:f},{text:o().text("Set as default"),onClick:h},{text:o().text("Delete"),onClick:w}].filter((0,i.prop)("onClick"))),[f,h,w]),A=e=>()=>(0,i.ifElse)((0,i.equals)(!0),g,b)(e),Z=r&&(l||S||s),P=!s&&!l&&S,j=r&&l;return a().createElement("div",{className:c()(N.overlay,{[N.selected]:l,[N.selectionMode]:s}),onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),onClick:s?A(l):e=>{e.currentTarget===e.target&&C()}},Z&&a().createElement(y,{className:N.checkedIcon,checked:l,onClick:A(l)}),P&&a().createElement("div",{className:N.actions},a().createElement(m.Z,{onClick:O,className:N.actionButton,icon:x.Z}),a().createElement(d.Z,{menuId:`image-overlay-actions-${t}`,buttonComponent:m.Z,buttonProps:{icon:p.Z,className:c()(N.actionButton,N.dropDownMenuButton)},menuItems:T})),j&&a().createElement(u.Z,{className:N.button,variant:"outlined",onClick:g},o().text("Deselect")))}))},95596:(e,t,r)=>{r.d(t,{C:()=>v,A:()=>x});var n=r(24328),a=r.n(n),l=r(2507),o=r.n(l),i=r(69089),s=r(290),c=r(13961),u=r(26482),p=r(83422),m=r(92679),d=r(15650);function g(){return g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},g.apply(this,arguments)}const b=e=>a().createElement("svg",g({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),a().createElement("defs",null,a().createElement("path",{d:"M14 5a1 1 0 011 1v12a1 1 0 01-1 1H4a1 1 0 01-1-1V6a1 1 0 011-1h10zm6 12v2h-3v-2h3zm2-4v2h-5v-2h5zm0-4v2h-5V9h5zm0-4v2h-5V5h5z",id:"Details_svg__a"})),a().createElement("g",{stroke:"none",strokeWidth:1,fillRule:"evenodd"},a().createElement("mask",{id:"Details_svg__b",fill:"#fff"},a().createElement("use",{xlinkHref:"#Details_svg__a"})),a().createElement("path",{mask:"url(#Details_svg__b)",d:"M0 0h24v24H0z"})));var f=r(39475),h=r(4270);const y=(0,r(72342).makeStyles)((()=>({paper:{backgroundColor:"rgba(0, 0, 0, .85)"},backdrop:{backgroundColor:"transparent"},toolbar:{paddingLeft:"20px",paddingRight:"20px"},appBar:{position:"relative",background:"linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 100%)"},closeButton:{marginRight:"28px"},closeIcon:{fontSize:"24px",color:"#fff"},headerLeft:{display:"flex",alignItems:"center",flex:2},headerCenter:{display:"flex",justifyContent:"center",flex:1},headerRight:{flex:2,display:"flex",justifyContent:"flex-end",alignItems:"center"},modeSwitcher:{backgroundColor:"#fff"},content:{padding:0}})));let x;!function(e){e.GALLERY_MODE="gallery",e.DETAILS_MODE="details"}(x||(x={}));const v=e=>{let{open:t,mode:r,children:l,header:g,onClose:v,onChangeMode:E}=e;const w=y(),O=(0,n.useMemo)((()=>[{id:x.GALLERY_MODE,title:o().text("Gallery"),Icon:d.Z},{id:x.DETAILS_MODE,title:o().text("Details"),Icon:b}]),[]);return a().createElement(i.Z,{classes:{paper:w.paper},open:t,BackdropProps:{className:w.backdrop},fullScreen:!0},a().createElement(c.Z,{classes:{colorPrimary:w.appBar}},a().createElement(u.Z,{className:w.toolbar},a().createElement(p.Z,{className:w.headerLeft},a().createElement(f.k,{tooltipTitle:o().text("Close"),onClick:v,className:w.closeButton,iconClassName:w.closeIcon,icon:m.default}),null==g?void 0:g.left),a().createElement(p.Z,{className:w.headerCenter},a().createElement(h.Z,{modes:O,modeId:r,onChange:E,className:w.modeSwitcher})),a().createElement(p.Z,{className:w.headerRight},null==g?void 0:g.right))),a().createElement(s.Z,{className:w.content},l))}},30357:(e,t,r)=>{r.d(t,{Z:()=>u});var n=r(24328),a=r.n(n),l=r(38529),o=r(71153),i=r.n(o);const s=(0,r(72342).makeStyles)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}})));function c(){return c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c.apply(this,arguments)}const u=e=>{const t=s(),r=(0,l.useInRouterContext)(),{href:n,className:o}=e,u=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["href","className"]),p=i()(t.link,o);return r&&n?a().createElement(l.Link,c({to:n.replace(window.location.origin,""),className:p},u)):a().createElement("a",c({href:n,className:p},u))}},80233:(e,t,r)=>{r.d(t,{Z:()=>m});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(12115),s=r(17055),c=r(7421);const u=(0,r(72342).makeStyles)((e=>{const t=e.palette.background.paper;return{paper:{backgroundColor:t,maxWidth:1e3},popper:{'&[data-popper-placement*="bottom"] $arrow':{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},'&[data-popper-placement*="top"] $arrow':{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},'&[data-popper-placement*="right"] $arrow':{left:0,marginLeft:"-0.71em",height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},'&[data-popper-placement*="left"] $arrow':{right:0,marginRight:"-0.71em",height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}},arrow:{overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:t,"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",boxShadow:e.shadows[1],backgroundColor:"currentColor",transform:"rotate(45deg)"}}}}));function p(){return p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},p.apply(this,arguments)}const m=e=>{let{children:t,className:r,classes:l,transition:m}=e,d=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","className","classes","transition"]);const g=u(),b=m?s.Z:a().Fragment,[f,h]=(0,n.useState)(null);return a().createElement(c.Z,p({className:o()(g.popper,r),modifiers:[{name:"preventOverflow",enabled:!0,options:{rootBoundary:"viewport",padding:14,altAxis:!0}},{name:"arrow",enabled:!0,options:{element:f,padding:4}}],transition:m,excludeAnchorFromBackdrop:!1},d),(e=>{let{TransitionProps:r}=e;return a().createElement(b,r,a().createElement(i.Z,{className:o()(g.paper,null==l?void 0:l.root)},a().createElement("span",{className:o()(g.arrow,null==l?void 0:l.arrow),ref:h}),t))}))}},14699:(e,t,r)=>{r.d(t,{Z:()=>p});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(32701),s=r(79312);const c=(0,r(72342).makeStyles)({label:{color:"rgba(0,0,0,0.6)",fontSize:"13px",lineHeight:"15px"}});function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}const p=e=>{let{label:t,isRequired:r,className:n}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","isRequired","className"]);const p=c();return a().createElement(s.Z,u({className:o()(p.label,n),component:"span"},l),t,r&&a().createElement(i.Z,null))}},52239:(e,t,r)=>{r.d(t,{Z:()=>c});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l);const i="1px solid #AFD4E9",s=(0,r(72342).makeStyles)({decorator:{marginLeft:8,borderLeft:i,"&:last-child":{borderLeft:"none","&:before":{borderLeft:i}},"&:before":{top:0,height:14,width:5,borderBottom:i,content:'""',display:"block",left:"0"},"&$plain":{"&:before":{width:0}}},plain:{},wrapper:{marginLeft:16,marginTop:-8}}),c=e=>{let{className:t,children:r,plain:n=!1,enabled:l=!1}=e;const i=s();return l?a().createElement("div",{className:o()(i.decorator,{[i.plain]:n},t)},a().createElement("div",{className:i.wrapper},r)):a().createElement(a().Fragment,null,r)}},4767:(e,t,r)=>{r.d(t,{Z:()=>g});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(19926),s=r(43407),c=r(78223);function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}const p=e=>a().createElement("svg",u({width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),a().createElement("path",{d:"M5.417 9.5h1.166V8.333H5.417V9.5zM6 .167A5.835 5.835 0 00.167 6 5.835 5.835 0 006 11.833 5.835 5.835 0 0011.833 6 5.835 5.835 0 006 .167zm0 10.5A4.673 4.673 0 011.333 6 4.673 4.673 0 016 1.333 4.673 4.673 0 0110.667 6 4.673 4.673 0 016 10.667zM6 2.5a2.333 2.333 0 00-2.333 2.333h1.166A1.17 1.17 0 016 3.667a1.17 1.17 0 011.167 1.166c0 1.167-1.75 1.021-1.75 2.917h1.166c0-1.313 1.75-1.458 1.75-2.917A2.333 2.333 0 006 2.5z",fill:"#000",fillOpacity:.54})),m=(0,r(72342).makeStyles)((()=>({container:{height:"15px",backgroundColor:"transparent","&:hover":{backgroundColor:"transparent"},"& $icon":{width:"12px",height:"12px",marginRight:0}},label:{paddingLeft:"4px",paddingRight:"4px",fontSize:"10px",lineHeight:"11px"},icon:{}}))),d=(0,c.Z)(i.Z),g=e=>{let{className:t,description:r}=e;const{showDescription:l}=(0,n.useContext)(s.Y),i=m();return r&&l?a().createElement(d,{tooltipTitle:r,tooltipPlacement:"bottom",icon:a().createElement(p,null),classes:{root:o()(i.container,t),label:i.label,icon:i.icon}}):null}},43253:(e,t,r)=>{r.d(t,{Z:()=>Ne});var n=r(24328),a=r.n(n),l=r(52730),o=r(44443),i=r(79312),s=r(50673),c=r(17512),u=r(65510),p=r(50914),m=r(83422),d=r(17283),g=r(78781),b=r(71153),f=r.n(b),h=r(26729),y=r(40435),x=r(72342);const v=(0,x.makeStyles)((e=>({root:{display:"flex",alignContent:"center",flexDirection:"column"},main:{position:"relative",padding:"0 86px",marginTop:"auto"},mainImageContainer:{display:"flex",alignContent:"center",height:"100%",width:"100%"},mainImage:{maxWidth:"calc(100vw - 512px)",maxHeight:"calc(100vh - 192px)",margin:"0 auto",userSelect:"none"},arrowButton:{backgroundColor:e.palette.divider,color:"white","&:hover":{backgroundColor:e.palette.divider}},arrowButtonPrev:{position:"absolute",top:"50%",left:"16px",transform:"translateY(-50%)"},arrowButtonNext:{position:"absolute",top:"50%",right:"16px",transform:"translateY(-50%)"}})));var E=r(63735);const w=(0,x.makeStyles)((()=>({thumbnails:{marginLeft:"12px",marginBottom:"12px",marginTop:"auto",width:"calc(100vw - 364px)",overflowX:"auto",overflowY:"hidden"},gridContainer:{width:"100%"},thumb:{width:"96px",height:"96px",cursor:"pointer",userSelect:"none"},inactiveThumb:{filter:"brightness(0.5)"}}))),O=e=>{let{attributeValues:t,setAttributeValueIndex:r,attributeValueIndex:l}=e;const o=w(),i=(0,n.useRef)(null);return(0,n.useEffect)((()=>{if(null!=i&&i.current){const e=i.current.scrollLeft,t=i.current.offsetWidth+e,r=96*l+16*l+12;t<r?i.current.scroll&&(r>t+96+16?i.current.scroll(r,0):i.current.scroll(112+e,0)):e+96>r&&i.current.scroll&&i.current.scroll(r-96,0)}}),[l,i]),a().createElement("div",{ref:i,className:o.thumbnails},a().createElement(E.ZP,{container:!0,wrap:"nowrap",direction:"row",spacing:1,className:o.gridContainer},t.map(((e,t)=>{let{uri:n,value:i}=e;return a().createElement(E.ZP,{item:!0,key:n},a().createElement(h.Z,{onClick:()=>r(t),className:f()(o.thumb,{[o.inactiveThumb]:l!==t}),src:(0,c.efz)({value:i})}))}))))},C=e=>{let{className:t,attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:l}=e;const o=v(),i=r[n],s=(0,c.QXK)(i);return a().createElement("div",{className:f()(o.root,t)},a().createElement("div",{className:o.main},n>0&&a().createElement(y.Z,{icon:d.Z,className:f()(o.arrowButton,o.arrowButtonPrev),onClick:()=>{l(n-1)},size:"XL"}),a().createElement(h.Z,{containerClassName:o.mainImageContainer,className:o.mainImage,size:s&&h.f.OVERRIDE,src:s}),n!==r.length-1&&a().createElement(y.Z,{icon:g.Z,className:f()(o.arrowButton,o.arrowButtonNext),onClick:()=>{l(n+1)},size:"XL"})),a().createElement(O,{attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:l}))};var N=r(2507),S=r.n(N),k=r(80852),T=r(30721),A=r(40476),Z=r(53626),P=r(56961),j=r(67283),I=r(95038),D=r.n(I);const V={get CreationTime(){return S().text("Creation Time")},get CreationDate(){return S().text("Creation Date")},get Dimensions(){return S().text("Dimensions")},get MimeType(){return S().text("Mime Type")},get Size(){return S().text("Size")},get Url(){return S().text("Full image URL (S3)")},get UrlPreview(){return S().text("Preview image URL (S3)")},get UrlThumbnail(){return S().text("Small image URL (S3)")},get CdnUrl(){return S().text("Full image URL (CDN)")},get CdnUrlPreview(){return S().text("Preview image URL (CDN)")},get CdnUrlThumbnail(){return S().text("Small image URL (CDN)")}},L=function(){let{value:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail","MimeType"].includes(t)?(0,p.path)([t,0,"value"],e):"CreationDate"===t&&(0,p.path)(["CreationTimestamp",0,"value"],e)?D()(e.CreationTimestamp[0].value).format("MM-DD-YYYY"):"CreationTime"===t&&(0,p.path)(["CreationTimestamp",0,"value"],e)?D()(e.CreationTimestamp[0].value).format("HH:mm:ss"):"Dimensions"===t&&(0,p.path)(["Height",0,"value"],e)&&(0,p.path)(["Width",0,"value"],e)?`${e.Height[0].value} x ${e.Width[0].value} ${S().text("pixels")}`:"Size"===t&&(0,p.path)(["Size",0,"value"],e)?`${(Number(e.Size[0].value)/1e3).toFixed(2)} KB`:void 0},R=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.filter((e=>{let{system:t}=e;return!t}))},U=(e,t)=>{const{includeNames:r=[],excludeNames:n=[],order:a=[]}=t,l=r.length?e.filter((e=>r.includes(e))):e.filter((e=>!n.includes(e)));return 0===a.length?l:l.sort(((e,t)=>{const r=a.indexOf(e),n=a.indexOf(t);return-1===r&&-1!==n?1:-1===n&&-1!==r?-1:r-n}))},M=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;const n=R(t.attributes);return U(Object.keys(e.value||{}),r).reduce(((t,r)=>{const a=n.find((e=>{let{name:t}=e;return t===r}));return a?[...t,{attrType:a,values:e.value[r]}]:t}),[])},_=e=>["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail"].includes(e),z=(0,x.makeStyles)({title:{marginBottom:"10px",color:"white",fontSize:"18px",lineHeight:"21px","&$canAdd":{marginBottom:"3px"}},divider:{width:"100%",height:"1px",borderColor:"rgba(255,255,255,0.12)"},canAdd:{}}),B=e=>{let{attributeType:t,onAddAttributes:r,uri:l}=e;const o=z(),s=R(t.attributes),c=Boolean(r);return a().createElement(m.Z,null,a().createElement(i.Z,{className:f()(o.title,{[o.canAdd]:c})},S().text("Meta info")),c&&a().createElement(n.Fragment,null,a().createElement(j.Z,{label:S().text("Attributes"),data:s,dense:!1,onApply:e=>{r&&r(e.map((e=>({attributeType:e,parentUri:l}))))}}),a().createElement(P.Z,{className:o.divider})))};var F=r(94319);const H=(0,x.makeStyles)((e=>({root:{fontSize:"13px",letterSpacing:0,lineHeight:"15px",marginBottom:"11px"},title:{color:"rgba(255,255,255,0.54)",marginRight:"12px",float:"left"},content:{color:"rgba(255,255,255,0.87)",wordWrap:"break-word"},link:{color:e.palette.primary.main,textDecoration:"none"}}))),q=e=>{let{title:t,content:r,isLink:n,children:l}=e;const o=H();return a().createElement("div",{className:o.root},a().createElement("span",{className:o.title},t),n?a().createElement("a",{className:o.link,href:r},S().text("link")):a().createElement("span",{className:o.content},r||l))},W=(0,x.makeStyles)({root:{padding:"10px 0"},title:{color:"rgba(255,255,255,0.54)",fontSize:"13px"},content:{color:"rgba(255,255,255,0.87)",wordWrap:"break-word"}}),$=e=>{let{attributeValue:t,attributeType:r,imageAttributeFieldsOrder:n}=e;const o=W(),i=(0,l.useSelector)(s.ZP.selectors.getIsViewMode),c=(u=t,p=n,U(Object.keys(V),p).map((e=>L(u,e)?{title:V[e],value:L(u,e),isLink:_(e)}:null)).filter(Boolean));var u,p;const d=M(t,r,n);return a().createElement(m.Z,{className:o.root},c.map((e=>{let{title:t,value:r,isLink:n}=e;return a().createElement(q,{key:t,isLink:n,title:t,content:r})})),i&&d.map((e=>{let{attrType:r,values:n}=e;return a().createElement(F.Z,{key:r.uri,attributeType:r,drawLines:!1,values:n,titleClassName:o.title,contentClassName:o.content,parentUri:t.uri})})))};var Y=r(38677),X=r(55752);const G=(0,x.makeStyles)({root:{},form:{padding:"10px 0"},divider:{width:"100%",height:"1px",borderColor:"rgba(255,255,255,0.12)"},actions:{display:"flex",justifyContent:"flex-end",marginTop:"4px"},cancelButton:{color:"white",marginRight:"8px"}}),K=e=>{let{attributeType:t,imageAttributeFieldsOrder:r,attributeValue:n,hasChanges:l,onDeleteAttribute:o,onChangeAttribute:i,onAddAttributes:s,onCancel:u,onApply:p,mode:d}=e;const g=G(),b=M(n,t,r),f=0!==b.length||0===b.length&&l;return a().createElement(m.Z,{className:g.root},a().createElement(m.Z,{className:g.form},b.map((e=>{let{attrType:t,values:r}=e;return a().createElement(X.ZP,{key:t.uri,parentUri:n.uri,attributeType:t,values:r,showEmptyEditors:(0,c.ZiX)(n.uri),mode:d,drawLines:!1,onDeleteAttribute:o,onChangeAttribute:i,onAddAttributes:s})}))),f&&a().createElement(a().Fragment,null,a().createElement(P.Z,{className:g.divider}),a().createElement(m.Z,{className:g.actions},a().createElement(Y.Z,{disabled:!l,onClick:u,className:g.cancelButton},S().text("Cancel")),a().createElement(Y.Z,{disabled:!l,onClick:p,color:"primary"},S().text("Apply")))))};var J=r(63532);const Q={palette:{mode:"dark",primary:c.rSc.palette.primary,secondary:c.rSc.palette.secondary}},ee=(0,A.Z)(Q),te=e=>{let{imageAttributeFieldsOrder:t,attributeType:r,attributeValue:o}=e;const{addAttributes:i,changeAttribute:u,deleteAttribute:d,clearLocalChanges:g,applyLocalChanges:b,attributeValue:f,hasChanges:h}=(e=>{let{initialAttributeValue:t,attributeType:r}=e;const a=(0,l.useDispatch)(),o=(0,n.useContext)(J.m),[i,u]=(0,n.useState)(t);(0,n.useEffect)((()=>{u(t)}),[t]);const m=!(0,p.equals)(i,t),d=(0,n.useCallback)((e=>{u((t=>e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,c.tPT)({entity:e,attributeType:r,parentUri:n,index:a,nestingLevel:1})}),t)))}),[]),g=(0,n.useCallback)((e=>{let{value:t,attributeType:r,uri:n}=e;u((e=>(0,c.ww$)({entity:e,attributeType:r,uri:n,value:t,nestingLevel:1})))}),[]),b=(0,n.useCallback)((e=>{let{attributeType:t,uri:r}=e;u((e=>(0,c.d$I)({entity:e,attributeType:t,uri:r,nestingLevel:1})))}),[]);return{addAttributes:d,changeAttribute:g,deleteAttribute:b,clearLocalChanges:(0,n.useCallback)((()=>{u(t)}),[t]),applyLocalChanges:(0,n.useCallback)((()=>{a(s.N5.actions.modifyAttribute({value:i,attributeType:r,uri:i.uri,viewId:o}))}),[i,r,o,a]),attributeValue:i,hasChanges:m}})({attributeType:r,initialAttributeValue:o}),y=(0,l.useSelector)(s.ZP.selectors.getMode),x=(0,l.useSelector)(s.ZP.selectors.getIsEditableMode);return a().createElement(Z.Z,{theme:ee},a().createElement(m.Z,null,a().createElement(B,{attributeType:r,uri:null==f?void 0:f.uri,onAddAttributes:x?i:void 0}),a().createElement($,{attributeType:r,attributeValue:f,imageAttributeFieldsOrder:t}),x&&a().createElement(K,{mode:y,imageAttributeFieldsOrder:t,attributeType:r,attributeValue:f,hasChanges:h,onDeleteAttribute:d,onChangeAttribute:u,onAddAttributes:i,onCancel:g,onApply:b})))},re=(0,x.makeStyles)((e=>({root:{position:"relative",backgroundColor:"#333",maxHeight:"calc(100vh - 64px)",overflow:"hidden"},header:{display:"flex",alignItems:"center",height:"56px",paddingLeft:"16px",boxShadow:`0 1px 0 0 ${e.palette.divider}`},headerTitle:{color:"rgba(255, 255, 255, 0.87)",fontSize:"16px",lineHeight:"19px"},bodyWrapper:{maxHeight:"calc(100% - 56px)",overflow:"auto"},body:{padding:"16px"},formControlLabel:{marginLeft:0,marginBottom:"27px"},checkboxLabel:{marginLeft:"8px",color:"rgba(255,255,255,0.87)",fontSize:"13px",lineHeight:"15px"},checkbox:{color:"white",padding:0}}))),ne=e=>{let{className:t,attributeValue:r,handleSetAsDefault:o,attributeType:c}=e;const u=re(),p=(0,l.useSelector)(s.ZP.selectors.getEntity)||{},d=(0,l.useSelector)((e=>s.ZP.selectors.getModifiedEntity(e,null==p?void 0:p.uri)))||{},g=(0,l.useSelector)(s.ZP.selectors.getIsViewMode)?p:d,b=(0,l.useSelector)(s.ZP.selectors.getImageAttributesFieldsOrder)||{},h=b[null==p?void 0:p.type]||(null==b?void 0:b.default)||{},[y,x]=(0,n.useState)(!1);(0,n.useEffect)((()=>{x((null==g?void 0:g.defaultProfilePic)===(null==r?void 0:r.uri))}),[null==r?void 0:r.uri,g]);const v=(0,n.useCallback)((()=>{o(r.uri)}),[null==r?void 0:r.uri]);return a().createElement(m.Z,{className:f()(u.root,t)},a().createElement(m.Z,{className:u.header},a().createElement(i.Z,{className:u.headerTitle},S().text("Details"))),a().createElement(m.Z,{className:u.bodyWrapper},a().createElement(m.Z,{className:u.body},a().createElement(T.Z,{classes:{root:u.formControlLabel,label:u.checkboxLabel},control:a().createElement(k.Z,{className:u.checkbox,checked:y,onChange:v}),label:S().text("Set as default")}),a().createElement(te,{attributeType:c,imageAttributeFieldsOrder:h,attributeValue:r}))))},ae=(0,x.makeStyles)((()=>({root:{display:"flex",width:"100%",overflowY:"auto",height:"calc(100vh - 64px)"},main:{flex:"1 0 auto"},details:{width:"340px"}}))),le=e=>{let{attributeValues:t=[],currentAttributeValueUri:r,setCurrentAttributeValueUri:l,handleSetAsDefault:o,attributeType:i}=e;const[s,c]=(0,n.useState)(0);(0,n.useEffect)((()=>{u(r?t.findIndex((e=>e.uri===r)):0)}),[r,t]);const u=(0,n.useCallback)((e=>{var r;c(e),l(null===(r=t[e])||void 0===r?void 0:r.uri)}),[t]),p=ae();return a().createElement(m.Z,{className:p.root},a().createElement(C,{attributeValueIndex:s,setAttributeValueIndex:u,attributeValues:t,className:p.main}),a().createElement(ne,{handleSetAsDefault:o,attributeValue:t[s],className:p.details,attributeType:i}))};var oe=r(95596),ie=r(22349);const se=(0,x.makeStyles)((()=>({root:{padding:"0 24px",overflowY:"auto",height:"calc(100vh - 64px)"},item:{padding:"2px"}}))),ce=e=>{let{items:t,selectedItems:r,onSelectImage:n,onDeselectImage:l,onShareLink:o,onSetAsDefault:i,onDownload:s,onClickImage:c,onDelete:u}=e;const p=se(),d=e=>a().createElement(ie.Z,{id:e,selected:r.includes(e),selectionMode:0!==r.length,onSelect:()=>n(e),onDeselect:()=>l(e),onShareLink:()=>o(e),onSetAsDefault:()=>i(e),onDownload:()=>s(e),onClick:()=>c(e),onDelete:u?()=>u(e):void 0,canBeSelected:!0});return a().createElement(m.Z,{className:p.root},a().createElement(E.ZP,{container:!0},t.map((e=>{let{id:t,src:r}=e;return a().createElement(E.ZP,{key:t,classes:{item:p.item},item:!0},a().createElement(h.Z,{size:h.f.LARGE,onClick:()=>c(t),src:r,overlay:d(t)}))}))))};var ue=r(55485);const pe=(0,x.makeStyles)((e=>({selectButton:{fontSize:"14px",fontWeight:500,color:e.palette.primary.main,textTransform:"uppercase"}}))),me=e=>{let{selectedItems:t,items:r,onSelectAll:n,onClearAll:l}=e;const o=pe(),i=t.length===r.length;return a().createElement(ue.Z,{component:"button",underline:"none",classes:{button:o.selectButton},onClick:i?l:n},i?S().text("Clear selection"):S().text("Select all images"))};var de=r(18169),ge=r(6163),be=r(34506),fe=r(36746),he=r(39475);const ye=(0,x.makeStyles)((()=>({downloadButton:{color:"#fff",fontSize:"24px",marginLeft:"30px"},shareButton:{color:"#fff",fontSize:"24px",marginLeft:"21px"},deleteButton:{color:"#fff",fontSize:"24px",marginLeft:"24px"},divider:{height:"31px",width:"1px",marginLeft:"10px",backgroundColor:"rgba(255,255,255,0.38)"}}))),xe=e=>{let{onDownload:t,onShare:r,onUpload:n,onDelete:l}=e;const o=ye();return a().createElement(a().Fragment,null,n&&a().createElement(Y.Z,{variant:"contained",color:"primary",onClick:n,startIcon:a().createElement(de.Z,null)},S().text("Upload")),t&&n&&a().createElement("div",{className:o.divider}),t&&a().createElement(he.k,{className:o.downloadButton,tooltipTitle:S().text("Download selected items"),icon:fe.Z,onClick:t}),r&&a().createElement(he.k,{className:o.shareButton,tooltipTitle:S().text("Copy link"),icon:be.Z,onClick:r}),l&&a().createElement(he.k,{className:o.deleteButton,tooltipTitle:S().text("Delete selected items"),icon:ge.Z,onClick:l}))},ve=e=>{let{attributeValues:t,open:r,onClose:o,currentAttributeValueUri:i,setCurrentAttributeValueUri:u,attributeType:m,onDownload:d,onShareLink:g,onSetAsDefault:b,onUpload:f,onDeleteAttribute:h}=e;const[y,x]=(0,n.useState)([]),[v,E]=(0,n.useState)(oe.A.GALLERY_MODE),w=(0,l.useSelector)(s.ZP.selectors.getIsViewMode);(0,n.useEffect)((()=>{E(i?oe.A.DETAILS_MODE:oe.A.GALLERY_MODE)}),[i]);const O=t.map((e=>({src:(0,c.efz)(e),downloadURL:(0,c.Q5d)(e),id:e.uri}))),C=e=>{g(O.find((0,p.propEq)("id",e)).downloadURL)},N=e=>{const r=t.find((t=>{let{uri:r}=t;return r===e}));b(r)},S=e=>{h({uri:e,attributeType:m})},k=v===oe.A.GALLERY_MODE,T=v===oe.A.DETAILS_MODE,A=y.length>0,Z=T||k&&A,P=!w&&Z,j=!w&&(T||k&&!A),I=k&&A&&a().createElement(me,{items:O,selectedItems:y,onClearAll:()=>{x([])},onSelectAll:()=>{x((0,p.pluck)("id",O))}}),D=a().createElement(xe,{onDelete:P?()=>{(k?y:[i]).forEach((e=>{S(e)})),y.length&&x([])}:void 0,onDownload:Z?()=>{const e=k?(0,p.pipe)((0,p.filter)((e=>{let{id:t}=e;return y.includes(t)})),(0,p.pluck)("downloadURL"))(O):[O.find((0,p.propEq)("id",i)).downloadURL];d(e)}:void 0,onShare:T?()=>{C(i)}:void 0,onUpload:j?f:void 0});return a().createElement(oe.C,{mode:v,open:r,onChangeMode:E,header:{left:I,right:D},onClose:o},k&&a().createElement(ce,{items:O,selectedItems:y,onSelectImage:e=>{x((t=>[...t,e]))},onDeselectImage:e=>{x((t=>t.filter((t=>t!==e))))},onShareLink:C,onSetAsDefault:N,onDownload:e=>{d([O.find((0,p.propEq)("id",e)).downloadURL])},onClickImage:e=>{u(e),E(oe.A.DETAILS_MODE)},onDelete:w?void 0:S}),T&&a().createElement(le,{handleSetAsDefault:N,setCurrentAttributeValueUri:u,currentAttributeValueUri:i,attributeValues:t,attributeType:m}))};var Ee=r(91446),we=r(47591);const Oe=(0,x.makeStyles)((e=>({imageBox:{position:"relative",display:"flex",width:"100%",flexGrow:1,flexShrink:0,flexWrap:"nowrap",marginTop:"2px",overflow:"hidden"},moreButtonContainer:e=>{let{imageWidth:t,imageHeight:r}=e;return{backgroundColor:"white",width:t,height:r,position:"absolute",right:0,cursor:"pointer"}},moreButton:t=>{let{imageWidth:r,imageHeight:n}=t;return{display:"flex",justifyContent:"center",alignItems:"center",width:r,height:n,backgroundColor:(0,we.Fq)(e.palette.primary.main,.06)}},number:{color:e.palette.primary.main,fontSize:"24px",lineHeight:"42px",letterSpacing:0,textAlign:"center",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}})));function Ce(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ne=e=>{let{attributeType:t,attributeValues:r=[],renderImage:p,overlay:m=!1,countFixedItems:d=0,children:g,onUpload:b,onDeleteAttribute:f,imageSize:h=Ee.By,paging:y,parentUri:x,showNonOv:v,requestNextPageOfAttributeValues:E}=e;const w=(0,l.useSelector)(s.ZP.selectors.getEntity)||{},O=(0,l.useSelector)(s.ZP.selectors.getIsViewMode),C=(0,l.useDispatch)(),N=Oe(h);(0,n.useEffect)((()=>{if(y&&E){const e=v?y.totalOvValues:y.totalValues;e>r.length&&E({parentUri:x,attributeTypeUri:t.uri,attributeTypeName:t.name,values:[],defaultMaxValues:e})}}),[y,E,t,x,r.length,v]);const S=(0,n.useRef)(),[k,T]=(0,n.useState)(0),[A,Z]=(0,n.useState)(0),P=(0,n.useContext)(u.P),[j,I]=(0,n.useState)(!1),[D,V]=(0,n.useState)(),L=(0,n.useCallback)((e=>{const{imageMargin:t,imageWidth:n}=h,a=Math.floor((e+t)/(n+t))-d,l=e+t-(a+d)*(n+t)<Ee.lc;T(a),r.length>a?Z(r.length-a+(l?1:0)):Z(0)}),[r.length,d,h]),R=(0,n.useCallback)((e=>{L(e),S.current=e}),[L]);(0,n.useEffect)((()=>{S.current&&L(S.current)}),[r.length,L]);const U=(0,n.useCallback)((e=>{P||(V(e),I(!0))}),[P]),M=(0,n.useCallback)((()=>{I(!1)}),[]),_=e=>(e=>{e.forEach(((e,t)=>{try{if((e=>!!(e=>e.indexOf("://")>0||0===e.indexOf("//"))(e)&&new URL(e).host!==location.host)(e)){const r=document.createElement("iframe");r.setAttribute("style","display: none;"),r.setAttribute("src",e),document.body.appendChild(r),setTimeout((()=>document.body.removeChild(r)),3e4*(t+1))}else{const t=document.createElement("a");t.href=e,t.download=(e=>e.split("/").pop())(e),document.body.appendChild(t),t.click(),document.body.removeChild(t)}}catch(e){console.error(e)}}))})(e),z=e=>navigator.clipboard.writeText(e),B=(0,n.useCallback)((e=>{O?(0,c.YL3)(w.uri,e.uri).then((t=>{let{status:r}=t;"success"===r&&C(s.N5.entity.actions.setDefaultProfilePic(e))})):C(s.N5.modifiedEntities.actions.setDefaultProfilePic({entityUri:w.uri,value:e}))}),[O,w.uri,C]),F=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ce(e,t,r[t])}))}return e}({onOpenImageGalleryDialog:U},m&&{onDownload:_,onShareLink:z,onSetAsDefault:B});return a().createElement(a().Fragment,null,a().createElement(o.Z,{handleWidth:!0,onResize:R}),a().createElement(ve,{attributeValues:r,open:j,onClose:M,setCurrentAttributeValueUri:V,currentAttributeValueUri:D,attributeType:t,onDownload:_,onShareLink:z,onSetAsDefault:B,onUpload:b,onDeleteAttribute:f}),a().createElement("div",{className:N.imageBox},g,r.slice(0,k).map(p(F)),A>0&&a().createElement("div",{className:N.moreButtonContainer},a().createElement("div",{className:N.moreButton,onClick:()=>U()},a().createElement(i.Z,{className:N.number},`+${A}`)))))}},91446:(e,t,r)=>{r.d(t,{lc:()=>o,By:()=>i});var n=r(26729);const a=n.f.SMALL.imageWidth,l=n.f.SMALL.imageHeight,o=8,i={imageMargin:4,imageWidth:a,imageHeight:l}},33043:(e,t,r)=>{r.d(t,{Z:()=>h});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(52730),s=r(19926),c=r(17512),u=r(50673),p=r(67586),m=r(78223),d=r(10609),g=r(47591);const b=(0,r(72342).makeStyles)((e=>({container:{height:"16px",borderColor:(0,g.Fq)(e.palette.primary.main,.54)},label:{paddingLeft:"4px",paddingRight:"4px",fontSize:"10px",lineHeight:"11px",color:e.palette.primary.main}}))),f=(0,m.Z)(s.Z),h=e=>{let{className:t,attributeType:r,nonOvValues:l=[],nonOvTotal:s}=e;const m=b(),g=(0,i.useDispatch)(),h=((e,t)=>{var r;const n=null==t||null===(r=t[0])||void 0===r?void 0:r.uri,a=n?(0,c.Uk3)(n):null;return a&&(0,c.WgC)(a)?a:null==e?void 0:e.uri})((0,n.useContext)(d.u),l),y=(0,n.useCallback)((()=>{g(u.ui.actions.openEntity({uri:h,viewId:null,screen:"sources"}))}),[g,h]);if(!s)return null;const x=l.length?l.map(((e,t)=>a().createElement("div",{key:t},(0,c.YkM)(r)?(0,c.idV)(e.label):a().createElement(p.Z,{value:(0,c.kDl)(e),dataTypeDefinition:(0,c.PFL)(r),rich:!1})))):null;return a().createElement(f,{tooltipTitle:x,tooltipPlacement:"bottom",label:`+ ${s}`,variant:"outlined",onClick:h?y:void 0,classes:{root:o()(m.container,t),label:m.label}})}},32826:(e,t,r)=>{r.d(t,{m:()=>j});var n=r(24328),a=r.n(n),l=r(52730),o=r(23883),i=r(50673),s=r(17512),c=r(50914),u=r(80687);const p=(e,t,r,n)=>{const a=((e,t)=>{const r=t.find((t=>t.uri===e.uri));return r&&Array.isArray(r.children)?r.children:[]})(e,r);let l=(null==e?void 0:e.attributes)||(null==e?void 0:e.analyticsAttributes)||[];return a.length&&(l=l.filter((e=>a.includes(e.uri)))),l.reduce(((e,a)=>{const l=m(t[a.name],n,r);return l&&l.length&&(Array.isArray(l[0])?e.push({[a.uri]:l[0]}):e.push({[a.uri]:l})),e}),[])},m=(e,t,r)=>{if(e&&0!==e.length)return e.reduce(((e,n)=>{if("type"in n&&n.type){const a="lookupCode"in n?n.lookupCode:n.value,l=(0,s.zeJ)(t,n.type);a&&"object"!=typeof a&&(0,s.OXP)(n)?e.push(d(a,l)):a&&"object"==typeof a&&!Array.isArray(a)&&e.push(p(l,a,r,t))}return e}),[])},d=(e,t)=>{switch(null==t?void 0:t.type){case s.oS0.TYPE_DATE:return new Date(e).getTime();case s.oS0.TYPE_TIMESTAMP:return isNaN(Number(e))?new Date(e).getTime():new Date(Number(e)).getTime();default:return e}};function g(){return g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},g.apply(this,arguments)}const b=e=>a().createElement("svg",g({width:11,height:11,viewBox:"0 0 11 11"},e),a().createElement("path",{d:"M2.514 5h2.314V3l2.5 2.5-2.5 2.5V6h-3.8a4.5 4.5 0 10.73-3H.6a5.5 5.5 0 11-.577 3H0V5H2.514z",fill:"#6CACE4",stroke:"none",strokeWidth:1,fillRule:"evenodd"}));var f=r(2507),h=r.n(f),y=r(37573),x=r(18527),v=r(71153),E=r.n(v),w=r(98074),O=r(72342);const C=(0,O.makeStyles)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}}))),N=(0,n.forwardRef)(((e,t)=>{let{value:r,attributeType:o,children:s,className:c,onClick:u}=e;const p=C(),m=(0,l.useSelector)(i.ZP.selectors.getUIPath),{generatePivotingUrl:d}=(0,n.useContext)(w.v),g=d({uiPath:m,uri:o.uri,value:JSON.stringify(r)});return a().createElement("a",{ref:t,href:g,onClick:e=>{u(),e.stopPropagation(),e.preventDefault()},className:E()(p.link,c)},s)}));N.displayName="PivotingUriLink";const S=N;var k=r(19701);const T=(0,O.makeStyles)((e=>({container:{backgroundColor:"white",width:"360px",minWidth:"360px",maxWidth:"720px"},header:{display:"flex",height:"48px",alignItems:"center",justifyContent:"space-between",paddingLeft:"16px"},title:{color:e.palette.text.primary,fontSize:"16px",letterSpacing:"0.15px",lineHeight:"19px"},entityTypeLabel:{color:"rgba(0,0,0,0.67)",fontSize:"14px",paddingLeft:"16px",paddingBottom:"12px",lineHeight:"16px"},divider:{height:"24px",width:"1px",backgroundColor:"rgba(0,0,0,0.12)"},headerCount:{color:e.palette.text.secondary,fontSize:"14px",letterSpacing:"0.24px",lineHeight:"28px",width:"210px"},body:{borderBottom:"1px solid rgba(0,0,0,0.12)",padding:"0 16px 8px"},footer:{display:"flex",alignItems:"center",height:"31px",paddingLeft:"16px",color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px"},profileIcon:{height:"16px",width:"16px"},entityContainer:{display:"flex",flexDirection:"row",alignItems:"center"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px",textDecoration:"none",paddingLeft:"8px",wordBreak:"break-word"},icon:{margin:"auto 8px auto 0"},content:{color:e.palette.primary.main,cursor:"pointer"},seeAllButton:{cursor:"pointer"}}))),A=(0,O.makeStyles)({tooltip:{backgroundColor:"white",boxShadow:"0 4px 5px 0 rgba(0,0,0,0.14), 0 1px 10px 0 rgba(0,0,0,0.12), 0 2px 4px -1px rgba(0,0,0,0.2)",padding:0,borderRadius:"4px",maxWidth:"none"},arrow:{"&::before":{backgroundColor:"white"}}});function Z(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const P=e=>{let{value:t,attributeType:r,config:o={},generatedValue:c,onSeeAllClick:u}=e;const[p,m]=(0,n.useState)([]),[d,g]=(0,n.useState)(0),b=(0,l.useSelector)(i.ZP.selectors.getEntity)||{},f=(0,k._)(),v=T(),E=(0,l.useSelector)(i.ZP.selectors.getGlobalSearchRequestOptions)||{},w=o.entityType||b.type,O=d>6;(0,n.useEffect)((()=>{const e=(0,s.BlA)({value:t,attributeType:r,entityType:w}),n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Z(e,t,r[t])}))}return e}({max:6},E);f(Promise.all([(0,s.ZOr)(e,n),(0,s.j_Q)(e,n)])).then((e=>{const[t,{total:r}]=e;m(Array.isArray(t)?t:[]),g(r)})).catch((()=>{m([]),g(0)}))}),[]);const C=Boolean(o.label);return a().createElement("div",{className:v.container},a().createElement("div",{className:v.header},a().createElement("div",{className:v.title},h().text("Pivot profiles")),a().createElement("div",{className:v.divider}),a().createElement("div",{className:v.headerCount},h().number(d,"0,0")+" "+(1===d?h().text("item"):h().text("items")))),C&&a().createElement("div",{className:v.entityTypeLabel},o.label),a().createElement("div",{className:v.body},p.map((e=>a().createElement("div",{key:e.uri,className:v.entityContainer},a().createElement(y.Z,{entity:e,avatarClassName:v.profileIcon}),a().createElement(x.Z,{className:v.entityLabel,value:(0,s.wwR)(e)},(0,s.idV)(e.label)))))),O&&a().createElement("div",{className:v.footer},a().createElement(S,{value:c,attributeType:r,className:v.seeAllButton,onClick:u},h().text("See all"))))},j=e=>{let{value:t,attributeType:r,children:m,className:g}=e;const f=A(),h=T(),y=(0,l.useDispatch)(),x=(0,n.useContext)(u.J)||[],v=(0,s.QZu)(r),E=(0,l.useSelector)(i.ZP.selectors.getMetadata)||{},w=v?p(r,t.value,x,E):d(t.lookupCode||t.value,r),O=x.some((e=>{let{uri:t}=e;return t===r.uri}))&&(Array.isArray(w)&&w.length||!Array.isArray(w)&&!(0,c.isNil)(w)),C=x.find((e=>{let{uri:t}=e;return t===r.uri})),N=O?Array.isArray(w)?w.map((e=>Object.fromEntries(Object.entries(e).map((e=>{let[t,r]=e;return[(0,s.nIW)(t),r]}))))):((e,t)=>[{[e.name]:t}])(r,w):void 0,k=()=>{y(i.ui.actions.openPivotingPerspective({value:N,attributeType:r}))};return O?a().createElement(o.Z,{arrow:!0,placement:"right-start",classes:f,disableInteractive:!1,title:a().createElement(P,{value:w,generatedValue:N,attributeType:r,config:C.popup,onSeeAllClick:k})},a().createElement("span",{className:g},a().createElement(b,{className:h.icon}),a().createElement(S,{onClick:k,className:h.content,value:N,attributeType:r},m))):a().createElement(a().Fragment,null,m)}},11387:(e,t,r)=>{r.d(t,{Z:()=>p});var n=r(24328),a=r.n(n),l=r(17512),o=r(13310),i=r(3853),s=r(10768);function c(){return c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c.apply(this,arguments)}const u=(0,n.forwardRef)(((e,t)=>{const{className:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className"]);return a().createElement("div",{ref:t,className:r},class{static build(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{showEmptyEditors:r,onAddAttributes:n,lazy:u,errors:p,crosswalks:m,showNonOv:d,expanded:g}=t,b=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["showEmptyEditors","onAddAttributes","lazy","errors","crosswalks","showNonOv","expanded"]);switch(e.type){case l.oS0.TYPE_NESTED:return a().createElement(i.Z,t);case l.oS0.TYPE_REFERENCE:return a().createElement(s.Z,t);default:return a().createElement(o.Z,c({isReltioCrosswalk:(0,l.KVV)(m,t.attributeValue)},b))}}}.build(e.attributeType,n))}));u.displayName="Attribute";const p=u},76141:(e,t,r)=>{r.d(t,{Z:()=>O});var n=r(24328),a=r.n(n),l=r(13980),o=r.n(l),i=r(2507),s=r.n(i),c=r(17512),u=r(50914),p=r(55752),m=r(52239),d=r(67283),g=r(86602),b=r(26978);var f=r(1108),h=r(38583),y=r(50548),x=r(43460);function v(){return v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},v.apply(this,arguments)}function E(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const w=e=>{let{parentAttributeType:t,attrTypes:r,entity:l,parentUri:o,showEmptyEditors:i,mode:y,crosswalks:w,drawLines:O,children:C,className:N,alwaysVisibleTypeUris:S=g.S,onAddAttributes:k,onChangeAttribute:T,onDeleteAttribute:A,additionalControlsRenderer:Z,showNonOv:P,highlightAttribute:j}=e;const{attributes:I={}}=l,[D,V]=(0,n.useState)({}),L=(0,n.useCallback)(((e,t)=>{V((r=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){E(e,t,r[t])}))}return e}({},r,{[e]:t})))}),[]);(0,n.useEffect)((()=>{V({})}),[o]);const R=(0,n.useMemo)((()=>t&&(0,c.Vg3)({attributeType:t,mode:y})),[t,y]),U=((e,t,r,n)=>e.filter((e=>{const a=((e,t)=>{const{attributes:r={},analyticsAttributes:n={}}=t;return(0,u.cond)([[c.kqr,(0,u.always)(t)],[(0,u.both)(c.kQw,(0,u.always)(n)),(0,u.always)(n)],[u.T,(0,u.always)(r)]])(e)})(e,t),l=(e=>(0,c.kqr)(e)?"uri":"name")(e);return!((e.singleValue||(0,c.ian)(e)||(0,c.VFZ)(e))&&((0,u.has)(e[l])(a)||r&&(null==n||!n[e.uri])))})))((0,n.useMemo)((()=>(0,c._kX)(y,r)),[r,y]),l,i,D),M=(0,n.useContext)(f.c),_=(0,n.useMemo)((()=>(0,c.Gtj)(r,y,l,i,P,M)),[r,y,l,i,P,M]),[z,B]=(0,n.useMemo)((()=>(0,b.A)(S,_)),[_,S]),F=(0,n.useCallback)((e=>{k(e.map((e=>({attributeType:e,parentUri:e===t?(0,c.JBA)(o):o})))),j((0,u.last)(e),x.g4.NewAttribute)}),[k,o,t]),H={enabled:O},q=(0,n.useMemo)((()=>({hasDeletionsMap:D,setHasDeletions:L})),[D,L]);return a().createElement("div",{className:N},C&&a().createElement(m.Z,H,C),a().createElement(m.Z,v({},H,{plain:!0}),U.length>0&&a().createElement(d.Z,{label:s().text("More attributes"),onApply:F,dense:O,data:U,parent:R&&t})),a().createElement(h.d.Provider,{value:q},B.concat(z).map((e=>{let{attrType:t,values:r}=e;return a().createElement(p.ZP,{key:`${t.uri}_${o}`,attributeType:t,drawLines:O,values:r,paging:(0,u.path)(["paging",t.uri],I),parentUri:o,showEmptyEditors:i,mode:y,crosswalks:w,onAddAttributes:k,onChangeAttribute:T,onDeleteAttribute:A,additionalControlsRenderer:Z,showNonOv:P})}))))};w.propTypes={parentAttributeType:o().object,attrTypes:o().array,entity:o().object,parentUri:o().string,children:o().node,showEmptyEditors:o().bool,mode:c.XGc,crosswalks:o().array,drawLines:o().bool,showNonOv:o().bool,className:o().string,alwaysVisibleTypeUris:o().array,onAddAttributes:o().func,onChangeAttribute:o().func,onDeleteAttribute:o().func,additionalControlsRenderer:o().func,highlightAttribute:o().func};const O=(0,y.l)(x.NY,(e=>{const{highlightAttribute:t}=e||{};return{highlightAttribute:t}}),w)},63928:(e,t,r)=>{r.d(t,{Z:()=>v});var n=r(24328),a=r.n(n),l=r(17512),o=r(79312),i=r(50914),s=r(40130),c=r(2507),u=r.n(c);const p=e=>u().text("${value}",{value:1===e?u().text("value"):u().text("values")}),m=(0,i.has)("minValue"),d=(0,i.has)("maxValue"),g=(0,i.pipe)(d,i.not),b=(0,i.propSatisfies)((e=>1===e),"minValue"),f=e=>{let{minValue:t}=e;return u().text("This attribute can have minimum ${minValue} ${minValueCaption}",{minValue:u().number(t,"0"),minValueCaption:p(t)})},h=e=>{let{maxValue:t}=e;return u().text("This attribute can have maximum ${maxValue} ${maxValueCaption}",{maxValue:u().number(t,"0"),maxValueCaption:p(t)})},y=(0,i.cond)([[i.isNil,(0,i.always)("")],[e=>{let{minValue:t,maxValue:r}=e;return t&&t===r},e=>{let{minValue:t}=e;return u().text("This attribute should have ${minValue} ${minValueCaption}",{minValue:u().number(t,"0"),minValueCaption:p(t)})}],[(0,i.allPass)([b,d]),h],[(0,i.allPass)([b,g]),(0,i.always)("")],[(0,i.allPass)([m,d]),e=>{let{minValue:t,maxValue:r}=e;return u().text("${minCardinality} and maximum ${maxValue} ${maxValueCaption}",{minCardinality:f({minValue:t}),maxValue:u().number(r,"0"),maxValueCaption:p(r)})}],[d,h],[m,f],[i.T,(0,i.always)("")]]),x=e=>{let{cardinality:t}=e;const r=(0,s.y)();return a().createElement(o.Z,{variant:"caption",className:r.caption},y(t))};x.propTypes={cardinality:l.oA3};const v=x},55752:(e,t,r)=>{r.d(t,{ZP:()=>ae});var n=r(52730),a=r(50673),l=r(17512),o=r(24328),i=r.n(o),s=r(50914),c=r(52239),u=r(71153),p=r.n(u),m=r(55401),d=r(14699),g=r(33043),b=r(31992),f=r(35039),h=r(11387),y=r(63928);const x=(0,s.filter)((0,s.propSatisfies)(l.ZiX,"uri"));var v=r(1108),E=r(40941),w=r(4767),O=r(72342);function C(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){N(e,t,r[t])}))}return e}function N(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const S={content:'""',position:"absolute",left:"-1000px",top:"-4px",width:"5000px",height:"calc(100% + 8px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},k=(0,O.makeStyles)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlighted:{"&::before":C({},S,{background:"rgba(228, 151, 0, 0.08)"}),position:"relative"}}))),T=e=>{const t=k(),r=(0,o.useRef)(null),{scrollIntoRef:n}=e||{};return(0,o.useEffect)((()=>{e&&n(r)}),[e,n]),e?{ref:r,highlightedClassName:t.highlighted}:{ref:r}};var A=r(40130);const Z=e=>{let{max:t,values:r,attributeType:n,parentUri:a,mode:u,drawLines:O,showEmptyEditors:C,errorMessage:N,errors:S,paging:k,crosswalks:Z,showNonOv:P,nonVisibleValues:j,highlightedError:I,highlightedAttribute:D,onAddAttributes:V,onDeleteAttribute:L,onChangeAttribute:R,onDeactivateError:U,additionalControlsRenderer:M,requestNextPageOfAttributeValues:_}=e;const z=(0,A.y)(),[B,F]=(0,o.useState)(t),[H,q]=(0,o.useState)(!1),{label:W,required:$,cardinality:Y,name:X,uri:G,description:K}=n,J=(0,l.KIu)(u),{ref:Q,errorClassName:ee}=(0,E.B)({highlightedError:I}),{ref:te,highlightedClassName:re}=T(D),ne=(0,o.useContext)(v.c),ae=(0,o.useMemo)((()=>null==ne?void 0:ne.includes(G)),[G,ne]),le=(0,l.O27)(r),oe=(!H&&C||$||ae)&&le,ie=(0,o.useRef)((0,l.gjI)({parentUri:a,attributeType:(0,s.omit)(["defaultValue"],n)})),se=(0,o.useCallback)((()=>{F(B+1);const e=e=>({parentUri:a,index:B,attributeType:e});if(oe&&!(0,l.YkM)(n.type)){const t=[e((0,s.omit)(["defaultValue"],n)),e(n)];return V(t)}return V([e(n)])}),[B,V,a,n,oe]),ce=(0,o.useCallback)((0,s.pipe)(L,s.T,q),[L,q]);if(le&&!oe)return null;if(oe&&le&&(r=[ie.current]),(0,l.O27)(r))return null;const ue=(x(r)||[]).length,pe=P?"totalValues":"totalOvValues",me=(0,s.ifElse)((0,s.has)(pe),(0,s.pipe)((0,s.prop)(pe),(0,s.add)(ue)),(0,s.always)(r.length))(k),de=null!=k&&k.totalValues?k.totalValues-me:null==j?void 0:j.length,ge=t<me,be=ge&&B<me,fe=ge&&B>=me,he=r.slice(0,B),ye=he?he.length-1:0,xe=me-B;return i().createElement(c.Z,{enabled:O},i().createElement("div",{ref:Q,className:p()(z.wrapper,ee)},i().createElement("div",{className:z.titleWrapper},i().createElement(d.Z,{label:W,isRequired:$,className:z.title,"data-reltio-id":"reltio-attribute-label"}),i().createElement(w.Z,{description:K,className:z.description}),i().createElement(g.Z,{nonOvValues:j,attributeType:n,className:z.ovIcon,nonOvTotal:de})),J&&i().createElement(y.Z,{cardinality:Y}),J&&i().createElement(m.Z,{message:N,className:z.typeError}),i().createElement("div",{className:z.attributesWrapper},he.map(((e,t)=>i().createElement(h.Z,{key:e.uri,attributeValue:e,attributeType:n,lazy:oe&&!$,showEmptyEditors:C,errors:S,ownError:(0,l.ADq)(e,t,n.uri,S),mode:u,crosswalks:Z,onAddOneMore:ye===t?se:null,onAddAttributes:V,onDeleteAttribute:ce,onChangeAttribute:R,onDeactivateError:U,additionalControlsRenderer:M,className:0===t?re:null,ref:0===t?te:null,isEmptyEditor:oe}))),be&&i().createElement(f.Z,{moreNumber:(0,s.min)(t,xe),valueNumber:xe,onClick:()=>{r.length<me&&_({parentUri:a,attributeTypeUri:G,attributeTypeName:X,values:r,defaultMaxValues:t}),F(B+t)}}),fe&&i().createElement(b.Z,{onClick:()=>{F(t)}}))))};Z.displayName="AttributeRenderer";const P=(0,o.memo)(Z);var j=r(83422),I=r(90590),D=r(92145);const V=(0,O.makeStyles)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},roleContainer:{width:"100%"},valueContainer:{marginLeft:"8px",width:0},deleteButton:{marginLeft:"8px"}});var L=r(40435),R=r(6163);const U={MultiValue:D.Z},M=e=>{let{values:t,onChange:r,onDelete:c}=e;const u=V(),p=(0,n.useSelector)(a.ZP.selectors.getMetadata),m=(0,n.useSelector)(a.ZP.selectors.getEntity),d=m.uri,g=(0,l.JvE)(p,m.type).map((e=>({value:e.uri,label:e.label}))),b=(t||[]).map((e=>{var t;return{value:e,label:(null===(t=g.find((0,s.propEq)("value",e)))||void 0===t?void 0:t.label)||(0,l.nIW)(e)}})),f=(0,o.useCallback)((e=>{const t=(null==e?void 0:e.map((0,s.prop)("value")))||[];r({value:t,attributeType:l.xPW.roles,uri:d})}),[d,r]),h=(0,o.useCallback)((()=>{c({uri:d,attributeType:l.xPW.roles})}),[d,c]);return i().createElement("div",{className:u.container,"data-reltio-id":"reltio-attribute-value"},i().createElement(I.Z,{label:"",height:40,isMulti:!0,options:g,value:b,onChange:f,components:U,classes:u,className:u.roleContainer}),!!c&&i().createElement(L.Z,{className:u.deleteButton,icon:R.Z,onClick:h,size:"L"}))};var _=r(7766);const z=(0,O.makeStyles)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},deleteButton:{marginLeft:"8px"}}),B=e=>e?`?filter=${(0,l.Uqd)()((e=>[{filter:"containsWordStartingWith",fieldName:"tags",values:[e]}])(e))}`:"",F=[{fieldName:"tags",orderType:"reversedCount"}],H=e=>(0,l.FK9)({query:B(e),body:F}).then((e=>Object.keys(e.tags))),q=e=>{let{className:t,values:r,onChange:s,onDelete:c}=e;const u=z(),p=(0,n.useSelector)(a.ZP.selectors.getEntityUri),m=(0,o.useCallback)((e=>{s({value:e,attributeType:l.xPW.tags,uri:p})}),[s,p]),d=(0,o.useCallback)((()=>{c({uri:p,attributeType:l.xPW.tags})}),[p,c]);return i().createElement("div",{className:u.container,"data-reltio-id":"reltio-attribute-value"},i().createElement(_.Z,{fullWidth:!0,multiple:!0,variant:"filled",className:t,value:r||[],onChange:m,getSuggestions:H}),!!c&&i().createElement(L.Z,{className:u.deleteButton,icon:R.Z,onClick:d,size:"L"}))};var W=r(38583),$=r(50548);function Y(){return Y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Y.apply(this,arguments)}function X(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const G=(0,$.l)(W.d,((e,t)=>{let{attributeType:r}=t;const{hasDeletionsMap:n,setHasDeletions:a}=e||{};return{hasDeletions:n?Boolean(n[null==r?void 0:r.uri]):void 0,setHasDeletions:a}}),(e=>{let{values:t,attributeType:r,parentUri:n,mode:a,errorMessage:c,onDeleteAttribute:u,onChangeAttribute:g,showEmptyEditors:b,hasDeletions:f,setHasDeletions:x,highlightedAttribute:v}=e,E=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["values","attributeType","parentUri","mode","errorMessage","onDeleteAttribute","onChangeAttribute","showEmptyEditors","hasDeletions","setHasDeletions","highlightedAttribute"]);const w=(0,A.y)(),{label:O,required:C,cardinality:N}=r,S=(0,l.KIu)(a),[k,Z]=(0,o.useState)(!1),P=(0,o.useCallback)((e=>{Z(e),null==x||x(r.uri,e)}),[r.uri,x]),I=void 0!==f?f:k,D=(0,o.useCallback)((0,s.pipe)(u,s.T,P),[u,P]),V=(0,l.O27)(t),L=!I&&b&&V,R=(0,o.useRef)((0,l.gjI)({parentUri:n,attributeType:r})),{ref:U,highlightedClassName:_}=T(v);return(0,l.j2U)(r)&&V&&!L?null:i().createElement("div",{ref:U,className:p()(_,w.wrapper)},i().createElement(d.Z,{label:O,isRequired:C,className:p()(w.title,w.titleWrapper),"data-reltio-id":"reltio-attribute-label"}),S&&i().createElement(y.Z,{cardinality:N}),S&&i().createElement(m.Z,{message:c}),i().createElement(j.Z,{className:w.attributesWrapper},(()=>{switch(r.uri){case l.xPW.tags.uri:return i().createElement(q,{values:t,onDelete:D,onChange:g});case l.xPW.roles.uri:return i().createElement(M,{values:t,onDelete:D,onChange:g});default:{const e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){X(e,t,r[t])}))}return e}({},R.current,{value:t[0]||""});return i().createElement(h.Z,Y({attributeValue:e,attributeType:r,mode:a,onDeleteAttribute:D,onChangeAttribute:g},E))}}})()))}));var K=r(66078);const J=e=>{let{attributeType:t,attributeValues:r,paging:n,parentUri:a,showNonOv:l,onDeleteAttribute:o,onChangeAttribute:s,requestNextPageOfAttributeValues:c,highlightedAttribute:u}=e;const m=(0,A.y)(),{label:g,description:b}=t,{ref:f,highlightedClassName:h}=T(u);return i().createElement("div",{ref:f,className:p()(m.wrapper,h)},i().createElement("div",{className:m.titleWrapper},i().createElement(d.Z,{className:m.title,label:g,"data-reltio-id":"reltio-attribute-label"}),i().createElement(w.Z,{className:m.description,description:b})),i().createElement(K.Z,{attributeValues:r,attributeType:t,paging:n,onDeleteAttribute:o,parentUri:a,onChangeAttribute:s,requestNextPageOfAttributeValues:c,showNonOv:l}))};var Q,ee=r(43460);function te(){return te=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},te.apply(this,arguments)}!function(e){e.imageLine="imageLine",e.special="special",e.default="default"}(Q||(Q={}));const re=(0,$.l)(ee.NY,((e,t)=>{let{attributeType:r,parentUri:n}=t;const{element:a,type:o}=e||{};return{highlightedAttribute:(0,ee.St)(o)&&a.uri===r.uri?e:null,highlightedError:(0,ee.Ie)(o)&&(0,l.Wah)(a,n,r.uri)?e:null}}),(e=>{let{values:t,attributeType:r,mode:n=l.ARY.Viewing,crosswalks:a,drawLines:o,paging:u={},parentUri:p,errors:m,errorMessage:d,max:g=1/0,showEmptyEditors:b,showNonOv:f,highlightedError:h,highlightedAttribute:y,onAddAttributes:x,onDeleteAttribute:v,onChangeAttribute:E,onDeactivateError:w,additionalControlsRenderer:O,requestNextPageOfAttributeValues:C}=e;const N=(0,s.partition)(l.OXP),[S,k]=N(t),T=f?t:S,A=f?[]:k,Z={errorMessage:d,errors:m,mode:n,parentUri:p,onAddAttributes:x,onDeleteAttribute:v,onChangeAttribute:E,onDeactivateError:w,additionalControlsRenderer:O,showEmptyEditors:b,highlightedError:h,highlightedAttribute:y};return(()=>{switch((0,s.cond)([[l.kqr,(0,s.always)(Q.special)],[l.Or$,(0,s.always)(Q.imageLine)],[s.T,(0,s.always)(Q.default)]])(r)){case Q.special:return i().createElement(c.Z,{enabled:o},i().createElement(G,te({values:T,attributeType:r},Z)));case Q.imageLine:return i().createElement(c.Z,{enabled:o},i().createElement(J,{attributeValues:T,attributeType:r,paging:u,onDeleteAttribute:v,parentUri:p,onChangeAttribute:E,requestNextPageOfAttributeValues:C,showNonOv:f,highlightedAttribute:y}));default:return i().createElement(P,te({values:T,attributeType:r,max:g,paging:u,crosswalks:a,drawLines:o,requestNextPageOfAttributeValues:C,showNonOv:f,nonVisibleValues:A},Z))}})()})),ne={requestNextPageOfAttributeValues:a.N5.actions.requestNextPageOfAttributeValues,onDeactivateError:a.N5.errors.actions.errorDeactivated},ae=(0,n.connect)(((e,t)=>{let{parentUri:r,attributeType:n,max:o}=t;return{errors:a.ZP.selectors.getActiveErrorsForAttributesPager(e,r,n),errorMessage:(0,l.tQX)(r,n,a.ZP.selectors.getProfileErrors(e)),max:o||a.ZP.selectors.getDefaultMaxValues(e)}}),ne)(re)},40130:(e,t,r)=>{r.d(t,{y:()=>n});const n=(0,r(72342).makeStyles)((e=>({caption:{fontSize:"0.7rem",opacity:.54},wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start",position:"relative"},description:{marginRight:"-9px"},attributesWrapper:{width:"100%",marginBottom:"10px"},link:{display:"flex",marginTop:4},"svg-icon__root":{fontSize:"1rem"},title:{fontSize:"12px",lineHeight:"14px",paddingLeft:"12px",color:e.palette.text.secondary},typeError:{marginLeft:"12px"},ovIcon:{marginLeft:"8px",marginTop:"-1px",textIndent:0},titleWrapper:{flex:1,paddingBottom:"3px"}})))},38328:(e,t,r)=>{r.d(t,{Z:()=>S});var n=r(24328),a=r.n(n),l=r(50914),o=r(13980),i=r.n(o),s=r(71153),c=r.n(s),u=r(2507),p=r.n(u),m=r(17512),d=r(38677),g=r(6163),b=r(79312),f=r(40435),h=r(85777),y=r(93555),x=r(76141),v=r(50548),E=r(43460),w=r(40941);const O=(0,r(72342).makeStyles)((e=>({complexWrapper:{position:"relative"},editor:{display:"flex",flex:1,height:"36px",alignItems:"center"},label:{flex:1,marginLeft:"2px",marginTop:"2px",fontSize:"13px",lineHeight:"15px"},actions:{display:"flex",alignItems:"center"},titleContainer:{display:"flex",flex:1,minHeight:"20px"},expandButton:{marginTop:"2px"},deleted:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary},errorWrapperHelperText:{marginLeft:0}})));function C(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const N=e=>{let{label:t,attributeTypesList:r,attributeType:l,attributeValue:o,children:i,errors:s,ownError:u,mode:v,metadata:E,crosswalks:C,lazy:N,showEmptyEditors:S,onAddOneMore:k,onAddAttributes:T,onDeleteAttribute:A,onChangeAttribute:Z,additionalControlsRenderer:P,hideDeleteButton:j,state:I,showNonOv:D,isHighlightedPath:V,highlightedError:L,expanded:R=!1}=e;const U=O(),M="deleted"===I,_="edited"===I,z=o.uri,B=(0,m.ZiX)(z),F=B||R,[H,q]=(0,n.useState)(F),{ref:W,errorClassName:$}=(0,w.B)({highlightedError:L});(0,n.useEffect)((()=>{V&&q(!0)}),[V]),(0,n.useEffect)((()=>{q(F)}),[F]);const Y=(0,n.useMemo)((()=>(0,m.xv5)({attributeType:l,attributeValue:o,mode:v,metadata:E,isReltioCrosswalk:(0,m.KVV)(C,o)})),[l,o,v,E,C]),X=!M&&!j&&!!A&&Y,G=(0,n.useMemo)((()=>(0,m.J6q)(o,s)),[s,o]);(0,n.useEffect)((()=>{G&&q(!0)}),[s,G]),(0,n.useEffect)((()=>{M&&q(!1)}),[M]);const K=(r||[]).some((e=>(0,m.kQw)(e))),J=(0,n.useMemo)((()=>({attributes:K?null:o.value,analyticsAttributes:K?o.value:null})),[o,K]),Q=(0,m.e$p)(u)||G&&p().text("Has an incorrect value")||"";return N?a().createElement(d.Z,{variant:"text",color:"primary",onClick:k},"Create attribute"):a().createElement("div",{ref:W,className:c()(U.complexWrapper,$)},a().createElement("div",{className:U.editor},a().createElement("div",{className:U.titleContainer},a().createElement(h.Z,{onClick:()=>q((e=>!e)),expanded:H,className:U.expandButton,disabled:M}),a().createElement(y.Z,{errorMessage:Q,classes:{helperText:U.errorWrapperHelperText}},a().createElement("div",{className:c()(U.label,{[U.deleted]:M}),"data-reltio-id":"reltio-attribute-complex-label"},t))),a().createElement("div",{className:U.actions},_&&a().createElement(b.Z,{variant:"caption",className:U.editedLabel},"(",p().text("edited"),")"),P&&P({attributeType:l,attributeValue:o}),X&&a().createElement(f.Z,{icon:g.Z,onClick:()=>A({uri:z,attributeType:l,attributeValue:o}),size:"L","data-reltio-id":"reltio-delete-complex-attribute-button"}))),H&&a().createElement(x.Z,{parentAttributeType:l,attrTypes:r,entity:J,showEmptyEditors:S||B,drawLines:!0,parentUri:z,mode:v,crosswalks:C,onAddAttributes:T,onChangeAttribute:Z,onDeleteAttribute:A,additionalControlsRenderer:P,showNonOv:D},i))};N.propTypes=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){C(e,t,r[t])}))}return e}({label:i().string,children:i().node,attributeTypesList:i().arrayOf(m.EMD),attributeValue:i().oneOfType([m.dMV,m.Rtp]),highlightedError:i().object,isHighlightedPath:i().bool},m.KVe);const S=(0,v.l)(E.NY,((e,t)=>{let{attributeValue:r}=t;const{element:n,type:a}=e||{},o=(0,E.Ie)(a);return{highlightedError:o&&(null==n?void 0:n.uri)===r.uri?e:null,isHighlightedPath:o&&(0,l.pipe)((0,l.propOr)([],"path"),(0,l.any)((0,l.pathEq)(["value","uri"],r.uri)))(n)}}),N)},54255:(e,t,r)=>{r.d(t,{Z:()=>b});var n=r(52730),a=r(50673),l=r(24328),o=r.n(l),i=r(13980),s=r.n(i),c=r(76141),u=r(17512);const p=e=>e&&e.attributes,m=e=>{let{entity:t,entityType:r,attributeTypesSelectionStrategy:n=p,mode:a,onAddAttributes:i,onDeleteAttribute:s,onChangeAttribute:u}=e;const m=(0,l.useMemo)((()=>n(r)),[n,r]);return t?o().createElement(c.Z,{key:t.uri,attrTypes:m,entity:t,showEmptyEditors:!0,drawLines:!0,parentUri:t.uri,mode:a,crosswalks:t.crosswalks,onAddAttributes:i,onChangeAttribute:u,onDeleteAttribute:s}):null};m.propTypes={entityUri:s().string,parentUri:s().string,entity:s().object,entityType:s().object,attributeTypesSelectionStrategy:s().func,mode:u.XGc,onAddAttributes:s().func,onDeleteAttribute:s().func,onChangeAttribute:s().func};const d=m,g={onAddAttributes:a.N5.actions.addAttributes,onDeleteAttribute:a.N5.actions.removeAttribute,onChangeAttribute:a.N5.actions.modifyAttribute},b=(0,n.connect)(((e,t)=>({entity:t.entityUri&&a.ZP.selectors.getModifiedEntity(e,t.entityUri)})),g)(d)},72283:(e,t,r)=>{r.d(t,{Z:()=>X});var n=r(24328),a=r.n(n),l=r(13980),o=r.n(l),i=r(2507),s=r.n(i),c=r(50914),u=r(17512),p=r(84425),m=r(95341),d=r(96379),g=r(40007),b=r(72342);const f=(0,b.makeStyles)({entityContainer:{display:"flex",alignItems:"center",height:"32px",minHeight:"32px",padding:0},entityLabel:{height:"15px",fontSize:"13px",color:"rgba(0,0,0,0.87)",cursor:"pointer",lineHeight:"15px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},emptyEntityLabel:{height:"15px",fontSize:"13px",color:"rgba(0,0,0,0.6)",lineHeight:"15px",marginLeft:"16px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",cursor:"default"},entityAvatar:{transform:"scale(0.5)",marginLeft:"8px",marginRight:"11px"},entitySecondaryLabel:{color:"rgba(0,0,0,0.6)"}}),h=(0,b.makeStyles)((e=>({singleValue:{color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",paddingTop:"18px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},linkValue:{cursor:"pointer",color:e.palette.primary.main,textDecoration:"none",pointerEvents:"all"}}))),y=(0,b.makeStyles)((e=>({addLabel:{color:e.palette.primary.main,display:"flex",fontWeight:"500",cursor:"pointer",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},groupHeading:{fontSize:"13px",height:"36px",padding:"0 16px",display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0.03)"},addIcon:{height:"18px",width:"18px",padding:"0 9px"}}))),x=(0,b.makeStyles)({clearIcon:{cursor:"pointer",height:"20px",width:"20px"}});function v(){return v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},v.apply(this,arguments)}const E=e=>{let{innerRef:t,innerProps:r,selectOption:n,data:l}=e;const o=f(),{uri:i,entityType:c,label:u,secondaryLabel:p}=l;return""!==i?a().createElement(m.Z,v({className:o.entityContainer,ref:t,key:i,onClick:()=>n({label:u,uri:i,entityType:c})},r),a().createElement(d.Z,{className:o.entityAvatar,entityType:c}),a().createElement(g.Z,{value:`${u}${p?", "+p:""}`},a().createElement("span",{className:o.entityLabel},u,p&&a().createElement("span",{className:o.entitySecondaryLabel},", ",p)))):a().createElement(m.Z,v({className:o.entityContainer,ref:t,key:i},r,{disabled:!0}),a().createElement("span",{className:o.emptyEntityLabel},s().text("No results found")))};E.propTypes={innerRef:o().oneOfType([o().oneOf([null]),o().func,o().shape({current:o().any.isRequired})]),innerProps:o().object.isRequired,selectOption:o().func.isRequired,data:o().shape({uri:o().string.isRequired,label:o().string.isRequired,entityType:u.pyR.isRequired})};const w=E;var O=r(71153),C=r.n(O),N=r(52730),S=r(50673),k=r(79312),T=r(63532),A=r(98074);const Z=e=>{const{selectProps:{currentEntityType:t,menuIsOpen:r,disableLinkClick:l},children:o,data:i}=e,p=h(),m=(0,N.useDispatch)(),d=(0,n.useContext)(T.m),{generateEntityUrl:g}=(0,n.useContext)(A.v),b=(0,N.useSelector)(S.ZP.selectors.getUIPath),f=(0,u.ZiX)(i.entityUri)?{className:p.singleValue,component:"span"}:{className:C()(p.singleValue,p.linkValue),onMouseDown:e=>{e.stopPropagation(),l||(0,c.pipe)((0,c.always)({uri:i.entityUri,viewId:d}),S.ui.actions.openEntity,m)()},onClick:e=>e.preventDefault(),href:g({uiPath:b,uri:i.entityUri}),component:"a"};return!r&&a().createElement(k.Z,f,(0,u.ZiX)(i.entityUri)?s().text(`New ${t.label} will be created`):(0,u.idV)(o))};Z.propTypes={children:o().string,data:o().object.isRequired,selectProps:o().object.isRequired};const P=Z;var j=r(54675),I=r(87037);const D=e=>{const{selectProps:{onClear:t}}=e,r=x();return a().createElement(I.Z,{onClick:t,size:"large"},a().createElement(j.Z,{className:r.clearIcon}))};D.propTypes={selectProps:o().object.isRequired};const V=D;var L=r(54255),R=r(79573),U=r(81997),M=r(93553);const{Group:_}=U.F,z=e=>{const{selectProps:{inputValue:t,onCreate:r},data:n,children:l}=e,o=y();return a().createElement(_,e,a().createElement("div",{className:o.groupHeading},a().createElement("span",null,n.label),r&&a().createElement("span",{onClick:()=>r(t,n.entityType),className:o.addLabel},a().createElement(M.Z,{className:o.addIcon}),s().text(`Create ${t?`"${t}" as `:""}new ${n.label}`))),l)};z.propTypes={selectProps:o().object.isRequired,data:o().object,children:o().array};const B=z,F=(0,b.makeStyles)({creatorWrapper:{marginTop:"20px"}});function H(){return H=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},H.apply(this,arguments)}function q(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function W(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){$(e,t,r[t])}))}return e}function $(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Y=e=>{let{entity:t={},entityTypesUris:r=[],mode:l,max:o,onChange:i,onCreate:m,metadata:d,globalSearchRequestOptions:g,attributeTypesSelectionStrategy:b,disableLinkClick:f=!1}=e,h=q(e,["entity","entityTypesUris","mode","max","onChange","onCreate","metadata","globalSearchRequestOptions","attributeTypesSelectionStrategy","disableLinkClick"]);const y=F(),[x,v]=(0,n.useState)(""),E=(0,n.useMemo)((()=>r.map((e=>(0,u.nt9)(d,e))).filter(u.oDv)),[r,d]),O=W({},g,{max:o}),C=m?(e,t)=>{m(t||r[0],e),v("")}:void 0,N=e=>{null!==e&&(v(""),i(e))},S=(0,n.useMemo)((()=>1!==E.length),[E]),k=((0,c.isEmpty)(t)?E[0]:(0,u.nt9)(d,t.entityType))||{},T=m&&s().text(`Create ${x?`"${x}" as `:""}new ${k.label}`),A=s().text(`Select ${1===E.length?`${E[0].label} `:""}profile`),Z=!(0,c.isEmpty)(t)&&(0,u.ZiX)(t.entityUri),j=S?{Group:B,GroupHeading:R.Vd}:{},I=Z?{ClearIndicator:V}:{},{TextFieldProps:D}=h,U=q(h,["TextFieldProps"]),M=(0,n.useMemo)((()=>W({},D||{},{"data-reltio-id":"reltio-entity-selector"})),[D]);return a().createElement(a().Fragment,null,a().createElement(p.Z,H({value:(0,c.isEmpty)(t)?void 0:t,inputValue:x,onInputChange:e=>{v(e)},getOptions:e=>(0,u.U10)(E,e,O).then(((e,t)=>r=>{const n=r.map((t=>W({},t,{label:(0,u.idV)(t.label),entityType:e.find((e=>{let{uri:r}=e;return r===t.type}))}))),a=e=>(0,c.isEmpty)(e)?[{label:"",uri:"",entityType:{}}]:e,l=t?e:e.filter((e=>n.some((t=>t.type===e.uri))));return l.length>1?l.map((e=>({label:e.label,entityType:e.uri,options:a(n.filter((t=>t.type===e.uri)))}))):a(n)})(E,m)),getOptionLabel:(0,c.prop)("entityLabel"),onChange:N,onCreate:C,onClear:()=>{N({})},label:A,createLabel:T,components:W({Option:w,SingleValue:P},j,I),currentEntityType:k,isClearable:!0,disableLinkClick:f,TextFieldProps:M},U)),Z&&a().createElement("div",{className:y.creatorWrapper},a().createElement(L.Z,{mode:l,attributeTypesSelectionStrategy:b,entityType:k,entityUri:t.entityUri})))};Y.propTypes={entity:u.oZZ,entityTypesUris:o().arrayOf(o().string),max:o().number,mode:u.XGc,dispatch:o().func,metadata:u.pGS,onChange:o().func.isRequired,onCreate:o().func,attributeTypesSelectionStrategy:o().func,globalSearchRequestOptions:o().object,disableLinkClick:o().bool};const X=Y},66078:(e,t,r)=>{r.d(t,{Z:()=>Y});var n=r(24328),a=r.n(n),l=r(52730),o=r(18169),i=r(50673),s=r(17512),c=r(26729),u=r(22349),p=r(40435),m=r(2507),d=r.n(m),g=r(83422),b=r(69089),f=r(79312),h=r(87378),y=r(12115),x=r(60769),v=r(38677),E=r(72342);const w=(0,E.makeStyles)((e=>({root:{width:"328px"},paper:{width:"100%",height:"40px",display:"flex",alignItems:"center",boxShadow:"none",backgroundColor:"rgba(0,0,0,0.03)"},inputRoot:{flex:1},input:{padding:"0 12px",fontSize:"14px","&:placeholder":{color:e.palette.text.secondary}},errorMessage:{marginTop:"8px",fontSize:"12px",color:e.palette.error.main}}))),O=e=>0===e.trim().length,C=e=>{let{onSend:t}=e;const r=w(),[l,o]=(0,n.useState)(""),[i,s]=(0,n.useState)(null);return a().createElement(g.Z,{className:r.root},a().createElement(y.Z,{className:r.paper},a().createElement(x.ZP,{value:l,onChange:e=>{const t=e.target.value,r=new RegExp(/^(ftp|http|https):\/\/[^ "]+$/).test(t);o(t),r||O(t)?s(null):s(d().text("URL is not correct"))},classes:{root:r.inputRoot,input:r.input},placeholder:d().text("Paste an image URL here")}),a().createElement(v.Z,{disabled:Boolean(i)||O(l),variant:"outlined",color:"primary",onClick:()=>{t(l),o(""),s(null)}},d().text("Send"))),i&&a().createElement(f.Z,{className:r.errorMessage},i))};var N=r(71153),S=r.n(N),k=r(13896),T=r(83997);const A=["image/png","image/jpeg","image/tiff","image/gif","image/bmp"],Z=e=>{let{className:t,onAppendFile:r}=e;return a().createElement(a().Fragment,null,a().createElement("input",{onInput:e=>{r&&r(e.currentTarget.files[0])},style:{display:"none"},accept:A.join(","),id:"upload-image-button","data-reltio-id":"upload-image-button",type:"file"}),a().createElement("label",{htmlFor:"upload-image-button"},a().createElement(v.Z,{className:t,variant:"contained",color:"primary",component:"span"},d().text("Select image"))))};function P(){return P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},P.apply(this,arguments)}const j=e=>a().createElement("svg",P({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),a().createElement("defs",null,a().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__c"},a().createElement("stop",{stopColor:"#FFF",offset:"0%"}),a().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),a().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__d"},a().createElement("stop",{stopColor:"#FFF",offset:"0%"}),a().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),a().createElement("linearGradient",{x1:"67.572%",y1:"54.952%",x2:"15.212%",y2:"13.907%",id:"UploadIcon_svg__e"},a().createElement("stop",{stopColor:"#000",stopOpacity:0,offset:"0%"}),a().createElement("stop",{stopColor:"#000",offset:"100%"})),a().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__f"},a().createElement("stop",{stopColor:"#B8EDFF",offset:"0%"}),a().createElement("stop",{stopColor:"#53ACDE",offset:"100%"})),a().createElement("circle",{id:"UploadIcon_svg__a",cx:128,cy:128,r:128})),a().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a().createElement("mask",{id:"UploadIcon_svg__b",fill:"#fff"},a().createElement("use",{xlinkHref:"#UploadIcon_svg__a"})),a().createElement("use",{fillOpacity:.1,fill:"#0072CE",xlinkHref:"#UploadIcon_svg__a"}),a().createElement("g",{mask:"url(#UploadIcon_svg__b)"},a().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(-1 9)"},a().createElement("path",{d:"M0 107.268c0 35.579 28.703 64.409 64.173 64.409h139.021c29.578 0 53.497-24.035 53.497-53.635 0-28.356-21.935-51.562-49.705-53.515C199.577 27.705 167.2 0 128.346 0 97.425 0 70.59 17.582 57.171 43.274 25.027 46.767 0 74.117 0 107.268z",fill:"#FFF",opacity:.3}),a().createElement("ellipse",{fill:"url(#UploadIcon_svg__c)",opacity:.4,cx:64.553,cy:107.664,rx:61.43,ry:62.336}),a().createElement("path",{d:"M127.979 8.91c38.773 0 70.206 31.895 70.206 71.24 0 39.346-31.433 71.241-70.206 71.241-6.067 0-11.954-.78-17.57-2.249 9.688-11.019 15.574-25.551 15.574-41.478 0-33.7-26.352-61.153-59.286-62.299C78.714 23.611 101.654 8.91 127.98 8.91z",fill:"url(#UploadIcon_svg__d)",opacity:.4})),a().createElement("path",{fill:"url(#UploadIcon_svg__e)",opacity:.12,d:"M82.093 128.474l38.374 37.966-10.666 18.958 72.714 71.94 63.578-57.537v-6.11l-71.107-70.352H97.22z",transform:"translate(-1 9)"}),a().createElement("path",{fill:"url(#UploadIcon_svg__f)",d:"M151.004 128.29v57.591h-40.836V128.29H81l49.5-49.409L180 128.29z",transform:"translate(-1 9)"})))),I=(0,E.makeStyles)((e=>({root:{padding:"36px 0 29px"},isActive:{backgroundColor:"rgba(0,114,206,0.12)"},icon:{width:"190px",height:"190px",marginBottom:"24px"},title:{marginBottom:"8px",color:e.palette.text.primary,fontSize:"20px",fontWeight:500,lineHeight:"24px"},description:{marginBottom:"24px",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"16px"}}))),D=e=>{let{onAppendFile:t,className:r}=e;const n=I(),[{canDrop:l,isOver:o},i]=(0,k.useDrop)({accept:[T.FILE],drop:e=>{e&&t(e.files[0])},collect:e=>({isOver:e.isOver(),canDrop:e.canDrop()})}),s=l&&o;return a().createElement("div",{ref:i,className:S()(n.root,{[n.isActive]:s},r)},a().createElement(j,{className:n.icon}),a().createElement(f.Z,{className:n.title},d().text("Drag an image here")),a().createElement(f.Z,{className:n.description},d().text("Acceptable image types would include JPG, PNG, TIFF, GIF, BMP. Maximum image size: ${MAX_IMAGE_SIZE}Mb",{MAX_IMAGE_SIZE:20})),a().createElement(Z,{onAppendFile:t}))},V=(0,E.makeStyles)((e=>({root:{width:"100%",display:"flex",alignItems:"center",padding:"0 30px",boxSizing:"border-box"},border:{borderBottom:`1px solid ${e.palette.text.primary}`,flex:1,opacity:.12},text:{padding:"0 10px",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"16px"}}))),L=e=>{let{children:t,className:r}=e;const n=V();return a().createElement(g.Z,{className:S()(n.root,r)},a().createElement(g.Z,{className:n.border}),a().createElement(f.Z,{className:n.text},t),a().createElement(g.Z,{className:n.border}))};var R=r(92679),U=r(10050),M=r(39475);const _=(0,E.makeStyles)({closeIcon:{color:"#fff"}}),z=e=>{let{error:t,onClose:r}=e;const n=_();return a().createElement(U.Z,{open:Boolean(t),onClose:r,message:t,action:a().createElement(M.k,{className:n.closeIcon,tooltipTitle:d().text("Close"),icon:R.default,onClick:r})})},B=(0,E.makeStyles)((e=>({root:{},dialogPaper:{position:"relative",maxWidth:"480px"},title:{color:e.palette.text.primary,fontSize:"20px",fontWeight:500,letterSpacing:"0.25px",lineHeight:"24px",padding:"16px"},body:{display:"flex",flexDirection:"column",alignItems:"center",padding:"0 8px 49px",textAlign:"center"},targetBox:{marginBottom:"8px"},divider:{marginBottom:"28px"}})));var F=r(30936);const H=e=>{let{open:t,onClose:r,onUpload:o}=e;const c=B(),u=(0,l.useSelector)(i.ZP.selectors.getImageServicePath),p=(0,l.useSelector)(i.ZP.selectors.getEnvironment),m=(0,l.useSelector)(i.ZP.selectors.getTenant),[y,x]=(0,n.useState)(!1),[v,E]=(0,n.useState)(null),w=e=>{x(!0),(0,s.Ixr)({image:e,imageServicePath:u,environment:p,tenant:m}).then((e=>{o(e),r()})).catch((e=>{E((0,s.xU7)(e,d().text("Something went wrong")))})).finally((()=>x(!1)))};return a().createElement(F.l,null,a().createElement(b.Z,{open:t,onClose:r,classes:{paper:c.dialogPaper}},a().createElement(f.Z,{className:c.title},d().text("Add new image")),a().createElement(g.Z,{className:c.body},a().createElement(D,{className:c.targetBox,onAppendFile:e=>{if(!e)return E(d().text("No image selected."));const t=Number((e.size/1024/1024).toFixed(2)),r=A.includes(e.type);t>20?E(d().text("File size exceeds configured max file size.")):r?w(e):E(d().text("File format is not supported."))}}),a().createElement(L,{className:c.divider},d().text("or")),a().createElement(C,{onSend:e=>{w(e)}})),y&&a().createElement(h.Z,null),a().createElement(z,{error:v,onClose:()=>E(null)})))};var q=r(43253),W=r(91446);const $=(0,E.makeStyles)((()=>({root:{width:"100%",marginBottom:"10px"},image:e=>{let{imageMargin:t}=e;return{marginRight:t,cursor:"pointer","&:last-child":{marginRight:0}}},uploadContainer:e=>{let{imageMargin:t,imageWidth:r,imageHeight:n}=e;return{backgroundColor:"white",width:r,height:n,cursor:"pointer",border:"1px dashed #0072CE",boxSizing:"border-box",marginRight:t,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},uploadButton:{width:"50px",height:"50px"},uploadIcon:{fontSize:"36px"}}))),Y=e=>{let{attributeType:t={},attributeValues:r=[],onDeleteAttribute:m,onChangeAttribute:d,requestNextPageOfAttributeValues:g,parentUri:b,paging:f,showNonOv:h,imageSize:y=W.By}=e;const x=$(y),v=(0,l.useSelector)(i.ZP.selectors.getEntity)||{},E=(0,l.useSelector)((e=>i.ZP.selectors.getModifiedEntityDefaultProfilePic(e,v.uri))),w=(0,l.useDispatch)(),[O,C]=(0,n.useState)(!1),N=(0,n.useCallback)((()=>{C((e=>!e))}),[]),S=(0,n.useCallback)((e=>{const r=(0,s.hm5)(b,t.name),n={};for(const a in e){const l=(t.attributes||[]).find((e=>{let{name:t}=e;return t===a}));l&&(n[a]=[{uri:(0,s.hm5)(r,l.name),ov:!0,value:e[a],type:l.uri}])}d({attributeType:t,uri:r,value:n})}),[d,b,t]),k=(0,n.useCallback)((e=>{if(m(e),E===e.uri){var t;const n=(null===(t=r[0])||void 0===t?void 0:t.uri)===e.uri?r[1]:r[0];w(i.N5.modifiedEntities.actions.setDefaultProfilePic({entityUri:v.uri,value:n||{}}))}}),[m,v,E,r]),T=(e,r)=>{const{onOpenImageGalleryDialog:n,onDownload:l,onShareLink:o,onSetAsDefault:i}=e,c=(0,s.Q5d)(r),{uri:p}=r;return a().createElement(u.Z,{id:p,onShareLink:()=>o(c),onSetAsDefault:()=>i(r),onDelete:()=>k({uri:p,attributeType:t}),onDownload:()=>l([c]),onClick:()=>n(p)})};return a().createElement("div",{className:x.root},a().createElement(q.Z,{attributeValues:r,attributeType:t,renderImage:e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=(0,s.efz)(t),{uri:n}=t,{onOpenImageGalleryDialog:l}=e;return a().createElement("div",{className:x.image,key:n},a().createElement(c.Z,{src:r,overlay:T(e,t),onClick:()=>l(n),size:{imageWidth:y.imageWidth,imageHeight:y.imageHeight},"data-reltio-id":"reltio-attribute-value"}))},overlay:!0,countFixedItems:1,onUpload:N,onDeleteAttribute:k,imageSize:y,requestNextPageOfAttributeValues:g,paging:f,parentUri:b,showNonOv:h},a().createElement("div",{className:x.uploadContainer,onClick:N},a().createElement(p.Z,{className:x.uploadButton,iconClassName:x.uploadIcon,icon:o.Z}))),a().createElement(H,{open:O,onUpload:S,onClose:N}))}},67283:(e,t,r)=>{r.d(t,{Z:()=>k});var n=r(24328),a=r.n(n),l=r(38677),o=r(35488),i=r(79312),s=r(71153),c=r.n(s),u=r(50914),p=r(2507),m=r.n(p),d=r(33117),g=r(22311),b=r(93553),f=r(94792),h=r(26638),y=r(63485),x=r(17512),v=r(41008);const E=(0,u.curry)(((e,t)=>(0,u.filter)((t=>(t.label||t.name).toLowerCase().includes(e.toLowerCase())))(t))),w=e=>{let{attrTypes:t,filter:r="",sortingFn:n}=e;return(0,u.pipe)(E(r),(0,u.sort)(n),(0,u.map)((e=>({item:{id:e.uri,label:e.label||e.name,attrType:e}}))))(t)};var O,C=r(50673),N=r(52730);!function(e){e.parent="parent",e.attributes="attributes"}(O||(O={}));const S=(0,r(72342).makeStyles)({moreAttributes:{display:"flex",paddingBottom:"6px","&$dense":{padding:0}},dense:{},popupContainer:{},moreAttributesPopup:{"&$popupContainer":{}},moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},subHeader:{backgroundColor:"rgb(245, 245, 245)",padding:"0 16px",margin:0,display:"flex",alignItems:"center",color:"rgba(0,0,0,0.84)",fontSize:"14px",fontWeight:500},noResultsCaptionContainer:{position:"absolute",top:0,bottom:0,left:0,right:0,display:"flex",justifyContent:"center",alignItems:"center"}}),k=e=>{let{label:t,popupTitle:r=t,data:s,parent:p,dense:E,onApply:k}=e;const T=S(),A=(0,n.useRef)(),[Z,P]=(0,n.useState)(!1),[j,I]=(0,n.useState)(""),[D,V]=(0,n.useState)([]),{items:L,hasGroups:R,parentGroupLength:U,attributesGroupLength:M}=(e=>{let{data:t,parent:r,filter:a}=e;const l=Boolean(r),o=(0,N.useSelector)(C.ZP.selectors.getAttributesSortingStrategy),i=(0,n.useMemo)((()=>o===x.PYu.ASC_BY_NAME?(e,t)=>{var r;return null==e||null===(r=e.label)||void 0===r?void 0:r.localeCompare(null==t?void 0:t.label)}:(e,t)=>0),[o]),s=(0,n.useMemo)((()=>l?w({attrTypes:[r],filter:a,sortingFn:i}):[]),[l,r,a,i]),c=(0,n.useMemo)((()=>l&&null!=s&&s.length?[{item:{id:O.parent,label:m().text("Parent")},items:s}]:[]),[l,s]),u=(0,n.useMemo)((()=>w({attrTypes:t,filter:a,sortingFn:i})),[t,a,i]),p=(0,n.useMemo)((()=>l&&null!=u&&u.length?[{item:{id:O.attributes,label:m().text("Attributes")},items:u}]:u),[l,u]),d=(0,n.useMemo)((()=>(0,v.LG)((c||[]).concat(p))),[c,p]),g=c.length,b=p.length;return{items:d,hasGroups:l,parentGroupLength:g,attributesGroupLength:b}})({data:s,parent:p,filter:j}),_=(0,n.useCallback)(((e,t)=>{V((0,u.ifElse)((0,u.always)(t),(0,u.append)(e),(0,u.reject)((0,u.propEq)("id",e.id)))(D))}),[D]),z=(0,n.useCallback)(((e,t)=>t.items?40:28),[]),B=(0,n.useCallback)((e=>{let{item:t}=e;_(t,(0,u.not)((0,u.any)((0,u.propEq)("id",t.id))(D)))}),[_,D]),{focusIndex:F,handleKeyDown:H}=(0,h.t)({items:L,open:Z,onSelectFocusedItem:B,selectedItems:D}),q=(0,n.useRef)(null);q.current=F;const W=R?(U?1:0)+(M?1:0):0,$=L.length-W,Y=Math.min(255,28*$+40*W),X=Math.max(140,Y+112),G=(0,n.useCallback)(((e,t,r)=>{var n;let{item:l,level:o=0}=t;const i=(0,u.any)((0,u.propEq)("id",l.id))(D),s=q.current===r;return a().createElement(d.Z,{key:l.uri,onClick:_,checked:i,level:o,data:l,label:a().createElement(f.Z,{text:l.label,highlight:j}),labelInText:l.label,style:e,isFocused:s,isRequired:!(null===(n=l.attrType)||void 0===n||!n.required),LogoIcon:l.LogoIcon})}),[j,_,D]),K=(0,n.useCallback)(((e,t)=>a().createElement(o.ZP,{component:"div",className:T.subHeader,style:e,key:`group-${t.item.id}`},t.item.label)),[]);return a().createElement("div",{className:c()(T.moreAttributes,{[T.dense]:E})},a().createElement(l.Z,{color:"primary",onClick:()=>P(!Z),ref:A,className:T.moreButton},a().createElement(b.Z,{classes:{root:T.icon}}),a().createElement("div",{className:T.buttonLabel},t)),a().createElement(g.Z,{open:Z,className:c()(T.moreAttributesPopup,T.popupContainer),anchorEl:A.current,onClose:(0,u.pipe)((()=>{D.length>0&&k((0,u.pluck)("attrType",D))}),(()=>P(!1)),(()=>I("")),(()=>V([]))),onSearch:I,containerHeight:X,title:r,containerWidth:320,searchInputOnKeyDown:H},a().createElement(y.Z,{getItemSize:z,renderItem:G,renderGroupTitle:K,items:L,height:Y,focusIndex:F}),0===L.length&&a().createElement("div",{className:T.noResultsCaptionContainer},a().createElement(i.Z,{variant:"caption",display:"block",gutterBottom:!0},m().text("No results found")))))}},3853:(e,t,r)=>{r.d(t,{Z:()=>c});var n=r(24328),a=r.n(n),l=r(17512),o=r(38328);function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i.apply(this,arguments)}const s=e=>{const{attributeValue:t,attributeType:r}=e,n=(0,l.Kxm)(t,r.dataLabelPattern);return a().createElement(o.Z,i({label:(0,l.idV)(n),attributeTypesList:r.attributes||r.analyticsAttributes},e))};s.propTypes=l.j2V;const c=(0,n.memo)(s)},10768:(e,t,r)=>{r.d(t,{Z:()=>S});var n=r(52730),a=r(50673),l=r(24328),o=r.n(l),i=r(13980),s=r.n(i),c=r(71153),u=r.n(c),p=r(50914),m=r(17512),d=r(38328),g=r(72283),b=r(93555),f=r(50548),h=r(43460),y=r(40941);const x=(0,r(72342).makeStyles)({item:{marginBottom:"20px"},dense:{marginBottom:0}});function v(){return v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},v.apply(this,arguments)}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){w(e,t,r[t])}))}return e}function w(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const O=e=>{const t=x(),{modifiedEntity:r,metadata:n,globalSearchRequestOptions:a,onDeleteModifiedEntity:i,onUpdateModifiedEntity:s,onDeactivateError:c,highlightedError:f}=e,h=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["modifiedEntity","metadata","globalSearchRequestOptions","onDeleteModifiedEntity","onUpdateModifiedEntity","onDeactivateError","highlightedError"]),{attributeValue:w,attributeType:O,mode:C,crosswalks:N,errors:S,onChangeAttribute:k}=h,T=(0,l.useRef)(w),{ref:A,errorClassName:Z}=(0,y.B)({highlightedError:f,isSimple:!0}),P=(0,m.CZ8)(w),j=(0,m.o96)(w),I=(0,m.Poc)(O),D=(0,m.nt9)(n,I),V=r?(0,m.Kxm)(r,D.dataLabelPattern):w.label,L=(0,l.useMemo)((()=>[I]),[I]),R=(0,l.useMemo)((()=>(0,m.EtK)(N,j)),[N,j]),U=(0,l.useMemo)((()=>(0,m.mbo)(w,S)),[w,S]),M=(0,l.useMemo)((()=>P&&{entityUri:(0,m.ZTM)(P),entityType:(0,m.uGi)(P),entityLabel:w.label}),[P,w.label]),_=(0,l.useMemo)((()=>(0,m.tF$)(O).map((e=>(0,m.zeJ)(n,e))).filter(p.identity)),[O,n]),z=(0,l.useCallback)((e=>(0,m.ct9)(O,e)),[O]),B=(0,l.useCallback)((e=>{r&&i(r.uri);const t=T.current,n=!(0,p.isEmpty)(e)&&e.uri===(0,m.bwT)(t),a=E({},w,{label:e.label,refEntity:n?t.refEntity:(0,m.fmQ)(e),refRelation:n?t.refRelation:(0,m.NBq)(w)});k({value:a,attributeType:O,uri:w.uri}),U&&c((0,m.iFp)(U))}),[w,O,r,k,i,c,U]),F=(0,l.useCallback)(((e,t)=>{const r=(0,p.pipe)(z,(0,m._kX)(C))(D),a=(0,m.pBq)({entityTypeUri:e,initValue:t,attributeTypes:r,metadata:n,mode:C});B(a),s(a)}),[z,C,D,n,B,s]),H=(0,l.useMemo)((()=>(0,m.yv0)({attributeType:O,attributeValue:w,mode:C,isReltioCrosswalk:(0,m.KVV)(N,w)})),[O,w,C,N]),q=(0,l.useMemo)((()=>(0,m.d89)(C,D)),[C,D]),W=(0,m.e$p)(U);return o().createElement(d.Z,v({},h,{label:(0,m.idV)(V),attributeTypesList:_,crosswalks:R,metadata:n}),o().createElement("div",{ref:A,className:Z},o().createElement(b.Z,{errorMessage:W},o().createElement(g.Z,{className:u()(t.item,{[t.dense]:W||M&&(0,m.ZiX)(M.entityUri)}),entity:M||{},entityTypesUris:L,max:20,globalSearchRequestOptions:a,mode:C,isDisabled:!H,onChange:B,onCreate:q?F:void 0,metadata:n,attributeTypesSelectionStrategy:z}))))};O.propTypes=E({},m.NkU,{modifiedEntity:m.pyR,metadata:m.pGS,globalSearchRequestOptions:s().object,onDeleteModifiedEntity:s().func,onUpdateModifiedEntity:s().func,onDeactivateError:s().func,highlightedError:s().object});const C=(0,f.l)(h.NY,((e,t)=>{let{attributeValue:r,attributeType:n}=t;const{element:a,type:l}=e||{};return{highlightedError:(0,h.Ie)(l)&&(0,m.Wah)(a,r.uri,n.uri)?e:null}}),O),N={onDeleteModifiedEntity:a.N5.modifiedEntities.actions.entityDeleted,onUpdateModifiedEntity:a.N5.modifiedEntities.actions.entityCreated,onDeactivateError:a.N5.errors.actions.errorDeactivated},S=(0,n.connect)(((e,t)=>{const r=(0,m.bwT)(t.attributeValue);return{modifiedEntity:(0,m.ZiX)(r)?a.ZP.selectors.getModifiedEntity(e,r):null,metadata:a.ZP.selectors.getMetadata(e),globalSearchRequestOptions:a.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"])}}),N)(C)},13310:(e,t,r)=>{r.d(t,{Z:()=>L});var n=r(24328),a=r.n(n),l=r(13980),o=r.n(l),i=r(52730),s=r(71153),c=r.n(s),u=r(50914),p=r(93553),m=r(6163),d=r(79312),g=r(2507),b=r.n(g),f=r(17512),h=r(67586),y=r(51492),x=r(93555),v=r(40435),E=r(12980),w=r(67462),O=r(50673);function C(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){N(e,t,r[t])}))}return e}function N(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const S={},k=(e,t,r)=>{const n=O.ZP.selectors.getDependentLookupsStructureNode(e,r);if(n){const r=t.uri,{parents:o,missedParentsAttributeTypes:i}=((e,t,r)=>{var n;const a=r.parents.flatMap((t=>{const r=O.ZP.selectors.getDependentLookupsStructureNode(e,t);return r.values.map((e=>C({},e,{type:t,dependentLookupCode:r.attrType.dependentLookupCode})))})),l=O.ZP.selectors.getModifiedEntities(e),o=O.ZP.selectors.getEntityUri(e),i=O.ZP.selectors.getAllRelationsToAddAndEdit(e),s=O.ZP.selectors.getMetadata(e),c=(0,f.vUy)({parentValues:a,valueUri:t,entityUri:o,modifiedEntities:l,connections:i}),p=(0,u.pipe)(f.uDV,(0,u.defaultTo)([]),(0,u.map)((0,u.pipe)((0,u.path)(["valueType","uri"]),f.u5q)),(0,u.prepend)(null===(n=l[o])||void 0===n?void 0:n.type),(0,u.reject)(u.isNil),u.uniq)({entityUri:o,entitiesMap:l,connections:i,metadata:s},t),m=r.parents.filter((e=>p.some((0,f.sOy)(e)))).map((t=>O.ZP.selectors.getDependentLookupsStructureNode(e,t).attrType)).filter((e=>!c.some((t=>{let{type:r,value:n}=t;return n&&r===e.uri}))));return{parents:Object.values(c.reduce(((e,t)=>{var r;const n=(e=>`${e.type}_${(0,f.JBA)(e.uri)}`)(t);return C({},e,{[n]:{type:t.dependentLookupCode,codeValues:(0,u.uniq)([t.value,...(null===(r=e[n])||void 0===r?void 0:r.codeValues)||[]]).filter(Boolean).sort()}})}),{})).filter((e=>!!e.codeValues.length)),missedParentsAttributeTypes:m}})(e,r,n),{isBlocked:s=!1}=O.ZP.selectors.getDependentLookupEditorState(e,r)||{},c=(a=i).length?b().text("Please select value for ${labels} ${attributes}.",{labels:(l=a.map((0,u.pipe)((0,u.prop)("label"),(e=>`'${e}'`))),l.reduce(((e,t,r)=>[e,t].join(r===l.length-1?` ${b().text("and")} `:", ")))),attributes:1===a.length?b().text("attribute"):b().text("attributes")}):"",p=!(null!=t&&t.lookupCode||null!=t&&t.value),m=p&&s&&b().text("Populating values...")||p&&c||"",d={parents:c?null:o,disabled:!!c&&p||s,placeholder:m};return m&&(d.value=null),((e,t)=>{const r=S[e];return(0,u.equals)(t,r)?r:((0,u.equals)(null==r?void 0:r.parents,t.parents)&&(t.parents=r.parents),S[e]=t,t)})(r,d)}var a,l};var T=r(50548),A=r(80231),Z=r(51894),P=r(43460),j=r(40941);const I=(0,r(72342).makeStyles)((e=>({wrapper:{width:"100%"},errorWrapper:{alignSelf:"stretch"},editor:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px",position:"relative"},"editor-value":{flex:"1 1 auto"},"editor-read-only-value":{marginLeft:"12px",display:"flex",alignItems:"center"},"editor-actions":{display:"flex",alignItems:"center",paddingLeft:"8px"},addButton:{marginRight:"-8px"},button:{color:e.palette.text.secondary},placeholder:{height:"50px"},deleted:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary}})));function D(){return D=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},D.apply(this,arguments)}const V=e=>{let{className:t,attributeValue:r,attributeType:l,isReltioCrosswalk:o,ownError:s,mode:g,onAddOneMore:w,onDeleteAttribute:C,onChangeAttribute:N,onDeactivateError:S,additionalControlsRenderer:T,state:P,highlightedError:V,isEmptyEditor:L=!1}=e,R=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","attributeValue","attributeType","isReltioCrosswalk","ownError","mode","onAddOneMore","onDeleteAttribute","onChangeAttribute","onDeactivateError","additionalControlsRenderer","state","highlightedError","isEmptyEditor"]);const U=I(),M="deleted"===P,_="edited"===P,z=(0,f.KIu)(g),B=(0,f.Vg3)({attributeType:l,mode:g}),F=(0,f.yv0)({attributeType:l,attributeValue:r,mode:g,isReltioCrosswalk:o}),H=(0,f.xv5)({attributeType:l,attributeValue:r,mode:g,isReltioCrosswalk:o}),q=F&&z,W=(0,f.e$p)(s),$=(0,i.useSelector)((e=>(0,f.QEi)(l)?k(e,r,null==l?void 0:l.uri):null)),{ref:Y,errorClassName:X}=(0,j.B)({highlightedError:V,isSimple:!0});(0,n.useEffect)((()=>{L&&(0,f.QEi)(l)&&!(0,u.has)("lookupCode",r)&&N({attributeType:l,uri:r.uri,value:r.value,silent:!0})}),[L]);const G=(0,n.useMemo)((()=>(0,f.PFL)(l)),[l]),K=(0,n.useMemo)((()=>(0,E.AG)(r,G)),[r,G]),J=(0,n.useCallback)((()=>{s&&S((0,f.iFp)(s))}),[s,S]),Q=(0,n.useCallback)((0,u.pipe)((0,E.pp)(r,l),N,J),[r,l,N,J]),ee=!!w&&B&&!l.singleValue,te=!M&&!!C&&H,re=!!W,ne=M?{disabled:!0,isCrossedOut:!0}:{},ae=(0,n.useContext)(A.j),{autopopulationContextValue:le}=(e=>{let{enabled:t,attributeTypeUri:r,valueUri:a}=e;const l=(0,i.useDispatch)(),o=(0,i.useSelector)(O.ZP.selectors.getLookupAutocomplete),s=t&&(0,f.Vmh)(o,r),c=s?a:null,{isTouched:u=!1}=(0,i.useSelector)((e=>s&&O.ZP.selectors.getDependentLookupEditorState(e,a)))||{},p=(0,n.useCallback)((e=>{l(O.N5.dependentLookups.actions.dependentLookupsEditorTouched({uri:e,isTouched:!0}))}),[l]);return{autopopulationContextValue:(0,n.useMemo)((()=>c?{id:c,isTouched:u,onTouch:p}:null),[c,u,p])}})({enabled:ae&&(0,f.QEi)(l),attributeTypeUri:null==l?void 0:l.uri,valueUri:r.uri});return a().createElement("div",{ref:Y,className:c()(U.editor,t,X)},a().createElement(x.Z,{errorMessage:W,className:U.errorWrapper},a().createElement("div",{className:c()(U["editor-value"],{[U.deleted]:M},{[U["editor-read-only-value"]]:!q}),"data-reltio-id":"reltio-attribute-value"},q?a().createElement(Z.m.Provider,{value:le},a().createElement(y.Z,D({fieldName:(0,f.Tde)(l.uri),value:K,dataTypeDefinition:G,error:re,onChange:Q,fullWidth:!0},$,R,ne))):a().createElement(h.Z,{value:(0,f.kDl)(r),dataTypeDefinition:G}))),a().createElement("div",{className:U["editor-actions"]},_&&a().createElement(d.Z,{variant:"caption",className:U.editedLabel},"(",b().text("edited"),")"),ee&&a().createElement(v.Z,{icon:p.Z,onClick:w,size:"L",className:c()(U.addButton,U.button)}),T&&T({attributeType:l,attributeValue:r}),te&&a().createElement(v.Z,{className:U.button,icon:m.Z,onClick:()=>{C({uri:r.uri,attributeType:l}),(0,f.PcX)(s)!==f.NIO.missed&&J()},size:"L","data-reltio-id":"reltio-delete-simple-attribute-button"})))};V.propTypes={className:o().string,attributeValue:f.cNQ,attributeType:f.EMD,ownError:f.wfT,isReltioCrosswalk:o().bool,state:o().oneOf(["deleted","edited"]),mode:f.XGc,onAddOneMore:o().func,onDeleteAttribute:o().func,onChangeAttribute:o().func,onDeactivateError:o().func,additionalControlsRenderer:o().func,highlightedError:o().object,isEmptyEditor:o().bool};const L=(0,w.Z)((0,T.l)(P.NY,((e,t)=>{let{attributeValue:r}=t;const{element:n,type:a}=e||{};return{highlightedError:(0,P.Ie)(a)&&(null==n?void 0:n.uri)===r.uri?e:null}}),V),(()=>{const e=I();return a().createElement("div",{className:e.placeholder})}))},12980:(e,t,r)=>{r.d(t,{AG:()=>i,Ho:()=>s,pp:()=>c});var n=r(95038),a=r.n(n),l=r(17512),o=r(50914);const i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t}=arguments.length>1?arguments[1]:void 0;const{value:r,lookupCode:n}=e;switch(t){case l.oS0.TYPE_BOOLEAN:case l.oS0.TYPE_BOOLEAN_RADIO:case l.oS0.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,l.gxP)(r);case l.oS0.TYPE_DATE:return r&&l.P6Y.dates.toLocalDate(r)||null;case l.oS0.TYPE_LOCAL_DATE:case l.oS0.TYPE_TIMESTAMP:case l.oS0.TYPE_ACTIVENESS_DATE:return r&&new Date(r)||null;case l.oS0.TYPE_DEPENDENT_LOOKUP:case l.oS0.TYPE_LOOKUP:return{value:r,lookupCode:n};default:return r}},s=(e,t)=>{const{type:r}=(0,l.PFL)(e);switch(r){case l.oS0.TYPE_BOOLEAN:case l.oS0.TYPE_BOOLEAN_RADIO:case l.oS0.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t.toString();case l.oS0.TYPE_DATE:return t&&a()(t).format("YYYY-MM-DD")||"";case l.oS0.TYPE_TIMESTAMP:return t&&a()(t).format()||"";case l.oS0.TYPE_ACTIVENESS_DATE:case l.oS0.TYPE_LOCAL_DATE:return t&&t.valueOf();default:return t||""}},c=(0,o.curry)(((e,t,r)=>({value:s(t,r),uri:e.uri,attributeType:t})))},38583:(e,t,r)=>{r.d(t,{d:()=>a});var n=r(24328);const a=r.n(n)().createContext(null)},1108:(e,t,r)=>{r.d(t,{c:()=>a});var n=r(24328);const a=r.n(n)().createContext(null)},26978:(e,t,r)=>{r.d(t,{U:()=>l,A:()=>o});var n=r(50914),a=r(17512);const l=(e,t,r,l)=>{const o=(0,n.pipe)(a.nt9,(0,n.defaultTo)({}),(0,n.props)(["attributes","analyticsAttributes"]),(0,n.reject)(n.isNil),n.flatten,(0,n.concat)(n.__,(0,n.pipe)(n.values,(0,n.reject)((0,n.propEq)("uri",a.xPW.id.uri)))(a.xPW)))(e,t);return r.length?o.filter((e=>{let{uri:t}=e;return r.includes(t)})):o.filter((e=>{let{uri:t}=e;return!l.includes(t)}))},o=(e,t)=>(0,n.partition)((0,n.pipe)((0,n.path)(["attrType","uri"]),(0,n.includes)(n.__,e)),t)},31992:(e,t,r)=>{r.d(t,{Z:()=>u});var n=r(25661),a=r(55485),l=r(24328),o=r.n(l),i=r(2507),s=r.n(i),c=r(47608);const u=e=>{let{onClick:t}=e;const r=(0,c.y)();return o().createElement(a.Z,{component:"button",variant:"caption",className:r.link,onClick:t,underline:"none"},o().createElement(n.Z,{className:r["svg-icon__root"]}),s().text("Show less"))}},35039:(e,t,r)=>{r.d(t,{Z:()=>u});var n=r(85101),a=r(55485),l=r(24328),o=r.n(l),i=r(2507),s=r.n(i),c=r(47608);const u=e=>{let{moreNumber:t,valueNumber:r,onClick:l}=e;const i=(0,c.y)();return o().createElement(a.Z,{component:"button",variant:"caption",className:i.link,onClick:l,underline:"none"},o().createElement(n.Z,{className:i["svg-icon__root"]}),t&&r?s().text("Show ${moreNumber} more of remaining ${valueNumber} value",{moreNumber:t,valueNumber:r}):s().text("Show more"))}},47608:(e,t,r)=>{r.d(t,{y:()=>n});const n=(0,r(72342).makeStyles)({link:{display:"flex",marginTop:4},"svg-icon__root":{fontSize:"1rem"}})},11013:(e,t,r)=>{r.d(t,{Z:()=>c});var n=r(24328),a=r.n(n),l=r(17512),o=r(81489),i=r(88610),s=r(25257);const c=e=>{const{attributeType:t}=e;return class{static build(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(e.type){case l.oS0.TYPE_NESTED:return a().createElement(i.Z,t);case l.oS0.TYPE_REFERENCE:return a().createElement(s.Z,t);default:return a().createElement(o.Z,t)}}}.build(t,e)}},89978:(e,t,r)=>{r.d(t,{Z:()=>d});var n=r(24328),a=r.n(n),l=r(50914),o=r(17512),i=r(52239),s=r(94319),c=r(35039),u=r(31992),p=r(86602),m=r(26978);const d=(0,n.memo)((e=>{let{attrTypes:t,entity:r,parentUri:d,drawLines:g,children:b,className:f,max:h,alwaysVisibleTypeUris:y=p.S,showNonOv:x}=e;const[v,E]=(0,n.useState)(h||1/0),w=(0,n.useMemo)((()=>(0,o.fyF)(t,r,x)),[t,r,x]),[O,C]=(0,n.useMemo)((()=>(0,m.A)(y,w)),[w,y]),N=C.slice(0,v),S=h&&N.length<C.length,k=h&&N.length>=C.length&&h<N.length,T={enabled:g};return a().createElement("div",{className:f},b&&a().createElement(i.Z,T,b),N.concat(O).map((e=>{let{attrType:t,values:n}=e;return a().createElement(s.Z,{key:t.uri,attributeType:t,drawLines:g,values:n,paging:(0,l.path)(["paging",t.uri],r.attributes),parentUri:d,showNonOv:x})})),S&&a().createElement(c.Z,{onClick:()=>{E(1/0)}}),k&&a().createElement(u.Z,{onClick:()=>{E(h)}}))}))},94319:(e,t,r)=>{r.d(t,{Z:()=>Q});var n=r(52730),a=r(50673),l=r(71153),o=r.n(l),i=r(24328),s=r.n(i),c=r(50914),u=r(17512),p=r(72342);function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){d(e,t,r[t])}))}return e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const g="13px",b="15px",f={titleRow:{display:"block",minHeight:"16px"},title:{whiteSpace:"nowrap"},ovIcon:{marginLeft:"8px",marginRight:"-3px",marginTop:"-1px",textIndent:0},descriptionIcon:{marginTop:"-1px",textIndent:0,marginRight:"-10px"}},h=(0,p.makeStyles)({paddingWrapper:{paddingTop:"3px",paddingBottom:"5px","&:last-child":{paddingBottom:"2px"}},paddingWrapperWithLines:{paddingBottom:"1px","&:last-child":{paddingBottom:"2px"}}}),y=(0,p.makeStyles)(m({wrapper:{fontSize:g,lineHeight:b,flex:1},collaborationWrapper:{display:"flex",alignItems:"start",minHeight:"18px"},attribute:{marginLeft:"8px",paddingLeft:"4px",paddingRight:"4px",display:"inline",overflow:"hidden",whiteSpace:"pre-wrap",wordBreak:"break-word"},titleIcon:{width:"16px",height:"16px",marginBottom:"-3px",marginRight:"8px",marginLeft:"1px",color:"rgba(0, 0, 0, 0.38)"}},f)),x=(0,p.makeStyles)(m({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start",fontSize:g,lineHeight:b},attribute:{"&:last-child":{marginBottom:0},paddingLeft:"4px",paddingRight:"4px",marginLeft:"5px",marginBottom:"4px",whiteSpace:"pre-wrap",wordBreak:"break-word"},attributes:{alignSelf:"stretch"},titleRow:m({},f.titleRow,{marginBottom:"3px"})},f));var v=r(52239),E=r(62901),w=r(72316),O=r(14699),C=r(33043),N=r(4767),S=r(11013);const k=e=>{let{value:t,nonVisibleValues:r,attributeType:n,titleClassName:a,contentClassName:l,showNonOv:i,totalNonVisibleValues:c}=e;const p=y(),{label:m,description:d}=n,g=(0,u.xdS)(n)?u.q7e.RELATION_ATTRIBUTE:u.q7e.ENTITY_ATTRIBUTE;return s().createElement("div",{className:o()(p.collaborationWrapper,E.U)},s().createElement("div",{className:o()(p.titleRow,p.wrapper)},s().createElement(O.Z,{label:m,className:o()(p.title,a),"data-reltio-id":"reltio-attribute-label"}),s().createElement(N.Z,{description:d,className:p.descriptionIcon}),s().createElement(C.Z,{nonOvValues:r,attributeType:n,className:p.ovIcon,nonOvTotal:c}),s().createElement(S.Z,{className:o()(p.attribute,l),attributeValue:t,attributeType:n,showNonOv:i,inlined:!0})),s().createElement(w.Z,{uri:t.uri,relatedObjectUris:(0,u.wp9)(g,{uri:t.uri}),objectType:g}))};var T=r(35039),A=r(31992);const Z=e=>{let{max:t,values:r,nonVisibleValues:n,totalVisibleValues:a,attributeType:l,parentUri:u,requestNextPageOfAttributeValues:p,titleClassName:m,contentClassName:d,showNonOv:g,totalNonVisibleValues:b}=e;const f=x(),[h,y]=(0,i.useState)(t),v=t<a,E=v&&h<a,w=v&&h>=a,{label:k,description:Z}=l,P=r.slice(0,h),j=a-h;return s().createElement("div",{className:f.wrapper},s().createElement("div",{className:f.titleRow},s().createElement(O.Z,{label:k,className:o()(f.title,m),"data-reltio-id":"reltio-attribute-label"}),s().createElement(N.Z,{description:Z}),s().createElement(C.Z,{nonOvValues:n,attributeType:l,className:f.ovIcon,nonOvTotal:b})),s().createElement("div",{className:f.attributes},P.map((e=>s().createElement(S.Z,{key:e.uri,className:o()(f.attribute,d),attributeValue:e,attributeType:l,showNonOv:g})))),E&&s().createElement(T.Z,{moreNumber:(0,c.min)(t,j),valueNumber:j,onClick:()=>{r.length<a&&p({parentUri:u,attributeTypeUri:l.uri,attributeTypeName:l.name,values:r,defaultMaxValues:t}),y(h+t)}}),w&&s().createElement(A.Z,{onClick:()=>{y(t)}}))};var P=r(59916);const j=e=>{let{className:t,values:r,Component:n,dataReltioId:a}=e;return s().createElement("div",{className:t,"data-reltio-id":a},r.map(((e,t)=>s().createElement(i.Fragment,{key:e},s().createElement(n,{value:e}),t<r.length-1&&", "))))};var I=r(62228);function D(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){V(e,t,r[t])}))}return e}function V(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const L=(0,p.makeStyles)({insertAttribute:D({width:"fit-content"},u.zXF[u.Y1q.insertAttribute]),deleteAttribute:D({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},u.zXF[u.Y1q.deleteAttribute])}),R=e=>{let{value:t}=e;const r=L(),l=(0,n.useSelector)(a.ZP.selectors.getMetadata),{appearance:o}=(0,i.useContext)(I.m),c=(0,u.YNv)("roles",t,o),p=(0,u.o_F)(c);return s().createElement("span",{className:r[p]},(0,u.xqc)(l,t))},U=e=>{let{className:t,values:r}=e;return s().createElement(j,{values:r,className:t,dataReltioId:"reltio-attribute-value",Component:R})};var M=r(30357),_=r(10609),z=r(98074);const B=e=>{let{value:t}=e;const r=L(),l=(0,n.useSelector)(a.ZP.selectors.getUIPath),o=(0,n.useSelector)(a.ZP.selectors.getEntity),c=(0,i.useContext)(_.u),{appearance:p}=(0,i.useContext)(I.m),{generateTagUrl:m}=(0,i.useContext)(z.v),d=(0,u.YNv)("tags",t,p),g=(0,u.o_F)(d),b=c||o;return s().createElement(M.Z,{className:r[g],href:m({uiPath:l,tag:t,entityUri:b.dataTenant?(0,u.Nsy)(b):b.uri})},t)},F=e=>{let{className:t,values:r}=e;return s().createElement(j,{values:r,className:t,dataReltioId:"reltio-attribute-value",Component:B})},H=e=>{let{values:t,attributeType:r}=e;const n=y(),{label:a}=r;return s().createElement("div",{className:o()(n.titleRow,n.wrapper)},(l=n.titleIcon,r.uri===u.xPW.tags.uri?s().createElement(P.Z,{className:l}):null),s().createElement(O.Z,{label:a,className:n.title,"data-reltio-id":"reltio-attribute-label"}),(e=>{switch(r.uri){case u.xPW.tags.uri:return s().createElement(F,{className:e,values:t});case u.xPW.roles.uri:return s().createElement(U,{className:e,values:t});default:return s().createElement(S.Z,{className:e,attributeValue:{value:t[0]},attributeType:r,inlined:!0})}})(n.attribute));var l};var q=r(61347);const W=e=>{let{attributeType:t,attributeValues:r,paging:n,parentUri:a,showNonOv:l,requestNextPageOfAttributeValues:o}=e;const i=x(),{label:c,description:u}=t;return s().createElement(s().Fragment,null,s().createElement("div",{className:i.titleRow},s().createElement(O.Z,{className:i.title,label:c,"data-reltio-id":"reltio-attribute-label"}),s().createElement(N.Z,{className:i.descriptionIcon,description:u})),s().createElement(q.Z,{attributeValues:r,attributeType:t,paging:n,parentUri:a,requestNextPageOfAttributeValues:o,showNonOv:l}))},$="oneLine",Y="multiLine",X="imageLine",G="special",K=(0,i.memo)((e=>{let{values:t,attributeType:r,drawLines:n,paging:a={},parentUri:l,max:i=1/0,requestNextPageOfAttributeValues:p,titleClassName:m,contentClassName:d,showNonOv:g}=e;const b=h(),f=(0,c.partition)(u.OXP);if(!t||!t.length)return null;const[y,x]=f(t),E=g?t:y,w=g?[]:x,O=g?"totalValues":"totalOvValues",C=(0,c.ifElse)((0,c.has)(O),(0,c.prop)(O),(0,c.always)(E.length))(a),N=null!=a&&a.totalValues?a.totalValues-C:w.length,S=1===C&&!(0,u.YkM)(r);return s().createElement(v.Z,{enabled:n,className:o()({[b.paddingWrapperWithLines]:n})},s().createElement("div",{className:o()({[b.paddingWrapper]:!n})},(()=>{switch((0,c.cond)([[u.kqr,(0,c.always)(G)],[u.Or$,(0,c.always)(X)],[(0,c.always)(S),(0,c.always)($)],[c.T,(0,c.always)(Y)]])(r)){case $:return s().createElement(k,{value:E[0],nonVisibleValues:w,totalNonVisibleValues:N,attributeType:r,titleClassName:m,contentClassName:d,showNonOv:g});case Y:return s().createElement(Z,{values:E,nonVisibleValues:w,totalVisibleValues:C,totalNonVisibleValues:N,attributeType:r,parentUri:l,max:i,requestNextPageOfAttributeValues:p,titleClassName:m,contentClassName:d,showNonOv:g});case X:return s().createElement(W,{attributeValues:E,attributeType:r,paging:a,parentUri:l,requestNextPageOfAttributeValues:p,showNonOv:g});case G:return s().createElement(H,{values:E,attributeType:r})}})()))})),J={requestNextPageOfAttributeValues:a.N5.actions.requestNextPageOfAttributeValues},Q=(0,n.connect)(((e,t)=>{let{max:r}=t;return{max:r||a.ZP.selectors.getDefaultMaxValues(e)}}),J)(K)},13870:(e,t,r)=>{r.d(t,{Z:()=>v});var n=r(24328),a=r.n(n),l=r(13980),o=r.n(l),i=r(71153),s=r.n(i),c=r(17512),u=r(79312),p=r(89978),m=r(85777),d=r(72316),g=r(54837),b=r(74542),f=r(62901);const h=(0,r(72342).makeStyles)({complexContainer:{marginTop:"1px"},labelContainer:{display:"flex",minHeight:"18px"},label:{fontSize:"13px",lineHeight:"15px",letterSpacing:"normal",paddingTop:"1px",marginLeft:"2px"},spacer:{flex:1}});function y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const x=e=>{let{attributeTypesList:t,attributeValue:r,label:l,expanded:o=!1,children:i,showNonOv:x,attributeType:v,LabelRenderer:E,RightSlot:w}=e;const O=h(),C=(0,b.V)(),N=r.uri,[S,k]=(0,n.useState)(!1),{highlightedValuesUris:T=[],highlightedClassName:A}=(0,n.useContext)(g.j);(0,n.useEffect)((()=>{k(o)}),[o]);const Z=(t||[]).some((e=>(0,c.kQw)(e))),P=(0,n.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){y(e,t,r[t])}))}return e}({attributes:Z?null:r.value,analyticsAttributes:Z?r.value:null},(0,c.kqr)(v)?r.value:{})),[r,Z,v]),j=(0,c.xdS)(v)?c.q7e.RELATION_ATTRIBUTE:c.q7e.ENTITY_ATTRIBUTE;return a().createElement("div",{className:O.complexContainer},a().createElement("div",{className:s()(O.labelContainer,f.U)},a().createElement(m.Z,{onClick:()=>k((e=>!e)),expanded:S}),E?a().createElement(E,{attributeType:v,attributeValue:r}):a().createElement(a().Fragment,null,a().createElement(u.Z,{component:"span",variant:"body2",classes:{body2:O.label},className:s()({[A]:T.includes(r.uri),[C.ovFalse]:!(0,c.OXP)(r)}),"data-reltio-id":"reltio-attribute-complex-label"},l),a().createElement("div",{className:O.spacer}),w&&a().createElement(w,{attributeType:v,attributeValue:r}),a().createElement(d.Z,{uri:r.uri,relatedObjectUris:(0,c.wp9)(j,{uri:r.uri}),objectType:j}))),S&&a().createElement(p.Z,{attrTypes:t,entity:P,drawLines:!0,parentUri:N,showNonOv:x},i))};x.propTypes={children:o().node,label:o().oneOfType([o().string,o().node]),attributeTypesList:o().arrayOf(c.EMD),attributeValue:o().oneOfType([c.dMV,c.Rtp]),expanded:o().bool,showNonOv:o().bool,attributeType:c.EMD,LabelRenderer:o().elementType,RightSlot:o().elementType};const v=x},61347:(e,t,r)=>{r.d(t,{Z:()=>d});var n=r(24328),a=r.n(n),l=r(17512),o=r(71153),i=r.n(o),s=r(62228),c=r(26729),u=r(43253),p=r(91446);const m=(0,r(72342).makeStyles)((e=>({image:e=>{let{imageMargin:t,imageHeight:r,imageWidth:n}=e;return{marginRight:t,width:n,height:r,cursor:"pointer","&:last-child":{marginRight:0}}},deleteAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,background:`url('${(0,l.m5F)('<svg xmlns="http://www.w3.org/2000/svg" style="stroke: #D1051E; stroke-width: 1" viewBox="0 0 114 114">\n\t<line x1="5" y1="109" x2="109" y2="5" />\n</svg>')}') no-repeat`,backgroundColor:l.zXF[l.Y1q.deleteAttribute].backgroundColor,pointerEvents:"none"}},updateAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:l.zXF[l.Y1q.updateAttribute].backgroundColor,pointerEvents:"none"}},deleteAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${l.zXF[l.Y1q.deleteAttribute].color}`,outlineOffset:"-3px"}},insertAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${l.zXF[l.Y1q.insertAttribute].color}`,outlineOffset:"-3px"}},updateAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${l.zXF[l.Y1q.updateAttribute].color}`,outlineOffset:"-3px"}},number:{color:e.palette.primary.main,fontSize:"24px",lineHeight:"42px",letterSpacing:0,padding:"36px 8px",textAlign:"center",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}}))),d=e=>{let{attributeType:t,attributeValues:r=[],paging:o,parentUri:d,requestNextPageOfAttributeValues:g,showNonOv:b,imageSize:f=p.By}=e;const h=m(f),{appearance:y}=(0,n.useContext)(s.m);return a().createElement(u.Z,{attributeValues:r,attributeType:t,renderImage:e=>{let{onOpenImageGalleryDialog:t}=e;return e=>{const r=(0,l.efz)(e),{uri:n}=e,o=(0,l.IFm)(n,y),s=(0,l.o_F)(o);return a().createElement("div",{className:i()(h.image,{[h[s+"Image"]]:s}),key:n,"data-reltio-id":"reltio-attribute-value"},a().createElement(c.Z,{onClick:()=>t(n),className:h[s],src:r,size:{imageWidth:f.imageWidth,imageHeight:f.imageHeight}}))}},imageSize:f,requestNextPageOfAttributeValues:g,paging:o,parentUri:d,showNonOv:b})}},88610:(e,t,r)=>{r.d(t,{Z:()=>y});var n=r(24328),a=r.n(n),l=r(83422),o=r(71153),i=r.n(o),s=r(17512),c=r(62228),u=r(13870),p=r(32826),m=r(1462);function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){g(e,t,r[t])}))}return e}function g(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const b=(0,r(72342).makeStyles)({label:{textDecoration:"none"},updateAttribute:d({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},s.zXF[s.Y1q.updateAttribute]),insertAttribute:d({width:"fit-content"},s.zXF[s.Y1q.insertAttribute]),deleteAttribute:d({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},s.zXF[s.Y1q.deleteAttribute]),pivotingTooltip:{marginLeft:"4px"}});function f(){return f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},f.apply(this,arguments)}const h=e=>{let{attributeValue:t,attributeType:r}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const d=b(),{appearance:g}=(0,n.useContext)(c.m),h=(0,n.useMemo)((()=>{const e=(0,s.IFm)(t.uri,g),n=(0,s.o_F)(e),o=t.label?t.label:(0,s.Kxm)(t,r.dataLabelPattern);return a().createElement(p.m,{className:d.pivotingTooltip,value:t,attributeType:r},a().createElement(l.Z,{component:"span",className:i()(d[n],d.label)},a().createElement(m.Z,{text:(0,s.idV)(o)})))}),[g,d,t,r]);return a().createElement(u.Z,f({label:h,attributeValue:t,attributeTypesList:(0,s.EUG)({},r),attributeType:r},o))};h.propTypes=s.j2V;const y=(0,n.memo)(h)},25257:(e,t,r)=>{r.d(t,{Z:()=>v});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(17512),s=r(50673),c=r(52730),u=r(62228),p=r(98074),m=r(13870),d=r(30357),g=r(1462),b=r(74542);function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){h(e,t,r[t])}))}return e}function h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const y=(0,r(72342).makeStyles)((e=>({relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary},updateAttribute:f({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},i.zXF[i.Y1q.updateAttribute]),insertAttribute:f({width:"fit-content"},i.zXF[i.Y1q.insertAttribute]),deleteAttribute:f({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},i.zXF[i.Y1q.deleteAttribute])})));function x(){return x=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},x.apply(this,arguments)}const v=(0,n.memo)((e=>{let{attributeValue:t,attributeType:r}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const f=(0,c.useSelector)(s.ZP.selectors.getMetadata),h=(0,c.useSelector)(s.ZP.selectors.getUIPath),v=y(),E=(0,b.V)(),w=(0,i.bwT)(t),O=(0,n.useMemo)((()=>(0,i.EUG)(f,r)),[r,f]),{appearance:C}=(0,n.useContext)(u.m),{generateEntityUrl:N}=(0,n.useContext)(p.v),S=(0,n.useMemo)((()=>{const e=(0,i.IFm)(t.uri,C),r=(0,i.o_F)(e),n=null!=w&&w.startsWith("changeRequests")?"dcrReview":"profile";return a().createElement(d.Z,{href:(0,i.O27)(C)?N({uiPath:h,uri:w,screen:n}):void 0,className:o()(v[r],{[E.ovFalse]:!(0,i.OXP)(t)})},a().createElement(g.Z,{text:(0,i.idV)(t.label)}),t.relationshipLabel&&a().createElement("span",{className:v.relationshipLabel},a().createElement(g.Z,{text:t.relationshipLabel})))}),[t,C,h,w,v,E.ovFalse,N]);return a().createElement(m.Z,x({attributeTypesList:O,attributeValue:t,label:S,attributeType:r},l))}))},81489:(e,t,r)=>{r.d(t,{Z:()=>y});var n=r(24328),a=r.n(n),l=r(17512),o=r(71153),i=r.n(o),s=r(62901),c=r(62228),u=r(72316),p=r(67586),m=r(32826);function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){g(e,t,r[t])}))}return e}function g(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const b=(0,r(72342).makeStyles)({root:{display:"flex",alignItems:"start",justifyContent:"space-between"},commentsContainer:{height:"15px",marginRight:"-4px"},attributeValue:{flex:1,wordBreak:"break-all"},updateAttribute:d({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},l.zXF[l.Y1q.updateAttribute],{"& > a":{color:l.zXF[l.Y1q.updateAttribute].color}}),insertAttribute:d({width:"fit-content"},l.zXF[l.Y1q.insertAttribute],{"& > a":{color:l.zXF[l.Y1q.insertAttribute].color}}),deleteAttribute:d({width:"fit-content",padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},l.zXF[l.Y1q.deleteAttribute],{"& > a":{color:l.zXF[l.Y1q.deleteAttribute].color}}),multilineAttribute:{width:"fit-content"}});var f=r(54837),h=r(74542);const y=e=>{let{className:t,attributeType:r=null,attributeValue:o,inlined:d}=e;const g=b(),y=(0,h.V)(),{highlightedValuesUris:x=[],highlightedClassName:v}=(0,n.useContext)(f.j),{appearance:E}=(0,n.useContext)(c.m),w=(0,l.IFm)(o.uri,E),O=(0,l.o_F)(w),C=a().createElement(p.Z,{value:(0,l.kDl)(o),dataTypeDefinition:(0,l.PFL)(r)}),N=(0,l.xdS)(r)?l.q7e.RELATION_ATTRIBUTE:l.q7e.ENTITY_ATTRIBUTE;return d||O?a().createElement("div",{className:i()(t,{[v]:x.includes(o.uri)})},a().createElement(m.m,{value:o,attributeType:r,key:o.uri,className:i()({[g.multilineAttribute]:!d})},a().createElement("span",{className:i()(g[O],{[y.ovFalse]:!(0,l.OXP)(o)}),"data-reltio-id":"reltio-attribute-value"},C))):a().createElement("div",{className:i()(t,g.root,s.U,{[v]:x.includes(o.uri)})},a().createElement(m.m,{value:o,attributeType:r,key:o.uri},a().createElement("span",{className:i()(g.attributeValue,{[y.ovFalse]:!(0,l.OXP)(o)}),"data-reltio-id":"reltio-attribute-value"},C)),a().createElement(u.Z,{className:g.commentsContainer,uri:o.uri,relatedObjectUris:(0,l.wp9)(N,{uri:o.uri}),objectType:N}))}},74542:(e,t,r)=>{r.d(t,{V:()=>n});const n=(0,r(72342).makeStyles)((e=>({ovFalse:e.inactive})))},86602:(e,t,r)=>{r.d(t,{S:()=>a});var n=r(17512);const a=[n.xPW.roles.uri,n.xPW.tags.uri]},62901:(e,t,r)=>{r.d(t,{U:()=>n});const n="commentsContainerVisibilityArea"},76572:(e,t,r)=>{r.d(t,{g:()=>i});var n=r(24328),a=r.n(n),l=r(13980),o=r.n(l);const i=a().createContext({enabled:!1,queueSizeThreshold:0});i.Provider.propTypes={value:o().shape({enabled:o().bool,queueSizeThreshold:o().number})},i.displayName="AsyncMountContext"},65510:(e,t,r)=>{r.d(t,{P:()=>a});var n=r(24328);const a=r.n(n)().createContext(!1);a.displayName="BlockImageGalleryDialogContext"},1824:(e,t,r)=>{r.d(t,{h:()=>s,e:()=>c});var n=r(24328),a=r.n(n),l=r(10),o=r(89575);const i=()=>{},s=a().createContext({comments:[],commentsMap:null,currentComment:null,updateCommentState:i,clearCommentState:i,getCommentState:()=>({}),getComment:i,getComments:()=>new Promise(i),getCommentsCount:i,createComment:()=>new Promise(i),editComment:()=>new Promise(i),createReply:()=>new Promise(i),resolveThread:i,reOpenThread:i,clearCurrentComment:i,deleteComment:i,sending:!1,loading:!1,pageToken:null,deleteReply:i,editReply:()=>new Promise(i)});s.displayName="CollaborationContext";const c=e=>{let{collaboration:t,children:r}=e;const n=(0,l.U)();return a().createElement(s.Provider,{value:t},a().createElement(o.s.Provider,{value:n},r))}},63929:(e,t,r)=>{r.d(t,{X:()=>a});var n=r(24328);const a=r.n(n)().createContext({});a.displayName="EntitiesMapContext"},10609:(e,t,r)=>{r.d(t,{u:()=>a});var n=r(24328);const a=r.n(n)().createContext(null);a.displayName="EntityContext"},43407:(e,t,r)=>{r.d(t,{Y:()=>a});var n=r(24328);const a=r.n(n)().createContext({showDescription:!1,showNavigateToGraph:!0});a.displayName="FeaturesContext"},54837:(e,t,r)=>{r.d(t,{j:()=>a});var n=r(24328);const a=r.n(n)().createContext({highlightedValuesUris:[],highlightedClassName:""});a.displayName="HighlightedValuesContext"},62228:(e,t,r)=>{r.d(t,{m:()=>a});var n=r(24328);const a=r.n(n)().createContext({appearance:void 0,attributes:void 0,roles:void 0,tags:void 0});a.displayName="HistoryDiffContext"},80687:(e,t,r)=>{r.d(t,{J:()=>a});var n=r(24328);const a=r.n(n)().createContext([])},80231:(e,t,r)=>{r.d(t,{j:()=>a});var n=r(24328);const a=r.n(n)().createContext(!1);a.displayName="ProfilePerspectiveViewContext"},38309:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(24328);const a=r.n(n)().createContext([]);a.displayName="RelatedObjectUrisContext"},43460:(e,t,r)=>{r.d(t,{g4:()=>o,Ie:()=>i,St:()=>s,NY:()=>c,fy:()=>u});var n=r(24328),a=r.n(n),l=r(79573);let o;!function(e){e.Error="Error",e.NewAttribute="NewAttribute"}(o||(o={}));const i=e=>e===o.Error,s=e=>e===o.NewAttribute,c=a().createContext({element:null,type:null,highlightError:l.ZT,highlightAttribute:l.ZT,scrollIntoRef:l.ZT}),u=e=>{let{children:t}=e;const[r,l]=(0,n.useState)(null),i=(0,n.useRef)(null),s=(0,n.useCallback)((e=>{e.current.scrollIntoView({behavior:"smooth",block:"center"}),i&&clearTimeout(i.current),i.current=setTimeout((()=>{l(null)}),2e3)}),[]),u=(0,n.useCallback)((e=>{l({value:e,type:o.Error})}),[]),p=(0,n.useCallback)((e=>{setTimeout((()=>l({value:e,type:o.NewAttribute})),300)}),[]),m=(0,n.useMemo)((()=>({element:null==r?void 0:r.value,highlightError:u,highlightAttribute:p,scrollIntoRef:s,type:null==r?void 0:r.type})),[r,s]);return a().createElement(c.Provider,{value:m},t)}},89575:(e,t,r)=>{r.d(t,{s:()=>a});var n=r(24328);const a=r.n(n)().createContext([]);a.displayName="UsersContext"},27536:(e,t,r)=>{r.d(t,{S:()=>o});var n=r(24328),a=r(76572);let l=0;const o=()=>{const e=(0,n.useRef)(!0),{enabled:t,queueSizeThreshold:r=0}=(0,n.useContext)(a.g),[o,i]=(0,n.useState)(!t||t&&l<r);e.current&&l++;const s=(0,n.useRef)();return(0,n.useEffect)((()=>{if(l--,!o)return s.current=setTimeout((()=>{i(!0)}),0),()=>clearTimeout(s.current)}),[]),e.current=!1,o}},40941:(e,t,r)=>{r.d(t,{B:()=>d});var n=r(24328),a=r(50914),l=r(71153),o=r.n(l),i=r(17512),s=r(72342);function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){u(e,t,r[t])}))}return e}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const p={content:'""',position:"absolute",left:"-1000px",top:"0px",width:"5000px",height:"calc(100% - 10px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},m=(0,s.makeStyles)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlightError:{"&::before":c({},p,{background:"rgba(255, 0, 0, 0.06)"})},highlightWarning:{"&::before":c({},p,{background:"rgba(228, 151, 0, 0.08)"})},simpleAttribute:{position:"relative","&::before":{top:"-4px",height:"calc(100% + 8px)"}}}))),d=e=>{let{highlightedError:t,isSimple:r=!1}=e;const l=m(),s=(0,n.useRef)(null),{element:c,scrollIntoRef:u}=t||{},p=(0,n.useMemo)((()=>(0,a.propOr)(i.Wkf.ERROR,"severity")(c)),[c]),d=o()({[l.highlightError]:p===i.Wkf.ERROR,[l.highlightWarning]:p===i.Wkf.WARNING,[l.simpleAttribute]:r});return(0,n.useEffect)((()=>{t&&u(s)}),[t,u]),t?{ref:s,errorClassName:d}:{ref:s}}},10:(e,t,r)=>{r.d(t,{U:()=>s});var n=r(24328),a=r(52730),l=r(17512),o=r(50673);const i=(0,r(36631).Z)(((e,t)=>(0,l.kz_)({tenant:e,servicesPath:t}))),s=()=>{const[e,t]=(0,n.useState)([]),r=(0,a.useSelector)(o.ZP.selectors.getTenant),l=(0,a.useSelector)(o.ZP.selectors.getServicesPath),s=e=>{console.warn("Users error",e),t([])};return(0,n.useEffect)((()=>{i(r,l).then((e=>t(e))).catch(s)}),[r,l]),e}},36746:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(24328),a=r.n(n);function l(){return l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},l.apply(this,arguments)}const o=e=>a().createElement("svg",l({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),a().createElement("defs",null,a().createElement("path",{d:"M19 16v3H5v-3H3v3c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-3h-2zm-6-3.33l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2v9.67z",id:"Download_svg__a"})),a().createElement("g",{transform:"translate(-3 -3)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a().createElement("mask",{id:"Download_svg__b",fill:"#fff"},a().createElement("use",{xlinkHref:"#Download_svg__a"})),a().createElement("path",{fillOpacity:.54,fill:"#fff",mask:"url(#Download_svg__b)",d:"M0 0h24v24H0z"})))}}]);
1
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f8c4900e-268b-41df-8ee3-e88ca5bfb232",e._sentryDebugIdIdentifier="sentry-dbid-f8c4900e-268b-41df-8ee3-e88ca5bfb232")}catch(e){}}();var _global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};_global.SENTRY_RELEASE={id:"1.4.1622"},(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[9028],{67462:(e,t,r)=>{r.d(t,{Z:()=>i});var n=r(24328),a=r.n(n),l=r(27536);function o(){return o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o.apply(this,arguments)}const i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r=(0,n.forwardRef)(((r,n)=>(0,l.S)()?a().createElement(e,o({},r,{ref:n})):t&&a().createElement(t,o({},r,{ref:n}))));return r.displayName="WithAsyncMount",r}},85777:(e,t,r)=>{r.d(t,{Z:()=>p});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(40435),s=r(89507);const c=(0,r(72342).makeStyles)({expandButton:{"&:hover":{backgroundColor:"transparent"}},expandIcon:{transition:"transform .15s ease"},expanded:{transform:"rotate(90deg)"}});function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}const p=e=>{const t=c(),{expanded:r,className:n}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["expanded","className"]);return a().createElement(i.Z,u({icon:s.Z,size:"XXS",disableRipple:!0,iconClassName:o()(t.expandIcon,{[t.expanded]:r}),className:o()(n,t.expandButton),"data-reltio-id":"arrow-expand-button"},l))}},17998:(e,t,r)=>{r.d(t,{Z:()=>p});var n=r(24328),a=r.n(n),l=r(2507),o=r.n(l),i=r(26482),s=r(79312);const c=(0,r(72342).makeStyles)({toolbar:{minHeight:"48px",padding:"8px 24px",lineHeight:"28px"},title:{fontSize:"18px",minWidth:"50px",fontWeight:"normal",lineHeight:"inherit",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}});function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}const p=e=>{let{title:t="",children:r=null,classes:n={}}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["title","children","classes"]);const p=c();return a().createElement(i.Z,u({className:n.root,classes:{root:p.toolbar}},l),a().createElement(s.Z,{className:n.title,classes:{root:p.title},variant:"h6"},o().text(t)),r)}},89925:(e,t,r)=>{r.d(t,{J:()=>K});var n=r(24328),a=r.n(n),l=r(83422),o=r(52730),i=r(2507),s=r.n(i),c=r(55485),u=r(79312),p=r(50985),m=r(50673),d=r(98538),g=r(39475),b=r(71153),f=r.n(b),h=r(50914),y=r(17512),x=r(63929),v=r(18527);const E=(e,t)=>{const r=e.relatedObjectUris.indexOf(t);if(r>=0)return e.relatedObjectUris[1-r]},w=e=>`${s().date(e,"LT")} ${s().date(e,"LL")}`,O=e=>`comment/${e.commentId}`,C=(e,t)=>`comment/${e.commentId}/reply/${t.replyId}`,N=(e,t)=>{let r=e;for(const e of t)r=r.split(`+${e}`).join(`@[${e}](${e})`);return r};var S=r(72342);const k=(0,S.makeStyles)((e=>({title:{marginBottom:"10px",color:e.palette.divider,fontSize:"12px",lineHeight:"14px"},label:{paddingLeft:"9px",borderLeft:"1px solid #D8D8D8",fontSize:"13px",color:e.palette.text.primary,lineHeight:"15px"},link:{color:e.palette.primary.main,textDecoration:"none"}})));function T(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const A=e=>{let{comment:t,className:r}=e;const i=k(),c=(0,o.useSelector)(m.ZP.selectors.getEntity),p=(0,o.useSelector)(m.ZP.selectors.getMetadata),d=(0,n.useContext)(x.X);return a().createElement(l.Z,{className:r},(()=>{switch(t.objectType){case y.q7e.ENTITY_ATTRIBUTE:{const e=(0,y.AFK)(t.objectId,c.type),r=(0,y.zeJ)(p,e);return a().createElement(a().Fragment,null,a().createElement(u.Z,{className:i.title},s().text("Selected attribute:")),a().createElement(u.Z,{className:i.label},null==r?void 0:r.label))}case y.q7e.RELATION_ATTRIBUTE:{const e=t.relatedObjectUris.find((0,h.startsWith)("configuration/relationTypes")),r=(0,y.AFK)(t.objectId,e),n=(0,y.zeJ)(p,r);return a().createElement(a().Fragment,null,a().createElement(u.Z,{className:i.title},s().text("Selected attribute:")),a().createElement(u.Z,{className:i.label},null==n?void 0:n.label))}case y.q7e.ENTITY:return a().createElement(a().Fragment,null,a().createElement(u.Z,{className:i.title},s().text("Selected profile:")),a().createElement(v.Z,{className:f()(i.label,i.link),value:(0,y.wwR)(c)},(0,y.idV)(c.label)));case y.q7e.RELATION:{const e=E(t,c.uri),r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){T(e,t,r[t])}))}return e}({},d[e]||{},{uri:e});return a().createElement(a().Fragment,null,a().createElement(u.Z,{className:i.title},s().text("Selected relation:")),a().createElement(u.Z,{className:i.label},a().createElement(v.Z,{className:i.link,value:(0,y.wwR)(c)},(0,y.idV)(c.label)),e&&a().createElement(a().Fragment,null,` ${s().text("to")} `,a().createElement(v.Z,{className:i.link,value:(0,y.wwR)(r)},r.label?(0,y.idV)(r.label):(0,y.BTI)(r)))))}case y.q7e.POTENTIAL_MATCH:{var e;const r=E(t,c.uri),n={uri:r,label:null===(e=d[r])||void 0===e?void 0:e.label};return a().createElement(a().Fragment,null,a().createElement(u.Z,{className:i.title},s().text("Selected potential match:")),a().createElement(u.Z,{className:i.label},a().createElement(v.Z,{className:i.link,value:(0,y.wwR)(c)},(0,y.idV)(c.label)),r&&a().createElement(a().Fragment,null,` ${s().text("and")} `,a().createElement(v.Z,{className:i.link,value:(0,y.wwR)(n)},n.label?(0,y.idV)(n.label):(0,y.BTI)(n)))))}default:return null}})())};var Z=r(89575);const P=(0,S.makeStyles)((e=>({root:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",wordBreak:"break-word"}}))),j=e=>{let{comment:t,className:r}=e;const l=P(),o=(0,n.useContext)(Z.s);return a().createElement(u.Z,{className:f()(l.root,r)},function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e=>e,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"+";const a=[];let l="",o=!1;for(let i=0;i<=e.length;i++){const s=e[i],c=e[i+1],u=i===e.length-1;l+=s,s===n&&0===i&&(o=!0),o&&t.includes(l.slice(n.length))&&(o=!1,a.push(r(l)),l=""),c===n&&(o=!0,a.push(l),l=""),u&&a.push(l)}return a}(t.content,t.namedUsers,(e=>{const t=o.find((t=>t.username===e.slice(1)));return t?a().createElement(c.Z,{href:`mailto:${t.email}`,underline:"hover"},e):e})).map(((e,t)=>a().createElement(n.Fragment,{key:t},e))))};var I=r(65439);const D=(0,S.makeStyles)((e=>({root:{width:"32px",height:"32px",fontSize:"12px",color:e.palette.text.secondary,backgroundColor:"rgba(144, 164, 174, 0.2)"}})));function V(){return V=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},V.apply(this,arguments)}const L=e=>{let{className:t,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","children"]);const l=D();return a().createElement(I.Z,V({},n,{className:f()(l.root,t)}),r.split(".").map((e=>e[0].toUpperCase())).join(""))};var R=r(1824),U=r(38677),M=r(2271);const _=(0,S.makeStyles)((e=>({root:{width:"100%",backgroundColor:"#fff",fontFamily:"Roboto","&__control":{fontSize:"13px"},"&__highlighter":{padding:"10px 22px",border:"1px solid transparent !important"},"&__input":{borderRadius:"2px",border:"1px solid rgba(0,0,0,0.12)",padding:"10px 22px",outline:0,overflow:"auto !important"},"&__suggestions":{padding:"8px 0",borderRadius:"4px",backgroundColor:"#fafafa !important",boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)",transform:"translateY(-100%)"},"&__suggestions__list":{maxHeight:"200px",overflowY:"scroll"},"&__suggestions__item":{padding:"6px 12px",color:e.palette.text.primary,fontSize:"13px",transition:e.transitions.create(["background-color"]),"&:hover, &--focused":{backgroundColor:"rgba(0,0,0,0.04)"}}},mention:{position:"relative",zIndex:1,color:e.palette.primary.main,textShadow:"1px 1px 1px white, 1px -1px 1px white, -1px 1px 1px white, -1px -1px 1px white",pointerEvents:"none"}})));function z(){return z=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},z.apply(this,arguments)}const B=e=>{let{onChange:t,className:r}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onChange","className"]);const o=_(),i=(0,n.useContext)(Z.s);return a().createElement(M.r,z({},l,{onChange:(e,r,n,a)=>{t(r,n,(0,h.uniq)(a.map((e=>{let{display:t}=e;return t.slice(1)}))))},className:f()(o.root,r)}),a().createElement(M.p,{trigger:"+",data:i.map((e=>{let{username:t}=e;return{id:t,display:t}})),displayTransform:(e,t)=>`+${t}`,appendSpaceOnAdd:!0,className:o.mention}))},F=(0,S.makeStyles)({root:e=>{let{isEditing:t}=e;return{padding:t?"6px 6px 6px 0":" 6px 6px 6px 8px",borderRadius:"4px",backgroundColor:t?"transparent":"rgba(0,114,206,0.06)"}},textField:e=>{let{isEditing:t}=e;return{maxWidth:t?"100%":"calc(100% - 40px)"}},form:{marginBottom:0},main:{display:"flex",alignItems:"center"},avatar:{marginRight:"8px"},buttons:e=>{let{isEditing:t}=e;return{marginLeft:t?"0":"40px",marginTop:"8px"}},button:{"& + $button":{marginLeft:"8px"}}}),H=e=>{switch(e){case"open":return s().text("Reply...");case"resolved":return s().text("Adding a comment will re-open this");default:return""}},q=e=>{let{inputRef:t,className:r,uri:i,relatedObjectUris:c,objectType:u,popperRef:p,comment:d,reply:g,isEditingComment:b,isEditingReply:y,onCancel:x}=e;const v=b||y,E=F({isEditing:v}),[w,S]=(0,n.useState)(!1),k=(0,o.useSelector)(m.ZP.selectors.getUserName),{createReply:T,createComment:A,sending:Z,editComment:P,editReply:j,getCommentState:I,updateCommentState:D,clearCommentState:V}=(0,n.useContext)(R.h),M=(e=>{let{comment:t,reply:r,isEditingComment:n,isEditingReply:a}=e;return(0,h.isNil)(t)?"comment/new":n?O(t):a?C(t,r):(e=>`comment/${e.commentId}/reply/new`)(t)})({comment:d,reply:g,isEditingComment:b,isEditingReply:y}),_=(e=>{let{comment:t,reply:r,isEditingComment:n,isEditingReply:a}=e;const l=n?t:a?r:null,{content:o="",namedUsers:i=[]}=l||{};return{value:N(o,i),plainTextValue:o,mentions:i}})({comment:d,reply:g,isEditingComment:b,isEditingReply:y}),{value:z=_.value,plainTextValue:q=_.plainTextValue,mentions:W=_.mentions}=I(i,M),$=""!==z.trim(),Y=w||$,X=null==d?void 0:d.status,G=()=>{null==x||x(),V(i,M)};(0,n.useEffect)((()=>{p&&p.current.forceUpdate()}),[p,Y]);const K=v?"small":"medium";return a().createElement(l.Z,{className:f()(E.root,r)},a().createElement("form",{onSubmit:e=>(e.preventDefault(),(0,h.cond)([[(0,h.always)(!d),()=>A({content:q,namedUsers:W,objectType:u,uri:i,relatedObjectUris:c})],[(0,h.always)(b),()=>P({content:q,namedUsers:W,commentId:d.commentId,objectType:u,replies:d.replies,relatedObjectUris:c,uri:i})],[(0,h.always)(y),()=>j({content:q,namedUsers:W,commentId:d.commentId,replyId:g.replyId})],[h.T,()=>T({content:q,namedUsers:W,commentId:d.commentId,action:"open"===d.status?"none":"reopen",uri:i})]])().then(G).catch(console.log)),className:E.form},a().createElement(l.Z,{className:E.main},!v&&a().createElement(L,{classes:{root:E.avatar}},k),a().createElement(B,{className:E.textField,disabled:Z,onChange:(e,t,r)=>D(i,M,{value:e,plainTextValue:t,mentions:r}),inputRef:t,value:z,onFocus:()=>S(!0),onBlur:()=>S(!1),placeholder:H(X)})),Y&&a().createElement(l.Z,{className:E.buttons},a().createElement(U.Z,{className:E.button,variant:"contained",color:"primary",disabled:!$||Z,type:"submit",size:K},((e,t,r)=>t||r?s().text("Edit"):"open"===e||"resolved"===e?s().text("Reply"):s().text("Comment"))(X,b,y)),a().createElement(U.Z,{disabled:Z,onClick:()=>G(),className:E.button,variant:"outlined",color:"primary",size:K},s().text("Cancel")))))},W=(0,S.makeStyles)((e=>({header:{display:"flex"},avatar:{marginRight:"8px"},username:{marginBottom:"1px",color:e.palette.text.primary,fontSize:"13px",fontWeight:500,lineHeight:"15px"},createdAt:{marginTop:"3px",marginRight:"4px",color:e.palette.text.secondary,fontSize:"11px",lineHeight:"13px",whiteSpace:"nowrap"},body:{marginLeft:"40px"},commentTarget:{marginTop:"-15px"},message:{marginTop:"12px"},dropdownMenu:{zIndex:"3000 !important"},buttons:{marginTop:"15px",marginBottom:"12px",display:"flex","& $button + $button":{marginLeft:"10px"}},button:{fontSize:"13px",lineHeight:"15px"}}))),$=e=>{let{onReply:t,className:r,uri:i,comment:b,relatedObjectUris:f,objectType:h}=e;const y=W(),x=(0,n.useRef)(),v=(0,o.useSelector)(m.ZP.selectors.getUserName),{commentId:E,createdBy:C,createdTime:N,status:S}=b,k="resolved"===S,T=C===v,{resolveThread:Z,reOpenThread:P,sending:I,deleteComment:D,updateCommentState:V,getCommentState:U}=(0,n.useContext)(R.h),M=O(b),{isEditing:_}=U(i,M),z=(0,n.useCallback)((e=>V(i,M,{isEditing:e})),[M,V,i]);(0,n.useEffect)((()=>{_&&x.current.focus()}),[_]);const B=(0,n.useMemo)((()=>k?[{text:s().text("Delete"),onClick:()=>D({uri:i,commentId:E})}]:[{text:s().text("Edit"),onClick:()=>z(!0)},{text:s().text("Delete"),onClick:()=>D({uri:i,commentId:E})}]),[E,D,k,z,i]),F=a().createElement(q,{inputRef:x,uri:i,relatedObjectUris:f,objectType:h,onCancel:()=>z(!1),isEditingComment:_,comment:b});return a().createElement(l.Z,{className:r},a().createElement(l.Z,{className:y.header},a().createElement(L,{classes:{root:y.avatar}},C),a().createElement(l.Z,{width:"100%"},a().createElement(u.Z,{className:y.username},C)),a().createElement(u.Z,{className:y.createdAt},w(N)),T&&a().createElement(d.Z,{buttonComponent:g.k,buttonProps:{icon:p.Z,tooltipTitle:s().text("Open menu")},popoverProps:{PopoverClasses:{root:y.dropdownMenu}},menuItems:B,menuId:"collaboration-comment-menu"})),a().createElement(l.Z,{className:y.body},a().createElement(A,{comment:b,className:y.commentTarget}),_?F:a().createElement(j,{comment:b,className:y.message}),a().createElement(l.Z,{className:y.buttons},a().createElement(c.Z,{className:y.button,onClick:t,component:"button",underline:"hover"},s().text("Reply")),!k&&a().createElement(c.Z,{disabled:I,className:y.button,onClick:()=>{Z({commentId:E,uri:i})},component:"button",underline:"hover"},s().text("Resolve")),k&&a().createElement(c.Z,{disabled:I,className:y.button,onClick:()=>{P({commentId:E,uri:i})},component:"button",underline:"hover"},s().text("Re-open")))))},Y=(0,S.makeStyles)((e=>({root:{display:"flex",padding:"8px",borderRadius:"4px",backgroundColor:"rgba(0,114,206,0.06)"},avatar:{marginRight:"8px"},header:{display:"flex",marginBottom:"8px"},username:{color:e.palette.text.primary,fontSize:"13px",fontWeight:500,lineHeight:"15px"},message:{marginBottom:"8px",color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px"},createdAt:{color:e.palette.text.secondary,fontSize:"11px",lineHeight:"13px",whiteSpace:"nowrap"},marked:{marginLeft:"8px",color:e.palette.text.secondary,fontSize:"13px",fontStyle:"italic",lineHeight:"15px"}}))),X=e=>{let{className:t,reply:r,uri:i,comment:c,popperRef:b}=e;const h=(0,n.useRef)(),{createdBy:y,action:x,createdTime:v}=r,E=y===(0,o.useSelector)(m.ZP.selectors.getUserName)&&"resolved"!==c.status,{deleteReply:O,updateCommentState:N,getCommentState:S}=(0,n.useContext)(R.h),k=C(c,r),{isEditing:T}=S(i,k),A=(0,n.useCallback)((e=>N(i,k,{isEditing:e})),[k,N,i]);(0,n.useEffect)((()=>{T&&h.current.focus()}),[T]);const Z=Y(),P=(0,n.useMemo)((()=>[{text:s().text("Edit"),onClick:()=>A(!0)},{text:s().text("Delete"),onClick:()=>O({uri:i,commentId:c.commentId,reply:r})}]),[O,i,c.commentId,r,A]),I=a().createElement(q,{inputRef:h,popperRef:b,uri:i,onCancel:()=>A(!1),isEditingReply:T,reply:r,comment:c});return a().createElement(l.Z,{className:f()(Z.root,t)},a().createElement(L,{classes:{root:Z.avatar}},y),a().createElement(l.Z,{flexGrow:1},a().createElement(l.Z,{className:Z.header},a().createElement(u.Z,{className:Z.username},y),"resolve"===x&&a().createElement(u.Z,{className:Z.marked},s().text("Marked as resolved")),"reopen"===x&&a().createElement(u.Z,{className:Z.marked},s().text("Re-opened"))),"resolve"!==x&&(T?I:a().createElement(j,{className:Z.message,comment:r})),a().createElement(u.Z,{className:Z.createdAt},w(v))),E&&a().createElement(d.Z,{buttonComponent:g.k,buttonProps:{icon:p.Z,tooltipTitle:s().text("Open menu")},menuItems:P,menuId:"collaboration-comment-menu"}))},G=(0,S.makeStyles)((()=>({root:{maxWidth:"100%",padding:"8px 4px 10px 16px"},messages:{},repliedComment:{marginBottom:"2px"},replies:{marginLeft:"40px"},sendMessageArea:{marginLeft:"40px"},comment:{}}))),K=(0,n.memo)((e=>{let{uri:t,relatedObjectUris:r,objectType:o,classes:i,popperRef:s,messagesRef:c,comment:u}=e;const p=(0,n.useRef)(),m=G({classes:i}),d=a().createElement(q,{className:m.sendMessageArea,inputRef:p,popperRef:s,uri:t,relatedObjectUris:r,objectType:o,comment:u});return a().createElement(l.Z,{className:m.root},u&&a().createElement(a().Fragment,null,a().createElement("div",{className:m.messages,ref:c},a().createElement($,{comment:u,uri:t,onReply:()=>{p.current.focus()},className:m.comment,relatedObjectUris:r,objectType:o}),a().createElement(l.Z,{className:m.replies},u.replies.map((e=>a().createElement(X,{key:e.replyId,className:m.repliedComment,reply:e,uri:t,comment:u}))))),d),!u&&d)}))},72316:(e,t,r)=>{r.d(t,{Z:()=>j});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(72342),s=r(62901);const c=(0,i.makeStyles)((()=>({root:{display:"flex",alignItems:"start"},addButton:{visibility:"hidden","&$showAlways":{visibility:"visible"},[`.${s.U}:hover &`]:{visibility:"visible"}},showAlways:{}})));var u=r(55962),p=r(1824),m=r(38309),d=r(2507),g=r.n(d),b=r(23883);function f(){return f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},f.apply(this,arguments)}const h=e=>a().createElement("svg",f({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},e),a().createElement("path",{d:"M2.8 1h14.4c.99 0 1.8.81 1.8 1.8v10.8c0 .99-.81 1.8-1.8 1.8H4.6L1 19V2.8C1 1.81 1.81 1 2.8 1z"})),y=(0,i.makeStyles)((()=>({root:{position:"relative",height:"18px",display:"flex",alignItems:"center",justifyContent:"center",marginLeft:"4px",cursor:"pointer"},icon:{"&:hover":{fillOpacity:.7}},childrenWrapper:{position:"absolute",width:"100%",height:"100%",lineHeight:"15px",display:"flex",alignItems:"center",justifyContent:"center",top:"-2px",left:0,right:0,bottom:0,color:"white",fontSize:"10px",pointerEvents:"none"}}))),x=a().forwardRef(((e,t)=>{let{children:r,onClick:n}=e;const l=y();return a().createElement(b.Z,{title:g().text("Show comment")},a().createElement("div",{ref:t,className:l.root,onClick:n},a().createElement(h,{className:l.icon}),a().createElement("div",{className:l.childrenWrapper},r)))}));x.displayName="CommentButton";const v=x;function E(){return E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},E.apply(this,arguments)}const w=e=>a().createElement("svg",E({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},e),a().createElement("path",{d:"M2.8 14.653L3.853 13.6H17.2V2.8H2.8v11.853zM17.2 1c.99 0 1.8.81 1.8 1.8v10.8c0 .99-.81 1.8-1.8 1.8H4.6L1 19V2.8C1 1.81 1.81 1 2.8 1h14.4zm-6.3 3.6H9.1v2.699L6.4 7.3v1.8l2.7-.001V11.8h1.8V9.099l2.7.001V7.3l-2.7-.001V4.6z"})),O=e=>{let{className:t,onClick:r}=e;const n=y();return a().createElement(b.Z,{title:g().text("Add comment")},a().createElement("div",{className:o()(n.root,t),onClick:r},a().createElement(w,{className:n.icon})))};var C=r(83422),N=r(79312),S=r(711),k=r(89925),T=r(39475),A=r(80233);const Z=(0,i.makeStyles)((e=>({root:{},header:{display:"flex",alignItems:"center",height:"48px",paddingLeft:"16px",paddingRight:"8px"},headerInfo:{marginRight:"auto",display:"flex",alignItems:"center"},title:{marginRight:"15px",color:e.palette.text.primary,fontSize:"16px"},counter:{paddingLeft:"15px",borderLeft:"1px solid rgba(0,0,0,0.12)",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"24px"},resolveButton:{zIndex:3e3,"&:hover":{backgroundColor:"transparent"}},popper:{width:"424px",borderRadius:"0 0 4px 4px"},collaborationItem:{padding:"0 0 10px 0"},comment:e=>{let{hasScroll:t}=e;return{marginLeft:"16px",marginRight:t?"2px":"8px"}},replies:e=>{let{hasScroll:t}=e;return{marginLeft:"8px",marginRight:t?"2px":"8px"}},sendMessageArea:e=>{let{hasScroll:t,scrollWidth:r}=e;return{marginLeft:"8px",marginRight:t?r+2:"8px"}},messages:{maxHeight:"400px",overflowY:"auto"}}))),P=e=>{let{uri:t,relatedObjectUris:r,objectType:l,anchorEl:o,onClose:i,open:s,comment:c}=e;const[u,m]=(0,n.useState)(0),d=Z({scrollWidth:u,hasScroll:0!==u}),b=(0,n.useRef)(null),{resolveThread:f,loading:h,sending:y}=(0,n.useContext)(p.h),x=1+(null==c?void 0:c.replies.length);return a().createElement(A.Z,{popperRef:b,anchorEl:o,open:s,placement:"right-start",onClose:i,className:d.popper},a().createElement(C.Z,{className:d.header},a().createElement(C.Z,{className:d.headerInfo},a().createElement(N.Z,{className:d.title},g().text("Comments")),c&&!h&&a().createElement(N.Z,{className:d.counter},g().number(x)," ",1===x?g().text("item"):g().text("items"))),c&&!h&&a().createElement(T.k,{className:d.resolveButton,size:"S",onClick:()=>{f({commentId:c.commentId,uri:t})},disabled:y,showForDisabled:!0,tooltipTitle:g().text("Resolve"),icon:S.Z,color:"primary"})),!h&&a().createElement(k.J,{popperRef:b,messagesRef:e=>{e&&m(e.offsetWidth-e.clientWidth)},classes:{root:d.collaborationItem,replies:d.replies,sendMessageArea:d.sendMessageArea,messages:d.messages,comment:d.comment},uri:t,relatedObjectUris:r,objectType:l,comment:c}))},j=e=>{let{className:t,uri:r,objectType:l,relatedObjectUris:i,onChangePopupVisibility:s,allowOnlyOneComment:d=!1,showAlways:g=!1}=e;const b=c(),[f,h]=(0,n.useState)(null),[y,x]=(0,n.useState)(!1),E=y&&Boolean(f),{currentComment:w,commentsMap:C,getComment:N,clearCurrentComment:S,objectTypes:k}=(0,n.useContext)(p.h),T=!!C&&(!k||k.includes(l)),A=((null==C?void 0:C[r])||[]).filter((e=>{let{status:t}=e;return"resolved"!==t})).reverse(),Z=!d||d&&0===A.length,j=null===w&&E;(0,u.D)((()=>{s&&s(E)}),[E]);const I=(0,n.useContext)(m.A),D=(0,n.useMemo)((()=>I?[...i,...I]:i),[I,i]);return T&&a().createElement("div",{className:o()(b.root,t)},Z&&a().createElement(O,{className:o()(b.addButton,{[b.showAlways]:g||j}),onClick:e=>{h(e.currentTarget),x(!0)}}),A.map((e=>{let{replies:t,commentId:r}=e;return a().createElement(v,{ref:r===(null==w?void 0:w.commentId)?h:null,key:r,onClick:()=>(e=>{N(e),x(!0)})(r)},1+t)})),a().createElement(P,{anchorEl:f,open:E,onClose:()=>{h(null),S(),x(!1)},uri:r,relatedObjectUris:D,objectType:l,comment:w}))}},30936:(e,t,r)=>{r.d(t,{l:()=>s});var n=r(13896),a=r(58651),l=r(24328),o=r.n(l);const i=(0,n.createDndContext)(a.default),s=e=>{const t=(e=>{const t=(0,l.useRef)(i);return e.children?o().createElement(n.DndProvider,{manager:t.current.dragDropManager},e.children):null})(e);return o().createElement(o().Fragment,null,t)}},98538:(e,t,r)=>{r.d(t,{Z:()=>w});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(50914),s=r(38677),c=r(18960),u=r(55962),p=r(80852),m=r(95341),d=r(79312),g=r(78223),b=r(47591);const f=(0,r(72342).makeStyles)((e=>({buttonRoot:{"&$selected":{color:e.palette.action.active,backgroundColor:(0,b.Fq)(e.palette.action.active,.12),"&:hover":{backgroundColor:(0,b.Fq)(e.palette.action.active,.15)}}},selected:{},paper:{minWidth:"112px"},menuItem:{minHeight:"32px"},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0}}))),h=(0,g.Z)(m.Z),y=(0,n.forwardRef)(((e,t)=>{let{item:r,onMenuClose:n=i.identity}=e;const l=f(),{disabled:o,text:s,tooltip:c,onClick:u,id:m="",selectable:g,selected:b}=r;return a().createElement(h,{tooltipTitle:c,showForDisabled:!0,classes:{root:l.menuItem},onClick:e=>{n(e),u(e)},disabled:o,ref:t,"data-modal":!0,"data-reltio-id":`reltio-search-menu-item${m}`},g&&a().createElement(p.Z,{checked:b,color:"primary"}),a().createElement(d.Z,{classes:{root:l.menuText}},s))}));y.displayName="MenuItemRenderer";const x=y;function v(){return v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},v.apply(this,arguments)}function E(e){let{className:t,menuId:r,buttonComponent:l=s.Z,buttonContent:p,menuItems:m=[],buttonProps:d={},popoverProps:g={},onMenuOpen:b=i.identity,onMenuClose:h=i.identity,MenuItemRenderer:y=x}=e;const E=l,w=f(),O=(0,n.useRef)(),[C,N]=(0,n.useState)(!1);(0,u.D)((()=>{C?b():h()}),[C]);const S=(0,n.useCallback)((e=>{null==e||e.stopPropagation(),N((e=>!e))}),[]);return a().createElement(a().Fragment,null,a().createElement(E,v({"data-reltio-id":"drop-down-menu-button",ref:O,className:o()(w.buttonRoot,{[w.selected]:C},t),onClick:S,"aria-pressed":C,"aria-controls":C?r:void 0,"aria-haspopup":"true"},d),p),a().createElement(c.Z,v({id:r,variant:"menu",open:C,autoFocus:!1,classes:{paper:w.paper},anchorEl:O.current,onClose:S,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},elevation:2,MenuListProps:{autoFocusItem:C}},g),m.map(((e,t)=>a().createElement(y,{item:e,key:t,onMenuClose:S})))))}E.displayName="DropDownMenuButton";const w=E},55401:(e,t,r)=>{r.d(t,{Z:()=>c});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(79312),s=r(95063);const c=e=>{let{className:t,message:r}=e;const n=(0,s.y)();return r?a().createElement(i.Z,{variant:"caption",className:o()(n.caption,t)},r):null}},93555:(e,t,r)=>{r.d(t,{Z:()=>m});var n=r(71153),a=r.n(n),l=r(55401),o=r(73074),i=r(95512),s=r(24328),c=r.n(s),u=r(95063);function p(){return p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},p.apply(this,arguments)}const m=(0,s.memo)((e=>{let{errorMessage:t,children:r,className:n,classes:s}=e,m=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["errorMessage","children","className","classes"]);const d=(0,u.y)(),g=!!t;return c().createElement(o.Z,p({variant:"standard",className:a()(d.wrapper,n,null==s?void 0:s.root),error:!0},m),r,g&&c().createElement(i.Z,{className:a()(d.helperText,null==s?void 0:s.helperText)},c().createElement(l.Z,{message:t})))}))},95063:(e,t,r)=>{r.d(t,{y:()=>n});const n=(0,r(72342).makeStyles)((e=>({wrapper:{width:"100%"},helperText:{margin:"3px 0 1px 12px"},caption:{display:"flex",color:e.palette.error.main,fontSize:"12px",lineHeight:"16px"}})))},26729:(e,t,r)=>{r.d(t,{f:()=>f,Z:()=>h});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(4836);function s(){return s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s.apply(this,arguments)}const c=e=>a().createElement("svg",s({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),a().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a().createElement("path",{d:"M0 0h24v24H0z"}),a().createElement("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zm-4.5-9l2.5 3.096V18H5l4.5-5.5 2.5 3.01L16.5 10zm-8-4a1.5 1.5 0 110 3 1.5 1.5 0 010-3z",fillOpacity:.12,fill:"#000",fillRule:"nonzero"})));var u=r(17512);const p=(0,r(72342).makeStyles)((e=>({root:{position:"relative"},image:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,objectFit:"cover",verticalAlign:"bottom"}},defaultContainer:{display:"flex",alignItems:"center",backgroundColor:"rgb(247, 247, 247)"},defaultImage:{width:"40px",height:"40px",marginLeft:"auto",marginRight:"auto",color:e.palette.text.secondary},hideImage:{display:"none"}})));function m(){return m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},m.apply(this,arguments)}const d="loading",g="loaded",b="error",f={SMALL:{imageWidth:114,imageHeight:114},MEDIUM:{imageWidth:162,imageHeight:162},LARGE:{imageWidth:192,imageHeight:192},OVERRIDE:{imageWidth:"unset",imageHeight:"unset"}},h=(0,n.memo)((e=>{const{src:t,className:r,containerClassName:l,size:s=f.SMALL,overlay:h=null}=e,y=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["src","className","containerClassName","size","overlay"]),x=s||f.SMALL,v=p(x),[E,w]=(0,n.useState)(d);(0,n.useEffect)((()=>{w(d)}),[t]);const O=E===d,C=E===g;return E===b?a().createElement("div",m({className:o()(v.defaultContainer,v.image,r)},y),a().createElement(i.Z,{className:v.defaultImage})):a().createElement("div",{className:o()(v.root,l)},!(0,u.O27)(t)&&a().createElement("img",m({src:t,className:o()(v.image,r,{[v.hideImage]:O}),onLoad:()=>{w(g)},onError:()=>{w(b)},alt:"image"},y)),O&&a().createElement("div",m({className:o()(v.defaultContainer,v.image,r)},y),a().createElement(c,{className:v.defaultImage})),C&&h)}))},22349:(e,t,r)=>{r.d(t,{Z:()=>w});var n=r(24328),a=r.n(n),l=r(2507),o=r.n(l),i=r(50914),s=r(71153),c=r.n(s),u=r(38677),p=r(50985),m=r(40435),d=r(98538),g=r(11376),b=r(43589),f=r(72342);const h=(0,f.makeStyles)((()=>({root:{fontSize:"24px",color:"#fff"}}))),y=e=>{let{checked:t,className:r,onClick:n}=e;const l=h(),o=t?b.Z:g.Z;return a().createElement(o,{className:c()(l.root,r),onClick:n})};var x=r(36746),v=r(79573);const E=(0,f.makeStyles)((()=>({overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",transition:"0.2s linear all","&:not($selected):not($selectionMode):hover":{backgroundColor:"rgba(0,0,0,0.6)"},userSelect:"none"},selected:{backgroundColor:"rgba(0,114,206,0.6)"},selectionMode:{cursor:"pointer","&:not($selected)":{backgroundColor:"rgba(0,0,0,0.6)"}},button:{padding:0,width:"100px",height:"36px",color:"#fff",fontSize:"14px",fontWeight:500,lineHeight:"16px",border:"1px solid rgba(255,255,255,0.25)",backgroundColor:"rgba(98,2,238,0)"},checkedIcon:{position:"absolute",left:"4px",top:"4px",cursor:"pointer"},actions:{display:"flex",alignItems:"center",position:"absolute",top:"4px",right:"4px"},actionButton:{color:"#fff",fontSize:"24px"},dropDownMenuButton:{margin:"0 2px 0 8px"}}))),w=(0,n.memo)((e=>{const{id:t,canBeSelected:r=!1,selected:l=!1,selectionMode:s=!1,onDeselect:g=v.ZT,onSelect:b=v.ZT,onShareLink:f,onSetAsDefault:h,onDelete:w,onDownload:O=v.ZT,onClick:C}=e,N=E(),[S,k]=(0,n.useState)(!1),T=(0,n.useMemo)((()=>[{text:o().text("Share link"),onClick:f},{text:o().text("Set as default"),onClick:h},{text:o().text("Delete"),onClick:w}].filter((0,i.prop)("onClick"))),[f,h,w]),A=e=>()=>(0,i.ifElse)((0,i.equals)(!0),g,b)(e),Z=r&&(l||S||s),P=!s&&!l&&S,j=r&&l;return a().createElement("div",{className:c()(N.overlay,{[N.selected]:l,[N.selectionMode]:s}),onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),onClick:s?A(l):e=>{e.currentTarget===e.target&&C()}},Z&&a().createElement(y,{className:N.checkedIcon,checked:l,onClick:A(l)}),P&&a().createElement("div",{className:N.actions},a().createElement(m.Z,{onClick:O,className:N.actionButton,icon:x.Z}),a().createElement(d.Z,{menuId:`image-overlay-actions-${t}`,buttonComponent:m.Z,buttonProps:{icon:p.Z,className:c()(N.actionButton,N.dropDownMenuButton)},menuItems:T})),j&&a().createElement(u.Z,{className:N.button,variant:"outlined",onClick:g},o().text("Deselect")))}))},95596:(e,t,r)=>{r.d(t,{C:()=>v,A:()=>x});var n=r(24328),a=r.n(n),l=r(2507),o=r.n(l),i=r(69089),s=r(290),c=r(13961),u=r(26482),p=r(83422),m=r(92679),d=r(15650);function g(){return g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},g.apply(this,arguments)}const b=e=>a().createElement("svg",g({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),a().createElement("defs",null,a().createElement("path",{d:"M14 5a1 1 0 011 1v12a1 1 0 01-1 1H4a1 1 0 01-1-1V6a1 1 0 011-1h10zm6 12v2h-3v-2h3zm2-4v2h-5v-2h5zm0-4v2h-5V9h5zm0-4v2h-5V5h5z",id:"Details_svg__a"})),a().createElement("g",{stroke:"none",strokeWidth:1,fillRule:"evenodd"},a().createElement("mask",{id:"Details_svg__b",fill:"#fff"},a().createElement("use",{xlinkHref:"#Details_svg__a"})),a().createElement("path",{mask:"url(#Details_svg__b)",d:"M0 0h24v24H0z"})));var f=r(39475),h=r(4270);const y=(0,r(72342).makeStyles)((()=>({paper:{backgroundColor:"rgba(0, 0, 0, .85)"},backdrop:{backgroundColor:"transparent"},toolbar:{paddingLeft:"20px",paddingRight:"20px"},appBar:{position:"relative",background:"linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 100%)"},closeButton:{marginRight:"28px"},closeIcon:{fontSize:"24px",color:"#fff"},headerLeft:{display:"flex",alignItems:"center",flex:2},headerCenter:{display:"flex",justifyContent:"center",flex:1},headerRight:{flex:2,display:"flex",justifyContent:"flex-end",alignItems:"center"},modeSwitcher:{backgroundColor:"#fff"},content:{padding:0}})));let x;!function(e){e.GALLERY_MODE="gallery",e.DETAILS_MODE="details"}(x||(x={}));const v=e=>{let{open:t,mode:r,children:l,header:g,onClose:v,onChangeMode:E}=e;const w=y(),O=(0,n.useMemo)((()=>[{id:x.GALLERY_MODE,title:o().text("Gallery"),Icon:d.Z},{id:x.DETAILS_MODE,title:o().text("Details"),Icon:b}]),[]);return a().createElement(i.Z,{classes:{paper:w.paper},open:t,BackdropProps:{className:w.backdrop},fullScreen:!0},a().createElement(c.Z,{classes:{colorPrimary:w.appBar}},a().createElement(u.Z,{className:w.toolbar},a().createElement(p.Z,{className:w.headerLeft},a().createElement(f.k,{tooltipTitle:o().text("Close"),onClick:v,className:w.closeButton,iconClassName:w.closeIcon,icon:m.default}),null==g?void 0:g.left),a().createElement(p.Z,{className:w.headerCenter},a().createElement(h.Z,{modes:O,modeId:r,onChange:E,className:w.modeSwitcher})),a().createElement(p.Z,{className:w.headerRight},null==g?void 0:g.right))),a().createElement(s.Z,{className:w.content},l))}},30357:(e,t,r)=>{r.d(t,{Z:()=>u});var n=r(24328),a=r.n(n),l=r(38529),o=r(71153),i=r.n(o);const s=(0,r(72342).makeStyles)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}})));function c(){return c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c.apply(this,arguments)}const u=e=>{const t=s(),r=(0,l.useInRouterContext)(),{href:n,className:o}=e,u=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["href","className"]),p=i()(t.link,o);return r&&n?a().createElement(l.Link,c({to:n.replace(window.location.origin,""),className:p},u)):a().createElement("a",c({href:n,className:p},u))}},80233:(e,t,r)=>{r.d(t,{Z:()=>m});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(12115),s=r(17055),c=r(7421);const u=(0,r(72342).makeStyles)((e=>{const t=e.palette.background.paper;return{paper:{backgroundColor:t,maxWidth:1e3},popper:{'&[data-popper-placement*="bottom"] $arrow':{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},'&[data-popper-placement*="top"] $arrow':{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},'&[data-popper-placement*="right"] $arrow':{left:0,marginLeft:"-0.71em",height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},'&[data-popper-placement*="left"] $arrow':{right:0,marginRight:"-0.71em",height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}},arrow:{overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:t,"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",boxShadow:e.shadows[1],backgroundColor:"currentColor",transform:"rotate(45deg)"}}}}));function p(){return p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},p.apply(this,arguments)}const m=e=>{let{children:t,className:r,classes:l,transition:m}=e,d=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","className","classes","transition"]);const g=u(),b=m?s.Z:a().Fragment,[f,h]=(0,n.useState)(null);return a().createElement(c.Z,p({className:o()(g.popper,r),modifiers:[{name:"preventOverflow",enabled:!0,options:{rootBoundary:"viewport",padding:14,altAxis:!0}},{name:"arrow",enabled:!0,options:{element:f,padding:4}}],transition:m,excludeAnchorFromBackdrop:!1},d),(e=>{let{TransitionProps:r}=e;return a().createElement(b,r,a().createElement(i.Z,{className:o()(g.paper,null==l?void 0:l.root)},a().createElement("span",{className:o()(g.arrow,null==l?void 0:l.arrow),ref:h}),t))}))}},14699:(e,t,r)=>{r.d(t,{Z:()=>p});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(32701),s=r(79312);const c=(0,r(72342).makeStyles)({label:{color:"rgba(0,0,0,0.6)",fontSize:"13px",lineHeight:"15px"}});function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}const p=e=>{let{label:t,isRequired:r,className:n}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","isRequired","className"]);const p=c();return a().createElement(s.Z,u({className:o()(p.label,n),component:"span"},l),t,r&&a().createElement(i.Z,null))}},52239:(e,t,r)=>{r.d(t,{Z:()=>c});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l);const i="1px solid #AFD4E9",s=(0,r(72342).makeStyles)({decorator:{marginLeft:8,borderLeft:i,"&:last-child":{borderLeft:"none","&:before":{borderLeft:i}},"&:before":{top:0,height:14,width:5,borderBottom:i,content:'""',display:"block",left:"0"},"&$plain":{"&:before":{width:0}}},plain:{},wrapper:{marginLeft:16,marginTop:-8}}),c=e=>{let{className:t,children:r,plain:n=!1,enabled:l=!1}=e;const i=s();return l?a().createElement("div",{className:o()(i.decorator,{[i.plain]:n},t)},a().createElement("div",{className:i.wrapper},r)):a().createElement(a().Fragment,null,r)}},4767:(e,t,r)=>{r.d(t,{Z:()=>g});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(19926),s=r(43407),c=r(78223);function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}const p=e=>a().createElement("svg",u({width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),a().createElement("path",{d:"M5.417 9.5h1.166V8.333H5.417V9.5zM6 .167A5.835 5.835 0 00.167 6 5.835 5.835 0 006 11.833 5.835 5.835 0 0011.833 6 5.835 5.835 0 006 .167zm0 10.5A4.673 4.673 0 011.333 6 4.673 4.673 0 016 1.333 4.673 4.673 0 0110.667 6 4.673 4.673 0 016 10.667zM6 2.5a2.333 2.333 0 00-2.333 2.333h1.166A1.17 1.17 0 016 3.667a1.17 1.17 0 011.167 1.166c0 1.167-1.75 1.021-1.75 2.917h1.166c0-1.313 1.75-1.458 1.75-2.917A2.333 2.333 0 006 2.5z",fill:"#000",fillOpacity:.54})),m=(0,r(72342).makeStyles)((()=>({container:{height:"15px",backgroundColor:"transparent","&:hover":{backgroundColor:"transparent"},"& $icon":{width:"12px",height:"12px",marginRight:0}},label:{paddingLeft:"4px",paddingRight:"4px",fontSize:"10px",lineHeight:"11px"},icon:{}}))),d=(0,c.Z)(i.Z),g=e=>{let{className:t,description:r}=e;const{showDescription:l}=(0,n.useContext)(s.Y),i=m();return r&&l?a().createElement(d,{tooltipTitle:r,tooltipPlacement:"bottom",icon:a().createElement(p,null),classes:{root:o()(i.container,t),label:i.label,icon:i.icon}}):null}},43253:(e,t,r)=>{r.d(t,{Z:()=>Ne});var n=r(24328),a=r.n(n),l=r(52730),o=r(44443),i=r(79312),s=r(50673),c=r(17512),u=r(65510),p=r(50914),m=r(83422),d=r(17283),g=r(78781),b=r(71153),f=r.n(b),h=r(26729),y=r(40435),x=r(72342);const v=(0,x.makeStyles)((e=>({root:{display:"flex",alignContent:"center",flexDirection:"column"},main:{position:"relative",padding:"0 86px",marginTop:"auto"},mainImageContainer:{display:"flex",alignContent:"center",height:"100%",width:"100%"},mainImage:{maxWidth:"calc(100vw - 512px)",maxHeight:"calc(100vh - 192px)",margin:"0 auto",userSelect:"none"},arrowButton:{backgroundColor:e.palette.divider,color:"white","&:hover":{backgroundColor:e.palette.divider}},arrowButtonPrev:{position:"absolute",top:"50%",left:"16px",transform:"translateY(-50%)"},arrowButtonNext:{position:"absolute",top:"50%",right:"16px",transform:"translateY(-50%)"}})));var E=r(63735);const w=(0,x.makeStyles)((()=>({thumbnails:{marginLeft:"12px",marginBottom:"12px",marginTop:"auto",width:"calc(100vw - 364px)",overflowX:"auto",overflowY:"hidden"},gridContainer:{width:"100%"},thumb:{width:"96px",height:"96px",cursor:"pointer",userSelect:"none"},inactiveThumb:{filter:"brightness(0.5)"}}))),O=e=>{let{attributeValues:t,setAttributeValueIndex:r,attributeValueIndex:l}=e;const o=w(),i=(0,n.useRef)(null);return(0,n.useEffect)((()=>{if(null!=i&&i.current){const e=i.current.scrollLeft,t=i.current.offsetWidth+e,r=96*l+16*l+12;t<r?i.current.scroll&&(r>t+96+16?i.current.scroll(r,0):i.current.scroll(112+e,0)):e+96>r&&i.current.scroll&&i.current.scroll(r-96,0)}}),[l,i]),a().createElement("div",{ref:i,className:o.thumbnails},a().createElement(E.ZP,{container:!0,wrap:"nowrap",direction:"row",spacing:1,className:o.gridContainer},t.map(((e,t)=>{let{uri:n,value:i}=e;return a().createElement(E.ZP,{item:!0,key:n},a().createElement(h.Z,{onClick:()=>r(t),className:f()(o.thumb,{[o.inactiveThumb]:l!==t}),src:(0,c.efz)({value:i})}))}))))},C=e=>{let{className:t,attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:l}=e;const o=v(),i=r[n],s=(0,c.QXK)(i);return a().createElement("div",{className:f()(o.root,t)},a().createElement("div",{className:o.main},n>0&&a().createElement(y.Z,{icon:d.Z,className:f()(o.arrowButton,o.arrowButtonPrev),onClick:()=>{l(n-1)},size:"XL"}),a().createElement(h.Z,{containerClassName:o.mainImageContainer,className:o.mainImage,size:s&&h.f.OVERRIDE,src:s}),n!==r.length-1&&a().createElement(y.Z,{icon:g.Z,className:f()(o.arrowButton,o.arrowButtonNext),onClick:()=>{l(n+1)},size:"XL"})),a().createElement(O,{attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:l}))};var N=r(2507),S=r.n(N),k=r(80852),T=r(30721),A=r(40476),Z=r(53626),P=r(56961),j=r(67283),I=r(95038),D=r.n(I);const V={get CreationTime(){return S().text("Creation Time")},get CreationDate(){return S().text("Creation Date")},get Dimensions(){return S().text("Dimensions")},get MimeType(){return S().text("Mime Type")},get Size(){return S().text("Size")},get Url(){return S().text("Full image URL (S3)")},get UrlPreview(){return S().text("Preview image URL (S3)")},get UrlThumbnail(){return S().text("Small image URL (S3)")},get CdnUrl(){return S().text("Full image URL (CDN)")},get CdnUrlPreview(){return S().text("Preview image URL (CDN)")},get CdnUrlThumbnail(){return S().text("Small image URL (CDN)")}},L=function(){let{value:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail","MimeType"].includes(t)?(0,p.path)([t,0,"value"],e):"CreationDate"===t&&(0,p.path)(["CreationTimestamp",0,"value"],e)?D()(e.CreationTimestamp[0].value).format("MM-DD-YYYY"):"CreationTime"===t&&(0,p.path)(["CreationTimestamp",0,"value"],e)?D()(e.CreationTimestamp[0].value).format("HH:mm:ss"):"Dimensions"===t&&(0,p.path)(["Height",0,"value"],e)&&(0,p.path)(["Width",0,"value"],e)?`${e.Height[0].value} x ${e.Width[0].value} ${S().text("pixels")}`:"Size"===t&&(0,p.path)(["Size",0,"value"],e)?`${(Number(e.Size[0].value)/1e3).toFixed(2)} KB`:void 0},R=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.filter((e=>{let{system:t}=e;return!t}))},U=(e,t)=>{const{includeNames:r=[],excludeNames:n=[],order:a=[]}=t,l=r.length?e.filter((e=>r.includes(e))):e.filter((e=>!n.includes(e)));return 0===a.length?l:l.sort(((e,t)=>{const r=a.indexOf(e),n=a.indexOf(t);return-1===r&&-1!==n?1:-1===n&&-1!==r?-1:r-n}))},M=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;const n=R(t.attributes);return U(Object.keys(e.value||{}),r).reduce(((t,r)=>{const a=n.find((e=>{let{name:t}=e;return t===r}));return a?[...t,{attrType:a,values:e.value[r]}]:t}),[])},_=e=>["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail"].includes(e),z=(0,x.makeStyles)({title:{marginBottom:"10px",color:"white",fontSize:"18px",lineHeight:"21px","&$canAdd":{marginBottom:"3px"}},divider:{width:"100%",height:"1px",borderColor:"rgba(255,255,255,0.12)"},canAdd:{}}),B=e=>{let{attributeType:t,onAddAttributes:r,uri:l}=e;const o=z(),s=R(t.attributes),c=Boolean(r);return a().createElement(m.Z,null,a().createElement(i.Z,{className:f()(o.title,{[o.canAdd]:c})},S().text("Meta info")),c&&a().createElement(n.Fragment,null,a().createElement(j.Z,{label:S().text("Attributes"),data:s,dense:!1,onApply:e=>{r&&r(e.map((e=>({attributeType:e,parentUri:l}))))}}),a().createElement(P.Z,{className:o.divider})))};var F=r(94319);const H=(0,x.makeStyles)((e=>({root:{fontSize:"13px",letterSpacing:0,lineHeight:"15px",marginBottom:"11px"},title:{color:"rgba(255,255,255,0.54)",marginRight:"12px",float:"left"},content:{color:"rgba(255,255,255,0.87)",wordWrap:"break-word"},link:{color:e.palette.primary.main,textDecoration:"none"}}))),q=e=>{let{title:t,content:r,isLink:n,children:l}=e;const o=H();return a().createElement("div",{className:o.root},a().createElement("span",{className:o.title},t),n?a().createElement("a",{className:o.link,href:r},S().text("link")):a().createElement("span",{className:o.content},r||l))},W=(0,x.makeStyles)({root:{padding:"10px 0"},title:{color:"rgba(255,255,255,0.54)",fontSize:"13px"},content:{color:"rgba(255,255,255,0.87)",wordWrap:"break-word"}}),$=e=>{let{attributeValue:t,attributeType:r,imageAttributeFieldsOrder:n}=e;const o=W(),i=(0,l.useSelector)(s.ZP.selectors.getIsViewMode),c=(u=t,p=n,U(Object.keys(V),p).map((e=>L(u,e)?{title:V[e],value:L(u,e),isLink:_(e)}:null)).filter(Boolean));var u,p;const d=M(t,r,n);return a().createElement(m.Z,{className:o.root},c.map((e=>{let{title:t,value:r,isLink:n}=e;return a().createElement(q,{key:t,isLink:n,title:t,content:r})})),i&&d.map((e=>{let{attrType:r,values:n}=e;return a().createElement(F.Z,{key:r.uri,attributeType:r,drawLines:!1,values:n,titleClassName:o.title,contentClassName:o.content,parentUri:t.uri})})))};var Y=r(38677),X=r(55752);const G=(0,x.makeStyles)({root:{},form:{padding:"10px 0"},divider:{width:"100%",height:"1px",borderColor:"rgba(255,255,255,0.12)"},actions:{display:"flex",justifyContent:"flex-end",marginTop:"4px"},cancelButton:{color:"white",marginRight:"8px"}}),K=e=>{let{attributeType:t,imageAttributeFieldsOrder:r,attributeValue:n,hasChanges:l,onDeleteAttribute:o,onChangeAttribute:i,onAddAttributes:s,onCancel:u,onApply:p,mode:d}=e;const g=G(),b=M(n,t,r),f=0!==b.length||0===b.length&&l;return a().createElement(m.Z,{className:g.root},a().createElement(m.Z,{className:g.form},b.map((e=>{let{attrType:t,values:r}=e;return a().createElement(X.ZP,{key:t.uri,parentUri:n.uri,attributeType:t,values:r,showEmptyEditors:(0,c.ZiX)(n.uri),mode:d,drawLines:!1,onDeleteAttribute:o,onChangeAttribute:i,onAddAttributes:s})}))),f&&a().createElement(a().Fragment,null,a().createElement(P.Z,{className:g.divider}),a().createElement(m.Z,{className:g.actions},a().createElement(Y.Z,{disabled:!l,onClick:u,className:g.cancelButton},S().text("Cancel")),a().createElement(Y.Z,{disabled:!l,onClick:p,color:"primary"},S().text("Apply")))))};var J=r(63532);const Q={palette:{mode:"dark",primary:c.rSc.palette.primary,secondary:c.rSc.palette.secondary}},ee=(0,A.Z)(Q),te=e=>{let{imageAttributeFieldsOrder:t,attributeType:r,attributeValue:o}=e;const{addAttributes:i,changeAttribute:u,deleteAttribute:d,clearLocalChanges:g,applyLocalChanges:b,attributeValue:f,hasChanges:h}=(e=>{let{initialAttributeValue:t,attributeType:r}=e;const a=(0,l.useDispatch)(),o=(0,n.useContext)(J.m),[i,u]=(0,n.useState)(t);(0,n.useEffect)((()=>{u(t)}),[t]);const m=!(0,p.equals)(i,t),d=(0,n.useCallback)((e=>{u((t=>e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,c.tPT)({entity:e,attributeType:r,parentUri:n,index:a,nestingLevel:1})}),t)))}),[]),g=(0,n.useCallback)((e=>{let{value:t,attributeType:r,uri:n}=e;u((e=>(0,c.ww$)({entity:e,attributeType:r,uri:n,value:t,nestingLevel:1})))}),[]),b=(0,n.useCallback)((e=>{let{attributeType:t,uri:r}=e;u((e=>(0,c.d$I)({entity:e,attributeType:t,uri:r,nestingLevel:1})))}),[]);return{addAttributes:d,changeAttribute:g,deleteAttribute:b,clearLocalChanges:(0,n.useCallback)((()=>{u(t)}),[t]),applyLocalChanges:(0,n.useCallback)((()=>{a(s.N5.actions.modifyAttribute({value:i,attributeType:r,uri:i.uri,viewId:o}))}),[i,r,o,a]),attributeValue:i,hasChanges:m}})({attributeType:r,initialAttributeValue:o}),y=(0,l.useSelector)(s.ZP.selectors.getMode),x=(0,l.useSelector)(s.ZP.selectors.getIsEditableMode);return a().createElement(Z.Z,{theme:ee},a().createElement(m.Z,null,a().createElement(B,{attributeType:r,uri:null==f?void 0:f.uri,onAddAttributes:x?i:void 0}),a().createElement($,{attributeType:r,attributeValue:f,imageAttributeFieldsOrder:t}),x&&a().createElement(K,{mode:y,imageAttributeFieldsOrder:t,attributeType:r,attributeValue:f,hasChanges:h,onDeleteAttribute:d,onChangeAttribute:u,onAddAttributes:i,onCancel:g,onApply:b})))},re=(0,x.makeStyles)((e=>({root:{position:"relative",backgroundColor:"#333",maxHeight:"calc(100vh - 64px)",overflow:"hidden"},header:{display:"flex",alignItems:"center",height:"56px",paddingLeft:"16px",boxShadow:`0 1px 0 0 ${e.palette.divider}`},headerTitle:{color:"rgba(255, 255, 255, 0.87)",fontSize:"16px",lineHeight:"19px"},bodyWrapper:{maxHeight:"calc(100% - 56px)",overflow:"auto"},body:{padding:"16px"},formControlLabel:{marginLeft:0,marginBottom:"27px"},checkboxLabel:{marginLeft:"8px",color:"rgba(255,255,255,0.87)",fontSize:"13px",lineHeight:"15px"},checkbox:{color:"white",padding:0}}))),ne=e=>{let{className:t,attributeValue:r,handleSetAsDefault:o,attributeType:c}=e;const u=re(),p=(0,l.useSelector)(s.ZP.selectors.getEntity)||{},d=(0,l.useSelector)((e=>s.ZP.selectors.getModifiedEntity(e,null==p?void 0:p.uri)))||{},g=(0,l.useSelector)(s.ZP.selectors.getIsViewMode)?p:d,b=(0,l.useSelector)(s.ZP.selectors.getImageAttributesFieldsOrder)||{},h=b[null==p?void 0:p.type]||(null==b?void 0:b.default)||{},[y,x]=(0,n.useState)(!1);(0,n.useEffect)((()=>{x((null==g?void 0:g.defaultProfilePic)===(null==r?void 0:r.uri))}),[null==r?void 0:r.uri,g]);const v=(0,n.useCallback)((()=>{o(r.uri)}),[null==r?void 0:r.uri]);return a().createElement(m.Z,{className:f()(u.root,t)},a().createElement(m.Z,{className:u.header},a().createElement(i.Z,{className:u.headerTitle},S().text("Details"))),a().createElement(m.Z,{className:u.bodyWrapper},a().createElement(m.Z,{className:u.body},a().createElement(T.Z,{classes:{root:u.formControlLabel,label:u.checkboxLabel},control:a().createElement(k.Z,{className:u.checkbox,checked:y,onChange:v}),label:S().text("Set as default")}),a().createElement(te,{attributeType:c,imageAttributeFieldsOrder:h,attributeValue:r}))))},ae=(0,x.makeStyles)((()=>({root:{display:"flex",width:"100%",overflowY:"auto",height:"calc(100vh - 64px)"},main:{flex:"1 0 auto"},details:{width:"340px"}}))),le=e=>{let{attributeValues:t=[],currentAttributeValueUri:r,setCurrentAttributeValueUri:l,handleSetAsDefault:o,attributeType:i}=e;const[s,c]=(0,n.useState)(0);(0,n.useEffect)((()=>{u(r?t.findIndex((e=>e.uri===r)):0)}),[r,t]);const u=(0,n.useCallback)((e=>{var r;c(e),l(null===(r=t[e])||void 0===r?void 0:r.uri)}),[t]),p=ae();return a().createElement(m.Z,{className:p.root},a().createElement(C,{attributeValueIndex:s,setAttributeValueIndex:u,attributeValues:t,className:p.main}),a().createElement(ne,{handleSetAsDefault:o,attributeValue:t[s],className:p.details,attributeType:i}))};var oe=r(95596),ie=r(22349);const se=(0,x.makeStyles)((()=>({root:{padding:"0 24px",overflowY:"auto",height:"calc(100vh - 64px)"},item:{padding:"2px"}}))),ce=e=>{let{items:t,selectedItems:r,onSelectImage:n,onDeselectImage:l,onShareLink:o,onSetAsDefault:i,onDownload:s,onClickImage:c,onDelete:u}=e;const p=se(),d=e=>a().createElement(ie.Z,{id:e,selected:r.includes(e),selectionMode:0!==r.length,onSelect:()=>n(e),onDeselect:()=>l(e),onShareLink:()=>o(e),onSetAsDefault:()=>i(e),onDownload:()=>s(e),onClick:()=>c(e),onDelete:u?()=>u(e):void 0,canBeSelected:!0});return a().createElement(m.Z,{className:p.root},a().createElement(E.ZP,{container:!0},t.map((e=>{let{id:t,src:r}=e;return a().createElement(E.ZP,{key:t,classes:{item:p.item},item:!0},a().createElement(h.Z,{size:h.f.LARGE,onClick:()=>c(t),src:r,overlay:d(t)}))}))))};var ue=r(55485);const pe=(0,x.makeStyles)((e=>({selectButton:{fontSize:"14px",fontWeight:500,color:e.palette.primary.main,textTransform:"uppercase"}}))),me=e=>{let{selectedItems:t,items:r,onSelectAll:n,onClearAll:l}=e;const o=pe(),i=t.length===r.length;return a().createElement(ue.Z,{component:"button",underline:"none",classes:{button:o.selectButton},onClick:i?l:n},i?S().text("Clear selection"):S().text("Select all images"))};var de=r(18169),ge=r(6163),be=r(34506),fe=r(36746),he=r(39475);const ye=(0,x.makeStyles)((()=>({downloadButton:{color:"#fff",fontSize:"24px",marginLeft:"30px"},shareButton:{color:"#fff",fontSize:"24px",marginLeft:"21px"},deleteButton:{color:"#fff",fontSize:"24px",marginLeft:"24px"},divider:{height:"31px",width:"1px",marginLeft:"10px",backgroundColor:"rgba(255,255,255,0.38)"}}))),xe=e=>{let{onDownload:t,onShare:r,onUpload:n,onDelete:l}=e;const o=ye();return a().createElement(a().Fragment,null,n&&a().createElement(Y.Z,{variant:"contained",color:"primary",onClick:n,startIcon:a().createElement(de.Z,null)},S().text("Upload")),t&&n&&a().createElement("div",{className:o.divider}),t&&a().createElement(he.k,{className:o.downloadButton,tooltipTitle:S().text("Download selected items"),icon:fe.Z,onClick:t}),r&&a().createElement(he.k,{className:o.shareButton,tooltipTitle:S().text("Copy link"),icon:be.Z,onClick:r}),l&&a().createElement(he.k,{className:o.deleteButton,tooltipTitle:S().text("Delete selected items"),icon:ge.Z,onClick:l}))},ve=e=>{let{attributeValues:t,open:r,onClose:o,currentAttributeValueUri:i,setCurrentAttributeValueUri:u,attributeType:m,onDownload:d,onShareLink:g,onSetAsDefault:b,onUpload:f,onDeleteAttribute:h}=e;const[y,x]=(0,n.useState)([]),[v,E]=(0,n.useState)(oe.A.GALLERY_MODE),w=(0,l.useSelector)(s.ZP.selectors.getIsViewMode);(0,n.useEffect)((()=>{E(i?oe.A.DETAILS_MODE:oe.A.GALLERY_MODE)}),[i]);const O=t.map((e=>({src:(0,c.efz)(e),downloadURL:(0,c.Q5d)(e),id:e.uri}))),C=e=>{g(O.find((0,p.propEq)("id",e)).downloadURL)},N=e=>{const r=t.find((t=>{let{uri:r}=t;return r===e}));b(r)},S=e=>{h({uri:e,attributeType:m})},k=v===oe.A.GALLERY_MODE,T=v===oe.A.DETAILS_MODE,A=y.length>0,Z=T||k&&A,P=!w&&Z,j=!w&&(T||k&&!A),I=k&&A&&a().createElement(me,{items:O,selectedItems:y,onClearAll:()=>{x([])},onSelectAll:()=>{x((0,p.pluck)("id",O))}}),D=a().createElement(xe,{onDelete:P?()=>{(k?y:[i]).forEach((e=>{S(e)})),y.length&&x([])}:void 0,onDownload:Z?()=>{const e=k?(0,p.pipe)((0,p.filter)((e=>{let{id:t}=e;return y.includes(t)})),(0,p.pluck)("downloadURL"))(O):[O.find((0,p.propEq)("id",i)).downloadURL];d(e)}:void 0,onShare:T?()=>{C(i)}:void 0,onUpload:j?f:void 0});return a().createElement(oe.C,{mode:v,open:r,onChangeMode:E,header:{left:I,right:D},onClose:o},k&&a().createElement(ce,{items:O,selectedItems:y,onSelectImage:e=>{x((t=>[...t,e]))},onDeselectImage:e=>{x((t=>t.filter((t=>t!==e))))},onShareLink:C,onSetAsDefault:N,onDownload:e=>{d([O.find((0,p.propEq)("id",e)).downloadURL])},onClickImage:e=>{u(e),E(oe.A.DETAILS_MODE)},onDelete:w?void 0:S}),T&&a().createElement(le,{handleSetAsDefault:N,setCurrentAttributeValueUri:u,currentAttributeValueUri:i,attributeValues:t,attributeType:m}))};var Ee=r(91446),we=r(47591);const Oe=(0,x.makeStyles)((e=>({imageBox:{position:"relative",display:"flex",width:"100%",flexGrow:1,flexShrink:0,flexWrap:"nowrap",marginTop:"2px",overflow:"hidden"},moreButtonContainer:e=>{let{imageWidth:t,imageHeight:r}=e;return{backgroundColor:"white",width:t,height:r,position:"absolute",right:0,cursor:"pointer"}},moreButton:t=>{let{imageWidth:r,imageHeight:n}=t;return{display:"flex",justifyContent:"center",alignItems:"center",width:r,height:n,backgroundColor:(0,we.Fq)(e.palette.primary.main,.06)}},number:{color:e.palette.primary.main,fontSize:"24px",lineHeight:"42px",letterSpacing:0,textAlign:"center",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}})));function Ce(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ne=e=>{let{attributeType:t,attributeValues:r=[],renderImage:p,overlay:m=!1,countFixedItems:d=0,children:g,onUpload:b,onDeleteAttribute:f,imageSize:h=Ee.By,paging:y,parentUri:x,showNonOv:v,requestNextPageOfAttributeValues:E}=e;const w=(0,l.useSelector)(s.ZP.selectors.getEntity)||{},O=(0,l.useSelector)(s.ZP.selectors.getIsViewMode),C=(0,l.useDispatch)(),N=Oe(h);(0,n.useEffect)((()=>{if(y&&E){const e=v?y.totalOvValues:y.totalValues;e>r.length&&E({parentUri:x,attributeTypeUri:t.uri,attributeTypeName:t.name,values:[],defaultMaxValues:e})}}),[y,E,t,x,r.length,v]);const S=(0,n.useRef)(),[k,T]=(0,n.useState)(0),[A,Z]=(0,n.useState)(0),P=(0,n.useContext)(u.P),[j,I]=(0,n.useState)(!1),[D,V]=(0,n.useState)(),L=(0,n.useCallback)((e=>{const{imageMargin:t,imageWidth:n}=h,a=Math.floor((e+t)/(n+t))-d,l=e+t-(a+d)*(n+t)<Ee.lc;T(a),r.length>a?Z(r.length-a+(l?1:0)):Z(0)}),[r.length,d,h]),R=(0,n.useCallback)((e=>{L(e),S.current=e}),[L]);(0,n.useEffect)((()=>{S.current&&L(S.current)}),[r.length,L]);const U=(0,n.useCallback)((e=>{P||(V(e),I(!0))}),[P]),M=(0,n.useCallback)((()=>{I(!1)}),[]),_=e=>(e=>{e.forEach(((e,t)=>{try{if((e=>!!(e=>e.indexOf("://")>0||0===e.indexOf("//"))(e)&&new URL(e).host!==location.host)(e)){const r=document.createElement("iframe");r.setAttribute("style","display: none;"),r.setAttribute("src",e),document.body.appendChild(r),setTimeout((()=>document.body.removeChild(r)),3e4*(t+1))}else{const t=document.createElement("a");t.href=e,t.download=(e=>e.split("/").pop())(e),document.body.appendChild(t),t.click(),document.body.removeChild(t)}}catch(e){console.error(e)}}))})(e),z=e=>navigator.clipboard.writeText(e),B=(0,n.useCallback)((e=>{O?(0,c.YL3)(w.uri,e.uri).then((t=>{let{status:r}=t;"success"===r&&C(s.N5.entity.actions.setDefaultProfilePic(e))})):C(s.N5.modifiedEntities.actions.setDefaultProfilePic({entityUri:w.uri,value:e}))}),[O,w.uri,C]),F=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ce(e,t,r[t])}))}return e}({onOpenImageGalleryDialog:U},m&&{onDownload:_,onShareLink:z,onSetAsDefault:B});return a().createElement(a().Fragment,null,a().createElement(o.Z,{handleWidth:!0,onResize:R}),a().createElement(ve,{attributeValues:r,open:j,onClose:M,setCurrentAttributeValueUri:V,currentAttributeValueUri:D,attributeType:t,onDownload:_,onShareLink:z,onSetAsDefault:B,onUpload:b,onDeleteAttribute:f}),a().createElement("div",{className:N.imageBox},g,r.slice(0,k).map(p(F)),A>0&&a().createElement("div",{className:N.moreButtonContainer},a().createElement("div",{className:N.moreButton,onClick:()=>U()},a().createElement(i.Z,{className:N.number},`+${A}`)))))}},91446:(e,t,r)=>{r.d(t,{lc:()=>o,By:()=>i});var n=r(26729);const a=n.f.SMALL.imageWidth,l=n.f.SMALL.imageHeight,o=8,i={imageMargin:4,imageWidth:a,imageHeight:l}},33043:(e,t,r)=>{r.d(t,{Z:()=>h});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(52730),s=r(19926),c=r(17512),u=r(50673),p=r(67586),m=r(78223),d=r(10609),g=r(47591);const b=(0,r(72342).makeStyles)((e=>({container:{height:"16px",borderColor:(0,g.Fq)(e.palette.primary.main,.54)},label:{paddingLeft:"4px",paddingRight:"4px",fontSize:"10px",lineHeight:"11px",color:e.palette.primary.main}}))),f=(0,m.Z)(s.Z),h=e=>{let{className:t,attributeType:r,nonOvValues:l=[],nonOvTotal:s}=e;const m=b(),g=(0,i.useDispatch)(),h=((e,t)=>{var r;const n=null==t||null===(r=t[0])||void 0===r?void 0:r.uri,a=n?(0,c.Uk3)(n):null;return a&&(0,c.WgC)(a)?a:null==e?void 0:e.uri})((0,n.useContext)(d.u),l),y=(0,n.useCallback)((()=>{g(u.ui.actions.openEntity({uri:h,viewId:null,screen:"sources"}))}),[g,h]);if(!s)return null;const x=l.length?l.map(((e,t)=>a().createElement("div",{key:t},(0,c.YkM)(r)?(0,c.idV)(e.label):a().createElement(p.Z,{value:(0,c.kDl)(e),dataTypeDefinition:(0,c.PFL)(r),rich:!1})))):null;return a().createElement(f,{tooltipTitle:x,tooltipPlacement:"bottom",label:`+ ${s}`,variant:"outlined",onClick:h?y:void 0,classes:{root:o()(m.container,t),label:m.label}})}},32826:(e,t,r)=>{r.d(t,{m:()=>j});var n=r(24328),a=r.n(n),l=r(52730),o=r(23883),i=r(50673),s=r(17512),c=r(50914),u=r(80687);const p=(e,t,r,n)=>{const a=((e,t)=>{const r=t.find((t=>t.uri===e.uri));return r&&Array.isArray(r.children)?r.children:[]})(e,r);let l=(null==e?void 0:e.attributes)||(null==e?void 0:e.analyticsAttributes)||[];return a.length&&(l=l.filter((e=>a.includes(e.uri)))),l.reduce(((e,a)=>{const l=m(t[a.name],n,r);return l&&l.length&&(Array.isArray(l[0])?e.push({[a.uri]:l[0]}):e.push({[a.uri]:l})),e}),[])},m=(e,t,r)=>{if(e&&0!==e.length)return e.reduce(((e,n)=>{if("type"in n&&n.type){const a="lookupCode"in n?n.lookupCode:n.value,l=(0,s.zeJ)(t,n.type);a&&"object"!=typeof a&&(0,s.OXP)(n)?e.push(d(a,l)):a&&"object"==typeof a&&!Array.isArray(a)&&e.push(p(l,a,r,t))}return e}),[])},d=(e,t)=>{switch(null==t?void 0:t.type){case s.oS0.TYPE_DATE:return new Date(e).getTime();case s.oS0.TYPE_TIMESTAMP:return isNaN(Number(e))?new Date(e).getTime():new Date(Number(e)).getTime();default:return e}};function g(){return g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},g.apply(this,arguments)}const b=e=>a().createElement("svg",g({width:11,height:11,viewBox:"0 0 11 11"},e),a().createElement("path",{d:"M2.514 5h2.314V3l2.5 2.5-2.5 2.5V6h-3.8a4.5 4.5 0 10.73-3H.6a5.5 5.5 0 11-.577 3H0V5H2.514z",fill:"#6CACE4",stroke:"none",strokeWidth:1,fillRule:"evenodd"}));var f=r(2507),h=r.n(f),y=r(37573),x=r(18527),v=r(71153),E=r.n(v),w=r(98074),O=r(72342);const C=(0,O.makeStyles)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}}))),N=(0,n.forwardRef)(((e,t)=>{let{value:r,attributeType:o,children:s,className:c,onClick:u}=e;const p=C(),m=(0,l.useSelector)(i.ZP.selectors.getUIPath),{generatePivotingUrl:d}=(0,n.useContext)(w.v),g=d({uiPath:m,uri:o.uri,value:JSON.stringify(r)});return a().createElement("a",{ref:t,href:g,onClick:e=>{u(),e.stopPropagation(),e.preventDefault()},className:E()(p.link,c)},s)}));N.displayName="PivotingUriLink";const S=N;var k=r(19701);const T=(0,O.makeStyles)((e=>({container:{backgroundColor:"white",width:"360px",minWidth:"360px",maxWidth:"720px"},header:{display:"flex",height:"48px",alignItems:"center",justifyContent:"space-between",paddingLeft:"16px"},title:{color:e.palette.text.primary,fontSize:"16px",letterSpacing:"0.15px",lineHeight:"19px"},entityTypeLabel:{color:"rgba(0,0,0,0.67)",fontSize:"14px",paddingLeft:"16px",paddingBottom:"12px",lineHeight:"16px"},divider:{height:"24px",width:"1px",backgroundColor:"rgba(0,0,0,0.12)"},headerCount:{color:e.palette.text.secondary,fontSize:"14px",letterSpacing:"0.24px",lineHeight:"28px",width:"210px"},body:{borderBottom:"1px solid rgba(0,0,0,0.12)",padding:"0 16px 8px"},footer:{display:"flex",alignItems:"center",height:"31px",paddingLeft:"16px",color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px"},profileIcon:{height:"16px",width:"16px"},entityContainer:{display:"flex",flexDirection:"row",alignItems:"center"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px",textDecoration:"none",paddingLeft:"8px",wordBreak:"break-word"},icon:{margin:"auto 8px auto 0"},content:{color:e.palette.primary.main,cursor:"pointer"},seeAllButton:{cursor:"pointer"}}))),A=(0,O.makeStyles)({tooltip:{backgroundColor:"white",boxShadow:"0 4px 5px 0 rgba(0,0,0,0.14), 0 1px 10px 0 rgba(0,0,0,0.12), 0 2px 4px -1px rgba(0,0,0,0.2)",padding:0,borderRadius:"4px",maxWidth:"none"},arrow:{"&::before":{backgroundColor:"white"}}});function Z(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const P=e=>{let{value:t,attributeType:r,config:o={},generatedValue:c,onSeeAllClick:u}=e;const[p,m]=(0,n.useState)([]),[d,g]=(0,n.useState)(0),b=(0,l.useSelector)(i.ZP.selectors.getEntity)||{},f=(0,k._)(),v=T(),E=(0,l.useSelector)(i.ZP.selectors.getGlobalSearchRequestOptions)||{},w=o.entityType||b.type,O=d>6;(0,n.useEffect)((()=>{const e=(0,s.BlA)({value:t,attributeType:r,entityType:w}),n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Z(e,t,r[t])}))}return e}({max:6},E);f(Promise.all([(0,s.ZOr)(e,n),(0,s.j_Q)(e,n)])).then((e=>{const[t,{total:r}]=e;m(Array.isArray(t)?t:[]),g(r)})).catch((()=>{m([]),g(0)}))}),[]);const C=Boolean(o.label);return a().createElement("div",{className:v.container},a().createElement("div",{className:v.header},a().createElement("div",{className:v.title},h().text("Pivot profiles")),a().createElement("div",{className:v.divider}),a().createElement("div",{className:v.headerCount},h().number(d,"0,0")+" "+(1===d?h().text("item"):h().text("items")))),C&&a().createElement("div",{className:v.entityTypeLabel},o.label),a().createElement("div",{className:v.body},p.map((e=>a().createElement("div",{key:e.uri,className:v.entityContainer},a().createElement(y.Z,{entity:e,avatarClassName:v.profileIcon}),a().createElement(x.Z,{className:v.entityLabel,value:(0,s.wwR)(e)},(0,s.idV)(e.label)))))),O&&a().createElement("div",{className:v.footer},a().createElement(S,{value:c,attributeType:r,className:v.seeAllButton,onClick:u},h().text("See all"))))},j=e=>{let{value:t,attributeType:r,children:m,className:g}=e;const f=A(),h=T(),y=(0,l.useDispatch)(),x=(0,n.useContext)(u.J)||[],v=(0,s.QZu)(r),E=(0,l.useSelector)(i.ZP.selectors.getMetadata)||{},w=v?p(r,t.value,x,E):d(t.lookupCode||t.value,r),O=x.some((e=>{let{uri:t}=e;return t===r.uri}))&&(Array.isArray(w)&&w.length||!Array.isArray(w)&&!(0,c.isNil)(w)),C=x.find((e=>{let{uri:t}=e;return t===r.uri})),N=O?Array.isArray(w)?w.map((e=>Object.fromEntries(Object.entries(e).map((e=>{let[t,r]=e;return[(0,s.nIW)(t),r]}))))):((e,t)=>[{[e.name]:t}])(r,w):void 0,k=()=>{y(i.ui.actions.openPivotingPerspective({value:N,attributeType:r}))};return O?a().createElement(o.Z,{arrow:!0,placement:"right-start",classes:f,disableInteractive:!1,title:a().createElement(P,{value:w,generatedValue:N,attributeType:r,config:C.popup,onSeeAllClick:k})},a().createElement("span",{className:g},a().createElement(b,{className:h.icon}),a().createElement(S,{onClick:k,className:h.content,value:N,attributeType:r},m))):a().createElement(a().Fragment,null,m)}},11387:(e,t,r)=>{r.d(t,{Z:()=>p});var n=r(24328),a=r.n(n),l=r(17512),o=r(13310),i=r(3853),s=r(10768);function c(){return c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c.apply(this,arguments)}const u=(0,n.forwardRef)(((e,t)=>{const{className:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className"]);return a().createElement("div",{ref:t,className:r},class{static build(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{showEmptyEditors:r,onAddAttributes:n,lazy:u,errors:p,crosswalks:m,showNonOv:d,expanded:g}=t,b=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["showEmptyEditors","onAddAttributes","lazy","errors","crosswalks","showNonOv","expanded"]);switch(e.type){case l.oS0.TYPE_NESTED:return a().createElement(i.Z,t);case l.oS0.TYPE_REFERENCE:return a().createElement(s.Z,t);default:return a().createElement(o.Z,c({isReltioCrosswalk:(0,l.KVV)(m,t.attributeValue)},b))}}}.build(e.attributeType,n))}));u.displayName="Attribute";const p=u},76141:(e,t,r)=>{r.d(t,{Z:()=>O});var n=r(24328),a=r.n(n),l=r(13980),o=r.n(l),i=r(2507),s=r.n(i),c=r(17512),u=r(50914),p=r(55752),m=r(52239),d=r(67283),g=r(86602),b=r(26978);var f=r(1108),h=r(38583),y=r(50548),x=r(43460);function v(){return v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},v.apply(this,arguments)}function E(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const w=e=>{let{parentAttributeType:t,attrTypes:r,entity:l,parentUri:o,showEmptyEditors:i,mode:y,crosswalks:w,drawLines:O,children:C,className:N,alwaysVisibleTypeUris:S=g.S,onAddAttributes:k,onChangeAttribute:T,onDeleteAttribute:A,additionalControlsRenderer:Z,showNonOv:P,highlightAttribute:j}=e;const{attributes:I={}}=l,[D,V]=(0,n.useState)({}),L=(0,n.useCallback)(((e,t)=>{V((r=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){E(e,t,r[t])}))}return e}({},r,{[e]:t})))}),[]);(0,n.useEffect)((()=>{V({})}),[o]);const R=(0,n.useMemo)((()=>t&&(0,c.Vg3)({attributeType:t,mode:y})),[t,y]),U=((e,t,r,n)=>e.filter((e=>{const a=((e,t)=>{const{attributes:r={},analyticsAttributes:n={}}=t;return(0,u.cond)([[c.kqr,(0,u.always)(t)],[(0,u.both)(c.kQw,(0,u.always)(n)),(0,u.always)(n)],[u.T,(0,u.always)(r)]])(e)})(e,t),l=(e=>(0,c.kqr)(e)?"uri":"name")(e);return!((e.singleValue||(0,c.ian)(e)||(0,c.VFZ)(e))&&((0,u.has)(e[l])(a)||r&&(null==n||!n[e.uri])))})))((0,n.useMemo)((()=>(0,c._kX)(y,r)),[r,y]),l,i,D),M=(0,n.useContext)(f.c),_=(0,n.useMemo)((()=>(0,c.Gtj)(r,y,l,i,P,M)),[r,y,l,i,P,M]),[z,B]=(0,n.useMemo)((()=>(0,b.A)(S,_)),[_,S]),F=(0,n.useCallback)((e=>{k(e.map((e=>({attributeType:e,parentUri:e===t?(0,c.JBA)(o):o})))),j((0,u.last)(e),x.g4.NewAttribute)}),[k,o,t]),H={enabled:O},q=(0,n.useMemo)((()=>({hasDeletionsMap:D,setHasDeletions:L})),[D,L]);return a().createElement("div",{className:N},C&&a().createElement(m.Z,H,C),a().createElement(m.Z,v({},H,{plain:!0}),U.length>0&&a().createElement(d.Z,{label:s().text("More attributes"),onApply:F,dense:O,data:U,parent:R&&t})),a().createElement(h.d.Provider,{value:q},B.concat(z).map((e=>{let{attrType:t,values:r}=e;return a().createElement(p.ZP,{key:`${t.uri}_${o}`,attributeType:t,drawLines:O,values:r,paging:(0,u.path)(["paging",t.uri],I),parentUri:o,showEmptyEditors:i,mode:y,crosswalks:w,onAddAttributes:k,onChangeAttribute:T,onDeleteAttribute:A,additionalControlsRenderer:Z,showNonOv:P})}))))};w.propTypes={parentAttributeType:o().object,attrTypes:o().array,entity:o().object,parentUri:o().string,children:o().node,showEmptyEditors:o().bool,mode:c.XGc,crosswalks:o().array,drawLines:o().bool,showNonOv:o().bool,className:o().string,alwaysVisibleTypeUris:o().array,onAddAttributes:o().func,onChangeAttribute:o().func,onDeleteAttribute:o().func,additionalControlsRenderer:o().func,highlightAttribute:o().func};const O=(0,y.l)(x.NY,(e=>{const{highlightAttribute:t}=e||{};return{highlightAttribute:t}}),w)},63928:(e,t,r)=>{r.d(t,{Z:()=>v});var n=r(24328),a=r.n(n),l=r(17512),o=r(79312),i=r(50914),s=r(40130),c=r(2507),u=r.n(c);const p=e=>u().text("${value}",{value:1===e?u().text("value"):u().text("values")}),m=(0,i.has)("minValue"),d=(0,i.has)("maxValue"),g=(0,i.pipe)(d,i.not),b=(0,i.propSatisfies)((e=>1===e),"minValue"),f=e=>{let{minValue:t}=e;return u().text("This attribute can have minimum ${minValue} ${minValueCaption}",{minValue:u().number(t,"0"),minValueCaption:p(t)})},h=e=>{let{maxValue:t}=e;return u().text("This attribute can have maximum ${maxValue} ${maxValueCaption}",{maxValue:u().number(t,"0"),maxValueCaption:p(t)})},y=(0,i.cond)([[i.isNil,(0,i.always)("")],[e=>{let{minValue:t,maxValue:r}=e;return t&&t===r},e=>{let{minValue:t}=e;return u().text("This attribute should have ${minValue} ${minValueCaption}",{minValue:u().number(t,"0"),minValueCaption:p(t)})}],[(0,i.allPass)([b,d]),h],[(0,i.allPass)([b,g]),(0,i.always)("")],[(0,i.allPass)([m,d]),e=>{let{minValue:t,maxValue:r}=e;return u().text("${minCardinality} and maximum ${maxValue} ${maxValueCaption}",{minCardinality:f({minValue:t}),maxValue:u().number(r,"0"),maxValueCaption:p(r)})}],[d,h],[m,f],[i.T,(0,i.always)("")]]),x=e=>{let{cardinality:t}=e;const r=(0,s.y)();return a().createElement(o.Z,{variant:"caption",className:r.caption},y(t))};x.propTypes={cardinality:l.oA3};const v=x},55752:(e,t,r)=>{r.d(t,{ZP:()=>ae});var n=r(52730),a=r(50673),l=r(17512),o=r(24328),i=r.n(o),s=r(50914),c=r(52239),u=r(71153),p=r.n(u),m=r(55401),d=r(14699),g=r(33043),b=r(31992),f=r(35039),h=r(11387),y=r(63928);const x=(0,s.filter)((0,s.propSatisfies)(l.ZiX,"uri"));var v=r(1108),E=r(40941),w=r(4767),O=r(72342);function C(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){N(e,t,r[t])}))}return e}function N(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const S={content:'""',position:"absolute",left:"-1000px",top:"-4px",width:"5000px",height:"calc(100% + 8px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},k=(0,O.makeStyles)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlighted:{"&::before":C({},S,{background:"rgba(228, 151, 0, 0.08)"}),position:"relative"}}))),T=e=>{const t=k(),r=(0,o.useRef)(null),{scrollIntoRef:n}=e||{};return(0,o.useEffect)((()=>{e&&n(r)}),[e,n]),e?{ref:r,highlightedClassName:t.highlighted}:{ref:r}};var A=r(40130);const Z=e=>{let{max:t,values:r,attributeType:n,parentUri:a,mode:u,drawLines:O,showEmptyEditors:C,errorMessage:N,errors:S,paging:k,crosswalks:Z,showNonOv:P,nonVisibleValues:j,highlightedError:I,highlightedAttribute:D,onAddAttributes:V,onDeleteAttribute:L,onChangeAttribute:R,onDeactivateError:U,additionalControlsRenderer:M,requestNextPageOfAttributeValues:_}=e;const z=(0,A.y)(),[B,F]=(0,o.useState)(t),[H,q]=(0,o.useState)(!1),{label:W,required:$,cardinality:Y,name:X,uri:G,description:K}=n,J=(0,l.KIu)(u),{ref:Q,errorClassName:ee}=(0,E.B)({highlightedError:I}),{ref:te,highlightedClassName:re}=T(D),ne=(0,o.useContext)(v.c),ae=(0,o.useMemo)((()=>null==ne?void 0:ne.includes(G)),[G,ne]),le=(0,l.O27)(r),oe=(!H&&C||$||ae)&&le,ie=(0,o.useRef)((0,l.gjI)({parentUri:a,attributeType:(0,s.omit)(["defaultValue"],n)})),se=(0,o.useCallback)((()=>{F(B+1);const e=e=>({parentUri:a,index:B,attributeType:e});if(oe&&!(0,l.YkM)(n.type)){const t=[e((0,s.omit)(["defaultValue"],n)),e(n)];return V(t)}return V([e(n)])}),[B,V,a,n,oe]),ce=(0,o.useCallback)((0,s.pipe)(L,s.T,q),[L,q]);if(le&&!oe)return null;if(oe&&le&&(r=[ie.current]),(0,l.O27)(r))return null;const ue=(x(r)||[]).length,pe=P?"totalValues":"totalOvValues",me=(0,s.ifElse)((0,s.has)(pe),(0,s.pipe)((0,s.prop)(pe),(0,s.add)(ue)),(0,s.always)(r.length))(k),de=null!=k&&k.totalValues?k.totalValues-me:null==j?void 0:j.length,ge=t<me,be=ge&&B<me,fe=ge&&B>=me,he=r.slice(0,B),ye=he?he.length-1:0,xe=me-B;return i().createElement(c.Z,{enabled:O},i().createElement("div",{ref:Q,className:p()(z.wrapper,ee)},i().createElement("div",{className:z.titleWrapper},i().createElement(d.Z,{label:W,isRequired:$,className:z.title,"data-reltio-id":"reltio-attribute-label"}),i().createElement(w.Z,{description:K,className:z.description}),i().createElement(g.Z,{nonOvValues:j,attributeType:n,className:z.ovIcon,nonOvTotal:de})),J&&i().createElement(y.Z,{cardinality:Y}),J&&i().createElement(m.Z,{message:N,className:z.typeError}),i().createElement("div",{className:z.attributesWrapper},he.map(((e,t)=>i().createElement(h.Z,{key:e.uri,attributeValue:e,attributeType:n,lazy:oe&&!$,showEmptyEditors:C,errors:S,ownError:(0,l.ADq)(e,t,n.uri,S),mode:u,crosswalks:Z,onAddOneMore:ye===t?se:null,onAddAttributes:V,onDeleteAttribute:ce,onChangeAttribute:R,onDeactivateError:U,additionalControlsRenderer:M,className:0===t?re:null,ref:0===t?te:null,isEmptyEditor:oe}))),be&&i().createElement(f.Z,{moreNumber:(0,s.min)(t,xe),valueNumber:xe,onClick:()=>{r.length<me&&_({parentUri:a,attributeTypeUri:G,attributeTypeName:X,values:r,defaultMaxValues:t}),F(B+t)}}),fe&&i().createElement(b.Z,{onClick:()=>{F(t)}}))))};Z.displayName="AttributeRenderer";const P=(0,o.memo)(Z);var j=r(83422),I=r(90590),D=r(92145);const V=(0,O.makeStyles)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},roleContainer:{width:"100%"},valueContainer:{marginLeft:"8px",width:0},deleteButton:{marginLeft:"8px"}});var L=r(40435),R=r(6163);const U={MultiValue:D.Z},M=e=>{let{values:t,onChange:r,onDelete:c}=e;const u=V(),p=(0,n.useSelector)(a.ZP.selectors.getMetadata),m=(0,n.useSelector)(a.ZP.selectors.getEntity),d=m.uri,g=(0,l.JvE)(p,m.type).map((e=>({value:e.uri,label:e.label}))),b=(t||[]).map((e=>{var t;return{value:e,label:(null===(t=g.find((0,s.propEq)("value",e)))||void 0===t?void 0:t.label)||(0,l.nIW)(e)}})),f=(0,o.useCallback)((e=>{const t=(null==e?void 0:e.map((0,s.prop)("value")))||[];r({value:t,attributeType:l.xPW.roles,uri:d})}),[d,r]),h=(0,o.useCallback)((()=>{c({uri:d,attributeType:l.xPW.roles})}),[d,c]);return i().createElement("div",{className:u.container,"data-reltio-id":"reltio-attribute-value"},i().createElement(I.Z,{label:"",height:40,isMulti:!0,options:g,value:b,onChange:f,components:U,classes:u,className:u.roleContainer}),!!c&&i().createElement(L.Z,{className:u.deleteButton,icon:R.Z,onClick:h,size:"L"}))};var _=r(7766);const z=(0,O.makeStyles)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},deleteButton:{marginLeft:"8px"}}),B=e=>e?`?filter=${(0,l.Uqd)()((e=>[{filter:"containsWordStartingWith",fieldName:"tags",values:[e]}])(e))}`:"",F=[{fieldName:"tags",orderType:"reversedCount"}],H=e=>(0,l.FK9)({query:B(e),body:F}).then((e=>Object.keys(e.tags))),q=e=>{let{className:t,values:r,onChange:s,onDelete:c}=e;const u=z(),p=(0,n.useSelector)(a.ZP.selectors.getEntityUri),m=(0,o.useCallback)((e=>{s({value:e,attributeType:l.xPW.tags,uri:p})}),[s,p]),d=(0,o.useCallback)((()=>{c({uri:p,attributeType:l.xPW.tags})}),[p,c]);return i().createElement("div",{className:u.container,"data-reltio-id":"reltio-attribute-value"},i().createElement(_.Z,{fullWidth:!0,multiple:!0,variant:"filled",className:t,value:r||[],onChange:m,getSuggestions:H}),!!c&&i().createElement(L.Z,{className:u.deleteButton,icon:R.Z,onClick:d,size:"L"}))};var W=r(38583),$=r(50548);function Y(){return Y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Y.apply(this,arguments)}function X(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const G=(0,$.l)(W.d,((e,t)=>{let{attributeType:r}=t;const{hasDeletionsMap:n,setHasDeletions:a}=e||{};return{hasDeletions:n?Boolean(n[null==r?void 0:r.uri]):void 0,setHasDeletions:a}}),(e=>{let{values:t,attributeType:r,parentUri:n,mode:a,errorMessage:c,onDeleteAttribute:u,onChangeAttribute:g,showEmptyEditors:b,hasDeletions:f,setHasDeletions:x,highlightedAttribute:v}=e,E=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["values","attributeType","parentUri","mode","errorMessage","onDeleteAttribute","onChangeAttribute","showEmptyEditors","hasDeletions","setHasDeletions","highlightedAttribute"]);const w=(0,A.y)(),{label:O,required:C,cardinality:N}=r,S=(0,l.KIu)(a),[k,Z]=(0,o.useState)(!1),P=(0,o.useCallback)((e=>{Z(e),null==x||x(r.uri,e)}),[r.uri,x]),I=void 0!==f?f:k,D=(0,o.useCallback)((0,s.pipe)(u,s.T,P),[u,P]),V=(0,l.O27)(t),L=!I&&b&&V,R=(0,o.useRef)((0,l.gjI)({parentUri:n,attributeType:r})),{ref:U,highlightedClassName:_}=T(v);return(0,l.j2U)(r)&&V&&!L?null:i().createElement("div",{ref:U,className:p()(_,w.wrapper)},i().createElement(d.Z,{label:O,isRequired:C,className:p()(w.title,w.titleWrapper),"data-reltio-id":"reltio-attribute-label"}),S&&i().createElement(y.Z,{cardinality:N}),S&&i().createElement(m.Z,{message:c}),i().createElement(j.Z,{className:w.attributesWrapper},(()=>{switch(r.uri){case l.xPW.tags.uri:return i().createElement(q,{values:t,onDelete:D,onChange:g});case l.xPW.roles.uri:return i().createElement(M,{values:t,onDelete:D,onChange:g});default:{const e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){X(e,t,r[t])}))}return e}({},R.current,{value:t[0]||""});return i().createElement(h.Z,Y({attributeValue:e,attributeType:r,mode:a,onDeleteAttribute:D,onChangeAttribute:g},E))}}})()))}));var K=r(66078);const J=e=>{let{attributeType:t,attributeValues:r,paging:n,parentUri:a,showNonOv:l,onDeleteAttribute:o,onChangeAttribute:s,requestNextPageOfAttributeValues:c,highlightedAttribute:u}=e;const m=(0,A.y)(),{label:g,description:b}=t,{ref:f,highlightedClassName:h}=T(u);return i().createElement("div",{ref:f,className:p()(m.wrapper,h)},i().createElement("div",{className:m.titleWrapper},i().createElement(d.Z,{className:m.title,label:g,"data-reltio-id":"reltio-attribute-label"}),i().createElement(w.Z,{className:m.description,description:b})),i().createElement(K.Z,{attributeValues:r,attributeType:t,paging:n,onDeleteAttribute:o,parentUri:a,onChangeAttribute:s,requestNextPageOfAttributeValues:c,showNonOv:l}))};var Q,ee=r(43460);function te(){return te=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},te.apply(this,arguments)}!function(e){e.imageLine="imageLine",e.special="special",e.default="default"}(Q||(Q={}));const re=(0,$.l)(ee.NY,((e,t)=>{let{attributeType:r,parentUri:n}=t;const{element:a,type:o}=e||{};return{highlightedAttribute:(0,ee.St)(o)&&a.uri===r.uri?e:null,highlightedError:(0,ee.Ie)(o)&&(0,l.Wah)(a,n,r.uri)?e:null}}),(e=>{let{values:t,attributeType:r,mode:n=l.ARY.Viewing,crosswalks:a,drawLines:o,paging:u={},parentUri:p,errors:m,errorMessage:d,max:g=1/0,showEmptyEditors:b,showNonOv:f,highlightedError:h,highlightedAttribute:y,onAddAttributes:x,onDeleteAttribute:v,onChangeAttribute:E,onDeactivateError:w,additionalControlsRenderer:O,requestNextPageOfAttributeValues:C}=e;const N=(0,s.partition)(l.OXP),[S,k]=N(t),T=f?t:S,A=f?[]:k,Z={errorMessage:d,errors:m,mode:n,parentUri:p,onAddAttributes:x,onDeleteAttribute:v,onChangeAttribute:E,onDeactivateError:w,additionalControlsRenderer:O,showEmptyEditors:b,highlightedError:h,highlightedAttribute:y};return(()=>{switch((0,s.cond)([[l.kqr,(0,s.always)(Q.special)],[l.Or$,(0,s.always)(Q.imageLine)],[s.T,(0,s.always)(Q.default)]])(r)){case Q.special:return i().createElement(c.Z,{enabled:o},i().createElement(G,te({values:T,attributeType:r},Z)));case Q.imageLine:return i().createElement(c.Z,{enabled:o},i().createElement(J,{attributeValues:T,attributeType:r,paging:u,onDeleteAttribute:v,parentUri:p,onChangeAttribute:E,requestNextPageOfAttributeValues:C,showNonOv:f,highlightedAttribute:y}));default:return i().createElement(P,te({values:T,attributeType:r,max:g,paging:u,crosswalks:a,drawLines:o,requestNextPageOfAttributeValues:C,showNonOv:f,nonVisibleValues:A},Z))}})()})),ne={requestNextPageOfAttributeValues:a.N5.actions.requestNextPageOfAttributeValues,onDeactivateError:a.N5.errors.actions.errorDeactivated},ae=(0,n.connect)(((e,t)=>{let{parentUri:r,attributeType:n,max:o}=t;return{errors:a.ZP.selectors.getActiveErrorsForAttributesPager(e,r,n),errorMessage:(0,l.tQX)(r,n,a.ZP.selectors.getProfileErrors(e)),max:o||a.ZP.selectors.getDefaultMaxValues(e)}}),ne)(re)},40130:(e,t,r)=>{r.d(t,{y:()=>n});const n=(0,r(72342).makeStyles)((e=>({caption:{fontSize:"0.7rem",opacity:.54},wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start",position:"relative"},description:{marginRight:"-9px"},attributesWrapper:{width:"100%",marginBottom:"10px"},link:{display:"flex",marginTop:4},"svg-icon__root":{fontSize:"1rem"},title:{fontSize:"12px",lineHeight:"14px",paddingLeft:"12px",color:e.palette.text.secondary},typeError:{marginLeft:"12px"},ovIcon:{marginLeft:"8px",marginTop:"-1px",textIndent:0},titleWrapper:{flex:1,paddingBottom:"3px"}})))},38328:(e,t,r)=>{r.d(t,{Z:()=>S});var n=r(24328),a=r.n(n),l=r(50914),o=r(13980),i=r.n(o),s=r(71153),c=r.n(s),u=r(2507),p=r.n(u),m=r(17512),d=r(38677),g=r(6163),b=r(79312),f=r(40435),h=r(85777),y=r(93555),x=r(76141),v=r(50548),E=r(43460),w=r(40941);const O=(0,r(72342).makeStyles)((e=>({complexWrapper:{position:"relative"},editor:{display:"flex",flex:1,height:"36px",alignItems:"center"},label:{flex:1,marginLeft:"2px",marginTop:"2px",fontSize:"13px",lineHeight:"15px"},actions:{display:"flex",alignItems:"center"},titleContainer:{display:"flex",flex:1,minHeight:"20px"},expandButton:{marginTop:"2px"},deleted:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary},errorWrapperHelperText:{marginLeft:0}})));function C(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const N=e=>{let{label:t,attributeTypesList:r,attributeType:l,attributeValue:o,children:i,errors:s,ownError:u,mode:v,metadata:E,crosswalks:C,lazy:N,showEmptyEditors:S,onAddOneMore:k,onAddAttributes:T,onDeleteAttribute:A,onChangeAttribute:Z,additionalControlsRenderer:P,hideDeleteButton:j,state:I,showNonOv:D,isHighlightedPath:V,highlightedError:L,expanded:R=!1}=e;const U=O(),M="deleted"===I,_="edited"===I,z=o.uri,B=(0,m.ZiX)(z),F=B||R,[H,q]=(0,n.useState)(F),{ref:W,errorClassName:$}=(0,w.B)({highlightedError:L});(0,n.useEffect)((()=>{V&&q(!0)}),[V]),(0,n.useEffect)((()=>{q(F)}),[F]);const Y=(0,n.useMemo)((()=>(0,m.xv5)({attributeType:l,attributeValue:o,mode:v,metadata:E,isReltioCrosswalk:(0,m.KVV)(C,o)})),[l,o,v,E,C]),X=!M&&!j&&!!A&&Y,G=(0,n.useMemo)((()=>(0,m.J6q)(o,s)),[s,o]);(0,n.useEffect)((()=>{G&&q(!0)}),[s,G]),(0,n.useEffect)((()=>{M&&q(!1)}),[M]);const K=(r||[]).some((e=>(0,m.kQw)(e))),J=(0,n.useMemo)((()=>({attributes:K?null:o.value,analyticsAttributes:K?o.value:null})),[o,K]),Q=(0,m.e$p)(u)||G&&p().text("Has an incorrect value")||"";return N?a().createElement(d.Z,{variant:"text",color:"primary",onClick:k},"Create attribute"):a().createElement("div",{ref:W,className:c()(U.complexWrapper,$)},a().createElement("div",{className:U.editor},a().createElement("div",{className:U.titleContainer},a().createElement(h.Z,{onClick:()=>q((e=>!e)),expanded:H,className:U.expandButton,disabled:M}),a().createElement(y.Z,{errorMessage:Q,classes:{helperText:U.errorWrapperHelperText}},a().createElement("div",{className:c()(U.label,{[U.deleted]:M}),"data-reltio-id":"reltio-attribute-complex-label"},t))),a().createElement("div",{className:U.actions},_&&a().createElement(b.Z,{variant:"caption",className:U.editedLabel},"(",p().text("edited"),")"),P&&P({attributeType:l,attributeValue:o}),X&&a().createElement(f.Z,{icon:g.Z,onClick:()=>A({uri:z,attributeType:l,attributeValue:o}),size:"L","data-reltio-id":"reltio-delete-complex-attribute-button"}))),H&&a().createElement(x.Z,{parentAttributeType:l,attrTypes:r,entity:J,showEmptyEditors:S||B,drawLines:!0,parentUri:z,mode:v,crosswalks:C,onAddAttributes:T,onChangeAttribute:Z,onDeleteAttribute:A,additionalControlsRenderer:P,showNonOv:D},i))};N.propTypes=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){C(e,t,r[t])}))}return e}({label:i().string,children:i().node,attributeTypesList:i().arrayOf(m.EMD),attributeValue:i().oneOfType([m.dMV,m.Rtp]),highlightedError:i().object,isHighlightedPath:i().bool},m.KVe);const S=(0,v.l)(E.NY,((e,t)=>{let{attributeValue:r}=t;const{element:n,type:a}=e||{},o=(0,E.Ie)(a);return{highlightedError:o&&(null==n?void 0:n.uri)===r.uri?e:null,isHighlightedPath:o&&(0,l.pipe)((0,l.propOr)([],"path"),(0,l.any)((0,l.pathEq)(["value","uri"],r.uri)))(n)}}),N)},54255:(e,t,r)=>{r.d(t,{Z:()=>b});var n=r(52730),a=r(50673),l=r(24328),o=r.n(l),i=r(13980),s=r.n(i),c=r(76141),u=r(17512);const p=e=>e&&e.attributes,m=e=>{let{entity:t,entityType:r,attributeTypesSelectionStrategy:n=p,mode:a,onAddAttributes:i,onDeleteAttribute:s,onChangeAttribute:u}=e;const m=(0,l.useMemo)((()=>n(r)),[n,r]);return t?o().createElement(c.Z,{key:t.uri,attrTypes:m,entity:t,showEmptyEditors:!0,drawLines:!0,parentUri:t.uri,mode:a,crosswalks:t.crosswalks,onAddAttributes:i,onChangeAttribute:u,onDeleteAttribute:s}):null};m.propTypes={entityUri:s().string,parentUri:s().string,entity:s().object,entityType:s().object,attributeTypesSelectionStrategy:s().func,mode:u.XGc,onAddAttributes:s().func,onDeleteAttribute:s().func,onChangeAttribute:s().func};const d=m,g={onAddAttributes:a.N5.actions.addAttributes,onDeleteAttribute:a.N5.actions.removeAttribute,onChangeAttribute:a.N5.actions.modifyAttribute},b=(0,n.connect)(((e,t)=>({entity:t.entityUri&&a.ZP.selectors.getModifiedEntity(e,t.entityUri)})),g)(d)},72283:(e,t,r)=>{r.d(t,{Z:()=>X});var n=r(24328),a=r.n(n),l=r(13980),o=r.n(l),i=r(2507),s=r.n(i),c=r(50914),u=r(17512),p=r(84425),m=r(95341),d=r(96379),g=r(40007),b=r(72342);const f=(0,b.makeStyles)({entityContainer:{display:"flex",alignItems:"center",height:"32px",minHeight:"32px",padding:0},entityLabel:{height:"15px",fontSize:"13px",color:"rgba(0,0,0,0.87)",cursor:"pointer",lineHeight:"15px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},emptyEntityLabel:{height:"15px",fontSize:"13px",color:"rgba(0,0,0,0.6)",lineHeight:"15px",marginLeft:"16px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",cursor:"default"},entityAvatar:{transform:"scale(0.5)",marginLeft:"8px",marginRight:"11px"},entitySecondaryLabel:{color:"rgba(0,0,0,0.6)"}}),h=(0,b.makeStyles)((e=>({singleValue:{color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",paddingTop:"18px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},linkValue:{cursor:"pointer",color:e.palette.primary.main,textDecoration:"none",pointerEvents:"all"}}))),y=(0,b.makeStyles)((e=>({addLabel:{color:e.palette.primary.main,display:"flex",fontWeight:"500",cursor:"pointer",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},groupHeading:{fontSize:"13px",height:"36px",padding:"0 16px",display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0.03)"},addIcon:{height:"18px",width:"18px",padding:"0 9px"}}))),x=(0,b.makeStyles)({clearIcon:{cursor:"pointer",height:"20px",width:"20px"}});function v(){return v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},v.apply(this,arguments)}const E=e=>{let{innerRef:t,innerProps:r,selectOption:n,data:l}=e;const o=f(),{uri:i,entityType:c,label:u,secondaryLabel:p}=l;return""!==i?a().createElement(m.Z,v({className:o.entityContainer,ref:t,key:i,onClick:()=>n({label:u,uri:i,entityType:c})},r),a().createElement(d.Z,{className:o.entityAvatar,entityType:c}),a().createElement(g.Z,{value:`${u}${p?", "+p:""}`},a().createElement("span",{className:o.entityLabel},u,p&&a().createElement("span",{className:o.entitySecondaryLabel},", ",p)))):a().createElement(m.Z,v({className:o.entityContainer,ref:t,key:i},r,{disabled:!0}),a().createElement("span",{className:o.emptyEntityLabel},s().text("No results found")))};E.propTypes={innerRef:o().oneOfType([o().oneOf([null]),o().func,o().shape({current:o().any.isRequired})]),innerProps:o().object.isRequired,selectOption:o().func.isRequired,data:o().shape({uri:o().string.isRequired,label:o().string.isRequired,entityType:u.pyR.isRequired})};const w=E;var O=r(71153),C=r.n(O),N=r(52730),S=r(50673),k=r(79312),T=r(63532),A=r(98074);const Z=e=>{const{selectProps:{currentEntityType:t,menuIsOpen:r,disableLinkClick:l},children:o,data:i}=e,p=h(),m=(0,N.useDispatch)(),d=(0,n.useContext)(T.m),{generateEntityUrl:g}=(0,n.useContext)(A.v),b=(0,N.useSelector)(S.ZP.selectors.getUIPath),f=(0,u.ZiX)(i.entityUri)?{className:p.singleValue,component:"span"}:{className:C()(p.singleValue,p.linkValue),onMouseDown:e=>{e.stopPropagation(),l||(0,c.pipe)((0,c.always)({uri:i.entityUri,viewId:d}),S.ui.actions.openEntity,m)()},onClick:e=>e.preventDefault(),href:g({uiPath:b,uri:i.entityUri}),component:"a"};return!r&&a().createElement(k.Z,f,(0,u.ZiX)(i.entityUri)?s().text(`New ${t.label} will be created`):(0,u.idV)(o))};Z.propTypes={children:o().string,data:o().object.isRequired,selectProps:o().object.isRequired};const P=Z;var j=r(54675),I=r(87037);const D=e=>{const{selectProps:{onClear:t}}=e,r=x();return a().createElement(I.Z,{onClick:t,size:"large"},a().createElement(j.Z,{className:r.clearIcon}))};D.propTypes={selectProps:o().object.isRequired};const V=D;var L=r(54255),R=r(79573),U=r(81997),M=r(93553);const{Group:_}=U.F,z=e=>{const{selectProps:{inputValue:t,onCreate:r},data:n,children:l}=e,o=y();return a().createElement(_,e,a().createElement("div",{className:o.groupHeading},a().createElement("span",null,n.label),r&&a().createElement("span",{onClick:()=>r(t,n.entityType),className:o.addLabel},a().createElement(M.Z,{className:o.addIcon}),s().text(`Create ${t?`"${t}" as `:""}new ${n.label}`))),l)};z.propTypes={selectProps:o().object.isRequired,data:o().object,children:o().array};const B=z,F=(0,b.makeStyles)({creatorWrapper:{marginTop:"20px"}});function H(){return H=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},H.apply(this,arguments)}function q(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function W(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){$(e,t,r[t])}))}return e}function $(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Y=e=>{let{entity:t={},entityTypesUris:r=[],mode:l,max:o,onChange:i,onCreate:m,metadata:d,globalSearchRequestOptions:g,attributeTypesSelectionStrategy:b,disableLinkClick:f=!1}=e,h=q(e,["entity","entityTypesUris","mode","max","onChange","onCreate","metadata","globalSearchRequestOptions","attributeTypesSelectionStrategy","disableLinkClick"]);const y=F(),[x,v]=(0,n.useState)(""),E=(0,n.useMemo)((()=>r.map((e=>(0,u.nt9)(d,e))).filter(u.oDv)),[r,d]),O=W({},g,{max:o}),C=m?(e,t)=>{m(t||r[0],e),v("")}:void 0,N=e=>{null!==e&&(v(""),i(e))},S=(0,n.useMemo)((()=>1!==E.length),[E]),k=((0,c.isEmpty)(t)?E[0]:(0,u.nt9)(d,t.entityType))||{},T=m&&s().text(`Create ${x?`"${x}" as `:""}new ${k.label}`),A=s().text(`Select ${1===E.length?`${E[0].label} `:""}profile`),Z=!(0,c.isEmpty)(t)&&(0,u.ZiX)(t.entityUri),j=S?{Group:B,GroupHeading:R.Vd}:{},I=Z?{ClearIndicator:V}:{},{TextFieldProps:D}=h,U=q(h,["TextFieldProps"]),M=(0,n.useMemo)((()=>W({},D||{},{"data-reltio-id":"reltio-entity-selector"})),[D]);return a().createElement(a().Fragment,null,a().createElement(p.Z,H({value:(0,c.isEmpty)(t)?void 0:t,inputValue:x,onInputChange:e=>{v(e)},getOptions:e=>(0,u.U10)(E,e,O).then(((e,t)=>r=>{const n=r.map((t=>W({},t,{label:(0,u.idV)(t.label),entityType:e.find((e=>{let{uri:r}=e;return r===t.type}))}))),a=e=>(0,c.isEmpty)(e)?[{label:"",uri:"",entityType:{}}]:e,l=t?e:e.filter((e=>n.some((t=>t.type===e.uri))));return l.length>1?l.map((e=>({label:e.label,entityType:e.uri,options:a(n.filter((t=>t.type===e.uri)))}))):a(n)})(E,m)),getOptionLabel:(0,c.prop)("entityLabel"),onChange:N,onCreate:C,onClear:()=>{N({})},label:A,createLabel:T,components:W({Option:w,SingleValue:P},j,I),currentEntityType:k,isClearable:!0,disableLinkClick:f,TextFieldProps:M},U)),Z&&a().createElement("div",{className:y.creatorWrapper},a().createElement(L.Z,{mode:l,attributeTypesSelectionStrategy:b,entityType:k,entityUri:t.entityUri})))};Y.propTypes={entity:u.oZZ,entityTypesUris:o().arrayOf(o().string),max:o().number,mode:u.XGc,dispatch:o().func,metadata:u.pGS,onChange:o().func.isRequired,onCreate:o().func,attributeTypesSelectionStrategy:o().func,globalSearchRequestOptions:o().object,disableLinkClick:o().bool};const X=Y},66078:(e,t,r)=>{r.d(t,{Z:()=>Y});var n=r(24328),a=r.n(n),l=r(52730),o=r(18169),i=r(50673),s=r(17512),c=r(26729),u=r(22349),p=r(40435),m=r(2507),d=r.n(m),g=r(83422),b=r(69089),f=r(79312),h=r(87378),y=r(12115),x=r(60769),v=r(38677),E=r(72342);const w=(0,E.makeStyles)((e=>({root:{width:"328px"},paper:{width:"100%",height:"40px",display:"flex",alignItems:"center",boxShadow:"none",backgroundColor:"rgba(0,0,0,0.03)"},inputRoot:{flex:1},input:{padding:"0 12px",fontSize:"14px","&:placeholder":{color:e.palette.text.secondary}},errorMessage:{marginTop:"8px",fontSize:"12px",color:e.palette.error.main}}))),O=e=>0===e.trim().length,C=e=>{let{onSend:t}=e;const r=w(),[l,o]=(0,n.useState)(""),[i,s]=(0,n.useState)(null);return a().createElement(g.Z,{className:r.root},a().createElement(y.Z,{className:r.paper},a().createElement(x.ZP,{value:l,onChange:e=>{const t=e.target.value,r=new RegExp(/^(ftp|http|https):\/\/[^ "]+$/).test(t);o(t),r||O(t)?s(null):s(d().text("URL is not correct"))},classes:{root:r.inputRoot,input:r.input},placeholder:d().text("Paste an image URL here")}),a().createElement(v.Z,{disabled:Boolean(i)||O(l),variant:"outlined",color:"primary",onClick:()=>{t(l),o(""),s(null)}},d().text("Send"))),i&&a().createElement(f.Z,{className:r.errorMessage},i))};var N=r(71153),S=r.n(N),k=r(13896),T=r(83997);const A=["image/png","image/jpeg","image/tiff","image/gif","image/bmp"],Z=e=>{let{className:t,onAppendFile:r}=e;return a().createElement(a().Fragment,null,a().createElement("input",{onInput:e=>{r&&r(e.currentTarget.files[0])},style:{display:"none"},accept:A.join(","),id:"upload-image-button","data-reltio-id":"upload-image-button",type:"file"}),a().createElement("label",{htmlFor:"upload-image-button"},a().createElement(v.Z,{className:t,variant:"contained",color:"primary",component:"span"},d().text("Select image"))))};function P(){return P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},P.apply(this,arguments)}const j=e=>a().createElement("svg",P({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),a().createElement("defs",null,a().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__c"},a().createElement("stop",{stopColor:"#FFF",offset:"0%"}),a().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),a().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__d"},a().createElement("stop",{stopColor:"#FFF",offset:"0%"}),a().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),a().createElement("linearGradient",{x1:"67.572%",y1:"54.952%",x2:"15.212%",y2:"13.907%",id:"UploadIcon_svg__e"},a().createElement("stop",{stopColor:"#000",stopOpacity:0,offset:"0%"}),a().createElement("stop",{stopColor:"#000",offset:"100%"})),a().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__f"},a().createElement("stop",{stopColor:"#B8EDFF",offset:"0%"}),a().createElement("stop",{stopColor:"#53ACDE",offset:"100%"})),a().createElement("circle",{id:"UploadIcon_svg__a",cx:128,cy:128,r:128})),a().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a().createElement("mask",{id:"UploadIcon_svg__b",fill:"#fff"},a().createElement("use",{xlinkHref:"#UploadIcon_svg__a"})),a().createElement("use",{fillOpacity:.1,fill:"#0072CE",xlinkHref:"#UploadIcon_svg__a"}),a().createElement("g",{mask:"url(#UploadIcon_svg__b)"},a().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(-1 9)"},a().createElement("path",{d:"M0 107.268c0 35.579 28.703 64.409 64.173 64.409h139.021c29.578 0 53.497-24.035 53.497-53.635 0-28.356-21.935-51.562-49.705-53.515C199.577 27.705 167.2 0 128.346 0 97.425 0 70.59 17.582 57.171 43.274 25.027 46.767 0 74.117 0 107.268z",fill:"#FFF",opacity:.3}),a().createElement("ellipse",{fill:"url(#UploadIcon_svg__c)",opacity:.4,cx:64.553,cy:107.664,rx:61.43,ry:62.336}),a().createElement("path",{d:"M127.979 8.91c38.773 0 70.206 31.895 70.206 71.24 0 39.346-31.433 71.241-70.206 71.241-6.067 0-11.954-.78-17.57-2.249 9.688-11.019 15.574-25.551 15.574-41.478 0-33.7-26.352-61.153-59.286-62.299C78.714 23.611 101.654 8.91 127.98 8.91z",fill:"url(#UploadIcon_svg__d)",opacity:.4})),a().createElement("path",{fill:"url(#UploadIcon_svg__e)",opacity:.12,d:"M82.093 128.474l38.374 37.966-10.666 18.958 72.714 71.94 63.578-57.537v-6.11l-71.107-70.352H97.22z",transform:"translate(-1 9)"}),a().createElement("path",{fill:"url(#UploadIcon_svg__f)",d:"M151.004 128.29v57.591h-40.836V128.29H81l49.5-49.409L180 128.29z",transform:"translate(-1 9)"})))),I=(0,E.makeStyles)((e=>({root:{padding:"36px 0 29px"},isActive:{backgroundColor:"rgba(0,114,206,0.12)"},icon:{width:"190px",height:"190px",marginBottom:"24px"},title:{marginBottom:"8px",color:e.palette.text.primary,fontSize:"20px",fontWeight:500,lineHeight:"24px"},description:{marginBottom:"24px",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"16px"}}))),D=e=>{let{onAppendFile:t,className:r}=e;const n=I(),[{canDrop:l,isOver:o},i]=(0,k.useDrop)({accept:[T.FILE],drop:e=>{e&&t(e.files[0])},collect:e=>({isOver:e.isOver(),canDrop:e.canDrop()})}),s=l&&o;return a().createElement("div",{ref:i,className:S()(n.root,{[n.isActive]:s},r)},a().createElement(j,{className:n.icon}),a().createElement(f.Z,{className:n.title},d().text("Drag an image here")),a().createElement(f.Z,{className:n.description},d().text("Acceptable image types would include JPG, PNG, TIFF, GIF, BMP. Maximum image size: ${MAX_IMAGE_SIZE}Mb",{MAX_IMAGE_SIZE:20})),a().createElement(Z,{onAppendFile:t}))},V=(0,E.makeStyles)((e=>({root:{width:"100%",display:"flex",alignItems:"center",padding:"0 30px",boxSizing:"border-box"},border:{borderBottom:`1px solid ${e.palette.text.primary}`,flex:1,opacity:.12},text:{padding:"0 10px",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"16px"}}))),L=e=>{let{children:t,className:r}=e;const n=V();return a().createElement(g.Z,{className:S()(n.root,r)},a().createElement(g.Z,{className:n.border}),a().createElement(f.Z,{className:n.text},t),a().createElement(g.Z,{className:n.border}))};var R=r(92679),U=r(10050),M=r(39475);const _=(0,E.makeStyles)({closeIcon:{color:"#fff"}}),z=e=>{let{error:t,onClose:r}=e;const n=_();return a().createElement(U.Z,{open:Boolean(t),onClose:r,message:t,action:a().createElement(M.k,{className:n.closeIcon,tooltipTitle:d().text("Close"),icon:R.default,onClick:r})})},B=(0,E.makeStyles)((e=>({root:{},dialogPaper:{position:"relative",maxWidth:"480px"},title:{color:e.palette.text.primary,fontSize:"20px",fontWeight:500,letterSpacing:"0.25px",lineHeight:"24px",padding:"16px"},body:{display:"flex",flexDirection:"column",alignItems:"center",padding:"0 8px 49px",textAlign:"center"},targetBox:{marginBottom:"8px"},divider:{marginBottom:"28px"}})));var F=r(30936);const H=e=>{let{open:t,onClose:r,onUpload:o}=e;const c=B(),u=(0,l.useSelector)(i.ZP.selectors.getImageServicePath),p=(0,l.useSelector)(i.ZP.selectors.getEnvironment),m=(0,l.useSelector)(i.ZP.selectors.getTenant),[y,x]=(0,n.useState)(!1),[v,E]=(0,n.useState)(null),w=e=>{x(!0),(0,s.Ixr)({image:e,imageServicePath:u,environment:p,tenant:m}).then((e=>{o(e),r()})).catch((e=>{E((0,s.xU7)(e,d().text("Something went wrong")))})).finally((()=>x(!1)))};return a().createElement(F.l,null,a().createElement(b.Z,{open:t,onClose:r,classes:{paper:c.dialogPaper}},a().createElement(f.Z,{className:c.title},d().text("Add new image")),a().createElement(g.Z,{className:c.body},a().createElement(D,{className:c.targetBox,onAppendFile:e=>{if(!e)return E(d().text("No image selected."));const t=Number((e.size/1024/1024).toFixed(2)),r=A.includes(e.type);t>20?E(d().text("File size exceeds configured max file size.")):r?w(e):E(d().text("File format is not supported."))}}),a().createElement(L,{className:c.divider},d().text("or")),a().createElement(C,{onSend:e=>{w(e)}})),y&&a().createElement(h.Z,null),a().createElement(z,{error:v,onClose:()=>E(null)})))};var q=r(43253),W=r(91446);const $=(0,E.makeStyles)((()=>({root:{width:"100%",marginBottom:"10px"},image:e=>{let{imageMargin:t}=e;return{marginRight:t,cursor:"pointer","&:last-child":{marginRight:0}}},uploadContainer:e=>{let{imageMargin:t,imageWidth:r,imageHeight:n}=e;return{backgroundColor:"white",width:r,height:n,cursor:"pointer",border:"1px dashed #0072CE",boxSizing:"border-box",marginRight:t,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},uploadButton:{width:"50px",height:"50px"},uploadIcon:{fontSize:"36px"}}))),Y=e=>{let{attributeType:t={},attributeValues:r=[],onDeleteAttribute:m,onChangeAttribute:d,requestNextPageOfAttributeValues:g,parentUri:b,paging:f,showNonOv:h,imageSize:y=W.By}=e;const x=$(y),v=(0,l.useSelector)(i.ZP.selectors.getEntity)||{},E=(0,l.useSelector)((e=>i.ZP.selectors.getModifiedEntityDefaultProfilePic(e,v.uri))),w=(0,l.useDispatch)(),[O,C]=(0,n.useState)(!1),N=(0,n.useCallback)((()=>{C((e=>!e))}),[]),S=(0,n.useCallback)((e=>{const r=(0,s.hm5)(b,t.name),n={};for(const a in e){const l=(t.attributes||[]).find((e=>{let{name:t}=e;return t===a}));l&&(n[a]=[{uri:(0,s.hm5)(r,l.name),ov:!0,value:e[a],type:l.uri}])}d({attributeType:t,uri:r,value:n})}),[d,b,t]),k=(0,n.useCallback)((e=>{if(m(e),E===e.uri){var t;const n=(null===(t=r[0])||void 0===t?void 0:t.uri)===e.uri?r[1]:r[0];w(i.N5.modifiedEntities.actions.setDefaultProfilePic({entityUri:v.uri,value:n||{}}))}}),[m,v,E,r]),T=(e,r)=>{const{onOpenImageGalleryDialog:n,onDownload:l,onShareLink:o,onSetAsDefault:i}=e,c=(0,s.Q5d)(r),{uri:p}=r;return a().createElement(u.Z,{id:p,onShareLink:()=>o(c),onSetAsDefault:()=>i(r),onDelete:()=>k({uri:p,attributeType:t}),onDownload:()=>l([c]),onClick:()=>n(p)})};return a().createElement("div",{className:x.root},a().createElement(q.Z,{attributeValues:r,attributeType:t,renderImage:e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=(0,s.efz)(t),{uri:n}=t,{onOpenImageGalleryDialog:l}=e;return a().createElement("div",{className:x.image,key:n},a().createElement(c.Z,{src:r,overlay:T(e,t),onClick:()=>l(n),size:{imageWidth:y.imageWidth,imageHeight:y.imageHeight},"data-reltio-id":"reltio-attribute-value"}))},overlay:!0,countFixedItems:1,onUpload:N,onDeleteAttribute:k,imageSize:y,requestNextPageOfAttributeValues:g,paging:f,parentUri:b,showNonOv:h},a().createElement("div",{className:x.uploadContainer,onClick:N},a().createElement(p.Z,{className:x.uploadButton,iconClassName:x.uploadIcon,icon:o.Z}))),a().createElement(H,{open:O,onUpload:S,onClose:N}))}},67283:(e,t,r)=>{r.d(t,{Z:()=>k});var n=r(24328),a=r.n(n),l=r(38677),o=r(35488),i=r(79312),s=r(71153),c=r.n(s),u=r(50914),p=r(2507),m=r.n(p),d=r(33117),g=r(22311),b=r(93553),f=r(94792),h=r(26638),y=r(63485),x=r(17512),v=r(41008);const E=(0,u.curry)(((e,t)=>(0,u.filter)((t=>(t.label||t.name).toLowerCase().includes(e.toLowerCase())))(t))),w=e=>{let{attrTypes:t,filter:r="",sortingFn:n}=e;return(0,u.pipe)(E(r),(0,u.sort)(n),(0,u.map)((e=>({item:{id:e.uri,label:e.label||e.name,attrType:e}}))))(t)};var O,C=r(50673),N=r(52730);!function(e){e.parent="parent",e.attributes="attributes"}(O||(O={}));const S=(0,r(72342).makeStyles)({moreAttributes:{display:"flex",paddingBottom:"6px","&$dense":{padding:0}},dense:{},popupContainer:{},moreAttributesPopup:{"&$popupContainer":{}},moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},subHeader:{backgroundColor:"rgb(245, 245, 245)",padding:"0 16px",margin:0,display:"flex",alignItems:"center",color:"rgba(0,0,0,0.84)",fontSize:"14px",fontWeight:500},noResultsCaptionContainer:{position:"absolute",top:0,bottom:0,left:0,right:0,display:"flex",justifyContent:"center",alignItems:"center"}}),k=e=>{let{label:t,popupTitle:r=t,data:s,parent:p,dense:E,onApply:k}=e;const T=S(),A=(0,n.useRef)(),[Z,P]=(0,n.useState)(!1),[j,I]=(0,n.useState)(""),[D,V]=(0,n.useState)([]),{items:L,hasGroups:R,parentGroupLength:U,attributesGroupLength:M}=(e=>{let{data:t,parent:r,filter:a}=e;const l=Boolean(r),o=(0,N.useSelector)(C.ZP.selectors.getAttributesSortingStrategy),i=(0,n.useMemo)((()=>o===x.PYu.ASC_BY_NAME?(e,t)=>{var r;return null==e||null===(r=e.label)||void 0===r?void 0:r.localeCompare(null==t?void 0:t.label)}:(e,t)=>0),[o]),s=(0,n.useMemo)((()=>l?w({attrTypes:[r],filter:a,sortingFn:i}):[]),[l,r,a,i]),c=(0,n.useMemo)((()=>l&&null!=s&&s.length?[{item:{id:O.parent,label:m().text("Parent")},items:s}]:[]),[l,s]),u=(0,n.useMemo)((()=>w({attrTypes:t,filter:a,sortingFn:i})),[t,a,i]),p=(0,n.useMemo)((()=>l&&null!=u&&u.length?[{item:{id:O.attributes,label:m().text("Attributes")},items:u}]:u),[l,u]),d=(0,n.useMemo)((()=>(0,v.LG)((c||[]).concat(p))),[c,p]),g=c.length,b=p.length;return{items:d,hasGroups:l,parentGroupLength:g,attributesGroupLength:b}})({data:s,parent:p,filter:j}),_=(0,n.useCallback)(((e,t)=>{V((0,u.ifElse)((0,u.always)(t),(0,u.append)(e),(0,u.reject)((0,u.propEq)("id",e.id)))(D))}),[D]),z=(0,n.useCallback)(((e,t)=>t.items?40:28),[]),B=(0,n.useCallback)((e=>{let{item:t}=e;_(t,(0,u.not)((0,u.any)((0,u.propEq)("id",t.id))(D)))}),[_,D]),{focusIndex:F,handleKeyDown:H}=(0,h.t)({items:L,open:Z,onSelectFocusedItem:B,selectedItems:D}),q=(0,n.useRef)(null);q.current=F;const W=R?(U?1:0)+(M?1:0):0,$=L.length-W,Y=Math.min(255,28*$+40*W),X=Math.max(140,Y+112),G=(0,n.useCallback)(((e,t,r)=>{var n;let{item:l,level:o=0}=t;const i=(0,u.any)((0,u.propEq)("id",l.id))(D),s=q.current===r;return a().createElement(d.Z,{key:l.uri,onClick:_,checked:i,level:o,data:l,label:a().createElement(f.Z,{text:l.label,highlight:j}),labelInText:l.label,style:e,isFocused:s,isRequired:!(null===(n=l.attrType)||void 0===n||!n.required),LogoIcon:l.LogoIcon})}),[j,_,D]),K=(0,n.useCallback)(((e,t)=>a().createElement(o.ZP,{component:"div",className:T.subHeader,style:e,key:`group-${t.item.id}`},t.item.label)),[]);return a().createElement("div",{className:c()(T.moreAttributes,{[T.dense]:E})},a().createElement(l.Z,{color:"primary",onClick:()=>P(!Z),ref:A,className:T.moreButton},a().createElement(b.Z,{classes:{root:T.icon}}),a().createElement("div",{className:T.buttonLabel},t)),a().createElement(g.Z,{open:Z,className:c()(T.moreAttributesPopup,T.popupContainer),anchorEl:A.current,onClose:(0,u.pipe)((()=>{D.length>0&&k((0,u.pluck)("attrType",D))}),(()=>P(!1)),(()=>I("")),(()=>V([]))),onSearch:I,containerHeight:X,title:r,containerWidth:320,searchInputOnKeyDown:H},a().createElement(y.Z,{getItemSize:z,renderItem:G,renderGroupTitle:K,items:L,height:Y,focusIndex:F}),0===L.length&&a().createElement("div",{className:T.noResultsCaptionContainer},a().createElement(i.Z,{variant:"caption",display:"block",gutterBottom:!0},m().text("No results found")))))}},3853:(e,t,r)=>{r.d(t,{Z:()=>c});var n=r(24328),a=r.n(n),l=r(17512),o=r(38328);function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i.apply(this,arguments)}const s=e=>{const{attributeValue:t,attributeType:r}=e,n=(0,l.Kxm)(t,r.dataLabelPattern);return a().createElement(o.Z,i({label:(0,l.idV)(n),attributeTypesList:r.attributes||r.analyticsAttributes},e))};s.propTypes=l.j2V;const c=(0,n.memo)(s)},10768:(e,t,r)=>{r.d(t,{Z:()=>S});var n=r(52730),a=r(50673),l=r(24328),o=r.n(l),i=r(13980),s=r.n(i),c=r(71153),u=r.n(c),p=r(50914),m=r(17512),d=r(38328),g=r(72283),b=r(93555),f=r(50548),h=r(43460),y=r(40941);const x=(0,r(72342).makeStyles)({item:{marginBottom:"20px"},dense:{marginBottom:0}});function v(){return v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},v.apply(this,arguments)}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){w(e,t,r[t])}))}return e}function w(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const O=e=>{const t=x(),{modifiedEntity:r,metadata:n,globalSearchRequestOptions:a,onDeleteModifiedEntity:i,onUpdateModifiedEntity:s,onDeactivateError:c,highlightedError:f}=e,h=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["modifiedEntity","metadata","globalSearchRequestOptions","onDeleteModifiedEntity","onUpdateModifiedEntity","onDeactivateError","highlightedError"]),{attributeValue:w,attributeType:O,mode:C,crosswalks:N,errors:S,onChangeAttribute:k}=h,T=(0,l.useRef)(w),{ref:A,errorClassName:Z}=(0,y.B)({highlightedError:f,isSimple:!0}),P=(0,m.CZ8)(w),j=(0,m.o96)(w),I=(0,m.Poc)(O),D=(0,m.nt9)(n,I),V=r?(0,m.Kxm)(r,D.dataLabelPattern):w.label,L=(0,l.useMemo)((()=>[I]),[I]),R=(0,l.useMemo)((()=>(0,m.EtK)(N,j)),[N,j]),U=(0,l.useMemo)((()=>(0,m.mbo)(w,S)),[w,S]),M=(0,l.useMemo)((()=>P&&{entityUri:(0,m.ZTM)(P),entityType:(0,m.uGi)(P),entityLabel:w.label}),[P,w.label]),_=(0,l.useMemo)((()=>(0,m.tF$)(O).map((e=>(0,m.zeJ)(n,e))).filter(p.identity)),[O,n]),z=(0,l.useCallback)((e=>(0,m.ct9)(O,e)),[O]),B=(0,l.useCallback)((e=>{r&&i(r.uri);const t=T.current,n=!(0,p.isEmpty)(e)&&e.uri===(0,m.bwT)(t),a=E({},w,{label:e.label,refEntity:n?t.refEntity:(0,m.fmQ)(e),refRelation:n?t.refRelation:(0,m.NBq)(w)});k({value:a,attributeType:O,uri:w.uri}),U&&c((0,m.iFp)(U))}),[w,O,r,k,i,c,U]),F=(0,l.useCallback)(((e,t)=>{const r=(0,p.pipe)(z,(0,m._kX)(C))(D),a=(0,m.pBq)({entityTypeUri:e,initValue:t,attributeTypes:r,metadata:n,mode:C});B(a),s(a)}),[z,C,D,n,B,s]),H=(0,l.useMemo)((()=>(0,m.yv0)({attributeType:O,attributeValue:w,mode:C,isReltioCrosswalk:(0,m.KVV)(N,w)})),[O,w,C,N]),q=(0,l.useMemo)((()=>(0,m.d89)(C,D)),[C,D]),W=(0,m.e$p)(U);return o().createElement(d.Z,v({},h,{label:(0,m.idV)(V),attributeTypesList:_,crosswalks:R,metadata:n}),o().createElement("div",{ref:A,className:Z},o().createElement(b.Z,{errorMessage:W},o().createElement(g.Z,{className:u()(t.item,{[t.dense]:W||M&&(0,m.ZiX)(M.entityUri)}),entity:M||{},entityTypesUris:L,max:20,globalSearchRequestOptions:a,mode:C,isDisabled:!H,onChange:B,onCreate:q?F:void 0,metadata:n,attributeTypesSelectionStrategy:z}))))};O.propTypes=E({},m.NkU,{modifiedEntity:m.pyR,metadata:m.pGS,globalSearchRequestOptions:s().object,onDeleteModifiedEntity:s().func,onUpdateModifiedEntity:s().func,onDeactivateError:s().func,highlightedError:s().object});const C=(0,f.l)(h.NY,((e,t)=>{let{attributeValue:r,attributeType:n}=t;const{element:a,type:l}=e||{};return{highlightedError:(0,h.Ie)(l)&&(0,m.Wah)(a,r.uri,n.uri)?e:null}}),O),N={onDeleteModifiedEntity:a.N5.modifiedEntities.actions.entityDeleted,onUpdateModifiedEntity:a.N5.modifiedEntities.actions.entityCreated,onDeactivateError:a.N5.errors.actions.errorDeactivated},S=(0,n.connect)(((e,t)=>{const r=(0,m.bwT)(t.attributeValue);return{modifiedEntity:(0,m.ZiX)(r)?a.ZP.selectors.getModifiedEntity(e,r):null,metadata:a.ZP.selectors.getMetadata(e),globalSearchRequestOptions:a.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"])}}),N)(C)},13310:(e,t,r)=>{r.d(t,{Z:()=>L});var n=r(24328),a=r.n(n),l=r(13980),o=r.n(l),i=r(52730),s=r(71153),c=r.n(s),u=r(50914),p=r(93553),m=r(6163),d=r(79312),g=r(2507),b=r.n(g),f=r(17512),h=r(67586),y=r(51492),x=r(93555),v=r(40435),E=r(12980),w=r(67462),O=r(50673);function C(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){N(e,t,r[t])}))}return e}function N(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const S={},k=(e,t,r)=>{const n=O.ZP.selectors.getDependentLookupsStructureNode(e,r);if(n){const r=t.uri,{parents:o,missedParentsAttributeTypes:i}=((e,t,r)=>{var n;const a=r.parents.flatMap((t=>{const r=O.ZP.selectors.getDependentLookupsStructureNode(e,t);return r.values.map((e=>C({},e,{type:t,dependentLookupCode:r.attrType.dependentLookupCode})))})),l=O.ZP.selectors.getModifiedEntities(e),o=O.ZP.selectors.getEntityUri(e),i=O.ZP.selectors.getAllRelationsToAddAndEdit(e),s=O.ZP.selectors.getMetadata(e),c=(0,f.vUy)({parentValues:a,valueUri:t,entityUri:o,modifiedEntities:l,connections:i}),p=(0,u.pipe)(f.uDV,(0,u.defaultTo)([]),(0,u.map)((0,u.pipe)((0,u.path)(["valueType","uri"]),f.u5q)),(0,u.prepend)(null===(n=l[o])||void 0===n?void 0:n.type),(0,u.reject)(u.isNil),u.uniq)({entityUri:o,entitiesMap:l,connections:i,metadata:s},t),m=r.parents.filter((e=>p.some((0,f.sOy)(e)))).map((t=>O.ZP.selectors.getDependentLookupsStructureNode(e,t).attrType)).filter((e=>!c.some((t=>{let{type:r,value:n}=t;return n&&r===e.uri}))));return{parents:Object.values(c.reduce(((e,t)=>{var r;const n=(e=>`${e.type}_${(0,f.JBA)(e.uri)}`)(t);return C({},e,{[n]:{type:t.dependentLookupCode,codeValues:(0,u.uniq)([t.value,...(null===(r=e[n])||void 0===r?void 0:r.codeValues)||[]]).filter(Boolean).sort()}})}),{})).filter((e=>!!e.codeValues.length)),missedParentsAttributeTypes:m}})(e,r,n),{isBlocked:s=!1}=O.ZP.selectors.getDependentLookupEditorState(e,r)||{},c=(a=i).length?b().text("Please select value for ${labels} ${attributes}.",{labels:(l=a.map((0,u.pipe)((0,u.prop)("label"),(e=>`'${e}'`))),l.reduce(((e,t,r)=>[e,t].join(r===l.length-1?` ${b().text("and")} `:", ")))),attributes:1===a.length?b().text("attribute"):b().text("attributes")}):"",p=!(null!=t&&t.lookupCode||null!=t&&t.value),m=p&&s&&b().text("Populating values...")||p&&c||"",d={parents:c?null:o,disabled:!!c&&p||s,placeholder:m};return m&&(d.value=null),((e,t)=>{const r=S[e];return(0,u.equals)(t,r)?r:((0,u.equals)(null==r?void 0:r.parents,t.parents)&&(t.parents=r.parents),S[e]=t,t)})(r,d)}var a,l};var T=r(50548),A=r(80231),Z=r(51894),P=r(43460),j=r(40941);const I=(0,r(72342).makeStyles)((e=>({wrapper:{width:"100%"},errorWrapper:{alignSelf:"stretch"},editor:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px",position:"relative"},"editor-value":{flex:"1 1 auto"},"editor-read-only-value":{marginLeft:"12px",display:"flex",alignItems:"center"},"editor-actions":{display:"flex",alignItems:"center",paddingLeft:"8px"},addButton:{marginRight:"-8px"},button:{color:e.palette.text.secondary},placeholder:{height:"50px"},deleted:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary}})));function D(){return D=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},D.apply(this,arguments)}const V=e=>{let{className:t,attributeValue:r,attributeType:l,isReltioCrosswalk:o,ownError:s,mode:g,onAddOneMore:w,onDeleteAttribute:C,onChangeAttribute:N,onDeactivateError:S,additionalControlsRenderer:T,state:P,highlightedError:V,isEmptyEditor:L=!1}=e,R=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","attributeValue","attributeType","isReltioCrosswalk","ownError","mode","onAddOneMore","onDeleteAttribute","onChangeAttribute","onDeactivateError","additionalControlsRenderer","state","highlightedError","isEmptyEditor"]);const U=I(),M="deleted"===P,_="edited"===P,z=(0,f.KIu)(g),B=(0,f.Vg3)({attributeType:l,mode:g}),F=(0,f.yv0)({attributeType:l,attributeValue:r,mode:g,isReltioCrosswalk:o}),H=(0,f.xv5)({attributeType:l,attributeValue:r,mode:g,isReltioCrosswalk:o}),q=F&&z,W=(0,f.e$p)(s),$=(0,i.useSelector)((e=>(0,f.QEi)(l)?k(e,r,null==l?void 0:l.uri):null)),{ref:Y,errorClassName:X}=(0,j.B)({highlightedError:V,isSimple:!0});(0,n.useEffect)((()=>{L&&(0,f.QEi)(l)&&!(0,u.has)("lookupCode",r)&&N({attributeType:l,uri:r.uri,value:r.value,silent:!0})}),[L]);const G=(0,n.useMemo)((()=>(0,f.PFL)(l)),[l]),K=(0,n.useMemo)((()=>(0,E.AG)(r,G)),[r,G]),J=(0,n.useCallback)((()=>{s&&S((0,f.iFp)(s))}),[s,S]),Q=(0,n.useCallback)((0,u.pipe)((0,E.pp)(r,l),N,J),[r,l,N,J]),ee=!!w&&B&&!l.singleValue,te=!M&&!!C&&H,re=!!W,ne=M?{disabled:!0,isCrossedOut:!0}:{},ae=(0,n.useContext)(A.j),{autopopulationContextValue:le}=(e=>{let{enabled:t,attributeTypeUri:r,valueUri:a}=e;const l=(0,i.useDispatch)(),o=(0,i.useSelector)(O.ZP.selectors.getLookupAutocomplete),s=t&&(0,f.Vmh)(o,r),c=s?a:null,{isTouched:u=!1}=(0,i.useSelector)((e=>s&&O.ZP.selectors.getDependentLookupEditorState(e,a)))||{},p=(0,n.useCallback)((e=>{l(O.N5.dependentLookups.actions.dependentLookupsEditorTouched({uri:e,isTouched:!0}))}),[l]);return{autopopulationContextValue:(0,n.useMemo)((()=>c?{id:c,isTouched:u,onTouch:p}:null),[c,u,p])}})({enabled:ae&&(0,f.QEi)(l),attributeTypeUri:null==l?void 0:l.uri,valueUri:r.uri});return a().createElement("div",{ref:Y,className:c()(U.editor,t,X)},a().createElement(x.Z,{errorMessage:W,className:U.errorWrapper},a().createElement("div",{className:c()(U["editor-value"],{[U.deleted]:M},{[U["editor-read-only-value"]]:!q}),"data-reltio-id":"reltio-attribute-value"},q?a().createElement(Z.m.Provider,{value:le},a().createElement(y.Z,D({fieldName:(0,f.Tde)(l.uri),value:K,dataTypeDefinition:G,error:re,onChange:Q,fullWidth:!0},$,R,ne))):a().createElement(h.Z,{value:(0,f.kDl)(r),dataTypeDefinition:G}))),a().createElement("div",{className:U["editor-actions"]},_&&a().createElement(d.Z,{variant:"caption",className:U.editedLabel},"(",b().text("edited"),")"),ee&&a().createElement(v.Z,{icon:p.Z,onClick:w,size:"L",className:c()(U.addButton,U.button)}),T&&T({attributeType:l,attributeValue:r}),te&&a().createElement(v.Z,{className:U.button,icon:m.Z,onClick:()=>{C({uri:r.uri,attributeType:l}),(0,f.PcX)(s)!==f.NIO.missed&&J()},size:"L","data-reltio-id":"reltio-delete-simple-attribute-button"})))};V.propTypes={className:o().string,attributeValue:f.cNQ,attributeType:f.EMD,ownError:f.wfT,isReltioCrosswalk:o().bool,state:o().oneOf(["deleted","edited"]),mode:f.XGc,onAddOneMore:o().func,onDeleteAttribute:o().func,onChangeAttribute:o().func,onDeactivateError:o().func,additionalControlsRenderer:o().func,highlightedError:o().object,isEmptyEditor:o().bool};const L=(0,w.Z)((0,T.l)(P.NY,((e,t)=>{let{attributeValue:r}=t;const{element:n,type:a}=e||{};return{highlightedError:(0,P.Ie)(a)&&(null==n?void 0:n.uri)===r.uri?e:null}}),V),(()=>{const e=I();return a().createElement("div",{className:e.placeholder})}))},12980:(e,t,r)=>{r.d(t,{AG:()=>i,Ho:()=>s,pp:()=>c});var n=r(95038),a=r.n(n),l=r(17512),o=r(50914);const i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t}=arguments.length>1?arguments[1]:void 0;const{value:r,lookupCode:n}=e;switch(t){case l.oS0.TYPE_BOOLEAN:case l.oS0.TYPE_BOOLEAN_RADIO:case l.oS0.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,l.gxP)(r);case l.oS0.TYPE_DATE:return r&&l.P6Y.dates.toLocalDate(r)||null;case l.oS0.TYPE_LOCAL_DATE:case l.oS0.TYPE_TIMESTAMP:case l.oS0.TYPE_ACTIVENESS_DATE:return r&&new Date(r)||null;case l.oS0.TYPE_DEPENDENT_LOOKUP:case l.oS0.TYPE_LOOKUP:return{value:r,lookupCode:n};default:return r}},s=(e,t)=>{const{type:r}=(0,l.PFL)(e);switch(r){case l.oS0.TYPE_BOOLEAN:case l.oS0.TYPE_BOOLEAN_RADIO:case l.oS0.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t.toString();case l.oS0.TYPE_DATE:return t&&a()(t).format("YYYY-MM-DD")||"";case l.oS0.TYPE_TIMESTAMP:return t&&a()(t).format()||"";case l.oS0.TYPE_ACTIVENESS_DATE:case l.oS0.TYPE_LOCAL_DATE:return t&&t.valueOf();default:return t||""}},c=(0,o.curry)(((e,t,r)=>({value:s(t,r),uri:e.uri,attributeType:t})))},38583:(e,t,r)=>{r.d(t,{d:()=>a});var n=r(24328);const a=r.n(n)().createContext(null)},1108:(e,t,r)=>{r.d(t,{c:()=>a});var n=r(24328);const a=r.n(n)().createContext(null)},26978:(e,t,r)=>{r.d(t,{U:()=>l,A:()=>o});var n=r(50914),a=r(17512);const l=(e,t,r,l)=>{const o=(0,n.pipe)(a.nt9,(0,n.defaultTo)({}),(0,n.props)(["attributes","analyticsAttributes"]),(0,n.reject)(n.isNil),n.flatten,(0,n.concat)(n.__,(0,n.pipe)(n.values,(0,n.reject)((0,n.propEq)("uri",a.xPW.id.uri)))(a.xPW)))(e,t);return r.length?o.filter((e=>{let{uri:t}=e;return r.includes(t)})):o.filter((e=>{let{uri:t}=e;return!l.includes(t)}))},o=(e,t)=>(0,n.partition)((0,n.pipe)((0,n.path)(["attrType","uri"]),(0,n.includes)(n.__,e)),t)},31992:(e,t,r)=>{r.d(t,{Z:()=>u});var n=r(25661),a=r(55485),l=r(24328),o=r.n(l),i=r(2507),s=r.n(i),c=r(47608);const u=e=>{let{onClick:t}=e;const r=(0,c.y)();return o().createElement(a.Z,{component:"button",variant:"caption",className:r.link,onClick:t,underline:"none"},o().createElement(n.Z,{className:r["svg-icon__root"]}),s().text("Show less"))}},35039:(e,t,r)=>{r.d(t,{Z:()=>u});var n=r(85101),a=r(55485),l=r(24328),o=r.n(l),i=r(2507),s=r.n(i),c=r(47608);const u=e=>{let{moreNumber:t,valueNumber:r,onClick:l}=e;const i=(0,c.y)();return o().createElement(a.Z,{component:"button",variant:"caption",className:i.link,onClick:l,underline:"none"},o().createElement(n.Z,{className:i["svg-icon__root"]}),t&&r?s().text("Show ${moreNumber} more of remaining ${valueNumber} value",{moreNumber:t,valueNumber:r}):s().text("Show more"))}},47608:(e,t,r)=>{r.d(t,{y:()=>n});const n=(0,r(72342).makeStyles)({link:{display:"flex",marginTop:4},"svg-icon__root":{fontSize:"1rem"}})},11013:(e,t,r)=>{r.d(t,{Z:()=>c});var n=r(24328),a=r.n(n),l=r(17512),o=r(81489),i=r(88610),s=r(25257);const c=e=>{const{attributeType:t}=e;return class{static build(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(e.type){case l.oS0.TYPE_NESTED:return a().createElement(i.Z,t);case l.oS0.TYPE_REFERENCE:return a().createElement(s.Z,t);default:return a().createElement(o.Z,t)}}}.build(t,e)}},89978:(e,t,r)=>{r.d(t,{Z:()=>d});var n=r(24328),a=r.n(n),l=r(50914),o=r(17512),i=r(52239),s=r(94319),c=r(35039),u=r(31992),p=r(86602),m=r(26978);const d=(0,n.memo)((e=>{let{attrTypes:t,entity:r,parentUri:d,drawLines:g,children:b,className:f,max:h,alwaysVisibleTypeUris:y=p.S,showNonOv:x}=e;const[v,E]=(0,n.useState)(h||1/0),w=(0,n.useMemo)((()=>(0,o.fyF)(t,r,x)),[t,r,x]),[O,C]=(0,n.useMemo)((()=>(0,m.A)(y,w)),[w,y]),N=C.slice(0,v),S=h&&N.length<C.length,k=h&&N.length>=C.length&&h<N.length,T={enabled:g};return a().createElement("div",{className:f},b&&a().createElement(i.Z,T,b),N.concat(O).map((e=>{let{attrType:t,values:n}=e;return a().createElement(s.Z,{key:t.uri,attributeType:t,drawLines:g,values:n,paging:(0,l.path)(["paging",t.uri],r.attributes),parentUri:d,showNonOv:x})})),S&&a().createElement(c.Z,{onClick:()=>{E(1/0)}}),k&&a().createElement(u.Z,{onClick:()=>{E(h)}}))}))},94319:(e,t,r)=>{r.d(t,{Z:()=>Q});var n=r(52730),a=r(50673),l=r(71153),o=r.n(l),i=r(24328),s=r.n(i),c=r(50914),u=r(17512),p=r(72342);function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){d(e,t,r[t])}))}return e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const g="13px",b="15px",f={titleRow:{display:"block",minHeight:"16px"},title:{whiteSpace:"nowrap"},ovIcon:{marginLeft:"8px",marginRight:"-3px",marginTop:"-1px",textIndent:0},descriptionIcon:{marginTop:"-1px",textIndent:0,marginRight:"-10px"}},h=(0,p.makeStyles)({paddingWrapper:{paddingTop:"3px",paddingBottom:"5px","&:last-child":{paddingBottom:"2px"}},paddingWrapperWithLines:{paddingBottom:"1px","&:last-child":{paddingBottom:"2px"}}}),y=(0,p.makeStyles)(m({wrapper:{fontSize:g,lineHeight:b,flex:1},collaborationWrapper:{display:"flex",alignItems:"start",minHeight:"18px"},attribute:{marginLeft:"8px",paddingLeft:"4px",paddingRight:"4px",display:"inline",overflow:"hidden",whiteSpace:"pre-wrap",wordBreak:"break-word"},titleIcon:{width:"16px",height:"16px",marginBottom:"-3px",marginRight:"8px",marginLeft:"1px",color:"rgba(0, 0, 0, 0.38)"}},f)),x=(0,p.makeStyles)(m({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start",fontSize:g,lineHeight:b},attribute:{"&:last-child":{marginBottom:0},paddingLeft:"4px",paddingRight:"4px",marginLeft:"5px",marginBottom:"4px",whiteSpace:"pre-wrap",wordBreak:"break-word"},attributes:{alignSelf:"stretch"},titleRow:m({},f.titleRow,{marginBottom:"3px"})},f));var v=r(52239),E=r(62901),w=r(72316),O=r(14699),C=r(33043),N=r(4767),S=r(11013);const k=e=>{let{value:t,nonVisibleValues:r,attributeType:n,titleClassName:a,contentClassName:l,showNonOv:i,totalNonVisibleValues:c}=e;const p=y(),{label:m,description:d}=n,g=(0,u.xdS)(n)?u.q7e.RELATION_ATTRIBUTE:u.q7e.ENTITY_ATTRIBUTE;return s().createElement("div",{className:o()(p.collaborationWrapper,E.U)},s().createElement("div",{className:o()(p.titleRow,p.wrapper)},s().createElement(O.Z,{label:m,className:o()(p.title,a),"data-reltio-id":"reltio-attribute-label"}),s().createElement(N.Z,{description:d,className:p.descriptionIcon}),s().createElement(C.Z,{nonOvValues:r,attributeType:n,className:p.ovIcon,nonOvTotal:c}),s().createElement(S.Z,{className:o()(p.attribute,l),attributeValue:t,attributeType:n,showNonOv:i,inlined:!0})),s().createElement(w.Z,{uri:t.uri,relatedObjectUris:(0,u.wp9)(g,{uri:t.uri}),objectType:g}))};var T=r(35039),A=r(31992);const Z=e=>{let{max:t,values:r,nonVisibleValues:n,totalVisibleValues:a,attributeType:l,parentUri:u,requestNextPageOfAttributeValues:p,titleClassName:m,contentClassName:d,showNonOv:g,totalNonVisibleValues:b}=e;const f=x(),[h,y]=(0,i.useState)(t),v=t<a,E=v&&h<a,w=v&&h>=a,{label:k,description:Z}=l,P=r.slice(0,h),j=a-h;return s().createElement("div",{className:f.wrapper},s().createElement("div",{className:f.titleRow},s().createElement(O.Z,{label:k,className:o()(f.title,m),"data-reltio-id":"reltio-attribute-label"}),s().createElement(N.Z,{description:Z}),s().createElement(C.Z,{nonOvValues:n,attributeType:l,className:f.ovIcon,nonOvTotal:b})),s().createElement("div",{className:f.attributes},P.map((e=>s().createElement(S.Z,{key:e.uri,className:o()(f.attribute,d),attributeValue:e,attributeType:l,showNonOv:g})))),E&&s().createElement(T.Z,{moreNumber:(0,c.min)(t,j),valueNumber:j,onClick:()=>{r.length<a&&p({parentUri:u,attributeTypeUri:l.uri,attributeTypeName:l.name,values:r,defaultMaxValues:t}),y(h+t)}}),w&&s().createElement(A.Z,{onClick:()=>{y(t)}}))};var P=r(59916);const j=e=>{let{className:t,values:r,Component:n,dataReltioId:a}=e;return s().createElement("div",{className:t,"data-reltio-id":a},r.map(((e,t)=>s().createElement(i.Fragment,{key:e},s().createElement(n,{value:e}),t<r.length-1&&", "))))};var I=r(62228);function D(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){V(e,t,r[t])}))}return e}function V(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const L=(0,p.makeStyles)({insertAttribute:D({width:"fit-content"},u.zXF[u.Y1q.insertAttribute]),deleteAttribute:D({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},u.zXF[u.Y1q.deleteAttribute])}),R=e=>{let{value:t}=e;const r=L(),l=(0,n.useSelector)(a.ZP.selectors.getMetadata),{appearance:o}=(0,i.useContext)(I.m),c=(0,u.YNv)("roles",t,o),p=(0,u.o_F)(c);return s().createElement("span",{className:r[p]},(0,u.xqc)(l,t))},U=e=>{let{className:t,values:r}=e;return s().createElement(j,{values:r,className:t,dataReltioId:"reltio-attribute-value",Component:R})};var M=r(30357),_=r(10609),z=r(98074);const B=e=>{let{value:t}=e;const r=L(),l=(0,n.useSelector)(a.ZP.selectors.getUIPath),o=(0,n.useSelector)(a.ZP.selectors.getEntity),c=(0,i.useContext)(_.u),{appearance:p}=(0,i.useContext)(I.m),{generateTagUrl:m}=(0,i.useContext)(z.v),d=(0,u.YNv)("tags",t,p),g=(0,u.o_F)(d),b=c||o;return s().createElement(M.Z,{className:r[g],href:m({uiPath:l,tag:t,entityUri:b.dataTenant?(0,u.Nsy)(b):b.uri})},t)},F=e=>{let{className:t,values:r}=e;return s().createElement(j,{values:r,className:t,dataReltioId:"reltio-attribute-value",Component:B})},H=e=>{let{values:t,attributeType:r}=e;const n=y(),{label:a}=r;return s().createElement("div",{className:o()(n.titleRow,n.wrapper)},(l=n.titleIcon,r.uri===u.xPW.tags.uri?s().createElement(P.Z,{className:l}):null),s().createElement(O.Z,{label:a,className:n.title,"data-reltio-id":"reltio-attribute-label"}),(e=>{switch(r.uri){case u.xPW.tags.uri:return s().createElement(F,{className:e,values:t});case u.xPW.roles.uri:return s().createElement(U,{className:e,values:t});default:return s().createElement(S.Z,{className:e,attributeValue:{value:t[0]},attributeType:r,inlined:!0})}})(n.attribute));var l};var q=r(61347);const W=e=>{let{attributeType:t,attributeValues:r,paging:n,parentUri:a,showNonOv:l,requestNextPageOfAttributeValues:o}=e;const i=x(),{label:c,description:u}=t;return s().createElement(s().Fragment,null,s().createElement("div",{className:i.titleRow},s().createElement(O.Z,{className:i.title,label:c,"data-reltio-id":"reltio-attribute-label"}),s().createElement(N.Z,{className:i.descriptionIcon,description:u})),s().createElement(q.Z,{attributeValues:r,attributeType:t,paging:n,parentUri:a,requestNextPageOfAttributeValues:o,showNonOv:l}))},$="oneLine",Y="multiLine",X="imageLine",G="special",K=(0,i.memo)((e=>{let{values:t,attributeType:r,drawLines:n,paging:a={},parentUri:l,max:i=1/0,requestNextPageOfAttributeValues:p,titleClassName:m,contentClassName:d,showNonOv:g}=e;const b=h(),f=(0,c.partition)(u.OXP);if(!t||!t.length)return null;const[y,x]=f(t),E=g?t:y,w=g?[]:x,O=g?"totalValues":"totalOvValues",C=(0,c.ifElse)((0,c.has)(O),(0,c.prop)(O),(0,c.always)(E.length))(a),N=null!=a&&a.totalValues?a.totalValues-C:w.length,S=1===C&&!(0,u.YkM)(r);return s().createElement(v.Z,{enabled:n,className:o()({[b.paddingWrapperWithLines]:n})},s().createElement("div",{className:o()({[b.paddingWrapper]:!n})},(()=>{switch((0,c.cond)([[u.kqr,(0,c.always)(G)],[u.Or$,(0,c.always)(X)],[(0,c.always)(S),(0,c.always)($)],[c.T,(0,c.always)(Y)]])(r)){case $:return s().createElement(k,{value:E[0],nonVisibleValues:w,totalNonVisibleValues:N,attributeType:r,titleClassName:m,contentClassName:d,showNonOv:g});case Y:return s().createElement(Z,{values:E,nonVisibleValues:w,totalVisibleValues:C,totalNonVisibleValues:N,attributeType:r,parentUri:l,max:i,requestNextPageOfAttributeValues:p,titleClassName:m,contentClassName:d,showNonOv:g});case X:return s().createElement(W,{attributeValues:E,attributeType:r,paging:a,parentUri:l,requestNextPageOfAttributeValues:p,showNonOv:g});case G:return s().createElement(H,{values:E,attributeType:r})}})()))})),J={requestNextPageOfAttributeValues:a.N5.actions.requestNextPageOfAttributeValues},Q=(0,n.connect)(((e,t)=>{let{max:r}=t;return{max:r||a.ZP.selectors.getDefaultMaxValues(e)}}),J)(K)},13870:(e,t,r)=>{r.d(t,{Z:()=>v});var n=r(24328),a=r.n(n),l=r(13980),o=r.n(l),i=r(71153),s=r.n(i),c=r(17512),u=r(79312),p=r(89978),m=r(85777),d=r(72316),g=r(54837),b=r(74542),f=r(62901);const h=(0,r(72342).makeStyles)({complexContainer:{marginTop:"1px"},labelContainer:{display:"flex",minHeight:"18px"},label:{fontSize:"13px",lineHeight:"15px",letterSpacing:"normal",paddingTop:"1px",marginLeft:"2px"},spacer:{flex:1}});function y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const x=e=>{let{attributeTypesList:t,attributeValue:r,label:l,expanded:o=!1,children:i,showNonOv:x,attributeType:v,LabelRenderer:E,RightSlot:w}=e;const O=h(),C=(0,b.V)(),N=r.uri,[S,k]=(0,n.useState)(!1),{highlightedValuesUris:T=[],highlightedClassName:A}=(0,n.useContext)(g.j);(0,n.useEffect)((()=>{k(o)}),[o]);const Z=(t||[]).some((e=>(0,c.kQw)(e))),P=(0,n.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){y(e,t,r[t])}))}return e}({attributes:Z?null:r.value,analyticsAttributes:Z?r.value:null},(0,c.kqr)(v)?r.value:{})),[r,Z,v]),j=(0,c.xdS)(v)?c.q7e.RELATION_ATTRIBUTE:c.q7e.ENTITY_ATTRIBUTE;return a().createElement("div",{className:O.complexContainer},a().createElement("div",{className:s()(O.labelContainer,f.U)},a().createElement(m.Z,{onClick:()=>k((e=>!e)),expanded:S}),E?a().createElement(E,{attributeType:v,attributeValue:r}):a().createElement(a().Fragment,null,a().createElement(u.Z,{component:"span",variant:"body2",classes:{body2:O.label},className:s()({[A]:T.includes(r.uri),[C.ovFalse]:!(0,c.OXP)(r)}),"data-reltio-id":"reltio-attribute-complex-label"},l),a().createElement("div",{className:O.spacer}),w&&a().createElement(w,{attributeType:v,attributeValue:r}),a().createElement(d.Z,{uri:r.uri,relatedObjectUris:(0,c.wp9)(j,{uri:r.uri}),objectType:j}))),S&&a().createElement(p.Z,{attrTypes:t,entity:P,drawLines:!0,parentUri:N,showNonOv:x},i))};x.propTypes={children:o().node,label:o().oneOfType([o().string,o().node]),attributeTypesList:o().arrayOf(c.EMD),attributeValue:o().oneOfType([c.dMV,c.Rtp]),expanded:o().bool,showNonOv:o().bool,attributeType:c.EMD,LabelRenderer:o().elementType,RightSlot:o().elementType};const v=x},61347:(e,t,r)=>{r.d(t,{Z:()=>d});var n=r(24328),a=r.n(n),l=r(17512),o=r(71153),i=r.n(o),s=r(62228),c=r(26729),u=r(43253),p=r(91446);const m=(0,r(72342).makeStyles)((e=>({image:e=>{let{imageMargin:t,imageHeight:r,imageWidth:n}=e;return{marginRight:t,width:n,height:r,cursor:"pointer","&:last-child":{marginRight:0}}},deleteAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,background:`url('${(0,l.m5F)('<svg xmlns="http://www.w3.org/2000/svg" style="stroke: #D1051E; stroke-width: 1" viewBox="0 0 114 114">\n\t<line x1="5" y1="109" x2="109" y2="5" />\n</svg>')}') no-repeat`,backgroundColor:l.zXF[l.Y1q.deleteAttribute].backgroundColor,pointerEvents:"none"}},updateAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:l.zXF[l.Y1q.updateAttribute].backgroundColor,pointerEvents:"none"}},deleteAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${l.zXF[l.Y1q.deleteAttribute].color}`,outlineOffset:"-3px"}},insertAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${l.zXF[l.Y1q.insertAttribute].color}`,outlineOffset:"-3px"}},updateAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${l.zXF[l.Y1q.updateAttribute].color}`,outlineOffset:"-3px"}},number:{color:e.palette.primary.main,fontSize:"24px",lineHeight:"42px",letterSpacing:0,padding:"36px 8px",textAlign:"center",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}}))),d=e=>{let{attributeType:t,attributeValues:r=[],paging:o,parentUri:d,requestNextPageOfAttributeValues:g,showNonOv:b,imageSize:f=p.By}=e;const h=m(f),{appearance:y}=(0,n.useContext)(s.m);return a().createElement(u.Z,{attributeValues:r,attributeType:t,renderImage:e=>{let{onOpenImageGalleryDialog:t}=e;return e=>{const r=(0,l.efz)(e),{uri:n}=e,o=(0,l.IFm)(n,y),s=(0,l.o_F)(o);return a().createElement("div",{className:i()(h.image,{[h[s+"Image"]]:s}),key:n,"data-reltio-id":"reltio-attribute-value"},a().createElement(c.Z,{onClick:()=>t(n),className:h[s],src:r,size:{imageWidth:f.imageWidth,imageHeight:f.imageHeight}}))}},imageSize:f,requestNextPageOfAttributeValues:g,paging:o,parentUri:d,showNonOv:b})}},88610:(e,t,r)=>{r.d(t,{Z:()=>y});var n=r(24328),a=r.n(n),l=r(83422),o=r(71153),i=r.n(o),s=r(17512),c=r(62228),u=r(13870),p=r(32826),m=r(1462);function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){g(e,t,r[t])}))}return e}function g(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const b=(0,r(72342).makeStyles)({label:{textDecoration:"none"},updateAttribute:d({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},s.zXF[s.Y1q.updateAttribute]),insertAttribute:d({width:"fit-content"},s.zXF[s.Y1q.insertAttribute]),deleteAttribute:d({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},s.zXF[s.Y1q.deleteAttribute]),pivotingTooltip:{marginLeft:"4px"}});function f(){return f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},f.apply(this,arguments)}const h=e=>{let{attributeValue:t,attributeType:r}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const d=b(),{appearance:g}=(0,n.useContext)(c.m),h=(0,n.useMemo)((()=>{const e=(0,s.IFm)(t.uri,g),n=(0,s.o_F)(e),o=t.label?t.label:(0,s.Kxm)(t,r.dataLabelPattern);return a().createElement(p.m,{className:d.pivotingTooltip,value:t,attributeType:r},a().createElement(l.Z,{component:"span",className:i()(d[n],d.label)},a().createElement(m.Z,{text:(0,s.idV)(o)})))}),[g,d,t,r]);return a().createElement(u.Z,f({label:h,attributeValue:t,attributeTypesList:(0,s.EUG)({},r),attributeType:r},o))};h.propTypes=s.j2V;const y=(0,n.memo)(h)},25257:(e,t,r)=>{r.d(t,{Z:()=>v});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(17512),s=r(50673),c=r(52730),u=r(62228),p=r(98074),m=r(13870),d=r(30357),g=r(1462),b=r(74542);function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){h(e,t,r[t])}))}return e}function h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const y=(0,r(72342).makeStyles)((e=>({relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary},updateAttribute:f({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},i.zXF[i.Y1q.updateAttribute]),insertAttribute:f({width:"fit-content"},i.zXF[i.Y1q.insertAttribute]),deleteAttribute:f({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},i.zXF[i.Y1q.deleteAttribute])})));function x(){return x=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},x.apply(this,arguments)}const v=(0,n.memo)((e=>{let{attributeValue:t,attributeType:r}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const f=(0,c.useSelector)(s.ZP.selectors.getMetadata),h=(0,c.useSelector)(s.ZP.selectors.getUIPath),v=y(),E=(0,b.V)(),w=(0,i.bwT)(t),O=(0,n.useMemo)((()=>(0,i.EUG)(f,r)),[r,f]),{appearance:C}=(0,n.useContext)(u.m),{generateEntityUrl:N}=(0,n.useContext)(p.v),S=(0,n.useMemo)((()=>{const e=(0,i.IFm)(t.uri,C),r=(0,i.o_F)(e),n=null!=w&&w.startsWith("changeRequests")?"dcrReview":"profile";return a().createElement(d.Z,{href:(0,i.O27)(C)?N({uiPath:h,uri:w,screen:n}):void 0,className:o()(v[r],{[E.ovFalse]:!(0,i.OXP)(t)})},a().createElement(g.Z,{text:(0,i.idV)(t.label)}),t.relationshipLabel&&a().createElement("span",{className:v.relationshipLabel},a().createElement(g.Z,{text:t.relationshipLabel})))}),[t,C,h,w,v,E.ovFalse,N]);return a().createElement(m.Z,x({attributeTypesList:O,attributeValue:t,label:S,attributeType:r},l))}))},81489:(e,t,r)=>{r.d(t,{Z:()=>y});var n=r(24328),a=r.n(n),l=r(17512),o=r(71153),i=r.n(o),s=r(62901),c=r(62228),u=r(72316),p=r(67586),m=r(32826);function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){g(e,t,r[t])}))}return e}function g(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const b=(0,r(72342).makeStyles)({root:{display:"flex",alignItems:"start",justifyContent:"space-between"},commentsContainer:{height:"15px",marginRight:"-4px"},attributeValue:{flex:1,wordBreak:"break-all"},updateAttribute:d({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},l.zXF[l.Y1q.updateAttribute],{"& > a":{color:l.zXF[l.Y1q.updateAttribute].color}}),insertAttribute:d({width:"fit-content"},l.zXF[l.Y1q.insertAttribute],{"& > a":{color:l.zXF[l.Y1q.insertAttribute].color}}),deleteAttribute:d({width:"fit-content",padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},l.zXF[l.Y1q.deleteAttribute],{"& > a":{color:l.zXF[l.Y1q.deleteAttribute].color}}),multilineAttribute:{width:"fit-content"}});var f=r(54837),h=r(74542);const y=e=>{let{className:t,attributeType:r=null,attributeValue:o,inlined:d}=e;const g=b(),y=(0,h.V)(),{highlightedValuesUris:x=[],highlightedClassName:v}=(0,n.useContext)(f.j),{appearance:E}=(0,n.useContext)(c.m),w=(0,l.IFm)(o.uri,E),O=(0,l.o_F)(w),C=a().createElement(p.Z,{value:(0,l.kDl)(o),dataTypeDefinition:(0,l.PFL)(r)}),N=(0,l.xdS)(r)?l.q7e.RELATION_ATTRIBUTE:l.q7e.ENTITY_ATTRIBUTE;return d||O?a().createElement("div",{className:i()(t,{[v]:x.includes(o.uri)})},a().createElement(m.m,{value:o,attributeType:r,key:o.uri,className:i()({[g.multilineAttribute]:!d})},a().createElement("span",{className:i()(g[O],{[y.ovFalse]:!(0,l.OXP)(o)}),"data-reltio-id":"reltio-attribute-value"},C))):a().createElement("div",{className:i()(t,g.root,s.U,{[v]:x.includes(o.uri)})},a().createElement(m.m,{value:o,attributeType:r,key:o.uri},a().createElement("span",{className:i()(g.attributeValue,{[y.ovFalse]:!(0,l.OXP)(o)}),"data-reltio-id":"reltio-attribute-value"},C)),a().createElement(u.Z,{className:g.commentsContainer,uri:o.uri,relatedObjectUris:(0,l.wp9)(N,{uri:o.uri}),objectType:N}))}},74542:(e,t,r)=>{r.d(t,{V:()=>n});const n=(0,r(72342).makeStyles)((e=>({ovFalse:e.inactive})))},86602:(e,t,r)=>{r.d(t,{S:()=>a});var n=r(17512);const a=[n.xPW.roles.uri,n.xPW.tags.uri]},62901:(e,t,r)=>{r.d(t,{U:()=>n});const n="commentsContainerVisibilityArea"},76572:(e,t,r)=>{r.d(t,{g:()=>i});var n=r(24328),a=r.n(n),l=r(13980),o=r.n(l);const i=a().createContext({enabled:!1,queueSizeThreshold:0});i.Provider.propTypes={value:o().shape({enabled:o().bool,queueSizeThreshold:o().number})},i.displayName="AsyncMountContext"},65510:(e,t,r)=>{r.d(t,{P:()=>a});var n=r(24328);const a=r.n(n)().createContext(!1);a.displayName="BlockImageGalleryDialogContext"},1824:(e,t,r)=>{r.d(t,{h:()=>s,e:()=>c});var n=r(24328),a=r.n(n),l=r(10),o=r(89575);const i=()=>{},s=a().createContext({comments:[],commentsMap:null,currentComment:null,updateCommentState:i,clearCommentState:i,getCommentState:()=>({}),getComment:i,getComments:()=>new Promise(i),getCommentsCount:i,createComment:()=>new Promise(i),editComment:()=>new Promise(i),createReply:()=>new Promise(i),resolveThread:i,reOpenThread:i,clearCurrentComment:i,deleteComment:i,sending:!1,loading:!1,pageToken:null,deleteReply:i,editReply:()=>new Promise(i)});s.displayName="CollaborationContext";const c=e=>{let{collaboration:t,children:r}=e;const n=(0,l.U)();return a().createElement(s.Provider,{value:t},a().createElement(o.s.Provider,{value:n},r))}},63929:(e,t,r)=>{r.d(t,{X:()=>a});var n=r(24328);const a=r.n(n)().createContext({});a.displayName="EntitiesMapContext"},10609:(e,t,r)=>{r.d(t,{u:()=>a});var n=r(24328);const a=r.n(n)().createContext(null);a.displayName="EntityContext"},43407:(e,t,r)=>{r.d(t,{Y:()=>a});var n=r(24328);const a=r.n(n)().createContext({showDescription:!1,showNavigateToGraph:!0});a.displayName="FeaturesContext"},54837:(e,t,r)=>{r.d(t,{j:()=>a});var n=r(24328);const a=r.n(n)().createContext({highlightedValuesUris:[],highlightedClassName:""});a.displayName="HighlightedValuesContext"},62228:(e,t,r)=>{r.d(t,{m:()=>a});var n=r(24328);const a=r.n(n)().createContext({appearance:void 0,attributes:void 0,roles:void 0,tags:void 0});a.displayName="HistoryDiffContext"},80687:(e,t,r)=>{r.d(t,{J:()=>a});var n=r(24328);const a=r.n(n)().createContext([])},80231:(e,t,r)=>{r.d(t,{j:()=>a});var n=r(24328);const a=r.n(n)().createContext(!1);a.displayName="ProfilePerspectiveViewContext"},38309:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(24328);const a=r.n(n)().createContext([]);a.displayName="RelatedObjectUrisContext"},43460:(e,t,r)=>{r.d(t,{g4:()=>o,Ie:()=>i,St:()=>s,NY:()=>c,fy:()=>u});var n=r(24328),a=r.n(n),l=r(79573);let o;!function(e){e.Error="Error",e.NewAttribute="NewAttribute"}(o||(o={}));const i=e=>e===o.Error,s=e=>e===o.NewAttribute,c=a().createContext({element:null,type:null,highlightError:l.ZT,highlightAttribute:l.ZT,scrollIntoRef:l.ZT}),u=e=>{let{children:t}=e;const[r,l]=(0,n.useState)(null),i=(0,n.useRef)(null),s=(0,n.useCallback)((e=>{e.current.scrollIntoView({behavior:"smooth",block:"center"}),i&&clearTimeout(i.current),i.current=setTimeout((()=>{l(null)}),2e3)}),[]),u=(0,n.useCallback)((e=>{l({value:e,type:o.Error})}),[]),p=(0,n.useCallback)((e=>{setTimeout((()=>l({value:e,type:o.NewAttribute})),300)}),[]),m=(0,n.useMemo)((()=>({element:null==r?void 0:r.value,highlightError:u,highlightAttribute:p,scrollIntoRef:s,type:null==r?void 0:r.type})),[r,s]);return a().createElement(c.Provider,{value:m},t)}},89575:(e,t,r)=>{r.d(t,{s:()=>a});var n=r(24328);const a=r.n(n)().createContext([]);a.displayName="UsersContext"},27536:(e,t,r)=>{r.d(t,{S:()=>o});var n=r(24328),a=r(76572);let l=0;const o=()=>{const e=(0,n.useRef)(!0),{enabled:t,queueSizeThreshold:r=0}=(0,n.useContext)(a.g),[o,i]=(0,n.useState)(!t||t&&l<r);e.current&&l++;const s=(0,n.useRef)();return(0,n.useEffect)((()=>{if(l--,!o)return s.current=setTimeout((()=>{i(!0)}),0),()=>clearTimeout(s.current)}),[]),e.current=!1,o}},40941:(e,t,r)=>{r.d(t,{B:()=>d});var n=r(24328),a=r(50914),l=r(71153),o=r.n(l),i=r(17512),s=r(72342);function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){u(e,t,r[t])}))}return e}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const p={content:'""',position:"absolute",left:"-1000px",top:"0px",width:"5000px",height:"calc(100% - 10px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},m=(0,s.makeStyles)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlightError:{"&::before":c({},p,{background:"rgba(255, 0, 0, 0.06)"})},highlightWarning:{"&::before":c({},p,{background:"rgba(228, 151, 0, 0.08)"})},simpleAttribute:{position:"relative","&::before":{top:"-4px",height:"calc(100% + 8px)"}}}))),d=e=>{let{highlightedError:t,isSimple:r=!1}=e;const l=m(),s=(0,n.useRef)(null),{element:c,scrollIntoRef:u}=t||{},p=(0,n.useMemo)((()=>(0,a.propOr)(i.Wkf.ERROR,"severity")(c)),[c]),d=o()({[l.highlightError]:p===i.Wkf.ERROR,[l.highlightWarning]:p===i.Wkf.WARNING,[l.simpleAttribute]:r});return(0,n.useEffect)((()=>{t&&u(s)}),[t,u]),t?{ref:s,errorClassName:d}:{ref:s}}},10:(e,t,r)=>{r.d(t,{U:()=>s});var n=r(24328),a=r(52730),l=r(17512),o=r(50673);const i=(0,r(36631).Z)(((e,t)=>(0,l.kz_)({tenant:e,servicesPath:t}))),s=()=>{const[e,t]=(0,n.useState)([]),r=(0,a.useSelector)(o.ZP.selectors.getTenant),l=(0,a.useSelector)(o.ZP.selectors.getServicesPath),s=e=>{console.warn("Users error",e),t([])};return(0,n.useEffect)((()=>{i(r,l).then((e=>t(e))).catch(s)}),[r,l]),e}},36746:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(24328),a=r.n(n);function l(){return l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},l.apply(this,arguments)}const o=e=>a().createElement("svg",l({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),a().createElement("defs",null,a().createElement("path",{d:"M19 16v3H5v-3H3v3c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-3h-2zm-6-3.33l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2v9.67z",id:"Download_svg__a"})),a().createElement("g",{transform:"translate(-3 -3)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a().createElement("mask",{id:"Download_svg__b",fill:"#fff"},a().createElement("use",{xlinkHref:"#Download_svg__a"})),a().createElement("path",{fillOpacity:.54,fill:"#fff",mask:"url(#Download_svg__b)",d:"M0 0h24v24H0z"})))}}]);
2
2
  //# sourceMappingURL=9028.js.map