@reltio/remotes 1.4.1443 → 1.4.1444

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/7140.js +1 -1
  2. package/7140.js.map +1 -1
  3. package/package.json +1 -1
package/7140.js CHANGED
@@ -1,2 +1,2 @@
1
- (self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[7140],{22143:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>tl,IL3:()=>Kf,PY2:()=>gn,Ng6:()=>Ue,YJ7:()=>mn,NlI:()=>on,XYV:()=>fn,Xt7:()=>Ne,wfT:()=>ai,EMD:()=>Hn,HAc:()=>Re,PEf:()=>Rn,oA3:()=>qn,$XE:()=>He,eWf:()=>Nn,q7e:()=>Se,KVe:()=>oi,WVQ:()=>Cr,oZZ:()=>Ti,bNA:()=>Ei,Rjq:()=>mi,G39:()=>wn,W0P:()=>rt,X1H:()=>Ze,hdG:()=>at,ws7:()=>ot,VI$:()=>it,yn8:()=>We,N0y:()=>Ge,dZX:()=>Qe,bQt:()=>bi,oS0:()=>lt,KfU:()=>Pe,bZE:()=>dn,Nsj:()=>bn,psV:()=>En,xPW:()=>_n,pyR:()=>Zn,p8l:()=>Kn,Wkf:()=>Ae,zHr:()=>_e,NIO:()=>ge,$26:()=>kg,Esk:()=>Vn,s9T:()=>$e,MEy:()=>$u,j5E:()=>an,vAw:()=>Yn,NMQ:()=>Bn,eVu:()=>ac,YGb:()=>tt,mNm:()=>Xn,Y1q:()=>Xm,s_5:()=>ei,RgZ:()=>Jn,unl:()=>fi,Qy0:()=>hi,pYu:()=>$n,wIJ:()=>o_,GFH:()=>De,Ury:()=>In,S91:()=>Un,p3$:()=>_i,wSh:()=>ee,BDP:()=>ji,pGS:()=>zn,ARY:()=>ut,XGc:()=>ii,fO_:()=>Yr,wwy:()=>Fe,h_8:()=>Dn,_XL:()=>hn,j2V:()=>si,dMV:()=>ri,NBX:()=>aN,OXy:()=>ct,BXd:()=>Be,KM9:()=>Ie,CJB:()=>ci,lXI:()=>Xe,nqG:()=>vi,C68:()=>Sn,yxQ:()=>Oi,Yj_:()=>Me,D25:()=>Le,ZIY:()=>Ke,Tl4:()=>y_,lwr:()=>Pn,NkU:()=>li,Rtp:()=>ni,YGx:()=>Ye,uTS:()=>ti,MCv:()=>we,IYE:()=>Qn,PiC:()=>yi,MVv:()=>nt,h_m:()=>ze,DUe:()=>yn,tJI:()=>Ce,fDt:()=>je,cNQ:()=>ui,SwE:()=>Gn,ZHR:()=>di,PYu:()=>et,lD1:()=>Cn,lVm:()=>qe,vnX:()=>og,$x5:()=>sg,_R1:()=>ig,wUm:()=>ag,z7V:()=>gi,dC6:()=>Ve,MBD:()=>ke,GmF:()=>da,cKm:()=>Je,iP_:()=>An,NVC:()=>xe,tPT:()=>Sl,tZe:()=>dT,kRE:()=>ME,psB:()=>xE,X0$:()=>Rl,zE1:()=>Ml,Wm5:()=>ml,vyX:()=>Vc,wLZ:()=>wl,W4V:()=>le,EtK:()=>ks,Wtd:()=>Pl,asT:()=>mN,kGs:()=>Ah,ewt:()=>yd,O_f:()=>Cu,sOy:()=>Lt,Tde:()=>pr,LMI:()=>Ac,skb:()=>rA,sPt:()=>Tc,sH1:()=>Ec,lPZ:()=>Dy,bG8:()=>Cy,_LJ:()=>jy,RPM:()=>xd,h27:()=>jc,Uqd:()=>$c,xG:()=>TA,Z2f:()=>bv,fgW:()=>k_,I69:()=>sA,ZxB:()=>uA,dwd:()=>Uy,F$g:()=>Iy,mdt:()=>$h,Qbq:()=>ch,rny:()=>Ki,UEY:()=>Da,Q0T:()=>Ca,Lyr:()=>$a,sBn:()=>Ua,itK:()=>Ra,H9$:()=>Ia,KPc:()=>wa,zos:()=>Sa,ELQ:()=>Va,dZs:()=>ma,Cz4:()=>Ea,z_L:()=>Ma,fGe:()=>Ta,iuF:()=>Na,Wib:()=>Pa,Hn0:()=>xa,obS:()=>Ga,E$L:()=>ha,XUh:()=>Aa,Qp_:()=>ga,_jk:()=>ba,sKE:()=>Oa,WmG:()=>_a,QKx:()=>ka,Oik:()=>La,s0A:()=>va,o9m:()=>ja,MCd:()=>Fa,RsS:()=>Lc,tGK:()=>su,lIv:()=>xl,Vg3:()=>ra,mkC:()=>Wi,xv5:()=>ia,a14:()=>Yi,yv0:()=>na,Zm0:()=>Bi,Nxd:()=>Gi,$mM:()=>ta,ifj:()=>jr,NWi:()=>$v,xr3:()=>xv,wNf:()=>mu,iJH:()=>Vv,d89:()=>xi,Edd:()=>$i,Z5t:()=>Vi,uGe:()=>ki,UoR:()=>Li,xvW:()=>Mv,$qe:()=>Fv,yPM:()=>fa,$cp:()=>Fl,vKJ:()=>Ll,VtG:()=>af,AID:()=>km,B1H:()=>nN,b7X:()=>sh,$uE:()=>Rh,keo:()=>uh,C_p:()=>gy,G27:()=>Yb,JA0:()=>RE,b3T:()=>_h,oC6:()=>vh,_Zs:()=>gh,epC:()=>wh,YYG:()=>Sh,f_2:()=>wE,w3l:()=>xA,QHB:()=>Bb,Jso:()=>qA,RXH:()=>wb,Vr9:()=>eO,lMm:()=>XO,BlA:()=>RN,fmQ:()=>Ss,yRD:()=>PA,NcL:()=>Sy,QK6:()=>fe,ymd:()=>Qf,JV_:()=>em,XiW:()=>qp,Yrx:()=>fE,GPx:()=>Nl,gjI:()=>Al,vlo:()=>Ud,E_P:()=>jh,aAL:()=>Lf,NBq:()=>ws,wp9:()=>xh,DsR:()=>wf,MPc:()=>Cp,gWE:()=>Dp,DT_:()=>jp,ipn:()=>kp,ORg:()=>Ii,_wz:()=>Lp,RYR:()=>ld,PP2:()=>bE,wS7:()=>Sv,cBQ:()=>yf,pBq:()=>Om,DsO:()=>te,X78:()=>rm,xZs:()=>JE,YFy:()=>EE,Gmt:()=>WE,K$w:()=>GE,DSj:()=>kf,Mfr:()=>mE,k9j:()=>Tf,EjS:()=>X,ww$:()=>Il,WVU:()=>VE,hxF:()=>bl,n6p:()=>Br,E7G:()=>wp,nwO:()=>IN,Mzk:()=>lf,aFF:()=>Eh,HRH:()=>Wu,EZK:()=>Zc,Kxm:()=>Kc,Z9i:()=>ny,CrF:()=>jE,DNd:()=>Ba,vUy:()=>gN,lJh:()=>Hu,zHo:()=>Qu,sEJ:()=>sN,UO$:()=>Pm,zeJ:()=>mr,dLR:()=>$s,JQy:()=>zs,XtP:()=>Ms,Ug0:()=>tn,A1W:()=>lh,sw:()=>zc,nv3:()=>Kv,JgD:()=>Qv,nve:()=>lN,SkP:()=>Zs,SAs:()=>gm,i5L:()=>el,PWK:()=>Wo,IM5:()=>xs,Aup:()=>Zb,Mfk:()=>rv,HQx:()=>ns,oN$:()=>rs,mB6:()=>gv,p6d:()=>w,o0x:()=>U,ufS:()=>uv,k7L:()=>cv,mrB:()=>I,OuZ:()=>ep,ncP:()=>wt,W$R:()=>tp,JOV:()=>_t,Zmi:()=>At,hm5:()=>Pt,ECL:()=>Fr,vPL:()=>rp,qmL:()=>Jm,hPi:()=>hm,hXd:()=>Xi,OCS:()=>zi,p2l:()=>nl,qF1:()=>Jf,_X$:()=>Xf,yj2:()=>r_,bzh:()=>Wh,k66:()=>Zo,kiP:()=>To,pSg:()=>pe,kz_:()=>_E,H_U:()=>ts,t9e:()=>Xa,j2$:()=>yT,PFL:()=>er,aJ3:()=>Rg,To9:()=>dr,wpo:()=>gp,ADq:()=>zd,UUb:()=>Jd,tQX:()=>Xd,xy8:()=>ir,EUG:()=>hr,AFK:()=>Vt,X3M:()=>Er,WN0:()=>es,kDl:()=>Vs,uDV:()=>Km,IhQ:()=>Hs,pfb:()=>Ks,R$r:()=>Dh,w80:()=>Uo,Pfu:()=>Ka,Gtj:()=>zl,fyF:()=>Xl,kkq:()=>zo,u5q:()=>It,O$n:()=>Op,ptG:()=>vp,f4_:()=>zh,uap:()=>Xh,d7q:()=>yE,liG:()=>OE,$oF:()=>dE,avf:()=>vd,DiQ:()=>Od,cfX:()=>bd,vD3:()=>_d,Qrb:()=>hd,EJQ:()=>gd,HWy:()=>md,gjS:()=>pd,y6v:()=>Ed,JUW:()=>IE,GtP:()=>pb,_kX:()=>qa,u1e:()=>Ha,sJj:()=>yh,CJp:()=>ub,uKF:()=>dh,wo0:()=>FE,s5:()=>qo,cwx:()=>Yo,Y6b:()=>rE,TTx:()=>HE,UtR:()=>nE,HaQ:()=>QE,E6I:()=>DE,Won:()=>aE,vTU:()=>eE,Nsy:()=>cp,KMQ:()=>Th,Do$:()=>fp,CSV:()=>ol,TMe:()=>iE,l1V:()=>Ju,RHh:()=>ic,VQ1:()=>rc,cGG:()=>tc,z7d:()=>Cd,Xaq:()=>os,Sj8:()=>NN,PJj:()=>iu,k3T:()=>nn,PjQ:()=>Ci,s7l:()=>zy,jLA:()=>db,GGR:()=>Rd,j5q:()=>Nd,DnY:()=>Ky,RY5:()=>Wm,Px$:()=>ud,KPC:()=>eN,NIY:()=>of,HvW:()=>ef,Fof:()=>za,BXy:()=>tf,fX:()=>yb,BTI:()=>Ep,uie:()=>ap,q27:()=>Ap,vrC:()=>yO,fAQ:()=>om,XkT:()=>Qy,lrH:()=>sm,nt9:()=>Jr,XH8:()=>bp,XH2:()=>rn,jFi:()=>hp,qhs:()=>Io,wwR:()=>Tp,Uk3:()=>Gt,$Rg:()=>Kt,ev7:()=>iN,RB9:()=>PE,iFp:()=>Vd,e$p:()=>Wd,PcX:()=>Bd,SpP:()=>Gd,R6_:()=>wg,CY1:()=>Fg,Ajk:()=>Wy,Yiz:()=>Gy,FK9:()=>ky,UOo:()=>pv,aTW:()=>YE,uug:()=>Eu,P$2:()=>$g,XS2:()=>lu,Hyb:()=>Su,d3Y:()=>Yc,Klp:()=>Hc,WxZ:()=>Vg,Gzu:()=>Ku,ZOr:()=>Hy,uqV:()=>XT,Pm4:()=>ne,hWO:()=>Mt,nHA:()=>tb,nVD:()=>Ym,_tF:()=>lc,dED:()=>cE,P2h:()=>uE,jrr:()=>co,mmY:()=>yo,T6O:()=>is,h6J:()=>uT,hM2:()=>KA,XR6:()=>z,jmz:()=>Qm,IHt:()=>Hm,NZI:()=>ry,wdF:()=>im,YNv:()=>oh,IFm:()=>ah,o_F:()=>Zm,kgP:()=>am,ZYI:()=>Bf,QXK:()=>Hl,efz:()=>Ql,Q5d:()=>ql,Ysv:()=>Kl,UWq:()=>Ld,ocC:()=>jd,io3:()=>Zr,Sbt:()=>Do,roS:()=>Co,Ww1:()=>jo,QaS:()=>uf,wsP:()=>Oe,ERZ:()=>FA,CL1:()=>JA,idV:()=>Xc,nIW:()=>Ft,fjE:()=>Ig,sG0:()=>fv,tV7:()=>au,g8o:()=>p_,Qy:()=>c_,t2P:()=>Pg,KbW:()=>Oo,wId:()=>go,LS0:()=>_o,bFH:()=>MT,Rgl:()=>$T,fW1:()=>Bh,GFW:()=>KE,Ywp:()=>eg,pg:()=>OT,WSA:()=>VT,fed:()=>HA,tT_:()=>Qs,BgZ:()=>Js,xIV:()=>Xs,KbL:()=>Xy,JBA:()=>qt,aNC:()=>Hv,RFJ:()=>Wf,Zeh:()=>Nm,OT5:()=>Zv,mC3:()=>Vl,kR6:()=>PN,gFw:()=>Zh,NVY:()=>Fh,k6v:()=>zf,FEC:()=>Zf,L5S:()=>Lh,Ob5:()=>Np,KUV:()=>Pp,dvH:()=>kh,V3i:()=>nO,VD3:()=>en,mm2:()=>ec,rou:()=>fm,izH:()=>Qa,DK$:()=>Ja,KMp:()=>jf,c31:()=>yt,mbo:()=>ey,gT8:()=>Et,CZ8:()=>Ps,uGi:()=>Cs,Poc:()=>pt,_9k:()=>Ls,ZTM:()=>Is,bwT:()=>Ds,tzW:()=>ht,tF$:()=>Tt,o96:()=>Rs,M4S:()=>js,_vs:()=>Rf,xF8:()=>dd,PUO:()=>mh,ATu:()=>Zd,j1S:()=>Si,V3K:()=>Pi,Lmx:()=>Ri,oSN:()=>Di,ZaZ:()=>dt,n_1:()=>ZT,N6e:()=>Uf,SxO:()=>po,w3p:()=>Mh,xU7:()=>ye,Y_p:()=>Fo,$k6:()=>ko,Gdl:()=>Ev,U6P:()=>Tv,OwB:()=>Sg,hTh:()=>qm,xqc:()=>Ho,JvE:()=>Qo,i29:()=>wc,dzT:()=>Hi,uPS:()=>df,cZV:()=>pf,n3B:()=>W_,e6O:()=>F_,s7j:()=>a_,j$Q:()=>UE,kW2:()=>cb,tH7:()=>Bo,Yxg:()=>pl,MaZ:()=>Pd,nqN:()=>Ad,jWj:()=>Fd,o_J:()=>ss,yW4:()=>cT,uT0:()=>sT,C82:()=>lT,bsH:()=>eb,u9Z:()=>ym,J$m:()=>zT,j_Q:()=>My,OaI:()=>xy,wB1:()=>rN,SP6:()=>bT,ZYr:()=>ZA,IMU:()=>Gf,FoU:()=>SE,DVz:()=>vv,mxe:()=>V_,FHr:()=>_m,D1g:()=>Tm,VO3:()=>pg,de5:()=>cg,Uw1:()=>me,J6q:()=>ty,XCe:()=>so,fbl:()=>tg,Ir:()=>ho,XQO:()=>bo,QXb:()=>UT,zXF:()=>zm,P8_:()=>zE,iiD:()=>Df,MOC:()=>CT,WF:()=>IT,xE1:()=>Ui,idW:()=>TN,QWZ:()=>ov,YL3:()=>sf,Fn9:()=>T,j2U:()=>rl,MpE:()=>bt,kQw:()=>rr,mfm:()=>wu,vZp:()=>Wt,E8K:()=>pN,VSb:()=>As,vr_:()=>tr,Vmh:()=>vN,FgW:()=>rO,oDv:()=>us,fGG:()=>sv,kuw:()=>ps,eHk:()=>kd,Tt2:()=>ls,pQZ:()=>ds,oZ7:()=>lv,T6Y:()=>Rr,_26:()=>Nu,YkM:()=>cr,J6y:()=>pu,njU:()=>bu,TBP:()=>cs,IT0:()=>iy,x_:()=>fh,FP6:()=>Qt,biM:()=>dp,TMl:()=>yp,Vkd:()=>gu,WiY:()=>jg,_zi:()=>_u,RZp:()=>wy,J6D:()=>Zu,Lt4:()=>vr,QEi:()=>fr,whI:()=>Hr,KIu:()=>Kr,JhM:()=>se,C_0:()=>Ir,lzc:()=>Sp,qIF:()=>B_,O27:()=>E,aBi:()=>_p,xOX:()=>El,EdS:()=>Dt,WgC:()=>Ct,eEv:()=>zt,A4t:()=>Ou,YOQ:()=>Yt,Wos:()=>Nr,jWr:()=>Wa,Or$:()=>ur,lhE:()=>zr,CwH:()=>yr,pzC:()=>yl,ymH:()=>hu,QZu:()=>sr,rYH:()=>Dg,FVt:()=>Ar,Kn2:()=>ce,jgw:()=>Iu,Qgr:()=>zu,OXP:()=>_s,lS4:()=>Tr,g5f:()=>Lg,fp6:()=>fu,Uty:()=>sa,YkG:()=>lr,xdS:()=>mt,kMF:()=>Fp,$NE:()=>jt,bC9:()=>Ut,Ian:()=>wi,KVV:()=>ph,q9e:()=>Lo,iIf:()=>mv,ian:()=>Ol,m6e:()=>Ur,OFd:()=>fl,kqr:()=>nr,fnZ:()=>qr,VFZ:()=>vl,ZiX:()=>Rt,j5n:()=>gr,zkt:()=>_,Pcm:()=>tN,QDV:()=>dl,M5u:()=>Cg,laD:()=>G_,mtq:()=>Xt,CtB:()=>hv,CBv:()=>oe,I0t:()=>wr,u1G:()=>Id,gk1:()=>x_,Bgb:()=>M_,uzs:()=>Qr,v0l:()=>dc,Zqp:()=>oE,j0k:()=>Go,tCm:()=>$t,gmx:()=>uu,mOr:()=>Vu,TwZ:()=>d_,GyU:()=>Jv,zGm:()=>_T,bMg:()=>YT,EyD:()=>Lv,FQA:()=>kv,fZN:()=>QT,xsF:()=>Dv,Lxg:()=>jv,O3l:()=>mf,Wni:()=>Ef,wRx:()=>Wv,OxG:()=>LT,uJQ:()=>jT,qWg:()=>Ov,i96:()=>vT,NPd:()=>qu,zhn:()=>Gv,G8q:()=>Ai,Jct:()=>nd,A9Y:()=>re,Y5F:()=>wA,gxP:()=>ue,c$P:()=>cu,M7o:()=>xc,BBN:()=>uo,ZBU:()=>J,UkJ:()=>Ao,xkv:()=>XE,z$M:()=>EN,KAm:()=>NE,lCl:()=>Fm,rkF:()=>_y,IU6:()=>hT,RGr:()=>h,aYu:()=>m,ije:()=>ru,Buf:()=>Cf,YLu:()=>tu,ct9:()=>xo,XkY:()=>qT,T5R:()=>AT,uQS:()=>KT,wcJ:()=>Mo,d$I:()=>Ul,rSp:()=>pp,Sx:()=>nf,Ilm:()=>$l,Ki6:()=>hl,VGk:()=>Sf,sFD:()=>Ib,eWN:()=>hN,dWE:()=>i_,Lkd:()=>Hp,aDL:()=>Rm,yaA:()=>JT,lOh:()=>mm,DBr:()=>_g,hK$:()=>ou,TZ_:()=>mT,CMB:()=>Y_,FU8:()=>rf,J$p:()=>Um,b5s:()=>Im,h2W:()=>xt,SL_:()=>cm,oUH:()=>iT,ck9:()=>NT,RAb:()=>sc,nL:()=>yv,k$p:()=>Cb,Xs0:()=>eu,u7I:()=>Em,rxg:()=>ju,bji:()=>Lu,oCZ:()=>hy,MjG:()=>ug,FuV:()=>nT,$ju:()=>oT,t6d:()=>aT,m5F:()=>Ee,sx:()=>bN,rSc:()=>_v,U10:()=>$y,L8n:()=>$E,R9X:()=>tE,rj2:()=>tm,_C4:()=>fT,tCj:()=>ZE,uAg:()=>TE,wx9:()=>fd,KF3:()=>TT,ax9:()=>ET,HH7:()=>If,ufV:()=>hE,_6y:()=>ff,XTh:()=>ng,AJo:()=>cf,Ixr:()=>CE,P6Y:()=>UN,Bd_:()=>fy,xkB:()=>yy,W41:()=>dm,WkI:()=>pm,sSE:()=>dy,GMd:()=>Nc,jtL:()=>Pc,Bxm:()=>Ey,FVh:()=>sy,U_T:()=>GT,FTe:()=>ae,VGB:()=>ie,tM8:()=>ku,Wfe:()=>Yu,Ls5:()=>Bu,$bd:()=>Mu});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:()=>K,getMomentFormatFromTimeMask:()=>Q,getStartOfDay:()=>R,isToday:()=>_,isValidMomentDate:()=>b,isValidMomentDateOrNull:()=>O,momentToDate:()=>v,parseTimestamp:()=>J,toLocalDate:()=>A,toUtcDate:()=>N});var a={};r.r(a),r.d(a,{addAttribute:()=>Ts,editAttribute:()=>Es,editEndDate:()=>gs,editRoles:()=>bs,editStartDate:()=>vs,editTags:()=>Os,removeAttribute:()=>hs});var o={};r.r(o),r.d(o,{applyCrosswalks:()=>Ah,collectCrosswalksFromAttributes:()=>Rh,compareActivenessAttributes:()=>_h,compareAttributes:()=>vh,compareImages:()=>gh,compareRoles:()=>wh,compareTags:()=>Sh});var s={};r.r(s),r.d(s,{createHistoryManager:()=>Ch});var l=r(17440);const u=e=>"string"==typeof e&&"function"==typeof e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e,c=(e,t)=>(t=(u(t)||"").toLowerCase(),(e=(u(e)||"").toLowerCase()).includes(t)),p=(0,l.curry)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n="asc"===e.toLowerCase();return t=t.toLowerCase(),r=r.toLowerCase(),t<r?n?-1:1:t>r?n?1:-1:0})),d=(0,l.replace)(/(\r\n|\n|\r)/gm,"");var y=r(95038),f=r.n(y);const T=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{startDate:t,endDate:r}=e,n=Date.now();return!(r&&r<n||t&&t>n)},E=(0,l.anyPass)([l.isEmpty,l.isNil]),m=e=>()=>new Promise(e),h=e=>Promise.all(e.map((e=>e.then((e=>({status:"fulfilled",value:e}))).catch((e=>({status:"rejected",reason:e})))))),b=e=>e&&e.isValid(),O=(0,l.either)(b,l.isNil),v=e=>e&&e.toDate(),g=e=>(e&&e.setHours(0,0,0,0),e),_=e=>f()(e).isSame(Date.now(),"day"),A=e=>{const t=new Date(e),r=new Date;return r.setFullYear(t.getUTCFullYear()),r.setDate(t.getUTCDate()),r.setMonth(t.getUTCMonth()),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"),j=(0,l.equals)("9999"),L=(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")],[L,(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")],[j,(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,Q=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},K=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)} ${Q(r)}`},J=e=>{const t=Number(e);return Number.isNaN(t)?e:t},X=e=>{const[t,r]=e;return f()().subtract(t,r).valueOf()},z=e=>e&&0!=e.length?e.split("").map((e=>e.charCodeAt())).reduce(((e,t)=>0|(e=(e<<5)-e+t)),0)+"":"0",Z=e=>({isNone:()=>(0,l.isNil)(e),extract:()=>e,orSome:t=>(0,l.isNil)(e)?t:e,map:t=>(0,l.isNil)(e)?ee.None():ee.Some(t(e))}),ee={Some:Z,None:()=>Z(null),chain:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return e=>t.reduce(((e,t)=>e.map(t)),e)},fromFalsy:function(e){return e?ee.Some(e):ee.None()},fromNull:function(e){return null==e?ee.None():ee.Some(e)},fromUndefined:function(e){return void 0===e?ee.None():ee.Some(e)},fromEmpty:function(e){return E(e)?ee.None():ee.Some(e)}},te=(e,t)=>{let r=null;return function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];const o=()=>{e.apply(this,i),r=null};r&&clearTimeout(r),r=setTimeout(o,t)}},re=(e,t)=>(r,n)=>{const i=t?(0,l.prop)(t):l.identity;return e.indexOf(i(r))-e.indexOf(i(n))},ne=(0,l.when)((0,l.is)(Array),(0,l.prop)(0)),ie=e=>Array.isArray(e)?e:[e],ae=e=>[e],oe=e=>!!e&&["www.","http://","https://","ftp://","ftps://","smb://","data:"].some((t=>String(e).toLowerCase().startsWith(t))),se=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase()),le=e=>se(e=e||"")?`mailto:${e}`:!e.includes("://")&&(e.toLowerCase().startsWith("www.")||e.split(".").length>2)?`http://${e}`:e,ue=(0,l.when)((0,l.is)(String),(e=>""===e?void 0:"true"===e.toLowerCase())),ce=e=>null!=e&&["object","function"].includes(typeof e),pe=function(e){const t=[],r=(e,n)=>{n=n||[];for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(Array.isArray(e)&&(i=parseInt(i,10)),ce(e[i])?r(e[i],n.concat(i)):t.push(n.concat(i)))};return r(e),t},de=(0,l.when)((0,l.is)(Object),JSON.stringify),ye=(e,t,r)=>{const n=[r,"errorDetailMessage","errorMessage","error"];return(0,l.cond)([...n.map((e=>[(0,l.prop)(e),(0,l.pipe)((0,l.prop)(e),de)])),[(0,l.always)(t),(0,l.always)(t)],[l.T,de]])(e)},fe=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)},Te=/[\n\r%#()<>?[\\\]^`{}|]/g,Ee=e=>`data:image/svg+xml;utf8,${e.replace(/["']\);{0,}$/,"").replace(/'/g,'"').replace(/>\s{1,}</g,"><").replace(/\s{2,}/g," ").replace(Te,encodeURIComponent)}`,me=e=>`data:image/gif;base64,${e}`;var he=r(87918),be=r.n(he);const Oe=e=>{switch(e){case"minutes":return be().text("minutes");case"hours":return be().text("hours");case"days":return be().text("days");case"weeks":return be().text("weeks");case"months":return be().text("months");case"years":return be().text("years");default:return""}};var ve=r(76665);let ge,_e,Ae,Ne,Pe,Re,Se,we,Ie,Ue,Ce,De,je,Le,ke,Fe,Me,xe,$e,Ve,Ge,We,Be,Ye,qe,He,Qe,Ke,Je,Xe,ze,Ze,et,tt,rt,nt,it,at,ot;var st;!function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(ge||(ge={})),function(e){e.local="local",e.validationService="validationService"}(_e||(_e={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(Ae||(Ae={})),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"}(Ne||(Ne={})),function(e){e.WITHIN="within",e.AGO="ago",e.BETWEEN="between"}(Pe||(Pe={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(Re||(Re={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch",e.RELATION_ATTRIBUTE="relationAttribute"}(Se||(Se={})),function(e){e.directed="directed",e.undirected="undirected",e.bidirectional="bidirectional"}(we||(we={})),function(e){e.asc="asc",e.desc="desc"}(Ie||(Ie={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(Ue||(Ue={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(Ce||(Ce={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}(De||(De={})),function(e){e.TABLE="table",e.List="list",e.MAP="map"}(je||(je={})),function(e){e.PROFILE="profile",e.MAP="map"}(Le||(Le={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(ke||(ke={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(Fe||(Fe={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(Me||(Me={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(xe||(xe={})),function(e){e.EXISTS="exists",e.MISSING="missing"}($e||($e={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(Ve||(Ve={})),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"}(Ge||(Ge={})),function(e){e.ENTITY_TYPE="entityLevel",e.ATTRIBUTE_TYPE="attributeLevel"}(We||(We={})),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"}(Be||(Be={})),function(e){e.IN="in",e.OUT="out"}(Ye||(Ye={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}(qe||(qe={})),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"}(He||(He={})),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"}(Qe||(Qe={})),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"}(Ke||(Ke={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}(Je||(Je={})),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"}(Xe||(Xe={})),function(e){e.CustomAction="CustomAction",e.ConsoleAppAction="ConsoleAppAction"}(ze||(ze={})),function(e){e.NEW="new",e.CLASSIC="classic"}(Ze||(Ze={})),function(e){e.ASC_BY_NAME="ascByName"}(et||(et={})),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"}(tt||(tt={})),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"}(rt||(rt={})),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"}(nt||(nt={})),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"}(it||(it={})),function(e){e.AWAITING_REVIEW="AWAITING_REVIEW",e.APPLIED="APPLIED",e.REJECTED="REJECTED"}(at||(at={})),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"}(ot||(ot={})),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"}(st||(st={}));const lt=st;let ut,ct;!function(e){e.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}(ut||(ut={})),function(e){e.Saving="Saving",e.Cloning="Cloning"}(ct||(ct={}));const pt=(0,l.prop)("referencedEntityTypeURI"),dt=(0,l.prop)("relationshipTypeURI"),yt=(0,l.prop)("referencedAttributeURIs"),ft=(0,l.curry)(((e,t)=>(0,l.pipe)(yt,(0,l.filter)((0,l.startsWith)(e)))(t))),Tt=ft("configuration/relationTypes"),Et=ft("configuration/entityTypes"),mt=(0,l.pipe)((0,l.prop)("uri"),(0,l.startsWith)("configuration/relationTypes")),ht=(0,l.filter)(mt),bt=(e,t)=>!t||t.some((t=>t===e.uri)),Ot="1Tempo4rary",vt="1Tepmo4Rel",gt=(0,l.cond)([[l.isNil,(0,l.always)("")],[(0,l.test)(/[^/]$/),(0,l.concat)(l.__,"/")]]),_t=()=>`1Tempo4DCR${Date.now()+Math.round(1e3*Math.random())}`,At=e=>`${e}/uri$$${Date.now()+Math.round(1e3*Math.random())}`,Nt=e=>()=>At(e),Pt=(e,t)=>{const r=gt(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return At(n)},Rt=e=>e&&e.includes("uri$$"),St=Nt("entities"),wt=Nt("relations"),It=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),Ut=(0,l.startsWith)("relations/"),Ct=(0,l.startsWith)("entities/"),Dt=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/entityTypes/")),jt=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/relationTypes/")),Lt=(0,l.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),kt=(0,l.pipe)((0,l.split)("/"),l.head),Ft=(0,l.pipe)((0,l.split)("/"),l.last),Mt=e=>e.split(".").slice(0,2).join("."),xt=(e,t)=>{const[r,...n]=e.split("."),i=n.join(`/${r}/`);return`${t||""}/${r+(i&&`/${i}`)}`},$t=(0,l.curry)(((e,t)=>`${e}/attributes/${t}`)),Vt=(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("/")},Gt=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},Wt=(0,l.either)((0,l.startsWith)("attributes."),(0,l.startsWith)("analyticsAttributes.")),Bt=e=>2===e.split("/").length,Yt=e=>5===e.split("/").length,qt=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},Ht=e=>e.replace(/uri\$\$/g,Ot),Qt=e=>e.includes("changeRequests/")&&e.includes("/changes/"),Kt=e=>e.split("/changes/")[1];function Jt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xt=(0,l.allPass)([(0,l.propSatisfies)((0,l.either)(l.isNil,Dt),"uri"),(0,l.prop)("faceted"),(0,l.propEq)("type",lt.TYPE_STRING)]),zt=(0,l.has)("values"),Zt=(0,l.cond)([[(0,l.has)("dependentLookupCode"),(0,l.always)(lt.TYPE_DEPENDENT_LOOKUP)],[(0,l.has)("lookupCode"),(0,l.always)(lt.TYPE_LOOKUP)],[zt,(0,l.always)(lt.TYPE_ENUM)],[Xt,(0,l.always)(lt.TYPE_TYPEAHEAD)],[(0,l.propEq)("type",lt.TYPE_BOOLEAN),(0,l.always)(lt.TYPE_BOOLEAN_RADIO)],[l.T,(0,l.prop)("type")]]),er=(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){Jt(e,t,r[t])}))}return e}({},e,{type:Zt(e)})),(0,l.pick)(["type","values","lookupCode","uri","dependentLookupCode","singleValue"])),tr=e=>!!e&&(!!e.autoGenerated&&e.type!==lt.TYPE_NESTED||!!e.parentAutoGenerated),rr=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.test)(/\/analyticsAttributes\//)),nr=(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),ir=e=>rr(e)?"analyticsAttributes":"attributes",ar=(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))),sr=or(lt.TYPE_NESTED),lr=or(lt.TYPE_REFERENCE),ur=or(lt.TYPE_IMAGE),cr=(0,l.either)(sr,lr),pr=(e,t)=>{const r=rr(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(".")},dr=(0,l.either)((0,l.prop)("lookupCode"),(0,l.prop)("dependentLookupCode")),yr=(0,l.pipe)(dr,Boolean),fr=(0,l.pipe)((0,l.prop)("dependentLookupCode"),Boolean),Tr=(0,l.both)(yr,(0,l.pipe)(dr,("rdm",(0,l.pipe)(kt,(0,l.equals)("rdm")))));const Er=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=ir({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]||hr(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:[]},mr=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=Er(e,t,r);return n.length?(0,l.last)(n):null},hr=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",lt.TYPE_NESTED),(0,l.propEq)("type",lt.TYPE_IMAGE)]),(0,l.prop)("attributes")],[(0,l.propEq)("type",lt.TYPE_REFERENCE),(0,l.pipe)(yt,(0,l.map)((t=>mr(e,t))),(0,l.reject)(l.isNil))],[l.T,(0,l.always)(null)]])(t)},br=[lt.TYPE_ACTIVENESS_DATE,lt.TYPE_DATE,lt.TYPE_TIMESTAMP,lt.TYPE_LOCAL_DATE],Or=[lt.TYPE_ACTIVENESS_DATE,lt.TYPE_TIMESTAMP,lt.TYPE_LOCAL_DATE],vr=e=>br.includes(e),gr=e=>Or.includes(e),_r=[lt.TYPE_INT,lt.TYPE_LONG,lt.TYPE_NUMBER,lt.TYPE_FLOAT,lt.TYPE_DOUBLE,lt.TYPE_COUNT],Ar=e=>_r.includes(e),Nr=e=>[lt.TYPE_FLOAT,lt.TYPE_DOUBLE].includes(e),Pr=[lt.TYPE_BOOLEAN,lt.TYPE_BOOLEAN_RADIO,lt.TYPE_RDM_LOOKUPS_NOT_RESOLVED],Rr=e=>Pr.includes(e),Sr=[lt.TYPE_URL,lt.TYPE_BLOG_URL,lt.TYPE_IMAGE_URL],wr=e=>Sr.includes(e),Ir=or(lt.TYPE_EMAIL),Ur=e=>lt.TYPE_SSN===e;var Cr,Dr=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(Cr||(Cr={}));const jr=(0,l.curry)(((e,t,r)=>{var n;const i=e===Cr.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)))})),Lr=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),kr=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),Lr),Fr=(0,l.pipe)((0,l.reject)(E),kr);function Mr(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){xr(e,t,r[t])}))}return e}function xr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $r=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("?")?"&":"?")+Lr(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}},Vr=e=>t=>{if(!(e=>!ce(e.value))(t)){var r;const n=`${e}/${null!==(r=t.refEntity)&&void 0!==r&&r.objectURI?Ft(t.refEntity.objectURI):_t()}`;return Mr({},t,{uri:n,value:(0,l.fromPairs)((0,l.map)(Gr(n),(0,l.toPairs)(t.value)))})}return Mr({},t,{uri:`${e}/${_t()}`})},Gr=e=>t=>{let[r,n]=t;return[r,(0,l.map)(Vr(`${e}/${r}`),n)]},Wr=e=>{const{uri:t}=e;return(0,l.evolve)({attributes:(0,l.pipe)(l.toPairs,(0,l.map)(Gr(`${t}/attributes`)),l.fromPairs)},e)},Br=e=>(0,l.evolve)({changes:(0,l.map)((0,l.map)((0,l.when)((0,l.propEq)("type",it.CREATE_ENTITY),(0,l.evolve)({newValue:Wr}))))},e),Yr={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},qr=(0,l.equals)(Yr.SUGGESTING),Hr=(0,l.equals)(Yr.EDITING),Qr=(0,l.equals)(Yr.VIEWING),Kr=(0,l.either)(Hr,qr),Jr=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Xr=(0,l.curry)(((e,t)=>(0,l.pipe)(Jr(e),(0,l.prop)("extendsTypeURI"))(t))),zr=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(Xr(e,r)));return n(r)})),Zr=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=Xr(e,n);return r})),en=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?en(e,Jr(e,t.extendsTypeURI),r):void 0,tn=(e,t)=>{const r=t.map(Zr(e));return(r.length?r.reduce(l.intersection):[])[0]},rn=(e,t)=>en(e,(0,l.is)(Object,t)?t:Jr(e,t),"typeImage"),nn=(e,t)=>e.entityTypes.reduce(((r,n)=>n.uri!==t&&zr(e,t,n.uri)?r.concat(n.uri):r),[]),an={EQUALS:"equals",NOT_EQUALS:"not equals",EXISTS:"exists",FULL_TEXT:"fullText",HAS_ALL:"hasAll",MISSING_VALUE:"missing",IN_RANGE:"range",LT:"lt",LTE:"lte",GT:"gt",GTE:"gte",STARTS_WITH:"startsWith",COUNT_EQUALS:"count.equals",COUNT_NOT_EQUALS:"count.not.equals",COUNT_LT:"count.less",COUNT_LTE:"count.less.or.equals",COUNT_GT:"count.greater",COUNT_GTE:"count.greater.or.equals",COUNT_RANGE:"count.range",IN_FILE:"in.file",NOT_IN_FILE:"not.in.file",CONTAINS:"contains",ON:"on",BEFORE:"before",AFTER:"after",WITHIN:"within"},on={LIST_EQUALS:"listEquals",NOT_LIST_EQUALS:"not listEquals",LIST_EQUALS_CASE_SENSITIVE:"listEqualsCaseSensitive",NOT_LIST_EQUALS_CASE_SENSITIVE:"not listEqualsCaseSensitive"},sn={[an.EQUALS]:"equals",[an.NOT_EQUALS]:"not",[an.STARTS_WITH]:"starts with",[an.MISSING_VALUE]:"missing value",[an.IN_RANGE]:"in range",[an.HAS_ALL]:"has all",[an.FULL_TEXT]:"full text",[an.EXISTS]:"exists",[an.COUNT_EQUALS]:"count equals",[an.COUNT_NOT_EQUALS]:"count not equal",[an.COUNT_LT]:"count less",[an.COUNT_LTE]:"count less or equal",[an.COUNT_GT]:"count greater",[an.COUNT_GTE]:"count greater or equal",[an.COUNT_RANGE]:"count in range",[an.LT]:"less than",[an.LTE]:"less than or equal",[an.GT]:"greater than",[an.GTE]:"greater than or equal",[an.IN_FILE]:"in file",[an.NOT_IN_FILE]:"not in file",[an.CONTAINS]:"contains",[an.ON]:"on",[an.BEFORE]:"before",[an.AFTER]:"after",[an.WITHIN]:"within"},ln="in",un="notIn",cn="not range",pn=e=>({[ln]:an.EQUALS,[un]:an.NOT_EQUALS}[e]||e);var dn,yn;!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"}(dn||(dn={})),function(e){e.LAST_3DAYS="last3Days"}(yn||(yn={}));const fn=["LAST_DAY","LAST_3DAYS","LAST_WEEK","LAST_MONTH","LAST_6MONTHS","LAST_YEAR","PICK_DATE"].reduce(((e,t)=>(e[t]=dn[t]||yn[t],e)),{}),Tn={[dn.LAST_DAY]:"Last 24 hours",[yn.LAST_3DAYS]:"Last 3 days",[dn.LAST_WEEK]:"Last 7 days",[dn.LAST_MONTH]:"Last month",[dn.LAST_6MONTHS]:"Last 6 months",[dn.LAST_YEAR]:"Last year",[dn.PICK_DATE]:"Pick date"},En={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},mn={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},hn="<No label>",bn={IN:"in",OUT:"out"};function On(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){vn(e,t,r[t])}))}return e}function vn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gn={startDate:{type:lt.TYPE_ACTIVENESS_DATE,get label(){return be().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:lt.TYPE_ACTIVENESS_DATE,get label(){return be().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},_n=On({id:{type:lt.TYPE_ENTITY_ID,get label(){return be().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},gn,{roles:{type:lt.TYPE_STRING,get label(){return be().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:lt.TYPE_STRING,get label(){return be().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),An={workflow:{type:lt.TYPE_STRING,get label(){return be().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:lt.TYPE_STRING,get label(){return be().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:lt.TYPE_STRING,get label(){return be().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:lt.TYPE_TIMESTAMP,get label(){return be().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},Nn={commenter:{type:lt.TYPE_STRING,get label(){return be().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},Pn={notResolved:{type:lt.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return be().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},Rn={createdBy:{type:lt.TYPE_STRING,get label(){return be().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:lt.TYPE_STRING,get label(){return be().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:lt.TYPE_TIMESTAMP,get label(){return be().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:lt.TYPE_TIMESTAMP,get label(){return be().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},Sn={matches:{type:lt.TYPE_COUNT,get label(){return be().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:lt.TYPE_COUNT,get label(){return be().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0}},wn={sourceSystems:{type:lt.TYPE_STRING,get label(){return be().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:lt.TYPE_STRING,get label(){return be().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:lt.TYPE_INT,get label(){return be().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:lt.TYPE_TIMESTAMP,get label(){return be().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:lt.TYPE_TIMESTAMP,get label(){return be().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:lt.TYPE_TIMESTAMP,get label(){return be().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:lt.TYPE_TIMESTAMP,get label(){return be().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:lt.TYPE_TIMESTAMP,get label(){return be().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:lt.TYPE_STRING,get label(){return be().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}};let In;!function(e){e.matchRules="matchRules",e.MLRecommendedMatch="MLRecommendedMatch"}(In||(In={}));const Un={[In.matchRules]:{type:lt.TYPE_STRING,get label(){return be().text("Match Rules")},uri:In.matchRules,name:In.matchRules,faceted:!0,hideForDataTenant:!0},[In.MLRecommendedMatch]:{type:lt.TYPE_STRING,get label(){return be().text("Match IQ")},uri:In.MLRecommendedMatch,name:In.MLRecommendedMatch,faceted:!0,hideForDataTenant:!0}},Cn=On({},_n,An,Nn,Pn,Rn,Sn,wn,Un,{type:{type:lt.TYPE_STRING,get label(){return be().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}}),Dn="NOT_MATCH";var jn=r(13980),Ln=r.n(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}const Mn=Ln().oneOf(["mobile","tablet","desktop"]),xn=Ln().shape({deviceTypes:Ln().oneOfType([Mn,Ln().arrayOf(Mn)]),roles:Ln().arrayOf(Ln().string)}),$n=Ln().shape({value:Ln().string,lookupCode:Ln().string}),Vn=Ln().shape({link:Ln().string,filename:Ln().string}),Gn=Ln().shape({displayName:Ln().string,parent:Ln().string}),Wn=Ln().oneOfType([Ln().string,Ln().number,Ln().bool,$n]),Bn=Ln().oneOfType([Wn,Ln().arrayOf(Wn)]),Yn=Ln().shape({fieldName:Ln().string,values:Ln().arrayOf(Bn),filter:Ln().string,type:Ln().string}),qn=Ln().shape({minValue:Ln().number,maxValue:Ln().number}),Hn=Ln().shape({label:Ln().string,name:Ln().string,description:Ln().string,type:Ln().string,hidden:Ln().bool,faceted:Ln().bool,searchable:Ln().bool,uri:Ln().string,access:Ln().arrayOf(Ln().string),cardinality:qn}),Qn=Ln().shape({label:Ln().string,uri:Ln().string,typeColor:Ln().string,direction:Ln().string,startObject:Ln().object,endObject:Ln().object}),Kn=Ln().shape({typeColor:Ln().string,typeIcon:Ln().string,typeImage:Ln().string,label:Ln().string,uri:Ln().string,attributes:Ln().arrayOf(Hn)}),Jn=Ln().shape({uri:Ln().string,label:Ln().string,memberTypes:Ln().array,extendsTypeUri:Ln().string,attributes:Ln().arrayOf(Hn)}),Xn=Ln().shape({uri:Ln().string,label:Ln().string,extendsTypeUri:Ln().string,relationshipTypeURIs:Ln().arrayOf(Ln().string)}),zn=Ln().shape({uri:Ln().string,description:Ln().string,label:Ln().string,schemaVersion:Ln().string,entityTypes:Ln().arrayOf(Kn),roles:Ln().arrayOf(Ln().object),groupTypes:Ln().arrayOf(Ln().object),relationTypes:Ln().arrayOf(Qn),graphTypes:Ln().arrayOf(Xn),interactionTypes:Ln().arrayOf(Jn),sources:Ln().arrayOf(Ln().object)}),Zn=Ln().shape({uri:Ln().string,type:Ln().string}),ei=Ln().shape({uri:Ln().string,attributes:Ln().object,type:Ln().string,timestamp:Ln().number,members:Ln().object}),ti=Ln().shape({uri:Ln().string,type:Ln().string}),ri=Ln().shape({value:Ln().object,ov:Ln().bool,type:Ln().string,uri:Ln().string}),ni=Ln().shape({refEntity:Ln().oneOfType([Ln().array,Ln().object]),refRelation:Ln().oneOfType([Ln().array,Ln().object]),value:Ln().object,ov:Ln().bool,type:Ln().string,uri:Ln().string}),ii=Ln().oneOf((0,l.values)(Yr)),ai=Ln().shape({type:Ln().oneOf(Object.values(ge)).isRequired,attributeTypeUri:Ln().string.isRequired,parentUri:Ln().string.isRequired,uri:Ln().string,message:Ln().string}),oi={attributeType:Hn,showEmptyEditors:Ln().bool,lazy:Ln().bool,mode:ii,metadata:zn,ownError:ai,errors:Ln().arrayOf(ai),crosswalks:Ln().array,onAddAttributes:Ln().func,onAddOneMore:Ln().func,onDeleteAttribute:Ln().func,onChangeAttribute:Ln().func,additionalControlsRenderer:Ln().func,hideDeleteButton:Ln().bool,showNonOv:Ln().bool,state:Ln().oneOf(["deleted","edited"]),expanded:Ln().bool},si=kn({attributeValue:ri},oi),li=kn({attributeValue:ni},oi),ui=Ln().shape({value:Ln().oneOfType([Ln().string,Ln().bool,Ln().number]),ov:Ln().bool,type:Ln().string,uri:Ln().string,lookupCode:Ln().string,lookupRawValue:Ln().string}),ci=Ln().shape({totalOvValues:Ln().number,totalValues:Ln().number}),pi=Ln().shape({inRelations:Ln().arrayOf(Ln().oneOfType([Ln().object,Ln().string])),outRelations:Ln().arrayOf(Ln().oneOfType([Ln().object,Ln().string])),groups:Ln().arrayOf(Ln().string),entityTypes:Ln().arrayOf(Ln().string),nextEntry:Ln().object}),di=Ln().oneOf(["asc","desc"]),yi=Ln().shape({id:Ln().string,content:pi,allowOnlyCreateNew:Ln().bool,sortColumn:Ln().string,sortOrder:di,"text-empty":Ln().string,max:Ln().number,icon:Ln().string,caption:Ln().string,canCreate:xn,canRead:xn,canUpdate:xn,canDelete:xn,editingEnabled:Ln().bool}),fi=Ln().shape({id:Ln().string,caption:Ln().string,pageSize:Ln().number,icon:Ln().string,canCreate:xn,canRead:xn,canUpdate:xn,canDelete:xn,attributes:Ln().object}),Ti=Ln().shape({entityUri:Ln().string,entityType:Ln().string,entityLabel:Ln().string,object:Zn}),Ei=Ln().shape({relationUri:Ln().string,relationType:Ln().string,relationLabel:Ln().string,direction:Ln().string,object:ti}),mi=Ln().shape({entity:Ti,relation:Ei}),hi=Ln().shape({value:Ln().string,isRawFilter:Ln().bool}),bi=Ln().shape({id:Ln().string,label:Ln().string,name:Ln().string,availableEntityTypes:Ln().array}),Oi=Ln().shape({id:Ln().string,allowMergeAll:Ln().bool,matchActions:Ln().object,availableTabs:Ln().arrayOf(Ln().oneOf(["findMatches","potentialMatches","notAMatch"]))}),vi=Ln().shape({matchRules:Ln().arrayOf(Ln().string),object:Zn,shortestTransitiveMatchPath:Ln().arrayOf(Ln().shape({matchRules:Ln().arrayOf(Ln().string),match:Ln().string})),direct:Ln().bool,matchScore:Ln().number}),gi=Ln().arrayOf(vi),_i=Ln().arrayOf(Ln().shape({uri:Ln().string,label:Ln().string})),Ai=[{label:be().text("And"),value:"and"},{label:be().text("Or"),value:"or"},{label:be().text("And not"),value:"and not"},{label:be().text("Or not"),value:"or not"}];function Ni(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Pi=(0,l.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Ri=(0,l.pipe)(Pi,(0,l.propOr)("","label")),Si=(0,l.curry)(((e,t)=>{const r=Pi(e,t);return[(0,l.path)(["startObject","objectTypeURI"],r),(0,l.path)(["endObject","objectTypeURI"],r)]})),wi=(0,l.curry)(((e,t,r)=>{const[n,i]=Si(e,r);return zr(e,n,t)||zr(e,i,t)})),Ii=(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){Ni(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),Ui=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?bn.OUT:bn.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(bn.IN),i=r(bn.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},Ci=(0,l.pathOr)("",["directionalContext",0,"labelPattern"]),Di=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?Di(e,Pi(e,t.extendsTypeURI),r):void 0,ji={CREATE:"CREATE",READ:"READ",UPDATE:"UPDATE",DELETE:"DELETE",INITIATE_CHANGE_REQUEST:"INITIATE_CHANGE_REQUEST",MERGE:"MERGE",UNMERGE:"UNMERGE"},Li=(0,l.curry)(((e,t)=>e.every((e=>ki(e,t))))),ki=(0,l.curry)(((e,t)=>{const r=tr(t);return Fi(e,t)&&(e===ji.READ||!r)})),Fi=(e,t)=>!t||!t.access||t.access.includes(e),Mi=(0,l.curry)(((e,t,r)=>ki(ji.READ,r)&&(qr(t)?ki(ji.INITIATE_CHANGE_REQUEST,r):ki(e,r)))),xi=Mi(ji.CREATE),$i=Mi(ji.DELETE),Vi=Mi(ji.UPDATE),Gi=Li([ji.CREATE,ji.MERGE,ji.READ,ji.UPDATE]),Wi=Li([ji.UPDATE,ji.READ,ji.CREATE]),Bi=Li([ji.UPDATE,ji.READ]),Yi=Li([ji.DELETE,ji.UPDATE,ji.READ]),qi=(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["*"])),Hi=(e,t,r)=>(0,l.pipe)((0,l.map)(qi(e,t)),(0,l.filter)(l.identity))(r),Qi=(e,t,r)=>{const n=Hi(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&ki(ji.MERGE,r)},Ki=(0,l.curry)(((e,t,r,n)=>{const i=Pi(e,n),[a,o]=Si(e,n);return i&&ki(ji.CREATE,i)&&zr(e,a,t.type)&&zr(e,o,r.type)})),Ji=(e,t,r,n,i)=>{const a=Jr(e,n.type),o=Hi(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(Ki(e,n,i))||a.some(Ki(e,i,n))}))},Xi=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=Jr(e,r.type),o=(0,l.propOr)({},"matchActions",t);return{canMerge:Qi(o,i,a),canAddRelation:Ji(e,o,i,r,n),canMark:ki(ji.UPDATE,a)&&ki(ji.READ,a)}},zi=(e,t,r,n)=>(0,l.pipe)((0,l.map)((n=>Xi(e,t,n.object,r,n.matchRules))),(0,l.reduce)((0,l.mergeWith)(l.and),{}))(n),Zi=rr,ea=(0,l.complement)(Zi),ta=ki(ji.READ),ra=e=>{let{attributeType:t,mode:r}=e;return ea(t)&&xi(r,t)&&!ar(t)},na=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=Rt(r.uri),o=Vi(n),s=xi(n);return(0,l.cond)([[Zi,l.F],[(0,l.always)(a),l.T],[(0,l.always)(i),o],[l.T,(0,l.allPass)([o,s])]])(t)},ia=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=Rt(r.uri),s=Vi(n),u=$i(n),c=oa(ji.UPDATE,n,a,r),p=oa(ji.DELETE,n,a,r);return(0,l.cond)([[Zi,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)},aa=(0,l.curry)(((e,t,r,n)=>{const i=hr(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=>!Fi(e,n)||!aa(e,t,r[n.name],n)))))})),oa=(0,l.curry)(((e,t,r,n,i)=>qr(t)?aa(ji.INITIATE_CHANGE_REQUEST,r,n,i):aa(e,r,n,i))),sa=(0,l.both)((0,l.complement)(ar),ta),la="SuperUser",ua="allTenants",ca=[ua,"allCustomers"],pa=e=>{let{allowedPermissionsNames:t,permissionsNames:r,permissionsConfig:n,superUserEnvironments:i}=e;return t.map((e=>{switch(e){case r.NON_SECURED:return l.T;case r.SECURED:return e=>void 0!==e.userPermissions;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===la})).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===la){const e=r?ca.concat(r.map((e=>`allTenants.${e}`))):ca,n=r&&t[0]===ua?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}))},da={NON_SECURED:"NON_SECURED",SECURED:"SECURED",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"},ya={[da.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[da.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activities"],privileges:["EXECUTE"]},[da.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[da.CAN_READ_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ"]},[da.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[da.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[da.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[da.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[da.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[da.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[da.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[da.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[da.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[da.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[da.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[da.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[da.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[da.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[da.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[da.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[da.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[da.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[da.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[da.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[da.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[da.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[da.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[da.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[da.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]},[da.CAN_READ_DVF]:{serviceId:"DVF",resourcePath:["functionsManagement"],privileges:["READ"]}},fa=(0,l.curry)(((e,t,r)=>pa({allowedPermissionsNames:e,permissionsNames:da,permissionsConfig:ya}).some((e=>e(t,{params:{tenant:r}}))))),Ta=fa([da.CAN_EXPORT]),Ea=fa([da.CAN_EXPORT_ACTIVITIES]),ma=fa([da.CAN_IMPORT_ENTITIES_FROM_DT]),ha=fa([da.CAN_READ_ENTITIES_FROM_DT]),ba=fa([da.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),Oa=fa([da.CAN_UPDATE_PROCESS_INSTANCE]),va=fa([da.CAN_VIEW_WORKFLOW_DEFINITION]),ga=fa([da.CAN_CONFIG_ENVIRONMENT_REGISTER]),_a=fa([da.CAN_UPDATE_WORKFLOW_DATA_TASK]),Aa=fa([da.CAN_READ_WORKFLOW_DATA_TASK]),Na=fa([da.CAN_MANAGE_WORKFLOW_DEFINITION]),Pa=fa([da.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),Ra=fa([da.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),Sa=fa([da.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),wa=fa([da.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),Ia=fa([da.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),Ua=fa([da.CAN_EXECUTE_WORKFLOW_JOBS]),Ca=fa([da.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),Da=fa([da.CAN_CREATE_CONFIG_JAR]),ja=fa([da.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),La=fa([da.CAN_VIEW_CONFIG_JAR]),ka=fa([da.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),Fa=fa([da.CAN_VIEW_WORKFLOW_JOBS]),Ma=fa([da.CAN_MAKE_BULK_UPDATE]),xa=fa([da.CAN_OPEN_DATA_LOADER_EXECUTE,da.CAN_OPEN_DATA_LOADER_READ]),$a=fa([da.CAN_BULK_DELETE_PROFILES]),Va=fa([da.CAN_READ_MDM_DATA_ENTITIES]),Ga=fa([da.CAN_READ_DVF]),Wa=fa([da.IS_FREEMIUM_ADMIN]),Ba=(0,l.reject)(ar),Ya=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),Ba,(0,l.filter)(e))(t),qa=(0,l.curry)(((e,t)=>Ya((t=>ra({attributeType:t,mode:e})),t))),Ha=(0,l.curry)(((e,t)=>Ya((t=>ra({attributeType:t,mode:e})||sa(t)),t))),Qa=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(sa)),Ka=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Ka(e)])))),Ja=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(sa),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Ja(e)])))),Xa=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...Xa(e)])))),za=(0,l.pipe)(Jr,(0,l.converge)(l.concat,[Ja,Xa]));function Za(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){eo(e,t,r[t])}))}return e}function eo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const to=(0,l.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,to(e)))},t))),ro=e=>{var t;return Za({},e,{matchGroups:(0,l.uniq)((e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[]))})},no=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),io=(0,l.when)(no,(0,l.dissoc)("values")),ao=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return Za({},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})})),oo=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},so=(0,Dr.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(Ka,t).concat((0,l.chain)(Ka,r)).some(oo)})),lo=e=>{let t=!1;const r=to((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?Za({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},uo=e=>{const t=so(e),r=(0,l.map)((e=>to((0,l.pipe)(io,(0,l.when)((0,l.always)(e),ao))))(t)),n=(0,l.map)(ro),i=(0,l.map)(lo);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},co=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),po=(0,l.prop)("relationshipTypeURIs"),yo=(0,l.curry)(((e,t)=>{var r;return(null===(r=e.graphTypes)||void 0===r?void 0:r.filter(fo(e,t)))||[]})),fo=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return null==n?void 0:n.some(wi(e,t))},To=(e,t)=>(0,l.pipe)(co,(0,l.defaultTo)({}),po,(0,l.defaultTo)([]),(0,l.chain)(Si(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(Jr(e)))(e,t),Eo=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),mo=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),ho=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return mo((0,l.complement)(Eo))(e)},bo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return mo(Eo)(e)},Oo=(0,l.pipe)(Jr,(0,l.propOr)([],"matchGroups")),vo=(e,t,r)=>(0,l.pipe)(Oo,(0,l.find)((0,l.propEq)("uri",r)))(e,t),go=(0,l.curry)(((e,t,r)=>(0,l.pipe)(vo,(0,l.propOr)(r,"label"))(e,t,r))),_o=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(Oo,(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]})),Ao=e=>(0,l.partition)(Eo,e),No=(0,l.includes)(l.__,["and","or","not"]),Po=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),Ro=(0,l.includes)(l.__,["equals","notEquals","in"]),So=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return No(t)?So(r):Po(t)?r.filter(Dt):Ro(t)?r.map((0,l.prop)("uri")).filter(Dt):[]})),l.uniq),wo=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)(So),l.uniq),Io=(0,l.pipe)(Oo,wo),Uo=(0,l.pipe)(_o,wo),Co=(e,t)=>{let{interactionTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},Do=(0,l.pipe)(Co,Ja),jo=(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||zr(e,n,t)})(e,t))})(e,t)),Lo=e=>!!e.required,ko=(e,t,r)=>{const n=(0,l.cond)([[Dt,Jr(e)],[jt,Pi(e)]])(t);return Fo(e,n,r)},Fo=(e,t,r)=>!t||t.hidden&&!(e=>e.uri&&Dt(e.uri)&&3===e.uri.split("/").length)(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!tr(e))).flatMap((t=>{const n=t.required?[t]:[];if(r){let i;if(t.type===lt.TYPE_REFERENCE){const n=dt(t),a=yt(t);i=ko(e,n,r).filter((e=>a.some(Lt(e.uri))))}else t.attributes&&(i=Fo(e,t,r));i&&n.push(...i)}return n})):t.type===lt.TYPE_REFERENCE?ko(e,dt(t),r):[],Mo=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),Lo]),e.attributes||[])},xo=(e,t)=>{const r=Et(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},$o=(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)?be().text(n):n};return r(null,t)})),Vo=["label","description","abbreviation","caption","toolTip"],Go=e=>$o(Vo,e),Wo=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=Ft(t);return r.find((e=>{let{uri:t}=e;return Ft(t)===n}))})),Bo=(0,l.curry)(((e,t)=>{const r=Ft(t);return(0,l.pipe)(Wo(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),Yo=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"})},qo=(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}))},Ho=(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)})),Qo=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=Jr(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));function Ko(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){Jo(e,t,r[t])}))}return e}function Jo(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=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 zo(i,e,t,r,n)},zo=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:["attributes"];return ee.fromNull(e&&e.length?e:hr(t,r)).map((e=>e.map((e=>{const r=Xo(t,e,n,i);return r.length?Ko({},e,{children:r}):e})))).orSome([]).filter((0,l.either)((0,l.complement)(cr),(0,l.prop)("children"))).filter(sa).filter(n).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},Zo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Xo(e,t,r,["attributes","analyticsAttributes"])},es=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Xo(e,t,r,["attributes"])},ts=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Xo(e,t,r,["analyticsAttributes"])},rs=e=>e.children?e.children.flatMap(rs):e,ns=e=>e.children?[e,...e.children.flatMap(ns)]:e,is=(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)})),as=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return Ft(r)===e})))),os=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),as("LUD")),(0,l.defaultTo)(r))(t||[])},ss=(e,t)=>{let{survivorshipStrategies:r}=e;return as(t,r)},ls=(0,l.allPass)([(0,l.complement)(l.isNil),ki(ji.READ)]),us=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),ki(ji.READ)]),cs=(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)([ki(ji.CREATE),ki(ji.INITIATE_CHANGE_REQUEST)])]),ps=(0,l.curryN)(2,(0,l.pipe)(Jr,us)),ds=(0,l.curryN)(2,(0,l.pipe)(Pi,ls));function ys(e,t,r,n){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 fs(e,t){for(var r=e.substr(e.indexOf("/attributes/")+12).split("/"),n=[],i=0;i<r.length;i+=2)n.push(ys(r[i],r[i+1],e,t));return n}function Ts(e,t,r,n,i,a,o){void 0===a&&(a=0);var s=fs(r,t)[a];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 Ts(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 Es(e,t,r,n,i,a){void 0===a&&(a=0);var o=fs(r,t)[a];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()?(ms(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(ms.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=Ts(e,t,r,n,i,a),s}var c=Es(e,o,o.valueUri,{},i,a);Es(c,t,r,n,i,a+1)}function ms(e,t){ce(e)?(t.value=e.value,t.lookupCode=e.lookupCode):(t.value=e,t.lookupCode&&(t.lookupCode=e))}function hs(e,t,r,n){void 0===n&&(n=0);var i=fs(r)[n];if(i.hasChildren){var a=(e[i.name]||[]).filter((function(e){return e.uri===i.valueUri}))[0];a&&hs(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 bs(e,t){e.roles=t||[]}function Os(e,t){e.tags=t||[]}function vs(e,t){e.startDate=t||""}function gs(e,t){e.endDate=t||""}const _s=e=>{let{ov:t}=e;return!1!==t},As=(e,t)=>((e,t)=>wr(e.type)&&oe(t))(e,t)||((e,t)=>Ir(e.type)&&se(t))(e,t),Ns=(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))),Ps=Ns("refEntity"),Rs=Ns("refRelation"),Ss=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],ws=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},Is=(0,l.prop)("objectURI"),Us=(0,l.prop)("objectURI"),Cs=(0,l.prop)("type"),Ds=(0,l.pipe)(Ps,(0,l.defaultTo)({}),Is),js=(0,l.pipe)(Rs,(0,l.defaultTo)({}),Us),Ls=(0,l.pipe)(Ps,(0,l.defaultTo)({}),Cs),ks=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type})));return(e||[]).concat(r)},Fs=(0,l.evolve)({refEntity:ne,refRelation:ne}),Ms=(e,t,r,n)=>{const i=Er(e,r),a=Jr(e,t.type)||Pi(e,t.type);if(0===i.length)return null;const o=ir(r);let s=[t],l=1;i[0].uri!==t.type&&(l=0);let u=null;const c=n?[]:null;let p=null;for(let e=l;e<i.length;++e){const t=e===i.length-1,r=i[e];let l=[];if(!bt(r,p)){u=n?[]:null;break}Array.isArray(s)&&(s.forEach((s=>{const u=s.value||s[o]||{};let d=[];r.startObject&&r.endObject||r.typeColor?(d=((null==a?void 0:a.attributes)||[]).filter((e=>dt(e)===r.uri||pt(e)===r.uri)),p=d.reduce(((e,t)=>{const r=t.referencedAttributeURIs&&t.referencedAttributeURIs.filter((function(t){return-1===e.indexOf(t)}));return r?e.concat(r):e}),[])):(d.push(r),p=null),d.forEach((a=>{const o=u[a.name];o&&(l=l.concat(o)),n&&t&&c.push({attrValues:o||[],parent:s,attrType:r,parentType:i[e-1],typePath:i})}))})),s=l),t&&(u=s)}return c||u},xs=(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?xs(a.value,o):a},$s=(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 xs(e[r],i)})),Vs=(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")]]),Gs=(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"])]]),Ws=(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"])]]),Bs=(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)(Bs(e,i)))))(r)})),Ys=(0,l.curry)(((e,t)=>(0,l.ifElse)((0,l.is)(Array),(0,l.map)(Ys(e)),e)(t))),qs=(0,l.curry)(((e,t,r,n)=>(0,l.pipe)(Bs(e,r),Ys(t))(n))),Hs=qs(null,Vs),Qs=qs(_s,Vs),Ks=qs(null,Gs),Js=qs(_s,Gs),Xs=qs(_s,Ws),zs=(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=$s(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},Zs=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(Ds,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{}),el=(e,t)=>{const r=qt(t),n=(0,l.pipe)((0,l.split)("/"),(0,l.dropLast)(1),l.last)(t);return zs(e,r,n)},tl=Object.values(gn),rl=(0,l.includes)(l.__,tl),nl=e=>tl.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,l.assoc)(n,e[n],t):t}),{});function il(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){al(e,t,r[t])}))}return e}function al(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ol=(e,t)=>`${e}_${t}`,sl=[Cn.matches.name,Cn.matchRules.name],ll=(0,l.values)(An).map((e=>e.name)),ul=e=>(0,l.when)((0,l.always)(!e),(0,l.reject)((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,ll)))),cl=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,sl)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>ol(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),pl=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,l.pipe)(l.values,ul(r),cl(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(ol(`dtPotentialMatches.${t.name}`,"")))))(Cn)},dl=(0,l.propEq)("uri",Cn.type.uri),yl=e=>(0,l.values)(Un).some((0,l.propEq)("uri",null==e?void 0:e.uri)),fl=(0,l.propEq)("uri",wn.sourceSystems.uri),Tl=Object.values(_n),El=(0,l.includes)(l.__,Tl),ml=e=>{let{entity:t,attributeType:r,value:n}=e;return il({},t,{[r.uri]:void 0===n?r.defaultValue:n})},hl=e=>{let{entity:t,attributeType:r}=e;return(0,l.dissoc)(r.uri,t)},bl=e=>{let{entity:t,attributeType:r,value:n}=e;return il({},t,{[r.uri]:n})},Ol=(0,l.propEq)("uri",_n.roles.uri),vl=(0,l.propEq)("uri",_n.tags.uri);function gl(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){_l(e,t,r[t])}))}return e}function _l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Al=e=>{let{parentUri:t,attributeType:r}=e;return gl({uri:Pt(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,l.propOr)("","defaultValue",e);return(0,l.cond)([[cr,(0,l.always)({value:{}})],[yr,()=>t?{value:"",lookupCode:t}:{value:""}],[(0,l.both)((0,l.propEq)("defaultValue","now"),(0,l.pipe)((0,l.prop)("type"),vr)),(0,l.always)({value:Date.now()})],[l.T,(0,l.always)({value:t})]])(e)})(r))},Nl=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)(qa(i),(0,l.filter)((0,l.anyPass)([(0,l.has)("defaultValue"),fr,(0,l.propEq)("required",!0)])))(t),o={};for(const e of a){const{name:t}=e,a=Al({parentUri:r,attributeType:e});let s=hr(n,e);s&&(e.type===lt.TYPE_REFERENCE&&(s=ht(s)),a.value=Nl({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(!(0,l.isEmpty)(a.value)||Boolean(a.lookupCode)||fr(e))&&(o[t]=[a])}return o},Pl=e=>{let{entity:t,metadata:r}=e;return ko(r,t.type,!0).filter(fr).reduce(((e,t)=>{const n=t.name,i=qt(t.uri);return(i===e.type?[{parentUri:e.uri,attributes:e.attributes}]:Ms(r,e,i).map((e=>{let{value:t,uri:r}=e;return{parentUri:r,attributes:t}}))).reduce(((e,r)=>{let{parentUri:i,attributes:a}=r;return a[n]&&0!==a[n].length?e:Sl({entity:e,attributeType:t,parentUri:i,index:0})}),e)}),t)},Rl=(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===lt.TYPE_NESTED?gl({},e,{value:Rl({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return gl({},s(t),Nl({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),Sl=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=Al({parentUri:n,attributeType:r}),u=Vs(l);return(0,ve.ZP)(t,(e=>{Ts(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},wl=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,ve.ZP)(t,(e=>{Ts(e.attributes||e.value,r,n.uri,Vs(n),a,o,i)}))},Il=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,ve.ZP)(t,(e=>{Es(e.attributes||e.value,r,n,i,a,o)}))},Ul=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,ve.ZP)(t,(e=>{hs(e.attributes||e.value,r,n,i)}))},Cl=e=>""===e,Dl=(0,l.cond)([[(0,l.propSatisfies)((0,l.complement)((0,l.anyPass)([Cl,l.isNil])),"lookupCode"),l.F],[(0,l.propSatisfies)((0,l.anyPass)([Cl,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]]),jl=(0,l.reject)(Dl),Ll=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=>Ll({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),jl)),(0,l.when)((0,l.always)(t),(0,l.reject)(l.isEmpty)))},kl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Ll({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),Fs),deleteEmptyComplex:e})},Fl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)(kl(e),(0,l.reject)(l.isEmpty))},Ml=(0,l.curry)(((e,t)=>t.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:i}=t;return rl(r)?ml({entity:e,attributeType:r}):Sl({entity:e,attributeType:r,parentUri:n,index:i})}),e))),xl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n,value:i}=t;return rl(r)?bl({entity:e,attributeType:r,value:i}):Il({entity:e,attributeType:r,uri:n,value:i})})),$l=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n}=t;return rl(r)?hl({entity:e,attributeType:r}):Ul({entity:e,attributeType:r,uri:n})})),Vl=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)},Gl="UrlThumbnail",Wl="CdnUrlThumbnail",Bl=(0,l.curry)(((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(_s):(0,l.head)(n);return e&&e.value}return null})),Yl=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>Bl(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),ql=Yl(["CdnUrl","Url"],!0),Hl=Yl(["CdnUrlPreview","UrlPreview"],!0),Ql=Yl([Wl,Gl],!0),Kl=Yl([Wl,Gl]),Jl=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,l.cond)([[nr,(0,l.always)(t)],[(0,l.both)(rr,(0,l.always)(i)),(0,l.always)(i)],[l.T,(0,l.always)(n)]])(a),s=nr(a)?"uri":"name",u=(0,l.pipe)((0,l.prop)(a[s]),(0,l.when)((0,l.both)((0,l.always)(rl(a)),(e=>null===e)),(0,l.always)([""])),(0,l.defaultTo)([]),ie)(o);return(0,l.when)((0,l.always)(r(u,a)),(0,l.append)({attrType:a,values:u}),e)}),[])},Xl=(e,t,r)=>{const n=Qa(e),i=(0,l.any)(r?l.T:_s);return Jl(n,t,i)},zl=(e,t,r,n,i,a)=>{const o=Rt(null==r?void 0:r.uri)?qa(t,e):Ha(t,e);return Jl(o,r,((e,o)=>{const s=ra({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:_s,e)||nr(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let Zl;const eu=e=>{Zl=e};function tu(e,t){return Zl(e,t)}const ru=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)})),nu=50,iu=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=nu,offset:a=0}=e;return tu("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i,offset:a}),headers:{"Content-Type":"application/json"}})},au=(0,l.once)((()=>tu("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),ou=e=>tu("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),su=(e,t)=>tu("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),lu=e=>ee.fromNull(sn[e]).map(be().text).orSome(""),uu=(0,l.curry)(((e,t)=>`${e}_${t}`)),cu=(0,l.split)("_"),pu=(0,l.includes)("_"),du=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),yu=(0,l.curry)(((e,t)=>e.some(du(t)))),fu=yu([an.IN_RANGE,an.COUNT_RANGE,an.WITHIN]),Tu=yu([an.EXISTS,an.MISSING_VALUE]),Eu=(0,l.cond)([[Tu,(0,l.always)(0)],[fu,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),mu=(0,l.complement)(Tu),hu=yu([an.HAS_ALL,an.EQUALS,an.NOT_EQUALS]),bu=yu([an.COUNT_EQUALS,an.COUNT_NOT_EQUALS,an.COUNT_LT,an.COUNT_LTE,an.COUNT_GT,an.COUNT_GTE,an.COUNT_RANGE]),Ou=yu([an.IN_FILE,an.NOT_IN_FILE]),vu=e=>{switch(e){case an.COUNT_EQUALS:return an.EQUALS;case an.COUNT_NOT_EQUALS:return an.NOT_EQUALS;case an.COUNT_LT:return an.LT;case an.COUNT_LTE:return an.LTE;case an.COUNT_GT:return an.GT;case an.COUNT_GTE:return an.GTE;case an.COUNT_RANGE:return an.IN_RANGE}},gu=yu([an.ON,an.BEFORE,an.AFTER,an.WITHIN,an.NOT_EQUALS]),_u=yu([an.WITHIN]),Au=[[an.COUNT_EQUALS,an.COUNT_NOT_EQUALS,an.COUNT_LT,an.COUNT_LTE,an.COUNT_GT,an.COUNT_GTE],[an.NOT_IN_FILE,an.IN_FILE],[an.EQUALS,an.NOT_EQUALS,an.HAS_ALL],[an.LT,an.LTE,an.GT,an.GTE],[an.MISSING_VALUE,an.EXISTS],[an.COUNT_RANGE],[an.IN_RANGE],[an.STARTS_WITH,an.CONTAINS],[an.FULL_TEXT],[an.ON,an.BEFORE,an.AFTER,an.NOT_EQUALS],[an.WITHIN]],Nu=(e,t)=>Au.some((r=>r.includes(e)&&r.includes(t))),Pu=(0,l.pipe)(l.omit,l.values),Ru={OPTIONS_FOR_STRING:Pu(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],an),OPTIONS_FOR_DATE:[an.ON,an.BEFORE,an.AFTER,an.WITHIN,an.NOT_EQUALS,an.MISSING_VALUE,an.EXISTS,an.COUNT_EQUALS,an.COUNT_NOT_EQUALS,an.COUNT_LT,an.COUNT_LTE,an.COUNT_GT,an.COUNT_GTE,an.COUNT_RANGE,an.IN_FILE,an.NOT_IN_FILE],OPTIONS_FOR_BOOLEAN:Pu(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],an),OPTIONS_FOR_BLOB:Pu(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],an),OPTIONS_FOR_NUMBER:Pu(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],an),OPTIONS_FOR_LOOKUP:Pu(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],an),OPTIONS_FOR_ENUM:Pu(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],an),OPTIONS_FOR_ID:[an.EQUALS,an.NOT_EQUALS,an.IN_FILE,an.NOT_IN_FILE],OPTIONS_FOR_COUNT:[an.EQUALS,an.NOT_EQUALS,an.LT,an.LTE,an.GT,an.GTE,an.IN_RANGE],OPTIONS_FOR_COMPLEX:[an.COUNT_EQUALS,an.COUNT_NOT_EQUALS,an.COUNT_LT,an.COUNT_LTE,an.COUNT_GT,an.COUNT_GTE,an.COUNT_RANGE,an.EXISTS,an.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[an.EQUALS,an.NOT_EQUALS,an.EXISTS,an.MISSING_VALUE]},Su=e=>{const{type:t,singleValue:r=!1}=e,n=(e=>{switch(e){case lt.TYPE_TYPEAHEAD:case lt.TYPE_STRING:case lt.TYPE_PASSWORD:case lt.TYPE_TEXT:case lt.TYPE_CIK_ID:case lt.TYPE_URL:case lt.TYPE_BLOG_URL:case lt.TYPE_IMAGE_URL:case lt.TYPE_EMAIL:return Ru.OPTIONS_FOR_STRING;case lt.TYPE_LOOKUP:case lt.TYPE_DEPENDENT_LOOKUP:return Ru.OPTIONS_FOR_LOOKUP;case lt.TYPE_ENUM:return Ru.OPTIONS_FOR_ENUM;case lt.TYPE_DATE:case lt.TYPE_ACTIVENESS_DATE:case lt.TYPE_TIMESTAMP:case lt.TYPE_LOCAL_DATE:return Ru.OPTIONS_FOR_DATE;case lt.TYPE_BOOLEAN:case lt.TYPE_BOOLEAN_RADIO:return Ru.OPTIONS_FOR_BOOLEAN;case lt.TYPE_BLOB:return Ru.OPTIONS_FOR_BLOB;case lt.TYPE_LONG:case lt.TYPE_INT:case lt.TYPE_FLOAT:case lt.TYPE_DOUBLE:case lt.TYPE_NUMBER:return Ru.OPTIONS_FOR_NUMBER;case lt.TYPE_ENTITY_ID:return Ru.OPTIONS_FOR_ID;case lt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[an.EQUALS];case lt.TYPE_COUNT:return Ru.OPTIONS_FOR_COUNT;case lt.TYPE_NESTED:case lt.TYPE_REFERENCE:case lt.TYPE_IMAGE:return Ru.OPTIONS_FOR_COMPLEX;default:return Ru.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(bu,n):n},wu=e=>[Ce.and,Ce.andNot].includes(e),Iu=e=>[Ce.or,Ce.orNot].includes(e),Uu=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),Iu)),Cu=(Du=[Ce.and],e=>e.slice(0,-1).every((e=>Du.includes(e.operator))));var Du;const ju=e=>e.map(((e,t,r)=>{const n=0===t;return(0,l.assoc)("operator",n?null:r[t-1].operator,e)}),[]),Lu=e=>e.map(((e,t,r)=>{const n=t===r.length-1;return(0,l.assoc)("operator",n?null:r[t+1].operator,e)}),[]),ku=e=>`(${e})`,Fu=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},Mu=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=[Ce.or,Ce.orNot],n=t?[Ce.and,Ce.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)&&Fu(e.slice(1,-1));return!i&&!a||o?e:ku(e)},xu="and",$u=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)(xu,n,e),o=(e=>[Ce.andNot,Ce.orNot].includes(e))(a)?Mu(r):r;return i?o:`${t} ${a} ${o}`}),"")}},Vu=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),Gu=e=>Array.isArray(e)?e.map(Gu).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),Wu=(0,l.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),Bu=e=>`'${e}'`,Yu=e=>`"${e}"`,qu=e=>(0,l.pipe)((0,l.map)(e),(0,l.join)(" or ")),Hu=(0,l.pipe)(Gu,Wu),Qu=(0,l.pipe)(Hu,Bu),Ku=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.allPass)([(0,l.always)(fu(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[l.T,l.identity]])(t))),Ju=(e,t)=>bu(t)?{type:lt.TYPE_INT}:Ou(t)?{type:lt.TYPE_FILE}:gu(t)&&!_u(t)&&gr(e.type)?{type:lt.TYPE_LOCAL_DATE}:e,Xu=Object.values(fn),zu=e=>!Object.values(fn).includes(e),Zu=e=>Xu.includes(e),ec=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Tn;return be().text(t[e])},tc=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.values(dn),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Tn;return e.map((e=>({value:e,get label(){return ec(e,t)}})))},rc=e=>{const t=f()().startOf("minute");switch(e){case dn.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case dn.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case dn.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case dn.LAST_6MONTHS:return[f()(t).subtract(6,"months").valueOf(),t.valueOf()];case dn.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()];case yn.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()];default:return e}},nc=e=>{let[t,r]=e;return[f()(t).valueOf(),f()(r).endOf("date").valueOf()]},ic=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rc;return(0,l.is)(String,e)?t(e):nc(e)};let ac;!function(e){e.CurrentUser="currentUser"}(ac||(ac={}));const oc={},sc=(e,t)=>{oc[e]=t},lc=e=>oc[e];function uc(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}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 pc=e=>e.split("{CurrentUser}").join(lc(ac.CurrentUser)||""),dc=(0,l.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),yc=(0,l.curry)(((e,t,r)=>{const n=r.map(fu(e)||t.endsWith(".count")?Hu:Qu).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),fc=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},Tc=e=>{let{filter:t,fieldName:r,values:n}=e;const i=Eu(t);return(0,l.pipe)(fc(i),(0,l.map)(yc(t,r)),dc(" or "))(n)},Ec=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(Qu).join(",")})`},mc=e=>`*${e}*`,hc=e=>`URL:${e}`,bc=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,Oc=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===an.IN_FILE?r:`not ${r}`},vc=(e,t)=>[R(e,t),S(e,t)],gc=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!_c(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case an.ON:return uc({},e,n?{filter:an.EQUALS}:{filter:an.IN_RANGE,values:[vc(i,n)]});case an.BEFORE:return uc({},e,{filter:an.LTE,values:[[S(i,n)]]});case an.AFTER:return uc({},e,{filter:an.GTE,values:[[R(i,n)]]});case an.WITHIN:return uc({},e,{filter:an.IN_RANGE,values:[rc(i)]})}}return e}),Tc),_c=(0,l.propSatisfies)(gr,"type"),Ac=[[(0,l.prop)("rawFilter"),(0,l.pipe)((0,l.prop)("rawFilter"),pc)],[(0,l.propEq)("filter",an.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(Tc({filter:an.EQUALS,fieldName:t,values:[r]}))),new $u).build())),dc(" or "))(r)}),pc)],[(0,l.propEq)("filter",an.CONTAINS),(0,l.pipe)((e=>{let{filter:t,fieldName:r,values:n}=e;return Tc({fieldName:r,filter:t,values:n.map((0,l.pipe)(Gu,mc))})}),pc)],[(0,l.propEq)("filter",an.EQUALS),(0,l.pipe)((e=>{const{fieldName:t,values:r}=e;return"type"===t?Tc(uc({},e,{values:(0,l.flatten)(r)})):bc(r)?Ec(uc({},e,{filter:"listEquals"})):Tc(e)}),pc)],[(0,l.propEq)("filter",an.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=Eu(t);return(0,l.pipe)(fc(i),(0,l.map)(yc(t,r)),dc(" and "))(n)})(uc({},e,{values:(0,l.flatten)(e.values)})):_c(e)?(e=>{const{values:t}=e,r=!_c(e),[n]=t;return(new $u).addClause(Tc(uc({},e,{filter:an.LT,values:[R(n,r)]}))).addClause(Tc(uc({},e,{filter:an.GT,values:[S(n,r)]}))).orBuild()})(e):bc(t)?Ec(uc({},e,{filter:"not listEquals"})):Tc(e)}),pc)],[(0,l.propSatisfies)(Ou,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return Tc({fieldName:r,filter:Oc(t,r),values:n.map((0,l.prop)("link")).map(hc)})}],[(0,l.propSatisfies)(bu,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return Tc({fieldName:`${r}.count`,values:n,filter:vu(t)})}],[(0,l.propSatisfies)(gu,"filter"),gc],[(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 yc(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return yc(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,(0,l.pipe)(Tc,pc)]],Nc=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!mu(e)||Rc(e,r))},Pc=(e,t)=>Array.isArray(t)?Rc(e,t):e===an.WITHIN?Zu(t)||Number.isInteger(t):!(0,l.isNil)(t)&&Gu(t).length>0,Rc=(e,t)=>t&&t.length>0&&t.every((t=>Pc(e,t)));function Sc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wc=e=>{let{fieldName:t=""}=e;const r=t.split("."),n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},Ic=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),Uc=(e,t,r)=>"children"===e?Dc(r,[...t][0],!0):r,Cc=(e,t,r)=>"values"===e?[...r,...t]:r,Dc=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)(Uc,t),e);if(!r&&hu(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(Cc,t),e)}return(0,l.append)(t,e)},jc=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=wc(e),r=e=>e.fieldName===t?e:r({fieldName:Ic(e),children:[e]});return r(e)})(t);return Dc(e,r)}),[]),Lc=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")),kc=e=>{let[t]=e;return t.children?kc(t.children):t.operator},Fc=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=kc(t)===Ce.andNot,a=n(t,!1),o=i?`not ${Mu(a)}`:a,s=n(r,!1);return`inSameAttributeValue(${o} ${kc(r)||xu} ${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&&Lc(i)&&!t?r(i):n(i,a)}],...e])(o))),new $u).buildWithOperators(i.map((0,l.prop)("operator")))}return n},Mc=(0,l.pipe)((0,l.propOr)("","filter"),pu),xc=(0,l.map)((0,l.when)(Mc,(e=>{const[t,r]=cu(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){Sc(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),$c=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)(Nc),xc,jc,Fc([...e,...Ac],t))},Vc=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),Gc=[an.ON,an.BEFORE,an.AFTER,an.WITHIN,an.NOT_EQUALS,an.MISSING_VALUE,an.EXISTS],Wc=[an.EQUALS,an.NOT_EQUALS,an.STARTS_WITH,an.MISSING_VALUE,an.HAS_ALL,an.FULL_TEXT,an.EXISTS],Bc=[an.EQUALS,an.NOT_EQUALS,an.LT,an.LTE,an.GT,an.GTE,an.IN_RANGE],Yc=(e,t)=>{const r=er(e);return(e=>{switch(e){case gn.startDate.name:case gn.endDate.name:case An.dueDate.name:case Rn.createdTime.name:case Rn.updatedTime.name:case wn.reltioLoadDate.name:case wn.createDate.name:case wn.updateDate.name:case wn.deleteDate.name:case wn.publishDate.name:return Gc;case Sn.matches.name:case wn.count.name:return Bc;case An.workflow.name:case An.assignee.name:case An.step.name:case Nn.commenter.name:case Rn.createdBy.name:case Rn.updatedBy.name:case wn.sourceSystems.name:case wn.value.name:return Wc;default:return null}})(t)||Su(r)},qc=[an.EQUALS,an.NOT_EQUALS,an.CONTAINS,an.STARTS_WITH,an.MISSING_VALUE,an.HAS_ALL,an.IN_RANGE,an.WITHIN,an.EXISTS,an.ON],Hc=(0,l.pipe)(Yc,(0,l.filter)((0,l.includes)(l.__,qc))),Qc=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(_s);return a&&a[0]&&(r=n.length>0&&a[0].value?Qc(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}}),""),Kc=(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=Qc(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},Jc=/[,\s]*$/,Xc=e=>{const t=be().text(hn);if(!e)return t;const r=e.replace(Jc,"");return""===r.toString().trim()?t:r},zc=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},Zc=(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=zc(e,r.referencedEntityTypeURI);if(n)return Kc({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return Kc({attributes:t||{}},r.dataLabelPattern);return""},ep=e=>{let{uiPath:t,uri:r}=e;return`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},tp=e=>{let{uiPath:t,tag:r,entityUri:n}=e;return`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},rp=(0,l.curry)(((e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"")),np=(0,l.when)((0,l.is)(Object),(0,l.ifElse)((0,l.pipe)((0,l.prop)("value"),(0,l.is)(Object)),Ql,(0,l.prop)("value"))),ip=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),np),ap=(e,t,r)=>{const n=ip(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)($s(e),np)))(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")])})(Jr(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>Ms(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,np))(r)})(e,r)||rn(e,r.type);return rp(t,n)};function op(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){sp(e,t,r[t])}))}return e}function sp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lp="DTSS/",up=(0,l.replace)(new RegExp("^entities/"),""),cp=e=>lp+e.dataTenant+"/"+e.uri,pp=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),dp=e=>!(!e||!e.dataTenant),yp=(0,l.startsWith)(lp),fp=(0,l.pipe)((0,l.ifElse)(yp,(0,l.pipe)((0,l.split)("/"),(0,l.nth)(1)),(0,l.always)(null))),Tp=(0,l.ifElse)(dp,cp,(0,l.prop)("uri")),Ep=e=>e&&e.uri?e.dataTenant?cp(e):up(e.uri):"",mp=(0,l.curry)(((e,t,r)=>(Jr(t,r.type)||{})[e]||"")),hp=mp("label"),bp=mp("typeGraphIcon"),Op=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=Jr(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(_s)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:Zc(e,o,i),uri:a.uri}})).filter(l.identity):[]},vp=(0,l.pipe)(Op,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),gp=(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=gp(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):gp(e.slice(1),r)}})),_p=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,Ap=e=>(0,l.propOr)([],"matchRules",e),Np=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?op({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},Pp=(e,t,r)=>t&&r?r.aEntity:e,Rp=(0,l.evolve)({attributes:Fl(!0)}),Sp=(0,l.pipe)(Rp,(0,l.props)(["attributes","startDate","endDate","roles","tags"]),(0,l.all)(E)),wp=e=>(0,l.assoc)("dataTenant",e);function Ip(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){Up(e,t,r[t])}))}return e}function Up(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cp=e=>{let{parentUri:t,relation:r,entityUri:n}=e;return{type:Be.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},Dp=e=>{let{relationUri:t}=e;return{type:Be.DELETE_RELATION,parameters:{relationUri:t}}},jp=e=>{let{parentUri:t,entityUri:r,relationType:n,relationDirection:i}=e;return{type:Be.IGNORE_RELATION,parameters:{parentUri:t,entityUri:r,relationType:n,relationDirection:i}}},Lp=e=>{let{oldRelation:t,newRelation:r}=e;return{type:Be.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},kp=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:Be.REPOINT_RELATION,parameters:{entityUri:t,newEntityUri:r,relation:n,isReversed:i}}},Fp=(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))),Mp=e=>e.type===Be.DELETE_RELATION,xp=e=>e.type===Be.CREATE_RELATION,$p=e=>e.type===Be.REPOINT_RELATION,Vp=e=>e.type===Be.UPDATE_RELATION,Gp=e=>e.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve()),Wp=e=>{let{type:t,parameters:r,dcrProcessor:n}=e;const{enhanceUriWithDCR:i,updateDCRUriFromResponse:a}=n,o=e=>(a(e),e);switch(t){case Be.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:a,attributes:s,startDate:l,endDate:u}=t;return wf({startEntityUri:e,endEntityUri:n,relationType:a,attributes:s,startDate:l,endDate:u,uriPreprocessor:i}).then(o)};case Be.DELETE_RELATION:return()=>{const{relationUri:e}=r;return Sf(e,i).then(o)};case Be.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return Df(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(o)};case Be.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return If({oldRelation:e,newRelation:t,uriPreprocessor:i}).then(o)};case Be.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:i,isReversed:a}=r,{uri:o}=i,s=[Dp({relationUri:o}),Cp({parentUri:a?e:t,relation:i,entityUri:a?t:e})];return(0,l.pipe)((0,l.map)(Yp(n)),(0,l.map)(Wp),Gp)(s)}}},Bp=e=>t=>()=>e().then(t),Yp=e=>t=>Ip({dcrProcessor:e},t),qp=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=$r({alwaysCreateDCR:e,dcrUri:t});return{commandExecutor:(0,l.pipe)(l.flatten,(0,l.map)(Yp(r)),(0,l.map)(Wp),(0,l.map)(Bp(r.getDcrUriAwait)),Gp,(0,l.otherwise)((e=>({errorMessage:e})))),dcrProcessor:r}},Hp=e=>t=>(0,l.map)((t=>Ip({},t,{parameters:(0,l.evolve)({parentUri:Mm(e),entityUri:Mm(e),newEntityUri:Mm(e)},t.parameters)})),t),Qp=e=>{let{condition:t,updater:r}=e;return e=>t(e)?r(e):e},Kp=(e,t)=>{const r=e.filter(xp).find(Fp(t));let n=null,i=null,a=null;const o=e.filter(((o,s)=>Vp(o)&&Fp(t,o)?(s>e.indexOf(r)&&(n=o.parameters.newRelation),!1):!$p(o)||!Fp(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(Qp({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},Jp=(e,t)=>{const r=e.filter($p).filter(Fp(t));let n=null;const i=e.filter(((i,a)=>r.includes(i)?(0,l.last)(r)===i:!Vp(i)||!Fp(t,i)||(a>e.indexOf((0,l.last)(r))&&(n=i.parameters.newRelation),!1)));return n?i.map(Qp({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({relation:(0,l.always)(n)})})(e)})):i},Xp=(e,t)=>{const r=e.filter(Mp).filter(Fp(t));return e.filter((e=>r.includes(e)?(0,l.last)(r)===e:!Fp(t,e)))},zp=(e,t)=>{const r=e.filter(Vp).filter(Fp(t));let n=null;const i=e.filter((e=>!r.includes(e)||!Vp(e)||(n=n||e.parameters.oldRelation,(0,l.last)(r)===e)));return n?i.map(Qp({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({oldRelation:(0,l.always)(n)})})(e)})):i},Zp=e=>{const t=e.filter(Mp).map((e=>{let{parameters:{relationUri:t}}=e;return t}));return(0,l.uniq)(t).reduce(Xp,e)},ed=e=>{const t=e.filter(xp).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(Kp,e)},td=e=>{const t=e.filter($p).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(Jp,e)},rd=e=>{const t=e.filter(Vp).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)(zp,e))(t)},nd=e=>(0,l.pipe)(Zp,ed,td,rd)(e);function id(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){ad(e,t,r[t])}))}return e}function ad(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const od=e=>id({},(0,l.path)(hd(),e),{startDate:(0,l.path)(gd(),e),endDate:(0,l.path)(_d(),e)}),sd=(e,t)=>(0,l.pipe)((0,l.path)(vd()),Mm(t))(e),ld=(e,t,r,n)=>{let{removedUris:i=[],addedConnections:a=[],editedConnections:o=[],ignoredRelationData:s=[]}=t;return[...a.map((e=>{const t=sd(e,r),i=(0,l.path)(bd(),e)===Ye.IN,a=e.parentEntityUri||n;return Cp({parentUri:i?t:a,relation:od(e),entityUri:i?a:t})})),...o.map((t=>{const i=sd(t,r),a=(0,l.path)(bd(),t)===Ye.IN,o=i!==(0,l.pipe)((0,l.path)(hd()),a?Ad:Nd)(t),s=Sd(e,(0,l.path)(Ed(),t)),u=t.parentEntityUri||n,c=Mm(r,i);return o?kp({entityUri:a?u:c,newEntityUri:a?c:u,relation:(0,l.path)(hd(),t),isReversed:!1}):Lp({oldRelation:(0,l.path)(hd(),s),newRelation:od(t)})})),...i.map((e=>Dp({relationUri:e}))),...s.map((e=>jp({parentUri:n,entityUri:e.entityUri,relationType:e.relationType,relationDirection:e.relationDirection})))]},ud=e=>(e||[]).reduce(((e,t)=>{let{entity:r}=t;const n=r.dataTenant;return id({},e,{[r.entityUri]:{uri:r.entityUri,label:r.entityLabel,type:r.entityType,dataTenant:n}})}),{}),cd=(0,l.has)("dataTenant"),pd=(0,l.ifElse)(cd,(e=>{let{relationUri:t,dataTenant:r}=e;return`DTSS/${r}/${t}`}),(0,l.prop)("relationUri")),dd=(e,t)=>(0,l.pipe)(Pi,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(tl),Ba)(e,t),yd=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)}},fd=(e,t,r)=>{const n=Kc(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)},Td="relation",Ed=(0,l.always)([Td,"relationUri"]),md=(0,l.always)([Td,"relationType"]),hd=(0,l.always)([Td,"object"]),bd=(0,l.always)([Td,"direction"]),Od=(0,l.always)([Td,"object","attributes"]),vd=(0,l.always)(["entity","entityUri"]),gd=(0,l.always)([Td,"startDate"]),_d=(0,l.always)([Td,"endDate"]),Ad=(0,l.path)(["startObject","objectURI"]),Nd=(0,l.path)(["endObject","objectURI"]),Pd=(0,l.path)(["startObject","objectTypeURI"]),Rd=(0,l.path)(["endObject","objectTypeURI"]),Sd=(e,t)=>{for(const r of e){if((0,l.pipe)((0,l.path)(Ed()),(0,l.equals)(t))(r))return r;if(r.connections){const e=Sd(r.connections,t);if(e)return e}}},wd=(0,l.pipe)(Sd,(0,l.path)(hd())),Id=(0,l.allPass)([(0,l.pipe)((0,l.path)(vd()),(0,l.complement)(E)),(0,l.pipe)((0,l.path)(md()),(0,l.complement)(E))]),Ud=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:wt()},entity:{},isNew:!0},{relationType:o,direction:s}=a.relation,{inRelations:u,outRelations:c}=jd({content:i?t.contentSecondLevel:t.content,direction:s,relationType:o,mode:r,metadata:n}),p=Cd(u,c);return(0,l.pipe)((0,l.evolve)({relation:p?yd(p):l.identity}),(0,l.defaultTo)({}),(0,l.when)((0,l.always)(i),(0,l.assoc)("parentEntityUri",i)))(a)},Cd=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:bn.IN}:{type:t[0],direction:bn.OUT}:null},Dd=e=>e.uri||e,jd=e=>{let{content:t,direction:r,relationType:n,mode:i,metadata:a}=e;const o={},s=e=>t=>{const a=t&&xi(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===bn.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"],Jr(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],Jr(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(Dd,Pi(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(bn.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(bn.OUT)),(0,l.map)(u))},t)||{}},Ld=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}=Ui({reversedContextLabels:!0}),a=(0,l.curry)(((e,t,r,n)=>{const[i,a]=Si(e,n.uri);return n&&(!t||zr(e,i,t))&&(!r||zr(e,a,r))})),o=t=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],Jr(e,t.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],Jr(e,t.endObject.objectTypeURI)))(t),s=(e.relationTypes||[]).filter((0,l.both)(ls,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)}},kd=(0,l.curry)(((e,t,r,n,i)=>{const a=zr(n,l.__,t.type),o=e?Rd:Pd,s=zr(n,l.__,r.type),u=e?Pd:Rd;return(0,l.both)((0,l.pipe)(o,a),(0,l.pipe)(u,s))(i)})),Fd=(e,t,r)=>{const n=e?Rd:Pd,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(zr(t,l.__,r))})),(0,l.reject)((0,l.prop)("abstract")),(0,l.map)((0,l.prop)("uri")))(t.entityTypes||[])};function Md(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xd=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}},$d=e=>!e.deactivated,Vd=e=>{let{attributeTypeUri:t,uri:r,parentUri:n}=e;return`${t}-${r}-${n}`},Gd=e=>Vd(e)+e.message,Wd=(0,l.unless)(l.isNil,(0,l.prop)("message")),Bd=(0,l.unless)(l.isNil,(0,l.prop)("type")),Yd=(0,l.curry)(((e,t)=>Lt(t.parentUri,e))),qd=(0,l.curry)(((e,t)=>t.parentUri===e)),Hd=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pipe)((0,l.prop)("uri"),Lt(t.attributeTypeUri)),l.T],[(0,l.both)((0,l.propEq)("type",lt.TYPE_REFERENCE),(0,l.pipe)(yt,(0,l.any)(Lt(t.attributeTypeUri)))),l.T],[l.T,l.F]])(e))),Qd=(0,l.curry)(((e,t)=>t.attributeTypeUri===e)),Kd=(0,l.curry)(((e,t,r)=>e===r.parentUri&&t!==r.attributeTypeUri)),Jd=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,l.filter)((0,l.allPass)([iy,$d,Yd(e),Hd(t),(0,l.complement)(Kd(e,t.uri))]))(r)},Xd=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=(0,l.find)((0,l.allPass)([iy,$d,qd(e),Qd(t.uri),(0,l.complement)((0,l.prop)("uri")),(0,l.complement)((0,l.propEq)("type",ge.missed))]))(r);return n&&n.message||""},zd=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===ge.missed))},Zd=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([$d,(0,l.propEq)("type",ge.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(Ed(),e))]))(t)},ey=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([$d,(0,l.propEq)("type",ge.missedRefEntity),(0,l.propEq)("parentUri",e.uri)]))(t)},ty=function(e){let{uri:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.any)((0,l.allPass)([$d,Yd(t)]))(r)},ry=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([$d,(0,l.propEq)("type",ge.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(["relation","uri"],e))]))(t)},ny=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?Km(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 Re.attributeValue:{const e=a;if(sr(a))return Kc(o,e.dataLabelPattern);if(lr(a)){const t=o,i=Ds(t),a=pt(e),s=Jr(n,a);return Rt(i)?Kc(r[i],s.dataLabelPattern):t.label}return""}case Re.tempEntity:return Kc(o,a.dataLabelPattern);case Re.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=Jr(n,null==e?void 0:e.entityType);return`${Xc(i&&Rt(i)?Kc(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||Ri(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){Md(e,t,r[t])}))}return e}({},e,{label:Xc(t)})}))},iy=e=>!e.severity||e.severity===Ae.ERROR,ay=(0,l.curry)(((e,t)=>{let r=t.value;switch(e.type){case lt.TYPE_NESTED:return Object.keys(r).some((t=>{const n=e.attributes.find((0,l.propEq)("name",t));return r[t].some(ay(n))}));case lt.TYPE_REFERENCE:return!!Ps(t);case lt.TYPE_BOOLEAN:return!0===r||!1===r||"true"===r||"false"===r;default:return"string"==typeof r&&(r=r.trim()),null!=r&&""!==r}})),oy=(e,t)=>e.every((0,l.complement)(ay(t))),sy=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const n=ko(e,t.type||t.relationType,!0).filter(r);return n.reduce(((r,n)=>{const i=Ms(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!_s(e.parent))))).forEach((e=>{oy(e.attrValues,n)&&r.push(xd({type:ge.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:be().text("Attribute is required"),source:_e.local}))})),r}),[])},ly=(0,l.curry)(((e,t,r)=>Ms(e,t,r,!1))),uy=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),Jr(e),(0,l.prop)("attributes"),(0,l.defaultTo)([]),(0,l.reject)(ar),(0,l.filter)(lr),(0,l.map)((0,l.prop)("uri")),(0,l.chain)(ly(e,t)));return(0,l.pipe)(r,(0,l.reject)(Ds),(0,l.map)((e=>{let{uri:r}=e;return xd({type:ge.missedRefEntity,uri:"",attributeTypeUri:Vt(r,t.type),parentUri:r,message:be().text("Entity is required"),source:_e.local})})))(t)},cy=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,l.has)("refEntity")).filter((0,l.pipe)(Ds,Rt)).flatMap((n=>{const i=Ds(n),a=t[i],o=mr(e,Vt(n.uri,r.type));return py(e,t,o,a)})),py=(e,t,r,n)=>{const i=yt(r),a=i.map((t=>mr(e,t))).filter((0,l.both)(l.identity,(0,l.propEq)("type",lt.TYPE_REFERENCE))).flatMap(Tt).concat(i);return dy(e,t,n,(e=>a.some(Lt(e.uri))))},dy=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity;const i=sy(e,r,n),a=uy(e,r),o=cy(e,t,r);return[...i,...a,...o]},yy=(e,t)=>{const r=(0,l.path)(hd(),t)||{};return sy(e,r)},fy=(e,t,r)=>{t=t||{};const n=(0,l.pipe)((0,l.path)(vd()),(0,l.ifElse)(Rt,(e=>t[e]),(0,l.always)(null)))(r),i=yy(e,r),a=(e=>(0,l.path)(vd(),e)?[]:[xd({type:ge.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(md(),e),parentUri:(0,l.path)(Ed(),e),message:be().text("Entity is required"),source:_e.local})])(r),o=((e,t,r)=>r?dy(e,t,r):[])(e,t,n);return[...i,...a,...o]},Ty=e=>(0,l.path)(["entity","uri"],e)?[]:[xd({type:ge.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(["relation","type"],e),parentUri:(0,l.path)(["relation","uri"],e),message:be().text("Entity is required"),source:_e.local})],Ey=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=sy(e,r),i=Ty(t);return[...n,...i]};function my(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hy=(e,t)=>{var r,n;const i=Jr(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||so(e)},by=e=>(0,l.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),Oy=e=>{const t=r=>(0,l.ifElse)(Array.isArray,(0,l.map)(t),(0,l.pipe)(by(e),(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(0,l.map)(t))})))(r);return t},vy=(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)(js,Rt,l.not)]),(e=>{const t=(0,l.pipe)(js,Ft)(e);return Oy((e=>e.replace(t,t+vt)))(e)})),(0,l.when)((0,l.pipe)(Ds,Rt),(t=>{const r=Ds(t),n=e[r],i=n&&_y(n,e);return null!=i&&i.attributes?(0,l.evolve)({value:e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){my(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),gy=(e,t,r)=>Ah(vh((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),Rh((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e).map((e=>(0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.pipe)((0,l.filter)((e=>!e.refRelation||e.refEntity)),(0,l.map)(vy(r,e.type)),(0,l.map)(Oy(Ht))))})(e))).concat(Lm(e,t)),_y=(e,t)=>(0,l.evolve)({attributes:Ll({valueTransformer:(0,l.pipe)(Fs,vy(t),by(Ht)),deleteEmptyComplex:!0}),uri:Ht})(e);function Ay(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){Ny(e,t,r[t])}))}return e}function Ny(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Py=(0,l.unless)(l.isNil,(e=>e.replace(new RegExp(Ot,"g"),"uri$$$$").replace(new RegExp(vt,"g"),""))),Ry=e=>(0,l.pipe)((0,l.evolve)({objectUri:Py,objectParentUri:Py}),(e=>{return Ay({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?ge.missed:ge.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&&qt(e.objectUri),uri:e.objectUri,source:_e.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),Sy=(e,t)=>(0,l.map)((0,l.pipe)(Ry,(e=>{var r,n,i,a;const{metadata:o}=t,{uri:s,parentUri:u}=e,c=ny(t,s),p=null!=c&&c.length?c.slice(0,-1):ny(t,u),d=((e,t,r)=>{let{uri:n,attributeTypeUri:i}=r,a=i&&mr(e,i);if(!a&&n&&t&&t.length){const e=(0,l.last)(t);e.type===Re.attributeValue&&(a=e.valueType)}return a})(o,c,e);return Ay({},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&&Yt(i)){const n=(0,l.last)(a),i=n.valueType;if(lr(i)&&Et(i).includes(o)){const i=Ds(n.value),o=i&&Rt(i)?t[i]:null;return o?Ay({},e,{parentUri:o.uri,path:a.concat({type:Re.tempEntity,value:o,valueType:Jr(r,o.type),label:""})}):e}}return e}})(t)))(e),wy=e=>{if(e.type===Pe.AGO||e.type===Pe.WITHIN){const[t,r]=e.period;return"Number"===(0,l.type)(t)&&"String"===(0,l.type)(r)&&t>0}if(e.type===Pe.BETWEEN){const[t,r]=e.period;return t instanceof Date&&r instanceof Date}},Iy=e=>`equals(user, '${Wu(e)}')`,Uy=e=>`equals(items.delta.sources, '${e.abbreviation}')`,Cy=e=>`equals(items.objectType, '${e.uri}')`,Dy=e=>{const{period:t,type:r}=e;if(!wy(e))return"";switch(r){case Pe.WITHIN:return`gte(timestamp, ${X(t)})`;case Pe.AGO:return`lte(timestamp, ${X(t)})`;case Pe.BETWEEN:{const[e,r]=t;return`range(timestamp, ${e.valueOf()}, ${f()(r).endOf("date").valueOf()})`}default:return""}},jy=e=>[`equals(items.objectUri, '${e}')`,`equals(items.startObjectUri, '${e}')`,`equals(items.endObjectUri, '${e}')`].join(" or "),Ly=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),ky=e=>{let{query:t,body:r}=e;return t=Ly(t),tu(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},Fy=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)($c(),Vc(t.globalFilter))(n),activeness:t.activityFilter||mn.ACTIVE_ONLY};return t.searchOptions&&(i.options=t.searchOptions),`/entities/_total${Fr(i)}`},My=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=Fy(e,t,r);return tu(n)},xy=e=>tu(`/entities/_total?${e}`),$y=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(0,l.pipe)((0,l.filter)(us),(0,l.map)((0,l.prop)("uri")))(e),i={filter:an.EQUALS,fieldName:"type",values:n},a=r.isRawFilter?{rawFilter:t}:{filter:"containsWordStartingWith",fieldName:"attributes",values:[t]},o=(0,l.pipe)($c(),Vc(r.globalFilter))([i,a]),s=Fr({filter:o,select:"uri,label,type,roles,secondaryLabel,defaultProfilePicValue",scoreEnabled:!0,activeness:r.activityFilter||mn.ACTIVE_ONLY,max:r.max||4});return tu("/entities/_typeAheadSearch"+s,{method:"GET"})},Vy=(0,l.pipe)((0,l.reject)(l.isNil),kr),Gy=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)($c(),Vc(i))(r),p=Vy({filter:c||null,activeness:a||"active",options:o||null}),d=[{fieldName:t,pageSize:s||20,pageNo:u||1,orderType:n.orderType||"reversedCount"}];return ky({query:p,body:d})},Wy=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return Gy({fieldName:t,searchParams:i,options:n})};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="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",qy=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)($c(),Vc(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||Yy,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null};return t.searchOptions&&(i.options=t.searchOptions),`/entities${Fr(i)}`},Hy=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=qy(e,t,r);return tu(n)},Qy=e=>ef(e,{select:"secondaryLabel"}),Ky=(e,t)=>{const{select:r=Yy,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),tu("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},Jy=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),Rt)),Xy=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=Jy(n).length,T={[r]:{max:a,offset:(0,l.isNil)(i)?y-f:i}},E=pr(r),m={attributesPaging:T,defaultMaxValues:a,options:d,select:"crosswalks,"+E},h=[...c,{filter:"containsWordStartingWith",fieldName:E,values:[u]}],b=(0,l.pipe)($c(),Vc(d.globalFilter))(h);return b&&(m.filter=b),p&&(m.sort=p.field,m.order=p.order),tu(`${s}/api/${o}/${t}/_object`,{method:"POST",body:JSON.stringify(m)})},zy=e=>`entities?filter=equals(uri,'${e}')&offset=0`,Zy={options:"sendHidden,addRefAttrUriToCrosswalk"},ef=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zy;return tu(`/${e}${Fr(t)}`)},tf=(e,t)=>ef(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){By(e,t,r[t])}))}return e}({},Zy,{explicitSurvivorshipGroup:t})),rf=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 tu(n,r)},nf=e=>tu(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),af=(e,t,r)=>{const n={method:"POST",body:JSON.stringify(t)};return tu(`/${e}/_clone${Fr({executeLCA:!1,valuesToCopy:r})}`,n)},of=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return tu(`/entities/_events/_total${kr({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},sf=(e,t)=>tu(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",body:t}),lf=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return tu(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",body:JSON.stringify(r)})},uf=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 tu(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),kr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},cf=e=>{const t=new FormData;return t.append("file",e),tu("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=ye(e,be().text("Can't upload file"));return Promise.reject(t)}))},pf=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 tu(`/personal/findSavedSearches${kr({countResults:s,findPublic:l})}`,{method:"POST",body:JSON.stringify({containsWordStartingWith:t,sortBy:r,sortOrder:n,favoriteOnly:i,offset:a,max:o,includes:u,startsWith:c}),headers:{"Content-Type":"application/json"}})},df=e=>tu(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),yf=e=>tu("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),ff=e=>{const{uri:t}=e,r=(0,l.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return tu(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},Tf=e=>{let{uri:t}=e;return tu(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},Ef=(e,t)=>(0,l.pipe)((0,l.evolve)({isPublic:(0,l.always)(t)}),ff)(e),mf=(e,t)=>(0,l.pipe)((0,l.evolve)({isFavorite:(0,l.always)(t)}),ff)(e);function hf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bf=["max","offset","filter"],Of=(0,l.curry)(((e,t)=>t.nextEntry?(0,l.evolve)({nextEntry:Of(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){hf(e,t,r[t])}))}return e}({},t,(0,l.pick)(bf,e)))),vf=e=>{if(1===e.length&&((0,l.pathEq)([0,"activeness","entity"],Ue.ALL,e)||(0,l.pathEq)([0,"activeness","relation"],Ue.ALL,e)))return!1},gf=(0,l.omit)(["activeness"]),_f=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=vf(t),{searchByOv:i}=r;t=(0,l.map)((0,l.pipe)((0,l.when)((0,l.prop)("nextEntry"),(e=>(0,l.pipe)(Of(e),(0,l.omit)(bf))(e))),gf,(0,l.omit)(["labels"])))(t);const a={limitCreditsConsumption:!0,activeness_enabled:n,options:i?"searchByOv":void 0},o=`/${e}/_connections${Fr(a)}`,s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)};return{url:o,options:s}},Af=(0,l.map)((e=>{let t=e;for(;t&&t.nextEntry;)t=t.nextEntry;return t})),Nf=(0,l.reject)(l.isNil),Pf=(0,l.unless)((0,l.startsWith)("/"),(0,l.concat)("/")),Rf=e=>tu(Pf(e),{method:"GET",headers:{"Content-Type":"application/json"}}),Sf=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r=(0,l.pipe)(t,Pf);return tu(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},wf=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?Fl()(i):null,startDate:a,endDate:o},c=(0,l.pipe)(Nf,ie,JSON.stringify);return tu(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(u)})},If=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"),Pf,n),o=vh(i(t),i(r)).concat(_h(t,r));return tu(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},Uf=(e,t,r)=>{const{url:n,options:i}=_f(e,t,r);return tu(n,i).then(Af)},Cf=(e,t)=>tu(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),Df=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===bn.IN?a.inRelations=[n]:a.outRelations=[n],tu(`/${e}/_ignoreSuggestedRelationship`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},jf=e=>{let{servicesPath:t="",environment:r,tenant:n,application:i}=e;return tu(`${t}/recentSearches${Fr({environment:r,tenant:n})}`,{method:"GET",application:i,headers:{"Content-Type":"application/json"}})},Lf=e=>tu("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),kf=e=>{let{environment:t,tenant:r,createdDate:n}=e;return tu(`/recentSearches${Fr({environment:t,tenant:r,createdDate:n})}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};function Ff(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){Mf(e,t,r[t])}))}return e}function Mf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xf={select:"label,secondaryLabel,name,type,startDate,endDate"},$f=(0,l.reject)(l.isNil),Vf=(0,l.pipe)($f,kr),Gf=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i}=e;const a=Ff({},xf,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{},{limitCreditsConsumption:!0});return tu(`/${t}/_tree${Vf(a)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Wf=e=>{let{uri:t,graphUri:r}=e;const n=Ff({},xf,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return tu(`/${t}/_parents${Vf(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Bf=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1,limitCreditsConsumption:o,max:s}=e;const l=Ff({},xf,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},o?{limitCreditsConsumption:o}:{},s?{max:s}:{},{filterLastLevel:i,deep:a});return tu(`/${t}/_hops${Vf(l)}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function Yf(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 qf=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},Hf="/activities",Qf=e=>{let{label:t,description:r}=e;return tu(Hf,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:qf()}})};var Kf;!function(e){e.userSearch="USER_SEARCH",e.profileView="USER_PROFILE_VIEW"}(Kf||(Kf={}));const Jf=e=>{const t=Fr(e);return tu(Hf+t,{method:"GET"})},Xf=e=>tu(`/activities/_total${Fr(e)}`,{method:"GET"}),zf=e=>{const{entityUri:t}=e,r=Yf(e,["entityUri"]);return tu(`/${t}/_activities${Fr(r)}`,{method:"GET"})},Zf=e=>{const{entityUri:t}=e,r=Yf(e,["entityUri"]);return tu(`/${t}/_activities/_total${Fr(r)}`,{method:"GET"})};function eT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tT(e,t,r[t])}))}return e}function tT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rT=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},nT=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return tu(rT({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},iT=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=rT({url:r,workflowPath:t,tenant:n})),tu(s,{method:i||"GET",body:JSON.stringify(a),headers:eT({"Content-Type":"application/json"},null!=o?o:{})})},aT=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=rT({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,l.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return tu(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)},oT=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=rT({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?eT({},l,{comment:o}):l;return tu(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},sT=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const u=rT({url:`/tasks${s?Fr(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(eT({objectURIs:[i]},(0,l.reject)(E,a)))};return tu(u,eT({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},lT=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i,max:a,offset:o}=e;return tu(rT({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})})},uT=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i,max:a,offset:o}=e;return tu(rT({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)(eT({max:a,offset:o},i))})},cT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return tu(rT({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},pT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return tu(rT({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},dT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return pT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},yT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return tu(rT({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},fT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return pT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},TT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return pT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},ET=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return pT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},mT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a}=e;return tu(rT({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a})})},hT=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return tu(rT({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},bT=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 tu(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),kr)(d)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},OT=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 tu(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),kr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},vT=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return tu("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},gT=(e,t,r)=>Promise.all(t.map((async t=>await tu(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})))),_T=async(e,t)=>await gT(e,t,"NOT"),AT=async(e,t)=>await gT(e,t,"MATCH"),NT=async(e,t)=>await Promise.all(t.map((async t=>await tu(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}}))));function PT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){RT(e,t,r[t])}))}return e}function RT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ST(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 wT=3e4,IT=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return tu(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},UT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return JT({url:`entities/_connections/_hasNonImported?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}})},CT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return JT({url:`entities/_connections/_import?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}})},DT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return tu(`${t}entities/_merge?dataEntityUri=${i}&customerEntityUri=${a}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},jT=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 DT({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},LT=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{uri:a}=n,[o,s]=(0,l.partition)(dp,i);return Promise.all([s.length?vT(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return DT({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},kT=(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=ST(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)}),[])),FT=(0,l.pipe)((0,l.find)((0,l.propEq)("index",0)),(0,l.propOr)({},"object"),kT),MT=e=>{let{dtssPath:t,customerTenant:r,entity:n}=e;const{uri:i,dataTenant:a}=n;return tu(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:a,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(FT)},xT=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)},$T=xT((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return tu(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{uri:a,type:o}])}).then(FT)})),VT=xT((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return tu(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),GT=(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)}},WT=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return tu(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},BT=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 WT(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},YT=BT("NOT"),qT=BT("MATCH"),HT=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{uri:o}=i,[s,u]=(0,l.partition)(dp,a);return Promise.all([gT(o,u,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return WT(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},QT=HT("NOT"),KT=HT("MATCH");function JT(e){let{requestProvider:t=tu,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}`,PT({},ST(s,["headers"]),{headers:PT({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const XT=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return JT({url:qy(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},zT=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return JT({url:Fy(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},ZT=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a,options:o}=e;const{searchByOv:s}=o,{options:u}=_f(t,r);return JT({url:`entities/_connections/_getConnections${Fr({dataEntityUri:t,options:s?"searchByOv":void 0})}`,options:u,dataTenant:n,customerTenant:i,dtssPath:a}).then((0,l.pipe)(Af,(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)))}))))},eE=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return JT({url:`${zy(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},tE=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return tu(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},rE=e=>{let{dtssPath:t,tenant:r}=e;return tu(`${t}tenants/customerTenants?id=${r}&useCache=true`,{method:"GET",timeout:wT})},nE=e=>{let{dtssPath:t,customerTenant:r}=e;return tu(`${t}subscriptions?useCache=true`,{method:"GET",headers:{CustomerTenant:r},timeout:wT})},iE=e=>{let{dtssPath:t,tenants:r}=e;return tu(`${t}tenants/dataTenants?id=${r}&useCache=true`,{method:"GET",timeout:wT})},aE=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return JT({url:zy(t),dataTenant:r,customerTenant:n,dtssPath:i})},oE=()=>tu("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET"});function sE(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){lE(e,t,r[t])}))}return e}function lE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const uE=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=sE({},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 tu(`${t}/api/${r}/graph/search${Fr({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},cE=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return tu(`${t}/api/${r}/graph/search/count`,{method:"POST",body:sE({},n,i),headers:{"Content-Type":"application/json"}})},pE=(e,t)=>`${e}/${t}/comments`,dE=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return tu(`${pE(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},yE=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return tu(`${pE(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},fE=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return tu(pE(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},TE=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return tu(`${pE(t,r)}/${n.commentId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},EE=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return tu(`${pE(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},mE=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i}=e;return tu(`${pE(t,r)}/${n}/replies/${i}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},hE=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i,data:a}=e;return tu(`${pE(t,r)}/${n}/replies/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},bE=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return tu(`${pE(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},OE=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=Fr({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return tu(`${pE(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function vE(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){gE(e,t,r[t])}))}return e}function gE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _E=e=>{let{tenant:t,servicesPath:r}=e;return tu(`${r}/users/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})},AE="graphExport",NE=async(e,t,r,n,i)=>{let a;try{const{data:n={}}=await wE({servicesPath:e,tenant:t,environment:r,namespace:AE,options:{method:"GET",headers:{"Content-Type":"application/json"}}});a=n}catch(e){a={}}const o={body:JSON.stringify(vE({},a,{[n]:i})),headers:{"Content-Type":"application/json"}};let s;try{s=await wE({servicesPath:e,tenant:t,environment:r,namespace:AE,options:vE({method:"PUT"},o)})}catch(e){s=null}return s||(s=await wE({servicesPath:e,tenant:t,environment:r,namespace:AE,options:vE({method:"POST"},o)})),s},PE=e=>{let{servicesPath:t,key:r}=e;return tu(`${t}/settings${Fr({key:r})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},RE=e=>{let{servicesPath:t}=e;return tu(`${t}/version/collect`,{method:"POST",headers:{"Content-Type":"application/json"}})},SE=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return tu(`${n}/plugins${Fr({tenant:t,user:r})}`,{method:"GET"})},wE=e=>{let{tenant:t,environment:r,servicesPath:n,options:i,namespace:a,projection:o}=e;return tu(`${n}/configService${Fr({tenant:t,environment:r,namespace:a,projection:o})}`,i)},IE=e=>{let{tenant:t,environment:r,servicesPath:n}=e;return wE({tenant:t,environment:r,servicesPath:n,options:{method:"GET"}})},UE=e=>{let{servicesPath:t,stateHash:r}=e;return tu(`${t}/searchLink?key=${r}`,{method:"GET"})},CE=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),tu(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},DE=e=>tu(`/${e}?showObjectsInfo=true`,{method:"GET"}),jE=e=>{let{exportPath:t,tenant:r,options:n}=e;return tu(`${t}/${r}/activities${Fr(n)}`,{method:"POST"})};function LE(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){kE(e,t,r[t])}))}return e}function kE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const FE=e=>{const{entityUri:t}=e;return tu(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},ME=e=>{let{entityUri:t,crosswalk:r}=e;return tu(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},xE=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return tu("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[LE({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),LE({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},$E=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return tu(`/${r}/_${n}${Fr({contributorURI:t})}`,{method:"POST"})},VE=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return tu(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},GE=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return tu(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},WE=e=>{let{entityUri:t,crosswalkId:r}=e;return tu(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})};function BE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const YE=e=>{let{entityTypeUri:t}=e;return tu(`/dataQuality/fillRates${kr({entityType:Ft(t)})}`,{method:"GET"})},qE=e=>{let{attributes:t=[],metrics:r=[]}=e;const n=r.length,i=t.length*n;return i>10?10:i},HE=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){BE(e,t,r[t])}))}return e}({},n===We.ATTRIBUTE_TYPE?{attributes:r}:{},i?{metrics:i}:{}),o=n===We.ATTRIBUTE_TYPE?kr({numberOfThreads:qE({attributes:r,metrics:i})||1}):"";return tu(`/entityType/${Ft(t)}/dataQuality/${n}${o}`,{method:"POST",body:JSON.stringify(a)})},QE=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n,env:i}=e;return tu(`${t}/api/${r}/dataValidationFunctions/entityTypes/${Ft(n)}`,{method:"GET",headers:{env:i}})},KE=e=>{let{mlDqPath:t,tenant:r,entityTypeUri:n,attribute:i,viewMultiplier:a=1,dataLevel:o=We.ATTRIBUTE_TYPE,metrics:s=[],startDate:l,endDate:u}=e;const c={attribute:i,metrics:s,viewMultiplier:a,startDate:l,endDate:u};return tu(`${t}/${r}/entityType/${Ft(n)}/ml/dataQuality/v1/${o}/timeSeries/`,{method:"POST",body:JSON.stringify(c)})},JE=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return tu(`/${t}${Fr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},XE=e=>{let{attributeUri:t,value:r}=e;return tu(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},zE=e=>{let{attributeUri:t,value:r}=e;return tu(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},ZE=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return tu(`/${t}${Fr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},em=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=Fr({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=Fl()([[{value:a}]]);return tu(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},tm=e=>{let{entityUri:t,attributeName:r,value:n}=e;return tu(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},rm=e=>{let{entityUri:t,attributeName:r}=e;return tu(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};function nm(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{entityUri:t}=e;return tu(`/${t}/_historicURIs`,{method:"GET"})},am=e=>{let{entityUri:t,historicUris:r}=e,n=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["entityUri","historicUris"]);return tu(`/${t}/_changesWithTotal${Fr(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){nm(e,t,r[t])}))}return e}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},om=(e,t)=>tu(`/${e}/_previousChange${Fr({timestamp:t})}`,{method:"GET"}),sm=(e,t)=>tu(`/${e}${Fr({time:t})}`,{method:"GET"});function lm(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}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{url:t,method:r,data:n,headers:i,noRequestProcessor:a}=e;return tu(t,{method:r||"GET",body:ce(n)?JSON.stringify(n):n,headers:lm({"Content-Type":"application/json"},null!=i?i:{}),noRequestProcessor:a})},pm=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=Fr({options:a.join(","),severity:o.join(",")});return tu(`${t}/validate/${i}/entity/${Ep({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},dm=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return tu(`${t}/validate/${n}/entity${Fr({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},ym=e=>{let{tenant:t,apiPath:r}=e;return tu(`${r}/tenants/${t}/name`,{method:"GET"})},fm=e=>{let{tenant:t,apiPath:r}=e;return tu(`${r}/tenants/${t}/_rdmTenants`,{method:"GET"})},Tm=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e;return tu(`${a}/preferences${Fr({name:t,tenant:r,environment:n,user:i})}`,{method:"GET"})},Em=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 tu(`${a}/preferences`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})},mm=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e,o={name:t,tenant:r,environment:n,user:i};return tu(`${a}/preferences`,{method:"DELETE",body:JSON.stringify(o)})},hm=e=>{const{servicesPath:t}=e;return tu(`${t}/getTokenForWorker`,{method:"GET"})};var bm=r(29524);const Om=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=St(),s={attributes:Nl({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=Ms(r,e,n.uri)[0];return i&&i.value?Il({entity:e,attributeType:n,uri:i.uri,value:t}):Sl({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)(Ds),(0,l.filter)(Rt),(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))})),_m=(0,l.curry)(((e,t)=>(0,l.pipe)(pe,(0,l.filter)(e))(t))),Am=_m((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),Nm=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),Rt)),Pm=e=>(0,l.pipe)(Am,Nm(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),Rm=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(Am,(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})),Sm=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),Rt),(0,l.omit)(["uri","timestamp"])),wm=(0,l.pipe)(Sm,Rp),Im=async(e,t,r)=>{if(!e)return null;const n=Pm(e);if(n.length>0)for(const r of n)e=Rm(r,t[r],e);const i=await rf(wm(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},Um=async(e,t,r)=>{const n=Dm(e,t),i={};for(const t of n)i[t]=await Im(e[t],i,r);return i},Cm=(0,l.curry)(((e,t)=>{const r=bm.Node(t);return Pm(e[t]).forEach((t=>{const n=Cm(e,t);r.addEdge(n)})),r})),Dm=(e,t)=>(0,l.pipe)((0,l.map)(Cm(e)),(0,l.map)(bm.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),jm=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)(Sm))})),Lm=(e,t)=>[...Sh(e.tags||[],t.tags||[]),...wh(e.roles||[],t.roles||[]),...gh(e,t),..._h(e,t)],km=(e,t)=>[...Ah(vh((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),Rh((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e),...Lm(e,t)],Fm=(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 Rm(r,n,e)}),e))))}),t)}),jm),Mm=(0,l.curry)(((e,t)=>(0,l.when)(Rt,(0,l.propOr)(l.__,t,e),t)));function xm(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}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 Vm=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return xm({},t,{[r]:{parents:n,children:i}})},Gm=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return xm({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},Wm=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=Vm({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>Wm(n.uri,t,[e],r)),o)},Bm=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)(Ed(),n),a=t?Gm({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(vd(),n),s=Rt(o)?[o]:[],u=Vm({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>Wm(t,r,[i],e)),u)}),n)},Ym=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return Bm(r,e,t,Wm(e,t))},qm=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return Ym(t,r,n);if(Ut(e)){const t=Sd(n,e);return t&&Bm([t],null,r)}return r[e]?Wm(e,r):void 0},Hm=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>Hm(e,t))))},Qm=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>Qm(e,t))))},Km=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=It(t),u=Ym(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(Ut(c)){if(s=Sd(i,c),!s)return null;o.push({type:Re.relationConnection,value:s,valueType:Pi(a,(0,l.path)(md(),s))});continue}if(Ut(u)){const e=n[c];if(!e)return null;o.push({type:Re.tempEntity,value:e,valueType:Jr(a,e.type)});continue}const p=n[u],d=Zs(p,c),y=n[c];if(!d||!y)return null;o.push({type:Re.attributeValue,value:d,valueType:mr(a,Vt(d.uri,p.type))}),o.push({type:Re.tempEntity,value:y,valueType:Jr(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},Qm(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=Ut(s),d=p?wd(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?Pi(a,d.type):Jr(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:hr(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:Re.tempEntity,value:T,valueType:Jr(a,T.type)}),o.push({type:Re.attributeValue,value:s,valueType:E}),m=s.value;const l=Ds(s);T=l&&Rt(l)?n[l]:null}}return o},Jm=e=>e.every((e=>{let{type:t}=e;return[Re.attributeValue,Re.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===Re.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null;let Xm;!function(e){e.insertAttribute="insertAttribute",e.updateAttribute="updateAttribute",e.deleteAttribute="deleteAttribute"}(Xm||(Xm={}));const zm={[Xm.insertAttribute]:{color:"#599E0E"},[Xm.updateAttribute]:{backgroundColor:"rgba(255, 187, 0, 0.12)",color:"#CC7500"},[Xm.deleteAttribute]:{backgroundColor:"rgba(255, 50, 0, 0.2)",color:"#CF0E26"}},Zm=e=>{switch(e){case"UPDATE_ATTRIBUTE":return Xm.updateAttribute;case"UNDO_IGNORE_ATTRIBUTE":case"INSERT_ATTRIBUTE":return Xm.insertAttribute;case"IGNORE_ATTRIBUTE":case"DELETE_ATTRIBUTE":return Xm.deleteAttribute;default:return""}},eh="/",th=(0,l.pipe)((0,l.split)(eh),(0,l.propSatisfies)((0,l.lte)(2),"length")),rh=(0,l.pipe)((0,l.split)(eh),(0,l.slice)(0,-2),(0,l.join)(eh)),nh=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.has)(e),(0,l.prop)(e)],[()=>th(e),nh(rh(e))]])(t))),ih=e=>(0,l.pipe)(l.keys,(0,l.any)((0,l.startsWith)(e+eh))),ah=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=nh(e,t);return(0,l.isNil)(r)?ih(e)(t)?"UPDATE_ATTRIBUTE":"":r},oh=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]},sh=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(sh(e))}))}))),t},lh=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)(dh,t),(0,l.propOr)([],"crosswalks",e))),e),uh=(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(uh(e))}))})),r},ch=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=ch(e);r>t&&(t=r)}))})),t+1):t},ph=(e,t)=>{if(Rt(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},dh=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},yh=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},fh=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},Th=(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)},Eh=(0,l.eqBy)(dh),mh=(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)(Rs,(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 hh(e){return e&&void 0!==e.uri}function bh(e){return function(t,r){var n,i,a=[];return i=r,!(n=t)&&!i||!(!n||!i)&&n.length===i.length&&n.every((function(e,t){return e===i[t]}))||a.push({type:e,newValue:r}),a}}function Oh(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 vh(e,t,r){var n,i,a,o=[];for(var s in e)if(e.hasOwnProperty(s)){if("paging"===s)continue;var u=e[s];if(void 0===t[s])for(var c in u)u.hasOwnProperty(c)&&o.push.apply(o,m(u[c]));else for(var p in u)if(u.hasOwnProperty(p)){var d=u[p],y=_(d,t[s]);void 0===y?o.push.apply(o,m(d)):d.value===y.value||d.lookupCode&&d.lookupCode===y.lookupCode?d.ignored!==y.ignored&&o.push.apply(o,b(y)):null==y.value||""===y.value?o.push.apply(o,m(d)):"Nested"===g(d)?d.ignored!==y.ignored&&(0,l.equals)(d.value,y.value)?o.push.apply(o,b(y)):o=o.concat(vh(d.value,y.value,r)):"Reference"===g(d)?Oh(d,y)?o.push.apply(o,vh(d.value,y.value,r)):(o.push.apply(o,m(d)),o.push(O([y]))):""!==y.value&&(!1===y.ov?o.push.apply(o,(void 0,void 0,i=(n=y).uri.lastIndexOf("/"),a=n.uri.substr(0,i),[{type:"_UPDATE_NON_OV_ATTRIBUTE",uri:n.uri,typeUri:a,value:n.lookupCode||n.value}])):o.push.apply(o,h(y)))}}for(var f in t)if(t.hasOwnProperty(f)){if("paging"===f)continue;var T=(t[f]||[]).filter((function(t){return void 0===_(t,e[f])}));(T=E((0,l.clone)(T))).length&&o.push(O(T))}return o;function E(e){return e?e.map((function(e){var t;if(e){var r=e.value;return null!=r&&(ce(r)?Object.keys(r).forEach((function(e){var n=E(r[e]);n.length>0?r[e]=n:delete r[e],t||(t=0!==n.length)})):t=null!=r&&""!==r),t||e.lookupCode||e.refEntity?e:null}})).filter((function(e){return null!=e})):[]}function m(e){return[{type:"DELETE_ATTRIBUTE",uri:e.uri}]}function h(e){return[{type:"UPDATE_ATTRIBUTE",uri:e.uri,newValue:{value:e.lookupCode||e.value}}]}function b(e){return e&&(e.ignored?function(e){return[{type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}}]}(e):function(e){return[{type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!1}}]}(e))}function O(e){var t=e[0].uri,n=t.lastIndexOf("/"),i={type:"INSERT_ATTRIBUTE",uri:t=t.substr(0,n),newValue:e.map((function(e){var t,n={value:JSON.parse(JSON.stringify(e.lookupCode||e.value))};return r&&(n.uri=e.uri),v(n.value),e.refEntity&&(t=e.refEntity,Array.isArray(t)&&(t=t[0]),n.refEntity=t),e.refRelation&&(t=e.refRelation,Array.isArray(t)&&(t=t[0]),r||delete t.objectURI,n.refRelation=t),n}))};return i}function v(e){if(null!==e&&"[object Object]"===e.toString())for(var t in e)e.hasOwnProperty(t)&&"paging"!==t&&e[t].forEach((function(e){delete e.crosswalks,delete e.type,r||delete e.uri,v(e.value)}))}function g(e){var t=e.value;if(ce(t))return e.hasOwnProperty("refEntity")?"Reference":"Nested"}function _(e,t){if(void 0!==t)return t.filter((function(t){return t.uri===e.uri}))[0]}}function gh(e,t){var r,n,i=[];return e.defaultProfilePic!==t.defaultProfilePic?i.push({type:"UPDATE_PROFILE_PIC_BY_URI",newValue:{value:t.defaultProfilePic}}):(r=e.defaultProfilePicValue)===(n=t.defaultProfilePicValue)||hh(r)&&hh(n)&&r.uri===n.uri||i.push({type:"UPDATE_PROFILE_PIC_BY_URL",newValue:{value:t.defaultProfilePicValue}}),i}function _h(e,t){var r=[],n=a(e.startDate,t.startDate);void 0!==n&&r.push({type:"UPDATE_START_DATE",newValue:{value:n}});var i=a(e.endDate,t.endDate);return void 0!==i&&r.push({type:"UPDATE_END_DATE",newValue:{value:i}}),r;function a(e,t){var r;return e!=t&&(r=(0,l.isNil)(t)?"":t+""),r}}function Ah(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;var n="configuration/sources/Reltio",i="configuration/sources/ReltioCleanser";function a(e,t){return e.crosswalk={type:t.type,value:t.value},e}function o(e,t){return e.reduce((function(e,r){return(e[r[t]]=e[r[t]]||[]).push(r),e}),{})}function s(e){return e.removeIt=!0}var l=e.map((function(e){if(e.crosswalk)return[e];var o=Nh(t,e.uri),s=o.filter((function(e){return e.type===n})),l=o.filter((function(e){return e.type!==n})),u=[];switch(e.type){case"INSERT_ATTRIBUTE":u.push(e);break;case"_UPDATE_NON_OV_ATTRIBUTE":u=u.concat(o.map((function(t){return a(e,t)})));break;case"DELETE_ATTRIBUTE":(l.length||0==s.length)&&u.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}}),u=u.concat(s.map((function(t){return a({type:"DELETE_ATTRIBUTE",uri:e.uri},t)})));break;case"UPDATE_ATTRIBUTE":{const o=l.some((e=>{let{type:t}=e;return t===i}))&&r?Ph(r,t,e.uri):null;if(o||s.length){if(s.length)u=u.concat(s.map((function(t){return a({type:"UPDATE_ATTRIBUTE",uri:e.uri,newValue:e.newValue},t)})));else if(o){var c=Nh(t,o.uri).filter((e=>{let{type:t}=e;return t===n}));u=u.concat(c.map((t=>a({type:"UPDATE_ATTRIBUTE",uri:o.uri,newValue:e.newValue},t))))}}else u.push({type:"INSERT_ATTRIBUTE",uri:e.uri.substr(0,e.uri.lastIndexOf("/")),newValue:[e.newValue],insteadOfUpdate:!0});l.length&&u.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}});break}}return u})),u=[].concat.apply([],l),c=o(u,"typeUri");for(var p in c)if("undefined"!==p){var d=c[p],y=u.filter((function(e){return"_UPDATE_NON_OV_ATTRIBUTE"!==e.type})).filter((function(e){return e.uri.substr(0,e.uri.lastIndexOf("/"))===p||"INSERT_ATTRIBUTE"===e.type&&e.uri===p})),f=d.filter((function(e){return e.crosswalk&&e.crosswalk.type===n}))[0],T=y.filter((function(e){return"UPDATE_ATTRIBUTE"===e.type}))[0];!T&&f&&(u.push({type:"UPDATE_ATTRIBUTE",uri:f.uri,newValue:{value:f.value},crosswalk:f.crosswalk}),y.forEach(s)),d.forEach(s)}return(u=u.filter((function(e){return!e.removeIt}))).forEach((function(e){delete e.insteadOfUpdate})),u}const Nh=(e,t)=>e.filter((function(e){return 1===(e.attributes||e.attributeURIs||[]).filter((function(e){return e===t})).length})),Ph=(e,t,r)=>(0,l.pipe)(el,(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 ph(t,r)},e=>{let[t]=e;return!_s(t)}]),(0,l.prop)(0),(0,l.always)(null)))(e,r);function Rh(e,t){for(var r in t=t||[],e)if(e.hasOwnProperty(r))for(var n=e[r],i=0;i<n.length;i++){var a=n[i];if(a.refRelation){var o=a.refRelation[0]||a.refRelation;if(o.crosswalks)for(var s=o.crosswalks.filter((function(e){return e.attributes||e.attributeURIs})),l=0;l<s.length;l++){for(var u=!0,c=0;c<t.length;c++)if(t[c].type===s[l].type&&t[c].value===s[l].value){t[c].attributes=t[c].attributes||t[c].attributeURIs,t[c].attributes=t[c].attributes.concat(s[l].attributes||s[l].attributeURIs),t[c].attributes=Object.keys(t[c].attributes.reduce((function(e,t){return e[t]=!0,e}),{})),delete t[c].attributeURIs,u=!1;break}u&&t.push(s[l])}}}return t}function Sh(e,t){return bh("UPDATE_TAGS").call(this,e,t)}function wh(e,t){return bh("UPDATE_ROLES").call(this,e,t)}function Ih(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Uh(e,t,r[t])}))}return e}function Uh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ch=function(e){var t=function(e,r,n,i){if(e&&r)if(n||(n=null),i=!!i,Array.isArray(e))for(var a=0;a<e.length;a++)r.call(n,a,e[a],e),i&&t(e[a],r,n,i);else if(ce(e))for(var o in e)r.call(n,o,e[o],e),i&&t(e[o],r,n,i)},r=function(e,t,r){return function(n){var i=-1!==n.uri.lastIndexOf("/")?n.uri.substring(0,n.uri.lastIndexOf("/")):"";e[i]||(e[i]=[]),e[i].push(n.type),t[n.uri]=n.type,"IGNORE_ATTRIBUTE"===n.type&&r.push(n.uri)}},n=function(e,t,r){var n=[],i=Object.keys(e).filter((function(t){return-1!==e[t].indexOf("IGNORE_ATTRIBUTE")&&-1!==e[t].indexOf("INSERT_ATTRIBUTE")}));return Object.keys(t).filter((function(e){var t=-1!==e.lastIndexOf("/")?e.substring(0,e.lastIndexOf("/")):null;return-1!==i.indexOf(t)})).forEach((function(e){-1!==r.indexOf(e)&&n.push(e),t[e]="UPDATE_ATTRIBUTE"})),{appearance:t,ignored:n}},i=function(e,t){var r=Array.isArray(t),n=r?[]:{};return r?(e=e||[]).some((function(e){return e.uri}))?n=function(e,t){var r=e.map((function(e){return e.uri})),n=e.map((function(e){var r,n,a=(n=t.filter((function(t){return t.uri===e.uri}))[0]||{},(r=e)&&n&&r.ignored!==n.ignored&&(delete r.ignored,delete n.ignored,r.ov=!0,n.ov=!0),{a:r,b:n});return i(a.a,a.b)})),a=t.filter((function(e){return-1===r.indexOf(e.uri)}));return n.concat(a)}(e,t):(n=n.concat(e),t.forEach((function(t,r){void 0===n[r]?n[r]=t:ce(t)?n[r]=i(e[r],t):-1===e.indexOf(t)&&n.push(t)}))):(ce(e)&&Object.keys(e).forEach((function(t){n[t]=e[t]})),Object.keys(t).forEach((function(r){ce(t[r])&&e[r]?n[r]=i(e[r],t[r]):n[r]=t[r]}))),n},a=function(){let a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var s=JSON.parse(JSON.stringify(a)),l=JSON.parse(JSON.stringify(o)),u=i(a,o),c={},p={},d=[],y=r(p,c,d);e.compareAttributes(u,l).map((function(e){return"IGNORE_ATTRIBUTE"===e.type&&!1===e.newValue.value&&(e.type="UNDO_IGNORE_ATTRIBUTE"),e})).forEach((function(e){y(e)})),e.compareAttributes(u,s).map((function(e){return"DELETE_ATTRIBUTE"===e.type&&(e.type="INSERT_ATTRIBUTE"),"IGNORE_ATTRIBUTE"===e.type&&(e.type=e.newValue.value?"UNDO_IGNORE_ATTRIBUTE":"IGNORE_ATTRIBUTE"),e})).forEach((function(e){y(e)}));var f=n(p,c,d);return t(u,(function(e,t){t&&-1!==this.indexOf(t.uri)&&(t.ignored=!0,delete t.ov,t.hidden=!0)}),f.ignored,!0),{attributes:u,appearance:f.appearance}};const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=(0,l.difference)(t,e),n=(0,l.difference)(e,t),i=n.concat(t),a=(e,t)=>(0,l.pipe)((0,l.map)((t=>[t,e])),l.fromPairs)(t),o=Ih({},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:Ih({},n,{roles:s,tags:u}),roles:i,tags:l}}}};const Dh=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?Dh(t.value):[]];return e.concat(r)}),[])),jh=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,Lh=e=>e?[Tp(e)]:[],kh=e=>{const t=[...Dh((null==e?void 0:e.attributes)||[]),...Dh((null==e?void 0:e.analyticsAttributes)||[])];return e?[...Lh(e),...t]:[]},Fh=(e,t)=>[e,...t.map((t=>jh(e,t)))],Mh=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return pd(t)}))},xh=(e,t)=>{switch(e){case Se.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case Se.ENTITY_ATTRIBUTE:case Se.RELATION_ATTRIBUTE:return(e=>{let{uri:t}=e;return[Gt(t)]})(t);case Se.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case Se.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n,dataTenant:i}}}=e;return[t,Tp({uri:n,dataTenant:i}),r]})(t)}},$h=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),Vh=(0,l.curry)(((e,t)=>{const r=Co(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(Vh(e,r.extendsTypeURI)):n})),Gh=(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))),Wh=(e,t)=>(0,l.pipe)((0,l.prop)("type"),Vh(e),Gh(t))(t),Bh=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 Yh,qh=r(33164);function Hh(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"}(Yh||(Yh={}));const Qh={},Kh={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"]}},Jh=e=>{if(!Qh[e]){const t=Kh[e]||Kh.random0;Qh[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){Hh(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return Qh[e]},Xh=(0,l.curry)(((e,t)=>{const r=Jh(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]})),zh=e=>Xh(Yh.Charts,e),Zh=()=>Jh(Yh.PotentialMatches).colors,eb=e=>Xh(Yh.Random1,e),tb=e=>(0,qh.getColor)(e)?"#FFFFFF":"#212121";var rb=r(73116);const nb=Array.from({length:100},((e,t)=>t/100)),ib=e=>{const t=Number(e.replace(/\D/g,""))||0;let r=3735928559^t,n=1103547991^t;for(let t,i=0;i<e.length;i++)t=e.charCodeAt(i),r=Math.imul(r^t,2654435761),n=Math.imul(n^t,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&n)+(r>>>0)},ab={},ob=new rb.Z({hash:ib,saturation:nb.slice(15,71),lightness:nb.slice(50,90)}),sb=new rb.Z({hash:ib,saturation:nb.slice(46,89),lightness:nb.slice(44,58)}),lb=(0,l.curry)(((e,t,r)=>{t in ab||(ab[t]={});const n=ab[t];r in n||(n[r]=((e,t)=>{const r=String(ib(t));return e.hsl(r)})(e,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),ub=lb(ob,"crosswalks"),cb=lb(ob,"sources"),pb=lb(ob,"contributors"),db=lb(ob,"dataValidationFunctions"),yb=lb(sb,"entities");function fb(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}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}const Eb=(0,l.has)("items"),mb=e=>0===e,hb=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)},bb=e=>e.reduce(((e,t)=>e+t.width),0),Ob=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),vb=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),gb=e=>e.reduce(((e,t)=>e+t.height),0),_b=e=>(0,l.is)(String,e)&&e.includes("%"),Ab=(0,l.has)("spacer"),Nb=(e,t)=>Math.max(Math.round(parseFloat(t)/100*e),1),Pb=e=>((null==e?void 0:e.items)||[]).reduce(((e,t)=>e.concat(Eb(t)?Pb(t):t)),[]),Rb=(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},Sb=e=>({id:e.layout}),wb=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Sb;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=_b(r.width)?Nb(i,r.width):u}return hb(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return hb(n,t,r)},o=(e,t)=>Eb(t.items[0])?p(e,t.items[0]):null,s=(t,r)=>{const o=r.items.map((a=>i(t,r,a,Eb(a)?n(a.layout):e(a.view)))),s=Rb(t.width,o),u=r.items.reduce(((r,n,i)=>{const o=s[i],u=mb(i)?t.x:(0,l.last)(r).x+(0,l.propOr)(o,"width",(0,l.last)(r));if(Eb(n))return r.concat(p(fb({},t,{x:u,width:o}),n));{const i=e(n.view);return r.push(fb({y:t.y,x:u,height:a(i),width:o},i)),r}}),[]);return{x:t.x,y:t.y,width:bb(u),height:Ob(u),items:u}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=Eb(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=mb(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(Eb(i))return r.concat(p(fb({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(fb({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?hb(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?hb(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:vb(i),height:gb(i),items:i}},c=(t,r)=>{const n=(e,t,r,n)=>mb(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 fb({},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=Rb(e.width,[o,o]),u=fb({},e,{width:s[0]}),c=fb({},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(fb({},e,{y:n(e,t,a,f),height:f,items:(0,l.filter)(l.identity,[p,d])}))}return t}),[]);return fb({},e,{height:gb(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(fb({},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 fb({},t,{height:y,items:(0,l.reject)(f,[s,p,d])})},p=(e,t)=>{const r=fb({},t,{items:(0,l.reject)(Ab,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 Pb(f)},Ib=(e,t)=>(e||[]).filter((e=>t.some((t=>t.id===e.id)))),Ub=[Qe.FilteredEntitiesViewFacet,Qe.ActivitiesViewFacet,Qe.ProfileStatsFacet,Qe.FilteredSavedSearchesFacet],Cb=(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=Ub.includes(a.component)?8:4;return fb({},i,{height:Math.max(r,o),minHeight:Math.max(n,o)})}));function Db(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){jb(e,t,r[t])}))}return e}function jb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Lb={BarChart:He.BAR,BarChartGrouped:He.BAR,BarChartHorizontal:He.BAR,LineChart:He.LINE,Map:He.MAP,Pie:He.PIE},kb=(e,t)=>Wt(e)?xt(e,t):e,Fb=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=Lb[r];return Db({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},Mb=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return Db({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"]))},xb=(e,t,r)=>{const n=(e=>e&&ie(e).map((e=>{const{type:t,value:r}=e;return Db({},e,{value:[ln,un,an.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?ie(n):void 0}})))(e);return t&&Wt(t)||!r?n:(n||[]).concat((i=r,{filter:an.EQUALS,fieldName:"type",values:[i]}));var i},$b=["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"],Vb={"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:kb(n,r),filters:xb(a,n,r),chartType:He.BAR,component:Qe.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:kb(n,r),filters:xb(a,n,r),chartType:He.BUBBLE,component:Qe.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:Qe.CustomActionViewFacet}},"com.reltio.plugins.dashboard.FacetChartView":e=>{let{id:t,firstDimension:r,useEntityType:n,caption:i,filter:a,count:o,orderType:s,options:l,canRead:u}=e;const c=ie(a).find((e=>"type"===(null==e?void 0:e.attribute))),p=n||(null==c?void 0:c.value);return Db({id:t,count:o,canRead:u,orderType:s,attributeUri:kb(r,p),filters:xb(a,r,p),component:Qe.DashboardFacet,title:i,showOthers:!0},Fb(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:kb(n,r),filters:xb(a,n,r),chartType:He.MAP,component:Qe.DashboardFacet,title:i,geoUrl:$b[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 Db({id:t,count:o,canRead:l,attributeUri:kb(n,r),filters:xb(a,n,r),component:Qe.DashboardFacet,title:i,geoUrl:s,chartType:He.MAP,projection:"geoMercator"},Fb(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Qe.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:Mb(i),component:Qe.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:xb(n,null,a),component:Qe.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:an.GTE,fieldName:"matches",values:["1"]}],component:Qe.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:Qe.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:He.CLOUD,component:Qe.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:He.TREE,component:Qe.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Qe.NotificationInboxFacet,title:n||be().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Qe.ActivitiesViewFacet,title:n||be().text("Activity log")}}},Gb=e=>({id:e,height:10}),Wb=(0,l.pipe)((0,l.map)((e=>{const t=Vb[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),Bb=e=>{if("0.1"===e.version){const t=Wb(e.views),r=wb(Gb,e.layout,{columns:4});return{id:e.id,margin:0,layout:Ib(r,t),views:t}}return e},Yb=e=>(0,l.cond)([[(0,l.propEq)("layout","profile"),(0,l.pipe)((0,l.pick)(["center","right","top"]),l.values,l.flatten,(0,l.map)((0,l.when)((0,l.is)(Object),l.values)),l.flatten)],[(0,l.has)("view"),(0,l.pipe)((0,l.prop)("view"),ie)],[(0,l.prop)("items"),(0,l.pipe)((0,l.prop)("items"),(0,l.map)((e=>Yb(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);function qb(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){Hb(e,t,r[t])}))}return e}function Hb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qb=qb({},Ke,{OldMap:"com.reltio.plugins.entity.EntityMapView",OldTree:"com.reltio.plugins.entity.TreeView"}),Kb=e=>e,Jb={[Qb.Attributes]:Kb,[Qb.HierarchyTree]:Kb,[Qb.HierarchyPaths]:Kb,[Qb.RelationsTable]:Kb,[Qb.Relations]:e=>qb({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[Qb.SingleAttribute]:Kb,[Qb.Custom]:Kb,[Qb.AttributeTable]:Kb,[Qb.Map]:Kb,[Qb.OldTree]:e=>qb({},e,{class:Ke.HierarchyTree}),[Qb.OldMap]:e=>qb({},e,{class:Ke.Map}),[Qb.ImageAttribute]:Kb,[Qb.PotentialMatches]:Kb},Xb=(0,l.pipe)((0,l.map)((e=>{const t=Jb[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),zb=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.defaultTo)([]),(0,l.find)((0,l.propEq)("id",t)),(0,l.prop)("class"))(e)===Ke.Map?{id:t,height:5,minHeight:5}:{id:t,autosizing:!0})),Zb=(e,t)=>(t||[]).map((t=>qb({},t,zb(e,t.id)))),eO=e=>{const t=(0,l.pick)(["id","workflow","maxWidth","sidePanelViews","profileBand","views"],e);if("2.0"===e.version)return qb({},t,{layout:Zb(t.views,e.newLayout)});if("0.1"===e.version){const r=Xb(e.views),n=wb(zb(r),e.layout,{columns:3});return qb({},t,{layout:Ib(n,r),views:r})}return e},tO=(e,t)=>e.class===t||e["react-class"]===t,rO=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(tO(t,Ke.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 tO(t,Ke.SingleAttribute)&&e.includeUris.push(t.attributeUri),e}),{includeUris:[],excludeUris:null}))(e);return e=>{let{uri:n}=e;return r&&!r.some(Lt(n))||t.some(Lt(n))}},nO=(e,t)=>e.filter((e=>t.some((t=>tO(e,t))))).map((e=>{let{id:t}=e;return t})),iO=(e,t)=>{let{extensions:r}=e;return(r||[]).find((e=>e.id===t))},aO=(e,t)=>e.flatMap((e=>{let{extensions:r=[]}=e;return r.filter((e=>{let{point:r}=e;return r===t}))})),oO=e=>(0,l.pipe)((0,l.map)((e=>iO(e,"com.reltio.plugins.entity.ProfileBand"))),(0,l.reject)(l.isNil),l.head)(e);function sO(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){lO(e,t,r[t])}))}return e}function lO(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)=>Yb(t).map((t=>(0,l.pipe)((0,l.map)((e=>iO(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")),pO=(0,l.propEq)("class",Ke.Custom),dO=e=>{let{extensions:t=[]}=e;return t.filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]))},yO=(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=Zb(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=>iO(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=>iO(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)(pO))(sO({},n,{items:i})),s=[{id:"common",views:uO(e,sO({},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=eO(sO({},t,{views:a,version:"0.1"})),u=(0,l.pipe)(oO,(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})},fO=(e,t)=>{if("scroll"===t.layout.layout){const r=uO(e,t.layout),n=Bb(sO({},t,{views:r,version:"0.1"}));return{class:Xe.Dashboard,id:t.id,views:n.views,layout:n.layout}}return{class:Xe.Dashboard,views:t.views,layout:t.layout,id:t.id}},TO=(e,t)=>{const r=uO(e,t.layout)[0];return{class:Xe.DQDashboard,id:t.id,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel}},EO=(e,t)=>{const r=uO(e,t.layout)[0];return{class:Xe.RelationshipSearch,id:t.id,options:r.options,consoleExportApp:r.consoleExportApp}},mO=(e,t)=>{const r=uO(e,t.layout)[0];return{class:Xe.Interactions,id:t.id,sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},hO=(e,t)=>{const r=uO(e,t.layout)[0];return{class:Xe.Relationships,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},bO=(e,t)=>{const r=uO(e,t.layout)[0];return{class:Xe.Sources,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},OO=(e,t)=>{const r=uO(e,t.layout)[0];return{class:Xe.PotentialMatches,id:t.id,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},vO=(e,t)=>{const r=uO(e,t.layout)[0],n=r.potentialMatchesReview||{processType:(e=>{const[t]=aO(e,"com.reltio.plugins.search.toolbar.component").filter((e=>"com.reltio.plugins.ui.CustomActionButtonView"===e.class&&e.processType));return null==t?void 0:t.processType})(e)};return{class:Xe.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}},gO=(e,t)=>({class:Xe.Graph,id:t.id}),_O=(e,t)=>{const r=uO(e,t.layout)[0];return{class:Xe.ProfileActivityLog,id:t.id,exportTypes:r.exportTypes,caption:r.caption}},AO=e=>t=>!!(0,l.intersection)(e,t).length,NO=(0,l.cond)([[AO(["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"]),()=>fO],[AO(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>TO],[AO(["com.reltio.plugins.graph.GraphView"]),()=>gO],[AO(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>EO],[AO(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>mO],[AO(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>hO],[AO(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>bO],[AO(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>OO],[AO(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>vO],[AO(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>_O],[l.T,()=>(0,l.always)(void 0)]]),PO=(e,t)=>{const{class:r}=e;if("com.reltio.plugins.entity.ProfileAction"===r)return((e,t)=>{const r=(0,l.pipe)((0,l.chain)(dO),(0,l.map)((t=>yO(e,t))),(0,l.indexBy)((0,l.prop)("entityType")),(0,l.map)((0,l.pick)(["layout","views","sidePanelViews","profileBand","workflow"])))(e);return{class:Xe.Profile,id:t.id,entityTypes:r}})(t,e);if("com.reltio.plugins.ui.actions.CustomAction"===r)return{id:e.id,type:ze.CustomAction,config:(0,l.omit)(["class","id","point","parent","type"],e)};if("com.reltio.plugins.ui.actions.ConsoleAppAction"===r)return{id:e.id,type:ze.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=>iO(e,"com.reltio.plugins.newDashboard.NewDashboardView")),(0,l.pick)(["id","views","layout"]),(0,l.assoc)("class",Xe.Dashboard))(e)}const i=(0,l.pipe)((0,l.map)((e=>iO(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=yO(e,r),i=(0,l.pipe)((0,l.propOr)([],"entity-types"),(0,l.map)((e=>[e,n])),l.fromPairs)(t);return{class:Xe.NestedProfile,id:t.id,entityTypes:i}})(t,e,i);const a=Yb(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 NO(o)(t,i)};function RO(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){SO(e,t,r[t])}))}return e}function SO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wO=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))},IO="https://reltio-ui-files.s3.amazonaws.com/new-ui/";var UO;!function(e){e[e.DashboardGroup=0]="DashboardGroup",e[e.ProfileGroup=1]="ProfileGroup",e[e.SearchGroup=2]="SearchGroup"}(UO||(UO={}));const CO={[Xe.DQDashboard]:`${IO}DqDashboard.svg`,[Xe.Dashboard]:`${IO}Dashboard.svg`,[Xe.Graph]:`${IO}Graph.svg`,[Xe.RelationshipSearch]:`${IO}GraphSearch.svg`,[Xe.Interactions]:`${IO}Interactions.svg`,[Xe.PotentialMatches]:`${IO}PotentialMatches.svg`,[Xe.Profile]:`${IO}Profile.svg`,[Xe.NestedProfile]:`${IO}Profile.svg`,[Xe.ProfileActivityLog]:`${IO}ActivityLog.svg`,[Xe.Relationships]:`${IO}Relationships.svg`,[Xe.Sources]:`${IO}Crosswalk.svg`,[Xe.Search]:`${IO}Search.svg`,[UO.DashboardGroup]:`${IO}DashboardGroup.svg`,[UO.ProfileGroup]:`${IO}ProfileGroup.svg`,[UO.SearchGroup]:`${IO}SearchGroup.svg`,DEFAULT:`${IO}Default.svg`},DO=e=>CO[null==e?void 0:e.class]||CO.DEFAULT,jO=(0,l.pipe)((0,l.pluck)("screen"),(0,l.filter)((0,l.anyPass)([(0,l.propEq)("class",Xe.NestedProfile)])),(0,l.groupBy)((0,l.prop)("class")),(0,l.map)((e=>e.map(((e,t)=>RO({},e,{nestedRoute:`${t+1}`})))))),LO=(e,t)=>{var r;return(null===(r=e[t.class])||void 0===r?void 0:r.find((0,l.propEq)("id",t.id)))||t},kO=e=>"com.reltio.plugins.entity.ProfileFirstAction"===e.class?CO[UO.ProfileGroup]:null,FO=e=>(0,l.cond)([[(0,l.any)((e=>{let{icon:t}=e;return t===CO[Xe.Dashboard]||t===CO[Xe.DQDashboard]})),(0,l.always)(CO[UO.DashboardGroup])],[(0,l.any)((e=>{let{icon:t}=e;return t===CO[Xe.Search]||t===CO[Xe.RelationshipSearch]})),(0,l.always)(CO[UO.SearchGroup])],[l.T,()=>null]])(e),MO=e=>(0,l.pipe)((0,l.chain)(wO),(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=>RO({},e,{entityTypes:e["entity-types"],screen:PO(e,t)}))),(0,l.filter)((e=>e.screen)))(t),n=jO(r);return(0,l.map)((e=>{let{label:t,screen:r,canRead:i,entityTypes:a}=e;return{label:t,icon:DO(r),screen:LO(n,r),canRead:i,entityTypes:a}}))(r)})(t,e),n=PO(t,e);return{label:t.label,icon:kO(t)||FO(r)||DO(n),menu:r.length?{type:"side",items:r}:void 0,screen:n,canRead:t.canRead}}));function xO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $O=e=>{let{extensions:t}=e;return(t||[]).filter((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},VO=e=>({id:e,height:10}),GO=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)($O),(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=Wb(((e,t)=>{const r=Yb(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){xO(e,t,r[t])}))}return e}({id:r},t[0])})),(0,l.uniqBy)((0,l.prop)("id")))(e)})(e,t.layout)),n=wb(VO,t.layout,{columns:4});return{views:r,layout:Ib(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))};function WO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const BO=(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))),YO=e=>"com.reltio.plugins.dashboard.DashboardPerspective"===e,qO=e=>(0,l.pipe)((e=>aO(e,"com.reltio.plugins.ui.custom_script")),(0,l.reject)(E),(0,l.map)((e=>{let{action:t}=e;return 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){WO(e,t,r[t])}))}return e}({},t,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,["action"]))})))(e),HO=(0,l.unless)((e=>!!e&&(e.startsWith("http:")||e.startsWith("https:"))),(0,l.always)(null)),QO=(0,l.pipe)(BO("top-logo"),HO),KO=(0,l.prop)("showLookupCode"),JO=e=>{var t;const r=(e=>(0,l.pipe)((0,l.map)((e=>iO(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=>iO(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=>iO(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=>iO(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=>iO(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=>iO(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=>iO(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.propEq)("format","none")),(0,l.map)((0,l.always)({thousandSeparator:""})))(e))(e),c=(e=>(0,l.pipe)((0,l.map)((e=>iO(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)(BO("default-perspective"),(0,l.ifElse)(YO,(0,l.always)("dashboard"),(0,l.always)("search")))(e))(e),d=(e=>(0,l.pipe)((0,l.map)((e=>iO(e,"com.reltio.plugins.ui.AttributesSorting"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("strategy"))(e))(e),y=qO(e),f=(e=>BO("checkUser",e))(e),T=(e=>BO("checkIdle",e))(e),E=(e=>(0,l.pipe)((0,l.map)((e=>iO(e,"com.reltio.plugins.ui.configuration.FeatureManagement"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("preferNewUI"),l.not)(e))(e),m=(e=>(0,l.pipe)((0,l.map)((e=>iO(e,"com.reltio.plugins.ui.LookupCodeVisibility"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}))(e))(e),h=void 0===(b=KO(m))||b;var b;const O=null===(t=oO(e))||void 0===t?void 0:t.showEntityId,v=(e=>BO("preview",e))(e),g=QO(e),_=(e=>BO("showAttributeDescription",e))(e),A=(e=>BO("topBackgroundColor",e))(e),N=(e=>(0,l.pipe)((0,l.map)((e=>iO(e,"com.reltio.framework.util.DateMask"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"),(0,l.defaultTo)({}),(e=>{let{dateMask:t,dateTimeMask:r}=e;return{dateMask:t,dateTimeMask:r}}),(0,l.reject)(l.isNil))(e))(e);return{i18n:s,entity:{requestSettings:{defaultMaxValues:r}},image:{attributeFieldsOrder:n},lookups:{autocomplete:i,showCode:h},validate:{levels:a,validateReadMode:o},masks:0===Object.keys(N).length?void 0:N,attributePresentations:u,attributesSorting:d,workflow:c,defaultRoute:p,customScripts:y,checkUser:f,checkIdle:T,showSwitchToClassic:E,showEntityId:O,preview:v,logo:g,showAttributeDescription:_,headerColor:A}},XO=e=>({layout:MO(e),pivoting:GO(e),properties:JO(e)});var zO=r(58697),ZO=r.n(zO);function ev(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){tv(e,t,r[t])}))}return e}function tv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rv=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}_${ZO()()}`;return n[e.id].push(t),i=!0,ev({},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]++,ev({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}};function nv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){iv(e,t,r[t])}))}return e}function iv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let av={};const ov=(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(av[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))}av=nv({},av,{[a]:nv({},av[a]||{},{worker:i})})}else i=av[a].worker,av[a].innerText&&t({task:{action:rt.SET_HTML,params:{html:av[a].innerText}},worker:i,config:r}),i.removeEventListener("message",av[a].onWorkerMessage);return i&&(av[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||(av[a].innerText=n.params.html)}},i.addEventListener("message",av[a].onWorkerMessage)),i},sv=(0,l.curry)(((e,t)=>!e||!e.availableEntityTypes||!t||e.availableEntityTypes.includes(t))),lv=(0,l.flip)(sv),uv=(0,l.curry)(((e,t)=>{if(null==t)return"";if("string"!=typeof t&&(t=String(t)),e&&t){const{thousandSeparator:r="",decimalSeparator:n=".",prefix:i="",suffix:a=""}=e,[o,s]=t.split(".");t=i+o.replace(/\B(?=(\d{3})+(?!\d))/g,r)+(s?n+s:"")+a}else!e&&t&&(t=be().number(t));return t})),cv=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?be().number(e,"0,0.0a").toUpperCase():be().number(e,"0,0"):""},pv=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last));let dv=!0;const yv=e=>dv=e,fv=(e,t)=>e!==t&&t?dv&&e?`${t} (${e})`:t:e,Tv=(e,t,r)=>(0,l.path)([t,r,"displayName"],e),Ev=(e,t,r)=>{const n=Tv(e,t,r);return fv(r,n)},mv=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),hv=(0,l.complement)(mv),bv=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),Ov=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)},vv=(0,l.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter(hv(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),gv=(0,l.curry)(((e,t)=>{let{attributePresentations:r={},dataTypeDefinition:n={},dateMask:i,dateTimeMask:a}=e;const o=r[n.uri],s=i?q(i):"L",u=a?K(a):"L LTS";switch(n.type){case lt.TYPE_NUMBER:case lt.TYPE_FLOAT:case lt.TYPE_DOUBLE:case lt.TYPE_LONG:case lt.TYPE_INT:case lt.TYPE_COUNT:return t&&uv(o,t);case lt.TYPE_BOOLEAN:case lt.TYPE_BOOLEAN_RADIO:case lt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t=t,(0,l.isNil)(t)?t:ue(t)?be().text("Yes"):be().text("No");case lt.TYPE_DATE:return(0,l.is)(Number,t)&&(t=A(Number(t)).getTime()),(t=t)&&(Zu(t)?ec(t):be().date(t,s));case lt.TYPE_ACTIVENESS_DATE:case lt.TYPE_LOCAL_DATE:return(t=t)&&(Zu(t)?ec(t):be().date(t,s));case lt.TYPE_TIMESTAMP:return(t=t)&&(Zu(t)?ec(t):be().date(isNaN(t)?t:Number(t),u));case lt.TYPE_FILE:return(0,l.propOr)(null,"filename",t);case lt.TYPE_SELECT:{const e=n.options.find((0,l.propEq)("value",t));return(0,l.propOr)(null,"label",e)}case lt.TYPE_DOLLAR:return t=t,new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0}).format(t);default:return(0,l.is)(Object,t)?fv((0,l.propOr)(null,"lookupCode",t),(0,l.propOr)(null,"value",t)):t}})),_v={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 Av(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Nv=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){Av(e,t,r[t])}))}return e}({},i,{signal:r.signal})).finally((()=>{clearTimeout(a)}))}return e(t,i)},Pv=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()}},Rv=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}}throw r})))),Sv=e=>{const{onRequest:t,onResponse:r,addRequestInterceptor:n,addResponseInterceptor:i,removeRequestInterceptor:a,removeResponseInterceptor:o}=(()=>{const e={onRequest:[],onResponse:[]};return{onRequest:t=>{const{url:r,options:n,abort:i,resolve:a}=t,o=e.onRequest.reduce(((e,t)=>(r,n)=>t({url:r,options:n,abort:i,next:e,resolve:a})),t.next);o(r,n)},onResponse:t=>{const{response:r,abort:n,url:i,options:a}=t,o=e.onResponse.reduce(((e,t)=>r=>r instanceof Response?t({response:r,abort:n,next:e,url:i,options:a}):e(r)),t.next);o(r)},addRequestInterceptor:t=>{e.onRequest.push(t)},addResponseInterceptor:t=>{e.onResponse.push(t)},removeRequestInterceptor:t=>{const r=e.onRequest.indexOf(t);e.onRequest.splice(r,1)},removeResponseInterceptor:t=>{const r=e.onResponse.indexOf(t);e.onResponse.splice(r,1)}}})(),s=(0,l.pipe)(Nv,(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),Pv,Rv);let u=0,c=[];return{request:(e,n)=>{const i=s(fetch);if(null!=n&&n.noRequestProcessor)return i(e,n);const a=()=>{const a=r?(e,t)=>i(e,t).then((n=>new Promise(((i,a)=>{r({response:n,next:e=>{i(e)},abort:a,url:e,options:t})})))):i;return t?new Promise(((r,i)=>{t({url:e,options:n,next:(e,t)=>{r(a(e,t))},resolve:e=>{r(e)},abort:i})})):a(e,n)};if(u){const{delayedRequest:e,resolver:t}=(e=>{let t;const r=new Promise((e=>{t=()=>{e(null)}})).then((()=>e()));return{delayedRequest:r,resolver:t}})(a);return c.push(t),e}return a()},addRequestInterceptor:n,addResponseInterceptor:i,startInterceptorInit:()=>{u+=1},finishInterceptorInit:()=>{u=Math.max(u-1,0),0===u&&(c.forEach((e=>e())),c=[])},removeRequestInterceptor:a,removeResponseInterceptor:o}},wv="__metadata",Iv=(e=>{const t=[wv,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),Uv=(0,l.set)(Iv),Cv=(0,l.view)(Iv),Dv=Uv(En.NEW),jv=Uv(En.REMOVED),Lv=Uv(En.EDITED),kv=Uv(En.IGNORED),Fv=(0,l.pipe)(Cv,(0,l.equals)(En.REMOVED)),Mv=(0,l.pipe)(Cv,(0,l.equals)(En.NEW)),xv=(0,l.pipe)(Cv,(0,l.equals)(En.EDITED)),$v=(0,l.pipe)(Cv,(0,l.complement)(l.isNil)),Vv=(0,l.pipe)(Cv,(0,l.equals)(En.IGNORED)),Gv=(0,l.omit)([wv]),Wv=(e,t)=>e===wv?void 0:t;function Bv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Yv=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=Yv(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},qv=(e,t)=>Yv((0,l.propEq)("nodeId",t),e),Hv=(e,t)=>Yv((0,l.pathEq)(["entity","uri"],t),e),Qv=(e,t)=>{const r=qv(e,t);return r.length>1?r[r.length-2]:null},Kv=(e,t)=>{const r=qv(e,t);return r.length>0?r[r.length-1]:null},Jv=(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=>Jv(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},Xv=()=>{},zv=(e,t)=>{let{parent:r,nodeProcessing:n=Xv}=t;n(e,r),e.children&&e.children.forEach((t=>zv(t,{parent:e,nodeProcessing:n})))},Zv=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case Fe.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 Fe.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 Fe.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){Bv(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})}}},eg=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&&zv(r,{nodeProcessing:r=>{const n=(0,l.path)(["editingConnections",(0,l.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===Fe.addingChild||r.editingMode===Fe.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=Zv({node:r,connection:n,isReversed:i}),s=Cp({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===Fe.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=Zv({node:r,isReversed:i,connection:n}),l=s?kp({entityUri:o,newEntityUri:s,relation:a,isReversed:i}):Lp({oldRelation:e,newRelation:a});t.push(l)}}})})),t},tg=(e,t)=>{if((0,l.path)(["entity","uri"],e)===t)return!0;if(e&&e.children)for(const r of e.children){const e=tg(r,t);if(e)return e}return!1},rg=(0,l.curry)(((e,t)=>{const r=(0,l.map)(rg(e));return(0,l.evolve)({entity:t=>t.uri===e.uri?e:t,children:r},t)})),ng=(e,t)=>{const r=(0,l.pipe)(Object.entries,(0,l.filter)((t=>{let[,r]=t;return r.root&&((e,t)=>tg(t,e.uri))(e,r.root)}))),n=(0,l.map)((t=>{let[r,n]=t;return{id:r,root:rg(e,n.root)}}));return(0,l.pipe)(r,n)(t)},ig={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},ag={asc:"asc",desc:"desc"},og=ig.entityLabel,sg=ag.asc,lg=(0,l.always)(0),ug=e=>{let{sortField:t=og,sortOrder:r=sg,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 UN.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 UN.strings.sort(e,i,a)})(r);default:return lg}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},cg=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values(ag)),l.identity,(0,l.always)(sg))),pg=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(ig)),l.identity,(0,l.always)(og)));var dg=r(91104);let yg;const fg=(e,t)=>(yg||(yg=dg.createClient({key:t})),new Promise((t=>{yg.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)}))}))),Tg=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,l.is)(Object,t)&&(t=""),t},Eg=(e,t)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(_s).flatMap((e=>{let r;return e.type==t&&(r=[Tg(e)]),(0,l.is)(Object,e.value)&&(r=(r||[]).concat(Eg(e.value,t))),r})),mg=e=>e&&e.length>0,hg=(e,t)=>[].concat(e&&e.attributes?Eg(e.attributes,t):[]).filter(l.identity);function bg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Og=(e,t,r,n,i,a)=>{if(e&&e.type){const t=Jr(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){bg(e,t,r[t])}))}return e}({},e,{attributes:{[i]:[n]}}));const a=(t.geoLocationAttributes||[]).map((t=>{return r=hg(e,t.latitude),n=hg(e,t.longitude),mg(r)&&mg(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(mg(t)&&t[0].value&&mg(r)&&r[0].value)return{id:e.uri,lat:Number(t[0].value),lng:Number(r[0].value)}})).filter(l.identity);if(e.length>0)return Promise.resolve(e)}return n&&n.label?fg(n.label,a).catch((()=>null)):Promise.resolve(null)},vg=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=Jr(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 Og(a,o,e,s,u,r).then((e=>!e&&a.label&&""!==a.label?fg(a.label,r).catch((()=>null)):e)).then((e=>ie(e).filter(l.identity).map((e=>({id:e.id||n,label:i,entity:a,point:e}))))).catch((()=>null))}))).then((e=>e.flat(1/0).filter(l.identity)))},gg=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=Jr(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(mr(e,r.latitude,t.type)&&mr(e,r.longitude,t.type)){const e=hg(t,r.latitude),n=hg(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))},_g=(e,t,r)=>Promise.all([gg(e,t),vg(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 Ag(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){Ng(e,t,r[t])}))}return e}function Ng(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Pg=(e,t)=>t.values.map(go(e,t.entityTypeUri)),Rg=(e,t,r)=>pl(t.fieldName,r)||mr(e,xt(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),Sg=(e,t)=>{const r=(0,l.propOr)([],"values",t),n=(0,l.path)([t.attrType.lookupCode],e);return(0,l.map)((e=>{const t=(0,l.prop)(e,n);return t?fv(e,t):e}),r)},wg=(0,l.path)(["attrType","label"]),Ig=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>Ag({},e,{[t]:!0})),{});e[r]=e[r]?Ag({},e[r],n):n}return e}),{}),Ug=(0,l.pipe)((0,l.prop)("values"),E),Cg=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",Cn.type.name)),Dg=e=>e.type===kg.NUMERIC_RANGE_FACET,jg=e=>e.type===kg.DATE_RANGE_FACET,Lg=(0,l.either)(Dg,jg),kg={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},Fg=e=>{switch(null==e?void 0:e.name){case Cn.type.name:return kg.ENTITY_TYPE_FACET;case Cn.createdBy.name:case Cn.updatedBy.name:case Cn.sourceSystems.name:case Cn.tags.name:case Cn.roles.name:case Cn.matchRules.name:case Cn.MLRecommendedMatch.name:return kg.WITH_DROPDOWN_CHECKBOXES_FACET;case Cn.createdTime.name:case Cn.updatedTime.name:case Cn.startDate.name:case Cn.endDate.name:return kg.DATE_RANGE_FACET;case Cn.matches.name:case Cn.matchScore.name:return kg.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return kg.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return kg.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return kg.DATE_RANGE_FACET;default:return kg.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},Mg=(0,l.pipe)(Rg,Fg),xg=(0,l.pipe)((0,l.path)(["attrType","type"]),Rr),$g=(0,l.cond)([[Dg,(0,l.always)(an.IN_RANGE)],[jg,(0,l.always)(an.WITHIN)],[(0,l.allPass)([xg,e=>e.values.length>=2]),(0,l.always)(an.EXISTS)],[l.T,(0,l.always)(an.EQUALS)]]),Vg=(0,l.cond)([[jg,(0,l.prop)("values")],[Dg,(0,l.prop)("values")],[xg,e=>1===e.values.length?e.values.map(ue):[]],[(0,l.pipe)((0,l.path)(["values",0]),Array.isArray),(0,l.prop)("values")],[l.T,e=>[e.values]]]);function Gg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Wg=(0,l.pipe)((0,l.path)(["attrType","type"]),vr),Bg=(0,l.pipe)((0,l.path)(["attrType","type"]),Ar),Yg=(0,l.pipe)((0,l.prop)("attrType"),yl),qg=(0,l.pipe)((0,l.prop)("attrType"),dl),Hg=e=>t=>t.values.map((t=>Jr(e,t).label)).join(" , "),Qg=(0,l.when)((0,l.propSatisfies)((0,l.gt)(l.__,1),"length"),(0,l.join)(" – ")),Kg=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(be().number),Qg)),(0,l.join)(","))(e.values);return`${wg(e)}: ${t}`},Jg=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(w),Qg)),(0,l.join)(","))(e.values);return`${wg(e)}: ${t}`},Xg=e=>t=>`${wg(t)}: ${Pg(e,t).join(", ")}`,zg=e=>t=>{const r=Sg(e,t);return`${wg(t)}: ${r.join(", ")}`},Zg=(0,l.curry)(((e,t,r)=>(0,l.map)((0,l.cond)([[qg,Hg(e)],[Bg,Kg],[Wg,Jg],[Yg,Xg(e)],[l.T,zg(t)]]),r))),e_=(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){Gg(e,t,r[t])}))}return e}({},t,{attrType:Rg(e,t,n)}))),Zg(e,r))(t),t_=new RegExp(`^${be().text("Search")}`),r_=(e,t,r,n)=>{let{uiState:i}=t;const{facets:a,keyword:o,advanced:s,readableQuery:u}=i;return(0,l.isEmpty)(s)?[...e_(e,a,r,n),...o?[o.value]:[]]:[(0,l.replace)(t_,"",u)]},n_=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values)(fn),i_=e=>(e=>n_.reduce(((e,t)=>{const r=new RegExp(`'{0,1}${encodeURIComponent("${")}${t}${encodeURIComponent("}")}'{0,1}`,"g"),n=new RegExp(`'{0,1}${encodeURIComponent("${")}now${encodeURIComponent("}")}'{0,1}`,"g"),[i,a]=rc(t);return e.replace(r,i).replace(n,a)}),e))(e),a_=(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}`})),o_={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},s_=e=>[o_.geoPolygon,o_.onMapMove].includes(e),l_=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},u_=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},c_=(e,t)=>s_(e)?t.map(l_):[u_(t)],p_=e=>s_(e)?be().text("Geo Polygon"):be().text("Geo Location"),d_=e=>{switch(e){case o_.geoLocation:return"geoLocation";case o_.geoPolygon:case o_.onMapMove:return"geoPolygon"}},y_={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},f_=e=>be().text(e),T_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[an.EQUALS]:"=",[an.NOT_EQUALS]:"≠",[an.STARTS_WITH]:"*",[an.MISSING_VALUE]:be().text("missing value"),[an.HAS_ALL]:be().text("has all"),[an.IN_RANGE]:be().text("in range"),[an.FULL_TEXT]:be().text("full text"),[an.EXISTS]:be().text("exists"),[an.COUNT_EQUALS]:`${be().text("count")} =`,[an.COUNT_NOT_EQUALS]:`${be().text("count")} ≠`,[an.COUNT_LT]:`${be().text("count")} <`,[an.COUNT_LTE]:`${be().text("count")} <=`,[an.COUNT_GT]:`${be().text("count")} >`,[an.COUNT_RANGE]:be().text("count range"),[an.LT]:"<",[an.LTE]:"<=",[an.GT]:">",[an.GTE]:">=",[an.IN_FILE]:be().text("in file"),[an.NOT_IN_FILE]:be().text("not in file"),[an.CONTAINS]:"~",[on.LIST_EQUALS]:"=",[on.NOT_LIST_EQUALS]:"≠",[on.LIST_EQUALS_CASE_SENSITIVE]:"=",[on.NOT_LIST_EQUALS_CASE_SENSITIVE]:"≠"}[e]||be().text(e.toLowerCase())},E_=e=>({type:y_.operator,text:e}),m_=e=>({type:y_.operator,text:f_(e)}),h_=e=>({type:y_.attributeLabel,text:e}),b_=e=>({type:y_.specialAttributeLabel,text:e}),O_=e=>({type:y_.attributeFilter,text:T_(e)}),v_=e=>({type:y_.attributeValue,text:e}),g_=e=>({type:y_.entityTypeLabel,text:e}),__=()=>({type:y_.space,text:" "}),A_=()=>({type:y_.bracket,text:"("}),N_=()=>({type:y_.bracket,text:")"}),P_=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),R_=(0,l.curry)(((e,t)=>t.map(P_(e)))),S_=(0,l.curry)(((e,t,r)=>[e,...r,t])),w_=S_(A_(),N_()),I_=S_(__(),__()),U_=(0,l.curry)(((e,t)=>[e,...t])),C_=e=>U_(g_(e)),D_=e=>U_(g_(`${e}: `)),j_=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=Uu(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=wu(s),a=Iu(s);!r&&t&&n&&(i.push(A_()),r=!0),i.push(o),r&&a&&(i.push(N_()),r=!1);const l=e?m_(s):E_(s);i.push(...I_([l]))}else i.push(o),r&&(i.push(N_()),r=!1)}return i}},L_=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),k_=(0,l.pipe)(j_({localizable:!1}),L_),F_=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},M_=e=>{let{data:t,values:r,filter:n}=e;return t&&Nc({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},x_=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(M_)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),$_=(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)&&yr(e.data.attrType)})(e)&&[an.HAS_ALL,an.EQUALS,an.NOT_EQUALS].includes(e.filter))),(0,l.map)((e=>({type:dr((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})))),Ov),V_=(e,t)=>(0,l.pipe)($_,vv(t))(e),G_=(0,l.pathEq)(["data","fieldName"],Cn.type.name),W_=(0,l.path)(["data","entityTypeUri"]),B_=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),Y_=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(ps(e)),attributes:(0,l.filter)((0,l.pipe)(W_,(0,l.anyPass)([l.isNil,ps(e),r=>{const n=(t.entityTypes||[]).filter(ps(e));return(n.length>1?tn(e,n):null)===r&&!!Jr(e,r)}])))})(t))))),q_=e=>(0,l.pipe)((0,l.prop)("filter"),Eu,(0,l.equals)(e)),H_=(0,l.curry)(((e,t,r,n,i,a)=>{const o=pl(n.fieldName)||n.attrType,s=Ju(o,i),u=gv({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>yr(s),()=>(0,l.is)(Object,a)&&a.lookupCode?fv(a.lookupCode,a.value):Ev(r,dr(o),a)],[()=>yl(s),()=>go(e,n.entityTypeUri,a)],[()=>fl(s),()=>Bo(e,a)],[()=>Ol(s),()=>Ho(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>Ar(c)||Rr(c)),Yu),v_)()})),Q_=(e,t,r,n)=>{const i=H_(e,t,r,n.data,n.filter);return(0,l.cond)([[q_(0),(0,l.always)([])],[(0,l.both)(q_(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[__(),i(r),{type:y_.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[__(),...(0,l.pipe)(l.flatten,(0,l.map)(i),R_({type:y_.punctuationMark,text:", "}))(t)]}]])(n)},K_=(e,t)=>{const r=!!pl(e.data.fieldName);return(0,l.pipe)(F_,r?b_:h_)(e,t)},J_=(e,t,r,n,i)=>[K_(n,i),__(),O_(n.filter),...Q_(e,t,r,n)],X_=(0,l.addIndex)(l.map),z_=(0,l.propEq)("length",1),Z_=(0,l.propSatisfies)((0,l.lt)(1),"length"),eA=(0,l.complement)(l.isEmpty),tA=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)(ju,(0,l.filter)(M_),Lu,(0,l.map)((n=>({operand:J_(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,j_()))(n)},rA=(0,l.pipe)(tA,l.flatten),nA=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>hp(e,{type:t}))).join(", ");return r?t(r):l.identity},u=tA(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(C_),(0,l.pipe)(s(D_),(0,l.unless)((()=>z_(u)||i),w_)))(u)},iA=(e,t,r,n)=>(0,l.pipe)(ju,(0,l.filter)(x_),Lu,X_(((n,i,a)=>({operand:nA(e,t,r,n,z_(a)),operator:n.operator}))),j_(),l.flatten)(n),aA=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),j_(),l.flatten),oA=e=>{let{searchType:t,values:[r]}=e;return c_(t,r).join(", ")},sA=(e,t,r,n,i,a)=>{const o=(e=>e?[b_(e.isRawFilter?be().text("Raw filter"):be().text("Search")),...I_([O_(an.EQUALS)]),v_(`"${e.value}"`)]:[])(i),s=(e=>e?[b_(p_(e.searchType)),__(),v_(oA(e))]:[])(a),u=(0,l.pipe)(iA,(0,l.when)((e=>Z_(e)&&(eA(o)||eA(s))),w_))(e,t,r,n);return aA([o,s,u])},lA=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),uA=(0,l.pipe)(sA,lA),cA=(0,l.has)("attributes"),pA=Array.isArray,dA=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),yA=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=fA(e,t,r,a,i);return(0,l.when)((0,l.always)((0,l.complement)(l.isNil)(o)),(0,l.pipe)((0,l.when)((0,l.always)((0,l.not)(dA(a))),w_),(0,l.concat)(I_([E_(o)]))))(s)},fA=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return cA(n)?yA(e,t,r,n,i):pA(n)?n.reduce(((n,a)=>n.concat(fA(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(I_([E_(n.operator)])))(J_(e,t,r,n,i))},TA=(e,t,r,n,i)=>(0,l.pipe)(fA,l.flatten)(e,t,r,n,i);function EA(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){mA(e,t,r[t])}))}return e}function mA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hA=(0,l.complement)(G_),bA=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(G_),(0,l.map)((0,l.prop)("values")),l.flatten,l.uniq)(e),r=(0,l.pipe)((0,l.map)(W_),(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}},OA=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=bA(t);return(r||n)&&Cu(t)},vA=(0,l.ifElse)((0,l.all)((0,l.has)("entityTypes")),l.identity,(0,l.pipe)((e=>{const t=[],r=e.filter((0,l.complement)(OA)),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(G_).some((0,l.propEq)("filter",an.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}=bA(r);if(OA(e))t.push(EA({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter(hA)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(G_,(0,l.pipe)((0,l.prop)("values"),l.flatten),(0,l.pipe)(W_,(e=>[e]),(0,l.reject)(l.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(hA),entityTypes:n,operator:i?a:e.operator,id:ZO()()}}));t.push(...n)}var a;return t})(t))),[]))),gA={[an.EQUALS]:an.ON,[an.IN_RANGE]:an.WITHIN,[an.GTE]:an.AFTER,[an.GT]:an.AFTER,[an.LTE]:an.BEFORE,[an.LT]:an.BEFORE},_A=(0,l.curry)((e=>gA[e]||e)),AA=(0,l.curry)(((e,t)=>{switch(e){case an.LT:return[f()(t[0]).subtract(1,"day").valueOf()];case an.GT:return[f()(t[0]).add(1,"day").valueOf()];default:return t}})),NA=(0,l.pipe)((0,l.path)(["data","attrType","type"]),vr),PA=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>EA({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return NA(e)?(0,l.evolve)({filter:_A,values:AA(t)},e):e}))})))})),RA=(0,l.evolve)({values:(0,l.when)((0,l.pipe)((0,l.prop)(0),zu),(0,l.map)(rc))}),SA=(0,l.map)((0,l.cond)([[NA,RA],[l.T,l.identity]])),wA=(0,l.curryN)(3,((e,t,r,n,i)=>(0,l.pipe)((0,l.defaultTo)([]),vA,Y_(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")),SA)})),PA,(0,l.reject)(B_))(r)));function IA(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){UA(e,t,r[t])}))}return e}function UA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const CA=(e,t)=>({data:{uri:Wt(e.fieldName)?xt(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||$g(e),id:ZO()(),values:Vg(e)}),DA=(0,l.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=pl(a,t,r)||mr(e,i);if(!s)return null;if(nr(s))return IA({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=hp(e,{type:o}),i=(Er(e,xt(a,o),o)||[]).map((0,l.pick)(["label","name"])).slice(0,-1);return IA({},n,{attrType:s,title:t,pathToTitle:Array.isArray(i)?[r,...(0,l.chain)((0,l.prop)("label"),i),t]:[r,t]})}})),jA=(0,l.curry)(((e,t,r,n)=>wA(DA,e,n,t,r)));function LA(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){kA(e,t,r[t])}))}return e}function kA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const FA=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},MA=e=>"rdmLookups.not.resolved"===e?Cn.notResolved.name:e,xA=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===cn?an.IN_RANGE:pn(a),u=MA(n),c=pl(u)||mr(e,i),p=(0,l.cond)([[()=>Ou(s),(0,l.map)((0,l.when)((0,l.both)((0,l.has)("link"),(0,l.complement)((0,l.has)("filename"))),(e=>LA({},e,{filename:pv(e)}))))],[()=>Rr(null==c?void 0:c.type),(0,l.map)(ue)],[e=>hu(s)&&!Array.isArray(e[0])&&!vr(null==c?void 0:c.type),ae],[l.T,l.identity]])(o);return{id:ZO()(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===cn?"and not":"and",filter:s,values:p}})),$A=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(xA(e,tn(e,i)));return[{id:ZO()(),operator:"or",attributes:a,entityTypes:i}]})),VA=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),GA=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([VA("from"),VA("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,()=>[]]]),WA=(e,t)=>{const r=(0,l.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return LA({},r,{values:GA(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?ol(e.fieldName,n):e.fieldName})},BA=(e,t)=>{if((0,l.has)("children")(e)){const r=WA(e,t);return e.children.reduce(((e,n)=>(e.push(BA(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return WA(e,t)},YA=(0,l.cond)([[(0,l.has)("searchParameters"),e=>{const t=[];return(0,l.has)("values",e)&&t.push(WA(e)),(0,l.propOr)([],"searchParameters",e).forEach((r=>t.push(LA({fieldName:e.fieldName},WA(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(BA,l.flatten)],[l.T,WA]]),qA=(0,l.pipe)((0,l.map)(YA),l.flatten),HA=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},QA=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=$A(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:qA(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>LA({},t,{type:Mg(e,t)}))).map((e=>LA({},e,{values:Lg(e)?HA(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 CA(r,t)})),operator:"or",id:ZO()(),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=>({[MA(t)]:e[t]}))),l.mergeAll)(e)}(o),p=[LA({},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 jA(e,t,r,p)},KA=(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)(Ug),(0,l.partition)(Cg))(t),i=n.map((t=>IA({},t,{type:Mg(e,t)}))).map((e=>CA(e))),a=r.values||[];return[{attributes:i,operator:"or",id:ZO()(),entityTypes:a}]})(e,a);return jA(e,t,r,o)})(e,t,r,n):QA(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},JA=e=>"2.0"===e.version?e.keyword:FA(e),XA=e=>(0,l.pathEq)(["object","uri"],e),zA=(e,t)=>(0,l.pipe)((0,l.find)(XA(e)),(0,l.prop)("object"))(t),ZA=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"),XA(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=zA(r.match,t)||n[r.match];return i?{label:Xc((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return vo(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)},eN=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,l.pick)(["uri","type","label"],r),e}),{}),tN=(0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)]),rN=(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:Xc((0,l.prop)("label",o)),matchRules:i.concat(a).map((function(t){return vo(e,o.type,t)||{label:t,uri:t}}))}})))(t),nN=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.map)((0,l.prop)("shortestTransitiveMatchPath")),l.flatten,(0,l.filter)(l.identity),(0,l.map)((0,l.prop)("match")),l.uniq);return t(e)},iN=(0,l.path)(["object","uri"]),aN=e=>{let t=[];return{addChild:e=>{t=(0,l.append)(e,t)},getValue:()=>e,getChildren:()=>t,removeChild:e=>{t=(0,l.without)([e],t)}}},oN=e=>e.getValue(),sN=(e,t)=>{let r=null;if(t(e.getValue()))return e;const n=e.getChildren();for(let e=0;e<n.length&&(r=sN(n[e],t),!r);e++);return r},lN=(e,t)=>{const r=[],n=(0,l.pipe)(oN,t),i=(0,l.pipe)(l.map,l.flatten),a=e.getChildren();a.some(n)&&r.push(e);const o=i((0,l.partialRight)(lN,[t]),a);return r.push.apply(r,o),r};function uN(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){cN(e,t,r[t])}))}return e}function cN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pN=(e,t)=>!!e[t],dN=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},yN=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return 0===t.length&&e?e:(0,l.uniqBy)(r,[...t,...e||[]])},fN=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return uN({},t,{[r.uri]:uN({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:yN(null==o?void 0:o.parents,n),children:yN(null==o?void 0:o.children,i),values:yN(null==o?void 0:o.values,a,(0,l.prop)("uri"))})})},TN=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=Jr(r,t)||Pi(r,t),i=(0,l.either)((0,l.both)((0,l.prop)("dependentLookupAttributes"),(0,l.prop)("dependentLookupCode")),(0,l.prop)("children"));return es(r,n,i).flatMap(rs).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>mr(r,e))).filter(l.identity).filter((0,l.prop)("dependentLookupCode"));return(e=>{let{structure:t,parentAttrType:r,childrenAttrTypes:n}=e;const i=n.map((0,l.prop)("uri")),a=fN({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>fN({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},EN=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!Rt(e.uri)&&Dt(e.type)&&Dt(t)&&!t.startsWith(e.type))(n,t))return e;const i=Ms(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(_s),(0,l.map)(dN))(i);return fN({structure:e,attrType:e[t].attrType,values:a})}),t)},mN=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 pN(e,r)}));return r||n?t.filter(_s).reduce(((e,t)=>mN({structure:e,attributeValue:t})),e):e}),t);{const e=r;return pN(t,e.type)?fN({structure:t,attrType:t[e.type].attrType,values:[dN(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)}))?uN({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},bN=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=Ms(i,n,r)||[];return a.length?fN({structure:t,attrType:t[r].attrType,values:a.filter(_s).map(dN)}):t},ON=(e,t,r)=>{const n=It(e),i=It(t);return n===i?((e,t)=>{const r=qt(t),n=qt(e);return Lt(n,r)||((e,t)=>Bt(e)&&!Bt(t)&&Lt(t,e))(n,r)})(e,t):!(!r||!Yt(t))&&Hm(r,i).includes(n)},vN=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},gN=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?Ym(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return ON(r,t,o)}))},_N=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>_N(e,t,r)))))},AN=(e,t,r,n)=>{let{uri:i,value:a}=r;return{type:e,uri:i,lookupValue:a,autopopulate:i!==t&&vN(n,e)}},NN=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s}=e;const l=t[r],u=It(n),c=qm(u,o,i,a),p=_N("children",t,l),d=_N("parents",t,l),y=p.flatMap((e=>_N("parents",t,e))).filter((e=>![...d,l,...p].includes(e))),f=p.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return ON(t,n,c)})).map((t=>AN(e.attrType.uri,n,t,s)))));if(!f.length)return[];const T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return ON(n,t,c)||It(t)!==u&&ON(t,n,c)})).map((t=>AN(e.attrType.uri,n,t,s))))),E=y.flatMap((e=>{const r=_N("children",t,e).map((e=>{let{attrType:t}=e;return t.uri}));return e.values.filter((e=>{let{uri:t}=e;return f.some((e=>{let{uri:n,type:i}=e;return r.includes(i)&&ON(n,t,c)}))})).map((t=>AN(e.attrType.uri,n,t,s)))}));return[...l.values.filter((e=>{let{uri:t}=e;return ON(t,n,c)})).map((e=>AN(r,n,e,s))),...T,...E,...f]},PN=async e=>{let{attributeType:t,attributePresentations:r,value:n}=e;const i=gv({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=>Kc(e,t.dataLabelPattern))),o=e=>Object.values(e[0])[0],s=(0,l.pipe)(o,i),u=(0,l.cond)([[sr,()=>a(n)],[yr,()=>(e=>{const r=o(e),n=dr(t);return ou([{codeValue:r,type:n}]).then((e=>{if(Array.isArray(e))return Ev(e[0],n,r)}))})(n)],[l.T,()=>s(n)]]);return await u(t)},RN=e=>{let{value:t,attributeType:r,entityType:n=""}=e,i=[{fieldName:"type",filter:an.EQUALS,values:[n]}];return Array.isArray(t)?i=i.concat(SN(r,t)):i.push(wN([t],r)),i},SN=(e,t)=>{const r=ir(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=sr(i)?SN(i,t[r]):[wN(t[r],i)];return e.push(...a),e}}),[])},wN=(e,t)=>e&&e.length&&!(0,l.isNil)(e[0])&&""!==e[0]?{fieldName:pr(t.uri),filter:t.type===lt.TYPE_BLOB?an.FULL_TEXT:an.EQUALS,values:e}:{fieldName:pr(t.uri),filter:an.MISSING_VALUE},IN={AttributesDiff:o,AttributesEditor:a,HistoryManager:s},UN={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([[7140],{22143:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>tl,IL3:()=>Kf,PY2:()=>gn,Ng6:()=>Ue,YJ7:()=>mn,NlI:()=>on,XYV:()=>fn,Xt7:()=>Ne,wfT:()=>ai,EMD:()=>Hn,HAc:()=>Re,PEf:()=>Rn,oA3:()=>qn,$XE:()=>He,eWf:()=>Nn,q7e:()=>Se,KVe:()=>oi,WVQ:()=>Cr,oZZ:()=>Ti,bNA:()=>Ei,Rjq:()=>mi,G39:()=>wn,W0P:()=>rt,X1H:()=>Ze,hdG:()=>at,ws7:()=>ot,VI$:()=>it,yn8:()=>We,N0y:()=>Ge,dZX:()=>Qe,bQt:()=>bi,oS0:()=>lt,KfU:()=>Pe,bZE:()=>dn,Nsj:()=>bn,psV:()=>En,xPW:()=>_n,pyR:()=>Zn,p8l:()=>Kn,Wkf:()=>Ae,zHr:()=>_e,NIO:()=>ge,$26:()=>kg,Esk:()=>Vn,s9T:()=>$e,MEy:()=>$u,j5E:()=>an,vAw:()=>Yn,NMQ:()=>Bn,eVu:()=>ac,YGb:()=>tt,mNm:()=>Xn,Y1q:()=>Xm,s_5:()=>ei,RgZ:()=>Jn,unl:()=>fi,Qy0:()=>hi,pYu:()=>$n,wIJ:()=>o_,GFH:()=>De,Ury:()=>In,S91:()=>Un,p3$:()=>_i,wSh:()=>ee,BDP:()=>ji,pGS:()=>zn,ARY:()=>ut,XGc:()=>ii,fO_:()=>Yr,wwy:()=>Fe,h_8:()=>Dn,_XL:()=>hn,j2V:()=>si,dMV:()=>ri,NBX:()=>aN,OXy:()=>ct,BXd:()=>Be,KM9:()=>Ie,CJB:()=>ci,lXI:()=>Xe,nqG:()=>vi,C68:()=>Sn,yxQ:()=>Oi,Yj_:()=>Me,D25:()=>Le,ZIY:()=>Ke,Tl4:()=>y_,lwr:()=>Pn,NkU:()=>li,Rtp:()=>ni,YGx:()=>Ye,uTS:()=>ti,MCv:()=>we,IYE:()=>Qn,PiC:()=>yi,MVv:()=>nt,h_m:()=>ze,DUe:()=>yn,tJI:()=>Ce,fDt:()=>je,cNQ:()=>ui,SwE:()=>Gn,ZHR:()=>di,PYu:()=>et,lD1:()=>Cn,lVm:()=>qe,vnX:()=>og,$x5:()=>sg,_R1:()=>ig,wUm:()=>ag,z7V:()=>gi,dC6:()=>Ve,MBD:()=>ke,GmF:()=>da,cKm:()=>Je,iP_:()=>An,NVC:()=>xe,tPT:()=>Sl,tZe:()=>dT,kRE:()=>ME,psB:()=>xE,X0$:()=>Rl,zE1:()=>Ml,Wm5:()=>ml,vyX:()=>Vc,wLZ:()=>wl,W4V:()=>le,EtK:()=>ks,Wtd:()=>Pl,asT:()=>mN,kGs:()=>Ah,ewt:()=>yd,O_f:()=>Cu,sOy:()=>Lt,Tde:()=>pr,LMI:()=>Ac,skb:()=>rA,sPt:()=>Tc,sH1:()=>Ec,lPZ:()=>Dy,bG8:()=>Cy,_LJ:()=>jy,RPM:()=>xd,h27:()=>jc,Uqd:()=>$c,xG:()=>TA,Z2f:()=>bv,fgW:()=>k_,I69:()=>sA,ZxB:()=>uA,dwd:()=>Uy,F$g:()=>Iy,mdt:()=>$h,Qbq:()=>ch,rny:()=>Ki,UEY:()=>Da,Q0T:()=>Ca,Lyr:()=>$a,sBn:()=>Ua,itK:()=>Ra,H9$:()=>Ia,KPc:()=>wa,zos:()=>Sa,ELQ:()=>Va,dZs:()=>ma,Cz4:()=>Ea,z_L:()=>Ma,fGe:()=>Ta,iuF:()=>Na,Wib:()=>Pa,Hn0:()=>xa,obS:()=>Ga,E$L:()=>ha,XUh:()=>Aa,Qp_:()=>ga,_jk:()=>ba,sKE:()=>Oa,WmG:()=>_a,QKx:()=>ka,Oik:()=>La,s0A:()=>va,o9m:()=>ja,MCd:()=>Fa,RsS:()=>Lc,tGK:()=>su,lIv:()=>xl,Vg3:()=>ra,mkC:()=>Wi,xv5:()=>ia,a14:()=>Yi,yv0:()=>na,Zm0:()=>Bi,Nxd:()=>Gi,$mM:()=>ta,ifj:()=>jr,NWi:()=>$v,xr3:()=>xv,wNf:()=>mu,iJH:()=>Vv,d89:()=>xi,Edd:()=>$i,Z5t:()=>Vi,uGe:()=>ki,UoR:()=>Li,xvW:()=>Mv,$qe:()=>Fv,yPM:()=>fa,$cp:()=>Fl,vKJ:()=>Ll,VtG:()=>af,AID:()=>km,B1H:()=>nN,b7X:()=>sh,$uE:()=>Rh,keo:()=>uh,C_p:()=>gy,G27:()=>Yb,JA0:()=>RE,b3T:()=>_h,oC6:()=>vh,_Zs:()=>gh,epC:()=>wh,YYG:()=>Sh,f_2:()=>wE,w3l:()=>xA,QHB:()=>Bb,Jso:()=>qA,RXH:()=>wb,Vr9:()=>eO,lMm:()=>XO,BlA:()=>RN,fmQ:()=>Ss,yRD:()=>PA,NcL:()=>Sy,QK6:()=>fe,ymd:()=>Qf,JV_:()=>em,XiW:()=>qp,Yrx:()=>fE,GPx:()=>Nl,gjI:()=>Al,vlo:()=>Ud,E_P:()=>jh,aAL:()=>Lf,NBq:()=>ws,wp9:()=>xh,DsR:()=>wf,MPc:()=>Cp,gWE:()=>Dp,DT_:()=>jp,ipn:()=>kp,ORg:()=>Ii,_wz:()=>Lp,RYR:()=>ld,PP2:()=>bE,wS7:()=>Sv,cBQ:()=>yf,pBq:()=>Om,DsO:()=>te,X78:()=>rm,xZs:()=>JE,YFy:()=>EE,Gmt:()=>WE,K$w:()=>GE,DSj:()=>kf,Mfr:()=>mE,k9j:()=>Tf,EjS:()=>X,ww$:()=>Il,WVU:()=>VE,hxF:()=>bl,n6p:()=>Br,E7G:()=>wp,nwO:()=>IN,Mzk:()=>lf,aFF:()=>Eh,HRH:()=>Wu,EZK:()=>Zc,Kxm:()=>Kc,Z9i:()=>ny,CrF:()=>jE,DNd:()=>Ba,vUy:()=>gN,lJh:()=>Hu,zHo:()=>Qu,sEJ:()=>sN,UO$:()=>Pm,zeJ:()=>mr,dLR:()=>$s,JQy:()=>zs,XtP:()=>Ms,Ug0:()=>tn,A1W:()=>lh,sw:()=>zc,nv3:()=>Kv,JgD:()=>Qv,nve:()=>lN,SkP:()=>Zs,SAs:()=>gm,i5L:()=>el,PWK:()=>Wo,IM5:()=>xs,Aup:()=>Zb,Mfk:()=>rv,HQx:()=>ns,oN$:()=>rs,mB6:()=>gv,p6d:()=>w,o0x:()=>U,ufS:()=>uv,k7L:()=>cv,mrB:()=>I,OuZ:()=>ep,ncP:()=>wt,W$R:()=>tp,JOV:()=>_t,Zmi:()=>At,hm5:()=>Pt,ECL:()=>Fr,vPL:()=>rp,qmL:()=>Jm,hPi:()=>hm,hXd:()=>Xi,OCS:()=>zi,p2l:()=>nl,qF1:()=>Jf,_X$:()=>Xf,yj2:()=>r_,bzh:()=>Wh,k66:()=>Zo,kiP:()=>To,pSg:()=>pe,kz_:()=>_E,H_U:()=>ts,t9e:()=>Xa,j2$:()=>yT,PFL:()=>er,aJ3:()=>Rg,To9:()=>dr,wpo:()=>gp,ADq:()=>zd,UUb:()=>Jd,tQX:()=>Xd,xy8:()=>ir,EUG:()=>hr,AFK:()=>Vt,X3M:()=>Er,WN0:()=>es,kDl:()=>Vs,uDV:()=>Km,IhQ:()=>Hs,pfb:()=>Ks,R$r:()=>Dh,w80:()=>Uo,Pfu:()=>Ka,Gtj:()=>zl,fyF:()=>Xl,kkq:()=>zo,u5q:()=>It,O$n:()=>Op,ptG:()=>vp,f4_:()=>zh,uap:()=>Xh,d7q:()=>yE,liG:()=>OE,$oF:()=>dE,avf:()=>vd,DiQ:()=>Od,cfX:()=>bd,vD3:()=>_d,Qrb:()=>hd,EJQ:()=>gd,HWy:()=>md,gjS:()=>pd,y6v:()=>Ed,JUW:()=>IE,GtP:()=>pb,_kX:()=>qa,u1e:()=>Ha,sJj:()=>yh,CJp:()=>ub,uKF:()=>dh,wo0:()=>FE,s5:()=>qo,cwx:()=>Yo,Y6b:()=>rE,TTx:()=>HE,UtR:()=>nE,HaQ:()=>QE,E6I:()=>DE,Won:()=>aE,vTU:()=>eE,Nsy:()=>cp,KMQ:()=>Th,Do$:()=>fp,CSV:()=>ol,TMe:()=>iE,l1V:()=>Ju,RHh:()=>ic,VQ1:()=>rc,cGG:()=>tc,z7d:()=>Cd,Xaq:()=>os,Sj8:()=>NN,PJj:()=>iu,k3T:()=>nn,PjQ:()=>Ci,s7l:()=>zy,jLA:()=>db,GGR:()=>Rd,j5q:()=>Nd,DnY:()=>Ky,RY5:()=>Wm,Px$:()=>ud,KPC:()=>eN,NIY:()=>of,HvW:()=>ef,Fof:()=>za,BXy:()=>tf,fX:()=>yb,BTI:()=>Ep,uie:()=>ap,q27:()=>Ap,vrC:()=>yO,fAQ:()=>om,XkT:()=>Qy,lrH:()=>sm,nt9:()=>Jr,XH8:()=>bp,XH2:()=>rn,jFi:()=>hp,qhs:()=>Io,wwR:()=>Tp,Uk3:()=>Gt,$Rg:()=>Kt,ev7:()=>iN,RB9:()=>PE,iFp:()=>Vd,e$p:()=>Wd,PcX:()=>Bd,SpP:()=>Gd,R6_:()=>wg,CY1:()=>Fg,Ajk:()=>Wy,Yiz:()=>Gy,FK9:()=>ky,UOo:()=>pv,aTW:()=>YE,uug:()=>Eu,P$2:()=>$g,XS2:()=>lu,Hyb:()=>Su,d3Y:()=>Yc,Klp:()=>Hc,WxZ:()=>Vg,Gzu:()=>Ku,ZOr:()=>Hy,uqV:()=>XT,Pm4:()=>ne,hWO:()=>Mt,nHA:()=>tb,nVD:()=>Ym,_tF:()=>lc,dED:()=>cE,P2h:()=>uE,jrr:()=>co,mmY:()=>yo,T6O:()=>is,h6J:()=>uT,hM2:()=>KA,XR6:()=>z,jmz:()=>Qm,IHt:()=>Hm,NZI:()=>ry,wdF:()=>im,YNv:()=>oh,IFm:()=>ah,o_F:()=>Zm,kgP:()=>am,ZYI:()=>Bf,QXK:()=>Hl,efz:()=>Ql,Q5d:()=>ql,Ysv:()=>Kl,UWq:()=>Ld,ocC:()=>jd,io3:()=>Zr,Sbt:()=>Do,roS:()=>Co,Ww1:()=>jo,QaS:()=>uf,wsP:()=>Oe,ERZ:()=>FA,CL1:()=>JA,idV:()=>Xc,nIW:()=>Ft,fjE:()=>Ig,sG0:()=>fv,tV7:()=>au,g8o:()=>p_,Qy:()=>c_,t2P:()=>Pg,KbW:()=>Oo,wId:()=>go,LS0:()=>_o,bFH:()=>MT,Rgl:()=>$T,fW1:()=>Bh,GFW:()=>KE,Ywp:()=>eg,pg:()=>OT,WSA:()=>VT,fed:()=>HA,tT_:()=>Qs,BgZ:()=>Js,xIV:()=>Xs,KbL:()=>Xy,JBA:()=>qt,aNC:()=>Hv,RFJ:()=>Wf,Zeh:()=>Nm,OT5:()=>Zv,mC3:()=>Vl,kR6:()=>PN,gFw:()=>Zh,NVY:()=>Fh,k6v:()=>zf,FEC:()=>Zf,L5S:()=>Lh,Ob5:()=>Np,KUV:()=>Pp,dvH:()=>kh,V3i:()=>nO,VD3:()=>en,mm2:()=>ec,rou:()=>fm,izH:()=>Qa,DK$:()=>Ja,KMp:()=>jf,c31:()=>yt,mbo:()=>ey,gT8:()=>Et,CZ8:()=>Ps,uGi:()=>Cs,Poc:()=>pt,_9k:()=>Ls,ZTM:()=>Is,bwT:()=>Ds,tzW:()=>ht,tF$:()=>Tt,o96:()=>Rs,M4S:()=>js,_vs:()=>Rf,xF8:()=>dd,PUO:()=>mh,ATu:()=>Zd,j1S:()=>Si,V3K:()=>Pi,Lmx:()=>Ri,oSN:()=>Di,ZaZ:()=>dt,n_1:()=>ZT,N6e:()=>Uf,SxO:()=>po,w3p:()=>Mh,xU7:()=>ye,Y_p:()=>Fo,$k6:()=>ko,Gdl:()=>Ev,U6P:()=>Tv,OwB:()=>Sg,hTh:()=>qm,xqc:()=>Ho,JvE:()=>Qo,i29:()=>wc,dzT:()=>Hi,uPS:()=>df,cZV:()=>pf,n3B:()=>W_,e6O:()=>F_,s7j:()=>a_,j$Q:()=>UE,kW2:()=>cb,tH7:()=>Bo,Yxg:()=>pl,MaZ:()=>Pd,nqN:()=>Ad,jWj:()=>Fd,o_J:()=>ss,yW4:()=>cT,uT0:()=>sT,C82:()=>lT,bsH:()=>eb,u9Z:()=>ym,J$m:()=>zT,j_Q:()=>My,OaI:()=>xy,wB1:()=>rN,SP6:()=>bT,ZYr:()=>ZA,IMU:()=>Gf,FoU:()=>SE,DVz:()=>vv,mxe:()=>V_,FHr:()=>_m,D1g:()=>Tm,VO3:()=>pg,de5:()=>cg,Uw1:()=>me,J6q:()=>ty,XCe:()=>so,fbl:()=>tg,Ir:()=>ho,XQO:()=>bo,QXb:()=>UT,zXF:()=>zm,P8_:()=>zE,iiD:()=>Df,MOC:()=>CT,WF:()=>IT,xE1:()=>Ui,idW:()=>TN,QWZ:()=>ov,YL3:()=>sf,Fn9:()=>T,j2U:()=>rl,MpE:()=>bt,kQw:()=>rr,mfm:()=>wu,vZp:()=>Wt,E8K:()=>pN,VSb:()=>As,vr_:()=>tr,Vmh:()=>vN,FgW:()=>rO,oDv:()=>us,fGG:()=>sv,kuw:()=>ps,eHk:()=>kd,Tt2:()=>ls,pQZ:()=>ds,oZ7:()=>lv,T6Y:()=>Rr,_26:()=>Nu,YkM:()=>cr,J6y:()=>pu,njU:()=>bu,TBP:()=>cs,IT0:()=>iy,x_:()=>fh,FP6:()=>Qt,biM:()=>dp,TMl:()=>yp,Vkd:()=>gu,WiY:()=>jg,_zi:()=>_u,RZp:()=>wy,J6D:()=>Zu,Lt4:()=>vr,QEi:()=>fr,whI:()=>Hr,KIu:()=>Kr,JhM:()=>se,C_0:()=>Ir,lzc:()=>Sp,qIF:()=>B_,O27:()=>E,aBi:()=>_p,xOX:()=>El,EdS:()=>Dt,WgC:()=>Ct,eEv:()=>zt,A4t:()=>Ou,YOQ:()=>Yt,Wos:()=>Nr,jWr:()=>Wa,Or$:()=>ur,lhE:()=>zr,CwH:()=>yr,pzC:()=>yl,ymH:()=>hu,QZu:()=>sr,rYH:()=>Dg,FVt:()=>Ar,Kn2:()=>ce,jgw:()=>Iu,Qgr:()=>zu,OXP:()=>_s,lS4:()=>Tr,g5f:()=>Lg,fp6:()=>fu,Uty:()=>sa,YkG:()=>lr,xdS:()=>mt,kMF:()=>Fp,$NE:()=>jt,bC9:()=>Ut,Ian:()=>wi,KVV:()=>ph,q9e:()=>Lo,iIf:()=>mv,ian:()=>Ol,m6e:()=>Ur,OFd:()=>fl,kqr:()=>nr,fnZ:()=>qr,VFZ:()=>vl,ZiX:()=>Rt,j5n:()=>gr,zkt:()=>_,Pcm:()=>tN,QDV:()=>dl,M5u:()=>Cg,laD:()=>G_,mtq:()=>Xt,CtB:()=>hv,CBv:()=>oe,I0t:()=>wr,u1G:()=>Id,gk1:()=>x_,Bgb:()=>M_,uzs:()=>Qr,v0l:()=>dc,Zqp:()=>oE,j0k:()=>Go,tCm:()=>$t,gmx:()=>uu,mOr:()=>Vu,TwZ:()=>d_,GyU:()=>Jv,zGm:()=>_T,bMg:()=>YT,EyD:()=>Lv,FQA:()=>kv,fZN:()=>QT,xsF:()=>Dv,Lxg:()=>jv,O3l:()=>mf,Wni:()=>Ef,wRx:()=>Wv,OxG:()=>LT,uJQ:()=>jT,qWg:()=>Ov,i96:()=>vT,NPd:()=>qu,zhn:()=>Gv,G8q:()=>Ai,Jct:()=>nd,A9Y:()=>re,Y5F:()=>wA,gxP:()=>ue,c$P:()=>cu,M7o:()=>xc,BBN:()=>uo,ZBU:()=>J,UkJ:()=>Ao,xkv:()=>XE,z$M:()=>EN,KAm:()=>NE,lCl:()=>Fm,rkF:()=>_y,IU6:()=>hT,RGr:()=>h,aYu:()=>m,ije:()=>ru,Buf:()=>Cf,YLu:()=>tu,ct9:()=>xo,XkY:()=>qT,T5R:()=>AT,uQS:()=>KT,wcJ:()=>Mo,d$I:()=>Ul,rSp:()=>pp,Sx:()=>nf,Ilm:()=>$l,Ki6:()=>hl,VGk:()=>Sf,sFD:()=>Ib,eWN:()=>hN,dWE:()=>i_,Lkd:()=>Hp,aDL:()=>Rm,yaA:()=>JT,lOh:()=>mm,DBr:()=>_g,hK$:()=>ou,TZ_:()=>mT,CMB:()=>Y_,FU8:()=>rf,J$p:()=>Um,b5s:()=>Im,h2W:()=>xt,SL_:()=>cm,oUH:()=>iT,ck9:()=>NT,RAb:()=>sc,nL:()=>yv,k$p:()=>Cb,Xs0:()=>eu,u7I:()=>Em,rxg:()=>ju,bji:()=>Lu,oCZ:()=>hy,MjG:()=>ug,FuV:()=>nT,$ju:()=>oT,t6d:()=>aT,m5F:()=>Ee,sx:()=>bN,rSc:()=>_v,U10:()=>$y,L8n:()=>$E,R9X:()=>tE,rj2:()=>tm,_C4:()=>fT,tCj:()=>ZE,uAg:()=>TE,wx9:()=>fd,KF3:()=>TT,ax9:()=>ET,HH7:()=>If,ufV:()=>hE,_6y:()=>ff,XTh:()=>ng,AJo:()=>cf,Ixr:()=>CE,P6Y:()=>UN,Bd_:()=>fy,xkB:()=>yy,W41:()=>dm,WkI:()=>pm,sSE:()=>dy,GMd:()=>Nc,jtL:()=>Pc,Bxm:()=>Ey,FVh:()=>sy,U_T:()=>GT,FTe:()=>ae,VGB:()=>ie,tM8:()=>ku,Wfe:()=>Yu,Ls5:()=>Bu,$bd:()=>Mu});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:()=>K,getMomentFormatFromTimeMask:()=>Q,getStartOfDay:()=>R,isToday:()=>_,isValidMomentDate:()=>b,isValidMomentDateOrNull:()=>O,momentToDate:()=>v,parseTimestamp:()=>J,toLocalDate:()=>A,toUtcDate:()=>N});var a={};r.r(a),r.d(a,{addAttribute:()=>Ts,editAttribute:()=>Es,editEndDate:()=>gs,editRoles:()=>bs,editStartDate:()=>vs,editTags:()=>Os,removeAttribute:()=>hs});var o={};r.r(o),r.d(o,{applyCrosswalks:()=>Ah,collectCrosswalksFromAttributes:()=>Rh,compareActivenessAttributes:()=>_h,compareAttributes:()=>vh,compareImages:()=>gh,compareRoles:()=>wh,compareTags:()=>Sh});var s={};r.r(s),r.d(s,{createHistoryManager:()=>Ch});var l=r(17440);const u=e=>"string"==typeof e&&"function"==typeof e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e,c=(e,t)=>(t=(u(t)||"").toLowerCase(),(e=(u(e)||"").toLowerCase()).includes(t)),p=(0,l.curry)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n="asc"===e.toLowerCase();return t=t.toLowerCase(),r=r.toLowerCase(),t<r?n?-1:1:t>r?n?1:-1:0})),d=(0,l.replace)(/(\r\n|\n|\r)/gm,"");var y=r(95038),f=r.n(y);const T=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{startDate:t,endDate:r}=e,n=Date.now();return!(r&&r<n||t&&t>n)},E=(0,l.anyPass)([l.isEmpty,l.isNil]),m=e=>()=>new Promise(e),h=e=>Promise.all(e.map((e=>e.then((e=>({status:"fulfilled",value:e}))).catch((e=>({status:"rejected",reason:e})))))),b=e=>e&&e.isValid(),O=(0,l.either)(b,l.isNil),v=e=>e&&e.toDate(),g=e=>(e&&e.setHours(0,0,0,0),e),_=e=>f()(e).isSame(Date.now(),"day"),A=e=>{const t=new Date(e),r=new Date;return r.setFullYear(t.getUTCFullYear()),r.setDate(t.getUTCDate()),r.setMonth(t.getUTCMonth()),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"),j=(0,l.equals)("9999"),L=(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")],[L,(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")],[j,(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,Q=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},K=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)} ${Q(r)}`},J=e=>{const t=Number(e);return Number.isNaN(t)?e:t},X=e=>{const[t,r]=e;return f()().subtract(t,r).valueOf()},z=e=>e&&0!=e.length?e.split("").map((e=>e.charCodeAt())).reduce(((e,t)=>0|(e=(e<<5)-e+t)),0)+"":"0",Z=e=>({isNone:()=>(0,l.isNil)(e),extract:()=>e,orSome:t=>(0,l.isNil)(e)?t:e,map:t=>(0,l.isNil)(e)?ee.None():ee.Some(t(e))}),ee={Some:Z,None:()=>Z(null),chain:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return e=>t.reduce(((e,t)=>e.map(t)),e)},fromFalsy:function(e){return e?ee.Some(e):ee.None()},fromNull:function(e){return null==e?ee.None():ee.Some(e)},fromUndefined:function(e){return void 0===e?ee.None():ee.Some(e)},fromEmpty:function(e){return E(e)?ee.None():ee.Some(e)}},te=(e,t)=>{let r=null;return function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];const o=()=>{e.apply(this,i),r=null};r&&clearTimeout(r),r=setTimeout(o,t)}},re=(e,t)=>(r,n)=>{const i=t?(0,l.prop)(t):l.identity;return e.indexOf(i(r))-e.indexOf(i(n))},ne=(0,l.when)((0,l.is)(Array),(0,l.prop)(0)),ie=e=>Array.isArray(e)?e:[e],ae=e=>[e],oe=e=>!!e&&["www.","http://","https://","ftp://","ftps://","smb://","data:"].some((t=>String(e).toLowerCase().startsWith(t))),se=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase()),le=e=>se(e=e||"")?`mailto:${e}`:!e.includes("://")&&(e.toLowerCase().startsWith("www.")||e.split(".").length>2)?`http://${e}`:e,ue=(0,l.when)((0,l.is)(String),(e=>""===e?void 0:"true"===e.toLowerCase())),ce=e=>null!=e&&["object","function"].includes(typeof e),pe=function(e){const t=[],r=(e,n)=>{n=n||[];for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(Array.isArray(e)&&(i=parseInt(i,10)),ce(e[i])?r(e[i],n.concat(i)):t.push(n.concat(i)))};return r(e),t},de=(0,l.when)((0,l.is)(Object),JSON.stringify),ye=(e,t,r)=>{const n=[r,"errorDetailMessage","errorMessage","error"];return(0,l.cond)([...n.map((e=>[(0,l.prop)(e),(0,l.pipe)((0,l.prop)(e),de)])),[(0,l.always)(t),(0,l.always)(t)],[l.T,de]])(e)},fe=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)},Te=/[\n\r%#()<>?[\\\]^`{}|]/g,Ee=e=>`data:image/svg+xml;utf8,${e.replace(/["']\);{0,}$/,"").replace(/'/g,'"').replace(/>\s{1,}</g,"><").replace(/\s{2,}/g," ").replace(Te,encodeURIComponent)}`,me=e=>`data:image/gif;base64,${e}`;var he=r(87918),be=r.n(he);const Oe=e=>{switch(e){case"minutes":return be().text("minutes");case"hours":return be().text("hours");case"days":return be().text("days");case"weeks":return be().text("weeks");case"months":return be().text("months");case"years":return be().text("years");default:return""}};var ve=r(76665);let ge,_e,Ae,Ne,Pe,Re,Se,we,Ie,Ue,Ce,De,je,Le,ke,Fe,Me,xe,$e,Ve,Ge,We,Be,Ye,qe,He,Qe,Ke,Je,Xe,ze,Ze,et,tt,rt,nt,it,at,ot;var st;!function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(ge||(ge={})),function(e){e.local="local",e.validationService="validationService"}(_e||(_e={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(Ae||(Ae={})),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"}(Ne||(Ne={})),function(e){e.WITHIN="within",e.AGO="ago",e.BETWEEN="between"}(Pe||(Pe={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(Re||(Re={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch",e.RELATION_ATTRIBUTE="relationAttribute"}(Se||(Se={})),function(e){e.directed="directed",e.undirected="undirected",e.bidirectional="bidirectional"}(we||(we={})),function(e){e.asc="asc",e.desc="desc"}(Ie||(Ie={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(Ue||(Ue={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(Ce||(Ce={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}(De||(De={})),function(e){e.TABLE="table",e.List="list",e.MAP="map"}(je||(je={})),function(e){e.PROFILE="profile",e.MAP="map"}(Le||(Le={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(ke||(ke={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(Fe||(Fe={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(Me||(Me={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(xe||(xe={})),function(e){e.EXISTS="exists",e.MISSING="missing"}($e||($e={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(Ve||(Ve={})),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"}(Ge||(Ge={})),function(e){e.ENTITY_TYPE="entityLevel",e.ATTRIBUTE_TYPE="attributeLevel"}(We||(We={})),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"}(Be||(Be={})),function(e){e.IN="in",e.OUT="out"}(Ye||(Ye={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}(qe||(qe={})),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"}(He||(He={})),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"}(Qe||(Qe={})),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"}(Ke||(Ke={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}(Je||(Je={})),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"}(Xe||(Xe={})),function(e){e.CustomAction="CustomAction",e.ConsoleAppAction="ConsoleAppAction"}(ze||(ze={})),function(e){e.NEW="new",e.CLASSIC="classic"}(Ze||(Ze={})),function(e){e.ASC_BY_NAME="ascByName"}(et||(et={})),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"}(tt||(tt={})),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"}(rt||(rt={})),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"}(nt||(nt={})),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"}(it||(it={})),function(e){e.AWAITING_REVIEW="AWAITING_REVIEW",e.APPLIED="APPLIED",e.REJECTED="REJECTED"}(at||(at={})),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"}(ot||(ot={})),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"}(st||(st={}));const lt=st;let ut,ct;!function(e){e.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}(ut||(ut={})),function(e){e.Saving="Saving",e.Cloning="Cloning"}(ct||(ct={}));const pt=(0,l.prop)("referencedEntityTypeURI"),dt=(0,l.prop)("relationshipTypeURI"),yt=(0,l.prop)("referencedAttributeURIs"),ft=(0,l.curry)(((e,t)=>(0,l.pipe)(yt,(0,l.filter)((0,l.startsWith)(e)))(t))),Tt=ft("configuration/relationTypes"),Et=ft("configuration/entityTypes"),mt=(0,l.pipe)((0,l.prop)("uri"),(0,l.startsWith)("configuration/relationTypes")),ht=(0,l.filter)(mt),bt=(e,t)=>!t||t.some((t=>t===e.uri)),Ot="1Tempo4rary",vt="1Tepmo4Rel",gt=(0,l.cond)([[l.isNil,(0,l.always)("")],[(0,l.test)(/[^/]$/),(0,l.concat)(l.__,"/")]]),_t=()=>`1Tempo4DCR${Date.now()+Math.round(1e3*Math.random())}`,At=e=>`${e}/uri$$${Date.now()+Math.round(1e3*Math.random())}`,Nt=e=>()=>At(e),Pt=(e,t)=>{const r=gt(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return At(n)},Rt=e=>e&&e.includes("uri$$"),St=Nt("entities"),wt=Nt("relations"),It=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),Ut=(0,l.startsWith)("relations/"),Ct=(0,l.startsWith)("entities/"),Dt=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/entityTypes/")),jt=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/relationTypes/")),Lt=(0,l.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),kt=(0,l.pipe)((0,l.split)("/"),l.head),Ft=(0,l.pipe)((0,l.split)("/"),l.last),Mt=e=>e.split(".").slice(0,2).join("."),xt=(e,t)=>{const[r,...n]=e.split("."),i=n.join(`/${r}/`);return`${t||""}/${r+(i&&`/${i}`)}`},$t=(0,l.curry)(((e,t)=>`${e}/attributes/${t}`)),Vt=(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("/")},Gt=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},Wt=(0,l.either)((0,l.startsWith)("attributes."),(0,l.startsWith)("analyticsAttributes.")),Bt=e=>2===e.split("/").length,Yt=e=>5===e.split("/").length,qt=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},Ht=e=>e.replace(/uri\$\$/g,Ot),Qt=e=>e.includes("changeRequests/")&&e.includes("/changes/"),Kt=e=>e.split("/changes/")[1];function Jt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xt=(0,l.allPass)([(0,l.propSatisfies)((0,l.either)(l.isNil,Dt),"uri"),(0,l.prop)("faceted"),(0,l.propEq)("type",lt.TYPE_STRING)]),zt=(0,l.has)("values"),Zt=(0,l.cond)([[(0,l.has)("dependentLookupCode"),(0,l.always)(lt.TYPE_DEPENDENT_LOOKUP)],[(0,l.has)("lookupCode"),(0,l.always)(lt.TYPE_LOOKUP)],[zt,(0,l.always)(lt.TYPE_ENUM)],[Xt,(0,l.always)(lt.TYPE_TYPEAHEAD)],[(0,l.propEq)("type",lt.TYPE_BOOLEAN),(0,l.always)(lt.TYPE_BOOLEAN_RADIO)],[l.T,(0,l.prop)("type")]]),er=(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){Jt(e,t,r[t])}))}return e}({},e,{type:Zt(e)})),(0,l.pick)(["type","values","lookupCode","uri","dependentLookupCode","singleValue"])),tr=e=>!!e&&(!!e.autoGenerated&&e.type!==lt.TYPE_NESTED||!!e.parentAutoGenerated),rr=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.test)(/\/analyticsAttributes\//)),nr=(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),ir=e=>rr(e)?"analyticsAttributes":"attributes",ar=(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))),sr=or(lt.TYPE_NESTED),lr=or(lt.TYPE_REFERENCE),ur=or(lt.TYPE_IMAGE),cr=(0,l.either)(sr,lr),pr=(e,t)=>{const r=rr(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(".")},dr=(0,l.either)((0,l.prop)("lookupCode"),(0,l.prop)("dependentLookupCode")),yr=(0,l.pipe)(dr,Boolean),fr=(0,l.pipe)((0,l.prop)("dependentLookupCode"),Boolean),Tr=(0,l.both)(yr,(0,l.pipe)(dr,("rdm",(0,l.pipe)(kt,(0,l.equals)("rdm")))));const Er=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=ir({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]||hr(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:[]},mr=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=Er(e,t,r);return n.length?(0,l.last)(n):null},hr=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",lt.TYPE_NESTED),(0,l.propEq)("type",lt.TYPE_IMAGE)]),(0,l.prop)("attributes")],[(0,l.propEq)("type",lt.TYPE_REFERENCE),(0,l.pipe)(yt,(0,l.map)((t=>mr(e,t))),(0,l.reject)(l.isNil))],[l.T,(0,l.always)(null)]])(t)},br=[lt.TYPE_ACTIVENESS_DATE,lt.TYPE_DATE,lt.TYPE_TIMESTAMP,lt.TYPE_LOCAL_DATE],Or=[lt.TYPE_ACTIVENESS_DATE,lt.TYPE_TIMESTAMP,lt.TYPE_LOCAL_DATE],vr=e=>br.includes(e),gr=e=>Or.includes(e),_r=[lt.TYPE_INT,lt.TYPE_LONG,lt.TYPE_NUMBER,lt.TYPE_FLOAT,lt.TYPE_DOUBLE,lt.TYPE_COUNT],Ar=e=>_r.includes(e),Nr=e=>[lt.TYPE_FLOAT,lt.TYPE_DOUBLE].includes(e),Pr=[lt.TYPE_BOOLEAN,lt.TYPE_BOOLEAN_RADIO,lt.TYPE_RDM_LOOKUPS_NOT_RESOLVED],Rr=e=>Pr.includes(e),Sr=[lt.TYPE_URL,lt.TYPE_BLOG_URL,lt.TYPE_IMAGE_URL],wr=e=>Sr.includes(e),Ir=or(lt.TYPE_EMAIL),Ur=e=>lt.TYPE_SSN===e;var Cr,Dr=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(Cr||(Cr={}));const jr=(0,l.curry)(((e,t,r)=>{var n;const i=e===Cr.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)))})),Lr=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),kr=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),Lr),Fr=(0,l.pipe)((0,l.reject)(E),kr);function Mr(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){xr(e,t,r[t])}))}return e}function xr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $r=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("?")?"&":"?")+Lr(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}},Vr=e=>t=>{if(!(e=>!ce(e.value))(t)){var r;const n=`${e}/${null!==(r=t.refEntity)&&void 0!==r&&r.objectURI?Ft(t.refEntity.objectURI):_t()}`;return Mr({},t,{uri:n,value:(0,l.fromPairs)((0,l.map)(Gr(n),(0,l.toPairs)(t.value)))})}return Mr({},t,{uri:`${e}/${_t()}`})},Gr=e=>t=>{let[r,n]=t;return[r,(0,l.map)(Vr(`${e}/${r}`),n)]},Wr=e=>{const{uri:t}=e;return(0,l.evolve)({attributes:(0,l.pipe)(l.toPairs,(0,l.map)(Gr(`${t}/attributes`)),l.fromPairs)},e)},Br=e=>(0,l.evolve)({changes:(0,l.map)((0,l.map)((0,l.when)((0,l.propEq)("type",it.CREATE_ENTITY),(0,l.evolve)({newValue:Wr}))))},e),Yr={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},qr=(0,l.equals)(Yr.SUGGESTING),Hr=(0,l.equals)(Yr.EDITING),Qr=(0,l.equals)(Yr.VIEWING),Kr=(0,l.either)(Hr,qr),Jr=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Xr=(0,l.curry)(((e,t)=>(0,l.pipe)(Jr(e),(0,l.prop)("extendsTypeURI"))(t))),zr=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(Xr(e,r)));return n(r)})),Zr=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=Xr(e,n);return r})),en=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?en(e,Jr(e,t.extendsTypeURI),r):void 0,tn=(e,t)=>{const r=t.map(Zr(e));return(r.length?r.reduce(l.intersection):[])[0]},rn=(e,t)=>en(e,(0,l.is)(Object,t)?t:Jr(e,t),"typeImage"),nn=(e,t)=>e.entityTypes.reduce(((r,n)=>n.uri!==t&&zr(e,t,n.uri)?r.concat(n.uri):r),[]),an={EQUALS:"equals",NOT_EQUALS:"not equals",EXISTS:"exists",FULL_TEXT:"fullText",HAS_ALL:"hasAll",MISSING_VALUE:"missing",IN_RANGE:"range",LT:"lt",LTE:"lte",GT:"gt",GTE:"gte",STARTS_WITH:"startsWith",COUNT_EQUALS:"count.equals",COUNT_NOT_EQUALS:"count.not.equals",COUNT_LT:"count.less",COUNT_LTE:"count.less.or.equals",COUNT_GT:"count.greater",COUNT_GTE:"count.greater.or.equals",COUNT_RANGE:"count.range",IN_FILE:"in.file",NOT_IN_FILE:"not.in.file",CONTAINS:"contains",ON:"on",BEFORE:"before",AFTER:"after",WITHIN:"within"},on={LIST_EQUALS:"listEquals",NOT_LIST_EQUALS:"not listEquals",LIST_EQUALS_CASE_SENSITIVE:"listEqualsCaseSensitive",NOT_LIST_EQUALS_CASE_SENSITIVE:"not listEqualsCaseSensitive"},sn={[an.EQUALS]:"equals",[an.NOT_EQUALS]:"not",[an.STARTS_WITH]:"starts with",[an.MISSING_VALUE]:"missing value",[an.IN_RANGE]:"in range",[an.HAS_ALL]:"has all",[an.FULL_TEXT]:"full text",[an.EXISTS]:"exists",[an.COUNT_EQUALS]:"count equals",[an.COUNT_NOT_EQUALS]:"count not equal",[an.COUNT_LT]:"count less",[an.COUNT_LTE]:"count less or equal",[an.COUNT_GT]:"count greater",[an.COUNT_GTE]:"count greater or equal",[an.COUNT_RANGE]:"count in range",[an.LT]:"less than",[an.LTE]:"less than or equal",[an.GT]:"greater than",[an.GTE]:"greater than or equal",[an.IN_FILE]:"in file",[an.NOT_IN_FILE]:"not in file",[an.CONTAINS]:"contains",[an.ON]:"on",[an.BEFORE]:"before",[an.AFTER]:"after",[an.WITHIN]:"within"},ln="in",un="notIn",cn="not range",pn=e=>({[ln]:an.EQUALS,[un]:an.NOT_EQUALS}[e]||e);var dn,yn;!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"}(dn||(dn={})),function(e){e.LAST_3DAYS="last3Days"}(yn||(yn={}));const fn=["LAST_DAY","LAST_3DAYS","LAST_WEEK","LAST_MONTH","LAST_6MONTHS","LAST_YEAR","PICK_DATE"].reduce(((e,t)=>(e[t]=dn[t]||yn[t],e)),{}),Tn={[dn.LAST_DAY]:"Last 24 hours",[yn.LAST_3DAYS]:"Last 3 days",[dn.LAST_WEEK]:"Last 7 days",[dn.LAST_MONTH]:"Last month",[dn.LAST_6MONTHS]:"Last 6 months",[dn.LAST_YEAR]:"Last year",[dn.PICK_DATE]:"Pick date"},En={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},mn={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},hn="<No label>",bn={IN:"in",OUT:"out"};function On(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){vn(e,t,r[t])}))}return e}function vn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gn={startDate:{type:lt.TYPE_ACTIVENESS_DATE,get label(){return be().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:lt.TYPE_ACTIVENESS_DATE,get label(){return be().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},_n=On({id:{type:lt.TYPE_ENTITY_ID,get label(){return be().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},gn,{roles:{type:lt.TYPE_STRING,get label(){return be().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:lt.TYPE_STRING,get label(){return be().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),An={workflow:{type:lt.TYPE_STRING,get label(){return be().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:lt.TYPE_STRING,get label(){return be().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:lt.TYPE_STRING,get label(){return be().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:lt.TYPE_TIMESTAMP,get label(){return be().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},Nn={commenter:{type:lt.TYPE_STRING,get label(){return be().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},Pn={notResolved:{type:lt.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return be().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},Rn={createdBy:{type:lt.TYPE_STRING,get label(){return be().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:lt.TYPE_STRING,get label(){return be().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:lt.TYPE_TIMESTAMP,get label(){return be().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:lt.TYPE_TIMESTAMP,get label(){return be().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},Sn={matches:{type:lt.TYPE_COUNT,get label(){return be().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:lt.TYPE_COUNT,get label(){return be().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0}},wn={sourceSystems:{type:lt.TYPE_STRING,get label(){return be().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:lt.TYPE_STRING,get label(){return be().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:lt.TYPE_INT,get label(){return be().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:lt.TYPE_TIMESTAMP,get label(){return be().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:lt.TYPE_TIMESTAMP,get label(){return be().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:lt.TYPE_TIMESTAMP,get label(){return be().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:lt.TYPE_TIMESTAMP,get label(){return be().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:lt.TYPE_TIMESTAMP,get label(){return be().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:lt.TYPE_STRING,get label(){return be().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}};let In;!function(e){e.matchRules="matchRules",e.MLRecommendedMatch="MLRecommendedMatch"}(In||(In={}));const Un={[In.matchRules]:{type:lt.TYPE_STRING,get label(){return be().text("Match Rules")},uri:In.matchRules,name:In.matchRules,faceted:!0,hideForDataTenant:!0},[In.MLRecommendedMatch]:{type:lt.TYPE_STRING,get label(){return be().text("Match IQ")},uri:In.MLRecommendedMatch,name:In.MLRecommendedMatch,faceted:!0,hideForDataTenant:!0}},Cn=On({},_n,An,Nn,Pn,Rn,Sn,wn,Un,{type:{type:lt.TYPE_STRING,get label(){return be().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}}),Dn="NOT_MATCH";var jn=r(13980),Ln=r.n(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}const Mn=Ln().oneOf(["mobile","tablet","desktop"]),xn=Ln().shape({deviceTypes:Ln().oneOfType([Mn,Ln().arrayOf(Mn)]),roles:Ln().arrayOf(Ln().string)}),$n=Ln().shape({value:Ln().string,lookupCode:Ln().string}),Vn=Ln().shape({link:Ln().string,filename:Ln().string}),Gn=Ln().shape({displayName:Ln().string,parent:Ln().string}),Wn=Ln().oneOfType([Ln().string,Ln().number,Ln().bool,$n]),Bn=Ln().oneOfType([Wn,Ln().arrayOf(Wn)]),Yn=Ln().shape({fieldName:Ln().string,values:Ln().arrayOf(Bn),filter:Ln().string,type:Ln().string}),qn=Ln().shape({minValue:Ln().number,maxValue:Ln().number}),Hn=Ln().shape({label:Ln().string,name:Ln().string,description:Ln().string,type:Ln().string,hidden:Ln().bool,faceted:Ln().bool,searchable:Ln().bool,uri:Ln().string,access:Ln().arrayOf(Ln().string),cardinality:qn}),Qn=Ln().shape({label:Ln().string,uri:Ln().string,typeColor:Ln().string,direction:Ln().string,startObject:Ln().object,endObject:Ln().object}),Kn=Ln().shape({typeColor:Ln().string,typeIcon:Ln().string,typeImage:Ln().string,label:Ln().string,uri:Ln().string,attributes:Ln().arrayOf(Hn)}),Jn=Ln().shape({uri:Ln().string,label:Ln().string,memberTypes:Ln().array,extendsTypeUri:Ln().string,attributes:Ln().arrayOf(Hn)}),Xn=Ln().shape({uri:Ln().string,label:Ln().string,extendsTypeUri:Ln().string,relationshipTypeURIs:Ln().arrayOf(Ln().string)}),zn=Ln().shape({uri:Ln().string,description:Ln().string,label:Ln().string,schemaVersion:Ln().string,entityTypes:Ln().arrayOf(Kn),roles:Ln().arrayOf(Ln().object),groupTypes:Ln().arrayOf(Ln().object),relationTypes:Ln().arrayOf(Qn),graphTypes:Ln().arrayOf(Xn),interactionTypes:Ln().arrayOf(Jn),sources:Ln().arrayOf(Ln().object)}),Zn=Ln().shape({uri:Ln().string,type:Ln().string}),ei=Ln().shape({uri:Ln().string,attributes:Ln().object,type:Ln().string,timestamp:Ln().number,members:Ln().object}),ti=Ln().shape({uri:Ln().string,type:Ln().string}),ri=Ln().shape({value:Ln().object,ov:Ln().bool,type:Ln().string,uri:Ln().string}),ni=Ln().shape({refEntity:Ln().oneOfType([Ln().array,Ln().object]),refRelation:Ln().oneOfType([Ln().array,Ln().object]),value:Ln().object,ov:Ln().bool,type:Ln().string,uri:Ln().string}),ii=Ln().oneOf((0,l.values)(Yr)),ai=Ln().shape({type:Ln().oneOf(Object.values(ge)).isRequired,attributeTypeUri:Ln().string.isRequired,parentUri:Ln().string.isRequired,uri:Ln().string,message:Ln().string}),oi={attributeType:Hn,showEmptyEditors:Ln().bool,lazy:Ln().bool,mode:ii,metadata:zn,ownError:ai,errors:Ln().arrayOf(ai),crosswalks:Ln().array,onAddAttributes:Ln().func,onAddOneMore:Ln().func,onDeleteAttribute:Ln().func,onChangeAttribute:Ln().func,additionalControlsRenderer:Ln().func,hideDeleteButton:Ln().bool,showNonOv:Ln().bool,state:Ln().oneOf(["deleted","edited"]),expanded:Ln().bool},si=kn({attributeValue:ri},oi),li=kn({attributeValue:ni},oi),ui=Ln().shape({value:Ln().oneOfType([Ln().string,Ln().bool,Ln().number]),ov:Ln().bool,type:Ln().string,uri:Ln().string,lookupCode:Ln().string,lookupRawValue:Ln().string}),ci=Ln().shape({totalOvValues:Ln().number,totalValues:Ln().number}),pi=Ln().shape({inRelations:Ln().arrayOf(Ln().oneOfType([Ln().object,Ln().string])),outRelations:Ln().arrayOf(Ln().oneOfType([Ln().object,Ln().string])),groups:Ln().arrayOf(Ln().string),entityTypes:Ln().arrayOf(Ln().string),nextEntry:Ln().object}),di=Ln().oneOf(["asc","desc"]),yi=Ln().shape({id:Ln().string,content:pi,allowOnlyCreateNew:Ln().bool,sortColumn:Ln().string,sortOrder:di,"text-empty":Ln().string,max:Ln().number,icon:Ln().string,caption:Ln().string,canCreate:xn,canRead:xn,canUpdate:xn,canDelete:xn,editingEnabled:Ln().bool}),fi=Ln().shape({id:Ln().string,caption:Ln().string,pageSize:Ln().number,icon:Ln().string,canCreate:xn,canRead:xn,canUpdate:xn,canDelete:xn,attributes:Ln().object}),Ti=Ln().shape({entityUri:Ln().string,entityType:Ln().string,entityLabel:Ln().string,object:Zn}),Ei=Ln().shape({relationUri:Ln().string,relationType:Ln().string,relationLabel:Ln().string,direction:Ln().string,object:ti}),mi=Ln().shape({entity:Ti,relation:Ei}),hi=Ln().shape({value:Ln().string,isRawFilter:Ln().bool}),bi=Ln().shape({id:Ln().string,label:Ln().string,name:Ln().string,availableEntityTypes:Ln().array}),Oi=Ln().shape({id:Ln().string,allowMergeAll:Ln().bool,matchActions:Ln().object,availableTabs:Ln().arrayOf(Ln().oneOf(["findMatches","potentialMatches","notAMatch"]))}),vi=Ln().shape({matchRules:Ln().arrayOf(Ln().string),object:Zn,shortestTransitiveMatchPath:Ln().arrayOf(Ln().shape({matchRules:Ln().arrayOf(Ln().string),match:Ln().string})),direct:Ln().bool,matchScore:Ln().number}),gi=Ln().arrayOf(vi),_i=Ln().arrayOf(Ln().shape({uri:Ln().string,label:Ln().string})),Ai=[{label:be().text("And"),value:"and"},{label:be().text("Or"),value:"or"},{label:be().text("And not"),value:"and not"},{label:be().text("Or not"),value:"or not"}];function Ni(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Pi=(0,l.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Ri=(0,l.pipe)(Pi,(0,l.propOr)("","label")),Si=(0,l.curry)(((e,t)=>{const r=Pi(e,t);return[(0,l.path)(["startObject","objectTypeURI"],r),(0,l.path)(["endObject","objectTypeURI"],r)]})),wi=(0,l.curry)(((e,t,r)=>{const[n,i]=Si(e,r);return zr(e,n,t)||zr(e,i,t)})),Ii=(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){Ni(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),Ui=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?bn.OUT:bn.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(bn.IN),i=r(bn.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},Ci=(0,l.pathOr)("",["directionalContext",0,"labelPattern"]),Di=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?Di(e,Pi(e,t.extendsTypeURI),r):void 0,ji={CREATE:"CREATE",READ:"READ",UPDATE:"UPDATE",DELETE:"DELETE",INITIATE_CHANGE_REQUEST:"INITIATE_CHANGE_REQUEST",MERGE:"MERGE",UNMERGE:"UNMERGE"},Li=(0,l.curry)(((e,t)=>e.every((e=>ki(e,t))))),ki=(0,l.curry)(((e,t)=>{const r=tr(t);return Fi(e,t)&&(e===ji.READ||!r)})),Fi=(e,t)=>!t||!t.access||t.access.includes(e),Mi=(0,l.curry)(((e,t,r)=>ki(ji.READ,r)&&(qr(t)?ki(ji.INITIATE_CHANGE_REQUEST,r):ki(e,r)))),xi=Mi(ji.CREATE),$i=Mi(ji.DELETE),Vi=Mi(ji.UPDATE),Gi=Li([ji.CREATE,ji.MERGE,ji.READ,ji.UPDATE]),Wi=Li([ji.UPDATE,ji.READ,ji.CREATE]),Bi=Li([ji.UPDATE,ji.READ]),Yi=Li([ji.DELETE,ji.UPDATE,ji.READ]),qi=(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["*"])),Hi=(e,t,r)=>(0,l.pipe)((0,l.map)(qi(e,t)),(0,l.filter)(l.identity))(r),Qi=(e,t,r)=>{const n=Hi(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&ki(ji.MERGE,r)},Ki=(0,l.curry)(((e,t,r,n)=>{const i=Pi(e,n),[a,o]=Si(e,n);return i&&ki(ji.CREATE,i)&&zr(e,a,t.type)&&zr(e,o,r.type)})),Ji=(e,t,r,n,i)=>{const a=Jr(e,n.type),o=Hi(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(Ki(e,n,i))||a.some(Ki(e,i,n))}))},Xi=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=Jr(e,r.type),o=(0,l.propOr)({},"matchActions",t);return{canMerge:Qi(o,i,a),canAddRelation:Ji(e,o,i,r,n),canMark:ki(ji.UPDATE,a)&&ki(ji.READ,a)}},zi=(e,t,r,n)=>(0,l.pipe)((0,l.map)((n=>Xi(e,t,n.object,r,n.matchRules))),(0,l.reduce)((0,l.mergeWith)(l.and),{}))(n),Zi=rr,ea=(0,l.complement)(Zi),ta=ki(ji.READ),ra=e=>{let{attributeType:t,mode:r}=e;return ea(t)&&xi(r,t)&&!ar(t)},na=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=Rt(r.uri),o=Vi(n),s=xi(n);return(0,l.cond)([[Zi,l.F],[(0,l.always)(a),l.T],[(0,l.always)(i),o],[l.T,(0,l.allPass)([o,s])]])(t)},ia=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=Rt(r.uri),s=Vi(n),u=$i(n),c=oa(ji.UPDATE,n,a,r),p=oa(ji.DELETE,n,a,r);return(0,l.cond)([[Zi,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)},aa=(0,l.curry)(((e,t,r,n)=>{const i="Reference"!==n.type&&hr(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=>!Fi(e,n)||!aa(e,t,r[n.name],n)))))})),oa=(0,l.curry)(((e,t,r,n,i)=>qr(t)?aa(ji.INITIATE_CHANGE_REQUEST,r,n,i):aa(e,r,n,i))),sa=(0,l.both)((0,l.complement)(ar),ta),la="SuperUser",ua="allTenants",ca=[ua,"allCustomers"],pa=e=>{let{allowedPermissionsNames:t,permissionsNames:r,permissionsConfig:n,superUserEnvironments:i}=e;return t.map((e=>{switch(e){case r.NON_SECURED:return l.T;case r.SECURED:return e=>void 0!==e.userPermissions;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===la})).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===la){const e=r?ca.concat(r.map((e=>`allTenants.${e}`))):ca,n=r&&t[0]===ua?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}))},da={NON_SECURED:"NON_SECURED",SECURED:"SECURED",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"},ya={[da.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[da.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activities"],privileges:["EXECUTE"]},[da.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[da.CAN_READ_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ"]},[da.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[da.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[da.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[da.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[da.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[da.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[da.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[da.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[da.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[da.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[da.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[da.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[da.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[da.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[da.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[da.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[da.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[da.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[da.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[da.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[da.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[da.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[da.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[da.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[da.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]},[da.CAN_READ_DVF]:{serviceId:"DVF",resourcePath:["functionsManagement"],privileges:["READ"]}},fa=(0,l.curry)(((e,t,r)=>pa({allowedPermissionsNames:e,permissionsNames:da,permissionsConfig:ya}).some((e=>e(t,{params:{tenant:r}}))))),Ta=fa([da.CAN_EXPORT]),Ea=fa([da.CAN_EXPORT_ACTIVITIES]),ma=fa([da.CAN_IMPORT_ENTITIES_FROM_DT]),ha=fa([da.CAN_READ_ENTITIES_FROM_DT]),ba=fa([da.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),Oa=fa([da.CAN_UPDATE_PROCESS_INSTANCE]),va=fa([da.CAN_VIEW_WORKFLOW_DEFINITION]),ga=fa([da.CAN_CONFIG_ENVIRONMENT_REGISTER]),_a=fa([da.CAN_UPDATE_WORKFLOW_DATA_TASK]),Aa=fa([da.CAN_READ_WORKFLOW_DATA_TASK]),Na=fa([da.CAN_MANAGE_WORKFLOW_DEFINITION]),Pa=fa([da.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),Ra=fa([da.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),Sa=fa([da.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),wa=fa([da.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),Ia=fa([da.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),Ua=fa([da.CAN_EXECUTE_WORKFLOW_JOBS]),Ca=fa([da.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),Da=fa([da.CAN_CREATE_CONFIG_JAR]),ja=fa([da.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),La=fa([da.CAN_VIEW_CONFIG_JAR]),ka=fa([da.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),Fa=fa([da.CAN_VIEW_WORKFLOW_JOBS]),Ma=fa([da.CAN_MAKE_BULK_UPDATE]),xa=fa([da.CAN_OPEN_DATA_LOADER_EXECUTE,da.CAN_OPEN_DATA_LOADER_READ]),$a=fa([da.CAN_BULK_DELETE_PROFILES]),Va=fa([da.CAN_READ_MDM_DATA_ENTITIES]),Ga=fa([da.CAN_READ_DVF]),Wa=fa([da.IS_FREEMIUM_ADMIN]),Ba=(0,l.reject)(ar),Ya=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),Ba,(0,l.filter)(e))(t),qa=(0,l.curry)(((e,t)=>Ya((t=>ra({attributeType:t,mode:e})),t))),Ha=(0,l.curry)(((e,t)=>Ya((t=>ra({attributeType:t,mode:e})||sa(t)),t))),Qa=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(sa)),Ka=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Ka(e)])))),Ja=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(sa),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Ja(e)])))),Xa=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...Xa(e)])))),za=(0,l.pipe)(Jr,(0,l.converge)(l.concat,[Ja,Xa]));function Za(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){eo(e,t,r[t])}))}return e}function eo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const to=(0,l.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,to(e)))},t))),ro=e=>{var t;return Za({},e,{matchGroups:(0,l.uniq)((e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[]))})},no=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),io=(0,l.when)(no,(0,l.dissoc)("values")),ao=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return Za({},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})})),oo=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},so=(0,Dr.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(Ka,t).concat((0,l.chain)(Ka,r)).some(oo)})),lo=e=>{let t=!1;const r=to((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?Za({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},uo=e=>{const t=so(e),r=(0,l.map)((e=>to((0,l.pipe)(io,(0,l.when)((0,l.always)(e),ao))))(t)),n=(0,l.map)(ro),i=(0,l.map)(lo);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},co=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),po=(0,l.prop)("relationshipTypeURIs"),yo=(0,l.curry)(((e,t)=>{var r;return(null===(r=e.graphTypes)||void 0===r?void 0:r.filter(fo(e,t)))||[]})),fo=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return null==n?void 0:n.some(wi(e,t))},To=(e,t)=>(0,l.pipe)(co,(0,l.defaultTo)({}),po,(0,l.defaultTo)([]),(0,l.chain)(Si(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(Jr(e)))(e,t),Eo=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),mo=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),ho=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return mo((0,l.complement)(Eo))(e)},bo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return mo(Eo)(e)},Oo=(0,l.pipe)(Jr,(0,l.propOr)([],"matchGroups")),vo=(e,t,r)=>(0,l.pipe)(Oo,(0,l.find)((0,l.propEq)("uri",r)))(e,t),go=(0,l.curry)(((e,t,r)=>(0,l.pipe)(vo,(0,l.propOr)(r,"label"))(e,t,r))),_o=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(Oo,(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]})),Ao=e=>(0,l.partition)(Eo,e),No=(0,l.includes)(l.__,["and","or","not"]),Po=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),Ro=(0,l.includes)(l.__,["equals","notEquals","in"]),So=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return No(t)?So(r):Po(t)?r.filter(Dt):Ro(t)?r.map((0,l.prop)("uri")).filter(Dt):[]})),l.uniq),wo=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)(So),l.uniq),Io=(0,l.pipe)(Oo,wo),Uo=(0,l.pipe)(_o,wo),Co=(e,t)=>{let{interactionTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},Do=(0,l.pipe)(Co,Ja),jo=(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||zr(e,n,t)})(e,t))})(e,t)),Lo=e=>!!e.required,ko=(e,t,r)=>{const n=(0,l.cond)([[Dt,Jr(e)],[jt,Pi(e)]])(t);return Fo(e,n,r)},Fo=(e,t,r)=>!t||t.hidden&&!(e=>e.uri&&Dt(e.uri)&&3===e.uri.split("/").length)(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!tr(e))).flatMap((t=>{const n=t.required?[t]:[];if(r){let i;if(t.type===lt.TYPE_REFERENCE){const n=dt(t),a=yt(t);i=ko(e,n,r).filter((e=>a.some(Lt(e.uri))))}else t.attributes&&(i=Fo(e,t,r));i&&n.push(...i)}return n})):t.type===lt.TYPE_REFERENCE?ko(e,dt(t),r):[],Mo=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),Lo]),e.attributes||[])},xo=(e,t)=>{const r=Et(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},$o=(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)?be().text(n):n};return r(null,t)})),Vo=["label","description","abbreviation","caption","toolTip"],Go=e=>$o(Vo,e),Wo=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=Ft(t);return r.find((e=>{let{uri:t}=e;return Ft(t)===n}))})),Bo=(0,l.curry)(((e,t)=>{const r=Ft(t);return(0,l.pipe)(Wo(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),Yo=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"})},qo=(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}))},Ho=(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)})),Qo=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=Jr(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));function Ko(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){Jo(e,t,r[t])}))}return e}function Jo(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=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 zo(i,e,t,r,n)},zo=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:["attributes"];return ee.fromNull(e&&e.length?e:hr(t,r)).map((e=>e.map((e=>{const r=Xo(t,e,n,i);return r.length?Ko({},e,{children:r}):e})))).orSome([]).filter((0,l.either)((0,l.complement)(cr),(0,l.prop)("children"))).filter(sa).filter(n).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},Zo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Xo(e,t,r,["attributes","analyticsAttributes"])},es=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Xo(e,t,r,["attributes"])},ts=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Xo(e,t,r,["analyticsAttributes"])},rs=e=>e.children?e.children.flatMap(rs):e,ns=e=>e.children?[e,...e.children.flatMap(ns)]:e,is=(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)})),as=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return Ft(r)===e})))),os=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),as("LUD")),(0,l.defaultTo)(r))(t||[])},ss=(e,t)=>{let{survivorshipStrategies:r}=e;return as(t,r)},ls=(0,l.allPass)([(0,l.complement)(l.isNil),ki(ji.READ)]),us=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),ki(ji.READ)]),cs=(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)([ki(ji.CREATE),ki(ji.INITIATE_CHANGE_REQUEST)])]),ps=(0,l.curryN)(2,(0,l.pipe)(Jr,us)),ds=(0,l.curryN)(2,(0,l.pipe)(Pi,ls));function ys(e,t,r,n){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 fs(e,t){for(var r=e.substr(e.indexOf("/attributes/")+12).split("/"),n=[],i=0;i<r.length;i+=2)n.push(ys(r[i],r[i+1],e,t));return n}function Ts(e,t,r,n,i,a,o){void 0===a&&(a=0);var s=fs(r,t)[a];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 Ts(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 Es(e,t,r,n,i,a){void 0===a&&(a=0);var o=fs(r,t)[a];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()?(ms(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(ms.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=Ts(e,t,r,n,i,a),s}var c=Es(e,o,o.valueUri,{},i,a);Es(c,t,r,n,i,a+1)}function ms(e,t){ce(e)?(t.value=e.value,t.lookupCode=e.lookupCode):(t.value=e,t.lookupCode&&(t.lookupCode=e))}function hs(e,t,r,n){void 0===n&&(n=0);var i=fs(r)[n];if(i.hasChildren){var a=(e[i.name]||[]).filter((function(e){return e.uri===i.valueUri}))[0];a&&hs(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 bs(e,t){e.roles=t||[]}function Os(e,t){e.tags=t||[]}function vs(e,t){e.startDate=t||""}function gs(e,t){e.endDate=t||""}const _s=e=>{let{ov:t}=e;return!1!==t},As=(e,t)=>((e,t)=>wr(e.type)&&oe(t))(e,t)||((e,t)=>Ir(e.type)&&se(t))(e,t),Ns=(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))),Ps=Ns("refEntity"),Rs=Ns("refRelation"),Ss=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],ws=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},Is=(0,l.prop)("objectURI"),Us=(0,l.prop)("objectURI"),Cs=(0,l.prop)("type"),Ds=(0,l.pipe)(Ps,(0,l.defaultTo)({}),Is),js=(0,l.pipe)(Rs,(0,l.defaultTo)({}),Us),Ls=(0,l.pipe)(Ps,(0,l.defaultTo)({}),Cs),ks=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type})));return(e||[]).concat(r)},Fs=(0,l.evolve)({refEntity:ne,refRelation:ne}),Ms=(e,t,r,n)=>{const i=Er(e,r),a=Jr(e,t.type)||Pi(e,t.type);if(0===i.length)return null;const o=ir(r);let s=[t],l=1;i[0].uri!==t.type&&(l=0);let u=null;const c=n?[]:null;let p=null;for(let e=l;e<i.length;++e){const t=e===i.length-1,r=i[e];let l=[];if(!bt(r,p)){u=n?[]:null;break}Array.isArray(s)&&(s.forEach((s=>{const u=s.value||s[o]||{};let d=[];r.startObject&&r.endObject||r.typeColor?(d=((null==a?void 0:a.attributes)||[]).filter((e=>dt(e)===r.uri||pt(e)===r.uri)),p=d.reduce(((e,t)=>{const r=t.referencedAttributeURIs&&t.referencedAttributeURIs.filter((function(t){return-1===e.indexOf(t)}));return r?e.concat(r):e}),[])):(d.push(r),p=null),d.forEach((a=>{const o=u[a.name];o&&(l=l.concat(o)),n&&t&&c.push({attrValues:o||[],parent:s,attrType:r,parentType:i[e-1],typePath:i})}))})),s=l),t&&(u=s)}return c||u},xs=(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?xs(a.value,o):a},$s=(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 xs(e[r],i)})),Vs=(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")]]),Gs=(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"])]]),Ws=(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"])]]),Bs=(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)(Bs(e,i)))))(r)})),Ys=(0,l.curry)(((e,t)=>(0,l.ifElse)((0,l.is)(Array),(0,l.map)(Ys(e)),e)(t))),qs=(0,l.curry)(((e,t,r,n)=>(0,l.pipe)(Bs(e,r),Ys(t))(n))),Hs=qs(null,Vs),Qs=qs(_s,Vs),Ks=qs(null,Gs),Js=qs(_s,Gs),Xs=qs(_s,Ws),zs=(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=$s(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},Zs=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(Ds,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{}),el=(e,t)=>{const r=qt(t),n=(0,l.pipe)((0,l.split)("/"),(0,l.dropLast)(1),l.last)(t);return zs(e,r,n)},tl=Object.values(gn),rl=(0,l.includes)(l.__,tl),nl=e=>tl.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,l.assoc)(n,e[n],t):t}),{});function il(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){al(e,t,r[t])}))}return e}function al(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ol=(e,t)=>`${e}_${t}`,sl=[Cn.matches.name,Cn.matchRules.name],ll=(0,l.values)(An).map((e=>e.name)),ul=e=>(0,l.when)((0,l.always)(!e),(0,l.reject)((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,ll)))),cl=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,sl)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>ol(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),pl=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,l.pipe)(l.values,ul(r),cl(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(ol(`dtPotentialMatches.${t.name}`,"")))))(Cn)},dl=(0,l.propEq)("uri",Cn.type.uri),yl=e=>(0,l.values)(Un).some((0,l.propEq)("uri",null==e?void 0:e.uri)),fl=(0,l.propEq)("uri",wn.sourceSystems.uri),Tl=Object.values(_n),El=(0,l.includes)(l.__,Tl),ml=e=>{let{entity:t,attributeType:r,value:n}=e;return il({},t,{[r.uri]:void 0===n?r.defaultValue:n})},hl=e=>{let{entity:t,attributeType:r}=e;return(0,l.dissoc)(r.uri,t)},bl=e=>{let{entity:t,attributeType:r,value:n}=e;return il({},t,{[r.uri]:n})},Ol=(0,l.propEq)("uri",_n.roles.uri),vl=(0,l.propEq)("uri",_n.tags.uri);function gl(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){_l(e,t,r[t])}))}return e}function _l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Al=e=>{let{parentUri:t,attributeType:r}=e;return gl({uri:Pt(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,l.propOr)("","defaultValue",e);return(0,l.cond)([[cr,(0,l.always)({value:{}})],[yr,()=>t?{value:"",lookupCode:t}:{value:""}],[(0,l.both)((0,l.propEq)("defaultValue","now"),(0,l.pipe)((0,l.prop)("type"),vr)),(0,l.always)({value:Date.now()})],[l.T,(0,l.always)({value:t})]])(e)})(r))},Nl=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)(qa(i),(0,l.filter)((0,l.anyPass)([(0,l.has)("defaultValue"),fr,(0,l.propEq)("required",!0)])))(t),o={};for(const e of a){const{name:t}=e,a=Al({parentUri:r,attributeType:e});let s=hr(n,e);s&&(e.type===lt.TYPE_REFERENCE&&(s=ht(s)),a.value=Nl({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(!(0,l.isEmpty)(a.value)||Boolean(a.lookupCode)||fr(e))&&(o[t]=[a])}return o},Pl=e=>{let{entity:t,metadata:r}=e;return ko(r,t.type,!0).filter(fr).reduce(((e,t)=>{const n=t.name,i=qt(t.uri);return(i===e.type?[{parentUri:e.uri,attributes:e.attributes}]:Ms(r,e,i).map((e=>{let{value:t,uri:r}=e;return{parentUri:r,attributes:t}}))).reduce(((e,r)=>{let{parentUri:i,attributes:a}=r;return a[n]&&0!==a[n].length?e:Sl({entity:e,attributeType:t,parentUri:i,index:0})}),e)}),t)},Rl=(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===lt.TYPE_NESTED?gl({},e,{value:Rl({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return gl({},s(t),Nl({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),Sl=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=Al({parentUri:n,attributeType:r}),u=Vs(l);return(0,ve.ZP)(t,(e=>{Ts(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},wl=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,ve.ZP)(t,(e=>{Ts(e.attributes||e.value,r,n.uri,Vs(n),a,o,i)}))},Il=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,ve.ZP)(t,(e=>{Es(e.attributes||e.value,r,n,i,a,o)}))},Ul=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,ve.ZP)(t,(e=>{hs(e.attributes||e.value,r,n,i)}))},Cl=e=>""===e,Dl=(0,l.cond)([[(0,l.propSatisfies)((0,l.complement)((0,l.anyPass)([Cl,l.isNil])),"lookupCode"),l.F],[(0,l.propSatisfies)((0,l.anyPass)([Cl,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]]),jl=(0,l.reject)(Dl),Ll=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=>Ll({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),jl)),(0,l.when)((0,l.always)(t),(0,l.reject)(l.isEmpty)))},kl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Ll({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),Fs),deleteEmptyComplex:e})},Fl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)(kl(e),(0,l.reject)(l.isEmpty))},Ml=(0,l.curry)(((e,t)=>t.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:i}=t;return rl(r)?ml({entity:e,attributeType:r}):Sl({entity:e,attributeType:r,parentUri:n,index:i})}),e))),xl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n,value:i}=t;return rl(r)?bl({entity:e,attributeType:r,value:i}):Il({entity:e,attributeType:r,uri:n,value:i})})),$l=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n}=t;return rl(r)?hl({entity:e,attributeType:r}):Ul({entity:e,attributeType:r,uri:n})})),Vl=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)},Gl="UrlThumbnail",Wl="CdnUrlThumbnail",Bl=(0,l.curry)(((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(_s):(0,l.head)(n);return e&&e.value}return null})),Yl=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>Bl(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),ql=Yl(["CdnUrl","Url"],!0),Hl=Yl(["CdnUrlPreview","UrlPreview"],!0),Ql=Yl([Wl,Gl],!0),Kl=Yl([Wl,Gl]),Jl=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,l.cond)([[nr,(0,l.always)(t)],[(0,l.both)(rr,(0,l.always)(i)),(0,l.always)(i)],[l.T,(0,l.always)(n)]])(a),s=nr(a)?"uri":"name",u=(0,l.pipe)((0,l.prop)(a[s]),(0,l.when)((0,l.both)((0,l.always)(rl(a)),(e=>null===e)),(0,l.always)([""])),(0,l.defaultTo)([]),ie)(o);return(0,l.when)((0,l.always)(r(u,a)),(0,l.append)({attrType:a,values:u}),e)}),[])},Xl=(e,t,r)=>{const n=Qa(e),i=(0,l.any)(r?l.T:_s);return Jl(n,t,i)},zl=(e,t,r,n,i,a)=>{const o=Rt(null==r?void 0:r.uri)?qa(t,e):Ha(t,e);return Jl(o,r,((e,o)=>{const s=ra({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:_s,e)||nr(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let Zl;const eu=e=>{Zl=e};function tu(e,t){return Zl(e,t)}const ru=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)})),nu=50,iu=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=nu,offset:a=0}=e;return tu("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i,offset:a}),headers:{"Content-Type":"application/json"}})},au=(0,l.once)((()=>tu("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),ou=e=>tu("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),su=(e,t)=>tu("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),lu=e=>ee.fromNull(sn[e]).map(be().text).orSome(""),uu=(0,l.curry)(((e,t)=>`${e}_${t}`)),cu=(0,l.split)("_"),pu=(0,l.includes)("_"),du=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),yu=(0,l.curry)(((e,t)=>e.some(du(t)))),fu=yu([an.IN_RANGE,an.COUNT_RANGE,an.WITHIN]),Tu=yu([an.EXISTS,an.MISSING_VALUE]),Eu=(0,l.cond)([[Tu,(0,l.always)(0)],[fu,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),mu=(0,l.complement)(Tu),hu=yu([an.HAS_ALL,an.EQUALS,an.NOT_EQUALS]),bu=yu([an.COUNT_EQUALS,an.COUNT_NOT_EQUALS,an.COUNT_LT,an.COUNT_LTE,an.COUNT_GT,an.COUNT_GTE,an.COUNT_RANGE]),Ou=yu([an.IN_FILE,an.NOT_IN_FILE]),vu=e=>{switch(e){case an.COUNT_EQUALS:return an.EQUALS;case an.COUNT_NOT_EQUALS:return an.NOT_EQUALS;case an.COUNT_LT:return an.LT;case an.COUNT_LTE:return an.LTE;case an.COUNT_GT:return an.GT;case an.COUNT_GTE:return an.GTE;case an.COUNT_RANGE:return an.IN_RANGE}},gu=yu([an.ON,an.BEFORE,an.AFTER,an.WITHIN,an.NOT_EQUALS]),_u=yu([an.WITHIN]),Au=[[an.COUNT_EQUALS,an.COUNT_NOT_EQUALS,an.COUNT_LT,an.COUNT_LTE,an.COUNT_GT,an.COUNT_GTE],[an.NOT_IN_FILE,an.IN_FILE],[an.EQUALS,an.NOT_EQUALS,an.HAS_ALL],[an.LT,an.LTE,an.GT,an.GTE],[an.MISSING_VALUE,an.EXISTS],[an.COUNT_RANGE],[an.IN_RANGE],[an.STARTS_WITH,an.CONTAINS],[an.FULL_TEXT],[an.ON,an.BEFORE,an.AFTER,an.NOT_EQUALS],[an.WITHIN]],Nu=(e,t)=>Au.some((r=>r.includes(e)&&r.includes(t))),Pu=(0,l.pipe)(l.omit,l.values),Ru={OPTIONS_FOR_STRING:Pu(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],an),OPTIONS_FOR_DATE:[an.ON,an.BEFORE,an.AFTER,an.WITHIN,an.NOT_EQUALS,an.MISSING_VALUE,an.EXISTS,an.COUNT_EQUALS,an.COUNT_NOT_EQUALS,an.COUNT_LT,an.COUNT_LTE,an.COUNT_GT,an.COUNT_GTE,an.COUNT_RANGE,an.IN_FILE,an.NOT_IN_FILE],OPTIONS_FOR_BOOLEAN:Pu(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],an),OPTIONS_FOR_BLOB:Pu(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],an),OPTIONS_FOR_NUMBER:Pu(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],an),OPTIONS_FOR_LOOKUP:Pu(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],an),OPTIONS_FOR_ENUM:Pu(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],an),OPTIONS_FOR_ID:[an.EQUALS,an.NOT_EQUALS,an.IN_FILE,an.NOT_IN_FILE],OPTIONS_FOR_COUNT:[an.EQUALS,an.NOT_EQUALS,an.LT,an.LTE,an.GT,an.GTE,an.IN_RANGE],OPTIONS_FOR_COMPLEX:[an.COUNT_EQUALS,an.COUNT_NOT_EQUALS,an.COUNT_LT,an.COUNT_LTE,an.COUNT_GT,an.COUNT_GTE,an.COUNT_RANGE,an.EXISTS,an.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[an.EQUALS,an.NOT_EQUALS,an.EXISTS,an.MISSING_VALUE]},Su=e=>{const{type:t,singleValue:r=!1}=e,n=(e=>{switch(e){case lt.TYPE_TYPEAHEAD:case lt.TYPE_STRING:case lt.TYPE_PASSWORD:case lt.TYPE_TEXT:case lt.TYPE_CIK_ID:case lt.TYPE_URL:case lt.TYPE_BLOG_URL:case lt.TYPE_IMAGE_URL:case lt.TYPE_EMAIL:return Ru.OPTIONS_FOR_STRING;case lt.TYPE_LOOKUP:case lt.TYPE_DEPENDENT_LOOKUP:return Ru.OPTIONS_FOR_LOOKUP;case lt.TYPE_ENUM:return Ru.OPTIONS_FOR_ENUM;case lt.TYPE_DATE:case lt.TYPE_ACTIVENESS_DATE:case lt.TYPE_TIMESTAMP:case lt.TYPE_LOCAL_DATE:return Ru.OPTIONS_FOR_DATE;case lt.TYPE_BOOLEAN:case lt.TYPE_BOOLEAN_RADIO:return Ru.OPTIONS_FOR_BOOLEAN;case lt.TYPE_BLOB:return Ru.OPTIONS_FOR_BLOB;case lt.TYPE_LONG:case lt.TYPE_INT:case lt.TYPE_FLOAT:case lt.TYPE_DOUBLE:case lt.TYPE_NUMBER:return Ru.OPTIONS_FOR_NUMBER;case lt.TYPE_ENTITY_ID:return Ru.OPTIONS_FOR_ID;case lt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[an.EQUALS];case lt.TYPE_COUNT:return Ru.OPTIONS_FOR_COUNT;case lt.TYPE_NESTED:case lt.TYPE_REFERENCE:case lt.TYPE_IMAGE:return Ru.OPTIONS_FOR_COMPLEX;default:return Ru.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(bu,n):n},wu=e=>[Ce.and,Ce.andNot].includes(e),Iu=e=>[Ce.or,Ce.orNot].includes(e),Uu=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),Iu)),Cu=(Du=[Ce.and],e=>e.slice(0,-1).every((e=>Du.includes(e.operator))));var Du;const ju=e=>e.map(((e,t,r)=>{const n=0===t;return(0,l.assoc)("operator",n?null:r[t-1].operator,e)}),[]),Lu=e=>e.map(((e,t,r)=>{const n=t===r.length-1;return(0,l.assoc)("operator",n?null:r[t+1].operator,e)}),[]),ku=e=>`(${e})`,Fu=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},Mu=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=[Ce.or,Ce.orNot],n=t?[Ce.and,Ce.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)&&Fu(e.slice(1,-1));return!i&&!a||o?e:ku(e)},xu="and",$u=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)(xu,n,e),o=(e=>[Ce.andNot,Ce.orNot].includes(e))(a)?Mu(r):r;return i?o:`${t} ${a} ${o}`}),"")}},Vu=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),Gu=e=>Array.isArray(e)?e.map(Gu).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),Wu=(0,l.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),Bu=e=>`'${e}'`,Yu=e=>`"${e}"`,qu=e=>(0,l.pipe)((0,l.map)(e),(0,l.join)(" or ")),Hu=(0,l.pipe)(Gu,Wu),Qu=(0,l.pipe)(Hu,Bu),Ku=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.allPass)([(0,l.always)(fu(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[l.T,l.identity]])(t))),Ju=(e,t)=>bu(t)?{type:lt.TYPE_INT}:Ou(t)?{type:lt.TYPE_FILE}:gu(t)&&!_u(t)&&gr(e.type)?{type:lt.TYPE_LOCAL_DATE}:e,Xu=Object.values(fn),zu=e=>!Object.values(fn).includes(e),Zu=e=>Xu.includes(e),ec=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Tn;return be().text(t[e])},tc=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.values(dn),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Tn;return e.map((e=>({value:e,get label(){return ec(e,t)}})))},rc=e=>{const t=f()().startOf("minute");switch(e){case dn.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case dn.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case dn.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case dn.LAST_6MONTHS:return[f()(t).subtract(6,"months").valueOf(),t.valueOf()];case dn.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()];case yn.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()];default:return e}},nc=e=>{let[t,r]=e;return[f()(t).valueOf(),f()(r).endOf("date").valueOf()]},ic=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rc;return(0,l.is)(String,e)?t(e):nc(e)};let ac;!function(e){e.CurrentUser="currentUser"}(ac||(ac={}));const oc={},sc=(e,t)=>{oc[e]=t},lc=e=>oc[e];function uc(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}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 pc=e=>e.split("{CurrentUser}").join(lc(ac.CurrentUser)||""),dc=(0,l.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),yc=(0,l.curry)(((e,t,r)=>{const n=r.map(fu(e)||t.endsWith(".count")?Hu:Qu).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),fc=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},Tc=e=>{let{filter:t,fieldName:r,values:n}=e;const i=Eu(t);return(0,l.pipe)(fc(i),(0,l.map)(yc(t,r)),dc(" or "))(n)},Ec=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(Qu).join(",")})`},mc=e=>`*${e}*`,hc=e=>`URL:${e}`,bc=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,Oc=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===an.IN_FILE?r:`not ${r}`},vc=(e,t)=>[R(e,t),S(e,t)],gc=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!_c(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case an.ON:return uc({},e,n?{filter:an.EQUALS}:{filter:an.IN_RANGE,values:[vc(i,n)]});case an.BEFORE:return uc({},e,{filter:an.LTE,values:[[S(i,n)]]});case an.AFTER:return uc({},e,{filter:an.GTE,values:[[R(i,n)]]});case an.WITHIN:return uc({},e,{filter:an.IN_RANGE,values:[rc(i)]})}}return e}),Tc),_c=(0,l.propSatisfies)(gr,"type"),Ac=[[(0,l.prop)("rawFilter"),(0,l.pipe)((0,l.prop)("rawFilter"),pc)],[(0,l.propEq)("filter",an.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(Tc({filter:an.EQUALS,fieldName:t,values:[r]}))),new $u).build())),dc(" or "))(r)}),pc)],[(0,l.propEq)("filter",an.CONTAINS),(0,l.pipe)((e=>{let{filter:t,fieldName:r,values:n}=e;return Tc({fieldName:r,filter:t,values:n.map((0,l.pipe)(Gu,mc))})}),pc)],[(0,l.propEq)("filter",an.EQUALS),(0,l.pipe)((e=>{const{fieldName:t,values:r}=e;return"type"===t?Tc(uc({},e,{values:(0,l.flatten)(r)})):bc(r)?Ec(uc({},e,{filter:"listEquals"})):Tc(e)}),pc)],[(0,l.propEq)("filter",an.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=Eu(t);return(0,l.pipe)(fc(i),(0,l.map)(yc(t,r)),dc(" and "))(n)})(uc({},e,{values:(0,l.flatten)(e.values)})):_c(e)?(e=>{const{values:t}=e,r=!_c(e),[n]=t;return(new $u).addClause(Tc(uc({},e,{filter:an.LT,values:[R(n,r)]}))).addClause(Tc(uc({},e,{filter:an.GT,values:[S(n,r)]}))).orBuild()})(e):bc(t)?Ec(uc({},e,{filter:"not listEquals"})):Tc(e)}),pc)],[(0,l.propSatisfies)(Ou,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return Tc({fieldName:r,filter:Oc(t,r),values:n.map((0,l.prop)("link")).map(hc)})}],[(0,l.propSatisfies)(bu,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return Tc({fieldName:`${r}.count`,values:n,filter:vu(t)})}],[(0,l.propSatisfies)(gu,"filter"),gc],[(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 yc(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return yc(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,(0,l.pipe)(Tc,pc)]],Nc=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!mu(e)||Rc(e,r))},Pc=(e,t)=>Array.isArray(t)?Rc(e,t):e===an.WITHIN?Zu(t)||Number.isInteger(t):!(0,l.isNil)(t)&&Gu(t).length>0,Rc=(e,t)=>t&&t.length>0&&t.every((t=>Pc(e,t)));function Sc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wc=e=>{let{fieldName:t=""}=e;const r=t.split("."),n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},Ic=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),Uc=(e,t,r)=>"children"===e?Dc(r,[...t][0],!0):r,Cc=(e,t,r)=>"values"===e?[...r,...t]:r,Dc=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)(Uc,t),e);if(!r&&hu(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(Cc,t),e)}return(0,l.append)(t,e)},jc=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=wc(e),r=e=>e.fieldName===t?e:r({fieldName:Ic(e),children:[e]});return r(e)})(t);return Dc(e,r)}),[]),Lc=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")),kc=e=>{let[t]=e;return t.children?kc(t.children):t.operator},Fc=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=kc(t)===Ce.andNot,a=n(t,!1),o=i?`not ${Mu(a)}`:a,s=n(r,!1);return`inSameAttributeValue(${o} ${kc(r)||xu} ${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&&Lc(i)&&!t?r(i):n(i,a)}],...e])(o))),new $u).buildWithOperators(i.map((0,l.prop)("operator")))}return n},Mc=(0,l.pipe)((0,l.propOr)("","filter"),pu),xc=(0,l.map)((0,l.when)(Mc,(e=>{const[t,r]=cu(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){Sc(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),$c=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)(Nc),xc,jc,Fc([...e,...Ac],t))},Vc=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),Gc=[an.ON,an.BEFORE,an.AFTER,an.WITHIN,an.NOT_EQUALS,an.MISSING_VALUE,an.EXISTS],Wc=[an.EQUALS,an.NOT_EQUALS,an.STARTS_WITH,an.MISSING_VALUE,an.HAS_ALL,an.FULL_TEXT,an.EXISTS],Bc=[an.EQUALS,an.NOT_EQUALS,an.LT,an.LTE,an.GT,an.GTE,an.IN_RANGE],Yc=(e,t)=>{const r=er(e);return(e=>{switch(e){case gn.startDate.name:case gn.endDate.name:case An.dueDate.name:case Rn.createdTime.name:case Rn.updatedTime.name:case wn.reltioLoadDate.name:case wn.createDate.name:case wn.updateDate.name:case wn.deleteDate.name:case wn.publishDate.name:return Gc;case Sn.matches.name:case wn.count.name:return Bc;case An.workflow.name:case An.assignee.name:case An.step.name:case Nn.commenter.name:case Rn.createdBy.name:case Rn.updatedBy.name:case wn.sourceSystems.name:case wn.value.name:return Wc;default:return null}})(t)||Su(r)},qc=[an.EQUALS,an.NOT_EQUALS,an.CONTAINS,an.STARTS_WITH,an.MISSING_VALUE,an.HAS_ALL,an.IN_RANGE,an.WITHIN,an.EXISTS,an.ON],Hc=(0,l.pipe)(Yc,(0,l.filter)((0,l.includes)(l.__,qc))),Qc=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(_s);return a&&a[0]&&(r=n.length>0&&a[0].value?Qc(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}}),""),Kc=(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=Qc(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},Jc=/[,\s]*$/,Xc=e=>{const t=be().text(hn);if(!e)return t;const r=e.replace(Jc,"");return""===r.toString().trim()?t:r},zc=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},Zc=(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=zc(e,r.referencedEntityTypeURI);if(n)return Kc({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return Kc({attributes:t||{}},r.dataLabelPattern);return""},ep=e=>{let{uiPath:t,uri:r}=e;return`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},tp=e=>{let{uiPath:t,tag:r,entityUri:n}=e;return`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},rp=(0,l.curry)(((e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"")),np=(0,l.when)((0,l.is)(Object),(0,l.ifElse)((0,l.pipe)((0,l.prop)("value"),(0,l.is)(Object)),Ql,(0,l.prop)("value"))),ip=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),np),ap=(e,t,r)=>{const n=ip(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)($s(e),np)))(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")])})(Jr(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>Ms(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,np))(r)})(e,r)||rn(e,r.type);return rp(t,n)};function op(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){sp(e,t,r[t])}))}return e}function sp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lp="DTSS/",up=(0,l.replace)(new RegExp("^entities/"),""),cp=e=>lp+e.dataTenant+"/"+e.uri,pp=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),dp=e=>!(!e||!e.dataTenant),yp=(0,l.startsWith)(lp),fp=(0,l.pipe)((0,l.ifElse)(yp,(0,l.pipe)((0,l.split)("/"),(0,l.nth)(1)),(0,l.always)(null))),Tp=(0,l.ifElse)(dp,cp,(0,l.prop)("uri")),Ep=e=>e&&e.uri?e.dataTenant?cp(e):up(e.uri):"",mp=(0,l.curry)(((e,t,r)=>(Jr(t,r.type)||{})[e]||"")),hp=mp("label"),bp=mp("typeGraphIcon"),Op=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=Jr(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(_s)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:Zc(e,o,i),uri:a.uri}})).filter(l.identity):[]},vp=(0,l.pipe)(Op,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),gp=(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=gp(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):gp(e.slice(1),r)}})),_p=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,Ap=e=>(0,l.propOr)([],"matchRules",e),Np=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?op({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},Pp=(e,t,r)=>t&&r?r.aEntity:e,Rp=(0,l.evolve)({attributes:Fl(!0)}),Sp=(0,l.pipe)(Rp,(0,l.props)(["attributes","startDate","endDate","roles","tags"]),(0,l.all)(E)),wp=e=>(0,l.assoc)("dataTenant",e);function Ip(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){Up(e,t,r[t])}))}return e}function Up(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cp=e=>{let{parentUri:t,relation:r,entityUri:n}=e;return{type:Be.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},Dp=e=>{let{relationUri:t}=e;return{type:Be.DELETE_RELATION,parameters:{relationUri:t}}},jp=e=>{let{parentUri:t,entityUri:r,relationType:n,relationDirection:i}=e;return{type:Be.IGNORE_RELATION,parameters:{parentUri:t,entityUri:r,relationType:n,relationDirection:i}}},Lp=e=>{let{oldRelation:t,newRelation:r}=e;return{type:Be.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},kp=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:Be.REPOINT_RELATION,parameters:{entityUri:t,newEntityUri:r,relation:n,isReversed:i}}},Fp=(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))),Mp=e=>e.type===Be.DELETE_RELATION,xp=e=>e.type===Be.CREATE_RELATION,$p=e=>e.type===Be.REPOINT_RELATION,Vp=e=>e.type===Be.UPDATE_RELATION,Gp=e=>e.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve()),Wp=e=>{let{type:t,parameters:r,dcrProcessor:n}=e;const{enhanceUriWithDCR:i,updateDCRUriFromResponse:a}=n,o=e=>(a(e),e);switch(t){case Be.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:a,attributes:s,startDate:l,endDate:u}=t;return wf({startEntityUri:e,endEntityUri:n,relationType:a,attributes:s,startDate:l,endDate:u,uriPreprocessor:i}).then(o)};case Be.DELETE_RELATION:return()=>{const{relationUri:e}=r;return Sf(e,i).then(o)};case Be.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return Df(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(o)};case Be.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return If({oldRelation:e,newRelation:t,uriPreprocessor:i}).then(o)};case Be.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:i,isReversed:a}=r,{uri:o}=i,s=[Dp({relationUri:o}),Cp({parentUri:a?e:t,relation:i,entityUri:a?t:e})];return(0,l.pipe)((0,l.map)(Yp(n)),(0,l.map)(Wp),Gp)(s)}}},Bp=e=>t=>()=>e().then(t),Yp=e=>t=>Ip({dcrProcessor:e},t),qp=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=$r({alwaysCreateDCR:e,dcrUri:t});return{commandExecutor:(0,l.pipe)(l.flatten,(0,l.map)(Yp(r)),(0,l.map)(Wp),(0,l.map)(Bp(r.getDcrUriAwait)),Gp,(0,l.otherwise)((e=>({errorMessage:e})))),dcrProcessor:r}},Hp=e=>t=>(0,l.map)((t=>Ip({},t,{parameters:(0,l.evolve)({parentUri:Mm(e),entityUri:Mm(e),newEntityUri:Mm(e)},t.parameters)})),t),Qp=e=>{let{condition:t,updater:r}=e;return e=>t(e)?r(e):e},Kp=(e,t)=>{const r=e.filter(xp).find(Fp(t));let n=null,i=null,a=null;const o=e.filter(((o,s)=>Vp(o)&&Fp(t,o)?(s>e.indexOf(r)&&(n=o.parameters.newRelation),!1):!$p(o)||!Fp(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(Qp({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},Jp=(e,t)=>{const r=e.filter($p).filter(Fp(t));let n=null;const i=e.filter(((i,a)=>r.includes(i)?(0,l.last)(r)===i:!Vp(i)||!Fp(t,i)||(a>e.indexOf((0,l.last)(r))&&(n=i.parameters.newRelation),!1)));return n?i.map(Qp({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({relation:(0,l.always)(n)})})(e)})):i},Xp=(e,t)=>{const r=e.filter(Mp).filter(Fp(t));return e.filter((e=>r.includes(e)?(0,l.last)(r)===e:!Fp(t,e)))},zp=(e,t)=>{const r=e.filter(Vp).filter(Fp(t));let n=null;const i=e.filter((e=>!r.includes(e)||!Vp(e)||(n=n||e.parameters.oldRelation,(0,l.last)(r)===e)));return n?i.map(Qp({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({oldRelation:(0,l.always)(n)})})(e)})):i},Zp=e=>{const t=e.filter(Mp).map((e=>{let{parameters:{relationUri:t}}=e;return t}));return(0,l.uniq)(t).reduce(Xp,e)},ed=e=>{const t=e.filter(xp).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(Kp,e)},td=e=>{const t=e.filter($p).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(Jp,e)},rd=e=>{const t=e.filter(Vp).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)(zp,e))(t)},nd=e=>(0,l.pipe)(Zp,ed,td,rd)(e);function id(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){ad(e,t,r[t])}))}return e}function ad(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const od=e=>id({},(0,l.path)(hd(),e),{startDate:(0,l.path)(gd(),e),endDate:(0,l.path)(_d(),e)}),sd=(e,t)=>(0,l.pipe)((0,l.path)(vd()),Mm(t))(e),ld=(e,t,r,n)=>{let{removedUris:i=[],addedConnections:a=[],editedConnections:o=[],ignoredRelationData:s=[]}=t;return[...a.map((e=>{const t=sd(e,r),i=(0,l.path)(bd(),e)===Ye.IN,a=e.parentEntityUri||n;return Cp({parentUri:i?t:a,relation:od(e),entityUri:i?a:t})})),...o.map((t=>{const i=sd(t,r),a=(0,l.path)(bd(),t)===Ye.IN,o=i!==(0,l.pipe)((0,l.path)(hd()),a?Ad:Nd)(t),s=Sd(e,(0,l.path)(Ed(),t)),u=t.parentEntityUri||n,c=Mm(r,i);return o?kp({entityUri:a?u:c,newEntityUri:a?c:u,relation:(0,l.path)(hd(),t),isReversed:!1}):Lp({oldRelation:(0,l.path)(hd(),s),newRelation:od(t)})})),...i.map((e=>Dp({relationUri:e}))),...s.map((e=>jp({parentUri:n,entityUri:e.entityUri,relationType:e.relationType,relationDirection:e.relationDirection})))]},ud=e=>(e||[]).reduce(((e,t)=>{let{entity:r}=t;const n=r.dataTenant;return id({},e,{[r.entityUri]:{uri:r.entityUri,label:r.entityLabel,type:r.entityType,dataTenant:n}})}),{}),cd=(0,l.has)("dataTenant"),pd=(0,l.ifElse)(cd,(e=>{let{relationUri:t,dataTenant:r}=e;return`DTSS/${r}/${t}`}),(0,l.prop)("relationUri")),dd=(e,t)=>(0,l.pipe)(Pi,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(tl),Ba)(e,t),yd=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)}},fd=(e,t,r)=>{const n=Kc(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)},Td="relation",Ed=(0,l.always)([Td,"relationUri"]),md=(0,l.always)([Td,"relationType"]),hd=(0,l.always)([Td,"object"]),bd=(0,l.always)([Td,"direction"]),Od=(0,l.always)([Td,"object","attributes"]),vd=(0,l.always)(["entity","entityUri"]),gd=(0,l.always)([Td,"startDate"]),_d=(0,l.always)([Td,"endDate"]),Ad=(0,l.path)(["startObject","objectURI"]),Nd=(0,l.path)(["endObject","objectURI"]),Pd=(0,l.path)(["startObject","objectTypeURI"]),Rd=(0,l.path)(["endObject","objectTypeURI"]),Sd=(e,t)=>{for(const r of e){if((0,l.pipe)((0,l.path)(Ed()),(0,l.equals)(t))(r))return r;if(r.connections){const e=Sd(r.connections,t);if(e)return e}}},wd=(0,l.pipe)(Sd,(0,l.path)(hd())),Id=(0,l.allPass)([(0,l.pipe)((0,l.path)(vd()),(0,l.complement)(E)),(0,l.pipe)((0,l.path)(md()),(0,l.complement)(E))]),Ud=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:wt()},entity:{},isNew:!0},{relationType:o,direction:s}=a.relation,{inRelations:u,outRelations:c}=jd({content:i?t.contentSecondLevel:t.content,direction:s,relationType:o,mode:r,metadata:n}),p=Cd(u,c);return(0,l.pipe)((0,l.evolve)({relation:p?yd(p):l.identity}),(0,l.defaultTo)({}),(0,l.when)((0,l.always)(i),(0,l.assoc)("parentEntityUri",i)))(a)},Cd=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:bn.IN}:{type:t[0],direction:bn.OUT}:null},Dd=e=>e.uri||e,jd=e=>{let{content:t,direction:r,relationType:n,mode:i,metadata:a}=e;const o={},s=e=>t=>{const a=t&&xi(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===bn.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"],Jr(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],Jr(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(Dd,Pi(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(bn.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(bn.OUT)),(0,l.map)(u))},t)||{}},Ld=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}=Ui({reversedContextLabels:!0}),a=(0,l.curry)(((e,t,r,n)=>{const[i,a]=Si(e,n.uri);return n&&(!t||zr(e,i,t))&&(!r||zr(e,a,r))})),o=t=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],Jr(e,t.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],Jr(e,t.endObject.objectTypeURI)))(t),s=(e.relationTypes||[]).filter((0,l.both)(ls,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)}},kd=(0,l.curry)(((e,t,r,n,i)=>{const a=zr(n,l.__,t.type),o=e?Rd:Pd,s=zr(n,l.__,r.type),u=e?Pd:Rd;return(0,l.both)((0,l.pipe)(o,a),(0,l.pipe)(u,s))(i)})),Fd=(e,t,r)=>{const n=e?Rd:Pd,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(zr(t,l.__,r))})),(0,l.reject)((0,l.prop)("abstract")),(0,l.map)((0,l.prop)("uri")))(t.entityTypes||[])};function Md(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xd=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}},$d=e=>!e.deactivated,Vd=e=>{let{attributeTypeUri:t,uri:r,parentUri:n}=e;return`${t}-${r}-${n}`},Gd=e=>Vd(e)+e.message,Wd=(0,l.unless)(l.isNil,(0,l.prop)("message")),Bd=(0,l.unless)(l.isNil,(0,l.prop)("type")),Yd=(0,l.curry)(((e,t)=>Lt(t.parentUri,e))),qd=(0,l.curry)(((e,t)=>t.parentUri===e)),Hd=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pipe)((0,l.prop)("uri"),Lt(t.attributeTypeUri)),l.T],[(0,l.both)((0,l.propEq)("type",lt.TYPE_REFERENCE),(0,l.pipe)(yt,(0,l.any)(Lt(t.attributeTypeUri)))),l.T],[l.T,l.F]])(e))),Qd=(0,l.curry)(((e,t)=>t.attributeTypeUri===e)),Kd=(0,l.curry)(((e,t,r)=>e===r.parentUri&&t!==r.attributeTypeUri)),Jd=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,l.filter)((0,l.allPass)([iy,$d,Yd(e),Hd(t),(0,l.complement)(Kd(e,t.uri))]))(r)},Xd=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=(0,l.find)((0,l.allPass)([iy,$d,qd(e),Qd(t.uri),(0,l.complement)((0,l.prop)("uri")),(0,l.complement)((0,l.propEq)("type",ge.missed))]))(r);return n&&n.message||""},zd=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===ge.missed))},Zd=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([$d,(0,l.propEq)("type",ge.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(Ed(),e))]))(t)},ey=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([$d,(0,l.propEq)("type",ge.missedRefEntity),(0,l.propEq)("parentUri",e.uri)]))(t)},ty=function(e){let{uri:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.any)((0,l.allPass)([$d,Yd(t)]))(r)},ry=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([$d,(0,l.propEq)("type",ge.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(["relation","uri"],e))]))(t)},ny=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?Km(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 Re.attributeValue:{const e=a;if(sr(a))return Kc(o,e.dataLabelPattern);if(lr(a)){const t=o,i=Ds(t),a=pt(e),s=Jr(n,a);return Rt(i)?Kc(r[i],s.dataLabelPattern):t.label}return""}case Re.tempEntity:return Kc(o,a.dataLabelPattern);case Re.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=Jr(n,null==e?void 0:e.entityType);return`${Xc(i&&Rt(i)?Kc(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||Ri(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){Md(e,t,r[t])}))}return e}({},e,{label:Xc(t)})}))},iy=e=>!e.severity||e.severity===Ae.ERROR,ay=(0,l.curry)(((e,t)=>{let r=t.value;switch(e.type){case lt.TYPE_NESTED:return Object.keys(r).some((t=>{const n=e.attributes.find((0,l.propEq)("name",t));return r[t].some(ay(n))}));case lt.TYPE_REFERENCE:return!!Ps(t);case lt.TYPE_BOOLEAN:return!0===r||!1===r||"true"===r||"false"===r;default:return"string"==typeof r&&(r=r.trim()),null!=r&&""!==r}})),oy=(e,t)=>e.every((0,l.complement)(ay(t))),sy=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const n=ko(e,t.type||t.relationType,!0).filter(r);return n.reduce(((r,n)=>{const i=Ms(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!_s(e.parent))))).forEach((e=>{oy(e.attrValues,n)&&r.push(xd({type:ge.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:be().text("Attribute is required"),source:_e.local}))})),r}),[])},ly=(0,l.curry)(((e,t,r)=>Ms(e,t,r,!1))),uy=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),Jr(e),(0,l.prop)("attributes"),(0,l.defaultTo)([]),(0,l.reject)(ar),(0,l.filter)(lr),(0,l.map)((0,l.prop)("uri")),(0,l.chain)(ly(e,t)));return(0,l.pipe)(r,(0,l.reject)(Ds),(0,l.map)((e=>{let{uri:r}=e;return xd({type:ge.missedRefEntity,uri:"",attributeTypeUri:Vt(r,t.type),parentUri:r,message:be().text("Entity is required"),source:_e.local})})))(t)},cy=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,l.has)("refEntity")).filter((0,l.pipe)(Ds,Rt)).flatMap((n=>{const i=Ds(n),a=t[i],o=mr(e,Vt(n.uri,r.type));return py(e,t,o,a)})),py=(e,t,r,n)=>{const i=yt(r),a=i.map((t=>mr(e,t))).filter((0,l.both)(l.identity,(0,l.propEq)("type",lt.TYPE_REFERENCE))).flatMap(Tt).concat(i);return dy(e,t,n,(e=>a.some(Lt(e.uri))))},dy=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity;const i=sy(e,r,n),a=uy(e,r),o=cy(e,t,r);return[...i,...a,...o]},yy=(e,t)=>{const r=(0,l.path)(hd(),t)||{};return sy(e,r)},fy=(e,t,r)=>{t=t||{};const n=(0,l.pipe)((0,l.path)(vd()),(0,l.ifElse)(Rt,(e=>t[e]),(0,l.always)(null)))(r),i=yy(e,r),a=(e=>(0,l.path)(vd(),e)?[]:[xd({type:ge.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(md(),e),parentUri:(0,l.path)(Ed(),e),message:be().text("Entity is required"),source:_e.local})])(r),o=((e,t,r)=>r?dy(e,t,r):[])(e,t,n);return[...i,...a,...o]},Ty=e=>(0,l.path)(["entity","uri"],e)?[]:[xd({type:ge.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(["relation","type"],e),parentUri:(0,l.path)(["relation","uri"],e),message:be().text("Entity is required"),source:_e.local})],Ey=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=sy(e,r),i=Ty(t);return[...n,...i]};function my(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hy=(e,t)=>{var r,n;const i=Jr(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||so(e)},by=e=>(0,l.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),Oy=e=>{const t=r=>(0,l.ifElse)(Array.isArray,(0,l.map)(t),(0,l.pipe)(by(e),(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(0,l.map)(t))})))(r);return t},vy=(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)(js,Rt,l.not)]),(e=>{const t=(0,l.pipe)(js,Ft)(e);return Oy((e=>e.replace(t,t+vt)))(e)})),(0,l.when)((0,l.pipe)(Ds,Rt),(t=>{const r=Ds(t),n=e[r],i=n&&_y(n,e);return null!=i&&i.attributes?(0,l.evolve)({value:e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){my(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),gy=(e,t,r)=>Ah(vh((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),Rh((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e).map((e=>(0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.pipe)((0,l.filter)((e=>!e.refRelation||e.refEntity)),(0,l.map)(vy(r,e.type)),(0,l.map)(Oy(Ht))))})(e))).concat(Lm(e,t)),_y=(e,t)=>(0,l.evolve)({attributes:Ll({valueTransformer:(0,l.pipe)(Fs,vy(t),by(Ht)),deleteEmptyComplex:!0}),uri:Ht})(e);function Ay(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){Ny(e,t,r[t])}))}return e}function Ny(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Py=(0,l.unless)(l.isNil,(e=>e.replace(new RegExp(Ot,"g"),"uri$$$$").replace(new RegExp(vt,"g"),""))),Ry=e=>(0,l.pipe)((0,l.evolve)({objectUri:Py,objectParentUri:Py}),(e=>{return Ay({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?ge.missed:ge.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&&qt(e.objectUri),uri:e.objectUri,source:_e.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),Sy=(e,t)=>(0,l.map)((0,l.pipe)(Ry,(e=>{var r,n,i,a;const{metadata:o}=t,{uri:s,parentUri:u}=e,c=ny(t,s),p=null!=c&&c.length?c.slice(0,-1):ny(t,u),d=((e,t,r)=>{let{uri:n,attributeTypeUri:i}=r,a=i&&mr(e,i);if(!a&&n&&t&&t.length){const e=(0,l.last)(t);e.type===Re.attributeValue&&(a=e.valueType)}return a})(o,c,e);return Ay({},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&&Yt(i)){const n=(0,l.last)(a),i=n.valueType;if(lr(i)&&Et(i).includes(o)){const i=Ds(n.value),o=i&&Rt(i)?t[i]:null;return o?Ay({},e,{parentUri:o.uri,path:a.concat({type:Re.tempEntity,value:o,valueType:Jr(r,o.type),label:""})}):e}}return e}})(t)))(e),wy=e=>{if(e.type===Pe.AGO||e.type===Pe.WITHIN){const[t,r]=e.period;return"Number"===(0,l.type)(t)&&"String"===(0,l.type)(r)&&t>0}if(e.type===Pe.BETWEEN){const[t,r]=e.period;return t instanceof Date&&r instanceof Date}},Iy=e=>`equals(user, '${Wu(e)}')`,Uy=e=>`equals(items.delta.sources, '${e.abbreviation}')`,Cy=e=>`equals(items.objectType, '${e.uri}')`,Dy=e=>{const{period:t,type:r}=e;if(!wy(e))return"";switch(r){case Pe.WITHIN:return`gte(timestamp, ${X(t)})`;case Pe.AGO:return`lte(timestamp, ${X(t)})`;case Pe.BETWEEN:{const[e,r]=t;return`range(timestamp, ${e.valueOf()}, ${f()(r).endOf("date").valueOf()})`}default:return""}},jy=e=>[`equals(items.objectUri, '${e}')`,`equals(items.startObjectUri, '${e}')`,`equals(items.endObjectUri, '${e}')`].join(" or "),Ly=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),ky=e=>{let{query:t,body:r}=e;return t=Ly(t),tu(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},Fy=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)($c(),Vc(t.globalFilter))(n),activeness:t.activityFilter||mn.ACTIVE_ONLY};return t.searchOptions&&(i.options=t.searchOptions),`/entities/_total${Fr(i)}`},My=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=Fy(e,t,r);return tu(n)},xy=e=>tu(`/entities/_total?${e}`),$y=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(0,l.pipe)((0,l.filter)(us),(0,l.map)((0,l.prop)("uri")))(e),i={filter:an.EQUALS,fieldName:"type",values:n},a=r.isRawFilter?{rawFilter:t}:{filter:"containsWordStartingWith",fieldName:"attributes",values:[t]},o=(0,l.pipe)($c(),Vc(r.globalFilter))([i,a]),s=Fr({filter:o,select:"uri,label,type,roles,secondaryLabel,defaultProfilePicValue",scoreEnabled:!0,activeness:r.activityFilter||mn.ACTIVE_ONLY,max:r.max||4});return tu("/entities/_typeAheadSearch"+s,{method:"GET"})},Vy=(0,l.pipe)((0,l.reject)(l.isNil),kr),Gy=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)($c(),Vc(i))(r),p=Vy({filter:c||null,activeness:a||"active",options:o||null}),d=[{fieldName:t,pageSize:s||20,pageNo:u||1,orderType:n.orderType||"reversedCount"}];return ky({query:p,body:d})},Wy=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return Gy({fieldName:t,searchParams:i,options:n})};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="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",qy=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)($c(),Vc(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||Yy,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null};return t.searchOptions&&(i.options=t.searchOptions),`/entities${Fr(i)}`},Hy=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=qy(e,t,r);return tu(n)},Qy=e=>ef(e,{select:"secondaryLabel"}),Ky=(e,t)=>{const{select:r=Yy,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),tu("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},Jy=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),Rt)),Xy=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=Jy(n).length,T={[r]:{max:a,offset:(0,l.isNil)(i)?y-f:i}},E=pr(r),m={attributesPaging:T,defaultMaxValues:a,options:d,select:"crosswalks,"+E},h=[...c,{filter:"containsWordStartingWith",fieldName:E,values:[u]}],b=(0,l.pipe)($c(),Vc(d.globalFilter))(h);return b&&(m.filter=b),p&&(m.sort=p.field,m.order=p.order),tu(`${s}/api/${o}/${t}/_object`,{method:"POST",body:JSON.stringify(m)})},zy=e=>`entities?filter=equals(uri,'${e}')&offset=0`,Zy={options:"sendHidden,addRefAttrUriToCrosswalk"},ef=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zy;return tu(`/${e}${Fr(t)}`)},tf=(e,t)=>ef(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){By(e,t,r[t])}))}return e}({},Zy,{explicitSurvivorshipGroup:t})),rf=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 tu(n,r)},nf=e=>tu(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),af=(e,t,r)=>{const n={method:"POST",body:JSON.stringify(t)};return tu(`/${e}/_clone${Fr({executeLCA:!1,valuesToCopy:r})}`,n)},of=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return tu(`/entities/_events/_total${kr({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},sf=(e,t)=>tu(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",body:t}),lf=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return tu(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",body:JSON.stringify(r)})},uf=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 tu(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),kr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},cf=e=>{const t=new FormData;return t.append("file",e),tu("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=ye(e,be().text("Can't upload file"));return Promise.reject(t)}))},pf=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 tu(`/personal/findSavedSearches${kr({countResults:s,findPublic:l})}`,{method:"POST",body:JSON.stringify({containsWordStartingWith:t,sortBy:r,sortOrder:n,favoriteOnly:i,offset:a,max:o,includes:u,startsWith:c}),headers:{"Content-Type":"application/json"}})},df=e=>tu(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),yf=e=>tu("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),ff=e=>{const{uri:t}=e,r=(0,l.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return tu(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},Tf=e=>{let{uri:t}=e;return tu(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},Ef=(e,t)=>(0,l.pipe)((0,l.evolve)({isPublic:(0,l.always)(t)}),ff)(e),mf=(e,t)=>(0,l.pipe)((0,l.evolve)({isFavorite:(0,l.always)(t)}),ff)(e);function hf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bf=["max","offset","filter"],Of=(0,l.curry)(((e,t)=>t.nextEntry?(0,l.evolve)({nextEntry:Of(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){hf(e,t,r[t])}))}return e}({},t,(0,l.pick)(bf,e)))),vf=e=>{if(1===e.length&&((0,l.pathEq)([0,"activeness","entity"],Ue.ALL,e)||(0,l.pathEq)([0,"activeness","relation"],Ue.ALL,e)))return!1},gf=(0,l.omit)(["activeness"]),_f=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=vf(t),{searchByOv:i}=r;t=(0,l.map)((0,l.pipe)((0,l.when)((0,l.prop)("nextEntry"),(e=>(0,l.pipe)(Of(e),(0,l.omit)(bf))(e))),gf,(0,l.omit)(["labels"])))(t);const a={limitCreditsConsumption:!0,activeness_enabled:n,options:i?"searchByOv":void 0},o=`/${e}/_connections${Fr(a)}`,s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)};return{url:o,options:s}},Af=(0,l.map)((e=>{let t=e;for(;t&&t.nextEntry;)t=t.nextEntry;return t})),Nf=(0,l.reject)(l.isNil),Pf=(0,l.unless)((0,l.startsWith)("/"),(0,l.concat)("/")),Rf=e=>tu(Pf(e),{method:"GET",headers:{"Content-Type":"application/json"}}),Sf=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r=(0,l.pipe)(t,Pf);return tu(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},wf=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?Fl()(i):null,startDate:a,endDate:o},c=(0,l.pipe)(Nf,ie,JSON.stringify);return tu(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(u)})},If=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"),Pf,n),o=vh(i(t),i(r)).concat(_h(t,r));return tu(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},Uf=(e,t,r)=>{const{url:n,options:i}=_f(e,t,r);return tu(n,i).then(Af)},Cf=(e,t)=>tu(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),Df=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===bn.IN?a.inRelations=[n]:a.outRelations=[n],tu(`/${e}/_ignoreSuggestedRelationship`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},jf=e=>{let{servicesPath:t="",environment:r,tenant:n,application:i}=e;return tu(`${t}/recentSearches${Fr({environment:r,tenant:n})}`,{method:"GET",application:i,headers:{"Content-Type":"application/json"}})},Lf=e=>tu("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),kf=e=>{let{environment:t,tenant:r,createdDate:n}=e;return tu(`/recentSearches${Fr({environment:t,tenant:r,createdDate:n})}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};function Ff(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){Mf(e,t,r[t])}))}return e}function Mf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xf={select:"label,secondaryLabel,name,type,startDate,endDate"},$f=(0,l.reject)(l.isNil),Vf=(0,l.pipe)($f,kr),Gf=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i}=e;const a=Ff({},xf,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{},{limitCreditsConsumption:!0});return tu(`/${t}/_tree${Vf(a)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Wf=e=>{let{uri:t,graphUri:r}=e;const n=Ff({},xf,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return tu(`/${t}/_parents${Vf(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Bf=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1,limitCreditsConsumption:o,max:s}=e;const l=Ff({},xf,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},o?{limitCreditsConsumption:o}:{},s?{max:s}:{},{filterLastLevel:i,deep:a});return tu(`/${t}/_hops${Vf(l)}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function Yf(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 qf=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},Hf="/activities",Qf=e=>{let{label:t,description:r}=e;return tu(Hf,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:qf()}})};var Kf;!function(e){e.userSearch="USER_SEARCH",e.profileView="USER_PROFILE_VIEW"}(Kf||(Kf={}));const Jf=e=>{const t=Fr(e);return tu(Hf+t,{method:"GET"})},Xf=e=>tu(`/activities/_total${Fr(e)}`,{method:"GET"}),zf=e=>{const{entityUri:t}=e,r=Yf(e,["entityUri"]);return tu(`/${t}/_activities${Fr(r)}`,{method:"GET"})},Zf=e=>{const{entityUri:t}=e,r=Yf(e,["entityUri"]);return tu(`/${t}/_activities/_total${Fr(r)}`,{method:"GET"})};function eT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tT(e,t,r[t])}))}return e}function tT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rT=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},nT=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return tu(rT({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},iT=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=rT({url:r,workflowPath:t,tenant:n})),tu(s,{method:i||"GET",body:JSON.stringify(a),headers:eT({"Content-Type":"application/json"},null!=o?o:{})})},aT=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=rT({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,l.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return tu(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)},oT=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=rT({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?eT({},l,{comment:o}):l;return tu(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},sT=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const u=rT({url:`/tasks${s?Fr(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(eT({objectURIs:[i]},(0,l.reject)(E,a)))};return tu(u,eT({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},lT=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i,max:a,offset:o}=e;return tu(rT({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})})},uT=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i,max:a,offset:o}=e;return tu(rT({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)(eT({max:a,offset:o},i))})},cT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return tu(rT({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},pT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return tu(rT({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},dT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return pT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},yT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return tu(rT({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},fT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return pT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},TT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return pT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},ET=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return pT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},mT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a}=e;return tu(rT({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a})})},hT=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return tu(rT({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},bT=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 tu(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),kr)(d)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},OT=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 tu(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),kr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},vT=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return tu("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},gT=(e,t,r)=>Promise.all(t.map((async t=>await tu(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})))),_T=async(e,t)=>await gT(e,t,"NOT"),AT=async(e,t)=>await gT(e,t,"MATCH"),NT=async(e,t)=>await Promise.all(t.map((async t=>await tu(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}}))));function PT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){RT(e,t,r[t])}))}return e}function RT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ST(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 wT=3e4,IT=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return tu(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},UT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return JT({url:`entities/_connections/_hasNonImported?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}})},CT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return JT({url:`entities/_connections/_import?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}})},DT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return tu(`${t}entities/_merge?dataEntityUri=${i}&customerEntityUri=${a}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},jT=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 DT({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},LT=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{uri:a}=n,[o,s]=(0,l.partition)(dp,i);return Promise.all([s.length?vT(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return DT({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},kT=(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=ST(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)}),[])),FT=(0,l.pipe)((0,l.find)((0,l.propEq)("index",0)),(0,l.propOr)({},"object"),kT),MT=e=>{let{dtssPath:t,customerTenant:r,entity:n}=e;const{uri:i,dataTenant:a}=n;return tu(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:a,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(FT)},xT=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)},$T=xT((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return tu(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{uri:a,type:o}])}).then(FT)})),VT=xT((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return tu(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),GT=(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)}},WT=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return tu(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},BT=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 WT(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},YT=BT("NOT"),qT=BT("MATCH"),HT=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{uri:o}=i,[s,u]=(0,l.partition)(dp,a);return Promise.all([gT(o,u,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return WT(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},QT=HT("NOT"),KT=HT("MATCH");function JT(e){let{requestProvider:t=tu,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}`,PT({},ST(s,["headers"]),{headers:PT({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const XT=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return JT({url:qy(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},zT=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return JT({url:Fy(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},ZT=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a,options:o}=e;const{searchByOv:s}=o,{options:u}=_f(t,r);return JT({url:`entities/_connections/_getConnections${Fr({dataEntityUri:t,options:s?"searchByOv":void 0})}`,options:u,dataTenant:n,customerTenant:i,dtssPath:a}).then((0,l.pipe)(Af,(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)))}))))},eE=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return JT({url:`${zy(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},tE=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return tu(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},rE=e=>{let{dtssPath:t,tenant:r}=e;return tu(`${t}tenants/customerTenants?id=${r}&useCache=true`,{method:"GET",timeout:wT})},nE=e=>{let{dtssPath:t,customerTenant:r}=e;return tu(`${t}subscriptions?useCache=true`,{method:"GET",headers:{CustomerTenant:r},timeout:wT})},iE=e=>{let{dtssPath:t,tenants:r}=e;return tu(`${t}tenants/dataTenants?id=${r}&useCache=true`,{method:"GET",timeout:wT})},aE=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return JT({url:zy(t),dataTenant:r,customerTenant:n,dtssPath:i})},oE=()=>tu("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET"});function sE(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){lE(e,t,r[t])}))}return e}function lE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const uE=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=sE({},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 tu(`${t}/api/${r}/graph/search${Fr({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},cE=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return tu(`${t}/api/${r}/graph/search/count`,{method:"POST",body:sE({},n,i),headers:{"Content-Type":"application/json"}})},pE=(e,t)=>`${e}/${t}/comments`,dE=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return tu(`${pE(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},yE=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return tu(`${pE(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},fE=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return tu(pE(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},TE=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return tu(`${pE(t,r)}/${n.commentId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},EE=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return tu(`${pE(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},mE=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i}=e;return tu(`${pE(t,r)}/${n}/replies/${i}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},hE=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i,data:a}=e;return tu(`${pE(t,r)}/${n}/replies/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},bE=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return tu(`${pE(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},OE=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=Fr({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return tu(`${pE(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function vE(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){gE(e,t,r[t])}))}return e}function gE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _E=e=>{let{tenant:t,servicesPath:r}=e;return tu(`${r}/users/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})},AE="graphExport",NE=async(e,t,r,n,i)=>{let a;try{const{data:n={}}=await wE({servicesPath:e,tenant:t,environment:r,namespace:AE,options:{method:"GET",headers:{"Content-Type":"application/json"}}});a=n}catch(e){a={}}const o={body:JSON.stringify(vE({},a,{[n]:i})),headers:{"Content-Type":"application/json"}};let s;try{s=await wE({servicesPath:e,tenant:t,environment:r,namespace:AE,options:vE({method:"PUT"},o)})}catch(e){s=null}return s||(s=await wE({servicesPath:e,tenant:t,environment:r,namespace:AE,options:vE({method:"POST"},o)})),s},PE=e=>{let{servicesPath:t,key:r}=e;return tu(`${t}/settings${Fr({key:r})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},RE=e=>{let{servicesPath:t}=e;return tu(`${t}/version/collect`,{method:"POST",headers:{"Content-Type":"application/json"}})},SE=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return tu(`${n}/plugins${Fr({tenant:t,user:r})}`,{method:"GET"})},wE=e=>{let{tenant:t,environment:r,servicesPath:n,options:i,namespace:a,projection:o}=e;return tu(`${n}/configService${Fr({tenant:t,environment:r,namespace:a,projection:o})}`,i)},IE=e=>{let{tenant:t,environment:r,servicesPath:n}=e;return wE({tenant:t,environment:r,servicesPath:n,options:{method:"GET"}})},UE=e=>{let{servicesPath:t,stateHash:r}=e;return tu(`${t}/searchLink?key=${r}`,{method:"GET"})},CE=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),tu(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},DE=e=>tu(`/${e}?showObjectsInfo=true`,{method:"GET"}),jE=e=>{let{exportPath:t,tenant:r,options:n}=e;return tu(`${t}/${r}/activities${Fr(n)}`,{method:"POST"})};function LE(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){kE(e,t,r[t])}))}return e}function kE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const FE=e=>{const{entityUri:t}=e;return tu(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},ME=e=>{let{entityUri:t,crosswalk:r}=e;return tu(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},xE=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return tu("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[LE({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),LE({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},$E=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return tu(`/${r}/_${n}${Fr({contributorURI:t})}`,{method:"POST"})},VE=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return tu(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},GE=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return tu(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},WE=e=>{let{entityUri:t,crosswalkId:r}=e;return tu(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})};function BE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const YE=e=>{let{entityTypeUri:t}=e;return tu(`/dataQuality/fillRates${kr({entityType:Ft(t)})}`,{method:"GET"})},qE=e=>{let{attributes:t=[],metrics:r=[]}=e;const n=r.length,i=t.length*n;return i>10?10:i},HE=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){BE(e,t,r[t])}))}return e}({},n===We.ATTRIBUTE_TYPE?{attributes:r}:{},i?{metrics:i}:{}),o=n===We.ATTRIBUTE_TYPE?kr({numberOfThreads:qE({attributes:r,metrics:i})||1}):"";return tu(`/entityType/${Ft(t)}/dataQuality/${n}${o}`,{method:"POST",body:JSON.stringify(a)})},QE=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n,env:i}=e;return tu(`${t}/api/${r}/dataValidationFunctions/entityTypes/${Ft(n)}`,{method:"GET",headers:{env:i}})},KE=e=>{let{mlDqPath:t,tenant:r,entityTypeUri:n,attribute:i,viewMultiplier:a=1,dataLevel:o=We.ATTRIBUTE_TYPE,metrics:s=[],startDate:l,endDate:u}=e;const c={attribute:i,metrics:s,viewMultiplier:a,startDate:l,endDate:u};return tu(`${t}/${r}/entityType/${Ft(n)}/ml/dataQuality/v1/${o}/timeSeries/`,{method:"POST",body:JSON.stringify(c)})},JE=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return tu(`/${t}${Fr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},XE=e=>{let{attributeUri:t,value:r}=e;return tu(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},zE=e=>{let{attributeUri:t,value:r}=e;return tu(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},ZE=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return tu(`/${t}${Fr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},em=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=Fr({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=Fl()([[{value:a}]]);return tu(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},tm=e=>{let{entityUri:t,attributeName:r,value:n}=e;return tu(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},rm=e=>{let{entityUri:t,attributeName:r}=e;return tu(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};function nm(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{entityUri:t}=e;return tu(`/${t}/_historicURIs`,{method:"GET"})},am=e=>{let{entityUri:t,historicUris:r}=e,n=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["entityUri","historicUris"]);return tu(`/${t}/_changesWithTotal${Fr(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){nm(e,t,r[t])}))}return e}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},om=(e,t)=>tu(`/${e}/_previousChange${Fr({timestamp:t})}`,{method:"GET"}),sm=(e,t)=>tu(`/${e}${Fr({time:t})}`,{method:"GET"});function lm(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}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{url:t,method:r,data:n,headers:i,noRequestProcessor:a}=e;return tu(t,{method:r||"GET",body:ce(n)?JSON.stringify(n):n,headers:lm({"Content-Type":"application/json"},null!=i?i:{}),noRequestProcessor:a})},pm=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=Fr({options:a.join(","),severity:o.join(",")});return tu(`${t}/validate/${i}/entity/${Ep({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},dm=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return tu(`${t}/validate/${n}/entity${Fr({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},ym=e=>{let{tenant:t,apiPath:r}=e;return tu(`${r}/tenants/${t}/name`,{method:"GET"})},fm=e=>{let{tenant:t,apiPath:r}=e;return tu(`${r}/tenants/${t}/_rdmTenants`,{method:"GET"})},Tm=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e;return tu(`${a}/preferences${Fr({name:t,tenant:r,environment:n,user:i})}`,{method:"GET"})},Em=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 tu(`${a}/preferences`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})},mm=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e,o={name:t,tenant:r,environment:n,user:i};return tu(`${a}/preferences`,{method:"DELETE",body:JSON.stringify(o)})},hm=e=>{const{servicesPath:t}=e;return tu(`${t}/getTokenForWorker`,{method:"GET"})};var bm=r(29524);const Om=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=St(),s={attributes:Nl({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=Ms(r,e,n.uri)[0];return i&&i.value?Il({entity:e,attributeType:n,uri:i.uri,value:t}):Sl({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)(Ds),(0,l.filter)(Rt),(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))})),_m=(0,l.curry)(((e,t)=>(0,l.pipe)(pe,(0,l.filter)(e))(t))),Am=_m((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),Nm=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),Rt)),Pm=e=>(0,l.pipe)(Am,Nm(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),Rm=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(Am,(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})),Sm=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),Rt),(0,l.omit)(["uri","timestamp"])),wm=(0,l.pipe)(Sm,Rp),Im=async(e,t,r)=>{if(!e)return null;const n=Pm(e);if(n.length>0)for(const r of n)e=Rm(r,t[r],e);const i=await rf(wm(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},Um=async(e,t,r)=>{const n=Dm(e,t),i={};for(const t of n)i[t]=await Im(e[t],i,r);return i},Cm=(0,l.curry)(((e,t)=>{const r=bm.Node(t);return Pm(e[t]).forEach((t=>{const n=Cm(e,t);r.addEdge(n)})),r})),Dm=(e,t)=>(0,l.pipe)((0,l.map)(Cm(e)),(0,l.map)(bm.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),jm=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)(Sm))})),Lm=(e,t)=>[...Sh(e.tags||[],t.tags||[]),...wh(e.roles||[],t.roles||[]),...gh(e,t),..._h(e,t)],km=(e,t)=>[...Ah(vh((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),Rh((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e),...Lm(e,t)],Fm=(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 Rm(r,n,e)}),e))))}),t)}),jm),Mm=(0,l.curry)(((e,t)=>(0,l.when)(Rt,(0,l.propOr)(l.__,t,e),t)));function xm(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}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 Vm=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return xm({},t,{[r]:{parents:n,children:i}})},Gm=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return xm({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},Wm=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=Vm({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>Wm(n.uri,t,[e],r)),o)},Bm=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)(Ed(),n),a=t?Gm({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(vd(),n),s=Rt(o)?[o]:[],u=Vm({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>Wm(t,r,[i],e)),u)}),n)},Ym=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return Bm(r,e,t,Wm(e,t))},qm=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return Ym(t,r,n);if(Ut(e)){const t=Sd(n,e);return t&&Bm([t],null,r)}return r[e]?Wm(e,r):void 0},Hm=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>Hm(e,t))))},Qm=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>Qm(e,t))))},Km=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=It(t),u=Ym(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(Ut(c)){if(s=Sd(i,c),!s)return null;o.push({type:Re.relationConnection,value:s,valueType:Pi(a,(0,l.path)(md(),s))});continue}if(Ut(u)){const e=n[c];if(!e)return null;o.push({type:Re.tempEntity,value:e,valueType:Jr(a,e.type)});continue}const p=n[u],d=Zs(p,c),y=n[c];if(!d||!y)return null;o.push({type:Re.attributeValue,value:d,valueType:mr(a,Vt(d.uri,p.type))}),o.push({type:Re.tempEntity,value:y,valueType:Jr(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},Qm(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=Ut(s),d=p?wd(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?Pi(a,d.type):Jr(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:hr(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:Re.tempEntity,value:T,valueType:Jr(a,T.type)}),o.push({type:Re.attributeValue,value:s,valueType:E}),m=s.value;const l=Ds(s);T=l&&Rt(l)?n[l]:null}}return o},Jm=e=>e.every((e=>{let{type:t}=e;return[Re.attributeValue,Re.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===Re.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null;let Xm;!function(e){e.insertAttribute="insertAttribute",e.updateAttribute="updateAttribute",e.deleteAttribute="deleteAttribute"}(Xm||(Xm={}));const zm={[Xm.insertAttribute]:{color:"#599E0E"},[Xm.updateAttribute]:{backgroundColor:"rgba(255, 187, 0, 0.12)",color:"#CC7500"},[Xm.deleteAttribute]:{backgroundColor:"rgba(255, 50, 0, 0.2)",color:"#CF0E26"}},Zm=e=>{switch(e){case"UPDATE_ATTRIBUTE":return Xm.updateAttribute;case"UNDO_IGNORE_ATTRIBUTE":case"INSERT_ATTRIBUTE":return Xm.insertAttribute;case"IGNORE_ATTRIBUTE":case"DELETE_ATTRIBUTE":return Xm.deleteAttribute;default:return""}},eh="/",th=(0,l.pipe)((0,l.split)(eh),(0,l.propSatisfies)((0,l.lte)(2),"length")),rh=(0,l.pipe)((0,l.split)(eh),(0,l.slice)(0,-2),(0,l.join)(eh)),nh=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.has)(e),(0,l.prop)(e)],[()=>th(e),nh(rh(e))]])(t))),ih=e=>(0,l.pipe)(l.keys,(0,l.any)((0,l.startsWith)(e+eh))),ah=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=nh(e,t);return(0,l.isNil)(r)?ih(e)(t)?"UPDATE_ATTRIBUTE":"":r},oh=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]},sh=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(sh(e))}))}))),t},lh=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)(dh,t),(0,l.propOr)([],"crosswalks",e))),e),uh=(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(uh(e))}))})),r},ch=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=ch(e);r>t&&(t=r)}))})),t+1):t},ph=(e,t)=>{if(Rt(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},dh=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},yh=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},fh=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},Th=(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)},Eh=(0,l.eqBy)(dh),mh=(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)(Rs,(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 hh(e){return e&&void 0!==e.uri}function bh(e){return function(t,r){var n,i,a=[];return i=r,!(n=t)&&!i||!(!n||!i)&&n.length===i.length&&n.every((function(e,t){return e===i[t]}))||a.push({type:e,newValue:r}),a}}function Oh(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 vh(e,t,r){var n,i,a,o=[];for(var s in e)if(e.hasOwnProperty(s)){if("paging"===s)continue;var u=e[s];if(void 0===t[s])for(var c in u)u.hasOwnProperty(c)&&o.push.apply(o,m(u[c]));else for(var p in u)if(u.hasOwnProperty(p)){var d=u[p],y=_(d,t[s]);void 0===y?o.push.apply(o,m(d)):d.value===y.value||d.lookupCode&&d.lookupCode===y.lookupCode?d.ignored!==y.ignored&&o.push.apply(o,b(y)):null==y.value||""===y.value?o.push.apply(o,m(d)):"Nested"===g(d)?d.ignored!==y.ignored&&(0,l.equals)(d.value,y.value)?o.push.apply(o,b(y)):o=o.concat(vh(d.value,y.value,r)):"Reference"===g(d)?Oh(d,y)?o.push.apply(o,vh(d.value,y.value,r)):(o.push.apply(o,m(d)),o.push(O([y]))):""!==y.value&&(!1===y.ov?o.push.apply(o,(void 0,void 0,i=(n=y).uri.lastIndexOf("/"),a=n.uri.substr(0,i),[{type:"_UPDATE_NON_OV_ATTRIBUTE",uri:n.uri,typeUri:a,value:n.lookupCode||n.value}])):o.push.apply(o,h(y)))}}for(var f in t)if(t.hasOwnProperty(f)){if("paging"===f)continue;var T=(t[f]||[]).filter((function(t){return void 0===_(t,e[f])}));(T=E((0,l.clone)(T))).length&&o.push(O(T))}return o;function E(e){return e?e.map((function(e){var t;if(e){var r=e.value;return null!=r&&(ce(r)?Object.keys(r).forEach((function(e){var n=E(r[e]);n.length>0?r[e]=n:delete r[e],t||(t=0!==n.length)})):t=null!=r&&""!==r),t||e.lookupCode||e.refEntity?e:null}})).filter((function(e){return null!=e})):[]}function m(e){return[{type:"DELETE_ATTRIBUTE",uri:e.uri}]}function h(e){return[{type:"UPDATE_ATTRIBUTE",uri:e.uri,newValue:{value:e.lookupCode||e.value}}]}function b(e){return e&&(e.ignored?function(e){return[{type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}}]}(e):function(e){return[{type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!1}}]}(e))}function O(e){var t=e[0].uri,n=t.lastIndexOf("/"),i={type:"INSERT_ATTRIBUTE",uri:t=t.substr(0,n),newValue:e.map((function(e){var t,n={value:JSON.parse(JSON.stringify(e.lookupCode||e.value))};return r&&(n.uri=e.uri),v(n.value),e.refEntity&&(t=e.refEntity,Array.isArray(t)&&(t=t[0]),n.refEntity=t),e.refRelation&&(t=e.refRelation,Array.isArray(t)&&(t=t[0]),r||delete t.objectURI,n.refRelation=t),n}))};return i}function v(e){if(null!==e&&"[object Object]"===e.toString())for(var t in e)e.hasOwnProperty(t)&&"paging"!==t&&e[t].forEach((function(e){delete e.crosswalks,delete e.type,r||delete e.uri,v(e.value)}))}function g(e){var t=e.value;if(ce(t))return e.hasOwnProperty("refEntity")?"Reference":"Nested"}function _(e,t){if(void 0!==t)return t.filter((function(t){return t.uri===e.uri}))[0]}}function gh(e,t){var r,n,i=[];return e.defaultProfilePic!==t.defaultProfilePic?i.push({type:"UPDATE_PROFILE_PIC_BY_URI",newValue:{value:t.defaultProfilePic}}):(r=e.defaultProfilePicValue)===(n=t.defaultProfilePicValue)||hh(r)&&hh(n)&&r.uri===n.uri||i.push({type:"UPDATE_PROFILE_PIC_BY_URL",newValue:{value:t.defaultProfilePicValue}}),i}function _h(e,t){var r=[],n=a(e.startDate,t.startDate);void 0!==n&&r.push({type:"UPDATE_START_DATE",newValue:{value:n}});var i=a(e.endDate,t.endDate);return void 0!==i&&r.push({type:"UPDATE_END_DATE",newValue:{value:i}}),r;function a(e,t){var r;return e!=t&&(r=(0,l.isNil)(t)?"":t+""),r}}function Ah(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;var n="configuration/sources/Reltio",i="configuration/sources/ReltioCleanser";function a(e,t){return e.crosswalk={type:t.type,value:t.value},e}function o(e,t){return e.reduce((function(e,r){return(e[r[t]]=e[r[t]]||[]).push(r),e}),{})}function s(e){return e.removeIt=!0}var l=e.map((function(e){if(e.crosswalk)return[e];var o=Nh(t,e.uri),s=o.filter((function(e){return e.type===n})),l=o.filter((function(e){return e.type!==n})),u=[];switch(e.type){case"INSERT_ATTRIBUTE":u.push(e);break;case"_UPDATE_NON_OV_ATTRIBUTE":u=u.concat(o.map((function(t){return a(e,t)})));break;case"DELETE_ATTRIBUTE":(l.length||0==s.length)&&u.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}}),u=u.concat(s.map((function(t){return a({type:"DELETE_ATTRIBUTE",uri:e.uri},t)})));break;case"UPDATE_ATTRIBUTE":{const o=l.some((e=>{let{type:t}=e;return t===i}))&&r?Ph(r,t,e.uri):null;if(o||s.length){if(s.length)u=u.concat(s.map((function(t){return a({type:"UPDATE_ATTRIBUTE",uri:e.uri,newValue:e.newValue},t)})));else if(o){var c=Nh(t,o.uri).filter((e=>{let{type:t}=e;return t===n}));u=u.concat(c.map((t=>a({type:"UPDATE_ATTRIBUTE",uri:o.uri,newValue:e.newValue},t))))}}else u.push({type:"INSERT_ATTRIBUTE",uri:e.uri.substr(0,e.uri.lastIndexOf("/")),newValue:[e.newValue],insteadOfUpdate:!0});l.length&&u.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}});break}}return u})),u=[].concat.apply([],l),c=o(u,"typeUri");for(var p in c)if("undefined"!==p){var d=c[p],y=u.filter((function(e){return"_UPDATE_NON_OV_ATTRIBUTE"!==e.type})).filter((function(e){return e.uri.substr(0,e.uri.lastIndexOf("/"))===p||"INSERT_ATTRIBUTE"===e.type&&e.uri===p})),f=d.filter((function(e){return e.crosswalk&&e.crosswalk.type===n}))[0],T=y.filter((function(e){return"UPDATE_ATTRIBUTE"===e.type}))[0];!T&&f&&(u.push({type:"UPDATE_ATTRIBUTE",uri:f.uri,newValue:{value:f.value},crosswalk:f.crosswalk}),y.forEach(s)),d.forEach(s)}return(u=u.filter((function(e){return!e.removeIt}))).forEach((function(e){delete e.insteadOfUpdate})),u}const Nh=(e,t)=>e.filter((function(e){return 1===(e.attributes||e.attributeURIs||[]).filter((function(e){return e===t})).length})),Ph=(e,t,r)=>(0,l.pipe)(el,(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 ph(t,r)},e=>{let[t]=e;return!_s(t)}]),(0,l.prop)(0),(0,l.always)(null)))(e,r);function Rh(e,t){for(var r in t=t||[],e)if(e.hasOwnProperty(r))for(var n=e[r],i=0;i<n.length;i++){var a=n[i];if(a.refRelation){var o=a.refRelation[0]||a.refRelation;if(o.crosswalks)for(var s=o.crosswalks.filter((function(e){return e.attributes||e.attributeURIs})),l=0;l<s.length;l++){for(var u=!0,c=0;c<t.length;c++)if(t[c].type===s[l].type&&t[c].value===s[l].value){t[c].attributes=t[c].attributes||t[c].attributeURIs,t[c].attributes=t[c].attributes.concat(s[l].attributes||s[l].attributeURIs),t[c].attributes=Object.keys(t[c].attributes.reduce((function(e,t){return e[t]=!0,e}),{})),delete t[c].attributeURIs,u=!1;break}u&&t.push(s[l])}}}return t}function Sh(e,t){return bh("UPDATE_TAGS").call(this,e,t)}function wh(e,t){return bh("UPDATE_ROLES").call(this,e,t)}function Ih(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Uh(e,t,r[t])}))}return e}function Uh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ch=function(e){var t=function(e,r,n,i){if(e&&r)if(n||(n=null),i=!!i,Array.isArray(e))for(var a=0;a<e.length;a++)r.call(n,a,e[a],e),i&&t(e[a],r,n,i);else if(ce(e))for(var o in e)r.call(n,o,e[o],e),i&&t(e[o],r,n,i)},r=function(e,t,r){return function(n){var i=-1!==n.uri.lastIndexOf("/")?n.uri.substring(0,n.uri.lastIndexOf("/")):"";e[i]||(e[i]=[]),e[i].push(n.type),t[n.uri]=n.type,"IGNORE_ATTRIBUTE"===n.type&&r.push(n.uri)}},n=function(e,t,r){var n=[],i=Object.keys(e).filter((function(t){return-1!==e[t].indexOf("IGNORE_ATTRIBUTE")&&-1!==e[t].indexOf("INSERT_ATTRIBUTE")}));return Object.keys(t).filter((function(e){var t=-1!==e.lastIndexOf("/")?e.substring(0,e.lastIndexOf("/")):null;return-1!==i.indexOf(t)})).forEach((function(e){-1!==r.indexOf(e)&&n.push(e),t[e]="UPDATE_ATTRIBUTE"})),{appearance:t,ignored:n}},i=function(e,t){var r=Array.isArray(t),n=r?[]:{};return r?(e=e||[]).some((function(e){return e.uri}))?n=function(e,t){var r=e.map((function(e){return e.uri})),n=e.map((function(e){var r,n,a=(n=t.filter((function(t){return t.uri===e.uri}))[0]||{},(r=e)&&n&&r.ignored!==n.ignored&&(delete r.ignored,delete n.ignored,r.ov=!0,n.ov=!0),{a:r,b:n});return i(a.a,a.b)})),a=t.filter((function(e){return-1===r.indexOf(e.uri)}));return n.concat(a)}(e,t):(n=n.concat(e),t.forEach((function(t,r){void 0===n[r]?n[r]=t:ce(t)?n[r]=i(e[r],t):-1===e.indexOf(t)&&n.push(t)}))):(ce(e)&&Object.keys(e).forEach((function(t){n[t]=e[t]})),Object.keys(t).forEach((function(r){ce(t[r])&&e[r]?n[r]=i(e[r],t[r]):n[r]=t[r]}))),n},a=function(){let a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var s=JSON.parse(JSON.stringify(a)),l=JSON.parse(JSON.stringify(o)),u=i(a,o),c={},p={},d=[],y=r(p,c,d);e.compareAttributes(u,l).map((function(e){return"IGNORE_ATTRIBUTE"===e.type&&!1===e.newValue.value&&(e.type="UNDO_IGNORE_ATTRIBUTE"),e})).forEach((function(e){y(e)})),e.compareAttributes(u,s).map((function(e){return"DELETE_ATTRIBUTE"===e.type&&(e.type="INSERT_ATTRIBUTE"),"IGNORE_ATTRIBUTE"===e.type&&(e.type=e.newValue.value?"UNDO_IGNORE_ATTRIBUTE":"IGNORE_ATTRIBUTE"),e})).forEach((function(e){y(e)}));var f=n(p,c,d);return t(u,(function(e,t){t&&-1!==this.indexOf(t.uri)&&(t.ignored=!0,delete t.ov,t.hidden=!0)}),f.ignored,!0),{attributes:u,appearance:f.appearance}};const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=(0,l.difference)(t,e),n=(0,l.difference)(e,t),i=n.concat(t),a=(e,t)=>(0,l.pipe)((0,l.map)((t=>[t,e])),l.fromPairs)(t),o=Ih({},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:Ih({},n,{roles:s,tags:u}),roles:i,tags:l}}}};const Dh=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?Dh(t.value):[]];return e.concat(r)}),[])),jh=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,Lh=e=>e?[Tp(e)]:[],kh=e=>{const t=[...Dh((null==e?void 0:e.attributes)||[]),...Dh((null==e?void 0:e.analyticsAttributes)||[])];return e?[...Lh(e),...t]:[]},Fh=(e,t)=>[e,...t.map((t=>jh(e,t)))],Mh=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return pd(t)}))},xh=(e,t)=>{switch(e){case Se.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case Se.ENTITY_ATTRIBUTE:case Se.RELATION_ATTRIBUTE:return(e=>{let{uri:t}=e;return[Gt(t)]})(t);case Se.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case Se.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n,dataTenant:i}}}=e;return[t,Tp({uri:n,dataTenant:i}),r]})(t)}},$h=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),Vh=(0,l.curry)(((e,t)=>{const r=Co(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(Vh(e,r.extendsTypeURI)):n})),Gh=(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))),Wh=(e,t)=>(0,l.pipe)((0,l.prop)("type"),Vh(e),Gh(t))(t),Bh=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 Yh,qh=r(33164);function Hh(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"}(Yh||(Yh={}));const Qh={},Kh={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"]}},Jh=e=>{if(!Qh[e]){const t=Kh[e]||Kh.random0;Qh[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){Hh(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return Qh[e]},Xh=(0,l.curry)(((e,t)=>{const r=Jh(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]})),zh=e=>Xh(Yh.Charts,e),Zh=()=>Jh(Yh.PotentialMatches).colors,eb=e=>Xh(Yh.Random1,e),tb=e=>(0,qh.getColor)(e)?"#FFFFFF":"#212121";var rb=r(73116);const nb=Array.from({length:100},((e,t)=>t/100)),ib=e=>{const t=Number(e.replace(/\D/g,""))||0;let r=3735928559^t,n=1103547991^t;for(let t,i=0;i<e.length;i++)t=e.charCodeAt(i),r=Math.imul(r^t,2654435761),n=Math.imul(n^t,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&n)+(r>>>0)},ab={},ob=new rb.Z({hash:ib,saturation:nb.slice(15,71),lightness:nb.slice(50,90)}),sb=new rb.Z({hash:ib,saturation:nb.slice(46,89),lightness:nb.slice(44,58)}),lb=(0,l.curry)(((e,t,r)=>{t in ab||(ab[t]={});const n=ab[t];r in n||(n[r]=((e,t)=>{const r=String(ib(t));return e.hsl(r)})(e,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),ub=lb(ob,"crosswalks"),cb=lb(ob,"sources"),pb=lb(ob,"contributors"),db=lb(ob,"dataValidationFunctions"),yb=lb(sb,"entities");function fb(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}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}const Eb=(0,l.has)("items"),mb=e=>0===e,hb=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)},bb=e=>e.reduce(((e,t)=>e+t.width),0),Ob=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),vb=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),gb=e=>e.reduce(((e,t)=>e+t.height),0),_b=e=>(0,l.is)(String,e)&&e.includes("%"),Ab=(0,l.has)("spacer"),Nb=(e,t)=>Math.max(Math.round(parseFloat(t)/100*e),1),Pb=e=>((null==e?void 0:e.items)||[]).reduce(((e,t)=>e.concat(Eb(t)?Pb(t):t)),[]),Rb=(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},Sb=e=>({id:e.layout}),wb=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Sb;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=_b(r.width)?Nb(i,r.width):u}return hb(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return hb(n,t,r)},o=(e,t)=>Eb(t.items[0])?p(e,t.items[0]):null,s=(t,r)=>{const o=r.items.map((a=>i(t,r,a,Eb(a)?n(a.layout):e(a.view)))),s=Rb(t.width,o),u=r.items.reduce(((r,n,i)=>{const o=s[i],u=mb(i)?t.x:(0,l.last)(r).x+(0,l.propOr)(o,"width",(0,l.last)(r));if(Eb(n))return r.concat(p(fb({},t,{x:u,width:o}),n));{const i=e(n.view);return r.push(fb({y:t.y,x:u,height:a(i),width:o},i)),r}}),[]);return{x:t.x,y:t.y,width:bb(u),height:Ob(u),items:u}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=Eb(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=mb(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(Eb(i))return r.concat(p(fb({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(fb({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?hb(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?hb(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:vb(i),height:gb(i),items:i}},c=(t,r)=>{const n=(e,t,r,n)=>mb(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 fb({},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=Rb(e.width,[o,o]),u=fb({},e,{width:s[0]}),c=fb({},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(fb({},e,{y:n(e,t,a,f),height:f,items:(0,l.filter)(l.identity,[p,d])}))}return t}),[]);return fb({},e,{height:gb(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(fb({},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 fb({},t,{height:y,items:(0,l.reject)(f,[s,p,d])})},p=(e,t)=>{const r=fb({},t,{items:(0,l.reject)(Ab,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 Pb(f)},Ib=(e,t)=>(e||[]).filter((e=>t.some((t=>t.id===e.id)))),Ub=[Qe.FilteredEntitiesViewFacet,Qe.ActivitiesViewFacet,Qe.ProfileStatsFacet,Qe.FilteredSavedSearchesFacet],Cb=(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=Ub.includes(a.component)?8:4;return fb({},i,{height:Math.max(r,o),minHeight:Math.max(n,o)})}));function Db(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){jb(e,t,r[t])}))}return e}function jb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Lb={BarChart:He.BAR,BarChartGrouped:He.BAR,BarChartHorizontal:He.BAR,LineChart:He.LINE,Map:He.MAP,Pie:He.PIE},kb=(e,t)=>Wt(e)?xt(e,t):e,Fb=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=Lb[r];return Db({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},Mb=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return Db({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"]))},xb=(e,t,r)=>{const n=(e=>e&&ie(e).map((e=>{const{type:t,value:r}=e;return Db({},e,{value:[ln,un,an.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?ie(n):void 0}})))(e);return t&&Wt(t)||!r?n:(n||[]).concat((i=r,{filter:an.EQUALS,fieldName:"type",values:[i]}));var i},$b=["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"],Vb={"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:kb(n,r),filters:xb(a,n,r),chartType:He.BAR,component:Qe.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:kb(n,r),filters:xb(a,n,r),chartType:He.BUBBLE,component:Qe.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:Qe.CustomActionViewFacet}},"com.reltio.plugins.dashboard.FacetChartView":e=>{let{id:t,firstDimension:r,useEntityType:n,caption:i,filter:a,count:o,orderType:s,options:l,canRead:u}=e;const c=ie(a).find((e=>"type"===(null==e?void 0:e.attribute))),p=n||(null==c?void 0:c.value);return Db({id:t,count:o,canRead:u,orderType:s,attributeUri:kb(r,p),filters:xb(a,r,p),component:Qe.DashboardFacet,title:i,showOthers:!0},Fb(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:kb(n,r),filters:xb(a,n,r),chartType:He.MAP,component:Qe.DashboardFacet,title:i,geoUrl:$b[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 Db({id:t,count:o,canRead:l,attributeUri:kb(n,r),filters:xb(a,n,r),component:Qe.DashboardFacet,title:i,geoUrl:s,chartType:He.MAP,projection:"geoMercator"},Fb(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Qe.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:Mb(i),component:Qe.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:xb(n,null,a),component:Qe.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:an.GTE,fieldName:"matches",values:["1"]}],component:Qe.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:Qe.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:He.CLOUD,component:Qe.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:He.TREE,component:Qe.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Qe.NotificationInboxFacet,title:n||be().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Qe.ActivitiesViewFacet,title:n||be().text("Activity log")}}},Gb=e=>({id:e,height:10}),Wb=(0,l.pipe)((0,l.map)((e=>{const t=Vb[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),Bb=e=>{if("0.1"===e.version){const t=Wb(e.views),r=wb(Gb,e.layout,{columns:4});return{id:e.id,margin:0,layout:Ib(r,t),views:t}}return e},Yb=e=>(0,l.cond)([[(0,l.propEq)("layout","profile"),(0,l.pipe)((0,l.pick)(["center","right","top"]),l.values,l.flatten,(0,l.map)((0,l.when)((0,l.is)(Object),l.values)),l.flatten)],[(0,l.has)("view"),(0,l.pipe)((0,l.prop)("view"),ie)],[(0,l.prop)("items"),(0,l.pipe)((0,l.prop)("items"),(0,l.map)((e=>Yb(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);function qb(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){Hb(e,t,r[t])}))}return e}function Hb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qb=qb({},Ke,{OldMap:"com.reltio.plugins.entity.EntityMapView",OldTree:"com.reltio.plugins.entity.TreeView"}),Kb=e=>e,Jb={[Qb.Attributes]:Kb,[Qb.HierarchyTree]:Kb,[Qb.HierarchyPaths]:Kb,[Qb.RelationsTable]:Kb,[Qb.Relations]:e=>qb({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[Qb.SingleAttribute]:Kb,[Qb.Custom]:Kb,[Qb.AttributeTable]:Kb,[Qb.Map]:Kb,[Qb.OldTree]:e=>qb({},e,{class:Ke.HierarchyTree}),[Qb.OldMap]:e=>qb({},e,{class:Ke.Map}),[Qb.ImageAttribute]:Kb,[Qb.PotentialMatches]:Kb},Xb=(0,l.pipe)((0,l.map)((e=>{const t=Jb[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),zb=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.defaultTo)([]),(0,l.find)((0,l.propEq)("id",t)),(0,l.prop)("class"))(e)===Ke.Map?{id:t,height:5,minHeight:5}:{id:t,autosizing:!0})),Zb=(e,t)=>(t||[]).map((t=>qb({},t,zb(e,t.id)))),eO=e=>{const t=(0,l.pick)(["id","workflow","maxWidth","sidePanelViews","profileBand","views"],e);if("2.0"===e.version)return qb({},t,{layout:Zb(t.views,e.newLayout)});if("0.1"===e.version){const r=Xb(e.views),n=wb(zb(r),e.layout,{columns:3});return qb({},t,{layout:Ib(n,r),views:r})}return e},tO=(e,t)=>e.class===t||e["react-class"]===t,rO=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(tO(t,Ke.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 tO(t,Ke.SingleAttribute)&&e.includeUris.push(t.attributeUri),e}),{includeUris:[],excludeUris:null}))(e);return e=>{let{uri:n}=e;return r&&!r.some(Lt(n))||t.some(Lt(n))}},nO=(e,t)=>e.filter((e=>t.some((t=>tO(e,t))))).map((e=>{let{id:t}=e;return t})),iO=(e,t)=>{let{extensions:r}=e;return(r||[]).find((e=>e.id===t))},aO=(e,t)=>e.flatMap((e=>{let{extensions:r=[]}=e;return r.filter((e=>{let{point:r}=e;return r===t}))})),oO=e=>(0,l.pipe)((0,l.map)((e=>iO(e,"com.reltio.plugins.entity.ProfileBand"))),(0,l.reject)(l.isNil),l.head)(e);function sO(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){lO(e,t,r[t])}))}return e}function lO(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)=>Yb(t).map((t=>(0,l.pipe)((0,l.map)((e=>iO(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")),pO=(0,l.propEq)("class",Ke.Custom),dO=e=>{let{extensions:t=[]}=e;return t.filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]))},yO=(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=Zb(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=>iO(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=>iO(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)(pO))(sO({},n,{items:i})),s=[{id:"common",views:uO(e,sO({},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=eO(sO({},t,{views:a,version:"0.1"})),u=(0,l.pipe)(oO,(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})},fO=(e,t)=>{if("scroll"===t.layout.layout){const r=uO(e,t.layout),n=Bb(sO({},t,{views:r,version:"0.1"}));return{class:Xe.Dashboard,id:t.id,views:n.views,layout:n.layout}}return{class:Xe.Dashboard,views:t.views,layout:t.layout,id:t.id}},TO=(e,t)=>{const r=uO(e,t.layout)[0];return{class:Xe.DQDashboard,id:t.id,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel}},EO=(e,t)=>{const r=uO(e,t.layout)[0];return{class:Xe.RelationshipSearch,id:t.id,options:r.options,consoleExportApp:r.consoleExportApp}},mO=(e,t)=>{const r=uO(e,t.layout)[0];return{class:Xe.Interactions,id:t.id,sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},hO=(e,t)=>{const r=uO(e,t.layout)[0];return{class:Xe.Relationships,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},bO=(e,t)=>{const r=uO(e,t.layout)[0];return{class:Xe.Sources,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},OO=(e,t)=>{const r=uO(e,t.layout)[0];return{class:Xe.PotentialMatches,id:t.id,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},vO=(e,t)=>{const r=uO(e,t.layout)[0],n=r.potentialMatchesReview||{processType:(e=>{const[t]=aO(e,"com.reltio.plugins.search.toolbar.component").filter((e=>"com.reltio.plugins.ui.CustomActionButtonView"===e.class&&e.processType));return null==t?void 0:t.processType})(e)};return{class:Xe.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}},gO=(e,t)=>({class:Xe.Graph,id:t.id}),_O=(e,t)=>{const r=uO(e,t.layout)[0];return{class:Xe.ProfileActivityLog,id:t.id,exportTypes:r.exportTypes,caption:r.caption}},AO=e=>t=>!!(0,l.intersection)(e,t).length,NO=(0,l.cond)([[AO(["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"]),()=>fO],[AO(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>TO],[AO(["com.reltio.plugins.graph.GraphView"]),()=>gO],[AO(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>EO],[AO(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>mO],[AO(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>hO],[AO(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>bO],[AO(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>OO],[AO(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>vO],[AO(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>_O],[l.T,()=>(0,l.always)(void 0)]]),PO=(e,t)=>{const{class:r}=e;if("com.reltio.plugins.entity.ProfileAction"===r)return((e,t)=>{const r=(0,l.pipe)((0,l.chain)(dO),(0,l.map)((t=>yO(e,t))),(0,l.indexBy)((0,l.prop)("entityType")),(0,l.map)((0,l.pick)(["layout","views","sidePanelViews","profileBand","workflow"])))(e);return{class:Xe.Profile,id:t.id,entityTypes:r}})(t,e);if("com.reltio.plugins.ui.actions.CustomAction"===r)return{id:e.id,type:ze.CustomAction,config:(0,l.omit)(["class","id","point","parent","type"],e)};if("com.reltio.plugins.ui.actions.ConsoleAppAction"===r)return{id:e.id,type:ze.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=>iO(e,"com.reltio.plugins.newDashboard.NewDashboardView")),(0,l.pick)(["id","views","layout"]),(0,l.assoc)("class",Xe.Dashboard))(e)}const i=(0,l.pipe)((0,l.map)((e=>iO(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=yO(e,r),i=(0,l.pipe)((0,l.propOr)([],"entity-types"),(0,l.map)((e=>[e,n])),l.fromPairs)(t);return{class:Xe.NestedProfile,id:t.id,entityTypes:i}})(t,e,i);const a=Yb(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 NO(o)(t,i)};function RO(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){SO(e,t,r[t])}))}return e}function SO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wO=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))},IO="https://reltio-ui-files.s3.amazonaws.com/new-ui/";var UO;!function(e){e[e.DashboardGroup=0]="DashboardGroup",e[e.ProfileGroup=1]="ProfileGroup",e[e.SearchGroup=2]="SearchGroup"}(UO||(UO={}));const CO={[Xe.DQDashboard]:`${IO}DqDashboard.svg`,[Xe.Dashboard]:`${IO}Dashboard.svg`,[Xe.Graph]:`${IO}Graph.svg`,[Xe.RelationshipSearch]:`${IO}GraphSearch.svg`,[Xe.Interactions]:`${IO}Interactions.svg`,[Xe.PotentialMatches]:`${IO}PotentialMatches.svg`,[Xe.Profile]:`${IO}Profile.svg`,[Xe.NestedProfile]:`${IO}Profile.svg`,[Xe.ProfileActivityLog]:`${IO}ActivityLog.svg`,[Xe.Relationships]:`${IO}Relationships.svg`,[Xe.Sources]:`${IO}Crosswalk.svg`,[Xe.Search]:`${IO}Search.svg`,[UO.DashboardGroup]:`${IO}DashboardGroup.svg`,[UO.ProfileGroup]:`${IO}ProfileGroup.svg`,[UO.SearchGroup]:`${IO}SearchGroup.svg`,DEFAULT:`${IO}Default.svg`},DO=e=>CO[null==e?void 0:e.class]||CO.DEFAULT,jO=(0,l.pipe)((0,l.pluck)("screen"),(0,l.filter)((0,l.anyPass)([(0,l.propEq)("class",Xe.NestedProfile)])),(0,l.groupBy)((0,l.prop)("class")),(0,l.map)((e=>e.map(((e,t)=>RO({},e,{nestedRoute:`${t+1}`})))))),LO=(e,t)=>{var r;return(null===(r=e[t.class])||void 0===r?void 0:r.find((0,l.propEq)("id",t.id)))||t},kO=e=>"com.reltio.plugins.entity.ProfileFirstAction"===e.class?CO[UO.ProfileGroup]:null,FO=e=>(0,l.cond)([[(0,l.any)((e=>{let{icon:t}=e;return t===CO[Xe.Dashboard]||t===CO[Xe.DQDashboard]})),(0,l.always)(CO[UO.DashboardGroup])],[(0,l.any)((e=>{let{icon:t}=e;return t===CO[Xe.Search]||t===CO[Xe.RelationshipSearch]})),(0,l.always)(CO[UO.SearchGroup])],[l.T,()=>null]])(e),MO=e=>(0,l.pipe)((0,l.chain)(wO),(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=>RO({},e,{entityTypes:e["entity-types"],screen:PO(e,t)}))),(0,l.filter)((e=>e.screen)))(t),n=jO(r);return(0,l.map)((e=>{let{label:t,screen:r,canRead:i,entityTypes:a}=e;return{label:t,icon:DO(r),screen:LO(n,r),canRead:i,entityTypes:a}}))(r)})(t,e),n=PO(t,e);return{label:t.label,icon:kO(t)||FO(r)||DO(n),menu:r.length?{type:"side",items:r}:void 0,screen:n,canRead:t.canRead}}));function xO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $O=e=>{let{extensions:t}=e;return(t||[]).filter((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},VO=e=>({id:e,height:10}),GO=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)($O),(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=Wb(((e,t)=>{const r=Yb(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){xO(e,t,r[t])}))}return e}({id:r},t[0])})),(0,l.uniqBy)((0,l.prop)("id")))(e)})(e,t.layout)),n=wb(VO,t.layout,{columns:4});return{views:r,layout:Ib(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))};function WO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const BO=(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))),YO=e=>"com.reltio.plugins.dashboard.DashboardPerspective"===e,qO=e=>(0,l.pipe)((e=>aO(e,"com.reltio.plugins.ui.custom_script")),(0,l.reject)(E),(0,l.map)((e=>{let{action:t}=e;return 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){WO(e,t,r[t])}))}return e}({},t,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,["action"]))})))(e),HO=(0,l.unless)((e=>!!e&&(e.startsWith("http:")||e.startsWith("https:"))),(0,l.always)(null)),QO=(0,l.pipe)(BO("top-logo"),HO),KO=(0,l.prop)("showLookupCode"),JO=e=>{var t;const r=(e=>(0,l.pipe)((0,l.map)((e=>iO(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=>iO(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=>iO(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=>iO(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=>iO(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=>iO(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=>iO(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.propEq)("format","none")),(0,l.map)((0,l.always)({thousandSeparator:""})))(e))(e),c=(e=>(0,l.pipe)((0,l.map)((e=>iO(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)(BO("default-perspective"),(0,l.ifElse)(YO,(0,l.always)("dashboard"),(0,l.always)("search")))(e))(e),d=(e=>(0,l.pipe)((0,l.map)((e=>iO(e,"com.reltio.plugins.ui.AttributesSorting"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("strategy"))(e))(e),y=qO(e),f=(e=>BO("checkUser",e))(e),T=(e=>BO("checkIdle",e))(e),E=(e=>(0,l.pipe)((0,l.map)((e=>iO(e,"com.reltio.plugins.ui.configuration.FeatureManagement"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("preferNewUI"),l.not)(e))(e),m=(e=>(0,l.pipe)((0,l.map)((e=>iO(e,"com.reltio.plugins.ui.LookupCodeVisibility"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}))(e))(e),h=void 0===(b=KO(m))||b;var b;const O=null===(t=oO(e))||void 0===t?void 0:t.showEntityId,v=(e=>BO("preview",e))(e),g=QO(e),_=(e=>BO("showAttributeDescription",e))(e),A=(e=>BO("topBackgroundColor",e))(e),N=(e=>(0,l.pipe)((0,l.map)((e=>iO(e,"com.reltio.framework.util.DateMask"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"),(0,l.defaultTo)({}),(e=>{let{dateMask:t,dateTimeMask:r}=e;return{dateMask:t,dateTimeMask:r}}),(0,l.reject)(l.isNil))(e))(e);return{i18n:s,entity:{requestSettings:{defaultMaxValues:r}},image:{attributeFieldsOrder:n},lookups:{autocomplete:i,showCode:h},validate:{levels:a,validateReadMode:o},masks:0===Object.keys(N).length?void 0:N,attributePresentations:u,attributesSorting:d,workflow:c,defaultRoute:p,customScripts:y,checkUser:f,checkIdle:T,showSwitchToClassic:E,showEntityId:O,preview:v,logo:g,showAttributeDescription:_,headerColor:A}},XO=e=>({layout:MO(e),pivoting:GO(e),properties:JO(e)});var zO=r(58697),ZO=r.n(zO);function ev(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){tv(e,t,r[t])}))}return e}function tv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rv=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}_${ZO()()}`;return n[e.id].push(t),i=!0,ev({},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]++,ev({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}};function nv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){iv(e,t,r[t])}))}return e}function iv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let av={};const ov=(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(av[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))}av=nv({},av,{[a]:nv({},av[a]||{},{worker:i})})}else i=av[a].worker,av[a].innerText&&t({task:{action:rt.SET_HTML,params:{html:av[a].innerText}},worker:i,config:r}),i.removeEventListener("message",av[a].onWorkerMessage);return i&&(av[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||(av[a].innerText=n.params.html)}},i.addEventListener("message",av[a].onWorkerMessage)),i},sv=(0,l.curry)(((e,t)=>!e||!e.availableEntityTypes||!t||e.availableEntityTypes.includes(t))),lv=(0,l.flip)(sv),uv=(0,l.curry)(((e,t)=>{if(null==t)return"";if("string"!=typeof t&&(t=String(t)),e&&t){const{thousandSeparator:r="",decimalSeparator:n=".",prefix:i="",suffix:a=""}=e,[o,s]=t.split(".");t=i+o.replace(/\B(?=(\d{3})+(?!\d))/g,r)+(s?n+s:"")+a}else!e&&t&&(t=be().number(t));return t})),cv=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?be().number(e,"0,0.0a").toUpperCase():be().number(e,"0,0"):""},pv=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last));let dv=!0;const yv=e=>dv=e,fv=(e,t)=>e!==t&&t?dv&&e?`${t} (${e})`:t:e,Tv=(e,t,r)=>(0,l.path)([t,r,"displayName"],e),Ev=(e,t,r)=>{const n=Tv(e,t,r);return fv(r,n)},mv=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),hv=(0,l.complement)(mv),bv=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),Ov=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)},vv=(0,l.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter(hv(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),gv=(0,l.curry)(((e,t)=>{let{attributePresentations:r={},dataTypeDefinition:n={},dateMask:i,dateTimeMask:a}=e;const o=r[n.uri],s=i?q(i):"L",u=a?K(a):"L LTS";switch(n.type){case lt.TYPE_NUMBER:case lt.TYPE_FLOAT:case lt.TYPE_DOUBLE:case lt.TYPE_LONG:case lt.TYPE_INT:case lt.TYPE_COUNT:return t&&uv(o,t);case lt.TYPE_BOOLEAN:case lt.TYPE_BOOLEAN_RADIO:case lt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t=t,(0,l.isNil)(t)?t:ue(t)?be().text("Yes"):be().text("No");case lt.TYPE_DATE:return(0,l.is)(Number,t)&&(t=A(Number(t)).getTime()),(t=t)&&(Zu(t)?ec(t):be().date(t,s));case lt.TYPE_ACTIVENESS_DATE:case lt.TYPE_LOCAL_DATE:return(t=t)&&(Zu(t)?ec(t):be().date(t,s));case lt.TYPE_TIMESTAMP:return(t=t)&&(Zu(t)?ec(t):be().date(isNaN(t)?t:Number(t),u));case lt.TYPE_FILE:return(0,l.propOr)(null,"filename",t);case lt.TYPE_SELECT:{const e=n.options.find((0,l.propEq)("value",t));return(0,l.propOr)(null,"label",e)}case lt.TYPE_DOLLAR:return t=t,new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0}).format(t);default:return(0,l.is)(Object,t)?fv((0,l.propOr)(null,"lookupCode",t),(0,l.propOr)(null,"value",t)):t}})),_v={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 Av(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Nv=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){Av(e,t,r[t])}))}return e}({},i,{signal:r.signal})).finally((()=>{clearTimeout(a)}))}return e(t,i)},Pv=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()}},Rv=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}}throw r})))),Sv=e=>{const{onRequest:t,onResponse:r,addRequestInterceptor:n,addResponseInterceptor:i,removeRequestInterceptor:a,removeResponseInterceptor:o}=(()=>{const e={onRequest:[],onResponse:[]};return{onRequest:t=>{const{url:r,options:n,abort:i,resolve:a}=t,o=e.onRequest.reduce(((e,t)=>(r,n)=>t({url:r,options:n,abort:i,next:e,resolve:a})),t.next);o(r,n)},onResponse:t=>{const{response:r,abort:n,url:i,options:a}=t,o=e.onResponse.reduce(((e,t)=>r=>r instanceof Response?t({response:r,abort:n,next:e,url:i,options:a}):e(r)),t.next);o(r)},addRequestInterceptor:t=>{e.onRequest.push(t)},addResponseInterceptor:t=>{e.onResponse.push(t)},removeRequestInterceptor:t=>{const r=e.onRequest.indexOf(t);e.onRequest.splice(r,1)},removeResponseInterceptor:t=>{const r=e.onResponse.indexOf(t);e.onResponse.splice(r,1)}}})(),s=(0,l.pipe)(Nv,(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),Pv,Rv);let u=0,c=[];return{request:(e,n)=>{const i=s(fetch);if(null!=n&&n.noRequestProcessor)return i(e,n);const a=()=>{const a=r?(e,t)=>i(e,t).then((n=>new Promise(((i,a)=>{r({response:n,next:e=>{i(e)},abort:a,url:e,options:t})})))):i;return t?new Promise(((r,i)=>{t({url:e,options:n,next:(e,t)=>{r(a(e,t))},resolve:e=>{r(e)},abort:i})})):a(e,n)};if(u){const{delayedRequest:e,resolver:t}=(e=>{let t;const r=new Promise((e=>{t=()=>{e(null)}})).then((()=>e()));return{delayedRequest:r,resolver:t}})(a);return c.push(t),e}return a()},addRequestInterceptor:n,addResponseInterceptor:i,startInterceptorInit:()=>{u+=1},finishInterceptorInit:()=>{u=Math.max(u-1,0),0===u&&(c.forEach((e=>e())),c=[])},removeRequestInterceptor:a,removeResponseInterceptor:o}},wv="__metadata",Iv=(e=>{const t=[wv,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),Uv=(0,l.set)(Iv),Cv=(0,l.view)(Iv),Dv=Uv(En.NEW),jv=Uv(En.REMOVED),Lv=Uv(En.EDITED),kv=Uv(En.IGNORED),Fv=(0,l.pipe)(Cv,(0,l.equals)(En.REMOVED)),Mv=(0,l.pipe)(Cv,(0,l.equals)(En.NEW)),xv=(0,l.pipe)(Cv,(0,l.equals)(En.EDITED)),$v=(0,l.pipe)(Cv,(0,l.complement)(l.isNil)),Vv=(0,l.pipe)(Cv,(0,l.equals)(En.IGNORED)),Gv=(0,l.omit)([wv]),Wv=(e,t)=>e===wv?void 0:t;function Bv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Yv=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=Yv(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},qv=(e,t)=>Yv((0,l.propEq)("nodeId",t),e),Hv=(e,t)=>Yv((0,l.pathEq)(["entity","uri"],t),e),Qv=(e,t)=>{const r=qv(e,t);return r.length>1?r[r.length-2]:null},Kv=(e,t)=>{const r=qv(e,t);return r.length>0?r[r.length-1]:null},Jv=(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=>Jv(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},Xv=()=>{},zv=(e,t)=>{let{parent:r,nodeProcessing:n=Xv}=t;n(e,r),e.children&&e.children.forEach((t=>zv(t,{parent:e,nodeProcessing:n})))},Zv=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case Fe.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 Fe.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 Fe.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){Bv(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})}}},eg=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&&zv(r,{nodeProcessing:r=>{const n=(0,l.path)(["editingConnections",(0,l.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===Fe.addingChild||r.editingMode===Fe.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=Zv({node:r,connection:n,isReversed:i}),s=Cp({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===Fe.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=Zv({node:r,isReversed:i,connection:n}),l=s?kp({entityUri:o,newEntityUri:s,relation:a,isReversed:i}):Lp({oldRelation:e,newRelation:a});t.push(l)}}})})),t},tg=(e,t)=>{if((0,l.path)(["entity","uri"],e)===t)return!0;if(e&&e.children)for(const r of e.children){const e=tg(r,t);if(e)return e}return!1},rg=(0,l.curry)(((e,t)=>{const r=(0,l.map)(rg(e));return(0,l.evolve)({entity:t=>t.uri===e.uri?e:t,children:r},t)})),ng=(e,t)=>{const r=(0,l.pipe)(Object.entries,(0,l.filter)((t=>{let[,r]=t;return r.root&&((e,t)=>tg(t,e.uri))(e,r.root)}))),n=(0,l.map)((t=>{let[r,n]=t;return{id:r,root:rg(e,n.root)}}));return(0,l.pipe)(r,n)(t)},ig={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},ag={asc:"asc",desc:"desc"},og=ig.entityLabel,sg=ag.asc,lg=(0,l.always)(0),ug=e=>{let{sortField:t=og,sortOrder:r=sg,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 UN.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 UN.strings.sort(e,i,a)})(r);default:return lg}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},cg=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values(ag)),l.identity,(0,l.always)(sg))),pg=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(ig)),l.identity,(0,l.always)(og)));var dg=r(91104);let yg;const fg=(e,t)=>(yg||(yg=dg.createClient({key:t})),new Promise((t=>{yg.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)}))}))),Tg=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,l.is)(Object,t)&&(t=""),t},Eg=(e,t)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(_s).flatMap((e=>{let r;return e.type==t&&(r=[Tg(e)]),(0,l.is)(Object,e.value)&&(r=(r||[]).concat(Eg(e.value,t))),r})),mg=e=>e&&e.length>0,hg=(e,t)=>[].concat(e&&e.attributes?Eg(e.attributes,t):[]).filter(l.identity);function bg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Og=(e,t,r,n,i,a)=>{if(e&&e.type){const t=Jr(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){bg(e,t,r[t])}))}return e}({},e,{attributes:{[i]:[n]}}));const a=(t.geoLocationAttributes||[]).map((t=>{return r=hg(e,t.latitude),n=hg(e,t.longitude),mg(r)&&mg(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(mg(t)&&t[0].value&&mg(r)&&r[0].value)return{id:e.uri,lat:Number(t[0].value),lng:Number(r[0].value)}})).filter(l.identity);if(e.length>0)return Promise.resolve(e)}return n&&n.label?fg(n.label,a).catch((()=>null)):Promise.resolve(null)},vg=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=Jr(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 Og(a,o,e,s,u,r).then((e=>!e&&a.label&&""!==a.label?fg(a.label,r).catch((()=>null)):e)).then((e=>ie(e).filter(l.identity).map((e=>({id:e.id||n,label:i,entity:a,point:e}))))).catch((()=>null))}))).then((e=>e.flat(1/0).filter(l.identity)))},gg=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=Jr(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(mr(e,r.latitude,t.type)&&mr(e,r.longitude,t.type)){const e=hg(t,r.latitude),n=hg(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))},_g=(e,t,r)=>Promise.all([gg(e,t),vg(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 Ag(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){Ng(e,t,r[t])}))}return e}function Ng(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Pg=(e,t)=>t.values.map(go(e,t.entityTypeUri)),Rg=(e,t,r)=>pl(t.fieldName,r)||mr(e,xt(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),Sg=(e,t)=>{const r=(0,l.propOr)([],"values",t),n=(0,l.path)([t.attrType.lookupCode],e);return(0,l.map)((e=>{const t=(0,l.prop)(e,n);return t?fv(e,t):e}),r)},wg=(0,l.path)(["attrType","label"]),Ig=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>Ag({},e,{[t]:!0})),{});e[r]=e[r]?Ag({},e[r],n):n}return e}),{}),Ug=(0,l.pipe)((0,l.prop)("values"),E),Cg=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",Cn.type.name)),Dg=e=>e.type===kg.NUMERIC_RANGE_FACET,jg=e=>e.type===kg.DATE_RANGE_FACET,Lg=(0,l.either)(Dg,jg),kg={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},Fg=e=>{switch(null==e?void 0:e.name){case Cn.type.name:return kg.ENTITY_TYPE_FACET;case Cn.createdBy.name:case Cn.updatedBy.name:case Cn.sourceSystems.name:case Cn.tags.name:case Cn.roles.name:case Cn.matchRules.name:case Cn.MLRecommendedMatch.name:return kg.WITH_DROPDOWN_CHECKBOXES_FACET;case Cn.createdTime.name:case Cn.updatedTime.name:case Cn.startDate.name:case Cn.endDate.name:return kg.DATE_RANGE_FACET;case Cn.matches.name:case Cn.matchScore.name:return kg.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return kg.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return kg.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return kg.DATE_RANGE_FACET;default:return kg.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},Mg=(0,l.pipe)(Rg,Fg),xg=(0,l.pipe)((0,l.path)(["attrType","type"]),Rr),$g=(0,l.cond)([[Dg,(0,l.always)(an.IN_RANGE)],[jg,(0,l.always)(an.WITHIN)],[(0,l.allPass)([xg,e=>e.values.length>=2]),(0,l.always)(an.EXISTS)],[l.T,(0,l.always)(an.EQUALS)]]),Vg=(0,l.cond)([[jg,(0,l.prop)("values")],[Dg,(0,l.prop)("values")],[xg,e=>1===e.values.length?e.values.map(ue):[]],[(0,l.pipe)((0,l.path)(["values",0]),Array.isArray),(0,l.prop)("values")],[l.T,e=>[e.values]]]);function Gg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Wg=(0,l.pipe)((0,l.path)(["attrType","type"]),vr),Bg=(0,l.pipe)((0,l.path)(["attrType","type"]),Ar),Yg=(0,l.pipe)((0,l.prop)("attrType"),yl),qg=(0,l.pipe)((0,l.prop)("attrType"),dl),Hg=e=>t=>t.values.map((t=>Jr(e,t).label)).join(" , "),Qg=(0,l.when)((0,l.propSatisfies)((0,l.gt)(l.__,1),"length"),(0,l.join)(" – ")),Kg=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(be().number),Qg)),(0,l.join)(","))(e.values);return`${wg(e)}: ${t}`},Jg=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(w),Qg)),(0,l.join)(","))(e.values);return`${wg(e)}: ${t}`},Xg=e=>t=>`${wg(t)}: ${Pg(e,t).join(", ")}`,zg=e=>t=>{const r=Sg(e,t);return`${wg(t)}: ${r.join(", ")}`},Zg=(0,l.curry)(((e,t,r)=>(0,l.map)((0,l.cond)([[qg,Hg(e)],[Bg,Kg],[Wg,Jg],[Yg,Xg(e)],[l.T,zg(t)]]),r))),e_=(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){Gg(e,t,r[t])}))}return e}({},t,{attrType:Rg(e,t,n)}))),Zg(e,r))(t),t_=new RegExp(`^${be().text("Search")}`),r_=(e,t,r,n)=>{let{uiState:i}=t;const{facets:a,keyword:o,advanced:s,readableQuery:u}=i;return(0,l.isEmpty)(s)?[...e_(e,a,r,n),...o?[o.value]:[]]:[(0,l.replace)(t_,"",u)]},n_=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values)(fn),i_=e=>(e=>n_.reduce(((e,t)=>{const r=new RegExp(`'{0,1}${encodeURIComponent("${")}${t}${encodeURIComponent("}")}'{0,1}`,"g"),n=new RegExp(`'{0,1}${encodeURIComponent("${")}now${encodeURIComponent("}")}'{0,1}`,"g"),[i,a]=rc(t);return e.replace(r,i).replace(n,a)}),e))(e),a_=(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}`})),o_={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},s_=e=>[o_.geoPolygon,o_.onMapMove].includes(e),l_=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},u_=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},c_=(e,t)=>s_(e)?t.map(l_):[u_(t)],p_=e=>s_(e)?be().text("Geo Polygon"):be().text("Geo Location"),d_=e=>{switch(e){case o_.geoLocation:return"geoLocation";case o_.geoPolygon:case o_.onMapMove:return"geoPolygon"}},y_={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},f_=e=>be().text(e),T_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[an.EQUALS]:"=",[an.NOT_EQUALS]:"≠",[an.STARTS_WITH]:"*",[an.MISSING_VALUE]:be().text("missing value"),[an.HAS_ALL]:be().text("has all"),[an.IN_RANGE]:be().text("in range"),[an.FULL_TEXT]:be().text("full text"),[an.EXISTS]:be().text("exists"),[an.COUNT_EQUALS]:`${be().text("count")} =`,[an.COUNT_NOT_EQUALS]:`${be().text("count")} ≠`,[an.COUNT_LT]:`${be().text("count")} <`,[an.COUNT_LTE]:`${be().text("count")} <=`,[an.COUNT_GT]:`${be().text("count")} >`,[an.COUNT_RANGE]:be().text("count range"),[an.LT]:"<",[an.LTE]:"<=",[an.GT]:">",[an.GTE]:">=",[an.IN_FILE]:be().text("in file"),[an.NOT_IN_FILE]:be().text("not in file"),[an.CONTAINS]:"~",[on.LIST_EQUALS]:"=",[on.NOT_LIST_EQUALS]:"≠",[on.LIST_EQUALS_CASE_SENSITIVE]:"=",[on.NOT_LIST_EQUALS_CASE_SENSITIVE]:"≠"}[e]||be().text(e.toLowerCase())},E_=e=>({type:y_.operator,text:e}),m_=e=>({type:y_.operator,text:f_(e)}),h_=e=>({type:y_.attributeLabel,text:e}),b_=e=>({type:y_.specialAttributeLabel,text:e}),O_=e=>({type:y_.attributeFilter,text:T_(e)}),v_=e=>({type:y_.attributeValue,text:e}),g_=e=>({type:y_.entityTypeLabel,text:e}),__=()=>({type:y_.space,text:" "}),A_=()=>({type:y_.bracket,text:"("}),N_=()=>({type:y_.bracket,text:")"}),P_=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),R_=(0,l.curry)(((e,t)=>t.map(P_(e)))),S_=(0,l.curry)(((e,t,r)=>[e,...r,t])),w_=S_(A_(),N_()),I_=S_(__(),__()),U_=(0,l.curry)(((e,t)=>[e,...t])),C_=e=>U_(g_(e)),D_=e=>U_(g_(`${e}: `)),j_=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=Uu(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=wu(s),a=Iu(s);!r&&t&&n&&(i.push(A_()),r=!0),i.push(o),r&&a&&(i.push(N_()),r=!1);const l=e?m_(s):E_(s);i.push(...I_([l]))}else i.push(o),r&&(i.push(N_()),r=!1)}return i}},L_=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),k_=(0,l.pipe)(j_({localizable:!1}),L_),F_=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},M_=e=>{let{data:t,values:r,filter:n}=e;return t&&Nc({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},x_=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(M_)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),$_=(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)&&yr(e.data.attrType)})(e)&&[an.HAS_ALL,an.EQUALS,an.NOT_EQUALS].includes(e.filter))),(0,l.map)((e=>({type:dr((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})))),Ov),V_=(e,t)=>(0,l.pipe)($_,vv(t))(e),G_=(0,l.pathEq)(["data","fieldName"],Cn.type.name),W_=(0,l.path)(["data","entityTypeUri"]),B_=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),Y_=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(ps(e)),attributes:(0,l.filter)((0,l.pipe)(W_,(0,l.anyPass)([l.isNil,ps(e),r=>{const n=(t.entityTypes||[]).filter(ps(e));return(n.length>1?tn(e,n):null)===r&&!!Jr(e,r)}])))})(t))))),q_=e=>(0,l.pipe)((0,l.prop)("filter"),Eu,(0,l.equals)(e)),H_=(0,l.curry)(((e,t,r,n,i,a)=>{const o=pl(n.fieldName)||n.attrType,s=Ju(o,i),u=gv({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>yr(s),()=>(0,l.is)(Object,a)&&a.lookupCode?fv(a.lookupCode,a.value):Ev(r,dr(o),a)],[()=>yl(s),()=>go(e,n.entityTypeUri,a)],[()=>fl(s),()=>Bo(e,a)],[()=>Ol(s),()=>Ho(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>Ar(c)||Rr(c)),Yu),v_)()})),Q_=(e,t,r,n)=>{const i=H_(e,t,r,n.data,n.filter);return(0,l.cond)([[q_(0),(0,l.always)([])],[(0,l.both)(q_(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[__(),i(r),{type:y_.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[__(),...(0,l.pipe)(l.flatten,(0,l.map)(i),R_({type:y_.punctuationMark,text:", "}))(t)]}]])(n)},K_=(e,t)=>{const r=!!pl(e.data.fieldName);return(0,l.pipe)(F_,r?b_:h_)(e,t)},J_=(e,t,r,n,i)=>[K_(n,i),__(),O_(n.filter),...Q_(e,t,r,n)],X_=(0,l.addIndex)(l.map),z_=(0,l.propEq)("length",1),Z_=(0,l.propSatisfies)((0,l.lt)(1),"length"),eA=(0,l.complement)(l.isEmpty),tA=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)(ju,(0,l.filter)(M_),Lu,(0,l.map)((n=>({operand:J_(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,j_()))(n)},rA=(0,l.pipe)(tA,l.flatten),nA=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>hp(e,{type:t}))).join(", ");return r?t(r):l.identity},u=tA(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(C_),(0,l.pipe)(s(D_),(0,l.unless)((()=>z_(u)||i),w_)))(u)},iA=(e,t,r,n)=>(0,l.pipe)(ju,(0,l.filter)(x_),Lu,X_(((n,i,a)=>({operand:nA(e,t,r,n,z_(a)),operator:n.operator}))),j_(),l.flatten)(n),aA=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),j_(),l.flatten),oA=e=>{let{searchType:t,values:[r]}=e;return c_(t,r).join(", ")},sA=(e,t,r,n,i,a)=>{const o=(e=>e?[b_(e.isRawFilter?be().text("Raw filter"):be().text("Search")),...I_([O_(an.EQUALS)]),v_(`"${e.value}"`)]:[])(i),s=(e=>e?[b_(p_(e.searchType)),__(),v_(oA(e))]:[])(a),u=(0,l.pipe)(iA,(0,l.when)((e=>Z_(e)&&(eA(o)||eA(s))),w_))(e,t,r,n);return aA([o,s,u])},lA=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),uA=(0,l.pipe)(sA,lA),cA=(0,l.has)("attributes"),pA=Array.isArray,dA=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),yA=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=fA(e,t,r,a,i);return(0,l.when)((0,l.always)((0,l.complement)(l.isNil)(o)),(0,l.pipe)((0,l.when)((0,l.always)((0,l.not)(dA(a))),w_),(0,l.concat)(I_([E_(o)]))))(s)},fA=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return cA(n)?yA(e,t,r,n,i):pA(n)?n.reduce(((n,a)=>n.concat(fA(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(I_([E_(n.operator)])))(J_(e,t,r,n,i))},TA=(e,t,r,n,i)=>(0,l.pipe)(fA,l.flatten)(e,t,r,n,i);function EA(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){mA(e,t,r[t])}))}return e}function mA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hA=(0,l.complement)(G_),bA=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(G_),(0,l.map)((0,l.prop)("values")),l.flatten,l.uniq)(e),r=(0,l.pipe)((0,l.map)(W_),(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}},OA=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=bA(t);return(r||n)&&Cu(t)},vA=(0,l.ifElse)((0,l.all)((0,l.has)("entityTypes")),l.identity,(0,l.pipe)((e=>{const t=[],r=e.filter((0,l.complement)(OA)),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(G_).some((0,l.propEq)("filter",an.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}=bA(r);if(OA(e))t.push(EA({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter(hA)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(G_,(0,l.pipe)((0,l.prop)("values"),l.flatten),(0,l.pipe)(W_,(e=>[e]),(0,l.reject)(l.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(hA),entityTypes:n,operator:i?a:e.operator,id:ZO()()}}));t.push(...n)}var a;return t})(t))),[]))),gA={[an.EQUALS]:an.ON,[an.IN_RANGE]:an.WITHIN,[an.GTE]:an.AFTER,[an.GT]:an.AFTER,[an.LTE]:an.BEFORE,[an.LT]:an.BEFORE},_A=(0,l.curry)((e=>gA[e]||e)),AA=(0,l.curry)(((e,t)=>{switch(e){case an.LT:return[f()(t[0]).subtract(1,"day").valueOf()];case an.GT:return[f()(t[0]).add(1,"day").valueOf()];default:return t}})),NA=(0,l.pipe)((0,l.path)(["data","attrType","type"]),vr),PA=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>EA({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return NA(e)?(0,l.evolve)({filter:_A,values:AA(t)},e):e}))})))})),RA=(0,l.evolve)({values:(0,l.when)((0,l.pipe)((0,l.prop)(0),zu),(0,l.map)(rc))}),SA=(0,l.map)((0,l.cond)([[NA,RA],[l.T,l.identity]])),wA=(0,l.curryN)(3,((e,t,r,n,i)=>(0,l.pipe)((0,l.defaultTo)([]),vA,Y_(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")),SA)})),PA,(0,l.reject)(B_))(r)));function IA(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){UA(e,t,r[t])}))}return e}function UA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const CA=(e,t)=>({data:{uri:Wt(e.fieldName)?xt(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||$g(e),id:ZO()(),values:Vg(e)}),DA=(0,l.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=pl(a,t,r)||mr(e,i);if(!s)return null;if(nr(s))return IA({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=hp(e,{type:o}),i=(Er(e,xt(a,o),o)||[]).map((0,l.pick)(["label","name"])).slice(0,-1);return IA({},n,{attrType:s,title:t,pathToTitle:Array.isArray(i)?[r,...(0,l.chain)((0,l.prop)("label"),i),t]:[r,t]})}})),jA=(0,l.curry)(((e,t,r,n)=>wA(DA,e,n,t,r)));function LA(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){kA(e,t,r[t])}))}return e}function kA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const FA=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},MA=e=>"rdmLookups.not.resolved"===e?Cn.notResolved.name:e,xA=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===cn?an.IN_RANGE:pn(a),u=MA(n),c=pl(u)||mr(e,i),p=(0,l.cond)([[()=>Ou(s),(0,l.map)((0,l.when)((0,l.both)((0,l.has)("link"),(0,l.complement)((0,l.has)("filename"))),(e=>LA({},e,{filename:pv(e)}))))],[()=>Rr(null==c?void 0:c.type),(0,l.map)(ue)],[e=>hu(s)&&!Array.isArray(e[0])&&!vr(null==c?void 0:c.type),ae],[l.T,l.identity]])(o);return{id:ZO()(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===cn?"and not":"and",filter:s,values:p}})),$A=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(xA(e,tn(e,i)));return[{id:ZO()(),operator:"or",attributes:a,entityTypes:i}]})),VA=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),GA=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([VA("from"),VA("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,()=>[]]]),WA=(e,t)=>{const r=(0,l.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return LA({},r,{values:GA(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?ol(e.fieldName,n):e.fieldName})},BA=(e,t)=>{if((0,l.has)("children")(e)){const r=WA(e,t);return e.children.reduce(((e,n)=>(e.push(BA(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return WA(e,t)},YA=(0,l.cond)([[(0,l.has)("searchParameters"),e=>{const t=[];return(0,l.has)("values",e)&&t.push(WA(e)),(0,l.propOr)([],"searchParameters",e).forEach((r=>t.push(LA({fieldName:e.fieldName},WA(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(BA,l.flatten)],[l.T,WA]]),qA=(0,l.pipe)((0,l.map)(YA),l.flatten),HA=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},QA=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=$A(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:qA(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>LA({},t,{type:Mg(e,t)}))).map((e=>LA({},e,{values:Lg(e)?HA(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 CA(r,t)})),operator:"or",id:ZO()(),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=>({[MA(t)]:e[t]}))),l.mergeAll)(e)}(o),p=[LA({},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 jA(e,t,r,p)},KA=(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)(Ug),(0,l.partition)(Cg))(t),i=n.map((t=>IA({},t,{type:Mg(e,t)}))).map((e=>CA(e))),a=r.values||[];return[{attributes:i,operator:"or",id:ZO()(),entityTypes:a}]})(e,a);return jA(e,t,r,o)})(e,t,r,n):QA(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},JA=e=>"2.0"===e.version?e.keyword:FA(e),XA=e=>(0,l.pathEq)(["object","uri"],e),zA=(e,t)=>(0,l.pipe)((0,l.find)(XA(e)),(0,l.prop)("object"))(t),ZA=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"),XA(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=zA(r.match,t)||n[r.match];return i?{label:Xc((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return vo(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)},eN=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,l.pick)(["uri","type","label"],r),e}),{}),tN=(0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)]),rN=(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:Xc((0,l.prop)("label",o)),matchRules:i.concat(a).map((function(t){return vo(e,o.type,t)||{label:t,uri:t}}))}})))(t),nN=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.map)((0,l.prop)("shortestTransitiveMatchPath")),l.flatten,(0,l.filter)(l.identity),(0,l.map)((0,l.prop)("match")),l.uniq);return t(e)},iN=(0,l.path)(["object","uri"]),aN=e=>{let t=[];return{addChild:e=>{t=(0,l.append)(e,t)},getValue:()=>e,getChildren:()=>t,removeChild:e=>{t=(0,l.without)([e],t)}}},oN=e=>e.getValue(),sN=(e,t)=>{let r=null;if(t(e.getValue()))return e;const n=e.getChildren();for(let e=0;e<n.length&&(r=sN(n[e],t),!r);e++);return r},lN=(e,t)=>{const r=[],n=(0,l.pipe)(oN,t),i=(0,l.pipe)(l.map,l.flatten),a=e.getChildren();a.some(n)&&r.push(e);const o=i((0,l.partialRight)(lN,[t]),a);return r.push.apply(r,o),r};function uN(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){cN(e,t,r[t])}))}return e}function cN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pN=(e,t)=>!!e[t],dN=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},yN=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return 0===t.length&&e?e:(0,l.uniqBy)(r,[...t,...e||[]])},fN=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return uN({},t,{[r.uri]:uN({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:yN(null==o?void 0:o.parents,n),children:yN(null==o?void 0:o.children,i),values:yN(null==o?void 0:o.values,a,(0,l.prop)("uri"))})})},TN=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=Jr(r,t)||Pi(r,t),i=(0,l.either)((0,l.both)((0,l.prop)("dependentLookupAttributes"),(0,l.prop)("dependentLookupCode")),(0,l.prop)("children"));return es(r,n,i).flatMap(rs).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>mr(r,e))).filter(l.identity).filter((0,l.prop)("dependentLookupCode"));return(e=>{let{structure:t,parentAttrType:r,childrenAttrTypes:n}=e;const i=n.map((0,l.prop)("uri")),a=fN({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>fN({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},EN=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!Rt(e.uri)&&Dt(e.type)&&Dt(t)&&!t.startsWith(e.type))(n,t))return e;const i=Ms(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(_s),(0,l.map)(dN))(i);return fN({structure:e,attrType:e[t].attrType,values:a})}),t)},mN=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 pN(e,r)}));return r||n?t.filter(_s).reduce(((e,t)=>mN({structure:e,attributeValue:t})),e):e}),t);{const e=r;return pN(t,e.type)?fN({structure:t,attrType:t[e.type].attrType,values:[dN(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)}))?uN({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},bN=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=Ms(i,n,r)||[];return a.length?fN({structure:t,attrType:t[r].attrType,values:a.filter(_s).map(dN)}):t},ON=(e,t,r)=>{const n=It(e),i=It(t);return n===i?((e,t)=>{const r=qt(t),n=qt(e);return Lt(n,r)||((e,t)=>Bt(e)&&!Bt(t)&&Lt(t,e))(n,r)})(e,t):!(!r||!Yt(t))&&Hm(r,i).includes(n)},vN=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},gN=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?Ym(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return ON(r,t,o)}))},_N=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>_N(e,t,r)))))},AN=(e,t,r,n)=>{let{uri:i,value:a}=r;return{type:e,uri:i,lookupValue:a,autopopulate:i!==t&&vN(n,e)}},NN=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s}=e;const l=t[r],u=It(n),c=qm(u,o,i,a),p=_N("children",t,l),d=_N("parents",t,l),y=p.flatMap((e=>_N("parents",t,e))).filter((e=>![...d,l,...p].includes(e))),f=p.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return ON(t,n,c)})).map((t=>AN(e.attrType.uri,n,t,s)))));if(!f.length)return[];const T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return ON(n,t,c)||It(t)!==u&&ON(t,n,c)})).map((t=>AN(e.attrType.uri,n,t,s))))),E=y.flatMap((e=>{const r=_N("children",t,e).map((e=>{let{attrType:t}=e;return t.uri}));return e.values.filter((e=>{let{uri:t}=e;return f.some((e=>{let{uri:n,type:i}=e;return r.includes(i)&&ON(n,t,c)}))})).map((t=>AN(e.attrType.uri,n,t,s)))}));return[...l.values.filter((e=>{let{uri:t}=e;return ON(t,n,c)})).map((e=>AN(r,n,e,s))),...T,...E,...f]},PN=async e=>{let{attributeType:t,attributePresentations:r,value:n}=e;const i=gv({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=>Kc(e,t.dataLabelPattern))),o=e=>Object.values(e[0])[0],s=(0,l.pipe)(o,i),u=(0,l.cond)([[sr,()=>a(n)],[yr,()=>(e=>{const r=o(e),n=dr(t);return ou([{codeValue:r,type:n}]).then((e=>{if(Array.isArray(e))return Ev(e[0],n,r)}))})(n)],[l.T,()=>s(n)]]);return await u(t)},RN=e=>{let{value:t,attributeType:r,entityType:n=""}=e,i=[{fieldName:"type",filter:an.EQUALS,values:[n]}];return Array.isArray(t)?i=i.concat(SN(r,t)):i.push(wN([t],r)),i},SN=(e,t)=>{const r=ir(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=sr(i)?SN(i,t[r]):[wN(t[r],i)];return e.push(...a),e}}),[])},wN=(e,t)=>e&&e.length&&!(0,l.isNil)(e[0])&&""!==e[0]?{fieldName:pr(t.uri),filter:t.type===lt.TYPE_BLOB?an.FULL_TEXT:an.EQUALS,values:e}:{fieldName:pr(t.uri),filter:an.MISSING_VALUE},IN={AttributesDiff:o,AttributesEditor:a,HistoryManager:s},UN={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=7140.js.map