@reltio/remotes 1.4.1484 → 1.4.1485
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/4217.js +2 -0
- package/4217.js.map +1 -0
- package/4843.js +1 -1
- package/747.js +1 -1
- package/747.js.map +1 -1
- package/package.json +1 -1
- package/remoteEntry.js +1 -1
- package/remoteEntry.js.map +1 -1
- package/3554.js +0 -2
- package/3554.js.map +0 -1
package/747.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[747],{47401:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>ol,IL3:()=>dT,PY2:()=>Fn,Ng6:()=>vt,YJ7:()=>Un,NlI:()=>On,XYV:()=>Sn,Xt7:()=>Tt,wfT:()=>Oi,EMD:()=>li,HAc:()=>mt,PEf:()=>Gn,oA3:()=>si,$XE:()=>Ft,eWf:()=>$n,q7e:()=>ht,KVe:()=>vi,WVQ:()=>qr,oZZ:()=>Ii,bNA:()=>Ui,Rjq:()=>Ci,G39:()=>Bn,W0P:()=>qt,X1H:()=>Wt,hdG:()=>Qt,ws7:()=>Kt,VI$:()=>Jt,yn8:()=>Dt,N0y:()=>Ct,dZX:()=>Mt,bQt:()=>Li,oS0:()=>zt,KfU:()=>Et,bZE:()=>Pn,Nsj:()=>Ln,psV:()=>In,xPW:()=>Mn,pyR:()=>fi,p8l:()=>ci,Wkf:()=>ft,zHr:()=>yt,NIO:()=>dt,$26:()=>i_,Esk:()=>ri,s9T:()=>It,MEy:()=>Yu,j5E:()=>bn,vAw:()=>oi,NMQ:()=>ai,eVu:()=>cc,YGb:()=>Yt,mNm:()=>di,Y1q:()=>Th,s_5:()=>Ti,RgZ:()=>pi,unl:()=>wi,Qy0:()=>Di,Q26:()=>Dn,pYu:()=>ti,wIJ:()=>S_,GFH:()=>_t,Ury:()=>Yn,S91:()=>qn,p3$:()=>Mi,wSh:()=>ee,BDP:()=>Qi,pGS:()=>yi,ARY:()=>Zt,XGc:()=>bi,fO_:()=>on,wwy:()=>Rt,h_8:()=>Jn,_XL:()=>Cn,j2V:()=>gi,dMV:()=>mi,NBX:()=>RN,OXy:()=>er,BXd:()=>Lt,KM9:()=>Ot,CJB:()=>Ni,lXI:()=>Vt,nqG:()=>ki,C68:()=>Wn,yxQ:()=>ji,Yj_:()=>St,D25:()=>Nt,ZIY:()=>xt,Tl4:()=>j_,lwr:()=>Vn,NkU:()=>_i,Rtp:()=>hi,YGx:()=>jt,uTS:()=>Ei,MCv:()=>bt,IYE:()=>ui,PiC:()=>Si,MVv:()=>Ht,h_m:()=>Gt,DUe:()=>Rn,tJI:()=>gt,fDt:()=>At,cNQ:()=>Ai,SwE:()=>ni,ZHR:()=>Ri,PYu:()=>Bt,lD1:()=>Hn,lVm:()=>kt,vnX:()=>Sg,$x5:()=>wg,_R1:()=>Pg,wUm:()=>Rg,z7V:()=>Fi,dC6:()=>Ut,MBD:()=>Pt,GmF:()=>Ra,cKm:()=>$t,iP_:()=>xn,NVC:()=>wt,tPT:()=>Dl,tZe:()=>wT,kRE:()=>tm,psB:()=>rm,X0$:()=>Cl,zE1:()=>Wl,Wm5:()=>gl,vyX:()=>qc,wLZ:()=>Ll,W4V:()=>le,EtK:()=>Vs,Wtd:()=>Ul,asT:()=>xN,kGs:()=>Gh,ewt:()=>wd,O_f:()=>Fu,sOy:()=>Xe,Tde:()=>Nr,LMI:()=>wc,skb:()=>AA,sPt:()=>Oc,sH1:()=>vc,lPZ:()=>Ky,bG8:()=>Qy,_LJ:()=>Xy,RPM:()=>ty,h27:()=>xc,Uqd:()=>Yc,xG:()=>FA,Z2f:()=>Vv,fgW:()=>iA,I69:()=>wA,ZxB:()=>UA,dwd:()=>Jy,F$g:()=>Hy,mdt:()=>ib,Qbq:()=>Sh,rny:()=>ca,UEY:()=>Ja,Q0T:()=>Ha,Lyr:()=>to,sBn:()=>qa,itK:()=>Ga,H9$:()=>Ya,KPc:()=>Ba,zos:()=>Wa,ELQ:()=>ro,dZs:()=>Ca,Cz4:()=>Ua,z_L:()=>Za,fGe:()=>Ia,iuF:()=>$a,Wib:()=>Va,Hn0:()=>eo,obS:()=>no,E$L:()=>Da,XUh:()=>xa,Qp_:()=>Fa,_jk:()=>La,sKE:()=>ja,WmG:()=>Ma,QKx:()=>Xa,Oik:()=>Ka,s0A:()=>ka,o9m:()=>Qa,MCd:()=>za,RsS:()=>$c,tGK:()=>du,lIv:()=>Bl,Vg3:()=>ma,mkC:()=>ia,xv5:()=>ba,a14:()=>oa,yv0:()=>ha,Zm0:()=>aa,Nxd:()=>na,$mM:()=>Ea,ifj:()=>Jr,NWi:()=>lg,xr3:()=>sg,wNf:()=>gu,iJH:()=>ug,d89:()=>ea,Edd:()=>ta,Z5t:()=>ra,uGe:()=>Xi,UoR:()=>Ki,xvW:()=>og,$qe:()=>ag,yPM:()=>wa,$cp:()=>Gl,vKJ:()=>$l,VtG:()=>gf,AID:()=>eh,B1H:()=>NN,b7X:()=>Nh,$uE:()=>Yh,keo:()=>Rh,C_p:()=>xy,G27:()=>uO,JA0:()=>BE,b3T:()=>Vh,oC6:()=>xh,_Zs:()=>$h,epC:()=>Hh,YYG:()=>qh,f_2:()=>qE,w3l:()=>sN,QHB:()=>lO,Jso:()=>fN,RXH:()=>Hb,Vr9:()=>hO,lMm:()=>Ev,BlA:()=>KN,fmQ:()=>Ds,yRD:()=>JA,NcL:()=>Yy,QK6:()=>me,ymd:()=>pT,JV_:()=>hm,XiW:()=>zp,Yrx:()=>UE,GPx:()=>Il,gjI:()=>wl,vlo:()=>Hd,E_P:()=>zh,aAL:()=>zf,NBq:()=>Ls,wp9:()=>nb,DsR:()=>qf,MPc:()=>Mp,gWE:()=>xp,DT_:()=>$p,ipn:()=>Gp,ORg:()=>Yi,_wz:()=>Vp,RYR:()=>fd,PP2:()=>kE,wS7:()=>Kv,cBQ:()=>If,pBq:()=>Mm,DsO:()=>te,X78:()=>Om,xZs:()=>fm,YFy:()=>DE,Gmt:()=>om,K$w:()=>am,DSj:()=>Zf,Mfr:()=>LE,k9j:()=>Cf,EjS:()=>X,ww$:()=>jl,WVU:()=>im,hxF:()=>Al,n6p:()=>an,E7G:()=>jp,nwO:()=>tP,Mzk:()=>Nf,aFF:()=>Lh,HRH:()=>Ju,EZK:()=>ip,Kxm:()=>ep,Z9i:()=>by,CrF:()=>XE,DNd:()=>ao,vUy:()=>BN,lJh:()=>zu,zHo:()=>Zu,sEJ:()=>wN,UO$:()=>Bm,zeJ:()=>Ur,dLR:()=>Ys,JQy:()=>nl,XtP:()=>Ws,Ug0:()=>En,A1W:()=>Ph,sw:()=>np,nv3:()=>mg,JgD:()=>Eg,nve:()=>IN,SkP:()=>il,SAs:()=>$m,i5L:()=>al,PWK:()=>is,IM5:()=>Bs,Aup:()=>mO,Mfk:()=>bv,HQx:()=>hs,oN$:()=>ms,mB6:()=>Bv,p6d:()=>w,o0x:()=>U,ufS:()=>Uv,k7L:()=>Cv,mrB:()=>I,OuZ:()=>ap,ncP:()=>Ye,FQ2:()=>op,W$R:()=>sp,JOV:()=>xe,Zmi:()=>$e,hm5:()=>Ge,ECL:()=>Xr,vPL:()=>lp,qmL:()=>fh,hPi:()=>km,hXd:()=>da,OCS:()=>ya,p2l:()=>ll,qF1:()=>yT,_X$:()=>fT,yj2:()=>A_,bzh:()=>sb,k66:()=>fs,kiP:()=>Io,pSg:()=>pe,kz_:()=>$E,H_U:()=>Es,t9e:()=>yo,j2$:()=>IT,PFL:()=>fr,aJ3:()=>Qg,To9:()=>Pr,wpo:()=>Sp,ADq:()=>fy,UUb:()=>dy,tQX:()=>yy,xy8:()=>hr,EUG:()=>Cr,AFK:()=>nt,X3M:()=>Ir,WN0:()=>Ts,kDl:()=>qs,uDV:()=>yh,IhQ:()=>zs,pfb:()=>el,R$r:()=>Xh,w80:()=>qo,Pfu:()=>co,Gtj:()=>nu,fyF:()=>ru,kkq:()=>ys,u5q:()=>qe,O$n:()=>Pp,ptG:()=>Rp,f4_:()=>Eb,uap:()=>Tb,d7q:()=>IE,liG:()=>FE,$oF:()=>wE,avf:()=>Fd,DiQ:()=>kd,cfX:()=>jd,vD3:()=>xd,Qrb:()=>Ld,EJQ:()=>Md,HWy:()=>Dd,gjS:()=>md,y6v:()=>Cd,JUW:()=>HE,GtP:()=>wb,_kX:()=>so,u1e:()=>lo,sJj:()=>Uh,CJp:()=>Rb,uKF:()=>Ih,wo0:()=>em,s5:()=>ss,cwx:()=>os,Y6b:()=>bE,TTx:()=>cm,UtR:()=>OE,HaQ:()=>pm,E6I:()=>KE,Won:()=>gE,vTU:()=>mE,Nsy:()=>Ep,KMQ:()=>Dh,Do$:()=>Op,CSV:()=>pl,TMe:()=>vE,l1V:()=>tc,RHh:()=>uc,VQ1:()=>sc,cGG:()=>oc,z7d:()=>Jd,Xaq:()=>vs,Sj8:()=>JN,PJj:()=>uu,k3T:()=>hn,PjQ:()=>Hi,s7l:()=>Ef,jLA:()=>Ib,GGR:()=>Wd,j5q:()=>Vd,DnY:()=>yf,RY5:()=>sh,Px$:()=>Td,KPC:()=>gN,NIY:()=>_f,HvW:()=>hf,Fof:()=>fo,BXy:()=>bf,fX:()=>Ub,BTI:()=>gp,uie:()=>pp,q27:()=>Ip,vrC:()=>UO,fAQ:()=>Am,XkT:()=>df,lrH:()=>Nm,nt9:()=>pn,XH8:()=>Np,XH2:()=>mn,jFi:()=>Ap,qhs:()=>Yo,wwR:()=>vp,Uk3:()=>it,$Rg:()=>pt,ev7:()=>PN,RB9:()=>WE,iFp:()=>ny,e$p:()=>ay,PcX:()=>oy,SpP:()=>iy,R6_:()=>Xg,CY1:()=>a_,Ajk:()=>sf,Yiz:()=>of,FK9:()=>Zy,UOo:()=>Dv,aTW:()=>lm,uug:()=>vu,P$2:()=>l_,XS2:()=>yu,Hyb:()=>Du,d3Y:()=>Kc,Klp:()=>zc,WxZ:()=>u_,Gzu:()=>ec,ZOr:()=>pf,uqV:()=>fE,Pm4:()=>ne,hWO:()=>et,nHA:()=>bb,nVD:()=>uh,_tF:()=>yc,dED:()=>RE,P2h:()=>PE,jrr:()=>Po,mmY:()=>So,T6O:()=>bs,h6J:()=>PT,hM2:()=>mN,XR6:()=>z,jmz:()=>dh,IHt:()=>ph,NZI:()=>hy,wdF:()=>gm,YNv:()=>Ah,IFm:()=>_h,o_F:()=>mh,kgP:()=>_m,ZYI:()=>sT,QXK:()=>zl,efz:()=>Zl,Q5d:()=>Xl,Ysv:()=>eu,UWq:()=>Xd,ocC:()=>Kd,io3:()=>fn,Sbt:()=>Jo,roS:()=>Ho,Ww1:()=>Qo,QaS:()=>Pf,wsP:()=>ve,ERZ:()=>aN,CL1:()=>hN,idV:()=>rp,nIW:()=>Ze,fjE:()=>zg,sG0:()=>kv,tV7:()=>cu,g8o:()=>D_,Qy:()=>C_,t2P:()=>Jg,KbW:()=>jo,wId:()=>Fo,LS0:()=>Mo,bFH:()=>tE,Rgl:()=>nE,fW1:()=>lb,GFW:()=>dm,Ywp:()=>gg,pg:()=>FT,WSA:()=>iE,fed:()=>TN,tT_:()=>Zs,BgZ:()=>tl,xIV:()=>rl,KbL:()=>Tf,JBA:()=>lt,aNC:()=>Tg,RFJ:()=>oT,Zeh:()=>Wm,OT5:()=>vg,mC3:()=>ql,kR6:()=>QN,gFw:()=>mb,NVY:()=>tb,k6v:()=>TT,FEC:()=>ET,L5S:()=>Zh,Ob5:()=>Up,KUV:()=>Cp,dvH:()=>eb,V3i:()=>vO,VD3:()=>Tn,mm2:()=>ac,rou:()=>Cm,izH:()=>uo,DK$:()=>po,KMp:()=>Xf,c31:()=>nr,mbo:()=>Ey,gT8:()=>or,CZ8:()=>Us,uGi:()=>Fs,Poc:()=>tr,_9k:()=>$s,ZTM:()=>js,bwT:()=>Ms,tzW:()=>lr,tF$:()=>ar,o96:()=>Cs,M4S:()=>xs,_vs:()=>Bf,xF8:()=>hd,PUO:()=>jh,ATu:()=>Ty,j1S:()=>Wi,V3K:()=>Vi,Lmx:()=>Gi,oSN:()=>Ji,ZaZ:()=>rr,n_1:()=>EE,N6e:()=>Jf,SxO:()=>Ro,w3p:()=>rb,xU7:()=>Te,Y_p:()=>zo,$k6:()=>Xo,Gdl:()=>Mv,U6P:()=>Fv,OwB:()=>Kg,hTh:()=>ch,xqc:()=>ls,JvE:()=>us,i29:()=>Lc,dzT:()=>la,uPS:()=>wf,cZV:()=>Sf,n3B:()=>pA,e6O:()=>aA,s7j:()=>R_,j$Q:()=>JE,kW2:()=>Sb,tH7:()=>as,Yxg:()=>El,MaZ:()=>Gd,nqN:()=>$d,jWj:()=>Zd,o_J:()=>gs,yW4:()=>RT,uT0:()=>AT,C82:()=>NT,bsH:()=>hb,u9Z:()=>Um,LCU:()=>ym,J$m:()=>TE,j_Q:()=>tf,OaI:()=>rf,wB1:()=>AN,SP6:()=>kT,ZYr:()=>vN,IMU:()=>aT,FoU:()=>YE,DVz:()=>Wv,mxe:()=>uA,FHr:()=>Vm,D1g:()=>Dm,VO3:()=>Dg,de5:()=>Cg,Uw1:()=>Oe,J6q:()=>my,XCe:()=>_o,fbl:()=>_g,Ir:()=>Do,XQO:()=>Lo,QXb:()=>JT,zXF:()=>Eh,P8_:()=>Em,iiD:()=>Kf,MOC:()=>QT,WF:()=>HT,xE1:()=>qi,idW:()=>FN,QWZ:()=>_v,YL3:()=>Af,NW9:()=>Iv,D_E:()=>Ee,Fn9:()=>T,j2U:()=>sl,MpE:()=>ur,kQw:()=>Er,mfm:()=>Lu,vZp:()=>at,Wah:()=>vy,E8K:()=>DN,VSb:()=>ws,vr_:()=>Tr,Vmh:()=>WN,FgW:()=>OO,oDv:()=>As,fGG:()=>Av,kuw:()=>Ps,eHk:()=>zd,Tt2:()=>_s,pQZ:()=>Rs,oZ7:()=>Nv,T6Y:()=>Vr,_26:()=>Iu,YkM:()=>Ar,J6y:()=>Eu,njU:()=>Au,TBP:()=>Ns,IT0:()=>Oy,x_:()=>Ch,FP6:()=>ct,biM:()=>hp,TMl:()=>bp,Vkd:()=>Ru,WiY:()=>r_,_zi:()=>Su,RZp:()=>qy,J6D:()=>ic,Lt4:()=>jr,QEi:()=>Sr,whI:()=>ln,KIu:()=>cn,JhM:()=>se,C_0:()=>Br,lzc:()=>Lp,qIF:()=>dA,O27:()=>E,aBi:()=>wp,xOX:()=>vl,EdS:()=>Qe,WgC:()=>Je,eEv:()=>dr,A4t:()=>Nu,YOQ:()=>st,Wos:()=>xr,jWr:()=>io,Or$:()=>_r,lhE:()=>yn,CwH:()=>Rr,pzC:()=>hl,ymH:()=>_u,QZu:()=>vr,rYH:()=>t_,FVt:()=>Mr,Kn2:()=>ce,jgw:()=>ju,Qgr:()=>nc,OXP:()=>Ss,lS4:()=>wr,g5f:()=>n_,fp6:()=>bu,Uty:()=>ga,YkG:()=>gr,xdS:()=>sr,kMF:()=>Wp,$NE:()=>Ke,bC9:()=>He,Ian:()=>Bi,KVV:()=>wh,q9e:()=>Ko,iIf:()=>xv,ian:()=>Nl,m6e:()=>Yr,OFd:()=>bl,kqr:()=>mr,fnZ:()=>sn,VFZ:()=>Pl,ZiX:()=>We,j5n:()=>kr,zkt:()=>_,Pcm:()=>_N,QDV:()=>ml,M5u:()=>e_,laD:()=>cA,mtq:()=>pr,CtB:()=>$v,CBv:()=>oe,I0t:()=>Wr,u1G:()=>qd,gk1:()=>sA,Bgb:()=>oA,uzs:()=>un,v0l:()=>mc,Zqp:()=>_E,j0k:()=>ns,l22:()=>ZN,tCm:()=>rt,gmx:()=>fu,mOr:()=>qu,TwZ:()=>L_,GyU:()=>hg,zGm:()=>$T,bMg:()=>lE,EyD:()=>ng,FQA:()=>ig,fZN:()=>pE,xsF:()=>tg,Lxg:()=>rg,O3l:()=>Lf,Wni:()=>Df,wRx:()=>pg,OxG:()=>zT,uJQ:()=>XT,qWg:()=>Gv,i96:()=>MT,NPd:()=>Xu,zhn:()=>cg,G8q:()=>xi,Jct:()=>ud,A9Y:()=>re,Y5F:()=>XA,gxP:()=>ue,c$P:()=>Tu,M7o:()=>Bc,BBN:()=>No,fS6:()=>Sd,ZBU:()=>K,UkJ:()=>xo,xkv:()=>Tm,z$M:()=>MN,KAm:()=>GE,lCl:()=>th,rkF:()=>$y,IU6:()=>jT,RGr:()=>h,aYu:()=>m,ije:()=>su,Buf:()=>Qf,YLu:()=>ou,ct9:()=>es,XkY:()=>uE,T5R:()=>VT,uQS:()=>dE,wcJ:()=>Zo,d$I:()=>kl,rSp:()=>mp,Sx:()=>vf,Ilm:()=>Yl,Ki6:()=>_l,VGk:()=>Yf,sFD:()=>Jb,eWN:()=>$N,dWE:()=>P_,Lkd:()=>Zp,aDL:()=>Ym,yaA:()=>yE,lOh:()=>jm,DBr:()=>Yg,hK$:()=>pu,TZ_:()=>LT,CMB:()=>yA,FU8:()=>Of,J$p:()=>Qm,b5s:()=>Jm,h2W:()=>tt,SL_:()=>Sm,oUH:()=>vT,ck9:()=>GT,RAb:()=>dc,nL:()=>jv,k$p:()=>Kb,Xs0:()=>au,u7I:()=>Lm,rxg:()=>xu,bji:()=>$u,oCZ:()=>jy,MjG:()=>Ug,FuV:()=>OT,$ju:()=>_T,t6d:()=>gT,m5F:()=>be,sx:()=>VN,rSc:()=>Yv,U10:()=>nf,L8n:()=>nm,R9X:()=>hE,rj2:()=>bm,_C4:()=>UT,tCj:()=>mm,uAg:()=>CE,wx9:()=>Id,KF3:()=>CT,ax9:()=>DT,HH7:()=>Hf,ufV:()=>jE,_6y:()=>Uf,XTh:()=>Ng,AJo:()=>Rf,Ixr:()=>QE,oss:()=>eP,P6Y:()=>rP,Bd_:()=>Uy,xkB:()=>Iy,W41:()=>Im,WkI:()=>wm,sSE:()=>wy,GMd:()=>Ic,jtL:()=>Uc,Bxm:()=>Dy,FVh:()=>Ay,U_T:()=>aE,FTe:()=>ae,VGB:()=>ie,tM8:()=>Vu,Wfe:()=>Ku,Ls5:()=>Qu,$bd:()=>Wu});var n={};r.r(n),r.d(n,{normalize:()=>u,removeLineBreaks:()=>d,search:()=>c,sort:()=>p});var i={};r.r(i),r.d(i,{clearDateTime:()=>g,durationToTimestamp:()=>X,formatDate:()=>w,formatDateTime:()=>U,formatTime:()=>I,getEndOfDay:()=>S,getMomentFormatFromDateMask:()=>q,getMomentFormatFromDateTimeMask:()=>Q,getMomentFormatFromTimeMask:()=>J,getStartOfDay:()=>R,isToday:()=>_,isValidMomentDate:()=>b,isValidMomentDateOrNull:()=>O,momentToDate:()=>v,parseTimestamp:()=>K,toLocalDate:()=>A,toUtcDate:()=>N});var a={};r.r(a),r.d(a,{addAttribute:()=>Ne,editAttribute:()=>Pe,editEndDate:()=>Ce,editRoles:()=>we,editStartDate:()=>Ue,editTags:()=>Ie,removeAttribute:()=>Se});var o={};r.r(o),r.d(o,{applyCrosswalks:()=>Gh,collectCrosswalksFromAttributes:()=>Yh,compareActivenessAttributes:()=>Vh,compareAttributes:()=>xh,compareImages:()=>$h,compareRoles:()=>Hh,compareTags:()=>qh});var s={};r.r(s),r.d(s,{createHistoryManager:()=>Kh});var l=r(17440);const u=e=>"string"==typeof e&&"function"==typeof e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e,c=(e,t)=>(t=(u(t)||"").toLowerCase(),(e=(u(e)||"").toLowerCase()).includes(t)),p=(0,l.curry)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n="asc"===e.toLowerCase();return t=t.toLowerCase(),r=r.toLowerCase(),t<r?n?-1:1:t>r?n?1:-1:0})),d=(0,l.replace)(/(\r\n|\n|\r)/gm,"");var y=r(95038),f=r.n(y);const T=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{startDate:t,endDate:r}=e,n=Date.now();return!(r&&r<n||t&&t>n)},E=(0,l.anyPass)([l.isEmpty,l.isNil]),m=e=>()=>new Promise(e),h=e=>Promise.all(e.map((e=>e.then((e=>({status:"fulfilled",value:e}))).catch((e=>({status:"rejected",reason:e})))))),b=e=>e&&e.isValid(),O=(0,l.either)(b,l.isNil),v=e=>e&&e.toDate(),g=e=>(e&&e.setHours(0,0,0,0),e),_=e=>f()(e).isSame(Date.now(),"day"),A=e=>{const t=new Date(e),r=new Date;return r.setFullYear(t.getUTCFullYear()),r.setMonth(t.getUTCMonth()),r.setDate(t.getUTCDate()),r.setHours(t.getUTCHours()),r.setMinutes(t.getUTCMinutes()),r.setSeconds(t.getUTCSeconds()),r.setMilliseconds(t.getUTCMilliseconds()),r},N=e=>{const t=new Date(e),r=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds());return new Date(r)},P=e=>(t,r)=>(r?f().utc(t):f()(t))[e]("day").valueOf(),R=P("startOf"),S=P("endOf"),w=e=>f()(e).format(f().localeData().longDateFormat("L")),I=e=>f()(e).format(f().localeData().longDateFormat("LTS")),U=e=>`${w(e)} ${I(e)}`,C=(0,l.equals)("9"),D=(0,l.equals)("99"),L=(0,l.equals)("9999"),j=(0,l.test)(/^[az][az][az]$/),k=(0,l.test)(/^[az][az][az][az]$/),F=(0,l.test)(/^9+$/),M=(0,l.test)(/^[9az]+$/),x=(0,l.cond)([[C,(0,l.always)("M")],[D,(0,l.always)("MM")],[j,(0,l.always)("MMM")],[k,(0,l.always)("MMMM")],[M,(0,l.always)("Mo")],[l.T,(0,l.always)("MM")]]),$=(0,l.cond)([[C,(0,l.always)("D")],[D,(0,l.always)("DD")],[M,(0,l.always)("Do")],[l.T,(0,l.always)("DD")]]),V=(0,l.cond)([[C,(0,l.always)("y")],[D,(0,l.always)("YY")],[L,(0,l.always)("YYYY")],[F,(0,l.always)("YYYYYY")],[l.T,(0,l.always)("YYYY")]]),G=(e,t)=>(0,l.cond)([[(0,l.both)((0,l.always)(t),C),(0,l.always)("h")],[(0,l.both)((0,l.always)(t),D),(0,l.always)("hh")],[C,(0,l.always)("H")],[D,(0,l.always)("HH")],[l.T,(0,l.always)(t?"hh":"HH")]])(e),W=(0,l.cond)([[C,(0,l.always)("m")],[D,(0,l.always)("mm")],[l.T,(0,l.always)("mm")]]),B=(0,l.cond)([[C,(0,l.always)("s")],[D,(0,l.always)("ss")],[l.T,(0,l.always)("ss")]]),Y=/([9az]+)([^9az]+)*/g,q=e=>{const t=[...e.toLowerCase().matchAll(Y)];if(E(e)||t.length>0){const[,e="",r=""]=(0,l.propOr)([],0,t),[,n="",i=""]=(0,l.propOr)([],1,t),[,a="",o=""]=(0,l.propOr)([],2,t);return(0,l.join)("",[x(e),r,$(n),i,V(a),o])}return e},H=/(9+)([^9]+)*/g,J=e=>{const t=[...e.toLowerCase().matchAll(H)];if(E(e)||t.length>0){const[,e="",r=""]=(0,l.propOr)([],0,t),[,n="",i=""]=(0,l.propOr)([],1,t),[,a="",o=""]=(0,l.propOr)([],2,t),s=(0,l.pipe)(l.last,(0,l.propOr)("",2),(0,l.test)(/^[^9]+$/))(t),u=(0,l.reject)(l.isEmpty,[G(e,s),r,W(n),i,a?B(a):"",o]),c=s?" A":"",p=(0,l.pipe)(l.init,(0,l.append)(c));return(0,l.pipe)((0,l.when)((0,l.always)(s),p),(0,l.join)(""))(u)}return e},Q=e=>{const[t="",r=""]=(0,l.pipe)((0,l.indexOf)(" "),l.inc,(0,l.splitAt)(l.__,e),(0,l.map)(l.trim))(e);return`${q(t)} ${J(r)}`},K=e=>{const t=Number(e);return Number.isNaN(t)?e:t},X=e=>{const[t,r]=e;return f()().subtract(t,r).valueOf()},z=e=>e&&0!=e.length?e.split("").map((e=>e.charCodeAt())).reduce(((e,t)=>0|(e=(e<<5)-e+t)),0)+"":"0",Z=e=>({isNone:()=>(0,l.isNil)(e),extract:()=>e,orSome:t=>(0,l.isNil)(e)?t:e,map:t=>(0,l.isNil)(e)?ee.None():ee.Some(t(e))}),ee={Some:Z,None:()=>Z(null),chain:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return e=>t.reduce(((e,t)=>e.map(t)),e)},fromFalsy:function(e){return e?ee.Some(e):ee.None()},fromNull:function(e){return null==e?ee.None():ee.Some(e)},fromUndefined:function(e){return void 0===e?ee.None():ee.Some(e)},fromEmpty:function(e){return E(e)?ee.None():ee.Some(e)}},te=(e,t)=>{let r=null;return function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];const o=()=>{e.apply(this,i),r=null};r&&clearTimeout(r),r=setTimeout(o,t)}},re=(e,t)=>(r,n)=>{const i=t?(0,l.prop)(t):l.identity;return e.indexOf(i(r))-e.indexOf(i(n))},ne=(0,l.when)((0,l.is)(Array),(0,l.prop)(0)),ie=e=>Array.isArray(e)?e:[e],ae=e=>[e],oe=e=>!!e&&["www.","http://","https://","ftp://","ftps://","smb://","data:"].some((t=>String(e).toLowerCase().startsWith(t))),se=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase()),le=e=>se(e=e||"")?`mailto:${e}`:!e.includes("://")&&(e.toLowerCase().startsWith("www.")||e.split(".").length>2)?`http://${e}`:e,ue=(0,l.when)((0,l.is)(String),(e=>""===e?void 0:"true"===e.toLowerCase())),ce=e=>null!=e&&["object","function"].includes(typeof e),pe=function(e){const t=[],r=(e,n)=>{n=n||[];for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(Array.isArray(e)&&(i=parseInt(i,10)),ce(e[i])?r(e[i],n.concat(i)):t.push(n.concat(i)))};return r(e),t};var de=r(87918),ye=r.n(de);const fe=(0,l.when)((0,l.is)(Object),JSON.stringify),Te=(e,t,r)=>{const n=[r,"errorDetailMessage","errorMessage","error"];return(0,l.cond)([[(0,l.prop)("originalResponse"),(0,l.pipe)((0,l.path)(["originalResponse","status"]),(e=>((e,t)=>{switch(e){case 400:return ye().text("Bad Request");case 403:return ye().text("Forbidden");case 404:return ye().text("Not Found");case 405:return ye().text("Method Not Allowed");case 408:return ye().text("Request Timeout");case 500:return ye().text("Internal Server Error");case 502:return ye().text("Bad Gateway");case 503:return ye().text("Service Unavailable");case 504:return ye().text("Gateway Timeout");default:return t||ye().text("Something went wrong")}})(e,t)))],...n.map((e=>[(0,l.prop)(e),(0,l.pipe)((0,l.prop)(e),fe)])),[(0,l.always)(t),(0,l.always)(t)],[l.T,fe]])(e)},Ee=e=>"AbortError"===e.name,me=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=(0,l.sum)(e);if(0===r)return[];const n=e=>+e.toFixed(t),i=e.map(((e,t)=>{const i=e/r*100,a=n(i);return{index:t,percent:a,diff:a-i}})),a=i.reduce(((e,t)=>{let{percent:r}=t;return e+r}),0);let o=n(100-a);if(0===o)return(0,l.pluck)("percent",i);const s=Math.sign(o),u=i.sort(((e,t)=>(e.diff-t.diff)*s||e.index-t.index)),c=(0===t?1:1/Math.pow(10,t))*s;for(let e=0;0!==o&&e<u.length;e++)u[e].percent=n(u[e].percent+c),o=n(o-c);return(0,l.pipe)((0,l.sortBy)((0,l.prop)("index")),(0,l.pluck)("percent"))(u)},he=/[\n\r%#()<>?[\\\]^`{}|]/g,be=e=>`data:image/svg+xml;utf8,${e.replace(/["']\);{0,}$/,"").replace(/'/g,'"').replace(/>\s{1,}</g,"><").replace(/\s{2,}/g," ").replace(he,encodeURIComponent)}`,Oe=e=>`data:image/gif;base64,${e}`,ve=e=>{switch(e){case"minutes":return ye().text("minutes");case"hours":return ye().text("hours");case"days":return ye().text("days");case"weeks":return ye().text("weeks");case"months":return ye().text("months");case"years":return ye().text("years");default:return""}};var ge=r(76665);function _e(e,t,r,n){if(null==t){const i=`\n Uri is null or undefined.\n getPartInfo parameters when the error occurred:\n 1. name - ${e}\n 2. uri - ${t}\n 3. fullUri - ${r}\n 4. attrType - ${ce(n)?JSON.stringify(n):n}\n `;console.error(i)}var i={name:e,valueUri:r.substr(0,r.indexOf(t)+t.length)};return n&&n.uri&&(i.uri=n.uri.substr(0,n.uri.indexOf(e)+e.length)),i.hasChildren=i.valueUri!==r,i}function Ae(e,t){for(var r=e.substr(e.indexOf("/attributes/")+12).split("/"),n=[],i=0;i<r.length;i+=2)n.push(_e(r[i],r[i+1],e,t));return n}function Ne(e,t,r,n,i,a,o){void 0===a&&(a=0);var s=Ae(r,t)[a];if(!s){const s=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(Ae(r,t))}\n addAttribute params when error occurred:\n attributes: ${JSON.stringify(e)}\n attrType: ${JSON.stringify(t)}\n uri: ${r}\n value: ${JSON.stringify(n)}\n crosswalks: ${JSON.stringify(i)}\n nestingLevel: ${a}\n index: ${o}\n `;console.error(s)}if(s.hasChildren){e[s.name]||(e[s.name]=[{uri:s.valueUri,value:{},type:s.uri}]);var l=e[s.name].filter((function(e){return e.uri===s.valueUri}))[0];return Ne(l.value,t,r,n,i,a+1,o)}var u=e[t.name];if(u||(u=e[t.name]=[]),null!=n){var c={value:n.refEntity?n.value:n,uri:r,type:t.uri};return n.lookupCode&&(c.value=n.value,c.lookupCode=n.lookupCode),n.refEntity&&(c.refEntity=n.refEntity,c.label=n.label),n.refRelation&&(c.refRelation=n.refRelation),i&&(c.crosswalks=i),u.splice(o||0,0,c),n}}function Pe(e,t,r,n,i,a){void 0===a&&(a=0);var o=Ae(r,t)[a];if(!o){const o=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(Ae(r,t))}\n editAttribute params when error occurred:\n attributes: ${JSON.stringify(e)}\n attrType: ${JSON.stringify(t)}\n uri: ${r}\n value: ${JSON.stringify(n)}\n crosswalks: ${JSON.stringify(i)}\n nestingLevel: ${a}\n `;console.error(o)}if(!o.hasChildren){var s,l=e[t.name],u=l&&l.filter((function(e){return e.uri===r}))[0];return u?("[object Object]"!==u.value.toString()?(Re(n,u),i&&(u.crosswalks=i),t.cardinality&&1===t.cardinality.minValue&&1===t.cardinality.maxValue&&l.filter((function(e){return!1===e.ov})).forEach(Re.bind(null,n))):n.refEntity?(u.refRelation=n.refRelation,u.refEntity=n.refEntity,u.value=n.value,u.label=n.label):null!==n.value&&void 0!==n.value&&null!==u.value&&"object"==typeof u.value&&(u.value=n.value,u.label=n.label),s=u.value):s=Ne(e,t,r,n,i,a),s}var c=Pe(e,o,o.valueUri,{},i,a);Pe(c,t,r,n,i,a+1)}function Re(e,t){ce(e)?(t.value=e.value,t.lookupCode=e.lookupCode):(t.value=e,t.lookupCode&&(t.lookupCode=e))}function Se(e,t,r,n){void 0===n&&(n=0);var i=Ae(r)[n];if(!i){const i=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(Ae(r,t))}\n removeAttribute params when error occurred:\n attributes: ${JSON.stringify(e)}\n attrType: ${JSON.stringify(t)}\n uri: ${r}\n nestingLevel: ${n}\n `;console.error(i)}if(i.hasChildren){var a=(e[i.name]||[]).filter((function(e){return e.uri===i.valueUri}))[0];a&&Se(a.value,t,r,n+1)}else{var o=e[t.name];o&&(o.forEach((function(e,t){e.uri===r&&o.splice(t,1)})),0===o.length&&delete e[t.name])}}function we(e,t){e.roles=t||[]}function Ie(e,t){e.tags=t||[]}function Ue(e,t){e.startDate=t||""}function Ce(e,t){e.endDate=t||""}var De=r(37164);const Le="1Tempo4rary",je="1Tepmo4Rel",ke=(0,l.cond)([[l.isNil,(0,l.always)("")],[(0,l.test)(/[^/]$/),(0,l.concat)(l.__,"/")]]),Fe=(0,De.kP)("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",16),Me=()=>`${Fe()}${Date.now()}`,xe=()=>`1Tempo4DCR${Me()}`,$e=e=>`${e}/uri$$${Me()}`,Ve=e=>()=>$e(e),Ge=(e,t)=>{const r=ke(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return $e(n)},We=e=>e&&e.includes("uri$$"),Be=Ve("entities"),Ye=Ve("relations"),qe=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),He=(0,l.startsWith)("relations/"),Je=(0,l.startsWith)("entities/"),Qe=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/entityTypes/")),Ke=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/relationTypes/")),Xe=(0,l.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),ze=(0,l.pipe)((0,l.split)("/"),l.head),Ze=(0,l.pipe)((0,l.split)("/"),l.last),et=e=>e.split(".").slice(0,2).join("."),tt=(e,t)=>{const[r,...n]=e.split("."),i=n.join(`/${r}/`);return`${t||""}/${r+(i&&`/${i}`)}`},rt=(0,l.curry)(((e,t)=>`${e}/attributes/${t}`)),nt=(e,t)=>{const r=e.split("/"),n=t.split("/");return 2===r.length?t:[n,r.slice(2,3),r.slice(3).map(((e,t)=>t%2?r[2]:e))].flat().slice(0,-1).join("/")},it=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},at=(0,l.either)((0,l.startsWith)("attributes."),(0,l.startsWith)("analyticsAttributes.")),ot=e=>2===e.split("/").length,st=e=>5===e.split("/").length,lt=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},ut=e=>e.replace(/uri\$\$/g,Le),ct=e=>e.includes("changeRequests/")&&e.includes("/changes/"),pt=e=>e.split("/changes/")[1];let dt,yt,ft,Tt,Et,mt,ht,bt,Ot,vt,gt,_t,At,Nt,Pt,Rt,St,wt,It,Ut,Ct,Dt,Lt,jt,kt,Ft,Mt,xt,$t,Vt,Gt,Wt,Bt,Yt,qt,Ht,Jt,Qt,Kt;var Xt;!function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(dt||(dt={})),function(e){e.local="local",e.validationService="validationService"}(yt||(yt={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(ft||(ft={})),function(e){e[e.OBJECT_NOT_FOUND=101]="OBJECT_NOT_FOUND",e[e.CROSSWALK_NOT_FOUND=102]="CROSSWALK_NOT_FOUND",e[e.TENANT_NOT_CONFIGURED=127]="TENANT_NOT_CONFIGURED",e[e.ACCESS_DENIED=403]="ACCESS_DENIED",e[e.DVF_NOT_CONFIGURED=902]="DVF_NOT_CONFIGURED",e[e.DCR_ALREADY_EXISTS=10015]="DCR_ALREADY_EXISTS",e[e.WORKFLOW_IS_NOT_REGISTERED_ERROR=10061]="WORKFLOW_IS_NOT_REGISTERED_ERROR"}(Tt||(Tt={})),function(e){e.WITHIN="within",e.AGO="ago",e.BETWEEN="between"}(Et||(Et={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(mt||(mt={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch",e.RELATION_ATTRIBUTE="relationAttribute"}(ht||(ht={})),function(e){e.directed="directed",e.undirected="undirected",e.bidirectional="bidirectional"}(bt||(bt={})),function(e){e.asc="asc",e.desc="desc"}(Ot||(Ot={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(vt||(vt={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(gt||(gt={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}(_t||(_t={})),function(e){e.TABLE="table",e.List="list",e.MAP="map"}(At||(At={})),function(e){e.PROFILE="profile",e.MAP="map"}(Nt||(Nt={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(Pt||(Pt={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(Rt||(Rt={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(St||(St={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(wt||(wt={})),function(e){e.EXISTS="exists",e.MISSING="missing"}(It||(It={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(Ut||(Ut={})),function(e){e.FILL_RATE="fillRate",e.LENGTH_STATISTIC="lengthStatistics",e.VALUE_DISTRIBUTION="valueDistribution",e.CROSSWALK_ANALYSIS="crosswalkAnalysis",e.DATA_VALIDATION="dataValidationFunctions",e.FREQUENCY="frequency",e.UNIQUENESS="uniqueness",e.PATTERN="pattern",e.CONSOLIDATION_RATE="consolidationRate"}(Ct||(Ct={})),function(e){e.ENTITY_TYPE="entityLevel",e.ATTRIBUTE_TYPE="attributeLevel"}(Dt||(Dt={})),function(e){e.DELETE_RELATION="DELETE_RELATION",e.CREATE_RELATION="CREATE_RELATION",e.UPDATE_RELATION="UPDATE_RELATION",e.REPOINT_RELATION="REPOINT_RELATION",e.IGNORE_RELATION="IGNORE_RELATION"}(Lt||(Lt={})),function(e){e.IN="in",e.OUT="out"}(jt||(jt={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}(kt||(kt={})),function(e){e.BAR="bar",e.DONUT="donut",e.PIE="pie",e.TREE="tree",e.TABLE="table",e.BUBBLE="bubble",e.LINE="line",e.MAP="map",e.CLOUD="cloud"}(Ft||(Ft={})),function(e){e.ActivitiesViewFacet="ActivitiesViewFacet",e.CustomActionViewFacet="CustomActionViewFacet",e.DashboardFacet="DashboardFacet",e.EntitiesByTypeViewFacet="EntitiesByTypeViewFacet",e.FilteredSavedSearchesFacet="FilteredSavedSearchesFacet",e.FilteredEntitiesViewFacet="FilteredEntitiesViewFacet",e.NotificationInboxFacet="NotificationInboxFacet",e.ProfileStatsFacet="ProfileStatsFacet"}(Mt||(Mt={})),function(e){e.Attributes="com.reltio.plugins.entity.attributes.AttributesView",e.HierarchyTree="com.reltio.plugins.react.ReactHierarchyTreeView",e.HierarchyPaths="com.reltio.plugins.entity.HierarchyPathsView",e.RelationsTable="com.reltio.plugins.react.ReactRelationshipTableView",e.Relations="com.reltio.plugins.entity.relations.RelationsView",e.SingleAttribute="com.reltio.plugins.entity.attributes.SingleAttributeView",e.AttributeTable="com.reltio.plugins.entity.attributes.AttributeTableView",e.Custom="com.reltio.plugins.ui.CustomActionView",e.Map="com.reltio.plugins.react.EntityMapView",e.ImageAttribute="com.reltio.plugins.entity.attributes.ImageAttributeView",e.PotentialMatches="com.reltio.plugins.entity.PotentialMatchesView"}(xt||(xt={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}($t||($t={})),function(e){e.DQDashboard="DQDashboardView",e.Dashboard="DashboardView",e.RelationshipSearch="RelationshipSearch",e.ProfileActivityLog="ProfileActivityLogView",e.Interactions="InteractionsView",e.Graph="GraphView",e.Relationships="RelationshipsView",e.PotentialMatches="PotentialMatchesView",e.Sources="SourcesView",e.Profile="ProfileView",e.NestedProfile="NestedProfileView",e.Search="SearchView",e.Tags="Tags",e.Pivoting="Pivoting",e.DCRReview="DCRReview"}(Vt||(Vt={})),function(e){e.CustomAction="CustomAction",e.ConsoleAppAction="ConsoleAppAction"}(Gt||(Gt={})),function(e){e.NEW="new",e.CLASSIC="classic"}(Wt||(Wt={})),function(e){e.ASC_BY_NAME="ascByName"}(Bt||(Bt={})),function(e){e.SIMPLE_NETWORK="Simple network",e.VERTICAL_TB="Vertical hierarchy",e.HORIZONTAL_LR="Horizontal hierarchy",e.DIRECTED_NETWORK="Directed Network",e.TREE="Tree"}(Yt||(Yt={})),function(e){e.SET_HTML="setHtml",e.SHOW_POPUP="showPopup",e.HIDE_POPUP="hidePopup",e.LOG="log",e.SET_VISIBILITY="setVisibility",e.MESSAGE="message",e.SET_ENABLED="setEnabled",e.SET_TOOLTIP="setToolTip",e.SET_LABEL="setLabel",e.SET_HEIGHT="setHeight",e.SET_WIDTH="setWidth",e.RETURN_PROCESSED_API_RESPONSE="returnProcessedApiResponse",e.RETURN_PROCESSED_API_REQUEST="returnProcessedApiRequest",e.REQUEST="request",e.EVENT="event"}(qt||(qt={})),function(e){e.WORKFLOW="workflow",e.WORKFLOW_START_PROCESS_FROM_QUERY="workflow/startProcessFromQuery",e.API="api",e.GET_ENTITY_URI="getEntityUri",e.GET_ENTITY="getEntity",e.GET_API_PATH="getApiPath",e.WORKFLOW_GET_WORKFLOW_PATH="workflow/getWorkflowPath",e.GET_SEARCH_QUERY="getSearchQuery",e.GET_TENANT="getTenant",e.GET_USER="getUser",e.GET_PERSPECTIVE="getPerspective",e.SET_PERSPECTIVE="setPerspective",e.SET_ENTITY_URI="setEntityUri",e.ALERT="alert",e.CONFIRM="confirm",e.PROMPT="prompt",e.OPEN_WINDOW="openWindow",e.GET_CONFIGURATION="getConfiguration",e.GET_UI_CONFIGURATION="getUiConfiguration",e.OPEN_SEARCH="openSearch",e.WORKFLOW_CHECK_PERMISSION="workflow/checkPermission",e.RELOAD_PAGE="reloadPage"}(Ht||(Ht={})),function(e){e.INSERT_ATTRIBUTE="INSERT_ATTRIBUTE",e.UPDATE_ATTRIBUTE="UPDATE_ATTRIBUTE",e.DELETE_ATTRIBUTE="DELETE_ATTRIBUTE",e.PIN_ATTRIBUTE="PIN_ATTRIBUTE",e.IGNORE_ATTRIBUTE="IGNORE_ATTRIBUTE",e.CREATE_ENTITY="CREATE_ENTITY",e.CREATE_RELATIONSHIP="CREATE_RELATIONSHIP",e.UPDATE_TAGS="UPDATE_TAGS",e.UPDATE_ROLES="UPDATE_ROLES",e.UPDATE_START_DATE="UPDATE_START_DATE",e.UPDATE_END_DATE="UPDATE_END_DATE",e.UPDATE_PROFILE_PIC_BY_URL="UPDATE_PROFILE_PIC_BY_URL",e.UPDATE_PROFILE_PIC_BY_URI="UPDATE_PROFILE_PIC_BY_URI",e.DELETE_RELATIONSHIP="DELETE_RELATIONSHIP"}(Jt||(Jt={})),function(e){e.AWAITING_REVIEW="AWAITING_REVIEW",e.APPLIED="APPLIED",e.REJECTED="REJECTED"}(Qt||(Qt={})),function(e){e.ADDED="added",e.EDITED="edited",e.DELETED="deleted",e.PINNED="pinned",e.IGNORED="ignored",e.PIN_DELETED="pin_deleted",e.IGNORE_DELETED="ignore_deleted"}(Kt||(Kt={})),function(e){e.TYPE_STRING="String",e.TYPE_TEXT="Text",e.TYPE_PASSWORD="Password",e.TYPE_LONG="Long",e.TYPE_INT="Int",e.TYPE_DOLLAR="Dollar",e.TYPE_FLOAT="Float",e.TYPE_DOUBLE="Double",e.TYPE_NUMBER="Number",e.TYPE_BOOLEAN="Boolean",e.TYPE_BOOLEAN_RADIO="Boolean_Radio",e.TYPE_DATE="Date",e.TYPE_TIMESTAMP="Timestamp",e.TYPE_ACTIVENESS_DATE="ActivenessDate",e.TYPE_LOCAL_DATE="LocalDate",e.TYPE_BLOB="Blob",e.TYPE_ENUM="Enum",e.TYPE_CIK_ID="cik id",e.TYPE_LOOKUP="Lookup",e.TYPE_TYPEAHEAD="Typeahead",e.TYPE_URL="URL",e.TYPE_BLOG_URL="Blog URL",e.TYPE_IMAGE_URL="Image URL",e.TYPE_EMAIL="Email",e.TYPE_DEPENDENT_LOOKUP="DependentLookup",e.TYPE_ENTITY_ID="EntityId",e.TYPE_RDM_LOOKUPS_NOT_RESOLVED="RdmLookupsNotResolved",e.TYPE_COUNT="Count",e.TYPE_FILE="File",e.TYPE_SELECT="Select",e.TYPE_NESTED="Nested",e.TYPE_REFERENCE="Reference",e.TYPE_IMAGE="Image",e.TYPE_SSN="SSN"}(Xt||(Xt={}));const zt=Xt;let Zt,er;!function(e){e.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}(Zt||(Zt={})),function(e){e.Saving="Saving",e.Cloning="Cloning"}(er||(er={}));const tr=(0,l.prop)("referencedEntityTypeURI"),rr=(0,l.prop)("relationshipTypeURI"),nr=(0,l.prop)("referencedAttributeURIs"),ir=(0,l.curry)(((e,t)=>(0,l.pipe)(nr,(0,l.filter)((0,l.startsWith)(e)))(t))),ar=ir("configuration/relationTypes"),or=ir("configuration/entityTypes"),sr=(0,l.pipe)((0,l.prop)("uri"),(0,l.startsWith)("configuration/relationTypes")),lr=(0,l.filter)(sr),ur=(e,t)=>!t||t.some((t=>t===e.uri));function cr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pr=(0,l.allPass)([(0,l.propSatisfies)((0,l.either)(l.isNil,Qe),"uri"),(0,l.prop)("faceted"),(0,l.propEq)("type",zt.TYPE_STRING)]),dr=(0,l.has)("values"),yr=(0,l.cond)([[(0,l.has)("dependentLookupCode"),(0,l.always)(zt.TYPE_DEPENDENT_LOOKUP)],[(0,l.has)("lookupCode"),(0,l.always)(zt.TYPE_LOOKUP)],[dr,(0,l.always)(zt.TYPE_ENUM)],[pr,(0,l.always)(zt.TYPE_TYPEAHEAD)],[(0,l.propEq)("type",zt.TYPE_BOOLEAN),(0,l.always)(zt.TYPE_BOOLEAN_RADIO)],[l.T,(0,l.prop)("type")]]),fr=(0,l.pipe)((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){cr(e,t,r[t])}))}return e}({},e,{type:yr(e)})),(0,l.pick)(["type","values","lookupCode","uri","dependentLookupCode","singleValue"])),Tr=e=>!!e&&(!!e.autoGenerated&&e.type!==zt.TYPE_NESTED||!!e.parentAutoGenerated),Er=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.test)(/\/analyticsAttributes\//)),mr=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.startsWith)("configuration/"),l.not),hr=e=>Er(e)?"analyticsAttributes":"attributes",br=(0,l.propEq)("hidden",!0),Or=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("type")),(0,l.equals)(e))(t))),vr=Or(zt.TYPE_NESTED),gr=Or(zt.TYPE_REFERENCE),_r=Or(zt.TYPE_IMAGE),Ar=(0,l.either)(vr,gr),Nr=(e,t)=>{const r=Er(e)?"analyticsAttributes":"attributes",n=e.split(`/${r}/`);return[r,...Array.isArray(t)?[...(0,l.chain)((0,l.prop)("name"),t),(0,l.last)(n)]:[...n.slice(1)]].join(".")},Pr=(0,l.either)((0,l.prop)("lookupCode"),(0,l.prop)("dependentLookupCode")),Rr=(0,l.pipe)(Pr,Boolean),Sr=(0,l.pipe)((0,l.prop)("dependentLookupCode"),Boolean),wr=(0,l.both)(Rr,(0,l.pipe)(Pr,("rdm",(0,l.pipe)(ze,(0,l.equals)("rdm")))));const Ir=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=hr({uri:t}),i=e=>e.split(`/${n}/`).length,a=(e.entityTypes||[]).concat(e.relationTypes||[]),o=r?a.find((0,l.propEq)("uri",r)):null,s=o?i(o.uri):0,u=(r,i)=>{const o=t.split(`/${n}/`).slice(0,i+1).join(`/${n}/`),s=(0,l.last)(o.split(`/${n}/`)),c=(r?r[n]||Cr(e,r)||[]:a).find((e=>{let{uri:t,name:r}=e;return t===o||r===s})),p=c?[c]:[];return c&&o!==t&&p.push(...u(c,i+1)),p},c=u(o,s),p=c.length===i(t)-s;return p?c:[]},Ur=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=Ir(e,t,r);return n.length?(0,l.last)(n):null},Cr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{entityTypes:[]},t=arguments.length>1?arguments[1]:void 0;return(0,l.cond)([[(0,l.has)("analyticsAttributes"),(0,l.prop)("analyticsAttributes")],[(0,l.anyPass)([(0,l.propEq)("type",zt.TYPE_NESTED),(0,l.propEq)("type",zt.TYPE_IMAGE)]),(0,l.prop)("attributes")],[(0,l.propEq)("type",zt.TYPE_REFERENCE),(0,l.pipe)(nr,(0,l.map)((t=>Ur(e,t))),(0,l.reject)(l.isNil))],[l.T,(0,l.always)(null)]])(t)},Dr=[zt.TYPE_ACTIVENESS_DATE,zt.TYPE_DATE,zt.TYPE_TIMESTAMP,zt.TYPE_LOCAL_DATE],Lr=[zt.TYPE_ACTIVENESS_DATE,zt.TYPE_TIMESTAMP,zt.TYPE_LOCAL_DATE],jr=e=>Dr.includes(e),kr=e=>Lr.includes(e),Fr=[zt.TYPE_INT,zt.TYPE_LONG,zt.TYPE_NUMBER,zt.TYPE_FLOAT,zt.TYPE_DOUBLE,zt.TYPE_COUNT],Mr=e=>Fr.includes(e),xr=e=>[zt.TYPE_FLOAT,zt.TYPE_DOUBLE].includes(e),$r=[zt.TYPE_BOOLEAN,zt.TYPE_BOOLEAN_RADIO,zt.TYPE_RDM_LOOKUPS_NOT_RESOLVED],Vr=e=>$r.includes(e),Gr=[zt.TYPE_URL,zt.TYPE_BLOG_URL,zt.TYPE_IMAGE_URL],Wr=e=>Gr.includes(e),Br=Or(zt.TYPE_EMAIL),Yr=e=>zt.TYPE_SSN===e;var qr,Hr=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(qr||(qr={}));const Jr=(0,l.curry)(((e,t,r)=>{var n;const i=e===qr.READ?["ROLE_UI_ALL","ROLE_UI_ALL_READONLY"]:["ROLE_UI_ALL"],a=null===(n=r[e])||void 0===n?void 0:n.roles;return!a||a.concat(i).some((e=>t.includes(e)))})),Qr=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),Kr=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),Qr),Xr=(0,l.pipe)((0,l.reject)(E),Kr);function zr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Zr(e,t,r[t])}))}return e}function Zr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const en=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r={dcrObjectUris:[],dcrUri:t},n=e=>e&&e.includes("changeRequest"),i=(0,l.propSatisfies)(n,"uri"),a=(0,l.pipe)((0,l.prop)("changes"),l.keys),o=(0,l.when)(i,(0,l.applySpec)({dcrObjectUris:a,dcrUri:(0,l.prop)("uri")})),s=e=>{let{dcrObjectUris:t,dcrUri:n}=e;r.dcrObjectUris=r.dcrObjectUris.concat(t),r.dcrUri=r.dcrUri||n},u=(0,l.pipe)(o,s,(()=>E())),c=(0,l.pipe)((0,l.prop)("dcrUri"),(0,l.unless)(l.isNil,(0,l.pipe)((0,l.split)("/"),(0,l.prop)(1)))),p=(e,t)=>(e+=e.includes("?")?"&":"?")+Qr(t),d=t=>{const n=c(r);return n?p(t,{changeRequestId:n}):e?p(t,{alwaysCreateDCR:!0}):t},y=()=>r.dcrObjectUris,f=()=>r.dcrUri;let T,E=l.identity;const m=()=>!e||f()||T?T||Promise.resolve():(T=new Promise((e=>{E=e})),Promise.resolve());return{updateDCRUriFromResponse:u,enhanceUriWithDCR:d,getDCRObjectUris:y,getDCRUri:f,getDcrUriAwait:m}},tn=e=>t=>{if(!(e=>!ce(e.value))(t)){var r;const n=`${e}/${null!==(r=t.refEntity)&&void 0!==r&&r.objectURI?Ze(t.refEntity.objectURI):xe()}`;return zr({},t,{uri:n,value:(0,l.fromPairs)((0,l.map)(rn(n),(0,l.toPairs)(t.value)))})}return zr({},t,{uri:`${e}/${xe()}`})},rn=e=>t=>{let[r,n]=t;return[r,(0,l.map)(tn(`${e}/${r}`),n)]},nn=e=>{const{uri:t}=e;return(0,l.evolve)({attributes:(0,l.pipe)(l.toPairs,(0,l.map)(rn(`${t}/attributes`)),l.fromPairs)},e)},an=e=>(0,l.evolve)({changes:(0,l.map)((0,l.map)((0,l.when)((0,l.propEq)("type",Jt.CREATE_ENTITY),(0,l.evolve)({newValue:nn}))))},e),on={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},sn=(0,l.equals)(on.SUGGESTING),ln=(0,l.equals)(on.EDITING),un=(0,l.equals)(on.VIEWING),cn=(0,l.either)(ln,sn),pn=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),dn=(0,l.curry)(((e,t)=>(0,l.pipe)(pn(e),(0,l.prop)("extendsTypeURI"))(t))),yn=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(dn(e,r)));return n(r)})),fn=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=dn(e,n);return r})),Tn=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?Tn(e,pn(e,t.extendsTypeURI),r):void 0,En=(e,t)=>{const r=t.map(fn(e));return(r.length?r.reduce(l.intersection):[])[0]},mn=(e,t)=>Tn(e,(0,l.is)(Object,t)?t:pn(e,t),"typeImage"),hn=(e,t)=>e.entityTypes.reduce(((r,n)=>n.uri!==t&&yn(e,t,n.uri)?r.concat(n.uri):r),[]),bn={EQUALS:"equals",NOT_EQUALS:"not equals",EXISTS:"exists",FULL_TEXT:"fullText",HAS_ALL:"hasAll",MISSING_VALUE:"missing",IN_RANGE:"range",LT:"lt",LTE:"lte",GT:"gt",GTE:"gte",STARTS_WITH:"startsWith",COUNT_EQUALS:"count.equals",COUNT_NOT_EQUALS:"count.not.equals",COUNT_LT:"count.less",COUNT_LTE:"count.less.or.equals",COUNT_GT:"count.greater",COUNT_GTE:"count.greater.or.equals",COUNT_RANGE:"count.range",IN_FILE:"in.file",NOT_IN_FILE:"not.in.file",CONTAINS:"contains",ON:"on",BEFORE:"before",AFTER:"after",WITHIN:"within"},On={LIST_EQUALS:"listEquals",NOT_LIST_EQUALS:"not listEquals",LIST_EQUALS_CASE_SENSITIVE:"listEqualsCaseSensitive",NOT_LIST_EQUALS_CASE_SENSITIVE:"not listEqualsCaseSensitive"},vn={[bn.EQUALS]:"equals",[bn.NOT_EQUALS]:"not",[bn.STARTS_WITH]:"starts with",[bn.MISSING_VALUE]:"missing value",[bn.IN_RANGE]:"in range",[bn.HAS_ALL]:"has all",[bn.FULL_TEXT]:"full text",[bn.EXISTS]:"exists",[bn.COUNT_EQUALS]:"count equals",[bn.COUNT_NOT_EQUALS]:"count not equal",[bn.COUNT_LT]:"count less",[bn.COUNT_LTE]:"count less or equal",[bn.COUNT_GT]:"count greater",[bn.COUNT_GTE]:"count greater or equal",[bn.COUNT_RANGE]:"count in range",[bn.LT]:"less than",[bn.LTE]:"less than or equal",[bn.GT]:"greater than",[bn.GTE]:"greater than or equal",[bn.IN_FILE]:"in file",[bn.NOT_IN_FILE]:"not in file",[bn.CONTAINS]:"contains",[bn.ON]:"on",[bn.BEFORE]:"before",[bn.AFTER]:"after",[bn.WITHIN]:"within"},gn="in",_n="notIn",An="not range",Nn=e=>({[gn]:bn.EQUALS,[_n]:bn.NOT_EQUALS}[e]||e);var Pn,Rn;!function(e){e.LAST_DAY="lastDay",e.LAST_WEEK="lastWeek",e.LAST_MONTH="lastMonth",e.LAST_6MONTHS="last6Months",e.LAST_YEAR="lastYear",e.PICK_DATE="pickDate"}(Pn||(Pn={})),function(e){e.LAST_3DAYS="last3Days"}(Rn||(Rn={}));const Sn=["LAST_DAY","LAST_3DAYS","LAST_WEEK","LAST_MONTH","LAST_6MONTHS","LAST_YEAR","PICK_DATE"].reduce(((e,t)=>(e[t]=Pn[t]||Rn[t],e)),{}),wn={[Pn.LAST_DAY]:"Last 24 hours",[Rn.LAST_3DAYS]:"Last 3 days",[Pn.LAST_WEEK]:"Last 7 days",[Pn.LAST_MONTH]:"Last month",[Pn.LAST_6MONTHS]:"Last 6 months",[Pn.LAST_YEAR]:"Last year",[Pn.PICK_DATE]:"Pick date"},In={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},Un={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},Cn="<No label>",Dn="__number",Ln={IN:"in",OUT:"out"};function jn(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){kn(e,t,r[t])}))}return e}function kn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Fn={startDate:{type:zt.TYPE_ACTIVENESS_DATE,get label(){return ye().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:zt.TYPE_ACTIVENESS_DATE,get label(){return ye().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},Mn=jn({id:{type:zt.TYPE_ENTITY_ID,get label(){return ye().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},Fn,{roles:{type:zt.TYPE_STRING,get label(){return ye().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:zt.TYPE_STRING,get label(){return ye().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),xn={workflow:{type:zt.TYPE_STRING,get label(){return ye().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:zt.TYPE_STRING,get label(){return ye().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:zt.TYPE_STRING,get label(){return ye().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:zt.TYPE_TIMESTAMP,get label(){return ye().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},$n={commenter:{type:zt.TYPE_STRING,get label(){return ye().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},Vn={notResolved:{type:zt.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return ye().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},Gn={createdBy:{type:zt.TYPE_STRING,get label(){return ye().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:zt.TYPE_STRING,get label(){return ye().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:zt.TYPE_TIMESTAMP,get label(){return ye().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:zt.TYPE_TIMESTAMP,get label(){return ye().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},Wn={matches:{type:zt.TYPE_COUNT,get label(){return ye().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:zt.TYPE_COUNT,get label(){return ye().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0}},Bn={sourceSystems:{type:zt.TYPE_STRING,get label(){return ye().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:zt.TYPE_STRING,get label(){return ye().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:zt.TYPE_INT,get label(){return ye().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:zt.TYPE_TIMESTAMP,get label(){return ye().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:zt.TYPE_TIMESTAMP,get label(){return ye().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:zt.TYPE_TIMESTAMP,get label(){return ye().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:zt.TYPE_TIMESTAMP,get label(){return ye().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:zt.TYPE_TIMESTAMP,get label(){return ye().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:zt.TYPE_STRING,get label(){return ye().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}};let Yn;!function(e){e.matchRules="matchRules",e.MLRecommendedMatch="MLRecommendedMatch"}(Yn||(Yn={}));const qn={[Yn.matchRules]:{type:zt.TYPE_STRING,get label(){return ye().text("Match Rules")},uri:Yn.matchRules,name:Yn.matchRules,faceted:!0,hideForDataTenant:!0},[Yn.MLRecommendedMatch]:{type:zt.TYPE_STRING,get label(){return ye().text("Match IQ")},uri:Yn.MLRecommendedMatch,name:Yn.MLRecommendedMatch,faceted:!0,hideForDataTenant:!0}},Hn=jn({},Mn,xn,$n,Vn,Gn,Wn,Bn,qn,{type:{type:zt.TYPE_STRING,get label(){return ye().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}}),Jn="NOT_MATCH";var Qn=r(13980),Kn=r.n(Qn);function Xn(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){zn(e,t,r[t])}))}return e}function zn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zn=Kn().oneOf(["mobile","tablet","desktop"]),ei=Kn().shape({deviceTypes:Kn().oneOfType([Zn,Kn().arrayOf(Zn)]),roles:Kn().arrayOf(Kn().string)}),ti=Kn().shape({value:Kn().string,lookupCode:Kn().string}),ri=Kn().shape({link:Kn().string,filename:Kn().string}),ni=Kn().shape({displayName:Kn().string,parent:Kn().string}),ii=Kn().oneOfType([Kn().string,Kn().number,Kn().bool,ti]),ai=Kn().oneOfType([ii,Kn().arrayOf(ii)]),oi=Kn().shape({fieldName:Kn().string,values:Kn().arrayOf(ai),filter:Kn().string,type:Kn().string}),si=Kn().shape({minValue:Kn().number,maxValue:Kn().number}),li=Kn().shape({label:Kn().string,name:Kn().string,description:Kn().string,type:Kn().string,hidden:Kn().bool,faceted:Kn().bool,searchable:Kn().bool,uri:Kn().string,access:Kn().arrayOf(Kn().string),cardinality:si}),ui=Kn().shape({label:Kn().string,uri:Kn().string,typeColor:Kn().string,direction:Kn().string,startObject:Kn().object,endObject:Kn().object}),ci=Kn().shape({typeColor:Kn().string,typeIcon:Kn().string,typeImage:Kn().string,label:Kn().string,uri:Kn().string,attributes:Kn().arrayOf(li)}),pi=Kn().shape({uri:Kn().string,label:Kn().string,memberTypes:Kn().array,extendsTypeUri:Kn().string,attributes:Kn().arrayOf(li)}),di=Kn().shape({uri:Kn().string,label:Kn().string,extendsTypeUri:Kn().string,relationshipTypeURIs:Kn().arrayOf(Kn().string)}),yi=Kn().shape({uri:Kn().string,description:Kn().string,label:Kn().string,schemaVersion:Kn().string,entityTypes:Kn().arrayOf(ci),roles:Kn().arrayOf(Kn().object),groupTypes:Kn().arrayOf(Kn().object),relationTypes:Kn().arrayOf(ui),graphTypes:Kn().arrayOf(di),interactionTypes:Kn().arrayOf(pi),sources:Kn().arrayOf(Kn().object)}),fi=Kn().shape({uri:Kn().string,type:Kn().string}),Ti=Kn().shape({uri:Kn().string,attributes:Kn().object,type:Kn().string,timestamp:Kn().number,members:Kn().object}),Ei=Kn().shape({uri:Kn().string,type:Kn().string}),mi=Kn().shape({value:Kn().object,ov:Kn().bool,type:Kn().string,uri:Kn().string}),hi=Kn().shape({refEntity:Kn().oneOfType([Kn().array,Kn().object]),refRelation:Kn().oneOfType([Kn().array,Kn().object]),value:Kn().object,ov:Kn().bool,type:Kn().string,uri:Kn().string}),bi=Kn().oneOf((0,l.values)(on)),Oi=Kn().shape({type:Kn().oneOf(Object.values(dt)).isRequired,attributeTypeUri:Kn().string.isRequired,parentUri:Kn().string.isRequired,uri:Kn().string,message:Kn().string}),vi={attributeType:li,showEmptyEditors:Kn().bool,lazy:Kn().bool,mode:bi,metadata:yi,ownError:Oi,errors:Kn().arrayOf(Oi),crosswalks:Kn().array,onAddAttributes:Kn().func,onAddOneMore:Kn().func,onDeleteAttribute:Kn().func,onChangeAttribute:Kn().func,additionalControlsRenderer:Kn().func,hideDeleteButton:Kn().bool,showNonOv:Kn().bool,state:Kn().oneOf(["deleted","edited"]),expanded:Kn().bool},gi=Xn({attributeValue:mi},vi),_i=Xn({attributeValue:hi},vi),Ai=Kn().shape({value:Kn().oneOfType([Kn().string,Kn().bool,Kn().number]),ov:Kn().bool,type:Kn().string,uri:Kn().string,lookupCode:Kn().string,lookupRawValue:Kn().string}),Ni=Kn().shape({totalOvValues:Kn().number,totalValues:Kn().number}),Pi=Kn().shape({inRelations:Kn().arrayOf(Kn().oneOfType([Kn().object,Kn().string])),outRelations:Kn().arrayOf(Kn().oneOfType([Kn().object,Kn().string])),groups:Kn().arrayOf(Kn().string),entityTypes:Kn().arrayOf(Kn().string),nextEntry:Kn().object}),Ri=Kn().oneOf(["asc","desc"]),Si=Kn().shape({id:Kn().string,content:Pi,allowOnlyCreateNew:Kn().bool,sortColumn:Kn().string,sortOrder:Ri,"text-empty":Kn().string,max:Kn().number,icon:Kn().string,caption:Kn().string,canCreate:ei,canRead:ei,canUpdate:ei,canDelete:ei,editingEnabled:Kn().bool}),wi=Kn().shape({id:Kn().string,caption:Kn().string,pageSize:Kn().number,icon:Kn().string,canCreate:ei,canRead:ei,canUpdate:ei,canDelete:ei,attributes:Kn().object}),Ii=Kn().shape({entityUri:Kn().string,entityType:Kn().string,entityLabel:Kn().string,object:fi}),Ui=Kn().shape({relationUri:Kn().string,relationType:Kn().string,relationLabel:Kn().string,direction:Kn().string,object:Ei}),Ci=Kn().shape({entity:Ii,relation:Ui}),Di=Kn().shape({value:Kn().string,isRawFilter:Kn().bool}),Li=Kn().shape({id:Kn().string,label:Kn().string,name:Kn().string,availableEntityTypes:Kn().array}),ji=Kn().shape({id:Kn().string,allowMergeAll:Kn().bool,matchActions:Kn().object,availableTabs:Kn().arrayOf(Kn().oneOf(["findMatches","potentialMatches","notAMatch"]))}),ki=Kn().shape({matchRules:Kn().arrayOf(Kn().string),object:fi,shortestTransitiveMatchPath:Kn().arrayOf(Kn().shape({matchRules:Kn().arrayOf(Kn().string),match:Kn().string})),direct:Kn().bool,matchScore:Kn().number}),Fi=Kn().arrayOf(ki),Mi=Kn().arrayOf(Kn().shape({uri:Kn().string,label:Kn().string})),xi=[{label:ye().text("And"),value:"and"},{label:ye().text("Or"),value:"or"},{label:ye().text("And not"),value:"and not"},{label:ye().text("Or not"),value:"or not"}];function $i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vi=(0,l.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Gi=(0,l.pipe)(Vi,(0,l.propOr)("","label")),Wi=(0,l.curry)(((e,t)=>{const r=Vi(e,t);return[(0,l.path)(["startObject","objectTypeURI"],r),(0,l.path)(["endObject","objectTypeURI"],r)]})),Bi=(0,l.curry)(((e,t,r)=>{const[n,i]=Wi(e,r);return yn(e,n,t)||yn(e,i,t)})),Yi=(0,l.pipe)((0,l.propOr)([],"relationTypes"),(0,l.reduce)(((e,t)=>{let{uri:r,label:n}=t;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){$i(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),qi=function(){let{reversedContextLabels:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={},r=r=>n=>{let{label:i}=n;const a=r===(e?Ln.OUT:Ln.IN)?"startObject":"endObject",{directionalContext:o}=n[a];return"directed"===n.direction&&1===(0,l.propOr)(0,"length",o)&&(i+=` (${o[0].labelPattern})`),!(i in t)&&(t[i]=!0,!0)},n=r(Ln.IN),i=r(Ln.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},Hi=(0,l.pathOr)("",["directionalContext",0,"labelPattern"]),Ji=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?Ji(e,Vi(e,t.extendsTypeURI),r):void 0,Qi={CREATE:"CREATE",READ:"READ",UPDATE:"UPDATE",DELETE:"DELETE",INITIATE_CHANGE_REQUEST:"INITIATE_CHANGE_REQUEST",MERGE:"MERGE",UNMERGE:"UNMERGE"},Ki=(0,l.curry)(((e,t)=>e.every((e=>Xi(e,t))))),Xi=(0,l.curry)(((e,t)=>{const r=Tr(t);return zi(e,t)&&(e===Qi.READ||!r)})),zi=(e,t)=>!t||!t.access||t.access.includes(e),Zi=(0,l.curry)(((e,t,r)=>Xi(Qi.READ,r)&&(sn(t)?Xi(Qi.INITIATE_CHANGE_REQUEST,r):Xi(e,r)))),ea=Zi(Qi.CREATE),ta=Zi(Qi.DELETE),ra=Zi(Qi.UPDATE),na=Ki([Qi.CREATE,Qi.MERGE,Qi.READ,Qi.UPDATE]),ia=Ki([Qi.UPDATE,Qi.READ,Qi.CREATE]),aa=Ki([Qi.UPDATE,Qi.READ]),oa=Ki([Qi.DELETE,Qi.UPDATE,Qi.READ]),sa=(0,l.curry)(((e,t,r)=>e[r]||e[((e,t)=>(0,l.pipe)((0,l.propOr)([],"matchGroups"),(0,l.find)((0,l.propEq)("uri",t)),(0,l.defaultTo)({}),(0,l.prop)("type"))(e))(t,r)]||e["*"])),la=(e,t,r)=>(0,l.pipe)((0,l.map)(sa(e,t)),(0,l.filter)(l.identity))(r),ua=(e,t,r)=>{const n=la(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&Xi(Qi.MERGE,r)},ca=(0,l.curry)(((e,t,r,n)=>{const i=Vi(e,n),[a,o]=Wi(e,n);return i&&Xi(Qi.CREATE,i)&&yn(e,a,t.type)&&yn(e,o,r.type)})),pa=(e,t,r,n,i)=>{const a=pn(e,n.type),o=la(t,a,r).map((e=>{let{createRelation:t}=e;return t})).filter(l.identity);return o.some((t=>{let{inRelations:r=[],outRelations:a=[]}=t;return r.some(ca(e,n,i))||a.some(ca(e,i,n))}))},da=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=pn(e,r.type),o=(0,l.propOr)({},"matchActions",t);return{canMerge:ua(o,i,a),canAddRelation:pa(e,o,i,r,n),canMark:Xi(Qi.UPDATE,a)&&Xi(Qi.READ,a)}},ya=(e,t,r,n)=>(0,l.pipe)((0,l.map)((n=>da(e,t,n.object,r,n.matchRules))),(0,l.reduce)((0,l.mergeWith)(l.and),{}))(n),fa=Er,Ta=(0,l.complement)(fa),Ea=Xi(Qi.READ),ma=e=>{let{attributeType:t,mode:r}=e;return Ta(t)&&ea(r,t)&&!br(t)},ha=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=We(r.uri),o=ra(n),s=ea(n);return(0,l.cond)([[fa,l.F],[(0,l.always)(a),l.T],[(0,l.always)(i),o],[l.T,(0,l.allPass)([o,s])]])(t)},ba=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=We(r.uri),s=ra(n),u=ta(n),c=va(Qi.UPDATE,n,a,r),p=va(Qi.DELETE,n,a,r);return(0,l.cond)([[fa,l.F],[(0,l.always)(o),l.T],[(0,l.always)(i),(0,l.allPass)([u,p])],[l.T,(0,l.allPass)([s,u,c,p])]])(t)},Oa=(0,l.curry)(((e,t,r,n)=>{const i="Reference"!==n.type&&Cr(t,n);return!i||!(0,l.pipe)((0,l.unless)(Array.isArray,l.of),(0,l.map)((0,l.prop)("value")))(r).some((r=>i.filter((e=>r&&!!r[e.name])).some((n=>!zi(e,n)||!Oa(e,t,r[n.name],n)))))})),va=(0,l.curry)(((e,t,r,n,i)=>sn(t)?Oa(Qi.INITIATE_CHANGE_REQUEST,r,n,i):Oa(e,r,n,i))),ga=(0,l.both)((0,l.complement)(br),Ea),_a="SuperUser",Aa="allTenants",Na=[Aa,"allCustomers"],Pa=e=>{let{allowedPermissionsNames:t,permissionsNames:r,permissionsConfig:n,superUserEnvironments:i}=e;return t.map((e=>{switch(e){case r.NON_SECURED:return l.T;case r.SECURED:return e=>void 0!==e.userPermissions||void 0!==(null==e?void 0:e.roles);case r.ADMIN:return(e=>t=>((null==t?void 0:t.roles)||[]).includes(e))(r.ADMIN);default:return(t=n[e])?(e,r)=>{let{params:n}=r;return((e,t,r,n)=>{const i=(0,l.path)(["userPermissions","permissions"],e)||{};return Object.keys(i).filter((e=>{const t=e.split(":"),[n]=t;return n===r.serviceId||n===_a})).filter((e=>{const t=e.split(":"),[i,a=""]=t;let o=a.split(".");return o=(0,l.endsWith)(["*"],o)?o.slice(0,-1):o,(0,l.startsWith)(o,r.resourcePath)||((e,t,r)=>{if(e===_a){const e=r?Na.concat(r.map((e=>`allTenants.${e}`))):Na,n=r&&t[0]===Aa?t.slice(0,2):t.slice(0,1);return e.map((e=>e.split("."))).some((e=>(0,l.startsWith)(n,e)))}})(i,o,n)})).some((e=>{const n=i[e];return r.privileges.every((e=>{const r=n[e],i=Array.isArray(r);return t?Array.isArray(r)&&r.some((e=>t=>t===e||"SuperUser:*"===t||t.startsWith("SuperUser:allTenants"))(t)):i}))}))})(e,n.tenant,t,i)}:l.F}var t}))},Ra={NON_SECURED:"NON_SECURED",SECURED:"SECURED",ADMIN:"ROLE_ADMIN",CAN_EXPORT:"CAN_EXPORT",CAN_EXPORT_ACTIVITIES:"CAN_EXPORT_ACTIVITIES",CAN_IMPORT_ENTITIES_FROM_DT:"CAN_IMPORT_ENTITIES_FROM_DT",CAN_READ_ENTITIES_FROM_DT:"CAN_READ_ENTITIES_FROM_DT",CAN_START_PROCESS_INSTANCE_SEARCH_QUERY:"CAN_START_PROCESS_INSTANCE_SEARCH_QUERY",CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY:"CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY",CAN_CREATE_ENVIRONMENT_CONFIG_JAR:"CAN_CREATE_ENVIRONMENT_CONFIG_JAR",CAN_CREATE_CONFIG_JAR:"CAN_CREATE_CONFIG_JAR",CAN_VIEW_ENVIRONMENT_CONFIG_JAR:"CAN_VIEW_ENVIRONMENT_CONFIG_JAR",CAN_VIEW_CONFIG_JAR:"CAN_VIEW_CONFIG_JAR",CAN_MANAGE_WORKFLOW_DEFINITION:"CAN_MANAGE_WORKFLOW_DEFINITION",CAN_VIEW_WORKFLOW_DEFINITION:"CAN_VIEW_WORKFLOW_DEFINITION",CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION:"CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION",CAN_UPDATE_WORKFLOW_DATA_TASK:"CAN_UPDATE_WORKFLOW_DATA_TASK",CAN_READ_WORKFLOW_DATA_TASK:"CAN_READ_WORKFLOW_DATA_TASK",CAN_CONFIG_ENVIRONMENT_REGISTER:"CAN_CONFIG_ENVIRONMENT_REGISTER",CAN_UPDATE_PROCESS_INSTANCE:"CAN_UPDATE_PROCESS_INSTANCE",CAN_EXECUTE_WORKFLOW_JOBS:"CAN_EXECUTE_WORKFLOW_JOBS",CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE:"CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE",CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS:"CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS",CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS:"CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS",CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA:"CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA",CAN_VIEW_WORKFLOW_JOBS:"CAN_VIEW_WORKFLOW_JOBS",CAN_MAKE_BULK_UPDATE:"CAN_MAKE_BULK_UPDATE",CAN_OPEN_DATA_LOADER_EXECUTE:"CAN_OPEN_DATA_LOADER_EXECUTE",CAN_OPEN_DATA_LOADER_READ:"CAN_OPEN_DATA_LOADER_READ",CAN_BULK_DELETE_PROFILES:"CAN_BULK_DELETE_PROFILES",CAN_READ_MDM_DATA_ENTITIES:"CAN_READ_MDM_DATA_ENTITIES",IS_FREEMIUM_ADMIN:"IS_FREEMIUM_ADMIN",CAN_READ_DVF:"CAN_READ_DVF",CAN_READ_PREFERENCES:"CAN_READ_PREFERENCES",CAN_UPDATE_PREFERENCES:"CAN_UPDATE_PREFERENCES",CAN_CREATE_PREFERENCES:"CAN_CREATE_PREFERENCES",CAN_DELETE_PREFERENCES:"CAN_DELETE_PREFERENCES"},Sa={[Ra.CAN_DELETE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["DELETE"]},[Ra.CAN_CREATE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["CREATE"]},[Ra.CAN_UPDATE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["UPDATE"]},[Ra.CAN_READ_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["READ"]},[Ra.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[Ra.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activities"],privileges:["EXECUTE"]},[Ra.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[Ra.CAN_READ_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ"]},[Ra.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[Ra.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[Ra.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[Ra.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[Ra.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[Ra.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[Ra.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[Ra.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[Ra.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[Ra.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[Ra.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[Ra.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[Ra.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[Ra.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[Ra.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[Ra.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[Ra.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[Ra.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[Ra.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[Ra.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[Ra.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[Ra.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[Ra.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[Ra.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[Ra.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]},[Ra.CAN_READ_DVF]:{serviceId:"DVF",resourcePath:["functionsManagement"],privileges:["READ"]}},wa=(0,l.curry)(((e,t,r)=>Pa({allowedPermissionsNames:e,permissionsNames:Ra,permissionsConfig:Sa}).some((e=>e(t,{params:{tenant:r}}))))),Ia=wa([Ra.CAN_EXPORT]),Ua=wa([Ra.CAN_EXPORT_ACTIVITIES]),Ca=wa([Ra.CAN_IMPORT_ENTITIES_FROM_DT]),Da=wa([Ra.CAN_READ_ENTITIES_FROM_DT]),La=wa([Ra.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),ja=wa([Ra.CAN_UPDATE_PROCESS_INSTANCE]),ka=wa([Ra.CAN_VIEW_WORKFLOW_DEFINITION]),Fa=wa([Ra.CAN_CONFIG_ENVIRONMENT_REGISTER]),Ma=wa([Ra.CAN_UPDATE_WORKFLOW_DATA_TASK]),xa=wa([Ra.CAN_READ_WORKFLOW_DATA_TASK]),$a=wa([Ra.CAN_MANAGE_WORKFLOW_DEFINITION]),Va=wa([Ra.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),Ga=wa([Ra.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),Wa=wa([Ra.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),Ba=wa([Ra.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),Ya=wa([Ra.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),qa=wa([Ra.CAN_EXECUTE_WORKFLOW_JOBS]),Ha=wa([Ra.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),Ja=wa([Ra.CAN_CREATE_CONFIG_JAR]),Qa=wa([Ra.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),Ka=wa([Ra.CAN_VIEW_CONFIG_JAR]),Xa=wa([Ra.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),za=wa([Ra.CAN_VIEW_WORKFLOW_JOBS]),Za=wa([Ra.CAN_MAKE_BULK_UPDATE]),eo=wa([Ra.CAN_OPEN_DATA_LOADER_EXECUTE,Ra.CAN_OPEN_DATA_LOADER_READ]),to=wa([Ra.CAN_BULK_DELETE_PROFILES]),ro=wa([Ra.CAN_READ_MDM_DATA_ENTITIES]),no=wa([Ra.CAN_READ_DVF]),io=wa([Ra.IS_FREEMIUM_ADMIN]),ao=(0,l.reject)(br),oo=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),ao,(0,l.filter)(e))(t),so=(0,l.curry)(((e,t)=>oo((t=>ma({attributeType:t,mode:e})),t))),lo=(0,l.curry)(((e,t)=>oo((t=>ma({attributeType:t,mode:e})||ga(t)),t))),uo=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(ga)),co=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...co(e)])))),po=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(ga),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...po(e)])))),yo=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...yo(e)])))),fo=(0,l.pipe)(pn,(0,l.converge)(l.concat,[po,yo]));function To(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Eo(e,t,r[t])}))}return e}function Eo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mo=(0,l.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,mo(e)))},t))),ho=e=>{var t;return To({},e,{matchGroups:(0,l.uniq)((e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[]))})},bo=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),Oo=(0,l.when)(bo,(0,l.dissoc)("values")),vo=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return To({},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["lookupCode"]),{dependentLookupCode:t})})),go=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},_o=(0,Hr.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(co,t).concat((0,l.chain)(co,r)).some(go)})),Ao=e=>{let t=!1;const r=mo((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?To({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},No=e=>{const t=_o(e),r=(0,l.map)((e=>mo((0,l.pipe)(Oo,(0,l.when)((0,l.always)(e),vo))))(t)),n=(0,l.map)(ho),i=(0,l.map)(Ao);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},Po=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Ro=(0,l.prop)("relationshipTypeURIs"),So=(0,l.curry)(((e,t)=>{var r;return(null===(r=e.graphTypes)||void 0===r?void 0:r.filter(wo(e,t)))||[]})),wo=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return null==n?void 0:n.some(Bi(e,t))},Io=(e,t)=>(0,l.pipe)(Po,(0,l.defaultTo)({}),Ro,(0,l.defaultTo)([]),(0,l.chain)(Wi(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(pn(e)))(e,t),Uo=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),Co=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),Do=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Co((0,l.complement)(Uo))(e)},Lo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Co(Uo)(e)},jo=(0,l.pipe)(pn,(0,l.propOr)([],"matchGroups")),ko=(e,t,r)=>(0,l.pipe)(jo,(0,l.find)((0,l.propEq)("uri",r)))(e,t),Fo=(0,l.curry)(((e,t,r)=>(0,l.pipe)(ko,(0,l.propOr)(r,"label"))(e,t,r))),Mo=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(jo,(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),(0,l.includes)(l.__,r))))(e,t),i=(0,l.pipe)((0,l.map)((0,l.prop)("uri")),(0,l.without)(l.__,r),(0,l.map)((e=>({uri:e,label:e}))))(n);return[...n,...i]})),xo=e=>(0,l.partition)(Uo,e),$o=(0,l.includes)(l.__,["and","or","not"]),Vo=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),Go=(0,l.includes)(l.__,["equals","notEquals","in"]),Wo=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return $o(t)?Wo(r):Vo(t)?r.filter(Qe):Go(t)?r.map((0,l.prop)("uri")).filter(Qe):[]})),l.uniq),Bo=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)(Wo),l.uniq),Yo=(0,l.pipe)(jo,Bo),qo=(0,l.pipe)(Mo,Bo),Ho=(e,t)=>{let{interactionTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},Jo=(0,l.pipe)(Ho,po),Qo=(e,t)=>(e.interactionTypes||[]).filter(((e,t)=>r=>{let{memberTypes:n}=r;return n.some(((e,t)=>r=>{let{objectTypeURI:n}=r;return n===t||yn(e,n,t)})(e,t))})(e,t)),Ko=e=>!!e.required,Xo=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity;const i=(0,l.cond)([[Qe,pn(e)],[Ke,Vi(e)]])(t);return zo(e,i,r,n)},zo=(e,t,r,n)=>!t||t.hidden&&!(e=>e.uri&&Qe(e.uri)&&3===e.uri.split("/").length)(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!Tr(e))).flatMap((t=>{const i=t.required?[t]:[];if(r){let a;if(t.type===zt.TYPE_REFERENCE){const i=rr(t),o=nr(t);a=Xo(e,i,r,n).filter((e=>o.some(Xe(e.uri))))}else t.attributes&&(a=zo(e,t,r,n));a&&i.push(...a)}return i.filter((e=>e===t?n(e):n(e,t)))})):t.type===zt.TYPE_REFERENCE?Xo(e,rr(t),r,n):[],Zo=e=>{const t=(0,l.pipe)((0,l.pick)(["dataLabelPattern","dataTooltipPattern","secondaryLabelPattern"]),l.values,(0,l.filter)(l.identity))(e);return(0,l.filter)((0,l.anyPass)([e=>{const r=`{${e.name}.`,n=`{${e.name}}`;return(0,l.any)((0,l.anyPass)([(0,l.includes)(n),(0,l.includes)(r)]),t)},t=>(e.businessCardAttributeURIs||[]).includes(t.uri),Ko]),e.attributes||[])},es=(e,t)=>{const r=or(e);return(0,l.pipe)((0,l.filter)((e=>r.includes(e.uri))),(0,l.sort)((n=r,(e,t)=>n.indexOf(e.uri)-n.indexOf(t.uri))))(t.attributes||[]);var n},ts=(0,l.curry)(((e,t)=>{const r=(t,n)=>{if(Array.isArray(n))return n.map((e=>r(t,e)));if(n&&"object"==typeof n){const e={};for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=r(t,n[t]));return e}return"string"==typeof n&&e.includes(t)?ye().text(n):n};return r(null,t)})),rs=["label","description","abbreviation","caption","toolTip"],ns=e=>ts(rs,e),is=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=Ze(t);return r.find((e=>{let{uri:t}=e;return Ze(t)===n}))})),as=(0,l.curry)(((e,t)=>{const r=Ze(t);return(0,l.pipe)(is(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),os=e=>{let{sources:t}=e;return(null==t?void 0:t.find((0,l.propEq)("uri","configuration/sources/Reltio")))?t:null==t?void 0:t.concat({uri:"configuration/sources/Reltio",label:"Reltio",icon:"images/source/reltio.png",abbreviation:"Reltio"})},ss=(e,t)=>{let{sources:r=[]}=e;return r.find((e=>{let{uri:r,label:n}=e;return r===t||n===t||r.substring(r.lastIndexOf("/")+1)===t}))},ls=(0,l.curry)(((e,t)=>{let{roles:r}=e;return(0,l.pipe)((0,l.find)((0,l.propEq)("uri",t)),(0,l.prop)("label"))(r)})),us=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=pn(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));function cs(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){ps(e,t,r[t])}))}return e}function ps(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ds=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:["attributes"];const i=n.reduce(((e,r)=>e.concat(t[r]||[])),[]);return ys(i,e,t,r,n)},ys=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:["attributes"];return ee.fromNull(e&&e.length?e:Cr(t,r)).map((e=>e.map((e=>{const r=ds(t,e,n,i);return r.length?cs({},e,{children:r}):e})))).orSome([]).filter((0,l.either)((0,l.complement)(Ar),(0,l.prop)("children"))).filter(ga).filter(n).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},fs=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return ds(e,t,r,["attributes","analyticsAttributes"])},Ts=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return ds(e,t,r,["attributes"])},Es=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return ds(e,t,r,["analyticsAttributes"])},ms=e=>e.children?e.children.flatMap(ms):e,hs=e=>e.children?[e,...e.children.flatMap(hs)]:e,bs=(0,l.curry)(((e,t)=>{let{groupTypes:r}=e;return(0,l.pipe)((0,l.find)((0,l.propEq)("uri",t)),(0,l.prop)("label"))(r)})),Os=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return Ze(r)===e})))),vs=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),Os("LUD")),(0,l.defaultTo)(r))(t||[])},gs=(e,t)=>{let{survivorshipStrategies:r}=e;return Os(t,r)},_s=(0,l.allPass)([(0,l.complement)(l.isNil),Xi(Qi.READ)]),As=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),Xi(Qi.READ)]),Ns=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),(0,l.anyPass)([Xi(Qi.CREATE),Xi(Qi.INITIATE_CHANGE_REQUEST)])]),Ps=(0,l.curryN)(2,(0,l.pipe)(pn,As)),Rs=(0,l.curryN)(2,(0,l.pipe)(Vi,_s)),Ss=e=>{let{ov:t}=e;return!1!==t},ws=(e,t)=>((e,t)=>Wr(e.type)&&oe(t))(e,t)||((e,t)=>Br(e.type)&&se(t))(e,t),Is=(0,l.curry)(((e,t)=>(0,l.cond)([[l.isNil,(0,l.always)(null)],[(0,l.pipe)((0,l.prop)(e),Array.isArray),(0,l.path)([e,0])],[l.T,(0,l.prop)(e)]])(t))),Us=Is("refEntity"),Cs=Is("refRelation"),Ds=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],Ls=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},js=(0,l.prop)("objectURI"),ks=(0,l.prop)("objectURI"),Fs=(0,l.prop)("type"),Ms=(0,l.pipe)(Us,(0,l.defaultTo)({}),js),xs=(0,l.pipe)(Cs,(0,l.defaultTo)({}),ks),$s=(0,l.pipe)(Us,(0,l.defaultTo)({}),Fs),Vs=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type})));return(e||[]).concat(r)},Gs=(0,l.evolve)({refEntity:ne,refRelation:ne}),Ws=(e,t,r,n)=>{const i=Ir(e,r),a=pn(e,t.type)||Vi(e,t.type);if(0===i.length)return null;const o=hr(r);let s=[t],l=1;i[0].uri!==t.type&&(l=0);let u=null;const c=n?[]:null;let p=null;for(let e=l;e<i.length;++e){const t=e===i.length-1,r=i[e];let l=[];if(!ur(r,p)){u=n?[]:null;break}Array.isArray(s)&&(s.forEach((s=>{const u=s.value||s[o]||{};let d=[];r.startObject&&r.endObject||r.typeColor?(d=((null==a?void 0:a.attributes)||[]).filter((e=>rr(e)===r.uri||tr(e)===r.uri)),p=d.reduce(((e,t)=>{const r=t.referencedAttributeURIs&&t.referencedAttributeURIs.filter((function(t){return-1===e.indexOf(t)}));return r?e.concat(r):e}),[])):(d.push(r),p=null),d.forEach((a=>{const o=u[a.name];o&&(l=l.concat(o)),n&&t&&c.push({attrValues:o||[],parent:s,attrType:r,parentType:i[e-1],typePath:i})}))})),s=l),t&&(u=s)}return c||u},Bs=(e,t)=>{const[r,n,...i]=t.split("/"),a=(e[r]||[]).find((e=>{let{uri:t}=e;return t.endsWith("/"+n)})),o=i.join("/");return o&&a?Bs(a.value,o):a},Ys=(0,l.curry)(((e,t)=>{if(!t.startsWith(e.uri))return;const[r,...n]=t.slice(e.uri.length+1).split("/"),i=n.join("/");return Bs(e[r],i)})),qs=(0,l.cond)([[(0,l.has)("lookupCode"),(0,l.pick)(["value","lookupCode"])],[(0,l.has)("refEntity"),(0,l.pick)(["refEntity","label","value"])],[l.T,(0,l.prop)("value")]]),Hs=(0,l.cond)([[(0,l.has)("lookupCode"),(0,l.pick)(["value","lookupCode","ov"])],[(0,l.has)("refEntity"),(0,l.pick)(["refEntity","label","value","ov"])],[l.T,(0,l.pick)(["value","ov"])]]),Js=(0,l.cond)([[(0,l.has)("lookupCode"),(0,l.pick)(["value","lookupCode","uri"])],[(0,l.has)("refEntity"),(0,l.pick)(["refEntity","label","value","uri"])],[l.T,(0,l.pick)(["value","uri"])]]),Qs=(0,l.curry)(((e,t,r)=>{const[n,...i]=t;return(0,l.pipe)((0,l.defaultTo)({}),(0,l.propOr)([],n),(t=>e?t.filter(e):t),(0,l.when)((()=>i.length>0),(0,l.pipe)((0,l.map)((0,l.prop)("value")),(0,l.map)(Qs(e,i)))))(r)})),Ks=(0,l.curry)(((e,t)=>(0,l.ifElse)((0,l.is)(Array),(0,l.map)(Ks(e)),e)(t))),Xs=(0,l.curry)(((e,t,r,n)=>(0,l.pipe)(Qs(e,r),Ks(t))(n))),zs=Xs(null,qs),Zs=Xs(Ss,qs),el=Xs(null,Hs),tl=Xs(Ss,Hs),rl=Xs(Ss,Js),nl=(e,t,r)=>{var n,i,a;return e.uri===t?null==e||null===(n=e.attributes)||void 0===n?void 0:n[r]:null===(i=Ys(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},il=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(Ms,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{}),al=(e,t)=>{const r=lt(t),n=(0,l.pipe)((0,l.split)("/"),(0,l.dropLast)(1),l.last)(t);return nl(e,r,n)},ol=Object.values(Fn),sl=(0,l.includes)(l.__,ol),ll=e=>ol.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,l.assoc)(n,e[n],t):t}),{});function ul(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){cl(e,t,r[t])}))}return e}function cl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pl=(e,t)=>`${e}_${t}`,dl=[Hn.matches.name,Hn.matchRules.name],yl=(0,l.values)(xn).map((e=>e.name)),fl=e=>(0,l.when)((0,l.always)(!e),(0,l.reject)((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,yl)))),Tl=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,dl)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>pl(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),El=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,l.pipe)(l.values,fl(r),Tl(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(pl(`dtPotentialMatches.${t.name}`,"")))))(Hn)},ml=(0,l.propEq)("uri",Hn.type.uri),hl=e=>(0,l.values)(qn).some((0,l.propEq)("uri",null==e?void 0:e.uri)),bl=(0,l.propEq)("uri",Bn.sourceSystems.uri),Ol=Object.values(Mn),vl=(0,l.includes)(l.__,Ol),gl=e=>{let{entity:t,attributeType:r,value:n}=e;return ul({},t,{[r.uri]:void 0===n?r.defaultValue:n})},_l=e=>{let{entity:t,attributeType:r}=e;return(0,l.dissoc)(r.uri,t)},Al=e=>{let{entity:t,attributeType:r,value:n}=e;return ul({},t,{[r.uri]:n})},Nl=(0,l.propEq)("uri",Mn.roles.uri),Pl=(0,l.propEq)("uri",Mn.tags.uri);function Rl(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){Sl(e,t,r[t])}))}return e}function Sl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wl=e=>{let{parentUri:t,attributeType:r}=e;return Rl({uri:Ge(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,l.propOr)("","defaultValue",e);return(0,l.cond)([[(0,l.either)(Ar,_r),(0,l.always)({value:{}})],[Rr,()=>t?{value:"",lookupCode:t}:{value:""}],[(0,l.both)((0,l.propEq)("defaultValue","now"),(0,l.pipe)((0,l.prop)("type"),jr)),(0,l.always)({value:Date.now()})],[l.T,(0,l.always)({value:t})]])(e)})(r))},Il=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)(so(i),(0,l.filter)((0,l.anyPass)([(0,l.has)("defaultValue"),Sr,(0,l.propEq)("required",!0)])))(t),o={};for(const e of a){const{name:t}=e,a=wl({parentUri:r,attributeType:e});let s=Cr(n,e);s&&(e.type===zt.TYPE_REFERENCE&&(s=lr(s)),a.value=Il({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(!(0,l.isEmpty)(a.value)||Boolean(a.lookupCode)||Sr(e))&&(o[t]=[a])}return o},Ul=e=>{let{entity:t,metadata:r}=e;return Xo(r,t.type,!0).filter(Sr).reduce(((e,t)=>{const n=t.name,i=lt(t.uri);return(i===e.type?[{parentUri:e.uri,attributes:e.attributes}]:Ws(r,e,i).map((e=>{let{value:t,uri:r}=e;return{parentUri:r,attributes:t}}))).reduce(((e,r)=>{let{parentUri:i,attributes:a}=r;return a[n]&&0!==a[n].length?e:Dl({entity:e,attributeType:t,parentUri:i,index:0})}),e)}),t)},Cl=(0,l.curry)(((e,t)=>{let{metadata:r,attributeTypes:n,parentUri:i,mode:a}=e;const o=n.filter((e=>{let{name:r}=e;return!t[r]})),s=(0,l.mapObjIndexed)(((e,t)=>{const{type:i,attributes:o}=n.find((e=>t===e.name));return e.map((e=>{const{value:t,uri:n}=e;return i===zt.TYPE_NESTED?Rl({},e,{value:Cl({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return Rl({},s(t),Il({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),Dl=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=wl({parentUri:n,attributeType:r}),u=qs(l);return(0,ge.ZP)(t,(e=>{Ne(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},Ll=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,ge.ZP)(t,(e=>{Ne(e.attributes||e.value,r,n.uri,qs(n),a,o,i)}))},jl=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,ge.ZP)(t,(e=>{Pe(e.attributes||e.value,r,n,i,a,o)}))},kl=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,ge.ZP)(t,(e=>{Se(e.attributes||e.value,r,n,i)}))},Fl=e=>""===e,Ml=(0,l.cond)([[(0,l.propSatisfies)((0,l.complement)((0,l.anyPass)([Fl,l.isNil])),"lookupCode"),l.F],[(0,l.propSatisfies)((0,l.anyPass)([Fl,l.isNil]),"value"),l.T],[(0,l.both)((0,l.propSatisfies)(l.isEmpty,"value"),(0,l.propSatisfies)((0,l.either)(l.isNil,l.isEmpty),"refEntity")),l.T],[l.T,l.F]]),xl=(0,l.reject)(Ml),$l=e=>{let{deleteEmptyComplex:t,valueTransformer:r=l.identity}=e;return(0,l.pipe)((0,l.map)((0,l.pipe)((0,l.map)((0,l.pipe)(r,(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(e=>$l({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),xl)),(0,l.when)((0,l.always)(t),(0,l.reject)(l.isEmpty)))},Vl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return $l({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),Gs),deleteEmptyComplex:e})},Gl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)(Vl(e),(0,l.reject)(l.isEmpty))},Wl=(0,l.curry)(((e,t)=>t.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:i}=t;return sl(r)?gl({entity:e,attributeType:r}):Dl({entity:e,attributeType:r,parentUri:n,index:i})}),e))),Bl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n,value:i}=t;return sl(r)?Al({entity:e,attributeType:r,value:i}):jl({entity:e,attributeType:r,uri:n,value:i})})),Yl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n}=t;return sl(r)?_l({entity:e,attributeType:r}):kl({entity:e,attributeType:r,uri:n})})),ql=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.pipe)((0,l.filter)((0,l.pipe)((0,l.pathOr)([],["roles"]),(0,l.either)((0,l.propEq)("length",0),(0,l.any)((e=>t.includes(e)))))),(0,l.map)((0,l.pathOr)([],["attributes"])),l.flatten)(e)},Hl="UrlThumbnail",Jl="CdnUrlThumbnail",Ql=(0,l.curry)(((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(Ss):(0,l.head)(n);return e&&e.value}return null})),Kl=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>Ql(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),Xl=Kl(["CdnUrl","Url"],!0),zl=Kl(["CdnUrlPreview","UrlPreview"],!0),Zl=Kl([Jl,Hl],!0),eu=Kl([Jl,Hl]),tu=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,l.cond)([[mr,(0,l.always)(t)],[(0,l.both)(Er,(0,l.always)(i)),(0,l.always)(i)],[l.T,(0,l.always)(n)]])(a),s=mr(a)?"uri":"name",u=(0,l.pipe)((0,l.prop)(a[s]),(0,l.when)((0,l.both)((0,l.always)(sl(a)),(e=>null===e)),(0,l.always)([""])),(0,l.defaultTo)([]),ie)(o);return(0,l.when)((0,l.always)(r(u,a)),(0,l.append)({attrType:a,values:u}),e)}),[])},ru=(e,t,r)=>{const n=uo(e),i=(0,l.any)(r?l.T:Ss);return tu(n,t,i)},nu=(e,t,r,n,i,a)=>{const o=We(null==r?void 0:r.uri)?so(t,e):lo(t,e);return tu(o,r,((e,o)=>{const s=ma({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:Ss,e)||mr(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let iu;const au=e=>{iu=e};function ou(e,t){return iu(e,t)}const su=e=>(t,r)=>new Promise(((n,i)=>{e(t,r,(e=>{n(e)}),((e,t)=>{i((0,l.when)((0,l.is)(String),(0,l.always)({errorMessage:e,errorCode:t}))(e))}),null)})),lu=50,uu=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=lu,offset:a=0}=e;return ou("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i,offset:a}),headers:{"Content-Type":"application/json"}})},cu=(0,l.once)((()=>ou("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),pu=e=>ou("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),du=(e,t)=>ou("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),yu=e=>ee.fromNull(vn[e]).map(ye().text).orSome(""),fu=(0,l.curry)(((e,t)=>`${e}_${t}`)),Tu=(0,l.split)("_"),Eu=(0,l.includes)("_"),mu=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),hu=(0,l.curry)(((e,t)=>e.some(mu(t)))),bu=hu([bn.IN_RANGE,bn.COUNT_RANGE,bn.WITHIN]),Ou=hu([bn.EXISTS,bn.MISSING_VALUE]),vu=(0,l.cond)([[Ou,(0,l.always)(0)],[bu,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),gu=(0,l.complement)(Ou),_u=hu([bn.HAS_ALL,bn.EQUALS,bn.NOT_EQUALS]),Au=hu([bn.COUNT_EQUALS,bn.COUNT_NOT_EQUALS,bn.COUNT_LT,bn.COUNT_LTE,bn.COUNT_GT,bn.COUNT_GTE,bn.COUNT_RANGE]),Nu=hu([bn.IN_FILE,bn.NOT_IN_FILE]),Pu=e=>{switch(e){case bn.COUNT_EQUALS:return bn.EQUALS;case bn.COUNT_NOT_EQUALS:return bn.NOT_EQUALS;case bn.COUNT_LT:return bn.LT;case bn.COUNT_LTE:return bn.LTE;case bn.COUNT_GT:return bn.GT;case bn.COUNT_GTE:return bn.GTE;case bn.COUNT_RANGE:return bn.IN_RANGE}},Ru=hu([bn.ON,bn.BEFORE,bn.AFTER,bn.WITHIN,bn.NOT_EQUALS]),Su=hu([bn.WITHIN]),wu=[[bn.COUNT_EQUALS,bn.COUNT_NOT_EQUALS,bn.COUNT_LT,bn.COUNT_LTE,bn.COUNT_GT,bn.COUNT_GTE],[bn.NOT_IN_FILE,bn.IN_FILE],[bn.EQUALS,bn.NOT_EQUALS,bn.HAS_ALL],[bn.LT,bn.LTE,bn.GT,bn.GTE],[bn.MISSING_VALUE,bn.EXISTS],[bn.COUNT_RANGE],[bn.IN_RANGE],[bn.STARTS_WITH,bn.CONTAINS],[bn.FULL_TEXT],[bn.ON,bn.BEFORE,bn.AFTER,bn.NOT_EQUALS],[bn.WITHIN]],Iu=(e,t)=>wu.some((r=>r.includes(e)&&r.includes(t))),Uu=(0,l.pipe)(l.omit,l.values),Cu={OPTIONS_FOR_STRING:Uu(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],bn),OPTIONS_FOR_DATE:[bn.ON,bn.BEFORE,bn.AFTER,bn.WITHIN,bn.NOT_EQUALS,bn.MISSING_VALUE,bn.EXISTS,bn.COUNT_EQUALS,bn.COUNT_NOT_EQUALS,bn.COUNT_LT,bn.COUNT_LTE,bn.COUNT_GT,bn.COUNT_GTE,bn.COUNT_RANGE,bn.IN_FILE,bn.NOT_IN_FILE],OPTIONS_FOR_BOOLEAN:Uu(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],bn),OPTIONS_FOR_BLOB:Uu(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],bn),OPTIONS_FOR_NUMBER:Uu(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],bn),OPTIONS_FOR_LOOKUP:Uu(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],bn),OPTIONS_FOR_ENUM:Uu(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],bn),OPTIONS_FOR_ID:[bn.EQUALS,bn.NOT_EQUALS,bn.IN_FILE,bn.NOT_IN_FILE],OPTIONS_FOR_COUNT:[bn.EQUALS,bn.NOT_EQUALS,bn.LT,bn.LTE,bn.GT,bn.GTE,bn.IN_RANGE],OPTIONS_FOR_COMPLEX:[bn.COUNT_EQUALS,bn.COUNT_NOT_EQUALS,bn.COUNT_LT,bn.COUNT_LTE,bn.COUNT_GT,bn.COUNT_GTE,bn.COUNT_RANGE,bn.EXISTS,bn.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[bn.EQUALS,bn.NOT_EQUALS,bn.EXISTS,bn.MISSING_VALUE]},Du=e=>{const{type:t,singleValue:r=!1}=e,n=(e=>{switch(e){case zt.TYPE_TYPEAHEAD:case zt.TYPE_STRING:case zt.TYPE_PASSWORD:case zt.TYPE_TEXT:case zt.TYPE_CIK_ID:case zt.TYPE_URL:case zt.TYPE_BLOG_URL:case zt.TYPE_IMAGE_URL:case zt.TYPE_EMAIL:return Cu.OPTIONS_FOR_STRING;case zt.TYPE_LOOKUP:case zt.TYPE_DEPENDENT_LOOKUP:return Cu.OPTIONS_FOR_LOOKUP;case zt.TYPE_ENUM:return Cu.OPTIONS_FOR_ENUM;case zt.TYPE_DATE:case zt.TYPE_ACTIVENESS_DATE:case zt.TYPE_TIMESTAMP:case zt.TYPE_LOCAL_DATE:return Cu.OPTIONS_FOR_DATE;case zt.TYPE_BOOLEAN:case zt.TYPE_BOOLEAN_RADIO:return Cu.OPTIONS_FOR_BOOLEAN;case zt.TYPE_BLOB:return Cu.OPTIONS_FOR_BLOB;case zt.TYPE_LONG:case zt.TYPE_INT:case zt.TYPE_FLOAT:case zt.TYPE_DOUBLE:case zt.TYPE_NUMBER:return Cu.OPTIONS_FOR_NUMBER;case zt.TYPE_ENTITY_ID:return Cu.OPTIONS_FOR_ID;case zt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[bn.EQUALS];case zt.TYPE_COUNT:return Cu.OPTIONS_FOR_COUNT;case zt.TYPE_NESTED:case zt.TYPE_REFERENCE:case zt.TYPE_IMAGE:return Cu.OPTIONS_FOR_COMPLEX;default:return Cu.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(Au,n):n},Lu=e=>[gt.and,gt.andNot].includes(e),ju=e=>[gt.or,gt.orNot].includes(e),ku=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),ju)),Fu=(Mu=[gt.and],e=>e.slice(0,-1).every((e=>Mu.includes(e.operator))));var Mu;const xu=e=>e.map(((e,t,r)=>{const n=0===t;return(0,l.assoc)("operator",n?null:r[t-1].operator,e)}),[]),$u=e=>e.map(((e,t,r)=>{const n=t===r.length-1;return(0,l.assoc)("operator",n?null:r[t+1].operator,e)}),[]),Vu=e=>`(${e})`,Gu=e=>{const t=[],r={"{":"}","[":"]","(":")"},n=(0,l.invertObj)(r);for(let i=0;i<e.length;i++){const a=e[i];if(r[a])t.push(a);else if(n[a]&&r[t.pop()]!==a)return!1}return 0===t.length},Wu=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=[gt.or,gt.orNot],n=t?[gt.and,gt.andNot,...r]:r,i=n.map((e=>` ${e} `)).some((t=>e.includes(t))),a=e.startsWith("not"),o="("===(0,l.head)(e)&&")"===(0,l.last)(e)&&Gu(e.slice(1,-1));return!i&&!a||o?e:Vu(e)},Bu="and",Yu=class{constructor(){this.clauses=[]}addClause(e){return e&&(this.clauses=this.clauses.concat(e)),this}build(){return this.clauses.join(" and ")}orBuild(){return`(${this.clauses.join(" or ")})`}buildWithOperators(e){return this.clauses.reduce(((t,r,n)=>{const i=0===t.length,a=(0,l.propOr)(Bu,n,e),o=(e=>[gt.andNot,gt.orNot].includes(e))(a)?Wu(r):r;return i?o:`${t} ${a} ${o}`}),"")}},qu=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),Hu=e=>Array.isArray(e)?e.map(Hu).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),Ju=(0,l.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),Qu=e=>`'${e}'`,Ku=e=>`"${e}"`,Xu=e=>(0,l.pipe)((0,l.map)(e),(0,l.join)(" or ")),zu=(0,l.pipe)(Hu,Ju),Zu=(0,l.pipe)(zu,Qu),ec=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.allPass)([(0,l.always)(bu(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[l.T,l.identity]])(t))),tc=(e,t)=>Au(t)?{type:zt.TYPE_INT}:Nu(t)?{type:zt.TYPE_FILE}:Ru(t)&&!Su(t)&&kr(e.type)?{type:zt.TYPE_LOCAL_DATE}:e,rc=Object.values(Sn),nc=e=>!Object.values(Sn).includes(e),ic=e=>rc.includes(e),ac=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:wn;return ye().text(t[e])},oc=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.values(Pn),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:wn;return e.map((e=>({value:e,get label(){return ac(e,t)}})))},sc=e=>{const t=f()().startOf("minute");switch(e){case Pn.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case Pn.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case Pn.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case Pn.LAST_6MONTHS:return[f()(t).subtract(6,"months").valueOf(),t.valueOf()];case Pn.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()];case Rn.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()];default:return e}},lc=e=>{let[t,r]=e;return[f()(t).valueOf(),f()(r).endOf("date").valueOf()]},uc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:sc;return(0,l.is)(String,e)?t(e):lc(e)};let cc;!function(e){e.CurrentUser="currentUser"}(cc||(cc={}));const pc={},dc=(e,t)=>{pc[e]=t},yc=e=>pc[e];function fc(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){Tc(e,t,r[t])}))}return e}function Tc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ec=e=>e.split("{CurrentUser}").join(yc(cc.CurrentUser)||""),mc=(0,l.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),hc=(0,l.curry)(((e,t,r)=>{const n=r.map(bu(e)||t.endsWith(".count")?zu:Zu).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),bc=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},Oc=e=>{let{filter:t,fieldName:r,values:n}=e;const i=vu(t);return(0,l.pipe)(bc(i),(0,l.map)(hc(t,r)),mc(" or "))(n)},vc=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(Zu).join(",")})`},gc=e=>`*${e}*`,_c=e=>`URL:${e}`,Ac=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,Nc=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===bn.IN_FILE?r:`not ${r}`},Pc=(e,t)=>[R(e,t),S(e,t)],Rc=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!Sc(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case bn.ON:return fc({},e,n?{filter:bn.EQUALS}:{filter:bn.IN_RANGE,values:[Pc(i,n)]});case bn.BEFORE:return fc({},e,{filter:bn.LTE,values:[[S(i,n)]]});case bn.AFTER:return fc({},e,{filter:bn.GTE,values:[[R(i,n)]]});case bn.WITHIN:return fc({},e,{filter:bn.IN_RANGE,values:[sc(i)]})}}return e}),Oc),Sc=(0,l.propSatisfies)(kr,"type"),wc=[[(0,l.prop)("rawFilter"),(0,l.pipe)((0,l.prop)("rawFilter"),Ec)],[(0,l.propEq)("filter",bn.HAS_ALL),(0,l.pipe)((e=>{let{fieldName:t,values:r}=e;return(0,l.pipe)((0,l.map)((e=>e.reduce(((e,r)=>e.addClause(Oc({filter:bn.EQUALS,fieldName:t,values:[r]}))),new Yu).build())),mc(" or "))(r)}),Ec)],[(0,l.propEq)("filter",bn.CONTAINS),(0,l.pipe)((e=>{let{filter:t,fieldName:r,values:n}=e;return Oc({fieldName:r,filter:t,values:n.map((0,l.pipe)(Hu,gc))})}),Ec)],[(0,l.propEq)("filter",bn.EQUALS),(0,l.pipe)((e=>{const{fieldName:t,values:r}=e;return"type"===t?Oc(fc({},e,{values:(0,l.flatten)(r)})):Ac(r)?vc(fc({},e,{filter:"listEquals"})):Oc(e)}),Ec)],[(0,l.propEq)("filter",bn.NOT_EQUALS),(0,l.pipe)((e=>{const{values:t}=e;return"type"===e.fieldName?(e=>{let{filter:t,fieldName:r,values:n}=e;const i=vu(t);return(0,l.pipe)(bc(i),(0,l.map)(hc(t,r)),mc(" and "))(n)})(fc({},e,{values:(0,l.flatten)(e.values)})):Sc(e)?(e=>{const{values:t}=e,r=!Sc(e),[n]=t;return(new Yu).addClause(Oc(fc({},e,{filter:bn.LT,values:[R(n,r)]}))).addClause(Oc(fc({},e,{filter:bn.GT,values:[S(n,r)]}))).orBuild()})(e):Ac(t)?vc(fc({},e,{filter:"not listEquals"})):Oc(e)}),Ec)],[(0,l.propSatisfies)(Nu,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return Oc({fieldName:r,filter:Nc(t,r),values:n.map((0,l.prop)("link")).map(_c)})}],[(0,l.propSatisfies)(Au,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return Oc({fieldName:`${r}.count`,values:n,filter:Pu(t)})}],[(0,l.propSatisfies)(Ru,"filter"),Rc],[(0,l.propEq)("fieldName","geoPolygon"),e=>{let{fieldName:t,values:[r]}=e;const n=(0,l.pipe)((0,l.map)((e=>{let[t,r]=e;return`${t},${r}`})),(0,l.join)(";"))(r);return hc(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return hc(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,(0,l.pipe)(Oc,Ec)]],Ic=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!gu(e)||Cc(e,r))},Uc=(e,t)=>Array.isArray(t)?Cc(e,t):e===bn.WITHIN?ic(t)||Number.isInteger(t):!(0,l.isNil)(t)&&Hu(t).length>0,Cc=(e,t)=>t&&t.length>0&&t.every((t=>Uc(e,t)));function Dc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Lc=e=>{let{fieldName:t=""}=e;const r=t.split("."),n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},jc=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),kc=(e,t,r)=>"children"===e?Mc(r,[...t][0],!0):r,Fc=(e,t,r)=>"values"===e?[...r,...t]:r,Mc=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=e.findIndex((0,l.propEq)("fieldName",t.fieldName));if(n>=0){const i=e[n];if("children"in i&&"children"in t)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(kc,t),e);if(!r&&_u(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(Fc,t),e)}return(0,l.append)(t,e)},xc=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=Lc(e),r=e=>e.fieldName===t?e:r({fieldName:jc(e),children:[e]});return r(e)})(t);return Mc(e,r)}),[]),$c=e=>e&&e.length>1&&!e.some((e=>{let{fieldName:t}=e;return null==t?void 0:t.startsWith("parent.")}))&&!e.every((0,l.has)("rawFilter")),Vc=e=>{let[t]=e;return t.children?Vc(t.children):t.operator},Gc=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function r(e){const[t,r]=(0,l.splitAt)(1,e),i=Vc(t)===gt.andNot,a=n(t,!1),o=i?`not ${Wu(a)}`:a,s=n(r,!1);return`inSameAttributeValue(${o} ${Vc(r)||Bu} ${s})`}function n(i){let a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return i.reduce(((i,o)=>i.addClause((0,l.cond)([[(0,l.has)("children"),e=>{let{children:i}=e;return a&&$c(i)&&!t?r(i):n(i,a)}],...e])(o))),new Yu).buildWithOperators(i.map((0,l.prop)("operator")))}return n},Wc=(0,l.pipe)((0,l.propOr)("","filter"),Eu),Bc=(0,l.map)((0,l.when)(Wc,(e=>{const[t,r]=Tu(e.filter);return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Dc(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),Yc=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,l.pipe)((0,l.filter)(Ic),Bc,xc,Gc([...e,...wc],t))},qc=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),Hc=[bn.ON,bn.BEFORE,bn.AFTER,bn.WITHIN,bn.NOT_EQUALS,bn.MISSING_VALUE,bn.EXISTS],Jc=[bn.EQUALS,bn.NOT_EQUALS,bn.STARTS_WITH,bn.MISSING_VALUE,bn.HAS_ALL,bn.FULL_TEXT,bn.EXISTS],Qc=[bn.EQUALS,bn.NOT_EQUALS,bn.LT,bn.LTE,bn.GT,bn.GTE,bn.IN_RANGE],Kc=(e,t)=>{const r=fr(e);return(e=>{switch(e){case Fn.startDate.name:case Fn.endDate.name:case xn.dueDate.name:case Gn.createdTime.name:case Gn.updatedTime.name:case Bn.reltioLoadDate.name:case Bn.createDate.name:case Bn.updateDate.name:case Bn.deleteDate.name:case Bn.publishDate.name:return Hc;case Wn.matches.name:case Bn.count.name:return Qc;case xn.workflow.name:case xn.assignee.name:case xn.step.name:case $n.commenter.name:case Gn.createdBy.name:case Gn.updatedBy.name:case Bn.sourceSystems.name:case Bn.value.name:return Jc;default:return null}})(t)||Du(r)},Xc=[bn.EQUALS,bn.NOT_EQUALS,bn.CONTAINS,bn.STARTS_WITH,bn.MISSING_VALUE,bn.HAS_ALL,bn.IN_RANGE,bn.WITHIN,bn.EXISTS,bn.ON],zc=(0,l.pipe)(Kc,(0,l.filter)((0,l.includes)(l.__,Xc))),Zc=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(Ss);return a&&a[0]&&(r=n.length>0&&a[0].value?Zc(a[0].value,[n.join(".")])[0].value:"label"in a[0]&&"string"==typeof a[0].label?a[0].label:Object.prototype.hasOwnProperty.call(a[0],"label")?"":a[0].value||""),{key:t,value:r}}),""),ep=(e,t)=>{const r=new RegExp("{[^}]*}","g");let n,i=[];for(;null!=(n=r.exec(t));)i.push(n[0]);i=i.map((function(e){return e.substring(1,e.length-1)}));const a=Zc(e.attributes||e.value,i);let o;return a.every((function(e){return void 0===e.value}))?o="":(o=t,o=o.replace(/\[[^\]]*]/g,(e=>{const t=e.match(/\{[^}]*}/g);return t?t.some((function(e){return e=e.substring(1,e.length-1).trim(),a.some((function(t){return t.key===e&&void 0===t.value}))}))?"":e.substring(1,e.length-1):e})),a.forEach((e=>{o=o.replace("{"+e.key+"}",e.value||"")}))),o},tp=/[,\s]*$/,rp=e=>{const t=ye().text(Cn);if(!e)return t;const r=e.replace(tp,"");return""===r.toString().trim()?t:r},np=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},ip=(e,t,r)=>{if("string"==typeof t)return t;if("Reference"!==r.type&&"Nested"!==r.type&&"Image"!==r.type)return"";if("Reference"===r.type){const n=np(e,r.referencedEntityTypeURI);if(n)return ep({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return ep({attributes:t||{}},r.dataLabelPattern);return""},ap=e=>{let{uiPath:t,uri:r}=e;return`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},op=e=>{let{uiPath:t,value:r,uri:n}=e;return`${t}#p~com.reltio.plugins.pivoting.default.DefaultPivotingPerspective_ps~pivoting_a~${encodeURIComponent(n)}_v~${encodeURIComponent(r)}`},sp=e=>{let{uiPath:t,tag:r,entityUri:n}=e;return`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},lp=(0,l.curry)(((e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"")),up=(0,l.when)((0,l.is)(Object),(0,l.ifElse)((0,l.pipe)((0,l.prop)("value"),(0,l.is)(Object)),Zl,(0,l.prop)("value"))),cp=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),up),pp=(e,t,r)=>{const n=cp(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)(Ys(e),up)))(e))(r)||((e,t)=>{const r=(e=>{const t=t=>`${e.uri}/attributes/${t}`,r=(e=e||{}).imageAttributeURIs||[];return(0,l.uniq)([t("ImageGallery"),...r,t("Image"),t("ImageLinks")])})(pn(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>Ws(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,up))(r)})(e,r)||mn(e,r.type);return lp(t,n)};function dp(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){yp(e,t,r[t])}))}return e}function yp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fp="DTSS/",Tp=(0,l.replace)(new RegExp("^entities/"),""),Ep=e=>fp+e.dataTenant+"/"+e.uri,mp=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),hp=e=>!(!e||!e.dataTenant),bp=(0,l.startsWith)(fp),Op=(0,l.pipe)((0,l.ifElse)(bp,(0,l.pipe)((0,l.split)("/"),(0,l.nth)(1)),(0,l.always)(null))),vp=(0,l.ifElse)(hp,Ep,(0,l.prop)("uri")),gp=e=>e&&e.uri?e.dataTenant?Ep(e):Tp(e.uri):"",_p=(0,l.curry)(((e,t,r)=>(pn(t,r.type)||{})[e]||"")),Ap=_p("label"),Np=_p("typeGraphIcon"),Pp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=pn(e,t.type)||{},n=(r.attributes||[]).reduce(((e,t)=>(e[t.uri]=t,e[t.name]=t,e)),{});return t.attributes&&r.businessCardAttributeURIs?r.businessCardAttributeURIs.map((r=>{const i=n[r];if(!i)return null;let a=t.attributes[i.name];if(!a)return null;Array.isArray(a)&&(a=a.find(Ss)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:ip(e,o,i),uri:a.uri}})).filter(l.identity):[]},Rp=(0,l.pipe)(Pp,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),Sp=(0,l.curry)(((e,t)=>{if(!t)return[];if(1===e.length){return t[e[0]]||[]}{const r=t[e[0]];return Array.isArray(r)?r.reduce(((t,r)=>{if((0,l.is)(Object,r.value)){const n=Sp(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):Sp(e.slice(1),r)}})),wp=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,Ip=e=>(0,l.propOr)([],"matchRules",e),Up=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?dp({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},Cp=(e,t,r)=>t&&r?r.aEntity:e,Dp=(0,l.evolve)({attributes:Gl(!0)}),Lp=(0,l.pipe)(Dp,(0,l.props)(["attributes","startDate","endDate","roles","tags"]),(0,l.all)(E)),jp=e=>(0,l.assoc)("dataTenant",e);function kp(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){Fp(e,t,r[t])}))}return e}function Fp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Mp=e=>{let{parentUri:t,relation:r,entityUri:n}=e;return{type:Lt.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},xp=e=>{let{relationUri:t}=e;return{type:Lt.DELETE_RELATION,parameters:{relationUri:t}}},$p=e=>{let{parentUri:t,entityUri:r,relationType:n,relationDirection:i}=e;return{type:Lt.IGNORE_RELATION,parameters:{parentUri:t,entityUri:r,relationType:n,relationDirection:i}}},Vp=e=>{let{oldRelation:t,newRelation:r}=e;return{type:Lt.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},Gp=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:Lt.REPOINT_RELATION,parameters:{entityUri:t,newEntityUri:r,relation:n,isReversed:i}}},Wp=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pathEq)(["parameters","relation","uri"],e),l.T],[(0,l.pathEq)(["parameters","relationUri"],e),l.T],[(0,l.pathEq)(["parameters","oldRelation","uri"],e),l.T],[(0,l.pathEq)(["parameters","newRelation","uri"],e),l.T],[l.T,l.F]])(t))),Bp=e=>e.type===Lt.DELETE_RELATION,Yp=e=>e.type===Lt.CREATE_RELATION,qp=e=>e.type===Lt.REPOINT_RELATION,Hp=e=>e.type===Lt.UPDATE_RELATION,Jp=e=>e.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve()),Qp=e=>{let{type:t,parameters:r,dcrProcessor:n}=e;const{enhanceUriWithDCR:i,updateDCRUriFromResponse:a}=n,o=e=>(a(e),e);switch(t){case Lt.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:a,attributes:s,startDate:l,endDate:u}=t;return qf({startEntityUri:e,endEntityUri:n,relationType:a,attributes:s,startDate:l,endDate:u,uriPreprocessor:i}).then(o)};case Lt.DELETE_RELATION:return()=>{const{relationUri:e}=r;return Yf(e,i).then(o)};case Lt.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return Kf(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(o)};case Lt.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return Hf({oldRelation:e,newRelation:t,uriPreprocessor:i}).then(o)};case Lt.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:i,isReversed:a}=r,{uri:o}=i,s=[xp({relationUri:o}),Mp({parentUri:a?e:t,relation:i,entityUri:a?t:e})];return(0,l.pipe)((0,l.map)(Xp(n)),(0,l.map)(Qp),Jp)(s)}}},Kp=e=>t=>()=>e().then(t),Xp=e=>t=>kp({dcrProcessor:e},t),zp=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=en({alwaysCreateDCR:e,dcrUri:t});return{commandExecutor:(0,l.pipe)(l.flatten,(0,l.map)(Xp(r)),(0,l.map)(Qp),(0,l.map)(Kp(r.getDcrUriAwait)),Jp,(0,l.otherwise)((e=>({errorMessage:e})))),dcrProcessor:r}},Zp=e=>t=>(0,l.map)((t=>kp({},t,{parameters:(0,l.evolve)({parentUri:rh(e),entityUri:rh(e),newEntityUri:rh(e)},t.parameters)})),t),ed=e=>{let{condition:t,updater:r}=e;return e=>t(e)?r(e):e},td=(e,t)=>{const r=e.filter(Yp).find(Wp(t));let n=null,i=null,a=null;const o=e.filter(((o,s)=>Hp(o)&&Wp(t,o)?(s>e.indexOf(r)&&(n=o.parameters.newRelation),!1):!qp(o)||!Wp(t,o)||(s>e.indexOf(r)&&(n=o.parameters.relation,i=o.parameters.isReversed?o.parameters.entityUri:o.parameters.newEntityUri,a=o.parameters.isReversed?o.parameters.newEntityUri:o.parameters.entityUri),!1)));return n?o.map(ed({condition:e=>r===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({relation:(0,l.always)(n),parentUri:e=>i||e,entityUri:e=>a||e})})(e)})):o},rd=(e,t)=>{const r=e.filter(qp).filter(Wp(t));let n=null;const i=e.filter(((i,a)=>r.includes(i)?(0,l.last)(r)===i:!Hp(i)||!Wp(t,i)||(a>e.indexOf((0,l.last)(r))&&(n=i.parameters.newRelation),!1)));return n?i.map(ed({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({relation:(0,l.always)(n)})})(e)})):i},nd=(e,t)=>{const r=e.filter(Bp).filter(Wp(t));return e.filter((e=>r.includes(e)?(0,l.last)(r)===e:!Wp(t,e)))},id=(e,t)=>{const r=e.filter(Hp).filter(Wp(t));let n=null;const i=e.filter((e=>!r.includes(e)||!Hp(e)||(n=n||e.parameters.oldRelation,(0,l.last)(r)===e)));return n?i.map(ed({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({oldRelation:(0,l.always)(n)})})(e)})):i},ad=e=>{const t=e.filter(Bp).map((e=>{let{parameters:{relationUri:t}}=e;return t}));return(0,l.uniq)(t).reduce(nd,e)},od=e=>{const t=e.filter(Yp).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(td,e)},sd=e=>{const t=e.filter(qp).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(rd,e)},ld=e=>{const t=e.filter(Hp).map((e=>{let{parameters:{newRelation:{uri:t}}}=e;return t}));return(0,l.pipe)((0,l.filter)((e=>(0,l.count)((0,l.equals)(e),t)>1)),l.uniq,(0,l.reduce)(id,e))(t)},ud=e=>(0,l.pipe)(ad,od,sd,ld)(e);function cd(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){pd(e,t,r[t])}))}return e}function pd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const dd=e=>cd({},(0,l.path)(Ld(),e),{startDate:(0,l.path)(Md(),e),endDate:(0,l.path)(xd(),e)}),yd=(e,t)=>(0,l.pipe)((0,l.path)(Fd()),rh(t))(e),fd=(e,t,r,n)=>{let{removedUris:i=[],addedConnections:a=[],editedConnections:o=[],ignoredRelationData:s=[]}=t;return[...a.map((e=>{const t=yd(e,r),i=(0,l.path)(jd(),e)===jt.IN,a=e.parentEntityUri||n;return Mp({parentUri:i?t:a,relation:dd(e),entityUri:i?a:t})})),...o.map((t=>{const i=yd(t,r),a=(0,l.path)(jd(),t)===jt.IN,o=i!==(0,l.pipe)((0,l.path)(Ld()),a?$d:Vd)(t),s=Bd(e,(0,l.path)(Cd(),t)),u=t.parentEntityUri||n,c=rh(r,i);return o?Gp({entityUri:a?u:c,newEntityUri:a?c:u,relation:(0,l.path)(Ld(),t),isReversed:!1}):Vp({oldRelation:(0,l.path)(Ld(),s),newRelation:dd(t)})})),...i.map((e=>xp({relationUri:e}))),...s.map((e=>$p({parentUri:n,entityUri:e.entityUri,relationType:e.relationType,relationDirection:e.relationDirection})))]},Td=e=>(e||[]).reduce(((e,t)=>{let{entity:r}=t;const n=r.dataTenant;return cd({},e,{[r.entityUri]:{uri:r.entityUri,label:r.entityLabel,type:r.entityType,dataTenant:n}})}),{}),Ed=(0,l.has)("dataTenant"),md=(0,l.ifElse)(Ed,(e=>{let{relationUri:t,dataTenant:r}=e;return`DTSS/${r}/${t}`}),(0,l.prop)("relationUri")),hd=(e,t)=>(0,l.pipe)(Vi,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(ol),ao)(e,t);function bd(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){Od(e,t,r[t])}))}return e}function Od(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vd=e=>(0,l.prop)("uri",e),gd=e=>vd(e)?e.uri:e,_d=e=>t=>gd(t)===e,Ad=(0,l.curry)(((e,t)=>{const r=(t,n)=>{let i=gd(n),a=!1;i.startsWith("!")&&(i=i.slice(1),a=!0);const o=e[i]&&Xi(Qi.READ,e[i]),s=t.find(_d(i))||!o?t:t.concat(vd(n)?bd({},n,{uri:i}):i);return a?s:(0,l.keys)(e).reduce(((t,n)=>e[n].extendsTypeURI!==i||t.find(_d(n))?t:r(t,n)),s)};return t.reduce(r,[])})),Nd=(0,l.curry)(((e,t)=>{const r=function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return r.reduce(((r,n)=>{const i=gd(n),a=(0,l.path)([i,t,"objectTypeUri"],e);return!a||r.find(_d(a))?r:r.concat(a)}),[])};return bd({},t,{entityTypes:[...r("startObject",t.inRelations),...r("endObject",t.outRelations)]})})),Pd=(0,l.indexBy)((0,l.prop)("uri")),Rd=(0,l.curry)(((e,t)=>{const r=Pd(e.relationTypes),n=Pd(e.entityTypes),i=e=>(0,l.evolve)({inRelations:Ad(r),outRelations:Ad(r),entityTypes:Ad(n),nextEntry:i},e);return(0,l.pipe)((0,l.unless)((0,l.either)((0,l.prop)("nextEntry"),(0,l.prop)("entityTypes")),Nd(r)),i)(t)})),Sd=(e,t)=>(0,l.evolve)({content:Rd(e)},t),wd=e=>{let{type:{uri:t,label:r},direction:n}=e;return e=>{const i=e.relationUri;return(0,l.pipe)((0,l.assoc)("relationType",t),(0,l.assoc)("relationLabel",r),(0,l.assoc)("object",{type:t,attributes:{},uri:i}),(0,l.assoc)("direction",n))(e)}},Id=(e,t,r)=>{const n=ep(t,e.dataLabelPattern),i=(0,l.lensProp)("entity");return(0,l.over)(i,(0,l.evolve)({entityLabel:(0,l.always)(n),object:{label:(0,l.always)(n)}}),r)},Ud="relation",Cd=(0,l.always)([Ud,"relationUri"]),Dd=(0,l.always)([Ud,"relationType"]),Ld=(0,l.always)([Ud,"object"]),jd=(0,l.always)([Ud,"direction"]),kd=(0,l.always)([Ud,"object","attributes"]),Fd=(0,l.always)(["entity","entityUri"]),Md=(0,l.always)([Ud,"startDate"]),xd=(0,l.always)([Ud,"endDate"]),$d=(0,l.path)(["startObject","objectURI"]),Vd=(0,l.path)(["endObject","objectURI"]),Gd=(0,l.path)(["startObject","objectTypeURI"]),Wd=(0,l.path)(["endObject","objectTypeURI"]),Bd=(e,t)=>{for(const r of e){if((0,l.pipe)((0,l.path)(Cd()),(0,l.equals)(t))(r))return r;if(r.connections){const e=Bd(r.connections,t);if(e)return e}}},Yd=(0,l.pipe)(Bd,(0,l.path)(Ld())),qd=(0,l.allPass)([(0,l.pipe)((0,l.path)(Fd()),(0,l.complement)(E)),(0,l.pipe)((0,l.path)(Dd()),(0,l.complement)(E))]),Hd=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:Ye()},entity:{},isNew:!0},{relationType:o,direction:s}=a.relation,{inRelations:u,outRelations:c}=Kd({content:i?t.contentSecondLevel:t.content,direction:s,relationType:o,mode:r,metadata:n}),p=Jd(u,c);return(0,l.pipe)((0,l.evolve)({relation:p?wd(p):l.identity}),(0,l.defaultTo)({}),(0,l.when)((0,l.always)(i),(0,l.assoc)("parentEntityUri",i)))(a)},Jd=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length+t.length===1?e.length?{type:e[0],direction:Ln.IN}:{type:t[0],direction:Ln.OUT}:null},Qd=e=>e.uri||e,Kd=e=>{let{content:t,direction:r,relationType:n,mode:i,metadata:a}=e;const o={},s=e=>t=>{const a=t&&ea(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===Ln.IN?"startObject":"endObject",{directionalContext:i}=t[n];return"directed"===t.direction&&1===(0,l.propOr)(0,"length",i)&&(r+=` (${i[0].labelPattern})`),!(r in o)&&(o[r]=!0,!0)}return!1},u=e=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],pn(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],pn(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(Qd,Vi(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(Ln.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(Ln.OUT)),(0,l.map)(u))},t)||{}},Xd=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}=qi({reversedContextLabels:!0}),a=(0,l.curry)(((e,t,r,n)=>{const[i,a]=Wi(e,n.uri);return n&&(!t||yn(e,i,t))&&(!r||yn(e,a,r))})),o=t=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],pn(e,t.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],pn(e,t.endObject.objectTypeURI)))(t),s=(e.relationTypes||[]).filter((0,l.both)(_s,r));return{inRelations:(0,l.pipe)((0,l.filter)(a(e,null,t)),(0,l.filter)(n),(0,l.map)(o))(s),outRelations:(0,l.pipe)((0,l.filter)(a(e,t,null)),(0,l.filter)(i),(0,l.map)(o))(s)}},zd=(0,l.curry)(((e,t,r,n,i)=>{const a=yn(n,l.__,t.type),o=e?Wd:Gd,s=yn(n,l.__,r.type),u=e?Gd:Wd;return(0,l.both)((0,l.pipe)(o,a),(0,l.pipe)(u,s))(i)})),Zd=(e,t,r)=>{const n=e?Wd:Gd,i=(0,l.pipe)((0,l.map)(n),l.uniq)(r);return(0,l.pipe)((0,l.filter)((e=>{let{uri:r}=e;return i.some(yn(t,l.__,r))})),(0,l.reject)((0,l.prop)("abstract")),(0,l.map)((0,l.prop)("uri")))(t.entityTypes||[])};function ey(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ty=e=>{let{type:t,attributeType:r,attributeTypeUri:n,parentUri:i,uri:a,message:o,source:s}=e;return{type:t,uri:a,attributeTypeUri:n,attributeType:r,parentUri:i,message:o,source:s}},ry=e=>!e.deactivated,ny=e=>{let{attributeTypeUri:t,uri:r,parentUri:n}=e;return`${t}-${r}-${n}`},iy=e=>ny(e)+e.message,ay=(0,l.unless)(l.isNil,(0,l.prop)("message")),oy=(0,l.unless)(l.isNil,(0,l.prop)("type")),sy=(0,l.curry)(((e,t)=>Xe(t.parentUri,e))),ly=(0,l.curry)(((e,t)=>t.parentUri===e)),uy=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pipe)((0,l.prop)("uri"),Xe(t.attributeTypeUri)),l.T],[(0,l.both)((0,l.propEq)("type",zt.TYPE_REFERENCE),(0,l.pipe)(nr,(0,l.any)(Xe(t.attributeTypeUri)))),l.T],[l.T,l.F]])(e))),cy=(0,l.curry)(((e,t)=>t.attributeTypeUri===e)),py=(0,l.curry)(((e,t,r)=>e===r.parentUri&&t!==r.attributeTypeUri)),dy=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,l.filter)((0,l.allPass)([Oy,ry,sy(e),uy(t),(0,l.complement)(py(e,t.uri))]))(r)},yy=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=(0,l.find)((0,l.allPass)([Oy,ry,ly(e),cy(t.uri),(0,l.complement)((0,l.prop)("uri")),(0,l.complement)((0,l.propEq)("type",dt.missed))]))(r);return n&&n.message||""},fy=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const{uri:i}=e,a=(0,l.find)((0,l.propEq)("uri",i))(n);return a||0!==t?a:n.find((e=>e.attributeTypeUri===r&&e.type===dt.missed))},Ty=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([ry,(0,l.propEq)("type",dt.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(Cd(),e))]))(t)},Ey=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([ry,(0,l.propEq)("type",dt.missedRefEntity),(0,l.propEq)("parentUri",e.uri)]))(t)},my=function(e){let{uri:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.any)((0,l.allPass)([ry,sy(t)]))(r)},hy=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([ry,(0,l.propEq)("type",dt.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(["relation","uri"],e))]))(t)},by=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?yh(e,t):null;return i&&i.map((e=>{const t=((e,t)=>{let{entitiesMap:r,metadata:n}=e;const{type:i,valueType:a,value:o}=t;switch(i){case mt.attributeValue:{const e=a;if(vr(a))return ep(o,e.dataLabelPattern);if(gr(a)){const t=o,i=Ms(t),a=tr(e),s=pn(n,a);return We(i)?ep(r[i],s.dataLabelPattern):t.label}return""}case mt.tempEntity:return ep(o,a.dataLabelPattern);case mt.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=pn(n,null==e?void 0:e.entityType);return`${rp(i&&We(i)?ep(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||Gi(n,null==t?void 0:t.relationType)}`}}})({entitiesMap:r,metadata:n},e);return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ey(e,t,r[t])}))}return e}({},e,{label:rp(t)})}))},Oy=e=>!e.severity||e.severity===ft.ERROR,vy=(e,t,r)=>(0,l.allPass)([(0,l.pipe)((0,l.prop)("uri"),E),(0,l.propEq)("parentUri",t),(0,l.propEq)("attributeTypeUri",r)])(e),gy=(0,l.curry)(((e,t)=>{let r=t.value;switch(e.type){case zt.TYPE_NESTED:return Object.keys(r).some((t=>{const n=e.attributes.find((0,l.propEq)("name",t));return r[t].some(gy(n))}));case zt.TYPE_REFERENCE:return!!Us(t);case zt.TYPE_BOOLEAN:return!0===r||!1===r||"true"===r||"false"===r;default:return"string"==typeof r&&(r=r.trim()),null!=r&&""!==r}})),_y=(e,t)=>e.every((0,l.complement)(gy(t))),Ay=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const n=Xo(e,t.type||t.relationType,!0,r);return n.reduce(((r,n)=>{const i=Ws(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!Ss(e.parent))))).forEach((e=>{_y(e.attrValues,n)&&r.push(ty({type:dt.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:ye().text("Attribute is required"),source:yt.local}))})),r}),[])},Ny=(0,l.curry)(((e,t,r)=>Ws(e,t,r,!1))),Py=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),pn(e),(0,l.prop)("attributes"),(0,l.defaultTo)([]),(0,l.reject)(br),(0,l.filter)(gr),(0,l.map)((0,l.prop)("uri")),(0,l.chain)(Ny(e,t)));return(0,l.pipe)(r,(0,l.reject)(Ms),(0,l.map)((e=>{let{uri:r}=e;return ty({type:dt.missedRefEntity,uri:"",attributeTypeUri:nt(r,t.type),parentUri:r,message:ye().text("Entity is required"),source:yt.local})})))(t)},Ry=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,l.has)("refEntity")).filter((0,l.pipe)(Ms,We)).flatMap((n=>{const i=Ms(n),a=t[i],o=Ur(e,nt(n.uri,r.type));return Sy(e,t,o,a)})),Sy=(e,t,r,n)=>{const i=nr(r),a=i.map((t=>Ur(e,t))).filter((0,l.both)(l.identity,(0,l.propEq)("type",zt.TYPE_REFERENCE))).flatMap(ar).concat(i);return wy(e,t,n,(e=>a.some(Xe(e.uri))))},wy=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity;const i=Ay(e,r,n),a=Py(e,r),o=Ry(e,t,r);return[...i,...a,...o]},Iy=(e,t)=>{const r=(0,l.path)(Ld(),t)||{};return Ay(e,r)},Uy=(e,t,r)=>{t=t||{};const n=(0,l.pipe)((0,l.path)(Fd()),(0,l.ifElse)(We,(e=>t[e]),(0,l.always)(null)))(r),i=Iy(e,r),a=(e=>(0,l.path)(Fd(),e)?[]:[ty({type:dt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(Dd(),e),parentUri:(0,l.path)(Cd(),e),message:ye().text("Entity is required"),source:yt.local})])(r),o=((e,t,r)=>r?wy(e,t,r):[])(e,t,n);return[...i,...a,...o]},Cy=e=>(0,l.path)(["entity","uri"],e)?[]:[ty({type:dt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(["relation","type"],e),parentUri:(0,l.path)(["relation","uri"],e),message:ye().text("Entity is required"),source:yt.local})],Dy=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=Ay(e,r),i=Cy(t);return[...n,...i]};function Ly(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jy=(e,t)=>{var r,n;const i=pn(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||_o(e)},ky=e=>(0,l.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),Fy=e=>{const t=r=>(0,l.ifElse)(Array.isArray,(0,l.map)(t),(0,l.pipe)(ky(e),(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(0,l.map)(t))})))(r);return t},My=(e,t)=>(0,l.when)((0,l.prop)("refEntity"),(0,l.pipe)((0,l.when)((0,l.allPass)([(0,l.prop)("refRelation"),(0,l.always)("INSERT_ATTRIBUTE"===t),(0,l.pipe)(xs,We,l.not)]),(e=>{const t=(0,l.pipe)(xs,Ze)(e);return Fy((e=>e.replace(t,t+je)))(e)})),(0,l.when)((0,l.pipe)(Ms,We),(t=>{const r=Ms(t),n=e[r],i=n&&$y(n,e);return null!=i&&i.attributes?(0,l.evolve)({value: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){Ly(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),xy=(e,t,r)=>Gh(xh((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),Yh((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e).map((e=>(0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.pipe)((0,l.filter)((e=>!e.refRelation||e.refEntity)),(0,l.map)(My(r,e.type)),(0,l.map)(Fy(ut))))})(e))).concat(Zm(e,t)),$y=(e,t)=>(0,l.evolve)({attributes:$l({valueTransformer:(0,l.pipe)(Gs,My(t),ky(ut)),deleteEmptyComplex:!0}),uri:ut})(e);function Vy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Gy(e,t,r[t])}))}return e}function Gy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Wy=(0,l.unless)(l.isNil,(e=>e.replace(new RegExp(Le,"g"),"uri$$$$").replace(new RegExp(je,"g"),""))),By=e=>(0,l.pipe)((0,l.evolve)({objectUri:Wy,objectParentUri:Wy}),(e=>{return Vy({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?dt.missed:dt.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&<(e.objectUri),uri:e.objectUri,source:yt.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),Yy=(e,t)=>(0,l.map)((0,l.pipe)(By,(e=>{var r,n,i,a;const{metadata:o}=t,{uri:s,parentUri:u}=e,c=by(t,s),p=null!=c&&c.length?c.slice(0,-1):by(t,u),d=((e,t,r)=>{let{uri:n,attributeTypeUri:i}=r,a=i&&Ur(e,i);if(!a&&n&&t&&t.length){const e=(0,l.last)(t);e.type===mt.attributeValue&&(a=e.valueType)}return a})(o,c,e);return Vy({},e,{attributeType:d,attributeTypeUri:null==d?void 0:d.uri,uri:c&&(null===(r=(0,l.last)(c))||void 0===r||null===(n=r.value)||void 0===n?void 0:n.uri)||s,parentUri:p&&(null===(i=(0,l.last)(p))||void 0===i||null===(a=i.value)||void 0===a?void 0:a.uri)||u,path:s?c:p})}),(e=>{let{entitiesMap:t,metadata:r}=e;return e=>{const{uri:n,parentUri:i,path:a,attributeTypeUri:o}=e;if(!n&&null!=a&&a.length&&i&&st(i)){const n=(0,l.last)(a),i=n.valueType;if(gr(i)&&or(i).includes(o)){const i=Ms(n.value),o=i&&We(i)?t[i]:null;return o?Vy({},e,{parentUri:o.uri,path:a.concat({type:mt.tempEntity,value:o,valueType:pn(r,o.type),label:""})}):e}}return e}})(t)))(e),qy=e=>{if(e.type===Et.AGO||e.type===Et.WITHIN){const[t,r]=e.period;return"Number"===(0,l.type)(t)&&"String"===(0,l.type)(r)&&t>0}if(e.type===Et.BETWEEN){const[t,r]=e.period;return t instanceof Date&&r instanceof Date}},Hy=e=>`equals(user, '${Ju(e)}')`,Jy=e=>`equals(items.delta.sources, '${e.abbreviation}')`,Qy=e=>`equals(items.objectType, '${e.uri}')`,Ky=e=>{const{period:t,type:r}=e;if(!qy(e))return"";switch(r){case Et.WITHIN:return`gte(timestamp, ${X(t)})`;case Et.AGO:return`lte(timestamp, ${X(t)})`;case Et.BETWEEN:{const[e,r]=t;return`range(timestamp, ${e.valueOf()}, ${f()(r).endOf("date").valueOf()})`}default:return""}},Xy=e=>[`equals(items.objectUri, '${e}')`,`equals(items.startObjectUri, '${e}')`,`equals(items.endObjectUri, '${e}')`].join(" or "),zy=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),Zy=e=>{let{query:t,body:r}=e;return t=zy(t),ou(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},ef=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n=[...e];r&&n.push({filter:"containsWordStartingWith",fieldName:"attributes",values:[r]});const i={filter:(0,l.pipe)(Yc(),qc(t.globalFilter))(n),activeness:t.activityFilter||Un.ACTIVE_ONLY};return t.searchOptions&&(i.options=t.searchOptions),`/entities/_total${Xr(i)}`},tf=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=ef(e,t,r);return ou(n)},rf=e=>ou(`/entities/_total?${e}`),nf=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(0,l.pipe)((0,l.filter)(As),(0,l.map)((0,l.prop)("uri")))(e),i={filter:bn.EQUALS,fieldName:"type",values:n},a=r.isRawFilter?{rawFilter:t}:{filter:"containsWordStartingWith",fieldName:"attributes",values:[t]},o=(0,l.pipe)(Yc(),qc(r.globalFilter))([i,a]),s=Xr({filter:o,select:"uri,label,type,roles,secondaryLabel,defaultProfilePicValue",scoreEnabled:!0,activeness:r.activityFilter||Un.ACTIVE_ONLY,max:r.max||4});return ou("/entities/_typeAheadSearch"+s,{method:"GET"})},af=(0,l.pipe)((0,l.reject)(l.isNil),Kr),of=e=>{let{fieldName:t,searchParams:r=[],options:n={}}=e;const{globalFilter:i,activityFilter:a,searchOptions:o,max:s,pageNo:u}=n,c=(0,l.pipe)(Yc(),qc(i))(r),p=af({filter:c||null,activeness:a||"active",options:o||null}),d=[{fieldName:t,pageSize:s||20,pageNo:u||1,orderType:n.orderType||"reversedCount"}];return Zy({query:p,body:d})},sf=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return of({fieldName:t,searchParams:i,options:n})};function lf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const uf="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",cf=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n=[...e,{filter:"containsWordStartingWith",fieldName:"attributes",values:[r]}],i={filter:(0,l.pipe)(Yc(),qc(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||uf,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null};return t.searchOptions&&(i.options=t.searchOptions),`/entities${Xr(i)}`},pf=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=cf(e,t,r);return ou(n)},df=e=>hf(e,{select:"secondaryLabel"}),yf=(e,t)=>{const{select:r=uf,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),ou("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},ff=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),We)),Tf=e=>{const{parentUri:t,attributeTypeUri:r,values:n=[],offset:i,defaultMaxValues:a,tenant:o,apiPath:s,searchQuery:u,filters:c=[],sorting:p,options:d="ovOnly"}=e,y=n.length,f=ff(n).length,T={[r]:{max:a,offset:(0,l.isNil)(i)?y-f:i}},E=Nr(r),m={attributesPaging:T,defaultMaxValues:a,options:d,select:"crosswalks,"+E},h=[...c,{filter:"containsWordStartingWith",fieldName:E,values:[u]}],b=(0,l.pipe)(Yc(),qc(d.globalFilter))(h);return b&&(m.filter=b),p&&(m.sort=p.field,m.order=p.order),ou(`${s}/api/${o}/${t}/_object`,{method:"POST",body:JSON.stringify(m)})},Ef=e=>`entities?filter=equals(uri,'${e}')&offset=0`,mf={options:"sendHidden,addRefAttrUriToCrosswalk"},hf=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:mf;return ou(`/${e}${Xr(t)}`)},bf=(e,t)=>hf(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){lf(e,t,r[t])}))}return e}({},mf,{explicitSurvivorshipGroup:t})),Of=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r={method:"POST",body:JSON.stringify([e])},n=t("/entities");return ou(n,r)},vf=e=>ou(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),gf=(e,t,r)=>{const n={method:"POST",body:JSON.stringify(t)};return ou(`/${e}/_clone${Xr({executeLCA:!1,valuesToCopy:r})}`,n)},_f=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return ou(`/entities/_events/_total${Kr({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Af=(e,t)=>ou(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",body:t}),Nf=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return ou(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",body:JSON.stringify(r)})},Pf=e=>{let{entityUri:t,offset:r,max:n,filter:i,sort:a,order:o}=e;const s={offset:r,max:n,filter:i,sort:a,order:o};return ou(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),Kr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Rf=e=>{const t=new FormData;return t.append("file",e),ou("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=Te(e,ye().text("Can't upload file"));return Promise.reject(t)}))},Sf=e=>{let{containsWordStartingWith:t,sortBy:r,sortOrder:n,favoriteOnly:i,offset:a,max:o,countResults:s=!1,findPublic:l=!0,includes:u,startsWith:c}=e;return ou(`/personal/findSavedSearches${Kr({countResults:s,findPublic:l})}`,{method:"POST",body:JSON.stringify({containsWordStartingWith:t,sortBy:r,sortOrder:n,favoriteOnly:i,offset:a,max:o,includes:u,startsWith:c}),headers:{"Content-Type":"application/json"}})},wf=e=>ou(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),If=e=>ou("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Uf=e=>{const{uri:t}=e,r=(0,l.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return ou(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},Cf=e=>{let{uri:t}=e;return ou(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},Df=(e,t)=>(0,l.pipe)((0,l.evolve)({isPublic:(0,l.always)(t)}),Uf)(e),Lf=(e,t)=>(0,l.pipe)((0,l.evolve)({isFavorite:(0,l.always)(t)}),Uf)(e);function jf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const kf=["max","offset","filter"],Ff=(0,l.curry)(((e,t)=>t.nextEntry?(0,l.evolve)({nextEntry:Ff(e)},t):function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){jf(e,t,r[t])}))}return e}({},t,(0,l.pick)(kf,e)))),Mf=e=>{if(1===e.length&&((0,l.pathEq)([0,"activeness","entity"],vt.ALL,e)||(0,l.pathEq)([0,"activeness","relation"],vt.ALL,e)))return!1},xf=(0,l.omit)(["activeness"]),$f=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=Mf(t),{searchByOv:i}=r;t=(0,l.map)((0,l.pipe)((0,l.when)((0,l.prop)("nextEntry"),(e=>(0,l.pipe)(Ff(e),(0,l.omit)(kf))(e))),xf,(0,l.omit)(["labels"])))(t);const a={limitCreditsConsumption:!0,activeness_enabled:n,options:i?"searchByOv":void 0},o=`/${e}/_connections${Xr(a)}`,s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)};return{url:o,options:s}},Vf=(0,l.map)((e=>{let t=e;for(;t&&t.nextEntry;)t=t.nextEntry;return t})),Gf=(0,l.reject)(l.isNil),Wf=(0,l.unless)((0,l.startsWith)("/"),(0,l.concat)("/")),Bf=e=>ou(Wf(e),{method:"GET",headers:{"Content-Type":"application/json"}}),Yf=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r=(0,l.pipe)(t,Wf);return ou(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},qf=e=>{let{startEntityUri:t,endEntityUri:r,relationType:n,attributes:i,startDate:a,endDate:o,uriPreprocessor:s=l.identity}=e;const u={type:n,startObject:{objectURI:t},endObject:{objectURI:r},attributes:i?Gl()(i):null,startDate:a,endDate:o},c=(0,l.pipe)(Gf,ie,JSON.stringify);return ou(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(u)})},Hf=e=>{let{oldRelation:t,newRelation:r,uriPreprocessor:n=l.identity}=e;const i=(0,l.prop)("attributes"),a=(0,l.pipe)((0,l.prop)("uri"),(0,l.concat)(l.__,"/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk"),Wf,n),o=xh(i(t),i(r)).concat(Vh(t,r));return ou(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},Jf=(e,t,r)=>{const{url:n,options:i}=$f(e,t,r);return ou(n,i).then(Vf)},Qf=(e,t)=>ou(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),Kf=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===Ln.IN?a.inRelations=[n]:a.outRelations=[n],ou(`/${e}/_ignoreSuggestedRelationship`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},Xf=e=>{let{servicesPath:t="",environment:r,tenant:n,application:i}=e;return ou(`${t}/recentSearches${Xr({environment:r,tenant:n})}`,{method:"GET",application:i,headers:{"Content-Type":"application/json"}})},zf=e=>ou("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Zf=e=>{let{environment:t,tenant:r,createdDate:n}=e;return ou(`/recentSearches${Xr({environment:t,tenant:r,createdDate:n})}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};function eT(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){tT(e,t,r[t])}))}return e}function tT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rT={select:"label,secondaryLabel,name,type,startDate,endDate"},nT=(0,l.reject)(l.isNil),iT=(0,l.pipe)(nT,Kr),aT=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i,signal:a}=e;const o=eT({},rT,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{},{limitCreditsConsumption:!0});return ou(`/${t}/_tree${iT(o)}`,{method:"GET",headers:{"Content-Type":"application/json"},signal:a})},oT=e=>{let{uri:t,graphUri:r}=e;const n=eT({},rT,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return ou(`/${t}/_parents${iT(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},sT=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1,limitCreditsConsumption:o,max:s}=e;const l=eT({},rT,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},o?{limitCreditsConsumption:o}:{},s?{max:s}:{},{filterLastLevel:i,deep:a});return ou(`/${t}/_hops${iT(l)}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function lT(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}const uT=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},cT="/activities",pT=e=>{let{label:t,description:r}=e;return ou(cT,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:uT()}})};var dT;!function(e){e.userSearch="USER_SEARCH",e.profileView="USER_PROFILE_VIEW"}(dT||(dT={}));const yT=e=>{const t=Xr(e);return ou(cT+t,{method:"GET"})},fT=e=>ou(`/activities/_total${Xr(e)}`,{method:"GET"}),TT=e=>{const{entityUri:t}=e,r=lT(e,["entityUri"]);return ou(`/${t}/_activities${Xr(r)}`,{method:"GET"})},ET=e=>{const{entityUri:t}=e,r=lT(e,["entityUri"]);return ou(`/${t}/_activities/_total${Xr(r)}`,{method:"GET"})};function mT(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){hT(e,t,r[t])}))}return e}function hT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bT=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},OT=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return ou(bT({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},vT=e=>{let{workflowPath:t,url:r,tenant:n,method:i,data:a,headers:o}=e,s=r;return r.includes("http:")||r.includes("https:")||(s=bT({url:r,workflowPath:t,tenant:n})),ou(s,{method:i||"GET",body:JSON.stringify(a),headers:mT({"Content-Type":"application/json"},null!=o?o:{})})},gT=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=bT({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,l.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return ou(e,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(n)})}));return(0,l.pipe)((e=>e.map((t=>[e[0],t])).slice(1)),(0,l.map)(s(o,r)),(e=>Promise.all(e)),(0,l.andThen)(l.last))(n)},_T=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=bT({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?mT({},l,{comment:o}):l;return ou(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},AT=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const u=bT({url:`/tasks${s?Xr(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(mT({objectURIs:[i]},(0,l.reject)(E,a)))};return ou(u,mT({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},NT=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i,max:a,offset:o}=e;return ou(bT({url:"/tasks",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)({assignee:i,max:a,offset:o})})},PT=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i,max:a,offset:o}=e;return ou(bT({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)(mT({max:a,offset:o},i))})},RT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return ou(bT({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},ST=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return ou(bT({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},wT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return ST({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},IT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return ou(bT({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},UT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return ST({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},CT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return ST({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},DT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return ST({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},LT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a}=e;return ou(bT({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a})})},jT=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return ou(bT({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},kT=e=>{let{entityUri:t,max:r,deep:n,sort:i,order:a,activeness:o,filter:s,markMatchedValues:u,sources:c,rules:p}=e;const d={max:r,deep:n,filter:s,markMatchedValues:u,sort:i,order:a,activeness:o,sources:c,rules:p};return ou(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),Kr)(d)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},FT=e=>{let{entityUri:t,max:r,sort:n,order:i,activeness:a,filter:o}=e;const s={max:r,filter:o,sort:n,order:i,activeness:a};return ou(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),Kr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},MT=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return ou("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},xT=(e,t,r)=>Promise.all(t.map((async t=>await ou(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})))),$T=async(e,t)=>await xT(e,t,"NOT"),VT=async(e,t)=>await xT(e,t,"MATCH"),GT=async(e,t)=>await Promise.all(t.map((async t=>await ou(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}}))));function WT(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){BT(e,t,r[t])}))}return e}function BT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function YT(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}const qT=3e4,HT=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return ou(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},JT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return yE({url:`entities/_connections/_hasNonImported?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}})},QT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return yE({url:`entities/_connections/_import?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}})},KT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return ou(`${t}entities/_merge?dataEntityUri=${i}&customerEntityUri=${a}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},XT=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{dataTenant:a,uri:o}=n;return Promise.all(i.map((e=>{let{uri:n}=e;return KT({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},zT=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{uri:a}=n,[o,s]=(0,l.partition)(hp,i);return Promise.all([s.length?MT(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return KT({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},ZT=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return r.map((0,l.assoc)("matchRule",t))})),(0,l.reduce)(((e,t)=>{let{matchRule:r}=t,n=YT(t,["matchRule"]);const i=e.findIndex((e=>{let{object:{uri:t}}=e;return n.uri===t}));return-1===i?e.concat({object:n,matchRules:[r]}):(0,l.adjust)(i,(0,l.evolve)({matchRules:(0,l.append)(r)}),e)}),[])),eE=(0,l.pipe)((0,l.find)((0,l.propEq)("index",0)),(0,l.propOr)({},"object"),ZT),tE=e=>{let{dtssPath:t,customerTenant:r,entity:n}=e;const{uri:i,dataTenant:a}=n;return ou(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:a,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(eE)},rE=e=>t=>{let{dtssPath:r,dataTenants:n=[],customerTenant:i,entity:a}=t;return Promise.all(n.map((t=>{let{id:n}=t;return e({dtssPath:r,dataTenant:n,customerTenant:i,entity:a}).then((0,l.map)((0,l.assocPath)(["object","dataTenant"],n))).catch((e=>(console.log(e),[])))}))).then(l.flatten)},nE=rE((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return ou(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{uri:a,type:o}])}).then(eE)})),iE=rE((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return ou(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),aE=(e,t)=>{let{dtssPath:r,dataTenants:n=[],entity:i,customerTenant:a,dtssRequest:o}=e;return function(){if(r&&n&&n.length){const e=o({dtssPath:r,dataTenants:n,entity:i,customerTenant:a});return Promise.all([t(...arguments),e]).then(l.flatten)}return t(...arguments)}},oE=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return ou(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},sE=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{dataTenant:o,uri:s}=i;return Promise.all(a.map((t=>{let{uri:i}=t;return oE(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},lE=sE("NOT"),uE=sE("MATCH"),cE=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{uri:o}=i,[s,u]=(0,l.partition)(hp,a);return Promise.all([xT(o,u,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return oE(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},pE=cE("NOT"),dE=cE("MATCH");function yE(e){let{requestProvider:t=ou,url:r,options:n,dataTenant:i,customerTenant:a,dtssPath:o}=e;r=o.endsWith("/")&&r.startsWith("/")?r.slice(1):r;const s=n||{},{headers:l}=s;return t(`${o}${r}`,WT({},YT(s,["headers"]),{headers:WT({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const fE=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return yE({url:cf(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},TE=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return yE({url:ef(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},EE=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a,options:o}=e;const{searchByOv:s}=o,{options:u}=$f(t,r);return yE({url:`entities/_connections/_getConnections${Xr({dataEntityUri:t,options:s?"searchByOv":void 0})}`,options:u,dataTenant:n,customerTenant:i,dtssPath:a}).then((0,l.pipe)(Vf,(0,l.map)((0,l.evolve)({connections:(0,l.map)((0,l.pipe)((0,l.assocPath)(["entity","dataTenant"],n),(0,l.assocPath)(["relation","dataTenant"],n)))}))))},mE=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return yE({url:`${Ef(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},hE=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return ou(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},bE=e=>{let{dtssPath:t,tenant:r}=e;return ou(`${t}tenants/customerTenants?id=${r}&useCache=true`,{method:"GET",timeout:qT})},OE=e=>{let{dtssPath:t,customerTenant:r}=e;return ou(`${t}subscriptions?useCache=true`,{method:"GET",headers:{CustomerTenant:r},timeout:qT})},vE=e=>{let{dtssPath:t,tenants:r}=e;return ou(`${t}tenants/dataTenants?id=${r}&useCache=true`,{method:"GET",timeout:qT})},gE=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return yE({url:Ef(t),dataTenant:r,customerTenant:n,dtssPath:i})},_E=()=>ou("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET"});function AE(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){NE(e,t,r[t])}))}return e}function NE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const PE=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=AE({},n,{ordered:"true",orderBy:"LastName,FirstName",from:0,max:100},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(i,["select"]));return ou(`${t}/api/${r}/graph/search${Xr({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},RE=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return ou(`${t}/api/${r}/graph/search/count`,{method:"POST",body:AE({},n,i),headers:{"Content-Type":"application/json"}})},SE=(e,t)=>`${e}/${t}/comments`,wE=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return ou(`${SE(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},IE=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return ou(`${SE(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},UE=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return ou(SE(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},CE=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return ou(`${SE(t,r)}/${n.commentId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},DE=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return ou(`${SE(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},LE=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i}=e;return ou(`${SE(t,r)}/${n}/replies/${i}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},jE=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i,data:a}=e;return ou(`${SE(t,r)}/${n}/replies/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},kE=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return ou(`${SE(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},FE=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=Xr({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return ou(`${SE(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function ME(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){xE(e,t,r[t])}))}return e}function xE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $E=e=>{let{tenant:t,servicesPath:r}=e;return ou(`${r}/users/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})},VE="graphExport",GE=async(e,t,r,n,i)=>{let a;try{const{data:n={}}=await qE({servicesPath:e,tenant:t,environment:r,namespace:VE,options:{method:"GET",headers:{"Content-Type":"application/json"}}});a=n}catch(e){a={}}const o={body:JSON.stringify(ME({},a,{[n]:i})),headers:{"Content-Type":"application/json"}};let s;try{s=await qE({servicesPath:e,tenant:t,environment:r,namespace:VE,options:ME({method:"PUT"},o)})}catch(e){s=null}return s||(s=await qE({servicesPath:e,tenant:t,environment:r,namespace:VE,options:ME({method:"POST"},o)})),s},WE=e=>{let{servicesPath:t,key:r}=e;return ou(`${t}/settings${Xr({key:r})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},BE=e=>{let{servicesPath:t}=e;return ou(`${t}/version/collect`,{method:"POST",headers:{"Content-Type":"application/json"}})},YE=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return ou(`${n}/plugins${Xr({tenant:t,user:r})}`,{method:"GET"})},qE=e=>{let{tenant:t,environment:r,servicesPath:n,options:i,namespace:a,projection:o}=e;return ou(`${n}/configService${Xr({tenant:t,environment:r,namespace:a,projection:o})}`,i)},HE=e=>{let{tenant:t,environment:r,servicesPath:n}=e;return qE({tenant:t,environment:r,servicesPath:n,options:{method:"GET"}})},JE=e=>{let{servicesPath:t,stateHash:r}=e;return ou(`${t}/searchLink?key=${r}`,{method:"GET"})},QE=e=>{let{imageServicePath:t,environment:r,tenant:n,image:i}=e;const a=new FormData;return"string"==typeof i?(a.append("sourceUrl",i),a.append("upload","false")):a.append("file",i),ou(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},KE=e=>ou(`/${e}?showObjectsInfo=true`,{method:"GET"}),XE=e=>{let{exportPath:t,tenant:r,options:n}=e;return ou(`${t}/${r}/activities${Xr(n)}`,{method:"POST"})};function zE(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){ZE(e,t,r[t])}))}return e}function ZE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const em=e=>{const{entityUri:t}=e;return ou(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},tm=e=>{let{entityUri:t,crosswalk:r}=e;return ou(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},rm=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return ou("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[zE({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),zE({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},nm=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return ou(`/${r}/_${n}${Xr({contributorURI:t})}`,{method:"POST"})},im=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return ou(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},am=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return ou(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},om=e=>{let{entityUri:t,crosswalkId:r}=e;return ou(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})};function sm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lm=e=>{let{entityTypeUri:t}=e;return ou(`/dataQuality/fillRates${Kr({entityType:Ze(t)})}`,{method:"GET"})},um=e=>{let{attributes:t=[],metrics:r=[]}=e;const n=r.length,i=t.length*n;return i>10?10:i},cm=e=>{let{entityTypeUri:t,attributes:r,dataLevel:n,metrics:i}=e;const a=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){sm(e,t,r[t])}))}return e}({},n===Dt.ATTRIBUTE_TYPE?{attributes:r}:{},i?{metrics:i}:{}),o=n===Dt.ATTRIBUTE_TYPE?Kr({numberOfThreads:um({attributes:r,metrics:i})||1}):"";return ou(`/entityType/${Ze(t)}/dataQuality/${n}${o}`,{method:"POST",body:JSON.stringify(a)})},pm=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n,env:i}=e;return ou(`${t}/api/${r}/dataValidationFunctions/entityTypes/${Ze(n)}`,{method:"GET",headers:{env:i}})},dm=e=>{let{mlDqPath:t,tenant:r,entityTypeUri:n,attribute:i,viewMultiplier:a=1,dataLevel:o=Dt.ATTRIBUTE_TYPE,metrics:s=[],startDate:l,endDate:u}=e;const c={attribute:i,metrics:s,viewMultiplier:a,startDate:l,endDate:u};return ou(`${t}/${r}/entityType/${Ze(n)}/ml/dataQuality/v1/${o}/timeSeries/`,{method:"POST",body:JSON.stringify(c)})},ym=e=>{let{tenant:t,apiPath:r}=e;return ou(`${r}/permissions/${t}`,{method:"GET"})},fm=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return ou(`/${t}${Xr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},Tm=e=>{let{attributeUri:t,value:r}=e;return ou(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},Em=e=>{let{attributeUri:t,value:r}=e;return ou(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},mm=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return ou(`/${t}${Xr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},hm=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=Xr({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=Gl()([[{value:a}]]);return ou(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},bm=e=>{let{entityUri:t,attributeName:r,value:n}=e;return ou(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},Om=e=>{let{entityUri:t,attributeName:r}=e;return ou(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};function vm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gm=e=>{let{entityUri:t}=e;return ou(`/${t}/_historicURIs`,{method:"GET"})},_m=e=>{let{entityUri:t,historicUris:r}=e,n=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["entityUri","historicUris"]);return ou(`/${t}/_changesWithTotal${Xr(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){vm(e,t,r[t])}))}return e}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},Am=(e,t)=>ou(`/${e}/_previousChange${Xr({timestamp:t})}`,{method:"GET"}),Nm=(e,t)=>ou(`/${e}${Xr({time:t})}`,{method:"GET"});function Pm(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){Rm(e,t,r[t])}))}return e}function Rm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Sm=e=>{let{url:t,method:r,data:n,headers:i,noRequestProcessor:a}=e;const o=r||"GET";let s;return"GET"!==o&&(s=ce(n)?JSON.stringify(n):n),ou(t,{method:o,body:s,headers:Pm({"Content-Type":"application/json"},null!=i?i:{}),noRequestProcessor:a})},wm=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=Xr({options:a.join(","),severity:o.join(",")});return ou(`${t}/validate/${i}/entity/${gp({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},Im=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return ou(`${t}/validate/${n}/entity${Xr({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},Um=e=>{let{tenant:t,apiPath:r}=e;return ou(`${r}/tenants/${t}/name`,{method:"GET"})},Cm=e=>{let{tenant:t,apiPath:r}=e;return ou(`${r}/tenants/${t}/_rdmTenants`,{method:"GET"})},Dm=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e;return ou(`${a}/preferences${Xr({name:t,tenant:r,environment:n,user:i})}`,{method:"GET"})},Lm=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a,value:o}=e,s={name:t,tenant:r,environment:n,user:i,values:[JSON.stringify(o)]};return ou(`${a}/preferences`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})},jm=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e,o={name:t,tenant:r,environment:n,user:i};return ou(`${a}/preferences`,{method:"DELETE",body:JSON.stringify(o)})},km=e=>{const{servicesPath:t}=e;return ou(`${t}/getTokenForWorker`,{method:"GET"})};var Fm=r(29524);const Mm=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=Be(),s={attributes:Il({attributeTypes:n,parentUri:o,metadata:i,mode:a}),uri:o,type:t,timestamp:Date.now()};return r?function(e,t,r){const n=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:[]).find((e=>!e.lookupCode&&!e.dependentLookupCode&&"String"===e.type));if(n){const i=Ws(r,e,n.uri)[0];return i&&i.value?jl({entity:e,attributeType:n,uri:i.uri,value:t}):Dl({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},xm=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.filter)((0,l.has)("refEntity")),(0,l.map)(Ms),(0,l.filter)(We),(0,l.map)((t=>e[t])),(0,l.reject)(l.isNil))((null==t?void 0:t.attributes)||{}),$m=(0,l.curry)(((e,t)=>{const r=xm(e=e||{},t=t||{});return r.concat((0,l.chain)($m(e),r))})),Vm=(0,l.curry)(((e,t)=>(0,l.pipe)(pe,(0,l.filter)(e))(t))),Gm=Vm((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),Wm=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),We)),Bm=e=>(0,l.pipe)(Gm,Wm(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),Ym=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(Gm,(0,l.find)((t=>(0,l.pathSatisfies)((t=>t===e),t,r))))(r);return n?(0,l.set)((0,l.lensPath)(n),t,r):r})),qm=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),We),(0,l.omit)(["uri","timestamp"])),Hm=(0,l.pipe)(qm,Dp),Jm=async(e,t,r)=>{if(!e)return null;const n=Bm(e);if(n.length>0)for(const r of n)e=Ym(r,t[r],e);const i=await Of(Hm(e),null==r?void 0:r.enhanceUriWithDCR),a=(e=>(0,l.path)([0,"errors"],e))(i);if(a)throw a;if((0,l.has)("changes",i))return null==r||r.updateDCRUriFromResponse(i),((e,t)=>(0,l.pipe)((0,l.prop)("changes"),l.keys,(0,l.find)((e=>!(0,l.values)(t).includes(e))))(e))(i,t);const o=(e=>(0,l.pathOr)(e,[0,"object"],e))(i);return o.uri},Qm=async(e,t,r)=>{const n=Xm(e,t),i={};for(const t of n)i[t]=await Jm(e[t],i,r);return i},Km=(0,l.curry)(((e,t)=>{const r=Fm.Node(t);return Bm(e[t]).forEach((t=>{const n=Km(e,t);r.addEdge(n)})),r})),Xm=(e,t)=>(0,l.pipe)((0,l.map)(Km(e)),(0,l.map)(Fm.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),zm=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)(qm))})),Zm=(e,t)=>[...qh(e.tags||[],t.tags||[]),...Hh(e.roles||[],t.roles||[]),...$h(e,t),...Vh(e,t)],eh=(e,t)=>[...Gh(xh((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),Yh((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e),...Zm(e,t)],th=(0,l.pipe)(((e,t)=>{const r=(0,l.toPairs)(e);return(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)((e=>r.reduce(((e,t)=>{let[r,n]=t;return Ym(r,n,e)}),e))))}),t)}),zm),rh=(0,l.curry)(((e,t)=>(0,l.when)(We,(0,l.propOr)(l.__,t,e),t)));function nh(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){ih(e,t,r[t])}))}return e}function ih(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ah=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return nh({},t,{[r]:{parents:n,children:i}})},oh=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return nh({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},sh=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=t[e],a=xm(t,i),o=ah({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>sh(n.uri,t,[e],r)),o)},lh=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return e.reduce(((e,n)=>{const i=(0,l.path)(Cd(),n),a=t?oh({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(Fd(),n),s=We(o)?[o]:[],u=ah({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>sh(t,r,[i],e)),u)}),n)},uh=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return lh(r,e,t,sh(e,t))},ch=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return uh(t,r,n);if(He(e)){const t=Bd(n,e);return t&&lh([t],null,r)}return r[e]?sh(e,r):void 0},ph=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>ph(e,t))))},dh=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>dh(e,t))))},yh=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=qe(t),u=uh(r,n,i),c=((e,t,r)=>{let{entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[];let s;for(let e=0;e<t.length;e++){const u=t[e],c=t[e+1]||r;if(He(c)){if(s=Bd(i,c),!s)return null;o.push({type:mt.relationConnection,value:s,valueType:Vi(a,(0,l.path)(Dd(),s))});continue}if(He(u)){const e=n[c];if(!e)return null;o.push({type:mt.tempEntity,value:e,valueType:pn(a,e.type)});continue}const p=n[u],d=il(p,c),y=n[c];if(!d||!y)return null;o.push({type:mt.attributeValue,value:d,valueType:Ur(a,nt(d.uri,p.type))}),o.push({type:mt.tempEntity,value:y,valueType:pn(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},dh(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=He(s),d=p?Yd(i,s):n[s],[y,f]=t!==s?(e=>{const t=e.split("/attributes/").slice(1).join("/attributes/");if(!t)return[];const[r,n]=t.split("/").reduce(((e,t,r)=>(e[r%2==0?0:1].push(t),e)),[[],[]]);return r.length!==n.length?[]:[r,n]})(t):[[],[]];if(!d||!y||!f)return null;let T,E=p?Vi(a,d.type):pn(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:Cr(a,E);if(E=null==t?void 0:t.find((0,l.propEq)("name",y[e])),!E)return null;{var h,b,O,v;const t=t=>{let{uri:r}=t;return r.endsWith(`/${f[e]}`)},r=null===(h=m[E.name])||void 0===h?void 0:h.find(t),i=null===(b=T)||void 0===b||null===(O=b.attributes)||void 0===O||null===(v=O[E.name])||void 0===v?void 0:v.find(t),s=i||r;if(!s)return null;i&&o.push({type:mt.tempEntity,value:T,valueType:pn(a,T.type)}),o.push({type:mt.attributeValue,value:s,valueType:E}),m=s.value;const l=Ms(s);T=l&&We(l)?n[l]:null}}return o},fh=e=>e.every((e=>{let{type:t}=e;return[mt.attributeValue,mt.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===mt.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null;let Th;!function(e){e.insertAttribute="insertAttribute",e.updateAttribute="updateAttribute",e.deleteAttribute="deleteAttribute"}(Th||(Th={}));const Eh={[Th.insertAttribute]:{color:"#599E0E"},[Th.updateAttribute]:{backgroundColor:"rgba(255, 187, 0, 0.12)",color:"#CC7500"},[Th.deleteAttribute]:{backgroundColor:"rgba(255, 50, 0, 0.2)",color:"#CF0E26"}},mh=e=>{switch(e){case"UPDATE_ATTRIBUTE":return Th.updateAttribute;case"UNDO_IGNORE_ATTRIBUTE":case"INSERT_ATTRIBUTE":return Th.insertAttribute;case"IGNORE_ATTRIBUTE":case"DELETE_ATTRIBUTE":return Th.deleteAttribute;default:return""}},hh="/",bh=(0,l.pipe)((0,l.split)(hh),(0,l.propSatisfies)((0,l.lte)(2),"length")),Oh=(0,l.pipe)((0,l.split)(hh),(0,l.slice)(0,-2),(0,l.join)(hh)),vh=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.has)(e),(0,l.prop)(e)],[()=>bh(e),vh(Oh(e))]])(t))),gh=e=>(0,l.pipe)(l.keys,(0,l.any)((0,l.startsWith)(e+hh))),_h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=vh(e,t);return(0,l.isNil)(r)?gh(e)(t)?"UPDATE_ATTRIBUTE":"":r},Ah=function(e,t){var r;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return null==n||null===(r=n[e])||void 0===r?void 0:r[t]},Nh=e=>{let t=[];var r;return e&&(t.push({uri:e.uri,crosswalks:e.crosswalks,merges:e.merges}),null===(r=e.merges)||void 0===r||r.forEach((e=>{e.losers.forEach((e=>{t=t.concat(Nh(e))}))}))),t},Ph=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)(Ih,t),(0,l.propOr)([],"crosswalks",e))),e),Rh=(e,t)=>{let r=e.crosswalks||[];var n;return t||null===(n=e.merges)||void 0===n||n.forEach((e=>{var t;null===(t=e.losers)||void 0===t||t.forEach((e=>{r=r.concat(Rh(e))}))})),r},Sh=e=>{let t=0;var r;return e?(null===(r=e.merges)||void 0===r||r.forEach((e=>{var r;null===(r=e.losers)||void 0===r||r.forEach((e=>{const r=Sh(e);r>t&&(t=r)}))})),t+1):t},wh=(e,t)=>{if(We(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},Ih=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},Uh=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},Ch=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},Dh=(e,t)=>{const r=t.reduce(((e,t)=>(e["configuration/sources/"+t.name]=t,e)),{}),n=t.reduce(((e,t)=>(e[t.id]=t,e)),{});return(0,l.pipe)((0,l.map)((e=>{var t,i;if(r[e.type])return r[e.type];const a=null===(t=e.crosswalkExternalInfo)||void 0===t||null===(i=t.dtssInfo)||void 0===i?void 0:i.tenantId;return a&&n[a]?n[a]:void 0})),(0,l.reject)(l.isNil),l.uniq,(0,l.ifElse)((e=>{let{length:t}=e;return 1===t}),l.head,(()=>{})))(e)},Lh=(0,l.eqBy)(Ih),jh=(0,l.pipe)((0,l.propOr)({},"attributes"),l.values,l.flatten,(0,l.filter)((0,l.has)("refRelation")),(0,l.chain)((e=>(0,l.pipe)(Cs,(0,l.propOr)([],"crosswalks"),(0,l.map)((0,l.when)((0,l.pipe)((0,l.prop)("attributeURIs"),E),(0,l.assoc)("attributeURIs",[e.uri]))))(e))));function kh(e){return e&&void 0!==e.uri}function Fh(e){return function(t,r){var n,i,a=[];return i=r,!(n=t)&&!i||!(!n||!i)&&n.length===i.length&&n.every((function(e,t){return e===i[t]}))||a.push({type:e,newValue:r}),a}}function Mh(e,t){function r(r){if(e[r]&&t[r])if(Array.isArray(e[r])&&Array.isArray(t[r])){if(e[r].length!==t[r].length)return!1;if(e[r][0]&&t[r][0]&&e[r][0].objectURI!==t[r][0].objectURI)return!1}else if(e[r].objectURI!==t[r].objectURI)return!1;return!0}return r("refEntity")&&r("refRelation")}function xh(e,t,r){var n,i,a,o=[];for(var s in e)if(e.hasOwnProperty(s)){if("paging"===s)continue;var u=e[s];if(void 0===t[s])for(var c in u)u.hasOwnProperty(c)&&o.push.apply(o,m(u[c]));else for(var p in u)if(u.hasOwnProperty(p)){var d=u[p],y=_(d,t[s]);void 0===y?o.push.apply(o,m(d)):d.value===y.value||d.lookupCode&&d.lookupCode===y.lookupCode?d.ignored!==y.ignored&&o.push.apply(o,b(y)):null==y.value||""===y.value?o.push.apply(o,m(d)):"Nested"===g(d)?d.ignored!==y.ignored&&(0,l.equals)(d.value,y.value)?o.push.apply(o,b(y)):o=o.concat(xh(d.value,y.value,r)):"Reference"===g(d)?Mh(d,y)?o.push.apply(o,xh(d.value,y.value,r)):(o.push.apply(o,m(d)),o.push(O([y]))):""!==y.value&&(!1===y.ov?o.push.apply(o,(void 0,void 0,i=(n=y).uri.lastIndexOf("/"),a=n.uri.substr(0,i),[{type:"_UPDATE_NON_OV_ATTRIBUTE",uri:n.uri,typeUri:a,value:n.lookupCode||n.value}])):o.push.apply(o,h(y)))}}for(var f in t)if(t.hasOwnProperty(f)){if("paging"===f)continue;var T=(t[f]||[]).filter((function(t){return void 0===_(t,e[f])}));(T=E((0,l.clone)(T))).length&&o.push(O(T))}return o;function E(e){return e?e.map((function(e){var t;if(e){var r=e.value;return null!=r&&(ce(r)?Object.keys(r).forEach((function(e){var n=E(r[e]);n.length>0?r[e]=n:delete r[e],t||(t=0!==n.length)})):t=null!=r&&""!==r),t||e.lookupCode||e.refEntity?e:null}})).filter((function(e){return null!=e})):[]}function m(e){return[{type:"DELETE_ATTRIBUTE",uri:e.uri}]}function h(e){return[{type:"UPDATE_ATTRIBUTE",uri:e.uri,newValue:{value:e.lookupCode||e.value}}]}function b(e){return e&&(e.ignored?function(e){return[{type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}}]}(e):function(e){return[{type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!1}}]}(e))}function O(e){var t=e[0].uri,n=t.lastIndexOf("/"),i={type:"INSERT_ATTRIBUTE",uri:t=t.substr(0,n),newValue:e.map((function(e){var t,n={value:JSON.parse(JSON.stringify(e.lookupCode||e.value))};return r&&(n.uri=e.uri),v(n.value),e.refEntity&&(t=e.refEntity,Array.isArray(t)&&(t=t[0]),n.refEntity=t),e.refRelation&&(t=e.refRelation,Array.isArray(t)&&(t=t[0]),r||delete t.objectURI,n.refRelation=t),n}))};return i}function v(e){if(null!==e&&"[object Object]"===e.toString())for(var t in e)e.hasOwnProperty(t)&&"paging"!==t&&e[t].forEach((function(e){delete e.crosswalks,delete e.type,r||delete e.uri,v(e.value)}))}function g(e){var t=e.value;if(ce(t))return e.hasOwnProperty("refEntity")?"Reference":"Nested"}function _(e,t){if(void 0!==t)return t.filter((function(t){return t.uri===e.uri}))[0]}}function $h(e,t){var r,n,i=[];return e.defaultProfilePic!==t.defaultProfilePic?i.push({type:"UPDATE_PROFILE_PIC_BY_URI",newValue:{value:t.defaultProfilePic}}):(r=e.defaultProfilePicValue)===(n=t.defaultProfilePicValue)||kh(r)&&kh(n)&&r.uri===n.uri||i.push({type:"UPDATE_PROFILE_PIC_BY_URL",newValue:{value:t.defaultProfilePicValue}}),i}function Vh(e,t){var r=[],n=a(e.startDate,t.startDate);void 0!==n&&r.push({type:"UPDATE_START_DATE",newValue:{value:n}});var i=a(e.endDate,t.endDate);return void 0!==i&&r.push({type:"UPDATE_END_DATE",newValue:{value:i}}),r;function a(e,t){var r;return e!=t&&(r=(0,l.isNil)(t)?"":t+""),r}}function Gh(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;var n="configuration/sources/Reltio",i="configuration/sources/ReltioCleanser";function a(e,t){return e.crosswalk={type:t.type,value:t.value},e}function o(e,t){return e.reduce((function(e,r){return(e[r[t]]=e[r[t]]||[]).push(r),e}),{})}function s(e){return e.removeIt=!0}var l=e.map((function(e){if(e.crosswalk)return[e];var o=Wh(t,e.uri),s=o.filter((function(e){return e.type===n})),l=o.filter((function(e){return e.type!==n})),u=[];switch(e.type){case"INSERT_ATTRIBUTE":u.push(e);break;case"_UPDATE_NON_OV_ATTRIBUTE":u=u.concat(o.map((function(t){return a(e,t)})));break;case"DELETE_ATTRIBUTE":(l.length||0==s.length)&&u.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}}),u=u.concat(s.map((function(t){return a({type:"DELETE_ATTRIBUTE",uri:e.uri},t)})));break;case"UPDATE_ATTRIBUTE":{const o=l.some((e=>{let{type:t}=e;return t===i}))&&r?Bh(r,t,e.uri):null;if(o||s.length){if(s.length)u=u.concat(s.map((function(t){return a({type:"UPDATE_ATTRIBUTE",uri:e.uri,newValue:e.newValue},t)})));else if(o){var c=Wh(t,o.uri).filter((e=>{let{type:t}=e;return t===n}));u=u.concat(c.map((t=>a({type:"UPDATE_ATTRIBUTE",uri:o.uri,newValue:e.newValue},t))))}}else u.push({type:"INSERT_ATTRIBUTE",uri:e.uri.substr(0,e.uri.lastIndexOf("/")),newValue:[e.newValue],insteadOfUpdate:!0});l.length&&u.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}});break}}return u})),u=[].concat.apply([],l),c=o(u,"typeUri");for(var p in c)if("undefined"!==p){var d=c[p],y=u.filter((function(e){return"_UPDATE_NON_OV_ATTRIBUTE"!==e.type})).filter((function(e){return e.uri.substr(0,e.uri.lastIndexOf("/"))===p||"INSERT_ATTRIBUTE"===e.type&&e.uri===p})),f=d.filter((function(e){return e.crosswalk&&e.crosswalk.type===n}))[0],T=y.filter((function(e){return"UPDATE_ATTRIBUTE"===e.type}))[0];!T&&f&&(u.push({type:"UPDATE_ATTRIBUTE",uri:f.uri,newValue:{value:f.value},crosswalk:f.crosswalk}),y.forEach(s)),d.forEach(s)}return(u=u.filter((function(e){return!e.removeIt}))).forEach((function(e){delete e.insteadOfUpdate})),u}const Wh=(e,t)=>e.filter((function(e){return 1===(e.attributes||e.attributeURIs||[]).filter((function(e){return e===t})).length})),Bh=(e,t,r)=>(0,l.pipe)(al,(0,l.defaultTo)([]),(0,l.reject)((0,l.propEq)("uri",r)),(0,l.ifElse)((0,l.allPass)([e=>1===e.length,e=>{let[r]=e;return wh(t,r)},e=>{let[t]=e;return!Ss(t)}]),(0,l.prop)(0),(0,l.always)(null)))(e,r);function Yh(e,t){for(var r in t=t||[],e)if(e.hasOwnProperty(r))for(var n=e[r],i=0;i<n.length;i++){var a=n[i];if(a.refRelation){var o=a.refRelation[0]||a.refRelation;if(o.crosswalks)for(var s=o.crosswalks.filter((function(e){return e.attributes||e.attributeURIs})),l=0;l<s.length;l++){for(var u=!0,c=0;c<t.length;c++)if(t[c].type===s[l].type&&t[c].value===s[l].value){t[c].attributes=t[c].attributes||t[c].attributeURIs,t[c].attributes=t[c].attributes.concat(s[l].attributes||s[l].attributeURIs),t[c].attributes=Object.keys(t[c].attributes.reduce((function(e,t){return e[t]=!0,e}),{})),delete t[c].attributeURIs,u=!1;break}u&&t.push(s[l])}}}return t}function qh(e,t){return Fh("UPDATE_TAGS").call(this,e,t)}function Hh(e,t){return Fh("UPDATE_ROLES").call(this,e,t)}function Jh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Qh(e,t,r[t])}))}return e}function Qh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Kh=function(e){var t=function(e,r,n,i){if(e&&r)if(n||(n=null),i=!!i,Array.isArray(e))for(var a=0;a<e.length;a++)r.call(n,a,e[a],e),i&&t(e[a],r,n,i);else if(ce(e))for(var o in e)r.call(n,o,e[o],e),i&&t(e[o],r,n,i)},r=function(e,t,r){return function(n){var i=-1!==n.uri.lastIndexOf("/")?n.uri.substring(0,n.uri.lastIndexOf("/")):"";e[i]||(e[i]=[]),e[i].push(n.type),t[n.uri]=n.type,"IGNORE_ATTRIBUTE"===n.type&&r.push(n.uri)}},n=function(e,t,r){var n=[],i=Object.keys(e).filter((function(t){return-1!==e[t].indexOf("IGNORE_ATTRIBUTE")&&-1!==e[t].indexOf("INSERT_ATTRIBUTE")}));return Object.keys(t).filter((function(e){var t=-1!==e.lastIndexOf("/")?e.substring(0,e.lastIndexOf("/")):null;return-1!==i.indexOf(t)})).forEach((function(e){-1!==r.indexOf(e)&&n.push(e),t[e]="UPDATE_ATTRIBUTE"})),{appearance:t,ignored:n}},i=function(e,t){var r=Array.isArray(t),n=r?[]:{};return r?(e=e||[]).some((function(e){return e.uri}))?n=function(e,t){var r=e.map((function(e){return e.uri})),n=e.map((function(e){var r,n,a=(n=t.filter((function(t){return t.uri===e.uri}))[0]||{},(r=e)&&n&&r.ignored!==n.ignored&&(delete r.ignored,delete n.ignored,r.ov=!0,n.ov=!0),{a:r,b:n});return i(a.a,a.b)})),a=t.filter((function(e){return-1===r.indexOf(e.uri)}));return n.concat(a)}(e,t):(n=n.concat(e),t.forEach((function(t,r){void 0===n[r]?n[r]=t:ce(t)?n[r]=i(e[r],t):-1===e.indexOf(t)&&n.push(t)}))):(ce(e)&&Object.keys(e).forEach((function(t){n[t]=e[t]})),Object.keys(t).forEach((function(r){ce(t[r])&&e[r]?n[r]=i(e[r],t[r]):n[r]=t[r]}))),n},a=function(){let a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var s=JSON.parse(JSON.stringify(a)),l=JSON.parse(JSON.stringify(o)),u=i(a,o),c={},p={},d=[],y=r(p,c,d);e.compareAttributes(u,l).map((function(e){return"IGNORE_ATTRIBUTE"===e.type&&!1===e.newValue.value&&(e.type="UNDO_IGNORE_ATTRIBUTE"),e})).forEach((function(e){y(e)})),e.compareAttributes(u,s).map((function(e){return"DELETE_ATTRIBUTE"===e.type&&(e.type="INSERT_ATTRIBUTE"),"IGNORE_ATTRIBUTE"===e.type&&(e.type=e.newValue.value?"UNDO_IGNORE_ATTRIBUTE":"IGNORE_ATTRIBUTE"),e})).forEach((function(e){y(e)}));var f=n(p,c,d);return t(u,(function(e,t){t&&-1!==this.indexOf(t.uri)&&(t.ignored=!0,delete t.ov,t.hidden=!0)}),f.ignored,!0),{attributes:u,appearance:f.appearance}};const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=(0,l.difference)(t,e),n=(0,l.difference)(e,t),i=n.concat(t),a=(e,t)=>(0,l.pipe)((0,l.map)((t=>[t,e])),l.fromPairs)(t),o=Jh({},a("INSERT_ATTRIBUTE",r),a("DELETE_ATTRIBUTE",n));return[i,o]};return{computeHistoryDiff:a,computeEntityHistoryDiff:(e,t)=>{const{attributes:r,appearance:n}=e?a(e.attributes,t.attributes):{attributes:t.attributes,appearance:{}},[i,s]=o(e?e.roles:[],t.roles),[l,u]=o(e?e.tags:[],t.tags);return{attributes:r,appearance:Jh({},n,{roles:s,tags:u}),roles:i,tags:l}}}};const Xh=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?Xh(t.value):[]];return e.concat(r)}),[])),zh=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,Zh=e=>e?[vp(e)]:[],eb=e=>{const t=[...Xh((null==e?void 0:e.attributes)||[]),...Xh((null==e?void 0:e.analyticsAttributes)||[])];return e?[...Zh(e),...t]:[]},tb=(e,t)=>[e,...t.map((t=>zh(e,t)))],rb=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return md(t)}))},nb=(e,t)=>{switch(e){case ht.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case ht.ENTITY_ATTRIBUTE:case ht.RELATION_ATTRIBUTE:return(e=>{let{uri:t}=e;return[it(t)]})(t);case ht.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case ht.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n,dataTenant:i}}}=e;return[t,vp({uri:n,dataTenant:i}),r]})(t)}},ib=e=>(0,l.pipe)(l.values,(0,l.map)((0,l.map)((0,l.pipe)((0,l.prop)("replies"),l.inc))),(0,l.map)(l.sum),l.sum)(e),ab=(0,l.curry)(((e,t)=>{const r=Ho(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(ab(e,r.extendsTypeURI)):n})),ob=(0,l.curry)(((e,t)=>(0,l.reduce)(((t,r)=>(0,l.assoc)(r,((e,t)=>(0,l.path)(["members",t],e))(e,r),t)),{},t))),sb=(e,t)=>(0,l.pipe)((0,l.prop)("type"),ab(e),ob(t))(t),lb=e=>{const t=r=>r.reduce(((r,n)=>Math.max(r,(t=>106+16*(t.level||0)+6.5*t.item[e].length)(n),t(n.items?n.items.flat(1/0):[]))),0);return t};var ub,cb=r(33164);function pb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e.PotentialMatches="potentialMatches",e.Random0="random0",e.Random1="random1",e.SpectreYellowCyan="spectreYellowCyan",e.SpectreBlueBrown="spectreBlueBrown",e.Charts="charts",e.Crosswalks="crosswalks"}(ub||(ub={}));const db={},yb={random0:{granularity:3,colors:["#ffee91","#ffdc0e","#fec92f","#eab710","#f69785","#f57f27","#fccde5","#f8b6b8","#ff9acc","#ee4272","#b71137","#c4c0e1","#bd81be","#5f3577","#9fd6bf","#8accca","#12959f"]},potentialMatches:{colors:["#fec92f","#ee4272","#6d9a35","#555962","#2d9ecf"]},random1:{colors:["#fccde5","#ff9acc","#81b2d3","#f8b6b8","#bd81be","#82c55c","#c4e3f1","#7f939e","#ffee91","#fec92f","#ee4272","#2d9ecf","#c4c0e1","#7accca","#cdc393","#f69785","#f0ecc7","#9fd6bf","#6d9a35","#afbc26","#12959f","#aacf99","#056b97","#eab710","#b4d36a","#70bede","#f57f27","#7a843b","#cfd0d2","#555962","#b71137","#ffdc0e","#bea68c","#5f3566"]},spectreYellowCyan:{granularity:3,colors:["#ffee91","#ffdc0e","#fec92f","#eab710","#f69785","#f57f27","#fccde5","#f8b6b8","#ff9acc","#ee4272","#b71137","#c4c0e1","#bd81be","#5f3577","#9fd6bf","#7accca","#12959f"]},spectreBlueBrown:{granularity:3,colors:["#c4e3f1","#70bede","#81b2d3","#2d9ecf","#056b97","#aacf99","#b4de6a","#82c55c","#6d9a35","#afbc26","#7a843b","#cfd0d2","#7f939e","#555962","#f0ecc7","#cfc393","#bea68c"]},charts:{colors:["#0072ce","#c4ce00","#ce5c00","#4bafff","#f97061","#9e7ed3","#c34980","#c4ce00","#669977","#ffe16f","#4896df","#40cfbb","#9bc66a","#ce5c00","#4bafff","#f085f2","#bea68c"]},crosswalks:{colors:["#86f2f9","#cae815","#f8a4a4","#fd63c0","#b6c5ec","#8fe98e","#ff9c72","#84cbf3","#a8f384","#d9ffa8","#ace1ff"]}},fb=e=>{if(!db[e]){const t=yb[e]||yb.random0;db[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){pb(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return db[e]},Tb=(0,l.curry)(((e,t)=>{const r=fb(e);return r.idToColor[t]||(r.idToColor[t]=(e=>{const t=e.counter,r=e.granularity||1;return e.counter+=r,e.counter>=e.colors.length&&(++e.granularityCounter>=r&&(e.granularityCounter=0),e.counter=e.granularityCounter),e.colors[t]})(r)),r.idToColor[t]})),Eb=e=>Tb(ub.Charts,e),mb=()=>fb(ub.PotentialMatches).colors,hb=e=>Tb(ub.Random1,e),bb=e=>(0,cb.getColor)(e)?"#FFFFFF":"#212121";var Ob=r(73116);const vb=Array.from({length:100},((e,t)=>t/100)),gb=e=>{const t=Number(e.replace(/\D/g,""))||0;let r=3735928559^t,n=1103547991^t;for(let t,i=0;i<e.length;i++)t=e.charCodeAt(i),r=Math.imul(r^t,2654435761),n=Math.imul(n^t,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&n)+(r>>>0)},_b={},Ab=new Ob.Z({hash:gb,saturation:vb.slice(15,71),lightness:vb.slice(50,90)}),Nb=new Ob.Z({hash:gb,saturation:vb.slice(46,89),lightness:vb.slice(44,58)}),Pb=(0,l.curry)(((e,t,r)=>{t in _b||(_b[t]={});const n=_b[t];r in n||(n[r]=((e,t)=>{const r=String(gb(t));return e.hsl(r)})(e,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),Rb=Pb(Ab,"crosswalks"),Sb=Pb(Ab,"sources"),wb=Pb(Ab,"contributors"),Ib=Pb(Ab,"dataValidationFunctions"),Ub=Pb(Nb,"entities");function Cb(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){Db(e,t,r[t])}))}return e}function Db(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Lb=(0,l.has)("items"),jb=e=>0===e,kb=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.MAX_SAFE_INTEGER;return Math.min(Math.max(e,t),r)},Fb=e=>e.reduce(((e,t)=>e+t.width),0),Mb=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),xb=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),$b=e=>e.reduce(((e,t)=>e+t.height),0),Vb=e=>(0,l.is)(String,e)&&e.includes("%"),Gb=(0,l.has)("spacer"),Wb=(e,t)=>Math.max(Math.round(parseFloat(t)/100*e),1),Bb=e=>((null==e?void 0:e.items)||[]).reduce(((e,t)=>e.concat(Lb(t)?Bb(t):t)),[]),Yb=(e,t)=>{const r=[...t];for(;(0,l.sum)(r)>e;){const e=Math.max(...r);if(1===e)break;const t=r.indexOf(e);r[t]--}return r},qb=e=>({id:e.layout}),Hb=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:qb;const i=(e,t,r,n)=>{let{width:i}=e;const a=t.items.some((e=>e.flex));let o;if(a){const[e,n]=(0,l.partition)((0,l.propIs)(Number,"flex"),t.items),a=(0,l.pipe)((0,l.map)((0,l.pipe)((0,l.prop)("flex"),parseInt)),l.sum)(e),s=Math.round(i-i*(a/(a+n.length))),u=Math.max(s/Math.max((0,l.length)(n),1),1),c=(e,t,r)=>Math.max(Math.round(t/r*e),1);o=r.flex?c(i,r.flex,a+n.length):u}else{const[e,n]=(0,l.partition)((0,l.both)((0,l.propIs)(String,"width"),(0,l.pipe)((0,l.propOr)("","width"),(0,l.includes)("%"))),t.items),a=(0,l.pipe)((0,l.map)((0,l.pipe)((0,l.prop)("width"),parseInt)),l.sum)(e),s=Math.round(i-i*(a/100)),u=Math.max(s/Math.max((0,l.length)(n),1),1);o=Vb(r.width)?Wb(i,r.width):u}return kb(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return kb(n,t,r)},o=(e,t)=>Lb(t.items[0])?p(e,t.items[0]):null,s=(t,r)=>{const o=r.items.map((a=>i(t,r,a,Lb(a)?n(a.layout):e(a.view)))),s=Yb(t.width,o),u=r.items.reduce(((r,n,i)=>{const o=s[i],u=jb(i)?t.x:(0,l.last)(r).x+(0,l.propOr)(o,"width",(0,l.last)(r));if(Lb(n))return r.concat(p(Cb({},t,{x:u,width:o}),n));{const i=e(n.view);return r.push(Cb({y:t.y,x:u,height:a(i),width:o},i)),r}}),[]);return{x:t.x,y:t.y,width:Fb(u),height:Mb(u),items:u}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=Lb(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=jb(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(Lb(i))return r.concat(p(Cb({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(Cb({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?kb(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?kb(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:xb(i),height:$b(i),items:i}},c=(t,r)=>{const n=(e,t,r,n)=>jb(r)?e.y:(0,l.last)(t).y+((0,l.last)(t).height||n),i=(t,r,i,o)=>{const s=e(i),l=t.width,u=a(s),c=n(t,r,o,u);return Cb({},s,{x:t.x,y:c,width:l,height:u})},o=(e,t)=>{const r=t.reduce(((t,r,a)=>{if("string"==typeof r)t.push(i(e,t,r,a));else if("object"==typeof r){const o=Math.max(Math.round(e.width/2),1),s=Yb(e.width,[o,o]),u=Cb({},e,{width:s[0]}),c=Cb({},e,{x:e.x+s[0],width:s[1]}),p=(0,l.has)("left",r)&&i(u,t,r.left,a),d=(0,l.has)("right",r)&&i(c,t,r.right,a),y=(0,l.propOr)(0,"height"),f=Math.max(y(p),y(d));t.push(Cb({},e,{y:n(e,t,a,f),height:f,items:(0,l.filter)(l.identity,[p,d])}))}return t}),[]);return Cb({},e,{height:$b(r),items:r})},s=o(t,(0,l.propOr)([],"top",r)),u=Math.round(.66*t.width),c=(0,l.isEmpty)(s)?t.y:t.y+s.height,p=o(Cb({},t,{y:c,width:u}),(0,l.propOr)([],"center",r)),d=o({x:t.x+u,y:c,width:t.width-u},(0,l.propOr)([],"right",r)),y=s.height+Math.max(p.height,d.height),f=(0,l.pipe)((0,l.prop)("items"),l.length,(0,l.equals)(0));return Cb({},t,{height:y,items:(0,l.reject)(f,[s,p,d])})},p=(e,t)=>{const r=Cb({},t,{items:(0,l.reject)(Gb,t.items)});switch(r.layout){case"scroll":return o(e,r);case"hbox":return s(e,r);case"vbox":return u(e,r);default:return null}},d=(0,l.propEq)("layout","profile",t),y={x:0,y:0,width:r.columns},f=d?c(y,t):p(y,t);return Bb(f)},Jb=(e,t)=>(e||[]).filter((e=>t.some((t=>t.id===e.id)))),Qb=[Mt.FilteredEntitiesViewFacet,Mt.ActivitiesViewFacet,Mt.ProfileStatsFacet,Mt.FilteredSavedSearchesFacet],Kb=(e,t)=>e.map((e=>{let{height:r=0,minHeight:n=0}=e,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["height","minHeight"]);const a=t.find((e=>e.id===i.id)),o=Qb.includes(a.component)?8:4;return Cb({},i,{height:Math.max(r,o),minHeight:Math.max(n,o)})}));function Xb(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){zb(e,t,r[t])}))}return e}function zb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zb={BarChart:Ft.BAR,BarChartGrouped:Ft.BAR,BarChartHorizontal:Ft.BAR,LineChart:Ft.LINE,Map:Ft.MAP,Pie:Ft.PIE},eO=(e,t)=>at(e)?tt(e,t):e,tO=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=Zb[r];return Xb({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},rO=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return Xb({findPublic:r},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(t,["findShared"]))},nO=(e,t,r)=>{const n=(e=>e&&ie(e).map((e=>{const{type:t,value:r}=e;return Xb({},e,{value:[gn,_n,bn.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:Nn(t),fieldName:r,values:n?ie(n):void 0}})))(e);return t&&at(t)||!r?n:(n||[]).concat((i=r,{filter:bn.EQUALS,fieldName:"type",values:[i]}));var i},iO=["https://reltio-ui-files.s3.amazonaws.com/map_resources/new_dashboard/world.countries.json","https://reltio-ui-files.s3.amazonaws.com/map_resources/new_dashboard/usa_prefix_latlng.topo.json","https://reltio-ui-files.s3.amazonaws.com/map_resources/new_dashboard/us-10m.json","https://reltio-ui-files.s3.amazonaws.com/map_resources/new_dashboard/zips-us-topo.json"],aO={"com.reltio.plugins.dashboard.BarChartView":e=>{let{id:t,entity:r,attribute:n,caption:i,filter:a,count:o,orderType:s,canRead:l}=e;return{id:t,count:o,canRead:l,orderType:s,attributeUri:eO(n,r),filters:nO(a,n,r),chartType:Ft.BAR,component:Mt.DashboardFacet,title:i}},"com.reltio.plugins.dashboard.BubbleChartView":e=>{let{id:t,entity:r,attribute:n,caption:i,filter:a,count:o,orderType:s,canRead:l}=e;return{id:t,count:o,canRead:l,orderType:s,attributeUri:eO(n,r),filters:nO(a,n,r),chartType:Ft.BUBBLE,component:Mt.DashboardFacet,title:i}},"com.reltio.plugins.ui.CustomActionView":e=>{let{id:t,caption:r,canRead:n,url:i}=e;return{id:t,url:i,canRead:n,title:r,component:Mt.CustomActionViewFacet}},"com.reltio.plugins.dashboard.FacetChartView":e=>{let{id:t,firstDimension:r,useEntityType:n,caption:i,filter:a,count:o,orderType:s,options:l,canRead:u}=e;const c=ie(a).find((e=>"type"===(null==e?void 0:e.attribute))),p=n||(null==c?void 0:c.value);return Xb({id:t,count:o,canRead:u,orderType:s,attributeUri:eO(r,p),filters:nO(a,r,p),component:Mt.DashboardFacet,title:i,showOthers:!0},tO(l))},"com.reltio.plugins.dashboard.MapView":e=>{let{id:t,entity:r,attribute:n,caption:i,filter:a,count:o,orderType:s,mapType:l,canRead:u}=e;return{id:t,count:o,canRead:u,orderType:s,attributeUri:eO(n,r),filters:nO(a,n,r),chartType:Ft.MAP,component:Mt.DashboardFacet,title:i,geoUrl:iO[l||0],projection:"geoMercator"}},"com.reltio.plugins.dashboard.SimpleMapView":e=>{let{id:t,entity:r,attribute:n,caption:i,filter:a,count:o,map:s,canRead:l,options:u}=e;return Xb({id:t,count:o,canRead:l,attributeUri:eO(n,r),filters:nO(a,n,r),component:Mt.DashboardFacet,title:i,geoUrl:s,chartType:Ft.MAP,projection:"geoMercator"},tO(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Mt.ProfileStatsFacet,title:n}},"com.reltio.plugins.dashboard.FilteredSavedSearchesView":e=>{let{id:t,caption:r,max:n,options:i,canRead:a}=e;return{id:t,canRead:a,options:rO(i),component:Mt.FilteredSavedSearchesFacet,title:r,max:n}},"com.reltio.plugins.dashboard.FilteredEntitiesView":e=>{let{id:t,caption:r,filter:n,max:i,entity:a,canRead:o}=e;return{id:t,canRead:o,filters:nO(n,null,a),component:Mt.FilteredEntitiesViewFacet,title:r,max:i}},"com.reltio.plugins.dashboard.MatchedEntitiesView":e=>{let{id:t,caption:r,max:n,canRead:i}=e;return{id:t,canRead:i,filters:[{filter:bn.GTE,fieldName:"matches",values:["1"]}],component:Mt.FilteredEntitiesViewFacet,title:r,max:n}},"com.reltio.plugins.dashboard.EntitiesByTypeView":e=>{let{id:t,caption:r,orderType:n="reversedCount",inheritChildren:i,hideEmpty:a,canRead:o}=e;return{id:t,canRead:o,component:Mt.EntitiesByTypeViewFacet,orderType:n,inheritChildren:i,hideEmpty:a,title:r}},"com.reltio.plugins.dashboard.EntitiesByTagView":e=>{let{id:t,caption:r,orderType:n,canRead:i}=e;return{id:t,canRead:i,orderType:n,title:r,chartType:Ft.CLOUD,component:Mt.DashboardFacet,attributeUri:"tags"}},"com.reltio.plugins.dashboard.EntitiesByRoleView":e=>{let{id:t,caption:r,orderType:n,canRead:i}=e;return{id:t,canRead:i,orderType:n,title:r,chartType:Ft.TREE,component:Mt.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Mt.NotificationInboxFacet,title:n||ye().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Mt.ActivitiesViewFacet,title:n||ye().text("Activity log")}}},oO=e=>({id:e,height:10}),sO=(0,l.pipe)((0,l.map)((e=>{const t=aO[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),lO=e=>{if("0.1"===e.version){const t=sO(e.views),r=Hb(oO,e.layout,{columns:4});return{id:e.id,margin:0,layout:Jb(r,t),views:t}}return e},uO=e=>(0,l.cond)([[(0,l.propEq)("layout","profile"),(0,l.pipe)((0,l.pick)(["center","right","top"]),l.values,l.flatten,(0,l.map)((0,l.when)((0,l.is)(Object),l.values)),l.flatten)],[(0,l.has)("view"),(0,l.pipe)((0,l.prop)("view"),ie)],[(0,l.prop)("items"),(0,l.pipe)((0,l.prop)("items"),(0,l.map)((e=>uO(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);function cO(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){pO(e,t,r[t])}))}return e}function pO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const dO=cO({},xt,{OldMap:"com.reltio.plugins.entity.EntityMapView",OldTree:"com.reltio.plugins.entity.TreeView"}),yO=e=>e,fO={[dO.Attributes]:yO,[dO.HierarchyTree]:yO,[dO.HierarchyPaths]:yO,[dO.RelationsTable]:yO,[dO.Relations]:e=>cO({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[dO.SingleAttribute]:yO,[dO.Custom]:yO,[dO.AttributeTable]:yO,[dO.Map]:yO,[dO.OldTree]:e=>cO({},e,{class:xt.HierarchyTree}),[dO.OldMap]:e=>cO({},e,{class:xt.Map}),[dO.ImageAttribute]:yO,[dO.PotentialMatches]:yO},TO=(0,l.pipe)((0,l.map)((e=>{const t=fO[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),EO=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.defaultTo)([]),(0,l.find)((0,l.propEq)("id",t)),(0,l.prop)("class"))(e)===xt.Map?{id:t,height:5,minHeight:5}:{id:t,autosizing:!0})),mO=(e,t)=>(t||[]).map((t=>cO({},t,EO(e,t.id)))),hO=e=>{const t=(0,l.pick)(["id","workflow","maxWidth","sidePanelViews","profileBand","views"],e);if("2.0"===e.version)return cO({},t,{layout:mO(t.views,e.newLayout)});if("0.1"===e.version){const r=TO(e.views),n=Hb(EO(r),e.layout,{columns:3});return cO({},t,{layout:Jb(n,r),views:r})}return e},bO=(e,t)=>e.class===t||e["react-class"]===t,OO=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(bO(t,xt.Attributes))if(t.includeUris)e.includeUris.push(...t.includeUris);else{const r=t.excludeUris||[];e.excludeUris=e.excludeUris?(0,l.intersection)(e.excludeUris,r):r}return bO(t,xt.SingleAttribute)&&e.includeUris.push(t.attributeUri),e}),{includeUris:[],excludeUris:null}))(e),n=e=>{let{uri:n}=e;return r&&!r.some(Xe(n))||t.some(Xe(n))};return(e,t)=>(!t||n(t))&&n(e)},vO=(e,t)=>e.filter((e=>t.some((t=>bO(e,t))))).map((e=>{let{id:t}=e;return t})),gO=(e,t)=>{let{extensions:r}=e;return(r||[]).find((e=>e.id===t))},_O=(e,t)=>e.flatMap((e=>{let{extensions:r=[]}=e;return r.filter((e=>{let{point:r}=e;return r===t}))})),AO=e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.plugins.entity.ProfileBand"))),(0,l.reject)(l.isNil),l.head)(e);function NO(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){PO(e,t,r[t])}))}return e}function PO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const RO=(0,l.curry)(((e,t)=>uO(t).map((t=>(0,l.pipe)((0,l.map)((e=>gO(e,t))),(0,l.reject)(l.isNil),l.head)(e))).filter(l.identity))),SO=(0,l.either)((0,l.propEq)("label","D&B Connector"),(0,l.propEq)("label","D&B Connector")),wO=(0,l.propEq)("class",xt.Custom),IO=e=>{let{extensions:t=[]}=e;return t.filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]))},UO=(e,t)=>{const r=(0,l.propOr)("0.1","version",t),n=t["entity-type"];let i;if("2.0"===r&&t.newLayout){const{newLayout:r}=t,a=mO(t.views,r);return i=(0,l.when)((0,l.pipe)(l.head,(0,l.is)(String)),(0,l.pipe)((0,l.map)((t=>(0,l.pipe)((0,l.map)((e=>gO(e,t))),(0,l.reject)(l.isNil),l.head)(e))),(0,l.reject)(l.isNil),(e=>[{id:"common",views:e}])))(t.sidePanelViews),(0,l.pipe)((0,l.pick)(["views","profileBand","workflow"]),(0,l.mergeRight)({entityType:n,layout:a,sidePanelViews:i}),(0,l.reject)(l.isNil))(t)}const a=RO(e,t.layout);i=((e,t)=>{if(t.side){var r;const n=(0,l.pipe)((0,l.chain)((e=>gO(e,t.side))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("layout"))(e),[i,a]=(0,l.partition)(SO,null!==(r=null==n?void 0:n.items)&&void 0!==r?r:[]),o=(0,l.pipe)(RO(e),(0,l.filter)(wO))(NO({},n,{items:i})),s=[{id:"common",views:RO(e,NO({},n,{items:a}))}];return o.length>0&&s.push({id:"D&B",views:o}),s}})(e,t);const o=(e=>(0,l.pipe)((0,l.chain)((e=>((e,t)=>{let{extensions:r}=e;return(r||[]).filter((e=>"com.reltio.plugins.entity.side.WorkflowsView"===e.class))})(e))),l.head,(0,l.unless)(l.isNil,(0,l.pick)(["showClosedTasks","assignee","processTypes"])))(e))(e),s=hO(NO({},t,{views:a,version:"0.1"})),u=(0,l.pipe)(AO,(0,l.defaultTo)({}),(0,l.pick)(["cloneAction","showEntityId"]))(e);return(0,l.reject)(l.isNil,{entityType:n,views:s.views,layout:s.layout,sidePanelViews:i,profileBand:u,workflow:o})},CO=(e,t)=>{if("scroll"===t.layout.layout){const r=RO(e,t.layout),n=lO(NO({},t,{views:r,version:"0.1"}));return{class:Vt.Dashboard,id:t.id,views:n.views,layout:n.layout}}return{class:Vt.Dashboard,views:t.views,layout:t.layout,id:t.id}},DO=(e,t)=>{const r=RO(e,t.layout)[0];return{class:Vt.DQDashboard,id:t.id,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel,showTimeSeries:r.showTimeSeries}},LO=(e,t)=>{const r=RO(e,t.layout)[0];return{class:Vt.RelationshipSearch,id:t.id,options:r.options,consoleExportApp:r.consoleExportApp}},jO=(e,t)=>{const r=RO(e,t.layout)[0];return{class:Vt.Interactions,id:t.id,sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},kO=(e,t)=>{const r=RO(e,t.layout)[0];return{class:Vt.Relationships,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},FO=(e,t)=>{const r=RO(e,t.layout)[0];return{class:Vt.Sources,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},MO=(e,t)=>{const r=RO(e,t.layout)[0];return{class:Vt.PotentialMatches,id:t.id,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},xO=(e,t)=>{const r=RO(e,t.layout)[0],n=r.potentialMatchesReview||{processType:(e=>{const[t]=_O(e,"com.reltio.plugins.search.toolbar.component").filter((e=>"com.reltio.plugins.ui.CustomActionButtonView"===e.class&&e.processType));return null==t?void 0:t.processType})(e)};return{class:Vt.Search,id:t.id,consoleExportApp:r.consoleExportApp,mapSearchEnabled:r.mapSearchEnabled,canRead:r.canRead,"bulk-update":r["bulk-update"],potentialMatchesReview:n,options:r.options,"entity-types":r["entity-types"],tabs:r.tabs}},$O=(e,t)=>({class:Vt.Graph,id:t.id}),VO=(e,t)=>{const r=RO(e,t.layout)[0];return{class:Vt.ProfileActivityLog,id:t.id,exportTypes:r.exportTypes,caption:r.caption}},GO=e=>t=>!!(0,l.intersection)(e,t).length,WO=(0,l.cond)([[GO(["com.reltio.plugins.dashboard.BarChartView","com.reltio.plugins.dashboard.BubbleChartView","com.reltio.plugins.ui.CustomActionView","com.reltio.plugins.dashboard.FacetChartView","com.reltio.plugins.dashboard.MapView","com.reltio.plugins.dashboard.SimpleMapView","com.reltio.plugins.dashboard.ProfileStatsView","com.reltio.plugins.dashboard.FilteredSavedSearchesView","com.reltio.plugins.dashboard.FilteredEntitiesView","com.reltio.plugins.dashboard.EntitiesByTypeView","com.reltio.plugins.dashboard.EntitiesByTagView","com.reltio.plugins.dashboard.EntitiesByRoleView","com.reltio.plugins.inbox.NotificationInboxView","com.reltio.plugins.activities.ActivitiesView","com.reltio.plugins.react.ReactDashboardView"]),()=>CO],[GO(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>DO],[GO(["com.reltio.plugins.graph.GraphView"]),()=>$O],[GO(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>LO],[GO(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>jO],[GO(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>kO],[GO(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>FO],[GO(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>MO],[GO(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>xO],[GO(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>VO],[l.T,()=>(0,l.always)(void 0)]]),BO=(e,t)=>{const{class:r}=e;if("com.reltio.plugins.entity.ProfileAction"===r)return((e,t)=>{const r=(0,l.pipe)((0,l.chain)(IO),(0,l.map)((t=>UO(e,t))),(0,l.indexBy)((0,l.prop)("entityType")),(0,l.map)((0,l.pick)(["layout","views","sidePanelViews","profileBand","workflow"])))(e);return{class:Vt.Profile,id:t.id,entityTypes:r}})(t,e);if("com.reltio.plugins.ui.actions.CustomAction"===r)return{id:e.id,type:Gt.CustomAction,config:(0,l.omit)(["class","id","point","parent","type"],e)};if("com.reltio.plugins.ui.actions.ConsoleAppAction"===r)return{id:e.id,type:Gt.ConsoleAppAction,config:(0,l.omit)(["class","id","point","parent","type"],e)};const n=(e=>{if(e.perspective)return e.perspective})(e);if((0,l.isNil)(n))return;if("com.reltio.plugins.dashboard.DashboardPerspective"===n||"com.reltio.plugins.newDashboard.NewDashboardPerspective"===n){const e=(0,l.find)((0,l.propEq)("id","com.reltio.plugins.newDashboard"))(t);if(e)return(0,l.pipe)((e=>gO(e,"com.reltio.plugins.newDashboard.NewDashboardView")),(0,l.pick)(["id","views","layout"]),(0,l.assoc)("class",Vt.Dashboard))(e)}const i=(0,l.pipe)((0,l.map)((e=>gO(e,n))),(0,l.reject)(l.isNil),l.head)(t);if((0,l.isNil)(i))return;if(i.entityPerspectiveId)return((e,t,r)=>{const n=UO(e,r),i=(0,l.pipe)((0,l.propOr)([],"entity-types"),(0,l.map)((e=>[e,n])),l.fromPairs)(t);return{class:Vt.NestedProfile,id:t.id,entityTypes:i}})(t,e,i);const a=uO(i.layout),o=(0,l.pipe)((0,l.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>a.includes(e.id)))})),(0,l.pluck)("class"),(0,l.reject)(l.isNil))(t);return WO(o)(t,i)};function YO(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){qO(e,t,r[t])}))}return e}function qO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const HO=e=>{let{extensions:t}=e;return(t||[]).filter((e=>"com.reltio.plugins.ui.action"===e.point&&"com.reltio.plugins.ui.first_level_action"===e.type&&!e.parent))},JO="https://reltio-ui-files.s3.amazonaws.com/new-ui/";var QO;!function(e){e[e.DashboardGroup=0]="DashboardGroup",e[e.ProfileGroup=1]="ProfileGroup",e[e.SearchGroup=2]="SearchGroup"}(QO||(QO={}));const KO={[Vt.DQDashboard]:`${JO}DqDashboard.svg`,[Vt.Dashboard]:`${JO}Dashboard.svg`,[Vt.Graph]:`${JO}Graph.svg`,[Vt.RelationshipSearch]:`${JO}GraphSearch.svg`,[Vt.Interactions]:`${JO}Interactions.svg`,[Vt.PotentialMatches]:`${JO}PotentialMatches.svg`,[Vt.Profile]:`${JO}Profile.svg`,[Vt.NestedProfile]:`${JO}Profile.svg`,[Vt.ProfileActivityLog]:`${JO}ActivityLog.svg`,[Vt.Relationships]:`${JO}Relationships.svg`,[Vt.Sources]:`${JO}Crosswalk.svg`,[Vt.Search]:`${JO}Search.svg`,[QO.DashboardGroup]:`${JO}DashboardGroup.svg`,[QO.ProfileGroup]:`${JO}ProfileGroup.svg`,[QO.SearchGroup]:`${JO}SearchGroup.svg`,DEFAULT:`${JO}Default.svg`},XO=e=>KO[null==e?void 0:e.class]||KO.DEFAULT,zO=(0,l.pipe)((0,l.pluck)("screen"),(0,l.filter)((0,l.anyPass)([(0,l.propEq)("class",Vt.NestedProfile)])),(0,l.groupBy)((0,l.prop)("class")),(0,l.map)((e=>e.map(((e,t)=>YO({},e,{nestedRoute:`${t+1}`})))))),ZO=(e,t)=>{var r;return(null===(r=e[t.class])||void 0===r?void 0:r.find((0,l.propEq)("id",t.id)))||t},ev=e=>"com.reltio.plugins.entity.ProfileFirstAction"===e.class?KO[QO.ProfileGroup]:null,tv=e=>(0,l.cond)([[(0,l.any)((e=>{let{icon:t}=e;return t===KO[Vt.Dashboard]||t===KO[Vt.DQDashboard]})),(0,l.always)(KO[QO.DashboardGroup])],[(0,l.any)((e=>{let{icon:t}=e;return t===KO[Vt.Search]||t===KO[Vt.RelationshipSearch]})),(0,l.always)(KO[QO.SearchGroup])],[l.T,()=>null]])(e),rv=e=>(0,l.pipe)((0,l.chain)(HO),(0,l.sortBy)((0,l.propOr)(1/0,"position")))(e).map((t=>{const r=((e,t)=>{const r=(0,l.pipe)((0,l.chain)((t=>((e,t)=>{let{extensions:r}=e;return(r||[]).filter((e=>"com.reltio.plugins.ui.action"===e.point&&e.parent===t))})(t,e.id))),(0,l.sortBy)((0,l.propOr)(1/0,"position")),(0,l.map)((e=>YO({},e,{entityTypes:e["entity-types"],screen:BO(e,t)}))),(0,l.filter)((e=>e.screen)))(t),n=zO(r);return(0,l.map)((e=>{let{label:t,screen:r,canRead:i,entityTypes:a}=e;return{label:t,icon:XO(r),screen:ZO(n,r),canRead:i,entityTypes:a}}))(r)})(t,e),n=BO(t,e);return{label:t.label,icon:ev(t)||tv(r)||XO(n),menu:r.length?{type:"side",items:r}:void 0,screen:n,canRead:t.canRead}}));function nv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const iv=e=>{let{extensions:t}=e;return(t||[]).filter((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},av=e=>({id:e,height:10}),ov=e=>{const t=(e=>(0,l.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["attribute-types"]))}))(e))(e),r=(e=>(0,l.pipe)((0,l.chain)(iv),(0,l.pluck)("pivotingAttributes"),l.flatten)(e))(e);return((e,t)=>{const r=(e=>(e||[]).find((0,l.propEq)("attribute-types","*")))(t);return(0,l.pipe)((0,l.reduce)(((e,n)=>{const i=((e,t)=>e.find((e=>Array.isArray(e["attribute-types"])&&e["attribute-types"].includes(t.uri))))(t,n)||r;return null!=i&&i.id&&(e[i.id]||(e[i.id]={extension:i,attributeTypes:[]}),e[i.id].attributeTypes.push(n)),e}),{}),l.values)(e)})(r,t).map((t=>{let{extension:r,attributeTypes:n}=t;const i=((e,t)=>{if("scroll"===t.layout.layout){const r=sO(((e,t)=>{const r=uO(t);return(0,l.pipe)((0,l.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>r.includes(e.id)))})),(0,l.filter)((e=>{let{views:t}=e;return t})),(0,l.map)((e=>{let{views:t,id:r}=e;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){nv(e,t,r[t])}))}return e}({id:r},t[0])})),(0,l.uniqBy)((0,l.prop)("id")))(e)})(e,t.layout)),n=Hb(av,t.layout,{columns:4});return{views:r,layout:Jb(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))};function sv(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){lv(e,t,r[t])}))}return e}function lv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uv(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}const cv=(0,l.curry)(((e,t)=>(0,l.pipe)((e=>((e,t)=>(e||[]).find((e=>"com.reltio.plugins.ui.Activator"===e.activator)))(e)),(0,l.prop)(e))(t))),pv=e=>"com.reltio.plugins.dashboard.DashboardPerspective"===e,dv=(0,l.unless)((e=>!!e&&(e.startsWith("http:")||e.startsWith("https:"))),(0,l.always)(null)),yv=(0,l.pipe)(cv("top-logo"),dv),fv=(0,l.prop)("showLookupCode"),Tv=e=>{var t;const r=(e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.plugins.entity.EntityRequestSettings"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("defaultMaxValues"))(e))(e),n=(e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.plugins.imageattribute.fieldsorder"))),(0,l.reject)(l.isNil),l.head,(0,l.omit)(["point","id"]))(e))(e),i=(e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.plugins.ui.LookupAutocomplete"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}),(0,l.pick)(["includeAttributes","excludeAttributes"]))(e))(e),a=(e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.plugins.entity.ValidationServiceLevels"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("levels"))(e))(e),o=(e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.plugins.entity.Validation"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("validateReadMode"))(e))(e),s=(e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.plugins.ui.LocalizationServer"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"))(e))(e),u=(e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.plugins.ui.AttributePresentation"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"),(0,l.defaultTo)({}),(0,l.filter)((0,l.propSatisfies)((0,l.either)(ce,(0,l.equals)("none")),"format")),(0,l.map)((e=>{let{format:t}=e;if("none"===t)return{thousandSeparator:""};const{groupSeparator:r,digitsAfterDecimalSeparator:n}=t;return sv({thousandSeparator:r,decimalScale:n},uv(t,["groupSeparator","digitsAfterDecimalSeparator"]))})))(e))(e),c=(e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.plugins.workflow.configuration"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}),(e=>{let{workflowPath:t,enabled:r}=e;return{enabled:r,path:t}}))(e))(e),p=(e=>(0,l.pipe)(cv("default-perspective"),(0,l.ifElse)(pv,(0,l.always)("dashboard"),(0,l.always)("search")))(e))(e),d=(e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.plugins.ui.AttributesSorting"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("strategy"))(e))(e),y=(e=>(0,l.pipe)((e=>_O(e,"com.reltio.plugins.ui.custom_script")),(0,l.reject)(E),(0,l.map)((e=>{let{action:t}=e;return sv({},t,uv(e,["action"]))})))(e))(e),f=(e=>cv("checkUser",e))(e),T=(e=>cv("checkIdle",e))(e),m=(e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.plugins.ui.configuration.FeatureManagement"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("preferNewUI"),l.not)(e))(e),h=(e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.plugins.ui.LookupCodeVisibility"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}))(e))(e),b=void 0===(O=fv(h))||O;var O;const v=null===(t=AO(e))||void 0===t?void 0:t.showEntityId,g=(e=>cv("preview",e))(e),_=yv(e),A=(e=>cv("showAttributeDescription",e))(e),N=(e=>cv("topBackgroundColor",e))(e),P=(e=>(0,l.pipe)((0,l.map)((e=>gO(e,"com.reltio.framework.util.DateMask"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"),(0,l.defaultTo)({}),(e=>{let{dateMask:t,dateTimeMask:r}=e;return{dateMask:t,dateTimeMask:r}}),(0,l.reject)(l.isNil))(e))(e);return{i18n:s,entity:{requestSettings:{defaultMaxValues:r}},image:{attributeFieldsOrder:n},lookups:{autocomplete:i,showCode:b},validate:{levels:a,validateReadMode:o},masks:0===Object.keys(P).length?void 0:P,attributePresentations:u,attributesSorting:d,workflow:c,defaultRoute:p,customScripts:y,checkUser:f,checkIdle:T,showSwitchToClassic:m,showEntityId:v,preview:g,logo:_,showAttributeDescription:A,headerColor:N}},Ev=e=>({layout:rv(e),pivoting:ov(e),properties:Tv(e)});function mv(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){hv(e,t,r[t])}))}return e}function hv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bv=e=>{let{views:t,layout:r}=e;const n={};let i=!1;const a=t.map((e=>{if(n[e.id]){const t=`${e.id}_${(0,De.x0)()}`;return n[e.id].push(t),i=!0,mv({},e,{id:t})}return n[e.id]=[e.id],e})),o={},s=r&&i?r.map((e=>null==o[e.id]?(o[e.id]=0,e):(o[e.id]++,mv({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}};function Ov(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){vv(e,t,r[t])}))}return e}function vv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let gv={};const _v=(e,t,r)=>{const n=`\n importScripts("${e}");\n importScripts("${r.action.files.join('","')}");\n postMessage({action:'loaded'});`;let i;const a=z(`${r.id}: ${r.action.files.join('","')}`);if(E(gv[a])){try{const e=window.webkitURL||window.URL;i=new Worker(e.createObjectURL(new Blob([n],{type:"application/javascript"})))}catch(e){i=new Worker("data:application/javascript,"+encodeURIComponent(n))}gv=Ov({},gv,{[a]:Ov({},gv[a]||{},{worker:i})})}else i=gv[a].worker,gv[a].innerText&&t({task:{action:qt.SET_HTML,params:{html:gv[a].innerText}},worker:i,config:r}),i.removeEventListener("message",gv[a].onWorkerMessage);return i&&(gv[a].onWorkerMessage=e=>{if("loaded"!==e.data.action){const n=JSON.parse(e.data);t({task:n,worker:i,config:r}),"setHtml"!==n.action||n.params.id||(gv[a].innerText=n.params.html)}},i.addEventListener("message",gv[a].onWorkerMessage)),i},Av=(0,l.curry)(((e,t)=>!e||!e.availableEntityTypes||!t||e.availableEntityTypes.includes(t))),Nv=(0,l.flip)(Av);var Pv=r(83926);const Rv=(e,t)=>{const{thousandSeparator:r="",decimalSeparator:n=".",prefix:i="",suffix:a="",groupSize:o=3,decimalScale:s}=e,l=null!=s?new Pv.Decimal(t).toFixed(s):t,[u,c]=l.split("."),p=new RegExp(`\\B(?=(\\d{${o}})+(?!\\d))`,"g"),d=u.replace(p,r),y=null==c?void 0:c.replace(/(0|\.)+$/,"");return i+d+(y?n+y:"")+a};let Sv;const wv=()=>Sv,Iv={setLocale:e=>{Sv=e},getLocale:wv,number:e=>((e,t)=>{const r=String(t);try{const t=(e=>{var t;e=null===(t=e)||void 0===t?void 0:t.replace(/_/g,"-");const r=new Intl.NumberFormat(e).formatToParts(1000000.1),n=e=>{var t;return null===(t=r.find((t=>{let{type:r}=t;return r===e})))||void 0===t?void 0:t.value};return{thousandSeparator:n("group"),decimalSeparator:n("decimal"),groupSize:((null===(i=r.filter((e=>{let{type:t}=e;return"integer"===t})).map((e=>{let{value:t}=e;return t})).sort(((e,t)=>t.length-e.length)))||void 0===i?void 0:i[0])||"000").length};var i})(e);return Rv(t,r)}catch(e){return console.warn("Number localization error"),r}})(wv(),e),applyFormatToNumber:Rv},Uv=(0,l.curry)(((e,t)=>null==t?"":("string"!=typeof t&&(t=String(t)),e&&t?Iv.applyFormatToNumber(e,t):(!e&&t&&(t=Iv.number(t)),t)))),Cv=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?ye().number(e,"0,0.0a").toUpperCase():ye().number(e,"0,0"):""},Dv=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last));let Lv=!0;const jv=e=>Lv=e,kv=(e,t)=>e!==t&&t?Lv&&e?`${t} (${e})`:t:e,Fv=(e,t,r)=>(0,l.path)([t,r,"displayName"],e),Mv=(e,t,r)=>{const n=Fv(e,t,r);return kv(r,n)},xv=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),$v=(0,l.complement)(xv),Vv=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),Gv=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,l.pipe)((0,l.reduce)(((e,t)=>t.reduce(((e,t)=>{let{type:r,codeValues:n}=t;return e[r]={type:r,codeValues:(0,l.uniq)([...(0,l.pathOr)([],[r,"codeValues"],e),...n])},e}),e)),{}),l.values)(t)},Wv=(0,l.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter($v(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),Bv=(0,l.curry)(((e,t)=>{let{attributePresentations:r={},dataTypeDefinition:n={},dateMask:i,dateTimeMask:a}=e;const o=r[n.uri]||r[Dn],s=i?q(i):"L",u=a?Q(a):"L LTS";switch(n.type){case zt.TYPE_NUMBER:case zt.TYPE_FLOAT:case zt.TYPE_DOUBLE:case zt.TYPE_LONG:case zt.TYPE_INT:case zt.TYPE_COUNT:return t&&Uv(o,t);case zt.TYPE_BOOLEAN:case zt.TYPE_BOOLEAN_RADIO:case zt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t=t,(0,l.isNil)(t)?t:ue(t)?ye().text("Yes"):ye().text("No");case zt.TYPE_DATE:return(0,l.is)(Number,t)&&(t=A(Number(t)).getTime()),(t=t)&&(ic(t)?ac(t):ye().date(t,s));case zt.TYPE_ACTIVENESS_DATE:case zt.TYPE_LOCAL_DATE:return(t=t)&&(ic(t)?ac(t):ye().date(t,s));case zt.TYPE_TIMESTAMP:return(t=t)&&(ic(t)?ac(t):ye().date(isNaN(t)?t:Number(t),u));case zt.TYPE_FILE:return(0,l.propOr)(null,"filename",t);case zt.TYPE_SELECT:{const e=n.options.find((0,l.propEq)("value",t));return(0,l.propOr)(null,"label",e)}case zt.TYPE_DOLLAR:return t=t,new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0}).format(t);default:return(0,l.is)(Object,t)?kv((0,l.propOr)(null,"lookupCode",t),(0,l.propOr)(null,"value",t)):t}})),Yv={palette:{primary:{main:"#0072CE",light:"#0072CE",dark:"#0072CE"},secondary:{main:"#0072CE"},error:{main:"#FF1744"},background:{paper:"#FFF",default:"#FAFAFA"},action:{hover:"rgba(0,0,0,0.04)",hoverOpacity:.04},text:{primary:"rgba(0,0,0,0.87)",secondary:"rgba(0,0,0,0.54)",disabled:"rgba(0,0,0,0.26)"},divider:"rgba(0,0,0,0.38)"},overrides:{MuiFilledInput:{root:{backgroundColor:"rgba(0, 0, 0, 0.03)","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"},"&.focused":{backgroundColor:"rgba(0, 0, 0, 0.03)"}}},MuiInputBase:{input:{"&::placeholder":{color:"currentColor !important"},"&::-ms-clear":{display:"none"}}}},tooltip:{borderRadius:"4px",backgroundColor:"rgba(0,0,0,0.54)"},inactiveBackground:"repeating-linear-gradient(45deg, #f5f5f5, #f5f5f5 14px, #e9e9e9 15px, #e9e9e9 16px)",inactiveSelectedBackground:"repeating-linear-gradient(45deg, #DBE9F4, #DBE9F4 14px, #CCDAE5 15px, #CCDAE5 16px)",inactiveSelectedHoverBackground:"repeating-linear-gradient(45deg, #D4E2ED, #D4E2ED 14px, #C6D4DF 15px, #C6D4DF 16px)",inactiveHoverBackground:"repeating-linear-gradient(45deg, #f2f2f2, #f2f2f2 14px, #e2e2e2 15px, #e2e2e2 16px)",transitions:{duration:{shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195}},inactive:{opacity:.7},basicView:{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)",borderRadius:"3px",backgroundColor:"#FFFFFF"},suggested:"rgb(237, 246, 251)"};function qv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Hv=e=>(t,r)=>{const{timeout:n}=r,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(r,["timeout"]);if(AbortController&&n){const r=new AbortController,a=setTimeout((()=>r.abort()),n);return e(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){qv(e,t,r[t])}))}return e}({},i,{signal:r.signal})).finally((()=>{clearTimeout(a)}))}return e(t,i)},Jv=e=>{const t=e=>{switch(e){case 429:case 502:case 503:case 504:return 4;default:return 0}},r=e=>{const t=Math.random()+1;return new Promise((r=>{const n=Math.min(Math.round(1e3*Math.exp(e)*t),2e4);setTimeout(r,n)}))};return(n,i)=>{const a=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e(n,i).then((e=>{const n=t(e.status);return n>0&&o<n?r(o).then((()=>a(o+1))):e}))};return a()}},Qv=e=>(t,r)=>e(t,r).then((e=>e.ok?e:e.text().then((t=>{let r;try{r=JSON.parse(t)}catch(n){r={errorMessage:t,errorCode:e.status,originalResponse:e}}throw r})))),Kv=e=>{const{onRequest:t,onResponse:r,addRequestInterceptor:n,addResponseInterceptor:i,removeRequestInterceptor:a,removeResponseInterceptor:o}=(()=>{const e={onRequest:[],onResponse:[]};return{onRequest:t=>{const{url:r,options:n,abort:i,resolve:a}=t,o=e.onRequest.reduce(((e,t)=>(r,n)=>t({url:r,options:n,abort:i,next:e,resolve:a})),t.next);o(r,n)},onResponse:t=>{const{response:r,abort:n,url:i,options:a}=t,o=e.onResponse.reduce(((e,t)=>r=>r instanceof Response?t({response:r,abort:n,next:e,url:i,options:a}):e(r)),t.next);o(r)},addRequestInterceptor:t=>{e.onRequest.push(t)},addResponseInterceptor:t=>{e.onResponse.push(t)},removeRequestInterceptor:t=>{const r=e.onRequest.indexOf(t);e.onRequest.splice(r,1)},removeResponseInterceptor:t=>{const r=e.onResponse.indexOf(t);e.onResponse.splice(r,1)}}})(),s=(0,l.pipe)(Hv,(e=>{let t=null;return r=>(n,i)=>{const a=()=>r(n,i),o=()=>{var e;return null===(e=t)||void 0===e?void 0:e.then(a)};return o()||a().then((r=>401===r.status?(t||(t=e().then((()=>{t=null}))),o()):r))}})(e),Jv,Qv);let u=0,c=[];return{request:(e,n)=>{const i=s(fetch);if(null!=n&&n.noRequestProcessor)return i(e,n);const a=()=>{const a=r?(e,t)=>i(e,t).then((n=>new Promise(((i,a)=>{r({response:n,next:e=>{i(e)},abort:a,url:e,options:t})})))):i;return t?new Promise(((r,i)=>{t({url:e,options:n,next:(e,t)=>{r(a(e,t))},resolve:e=>{r(e)},abort:i})})):a(e,n)};if(u){const{delayedRequest:e,resolver:t}=(e=>{let t;const r=new Promise((e=>{t=()=>{e(null)}})).then((()=>e()));return{delayedRequest:r,resolver:t}})(a);return c.push(t),e}return a()},addRequestInterceptor:n,addResponseInterceptor:i,startInterceptorInit:()=>{u+=1},finishInterceptorInit:()=>{u=Math.max(u-1,0),0===u&&(c.forEach((e=>e())),c=[])},removeRequestInterceptor:a,removeResponseInterceptor:o}},Xv="__metadata",zv=(e=>{const t=[Xv,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),Zv=(0,l.set)(zv),eg=(0,l.view)(zv),tg=Zv(In.NEW),rg=Zv(In.REMOVED),ng=Zv(In.EDITED),ig=Zv(In.IGNORED),ag=(0,l.pipe)(eg,(0,l.equals)(In.REMOVED)),og=(0,l.pipe)(eg,(0,l.equals)(In.NEW)),sg=(0,l.pipe)(eg,(0,l.equals)(In.EDITED)),lg=(0,l.pipe)(eg,(0,l.complement)(l.isNil)),ug=(0,l.pipe)(eg,(0,l.equals)(In.IGNORED)),cg=(0,l.omit)([Xv]),pg=(e,t)=>e===Xv?void 0:t;function dg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yg=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(e(t))return r.concat(t);if(t&&t.children)for(const n of t.children){const i=yg(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},fg=(e,t)=>yg((0,l.propEq)("nodeId",t),e),Tg=(e,t)=>yg((0,l.pathEq)(["entity","uri"],t),e),Eg=(e,t)=>{const r=fg(e,t);return r.length>1?r[r.length-2]:null},mg=(e,t)=>{const r=fg(e,t);return r.length>0?r[r.length-1]:null},hg=(e,t)=>{let{parent:r,childrenProcessing:n=(e=>e),nodeProcessing:i=(e=>e)}=t;return(e=i(e,r)).children&&(e.children=n(e.children.map((t=>hg(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},bg=()=>{},Og=(e,t)=>{let{parent:r,nodeProcessing:n=bg}=t;n(e,r),e.children&&e.children.forEach((t=>Og(t,{parent:e,nodeProcessing:n})))},vg=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case Rt.addingParent:var i,a,o,s;return{entityUri:n?null===(i=r.entity)||void 0===i?void 0:i.uri:null===(a=t.relatedEntity)||void 0===a?void 0:a.uri,relation:r.relation,parentEntityUri:n?null===(o=t.relatedEntity)||void 0===o?void 0:o.uri:null===(s=r.entity)||void 0===s?void 0:s.uri};case Rt.addingChild:var l,u,c,p;return{entityUri:n?null===(l=t.relatedEntity)||void 0===l?void 0:l.uri:null===(u=r.entity)||void 0===u?void 0:u.uri,relation:r.relation,parentEntityUri:n?null===(c=r.entity)||void 0===c?void 0:c.uri:null===(p=t.relatedEntity)||void 0===p?void 0:p.uri};case Rt.editing:{var d,y,f,T;const e={oldRelation:t.relation,newRelation:r.relation,isReversed:n},i=null===(d=r.entity)||void 0===d?void 0:d.uri,a=null===(y=t.relatedEntity)||void 0===y?void 0:y.uri;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){dg(e,t,r[t])}))}return e}({},e,(null===(f=t.entity)||void 0===f?void 0:f.uri)===(null===(T=r.entity)||void 0===T?void 0:T.uri)?{}:{entityUri:i,newEntityUri:a})}}},gg=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[];return Object.values(e).forEach((e=>{const r=e.root;r&&Og(r,{nodeProcessing:r=>{const n=(0,l.path)(["editingConnections",(0,l.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===Rt.addingChild||r.editingMode===Rt.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=vg({node:r,connection:n,isReversed:i}),s=Mp({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===Rt.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=vg({node:r,isReversed:i,connection:n}),l=s?Gp({entityUri:o,newEntityUri:s,relation:a,isReversed:i}):Vp({oldRelation:e,newRelation:a});t.push(l)}}})})),t},_g=(e,t)=>{if((0,l.path)(["entity","uri"],e)===t)return!0;if(e&&e.children)for(const r of e.children){const e=_g(r,t);if(e)return e}return!1},Ag=(0,l.curry)(((e,t)=>{const r=(0,l.map)(Ag(e));return(0,l.evolve)({entity:t=>t.uri===e.uri?e:t,children:r},t)})),Ng=(e,t)=>{const r=(0,l.pipe)(Object.entries,(0,l.filter)((t=>{let[,r]=t;return r.root&&((e,t)=>_g(t,e.uri))(e,r.root)}))),n=(0,l.map)((t=>{let[r,n]=t;return{id:r,root:Ag(e,n.root)}}));return(0,l.pipe)(r,n)(t)},Pg={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},Rg={asc:"asc",desc:"desc"},Sg=Pg.entityLabel,wg=Rg.asc,Ig=(0,l.always)(0),Ug=e=>{let{sortField:t=Sg,sortOrder:r=wg,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case Pg.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,l.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return rP.strings.sort(t,a,o)})(n,r);case Pg.entityLabel:return(e=>(t,r)=>{const n=(0,l.path)(["entity","label"]),i=n(t),a=n(r);return rP.strings.sort(e,i,a)})(r);default:return Ig}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},Cg=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values(Rg)),l.identity,(0,l.always)(wg))),Dg=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(Pg)),l.identity,(0,l.always)(Sg)));var Lg=r(91104);let jg;const kg=(e,t)=>(jg||(jg=Lg.createClient({key:t})),new Promise((t=>{jg.geocode({address:e},((e,r)=>{e&&(console.warn(e),t(null));const{results:n}=r.json,i=(0,l.pathOr)(null,[0,"geometry","location"],n);t(i||null)}))}))),Fg=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,l.is)(Object,t)&&(t=""),t},Mg=(e,t)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(Ss).flatMap((e=>{let r;return e.type==t&&(r=[Fg(e)]),(0,l.is)(Object,e.value)&&(r=(r||[]).concat(Mg(e.value,t))),r})),xg=e=>e&&e.length>0,$g=(e,t)=>[].concat(e&&e.attributes?Mg(e.attributes,t):[]).filter(l.identity);function Vg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Gg=(e,t,r,n,i,a)=>{if(e&&e.type){const t=pn(r,e.type);n&&(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){Vg(e,t,r[t])}))}return e}({},e,{attributes:{[i]:[n]}}));const a=(t.geoLocationAttributes||[]).map((t=>{return r=$g(e,t.latitude),n=$g(e,t.longitude),xg(r)&&xg(n)&&(0,l.zipWith)(((e,t)=>({lat:Number(e),lng:Number(t)})),r,n);var r,n})).filter(l.identity);if(a.length>0)return Promise.resolve(a[0])}const o=t.GeoLocation;if(o){const e=o.map((e=>{const t=e.value.Latitude,r=e.value.Longitude;if(xg(t)&&t[0].value&&xg(r)&&r[0].value)return{id:e.uri,lat:Number(t[0].value),lng:Number(r[0].value)}})).filter(l.identity);if(e.length>0)return Promise.resolve(e)}return n&&n.label?kg(n.label,a).catch((()=>null)):Promise.resolve(null)},Wg=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;const n={},i=(0,l.flatten)(t.map((t=>{return"configuration/entityTypes/Location"===t.type?{id:t.uri,label:t.label,entity:t,pointSource:t.attributes}:(n[t.type]=n[t.type]||((null===(r=pn(e,t.type))||void 0===r?void 0:r.attributes)||[]).filter((e=>"configuration/entityTypes/Location"===e.referencedEntityTypeURI)).map((e=>{let{name:t}=e;return t})),n[t.type].map((e=>[e,t.attributes[e]])).filter((e=>{let[,t]=e;return t})).flatMap((e=>{let[r,n]=e;return n.map((e=>({id:e.uri,label:e.label,entity:t,pointSource:e.value,refAttribute:e,name:r})))})));var r})));return Promise.all(i.map((t=>{let{id:n,label:i,entity:a,pointSource:o,refAttribute:s,name:u}=t;return Gg(a,o,e,s,u,r).then((e=>!e&&a.label&&""!==a.label?kg(a.label,r).catch((()=>null)):e)).then((e=>ie(e).filter(l.identity).map((e=>({id:e.id||n,label:i,entity:a,point:e}))))).catch((()=>null))}))).then((e=>e.flat(1/0).filter(l.identity)))},Bg=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Promise.resolve((0,l.pipe)((0,l.chain)((t=>{const r=pn(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(Ur(e,r.latitude,t.type)&&Ur(e,r.longitude,t.type)){const e=$g(t,r.latitude),n=$g(t,r.longitude),i=(e,r)=>({id:`${t.uri}_nested_${e}_${r}`,entity:t,label:t.label,point:{lat:Number(e),lng:Number(r)}});return(0,l.zipWith)(i,e,n)}}))})),(0,l.filter)(l.identity),(0,l.uniqBy)((0,l.prop)("id")))(t))},Yg=(e,t,r)=>Promise.all([Bg(e,t),Wg(e,t,r)]).then((e=>{const[t,r]=e;return[...t,...r.filter((e=>0===t.length||!t.some((t=>t.entity===e.entity&&t.point.lat===e.point.lat&&t.point.lng===e.point.lng))))]}));function qg(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){Hg(e,t,r[t])}))}return e}function Hg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Jg=(e,t)=>t.values.map(Fo(e,t.entityTypeUri)),Qg=(e,t,r)=>El(t.fieldName,r)||Ur(e,tt(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),Kg=(e,t)=>{const r=(0,l.propOr)([],"values",t),n=(0,l.path)([t.attrType.lookupCode],e);return(0,l.map)((e=>{const t=(0,l.prop)(e,n);return t?kv(e,t):e}),r)},Xg=(0,l.path)(["attrType","label"]),zg=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>qg({},e,{[t]:!0})),{});e[r]=e[r]?qg({},e[r],n):n}return e}),{}),Zg=(0,l.pipe)((0,l.prop)("values"),E),e_=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",Hn.type.name)),t_=e=>e.type===i_.NUMERIC_RANGE_FACET,r_=e=>e.type===i_.DATE_RANGE_FACET,n_=(0,l.either)(t_,r_),i_={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},a_=e=>{switch(null==e?void 0:e.name){case Hn.type.name:return i_.ENTITY_TYPE_FACET;case Hn.createdBy.name:case Hn.updatedBy.name:case Hn.sourceSystems.name:case Hn.tags.name:case Hn.roles.name:case Hn.matchRules.name:case Hn.MLRecommendedMatch.name:return i_.WITH_DROPDOWN_CHECKBOXES_FACET;case Hn.createdTime.name:case Hn.updatedTime.name:case Hn.startDate.name:case Hn.endDate.name:return i_.DATE_RANGE_FACET;case Hn.matches.name:case Hn.matchScore.name:return i_.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return i_.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return i_.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return i_.DATE_RANGE_FACET;default:return i_.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},o_=(0,l.pipe)(Qg,a_),s_=(0,l.pipe)((0,l.path)(["attrType","type"]),Vr),l_=(0,l.cond)([[t_,(0,l.always)(bn.IN_RANGE)],[r_,(0,l.always)(bn.WITHIN)],[(0,l.allPass)([s_,e=>e.values.length>=2]),(0,l.always)(bn.EXISTS)],[l.T,(0,l.always)(bn.EQUALS)]]),u_=(0,l.cond)([[r_,(0,l.prop)("values")],[t_,(0,l.prop)("values")],[s_,e=>1===e.values.length?e.values.map(ue):[]],[(0,l.pipe)((0,l.path)(["values",0]),Array.isArray),(0,l.prop)("values")],[l.T,e=>[e.values]]]);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 p_=(0,l.pipe)((0,l.path)(["attrType","type"]),jr),d_=(0,l.pipe)((0,l.path)(["attrType","type"]),Mr),y_=(0,l.pipe)((0,l.prop)("attrType"),hl),f_=(0,l.pipe)((0,l.prop)("attrType"),ml),T_=e=>t=>t.values.map((t=>pn(e,t).label)).join(" , "),E_=(0,l.when)((0,l.propSatisfies)((0,l.gt)(l.__,1),"length"),(0,l.join)(" – ")),m_=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(ye().number),E_)),(0,l.join)(","))(e.values);return`${Xg(e)}: ${t}`},h_=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(w),E_)),(0,l.join)(","))(e.values);return`${Xg(e)}: ${t}`},b_=e=>t=>`${Xg(t)}: ${Jg(e,t).join(", ")}`,O_=e=>t=>{const r=Kg(e,t);return`${Xg(t)}: ${r.join(", ")}`},v_=(0,l.curry)(((e,t,r)=>(0,l.map)((0,l.cond)([[f_,T_(e)],[d_,m_],[p_,h_],[y_,b_(e)],[l.T,O_(t)]]),r))),g_=(e,t,r,n)=>(0,l.pipe)(l.values,(0,l.reject)((0,l.pipe)((0,l.prop)("values"),E)),(0,l.map)((t=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=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}({},t,{attrType:Qg(e,t,n)}))),v_(e,r))(t),__=new RegExp(`^${ye().text("Search")}`),A_=(e,t,r,n)=>{let{uiState:i}=t;const{facets:a,keyword:o,advanced:s,readableQuery:u}=i;return(0,l.isEmpty)(s)?[...g_(e,a,r,n),...o?[o.value]:[]]:[(0,l.replace)(__,"",u)]},N_=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values)(Sn),P_=e=>(e=>N_.reduce(((e,t)=>{const r=new RegExp(`'{0,1}${encodeURIComponent("${")}${t}${encodeURIComponent("}")}'{0,1}`,"g"),n=new RegExp(`'{0,1}${encodeURIComponent("${")}now${encodeURIComponent("}")}'{0,1}`,"g"),[i,a]=sc(t);return e.replace(r,i).replace(n,a)}),e))(e),R_=(0,l.curry)(((e,t)=>{const r=new URL(e),[,n]=r.pathname.split("/");return"nui"===n?`${e}search?state=${t}`:`${e}#p~com.reltio.plugins.search.SearchPerspective_s~${t}`})),S_={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},w_=e=>[S_.geoPolygon,S_.onMapMove].includes(e),I_=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},U_=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},C_=(e,t)=>w_(e)?t.map(I_):[U_(t)],D_=e=>w_(e)?ye().text("Geo Polygon"):ye().text("Geo Location"),L_=e=>{switch(e){case S_.geoLocation:return"geoLocation";case S_.geoPolygon:case S_.onMapMove:return"geoPolygon"}},j_={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},k_=e=>ye().text(e),F_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[bn.EQUALS]:"=",[bn.NOT_EQUALS]:"≠",[bn.STARTS_WITH]:"*",[bn.MISSING_VALUE]:ye().text("missing value"),[bn.HAS_ALL]:ye().text("has all"),[bn.IN_RANGE]:ye().text("in range"),[bn.FULL_TEXT]:ye().text("full text"),[bn.EXISTS]:ye().text("exists"),[bn.COUNT_EQUALS]:`${ye().text("count")} =`,[bn.COUNT_NOT_EQUALS]:`${ye().text("count")} ≠`,[bn.COUNT_LT]:`${ye().text("count")} <`,[bn.COUNT_LTE]:`${ye().text("count")} <=`,[bn.COUNT_GT]:`${ye().text("count")} >`,[bn.COUNT_RANGE]:ye().text("count range"),[bn.LT]:"<",[bn.LTE]:"<=",[bn.GT]:">",[bn.GTE]:">=",[bn.IN_FILE]:ye().text("in file"),[bn.NOT_IN_FILE]:ye().text("not in file"),[bn.CONTAINS]:"~",[On.LIST_EQUALS]:"=",[On.NOT_LIST_EQUALS]:"≠",[On.LIST_EQUALS_CASE_SENSITIVE]:"=",[On.NOT_LIST_EQUALS_CASE_SENSITIVE]:"≠"}[e]||ye().text(e.toLowerCase())},M_=e=>({type:j_.operator,text:e}),x_=e=>({type:j_.operator,text:k_(e)}),$_=e=>({type:j_.attributeLabel,text:e}),V_=e=>({type:j_.specialAttributeLabel,text:e}),G_=e=>({type:j_.attributeFilter,text:F_(e)}),W_=e=>({type:j_.attributeValue,text:e}),B_=e=>({type:j_.entityTypeLabel,text:e}),Y_=()=>({type:j_.space,text:" "}),q_=()=>({type:j_.bracket,text:"("}),H_=()=>({type:j_.bracket,text:")"}),J_=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),Q_=(0,l.curry)(((e,t)=>t.map(J_(e)))),K_=(0,l.curry)(((e,t,r)=>[e,...r,t])),X_=K_(q_(),H_()),z_=K_(Y_(),Y_()),Z_=(0,l.curry)(((e,t)=>[e,...t])),eA=e=>Z_(B_(e)),tA=e=>Z_(B_(`${e}: `)),rA=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=ku(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=Lu(s),a=ju(s);!r&&t&&n&&(i.push(q_()),r=!0),i.push(o),r&&a&&(i.push(H_()),r=!1);const l=e?x_(s):M_(s);i.push(...z_([l]))}else i.push(o),r&&(i.push(H_()),r=!1)}return i}},nA=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),iA=(0,l.pipe)(rA({localizable:!1}),nA),aA=function(e){let{data:{title:t,pathToTitle:r}}=e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return r&&n?r.slice(1).join(" / "):t},oA=e=>{let{data:t,values:r,filter:n}=e;return t&&Ic({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},sA=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(oA)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),lA=(0,l.pipe)((0,l.chain)((0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)((e=>(e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.attrType)&&Rr(e.data.attrType)})(e)&&[bn.HAS_ALL,bn.EQUALS,bn.NOT_EQUALS].includes(e.filter))),(0,l.map)((e=>({type:Pr((0,l.path)(["data","attrType"],e)),codeValues:(0,l.flatten)((0,l.propOr)([],"values",e))}))),(0,l.filter)((e=>{let{codeValues:t}=e;return t.length>0})))),Gv),uA=(e,t)=>(0,l.pipe)(lA,Wv(t))(e),cA=(0,l.pathEq)(["data","fieldName"],Hn.type.name),pA=(0,l.path)(["data","entityTypeUri"]),dA=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),yA=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(Ps(e)),attributes:(0,l.filter)((0,l.pipe)(pA,(0,l.anyPass)([l.isNil,Ps(e),r=>{const n=(t.entityTypes||[]).filter(Ps(e));return(n.length>1?En(e,n):null)===r&&!!pn(e,r)}])))})(t))))),fA=e=>(0,l.pipe)((0,l.prop)("filter"),vu,(0,l.equals)(e)),TA=(0,l.curry)(((e,t,r,n,i,a)=>{const o=El(n.fieldName)||n.attrType,s=tc(o,i),u=Bv({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>Rr(s),()=>(0,l.is)(Object,a)&&a.lookupCode?kv(a.lookupCode,a.value):Mv(r,Pr(o),a)],[()=>hl(s),()=>Fo(e,n.entityTypeUri,a)],[()=>bl(s),()=>as(e,a)],[()=>Nl(s),()=>ls(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>Mr(c)||Vr(c)),Ku),W_)()})),EA=(e,t,r,n)=>{const i=TA(e,t,r,n.data,n.filter);return(0,l.cond)([[fA(0),(0,l.always)([])],[(0,l.both)(fA(2),(2,(0,l.pipe)((0,l.prop)("values"),l.flatten,l.length,(0,l.equals)(2)))),e=>{let{values:t}=e;const[r,n]=(0,l.flatten)(t);return[Y_(),i(r),{type:j_.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[Y_(),...(0,l.pipe)(l.flatten,(0,l.map)(i),Q_({type:j_.punctuationMark,text:", "}))(t)]}]])(n)},mA=(e,t)=>{const r=!!El(e.data.fieldName);return(0,l.pipe)(aA,r?V_:$_)(e,t)},hA=(e,t,r,n,i)=>[mA(n,i),Y_(),G_(n.filter),...EA(e,t,r,n)],bA=(0,l.addIndex)(l.map),OA=(0,l.propEq)("length",1),vA=(0,l.propSatisfies)((0,l.lt)(1),"length"),gA=(0,l.complement)(l.isEmpty),_A=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)(xu,(0,l.filter)(oA),$u,(0,l.map)((n=>({operand:hA(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,rA()))(n)},AA=(0,l.pipe)(_A,l.flatten),NA=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>Ap(e,{type:t}))).join(", ");return r?t(r):l.identity},u=_A(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(eA),(0,l.pipe)(s(tA),(0,l.unless)((()=>OA(u)||i),X_)))(u)},PA=(e,t,r,n)=>(0,l.pipe)(xu,(0,l.filter)(sA),$u,bA(((n,i,a)=>({operand:NA(e,t,r,n,OA(a)),operator:n.operator}))),rA(),l.flatten)(n),RA=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),rA(),l.flatten),SA=e=>{let{searchType:t,values:[r]}=e;return C_(t,r).join(", ")},wA=(e,t,r,n,i,a)=>{const o=(e=>e?[V_(e.isRawFilter?ye().text("Raw filter"):ye().text("Search")),...z_([G_(bn.EQUALS)]),W_(`"${e.value}"`)]:[])(i),s=(e=>e?[V_(D_(e.searchType)),Y_(),W_(SA(e))]:[])(a),u=(0,l.pipe)(PA,(0,l.when)((e=>vA(e)&&(gA(o)||gA(s))),X_))(e,t,r,n);return RA([o,s,u])},IA=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),UA=(0,l.pipe)(wA,IA),CA=(0,l.has)("attributes"),DA=Array.isArray,LA=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),jA=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=kA(e,t,r,a,i);return(0,l.when)((0,l.always)((0,l.complement)(l.isNil)(o)),(0,l.pipe)((0,l.when)((0,l.always)((0,l.not)(LA(a))),X_),(0,l.concat)(z_([M_(o)]))))(s)},kA=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return CA(n)?jA(e,t,r,n,i):DA(n)?n.reduce(((n,a)=>n.concat(kA(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(z_([M_(n.operator)])))(hA(e,t,r,n,i))},FA=(e,t,r,n,i)=>(0,l.pipe)(kA,l.flatten)(e,t,r,n,i);function MA(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){xA(e,t,r[t])}))}return e}function xA(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=(0,l.complement)(cA),VA=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(cA),(0,l.map)((0,l.prop)("values")),l.flatten,l.uniq)(e),r=(0,l.pipe)((0,l.map)(pA),(0,l.reject)(l.isNil),l.uniq)(e),n=0===r.length,i=1===r.length&&(0===t.length||(0,l.equals)(r,t));return{entityTypesFromSpecialAttributes:t,entityTypesFromAttributes:r,areOnlySpecialAttributes:n,areAttributesFromOneEntityType:i}},GA=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=VA(t);return(r||n)&&Fu(t)},WA=(0,l.ifElse)((0,l.all)((0,l.has)("entityTypes")),l.identity,(0,l.pipe)((e=>{const t=[],r=e.filter((0,l.complement)(GA)),n=e.filter((e=>{let{attributes:t=[]}=e;return t.length>0}));if(0===r.length||1===r.length&&1===n.length||t.push("Can't convert more than one complex transition advanced search group"),e.some((e=>(e.attributes||[]).filter(cA).some((0,l.propEq)("filter",bn.NOT_EQUALS))))&&t.push("Can't convert advanced search group with 'Type' attribute and 'not equals' filter."),t.length)throw t;return e}),(0,l.reduce)(((e,t)=>e.concat((e=>{const t=[],r=e.attributes||[],{entityTypesFromSpecialAttributes:n,entityTypesFromAttributes:i}=VA(r);if(GA(e))t.push(MA({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter($A)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(cA,(0,l.pipe)((0,l.prop)("values"),l.flatten),(0,l.pipe)(pA,(e=>[e]),(0,l.reject)(l.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter($A),entityTypes:n,operator:i?a:e.operator,id:(0,De.x0)()}}));t.push(...n)}var a;return t})(t))),[]))),BA={[bn.EQUALS]:bn.ON,[bn.IN_RANGE]:bn.WITHIN,[bn.GTE]:bn.AFTER,[bn.GT]:bn.AFTER,[bn.LTE]:bn.BEFORE,[bn.LT]:bn.BEFORE},YA=(0,l.curry)((e=>BA[e]||e)),qA=(0,l.curry)(((e,t)=>{switch(e){case bn.LT:return[f()(t[0]).subtract(1,"day").valueOf()];case bn.GT:return[f()(t[0]).add(1,"day").valueOf()];default:return t}})),HA=(0,l.pipe)((0,l.path)(["data","attrType","type"]),jr),JA=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>MA({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return HA(e)?(0,l.evolve)({filter:YA,values:qA(t)},e):e}))})))})),QA=(0,l.evolve)({values:(0,l.when)((0,l.pipe)((0,l.prop)(0),nc),(0,l.map)(sc))}),KA=(0,l.map)((0,l.cond)([[HA,QA],[l.T,l.identity]])),XA=(0,l.curryN)(3,((e,t,r,n,i)=>(0,l.pipe)((0,l.defaultTo)([]),WA,yA(t),(0,l.map)((0,l.evolve)({attributes:(0,l.pipe)((0,l.map)((0,l.evolve)({data:e(t,n,i)})),(0,l.reject)((0,l.propSatisfies)(l.isNil,"data")),KA)})),JA,(0,l.reject)(dA))(r)));function zA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ZA(e,t,r[t])}))}return e}function ZA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const eN=(e,t)=>({data:{uri:at(e.fieldName)?tt(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||l_(e),id:(0,De.x0)(),values:u_(e)}),tN=(0,l.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=El(a,t,r)||Ur(e,i);if(!s)return null;if(mr(s))return zA({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=Ap(e,{type:o}),i=(Ir(e,tt(a,o),o)||[]).map((0,l.pick)(["label","name"])).slice(0,-1);return zA({},n,{attrType:s,title:t,pathToTitle:Array.isArray(i)?[r,...(0,l.chain)((0,l.prop)("label"),i),t]:[r,t]})}})),rN=(0,l.curry)(((e,t,r,n)=>XA(tN,e,n,t,r)));function nN(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){iN(e,t,r[t])}))}return e}function iN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const aN=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},oN=e=>"rdmLookups.not.resolved"===e?Hn.notResolved.name:e,sN=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===An?bn.IN_RANGE:Nn(a),u=oN(n),c=El(u)||Ur(e,i),p=(0,l.cond)([[()=>Nu(s),(0,l.map)((0,l.when)((0,l.both)((0,l.has)("link"),(0,l.complement)((0,l.has)("filename"))),(e=>nN({},e,{filename:Dv(e)}))))],[()=>Vr(null==c?void 0:c.type),(0,l.map)(ue)],[e=>_u(s)&&!Array.isArray(e[0])&&!jr(null==c?void 0:c.type),ae],[l.T,l.identity]])(o);return{id:(0,De.x0)(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===An?"and not":"and",filter:s,values:p}})),lN=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(sN(e,En(e,i)));return[{id:(0,De.x0)(),operator:"or",attributes:a,entityTypes:i}]})),uN=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),cN=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([uN("from"),uN("to")]),(0,l.pipe)((0,l.pick)(["from","to"]),l.values)],[(0,l.pipe)((0,l.prop)("rangeSelection"),E,l.not),(0,l.pipe)((0,l.prop)("rangeSelection"),(0,l.pick)(["start","end"]),l.values)],[l.T,()=>[]]]),pN=(e,t)=>{const r=(0,l.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return nN({},r,{values:cN(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?pl(e.fieldName,n):e.fieldName})},dN=(e,t)=>{if((0,l.has)("children")(e)){const r=pN(e,t);return e.children.reduce(((e,n)=>(e.push(dN(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return pN(e,t)},yN=(0,l.cond)([[(0,l.has)("searchParameters"),e=>{const t=[];return(0,l.has)("values",e)&&t.push(pN(e)),(0,l.propOr)([],"searchParameters",e).forEach((r=>t.push(nN({fieldName:e.fieldName},pN(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(dN,l.flatten)],[l.T,pN]]),fN=(0,l.pipe)((0,l.map)(yN),l.flatten),TN=e=>{if(e.every((e=>Array.isArray(e))))return e;if(2===e.length)return[e.map((e=>Number(e)))];if(1===e.length){const t=Number(e[0]);return[[t,t]]}return e},EN=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=lN(e,a),[u]=((e,t)=>{if(!t)return[];const[r,n]=(0,l.pipe)((0,l.reject)((e=>"tenants"===e.fieldName)),(0,l.partition)((e=>"type"===e.fieldName)))(t),i=(0,l.chain)((0,l.propOr)([],"values"),r);return[{attributes:fN(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>nN({},t,{type:o_(e,t)}))).map((e=>nN({},e,{values:n_(e)?TN(e.values):e.values}))).map((e=>{let{filter:t}=e,r=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["filter"]);return eN(r,t)})),operator:"or",id:(0,De.x0)(),entityTypes:i}]})(e,i),c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,l.pipe)(l.keys,(0,l.map)((t=>({[oN(t)]:e[t]}))),l.mergeAll)(e)}(o),p=[nN({},u,{entityTypes:null!=c&&c.type?(0,l.uniq)([...u.entityTypes,...s.entityTypes]):[],attributes:[...u.attributes,...s.attributes].filter((e=>{let{data:{fieldName:t}}=e;return c[t]}))})];return rN(e,t,r,p)},mN=(e,t,r,n)=>{try{return"2.0"==n.version?((e,t,r,n)=>{const{advanced:i=[],facets:a={}}=n,o=i.some((e=>{let{attributes:t,entityTypes:r=[]}=e;return t.length||r.length}))?i:((e,t)=>{const[[r={}],n]=(0,l.pipe)(l.values,(0,l.reject)(Zg),(0,l.partition)(e_))(t),i=n.map((t=>zA({},t,{type:o_(e,t)}))).map((e=>eN(e))),a=r.values||[];return[{attributes:i,operator:"or",id:(0,De.x0)(),entityTypes:a}]})(e,a);return rN(e,t,r,o)})(e,t,r,n):EN(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},hN=e=>"2.0"===e.version?e.keyword:aN(e),bN=e=>(0,l.pathEq)(["object","uri"],e),ON=(e,t)=>(0,l.pipe)((0,l.find)(bN(e)),(0,l.prop)("object"))(t),vN=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=(0,l.pipe)((0,l.find)((0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),bN(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=ON(r.match,t)||n[r.match];return i?{label:rp((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return ko(e,i.type,t)||{label:t,uri:t}}))}:null};return(0,l.pipe)((0,l.defaultTo)([]),(0,l.when)((0,l.complement)(l.isEmpty),(0,l.map)(a)),(0,l.reject)(l.isNil))(i)},gN=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,l.pick)(["uri","type","label"],r),e}),{}),_N=(0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)]),AN=(e,t,r)=>(0,l.pipe)((0,l.propOr)([],"shortestTransitiveMatchPath"),(0,l.map)((t=>{let{match:n,matchRules:i=[],negativeRules:a=[]}=t;const o=(0,l.propOr)({},n,r);return{label:rp((0,l.prop)("label",o)),matchRules:i.concat(a).map((function(t){return ko(e,o.type,t)||{label:t,uri:t}}))}})))(t),NN=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.map)((0,l.prop)("shortestTransitiveMatchPath")),l.flatten,(0,l.filter)(l.identity),(0,l.map)((0,l.prop)("match")),l.uniq);return t(e)},PN=(0,l.path)(["object","uri"]),RN=e=>{let t=[];return{addChild:e=>{t=(0,l.append)(e,t)},getValue:()=>e,getChildren:()=>t,removeChild:e=>{t=(0,l.without)([e],t)}}},SN=e=>e.getValue(),wN=(e,t)=>{let r=null;if(t(e.getValue()))return e;const n=e.getChildren();for(let e=0;e<n.length&&(r=wN(n[e],t),!r);e++);return r},IN=(e,t)=>{const r=[],n=(0,l.pipe)(SN,t),i=(0,l.pipe)(l.map,l.flatten),a=e.getChildren();a.some(n)&&r.push(e);const o=i((0,l.partialRight)(IN,[t]),a);return r.push.apply(r,o),r};function UN(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){CN(e,t,r[t])}))}return e}function CN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const DN=(e,t)=>!!e[t],LN=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},jN=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return 0===t.length&&e?e:(0,l.uniqBy)(r,[...t,...e||[]])},kN=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return UN({},t,{[r.uri]:UN({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:jN(null==o?void 0:o.parents,n),children:jN(null==o?void 0:o.children,i),values:jN(null==o?void 0:o.values,a,(0,l.prop)("uri"))})})},FN=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=pn(r,t)||Vi(r,t),i=(0,l.either)((0,l.both)((0,l.prop)("dependentLookupAttributes"),(0,l.prop)("dependentLookupCode")),(0,l.prop)("children"));return Ts(r,n,i).flatMap(ms).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>Ur(r,e))).filter(l.identity).filter((0,l.prop)("dependentLookupCode"));return(e=>{let{structure:t,parentAttrType:r,childrenAttrTypes:n}=e;const i=n.map((0,l.prop)("uri")),a=kN({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>kN({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},MN=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!We(e.uri)&&Qe(e.type)&&Qe(t)&&!t.startsWith(e.type))(n,t))return e;const i=Ws(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(Ss),(0,l.map)(LN))(i);return kN({structure:e,attrType:e[t].attrType,values:a})}),t)},xN=e=>{let{structure:t,attributeValue:r}=e;if((0,l.is)(Object,r.value))return Object.values(r.value).reduce(((e,t)=>{const r=t.some((e=>{let{value:t}=e;return(0,l.is)(Object,t)})),n=t.some((t=>{let{type:r}=t;return DN(e,r)}));return r||n?t.filter(Ss).reduce(((e,t)=>xN({structure:e,attributeValue:t})),e):e}),t);{const e=r;return DN(t,e.type)?kN({structure:t,attrType:t[e.type].attrType,values:[LN(e)]}):t}},$N=e=>{let{structure:t,uri:r}=e;return(0,l.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?UN({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},VN=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=Ws(i,n,r)||[];return a.length?kN({structure:t,attrType:t[r].attrType,values:a.filter(Ss).map(LN)}):t},GN=(e,t,r)=>{const n=qe(e),i=qe(t);return n===i?((e,t)=>{const r=lt(t),n=lt(e);return Xe(n,r)||((e,t)=>ot(e)&&!ot(t)&&Xe(t,e))(n,r)})(e,t):!(!r||!st(t))&&ph(r,i).includes(n)},WN=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},BN=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?uh(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return GN(r,t,o)}))},YN=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>YN(e,t,r)))))},qN=(e,t)=>{var r;return null==e||null===(r=e[t])||void 0===r?void 0:r.isTouched},HN=(e,t,r,n,i)=>{let{uri:a,value:o}=r;const s=a!==t&&WN(n,e);return{type:e,uri:a,lookupValue:o,autopopulate:s,useDefaultValue:s&&!qN(i,a)}},JN=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s,editorsState:l}=e;const u=t[r],c=qe(n),p=ch(c,o,i,a),d=YN("children",t,u),y=YN("parents",t,u),f=d.flatMap((e=>YN("parents",t,e))).filter((e=>![...y,u,...d].includes(e))),T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return GN(t,n,p)})).map((t=>HN(e.attrType.uri,n,t,s,l)))));if(!T.length)return[];const E=y.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return GN(n,t,p)||qe(t)!==c&&GN(t,n,p)})).map((t=>HN(e.attrType.uri,n,t,s,l))))),m=f.flatMap((e=>{const r=YN("children",t,e).map((e=>{let{attrType:t}=e;return t.uri}));return e.values.filter((e=>{let{uri:t}=e;return T.some((e=>{let{uri:n,type:i}=e;return r.includes(i)&&GN(n,t,p)}))})).map((t=>HN(e.attrType.uri,n,t,s,l)))}));return[...u.values.filter((e=>{let{uri:t}=e;return GN(t,n,p)})).map((e=>HN(r,n,e,s,l))),...E,...m,...T]},QN=async e=>{let{attributeType:t,attributePresentations:r,value:n}=e;const i=Bv({attributePresentations:r,dataTypeDefinition:t}),a=(0,l.pipe)((e=>{const t={};for(const r of e){const[e,n]=Object.entries(r)[0];t[e]=Array.isArray(n)?n.map((e=>({value:e,ov:!0}))):[{value:n,ov:!0}]}return{value:t}}),(e=>ep(e,t.dataLabelPattern))),o=e=>Object.values(e[0])[0],s=(0,l.pipe)(o,i),u=(0,l.cond)([[vr,()=>a(n)],[Rr,()=>(e=>{const r=o(e),n=Pr(t);return pu([{codeValue:r,type:n}]).then((e=>{if(Array.isArray(e))return Mv(e[0],n,r)}))})(n)],[l.T,()=>s(n)]]);return await u(t)},KN=e=>{let{value:t,attributeType:r,entityType:n=""}=e,i=[{fieldName:"type",filter:bn.EQUALS,values:[n]}];return Array.isArray(t)?i=i.concat(XN(r,t)):i.push(zN([t],r)),i},XN=(e,t)=>{const r=hr(e),n=t=>(e[r]||[]).find((e=>e.uri===t||e.uri.endsWith(`/${t}`)));return t.reduce(((e,t)=>{for(const r in t){const i=n(r),a=vr(i)?XN(i,t[r]):[zN(t[r],i)];return e.push(...a),e}}),[])},zN=(e,t)=>e&&e.length&&!(0,l.isNil)(e[0])&&""!==e[0]?{fieldName:Nr(t.uri),filter:t.type===zt.TYPE_BLOB?bn.FULL_TEXT:bn.EQUALS,values:e}:{fieldName:Nr(t.uri),filter:bn.MISSING_VALUE},ZN=(e,t)=>(0,l.equals)(JSON.parse(JSON.stringify(e)),JSON.parse(JSON.stringify(t))),eP=new class{constructor(){this.comparators=void 0,this.comparators={}}register(e,t){this.comparators[e]=t}get(e){var t;return null!==(t=this.comparators[e])&&void 0!==t?t:ZN}},tP={AttributesDiff:o,AttributesEditor:a,HistoryManager:s},rP={Colors:r(33164),DependencyManager:r(29524),strings:n,dates:i}},33164:(e,t,r)=>{"use strict";r.r(t),r.d(t,{getColor:()=>i});var n=[[255,235,238,0],[255,205,210,0],[239,154,154,0],[229,115,115,0],[239,83,80,1],[244,67,54,1],[229,57,53,1],[211,47,47,1],[198,40,40,1],[183,28,28,1],[255,138,128,0],[255,82,82,1],[255,23,68,1],[213,0,0,1],[252,228,236,0],[248,187,208,0],[244,143,177,0],[240,98,146,1],[236,64,122,1],[233,30,99,1],[216,27,96,1],[194,24,91,1],[173,20,87,1],[136,14,79,1],[255,128,171,0],[255,64,129,1],[245,0,87,1],[197,17,98,1],[243,229,245,0],[225,190,231,0],[206,147,216,0],[186,104,200,1],[171,71,188,1],[156,39,176,1],[142,36,170,1],[123,31,162,1],[106,27,154,1],[74,20,140,1],[234,128,252,0],[224,64,251,1],[213,0,249,1],[170,0,255,1],[237,231,246,0],[209,196,233,0],[179,157,219,0],[149,117,205,1],[126,87,194,1],[103,58,183,1],[94,53,177,1],[81,45,168,1],[69,39,160,1],[49,27,146,1],[179,136,255,0],[124,77,255,1],[101,31,255,1],[98,0,234,1],[232,234,246,0],[197,202,233,0],[159,168,218,0],[121,134,203,1],[92,107,192,1],[63,81,181,1],[57,73,171,1],[48,63,159,1],[40,53,147,1],[26,35,126,1],[140,158,255,0],[83,109,254,1],[61,90,254,1],[48,79,254,1],[227,242,253,0],[187,222,251,0],[144,202,249,0],[100,181,246,0],[66,165,245,0],[33,150,243,1],[30,136,229,1],[25,118,210,1],[21,101,192,1],[13,71,161,1],[130,177,255,0],[68,138,255,1],[41,121,255,1],[41,98,255,1],[225,245,254,0],[179,229,252,0],[129,212,250,0],[79,195,247,0],[41,182,246,0],[3,169,244,0],[3,155,229,1],[2,136,209,1],[2,119,189,1],[1,87,155,1],[128,216,255,0],[64,196,255,0],[0,176,255,0],[0,145,234,1],[224,247,250,0],[178,235,242,0],[128,222,234,0],[77,208,225,0],[38,198,218,0],[0,188,212,0],[0,172,193,0],[0,151,167,1],[0,131,143,1],[0,96,100,1],[132,255,255,0],[24,255,255,0],[0,229,255,0],[0,184,212,0],[224,242,241,0],[178,223,219,0],[128,203,196,0],[77,182,172,0],[38,166,154,0],[0,150,136,1],[0,137,123,1],[0,121,107,1],[0,105,92,1],[0,77,64,1],[167,255,235,0],[100,255,218,0],[29,233,182,0],[0,191,165,0],[232,245,233,0],[200,230,201,0],[165,214,167,0],[129,199,132,0],[102,187,106,0],[76,175,80,0],[67,160,71,1],[56,142,60,1],[46,125,50,1],[27,94,32,1],[185,246,202,0],[105,240,174,0],[0,230,118,0],[0,200,83,0],[241,248,233,0],[220,237,200,0],[197,225,165,0],[174,213,129,0],[156,204,101,0],[139,195,74,0],[124,179,66,0],[104,159,56,1],[85,139,47,1],[51,105,30,1],[204,255,144,0],[178,255,89,0],[118,255,3,0],[100,221,23,0],[249,251,231,0],[240,244,195,0],[230,238,156,0],[220,231,117,0],[212,225,87,0],[205,220,57,0],[192,202,51,0],[175,180,43,0],[158,157,36,0],[130,119,23,1],[244,255,129,0],[238,255,65,0],[198,255,0,0],[174,234,0,0],[255,253,231,0],[255,249,196,0],[255,245,157,0],[255,241,118,0],[255,238,88,0],[255,235,59,0],[253,216,53,0],[251,192,45,0],[249,168,37,0],[245,127,23,0],[255,255,141,0],[255,255,0,0],[255,234,0,0],[255,214,0,0],[255,248,225,0],[255,236,179,0],[255,224,130,0],[255,213,79,0],[255,202,40,0],[255,193,7,0],[255,179,0,0],[255,160,0,0],[255,143,0,0],[255,111,0,0],[255,229,127,0],[255,215,64,0],[255,196,0,0],[255,171,0,0],[255,243,224,0],[255,224,178,0],[255,204,128,0],[255,183,77,0],[255,167,38,0],[255,152,0,0],[251,140,0,0],[245,124,0,0],[239,108,0,1],[230,81,0,1],[255,209,128,0],[255,171,64,0],[255,145,0,0],[255,109,0,0],[251,233,231,0],[255,204,188,0],[255,171,145,0],[255,138,101,0],[255,112,67,0],[255,87,34,1],[244,81,30,1],[230,74,25,1],[216,67,21,1],[191,54,12,1],[255,158,128,0],[255,110,64,0],[255,61,0,1],[221,44,0,1],[239,235,233,0],[215,204,200,0],[188,170,164,0],[161,136,127,1],[141,110,99,1],[121,85,72,1],[109,76,65,1],[93,64,55,1],[78,52,46,1],[62,39,35,1],[250,250,250,0],[245,245,245,0],[238,238,238,0],[224,224,224,0],[189,189,189,0],[158,158,158,0],[117,117,117,1],[97,97,97,1],[66,66,66,1],[33,33,33,1],[236,239,241,0],[207,216,220,0],[176,190,197,0],[144,164,174,0],[120,144,156,1],[96,125,139,1],[84,110,122,1],[69,90,100,1],[55,71,79,1],[38,50,56,1],[0,0,0,1],[255,255,255,0]];function i(e){var t,r=null,i=[parseInt(e.substring(1,3),16),parseInt(e.substring(3,5),16),parseInt(e.substring(5,7),16)];return n.forEach((function(e){var n=Math.abs(i[0]-e[0])+Math.abs(i[1]-e[1])+Math.abs(i[2]-e[2]);(null===r||n<r)&&(r=n,t=e)})),t?t[3]:0}},29524:(e,t,r)=>{"use strict";function n(e){var t=[];return{getInfo:function(){return e},getEdges:function(){return t},removeEdge:function(e){var r=t.indexOf(e);t.splice(r,1)},addEdge:function(e){t.push(e)}}}function i(e,t){t(e),e.getEdges().forEach((function(e){i(e,t)}))}function a(e){var t=[];return e.getEdges().forEach((function(e){t.push.apply(t,a(e))})),t.push(e),t}function o(e,t){var r=null;if(e.getInfo()===t)return e;for(var n=e.getEdges(),i=0;i<n.length&&!(r=o(n[i],t));i++);return r}function s(e,t){var r=null;if(e.getEdges().some((function(e){return e.getInfo()===t})))return e;for(var n=e.getEdges(),i=0;i<n.length&&!(r=s(n[i],t));i++);return r}r.r(t),r.d(t,{Node:()=>n,resolve:()=>i,findNode:()=>o,findParentNode:()=>s,getDependencyOrder:()=>a})},33196:()=>{},38087:()=>{},74854:()=>{},66602:()=>{}}]);
|
|
1
|
+
(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[747],{47401:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>ol,IL3:()=>yT,PY2:()=>Fn,Ng6:()=>vt,YJ7:()=>Un,NlI:()=>On,XYV:()=>Sn,Xt7:()=>Tt,wfT:()=>Oi,EMD:()=>li,HAc:()=>mt,PEf:()=>Gn,oA3:()=>si,$XE:()=>Ft,eWf:()=>$n,q7e:()=>ht,KVe:()=>vi,WVQ:()=>qr,oZZ:()=>Ii,bNA:()=>Ui,Rjq:()=>Ci,G39:()=>Bn,W0P:()=>qt,X1H:()=>Wt,hdG:()=>Qt,ws7:()=>Kt,VI$:()=>Jt,yn8:()=>Dt,N0y:()=>Ct,dZX:()=>Mt,bQt:()=>Li,oS0:()=>zt,KfU:()=>Et,bZE:()=>Pn,Nsj:()=>Ln,psV:()=>In,xPW:()=>Mn,pyR:()=>fi,p8l:()=>ci,Wkf:()=>ft,zHr:()=>yt,NIO:()=>dt,$26:()=>a_,Esk:()=>ri,s9T:()=>It,MEy:()=>qu,j5E:()=>bn,vAw:()=>oi,NMQ:()=>ai,eVu:()=>pc,YGb:()=>Yt,mNm:()=>di,Y1q:()=>Eh,s_5:()=>Ti,RgZ:()=>pi,unl:()=>wi,Qy0:()=>Di,Q26:()=>Dn,pYu:()=>ti,wIJ:()=>w_,GFH:()=>_t,Ury:()=>Yn,S91:()=>qn,p3$:()=>Mi,wSh:()=>ee,BDP:()=>Qi,pGS:()=>yi,ARY:()=>Zt,XGc:()=>bi,fO_:()=>on,wwy:()=>Rt,h_8:()=>Jn,_XL:()=>Cn,j2V:()=>gi,dMV:()=>mi,NBX:()=>SN,OXy:()=>er,BXd:()=>Lt,KM9:()=>Ot,CJB:()=>Ni,lXI:()=>Vt,nqG:()=>ki,C68:()=>Wn,yxQ:()=>ji,Yj_:()=>St,D25:()=>Nt,ZIY:()=>xt,Tl4:()=>k_,lwr:()=>Vn,NkU:()=>_i,Rtp:()=>hi,YGx:()=>jt,uTS:()=>Ei,MCv:()=>bt,IYE:()=>ui,PiC:()=>Si,MVv:()=>Ht,h_m:()=>Gt,DUe:()=>Rn,tJI:()=>gt,fDt:()=>At,cNQ:()=>Ai,SwE:()=>ni,ZHR:()=>Ri,PYu:()=>Bt,lD1:()=>Hn,lVm:()=>kt,vnX:()=>wg,$x5:()=>Ig,_R1:()=>Rg,wUm:()=>Sg,z7V:()=>Fi,dC6:()=>Ut,MBD:()=>Pt,GmF:()=>Ra,cKm:()=>$t,iP_:()=>xn,NVC:()=>wt,tPT:()=>Ll,tZe:()=>IT,kRE:()=>rm,psB:()=>nm,X0$:()=>Dl,$vY:()=>Cl,zE1:()=>Bl,Wm5:()=>gl,vyX:()=>Hc,wLZ:()=>jl,W4V:()=>le,EtK:()=>Vs,ayi:()=>Ul,asT:()=>$N,kGs:()=>Wh,ewt:()=>Id,O_f:()=>Mu,sOy:()=>Xe,Tde:()=>Nr,LMI:()=>Ic,skb:()=>NA,sPt:()=>vc,sH1:()=>gc,lPZ:()=>Xy,bG8:()=>Ky,_LJ:()=>zy,RPM:()=>ry,h27:()=>$c,Uqd:()=>qc,xG:()=>MA,Z2f:()=>Gv,fgW:()=>aA,I69:()=>IA,ZxB:()=>CA,dwd:()=>Qy,F$g:()=>Jy,mdt:()=>ab,Qbq:()=>wh,rny:()=>ca,UEY:()=>Ja,Q0T:()=>Ha,Lyr:()=>to,sBn:()=>qa,itK:()=>Ga,H9$:()=>Ya,KPc:()=>Ba,zos:()=>Wa,ELQ:()=>ro,dZs:()=>Ca,Cz4:()=>Ua,z_L:()=>Za,fGe:()=>Ia,iuF:()=>$a,Wib:()=>Va,Hn0:()=>eo,obS:()=>no,E$L:()=>Da,XUh:()=>xa,Qp_:()=>Fa,_jk:()=>La,sKE:()=>ja,WmG:()=>Ma,QKx:()=>Xa,Oik:()=>Ka,s0A:()=>ka,o9m:()=>Qa,MCd:()=>za,RsS:()=>Vc,tGK:()=>yu,lIv:()=>Yl,Vg3:()=>ma,mkC:()=>ia,xv5:()=>ba,a14:()=>oa,yv0:()=>ha,Zm0:()=>aa,Nxd:()=>na,$mM:()=>Ea,ifj:()=>Jr,NWi:()=>ug,xr3:()=>lg,wNf:()=>_u,iJH:()=>cg,d89:()=>ea,Edd:()=>ta,Z5t:()=>ra,uGe:()=>Xi,UoR:()=>Ki,xvW:()=>sg,$qe:()=>og,yPM:()=>wa,$cp:()=>Wl,vKJ:()=>Vl,VtG:()=>_f,AID:()=>th,B1H:()=>PN,b7X:()=>Ph,$uE:()=>qh,keo:()=>Sh,C_p:()=>$y,G27:()=>cO,JA0:()=>YE,b3T:()=>Gh,oC6:()=>$h,_Zs:()=>Vh,epC:()=>Jh,YYG:()=>Hh,f_2:()=>HE,w3l:()=>lN,QHB:()=>uO,Jso:()=>TN,RXH:()=>Jb,Vr9:()=>bO,lMm:()=>mv,BlA:()=>XN,fmQ:()=>Ds,yRD:()=>QA,NcL:()=>qy,QK6:()=>me,ymd:()=>dT,JV_:()=>bm,XiW:()=>Zp,Yrx:()=>CE,GPx:()=>Il,gjI:()=>wl,vlo:()=>Jd,E_P:()=>Zh,aAL:()=>Zf,NBq:()=>Ls,wp9:()=>ib,DsR:()=>Hf,MPc:()=>xp,gWE:()=>$p,DT_:()=>Vp,ipn:()=>Wp,ORg:()=>Yi,_wz:()=>Gp,RYR:()=>Td,PP2:()=>FE,wS7:()=>Xv,cBQ:()=>Uf,pBq:()=>xm,DsO:()=>te,X78:()=>vm,xZs:()=>Tm,YFy:()=>LE,Gmt:()=>sm,K$w:()=>om,DSj:()=>eT,Mfr:()=>jE,k9j:()=>Df,EjS:()=>X,ww$:()=>kl,WVU:()=>am,hxF:()=>Al,n6p:()=>an,E7G:()=>kp,nwO:()=>rP,Mzk:()=>Pf,aFF:()=>jh,HRH:()=>Qu,EZK:()=>ap,Kxm:()=>tp,Z9i:()=>Oy,CrF:()=>zE,DNd:()=>ao,vUy:()=>YN,lJh:()=>Zu,zHo:()=>ec,sEJ:()=>IN,UO$:()=>Ym,zeJ:()=>Ur,dLR:()=>Ys,JQy:()=>nl,XtP:()=>Ws,Ug0:()=>En,A1W:()=>Rh,sw:()=>ip,nv3:()=>hg,JgD:()=>mg,nve:()=>UN,SkP:()=>il,SAs:()=>Vm,i5L:()=>al,PWK:()=>is,IM5:()=>Bs,Aup:()=>hO,Mfk:()=>Ov,HQx:()=>hs,oN$:()=>ms,mB6:()=>Yv,p6d:()=>w,o0x:()=>U,ufS:()=>Cv,k7L:()=>Dv,mrB:()=>I,OuZ:()=>op,ncP:()=>Ye,FQ2:()=>sp,W$R:()=>lp,JOV:()=>xe,Zmi:()=>$e,hm5:()=>Ge,ECL:()=>Xr,vPL:()=>up,qmL:()=>Th,hPi:()=>Fm,hXd:()=>da,OCS:()=>ya,p2l:()=>ll,qF1:()=>fT,_X$:()=>TT,yj2:()=>N_,bzh:()=>lb,k66:()=>fs,kiP:()=>Io,pSg:()=>pe,kz_:()=>VE,H_U:()=>Es,t9e:()=>yo,j2$:()=>UT,PFL:()=>fr,aJ3:()=>Kg,To9:()=>Pr,wpo:()=>wp,ADq:()=>Ty,UUb:()=>yy,tQX:()=>fy,xy8:()=>hr,EUG:()=>Cr,AFK:()=>nt,X3M:()=>Ir,WN0:()=>Ts,kDl:()=>qs,uDV:()=>fh,IhQ:()=>zs,pfb:()=>el,R$r:()=>zh,w80:()=>qo,Pfu:()=>co,Gtj:()=>iu,fyF:()=>nu,kkq:()=>ys,u5q:()=>qe,O$n:()=>Rp,ptG:()=>Sp,f4_:()=>mb,uap:()=>Eb,d7q:()=>UE,liG:()=>ME,$oF:()=>IE,avf:()=>Md,DiQ:()=>Fd,cfX:()=>kd,vD3:()=>$d,Qrb:()=>jd,EJQ:()=>xd,HWy:()=>Ld,gjS:()=>hd,y6v:()=>Dd,JUW:()=>JE,GtP:()=>Ib,_kX:()=>so,u1e:()=>lo,sJj:()=>Ch,CJp:()=>Sb,uKF:()=>Uh,wo0:()=>tm,s5:()=>ss,cwx:()=>os,Y6b:()=>OE,TTx:()=>pm,UtR:()=>vE,HaQ:()=>dm,E6I:()=>XE,Won:()=>_E,vTU:()=>hE,Nsy:()=>mp,KMQ:()=>Lh,Do$:()=>vp,CSV:()=>pl,TMe:()=>gE,l1V:()=>rc,RHh:()=>cc,VQ1:()=>lc,cGG:()=>sc,z7d:()=>Qd,Xaq:()=>vs,Sj8:()=>QN,PJj:()=>cu,k3T:()=>hn,PjQ:()=>Hi,s7l:()=>mf,jLA:()=>Ub,GGR:()=>Bd,j5q:()=>Gd,DnY:()=>ff,RY5:()=>lh,Px$:()=>Ed,KPC:()=>_N,NIY:()=>Af,HvW:()=>bf,Fof:()=>fo,BXy:()=>Of,fX:()=>Cb,BTI:()=>_p,uie:()=>dp,q27:()=>Up,vrC:()=>CO,fAQ:()=>Nm,XkT:()=>yf,lrH:()=>Pm,nt9:()=>pn,XH8:()=>Pp,XH2:()=>mn,jFi:()=>Np,qhs:()=>Yo,wwR:()=>gp,Uk3:()=>it,$Rg:()=>pt,ev7:()=>RN,RB9:()=>BE,iFp:()=>iy,e$p:()=>oy,PcX:()=>sy,SpP:()=>ay,R6_:()=>zg,CY1:()=>o_,Ajk:()=>lf,Yiz:()=>sf,FK9:()=>ef,UOo:()=>Lv,aTW:()=>um,uug:()=>gu,P$2:()=>u_,XS2:()=>fu,Hyb:()=>Lu,d3Y:()=>Xc,Klp:()=>Zc,WxZ:()=>c_,Gzu:()=>tc,ZOr:()=>df,uqV:()=>TE,Pm4:()=>ne,hWO:()=>et,nHA:()=>Ob,nVD:()=>ch,_tF:()=>fc,dED:()=>SE,P2h:()=>RE,jrr:()=>Po,mmY:()=>So,T6O:()=>bs,h6J:()=>RT,hM2:()=>hN,XR6:()=>z,jmz:()=>yh,IHt:()=>dh,NZI:()=>by,wdF:()=>_m,YNv:()=>Nh,IFm:()=>Ah,o_F:()=>hh,kgP:()=>Am,ZYI:()=>lT,QXK:()=>Zl,efz:()=>eu,Q5d:()=>zl,Ysv:()=>tu,UWq:()=>zd,ocC:()=>Xd,io3:()=>fn,Sbt:()=>Jo,roS:()=>Ho,Ww1:()=>Qo,QaS:()=>Rf,wsP:()=>ve,ERZ:()=>oN,CL1:()=>bN,idV:()=>np,nIW:()=>Ze,fjE:()=>Zg,sG0:()=>Fv,tV7:()=>pu,g8o:()=>L_,Qy:()=>D_,t2P:()=>Qg,KbW:()=>jo,wId:()=>Fo,LS0:()=>Mo,bFH:()=>rE,Rgl:()=>iE,fW1:()=>ub,GFW:()=>ym,Ywp:()=>_g,pg:()=>MT,WSA:()=>aE,fed:()=>EN,tT_:()=>Zs,BgZ:()=>tl,xIV:()=>rl,KbL:()=>Ef,JBA:()=>lt,aNC:()=>Eg,RFJ:()=>sT,Zeh:()=>Bm,OT5:()=>gg,mC3:()=>Hl,kR6:()=>KN,gFw:()=>hb,NVY:()=>rb,k6v:()=>ET,FEC:()=>mT,L5S:()=>eb,Ob5:()=>Cp,KUV:()=>Dp,dvH:()=>tb,V3i:()=>gO,VD3:()=>Tn,mm2:()=>oc,rou:()=>Dm,izH:()=>uo,DK$:()=>po,KMp:()=>zf,c31:()=>nr,mbo:()=>my,gT8:()=>or,CZ8:()=>Us,uGi:()=>Fs,Poc:()=>tr,_9k:()=>$s,ZTM:()=>js,bwT:()=>Ms,tzW:()=>lr,tF$:()=>ar,o96:()=>Cs,M4S:()=>xs,_vs:()=>Yf,xF8:()=>bd,PUO:()=>kh,ATu:()=>Ey,j1S:()=>Wi,V3K:()=>Vi,Lmx:()=>Gi,oSN:()=>Ji,ZaZ:()=>rr,n_1:()=>mE,N6e:()=>Qf,SxO:()=>Ro,w3p:()=>nb,xU7:()=>Te,Y_p:()=>zo,$k6:()=>Xo,Gdl:()=>xv,U6P:()=>Mv,OwB:()=>Xg,hTh:()=>ph,xqc:()=>ls,JvE:()=>us,i29:()=>jc,dzT:()=>la,uPS:()=>If,cZV:()=>wf,n3B:()=>dA,e6O:()=>oA,s7j:()=>S_,j$Q:()=>QE,kW2:()=>wb,tH7:()=>as,Yxg:()=>El,MaZ:()=>Wd,nqN:()=>Vd,jWj:()=>ey,o_J:()=>gs,yW4:()=>ST,uT0:()=>NT,C82:()=>PT,bsH:()=>bb,u9Z:()=>Cm,LCU:()=>fm,J$m:()=>EE,j_Q:()=>rf,OaI:()=>nf,wB1:()=>NN,SP6:()=>FT,ZYr:()=>gN,IMU:()=>oT,FoU:()=>qE,DVz:()=>Bv,mxe:()=>cA,FHr:()=>Gm,D1g:()=>Lm,VO3:()=>Lg,de5:()=>Dg,Uw1:()=>Oe,J6q:()=>hy,XCe:()=>_o,fbl:()=>Ag,Ir:()=>Do,XQO:()=>Lo,QXb:()=>QT,zXF:()=>mh,P8_:()=>mm,iiD:()=>Xf,MOC:()=>KT,WF:()=>JT,xE1:()=>qi,idW:()=>MN,QWZ:()=>Av,YL3:()=>Nf,NW9:()=>Uv,D_E:()=>Ee,Fn9:()=>T,j2U:()=>sl,MpE:()=>ur,kQw:()=>Er,mfm:()=>ju,vZp:()=>at,Wah:()=>gy,E8K:()=>LN,VSb:()=>ws,vr_:()=>Tr,Vmh:()=>BN,FgW:()=>vO,oDv:()=>As,fGG:()=>Nv,kuw:()=>Ps,eHk:()=>Zd,Tt2:()=>_s,pQZ:()=>Rs,oZ7:()=>Pv,T6Y:()=>Vr,_26:()=>Uu,YkM:()=>Ar,J6y:()=>mu,njU:()=>Nu,TBP:()=>Ns,IT0:()=>vy,x_:()=>Dh,FP6:()=>ct,biM:()=>bp,TMl:()=>Op,Vkd:()=>Su,WiY:()=>n_,_zi:()=>wu,RZp:()=>Hy,J6D:()=>ac,Lt4:()=>jr,QEi:()=>Sr,whI:()=>ln,KIu:()=>cn,JhM:()=>se,C_0:()=>Br,lzc:()=>jp,qIF:()=>yA,O27:()=>E,aBi:()=>Ip,xOX:()=>vl,EdS:()=>Qe,WgC:()=>Je,eEv:()=>dr,A4t:()=>Pu,YOQ:()=>st,Wos:()=>xr,jWr:()=>io,Or$:()=>_r,lhE:()=>yn,CwH:()=>Rr,pzC:()=>hl,ymH:()=>Au,QZu:()=>vr,rYH:()=>r_,FVt:()=>Mr,Kn2:()=>ce,jgw:()=>ku,Qgr:()=>ic,OXP:()=>Ss,lS4:()=>wr,g5f:()=>i_,fp6:()=>Ou,Uty:()=>ga,YkG:()=>gr,xdS:()=>sr,kMF:()=>Bp,$NE:()=>Ke,bC9:()=>He,Ian:()=>Bi,KVV:()=>Ih,q9e:()=>Ko,iIf:()=>$v,ian:()=>Nl,m6e:()=>Yr,OFd:()=>bl,kqr:()=>mr,fnZ:()=>sn,VFZ:()=>Pl,ZiX:()=>We,j5n:()=>kr,zkt:()=>_,Pcm:()=>AN,QDV:()=>ml,M5u:()=>t_,laD:()=>pA,mtq:()=>pr,CtB:()=>Vv,CBv:()=>oe,I0t:()=>Wr,u1G:()=>Hd,gk1:()=>lA,Bgb:()=>sA,uzs:()=>un,v0l:()=>hc,Zqp:()=>AE,j0k:()=>ns,l22:()=>eP,tCm:()=>rt,gmx:()=>Tu,mOr:()=>Hu,TwZ:()=>j_,GyU:()=>bg,zGm:()=>VT,bMg:()=>uE,EyD:()=>ig,FQA:()=>ag,fZN:()=>dE,xsF:()=>rg,Lxg:()=>ng,O3l:()=>jf,Wni:()=>Lf,wRx:()=>dg,OxG:()=>ZT,uJQ:()=>zT,qWg:()=>Wv,i96:()=>xT,NPd:()=>zu,zhn:()=>pg,G8q:()=>xi,Jct:()=>cd,A9Y:()=>re,Y5F:()=>zA,gxP:()=>ue,c$P:()=>Eu,M7o:()=>Yc,BBN:()=>No,fS6:()=>wd,ZBU:()=>K,UkJ:()=>xo,xkv:()=>Em,z$M:()=>xN,KAm:()=>WE,lCl:()=>rh,rkF:()=>Vy,IU6:()=>kT,RGr:()=>h,aYu:()=>m,ije:()=>lu,Buf:()=>Kf,YLu:()=>su,ct9:()=>es,XkY:()=>cE,T5R:()=>GT,uQS:()=>yE,wcJ:()=>Zo,d$I:()=>Fl,rSp:()=>hp,Sx:()=>gf,Ilm:()=>ql,Ki6:()=>_l,VGk:()=>qf,sFD:()=>Qb,eWN:()=>VN,dWE:()=>R_,Lkd:()=>ed,aDL:()=>qm,yaA:()=>fE,lOh:()=>km,DBr:()=>qg,hK$:()=>du,TZ_:()=>jT,CMB:()=>fA,FU8:()=>vf,J$p:()=>Km,b5s:()=>Qm,h2W:()=>tt,SL_:()=>wm,oUH:()=>gT,ck9:()=>WT,RAb:()=>yc,nL:()=>kv,k$p:()=>Xb,Xs0:()=>ou,u7I:()=>jm,rxg:()=>$u,bji:()=>Vu,oCZ:()=>ky,MjG:()=>Cg,FuV:()=>vT,$ju:()=>AT,t6d:()=>_T,m5F:()=>be,sx:()=>GN,rSc:()=>qv,U10:()=>af,L8n:()=>im,R9X:()=>bE,rj2:()=>Om,_C4:()=>CT,tCj:()=>hm,uAg:()=>DE,wx9:()=>Ud,KF3:()=>DT,ax9:()=>LT,HH7:()=>Jf,ufV:()=>kE,_6y:()=>Cf,XTh:()=>Pg,AJo:()=>Sf,Ixr:()=>KE,oss:()=>tP,P6Y:()=>nP,Bd_:()=>Cy,xkB:()=>Uy,W41:()=>Um,WkI:()=>Im,sSE:()=>Iy,GMd:()=>Uc,jtL:()=>Cc,Bxm:()=>Ly,FVh:()=>Ny,U_T:()=>oE,FTe:()=>ae,VGB:()=>ie,tM8:()=>Gu,Wfe:()=>Xu,Ls5:()=>Ku,$bd:()=>Bu});var n={};r.r(n),r.d(n,{normalize:()=>u,removeLineBreaks:()=>d,search:()=>c,sort:()=>p});var i={};r.r(i),r.d(i,{clearDateTime:()=>g,durationToTimestamp:()=>X,formatDate:()=>w,formatDateTime:()=>U,formatTime:()=>I,getEndOfDay:()=>S,getMomentFormatFromDateMask:()=>q,getMomentFormatFromDateTimeMask:()=>Q,getMomentFormatFromTimeMask:()=>J,getStartOfDay:()=>R,isToday:()=>_,isValidMomentDate:()=>b,isValidMomentDateOrNull:()=>O,momentToDate:()=>v,parseTimestamp:()=>K,toLocalDate:()=>A,toUtcDate:()=>N});var a={};r.r(a),r.d(a,{addAttribute:()=>Ne,editAttribute:()=>Pe,editEndDate:()=>Ce,editRoles:()=>we,editStartDate:()=>Ue,editTags:()=>Ie,removeAttribute:()=>Se});var o={};r.r(o),r.d(o,{applyCrosswalks:()=>Wh,collectCrosswalksFromAttributes:()=>qh,compareActivenessAttributes:()=>Gh,compareAttributes:()=>$h,compareImages:()=>Vh,compareRoles:()=>Jh,compareTags:()=>Hh});var s={};r.r(s),r.d(s,{createHistoryManager:()=>Xh});var l=r(17440);const u=e=>"string"==typeof e&&"function"==typeof e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e,c=(e,t)=>(t=(u(t)||"").toLowerCase(),(e=(u(e)||"").toLowerCase()).includes(t)),p=(0,l.curry)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n="asc"===e.toLowerCase();return t=t.toLowerCase(),r=r.toLowerCase(),t<r?n?-1:1:t>r?n?1:-1:0})),d=(0,l.replace)(/(\r\n|\n|\r)/gm,"");var y=r(95038),f=r.n(y);const T=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{startDate:t,endDate:r}=e,n=Date.now();return!(r&&r<n||t&&t>n)},E=(0,l.anyPass)([l.isEmpty,l.isNil]),m=e=>()=>new Promise(e),h=e=>Promise.all(e.map((e=>e.then((e=>({status:"fulfilled",value:e}))).catch((e=>({status:"rejected",reason:e})))))),b=e=>e&&e.isValid(),O=(0,l.either)(b,l.isNil),v=e=>e&&e.toDate(),g=e=>(e&&e.setHours(0,0,0,0),e),_=e=>f()(e).isSame(Date.now(),"day"),A=e=>{const t=new Date(e),r=new Date;return r.setFullYear(t.getUTCFullYear()),r.setMonth(t.getUTCMonth()),r.setDate(t.getUTCDate()),r.setHours(t.getUTCHours()),r.setMinutes(t.getUTCMinutes()),r.setSeconds(t.getUTCSeconds()),r.setMilliseconds(t.getUTCMilliseconds()),r},N=e=>{const t=new Date(e),r=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds());return new Date(r)},P=e=>(t,r)=>(r?f().utc(t):f()(t))[e]("day").valueOf(),R=P("startOf"),S=P("endOf"),w=e=>f()(e).format(f().localeData().longDateFormat("L")),I=e=>f()(e).format(f().localeData().longDateFormat("LTS")),U=e=>`${w(e)} ${I(e)}`,C=(0,l.equals)("9"),D=(0,l.equals)("99"),L=(0,l.equals)("9999"),j=(0,l.test)(/^[az][az][az]$/),k=(0,l.test)(/^[az][az][az][az]$/),F=(0,l.test)(/^9+$/),M=(0,l.test)(/^[9az]+$/),x=(0,l.cond)([[C,(0,l.always)("M")],[D,(0,l.always)("MM")],[j,(0,l.always)("MMM")],[k,(0,l.always)("MMMM")],[M,(0,l.always)("Mo")],[l.T,(0,l.always)("MM")]]),$=(0,l.cond)([[C,(0,l.always)("D")],[D,(0,l.always)("DD")],[M,(0,l.always)("Do")],[l.T,(0,l.always)("DD")]]),V=(0,l.cond)([[C,(0,l.always)("y")],[D,(0,l.always)("YY")],[L,(0,l.always)("YYYY")],[F,(0,l.always)("YYYYYY")],[l.T,(0,l.always)("YYYY")]]),G=(e,t)=>(0,l.cond)([[(0,l.both)((0,l.always)(t),C),(0,l.always)("h")],[(0,l.both)((0,l.always)(t),D),(0,l.always)("hh")],[C,(0,l.always)("H")],[D,(0,l.always)("HH")],[l.T,(0,l.always)(t?"hh":"HH")]])(e),W=(0,l.cond)([[C,(0,l.always)("m")],[D,(0,l.always)("mm")],[l.T,(0,l.always)("mm")]]),B=(0,l.cond)([[C,(0,l.always)("s")],[D,(0,l.always)("ss")],[l.T,(0,l.always)("ss")]]),Y=/([9az]+)([^9az]+)*/g,q=e=>{const t=[...e.toLowerCase().matchAll(Y)];if(E(e)||t.length>0){const[,e="",r=""]=(0,l.propOr)([],0,t),[,n="",i=""]=(0,l.propOr)([],1,t),[,a="",o=""]=(0,l.propOr)([],2,t);return(0,l.join)("",[x(e),r,$(n),i,V(a),o])}return e},H=/(9+)([^9]+)*/g,J=e=>{const t=[...e.toLowerCase().matchAll(H)];if(E(e)||t.length>0){const[,e="",r=""]=(0,l.propOr)([],0,t),[,n="",i=""]=(0,l.propOr)([],1,t),[,a="",o=""]=(0,l.propOr)([],2,t),s=(0,l.pipe)(l.last,(0,l.propOr)("",2),(0,l.test)(/^[^9]+$/))(t),u=(0,l.reject)(l.isEmpty,[G(e,s),r,W(n),i,a?B(a):"",o]),c=s?" A":"",p=(0,l.pipe)(l.init,(0,l.append)(c));return(0,l.pipe)((0,l.when)((0,l.always)(s),p),(0,l.join)(""))(u)}return e},Q=e=>{const[t="",r=""]=(0,l.pipe)((0,l.indexOf)(" "),l.inc,(0,l.splitAt)(l.__,e),(0,l.map)(l.trim))(e);return`${q(t)} ${J(r)}`},K=e=>{const t=Number(e);return Number.isNaN(t)?e:t},X=e=>{const[t,r]=e;return f()().subtract(t,r).valueOf()},z=e=>e&&0!=e.length?e.split("").map((e=>e.charCodeAt())).reduce(((e,t)=>0|(e=(e<<5)-e+t)),0)+"":"0",Z=e=>({isNone:()=>(0,l.isNil)(e),extract:()=>e,orSome:t=>(0,l.isNil)(e)?t:e,map:t=>(0,l.isNil)(e)?ee.None():ee.Some(t(e))}),ee={Some:Z,None:()=>Z(null),chain:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return e=>t.reduce(((e,t)=>e.map(t)),e)},fromFalsy:function(e){return e?ee.Some(e):ee.None()},fromNull:function(e){return null==e?ee.None():ee.Some(e)},fromUndefined:function(e){return void 0===e?ee.None():ee.Some(e)},fromEmpty:function(e){return E(e)?ee.None():ee.Some(e)}},te=(e,t)=>{let r=null;return function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];const o=()=>{e.apply(this,i),r=null};r&&clearTimeout(r),r=setTimeout(o,t)}},re=(e,t)=>(r,n)=>{const i=t?(0,l.prop)(t):l.identity;return e.indexOf(i(r))-e.indexOf(i(n))},ne=(0,l.when)((0,l.is)(Array),(0,l.prop)(0)),ie=e=>Array.isArray(e)?e:[e],ae=e=>[e],oe=e=>!!e&&["www.","http://","https://","ftp://","ftps://","smb://","data:"].some((t=>String(e).toLowerCase().startsWith(t))),se=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase()),le=e=>se(e=e||"")?`mailto:${e}`:!e.includes("://")&&(e.toLowerCase().startsWith("www.")||e.split(".").length>2)?`http://${e}`:e,ue=(0,l.when)((0,l.is)(String),(e=>""===e?void 0:"true"===e.toLowerCase())),ce=e=>null!=e&&["object","function"].includes(typeof e),pe=function(e){const t=[],r=(e,n)=>{n=n||[];for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(Array.isArray(e)&&(i=parseInt(i,10)),ce(e[i])?r(e[i],n.concat(i)):t.push(n.concat(i)))};return r(e),t};var de=r(87918),ye=r.n(de);const fe=(0,l.when)((0,l.is)(Object),JSON.stringify),Te=(e,t,r)=>{const n=[r,"errorDetailMessage","errorMessage","error"];return(0,l.cond)([[(0,l.prop)("originalResponse"),(0,l.pipe)((0,l.path)(["originalResponse","status"]),(e=>((e,t)=>{switch(e){case 400:return ye().text("Bad Request");case 403:return ye().text("Forbidden");case 404:return ye().text("Not Found");case 405:return ye().text("Method Not Allowed");case 408:return ye().text("Request Timeout");case 500:return ye().text("Internal Server Error");case 502:return ye().text("Bad Gateway");case 503:return ye().text("Service Unavailable");case 504:return ye().text("Gateway Timeout");default:return t||ye().text("Something went wrong")}})(e,t)))],...n.map((e=>[(0,l.prop)(e),(0,l.pipe)((0,l.prop)(e),fe)])),[(0,l.always)(t),(0,l.always)(t)],[l.T,fe]])(e)},Ee=e=>"AbortError"===e.name,me=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=(0,l.sum)(e);if(0===r)return[];const n=e=>+e.toFixed(t),i=e.map(((e,t)=>{const i=e/r*100,a=n(i);return{index:t,percent:a,diff:a-i}})),a=i.reduce(((e,t)=>{let{percent:r}=t;return e+r}),0);let o=n(100-a);if(0===o)return(0,l.pluck)("percent",i);const s=Math.sign(o),u=i.sort(((e,t)=>(e.diff-t.diff)*s||e.index-t.index)),c=(0===t?1:1/Math.pow(10,t))*s;for(let e=0;0!==o&&e<u.length;e++)u[e].percent=n(u[e].percent+c),o=n(o-c);return(0,l.pipe)((0,l.sortBy)((0,l.prop)("index")),(0,l.pluck)("percent"))(u)},he=/[\n\r%#()<>?[\\\]^`{}|]/g,be=e=>`data:image/svg+xml;utf8,${e.replace(/["']\);{0,}$/,"").replace(/'/g,'"').replace(/>\s{1,}</g,"><").replace(/\s{2,}/g," ").replace(he,encodeURIComponent)}`,Oe=e=>`data:image/gif;base64,${e}`,ve=e=>{switch(e){case"minutes":return ye().text("minutes");case"hours":return ye().text("hours");case"days":return ye().text("days");case"weeks":return ye().text("weeks");case"months":return ye().text("months");case"years":return ye().text("years");default:return""}};var ge=r(76665);function _e(e,t,r,n){if(null==t){const i=`\n Uri is null or undefined.\n getPartInfo parameters when the error occurred:\n 1. name - ${e}\n 2. uri - ${t}\n 3. fullUri - ${r}\n 4. attrType - ${ce(n)?JSON.stringify(n):n}\n `;console.error(i)}var i={name:e,valueUri:r.substr(0,r.indexOf(t)+t.length)};return n&&n.uri&&(i.uri=n.uri.substr(0,n.uri.indexOf(e)+e.length)),i.hasChildren=i.valueUri!==r,i}function Ae(e,t){for(var r=e.substr(e.indexOf("/attributes/")+12).split("/"),n=[],i=0;i<r.length;i+=2)n.push(_e(r[i],r[i+1],e,t));return n}function Ne(e,t,r,n,i,a,o){void 0===a&&(a=0);var s=Ae(r,t)[a];if(!s){const s=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(Ae(r,t))}\n addAttribute params when error occurred:\n attributes: ${JSON.stringify(e)}\n attrType: ${JSON.stringify(t)}\n uri: ${r}\n value: ${JSON.stringify(n)}\n crosswalks: ${JSON.stringify(i)}\n nestingLevel: ${a}\n index: ${o}\n `;console.error(s)}if(s.hasChildren){e[s.name]||(e[s.name]=[{uri:s.valueUri,value:{},type:s.uri}]);var l=e[s.name].filter((function(e){return e.uri===s.valueUri}))[0];return Ne(l.value,t,r,n,i,a+1,o)}var u=e[t.name];if(u||(u=e[t.name]=[]),null!=n){var c={value:n.refEntity?n.value:n,uri:r,type:t.uri};return n.lookupCode&&(c.value=n.value,c.lookupCode=n.lookupCode),n.refEntity&&(c.refEntity=n.refEntity,c.label=n.label),n.refRelation&&(c.refRelation=n.refRelation),i&&(c.crosswalks=i),u.splice(o||0,0,c),n}}function Pe(e,t,r,n,i,a){void 0===a&&(a=0);var o=Ae(r,t)[a];if(!o){const o=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(Ae(r,t))}\n editAttribute params when error occurred:\n attributes: ${JSON.stringify(e)}\n attrType: ${JSON.stringify(t)}\n uri: ${r}\n value: ${JSON.stringify(n)}\n crosswalks: ${JSON.stringify(i)}\n nestingLevel: ${a}\n `;console.error(o)}if(!o.hasChildren){var s,l=e[t.name],u=l&&l.filter((function(e){return e.uri===r}))[0];return u?("[object Object]"!==u.value.toString()?(Re(n,u),i&&(u.crosswalks=i),t.cardinality&&1===t.cardinality.minValue&&1===t.cardinality.maxValue&&l.filter((function(e){return!1===e.ov})).forEach(Re.bind(null,n))):n.refEntity?(u.refRelation=n.refRelation,u.refEntity=n.refEntity,u.value=n.value,u.label=n.label):null!==n.value&&void 0!==n.value&&null!==u.value&&"object"==typeof u.value&&(u.value=n.value,u.label=n.label),s=u.value):s=Ne(e,t,r,n,i,a),s}var c=Pe(e,o,o.valueUri,{},i,a);Pe(c,t,r,n,i,a+1)}function Re(e,t){ce(e)?(t.value=e.value,t.lookupCode=e.lookupCode):(t.value=e,t.lookupCode&&(t.lookupCode=e))}function Se(e,t,r,n){void 0===n&&(n=0);var i=Ae(r)[n];if(!i){const i=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(Ae(r,t))}\n removeAttribute params when error occurred:\n attributes: ${JSON.stringify(e)}\n attrType: ${JSON.stringify(t)}\n uri: ${r}\n nestingLevel: ${n}\n `;console.error(i)}if(i.hasChildren){var a=(e[i.name]||[]).filter((function(e){return e.uri===i.valueUri}))[0];a&&Se(a.value,t,r,n+1)}else{var o=e[t.name];o&&(o.forEach((function(e,t){e.uri===r&&o.splice(t,1)})),0===o.length&&delete e[t.name])}}function we(e,t){e.roles=t||[]}function Ie(e,t){e.tags=t||[]}function Ue(e,t){e.startDate=t||""}function Ce(e,t){e.endDate=t||""}var De=r(37164);const Le="1Tempo4rary",je="1Tepmo4Rel",ke=(0,l.cond)([[l.isNil,(0,l.always)("")],[(0,l.test)(/[^/]$/),(0,l.concat)(l.__,"/")]]),Fe=(0,De.kP)("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",16),Me=()=>`${Fe()}${Date.now()}`,xe=()=>`1Tempo4DCR${Me()}`,$e=e=>`${e}/uri$$${Me()}`,Ve=e=>()=>$e(e),Ge=(e,t)=>{const r=ke(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return $e(n)},We=e=>e&&e.includes("uri$$"),Be=Ve("entities"),Ye=Ve("relations"),qe=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),He=(0,l.startsWith)("relations/"),Je=(0,l.startsWith)("entities/"),Qe=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/entityTypes/")),Ke=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/relationTypes/")),Xe=(0,l.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),ze=(0,l.pipe)((0,l.split)("/"),l.head),Ze=(0,l.pipe)((0,l.split)("/"),l.last),et=e=>e.split(".").slice(0,2).join("."),tt=(e,t)=>{const[r,...n]=e.split("."),i=n.join(`/${r}/`);return`${t||""}/${r+(i&&`/${i}`)}`},rt=(0,l.curry)(((e,t)=>`${e}/attributes/${t}`)),nt=(e,t)=>{const r=e.split("/"),n=t.split("/");return 2===r.length?t:[n,r.slice(2,3),r.slice(3).map(((e,t)=>t%2?r[2]:e))].flat().slice(0,-1).join("/")},it=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},at=(0,l.either)((0,l.startsWith)("attributes."),(0,l.startsWith)("analyticsAttributes.")),ot=e=>{const t=e.startsWith("configuration/")?3:2;return e.split("/").length===t},st=e=>5===e.split("/").length,lt=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},ut=e=>e.replace(/uri\$\$/g,Le),ct=e=>e.includes("changeRequests/")&&e.includes("/changes/"),pt=e=>e.split("/changes/")[1];let dt,yt,ft,Tt,Et,mt,ht,bt,Ot,vt,gt,_t,At,Nt,Pt,Rt,St,wt,It,Ut,Ct,Dt,Lt,jt,kt,Ft,Mt,xt,$t,Vt,Gt,Wt,Bt,Yt,qt,Ht,Jt,Qt,Kt;var Xt;!function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(dt||(dt={})),function(e){e.local="local",e.validationService="validationService"}(yt||(yt={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(ft||(ft={})),function(e){e[e.OBJECT_NOT_FOUND=101]="OBJECT_NOT_FOUND",e[e.CROSSWALK_NOT_FOUND=102]="CROSSWALK_NOT_FOUND",e[e.TENANT_NOT_CONFIGURED=127]="TENANT_NOT_CONFIGURED",e[e.ACCESS_DENIED=403]="ACCESS_DENIED",e[e.DVF_NOT_CONFIGURED=902]="DVF_NOT_CONFIGURED",e[e.DCR_ALREADY_EXISTS=10015]="DCR_ALREADY_EXISTS",e[e.WORKFLOW_IS_NOT_REGISTERED_ERROR=10061]="WORKFLOW_IS_NOT_REGISTERED_ERROR"}(Tt||(Tt={})),function(e){e.WITHIN="within",e.AGO="ago",e.BETWEEN="between"}(Et||(Et={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(mt||(mt={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch",e.RELATION_ATTRIBUTE="relationAttribute"}(ht||(ht={})),function(e){e.directed="directed",e.undirected="undirected",e.bidirectional="bidirectional"}(bt||(bt={})),function(e){e.asc="asc",e.desc="desc"}(Ot||(Ot={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(vt||(vt={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(gt||(gt={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}(_t||(_t={})),function(e){e.TABLE="table",e.List="list",e.MAP="map"}(At||(At={})),function(e){e.PROFILE="profile",e.MAP="map"}(Nt||(Nt={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(Pt||(Pt={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(Rt||(Rt={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(St||(St={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(wt||(wt={})),function(e){e.EXISTS="exists",e.MISSING="missing"}(It||(It={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(Ut||(Ut={})),function(e){e.FILL_RATE="fillRate",e.LENGTH_STATISTIC="lengthStatistics",e.VALUE_DISTRIBUTION="valueDistribution",e.CROSSWALK_ANALYSIS="crosswalkAnalysis",e.DATA_VALIDATION="dataValidationFunctions",e.FREQUENCY="frequency",e.UNIQUENESS="uniqueness",e.PATTERN="pattern",e.CONSOLIDATION_RATE="consolidationRate"}(Ct||(Ct={})),function(e){e.ENTITY_TYPE="entityLevel",e.ATTRIBUTE_TYPE="attributeLevel"}(Dt||(Dt={})),function(e){e.DELETE_RELATION="DELETE_RELATION",e.CREATE_RELATION="CREATE_RELATION",e.UPDATE_RELATION="UPDATE_RELATION",e.REPOINT_RELATION="REPOINT_RELATION",e.IGNORE_RELATION="IGNORE_RELATION"}(Lt||(Lt={})),function(e){e.IN="in",e.OUT="out"}(jt||(jt={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}(kt||(kt={})),function(e){e.BAR="bar",e.DONUT="donut",e.PIE="pie",e.TREE="tree",e.TABLE="table",e.BUBBLE="bubble",e.LINE="line",e.MAP="map",e.CLOUD="cloud"}(Ft||(Ft={})),function(e){e.ActivitiesViewFacet="ActivitiesViewFacet",e.CustomActionViewFacet="CustomActionViewFacet",e.DashboardFacet="DashboardFacet",e.EntitiesByTypeViewFacet="EntitiesByTypeViewFacet",e.FilteredSavedSearchesFacet="FilteredSavedSearchesFacet",e.FilteredEntitiesViewFacet="FilteredEntitiesViewFacet",e.NotificationInboxFacet="NotificationInboxFacet",e.ProfileStatsFacet="ProfileStatsFacet"}(Mt||(Mt={})),function(e){e.Attributes="com.reltio.plugins.entity.attributes.AttributesView",e.HierarchyTree="com.reltio.plugins.react.ReactHierarchyTreeView",e.HierarchyPaths="com.reltio.plugins.entity.HierarchyPathsView",e.RelationsTable="com.reltio.plugins.react.ReactRelationshipTableView",e.Relations="com.reltio.plugins.entity.relations.RelationsView",e.SingleAttribute="com.reltio.plugins.entity.attributes.SingleAttributeView",e.AttributeTable="com.reltio.plugins.entity.attributes.AttributeTableView",e.Custom="com.reltio.plugins.ui.CustomActionView",e.Map="com.reltio.plugins.react.EntityMapView",e.ImageAttribute="com.reltio.plugins.entity.attributes.ImageAttributeView",e.PotentialMatches="com.reltio.plugins.entity.PotentialMatchesView"}(xt||(xt={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}($t||($t={})),function(e){e.DQDashboard="DQDashboardView",e.Dashboard="DashboardView",e.RelationshipSearch="RelationshipSearch",e.ProfileActivityLog="ProfileActivityLogView",e.Interactions="InteractionsView",e.Graph="GraphView",e.Relationships="RelationshipsView",e.PotentialMatches="PotentialMatchesView",e.Sources="SourcesView",e.Profile="ProfileView",e.NestedProfile="NestedProfileView",e.Search="SearchView",e.Tags="Tags",e.Pivoting="Pivoting",e.DCRReview="DCRReview"}(Vt||(Vt={})),function(e){e.CustomAction="CustomAction",e.ConsoleAppAction="ConsoleAppAction"}(Gt||(Gt={})),function(e){e.NEW="new",e.CLASSIC="classic"}(Wt||(Wt={})),function(e){e.ASC_BY_NAME="ascByName"}(Bt||(Bt={})),function(e){e.SIMPLE_NETWORK="Simple network",e.VERTICAL_TB="Vertical hierarchy",e.HORIZONTAL_LR="Horizontal hierarchy",e.DIRECTED_NETWORK="Directed Network",e.TREE="Tree"}(Yt||(Yt={})),function(e){e.SET_HTML="setHtml",e.SHOW_POPUP="showPopup",e.HIDE_POPUP="hidePopup",e.LOG="log",e.SET_VISIBILITY="setVisibility",e.MESSAGE="message",e.SET_ENABLED="setEnabled",e.SET_TOOLTIP="setToolTip",e.SET_LABEL="setLabel",e.SET_HEIGHT="setHeight",e.SET_WIDTH="setWidth",e.RETURN_PROCESSED_API_RESPONSE="returnProcessedApiResponse",e.RETURN_PROCESSED_API_REQUEST="returnProcessedApiRequest",e.REQUEST="request",e.EVENT="event"}(qt||(qt={})),function(e){e.WORKFLOW="workflow",e.WORKFLOW_START_PROCESS_FROM_QUERY="workflow/startProcessFromQuery",e.API="api",e.GET_ENTITY_URI="getEntityUri",e.GET_ENTITY="getEntity",e.GET_API_PATH="getApiPath",e.WORKFLOW_GET_WORKFLOW_PATH="workflow/getWorkflowPath",e.GET_SEARCH_QUERY="getSearchQuery",e.GET_TENANT="getTenant",e.GET_USER="getUser",e.GET_PERSPECTIVE="getPerspective",e.SET_PERSPECTIVE="setPerspective",e.SET_ENTITY_URI="setEntityUri",e.ALERT="alert",e.CONFIRM="confirm",e.PROMPT="prompt",e.OPEN_WINDOW="openWindow",e.GET_CONFIGURATION="getConfiguration",e.GET_UI_CONFIGURATION="getUiConfiguration",e.OPEN_SEARCH="openSearch",e.WORKFLOW_CHECK_PERMISSION="workflow/checkPermission",e.RELOAD_PAGE="reloadPage"}(Ht||(Ht={})),function(e){e.INSERT_ATTRIBUTE="INSERT_ATTRIBUTE",e.UPDATE_ATTRIBUTE="UPDATE_ATTRIBUTE",e.DELETE_ATTRIBUTE="DELETE_ATTRIBUTE",e.PIN_ATTRIBUTE="PIN_ATTRIBUTE",e.IGNORE_ATTRIBUTE="IGNORE_ATTRIBUTE",e.CREATE_ENTITY="CREATE_ENTITY",e.CREATE_RELATIONSHIP="CREATE_RELATIONSHIP",e.UPDATE_TAGS="UPDATE_TAGS",e.UPDATE_ROLES="UPDATE_ROLES",e.UPDATE_START_DATE="UPDATE_START_DATE",e.UPDATE_END_DATE="UPDATE_END_DATE",e.UPDATE_PROFILE_PIC_BY_URL="UPDATE_PROFILE_PIC_BY_URL",e.UPDATE_PROFILE_PIC_BY_URI="UPDATE_PROFILE_PIC_BY_URI",e.DELETE_RELATIONSHIP="DELETE_RELATIONSHIP"}(Jt||(Jt={})),function(e){e.AWAITING_REVIEW="AWAITING_REVIEW",e.APPLIED="APPLIED",e.REJECTED="REJECTED"}(Qt||(Qt={})),function(e){e.ADDED="added",e.EDITED="edited",e.DELETED="deleted",e.PINNED="pinned",e.IGNORED="ignored",e.PIN_DELETED="pin_deleted",e.IGNORE_DELETED="ignore_deleted"}(Kt||(Kt={})),function(e){e.TYPE_STRING="String",e.TYPE_TEXT="Text",e.TYPE_PASSWORD="Password",e.TYPE_LONG="Long",e.TYPE_INT="Int",e.TYPE_DOLLAR="Dollar",e.TYPE_FLOAT="Float",e.TYPE_DOUBLE="Double",e.TYPE_NUMBER="Number",e.TYPE_BOOLEAN="Boolean",e.TYPE_BOOLEAN_RADIO="Boolean_Radio",e.TYPE_DATE="Date",e.TYPE_TIMESTAMP="Timestamp",e.TYPE_ACTIVENESS_DATE="ActivenessDate",e.TYPE_LOCAL_DATE="LocalDate",e.TYPE_BLOB="Blob",e.TYPE_ENUM="Enum",e.TYPE_CIK_ID="cik id",e.TYPE_LOOKUP="Lookup",e.TYPE_TYPEAHEAD="Typeahead",e.TYPE_URL="URL",e.TYPE_BLOG_URL="Blog URL",e.TYPE_IMAGE_URL="Image URL",e.TYPE_EMAIL="Email",e.TYPE_DEPENDENT_LOOKUP="DependentLookup",e.TYPE_ENTITY_ID="EntityId",e.TYPE_RDM_LOOKUPS_NOT_RESOLVED="RdmLookupsNotResolved",e.TYPE_COUNT="Count",e.TYPE_FILE="File",e.TYPE_SELECT="Select",e.TYPE_NESTED="Nested",e.TYPE_REFERENCE="Reference",e.TYPE_IMAGE="Image",e.TYPE_SSN="SSN"}(Xt||(Xt={}));const zt=Xt;let Zt,er;!function(e){e.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}(Zt||(Zt={})),function(e){e.Saving="Saving",e.Cloning="Cloning"}(er||(er={}));const tr=(0,l.prop)("referencedEntityTypeURI"),rr=(0,l.prop)("relationshipTypeURI"),nr=(0,l.prop)("referencedAttributeURIs"),ir=(0,l.curry)(((e,t)=>(0,l.pipe)(nr,(0,l.filter)((0,l.startsWith)(e)))(t))),ar=ir("configuration/relationTypes"),or=ir("configuration/entityTypes"),sr=(0,l.pipe)((0,l.prop)("uri"),(0,l.startsWith)("configuration/relationTypes")),lr=(0,l.filter)(sr),ur=(e,t)=>!t||t.some((t=>Xe(e.uri,t)));function cr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pr=(0,l.allPass)([(0,l.propSatisfies)((0,l.either)(l.isNil,Qe),"uri"),(0,l.prop)("faceted"),(0,l.propEq)("type",zt.TYPE_STRING)]),dr=(0,l.has)("values"),yr=(0,l.cond)([[(0,l.has)("dependentLookupCode"),(0,l.always)(zt.TYPE_DEPENDENT_LOOKUP)],[(0,l.has)("lookupCode"),(0,l.always)(zt.TYPE_LOOKUP)],[dr,(0,l.always)(zt.TYPE_ENUM)],[pr,(0,l.always)(zt.TYPE_TYPEAHEAD)],[(0,l.propEq)("type",zt.TYPE_BOOLEAN),(0,l.always)(zt.TYPE_BOOLEAN_RADIO)],[l.T,(0,l.prop)("type")]]),fr=(0,l.pipe)((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){cr(e,t,r[t])}))}return e}({},e,{type:yr(e)})),(0,l.pick)(["type","values","lookupCode","uri","dependentLookupCode","singleValue"])),Tr=e=>!!e&&(!!e.autoGenerated&&e.type!==zt.TYPE_NESTED||!!e.parentAutoGenerated),Er=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.test)(/\/analyticsAttributes\//)),mr=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.startsWith)("configuration/"),l.not),hr=e=>Er(e)?"analyticsAttributes":"attributes",br=(0,l.propEq)("hidden",!0),Or=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("type")),(0,l.equals)(e))(t))),vr=Or(zt.TYPE_NESTED),gr=Or(zt.TYPE_REFERENCE),_r=Or(zt.TYPE_IMAGE),Ar=(0,l.either)(vr,gr),Nr=(e,t)=>{const r=Er(e)?"analyticsAttributes":"attributes",n=e.split(`/${r}/`);return[r,...Array.isArray(t)?[...(0,l.chain)((0,l.prop)("name"),t),(0,l.last)(n)]:[...n.slice(1)]].join(".")},Pr=(0,l.either)((0,l.prop)("lookupCode"),(0,l.prop)("dependentLookupCode")),Rr=(0,l.pipe)(Pr,Boolean),Sr=(0,l.pipe)((0,l.prop)("dependentLookupCode"),Boolean),wr=(0,l.both)(Rr,(0,l.pipe)(Pr,("rdm",(0,l.pipe)(ze,(0,l.equals)("rdm")))));const Ir=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=hr({uri:t}),i=e=>e.split(`/${n}/`).length,a=(e.entityTypes||[]).concat(e.relationTypes||[]),o=r?a.find((0,l.propEq)("uri",r)):null,s=o?i(o.uri):0,u=(r,i)=>{const o=t.split(`/${n}/`).slice(0,i+1).join(`/${n}/`),s=(0,l.last)(o.split(`/${n}/`)),c=(r?r[n]||Cr(e,r)||[]:a).find((e=>{let{uri:t,name:r}=e;return t===o||r===s})),p=c?[c]:[];return c&&o!==t&&p.push(...u(c,i+1)),p},c=u(o,s),p=c.length===i(t)-s;return p?c:[]},Ur=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=Ir(e,t,r);return n.length?(0,l.last)(n):null},Cr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{entityTypes:[]},t=arguments.length>1?arguments[1]:void 0;return(0,l.cond)([[(0,l.has)("analyticsAttributes"),(0,l.prop)("analyticsAttributes")],[(0,l.anyPass)([(0,l.propEq)("type",zt.TYPE_NESTED),(0,l.propEq)("type",zt.TYPE_IMAGE)]),(0,l.prop)("attributes")],[(0,l.propEq)("type",zt.TYPE_REFERENCE),(0,l.pipe)(nr,(0,l.map)((t=>Ur(e,t))),(0,l.reject)(l.isNil))],[l.T,(0,l.always)(null)]])(t)},Dr=[zt.TYPE_ACTIVENESS_DATE,zt.TYPE_DATE,zt.TYPE_TIMESTAMP,zt.TYPE_LOCAL_DATE],Lr=[zt.TYPE_ACTIVENESS_DATE,zt.TYPE_TIMESTAMP,zt.TYPE_LOCAL_DATE],jr=e=>Dr.includes(e),kr=e=>Lr.includes(e),Fr=[zt.TYPE_INT,zt.TYPE_LONG,zt.TYPE_NUMBER,zt.TYPE_FLOAT,zt.TYPE_DOUBLE,zt.TYPE_COUNT],Mr=e=>Fr.includes(e),xr=e=>[zt.TYPE_FLOAT,zt.TYPE_DOUBLE].includes(e),$r=[zt.TYPE_BOOLEAN,zt.TYPE_BOOLEAN_RADIO,zt.TYPE_RDM_LOOKUPS_NOT_RESOLVED],Vr=e=>$r.includes(e),Gr=[zt.TYPE_URL,zt.TYPE_BLOG_URL,zt.TYPE_IMAGE_URL],Wr=e=>Gr.includes(e),Br=Or(zt.TYPE_EMAIL),Yr=e=>zt.TYPE_SSN===e;var qr,Hr=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(qr||(qr={}));const Jr=(0,l.curry)(((e,t,r)=>{var n;const i=e===qr.READ?["ROLE_UI_ALL","ROLE_UI_ALL_READONLY"]:["ROLE_UI_ALL"],a=null===(n=r[e])||void 0===n?void 0:n.roles;return!a||a.concat(i).some((e=>t.includes(e)))})),Qr=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),Kr=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),Qr),Xr=(0,l.pipe)((0,l.reject)(E),Kr);function zr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Zr(e,t,r[t])}))}return e}function Zr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const en=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r={dcrObjectUris:[],dcrUri:t},n=e=>e&&e.includes("changeRequest"),i=(0,l.propSatisfies)(n,"uri"),a=(0,l.pipe)((0,l.prop)("changes"),l.keys),o=(0,l.when)(i,(0,l.applySpec)({dcrObjectUris:a,dcrUri:(0,l.prop)("uri")})),s=e=>{let{dcrObjectUris:t,dcrUri:n}=e;r.dcrObjectUris=r.dcrObjectUris.concat(t),r.dcrUri=r.dcrUri||n},u=(0,l.pipe)(o,s,(()=>E())),c=(0,l.pipe)((0,l.prop)("dcrUri"),(0,l.unless)(l.isNil,(0,l.pipe)((0,l.split)("/"),(0,l.prop)(1)))),p=(e,t)=>(e+=e.includes("?")?"&":"?")+Qr(t),d=t=>{const n=c(r);return n?p(t,{changeRequestId:n}):e?p(t,{alwaysCreateDCR:!0}):t},y=()=>r.dcrObjectUris,f=()=>r.dcrUri;let T,E=l.identity;const m=()=>!e||f()||T?T||Promise.resolve():(T=new Promise((e=>{E=e})),Promise.resolve());return{updateDCRUriFromResponse:u,enhanceUriWithDCR:d,getDCRObjectUris:y,getDCRUri:f,getDcrUriAwait:m}},tn=e=>t=>{if(!(e=>!ce(e.value))(t)){var r;const n=`${e}/${null!==(r=t.refEntity)&&void 0!==r&&r.objectURI?Ze(t.refEntity.objectURI):xe()}`;return zr({},t,{uri:n,value:(0,l.fromPairs)((0,l.map)(rn(n),(0,l.toPairs)(t.value)))})}return zr({},t,{uri:`${e}/${xe()}`})},rn=e=>t=>{let[r,n]=t;return[r,(0,l.map)(tn(`${e}/${r}`),n)]},nn=e=>{const{uri:t}=e;return(0,l.evolve)({attributes:(0,l.pipe)(l.toPairs,(0,l.map)(rn(`${t}/attributes`)),l.fromPairs)},e)},an=e=>(0,l.evolve)({changes:(0,l.map)((0,l.map)((0,l.when)((0,l.propEq)("type",Jt.CREATE_ENTITY),(0,l.evolve)({newValue:nn}))))},e),on={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},sn=(0,l.equals)(on.SUGGESTING),ln=(0,l.equals)(on.EDITING),un=(0,l.equals)(on.VIEWING),cn=(0,l.either)(ln,sn),pn=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),dn=(0,l.curry)(((e,t)=>(0,l.pipe)(pn(e),(0,l.prop)("extendsTypeURI"))(t))),yn=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(dn(e,r)));return n(r)})),fn=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=dn(e,n);return r})),Tn=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?Tn(e,pn(e,t.extendsTypeURI),r):void 0,En=(e,t)=>{const r=t.map(fn(e));return(r.length?r.reduce(l.intersection):[])[0]},mn=(e,t)=>Tn(e,(0,l.is)(Object,t)?t:pn(e,t),"typeImage"),hn=(e,t)=>e.entityTypes.reduce(((r,n)=>n.uri!==t&&yn(e,t,n.uri)?r.concat(n.uri):r),[]),bn={EQUALS:"equals",NOT_EQUALS:"not equals",EXISTS:"exists",FULL_TEXT:"fullText",HAS_ALL:"hasAll",MISSING_VALUE:"missing",IN_RANGE:"range",LT:"lt",LTE:"lte",GT:"gt",GTE:"gte",STARTS_WITH:"startsWith",COUNT_EQUALS:"count.equals",COUNT_NOT_EQUALS:"count.not.equals",COUNT_LT:"count.less",COUNT_LTE:"count.less.or.equals",COUNT_GT:"count.greater",COUNT_GTE:"count.greater.or.equals",COUNT_RANGE:"count.range",IN_FILE:"in.file",NOT_IN_FILE:"not.in.file",CONTAINS:"contains",ON:"on",BEFORE:"before",AFTER:"after",WITHIN:"within"},On={LIST_EQUALS:"listEquals",NOT_LIST_EQUALS:"not listEquals",LIST_EQUALS_CASE_SENSITIVE:"listEqualsCaseSensitive",NOT_LIST_EQUALS_CASE_SENSITIVE:"not listEqualsCaseSensitive"},vn={[bn.EQUALS]:"equals",[bn.NOT_EQUALS]:"not",[bn.STARTS_WITH]:"starts with",[bn.MISSING_VALUE]:"missing value",[bn.IN_RANGE]:"in range",[bn.HAS_ALL]:"has all",[bn.FULL_TEXT]:"full text",[bn.EXISTS]:"exists",[bn.COUNT_EQUALS]:"count equals",[bn.COUNT_NOT_EQUALS]:"count not equal",[bn.COUNT_LT]:"count less",[bn.COUNT_LTE]:"count less or equal",[bn.COUNT_GT]:"count greater",[bn.COUNT_GTE]:"count greater or equal",[bn.COUNT_RANGE]:"count in range",[bn.LT]:"less than",[bn.LTE]:"less than or equal",[bn.GT]:"greater than",[bn.GTE]:"greater than or equal",[bn.IN_FILE]:"in file",[bn.NOT_IN_FILE]:"not in file",[bn.CONTAINS]:"contains",[bn.ON]:"on",[bn.BEFORE]:"before",[bn.AFTER]:"after",[bn.WITHIN]:"within"},gn="in",_n="notIn",An="not range",Nn=e=>({[gn]:bn.EQUALS,[_n]:bn.NOT_EQUALS}[e]||e);var Pn,Rn;!function(e){e.LAST_DAY="lastDay",e.LAST_WEEK="lastWeek",e.LAST_MONTH="lastMonth",e.LAST_6MONTHS="last6Months",e.LAST_YEAR="lastYear",e.PICK_DATE="pickDate"}(Pn||(Pn={})),function(e){e.LAST_3DAYS="last3Days"}(Rn||(Rn={}));const Sn=["LAST_DAY","LAST_3DAYS","LAST_WEEK","LAST_MONTH","LAST_6MONTHS","LAST_YEAR","PICK_DATE"].reduce(((e,t)=>(e[t]=Pn[t]||Rn[t],e)),{}),wn={[Pn.LAST_DAY]:"Last 24 hours",[Rn.LAST_3DAYS]:"Last 3 days",[Pn.LAST_WEEK]:"Last 7 days",[Pn.LAST_MONTH]:"Last month",[Pn.LAST_6MONTHS]:"Last 6 months",[Pn.LAST_YEAR]:"Last year",[Pn.PICK_DATE]:"Pick date"},In={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},Un={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},Cn="<No label>",Dn="__number",Ln={IN:"in",OUT:"out"};function jn(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){kn(e,t,r[t])}))}return e}function kn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Fn={startDate:{type:zt.TYPE_ACTIVENESS_DATE,get label(){return ye().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:zt.TYPE_ACTIVENESS_DATE,get label(){return ye().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},Mn=jn({id:{type:zt.TYPE_ENTITY_ID,get label(){return ye().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},Fn,{roles:{type:zt.TYPE_STRING,get label(){return ye().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:zt.TYPE_STRING,get label(){return ye().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),xn={workflow:{type:zt.TYPE_STRING,get label(){return ye().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:zt.TYPE_STRING,get label(){return ye().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:zt.TYPE_STRING,get label(){return ye().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:zt.TYPE_TIMESTAMP,get label(){return ye().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},$n={commenter:{type:zt.TYPE_STRING,get label(){return ye().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},Vn={notResolved:{type:zt.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return ye().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},Gn={createdBy:{type:zt.TYPE_STRING,get label(){return ye().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:zt.TYPE_STRING,get label(){return ye().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:zt.TYPE_TIMESTAMP,get label(){return ye().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:zt.TYPE_TIMESTAMP,get label(){return ye().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},Wn={matches:{type:zt.TYPE_COUNT,get label(){return ye().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:zt.TYPE_COUNT,get label(){return ye().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0}},Bn={sourceSystems:{type:zt.TYPE_STRING,get label(){return ye().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:zt.TYPE_STRING,get label(){return ye().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:zt.TYPE_INT,get label(){return ye().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:zt.TYPE_TIMESTAMP,get label(){return ye().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:zt.TYPE_TIMESTAMP,get label(){return ye().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:zt.TYPE_TIMESTAMP,get label(){return ye().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:zt.TYPE_TIMESTAMP,get label(){return ye().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:zt.TYPE_TIMESTAMP,get label(){return ye().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:zt.TYPE_STRING,get label(){return ye().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}};let Yn;!function(e){e.matchRules="matchRules",e.MLRecommendedMatch="MLRecommendedMatch"}(Yn||(Yn={}));const qn={[Yn.matchRules]:{type:zt.TYPE_STRING,get label(){return ye().text("Match Rules")},uri:Yn.matchRules,name:Yn.matchRules,faceted:!0,hideForDataTenant:!0},[Yn.MLRecommendedMatch]:{type:zt.TYPE_STRING,get label(){return ye().text("Match IQ")},uri:Yn.MLRecommendedMatch,name:Yn.MLRecommendedMatch,faceted:!0,hideForDataTenant:!0}},Hn=jn({},Mn,xn,$n,Vn,Gn,Wn,Bn,qn,{type:{type:zt.TYPE_STRING,get label(){return ye().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}}),Jn="NOT_MATCH";var Qn=r(13980),Kn=r.n(Qn);function Xn(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){zn(e,t,r[t])}))}return e}function zn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zn=Kn().oneOf(["mobile","tablet","desktop"]),ei=Kn().shape({deviceTypes:Kn().oneOfType([Zn,Kn().arrayOf(Zn)]),roles:Kn().arrayOf(Kn().string)}),ti=Kn().shape({value:Kn().string,lookupCode:Kn().string}),ri=Kn().shape({link:Kn().string,filename:Kn().string}),ni=Kn().shape({displayName:Kn().string,parent:Kn().string}),ii=Kn().oneOfType([Kn().string,Kn().number,Kn().bool,ti]),ai=Kn().oneOfType([ii,Kn().arrayOf(ii)]),oi=Kn().shape({fieldName:Kn().string,values:Kn().arrayOf(ai),filter:Kn().string,type:Kn().string}),si=Kn().shape({minValue:Kn().number,maxValue:Kn().number}),li=Kn().shape({label:Kn().string,name:Kn().string,description:Kn().string,type:Kn().string,hidden:Kn().bool,faceted:Kn().bool,searchable:Kn().bool,uri:Kn().string,access:Kn().arrayOf(Kn().string),cardinality:si}),ui=Kn().shape({label:Kn().string,uri:Kn().string,typeColor:Kn().string,direction:Kn().string,startObject:Kn().object,endObject:Kn().object}),ci=Kn().shape({typeColor:Kn().string,typeIcon:Kn().string,typeImage:Kn().string,label:Kn().string,uri:Kn().string,attributes:Kn().arrayOf(li)}),pi=Kn().shape({uri:Kn().string,label:Kn().string,memberTypes:Kn().array,extendsTypeUri:Kn().string,attributes:Kn().arrayOf(li)}),di=Kn().shape({uri:Kn().string,label:Kn().string,extendsTypeUri:Kn().string,relationshipTypeURIs:Kn().arrayOf(Kn().string)}),yi=Kn().shape({uri:Kn().string,description:Kn().string,label:Kn().string,schemaVersion:Kn().string,entityTypes:Kn().arrayOf(ci),roles:Kn().arrayOf(Kn().object),groupTypes:Kn().arrayOf(Kn().object),relationTypes:Kn().arrayOf(ui),graphTypes:Kn().arrayOf(di),interactionTypes:Kn().arrayOf(pi),sources:Kn().arrayOf(Kn().object)}),fi=Kn().shape({uri:Kn().string,type:Kn().string}),Ti=Kn().shape({uri:Kn().string,attributes:Kn().object,type:Kn().string,timestamp:Kn().number,members:Kn().object}),Ei=Kn().shape({uri:Kn().string,type:Kn().string}),mi=Kn().shape({value:Kn().object,ov:Kn().bool,type:Kn().string,uri:Kn().string}),hi=Kn().shape({refEntity:Kn().oneOfType([Kn().array,Kn().object]),refRelation:Kn().oneOfType([Kn().array,Kn().object]),value:Kn().object,ov:Kn().bool,type:Kn().string,uri:Kn().string}),bi=Kn().oneOf((0,l.values)(on)),Oi=Kn().shape({type:Kn().oneOf(Object.values(dt)).isRequired,attributeTypeUri:Kn().string.isRequired,parentUri:Kn().string.isRequired,uri:Kn().string,message:Kn().string}),vi={attributeType:li,showEmptyEditors:Kn().bool,lazy:Kn().bool,mode:bi,metadata:yi,ownError:Oi,errors:Kn().arrayOf(Oi),crosswalks:Kn().array,onAddAttributes:Kn().func,onAddOneMore:Kn().func,onDeleteAttribute:Kn().func,onChangeAttribute:Kn().func,additionalControlsRenderer:Kn().func,hideDeleteButton:Kn().bool,showNonOv:Kn().bool,state:Kn().oneOf(["deleted","edited"]),expanded:Kn().bool},gi=Xn({attributeValue:mi},vi),_i=Xn({attributeValue:hi},vi),Ai=Kn().shape({value:Kn().oneOfType([Kn().string,Kn().bool,Kn().number]),ov:Kn().bool,type:Kn().string,uri:Kn().string,lookupCode:Kn().string,lookupRawValue:Kn().string}),Ni=Kn().shape({totalOvValues:Kn().number,totalValues:Kn().number}),Pi=Kn().shape({inRelations:Kn().arrayOf(Kn().oneOfType([Kn().object,Kn().string])),outRelations:Kn().arrayOf(Kn().oneOfType([Kn().object,Kn().string])),groups:Kn().arrayOf(Kn().string),entityTypes:Kn().arrayOf(Kn().string),nextEntry:Kn().object}),Ri=Kn().oneOf(["asc","desc"]),Si=Kn().shape({id:Kn().string,content:Pi,allowOnlyCreateNew:Kn().bool,sortColumn:Kn().string,sortOrder:Ri,"text-empty":Kn().string,max:Kn().number,icon:Kn().string,caption:Kn().string,canCreate:ei,canRead:ei,canUpdate:ei,canDelete:ei,editingEnabled:Kn().bool}),wi=Kn().shape({id:Kn().string,caption:Kn().string,pageSize:Kn().number,icon:Kn().string,canCreate:ei,canRead:ei,canUpdate:ei,canDelete:ei,attributes:Kn().object}),Ii=Kn().shape({entityUri:Kn().string,entityType:Kn().string,entityLabel:Kn().string,object:fi}),Ui=Kn().shape({relationUri:Kn().string,relationType:Kn().string,relationLabel:Kn().string,direction:Kn().string,object:Ei}),Ci=Kn().shape({entity:Ii,relation:Ui}),Di=Kn().shape({value:Kn().string,isRawFilter:Kn().bool}),Li=Kn().shape({id:Kn().string,label:Kn().string,name:Kn().string,availableEntityTypes:Kn().array}),ji=Kn().shape({id:Kn().string,allowMergeAll:Kn().bool,matchActions:Kn().object,availableTabs:Kn().arrayOf(Kn().oneOf(["findMatches","potentialMatches","notAMatch"]))}),ki=Kn().shape({matchRules:Kn().arrayOf(Kn().string),object:fi,shortestTransitiveMatchPath:Kn().arrayOf(Kn().shape({matchRules:Kn().arrayOf(Kn().string),match:Kn().string})),direct:Kn().bool,matchScore:Kn().number}),Fi=Kn().arrayOf(ki),Mi=Kn().arrayOf(Kn().shape({uri:Kn().string,label:Kn().string})),xi=[{label:ye().text("And"),value:"and"},{label:ye().text("Or"),value:"or"},{label:ye().text("And not"),value:"and not"},{label:ye().text("Or not"),value:"or not"}];function $i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vi=(0,l.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Gi=(0,l.pipe)(Vi,(0,l.propOr)("","label")),Wi=(0,l.curry)(((e,t)=>{const r=Vi(e,t);return[(0,l.path)(["startObject","objectTypeURI"],r),(0,l.path)(["endObject","objectTypeURI"],r)]})),Bi=(0,l.curry)(((e,t,r)=>{const[n,i]=Wi(e,r);return yn(e,n,t)||yn(e,i,t)})),Yi=(0,l.pipe)((0,l.propOr)([],"relationTypes"),(0,l.reduce)(((e,t)=>{let{uri:r,label:n}=t;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){$i(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),qi=function(){let{reversedContextLabels:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={},r=r=>n=>{let{label:i}=n;const a=r===(e?Ln.OUT:Ln.IN)?"startObject":"endObject",{directionalContext:o}=n[a];return"directed"===n.direction&&1===(0,l.propOr)(0,"length",o)&&(i+=` (${o[0].labelPattern})`),!(i in t)&&(t[i]=!0,!0)},n=r(Ln.IN),i=r(Ln.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},Hi=(0,l.pathOr)("",["directionalContext",0,"labelPattern"]),Ji=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?Ji(e,Vi(e,t.extendsTypeURI),r):void 0,Qi={CREATE:"CREATE",READ:"READ",UPDATE:"UPDATE",DELETE:"DELETE",INITIATE_CHANGE_REQUEST:"INITIATE_CHANGE_REQUEST",MERGE:"MERGE",UNMERGE:"UNMERGE"},Ki=(0,l.curry)(((e,t)=>e.every((e=>Xi(e,t))))),Xi=(0,l.curry)(((e,t)=>{const r=Tr(t);return zi(e,t)&&(e===Qi.READ||!r)})),zi=(e,t)=>!t||!t.access||t.access.includes(e),Zi=(0,l.curry)(((e,t,r)=>Xi(Qi.READ,r)&&(sn(t)?Xi(Qi.INITIATE_CHANGE_REQUEST,r):Xi(e,r)))),ea=Zi(Qi.CREATE),ta=Zi(Qi.DELETE),ra=Zi(Qi.UPDATE),na=Ki([Qi.CREATE,Qi.MERGE,Qi.READ,Qi.UPDATE]),ia=Ki([Qi.UPDATE,Qi.READ,Qi.CREATE]),aa=Ki([Qi.UPDATE,Qi.READ]),oa=Ki([Qi.DELETE,Qi.UPDATE,Qi.READ]),sa=(0,l.curry)(((e,t,r)=>e[r]||e[((e,t)=>(0,l.pipe)((0,l.propOr)([],"matchGroups"),(0,l.find)((0,l.propEq)("uri",t)),(0,l.defaultTo)({}),(0,l.prop)("type"))(e))(t,r)]||e["*"])),la=(e,t,r)=>(0,l.pipe)((0,l.map)(sa(e,t)),(0,l.filter)(l.identity))(r),ua=(e,t,r)=>{const n=la(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&Xi(Qi.MERGE,r)},ca=(0,l.curry)(((e,t,r,n)=>{const i=Vi(e,n),[a,o]=Wi(e,n);return i&&Xi(Qi.CREATE,i)&&yn(e,a,t.type)&&yn(e,o,r.type)})),pa=(e,t,r,n,i)=>{const a=pn(e,n.type),o=la(t,a,r).map((e=>{let{createRelation:t}=e;return t})).filter(l.identity);return o.some((t=>{let{inRelations:r=[],outRelations:a=[]}=t;return r.some(ca(e,n,i))||a.some(ca(e,i,n))}))},da=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=pn(e,r.type),o=(0,l.propOr)({},"matchActions",t);return{canMerge:ua(o,i,a),canAddRelation:pa(e,o,i,r,n),canMark:Xi(Qi.UPDATE,a)&&Xi(Qi.READ,a)}},ya=(e,t,r,n)=>(0,l.pipe)((0,l.map)((n=>da(e,t,n.object,r,n.matchRules))),(0,l.reduce)((0,l.mergeWith)(l.and),{}))(n),fa=Er,Ta=(0,l.complement)(fa),Ea=Xi(Qi.READ),ma=e=>{let{attributeType:t,mode:r}=e;return Ta(t)&&ea(r,t)&&!br(t)},ha=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=We(r.uri),o=ra(n),s=ea(n);return(0,l.cond)([[fa,l.F],[(0,l.always)(a),l.T],[(0,l.always)(i),o],[l.T,(0,l.allPass)([o,s])]])(t)},ba=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=We(r.uri),s=ra(n),u=ta(n),c=va(Qi.UPDATE,n,a,r),p=va(Qi.DELETE,n,a,r);return(0,l.cond)([[fa,l.F],[(0,l.always)(o),l.T],[(0,l.always)(i),(0,l.allPass)([u,p])],[l.T,(0,l.allPass)([s,u,c,p])]])(t)},Oa=(0,l.curry)(((e,t,r,n)=>{const i="Reference"!==n.type&&Cr(t,n);return!i||!(0,l.pipe)((0,l.unless)(Array.isArray,l.of),(0,l.map)((0,l.prop)("value")))(r).some((r=>i.filter((e=>r&&!!r[e.name])).some((n=>!zi(e,n)||!Oa(e,t,r[n.name],n)))))})),va=(0,l.curry)(((e,t,r,n,i)=>sn(t)?Oa(Qi.INITIATE_CHANGE_REQUEST,r,n,i):Oa(e,r,n,i))),ga=(0,l.both)((0,l.complement)(br),Ea),_a="SuperUser",Aa="allTenants",Na=[Aa,"allCustomers"],Pa=e=>{let{allowedPermissionsNames:t,permissionsNames:r,permissionsConfig:n,superUserEnvironments:i}=e;return t.map((e=>{switch(e){case r.NON_SECURED:return l.T;case r.SECURED:return e=>void 0!==e.userPermissions||void 0!==(null==e?void 0:e.roles);case r.ADMIN:return(e=>t=>((null==t?void 0:t.roles)||[]).includes(e))(r.ADMIN);default:return(t=n[e])?(e,r)=>{let{params:n}=r;return((e,t,r,n)=>{const i=(0,l.path)(["userPermissions","permissions"],e)||{};return Object.keys(i).filter((e=>{const t=e.split(":"),[n]=t;return n===r.serviceId||n===_a})).filter((e=>{const t=e.split(":"),[i,a=""]=t;let o=a.split(".");return o=(0,l.endsWith)(["*"],o)?o.slice(0,-1):o,(0,l.startsWith)(o,r.resourcePath)||((e,t,r)=>{if(e===_a){const e=r?Na.concat(r.map((e=>`allTenants.${e}`))):Na,n=r&&t[0]===Aa?t.slice(0,2):t.slice(0,1);return e.map((e=>e.split("."))).some((e=>(0,l.startsWith)(n,e)))}})(i,o,n)})).some((e=>{const n=i[e];return r.privileges.every((e=>{const r=n[e],i=Array.isArray(r);return t?Array.isArray(r)&&r.some((e=>t=>t===e||"SuperUser:*"===t||t.startsWith("SuperUser:allTenants"))(t)):i}))}))})(e,n.tenant,t,i)}:l.F}var t}))},Ra={NON_SECURED:"NON_SECURED",SECURED:"SECURED",ADMIN:"ROLE_ADMIN",CAN_EXPORT:"CAN_EXPORT",CAN_EXPORT_ACTIVITIES:"CAN_EXPORT_ACTIVITIES",CAN_IMPORT_ENTITIES_FROM_DT:"CAN_IMPORT_ENTITIES_FROM_DT",CAN_READ_ENTITIES_FROM_DT:"CAN_READ_ENTITIES_FROM_DT",CAN_START_PROCESS_INSTANCE_SEARCH_QUERY:"CAN_START_PROCESS_INSTANCE_SEARCH_QUERY",CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY:"CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY",CAN_CREATE_ENVIRONMENT_CONFIG_JAR:"CAN_CREATE_ENVIRONMENT_CONFIG_JAR",CAN_CREATE_CONFIG_JAR:"CAN_CREATE_CONFIG_JAR",CAN_VIEW_ENVIRONMENT_CONFIG_JAR:"CAN_VIEW_ENVIRONMENT_CONFIG_JAR",CAN_VIEW_CONFIG_JAR:"CAN_VIEW_CONFIG_JAR",CAN_MANAGE_WORKFLOW_DEFINITION:"CAN_MANAGE_WORKFLOW_DEFINITION",CAN_VIEW_WORKFLOW_DEFINITION:"CAN_VIEW_WORKFLOW_DEFINITION",CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION:"CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION",CAN_UPDATE_WORKFLOW_DATA_TASK:"CAN_UPDATE_WORKFLOW_DATA_TASK",CAN_READ_WORKFLOW_DATA_TASK:"CAN_READ_WORKFLOW_DATA_TASK",CAN_CONFIG_ENVIRONMENT_REGISTER:"CAN_CONFIG_ENVIRONMENT_REGISTER",CAN_UPDATE_PROCESS_INSTANCE:"CAN_UPDATE_PROCESS_INSTANCE",CAN_EXECUTE_WORKFLOW_JOBS:"CAN_EXECUTE_WORKFLOW_JOBS",CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE:"CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE",CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS:"CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS",CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS:"CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS",CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA:"CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA",CAN_VIEW_WORKFLOW_JOBS:"CAN_VIEW_WORKFLOW_JOBS",CAN_MAKE_BULK_UPDATE:"CAN_MAKE_BULK_UPDATE",CAN_OPEN_DATA_LOADER_EXECUTE:"CAN_OPEN_DATA_LOADER_EXECUTE",CAN_OPEN_DATA_LOADER_READ:"CAN_OPEN_DATA_LOADER_READ",CAN_BULK_DELETE_PROFILES:"CAN_BULK_DELETE_PROFILES",CAN_READ_MDM_DATA_ENTITIES:"CAN_READ_MDM_DATA_ENTITIES",IS_FREEMIUM_ADMIN:"IS_FREEMIUM_ADMIN",CAN_READ_DVF:"CAN_READ_DVF",CAN_READ_PREFERENCES:"CAN_READ_PREFERENCES",CAN_UPDATE_PREFERENCES:"CAN_UPDATE_PREFERENCES",CAN_CREATE_PREFERENCES:"CAN_CREATE_PREFERENCES",CAN_DELETE_PREFERENCES:"CAN_DELETE_PREFERENCES"},Sa={[Ra.CAN_DELETE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["DELETE"]},[Ra.CAN_CREATE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["CREATE"]},[Ra.CAN_UPDATE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["UPDATE"]},[Ra.CAN_READ_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["READ"]},[Ra.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[Ra.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activities"],privileges:["EXECUTE"]},[Ra.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[Ra.CAN_READ_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ"]},[Ra.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[Ra.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[Ra.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[Ra.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[Ra.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[Ra.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[Ra.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[Ra.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[Ra.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[Ra.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[Ra.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[Ra.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[Ra.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[Ra.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[Ra.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[Ra.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[Ra.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[Ra.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[Ra.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[Ra.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[Ra.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[Ra.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[Ra.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[Ra.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[Ra.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]},[Ra.CAN_READ_DVF]:{serviceId:"DVF",resourcePath:["functionsManagement"],privileges:["READ"]}},wa=(0,l.curry)(((e,t,r)=>Pa({allowedPermissionsNames:e,permissionsNames:Ra,permissionsConfig:Sa}).some((e=>e(t,{params:{tenant:r}}))))),Ia=wa([Ra.CAN_EXPORT]),Ua=wa([Ra.CAN_EXPORT_ACTIVITIES]),Ca=wa([Ra.CAN_IMPORT_ENTITIES_FROM_DT]),Da=wa([Ra.CAN_READ_ENTITIES_FROM_DT]),La=wa([Ra.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),ja=wa([Ra.CAN_UPDATE_PROCESS_INSTANCE]),ka=wa([Ra.CAN_VIEW_WORKFLOW_DEFINITION]),Fa=wa([Ra.CAN_CONFIG_ENVIRONMENT_REGISTER]),Ma=wa([Ra.CAN_UPDATE_WORKFLOW_DATA_TASK]),xa=wa([Ra.CAN_READ_WORKFLOW_DATA_TASK]),$a=wa([Ra.CAN_MANAGE_WORKFLOW_DEFINITION]),Va=wa([Ra.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),Ga=wa([Ra.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),Wa=wa([Ra.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),Ba=wa([Ra.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),Ya=wa([Ra.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),qa=wa([Ra.CAN_EXECUTE_WORKFLOW_JOBS]),Ha=wa([Ra.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),Ja=wa([Ra.CAN_CREATE_CONFIG_JAR]),Qa=wa([Ra.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),Ka=wa([Ra.CAN_VIEW_CONFIG_JAR]),Xa=wa([Ra.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),za=wa([Ra.CAN_VIEW_WORKFLOW_JOBS]),Za=wa([Ra.CAN_MAKE_BULK_UPDATE]),eo=wa([Ra.CAN_OPEN_DATA_LOADER_EXECUTE,Ra.CAN_OPEN_DATA_LOADER_READ]),to=wa([Ra.CAN_BULK_DELETE_PROFILES]),ro=wa([Ra.CAN_READ_MDM_DATA_ENTITIES]),no=wa([Ra.CAN_READ_DVF]),io=wa([Ra.IS_FREEMIUM_ADMIN]),ao=(0,l.reject)(br),oo=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),ao,(0,l.filter)(e))(t),so=(0,l.curry)(((e,t)=>oo((t=>ma({attributeType:t,mode:e})),t))),lo=(0,l.curry)(((e,t)=>oo((t=>ma({attributeType:t,mode:e})||ga(t)),t))),uo=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(ga)),co=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...co(e)])))),po=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(ga),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...po(e)])))),yo=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...yo(e)])))),fo=(0,l.pipe)(pn,(0,l.converge)(l.concat,[po,yo]));function To(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Eo(e,t,r[t])}))}return e}function Eo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mo=(0,l.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,mo(e)))},t))),ho=e=>{var t;return To({},e,{matchGroups:(0,l.uniq)((e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[]))})},bo=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),Oo=(0,l.when)(bo,(0,l.dissoc)("values")),vo=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return To({},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["lookupCode"]),{dependentLookupCode:t})})),go=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},_o=(0,Hr.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(co,t).concat((0,l.chain)(co,r)).some(go)})),Ao=e=>{let t=!1;const r=mo((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?To({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},No=e=>{const t=_o(e),r=(0,l.map)((e=>mo((0,l.pipe)(Oo,(0,l.when)((0,l.always)(e),vo))))(t)),n=(0,l.map)(ho),i=(0,l.map)(Ao);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},Po=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Ro=(0,l.prop)("relationshipTypeURIs"),So=(0,l.curry)(((e,t)=>{var r;return(null===(r=e.graphTypes)||void 0===r?void 0:r.filter(wo(e,t)))||[]})),wo=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return null==n?void 0:n.some(Bi(e,t))},Io=(e,t)=>(0,l.pipe)(Po,(0,l.defaultTo)({}),Ro,(0,l.defaultTo)([]),(0,l.chain)(Wi(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(pn(e)))(e,t),Uo=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),Co=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),Do=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Co((0,l.complement)(Uo))(e)},Lo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Co(Uo)(e)},jo=(0,l.pipe)(pn,(0,l.propOr)([],"matchGroups")),ko=(e,t,r)=>(0,l.pipe)(jo,(0,l.find)((0,l.propEq)("uri",r)))(e,t),Fo=(0,l.curry)(((e,t,r)=>(0,l.pipe)(ko,(0,l.propOr)(r,"label"))(e,t,r))),Mo=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(jo,(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),(0,l.includes)(l.__,r))))(e,t),i=(0,l.pipe)((0,l.map)((0,l.prop)("uri")),(0,l.without)(l.__,r),(0,l.map)((e=>({uri:e,label:e}))))(n);return[...n,...i]})),xo=e=>(0,l.partition)(Uo,e),$o=(0,l.includes)(l.__,["and","or","not"]),Vo=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),Go=(0,l.includes)(l.__,["equals","notEquals","in"]),Wo=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return $o(t)?Wo(r):Vo(t)?r.filter(Qe):Go(t)?r.map((0,l.prop)("uri")).filter(Qe):[]})),l.uniq),Bo=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)(Wo),l.uniq),Yo=(0,l.pipe)(jo,Bo),qo=(0,l.pipe)(Mo,Bo),Ho=(e,t)=>{let{interactionTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},Jo=(0,l.pipe)(Ho,po),Qo=(e,t)=>(e.interactionTypes||[]).filter(((e,t)=>r=>{let{memberTypes:n}=r;return n.some(((e,t)=>r=>{let{objectTypeURI:n}=r;return n===t||yn(e,n,t)})(e,t))})(e,t)),Ko=e=>!!e.required,Xo=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity;const i=(0,l.cond)([[Qe,pn(e)],[Ke,Vi(e)]])(t);return zo(e,i,r,n)},zo=(e,t,r,n)=>!t||t.hidden&&!(e=>e.uri&&Qe(e.uri)&&3===e.uri.split("/").length)(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!Tr(e))).flatMap((t=>{const i=t.required?[t]:[];if(r){let a;if(t.type===zt.TYPE_REFERENCE){const i=rr(t),o=nr(t);a=Xo(e,i,r,n).filter((e=>o.some(Xe(e.uri))))}else t.attributes&&(a=zo(e,t,r,n));a&&i.push(...a)}return i.filter((e=>e===t?n(e):n(e,t)))})):t.type===zt.TYPE_REFERENCE?Xo(e,rr(t),r,n):[],Zo=e=>{const t=(0,l.pipe)((0,l.pick)(["dataLabelPattern","dataTooltipPattern","secondaryLabelPattern"]),l.values,(0,l.filter)(l.identity))(e);return(0,l.filter)((0,l.anyPass)([e=>{const r=`{${e.name}.`,n=`{${e.name}}`;return(0,l.any)((0,l.anyPass)([(0,l.includes)(n),(0,l.includes)(r)]),t)},t=>(e.businessCardAttributeURIs||[]).includes(t.uri),Ko]),e.attributes||[])},es=(e,t)=>{const r=or(e);return(0,l.pipe)((0,l.filter)((e=>r.includes(e.uri))),(0,l.sort)((n=r,(e,t)=>n.indexOf(e.uri)-n.indexOf(t.uri))))(t.attributes||[]);var n},ts=(0,l.curry)(((e,t)=>{const r=(t,n)=>{if(Array.isArray(n))return n.map((e=>r(t,e)));if(n&&"object"==typeof n){const e={};for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=r(t,n[t]));return e}return"string"==typeof n&&e.includes(t)?ye().text(n):n};return r(null,t)})),rs=["label","description","abbreviation","caption","toolTip"],ns=e=>ts(rs,e),is=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=Ze(t);return r.find((e=>{let{uri:t}=e;return Ze(t)===n}))})),as=(0,l.curry)(((e,t)=>{const r=Ze(t);return(0,l.pipe)(is(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),os=e=>{let{sources:t}=e;return(null==t?void 0:t.find((0,l.propEq)("uri","configuration/sources/Reltio")))?t:null==t?void 0:t.concat({uri:"configuration/sources/Reltio",label:"Reltio",icon:"images/source/reltio.png",abbreviation:"Reltio"})},ss=(e,t)=>{let{sources:r=[]}=e;return r.find((e=>{let{uri:r,label:n}=e;return r===t||n===t||r.substring(r.lastIndexOf("/")+1)===t}))},ls=(0,l.curry)(((e,t)=>{let{roles:r}=e;return(0,l.pipe)((0,l.find)((0,l.propEq)("uri",t)),(0,l.prop)("label"))(r)})),us=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=pn(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));function cs(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){ps(e,t,r[t])}))}return e}function ps(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ds=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:["attributes"];const i=n.reduce(((e,r)=>e.concat(t[r]||[])),[]);return ys(i,e,t,r,n)},ys=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:["attributes"];return ee.fromNull(e&&e.length?e:Cr(t,r)).map((e=>e.map((e=>{const r=ds(t,e,n,i);return r.length?cs({},e,{children:r}):e})))).orSome([]).filter((0,l.either)((0,l.complement)(Ar),(0,l.prop)("children"))).filter(ga).filter(n).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},fs=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return ds(e,t,r,["attributes","analyticsAttributes"])},Ts=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return ds(e,t,r,["attributes"])},Es=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return ds(e,t,r,["analyticsAttributes"])},ms=e=>e.children?e.children.flatMap(ms):e,hs=e=>e.children?[e,...e.children.flatMap(hs)]:e,bs=(0,l.curry)(((e,t)=>{let{groupTypes:r}=e;return(0,l.pipe)((0,l.find)((0,l.propEq)("uri",t)),(0,l.prop)("label"))(r)})),Os=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return Ze(r)===e})))),vs=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),Os("LUD")),(0,l.defaultTo)(r))(t||[])},gs=(e,t)=>{let{survivorshipStrategies:r}=e;return Os(t,r)},_s=(0,l.allPass)([(0,l.complement)(l.isNil),Xi(Qi.READ)]),As=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),Xi(Qi.READ)]),Ns=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),(0,l.anyPass)([Xi(Qi.CREATE),Xi(Qi.INITIATE_CHANGE_REQUEST)])]),Ps=(0,l.curryN)(2,(0,l.pipe)(pn,As)),Rs=(0,l.curryN)(2,(0,l.pipe)(Vi,_s)),Ss=e=>{let{ov:t}=e;return!1!==t},ws=(e,t)=>((e,t)=>Wr(e.type)&&oe(t))(e,t)||((e,t)=>Br(e.type)&&se(t))(e,t),Is=(0,l.curry)(((e,t)=>(0,l.cond)([[l.isNil,(0,l.always)(null)],[(0,l.pipe)((0,l.prop)(e),Array.isArray),(0,l.path)([e,0])],[l.T,(0,l.prop)(e)]])(t))),Us=Is("refEntity"),Cs=Is("refRelation"),Ds=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],Ls=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},js=(0,l.prop)("objectURI"),ks=(0,l.prop)("objectURI"),Fs=(0,l.prop)("type"),Ms=(0,l.pipe)(Us,(0,l.defaultTo)({}),js),xs=(0,l.pipe)(Cs,(0,l.defaultTo)({}),ks),$s=(0,l.pipe)(Us,(0,l.defaultTo)({}),Fs),Vs=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type})));return(e||[]).concat(r)},Gs=(0,l.evolve)({refEntity:ne,refRelation:ne}),Ws=(e,t,r,n)=>{const i=Ir(e,r),a=pn(e,t.type)||Vi(e,t.type);if(0===i.length)return null;const o=hr(r);let s=[t],u=1;i[0].uri!==t.type&&(u=0);let c=null;const p=n?[]:null;let d=null;for(let e=u;e<i.length;++e){const t=e===i.length-1,r=i[e];let u=[];if(!ur(r,d)){c=n?[]:null;break}Array.isArray(s)&&(s.forEach((s=>{const c=s.value||s[o]||{};let y=[];r.startObject&&r.endObject||(0,l.both)(ot,Ke)(r.uri)?(y=((null==a?void 0:a.attributes)||[]).filter((e=>rr(e)===r.uri||tr(e)===r.uri)),d=y.reduce(((e,t)=>{const r=t.referencedAttributeURIs&&t.referencedAttributeURIs.filter((function(t){return-1===e.indexOf(t)}));return r?e.concat(r):e}),[])):(y.push(r),d=null),y.forEach((a=>{const o=c[a.name];o&&(u=u.concat(o)),n&&t&&p.push({attrValues:o||[],parent:s,attrType:r,parentType:i[e-1],typePath:i})}))})),s=u),t&&(c=s)}return p||c},Bs=(e,t)=>{const[r,n,...i]=t.split("/"),a=(e[r]||[]).find((e=>{let{uri:t}=e;return t.endsWith("/"+n)})),o=i.join("/");return o&&a?Bs(a.value,o):a},Ys=(0,l.curry)(((e,t)=>{if(!t.startsWith(e.uri))return;const[r,...n]=t.slice(e.uri.length+1).split("/"),i=n.join("/");return Bs(e[r],i)})),qs=(0,l.cond)([[(0,l.has)("lookupCode"),(0,l.pick)(["value","lookupCode"])],[(0,l.has)("refEntity"),(0,l.pick)(["refEntity","label","value"])],[l.T,(0,l.prop)("value")]]),Hs=(0,l.cond)([[(0,l.has)("lookupCode"),(0,l.pick)(["value","lookupCode","ov"])],[(0,l.has)("refEntity"),(0,l.pick)(["refEntity","label","value","ov"])],[l.T,(0,l.pick)(["value","ov"])]]),Js=(0,l.cond)([[(0,l.has)("lookupCode"),(0,l.pick)(["value","lookupCode","uri"])],[(0,l.has)("refEntity"),(0,l.pick)(["refEntity","label","value","uri"])],[l.T,(0,l.pick)(["value","uri"])]]),Qs=(0,l.curry)(((e,t,r)=>{const[n,...i]=t;return(0,l.pipe)((0,l.defaultTo)({}),(0,l.propOr)([],n),(t=>e?t.filter(e):t),(0,l.when)((()=>i.length>0),(0,l.pipe)((0,l.map)((0,l.prop)("value")),(0,l.map)(Qs(e,i)))))(r)})),Ks=(0,l.curry)(((e,t)=>(0,l.ifElse)((0,l.is)(Array),(0,l.map)(Ks(e)),e)(t))),Xs=(0,l.curry)(((e,t,r,n)=>(0,l.pipe)(Qs(e,r),Ks(t))(n))),zs=Xs(null,qs),Zs=Xs(Ss,qs),el=Xs(null,Hs),tl=Xs(Ss,Hs),rl=Xs(Ss,Js),nl=(e,t,r)=>{var n,i,a;return e.uri===t?null==e||null===(n=e.attributes)||void 0===n?void 0:n[r]:null===(i=Ys(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},il=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(Ms,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{}),al=(e,t)=>{const r=lt(t),n=(0,l.pipe)((0,l.split)("/"),(0,l.dropLast)(1),l.last)(t);return nl(e,r,n)},ol=Object.values(Fn),sl=(0,l.includes)(l.__,ol),ll=e=>ol.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,l.assoc)(n,e[n],t):t}),{});function ul(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){cl(e,t,r[t])}))}return e}function cl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pl=(e,t)=>`${e}_${t}`,dl=[Hn.matches.name,Hn.matchRules.name],yl=(0,l.values)(xn).map((e=>e.name)),fl=e=>(0,l.when)((0,l.always)(!e),(0,l.reject)((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,yl)))),Tl=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,dl)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>pl(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),El=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,l.pipe)(l.values,fl(r),Tl(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(pl(`dtPotentialMatches.${t.name}`,"")))))(Hn)},ml=(0,l.propEq)("uri",Hn.type.uri),hl=e=>(0,l.values)(qn).some((0,l.propEq)("uri",null==e?void 0:e.uri)),bl=(0,l.propEq)("uri",Bn.sourceSystems.uri),Ol=Object.values(Mn),vl=(0,l.includes)(l.__,Ol),gl=e=>{let{entity:t,attributeType:r,value:n}=e;return ul({},t,{[r.uri]:void 0===n?r.defaultValue:n})},_l=e=>{let{entity:t,attributeType:r}=e;return(0,l.dissoc)(r.uri,t)},Al=e=>{let{entity:t,attributeType:r,value:n}=e;return ul({},t,{[r.uri]:n})},Nl=(0,l.propEq)("uri",Mn.roles.uri),Pl=(0,l.propEq)("uri",Mn.tags.uri);function Rl(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){Sl(e,t,r[t])}))}return e}function Sl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wl=e=>{let{parentUri:t,attributeType:r}=e;return Rl({uri:Ge(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,l.propOr)("","defaultValue",e);return(0,l.cond)([[(0,l.either)(Ar,_r),(0,l.always)({value:{}})],[Rr,()=>t?{value:"",lookupCode:t}:{value:""}],[(0,l.both)((0,l.propEq)("defaultValue","now"),(0,l.pipe)((0,l.prop)("type"),jr)),(0,l.always)({value:Date.now()})],[l.T,(0,l.always)({value:t})]])(e)})(r))},Il=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)(so(i),(0,l.filter)((0,l.anyPass)([(0,l.has)("defaultValue"),Sr,(0,l.propEq)("required",!0)])))(t),o={};for(const e of a){const{name:t}=e,a=wl({parentUri:r,attributeType:e});let s=Cr(n,e);s&&(e.type===zt.TYPE_REFERENCE&&(s=lr(s)),a.value=Il({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(!(0,l.isEmpty)(a.value)||Boolean(a.lookupCode)||Sr(e))&&(o[t]=[a])}return o},Ul=e=>{let{entity:t,metadata:r,mode:n}=e;return Xo(r,t.type,!0).reduce(((e,t)=>{const i=t.name,a=lt(t.uri);return(a===e.type?[{parentUri:e.uri,attributes:e.attributes}]:(Ws(r,e,a)||[]).map((e=>{let{value:t,uri:r}=e;return{parentUri:r,attributes:t}}))).reduce(((e,a)=>{let{parentUri:o,attributes:s}=a;if(!s[i]||0===s[i].length){let i=Ll({entity:e,attributeType:t,parentUri:o,index:0});if(Ar(t)){const e=Cr(r,t),a=vr(t)?e:lr(e);i=Cl({attributeType:t,subAttributes:a,metadata:r,mode:n},i)}return i}return e}),e)}),t)},Cl=(0,l.curry)(((e,t)=>{let{attributeType:r,subAttributes:n,metadata:i,mode:a}=e;const o=Ws(i,t,r.uri)[0],s=Rl({},o,{value:Il({attributeTypes:n,parentUri:o.uri,mode:a,metadata:i})});return kl({entity:t,attributeType:r,uri:o.uri,value:s})})),Dl=(0,l.curry)(((e,t)=>{let{metadata:r,attributeTypes:n,parentUri:i,mode:a}=e;const o=n.filter((e=>{let{name:r}=e;return!t[r]})),s=(0,l.mapObjIndexed)(((e,t)=>{const{type:i,attributes:o}=n.find((e=>t===e.name));return e.map((e=>{const{value:t,uri:n}=e;return i===zt.TYPE_NESTED?Rl({},e,{value:Dl({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return Rl({},s(t),Il({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),Ll=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=wl({parentUri:n,attributeType:r}),u=qs(l);return(0,ge.ZP)(t,(e=>{Ne(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},jl=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,ge.ZP)(t,(e=>{Ne(e.attributes||e.value,r,n.uri,qs(n),a,o,i)}))},kl=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,ge.ZP)(t,(e=>{Pe(e.attributes||e.value,r,n,i,a,o)}))},Fl=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,ge.ZP)(t,(e=>{Se(e.attributes||e.value,r,n,i)}))},Ml=e=>""===e,xl=(0,l.cond)([[(0,l.propSatisfies)((0,l.complement)((0,l.anyPass)([Ml,l.isNil])),"lookupCode"),l.F],[(0,l.propSatisfies)((0,l.anyPass)([Ml,l.isNil]),"value"),l.T],[(0,l.both)((0,l.propSatisfies)(l.isEmpty,"value"),(0,l.propSatisfies)((0,l.either)(l.isNil,l.isEmpty),"refEntity")),l.T],[l.T,l.F]]),$l=(0,l.reject)(xl),Vl=e=>{let{deleteEmptyComplex:t,valueTransformer:r=l.identity}=e;return(0,l.pipe)((0,l.map)((0,l.pipe)((0,l.map)((0,l.pipe)(r,(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(e=>Vl({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),$l)),(0,l.when)((0,l.always)(t),(0,l.reject)(l.isEmpty)))},Gl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Vl({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),Gs),deleteEmptyComplex:e})},Wl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)(Gl(e),(0,l.reject)(l.isEmpty))},Bl=(0,l.curry)(((e,t)=>t.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:i}=t;return sl(r)?gl({entity:e,attributeType:r}):Ll({entity:e,attributeType:r,parentUri:n,index:i})}),e))),Yl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n,value:i}=t;return sl(r)?Al({entity:e,attributeType:r,value:i}):kl({entity:e,attributeType:r,uri:n,value:i})})),ql=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n}=t;return sl(r)?_l({entity:e,attributeType:r}):Fl({entity:e,attributeType:r,uri:n})})),Hl=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.pipe)((0,l.filter)((0,l.pipe)((0,l.pathOr)([],["roles"]),(0,l.either)((0,l.propEq)("length",0),(0,l.any)((e=>t.includes(e)))))),(0,l.map)((0,l.pathOr)([],["attributes"])),l.flatten)(e)},Jl="UrlThumbnail",Ql="CdnUrlThumbnail",Kl=(0,l.curry)(((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(Ss):(0,l.head)(n);return e&&e.value}return null})),Xl=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>Kl(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),zl=Xl(["CdnUrl","Url"],!0),Zl=Xl(["CdnUrlPreview","UrlPreview"],!0),eu=Xl([Ql,Jl],!0),tu=Xl([Ql,Jl]),ru=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,l.cond)([[mr,(0,l.always)(t)],[(0,l.both)(Er,(0,l.always)(i)),(0,l.always)(i)],[l.T,(0,l.always)(n)]])(a),s=mr(a)?"uri":"name",u=(0,l.pipe)((0,l.prop)(a[s]),(0,l.when)((0,l.both)((0,l.always)(sl(a)),(e=>null===e)),(0,l.always)([""])),(0,l.defaultTo)([]),ie)(o);return(0,l.when)((0,l.always)(r(u,a)),(0,l.append)({attrType:a,values:u}),e)}),[])},nu=(e,t,r)=>{const n=uo(e),i=(0,l.any)(r?l.T:Ss);return ru(n,t,i)},iu=(e,t,r,n,i,a)=>{const o=We(null==r?void 0:r.uri)?so(t,e):lo(t,e);return ru(o,r,((e,o)=>{const s=ma({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:Ss,e)||mr(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let au;const ou=e=>{au=e};function su(e,t){return au(e,t)}const lu=e=>(t,r)=>new Promise(((n,i)=>{e(t,r,(e=>{n(e)}),((e,t)=>{i((0,l.when)((0,l.is)(String),(0,l.always)({errorMessage:e,errorCode:t}))(e))}),null)})),uu=50,cu=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=uu,offset:a=0}=e;return su("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i,offset:a}),headers:{"Content-Type":"application/json"}})},pu=(0,l.once)((()=>su("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),du=e=>su("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),yu=(e,t)=>su("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),fu=e=>ee.fromNull(vn[e]).map(ye().text).orSome(""),Tu=(0,l.curry)(((e,t)=>`${e}_${t}`)),Eu=(0,l.split)("_"),mu=(0,l.includes)("_"),hu=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),bu=(0,l.curry)(((e,t)=>e.some(hu(t)))),Ou=bu([bn.IN_RANGE,bn.COUNT_RANGE,bn.WITHIN]),vu=bu([bn.EXISTS,bn.MISSING_VALUE]),gu=(0,l.cond)([[vu,(0,l.always)(0)],[Ou,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),_u=(0,l.complement)(vu),Au=bu([bn.HAS_ALL,bn.EQUALS,bn.NOT_EQUALS]),Nu=bu([bn.COUNT_EQUALS,bn.COUNT_NOT_EQUALS,bn.COUNT_LT,bn.COUNT_LTE,bn.COUNT_GT,bn.COUNT_GTE,bn.COUNT_RANGE]),Pu=bu([bn.IN_FILE,bn.NOT_IN_FILE]),Ru=e=>{switch(e){case bn.COUNT_EQUALS:return bn.EQUALS;case bn.COUNT_NOT_EQUALS:return bn.NOT_EQUALS;case bn.COUNT_LT:return bn.LT;case bn.COUNT_LTE:return bn.LTE;case bn.COUNT_GT:return bn.GT;case bn.COUNT_GTE:return bn.GTE;case bn.COUNT_RANGE:return bn.IN_RANGE}},Su=bu([bn.ON,bn.BEFORE,bn.AFTER,bn.WITHIN,bn.NOT_EQUALS]),wu=bu([bn.WITHIN]),Iu=[[bn.COUNT_EQUALS,bn.COUNT_NOT_EQUALS,bn.COUNT_LT,bn.COUNT_LTE,bn.COUNT_GT,bn.COUNT_GTE],[bn.NOT_IN_FILE,bn.IN_FILE],[bn.EQUALS,bn.NOT_EQUALS,bn.HAS_ALL],[bn.LT,bn.LTE,bn.GT,bn.GTE],[bn.MISSING_VALUE,bn.EXISTS],[bn.COUNT_RANGE],[bn.IN_RANGE],[bn.STARTS_WITH,bn.CONTAINS],[bn.FULL_TEXT],[bn.ON,bn.BEFORE,bn.AFTER,bn.NOT_EQUALS],[bn.WITHIN]],Uu=(e,t)=>Iu.some((r=>r.includes(e)&&r.includes(t))),Cu=(0,l.pipe)(l.omit,l.values),Du={OPTIONS_FOR_STRING:Cu(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],bn),OPTIONS_FOR_DATE:[bn.ON,bn.BEFORE,bn.AFTER,bn.WITHIN,bn.NOT_EQUALS,bn.MISSING_VALUE,bn.EXISTS,bn.COUNT_EQUALS,bn.COUNT_NOT_EQUALS,bn.COUNT_LT,bn.COUNT_LTE,bn.COUNT_GT,bn.COUNT_GTE,bn.COUNT_RANGE,bn.IN_FILE,bn.NOT_IN_FILE],OPTIONS_FOR_BOOLEAN:Cu(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],bn),OPTIONS_FOR_BLOB:Cu(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],bn),OPTIONS_FOR_NUMBER:Cu(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],bn),OPTIONS_FOR_LOOKUP:Cu(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],bn),OPTIONS_FOR_ENUM:Cu(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],bn),OPTIONS_FOR_ID:[bn.EQUALS,bn.NOT_EQUALS,bn.IN_FILE,bn.NOT_IN_FILE],OPTIONS_FOR_COUNT:[bn.EQUALS,bn.NOT_EQUALS,bn.LT,bn.LTE,bn.GT,bn.GTE,bn.IN_RANGE],OPTIONS_FOR_COMPLEX:[bn.COUNT_EQUALS,bn.COUNT_NOT_EQUALS,bn.COUNT_LT,bn.COUNT_LTE,bn.COUNT_GT,bn.COUNT_GTE,bn.COUNT_RANGE,bn.EXISTS,bn.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[bn.EQUALS,bn.NOT_EQUALS,bn.EXISTS,bn.MISSING_VALUE]},Lu=e=>{const{type:t,singleValue:r=!1}=e,n=(e=>{switch(e){case zt.TYPE_TYPEAHEAD:case zt.TYPE_STRING:case zt.TYPE_PASSWORD:case zt.TYPE_TEXT:case zt.TYPE_CIK_ID:case zt.TYPE_URL:case zt.TYPE_BLOG_URL:case zt.TYPE_IMAGE_URL:case zt.TYPE_EMAIL:return Du.OPTIONS_FOR_STRING;case zt.TYPE_LOOKUP:case zt.TYPE_DEPENDENT_LOOKUP:return Du.OPTIONS_FOR_LOOKUP;case zt.TYPE_ENUM:return Du.OPTIONS_FOR_ENUM;case zt.TYPE_DATE:case zt.TYPE_ACTIVENESS_DATE:case zt.TYPE_TIMESTAMP:case zt.TYPE_LOCAL_DATE:return Du.OPTIONS_FOR_DATE;case zt.TYPE_BOOLEAN:case zt.TYPE_BOOLEAN_RADIO:return Du.OPTIONS_FOR_BOOLEAN;case zt.TYPE_BLOB:return Du.OPTIONS_FOR_BLOB;case zt.TYPE_LONG:case zt.TYPE_INT:case zt.TYPE_FLOAT:case zt.TYPE_DOUBLE:case zt.TYPE_NUMBER:return Du.OPTIONS_FOR_NUMBER;case zt.TYPE_ENTITY_ID:return Du.OPTIONS_FOR_ID;case zt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[bn.EQUALS];case zt.TYPE_COUNT:return Du.OPTIONS_FOR_COUNT;case zt.TYPE_NESTED:case zt.TYPE_REFERENCE:case zt.TYPE_IMAGE:return Du.OPTIONS_FOR_COMPLEX;default:return Du.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(Nu,n):n},ju=e=>[gt.and,gt.andNot].includes(e),ku=e=>[gt.or,gt.orNot].includes(e),Fu=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),ku)),Mu=(xu=[gt.and],e=>e.slice(0,-1).every((e=>xu.includes(e.operator))));var xu;const $u=e=>e.map(((e,t,r)=>{const n=0===t;return(0,l.assoc)("operator",n?null:r[t-1].operator,e)}),[]),Vu=e=>e.map(((e,t,r)=>{const n=t===r.length-1;return(0,l.assoc)("operator",n?null:r[t+1].operator,e)}),[]),Gu=e=>`(${e})`,Wu=e=>{const t=[],r={"{":"}","[":"]","(":")"},n=(0,l.invertObj)(r);for(let i=0;i<e.length;i++){const a=e[i];if(r[a])t.push(a);else if(n[a]&&r[t.pop()]!==a)return!1}return 0===t.length},Bu=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=[gt.or,gt.orNot],n=t?[gt.and,gt.andNot,...r]:r,i=n.map((e=>` ${e} `)).some((t=>e.includes(t))),a=e.startsWith("not"),o="("===(0,l.head)(e)&&")"===(0,l.last)(e)&&Wu(e.slice(1,-1));return!i&&!a||o?e:Gu(e)},Yu="and",qu=class{constructor(){this.clauses=[]}addClause(e){return e&&(this.clauses=this.clauses.concat(e)),this}build(){return this.clauses.join(" and ")}orBuild(){return`(${this.clauses.join(" or ")})`}buildWithOperators(e){return this.clauses.reduce(((t,r,n)=>{const i=0===t.length,a=(0,l.propOr)(Yu,n,e),o=(e=>[gt.andNot,gt.orNot].includes(e))(a)?Bu(r):r;return i?o:`${t} ${a} ${o}`}),"")}},Hu=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),Ju=e=>Array.isArray(e)?e.map(Ju).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),Qu=(0,l.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),Ku=e=>`'${e}'`,Xu=e=>`"${e}"`,zu=e=>(0,l.pipe)((0,l.map)(e),(0,l.join)(" or ")),Zu=(0,l.pipe)(Ju,Qu),ec=(0,l.pipe)(Zu,Ku),tc=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.allPass)([(0,l.always)(Ou(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[l.T,l.identity]])(t))),rc=(e,t)=>Nu(t)?{type:zt.TYPE_INT}:Pu(t)?{type:zt.TYPE_FILE}:Su(t)&&!wu(t)&&kr(e.type)?{type:zt.TYPE_LOCAL_DATE}:e,nc=Object.values(Sn),ic=e=>!Object.values(Sn).includes(e),ac=e=>nc.includes(e),oc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:wn;return ye().text(t[e])},sc=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.values(Pn),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:wn;return e.map((e=>({value:e,get label(){return oc(e,t)}})))},lc=e=>{const t=f()().startOf("minute");switch(e){case Pn.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case Pn.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case Pn.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case Pn.LAST_6MONTHS:return[f()(t).subtract(6,"months").valueOf(),t.valueOf()];case Pn.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()];case Rn.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()];default:return e}},uc=e=>{let[t,r]=e;return[f()(t).valueOf(),f()(r).endOf("date").valueOf()]},cc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:lc;return(0,l.is)(String,e)?t(e):uc(e)};let pc;!function(e){e.CurrentUser="currentUser"}(pc||(pc={}));const dc={},yc=(e,t)=>{dc[e]=t},fc=e=>dc[e];function Tc(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){Ec(e,t,r[t])}))}return e}function Ec(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mc=e=>e.split("{CurrentUser}").join(fc(pc.CurrentUser)||""),hc=(0,l.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),bc=(0,l.curry)(((e,t,r)=>{const n=r.map(Ou(e)||t.endsWith(".count")?Zu:ec).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),Oc=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},vc=e=>{let{filter:t,fieldName:r,values:n}=e;const i=gu(t);return(0,l.pipe)(Oc(i),(0,l.map)(bc(t,r)),hc(" or "))(n)},gc=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(ec).join(",")})`},_c=e=>`*${e}*`,Ac=e=>`URL:${e}`,Nc=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,Pc=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===bn.IN_FILE?r:`not ${r}`},Rc=(e,t)=>[R(e,t),S(e,t)],Sc=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!wc(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case bn.ON:return Tc({},e,n?{filter:bn.EQUALS}:{filter:bn.IN_RANGE,values:[Rc(i,n)]});case bn.BEFORE:return Tc({},e,{filter:bn.LTE,values:[[S(i,n)]]});case bn.AFTER:return Tc({},e,{filter:bn.GTE,values:[[R(i,n)]]});case bn.WITHIN:return Tc({},e,{filter:bn.IN_RANGE,values:[lc(i)]})}}return e}),vc),wc=(0,l.propSatisfies)(kr,"type"),Ic=[[(0,l.prop)("rawFilter"),(0,l.pipe)((0,l.prop)("rawFilter"),mc)],[(0,l.propEq)("filter",bn.HAS_ALL),(0,l.pipe)((e=>{let{fieldName:t,values:r}=e;return(0,l.pipe)((0,l.map)((e=>e.reduce(((e,r)=>e.addClause(vc({filter:bn.EQUALS,fieldName:t,values:[r]}))),new qu).build())),hc(" or "))(r)}),mc)],[(0,l.propEq)("filter",bn.CONTAINS),(0,l.pipe)((e=>{let{filter:t,fieldName:r,values:n}=e;return vc({fieldName:r,filter:t,values:n.map((0,l.pipe)(Ju,_c))})}),mc)],[(0,l.propEq)("filter",bn.EQUALS),(0,l.pipe)((e=>{const{fieldName:t,values:r}=e;return"type"===t?vc(Tc({},e,{values:(0,l.flatten)(r)})):Nc(r)?gc(Tc({},e,{filter:"listEquals"})):vc(e)}),mc)],[(0,l.propEq)("filter",bn.NOT_EQUALS),(0,l.pipe)((e=>{const{values:t}=e;return"type"===e.fieldName?(e=>{let{filter:t,fieldName:r,values:n}=e;const i=gu(t);return(0,l.pipe)(Oc(i),(0,l.map)(bc(t,r)),hc(" and "))(n)})(Tc({},e,{values:(0,l.flatten)(e.values)})):wc(e)?(e=>{const{values:t}=e,r=!wc(e),[n]=t;return(new qu).addClause(vc(Tc({},e,{filter:bn.LT,values:[R(n,r)]}))).addClause(vc(Tc({},e,{filter:bn.GT,values:[S(n,r)]}))).orBuild()})(e):Nc(t)?gc(Tc({},e,{filter:"not listEquals"})):vc(e)}),mc)],[(0,l.propSatisfies)(Pu,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return vc({fieldName:r,filter:Pc(t,r),values:n.map((0,l.prop)("link")).map(Ac)})}],[(0,l.propSatisfies)(Nu,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return vc({fieldName:`${r}.count`,values:n,filter:Ru(t)})}],[(0,l.propSatisfies)(Su,"filter"),Sc],[(0,l.propEq)("fieldName","geoPolygon"),e=>{let{fieldName:t,values:[r]}=e;const n=(0,l.pipe)((0,l.map)((e=>{let[t,r]=e;return`${t},${r}`})),(0,l.join)(";"))(r);return bc(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return bc(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,(0,l.pipe)(vc,mc)]],Uc=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!_u(e)||Dc(e,r))},Cc=(e,t)=>Array.isArray(t)?Dc(e,t):e===bn.WITHIN?ac(t)||Number.isInteger(t):!(0,l.isNil)(t)&&Ju(t).length>0,Dc=(e,t)=>t&&t.length>0&&t.every((t=>Cc(e,t)));function Lc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jc=e=>{let{fieldName:t=""}=e;const r=t.split("."),n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},kc=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),Fc=(e,t,r)=>"children"===e?xc(r,[...t][0],!0):r,Mc=(e,t,r)=>"values"===e?[...r,...t]:r,xc=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=e.findIndex((0,l.propEq)("fieldName",t.fieldName));if(n>=0){const i=e[n];if("children"in i&&"children"in t)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(Fc,t),e);if(!r&&Au(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(Mc,t),e)}return(0,l.append)(t,e)},$c=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=jc(e),r=e=>e.fieldName===t?e:r({fieldName:kc(e),children:[e]});return r(e)})(t);return xc(e,r)}),[]),Vc=e=>e&&e.length>1&&!e.some((e=>{let{fieldName:t}=e;return null==t?void 0:t.startsWith("parent.")}))&&!e.every((0,l.has)("rawFilter")),Gc=e=>{let[t]=e;return t.children?Gc(t.children):t.operator},Wc=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function r(e){const[t,r]=(0,l.splitAt)(1,e),i=Gc(t)===gt.andNot,a=n(t,!1),o=i?`not ${Bu(a)}`:a,s=n(r,!1);return`inSameAttributeValue(${o} ${Gc(r)||Yu} ${s})`}function n(i){let a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return i.reduce(((i,o)=>i.addClause((0,l.cond)([[(0,l.has)("children"),e=>{let{children:i}=e;return a&&Vc(i)&&!t?r(i):n(i,a)}],...e])(o))),new qu).buildWithOperators(i.map((0,l.prop)("operator")))}return n},Bc=(0,l.pipe)((0,l.propOr)("","filter"),mu),Yc=(0,l.map)((0,l.when)(Bc,(e=>{const[t,r]=Eu(e.filter);return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Lc(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),qc=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,l.pipe)((0,l.filter)(Uc),Yc,$c,Wc([...e,...Ic],t))},Hc=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),Jc=[bn.ON,bn.BEFORE,bn.AFTER,bn.WITHIN,bn.NOT_EQUALS,bn.MISSING_VALUE,bn.EXISTS],Qc=[bn.EQUALS,bn.NOT_EQUALS,bn.STARTS_WITH,bn.MISSING_VALUE,bn.HAS_ALL,bn.FULL_TEXT,bn.EXISTS],Kc=[bn.EQUALS,bn.NOT_EQUALS,bn.LT,bn.LTE,bn.GT,bn.GTE,bn.IN_RANGE],Xc=(e,t)=>{const r=fr(e);return(e=>{switch(e){case Fn.startDate.name:case Fn.endDate.name:case xn.dueDate.name:case Gn.createdTime.name:case Gn.updatedTime.name:case Bn.reltioLoadDate.name:case Bn.createDate.name:case Bn.updateDate.name:case Bn.deleteDate.name:case Bn.publishDate.name:return Jc;case Wn.matches.name:case Bn.count.name:return Kc;case xn.workflow.name:case xn.assignee.name:case xn.step.name:case $n.commenter.name:case Gn.createdBy.name:case Gn.updatedBy.name:case Bn.sourceSystems.name:case Bn.value.name:return Qc;default:return null}})(t)||Lu(r)},zc=[bn.EQUALS,bn.NOT_EQUALS,bn.CONTAINS,bn.STARTS_WITH,bn.MISSING_VALUE,bn.HAS_ALL,bn.IN_RANGE,bn.WITHIN,bn.EXISTS,bn.ON],Zc=(0,l.pipe)(Xc,(0,l.filter)((0,l.includes)(l.__,zc))),ep=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(Ss);return a&&a[0]&&(r=n.length>0&&a[0].value?ep(a[0].value,[n.join(".")])[0].value:"label"in a[0]&&"string"==typeof a[0].label?a[0].label:Object.prototype.hasOwnProperty.call(a[0],"label")?"":a[0].value||""),{key:t,value:r}}),""),tp=(e,t)=>{const r=new RegExp("{[^}]*}","g");let n,i=[];for(;null!=(n=r.exec(t));)i.push(n[0]);i=i.map((function(e){return e.substring(1,e.length-1)}));const a=ep(e.attributes||e.value,i);let o;return a.every((function(e){return void 0===e.value}))?o="":(o=t,o=o.replace(/\[[^\]]*]/g,(e=>{const t=e.match(/\{[^}]*}/g);return t?t.some((function(e){return e=e.substring(1,e.length-1).trim(),a.some((function(t){return t.key===e&&void 0===t.value}))}))?"":e.substring(1,e.length-1):e})),a.forEach((e=>{o=o.replace("{"+e.key+"}",e.value||"")}))),o},rp=/[,\s]*$/,np=e=>{const t=ye().text(Cn);if(!e)return t;const r=e.replace(rp,"");return""===r.toString().trim()?t:r},ip=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},ap=(e,t,r)=>{if("string"==typeof t)return t;if("Reference"!==r.type&&"Nested"!==r.type&&"Image"!==r.type)return"";if("Reference"===r.type){const n=ip(e,r.referencedEntityTypeURI);if(n)return tp({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return tp({attributes:t||{}},r.dataLabelPattern);return""},op=e=>{let{uiPath:t,uri:r}=e;return`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},sp=e=>{let{uiPath:t,value:r,uri:n}=e;return`${t}#p~com.reltio.plugins.pivoting.default.DefaultPivotingPerspective_ps~pivoting_a~${encodeURIComponent(n)}_v~${encodeURIComponent(r)}`},lp=e=>{let{uiPath:t,tag:r,entityUri:n}=e;return`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},up=(0,l.curry)(((e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"")),cp=(0,l.when)((0,l.is)(Object),(0,l.ifElse)((0,l.pipe)((0,l.prop)("value"),(0,l.is)(Object)),eu,(0,l.prop)("value"))),pp=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),cp),dp=(e,t,r)=>{const n=pp(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)(Ys(e),cp)))(e))(r)||((e,t)=>{const r=(e=>{const t=t=>`${e.uri}/attributes/${t}`,r=(e=e||{}).imageAttributeURIs||[];return(0,l.uniq)([t("ImageGallery"),...r,t("Image"),t("ImageLinks")])})(pn(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>Ws(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,cp))(r)})(e,r)||mn(e,r.type);return up(t,n)};function yp(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){fp(e,t,r[t])}))}return e}function fp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Tp="DTSS/",Ep=(0,l.replace)(new RegExp("^entities/"),""),mp=e=>Tp+e.dataTenant+"/"+e.uri,hp=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),bp=e=>!(!e||!e.dataTenant),Op=(0,l.startsWith)(Tp),vp=(0,l.pipe)((0,l.ifElse)(Op,(0,l.pipe)((0,l.split)("/"),(0,l.nth)(1)),(0,l.always)(null))),gp=(0,l.ifElse)(bp,mp,(0,l.prop)("uri")),_p=e=>e&&e.uri?e.dataTenant?mp(e):Ep(e.uri):"",Ap=(0,l.curry)(((e,t,r)=>(pn(t,r.type)||{})[e]||"")),Np=Ap("label"),Pp=Ap("typeGraphIcon"),Rp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=pn(e,t.type)||{},n=(r.attributes||[]).reduce(((e,t)=>(e[t.uri]=t,e[t.name]=t,e)),{});return t.attributes&&r.businessCardAttributeURIs?r.businessCardAttributeURIs.map((r=>{const i=n[r];if(!i)return null;let a=t.attributes[i.name];if(!a)return null;Array.isArray(a)&&(a=a.find(Ss)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:ap(e,o,i),uri:a.uri}})).filter(l.identity):[]},Sp=(0,l.pipe)(Rp,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),wp=(0,l.curry)(((e,t)=>{if(!t)return[];if(1===e.length){return t[e[0]]||[]}{const r=t[e[0]];return Array.isArray(r)?r.reduce(((t,r)=>{if((0,l.is)(Object,r.value)){const n=wp(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):wp(e.slice(1),r)}})),Ip=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,Up=e=>(0,l.propOr)([],"matchRules",e),Cp=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?yp({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},Dp=(e,t,r)=>t&&r?r.aEntity:e,Lp=(0,l.evolve)({attributes:Wl(!0)}),jp=(0,l.pipe)(Lp,(0,l.props)(["attributes","startDate","endDate","roles","tags"]),(0,l.all)(E)),kp=e=>(0,l.assoc)("dataTenant",e);function Fp(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){Mp(e,t,r[t])}))}return e}function Mp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xp=e=>{let{parentUri:t,relation:r,entityUri:n}=e;return{type:Lt.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},$p=e=>{let{relationUri:t}=e;return{type:Lt.DELETE_RELATION,parameters:{relationUri:t}}},Vp=e=>{let{parentUri:t,entityUri:r,relationType:n,relationDirection:i}=e;return{type:Lt.IGNORE_RELATION,parameters:{parentUri:t,entityUri:r,relationType:n,relationDirection:i}}},Gp=e=>{let{oldRelation:t,newRelation:r}=e;return{type:Lt.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},Wp=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:Lt.REPOINT_RELATION,parameters:{entityUri:t,newEntityUri:r,relation:n,isReversed:i}}},Bp=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pathEq)(["parameters","relation","uri"],e),l.T],[(0,l.pathEq)(["parameters","relationUri"],e),l.T],[(0,l.pathEq)(["parameters","oldRelation","uri"],e),l.T],[(0,l.pathEq)(["parameters","newRelation","uri"],e),l.T],[l.T,l.F]])(t))),Yp=e=>e.type===Lt.DELETE_RELATION,qp=e=>e.type===Lt.CREATE_RELATION,Hp=e=>e.type===Lt.REPOINT_RELATION,Jp=e=>e.type===Lt.UPDATE_RELATION,Qp=e=>e.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve()),Kp=e=>{let{type:t,parameters:r,dcrProcessor:n}=e;const{enhanceUriWithDCR:i,updateDCRUriFromResponse:a}=n,o=e=>(a(e),e);switch(t){case Lt.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:a,attributes:s,startDate:l,endDate:u}=t;return Hf({startEntityUri:e,endEntityUri:n,relationType:a,attributes:s,startDate:l,endDate:u,uriPreprocessor:i}).then(o)};case Lt.DELETE_RELATION:return()=>{const{relationUri:e}=r;return qf(e,i).then(o)};case Lt.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return Xf(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(o)};case Lt.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return Jf({oldRelation:e,newRelation:t,uriPreprocessor:i}).then(o)};case Lt.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:i,isReversed:a}=r,{uri:o}=i,s=[$p({relationUri:o}),xp({parentUri:a?e:t,relation:i,entityUri:a?t:e})];return(0,l.pipe)((0,l.map)(zp(n)),(0,l.map)(Kp),Qp)(s)}}},Xp=e=>t=>()=>e().then(t),zp=e=>t=>Fp({dcrProcessor:e},t),Zp=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=en({alwaysCreateDCR:e,dcrUri:t});return{commandExecutor:(0,l.pipe)(l.flatten,(0,l.map)(zp(r)),(0,l.map)(Kp),(0,l.map)(Xp(r.getDcrUriAwait)),Qp,(0,l.otherwise)((e=>({errorMessage:e})))),dcrProcessor:r}},ed=e=>t=>(0,l.map)((t=>Fp({},t,{parameters:(0,l.evolve)({parentUri:nh(e),entityUri:nh(e),newEntityUri:nh(e)},t.parameters)})),t),td=e=>{let{condition:t,updater:r}=e;return e=>t(e)?r(e):e},rd=(e,t)=>{const r=e.filter(qp).find(Bp(t));let n=null,i=null,a=null;const o=e.filter(((o,s)=>Jp(o)&&Bp(t,o)?(s>e.indexOf(r)&&(n=o.parameters.newRelation),!1):!Hp(o)||!Bp(t,o)||(s>e.indexOf(r)&&(n=o.parameters.relation,i=o.parameters.isReversed?o.parameters.entityUri:o.parameters.newEntityUri,a=o.parameters.isReversed?o.parameters.newEntityUri:o.parameters.entityUri),!1)));return n?o.map(td({condition:e=>r===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({relation:(0,l.always)(n),parentUri:e=>i||e,entityUri:e=>a||e})})(e)})):o},nd=(e,t)=>{const r=e.filter(Hp).filter(Bp(t));let n=null;const i=e.filter(((i,a)=>r.includes(i)?(0,l.last)(r)===i:!Jp(i)||!Bp(t,i)||(a>e.indexOf((0,l.last)(r))&&(n=i.parameters.newRelation),!1)));return n?i.map(td({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({relation:(0,l.always)(n)})})(e)})):i},id=(e,t)=>{const r=e.filter(Yp).filter(Bp(t));return e.filter((e=>r.includes(e)?(0,l.last)(r)===e:!Bp(t,e)))},ad=(e,t)=>{const r=e.filter(Jp).filter(Bp(t));let n=null;const i=e.filter((e=>!r.includes(e)||!Jp(e)||(n=n||e.parameters.oldRelation,(0,l.last)(r)===e)));return n?i.map(td({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({oldRelation:(0,l.always)(n)})})(e)})):i},od=e=>{const t=e.filter(Yp).map((e=>{let{parameters:{relationUri:t}}=e;return t}));return(0,l.uniq)(t).reduce(id,e)},sd=e=>{const t=e.filter(qp).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(rd,e)},ld=e=>{const t=e.filter(Hp).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(nd,e)},ud=e=>{const t=e.filter(Jp).map((e=>{let{parameters:{newRelation:{uri:t}}}=e;return t}));return(0,l.pipe)((0,l.filter)((e=>(0,l.count)((0,l.equals)(e),t)>1)),l.uniq,(0,l.reduce)(ad,e))(t)},cd=e=>(0,l.pipe)(od,sd,ld,ud)(e);function pd(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){dd(e,t,r[t])}))}return e}function dd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yd=e=>pd({},(0,l.path)(jd(),e),{startDate:(0,l.path)(xd(),e),endDate:(0,l.path)($d(),e)}),fd=(e,t)=>(0,l.pipe)((0,l.path)(Md()),nh(t))(e),Td=(e,t,r,n)=>{let{removedUris:i=[],addedConnections:a=[],editedConnections:o=[],ignoredRelationData:s=[]}=t;return[...a.map((e=>{const t=fd(e,r),i=(0,l.path)(kd(),e)===jt.IN,a=e.parentEntityUri||n;return xp({parentUri:i?t:a,relation:yd(e),entityUri:i?a:t})})),...o.map((t=>{const i=fd(t,r),a=(0,l.path)(kd(),t)===jt.IN,o=i!==(0,l.pipe)((0,l.path)(jd()),a?Vd:Gd)(t),s=Yd(e,(0,l.path)(Dd(),t)),u=t.parentEntityUri||n,c=nh(r,i);return o?Wp({entityUri:a?u:c,newEntityUri:a?c:u,relation:(0,l.path)(jd(),t),isReversed:!1}):Gp({oldRelation:(0,l.path)(jd(),s),newRelation:yd(t)})})),...i.map((e=>$p({relationUri:e}))),...s.map((e=>Vp({parentUri:n,entityUri:e.entityUri,relationType:e.relationType,relationDirection:e.relationDirection})))]},Ed=e=>(e||[]).reduce(((e,t)=>{let{entity:r}=t;const n=r.dataTenant;return pd({},e,{[r.entityUri]:{uri:r.entityUri,label:r.entityLabel,type:r.entityType,dataTenant:n}})}),{}),md=(0,l.has)("dataTenant"),hd=(0,l.ifElse)(md,(e=>{let{relationUri:t,dataTenant:r}=e;return`DTSS/${r}/${t}`}),(0,l.prop)("relationUri")),bd=(e,t)=>(0,l.pipe)(Vi,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(ol),ao)(e,t);function Od(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){vd(e,t,r[t])}))}return e}function vd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gd=e=>(0,l.prop)("uri",e),_d=e=>gd(e)?e.uri:e,Ad=e=>t=>_d(t)===e,Nd=(0,l.curry)(((e,t)=>{const r=(t,n)=>{let i=_d(n),a=!1;i.startsWith("!")&&(i=i.slice(1),a=!0);const o=e[i]&&Xi(Qi.READ,e[i]),s=t.find(Ad(i))||!o?t:t.concat(gd(n)?Od({},n,{uri:i}):i);return a?s:(0,l.keys)(e).reduce(((t,n)=>e[n].extendsTypeURI!==i||t.find(Ad(n))?t:r(t,n)),s)};return t.reduce(r,[])})),Pd=(0,l.curry)(((e,t)=>{const r=function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return r.reduce(((r,n)=>{const i=_d(n),a=(0,l.path)([i,t,"objectTypeUri"],e);return!a||r.find(Ad(a))?r:r.concat(a)}),[])};return Od({},t,{entityTypes:[...r("startObject",t.inRelations),...r("endObject",t.outRelations)]})})),Rd=(0,l.indexBy)((0,l.prop)("uri")),Sd=(0,l.curry)(((e,t)=>{const r=Rd(e.relationTypes),n=Rd(e.entityTypes),i=e=>(0,l.evolve)({inRelations:Nd(r),outRelations:Nd(r),entityTypes:Nd(n),nextEntry:i},e);return(0,l.pipe)((0,l.unless)((0,l.either)((0,l.prop)("nextEntry"),(0,l.prop)("entityTypes")),Pd(r)),i)(t)})),wd=(e,t)=>(0,l.evolve)({content:Sd(e)},t),Id=e=>{let{type:{uri:t,label:r},direction:n}=e;return e=>{const i=e.relationUri;return(0,l.pipe)((0,l.assoc)("relationType",t),(0,l.assoc)("relationLabel",r),(0,l.assoc)("object",{type:t,attributes:{},uri:i}),(0,l.assoc)("direction",n))(e)}},Ud=(e,t,r)=>{const n=tp(t,e.dataLabelPattern),i=(0,l.lensProp)("entity");return(0,l.over)(i,(0,l.evolve)({entityLabel:(0,l.always)(n),object:{label:(0,l.always)(n)}}),r)},Cd="relation",Dd=(0,l.always)([Cd,"relationUri"]),Ld=(0,l.always)([Cd,"relationType"]),jd=(0,l.always)([Cd,"object"]),kd=(0,l.always)([Cd,"direction"]),Fd=(0,l.always)([Cd,"object","attributes"]),Md=(0,l.always)(["entity","entityUri"]),xd=(0,l.always)([Cd,"startDate"]),$d=(0,l.always)([Cd,"endDate"]),Vd=(0,l.path)(["startObject","objectURI"]),Gd=(0,l.path)(["endObject","objectURI"]),Wd=(0,l.path)(["startObject","objectTypeURI"]),Bd=(0,l.path)(["endObject","objectTypeURI"]),Yd=(e,t)=>{for(const r of e){if((0,l.pipe)((0,l.path)(Dd()),(0,l.equals)(t))(r))return r;if(r.connections){const e=Yd(r.connections,t);if(e)return e}}},qd=(0,l.pipe)(Yd,(0,l.path)(jd())),Hd=(0,l.allPass)([(0,l.pipe)((0,l.path)(Md()),(0,l.complement)(E)),(0,l.pipe)((0,l.path)(Ld()),(0,l.complement)(E))]),Jd=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:Ye()},entity:{},isNew:!0},{relationType:o,direction:s}=a.relation,{inRelations:u,outRelations:c}=Xd({content:i?t.contentSecondLevel:t.content,direction:s,relationType:o,mode:r,metadata:n}),p=Qd(u,c);return(0,l.pipe)((0,l.evolve)({relation:p?Id(p):l.identity}),(0,l.defaultTo)({}),(0,l.when)((0,l.always)(i),(0,l.assoc)("parentEntityUri",i)))(a)},Qd=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length+t.length===1?e.length?{type:e[0],direction:Ln.IN}:{type:t[0],direction:Ln.OUT}:null},Kd=e=>e.uri||e,Xd=e=>{let{content:t,direction:r,relationType:n,mode:i,metadata:a}=e;const o={},s=e=>t=>{const a=t&&ea(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===Ln.IN?"startObject":"endObject",{directionalContext:i}=t[n];return"directed"===t.direction&&1===(0,l.propOr)(0,"length",i)&&(r+=` (${i[0].labelPattern})`),!(r in o)&&(o[r]=!0,!0)}return!1},u=e=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],pn(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],pn(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(Kd,Vi(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(Ln.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(Ln.OUT)),(0,l.map)(u))},t)||{}},zd=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}=qi({reversedContextLabels:!0}),a=(0,l.curry)(((e,t,r,n)=>{const[i,a]=Wi(e,n.uri);return n&&(!t||yn(e,i,t))&&(!r||yn(e,a,r))})),o=t=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],pn(e,t.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],pn(e,t.endObject.objectTypeURI)))(t),s=(e.relationTypes||[]).filter((0,l.both)(_s,r));return{inRelations:(0,l.pipe)((0,l.filter)(a(e,null,t)),(0,l.filter)(n),(0,l.map)(o))(s),outRelations:(0,l.pipe)((0,l.filter)(a(e,t,null)),(0,l.filter)(i),(0,l.map)(o))(s)}},Zd=(0,l.curry)(((e,t,r,n,i)=>{const a=yn(n,l.__,t.type),o=e?Bd:Wd,s=yn(n,l.__,r.type),u=e?Wd:Bd;return(0,l.both)((0,l.pipe)(o,a),(0,l.pipe)(u,s))(i)})),ey=(e,t,r)=>{const n=e?Bd:Wd,i=(0,l.pipe)((0,l.map)(n),l.uniq)(r);return(0,l.pipe)((0,l.filter)((e=>{let{uri:r}=e;return i.some(yn(t,l.__,r))})),(0,l.reject)((0,l.prop)("abstract")),(0,l.map)((0,l.prop)("uri")))(t.entityTypes||[])};function ty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ry=e=>{let{type:t,attributeType:r,attributeTypeUri:n,parentUri:i,uri:a,message:o,source:s}=e;return{type:t,uri:a,attributeTypeUri:n,attributeType:r,parentUri:i,message:o,source:s}},ny=e=>!e.deactivated,iy=e=>{let{attributeTypeUri:t,uri:r,parentUri:n}=e;return`${t}-${r}-${n}`},ay=e=>iy(e)+e.message,oy=(0,l.unless)(l.isNil,(0,l.prop)("message")),sy=(0,l.unless)(l.isNil,(0,l.prop)("type")),ly=(0,l.curry)(((e,t)=>Xe(t.parentUri,e))),uy=(0,l.curry)(((e,t)=>t.parentUri===e)),cy=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pipe)((0,l.prop)("uri"),Xe(t.attributeTypeUri)),l.T],[(0,l.both)((0,l.propEq)("type",zt.TYPE_REFERENCE),(0,l.pipe)(nr,(0,l.any)(Xe(t.attributeTypeUri)))),l.T],[l.T,l.F]])(e))),py=(0,l.curry)(((e,t)=>t.attributeTypeUri===e)),dy=(0,l.curry)(((e,t,r)=>e===r.parentUri&&t!==r.attributeTypeUri)),yy=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,l.filter)((0,l.allPass)([vy,ny,ly(e),cy(t),(0,l.complement)(dy(e,t.uri))]))(r)},fy=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=(0,l.find)((0,l.allPass)([vy,ny,uy(e),py(t.uri),(0,l.complement)((0,l.prop)("uri")),(0,l.complement)((0,l.propEq)("type",dt.missed))]))(r);return n&&n.message||""},Ty=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const{uri:i}=e,a=(0,l.find)((0,l.propEq)("uri",i))(n);return a||0!==t?a:n.find((e=>e.attributeTypeUri===r&&e.type===dt.missed))},Ey=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([ny,(0,l.propEq)("type",dt.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(Dd(),e))]))(t)},my=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([ny,(0,l.propEq)("type",dt.missedRefEntity),(0,l.propEq)("parentUri",e.uri)]))(t)},hy=function(e){let{uri:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.any)((0,l.allPass)([ny,ly(t)]))(r)},by=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([ny,(0,l.propEq)("type",dt.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(["relation","uri"],e))]))(t)},Oy=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?fh(e,t):null;return i&&i.map((e=>{const t=((e,t)=>{let{entitiesMap:r,metadata:n}=e;const{type:i,valueType:a,value:o}=t;switch(i){case mt.attributeValue:{const e=a;if(vr(a))return tp(o,e.dataLabelPattern);if(gr(a)){const t=o,i=Ms(t),a=tr(e),s=pn(n,a);return We(i)?tp(r[i],s.dataLabelPattern):t.label}return""}case mt.tempEntity:return tp(o,a.dataLabelPattern);case mt.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=pn(n,null==e?void 0:e.entityType);return`${np(i&&We(i)?tp(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||Gi(n,null==t?void 0:t.relationType)}`}}})({entitiesMap:r,metadata:n},e);return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ty(e,t,r[t])}))}return e}({},e,{label:np(t)})}))},vy=e=>!e.severity||e.severity===ft.ERROR,gy=(e,t,r)=>(0,l.allPass)([(0,l.pipe)((0,l.prop)("uri"),E),(0,l.propEq)("parentUri",t),(0,l.propEq)("attributeTypeUri",r)])(e),_y=(0,l.curry)(((e,t)=>{let r=t.value;switch(e.type){case zt.TYPE_NESTED:return Object.keys(r).some((t=>{const n=e.attributes.find((0,l.propEq)("name",t));return r[t].some(_y(n))}));case zt.TYPE_REFERENCE:return!!Us(t);case zt.TYPE_BOOLEAN:return!0===r||!1===r||"true"===r||"false"===r;default:return"string"==typeof r&&(r=r.trim()),null!=r&&""!==r}})),Ay=(e,t)=>e.every((0,l.complement)(_y(t))),Ny=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const n=Xo(e,t.type||t.relationType,!0,r);return n.reduce(((r,n)=>{const i=Ws(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!Ss(e.parent))))).forEach((e=>{Ay(e.attrValues,n)&&r.push(ry({type:dt.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:ye().text("Attribute is required"),source:yt.local}))})),r}),[])},Py=(0,l.curry)(((e,t,r)=>Ws(e,t,r,!1))),Ry=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),pn(e),(0,l.prop)("attributes"),(0,l.defaultTo)([]),(0,l.reject)(br),(0,l.filter)(gr),(0,l.map)((0,l.prop)("uri")),(0,l.chain)(Py(e,t)));return(0,l.pipe)(r,(0,l.reject)(Ms),(0,l.map)((e=>{let{uri:r}=e;return ry({type:dt.missedRefEntity,uri:"",attributeTypeUri:nt(r,t.type),parentUri:r,message:ye().text("Entity is required"),source:yt.local})})))(t)},Sy=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,l.has)("refEntity")).filter((0,l.pipe)(Ms,We)).flatMap((n=>{const i=Ms(n),a=t[i],o=Ur(e,nt(n.uri,r.type));return wy(e,t,o,a)})),wy=(e,t,r,n)=>{const i=nr(r),a=i.map((t=>Ur(e,t))).filter((0,l.both)(l.identity,(0,l.propEq)("type",zt.TYPE_REFERENCE))).flatMap(ar).concat(i);return Iy(e,t,n,(e=>a.some(Xe(e.uri))))},Iy=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity;const i=Ny(e,r,n),a=Ry(e,r),o=Sy(e,t,r);return[...i,...a,...o]},Uy=(e,t)=>{const r=(0,l.path)(jd(),t)||{};return Ny(e,r)},Cy=(e,t,r)=>{t=t||{};const n=(0,l.pipe)((0,l.path)(Md()),(0,l.ifElse)(We,(e=>t[e]),(0,l.always)(null)))(r),i=Uy(e,r),a=(e=>(0,l.path)(Md(),e)?[]:[ry({type:dt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(Ld(),e),parentUri:(0,l.path)(Dd(),e),message:ye().text("Entity is required"),source:yt.local})])(r),o=((e,t,r)=>r?Iy(e,t,r):[])(e,t,n);return[...i,...a,...o]},Dy=e=>(0,l.path)(["entity","uri"],e)?[]:[ry({type:dt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(["relation","type"],e),parentUri:(0,l.path)(["relation","uri"],e),message:ye().text("Entity is required"),source:yt.local})],Ly=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=Ny(e,r),i=Dy(t);return[...n,...i]};function jy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ky=(e,t)=>{var r,n;const i=pn(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||_o(e)},Fy=e=>(0,l.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),My=e=>{const t=r=>(0,l.ifElse)(Array.isArray,(0,l.map)(t),(0,l.pipe)(Fy(e),(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(0,l.map)(t))})))(r);return t},xy=(e,t)=>(0,l.when)((0,l.prop)("refEntity"),(0,l.pipe)((0,l.when)((0,l.allPass)([(0,l.prop)("refRelation"),(0,l.always)("INSERT_ATTRIBUTE"===t),(0,l.pipe)(xs,We,l.not)]),(e=>{const t=(0,l.pipe)(xs,Ze)(e);return My((e=>e.replace(t,t+je)))(e)})),(0,l.when)((0,l.pipe)(Ms,We),(t=>{const r=Ms(t),n=e[r],i=n&&Vy(n,e);return null!=i&&i.attributes?(0,l.evolve)({value: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){jy(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),$y=(e,t,r)=>Wh($h((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),qh((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e).map((e=>(0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.pipe)((0,l.filter)((e=>!e.refRelation||e.refEntity)),(0,l.map)(xy(r,e.type)),(0,l.map)(My(ut))))})(e))).concat(eh(e,t)),Vy=(e,t)=>(0,l.evolve)({attributes:Vl({valueTransformer:(0,l.pipe)(Gs,xy(t),Fy(ut)),deleteEmptyComplex:!0}),uri:ut})(e);function Gy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Wy(e,t,r[t])}))}return e}function Wy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const By=(0,l.unless)(l.isNil,(e=>e.replace(new RegExp(Le,"g"),"uri$$$$").replace(new RegExp(je,"g"),""))),Yy=e=>(0,l.pipe)((0,l.evolve)({objectUri:By,objectParentUri:By}),(e=>{return Gy({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?dt.missed:dt.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&<(e.objectUri),uri:e.objectUri,source:yt.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),qy=(e,t)=>(0,l.map)((0,l.pipe)(Yy,(e=>{var r,n,i,a;const{metadata:o}=t,{uri:s,parentUri:u}=e,c=Oy(t,s),p=null!=c&&c.length?c.slice(0,-1):Oy(t,u),d=((e,t,r)=>{let{uri:n,attributeTypeUri:i}=r,a=i&&Ur(e,i);if(!a&&n&&t&&t.length){const e=(0,l.last)(t);e.type===mt.attributeValue&&(a=e.valueType)}return a})(o,c,e);return Gy({},e,{attributeType:d,attributeTypeUri:null==d?void 0:d.uri,uri:c&&(null===(r=(0,l.last)(c))||void 0===r||null===(n=r.value)||void 0===n?void 0:n.uri)||s,parentUri:p&&(null===(i=(0,l.last)(p))||void 0===i||null===(a=i.value)||void 0===a?void 0:a.uri)||u,path:s?c:p})}),(e=>{let{entitiesMap:t,metadata:r}=e;return e=>{const{uri:n,parentUri:i,path:a,attributeTypeUri:o}=e;if(!n&&null!=a&&a.length&&i&&st(i)){const n=(0,l.last)(a),i=n.valueType;if(gr(i)&&or(i).includes(o)){const i=Ms(n.value),o=i&&We(i)?t[i]:null;return o?Gy({},e,{parentUri:o.uri,path:a.concat({type:mt.tempEntity,value:o,valueType:pn(r,o.type),label:""})}):e}}return e}})(t)))(e),Hy=e=>{if(e.type===Et.AGO||e.type===Et.WITHIN){const[t,r]=e.period;return"Number"===(0,l.type)(t)&&"String"===(0,l.type)(r)&&t>0}if(e.type===Et.BETWEEN){const[t,r]=e.period;return t instanceof Date&&r instanceof Date}},Jy=e=>`equals(user, '${Qu(e)}')`,Qy=e=>`equals(items.delta.sources, '${e.abbreviation}')`,Ky=e=>`equals(items.objectType, '${e.uri}')`,Xy=e=>{const{period:t,type:r}=e;if(!Hy(e))return"";switch(r){case Et.WITHIN:return`gte(timestamp, ${X(t)})`;case Et.AGO:return`lte(timestamp, ${X(t)})`;case Et.BETWEEN:{const[e,r]=t;return`range(timestamp, ${e.valueOf()}, ${f()(r).endOf("date").valueOf()})`}default:return""}},zy=e=>[`equals(items.objectUri, '${e}')`,`equals(items.startObjectUri, '${e}')`,`equals(items.endObjectUri, '${e}')`].join(" or "),Zy=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),ef=e=>{let{query:t,body:r}=e;return t=Zy(t),su(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},tf=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n=[...e];r&&n.push({filter:"containsWordStartingWith",fieldName:"attributes",values:[r]});const i={filter:(0,l.pipe)(qc(),Hc(t.globalFilter))(n),activeness:t.activityFilter||Un.ACTIVE_ONLY};return t.searchOptions&&(i.options=t.searchOptions),`/entities/_total${Xr(i)}`},rf=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=tf(e,t,r);return su(n)},nf=e=>su(`/entities/_total?${e}`),af=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(0,l.pipe)((0,l.filter)(As),(0,l.map)((0,l.prop)("uri")))(e),i={filter:bn.EQUALS,fieldName:"type",values:n},a=r.isRawFilter?{rawFilter:t}:{filter:"containsWordStartingWith",fieldName:"attributes",values:[t]},o=(0,l.pipe)(qc(),Hc(r.globalFilter))([i,a]),s=Xr({filter:o,select:"uri,label,type,roles,secondaryLabel,defaultProfilePicValue",scoreEnabled:!0,activeness:r.activityFilter||Un.ACTIVE_ONLY,max:r.max||4});return su("/entities/_typeAheadSearch"+s,{method:"GET"})},of=(0,l.pipe)((0,l.reject)(l.isNil),Kr),sf=e=>{let{fieldName:t,searchParams:r=[],options:n={}}=e;const{globalFilter:i,activityFilter:a,searchOptions:o,max:s,pageNo:u}=n,c=(0,l.pipe)(qc(),Hc(i))(r),p=of({filter:c||null,activeness:a||"active",options:o||null}),d=[{fieldName:t,pageSize:s||20,pageNo:u||1,orderType:n.orderType||"reversedCount"}];return ef({query:p,body:d})},lf=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return sf({fieldName:t,searchParams:i,options:n})};function uf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cf="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",pf=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n=[...e,{filter:"containsWordStartingWith",fieldName:"attributes",values:[r]}],i={filter:(0,l.pipe)(qc(),Hc(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||cf,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null};return t.searchOptions&&(i.options=t.searchOptions),`/entities${Xr(i)}`},df=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=pf(e,t,r);return su(n)},yf=e=>bf(e,{select:"secondaryLabel"}),ff=(e,t)=>{const{select:r=cf,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),su("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},Tf=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),We)),Ef=e=>{const{parentUri:t,attributeTypeUri:r,values:n=[],offset:i,defaultMaxValues:a,tenant:o,apiPath:s,searchQuery:u,filters:c=[],sorting:p,options:d="ovOnly"}=e,y=n.length,f=Tf(n).length,T={[r]:{max:a,offset:(0,l.isNil)(i)?y-f:i}},E=Nr(r),m={attributesPaging:T,defaultMaxValues:a,options:d,select:"crosswalks,"+E},h=[...c,{filter:"containsWordStartingWith",fieldName:E,values:[u]}],b=(0,l.pipe)(qc(),Hc(d.globalFilter))(h);return b&&(m.filter=b),p&&(m.sort=p.field,m.order=p.order),su(`${s}/api/${o}/${t}/_object`,{method:"POST",body:JSON.stringify(m)})},mf=e=>`entities?filter=equals(uri,'${e}')&offset=0`,hf={options:"sendHidden,addRefAttrUriToCrosswalk"},bf=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:hf;return su(`/${e}${Xr(t)}`)},Of=(e,t)=>bf(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){uf(e,t,r[t])}))}return e}({},hf,{explicitSurvivorshipGroup:t})),vf=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r={method:"POST",body:JSON.stringify([e])},n=t("/entities");return su(n,r)},gf=e=>su(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),_f=(e,t,r)=>{const n={method:"POST",body:JSON.stringify(t)};return su(`/${e}/_clone${Xr({executeLCA:!1,valuesToCopy:r})}`,n)},Af=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return su(`/entities/_events/_total${Kr({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Nf=(e,t)=>su(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",body:t}),Pf=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return su(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",body:JSON.stringify(r)})},Rf=e=>{let{entityUri:t,offset:r,max:n,filter:i,sort:a,order:o}=e;const s={offset:r,max:n,filter:i,sort:a,order:o};return su(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),Kr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Sf=e=>{const t=new FormData;return t.append("file",e),su("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=Te(e,ye().text("Can't upload file"));return Promise.reject(t)}))},wf=e=>{let{containsWordStartingWith:t,sortBy:r,sortOrder:n,favoriteOnly:i,offset:a,max:o,countResults:s=!1,findPublic:l=!0,includes:u,startsWith:c}=e;return su(`/personal/findSavedSearches${Kr({countResults:s,findPublic:l})}`,{method:"POST",body:JSON.stringify({containsWordStartingWith:t,sortBy:r,sortOrder:n,favoriteOnly:i,offset:a,max:o,includes:u,startsWith:c}),headers:{"Content-Type":"application/json"}})},If=e=>su(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),Uf=e=>su("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Cf=e=>{const{uri:t}=e,r=(0,l.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return su(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},Df=e=>{let{uri:t}=e;return su(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},Lf=(e,t)=>(0,l.pipe)((0,l.evolve)({isPublic:(0,l.always)(t)}),Cf)(e),jf=(e,t)=>(0,l.pipe)((0,l.evolve)({isFavorite:(0,l.always)(t)}),Cf)(e);function kf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ff=["max","offset","filter"],Mf=(0,l.curry)(((e,t)=>t.nextEntry?(0,l.evolve)({nextEntry:Mf(e)},t):function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){kf(e,t,r[t])}))}return e}({},t,(0,l.pick)(Ff,e)))),xf=e=>{if(1===e.length&&((0,l.pathEq)([0,"activeness","entity"],vt.ALL,e)||(0,l.pathEq)([0,"activeness","relation"],vt.ALL,e)))return!1},$f=(0,l.omit)(["activeness"]),Vf=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=xf(t),{searchByOv:i}=r;t=(0,l.map)((0,l.pipe)((0,l.when)((0,l.prop)("nextEntry"),(e=>(0,l.pipe)(Mf(e),(0,l.omit)(Ff))(e))),$f,(0,l.omit)(["labels"])))(t);const a={limitCreditsConsumption:!0,activeness_enabled:n,options:i?"searchByOv":void 0},o=`/${e}/_connections${Xr(a)}`,s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)};return{url:o,options:s}},Gf=(0,l.map)((e=>{let t=e;for(;t&&t.nextEntry;)t=t.nextEntry;return t})),Wf=(0,l.reject)(l.isNil),Bf=(0,l.unless)((0,l.startsWith)("/"),(0,l.concat)("/")),Yf=e=>su(Bf(e),{method:"GET",headers:{"Content-Type":"application/json"}}),qf=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r=(0,l.pipe)(t,Bf);return su(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},Hf=e=>{let{startEntityUri:t,endEntityUri:r,relationType:n,attributes:i,startDate:a,endDate:o,uriPreprocessor:s=l.identity}=e;const u={type:n,startObject:{objectURI:t},endObject:{objectURI:r},attributes:i?Wl()(i):null,startDate:a,endDate:o},c=(0,l.pipe)(Wf,ie,JSON.stringify);return su(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(u)})},Jf=e=>{let{oldRelation:t,newRelation:r,uriPreprocessor:n=l.identity}=e;const i=(0,l.prop)("attributes"),a=(0,l.pipe)((0,l.prop)("uri"),(0,l.concat)(l.__,"/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk"),Bf,n),o=$h(i(t),i(r)).concat(Gh(t,r));return su(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},Qf=(e,t,r)=>{const{url:n,options:i}=Vf(e,t,r);return su(n,i).then(Gf)},Kf=(e,t)=>su(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),Xf=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===Ln.IN?a.inRelations=[n]:a.outRelations=[n],su(`/${e}/_ignoreSuggestedRelationship`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},zf=e=>{let{servicesPath:t="",environment:r,tenant:n,application:i}=e;return su(`${t}/recentSearches${Xr({environment:r,tenant:n})}`,{method:"GET",application:i,headers:{"Content-Type":"application/json"}})},Zf=e=>su("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),eT=e=>{let{environment:t,tenant:r,createdDate:n}=e;return su(`/recentSearches${Xr({environment:t,tenant:r,createdDate:n})}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};function tT(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){rT(e,t,r[t])}))}return e}function rT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nT={select:"label,secondaryLabel,name,type,startDate,endDate"},iT=(0,l.reject)(l.isNil),aT=(0,l.pipe)(iT,Kr),oT=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i,signal:a}=e;const o=tT({},nT,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{},{limitCreditsConsumption:!0});return su(`/${t}/_tree${aT(o)}`,{method:"GET",headers:{"Content-Type":"application/json"},signal:a})},sT=e=>{let{uri:t,graphUri:r}=e;const n=tT({},nT,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return su(`/${t}/_parents${aT(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},lT=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1,limitCreditsConsumption:o,max:s}=e;const l=tT({},nT,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},o?{limitCreditsConsumption:o}:{},s?{max:s}:{},{filterLastLevel:i,deep:a});return su(`/${t}/_hops${aT(l)}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function uT(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}const cT=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},pT="/activities",dT=e=>{let{label:t,description:r}=e;return su(pT,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:cT()}})};var yT;!function(e){e.userSearch="USER_SEARCH",e.profileView="USER_PROFILE_VIEW"}(yT||(yT={}));const fT=e=>{const t=Xr(e);return su(pT+t,{method:"GET"})},TT=e=>su(`/activities/_total${Xr(e)}`,{method:"GET"}),ET=e=>{const{entityUri:t}=e,r=uT(e,["entityUri"]);return su(`/${t}/_activities${Xr(r)}`,{method:"GET"})},mT=e=>{const{entityUri:t}=e,r=uT(e,["entityUri"]);return su(`/${t}/_activities/_total${Xr(r)}`,{method:"GET"})};function hT(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){bT(e,t,r[t])}))}return e}function bT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const OT=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},vT=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return su(OT({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},gT=e=>{let{workflowPath:t,url:r,tenant:n,method:i,data:a,headers:o}=e,s=r;return r.includes("http:")||r.includes("https:")||(s=OT({url:r,workflowPath:t,tenant:n})),su(s,{method:i||"GET",body:JSON.stringify(a),headers:hT({"Content-Type":"application/json"},null!=o?o:{})})},_T=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=OT({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,l.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return su(e,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(n)})}));return(0,l.pipe)((e=>e.map((t=>[e[0],t])).slice(1)),(0,l.map)(s(o,r)),(e=>Promise.all(e)),(0,l.andThen)(l.last))(n)},AT=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=OT({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?hT({},l,{comment:o}):l;return su(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},NT=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const u=OT({url:`/tasks${s?Xr(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(hT({objectURIs:[i]},(0,l.reject)(E,a)))};return su(u,hT({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},PT=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i,max:a,offset:o}=e;return su(OT({url:"/tasks",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)({assignee:i,max:a,offset:o})})},RT=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i,max:a,offset:o}=e;return su(OT({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)(hT({max:a,offset:o},i))})},ST=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return su(OT({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},wT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return su(OT({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},IT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return wT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},UT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return su(OT({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},CT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return wT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},DT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return wT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},LT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return wT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},jT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a}=e;return su(OT({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a})})},kT=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return su(OT({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},FT=e=>{let{entityUri:t,max:r,deep:n,sort:i,order:a,activeness:o,filter:s,markMatchedValues:u,sources:c,rules:p}=e;const d={max:r,deep:n,filter:s,markMatchedValues:u,sort:i,order:a,activeness:o,sources:c,rules:p};return su(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),Kr)(d)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},MT=e=>{let{entityUri:t,max:r,sort:n,order:i,activeness:a,filter:o}=e;const s={max:r,filter:o,sort:n,order:i,activeness:a};return su(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),Kr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},xT=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return su("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},$T=(e,t,r)=>Promise.all(t.map((async t=>await su(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})))),VT=async(e,t)=>await $T(e,t,"NOT"),GT=async(e,t)=>await $T(e,t,"MATCH"),WT=async(e,t)=>await Promise.all(t.map((async t=>await su(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}}))));function BT(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){YT(e,t,r[t])}))}return e}function YT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qT(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}const HT=3e4,JT=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return su(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},QT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return fE({url:`entities/_connections/_hasNonImported?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}})},KT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return fE({url:`entities/_connections/_import?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}})},XT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return su(`${t}entities/_merge?dataEntityUri=${i}&customerEntityUri=${a}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},zT=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{dataTenant:a,uri:o}=n;return Promise.all(i.map((e=>{let{uri:n}=e;return XT({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},ZT=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{uri:a}=n,[o,s]=(0,l.partition)(bp,i);return Promise.all([s.length?xT(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return XT({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},eE=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return r.map((0,l.assoc)("matchRule",t))})),(0,l.reduce)(((e,t)=>{let{matchRule:r}=t,n=qT(t,["matchRule"]);const i=e.findIndex((e=>{let{object:{uri:t}}=e;return n.uri===t}));return-1===i?e.concat({object:n,matchRules:[r]}):(0,l.adjust)(i,(0,l.evolve)({matchRules:(0,l.append)(r)}),e)}),[])),tE=(0,l.pipe)((0,l.find)((0,l.propEq)("index",0)),(0,l.propOr)({},"object"),eE),rE=e=>{let{dtssPath:t,customerTenant:r,entity:n}=e;const{uri:i,dataTenant:a}=n;return su(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:a,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(tE)},nE=e=>t=>{let{dtssPath:r,dataTenants:n=[],customerTenant:i,entity:a}=t;return Promise.all(n.map((t=>{let{id:n}=t;return e({dtssPath:r,dataTenant:n,customerTenant:i,entity:a}).then((0,l.map)((0,l.assocPath)(["object","dataTenant"],n))).catch((e=>(console.log(e),[])))}))).then(l.flatten)},iE=nE((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return su(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{uri:a,type:o}])}).then(tE)})),aE=nE((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return su(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),oE=(e,t)=>{let{dtssPath:r,dataTenants:n=[],entity:i,customerTenant:a,dtssRequest:o}=e;return function(){if(r&&n&&n.length){const e=o({dtssPath:r,dataTenants:n,entity:i,customerTenant:a});return Promise.all([t(...arguments),e]).then(l.flatten)}return t(...arguments)}},sE=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return su(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},lE=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{dataTenant:o,uri:s}=i;return Promise.all(a.map((t=>{let{uri:i}=t;return sE(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},uE=lE("NOT"),cE=lE("MATCH"),pE=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{uri:o}=i,[s,u]=(0,l.partition)(bp,a);return Promise.all([$T(o,u,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return sE(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},dE=pE("NOT"),yE=pE("MATCH");function fE(e){let{requestProvider:t=su,url:r,options:n,dataTenant:i,customerTenant:a,dtssPath:o}=e;r=o.endsWith("/")&&r.startsWith("/")?r.slice(1):r;const s=n||{},{headers:l}=s;return t(`${o}${r}`,BT({},qT(s,["headers"]),{headers:BT({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const TE=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return fE({url:pf(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},EE=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return fE({url:tf(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},mE=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a,options:o}=e;const{searchByOv:s}=o,{options:u}=Vf(t,r);return fE({url:`entities/_connections/_getConnections${Xr({dataEntityUri:t,options:s?"searchByOv":void 0})}`,options:u,dataTenant:n,customerTenant:i,dtssPath:a}).then((0,l.pipe)(Gf,(0,l.map)((0,l.evolve)({connections:(0,l.map)((0,l.pipe)((0,l.assocPath)(["entity","dataTenant"],n),(0,l.assocPath)(["relation","dataTenant"],n)))}))))},hE=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return fE({url:`${mf(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},bE=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return su(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},OE=e=>{let{dtssPath:t,tenant:r}=e;return su(`${t}tenants/customerTenants?id=${r}&useCache=true`,{method:"GET",timeout:HT})},vE=e=>{let{dtssPath:t,customerTenant:r}=e;return su(`${t}subscriptions?useCache=true`,{method:"GET",headers:{CustomerTenant:r},timeout:HT})},gE=e=>{let{dtssPath:t,tenants:r}=e;return su(`${t}tenants/dataTenants?id=${r}&useCache=true`,{method:"GET",timeout:HT})},_E=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return fE({url:mf(t),dataTenant:r,customerTenant:n,dtssPath:i})},AE=()=>su("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET"});function NE(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){PE(e,t,r[t])}))}return e}function PE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const RE=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=NE({},n,{ordered:"true",orderBy:"LastName,FirstName",from:0,max:100},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(i,["select"]));return su(`${t}/api/${r}/graph/search${Xr({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},SE=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return su(`${t}/api/${r}/graph/search/count`,{method:"POST",body:NE({},n,i),headers:{"Content-Type":"application/json"}})},wE=(e,t)=>`${e}/${t}/comments`,IE=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return su(`${wE(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},UE=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return su(`${wE(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},CE=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return su(wE(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},DE=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return su(`${wE(t,r)}/${n.commentId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},LE=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return su(`${wE(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},jE=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i}=e;return su(`${wE(t,r)}/${n}/replies/${i}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},kE=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i,data:a}=e;return su(`${wE(t,r)}/${n}/replies/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},FE=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return su(`${wE(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},ME=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=Xr({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return su(`${wE(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function xE(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}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 VE=e=>{let{tenant:t,servicesPath:r}=e;return su(`${r}/users/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})},GE="graphExport",WE=async(e,t,r,n,i)=>{let a;try{const{data:n={}}=await HE({servicesPath:e,tenant:t,environment:r,namespace:GE,options:{method:"GET",headers:{"Content-Type":"application/json"}}});a=n}catch(e){a={}}const o={body:JSON.stringify(xE({},a,{[n]:i})),headers:{"Content-Type":"application/json"}};let s;try{s=await HE({servicesPath:e,tenant:t,environment:r,namespace:GE,options:xE({method:"PUT"},o)})}catch(e){s=null}return s||(s=await HE({servicesPath:e,tenant:t,environment:r,namespace:GE,options:xE({method:"POST"},o)})),s},BE=e=>{let{servicesPath:t,key:r}=e;return su(`${t}/settings${Xr({key:r})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},YE=e=>{let{servicesPath:t}=e;return su(`${t}/version/collect`,{method:"POST",headers:{"Content-Type":"application/json"}})},qE=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return su(`${n}/plugins${Xr({tenant:t,user:r})}`,{method:"GET"})},HE=e=>{let{tenant:t,environment:r,servicesPath:n,options:i,namespace:a,projection:o}=e;return su(`${n}/configService${Xr({tenant:t,environment:r,namespace:a,projection:o})}`,i)},JE=e=>{let{tenant:t,environment:r,servicesPath:n}=e;return HE({tenant:t,environment:r,servicesPath:n,options:{method:"GET"}})},QE=e=>{let{servicesPath:t,stateHash:r}=e;return su(`${t}/searchLink?key=${r}`,{method:"GET"})},KE=e=>{let{imageServicePath:t,environment:r,tenant:n,image:i}=e;const a=new FormData;return"string"==typeof i?(a.append("sourceUrl",i),a.append("upload","false")):a.append("file",i),su(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},XE=e=>su(`/${e}?showObjectsInfo=true`,{method:"GET"}),zE=e=>{let{exportPath:t,tenant:r,options:n}=e;return su(`${t}/${r}/activities${Xr(n)}`,{method:"POST"})};function ZE(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){em(e,t,r[t])}))}return e}function em(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tm=e=>{const{entityUri:t}=e;return su(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},rm=e=>{let{entityUri:t,crosswalk:r}=e;return su(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},nm=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return su("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[ZE({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),ZE({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},im=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return su(`/${r}/_${n}${Xr({contributorURI:t})}`,{method:"POST"})},am=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return su(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},om=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return su(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},sm=e=>{let{entityUri:t,crosswalkId:r}=e;return su(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})};function lm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const um=e=>{let{entityTypeUri:t}=e;return su(`/dataQuality/fillRates${Kr({entityType:Ze(t)})}`,{method:"GET"})},cm=e=>{let{attributes:t=[],metrics:r=[]}=e;const n=r.length,i=t.length*n;return i>10?10:i},pm=e=>{let{entityTypeUri:t,attributes:r,dataLevel:n,metrics:i}=e;const a=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){lm(e,t,r[t])}))}return e}({},n===Dt.ATTRIBUTE_TYPE?{attributes:r}:{},i?{metrics:i}:{}),o=n===Dt.ATTRIBUTE_TYPE?Kr({numberOfThreads:cm({attributes:r,metrics:i})||1}):"";return su(`/entityType/${Ze(t)}/dataQuality/${n}${o}`,{method:"POST",body:JSON.stringify(a)})},dm=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n,env:i}=e;return su(`${t}/api/${r}/dataValidationFunctions/entityTypes/${Ze(n)}`,{method:"GET",headers:{env:i}})},ym=e=>{let{mlDqPath:t,tenant:r,entityTypeUri:n,attribute:i,viewMultiplier:a=1,dataLevel:o=Dt.ATTRIBUTE_TYPE,metrics:s=[],startDate:l,endDate:u}=e;const c={attribute:i,metrics:s,viewMultiplier:a,startDate:l,endDate:u};return su(`${t}/${r}/entityType/${Ze(n)}/ml/dataQuality/v1/${o}/timeSeries/`,{method:"POST",body:JSON.stringify(c)})},fm=e=>{let{tenant:t,apiPath:r}=e;return su(`${r}/permissions/${t}`,{method:"GET"})},Tm=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return su(`/${t}${Xr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},Em=e=>{let{attributeUri:t,value:r}=e;return su(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},mm=e=>{let{attributeUri:t,value:r}=e;return su(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},hm=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return su(`/${t}${Xr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},bm=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=Xr({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=Wl()([[{value:a}]]);return su(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},Om=e=>{let{entityUri:t,attributeName:r,value:n}=e;return su(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},vm=e=>{let{entityUri:t,attributeName:r}=e;return su(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};function gm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _m=e=>{let{entityUri:t}=e;return su(`/${t}/_historicURIs`,{method:"GET"})},Am=e=>{let{entityUri:t,historicUris:r}=e,n=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["entityUri","historicUris"]);return su(`/${t}/_changesWithTotal${Xr(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){gm(e,t,r[t])}))}return e}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},Nm=(e,t)=>su(`/${e}/_previousChange${Xr({timestamp:t})}`,{method:"GET"}),Pm=(e,t)=>su(`/${e}${Xr({time:t})}`,{method:"GET"});function Rm(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){Sm(e,t,r[t])}))}return e}function Sm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wm=e=>{let{url:t,method:r,data:n,headers:i,noRequestProcessor:a}=e;const o=r||"GET";let s;return"GET"!==o&&(s=ce(n)?JSON.stringify(n):n),su(t,{method:o,body:s,headers:Rm({"Content-Type":"application/json"},null!=i?i:{}),noRequestProcessor:a})},Im=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=Xr({options:a.join(","),severity:o.join(",")});return su(`${t}/validate/${i}/entity/${_p({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},Um=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return su(`${t}/validate/${n}/entity${Xr({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},Cm=e=>{let{tenant:t,apiPath:r}=e;return su(`${r}/tenants/${t}/name`,{method:"GET"})},Dm=e=>{let{tenant:t,apiPath:r}=e;return su(`${r}/tenants/${t}/_rdmTenants`,{method:"GET"})},Lm=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e;return su(`${a}/preferences${Xr({name:t,tenant:r,environment:n,user:i})}`,{method:"GET"})},jm=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a,value:o}=e,s={name:t,tenant:r,environment:n,user:i,values:[JSON.stringify(o)]};return su(`${a}/preferences`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})},km=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e,o={name:t,tenant:r,environment:n,user:i};return su(`${a}/preferences`,{method:"DELETE",body:JSON.stringify(o)})},Fm=e=>{const{servicesPath:t}=e;return su(`${t}/getTokenForWorker`,{method:"GET"})};var Mm=r(29524);const xm=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=Be(),s={attributes:Il({attributeTypes:n,parentUri:o,metadata:i,mode:a}),uri:o,type:t,timestamp:Date.now()};return r?function(e,t,r){const n=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:[]).find((e=>!e.lookupCode&&!e.dependentLookupCode&&"String"===e.type));if(n){const i=Ws(r,e,n.uri)[0];return i&&i.value?kl({entity:e,attributeType:n,uri:i.uri,value:t}):Ll({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},$m=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.filter)((0,l.has)("refEntity")),(0,l.map)(Ms),(0,l.filter)(We),(0,l.map)((t=>e[t])),(0,l.reject)(l.isNil))((null==t?void 0:t.attributes)||{}),Vm=(0,l.curry)(((e,t)=>{const r=$m(e=e||{},t=t||{});return r.concat((0,l.chain)(Vm(e),r))})),Gm=(0,l.curry)(((e,t)=>(0,l.pipe)(pe,(0,l.filter)(e))(t))),Wm=Gm((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),Bm=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),We)),Ym=e=>(0,l.pipe)(Wm,Bm(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),qm=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(Wm,(0,l.find)((t=>(0,l.pathSatisfies)((t=>t===e),t,r))))(r);return n?(0,l.set)((0,l.lensPath)(n),t,r):r})),Hm=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),We),(0,l.omit)(["uri","timestamp"])),Jm=(0,l.pipe)(Hm,Lp),Qm=async(e,t,r)=>{if(!e)return null;const n=Ym(e);if(n.length>0)for(const r of n)e=qm(r,t[r],e);const i=await vf(Jm(e),null==r?void 0:r.enhanceUriWithDCR),a=(e=>(0,l.path)([0,"errors"],e))(i);if(a)throw a;if((0,l.has)("changes",i))return null==r||r.updateDCRUriFromResponse(i),((e,t)=>(0,l.pipe)((0,l.prop)("changes"),l.keys,(0,l.find)((e=>!(0,l.values)(t).includes(e))))(e))(i,t);const o=(e=>(0,l.pathOr)(e,[0,"object"],e))(i);return o.uri},Km=async(e,t,r)=>{const n=zm(e,t),i={};for(const t of n)i[t]=await Qm(e[t],i,r);return i},Xm=(0,l.curry)(((e,t)=>{const r=Mm.Node(t);return Ym(e[t]).forEach((t=>{const n=Xm(e,t);r.addEdge(n)})),r})),zm=(e,t)=>(0,l.pipe)((0,l.map)(Xm(e)),(0,l.map)(Mm.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),Zm=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)(Hm))})),eh=(e,t)=>[...Hh(e.tags||[],t.tags||[]),...Jh(e.roles||[],t.roles||[]),...Vh(e,t),...Gh(e,t)],th=(e,t)=>[...Wh($h((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),qh((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e),...eh(e,t)],rh=(0,l.pipe)(((e,t)=>{const r=(0,l.toPairs)(e);return(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)((e=>r.reduce(((e,t)=>{let[r,n]=t;return qm(r,n,e)}),e))))}),t)}),Zm),nh=(0,l.curry)(((e,t)=>(0,l.when)(We,(0,l.propOr)(l.__,t,e),t)));function ih(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){ah(e,t,r[t])}))}return e}function ah(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const oh=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return ih({},t,{[r]:{parents:n,children:i}})},sh=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return ih({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},lh=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=t[e],a=$m(t,i),o=oh({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>lh(n.uri,t,[e],r)),o)},uh=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return e.reduce(((e,n)=>{const i=(0,l.path)(Dd(),n),a=t?sh({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(Md(),n),s=We(o)?[o]:[],u=oh({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>lh(t,r,[i],e)),u)}),n)},ch=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return uh(r,e,t,lh(e,t))},ph=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return ch(t,r,n);if(He(e)){const t=Yd(n,e);return t&&uh([t],null,r)}return r[e]?lh(e,r):void 0},dh=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>dh(e,t))))},yh=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>yh(e,t))))},fh=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=qe(t),u=ch(r,n,i),c=((e,t,r)=>{let{entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[];let s;for(let e=0;e<t.length;e++){const u=t[e],c=t[e+1]||r;if(He(c)){if(s=Yd(i,c),!s)return null;o.push({type:mt.relationConnection,value:s,valueType:Vi(a,(0,l.path)(Ld(),s))});continue}if(He(u)){const e=n[c];if(!e)return null;o.push({type:mt.tempEntity,value:e,valueType:pn(a,e.type)});continue}const p=n[u],d=il(p,c),y=n[c];if(!d||!y)return null;o.push({type:mt.attributeValue,value:d,valueType:Ur(a,nt(d.uri,p.type))}),o.push({type:mt.tempEntity,value:y,valueType:pn(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},yh(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=He(s),d=p?qd(i,s):n[s],[y,f]=t!==s?(e=>{const t=e.split("/attributes/").slice(1).join("/attributes/");if(!t)return[];const[r,n]=t.split("/").reduce(((e,t,r)=>(e[r%2==0?0:1].push(t),e)),[[],[]]);return r.length!==n.length?[]:[r,n]})(t):[[],[]];if(!d||!y||!f)return null;let T,E=p?Vi(a,d.type):pn(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:Cr(a,E);if(E=null==t?void 0:t.find((0,l.propEq)("name",y[e])),!E)return null;{var h,b,O,v;const t=t=>{let{uri:r}=t;return r.endsWith(`/${f[e]}`)},r=null===(h=m[E.name])||void 0===h?void 0:h.find(t),i=null===(b=T)||void 0===b||null===(O=b.attributes)||void 0===O||null===(v=O[E.name])||void 0===v?void 0:v.find(t),s=i||r;if(!s)return null;i&&o.push({type:mt.tempEntity,value:T,valueType:pn(a,T.type)}),o.push({type:mt.attributeValue,value:s,valueType:E}),m=s.value;const l=Ms(s);T=l&&We(l)?n[l]:null}}return o},Th=e=>e.every((e=>{let{type:t}=e;return[mt.attributeValue,mt.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===mt.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null;let Eh;!function(e){e.insertAttribute="insertAttribute",e.updateAttribute="updateAttribute",e.deleteAttribute="deleteAttribute"}(Eh||(Eh={}));const mh={[Eh.insertAttribute]:{color:"#599E0E"},[Eh.updateAttribute]:{backgroundColor:"rgba(255, 187, 0, 0.12)",color:"#CC7500"},[Eh.deleteAttribute]:{backgroundColor:"rgba(255, 50, 0, 0.2)",color:"#CF0E26"}},hh=e=>{switch(e){case"UPDATE_ATTRIBUTE":return Eh.updateAttribute;case"UNDO_IGNORE_ATTRIBUTE":case"INSERT_ATTRIBUTE":return Eh.insertAttribute;case"IGNORE_ATTRIBUTE":case"DELETE_ATTRIBUTE":return Eh.deleteAttribute;default:return""}},bh="/",Oh=(0,l.pipe)((0,l.split)(bh),(0,l.propSatisfies)((0,l.lte)(2),"length")),vh=(0,l.pipe)((0,l.split)(bh),(0,l.slice)(0,-2),(0,l.join)(bh)),gh=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.has)(e),(0,l.prop)(e)],[()=>Oh(e),gh(vh(e))]])(t))),_h=e=>(0,l.pipe)(l.keys,(0,l.any)((0,l.startsWith)(e+bh))),Ah=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=gh(e,t);return(0,l.isNil)(r)?_h(e)(t)?"UPDATE_ATTRIBUTE":"":r},Nh=function(e,t){var r;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return null==n||null===(r=n[e])||void 0===r?void 0:r[t]},Ph=e=>{let t=[];var r;return e&&(t.push({uri:e.uri,crosswalks:e.crosswalks,merges:e.merges}),null===(r=e.merges)||void 0===r||r.forEach((e=>{e.losers.forEach((e=>{t=t.concat(Ph(e))}))}))),t},Rh=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)(Uh,t),(0,l.propOr)([],"crosswalks",e))),e),Sh=(e,t)=>{let r=e.crosswalks||[];var n;return t||null===(n=e.merges)||void 0===n||n.forEach((e=>{var t;null===(t=e.losers)||void 0===t||t.forEach((e=>{r=r.concat(Sh(e))}))})),r},wh=e=>{let t=0;var r;return e?(null===(r=e.merges)||void 0===r||r.forEach((e=>{var r;null===(r=e.losers)||void 0===r||r.forEach((e=>{const r=wh(e);r>t&&(t=r)}))})),t+1):t},Ih=(e,t)=>{if(We(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},Uh=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},Ch=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},Dh=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},Lh=(e,t)=>{const r=t.reduce(((e,t)=>(e["configuration/sources/"+t.name]=t,e)),{}),n=t.reduce(((e,t)=>(e[t.id]=t,e)),{});return(0,l.pipe)((0,l.map)((e=>{var t,i;if(r[e.type])return r[e.type];const a=null===(t=e.crosswalkExternalInfo)||void 0===t||null===(i=t.dtssInfo)||void 0===i?void 0:i.tenantId;return a&&n[a]?n[a]:void 0})),(0,l.reject)(l.isNil),l.uniq,(0,l.ifElse)((e=>{let{length:t}=e;return 1===t}),l.head,(()=>{})))(e)},jh=(0,l.eqBy)(Uh),kh=(0,l.pipe)((0,l.propOr)({},"attributes"),l.values,l.flatten,(0,l.filter)((0,l.has)("refRelation")),(0,l.chain)((e=>(0,l.pipe)(Cs,(0,l.propOr)([],"crosswalks"),(0,l.map)((0,l.when)((0,l.pipe)((0,l.prop)("attributeURIs"),E),(0,l.assoc)("attributeURIs",[e.uri]))))(e))));function Fh(e){return e&&void 0!==e.uri}function Mh(e){return function(t,r){var n,i,a=[];return i=r,!(n=t)&&!i||!(!n||!i)&&n.length===i.length&&n.every((function(e,t){return e===i[t]}))||a.push({type:e,newValue:r}),a}}function xh(e,t){function r(r){if(e[r]&&t[r])if(Array.isArray(e[r])&&Array.isArray(t[r])){if(e[r].length!==t[r].length)return!1;if(e[r][0]&&t[r][0]&&e[r][0].objectURI!==t[r][0].objectURI)return!1}else if(e[r].objectURI!==t[r].objectURI)return!1;return!0}return r("refEntity")&&r("refRelation")}function $h(e,t,r){var n,i,a,o=[];for(var s in e)if(e.hasOwnProperty(s)){if("paging"===s)continue;var u=e[s];if(void 0===t[s])for(var c in u)u.hasOwnProperty(c)&&o.push.apply(o,m(u[c]));else for(var p in u)if(u.hasOwnProperty(p)){var d=u[p],y=_(d,t[s]);void 0===y?o.push.apply(o,m(d)):d.value===y.value||d.lookupCode&&d.lookupCode===y.lookupCode?d.ignored!==y.ignored&&o.push.apply(o,b(y)):null==y.value||""===y.value?o.push.apply(o,m(d)):"Nested"===g(d)?d.ignored!==y.ignored&&(0,l.equals)(d.value,y.value)?o.push.apply(o,b(y)):o=o.concat($h(d.value,y.value,r)):"Reference"===g(d)?xh(d,y)?o.push.apply(o,$h(d.value,y.value,r)):(o.push.apply(o,m(d)),o.push(O([y]))):""!==y.value&&(!1===y.ov?o.push.apply(o,(void 0,void 0,i=(n=y).uri.lastIndexOf("/"),a=n.uri.substr(0,i),[{type:"_UPDATE_NON_OV_ATTRIBUTE",uri:n.uri,typeUri:a,value:n.lookupCode||n.value}])):o.push.apply(o,h(y)))}}for(var f in t)if(t.hasOwnProperty(f)){if("paging"===f)continue;var T=(t[f]||[]).filter((function(t){return void 0===_(t,e[f])}));(T=E((0,l.clone)(T))).length&&o.push(O(T))}return o;function E(e){return e?e.map((function(e){var t;if(e){var r=e.value;return null!=r&&(ce(r)?Object.keys(r).forEach((function(e){var n=E(r[e]);n.length>0?r[e]=n:delete r[e],t||(t=0!==n.length)})):t=null!=r&&""!==r),t||e.lookupCode||e.refEntity?e:null}})).filter((function(e){return null!=e})):[]}function m(e){return[{type:"DELETE_ATTRIBUTE",uri:e.uri}]}function h(e){return[{type:"UPDATE_ATTRIBUTE",uri:e.uri,newValue:{value:e.lookupCode||e.value}}]}function b(e){return e&&(e.ignored?function(e){return[{type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}}]}(e):function(e){return[{type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!1}}]}(e))}function O(e){var t=e[0].uri,n=t.lastIndexOf("/"),i={type:"INSERT_ATTRIBUTE",uri:t=t.substr(0,n),newValue:e.map((function(e){var t,n={value:JSON.parse(JSON.stringify(e.lookupCode||e.value))};return r&&(n.uri=e.uri),v(n.value),e.refEntity&&(t=e.refEntity,Array.isArray(t)&&(t=t[0]),n.refEntity=t),e.refRelation&&(t=e.refRelation,Array.isArray(t)&&(t=t[0]),r||delete t.objectURI,n.refRelation=t),n}))};return i}function v(e){if(null!==e&&"[object Object]"===e.toString())for(var t in e)e.hasOwnProperty(t)&&"paging"!==t&&e[t].forEach((function(e){delete e.crosswalks,delete e.type,r||delete e.uri,v(e.value)}))}function g(e){var t=e.value;if(ce(t))return e.hasOwnProperty("refEntity")?"Reference":"Nested"}function _(e,t){if(void 0!==t)return t.filter((function(t){return t.uri===e.uri}))[0]}}function Vh(e,t){var r,n,i=[];return e.defaultProfilePic!==t.defaultProfilePic?i.push({type:"UPDATE_PROFILE_PIC_BY_URI",newValue:{value:t.defaultProfilePic}}):(r=e.defaultProfilePicValue)===(n=t.defaultProfilePicValue)||Fh(r)&&Fh(n)&&r.uri===n.uri||i.push({type:"UPDATE_PROFILE_PIC_BY_URL",newValue:{value:t.defaultProfilePicValue}}),i}function Gh(e,t){var r=[],n=a(e.startDate,t.startDate);void 0!==n&&r.push({type:"UPDATE_START_DATE",newValue:{value:n}});var i=a(e.endDate,t.endDate);return void 0!==i&&r.push({type:"UPDATE_END_DATE",newValue:{value:i}}),r;function a(e,t){var r;return e!=t&&(r=(0,l.isNil)(t)?"":t+""),r}}function Wh(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;var n="configuration/sources/Reltio",i="configuration/sources/ReltioCleanser";function a(e,t){return e.crosswalk={type:t.type,value:t.value},e}function o(e,t){return e.reduce((function(e,r){return(e[r[t]]=e[r[t]]||[]).push(r),e}),{})}function s(e){return e.removeIt=!0}var l=e.map((function(e){if(e.crosswalk)return[e];var o=Bh(t,e.uri),s=o.filter((function(e){return e.type===n})),l=o.filter((function(e){return e.type!==n})),u=[];switch(e.type){case"INSERT_ATTRIBUTE":u.push(e);break;case"_UPDATE_NON_OV_ATTRIBUTE":u=u.concat(o.map((function(t){return a(e,t)})));break;case"DELETE_ATTRIBUTE":(l.length||0==s.length)&&u.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}}),u=u.concat(s.map((function(t){return a({type:"DELETE_ATTRIBUTE",uri:e.uri},t)})));break;case"UPDATE_ATTRIBUTE":{const o=l.some((e=>{let{type:t}=e;return t===i}))&&r?Yh(r,t,e.uri):null;if(o||s.length){if(s.length)u=u.concat(s.map((function(t){return a({type:"UPDATE_ATTRIBUTE",uri:e.uri,newValue:e.newValue},t)})));else if(o){var c=Bh(t,o.uri).filter((e=>{let{type:t}=e;return t===n}));u=u.concat(c.map((t=>a({type:"UPDATE_ATTRIBUTE",uri:o.uri,newValue:e.newValue},t))))}}else u.push({type:"INSERT_ATTRIBUTE",uri:e.uri.substr(0,e.uri.lastIndexOf("/")),newValue:[e.newValue],insteadOfUpdate:!0});l.length&&u.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}});break}}return u})),u=[].concat.apply([],l),c=o(u,"typeUri");for(var p in c)if("undefined"!==p){var d=c[p],y=u.filter((function(e){return"_UPDATE_NON_OV_ATTRIBUTE"!==e.type})).filter((function(e){return e.uri.substr(0,e.uri.lastIndexOf("/"))===p||"INSERT_ATTRIBUTE"===e.type&&e.uri===p})),f=d.filter((function(e){return e.crosswalk&&e.crosswalk.type===n}))[0],T=y.filter((function(e){return"UPDATE_ATTRIBUTE"===e.type}))[0];!T&&f&&(u.push({type:"UPDATE_ATTRIBUTE",uri:f.uri,newValue:{value:f.value},crosswalk:f.crosswalk}),y.forEach(s)),d.forEach(s)}return(u=u.filter((function(e){return!e.removeIt}))).forEach((function(e){delete e.insteadOfUpdate})),u}const Bh=(e,t)=>e.filter((function(e){return 1===(e.attributes||e.attributeURIs||[]).filter((function(e){return e===t})).length})),Yh=(e,t,r)=>(0,l.pipe)(al,(0,l.defaultTo)([]),(0,l.reject)((0,l.propEq)("uri",r)),(0,l.ifElse)((0,l.allPass)([e=>1===e.length,e=>{let[r]=e;return Ih(t,r)},e=>{let[t]=e;return!Ss(t)}]),(0,l.prop)(0),(0,l.always)(null)))(e,r);function qh(e,t){for(var r in t=t||[],e)if(e.hasOwnProperty(r))for(var n=e[r],i=0;i<n.length;i++){var a=n[i];if(a.refRelation){var o=a.refRelation[0]||a.refRelation;if(o.crosswalks)for(var s=o.crosswalks.filter((function(e){return e.attributes||e.attributeURIs})),l=0;l<s.length;l++){for(var u=!0,c=0;c<t.length;c++)if(t[c].type===s[l].type&&t[c].value===s[l].value){t[c].attributes=t[c].attributes||t[c].attributeURIs,t[c].attributes=t[c].attributes.concat(s[l].attributes||s[l].attributeURIs),t[c].attributes=Object.keys(t[c].attributes.reduce((function(e,t){return e[t]=!0,e}),{})),delete t[c].attributeURIs,u=!1;break}u&&t.push(s[l])}}}return t}function Hh(e,t){return Mh("UPDATE_TAGS").call(this,e,t)}function Jh(e,t){return Mh("UPDATE_ROLES").call(this,e,t)}function Qh(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){Kh(e,t,r[t])}))}return e}function Kh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Xh=function(e){var t=function(e,r,n,i){if(e&&r)if(n||(n=null),i=!!i,Array.isArray(e))for(var a=0;a<e.length;a++)r.call(n,a,e[a],e),i&&t(e[a],r,n,i);else if(ce(e))for(var o in e)r.call(n,o,e[o],e),i&&t(e[o],r,n,i)},r=function(e,t,r){return function(n){var i=-1!==n.uri.lastIndexOf("/")?n.uri.substring(0,n.uri.lastIndexOf("/")):"";e[i]||(e[i]=[]),e[i].push(n.type),t[n.uri]=n.type,"IGNORE_ATTRIBUTE"===n.type&&r.push(n.uri)}},n=function(e,t,r){var n=[],i=Object.keys(e).filter((function(t){return-1!==e[t].indexOf("IGNORE_ATTRIBUTE")&&-1!==e[t].indexOf("INSERT_ATTRIBUTE")}));return Object.keys(t).filter((function(e){var t=-1!==e.lastIndexOf("/")?e.substring(0,e.lastIndexOf("/")):null;return-1!==i.indexOf(t)})).forEach((function(e){-1!==r.indexOf(e)&&n.push(e),t[e]="UPDATE_ATTRIBUTE"})),{appearance:t,ignored:n}},i=function(e,t){var r=Array.isArray(t),n=r?[]:{};return r?(e=e||[]).some((function(e){return e.uri}))?n=function(e,t){var r=e.map((function(e){return e.uri})),n=e.map((function(e){var r,n,a=(n=t.filter((function(t){return t.uri===e.uri}))[0]||{},(r=e)&&n&&r.ignored!==n.ignored&&(delete r.ignored,delete n.ignored,r.ov=!0,n.ov=!0),{a:r,b:n});return i(a.a,a.b)})),a=t.filter((function(e){return-1===r.indexOf(e.uri)}));return n.concat(a)}(e,t):(n=n.concat(e),t.forEach((function(t,r){void 0===n[r]?n[r]=t:ce(t)?n[r]=i(e[r],t):-1===e.indexOf(t)&&n.push(t)}))):(ce(e)&&Object.keys(e).forEach((function(t){n[t]=e[t]})),Object.keys(t).forEach((function(r){ce(t[r])&&e[r]?n[r]=i(e[r],t[r]):n[r]=t[r]}))),n},a=function(){let a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var s=JSON.parse(JSON.stringify(a)),l=JSON.parse(JSON.stringify(o)),u=i(a,o),c={},p={},d=[],y=r(p,c,d);e.compareAttributes(u,l).map((function(e){return"IGNORE_ATTRIBUTE"===e.type&&!1===e.newValue.value&&(e.type="UNDO_IGNORE_ATTRIBUTE"),e})).forEach((function(e){y(e)})),e.compareAttributes(u,s).map((function(e){return"DELETE_ATTRIBUTE"===e.type&&(e.type="INSERT_ATTRIBUTE"),"IGNORE_ATTRIBUTE"===e.type&&(e.type=e.newValue.value?"UNDO_IGNORE_ATTRIBUTE":"IGNORE_ATTRIBUTE"),e})).forEach((function(e){y(e)}));var f=n(p,c,d);return t(u,(function(e,t){t&&-1!==this.indexOf(t.uri)&&(t.ignored=!0,delete t.ov,t.hidden=!0)}),f.ignored,!0),{attributes:u,appearance:f.appearance}};const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=(0,l.difference)(t,e),n=(0,l.difference)(e,t),i=n.concat(t),a=(e,t)=>(0,l.pipe)((0,l.map)((t=>[t,e])),l.fromPairs)(t),o=Qh({},a("INSERT_ATTRIBUTE",r),a("DELETE_ATTRIBUTE",n));return[i,o]};return{computeHistoryDiff:a,computeEntityHistoryDiff:(e,t)=>{const{attributes:r,appearance:n}=e?a(e.attributes,t.attributes):{attributes:t.attributes,appearance:{}},[i,s]=o(e?e.roles:[],t.roles),[l,u]=o(e?e.tags:[],t.tags);return{attributes:r,appearance:Qh({},n,{roles:s,tags:u}),roles:i,tags:l}}}};const zh=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?zh(t.value):[]];return e.concat(r)}),[])),Zh=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,eb=e=>e?[gp(e)]:[],tb=e=>{const t=[...zh((null==e?void 0:e.attributes)||[]),...zh((null==e?void 0:e.analyticsAttributes)||[])];return e?[...eb(e),...t]:[]},rb=(e,t)=>[e,...t.map((t=>Zh(e,t)))],nb=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return hd(t)}))},ib=(e,t)=>{switch(e){case ht.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case ht.ENTITY_ATTRIBUTE:case ht.RELATION_ATTRIBUTE:return(e=>{let{uri:t}=e;return[it(t)]})(t);case ht.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case ht.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n,dataTenant:i}}}=e;return[t,gp({uri:n,dataTenant:i}),r]})(t)}},ab=e=>(0,l.pipe)(l.values,(0,l.map)((0,l.map)((0,l.pipe)((0,l.prop)("replies"),l.inc))),(0,l.map)(l.sum),l.sum)(e),ob=(0,l.curry)(((e,t)=>{const r=Ho(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(ob(e,r.extendsTypeURI)):n})),sb=(0,l.curry)(((e,t)=>(0,l.reduce)(((t,r)=>(0,l.assoc)(r,((e,t)=>(0,l.path)(["members",t],e))(e,r),t)),{},t))),lb=(e,t)=>(0,l.pipe)((0,l.prop)("type"),ob(e),sb(t))(t),ub=e=>{const t=r=>r.reduce(((r,n)=>Math.max(r,(t=>106+16*(t.level||0)+6.5*t.item[e].length)(n),t(n.items?n.items.flat(1/0):[]))),0);return t};var cb,pb=r(33164);function db(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e.PotentialMatches="potentialMatches",e.Random0="random0",e.Random1="random1",e.SpectreYellowCyan="spectreYellowCyan",e.SpectreBlueBrown="spectreBlueBrown",e.Charts="charts",e.Crosswalks="crosswalks"}(cb||(cb={}));const yb={},fb={random0:{granularity:3,colors:["#ffee91","#ffdc0e","#fec92f","#eab710","#f69785","#f57f27","#fccde5","#f8b6b8","#ff9acc","#ee4272","#b71137","#c4c0e1","#bd81be","#5f3577","#9fd6bf","#8accca","#12959f"]},potentialMatches:{colors:["#fec92f","#ee4272","#6d9a35","#555962","#2d9ecf"]},random1:{colors:["#fccde5","#ff9acc","#81b2d3","#f8b6b8","#bd81be","#82c55c","#c4e3f1","#7f939e","#ffee91","#fec92f","#ee4272","#2d9ecf","#c4c0e1","#7accca","#cdc393","#f69785","#f0ecc7","#9fd6bf","#6d9a35","#afbc26","#12959f","#aacf99","#056b97","#eab710","#b4d36a","#70bede","#f57f27","#7a843b","#cfd0d2","#555962","#b71137","#ffdc0e","#bea68c","#5f3566"]},spectreYellowCyan:{granularity:3,colors:["#ffee91","#ffdc0e","#fec92f","#eab710","#f69785","#f57f27","#fccde5","#f8b6b8","#ff9acc","#ee4272","#b71137","#c4c0e1","#bd81be","#5f3577","#9fd6bf","#7accca","#12959f"]},spectreBlueBrown:{granularity:3,colors:["#c4e3f1","#70bede","#81b2d3","#2d9ecf","#056b97","#aacf99","#b4de6a","#82c55c","#6d9a35","#afbc26","#7a843b","#cfd0d2","#7f939e","#555962","#f0ecc7","#cfc393","#bea68c"]},charts:{colors:["#0072ce","#c4ce00","#ce5c00","#4bafff","#f97061","#9e7ed3","#c34980","#c4ce00","#669977","#ffe16f","#4896df","#40cfbb","#9bc66a","#ce5c00","#4bafff","#f085f2","#bea68c"]},crosswalks:{colors:["#86f2f9","#cae815","#f8a4a4","#fd63c0","#b6c5ec","#8fe98e","#ff9c72","#84cbf3","#a8f384","#d9ffa8","#ace1ff"]}},Tb=e=>{if(!yb[e]){const t=fb[e]||fb.random0;yb[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){db(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return yb[e]},Eb=(0,l.curry)(((e,t)=>{const r=Tb(e);return r.idToColor[t]||(r.idToColor[t]=(e=>{const t=e.counter,r=e.granularity||1;return e.counter+=r,e.counter>=e.colors.length&&(++e.granularityCounter>=r&&(e.granularityCounter=0),e.counter=e.granularityCounter),e.colors[t]})(r)),r.idToColor[t]})),mb=e=>Eb(cb.Charts,e),hb=()=>Tb(cb.PotentialMatches).colors,bb=e=>Eb(cb.Random1,e),Ob=e=>(0,pb.getColor)(e)?"#FFFFFF":"#212121";var vb=r(73116);const gb=Array.from({length:100},((e,t)=>t/100)),_b=e=>{const t=Number(e.replace(/\D/g,""))||0;let r=3735928559^t,n=1103547991^t;for(let t,i=0;i<e.length;i++)t=e.charCodeAt(i),r=Math.imul(r^t,2654435761),n=Math.imul(n^t,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&n)+(r>>>0)},Ab={},Nb=new vb.Z({hash:_b,saturation:gb.slice(15,71),lightness:gb.slice(50,90)}),Pb=new vb.Z({hash:_b,saturation:gb.slice(46,89),lightness:gb.slice(44,58)}),Rb=(0,l.curry)(((e,t,r)=>{t in Ab||(Ab[t]={});const n=Ab[t];r in n||(n[r]=((e,t)=>{const r=String(_b(t));return e.hsl(r)})(e,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),Sb=Rb(Nb,"crosswalks"),wb=Rb(Nb,"sources"),Ib=Rb(Nb,"contributors"),Ub=Rb(Nb,"dataValidationFunctions"),Cb=Rb(Pb,"entities");function Db(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){Lb(e,t,r[t])}))}return e}function Lb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jb=(0,l.has)("items"),kb=e=>0===e,Fb=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.MAX_SAFE_INTEGER;return Math.min(Math.max(e,t),r)},Mb=e=>e.reduce(((e,t)=>e+t.width),0),xb=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),$b=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),Vb=e=>e.reduce(((e,t)=>e+t.height),0),Gb=e=>(0,l.is)(String,e)&&e.includes("%"),Wb=(0,l.has)("spacer"),Bb=(e,t)=>Math.max(Math.round(parseFloat(t)/100*e),1),Yb=e=>((null==e?void 0:e.items)||[]).reduce(((e,t)=>e.concat(jb(t)?Yb(t):t)),[]),qb=(e,t)=>{const r=[...t];for(;(0,l.sum)(r)>e;){const e=Math.max(...r);if(1===e)break;const t=r.indexOf(e);r[t]--}return r},Hb=e=>({id:e.layout}),Jb=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Hb;const i=(e,t,r,n)=>{let{width:i}=e;const a=t.items.some((e=>e.flex));let o;if(a){const[e,n]=(0,l.partition)((0,l.propIs)(Number,"flex"),t.items),a=(0,l.pipe)((0,l.map)((0,l.pipe)((0,l.prop)("flex"),parseInt)),l.sum)(e),s=Math.round(i-i*(a/(a+n.length))),u=Math.max(s/Math.max((0,l.length)(n),1),1),c=(e,t,r)=>Math.max(Math.round(t/r*e),1);o=r.flex?c(i,r.flex,a+n.length):u}else{const[e,n]=(0,l.partition)((0,l.both)((0,l.propIs)(String,"width"),(0,l.pipe)((0,l.propOr)("","width"),(0,l.includes)("%"))),t.items),a=(0,l.pipe)((0,l.map)((0,l.pipe)((0,l.prop)("width"),parseInt)),l.sum)(e),s=Math.round(i-i*(a/100)),u=Math.max(s/Math.max((0,l.length)(n),1),1);o=Gb(r.width)?Bb(i,r.width):u}return Fb(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return Fb(n,t,r)},o=(e,t)=>jb(t.items[0])?p(e,t.items[0]):null,s=(t,r)=>{const o=r.items.map((a=>i(t,r,a,jb(a)?n(a.layout):e(a.view)))),s=qb(t.width,o),u=r.items.reduce(((r,n,i)=>{const o=s[i],u=kb(i)?t.x:(0,l.last)(r).x+(0,l.propOr)(o,"width",(0,l.last)(r));if(jb(n))return r.concat(p(Db({},t,{x:u,width:o}),n));{const i=e(n.view);return r.push(Db({y:t.y,x:u,height:a(i),width:o},i)),r}}),[]);return{x:t.x,y:t.y,width:Mb(u),height:xb(u),items:u}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=jb(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=kb(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(jb(i))return r.concat(p(Db({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(Db({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?Fb(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?Fb(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:$b(i),height:Vb(i),items:i}},c=(t,r)=>{const n=(e,t,r,n)=>kb(r)?e.y:(0,l.last)(t).y+((0,l.last)(t).height||n),i=(t,r,i,o)=>{const s=e(i),l=t.width,u=a(s),c=n(t,r,o,u);return Db({},s,{x:t.x,y:c,width:l,height:u})},o=(e,t)=>{const r=t.reduce(((t,r,a)=>{if("string"==typeof r)t.push(i(e,t,r,a));else if("object"==typeof r){const o=Math.max(Math.round(e.width/2),1),s=qb(e.width,[o,o]),u=Db({},e,{width:s[0]}),c=Db({},e,{x:e.x+s[0],width:s[1]}),p=(0,l.has)("left",r)&&i(u,t,r.left,a),d=(0,l.has)("right",r)&&i(c,t,r.right,a),y=(0,l.propOr)(0,"height"),f=Math.max(y(p),y(d));t.push(Db({},e,{y:n(e,t,a,f),height:f,items:(0,l.filter)(l.identity,[p,d])}))}return t}),[]);return Db({},e,{height:Vb(r),items:r})},s=o(t,(0,l.propOr)([],"top",r)),u=Math.round(.66*t.width),c=(0,l.isEmpty)(s)?t.y:t.y+s.height,p=o(Db({},t,{y:c,width:u}),(0,l.propOr)([],"center",r)),d=o({x:t.x+u,y:c,width:t.width-u},(0,l.propOr)([],"right",r)),y=s.height+Math.max(p.height,d.height),f=(0,l.pipe)((0,l.prop)("items"),l.length,(0,l.equals)(0));return Db({},t,{height:y,items:(0,l.reject)(f,[s,p,d])})},p=(e,t)=>{const r=Db({},t,{items:(0,l.reject)(Wb,t.items)});switch(r.layout){case"scroll":return o(e,r);case"hbox":return s(e,r);case"vbox":return u(e,r);default:return null}},d=(0,l.propEq)("layout","profile",t),y={x:0,y:0,width:r.columns},f=d?c(y,t):p(y,t);return Yb(f)},Qb=(e,t)=>(e||[]).filter((e=>t.some((t=>t.id===e.id)))),Kb=[Mt.FilteredEntitiesViewFacet,Mt.ActivitiesViewFacet,Mt.ProfileStatsFacet,Mt.FilteredSavedSearchesFacet],Xb=(e,t)=>e.map((e=>{let{height:r=0,minHeight:n=0}=e,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["height","minHeight"]);const a=t.find((e=>e.id===i.id)),o=Kb.includes(a.component)?8:4;return Db({},i,{height:Math.max(r,o),minHeight:Math.max(n,o)})}));function zb(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){Zb(e,t,r[t])}))}return e}function Zb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const eO={BarChart:Ft.BAR,BarChartGrouped:Ft.BAR,BarChartHorizontal:Ft.BAR,LineChart:Ft.LINE,Map:Ft.MAP,Pie:Ft.PIE},tO=(e,t)=>at(e)?tt(e,t):e,rO=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=eO[r];return zb({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},nO=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return zb({findPublic:r},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(t,["findShared"]))},iO=(e,t,r)=>{const n=(e=>e&&ie(e).map((e=>{const{type:t,value:r}=e;return zb({},e,{value:[gn,_n,bn.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:Nn(t),fieldName:r,values:n?ie(n):void 0}})))(e);return t&&at(t)||!r?n:(n||[]).concat((i=r,{filter:bn.EQUALS,fieldName:"type",values:[i]}));var i},aO=["https://reltio-ui-files.s3.amazonaws.com/map_resources/new_dashboard/world.countries.json","https://reltio-ui-files.s3.amazonaws.com/map_resources/new_dashboard/usa_prefix_latlng.topo.json","https://reltio-ui-files.s3.amazonaws.com/map_resources/new_dashboard/us-10m.json","https://reltio-ui-files.s3.amazonaws.com/map_resources/new_dashboard/zips-us-topo.json"],oO={"com.reltio.plugins.dashboard.BarChartView":e=>{let{id:t,entity:r,attribute:n,caption:i,filter:a,count:o,orderType:s,canRead:l}=e;return{id:t,count:o,canRead:l,orderType:s,attributeUri:tO(n,r),filters:iO(a,n,r),chartType:Ft.BAR,component:Mt.DashboardFacet,title:i}},"com.reltio.plugins.dashboard.BubbleChartView":e=>{let{id:t,entity:r,attribute:n,caption:i,filter:a,count:o,orderType:s,canRead:l}=e;return{id:t,count:o,canRead:l,orderType:s,attributeUri:tO(n,r),filters:iO(a,n,r),chartType:Ft.BUBBLE,component:Mt.DashboardFacet,title:i}},"com.reltio.plugins.ui.CustomActionView":e=>{let{id:t,caption:r,canRead:n,url:i}=e;return{id:t,url:i,canRead:n,title:r,component:Mt.CustomActionViewFacet}},"com.reltio.plugins.dashboard.FacetChartView":e=>{let{id:t,firstDimension:r,useEntityType:n,caption:i,filter:a,count:o,orderType:s,options:l,canRead:u}=e;const c=ie(a).find((e=>"type"===(null==e?void 0:e.attribute))),p=n||(null==c?void 0:c.value);return zb({id:t,count:o,canRead:u,orderType:s,attributeUri:tO(r,p),filters:iO(a,r,p),component:Mt.DashboardFacet,title:i,showOthers:!0},rO(l))},"com.reltio.plugins.dashboard.MapView":e=>{let{id:t,entity:r,attribute:n,caption:i,filter:a,count:o,orderType:s,mapType:l,canRead:u}=e;return{id:t,count:o,canRead:u,orderType:s,attributeUri:tO(n,r),filters:iO(a,n,r),chartType:Ft.MAP,component:Mt.DashboardFacet,title:i,geoUrl:aO[l||0],projection:"geoMercator"}},"com.reltio.plugins.dashboard.SimpleMapView":e=>{let{id:t,entity:r,attribute:n,caption:i,filter:a,count:o,map:s,canRead:l,options:u}=e;return zb({id:t,count:o,canRead:l,attributeUri:tO(n,r),filters:iO(a,n,r),component:Mt.DashboardFacet,title:i,geoUrl:s,chartType:Ft.MAP,projection:"geoMercator"},rO(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Mt.ProfileStatsFacet,title:n}},"com.reltio.plugins.dashboard.FilteredSavedSearchesView":e=>{let{id:t,caption:r,max:n,options:i,canRead:a}=e;return{id:t,canRead:a,options:nO(i),component:Mt.FilteredSavedSearchesFacet,title:r,max:n}},"com.reltio.plugins.dashboard.FilteredEntitiesView":e=>{let{id:t,caption:r,filter:n,max:i,entity:a,canRead:o}=e;return{id:t,canRead:o,filters:iO(n,null,a),component:Mt.FilteredEntitiesViewFacet,title:r,max:i}},"com.reltio.plugins.dashboard.MatchedEntitiesView":e=>{let{id:t,caption:r,max:n,canRead:i}=e;return{id:t,canRead:i,filters:[{filter:bn.GTE,fieldName:"matches",values:["1"]}],component:Mt.FilteredEntitiesViewFacet,title:r,max:n}},"com.reltio.plugins.dashboard.EntitiesByTypeView":e=>{let{id:t,caption:r,orderType:n="reversedCount",inheritChildren:i,hideEmpty:a,canRead:o}=e;return{id:t,canRead:o,component:Mt.EntitiesByTypeViewFacet,orderType:n,inheritChildren:i,hideEmpty:a,title:r}},"com.reltio.plugins.dashboard.EntitiesByTagView":e=>{let{id:t,caption:r,orderType:n,canRead:i}=e;return{id:t,canRead:i,orderType:n,title:r,chartType:Ft.CLOUD,component:Mt.DashboardFacet,attributeUri:"tags"}},"com.reltio.plugins.dashboard.EntitiesByRoleView":e=>{let{id:t,caption:r,orderType:n,canRead:i}=e;return{id:t,canRead:i,orderType:n,title:r,chartType:Ft.TREE,component:Mt.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Mt.NotificationInboxFacet,title:n||ye().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Mt.ActivitiesViewFacet,title:n||ye().text("Activity log")}}},sO=e=>({id:e,height:10}),lO=(0,l.pipe)((0,l.map)((e=>{const t=oO[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),uO=e=>{if("0.1"===e.version){const t=lO(e.views),r=Jb(sO,e.layout,{columns:4});return{id:e.id,margin:0,layout:Qb(r,t),views:t}}return e},cO=e=>(0,l.cond)([[(0,l.propEq)("layout","profile"),(0,l.pipe)((0,l.pick)(["center","right","top"]),l.values,l.flatten,(0,l.map)((0,l.when)((0,l.is)(Object),l.values)),l.flatten)],[(0,l.has)("view"),(0,l.pipe)((0,l.prop)("view"),ie)],[(0,l.prop)("items"),(0,l.pipe)((0,l.prop)("items"),(0,l.map)((e=>cO(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);function pO(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){dO(e,t,r[t])}))}return e}function dO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yO=pO({},xt,{OldMap:"com.reltio.plugins.entity.EntityMapView",OldTree:"com.reltio.plugins.entity.TreeView"}),fO=e=>e,TO={[yO.Attributes]:fO,[yO.HierarchyTree]:fO,[yO.HierarchyPaths]:fO,[yO.RelationsTable]:fO,[yO.Relations]:e=>pO({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[yO.SingleAttribute]:fO,[yO.Custom]:fO,[yO.AttributeTable]:fO,[yO.Map]:fO,[yO.OldTree]:e=>pO({},e,{class:xt.HierarchyTree}),[yO.OldMap]:e=>pO({},e,{class:xt.Map}),[yO.ImageAttribute]:fO,[yO.PotentialMatches]:fO},EO=(0,l.pipe)((0,l.map)((e=>{const t=TO[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),mO=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.defaultTo)([]),(0,l.find)((0,l.propEq)("id",t)),(0,l.prop)("class"))(e)===xt.Map?{id:t,height:5,minHeight:5}:{id:t,autosizing:!0})),hO=(e,t)=>(t||[]).map((t=>pO({},t,mO(e,t.id)))),bO=e=>{const t=(0,l.pick)(["id","workflow","maxWidth","sidePanelViews","profileBand","views"],e);if("2.0"===e.version)return pO({},t,{layout:hO(t.views,e.newLayout)});if("0.1"===e.version){const r=EO(e.views),n=Jb(mO(r),e.layout,{columns:3});return pO({},t,{layout:Qb(n,r),views:r})}return e},OO=(e,t)=>e.class===t||e["react-class"]===t,vO=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(OO(t,xt.Attributes))if(t.includeUris)e.includeUris.push(...t.includeUris);else{const r=t.excludeUris||[];e.excludeUris=e.excludeUris?(0,l.intersection)(e.excludeUris,r):r}return OO(t,xt.SingleAttribute)&&e.includeUris.push(t.attributeUri),e}),{includeUris:[],excludeUris:null}))(e),n=e=>{let{uri:n}=e;return r&&!r.some(Xe(n))||t.some(Xe(n))};return(e,t)=>(!t||n(t))&&n(e)},gO=(e,t)=>e.filter((e=>t.some((t=>OO(e,t))))).map((e=>{let{id:t}=e;return t})),_O=(e,t)=>{let{extensions:r}=e;return(r||[]).find((e=>e.id===t))},AO=(e,t)=>e.flatMap((e=>{let{extensions:r=[]}=e;return r.filter((e=>{let{point:r}=e;return r===t}))})),NO=e=>(0,l.pipe)((0,l.map)((e=>_O(e,"com.reltio.plugins.entity.ProfileBand"))),(0,l.reject)(l.isNil),l.head)(e);function PO(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){RO(e,t,r[t])}))}return e}function RO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const SO=(0,l.curry)(((e,t)=>cO(t).map((t=>(0,l.pipe)((0,l.map)((e=>_O(e,t))),(0,l.reject)(l.isNil),l.head)(e))).filter(l.identity))),wO=(0,l.either)((0,l.propEq)("label","D&B Connector"),(0,l.propEq)("label","D&B Connector")),IO=(0,l.propEq)("class",xt.Custom),UO=e=>{let{extensions:t=[]}=e;return t.filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]))},CO=(e,t)=>{const r=(0,l.propOr)("0.1","version",t),n=t["entity-type"];let i;if("2.0"===r&&t.newLayout){const{newLayout:r}=t,a=hO(t.views,r);return i=(0,l.when)((0,l.pipe)(l.head,(0,l.is)(String)),(0,l.pipe)((0,l.map)((t=>(0,l.pipe)((0,l.map)((e=>_O(e,t))),(0,l.reject)(l.isNil),l.head)(e))),(0,l.reject)(l.isNil),(e=>[{id:"common",views:e}])))(t.sidePanelViews),(0,l.pipe)((0,l.pick)(["views","profileBand","workflow"]),(0,l.mergeRight)({entityType:n,layout:a,sidePanelViews:i}),(0,l.reject)(l.isNil))(t)}const a=SO(e,t.layout);i=((e,t)=>{if(t.side){var r;const n=(0,l.pipe)((0,l.chain)((e=>_O(e,t.side))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("layout"))(e),[i,a]=(0,l.partition)(wO,null!==(r=null==n?void 0:n.items)&&void 0!==r?r:[]),o=(0,l.pipe)(SO(e),(0,l.filter)(IO))(PO({},n,{items:i})),s=[{id:"common",views:SO(e,PO({},n,{items:a}))}];return o.length>0&&s.push({id:"D&B",views:o}),s}})(e,t);const o=(e=>(0,l.pipe)((0,l.chain)((e=>((e,t)=>{let{extensions:r}=e;return(r||[]).filter((e=>"com.reltio.plugins.entity.side.WorkflowsView"===e.class))})(e))),l.head,(0,l.unless)(l.isNil,(0,l.pick)(["showClosedTasks","assignee","processTypes"])))(e))(e),s=bO(PO({},t,{views:a,version:"0.1"})),u=(0,l.pipe)(NO,(0,l.defaultTo)({}),(0,l.pick)(["cloneAction","showEntityId"]))(e);return(0,l.reject)(l.isNil,{entityType:n,views:s.views,layout:s.layout,sidePanelViews:i,profileBand:u,workflow:o})},DO=(e,t)=>{if("scroll"===t.layout.layout){const r=SO(e,t.layout),n=uO(PO({},t,{views:r,version:"0.1"}));return{class:Vt.Dashboard,id:t.id,views:n.views,layout:n.layout}}return{class:Vt.Dashboard,views:t.views,layout:t.layout,id:t.id}},LO=(e,t)=>{const r=SO(e,t.layout)[0];return{class:Vt.DQDashboard,id:t.id,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel,showTimeSeries:r.showTimeSeries}},jO=(e,t)=>{const r=SO(e,t.layout)[0];return{class:Vt.RelationshipSearch,id:t.id,options:r.options,consoleExportApp:r.consoleExportApp}},kO=(e,t)=>{const r=SO(e,t.layout)[0];return{class:Vt.Interactions,id:t.id,sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},FO=(e,t)=>{const r=SO(e,t.layout)[0];return{class:Vt.Relationships,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},MO=(e,t)=>{const r=SO(e,t.layout)[0];return{class:Vt.Sources,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},xO=(e,t)=>{const r=SO(e,t.layout)[0];return{class:Vt.PotentialMatches,id:t.id,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},$O=(e,t)=>{const r=SO(e,t.layout)[0],n=r.potentialMatchesReview||{processType:(e=>{const[t]=AO(e,"com.reltio.plugins.search.toolbar.component").filter((e=>"com.reltio.plugins.ui.CustomActionButtonView"===e.class&&e.processType));return null==t?void 0:t.processType})(e)};return{class:Vt.Search,id:t.id,consoleExportApp:r.consoleExportApp,mapSearchEnabled:r.mapSearchEnabled,canRead:r.canRead,"bulk-update":r["bulk-update"],potentialMatchesReview:n,options:r.options,"entity-types":r["entity-types"],tabs:r.tabs}},VO=(e,t)=>({class:Vt.Graph,id:t.id}),GO=(e,t)=>{const r=SO(e,t.layout)[0];return{class:Vt.ProfileActivityLog,id:t.id,exportTypes:r.exportTypes,caption:r.caption}},WO=e=>t=>!!(0,l.intersection)(e,t).length,BO=(0,l.cond)([[WO(["com.reltio.plugins.dashboard.BarChartView","com.reltio.plugins.dashboard.BubbleChartView","com.reltio.plugins.ui.CustomActionView","com.reltio.plugins.dashboard.FacetChartView","com.reltio.plugins.dashboard.MapView","com.reltio.plugins.dashboard.SimpleMapView","com.reltio.plugins.dashboard.ProfileStatsView","com.reltio.plugins.dashboard.FilteredSavedSearchesView","com.reltio.plugins.dashboard.FilteredEntitiesView","com.reltio.plugins.dashboard.EntitiesByTypeView","com.reltio.plugins.dashboard.EntitiesByTagView","com.reltio.plugins.dashboard.EntitiesByRoleView","com.reltio.plugins.inbox.NotificationInboxView","com.reltio.plugins.activities.ActivitiesView","com.reltio.plugins.react.ReactDashboardView"]),()=>DO],[WO(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>LO],[WO(["com.reltio.plugins.graph.GraphView"]),()=>VO],[WO(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>jO],[WO(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>kO],[WO(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>FO],[WO(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>MO],[WO(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>xO],[WO(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>$O],[WO(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>GO],[l.T,()=>(0,l.always)(void 0)]]),YO=(e,t)=>{const{class:r}=e;if("com.reltio.plugins.entity.ProfileAction"===r)return((e,t)=>{const r=(0,l.pipe)((0,l.chain)(UO),(0,l.map)((t=>CO(e,t))),(0,l.indexBy)((0,l.prop)("entityType")),(0,l.map)((0,l.pick)(["layout","views","sidePanelViews","profileBand","workflow"])))(e);return{class:Vt.Profile,id:t.id,entityTypes:r}})(t,e);if("com.reltio.plugins.ui.actions.CustomAction"===r)return{id:e.id,type:Gt.CustomAction,config:(0,l.omit)(["class","id","point","parent","type"],e)};if("com.reltio.plugins.ui.actions.ConsoleAppAction"===r)return{id:e.id,type:Gt.ConsoleAppAction,config:(0,l.omit)(["class","id","point","parent","type"],e)};const n=(e=>{if(e.perspective)return e.perspective})(e);if((0,l.isNil)(n))return;if("com.reltio.plugins.dashboard.DashboardPerspective"===n||"com.reltio.plugins.newDashboard.NewDashboardPerspective"===n){const e=(0,l.find)((0,l.propEq)("id","com.reltio.plugins.newDashboard"))(t);if(e)return(0,l.pipe)((e=>_O(e,"com.reltio.plugins.newDashboard.NewDashboardView")),(0,l.pick)(["id","views","layout"]),(0,l.assoc)("class",Vt.Dashboard))(e)}const i=(0,l.pipe)((0,l.map)((e=>_O(e,n))),(0,l.reject)(l.isNil),l.head)(t);if((0,l.isNil)(i))return;if(i.entityPerspectiveId)return((e,t,r)=>{const n=CO(e,r),i=(0,l.pipe)((0,l.propOr)([],"entity-types"),(0,l.map)((e=>[e,n])),l.fromPairs)(t);return{class:Vt.NestedProfile,id:t.id,entityTypes:i}})(t,e,i);const a=cO(i.layout),o=(0,l.pipe)((0,l.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>a.includes(e.id)))})),(0,l.pluck)("class"),(0,l.reject)(l.isNil))(t);return BO(o)(t,i)};function qO(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){HO(e,t,r[t])}))}return e}function HO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const JO=e=>{let{extensions:t}=e;return(t||[]).filter((e=>"com.reltio.plugins.ui.action"===e.point&&"com.reltio.plugins.ui.first_level_action"===e.type&&!e.parent))},QO="https://reltio-ui-files.s3.amazonaws.com/new-ui/";var KO;!function(e){e[e.DashboardGroup=0]="DashboardGroup",e[e.ProfileGroup=1]="ProfileGroup",e[e.SearchGroup=2]="SearchGroup"}(KO||(KO={}));const XO={[Vt.DQDashboard]:`${QO}DqDashboard.svg`,[Vt.Dashboard]:`${QO}Dashboard.svg`,[Vt.Graph]:`${QO}Graph.svg`,[Vt.RelationshipSearch]:`${QO}GraphSearch.svg`,[Vt.Interactions]:`${QO}Interactions.svg`,[Vt.PotentialMatches]:`${QO}PotentialMatches.svg`,[Vt.Profile]:`${QO}Profile.svg`,[Vt.NestedProfile]:`${QO}Profile.svg`,[Vt.ProfileActivityLog]:`${QO}ActivityLog.svg`,[Vt.Relationships]:`${QO}Relationships.svg`,[Vt.Sources]:`${QO}Crosswalk.svg`,[Vt.Search]:`${QO}Search.svg`,[KO.DashboardGroup]:`${QO}DashboardGroup.svg`,[KO.ProfileGroup]:`${QO}ProfileGroup.svg`,[KO.SearchGroup]:`${QO}SearchGroup.svg`,DEFAULT:`${QO}Default.svg`},zO=e=>XO[null==e?void 0:e.class]||XO.DEFAULT,ZO=(0,l.pipe)((0,l.pluck)("screen"),(0,l.filter)((0,l.anyPass)([(0,l.propEq)("class",Vt.NestedProfile)])),(0,l.groupBy)((0,l.prop)("class")),(0,l.map)((e=>e.map(((e,t)=>qO({},e,{nestedRoute:`${t+1}`})))))),ev=(e,t)=>{var r;return(null===(r=e[t.class])||void 0===r?void 0:r.find((0,l.propEq)("id",t.id)))||t},tv=e=>"com.reltio.plugins.entity.ProfileFirstAction"===e.class?XO[KO.ProfileGroup]:null,rv=e=>(0,l.cond)([[(0,l.any)((e=>{let{icon:t}=e;return t===XO[Vt.Dashboard]||t===XO[Vt.DQDashboard]})),(0,l.always)(XO[KO.DashboardGroup])],[(0,l.any)((e=>{let{icon:t}=e;return t===XO[Vt.Search]||t===XO[Vt.RelationshipSearch]})),(0,l.always)(XO[KO.SearchGroup])],[l.T,()=>null]])(e),nv=e=>(0,l.pipe)((0,l.chain)(JO),(0,l.sortBy)((0,l.propOr)(1/0,"position")))(e).map((t=>{const r=((e,t)=>{const r=(0,l.pipe)((0,l.chain)((t=>((e,t)=>{let{extensions:r}=e;return(r||[]).filter((e=>"com.reltio.plugins.ui.action"===e.point&&e.parent===t))})(t,e.id))),(0,l.sortBy)((0,l.propOr)(1/0,"position")),(0,l.map)((e=>qO({},e,{entityTypes:e["entity-types"],screen:YO(e,t)}))),(0,l.filter)((e=>e.screen)))(t),n=ZO(r);return(0,l.map)((e=>{let{label:t,screen:r,canRead:i,entityTypes:a}=e;return{label:t,icon:zO(r),screen:ev(n,r),canRead:i,entityTypes:a}}))(r)})(t,e),n=YO(t,e);return{label:t.label,icon:tv(t)||rv(r)||zO(n),menu:r.length?{type:"side",items:r}:void 0,screen:n,canRead:t.canRead}}));function iv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const av=e=>{let{extensions:t}=e;return(t||[]).filter((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},ov=e=>({id:e,height:10}),sv=e=>{const t=(e=>(0,l.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["attribute-types"]))}))(e))(e),r=(e=>(0,l.pipe)((0,l.chain)(av),(0,l.pluck)("pivotingAttributes"),l.flatten)(e))(e);return((e,t)=>{const r=(e=>(e||[]).find((0,l.propEq)("attribute-types","*")))(t);return(0,l.pipe)((0,l.reduce)(((e,n)=>{const i=((e,t)=>e.find((e=>Array.isArray(e["attribute-types"])&&e["attribute-types"].includes(t.uri))))(t,n)||r;return null!=i&&i.id&&(e[i.id]||(e[i.id]={extension:i,attributeTypes:[]}),e[i.id].attributeTypes.push(n)),e}),{}),l.values)(e)})(r,t).map((t=>{let{extension:r,attributeTypes:n}=t;const i=((e,t)=>{if("scroll"===t.layout.layout){const r=lO(((e,t)=>{const r=cO(t);return(0,l.pipe)((0,l.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>r.includes(e.id)))})),(0,l.filter)((e=>{let{views:t}=e;return t})),(0,l.map)((e=>{let{views:t,id:r}=e;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){iv(e,t,r[t])}))}return e}({id:r},t[0])})),(0,l.uniqBy)((0,l.prop)("id")))(e)})(e,t.layout)),n=Jb(ov,t.layout,{columns:4});return{views:r,layout:Qb(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))};function lv(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){uv(e,t,r[t])}))}return e}function uv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cv(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}const pv=(0,l.curry)(((e,t)=>(0,l.pipe)((e=>((e,t)=>(e||[]).find((e=>"com.reltio.plugins.ui.Activator"===e.activator)))(e)),(0,l.prop)(e))(t))),dv=e=>"com.reltio.plugins.dashboard.DashboardPerspective"===e,yv=(0,l.unless)((e=>!!e&&(e.startsWith("http:")||e.startsWith("https:"))),(0,l.always)(null)),fv=(0,l.pipe)(pv("top-logo"),yv),Tv=(0,l.prop)("showLookupCode"),Ev=e=>{var t;const r=(e=>(0,l.pipe)((0,l.map)((e=>_O(e,"com.reltio.plugins.entity.EntityRequestSettings"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("defaultMaxValues"))(e))(e),n=(e=>(0,l.pipe)((0,l.map)((e=>_O(e,"com.reltio.plugins.imageattribute.fieldsorder"))),(0,l.reject)(l.isNil),l.head,(0,l.omit)(["point","id"]))(e))(e),i=(e=>(0,l.pipe)((0,l.map)((e=>_O(e,"com.reltio.plugins.ui.LookupAutocomplete"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}),(0,l.pick)(["includeAttributes","excludeAttributes"]))(e))(e),a=(e=>(0,l.pipe)((0,l.map)((e=>_O(e,"com.reltio.plugins.entity.ValidationServiceLevels"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("levels"))(e))(e),o=(e=>(0,l.pipe)((0,l.map)((e=>_O(e,"com.reltio.plugins.entity.Validation"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("validateReadMode"))(e))(e),s=(e=>(0,l.pipe)((0,l.map)((e=>_O(e,"com.reltio.plugins.ui.LocalizationServer"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"))(e))(e),u=(e=>(0,l.pipe)((0,l.map)((e=>_O(e,"com.reltio.plugins.ui.AttributePresentation"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"),(0,l.defaultTo)({}),(0,l.filter)((0,l.propSatisfies)((0,l.either)(ce,(0,l.equals)("none")),"format")),(0,l.map)((e=>{let{format:t}=e;if("none"===t)return{thousandSeparator:""};const{groupSeparator:r,digitsAfterDecimalSeparator:n}=t;return lv({thousandSeparator:r,decimalScale:n},cv(t,["groupSeparator","digitsAfterDecimalSeparator"]))})))(e))(e),c=(e=>(0,l.pipe)((0,l.map)((e=>_O(e,"com.reltio.plugins.workflow.configuration"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}),(e=>{let{workflowPath:t,enabled:r}=e;return{enabled:r,path:t}}))(e))(e),p=(e=>(0,l.pipe)(pv("default-perspective"),(0,l.ifElse)(dv,(0,l.always)("dashboard"),(0,l.always)("search")))(e))(e),d=(e=>(0,l.pipe)((0,l.map)((e=>_O(e,"com.reltio.plugins.ui.AttributesSorting"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("strategy"))(e))(e),y=(e=>(0,l.pipe)((e=>AO(e,"com.reltio.plugins.ui.custom_script")),(0,l.reject)(E),(0,l.map)((e=>{let{action:t}=e;return lv({},t,cv(e,["action"]))})))(e))(e),f=(e=>pv("checkUser",e))(e),T=(e=>pv("checkIdle",e))(e),m=(e=>(0,l.pipe)((0,l.map)((e=>_O(e,"com.reltio.plugins.ui.configuration.FeatureManagement"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("preferNewUI"),l.not)(e))(e),h=(e=>(0,l.pipe)((0,l.map)((e=>_O(e,"com.reltio.plugins.ui.LookupCodeVisibility"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}))(e))(e),b=void 0===(O=Tv(h))||O;var O;const v=null===(t=NO(e))||void 0===t?void 0:t.showEntityId,g=(e=>pv("preview",e))(e),_=fv(e),A=(e=>pv("showAttributeDescription",e))(e),N=(e=>pv("topBackgroundColor",e))(e),P=(e=>(0,l.pipe)((0,l.map)((e=>_O(e,"com.reltio.framework.util.DateMask"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"),(0,l.defaultTo)({}),(e=>{let{dateMask:t,dateTimeMask:r}=e;return{dateMask:t,dateTimeMask:r}}),(0,l.reject)(l.isNil))(e))(e);return{i18n:s,entity:{requestSettings:{defaultMaxValues:r}},image:{attributeFieldsOrder:n},lookups:{autocomplete:i,showCode:b},validate:{levels:a,validateReadMode:o},masks:0===Object.keys(P).length?void 0:P,attributePresentations:u,attributesSorting:d,workflow:c,defaultRoute:p,customScripts:y,checkUser:f,checkIdle:T,showSwitchToClassic:m,showEntityId:v,preview:g,logo:_,showAttributeDescription:A,headerColor:N}},mv=e=>({layout:nv(e),pivoting:sv(e),properties:Ev(e)});function hv(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){bv(e,t,r[t])}))}return e}function bv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ov=e=>{let{views:t,layout:r}=e;const n={};let i=!1;const a=t.map((e=>{if(n[e.id]){const t=`${e.id}_${(0,De.x0)()}`;return n[e.id].push(t),i=!0,hv({},e,{id:t})}return n[e.id]=[e.id],e})),o={},s=r&&i?r.map((e=>null==o[e.id]?(o[e.id]=0,e):(o[e.id]++,hv({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}};function vv(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){gv(e,t,r[t])}))}return e}function gv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let _v={};const Av=(e,t,r)=>{const n=`\n importScripts("${e}");\n importScripts("${r.action.files.join('","')}");\n postMessage({action:'loaded'});`;let i;const a=z(`${r.id}: ${r.action.files.join('","')}`);if(E(_v[a])){try{const e=window.webkitURL||window.URL;i=new Worker(e.createObjectURL(new Blob([n],{type:"application/javascript"})))}catch(e){i=new Worker("data:application/javascript,"+encodeURIComponent(n))}_v=vv({},_v,{[a]:vv({},_v[a]||{},{worker:i})})}else i=_v[a].worker,_v[a].innerText&&t({task:{action:qt.SET_HTML,params:{html:_v[a].innerText}},worker:i,config:r}),i.removeEventListener("message",_v[a].onWorkerMessage);return i&&(_v[a].onWorkerMessage=e=>{if("loaded"!==e.data.action){const n=JSON.parse(e.data);t({task:n,worker:i,config:r}),"setHtml"!==n.action||n.params.id||(_v[a].innerText=n.params.html)}},i.addEventListener("message",_v[a].onWorkerMessage)),i},Nv=(0,l.curry)(((e,t)=>!e||!e.availableEntityTypes||!t||e.availableEntityTypes.includes(t))),Pv=(0,l.flip)(Nv);var Rv=r(83926);const Sv=(e,t)=>{const{thousandSeparator:r="",decimalSeparator:n=".",prefix:i="",suffix:a="",groupSize:o=3,decimalScale:s}=e,l=null!=s?new Rv.Decimal(t).toFixed(s):t,[u,c]=l.split("."),p=new RegExp(`\\B(?=(\\d{${o}})+(?!\\d))`,"g"),d=u.replace(p,r),y=null==c?void 0:c.replace(/(0|\.)+$/,"");return i+d+(y?n+y:"")+a};let wv;const Iv=()=>wv,Uv={setLocale:e=>{wv=e},getLocale:Iv,number:e=>((e,t)=>{const r=String(t);try{const t=(e=>{var t;e=null===(t=e)||void 0===t?void 0:t.replace(/_/g,"-");const r=new Intl.NumberFormat(e).formatToParts(1000000.1),n=e=>{var t;return null===(t=r.find((t=>{let{type:r}=t;return r===e})))||void 0===t?void 0:t.value};return{thousandSeparator:n("group"),decimalSeparator:n("decimal"),groupSize:((null===(i=r.filter((e=>{let{type:t}=e;return"integer"===t})).map((e=>{let{value:t}=e;return t})).sort(((e,t)=>t.length-e.length)))||void 0===i?void 0:i[0])||"000").length};var i})(e);return Sv(t,r)}catch(e){return console.warn("Number localization error"),r}})(Iv(),e),applyFormatToNumber:Sv},Cv=(0,l.curry)(((e,t)=>null==t?"":("string"!=typeof t&&(t=String(t)),e&&t?Uv.applyFormatToNumber(e,t):(!e&&t&&(t=Uv.number(t)),t)))),Dv=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?ye().number(e,"0,0.0a").toUpperCase():ye().number(e,"0,0"):""},Lv=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last));let jv=!0;const kv=e=>jv=e,Fv=(e,t)=>e!==t&&t?jv&&e?`${t} (${e})`:t:e,Mv=(e,t,r)=>(0,l.path)([t,r,"displayName"],e),xv=(e,t,r)=>{const n=Mv(e,t,r);return Fv(r,n)},$v=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),Vv=(0,l.complement)($v),Gv=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),Wv=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,l.pipe)((0,l.reduce)(((e,t)=>t.reduce(((e,t)=>{let{type:r,codeValues:n}=t;return e[r]={type:r,codeValues:(0,l.uniq)([...(0,l.pathOr)([],[r,"codeValues"],e),...n])},e}),e)),{}),l.values)(t)},Bv=(0,l.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter(Vv(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),Yv=(0,l.curry)(((e,t)=>{let{attributePresentations:r={},dataTypeDefinition:n={},dateMask:i,dateTimeMask:a}=e;const o=r[n.uri]||r[Dn],s=i?q(i):"L",u=a?Q(a):"L LTS";switch(n.type){case zt.TYPE_NUMBER:case zt.TYPE_FLOAT:case zt.TYPE_DOUBLE:case zt.TYPE_LONG:case zt.TYPE_INT:case zt.TYPE_COUNT:return t&&Cv(o,t);case zt.TYPE_BOOLEAN:case zt.TYPE_BOOLEAN_RADIO:case zt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t=t,(0,l.isNil)(t)?t:ue(t)?ye().text("Yes"):ye().text("No");case zt.TYPE_DATE:return(0,l.is)(Number,t)&&(t=A(Number(t)).getTime()),(t=t)&&(ac(t)?oc(t):ye().date(t,s));case zt.TYPE_ACTIVENESS_DATE:case zt.TYPE_LOCAL_DATE:return(t=t)&&(ac(t)?oc(t):ye().date(t,s));case zt.TYPE_TIMESTAMP:return(t=t)&&(ac(t)?oc(t):ye().date(isNaN(t)?t:Number(t),u));case zt.TYPE_FILE:return(0,l.propOr)(null,"filename",t);case zt.TYPE_SELECT:{const e=n.options.find((0,l.propEq)("value",t));return(0,l.propOr)(null,"label",e)}case zt.TYPE_DOLLAR:return t=t,new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0}).format(t);default:return(0,l.is)(Object,t)?Fv((0,l.propOr)(null,"lookupCode",t),(0,l.propOr)(null,"value",t)):t}})),qv={palette:{primary:{main:"#0072CE",light:"#0072CE",dark:"#0072CE"},secondary:{main:"#0072CE"},error:{main:"#FF1744"},background:{paper:"#FFF",default:"#FAFAFA"},action:{hover:"rgba(0,0,0,0.04)",hoverOpacity:.04},text:{primary:"rgba(0,0,0,0.87)",secondary:"rgba(0,0,0,0.54)",disabled:"rgba(0,0,0,0.26)"},divider:"rgba(0,0,0,0.38)"},overrides:{MuiFilledInput:{root:{backgroundColor:"rgba(0, 0, 0, 0.03)","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"},"&.focused":{backgroundColor:"rgba(0, 0, 0, 0.03)"}}},MuiInputBase:{input:{"&::placeholder":{color:"currentColor !important"},"&::-ms-clear":{display:"none"}}}},tooltip:{borderRadius:"4px",backgroundColor:"rgba(0,0,0,0.54)"},inactiveBackground:"repeating-linear-gradient(45deg, #f5f5f5, #f5f5f5 14px, #e9e9e9 15px, #e9e9e9 16px)",inactiveSelectedBackground:"repeating-linear-gradient(45deg, #DBE9F4, #DBE9F4 14px, #CCDAE5 15px, #CCDAE5 16px)",inactiveSelectedHoverBackground:"repeating-linear-gradient(45deg, #D4E2ED, #D4E2ED 14px, #C6D4DF 15px, #C6D4DF 16px)",inactiveHoverBackground:"repeating-linear-gradient(45deg, #f2f2f2, #f2f2f2 14px, #e2e2e2 15px, #e2e2e2 16px)",transitions:{duration:{shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195}},inactive:{opacity:.7},basicView:{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)",borderRadius:"3px",backgroundColor:"#FFFFFF"},suggested:"rgb(237, 246, 251)"};function Hv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Jv=e=>(t,r)=>{const{timeout:n}=r,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(r,["timeout"]);if(AbortController&&n){const r=new AbortController,a=setTimeout((()=>r.abort()),n);return e(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Hv(e,t,r[t])}))}return e}({},i,{signal:r.signal})).finally((()=>{clearTimeout(a)}))}return e(t,i)},Qv=e=>{const t=e=>{switch(e){case 429:case 502:case 503:case 504:return 4;default:return 0}},r=e=>{const t=Math.random()+1;return new Promise((r=>{const n=Math.min(Math.round(1e3*Math.exp(e)*t),2e4);setTimeout(r,n)}))};return(n,i)=>{const a=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e(n,i).then((e=>{const n=t(e.status);return n>0&&o<n?r(o).then((()=>a(o+1))):e}))};return a()}},Kv=e=>(t,r)=>e(t,r).then((e=>e.ok?e:e.text().then((t=>{let r;try{r=JSON.parse(t)}catch(n){r={errorMessage:t,errorCode:e.status,originalResponse:e}}throw r})))),Xv=e=>{const{onRequest:t,onResponse:r,addRequestInterceptor:n,addResponseInterceptor:i,removeRequestInterceptor:a,removeResponseInterceptor:o}=(()=>{const e={onRequest:[],onResponse:[]};return{onRequest:t=>{const{url:r,options:n,abort:i,resolve:a}=t,o=e.onRequest.reduce(((e,t)=>(r,n)=>t({url:r,options:n,abort:i,next:e,resolve:a})),t.next);o(r,n)},onResponse:t=>{const{response:r,abort:n,url:i,options:a}=t,o=e.onResponse.reduce(((e,t)=>r=>r instanceof Response?t({response:r,abort:n,next:e,url:i,options:a}):e(r)),t.next);o(r)},addRequestInterceptor:t=>{e.onRequest.push(t)},addResponseInterceptor:t=>{e.onResponse.push(t)},removeRequestInterceptor:t=>{const r=e.onRequest.indexOf(t);e.onRequest.splice(r,1)},removeResponseInterceptor:t=>{const r=e.onResponse.indexOf(t);e.onResponse.splice(r,1)}}})(),s=(0,l.pipe)(Jv,(e=>{let t=null;return r=>(n,i)=>{const a=()=>r(n,i),o=()=>{var e;return null===(e=t)||void 0===e?void 0:e.then(a)};return o()||a().then((r=>401===r.status?(t||(t=e().then((()=>{t=null}))),o()):r))}})(e),Qv,Kv);let u=0,c=[];return{request:(e,n)=>{const i=s(fetch);if(null!=n&&n.noRequestProcessor)return i(e,n);const a=()=>{const a=r?(e,t)=>i(e,t).then((n=>new Promise(((i,a)=>{r({response:n,next:e=>{i(e)},abort:a,url:e,options:t})})))):i;return t?new Promise(((r,i)=>{t({url:e,options:n,next:(e,t)=>{r(a(e,t))},resolve:e=>{r(e)},abort:i})})):a(e,n)};if(u){const{delayedRequest:e,resolver:t}=(e=>{let t;const r=new Promise((e=>{t=()=>{e(null)}})).then((()=>e()));return{delayedRequest:r,resolver:t}})(a);return c.push(t),e}return a()},addRequestInterceptor:n,addResponseInterceptor:i,startInterceptorInit:()=>{u+=1},finishInterceptorInit:()=>{u=Math.max(u-1,0),0===u&&(c.forEach((e=>e())),c=[])},removeRequestInterceptor:a,removeResponseInterceptor:o}},zv="__metadata",Zv=(e=>{const t=[zv,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),eg=(0,l.set)(Zv),tg=(0,l.view)(Zv),rg=eg(In.NEW),ng=eg(In.REMOVED),ig=eg(In.EDITED),ag=eg(In.IGNORED),og=(0,l.pipe)(tg,(0,l.equals)(In.REMOVED)),sg=(0,l.pipe)(tg,(0,l.equals)(In.NEW)),lg=(0,l.pipe)(tg,(0,l.equals)(In.EDITED)),ug=(0,l.pipe)(tg,(0,l.complement)(l.isNil)),cg=(0,l.pipe)(tg,(0,l.equals)(In.IGNORED)),pg=(0,l.omit)([zv]),dg=(e,t)=>e===zv?void 0:t;function yg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fg=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(e(t))return r.concat(t);if(t&&t.children)for(const n of t.children){const i=fg(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},Tg=(e,t)=>fg((0,l.propEq)("nodeId",t),e),Eg=(e,t)=>fg((0,l.pathEq)(["entity","uri"],t),e),mg=(e,t)=>{const r=Tg(e,t);return r.length>1?r[r.length-2]:null},hg=(e,t)=>{const r=Tg(e,t);return r.length>0?r[r.length-1]:null},bg=(e,t)=>{let{parent:r,childrenProcessing:n=(e=>e),nodeProcessing:i=(e=>e)}=t;return(e=i(e,r)).children&&(e.children=n(e.children.map((t=>bg(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},Og=()=>{},vg=(e,t)=>{let{parent:r,nodeProcessing:n=Og}=t;n(e,r),e.children&&e.children.forEach((t=>vg(t,{parent:e,nodeProcessing:n})))},gg=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case Rt.addingParent:var i,a,o,s;return{entityUri:n?null===(i=r.entity)||void 0===i?void 0:i.uri:null===(a=t.relatedEntity)||void 0===a?void 0:a.uri,relation:r.relation,parentEntityUri:n?null===(o=t.relatedEntity)||void 0===o?void 0:o.uri:null===(s=r.entity)||void 0===s?void 0:s.uri};case Rt.addingChild:var l,u,c,p;return{entityUri:n?null===(l=t.relatedEntity)||void 0===l?void 0:l.uri:null===(u=r.entity)||void 0===u?void 0:u.uri,relation:r.relation,parentEntityUri:n?null===(c=r.entity)||void 0===c?void 0:c.uri:null===(p=t.relatedEntity)||void 0===p?void 0:p.uri};case Rt.editing:{var d,y,f,T;const e={oldRelation:t.relation,newRelation:r.relation,isReversed:n},i=null===(d=r.entity)||void 0===d?void 0:d.uri,a=null===(y=t.relatedEntity)||void 0===y?void 0:y.uri;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){yg(e,t,r[t])}))}return e}({},e,(null===(f=t.entity)||void 0===f?void 0:f.uri)===(null===(T=r.entity)||void 0===T?void 0:T.uri)?{}:{entityUri:i,newEntityUri:a})}}},_g=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[];return Object.values(e).forEach((e=>{const r=e.root;r&&vg(r,{nodeProcessing:r=>{const n=(0,l.path)(["editingConnections",(0,l.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===Rt.addingChild||r.editingMode===Rt.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=gg({node:r,connection:n,isReversed:i}),s=xp({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===Rt.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=gg({node:r,isReversed:i,connection:n}),l=s?Wp({entityUri:o,newEntityUri:s,relation:a,isReversed:i}):Gp({oldRelation:e,newRelation:a});t.push(l)}}})})),t},Ag=(e,t)=>{if((0,l.path)(["entity","uri"],e)===t)return!0;if(e&&e.children)for(const r of e.children){const e=Ag(r,t);if(e)return e}return!1},Ng=(0,l.curry)(((e,t)=>{const r=(0,l.map)(Ng(e));return(0,l.evolve)({entity:t=>t.uri===e.uri?e:t,children:r},t)})),Pg=(e,t)=>{const r=(0,l.pipe)(Object.entries,(0,l.filter)((t=>{let[,r]=t;return r.root&&((e,t)=>Ag(t,e.uri))(e,r.root)}))),n=(0,l.map)((t=>{let[r,n]=t;return{id:r,root:Ng(e,n.root)}}));return(0,l.pipe)(r,n)(t)},Rg={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},Sg={asc:"asc",desc:"desc"},wg=Rg.entityLabel,Ig=Sg.asc,Ug=(0,l.always)(0),Cg=e=>{let{sortField:t=wg,sortOrder:r=Ig,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case Rg.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,l.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return nP.strings.sort(t,a,o)})(n,r);case Rg.entityLabel:return(e=>(t,r)=>{const n=(0,l.path)(["entity","label"]),i=n(t),a=n(r);return nP.strings.sort(e,i,a)})(r);default:return Ug}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},Dg=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values(Sg)),l.identity,(0,l.always)(Ig))),Lg=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(Rg)),l.identity,(0,l.always)(wg)));var jg=r(91104);let kg;const Fg=(e,t)=>(kg||(kg=jg.createClient({key:t})),new Promise((t=>{kg.geocode({address:e},((e,r)=>{e&&(console.warn(e),t(null));const{results:n}=r.json,i=(0,l.pathOr)(null,[0,"geometry","location"],n);t(i||null)}))}))),Mg=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,l.is)(Object,t)&&(t=""),t},xg=(e,t)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(Ss).flatMap((e=>{let r;return e.type==t&&(r=[Mg(e)]),(0,l.is)(Object,e.value)&&(r=(r||[]).concat(xg(e.value,t))),r})),$g=e=>e&&e.length>0,Vg=(e,t)=>[].concat(e&&e.attributes?xg(e.attributes,t):[]).filter(l.identity);function Gg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Wg=(e,t,r,n,i,a)=>{if(e&&e.type){const t=pn(r,e.type);n&&(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){Gg(e,t,r[t])}))}return e}({},e,{attributes:{[i]:[n]}}));const a=(t.geoLocationAttributes||[]).map((t=>{return r=Vg(e,t.latitude),n=Vg(e,t.longitude),$g(r)&&$g(n)&&(0,l.zipWith)(((e,t)=>({lat:Number(e),lng:Number(t)})),r,n);var r,n})).filter(l.identity);if(a.length>0)return Promise.resolve(a[0])}const o=t.GeoLocation;if(o){const e=o.map((e=>{const t=e.value.Latitude,r=e.value.Longitude;if($g(t)&&t[0].value&&$g(r)&&r[0].value)return{id:e.uri,lat:Number(t[0].value),lng:Number(r[0].value)}})).filter(l.identity);if(e.length>0)return Promise.resolve(e)}return n&&n.label?Fg(n.label,a).catch((()=>null)):Promise.resolve(null)},Bg=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;const n={},i=(0,l.flatten)(t.map((t=>{return"configuration/entityTypes/Location"===t.type?{id:t.uri,label:t.label,entity:t,pointSource:t.attributes}:(n[t.type]=n[t.type]||((null===(r=pn(e,t.type))||void 0===r?void 0:r.attributes)||[]).filter((e=>"configuration/entityTypes/Location"===e.referencedEntityTypeURI)).map((e=>{let{name:t}=e;return t})),n[t.type].map((e=>[e,t.attributes[e]])).filter((e=>{let[,t]=e;return t})).flatMap((e=>{let[r,n]=e;return n.map((e=>({id:e.uri,label:e.label,entity:t,pointSource:e.value,refAttribute:e,name:r})))})));var r})));return Promise.all(i.map((t=>{let{id:n,label:i,entity:a,pointSource:o,refAttribute:s,name:u}=t;return Wg(a,o,e,s,u,r).then((e=>!e&&a.label&&""!==a.label?Fg(a.label,r).catch((()=>null)):e)).then((e=>ie(e).filter(l.identity).map((e=>({id:e.id||n,label:i,entity:a,point:e}))))).catch((()=>null))}))).then((e=>e.flat(1/0).filter(l.identity)))},Yg=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Promise.resolve((0,l.pipe)((0,l.chain)((t=>{const r=pn(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(Ur(e,r.latitude,t.type)&&Ur(e,r.longitude,t.type)){const e=Vg(t,r.latitude),n=Vg(t,r.longitude),i=(e,r)=>({id:`${t.uri}_nested_${e}_${r}`,entity:t,label:t.label,point:{lat:Number(e),lng:Number(r)}});return(0,l.zipWith)(i,e,n)}}))})),(0,l.filter)(l.identity),(0,l.uniqBy)((0,l.prop)("id")))(t))},qg=(e,t,r)=>Promise.all([Yg(e,t),Bg(e,t,r)]).then((e=>{const[t,r]=e;return[...t,...r.filter((e=>0===t.length||!t.some((t=>t.entity===e.entity&&t.point.lat===e.point.lat&&t.point.lng===e.point.lng))))]}));function Hg(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){Jg(e,t,r[t])}))}return e}function Jg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qg=(e,t)=>t.values.map(Fo(e,t.entityTypeUri)),Kg=(e,t,r)=>El(t.fieldName,r)||Ur(e,tt(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),Xg=(e,t)=>{const r=(0,l.propOr)([],"values",t),n=(0,l.path)([t.attrType.lookupCode],e);return(0,l.map)((e=>{const t=(0,l.prop)(e,n);return t?Fv(e,t):e}),r)},zg=(0,l.path)(["attrType","label"]),Zg=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>Hg({},e,{[t]:!0})),{});e[r]=e[r]?Hg({},e[r],n):n}return e}),{}),e_=(0,l.pipe)((0,l.prop)("values"),E),t_=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",Hn.type.name)),r_=e=>e.type===a_.NUMERIC_RANGE_FACET,n_=e=>e.type===a_.DATE_RANGE_FACET,i_=(0,l.either)(r_,n_),a_={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},o_=e=>{switch(null==e?void 0:e.name){case Hn.type.name:return a_.ENTITY_TYPE_FACET;case Hn.createdBy.name:case Hn.updatedBy.name:case Hn.sourceSystems.name:case Hn.tags.name:case Hn.roles.name:case Hn.matchRules.name:case Hn.MLRecommendedMatch.name:return a_.WITH_DROPDOWN_CHECKBOXES_FACET;case Hn.createdTime.name:case Hn.updatedTime.name:case Hn.startDate.name:case Hn.endDate.name:return a_.DATE_RANGE_FACET;case Hn.matches.name:case Hn.matchScore.name:return a_.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return a_.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return a_.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return a_.DATE_RANGE_FACET;default:return a_.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},s_=(0,l.pipe)(Kg,o_),l_=(0,l.pipe)((0,l.path)(["attrType","type"]),Vr),u_=(0,l.cond)([[r_,(0,l.always)(bn.IN_RANGE)],[n_,(0,l.always)(bn.WITHIN)],[(0,l.allPass)([l_,e=>e.values.length>=2]),(0,l.always)(bn.EXISTS)],[l.T,(0,l.always)(bn.EQUALS)]]),c_=(0,l.cond)([[n_,(0,l.prop)("values")],[r_,(0,l.prop)("values")],[l_,e=>1===e.values.length?e.values.map(ue):[]],[(0,l.pipe)((0,l.path)(["values",0]),Array.isArray),(0,l.prop)("values")],[l.T,e=>[e.values]]]);function p_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const d_=(0,l.pipe)((0,l.path)(["attrType","type"]),jr),y_=(0,l.pipe)((0,l.path)(["attrType","type"]),Mr),f_=(0,l.pipe)((0,l.prop)("attrType"),hl),T_=(0,l.pipe)((0,l.prop)("attrType"),ml),E_=e=>t=>t.values.map((t=>pn(e,t).label)).join(" , "),m_=(0,l.when)((0,l.propSatisfies)((0,l.gt)(l.__,1),"length"),(0,l.join)(" – ")),h_=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(ye().number),m_)),(0,l.join)(","))(e.values);return`${zg(e)}: ${t}`},b_=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(w),m_)),(0,l.join)(","))(e.values);return`${zg(e)}: ${t}`},O_=e=>t=>`${zg(t)}: ${Qg(e,t).join(", ")}`,v_=e=>t=>{const r=Xg(e,t);return`${zg(t)}: ${r.join(", ")}`},g_=(0,l.curry)(((e,t,r)=>(0,l.map)((0,l.cond)([[T_,E_(e)],[y_,h_],[d_,b_],[f_,O_(e)],[l.T,v_(t)]]),r))),__=(e,t,r,n)=>(0,l.pipe)(l.values,(0,l.reject)((0,l.pipe)((0,l.prop)("values"),E)),(0,l.map)((t=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){p_(e,t,r[t])}))}return e}({},t,{attrType:Kg(e,t,n)}))),g_(e,r))(t),A_=new RegExp(`^${ye().text("Search")}`),N_=(e,t,r,n)=>{let{uiState:i}=t;const{facets:a,keyword:o,advanced:s,readableQuery:u}=i;return(0,l.isEmpty)(s)?[...__(e,a,r,n),...o?[o.value]:[]]:[(0,l.replace)(A_,"",u)]},P_=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values)(Sn),R_=e=>(e=>P_.reduce(((e,t)=>{const r=new RegExp(`'{0,1}${encodeURIComponent("${")}${t}${encodeURIComponent("}")}'{0,1}`,"g"),n=new RegExp(`'{0,1}${encodeURIComponent("${")}now${encodeURIComponent("}")}'{0,1}`,"g"),[i,a]=lc(t);return e.replace(r,i).replace(n,a)}),e))(e),S_=(0,l.curry)(((e,t)=>{const r=new URL(e),[,n]=r.pathname.split("/");return"nui"===n?`${e}search?state=${t}`:`${e}#p~com.reltio.plugins.search.SearchPerspective_s~${t}`})),w_={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},I_=e=>[w_.geoPolygon,w_.onMapMove].includes(e),U_=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},C_=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},D_=(e,t)=>I_(e)?t.map(U_):[C_(t)],L_=e=>I_(e)?ye().text("Geo Polygon"):ye().text("Geo Location"),j_=e=>{switch(e){case w_.geoLocation:return"geoLocation";case w_.geoPolygon:case w_.onMapMove:return"geoPolygon"}},k_={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},F_=e=>ye().text(e),M_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[bn.EQUALS]:"=",[bn.NOT_EQUALS]:"≠",[bn.STARTS_WITH]:"*",[bn.MISSING_VALUE]:ye().text("missing value"),[bn.HAS_ALL]:ye().text("has all"),[bn.IN_RANGE]:ye().text("in range"),[bn.FULL_TEXT]:ye().text("full text"),[bn.EXISTS]:ye().text("exists"),[bn.COUNT_EQUALS]:`${ye().text("count")} =`,[bn.COUNT_NOT_EQUALS]:`${ye().text("count")} ≠`,[bn.COUNT_LT]:`${ye().text("count")} <`,[bn.COUNT_LTE]:`${ye().text("count")} <=`,[bn.COUNT_GT]:`${ye().text("count")} >`,[bn.COUNT_RANGE]:ye().text("count range"),[bn.LT]:"<",[bn.LTE]:"<=",[bn.GT]:">",[bn.GTE]:">=",[bn.IN_FILE]:ye().text("in file"),[bn.NOT_IN_FILE]:ye().text("not in file"),[bn.CONTAINS]:"~",[On.LIST_EQUALS]:"=",[On.NOT_LIST_EQUALS]:"≠",[On.LIST_EQUALS_CASE_SENSITIVE]:"=",[On.NOT_LIST_EQUALS_CASE_SENSITIVE]:"≠"}[e]||ye().text(e.toLowerCase())},x_=e=>({type:k_.operator,text:e}),$_=e=>({type:k_.operator,text:F_(e)}),V_=e=>({type:k_.attributeLabel,text:e}),G_=e=>({type:k_.specialAttributeLabel,text:e}),W_=e=>({type:k_.attributeFilter,text:M_(e)}),B_=e=>({type:k_.attributeValue,text:e}),Y_=e=>({type:k_.entityTypeLabel,text:e}),q_=()=>({type:k_.space,text:" "}),H_=()=>({type:k_.bracket,text:"("}),J_=()=>({type:k_.bracket,text:")"}),Q_=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),K_=(0,l.curry)(((e,t)=>t.map(Q_(e)))),X_=(0,l.curry)(((e,t,r)=>[e,...r,t])),z_=X_(H_(),J_()),Z_=X_(q_(),q_()),eA=(0,l.curry)(((e,t)=>[e,...t])),tA=e=>eA(Y_(e)),rA=e=>eA(Y_(`${e}: `)),nA=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=Fu(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=ju(s),a=ku(s);!r&&t&&n&&(i.push(H_()),r=!0),i.push(o),r&&a&&(i.push(J_()),r=!1);const l=e?$_(s):x_(s);i.push(...Z_([l]))}else i.push(o),r&&(i.push(J_()),r=!1)}return i}},iA=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),aA=(0,l.pipe)(nA({localizable:!1}),iA),oA=function(e){let{data:{title:t,pathToTitle:r}}=e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return r&&n?r.slice(1).join(" / "):t},sA=e=>{let{data:t,values:r,filter:n}=e;return t&&Uc({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},lA=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(sA)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),uA=(0,l.pipe)((0,l.chain)((0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)((e=>(e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.attrType)&&Rr(e.data.attrType)})(e)&&[bn.HAS_ALL,bn.EQUALS,bn.NOT_EQUALS].includes(e.filter))),(0,l.map)((e=>({type:Pr((0,l.path)(["data","attrType"],e)),codeValues:(0,l.flatten)((0,l.propOr)([],"values",e))}))),(0,l.filter)((e=>{let{codeValues:t}=e;return t.length>0})))),Wv),cA=(e,t)=>(0,l.pipe)(uA,Bv(t))(e),pA=(0,l.pathEq)(["data","fieldName"],Hn.type.name),dA=(0,l.path)(["data","entityTypeUri"]),yA=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),fA=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(Ps(e)),attributes:(0,l.filter)((0,l.pipe)(dA,(0,l.anyPass)([l.isNil,Ps(e),r=>{const n=(t.entityTypes||[]).filter(Ps(e));return(n.length>1?En(e,n):null)===r&&!!pn(e,r)}])))})(t))))),TA=e=>(0,l.pipe)((0,l.prop)("filter"),gu,(0,l.equals)(e)),EA=(0,l.curry)(((e,t,r,n,i,a)=>{const o=El(n.fieldName)||n.attrType,s=rc(o,i),u=Yv({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>Rr(s),()=>(0,l.is)(Object,a)&&a.lookupCode?Fv(a.lookupCode,a.value):xv(r,Pr(o),a)],[()=>hl(s),()=>Fo(e,n.entityTypeUri,a)],[()=>bl(s),()=>as(e,a)],[()=>Nl(s),()=>ls(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>Mr(c)||Vr(c)),Xu),B_)()})),mA=(e,t,r,n)=>{const i=EA(e,t,r,n.data,n.filter);return(0,l.cond)([[TA(0),(0,l.always)([])],[(0,l.both)(TA(2),(2,(0,l.pipe)((0,l.prop)("values"),l.flatten,l.length,(0,l.equals)(2)))),e=>{let{values:t}=e;const[r,n]=(0,l.flatten)(t);return[q_(),i(r),{type:k_.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[q_(),...(0,l.pipe)(l.flatten,(0,l.map)(i),K_({type:k_.punctuationMark,text:", "}))(t)]}]])(n)},hA=(e,t)=>{const r=!!El(e.data.fieldName);return(0,l.pipe)(oA,r?G_:V_)(e,t)},bA=(e,t,r,n,i)=>[hA(n,i),q_(),W_(n.filter),...mA(e,t,r,n)],OA=(0,l.addIndex)(l.map),vA=(0,l.propEq)("length",1),gA=(0,l.propSatisfies)((0,l.lt)(1),"length"),_A=(0,l.complement)(l.isEmpty),AA=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)($u,(0,l.filter)(sA),Vu,(0,l.map)((n=>({operand:bA(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,nA()))(n)},NA=(0,l.pipe)(AA,l.flatten),PA=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>Np(e,{type:t}))).join(", ");return r?t(r):l.identity},u=AA(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(tA),(0,l.pipe)(s(rA),(0,l.unless)((()=>vA(u)||i),z_)))(u)},RA=(e,t,r,n)=>(0,l.pipe)($u,(0,l.filter)(lA),Vu,OA(((n,i,a)=>({operand:PA(e,t,r,n,vA(a)),operator:n.operator}))),nA(),l.flatten)(n),SA=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),nA(),l.flatten),wA=e=>{let{searchType:t,values:[r]}=e;return D_(t,r).join(", ")},IA=(e,t,r,n,i,a)=>{const o=(e=>e?[G_(e.isRawFilter?ye().text("Raw filter"):ye().text("Search")),...Z_([W_(bn.EQUALS)]),B_(`"${e.value}"`)]:[])(i),s=(e=>e?[G_(L_(e.searchType)),q_(),B_(wA(e))]:[])(a),u=(0,l.pipe)(RA,(0,l.when)((e=>gA(e)&&(_A(o)||_A(s))),z_))(e,t,r,n);return SA([o,s,u])},UA=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),CA=(0,l.pipe)(IA,UA),DA=(0,l.has)("attributes"),LA=Array.isArray,jA=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),kA=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=FA(e,t,r,a,i);return(0,l.when)((0,l.always)((0,l.complement)(l.isNil)(o)),(0,l.pipe)((0,l.when)((0,l.always)((0,l.not)(jA(a))),z_),(0,l.concat)(Z_([x_(o)]))))(s)},FA=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return DA(n)?kA(e,t,r,n,i):LA(n)?n.reduce(((n,a)=>n.concat(FA(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(Z_([x_(n.operator)])))(bA(e,t,r,n,i))},MA=(e,t,r,n,i)=>(0,l.pipe)(FA,l.flatten)(e,t,r,n,i);function xA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){$A(e,t,r[t])}))}return e}function $A(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const VA=(0,l.complement)(pA),GA=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(pA),(0,l.map)((0,l.prop)("values")),l.flatten,l.uniq)(e),r=(0,l.pipe)((0,l.map)(dA),(0,l.reject)(l.isNil),l.uniq)(e),n=0===r.length,i=1===r.length&&(0===t.length||(0,l.equals)(r,t));return{entityTypesFromSpecialAttributes:t,entityTypesFromAttributes:r,areOnlySpecialAttributes:n,areAttributesFromOneEntityType:i}},WA=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=GA(t);return(r||n)&&Mu(t)},BA=(0,l.ifElse)((0,l.all)((0,l.has)("entityTypes")),l.identity,(0,l.pipe)((e=>{const t=[],r=e.filter((0,l.complement)(WA)),n=e.filter((e=>{let{attributes:t=[]}=e;return t.length>0}));if(0===r.length||1===r.length&&1===n.length||t.push("Can't convert more than one complex transition advanced search group"),e.some((e=>(e.attributes||[]).filter(pA).some((0,l.propEq)("filter",bn.NOT_EQUALS))))&&t.push("Can't convert advanced search group with 'Type' attribute and 'not equals' filter."),t.length)throw t;return e}),(0,l.reduce)(((e,t)=>e.concat((e=>{const t=[],r=e.attributes||[],{entityTypesFromSpecialAttributes:n,entityTypesFromAttributes:i}=GA(r);if(WA(e))t.push(xA({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter(VA)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(pA,(0,l.pipe)((0,l.prop)("values"),l.flatten),(0,l.pipe)(dA,(e=>[e]),(0,l.reject)(l.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(VA),entityTypes:n,operator:i?a:e.operator,id:(0,De.x0)()}}));t.push(...n)}var a;return t})(t))),[]))),YA={[bn.EQUALS]:bn.ON,[bn.IN_RANGE]:bn.WITHIN,[bn.GTE]:bn.AFTER,[bn.GT]:bn.AFTER,[bn.LTE]:bn.BEFORE,[bn.LT]:bn.BEFORE},qA=(0,l.curry)((e=>YA[e]||e)),HA=(0,l.curry)(((e,t)=>{switch(e){case bn.LT:return[f()(t[0]).subtract(1,"day").valueOf()];case bn.GT:return[f()(t[0]).add(1,"day").valueOf()];default:return t}})),JA=(0,l.pipe)((0,l.path)(["data","attrType","type"]),jr),QA=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>xA({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return JA(e)?(0,l.evolve)({filter:qA,values:HA(t)},e):e}))})))})),KA=(0,l.evolve)({values:(0,l.when)((0,l.pipe)((0,l.prop)(0),ic),(0,l.map)(lc))}),XA=(0,l.map)((0,l.cond)([[JA,KA],[l.T,l.identity]])),zA=(0,l.curryN)(3,((e,t,r,n,i)=>(0,l.pipe)((0,l.defaultTo)([]),BA,fA(t),(0,l.map)((0,l.evolve)({attributes:(0,l.pipe)((0,l.map)((0,l.evolve)({data:e(t,n,i)})),(0,l.reject)((0,l.propSatisfies)(l.isNil,"data")),XA)})),QA,(0,l.reject)(yA))(r)));function ZA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){eN(e,t,r[t])}))}return e}function eN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tN=(e,t)=>({data:{uri:at(e.fieldName)?tt(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||u_(e),id:(0,De.x0)(),values:c_(e)}),rN=(0,l.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=El(a,t,r)||Ur(e,i);if(!s)return null;if(mr(s))return ZA({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=Np(e,{type:o}),i=(Ir(e,tt(a,o),o)||[]).map((0,l.pick)(["label","name"])).slice(0,-1);return ZA({},n,{attrType:s,title:t,pathToTitle:Array.isArray(i)?[r,...(0,l.chain)((0,l.prop)("label"),i),t]:[r,t]})}})),nN=(0,l.curry)(((e,t,r,n)=>zA(rN,e,n,t,r)));function iN(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){aN(e,t,r[t])}))}return e}function aN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const oN=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},sN=e=>"rdmLookups.not.resolved"===e?Hn.notResolved.name:e,lN=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===An?bn.IN_RANGE:Nn(a),u=sN(n),c=El(u)||Ur(e,i),p=(0,l.cond)([[()=>Pu(s),(0,l.map)((0,l.when)((0,l.both)((0,l.has)("link"),(0,l.complement)((0,l.has)("filename"))),(e=>iN({},e,{filename:Lv(e)}))))],[()=>Vr(null==c?void 0:c.type),(0,l.map)(ue)],[e=>Au(s)&&!Array.isArray(e[0])&&!jr(null==c?void 0:c.type),ae],[l.T,l.identity]])(o);return{id:(0,De.x0)(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===An?"and not":"and",filter:s,values:p}})),uN=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(lN(e,En(e,i)));return[{id:(0,De.x0)(),operator:"or",attributes:a,entityTypes:i}]})),cN=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),pN=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([cN("from"),cN("to")]),(0,l.pipe)((0,l.pick)(["from","to"]),l.values)],[(0,l.pipe)((0,l.prop)("rangeSelection"),E,l.not),(0,l.pipe)((0,l.prop)("rangeSelection"),(0,l.pick)(["start","end"]),l.values)],[l.T,()=>[]]]),dN=(e,t)=>{const r=(0,l.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return iN({},r,{values:pN(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?pl(e.fieldName,n):e.fieldName})},yN=(e,t)=>{if((0,l.has)("children")(e)){const r=dN(e,t);return e.children.reduce(((e,n)=>(e.push(yN(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return dN(e,t)},fN=(0,l.cond)([[(0,l.has)("searchParameters"),e=>{const t=[];return(0,l.has)("values",e)&&t.push(dN(e)),(0,l.propOr)([],"searchParameters",e).forEach((r=>t.push(iN({fieldName:e.fieldName},dN(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(yN,l.flatten)],[l.T,dN]]),TN=(0,l.pipe)((0,l.map)(fN),l.flatten),EN=e=>{if(e.every((e=>Array.isArray(e))))return e;if(2===e.length)return[e.map((e=>Number(e)))];if(1===e.length){const t=Number(e[0]);return[[t,t]]}return e},mN=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=uN(e,a),[u]=((e,t)=>{if(!t)return[];const[r,n]=(0,l.pipe)((0,l.reject)((e=>"tenants"===e.fieldName)),(0,l.partition)((e=>"type"===e.fieldName)))(t),i=(0,l.chain)((0,l.propOr)([],"values"),r);return[{attributes:TN(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>iN({},t,{type:s_(e,t)}))).map((e=>iN({},e,{values:i_(e)?EN(e.values):e.values}))).map((e=>{let{filter:t}=e,r=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["filter"]);return tN(r,t)})),operator:"or",id:(0,De.x0)(),entityTypes:i}]})(e,i),c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,l.pipe)(l.keys,(0,l.map)((t=>({[sN(t)]:e[t]}))),l.mergeAll)(e)}(o),p=[iN({},u,{entityTypes:null!=c&&c.type?(0,l.uniq)([...u.entityTypes,...s.entityTypes]):[],attributes:[...u.attributes,...s.attributes].filter((e=>{let{data:{fieldName:t}}=e;return c[t]}))})];return nN(e,t,r,p)},hN=(e,t,r,n)=>{try{return"2.0"==n.version?((e,t,r,n)=>{const{advanced:i=[],facets:a={}}=n,o=i.some((e=>{let{attributes:t,entityTypes:r=[]}=e;return t.length||r.length}))?i:((e,t)=>{const[[r={}],n]=(0,l.pipe)(l.values,(0,l.reject)(e_),(0,l.partition)(t_))(t),i=n.map((t=>ZA({},t,{type:s_(e,t)}))).map((e=>tN(e))),a=r.values||[];return[{attributes:i,operator:"or",id:(0,De.x0)(),entityTypes:a}]})(e,a);return nN(e,t,r,o)})(e,t,r,n):mN(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},bN=e=>"2.0"===e.version?e.keyword:oN(e),ON=e=>(0,l.pathEq)(["object","uri"],e),vN=(e,t)=>(0,l.pipe)((0,l.find)(ON(e)),(0,l.prop)("object"))(t),gN=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=(0,l.pipe)((0,l.find)((0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),ON(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=vN(r.match,t)||n[r.match];return i?{label:np((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return ko(e,i.type,t)||{label:t,uri:t}}))}:null};return(0,l.pipe)((0,l.defaultTo)([]),(0,l.when)((0,l.complement)(l.isEmpty),(0,l.map)(a)),(0,l.reject)(l.isNil))(i)},_N=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,l.pick)(["uri","type","label"],r),e}),{}),AN=(0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)]),NN=(e,t,r)=>(0,l.pipe)((0,l.propOr)([],"shortestTransitiveMatchPath"),(0,l.map)((t=>{let{match:n,matchRules:i=[],negativeRules:a=[]}=t;const o=(0,l.propOr)({},n,r);return{label:np((0,l.prop)("label",o)),matchRules:i.concat(a).map((function(t){return ko(e,o.type,t)||{label:t,uri:t}}))}})))(t),PN=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.map)((0,l.prop)("shortestTransitiveMatchPath")),l.flatten,(0,l.filter)(l.identity),(0,l.map)((0,l.prop)("match")),l.uniq);return t(e)},RN=(0,l.path)(["object","uri"]),SN=e=>{let t=[];return{addChild:e=>{t=(0,l.append)(e,t)},getValue:()=>e,getChildren:()=>t,removeChild:e=>{t=(0,l.without)([e],t)}}},wN=e=>e.getValue(),IN=(e,t)=>{let r=null;if(t(e.getValue()))return e;const n=e.getChildren();for(let e=0;e<n.length&&(r=IN(n[e],t),!r);e++);return r},UN=(e,t)=>{const r=[],n=(0,l.pipe)(wN,t),i=(0,l.pipe)(l.map,l.flatten),a=e.getChildren();a.some(n)&&r.push(e);const o=i((0,l.partialRight)(UN,[t]),a);return r.push.apply(r,o),r};function CN(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){DN(e,t,r[t])}))}return e}function DN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const LN=(e,t)=>!!e[t],jN=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},kN=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return 0===t.length&&e?e:(0,l.uniqBy)(r,[...t,...e||[]])},FN=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return CN({},t,{[r.uri]:CN({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:kN(null==o?void 0:o.parents,n),children:kN(null==o?void 0:o.children,i),values:kN(null==o?void 0:o.values,a,(0,l.prop)("uri"))})})},MN=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=pn(r,t)||Vi(r,t),i=(0,l.either)((0,l.both)((0,l.prop)("dependentLookupAttributes"),(0,l.prop)("dependentLookupCode")),(0,l.prop)("children"));return Ts(r,n,i).flatMap(ms).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>Ur(r,e))).filter(l.identity).filter((0,l.prop)("dependentLookupCode"));return(e=>{let{structure:t,parentAttrType:r,childrenAttrTypes:n}=e;const i=n.map((0,l.prop)("uri")),a=FN({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>FN({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},xN=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!We(e.uri)&&Qe(e.type)&&Qe(t)&&!t.startsWith(e.type))(n,t))return e;const i=Ws(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(Ss),(0,l.map)(jN))(i);return FN({structure:e,attrType:e[t].attrType,values:a})}),t)},$N=e=>{let{structure:t,attributeValue:r}=e;if((0,l.is)(Object,r.value))return Object.values(r.value).reduce(((e,t)=>{const r=t.some((e=>{let{value:t}=e;return(0,l.is)(Object,t)})),n=t.some((t=>{let{type:r}=t;return LN(e,r)}));return r||n?t.filter(Ss).reduce(((e,t)=>$N({structure:e,attributeValue:t})),e):e}),t);{const e=r;return LN(t,e.type)?FN({structure:t,attrType:t[e.type].attrType,values:[jN(e)]}):t}},VN=e=>{let{structure:t,uri:r}=e;return(0,l.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?CN({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},GN=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=Ws(i,n,r)||[];return a.length?FN({structure:t,attrType:t[r].attrType,values:a.filter(Ss).map(jN)}):t},WN=(e,t,r)=>{const n=qe(e),i=qe(t);return n===i?((e,t)=>{const r=lt(t),n=lt(e);return Xe(n,r)||((e,t)=>ot(e)&&!ot(t)&&Xe(t,e))(n,r)})(e,t):!(!r||!st(t))&&dh(r,i).includes(n)},BN=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},YN=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?ch(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return WN(r,t,o)}))},qN=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>qN(e,t,r)))))},HN=(e,t)=>{var r;return null==e||null===(r=e[t])||void 0===r?void 0:r.isTouched},JN=(e,t,r,n,i)=>{let{uri:a,value:o}=r;const s=a!==t&&BN(n,e);return{type:e,uri:a,lookupValue:o,autopopulate:s,useDefaultValue:s&&!HN(i,a)}},QN=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s,editorsState:l}=e;const u=t[r],c=qe(n),p=ph(c,o,i,a),d=qN("children",t,u),y=qN("parents",t,u),f=d.flatMap((e=>qN("parents",t,e))).filter((e=>![...y,u,...d].includes(e))),T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return WN(t,n,p)})).map((t=>JN(e.attrType.uri,n,t,s,l)))));if(!T.length)return[];const E=y.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return WN(n,t,p)||qe(t)!==c&&WN(t,n,p)})).map((t=>JN(e.attrType.uri,n,t,s,l))))),m=f.flatMap((e=>{const r=qN("children",t,e).map((e=>{let{attrType:t}=e;return t.uri}));return e.values.filter((e=>{let{uri:t}=e;return T.some((e=>{let{uri:n,type:i}=e;return r.includes(i)&&WN(n,t,p)}))})).map((t=>JN(e.attrType.uri,n,t,s,l)))}));return[...u.values.filter((e=>{let{uri:t}=e;return WN(t,n,p)})).map((e=>JN(r,n,e,s,l))),...E,...m,...T]},KN=async e=>{let{attributeType:t,attributePresentations:r,value:n}=e;const i=Yv({attributePresentations:r,dataTypeDefinition:t}),a=(0,l.pipe)((e=>{const t={};for(const r of e){const[e,n]=Object.entries(r)[0];t[e]=Array.isArray(n)?n.map((e=>({value:e,ov:!0}))):[{value:n,ov:!0}]}return{value:t}}),(e=>tp(e,t.dataLabelPattern))),o=e=>Object.values(e[0])[0],s=(0,l.pipe)(o,i),u=(0,l.cond)([[vr,()=>a(n)],[Rr,()=>(e=>{const r=o(e),n=Pr(t);return du([{codeValue:r,type:n}]).then((e=>{if(Array.isArray(e))return xv(e[0],n,r)}))})(n)],[l.T,()=>s(n)]]);return await u(t)},XN=e=>{let{value:t,attributeType:r,entityType:n=""}=e,i=[{fieldName:"type",filter:bn.EQUALS,values:[n]}];return Array.isArray(t)?i=i.concat(zN(r,t)):i.push(ZN([t],r)),i},zN=(e,t)=>{const r=hr(e),n=t=>(e[r]||[]).find((e=>e.uri===t||e.uri.endsWith(`/${t}`)));return t.reduce(((e,t)=>{for(const r in t){const i=n(r),a=vr(i)?zN(i,t[r]):[ZN(t[r],i)];return e.push(...a),e}}),[])},ZN=(e,t)=>e&&e.length&&!(0,l.isNil)(e[0])&&""!==e[0]?{fieldName:Nr(t.uri),filter:t.type===zt.TYPE_BLOB?bn.FULL_TEXT:bn.EQUALS,values:e}:{fieldName:Nr(t.uri),filter:bn.MISSING_VALUE},eP=(e,t)=>(0,l.equals)(JSON.parse(JSON.stringify(e)),JSON.parse(JSON.stringify(t))),tP=new class{constructor(){this.comparators=void 0,this.comparators={}}register(e,t){this.comparators[e]=t}get(e){var t;return null!==(t=this.comparators[e])&&void 0!==t?t:eP}},rP={AttributesDiff:o,AttributesEditor:a,HistoryManager:s},nP={Colors:r(33164),DependencyManager:r(29524),strings:n,dates:i}},33164:(e,t,r)=>{"use strict";r.r(t),r.d(t,{getColor:()=>i});var n=[[255,235,238,0],[255,205,210,0],[239,154,154,0],[229,115,115,0],[239,83,80,1],[244,67,54,1],[229,57,53,1],[211,47,47,1],[198,40,40,1],[183,28,28,1],[255,138,128,0],[255,82,82,1],[255,23,68,1],[213,0,0,1],[252,228,236,0],[248,187,208,0],[244,143,177,0],[240,98,146,1],[236,64,122,1],[233,30,99,1],[216,27,96,1],[194,24,91,1],[173,20,87,1],[136,14,79,1],[255,128,171,0],[255,64,129,1],[245,0,87,1],[197,17,98,1],[243,229,245,0],[225,190,231,0],[206,147,216,0],[186,104,200,1],[171,71,188,1],[156,39,176,1],[142,36,170,1],[123,31,162,1],[106,27,154,1],[74,20,140,1],[234,128,252,0],[224,64,251,1],[213,0,249,1],[170,0,255,1],[237,231,246,0],[209,196,233,0],[179,157,219,0],[149,117,205,1],[126,87,194,1],[103,58,183,1],[94,53,177,1],[81,45,168,1],[69,39,160,1],[49,27,146,1],[179,136,255,0],[124,77,255,1],[101,31,255,1],[98,0,234,1],[232,234,246,0],[197,202,233,0],[159,168,218,0],[121,134,203,1],[92,107,192,1],[63,81,181,1],[57,73,171,1],[48,63,159,1],[40,53,147,1],[26,35,126,1],[140,158,255,0],[83,109,254,1],[61,90,254,1],[48,79,254,1],[227,242,253,0],[187,222,251,0],[144,202,249,0],[100,181,246,0],[66,165,245,0],[33,150,243,1],[30,136,229,1],[25,118,210,1],[21,101,192,1],[13,71,161,1],[130,177,255,0],[68,138,255,1],[41,121,255,1],[41,98,255,1],[225,245,254,0],[179,229,252,0],[129,212,250,0],[79,195,247,0],[41,182,246,0],[3,169,244,0],[3,155,229,1],[2,136,209,1],[2,119,189,1],[1,87,155,1],[128,216,255,0],[64,196,255,0],[0,176,255,0],[0,145,234,1],[224,247,250,0],[178,235,242,0],[128,222,234,0],[77,208,225,0],[38,198,218,0],[0,188,212,0],[0,172,193,0],[0,151,167,1],[0,131,143,1],[0,96,100,1],[132,255,255,0],[24,255,255,0],[0,229,255,0],[0,184,212,0],[224,242,241,0],[178,223,219,0],[128,203,196,0],[77,182,172,0],[38,166,154,0],[0,150,136,1],[0,137,123,1],[0,121,107,1],[0,105,92,1],[0,77,64,1],[167,255,235,0],[100,255,218,0],[29,233,182,0],[0,191,165,0],[232,245,233,0],[200,230,201,0],[165,214,167,0],[129,199,132,0],[102,187,106,0],[76,175,80,0],[67,160,71,1],[56,142,60,1],[46,125,50,1],[27,94,32,1],[185,246,202,0],[105,240,174,0],[0,230,118,0],[0,200,83,0],[241,248,233,0],[220,237,200,0],[197,225,165,0],[174,213,129,0],[156,204,101,0],[139,195,74,0],[124,179,66,0],[104,159,56,1],[85,139,47,1],[51,105,30,1],[204,255,144,0],[178,255,89,0],[118,255,3,0],[100,221,23,0],[249,251,231,0],[240,244,195,0],[230,238,156,0],[220,231,117,0],[212,225,87,0],[205,220,57,0],[192,202,51,0],[175,180,43,0],[158,157,36,0],[130,119,23,1],[244,255,129,0],[238,255,65,0],[198,255,0,0],[174,234,0,0],[255,253,231,0],[255,249,196,0],[255,245,157,0],[255,241,118,0],[255,238,88,0],[255,235,59,0],[253,216,53,0],[251,192,45,0],[249,168,37,0],[245,127,23,0],[255,255,141,0],[255,255,0,0],[255,234,0,0],[255,214,0,0],[255,248,225,0],[255,236,179,0],[255,224,130,0],[255,213,79,0],[255,202,40,0],[255,193,7,0],[255,179,0,0],[255,160,0,0],[255,143,0,0],[255,111,0,0],[255,229,127,0],[255,215,64,0],[255,196,0,0],[255,171,0,0],[255,243,224,0],[255,224,178,0],[255,204,128,0],[255,183,77,0],[255,167,38,0],[255,152,0,0],[251,140,0,0],[245,124,0,0],[239,108,0,1],[230,81,0,1],[255,209,128,0],[255,171,64,0],[255,145,0,0],[255,109,0,0],[251,233,231,0],[255,204,188,0],[255,171,145,0],[255,138,101,0],[255,112,67,0],[255,87,34,1],[244,81,30,1],[230,74,25,1],[216,67,21,1],[191,54,12,1],[255,158,128,0],[255,110,64,0],[255,61,0,1],[221,44,0,1],[239,235,233,0],[215,204,200,0],[188,170,164,0],[161,136,127,1],[141,110,99,1],[121,85,72,1],[109,76,65,1],[93,64,55,1],[78,52,46,1],[62,39,35,1],[250,250,250,0],[245,245,245,0],[238,238,238,0],[224,224,224,0],[189,189,189,0],[158,158,158,0],[117,117,117,1],[97,97,97,1],[66,66,66,1],[33,33,33,1],[236,239,241,0],[207,216,220,0],[176,190,197,0],[144,164,174,0],[120,144,156,1],[96,125,139,1],[84,110,122,1],[69,90,100,1],[55,71,79,1],[38,50,56,1],[0,0,0,1],[255,255,255,0]];function i(e){var t,r=null,i=[parseInt(e.substring(1,3),16),parseInt(e.substring(3,5),16),parseInt(e.substring(5,7),16)];return n.forEach((function(e){var n=Math.abs(i[0]-e[0])+Math.abs(i[1]-e[1])+Math.abs(i[2]-e[2]);(null===r||n<r)&&(r=n,t=e)})),t?t[3]:0}},29524:(e,t,r)=>{"use strict";function n(e){var t=[];return{getInfo:function(){return e},getEdges:function(){return t},removeEdge:function(e){var r=t.indexOf(e);t.splice(r,1)},addEdge:function(e){t.push(e)}}}function i(e,t){t(e),e.getEdges().forEach((function(e){i(e,t)}))}function a(e){var t=[];return e.getEdges().forEach((function(e){t.push.apply(t,a(e))})),t.push(e),t}function o(e,t){var r=null;if(e.getInfo()===t)return e;for(var n=e.getEdges(),i=0;i<n.length&&!(r=o(n[i],t));i++);return r}function s(e,t){var r=null;if(e.getEdges().some((function(e){return e.getInfo()===t})))return e;for(var n=e.getEdges(),i=0;i<n.length&&!(r=s(n[i],t));i++);return r}r.r(t),r.d(t,{Node:()=>n,resolve:()=>i,findNode:()=>o,findParentNode:()=>s,getDependencyOrder:()=>a})},33196:()=>{},38087:()=>{},74854:()=>{},66602:()=>{}}]);
|
|
2
2
|
//# sourceMappingURL=747.js.map
|