@reltio/remotes 1.4.1536 → 1.4.1537

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/9291.js +1 -1
  2. package/9291.js.map +1 -1
  3. package/package.json +1 -1
package/9291.js CHANGED
@@ -1,2 +1,2 @@
1
- (self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[9291],{50757:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>il,IL3:()=>fT,PY2:()=>Mn,Ng6:()=>vt,YJ7:()=>Cn,NlI:()=>vn,XYV:()=>wn,Xt7:()=>Tt,wfT:()=>Oi,EMD:()=>ui,HAc:()=>mt,PEf:()=>Wn,oA3:()=>li,$XE:()=>Ft,eWf:()=>Vn,q7e:()=>ht,KVe:()=>vi,WVQ:()=>Hr,oZZ:()=>wi,bNA:()=>Ii,Rjq:()=>Ui,G39:()=>Yn,W0P:()=>qt,X1H:()=>Wt,hdG:()=>Qt,ws7:()=>Kt,VI$:()=>Jt,yn8:()=>Dt,N0y:()=>Ct,dZX:()=>Mt,bQt:()=>Di,oS0:()=>zt,KfU:()=>Et,bZE:()=>Rn,Nsj:()=>jn,psV:()=>Un,xPW:()=>xn,pyR:()=>Ti,p8l:()=>pi,Wkf:()=>ft,zHr:()=>yt,NIO:()=>dt,$26:()=>l_,Esk:()=>ni,s9T:()=>It,MEy:()=>Bu,j5E:()=>On,vAw:()=>si,NMQ:()=>oi,eVu:()=>uc,YGb:()=>Yt,mNm:()=>yi,Y1q:()=>mh,RgZ:()=>di,Qy0:()=>Ci,Q26:()=>Ln,pYu:()=>ri,wIJ:()=>C_,GFH:()=>_t,Ury:()=>qn,S91:()=>Hn,p3$:()=>ji,wSh:()=>Z,BDP:()=>qi,pGS:()=>fi,ARY:()=>Zt,XGc:()=>bi,fO_:()=>sn,wwy:()=>Rt,h_8:()=>Qn,_XL:()=>Dn,j2V:()=>gi,dMV:()=>mi,NBX:()=>LN,OXy:()=>er,BXd:()=>Lt,KM9:()=>Ot,CJB:()=>Ni,lXI:()=>Vt,C68:()=>Bn,yxQ:()=>Li,Yj_:()=>St,D25:()=>Nt,ZIY:()=>xt,Tl4:()=>x_,lwr:()=>Gn,NkU:()=>_i,Rtp:()=>hi,YGx:()=>jt,uTS:()=>Ei,MCv:()=>bt,IYE:()=>ci,PiC:()=>Si,MVv:()=>Ht,h_m:()=>Gt,DUe:()=>Sn,tJI:()=>gt,fDt:()=>At,cNQ:()=>Ai,SwE:()=>ii,ZHR:()=>Ri,PYu:()=>Bt,lD1:()=>Jn,lVm:()=>kt,vnX:()=>Cg,$x5:()=>Dg,_R1:()=>Ig,wUm:()=>Ug,dC6:()=>Ut,MBD:()=>Pt,GmF:()=>Aa,cKm:()=>$t,iP_:()=>$n,NVC:()=>wt,tPT:()=>Cl,tZe:()=>UT,kRE:()=>nm,psB:()=>im,X0$:()=>Ul,$vY:()=>Il,zE1:()=>Gl,Wm5:()=>Ol,vyX:()=>Yc,wLZ:()=>Dl,W4V:()=>se,EtK:()=>xs,ayi:()=>wl,asT:()=>qN,kGs:()=>qh,ewt:()=>wd,O_f:()=>ku,sOy:()=>Ke,Tde:()=>Nr,LMI:()=>Sc,skb:()=>SA,sPt:()=>bc,sH1:()=>Oc,lPZ:()=>zy,bG8:()=>Xy,_LJ:()=>Zy,RPM:()=>ty,h27:()=>Mc,Uqd:()=>Bc,xG:()=>VA,Z2f:()=>Yv,fgW:()=>lA,I69:()=>DA,ZxB:()=>jA,dwd:()=>Ky,F$g:()=>Qy,mdt:()=>lb,Qbq:()=>Ih,rny:()=>sa,UEY:()=>Ya,Q0T:()=>Ba,Lyr:()=>za,sBn:()=>Wa,itK:()=>xa,H9$:()=>Ga,KPc:()=>Va,zos:()=>$a,ELQ:()=>Za,dZs:()=>wa,Cz4:()=>Sa,z_L:()=>Ka,fGe:()=>Ra,iuF:()=>Fa,Wib:()=>Ma,Hn0:()=>Xa,obS:()=>eo,E$L:()=>Ia,XUh:()=>ka,Qp_:()=>La,_jk:()=>Ua,sKE:()=>Ca,WmG:()=>ja,QKx:()=>Ja,Oik:()=>Ha,s0A:()=>Da,o9m:()=>qa,MCd:()=>Qa,RsS:()=>xc,tGK:()=>pu,lIv:()=>Wl,Vg3:()=>fa,mkC:()=>ta,xv5:()=>Ea,a14:()=>na,yv0:()=>Ta,Zm0:()=>ra,Nxd:()=>ea,$mM:()=>ya,ifj:()=>Qr,NWi:()=>dg,xr3:()=>pg,wNf:()=>vu,iJH:()=>yg,KB$:()=>CN,d89:()=>Xi,Edd:()=>zi,Z5t:()=>Zi,uGe:()=>Ji,UoR:()=>Hi,xvW:()=>cg,$qe:()=>ug,yPM:()=>Pa,$cp:()=>Vl,vKJ:()=>xl,VtG:()=>Af,AID:()=>rh,B1H:()=>wN,b7X:()=>Rh,$uE:()=>Qh,keo:()=>wh,C_p:()=>Vy,G27:()=>yO,JA0:()=>qE,b3T:()=>Yh,oC6:()=>Wh,_Zs:()=>Bh,epC:()=>Xh,YYG:()=>Kh,f_2:()=>JE,w3l:()=>pN,QHB:()=>dO,Jso:()=>hN,RXH:()=>Xb,Vr9:()=>gO,lMm:()=>Ov,BlA:()=>nP,fmQ:()=>Us,yRD:()=>zA,NcL:()=>Hy,QK6:()=>Ee,ymd:()=>yT,JV_:()=>Om,XiW:()=>zp,Yrx:()=>DE,GPx:()=>Sl,gjI:()=>Rl,vlo:()=>Hd,E_P:()=>rb,aAL:()=>eT,NBq:()=>Cs,wp9:()=>sb,DsR:()=>Jf,MPc:()=>Mp,gWE:()=>xp,DT_:()=>$p,ipn:()=>Gp,ORg:()=>Gi,_wz:()=>Vp,RYR:()=>fd,PP2:()=>ME,wS7:()=>eg,cBQ:()=>Cf,pBq:()=>$m,DsO:()=>ee,X78:()=>gm,xZs:()=>Em,YFy:()=>jE,Gmt:()=>lm,K$w:()=>sm,DSj:()=>tT,Mfr:()=>kE,k9j:()=>Lf,EjS:()=>X,ww$:()=>Ll,WVU:()=>om,hxF:()=>gl,n6p:()=>on,E7G:()=>Lp,nwO:()=>lP,Mzk:()=>Rf,aFF:()=>kh,HRH:()=>Hu,EZK:()=>np,Kxm:()=>Zc,Z9i:()=>by,CrF:()=>ZE,DNd:()=>ro,vUy:()=>XN,lJh:()=>Xu,zHo:()=>zu,sEJ:()=>kN,UO$:()=>qm,zeJ:()=>Ur,dLR:()=>Ws,JQy:()=>tl,XtP:()=>Vs,Ug0:()=>mn,A1W:()=>Sh,sw:()=>rp,nv3:()=>vg,JgD:()=>Og,nve:()=>FN,SkP:()=>rl,SAs:()=>Gm,i5L:()=>nl,PWK:()=>rs,IM5:()=>Gs,Aup:()=>vO,Mfk:()=>_v,HQx:()=>Es,oN$:()=>Ts,mB6:()=>Jv,p6d:()=>w,o0x:()=>U,ufS:()=>jv,k7L:()=>kv,ped:()=>DN,mrB:()=>I,OuZ:()=>ip,ncP:()=>Be,FQ2:()=>ap,W$R:()=>op,JOV:()=>Me,Zmi:()=>xe,hm5:()=>Ve,ECL:()=>zr,vPL:()=>sp,qmL:()=>Eh,hPi:()=>Mm,hXd:()=>ua,OCS:()=>ca,p2l:()=>ol,qF1:()=>TT,_X$:()=>ET,yj2:()=>S_,bzh:()=>pb,k66:()=>ds,kiP:()=>Ro,pSg:()=>ce,kz_:()=>GE,H_U:()=>fs,t9e:()=>uo,j2$:()=>CT,PFL:()=>fr,aJ3:()=>Zg,To9:()=>Pr,wpo:()=>Rp,ADq:()=>fy,UUb:()=>dy,tQX:()=>yy,xy8:()=>hr,EUG:()=>Cr,AFK:()=>rt,X3M:()=>Ir,WN0:()=>ys,kDl:()=>Bs,uDV:()=>Th,IhQ:()=>Ks,pfb:()=>zs,R$r:()=>tb,w80:()=>Wo,Pfu:()=>so,Gtj:()=>ru,fyF:()=>tu,kkq:()=>ps,u5q:()=>Ye,O$n:()=>Np,ptG:()=>Pp,f4_:()=>Ob,uap:()=>bb,d7q:()=>CE,liG:()=>xE,$oF:()=>UE,avf:()=>Fd,DiQ:()=>kd,cfX:()=>jd,vD3:()=>xd,Qrb:()=>Ld,EJQ:()=>Md,HWy:()=>Dd,gjS:()=>md,y6v:()=>Cd,JUW:()=>QE,GtP:()=>Db,_kX:()=>io,u1e:()=>ao,sJj:()=>Dh,CJp:()=>Ub,uKF:()=>Ch,wo0:()=>rm,s5:()=>as,cwx:()=>is,Y6b:()=>vE,TTx:()=>dm,UtR:()=>gE,HaQ:()=>ym,E6I:()=>zE,Won:()=>AE,vTU:()=>bE,Nsy:()=>Tp,KMQ:()=>jh,Do$:()=>bp,CSV:()=>ul,TMe:()=>_E,l1V:()=>ec,RHh:()=>lc,VQ1:()=>oc,cGG:()=>ac,z7d:()=>Jd,Xaq:()=>bs,Sj8:()=>tP,PJj:()=>lu,k3T:()=>bn,PjQ:()=>Bi,s7l:()=>hf,jLA:()=>Lb,BoX:()=>Dr,GGR:()=>Wd,j5q:()=>Vd,DnY:()=>Tf,RY5:()=>uh,Px$:()=>Td,KPC:()=>PN,NIY:()=>Nf,HvW:()=>Of,Fof:()=>co,BXy:()=>vf,fX:()=>jb,BTI:()=>vp,uie:()=>cp,q27:()=>wp,vrC:()=>jO,fAQ:()=>Pm,XkT:()=>ff,lrH:()=>Rm,nt9:()=>dn,XH8:()=>Ap,XH2:()=>hn,jFi:()=>_p,qhs:()=>Go,wwR:()=>Op,Uk3:()=>nt,$Rg:()=>pt,ev7:()=>IN,RB9:()=>YE,iFp:()=>ny,e$p:()=>ay,PcX:()=>oy,SpP:()=>iy,R6_:()=>t_,CY1:()=>u_,Ajk:()=>uf,Yiz:()=>lf,FK9:()=>tf,UOo:()=>Fv,aTW:()=>cm,uug:()=>Ou,P$2:()=>d_,XS2:()=>du,Hyb:()=>Cu,d3Y:()=>Qc,Klp:()=>Xc,WxZ:()=>y_,Gzu:()=>Zu,ZOr:()=>yf,uqV:()=>EE,Pm4:()=>re,hWO:()=>Ze,nHA:()=>_b,nVD:()=>ph,_tF:()=>dc,dED:()=>wE,P2h:()=>SE,jrr:()=>_o,mmY:()=>No,T6O:()=>ms,h6J:()=>ST,hM2:()=>vN,XR6:()=>z,jmz:()=>fh,IHt:()=>yh,NZI:()=>hy,wdF:()=>Am,YNv:()=>Ph,IFm:()=>Nh,o_F:()=>bh,kgP:()=>Nm,ZYI:()=>uT,QXK:()=>Xl,efz:()=>zl,Q5d:()=>Kl,Ysv:()=>Zl,UWq:()=>Xd,ocC:()=>Kd,io3:()=>Tn,Sbt:()=>Yo,roS:()=>Bo,Ww1:()=>qo,QaS:()=>Sf,wsP:()=>Oe,ERZ:()=>uN,CL1:()=>gN,idV:()=>tp,nIW:()=>ze,fjE:()=>r_,sG0:()=>$v,tV7:()=>uu,g8o:()=>F_,Qy:()=>k_,t2P:()=>zg,KbW:()=>Co,wId:()=>Lo,TAC:()=>UN,LS0:()=>jo,bFH:()=>nE,Rgl:()=>aE,fW1:()=>db,GFW:()=>fm,Ywp:()=>Pg,pg:()=>xT,WSA:()=>oE,fed:()=>bN,tT_:()=>Xs,BgZ:()=>Zs,xIV:()=>el,KbL:()=>mf,JBA:()=>st,aNC:()=>bg,RFJ:()=>lT,Zeh:()=>Ym,OT5:()=>Ng,mC3:()=>Yl,kR6:()=>rP,gFw:()=>vb,NVY:()=>ab,k6v:()=>mT,FEC:()=>hT,L5S:()=>nb,Ob5:()=>Ip,KUV:()=>Up,dvH:()=>ib,V3i:()=>NO,VD3:()=>En,mm2:()=>ic,rou:()=>Lm,izH:()=>oo,DK$:()=>lo,KMp:()=>Zf,c31:()=>nr,mbo:()=>Ey,gT8:()=>or,CZ8:()=>ws,uGi:()=>js,Poc:()=>tr,_9k:()=>Ms,ZTM:()=>Ds,bwT:()=>ks,tF$:()=>ar,o96:()=>Is,M4S:()=>Fs,_vs:()=>qf,xF8:()=>hd,PUO:()=>Fh,ATu:()=>Ty,j1S:()=>$i,V3K:()=>Mi,Lmx:()=>xi,oSN:()=>Yi,ZaZ:()=>rr,n_1:()=>hE,N6e:()=>Kf,SxO:()=>Ao,w3p:()=>ob,xU7:()=>fe,Y_p:()=>Qo,$k6:()=>Jo,Gdl:()=>Gv,U6P:()=>Vv,OwB:()=>e_,hTh:()=>dh,xqc:()=>os,JvE:()=>ss,i29:()=>Dc,dzT:()=>aa,uPS:()=>Uf,cZV:()=>If,n3B:()=>TA,e6O:()=>uA,s7j:()=>U_,j$Q:()=>KE,PeS:()=>Iy,kW2:()=>Cb,tH7:()=>ns,Yxg:()=>fl,MaZ:()=>Gd,nqN:()=>$d,jWj:()=>Zd,o_J:()=>Os,yW4:()=>wT,uT0:()=>PT,C82:()=>RT,bsH:()=>gb,u9Z:()=>Dm,LCU:()=>Tm,J$m:()=>mE,j_Q:()=>nf,OaI:()=>af,wB1:()=>SN,SP6:()=>MT,ZYr:()=>NN,IMU:()=>sT,FoU:()=>HE,DVz:()=>Hv,mxe:()=>yA,FHr:()=>Wm,D1g:()=>jm,VO3:()=>Fg,de5:()=>kg,Uw1:()=>be,J6q:()=>my,XCe:()=>Oo,fbl:()=>Rg,Ir:()=>Io,XQO:()=>Uo,QXb:()=>KT,zXF:()=>hh,P8_:()=>hm,iiD:()=>zf,MOC:()=>XT,WF:()=>QT,xE1:()=>Wi,idW:()=>BN,QWZ:()=>Rv,YL3:()=>Pf,NW9:()=>Lv,D_E:()=>Te,Fn9:()=>T,j2U:()=>al,MpE:()=>ur,kQw:()=>Er,mfm:()=>Du,vZp:()=>it,Wah:()=>vy,E8K:()=>$N,VSb:()=>Rs,vr_:()=>Tr,Vmh:()=>KN,FgW:()=>AO,oDv:()=>gs,fGG:()=>Sv,kuw:()=>As,eHk:()=>zd,Tt2:()=>vs,pQZ:()=>Ns,oZ7:()=>wv,T6Y:()=>Gr,VRd:()=>ut,_26:()=>wu,YkM:()=>Ar,J6y:()=>Tu,njU:()=>_u,TBP:()=>_s,IT0:()=>Oy,x_:()=>Lh,FP6:()=>ct,biM:()=>mp,TMl:()=>hp,Vkd:()=>Pu,WiY:()=>o_,_zi:()=>Ru,RZp:()=>Jy,J6D:()=>nc,Lt4:()=>kr,QEi:()=>Sr,whI:()=>un,KIu:()=>pn,JhM:()=>oe,C_0:()=>Yr,lzc:()=>Dp,qIF:()=>EA,O27:()=>E,aBi:()=>Sp,xOX:()=>bl,EdS:()=>Je,WgC:()=>He,eEv:()=>dr,A4t:()=>Au,YOQ:()=>ot,Wos:()=>$r,jWr:()=>to,Or$:()=>_r,lhE:()=>fn,CwH:()=>Rr,pzC:()=>El,ymH:()=>gu,QZu:()=>vr,rYH:()=>a_,FVt:()=>xr,Kn2:()=>ue,jgw:()=>Lu,Qgr:()=>rc,OXP:()=>Ps,nsY:()=>uy,vyG:()=>sy,lS4:()=>wr,g5f:()=>s_,fp6:()=>hu,Uty:()=>ba,YkG:()=>gr,xdS:()=>sr,kMF:()=>Wp,$NE:()=>Qe,bC9:()=>qe,Ian:()=>Vi,KVV:()=>Uh,q9e:()=>Ho,iIf:()=>Wv,ian:()=>_l,m6e:()=>qr,OFd:()=>ml,kqr:()=>mr,fnZ:()=>ln,VFZ:()=>Al,ZiX:()=>Ge,j5n:()=>Fr,zkt:()=>_,Pcm:()=>RN,QDV:()=>Tl,M5u:()=>i_,laD:()=>fA,mtq:()=>pr,CtB:()=>Bv,CBv:()=>ae,I0t:()=>Br,u1G:()=>qd,gk1:()=>pA,Bgb:()=>cA,uzs:()=>cn,v0l:()=>Ec,Zqp:()=>NE,j0k:()=>es,l22:()=>oP,tCm:()=>tt,gmx:()=>yu,mOr:()=>Yu,TwZ:()=>M_,GyU:()=>gg,zGm:()=>GT,bMg:()=>cE,EyD:()=>sg,FQA:()=>lg,fZN:()=>yE,xsF:()=>ag,Lxg:()=>og,O3l:()=>kf,Wni:()=>jf,wRx:()=>Tg,OxG:()=>eE,Jwg:()=>zT,uJQ:()=>ZT,qWg:()=>qv,i96:()=>$T,NPd:()=>Ku,MrZ:()=>ts,zhn:()=>fg,G8q:()=>ki,Jct:()=>ud,A9Y:()=>te,Y5F:()=>tN,gxP:()=>le,c$P:()=>fu,M7o:()=>Wc,BBN:()=>go,fS6:()=>Sd,ZBU:()=>K,UkJ:()=>ko,xkv:()=>mm,z$M:()=>YN,KAm:()=>BE,lCl:()=>nh,rkF:()=>Gy,IU6:()=>FT,RGr:()=>h,aYu:()=>m,ije:()=>ou,Buf:()=>Xf,YLu:()=>au,ct9:()=>Xo,XkY:()=>pE,T5R:()=>WT,uQS:()=>fE,wcJ:()=>Ko,d$I:()=>jl,rSp:()=>Ep,Sx:()=>_f,Ilm:()=>Bl,Ki6:()=>vl,VGk:()=>Hf,sFD:()=>zb,eWN:()=>HN,dWE:()=>I_,Lkd:()=>Zp,aDL:()=>Hm,yaA:()=>TE,lOh:()=>Fm,DBr:()=>Qg,hK$:()=>cu,TZ_:()=>kT,CMB:()=>mA,FU8:()=>gf,J$p:()=>Xm,b5s:()=>Km,h2W:()=>et,SL_:()=>Im,oUH:()=>_T,ck9:()=>BT,RAb:()=>pc,nL:()=>xv,k$p:()=>eO,Xs0:()=>iu,u7I:()=>km,rxg:()=>Mu,bji:()=>xu,oCZ:()=>Fy,MjG:()=>jg,FuV:()=>gT,$ju:()=>NT,t6d:()=>AT,m5F:()=>he,sx:()=>JN,rSc:()=>Qv,U10:()=>of,L8n:()=>am,R9X:()=>OE,rj2:()=>vm,_C4:()=>DT,tCj:()=>bm,uAg:()=>LE,wx9:()=>Id,KF3:()=>LT,ax9:()=>jT,HH7:()=>Qf,ufV:()=>FE,_6y:()=>Df,XTh:()=>wg,AJo:()=>wf,Ixr:()=>XE,oss:()=>sP,P6Y:()=>uP,q5j:()=>Uy,Bd_:()=>Dy,xkB:()=>Cy,W41:()=>Cm,WkI:()=>Um,sSE:()=>wy,GMd:()=>wc,jtL:()=>Ic,Bxm:()=>jy,FVh:()=>Ay,inb:()=>Ag,U_T:()=>sE,FTe:()=>ie,VGB:()=>ne,tM8:()=>$u,Wfe:()=>Qu,Ls5:()=>Ju,$bd:()=>Gu});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:()=>Ae,editAttribute:()=>Ne,editEndDate:()=>Ue,editRoles:()=>Se,editStartDate:()=>Ie,editTags:()=>we,removeAttribute:()=>Re});var o={};r.r(o),r.d(o,{EventType:()=>xh,applyCrosswalks:()=>qh,collectCrosswalksFromAttributes:()=>Qh,compareActivenessAttributes:()=>Yh,compareAttributes:()=>Wh,compareImages:()=>Bh,compareRoles:()=>Xh,compareTags:()=>Kh});var s={};r.r(s),r.d(s,{createHistoryManager:()=>eb});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("2023-01-05");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";class Z{constructor(e){this.value=void 0,this.value=e}isNone(){return(0,l.isNil)(this.value)}extract(){return this.value}orSome(e){return(0,l.isNil)(this.value)?e:this.value}map(e){return(0,l.isNil)(this.value)?Z.None():Z.Some(e(this.value))}static Some(e){return new Z(e)}static None(){return new Z(null)}static fromFalsy(e){return e?Z.Some(e):Z.None()}static fromNull(e){return(e=>null==e)(e)?Z.None():Z.Some(e)}static fromUndefined(e){return void 0===e?Z.None():Z.Some(e)}static fromEmpty(e){return E(e)?Z.None():Z.Some(e)}}const ee=(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)}},te=(e,t)=>(r,n)=>{const i=t?(0,l.prop)(t):l.identity;return e.indexOf(i(r))-e.indexOf(i(n))},re=(0,l.when)((0,l.is)(Array),(0,l.prop)(0)),ne=e=>Array.isArray(e)?e:[e],ie=e=>[e],ae=e=>!!e&&["www.","http://","https://","ftp://","ftps://","smb://","data:"].some((t=>String(e).toLowerCase().startsWith(t))),oe=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase()),se=e=>oe(e=e||"")?`mailto:${e}`:!e.includes("://")&&(e.toLowerCase().startsWith("www.")||e.split(".").length>2)?`http://${e}`:e,le=(0,l.when)((0,l.is)(String),(e=>""===e?void 0:"true"===e.toLowerCase())),ue=e=>null!=e&&["object","function"].includes(typeof e),ce=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)),ue(e[i])?r(e[i],n.concat(i)):t.push(n.concat(i)))};return r(e),t};var pe=r(87918),de=r.n(pe);const ye=(0,l.when)((0,l.is)(Object),JSON.stringify),fe=(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 de().text("Bad Request");case 403:return de().text("Forbidden");case 404:return de().text("Not Found");case 405:return de().text("Method Not Allowed");case 408:return de().text("Request Timeout");case 500:return de().text("Internal Server Error");case 502:return de().text("Bad Gateway");case 503:return de().text("Service Unavailable");case 504:return de().text("Gateway Timeout");default:return t||de().text("Something went wrong")}})(e,t)))],...n.map((e=>[(0,l.prop)(e),(0,l.pipe)((0,l.prop)(e),ye)])),[(0,l.always)(t),(0,l.always)(t)],[l.T,ye]])(e)},Te=e=>"AbortError"===e.name,Ee=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)},me=/[\n\r%#()<>?[\\\]^`{}|]/g,he=e=>`data:image/svg+xml;utf8,${e.replace(/["']\);{0,}$/,"").replace(/'/g,'"').replace(/>\s{1,}</g,"><").replace(/\s{2,}/g," ").replace(me,encodeURIComponent)}`,be=e=>`data:image/gif;base64,${e}`,Oe=e=>{switch(e){case"minutes":return de().text("minutes");case"hours":return de().text("hours");case"days":return de().text("days");case"weeks":return de().text("weeks");case"months":return de().text("months");case"years":return de().text("years");default:return""}};var ve=r(76665);function ge(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 - ${ue(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 _e(e,t){for(var r=e.substr(e.indexOf("/attributes/")+12).split("/"),n=[],i=0;i<r.length;i+=2)n.push(ge(r[i],r[i+1],e,t));return n}function Ae(e,t,r,n,i,a,o){void 0===a&&(a=0);var s=_e(r,t)[a];if(!s){const s=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(_e(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 Ae(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 Ne(e,t,r,n,i,a){void 0===a&&(a=0);var o=_e(r,t)[a];if(!o){const o=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(_e(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()?(Pe(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(Pe.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=Ae(e,t,r,n,i,a),s}var c=Ne(e,o,o.valueUri,{},i,a);Ne(c,t,r,n,i,a+1)}function Pe(e,t){ue(e)?(t.value=e.value,t.lookupCode=e.lookupCode):(t.value=e,t.lookupCode&&(t.lookupCode=e))}function Re(e,t,r,n){void 0===n&&(n=0);var i=_e(r)[n];if(!i){const i=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(_e(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&&Re(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 Se(e,t){e.roles=t||[]}function we(e,t){e.tags=t||[]}function Ie(e,t){e.startDate=t||""}function Ue(e,t){e.endDate=t||""}var Ce=r(37164);const De="1Tempo4rary",Le="1Tepmo4Rel",je=(0,l.cond)([[l.isNil,(0,l.always)("")],[(0,l.test)(/[^/]$/),(0,l.concat)(l.__,"/")]]),ke=(0,Ce.kP)("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",16),Fe=()=>`${ke()}${Date.now()}`,Me=()=>`1Tempo4DCR${Fe()}`,xe=e=>`${e}/uri$$${Fe()}`,$e=e=>()=>xe(e),Ve=(e,t)=>{const r=je(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return xe(n)},Ge=e=>e&&e.includes("uri$$"),We=$e("entities"),Be=$e("relations"),Ye=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),qe=(0,l.startsWith)("relations/"),He=(0,l.startsWith)("entities/"),Je=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/entityTypes/")),Qe=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/relationTypes/")),Ke=(0,l.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),Xe=(0,l.pipe)((0,l.split)("/"),l.head),ze=(0,l.pipe)((0,l.split)("/"),l.last),Ze=e=>e.split(".").slice(0,2).join("."),et=(e,t)=>{const[r,...n]=e.split("."),i=n.join(`/${r}/`);return`${t||""}/${r+(i&&`/${i}`)}`},tt=(0,l.curry)(((e,t)=>`${e}/attributes/${t}`)),rt=(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("/")},nt=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},it=(0,l.either)((0,l.startsWith)("attributes."),(0,l.startsWith)("analyticsAttributes.")),at=e=>{const t=e.startsWith("configuration/")?3:2;return e.split("/").length===t},ot=e=>5===e.split("/").length,st=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},lt=e=>e.replace(/uri\$\$/g,De),ut=e=>null==e?void 0:e.startsWith("changeRequests/"),ct=e=>ut(e)&&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=>Ke(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,Je),"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)(Xe,(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=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{entityTypes:[]},t=arguments.length>1?arguments[1]:void 0;const r=Cr(e,t);return r&&gr(t)?lr(r):r},Lr=[zt.TYPE_ACTIVENESS_DATE,zt.TYPE_DATE,zt.TYPE_TIMESTAMP,zt.TYPE_LOCAL_DATE],jr=[zt.TYPE_ACTIVENESS_DATE,zt.TYPE_TIMESTAMP,zt.TYPE_LOCAL_DATE],kr=e=>Lr.includes(e),Fr=e=>jr.includes(e),Mr=[zt.TYPE_INT,zt.TYPE_LONG,zt.TYPE_NUMBER,zt.TYPE_FLOAT,zt.TYPE_DOUBLE,zt.TYPE_COUNT],xr=e=>Mr.includes(e),$r=e=>[zt.TYPE_FLOAT,zt.TYPE_DOUBLE].includes(e),Vr=[zt.TYPE_BOOLEAN,zt.TYPE_BOOLEAN_RADIO,zt.TYPE_RDM_LOOKUPS_NOT_RESOLVED],Gr=e=>Vr.includes(e),Wr=[zt.TYPE_URL,zt.TYPE_BLOG_URL,zt.TYPE_IMAGE_URL],Br=e=>Wr.includes(e),Yr=Or(zt.TYPE_EMAIL),qr=e=>zt.TYPE_SSN===e;var Hr,Jr=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(Hr||(Hr={}));const Qr=(0,l.curry)(((e,t,r)=>{var n;const i=e===Hr.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)))})),Kr=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),Xr=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),Kr),zr=(0,l.pipe)((0,l.reject)(E),Xr);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){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=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("?")?"&":"?")+Kr(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}},rn=e=>t=>{if(!(e=>!ue(e.value))(t)){var r;const n=`${e}/${null!==(r=t.refEntity)&&void 0!==r&&r.objectURI?ze(t.refEntity.objectURI):Me()}`;return Zr({},t,{uri:n,value:(0,l.fromPairs)((0,l.map)(nn(n),(0,l.toPairs)(t.value)))})}return Zr({},t,{uri:`${e}/${Me()}`})},nn=e=>t=>{let[r,n]=t;return[r,(0,l.map)(rn(`${e}/${r}`),n)]},an=e=>{const{uri:t}=e;return(0,l.evolve)({attributes:(0,l.pipe)(l.toPairs,(0,l.map)(nn(`${t}/attributes`)),l.fromPairs)},e)},on=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:an}))))},e),sn={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},ln=(0,l.equals)(sn.SUGGESTING),un=(0,l.equals)(sn.EDITING),cn=(0,l.equals)(sn.VIEWING),pn=(0,l.either)(un,ln),dn=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),yn=(0,l.curry)(((e,t)=>(0,l.pipe)(dn(e),(0,l.prop)("extendsTypeURI"))(t))),fn=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(yn(e,r)));return n(r)})),Tn=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=yn(e,n);return r})),En=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?En(e,dn(e,t.extendsTypeURI),r):void 0,mn=(e,t)=>{const r=t.map(Tn(e));return(r.length?r.reduce(l.intersection):[])[0]},hn=(e,t)=>En(e,(0,l.is)(Object,t)?t:dn(e,t),"typeImage"),bn=(e,t)=>e.entityTypes.reduce(((r,n)=>n.uri!==t&&fn(e,t,n.uri)?r.concat(n.uri):r),[]),On={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"},vn={LIST_EQUALS:"listEquals",NOT_LIST_EQUALS:"not listEquals",LIST_EQUALS_CASE_SENSITIVE:"listEqualsCaseSensitive",NOT_LIST_EQUALS_CASE_SENSITIVE:"not listEqualsCaseSensitive"},gn={[On.EQUALS]:"equals",[On.NOT_EQUALS]:"not",[On.STARTS_WITH]:"starts with",[On.MISSING_VALUE]:"missing value",[On.IN_RANGE]:"in range",[On.HAS_ALL]:"has all",[On.FULL_TEXT]:"full text",[On.EXISTS]:"exists",[On.COUNT_EQUALS]:"count equals",[On.COUNT_NOT_EQUALS]:"count not equal",[On.COUNT_LT]:"count less",[On.COUNT_LTE]:"count less or equal",[On.COUNT_GT]:"count greater",[On.COUNT_GTE]:"count greater or equal",[On.COUNT_RANGE]:"count in range",[On.LT]:"less than",[On.LTE]:"less than or equal",[On.GT]:"greater than",[On.GTE]:"greater than or equal",[On.IN_FILE]:"in file",[On.NOT_IN_FILE]:"not in file",[On.CONTAINS]:"contains",[On.ON]:"on",[On.BEFORE]:"before",[On.AFTER]:"after",[On.WITHIN]:"within"},_n="in",An="notIn",Nn="not range",Pn=e=>({[_n]:On.EQUALS,[An]:On.NOT_EQUALS}[e]||e);var Rn,Sn;!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"}(Rn||(Rn={})),function(e){e.LAST_3DAYS="last3Days"}(Sn||(Sn={}));const wn=["LAST_DAY","LAST_3DAYS","LAST_WEEK","LAST_MONTH","LAST_6MONTHS","LAST_YEAR","PICK_DATE"].reduce(((e,t)=>(e[t]=Rn[t]||Sn[t],e)),{}),In={[Rn.LAST_DAY]:"Last 24 hours",[Sn.LAST_3DAYS]:"Last 3 days",[Rn.LAST_WEEK]:"Last 7 days",[Rn.LAST_MONTH]:"Last month",[Rn.LAST_6MONTHS]:"Last 6 months",[Rn.LAST_YEAR]:"Last year",[Rn.PICK_DATE]:"Pick date"},Un={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},Cn={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},Dn="<No label>",Ln="__number";var jn;function kn(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){Fn(e,t,r[t])}))}return e}function Fn(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.IN="in",e.OUT="out"}(jn||(jn={}));const Mn={startDate:{type:zt.TYPE_ACTIVENESS_DATE,get label(){return de().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:zt.TYPE_ACTIVENESS_DATE,get label(){return de().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},xn=kn({id:{type:zt.TYPE_ENTITY_ID,get label(){return de().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},Mn,{roles:{type:zt.TYPE_STRING,get label(){return de().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:zt.TYPE_STRING,get label(){return de().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),$n={workflow:{type:zt.TYPE_STRING,get label(){return de().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:zt.TYPE_STRING,get label(){return de().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:zt.TYPE_STRING,get label(){return de().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:zt.TYPE_TIMESTAMP,get label(){return de().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},Vn={commenter:{type:zt.TYPE_STRING,get label(){return de().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},Gn={notResolved:{type:zt.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return de().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},Wn={createdBy:{type:zt.TYPE_STRING,get label(){return de().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:zt.TYPE_STRING,get label(){return de().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:zt.TYPE_TIMESTAMP,get label(){return de().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:zt.TYPE_TIMESTAMP,get label(){return de().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},Bn={matches:{type:zt.TYPE_COUNT,get label(){return de().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:zt.TYPE_COUNT,get label(){return de().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0}},Yn={sourceSystems:{type:zt.TYPE_STRING,get label(){return de().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:zt.TYPE_STRING,get label(){return de().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:zt.TYPE_INT,get label(){return de().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:zt.TYPE_TIMESTAMP,get label(){return de().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:zt.TYPE_TIMESTAMP,get label(){return de().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:zt.TYPE_TIMESTAMP,get label(){return de().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:zt.TYPE_TIMESTAMP,get label(){return de().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:zt.TYPE_TIMESTAMP,get label(){return de().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:zt.TYPE_STRING,get label(){return de().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}};let qn;!function(e){e.matchRules="matchRules",e.MLRecommendedMatch="MLRecommendedMatch"}(qn||(qn={}));const Hn={[qn.matchRules]:{type:zt.TYPE_STRING,get label(){return de().text("Match Rules")},uri:qn.matchRules,name:qn.matchRules,faceted:!0,hideForDataTenant:!0},[qn.MLRecommendedMatch]:{type:zt.TYPE_STRING,get label(){return de().text("Match IQ")},uri:qn.MLRecommendedMatch,name:qn.MLRecommendedMatch,faceted:!0,hideForDataTenant:!0}},Jn=kn({},xn,$n,Vn,Gn,Wn,Bn,Yn,Hn,{type:{type:zt.TYPE_STRING,get label(){return de().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}}),Qn="NOT_MATCH";var Kn=r(13980),Xn=r.n(Kn);function zn(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 ei=Xn().oneOf(["mobile","tablet","desktop"]),ti=Xn().shape({deviceTypes:Xn().oneOfType([ei,Xn().arrayOf(ei)]),roles:Xn().arrayOf(Xn().string)}),ri=Xn().shape({value:Xn().string,lookupCode:Xn().string}),ni=Xn().shape({link:Xn().string,filename:Xn().string}),ii=Xn().shape({displayName:Xn().string,parent:Xn().string}),ai=Xn().oneOfType([Xn().string,Xn().number,Xn().bool,ri]),oi=Xn().oneOfType([ai,Xn().arrayOf(ai)]),si=Xn().shape({fieldName:Xn().string,values:Xn().arrayOf(oi),filter:Xn().string,type:Xn().string}),li=Xn().shape({minValue:Xn().number,maxValue:Xn().number}),ui=Xn().shape({label:Xn().string,name:Xn().string,description:Xn().string,type:Xn().string,hidden:Xn().bool,faceted:Xn().bool,searchable:Xn().bool,uri:Xn().string,access:Xn().arrayOf(Xn().string),cardinality:li}),ci=Xn().shape({label:Xn().string,uri:Xn().string,typeColor:Xn().string,direction:Xn().string,startObject:Xn().object,endObject:Xn().object}),pi=Xn().shape({typeColor:Xn().string,typeIcon:Xn().string,typeImage:Xn().string,label:Xn().string,uri:Xn().string,attributes:Xn().arrayOf(ui)}),di=Xn().shape({uri:Xn().string,label:Xn().string,memberTypes:Xn().array,extendsTypeUri:Xn().string,attributes:Xn().arrayOf(ui)}),yi=Xn().shape({uri:Xn().string,label:Xn().string,extendsTypeUri:Xn().string,relationshipTypeURIs:Xn().arrayOf(Xn().string)}),fi=Xn().shape({uri:Xn().string,description:Xn().string,label:Xn().string,schemaVersion:Xn().string,entityTypes:Xn().arrayOf(pi),roles:Xn().arrayOf(Xn().object),groupTypes:Xn().arrayOf(Xn().object),relationTypes:Xn().arrayOf(ci),graphTypes:Xn().arrayOf(yi),interactionTypes:Xn().arrayOf(di),sources:Xn().arrayOf(Xn().object)}),Ti=Xn().shape({uri:Xn().string,type:Xn().string}),Ei=Xn().shape({uri:Xn().string,type:Xn().string}),mi=Xn().shape({value:Xn().object,ov:Xn().bool,type:Xn().string,uri:Xn().string}),hi=Xn().shape({refEntity:Xn().oneOfType([Xn().array,Xn().object]),refRelation:Xn().oneOfType([Xn().array,Xn().object]),value:Xn().object,ov:Xn().bool,type:Xn().string,uri:Xn().string}),bi=Xn().oneOf((0,l.values)(sn)),Oi=Xn().shape({type:Xn().oneOf(Object.values(dt)).isRequired,attributeTypeUri:Xn().string.isRequired,parentUri:Xn().string.isRequired,uri:Xn().string,message:Xn().string}),vi={attributeType:ui,showEmptyEditors:Xn().bool,lazy:Xn().bool,mode:bi,metadata:fi,ownError:Oi,errors:Xn().arrayOf(Oi),crosswalks:Xn().array,onAddAttributes:Xn().func,onAddOneMore:Xn().func,onDeleteAttribute:Xn().func,onChangeAttribute:Xn().func,additionalControlsRenderer:Xn().func,hideDeleteButton:Xn().bool,showNonOv:Xn().bool,state:Xn().oneOf(["deleted","edited"]),expanded:Xn().bool},gi=zn({attributeValue:mi},vi),_i=zn({attributeValue:hi},vi),Ai=Xn().shape({value:Xn().oneOfType([Xn().string,Xn().bool,Xn().number]),ov:Xn().bool,type:Xn().string,uri:Xn().string,lookupCode:Xn().string,lookupRawValue:Xn().string}),Ni=Xn().shape({totalOvValues:Xn().number,totalValues:Xn().number}),Pi=Xn().shape({inRelations:Xn().arrayOf(Xn().oneOfType([Xn().object,Xn().string])),outRelations:Xn().arrayOf(Xn().oneOfType([Xn().object,Xn().string])),groups:Xn().arrayOf(Xn().string),entityTypes:Xn().arrayOf(Xn().string),nextEntry:Xn().object}),Ri=Xn().oneOf(["asc","desc"]),Si=Xn().shape({id:Xn().string,content:Pi,allowOnlyCreateNew:Xn().bool,sortColumn:Xn().string,sortOrder:Ri,"text-empty":Xn().string,max:Xn().number,icon:Xn().string,caption:Xn().string,canCreate:ti,canRead:ti,canUpdate:ti,canDelete:ti,editingEnabled:Xn().bool}),wi=Xn().shape({entityUri:Xn().string,entityType:Xn().string,entityLabel:Xn().string,object:Ti}),Ii=Xn().shape({relationUri:Xn().string,relationType:Xn().string,relationLabel:Xn().string,direction:Xn().string,object:Ei}),Ui=Xn().shape({entity:wi,relation:Ii}),Ci=Xn().shape({value:Xn().string,isRawFilter:Xn().bool}),Di=Xn().shape({id:Xn().string,label:Xn().string,name:Xn().string,availableEntityTypes:Xn().array}),Li=Xn().shape({id:Xn().string,allowMergeAll:Xn().bool,matchActions:Xn().object,availableTabs:Xn().arrayOf(Xn().oneOf(["findMatches","potentialMatches","notAMatch"]))}),ji=Xn().arrayOf(Xn().shape({uri:Xn().string,label:Xn().string})),ki=[{label:de().text("And"),value:"and"},{label:de().text("Or"),value:"or"},{label:de().text("And not"),value:"and not"},{label:de().text("Or not"),value:"or not"}];function Fi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Mi=(0,l.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),xi=(0,l.pipe)(Mi,(0,l.propOr)("","label")),$i=(0,l.curry)(((e,t)=>{const r=Mi(e,t);return[(0,l.path)(["startObject","objectTypeURI"],r),(0,l.path)(["endObject","objectTypeURI"],r)]})),Vi=(0,l.curry)(((e,t,r)=>{const[n,i]=$i(e,r);return fn(e,n,t)||fn(e,i,t)})),Gi=(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){Fi(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),Wi=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?jn.OUT:jn.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(jn.IN),i=r(jn.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},Bi=(0,l.pathOr)("",["directionalContext",0,"labelPattern"]),Yi=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?Yi(e,Mi(e,t.extendsTypeURI),r):void 0;var qi;!function(e){e.CREATE="CREATE",e.READ="READ",e.UPDATE="UPDATE",e.DELETE="DELETE",e.INITIATE_CHANGE_REQUEST="INITIATE_CHANGE_REQUEST",e.MERGE="MERGE",e.UNMERGE="UNMERGE"}(qi||(qi={}));const Hi=(0,l.curry)(((e,t)=>e.every((e=>Ji(e,t))))),Ji=(0,l.curry)(((e,t)=>{const r=Tr(t);return Qi(e,t)&&(e===qi.READ||!r)})),Qi=(e,t)=>!t||!t.access||t.access.includes(e),Ki=(0,l.curry)(((e,t,r)=>Ji(qi.READ,r)&&(ln(t)?Ji(qi.INITIATE_CHANGE_REQUEST,r):Ji(e,r)))),Xi=Ki(qi.CREATE),zi=Ki(qi.DELETE),Zi=Ki(qi.UPDATE),ea=Hi([qi.CREATE,qi.MERGE,qi.READ,qi.UPDATE]),ta=Hi([qi.UPDATE,qi.READ,qi.CREATE]),ra=Hi([qi.UPDATE,qi.READ]),na=Hi([qi.DELETE,qi.UPDATE,qi.READ]),ia=(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["*"])),aa=(e,t,r)=>(0,l.pipe)((0,l.map)(ia(e,t)),(0,l.filter)(l.identity))(r),oa=(e,t,r)=>{const n=aa(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&Ji(qi.MERGE,r)},sa=(0,l.curry)(((e,t,r,n)=>{const i=Mi(e,n),[a,o]=$i(e,n);return i&&Ji(qi.CREATE,i)&&fn(e,a,t.type)&&fn(e,o,r.type)})),la=(e,t,r,n,i)=>{const a=dn(e,n.type),o=aa(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(sa(e,n,i))||a.some(sa(e,i,n))}))},ua=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=dn(e,r.type),o=(0,l.propOr)({},"matchActions",t);return{canMerge:oa(o,i,a),canAddRelation:la(e,o,i,r,n),canMark:Ji(qi.UPDATE,a)&&Ji(qi.READ,a)}},ca=(e,t,r,n)=>(0,l.pipe)((0,l.map)((n=>ua(e,t,n.object,r,n.matchRules))),(0,l.reduce)((0,l.mergeWith)(l.and),{}))(n),pa=Er,da=(0,l.complement)(pa),ya=Ji(qi.READ),fa=e=>{let{attributeType:t,mode:r}=e;return da(t)&&Xi(r,t)&&!br(t)},Ta=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=Ge(r.uri),o=Zi(n),s=Xi(n);return(0,l.cond)([[pa,l.F],[(0,l.always)(a),l.T],[(0,l.always)(i),o],[l.T,(0,l.allPass)([o,s])]])(t)},Ea=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=Ge(r.uri),s=Zi(n),u=zi(n),c=ha(qi.UPDATE,n,a,r),p=ha(qi.DELETE,n,a,r);return(0,l.cond)([[pa,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)},ma=(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=>!Qi(e,n)||!ma(e,t,r[n.name],n)))))})),ha=(0,l.curry)(((e,t,r,n,i)=>ln(t)?ma(qi.INITIATE_CHANGE_REQUEST,r,n,i):ma(e,r,n,i))),ba=(0,l.both)((0,l.complement)(br),ya),Oa="SuperUser",va="allTenants",ga=[va,"allCustomers"],_a=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===Oa})).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===Oa){const e=r?ga.concat(r.map((e=>`allTenants.${e}`))):ga,n=r&&t[0]===va?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}))},Aa={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"},Na={[Aa.CAN_DELETE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["DELETE"]},[Aa.CAN_CREATE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["CREATE"]},[Aa.CAN_UPDATE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["UPDATE"]},[Aa.CAN_READ_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["READ"]},[Aa.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[Aa.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activities"],privileges:["EXECUTE"]},[Aa.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[Aa.CAN_READ_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ"]},[Aa.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[Aa.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[Aa.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[Aa.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[Aa.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[Aa.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[Aa.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[Aa.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[Aa.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[Aa.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[Aa.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[Aa.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[Aa.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[Aa.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[Aa.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[Aa.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[Aa.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[Aa.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[Aa.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[Aa.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[Aa.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[Aa.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[Aa.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[Aa.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[Aa.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]},[Aa.CAN_READ_DVF]:{serviceId:"DVF",resourcePath:["functionsManagement"],privileges:["READ"]}},Pa=(0,l.curry)(((e,t,r)=>_a({allowedPermissionsNames:e,permissionsNames:Aa,permissionsConfig:Na}).some((e=>e(t,{params:{tenant:r}}))))),Ra=Pa([Aa.CAN_EXPORT]),Sa=Pa([Aa.CAN_EXPORT_ACTIVITIES]),wa=Pa([Aa.CAN_IMPORT_ENTITIES_FROM_DT]),Ia=Pa([Aa.CAN_READ_ENTITIES_FROM_DT]),Ua=Pa([Aa.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),Ca=Pa([Aa.CAN_UPDATE_PROCESS_INSTANCE]),Da=Pa([Aa.CAN_VIEW_WORKFLOW_DEFINITION]),La=Pa([Aa.CAN_CONFIG_ENVIRONMENT_REGISTER]),ja=Pa([Aa.CAN_UPDATE_WORKFLOW_DATA_TASK]),ka=Pa([Aa.CAN_READ_WORKFLOW_DATA_TASK]),Fa=Pa([Aa.CAN_MANAGE_WORKFLOW_DEFINITION]),Ma=Pa([Aa.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),xa=Pa([Aa.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),$a=Pa([Aa.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),Va=Pa([Aa.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),Ga=Pa([Aa.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),Wa=Pa([Aa.CAN_EXECUTE_WORKFLOW_JOBS]),Ba=Pa([Aa.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),Ya=Pa([Aa.CAN_CREATE_CONFIG_JAR]),qa=Pa([Aa.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),Ha=Pa([Aa.CAN_VIEW_CONFIG_JAR]),Ja=Pa([Aa.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),Qa=Pa([Aa.CAN_VIEW_WORKFLOW_JOBS]),Ka=Pa([Aa.CAN_MAKE_BULK_UPDATE]),Xa=Pa([Aa.CAN_OPEN_DATA_LOADER_EXECUTE,Aa.CAN_OPEN_DATA_LOADER_READ]),za=Pa([Aa.CAN_BULK_DELETE_PROFILES]),Za=Pa([Aa.CAN_READ_MDM_DATA_ENTITIES]),eo=Pa([Aa.CAN_READ_DVF]),to=Pa([Aa.IS_FREEMIUM_ADMIN]),ro=(0,l.reject)(br),no=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),ro,(0,l.filter)(e))(t),io=(0,l.curry)(((e,t)=>no((t=>fa({attributeType:t,mode:e})),t))),ao=(0,l.curry)(((e,t)=>no((t=>fa({attributeType:t,mode:e})||ba(t)),t))),oo=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(ba)),so=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...so(e)])))),lo=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(ba),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...lo(e)])))),uo=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...uo(e)])))),co=(0,l.pipe)(dn,(0,l.converge)(l.concat,[lo,uo]));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){yo(e,t,r[t])}))}return e}function yo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fo=(0,l.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,fo(e)))},t))),To=e=>{var t;return po({},e,{matchGroups:(0,l.uniq)((e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[]))})},Eo=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),mo=(0,l.when)(Eo,(0,l.dissoc)("values")),ho=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return po({},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})})),bo=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},Oo=(0,Jr.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(so,t).concat((0,l.chain)(so,r)).some(bo)})),vo=e=>{let t=!1;const r=fo((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?po({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},go=e=>{const t=Oo(e),r=(0,l.map)((e=>fo((0,l.pipe)(mo,(0,l.when)((0,l.always)(e),ho))))(t)),n=(0,l.map)(To),i=(0,l.map)(vo);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},_o=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Ao=(0,l.prop)("relationshipTypeURIs"),No=(0,l.curry)(((e,t)=>{var r;return(null===(r=e.graphTypes)||void 0===r?void 0:r.filter(Po(e,t)))||[]})),Po=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return null==n?void 0:n.some(Vi(e,t))},Ro=(e,t)=>(0,l.pipe)(_o,(0,l.defaultTo)({}),Ao,(0,l.defaultTo)([]),(0,l.chain)($i(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(dn(e)))(e,t),So=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),wo=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),Io=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return wo((0,l.complement)(So))(e)},Uo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return wo(So)(e)},Co=(0,l.pipe)(dn,(0,l.propOr)([],"matchGroups")),Do=(e,t,r)=>(0,l.pipe)(Co,(0,l.find)((0,l.propEq)("uri",r)))(e,t),Lo=(0,l.curry)(((e,t,r)=>(0,l.pipe)(Do,(0,l.propOr)(r,"label"))(e,t,r))),jo=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(Co,(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]})),ko=e=>(0,l.partition)(So,e),Fo=(0,l.includes)(l.__,["and","or","not"]),Mo=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),xo=(0,l.includes)(l.__,["equals","notEquals","in"]),$o=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return Fo(t)?$o(r):Mo(t)?r.filter(Je):xo(t)?r.map((0,l.prop)("uri")).filter(Je):[]})),l.uniq),Vo=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)($o),l.uniq),Go=(0,l.pipe)(Co,Vo),Wo=(0,l.pipe)(jo,Vo),Bo=(e,t)=>{let{interactionTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},Yo=(0,l.pipe)(Bo,lo),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||fn(e,n,t)})(e,t))})(e,t)),Ho=e=>!!e.required,Jo=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]:[];const a=(0,l.cond)([[Je,dn(e)],[Qe,Mi(e)]])(t);return Qo(e,a,r,n,i)},Qo=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=e=>e.uri&&Je(e.uri)&&3===e.uri.split("/").length;return!t||t.hidden&&!a(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!Tr(e)&&n(e,i))).flatMap((t=>{const a=t.required?[t]:[];if(r){let o;if(t.type===zt.TYPE_REFERENCE){const a=rr(t),s=nr(t);o=Jo(e,a,r,n,[...i,t]).filter((e=>s.some(Ke(e.uri))))}else t.attributes&&(o=Qo(e,t,r,n,[...i,t]));o&&a.push(...o)}return a})):t.type===zt.TYPE_REFERENCE?Jo(e,rr(t),r,n,[...i,t]):[]},Ko=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),Ho]),e.attributes||[])},Xo=(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},zo=(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)?de().text(n):n};return r(null,t)})),Zo=["label","description","abbreviation","caption","toolTip"],es=e=>zo(Zo,e),ts=(0,l.mergeRight)({attributeTypes:[],categoryTypes:[],changeRequestTypes:[],entityTypes:[],graphTypes:[],groupTypes:[],interactionTypes:[],relationTypes:[],roles:[],sources:[],survivorshipStrategies:[]}),rs=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=ze(t);return r.find((e=>{let{uri:t}=e;return ze(t)===n}))})),ns=(0,l.curry)(((e,t)=>{const r=ze(t);return(0,l.pipe)(rs(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),is=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"})},as=(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}))},os=(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)})),ss=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=dn(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));function ls(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){us(e,t,r[t])}))}return e}function us(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cs=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 ps(i,e,t,r,n)},ps=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 Z.fromNull(e&&e.length?e:Cr(t,r)).map((e=>e.map((e=>{const r=cs(t,e,n,i);return r.length?ls({},e,{children:r}):e})))).orSome([]).filter((0,l.either)((0,l.complement)(Ar),(0,l.prop)("children"))).filter(ba).filter(n).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},ds=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return cs(e,t,r,["attributes","analyticsAttributes"])},ys=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return cs(e,t,r,["attributes"])},fs=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return cs(e,t,r,["analyticsAttributes"])},Ts=e=>e.children?e.children.flatMap(Ts):e,Es=e=>e.children?[e,...e.children.flatMap(Es)]:e,ms=(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)})),hs=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return ze(r)===e})))),bs=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),hs("LUD")),(0,l.defaultTo)(r))(t||[])},Os=(e,t)=>{let{survivorshipStrategies:r}=e;return hs(t,r)},vs=(0,l.allPass)([(0,l.complement)(l.isNil),Ji(qi.READ)]),gs=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),Ji(qi.READ)]),_s=(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)([Ji(qi.CREATE),Ji(qi.INITIATE_CHANGE_REQUEST)])]),As=(0,l.curryN)(2,(0,l.pipe)(dn,gs)),Ns=(0,l.curryN)(2,(0,l.pipe)(Mi,vs)),Ps=e=>{let{ov:t}=e;return!1!==t},Rs=(e,t)=>((e,t)=>Br(e.type)&&ae(t))(e,t)||((e,t)=>Yr(e.type)&&oe(t))(e,t),Ss=(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))),ws=Ss("refEntity"),Is=Ss("refRelation"),Us=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],Cs=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},Ds=(0,l.prop)("objectURI"),Ls=(0,l.prop)("objectURI"),js=(0,l.prop)("type"),ks=(0,l.pipe)(ws,(0,l.defaultTo)({}),Ds),Fs=(0,l.pipe)(Is,(0,l.defaultTo)({}),Ls),Ms=(0,l.pipe)(ws,(0,l.defaultTo)({}),js),xs=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type})));return(e||[]).concat(r)},$s=(0,l.evolve)({refEntity:re,refRelation:re}),Vs=(e,t,r,n)=>{const i=Ir(e,r),a=dn(e,t.type)||Mi(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)(at,Qe)(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},Gs=(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?Gs(a.value,o):a},Ws=(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 Gs(e[r],i)})),Bs=(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")]]),Ys=(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"])]]),qs=(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"])]]),Hs=(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)(Hs(e,i)))))(r)})),Js=(0,l.curry)(((e,t)=>(0,l.ifElse)((0,l.is)(Array),(0,l.map)(Js(e)),e)(t))),Qs=(0,l.curry)(((e,t,r,n)=>(0,l.pipe)(Hs(e,r),Js(t))(n))),Ks=Qs(null,Bs),Xs=Qs(Ps,Bs),zs=Qs(null,Ys),Zs=Qs(Ps,Ys),el=Qs(Ps,qs),tl=(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=Ws(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},rl=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(ks,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{}),nl=(e,t)=>{const r=st(t),n=(0,l.pipe)((0,l.split)("/"),(0,l.dropLast)(1),l.last)(t);return tl(e,r,n)},il=Object.values(Mn),al=(0,l.includes)(l.__,il),ol=e=>il.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,l.assoc)(n,e[n],t):t}),{});function sl(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){ll(e,t,r[t])}))}return e}function ll(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ul=(e,t)=>`${e}_${t}`,cl=[Jn.matches.name,Jn.matchRules.name],pl=(0,l.values)($n).map((e=>e.name)),dl=e=>(0,l.when)((0,l.always)(!e),(0,l.reject)((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,pl)))),yl=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,cl)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>ul(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),fl=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,l.pipe)(l.values,dl(r),yl(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(ul(`dtPotentialMatches.${t.name}`,"")))))(Jn)},Tl=(0,l.propEq)("uri",Jn.type.uri),El=e=>(0,l.values)(Hn).some((0,l.propEq)("uri",null==e?void 0:e.uri)),ml=(0,l.propEq)("uri",Yn.sourceSystems.uri),hl=Object.values(xn),bl=(0,l.includes)(l.__,hl),Ol=e=>{let{entity:t,attributeType:r,value:n}=e;return sl({},t,{[r.uri]:void 0===n?r.defaultValue:n})},vl=e=>{let{entity:t,attributeType:r}=e;return(0,l.dissoc)(r.uri,t)},gl=e=>{let{entity:t,attributeType:r,value:n}=e;return sl({},t,{[r.uri]:n})},_l=(0,l.propEq)("uri",xn.roles.uri),Al=(0,l.propEq)("uri",xn.tags.uri);function Nl(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){Pl(e,t,r[t])}))}return e}function Pl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Rl=e=>{let{parentUri:t,attributeType:r}=e;return Nl({uri:Ve(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"),kr)),(0,l.always)({value:Date.now()})],[l.T,(0,l.always)({value:t})]])(e)})(r))},Sl=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)(io(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=Rl({parentUri:r,attributeType:e}),s=Dr(n,e);s&&(a.value=Sl({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(!(0,l.isEmpty)(a.value)||Boolean(a.lookupCode)||Sr(e))&&(o[t]=[a])}return o},wl=e=>{let{entity:t,metadata:r,mode:n,attrTypeFilter:i}=e;return Jo(r,t.type,!0,i).reduce(((e,t)=>{const i=t.name,a=st(t.uri);return(a===e.type?[{parentUri:e.uri,attributes:e.attributes}]:(Vs(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=Cl({entity:e,attributeType:t,parentUri:o,index:0});if(Ar(t)){const e=Dr(r,t);i=Il({attributeType:t,subAttributes:e,metadata:r,mode:n},i)}return i}return e}),e)}),t)},Il=(0,l.curry)(((e,t)=>{let{attributeType:r,subAttributes:n,metadata:i,mode:a}=e;const o=Vs(i,t,r.uri)[0],s=Nl({},o,{value:Sl({attributeTypes:n,parentUri:o.uri,mode:a,metadata:i})});return Ll({entity:t,attributeType:r,uri:o.uri,value:s})})),Ul=(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?Nl({},e,{value:Ul({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return Nl({},s(t),Sl({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),Cl=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=Rl({parentUri:n,attributeType:r}),u=Bs(l);return(0,ve.ZP)(t,(e=>{Ae(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},Dl=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,ve.ZP)(t,(e=>{Ae(e.attributes||e.value,r,n.uri,Bs(n),a,o,i)}))},Ll=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,ve.ZP)(t,(e=>{Ne(e.attributes||e.value,r,n,i,a,o)}))},jl=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,ve.ZP)(t,(e=>{Re(e.attributes||e.value,r,n,i)}))},kl=e=>""===e,Fl=(0,l.cond)([[(0,l.propSatisfies)((0,l.complement)((0,l.anyPass)([kl,l.isNil])),"lookupCode"),l.F],[(0,l.propSatisfies)((0,l.anyPass)([kl,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]]),Ml=(0,l.reject)(Fl),xl=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=>xl({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),Ml)),(0,l.when)((0,l.always)(t),(0,l.reject)(l.isEmpty)))},$l=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return xl({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),$s),deleteEmptyComplex:e})},Vl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)($l(e),(0,l.reject)(l.isEmpty))},Gl=(0,l.curry)(((e,t)=>t.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:i}=t;return al(r)?Ol({entity:e,attributeType:r}):Cl({entity:e,attributeType:r,parentUri:n,index:i})}),e))),Wl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n,value:i}=t;return al(r)?gl({entity:e,attributeType:r,value:i}):Ll({entity:e,attributeType:r,uri:n,value:i})})),Bl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n}=t;return al(r)?vl({entity:e,attributeType:r}):jl({entity:e,attributeType:r,uri:n})})),Yl=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)},ql="UrlThumbnail",Hl="CdnUrlThumbnail",Jl=(0,l.curry)(((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(Ps):(0,l.head)(n);return e&&e.value}return null})),Ql=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>Jl(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),Kl=Ql(["CdnUrl","Url"],!0),Xl=Ql(["CdnUrlPreview","UrlPreview"],!0),zl=Ql([Hl,ql],!0),Zl=Ql([Hl,ql]),eu=(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)(al(a)),(e=>null===e)),(0,l.always)([""])),(0,l.defaultTo)([]),ne)(o);return(0,l.when)((0,l.always)(r(u,a)),(0,l.append)({attrType:a,values:u}),e)}),[])},tu=(e,t,r)=>{const n=oo(e),i=(0,l.any)(r?l.T:Ps);return eu(n,t,i)},ru=(e,t,r,n,i,a)=>{const o=Ge(null==r?void 0:r.uri)?io(t,e):ao(t,e);return eu(o,r,((e,o)=>{const s=fa({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:Ps,e)||mr(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let nu;const iu=e=>{nu=e};function au(e,t){return nu(e,t)}const ou=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)})),su=50,lu=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=su,offset:a=0}=e;return au("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i,offset:a}),headers:{"Content-Type":"application/json"}})},uu=(0,l.once)((()=>au("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),cu=e=>au("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),pu=(e,t)=>au("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),du=e=>Z.fromNull(gn[e]).map(de().text).orSome(""),yu=(0,l.curry)(((e,t)=>`${e}_${t}`)),fu=(0,l.split)("_"),Tu=(0,l.includes)("_"),Eu=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),mu=(0,l.curry)(((e,t)=>e.some(Eu(t)))),hu=mu([On.IN_RANGE,On.COUNT_RANGE,On.WITHIN]),bu=mu([On.EXISTS,On.MISSING_VALUE]),Ou=(0,l.cond)([[bu,(0,l.always)(0)],[hu,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),vu=(0,l.complement)(bu),gu=mu([On.HAS_ALL,On.EQUALS,On.NOT_EQUALS]),_u=mu([On.COUNT_EQUALS,On.COUNT_NOT_EQUALS,On.COUNT_LT,On.COUNT_LTE,On.COUNT_GT,On.COUNT_GTE,On.COUNT_RANGE]),Au=mu([On.IN_FILE,On.NOT_IN_FILE]),Nu=e=>{switch(e){case On.COUNT_EQUALS:return On.EQUALS;case On.COUNT_NOT_EQUALS:return On.NOT_EQUALS;case On.COUNT_LT:return On.LT;case On.COUNT_LTE:return On.LTE;case On.COUNT_GT:return On.GT;case On.COUNT_GTE:return On.GTE;case On.COUNT_RANGE:return On.IN_RANGE}},Pu=mu([On.ON,On.BEFORE,On.AFTER,On.WITHIN,On.NOT_EQUALS]),Ru=mu([On.WITHIN]),Su=[[On.COUNT_EQUALS,On.COUNT_NOT_EQUALS,On.COUNT_LT,On.COUNT_LTE,On.COUNT_GT,On.COUNT_GTE],[On.NOT_IN_FILE,On.IN_FILE],[On.EQUALS,On.NOT_EQUALS,On.HAS_ALL],[On.LT,On.LTE,On.GT,On.GTE],[On.MISSING_VALUE,On.EXISTS],[On.COUNT_RANGE],[On.IN_RANGE],[On.STARTS_WITH,On.CONTAINS],[On.FULL_TEXT],[On.ON,On.BEFORE,On.AFTER,On.NOT_EQUALS],[On.WITHIN]],wu=(e,t)=>Su.some((r=>r.includes(e)&&r.includes(t))),Iu=(0,l.pipe)(l.omit,l.values),Uu={OPTIONS_FOR_STRING:Iu(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],On),OPTIONS_FOR_DATE:[On.ON,On.BEFORE,On.AFTER,On.WITHIN,On.NOT_EQUALS,On.MISSING_VALUE,On.EXISTS,On.COUNT_EQUALS,On.COUNT_NOT_EQUALS,On.COUNT_LT,On.COUNT_LTE,On.COUNT_GT,On.COUNT_GTE,On.COUNT_RANGE,On.IN_FILE,On.NOT_IN_FILE],OPTIONS_FOR_BOOLEAN:Iu(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],On),OPTIONS_FOR_BLOB:Iu(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],On),OPTIONS_FOR_NUMBER:Iu(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],On),OPTIONS_FOR_LOOKUP:Iu(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],On),OPTIONS_FOR_ENUM:Iu(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],On),OPTIONS_FOR_ID:[On.EQUALS,On.NOT_EQUALS,On.IN_FILE,On.NOT_IN_FILE],OPTIONS_FOR_COUNT:[On.EQUALS,On.NOT_EQUALS,On.LT,On.LTE,On.GT,On.GTE,On.IN_RANGE],OPTIONS_FOR_COMPLEX:[On.COUNT_EQUALS,On.COUNT_NOT_EQUALS,On.COUNT_LT,On.COUNT_LTE,On.COUNT_GT,On.COUNT_GTE,On.COUNT_RANGE,On.EXISTS,On.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[On.EQUALS,On.NOT_EQUALS,On.EXISTS,On.MISSING_VALUE]},Cu=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 Uu.OPTIONS_FOR_STRING;case zt.TYPE_LOOKUP:case zt.TYPE_DEPENDENT_LOOKUP:return Uu.OPTIONS_FOR_LOOKUP;case zt.TYPE_ENUM:return Uu.OPTIONS_FOR_ENUM;case zt.TYPE_DATE:case zt.TYPE_ACTIVENESS_DATE:case zt.TYPE_TIMESTAMP:case zt.TYPE_LOCAL_DATE:return Uu.OPTIONS_FOR_DATE;case zt.TYPE_BOOLEAN:case zt.TYPE_BOOLEAN_RADIO:return Uu.OPTIONS_FOR_BOOLEAN;case zt.TYPE_BLOB:return Uu.OPTIONS_FOR_BLOB;case zt.TYPE_LONG:case zt.TYPE_INT:case zt.TYPE_FLOAT:case zt.TYPE_DOUBLE:case zt.TYPE_NUMBER:return Uu.OPTIONS_FOR_NUMBER;case zt.TYPE_ENTITY_ID:return Uu.OPTIONS_FOR_ID;case zt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[On.EQUALS];case zt.TYPE_COUNT:return Uu.OPTIONS_FOR_COUNT;case zt.TYPE_NESTED:case zt.TYPE_REFERENCE:case zt.TYPE_IMAGE:return Uu.OPTIONS_FOR_COMPLEX;default:return Uu.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(_u,n):n},Du=e=>[gt.and,gt.andNot].includes(e),Lu=e=>[gt.or,gt.orNot].includes(e),ju=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),Lu)),ku=(Fu=[gt.and],e=>e.slice(0,-1).every((e=>Fu.includes(e.operator))));var Fu;const Mu=e=>e.map(((e,t,r)=>{const n=0===t;return(0,l.assoc)("operator",n?null:r[t-1].operator,e)}),[]),xu=e=>e.map(((e,t,r)=>{const n=t===r.length-1;return(0,l.assoc)("operator",n?null:r[t+1].operator,e)}),[]),$u=e=>`(${e})`,Vu=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},Gu=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)&&Vu(e.slice(1,-1));return!i&&!a||o?e:$u(e)},Wu="and",Bu=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)(Wu,n,e),o=(e=>[gt.andNot,gt.orNot].includes(e))(a)?Gu(r):r;return i?o:`${t} ${a} ${o}`}),"")}},Yu=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),qu=e=>Array.isArray(e)?e.map(qu).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),Hu=(0,l.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),Ju=e=>`'${e}'`,Qu=e=>`"${e}"`,Ku=e=>(0,l.pipe)((0,l.map)(e),(0,l.join)(" or ")),Xu=(0,l.pipe)(qu,Hu),zu=(0,l.pipe)(Xu,Ju),Zu=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.allPass)([(0,l.always)(hu(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[l.T,l.identity]])(t))),ec=(e,t)=>_u(t)?{type:zt.TYPE_INT}:Au(t)?{type:zt.TYPE_FILE}:Pu(t)&&!Ru(t)&&Fr(e.type)?{type:zt.TYPE_LOCAL_DATE}:e,tc=Object.values(wn),rc=e=>!Object.values(wn).includes(e),nc=e=>tc.includes(e),ic=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:In;return de().text(t[e])},ac=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.values(Rn),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:In;return e.map((e=>({value:e,get label(){return ic(e,t)}})))},oc=e=>{const t=f()().startOf("minute");switch(e){case Rn.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case Rn.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case Rn.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case Rn.LAST_6MONTHS:return[f()(t).subtract(6,"months").valueOf(),t.valueOf()];case Rn.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()];case Sn.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()];default:return e}},sc=e=>{let[t,r]=e;return[f()(t).valueOf(),f()(r).endOf("date").valueOf()]},lc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:oc;return(0,l.is)(String,e)?t(e):sc(e)};let uc;!function(e){e.CurrentUser="currentUser"}(uc||(uc={}));const cc={},pc=(e,t)=>{cc[e]=t},dc=e=>cc[e];function yc(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){fc(e,t,r[t])}))}return e}function fc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Tc=e=>e.split("{CurrentUser}").join(dc(uc.CurrentUser)||""),Ec=(0,l.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),mc=(0,l.curry)(((e,t,r)=>{const n=r.map(hu(e)||t.endsWith(".count")?Xu:zu).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),hc=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},bc=e=>{let{filter:t,fieldName:r,values:n}=e;const i=Ou(t);return(0,l.pipe)(hc(i),(0,l.map)(mc(t,r)),Ec(" or "))(n)},Oc=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(zu).join(",")})`},vc=e=>`*${e}*`,gc=e=>`URL:${e}`,_c=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,Ac=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===On.IN_FILE?r:`not ${r}`},Nc=(e,t)=>[R(e,t),S(e,t)],Pc=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!Rc(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case On.ON:return yc({},e,n?{filter:On.EQUALS}:{filter:On.IN_RANGE,values:[Nc(i,n)]});case On.BEFORE:return yc({},e,{filter:On.LTE,values:[[S(i,n)]]});case On.AFTER:return yc({},e,{filter:On.GTE,values:[[R(i,n)]]});case On.WITHIN:return yc({},e,{filter:On.IN_RANGE,values:[oc(i)]})}}return e}),bc),Rc=(0,l.propSatisfies)(Fr,"type"),Sc=[[(0,l.prop)("rawFilter"),(0,l.pipe)((0,l.prop)("rawFilter"),Tc)],[(0,l.propEq)("filter",On.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(bc({filter:On.EQUALS,fieldName:t,values:[r]}))),new Bu).build())),Ec(" or "))(r)}),Tc)],[(0,l.propEq)("filter",On.CONTAINS),(0,l.pipe)((e=>{let{filter:t,fieldName:r,values:n}=e;return bc({fieldName:r,filter:t,values:n.map((0,l.pipe)(qu,vc))})}),Tc)],[(0,l.propEq)("filter",On.EQUALS),(0,l.pipe)((e=>{const{fieldName:t,values:r}=e;return"type"===t?bc(yc({},e,{values:(0,l.flatten)(r)})):_c(r)?Oc(yc({},e,{filter:"listEquals"})):bc(e)}),Tc)],[(0,l.propEq)("filter",On.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=Ou(t);return(0,l.pipe)(hc(i),(0,l.map)(mc(t,r)),Ec(" and "))(n)})(yc({},e,{values:(0,l.flatten)(e.values)})):Rc(e)?(e=>{const{values:t}=e,r=!Rc(e),[n]=t;return(new Bu).addClause(bc(yc({},e,{filter:On.LT,values:[R(n,r)]}))).addClause(bc(yc({},e,{filter:On.GT,values:[S(n,r)]}))).orBuild()})(e):_c(t)?Oc(yc({},e,{filter:"not listEquals"})):bc(e)}),Tc)],[(0,l.propSatisfies)(Au,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return bc({fieldName:r,filter:Ac(t,r),values:n.map((0,l.prop)("link")).map(gc)})}],[(0,l.propSatisfies)(_u,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return bc({fieldName:`${r}.count`,values:n,filter:Nu(t)})}],[(0,l.propSatisfies)(Pu,"filter"),Pc],[(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 mc(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return mc(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,(0,l.pipe)(bc,Tc)]],wc=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!vu(e)||Uc(e,r))},Ic=(e,t)=>Array.isArray(t)?Uc(e,t):e===On.WITHIN?nc(t)||Number.isInteger(t):!(0,l.isNil)(t)&&qu(t).length>0,Uc=(e,t)=>t&&t.length>0&&t.every((t=>Ic(e,t)));function Cc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Dc=e=>{let{fieldName:t=""}=e;const r=t.split("."),n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},Lc=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),jc=(e,t,r)=>"children"===e?Fc(r,[...t][0],!0):r,kc=(e,t,r)=>"values"===e?[...r,...t]:r,Fc=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)(jc,t),e);if(!r&&gu(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(kc,t),e)}return(0,l.append)(t,e)},Mc=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=Dc(e),r=e=>e.fieldName===t?e:r({fieldName:Lc(e),children:[e]});return r(e)})(t);return Fc(e,r)}),[]),xc=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")),$c=e=>{let[t]=e;return t.children?$c(t.children):t.operator},Vc=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=$c(t)===gt.andNot,a=n(t,!1),o=i?`not ${Gu(a)}`:a,s=n(r,!1);return`inSameAttributeValue(${o} ${$c(r)||Wu} ${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&&xc(i)&&!t?r(i):n(i,a)}],...e])(o))),new Bu).buildWithOperators(i.map((0,l.prop)("operator")))}return n},Gc=(0,l.pipe)((0,l.propOr)("","filter"),Tu),Wc=(0,l.map)((0,l.when)(Gc,(e=>{const[t,r]=fu(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){Cc(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),Bc=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)(wc),Wc,Mc,Vc([...e,...Sc],t))},Yc=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),qc=[On.ON,On.BEFORE,On.AFTER,On.WITHIN,On.NOT_EQUALS,On.MISSING_VALUE,On.EXISTS],Hc=[On.EQUALS,On.NOT_EQUALS,On.STARTS_WITH,On.MISSING_VALUE,On.HAS_ALL,On.FULL_TEXT,On.EXISTS],Jc=[On.EQUALS,On.NOT_EQUALS,On.LT,On.LTE,On.GT,On.GTE,On.IN_RANGE],Qc=(e,t)=>{const r=fr(e);return(e=>{switch(e){case Mn.startDate.name:case Mn.endDate.name:case $n.dueDate.name:case Wn.createdTime.name:case Wn.updatedTime.name:case Yn.reltioLoadDate.name:case Yn.createDate.name:case Yn.updateDate.name:case Yn.deleteDate.name:case Yn.publishDate.name:return qc;case Bn.matches.name:case Yn.count.name:return Jc;case $n.workflow.name:case $n.assignee.name:case $n.step.name:case Vn.commenter.name:case Wn.createdBy.name:case Wn.updatedBy.name:case Yn.sourceSystems.name:case Yn.value.name:return Hc;default:return null}})(t)||Cu(r)},Kc=[On.EQUALS,On.NOT_EQUALS,On.CONTAINS,On.STARTS_WITH,On.MISSING_VALUE,On.HAS_ALL,On.IN_RANGE,On.WITHIN,On.EXISTS,On.ON],Xc=(0,l.pipe)(Qc,(0,l.filter)((0,l.includes)(l.__,Kc))),zc=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(Ps);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}}),""),Zc=(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},ep=/[,\s]*$/,tp=e=>{const t=de().text(Dn);if(!e)return t;const r=e.replace(ep,"");return""===r.toString().trim()?t:r},rp=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},np=(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=rp(e,r.referencedEntityTypeURI);if(n)return Zc({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return Zc({attributes:t||{}},r.dataLabelPattern);return""},ip=e=>{let{uiPath:t,uri:r}=e;return`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},ap=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)}`},op=e=>{let{uiPath:t,tag:r,entityUri:n}=e;return`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},sp=(0,l.curry)(((e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"")),lp=(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"))),up=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),lp),cp=(e,t,r)=>{const n=up(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)(Ws(e),lp)))(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")])})(dn(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>Vs(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,lp))(r)})(e,r)||hn(e,r.type);return sp(t,n)};function pp(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){dp(e,t,r[t])}))}return e}function dp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yp="DTSS/",fp=(0,l.replace)(new RegExp("^entities/"),""),Tp=e=>yp+e.dataTenant+"/"+e.uri,Ep=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),mp=e=>!(!e||!e.dataTenant),hp=(0,l.startsWith)(yp),bp=(0,l.pipe)((0,l.ifElse)(hp,(0,l.pipe)((0,l.split)("/"),(0,l.nth)(1)),(0,l.always)(null))),Op=(0,l.ifElse)(mp,Tp,(0,l.prop)("uri")),vp=e=>e&&e.uri?e.dataTenant?Tp(e):fp(e.uri):"",gp=(0,l.curry)(((e,t,r)=>(dn(t,r.type)||{})[e]||"")),_p=gp("label"),Ap=gp("typeGraphIcon"),Np=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=dn(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(Ps)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:np(e,o,i),uri:a.uri}})).filter(l.identity):[]},Pp=(0,l.pipe)(Np,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),Rp=(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=Rp(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):Rp(e.slice(1),r)}})),Sp=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,wp=e=>(0,l.propOr)([],"matchRules",e),Ip=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?pp({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},Up=(e,t,r)=>t&&r?r.aEntity:e,Cp=(0,l.evolve)({attributes:Vl(!0)}),Dp=(0,l.pipe)(Cp,(0,l.props)(["attributes","startDate","endDate","roles","tags"]),(0,l.all)(E)),Lp=e=>(0,l.assoc)("dataTenant",e),jp=()=>{const e={newUriMap:{}};return{getUri:t=>(0,l.pathOr)(t,["newUriMap",t],e),addUriFromCreateRequest:t=>r=>{var n;return null!=r&&null!==(n=r[0])&&void 0!==n&&n.successful&&((t,r)=>{e.newUriMap=(0,l.assoc)(t,r,e.newUriMap)})(t,r[0].object.uri),r},hasNewUri:()=>!(0,l.isEmpty)(e.newUriMap)}};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=async e=>{const t=[];for(const r of e){let e;try{e=await r()}catch(e){throw{errorMessage:e.toString()}}t.push(e);const n=Array.isArray(e)&&e.find((0,l.has)("errors"));if(n)throw n.errors}return t.flat()},Qp=e=>{let{type:t,parameters:r,dcrProcessor:n,relationUriProcessor:i}=e;const{enhanceUriWithDCR:a,updateDCRUriFromResponse:o}=n,s=e=>(o(e),e);switch(t){case Lt.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:o,attributes:l,startDate:u,endDate:c}=t;return Jf({startEntityUri:e,endEntityUri:n,relationType:o,attributes:l,startDate:u,endDate:c,uriPreprocessor:a}).then(s).then(i.addUriFromCreateRequest(t.uri))};case Lt.DELETE_RELATION:return()=>{const{relationUri:e}=r;return Hf(e,a).then(s)};case Lt.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return zf(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(s)};case Lt.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return Qf({oldRelation:e,newRelation:t,uriPreprocessor:a}).then(s)};case Lt.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:a,isReversed:o}=r,{uri:s}=a,u=[xp({relationUri:s}),Mp({parentUri:o?e:t,relation:a,entityUri:o?t:e})];return(0,l.pipe)((0,l.map)(Xp(n,i)),(0,l.map)(Qp),Jp)(u)}}},Kp=e=>t=>()=>e().then(t),Xp=(e,t)=>r=>kp({dcrProcessor:e,relationUriProcessor:t},r),zp=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=tn({alwaysCreateDCR:e,dcrUri:t}),n=jp();return{commandExecutor:e=>(0,l.pipe)(l.flatten,(0,l.map)(Xp(r,n)),(0,l.map)(Qp),(0,l.map)(Kp(r.getDcrUriAwait)),Jp)(e),dcrProcessor:r,relationUriProcessor:n}},Zp=e=>t=>(0,l.map)((t=>kp({},t,{parameters:(0,l.evolve)({parentUri:ih(e),entityUri:ih(e),newEntityUri:ih(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()),ih(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=ih(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)(Mi,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(il),ro)(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]&&Ji(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=Zc(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:Be()},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:jn.IN}:{type:t[0],direction:jn.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&&Xi(i,t)&&Zi(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===jn.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"],dn(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],dn(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(Qd,Mi(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(jn.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(jn.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}=Wi({reversedContextLabels:!0}),a=(0,l.curry)(((e,t,r,n)=>{const[i,a]=$i(e,n.uri);return n&&(!t||fn(e,i,t))&&(!r||fn(e,a,r))})),o=t=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],dn(e,t.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],dn(e,t.endObject.objectTypeURI)))(t),s=(e.relationTypes||[]).filter((0,l.both)(vs,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=fn(n,l.__,t.type),o=e?Wd:Gd,s=fn(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(fn(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)=>Ke(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"),Ke(t.attributeTypeUri)),l.T],[(0,l.both)((0,l.propEq)("type",zt.TYPE_REFERENCE),(0,l.pipe)(nr,(0,l.any)(Ke(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?Th(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 Zc(o,e.dataLabelPattern);if(gr(a)){const t=o,i=ks(t),a=tr(e),s=dn(n,a);return Ge(i)?Zc(r[i],s.dataLabelPattern):t.label}return""}case mt.tempEntity:return Zc(o,a.dataLabelPattern);case mt.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=dn(n,null==e?void 0:e.entityType);return`${tp(i&&Ge(i)?Zc(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||xi(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:tp(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!!ws(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=Jo(e,t.type||t.relationType,!0,r);return n.reduce(((r,n)=>{const i=Vs(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!Ps(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:de().text("Attribute is required"),source:yt.local}))})),r}),[])},Ny=(0,l.curry)(((e,t,r)=>Vs(e,t,r,!1))),Py=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),dn(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)(ks),(0,l.map)((e=>{let{uri:r}=e;return ty({type:dt.missedRefEntity,uri:"",attributeTypeUri:rt(r,t.type),parentUri:r,message:de().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)(ks,Ge)).flatMap((n=>{const i=ks(n),a=t[i],o=Ur(e,rt(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(Ke(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)=>({attributes:{[e.name]:[t]},type:nt(e.uri),uri:nt(t.uri)}),Uy=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=Iy(t,r),a=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=(r[0]||e).uri;return t.uri===n};return wy(e,n,i,a)},Cy=(e,t)=>{const r=(0,l.path)(Ld(),t)||{};return Ay(e,r)},Dy=(e,t,r)=>{t=t||{};const n=(0,l.pipe)((0,l.path)(Fd()),(0,l.ifElse)(Ge,(e=>t[e]),(0,l.always)(null)))(r),i=Cy(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:de().text("Entity is required"),source:yt.local})])(r),o=((e,t,r)=>r?wy(e,t,r):[])(e,t,n);return[...i,...a,...o]},Ly=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:de().text("Entity is required"),source:yt.local})],jy=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=Ay(e,r),i=Ly(t);return[...n,...i]};function ky(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Fy=(e,t)=>{var r,n;const i=dn(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||Oo(e)},My=e=>(0,l.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),xy=e=>{const t=r=>(0,l.ifElse)(Array.isArray,(0,l.map)(t),(0,l.pipe)(My(e),(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(0,l.map)(t))})))(r);return t},$y=(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)(Fs,Ge,l.not)]),(e=>{const t=(0,l.pipe)(Fs,ze)(e);return xy((e=>e.replace(t,t+Le)))(e)})),(0,l.when)((0,l.pipe)(ks,Ge),(t=>{const r=ks(t),n=e[r],i=n&&Gy(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){ky(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),Vy=(e,t,r,n)=>qh(Wh((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),Qh((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e,n).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)($y(r,e.type)),(0,l.map)(xy(lt))))})(e))).concat(th(e,t)),Gy=(e,t)=>(0,l.evolve)({attributes:xl({valueTransformer:(0,l.pipe)($s,$y(t),My(lt)),deleteEmptyComplex:!0}),uri:lt})(e);function Wy(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){By(e,t,r[t])}))}return e}function By(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Yy=(0,l.unless)(l.isNil,(e=>e.replace(new RegExp(De,"g"),"uri$$$$").replace(new RegExp(Le,"g"),""))),qy=e=>(0,l.pipe)((0,l.evolve)({objectUri:Yy,objectParentUri:Yy}),(e=>{return Wy({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?dt.missed:dt.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&&st(e.objectUri),uri:e.objectUri,source:yt.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),Hy=(e,t)=>(0,l.map)((0,l.pipe)(qy,(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 Wy({},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&&ot(i)){const n=(0,l.last)(a),i=n.valueType;if(gr(i)&&or(i).includes(o)){const i=ks(n.value),o=i&&Ge(i)?t[i]:null;return o?Wy({},e,{parentUri:o.uri,path:a.concat({type:mt.tempEntity,value:o,valueType:dn(r,o.type),label:""})}):e}}return e}})(t)))(e),Jy=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}},Qy=e=>`equals(user, '${Hu(e)}')`,Ky=e=>`equals(items.delta.sources, '${e.abbreviation}')`,Xy=e=>`equals(items.objectType, '${e.uri}')`,zy=e=>{const{period:t,type:r}=e;if(!Jy(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 "),ef=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),tf=e=>{let{query:t,body:r}=e;return t=ef(t),au(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},rf=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)(Bc(),Yc(t.globalFilter))(n),activeness:t.activityFilter||Cn.ACTIVE_ONLY};return t.searchOptions&&(i.options=t.searchOptions),`/entities/_total${zr(i)}`},nf=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=rf(e,t,r);return au(n)},af=e=>au(`/entities/_total?${e}`),of=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(0,l.pipe)((0,l.filter)(gs),(0,l.map)((0,l.prop)("uri")))(e),i={filter:On.EQUALS,fieldName:"type",values:n},a=r.isRawFilter?{rawFilter:t}:{filter:"containsWordStartingWith",fieldName:"attributes",values:[t]},o=(0,l.pipe)(Bc(),Yc(r.globalFilter))([i,a]),s=zr({filter:o,select:"uri,label,type,roles,secondaryLabel,defaultProfilePicValue",scoreEnabled:!0,activeness:r.activityFilter||Cn.ACTIVE_ONLY,max:r.max||4,options:r.searchByOv?"searchByOv":""});return au("/entities/_typeAheadSearch"+s,{method:"GET"})},sf=(0,l.pipe)((0,l.reject)(l.isNil),Xr),lf=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)(Bc(),Yc(i))(r),p=sf({filter:c||null,activeness:a||"active",options:o||null}),d=[{fieldName:t,pageSize:s||20,pageNo:u||1,orderType:n.orderType||"reversedCount"}];return tf({query:p,body:d})},uf=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return lf({fieldName:t,searchParams:i,options:n})};function cf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pf="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",df=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)(Bc(),Yc(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||pf,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null};return t.searchOptions&&(i.options=t.searchOptions),`/entities${zr(i)}`},yf=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=df(e,t,r);return au(n)},ff=e=>Of(e,{select:"secondaryLabel"}),Tf=(e,t)=>{const{select:r=pf,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),au("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},Ef=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),Ge)),mf=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=Ef(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)(Bc(),Yc(d.globalFilter))(h);return b&&(m.filter=b),p&&(m.sort=p.field,m.order=p.order),au(`${s}/api/${o}/${t}/_object`,{method:"POST",body:JSON.stringify(m)})},hf=e=>`entities?filter=equals(uri,'${e}')&offset=0`,bf={options:"sendHidden,addRefAttrUriToCrosswalk"},Of=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bf;return au(`/${e}${zr(t)}`)},vf=(e,t)=>Of(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){cf(e,t,r[t])}))}return e}({},bf,{explicitSurvivorshipGroup:t})),gf=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 au(n,r)},_f=e=>au(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),Af=(e,t,r)=>{const n={method:"POST",body:JSON.stringify(t)};return au(`/${e}/_clone${zr({executeLCA:!1,valuesToCopy:r})}`,n)},Nf=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return au(`/entities/_events/_total${Xr({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Pf=(e,t)=>au(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",body:t}),Rf=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return au(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",body:JSON.stringify(r)})},Sf=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 au(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),Xr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},wf=e=>{const t=new FormData;return t.append("file",e),au("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=fe(e,de().text("Can't upload file"));return Promise.reject(t)}))},If=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 au(`/personal/findSavedSearches${Xr({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"}})},Uf=e=>au(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),Cf=e=>au("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Df=e=>{const{uri:t}=e,r=(0,l.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return au(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},Lf=e=>{let{uri:t}=e;return au(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},jf=(e,t)=>(0,l.pipe)((0,l.evolve)({isPublic:(0,l.always)(t)}),Df)(e),kf=(e,t)=>(0,l.pipe)((0,l.evolve)({isFavorite:(0,l.always)(t)}),Df)(e);function Ff(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Mf=["max","offset","filter"],xf=(0,l.curry)(((e,t)=>t.nextEntry?(0,l.evolve)({nextEntry:xf(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){Ff(e,t,r[t])}))}return e}({},t,(0,l.pick)(Mf,e)))),$f=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},Vf=(0,l.omit)(["activeness"]),Gf=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=$f(t),{searchByOv:i}=r;t=(0,l.map)((0,l.pipe)((0,l.when)((0,l.prop)("nextEntry"),(e=>(0,l.pipe)(xf(e),(0,l.omit)(Mf))(e))),Vf,(0,l.omit)(["labels"])))(t);const a={limitCreditsConsumption:!0,activeness_enabled:n,options:i?"searchByOv":void 0},o=`/${e}/_connections${zr(a)}`,s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)};return{url:o,options:s}},Wf=(0,l.map)((e=>{let t=e;for(;t&&t.nextEntry;)t=t.nextEntry;return t})),Bf=(0,l.reject)(l.isNil),Yf=(0,l.unless)((0,l.startsWith)("/"),(0,l.concat)("/")),qf=e=>au(Yf(e),{method:"GET",headers:{"Content-Type":"application/json"}}),Hf=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r=(0,l.pipe)(t,Yf);return au(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},Jf=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?Vl()(i):null,startDate:a,endDate:o},c=(0,l.pipe)(Bf,ne,JSON.stringify);return au(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(u)})},Qf=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"),Yf,n),o=Wh(i(t),i(r),!1).concat(Yh(t,r));return au(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},Kf=(e,t,r)=>{const{url:n,options:i}=Gf(e,t,r);return au(n,i).then(Wf)},Xf=(e,t)=>au(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),zf=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===jn.IN?a.inRelations=[n]:a.outRelations=[n],au(`/${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 au(`${t}/recentSearches${zr({environment:r,tenant:n})}`,{method:"GET",application:i,headers:{"Content-Type":"application/json"}})},eT=e=>au("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),tT=e=>{let{environment:t,tenant:r,createdDate:n}=e;return au(`/recentSearches${zr({environment:t,tenant:r,createdDate:n})}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};function rT(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){nT(e,t,r[t])}))}return e}function nT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const iT={select:"label,secondaryLabel,name,type,startDate,endDate"},aT=(0,l.reject)(l.isNil),oT=(0,l.pipe)(aT,Xr),sT=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i,signal:a}=e;const o=rT({},iT,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{},{limitCreditsConsumption:!0});return au(`/${t}/_tree${oT(o)}`,{method:"GET",headers:{"Content-Type":"application/json"},signal:a})},lT=e=>{let{uri:t,graphUri:r}=e;const n=rT({},iT,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return au(`/${t}/_parents${oT(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},uT=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1,limitCreditsConsumption:o,max:s,signal:l}=e;const u=rT({},iT,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},o?{limitCreditsConsumption:o}:{},s?{max:s}:{},{filterLastLevel:i,deep:a});return au(`/${t}/_hops${oT(u)}`,{method:"GET",headers:{"Content-Type":"application/json"},signal:l})};function cT(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 pT=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},dT="/activities",yT=e=>{let{label:t,description:r}=e;return au(dT,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:pT()}})};var fT;!function(e){e.userSearch="USER_SEARCH",e.profileView="USER_PROFILE_VIEW"}(fT||(fT={}));const TT=e=>{const t=zr(e);return au(dT+t,{method:"GET"})},ET=e=>au(`/activities/_total${zr(e)}`,{method:"GET"}),mT=e=>{const{entityUri:t}=e,r=cT(e,["entityUri"]);return au(`/${t}/_activities${zr(r)}`,{method:"GET"})},hT=e=>{const{entityUri:t}=e,r=cT(e,["entityUri"]);return au(`/${t}/_activities/_total${zr(r)}`,{method:"GET"})};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){OT(e,t,r[t])}))}return e}function OT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vT=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},gT=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return au(vT({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},_T=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=vT({url:r,workflowPath:t,tenant:n})),au(s,{method:i||"GET",body:JSON.stringify(a),headers:bT({"Content-Type":"application/json"},null!=o?o:{})})},AT=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=vT({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,l.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return au(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)},NT=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=vT({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?bT({},l,{comment:o}):l;return au(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},PT=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const u=vT({url:`/tasks${s?zr(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(bT({objectURIs:[i]},(0,l.reject)(E,a)))};return au(u,bT({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},RT=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i,max:a,offset:o}=e;return au(vT({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})})},ST=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i,max:a,offset:o}=e;return au(vT({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)(bT({max:a,offset:o},i))})},wT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return au(vT({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},IT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return au(vT({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},UT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return IT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},CT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return au(vT({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},DT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return IT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},LT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return IT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},jT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return IT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},kT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a,processInstanceComment:o}=e;return au(vT({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a,processInstanceComment:o})})},FT=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return au(vT({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},MT=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 au(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),Xr)(d)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},xT=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 au(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),Xr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},$T=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return au("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},VT=(e,t,r)=>Promise.all(t.map((async t=>await au(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})))),GT=async(e,t)=>await VT(e,t,"NOT"),WT=async(e,t)=>await VT(e,t,"MATCH"),BT=async(e,t)=>await Promise.all(t.map((async t=>await au(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}}))));function YT(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){qT(e,t,r[t])}))}return e}function qT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function HT(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 JT=3e4,QT=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return au(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},KT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return TE({url:`entities/_connections/_hasNonImported?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,entityUri:i,content:a}=e;return TE({url:`entities/_connections/_import?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}})},zT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return au(`${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 zT({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},eE=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{uri:a}=n,[o,s]=(0,l.partition)(mp,i);return Promise.all([s.length?$T(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return zT({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},tE=(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=HT(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)}),[])),rE=(0,l.pipe)((0,l.find)((0,l.propEq)("index",0)),(0,l.propOr)({},"object"),tE),nE=e=>{let{dtssPath:t,customerTenant:r,entity:n}=e;const{uri:i,dataTenant:a}=n;return au(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:a,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(rE)},iE=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)},aE=iE((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return au(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{uri:a,type:o}])}).then(rE)})),oE=iE((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return au(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),sE=(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)}},lE=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return au(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},uE=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 lE(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},cE=uE("NOT"),pE=uE("MATCH"),dE=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{uri:o}=i,[s,u]=(0,l.partition)(mp,a);return Promise.all([VT(o,u,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return lE(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},yE=dE("NOT"),fE=dE("MATCH");function TE(e){let{requestProvider:t=au,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}`,YT({},HT(s,["headers"]),{headers:YT({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const EE=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return TE({url:df(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},mE=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return TE({url:rf(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},hE=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a,options:o}=e;const{searchByOv:s}=o,{options:u}=Gf(t,r);return TE({url:`entities/_connections/_getConnections${zr({dataEntityUri:t,options:s?"searchByOv":void 0})}`,options:u,dataTenant:n,customerTenant:i,dtssPath:a}).then((0,l.pipe)(Wf,(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)))}))))},bE=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return TE({url:`${hf(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},OE=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return au(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},vE=e=>{let{dtssPath:t,tenant:r}=e;return au(`${t}tenants/customerTenants?id=${r}&useCache=true`,{method:"GET",timeout:JT})},gE=e=>{let{dtssPath:t,customerTenant:r}=e;return au(`${t}subscriptions?useCache=true`,{method:"GET",headers:{CustomerTenant:r},timeout:JT})},_E=e=>{let{dtssPath:t,tenants:r}=e;return au(`${t}tenants/dataTenants?id=${r}&useCache=true`,{method:"GET",timeout:JT})},AE=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return TE({url:hf(t),dataTenant:r,customerTenant:n,dtssPath:i})},NE=()=>au("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET"});function PE(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){RE(e,t,r[t])}))}return e}function RE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const SE=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=PE({},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 au(`${t}/api/${r}/graph/search${zr({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},wE=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return au(`${t}/api/${r}/graph/search/count`,{method:"POST",body:PE({},n,i),headers:{"Content-Type":"application/json"}})},IE=(e,t)=>`${e}/${t}/comments`,UE=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return au(`${IE(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},CE=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return au(`${IE(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},DE=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return au(IE(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},LE=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return au(`${IE(t,r)}/${n.commentId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},jE=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return au(`${IE(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},kE=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i}=e;return au(`${IE(t,r)}/${n}/replies/${i}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},FE=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i,data:a}=e;return au(`${IE(t,r)}/${n}/replies/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},ME=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return au(`${IE(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},xE=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=zr({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return au(`${IE(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function $E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){VE(e,t,r[t])}))}return e}function VE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const GE=e=>{let{tenant:t,servicesPath:r}=e;return au(`${r}/users/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})},WE="graphExport",BE=async(e,t,r,n,i)=>{let a;try{const{data:n={}}=await JE({servicesPath:e,tenant:t,environment:r,namespace:WE,options:{method:"GET",headers:{"Content-Type":"application/json"}}});a=n}catch(e){a={}}const o={body:JSON.stringify($E({},a,{[n]:i})),headers:{"Content-Type":"application/json"}};let s;try{s=await JE({servicesPath:e,tenant:t,environment:r,namespace:WE,options:$E({method:"PUT"},o)})}catch(e){s=null}return s||(s=await JE({servicesPath:e,tenant:t,environment:r,namespace:WE,options:$E({method:"POST"},o)})),s},YE=e=>{let{servicesPath:t,key:r}=e;return au(`${t}/settings${zr({key:r})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},qE=e=>{let{servicesPath:t}=e;return au(`${t}/version/collect`,{method:"POST",headers:{"Content-Type":"application/json"}})},HE=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return au(`${n}/plugins${zr({tenant:t,user:r})}`,{method:"GET"})},JE=e=>{let{tenant:t,environment:r,servicesPath:n,options:i,namespace:a,projection:o}=e;return au(`${n}/configService${zr({tenant:t,environment:r,namespace:a,projection:o})}`,i)},QE=e=>{let{tenant:t,environment:r,servicesPath:n}=e;return JE({tenant:t,environment:r,servicesPath:n,options:{method:"GET"}})},KE=e=>{let{servicesPath:t,stateHash:r}=e;return au(`${t}/searchLink?key=${r}`,{method:"GET"})},XE=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),au(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},zE=e=>au(`/${e}?showObjectsInfo=true`,{method:"GET"}),ZE=e=>{let{exportPath:t,tenant:r,options:n}=e;return au(`${t}/${r}/activities${zr(n)}`,{method:"POST"})};function em(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){tm(e,t,r[t])}))}return e}function tm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rm=e=>{const{entityUri:t}=e;return au(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},nm=e=>{let{entityUri:t,crosswalk:r}=e;return au(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},im=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return au("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[em({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),em({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},am=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return au(`/${r}/_${n}${zr({contributorURI:t})}`,{method:"POST"})},om=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return au(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},sm=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return au(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},lm=e=>{let{entityUri:t,crosswalkId:r}=e;return au(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})};function um(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cm=e=>{let{entityTypeUri:t}=e;return au(`/dataQuality/fillRates${Xr({entityType:ze(t)})}`,{method:"GET"})},pm=e=>{let{attributes:t=[],metrics:r=[]}=e;const n=r.length,i=t.length*n;return i>10?10:i},dm=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){um(e,t,r[t])}))}return e}({},n===Dt.ATTRIBUTE_TYPE?{attributes:r}:{},i?{metrics:i}:{}),o=n===Dt.ATTRIBUTE_TYPE?Xr({numberOfThreads:pm({attributes:r,metrics:i})||1}):"";return au(`/entityType/${ze(t)}/dataQuality/${n}${o}`,{method:"POST",body:JSON.stringify(a)})},ym=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n,env:i}=e;return au(`${t}/api/${r}/dataValidationFunctions/entityTypes/${ze(n)}`,{method:"GET",headers:{env:i}})},fm=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 au(`${t}/${r}/entityType/${ze(n)}/ml/dataQuality/v1/${o}/timeSeries/`,{method:"POST",body:JSON.stringify(c)})},Tm=e=>{let{tenant:t,apiPath:r}=e;return au(`${r}/permissions/${t}`,{method:"GET"})},Em=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return au(`/${t}${zr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},mm=e=>{let{attributeUri:t,value:r}=e;return au(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},hm=e=>{let{attributeUri:t,value:r}=e;return au(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},bm=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return au(`/${t}${zr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},Om=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=zr({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=Vl()([[{value:a}]]);return au(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},vm=e=>{let{entityUri:t,attributeName:r,value:n}=e;return au(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},gm=e=>{let{entityUri:t,attributeName:r}=e;return au(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};function _m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Am=e=>{let{entityUri:t}=e;return au(`/${t}/_historicURIs`,{method:"GET"})},Nm=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 au(`/${t}/_changesWithTotal${zr(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){_m(e,t,r[t])}))}return e}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},Pm=(e,t)=>au(`/${e}/_previousChange${zr({timestamp:t})}`,{method:"GET"}),Rm=(e,t)=>au(`/${e}${zr({time:t})}`,{method:"GET"});function Sm(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){wm(e,t,r[t])}))}return e}function wm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Im=e=>{let{url:t,method:r,data:n,headers:i,noRequestProcessor:a}=e;const o=r||"GET";let s;return"GET"!==o&&(s=ue(n)?JSON.stringify(n):n),au(t,{method:o,body:s,headers:Sm({"Content-Type":"application/json"},null!=i?i:{}),noRequestProcessor:a})},Um=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=zr({options:a.join(","),severity:o.join(",")});return au(`${t}/validate/${i}/entity/${vp({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},Cm=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return au(`${t}/validate/${n}/entity${zr({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},Dm=e=>{let{tenant:t,apiPath:r}=e;return au(`${r}/tenants/${t}/name`,{method:"GET"})},Lm=e=>{let{tenant:t,apiPath:r}=e;return au(`${r}/tenants/${t}/_rdmTenants`,{method:"GET"})},jm=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e;return au(`${a}/preferences${zr({name:t,tenant:r,environment:n,user:i})}`,{method:"GET"})},km=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 au(`${a}/preferences`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})},Fm=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e,o={name:t,tenant:r,environment:n,user:i};return au(`${a}/preferences`,{method:"DELETE",body:JSON.stringify(o)})},Mm=e=>{const{servicesPath:t}=e;return au(`${t}/getTokenForWorker`,{method:"GET"})};var xm=r(29524);const $m=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=We(),s={attributes:Sl({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=Vs(r,e,n.uri)[0];return i&&i.value?Ll({entity:e,attributeType:n,uri:i.uri,value:t}):Cl({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},Vm=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.filter)((0,l.has)("refEntity")),(0,l.map)(ks),(0,l.filter)(Ge),(0,l.map)((t=>e[t])),(0,l.reject)(l.isNil))((null==t?void 0:t.attributes)||{}),Gm=(0,l.curry)(((e,t)=>{const r=Vm(e=e||{},t=t||{});return r.concat((0,l.chain)(Gm(e),r))})),Wm=(0,l.curry)(((e,t)=>(0,l.pipe)(ce,(0,l.filter)(e))(t))),Bm=Wm((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),Ym=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),Ge)),qm=e=>(0,l.pipe)(Bm,Ym(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),Hm=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(Bm,(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})),Jm=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),Ge),(0,l.omit)(["uri","timestamp"])),Qm=(0,l.pipe)(Jm,Cp),Km=async(e,t,r)=>{if(!e)return null;const n=qm(e);if(n.length>0)for(const r of n)e=Hm(r,t[r],e);const i=await gf(Qm(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},Xm=async(e,t,r)=>{const n=Zm(e,t),i={};for(const t of n)i[t]=await Km(e[t],i,r);return i},zm=(0,l.curry)(((e,t)=>{const r=xm.Node(t);return qm(e[t]).forEach((t=>{const n=zm(e,t);r.addEdge(n)})),r})),Zm=(e,t)=>(0,l.pipe)((0,l.map)(zm(e)),(0,l.map)(xm.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),eh=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)(Jm))})),th=(e,t)=>[...Kh(e.tags||[],t.tags||[]),...Xh(e.roles||[],t.roles||[]),...Bh(e,t),...Yh(e,t)],rh=(e,t,r)=>[...qh(Wh((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),Qh((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e,r),...th(e,t)],nh=(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 Hm(r,n,e)}),e))))}),t)}),eh),ih=(0,l.curry)(((e,t)=>(0,l.when)(Ge,(0,l.propOr)(l.__,t,e),t)));function ah(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){oh(e,t,r[t])}))}return e}function oh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sh=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return ah({},t,{[r]:{parents:n,children:i}})},lh=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return ah({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},uh=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=Vm(t,i),o=sh({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>uh(n.uri,t,[e],r)),o)},ch=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?lh({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(Fd(),n),s=Ge(o)?[o]:[],u=sh({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>uh(t,r,[i],e)),u)}),n)},ph=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return ch(r,e,t,uh(e,t))},dh=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return ph(t,r,n);if(qe(e)){const t=Bd(n,e);return t&&ch([t],null,r)}return r[e]?uh(e,r):void 0},yh=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>yh(e,t))))},fh=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>fh(e,t))))},Th=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=Ye(t),u=ph(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(qe(c)){if(s=Bd(i,c),!s)return null;o.push({type:mt.relationConnection,value:s,valueType:Mi(a,(0,l.path)(Dd(),s))});continue}if(qe(u)){const e=n[c];if(!e)return null;o.push({type:mt.tempEntity,value:e,valueType:dn(a,e.type)});continue}const p=n[u],d=rl(p,c),y=n[c];if(!d||!y)return null;o.push({type:mt.attributeValue,value:d,valueType:Ur(a,rt(d.uri,p.type))}),o.push({type:mt.tempEntity,value:y,valueType:dn(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},fh(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=qe(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?Mi(a,d.type):dn(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:dn(a,T.type)}),o.push({type:mt.attributeValue,value:s,valueType:E}),m=s.value;const l=ks(s);T=l&&Ge(l)?n[l]:null}}return o},Eh=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 mh;!function(e){e.insertAttribute="insertAttribute",e.updateAttribute="updateAttribute",e.deleteAttribute="deleteAttribute"}(mh||(mh={}));const hh={[mh.insertAttribute]:{color:"#599E0E"},[mh.updateAttribute]:{backgroundColor:"rgba(255, 187, 0, 0.12)",color:"#CC7500"},[mh.deleteAttribute]:{backgroundColor:"rgba(255, 50, 0, 0.2)",color:"#CF0E26"}},bh=e=>{switch(e){case"UPDATE_ATTRIBUTE":return mh.updateAttribute;case"UNDO_IGNORE_ATTRIBUTE":case"INSERT_ATTRIBUTE":return mh.insertAttribute;case"IGNORE_ATTRIBUTE":case"DELETE_ATTRIBUTE":return mh.deleteAttribute;default:return""}},Oh="/",vh=(0,l.pipe)((0,l.split)(Oh),(0,l.propSatisfies)((0,l.lte)(2),"length")),gh=(0,l.pipe)((0,l.split)(Oh),(0,l.slice)(0,-2),(0,l.join)(Oh)),_h=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.has)(e),(0,l.prop)(e)],[()=>vh(e),_h(gh(e))]])(t))),Ah=e=>(0,l.pipe)(l.keys,(0,l.any)((0,l.startsWith)(e+Oh))),Nh=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=_h(e,t);return(0,l.isNil)(r)?Ah(e)(t)?"UPDATE_ATTRIBUTE":"":r},Ph=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]},Rh=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(Rh(e))}))}))),t},Sh=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)(Ch,t),(0,l.propOr)([],"crosswalks",e))),e),wh=(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(wh(e))}))})),r},Ih=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=Ih(e);r>t&&(t=r)}))})),t+1):t},Uh=(e,t)=>{if(Ge(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},Ch=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},Dh=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},Lh=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},jh=(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)},kh=(0,l.eqBy)(Ch),Fh=(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)(Is,(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 Mh(e){return e&&void 0!==e.uri}let xh;function $h(e){return function(t,r){const n=[];return a=r,!(i=t)&&!a||!(!i||!a)&&i.length===a.length&&i.every((function(e,t){return e===a[t]}))||n.push({type:e,newValue:r}),n;var i,a}}function Vh(e){return void 0!==e.refEntity}function Gh(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 Wh(e,t,r){const n=[];for(const a in e)if(e.hasOwnProperty(a)){if("paging"===a)continue;const p=e[a];if(void 0===t[a])for(const e in p)p.hasOwnProperty(e)&&n.push(...o(p[e]));else for(const e in p)if(p.hasOwnProperty(e)){const f=p[e],T=y(f,t[a]);void 0===T?n.push(...o(f)):f.value===T.value||f.lookupCode&&f.lookupCode===T.lookupCode?f.ignored!==T.ignored&&n.push(...s(T)):null==T.value||""===T.value?n.push(...o(f)):"Nested"===d(f)?f.ignored!==T.ignored&&(0,l.equals)(f.value,T.value)?n.push(...s(T)):n.push(...Wh(f.value,T.value,r)):"Reference"===d(f)?Gh(f,T)?n.push(...Wh(f.value,T.value,r)):(n.push(...o(f)),n.push(c([T]))):""!==T.value&&(!1===T.ov?n.push(...u(T)):n.push(...(i=T,[{type:xh.UPDATE_ATTRIBUTE,uri:i.uri,newValue:{value:i.lookupCode||i.value}}])))}}var i;for(const r in t)if(t.hasOwnProperty(r)){if("paging"===r)continue;let i=(t[r]||[]).filter((function(t){return void 0===y(t,e[r])}));i=a((0,l.clone)(i)),i.length&&n.push(c(i))}return n;function a(e){return e?e.map((function(e){let t;if(e){const r=e.value;return null!=r&&(ue(r)?Object.keys(r).forEach((function(e){const n=a(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 o(e){return[{type:xh.DELETE_ATTRIBUTE,uri:e.uri}]}function s(e){return e&&(e.ignored?function(e){return[{type:xh.IGNORE_ATTRIBUTE,uri:e.uri,newValue:{value:!0}}]}(e):function(e){return[{type:xh.IGNORE_ATTRIBUTE,uri:e.uri,newValue:{value:!1}}]}(e))}function u(e){const t=e.uri.lastIndexOf("/"),r=e.uri.substr(0,t);return[{type:xh._UPDATE_NON_OV_ATTRIBUTE,uri:e.uri,typeUri:r,value:e.lookupCode||e.value}]}function c(e){let t=e[0].uri;const n=t.lastIndexOf("/");return t=t.substr(0,n),{type:xh.INSERT_ATTRIBUTE,uri:t,newValue:e.map((function(e){let t;const n={value:JSON.parse(JSON.stringify(e.lookupCode||e.value))};return r&&(n.uri=e.uri),p(n.value),Vh(e)&&(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}))}}function p(e){if(null!==e&&"[object Object]"===e.toString())for(const t in e)e.hasOwnProperty(t)&&"paging"!==t&&e[t].forEach((function(e){delete e.crosswalks,delete e.type,r||delete e.uri,p(e.value)}))}function d(e){const t=e.value;if(ue(t))return e.hasOwnProperty("refEntity")?"Reference":"Nested"}function y(e,t){if(void 0!==t)return t.filter((function(t){return t.uri===e.uri}))[0]}}function Bh(e,t){const r=[];var n,i;return e.defaultProfilePic!==t.defaultProfilePic?r.push({type:xh.UPDATE_PROFILE_PIC_BY_URI,newValue:{value:t.defaultProfilePic}}):(n=e.defaultProfilePicValue)===(i=t.defaultProfilePicValue)||Mh(n)&&Mh(i)&&n.uri===i.uri||r.push({type:xh.UPDATE_PROFILE_PIC_BY_URL,newValue:{value:t.defaultProfilePicValue}}),r}function Yh(e,t){const r=[],n=a(e.startDate,t.startDate);void 0!==n&&r.push({type:xh.UPDATE_START_DATE,newValue:{value:n}});const i=a(e.endDate,t.endDate);return void 0!==i&&r.push({type:xh.UPDATE_END_DATE,newValue:{value:i}}),r;function a(e,t){let r;return e!=t&&(r=(0,l.isNil)(t)?"":t+""),r}}function qh(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];const i="configuration/sources/Reltio",a="configuration/sources/ReltioCleanser";function o(e,t){return e.crosswalk={type:t.type,value:t.value},e}function s(e,t){return e.reduce((function(e,r){return(e[r[t]]=e[r[t]]||[]).push(r),e}),{})}function l(e){return e.removeIt=!0}const u=e.map((function(e){if(e.crosswalk)return[e];const s=Hh(t,e.uri),l=s.filter((function(e){return e.type===i})),u=s.filter((function(e){return e.type!==i}));let c=[];switch(e.type){case xh.INSERT_ATTRIBUTE:c.push(e);break;case xh._UPDATE_NON_OV_ATTRIBUTE:c=c.concat(s.map((function(t){return o(e,t)})));break;case xh.DELETE_ATTRIBUTE:(u.length||0==l.length)&&c.push({type:xh.IGNORE_ATTRIBUTE,uri:e.uri,newValue:{value:!0}}),c=c.concat(l.map((function(t){return o({type:xh.DELETE_ATTRIBUTE,uri:e.uri},t)})));break;case xh.UPDATE_ATTRIBUTE:{const s=u.some((e=>{let{type:t}=e;return t===a}))&&r?Jh(r,t,e.uri):null;if(s||l.length){if(l.length)c=c.concat(l.map((function(t){return o({type:xh.UPDATE_ATTRIBUTE,uri:e.uri,newValue:e.newValue},t)})));else if(s){const r=Hh(t,s.uri).filter((e=>{let{type:t}=e;return t===i}));c=c.concat(r.map((t=>o({type:xh.UPDATE_ATTRIBUTE,uri:s.uri,newValue:e.newValue},t))))}}else c.push({type:xh.INSERT_ATTRIBUTE,uri:e.uri.substr(0,e.uri.lastIndexOf("/")),newValue:[e.newValue],insteadOfUpdate:!0});u.length&&n&&c.push({type:xh.IGNORE_ATTRIBUTE,uri:e.uri,newValue:{value:!0}});break}}return c}));let c=u.flat();const p=s(c,"typeUri");for(const e in p){if("undefined"===e)continue;const t=p[e],r=c.filter((function(e){return e.type!==xh._UPDATE_NON_OV_ATTRIBUTE})).filter((function(t){return t.uri.substr(0,t.uri.lastIndexOf("/"))===e||"INSERT_ATTRIBUTE"===t.type&&t.uri===e})),n=t.find((function(e){const{crosswalk:t}=e;return t&&t.type===i}));!r.find((function(e){return"UPDATE_ATTRIBUTE"===e.type}))&&n&&(c.push({type:xh.UPDATE_ATTRIBUTE,uri:n.uri,newValue:{value:n.value},crosswalk:n.crosswalk}),r.forEach(l)),t.forEach(l)}return c=c.filter((function(e){return!e.removeIt})),c.forEach((function(e){delete e.insteadOfUpdate})),c}!function(e){e.UPDATE_PROFILE_PIC_BY_URI="UPDATE_PROFILE_PIC_BY_URI",e.UPDATE_PROFILE_PIC_BY_URL="UPDATE_PROFILE_PIC_BY_URL",e.UPDATE_START_DATE="UPDATE_START_DATE",e.UPDATE_END_DATE="UPDATE_END_DATE",e.INSERT_ATTRIBUTE="INSERT_ATTRIBUTE",e.UPDATE_ATTRIBUTE="UPDATE_ATTRIBUTE",e.DELETE_ATTRIBUTE="DELETE_ATTRIBUTE",e.UPDATE_ROLES="UPDATE_ROLES",e.UPDATE_TAGS="UPDATE_TAGS",e.IGNORE_ATTRIBUTE="IGNORE_ATTRIBUTE",e._UPDATE_NON_OV_ATTRIBUTE="_UPDATE_NON_OV_ATTRIBUTE"}(xh||(xh={}));const Hh=(e,t)=>e.filter((function(e){return 1===(e.attributes||e.attributeURIs||[]).filter((function(e){return e===t})).length})),Jh=(e,t,r)=>(0,l.pipe)(nl,(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 Uh(t,r)},e=>{let[t]=e;return!Ps(t)}]),(0,l.prop)(0),(0,l.always)(null)))(e,r);function Qh(e,t){t=t||[];for(const r in e)if(e.hasOwnProperty(r)){const n=e[r];for(let e=0;e<n.length;e++){const r=n[e];if(Vh(r)&&r.refRelation){const e=r.refRelation[0]||r.refRelation;if(e.crosswalks){const r=e.crosswalks.filter((function(e){return e.attributes||e.attributeURIs}));for(let e=0;e<r.length;e++){let n=!0;for(let i=0;i<t.length;i++)if(t[i].type===r[e].type&&t[i].value===r[e].value){t[i].attributes=t[i].attributes||t[i].attributeURIs,t[i].attributes=t[i].attributes.concat(r[e].attributes||r[e].attributeURIs),t[i].attributes=Object.keys(t[i].attributes.reduce((function(e,t){return e[t]=!0,e}),{})),delete t[i].attributeURIs,n=!1;break}n&&t.push(r[e])}}}}}return t}function Kh(e,t){return $h(xh.UPDATE_TAGS).call(this,e,t)}function Xh(e,t){return $h(xh.UPDATE_ROLES).call(this,e,t)}function zh(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){Zh(e,t,r[t])}))}return e}function Zh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var eb=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(ue(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:ue(t)?n[r]=i(e[r],t):-1===e.indexOf(t)&&n.push(t)}))):(ue(e)&&Object.keys(e).forEach((function(t){n[t]=e[t]})),Object.keys(t).forEach((function(r){ue(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=zh({},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:zh({},n,{roles:s,tags:u}),roles:i,tags:l}}}};const tb=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?tb(t.value):[]];return e.concat(r)}),[])),rb=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,nb=e=>e?[Op(e)]:[],ib=e=>{const t=[...tb((null==e?void 0:e.attributes)||[]),...tb((null==e?void 0:e.analyticsAttributes)||[])];return e?[...nb(e),...t]:[]},ab=(e,t)=>[e,...t.map((t=>rb(e,t)))],ob=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return md(t)}))},sb=(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[nt(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,Op({uri:n,dataTenant:i}),r]})(t)}},lb=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),ub=(0,l.curry)(((e,t)=>{const r=Bo(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(ub(e,r.extendsTypeURI)):n})),cb=(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))),pb=(e,t)=>(0,l.pipe)((0,l.prop)("type"),ub(e),cb(t))(t),db=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 yb,fb=r(33164);function Tb(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"}(yb||(yb={}));const Eb={},mb={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"]}},hb=e=>{if(!Eb[e]){const t=mb[e]||mb.random0;Eb[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){Tb(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return Eb[e]},bb=(0,l.curry)(((e,t)=>{const r=hb(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]})),Ob=e=>bb(yb.Charts,e),vb=()=>hb(yb.PotentialMatches).colors,gb=e=>bb(yb.Random1,e),_b=e=>(0,fb.getColor)(e)?"#FFFFFF":"#212121";var Ab=r(73116);const Nb=Array.from({length:100},((e,t)=>t/100)),Pb=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)},Rb={},Sb=new Ab.Z({hash:Pb,saturation:Nb.slice(15,71),lightness:Nb.slice(50,90)}),wb=new Ab.Z({hash:Pb,saturation:Nb.slice(46,89),lightness:Nb.slice(44,58)}),Ib=(0,l.curry)(((e,t,r)=>{t in Rb||(Rb[t]={});const n=Rb[t];r in n||(n[r]=((e,t)=>{const r=String(Pb(t));return e.hsl(r)})(e,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),Ub=Ib(Sb,"crosswalks"),Cb=Ib(Sb,"sources"),Db=Ib(Sb,"contributors"),Lb=Ib(Sb,"dataValidationFunctions"),jb=Ib(wb,"entities");function kb(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){Fb(e,t,r[t])}))}return e}function Fb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Mb=(0,l.has)("items"),xb=e=>0===e,$b=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)},Vb=e=>e.reduce(((e,t)=>e+t.width),0),Gb=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),Wb=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),Bb=e=>e.reduce(((e,t)=>e+t.height),0),Yb=e=>(0,l.is)(String,e)&&e.includes("%"),qb=(0,l.has)("spacer"),Hb=(e,t)=>Math.max(Math.round(parseFloat(t)/100*e),1),Jb=e=>((null==e?void 0:e.items)||[]).reduce(((e,t)=>e.concat(Mb(t)?Jb(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},Kb=e=>({id:e.layout}),Xb=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Kb;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=Yb(r.width)?Hb(i,r.width):u}return $b(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return $b(n,t,r)},o=(e,t)=>Mb(t.items[0])?p(e,t.items[0]):null,s=(t,r)=>{const o=r.items.map((a=>i(t,r,a,Mb(a)?n(a.layout):e(a.view)))),s=Qb(t.width,o),u=r.items.reduce(((r,n,i)=>{const o=s[i],u=xb(i)?t.x:(0,l.last)(r).x+(0,l.propOr)(o,"width",(0,l.last)(r));if(Mb(n))return r.concat(p(kb({},t,{x:u,width:o}),n));{const i=e(n.view);return r.push(kb({y:t.y,x:u,height:a(i),width:o},i)),r}}),[]);return{x:t.x,y:t.y,width:Vb(u),height:Gb(u),items:u}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=Mb(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=xb(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(Mb(i))return r.concat(p(kb({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(kb({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?$b(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?$b(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:Wb(i),height:Bb(i),items:i}},c=(t,r)=>{const n=(e,t,r,n)=>xb(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 kb({},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=kb({},e,{width:s[0]}),c=kb({},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(kb({},e,{y:n(e,t,a,f),height:f,items:(0,l.filter)(l.identity,[p,d])}))}return t}),[]);return kb({},e,{height:Bb(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(kb({},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 kb({},t,{height:y,items:(0,l.reject)(f,[s,p,d])})},p=(e,t)=>{const r=kb({},t,{items:(0,l.reject)(qb,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 Jb(f)},zb=(e,t)=>(e||[]).filter((e=>t.some((t=>t.id===e.id)))),Zb=[Mt.FilteredEntitiesViewFacet,Mt.ActivitiesViewFacet,Mt.ProfileStatsFacet,Mt.FilteredSavedSearchesFacet],eO=(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=Zb.includes(a.component)?8:4;return kb({},i,{height:Math.max(r,o),minHeight:Math.max(n,o)})}));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){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 nO={BarChart:Ft.BAR,BarChartGrouped:Ft.BAR,BarChartHorizontal:Ft.BAR,LineChart:Ft.LINE,Map:Ft.MAP,Pie:Ft.PIE},iO=(e,t)=>it(e)?et(e,t):e,aO=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=nO[r];return tO({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},oO=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return tO({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"]))},sO=(e,t,r)=>{const n=(e=>e&&ne(e).map((e=>{const{type:t,value:r}=e;return tO({},e,{value:[_n,An,On.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:Pn(t),fieldName:r,values:n?ne(n):void 0}})))(e);return t&&it(t)||!r?n:(n||[]).concat((i=r,{filter:On.EQUALS,fieldName:"type",values:[i]}));var i},lO=["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"],uO={"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:iO(n,r),filters:sO(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:iO(n,r),filters:sO(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=ne(a).find((e=>"type"===(null==e?void 0:e.attribute))),p=n||(null==c?void 0:c.value);return tO({id:t,count:o,canRead:u,orderType:s,attributeUri:iO(r,p),filters:sO(a,r,p),component:Mt.DashboardFacet,title:i,showOthers:!0},aO(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:iO(n,r),filters:sO(a,n,r),chartType:Ft.MAP,component:Mt.DashboardFacet,title:i,geoUrl:lO[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 tO({id:t,count:o,canRead:l,attributeUri:iO(n,r),filters:sO(a,n,r),component:Mt.DashboardFacet,title:i,geoUrl:s,chartType:Ft.MAP,projection:"geoMercator"},aO(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:oO(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:sO(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:On.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||de().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||de().text("Activity log")}}},cO=e=>({id:e,height:10}),pO=(0,l.pipe)((0,l.map)((e=>{const t=uO[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),dO=e=>{if("0.1"===e.version){const t=pO(e.views),r=Xb(cO,e.layout,{columns:4});return{id:e.id,margin:0,layout:zb(r,t),views:t}}return e},yO=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"),ne)],[(0,l.prop)("items"),(0,l.pipe)((0,l.prop)("items"),(0,l.map)((e=>yO(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);function fO(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){TO(e,t,r[t])}))}return e}function TO(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=fO({},xt,{OldMap:"com.reltio.plugins.entity.EntityMapView",OldTree:"com.reltio.plugins.entity.TreeView"}),mO=e=>e,hO={[EO.Attributes]:mO,[EO.HierarchyTree]:mO,[EO.HierarchyPaths]:mO,[EO.RelationsTable]:mO,[EO.Relations]:e=>fO({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[EO.SingleAttribute]:mO,[EO.Custom]:mO,[EO.AttributeTable]:mO,[EO.Map]:mO,[EO.OldTree]:e=>fO({},e,{class:xt.HierarchyTree}),[EO.OldMap]:e=>fO({},e,{class:xt.Map}),[EO.ImageAttribute]:mO,[EO.PotentialMatches]:mO},bO=(0,l.pipe)((0,l.map)((e=>{const t=hO[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),OO=(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})),vO=(e,t)=>(t||[]).map((t=>fO({},t,OO(e,t.id)))),gO=e=>{const t=(0,l.pick)(["id","workflow","maxWidth","sidePanelViews","profileBand","views"],e);if("2.0"===e.version)return fO({},t,{layout:vO(t.views,e.newLayout)});if("0.1"===e.version){const r=bO(e.views),n=Xb(OO(r),e.layout,{columns:3});return fO({},t,{layout:zb(n,r),views:r})}return e},_O=(e,t)=>e.class===t||e["react-class"]===t,AO=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(_O(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(_O(t,xt.SingleAttribute)||_O(t,xt.AttributeTable))&&e.includeUris.push(t.attributeUri),e}),{includeUris:[],excludeUris:null}))(e);return function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const i=(n[0]||e).uri;return r&&!r.some(Ke(i))||t.some(Ke(i))}},NO=(e,t)=>e.filter((e=>t.some((t=>_O(e,t))))).map((e=>{let{id:t}=e;return t})),PO=(e,t)=>{let{extensions:r}=e;return(r||[]).find((e=>e.id===t))},RO=(e,t)=>e.flatMap((e=>{let{extensions:r=[]}=e;return r.filter((e=>{let{point:r}=e;return r===t}))})),SO=e=>(0,l.pipe)((0,l.map)((e=>PO(e,"com.reltio.plugins.entity.ProfileBand"))),(0,l.reject)(l.isNil),l.head)(e);function wO(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){IO(e,t,r[t])}))}return e}function IO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const UO=(0,l.curry)(((e,t)=>yO(t).map((t=>(0,l.pipe)((0,l.map)((e=>PO(e,t))),(0,l.reject)(l.isNil),l.head)(e))).filter(l.identity))),CO=(0,l.either)((0,l.propEq)("label","D&B Connector"),(0,l.propEq)("label","D&B Connector")),DO=(0,l.propEq)("class",xt.Custom),LO=e=>{let{extensions:t=[]}=e;return t.filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]))},jO=(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=vO(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=>PO(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=UO(e,t.layout);i=((e,t)=>{if(t.side){var r;const n=(0,l.pipe)((0,l.chain)((e=>PO(e,t.side))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("layout"))(e),[i,a]=(0,l.partition)(CO,null!==(r=null==n?void 0:n.items)&&void 0!==r?r:[]),o=(0,l.pipe)(UO(e),(0,l.filter)(DO))(wO({},n,{items:i})),s=[{id:"common",views:UO(e,wO({},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=gO(wO({},t,{views:a,version:"0.1"})),u=(0,l.pipe)(SO,(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})},kO=(e,t)=>{if("scroll"===t.layout.layout){const r=UO(e,t.layout),n=dO(wO({},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}},FO=(e,t)=>{const r=UO(e,t.layout)[0];return{class:Vt.DQDashboard,id:t.id,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel,showTimeSeries:r.showTimeSeries}},MO=(e,t)=>{const r=UO(e,t.layout)[0];return{class:Vt.RelationshipSearch,id:t.id,options:r.options,consoleExportApp:r.consoleExportApp}},xO=(e,t)=>{const r=UO(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}},$O=(e,t)=>{const r=UO(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}},VO=(e,t)=>{const r=UO(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}},GO=(e,t)=>{const r=UO(e,t.layout)[0];return{class:Vt.PotentialMatches,id:t.id,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},WO=(e,t)=>{const r=UO(e,t.layout)[0],n=r.potentialMatchesReview||{processType:(e=>{const[t]=RO(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}},BO=(e,t)=>({class:Vt.Graph,id:t.id}),YO=(e,t)=>{const r=UO(e,t.layout)[0];return{class:Vt.ProfileActivityLog,id:t.id,exportTypes:r.exportTypes,caption:r.caption}},qO=e=>t=>!!(0,l.intersection)(e,t).length,HO=(0,l.cond)([[qO(["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"]),()=>kO],[qO(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>FO],[qO(["com.reltio.plugins.graph.GraphView"]),()=>BO],[qO(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>MO],[qO(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>xO],[qO(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>$O],[qO(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>VO],[qO(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>GO],[qO(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>WO],[qO(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>YO],[l.T,()=>(0,l.always)(void 0)]]),JO=(e,t)=>{const{class:r}=e;if("com.reltio.plugins.entity.ProfileAction"===r)return((e,t)=>{const r=(0,l.pipe)((0,l.chain)(LO),(0,l.map)((t=>jO(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=>PO(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=>PO(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=jO(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=yO(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 HO(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){KO(e,t,r[t])}))}return e}function KO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const XO=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))},zO="https://reltio-ui-files.s3.amazonaws.com/new-ui/";var ZO;!function(e){e[e.DashboardGroup=0]="DashboardGroup",e[e.ProfileGroup=1]="ProfileGroup",e[e.SearchGroup=2]="SearchGroup"}(ZO||(ZO={}));const ev={[Vt.DQDashboard]:`${zO}DqDashboard.svg`,[Vt.Dashboard]:`${zO}Dashboard.svg`,[Vt.Graph]:`${zO}Graph.svg`,[Vt.RelationshipSearch]:`${zO}GraphSearch.svg`,[Vt.Interactions]:`${zO}Interactions.svg`,[Vt.PotentialMatches]:`${zO}PotentialMatches.svg`,[Vt.Profile]:`${zO}Profile.svg`,[Vt.NestedProfile]:`${zO}Profile.svg`,[Vt.ProfileActivityLog]:`${zO}ActivityLog.svg`,[Vt.Relationships]:`${zO}Relationships.svg`,[Vt.Sources]:`${zO}Crosswalk.svg`,[Vt.Search]:`${zO}Search.svg`,[ZO.DashboardGroup]:`${zO}DashboardGroup.svg`,[ZO.ProfileGroup]:`${zO}ProfileGroup.svg`,[ZO.SearchGroup]:`${zO}SearchGroup.svg`,DEFAULT:`${zO}Default.svg`},tv=e=>ev[null==e?void 0:e.class]||ev.DEFAULT,rv=(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}`})))))),nv=(e,t)=>{var r;return(null===(r=e[t.class])||void 0===r?void 0:r.find((0,l.propEq)("id",t.id)))||t},iv=e=>"com.reltio.plugins.entity.ProfileFirstAction"===e.class?ev[ZO.ProfileGroup]:null,av=e=>(0,l.cond)([[(0,l.any)((e=>{let{icon:t}=e;return t===ev[Vt.Dashboard]||t===ev[Vt.DQDashboard]})),(0,l.always)(ev[ZO.DashboardGroup])],[(0,l.any)((e=>{let{icon:t}=e;return t===ev[Vt.Search]||t===ev[Vt.RelationshipSearch]})),(0,l.always)(ev[ZO.SearchGroup])],[l.T,()=>null]])(e),ov=e=>(0,l.pipe)((0,l.chain)(XO),(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:JO(e,t)}))),(0,l.filter)((e=>e.screen)))(t),n=rv(r);return(0,l.map)((e=>{let{label:t,screen:r,canRead:i,entityTypes:a}=e;return{label:t,icon:tv(r),screen:nv(n,r),canRead:i,entityTypes:a}}))(r)})(t,e),n=JO(t,e);return{label:t.label,icon:iv(t)||av(r)||tv(n),menu:r.length?{type:"side",items:r}:void 0,screen:n,canRead:t.canRead}}));function sv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lv=e=>{let{extensions:t}=e;return(t||[]).filter((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},uv=e=>({id:e,height:10}),cv=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)(lv),(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=pO(((e,t)=>{const r=yO(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){sv(e,t,r[t])}))}return e}({id:r},t[0])})),(0,l.uniqBy)((0,l.prop)("id")))(e)})(e,t.layout)),n=Xb(uv,t.layout,{columns:4});return{views:r,layout:zb(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))};function pv(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){dv(e,t,r[t])}))}return e}function dv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yv(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 fv=(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))),Tv=e=>"com.reltio.plugins.dashboard.DashboardPerspective"===e,Ev=(0,l.unless)((e=>!!e&&(e.startsWith("http:")||e.startsWith("https:"))),(0,l.always)(null)),mv=(0,l.pipe)(fv("top-logo"),Ev),hv=(0,l.prop)("showLookupCode"),bv=e=>{var t;const r=(e=>(0,l.pipe)((0,l.map)((e=>PO(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=>PO(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=>PO(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=>PO(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=>PO(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=>PO(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=>PO(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)(ue,(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 pv({thousandSeparator:r,decimalScale:n},yv(t,["groupSeparator","digitsAfterDecimalSeparator"]))})))(e))(e),c=(e=>(0,l.pipe)((0,l.map)((e=>PO(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)(fv("default-perspective"),(0,l.ifElse)(Tv,(0,l.always)("dashboard"),(0,l.always)("search")))(e))(e),d=(e=>(0,l.pipe)((0,l.map)((e=>PO(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=>RO(e,"com.reltio.plugins.ui.custom_script")),(0,l.reject)(E),(0,l.map)((e=>{let{action:t}=e;return pv({},t,yv(e,["action"]))})))(e))(e),f=(e=>fv("checkUser",e))(e),T=(e=>fv("checkIdle",e))(e),m=(e=>(0,l.pipe)((0,l.map)((e=>PO(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=>PO(e,"com.reltio.plugins.ui.LookupCodeVisibility"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}))(e))(e),b=void 0===(O=hv(h))||O;var O;const v=null===(t=SO(e))||void 0===t?void 0:t.showEntityId,g=(e=>fv("preview",e))(e),_=mv(e),A=(e=>fv("showAttributeDescription",e))(e),N=(e=>fv("topBackgroundColor",e))(e),P=(e=>(0,l.pipe)((0,l.map)((e=>PO(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),R=(e=>(0,l.pipe)((0,l.map)((e=>PO(e,"com.reltio.plugins.network.configuration"))),(0,l.reject)(l.isNil),l.head,(0,l.omit)(["id","point"]))(e))(e),S=(e=>(0,l.pipe)((0,l.map)((e=>PO(e,"com.reltio.plugins.search.dev.SearchView"))),(0,l.reject)(l.isNil),l.head,(0,l.path)(["options","showSearchByOv"]))(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,requestProvider:R,attributePresentations:u,attributesSorting:d,workflow:c,defaultRoute:p,customScripts:y,checkUser:f,checkIdle:T,showSearchByOv:S,showSwitchToClassic:m,showEntityId:v,preview:g,logo:_,showAttributeDescription:A,headerColor:N}},Ov=e=>({layout:ov(e),pivoting:cv(e),properties:bv(e)});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}const _v=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,Ce.x0)()}`;return n[e.id].push(t),i=!0,vv({},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]++,vv({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}};function Av(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}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}let Pv={};const Rv=(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(Pv[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))}Pv=Av({},Pv,{[a]:Av({},Pv[a]||{},{worker:i})})}else i=Pv[a].worker,Pv[a].innerText&&t({task:{action:qt.SET_HTML,params:{html:Pv[a].innerText}},worker:i,config:r}),i.removeEventListener("message",Pv[a].onWorkerMessage);return i&&(Pv[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||(Pv[a].innerText=n.params.html)}},i.addEventListener("message",Pv[a].onWorkerMessage)),i},Sv=(0,l.curry)(((e,t)=>!e||!e.availableEntityTypes||!t||e.availableEntityTypes.includes(t))),wv=(0,l.flip)(Sv);var Iv=r(83926);const Uv=(e,t)=>{const{thousandSeparator:r="",decimalSeparator:n=".",prefix:i="",suffix:a="",groupSize:o=3,decimalScale:s}=e,l=null!=s?new Iv.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 Cv;const Dv=()=>Cv,Lv={setLocale:e=>{Cv=e},getLocale:Dv,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 Uv(t,r)}catch(e){return console.warn("Number localization error"),r}})(Dv(),e),applyFormatToNumber:Uv},jv=(0,l.curry)(((e,t)=>null==t?"":("string"!=typeof t&&(t=String(t)),e&&t?Lv.applyFormatToNumber(e,t):(!e&&t&&(t=Lv.number(t)),t)))),kv=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?de().number(e,"0,0.0a").toUpperCase():de().number(e,"0,0"):""},Fv=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last));let Mv=!0;const xv=e=>Mv=e,$v=(e,t)=>e!==t&&t?Mv&&e?`${t} (${e})`:t:e,Vv=(e,t,r)=>(0,l.path)([t,r,"displayName"],e),Gv=(e,t,r)=>{const n=Vv(e,t,r);return $v(r,n)},Wv=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),Bv=(0,l.complement)(Wv),Yv=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),qv=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)},Hv=(0,l.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter(Bv(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),Jv=(0,l.curry)(((e,t)=>{let{attributePresentations:r={},dataTypeDefinition:n={},dateMask:i,dateTimeMask:a}=e;const o=r[n.uri]||r[Ln],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&&jv(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:le(t)?de().text("Yes"):de().text("No");case zt.TYPE_DATE:return(0,l.is)(Number,t)&&(t=A(Number(t)).getTime()),(t=t)&&(nc(t)?ic(t):de().date(t,s));case zt.TYPE_ACTIVENESS_DATE:case zt.TYPE_LOCAL_DATE:return(t=t)&&(nc(t)?ic(t):de().date(t,s));case zt.TYPE_TIMESTAMP:return(t=t)&&(nc(t)?ic(t):de().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)?$v((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 Kv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xv=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){Kv(e,t,r[t])}))}return e}({},i,{signal:r.signal})).finally((()=>{clearTimeout(a)}))}return e(t,i)},zv=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()}},Zv=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})))),eg=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={},u=(0,l.pipe)(Xv,(e=>{const t={},r={};return n=>{var i,a;const o=null!==(i=e.attemptsThreshold)&&void 0!==i?i:10,s=null!==(a=e.attemptsTimeWindowSize)&&void 0!==a?a:5e3;return(i,a)=>{const l=(e=>{const[t]=e.split("?");return t.split("/")[2]})(i),u=t[l],c=()=>Promise.reject({errorMessage:`service ${l} was disabled (authorization issues)`});if(u)return c();if(r[l]){const e=r[l].length;if(e>o){const n=e-o-1;if(r[l][e-1]-r[l][n]<=s)return t[l]=!0,c();r[l]=r[l].slice(n)}}return n(i,a).then((t=>{var n;return!e.excludedServices||null!==(n=e.excludedServices)&&void 0!==n&&n.includes(l)||(401===t.status?(r[l]||(r[l]=[]),u||r[l].push(Date.now())):r[l]&&t.ok&&(r[l].length=0)),t}))}}})(s),(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),zv,Zv);let c=0,p=[];return{request:(e,n)=>{const i=u(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(c){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 p.push(t),e}return a()},addRequestInterceptor:n,addResponseInterceptor:i,setRequestProviderConfiguration:e=>{Object.assign(s,e)},startInterceptorInit:()=>{c+=1},finishInterceptorInit:()=>{c=Math.max(c-1,0),0===c&&(p.forEach((e=>e())),p=[])},removeRequestInterceptor:a,removeResponseInterceptor:o}},tg="__metadata",rg=(e=>{const t=[tg,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),ng=(0,l.set)(rg),ig=(0,l.view)(rg),ag=ng(Un.NEW),og=ng(Un.REMOVED),sg=ng(Un.EDITED),lg=ng(Un.IGNORED),ug=(0,l.pipe)(ig,(0,l.equals)(Un.REMOVED)),cg=(0,l.pipe)(ig,(0,l.equals)(Un.NEW)),pg=(0,l.pipe)(ig,(0,l.equals)(Un.EDITED)),dg=(0,l.pipe)(ig,(0,l.complement)(l.isNil)),yg=(0,l.pipe)(ig,(0,l.equals)(Un.IGNORED)),fg=(0,l.omit)([tg]),Tg=(e,t)=>e===tg?void 0:t;function Eg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mg=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=mg(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},hg=(e,t)=>mg((0,l.propEq)("nodeId",t),e),bg=(e,t)=>mg((0,l.pathEq)(["entity","uri"],t),e),Og=(e,t)=>{const r=hg(e,t);return r.length>1?r[r.length-2]:null},vg=(e,t)=>{const r=hg(e,t);return r.length>0?r[r.length-1]:null},gg=(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=>gg(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},_g=()=>{},Ag=(e,t)=>{let{parent:r,nodeProcessing:n=_g}=t;n(e,r),e.children&&e.children.forEach((t=>Ag(t,{parent:e,nodeProcessing:n})))},Ng=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){Eg(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})}}},Pg=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&&Ag(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}=Ng({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}=Ng({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},Rg=(e,t)=>{if((0,l.path)(["entity","uri"],e)===t)return!0;if(e&&e.children)for(const r of e.children){const e=Rg(r,t);if(e)return e}return!1},Sg=(0,l.curry)(((e,t)=>{const r=(0,l.map)(Sg(e));return(0,l.evolve)({entity:t=>t.uri===e.uri?e:t,children:r},t)})),wg=(e,t)=>{const r=(0,l.pipe)(Object.entries,(0,l.filter)((t=>{let[,r]=t;return r.root&&((e,t)=>Rg(t,e.uri))(e,r.root)}))),n=(0,l.map)((t=>{let[r,n]=t;return{id:r,root:Sg(e,n.root)}}));return(0,l.pipe)(r,n)(t)},Ig={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},Ug={asc:"asc",desc:"desc"},Cg=Ig.entityLabel,Dg=Ug.asc,Lg=(0,l.always)(0),jg=e=>{let{sortField:t=Cg,sortOrder:r=Dg,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case Ig.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,l.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return uP.strings.sort(t,a,o)})(n,r);case Ig.entityLabel:return(e=>(t,r)=>{const n=(0,l.path)(["entity","label"]),i=n(t),a=n(r);return uP.strings.sort(e,i,a)})(r);default:return Lg}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},kg=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values(Ug)),l.identity,(0,l.always)(Dg))),Fg=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(Ig)),l.identity,(0,l.always)(Cg)));var Mg=r(91104);let xg;const $g=(e,t)=>(xg||(xg=Mg.createClient({key:t})),new Promise((t=>{xg.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)}))}))),Vg=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,l.is)(Object,t)&&(t=""),t},Gg=(e,t)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(Ps).flatMap((e=>{let r;return e.type==t&&(r=[Vg(e)]),(0,l.is)(Object,e.value)&&(r=(r||[]).concat(Gg(e.value,t))),r})),Wg=e=>e&&e.length>0,Bg=(e,t)=>[].concat(e&&e.attributes?Gg(e.attributes,t):[]).filter(l.identity);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 qg=(e,t,r,n,i,a)=>{if(e&&e.type){const t=dn(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){Yg(e,t,r[t])}))}return e}({},e,{attributes:{[i]:[n]}}));const a=(t.geoLocationAttributes||[]).map((t=>{return r=Bg(e,t.latitude),n=Bg(e,t.longitude),Wg(r)&&Wg(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(Wg(t)&&t[0].value&&Wg(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?$g(n.label,a).catch((()=>null)):Promise.resolve(null)},Hg=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=dn(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 qg(a,o,e,s,u,r).then((e=>!e&&a.label&&""!==a.label?$g(a.label,r).catch((()=>null)):e)).then((e=>ne(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)))},Jg=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=dn(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=Bg(t,r.latitude),n=Bg(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([Jg(e,t),Hg(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 Kg(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){Xg(e,t,r[t])}))}return e}function Xg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zg=(e,t)=>t.values.map(Lo(e,t.entityTypeUri)),Zg=(e,t,r)=>fl(t.fieldName,r)||Ur(e,et(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),e_=(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?$v(e,t):e}),r)},t_=(0,l.path)(["attrType","label"]),r_=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>Kg({},e,{[t]:!0})),{});e[r]=e[r]?Kg({},e[r],n):n}return e}),{}),n_=(0,l.pipe)((0,l.prop)("values"),E),i_=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",Jn.type.name)),a_=e=>e.type===l_.NUMERIC_RANGE_FACET,o_=e=>e.type===l_.DATE_RANGE_FACET,s_=(0,l.either)(a_,o_),l_={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},u_=e=>{switch(null==e?void 0:e.name){case Jn.type.name:return l_.ENTITY_TYPE_FACET;case Jn.createdBy.name:case Jn.updatedBy.name:case Jn.sourceSystems.name:case Jn.tags.name:case Jn.roles.name:case Jn.matchRules.name:case Jn.MLRecommendedMatch.name:return l_.WITH_DROPDOWN_CHECKBOXES_FACET;case Jn.createdTime.name:case Jn.updatedTime.name:case Jn.startDate.name:case Jn.endDate.name:return l_.DATE_RANGE_FACET;case Jn.matches.name:case Jn.matchScore.name:return l_.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return l_.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return l_.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return l_.DATE_RANGE_FACET;default:return l_.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},c_=(0,l.pipe)(Zg,u_),p_=(0,l.pipe)((0,l.path)(["attrType","type"]),Gr),d_=(0,l.cond)([[a_,(0,l.always)(On.IN_RANGE)],[o_,(0,l.always)(On.WITHIN)],[(0,l.allPass)([p_,e=>e.values.length>=2]),(0,l.always)(On.EXISTS)],[l.T,(0,l.always)(On.EQUALS)]]),y_=(0,l.cond)([[o_,(0,l.prop)("values")],[a_,(0,l.prop)("values")],[p_,e=>1===e.values.length?e.values.map(le):[]],[(0,l.pipe)((0,l.path)(["values",0]),Array.isArray),(0,l.prop)("values")],[l.T,e=>[e.values]]]);function f_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const T_=(0,l.pipe)((0,l.path)(["attrType","type"]),kr),E_=(0,l.pipe)((0,l.path)(["attrType","type"]),xr),m_=(0,l.pipe)((0,l.prop)("attrType"),El),h_=(0,l.pipe)((0,l.prop)("attrType"),Tl),b_=e=>t=>t.values.map((t=>dn(e,t).label)).join(" , "),O_=(0,l.when)((0,l.propSatisfies)((0,l.gt)(l.__,1),"length"),(0,l.join)(" – ")),v_=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(de().number),O_)),(0,l.join)(","))(e.values);return`${t_(e)}: ${t}`},g_=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(w),O_)),(0,l.join)(","))(e.values);return`${t_(e)}: ${t}`},__=e=>t=>`${t_(t)}: ${zg(e,t).join(", ")}`,A_=e=>t=>{const r=e_(e,t);return`${t_(t)}: ${r.join(", ")}`},N_=(0,l.curry)(((e,t,r)=>(0,l.map)((0,l.cond)([[h_,b_(e)],[E_,v_],[T_,g_],[m_,__(e)],[l.T,A_(t)]]),r))),P_=(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){f_(e,t,r[t])}))}return e}({},t,{attrType:Zg(e,t,n)}))),N_(e,r))(t),R_=new RegExp(`^${de().text("Search")}`),S_=(e,t,r,n)=>{let{uiState:i}=t;const{facets:a,keyword:o,advanced:s,readableQuery:u}=i;return(0,l.isEmpty)(s)?[...P_(e,a,r,n),...o?[o.value]:[]]:[(0,l.replace)(R_,"",u)]},w_=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values)(wn),I_=e=>(e=>w_.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]=oc(t);return e.replace(r,i).replace(n,a)}),e))(e),U_=(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}`})),C_={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},D_=e=>[C_.geoPolygon,C_.onMapMove].includes(e),L_=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},j_=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},k_=(e,t)=>D_(e)?t.map(L_):[j_(t)],F_=e=>D_(e)?de().text("Geo Polygon"):de().text("Geo Location"),M_=e=>{switch(e){case C_.geoLocation:return"geoLocation";case C_.geoPolygon:case C_.onMapMove:return"geoPolygon"}},x_={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},$_=e=>de().text(e),V_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[On.EQUALS]:"=",[On.NOT_EQUALS]:"≠",[On.STARTS_WITH]:"*",[On.MISSING_VALUE]:de().text("missing value"),[On.HAS_ALL]:de().text("has all"),[On.IN_RANGE]:de().text("in range"),[On.FULL_TEXT]:de().text("full text"),[On.EXISTS]:de().text("exists"),[On.COUNT_EQUALS]:`${de().text("count")} =`,[On.COUNT_NOT_EQUALS]:`${de().text("count")} ≠`,[On.COUNT_LT]:`${de().text("count")} <`,[On.COUNT_LTE]:`${de().text("count")} <=`,[On.COUNT_GT]:`${de().text("count")} >`,[On.COUNT_RANGE]:de().text("count range"),[On.LT]:"<",[On.LTE]:"<=",[On.GT]:">",[On.GTE]:">=",[On.IN_FILE]:de().text("in file"),[On.NOT_IN_FILE]:de().text("not in file"),[On.CONTAINS]:"~",[vn.LIST_EQUALS]:"=",[vn.NOT_LIST_EQUALS]:"≠",[vn.LIST_EQUALS_CASE_SENSITIVE]:"=",[vn.NOT_LIST_EQUALS_CASE_SENSITIVE]:"≠"}[e]||de().text(e.toLowerCase())},G_=e=>({type:x_.operator,text:e}),W_=e=>({type:x_.operator,text:$_(e)}),B_=e=>({type:x_.attributeLabel,text:e}),Y_=e=>({type:x_.specialAttributeLabel,text:e}),q_=e=>({type:x_.attributeFilter,text:V_(e)}),H_=e=>({type:x_.attributeValue,text:e}),J_=e=>({type:x_.entityTypeLabel,text:e}),Q_=()=>({type:x_.space,text:" "}),K_=()=>({type:x_.bracket,text:"("}),X_=()=>({type:x_.bracket,text:")"}),z_=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),Z_=(0,l.curry)(((e,t)=>t.map(z_(e)))),eA=(0,l.curry)(((e,t,r)=>[e,...r,t])),tA=eA(K_(),X_()),rA=eA(Q_(),Q_()),nA=(0,l.curry)(((e,t)=>[e,...t])),iA=e=>nA(J_(e)),aA=e=>nA(J_(`${e}: `)),oA=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=ju(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=Du(s),a=Lu(s);!r&&t&&n&&(i.push(K_()),r=!0),i.push(o),r&&a&&(i.push(X_()),r=!1);const l=e?W_(s):G_(s);i.push(...rA([l]))}else i.push(o),r&&(i.push(X_()),r=!1)}return i}},sA=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),lA=(0,l.pipe)(oA({localizable:!1}),sA),uA=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},cA=e=>{let{data:t,values:r,filter:n}=e;return t&&wc({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},pA=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(cA)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),dA=(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)&&[On.HAS_ALL,On.EQUALS,On.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})))),qv),yA=(e,t)=>(0,l.pipe)(dA,Hv(t))(e),fA=(0,l.pathEq)(["data","fieldName"],Jn.type.name),TA=(0,l.path)(["data","entityTypeUri"]),EA=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),mA=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(As(e)),attributes:(0,l.filter)((0,l.pipe)(TA,(0,l.anyPass)([l.isNil,As(e),r=>{const n=(t.entityTypes||[]).filter(As(e));return(n.length>1?mn(e,n):null)===r&&!!dn(e,r)}])))})(t))))),hA=e=>(0,l.pipe)((0,l.prop)("filter"),Ou,(0,l.equals)(e)),bA=(0,l.curry)(((e,t,r,n,i,a)=>{const o=fl(n.fieldName)||n.attrType,s=ec(o,i),u=Jv({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>Rr(s),()=>(0,l.is)(Object,a)&&a.lookupCode?$v(a.lookupCode,a.value):Gv(r,Pr(o),a)],[()=>El(s),()=>Lo(e,n.entityTypeUri,a)],[()=>ml(s),()=>ns(e,a)],[()=>_l(s),()=>os(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>xr(c)||Gr(c)),Qu),H_)()})),OA=(e,t,r,n)=>{const i=bA(e,t,r,n.data,n.filter);return(0,l.cond)([[hA(0),(0,l.always)([])],[(0,l.both)(hA(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:x_.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[Q_(),...(0,l.pipe)(l.flatten,(0,l.map)(i),Z_({type:x_.punctuationMark,text:", "}))(t)]}]])(n)},vA=(e,t)=>{const r=!!fl(e.data.fieldName);return(0,l.pipe)(uA,r?Y_:B_)(e,t)},gA=(e,t,r,n,i)=>[vA(n,i),Q_(),q_(n.filter),...OA(e,t,r,n)],_A=(0,l.addIndex)(l.map),AA=(0,l.propEq)("length",1),NA=(0,l.propSatisfies)((0,l.lt)(1),"length"),PA=(0,l.complement)(l.isEmpty),RA=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)(Mu,(0,l.filter)(cA),xu,(0,l.map)((n=>({operand:gA(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,oA()))(n)},SA=(0,l.pipe)(RA,l.flatten),wA=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>_p(e,{type:t}))).join(", ");return r?t(r):l.identity},u=RA(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(iA),(0,l.pipe)(s(aA),(0,l.unless)((()=>AA(u)||i),tA)))(u)},IA=(e,t,r,n)=>(0,l.pipe)(Mu,(0,l.filter)(pA),xu,_A(((n,i,a)=>({operand:wA(e,t,r,n,AA(a)),operator:n.operator}))),oA(),l.flatten)(n),UA=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),oA(),l.flatten),CA=e=>{let{searchType:t,values:[r]}=e;return k_(t,r).join(", ")},DA=(e,t,r,n,i,a)=>{const o=(e=>e?[Y_(e.isRawFilter?de().text("Raw filter"):de().text("Search")),...rA([q_(On.EQUALS)]),H_(`"${e.value}"`)]:[])(i),s=(e=>e?[Y_(F_(e.searchType)),Q_(),H_(CA(e))]:[])(a),u=(0,l.pipe)(IA,(0,l.when)((e=>NA(e)&&(PA(o)||PA(s))),tA))(e,t,r,n);return UA([o,s,u])},LA=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),jA=(0,l.pipe)(DA,LA),kA=(0,l.has)("attributes"),FA=Array.isArray,MA=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),xA=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=$A(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)(MA(a))),tA),(0,l.concat)(rA([G_(o)]))))(s)},$A=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return kA(n)?xA(e,t,r,n,i):FA(n)?n.reduce(((n,a)=>n.concat($A(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(rA([G_(n.operator)])))(gA(e,t,r,n,i))},VA=(e,t,r,n,i)=>(0,l.pipe)($A,l.flatten)(e,t,r,n,i);function GA(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){WA(e,t,r[t])}))}return e}function WA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const BA=(0,l.complement)(fA),YA=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(fA),(0,l.map)((0,l.prop)("values")),l.flatten,l.uniq)(e),r=(0,l.pipe)((0,l.map)(TA),(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}},qA=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=YA(t);return(r||n)&&ku(t)},HA=(0,l.ifElse)((0,l.all)((0,l.has)("entityTypes")),l.identity,(0,l.pipe)((e=>{const t=[],r=e.filter((0,l.complement)(qA)),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(fA).some((0,l.propEq)("filter",On.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}=YA(r);if(qA(e))t.push(GA({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter(BA)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(fA,(0,l.pipe)((0,l.prop)("values"),l.flatten),(0,l.pipe)(TA,(e=>[e]),(0,l.reject)(l.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(BA),entityTypes:n,operator:i?a:e.operator,id:(0,Ce.x0)()}}));t.push(...n)}var a;return t})(t))),[]))),JA={[On.EQUALS]:On.ON,[On.IN_RANGE]:On.WITHIN,[On.GTE]:On.AFTER,[On.GT]:On.AFTER,[On.LTE]:On.BEFORE,[On.LT]:On.BEFORE},QA=(0,l.curry)((e=>JA[e]||e)),KA=(0,l.curry)(((e,t)=>{switch(e){case On.LT:return[f()(t[0]).subtract(1,"day").valueOf()];case On.GT:return[f()(t[0]).add(1,"day").valueOf()];default:return t}})),XA=(0,l.pipe)((0,l.path)(["data","attrType","type"]),kr),zA=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>GA({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return XA(e)?(0,l.evolve)({filter:QA,values:KA(t)},e):e}))})))})),ZA=(0,l.evolve)({values:(0,l.when)((0,l.pipe)((0,l.prop)(0),rc),(0,l.map)(oc))}),eN=(0,l.map)((0,l.cond)([[XA,ZA],[l.T,l.identity]])),tN=(0,l.curryN)(3,((e,t,r,n,i)=>(0,l.pipe)((0,l.defaultTo)([]),HA,mA(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")),eN)})),zA,(0,l.reject)(EA))(r)));function rN(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){nN(e,t,r[t])}))}return e}function nN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const iN=(e,t)=>({data:{uri:it(e.fieldName)?et(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||d_(e),id:(0,Ce.x0)(),values:y_(e)}),aN=(0,l.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=fl(a,t,r)||Ur(e,i);if(!s)return null;if(mr(s))return rN({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=_p(e,{type:o}),i=(Ir(e,et(a,o),o)||[]).map((0,l.pick)(["label","name"])).slice(0,-1);return rN({},n,{attrType:s,title:t,pathToTitle:Array.isArray(i)?[r,...(0,l.chain)((0,l.prop)("label"),i),t]:[r,t]})}})),oN=(0,l.curry)(((e,t,r,n)=>tN(aN,e,n,t,r)));function sN(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){lN(e,t,r[t])}))}return e}function lN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const uN=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},cN=e=>"rdmLookups.not.resolved"===e?Jn.notResolved.name:e,pN=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===Nn?On.IN_RANGE:Pn(a),u=cN(n),c=fl(u)||Ur(e,i),p=(0,l.cond)([[()=>Au(s),(0,l.map)((0,l.when)((0,l.both)((0,l.has)("link"),(0,l.complement)((0,l.has)("filename"))),(e=>sN({},e,{filename:Fv(e)}))))],[()=>Gr(null==c?void 0:c.type),(0,l.map)(le)],[e=>gu(s)&&!Array.isArray(e[0])&&!kr(null==c?void 0:c.type),ie],[l.T,l.identity]])(o);return{id:(0,Ce.x0)(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===Nn?"and not":"and",filter:s,values:p}})),dN=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(pN(e,mn(e,i)));return[{id:(0,Ce.x0)(),operator:"or",attributes:a,entityTypes:i}]})),yN=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),fN=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([yN("from"),yN("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,()=>[]]]),TN=(e,t)=>{const r=(0,l.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return sN({},r,{values:fN(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?ul(e.fieldName,n):e.fieldName})},EN=(e,t)=>{if((0,l.has)("children")(e)){const r=TN(e,t);return e.children.reduce(((e,n)=>(e.push(EN(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return TN(e,t)},mN=(0,l.cond)([[(0,l.has)("searchParameters"),e=>{const t=[];return(0,l.has)("values",e)&&t.push(TN(e)),(0,l.propOr)([],"searchParameters",e).forEach((r=>t.push(sN({fieldName:e.fieldName},TN(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(EN,l.flatten)],[l.T,TN]]),hN=(0,l.pipe)((0,l.map)(mN),l.flatten),bN=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},ON=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=dN(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:hN(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>sN({},t,{type:c_(e,t)}))).map((e=>sN({},e,{values:s_(e)?bN(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 iN(r,t)})),operator:"or",id:(0,Ce.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=>({[cN(t)]:e[t]}))),l.mergeAll)(e)}(o),p=[sN({},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 oN(e,t,r,p)},vN=(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)(n_),(0,l.partition)(i_))(t),i=n.map((t=>rN({},t,{type:c_(e,t)}))).map((e=>iN(e))),a=r.values||[];return[{attributes:i,operator:"or",id:(0,Ce.x0)(),entityTypes:a}]})(e,a);return oN(e,t,r,o)})(e,t,r,n):ON(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},gN=e=>"2.0"===e.version?e.keyword:uN(e),_N=e=>(0,l.pathEq)(["object","uri"],e),AN=(e,t)=>(0,l.pipe)((0,l.find)(_N(e)),(0,l.prop)("object"))(t),NN=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"),_N(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=AN(r.match,t)||n[r.match];return i?{label:tp((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return Do(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)},PN=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,l.pick)(["uri","type","label"],r),e}),{}),RN=(0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)]),SN=(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:tp((0,l.prop)("label",o)),matchRules:i.concat(a).map((function(t){return Do(e,o.type,t)||{label:t,uri:t}}))}})))(t),wN=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)},IN=(0,l.path)(["object","uri"]),UN=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return e.find((e=>{let{uri:r}=e;return r===t}))},CN=e=>void 0!==(null==e?void 0:e.relevance),DN=e=>CN(e)?100*e.relevance+"%":"",LN=e=>{let t=[];return{addChild:e=>{t=(0,l.append)(e,t)},getValue:()=>e,getChildren:()=>t,removeChild:e=>{t=(0,l.without)([e],t)}}},jN=e=>e.getValue(),kN=(e,t)=>{let r=null;if(t(e.getValue()))return e;const n=e.getChildren();for(let e=0;e<n.length&&(r=kN(n[e],t),!r);e++);return r},FN=(e,t)=>{const r=[],n=(0,l.pipe)(jN,t),i=(0,l.pipe)(l.map,l.flatten),a=e.getChildren();a.some(n)&&r.push(e);const o=i((0,l.partialRight)(FN,[t]),a);return r.push.apply(r,o),r};function MN(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){xN(e,t,r[t])}))}return e}function xN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $N=(e,t)=>!!e[t],VN=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},GN=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||[]])},WN=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return MN({},t,{[r.uri]:MN({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:GN(null==o?void 0:o.parents,n),children:GN(null==o?void 0:o.children,i),values:GN(null==o?void 0:o.values,a,(0,l.prop)("uri"))})})},BN=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=dn(r,t)||Mi(r,t),i=(0,l.either)((0,l.both)((0,l.prop)("dependentLookupAttributes"),(0,l.prop)("dependentLookupCode")),(0,l.prop)("children"));return ys(r,n,i).flatMap(Ts).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=WN({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>WN({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},YN=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!Ge(e.uri)&&Je(e.type)&&Je(t)&&!t.startsWith(e.type))(n,t))return e;const i=Vs(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(Ps),(0,l.map)(VN))(i);return WN({structure:e,attrType:e[t].attrType,values:a})}),t)},qN=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 $N(e,r)}));return r||n?t.filter(Ps).reduce(((e,t)=>qN({structure:e,attributeValue:t})),e):e}),t);{const e=r;return $N(t,e.type)?WN({structure:t,attrType:t[e.type].attrType,values:[VN(e)]}):t}},HN=e=>{let{structure:t,uri:r}=e;return(0,l.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?MN({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},JN=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=Vs(i,n,r)||[];return a.length?WN({structure:t,attrType:t[r].attrType,values:a.filter(Ps).map(VN)}):t},QN=(e,t,r)=>{const n=Ye(e),i=Ye(t);return n===i?((e,t)=>{const r=st(t),n=st(e);return Ke(n,r)||((e,t)=>at(e)&&!at(t)&&Ke(t,e))(n,r)})(e,t):!(!r||!ot(t))&&yh(r,i).includes(n)},KN=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},XN=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?ph(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return QN(r,t,o)}))},zN=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>zN(e,t,r)))))},ZN=(e,t)=>{var r;return null==e||null===(r=e[t])||void 0===r?void 0:r.isTouched},eP=(e,t,r,n,i)=>{let{uri:a,value:o}=r;const s=a!==t&&KN(n,e);return{type:e,uri:a,lookupValue:o,autopopulate:s,useDefaultValue:s&&!ZN(i,a)}},tP=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s,editorsState:l}=e;const u=t[r],c=Ye(n),p=dh(c,o,i,a),d=zN("children",t,u),y=zN("parents",t,u),f=d.flatMap((e=>zN("parents",t,e))).filter((e=>![...y,u,...d].includes(e))),T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return QN(t,n,p)})).map((t=>eP(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 QN(n,t,p)||Ye(t)!==c&&QN(t,n,p)})).map((t=>eP(e.attrType.uri,n,t,s,l))))),m=f.flatMap((e=>{const r=zN("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)&&QN(n,t,p)}))})).map((t=>eP(e.attrType.uri,n,t,s,l)))}));return[...u.values.filter((e=>{let{uri:t}=e;return QN(t,n,p)})).map((e=>eP(r,n,e,s,l))),...E,...m,...T]},rP=async e=>{let{attributeType:t,attributePresentations:r,value:n}=e;const i=Jv({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=>Zc(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 cu([{codeValue:r,type:n}]).then((e=>{if(Array.isArray(e))return Gv(e[0],n,r)}))})(n)],[l.T,()=>s(n)]]);return await u(t)},nP=e=>{let{value:t,attributeType:r,entityType:n=""}=e,i=[{fieldName:"type",filter:On.EQUALS,values:[n]}];return Array.isArray(t)?i=i.concat(iP(r,t)):i.push(aP([t],r)),i},iP=(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)?iP(i,t[r]):[aP(t[r],i)];return e.push(...a),e}}),[])},aP=(e,t)=>e&&e.length&&!(0,l.isNil)(e[0])&&""!==e[0]?{fieldName:Nr(t.uri),filter:t.type===zt.TYPE_BLOB?On.FULL_TEXT:On.EQUALS,values:e}:{fieldName:Nr(t.uri),filter:On.MISSING_VALUE},oP=(e,t)=>(0,l.equals)(JSON.parse(JSON.stringify(e)),JSON.parse(JSON.stringify(t))),sP=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:oP}},lP={AttributesDiff:o,AttributesEditor:a,HistoryManager:s},uP={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([[9291],{50757:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>il,IL3:()=>fT,PY2:()=>Mn,Ng6:()=>vt,YJ7:()=>Cn,NlI:()=>vn,XYV:()=>wn,Xt7:()=>Tt,wfT:()=>Oi,EMD:()=>ui,HAc:()=>mt,PEf:()=>Wn,oA3:()=>li,$XE:()=>Ft,eWf:()=>Vn,q7e:()=>ht,KVe:()=>vi,WVQ:()=>Hr,oZZ:()=>wi,bNA:()=>Ii,Rjq:()=>Ui,G39:()=>Yn,W0P:()=>qt,X1H:()=>Wt,hdG:()=>Qt,ws7:()=>Kt,VI$:()=>Jt,yn8:()=>Dt,N0y:()=>Ct,dZX:()=>Mt,bQt:()=>Di,oS0:()=>zt,KfU:()=>Et,bZE:()=>Rn,Nsj:()=>jn,psV:()=>Un,xPW:()=>xn,pyR:()=>Ti,p8l:()=>pi,Wkf:()=>ft,zHr:()=>yt,NIO:()=>dt,$26:()=>l_,Esk:()=>ni,s9T:()=>It,MEy:()=>Bu,j5E:()=>On,vAw:()=>si,NMQ:()=>oi,eVu:()=>uc,YGb:()=>Yt,mNm:()=>yi,Y1q:()=>mh,RgZ:()=>di,Qy0:()=>Ci,Q26:()=>Ln,pYu:()=>ri,wIJ:()=>C_,GFH:()=>_t,Ury:()=>qn,S91:()=>Hn,p3$:()=>ji,wSh:()=>Z,BDP:()=>qi,pGS:()=>fi,ARY:()=>Zt,XGc:()=>bi,fO_:()=>sn,wwy:()=>Rt,h_8:()=>Qn,_XL:()=>Dn,j2V:()=>gi,dMV:()=>mi,NBX:()=>LN,OXy:()=>er,BXd:()=>Lt,KM9:()=>Ot,CJB:()=>Ni,lXI:()=>Vt,C68:()=>Bn,yxQ:()=>Li,Yj_:()=>St,D25:()=>Nt,ZIY:()=>xt,Tl4:()=>x_,lwr:()=>Gn,NkU:()=>_i,Rtp:()=>hi,YGx:()=>jt,uTS:()=>Ei,MCv:()=>bt,IYE:()=>ci,PiC:()=>Si,MVv:()=>Ht,h_m:()=>Gt,DUe:()=>Sn,tJI:()=>gt,fDt:()=>At,cNQ:()=>Ai,SwE:()=>ii,ZHR:()=>Ri,PYu:()=>Bt,lD1:()=>Jn,lVm:()=>kt,vnX:()=>Cg,$x5:()=>Dg,_R1:()=>Ig,wUm:()=>Ug,dC6:()=>Ut,MBD:()=>Pt,GmF:()=>Aa,cKm:()=>$t,iP_:()=>$n,NVC:()=>wt,tPT:()=>Cl,tZe:()=>UT,kRE:()=>nm,psB:()=>im,X0$:()=>Ul,$vY:()=>Il,zE1:()=>Gl,Wm5:()=>Ol,vyX:()=>Yc,wLZ:()=>Dl,W4V:()=>se,EtK:()=>xs,ayi:()=>wl,asT:()=>qN,kGs:()=>qh,ewt:()=>wd,O_f:()=>ku,sOy:()=>Ke,Tde:()=>Nr,LMI:()=>Sc,skb:()=>SA,sPt:()=>bc,sH1:()=>Oc,lPZ:()=>zy,bG8:()=>Xy,_LJ:()=>Zy,RPM:()=>ty,h27:()=>Mc,Uqd:()=>Bc,xG:()=>VA,Z2f:()=>Yv,fgW:()=>lA,I69:()=>DA,ZxB:()=>jA,dwd:()=>Ky,F$g:()=>Qy,mdt:()=>lb,Qbq:()=>Ih,rny:()=>sa,UEY:()=>Ya,Q0T:()=>Ba,Lyr:()=>za,sBn:()=>Wa,itK:()=>xa,H9$:()=>Ga,KPc:()=>Va,zos:()=>$a,ELQ:()=>Za,dZs:()=>wa,Cz4:()=>Sa,z_L:()=>Ka,fGe:()=>Ra,iuF:()=>Fa,Wib:()=>Ma,Hn0:()=>Xa,obS:()=>eo,E$L:()=>Ia,XUh:()=>ka,Qp_:()=>La,_jk:()=>Ua,sKE:()=>Ca,WmG:()=>ja,QKx:()=>Ja,Oik:()=>Ha,s0A:()=>Da,o9m:()=>qa,MCd:()=>Qa,RsS:()=>xc,tGK:()=>pu,lIv:()=>Wl,Vg3:()=>fa,mkC:()=>ta,xv5:()=>Ea,a14:()=>na,yv0:()=>Ta,Zm0:()=>ra,Nxd:()=>ea,$mM:()=>ya,ifj:()=>Qr,NWi:()=>dg,xr3:()=>pg,wNf:()=>vu,iJH:()=>yg,KB$:()=>CN,d89:()=>Xi,Edd:()=>zi,Z5t:()=>Zi,uGe:()=>Ji,UoR:()=>Hi,xvW:()=>cg,$qe:()=>ug,yPM:()=>Pa,$cp:()=>Vl,vKJ:()=>xl,VtG:()=>Af,AID:()=>rh,B1H:()=>wN,b7X:()=>Rh,$uE:()=>Qh,keo:()=>wh,C_p:()=>Vy,G27:()=>yO,JA0:()=>qE,b3T:()=>Yh,oC6:()=>Wh,_Zs:()=>Bh,epC:()=>Xh,YYG:()=>Kh,f_2:()=>JE,w3l:()=>pN,QHB:()=>dO,Jso:()=>hN,RXH:()=>Xb,Vr9:()=>gO,lMm:()=>Ov,BlA:()=>nP,fmQ:()=>Us,yRD:()=>zA,NcL:()=>Hy,QK6:()=>Ee,ymd:()=>yT,JV_:()=>Om,XiW:()=>zp,Yrx:()=>DE,GPx:()=>Sl,gjI:()=>Rl,vlo:()=>Hd,E_P:()=>rb,aAL:()=>eT,NBq:()=>Cs,wp9:()=>sb,DsR:()=>Jf,MPc:()=>Mp,gWE:()=>xp,DT_:()=>$p,ipn:()=>Gp,ORg:()=>Gi,_wz:()=>Vp,RYR:()=>fd,PP2:()=>ME,wS7:()=>eg,cBQ:()=>Cf,pBq:()=>$m,DsO:()=>ee,X78:()=>gm,xZs:()=>Em,YFy:()=>jE,Gmt:()=>lm,K$w:()=>sm,DSj:()=>tT,Mfr:()=>kE,k9j:()=>Lf,EjS:()=>X,ww$:()=>Ll,WVU:()=>om,hxF:()=>gl,n6p:()=>on,E7G:()=>Lp,nwO:()=>lP,Mzk:()=>Rf,aFF:()=>kh,HRH:()=>Hu,EZK:()=>np,Kxm:()=>Zc,Z9i:()=>by,CrF:()=>ZE,DNd:()=>ro,vUy:()=>XN,lJh:()=>Xu,zHo:()=>zu,sEJ:()=>kN,UO$:()=>qm,zeJ:()=>Ur,dLR:()=>Ws,JQy:()=>tl,XtP:()=>Vs,Ug0:()=>mn,A1W:()=>Sh,sw:()=>rp,nv3:()=>vg,JgD:()=>Og,nve:()=>FN,SkP:()=>rl,SAs:()=>Gm,i5L:()=>nl,PWK:()=>rs,IM5:()=>Gs,Aup:()=>vO,Mfk:()=>_v,HQx:()=>Es,oN$:()=>Ts,mB6:()=>Jv,p6d:()=>w,o0x:()=>U,ufS:()=>jv,k7L:()=>kv,ped:()=>DN,mrB:()=>I,OuZ:()=>ip,ncP:()=>Be,FQ2:()=>ap,W$R:()=>op,JOV:()=>Me,Zmi:()=>xe,hm5:()=>Ve,ECL:()=>zr,vPL:()=>sp,qmL:()=>Eh,hPi:()=>Mm,hXd:()=>ua,OCS:()=>ca,p2l:()=>ol,qF1:()=>TT,_X$:()=>ET,yj2:()=>S_,bzh:()=>pb,k66:()=>ds,kiP:()=>Ro,pSg:()=>ce,kz_:()=>GE,H_U:()=>fs,t9e:()=>uo,j2$:()=>CT,PFL:()=>fr,aJ3:()=>Zg,To9:()=>Pr,wpo:()=>Rp,ADq:()=>fy,UUb:()=>dy,tQX:()=>yy,xy8:()=>hr,EUG:()=>Cr,AFK:()=>rt,X3M:()=>Ir,WN0:()=>ys,kDl:()=>Bs,uDV:()=>Th,IhQ:()=>Ks,pfb:()=>zs,R$r:()=>tb,w80:()=>Wo,Pfu:()=>so,Gtj:()=>ru,fyF:()=>tu,kkq:()=>ps,u5q:()=>Ye,O$n:()=>Np,ptG:()=>Pp,f4_:()=>Ob,uap:()=>bb,d7q:()=>CE,liG:()=>xE,$oF:()=>UE,avf:()=>Fd,DiQ:()=>kd,cfX:()=>jd,vD3:()=>xd,Qrb:()=>Ld,EJQ:()=>Md,HWy:()=>Dd,gjS:()=>md,y6v:()=>Cd,JUW:()=>QE,GtP:()=>Db,_kX:()=>io,u1e:()=>ao,sJj:()=>Dh,CJp:()=>Ub,uKF:()=>Ch,wo0:()=>rm,s5:()=>as,cwx:()=>is,Y6b:()=>vE,TTx:()=>dm,UtR:()=>gE,HaQ:()=>ym,E6I:()=>zE,Won:()=>AE,vTU:()=>bE,Nsy:()=>Tp,KMQ:()=>jh,Do$:()=>bp,CSV:()=>ul,TMe:()=>_E,l1V:()=>ec,RHh:()=>lc,VQ1:()=>oc,cGG:()=>ac,z7d:()=>Jd,Xaq:()=>bs,Sj8:()=>tP,PJj:()=>lu,k3T:()=>bn,PjQ:()=>Bi,s7l:()=>hf,jLA:()=>Lb,BoX:()=>Dr,GGR:()=>Wd,j5q:()=>Vd,DnY:()=>Tf,RY5:()=>uh,Px$:()=>Td,KPC:()=>PN,NIY:()=>Nf,HvW:()=>Of,Fof:()=>co,BXy:()=>vf,fX:()=>jb,BTI:()=>vp,uie:()=>cp,q27:()=>wp,vrC:()=>jO,fAQ:()=>Pm,XkT:()=>ff,lrH:()=>Rm,nt9:()=>dn,XH8:()=>Ap,XH2:()=>hn,jFi:()=>_p,qhs:()=>Go,wwR:()=>Op,Uk3:()=>nt,$Rg:()=>pt,ev7:()=>IN,RB9:()=>YE,iFp:()=>ny,e$p:()=>ay,PcX:()=>oy,SpP:()=>iy,R6_:()=>t_,CY1:()=>u_,Ajk:()=>uf,Yiz:()=>lf,FK9:()=>tf,UOo:()=>Fv,aTW:()=>cm,uug:()=>Ou,P$2:()=>d_,XS2:()=>du,Hyb:()=>Cu,d3Y:()=>Qc,Klp:()=>Xc,WxZ:()=>y_,Gzu:()=>Zu,ZOr:()=>yf,uqV:()=>EE,Pm4:()=>re,hWO:()=>Ze,nHA:()=>_b,nVD:()=>ph,_tF:()=>dc,dED:()=>wE,P2h:()=>SE,jrr:()=>_o,mmY:()=>No,T6O:()=>ms,h6J:()=>ST,hM2:()=>vN,XR6:()=>z,jmz:()=>fh,IHt:()=>yh,NZI:()=>hy,wdF:()=>Am,YNv:()=>Ph,IFm:()=>Nh,o_F:()=>bh,kgP:()=>Nm,ZYI:()=>uT,QXK:()=>Xl,efz:()=>zl,Q5d:()=>Kl,Ysv:()=>Zl,UWq:()=>Xd,ocC:()=>Kd,io3:()=>Tn,Sbt:()=>Yo,roS:()=>Bo,Ww1:()=>qo,QaS:()=>Sf,wsP:()=>Oe,ERZ:()=>uN,CL1:()=>gN,idV:()=>tp,nIW:()=>ze,fjE:()=>r_,sG0:()=>$v,tV7:()=>uu,g8o:()=>F_,Qy:()=>k_,t2P:()=>zg,KbW:()=>Co,wId:()=>Lo,TAC:()=>UN,LS0:()=>jo,bFH:()=>nE,Rgl:()=>aE,fW1:()=>db,GFW:()=>fm,Ywp:()=>Pg,pg:()=>xT,WSA:()=>oE,fed:()=>bN,tT_:()=>Xs,BgZ:()=>Zs,xIV:()=>el,KbL:()=>mf,JBA:()=>st,aNC:()=>bg,RFJ:()=>lT,Zeh:()=>Ym,OT5:()=>Ng,mC3:()=>Yl,kR6:()=>rP,gFw:()=>vb,NVY:()=>ab,k6v:()=>mT,FEC:()=>hT,L5S:()=>nb,Ob5:()=>Ip,KUV:()=>Up,dvH:()=>ib,V3i:()=>NO,VD3:()=>En,mm2:()=>ic,rou:()=>Lm,izH:()=>oo,DK$:()=>lo,KMp:()=>Zf,c31:()=>nr,mbo:()=>Ey,gT8:()=>or,CZ8:()=>ws,uGi:()=>js,Poc:()=>tr,_9k:()=>Ms,ZTM:()=>Ds,bwT:()=>ks,tF$:()=>ar,o96:()=>Is,M4S:()=>Fs,_vs:()=>qf,xF8:()=>hd,PUO:()=>Fh,ATu:()=>Ty,j1S:()=>$i,V3K:()=>Mi,Lmx:()=>xi,oSN:()=>Yi,ZaZ:()=>rr,n_1:()=>hE,N6e:()=>Kf,SxO:()=>Ao,w3p:()=>ob,xU7:()=>fe,Y_p:()=>Qo,$k6:()=>Jo,Gdl:()=>Gv,U6P:()=>Vv,OwB:()=>e_,hTh:()=>dh,xqc:()=>os,JvE:()=>ss,i29:()=>Dc,dzT:()=>aa,uPS:()=>Uf,cZV:()=>If,n3B:()=>TA,e6O:()=>uA,s7j:()=>U_,j$Q:()=>KE,PeS:()=>Iy,kW2:()=>Cb,tH7:()=>ns,Yxg:()=>fl,MaZ:()=>Gd,nqN:()=>$d,jWj:()=>Zd,o_J:()=>Os,yW4:()=>wT,uT0:()=>PT,C82:()=>RT,bsH:()=>gb,u9Z:()=>Dm,LCU:()=>Tm,J$m:()=>mE,j_Q:()=>nf,OaI:()=>af,wB1:()=>SN,SP6:()=>MT,ZYr:()=>NN,IMU:()=>sT,FoU:()=>HE,DVz:()=>Hv,mxe:()=>yA,FHr:()=>Wm,D1g:()=>jm,VO3:()=>Fg,de5:()=>kg,Uw1:()=>be,J6q:()=>my,XCe:()=>Oo,fbl:()=>Rg,Ir:()=>Io,XQO:()=>Uo,QXb:()=>KT,zXF:()=>hh,P8_:()=>hm,iiD:()=>zf,MOC:()=>XT,WF:()=>QT,xE1:()=>Wi,idW:()=>BN,QWZ:()=>Rv,YL3:()=>Pf,NW9:()=>Lv,D_E:()=>Te,Fn9:()=>T,j2U:()=>al,MpE:()=>ur,kQw:()=>Er,mfm:()=>Du,vZp:()=>it,Wah:()=>vy,E8K:()=>$N,VSb:()=>Rs,vr_:()=>Tr,Vmh:()=>KN,FgW:()=>AO,oDv:()=>gs,fGG:()=>Sv,kuw:()=>As,eHk:()=>zd,Tt2:()=>vs,pQZ:()=>Ns,oZ7:()=>wv,T6Y:()=>Gr,VRd:()=>ut,_26:()=>wu,YkM:()=>Ar,J6y:()=>Tu,njU:()=>_u,TBP:()=>_s,IT0:()=>Oy,x_:()=>Lh,FP6:()=>ct,biM:()=>mp,TMl:()=>hp,Vkd:()=>Pu,WiY:()=>o_,_zi:()=>Ru,RZp:()=>Jy,J6D:()=>nc,Lt4:()=>kr,QEi:()=>Sr,whI:()=>un,KIu:()=>pn,JhM:()=>oe,C_0:()=>Yr,lzc:()=>Dp,qIF:()=>EA,O27:()=>E,aBi:()=>Sp,xOX:()=>bl,EdS:()=>Je,WgC:()=>He,eEv:()=>dr,A4t:()=>Au,YOQ:()=>ot,Wos:()=>$r,jWr:()=>to,Or$:()=>_r,lhE:()=>fn,CwH:()=>Rr,pzC:()=>El,ymH:()=>gu,QZu:()=>vr,rYH:()=>a_,FVt:()=>xr,Kn2:()=>ue,jgw:()=>Lu,Qgr:()=>rc,OXP:()=>Ps,nsY:()=>uy,vyG:()=>sy,lS4:()=>wr,g5f:()=>s_,fp6:()=>hu,Uty:()=>ba,YkG:()=>gr,xdS:()=>sr,kMF:()=>Wp,$NE:()=>Qe,bC9:()=>qe,Ian:()=>Vi,KVV:()=>Uh,q9e:()=>Ho,iIf:()=>Wv,ian:()=>_l,m6e:()=>qr,OFd:()=>ml,kqr:()=>mr,fnZ:()=>ln,VFZ:()=>Al,ZiX:()=>Ge,j5n:()=>Fr,zkt:()=>_,Pcm:()=>RN,QDV:()=>Tl,M5u:()=>i_,laD:()=>fA,mtq:()=>pr,CtB:()=>Bv,CBv:()=>ae,I0t:()=>Br,u1G:()=>qd,gk1:()=>pA,Bgb:()=>cA,uzs:()=>cn,v0l:()=>Ec,Zqp:()=>NE,j0k:()=>es,l22:()=>oP,tCm:()=>tt,gmx:()=>yu,mOr:()=>Yu,TwZ:()=>M_,GyU:()=>gg,zGm:()=>GT,bMg:()=>cE,EyD:()=>sg,FQA:()=>lg,fZN:()=>yE,xsF:()=>ag,Lxg:()=>og,O3l:()=>kf,Wni:()=>jf,wRx:()=>Tg,OxG:()=>eE,Jwg:()=>zT,uJQ:()=>ZT,qWg:()=>qv,i96:()=>$T,NPd:()=>Ku,MrZ:()=>ts,zhn:()=>fg,G8q:()=>ki,Jct:()=>ud,A9Y:()=>te,Y5F:()=>tN,gxP:()=>le,c$P:()=>fu,M7o:()=>Wc,BBN:()=>go,fS6:()=>Sd,ZBU:()=>K,UkJ:()=>ko,xkv:()=>mm,z$M:()=>YN,KAm:()=>BE,lCl:()=>nh,rkF:()=>Gy,IU6:()=>FT,RGr:()=>h,aYu:()=>m,ije:()=>ou,Buf:()=>Xf,YLu:()=>au,ct9:()=>Xo,XkY:()=>pE,T5R:()=>WT,uQS:()=>fE,wcJ:()=>Ko,d$I:()=>jl,rSp:()=>Ep,Sx:()=>_f,Ilm:()=>Bl,Ki6:()=>vl,VGk:()=>Hf,sFD:()=>zb,eWN:()=>HN,dWE:()=>I_,Lkd:()=>Zp,aDL:()=>Hm,yaA:()=>TE,lOh:()=>Fm,DBr:()=>Qg,hK$:()=>cu,TZ_:()=>kT,CMB:()=>mA,FU8:()=>gf,J$p:()=>Xm,b5s:()=>Km,h2W:()=>et,SL_:()=>Im,oUH:()=>_T,ck9:()=>BT,RAb:()=>pc,nL:()=>xv,k$p:()=>eO,Xs0:()=>iu,u7I:()=>km,rxg:()=>Mu,bji:()=>xu,oCZ:()=>Fy,MjG:()=>jg,FuV:()=>gT,$ju:()=>NT,t6d:()=>AT,m5F:()=>he,sx:()=>JN,rSc:()=>Qv,U10:()=>of,L8n:()=>am,R9X:()=>OE,rj2:()=>vm,_C4:()=>DT,tCj:()=>bm,uAg:()=>LE,wx9:()=>Id,KF3:()=>LT,ax9:()=>jT,HH7:()=>Qf,ufV:()=>FE,_6y:()=>Df,XTh:()=>wg,AJo:()=>wf,Ixr:()=>XE,oss:()=>sP,P6Y:()=>uP,q5j:()=>Uy,Bd_:()=>Dy,xkB:()=>Cy,W41:()=>Cm,WkI:()=>Um,sSE:()=>wy,GMd:()=>wc,jtL:()=>Ic,Bxm:()=>jy,FVh:()=>Ay,inb:()=>Ag,U_T:()=>sE,FTe:()=>ie,VGB:()=>ne,tM8:()=>$u,Wfe:()=>Qu,Ls5:()=>Ju,$bd:()=>Gu});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:()=>Ae,editAttribute:()=>Ne,editEndDate:()=>Ue,editRoles:()=>Se,editStartDate:()=>Ie,editTags:()=>we,removeAttribute:()=>Re});var o={};r.r(o),r.d(o,{EventType:()=>xh,applyCrosswalks:()=>qh,collectCrosswalksFromAttributes:()=>Qh,compareActivenessAttributes:()=>Yh,compareAttributes:()=>Wh,compareImages:()=>Bh,compareRoles:()=>Xh,compareTags:()=>Kh});var s={};r.r(s),r.d(s,{createHistoryManager:()=>eb});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("2023-01-05");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";class Z{constructor(e){this.value=void 0,this.value=e}isNone(){return(0,l.isNil)(this.value)}extract(){return this.value}orSome(e){return(0,l.isNil)(this.value)?e:this.value}map(e){return(0,l.isNil)(this.value)?Z.None():Z.Some(e(this.value))}static Some(e){return new Z(e)}static None(){return new Z(null)}static fromFalsy(e){return e?Z.Some(e):Z.None()}static fromNull(e){return(e=>null==e)(e)?Z.None():Z.Some(e)}static fromUndefined(e){return void 0===e?Z.None():Z.Some(e)}static fromEmpty(e){return E(e)?Z.None():Z.Some(e)}}const ee=(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)}},te=(e,t)=>(r,n)=>{const i=t?(0,l.prop)(t):l.identity;return e.indexOf(i(r))-e.indexOf(i(n))},re=(0,l.when)((0,l.is)(Array),(0,l.prop)(0)),ne=e=>Array.isArray(e)?e:[e],ie=e=>[e],ae=e=>!!e&&["www.","http://","https://","ftp://","ftps://","smb://","data:"].some((t=>String(e).toLowerCase().startsWith(t))),oe=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase()),se=e=>oe(e=e||"")?`mailto:${e}`:!e.includes("://")&&(e.toLowerCase().startsWith("www.")||e.split(".").length>2)?`http://${e}`:e,le=(0,l.when)((0,l.is)(String),(e=>""===e?void 0:"true"===e.toLowerCase())),ue=e=>null!=e&&["object","function"].includes(typeof e),ce=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)),ue(e[i])?r(e[i],n.concat(i)):t.push(n.concat(i)))};return r(e),t};var pe=r(87918),de=r.n(pe);const ye=(0,l.when)((0,l.is)(Object),JSON.stringify),fe=(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 de().text("Bad Request");case 403:return de().text("Forbidden");case 404:return de().text("Not Found");case 405:return de().text("Method Not Allowed");case 408:return de().text("Request Timeout");case 500:return de().text("Internal Server Error");case 502:return de().text("Bad Gateway");case 503:return de().text("Service Unavailable");case 504:return de().text("Gateway Timeout");default:return t||de().text("Something went wrong")}})(e,t)))],...n.map((e=>[(0,l.prop)(e),(0,l.pipe)((0,l.prop)(e),ye)])),[(0,l.always)(t),(0,l.always)(t)],[l.T,ye]])(e)},Te=e=>"AbortError"===e.name,Ee=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)},me=/[\n\r%#()<>?[\\\]^`{}|]/g,he=e=>`data:image/svg+xml;utf8,${e.replace(/["']\);{0,}$/,"").replace(/'/g,'"').replace(/>\s{1,}</g,"><").replace(/\s{2,}/g," ").replace(me,encodeURIComponent)}`,be=e=>`data:image/gif;base64,${e}`,Oe=e=>{switch(e){case"minutes":return de().text("minutes");case"hours":return de().text("hours");case"days":return de().text("days");case"weeks":return de().text("weeks");case"months":return de().text("months");case"years":return de().text("years");default:return""}};var ve=r(76665);function ge(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 - ${ue(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 _e(e,t){for(var r=e.substr(e.indexOf("/attributes/")+12).split("/"),n=[],i=0;i<r.length;i+=2)n.push(ge(r[i],r[i+1],e,t));return n}function Ae(e,t,r,n,i,a,o){void 0===a&&(a=0);var s=_e(r,t)[a];if(!s){const s=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(_e(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 Ae(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 Ne(e,t,r,n,i,a){void 0===a&&(a=0);var o=_e(r,t)[a];if(!o){const o=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(_e(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()?(Pe(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(Pe.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=Ae(e,t,r,n,i,a),s}var c=Ne(e,o,o.valueUri,{},i,a);Ne(c,t,r,n,i,a+1)}function Pe(e,t){ue(e)?(t.value=e.value,t.lookupCode=e.lookupCode):(t.value=e,t.lookupCode&&(t.lookupCode=e))}function Re(e,t,r,n){void 0===n&&(n=0);var i=_e(r)[n];if(!i){const i=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(_e(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&&Re(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 Se(e,t){e.roles=t||[]}function we(e,t){e.tags=t||[]}function Ie(e,t){e.startDate=t||""}function Ue(e,t){e.endDate=t||""}var Ce=r(37164);const De="1Tempo4rary",Le="1Tepmo4Rel",je=(0,l.cond)([[l.isNil,(0,l.always)("")],[(0,l.test)(/[^/]$/),(0,l.concat)(l.__,"/")]]),ke=(0,Ce.kP)("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",16),Fe=()=>`${ke()}${Date.now()}`,Me=()=>`1Tempo4DCR${Fe()}`,xe=e=>`${e}/uri$$${Fe()}`,$e=e=>()=>xe(e),Ve=(e,t)=>{const r=je(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return xe(n)},Ge=e=>e&&e.includes("uri$$"),We=$e("entities"),Be=$e("relations"),Ye=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),qe=(0,l.startsWith)("relations/"),He=(0,l.startsWith)("entities/"),Je=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/entityTypes/")),Qe=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/relationTypes/")),Ke=(0,l.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),Xe=(0,l.pipe)((0,l.split)("/"),l.head),ze=(0,l.pipe)((0,l.split)("/"),l.last),Ze=e=>e.split(".").slice(0,2).join("."),et=(e,t)=>{const[r,...n]=e.split("."),i=n.join(`/${r}/`);return`${t||""}/${r+(i&&`/${i}`)}`},tt=(0,l.curry)(((e,t)=>`${e}/attributes/${t}`)),rt=(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("/")},nt=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},it=(0,l.either)((0,l.startsWith)("attributes."),(0,l.startsWith)("analyticsAttributes.")),at=e=>{const t=e.startsWith("configuration/")?3:2;return e.split("/").length===t},ot=e=>5===e.split("/").length,st=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},lt=e=>e.replace(/uri\$\$/g,De),ut=e=>null==e?void 0:e.startsWith("changeRequests/"),ct=e=>ut(e)&&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=>Ke(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,Je),"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)(Xe,(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=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{entityTypes:[]},t=arguments.length>1?arguments[1]:void 0;const r=Cr(e,t);return r&&gr(t)?lr(r):r},Lr=[zt.TYPE_ACTIVENESS_DATE,zt.TYPE_DATE,zt.TYPE_TIMESTAMP,zt.TYPE_LOCAL_DATE],jr=[zt.TYPE_ACTIVENESS_DATE,zt.TYPE_TIMESTAMP,zt.TYPE_LOCAL_DATE],kr=e=>Lr.includes(e),Fr=e=>jr.includes(e),Mr=[zt.TYPE_INT,zt.TYPE_LONG,zt.TYPE_NUMBER,zt.TYPE_FLOAT,zt.TYPE_DOUBLE,zt.TYPE_COUNT],xr=e=>Mr.includes(e),$r=e=>[zt.TYPE_FLOAT,zt.TYPE_DOUBLE].includes(e),Vr=[zt.TYPE_BOOLEAN,zt.TYPE_BOOLEAN_RADIO,zt.TYPE_RDM_LOOKUPS_NOT_RESOLVED],Gr=e=>Vr.includes(e),Wr=[zt.TYPE_URL,zt.TYPE_BLOG_URL,zt.TYPE_IMAGE_URL],Br=e=>Wr.includes(e),Yr=Or(zt.TYPE_EMAIL),qr=e=>zt.TYPE_SSN===e;var Hr,Jr=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(Hr||(Hr={}));const Qr=(0,l.curry)(((e,t,r)=>{var n;const i=e===Hr.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)))})),Kr=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),Xr=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),Kr),zr=(0,l.pipe)((0,l.reject)(E),Xr);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){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=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("?")?"&":"?")+Kr(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}},rn=e=>t=>{if(!(e=>!ue(e.value))(t)){var r;const n=`${e}/${null!==(r=t.refEntity)&&void 0!==r&&r.objectURI?ze(t.refEntity.objectURI):Me()}`;return Zr({},t,{uri:n,value:(0,l.fromPairs)((0,l.map)(nn(n),(0,l.toPairs)(t.value)))})}return Zr({},t,{uri:`${e}/${Me()}`})},nn=e=>t=>{let[r,n]=t;return[r,(0,l.map)(rn(`${e}/${r}`),n)]},an=e=>{const{uri:t}=e;return(0,l.evolve)({attributes:(0,l.pipe)(l.toPairs,(0,l.map)(nn(`${t}/attributes`)),l.fromPairs)},e)},on=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:an}))))},e),sn={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},ln=(0,l.equals)(sn.SUGGESTING),un=(0,l.equals)(sn.EDITING),cn=(0,l.equals)(sn.VIEWING),pn=(0,l.either)(un,ln),dn=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),yn=(0,l.curry)(((e,t)=>(0,l.pipe)(dn(e),(0,l.prop)("extendsTypeURI"))(t))),fn=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(yn(e,r)));return n(r)})),Tn=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=yn(e,n);return r})),En=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?En(e,dn(e,t.extendsTypeURI),r):void 0,mn=(e,t)=>{const r=t.map(Tn(e));return(r.length?r.reduce(l.intersection):[])[0]},hn=(e,t)=>En(e,(0,l.is)(Object,t)?t:dn(e,t),"typeImage"),bn=(e,t)=>e.entityTypes.reduce(((r,n)=>n.uri!==t&&fn(e,t,n.uri)?r.concat(n.uri):r),[]),On={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"},vn={LIST_EQUALS:"listEquals",NOT_LIST_EQUALS:"not listEquals",LIST_EQUALS_CASE_SENSITIVE:"listEqualsCaseSensitive",NOT_LIST_EQUALS_CASE_SENSITIVE:"not listEqualsCaseSensitive"},gn={[On.EQUALS]:"equals",[On.NOT_EQUALS]:"not",[On.STARTS_WITH]:"starts with",[On.MISSING_VALUE]:"missing value",[On.IN_RANGE]:"in range",[On.HAS_ALL]:"has all",[On.FULL_TEXT]:"full text",[On.EXISTS]:"exists",[On.COUNT_EQUALS]:"count equals",[On.COUNT_NOT_EQUALS]:"count not equal",[On.COUNT_LT]:"count less",[On.COUNT_LTE]:"count less or equal",[On.COUNT_GT]:"count greater",[On.COUNT_GTE]:"count greater or equal",[On.COUNT_RANGE]:"count in range",[On.LT]:"less than",[On.LTE]:"less than or equal",[On.GT]:"greater than",[On.GTE]:"greater than or equal",[On.IN_FILE]:"in file",[On.NOT_IN_FILE]:"not in file",[On.CONTAINS]:"contains",[On.ON]:"on",[On.BEFORE]:"before",[On.AFTER]:"after",[On.WITHIN]:"within"},_n="in",An="notIn",Nn="not range",Pn=e=>({[_n]:On.EQUALS,[An]:On.NOT_EQUALS}[e]||e);var Rn,Sn;!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"}(Rn||(Rn={})),function(e){e.LAST_3DAYS="last3Days"}(Sn||(Sn={}));const wn=["LAST_DAY","LAST_3DAYS","LAST_WEEK","LAST_MONTH","LAST_6MONTHS","LAST_YEAR","PICK_DATE"].reduce(((e,t)=>(e[t]=Rn[t]||Sn[t],e)),{}),In={[Rn.LAST_DAY]:"Last 24 hours",[Sn.LAST_3DAYS]:"Last 3 days",[Rn.LAST_WEEK]:"Last 7 days",[Rn.LAST_MONTH]:"Last month",[Rn.LAST_6MONTHS]:"Last 6 months",[Rn.LAST_YEAR]:"Last year",[Rn.PICK_DATE]:"Pick date"},Un={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},Cn={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},Dn="<No label>",Ln="__number";var jn;function kn(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){Fn(e,t,r[t])}))}return e}function Fn(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.IN="in",e.OUT="out"}(jn||(jn={}));const Mn={startDate:{type:zt.TYPE_ACTIVENESS_DATE,get label(){return de().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:zt.TYPE_ACTIVENESS_DATE,get label(){return de().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},xn=kn({id:{type:zt.TYPE_ENTITY_ID,get label(){return de().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},Mn,{roles:{type:zt.TYPE_STRING,get label(){return de().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:zt.TYPE_STRING,get label(){return de().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),$n={workflow:{type:zt.TYPE_STRING,get label(){return de().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:zt.TYPE_STRING,get label(){return de().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:zt.TYPE_STRING,get label(){return de().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:zt.TYPE_TIMESTAMP,get label(){return de().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},Vn={commenter:{type:zt.TYPE_STRING,get label(){return de().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},Gn={notResolved:{type:zt.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return de().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},Wn={createdBy:{type:zt.TYPE_STRING,get label(){return de().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:zt.TYPE_STRING,get label(){return de().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:zt.TYPE_TIMESTAMP,get label(){return de().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:zt.TYPE_TIMESTAMP,get label(){return de().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},Bn={matches:{type:zt.TYPE_COUNT,get label(){return de().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:zt.TYPE_COUNT,get label(){return de().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0}},Yn={sourceSystems:{type:zt.TYPE_STRING,get label(){return de().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:zt.TYPE_STRING,get label(){return de().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:zt.TYPE_INT,get label(){return de().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:zt.TYPE_TIMESTAMP,get label(){return de().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:zt.TYPE_TIMESTAMP,get label(){return de().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:zt.TYPE_TIMESTAMP,get label(){return de().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:zt.TYPE_TIMESTAMP,get label(){return de().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:zt.TYPE_TIMESTAMP,get label(){return de().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:zt.TYPE_STRING,get label(){return de().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}};let qn;!function(e){e.matchRules="matchRules",e.MLRecommendedMatch="MLRecommendedMatch"}(qn||(qn={}));const Hn={[qn.matchRules]:{type:zt.TYPE_STRING,get label(){return de().text("Match Rules")},uri:qn.matchRules,name:qn.matchRules,faceted:!0,hideForDataTenant:!0},[qn.MLRecommendedMatch]:{type:zt.TYPE_STRING,get label(){return de().text("Match IQ")},uri:qn.MLRecommendedMatch,name:qn.MLRecommendedMatch,faceted:!0,hideForDataTenant:!0}},Jn=kn({},xn,$n,Vn,Gn,Wn,Bn,Yn,Hn,{type:{type:zt.TYPE_STRING,get label(){return de().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}}),Qn="NOT_MATCH";var Kn=r(13980),Xn=r.n(Kn);function zn(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 ei=Xn().oneOf(["mobile","tablet","desktop"]),ti=Xn().shape({deviceTypes:Xn().oneOfType([ei,Xn().arrayOf(ei)]),roles:Xn().arrayOf(Xn().string)}),ri=Xn().shape({value:Xn().string,lookupCode:Xn().string}),ni=Xn().shape({link:Xn().string,filename:Xn().string}),ii=Xn().shape({displayName:Xn().string,parent:Xn().string}),ai=Xn().oneOfType([Xn().string,Xn().number,Xn().bool,ri]),oi=Xn().oneOfType([ai,Xn().arrayOf(ai)]),si=Xn().shape({fieldName:Xn().string,values:Xn().arrayOf(oi),filter:Xn().string,type:Xn().string}),li=Xn().shape({minValue:Xn().number,maxValue:Xn().number}),ui=Xn().shape({label:Xn().string,name:Xn().string,description:Xn().string,type:Xn().string,hidden:Xn().bool,faceted:Xn().bool,searchable:Xn().bool,uri:Xn().string,access:Xn().arrayOf(Xn().string),cardinality:li}),ci=Xn().shape({label:Xn().string,uri:Xn().string,typeColor:Xn().string,direction:Xn().string,startObject:Xn().object,endObject:Xn().object}),pi=Xn().shape({typeColor:Xn().string,typeIcon:Xn().string,typeImage:Xn().string,label:Xn().string,uri:Xn().string,attributes:Xn().arrayOf(ui)}),di=Xn().shape({uri:Xn().string,label:Xn().string,memberTypes:Xn().array,extendsTypeUri:Xn().string,attributes:Xn().arrayOf(ui)}),yi=Xn().shape({uri:Xn().string,label:Xn().string,extendsTypeUri:Xn().string,relationshipTypeURIs:Xn().arrayOf(Xn().string)}),fi=Xn().shape({uri:Xn().string,description:Xn().string,label:Xn().string,schemaVersion:Xn().string,entityTypes:Xn().arrayOf(pi),roles:Xn().arrayOf(Xn().object),groupTypes:Xn().arrayOf(Xn().object),relationTypes:Xn().arrayOf(ci),graphTypes:Xn().arrayOf(yi),interactionTypes:Xn().arrayOf(di),sources:Xn().arrayOf(Xn().object)}),Ti=Xn().shape({uri:Xn().string,type:Xn().string}),Ei=Xn().shape({uri:Xn().string,type:Xn().string}),mi=Xn().shape({value:Xn().object,ov:Xn().bool,type:Xn().string,uri:Xn().string}),hi=Xn().shape({refEntity:Xn().oneOfType([Xn().array,Xn().object]),refRelation:Xn().oneOfType([Xn().array,Xn().object]),value:Xn().object,ov:Xn().bool,type:Xn().string,uri:Xn().string}),bi=Xn().oneOf((0,l.values)(sn)),Oi=Xn().shape({type:Xn().oneOf(Object.values(dt)).isRequired,attributeTypeUri:Xn().string.isRequired,parentUri:Xn().string.isRequired,uri:Xn().string,message:Xn().string}),vi={attributeType:ui,showEmptyEditors:Xn().bool,lazy:Xn().bool,mode:bi,metadata:fi,ownError:Oi,errors:Xn().arrayOf(Oi),crosswalks:Xn().array,onAddAttributes:Xn().func,onAddOneMore:Xn().func,onDeleteAttribute:Xn().func,onChangeAttribute:Xn().func,additionalControlsRenderer:Xn().func,hideDeleteButton:Xn().bool,showNonOv:Xn().bool,state:Xn().oneOf(["deleted","edited"]),expanded:Xn().bool},gi=zn({attributeValue:mi},vi),_i=zn({attributeValue:hi},vi),Ai=Xn().shape({value:Xn().oneOfType([Xn().string,Xn().bool,Xn().number]),ov:Xn().bool,type:Xn().string,uri:Xn().string,lookupCode:Xn().string,lookupRawValue:Xn().string}),Ni=Xn().shape({totalOvValues:Xn().number,totalValues:Xn().number}),Pi=Xn().shape({inRelations:Xn().arrayOf(Xn().oneOfType([Xn().object,Xn().string])),outRelations:Xn().arrayOf(Xn().oneOfType([Xn().object,Xn().string])),groups:Xn().arrayOf(Xn().string),entityTypes:Xn().arrayOf(Xn().string),nextEntry:Xn().object}),Ri=Xn().oneOf(["asc","desc"]),Si=Xn().shape({id:Xn().string,content:Pi,allowOnlyCreateNew:Xn().bool,sortColumn:Xn().string,sortOrder:Ri,"text-empty":Xn().string,max:Xn().number,icon:Xn().string,caption:Xn().string,canCreate:ti,canRead:ti,canUpdate:ti,canDelete:ti,editingEnabled:Xn().bool}),wi=Xn().shape({entityUri:Xn().string,entityType:Xn().string,entityLabel:Xn().string,object:Ti}),Ii=Xn().shape({relationUri:Xn().string,relationType:Xn().string,relationLabel:Xn().string,direction:Xn().string,object:Ei}),Ui=Xn().shape({entity:wi,relation:Ii}),Ci=Xn().shape({value:Xn().string,isRawFilter:Xn().bool}),Di=Xn().shape({id:Xn().string,label:Xn().string,name:Xn().string,availableEntityTypes:Xn().array}),Li=Xn().shape({id:Xn().string,allowMergeAll:Xn().bool,matchActions:Xn().object,availableTabs:Xn().arrayOf(Xn().oneOf(["findMatches","potentialMatches","notAMatch"]))}),ji=Xn().arrayOf(Xn().shape({uri:Xn().string,label:Xn().string})),ki=[{label:de().text("And"),value:"and"},{label:de().text("Or"),value:"or"},{label:de().text("And not"),value:"and not"},{label:de().text("Or not"),value:"or not"}];function Fi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Mi=(0,l.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),xi=(0,l.pipe)(Mi,(0,l.propOr)("","label")),$i=(0,l.curry)(((e,t)=>{const r=Mi(e,t);return[(0,l.path)(["startObject","objectTypeURI"],r),(0,l.path)(["endObject","objectTypeURI"],r)]})),Vi=(0,l.curry)(((e,t,r)=>{const[n,i]=$i(e,r);return fn(e,n,t)||fn(e,i,t)})),Gi=(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){Fi(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),Wi=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?jn.OUT:jn.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(jn.IN),i=r(jn.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},Bi=(0,l.pathOr)("",["directionalContext",0,"labelPattern"]),Yi=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?Yi(e,Mi(e,t.extendsTypeURI),r):void 0;var qi;!function(e){e.CREATE="CREATE",e.READ="READ",e.UPDATE="UPDATE",e.DELETE="DELETE",e.INITIATE_CHANGE_REQUEST="INITIATE_CHANGE_REQUEST",e.MERGE="MERGE",e.UNMERGE="UNMERGE"}(qi||(qi={}));const Hi=(0,l.curry)(((e,t)=>e.every((e=>Ji(e,t))))),Ji=(0,l.curry)(((e,t)=>{const r=Tr(t);return Qi(e,t)&&(e===qi.READ||!r)})),Qi=(e,t)=>!t||!t.access||t.access.includes(e),Ki=(0,l.curry)(((e,t,r)=>Ji(qi.READ,r)&&(ln(t)?Ji(qi.INITIATE_CHANGE_REQUEST,r):Ji(e,r)))),Xi=Ki(qi.CREATE),zi=Ki(qi.DELETE),Zi=Ki(qi.UPDATE),ea=Hi([qi.CREATE,qi.MERGE,qi.READ,qi.UPDATE]),ta=Hi([qi.UPDATE,qi.READ,qi.CREATE]),ra=Hi([qi.UPDATE,qi.READ]),na=Hi([qi.DELETE,qi.UPDATE,qi.READ]),ia=(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["*"])),aa=(e,t,r)=>(0,l.pipe)((0,l.map)(ia(e,t)),(0,l.filter)(l.identity))(r),oa=(e,t,r)=>{const n=aa(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&Ji(qi.MERGE,r)},sa=(0,l.curry)(((e,t,r,n)=>{const i=Mi(e,n),[a,o]=$i(e,n);return i&&Ji(qi.CREATE,i)&&fn(e,a,t.type)&&fn(e,o,r.type)})),la=(e,t,r,n,i)=>{const a=dn(e,n.type),o=aa(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(sa(e,n,i))||a.some(sa(e,i,n))}))},ua=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=dn(e,r.type),o=(0,l.propOr)({},"matchActions",t);return{canMerge:oa(o,i,a),canAddRelation:la(e,o,i,r,n),canMark:Ji(qi.UPDATE,a)&&Ji(qi.READ,a)}},ca=(e,t,r,n)=>(0,l.pipe)((0,l.map)((n=>ua(e,t,n.object,r,n.matchRules))),(0,l.reduce)((0,l.mergeWith)(l.and),{}))(n),pa=Er,da=(0,l.complement)(pa),ya=Ji(qi.READ),fa=e=>{let{attributeType:t,mode:r}=e;return da(t)&&Xi(r,t)&&!br(t)},Ta=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=Ge(r.uri),o=Zi(n),s=Xi(n);return(0,l.cond)([[pa,l.F],[(0,l.always)(a),l.T],[(0,l.always)(i),o],[l.T,(0,l.allPass)([o,s])]])(t)},Ea=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=Ge(r.uri),s=Zi(n),u=zi(n),c=ha(qi.UPDATE,n,a,r),p=ha(qi.DELETE,n,a,r);return(0,l.cond)([[pa,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)},ma=(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=>!Qi(e,n)||!ma(e,t,r[n.name],n)))))})),ha=(0,l.curry)(((e,t,r,n,i)=>ln(t)?ma(qi.INITIATE_CHANGE_REQUEST,r,n,i):ma(e,r,n,i))),ba=(0,l.both)((0,l.complement)(br),ya),Oa="SuperUser",va="allTenants",ga=[va,"allCustomers"],_a=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===Oa})).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===Oa){const e=r?ga.concat(r.map((e=>`allTenants.${e}`))):ga,n=r&&t[0]===va?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}))},Aa={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"},Na={[Aa.CAN_DELETE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["DELETE"]},[Aa.CAN_CREATE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["CREATE"]},[Aa.CAN_UPDATE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["UPDATE"]},[Aa.CAN_READ_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["READ"]},[Aa.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[Aa.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activities"],privileges:["EXECUTE"]},[Aa.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[Aa.CAN_READ_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ"]},[Aa.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[Aa.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[Aa.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[Aa.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[Aa.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[Aa.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[Aa.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[Aa.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[Aa.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[Aa.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[Aa.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[Aa.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[Aa.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[Aa.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[Aa.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[Aa.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[Aa.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[Aa.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[Aa.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[Aa.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[Aa.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[Aa.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[Aa.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[Aa.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[Aa.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]},[Aa.CAN_READ_DVF]:{serviceId:"DVF",resourcePath:["functionsManagement"],privileges:["READ"]}},Pa=(0,l.curry)(((e,t,r)=>_a({allowedPermissionsNames:e,permissionsNames:Aa,permissionsConfig:Na}).some((e=>e(t,{params:{tenant:r}}))))),Ra=Pa([Aa.CAN_EXPORT]),Sa=Pa([Aa.CAN_EXPORT_ACTIVITIES]),wa=Pa([Aa.CAN_IMPORT_ENTITIES_FROM_DT]),Ia=Pa([Aa.CAN_READ_ENTITIES_FROM_DT]),Ua=Pa([Aa.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),Ca=Pa([Aa.CAN_UPDATE_PROCESS_INSTANCE]),Da=Pa([Aa.CAN_VIEW_WORKFLOW_DEFINITION]),La=Pa([Aa.CAN_CONFIG_ENVIRONMENT_REGISTER]),ja=Pa([Aa.CAN_UPDATE_WORKFLOW_DATA_TASK]),ka=Pa([Aa.CAN_READ_WORKFLOW_DATA_TASK]),Fa=Pa([Aa.CAN_MANAGE_WORKFLOW_DEFINITION]),Ma=Pa([Aa.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),xa=Pa([Aa.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),$a=Pa([Aa.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),Va=Pa([Aa.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),Ga=Pa([Aa.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),Wa=Pa([Aa.CAN_EXECUTE_WORKFLOW_JOBS]),Ba=Pa([Aa.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),Ya=Pa([Aa.CAN_CREATE_CONFIG_JAR]),qa=Pa([Aa.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),Ha=Pa([Aa.CAN_VIEW_CONFIG_JAR]),Ja=Pa([Aa.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),Qa=Pa([Aa.CAN_VIEW_WORKFLOW_JOBS]),Ka=Pa([Aa.CAN_MAKE_BULK_UPDATE]),Xa=Pa([Aa.CAN_OPEN_DATA_LOADER_EXECUTE,Aa.CAN_OPEN_DATA_LOADER_READ]),za=Pa([Aa.CAN_BULK_DELETE_PROFILES]),Za=Pa([Aa.CAN_READ_MDM_DATA_ENTITIES]),eo=Pa([Aa.CAN_READ_DVF]),to=Pa([Aa.IS_FREEMIUM_ADMIN]),ro=(0,l.reject)(br),no=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),ro,(0,l.filter)(e))(t),io=(0,l.curry)(((e,t)=>no((t=>fa({attributeType:t,mode:e})),t))),ao=(0,l.curry)(((e,t)=>no((t=>fa({attributeType:t,mode:e})||ba(t)),t))),oo=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(ba)),so=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...so(e)])))),lo=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(ba),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...lo(e)])))),uo=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...uo(e)])))),co=(0,l.pipe)(dn,(0,l.converge)(l.concat,[lo,uo]));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){yo(e,t,r[t])}))}return e}function yo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fo=(0,l.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,fo(e)))},t))),To=e=>{var t;return po({},e,{matchGroups:(0,l.uniq)((e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[]))})},Eo=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),mo=(0,l.when)(Eo,(0,l.dissoc)("values")),ho=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return po({},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})})),bo=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},Oo=(0,Jr.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(so,t).concat((0,l.chain)(so,r)).some(bo)})),vo=e=>{let t=!1;const r=fo((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?po({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},go=e=>{const t=Oo(e),r=(0,l.map)((e=>fo((0,l.pipe)(mo,(0,l.when)((0,l.always)(e),ho))))(t)),n=(0,l.map)(To),i=(0,l.map)(vo);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},_o=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Ao=(0,l.prop)("relationshipTypeURIs"),No=(0,l.curry)(((e,t)=>{var r;return(null===(r=e.graphTypes)||void 0===r?void 0:r.filter(Po(e,t)))||[]})),Po=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return null==n?void 0:n.some(Vi(e,t))},Ro=(e,t)=>(0,l.pipe)(_o,(0,l.defaultTo)({}),Ao,(0,l.defaultTo)([]),(0,l.chain)($i(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(dn(e)))(e,t),So=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),wo=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),Io=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return wo((0,l.complement)(So))(e)},Uo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return wo(So)(e)},Co=(0,l.pipe)(dn,(0,l.propOr)([],"matchGroups")),Do=(e,t,r)=>(0,l.pipe)(Co,(0,l.find)((0,l.propEq)("uri",r)))(e,t),Lo=(0,l.curry)(((e,t,r)=>(0,l.pipe)(Do,(0,l.propOr)(r,"label"))(e,t,r))),jo=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(Co,(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]})),ko=e=>(0,l.partition)(So,e),Fo=(0,l.includes)(l.__,["and","or","not"]),Mo=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),xo=(0,l.includes)(l.__,["equals","notEquals","in"]),$o=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return Fo(t)?$o(r):Mo(t)?r.filter(Je):xo(t)?r.map((0,l.prop)("uri")).filter(Je):[]})),l.uniq),Vo=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)($o),l.uniq),Go=(0,l.pipe)(Co,Vo),Wo=(0,l.pipe)(jo,Vo),Bo=(e,t)=>{let{interactionTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},Yo=(0,l.pipe)(Bo,lo),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||fn(e,n,t)})(e,t))})(e,t)),Ho=e=>!!e.required,Jo=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]:[];const a=(0,l.cond)([[Je,dn(e)],[Qe,Mi(e)]])(t);return Qo(e,a,r,n,i)},Qo=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=e=>e.uri&&Je(e.uri)&&3===e.uri.split("/").length;return!t||t.hidden&&!a(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!Tr(e)&&n(e,i))).flatMap((t=>{const a=t.required?[t]:[];if(r){let o;if(t.type===zt.TYPE_REFERENCE){const a=rr(t),s=nr(t);o=Jo(e,a,r,n,[...i,t]).filter((e=>s.some(Ke(e.uri))))}else t.attributes&&(o=Qo(e,t,r,n,[...i,t]));o&&a.push(...o)}return a})):t.type===zt.TYPE_REFERENCE?Jo(e,rr(t),r,n,[...i,t]):[]},Ko=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),Ho]),e.attributes||[])},Xo=(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},zo=(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)?de().text(n):n};return r(null,t)})),Zo=["label","description","abbreviation","caption","toolTip"],es=e=>zo(Zo,e),ts=(0,l.mergeRight)({attributeTypes:[],categoryTypes:[],changeRequestTypes:[],entityTypes:[],graphTypes:[],groupTypes:[],interactionTypes:[],relationTypes:[],roles:[],sources:[],survivorshipStrategies:[]}),rs=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=ze(t);return r.find((e=>{let{uri:t}=e;return ze(t)===n}))})),ns=(0,l.curry)(((e,t)=>{const r=ze(t);return(0,l.pipe)(rs(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),is=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"})},as=(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}))},os=(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)})),ss=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=dn(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));function ls(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){us(e,t,r[t])}))}return e}function us(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cs=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 ps(i,e,t,r,n)},ps=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 Z.fromNull(e&&e.length?e:Cr(t,r)).map((e=>e.map((e=>{const r=cs(t,e,n,i);return r.length?ls({},e,{children:r}):e})))).orSome([]).filter((0,l.either)((0,l.complement)(Ar),(0,l.prop)("children"))).filter(ba).filter(n).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},ds=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return cs(e,t,r,["attributes","analyticsAttributes"])},ys=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return cs(e,t,r,["attributes"])},fs=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return cs(e,t,r,["analyticsAttributes"])},Ts=e=>e.children?e.children.flatMap(Ts):e,Es=e=>e.children?[e,...e.children.flatMap(Es)]:e,ms=(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)})),hs=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return ze(r)===e})))),bs=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),hs("LUD")),(0,l.defaultTo)(r))(t||[])},Os=(e,t)=>{let{survivorshipStrategies:r}=e;return hs(t,r)},vs=(0,l.allPass)([(0,l.complement)(l.isNil),Ji(qi.READ)]),gs=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),Ji(qi.READ)]),_s=(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)([Ji(qi.CREATE),Ji(qi.INITIATE_CHANGE_REQUEST)])]),As=(0,l.curryN)(2,(0,l.pipe)(dn,gs)),Ns=(0,l.curryN)(2,(0,l.pipe)(Mi,vs)),Ps=e=>{let{ov:t}=e;return!1!==t},Rs=(e,t)=>((e,t)=>Br(e.type)&&ae(t))(e,t)||((e,t)=>Yr(e.type)&&oe(t))(e,t),Ss=(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))),ws=Ss("refEntity"),Is=Ss("refRelation"),Us=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],Cs=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},Ds=(0,l.prop)("objectURI"),Ls=(0,l.prop)("objectURI"),js=(0,l.prop)("type"),ks=(0,l.pipe)(ws,(0,l.defaultTo)({}),Ds),Fs=(0,l.pipe)(Is,(0,l.defaultTo)({}),Ls),Ms=(0,l.pipe)(ws,(0,l.defaultTo)({}),js),xs=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type})));return(e||[]).concat(r)},$s=(0,l.evolve)({refEntity:re,refRelation:re}),Vs=(e,t,r,n)=>{const i=Ir(e,r),a=dn(e,t.type)||Mi(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)(at,Qe)(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},Gs=(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?Gs(a.value,o):a},Ws=(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 Gs(e[r],i)})),Bs=(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")]]),Ys=(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"])]]),qs=(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"])]]),Hs=(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)(Hs(e,i)))))(r)})),Js=(0,l.curry)(((e,t)=>(0,l.ifElse)((0,l.is)(Array),(0,l.map)(Js(e)),e)(t))),Qs=(0,l.curry)(((e,t,r,n)=>(0,l.pipe)(Hs(e,r),Js(t))(n))),Ks=Qs(null,Bs),Xs=Qs(Ps,Bs),zs=Qs(null,Ys),Zs=Qs(Ps,Ys),el=Qs(Ps,qs),tl=(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=Ws(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},rl=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(ks,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{}),nl=(e,t)=>{const r=st(t),n=(0,l.pipe)((0,l.split)("/"),(0,l.dropLast)(1),l.last)(t);return tl(e,r,n)},il=Object.values(Mn),al=(0,l.includes)(l.__,il),ol=e=>il.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,l.assoc)(n,e[n],t):t}),{});function sl(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){ll(e,t,r[t])}))}return e}function ll(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ul=(e,t)=>`${e}_${t}`,cl=[Jn.matches.name,Jn.matchRules.name],pl=(0,l.values)($n).map((e=>e.name)),dl=e=>(0,l.when)((0,l.always)(!e),(0,l.reject)((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,pl)))),yl=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,cl)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>ul(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),fl=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,l.pipe)(l.values,dl(r),yl(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(ul(`dtPotentialMatches.${t.name}`,"")))))(Jn)},Tl=(0,l.propEq)("uri",Jn.type.uri),El=e=>(0,l.values)(Hn).some((0,l.propEq)("uri",null==e?void 0:e.uri)),ml=(0,l.propEq)("uri",Yn.sourceSystems.uri),hl=Object.values(xn),bl=(0,l.includes)(l.__,hl),Ol=e=>{let{entity:t,attributeType:r,value:n}=e;return sl({},t,{[r.uri]:void 0===n?r.defaultValue:n})},vl=e=>{let{entity:t,attributeType:r}=e;return(0,l.dissoc)(r.uri,t)},gl=e=>{let{entity:t,attributeType:r,value:n}=e;return sl({},t,{[r.uri]:n})},_l=(0,l.propEq)("uri",xn.roles.uri),Al=(0,l.propEq)("uri",xn.tags.uri);function Nl(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){Pl(e,t,r[t])}))}return e}function Pl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Rl=e=>{let{parentUri:t,attributeType:r}=e;return Nl({uri:Ve(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"),kr)),(0,l.always)({value:Date.now()})],[l.T,(0,l.always)({value:t})]])(e)})(r))},Sl=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)(io(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=Rl({parentUri:r,attributeType:e}),s=Dr(n,e);s&&(a.value=Sl({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(!(0,l.isEmpty)(a.value)||Boolean(a.lookupCode)||Sr(e))&&(o[t]=[a])}return o},wl=e=>{let{entity:t,metadata:r,mode:n,attrTypeFilter:i}=e;return Jo(r,t.type,!0,i).reduce(((e,t)=>{const i=t.name,a=st(t.uri);return(a===e.type?[{parentUri:e.uri,attributes:e.attributes}]:(Vs(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=Cl({entity:e,attributeType:t,parentUri:o,index:0});if(Ar(t)){const e=Dr(r,t);i=Il({attributeType:t,subAttributes:e,metadata:r,mode:n},i)}return i}return e}),e)}),t)},Il=(0,l.curry)(((e,t)=>{let{attributeType:r,subAttributes:n,metadata:i,mode:a}=e;const o=Vs(i,t,r.uri)[0],s=Nl({},o,{value:Sl({attributeTypes:n,parentUri:o.uri,mode:a,metadata:i})});return Ll({entity:t,attributeType:r,uri:o.uri,value:s})})),Ul=(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?Nl({},e,{value:Ul({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return Nl({},s(t),Sl({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),Cl=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=Rl({parentUri:n,attributeType:r}),u=Bs(l);return(0,ve.ZP)(t,(e=>{Ae(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},Dl=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,ve.ZP)(t,(e=>{Ae(e.attributes||e.value,r,n.uri,Bs(n),a,o,i)}))},Ll=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,ve.ZP)(t,(e=>{Ne(e.attributes||e.value,r,n,i,a,o)}))},jl=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,ve.ZP)(t,(e=>{Re(e.attributes||e.value,r,n,i)}))},kl=e=>""===e,Fl=(0,l.cond)([[(0,l.propSatisfies)((0,l.complement)((0,l.anyPass)([kl,l.isNil])),"lookupCode"),l.F],[(0,l.propSatisfies)((0,l.anyPass)([kl,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]]),Ml=(0,l.reject)(Fl),xl=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=>xl({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),Ml)),(0,l.when)((0,l.always)(t),(0,l.reject)(l.isEmpty)))},$l=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return xl({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),$s),deleteEmptyComplex:e})},Vl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)($l(e),(0,l.reject)(l.isEmpty))},Gl=(0,l.curry)(((e,t)=>t.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:i}=t;return al(r)?Ol({entity:e,attributeType:r}):Cl({entity:e,attributeType:r,parentUri:n,index:i})}),e))),Wl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n,value:i}=t;return al(r)?gl({entity:e,attributeType:r,value:i}):Ll({entity:e,attributeType:r,uri:n,value:i})})),Bl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n}=t;return al(r)?vl({entity:e,attributeType:r}):jl({entity:e,attributeType:r,uri:n})})),Yl=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)},ql="UrlThumbnail",Hl="CdnUrlThumbnail",Jl=(0,l.curry)(((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(Ps):(0,l.head)(n);return e&&e.value}return null})),Ql=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>Jl(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),Kl=Ql(["CdnUrl","Url"],!0),Xl=Ql(["CdnUrlPreview","UrlPreview"],!0),zl=Ql([Hl,ql],!0),Zl=Ql([Hl,ql]),eu=(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)(al(a)),(e=>null===e)),(0,l.always)([""])),(0,l.defaultTo)([]),ne)(o);return(0,l.when)((0,l.always)(r(u,a)),(0,l.append)({attrType:a,values:u}),e)}),[])},tu=(e,t,r)=>{const n=oo(e),i=(0,l.any)(r?l.T:Ps);return eu(n,t,i)},ru=(e,t,r,n,i,a)=>{const o=Ge(null==r?void 0:r.uri)?io(t,e):ao(t,e);return eu(o,r,((e,o)=>{const s=fa({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:Ps,e)||mr(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let nu;const iu=e=>{nu=e};function au(e,t){return nu(e,t)}const ou=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)})),su=50,lu=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=su,offset:a=0}=e;return au("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i,offset:a}),headers:{"Content-Type":"application/json"}})},uu=(0,l.once)((()=>au("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),cu=e=>au("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),pu=(e,t)=>au("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),du=e=>Z.fromNull(gn[e]).map(de().text).orSome(""),yu=(0,l.curry)(((e,t)=>`${e}_${t}`)),fu=(0,l.split)("_"),Tu=(0,l.includes)("_"),Eu=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),mu=(0,l.curry)(((e,t)=>e.some(Eu(t)))),hu=mu([On.IN_RANGE,On.COUNT_RANGE,On.WITHIN]),bu=mu([On.EXISTS,On.MISSING_VALUE]),Ou=(0,l.cond)([[bu,(0,l.always)(0)],[hu,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),vu=(0,l.complement)(bu),gu=mu([On.HAS_ALL,On.EQUALS,On.NOT_EQUALS]),_u=mu([On.COUNT_EQUALS,On.COUNT_NOT_EQUALS,On.COUNT_LT,On.COUNT_LTE,On.COUNT_GT,On.COUNT_GTE,On.COUNT_RANGE]),Au=mu([On.IN_FILE,On.NOT_IN_FILE]),Nu=e=>{switch(e){case On.COUNT_EQUALS:return On.EQUALS;case On.COUNT_NOT_EQUALS:return On.NOT_EQUALS;case On.COUNT_LT:return On.LT;case On.COUNT_LTE:return On.LTE;case On.COUNT_GT:return On.GT;case On.COUNT_GTE:return On.GTE;case On.COUNT_RANGE:return On.IN_RANGE}},Pu=mu([On.ON,On.BEFORE,On.AFTER,On.WITHIN,On.NOT_EQUALS]),Ru=mu([On.WITHIN]),Su=[[On.COUNT_EQUALS,On.COUNT_NOT_EQUALS,On.COUNT_LT,On.COUNT_LTE,On.COUNT_GT,On.COUNT_GTE],[On.NOT_IN_FILE,On.IN_FILE],[On.EQUALS,On.NOT_EQUALS,On.HAS_ALL],[On.LT,On.LTE,On.GT,On.GTE],[On.MISSING_VALUE,On.EXISTS],[On.COUNT_RANGE],[On.IN_RANGE],[On.STARTS_WITH,On.CONTAINS],[On.FULL_TEXT],[On.ON,On.BEFORE,On.AFTER,On.NOT_EQUALS],[On.WITHIN]],wu=(e,t)=>Su.some((r=>r.includes(e)&&r.includes(t))),Iu=(0,l.pipe)(l.omit,l.values),Uu={OPTIONS_FOR_STRING:Iu(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],On),OPTIONS_FOR_DATE:[On.ON,On.BEFORE,On.AFTER,On.WITHIN,On.NOT_EQUALS,On.MISSING_VALUE,On.EXISTS,On.COUNT_EQUALS,On.COUNT_NOT_EQUALS,On.COUNT_LT,On.COUNT_LTE,On.COUNT_GT,On.COUNT_GTE,On.COUNT_RANGE,On.IN_FILE,On.NOT_IN_FILE],OPTIONS_FOR_BOOLEAN:Iu(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],On),OPTIONS_FOR_BLOB:Iu(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],On),OPTIONS_FOR_NUMBER:Iu(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],On),OPTIONS_FOR_LOOKUP:Iu(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],On),OPTIONS_FOR_ENUM:Iu(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],On),OPTIONS_FOR_ID:[On.EQUALS,On.NOT_EQUALS,On.IN_FILE,On.NOT_IN_FILE],OPTIONS_FOR_COUNT:[On.EQUALS,On.NOT_EQUALS,On.LT,On.LTE,On.GT,On.GTE,On.IN_RANGE],OPTIONS_FOR_COMPLEX:[On.COUNT_EQUALS,On.COUNT_NOT_EQUALS,On.COUNT_LT,On.COUNT_LTE,On.COUNT_GT,On.COUNT_GTE,On.COUNT_RANGE,On.EXISTS,On.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[On.EQUALS,On.NOT_EQUALS,On.EXISTS,On.MISSING_VALUE]},Cu=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 Uu.OPTIONS_FOR_STRING;case zt.TYPE_LOOKUP:case zt.TYPE_DEPENDENT_LOOKUP:return Uu.OPTIONS_FOR_LOOKUP;case zt.TYPE_ENUM:return Uu.OPTIONS_FOR_ENUM;case zt.TYPE_DATE:case zt.TYPE_ACTIVENESS_DATE:case zt.TYPE_TIMESTAMP:case zt.TYPE_LOCAL_DATE:return Uu.OPTIONS_FOR_DATE;case zt.TYPE_BOOLEAN:case zt.TYPE_BOOLEAN_RADIO:return Uu.OPTIONS_FOR_BOOLEAN;case zt.TYPE_BLOB:return Uu.OPTIONS_FOR_BLOB;case zt.TYPE_LONG:case zt.TYPE_INT:case zt.TYPE_FLOAT:case zt.TYPE_DOUBLE:case zt.TYPE_NUMBER:return Uu.OPTIONS_FOR_NUMBER;case zt.TYPE_ENTITY_ID:return Uu.OPTIONS_FOR_ID;case zt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[On.EQUALS];case zt.TYPE_COUNT:return Uu.OPTIONS_FOR_COUNT;case zt.TYPE_NESTED:case zt.TYPE_REFERENCE:case zt.TYPE_IMAGE:return Uu.OPTIONS_FOR_COMPLEX;default:return Uu.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(_u,n):n},Du=e=>[gt.and,gt.andNot].includes(e),Lu=e=>[gt.or,gt.orNot].includes(e),ju=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),Lu)),ku=(Fu=[gt.and],e=>e.slice(0,-1).every((e=>Fu.includes(e.operator))));var Fu;const Mu=e=>e.map(((e,t,r)=>{const n=0===t;return(0,l.assoc)("operator",n?null:r[t-1].operator,e)}),[]),xu=e=>e.map(((e,t,r)=>{const n=t===r.length-1;return(0,l.assoc)("operator",n?null:r[t+1].operator,e)}),[]),$u=e=>`(${e})`,Vu=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},Gu=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)&&Vu(e.slice(1,-1));return!i&&!a||o?e:$u(e)},Wu="and",Bu=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)(Wu,n,e),o=(e=>[gt.andNot,gt.orNot].includes(e))(a)?Gu(r):r;return i?o:`${t} ${a} ${o}`}),"")}},Yu=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),qu=e=>Array.isArray(e)?e.map(qu).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),Hu=(0,l.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),Ju=e=>`'${e}'`,Qu=e=>`"${e}"`,Ku=e=>(0,l.pipe)((0,l.map)(e),(0,l.join)(" or ")),Xu=(0,l.pipe)(qu,Hu),zu=(0,l.pipe)(Xu,Ju),Zu=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.allPass)([(0,l.always)(hu(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[l.T,l.identity]])(t))),ec=(e,t)=>_u(t)?{type:zt.TYPE_INT}:Au(t)?{type:zt.TYPE_FILE}:Pu(t)&&!Ru(t)&&Fr(e.type)?{type:zt.TYPE_LOCAL_DATE}:e,tc=Object.values(wn),rc=e=>!Object.values(wn).includes(e),nc=e=>tc.includes(e),ic=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:In;return de().text(t[e])},ac=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.values(Rn),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:In;return e.map((e=>({value:e,get label(){return ic(e,t)}})))},oc=e=>{const t=f()().startOf("minute");switch(e){case Rn.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case Rn.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case Rn.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case Rn.LAST_6MONTHS:return[f()(t).subtract(6,"months").valueOf(),t.valueOf()];case Rn.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()];case Sn.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()];default:return e}},sc=e=>{let[t,r]=e;return[f()(t).valueOf(),f()(r).endOf("date").valueOf()]},lc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:oc;return(0,l.is)(String,e)?t(e):sc(e)};let uc;!function(e){e.CurrentUser="currentUser"}(uc||(uc={}));const cc={},pc=(e,t)=>{cc[e]=t},dc=e=>cc[e];function yc(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){fc(e,t,r[t])}))}return e}function fc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Tc=e=>e.split("{CurrentUser}").join(dc(uc.CurrentUser)||""),Ec=(0,l.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),mc=(0,l.curry)(((e,t,r)=>{const n=r.map(hu(e)||t.endsWith(".count")?Xu:zu).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),hc=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},bc=e=>{let{filter:t,fieldName:r,values:n}=e;const i=Ou(t);return(0,l.pipe)(hc(i),(0,l.map)(mc(t,r)),Ec(" or "))(n)},Oc=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(zu).join(",")})`},vc=e=>`*${e}*`,gc=e=>`URL:${e}`,_c=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,Ac=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===On.IN_FILE?r:`not ${r}`},Nc=(e,t)=>[R(e,t),S(e,t)],Pc=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!Rc(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case On.ON:return yc({},e,n?{filter:On.EQUALS}:{filter:On.IN_RANGE,values:[Nc(i,n)]});case On.BEFORE:return yc({},e,{filter:On.LTE,values:[[S(i,n)]]});case On.AFTER:return yc({},e,{filter:On.GTE,values:[[R(i,n)]]});case On.WITHIN:return yc({},e,{filter:On.IN_RANGE,values:[oc(i)]})}}return e}),bc),Rc=(0,l.propSatisfies)(Fr,"type"),Sc=[[(0,l.prop)("rawFilter"),(0,l.pipe)((0,l.prop)("rawFilter"),Tc)],[(0,l.propEq)("filter",On.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(bc({filter:On.EQUALS,fieldName:t,values:[r]}))),new Bu).build())),Ec(" or "))(r)}),Tc)],[(0,l.propEq)("filter",On.CONTAINS),(0,l.pipe)((e=>{let{filter:t,fieldName:r,values:n}=e;return bc({fieldName:r,filter:t,values:n.map((0,l.pipe)(qu,vc))})}),Tc)],[(0,l.propEq)("filter",On.EQUALS),(0,l.pipe)((e=>{const{fieldName:t,values:r}=e;return"type"===t?bc(yc({},e,{values:(0,l.flatten)(r)})):_c(r)?Oc(yc({},e,{filter:"listEquals"})):bc(e)}),Tc)],[(0,l.propEq)("filter",On.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=Ou(t);return(0,l.pipe)(hc(i),(0,l.map)(mc(t,r)),Ec(" and "))(n)})(yc({},e,{values:(0,l.flatten)(e.values)})):Rc(e)?(e=>{const{values:t}=e,r=!Rc(e),[n]=t;return(new Bu).addClause(bc(yc({},e,{filter:On.LT,values:[R(n,r)]}))).addClause(bc(yc({},e,{filter:On.GT,values:[S(n,r)]}))).orBuild()})(e):_c(t)?Oc(yc({},e,{filter:"not listEquals"})):bc(e)}),Tc)],[(0,l.propSatisfies)(Au,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return bc({fieldName:r,filter:Ac(t,r),values:n.map((0,l.prop)("link")).map(gc)})}],[(0,l.propSatisfies)(_u,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return bc({fieldName:`${r}.count`,values:n,filter:Nu(t)})}],[(0,l.propSatisfies)(Pu,"filter"),Pc],[(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 mc(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return mc(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,(0,l.pipe)(bc,Tc)]],wc=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!vu(e)||Uc(e,r))},Ic=(e,t)=>Array.isArray(t)?Uc(e,t):e===On.WITHIN?nc(t)||Number.isInteger(t):!(0,l.isNil)(t)&&qu(t).length>0,Uc=(e,t)=>t&&t.length>0&&t.every((t=>Ic(e,t)));function Cc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Dc=e=>{let{fieldName:t=""}=e;const r=t.split("."),n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},Lc=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),jc=(e,t,r)=>"children"===e?Fc(r,[...t][0],!0):r,kc=(e,t,r)=>"values"===e?[...r,...t]:r,Fc=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)(jc,t),e);if(!r&&gu(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(kc,t),e)}return(0,l.append)(t,e)},Mc=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=Dc(e),r=e=>e.fieldName===t?e:r({fieldName:Lc(e),children:[e]});return r(e)})(t);return Fc(e,r)}),[]),xc=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")),$c=e=>{let[t]=e;return t.children?$c(t.children):t.operator},Vc=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=$c(t)===gt.andNot,a=n(t,!1),o=i?`not ${Gu(a)}`:a,s=n(r,!1);return`inSameAttributeValue(${o} ${$c(r)||Wu} ${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&&xc(i)&&!t?r(i):n(i,a)}],...e])(o))),new Bu).buildWithOperators(i.map((0,l.prop)("operator")))}return n},Gc=(0,l.pipe)((0,l.propOr)("","filter"),Tu),Wc=(0,l.map)((0,l.when)(Gc,(e=>{const[t,r]=fu(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){Cc(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),Bc=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)(wc),Wc,Mc,Vc([...e,...Sc],t))},Yc=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),qc=[On.ON,On.BEFORE,On.AFTER,On.WITHIN,On.NOT_EQUALS,On.MISSING_VALUE,On.EXISTS],Hc=[On.EQUALS,On.NOT_EQUALS,On.STARTS_WITH,On.MISSING_VALUE,On.HAS_ALL,On.FULL_TEXT,On.EXISTS],Jc=[On.EQUALS,On.NOT_EQUALS,On.LT,On.LTE,On.GT,On.GTE,On.IN_RANGE],Qc=(e,t)=>{const r=fr(e);return(e=>{switch(e){case Mn.startDate.name:case Mn.endDate.name:case $n.dueDate.name:case Wn.createdTime.name:case Wn.updatedTime.name:case Yn.reltioLoadDate.name:case Yn.createDate.name:case Yn.updateDate.name:case Yn.deleteDate.name:case Yn.publishDate.name:return qc;case Bn.matches.name:case Yn.count.name:return Jc;case $n.workflow.name:case $n.assignee.name:case $n.step.name:case Vn.commenter.name:case Wn.createdBy.name:case Wn.updatedBy.name:case Yn.sourceSystems.name:case Yn.value.name:return Hc;default:return null}})(t)||Cu(r)},Kc=[On.EQUALS,On.NOT_EQUALS,On.CONTAINS,On.STARTS_WITH,On.MISSING_VALUE,On.HAS_ALL,On.IN_RANGE,On.WITHIN,On.EXISTS,On.ON],Xc=(0,l.pipe)(Qc,(0,l.filter)((0,l.includes)(l.__,Kc))),zc=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(Ps);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}}),""),Zc=(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},ep=/[,\s]*$/,tp=e=>{const t=de().text(Dn);if(!e)return t;const r=e.replace(ep,"");return""===r.toString().trim()?t:r},rp=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},np=(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=rp(e,r.referencedEntityTypeURI);if(n)return Zc({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return Zc({attributes:t||{}},r.dataLabelPattern);return""},ip=e=>{let{uiPath:t,uri:r}=e;return`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},ap=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)}`},op=e=>{let{uiPath:t,tag:r,entityUri:n}=e;return`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},sp=(0,l.curry)(((e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"")),lp=(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"))),up=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),lp),cp=(e,t,r)=>{const n=up(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)(Ws(e),lp)))(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")])})(dn(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>Vs(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,lp))(r)})(e,r)||hn(e,r.type);return sp(t,n)};function pp(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){dp(e,t,r[t])}))}return e}function dp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yp="DTSS/",fp=(0,l.replace)(new RegExp("^entities/"),""),Tp=e=>yp+e.dataTenant+"/"+e.uri,Ep=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),mp=e=>!(!e||!e.dataTenant),hp=(0,l.startsWith)(yp),bp=(0,l.pipe)((0,l.ifElse)(hp,(0,l.pipe)((0,l.split)("/"),(0,l.nth)(1)),(0,l.always)(null))),Op=(0,l.ifElse)(mp,Tp,(0,l.prop)("uri")),vp=e=>e&&e.uri?e.dataTenant?Tp(e):fp(e.uri):"",gp=(0,l.curry)(((e,t,r)=>(dn(t,r.type)||{})[e]||"")),_p=gp("label"),Ap=gp("typeGraphIcon"),Np=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=dn(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(Ps)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:np(e,o,i),uri:a.uri}})).filter(l.identity):[]},Pp=(0,l.pipe)(Np,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),Rp=(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=Rp(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):Rp(e.slice(1),r)}})),Sp=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,wp=e=>(0,l.propOr)([],"matchRules",e),Ip=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?pp({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},Up=(e,t,r)=>t&&r?r.aEntity:e,Cp=(0,l.evolve)({attributes:Vl(!0)}),Dp=(0,l.pipe)(Cp,(0,l.props)(["attributes","startDate","endDate","roles","tags"]),(0,l.all)(E)),Lp=e=>(0,l.assoc)("dataTenant",e),jp=()=>{const e={newUriMap:{}};return{getUri:t=>(0,l.pathOr)(t,["newUriMap",t],e),addUriFromCreateRequest:t=>r=>{var n;return null!=r&&null!==(n=r[0])&&void 0!==n&&n.successful&&((t,r)=>{e.newUriMap=(0,l.assoc)(t,r,e.newUriMap)})(t,r[0].object.uri),r},hasNewUri:()=>!(0,l.isEmpty)(e.newUriMap)}};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=async e=>{const t=[];for(const r of e){let e;try{e=await r()}catch(e){throw{errorMessage:e.toString()}}t.push(e);const n=Array.isArray(e)&&e.find((0,l.has)("errors"));if(n)throw n.errors}return t.flat()},Qp=e=>{let{type:t,parameters:r,dcrProcessor:n,relationUriProcessor:i}=e;const{enhanceUriWithDCR:a,updateDCRUriFromResponse:o}=n,s=e=>(o(e),e);switch(t){case Lt.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:o,attributes:l,startDate:u,endDate:c}=t;return Jf({startEntityUri:e,endEntityUri:n,relationType:o,attributes:l,startDate:u,endDate:c,uriPreprocessor:a}).then(s).then(i.addUriFromCreateRequest(t.uri))};case Lt.DELETE_RELATION:return()=>{const{relationUri:e}=r;return Hf(e,a).then(s)};case Lt.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return zf(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(s)};case Lt.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return Qf({oldRelation:e,newRelation:t,uriPreprocessor:a}).then(s)};case Lt.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:a,isReversed:o}=r,{uri:s}=a,u=[xp({relationUri:s}),Mp({parentUri:o?e:t,relation:a,entityUri:o?t:e})];return(0,l.pipe)((0,l.map)(Xp(n,i)),(0,l.map)(Qp),Jp)(u)}}},Kp=e=>t=>()=>e().then(t),Xp=(e,t)=>r=>kp({dcrProcessor:e,relationUriProcessor:t},r),zp=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=tn({alwaysCreateDCR:e,dcrUri:t}),n=jp();return{commandExecutor:e=>(0,l.pipe)(l.flatten,(0,l.map)(Xp(r,n)),(0,l.map)(Qp),(0,l.map)(Kp(r.getDcrUriAwait)),Jp)(e),dcrProcessor:r,relationUriProcessor:n}},Zp=e=>t=>(0,l.map)((t=>kp({},t,{parameters:(0,l.evolve)({parentUri:ih(e),entityUri:ih(e),newEntityUri:ih(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()),ih(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=ih(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)(Mi,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(il),ro)(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=(n,i)=>{var a;let o=gd(i),s=!1;o.startsWith("!")&&(o=o.slice(1),s=!0);const u=e[o]&&Ji(qi.READ,e[o]),c=n.find(_d(o))||!u?n:n.concat(vd(i)?bd({},i,{uri:o}):null!==(a=t.find(_d(o)))&&void 0!==a?a:o);return s?c:(0,l.keys)(e).reduce(((t,n)=>e[n].extendsTypeURI!==o||t.find(_d(n))?t:r(t,n)),c)};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=Zc(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:Be()},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:jn.IN}:{type:t[0],direction:jn.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&&Xi(i,t)&&Zi(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===jn.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"],dn(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],dn(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(Qd,Mi(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(jn.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(jn.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}=Wi({reversedContextLabels:!0}),a=(0,l.curry)(((e,t,r,n)=>{const[i,a]=$i(e,n.uri);return n&&(!t||fn(e,i,t))&&(!r||fn(e,a,r))})),o=t=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],dn(e,t.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],dn(e,t.endObject.objectTypeURI)))(t),s=(e.relationTypes||[]).filter((0,l.both)(vs,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=fn(n,l.__,t.type),o=e?Wd:Gd,s=fn(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(fn(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)=>Ke(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"),Ke(t.attributeTypeUri)),l.T],[(0,l.both)((0,l.propEq)("type",zt.TYPE_REFERENCE),(0,l.pipe)(nr,(0,l.any)(Ke(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?Th(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 Zc(o,e.dataLabelPattern);if(gr(a)){const t=o,i=ks(t),a=tr(e),s=dn(n,a);return Ge(i)?Zc(r[i],s.dataLabelPattern):t.label}return""}case mt.tempEntity:return Zc(o,a.dataLabelPattern);case mt.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=dn(n,null==e?void 0:e.entityType);return`${tp(i&&Ge(i)?Zc(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||xi(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:tp(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!!ws(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=Jo(e,t.type||t.relationType,!0,r);return n.reduce(((r,n)=>{const i=Vs(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!Ps(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:de().text("Attribute is required"),source:yt.local}))})),r}),[])},Ny=(0,l.curry)(((e,t,r)=>Vs(e,t,r,!1))),Py=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),dn(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)(ks),(0,l.map)((e=>{let{uri:r}=e;return ty({type:dt.missedRefEntity,uri:"",attributeTypeUri:rt(r,t.type),parentUri:r,message:de().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)(ks,Ge)).flatMap((n=>{const i=ks(n),a=t[i],o=Ur(e,rt(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(Ke(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)=>({attributes:{[e.name]:[t]},type:nt(e.uri),uri:nt(t.uri)}),Uy=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=Iy(t,r),a=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=(r[0]||e).uri;return t.uri===n};return wy(e,n,i,a)},Cy=(e,t)=>{const r=(0,l.path)(Ld(),t)||{};return Ay(e,r)},Dy=(e,t,r)=>{t=t||{};const n=(0,l.pipe)((0,l.path)(Fd()),(0,l.ifElse)(Ge,(e=>t[e]),(0,l.always)(null)))(r),i=Cy(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:de().text("Entity is required"),source:yt.local})])(r),o=((e,t,r)=>r?wy(e,t,r):[])(e,t,n);return[...i,...a,...o]},Ly=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:de().text("Entity is required"),source:yt.local})],jy=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=Ay(e,r),i=Ly(t);return[...n,...i]};function ky(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Fy=(e,t)=>{var r,n;const i=dn(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||Oo(e)},My=e=>(0,l.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),xy=e=>{const t=r=>(0,l.ifElse)(Array.isArray,(0,l.map)(t),(0,l.pipe)(My(e),(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(0,l.map)(t))})))(r);return t},$y=(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)(Fs,Ge,l.not)]),(e=>{const t=(0,l.pipe)(Fs,ze)(e);return xy((e=>e.replace(t,t+Le)))(e)})),(0,l.when)((0,l.pipe)(ks,Ge),(t=>{const r=ks(t),n=e[r],i=n&&Gy(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){ky(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),Vy=(e,t,r,n)=>qh(Wh((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),Qh((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e,n).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)($y(r,e.type)),(0,l.map)(xy(lt))))})(e))).concat(th(e,t)),Gy=(e,t)=>(0,l.evolve)({attributes:xl({valueTransformer:(0,l.pipe)($s,$y(t),My(lt)),deleteEmptyComplex:!0}),uri:lt})(e);function Wy(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){By(e,t,r[t])}))}return e}function By(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Yy=(0,l.unless)(l.isNil,(e=>e.replace(new RegExp(De,"g"),"uri$$$$").replace(new RegExp(Le,"g"),""))),qy=e=>(0,l.pipe)((0,l.evolve)({objectUri:Yy,objectParentUri:Yy}),(e=>{return Wy({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?dt.missed:dt.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&&st(e.objectUri),uri:e.objectUri,source:yt.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),Hy=(e,t)=>(0,l.map)((0,l.pipe)(qy,(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 Wy({},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&&ot(i)){const n=(0,l.last)(a),i=n.valueType;if(gr(i)&&or(i).includes(o)){const i=ks(n.value),o=i&&Ge(i)?t[i]:null;return o?Wy({},e,{parentUri:o.uri,path:a.concat({type:mt.tempEntity,value:o,valueType:dn(r,o.type),label:""})}):e}}return e}})(t)))(e),Jy=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}},Qy=e=>`equals(user, '${Hu(e)}')`,Ky=e=>`equals(items.delta.sources, '${e.abbreviation}')`,Xy=e=>`equals(items.objectType, '${e.uri}')`,zy=e=>{const{period:t,type:r}=e;if(!Jy(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 "),ef=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),tf=e=>{let{query:t,body:r}=e;return t=ef(t),au(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},rf=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)(Bc(),Yc(t.globalFilter))(n),activeness:t.activityFilter||Cn.ACTIVE_ONLY};return t.searchOptions&&(i.options=t.searchOptions),`/entities/_total${zr(i)}`},nf=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=rf(e,t,r);return au(n)},af=e=>au(`/entities/_total?${e}`),of=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(0,l.pipe)((0,l.filter)(gs),(0,l.map)((0,l.prop)("uri")))(e),i={filter:On.EQUALS,fieldName:"type",values:n},a=r.isRawFilter?{rawFilter:t}:{filter:"containsWordStartingWith",fieldName:"attributes",values:[t]},o=(0,l.pipe)(Bc(),Yc(r.globalFilter))([i,a]),s=zr({filter:o,select:"uri,label,type,roles,secondaryLabel,defaultProfilePicValue",scoreEnabled:!0,activeness:r.activityFilter||Cn.ACTIVE_ONLY,max:r.max||4,options:r.searchByOv?"searchByOv":""});return au("/entities/_typeAheadSearch"+s,{method:"GET"})},sf=(0,l.pipe)((0,l.reject)(l.isNil),Xr),lf=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)(Bc(),Yc(i))(r),p=sf({filter:c||null,activeness:a||"active",options:o||null}),d=[{fieldName:t,pageSize:s||20,pageNo:u||1,orderType:n.orderType||"reversedCount"}];return tf({query:p,body:d})},uf=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return lf({fieldName:t,searchParams:i,options:n})};function cf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pf="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",df=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)(Bc(),Yc(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||pf,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null};return t.searchOptions&&(i.options=t.searchOptions),`/entities${zr(i)}`},yf=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=df(e,t,r);return au(n)},ff=e=>Of(e,{select:"secondaryLabel"}),Tf=(e,t)=>{const{select:r=pf,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),au("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},Ef=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),Ge)),mf=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=Ef(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)(Bc(),Yc(d.globalFilter))(h);return b&&(m.filter=b),p&&(m.sort=p.field,m.order=p.order),au(`${s}/api/${o}/${t}/_object`,{method:"POST",body:JSON.stringify(m)})},hf=e=>`entities?filter=equals(uri,'${e}')&offset=0`,bf={options:"sendHidden,addRefAttrUriToCrosswalk"},Of=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bf;return au(`/${e}${zr(t)}`)},vf=(e,t)=>Of(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){cf(e,t,r[t])}))}return e}({},bf,{explicitSurvivorshipGroup:t})),gf=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 au(n,r)},_f=e=>au(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),Af=(e,t,r)=>{const n={method:"POST",body:JSON.stringify(t)};return au(`/${e}/_clone${zr({executeLCA:!1,valuesToCopy:r})}`,n)},Nf=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return au(`/entities/_events/_total${Xr({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Pf=(e,t)=>au(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",body:t}),Rf=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return au(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",body:JSON.stringify(r)})},Sf=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 au(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),Xr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},wf=e=>{const t=new FormData;return t.append("file",e),au("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=fe(e,de().text("Can't upload file"));return Promise.reject(t)}))},If=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 au(`/personal/findSavedSearches${Xr({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"}})},Uf=e=>au(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),Cf=e=>au("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Df=e=>{const{uri:t}=e,r=(0,l.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return au(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},Lf=e=>{let{uri:t}=e;return au(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},jf=(e,t)=>(0,l.pipe)((0,l.evolve)({isPublic:(0,l.always)(t)}),Df)(e),kf=(e,t)=>(0,l.pipe)((0,l.evolve)({isFavorite:(0,l.always)(t)}),Df)(e);function Ff(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Mf=["max","offset","filter"],xf=(0,l.curry)(((e,t)=>t.nextEntry?(0,l.evolve)({nextEntry:xf(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){Ff(e,t,r[t])}))}return e}({},t,(0,l.pick)(Mf,e)))),$f=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},Vf=(0,l.omit)(["activeness"]),Gf=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=$f(t),{searchByOv:i}=r;t=(0,l.map)((0,l.pipe)((0,l.when)((0,l.prop)("nextEntry"),(e=>(0,l.pipe)(xf(e),(0,l.omit)(Mf))(e))),Vf,(0,l.omit)(["labels"])))(t);const a={limitCreditsConsumption:!0,activeness_enabled:n,options:i?"searchByOv":void 0},o=`/${e}/_connections${zr(a)}`,s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)};return{url:o,options:s}},Wf=(0,l.map)((e=>{let t=e;for(;t&&t.nextEntry;)t=t.nextEntry;return t})),Bf=(0,l.reject)(l.isNil),Yf=(0,l.unless)((0,l.startsWith)("/"),(0,l.concat)("/")),qf=e=>au(Yf(e),{method:"GET",headers:{"Content-Type":"application/json"}}),Hf=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r=(0,l.pipe)(t,Yf);return au(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},Jf=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?Vl()(i):null,startDate:a,endDate:o},c=(0,l.pipe)(Bf,ne,JSON.stringify);return au(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(u)})},Qf=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"),Yf,n),o=Wh(i(t),i(r),!1).concat(Yh(t,r));return au(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},Kf=(e,t,r)=>{const{url:n,options:i}=Gf(e,t,r);return au(n,i).then(Wf)},Xf=(e,t)=>au(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),zf=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===jn.IN?a.inRelations=[n]:a.outRelations=[n],au(`/${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 au(`${t}/recentSearches${zr({environment:r,tenant:n})}`,{method:"GET",application:i,headers:{"Content-Type":"application/json"}})},eT=e=>au("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),tT=e=>{let{environment:t,tenant:r,createdDate:n}=e;return au(`/recentSearches${zr({environment:t,tenant:r,createdDate:n})}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};function rT(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){nT(e,t,r[t])}))}return e}function nT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const iT={select:"label,secondaryLabel,name,type,startDate,endDate"},aT=(0,l.reject)(l.isNil),oT=(0,l.pipe)(aT,Xr),sT=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i,signal:a}=e;const o=rT({},iT,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{},{limitCreditsConsumption:!0});return au(`/${t}/_tree${oT(o)}`,{method:"GET",headers:{"Content-Type":"application/json"},signal:a})},lT=e=>{let{uri:t,graphUri:r}=e;const n=rT({},iT,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return au(`/${t}/_parents${oT(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},uT=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1,limitCreditsConsumption:o,max:s,signal:l}=e;const u=rT({},iT,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},o?{limitCreditsConsumption:o}:{},s?{max:s}:{},{filterLastLevel:i,deep:a});return au(`/${t}/_hops${oT(u)}`,{method:"GET",headers:{"Content-Type":"application/json"},signal:l})};function cT(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 pT=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},dT="/activities",yT=e=>{let{label:t,description:r}=e;return au(dT,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:pT()}})};var fT;!function(e){e.userSearch="USER_SEARCH",e.profileView="USER_PROFILE_VIEW"}(fT||(fT={}));const TT=e=>{const t=zr(e);return au(dT+t,{method:"GET"})},ET=e=>au(`/activities/_total${zr(e)}`,{method:"GET"}),mT=e=>{const{entityUri:t}=e,r=cT(e,["entityUri"]);return au(`/${t}/_activities${zr(r)}`,{method:"GET"})},hT=e=>{const{entityUri:t}=e,r=cT(e,["entityUri"]);return au(`/${t}/_activities/_total${zr(r)}`,{method:"GET"})};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){OT(e,t,r[t])}))}return e}function OT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vT=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},gT=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return au(vT({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},_T=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=vT({url:r,workflowPath:t,tenant:n})),au(s,{method:i||"GET",body:JSON.stringify(a),headers:bT({"Content-Type":"application/json"},null!=o?o:{})})},AT=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=vT({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,l.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return au(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)},NT=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=vT({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?bT({},l,{comment:o}):l;return au(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},PT=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const u=vT({url:`/tasks${s?zr(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(bT({objectURIs:[i]},(0,l.reject)(E,a)))};return au(u,bT({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},RT=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i,max:a,offset:o}=e;return au(vT({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})})},ST=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i,max:a,offset:o}=e;return au(vT({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)(bT({max:a,offset:o},i))})},wT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return au(vT({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},IT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return au(vT({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},UT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return IT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},CT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return au(vT({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},DT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return IT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},LT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return IT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},jT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return IT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},kT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a,processInstanceComment:o}=e;return au(vT({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a,processInstanceComment:o})})},FT=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return au(vT({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},MT=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 au(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),Xr)(d)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},xT=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 au(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),Xr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},$T=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return au("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},VT=(e,t,r)=>Promise.all(t.map((async t=>await au(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})))),GT=async(e,t)=>await VT(e,t,"NOT"),WT=async(e,t)=>await VT(e,t,"MATCH"),BT=async(e,t)=>await Promise.all(t.map((async t=>await au(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}}))));function YT(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){qT(e,t,r[t])}))}return e}function qT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function HT(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 JT=3e4,QT=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return au(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},KT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return TE({url:`entities/_connections/_hasNonImported?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,entityUri:i,content:a}=e;return TE({url:`entities/_connections/_import?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}})},zT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return au(`${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 zT({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},eE=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{uri:a}=n,[o,s]=(0,l.partition)(mp,i);return Promise.all([s.length?$T(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return zT({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},tE=(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=HT(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)}),[])),rE=(0,l.pipe)((0,l.find)((0,l.propEq)("index",0)),(0,l.propOr)({},"object"),tE),nE=e=>{let{dtssPath:t,customerTenant:r,entity:n}=e;const{uri:i,dataTenant:a}=n;return au(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:a,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(rE)},iE=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)},aE=iE((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return au(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{uri:a,type:o}])}).then(rE)})),oE=iE((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return au(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),sE=(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)}},lE=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return au(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},uE=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 lE(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},cE=uE("NOT"),pE=uE("MATCH"),dE=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{uri:o}=i,[s,u]=(0,l.partition)(mp,a);return Promise.all([VT(o,u,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return lE(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},yE=dE("NOT"),fE=dE("MATCH");function TE(e){let{requestProvider:t=au,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}`,YT({},HT(s,["headers"]),{headers:YT({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const EE=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return TE({url:df(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},mE=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return TE({url:rf(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},hE=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a,options:o}=e;const{searchByOv:s}=o,{options:u}=Gf(t,r);return TE({url:`entities/_connections/_getConnections${zr({dataEntityUri:t,options:s?"searchByOv":void 0})}`,options:u,dataTenant:n,customerTenant:i,dtssPath:a}).then((0,l.pipe)(Wf,(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)))}))))},bE=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return TE({url:`${hf(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},OE=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return au(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},vE=e=>{let{dtssPath:t,tenant:r}=e;return au(`${t}tenants/customerTenants?id=${r}&useCache=true`,{method:"GET",timeout:JT})},gE=e=>{let{dtssPath:t,customerTenant:r}=e;return au(`${t}subscriptions?useCache=true`,{method:"GET",headers:{CustomerTenant:r},timeout:JT})},_E=e=>{let{dtssPath:t,tenants:r}=e;return au(`${t}tenants/dataTenants?id=${r}&useCache=true`,{method:"GET",timeout:JT})},AE=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return TE({url:hf(t),dataTenant:r,customerTenant:n,dtssPath:i})},NE=()=>au("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET"});function PE(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){RE(e,t,r[t])}))}return e}function RE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const SE=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=PE({},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 au(`${t}/api/${r}/graph/search${zr({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},wE=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return au(`${t}/api/${r}/graph/search/count`,{method:"POST",body:PE({},n,i),headers:{"Content-Type":"application/json"}})},IE=(e,t)=>`${e}/${t}/comments`,UE=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return au(`${IE(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},CE=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return au(`${IE(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},DE=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return au(IE(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},LE=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return au(`${IE(t,r)}/${n.commentId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},jE=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return au(`${IE(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},kE=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i}=e;return au(`${IE(t,r)}/${n}/replies/${i}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},FE=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i,data:a}=e;return au(`${IE(t,r)}/${n}/replies/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},ME=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return au(`${IE(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},xE=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=zr({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return au(`${IE(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function $E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){VE(e,t,r[t])}))}return e}function VE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const GE=e=>{let{tenant:t,servicesPath:r}=e;return au(`${r}/users/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})},WE="graphExport",BE=async(e,t,r,n,i)=>{let a;try{const{data:n={}}=await JE({servicesPath:e,tenant:t,environment:r,namespace:WE,options:{method:"GET",headers:{"Content-Type":"application/json"}}});a=n}catch(e){a={}}const o={body:JSON.stringify($E({},a,{[n]:i})),headers:{"Content-Type":"application/json"}};let s;try{s=await JE({servicesPath:e,tenant:t,environment:r,namespace:WE,options:$E({method:"PUT"},o)})}catch(e){s=null}return s||(s=await JE({servicesPath:e,tenant:t,environment:r,namespace:WE,options:$E({method:"POST"},o)})),s},YE=e=>{let{servicesPath:t,key:r}=e;return au(`${t}/settings${zr({key:r})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},qE=e=>{let{servicesPath:t}=e;return au(`${t}/version/collect`,{method:"POST",headers:{"Content-Type":"application/json"}})},HE=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return au(`${n}/plugins${zr({tenant:t,user:r})}`,{method:"GET"})},JE=e=>{let{tenant:t,environment:r,servicesPath:n,options:i,namespace:a,projection:o}=e;return au(`${n}/configService${zr({tenant:t,environment:r,namespace:a,projection:o})}`,i)},QE=e=>{let{tenant:t,environment:r,servicesPath:n}=e;return JE({tenant:t,environment:r,servicesPath:n,options:{method:"GET"}})},KE=e=>{let{servicesPath:t,stateHash:r}=e;return au(`${t}/searchLink?key=${r}`,{method:"GET"})},XE=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),au(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},zE=e=>au(`/${e}?showObjectsInfo=true`,{method:"GET"}),ZE=e=>{let{exportPath:t,tenant:r,options:n}=e;return au(`${t}/${r}/activities${zr(n)}`,{method:"POST"})};function em(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){tm(e,t,r[t])}))}return e}function tm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rm=e=>{const{entityUri:t}=e;return au(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},nm=e=>{let{entityUri:t,crosswalk:r}=e;return au(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},im=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return au("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[em({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),em({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},am=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return au(`/${r}/_${n}${zr({contributorURI:t})}`,{method:"POST"})},om=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return au(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},sm=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return au(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},lm=e=>{let{entityUri:t,crosswalkId:r}=e;return au(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})};function um(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cm=e=>{let{entityTypeUri:t}=e;return au(`/dataQuality/fillRates${Xr({entityType:ze(t)})}`,{method:"GET"})},pm=e=>{let{attributes:t=[],metrics:r=[]}=e;const n=r.length,i=t.length*n;return i>10?10:i},dm=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){um(e,t,r[t])}))}return e}({},n===Dt.ATTRIBUTE_TYPE?{attributes:r}:{},i?{metrics:i}:{}),o=n===Dt.ATTRIBUTE_TYPE?Xr({numberOfThreads:pm({attributes:r,metrics:i})||1}):"";return au(`/entityType/${ze(t)}/dataQuality/${n}${o}`,{method:"POST",body:JSON.stringify(a)})},ym=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n,env:i}=e;return au(`${t}/api/${r}/dataValidationFunctions/entityTypes/${ze(n)}`,{method:"GET",headers:{env:i}})},fm=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 au(`${t}/${r}/entityType/${ze(n)}/ml/dataQuality/v1/${o}/timeSeries/`,{method:"POST",body:JSON.stringify(c)})},Tm=e=>{let{tenant:t,apiPath:r}=e;return au(`${r}/permissions/${t}`,{method:"GET"})},Em=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return au(`/${t}${zr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},mm=e=>{let{attributeUri:t,value:r}=e;return au(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},hm=e=>{let{attributeUri:t,value:r}=e;return au(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},bm=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return au(`/${t}${zr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},Om=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=zr({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=Vl()([[{value:a}]]);return au(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},vm=e=>{let{entityUri:t,attributeName:r,value:n}=e;return au(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},gm=e=>{let{entityUri:t,attributeName:r}=e;return au(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};function _m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Am=e=>{let{entityUri:t}=e;return au(`/${t}/_historicURIs`,{method:"GET"})},Nm=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 au(`/${t}/_changesWithTotal${zr(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){_m(e,t,r[t])}))}return e}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},Pm=(e,t)=>au(`/${e}/_previousChange${zr({timestamp:t})}`,{method:"GET"}),Rm=(e,t)=>au(`/${e}${zr({time:t})}`,{method:"GET"});function Sm(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){wm(e,t,r[t])}))}return e}function wm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Im=e=>{let{url:t,method:r,data:n,headers:i,noRequestProcessor:a}=e;const o=r||"GET";let s;return"GET"!==o&&(s=ue(n)?JSON.stringify(n):n),au(t,{method:o,body:s,headers:Sm({"Content-Type":"application/json"},null!=i?i:{}),noRequestProcessor:a})},Um=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=zr({options:a.join(","),severity:o.join(",")});return au(`${t}/validate/${i}/entity/${vp({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},Cm=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return au(`${t}/validate/${n}/entity${zr({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},Dm=e=>{let{tenant:t,apiPath:r}=e;return au(`${r}/tenants/${t}/name`,{method:"GET"})},Lm=e=>{let{tenant:t,apiPath:r}=e;return au(`${r}/tenants/${t}/_rdmTenants`,{method:"GET"})},jm=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e;return au(`${a}/preferences${zr({name:t,tenant:r,environment:n,user:i})}`,{method:"GET"})},km=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 au(`${a}/preferences`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})},Fm=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e,o={name:t,tenant:r,environment:n,user:i};return au(`${a}/preferences`,{method:"DELETE",body:JSON.stringify(o)})},Mm=e=>{const{servicesPath:t}=e;return au(`${t}/getTokenForWorker`,{method:"GET"})};var xm=r(29524);const $m=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=We(),s={attributes:Sl({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=Vs(r,e,n.uri)[0];return i&&i.value?Ll({entity:e,attributeType:n,uri:i.uri,value:t}):Cl({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},Vm=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.filter)((0,l.has)("refEntity")),(0,l.map)(ks),(0,l.filter)(Ge),(0,l.map)((t=>e[t])),(0,l.reject)(l.isNil))((null==t?void 0:t.attributes)||{}),Gm=(0,l.curry)(((e,t)=>{const r=Vm(e=e||{},t=t||{});return r.concat((0,l.chain)(Gm(e),r))})),Wm=(0,l.curry)(((e,t)=>(0,l.pipe)(ce,(0,l.filter)(e))(t))),Bm=Wm((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),Ym=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),Ge)),qm=e=>(0,l.pipe)(Bm,Ym(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),Hm=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(Bm,(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})),Jm=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),Ge),(0,l.omit)(["uri","timestamp"])),Qm=(0,l.pipe)(Jm,Cp),Km=async(e,t,r)=>{if(!e)return null;const n=qm(e);if(n.length>0)for(const r of n)e=Hm(r,t[r],e);const i=await gf(Qm(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},Xm=async(e,t,r)=>{const n=Zm(e,t),i={};for(const t of n)i[t]=await Km(e[t],i,r);return i},zm=(0,l.curry)(((e,t)=>{const r=xm.Node(t);return qm(e[t]).forEach((t=>{const n=zm(e,t);r.addEdge(n)})),r})),Zm=(e,t)=>(0,l.pipe)((0,l.map)(zm(e)),(0,l.map)(xm.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),eh=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)(Jm))})),th=(e,t)=>[...Kh(e.tags||[],t.tags||[]),...Xh(e.roles||[],t.roles||[]),...Bh(e,t),...Yh(e,t)],rh=(e,t,r)=>[...qh(Wh((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),Qh((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e,r),...th(e,t)],nh=(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 Hm(r,n,e)}),e))))}),t)}),eh),ih=(0,l.curry)(((e,t)=>(0,l.when)(Ge,(0,l.propOr)(l.__,t,e),t)));function ah(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){oh(e,t,r[t])}))}return e}function oh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sh=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return ah({},t,{[r]:{parents:n,children:i}})},lh=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return ah({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},uh=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=Vm(t,i),o=sh({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>uh(n.uri,t,[e],r)),o)},ch=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?lh({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(Fd(),n),s=Ge(o)?[o]:[],u=sh({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>uh(t,r,[i],e)),u)}),n)},ph=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return ch(r,e,t,uh(e,t))},dh=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return ph(t,r,n);if(qe(e)){const t=Bd(n,e);return t&&ch([t],null,r)}return r[e]?uh(e,r):void 0},yh=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>yh(e,t))))},fh=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>fh(e,t))))},Th=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=Ye(t),u=ph(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(qe(c)){if(s=Bd(i,c),!s)return null;o.push({type:mt.relationConnection,value:s,valueType:Mi(a,(0,l.path)(Dd(),s))});continue}if(qe(u)){const e=n[c];if(!e)return null;o.push({type:mt.tempEntity,value:e,valueType:dn(a,e.type)});continue}const p=n[u],d=rl(p,c),y=n[c];if(!d||!y)return null;o.push({type:mt.attributeValue,value:d,valueType:Ur(a,rt(d.uri,p.type))}),o.push({type:mt.tempEntity,value:y,valueType:dn(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},fh(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=qe(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?Mi(a,d.type):dn(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:dn(a,T.type)}),o.push({type:mt.attributeValue,value:s,valueType:E}),m=s.value;const l=ks(s);T=l&&Ge(l)?n[l]:null}}return o},Eh=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 mh;!function(e){e.insertAttribute="insertAttribute",e.updateAttribute="updateAttribute",e.deleteAttribute="deleteAttribute"}(mh||(mh={}));const hh={[mh.insertAttribute]:{color:"#599E0E"},[mh.updateAttribute]:{backgroundColor:"rgba(255, 187, 0, 0.12)",color:"#CC7500"},[mh.deleteAttribute]:{backgroundColor:"rgba(255, 50, 0, 0.2)",color:"#CF0E26"}},bh=e=>{switch(e){case"UPDATE_ATTRIBUTE":return mh.updateAttribute;case"UNDO_IGNORE_ATTRIBUTE":case"INSERT_ATTRIBUTE":return mh.insertAttribute;case"IGNORE_ATTRIBUTE":case"DELETE_ATTRIBUTE":return mh.deleteAttribute;default:return""}},Oh="/",vh=(0,l.pipe)((0,l.split)(Oh),(0,l.propSatisfies)((0,l.lte)(2),"length")),gh=(0,l.pipe)((0,l.split)(Oh),(0,l.slice)(0,-2),(0,l.join)(Oh)),_h=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.has)(e),(0,l.prop)(e)],[()=>vh(e),_h(gh(e))]])(t))),Ah=e=>(0,l.pipe)(l.keys,(0,l.any)((0,l.startsWith)(e+Oh))),Nh=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=_h(e,t);return(0,l.isNil)(r)?Ah(e)(t)?"UPDATE_ATTRIBUTE":"":r},Ph=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]},Rh=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(Rh(e))}))}))),t},Sh=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)(Ch,t),(0,l.propOr)([],"crosswalks",e))),e),wh=(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(wh(e))}))})),r},Ih=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=Ih(e);r>t&&(t=r)}))})),t+1):t},Uh=(e,t)=>{if(Ge(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},Ch=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},Dh=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},Lh=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},jh=(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)},kh=(0,l.eqBy)(Ch),Fh=(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)(Is,(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 Mh(e){return e&&void 0!==e.uri}let xh;function $h(e){return function(t,r){const n=[];return a=r,!(i=t)&&!a||!(!i||!a)&&i.length===a.length&&i.every((function(e,t){return e===a[t]}))||n.push({type:e,newValue:r}),n;var i,a}}function Vh(e){return void 0!==e.refEntity}function Gh(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 Wh(e,t,r){const n=[];for(const a in e)if(e.hasOwnProperty(a)){if("paging"===a)continue;const p=e[a];if(void 0===t[a])for(const e in p)p.hasOwnProperty(e)&&n.push(...o(p[e]));else for(const e in p)if(p.hasOwnProperty(e)){const f=p[e],T=y(f,t[a]);void 0===T?n.push(...o(f)):f.value===T.value||f.lookupCode&&f.lookupCode===T.lookupCode?f.ignored!==T.ignored&&n.push(...s(T)):null==T.value||""===T.value?n.push(...o(f)):"Nested"===d(f)?f.ignored!==T.ignored&&(0,l.equals)(f.value,T.value)?n.push(...s(T)):n.push(...Wh(f.value,T.value,r)):"Reference"===d(f)?Gh(f,T)?n.push(...Wh(f.value,T.value,r)):(n.push(...o(f)),n.push(c([T]))):""!==T.value&&(!1===T.ov?n.push(...u(T)):n.push(...(i=T,[{type:xh.UPDATE_ATTRIBUTE,uri:i.uri,newValue:{value:i.lookupCode||i.value}}])))}}var i;for(const r in t)if(t.hasOwnProperty(r)){if("paging"===r)continue;let i=(t[r]||[]).filter((function(t){return void 0===y(t,e[r])}));i=a((0,l.clone)(i)),i.length&&n.push(c(i))}return n;function a(e){return e?e.map((function(e){let t;if(e){const r=e.value;return null!=r&&(ue(r)?Object.keys(r).forEach((function(e){const n=a(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 o(e){return[{type:xh.DELETE_ATTRIBUTE,uri:e.uri}]}function s(e){return e&&(e.ignored?function(e){return[{type:xh.IGNORE_ATTRIBUTE,uri:e.uri,newValue:{value:!0}}]}(e):function(e){return[{type:xh.IGNORE_ATTRIBUTE,uri:e.uri,newValue:{value:!1}}]}(e))}function u(e){const t=e.uri.lastIndexOf("/"),r=e.uri.substr(0,t);return[{type:xh._UPDATE_NON_OV_ATTRIBUTE,uri:e.uri,typeUri:r,value:e.lookupCode||e.value}]}function c(e){let t=e[0].uri;const n=t.lastIndexOf("/");return t=t.substr(0,n),{type:xh.INSERT_ATTRIBUTE,uri:t,newValue:e.map((function(e){let t;const n={value:JSON.parse(JSON.stringify(e.lookupCode||e.value))};return r&&(n.uri=e.uri),p(n.value),Vh(e)&&(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}))}}function p(e){if(null!==e&&"[object Object]"===e.toString())for(const t in e)e.hasOwnProperty(t)&&"paging"!==t&&e[t].forEach((function(e){delete e.crosswalks,delete e.type,r||delete e.uri,p(e.value)}))}function d(e){const t=e.value;if(ue(t))return e.hasOwnProperty("refEntity")?"Reference":"Nested"}function y(e,t){if(void 0!==t)return t.filter((function(t){return t.uri===e.uri}))[0]}}function Bh(e,t){const r=[];var n,i;return e.defaultProfilePic!==t.defaultProfilePic?r.push({type:xh.UPDATE_PROFILE_PIC_BY_URI,newValue:{value:t.defaultProfilePic}}):(n=e.defaultProfilePicValue)===(i=t.defaultProfilePicValue)||Mh(n)&&Mh(i)&&n.uri===i.uri||r.push({type:xh.UPDATE_PROFILE_PIC_BY_URL,newValue:{value:t.defaultProfilePicValue}}),r}function Yh(e,t){const r=[],n=a(e.startDate,t.startDate);void 0!==n&&r.push({type:xh.UPDATE_START_DATE,newValue:{value:n}});const i=a(e.endDate,t.endDate);return void 0!==i&&r.push({type:xh.UPDATE_END_DATE,newValue:{value:i}}),r;function a(e,t){let r;return e!=t&&(r=(0,l.isNil)(t)?"":t+""),r}}function qh(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];const i="configuration/sources/Reltio",a="configuration/sources/ReltioCleanser";function o(e,t){return e.crosswalk={type:t.type,value:t.value},e}function s(e,t){return e.reduce((function(e,r){return(e[r[t]]=e[r[t]]||[]).push(r),e}),{})}function l(e){return e.removeIt=!0}const u=e.map((function(e){if(e.crosswalk)return[e];const s=Hh(t,e.uri),l=s.filter((function(e){return e.type===i})),u=s.filter((function(e){return e.type!==i}));let c=[];switch(e.type){case xh.INSERT_ATTRIBUTE:c.push(e);break;case xh._UPDATE_NON_OV_ATTRIBUTE:c=c.concat(s.map((function(t){return o(e,t)})));break;case xh.DELETE_ATTRIBUTE:(u.length||0==l.length)&&c.push({type:xh.IGNORE_ATTRIBUTE,uri:e.uri,newValue:{value:!0}}),c=c.concat(l.map((function(t){return o({type:xh.DELETE_ATTRIBUTE,uri:e.uri},t)})));break;case xh.UPDATE_ATTRIBUTE:{const s=u.some((e=>{let{type:t}=e;return t===a}))&&r?Jh(r,t,e.uri):null;if(s||l.length){if(l.length)c=c.concat(l.map((function(t){return o({type:xh.UPDATE_ATTRIBUTE,uri:e.uri,newValue:e.newValue},t)})));else if(s){const r=Hh(t,s.uri).filter((e=>{let{type:t}=e;return t===i}));c=c.concat(r.map((t=>o({type:xh.UPDATE_ATTRIBUTE,uri:s.uri,newValue:e.newValue},t))))}}else c.push({type:xh.INSERT_ATTRIBUTE,uri:e.uri.substr(0,e.uri.lastIndexOf("/")),newValue:[e.newValue],insteadOfUpdate:!0});u.length&&n&&c.push({type:xh.IGNORE_ATTRIBUTE,uri:e.uri,newValue:{value:!0}});break}}return c}));let c=u.flat();const p=s(c,"typeUri");for(const e in p){if("undefined"===e)continue;const t=p[e],r=c.filter((function(e){return e.type!==xh._UPDATE_NON_OV_ATTRIBUTE})).filter((function(t){return t.uri.substr(0,t.uri.lastIndexOf("/"))===e||"INSERT_ATTRIBUTE"===t.type&&t.uri===e})),n=t.find((function(e){const{crosswalk:t}=e;return t&&t.type===i}));!r.find((function(e){return"UPDATE_ATTRIBUTE"===e.type}))&&n&&(c.push({type:xh.UPDATE_ATTRIBUTE,uri:n.uri,newValue:{value:n.value},crosswalk:n.crosswalk}),r.forEach(l)),t.forEach(l)}return c=c.filter((function(e){return!e.removeIt})),c.forEach((function(e){delete e.insteadOfUpdate})),c}!function(e){e.UPDATE_PROFILE_PIC_BY_URI="UPDATE_PROFILE_PIC_BY_URI",e.UPDATE_PROFILE_PIC_BY_URL="UPDATE_PROFILE_PIC_BY_URL",e.UPDATE_START_DATE="UPDATE_START_DATE",e.UPDATE_END_DATE="UPDATE_END_DATE",e.INSERT_ATTRIBUTE="INSERT_ATTRIBUTE",e.UPDATE_ATTRIBUTE="UPDATE_ATTRIBUTE",e.DELETE_ATTRIBUTE="DELETE_ATTRIBUTE",e.UPDATE_ROLES="UPDATE_ROLES",e.UPDATE_TAGS="UPDATE_TAGS",e.IGNORE_ATTRIBUTE="IGNORE_ATTRIBUTE",e._UPDATE_NON_OV_ATTRIBUTE="_UPDATE_NON_OV_ATTRIBUTE"}(xh||(xh={}));const Hh=(e,t)=>e.filter((function(e){return 1===(e.attributes||e.attributeURIs||[]).filter((function(e){return e===t})).length})),Jh=(e,t,r)=>(0,l.pipe)(nl,(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 Uh(t,r)},e=>{let[t]=e;return!Ps(t)}]),(0,l.prop)(0),(0,l.always)(null)))(e,r);function Qh(e,t){t=t||[];for(const r in e)if(e.hasOwnProperty(r)){const n=e[r];for(let e=0;e<n.length;e++){const r=n[e];if(Vh(r)&&r.refRelation){const e=r.refRelation[0]||r.refRelation;if(e.crosswalks){const r=e.crosswalks.filter((function(e){return e.attributes||e.attributeURIs}));for(let e=0;e<r.length;e++){let n=!0;for(let i=0;i<t.length;i++)if(t[i].type===r[e].type&&t[i].value===r[e].value){t[i].attributes=t[i].attributes||t[i].attributeURIs,t[i].attributes=t[i].attributes.concat(r[e].attributes||r[e].attributeURIs),t[i].attributes=Object.keys(t[i].attributes.reduce((function(e,t){return e[t]=!0,e}),{})),delete t[i].attributeURIs,n=!1;break}n&&t.push(r[e])}}}}}return t}function Kh(e,t){return $h(xh.UPDATE_TAGS).call(this,e,t)}function Xh(e,t){return $h(xh.UPDATE_ROLES).call(this,e,t)}function zh(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){Zh(e,t,r[t])}))}return e}function Zh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var eb=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(ue(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:ue(t)?n[r]=i(e[r],t):-1===e.indexOf(t)&&n.push(t)}))):(ue(e)&&Object.keys(e).forEach((function(t){n[t]=e[t]})),Object.keys(t).forEach((function(r){ue(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=zh({},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:zh({},n,{roles:s,tags:u}),roles:i,tags:l}}}};const tb=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?tb(t.value):[]];return e.concat(r)}),[])),rb=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,nb=e=>e?[Op(e)]:[],ib=e=>{const t=[...tb((null==e?void 0:e.attributes)||[]),...tb((null==e?void 0:e.analyticsAttributes)||[])];return e?[...nb(e),...t]:[]},ab=(e,t)=>[e,...t.map((t=>rb(e,t)))],ob=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return md(t)}))},sb=(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[nt(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,Op({uri:n,dataTenant:i}),r]})(t)}},lb=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),ub=(0,l.curry)(((e,t)=>{const r=Bo(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(ub(e,r.extendsTypeURI)):n})),cb=(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))),pb=(e,t)=>(0,l.pipe)((0,l.prop)("type"),ub(e),cb(t))(t),db=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 yb,fb=r(33164);function Tb(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"}(yb||(yb={}));const Eb={},mb={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"]}},hb=e=>{if(!Eb[e]){const t=mb[e]||mb.random0;Eb[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){Tb(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return Eb[e]},bb=(0,l.curry)(((e,t)=>{const r=hb(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]})),Ob=e=>bb(yb.Charts,e),vb=()=>hb(yb.PotentialMatches).colors,gb=e=>bb(yb.Random1,e),_b=e=>(0,fb.getColor)(e)?"#FFFFFF":"#212121";var Ab=r(73116);const Nb=Array.from({length:100},((e,t)=>t/100)),Pb=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)},Rb={},Sb=new Ab.Z({hash:Pb,saturation:Nb.slice(15,71),lightness:Nb.slice(50,90)}),wb=new Ab.Z({hash:Pb,saturation:Nb.slice(46,89),lightness:Nb.slice(44,58)}),Ib=(0,l.curry)(((e,t,r)=>{t in Rb||(Rb[t]={});const n=Rb[t];r in n||(n[r]=((e,t)=>{const r=String(Pb(t));return e.hsl(r)})(e,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),Ub=Ib(Sb,"crosswalks"),Cb=Ib(Sb,"sources"),Db=Ib(Sb,"contributors"),Lb=Ib(Sb,"dataValidationFunctions"),jb=Ib(wb,"entities");function kb(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){Fb(e,t,r[t])}))}return e}function Fb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Mb=(0,l.has)("items"),xb=e=>0===e,$b=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)},Vb=e=>e.reduce(((e,t)=>e+t.width),0),Gb=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),Wb=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),Bb=e=>e.reduce(((e,t)=>e+t.height),0),Yb=e=>(0,l.is)(String,e)&&e.includes("%"),qb=(0,l.has)("spacer"),Hb=(e,t)=>Math.max(Math.round(parseFloat(t)/100*e),1),Jb=e=>((null==e?void 0:e.items)||[]).reduce(((e,t)=>e.concat(Mb(t)?Jb(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},Kb=e=>({id:e.layout}),Xb=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Kb;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=Yb(r.width)?Hb(i,r.width):u}return $b(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return $b(n,t,r)},o=(e,t)=>Mb(t.items[0])?p(e,t.items[0]):null,s=(t,r)=>{const o=r.items.map((a=>i(t,r,a,Mb(a)?n(a.layout):e(a.view)))),s=Qb(t.width,o),u=r.items.reduce(((r,n,i)=>{const o=s[i],u=xb(i)?t.x:(0,l.last)(r).x+(0,l.propOr)(o,"width",(0,l.last)(r));if(Mb(n))return r.concat(p(kb({},t,{x:u,width:o}),n));{const i=e(n.view);return r.push(kb({y:t.y,x:u,height:a(i),width:o},i)),r}}),[]);return{x:t.x,y:t.y,width:Vb(u),height:Gb(u),items:u}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=Mb(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=xb(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(Mb(i))return r.concat(p(kb({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(kb({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?$b(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?$b(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:Wb(i),height:Bb(i),items:i}},c=(t,r)=>{const n=(e,t,r,n)=>xb(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 kb({},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=kb({},e,{width:s[0]}),c=kb({},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(kb({},e,{y:n(e,t,a,f),height:f,items:(0,l.filter)(l.identity,[p,d])}))}return t}),[]);return kb({},e,{height:Bb(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(kb({},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 kb({},t,{height:y,items:(0,l.reject)(f,[s,p,d])})},p=(e,t)=>{const r=kb({},t,{items:(0,l.reject)(qb,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 Jb(f)},zb=(e,t)=>(e||[]).filter((e=>t.some((t=>t.id===e.id)))),Zb=[Mt.FilteredEntitiesViewFacet,Mt.ActivitiesViewFacet,Mt.ProfileStatsFacet,Mt.FilteredSavedSearchesFacet],eO=(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=Zb.includes(a.component)?8:4;return kb({},i,{height:Math.max(r,o),minHeight:Math.max(n,o)})}));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){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 nO={BarChart:Ft.BAR,BarChartGrouped:Ft.BAR,BarChartHorizontal:Ft.BAR,LineChart:Ft.LINE,Map:Ft.MAP,Pie:Ft.PIE},iO=(e,t)=>it(e)?et(e,t):e,aO=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=nO[r];return tO({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},oO=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return tO({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"]))},sO=(e,t,r)=>{const n=(e=>e&&ne(e).map((e=>{const{type:t,value:r}=e;return tO({},e,{value:[_n,An,On.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:Pn(t),fieldName:r,values:n?ne(n):void 0}})))(e);return t&&it(t)||!r?n:(n||[]).concat((i=r,{filter:On.EQUALS,fieldName:"type",values:[i]}));var i},lO=["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"],uO={"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:iO(n,r),filters:sO(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:iO(n,r),filters:sO(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=ne(a).find((e=>"type"===(null==e?void 0:e.attribute))),p=n||(null==c?void 0:c.value);return tO({id:t,count:o,canRead:u,orderType:s,attributeUri:iO(r,p),filters:sO(a,r,p),component:Mt.DashboardFacet,title:i,showOthers:!0},aO(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:iO(n,r),filters:sO(a,n,r),chartType:Ft.MAP,component:Mt.DashboardFacet,title:i,geoUrl:lO[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 tO({id:t,count:o,canRead:l,attributeUri:iO(n,r),filters:sO(a,n,r),component:Mt.DashboardFacet,title:i,geoUrl:s,chartType:Ft.MAP,projection:"geoMercator"},aO(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:oO(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:sO(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:On.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||de().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||de().text("Activity log")}}},cO=e=>({id:e,height:10}),pO=(0,l.pipe)((0,l.map)((e=>{const t=uO[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),dO=e=>{if("0.1"===e.version){const t=pO(e.views),r=Xb(cO,e.layout,{columns:4});return{id:e.id,margin:0,layout:zb(r,t),views:t}}return e},yO=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"),ne)],[(0,l.prop)("items"),(0,l.pipe)((0,l.prop)("items"),(0,l.map)((e=>yO(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);function fO(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){TO(e,t,r[t])}))}return e}function TO(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=fO({},xt,{OldMap:"com.reltio.plugins.entity.EntityMapView",OldTree:"com.reltio.plugins.entity.TreeView"}),mO=e=>e,hO={[EO.Attributes]:mO,[EO.HierarchyTree]:mO,[EO.HierarchyPaths]:mO,[EO.RelationsTable]:mO,[EO.Relations]:e=>fO({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[EO.SingleAttribute]:mO,[EO.Custom]:mO,[EO.AttributeTable]:mO,[EO.Map]:mO,[EO.OldTree]:e=>fO({},e,{class:xt.HierarchyTree}),[EO.OldMap]:e=>fO({},e,{class:xt.Map}),[EO.ImageAttribute]:mO,[EO.PotentialMatches]:mO},bO=(0,l.pipe)((0,l.map)((e=>{const t=hO[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),OO=(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})),vO=(e,t)=>(t||[]).map((t=>fO({},t,OO(e,t.id)))),gO=e=>{const t=(0,l.pick)(["id","workflow","maxWidth","sidePanelViews","profileBand","views"],e);if("2.0"===e.version)return fO({},t,{layout:vO(t.views,e.newLayout)});if("0.1"===e.version){const r=bO(e.views),n=Xb(OO(r),e.layout,{columns:3});return fO({},t,{layout:zb(n,r),views:r})}return e},_O=(e,t)=>e.class===t||e["react-class"]===t,AO=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(_O(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(_O(t,xt.SingleAttribute)||_O(t,xt.AttributeTable))&&e.includeUris.push(t.attributeUri),e}),{includeUris:[],excludeUris:null}))(e);return function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const i=(n[0]||e).uri;return r&&!r.some(Ke(i))||t.some(Ke(i))}},NO=(e,t)=>e.filter((e=>t.some((t=>_O(e,t))))).map((e=>{let{id:t}=e;return t})),PO=(e,t)=>{let{extensions:r}=e;return(r||[]).find((e=>e.id===t))},RO=(e,t)=>e.flatMap((e=>{let{extensions:r=[]}=e;return r.filter((e=>{let{point:r}=e;return r===t}))})),SO=e=>(0,l.pipe)((0,l.map)((e=>PO(e,"com.reltio.plugins.entity.ProfileBand"))),(0,l.reject)(l.isNil),l.head)(e);function wO(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){IO(e,t,r[t])}))}return e}function IO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const UO=(0,l.curry)(((e,t)=>yO(t).map((t=>(0,l.pipe)((0,l.map)((e=>PO(e,t))),(0,l.reject)(l.isNil),l.head)(e))).filter(l.identity))),CO=(0,l.either)((0,l.propEq)("label","D&B Connector"),(0,l.propEq)("label","D&B Connector")),DO=(0,l.propEq)("class",xt.Custom),LO=e=>{let{extensions:t=[]}=e;return t.filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]))},jO=(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=vO(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=>PO(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=UO(e,t.layout);i=((e,t)=>{if(t.side){var r;const n=(0,l.pipe)((0,l.chain)((e=>PO(e,t.side))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("layout"))(e),[i,a]=(0,l.partition)(CO,null!==(r=null==n?void 0:n.items)&&void 0!==r?r:[]),o=(0,l.pipe)(UO(e),(0,l.filter)(DO))(wO({},n,{items:i})),s=[{id:"common",views:UO(e,wO({},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=gO(wO({},t,{views:a,version:"0.1"})),u=(0,l.pipe)(SO,(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})},kO=(e,t)=>{if("scroll"===t.layout.layout){const r=UO(e,t.layout),n=dO(wO({},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}},FO=(e,t)=>{const r=UO(e,t.layout)[0];return{class:Vt.DQDashboard,id:t.id,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel,showTimeSeries:r.showTimeSeries}},MO=(e,t)=>{const r=UO(e,t.layout)[0];return{class:Vt.RelationshipSearch,id:t.id,options:r.options,consoleExportApp:r.consoleExportApp}},xO=(e,t)=>{const r=UO(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}},$O=(e,t)=>{const r=UO(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}},VO=(e,t)=>{const r=UO(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}},GO=(e,t)=>{const r=UO(e,t.layout)[0];return{class:Vt.PotentialMatches,id:t.id,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},WO=(e,t)=>{const r=UO(e,t.layout)[0],n=r.potentialMatchesReview||{processType:(e=>{const[t]=RO(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}},BO=(e,t)=>({class:Vt.Graph,id:t.id}),YO=(e,t)=>{const r=UO(e,t.layout)[0];return{class:Vt.ProfileActivityLog,id:t.id,exportTypes:r.exportTypes,caption:r.caption}},qO=e=>t=>!!(0,l.intersection)(e,t).length,HO=(0,l.cond)([[qO(["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"]),()=>kO],[qO(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>FO],[qO(["com.reltio.plugins.graph.GraphView"]),()=>BO],[qO(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>MO],[qO(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>xO],[qO(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>$O],[qO(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>VO],[qO(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>GO],[qO(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>WO],[qO(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>YO],[l.T,()=>(0,l.always)(void 0)]]),JO=(e,t)=>{const{class:r}=e;if("com.reltio.plugins.entity.ProfileAction"===r)return((e,t)=>{const r=(0,l.pipe)((0,l.chain)(LO),(0,l.map)((t=>jO(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=>PO(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=>PO(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=jO(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=yO(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 HO(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){KO(e,t,r[t])}))}return e}function KO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const XO=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))},zO="https://reltio-ui-files.s3.amazonaws.com/new-ui/";var ZO;!function(e){e[e.DashboardGroup=0]="DashboardGroup",e[e.ProfileGroup=1]="ProfileGroup",e[e.SearchGroup=2]="SearchGroup"}(ZO||(ZO={}));const ev={[Vt.DQDashboard]:`${zO}DqDashboard.svg`,[Vt.Dashboard]:`${zO}Dashboard.svg`,[Vt.Graph]:`${zO}Graph.svg`,[Vt.RelationshipSearch]:`${zO}GraphSearch.svg`,[Vt.Interactions]:`${zO}Interactions.svg`,[Vt.PotentialMatches]:`${zO}PotentialMatches.svg`,[Vt.Profile]:`${zO}Profile.svg`,[Vt.NestedProfile]:`${zO}Profile.svg`,[Vt.ProfileActivityLog]:`${zO}ActivityLog.svg`,[Vt.Relationships]:`${zO}Relationships.svg`,[Vt.Sources]:`${zO}Crosswalk.svg`,[Vt.Search]:`${zO}Search.svg`,[ZO.DashboardGroup]:`${zO}DashboardGroup.svg`,[ZO.ProfileGroup]:`${zO}ProfileGroup.svg`,[ZO.SearchGroup]:`${zO}SearchGroup.svg`,DEFAULT:`${zO}Default.svg`},tv=e=>ev[null==e?void 0:e.class]||ev.DEFAULT,rv=(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}`})))))),nv=(e,t)=>{var r;return(null===(r=e[t.class])||void 0===r?void 0:r.find((0,l.propEq)("id",t.id)))||t},iv=e=>"com.reltio.plugins.entity.ProfileFirstAction"===e.class?ev[ZO.ProfileGroup]:null,av=e=>(0,l.cond)([[(0,l.any)((e=>{let{icon:t}=e;return t===ev[Vt.Dashboard]||t===ev[Vt.DQDashboard]})),(0,l.always)(ev[ZO.DashboardGroup])],[(0,l.any)((e=>{let{icon:t}=e;return t===ev[Vt.Search]||t===ev[Vt.RelationshipSearch]})),(0,l.always)(ev[ZO.SearchGroup])],[l.T,()=>null]])(e),ov=e=>(0,l.pipe)((0,l.chain)(XO),(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:JO(e,t)}))),(0,l.filter)((e=>e.screen)))(t),n=rv(r);return(0,l.map)((e=>{let{label:t,screen:r,canRead:i,entityTypes:a}=e;return{label:t,icon:tv(r),screen:nv(n,r),canRead:i,entityTypes:a}}))(r)})(t,e),n=JO(t,e);return{label:t.label,icon:iv(t)||av(r)||tv(n),menu:r.length?{type:"side",items:r}:void 0,screen:n,canRead:t.canRead}}));function sv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lv=e=>{let{extensions:t}=e;return(t||[]).filter((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},uv=e=>({id:e,height:10}),cv=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)(lv),(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=pO(((e,t)=>{const r=yO(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){sv(e,t,r[t])}))}return e}({id:r},t[0])})),(0,l.uniqBy)((0,l.prop)("id")))(e)})(e,t.layout)),n=Xb(uv,t.layout,{columns:4});return{views:r,layout:zb(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))};function pv(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){dv(e,t,r[t])}))}return e}function dv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yv(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 fv=(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))),Tv=e=>"com.reltio.plugins.dashboard.DashboardPerspective"===e,Ev=(0,l.unless)((e=>!!e&&(e.startsWith("http:")||e.startsWith("https:"))),(0,l.always)(null)),mv=(0,l.pipe)(fv("top-logo"),Ev),hv=(0,l.prop)("showLookupCode"),bv=e=>{var t;const r=(e=>(0,l.pipe)((0,l.map)((e=>PO(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=>PO(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=>PO(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=>PO(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=>PO(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=>PO(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=>PO(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)(ue,(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 pv({thousandSeparator:r,decimalScale:n},yv(t,["groupSeparator","digitsAfterDecimalSeparator"]))})))(e))(e),c=(e=>(0,l.pipe)((0,l.map)((e=>PO(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)(fv("default-perspective"),(0,l.ifElse)(Tv,(0,l.always)("dashboard"),(0,l.always)("search")))(e))(e),d=(e=>(0,l.pipe)((0,l.map)((e=>PO(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=>RO(e,"com.reltio.plugins.ui.custom_script")),(0,l.reject)(E),(0,l.map)((e=>{let{action:t}=e;return pv({},t,yv(e,["action"]))})))(e))(e),f=(e=>fv("checkUser",e))(e),T=(e=>fv("checkIdle",e))(e),m=(e=>(0,l.pipe)((0,l.map)((e=>PO(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=>PO(e,"com.reltio.plugins.ui.LookupCodeVisibility"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}))(e))(e),b=void 0===(O=hv(h))||O;var O;const v=null===(t=SO(e))||void 0===t?void 0:t.showEntityId,g=(e=>fv("preview",e))(e),_=mv(e),A=(e=>fv("showAttributeDescription",e))(e),N=(e=>fv("topBackgroundColor",e))(e),P=(e=>(0,l.pipe)((0,l.map)((e=>PO(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),R=(e=>(0,l.pipe)((0,l.map)((e=>PO(e,"com.reltio.plugins.network.configuration"))),(0,l.reject)(l.isNil),l.head,(0,l.omit)(["id","point"]))(e))(e),S=(e=>(0,l.pipe)((0,l.map)((e=>PO(e,"com.reltio.plugins.search.dev.SearchView"))),(0,l.reject)(l.isNil),l.head,(0,l.path)(["options","showSearchByOv"]))(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,requestProvider:R,attributePresentations:u,attributesSorting:d,workflow:c,defaultRoute:p,customScripts:y,checkUser:f,checkIdle:T,showSearchByOv:S,showSwitchToClassic:m,showEntityId:v,preview:g,logo:_,showAttributeDescription:A,headerColor:N}},Ov=e=>({layout:ov(e),pivoting:cv(e),properties:bv(e)});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}const _v=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,Ce.x0)()}`;return n[e.id].push(t),i=!0,vv({},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]++,vv({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}};function Av(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}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}let Pv={};const Rv=(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(Pv[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))}Pv=Av({},Pv,{[a]:Av({},Pv[a]||{},{worker:i})})}else i=Pv[a].worker,Pv[a].innerText&&t({task:{action:qt.SET_HTML,params:{html:Pv[a].innerText}},worker:i,config:r}),i.removeEventListener("message",Pv[a].onWorkerMessage);return i&&(Pv[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||(Pv[a].innerText=n.params.html)}},i.addEventListener("message",Pv[a].onWorkerMessage)),i},Sv=(0,l.curry)(((e,t)=>!e||!e.availableEntityTypes||!t||e.availableEntityTypes.includes(t))),wv=(0,l.flip)(Sv);var Iv=r(83926);const Uv=(e,t)=>{const{thousandSeparator:r="",decimalSeparator:n=".",prefix:i="",suffix:a="",groupSize:o=3,decimalScale:s}=e,l=null!=s?new Iv.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 Cv;const Dv=()=>Cv,Lv={setLocale:e=>{Cv=e},getLocale:Dv,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 Uv(t,r)}catch(e){return console.warn("Number localization error"),r}})(Dv(),e),applyFormatToNumber:Uv},jv=(0,l.curry)(((e,t)=>null==t?"":("string"!=typeof t&&(t=String(t)),e&&t?Lv.applyFormatToNumber(e,t):(!e&&t&&(t=Lv.number(t)),t)))),kv=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?de().number(e,"0,0.0a").toUpperCase():de().number(e,"0,0"):""},Fv=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last));let Mv=!0;const xv=e=>Mv=e,$v=(e,t)=>e!==t&&t?Mv&&e?`${t} (${e})`:t:e,Vv=(e,t,r)=>(0,l.path)([t,r,"displayName"],e),Gv=(e,t,r)=>{const n=Vv(e,t,r);return $v(r,n)},Wv=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),Bv=(0,l.complement)(Wv),Yv=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),qv=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)},Hv=(0,l.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter(Bv(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),Jv=(0,l.curry)(((e,t)=>{let{attributePresentations:r={},dataTypeDefinition:n={},dateMask:i,dateTimeMask:a}=e;const o=r[n.uri]||r[Ln],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&&jv(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:le(t)?de().text("Yes"):de().text("No");case zt.TYPE_DATE:return(0,l.is)(Number,t)&&(t=A(Number(t)).getTime()),(t=t)&&(nc(t)?ic(t):de().date(t,s));case zt.TYPE_ACTIVENESS_DATE:case zt.TYPE_LOCAL_DATE:return(t=t)&&(nc(t)?ic(t):de().date(t,s));case zt.TYPE_TIMESTAMP:return(t=t)&&(nc(t)?ic(t):de().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)?$v((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 Kv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xv=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){Kv(e,t,r[t])}))}return e}({},i,{signal:r.signal})).finally((()=>{clearTimeout(a)}))}return e(t,i)},zv=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()}},Zv=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})))),eg=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={},u=(0,l.pipe)(Xv,(e=>{const t={},r={};return n=>{var i,a;const o=null!==(i=e.attemptsThreshold)&&void 0!==i?i:10,s=null!==(a=e.attemptsTimeWindowSize)&&void 0!==a?a:5e3;return(i,a)=>{const l=(e=>{const[t]=e.split("?");return t.split("/")[2]})(i),u=t[l],c=()=>Promise.reject({errorMessage:`service ${l} was disabled (authorization issues)`});if(u)return c();if(r[l]){const e=r[l].length;if(e>o){const n=e-o-1;if(r[l][e-1]-r[l][n]<=s)return t[l]=!0,c();r[l]=r[l].slice(n)}}return n(i,a).then((t=>{var n;return!e.excludedServices||null!==(n=e.excludedServices)&&void 0!==n&&n.includes(l)||(401===t.status?(r[l]||(r[l]=[]),u||r[l].push(Date.now())):r[l]&&t.ok&&(r[l].length=0)),t}))}}})(s),(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),zv,Zv);let c=0,p=[];return{request:(e,n)=>{const i=u(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(c){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 p.push(t),e}return a()},addRequestInterceptor:n,addResponseInterceptor:i,setRequestProviderConfiguration:e=>{Object.assign(s,e)},startInterceptorInit:()=>{c+=1},finishInterceptorInit:()=>{c=Math.max(c-1,0),0===c&&(p.forEach((e=>e())),p=[])},removeRequestInterceptor:a,removeResponseInterceptor:o}},tg="__metadata",rg=(e=>{const t=[tg,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),ng=(0,l.set)(rg),ig=(0,l.view)(rg),ag=ng(Un.NEW),og=ng(Un.REMOVED),sg=ng(Un.EDITED),lg=ng(Un.IGNORED),ug=(0,l.pipe)(ig,(0,l.equals)(Un.REMOVED)),cg=(0,l.pipe)(ig,(0,l.equals)(Un.NEW)),pg=(0,l.pipe)(ig,(0,l.equals)(Un.EDITED)),dg=(0,l.pipe)(ig,(0,l.complement)(l.isNil)),yg=(0,l.pipe)(ig,(0,l.equals)(Un.IGNORED)),fg=(0,l.omit)([tg]),Tg=(e,t)=>e===tg?void 0:t;function Eg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mg=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=mg(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},hg=(e,t)=>mg((0,l.propEq)("nodeId",t),e),bg=(e,t)=>mg((0,l.pathEq)(["entity","uri"],t),e),Og=(e,t)=>{const r=hg(e,t);return r.length>1?r[r.length-2]:null},vg=(e,t)=>{const r=hg(e,t);return r.length>0?r[r.length-1]:null},gg=(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=>gg(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},_g=()=>{},Ag=(e,t)=>{let{parent:r,nodeProcessing:n=_g}=t;n(e,r),e.children&&e.children.forEach((t=>Ag(t,{parent:e,nodeProcessing:n})))},Ng=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){Eg(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})}}},Pg=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&&Ag(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}=Ng({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}=Ng({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},Rg=(e,t)=>{if((0,l.path)(["entity","uri"],e)===t)return!0;if(e&&e.children)for(const r of e.children){const e=Rg(r,t);if(e)return e}return!1},Sg=(0,l.curry)(((e,t)=>{const r=(0,l.map)(Sg(e));return(0,l.evolve)({entity:t=>t.uri===e.uri?e:t,children:r},t)})),wg=(e,t)=>{const r=(0,l.pipe)(Object.entries,(0,l.filter)((t=>{let[,r]=t;return r.root&&((e,t)=>Rg(t,e.uri))(e,r.root)}))),n=(0,l.map)((t=>{let[r,n]=t;return{id:r,root:Sg(e,n.root)}}));return(0,l.pipe)(r,n)(t)},Ig={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},Ug={asc:"asc",desc:"desc"},Cg=Ig.entityLabel,Dg=Ug.asc,Lg=(0,l.always)(0),jg=e=>{let{sortField:t=Cg,sortOrder:r=Dg,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case Ig.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,l.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return uP.strings.sort(t,a,o)})(n,r);case Ig.entityLabel:return(e=>(t,r)=>{const n=(0,l.path)(["entity","label"]),i=n(t),a=n(r);return uP.strings.sort(e,i,a)})(r);default:return Lg}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},kg=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values(Ug)),l.identity,(0,l.always)(Dg))),Fg=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(Ig)),l.identity,(0,l.always)(Cg)));var Mg=r(91104);let xg;const $g=(e,t)=>(xg||(xg=Mg.createClient({key:t})),new Promise((t=>{xg.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)}))}))),Vg=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,l.is)(Object,t)&&(t=""),t},Gg=(e,t)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(Ps).flatMap((e=>{let r;return e.type==t&&(r=[Vg(e)]),(0,l.is)(Object,e.value)&&(r=(r||[]).concat(Gg(e.value,t))),r})),Wg=e=>e&&e.length>0,Bg=(e,t)=>[].concat(e&&e.attributes?Gg(e.attributes,t):[]).filter(l.identity);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 qg=(e,t,r,n,i,a)=>{if(e&&e.type){const t=dn(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){Yg(e,t,r[t])}))}return e}({},e,{attributes:{[i]:[n]}}));const a=(t.geoLocationAttributes||[]).map((t=>{return r=Bg(e,t.latitude),n=Bg(e,t.longitude),Wg(r)&&Wg(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(Wg(t)&&t[0].value&&Wg(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?$g(n.label,a).catch((()=>null)):Promise.resolve(null)},Hg=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=dn(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 qg(a,o,e,s,u,r).then((e=>!e&&a.label&&""!==a.label?$g(a.label,r).catch((()=>null)):e)).then((e=>ne(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)))},Jg=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=dn(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=Bg(t,r.latitude),n=Bg(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([Jg(e,t),Hg(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 Kg(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){Xg(e,t,r[t])}))}return e}function Xg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zg=(e,t)=>t.values.map(Lo(e,t.entityTypeUri)),Zg=(e,t,r)=>fl(t.fieldName,r)||Ur(e,et(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),e_=(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?$v(e,t):e}),r)},t_=(0,l.path)(["attrType","label"]),r_=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>Kg({},e,{[t]:!0})),{});e[r]=e[r]?Kg({},e[r],n):n}return e}),{}),n_=(0,l.pipe)((0,l.prop)("values"),E),i_=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",Jn.type.name)),a_=e=>e.type===l_.NUMERIC_RANGE_FACET,o_=e=>e.type===l_.DATE_RANGE_FACET,s_=(0,l.either)(a_,o_),l_={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},u_=e=>{switch(null==e?void 0:e.name){case Jn.type.name:return l_.ENTITY_TYPE_FACET;case Jn.createdBy.name:case Jn.updatedBy.name:case Jn.sourceSystems.name:case Jn.tags.name:case Jn.roles.name:case Jn.matchRules.name:case Jn.MLRecommendedMatch.name:return l_.WITH_DROPDOWN_CHECKBOXES_FACET;case Jn.createdTime.name:case Jn.updatedTime.name:case Jn.startDate.name:case Jn.endDate.name:return l_.DATE_RANGE_FACET;case Jn.matches.name:case Jn.matchScore.name:return l_.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return l_.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return l_.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return l_.DATE_RANGE_FACET;default:return l_.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},c_=(0,l.pipe)(Zg,u_),p_=(0,l.pipe)((0,l.path)(["attrType","type"]),Gr),d_=(0,l.cond)([[a_,(0,l.always)(On.IN_RANGE)],[o_,(0,l.always)(On.WITHIN)],[(0,l.allPass)([p_,e=>e.values.length>=2]),(0,l.always)(On.EXISTS)],[l.T,(0,l.always)(On.EQUALS)]]),y_=(0,l.cond)([[o_,(0,l.prop)("values")],[a_,(0,l.prop)("values")],[p_,e=>1===e.values.length?e.values.map(le):[]],[(0,l.pipe)((0,l.path)(["values",0]),Array.isArray),(0,l.prop)("values")],[l.T,e=>[e.values]]]);function f_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const T_=(0,l.pipe)((0,l.path)(["attrType","type"]),kr),E_=(0,l.pipe)((0,l.path)(["attrType","type"]),xr),m_=(0,l.pipe)((0,l.prop)("attrType"),El),h_=(0,l.pipe)((0,l.prop)("attrType"),Tl),b_=e=>t=>t.values.map((t=>dn(e,t).label)).join(" , "),O_=(0,l.when)((0,l.propSatisfies)((0,l.gt)(l.__,1),"length"),(0,l.join)(" – ")),v_=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(de().number),O_)),(0,l.join)(","))(e.values);return`${t_(e)}: ${t}`},g_=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(w),O_)),(0,l.join)(","))(e.values);return`${t_(e)}: ${t}`},__=e=>t=>`${t_(t)}: ${zg(e,t).join(", ")}`,A_=e=>t=>{const r=e_(e,t);return`${t_(t)}: ${r.join(", ")}`},N_=(0,l.curry)(((e,t,r)=>(0,l.map)((0,l.cond)([[h_,b_(e)],[E_,v_],[T_,g_],[m_,__(e)],[l.T,A_(t)]]),r))),P_=(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){f_(e,t,r[t])}))}return e}({},t,{attrType:Zg(e,t,n)}))),N_(e,r))(t),R_=new RegExp(`^${de().text("Search")}`),S_=(e,t,r,n)=>{let{uiState:i}=t;const{facets:a,keyword:o,advanced:s,readableQuery:u}=i;return(0,l.isEmpty)(s)?[...P_(e,a,r,n),...o?[o.value]:[]]:[(0,l.replace)(R_,"",u)]},w_=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values)(wn),I_=e=>(e=>w_.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]=oc(t);return e.replace(r,i).replace(n,a)}),e))(e),U_=(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}`})),C_={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},D_=e=>[C_.geoPolygon,C_.onMapMove].includes(e),L_=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},j_=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},k_=(e,t)=>D_(e)?t.map(L_):[j_(t)],F_=e=>D_(e)?de().text("Geo Polygon"):de().text("Geo Location"),M_=e=>{switch(e){case C_.geoLocation:return"geoLocation";case C_.geoPolygon:case C_.onMapMove:return"geoPolygon"}},x_={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},$_=e=>de().text(e),V_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[On.EQUALS]:"=",[On.NOT_EQUALS]:"≠",[On.STARTS_WITH]:"*",[On.MISSING_VALUE]:de().text("missing value"),[On.HAS_ALL]:de().text("has all"),[On.IN_RANGE]:de().text("in range"),[On.FULL_TEXT]:de().text("full text"),[On.EXISTS]:de().text("exists"),[On.COUNT_EQUALS]:`${de().text("count")} =`,[On.COUNT_NOT_EQUALS]:`${de().text("count")} ≠`,[On.COUNT_LT]:`${de().text("count")} <`,[On.COUNT_LTE]:`${de().text("count")} <=`,[On.COUNT_GT]:`${de().text("count")} >`,[On.COUNT_RANGE]:de().text("count range"),[On.LT]:"<",[On.LTE]:"<=",[On.GT]:">",[On.GTE]:">=",[On.IN_FILE]:de().text("in file"),[On.NOT_IN_FILE]:de().text("not in file"),[On.CONTAINS]:"~",[vn.LIST_EQUALS]:"=",[vn.NOT_LIST_EQUALS]:"≠",[vn.LIST_EQUALS_CASE_SENSITIVE]:"=",[vn.NOT_LIST_EQUALS_CASE_SENSITIVE]:"≠"}[e]||de().text(e.toLowerCase())},G_=e=>({type:x_.operator,text:e}),W_=e=>({type:x_.operator,text:$_(e)}),B_=e=>({type:x_.attributeLabel,text:e}),Y_=e=>({type:x_.specialAttributeLabel,text:e}),q_=e=>({type:x_.attributeFilter,text:V_(e)}),H_=e=>({type:x_.attributeValue,text:e}),J_=e=>({type:x_.entityTypeLabel,text:e}),Q_=()=>({type:x_.space,text:" "}),K_=()=>({type:x_.bracket,text:"("}),X_=()=>({type:x_.bracket,text:")"}),z_=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),Z_=(0,l.curry)(((e,t)=>t.map(z_(e)))),eA=(0,l.curry)(((e,t,r)=>[e,...r,t])),tA=eA(K_(),X_()),rA=eA(Q_(),Q_()),nA=(0,l.curry)(((e,t)=>[e,...t])),iA=e=>nA(J_(e)),aA=e=>nA(J_(`${e}: `)),oA=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=ju(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=Du(s),a=Lu(s);!r&&t&&n&&(i.push(K_()),r=!0),i.push(o),r&&a&&(i.push(X_()),r=!1);const l=e?W_(s):G_(s);i.push(...rA([l]))}else i.push(o),r&&(i.push(X_()),r=!1)}return i}},sA=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),lA=(0,l.pipe)(oA({localizable:!1}),sA),uA=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},cA=e=>{let{data:t,values:r,filter:n}=e;return t&&wc({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},pA=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(cA)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),dA=(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)&&[On.HAS_ALL,On.EQUALS,On.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})))),qv),yA=(e,t)=>(0,l.pipe)(dA,Hv(t))(e),fA=(0,l.pathEq)(["data","fieldName"],Jn.type.name),TA=(0,l.path)(["data","entityTypeUri"]),EA=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),mA=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(As(e)),attributes:(0,l.filter)((0,l.pipe)(TA,(0,l.anyPass)([l.isNil,As(e),r=>{const n=(t.entityTypes||[]).filter(As(e));return(n.length>1?mn(e,n):null)===r&&!!dn(e,r)}])))})(t))))),hA=e=>(0,l.pipe)((0,l.prop)("filter"),Ou,(0,l.equals)(e)),bA=(0,l.curry)(((e,t,r,n,i,a)=>{const o=fl(n.fieldName)||n.attrType,s=ec(o,i),u=Jv({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>Rr(s),()=>(0,l.is)(Object,a)&&a.lookupCode?$v(a.lookupCode,a.value):Gv(r,Pr(o),a)],[()=>El(s),()=>Lo(e,n.entityTypeUri,a)],[()=>ml(s),()=>ns(e,a)],[()=>_l(s),()=>os(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>xr(c)||Gr(c)),Qu),H_)()})),OA=(e,t,r,n)=>{const i=bA(e,t,r,n.data,n.filter);return(0,l.cond)([[hA(0),(0,l.always)([])],[(0,l.both)(hA(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:x_.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[Q_(),...(0,l.pipe)(l.flatten,(0,l.map)(i),Z_({type:x_.punctuationMark,text:", "}))(t)]}]])(n)},vA=(e,t)=>{const r=!!fl(e.data.fieldName);return(0,l.pipe)(uA,r?Y_:B_)(e,t)},gA=(e,t,r,n,i)=>[vA(n,i),Q_(),q_(n.filter),...OA(e,t,r,n)],_A=(0,l.addIndex)(l.map),AA=(0,l.propEq)("length",1),NA=(0,l.propSatisfies)((0,l.lt)(1),"length"),PA=(0,l.complement)(l.isEmpty),RA=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)(Mu,(0,l.filter)(cA),xu,(0,l.map)((n=>({operand:gA(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,oA()))(n)},SA=(0,l.pipe)(RA,l.flatten),wA=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>_p(e,{type:t}))).join(", ");return r?t(r):l.identity},u=RA(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(iA),(0,l.pipe)(s(aA),(0,l.unless)((()=>AA(u)||i),tA)))(u)},IA=(e,t,r,n)=>(0,l.pipe)(Mu,(0,l.filter)(pA),xu,_A(((n,i,a)=>({operand:wA(e,t,r,n,AA(a)),operator:n.operator}))),oA(),l.flatten)(n),UA=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),oA(),l.flatten),CA=e=>{let{searchType:t,values:[r]}=e;return k_(t,r).join(", ")},DA=(e,t,r,n,i,a)=>{const o=(e=>e?[Y_(e.isRawFilter?de().text("Raw filter"):de().text("Search")),...rA([q_(On.EQUALS)]),H_(`"${e.value}"`)]:[])(i),s=(e=>e?[Y_(F_(e.searchType)),Q_(),H_(CA(e))]:[])(a),u=(0,l.pipe)(IA,(0,l.when)((e=>NA(e)&&(PA(o)||PA(s))),tA))(e,t,r,n);return UA([o,s,u])},LA=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),jA=(0,l.pipe)(DA,LA),kA=(0,l.has)("attributes"),FA=Array.isArray,MA=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),xA=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=$A(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)(MA(a))),tA),(0,l.concat)(rA([G_(o)]))))(s)},$A=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return kA(n)?xA(e,t,r,n,i):FA(n)?n.reduce(((n,a)=>n.concat($A(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(rA([G_(n.operator)])))(gA(e,t,r,n,i))},VA=(e,t,r,n,i)=>(0,l.pipe)($A,l.flatten)(e,t,r,n,i);function GA(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){WA(e,t,r[t])}))}return e}function WA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const BA=(0,l.complement)(fA),YA=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(fA),(0,l.map)((0,l.prop)("values")),l.flatten,l.uniq)(e),r=(0,l.pipe)((0,l.map)(TA),(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}},qA=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=YA(t);return(r||n)&&ku(t)},HA=(0,l.ifElse)((0,l.all)((0,l.has)("entityTypes")),l.identity,(0,l.pipe)((e=>{const t=[],r=e.filter((0,l.complement)(qA)),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(fA).some((0,l.propEq)("filter",On.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}=YA(r);if(qA(e))t.push(GA({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter(BA)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(fA,(0,l.pipe)((0,l.prop)("values"),l.flatten),(0,l.pipe)(TA,(e=>[e]),(0,l.reject)(l.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(BA),entityTypes:n,operator:i?a:e.operator,id:(0,Ce.x0)()}}));t.push(...n)}var a;return t})(t))),[]))),JA={[On.EQUALS]:On.ON,[On.IN_RANGE]:On.WITHIN,[On.GTE]:On.AFTER,[On.GT]:On.AFTER,[On.LTE]:On.BEFORE,[On.LT]:On.BEFORE},QA=(0,l.curry)((e=>JA[e]||e)),KA=(0,l.curry)(((e,t)=>{switch(e){case On.LT:return[f()(t[0]).subtract(1,"day").valueOf()];case On.GT:return[f()(t[0]).add(1,"day").valueOf()];default:return t}})),XA=(0,l.pipe)((0,l.path)(["data","attrType","type"]),kr),zA=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>GA({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return XA(e)?(0,l.evolve)({filter:QA,values:KA(t)},e):e}))})))})),ZA=(0,l.evolve)({values:(0,l.when)((0,l.pipe)((0,l.prop)(0),rc),(0,l.map)(oc))}),eN=(0,l.map)((0,l.cond)([[XA,ZA],[l.T,l.identity]])),tN=(0,l.curryN)(3,((e,t,r,n,i)=>(0,l.pipe)((0,l.defaultTo)([]),HA,mA(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")),eN)})),zA,(0,l.reject)(EA))(r)));function rN(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){nN(e,t,r[t])}))}return e}function nN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const iN=(e,t)=>({data:{uri:it(e.fieldName)?et(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||d_(e),id:(0,Ce.x0)(),values:y_(e)}),aN=(0,l.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=fl(a,t,r)||Ur(e,i);if(!s)return null;if(mr(s))return rN({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=_p(e,{type:o}),i=(Ir(e,et(a,o),o)||[]).map((0,l.pick)(["label","name"])).slice(0,-1);return rN({},n,{attrType:s,title:t,pathToTitle:Array.isArray(i)?[r,...(0,l.chain)((0,l.prop)("label"),i),t]:[r,t]})}})),oN=(0,l.curry)(((e,t,r,n)=>tN(aN,e,n,t,r)));function sN(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){lN(e,t,r[t])}))}return e}function lN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const uN=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},cN=e=>"rdmLookups.not.resolved"===e?Jn.notResolved.name:e,pN=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===Nn?On.IN_RANGE:Pn(a),u=cN(n),c=fl(u)||Ur(e,i),p=(0,l.cond)([[()=>Au(s),(0,l.map)((0,l.when)((0,l.both)((0,l.has)("link"),(0,l.complement)((0,l.has)("filename"))),(e=>sN({},e,{filename:Fv(e)}))))],[()=>Gr(null==c?void 0:c.type),(0,l.map)(le)],[e=>gu(s)&&!Array.isArray(e[0])&&!kr(null==c?void 0:c.type),ie],[l.T,l.identity]])(o);return{id:(0,Ce.x0)(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===Nn?"and not":"and",filter:s,values:p}})),dN=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(pN(e,mn(e,i)));return[{id:(0,Ce.x0)(),operator:"or",attributes:a,entityTypes:i}]})),yN=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),fN=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([yN("from"),yN("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,()=>[]]]),TN=(e,t)=>{const r=(0,l.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return sN({},r,{values:fN(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?ul(e.fieldName,n):e.fieldName})},EN=(e,t)=>{if((0,l.has)("children")(e)){const r=TN(e,t);return e.children.reduce(((e,n)=>(e.push(EN(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return TN(e,t)},mN=(0,l.cond)([[(0,l.has)("searchParameters"),e=>{const t=[];return(0,l.has)("values",e)&&t.push(TN(e)),(0,l.propOr)([],"searchParameters",e).forEach((r=>t.push(sN({fieldName:e.fieldName},TN(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(EN,l.flatten)],[l.T,TN]]),hN=(0,l.pipe)((0,l.map)(mN),l.flatten),bN=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},ON=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=dN(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:hN(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>sN({},t,{type:c_(e,t)}))).map((e=>sN({},e,{values:s_(e)?bN(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 iN(r,t)})),operator:"or",id:(0,Ce.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=>({[cN(t)]:e[t]}))),l.mergeAll)(e)}(o),p=[sN({},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 oN(e,t,r,p)},vN=(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)(n_),(0,l.partition)(i_))(t),i=n.map((t=>rN({},t,{type:c_(e,t)}))).map((e=>iN(e))),a=r.values||[];return[{attributes:i,operator:"or",id:(0,Ce.x0)(),entityTypes:a}]})(e,a);return oN(e,t,r,o)})(e,t,r,n):ON(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},gN=e=>"2.0"===e.version?e.keyword:uN(e),_N=e=>(0,l.pathEq)(["object","uri"],e),AN=(e,t)=>(0,l.pipe)((0,l.find)(_N(e)),(0,l.prop)("object"))(t),NN=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"),_N(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=AN(r.match,t)||n[r.match];return i?{label:tp((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return Do(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)},PN=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,l.pick)(["uri","type","label"],r),e}),{}),RN=(0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)]),SN=(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:tp((0,l.prop)("label",o)),matchRules:i.concat(a).map((function(t){return Do(e,o.type,t)||{label:t,uri:t}}))}})))(t),wN=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)},IN=(0,l.path)(["object","uri"]),UN=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return e.find((e=>{let{uri:r}=e;return r===t}))},CN=e=>void 0!==(null==e?void 0:e.relevance),DN=e=>CN(e)?100*e.relevance+"%":"",LN=e=>{let t=[];return{addChild:e=>{t=(0,l.append)(e,t)},getValue:()=>e,getChildren:()=>t,removeChild:e=>{t=(0,l.without)([e],t)}}},jN=e=>e.getValue(),kN=(e,t)=>{let r=null;if(t(e.getValue()))return e;const n=e.getChildren();for(let e=0;e<n.length&&(r=kN(n[e],t),!r);e++);return r},FN=(e,t)=>{const r=[],n=(0,l.pipe)(jN,t),i=(0,l.pipe)(l.map,l.flatten),a=e.getChildren();a.some(n)&&r.push(e);const o=i((0,l.partialRight)(FN,[t]),a);return r.push.apply(r,o),r};function MN(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){xN(e,t,r[t])}))}return e}function xN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $N=(e,t)=>!!e[t],VN=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},GN=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||[]])},WN=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return MN({},t,{[r.uri]:MN({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:GN(null==o?void 0:o.parents,n),children:GN(null==o?void 0:o.children,i),values:GN(null==o?void 0:o.values,a,(0,l.prop)("uri"))})})},BN=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=dn(r,t)||Mi(r,t),i=(0,l.either)((0,l.both)((0,l.prop)("dependentLookupAttributes"),(0,l.prop)("dependentLookupCode")),(0,l.prop)("children"));return ys(r,n,i).flatMap(Ts).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=WN({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>WN({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},YN=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!Ge(e.uri)&&Je(e.type)&&Je(t)&&!t.startsWith(e.type))(n,t))return e;const i=Vs(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(Ps),(0,l.map)(VN))(i);return WN({structure:e,attrType:e[t].attrType,values:a})}),t)},qN=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 $N(e,r)}));return r||n?t.filter(Ps).reduce(((e,t)=>qN({structure:e,attributeValue:t})),e):e}),t);{const e=r;return $N(t,e.type)?WN({structure:t,attrType:t[e.type].attrType,values:[VN(e)]}):t}},HN=e=>{let{structure:t,uri:r}=e;return(0,l.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?MN({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},JN=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=Vs(i,n,r)||[];return a.length?WN({structure:t,attrType:t[r].attrType,values:a.filter(Ps).map(VN)}):t},QN=(e,t,r)=>{const n=Ye(e),i=Ye(t);return n===i?((e,t)=>{const r=st(t),n=st(e);return Ke(n,r)||((e,t)=>at(e)&&!at(t)&&Ke(t,e))(n,r)})(e,t):!(!r||!ot(t))&&yh(r,i).includes(n)},KN=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},XN=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?ph(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return QN(r,t,o)}))},zN=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>zN(e,t,r)))))},ZN=(e,t)=>{var r;return null==e||null===(r=e[t])||void 0===r?void 0:r.isTouched},eP=(e,t,r,n,i)=>{let{uri:a,value:o}=r;const s=a!==t&&KN(n,e);return{type:e,uri:a,lookupValue:o,autopopulate:s,useDefaultValue:s&&!ZN(i,a)}},tP=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s,editorsState:l}=e;const u=t[r],c=Ye(n),p=dh(c,o,i,a),d=zN("children",t,u),y=zN("parents",t,u),f=d.flatMap((e=>zN("parents",t,e))).filter((e=>![...y,u,...d].includes(e))),T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return QN(t,n,p)})).map((t=>eP(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 QN(n,t,p)||Ye(t)!==c&&QN(t,n,p)})).map((t=>eP(e.attrType.uri,n,t,s,l))))),m=f.flatMap((e=>{const r=zN("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)&&QN(n,t,p)}))})).map((t=>eP(e.attrType.uri,n,t,s,l)))}));return[...u.values.filter((e=>{let{uri:t}=e;return QN(t,n,p)})).map((e=>eP(r,n,e,s,l))),...E,...m,...T]},rP=async e=>{let{attributeType:t,attributePresentations:r,value:n}=e;const i=Jv({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=>Zc(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 cu([{codeValue:r,type:n}]).then((e=>{if(Array.isArray(e))return Gv(e[0],n,r)}))})(n)],[l.T,()=>s(n)]]);return await u(t)},nP=e=>{let{value:t,attributeType:r,entityType:n=""}=e,i=[{fieldName:"type",filter:On.EQUALS,values:[n]}];return Array.isArray(t)?i=i.concat(iP(r,t)):i.push(aP([t],r)),i},iP=(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)?iP(i,t[r]):[aP(t[r],i)];return e.push(...a),e}}),[])},aP=(e,t)=>e&&e.length&&!(0,l.isNil)(e[0])&&""!==e[0]?{fieldName:Nr(t.uri),filter:t.type===zt.TYPE_BLOB?On.FULL_TEXT:On.EQUALS,values:e}:{fieldName:Nr(t.uri),filter:On.MISSING_VALUE},oP=(e,t)=>(0,l.equals)(JSON.parse(JSON.stringify(e)),JSON.parse(JSON.stringify(t))),sP=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:oP}},lP={AttributesDiff:o,AttributesEditor:a,HistoryManager:s},uP={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=9291.js.map