@reltio/remotes 1.4.1423 → 1.4.1425

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/3937.js +1 -1
  2. package/3937.js.map +1 -1
  3. package/package.json +1 -1
package/3937.js CHANGED
@@ -1,2 +1,2 @@
1
- (self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[3937],{27950:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>zs,IL3:()=>rd,PY2:()=>bn,Ng6:()=>Pe,YJ7:()=>dn,NlI:()=>en,XYV:()=>un,Xt7:()=>ve,wfT:()=>ri,EMD:()=>Bn,HAc:()=>ge,PEf:()=>An,oA3:()=>Wn,$XE:()=>Ge,eWf:()=>gn,q7e:()=>_e,KVe:()=>ni,WVQ:()=>Rr,oZZ:()=>di,bNA:()=>yi,Rjq:()=>fi,G39:()=>Pn,W0P:()=>Xe,X1H:()=>Qe,hdG:()=>et,ws7:()=>tt,VI$:()=>Ze,yn8:()=>Me,N0y:()=>Fe,dZX:()=>We,bQt:()=>Ei,oS0:()=>nt,bZE:()=>sn,Nsj:()=>fn,psV:()=>pn,xPW:()=>On,pyR:()=>Jn,p8l:()=>qn,Wkf:()=>Oe,zHr:()=>be,NIO:()=>he,$26:()=>gg,Esk:()=>Mn,s9T:()=>je,MEy:()=>ku,j5E:()=>Zr,vAw:()=>Gn,NMQ:()=>Vn,eVu:()=>ec,YGb:()=>Je,mNm:()=>Qn,Y1q:()=>QE,s_5:()=>Xn,RgZ:()=>Hn,unl:()=>pi,Qy0:()=>Ti,pYu:()=>Fn,wIJ:()=>qg,GFH:()=>Se,Ury:()=>Rn,S91:()=>Sn,p3$:()=>Oi,wSh:()=>Z,BDP:()=>Ui,pGS:()=>Kn,ARY:()=>it,XGc:()=>ti,fO_:()=>$r,wwy:()=>Ce,h_8:()=>In,_XL:()=>yn,j2V:()=>ii,dMV:()=>Zn,NBX:()=>YA,OXy:()=>at,BXd:()=>xe,KM9:()=>Ne,CJB:()=>si,lXI:()=>qe,nqG:()=>hi,C68:()=>Nn,yxQ:()=>mi,Yj_:()=>De,D25:()=>Ie,ZIY:()=>Be,Tl4:()=>Zg,lwr:()=>_n,NkU:()=>ai,Rtp:()=>ei,YGx:()=>$e,uTS:()=>zn,MCv:()=>Ae,IYE:()=>Yn,PiC:()=>ci,MVv:()=>ze,h_m:()=>He,DUe:()=>ln,tJI:()=>Re,fDt:()=>we,cNQ:()=>oi,SwE:()=>xn,ZHR:()=>ui,PYu:()=>Ke,lD1:()=>wn,lVm:()=>Ve,vnX:()=>qv,$x5:()=>Hv,_R1:()=>Bv,wUm:()=>Yv,z7V:()=>bi,dC6:()=>ke,MBD:()=>Ue,GmF:()=>ua,cKm:()=>Ye,iP_:()=>vn,NVC:()=>Le,tPT:()=>Nl,tZe:()=>bd,kRE:()=>Rf,psB:()=>Sf,X0$:()=>Al,zE1:()=>jl,Wm5:()=>fl,vyX:()=>kc,wLZ:()=>Pl,W4V:()=>se,EtK:()=>Ds,Wtd:()=>_l,asT:()=>nN,kGs:()=>vm,ewt:()=>pE,O_f:()=>wu,sOy:()=>It,Tde:()=>or,LMI:()=>bc,skb:()=>G_,sPt:()=>cc,sH1:()=>pc,RPM:()=>Gm,h27:()=>wc,Uqd:()=>jc,xG:()=>tA,Z2f:()=>sv,fgW:()=>g_,I69:()=>H_,ZxB:()=>K_,mdt:()=>Fm,Qbq:()=>sm,rny:()=>qi,UEY:()=>Ia,Q0T:()=>wa,Lyr:()=>Fa,sBn:()=>Sa,itK:()=>Aa,H9$:()=>Ra,KPc:()=>Pa,zos:()=>Na,ELQ:()=>Ma,dZs:()=>fa,Cz4:()=>ya,z_L:()=>ja,fGe:()=>da,iuF:()=>ga,Wib:()=>_a,Hn0:()=>ka,obS:()=>xa,E$L:()=>Ta,XUh:()=>va,Qp_:()=>ba,_jk:()=>Ea,sKE:()=>ma,WmG:()=>Oa,QKx:()=>Da,Oik:()=>Ca,s0A:()=>ha,o9m:()=>Ua,MCd:()=>La,RsS:()=>Ic,tGK:()=>iu,lIv:()=>kl,Vg3:()=>Zi,mkC:()=>$i,xv5:()=>ta,a14:()=>Gi,yv0:()=>ea,Zm0:()=>Vi,Nxd:()=>xi,$mM:()=>zi,ifj:()=>wr,NWi:()=>Pv,xr3:()=>Nv,wNf:()=>fu,iJH:()=>Rv,d89:()=>ki,Edd:()=>Fi,Z5t:()=>Mi,uGe:()=>Di,UoR:()=>Ci,xvW:()=>Av,$qe:()=>_v,yPM:()=>pa,$cp:()=>Ll,vKJ:()=>Cl,VtG:()=>dp,AID:()=>NT,B1H:()=>WA,b7X:()=>im,$uE:()=>Am,keo:()=>om,C_p:()=>Nh,G27:()=>Db,JA0:()=>Ef,b3T:()=>Om,oC6:()=>hm,_Zs:()=>bm,epC:()=>Pm,YYG:()=>Nm,f_2:()=>hf,w3l:()=>NA,QHB:()=>Cb,Jso:()=>CA,RXH:()=>mb,Vr9:()=>Gb,lMm:()=>xO,BlA:()=>yN,fmQ:()=>Ns,yRD:()=>dA,NcL:()=>Uh,QK6:()=>ye,ymd:()=>td,JV_:()=>Wf,XiW:()=>BT,Yrx:()=>rf,GPx:()=>gl,gjI:()=>vl,vlo:()=>wE,E_P:()=>Um,aAL:()=>Gp,NBq:()=>Ps,wp9:()=>km,DsR:()=>kp,MPc:()=>IT,gWE:()=>UT,DT_:()=>CT,ipn:()=>LT,ORg:()=>Ri,_wz:()=>DT,RYR:()=>oE,PP2:()=>lf,wS7:()=>fv,cBQ:()=>Op,pBq:()=>uT,DsO:()=>ee,X78:()=>Yf,xZs:()=>xf,YFy:()=>af,Gmt:()=>Cf,K$w:()=>Uf,DSj:()=>Wp,Mfr:()=>of,k9j:()=>gp,ww$:()=>Rl,WVU:()=>If,hxF:()=>El,n6p:()=>xr,E7G:()=>sy,nwO:()=>EN,Mzk:()=>Tp,aFF:()=>ym,HRH:()=>xu,EZK:()=>Ud,Kxm:()=>Rd,Z9i:()=>oh,CrF:()=>_f,DNd:()=>Va,vUy:()=>lN,lJh:()=>Gu,zHo:()=>Wu,sEJ:()=>HA,UO$:()=>TT,zeJ:()=>dr,dLR:()=>Fs,JQy:()=>Ks,XtP:()=>js,Ug0:()=>Jr,A1W:()=>am,sw:()=>Id,nv3:()=>jv,JgD:()=>Lv,nve:()=>QA,SkP:()=>Js,SAs:()=>pT,i5L:()=>Xs,PWK:()=>$o,IM5:()=>ks,Aup:()=>Vb,Mfk:()=>BO,HQx:()=>es,oN$:()=>Zo,mB6:()=>cv,p6d:()=>w,o0x:()=>U,ufS:()=>XO,k7L:()=>zO,mrB:()=>I,OuZ:()=>Cd,ncP:()=>At,W$R:()=>Dd,JOV:()=>ht,Zmi:()=>bt,hm5:()=>vt,ECL:()=>Cr,vPL:()=>Ld,qmL:()=>HE,hPi:()=>sT,hXd:()=>Qi,OCS:()=>Ki,p2l:()=>el,qF1:()=>nd,_X$:()=>id,yj2:()=>Gg,bzh:()=>$m,k66:()=>Jo,kiP:()=>po,pSg:()=>ce,kz_:()=>df,H_U:()=>zo,t9e:()=>Qa,j2$:()=>Od,PFL:()=>Kt,aJ3:()=>yg,To9:()=>sr,wpo:()=>ey,ADq:()=>th,UUb:()=>Zm,tQX:()=>eh,xy8:()=>Zt,EUG:()=>yr,AFK:()=>kt,X3M:()=>pr,WN0:()=>Xo,kDl:()=>Ms,uDV:()=>qE,IhQ:()=>Bs,pfb:()=>qs,R$r:()=>Im,w80:()=>So,Pfu:()=>qa,Gtj:()=>Kl,fyF:()=>Ql,kkq:()=>Ko,u5q:()=>Nt,O$n:()=>zd,ptG:()=>Zd,f4_:()=>$h,uap:()=>xh,d7q:()=>tf,liG:()=>uf,$oF:()=>ef,avf:()=>bE,DiQ:()=>hE,cfX:()=>mE,vD3:()=>vE,Qrb:()=>EE,EJQ:()=>OE,HWy:()=>TE,gjS:()=>uE,y6v:()=>fE,JUW:()=>bf,GtP:()=>Zh,_kX:()=>Wa,u1e:()=>Ba,sJj:()=>cm,CJp:()=>Xh,uKF:()=>um,wo0:()=>Pf,s5:()=>Wo,cwx:()=>Go,Y6b:()=>By,TTx:()=>kf,UtR:()=>Yy,HaQ:()=>Ff,E6I:()=>gf,Won:()=>Hy,vTU:()=>Gy,Nsy:()=>Gd,KMQ:()=>dm,Do$:()=>qd,CSV:()=>nl,TMe:()=>qy,l1V:()=>Yu,RHh:()=>Zu,VQ1:()=>Xu,cGG:()=>Ju,z7d:()=>IE,Xaq:()=>ns,Sj8:()=>pN,PJj:()=>tu,k3T:()=>zr,PjQ:()=>wi,s7l:()=>op,jLA:()=>eb,GGR:()=>NE,j5q:()=>_E,DnY:()=>np,RY5:()=>$E,Px$:()=>sE,KPC:()=>$A,NIY:()=>yp,HvW:()=>lp,Fof:()=>Ka,BXy:()=>up,fX:()=>tb,BTI:()=>Qd,uie:()=>Fd,q27:()=>ry,vrC:()=>tO,fAQ:()=>Kf,XkT:()=>rp,lrH:()=>Jf,nt9:()=>Yr,XH8:()=>Xd,XH2:()=>Xr,jFi:()=>Jd,qhs:()=>Ro,wwR:()=>Hd,Uk3:()=>Ft,$Rg:()=>Bt,ev7:()=>BA,RB9:()=>Tf,iFp:()=>Bm,e$p:()=>qm,PcX:()=>Hm,SpP:()=>Ym,R6_:()=>Tg,CY1:()=>_g,Ajk:()=>Xc,Yiz:()=>Jc,FK9:()=>Bc,UOo:()=>ZO,aTW:()=>Lf,uug:()=>yu,P$2:()=>Pg,XS2:()=>au,Hyb:()=>Nu,d3Y:()=>$c,Klp:()=>Gc,WxZ:()=>Rg,Gzu:()=>Bu,ZOr:()=>tp,uqV:()=>xy,Pm4:()=>re,hWO:()=>Dt,nHA:()=>Wh,nVD:()=>GE,_tF:()=>nc,dED:()=>zy,P2h:()=>Xy,jrr:()=>so,mmY:()=>uo,T6O:()=>ts,h6J:()=>Ed,hM2:()=>jA,XR6:()=>X,jmz:()=>YE,IHt:()=>BE,NZI:()=>ah,wdF:()=>Hf,YNv:()=>nm,IFm:()=>rm,o_F:()=>JE,kgP:()=>Qf,ZYI:()=>Xp,QXK:()=>Bl,efz:()=>Yl,Q5d:()=>Wl,Ysv:()=>ql,UWq:()=>DE,ocC:()=>CE,io3:()=>Qr,Sbt:()=>Io,roS:()=>wo,Ww1:()=>Uo,QaS:()=>Ep,ERZ:()=>_A,CL1:()=>kA,idV:()=>wd,nIW:()=>Ct,fjE:()=>Eg,sG0:()=>rv,tV7:()=>ru,g8o:()=>Xg,Qy:()=>Jg,t2P:()=>dg,KbW:()=>mo,wId:()=>bo,LS0:()=>Oo,bFH:()=>Py,Rgl:()=>Sy,fW1:()=>Ch,GFW:()=>Mf,Ywp:()=>$v,pg:()=>uy,WSA:()=>wy,fed:()=>DA,tT_:()=>Ys,BgZ:()=>Hs,xIV:()=>Qs,KbL:()=>ap,JBA:()=>Vt,aNC:()=>Dv,RFJ:()=>Jp,Zeh:()=>fT,OT5:()=>xv,mC3:()=>Ml,kR6:()=>dN,gFw:()=>Vh,NVY:()=>Lm,k6v:()=>ad,FEC:()=>od,L5S:()=>Cm,Ob5:()=>ny,KUV:()=>iy,dvH:()=>Dm,V3i:()=>Yb,VD3:()=>Kr,mm2:()=>Ku,rou:()=>nT,izH:()=>Ya,DK$:()=>Ha,KMp:()=>Vp,c31:()=>lt,mbo:()=>nh,gT8:()=>pt,CZ8:()=>_s,uGi:()=>ws,Poc:()=>ot,_9k:()=>Cs,ZTM:()=>Rs,bwT:()=>Is,tzW:()=>yt,tF$:()=>ct,o96:()=>As,M4S:()=>Us,_vs:()=>Lp,xF8:()=>cE,PUO:()=>fm,ATu:()=>rh,j1S:()=>Ni,V3K:()=>_i,Lmx:()=>Ai,oSN:()=>Ii,ZaZ:()=>st,n_1:()=>Vy,N6e:()=>Mp,SxO:()=>lo,w3p:()=>jm,xU7:()=>de,Y_p:()=>Lo,$k6:()=>Do,Gdl:()=>iv,U6P:()=>nv,OwB:()=>fg,hTh:()=>WE,xqc:()=>Bo,JvE:()=>Yo,i29:()=>Ac,dzT:()=>Bi,uPS:()=>bp,cZV:()=>hp,n3B:()=>w_,e6O:()=>__,s7j:()=>Yg,j$Q:()=>Of,kW2:()=>zh,tH7:()=>Vo,Yxg:()=>ll,MaZ:()=>AE,nqN:()=>gE,jWj:()=>jE,o_J:()=>is,yW4:()=>md,uT0:()=>fd,C82:()=>Td,bsH:()=>Gh,u9Z:()=>rT,J$m:()=>$y,j_Q:()=>qc,OaI:()=>Hc,wB1:()=>GA,SP6:()=>ly,ZYr:()=>xA,IMU:()=>Kp,FoU:()=>mf,DVz:()=>uv,mxe:()=>R_,FHr:()=>dT,D1g:()=>iT,VO3:()=>Xv,de5:()=>Jv,Uw1:()=>Ee,J6q:()=>ih,XCe:()=>io,fbl:()=>Vv,Ir:()=>To,XQO:()=>Eo,QXb:()=>by,zXF:()=>KE,P8_:()=>Vf,iiD:()=>$p,MOC:()=>Oy,WF:()=>hy,xE1:()=>Si,idW:()=>tN,QWZ:()=>QO,YL3:()=>fp,Fn9:()=>T,j2U:()=>Zs,MpE:()=>ft,kQw:()=>Xt,mfm:()=>Pu,vZp:()=>Mt,E8K:()=>XA,VSb:()=>vs,vr_:()=>Jt,Vmh:()=>sN,FgW:()=>Bb,oDv:()=>os,fGG:()=>KO,kuw:()=>ls,eHk:()=>LE,Tt2:()=>as,pQZ:()=>us,oZ7:()=>JO,T6Y:()=>gr,_26:()=>gu,YkM:()=>ar,J6y:()=>lu,njU:()=>Eu,TBP:()=>ss,IT0:()=>sh,x_:()=>pm,FP6:()=>Wt,biM:()=>Bd,TMl:()=>Yd,Vkd:()=>bu,WiY:()=>Og,_zi:()=>Ou,J6D:()=>Qu,Lt4:()=>Er,QEi:()=>ur,whI:()=>Gr,KIu:()=>Br,JhM:()=>oe,C_0:()=>Nr,lzc:()=>oy,qIF:()=>I_,O27:()=>E,aBi:()=>ty,xOX:()=>yl,EdS:()=>St,WgC:()=>Rt,eEv:()=>Ht,A4t:()=>mu,YOQ:()=>$t,Wos:()=>Or,jWr:()=>$a,Or$:()=>ir,lhE:()=>Hr,CwH:()=>lr,pzC:()=>cl,ymH:()=>Tu,QZu:()=>rr,rYH:()=>bg,FVt:()=>br,Kn2:()=>ue,jgw:()=>Ru,Qgr:()=>Hu,OXP:()=>Os,lS4:()=>cr,g5f:()=>vg,fp6:()=>pu,Uty:()=>ia,YkG:()=>nr,xdS:()=>dt,kMF:()=>jT,$NE:()=>wt,bC9:()=>Pt,Ian:()=>Pi,KVV:()=>lm,q9e:()=>Co,iIf:()=>av,ian:()=>ml,m6e:()=>Pr,OFd:()=>pl,kqr:()=>zt,fnZ:()=>Vr,VFZ:()=>hl,ZiX:()=>gt,j5n:()=>mr,zkt:()=>_,Pcm:()=>VA,QDV:()=>ul,M5u:()=>hg,laD:()=>S_,mtq:()=>qt,CtB:()=>ov,CBv:()=>ae,I0t:()=>Ar,u1G:()=>SE,gk1:()=>N_,Bgb:()=>A_,uzs:()=>Wr,v0l:()=>sc,Zqp:()=>Qy,j0k:()=>xo,tCm:()=>jt,gmx:()=>ou,mOr:()=>Fu,TwZ:()=>zg,GyU:()=>kv,zGm:()=>dy,bMg:()=>Dy,EyD:()=>vv,FQA:()=>gv,fZN:()=>ky,xsF:()=>bv,Lxg:()=>Ov,O3l:()=>Ap,Wni:()=>_p,wRx:()=>wv,OxG:()=>_y,uJQ:()=>gy,qWg:()=>lv,i96:()=>cy,zhn:()=>Sv,G8q:()=>vi,Jct:()=>tE,A9Y:()=>te,Y5F:()=>TA,gxP:()=>le,c$P:()=>su,M7o:()=>Lc,BBN:()=>oo,ZBU:()=>J,UkJ:()=>vo,xkv:()=>$f,z$M:()=>rN,KAm:()=>ff,lCl:()=>PT,rkF:()=>Ph,IU6:()=>Nd,RGr:()=>h,aYu:()=>m,ije:()=>Zl,Buf:()=>xp,YLu:()=>zl,ct9:()=>ko,XkY:()=>Ly,T5R:()=>yy,uQS:()=>Fy,wcJ:()=>jo,d$I:()=>Sl,rSp:()=>Wd,Sx:()=>pp,Ilm:()=>Fl,Ki6:()=>Tl,VGk:()=>jp,sFD:()=>hb,eWN:()=>iN,dWE:()=>Bg,Lkd:()=>YT,aDL:()=>ET,yaA:()=>My,lOh:()=>oT,DBr:()=>ug,hK$:()=>nu,TZ_:()=>Ad,CMB:()=>U_,FU8:()=>cp,J$p:()=>OT,b5s:()=>bT,h2W:()=>Lt,SL_:()=>Zf,oUH:()=>pd,ck9:()=>fy,RAb:()=>rc,nL:()=>tv,k$p:()=>Ob,Xs0:()=>Xl,u7I:()=>aT,rxg:()=>Uu,bji:()=>Cu,oCZ:()=>vh,MjG:()=>Kv,FuV:()=>cd,$ju:()=>yd,t6d:()=>dd,m5F:()=>Te,sx:()=>aN,rSc:()=>pv,U10:()=>Qc,L8n:()=>wf,R9X:()=>Wy,rj2:()=>Bf,_C4:()=>vd,tCj:()=>Gf,uAg:()=>nf,wx9:()=>dE,KF3:()=>gd,ax9:()=>_d,HH7:()=>Fp,ufV:()=>sf,_6y:()=>vp,XTh:()=>Wv,AJo:()=>mp,Ixr:()=>vf,P6Y:()=>mN,Bd_:()=>mh,xkB:()=>Eh,W41:()=>tT,WkI:()=>eT,sSE:()=>Th,GMd:()=>Oc,jtL:()=>vc,Bxm:()=>bh,FVh:()=>ch,U_T:()=>Iy,FTe:()=>ie,VGB:()=>ne,Wfe:()=>Vu,Ls5:()=>$u,$bd:()=>Lu});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,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:()=>ds,editAttribute:()=>ys,editEndDate:()=>bs,editRoles:()=>Es,editStartDate:()=>hs,editTags:()=>ms,removeAttribute:()=>Ts});var o={};r.r(o),r.d(o,{applyCrosswalks:()=>vm,collectCrosswalksFromAttributes:()=>Am,compareActivenessAttributes:()=>Om,compareAttributes:()=>hm,compareImages:()=>bm,compareRoles:()=>Pm,compareTags:()=>Nm});var s={};r.r(s),r.d(s,{createHistoryManager:()=>wm});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"),L=(0,l.equals)("9999"),j=(0,l.test)(/^[az][az][az]$/),k=(0,l.test)(/^[az][az][az][az]$/),F=(0,l.test)(/^9+$/),M=(0,l.test)(/^[9az]+$/),x=(0,l.cond)([[C,(0,l.always)("M")],[D,(0,l.always)("MM")],[j,(0,l.always)("MMM")],[k,(0,l.always)("MMMM")],[M,(0,l.always)("Mo")],[l.T,(0,l.always)("MM")]]),$=(0,l.cond)([[C,(0,l.always)("D")],[D,(0,l.always)("DD")],[M,(0,l.always)("Do")],[l.T,(0,l.always)("DD")]]),V=(0,l.cond)([[C,(0,l.always)("y")],[D,(0,l.always)("YY")],[L,(0,l.always)("YYYY")],[F,(0,l.always)("YYYYYY")],[l.T,(0,l.always)("YYYY")]]),G=(e,t)=>(0,l.cond)([[(0,l.both)((0,l.always)(t),C),(0,l.always)("h")],[(0,l.both)((0,l.always)(t),D),(0,l.always)("hh")],[C,(0,l.always)("H")],[D,(0,l.always)("HH")],[l.T,(0,l.always)(t?"hh":"HH")]])(e),W=(0,l.cond)([[C,(0,l.always)("m")],[D,(0,l.always)("mm")],[l.T,(0,l.always)("mm")]]),B=(0,l.cond)([[C,(0,l.always)("s")],[D,(0,l.always)("ss")],[l.T,(0,l.always)("ss")]]),Y=/([9az]+)([^9az]+)*/g,q=e=>{const t=[...e.toLowerCase().matchAll(Y)];if(E(e)||t.length>0){const[,e="",r=""]=(0,l.propOr)([],0,t),[,n="",i=""]=(0,l.propOr)([],1,t),[,a="",o=""]=(0,l.propOr)([],2,t);return(0,l.join)("",[x(e),r,$(n),i,V(a),o])}return e},H=/(9+)([^9]+)*/g,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=>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)?Z.None():Z.Some(t(e))}),Z={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?Z.Some(e):Z.None()},fromNull:function(e){return null==e?Z.None():Z.Some(e)},fromUndefined:function(e){return void 0===e?Z.None():Z.Some(e)},fromEmpty:function(e){return E(e)?Z.None():Z.Some(e)}},ee=(e,t)=>{let r=null;return function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];const o=()=>{e.apply(this,i),r=null};r&&clearTimeout(r),r=setTimeout(o,t)}},te=(e,t)=>(r,n)=>{const i=t?(0,l.prop)(t):l.identity;return e.indexOf(i(r))-e.indexOf(i(n))},re=(0,l.when)((0,l.is)(Array),(0,l.prop)(0)),ne=e=>Array.isArray(e)?e:[e],ie=e=>[e],ae=e=>!!e&&["www.","http://","https://","ftp://","ftps://","smb://","data:"].some((t=>String(e).toLowerCase().startsWith(t))),oe=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase()),se=e=>oe(e=e||"")?`mailto:${e}`:!e.includes("://")&&(e.toLowerCase().startsWith("www.")||e.split(".").length>2)?`http://${e}`:e,le=(0,l.when)((0,l.is)(String),(e=>""===e?void 0:"true"===e.toLowerCase())),ue=e=>null!=e&&["object","function"].includes(typeof e),ce=function(e){const t=[],r=(e,n)=>{n=n||[];for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(Array.isArray(e)&&(i=parseInt(i,10)),ue(e[i])?r(e[i],n.concat(i)):t.push(n.concat(i)))};return r(e),t},pe=(0,l.when)((0,l.is)(Object),JSON.stringify),de=(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),pe)])),[(0,l.always)(t),(0,l.always)(t)],[l.T,pe]])(e)},ye=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)},fe=/[\n\r%#()<>?[\\\]^`{}|]/g,Te=e=>`data:image/svg+xml;utf8,${e.replace(/["']\);{0,}$/,"").replace(/'/g,'"').replace(/>\s{1,}</g,"><").replace(/\s{2,}/g," ").replace(fe,encodeURIComponent)}`,Ee=e=>`data:image/gif;base64,${e}`;var me=r(76665);let he,be,Oe,ve,ge,_e,Ae,Ne,Pe,Re,Se,we,Ie,Ue,Ce,De,Le,je,ke,Fe,Me,xe,$e,Ve,Ge,We,Be,Ye,qe,He,Qe,Ke,Je,Xe,ze,Ze,et,tt;var rt;!function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(he||(he={})),function(e){e.local="local",e.validationService="validationService"}(be||(be={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(Oe||(Oe={})),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"}(ve||(ve={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(ge||(ge={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch",e.RELATION_ATTRIBUTE="relationAttribute"}(_e||(_e={})),function(e){e.directed="directed",e.undirected="undirected",e.bidirectional="bidirectional"}(Ae||(Ae={})),function(e){e.asc="asc",e.desc="desc"}(Ne||(Ne={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(Pe||(Pe={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(Re||(Re={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}(Se||(Se={})),function(e){e.TABLE="table",e.List="list",e.MAP="map"}(we||(we={})),function(e){e.PROFILE="profile",e.MAP="map"}(Ie||(Ie={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(Ue||(Ue={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(Ce||(Ce={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(De||(De={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(Le||(Le={})),function(e){e.EXISTS="exists",e.MISSING="missing"}(je||(je={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(ke||(ke={})),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"}(Fe||(Fe={})),function(e){e.ENTITY_TYPE="entityLevel",e.ATTRIBUTE_TYPE="attributeLevel"}(Me||(Me={})),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"}(xe||(xe={})),function(e){e.IN="in",e.OUT="out"}($e||($e={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}(Ve||(Ve={})),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"}(Ge||(Ge={})),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"}(We||(We={})),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"}(Be||(Be={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}(Ye||(Ye={})),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"}(qe||(qe={})),function(e){e.CustomAction="CustomAction",e.ConsoleAppAction="ConsoleAppAction"}(He||(He={})),function(e){e.NEW="new",e.CLASSIC="classic"}(Qe||(Qe={})),function(e){e.ASC_BY_NAME="ascByName"}(Ke||(Ke={})),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"}(Je||(Je={})),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"}(Xe||(Xe={})),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"}(ze||(ze={})),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"}(Ze||(Ze={})),function(e){e.AWAITING_REVIEW="AWAITING_REVIEW",e.APPLIED="APPLIED",e.REJECTED="REJECTED"}(et||(et={})),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"}(tt||(tt={})),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"}(rt||(rt={}));const nt=rt;let it,at;!function(e){e.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}(it||(it={})),function(e){e.Saving="Saving",e.Cloning="Cloning"}(at||(at={}));const ot=(0,l.prop)("referencedEntityTypeURI"),st=(0,l.prop)("relationshipTypeURI"),lt=(0,l.prop)("referencedAttributeURIs"),ut=(0,l.curry)(((e,t)=>(0,l.pipe)(lt,(0,l.filter)((0,l.startsWith)(e)))(t))),ct=ut("configuration/relationTypes"),pt=ut("configuration/entityTypes"),dt=(0,l.pipe)((0,l.prop)("uri"),(0,l.startsWith)("configuration/relationTypes")),yt=(0,l.filter)(dt),ft=(e,t)=>!t||t.some((t=>t===e.uri)),Tt="1Tempo4rary",Et="1Tepmo4Rel",mt=(0,l.cond)([[l.isNil,(0,l.always)("")],[(0,l.test)(/[^/]$/),(0,l.concat)(l.__,"/")]]),ht=()=>`1Tempo4DCR${Date.now()+Math.round(1e3*Math.random())}`,bt=e=>`${e}/uri$$${Date.now()+Math.round(1e3*Math.random())}`,Ot=e=>()=>bt(e),vt=(e,t)=>{const r=mt(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return bt(n)},gt=e=>e&&e.includes("uri$$"),_t=Ot("entities"),At=Ot("relations"),Nt=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),Pt=(0,l.startsWith)("relations/"),Rt=(0,l.startsWith)("entities/"),St=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/entityTypes/")),wt=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/relationTypes/")),It=(0,l.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),Ut=(0,l.pipe)((0,l.split)("/"),l.head),Ct=(0,l.pipe)((0,l.split)("/"),l.last),Dt=e=>e.split(".").slice(0,2).join("."),Lt=(e,t)=>{const[r,...n]=e.split("."),i=n.join(`/${r}/`);return`${t||""}/${r+(i&&`/${i}`)}`},jt=(0,l.curry)(((e,t)=>`${e}/attributes/${t}`)),kt=(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("/")},Ft=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},Mt=(0,l.either)((0,l.startsWith)("attributes."),(0,l.startsWith)("analyticsAttributes.")),xt=e=>2===e.split("/").length,$t=e=>5===e.split("/").length,Vt=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},Gt=e=>e.replace(/uri\$\$/g,Tt),Wt=e=>e.includes("changeRequests/")&&e.includes("/changes/"),Bt=e=>e.split("/changes/")[1];function Yt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qt=(0,l.allPass)([(0,l.propSatisfies)((0,l.either)(l.isNil,St),"uri"),(0,l.prop)("faceted"),(0,l.propEq)("type",nt.TYPE_STRING)]),Ht=(0,l.has)("values"),Qt=(0,l.cond)([[(0,l.has)("dependentLookupCode"),(0,l.always)(nt.TYPE_DEPENDENT_LOOKUP)],[(0,l.has)("lookupCode"),(0,l.always)(nt.TYPE_LOOKUP)],[Ht,(0,l.always)(nt.TYPE_ENUM)],[qt,(0,l.always)(nt.TYPE_TYPEAHEAD)],[(0,l.propEq)("type",nt.TYPE_BOOLEAN),(0,l.always)(nt.TYPE_BOOLEAN_RADIO)],[l.T,(0,l.prop)("type")]]),Kt=(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){Yt(e,t,r[t])}))}return e}({},e,{type:Qt(e)})),(0,l.pick)(["type","values","lookupCode","uri","dependentLookupCode","singleValue"])),Jt=e=>!!e&&(!!e.autoGenerated&&e.type!==nt.TYPE_NESTED||!!e.parentAutoGenerated),Xt=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.test)(/\/analyticsAttributes\//)),zt=(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),Zt=e=>Xt(e)?"analyticsAttributes":"attributes",er=(0,l.propEq)("hidden",!0),tr=(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))),rr=tr(nt.TYPE_NESTED),nr=tr(nt.TYPE_REFERENCE),ir=tr(nt.TYPE_IMAGE),ar=(0,l.either)(rr,nr),or=(e,t)=>{const r=Xt(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(".")},sr=(0,l.either)((0,l.prop)("lookupCode"),(0,l.prop)("dependentLookupCode")),lr=(0,l.pipe)(sr,Boolean),ur=(0,l.pipe)((0,l.prop)("dependentLookupCode"),Boolean),cr=(0,l.both)(lr,(0,l.pipe)(sr,("rdm",(0,l.pipe)(Ut,(0,l.equals)("rdm")))));const pr=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=Zt({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]||yr(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:[]},dr=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=pr(e,t,r);return n.length?(0,l.last)(n):null},yr=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",nt.TYPE_NESTED),(0,l.propEq)("type",nt.TYPE_IMAGE)]),(0,l.prop)("attributes")],[(0,l.propEq)("type",nt.TYPE_REFERENCE),(0,l.pipe)(lt,(0,l.map)((t=>dr(e,t))),(0,l.reject)(l.isNil))],[l.T,(0,l.always)(null)]])(t)},fr=[nt.TYPE_ACTIVENESS_DATE,nt.TYPE_DATE,nt.TYPE_TIMESTAMP,nt.TYPE_LOCAL_DATE],Tr=[nt.TYPE_ACTIVENESS_DATE,nt.TYPE_TIMESTAMP,nt.TYPE_LOCAL_DATE],Er=e=>fr.includes(e),mr=e=>Tr.includes(e),hr=[nt.TYPE_INT,nt.TYPE_LONG,nt.TYPE_NUMBER,nt.TYPE_FLOAT,nt.TYPE_DOUBLE,nt.TYPE_COUNT],br=e=>hr.includes(e),Or=e=>[nt.TYPE_FLOAT,nt.TYPE_DOUBLE].includes(e),vr=[nt.TYPE_BOOLEAN,nt.TYPE_BOOLEAN_RADIO,nt.TYPE_RDM_LOOKUPS_NOT_RESOLVED],gr=e=>vr.includes(e),_r=[nt.TYPE_URL,nt.TYPE_BLOG_URL,nt.TYPE_IMAGE_URL],Ar=e=>_r.includes(e),Nr=tr(nt.TYPE_EMAIL),Pr=e=>nt.TYPE_SSN===e;var Rr,Sr=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(Rr||(Rr={}));const wr=(0,l.curry)(((e,t,r)=>{var n;const i=e===Rr.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)))})),Ir=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),Ur=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),Ir),Cr=(0,l.pipe)((0,l.reject)(E),Ur);function Dr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Lr(e,t,r[t])}))}return e}function Lr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jr=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("?")?"&":"?")+Ir(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}},kr=e=>t=>{if(!(e=>!ue(e.value))(t)){var r;const n=`${e}/${null!==(r=t.refEntity)&&void 0!==r&&r.objectURI?Ct(t.refEntity.objectURI):ht()}`;return Dr({},t,{uri:n,value:(0,l.fromPairs)((0,l.map)(Fr(n),(0,l.toPairs)(t.value)))})}return Dr({},t,{uri:`${e}/${ht()}`})},Fr=e=>t=>{let[r,n]=t;return[r,(0,l.map)(kr(`${e}/${r}`),n)]},Mr=e=>{const{uri:t}=e;return(0,l.evolve)({attributes:(0,l.pipe)(l.toPairs,(0,l.map)(Fr(`${t}/attributes`)),l.fromPairs)},e)},xr=e=>(0,l.evolve)({changes:(0,l.map)((0,l.map)((0,l.when)((0,l.propEq)("type",Ze.CREATE_ENTITY),(0,l.evolve)({newValue:Mr}))))},e),$r={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},Vr=(0,l.equals)($r.SUGGESTING),Gr=(0,l.equals)($r.EDITING),Wr=(0,l.equals)($r.VIEWING),Br=(0,l.either)(Gr,Vr),Yr=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),qr=(0,l.curry)(((e,t)=>(0,l.pipe)(Yr(e),(0,l.prop)("extendsTypeURI"))(t))),Hr=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(qr(e,r)));return n(r)})),Qr=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=qr(e,n);return r})),Kr=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?Kr(e,Yr(e,t.extendsTypeURI),r):void 0,Jr=(e,t)=>{const r=t.map(Qr(e));return(r.length?r.reduce(l.intersection):[])[0]},Xr=(e,t)=>Kr(e,(0,l.is)(Object,t)?t:Yr(e,t),"typeImage"),zr=(e,t)=>e.entityTypes.reduce(((r,n)=>n.uri!==t&&Hr(e,t,n.uri)?r.concat(n.uri):r),[]),Zr={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"},en={LIST_EQUALS:"listEquals",NOT_LIST_EQUALS:"not listEquals",LIST_EQUALS_CASE_SENSITIVE:"listEqualsCaseSensitive",NOT_LIST_EQUALS_CASE_SENSITIVE:"not listEqualsCaseSensitive"},tn={[Zr.EQUALS]:"equals",[Zr.NOT_EQUALS]:"not",[Zr.STARTS_WITH]:"starts with",[Zr.MISSING_VALUE]:"missing value",[Zr.IN_RANGE]:"in range",[Zr.HAS_ALL]:"has all",[Zr.FULL_TEXT]:"full text",[Zr.EXISTS]:"exists",[Zr.COUNT_EQUALS]:"count equals",[Zr.COUNT_NOT_EQUALS]:"count not equal",[Zr.COUNT_LT]:"count less",[Zr.COUNT_LTE]:"count less or equal",[Zr.COUNT_GT]:"count greater",[Zr.COUNT_GTE]:"count greater or equal",[Zr.COUNT_RANGE]:"count in range",[Zr.LT]:"less than",[Zr.LTE]:"less than or equal",[Zr.GT]:"greater than",[Zr.GTE]:"greater than or equal",[Zr.IN_FILE]:"in file",[Zr.NOT_IN_FILE]:"not in file",[Zr.CONTAINS]:"contains",[Zr.ON]:"on",[Zr.BEFORE]:"before",[Zr.AFTER]:"after",[Zr.WITHIN]:"within"},rn="in",nn="notIn",an="not range",on=e=>({[rn]:Zr.EQUALS,[nn]:Zr.NOT_EQUALS}[e]||e);var sn,ln;!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"}(sn||(sn={})),function(e){e.LAST_3DAYS="last3Days"}(ln||(ln={}));const un=["LAST_DAY","LAST_3DAYS","LAST_WEEK","LAST_MONTH","LAST_6MONTHS","LAST_YEAR","PICK_DATE"].reduce(((e,t)=>(e[t]=sn[t]||ln[t],e)),{}),cn={[sn.LAST_DAY]:"Last 24 hours",[ln.LAST_3DAYS]:"Last 3 days",[sn.LAST_WEEK]:"Last 7 days",[sn.LAST_MONTH]:"Last month",[sn.LAST_6MONTHS]:"Last 6 months",[sn.LAST_YEAR]:"Last year",[sn.PICK_DATE]:"Pick date"},pn={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},dn={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},yn="<No label>",fn={IN:"in",OUT:"out"};var Tn=r(87918),En=r.n(Tn);function mn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){hn(e,t,r[t])}))}return e}function hn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bn={startDate:{type:nt.TYPE_ACTIVENESS_DATE,get label(){return En().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:nt.TYPE_ACTIVENESS_DATE,get label(){return En().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},On=mn({id:{type:nt.TYPE_ENTITY_ID,get label(){return En().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},bn,{roles:{type:nt.TYPE_STRING,get label(){return En().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:nt.TYPE_STRING,get label(){return En().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),vn={workflow:{type:nt.TYPE_STRING,get label(){return En().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:nt.TYPE_STRING,get label(){return En().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:nt.TYPE_STRING,get label(){return En().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:nt.TYPE_TIMESTAMP,get label(){return En().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},gn={commenter:{type:nt.TYPE_STRING,get label(){return En().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},_n={notResolved:{type:nt.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return En().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},An={createdBy:{type:nt.TYPE_STRING,get label(){return En().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:nt.TYPE_STRING,get label(){return En().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:nt.TYPE_TIMESTAMP,get label(){return En().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:nt.TYPE_TIMESTAMP,get label(){return En().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},Nn={matches:{type:nt.TYPE_COUNT,get label(){return En().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:nt.TYPE_COUNT,get label(){return En().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0}},Pn={sourceSystems:{type:nt.TYPE_STRING,get label(){return En().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:nt.TYPE_STRING,get label(){return En().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:nt.TYPE_INT,get label(){return En().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:nt.TYPE_TIMESTAMP,get label(){return En().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:nt.TYPE_TIMESTAMP,get label(){return En().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:nt.TYPE_TIMESTAMP,get label(){return En().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:nt.TYPE_TIMESTAMP,get label(){return En().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:nt.TYPE_TIMESTAMP,get label(){return En().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:nt.TYPE_STRING,get label(){return En().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}};let Rn;!function(e){e.matchRules="matchRules",e.MLRecommendedMatch="MLRecommendedMatch"}(Rn||(Rn={}));const Sn={[Rn.matchRules]:{type:nt.TYPE_STRING,get label(){return En().text("Match Rules")},uri:Rn.matchRules,name:Rn.matchRules,faceted:!0,hideForDataTenant:!0},[Rn.MLRecommendedMatch]:{type:nt.TYPE_STRING,get label(){return En().text("Match IQ")},uri:Rn.MLRecommendedMatch,name:Rn.MLRecommendedMatch,faceted:!0,hideForDataTenant:!0}},wn=mn({},On,vn,gn,_n,An,Nn,Pn,Sn,{type:{type:nt.TYPE_STRING,get label(){return En().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}}),In="NOT_MATCH";var Un=r(13980),Cn=r.n(Un);function Dn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ln(e,t,r[t])}))}return e}function Ln(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jn=Cn().oneOf(["mobile","tablet","desktop"]),kn=Cn().shape({deviceTypes:Cn().oneOfType([jn,Cn().arrayOf(jn)]),roles:Cn().arrayOf(Cn().string)}),Fn=Cn().shape({value:Cn().string,lookupCode:Cn().string}),Mn=Cn().shape({link:Cn().string,filename:Cn().string}),xn=Cn().shape({displayName:Cn().string,parent:Cn().string}),$n=Cn().oneOfType([Cn().string,Cn().number,Cn().bool,Fn]),Vn=Cn().oneOfType([$n,Cn().arrayOf($n)]),Gn=Cn().shape({fieldName:Cn().string,values:Cn().arrayOf(Vn),filter:Cn().string,type:Cn().string}),Wn=Cn().shape({minValue:Cn().number,maxValue:Cn().number}),Bn=Cn().shape({label:Cn().string,name:Cn().string,description:Cn().string,type:Cn().string,hidden:Cn().bool,faceted:Cn().bool,searchable:Cn().bool,uri:Cn().string,access:Cn().arrayOf(Cn().string),cardinality:Wn}),Yn=Cn().shape({label:Cn().string,uri:Cn().string,typeColor:Cn().string,direction:Cn().string,startObject:Cn().object,endObject:Cn().object}),qn=Cn().shape({typeColor:Cn().string,typeIcon:Cn().string,typeImage:Cn().string,label:Cn().string,uri:Cn().string,attributes:Cn().arrayOf(Bn)}),Hn=Cn().shape({uri:Cn().string,label:Cn().string,memberTypes:Cn().array,extendsTypeUri:Cn().string,attributes:Cn().arrayOf(Bn)}),Qn=Cn().shape({uri:Cn().string,label:Cn().string,extendsTypeUri:Cn().string,relationshipTypeURIs:Cn().arrayOf(Cn().string)}),Kn=Cn().shape({uri:Cn().string,description:Cn().string,label:Cn().string,schemaVersion:Cn().string,entityTypes:Cn().arrayOf(qn),roles:Cn().arrayOf(Cn().object),groupTypes:Cn().arrayOf(Cn().object),relationTypes:Cn().arrayOf(Yn),graphTypes:Cn().arrayOf(Qn),interactionTypes:Cn().arrayOf(Hn),sources:Cn().arrayOf(Cn().object)}),Jn=Cn().shape({uri:Cn().string,type:Cn().string}),Xn=Cn().shape({uri:Cn().string,attributes:Cn().object,type:Cn().string,timestamp:Cn().number,members:Cn().object}),zn=Cn().shape({uri:Cn().string,type:Cn().string}),Zn=Cn().shape({value:Cn().object,ov:Cn().bool,type:Cn().string,uri:Cn().string}),ei=Cn().shape({refEntity:Cn().oneOfType([Cn().array,Cn().object]),refRelation:Cn().oneOfType([Cn().array,Cn().object]),value:Cn().object,ov:Cn().bool,type:Cn().string,uri:Cn().string}),ti=Cn().oneOf((0,l.values)($r)),ri=Cn().shape({type:Cn().oneOf(Object.values(he)).isRequired,attributeTypeUri:Cn().string.isRequired,parentUri:Cn().string.isRequired,uri:Cn().string,message:Cn().string}),ni={attributeType:Bn,showEmptyEditors:Cn().bool,lazy:Cn().bool,mode:ti,metadata:Kn,ownError:ri,errors:Cn().arrayOf(ri),crosswalks:Cn().array,onAddAttributes:Cn().func,onAddOneMore:Cn().func,onDeleteAttribute:Cn().func,onChangeAttribute:Cn().func,additionalControlsRenderer:Cn().func,hideDeleteButton:Cn().bool,showNonOv:Cn().bool,state:Cn().oneOf(["deleted","edited"]),expanded:Cn().bool},ii=Dn({attributeValue:Zn},ni),ai=Dn({attributeValue:ei},ni),oi=Cn().shape({value:Cn().oneOfType([Cn().string,Cn().bool,Cn().number]),ov:Cn().bool,type:Cn().string,uri:Cn().string,lookupCode:Cn().string,lookupRawValue:Cn().string}),si=Cn().shape({totalOvValues:Cn().number,totalValues:Cn().number}),li=Cn().shape({inRelations:Cn().arrayOf(Cn().oneOfType([Cn().object,Cn().string])),outRelations:Cn().arrayOf(Cn().oneOfType([Cn().object,Cn().string])),groups:Cn().arrayOf(Cn().string),entityTypes:Cn().arrayOf(Cn().string),nextEntry:Cn().object}),ui=Cn().oneOf(["asc","desc"]),ci=Cn().shape({id:Cn().string,content:li,allowOnlyCreateNew:Cn().bool,sortColumn:Cn().string,sortOrder:ui,"text-empty":Cn().string,max:Cn().number,icon:Cn().string,caption:Cn().string,canCreate:kn,canRead:kn,canUpdate:kn,canDelete:kn,editingEnabled:Cn().bool}),pi=Cn().shape({id:Cn().string,caption:Cn().string,pageSize:Cn().number,icon:Cn().string,canCreate:kn,canRead:kn,canUpdate:kn,canDelete:kn,attributes:Cn().object}),di=Cn().shape({entityUri:Cn().string,entityType:Cn().string,entityLabel:Cn().string,object:Jn}),yi=Cn().shape({relationUri:Cn().string,relationType:Cn().string,relationLabel:Cn().string,direction:Cn().string,object:zn}),fi=Cn().shape({entity:di,relation:yi}),Ti=Cn().shape({value:Cn().string,isRawFilter:Cn().bool}),Ei=Cn().shape({id:Cn().string,label:Cn().string,name:Cn().string,availableEntityTypes:Cn().array}),mi=Cn().shape({id:Cn().string,allowMergeAll:Cn().bool,matchActions:Cn().object,availableTabs:Cn().arrayOf(Cn().oneOf(["findMatches","potentialMatches","notAMatch"]))}),hi=Cn().shape({matchRules:Cn().arrayOf(Cn().string),object:Jn,shortestTransitiveMatchPath:Cn().arrayOf(Cn().shape({matchRules:Cn().arrayOf(Cn().string),match:Cn().string})),direct:Cn().bool,matchScore:Cn().number}),bi=Cn().arrayOf(hi),Oi=Cn().arrayOf(Cn().shape({uri:Cn().string,label:Cn().string})),vi=[{label:En().text("And"),value:"and"},{label:En().text("Or"),value:"or"},{label:En().text("And not"),value:"and not"},{label:En().text("Or not"),value:"or not"}];function gi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _i=(0,l.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Ai=(0,l.pipe)(_i,(0,l.propOr)("","label")),Ni=(0,l.curry)(((e,t)=>{const r=_i(e,t);return[(0,l.path)(["startObject","objectTypeURI"],r),(0,l.path)(["endObject","objectTypeURI"],r)]})),Pi=(0,l.curry)(((e,t,r)=>{const[n,i]=Ni(e,r);return Hr(e,n,t)||Hr(e,i,t)})),Ri=(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){gi(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),Si=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?fn.OUT:fn.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(fn.IN),i=r(fn.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},wi=(0,l.pathOr)("",["directionalContext",0,"labelPattern"]),Ii=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?Ii(e,_i(e,t.extendsTypeURI),r):void 0,Ui={CREATE:"CREATE",READ:"READ",UPDATE:"UPDATE",DELETE:"DELETE",INITIATE_CHANGE_REQUEST:"INITIATE_CHANGE_REQUEST",MERGE:"MERGE",UNMERGE:"UNMERGE"},Ci=(0,l.curry)(((e,t)=>e.every((e=>Di(e,t))))),Di=(0,l.curry)(((e,t)=>{const r=Jt(t);return Li(e,t)&&(e===Ui.READ||!r)})),Li=(e,t)=>!t||!t.access||t.access.includes(e),ji=(0,l.curry)(((e,t,r)=>Di(Ui.READ,r)&&(Vr(t)?Di(Ui.INITIATE_CHANGE_REQUEST,r):Di(e,r)))),ki=ji(Ui.CREATE),Fi=ji(Ui.DELETE),Mi=ji(Ui.UPDATE),xi=Ci([Ui.CREATE,Ui.MERGE,Ui.READ,Ui.UPDATE]),$i=Ci([Ui.UPDATE,Ui.READ,Ui.CREATE]),Vi=Ci([Ui.UPDATE,Ui.READ]),Gi=Ci([Ui.DELETE,Ui.UPDATE,Ui.READ]),Wi=(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["*"])),Bi=(e,t,r)=>(0,l.pipe)((0,l.map)(Wi(e,t)),(0,l.filter)(l.identity))(r),Yi=(e,t,r)=>{const n=Bi(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&Di(Ui.MERGE,r)},qi=(0,l.curry)(((e,t,r,n)=>{const i=_i(e,n),[a,o]=Ni(e,n);return i&&Di(Ui.CREATE,i)&&Hr(e,a,t.type)&&Hr(e,o,r.type)})),Hi=(e,t,r,n,i)=>{const a=Yr(e,n.type),o=Bi(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(qi(e,n,i))||a.some(qi(e,i,n))}))},Qi=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=Yr(e,r.type),o=(0,l.propOr)({},"matchActions",t);return{canMerge:Yi(o,i,a),canAddRelation:Hi(e,o,i,r,n),canMark:Di(Ui.UPDATE,a)&&Di(Ui.READ,a)}},Ki=(e,t,r,n)=>(0,l.pipe)((0,l.map)((n=>Qi(e,t,n.object,r,n.matchRules))),(0,l.reduce)((0,l.mergeWith)(l.and),{}))(n),Ji=Xt,Xi=(0,l.complement)(Ji),zi=Di(Ui.READ),Zi=e=>{let{attributeType:t,mode:r}=e;return Xi(t)&&ki(r,t)&&!er(t)},ea=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=gt(r.uri),o=Mi(n),s=ki(n);return(0,l.cond)([[Ji,l.F],[(0,l.always)(a),l.T],[(0,l.always)(i),o],[l.T,(0,l.allPass)([o,s])]])(t)},ta=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=gt(r.uri),s=Mi(n),u=Fi(n),c=na(Ui.UPDATE,n,a,r),p=na(Ui.DELETE,n,a,r);return(0,l.cond)([[Ji,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)},ra=(0,l.curry)(((e,t,r,n)=>{const i=yr(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=>!Li(e,n)||!ra(e,t,r[n.name],n)))))})),na=(0,l.curry)(((e,t,r,n,i)=>Vr(t)?ra(Ui.INITIATE_CHANGE_REQUEST,r,n,i):ra(e,r,n,i))),ia=(0,l.both)((0,l.complement)(er),zi),aa="SuperUser",oa="allTenants",sa=[oa,"allCustomers"],la=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===aa})).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===aa){const e=r?sa.concat(r.map((e=>`allTenants.${e}`))):sa,n=r&&t[0]===oa?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}))},ua={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"},ca={[ua.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[ua.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activities"],privileges:["EXECUTE"]},[ua.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[ua.CAN_READ_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ"]},[ua.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[ua.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[ua.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[ua.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[ua.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[ua.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[ua.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[ua.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[ua.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[ua.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[ua.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[ua.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[ua.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[ua.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[ua.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[ua.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[ua.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[ua.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[ua.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[ua.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[ua.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[ua.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[ua.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[ua.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[ua.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]},[ua.CAN_READ_DVF]:{serviceId:"DVF",resourcePath:["functionsManagement"],privileges:["READ"]}},pa=(0,l.curry)(((e,t,r)=>la({allowedPermissionsNames:e,permissionsNames:ua,permissionsConfig:ca}).some((e=>e(t,{params:{tenant:r}}))))),da=pa([ua.CAN_EXPORT]),ya=pa([ua.CAN_EXPORT_ACTIVITIES]),fa=pa([ua.CAN_IMPORT_ENTITIES_FROM_DT]),Ta=pa([ua.CAN_READ_ENTITIES_FROM_DT]),Ea=pa([ua.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),ma=pa([ua.CAN_UPDATE_PROCESS_INSTANCE]),ha=pa([ua.CAN_VIEW_WORKFLOW_DEFINITION]),ba=pa([ua.CAN_CONFIG_ENVIRONMENT_REGISTER]),Oa=pa([ua.CAN_UPDATE_WORKFLOW_DATA_TASK]),va=pa([ua.CAN_READ_WORKFLOW_DATA_TASK]),ga=pa([ua.CAN_MANAGE_WORKFLOW_DEFINITION]),_a=pa([ua.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),Aa=pa([ua.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),Na=pa([ua.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),Pa=pa([ua.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),Ra=pa([ua.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),Sa=pa([ua.CAN_EXECUTE_WORKFLOW_JOBS]),wa=pa([ua.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),Ia=pa([ua.CAN_CREATE_CONFIG_JAR]),Ua=pa([ua.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),Ca=pa([ua.CAN_VIEW_CONFIG_JAR]),Da=pa([ua.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),La=pa([ua.CAN_VIEW_WORKFLOW_JOBS]),ja=pa([ua.CAN_MAKE_BULK_UPDATE]),ka=pa([ua.CAN_OPEN_DATA_LOADER_EXECUTE,ua.CAN_OPEN_DATA_LOADER_READ]),Fa=pa([ua.CAN_BULK_DELETE_PROFILES]),Ma=pa([ua.CAN_READ_MDM_DATA_ENTITIES]),xa=pa([ua.CAN_READ_DVF]),$a=pa([ua.IS_FREEMIUM_ADMIN]),Va=(0,l.reject)(er),Ga=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),Va,(0,l.filter)(e))(t),Wa=(0,l.curry)(((e,t)=>Ga((t=>Zi({attributeType:t,mode:e})),t))),Ba=(0,l.curry)(((e,t)=>Ga((t=>Zi({attributeType:t,mode:e})||ia(t)),t))),Ya=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(ia)),qa=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...qa(e)])))),Ha=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(ia),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Ha(e)])))),Qa=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...Qa(e)])))),Ka=(0,l.pipe)(Yr,(0,l.converge)(l.concat,[Ha,Qa]));function Ja(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Xa(e,t,r[t])}))}return e}function Xa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const za=(0,l.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,za(e)))},t))),Za=e=>{var t;return Ja({},e,{matchGroups:(0,l.uniq)((e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[]))})},eo=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),to=(0,l.when)(eo,(0,l.dissoc)("values")),ro=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return Ja({},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})})),no=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},io=(0,Sr.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(qa,t).concat((0,l.chain)(qa,r)).some(no)})),ao=e=>{let t=!1;const r=za((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?Ja({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},oo=e=>{const t=io(e),r=(0,l.map)((e=>za((0,l.pipe)(to,(0,l.when)((0,l.always)(e),ro))))(t)),n=(0,l.map)(Za),i=(0,l.map)(ao);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},so=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),lo=(0,l.prop)("relationshipTypeURIs"),uo=(0,l.curry)(((e,t)=>{var r;return(null===(r=e.graphTypes)||void 0===r?void 0:r.filter(co(e,t)))||[]})),co=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return null==n?void 0:n.some(Pi(e,t))},po=(e,t)=>(0,l.pipe)(so,(0,l.defaultTo)({}),lo,(0,l.defaultTo)([]),(0,l.chain)(Ni(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(Yr(e)))(e,t),yo=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),fo=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),To=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return fo((0,l.complement)(yo))(e)},Eo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return fo(yo)(e)},mo=(0,l.pipe)(Yr,(0,l.propOr)([],"matchGroups")),ho=(e,t,r)=>(0,l.pipe)(mo,(0,l.find)((0,l.propEq)("uri",r)))(e,t),bo=(0,l.curry)(((e,t,r)=>(0,l.pipe)(ho,(0,l.propOr)(r,"label"))(e,t,r))),Oo=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(mo,(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]})),vo=e=>(0,l.partition)(yo,e),go=(0,l.includes)(l.__,["and","or","not"]),_o=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),Ao=(0,l.includes)(l.__,["equals","notEquals","in"]),No=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return go(t)?No(r):_o(t)?r.filter(St):Ao(t)?r.map((0,l.prop)("uri")).filter(St):[]})),l.uniq),Po=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)(No),l.uniq),Ro=(0,l.pipe)(mo,Po),So=(0,l.pipe)(Oo,Po),wo=(e,t)=>{let{interactionTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},Io=(0,l.pipe)(wo,Ha),Uo=(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||Hr(e,n,t)})(e,t))})(e,t)),Co=e=>!!e.required,Do=(e,t,r)=>{const n=(0,l.cond)([[St,Yr(e)],[wt,_i(e)]])(t);return Lo(e,n,r)},Lo=(e,t,r)=>!t||t.hidden&&!(e=>e.uri&&St(e.uri)&&3===e.uri.split("/").length)(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!Jt(e))).flatMap((t=>{const n=t.required?[t]:[];if(r){let i;if(t.type===nt.TYPE_REFERENCE){const n=st(t),a=lt(t);i=Do(e,n,r).filter((e=>a.some(It(e.uri))))}else t.attributes&&(i=Lo(e,t,r));i&&n.push(...i)}return n})):t.type===nt.TYPE_REFERENCE?Do(e,st(t),r):[],jo=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),Co]),e.attributes||[])},ko=(e,t)=>{const r=pt(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},Fo=(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)?En().text(n):n};return r(null,t)})),Mo=["label","description","abbreviation","caption","toolTip"],xo=e=>Fo(Mo,e),$o=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=Ct(t);return r.find((e=>{let{uri:t}=e;return Ct(t)===n}))})),Vo=(0,l.curry)(((e,t)=>{const r=Ct(t);return(0,l.pipe)($o(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),Go=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"})},Wo=(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}))},Bo=(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)})),Yo=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=Yr(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));function qo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ho(e,t,r[t])}))}return e}function Ho(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qo=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 Ko(i,e,t,r,n)},Ko=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:["attributes"];return Z.fromNull(e&&e.length?e:yr(t,r)).map((e=>e.map((e=>{const r=Qo(t,e,n,i);return r.length?qo({},e,{children:r}):e})))).orSome([]).filter((0,l.either)((0,l.complement)(ar),(0,l.prop)("children"))).filter(ia).filter(n).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},Jo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Qo(e,t,r,["attributes","analyticsAttributes"])},Xo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Qo(e,t,r,["attributes"])},zo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Qo(e,t,r,["analyticsAttributes"])},Zo=e=>e.children?e.children.flatMap(Zo):e,es=e=>e.children?[e,...e.children.flatMap(es)]:e,ts=(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)})),rs=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return Ct(r)===e})))),ns=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),rs("LUD")),(0,l.defaultTo)(r))(t||[])},is=(e,t)=>{let{survivorshipStrategies:r}=e;return rs(t,r)},as=(0,l.allPass)([(0,l.complement)(l.isNil),Di(Ui.READ)]),os=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),Di(Ui.READ)]),ss=(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)([Di(Ui.CREATE),Di(Ui.INITIATE_CHANGE_REQUEST)])]),ls=(0,l.curryN)(2,(0,l.pipe)(Yr,os)),us=(0,l.curryN)(2,(0,l.pipe)(_i,as));function cs(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 ps(e,t){for(var r=e.substr(e.indexOf("/attributes/")+12).split("/"),n=[],i=0;i<r.length;i+=2)n.push(cs(r[i],r[i+1],e,t));return n}function ds(e,t,r,n,i,a,o){void 0===a&&(a=0);var s=ps(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 ds(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 ys(e,t,r,n,i,a){void 0===a&&(a=0);var o=ps(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()?(fs(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(fs.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=ds(e,t,r,n,i,a),s}var c=ys(e,o,o.valueUri,{},i,a);ys(c,t,r,n,i,a+1)}function fs(e,t){ue(e)?(t.value=e.value,t.lookupCode=e.lookupCode):(t.value=e,t.lookupCode&&(t.lookupCode=e))}function Ts(e,t,r,n){void 0===n&&(n=0);var i=ps(r)[n];if(i.hasChildren){var a=(e[i.name]||[]).filter((function(e){return e.uri===i.valueUri}))[0];a&&Ts(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 Es(e,t){e.roles=t||[]}function ms(e,t){e.tags=t||[]}function hs(e,t){e.startDate=t||""}function bs(e,t){e.endDate=t||""}const Os=e=>{let{ov:t}=e;return!1!==t},vs=(e,t)=>((e,t)=>Ar(e.type)&&ae(t))(e,t)||((e,t)=>Nr(e.type)&&oe(t))(e,t),gs=(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))),_s=gs("refEntity"),As=gs("refRelation"),Ns=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],Ps=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},Rs=(0,l.prop)("objectURI"),Ss=(0,l.prop)("objectURI"),ws=(0,l.prop)("type"),Is=(0,l.pipe)(_s,(0,l.defaultTo)({}),Rs),Us=(0,l.pipe)(As,(0,l.defaultTo)({}),Ss),Cs=(0,l.pipe)(_s,(0,l.defaultTo)({}),ws),Ds=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type})));return(e||[]).concat(r)},Ls=(0,l.evolve)({refEntity:re,refRelation:re}),js=(e,t,r,n)=>{const i=pr(e,r),a=Yr(e,t.type)||_i(e,t.type);if(0===i.length)return null;const o=Zt(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(!ft(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=a.attributes.filter((e=>st(e)===r.uri||ot(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},ks=(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?ks(a.value,o):a},Fs=(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 ks(e[r],i)})),Ms=(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")]]),xs=(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"])]]),$s=(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"])]]),Vs=(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)(Vs(e,i)))))(r)})),Gs=(0,l.curry)(((e,t)=>(0,l.ifElse)((0,l.is)(Array),(0,l.map)(Gs(e)),e)(t))),Ws=(0,l.curry)(((e,t,r,n)=>(0,l.pipe)(Vs(e,r),Gs(t))(n))),Bs=Ws(null,Ms),Ys=Ws(Os,Ms),qs=Ws(null,xs),Hs=Ws(Os,xs),Qs=Ws(Os,$s),Ks=(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=Fs(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},Js=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(Is,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{}),Xs=(e,t)=>{const r=Vt(t),n=(0,l.pipe)((0,l.split)("/"),(0,l.dropLast)(1),l.last)(t);return Ks(e,r,n)},zs=Object.values(bn),Zs=(0,l.includes)(l.__,zs),el=e=>zs.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,l.assoc)(n,e[n],t):t}),{});function tl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){rl(e,t,r[t])}))}return e}function rl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nl=(e,t)=>`${e}_${t}`,il=[wn.matches.name,wn.matchRules.name],al=(0,l.values)(vn).map((e=>e.name)),ol=e=>(0,l.when)((0,l.always)(!e),(0,l.reject)((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,al)))),sl=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,il)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>nl(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),ll=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,l.pipe)(l.values,ol(r),sl(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(nl(`dtPotentialMatches.${t.name}`,"")))))(wn)},ul=(0,l.propEq)("uri",wn.type.uri),cl=e=>(0,l.values)(Sn).some((0,l.propEq)("uri",null==e?void 0:e.uri)),pl=(0,l.propEq)("uri",Pn.sourceSystems.uri),dl=Object.values(On),yl=(0,l.includes)(l.__,dl),fl=e=>{let{entity:t,attributeType:r,value:n}=e;return tl({},t,{[r.uri]:void 0===n?r.defaultValue:n})},Tl=e=>{let{entity:t,attributeType:r}=e;return(0,l.dissoc)(r.uri,t)},El=e=>{let{entity:t,attributeType:r,value:n}=e;return tl({},t,{[r.uri]:n})},ml=(0,l.propEq)("uri",On.roles.uri),hl=(0,l.propEq)("uri",On.tags.uri);function bl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ol(e,t,r[t])}))}return e}function Ol(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vl=e=>{let{parentUri:t,attributeType:r}=e;return bl({uri:vt(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,l.propOr)("","defaultValue",e);return(0,l.cond)([[ar,(0,l.always)({value:{}})],[lr,()=>t?{value:"",lookupCode:t}:{value:""}],[(0,l.both)((0,l.propEq)("defaultValue","now"),(0,l.pipe)((0,l.prop)("type"),Er)),(0,l.always)({value:Date.now()})],[l.T,(0,l.always)({value:t})]])(e)})(r))},gl=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)(Wa(i),(0,l.filter)((0,l.anyPass)([(0,l.has)("defaultValue"),ur,(0,l.propEq)("required",!0)])))(t),o={};for(const e of a){const{name:t}=e,a=vl({parentUri:r,attributeType:e});let s=yr(n,e);s&&(e.type===nt.TYPE_REFERENCE&&(s=yt(s)),a.value=gl({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(!(0,l.isEmpty)(a.value)||Boolean(a.lookupCode)||ur(e))&&(o[t]=[a])}return o},_l=e=>{let{entity:t,metadata:r}=e;return Do(r,t.type,!0).filter(ur).reduce(((e,t)=>{const n=t.name,i=Vt(t.uri);return(i===e.type?[{parentUri:e.uri,attributes:e.attributes}]:js(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:Nl({entity:e,attributeType:t,parentUri:i,index:0})}),e)}),t)},Al=(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===nt.TYPE_NESTED?bl({},e,{value:Al({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return bl({},s(t),gl({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),Nl=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=vl({parentUri:n,attributeType:r}),u=Ms(l);return(0,me.ZP)(t,(e=>{ds(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},Pl=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,me.ZP)(t,(e=>{ds(e.attributes||e.value,r,n.uri,Ms(n),a,o,i)}))},Rl=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,me.ZP)(t,(e=>{ys(e.attributes||e.value,r,n,i,a,o)}))},Sl=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,me.ZP)(t,(e=>{Ts(e.attributes||e.value,r,n,i)}))},wl=e=>""===e,Il=(0,l.cond)([[(0,l.propSatisfies)((0,l.complement)((0,l.anyPass)([wl,l.isNil])),"lookupCode"),l.F],[(0,l.propSatisfies)((0,l.anyPass)([wl,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]]),Ul=(0,l.reject)(Il),Cl=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=>Cl({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),Ul)),(0,l.when)((0,l.always)(t),(0,l.reject)(l.isEmpty)))},Dl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Cl({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),Ls),deleteEmptyComplex:e})},Ll=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)(Dl(e),(0,l.reject)(l.isEmpty))},jl=(0,l.curry)(((e,t)=>t.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:i}=t;return Zs(r)?fl({entity:e,attributeType:r}):Nl({entity:e,attributeType:r,parentUri:n,index:i})}),e))),kl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n,value:i}=t;return Zs(r)?El({entity:e,attributeType:r,value:i}):Rl({entity:e,attributeType:r,uri:n,value:i})})),Fl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n}=t;return Zs(r)?Tl({entity:e,attributeType:r}):Sl({entity:e,attributeType:r,uri:n})})),Ml=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)},xl="UrlThumbnail",$l="CdnUrlThumbnail",Vl=(0,l.curry)(((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(Os):(0,l.head)(n);return e&&e.value}return null})),Gl=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>Vl(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),Wl=Gl(["CdnUrl","Url"],!0),Bl=Gl(["CdnUrlPreview","UrlPreview"],!0),Yl=Gl([$l,xl],!0),ql=Gl([$l,xl]),Hl=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,l.cond)([[zt,(0,l.always)(t)],[(0,l.both)(Xt,(0,l.always)(i)),(0,l.always)(i)],[l.T,(0,l.always)(n)]])(a),s=zt(a)?"uri":"name",u=(0,l.pipe)((0,l.prop)(a[s]),(0,l.when)((0,l.both)((0,l.always)(Zs(a)),(e=>null===e)),(0,l.always)([""])),(0,l.defaultTo)([]),ne)(o);return(0,l.when)((0,l.always)(r(u,a)),(0,l.append)({attrType:a,values:u}),e)}),[])},Ql=(e,t,r)=>{const n=Ya(e),i=(0,l.any)(r?l.T:Os);return Hl(n,t,i)},Kl=(e,t,r,n,i,a)=>{const o=gt(null==r?void 0:r.uri)?Wa(t,e):Ba(t,e);return Hl(o,r,((e,o)=>{const s=Zi({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:Os,e)||zt(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let Jl;const Xl=e=>{Jl=e};function zl(e,t){return Jl(e,t)}const Zl=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)})),eu=50,tu=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=eu,offset:a=0}=e;return zl("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i,offset:a}),headers:{"Content-Type":"application/json"}})},ru=(0,l.once)((()=>zl("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),nu=e=>zl("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),iu=(e,t)=>zl("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),au=e=>Z.fromNull(tn[e]).map(En().text).orSome(""),ou=(0,l.curry)(((e,t)=>`${e}_${t}`)),su=(0,l.split)("_"),lu=(0,l.includes)("_"),uu=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),cu=(0,l.curry)(((e,t)=>e.some(uu(t)))),pu=cu([Zr.IN_RANGE,Zr.COUNT_RANGE,Zr.WITHIN]),du=cu([Zr.EXISTS,Zr.MISSING_VALUE]),yu=(0,l.cond)([[du,(0,l.always)(0)],[pu,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),fu=(0,l.complement)(du),Tu=cu([Zr.HAS_ALL,Zr.EQUALS,Zr.NOT_EQUALS]),Eu=cu([Zr.COUNT_EQUALS,Zr.COUNT_NOT_EQUALS,Zr.COUNT_LT,Zr.COUNT_LTE,Zr.COUNT_GT,Zr.COUNT_GTE,Zr.COUNT_RANGE]),mu=cu([Zr.IN_FILE,Zr.NOT_IN_FILE]),hu=e=>{switch(e){case Zr.COUNT_EQUALS:return Zr.EQUALS;case Zr.COUNT_NOT_EQUALS:return Zr.NOT_EQUALS;case Zr.COUNT_LT:return Zr.LT;case Zr.COUNT_LTE:return Zr.LTE;case Zr.COUNT_GT:return Zr.GT;case Zr.COUNT_GTE:return Zr.GTE;case Zr.COUNT_RANGE:return Zr.IN_RANGE}},bu=cu([Zr.ON,Zr.BEFORE,Zr.AFTER,Zr.WITHIN,Zr.NOT_EQUALS]),Ou=cu([Zr.WITHIN]),vu=[[Zr.COUNT_EQUALS,Zr.COUNT_NOT_EQUALS,Zr.COUNT_LT,Zr.COUNT_LTE,Zr.COUNT_GT,Zr.COUNT_GTE],[Zr.NOT_IN_FILE,Zr.IN_FILE],[Zr.EQUALS,Zr.NOT_EQUALS,Zr.HAS_ALL],[Zr.LT,Zr.LTE,Zr.GT,Zr.GTE],[Zr.MISSING_VALUE,Zr.EXISTS],[Zr.COUNT_RANGE],[Zr.IN_RANGE],[Zr.STARTS_WITH,Zr.CONTAINS],[Zr.FULL_TEXT],[Zr.ON,Zr.BEFORE,Zr.AFTER,Zr.NOT_EQUALS],[Zr.WITHIN]],gu=(e,t)=>vu.some((r=>r.includes(e)&&r.includes(t))),_u=(0,l.pipe)(l.omit,l.values),Au={OPTIONS_FOR_STRING:_u(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],Zr),OPTIONS_FOR_DATE:[Zr.ON,Zr.BEFORE,Zr.AFTER,Zr.WITHIN,Zr.NOT_EQUALS,Zr.MISSING_VALUE,Zr.EXISTS,Zr.COUNT_EQUALS,Zr.COUNT_NOT_EQUALS,Zr.COUNT_LT,Zr.COUNT_LTE,Zr.COUNT_GT,Zr.COUNT_GTE,Zr.COUNT_RANGE,Zr.IN_FILE,Zr.NOT_IN_FILE],OPTIONS_FOR_BOOLEAN:_u(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],Zr),OPTIONS_FOR_BLOB:_u(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],Zr),OPTIONS_FOR_NUMBER:_u(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],Zr),OPTIONS_FOR_LOOKUP:_u(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],Zr),OPTIONS_FOR_ENUM:_u(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],Zr),OPTIONS_FOR_ID:[Zr.EQUALS,Zr.NOT_EQUALS,Zr.IN_FILE,Zr.NOT_IN_FILE],OPTIONS_FOR_COUNT:[Zr.EQUALS,Zr.NOT_EQUALS,Zr.LT,Zr.LTE,Zr.GT,Zr.GTE,Zr.IN_RANGE],OPTIONS_FOR_COMPLEX:[Zr.COUNT_EQUALS,Zr.COUNT_NOT_EQUALS,Zr.COUNT_LT,Zr.COUNT_LTE,Zr.COUNT_GT,Zr.COUNT_GTE,Zr.COUNT_RANGE,Zr.EXISTS,Zr.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[Zr.EQUALS,Zr.NOT_EQUALS,Zr.EXISTS,Zr.MISSING_VALUE]},Nu=e=>{const{type:t,singleValue:r=!1}=e,n=(e=>{switch(e){case nt.TYPE_TYPEAHEAD:case nt.TYPE_STRING:case nt.TYPE_PASSWORD:case nt.TYPE_TEXT:case nt.TYPE_CIK_ID:case nt.TYPE_URL:case nt.TYPE_BLOG_URL:case nt.TYPE_IMAGE_URL:case nt.TYPE_EMAIL:return Au.OPTIONS_FOR_STRING;case nt.TYPE_LOOKUP:case nt.TYPE_DEPENDENT_LOOKUP:return Au.OPTIONS_FOR_LOOKUP;case nt.TYPE_ENUM:return Au.OPTIONS_FOR_ENUM;case nt.TYPE_DATE:case nt.TYPE_ACTIVENESS_DATE:case nt.TYPE_TIMESTAMP:case nt.TYPE_LOCAL_DATE:return Au.OPTIONS_FOR_DATE;case nt.TYPE_BOOLEAN:case nt.TYPE_BOOLEAN_RADIO:return Au.OPTIONS_FOR_BOOLEAN;case nt.TYPE_BLOB:return Au.OPTIONS_FOR_BLOB;case nt.TYPE_LONG:case nt.TYPE_INT:case nt.TYPE_FLOAT:case nt.TYPE_DOUBLE:case nt.TYPE_NUMBER:return Au.OPTIONS_FOR_NUMBER;case nt.TYPE_ENTITY_ID:return Au.OPTIONS_FOR_ID;case nt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[Zr.EQUALS];case nt.TYPE_COUNT:return Au.OPTIONS_FOR_COUNT;case nt.TYPE_NESTED:case nt.TYPE_REFERENCE:case nt.TYPE_IMAGE:return Au.OPTIONS_FOR_COMPLEX;default:return Au.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(Eu,n):n},Pu=e=>[Re.and,Re.andNot].includes(e),Ru=e=>[Re.or,Re.orNot].includes(e),Su=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),Ru)),wu=(Iu=[Re.and],e=>e.slice(0,-1).every((e=>Iu.includes(e.operator))));var Iu;const Uu=e=>e.map(((e,t,r)=>{const n=0===t;return(0,l.assoc)("operator",n?null:r[t-1].operator,e)}),[]),Cu=e=>e.map(((e,t,r)=>{const n=t===r.length-1;return(0,l.assoc)("operator",n?null:r[t+1].operator,e)}),[]),Du=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},Lu=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=[Re.or,Re.orNot],n=t?[Re.and,Re.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)&&Du(e.slice(1,-1));return!i&&!a||o?e:`(${e})`},ju="and",ku=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)(ju,n,e),o=(e=>[Re.andNot,Re.orNot].includes(e))(a)?Lu(r):r;return i?o:`${t} ${a} ${o}`}),"")}},Fu=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),Mu=e=>Array.isArray(e)?e.map(Mu).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),xu=(0,l.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),$u=e=>`'${e}'`,Vu=e=>`"${e}"`,Gu=(0,l.pipe)(Mu,xu),Wu=(0,l.pipe)(Gu,$u),Bu=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.allPass)([(0,l.always)(pu(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[l.T,l.identity]])(t))),Yu=(e,t)=>Eu(t)?{type:nt.TYPE_INT}:mu(t)?{type:nt.TYPE_FILE}:bu(t)&&!Ou(t)&&mr(e.type)?{type:nt.TYPE_LOCAL_DATE}:e,qu=Object.values(un),Hu=e=>!Object.values(un).includes(e),Qu=e=>qu.includes(e),Ku=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cn;return En().text(t[e])},Ju=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.values(sn),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cn;return e.map((e=>({value:e,get label(){return Ku(e,t)}})))},Xu=e=>{const t=f()().startOf("minute");switch(e){case sn.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case sn.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case sn.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case sn.LAST_6MONTHS:return[f()(t).subtract(6,"months").valueOf(),t.valueOf()];case sn.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()];case ln.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()];default:return e}},zu=e=>{let[t,r]=e;return[f()(t).valueOf(),f()(r).endOf("date").valueOf()]},Zu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xu;return(0,l.is)(String,e)?t(e):zu(e)};let ec;!function(e){e.CurrentUser="currentUser"}(ec||(ec={}));const tc={},rc=(e,t)=>{tc[e]=t},nc=e=>tc[e];function ic(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ac(e,t,r[t])}))}return e}function ac(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const oc=e=>e.split("{CurrentUser}").join(nc(ec.CurrentUser)||""),sc=(0,l.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),lc=(0,l.curry)(((e,t,r)=>{const n=r.map(pu(e)||t.endsWith(".count")?Gu:Wu).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),uc=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},cc=e=>{let{filter:t,fieldName:r,values:n}=e;const i=yu(t);return(0,l.pipe)(uc(i),(0,l.map)(lc(t,r)),sc(" or "))(n)},pc=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(Wu).join(",")})`},dc=e=>`*${e}*`,yc=e=>`URL:${e}`,fc=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,Tc=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===Zr.IN_FILE?r:`not ${r}`},Ec=(e,t)=>[R(e,t),S(e,t)],mc=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!hc(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case Zr.ON:return ic({},e,n?{filter:Zr.EQUALS}:{filter:Zr.IN_RANGE,values:[Ec(i,n)]});case Zr.BEFORE:return ic({},e,{filter:Zr.LTE,values:[[S(i,n)]]});case Zr.AFTER:return ic({},e,{filter:Zr.GTE,values:[[R(i,n)]]});case Zr.WITHIN:return ic({},e,{filter:Zr.IN_RANGE,values:[Xu(i)]})}}return e}),cc),hc=(0,l.propSatisfies)(mr,"type"),bc=[[(0,l.prop)("rawFilter"),(0,l.pipe)((0,l.prop)("rawFilter"),oc)],[(0,l.propEq)("filter",Zr.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(cc({filter:Zr.EQUALS,fieldName:t,values:[r]}))),new ku).build())),sc(" or "))(r)}),oc)],[(0,l.propEq)("filter",Zr.CONTAINS),(0,l.pipe)((e=>{let{filter:t,fieldName:r,values:n}=e;return cc({fieldName:r,filter:t,values:n.map((0,l.pipe)(Mu,dc))})}),oc)],[(0,l.propEq)("filter",Zr.EQUALS),(0,l.pipe)((e=>{const{fieldName:t,values:r}=e;return"type"===t?cc(ic({},e,{values:(0,l.flatten)(r)})):fc(r)?pc(ic({},e,{filter:"listEquals"})):cc(e)}),oc)],[(0,l.propEq)("filter",Zr.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=yu(t);return(0,l.pipe)(uc(i),(0,l.map)(lc(t,r)),sc(" and "))(n)})(ic({},e,{values:(0,l.flatten)(e.values)})):hc(e)?(e=>{const{values:t}=e,r=!hc(e),[n]=t;return(new ku).addClause(cc(ic({},e,{filter:Zr.LT,values:[R(n,r)]}))).addClause(cc(ic({},e,{filter:Zr.GT,values:[S(n,r)]}))).orBuild()})(e):fc(t)?pc(ic({},e,{filter:"not listEquals"})):cc(e)}),oc)],[(0,l.propSatisfies)(mu,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return cc({fieldName:r,filter:Tc(t,r),values:n.map((0,l.prop)("link")).map(yc)})}],[(0,l.propSatisfies)(Eu,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return cc({fieldName:`${r}.count`,values:n,filter:hu(t)})}],[(0,l.propSatisfies)(bu,"filter"),mc],[(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 lc(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return lc(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,(0,l.pipe)(cc,oc)]],Oc=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!fu(e)||gc(e,r))},vc=(e,t)=>Array.isArray(t)?gc(e,t):e===Zr.WITHIN?Qu(t)||Number.isInteger(t):!(0,l.isNil)(t)&&Mu(t).length>0,gc=(e,t)=>t&&t.length>0&&t.every((t=>vc(e,t)));function _c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ac=e=>{let{fieldName:t=""}=e;const r=t.split("."),n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},Nc=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),Pc=(e,t,r)=>"children"===e?Sc(r,[...t][0],!0):r,Rc=(e,t,r)=>"values"===e?[...r,...t]:r,Sc=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)(Pc,t),e);if(!r&&Tu(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(Rc,t),e)}return(0,l.append)(t,e)},wc=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=Ac(e),r=e=>e.fieldName===t?e:r({fieldName:Nc(e),children:[e]});return r(e)})(t);return Sc(e,r)}),[]),Ic=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")),Uc=e=>{let[t]=e;return t.children?Uc(t.children):t.operator},Cc=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=Uc(t)===Re.andNot,a=n(t,!1),o=i?`not ${Lu(a)}`:a,s=n(r,!1);return`inSameAttributeValue(${o} ${Uc(r)||ju} ${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&&Ic(i)&&!t?r(i):n(i,a)}],...e])(o))),new ku).buildWithOperators(i.map((0,l.prop)("operator")))}return n},Dc=(0,l.pipe)((0,l.propOr)("","filter"),lu),Lc=(0,l.map)((0,l.when)(Dc,(e=>{const[t,r]=su(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){_c(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),jc=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)(Oc),Lc,wc,Cc([...e,...bc],t))},kc=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),Fc=[Zr.ON,Zr.BEFORE,Zr.AFTER,Zr.WITHIN,Zr.NOT_EQUALS,Zr.MISSING_VALUE,Zr.EXISTS],Mc=[Zr.EQUALS,Zr.NOT_EQUALS,Zr.STARTS_WITH,Zr.MISSING_VALUE,Zr.HAS_ALL,Zr.FULL_TEXT,Zr.EXISTS],xc=[Zr.EQUALS,Zr.NOT_EQUALS,Zr.LT,Zr.LTE,Zr.GT,Zr.GTE,Zr.IN_RANGE],$c=(e,t)=>{const r=Kt(e);return(e=>{switch(e){case bn.startDate.name:case bn.endDate.name:case vn.dueDate.name:case An.createdTime.name:case An.updatedTime.name:case Pn.reltioLoadDate.name:case Pn.createDate.name:case Pn.updateDate.name:case Pn.deleteDate.name:case Pn.publishDate.name:return Fc;case Nn.matches.name:case Pn.count.name:return xc;case vn.workflow.name:case vn.assignee.name:case vn.step.name:case gn.commenter.name:case An.createdBy.name:case An.updatedBy.name:case Pn.sourceSystems.name:case Pn.value.name:return Mc;default:return null}})(t)||Nu(r)},Vc=[Zr.EQUALS,Zr.NOT_EQUALS,Zr.CONTAINS,Zr.STARTS_WITH,Zr.MISSING_VALUE,Zr.HAS_ALL,Zr.IN_RANGE,Zr.WITHIN,Zr.EXISTS,Zr.ON],Gc=(0,l.pipe)($c,(0,l.filter)((0,l.includes)(l.__,Vc))),Wc=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),Bc=e=>{let{query:t,body:r}=e;return t=Wc(t),zl(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},Yc=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)(jc(),kc(t.globalFilter))(n),activeness:t.activityFilter||dn.ACTIVE_ONLY};return t.searchOptions&&(i.options=t.searchOptions),`/entities/_total${Cr(i)}`},qc=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=Yc(e,t,r);return zl(n)},Hc=e=>zl(`/entities/_total?${e}`),Qc=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(0,l.pipe)((0,l.filter)(os),(0,l.map)((0,l.prop)("uri")))(e),i={filter:Zr.EQUALS,fieldName:"type",values:n},a=r.isRawFilter?{rawFilter:t}:{filter:"containsWordStartingWith",fieldName:"attributes",values:[t]},o=(0,l.pipe)(jc(),kc(r.globalFilter))([i,a]),s=Cr({filter:o,select:"uri,label,type,roles,secondaryLabel,defaultProfilePicValue",scoreEnabled:!0,activeness:r.activityFilter||dn.ACTIVE_ONLY,max:r.max||4});return zl("/entities/_typeAheadSearch"+s,{method:"GET"})},Kc=(0,l.pipe)((0,l.reject)(l.isNil),Ur),Jc=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)(jc(),kc(i))(r),p=Kc({filter:c||null,activeness:a||"active",options:o||null}),d=[{fieldName:t,pageSize:s||20,pageNo:u||1,orderType:n.orderType||"reversedCount"}];return Bc({query:p,body:d})},Xc=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return Jc({fieldName:t,searchParams:i,options:n})};function zc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zc="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",ep=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)(jc(),kc(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||Zc,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null};return t.searchOptions&&(i.options=t.searchOptions),`/entities${Cr(i)}`},tp=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=ep(e,t,r);return zl(n)},rp=e=>lp(e,{select:"secondaryLabel"}),np=(e,t)=>{const{select:r=Zc,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),zl("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},ip=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),gt)),ap=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=ip(n).length,T={[r]:{max:a,offset:(0,l.isNil)(i)?y-f:i}},E=or(r),m={attributesPaging:T,defaultMaxValues:a,options:d,select:"crosswalks,"+E},h=[...c,{filter:"containsWordStartingWith",fieldName:E,values:[u]}],b=(0,l.pipe)(jc(),kc(d.globalFilter))(h);return b&&(m.filter=b),p&&(m.sort=p.field,m.order=p.order),zl(`${s}/api/${o}/${t}/_object`,{method:"POST",body:JSON.stringify(m)})},op=e=>`entities?filter=equals(uri,'${e}')&offset=0`,sp={options:"sendHidden,addRefAttrUriToCrosswalk"},lp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:sp;return zl(`/${e}${Cr(t)}`)},up=(e,t)=>lp(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){zc(e,t,r[t])}))}return e}({},sp,{explicitSurvivorshipGroup:t})),cp=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 zl(n,r)},pp=e=>zl(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),dp=(e,t,r)=>{const n={method:"POST",body:JSON.stringify(t)};return zl(`/${e}/_clone${Cr({executeLCA:!1,valuesToCopy:r})}`,n)},yp=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return zl(`/entities/_events/_total${Ur({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},fp=(e,t)=>zl(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",body:t}),Tp=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return zl(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",body:JSON.stringify(r)})},Ep=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 zl(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),Ur)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},mp=e=>{const t=new FormData;return t.append("file",e),zl("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=de(e,En().text("Can't upload file"));return Promise.reject(t)}))},hp=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 zl(`/personal/findSavedSearches${Ur({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"}})},bp=e=>zl(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),Op=e=>zl("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),vp=e=>{const{uri:t}=e,r=(0,l.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return zl(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},gp=e=>{let{uri:t}=e;return zl(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},_p=(e,t)=>(0,l.pipe)((0,l.evolve)({isPublic:(0,l.always)(t)}),vp)(e),Ap=(e,t)=>(0,l.pipe)((0,l.evolve)({isFavorite:(0,l.always)(t)}),vp)(e);function Np(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Pp=["max","offset","filter"],Rp=(0,l.curry)(((e,t)=>t.nextEntry?(0,l.evolve)({nextEntry:Rp(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){Np(e,t,r[t])}))}return e}({},t,(0,l.pick)(Pp,e)))),Sp=e=>{if(1===e.length&&((0,l.pathEq)([0,"activeness","entity"],Pe.ALL,e)||(0,l.pathEq)([0,"activeness","relation"],Pe.ALL,e)))return!1},wp=(0,l.omit)(["activeness"]),Ip=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=Sp(t),{searchByOv:i}=r;t=(0,l.map)((0,l.pipe)((0,l.when)((0,l.prop)("nextEntry"),(e=>(0,l.pipe)(Rp(e),(0,l.omit)(Pp))(e))),wp,(0,l.omit)(["labels"])))(t);const a={limitCreditsConsumption:!0,activeness_enabled:n,options:i?"searchByOv":void 0},o=`/${e}/_connections${Cr(a)}`,s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)};return{url:o,options:s}},Up=(0,l.map)((e=>{let t=e;for(;t&&t.nextEntry;)t=t.nextEntry;return t})),Cp=(0,l.reject)(l.isNil),Dp=(0,l.unless)((0,l.startsWith)("/"),(0,l.concat)("/")),Lp=e=>zl(Dp(e),{method:"GET",headers:{"Content-Type":"application/json"}}),jp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r=(0,l.pipe)(t,Dp);return zl(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},kp=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?Ll()(i):null,startDate:a,endDate:o},c=(0,l.pipe)(Cp,ne,JSON.stringify);return zl(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(u)})},Fp=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"),Dp,n),o=hm(i(t),i(r)).concat(Om(t,r));return zl(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},Mp=(e,t,r)=>{const{url:n,options:i}=Ip(e,t,r);return zl(n,i).then(Up)},xp=(e,t)=>zl(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),$p=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===fn.IN?a.inRelations=[n]:a.outRelations=[n],zl(`/${e}/_ignoreSuggestedRelationship`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},Vp=e=>{let{servicesPath:t="",environment:r,tenant:n,application:i}=e;return zl(`${t}/recentSearches${Cr({environment:r,tenant:n})}`,{method:"GET",application:i,headers:{"Content-Type":"application/json"}})},Gp=e=>zl("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Wp=e=>{let{environment:t,tenant:r,createdDate:n}=e;return zl(`/recentSearches${Cr({environment:t,tenant:r,createdDate:n})}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};function Bp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Yp(e,t,r[t])}))}return e}function Yp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qp={select:"label,secondaryLabel,name,type,startDate,endDate"},Hp=(0,l.reject)(l.isNil),Qp=(0,l.pipe)(Hp,Ur),Kp=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i}=e;const a=Bp({},qp,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{},{limitCreditsConsumption:!0});return zl(`/${t}/_tree${Qp(a)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Jp=e=>{let{uri:t,graphUri:r}=e;const n=Bp({},qp,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return zl(`/${t}/_parents${Qp(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Xp=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1,limitCreditsConsumption:o,max:s}=e;const l=Bp({},qp,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},o?{limitCreditsConsumption:o}:{},s?{max:s}:{},{filterLastLevel:i,deep:a});return zl(`/${t}/_hops${Qp(l)}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function zp(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 Zp=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},ed="/activities",td=e=>{let{label:t,description:r}=e;return zl(ed,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:Zp()}})};var rd;!function(e){e.userSearch="USER_SEARCH",e.profileView="USER_PROFILE_VIEW"}(rd||(rd={}));const nd=e=>{const t=Cr(e);return zl(ed+t,{method:"GET"})},id=e=>zl(`/activities/_total${Cr(e)}`,{method:"GET"}),ad=e=>{const{entityUri:t}=e,r=zp(e,["entityUri"]);return zl(`/${t}/_activities${Cr(r)}`,{method:"GET"})},od=e=>{const{entityUri:t}=e,r=zp(e,["entityUri"]);return zl(`/${t}/_activities/_total${Cr(r)}`,{method:"GET"})};function sd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ld(e,t,r[t])}))}return e}function ld(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ud=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},cd=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return zl(ud({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},pd=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=ud({url:r,workflowPath:t,tenant:n})),zl(s,{method:i||"GET",body:JSON.stringify(a),headers:sd({"Content-Type":"application/json"},null!=o?o:{})})},dd=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=ud({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,l.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return zl(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)},yd=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=ud({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?sd({},l,{comment:o}):l;return zl(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},fd=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const u=ud({url:`/tasks${s?Cr(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(sd({objectURIs:[i]},(0,l.reject)(E,a)))};return zl(u,sd({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},Td=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i,max:a,offset:o}=e;return zl(ud({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})})},Ed=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i,max:a,offset:o}=e;return zl(ud({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)(sd({max:a,offset:o},i))})},md=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return zl(ud({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},hd=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return zl(ud({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},bd=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return hd({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},Od=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return zl(ud({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},vd=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return hd({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},gd=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return hd({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},_d=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return hd({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},Ad=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a}=e;return zl(ud({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a})})},Nd=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return zl(ud({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},Pd=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(Os);return a&&a[0]&&(r=n.length>0&&a[0].value?Pd(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}}),""),Rd=(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=Pd(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},Sd=/[,\s]*$/,wd=e=>{const t=En().text(yn);if(!e)return t;const r=e.replace(Sd,"");return""===r.toString().trim()?t:r},Id=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},Ud=(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=Id(e,r.referencedEntityTypeURI);if(n)return Rd({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return Rd({attributes:t||{}},r.dataLabelPattern);return""},Cd=e=>{let{uiPath:t,uri:r}=e;return`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},Dd=e=>{let{uiPath:t,tag:r,entityUri:n}=e;return`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},Ld=(0,l.curry)(((e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"")),jd=(0,l.when)((0,l.is)(Object),(0,l.ifElse)((0,l.pipe)((0,l.prop)("value"),(0,l.is)(Object)),Yl,(0,l.prop)("value"))),kd=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),jd),Fd=(e,t,r)=>{const n=kd(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)(Fs(e),jd)))(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")])})(Yr(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>js(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,jd))(r)})(e,r)||Xr(e,r.type);return Ld(t,n)};function Md(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){xd(e,t,r[t])}))}return e}function xd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $d="DTSS/",Vd=(0,l.replace)(new RegExp("^entities/"),""),Gd=e=>$d+e.dataTenant+"/"+e.uri,Wd=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),Bd=e=>!(!e||!e.dataTenant),Yd=(0,l.startsWith)($d),qd=(0,l.pipe)((0,l.ifElse)(Yd,(0,l.pipe)((0,l.split)("/"),(0,l.nth)(1)),(0,l.always)(null))),Hd=(0,l.ifElse)(Bd,Gd,(0,l.prop)("uri")),Qd=e=>e&&e.uri?e.dataTenant?Gd(e):Vd(e.uri):"",Kd=(0,l.curry)(((e,t,r)=>(Yr(t,r.type)||{})[e]||"")),Jd=Kd("label"),Xd=Kd("typeGraphIcon"),zd=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=Yr(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(Os)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:Ud(e,o,i),uri:a.uri}})).filter(l.identity):[]},Zd=(0,l.pipe)(zd,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),ey=(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=ey(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):ey(e.slice(1),r)}})),ty=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,ry=e=>(0,l.propOr)([],"matchRules",e),ny=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?Md({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},iy=(e,t,r)=>t&&r?r.aEntity:e,ay=(0,l.evolve)({attributes:Ll(!0)}),oy=(0,l.pipe)(ay,(0,l.props)(["attributes","startDate","endDate","roles","tags"]),(0,l.all)(E)),sy=e=>(0,l.assoc)("dataTenant",e),ly=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 zl(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),Ur)(d)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},uy=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 zl(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),Ur)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},cy=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return zl("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},py=(e,t,r)=>Promise.all(t.map((async t=>await zl(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})))),dy=async(e,t)=>await py(e,t,"NOT"),yy=async(e,t)=>await py(e,t,"MATCH"),fy=async(e,t)=>await Promise.all(t.map((async t=>await zl(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}}))));function Ty(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ey(e,t,r[t])}))}return e}function Ey(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function my(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 hy=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return zl(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},by=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return My({url:`entities/_connections/_hasNonImported?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}})},Oy=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return My({url:`entities/_connections/_import?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}})},vy=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return zl(`${t}entities/_merge?dataEntityUri=${i}&customerEntityUri=${a}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},gy=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 vy({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},_y=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{uri:a}=n,[o,s]=(0,l.partition)(Bd,i);return Promise.all([s.length?cy(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return vy({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},Ay=(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=my(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)}),[])),Ny=(0,l.pipe)((0,l.find)((0,l.propEq)("index",0)),(0,l.propOr)({},"object"),Ay),Py=e=>{let{dtssPath:t,customerTenant:r,entity:n}=e;const{uri:i,dataTenant:a}=n;return zl(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:a,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(Ny)},Ry=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)},Sy=Ry((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return zl(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{uri:a,type:o}])}).then(Ny)})),wy=Ry((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return zl(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),Iy=(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)}},Uy=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return zl(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},Cy=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 Uy(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},Dy=Cy("NOT"),Ly=Cy("MATCH"),jy=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{uri:o}=i,[s,u]=(0,l.partition)(Bd,a);return Promise.all([py(o,u,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return Uy(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},ky=jy("NOT"),Fy=jy("MATCH");function My(e){let{requestProvider:t=zl,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}`,Ty({},my(s,["headers"]),{headers:Ty({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const xy=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return My({url:ep(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},$y=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return My({url:Yc(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},Vy=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a,options:o}=e;const{searchByOv:s}=o,{options:u}=Ip(t,r);return My({url:`entities/_connections/_getConnections${Cr({dataEntityUri:t,options:s?"searchByOv":void 0})}`,options:u,dataTenant:n,customerTenant:i,dtssPath:a}).then((0,l.pipe)(Up,(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)))}))))},Gy=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return My({url:`${op(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},Wy=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return zl(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},By=e=>{let{dtssPath:t,tenant:r}=e;return zl(`${t}tenants/customerTenants?id=${r}&useCache=true`,{method:"GET"})},Yy=e=>{let{dtssPath:t,customerTenant:r}=e;return zl(`${t}subscriptions?useCache=true`,{method:"GET",headers:{CustomerTenant:r}})},qy=e=>{let{dtssPath:t,tenants:r}=e;return zl(`${t}tenants/dataTenants?id=${r}&useCache=true`,{method:"GET"})},Hy=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return My({url:op(t),dataTenant:r,customerTenant:n,dtssPath:i})},Qy=()=>zl("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET"});function Ky(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Jy(e,t,r[t])}))}return e}function Jy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xy=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=Ky({},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 zl(`${t}/api/${r}/graph/search${Cr({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},zy=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return zl(`${t}/api/${r}/graph/search/count`,{method:"POST",body:Ky({},n,i),headers:{"Content-Type":"application/json"}})},Zy=(e,t)=>`${e}/${t}/comments`,ef=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return zl(`${Zy(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},tf=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return zl(`${Zy(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},rf=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return zl(Zy(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},nf=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return zl(`${Zy(t,r)}/${n.commentId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},af=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return zl(`${Zy(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},of=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i}=e;return zl(`${Zy(t,r)}/${n}/replies/${i}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},sf=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i,data:a}=e;return zl(`${Zy(t,r)}/${n}/replies/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},lf=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return zl(`${Zy(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},uf=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=Cr({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return zl(`${Zy(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function cf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){pf(e,t,r[t])}))}return e}function pf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const df=e=>{let{tenant:t,servicesPath:r}=e;return zl(`${r}/users/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})},yf="graphExport",ff=async(e,t,r,n,i)=>{let a;try{const{data:n={}}=await hf({servicesPath:e,tenant:t,environment:r,namespace:yf,options:{method:"GET",headers:{"Content-Type":"application/json"}}});a=n}catch(e){a={}}const o={body:JSON.stringify(cf({},a,{[n]:i})),headers:{"Content-Type":"application/json"}};let s;try{s=await hf({servicesPath:e,tenant:t,environment:r,namespace:yf,options:cf({method:"PUT"},o)})}catch(e){s=null}return s||(s=await hf({servicesPath:e,tenant:t,environment:r,namespace:yf,options:cf({method:"POST"},o)})),s},Tf=e=>{let{servicesPath:t,key:r}=e;return zl(`${t}/settings${Cr({key:r})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Ef=e=>{let{servicesPath:t}=e;return zl(`${t}/version/collect`,{method:"POST",headers:{"Content-Type":"application/json"}})},mf=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return zl(`${n}/plugins${Cr({tenant:t,user:r})}`,{method:"GET"})},hf=e=>{let{tenant:t,environment:r,servicesPath:n,options:i,namespace:a,projection:o}=e;return zl(`${n}/configService${Cr({tenant:t,environment:r,namespace:a,projection:o})}`,i)},bf=e=>{let{tenant:t,environment:r,servicesPath:n}=e;return hf({tenant:t,environment:r,servicesPath:n,options:{method:"GET"}})},Of=e=>{let{servicesPath:t,stateHash:r}=e;return zl(`${t}/searchLink?key=${r}`,{method:"GET"})},vf=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),zl(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},gf=e=>zl(`/${e}?showObjectsInfo=true`,{method:"GET"}),_f=e=>{let{exportPath:t,tenant:r,options:n}=e;return zl(`${t}/${r}/activities${Cr(n)}`,{method:"POST"})};function Af(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Nf(e,t,r[t])}))}return e}function Nf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Pf=e=>{const{entityUri:t}=e;return zl(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},Rf=e=>{let{entityUri:t,crosswalk:r}=e;return zl(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},Sf=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return zl("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[Af({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),Af({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},wf=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return zl(`/${r}/_${n}${Cr({contributorURI:t})}`,{method:"POST"})},If=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return zl(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},Uf=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return zl(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},Cf=e=>{let{entityUri:t,crosswalkId:r}=e;return zl(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})};function Df(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Lf=e=>{let{entityTypeUri:t}=e;return zl(`/dataQuality/fillRates${Ur({entityType:Ct(t)})}`,{method:"GET"})},jf=e=>{let{attributes:t=[],metrics:r=[]}=e;const n=r.length,i=t.length*n;return i>10?10:i},kf=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){Df(e,t,r[t])}))}return e}({},n===Me.ATTRIBUTE_TYPE?{attributes:r}:{},i?{metrics:i}:{}),o=n===Me.ATTRIBUTE_TYPE?Ur({numberOfThreads:jf({attributes:r,metrics:i})||1}):"";return zl(`/entityType/${Ct(t)}/dataQuality/${n}${o}`,{method:"POST",body:JSON.stringify(a)})},Ff=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n,env:i}=e;return zl(`${t}/api/${r}/dataValidationFunctions/entityTypes/${Ct(n)}`,{method:"GET",headers:{env:i}})},Mf=e=>{let{mlDqPath:t,tenant:r,entityTypeUri:n,attribute:i,viewMultiplier:a=1,dataLevel:o=Me.ATTRIBUTE_TYPE,metrics:s=[],startDate:l,endDate:u}=e;const c={attribute:i,metrics:s,viewMultiplier:a,startDate:l,endDate:u};return zl(`${t}/${r}/entityType/${Ct(n)}/ml/dataQuality/v1/${o}/timeSeries/`,{method:"POST",body:JSON.stringify(c)})},xf=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return zl(`/${t}${Cr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},$f=e=>{let{attributeUri:t,value:r}=e;return zl(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},Vf=e=>{let{attributeUri:t,value:r}=e;return zl(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},Gf=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return zl(`/${t}${Cr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},Wf=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=Cr({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=Ll()([[{value:a}]]);return zl(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},Bf=e=>{let{entityUri:t,attributeName:r,value:n}=e;return zl(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},Yf=e=>{let{entityUri:t,attributeName:r}=e;return zl(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};function qf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Hf=e=>{let{entityUri:t}=e;return zl(`/${t}/_historicURIs`,{method:"GET"})},Qf=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 zl(`/${t}/_changesWithTotal${Cr(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){qf(e,t,r[t])}))}return e}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},Kf=(e,t)=>zl(`/${e}/_previousChange${Cr({timestamp:t})}`,{method:"GET"}),Jf=(e,t)=>zl(`/${e}${Cr({time:t})}`,{method:"GET"});function Xf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){zf(e,t,r[t])}))}return e}function zf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zf=e=>{let{url:t,method:r,data:n,headers:i,noRequestProcessor:a}=e;return zl(t,{method:r||"GET",body:n,headers:Xf({"Content-Type":"application/json"},null!=i?i:{}),noRequestProcessor:a})},eT=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=Cr({options:a.join(","),severity:o.join(",")});return zl(`${t}/validate/${i}/entity/${Qd({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},tT=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return zl(`${t}/validate/${n}/entity${Cr({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},rT=e=>{let{tenant:t,apiPath:r}=e;return zl(`${r}/tenants/${t}/name`,{method:"GET"})},nT=e=>{let{tenant:t,apiPath:r}=e;return zl(`${r}/tenants/${t}/_rdmTenants`,{method:"GET"})},iT=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e;return zl(`${a}/preferences${Cr({name:t,tenant:r,environment:n,user:i})}`,{method:"GET"})},aT=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 zl(`${a}/preferences`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})},oT=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e,o={name:t,tenant:r,environment:n,user:i};return zl(`${a}/preferences`,{method:"DELETE",body:JSON.stringify(o)})},sT=e=>{const{servicesPath:t}=e;return zl(`${t}/getTokenForWorker`,{method:"GET"})};var lT=r(29524);const uT=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=_t(),s={attributes:gl({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=js(r,e,n.uri)[0];return i&&i.value?Rl({entity:e,attributeType:n,uri:i.uri,value:t}):Nl({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},cT=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.filter)((0,l.has)("refEntity")),(0,l.map)(Is),(0,l.filter)(gt),(0,l.map)((t=>e[t])),(0,l.reject)(l.isNil))((null==t?void 0:t.attributes)||{}),pT=(0,l.curry)(((e,t)=>{const r=cT(e=e||{},t=t||{});return r.concat((0,l.chain)(pT(e),r))})),dT=(0,l.curry)(((e,t)=>(0,l.pipe)(ce,(0,l.filter)(e))(t))),yT=dT((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),fT=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),gt)),TT=e=>(0,l.pipe)(yT,fT(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),ET=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(yT,(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})),mT=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),gt),(0,l.omit)(["uri","timestamp"])),hT=(0,l.pipe)(mT,ay),bT=async(e,t,r)=>{if(!e)return null;const n=TT(e);if(n.length>0)for(const r of n)e=ET(r,t[r],e);const i=await cp(hT(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},OT=async(e,t,r)=>{const n=gT(e,t),i={};for(const t of n)i[t]=await bT(e[t],i,r);return i},vT=(0,l.curry)(((e,t)=>{const r=lT.Node(t);return TT(e[t]).forEach((t=>{const n=vT(e,t);r.addEdge(n)})),r})),gT=(e,t)=>(0,l.pipe)((0,l.map)(vT(e)),(0,l.map)(lT.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),_T=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)(mT))})),AT=(e,t)=>[...Nm(e.tags||[],t.tags||[]),...Pm(e.roles||[],t.roles||[]),...bm(e,t),...Om(e,t)],NT=(e,t)=>[...vm(hm((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),Am((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e),...AT(e,t)],PT=(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 ET(r,n,e)}),e))))}),t)}),_T),RT=(0,l.curry)(((e,t)=>(0,l.when)(gt,(0,l.propOr)(l.__,t,e),t)));function ST(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){wT(e,t,r[t])}))}return e}function wT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const IT=e=>{let{parentUri:t,relation:r,entityUri:n}=e;return{type:xe.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},UT=e=>{let{relationUri:t}=e;return{type:xe.DELETE_RELATION,parameters:{relationUri:t}}},CT=e=>{let{parentUri:t,entityUri:r,relationType:n,relationDirection:i}=e;return{type:xe.IGNORE_RELATION,parameters:{parentUri:t,entityUri:r,relationType:n,relationDirection:i}}},DT=e=>{let{oldRelation:t,newRelation:r}=e;return{type:xe.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},LT=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:xe.REPOINT_RELATION,parameters:{entityUri:t,newEntityUri:r,relation:n,isReversed:i}}},jT=(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))),kT=e=>e.type===xe.DELETE_RELATION,FT=e=>e.type===xe.CREATE_RELATION,MT=e=>e.type===xe.REPOINT_RELATION,xT=e=>e.type===xe.UPDATE_RELATION,$T=e=>e.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve()),VT=e=>{let{type:t,parameters:r,dcrProcessor:n}=e;const{enhanceUriWithDCR:i,updateDCRUriFromResponse:a}=n,o=e=>(a(e),e);switch(t){case xe.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:a,attributes:s,startDate:l,endDate:u}=t;return kp({startEntityUri:e,endEntityUri:n,relationType:a,attributes:s,startDate:l,endDate:u,uriPreprocessor:i}).then(o)};case xe.DELETE_RELATION:return()=>{const{relationUri:e}=r;return jp(e,i).then(o)};case xe.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return $p(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(o)};case xe.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return Fp({oldRelation:e,newRelation:t,uriPreprocessor:i}).then(o)};case xe.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:i,isReversed:a}=r,{uri:o}=i,s=[UT({relationUri:o}),IT({parentUri:a?e:t,relation:i,entityUri:a?t:e})];return(0,l.pipe)((0,l.map)(WT(n)),(0,l.map)(VT),$T)(s)}}},GT=e=>t=>()=>e().then(t),WT=e=>t=>ST({dcrProcessor:e},t),BT=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=jr({alwaysCreateDCR:e,dcrUri:t});return{commandExecutor:(0,l.pipe)(l.flatten,(0,l.map)(WT(r)),(0,l.map)(VT),(0,l.map)(GT(r.getDcrUriAwait)),$T,(0,l.otherwise)((e=>({errorMessage:e})))),dcrProcessor:r}},YT=e=>t=>(0,l.map)((t=>ST({},t,{parameters:(0,l.evolve)({parentUri:RT(e),entityUri:RT(e),newEntityUri:RT(e)},t.parameters)})),t),qT=e=>{let{condition:t,updater:r}=e;return e=>t(e)?r(e):e},HT=(e,t)=>{const r=e.filter(FT).find(jT(t));let n=null,i=null,a=null;const o=e.filter(((o,s)=>xT(o)&&jT(t,o)?(s>e.indexOf(r)&&(n=o.parameters.newRelation),!1):!MT(o)||!jT(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(qT({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},QT=(e,t)=>{const r=e.filter(MT).filter(jT(t));let n=null;const i=e.filter(((i,a)=>r.includes(i)?(0,l.last)(r)===i:!xT(i)||!jT(t,i)||(a>e.indexOf((0,l.last)(r))&&(n=i.parameters.newRelation),!1)));return n?i.map(qT({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({relation:(0,l.always)(n)})})(e)})):i},KT=(e,t)=>{const r=e.filter(kT).filter(jT(t));return e.filter((e=>r.includes(e)?(0,l.last)(r)===e:!jT(t,e)))},JT=(e,t)=>{const r=e.filter(xT).filter(jT(t));let n=null;const i=e.filter((e=>!r.includes(e)||!xT(e)||(n=n||e.parameters.oldRelation,(0,l.last)(r)===e)));return n?i.map(qT({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({oldRelation:(0,l.always)(n)})})(e)})):i},XT=e=>{const t=e.filter(kT).map((e=>{let{parameters:{relationUri:t}}=e;return t}));return(0,l.uniq)(t).reduce(KT,e)},zT=e=>{const t=e.filter(FT).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(HT,e)},ZT=e=>{const t=e.filter(MT).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(QT,e)},eE=e=>{const t=e.filter(xT).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)(JT,e))(t)},tE=e=>(0,l.pipe)(XT,zT,ZT,eE)(e);function rE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){nE(e,t,r[t])}))}return e}function nE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const iE=e=>rE({},(0,l.path)(EE(),e),{startDate:(0,l.path)(OE(),e),endDate:(0,l.path)(vE(),e)}),aE=(e,t)=>(0,l.pipe)((0,l.path)(bE()),RT(t))(e),oE=(e,t,r,n)=>{let{removedUris:i=[],addedConnections:a=[],editedConnections:o=[],ignoredRelationData:s=[]}=t;return[...a.map((e=>{const t=aE(e,r),i=(0,l.path)(mE(),e)===$e.IN,a=e.parentEntityUri||n;return IT({parentUri:i?t:a,relation:iE(e),entityUri:i?a:t})})),...o.map((t=>{const i=aE(t,r),a=(0,l.path)(mE(),t)===$e.IN,o=i!==(0,l.pipe)((0,l.path)(EE()),a?gE:_E)(t),s=PE(e,(0,l.path)(fE(),t)),u=t.parentEntityUri||n,c=RT(r,i);return o?LT({entityUri:a?u:c,newEntityUri:a?c:u,relation:(0,l.path)(EE(),t),isReversed:!1}):DT({oldRelation:(0,l.path)(EE(),s),newRelation:iE(t)})})),...i.map((e=>UT({relationUri:e}))),...s.map((e=>CT({parentUri:n,entityUri:e.entityUri,relationType:e.relationType,relationDirection:e.relationDirection})))]},sE=e=>(e||[]).reduce(((e,t)=>{let{entity:r}=t;const n=r.dataTenant;return rE({},e,{[r.entityUri]:{uri:r.entityUri,label:r.entityLabel,type:r.entityType,dataTenant:n}})}),{}),lE=(0,l.has)("dataTenant"),uE=(0,l.ifElse)(lE,(e=>{let{relationUri:t,dataTenant:r}=e;return`DTSS/${r}/${t}`}),(0,l.prop)("relationUri")),cE=(e,t)=>(0,l.pipe)(_i,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(zs),Va)(e,t),pE=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)}},dE=(e,t,r)=>{const n=Rd(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)},yE="relation",fE=(0,l.always)([yE,"relationUri"]),TE=(0,l.always)([yE,"relationType"]),EE=(0,l.always)([yE,"object"]),mE=(0,l.always)([yE,"direction"]),hE=(0,l.always)([yE,"object","attributes"]),bE=(0,l.always)(["entity","entityUri"]),OE=(0,l.always)([yE,"startDate"]),vE=(0,l.always)([yE,"endDate"]),gE=(0,l.path)(["startObject","objectURI"]),_E=(0,l.path)(["endObject","objectURI"]),AE=(0,l.path)(["startObject","objectTypeURI"]),NE=(0,l.path)(["endObject","objectTypeURI"]),PE=(e,t)=>{for(const r of e){if((0,l.pipe)((0,l.path)(fE()),(0,l.equals)(t))(r))return r;if(r.connections){const e=PE(r.connections,t);if(e)return e}}},RE=(0,l.pipe)(PE,(0,l.path)(EE())),SE=(0,l.allPass)([(0,l.pipe)((0,l.path)(bE()),(0,l.complement)(E)),(0,l.pipe)((0,l.path)(TE()),(0,l.complement)(E))]),wE=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:At()},entity:{},isNew:!0},{relationType:o,direction:s}=a.relation,{inRelations:u,outRelations:c}=CE({content:i?t.contentSecondLevel:t.content,direction:s,relationType:o,mode:r,metadata:n}),p=IE(u,c);return(0,l.pipe)((0,l.evolve)({relation:p?pE(p):l.identity}),(0,l.defaultTo)({}),(0,l.when)((0,l.always)(i),(0,l.assoc)("parentEntityUri",i)))(a)},IE=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:fn.IN}:{type:t[0],direction:fn.OUT}:null},UE=e=>e.uri||e,CE=e=>{let{content:t,direction:r,relationType:n,mode:i,metadata:a}=e;const o={},s=e=>t=>{const a=t&&ki(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===fn.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"],Yr(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],Yr(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(UE,_i(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(fn.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(fn.OUT)),(0,l.map)(u))},t)||{}},DE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}=Si({reversedContextLabels:!0}),a=(0,l.curry)(((e,t,r,n)=>{const[i,a]=Ni(e,n.uri);return n&&(!t||Hr(e,i,t))&&(!r||Hr(e,a,r))})),o=t=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],Yr(e,t.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],Yr(e,t.endObject.objectTypeURI)))(t),s=(e.relationTypes||[]).filter((0,l.both)(as,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)}},LE=(0,l.curry)(((e,t,r,n,i)=>{const a=Hr(n,l.__,t.type),o=e?NE:AE,s=Hr(n,l.__,r.type),u=e?AE:NE;return(0,l.both)((0,l.pipe)(o,a),(0,l.pipe)(u,s))(i)})),jE=(e,t,r)=>{const n=e?NE:AE,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(Hr(t,l.__,r))})),(0,l.reject)((0,l.prop)("abstract")),(0,l.map)((0,l.prop)("uri")))(t.entityTypes||[])};function kE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){FE(e,t,r[t])}))}return e}function FE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ME=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return kE({},t,{[r]:{parents:n,children:i}})},xE=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return kE({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},$E=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=cT(t,i),o=ME({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>$E(n.uri,t,[e],r)),o)},VE=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)(fE(),n),a=t?xE({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(bE(),n),s=gt(o)?[o]:[],u=ME({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>$E(t,r,[i],e)),u)}),n)},GE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return VE(r,e,t,$E(e,t))},WE=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return GE(t,r,n);if(Pt(e)){const t=PE(n,e);return t&&VE([t],null,r)}return r[e]?$E(e,r):void 0},BE=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>BE(e,t))))},YE=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>YE(e,t))))},qE=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=Nt(t),u=GE(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(Pt(c)){if(s=PE(i,c),!s)return null;o.push({type:ge.relationConnection,value:s,valueType:_i(a,(0,l.path)(TE(),s))});continue}if(Pt(u)){const e=n[c];if(!e)return null;o.push({type:ge.tempEntity,value:e,valueType:Yr(a,e.type)});continue}const p=n[u],d=Js(p,c),y=n[c];if(!d||!y)return null;o.push({type:ge.attributeValue,value:d,valueType:dr(a,kt(d.uri,p.type))}),o.push({type:ge.tempEntity,value:y,valueType:Yr(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},YE(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=Pt(s),d=p?RE(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?_i(a,d.type):Yr(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:yr(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:ge.tempEntity,value:T,valueType:Yr(a,T.type)}),o.push({type:ge.attributeValue,value:s,valueType:E}),m=s.value;const l=Is(s);T=l&&gt(l)?n[l]:null}}return o},HE=e=>e.every((e=>{let{type:t}=e;return[ge.attributeValue,ge.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===ge.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null;let QE;!function(e){e.insertAttribute="insertAttribute",e.updateAttribute="updateAttribute",e.deleteAttribute="deleteAttribute"}(QE||(QE={}));const KE={[QE.insertAttribute]:{color:"#599E0E"},[QE.updateAttribute]:{backgroundColor:"rgba(255, 187, 0, 0.12)",color:"#CC7500"},[QE.deleteAttribute]:{backgroundColor:"rgba(255, 50, 0, 0.2)",color:"#CF0E26"}},JE=e=>{switch(e){case"UPDATE_ATTRIBUTE":return QE.updateAttribute;case"UNDO_IGNORE_ATTRIBUTE":case"INSERT_ATTRIBUTE":return QE.insertAttribute;case"IGNORE_ATTRIBUTE":case"DELETE_ATTRIBUTE":return QE.deleteAttribute;default:return""}},XE="/",zE=(0,l.pipe)((0,l.split)(XE),(0,l.propSatisfies)((0,l.lte)(2),"length")),ZE=(0,l.pipe)((0,l.split)(XE),(0,l.slice)(0,-2),(0,l.join)(XE)),em=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.has)(e),(0,l.prop)(e)],[()=>zE(e),em(ZE(e))]])(t))),tm=e=>(0,l.pipe)(l.keys,(0,l.any)((0,l.startsWith)(e+XE))),rm=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=em(e,t);return(0,l.isNil)(r)?tm(e)(t)?"UPDATE_ATTRIBUTE":"":r},nm=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]},im=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(im(e))}))}))),t},am=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)(um,t),(0,l.propOr)([],"crosswalks",e))),e),om=(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(om(e))}))})),r},sm=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=sm(e);r>t&&(t=r)}))})),t+1):t},lm=(e,t)=>{if(gt(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},um=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},cm=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},pm=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},dm=(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)},ym=(0,l.eqBy)(um),fm=(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)(As,(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 Tm(e){return e&&void 0!==e.uri}function Em(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 mm(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 hm(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(hm(d.value,y.value,r)):"Reference"===g(d)?mm(d,y)?o.push.apply(o,hm(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&&(ue(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(ue(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 bm(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)||Tm(r)&&Tm(n)&&r.uri===n.uri||i.push({type:"UPDATE_PROFILE_PIC_BY_URL",newValue:{value:t.defaultProfilePicValue}}),i}function Om(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 vm(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=gm(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?_m(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=gm(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 gm=(e,t)=>e.filter((function(e){return 1===(e.attributes||e.attributeURIs||[]).filter((function(e){return e===t})).length})),_m=(e,t,r)=>(0,l.pipe)(Xs,(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 lm(t,r)},e=>{let[t]=e;return!Os(t)}]),(0,l.prop)(0),(0,l.always)(null)))(e,r);function Am(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 Nm(e,t){return Em("UPDATE_TAGS").call(this,e,t)}function Pm(e,t){return Em("UPDATE_ROLES").call(this,e,t)}function Rm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Sm(e,t,r[t])}))}return e}function Sm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var wm=function(e){var t=function(e,r,n,i){if(e&&r)if(n||(n=null),i=!!i,Array.isArray(e))for(var a=0;a<e.length;a++)r.call(n,a,e[a],e),i&&t(e[a],r,n,i);else if(ue(e))for(var o in e)r.call(n,o,e[o],e),i&&t(e[o],r,n,i)},r=function(e,t,r){return function(n){var i=-1!==n.uri.lastIndexOf("/")?n.uri.substring(0,n.uri.lastIndexOf("/")):"";e[i]||(e[i]=[]),e[i].push(n.type),t[n.uri]=n.type,"IGNORE_ATTRIBUTE"===n.type&&r.push(n.uri)}},n=function(e,t,r){var n=[],i=Object.keys(e).filter((function(t){return-1!==e[t].indexOf("IGNORE_ATTRIBUTE")&&-1!==e[t].indexOf("INSERT_ATTRIBUTE")}));return Object.keys(t).filter((function(e){var t=-1!==e.lastIndexOf("/")?e.substring(0,e.lastIndexOf("/")):null;return-1!==i.indexOf(t)})).forEach((function(e){-1!==r.indexOf(e)&&n.push(e),t[e]="UPDATE_ATTRIBUTE"})),{appearance:t,ignored:n}},i=function(e,t){var r=Array.isArray(t),n=r?[]:{};return r?(e=e||[]).some((function(e){return e.uri}))?n=function(e,t){var r=e.map((function(e){return e.uri})),n=e.map((function(e){var r,n,a=(n=t.filter((function(t){return t.uri===e.uri}))[0]||{},(r=e)&&n&&r.ignored!==n.ignored&&(delete r.ignored,delete n.ignored,r.ov=!0,n.ov=!0),{a:r,b:n});return i(a.a,a.b)})),a=t.filter((function(e){return-1===r.indexOf(e.uri)}));return n.concat(a)}(e,t):(n=n.concat(e),t.forEach((function(t,r){void 0===n[r]?n[r]=t:ue(t)?n[r]=i(e[r],t):-1===e.indexOf(t)&&n.push(t)}))):(ue(e)&&Object.keys(e).forEach((function(t){n[t]=e[t]})),Object.keys(t).forEach((function(r){ue(t[r])&&e[r]?n[r]=i(e[r],t[r]):n[r]=t[r]}))),n},a=function(){let a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var s=JSON.parse(JSON.stringify(a)),l=JSON.parse(JSON.stringify(o)),u=i(a,o),c={},p={},d=[],y=r(p,c,d);e.compareAttributes(u,l).map((function(e){return"IGNORE_ATTRIBUTE"===e.type&&!1===e.newValue.value&&(e.type="UNDO_IGNORE_ATTRIBUTE"),e})).forEach((function(e){y(e)})),e.compareAttributes(u,s).map((function(e){return"DELETE_ATTRIBUTE"===e.type&&(e.type="INSERT_ATTRIBUTE"),"IGNORE_ATTRIBUTE"===e.type&&(e.type=e.newValue.value?"UNDO_IGNORE_ATTRIBUTE":"IGNORE_ATTRIBUTE"),e})).forEach((function(e){y(e)}));var f=n(p,c,d);return t(u,(function(e,t){t&&-1!==this.indexOf(t.uri)&&(t.ignored=!0,delete t.ov,t.hidden=!0)}),f.ignored,!0),{attributes:u,appearance:f.appearance}};const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=(0,l.difference)(t,e),n=(0,l.difference)(e,t),i=n.concat(t),a=(e,t)=>(0,l.pipe)((0,l.map)((t=>[t,e])),l.fromPairs)(t),o=Rm({},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:Rm({},n,{roles:s,tags:u}),roles:i,tags:l}}}};const Im=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?Im(t.value):[]];return e.concat(r)}),[])),Um=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,Cm=e=>e?[Hd(e)]:[],Dm=e=>{const t=[...Im((null==e?void 0:e.attributes)||[]),...Im((null==e?void 0:e.analyticsAttributes)||[])];return e?[...Cm(e),...t]:[]},Lm=(e,t)=>[e,...t.map((t=>Um(e,t)))],jm=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return uE(t)}))},km=(e,t)=>{switch(e){case _e.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case _e.ENTITY_ATTRIBUTE:case _e.RELATION_ATTRIBUTE:return(e=>{let{uri:t}=e;return[Ft(t)]})(t);case _e.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case _e.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n,dataTenant:i}}}=e;return[t,Hd({uri:n,dataTenant:i}),r]})(t)}},Fm=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),Mm=(0,l.curry)(((e,t)=>{const r=wo(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(Mm(e,r.extendsTypeURI)):n})),xm=(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))),$m=(e,t)=>(0,l.pipe)((0,l.prop)("type"),Mm(e),xm(t))(t);function Vm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Gm=e=>{let{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}},Wm=e=>!e.deactivated,Bm=e=>{let{attributeTypeUri:t,uri:r,parentUri:n}=e;return`${t}-${r}-${n}`},Ym=e=>Bm(e)+e.message,qm=(0,l.unless)(l.isNil,(0,l.prop)("message")),Hm=(0,l.unless)(l.isNil,(0,l.prop)("type")),Qm=(0,l.curry)(((e,t)=>It(t.parentUri,e))),Km=(0,l.curry)(((e,t)=>t.parentUri===e)),Jm=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pipe)((0,l.prop)("uri"),It(t.attributeTypeUri)),l.T],[(0,l.both)((0,l.propEq)("type",nt.TYPE_REFERENCE),(0,l.pipe)(lt,(0,l.any)(It(t.attributeTypeUri)))),l.T],[l.T,l.F]])(e))),Xm=(0,l.curry)(((e,t)=>t.attributeTypeUri===e)),zm=(0,l.curry)(((e,t,r)=>e===r.parentUri&&t!==r.attributeTypeUri)),Zm=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,l.filter)((0,l.allPass)([sh,Wm,Qm(e),Jm(t),(0,l.complement)(zm(e,t.uri))]))(r)},eh=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=(0,l.find)((0,l.allPass)([sh,Wm,Km(e),Xm(t.uri),(0,l.complement)((0,l.prop)("uri")),(0,l.complement)((0,l.propEq)("type",he.missed))]))(r);return n&&n.message||""},th=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===he.missed))},rh=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([Wm,(0,l.propEq)("type",he.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(fE(),e))]))(t)},nh=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([Wm,(0,l.propEq)("type",he.missedRefEntity),(0,l.propEq)("parentUri",e.uri)]))(t)},ih=function(e){let{uri:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.any)((0,l.allPass)([Wm,Qm(t)]))(r)},ah=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([Wm,(0,l.propEq)("type",he.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(["relation","uri"],e))]))(t)},oh=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?qE(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 ge.attributeValue:{const e=a;if(rr(a))return Rd(o,e.dataLabelPattern);if(nr(a)){const t=o,i=Is(t),a=ot(e),s=Yr(n,a);return gt(i)?Rd(r[i],s.dataLabelPattern):t.label}return""}case ge.tempEntity:return Rd(o,a.dataLabelPattern);case ge.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=Yr(n,null==e?void 0:e.entityType);return`${wd(i&&gt(i)?Rd(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||Ai(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){Vm(e,t,r[t])}))}return e}({},e,{label:wd(t)})}))},sh=e=>!e.severity||e.severity===Oe.ERROR,lh=(0,l.curry)(((e,t)=>{let r=t.value;switch(e.type){case nt.TYPE_NESTED:return Object.keys(r).some((t=>{const n=e.attributes.find((0,l.propEq)("name",t));return r[t].some(lh(n))}));case nt.TYPE_REFERENCE:return!!_s(t);case nt.TYPE_BOOLEAN:return!0===r||!1===r||"true"===r||"false"===r;default:return"string"==typeof r&&(r=r.trim()),null!=r&&""!==r}})),uh=(e,t)=>e.every((0,l.complement)(lh(t))),ch=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const n=Do(e,t.type||t.relationType,!0).filter(r);return n.reduce(((r,n)=>{const i=js(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!Os(e.parent))))).forEach((e=>{uh(e.attrValues,n)&&r.push(Gm({type:he.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:En().text("Attribute is required"),source:be.local}))})),r}),[])},ph=(0,l.curry)(((e,t,r)=>js(e,t,r,!1))),dh=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),Yr(e),(0,l.prop)("attributes"),(0,l.defaultTo)([]),(0,l.reject)(er),(0,l.filter)(nr),(0,l.map)((0,l.prop)("uri")),(0,l.chain)(ph(e,t)));return(0,l.pipe)(r,(0,l.reject)(Is),(0,l.map)((e=>{let{uri:r}=e;return Gm({type:he.missedRefEntity,uri:"",attributeTypeUri:kt(r,t.type),parentUri:r,message:En().text("Entity is required"),source:be.local})})))(t)},yh=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,l.has)("refEntity")).filter((0,l.pipe)(Is,gt)).flatMap((n=>{const i=Is(n),a=t[i],o=dr(e,kt(n.uri,r.type));return fh(e,t,o,a)})),fh=(e,t,r,n)=>{const i=lt(r),a=i.map((t=>dr(e,t))).filter((0,l.both)(l.identity,(0,l.propEq)("type",nt.TYPE_REFERENCE))).flatMap(ct).concat(i);return Th(e,t,n,(e=>a.some(It(e.uri))))},Th=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity;const i=ch(e,r,n),a=dh(e,r),o=yh(e,t,r);return[...i,...a,...o]},Eh=(e,t)=>{const r=(0,l.path)(EE(),t)||{};return ch(e,r)},mh=(e,t,r)=>{t=t||{};const n=(0,l.pipe)((0,l.path)(bE()),(0,l.ifElse)(gt,(e=>t[e]),(0,l.always)(null)))(r),i=Eh(e,r),a=(e=>(0,l.path)(bE(),e)?[]:[Gm({type:he.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(TE(),e),parentUri:(0,l.path)(fE(),e),message:En().text("Entity is required"),source:be.local})])(r),o=((e,t,r)=>r?Th(e,t,r):[])(e,t,n);return[...i,...a,...o]},hh=e=>(0,l.path)(["entity","uri"],e)?[]:[Gm({type:he.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(["relation","type"],e),parentUri:(0,l.path)(["relation","uri"],e),message:En().text("Entity is required"),source:be.local})],bh=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=ch(e,r),i=hh(t);return[...n,...i]};function Oh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vh=(e,t)=>{var r,n;const i=Yr(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||io(e)},gh=e=>(0,l.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),_h=e=>{const t=r=>(0,l.ifElse)(Array.isArray,(0,l.map)(t),(0,l.pipe)(gh(e),(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(0,l.map)(t))})))(r);return t},Ah=(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)(Us,gt,l.not)]),(e=>{const t=(0,l.pipe)(Us,Ct)(e);return _h((e=>e.replace(t,t+Et)))(e)})),(0,l.when)((0,l.pipe)(Is,gt),(t=>{const r=Is(t),n=e[r],i=n&&Ph(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){Oh(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),Nh=(e,t,r)=>vm(hm((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),Am((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)(Ah(r,e.type)),(0,l.map)(_h(Gt))))})(e))).concat(AT(e,t)),Ph=(e,t)=>(0,l.evolve)({attributes:Cl({valueTransformer:(0,l.pipe)(Ls,Ah(t),gh(Gt)),deleteEmptyComplex:!0}),uri:Gt})(e);function Rh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Sh(e,t,r[t])}))}return e}function Sh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wh=(0,l.unless)(l.isNil,(e=>e.replace(new RegExp(Tt,"g"),"uri$$$$").replace(new RegExp(Et,"g"),""))),Ih=e=>(0,l.pipe)((0,l.evolve)({objectUri:wh,objectParentUri:wh}),(e=>{return Rh({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?he.missed:he.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&&Vt(e.objectUri),uri:e.objectUri,source:be.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),Uh=(e,t)=>(0,l.map)((0,l.pipe)(Ih,(e=>{var r,n,i,a;const{metadata:o}=t,{uri:s,parentUri:u}=e,c=oh(t,s),p=null!=c&&c.length?c.slice(0,-1):oh(t,u),d=((e,t,r)=>{let{uri:n,attributeTypeUri:i}=r,a=i&&dr(e,i);if(!a&&n&&t&&t.length){const e=(0,l.last)(t);e.type===ge.attributeValue&&(a=e.valueType)}return a})(o,c,e);return Rh({},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&&$t(i)){const n=(0,l.last)(a),i=n.valueType;if(nr(i)&&pt(i).includes(o)){const i=Is(n.value),o=i&&gt(i)?t[i]:null;return o?Rh({},e,{parentUri:o.uri,path:a.concat({type:ge.tempEntity,value:o,valueType:Yr(r,o.type),label:""})}):e}}return e}})(t)))(e),Ch=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 Dh,Lh=r(33164);function jh(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"}(Dh||(Dh={}));const kh={},Fh={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"]}},Mh=e=>{if(!kh[e]){const t=Fh[e]||Fh.random0;kh[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){jh(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return kh[e]},xh=(0,l.curry)(((e,t)=>{const r=Mh(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]})),$h=e=>xh(Dh.Charts,e),Vh=()=>Mh(Dh.PotentialMatches).colors,Gh=e=>xh(Dh.Random1,e),Wh=e=>(0,Lh.getColor)(e)?"#FFFFFF":"#212121";var Bh=r(73116);const Yh=Array.from({length:100},((e,t)=>t/100)),qh=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)},Hh={},Qh=new Bh.Z({hash:qh,saturation:Yh.slice(15,71),lightness:Yh.slice(50,90)}),Kh=new Bh.Z({hash:qh,saturation:Yh.slice(46,89),lightness:Yh.slice(44,58)}),Jh=(0,l.curry)(((e,t,r)=>{t in Hh||(Hh[t]={});const n=Hh[t];r in n||(n[r]=((e,t)=>{const r=String(qh(t));return e.hsl(r)})(e,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),Xh=Jh(Qh,"crosswalks"),zh=Jh(Qh,"sources"),Zh=Jh(Qh,"contributors"),eb=Jh(Qh,"dataValidationFunctions"),tb=Jh(Kh,"entities");function rb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){nb(e,t,r[t])}))}return e}function nb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ib=(0,l.has)("items"),ab=e=>0===e,ob=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)},sb=e=>e.reduce(((e,t)=>e+t.width),0),lb=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),ub=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),cb=e=>e.reduce(((e,t)=>e+t.height),0),pb=e=>(0,l.is)(String,e)&&e.includes("%"),db=(0,l.has)("spacer"),yb=(e,t)=>Math.max(Math.round(parseFloat(t)/100*e),1),fb=e=>((null==e?void 0:e.items)||[]).reduce(((e,t)=>e.concat(ib(t)?fb(t):t)),[]),Tb=(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},Eb=e=>({id:e.layout}),mb=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Eb;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=pb(r.width)?yb(i,r.width):u}return ob(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return ob(n,t,r)},o=(e,t)=>ib(t.items[0])?p(e,t.items[0]):null,s=(t,r)=>{const o=r.items.map((a=>i(t,r,a,ib(a)?n(a.layout):e(a.view)))),s=Tb(t.width,o),u=r.items.reduce(((r,n,i)=>{const o=s[i],u=ab(i)?t.x:(0,l.last)(r).x+(0,l.propOr)(o,"width",(0,l.last)(r));if(ib(n))return r.concat(p(rb({},t,{x:u,width:o}),n));{const i=e(n.view);return r.push(rb({y:t.y,x:u,height:a(i),width:o},i)),r}}),[]);return{x:t.x,y:t.y,width:sb(u),height:lb(u),items:u}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=ib(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=ab(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(ib(i))return r.concat(p(rb({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(rb({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?ob(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?ob(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:ub(i),height:cb(i),items:i}},c=(t,r)=>{const n=(e,t,r,n)=>ab(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 rb({},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=Tb(e.width,[o,o]),u=rb({},e,{width:s[0]}),c=rb({},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(rb({},e,{y:n(e,t,a,f),height:f,items:(0,l.filter)(l.identity,[p,d])}))}return t}),[]);return rb({},e,{height:cb(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(rb({},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 rb({},t,{height:y,items:(0,l.reject)(f,[s,p,d])})},p=(e,t)=>{const r=rb({},t,{items:(0,l.reject)(db,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 fb(f)},hb=(e,t)=>(e||[]).filter((e=>t.some((t=>t.id===e.id)))),bb=[We.FilteredEntitiesViewFacet,We.ActivitiesViewFacet,We.ProfileStatsFacet,We.FilteredSavedSearchesFacet],Ob=(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=bb.includes(a.component)?8:4;return rb({},i,{height:Math.max(r,o),minHeight:Math.max(n,o)})}));function vb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){gb(e,t,r[t])}))}return e}function gb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _b={BarChart:Ge.BAR,BarChartGrouped:Ge.BAR,BarChartHorizontal:Ge.BAR,LineChart:Ge.LINE,Map:Ge.MAP,Pie:Ge.PIE},Ab=(e,t)=>Mt(e)?Lt(e,t):e,Nb=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=_b[r];return vb({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},Pb=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return vb({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"]))},Rb=(e,t,r)=>{const n=(e=>e&&ne(e).map((e=>{const{type:t,value:r}=e;return vb({},e,{value:[rn,nn,Zr.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:on(t),fieldName:r,values:n?ne(n):void 0}})))(e);return t&&Mt(t)||!r?n:(n||[]).concat((i=r,{filter:Zr.EQUALS,fieldName:"type",values:[i]}));var i},Sb=["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"],wb={"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:Ab(n,r),filters:Rb(a,n,r),chartType:Ge.BAR,component:We.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:Ab(n,r),filters:Rb(a,n,r),chartType:Ge.BUBBLE,component:We.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:We.CustomActionViewFacet}},"com.reltio.plugins.dashboard.FacetChartView":e=>{let{id:t,firstDimension:r,useEntityType:n,caption:i,filter:a,count:o,orderType:s,options:l,canRead:u}=e;const c=ne(a).find((e=>"type"===(null==e?void 0:e.attribute))),p=n||(null==c?void 0:c.value);return vb({id:t,count:o,canRead:u,orderType:s,attributeUri:Ab(r,p),filters:Rb(a,r,p),component:We.DashboardFacet,title:i,showOthers:!0},Nb(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:Ab(n,r),filters:Rb(a,n,r),chartType:Ge.MAP,component:We.DashboardFacet,title:i,geoUrl:Sb[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 vb({id:t,count:o,canRead:l,attributeUri:Ab(n,r),filters:Rb(a,n,r),component:We.DashboardFacet,title:i,geoUrl:s,chartType:Ge.MAP,projection:"geoMercator"},Nb(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:We.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:Pb(i),component:We.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:Rb(n,null,a),component:We.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:Zr.GTE,fieldName:"matches",values:["1"]}],component:We.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:We.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:Ge.CLOUD,component:We.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:Ge.TREE,component:We.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:We.NotificationInboxFacet,title:n||En().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:We.ActivitiesViewFacet,title:n||En().text("Activity log")}}},Ib=e=>({id:e,height:10}),Ub=(0,l.pipe)((0,l.map)((e=>{const t=wb[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),Cb=e=>{if("0.1"===e.version){const t=Ub(e.views),r=mb(Ib,e.layout,{columns:4});return{id:e.id,margin:0,layout:hb(r,t),views:t}}return e},Db=e=>(0,l.cond)([[(0,l.propEq)("layout","profile"),(0,l.pipe)((0,l.pick)(["center","right","top"]),l.values,l.flatten,(0,l.map)((0,l.when)((0,l.is)(Object),l.values)),l.flatten)],[(0,l.has)("view"),(0,l.pipe)((0,l.prop)("view"),ne)],[(0,l.prop)("items"),(0,l.pipe)((0,l.prop)("items"),(0,l.map)((e=>Db(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);function Lb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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 kb=Lb({},Be,{OldMap:"com.reltio.plugins.entity.EntityMapView",OldTree:"com.reltio.plugins.entity.TreeView"}),Fb=e=>e,Mb={[kb.Attributes]:Fb,[kb.HierarchyTree]:Fb,[kb.HierarchyPaths]:Fb,[kb.RelationsTable]:Fb,[kb.Relations]:e=>Lb({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[kb.SingleAttribute]:Fb,[kb.Custom]:Fb,[kb.AttributeTable]:Fb,[kb.Map]:Fb,[kb.OldTree]:e=>Lb({},e,{class:Be.HierarchyTree}),[kb.OldMap]:e=>Lb({},e,{class:Be.Map}),[kb.ImageAttribute]:Fb,[kb.PotentialMatches]:Fb},xb=(0,l.pipe)((0,l.map)((e=>{const t=Mb[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),$b=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.defaultTo)([]),(0,l.find)((0,l.propEq)("id",t)),(0,l.prop)("class"))(e)===Be.Map?{id:t,height:5,minHeight:5}:{id:t,autosizing:!0})),Vb=(e,t)=>(t||[]).map((t=>Lb({},t,$b(e,t.id)))),Gb=e=>{const t=(0,l.pick)(["id","workflow","maxWidth","sidePanelViews","profileBand","views"],e);if("2.0"===e.version)return Lb({},t,{layout:Vb(t.views,e.newLayout)});if("0.1"===e.version){const r=xb(e.views),n=mb($b(r),e.layout,{columns:3});return Lb({},t,{layout:hb(n,r),views:r})}return e},Wb=(e,t)=>e.class===t||e["react-class"]===t,Bb=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(Wb(t,Be.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 Wb(t,Be.SingleAttribute)&&e.includeUris.push(t.attributeUri),e}),{includeUris:[],excludeUris:null}))(e);return e=>{let{uri:n}=e;return r&&!r.some(It(n))||t.some(It(n))}},Yb=(e,t)=>e.filter((e=>t.some((t=>Wb(e,t))))).map((e=>{let{id:t}=e;return t})),qb=(e,t)=>{let{extensions:r}=e;return(r||[]).find((e=>e.id===t))},Hb=(e,t)=>e.flatMap((e=>{let{extensions:r=[]}=e;return r.filter((e=>{let{point:r}=e;return r===t}))})),Qb=e=>(0,l.pipe)((0,l.map)((e=>qb(e,"com.reltio.plugins.entity.ProfileBand"))),(0,l.reject)(l.isNil),l.head)(e);function Kb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){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 Xb=(0,l.curry)(((e,t)=>Db(t).map((t=>(0,l.pipe)((0,l.map)((e=>qb(e,t))),(0,l.reject)(l.isNil),l.head)(e))).filter(l.identity))),zb=(0,l.either)((0,l.propEq)("label","D&B Connector"),(0,l.propEq)("label","D&B Connector")),Zb=(0,l.propEq)("class",Be.Custom),eO=e=>{let{extensions:t=[]}=e;return t.filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]))},tO=(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=Vb(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=>qb(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=Xb(e,t.layout);i=((e,t)=>{if(t.side){var r;const n=(0,l.pipe)((0,l.chain)((e=>qb(e,t.side))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("layout"))(e),[i,a]=(0,l.partition)(zb,null!==(r=null==n?void 0:n.items)&&void 0!==r?r:[]),o=(0,l.pipe)(Xb(e),(0,l.filter)(Zb))(Kb({},n,{items:i})),s=[{id:"common",views:Xb(e,Kb({},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=Gb(Kb({},t,{views:a,version:"0.1"})),u=(0,l.pipe)(Qb,(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})},rO=(e,t)=>{if("scroll"===t.layout.layout){const r=Xb(e,t.layout),n=Cb(Kb({},t,{views:r,version:"0.1"}));return{class:qe.Dashboard,id:t.id,views:n.views,layout:n.layout}}return{class:qe.Dashboard,views:t.views,layout:t.layout,id:t.id}},nO=(e,t)=>{const r=Xb(e,t.layout)[0];return{class:qe.DQDashboard,id:t.id,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel}},iO=(e,t)=>{const r=Xb(e,t.layout)[0];return{class:qe.RelationshipSearch,id:t.id,options:r.options,consoleExportApp:r.consoleExportApp}},aO=(e,t)=>{const r=Xb(e,t.layout)[0];return{class:qe.Interactions,id:t.id,sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},oO=(e,t)=>{const r=Xb(e,t.layout)[0];return{class:qe.Relationships,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},sO=(e,t)=>{const r=Xb(e,t.layout)[0];return{class:qe.Sources,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},lO=(e,t)=>{const r=Xb(e,t.layout)[0];return{class:qe.PotentialMatches,id:t.id,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},uO=(e,t)=>{const r=Xb(e,t.layout)[0],n=r.potentialMatchesReview||{processType:(e=>{const[t]=Hb(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:qe.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}},cO=(e,t)=>({class:qe.Graph,id:t.id}),pO=(e,t)=>{const r=Xb(e,t.layout)[0];return{class:qe.ProfileActivityLog,id:t.id,exportTypes:r.exportTypes,caption:r.caption}},dO=e=>t=>!!(0,l.intersection)(e,t).length,yO=(0,l.cond)([[dO(["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"]),()=>rO],[dO(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>nO],[dO(["com.reltio.plugins.graph.GraphView"]),()=>cO],[dO(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>iO],[dO(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>aO],[dO(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>oO],[dO(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>sO],[dO(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>lO],[dO(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>uO],[dO(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>pO],[l.T,()=>(0,l.always)(void 0)]]),fO=(e,t)=>{const{class:r}=e;if("com.reltio.plugins.entity.ProfileAction"===r)return((e,t)=>{const r=(0,l.pipe)((0,l.chain)(eO),(0,l.map)((t=>tO(e,t))),(0,l.indexBy)((0,l.prop)("entityType")),(0,l.map)((0,l.pick)(["layout","views","sidePanelViews","profileBand","workflow"])))(e);return{class:qe.Profile,id:t.id,entityTypes:r}})(t,e);if("com.reltio.plugins.ui.actions.CustomAction"===r)return{id:e.id,type:He.CustomAction,config:(0,l.omit)(["class","id","point","parent","type"],e)};if("com.reltio.plugins.ui.actions.ConsoleAppAction"===r)return{id:e.id,type:He.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=>qb(e,"com.reltio.plugins.newDashboard.NewDashboardView")),(0,l.pick)(["id","views","layout"]),(0,l.assoc)("class",qe.Dashboard))(e)}const i=(0,l.pipe)((0,l.map)((e=>qb(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=tO(e,r),i=(0,l.pipe)((0,l.propOr)([],"entity-types"),(0,l.map)((e=>[e,n])),l.fromPairs)(t);return{class:qe.NestedProfile,id:t.id,entityTypes:i}})(t,e,i);const a=Db(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 yO(o)(t,i)};function TO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){EO(e,t,r[t])}))}return e}function EO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mO=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))},hO="https://reltio-ui-files.s3.amazonaws.com/new-ui/";var bO;!function(e){e[e.DashboardGroup=0]="DashboardGroup",e[e.ProfileGroup=1]="ProfileGroup",e[e.SearchGroup=2]="SearchGroup"}(bO||(bO={}));const OO={[qe.DQDashboard]:`${hO}DqDashboard.svg`,[qe.Dashboard]:`${hO}Dashboard.svg`,[qe.Graph]:`${hO}Graph.svg`,[qe.RelationshipSearch]:`${hO}GraphSearch.svg`,[qe.Interactions]:`${hO}Interactions.svg`,[qe.PotentialMatches]:`${hO}PotentialMatches.svg`,[qe.Profile]:`${hO}Profile.svg`,[qe.NestedProfile]:`${hO}Profile.svg`,[qe.ProfileActivityLog]:`${hO}ActivityLog.svg`,[qe.Relationships]:`${hO}Relationships.svg`,[qe.Sources]:`${hO}Crosswalk.svg`,[qe.Search]:`${hO}Search.svg`,[bO.DashboardGroup]:`${hO}DashboardGroup.svg`,[bO.ProfileGroup]:`${hO}ProfileGroup.svg`,[bO.SearchGroup]:`${hO}SearchGroup.svg`,DEFAULT:`${hO}Default.svg`},vO=e=>OO[null==e?void 0:e.class]||OO.DEFAULT,gO=(0,l.pipe)((0,l.pluck)("screen"),(0,l.filter)((0,l.anyPass)([(0,l.propEq)("class",qe.NestedProfile)])),(0,l.groupBy)((0,l.prop)("class")),(0,l.map)((e=>e.map(((e,t)=>TO({},e,{nestedRoute:`${t+1}`})))))),_O=(e,t)=>{var r;return(null===(r=e[t.class])||void 0===r?void 0:r.find((0,l.propEq)("id",t.id)))||t},AO=e=>"com.reltio.plugins.entity.ProfileFirstAction"===e.class?OO[bO.ProfileGroup]:null,NO=e=>(0,l.cond)([[(0,l.any)((e=>{let{icon:t}=e;return t===OO[qe.Dashboard]||t===OO[qe.DQDashboard]})),(0,l.always)(OO[bO.DashboardGroup])],[(0,l.any)((e=>{let{icon:t}=e;return t===OO[qe.Search]||t===OO[qe.RelationshipSearch]})),(0,l.always)(OO[bO.SearchGroup])],[l.T,()=>null]])(e),PO=e=>(0,l.pipe)((0,l.chain)(mO),(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=>TO({},e,{entityTypes:e["entity-types"],screen:fO(e,t)}))),(0,l.filter)((e=>e.screen)))(t),n=gO(r);return(0,l.map)((e=>{let{label:t,screen:r,canRead:i,entityTypes:a}=e;return{label:t,icon:vO(r),screen:_O(n,r),canRead:i,entityTypes:a}}))(r)})(t,e),n=fO(t,e);return{label:t.label,icon:AO(t)||NO(r)||vO(n),menu:r.length?{type:"side",items:r}:void 0,screen:n,canRead:t.canRead}}));function RO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const SO=e=>{let{extensions:t}=e;return(t||[]).filter((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},wO=e=>({id:e,height:10}),IO=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)(SO),(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=Ub(((e,t)=>{const r=Db(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){RO(e,t,r[t])}))}return e}({id:r},t[0])})),(0,l.uniqBy)((0,l.prop)("id")))(e)})(e,t.layout)),n=mb(wO,t.layout,{columns:4});return{views:r,layout:hb(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))};function UO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const CO=(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))),DO=e=>"com.reltio.plugins.dashboard.DashboardPerspective"===e,LO=e=>(0,l.pipe)((e=>Hb(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){UO(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),jO=(0,l.unless)((e=>!!e&&(e.startsWith("http:")||e.startsWith("https:"))),(0,l.always)(null)),kO=(0,l.pipe)(CO("top-logo"),jO),FO=(0,l.prop)("showLookupCode"),MO=e=>{var t;const r=(e=>(0,l.pipe)((0,l.map)((e=>qb(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=>qb(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=>qb(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=>qb(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=>qb(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=>qb(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=>qb(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=>qb(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)(CO("default-perspective"),(0,l.ifElse)(DO,(0,l.always)("dashboard"),(0,l.always)("search")))(e))(e),d=(e=>(0,l.pipe)((0,l.map)((e=>qb(e,"com.reltio.plugins.ui.AttributesSorting"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("strategy"))(e))(e),y=LO(e),f=(e=>CO("checkUser",e))(e),T=(e=>CO("checkIdle",e))(e),E=(e=>(0,l.pipe)((0,l.map)((e=>qb(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=>qb(e,"com.reltio.plugins.ui.LookupCodeVisibility"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}))(e))(e),h=void 0===(b=FO(m))||b;var b;const O=null===(t=Qb(e))||void 0===t?void 0:t.showEntityId,v=(e=>CO("preview",e))(e),g=kO(e),_=(e=>CO("topBackgroundColor",e))(e),A=(e=>(0,l.pipe)((0,l.map)((e=>qb(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(A).length?void 0:A,attributePresentations:u,attributesSorting:d,workflow:c,defaultRoute:p,customScripts:y,checkUser:f,checkIdle:T,showSwitchToClassic:E,showEntityId:O,preview:v,logo:g,headerColor:_}},xO=e=>({layout:PO(e),pivoting:IO(e),properties:MO(e)});var $O=r(58697),VO=r.n($O);function GO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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}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=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}_${VO()()}`;return n[e.id].push(t),i=!0,GO({},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]++,GO({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}};function YO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){qO(e,t,r[t])}))}return e}function qO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let HO={};const QO=(e,t,r)=>{const n=`\n importScripts("${e}");\n importScripts("${r.action.files.join('","')}");\n postMessage({action:'loaded'});`;let i;const a=X(`${r.id}: ${r.action.files.join('","')}`);if(E(HO[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))}HO=YO({},HO,{[a]:YO({},HO[a]||{},{worker:i})})}else i=HO[a].worker,HO[a].innerText&&t({task:{action:Xe.SET_HTML,params:{html:HO[a].innerText}},worker:i,config:r}),i.removeEventListener("message",HO[a].onWorkerMessage);return i&&(HO[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||(HO[a].innerText=n.params.html)}},i.addEventListener("message",HO[a].onWorkerMessage)),i},KO=(0,l.curry)(((e,t)=>!e||!e.availableEntityTypes||!t||e.availableEntityTypes.includes(t))),JO=(0,l.flip)(KO),XO=(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=En().number(t));return t})),zO=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?En().number(e,"0,0.0a").toUpperCase():En().number(e,"0,0"):""},ZO=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last));let ev=!0;const tv=e=>ev=e,rv=(e,t)=>e!==t&&t?ev&&e?`${t} (${e})`:t:e,nv=(e,t,r)=>(0,l.path)([t,r,"displayName"],e),iv=(e,t,r)=>{const n=nv(e,t,r);return rv(r,n)},av=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),ov=(0,l.complement)(av),sv=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),lv=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)},uv=(0,l.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter(ov(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),cv=(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 nt.TYPE_NUMBER:case nt.TYPE_FLOAT:case nt.TYPE_DOUBLE:case nt.TYPE_LONG:case nt.TYPE_INT:case nt.TYPE_COUNT:return t&&XO(o,t);case nt.TYPE_BOOLEAN:case nt.TYPE_BOOLEAN_RADIO:case nt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t=t,(0,l.isNil)(t)?t:le(t)?En().text("Yes"):En().text("No");case nt.TYPE_DATE:return(0,l.is)(Number,t)&&(t=A(Number(t)).getTime()),(t=t)&&(Qu(t)?Ku(t):En().date(t,s));case nt.TYPE_ACTIVENESS_DATE:case nt.TYPE_LOCAL_DATE:return(t=t)&&(Qu(t)?Ku(t):En().date(t,s));case nt.TYPE_TIMESTAMP:return(t=t)&&(Qu(t)?Ku(t):En().date(isNaN(t)?t:Number(t),u));case nt.TYPE_FILE:return(0,l.propOr)(null,"filename",t);case nt.TYPE_SELECT:{const e=n.options.find((0,l.propEq)("value",t));return(0,l.propOr)(null,"label",e)}case nt.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)?rv((0,l.propOr)(null,"lookupCode",t),(0,l.propOr)(null,"value",t)):t}})),pv={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)"},dv=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()}},yv=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})))),fv=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}=t,a=e.onRequest.reduce(((e,t)=>(r,n)=>t({url:r,options:n,abort:i,next:e})),t.next);a(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)((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),dv,yv);return{request:(e,n)=>{const i=s(fetch),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))},abort:i})})):a(e,n)},addRequestInterceptor:n,addResponseInterceptor:i,removeRequestInterceptor:a,removeResponseInterceptor:o}},Tv="__metadata",Ev=(e=>{const t=[Tv,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),mv=(0,l.set)(Ev),hv=(0,l.view)(Ev),bv=mv(pn.NEW),Ov=mv(pn.REMOVED),vv=mv(pn.EDITED),gv=mv(pn.IGNORED),_v=(0,l.pipe)(hv,(0,l.equals)(pn.REMOVED)),Av=(0,l.pipe)(hv,(0,l.equals)(pn.NEW)),Nv=(0,l.pipe)(hv,(0,l.equals)(pn.EDITED)),Pv=(0,l.pipe)(hv,(0,l.complement)(l.isNil)),Rv=(0,l.pipe)(hv,(0,l.equals)(pn.IGNORED)),Sv=(0,l.omit)([Tv]),wv=(e,t)=>e===Tv?void 0:t;function Iv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Uv=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=Uv(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},Cv=(e,t)=>Uv((0,l.propEq)("nodeId",t),e),Dv=(e,t)=>Uv((0,l.pathEq)(["entity","uri"],t),e),Lv=(e,t)=>{const r=Cv(e,t);return r.length>1?r[r.length-2]:null},jv=(e,t)=>{const r=Cv(e,t);return r.length>0?r[r.length-1]:null},kv=(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=>kv(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},Fv=()=>{},Mv=(e,t)=>{let{parent:r,nodeProcessing:n=Fv}=t;n(e,r),e.children&&e.children.forEach((t=>Mv(t,{parent:e,nodeProcessing:n})))},xv=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case Ce.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 Ce.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 Ce.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){Iv(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})}}},$v=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&&Mv(r,{nodeProcessing:r=>{const n=(0,l.path)(["editingConnections",(0,l.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===Ce.addingChild||r.editingMode===Ce.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=xv({node:r,connection:n,isReversed:i}),s=IT({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===Ce.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=xv({node:r,isReversed:i,connection:n}),l=s?LT({entityUri:o,newEntityUri:s,relation:a,isReversed:i}):DT({oldRelation:e,newRelation:a});t.push(l)}}})})),t},Vv=(e,t)=>{if((0,l.path)(["entity","uri"],e)===t)return!0;if(e&&e.children)for(const r of e.children){const e=Vv(r,t);if(e)return e}return!1},Gv=(0,l.curry)(((e,t)=>{const r=(0,l.map)(Gv(e));return(0,l.evolve)({entity:t=>t.uri===e.uri?e:t,children:r},t)})),Wv=(e,t)=>{const r=(0,l.pipe)(Object.entries,(0,l.filter)((t=>{let[,r]=t;return r.root&&((e,t)=>Vv(t,e.uri))(e,r.root)}))),n=(0,l.map)((t=>{let[r,n]=t;return{id:r,root:Gv(e,n.root)}}));return(0,l.pipe)(r,n)(t)},Bv={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},Yv={asc:"asc",desc:"desc"},qv=Bv.entityLabel,Hv=Yv.asc,Qv=(0,l.always)(0),Kv=e=>{let{sortField:t=qv,sortOrder:r=Hv,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case Bv.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,l.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return mN.strings.sort(t,a,o)})(n,r);case Bv.entityLabel:return(e=>(t,r)=>{const n=(0,l.path)(["entity","label"]),i=n(t),a=n(r);return mN.strings.sort(e,i,a)})(r);default:return Qv}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},Jv=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values(Yv)),l.identity,(0,l.always)(Hv))),Xv=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(Bv)),l.identity,(0,l.always)(qv)));var zv=r(91104);let Zv;const eg=(e,t)=>(Zv||(Zv=zv.createClient({key:t})),new Promise((t=>{Zv.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},rg=(e,t)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(Os).flatMap((e=>{let r;return e.type==t&&(r=[tg(e)]),(0,l.is)(Object,e.value)&&(r=(r||[]).concat(rg(e.value,t))),r})),ng=e=>e&&e.length>0,ig=(e,t)=>[].concat(e&&e.attributes?rg(e.attributes,t):[]).filter(l.identity);function ag(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=Yr(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){ag(e,t,r[t])}))}return e}({},e,{attributes:{[i]:[n]}}));const a=(t.geoLocationAttributes||[]).map((t=>{return r=ig(e,t.latitude),n=ig(e,t.longitude),ng(r)&&ng(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(ng(t)&&t[0].value&&ng(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?eg(n.label,a).catch((()=>null)):Promise.resolve(null)},sg=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=Yr(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?eg(a.label,r).catch((()=>null)):e)).then((e=>ne(e).filter(l.identity).map((e=>({id:e.id||n,label:i,entity:a,point:e}))))).catch((()=>null))}))).then((e=>e.flat(1/0).filter(l.identity)))},lg=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=Yr(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(dr(e,r.latitude,t.type)&&dr(e,r.longitude,t.type)){const e=ig(t,r.latitude),n=ig(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))},ug=(e,t,r)=>Promise.all([lg(e,t),sg(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 cg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){pg(e,t,r[t])}))}return e}function pg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const dg=(e,t)=>t.values.map(bo(e,t.entityTypeUri)),yg=(e,t,r)=>ll(t.fieldName,r)||dr(e,Lt(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),fg=(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?rv(e,t):e}),r)},Tg=(0,l.path)(["attrType","label"]),Eg=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>cg({},e,{[t]:!0})),{});e[r]=e[r]?cg({},e[r],n):n}return e}),{}),mg=(0,l.pipe)((0,l.prop)("values"),E),hg=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",wn.type.name)),bg=e=>e.type===gg.NUMERIC_RANGE_FACET,Og=e=>e.type===gg.DATE_RANGE_FACET,vg=(0,l.either)(bg,Og),gg={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},_g=e=>{switch(null==e?void 0:e.name){case wn.type.name:return gg.ENTITY_TYPE_FACET;case wn.createdBy.name:case wn.updatedBy.name:case wn.sourceSystems.name:case wn.tags.name:case wn.roles.name:case wn.matchRules.name:case wn.MLRecommendedMatch.name:return gg.WITH_DROPDOWN_CHECKBOXES_FACET;case wn.createdTime.name:case wn.updatedTime.name:case wn.startDate.name:case wn.endDate.name:return gg.DATE_RANGE_FACET;case wn.matches.name:case wn.matchScore.name:return gg.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return gg.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return gg.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return gg.DATE_RANGE_FACET;default:return gg.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},Ag=(0,l.pipe)(yg,_g),Ng=(0,l.pipe)((0,l.path)(["attrType","type"]),gr),Pg=(0,l.cond)([[bg,(0,l.always)(Zr.IN_RANGE)],[Og,(0,l.always)(Zr.WITHIN)],[(0,l.allPass)([Ng,e=>e.values.length>=2]),(0,l.always)(Zr.EXISTS)],[l.T,(0,l.always)(Zr.EQUALS)]]),Rg=(0,l.cond)([[Og,(0,l.prop)("values")],[bg,(0,l.prop)("values")],[Ng,e=>1===e.values.length?e.values.map(le):[]],[(0,l.pipe)((0,l.path)(["values",0]),Array.isArray),(0,l.prop)("values")],[l.T,e=>[e.values]]]);function Sg(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"]),Er),Ig=(0,l.pipe)((0,l.path)(["attrType","type"]),br),Ug=(0,l.pipe)((0,l.prop)("attrType"),cl),Cg=(0,l.pipe)((0,l.prop)("attrType"),ul),Dg=e=>t=>t.values.map((t=>Yr(e,t).label)).join(" , "),Lg=(0,l.when)((0,l.propSatisfies)((0,l.gt)(l.__,1),"length"),(0,l.join)(" – ")),jg=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(En().number),Lg)),(0,l.join)(","))(e.values);return`${Tg(e)}: ${t}`},kg=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(w),Lg)),(0,l.join)(","))(e.values);return`${Tg(e)}: ${t}`},Fg=e=>t=>`${Tg(t)}: ${dg(e,t).join(", ")}`,Mg=e=>t=>{const r=fg(e,t);return`${Tg(t)}: ${r.join(", ")}`},xg=(0,l.curry)(((e,t,r)=>(0,l.map)((0,l.cond)([[Cg,Dg(e)],[Ig,jg],[wg,kg],[Ug,Fg(e)],[l.T,Mg(t)]]),r))),$g=(e,t,r,n)=>(0,l.pipe)(l.values,(0,l.reject)((0,l.pipe)((0,l.prop)("values"),E)),(0,l.map)((t=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Sg(e,t,r[t])}))}return e}({},t,{attrType:yg(e,t,n)}))),xg(e,r))(t),Vg=new RegExp(`^${En().text("Search")}`),Gg=(e,t,r,n)=>{let{uiState:i}=t;const{facets:a,keyword:o,advanced:s,readableQuery:u}=i;return(0,l.isEmpty)(s)?[...$g(e,a,r,n),...o?[o.value]:[]]:[(0,l.replace)(Vg,"",u)]},Wg=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values)(un),Bg=e=>(e=>Wg.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]=Xu(t);return e.replace(r,i).replace(n,a)}),e))(e),Yg=(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}`})),qg={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},Hg=e=>[qg.geoPolygon,qg.onMapMove].includes(e),Qg=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},Kg=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},Jg=(e,t)=>Hg(e)?t.map(Qg):[Kg(t)],Xg=e=>Hg(e)?En().text("Geo Polygon"):En().text("Geo Location"),zg=e=>{switch(e){case qg.geoLocation:return"geoLocation";case qg.geoPolygon:case qg.onMapMove:return"geoPolygon"}},Zg={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},e_=e=>En().text(e),t_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[Zr.EQUALS]:"=",[Zr.NOT_EQUALS]:"≠",[Zr.STARTS_WITH]:"*",[Zr.MISSING_VALUE]:En().text("missing value"),[Zr.HAS_ALL]:En().text("has all"),[Zr.IN_RANGE]:En().text("in range"),[Zr.FULL_TEXT]:En().text("full text"),[Zr.EXISTS]:En().text("exists"),[Zr.COUNT_EQUALS]:`${En().text("count")} =`,[Zr.COUNT_NOT_EQUALS]:`${En().text("count")} ≠`,[Zr.COUNT_LT]:`${En().text("count")} <`,[Zr.COUNT_LTE]:`${En().text("count")} <=`,[Zr.COUNT_GT]:`${En().text("count")} >`,[Zr.COUNT_RANGE]:En().text("count range"),[Zr.LT]:"<",[Zr.LTE]:"<=",[Zr.GT]:">",[Zr.GTE]:">=",[Zr.IN_FILE]:En().text("in file"),[Zr.NOT_IN_FILE]:En().text("not in file"),[Zr.CONTAINS]:"~",[en.LIST_EQUALS]:"=",[en.NOT_LIST_EQUALS]:"≠",[en.LIST_EQUALS_CASE_SENSITIVE]:"=",[en.NOT_LIST_EQUALS_CASE_SENSITIVE]:"≠"}[e]||En().text(e.toLowerCase())},r_=e=>({type:Zg.operator,text:e}),n_=e=>({type:Zg.operator,text:e_(e)}),i_=e=>({type:Zg.attributeLabel,text:e}),a_=e=>({type:Zg.specialAttributeLabel,text:e}),o_=e=>({type:Zg.attributeFilter,text:t_(e)}),s_=e=>({type:Zg.attributeValue,text:e}),l_=e=>({type:Zg.entityTypeLabel,text:e}),u_=()=>({type:Zg.space,text:" "}),c_=()=>({type:Zg.bracket,text:"("}),p_=()=>({type:Zg.bracket,text:")"}),d_=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),y_=(0,l.curry)(((e,t)=>t.map(d_(e)))),f_=(0,l.curry)(((e,t,r)=>[e,...r,t])),T_=f_(c_(),p_()),E_=f_(u_(),u_()),m_=(0,l.curry)(((e,t)=>[e,...t])),h_=e=>m_(l_(e)),b_=e=>m_(l_(`${e}: `)),O_=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=Su(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=Pu(s),a=Ru(s);!r&&t&&n&&(i.push(c_()),r=!0),i.push(o),r&&a&&(i.push(p_()),r=!1);const l=e?n_(s):r_(s);i.push(...E_([l]))}else i.push(o),r&&(i.push(p_()),r=!1)}return i}},v_=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),g_=(0,l.pipe)(O_({localizable:!1}),v_),__=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},A_=e=>{let{data:t,values:r,filter:n}=e;return t&&Oc({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},N_=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(A_)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),P_=(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)&&lr(e.data.attrType)})(e)&&[Zr.HAS_ALL,Zr.EQUALS,Zr.NOT_EQUALS].includes(e.filter))),(0,l.map)((e=>({type:sr((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})))),lv),R_=(e,t)=>(0,l.pipe)(P_,uv(t))(e),S_=(0,l.pathEq)(["data","fieldName"],wn.type.name),w_=(0,l.path)(["data","entityTypeUri"]),I_=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),U_=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(ls(e)),attributes:(0,l.filter)((0,l.pipe)(w_,(0,l.anyPass)([l.isNil,ls(e),r=>{const n=(t.entityTypes||[]).filter(ls(e));return(n.length>1?Jr(e,n):null)===r&&!!Yr(e,r)}])))})(t))))),C_=e=>(0,l.pipe)((0,l.prop)("filter"),yu,(0,l.equals)(e)),D_=(0,l.curry)(((e,t,r,n,i,a)=>{const o=ll(n.fieldName)||n.attrType,s=Yu(o,i),u=cv({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>lr(s),()=>(0,l.is)(Object,a)&&a.lookupCode?rv(a.lookupCode,a.value):iv(r,sr(o),a)],[()=>cl(s),()=>bo(e,n.entityTypeUri,a)],[()=>pl(s),()=>Vo(e,a)],[()=>ml(s),()=>Bo(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>br(c)||gr(c)),Vu),s_)()})),L_=(e,t,r,n)=>{const i=D_(e,t,r,n.data,n.filter);return(0,l.cond)([[C_(0),(0,l.always)([])],[(0,l.both)(C_(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[u_(),i(r),{type:Zg.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[u_(),...(0,l.pipe)(l.flatten,(0,l.map)(i),y_({type:Zg.punctuationMark,text:", "}))(t)]}]])(n)},j_=(e,t)=>{const r=!!ll(e.data.fieldName);return(0,l.pipe)(__,r?a_:i_)(e,t)},k_=(e,t,r,n,i)=>[j_(n,i),u_(),o_(n.filter),...L_(e,t,r,n)],F_=(0,l.addIndex)(l.map),M_=(0,l.propEq)("length",1),x_=(0,l.propSatisfies)((0,l.lt)(1),"length"),$_=(0,l.complement)(l.isEmpty),V_=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)(Uu,(0,l.filter)(A_),Cu,(0,l.map)((n=>({operand:k_(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,O_()))(n)},G_=(0,l.pipe)(V_,l.flatten),W_=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>Jd(e,{type:t}))).join(", ");return r?t(r):l.identity},u=V_(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(h_),(0,l.pipe)(s(b_),(0,l.unless)((()=>M_(u)||i),T_)))(u)},B_=(e,t,r,n)=>(0,l.pipe)(Uu,(0,l.filter)(N_),Cu,F_(((n,i,a)=>({operand:W_(e,t,r,n,M_(a)),operator:n.operator}))),O_(),l.flatten)(n),Y_=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),O_(),l.flatten),q_=e=>{let{searchType:t,values:[r]}=e;return Jg(t,r).join(", ")},H_=(e,t,r,n,i,a)=>{const o=(e=>e?[a_(e.isRawFilter?En().text("Raw filter"):En().text("Search")),...E_([o_(Zr.EQUALS)]),s_(`"${e.value}"`)]:[])(i),s=(e=>e?[a_(Xg(e.searchType)),u_(),s_(q_(e))]:[])(a),u=(0,l.pipe)(B_,(0,l.when)((e=>x_(e)&&($_(o)||$_(s))),T_))(e,t,r,n);return Y_([o,s,u])},Q_=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),K_=(0,l.pipe)(H_,Q_),J_=(0,l.has)("attributes"),X_=Array.isArray,z_=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),Z_=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=eA(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)(z_(a))),T_),(0,l.concat)(E_([r_(o)]))))(s)},eA=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return J_(n)?Z_(e,t,r,n,i):X_(n)?n.reduce(((n,a)=>n.concat(eA(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(E_([r_(n.operator)])))(k_(e,t,r,n,i))},tA=(e,t,r,n,i)=>(0,l.pipe)(eA,l.flatten)(e,t,r,n,i);function rA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){nA(e,t,r[t])}))}return e}function nA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const iA=(0,l.complement)(S_),aA=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(S_),(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}=aA(t);return(r||n)&&wu(t)},sA=(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(S_).some((0,l.propEq)("filter",Zr.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}=aA(r);if(oA(e))t.push(rA({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter(iA)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(S_,(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(iA),entityTypes:n,operator:i?a:e.operator,id:VO()()}}));t.push(...n)}var a;return t})(t))),[]))),lA={[Zr.EQUALS]:Zr.ON,[Zr.IN_RANGE]:Zr.WITHIN,[Zr.GTE]:Zr.AFTER,[Zr.GT]:Zr.AFTER,[Zr.LTE]:Zr.BEFORE,[Zr.LT]:Zr.BEFORE},uA=(0,l.curry)((e=>lA[e]||e)),cA=(0,l.curry)(((e,t)=>{switch(e){case Zr.LT:return[f()(t[0]).subtract(1,"day").valueOf()];case Zr.GT:return[f()(t[0]).add(1,"day").valueOf()];default:return t}})),pA=(0,l.pipe)((0,l.path)(["data","attrType","type"]),Er),dA=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>rA({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return pA(e)?(0,l.evolve)({filter:uA,values:cA(t)},e):e}))})))})),yA=(0,l.evolve)({values:(0,l.when)((0,l.pipe)((0,l.prop)(0),Hu),(0,l.map)(Xu))}),fA=(0,l.map)((0,l.cond)([[pA,yA],[l.T,l.identity]])),TA=(0,l.curryN)(3,((e,t,r,n,i)=>(0,l.pipe)((0,l.defaultTo)([]),sA,U_(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")),fA)})),dA,(0,l.reject)(I_))(r)));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=(e,t)=>({data:{uri:Mt(e.fieldName)?Lt(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||Pg(e),id:VO()(),values:Rg(e)}),bA=(0,l.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=ll(a,t,r)||dr(e,i);if(!s)return null;if(zt(s))return EA({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=Jd(e,{type:o}),i=(pr(e,Lt(a,o),o)||[]).map((0,l.pick)(["label","name"])).slice(0,-1);return EA({},n,{attrType:s,title:t,pathToTitle:Array.isArray(i)?[r,...(0,l.chain)((0,l.prop)("label"),i),t]:[r,t]})}})),OA=(0,l.curry)(((e,t,r,n)=>TA(bA,e,n,t,r)));function vA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){gA(e,t,r[t])}))}return e}function gA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _A=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},AA=e=>"rdmLookups.not.resolved"===e?wn.notResolved.name:e,NA=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===an?Zr.IN_RANGE:on(a),u=AA(n),c=ll(u)||dr(e,i),p=(0,l.cond)([[()=>mu(s),(0,l.map)((0,l.when)((0,l.both)((0,l.has)("link"),(0,l.complement)((0,l.has)("filename"))),(e=>vA({},e,{filename:ZO(e)}))))],[()=>gr(null==c?void 0:c.type),(0,l.map)(le)],[e=>Tu(s)&&!Array.isArray(e[0])&&!Er(null==c?void 0:c.type),ie],[l.T,l.identity]])(o);return{id:VO()(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===an?"and not":"and",filter:s,values:p}})),PA=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(NA(e,Jr(e,i)));return[{id:VO()(),operator:"or",attributes:a,entityTypes:i}]})),RA=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),SA=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([RA("from"),RA("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 vA({},r,{values:SA(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?nl(e.fieldName,n):e.fieldName})},IA=(e,t)=>{if((0,l.has)("children")(e)){const r=wA(e,t);return e.children.reduce(((e,n)=>(e.push(IA(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return wA(e,t)},UA=(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(vA({fieldName:e.fieldName},wA(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(IA,l.flatten)],[l.T,wA]]),CA=(0,l.pipe)((0,l.map)(UA),l.flatten),DA=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},LA=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=PA(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:CA(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>vA({},t,{type:Ag(e,t)}))).map((e=>vA({},e,{values:vg(e)?DA(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 hA(r,t)})),operator:"or",id:VO()(),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=>({[AA(t)]:e[t]}))),l.mergeAll)(e)}(o),p=[vA({},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 OA(e,t,r,p)},jA=(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)(mg),(0,l.partition)(hg))(t),i=n.map((t=>EA({},t,{type:Ag(e,t)}))).map((e=>hA(e))),a=r.values||[];return[{attributes:i,operator:"or",id:VO()(),entityTypes:a}]})(e,a);return OA(e,t,r,o)})(e,t,r,n):LA(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},kA=e=>"2.0"===e.version?e.keyword:_A(e),FA=e=>(0,l.pathEq)(["object","uri"],e),MA=(e,t)=>(0,l.pipe)((0,l.find)(FA(e)),(0,l.prop)("object"))(t),xA=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"),FA(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=MA(r.match,t)||n[r.match];return i?{label:wd((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return ho(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)},$A=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,l.pick)(["uri","type","label"],r),e}),{}),VA=(0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)]),GA=(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:wd((0,l.prop)("label",o)),matchRules:i.concat(a).map((function(t){return ho(e,o.type,t)||{label:t,uri:t}}))}})))(t),WA=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)},BA=(0,l.path)(["object","uri"]),YA=e=>{let t=[];return{addChild:e=>{t=(0,l.append)(e,t)},getValue:()=>e,getChildren:()=>t,removeChild:e=>{t=(0,l.without)([e],t)}}},qA=e=>e.getValue(),HA=(e,t)=>{let r=null;if(t(e.getValue()))return e;const n=e.getChildren();for(let e=0;e<n.length&&(r=HA(n[e],t),!r);e++);return r},QA=(e,t)=>{const r=[],n=(0,l.pipe)(qA,t),i=(0,l.pipe)(l.map,l.flatten),a=e.getChildren();a.some(n)&&r.push(e);const o=i((0,l.partialRight)(QA,[t]),a);return r.push.apply(r,o),r};function KA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){JA(e,t,r[t])}))}return e}function JA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const XA=(e,t)=>!!e[t],zA=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},ZA=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||[]])},eN=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return KA({},t,{[r.uri]:KA({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:ZA(null==o?void 0:o.parents,n),children:ZA(null==o?void 0:o.children,i),values:ZA(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=Yr(r,t)||_i(r,t),i=(0,l.either)((0,l.both)((0,l.prop)("dependentLookupAttributes"),(0,l.prop)("dependentLookupCode")),(0,l.prop)("children"));return Xo(r,n,i).flatMap(Zo).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>dr(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=eN({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>eN({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},rN=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!gt(e.uri)&&St(e.type)&&St(t)&&!t.startsWith(e.type))(n,t))return e;const i=js(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(Os),(0,l.map)(zA))(i);return eN({structure:e,attrType:e[t].attrType,values:a})}),t)},nN=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 XA(e,r)}));return r||n?t.filter(Os).reduce(((e,t)=>nN({structure:e,attributeValue:t})),e):e}),t);{const e=r;return XA(t,e.type)?eN({structure:t,attrType:t[e.type].attrType,values:[zA(e)]}):t}},iN=e=>{let{structure:t,uri:r}=e;return(0,l.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?KA({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},aN=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=js(i,n,r)||[];return a.length?eN({structure:t,attrType:t[r].attrType,values:a.filter(Os).map(zA)}):t},oN=(e,t,r)=>{const n=Nt(e),i=Nt(t);return n===i?((e,t)=>{const r=Vt(t),n=Vt(e);return It(n,r)||((e,t)=>xt(e)&&!xt(t)&&It(t,e))(n,r)})(e,t):!(!r||!$t(t))&&BE(r,i).includes(n)},sN=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},lN=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?GE(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return oN(r,t,o)}))},uN=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>uN(e,t,r)))))},cN=(e,t,r,n)=>{let{uri:i,value:a}=r;return{type:e,uri:i,lookupValue:a,autopopulate:i!==t&&sN(n,e)}},pN=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s}=e;const l=t[r],u=Nt(n),c=WE(u,o,i,a),p=uN("children",t,l),d=uN("parents",t,l),y=p.flatMap((e=>uN("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=>cN(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)||Nt(t)!==u&&oN(t,n,c)})).map((t=>cN(e.attrType.uri,n,t,s))))),E=y.flatMap((e=>{const r=uN("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=>cN(e.attrType.uri,n,t,s)))}));return[...l.values.filter((e=>{let{uri:t}=e;return oN(t,n,c)})).map((e=>cN(r,n,e,s))),...T,...E,...f]},dN=async e=>{let{attributeType:t,attributePresentations:r,value:n}=e;const i=cv({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=>Rd(e,t.dataLabelPattern))),o=e=>Object.values(e[0])[0],s=(0,l.pipe)(o,i),u=(0,l.cond)([[rr,()=>a(n)],[lr,()=>(e=>{const r=o(e),n=sr(t);return nu([{codeValue:r,type:n}]).then((e=>{if(Array.isArray(e))return iv(e[0],n,r)}))})(n)],[l.T,()=>s(n)]]);return await u(t)},yN=e=>{let{value:t,attributeType:r,entityType:n=""}=e,i=[{fieldName:"type",filter:Zr.EQUALS,values:[n]}];return Array.isArray(t)?i=i.concat(fN(r,t)):i.push(TN([t],r)),i},fN=(e,t)=>{const r=Zt(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=rr(i)?fN(i,t[r]):[TN(t[r],i)];return e.push(...a),e}}),[])},TN=(e,t)=>e&&e.length&&!(0,l.isNil)(e[0])&&""!==e[0]?{fieldName:or(t.uri),filter:t.type===nt.TYPE_BLOB?Zr.FULL_TEXT:Zr.EQUALS,values:e}:{fieldName:or(t.uri),filter:Zr.MISSING_VALUE},EN={AttributesDiff:o,AttributesEditor:a,HistoryManager:s},mN={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([[3937],{27950:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>zs,IL3:()=>rd,PY2:()=>bn,Ng6:()=>Pe,YJ7:()=>dn,NlI:()=>en,XYV:()=>un,Xt7:()=>ve,wfT:()=>ri,EMD:()=>Bn,HAc:()=>ge,PEf:()=>An,oA3:()=>Wn,$XE:()=>Ge,eWf:()=>gn,q7e:()=>_e,KVe:()=>ni,WVQ:()=>Rr,oZZ:()=>di,bNA:()=>yi,Rjq:()=>fi,G39:()=>Pn,W0P:()=>Xe,X1H:()=>Qe,hdG:()=>et,ws7:()=>tt,VI$:()=>Ze,yn8:()=>Me,N0y:()=>Fe,dZX:()=>We,bQt:()=>Ei,oS0:()=>nt,bZE:()=>sn,Nsj:()=>fn,psV:()=>pn,xPW:()=>On,pyR:()=>Jn,p8l:()=>qn,Wkf:()=>Oe,zHr:()=>be,NIO:()=>he,$26:()=>Ng,Esk:()=>Mn,s9T:()=>je,MEy:()=>ku,j5E:()=>Zr,vAw:()=>Gn,NMQ:()=>Vn,eVu:()=>ec,YGb:()=>Je,mNm:()=>Qn,Y1q:()=>KE,s_5:()=>Xn,RgZ:()=>Hn,unl:()=>pi,Qy0:()=>Ti,pYu:()=>Fn,wIJ:()=>Kg,GFH:()=>Se,Ury:()=>Rn,S91:()=>Sn,p3$:()=>Oi,wSh:()=>Z,BDP:()=>Ui,pGS:()=>Kn,ARY:()=>it,XGc:()=>ti,fO_:()=>$r,wwy:()=>Ce,h_8:()=>In,_XL:()=>yn,j2V:()=>ii,dMV:()=>Zn,NBX:()=>QA,OXy:()=>at,BXd:()=>xe,KM9:()=>Ne,CJB:()=>si,lXI:()=>qe,nqG:()=>hi,C68:()=>Nn,yxQ:()=>mi,Yj_:()=>De,D25:()=>Ie,ZIY:()=>Be,Tl4:()=>r_,lwr:()=>_n,NkU:()=>ai,Rtp:()=>ei,YGx:()=>$e,uTS:()=>zn,MCv:()=>Ae,IYE:()=>Yn,PiC:()=>ci,MVv:()=>ze,h_m:()=>He,DUe:()=>ln,tJI:()=>Re,fDt:()=>we,cNQ:()=>oi,SwE:()=>xn,ZHR:()=>ui,PYu:()=>Ke,lD1:()=>wn,lVm:()=>Ve,vnX:()=>Kv,$x5:()=>Jv,_R1:()=>Hv,wUm:()=>Qv,z7V:()=>bi,dC6:()=>ke,MBD:()=>Ue,GmF:()=>ua,cKm:()=>Ye,iP_:()=>vn,NVC:()=>Le,tPT:()=>Nl,tZe:()=>bd,kRE:()=>Sf,psB:()=>wf,X0$:()=>Al,zE1:()=>jl,Wm5:()=>fl,vyX:()=>kc,wLZ:()=>Pl,W4V:()=>se,EtK:()=>Ds,Wtd:()=>_l,asT:()=>oN,kGs:()=>gm,ewt:()=>dE,O_f:()=>wu,sOy:()=>It,Tde:()=>or,LMI:()=>bc,skb:()=>Y_,sPt:()=>cc,sH1:()=>pc,RPM:()=>Wm,h27:()=>wc,Uqd:()=>jc,xG:()=>iA,Z2f:()=>lv,fgW:()=>N_,I69:()=>J_,ZxB:()=>z_,mdt:()=>Mm,Qbq:()=>lm,rny:()=>qi,UEY:()=>Ia,Q0T:()=>wa,Lyr:()=>Fa,sBn:()=>Sa,itK:()=>Aa,H9$:()=>Ra,KPc:()=>Pa,zos:()=>Na,ELQ:()=>Ma,dZs:()=>fa,Cz4:()=>ya,z_L:()=>ja,fGe:()=>da,iuF:()=>ga,Wib:()=>_a,Hn0:()=>ka,obS:()=>xa,E$L:()=>Ta,XUh:()=>va,Qp_:()=>ba,_jk:()=>Ea,sKE:()=>ma,WmG:()=>Oa,QKx:()=>Da,Oik:()=>Ca,s0A:()=>ha,o9m:()=>Ua,MCd:()=>La,RsS:()=>Ic,tGK:()=>iu,lIv:()=>kl,Vg3:()=>Zi,mkC:()=>$i,xv5:()=>ta,a14:()=>Gi,yv0:()=>ea,Zm0:()=>Vi,Nxd:()=>xi,$mM:()=>zi,ifj:()=>wr,NWi:()=>wv,xr3:()=>Sv,wNf:()=>fu,iJH:()=>Iv,d89:()=>ki,Edd:()=>Fi,Z5t:()=>Mi,uGe:()=>Di,UoR:()=>Ci,xvW:()=>Rv,$qe:()=>Pv,yPM:()=>pa,$cp:()=>Ll,vKJ:()=>Cl,VtG:()=>dp,AID:()=>PT,B1H:()=>qA,b7X:()=>am,$uE:()=>Nm,keo:()=>sm,C_p:()=>Ph,G27:()=>Lb,JA0:()=>mf,b3T:()=>vm,oC6:()=>bm,_Zs:()=>Om,epC:()=>Rm,YYG:()=>Pm,f_2:()=>bf,w3l:()=>SA,QHB:()=>Db,Jso:()=>jA,RXH:()=>hb,Vr9:()=>Wb,lMm:()=>$O,BlA:()=>EN,fmQ:()=>Ns,yRD:()=>TA,NcL:()=>Ch,QK6:()=>ye,ymd:()=>td,JV_:()=>Bf,XiW:()=>YT,Yrx:()=>nf,GPx:()=>gl,gjI:()=>vl,vlo:()=>IE,E_P:()=>Cm,aAL:()=>Gp,NBq:()=>Ps,wp9:()=>Fm,DsR:()=>kp,MPc:()=>UT,gWE:()=>CT,DT_:()=>DT,ipn:()=>jT,ORg:()=>Ri,_wz:()=>LT,RYR:()=>sE,PP2:()=>uf,wS7:()=>mv,cBQ:()=>Op,pBq:()=>cT,DsO:()=>ee,X78:()=>qf,xZs:()=>$f,YFy:()=>of,Gmt:()=>Df,K$w:()=>Cf,DSj:()=>Wp,Mfr:()=>sf,k9j:()=>gp,ww$:()=>Rl,WVU:()=>Uf,hxF:()=>El,n6p:()=>xr,E7G:()=>sy,nwO:()=>bN,Mzk:()=>Tp,aFF:()=>fm,HRH:()=>xu,EZK:()=>Ud,Kxm:()=>Rd,Z9i:()=>sh,CrF:()=>Af,DNd:()=>Va,vUy:()=>pN,lJh:()=>Gu,zHo:()=>Wu,sEJ:()=>JA,UO$:()=>ET,zeJ:()=>dr,dLR:()=>Fs,JQy:()=>Ks,XtP:()=>js,Ug0:()=>Jr,A1W:()=>om,sw:()=>Id,nv3:()=>Mv,JgD:()=>Fv,nve:()=>XA,SkP:()=>Js,SAs:()=>dT,i5L:()=>Xs,PWK:()=>$o,IM5:()=>ks,Aup:()=>Gb,Mfk:()=>YO,HQx:()=>es,oN$:()=>Zo,mB6:()=>pv,p6d:()=>w,o0x:()=>U,ufS:()=>zO,k7L:()=>ZO,mrB:()=>I,OuZ:()=>Cd,ncP:()=>At,W$R:()=>Dd,JOV:()=>ht,Zmi:()=>bt,hm5:()=>vt,ECL:()=>Cr,vPL:()=>Ld,qmL:()=>QE,hPi:()=>lT,hXd:()=>Qi,OCS:()=>Ki,p2l:()=>el,qF1:()=>nd,_X$:()=>id,yj2:()=>Yg,bzh:()=>Vm,k66:()=>Jo,kiP:()=>po,pSg:()=>ce,kz_:()=>yf,H_U:()=>zo,t9e:()=>Qa,j2$:()=>Od,PFL:()=>Kt,aJ3:()=>Eg,To9:()=>sr,wpo:()=>ey,ADq:()=>rh,UUb:()=>eh,tQX:()=>th,xy8:()=>Zt,EUG:()=>yr,AFK:()=>kt,X3M:()=>pr,WN0:()=>Xo,kDl:()=>Ms,uDV:()=>HE,IhQ:()=>Bs,pfb:()=>qs,R$r:()=>Um,w80:()=>So,Pfu:()=>qa,Gtj:()=>Kl,fyF:()=>Ql,kkq:()=>Ko,u5q:()=>Nt,O$n:()=>zd,ptG:()=>Zd,f4_:()=>Vh,uap:()=>$h,d7q:()=>rf,liG:()=>cf,$oF:()=>tf,avf:()=>OE,DiQ:()=>bE,cfX:()=>hE,vD3:()=>gE,Qrb:()=>mE,EJQ:()=>vE,HWy:()=>EE,gjS:()=>cE,y6v:()=>TE,JUW:()=>Of,GtP:()=>eb,_kX:()=>Wa,u1e:()=>Ba,sJj:()=>pm,CJp:()=>zh,uKF:()=>cm,wo0:()=>Rf,s5:()=>Wo,cwx:()=>Go,Y6b:()=>Yy,TTx:()=>Ff,UtR:()=>qy,HaQ:()=>Mf,E6I:()=>_f,Won:()=>Qy,vTU:()=>Wy,Nsy:()=>Gd,KMQ:()=>ym,Do$:()=>qd,CSV:()=>nl,TMe:()=>Hy,l1V:()=>Yu,RHh:()=>Zu,VQ1:()=>Xu,cGG:()=>Ju,z7d:()=>UE,Xaq:()=>ns,Sj8:()=>fN,PJj:()=>tu,k3T:()=>zr,PjQ:()=>wi,s7l:()=>op,jLA:()=>tb,GGR:()=>PE,j5q:()=>AE,DnY:()=>np,RY5:()=>VE,Px$:()=>lE,KPC:()=>WA,NIY:()=>yp,HvW:()=>lp,Fof:()=>Ka,BXy:()=>up,fX:()=>rb,BTI:()=>Qd,uie:()=>Fd,q27:()=>ry,vrC:()=>rO,fAQ:()=>Jf,XkT:()=>rp,lrH:()=>Xf,nt9:()=>Yr,XH8:()=>Xd,XH2:()=>Xr,jFi:()=>Jd,qhs:()=>Ro,wwR:()=>Hd,Uk3:()=>Ft,$Rg:()=>Bt,ev7:()=>HA,RB9:()=>Ef,iFp:()=>Ym,e$p:()=>Hm,PcX:()=>Qm,SpP:()=>qm,R6_:()=>hg,CY1:()=>Pg,Ajk:()=>Xc,Yiz:()=>Jc,FK9:()=>Bc,UOo:()=>ev,aTW:()=>jf,uug:()=>yu,P$2:()=>wg,XS2:()=>au,Hyb:()=>Nu,d3Y:()=>$c,Klp:()=>Gc,WxZ:()=>Ig,Gzu:()=>Bu,ZOr:()=>tp,uqV:()=>$y,Pm4:()=>re,hWO:()=>Dt,nHA:()=>Bh,nVD:()=>WE,_tF:()=>nc,dED:()=>Zy,P2h:()=>zy,jrr:()=>so,mmY:()=>uo,T6O:()=>ts,h6J:()=>Ed,hM2:()=>MA,XR6:()=>X,jmz:()=>qE,IHt:()=>YE,NZI:()=>oh,wdF:()=>Qf,YNv:()=>im,IFm:()=>nm,o_F:()=>XE,kgP:()=>Kf,ZYI:()=>Xp,QXK:()=>Bl,efz:()=>Yl,Q5d:()=>Wl,Ysv:()=>ql,UWq:()=>LE,ocC:()=>DE,io3:()=>Qr,Sbt:()=>Io,roS:()=>wo,Ww1:()=>Uo,QaS:()=>Ep,ERZ:()=>PA,CL1:()=>xA,idV:()=>wd,nIW:()=>Ct,fjE:()=>bg,sG0:()=>nv,tV7:()=>ru,g8o:()=>e_,Qy:()=>Zg,t2P:()=>Tg,KbW:()=>mo,wId:()=>bo,LS0:()=>Oo,bFH:()=>Ry,Rgl:()=>wy,fW1:()=>Dh,GFW:()=>xf,Ywp:()=>Wv,pg:()=>uy,WSA:()=>Iy,fed:()=>kA,tT_:()=>Ys,BgZ:()=>Hs,xIV:()=>Qs,KbL:()=>ap,JBA:()=>Vt,aNC:()=>kv,RFJ:()=>Jp,Zeh:()=>TT,OT5:()=>Gv,mC3:()=>Ml,kR6:()=>TN,gFw:()=>Gh,NVY:()=>jm,k6v:()=>ad,FEC:()=>od,L5S:()=>Dm,Ob5:()=>ny,KUV:()=>iy,dvH:()=>Lm,V3i:()=>qb,VD3:()=>Kr,mm2:()=>Ku,rou:()=>iT,izH:()=>Ya,DK$:()=>Ha,KMp:()=>Vp,c31:()=>lt,mbo:()=>ih,gT8:()=>pt,CZ8:()=>_s,uGi:()=>ws,Poc:()=>ot,_9k:()=>Cs,ZTM:()=>Rs,bwT:()=>Is,tzW:()=>yt,tF$:()=>ct,o96:()=>As,M4S:()=>Us,_vs:()=>Lp,xF8:()=>pE,PUO:()=>Tm,ATu:()=>nh,j1S:()=>Ni,V3K:()=>_i,Lmx:()=>Ai,oSN:()=>Ii,ZaZ:()=>st,n_1:()=>Gy,N6e:()=>Mp,SxO:()=>lo,w3p:()=>km,xU7:()=>de,Y_p:()=>Lo,$k6:()=>Do,Gdl:()=>av,U6P:()=>iv,OwB:()=>mg,hTh:()=>BE,xqc:()=>Bo,JvE:()=>Yo,i29:()=>Ac,dzT:()=>Bi,uPS:()=>bp,cZV:()=>hp,n3B:()=>C_,e6O:()=>P_,s7j:()=>Qg,j$Q:()=>vf,kW2:()=>Zh,tH7:()=>Vo,Yxg:()=>ll,MaZ:()=>NE,nqN:()=>_E,jWj:()=>kE,o_J:()=>is,yW4:()=>md,uT0:()=>fd,C82:()=>Td,bsH:()=>Wh,u9Z:()=>nT,J$m:()=>Vy,j_Q:()=>qc,OaI:()=>Hc,wB1:()=>YA,SP6:()=>ly,ZYr:()=>GA,IMU:()=>Kp,FoU:()=>hf,DVz:()=>cv,mxe:()=>I_,FHr:()=>yT,D1g:()=>aT,VO3:()=>eg,de5:()=>Zv,Uw1:()=>Ee,J6q:()=>ah,XCe:()=>io,fbl:()=>Bv,Ir:()=>To,XQO:()=>Eo,QXb:()=>Oy,zXF:()=>JE,P8_:()=>Gf,iiD:()=>$p,MOC:()=>vy,WF:()=>by,xE1:()=>Si,idW:()=>iN,QWZ:()=>KO,YL3:()=>fp,Fn9:()=>T,j2U:()=>Zs,MpE:()=>ft,kQw:()=>Xt,mfm:()=>Pu,vZp:()=>Mt,E8K:()=>eN,VSb:()=>vs,vr_:()=>Jt,Vmh:()=>cN,FgW:()=>Yb,oDv:()=>os,fGG:()=>JO,kuw:()=>ls,eHk:()=>jE,Tt2:()=>as,pQZ:()=>us,oZ7:()=>XO,T6Y:()=>gr,_26:()=>gu,YkM:()=>ar,J6y:()=>lu,njU:()=>Eu,TBP:()=>ss,IT0:()=>lh,x_:()=>dm,FP6:()=>Wt,biM:()=>Bd,TMl:()=>Yd,Vkd:()=>bu,WiY:()=>_g,_zi:()=>Ou,J6D:()=>Qu,Lt4:()=>Er,QEi:()=>ur,whI:()=>Gr,KIu:()=>Br,JhM:()=>oe,C_0:()=>Nr,lzc:()=>oy,qIF:()=>D_,O27:()=>E,aBi:()=>ty,xOX:()=>yl,EdS:()=>St,WgC:()=>Rt,eEv:()=>Ht,A4t:()=>mu,YOQ:()=>$t,Wos:()=>Or,jWr:()=>$a,Or$:()=>ir,lhE:()=>Hr,CwH:()=>lr,pzC:()=>cl,ymH:()=>Tu,QZu:()=>rr,rYH:()=>gg,FVt:()=>br,Kn2:()=>ue,jgw:()=>Ru,Qgr:()=>Hu,OXP:()=>Os,lS4:()=>cr,g5f:()=>Ag,fp6:()=>pu,Uty:()=>ia,YkG:()=>nr,xdS:()=>dt,kMF:()=>kT,$NE:()=>wt,bC9:()=>Pt,Ian:()=>Pi,KVV:()=>um,q9e:()=>Co,iIf:()=>ov,ian:()=>ml,m6e:()=>Pr,OFd:()=>pl,kqr:()=>zt,fnZ:()=>Vr,VFZ:()=>hl,ZiX:()=>gt,j5n:()=>mr,zkt:()=>_,Pcm:()=>BA,QDV:()=>ul,M5u:()=>vg,laD:()=>U_,mtq:()=>qt,CtB:()=>sv,CBv:()=>ae,I0t:()=>Ar,u1G:()=>wE,gk1:()=>S_,Bgb:()=>R_,uzs:()=>Wr,v0l:()=>sc,Zqp:()=>Ky,j0k:()=>xo,tCm:()=>jt,gmx:()=>ou,mOr:()=>Fu,TwZ:()=>t_,GyU:()=>xv,zGm:()=>dy,bMg:()=>Ly,EyD:()=>Av,FQA:()=>Nv,fZN:()=>Fy,xsF:()=>gv,Lxg:()=>_v,O3l:()=>Ap,Wni:()=>_p,wRx:()=>Cv,OxG:()=>Ay,uJQ:()=>_y,qWg:()=>uv,i96:()=>cy,zhn:()=>Uv,G8q:()=>vi,Jct:()=>rE,A9Y:()=>te,Y5F:()=>hA,gxP:()=>le,c$P:()=>su,M7o:()=>Lc,BBN:()=>oo,ZBU:()=>J,UkJ:()=>vo,xkv:()=>Vf,z$M:()=>aN,KAm:()=>Tf,lCl:()=>RT,rkF:()=>Rh,IU6:()=>Nd,RGr:()=>h,aYu:()=>m,ije:()=>Zl,Buf:()=>xp,YLu:()=>zl,ct9:()=>ko,XkY:()=>jy,T5R:()=>yy,uQS:()=>My,wcJ:()=>jo,d$I:()=>Sl,rSp:()=>Wd,Sx:()=>pp,Ilm:()=>Fl,Ki6:()=>Tl,VGk:()=>jp,sFD:()=>bb,eWN:()=>sN,dWE:()=>Hg,Lkd:()=>qT,aDL:()=>mT,yaA:()=>xy,lOh:()=>sT,DBr:()=>dg,hK$:()=>nu,TZ_:()=>Ad,CMB:()=>L_,FU8:()=>cp,J$p:()=>vT,b5s:()=>OT,h2W:()=>Lt,SL_:()=>eT,oUH:()=>pd,ck9:()=>fy,RAb:()=>rc,nL:()=>rv,k$p:()=>vb,Xs0:()=>Xl,u7I:()=>oT,rxg:()=>Uu,bji:()=>Cu,oCZ:()=>gh,MjG:()=>zv,FuV:()=>cd,$ju:()=>yd,t6d:()=>dd,m5F:()=>Te,sx:()=>lN,rSc:()=>dv,U10:()=>Qc,L8n:()=>If,R9X:()=>By,rj2:()=>Yf,_C4:()=>vd,tCj:()=>Wf,uAg:()=>af,wx9:()=>yE,KF3:()=>gd,ax9:()=>_d,HH7:()=>Fp,ufV:()=>lf,_6y:()=>vp,XTh:()=>qv,AJo:()=>mp,Ixr:()=>gf,P6Y:()=>ON,Bd_:()=>hh,xkB:()=>mh,W41:()=>rT,WkI:()=>tT,sSE:()=>Eh,GMd:()=>Oc,jtL:()=>vc,Bxm:()=>Oh,FVh:()=>ph,U_T:()=>Uy,FTe:()=>ie,VGB:()=>ne,Wfe:()=>Vu,Ls5:()=>$u,$bd:()=>Lu});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,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:()=>ds,editAttribute:()=>ys,editEndDate:()=>bs,editRoles:()=>Es,editStartDate:()=>hs,editTags:()=>ms,removeAttribute:()=>Ts});var o={};r.r(o),r.d(o,{applyCrosswalks:()=>gm,collectCrosswalksFromAttributes:()=>Nm,compareActivenessAttributes:()=>vm,compareAttributes:()=>bm,compareImages:()=>Om,compareRoles:()=>Rm,compareTags:()=>Pm});var s={};r.r(s),r.d(s,{createHistoryManager:()=>Im});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"),L=(0,l.equals)("9999"),j=(0,l.test)(/^[az][az][az]$/),k=(0,l.test)(/^[az][az][az][az]$/),F=(0,l.test)(/^9+$/),M=(0,l.test)(/^[9az]+$/),x=(0,l.cond)([[C,(0,l.always)("M")],[D,(0,l.always)("MM")],[j,(0,l.always)("MMM")],[k,(0,l.always)("MMMM")],[M,(0,l.always)("Mo")],[l.T,(0,l.always)("MM")]]),$=(0,l.cond)([[C,(0,l.always)("D")],[D,(0,l.always)("DD")],[M,(0,l.always)("Do")],[l.T,(0,l.always)("DD")]]),V=(0,l.cond)([[C,(0,l.always)("y")],[D,(0,l.always)("YY")],[L,(0,l.always)("YYYY")],[F,(0,l.always)("YYYYYY")],[l.T,(0,l.always)("YYYY")]]),G=(e,t)=>(0,l.cond)([[(0,l.both)((0,l.always)(t),C),(0,l.always)("h")],[(0,l.both)((0,l.always)(t),D),(0,l.always)("hh")],[C,(0,l.always)("H")],[D,(0,l.always)("HH")],[l.T,(0,l.always)(t?"hh":"HH")]])(e),W=(0,l.cond)([[C,(0,l.always)("m")],[D,(0,l.always)("mm")],[l.T,(0,l.always)("mm")]]),B=(0,l.cond)([[C,(0,l.always)("s")],[D,(0,l.always)("ss")],[l.T,(0,l.always)("ss")]]),Y=/([9az]+)([^9az]+)*/g,q=e=>{const t=[...e.toLowerCase().matchAll(Y)];if(E(e)||t.length>0){const[,e="",r=""]=(0,l.propOr)([],0,t),[,n="",i=""]=(0,l.propOr)([],1,t),[,a="",o=""]=(0,l.propOr)([],2,t);return(0,l.join)("",[x(e),r,$(n),i,V(a),o])}return e},H=/(9+)([^9]+)*/g,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=>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)?Z.None():Z.Some(t(e))}),Z={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?Z.Some(e):Z.None()},fromNull:function(e){return null==e?Z.None():Z.Some(e)},fromUndefined:function(e){return void 0===e?Z.None():Z.Some(e)},fromEmpty:function(e){return E(e)?Z.None():Z.Some(e)}},ee=(e,t)=>{let r=null;return function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];const o=()=>{e.apply(this,i),r=null};r&&clearTimeout(r),r=setTimeout(o,t)}},te=(e,t)=>(r,n)=>{const i=t?(0,l.prop)(t):l.identity;return e.indexOf(i(r))-e.indexOf(i(n))},re=(0,l.when)((0,l.is)(Array),(0,l.prop)(0)),ne=e=>Array.isArray(e)?e:[e],ie=e=>[e],ae=e=>!!e&&["www.","http://","https://","ftp://","ftps://","smb://","data:"].some((t=>String(e).toLowerCase().startsWith(t))),oe=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase()),se=e=>oe(e=e||"")?`mailto:${e}`:!e.includes("://")&&(e.toLowerCase().startsWith("www.")||e.split(".").length>2)?`http://${e}`:e,le=(0,l.when)((0,l.is)(String),(e=>""===e?void 0:"true"===e.toLowerCase())),ue=e=>null!=e&&["object","function"].includes(typeof e),ce=function(e){const t=[],r=(e,n)=>{n=n||[];for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(Array.isArray(e)&&(i=parseInt(i,10)),ue(e[i])?r(e[i],n.concat(i)):t.push(n.concat(i)))};return r(e),t},pe=(0,l.when)((0,l.is)(Object),JSON.stringify),de=(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),pe)])),[(0,l.always)(t),(0,l.always)(t)],[l.T,pe]])(e)},ye=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)},fe=/[\n\r%#()<>?[\\\]^`{}|]/g,Te=e=>`data:image/svg+xml;utf8,${e.replace(/["']\);{0,}$/,"").replace(/'/g,'"').replace(/>\s{1,}</g,"><").replace(/\s{2,}/g," ").replace(fe,encodeURIComponent)}`,Ee=e=>`data:image/gif;base64,${e}`;var me=r(76665);let he,be,Oe,ve,ge,_e,Ae,Ne,Pe,Re,Se,we,Ie,Ue,Ce,De,Le,je,ke,Fe,Me,xe,$e,Ve,Ge,We,Be,Ye,qe,He,Qe,Ke,Je,Xe,ze,Ze,et,tt;var rt;!function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(he||(he={})),function(e){e.local="local",e.validationService="validationService"}(be||(be={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(Oe||(Oe={})),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"}(ve||(ve={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(ge||(ge={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch",e.RELATION_ATTRIBUTE="relationAttribute"}(_e||(_e={})),function(e){e.directed="directed",e.undirected="undirected",e.bidirectional="bidirectional"}(Ae||(Ae={})),function(e){e.asc="asc",e.desc="desc"}(Ne||(Ne={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(Pe||(Pe={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(Re||(Re={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}(Se||(Se={})),function(e){e.TABLE="table",e.List="list",e.MAP="map"}(we||(we={})),function(e){e.PROFILE="profile",e.MAP="map"}(Ie||(Ie={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(Ue||(Ue={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(Ce||(Ce={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(De||(De={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(Le||(Le={})),function(e){e.EXISTS="exists",e.MISSING="missing"}(je||(je={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(ke||(ke={})),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"}(Fe||(Fe={})),function(e){e.ENTITY_TYPE="entityLevel",e.ATTRIBUTE_TYPE="attributeLevel"}(Me||(Me={})),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"}(xe||(xe={})),function(e){e.IN="in",e.OUT="out"}($e||($e={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}(Ve||(Ve={})),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"}(Ge||(Ge={})),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"}(We||(We={})),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"}(Be||(Be={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}(Ye||(Ye={})),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"}(qe||(qe={})),function(e){e.CustomAction="CustomAction",e.ConsoleAppAction="ConsoleAppAction"}(He||(He={})),function(e){e.NEW="new",e.CLASSIC="classic"}(Qe||(Qe={})),function(e){e.ASC_BY_NAME="ascByName"}(Ke||(Ke={})),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"}(Je||(Je={})),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"}(Xe||(Xe={})),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"}(ze||(ze={})),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"}(Ze||(Ze={})),function(e){e.AWAITING_REVIEW="AWAITING_REVIEW",e.APPLIED="APPLIED",e.REJECTED="REJECTED"}(et||(et={})),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"}(tt||(tt={})),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"}(rt||(rt={}));const nt=rt;let it,at;!function(e){e.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}(it||(it={})),function(e){e.Saving="Saving",e.Cloning="Cloning"}(at||(at={}));const ot=(0,l.prop)("referencedEntityTypeURI"),st=(0,l.prop)("relationshipTypeURI"),lt=(0,l.prop)("referencedAttributeURIs"),ut=(0,l.curry)(((e,t)=>(0,l.pipe)(lt,(0,l.filter)((0,l.startsWith)(e)))(t))),ct=ut("configuration/relationTypes"),pt=ut("configuration/entityTypes"),dt=(0,l.pipe)((0,l.prop)("uri"),(0,l.startsWith)("configuration/relationTypes")),yt=(0,l.filter)(dt),ft=(e,t)=>!t||t.some((t=>t===e.uri)),Tt="1Tempo4rary",Et="1Tepmo4Rel",mt=(0,l.cond)([[l.isNil,(0,l.always)("")],[(0,l.test)(/[^/]$/),(0,l.concat)(l.__,"/")]]),ht=()=>`1Tempo4DCR${Date.now()+Math.round(1e3*Math.random())}`,bt=e=>`${e}/uri$$${Date.now()+Math.round(1e3*Math.random())}`,Ot=e=>()=>bt(e),vt=(e,t)=>{const r=mt(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return bt(n)},gt=e=>e&&e.includes("uri$$"),_t=Ot("entities"),At=Ot("relations"),Nt=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),Pt=(0,l.startsWith)("relations/"),Rt=(0,l.startsWith)("entities/"),St=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/entityTypes/")),wt=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/relationTypes/")),It=(0,l.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),Ut=(0,l.pipe)((0,l.split)("/"),l.head),Ct=(0,l.pipe)((0,l.split)("/"),l.last),Dt=e=>e.split(".").slice(0,2).join("."),Lt=(e,t)=>{const[r,...n]=e.split("."),i=n.join(`/${r}/`);return`${t||""}/${r+(i&&`/${i}`)}`},jt=(0,l.curry)(((e,t)=>`${e}/attributes/${t}`)),kt=(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("/")},Ft=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},Mt=(0,l.either)((0,l.startsWith)("attributes."),(0,l.startsWith)("analyticsAttributes.")),xt=e=>2===e.split("/").length,$t=e=>5===e.split("/").length,Vt=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},Gt=e=>e.replace(/uri\$\$/g,Tt),Wt=e=>e.includes("changeRequests/")&&e.includes("/changes/"),Bt=e=>e.split("/changes/")[1];function Yt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qt=(0,l.allPass)([(0,l.propSatisfies)((0,l.either)(l.isNil,St),"uri"),(0,l.prop)("faceted"),(0,l.propEq)("type",nt.TYPE_STRING)]),Ht=(0,l.has)("values"),Qt=(0,l.cond)([[(0,l.has)("dependentLookupCode"),(0,l.always)(nt.TYPE_DEPENDENT_LOOKUP)],[(0,l.has)("lookupCode"),(0,l.always)(nt.TYPE_LOOKUP)],[Ht,(0,l.always)(nt.TYPE_ENUM)],[qt,(0,l.always)(nt.TYPE_TYPEAHEAD)],[(0,l.propEq)("type",nt.TYPE_BOOLEAN),(0,l.always)(nt.TYPE_BOOLEAN_RADIO)],[l.T,(0,l.prop)("type")]]),Kt=(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){Yt(e,t,r[t])}))}return e}({},e,{type:Qt(e)})),(0,l.pick)(["type","values","lookupCode","uri","dependentLookupCode","singleValue"])),Jt=e=>!!e&&(!!e.autoGenerated&&e.type!==nt.TYPE_NESTED||!!e.parentAutoGenerated),Xt=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.test)(/\/analyticsAttributes\//)),zt=(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),Zt=e=>Xt(e)?"analyticsAttributes":"attributes",er=(0,l.propEq)("hidden",!0),tr=(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))),rr=tr(nt.TYPE_NESTED),nr=tr(nt.TYPE_REFERENCE),ir=tr(nt.TYPE_IMAGE),ar=(0,l.either)(rr,nr),or=(e,t)=>{const r=Xt(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(".")},sr=(0,l.either)((0,l.prop)("lookupCode"),(0,l.prop)("dependentLookupCode")),lr=(0,l.pipe)(sr,Boolean),ur=(0,l.pipe)((0,l.prop)("dependentLookupCode"),Boolean),cr=(0,l.both)(lr,(0,l.pipe)(sr,("rdm",(0,l.pipe)(Ut,(0,l.equals)("rdm")))));const pr=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=Zt({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]||yr(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:[]},dr=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=pr(e,t,r);return n.length?(0,l.last)(n):null},yr=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",nt.TYPE_NESTED),(0,l.propEq)("type",nt.TYPE_IMAGE)]),(0,l.prop)("attributes")],[(0,l.propEq)("type",nt.TYPE_REFERENCE),(0,l.pipe)(lt,(0,l.map)((t=>dr(e,t))),(0,l.reject)(l.isNil))],[l.T,(0,l.always)(null)]])(t)},fr=[nt.TYPE_ACTIVENESS_DATE,nt.TYPE_DATE,nt.TYPE_TIMESTAMP,nt.TYPE_LOCAL_DATE],Tr=[nt.TYPE_ACTIVENESS_DATE,nt.TYPE_TIMESTAMP,nt.TYPE_LOCAL_DATE],Er=e=>fr.includes(e),mr=e=>Tr.includes(e),hr=[nt.TYPE_INT,nt.TYPE_LONG,nt.TYPE_NUMBER,nt.TYPE_FLOAT,nt.TYPE_DOUBLE,nt.TYPE_COUNT],br=e=>hr.includes(e),Or=e=>[nt.TYPE_FLOAT,nt.TYPE_DOUBLE].includes(e),vr=[nt.TYPE_BOOLEAN,nt.TYPE_BOOLEAN_RADIO,nt.TYPE_RDM_LOOKUPS_NOT_RESOLVED],gr=e=>vr.includes(e),_r=[nt.TYPE_URL,nt.TYPE_BLOG_URL,nt.TYPE_IMAGE_URL],Ar=e=>_r.includes(e),Nr=tr(nt.TYPE_EMAIL),Pr=e=>nt.TYPE_SSN===e;var Rr,Sr=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(Rr||(Rr={}));const wr=(0,l.curry)(((e,t,r)=>{var n;const i=e===Rr.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)))})),Ir=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),Ur=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),Ir),Cr=(0,l.pipe)((0,l.reject)(E),Ur);function Dr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Lr(e,t,r[t])}))}return e}function Lr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jr=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("?")?"&":"?")+Ir(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}},kr=e=>t=>{if(!(e=>!ue(e.value))(t)){var r;const n=`${e}/${null!==(r=t.refEntity)&&void 0!==r&&r.objectURI?Ct(t.refEntity.objectURI):ht()}`;return Dr({},t,{uri:n,value:(0,l.fromPairs)((0,l.map)(Fr(n),(0,l.toPairs)(t.value)))})}return Dr({},t,{uri:`${e}/${ht()}`})},Fr=e=>t=>{let[r,n]=t;return[r,(0,l.map)(kr(`${e}/${r}`),n)]},Mr=e=>{const{uri:t}=e;return(0,l.evolve)({attributes:(0,l.pipe)(l.toPairs,(0,l.map)(Fr(`${t}/attributes`)),l.fromPairs)},e)},xr=e=>(0,l.evolve)({changes:(0,l.map)((0,l.map)((0,l.when)((0,l.propEq)("type",Ze.CREATE_ENTITY),(0,l.evolve)({newValue:Mr}))))},e),$r={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},Vr=(0,l.equals)($r.SUGGESTING),Gr=(0,l.equals)($r.EDITING),Wr=(0,l.equals)($r.VIEWING),Br=(0,l.either)(Gr,Vr),Yr=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),qr=(0,l.curry)(((e,t)=>(0,l.pipe)(Yr(e),(0,l.prop)("extendsTypeURI"))(t))),Hr=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(qr(e,r)));return n(r)})),Qr=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=qr(e,n);return r})),Kr=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?Kr(e,Yr(e,t.extendsTypeURI),r):void 0,Jr=(e,t)=>{const r=t.map(Qr(e));return(r.length?r.reduce(l.intersection):[])[0]},Xr=(e,t)=>Kr(e,(0,l.is)(Object,t)?t:Yr(e,t),"typeImage"),zr=(e,t)=>e.entityTypes.reduce(((r,n)=>n.uri!==t&&Hr(e,t,n.uri)?r.concat(n.uri):r),[]),Zr={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"},en={LIST_EQUALS:"listEquals",NOT_LIST_EQUALS:"not listEquals",LIST_EQUALS_CASE_SENSITIVE:"listEqualsCaseSensitive",NOT_LIST_EQUALS_CASE_SENSITIVE:"not listEqualsCaseSensitive"},tn={[Zr.EQUALS]:"equals",[Zr.NOT_EQUALS]:"not",[Zr.STARTS_WITH]:"starts with",[Zr.MISSING_VALUE]:"missing value",[Zr.IN_RANGE]:"in range",[Zr.HAS_ALL]:"has all",[Zr.FULL_TEXT]:"full text",[Zr.EXISTS]:"exists",[Zr.COUNT_EQUALS]:"count equals",[Zr.COUNT_NOT_EQUALS]:"count not equal",[Zr.COUNT_LT]:"count less",[Zr.COUNT_LTE]:"count less or equal",[Zr.COUNT_GT]:"count greater",[Zr.COUNT_GTE]:"count greater or equal",[Zr.COUNT_RANGE]:"count in range",[Zr.LT]:"less than",[Zr.LTE]:"less than or equal",[Zr.GT]:"greater than",[Zr.GTE]:"greater than or equal",[Zr.IN_FILE]:"in file",[Zr.NOT_IN_FILE]:"not in file",[Zr.CONTAINS]:"contains",[Zr.ON]:"on",[Zr.BEFORE]:"before",[Zr.AFTER]:"after",[Zr.WITHIN]:"within"},rn="in",nn="notIn",an="not range",on=e=>({[rn]:Zr.EQUALS,[nn]:Zr.NOT_EQUALS}[e]||e);var sn,ln;!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"}(sn||(sn={})),function(e){e.LAST_3DAYS="last3Days"}(ln||(ln={}));const un=["LAST_DAY","LAST_3DAYS","LAST_WEEK","LAST_MONTH","LAST_6MONTHS","LAST_YEAR","PICK_DATE"].reduce(((e,t)=>(e[t]=sn[t]||ln[t],e)),{}),cn={[sn.LAST_DAY]:"Last 24 hours",[ln.LAST_3DAYS]:"Last 3 days",[sn.LAST_WEEK]:"Last 7 days",[sn.LAST_MONTH]:"Last month",[sn.LAST_6MONTHS]:"Last 6 months",[sn.LAST_YEAR]:"Last year",[sn.PICK_DATE]:"Pick date"},pn={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},dn={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},yn="<No label>",fn={IN:"in",OUT:"out"};var Tn=r(87918),En=r.n(Tn);function mn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){hn(e,t,r[t])}))}return e}function hn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bn={startDate:{type:nt.TYPE_ACTIVENESS_DATE,get label(){return En().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:nt.TYPE_ACTIVENESS_DATE,get label(){return En().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},On=mn({id:{type:nt.TYPE_ENTITY_ID,get label(){return En().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},bn,{roles:{type:nt.TYPE_STRING,get label(){return En().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:nt.TYPE_STRING,get label(){return En().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),vn={workflow:{type:nt.TYPE_STRING,get label(){return En().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:nt.TYPE_STRING,get label(){return En().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:nt.TYPE_STRING,get label(){return En().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:nt.TYPE_TIMESTAMP,get label(){return En().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},gn={commenter:{type:nt.TYPE_STRING,get label(){return En().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},_n={notResolved:{type:nt.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return En().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},An={createdBy:{type:nt.TYPE_STRING,get label(){return En().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:nt.TYPE_STRING,get label(){return En().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:nt.TYPE_TIMESTAMP,get label(){return En().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:nt.TYPE_TIMESTAMP,get label(){return En().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},Nn={matches:{type:nt.TYPE_COUNT,get label(){return En().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:nt.TYPE_COUNT,get label(){return En().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0}},Pn={sourceSystems:{type:nt.TYPE_STRING,get label(){return En().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:nt.TYPE_STRING,get label(){return En().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:nt.TYPE_INT,get label(){return En().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:nt.TYPE_TIMESTAMP,get label(){return En().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:nt.TYPE_TIMESTAMP,get label(){return En().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:nt.TYPE_TIMESTAMP,get label(){return En().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:nt.TYPE_TIMESTAMP,get label(){return En().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:nt.TYPE_TIMESTAMP,get label(){return En().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:nt.TYPE_STRING,get label(){return En().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}};let Rn;!function(e){e.matchRules="matchRules",e.MLRecommendedMatch="MLRecommendedMatch"}(Rn||(Rn={}));const Sn={[Rn.matchRules]:{type:nt.TYPE_STRING,get label(){return En().text("Match Rules")},uri:Rn.matchRules,name:Rn.matchRules,faceted:!0,hideForDataTenant:!0},[Rn.MLRecommendedMatch]:{type:nt.TYPE_STRING,get label(){return En().text("Match IQ")},uri:Rn.MLRecommendedMatch,name:Rn.MLRecommendedMatch,faceted:!0,hideForDataTenant:!0}},wn=mn({},On,vn,gn,_n,An,Nn,Pn,Sn,{type:{type:nt.TYPE_STRING,get label(){return En().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}}),In="NOT_MATCH";var Un=r(13980),Cn=r.n(Un);function Dn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ln(e,t,r[t])}))}return e}function Ln(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jn=Cn().oneOf(["mobile","tablet","desktop"]),kn=Cn().shape({deviceTypes:Cn().oneOfType([jn,Cn().arrayOf(jn)]),roles:Cn().arrayOf(Cn().string)}),Fn=Cn().shape({value:Cn().string,lookupCode:Cn().string}),Mn=Cn().shape({link:Cn().string,filename:Cn().string}),xn=Cn().shape({displayName:Cn().string,parent:Cn().string}),$n=Cn().oneOfType([Cn().string,Cn().number,Cn().bool,Fn]),Vn=Cn().oneOfType([$n,Cn().arrayOf($n)]),Gn=Cn().shape({fieldName:Cn().string,values:Cn().arrayOf(Vn),filter:Cn().string,type:Cn().string}),Wn=Cn().shape({minValue:Cn().number,maxValue:Cn().number}),Bn=Cn().shape({label:Cn().string,name:Cn().string,description:Cn().string,type:Cn().string,hidden:Cn().bool,faceted:Cn().bool,searchable:Cn().bool,uri:Cn().string,access:Cn().arrayOf(Cn().string),cardinality:Wn}),Yn=Cn().shape({label:Cn().string,uri:Cn().string,typeColor:Cn().string,direction:Cn().string,startObject:Cn().object,endObject:Cn().object}),qn=Cn().shape({typeColor:Cn().string,typeIcon:Cn().string,typeImage:Cn().string,label:Cn().string,uri:Cn().string,attributes:Cn().arrayOf(Bn)}),Hn=Cn().shape({uri:Cn().string,label:Cn().string,memberTypes:Cn().array,extendsTypeUri:Cn().string,attributes:Cn().arrayOf(Bn)}),Qn=Cn().shape({uri:Cn().string,label:Cn().string,extendsTypeUri:Cn().string,relationshipTypeURIs:Cn().arrayOf(Cn().string)}),Kn=Cn().shape({uri:Cn().string,description:Cn().string,label:Cn().string,schemaVersion:Cn().string,entityTypes:Cn().arrayOf(qn),roles:Cn().arrayOf(Cn().object),groupTypes:Cn().arrayOf(Cn().object),relationTypes:Cn().arrayOf(Yn),graphTypes:Cn().arrayOf(Qn),interactionTypes:Cn().arrayOf(Hn),sources:Cn().arrayOf(Cn().object)}),Jn=Cn().shape({uri:Cn().string,type:Cn().string}),Xn=Cn().shape({uri:Cn().string,attributes:Cn().object,type:Cn().string,timestamp:Cn().number,members:Cn().object}),zn=Cn().shape({uri:Cn().string,type:Cn().string}),Zn=Cn().shape({value:Cn().object,ov:Cn().bool,type:Cn().string,uri:Cn().string}),ei=Cn().shape({refEntity:Cn().oneOfType([Cn().array,Cn().object]),refRelation:Cn().oneOfType([Cn().array,Cn().object]),value:Cn().object,ov:Cn().bool,type:Cn().string,uri:Cn().string}),ti=Cn().oneOf((0,l.values)($r)),ri=Cn().shape({type:Cn().oneOf(Object.values(he)).isRequired,attributeTypeUri:Cn().string.isRequired,parentUri:Cn().string.isRequired,uri:Cn().string,message:Cn().string}),ni={attributeType:Bn,showEmptyEditors:Cn().bool,lazy:Cn().bool,mode:ti,metadata:Kn,ownError:ri,errors:Cn().arrayOf(ri),crosswalks:Cn().array,onAddAttributes:Cn().func,onAddOneMore:Cn().func,onDeleteAttribute:Cn().func,onChangeAttribute:Cn().func,additionalControlsRenderer:Cn().func,hideDeleteButton:Cn().bool,showNonOv:Cn().bool,state:Cn().oneOf(["deleted","edited"]),expanded:Cn().bool},ii=Dn({attributeValue:Zn},ni),ai=Dn({attributeValue:ei},ni),oi=Cn().shape({value:Cn().oneOfType([Cn().string,Cn().bool,Cn().number]),ov:Cn().bool,type:Cn().string,uri:Cn().string,lookupCode:Cn().string,lookupRawValue:Cn().string}),si=Cn().shape({totalOvValues:Cn().number,totalValues:Cn().number}),li=Cn().shape({inRelations:Cn().arrayOf(Cn().oneOfType([Cn().object,Cn().string])),outRelations:Cn().arrayOf(Cn().oneOfType([Cn().object,Cn().string])),groups:Cn().arrayOf(Cn().string),entityTypes:Cn().arrayOf(Cn().string),nextEntry:Cn().object}),ui=Cn().oneOf(["asc","desc"]),ci=Cn().shape({id:Cn().string,content:li,allowOnlyCreateNew:Cn().bool,sortColumn:Cn().string,sortOrder:ui,"text-empty":Cn().string,max:Cn().number,icon:Cn().string,caption:Cn().string,canCreate:kn,canRead:kn,canUpdate:kn,canDelete:kn,editingEnabled:Cn().bool}),pi=Cn().shape({id:Cn().string,caption:Cn().string,pageSize:Cn().number,icon:Cn().string,canCreate:kn,canRead:kn,canUpdate:kn,canDelete:kn,attributes:Cn().object}),di=Cn().shape({entityUri:Cn().string,entityType:Cn().string,entityLabel:Cn().string,object:Jn}),yi=Cn().shape({relationUri:Cn().string,relationType:Cn().string,relationLabel:Cn().string,direction:Cn().string,object:zn}),fi=Cn().shape({entity:di,relation:yi}),Ti=Cn().shape({value:Cn().string,isRawFilter:Cn().bool}),Ei=Cn().shape({id:Cn().string,label:Cn().string,name:Cn().string,availableEntityTypes:Cn().array}),mi=Cn().shape({id:Cn().string,allowMergeAll:Cn().bool,matchActions:Cn().object,availableTabs:Cn().arrayOf(Cn().oneOf(["findMatches","potentialMatches","notAMatch"]))}),hi=Cn().shape({matchRules:Cn().arrayOf(Cn().string),object:Jn,shortestTransitiveMatchPath:Cn().arrayOf(Cn().shape({matchRules:Cn().arrayOf(Cn().string),match:Cn().string})),direct:Cn().bool,matchScore:Cn().number}),bi=Cn().arrayOf(hi),Oi=Cn().arrayOf(Cn().shape({uri:Cn().string,label:Cn().string})),vi=[{label:En().text("And"),value:"and"},{label:En().text("Or"),value:"or"},{label:En().text("And not"),value:"and not"},{label:En().text("Or not"),value:"or not"}];function gi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _i=(0,l.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Ai=(0,l.pipe)(_i,(0,l.propOr)("","label")),Ni=(0,l.curry)(((e,t)=>{const r=_i(e,t);return[(0,l.path)(["startObject","objectTypeURI"],r),(0,l.path)(["endObject","objectTypeURI"],r)]})),Pi=(0,l.curry)(((e,t,r)=>{const[n,i]=Ni(e,r);return Hr(e,n,t)||Hr(e,i,t)})),Ri=(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){gi(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),Si=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?fn.OUT:fn.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(fn.IN),i=r(fn.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},wi=(0,l.pathOr)("",["directionalContext",0,"labelPattern"]),Ii=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?Ii(e,_i(e,t.extendsTypeURI),r):void 0,Ui={CREATE:"CREATE",READ:"READ",UPDATE:"UPDATE",DELETE:"DELETE",INITIATE_CHANGE_REQUEST:"INITIATE_CHANGE_REQUEST",MERGE:"MERGE",UNMERGE:"UNMERGE"},Ci=(0,l.curry)(((e,t)=>e.every((e=>Di(e,t))))),Di=(0,l.curry)(((e,t)=>{const r=Jt(t);return Li(e,t)&&(e===Ui.READ||!r)})),Li=(e,t)=>!t||!t.access||t.access.includes(e),ji=(0,l.curry)(((e,t,r)=>Di(Ui.READ,r)&&(Vr(t)?Di(Ui.INITIATE_CHANGE_REQUEST,r):Di(e,r)))),ki=ji(Ui.CREATE),Fi=ji(Ui.DELETE),Mi=ji(Ui.UPDATE),xi=Ci([Ui.CREATE,Ui.MERGE,Ui.READ,Ui.UPDATE]),$i=Ci([Ui.UPDATE,Ui.READ,Ui.CREATE]),Vi=Ci([Ui.UPDATE,Ui.READ]),Gi=Ci([Ui.DELETE,Ui.UPDATE,Ui.READ]),Wi=(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["*"])),Bi=(e,t,r)=>(0,l.pipe)((0,l.map)(Wi(e,t)),(0,l.filter)(l.identity))(r),Yi=(e,t,r)=>{const n=Bi(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&Di(Ui.MERGE,r)},qi=(0,l.curry)(((e,t,r,n)=>{const i=_i(e,n),[a,o]=Ni(e,n);return i&&Di(Ui.CREATE,i)&&Hr(e,a,t.type)&&Hr(e,o,r.type)})),Hi=(e,t,r,n,i)=>{const a=Yr(e,n.type),o=Bi(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(qi(e,n,i))||a.some(qi(e,i,n))}))},Qi=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=Yr(e,r.type),o=(0,l.propOr)({},"matchActions",t);return{canMerge:Yi(o,i,a),canAddRelation:Hi(e,o,i,r,n),canMark:Di(Ui.UPDATE,a)&&Di(Ui.READ,a)}},Ki=(e,t,r,n)=>(0,l.pipe)((0,l.map)((n=>Qi(e,t,n.object,r,n.matchRules))),(0,l.reduce)((0,l.mergeWith)(l.and),{}))(n),Ji=Xt,Xi=(0,l.complement)(Ji),zi=Di(Ui.READ),Zi=e=>{let{attributeType:t,mode:r}=e;return Xi(t)&&ki(r,t)&&!er(t)},ea=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=gt(r.uri),o=Mi(n),s=ki(n);return(0,l.cond)([[Ji,l.F],[(0,l.always)(a),l.T],[(0,l.always)(i),o],[l.T,(0,l.allPass)([o,s])]])(t)},ta=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=gt(r.uri),s=Mi(n),u=Fi(n),c=na(Ui.UPDATE,n,a,r),p=na(Ui.DELETE,n,a,r);return(0,l.cond)([[Ji,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)},ra=(0,l.curry)(((e,t,r,n)=>{const i=yr(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=>!Li(e,n)||!ra(e,t,r[n.name],n)))))})),na=(0,l.curry)(((e,t,r,n,i)=>Vr(t)?ra(Ui.INITIATE_CHANGE_REQUEST,r,n,i):ra(e,r,n,i))),ia=(0,l.both)((0,l.complement)(er),zi),aa="SuperUser",oa="allTenants",sa=[oa,"allCustomers"],la=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===aa})).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===aa){const e=r?sa.concat(r.map((e=>`allTenants.${e}`))):sa,n=r&&t[0]===oa?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}))},ua={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"},ca={[ua.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[ua.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activities"],privileges:["EXECUTE"]},[ua.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[ua.CAN_READ_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ"]},[ua.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[ua.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[ua.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[ua.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[ua.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[ua.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[ua.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[ua.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[ua.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[ua.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[ua.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[ua.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[ua.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[ua.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[ua.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[ua.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[ua.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[ua.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[ua.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[ua.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[ua.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[ua.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[ua.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[ua.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[ua.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]},[ua.CAN_READ_DVF]:{serviceId:"DVF",resourcePath:["functionsManagement"],privileges:["READ"]}},pa=(0,l.curry)(((e,t,r)=>la({allowedPermissionsNames:e,permissionsNames:ua,permissionsConfig:ca}).some((e=>e(t,{params:{tenant:r}}))))),da=pa([ua.CAN_EXPORT]),ya=pa([ua.CAN_EXPORT_ACTIVITIES]),fa=pa([ua.CAN_IMPORT_ENTITIES_FROM_DT]),Ta=pa([ua.CAN_READ_ENTITIES_FROM_DT]),Ea=pa([ua.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),ma=pa([ua.CAN_UPDATE_PROCESS_INSTANCE]),ha=pa([ua.CAN_VIEW_WORKFLOW_DEFINITION]),ba=pa([ua.CAN_CONFIG_ENVIRONMENT_REGISTER]),Oa=pa([ua.CAN_UPDATE_WORKFLOW_DATA_TASK]),va=pa([ua.CAN_READ_WORKFLOW_DATA_TASK]),ga=pa([ua.CAN_MANAGE_WORKFLOW_DEFINITION]),_a=pa([ua.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),Aa=pa([ua.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),Na=pa([ua.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),Pa=pa([ua.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),Ra=pa([ua.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),Sa=pa([ua.CAN_EXECUTE_WORKFLOW_JOBS]),wa=pa([ua.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),Ia=pa([ua.CAN_CREATE_CONFIG_JAR]),Ua=pa([ua.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),Ca=pa([ua.CAN_VIEW_CONFIG_JAR]),Da=pa([ua.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),La=pa([ua.CAN_VIEW_WORKFLOW_JOBS]),ja=pa([ua.CAN_MAKE_BULK_UPDATE]),ka=pa([ua.CAN_OPEN_DATA_LOADER_EXECUTE,ua.CAN_OPEN_DATA_LOADER_READ]),Fa=pa([ua.CAN_BULK_DELETE_PROFILES]),Ma=pa([ua.CAN_READ_MDM_DATA_ENTITIES]),xa=pa([ua.CAN_READ_DVF]),$a=pa([ua.IS_FREEMIUM_ADMIN]),Va=(0,l.reject)(er),Ga=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),Va,(0,l.filter)(e))(t),Wa=(0,l.curry)(((e,t)=>Ga((t=>Zi({attributeType:t,mode:e})),t))),Ba=(0,l.curry)(((e,t)=>Ga((t=>Zi({attributeType:t,mode:e})||ia(t)),t))),Ya=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(ia)),qa=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...qa(e)])))),Ha=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(ia),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Ha(e)])))),Qa=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...Qa(e)])))),Ka=(0,l.pipe)(Yr,(0,l.converge)(l.concat,[Ha,Qa]));function Ja(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Xa(e,t,r[t])}))}return e}function Xa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const za=(0,l.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,za(e)))},t))),Za=e=>{var t;return Ja({},e,{matchGroups:(0,l.uniq)((e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[]))})},eo=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),to=(0,l.when)(eo,(0,l.dissoc)("values")),ro=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return Ja({},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})})),no=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},io=(0,Sr.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(qa,t).concat((0,l.chain)(qa,r)).some(no)})),ao=e=>{let t=!1;const r=za((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?Ja({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},oo=e=>{const t=io(e),r=(0,l.map)((e=>za((0,l.pipe)(to,(0,l.when)((0,l.always)(e),ro))))(t)),n=(0,l.map)(Za),i=(0,l.map)(ao);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},so=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),lo=(0,l.prop)("relationshipTypeURIs"),uo=(0,l.curry)(((e,t)=>{var r;return(null===(r=e.graphTypes)||void 0===r?void 0:r.filter(co(e,t)))||[]})),co=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return null==n?void 0:n.some(Pi(e,t))},po=(e,t)=>(0,l.pipe)(so,(0,l.defaultTo)({}),lo,(0,l.defaultTo)([]),(0,l.chain)(Ni(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(Yr(e)))(e,t),yo=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),fo=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),To=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return fo((0,l.complement)(yo))(e)},Eo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return fo(yo)(e)},mo=(0,l.pipe)(Yr,(0,l.propOr)([],"matchGroups")),ho=(e,t,r)=>(0,l.pipe)(mo,(0,l.find)((0,l.propEq)("uri",r)))(e,t),bo=(0,l.curry)(((e,t,r)=>(0,l.pipe)(ho,(0,l.propOr)(r,"label"))(e,t,r))),Oo=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(mo,(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]})),vo=e=>(0,l.partition)(yo,e),go=(0,l.includes)(l.__,["and","or","not"]),_o=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),Ao=(0,l.includes)(l.__,["equals","notEquals","in"]),No=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return go(t)?No(r):_o(t)?r.filter(St):Ao(t)?r.map((0,l.prop)("uri")).filter(St):[]})),l.uniq),Po=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)(No),l.uniq),Ro=(0,l.pipe)(mo,Po),So=(0,l.pipe)(Oo,Po),wo=(e,t)=>{let{interactionTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},Io=(0,l.pipe)(wo,Ha),Uo=(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||Hr(e,n,t)})(e,t))})(e,t)),Co=e=>!!e.required,Do=(e,t,r)=>{const n=(0,l.cond)([[St,Yr(e)],[wt,_i(e)]])(t);return Lo(e,n,r)},Lo=(e,t,r)=>!t||t.hidden&&!(e=>e.uri&&St(e.uri)&&3===e.uri.split("/").length)(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!Jt(e))).flatMap((t=>{const n=t.required?[t]:[];if(r){let i;if(t.type===nt.TYPE_REFERENCE){const n=st(t),a=lt(t);i=Do(e,n,r).filter((e=>a.some(It(e.uri))))}else t.attributes&&(i=Lo(e,t,r));i&&n.push(...i)}return n})):t.type===nt.TYPE_REFERENCE?Do(e,st(t),r):[],jo=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),Co]),e.attributes||[])},ko=(e,t)=>{const r=pt(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},Fo=(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)?En().text(n):n};return r(null,t)})),Mo=["label","description","abbreviation","caption","toolTip"],xo=e=>Fo(Mo,e),$o=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=Ct(t);return r.find((e=>{let{uri:t}=e;return Ct(t)===n}))})),Vo=(0,l.curry)(((e,t)=>{const r=Ct(t);return(0,l.pipe)($o(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),Go=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"})},Wo=(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}))},Bo=(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)})),Yo=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=Yr(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));function qo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ho(e,t,r[t])}))}return e}function Ho(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qo=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 Ko(i,e,t,r,n)},Ko=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:["attributes"];return Z.fromNull(e&&e.length?e:yr(t,r)).map((e=>e.map((e=>{const r=Qo(t,e,n,i);return r.length?qo({},e,{children:r}):e})))).orSome([]).filter((0,l.either)((0,l.complement)(ar),(0,l.prop)("children"))).filter(ia).filter(n).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},Jo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Qo(e,t,r,["attributes","analyticsAttributes"])},Xo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Qo(e,t,r,["attributes"])},zo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Qo(e,t,r,["analyticsAttributes"])},Zo=e=>e.children?e.children.flatMap(Zo):e,es=e=>e.children?[e,...e.children.flatMap(es)]:e,ts=(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)})),rs=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return Ct(r)===e})))),ns=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),rs("LUD")),(0,l.defaultTo)(r))(t||[])},is=(e,t)=>{let{survivorshipStrategies:r}=e;return rs(t,r)},as=(0,l.allPass)([(0,l.complement)(l.isNil),Di(Ui.READ)]),os=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),Di(Ui.READ)]),ss=(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)([Di(Ui.CREATE),Di(Ui.INITIATE_CHANGE_REQUEST)])]),ls=(0,l.curryN)(2,(0,l.pipe)(Yr,os)),us=(0,l.curryN)(2,(0,l.pipe)(_i,as));function cs(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 ps(e,t){for(var r=e.substr(e.indexOf("/attributes/")+12).split("/"),n=[],i=0;i<r.length;i+=2)n.push(cs(r[i],r[i+1],e,t));return n}function ds(e,t,r,n,i,a,o){void 0===a&&(a=0);var s=ps(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 ds(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 ys(e,t,r,n,i,a){void 0===a&&(a=0);var o=ps(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()?(fs(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(fs.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=ds(e,t,r,n,i,a),s}var c=ys(e,o,o.valueUri,{},i,a);ys(c,t,r,n,i,a+1)}function fs(e,t){ue(e)?(t.value=e.value,t.lookupCode=e.lookupCode):(t.value=e,t.lookupCode&&(t.lookupCode=e))}function Ts(e,t,r,n){void 0===n&&(n=0);var i=ps(r)[n];if(i.hasChildren){var a=(e[i.name]||[]).filter((function(e){return e.uri===i.valueUri}))[0];a&&Ts(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 Es(e,t){e.roles=t||[]}function ms(e,t){e.tags=t||[]}function hs(e,t){e.startDate=t||""}function bs(e,t){e.endDate=t||""}const Os=e=>{let{ov:t}=e;return!1!==t},vs=(e,t)=>((e,t)=>Ar(e.type)&&ae(t))(e,t)||((e,t)=>Nr(e.type)&&oe(t))(e,t),gs=(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))),_s=gs("refEntity"),As=gs("refRelation"),Ns=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],Ps=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},Rs=(0,l.prop)("objectURI"),Ss=(0,l.prop)("objectURI"),ws=(0,l.prop)("type"),Is=(0,l.pipe)(_s,(0,l.defaultTo)({}),Rs),Us=(0,l.pipe)(As,(0,l.defaultTo)({}),Ss),Cs=(0,l.pipe)(_s,(0,l.defaultTo)({}),ws),Ds=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type})));return(e||[]).concat(r)},Ls=(0,l.evolve)({refEntity:re,refRelation:re}),js=(e,t,r,n)=>{const i=pr(e,r),a=Yr(e,t.type)||_i(e,t.type);if(0===i.length)return null;const o=Zt(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(!ft(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=a.attributes.filter((e=>st(e)===r.uri||ot(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},ks=(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?ks(a.value,o):a},Fs=(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 ks(e[r],i)})),Ms=(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")]]),xs=(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"])]]),$s=(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"])]]),Vs=(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)(Vs(e,i)))))(r)})),Gs=(0,l.curry)(((e,t)=>(0,l.ifElse)((0,l.is)(Array),(0,l.map)(Gs(e)),e)(t))),Ws=(0,l.curry)(((e,t,r,n)=>(0,l.pipe)(Vs(e,r),Gs(t))(n))),Bs=Ws(null,Ms),Ys=Ws(Os,Ms),qs=Ws(null,xs),Hs=Ws(Os,xs),Qs=Ws(Os,$s),Ks=(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=Fs(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},Js=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(Is,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{}),Xs=(e,t)=>{const r=Vt(t),n=(0,l.pipe)((0,l.split)("/"),(0,l.dropLast)(1),l.last)(t);return Ks(e,r,n)},zs=Object.values(bn),Zs=(0,l.includes)(l.__,zs),el=e=>zs.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,l.assoc)(n,e[n],t):t}),{});function tl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){rl(e,t,r[t])}))}return e}function rl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nl=(e,t)=>`${e}_${t}`,il=[wn.matches.name,wn.matchRules.name],al=(0,l.values)(vn).map((e=>e.name)),ol=e=>(0,l.when)((0,l.always)(!e),(0,l.reject)((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,al)))),sl=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,il)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>nl(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),ll=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,l.pipe)(l.values,ol(r),sl(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(nl(`dtPotentialMatches.${t.name}`,"")))))(wn)},ul=(0,l.propEq)("uri",wn.type.uri),cl=e=>(0,l.values)(Sn).some((0,l.propEq)("uri",null==e?void 0:e.uri)),pl=(0,l.propEq)("uri",Pn.sourceSystems.uri),dl=Object.values(On),yl=(0,l.includes)(l.__,dl),fl=e=>{let{entity:t,attributeType:r,value:n}=e;return tl({},t,{[r.uri]:void 0===n?r.defaultValue:n})},Tl=e=>{let{entity:t,attributeType:r}=e;return(0,l.dissoc)(r.uri,t)},El=e=>{let{entity:t,attributeType:r,value:n}=e;return tl({},t,{[r.uri]:n})},ml=(0,l.propEq)("uri",On.roles.uri),hl=(0,l.propEq)("uri",On.tags.uri);function bl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ol(e,t,r[t])}))}return e}function Ol(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vl=e=>{let{parentUri:t,attributeType:r}=e;return bl({uri:vt(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,l.propOr)("","defaultValue",e);return(0,l.cond)([[ar,(0,l.always)({value:{}})],[lr,()=>t?{value:"",lookupCode:t}:{value:""}],[(0,l.both)((0,l.propEq)("defaultValue","now"),(0,l.pipe)((0,l.prop)("type"),Er)),(0,l.always)({value:Date.now()})],[l.T,(0,l.always)({value:t})]])(e)})(r))},gl=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)(Wa(i),(0,l.filter)((0,l.anyPass)([(0,l.has)("defaultValue"),ur,(0,l.propEq)("required",!0)])))(t),o={};for(const e of a){const{name:t}=e,a=vl({parentUri:r,attributeType:e});let s=yr(n,e);s&&(e.type===nt.TYPE_REFERENCE&&(s=yt(s)),a.value=gl({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(!(0,l.isEmpty)(a.value)||Boolean(a.lookupCode)||ur(e))&&(o[t]=[a])}return o},_l=e=>{let{entity:t,metadata:r}=e;return Do(r,t.type,!0).filter(ur).reduce(((e,t)=>{const n=t.name,i=Vt(t.uri);return(i===e.type?[{parentUri:e.uri,attributes:e.attributes}]:js(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:Nl({entity:e,attributeType:t,parentUri:i,index:0})}),e)}),t)},Al=(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===nt.TYPE_NESTED?bl({},e,{value:Al({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return bl({},s(t),gl({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),Nl=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=vl({parentUri:n,attributeType:r}),u=Ms(l);return(0,me.ZP)(t,(e=>{ds(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},Pl=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,me.ZP)(t,(e=>{ds(e.attributes||e.value,r,n.uri,Ms(n),a,o,i)}))},Rl=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,me.ZP)(t,(e=>{ys(e.attributes||e.value,r,n,i,a,o)}))},Sl=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,me.ZP)(t,(e=>{Ts(e.attributes||e.value,r,n,i)}))},wl=e=>""===e,Il=(0,l.cond)([[(0,l.propSatisfies)((0,l.complement)((0,l.anyPass)([wl,l.isNil])),"lookupCode"),l.F],[(0,l.propSatisfies)((0,l.anyPass)([wl,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]]),Ul=(0,l.reject)(Il),Cl=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=>Cl({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),Ul)),(0,l.when)((0,l.always)(t),(0,l.reject)(l.isEmpty)))},Dl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Cl({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),Ls),deleteEmptyComplex:e})},Ll=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)(Dl(e),(0,l.reject)(l.isEmpty))},jl=(0,l.curry)(((e,t)=>t.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:i}=t;return Zs(r)?fl({entity:e,attributeType:r}):Nl({entity:e,attributeType:r,parentUri:n,index:i})}),e))),kl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n,value:i}=t;return Zs(r)?El({entity:e,attributeType:r,value:i}):Rl({entity:e,attributeType:r,uri:n,value:i})})),Fl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n}=t;return Zs(r)?Tl({entity:e,attributeType:r}):Sl({entity:e,attributeType:r,uri:n})})),Ml=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)},xl="UrlThumbnail",$l="CdnUrlThumbnail",Vl=(0,l.curry)(((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(Os):(0,l.head)(n);return e&&e.value}return null})),Gl=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>Vl(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),Wl=Gl(["CdnUrl","Url"],!0),Bl=Gl(["CdnUrlPreview","UrlPreview"],!0),Yl=Gl([$l,xl],!0),ql=Gl([$l,xl]),Hl=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,l.cond)([[zt,(0,l.always)(t)],[(0,l.both)(Xt,(0,l.always)(i)),(0,l.always)(i)],[l.T,(0,l.always)(n)]])(a),s=zt(a)?"uri":"name",u=(0,l.pipe)((0,l.prop)(a[s]),(0,l.when)((0,l.both)((0,l.always)(Zs(a)),(e=>null===e)),(0,l.always)([""])),(0,l.defaultTo)([]),ne)(o);return(0,l.when)((0,l.always)(r(u,a)),(0,l.append)({attrType:a,values:u}),e)}),[])},Ql=(e,t,r)=>{const n=Ya(e),i=(0,l.any)(r?l.T:Os);return Hl(n,t,i)},Kl=(e,t,r,n,i,a)=>{const o=gt(null==r?void 0:r.uri)?Wa(t,e):Ba(t,e);return Hl(o,r,((e,o)=>{const s=Zi({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:Os,e)||zt(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let Jl;const Xl=e=>{Jl=e};function zl(e,t){return Jl(e,t)}const Zl=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)})),eu=50,tu=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=eu,offset:a=0}=e;return zl("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i,offset:a}),headers:{"Content-Type":"application/json"}})},ru=(0,l.once)((()=>zl("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),nu=e=>zl("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),iu=(e,t)=>zl("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),au=e=>Z.fromNull(tn[e]).map(En().text).orSome(""),ou=(0,l.curry)(((e,t)=>`${e}_${t}`)),su=(0,l.split)("_"),lu=(0,l.includes)("_"),uu=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),cu=(0,l.curry)(((e,t)=>e.some(uu(t)))),pu=cu([Zr.IN_RANGE,Zr.COUNT_RANGE,Zr.WITHIN]),du=cu([Zr.EXISTS,Zr.MISSING_VALUE]),yu=(0,l.cond)([[du,(0,l.always)(0)],[pu,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),fu=(0,l.complement)(du),Tu=cu([Zr.HAS_ALL,Zr.EQUALS,Zr.NOT_EQUALS]),Eu=cu([Zr.COUNT_EQUALS,Zr.COUNT_NOT_EQUALS,Zr.COUNT_LT,Zr.COUNT_LTE,Zr.COUNT_GT,Zr.COUNT_GTE,Zr.COUNT_RANGE]),mu=cu([Zr.IN_FILE,Zr.NOT_IN_FILE]),hu=e=>{switch(e){case Zr.COUNT_EQUALS:return Zr.EQUALS;case Zr.COUNT_NOT_EQUALS:return Zr.NOT_EQUALS;case Zr.COUNT_LT:return Zr.LT;case Zr.COUNT_LTE:return Zr.LTE;case Zr.COUNT_GT:return Zr.GT;case Zr.COUNT_GTE:return Zr.GTE;case Zr.COUNT_RANGE:return Zr.IN_RANGE}},bu=cu([Zr.ON,Zr.BEFORE,Zr.AFTER,Zr.WITHIN,Zr.NOT_EQUALS]),Ou=cu([Zr.WITHIN]),vu=[[Zr.COUNT_EQUALS,Zr.COUNT_NOT_EQUALS,Zr.COUNT_LT,Zr.COUNT_LTE,Zr.COUNT_GT,Zr.COUNT_GTE],[Zr.NOT_IN_FILE,Zr.IN_FILE],[Zr.EQUALS,Zr.NOT_EQUALS,Zr.HAS_ALL],[Zr.LT,Zr.LTE,Zr.GT,Zr.GTE],[Zr.MISSING_VALUE,Zr.EXISTS],[Zr.COUNT_RANGE],[Zr.IN_RANGE],[Zr.STARTS_WITH,Zr.CONTAINS],[Zr.FULL_TEXT],[Zr.ON,Zr.BEFORE,Zr.AFTER,Zr.NOT_EQUALS],[Zr.WITHIN]],gu=(e,t)=>vu.some((r=>r.includes(e)&&r.includes(t))),_u=(0,l.pipe)(l.omit,l.values),Au={OPTIONS_FOR_STRING:_u(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],Zr),OPTIONS_FOR_DATE:[Zr.ON,Zr.BEFORE,Zr.AFTER,Zr.WITHIN,Zr.NOT_EQUALS,Zr.MISSING_VALUE,Zr.EXISTS,Zr.COUNT_EQUALS,Zr.COUNT_NOT_EQUALS,Zr.COUNT_LT,Zr.COUNT_LTE,Zr.COUNT_GT,Zr.COUNT_GTE,Zr.COUNT_RANGE,Zr.IN_FILE,Zr.NOT_IN_FILE],OPTIONS_FOR_BOOLEAN:_u(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],Zr),OPTIONS_FOR_BLOB:_u(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],Zr),OPTIONS_FOR_NUMBER:_u(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],Zr),OPTIONS_FOR_LOOKUP:_u(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],Zr),OPTIONS_FOR_ENUM:_u(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],Zr),OPTIONS_FOR_ID:[Zr.EQUALS,Zr.NOT_EQUALS,Zr.IN_FILE,Zr.NOT_IN_FILE],OPTIONS_FOR_COUNT:[Zr.EQUALS,Zr.NOT_EQUALS,Zr.LT,Zr.LTE,Zr.GT,Zr.GTE,Zr.IN_RANGE],OPTIONS_FOR_COMPLEX:[Zr.COUNT_EQUALS,Zr.COUNT_NOT_EQUALS,Zr.COUNT_LT,Zr.COUNT_LTE,Zr.COUNT_GT,Zr.COUNT_GTE,Zr.COUNT_RANGE,Zr.EXISTS,Zr.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[Zr.EQUALS,Zr.NOT_EQUALS,Zr.EXISTS,Zr.MISSING_VALUE]},Nu=e=>{const{type:t,singleValue:r=!1}=e,n=(e=>{switch(e){case nt.TYPE_TYPEAHEAD:case nt.TYPE_STRING:case nt.TYPE_PASSWORD:case nt.TYPE_TEXT:case nt.TYPE_CIK_ID:case nt.TYPE_URL:case nt.TYPE_BLOG_URL:case nt.TYPE_IMAGE_URL:case nt.TYPE_EMAIL:return Au.OPTIONS_FOR_STRING;case nt.TYPE_LOOKUP:case nt.TYPE_DEPENDENT_LOOKUP:return Au.OPTIONS_FOR_LOOKUP;case nt.TYPE_ENUM:return Au.OPTIONS_FOR_ENUM;case nt.TYPE_DATE:case nt.TYPE_ACTIVENESS_DATE:case nt.TYPE_TIMESTAMP:case nt.TYPE_LOCAL_DATE:return Au.OPTIONS_FOR_DATE;case nt.TYPE_BOOLEAN:case nt.TYPE_BOOLEAN_RADIO:return Au.OPTIONS_FOR_BOOLEAN;case nt.TYPE_BLOB:return Au.OPTIONS_FOR_BLOB;case nt.TYPE_LONG:case nt.TYPE_INT:case nt.TYPE_FLOAT:case nt.TYPE_DOUBLE:case nt.TYPE_NUMBER:return Au.OPTIONS_FOR_NUMBER;case nt.TYPE_ENTITY_ID:return Au.OPTIONS_FOR_ID;case nt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[Zr.EQUALS];case nt.TYPE_COUNT:return Au.OPTIONS_FOR_COUNT;case nt.TYPE_NESTED:case nt.TYPE_REFERENCE:case nt.TYPE_IMAGE:return Au.OPTIONS_FOR_COMPLEX;default:return Au.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(Eu,n):n},Pu=e=>[Re.and,Re.andNot].includes(e),Ru=e=>[Re.or,Re.orNot].includes(e),Su=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),Ru)),wu=(Iu=[Re.and],e=>e.slice(0,-1).every((e=>Iu.includes(e.operator))));var Iu;const Uu=e=>e.map(((e,t,r)=>{const n=0===t;return(0,l.assoc)("operator",n?null:r[t-1].operator,e)}),[]),Cu=e=>e.map(((e,t,r)=>{const n=t===r.length-1;return(0,l.assoc)("operator",n?null:r[t+1].operator,e)}),[]),Du=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},Lu=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=[Re.or,Re.orNot],n=t?[Re.and,Re.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)&&Du(e.slice(1,-1));return!i&&!a||o?e:`(${e})`},ju="and",ku=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)(ju,n,e),o=(e=>[Re.andNot,Re.orNot].includes(e))(a)?Lu(r):r;return i?o:`${t} ${a} ${o}`}),"")}},Fu=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),Mu=e=>Array.isArray(e)?e.map(Mu).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),xu=(0,l.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),$u=e=>`'${e}'`,Vu=e=>`"${e}"`,Gu=(0,l.pipe)(Mu,xu),Wu=(0,l.pipe)(Gu,$u),Bu=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.allPass)([(0,l.always)(pu(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[l.T,l.identity]])(t))),Yu=(e,t)=>Eu(t)?{type:nt.TYPE_INT}:mu(t)?{type:nt.TYPE_FILE}:bu(t)&&!Ou(t)&&mr(e.type)?{type:nt.TYPE_LOCAL_DATE}:e,qu=Object.values(un),Hu=e=>!Object.values(un).includes(e),Qu=e=>qu.includes(e),Ku=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cn;return En().text(t[e])},Ju=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.values(sn),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cn;return e.map((e=>({value:e,get label(){return Ku(e,t)}})))},Xu=e=>{const t=f()().startOf("minute");switch(e){case sn.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case sn.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case sn.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case sn.LAST_6MONTHS:return[f()(t).subtract(6,"months").valueOf(),t.valueOf()];case sn.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()];case ln.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()];default:return e}},zu=e=>{let[t,r]=e;return[f()(t).valueOf(),f()(r).endOf("date").valueOf()]},Zu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xu;return(0,l.is)(String,e)?t(e):zu(e)};let ec;!function(e){e.CurrentUser="currentUser"}(ec||(ec={}));const tc={},rc=(e,t)=>{tc[e]=t},nc=e=>tc[e];function ic(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ac(e,t,r[t])}))}return e}function ac(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const oc=e=>e.split("{CurrentUser}").join(nc(ec.CurrentUser)||""),sc=(0,l.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),lc=(0,l.curry)(((e,t,r)=>{const n=r.map(pu(e)||t.endsWith(".count")?Gu:Wu).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),uc=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},cc=e=>{let{filter:t,fieldName:r,values:n}=e;const i=yu(t);return(0,l.pipe)(uc(i),(0,l.map)(lc(t,r)),sc(" or "))(n)},pc=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(Wu).join(",")})`},dc=e=>`*${e}*`,yc=e=>`URL:${e}`,fc=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,Tc=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===Zr.IN_FILE?r:`not ${r}`},Ec=(e,t)=>[R(e,t),S(e,t)],mc=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!hc(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case Zr.ON:return ic({},e,n?{filter:Zr.EQUALS}:{filter:Zr.IN_RANGE,values:[Ec(i,n)]});case Zr.BEFORE:return ic({},e,{filter:Zr.LTE,values:[[S(i,n)]]});case Zr.AFTER:return ic({},e,{filter:Zr.GTE,values:[[R(i,n)]]});case Zr.WITHIN:return ic({},e,{filter:Zr.IN_RANGE,values:[Xu(i)]})}}return e}),cc),hc=(0,l.propSatisfies)(mr,"type"),bc=[[(0,l.prop)("rawFilter"),(0,l.pipe)((0,l.prop)("rawFilter"),oc)],[(0,l.propEq)("filter",Zr.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(cc({filter:Zr.EQUALS,fieldName:t,values:[r]}))),new ku).build())),sc(" or "))(r)}),oc)],[(0,l.propEq)("filter",Zr.CONTAINS),(0,l.pipe)((e=>{let{filter:t,fieldName:r,values:n}=e;return cc({fieldName:r,filter:t,values:n.map((0,l.pipe)(Mu,dc))})}),oc)],[(0,l.propEq)("filter",Zr.EQUALS),(0,l.pipe)((e=>{const{fieldName:t,values:r}=e;return"type"===t?cc(ic({},e,{values:(0,l.flatten)(r)})):fc(r)?pc(ic({},e,{filter:"listEquals"})):cc(e)}),oc)],[(0,l.propEq)("filter",Zr.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=yu(t);return(0,l.pipe)(uc(i),(0,l.map)(lc(t,r)),sc(" and "))(n)})(ic({},e,{values:(0,l.flatten)(e.values)})):hc(e)?(e=>{const{values:t}=e,r=!hc(e),[n]=t;return(new ku).addClause(cc(ic({},e,{filter:Zr.LT,values:[R(n,r)]}))).addClause(cc(ic({},e,{filter:Zr.GT,values:[S(n,r)]}))).orBuild()})(e):fc(t)?pc(ic({},e,{filter:"not listEquals"})):cc(e)}),oc)],[(0,l.propSatisfies)(mu,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return cc({fieldName:r,filter:Tc(t,r),values:n.map((0,l.prop)("link")).map(yc)})}],[(0,l.propSatisfies)(Eu,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return cc({fieldName:`${r}.count`,values:n,filter:hu(t)})}],[(0,l.propSatisfies)(bu,"filter"),mc],[(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 lc(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return lc(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,(0,l.pipe)(cc,oc)]],Oc=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!fu(e)||gc(e,r))},vc=(e,t)=>Array.isArray(t)?gc(e,t):e===Zr.WITHIN?Qu(t)||Number.isInteger(t):!(0,l.isNil)(t)&&Mu(t).length>0,gc=(e,t)=>t&&t.length>0&&t.every((t=>vc(e,t)));function _c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ac=e=>{let{fieldName:t=""}=e;const r=t.split("."),n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},Nc=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),Pc=(e,t,r)=>"children"===e?Sc(r,[...t][0],!0):r,Rc=(e,t,r)=>"values"===e?[...r,...t]:r,Sc=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)(Pc,t),e);if(!r&&Tu(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(Rc,t),e)}return(0,l.append)(t,e)},wc=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=Ac(e),r=e=>e.fieldName===t?e:r({fieldName:Nc(e),children:[e]});return r(e)})(t);return Sc(e,r)}),[]),Ic=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")),Uc=e=>{let[t]=e;return t.children?Uc(t.children):t.operator},Cc=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=Uc(t)===Re.andNot,a=n(t,!1),o=i?`not ${Lu(a)}`:a,s=n(r,!1);return`inSameAttributeValue(${o} ${Uc(r)||ju} ${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&&Ic(i)&&!t?r(i):n(i,a)}],...e])(o))),new ku).buildWithOperators(i.map((0,l.prop)("operator")))}return n},Dc=(0,l.pipe)((0,l.propOr)("","filter"),lu),Lc=(0,l.map)((0,l.when)(Dc,(e=>{const[t,r]=su(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){_c(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),jc=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)(Oc),Lc,wc,Cc([...e,...bc],t))},kc=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),Fc=[Zr.ON,Zr.BEFORE,Zr.AFTER,Zr.WITHIN,Zr.NOT_EQUALS,Zr.MISSING_VALUE,Zr.EXISTS],Mc=[Zr.EQUALS,Zr.NOT_EQUALS,Zr.STARTS_WITH,Zr.MISSING_VALUE,Zr.HAS_ALL,Zr.FULL_TEXT,Zr.EXISTS],xc=[Zr.EQUALS,Zr.NOT_EQUALS,Zr.LT,Zr.LTE,Zr.GT,Zr.GTE,Zr.IN_RANGE],$c=(e,t)=>{const r=Kt(e);return(e=>{switch(e){case bn.startDate.name:case bn.endDate.name:case vn.dueDate.name:case An.createdTime.name:case An.updatedTime.name:case Pn.reltioLoadDate.name:case Pn.createDate.name:case Pn.updateDate.name:case Pn.deleteDate.name:case Pn.publishDate.name:return Fc;case Nn.matches.name:case Pn.count.name:return xc;case vn.workflow.name:case vn.assignee.name:case vn.step.name:case gn.commenter.name:case An.createdBy.name:case An.updatedBy.name:case Pn.sourceSystems.name:case Pn.value.name:return Mc;default:return null}})(t)||Nu(r)},Vc=[Zr.EQUALS,Zr.NOT_EQUALS,Zr.CONTAINS,Zr.STARTS_WITH,Zr.MISSING_VALUE,Zr.HAS_ALL,Zr.IN_RANGE,Zr.WITHIN,Zr.EXISTS,Zr.ON],Gc=(0,l.pipe)($c,(0,l.filter)((0,l.includes)(l.__,Vc))),Wc=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),Bc=e=>{let{query:t,body:r}=e;return t=Wc(t),zl(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},Yc=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)(jc(),kc(t.globalFilter))(n),activeness:t.activityFilter||dn.ACTIVE_ONLY};return t.searchOptions&&(i.options=t.searchOptions),`/entities/_total${Cr(i)}`},qc=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=Yc(e,t,r);return zl(n)},Hc=e=>zl(`/entities/_total?${e}`),Qc=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(0,l.pipe)((0,l.filter)(os),(0,l.map)((0,l.prop)("uri")))(e),i={filter:Zr.EQUALS,fieldName:"type",values:n},a=r.isRawFilter?{rawFilter:t}:{filter:"containsWordStartingWith",fieldName:"attributes",values:[t]},o=(0,l.pipe)(jc(),kc(r.globalFilter))([i,a]),s=Cr({filter:o,select:"uri,label,type,roles,secondaryLabel,defaultProfilePicValue",scoreEnabled:!0,activeness:r.activityFilter||dn.ACTIVE_ONLY,max:r.max||4});return zl("/entities/_typeAheadSearch"+s,{method:"GET"})},Kc=(0,l.pipe)((0,l.reject)(l.isNil),Ur),Jc=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)(jc(),kc(i))(r),p=Kc({filter:c||null,activeness:a||"active",options:o||null}),d=[{fieldName:t,pageSize:s||20,pageNo:u||1,orderType:n.orderType||"reversedCount"}];return Bc({query:p,body:d})},Xc=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return Jc({fieldName:t,searchParams:i,options:n})};function zc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zc="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",ep=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)(jc(),kc(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||Zc,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null};return t.searchOptions&&(i.options=t.searchOptions),`/entities${Cr(i)}`},tp=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=ep(e,t,r);return zl(n)},rp=e=>lp(e,{select:"secondaryLabel"}),np=(e,t)=>{const{select:r=Zc,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),zl("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},ip=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),gt)),ap=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=ip(n).length,T={[r]:{max:a,offset:(0,l.isNil)(i)?y-f:i}},E=or(r),m={attributesPaging:T,defaultMaxValues:a,options:d,select:"crosswalks,"+E},h=[...c,{filter:"containsWordStartingWith",fieldName:E,values:[u]}],b=(0,l.pipe)(jc(),kc(d.globalFilter))(h);return b&&(m.filter=b),p&&(m.sort=p.field,m.order=p.order),zl(`${s}/api/${o}/${t}/_object`,{method:"POST",body:JSON.stringify(m)})},op=e=>`entities?filter=equals(uri,'${e}')&offset=0`,sp={options:"sendHidden,addRefAttrUriToCrosswalk"},lp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:sp;return zl(`/${e}${Cr(t)}`)},up=(e,t)=>lp(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){zc(e,t,r[t])}))}return e}({},sp,{explicitSurvivorshipGroup:t})),cp=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 zl(n,r)},pp=e=>zl(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),dp=(e,t,r)=>{const n={method:"POST",body:JSON.stringify(t)};return zl(`/${e}/_clone${Cr({executeLCA:!1,valuesToCopy:r})}`,n)},yp=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return zl(`/entities/_events/_total${Ur({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},fp=(e,t)=>zl(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",body:t}),Tp=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return zl(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",body:JSON.stringify(r)})},Ep=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 zl(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),Ur)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},mp=e=>{const t=new FormData;return t.append("file",e),zl("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=de(e,En().text("Can't upload file"));return Promise.reject(t)}))},hp=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 zl(`/personal/findSavedSearches${Ur({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"}})},bp=e=>zl(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),Op=e=>zl("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),vp=e=>{const{uri:t}=e,r=(0,l.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return zl(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},gp=e=>{let{uri:t}=e;return zl(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},_p=(e,t)=>(0,l.pipe)((0,l.evolve)({isPublic:(0,l.always)(t)}),vp)(e),Ap=(e,t)=>(0,l.pipe)((0,l.evolve)({isFavorite:(0,l.always)(t)}),vp)(e);function Np(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Pp=["max","offset","filter"],Rp=(0,l.curry)(((e,t)=>t.nextEntry?(0,l.evolve)({nextEntry:Rp(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){Np(e,t,r[t])}))}return e}({},t,(0,l.pick)(Pp,e)))),Sp=e=>{if(1===e.length&&((0,l.pathEq)([0,"activeness","entity"],Pe.ALL,e)||(0,l.pathEq)([0,"activeness","relation"],Pe.ALL,e)))return!1},wp=(0,l.omit)(["activeness"]),Ip=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=Sp(t),{searchByOv:i}=r;t=(0,l.map)((0,l.pipe)((0,l.when)((0,l.prop)("nextEntry"),(e=>(0,l.pipe)(Rp(e),(0,l.omit)(Pp))(e))),wp,(0,l.omit)(["labels"])))(t);const a={limitCreditsConsumption:!0,activeness_enabled:n,options:i?"searchByOv":void 0},o=`/${e}/_connections${Cr(a)}`,s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)};return{url:o,options:s}},Up=(0,l.map)((e=>{let t=e;for(;t&&t.nextEntry;)t=t.nextEntry;return t})),Cp=(0,l.reject)(l.isNil),Dp=(0,l.unless)((0,l.startsWith)("/"),(0,l.concat)("/")),Lp=e=>zl(Dp(e),{method:"GET",headers:{"Content-Type":"application/json"}}),jp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r=(0,l.pipe)(t,Dp);return zl(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},kp=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?Ll()(i):null,startDate:a,endDate:o},c=(0,l.pipe)(Cp,ne,JSON.stringify);return zl(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(u)})},Fp=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"),Dp,n),o=bm(i(t),i(r)).concat(vm(t,r));return zl(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},Mp=(e,t,r)=>{const{url:n,options:i}=Ip(e,t,r);return zl(n,i).then(Up)},xp=(e,t)=>zl(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),$p=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===fn.IN?a.inRelations=[n]:a.outRelations=[n],zl(`/${e}/_ignoreSuggestedRelationship`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},Vp=e=>{let{servicesPath:t="",environment:r,tenant:n,application:i}=e;return zl(`${t}/recentSearches${Cr({environment:r,tenant:n})}`,{method:"GET",application:i,headers:{"Content-Type":"application/json"}})},Gp=e=>zl("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Wp=e=>{let{environment:t,tenant:r,createdDate:n}=e;return zl(`/recentSearches${Cr({environment:t,tenant:r,createdDate:n})}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};function Bp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Yp(e,t,r[t])}))}return e}function Yp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qp={select:"label,secondaryLabel,name,type,startDate,endDate"},Hp=(0,l.reject)(l.isNil),Qp=(0,l.pipe)(Hp,Ur),Kp=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i}=e;const a=Bp({},qp,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{},{limitCreditsConsumption:!0});return zl(`/${t}/_tree${Qp(a)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Jp=e=>{let{uri:t,graphUri:r}=e;const n=Bp({},qp,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return zl(`/${t}/_parents${Qp(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Xp=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1,limitCreditsConsumption:o,max:s}=e;const l=Bp({},qp,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},o?{limitCreditsConsumption:o}:{},s?{max:s}:{},{filterLastLevel:i,deep:a});return zl(`/${t}/_hops${Qp(l)}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function zp(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 Zp=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},ed="/activities",td=e=>{let{label:t,description:r}=e;return zl(ed,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:Zp()}})};var rd;!function(e){e.userSearch="USER_SEARCH",e.profileView="USER_PROFILE_VIEW"}(rd||(rd={}));const nd=e=>{const t=Cr(e);return zl(ed+t,{method:"GET"})},id=e=>zl(`/activities/_total${Cr(e)}`,{method:"GET"}),ad=e=>{const{entityUri:t}=e,r=zp(e,["entityUri"]);return zl(`/${t}/_activities${Cr(r)}`,{method:"GET"})},od=e=>{const{entityUri:t}=e,r=zp(e,["entityUri"]);return zl(`/${t}/_activities/_total${Cr(r)}`,{method:"GET"})};function sd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ld(e,t,r[t])}))}return e}function ld(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ud=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},cd=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return zl(ud({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},pd=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=ud({url:r,workflowPath:t,tenant:n})),zl(s,{method:i||"GET",body:JSON.stringify(a),headers:sd({"Content-Type":"application/json"},null!=o?o:{})})},dd=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=ud({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,l.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return zl(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)},yd=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=ud({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?sd({},l,{comment:o}):l;return zl(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},fd=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const u=ud({url:`/tasks${s?Cr(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(sd({objectURIs:[i]},(0,l.reject)(E,a)))};return zl(u,sd({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},Td=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i,max:a,offset:o}=e;return zl(ud({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})})},Ed=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i,max:a,offset:o}=e;return zl(ud({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)(sd({max:a,offset:o},i))})},md=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return zl(ud({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},hd=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return zl(ud({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},bd=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return hd({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},Od=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return zl(ud({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},vd=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return hd({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},gd=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return hd({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},_d=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return hd({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},Ad=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a}=e;return zl(ud({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a})})},Nd=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return zl(ud({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},Pd=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(Os);return a&&a[0]&&(r=n.length>0&&a[0].value?Pd(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}}),""),Rd=(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=Pd(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},Sd=/[,\s]*$/,wd=e=>{const t=En().text(yn);if(!e)return t;const r=e.replace(Sd,"");return""===r.toString().trim()?t:r},Id=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},Ud=(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=Id(e,r.referencedEntityTypeURI);if(n)return Rd({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return Rd({attributes:t||{}},r.dataLabelPattern);return""},Cd=e=>{let{uiPath:t,uri:r}=e;return`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},Dd=e=>{let{uiPath:t,tag:r,entityUri:n}=e;return`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},Ld=(0,l.curry)(((e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"")),jd=(0,l.when)((0,l.is)(Object),(0,l.ifElse)((0,l.pipe)((0,l.prop)("value"),(0,l.is)(Object)),Yl,(0,l.prop)("value"))),kd=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),jd),Fd=(e,t,r)=>{const n=kd(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)(Fs(e),jd)))(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")])})(Yr(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>js(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,jd))(r)})(e,r)||Xr(e,r.type);return Ld(t,n)};function Md(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){xd(e,t,r[t])}))}return e}function xd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $d="DTSS/",Vd=(0,l.replace)(new RegExp("^entities/"),""),Gd=e=>$d+e.dataTenant+"/"+e.uri,Wd=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),Bd=e=>!(!e||!e.dataTenant),Yd=(0,l.startsWith)($d),qd=(0,l.pipe)((0,l.ifElse)(Yd,(0,l.pipe)((0,l.split)("/"),(0,l.nth)(1)),(0,l.always)(null))),Hd=(0,l.ifElse)(Bd,Gd,(0,l.prop)("uri")),Qd=e=>e&&e.uri?e.dataTenant?Gd(e):Vd(e.uri):"",Kd=(0,l.curry)(((e,t,r)=>(Yr(t,r.type)||{})[e]||"")),Jd=Kd("label"),Xd=Kd("typeGraphIcon"),zd=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=Yr(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(Os)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:Ud(e,o,i),uri:a.uri}})).filter(l.identity):[]},Zd=(0,l.pipe)(zd,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),ey=(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=ey(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):ey(e.slice(1),r)}})),ty=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,ry=e=>(0,l.propOr)([],"matchRules",e),ny=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?Md({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},iy=(e,t,r)=>t&&r?r.aEntity:e,ay=(0,l.evolve)({attributes:Ll(!0)}),oy=(0,l.pipe)(ay,(0,l.props)(["attributes","startDate","endDate","roles","tags"]),(0,l.all)(E)),sy=e=>(0,l.assoc)("dataTenant",e),ly=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 zl(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),Ur)(d)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},uy=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 zl(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),Ur)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},cy=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return zl("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},py=(e,t,r)=>Promise.all(t.map((async t=>await zl(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})))),dy=async(e,t)=>await py(e,t,"NOT"),yy=async(e,t)=>await py(e,t,"MATCH"),fy=async(e,t)=>await Promise.all(t.map((async t=>await zl(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}}))));function Ty(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ey(e,t,r[t])}))}return e}function Ey(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function my(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 hy=3e4,by=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return zl(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},Oy=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return xy({url:`entities/_connections/_hasNonImported?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}})},vy=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return xy({url:`entities/_connections/_import?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}})},gy=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return zl(`${t}entities/_merge?dataEntityUri=${i}&customerEntityUri=${a}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},_y=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 gy({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},Ay=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{uri:a}=n,[o,s]=(0,l.partition)(Bd,i);return Promise.all([s.length?cy(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return gy({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},Ny=(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=my(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)}),[])),Py=(0,l.pipe)((0,l.find)((0,l.propEq)("index",0)),(0,l.propOr)({},"object"),Ny),Ry=e=>{let{dtssPath:t,customerTenant:r,entity:n}=e;const{uri:i,dataTenant:a}=n;return zl(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:a,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(Py)},Sy=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)},wy=Sy((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return zl(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{uri:a,type:o}])}).then(Py)})),Iy=Sy((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return zl(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),Uy=(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)}},Cy=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return zl(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},Dy=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 Cy(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},Ly=Dy("NOT"),jy=Dy("MATCH"),ky=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{uri:o}=i,[s,u]=(0,l.partition)(Bd,a);return Promise.all([py(o,u,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return Cy(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},Fy=ky("NOT"),My=ky("MATCH");function xy(e){let{requestProvider:t=zl,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}`,Ty({},my(s,["headers"]),{headers:Ty({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const $y=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return xy({url:ep(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},Vy=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return xy({url:Yc(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},Gy=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a,options:o}=e;const{searchByOv:s}=o,{options:u}=Ip(t,r);return xy({url:`entities/_connections/_getConnections${Cr({dataEntityUri:t,options:s?"searchByOv":void 0})}`,options:u,dataTenant:n,customerTenant:i,dtssPath:a}).then((0,l.pipe)(Up,(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)))}))))},Wy=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return xy({url:`${op(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},By=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return zl(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},Yy=e=>{let{dtssPath:t,tenant:r}=e;return zl(`${t}tenants/customerTenants?id=${r}&useCache=true`,{method:"GET",timeout:hy})},qy=e=>{let{dtssPath:t,customerTenant:r}=e;return zl(`${t}subscriptions?useCache=true`,{method:"GET",headers:{CustomerTenant:r},timeout:hy})},Hy=e=>{let{dtssPath:t,tenants:r}=e;return zl(`${t}tenants/dataTenants?id=${r}&useCache=true`,{method:"GET",timeout:hy})},Qy=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return xy({url:op(t),dataTenant:r,customerTenant:n,dtssPath:i})},Ky=()=>zl("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET"});function Jy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Xy(e,t,r[t])}))}return e}function Xy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zy=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=Jy({},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 zl(`${t}/api/${r}/graph/search${Cr({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},Zy=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return zl(`${t}/api/${r}/graph/search/count`,{method:"POST",body:Jy({},n,i),headers:{"Content-Type":"application/json"}})},ef=(e,t)=>`${e}/${t}/comments`,tf=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return zl(`${ef(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},rf=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return zl(`${ef(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},nf=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return zl(ef(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},af=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return zl(`${ef(t,r)}/${n.commentId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},of=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return zl(`${ef(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},sf=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i}=e;return zl(`${ef(t,r)}/${n}/replies/${i}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},lf=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i,data:a}=e;return zl(`${ef(t,r)}/${n}/replies/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},uf=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return zl(`${ef(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},cf=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=Cr({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return zl(`${ef(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function pf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){df(e,t,r[t])}))}return e}function df(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yf=e=>{let{tenant:t,servicesPath:r}=e;return zl(`${r}/users/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})},ff="graphExport",Tf=async(e,t,r,n,i)=>{let a;try{const{data:n={}}=await bf({servicesPath:e,tenant:t,environment:r,namespace:ff,options:{method:"GET",headers:{"Content-Type":"application/json"}}});a=n}catch(e){a={}}const o={body:JSON.stringify(pf({},a,{[n]:i})),headers:{"Content-Type":"application/json"}};let s;try{s=await bf({servicesPath:e,tenant:t,environment:r,namespace:ff,options:pf({method:"PUT"},o)})}catch(e){s=null}return s||(s=await bf({servicesPath:e,tenant:t,environment:r,namespace:ff,options:pf({method:"POST"},o)})),s},Ef=e=>{let{servicesPath:t,key:r}=e;return zl(`${t}/settings${Cr({key:r})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},mf=e=>{let{servicesPath:t}=e;return zl(`${t}/version/collect`,{method:"POST",headers:{"Content-Type":"application/json"}})},hf=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return zl(`${n}/plugins${Cr({tenant:t,user:r})}`,{method:"GET"})},bf=e=>{let{tenant:t,environment:r,servicesPath:n,options:i,namespace:a,projection:o}=e;return zl(`${n}/configService${Cr({tenant:t,environment:r,namespace:a,projection:o})}`,i)},Of=e=>{let{tenant:t,environment:r,servicesPath:n}=e;return bf({tenant:t,environment:r,servicesPath:n,options:{method:"GET"}})},vf=e=>{let{servicesPath:t,stateHash:r}=e;return zl(`${t}/searchLink?key=${r}`,{method:"GET"})},gf=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),zl(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},_f=e=>zl(`/${e}?showObjectsInfo=true`,{method:"GET"}),Af=e=>{let{exportPath:t,tenant:r,options:n}=e;return zl(`${t}/${r}/activities${Cr(n)}`,{method:"POST"})};function Nf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Pf(e,t,r[t])}))}return e}function Pf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Rf=e=>{const{entityUri:t}=e;return zl(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},Sf=e=>{let{entityUri:t,crosswalk:r}=e;return zl(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},wf=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return zl("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[Nf({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),Nf({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},If=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return zl(`/${r}/_${n}${Cr({contributorURI:t})}`,{method:"POST"})},Uf=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return zl(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},Cf=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return zl(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},Df=e=>{let{entityUri:t,crosswalkId:r}=e;return zl(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})};function Lf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jf=e=>{let{entityTypeUri:t}=e;return zl(`/dataQuality/fillRates${Ur({entityType:Ct(t)})}`,{method:"GET"})},kf=e=>{let{attributes:t=[],metrics:r=[]}=e;const n=r.length,i=t.length*n;return i>10?10:i},Ff=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){Lf(e,t,r[t])}))}return e}({},n===Me.ATTRIBUTE_TYPE?{attributes:r}:{},i?{metrics:i}:{}),o=n===Me.ATTRIBUTE_TYPE?Ur({numberOfThreads:kf({attributes:r,metrics:i})||1}):"";return zl(`/entityType/${Ct(t)}/dataQuality/${n}${o}`,{method:"POST",body:JSON.stringify(a)})},Mf=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n,env:i}=e;return zl(`${t}/api/${r}/dataValidationFunctions/entityTypes/${Ct(n)}`,{method:"GET",headers:{env:i}})},xf=e=>{let{mlDqPath:t,tenant:r,entityTypeUri:n,attribute:i,viewMultiplier:a=1,dataLevel:o=Me.ATTRIBUTE_TYPE,metrics:s=[],startDate:l,endDate:u}=e;const c={attribute:i,metrics:s,viewMultiplier:a,startDate:l,endDate:u};return zl(`${t}/${r}/entityType/${Ct(n)}/ml/dataQuality/v1/${o}/timeSeries/`,{method:"POST",body:JSON.stringify(c)})},$f=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return zl(`/${t}${Cr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},Vf=e=>{let{attributeUri:t,value:r}=e;return zl(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},Gf=e=>{let{attributeUri:t,value:r}=e;return zl(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},Wf=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return zl(`/${t}${Cr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},Bf=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=Cr({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=Ll()([[{value:a}]]);return zl(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},Yf=e=>{let{entityUri:t,attributeName:r,value:n}=e;return zl(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},qf=e=>{let{entityUri:t,attributeName:r}=e;return zl(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};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 Qf=e=>{let{entityUri:t}=e;return zl(`/${t}/_historicURIs`,{method:"GET"})},Kf=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 zl(`/${t}/_changesWithTotal${Cr(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}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},Jf=(e,t)=>zl(`/${e}/_previousChange${Cr({timestamp:t})}`,{method:"GET"}),Xf=(e,t)=>zl(`/${e}${Cr({time:t})}`,{method:"GET"});function zf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Zf(e,t,r[t])}))}return e}function Zf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const eT=e=>{let{url:t,method:r,data:n,headers:i,noRequestProcessor:a}=e;return zl(t,{method:r||"GET",body:n,headers:zf({"Content-Type":"application/json"},null!=i?i:{}),noRequestProcessor:a})},tT=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=Cr({options:a.join(","),severity:o.join(",")});return zl(`${t}/validate/${i}/entity/${Qd({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},rT=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return zl(`${t}/validate/${n}/entity${Cr({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},nT=e=>{let{tenant:t,apiPath:r}=e;return zl(`${r}/tenants/${t}/name`,{method:"GET"})},iT=e=>{let{tenant:t,apiPath:r}=e;return zl(`${r}/tenants/${t}/_rdmTenants`,{method:"GET"})},aT=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e;return zl(`${a}/preferences${Cr({name:t,tenant:r,environment:n,user:i})}`,{method:"GET"})},oT=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 zl(`${a}/preferences`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})},sT=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e,o={name:t,tenant:r,environment:n,user:i};return zl(`${a}/preferences`,{method:"DELETE",body:JSON.stringify(o)})},lT=e=>{const{servicesPath:t}=e;return zl(`${t}/getTokenForWorker`,{method:"GET"})};var uT=r(29524);const cT=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=_t(),s={attributes:gl({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=js(r,e,n.uri)[0];return i&&i.value?Rl({entity:e,attributeType:n,uri:i.uri,value:t}):Nl({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},pT=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.filter)((0,l.has)("refEntity")),(0,l.map)(Is),(0,l.filter)(gt),(0,l.map)((t=>e[t])),(0,l.reject)(l.isNil))((null==t?void 0:t.attributes)||{}),dT=(0,l.curry)(((e,t)=>{const r=pT(e=e||{},t=t||{});return r.concat((0,l.chain)(dT(e),r))})),yT=(0,l.curry)(((e,t)=>(0,l.pipe)(ce,(0,l.filter)(e))(t))),fT=yT((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),TT=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),gt)),ET=e=>(0,l.pipe)(fT,TT(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),mT=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(fT,(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})),hT=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),gt),(0,l.omit)(["uri","timestamp"])),bT=(0,l.pipe)(hT,ay),OT=async(e,t,r)=>{if(!e)return null;const n=ET(e);if(n.length>0)for(const r of n)e=mT(r,t[r],e);const i=await cp(bT(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},vT=async(e,t,r)=>{const n=_T(e,t),i={};for(const t of n)i[t]=await OT(e[t],i,r);return i},gT=(0,l.curry)(((e,t)=>{const r=uT.Node(t);return ET(e[t]).forEach((t=>{const n=gT(e,t);r.addEdge(n)})),r})),_T=(e,t)=>(0,l.pipe)((0,l.map)(gT(e)),(0,l.map)(uT.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),AT=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)(hT))})),NT=(e,t)=>[...Pm(e.tags||[],t.tags||[]),...Rm(e.roles||[],t.roles||[]),...Om(e,t),...vm(e,t)],PT=(e,t)=>[...gm(bm((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),Nm((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e),...NT(e,t)],RT=(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 mT(r,n,e)}),e))))}),t)}),AT),ST=(0,l.curry)(((e,t)=>(0,l.when)(gt,(0,l.propOr)(l.__,t,e),t)));function wT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){IT(e,t,r[t])}))}return e}function IT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const UT=e=>{let{parentUri:t,relation:r,entityUri:n}=e;return{type:xe.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},CT=e=>{let{relationUri:t}=e;return{type:xe.DELETE_RELATION,parameters:{relationUri:t}}},DT=e=>{let{parentUri:t,entityUri:r,relationType:n,relationDirection:i}=e;return{type:xe.IGNORE_RELATION,parameters:{parentUri:t,entityUri:r,relationType:n,relationDirection:i}}},LT=e=>{let{oldRelation:t,newRelation:r}=e;return{type:xe.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},jT=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:xe.REPOINT_RELATION,parameters:{entityUri:t,newEntityUri:r,relation:n,isReversed:i}}},kT=(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))),FT=e=>e.type===xe.DELETE_RELATION,MT=e=>e.type===xe.CREATE_RELATION,xT=e=>e.type===xe.REPOINT_RELATION,$T=e=>e.type===xe.UPDATE_RELATION,VT=e=>e.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve()),GT=e=>{let{type:t,parameters:r,dcrProcessor:n}=e;const{enhanceUriWithDCR:i,updateDCRUriFromResponse:a}=n,o=e=>(a(e),e);switch(t){case xe.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:a,attributes:s,startDate:l,endDate:u}=t;return kp({startEntityUri:e,endEntityUri:n,relationType:a,attributes:s,startDate:l,endDate:u,uriPreprocessor:i}).then(o)};case xe.DELETE_RELATION:return()=>{const{relationUri:e}=r;return jp(e,i).then(o)};case xe.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return $p(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(o)};case xe.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return Fp({oldRelation:e,newRelation:t,uriPreprocessor:i}).then(o)};case xe.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:i,isReversed:a}=r,{uri:o}=i,s=[CT({relationUri:o}),UT({parentUri:a?e:t,relation:i,entityUri:a?t:e})];return(0,l.pipe)((0,l.map)(BT(n)),(0,l.map)(GT),VT)(s)}}},WT=e=>t=>()=>e().then(t),BT=e=>t=>wT({dcrProcessor:e},t),YT=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=jr({alwaysCreateDCR:e,dcrUri:t});return{commandExecutor:(0,l.pipe)(l.flatten,(0,l.map)(BT(r)),(0,l.map)(GT),(0,l.map)(WT(r.getDcrUriAwait)),VT,(0,l.otherwise)((e=>({errorMessage:e})))),dcrProcessor:r}},qT=e=>t=>(0,l.map)((t=>wT({},t,{parameters:(0,l.evolve)({parentUri:ST(e),entityUri:ST(e),newEntityUri:ST(e)},t.parameters)})),t),HT=e=>{let{condition:t,updater:r}=e;return e=>t(e)?r(e):e},QT=(e,t)=>{const r=e.filter(MT).find(kT(t));let n=null,i=null,a=null;const o=e.filter(((o,s)=>$T(o)&&kT(t,o)?(s>e.indexOf(r)&&(n=o.parameters.newRelation),!1):!xT(o)||!kT(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(HT({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},KT=(e,t)=>{const r=e.filter(xT).filter(kT(t));let n=null;const i=e.filter(((i,a)=>r.includes(i)?(0,l.last)(r)===i:!$T(i)||!kT(t,i)||(a>e.indexOf((0,l.last)(r))&&(n=i.parameters.newRelation),!1)));return n?i.map(HT({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({relation:(0,l.always)(n)})})(e)})):i},JT=(e,t)=>{const r=e.filter(FT).filter(kT(t));return e.filter((e=>r.includes(e)?(0,l.last)(r)===e:!kT(t,e)))},XT=(e,t)=>{const r=e.filter($T).filter(kT(t));let n=null;const i=e.filter((e=>!r.includes(e)||!$T(e)||(n=n||e.parameters.oldRelation,(0,l.last)(r)===e)));return n?i.map(HT({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({oldRelation:(0,l.always)(n)})})(e)})):i},zT=e=>{const t=e.filter(FT).map((e=>{let{parameters:{relationUri:t}}=e;return t}));return(0,l.uniq)(t).reduce(JT,e)},ZT=e=>{const t=e.filter(MT).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(QT,e)},eE=e=>{const t=e.filter(xT).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(KT,e)},tE=e=>{const t=e.filter($T).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)(XT,e))(t)},rE=e=>(0,l.pipe)(zT,ZT,eE,tE)(e);function nE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){iE(e,t,r[t])}))}return e}function iE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const aE=e=>nE({},(0,l.path)(mE(),e),{startDate:(0,l.path)(vE(),e),endDate:(0,l.path)(gE(),e)}),oE=(e,t)=>(0,l.pipe)((0,l.path)(OE()),ST(t))(e),sE=(e,t,r,n)=>{let{removedUris:i=[],addedConnections:a=[],editedConnections:o=[],ignoredRelationData:s=[]}=t;return[...a.map((e=>{const t=oE(e,r),i=(0,l.path)(hE(),e)===$e.IN,a=e.parentEntityUri||n;return UT({parentUri:i?t:a,relation:aE(e),entityUri:i?a:t})})),...o.map((t=>{const i=oE(t,r),a=(0,l.path)(hE(),t)===$e.IN,o=i!==(0,l.pipe)((0,l.path)(mE()),a?_E:AE)(t),s=RE(e,(0,l.path)(TE(),t)),u=t.parentEntityUri||n,c=ST(r,i);return o?jT({entityUri:a?u:c,newEntityUri:a?c:u,relation:(0,l.path)(mE(),t),isReversed:!1}):LT({oldRelation:(0,l.path)(mE(),s),newRelation:aE(t)})})),...i.map((e=>CT({relationUri:e}))),...s.map((e=>DT({parentUri:n,entityUri:e.entityUri,relationType:e.relationType,relationDirection:e.relationDirection})))]},lE=e=>(e||[]).reduce(((e,t)=>{let{entity:r}=t;const n=r.dataTenant;return nE({},e,{[r.entityUri]:{uri:r.entityUri,label:r.entityLabel,type:r.entityType,dataTenant:n}})}),{}),uE=(0,l.has)("dataTenant"),cE=(0,l.ifElse)(uE,(e=>{let{relationUri:t,dataTenant:r}=e;return`DTSS/${r}/${t}`}),(0,l.prop)("relationUri")),pE=(e,t)=>(0,l.pipe)(_i,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(zs),Va)(e,t),dE=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)}},yE=(e,t,r)=>{const n=Rd(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)},fE="relation",TE=(0,l.always)([fE,"relationUri"]),EE=(0,l.always)([fE,"relationType"]),mE=(0,l.always)([fE,"object"]),hE=(0,l.always)([fE,"direction"]),bE=(0,l.always)([fE,"object","attributes"]),OE=(0,l.always)(["entity","entityUri"]),vE=(0,l.always)([fE,"startDate"]),gE=(0,l.always)([fE,"endDate"]),_E=(0,l.path)(["startObject","objectURI"]),AE=(0,l.path)(["endObject","objectURI"]),NE=(0,l.path)(["startObject","objectTypeURI"]),PE=(0,l.path)(["endObject","objectTypeURI"]),RE=(e,t)=>{for(const r of e){if((0,l.pipe)((0,l.path)(TE()),(0,l.equals)(t))(r))return r;if(r.connections){const e=RE(r.connections,t);if(e)return e}}},SE=(0,l.pipe)(RE,(0,l.path)(mE())),wE=(0,l.allPass)([(0,l.pipe)((0,l.path)(OE()),(0,l.complement)(E)),(0,l.pipe)((0,l.path)(EE()),(0,l.complement)(E))]),IE=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:At()},entity:{},isNew:!0},{relationType:o,direction:s}=a.relation,{inRelations:u,outRelations:c}=DE({content:i?t.contentSecondLevel:t.content,direction:s,relationType:o,mode:r,metadata:n}),p=UE(u,c);return(0,l.pipe)((0,l.evolve)({relation:p?dE(p):l.identity}),(0,l.defaultTo)({}),(0,l.when)((0,l.always)(i),(0,l.assoc)("parentEntityUri",i)))(a)},UE=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:fn.IN}:{type:t[0],direction:fn.OUT}:null},CE=e=>e.uri||e,DE=e=>{let{content:t,direction:r,relationType:n,mode:i,metadata:a}=e;const o={},s=e=>t=>{const a=t&&ki(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===fn.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"],Yr(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],Yr(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(CE,_i(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(fn.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(fn.OUT)),(0,l.map)(u))},t)||{}},LE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}=Si({reversedContextLabels:!0}),a=(0,l.curry)(((e,t,r,n)=>{const[i,a]=Ni(e,n.uri);return n&&(!t||Hr(e,i,t))&&(!r||Hr(e,a,r))})),o=t=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],Yr(e,t.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],Yr(e,t.endObject.objectTypeURI)))(t),s=(e.relationTypes||[]).filter((0,l.both)(as,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)}},jE=(0,l.curry)(((e,t,r,n,i)=>{const a=Hr(n,l.__,t.type),o=e?PE:NE,s=Hr(n,l.__,r.type),u=e?NE:PE;return(0,l.both)((0,l.pipe)(o,a),(0,l.pipe)(u,s))(i)})),kE=(e,t,r)=>{const n=e?PE:NE,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(Hr(t,l.__,r))})),(0,l.reject)((0,l.prop)("abstract")),(0,l.map)((0,l.prop)("uri")))(t.entityTypes||[])};function FE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ME(e,t,r[t])}))}return e}function ME(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xE=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return FE({},t,{[r]:{parents:n,children:i}})},$E=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return FE({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},VE=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=pT(t,i),o=xE({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>VE(n.uri,t,[e],r)),o)},GE=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)(TE(),n),a=t?$E({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(OE(),n),s=gt(o)?[o]:[],u=xE({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>VE(t,r,[i],e)),u)}),n)},WE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return GE(r,e,t,VE(e,t))},BE=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return WE(t,r,n);if(Pt(e)){const t=RE(n,e);return t&&GE([t],null,r)}return r[e]?VE(e,r):void 0},YE=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>YE(e,t))))},qE=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>qE(e,t))))},HE=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=Nt(t),u=WE(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(Pt(c)){if(s=RE(i,c),!s)return null;o.push({type:ge.relationConnection,value:s,valueType:_i(a,(0,l.path)(EE(),s))});continue}if(Pt(u)){const e=n[c];if(!e)return null;o.push({type:ge.tempEntity,value:e,valueType:Yr(a,e.type)});continue}const p=n[u],d=Js(p,c),y=n[c];if(!d||!y)return null;o.push({type:ge.attributeValue,value:d,valueType:dr(a,kt(d.uri,p.type))}),o.push({type:ge.tempEntity,value:y,valueType:Yr(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},qE(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=Pt(s),d=p?SE(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?_i(a,d.type):Yr(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:yr(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:ge.tempEntity,value:T,valueType:Yr(a,T.type)}),o.push({type:ge.attributeValue,value:s,valueType:E}),m=s.value;const l=Is(s);T=l&&gt(l)?n[l]:null}}return o},QE=e=>e.every((e=>{let{type:t}=e;return[ge.attributeValue,ge.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===ge.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null;let KE;!function(e){e.insertAttribute="insertAttribute",e.updateAttribute="updateAttribute",e.deleteAttribute="deleteAttribute"}(KE||(KE={}));const JE={[KE.insertAttribute]:{color:"#599E0E"},[KE.updateAttribute]:{backgroundColor:"rgba(255, 187, 0, 0.12)",color:"#CC7500"},[KE.deleteAttribute]:{backgroundColor:"rgba(255, 50, 0, 0.2)",color:"#CF0E26"}},XE=e=>{switch(e){case"UPDATE_ATTRIBUTE":return KE.updateAttribute;case"UNDO_IGNORE_ATTRIBUTE":case"INSERT_ATTRIBUTE":return KE.insertAttribute;case"IGNORE_ATTRIBUTE":case"DELETE_ATTRIBUTE":return KE.deleteAttribute;default:return""}},zE="/",ZE=(0,l.pipe)((0,l.split)(zE),(0,l.propSatisfies)((0,l.lte)(2),"length")),em=(0,l.pipe)((0,l.split)(zE),(0,l.slice)(0,-2),(0,l.join)(zE)),tm=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.has)(e),(0,l.prop)(e)],[()=>ZE(e),tm(em(e))]])(t))),rm=e=>(0,l.pipe)(l.keys,(0,l.any)((0,l.startsWith)(e+zE))),nm=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=tm(e,t);return(0,l.isNil)(r)?rm(e)(t)?"UPDATE_ATTRIBUTE":"":r},im=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]},am=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(am(e))}))}))),t},om=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)(cm,t),(0,l.propOr)([],"crosswalks",e))),e),sm=(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(sm(e))}))})),r},lm=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=lm(e);r>t&&(t=r)}))})),t+1):t},um=(e,t)=>{if(gt(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},cm=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},pm=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},dm=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},ym=(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)},fm=(0,l.eqBy)(cm),Tm=(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)(As,(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 Em(e){return e&&void 0!==e.uri}function mm(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 hm(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 bm(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(bm(d.value,y.value,r)):"Reference"===g(d)?hm(d,y)?o.push.apply(o,bm(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&&(ue(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(ue(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 Om(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)||Em(r)&&Em(n)&&r.uri===n.uri||i.push({type:"UPDATE_PROFILE_PIC_BY_URL",newValue:{value:t.defaultProfilePicValue}}),i}function vm(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 gm(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=_m(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?Am(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=_m(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 _m=(e,t)=>e.filter((function(e){return 1===(e.attributes||e.attributeURIs||[]).filter((function(e){return e===t})).length})),Am=(e,t,r)=>(0,l.pipe)(Xs,(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 um(t,r)},e=>{let[t]=e;return!Os(t)}]),(0,l.prop)(0),(0,l.always)(null)))(e,r);function Nm(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 Pm(e,t){return mm("UPDATE_TAGS").call(this,e,t)}function Rm(e,t){return mm("UPDATE_ROLES").call(this,e,t)}function Sm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){wm(e,t,r[t])}))}return e}function wm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Im=function(e){var t=function(e,r,n,i){if(e&&r)if(n||(n=null),i=!!i,Array.isArray(e))for(var a=0;a<e.length;a++)r.call(n,a,e[a],e),i&&t(e[a],r,n,i);else if(ue(e))for(var o in e)r.call(n,o,e[o],e),i&&t(e[o],r,n,i)},r=function(e,t,r){return function(n){var i=-1!==n.uri.lastIndexOf("/")?n.uri.substring(0,n.uri.lastIndexOf("/")):"";e[i]||(e[i]=[]),e[i].push(n.type),t[n.uri]=n.type,"IGNORE_ATTRIBUTE"===n.type&&r.push(n.uri)}},n=function(e,t,r){var n=[],i=Object.keys(e).filter((function(t){return-1!==e[t].indexOf("IGNORE_ATTRIBUTE")&&-1!==e[t].indexOf("INSERT_ATTRIBUTE")}));return Object.keys(t).filter((function(e){var t=-1!==e.lastIndexOf("/")?e.substring(0,e.lastIndexOf("/")):null;return-1!==i.indexOf(t)})).forEach((function(e){-1!==r.indexOf(e)&&n.push(e),t[e]="UPDATE_ATTRIBUTE"})),{appearance:t,ignored:n}},i=function(e,t){var r=Array.isArray(t),n=r?[]:{};return r?(e=e||[]).some((function(e){return e.uri}))?n=function(e,t){var r=e.map((function(e){return e.uri})),n=e.map((function(e){var r,n,a=(n=t.filter((function(t){return t.uri===e.uri}))[0]||{},(r=e)&&n&&r.ignored!==n.ignored&&(delete r.ignored,delete n.ignored,r.ov=!0,n.ov=!0),{a:r,b:n});return i(a.a,a.b)})),a=t.filter((function(e){return-1===r.indexOf(e.uri)}));return n.concat(a)}(e,t):(n=n.concat(e),t.forEach((function(t,r){void 0===n[r]?n[r]=t:ue(t)?n[r]=i(e[r],t):-1===e.indexOf(t)&&n.push(t)}))):(ue(e)&&Object.keys(e).forEach((function(t){n[t]=e[t]})),Object.keys(t).forEach((function(r){ue(t[r])&&e[r]?n[r]=i(e[r],t[r]):n[r]=t[r]}))),n},a=function(){let a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var s=JSON.parse(JSON.stringify(a)),l=JSON.parse(JSON.stringify(o)),u=i(a,o),c={},p={},d=[],y=r(p,c,d);e.compareAttributes(u,l).map((function(e){return"IGNORE_ATTRIBUTE"===e.type&&!1===e.newValue.value&&(e.type="UNDO_IGNORE_ATTRIBUTE"),e})).forEach((function(e){y(e)})),e.compareAttributes(u,s).map((function(e){return"DELETE_ATTRIBUTE"===e.type&&(e.type="INSERT_ATTRIBUTE"),"IGNORE_ATTRIBUTE"===e.type&&(e.type=e.newValue.value?"UNDO_IGNORE_ATTRIBUTE":"IGNORE_ATTRIBUTE"),e})).forEach((function(e){y(e)}));var f=n(p,c,d);return t(u,(function(e,t){t&&-1!==this.indexOf(t.uri)&&(t.ignored=!0,delete t.ov,t.hidden=!0)}),f.ignored,!0),{attributes:u,appearance:f.appearance}};const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=(0,l.difference)(t,e),n=(0,l.difference)(e,t),i=n.concat(t),a=(e,t)=>(0,l.pipe)((0,l.map)((t=>[t,e])),l.fromPairs)(t),o=Sm({},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:Sm({},n,{roles:s,tags:u}),roles:i,tags:l}}}};const Um=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?Um(t.value):[]];return e.concat(r)}),[])),Cm=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,Dm=e=>e?[Hd(e)]:[],Lm=e=>{const t=[...Um((null==e?void 0:e.attributes)||[]),...Um((null==e?void 0:e.analyticsAttributes)||[])];return e?[...Dm(e),...t]:[]},jm=(e,t)=>[e,...t.map((t=>Cm(e,t)))],km=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return cE(t)}))},Fm=(e,t)=>{switch(e){case _e.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case _e.ENTITY_ATTRIBUTE:case _e.RELATION_ATTRIBUTE:return(e=>{let{uri:t}=e;return[Ft(t)]})(t);case _e.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case _e.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n,dataTenant:i}}}=e;return[t,Hd({uri:n,dataTenant:i}),r]})(t)}},Mm=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),xm=(0,l.curry)(((e,t)=>{const r=wo(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(xm(e,r.extendsTypeURI)):n})),$m=(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))),Vm=(e,t)=>(0,l.pipe)((0,l.prop)("type"),xm(e),$m(t))(t);function Gm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Wm=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}},Bm=e=>!e.deactivated,Ym=e=>{let{attributeTypeUri:t,uri:r,parentUri:n}=e;return`${t}-${r}-${n}`},qm=e=>Ym(e)+e.message,Hm=(0,l.unless)(l.isNil,(0,l.prop)("message")),Qm=(0,l.unless)(l.isNil,(0,l.prop)("type")),Km=(0,l.curry)(((e,t)=>It(t.parentUri,e))),Jm=(0,l.curry)(((e,t)=>t.parentUri===e)),Xm=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pipe)((0,l.prop)("uri"),It(t.attributeTypeUri)),l.T],[(0,l.both)((0,l.propEq)("type",nt.TYPE_REFERENCE),(0,l.pipe)(lt,(0,l.any)(It(t.attributeTypeUri)))),l.T],[l.T,l.F]])(e))),zm=(0,l.curry)(((e,t)=>t.attributeTypeUri===e)),Zm=(0,l.curry)(((e,t,r)=>e===r.parentUri&&t!==r.attributeTypeUri)),eh=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,l.filter)((0,l.allPass)([lh,Bm,Km(e),Xm(t),(0,l.complement)(Zm(e,t.uri))]))(r)},th=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=(0,l.find)((0,l.allPass)([lh,Bm,Jm(e),zm(t.uri),(0,l.complement)((0,l.prop)("uri")),(0,l.complement)((0,l.propEq)("type",he.missed))]))(r);return n&&n.message||""},rh=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===he.missed))},nh=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([Bm,(0,l.propEq)("type",he.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(TE(),e))]))(t)},ih=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([Bm,(0,l.propEq)("type",he.missedRefEntity),(0,l.propEq)("parentUri",e.uri)]))(t)},ah=function(e){let{uri:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.any)((0,l.allPass)([Bm,Km(t)]))(r)},oh=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([Bm,(0,l.propEq)("type",he.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(["relation","uri"],e))]))(t)},sh=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?HE(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 ge.attributeValue:{const e=a;if(rr(a))return Rd(o,e.dataLabelPattern);if(nr(a)){const t=o,i=Is(t),a=ot(e),s=Yr(n,a);return gt(i)?Rd(r[i],s.dataLabelPattern):t.label}return""}case ge.tempEntity:return Rd(o,a.dataLabelPattern);case ge.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=Yr(n,null==e?void 0:e.entityType);return`${wd(i&&gt(i)?Rd(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||Ai(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){Gm(e,t,r[t])}))}return e}({},e,{label:wd(t)})}))},lh=e=>!e.severity||e.severity===Oe.ERROR,uh=(0,l.curry)(((e,t)=>{let r=t.value;switch(e.type){case nt.TYPE_NESTED:return Object.keys(r).some((t=>{const n=e.attributes.find((0,l.propEq)("name",t));return r[t].some(uh(n))}));case nt.TYPE_REFERENCE:return!!_s(t);case nt.TYPE_BOOLEAN:return!0===r||!1===r||"true"===r||"false"===r;default:return"string"==typeof r&&(r=r.trim()),null!=r&&""!==r}})),ch=(e,t)=>e.every((0,l.complement)(uh(t))),ph=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const n=Do(e,t.type||t.relationType,!0).filter(r);return n.reduce(((r,n)=>{const i=js(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!Os(e.parent))))).forEach((e=>{ch(e.attrValues,n)&&r.push(Wm({type:he.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:En().text("Attribute is required"),source:be.local}))})),r}),[])},dh=(0,l.curry)(((e,t,r)=>js(e,t,r,!1))),yh=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),Yr(e),(0,l.prop)("attributes"),(0,l.defaultTo)([]),(0,l.reject)(er),(0,l.filter)(nr),(0,l.map)((0,l.prop)("uri")),(0,l.chain)(dh(e,t)));return(0,l.pipe)(r,(0,l.reject)(Is),(0,l.map)((e=>{let{uri:r}=e;return Wm({type:he.missedRefEntity,uri:"",attributeTypeUri:kt(r,t.type),parentUri:r,message:En().text("Entity is required"),source:be.local})})))(t)},fh=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,l.has)("refEntity")).filter((0,l.pipe)(Is,gt)).flatMap((n=>{const i=Is(n),a=t[i],o=dr(e,kt(n.uri,r.type));return Th(e,t,o,a)})),Th=(e,t,r,n)=>{const i=lt(r),a=i.map((t=>dr(e,t))).filter((0,l.both)(l.identity,(0,l.propEq)("type",nt.TYPE_REFERENCE))).flatMap(ct).concat(i);return Eh(e,t,n,(e=>a.some(It(e.uri))))},Eh=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity;const i=ph(e,r,n),a=yh(e,r),o=fh(e,t,r);return[...i,...a,...o]},mh=(e,t)=>{const r=(0,l.path)(mE(),t)||{};return ph(e,r)},hh=(e,t,r)=>{t=t||{};const n=(0,l.pipe)((0,l.path)(OE()),(0,l.ifElse)(gt,(e=>t[e]),(0,l.always)(null)))(r),i=mh(e,r),a=(e=>(0,l.path)(OE(),e)?[]:[Wm({type:he.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(EE(),e),parentUri:(0,l.path)(TE(),e),message:En().text("Entity is required"),source:be.local})])(r),o=((e,t,r)=>r?Eh(e,t,r):[])(e,t,n);return[...i,...a,...o]},bh=e=>(0,l.path)(["entity","uri"],e)?[]:[Wm({type:he.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(["relation","type"],e),parentUri:(0,l.path)(["relation","uri"],e),message:En().text("Entity is required"),source:be.local})],Oh=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=ph(e,r),i=bh(t);return[...n,...i]};function vh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gh=(e,t)=>{var r,n;const i=Yr(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||io(e)},_h=e=>(0,l.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),Ah=e=>{const t=r=>(0,l.ifElse)(Array.isArray,(0,l.map)(t),(0,l.pipe)(_h(e),(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(0,l.map)(t))})))(r);return t},Nh=(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)(Us,gt,l.not)]),(e=>{const t=(0,l.pipe)(Us,Ct)(e);return Ah((e=>e.replace(t,t+Et)))(e)})),(0,l.when)((0,l.pipe)(Is,gt),(t=>{const r=Is(t),n=e[r],i=n&&Rh(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){vh(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),Ph=(e,t,r)=>gm(bm((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),Nm((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)(Nh(r,e.type)),(0,l.map)(Ah(Gt))))})(e))).concat(NT(e,t)),Rh=(e,t)=>(0,l.evolve)({attributes:Cl({valueTransformer:(0,l.pipe)(Ls,Nh(t),_h(Gt)),deleteEmptyComplex:!0}),uri:Gt})(e);function Sh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){wh(e,t,r[t])}))}return e}function wh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ih=(0,l.unless)(l.isNil,(e=>e.replace(new RegExp(Tt,"g"),"uri$$$$").replace(new RegExp(Et,"g"),""))),Uh=e=>(0,l.pipe)((0,l.evolve)({objectUri:Ih,objectParentUri:Ih}),(e=>{return Sh({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?he.missed:he.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&&Vt(e.objectUri),uri:e.objectUri,source:be.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),Ch=(e,t)=>(0,l.map)((0,l.pipe)(Uh,(e=>{var r,n,i,a;const{metadata:o}=t,{uri:s,parentUri:u}=e,c=sh(t,s),p=null!=c&&c.length?c.slice(0,-1):sh(t,u),d=((e,t,r)=>{let{uri:n,attributeTypeUri:i}=r,a=i&&dr(e,i);if(!a&&n&&t&&t.length){const e=(0,l.last)(t);e.type===ge.attributeValue&&(a=e.valueType)}return a})(o,c,e);return Sh({},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&&$t(i)){const n=(0,l.last)(a),i=n.valueType;if(nr(i)&&pt(i).includes(o)){const i=Is(n.value),o=i&&gt(i)?t[i]:null;return o?Sh({},e,{parentUri:o.uri,path:a.concat({type:ge.tempEntity,value:o,valueType:Yr(r,o.type),label:""})}):e}}return e}})(t)))(e),Dh=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 Lh,jh=r(33164);function kh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e.PotentialMatches="potentialMatches",e.Random0="random0",e.Random1="random1",e.SpectreYellowCyan="spectreYellowCyan",e.SpectreBlueBrown="spectreBlueBrown",e.Charts="charts",e.Crosswalks="crosswalks"}(Lh||(Lh={}));const Fh={},Mh={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"]}},xh=e=>{if(!Fh[e]){const t=Mh[e]||Mh.random0;Fh[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){kh(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return Fh[e]},$h=(0,l.curry)(((e,t)=>{const r=xh(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]})),Vh=e=>$h(Lh.Charts,e),Gh=()=>xh(Lh.PotentialMatches).colors,Wh=e=>$h(Lh.Random1,e),Bh=e=>(0,jh.getColor)(e)?"#FFFFFF":"#212121";var Yh=r(73116);const qh=Array.from({length:100},((e,t)=>t/100)),Hh=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)},Qh={},Kh=new Yh.Z({hash:Hh,saturation:qh.slice(15,71),lightness:qh.slice(50,90)}),Jh=new Yh.Z({hash:Hh,saturation:qh.slice(46,89),lightness:qh.slice(44,58)}),Xh=(0,l.curry)(((e,t,r)=>{t in Qh||(Qh[t]={});const n=Qh[t];r in n||(n[r]=((e,t)=>{const r=String(Hh(t));return e.hsl(r)})(e,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),zh=Xh(Kh,"crosswalks"),Zh=Xh(Kh,"sources"),eb=Xh(Kh,"contributors"),tb=Xh(Kh,"dataValidationFunctions"),rb=Xh(Jh,"entities");function nb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ib(e,t,r[t])}))}return e}function ib(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ab=(0,l.has)("items"),ob=e=>0===e,sb=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)},lb=e=>e.reduce(((e,t)=>e+t.width),0),ub=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),cb=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),pb=e=>e.reduce(((e,t)=>e+t.height),0),db=e=>(0,l.is)(String,e)&&e.includes("%"),yb=(0,l.has)("spacer"),fb=(e,t)=>Math.max(Math.round(parseFloat(t)/100*e),1),Tb=e=>((null==e?void 0:e.items)||[]).reduce(((e,t)=>e.concat(ab(t)?Tb(t):t)),[]),Eb=(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},mb=e=>({id:e.layout}),hb=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:mb;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=db(r.width)?fb(i,r.width):u}return sb(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return sb(n,t,r)},o=(e,t)=>ab(t.items[0])?p(e,t.items[0]):null,s=(t,r)=>{const o=r.items.map((a=>i(t,r,a,ab(a)?n(a.layout):e(a.view)))),s=Eb(t.width,o),u=r.items.reduce(((r,n,i)=>{const o=s[i],u=ob(i)?t.x:(0,l.last)(r).x+(0,l.propOr)(o,"width",(0,l.last)(r));if(ab(n))return r.concat(p(nb({},t,{x:u,width:o}),n));{const i=e(n.view);return r.push(nb({y:t.y,x:u,height:a(i),width:o},i)),r}}),[]);return{x:t.x,y:t.y,width:lb(u),height:ub(u),items:u}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=ab(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=ob(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(ab(i))return r.concat(p(nb({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(nb({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?sb(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?sb(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:cb(i),height:pb(i),items:i}},c=(t,r)=>{const n=(e,t,r,n)=>ob(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 nb({},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=Eb(e.width,[o,o]),u=nb({},e,{width:s[0]}),c=nb({},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(nb({},e,{y:n(e,t,a,f),height:f,items:(0,l.filter)(l.identity,[p,d])}))}return t}),[]);return nb({},e,{height:pb(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(nb({},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 nb({},t,{height:y,items:(0,l.reject)(f,[s,p,d])})},p=(e,t)=>{const r=nb({},t,{items:(0,l.reject)(yb,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 Tb(f)},bb=(e,t)=>(e||[]).filter((e=>t.some((t=>t.id===e.id)))),Ob=[We.FilteredEntitiesViewFacet,We.ActivitiesViewFacet,We.ProfileStatsFacet,We.FilteredSavedSearchesFacet],vb=(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=Ob.includes(a.component)?8:4;return nb({},i,{height:Math.max(r,o),minHeight:Math.max(n,o)})}));function gb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){_b(e,t,r[t])}))}return e}function _b(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ab={BarChart:Ge.BAR,BarChartGrouped:Ge.BAR,BarChartHorizontal:Ge.BAR,LineChart:Ge.LINE,Map:Ge.MAP,Pie:Ge.PIE},Nb=(e,t)=>Mt(e)?Lt(e,t):e,Pb=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=Ab[r];return gb({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},Rb=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return gb({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"]))},Sb=(e,t,r)=>{const n=(e=>e&&ne(e).map((e=>{const{type:t,value:r}=e;return gb({},e,{value:[rn,nn,Zr.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:on(t),fieldName:r,values:n?ne(n):void 0}})))(e);return t&&Mt(t)||!r?n:(n||[]).concat((i=r,{filter:Zr.EQUALS,fieldName:"type",values:[i]}));var i},wb=["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"],Ib={"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:Nb(n,r),filters:Sb(a,n,r),chartType:Ge.BAR,component:We.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:Nb(n,r),filters:Sb(a,n,r),chartType:Ge.BUBBLE,component:We.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:We.CustomActionViewFacet}},"com.reltio.plugins.dashboard.FacetChartView":e=>{let{id:t,firstDimension:r,useEntityType:n,caption:i,filter:a,count:o,orderType:s,options:l,canRead:u}=e;const c=ne(a).find((e=>"type"===(null==e?void 0:e.attribute))),p=n||(null==c?void 0:c.value);return gb({id:t,count:o,canRead:u,orderType:s,attributeUri:Nb(r,p),filters:Sb(a,r,p),component:We.DashboardFacet,title:i,showOthers:!0},Pb(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:Nb(n,r),filters:Sb(a,n,r),chartType:Ge.MAP,component:We.DashboardFacet,title:i,geoUrl:wb[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 gb({id:t,count:o,canRead:l,attributeUri:Nb(n,r),filters:Sb(a,n,r),component:We.DashboardFacet,title:i,geoUrl:s,chartType:Ge.MAP,projection:"geoMercator"},Pb(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:We.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:Rb(i),component:We.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:Sb(n,null,a),component:We.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:Zr.GTE,fieldName:"matches",values:["1"]}],component:We.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:We.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:Ge.CLOUD,component:We.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:Ge.TREE,component:We.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:We.NotificationInboxFacet,title:n||En().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:We.ActivitiesViewFacet,title:n||En().text("Activity log")}}},Ub=e=>({id:e,height:10}),Cb=(0,l.pipe)((0,l.map)((e=>{const t=Ib[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),Db=e=>{if("0.1"===e.version){const t=Cb(e.views),r=hb(Ub,e.layout,{columns:4});return{id:e.id,margin:0,layout:bb(r,t),views:t}}return e},Lb=e=>(0,l.cond)([[(0,l.propEq)("layout","profile"),(0,l.pipe)((0,l.pick)(["center","right","top"]),l.values,l.flatten,(0,l.map)((0,l.when)((0,l.is)(Object),l.values)),l.flatten)],[(0,l.has)("view"),(0,l.pipe)((0,l.prop)("view"),ne)],[(0,l.prop)("items"),(0,l.pipe)((0,l.prop)("items"),(0,l.map)((e=>Lb(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);function jb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){kb(e,t,r[t])}))}return e}function kb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Fb=jb({},Be,{OldMap:"com.reltio.plugins.entity.EntityMapView",OldTree:"com.reltio.plugins.entity.TreeView"}),Mb=e=>e,xb={[Fb.Attributes]:Mb,[Fb.HierarchyTree]:Mb,[Fb.HierarchyPaths]:Mb,[Fb.RelationsTable]:Mb,[Fb.Relations]:e=>jb({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[Fb.SingleAttribute]:Mb,[Fb.Custom]:Mb,[Fb.AttributeTable]:Mb,[Fb.Map]:Mb,[Fb.OldTree]:e=>jb({},e,{class:Be.HierarchyTree}),[Fb.OldMap]:e=>jb({},e,{class:Be.Map}),[Fb.ImageAttribute]:Mb,[Fb.PotentialMatches]:Mb},$b=(0,l.pipe)((0,l.map)((e=>{const t=xb[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),Vb=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.defaultTo)([]),(0,l.find)((0,l.propEq)("id",t)),(0,l.prop)("class"))(e)===Be.Map?{id:t,height:5,minHeight:5}:{id:t,autosizing:!0})),Gb=(e,t)=>(t||[]).map((t=>jb({},t,Vb(e,t.id)))),Wb=e=>{const t=(0,l.pick)(["id","workflow","maxWidth","sidePanelViews","profileBand","views"],e);if("2.0"===e.version)return jb({},t,{layout:Gb(t.views,e.newLayout)});if("0.1"===e.version){const r=$b(e.views),n=hb(Vb(r),e.layout,{columns:3});return jb({},t,{layout:bb(n,r),views:r})}return e},Bb=(e,t)=>e.class===t||e["react-class"]===t,Yb=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(Bb(t,Be.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 Bb(t,Be.SingleAttribute)&&e.includeUris.push(t.attributeUri),e}),{includeUris:[],excludeUris:null}))(e);return e=>{let{uri:n}=e;return r&&!r.some(It(n))||t.some(It(n))}},qb=(e,t)=>e.filter((e=>t.some((t=>Bb(e,t))))).map((e=>{let{id:t}=e;return t})),Hb=(e,t)=>{let{extensions:r}=e;return(r||[]).find((e=>e.id===t))},Qb=(e,t)=>e.flatMap((e=>{let{extensions:r=[]}=e;return r.filter((e=>{let{point:r}=e;return r===t}))})),Kb=e=>(0,l.pipe)((0,l.map)((e=>Hb(e,"com.reltio.plugins.entity.ProfileBand"))),(0,l.reject)(l.isNil),l.head)(e);function Jb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Xb(e,t,r[t])}))}return e}function Xb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zb=(0,l.curry)(((e,t)=>Lb(t).map((t=>(0,l.pipe)((0,l.map)((e=>Hb(e,t))),(0,l.reject)(l.isNil),l.head)(e))).filter(l.identity))),Zb=(0,l.either)((0,l.propEq)("label","D&B Connector"),(0,l.propEq)("label","D&B Connector")),eO=(0,l.propEq)("class",Be.Custom),tO=e=>{let{extensions:t=[]}=e;return t.filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]))},rO=(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=Gb(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=>Hb(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=zb(e,t.layout);i=((e,t)=>{if(t.side){var r;const n=(0,l.pipe)((0,l.chain)((e=>Hb(e,t.side))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("layout"))(e),[i,a]=(0,l.partition)(Zb,null!==(r=null==n?void 0:n.items)&&void 0!==r?r:[]),o=(0,l.pipe)(zb(e),(0,l.filter)(eO))(Jb({},n,{items:i})),s=[{id:"common",views:zb(e,Jb({},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=Wb(Jb({},t,{views:a,version:"0.1"})),u=(0,l.pipe)(Kb,(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})},nO=(e,t)=>{if("scroll"===t.layout.layout){const r=zb(e,t.layout),n=Db(Jb({},t,{views:r,version:"0.1"}));return{class:qe.Dashboard,id:t.id,views:n.views,layout:n.layout}}return{class:qe.Dashboard,views:t.views,layout:t.layout,id:t.id}},iO=(e,t)=>{const r=zb(e,t.layout)[0];return{class:qe.DQDashboard,id:t.id,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel}},aO=(e,t)=>{const r=zb(e,t.layout)[0];return{class:qe.RelationshipSearch,id:t.id,options:r.options,consoleExportApp:r.consoleExportApp}},oO=(e,t)=>{const r=zb(e,t.layout)[0];return{class:qe.Interactions,id:t.id,sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},sO=(e,t)=>{const r=zb(e,t.layout)[0];return{class:qe.Relationships,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},lO=(e,t)=>{const r=zb(e,t.layout)[0];return{class:qe.Sources,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},uO=(e,t)=>{const r=zb(e,t.layout)[0];return{class:qe.PotentialMatches,id:t.id,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},cO=(e,t)=>{const r=zb(e,t.layout)[0],n=r.potentialMatchesReview||{processType:(e=>{const[t]=Qb(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:qe.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}},pO=(e,t)=>({class:qe.Graph,id:t.id}),dO=(e,t)=>{const r=zb(e,t.layout)[0];return{class:qe.ProfileActivityLog,id:t.id,exportTypes:r.exportTypes,caption:r.caption}},yO=e=>t=>!!(0,l.intersection)(e,t).length,fO=(0,l.cond)([[yO(["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"]),()=>nO],[yO(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>iO],[yO(["com.reltio.plugins.graph.GraphView"]),()=>pO],[yO(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>aO],[yO(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>oO],[yO(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>sO],[yO(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>lO],[yO(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>uO],[yO(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>cO],[yO(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>dO],[l.T,()=>(0,l.always)(void 0)]]),TO=(e,t)=>{const{class:r}=e;if("com.reltio.plugins.entity.ProfileAction"===r)return((e,t)=>{const r=(0,l.pipe)((0,l.chain)(tO),(0,l.map)((t=>rO(e,t))),(0,l.indexBy)((0,l.prop)("entityType")),(0,l.map)((0,l.pick)(["layout","views","sidePanelViews","profileBand","workflow"])))(e);return{class:qe.Profile,id:t.id,entityTypes:r}})(t,e);if("com.reltio.plugins.ui.actions.CustomAction"===r)return{id:e.id,type:He.CustomAction,config:(0,l.omit)(["class","id","point","parent","type"],e)};if("com.reltio.plugins.ui.actions.ConsoleAppAction"===r)return{id:e.id,type:He.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=>Hb(e,"com.reltio.plugins.newDashboard.NewDashboardView")),(0,l.pick)(["id","views","layout"]),(0,l.assoc)("class",qe.Dashboard))(e)}const i=(0,l.pipe)((0,l.map)((e=>Hb(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=rO(e,r),i=(0,l.pipe)((0,l.propOr)([],"entity-types"),(0,l.map)((e=>[e,n])),l.fromPairs)(t);return{class:qe.NestedProfile,id:t.id,entityTypes:i}})(t,e,i);const a=Lb(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 fO(o)(t,i)};function EO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){mO(e,t,r[t])}))}return e}function mO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hO=e=>{let{extensions:t}=e;return(t||[]).filter((e=>"com.reltio.plugins.ui.action"===e.point&&"com.reltio.plugins.ui.first_level_action"===e.type&&!e.parent))},bO="https://reltio-ui-files.s3.amazonaws.com/new-ui/";var OO;!function(e){e[e.DashboardGroup=0]="DashboardGroup",e[e.ProfileGroup=1]="ProfileGroup",e[e.SearchGroup=2]="SearchGroup"}(OO||(OO={}));const vO={[qe.DQDashboard]:`${bO}DqDashboard.svg`,[qe.Dashboard]:`${bO}Dashboard.svg`,[qe.Graph]:`${bO}Graph.svg`,[qe.RelationshipSearch]:`${bO}GraphSearch.svg`,[qe.Interactions]:`${bO}Interactions.svg`,[qe.PotentialMatches]:`${bO}PotentialMatches.svg`,[qe.Profile]:`${bO}Profile.svg`,[qe.NestedProfile]:`${bO}Profile.svg`,[qe.ProfileActivityLog]:`${bO}ActivityLog.svg`,[qe.Relationships]:`${bO}Relationships.svg`,[qe.Sources]:`${bO}Crosswalk.svg`,[qe.Search]:`${bO}Search.svg`,[OO.DashboardGroup]:`${bO}DashboardGroup.svg`,[OO.ProfileGroup]:`${bO}ProfileGroup.svg`,[OO.SearchGroup]:`${bO}SearchGroup.svg`,DEFAULT:`${bO}Default.svg`},gO=e=>vO[null==e?void 0:e.class]||vO.DEFAULT,_O=(0,l.pipe)((0,l.pluck)("screen"),(0,l.filter)((0,l.anyPass)([(0,l.propEq)("class",qe.NestedProfile)])),(0,l.groupBy)((0,l.prop)("class")),(0,l.map)((e=>e.map(((e,t)=>EO({},e,{nestedRoute:`${t+1}`})))))),AO=(e,t)=>{var r;return(null===(r=e[t.class])||void 0===r?void 0:r.find((0,l.propEq)("id",t.id)))||t},NO=e=>"com.reltio.plugins.entity.ProfileFirstAction"===e.class?vO[OO.ProfileGroup]:null,PO=e=>(0,l.cond)([[(0,l.any)((e=>{let{icon:t}=e;return t===vO[qe.Dashboard]||t===vO[qe.DQDashboard]})),(0,l.always)(vO[OO.DashboardGroup])],[(0,l.any)((e=>{let{icon:t}=e;return t===vO[qe.Search]||t===vO[qe.RelationshipSearch]})),(0,l.always)(vO[OO.SearchGroup])],[l.T,()=>null]])(e),RO=e=>(0,l.pipe)((0,l.chain)(hO),(0,l.sortBy)((0,l.propOr)(1/0,"position")))(e).map((t=>{const r=((e,t)=>{const r=(0,l.pipe)((0,l.chain)((t=>((e,t)=>{let{extensions:r}=e;return(r||[]).filter((e=>"com.reltio.plugins.ui.action"===e.point&&e.parent===t))})(t,e.id))),(0,l.sortBy)((0,l.propOr)(1/0,"position")),(0,l.map)((e=>EO({},e,{entityTypes:e["entity-types"],screen:TO(e,t)}))),(0,l.filter)((e=>e.screen)))(t),n=_O(r);return(0,l.map)((e=>{let{label:t,screen:r,canRead:i,entityTypes:a}=e;return{label:t,icon:gO(r),screen:AO(n,r),canRead:i,entityTypes:a}}))(r)})(t,e),n=TO(t,e);return{label:t.label,icon:NO(t)||PO(r)||gO(n),menu:r.length?{type:"side",items:r}:void 0,screen:n,canRead:t.canRead}}));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((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},IO=e=>({id:e,height:10}),UO=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)(wO),(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=Cb(((e,t)=>{const r=Lb(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){SO(e,t,r[t])}))}return e}({id:r},t[0])})),(0,l.uniqBy)((0,l.prop)("id")))(e)})(e,t.layout)),n=hb(IO,t.layout,{columns:4});return{views:r,layout:bb(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))};function CO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const DO=(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))),LO=e=>"com.reltio.plugins.dashboard.DashboardPerspective"===e,jO=e=>(0,l.pipe)((e=>Qb(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){CO(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),kO=(0,l.unless)((e=>!!e&&(e.startsWith("http:")||e.startsWith("https:"))),(0,l.always)(null)),FO=(0,l.pipe)(DO("top-logo"),kO),MO=(0,l.prop)("showLookupCode"),xO=e=>{var t;const r=(e=>(0,l.pipe)((0,l.map)((e=>Hb(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=>Hb(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=>Hb(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=>Hb(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=>Hb(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=>Hb(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=>Hb(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=>Hb(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)(DO("default-perspective"),(0,l.ifElse)(LO,(0,l.always)("dashboard"),(0,l.always)("search")))(e))(e),d=(e=>(0,l.pipe)((0,l.map)((e=>Hb(e,"com.reltio.plugins.ui.AttributesSorting"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("strategy"))(e))(e),y=jO(e),f=(e=>DO("checkUser",e))(e),T=(e=>DO("checkIdle",e))(e),E=(e=>(0,l.pipe)((0,l.map)((e=>Hb(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=>Hb(e,"com.reltio.plugins.ui.LookupCodeVisibility"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}))(e))(e),h=void 0===(b=MO(m))||b;var b;const O=null===(t=Kb(e))||void 0===t?void 0:t.showEntityId,v=(e=>DO("preview",e))(e),g=FO(e),_=(e=>DO("topBackgroundColor",e))(e),A=(e=>(0,l.pipe)((0,l.map)((e=>Hb(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(A).length?void 0:A,attributePresentations:u,attributesSorting:d,workflow:c,defaultRoute:p,customScripts:y,checkUser:f,checkIdle:T,showSwitchToClassic:E,showEntityId:O,preview:v,logo:g,headerColor:_}},$O=e=>({layout:RO(e),pivoting:UO(e),properties:xO(e)});var VO=r(58697),GO=r.n(VO);function WO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){BO(e,t,r[t])}))}return e}function BO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const YO=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}_${GO()()}`;return n[e.id].push(t),i=!0,WO({},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]++,WO({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}};function qO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){HO(e,t,r[t])}))}return e}function HO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let QO={};const KO=(e,t,r)=>{const n=`\n importScripts("${e}");\n importScripts("${r.action.files.join('","')}");\n postMessage({action:'loaded'});`;let i;const a=X(`${r.id}: ${r.action.files.join('","')}`);if(E(QO[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))}QO=qO({},QO,{[a]:qO({},QO[a]||{},{worker:i})})}else i=QO[a].worker,QO[a].innerText&&t({task:{action:Xe.SET_HTML,params:{html:QO[a].innerText}},worker:i,config:r}),i.removeEventListener("message",QO[a].onWorkerMessage);return i&&(QO[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||(QO[a].innerText=n.params.html)}},i.addEventListener("message",QO[a].onWorkerMessage)),i},JO=(0,l.curry)(((e,t)=>!e||!e.availableEntityTypes||!t||e.availableEntityTypes.includes(t))),XO=(0,l.flip)(JO),zO=(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=En().number(t));return t})),ZO=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?En().number(e,"0,0.0a").toUpperCase():En().number(e,"0,0"):""},ev=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last));let tv=!0;const rv=e=>tv=e,nv=(e,t)=>e!==t&&t?tv&&e?`${t} (${e})`:t:e,iv=(e,t,r)=>(0,l.path)([t,r,"displayName"],e),av=(e,t,r)=>{const n=iv(e,t,r);return nv(r,n)},ov=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),sv=(0,l.complement)(ov),lv=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),uv=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)},cv=(0,l.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter(sv(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),pv=(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 nt.TYPE_NUMBER:case nt.TYPE_FLOAT:case nt.TYPE_DOUBLE:case nt.TYPE_LONG:case nt.TYPE_INT:case nt.TYPE_COUNT:return t&&zO(o,t);case nt.TYPE_BOOLEAN:case nt.TYPE_BOOLEAN_RADIO:case nt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t=t,(0,l.isNil)(t)?t:le(t)?En().text("Yes"):En().text("No");case nt.TYPE_DATE:return(0,l.is)(Number,t)&&(t=A(Number(t)).getTime()),(t=t)&&(Qu(t)?Ku(t):En().date(t,s));case nt.TYPE_ACTIVENESS_DATE:case nt.TYPE_LOCAL_DATE:return(t=t)&&(Qu(t)?Ku(t):En().date(t,s));case nt.TYPE_TIMESTAMP:return(t=t)&&(Qu(t)?Ku(t):En().date(isNaN(t)?t:Number(t),u));case nt.TYPE_FILE:return(0,l.propOr)(null,"filename",t);case nt.TYPE_SELECT:{const e=n.options.find((0,l.propEq)("value",t));return(0,l.propOr)(null,"label",e)}case nt.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)?nv((0,l.propOr)(null,"lookupCode",t),(0,l.propOr)(null,"value",t)):t}})),dv={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 yv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fv=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){yv(e,t,r[t])}))}return e}({},i,{signal:r.signal})).finally((()=>{clearTimeout(a)}))}return e(t,i)},Tv=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()}},Ev=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})))),mv=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}=t,a=e.onRequest.reduce(((e,t)=>(r,n)=>t({url:r,options:n,abort:i,next:e})),t.next);a(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)(fv,(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),Tv,Ev);return{request:(e,n)=>{const i=s(fetch),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))},abort:i})})):a(e,n)},addRequestInterceptor:n,addResponseInterceptor:i,removeRequestInterceptor:a,removeResponseInterceptor:o}},hv="__metadata",bv=(e=>{const t=[hv,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),Ov=(0,l.set)(bv),vv=(0,l.view)(bv),gv=Ov(pn.NEW),_v=Ov(pn.REMOVED),Av=Ov(pn.EDITED),Nv=Ov(pn.IGNORED),Pv=(0,l.pipe)(vv,(0,l.equals)(pn.REMOVED)),Rv=(0,l.pipe)(vv,(0,l.equals)(pn.NEW)),Sv=(0,l.pipe)(vv,(0,l.equals)(pn.EDITED)),wv=(0,l.pipe)(vv,(0,l.complement)(l.isNil)),Iv=(0,l.pipe)(vv,(0,l.equals)(pn.IGNORED)),Uv=(0,l.omit)([hv]),Cv=(e,t)=>e===hv?void 0:t;function Dv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Lv=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=Lv(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},jv=(e,t)=>Lv((0,l.propEq)("nodeId",t),e),kv=(e,t)=>Lv((0,l.pathEq)(["entity","uri"],t),e),Fv=(e,t)=>{const r=jv(e,t);return r.length>1?r[r.length-2]:null},Mv=(e,t)=>{const r=jv(e,t);return r.length>0?r[r.length-1]:null},xv=(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=>xv(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},$v=()=>{},Vv=(e,t)=>{let{parent:r,nodeProcessing:n=$v}=t;n(e,r),e.children&&e.children.forEach((t=>Vv(t,{parent:e,nodeProcessing:n})))},Gv=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case Ce.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 Ce.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 Ce.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){Dv(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})}}},Wv=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&&Vv(r,{nodeProcessing:r=>{const n=(0,l.path)(["editingConnections",(0,l.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===Ce.addingChild||r.editingMode===Ce.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=Gv({node:r,connection:n,isReversed:i}),s=UT({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===Ce.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=Gv({node:r,isReversed:i,connection:n}),l=s?jT({entityUri:o,newEntityUri:s,relation:a,isReversed:i}):LT({oldRelation:e,newRelation:a});t.push(l)}}})})),t},Bv=(e,t)=>{if((0,l.path)(["entity","uri"],e)===t)return!0;if(e&&e.children)for(const r of e.children){const e=Bv(r,t);if(e)return e}return!1},Yv=(0,l.curry)(((e,t)=>{const r=(0,l.map)(Yv(e));return(0,l.evolve)({entity:t=>t.uri===e.uri?e:t,children:r},t)})),qv=(e,t)=>{const r=(0,l.pipe)(Object.entries,(0,l.filter)((t=>{let[,r]=t;return r.root&&((e,t)=>Bv(t,e.uri))(e,r.root)}))),n=(0,l.map)((t=>{let[r,n]=t;return{id:r,root:Yv(e,n.root)}}));return(0,l.pipe)(r,n)(t)},Hv={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},Qv={asc:"asc",desc:"desc"},Kv=Hv.entityLabel,Jv=Qv.asc,Xv=(0,l.always)(0),zv=e=>{let{sortField:t=Kv,sortOrder:r=Jv,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case Hv.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,l.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return ON.strings.sort(t,a,o)})(n,r);case Hv.entityLabel:return(e=>(t,r)=>{const n=(0,l.path)(["entity","label"]),i=n(t),a=n(r);return ON.strings.sort(e,i,a)})(r);default:return Xv}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},Zv=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values(Qv)),l.identity,(0,l.always)(Jv))),eg=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(Hv)),l.identity,(0,l.always)(Kv)));var tg=r(91104);let rg;const ng=(e,t)=>(rg||(rg=tg.createClient({key:t})),new Promise((t=>{rg.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)}))}))),ig=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,l.is)(Object,t)&&(t=""),t},ag=(e,t)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(Os).flatMap((e=>{let r;return e.type==t&&(r=[ig(e)]),(0,l.is)(Object,e.value)&&(r=(r||[]).concat(ag(e.value,t))),r})),og=e=>e&&e.length>0,sg=(e,t)=>[].concat(e&&e.attributes?ag(e.attributes,t):[]).filter(l.identity);function lg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ug=(e,t,r,n,i,a)=>{if(e&&e.type){const t=Yr(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){lg(e,t,r[t])}))}return e}({},e,{attributes:{[i]:[n]}}));const a=(t.geoLocationAttributes||[]).map((t=>{return r=sg(e,t.latitude),n=sg(e,t.longitude),og(r)&&og(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(og(t)&&t[0].value&&og(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?ng(n.label,a).catch((()=>null)):Promise.resolve(null)},cg=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=Yr(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 ug(a,o,e,s,u,r).then((e=>!e&&a.label&&""!==a.label?ng(a.label,r).catch((()=>null)):e)).then((e=>ne(e).filter(l.identity).map((e=>({id:e.id||n,label:i,entity:a,point:e}))))).catch((()=>null))}))).then((e=>e.flat(1/0).filter(l.identity)))},pg=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=Yr(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(dr(e,r.latitude,t.type)&&dr(e,r.longitude,t.type)){const e=sg(t,r.latitude),n=sg(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))},dg=(e,t,r)=>Promise.all([pg(e,t),cg(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 yg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){fg(e,t,r[t])}))}return e}function fg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Tg=(e,t)=>t.values.map(bo(e,t.entityTypeUri)),Eg=(e,t,r)=>ll(t.fieldName,r)||dr(e,Lt(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),mg=(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?nv(e,t):e}),r)},hg=(0,l.path)(["attrType","label"]),bg=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>yg({},e,{[t]:!0})),{});e[r]=e[r]?yg({},e[r],n):n}return e}),{}),Og=(0,l.pipe)((0,l.prop)("values"),E),vg=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",wn.type.name)),gg=e=>e.type===Ng.NUMERIC_RANGE_FACET,_g=e=>e.type===Ng.DATE_RANGE_FACET,Ag=(0,l.either)(gg,_g),Ng={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},Pg=e=>{switch(null==e?void 0:e.name){case wn.type.name:return Ng.ENTITY_TYPE_FACET;case wn.createdBy.name:case wn.updatedBy.name:case wn.sourceSystems.name:case wn.tags.name:case wn.roles.name:case wn.matchRules.name:case wn.MLRecommendedMatch.name:return Ng.WITH_DROPDOWN_CHECKBOXES_FACET;case wn.createdTime.name:case wn.updatedTime.name:case wn.startDate.name:case wn.endDate.name:return Ng.DATE_RANGE_FACET;case wn.matches.name:case wn.matchScore.name:return Ng.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return Ng.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return Ng.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return Ng.DATE_RANGE_FACET;default:return Ng.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},Rg=(0,l.pipe)(Eg,Pg),Sg=(0,l.pipe)((0,l.path)(["attrType","type"]),gr),wg=(0,l.cond)([[gg,(0,l.always)(Zr.IN_RANGE)],[_g,(0,l.always)(Zr.WITHIN)],[(0,l.allPass)([Sg,e=>e.values.length>=2]),(0,l.always)(Zr.EXISTS)],[l.T,(0,l.always)(Zr.EQUALS)]]),Ig=(0,l.cond)([[_g,(0,l.prop)("values")],[gg,(0,l.prop)("values")],[Sg,e=>1===e.values.length?e.values.map(le):[]],[(0,l.pipe)((0,l.path)(["values",0]),Array.isArray),(0,l.prop)("values")],[l.T,e=>[e.values]]]);function Ug(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cg=(0,l.pipe)((0,l.path)(["attrType","type"]),Er),Dg=(0,l.pipe)((0,l.path)(["attrType","type"]),br),Lg=(0,l.pipe)((0,l.prop)("attrType"),cl),jg=(0,l.pipe)((0,l.prop)("attrType"),ul),kg=e=>t=>t.values.map((t=>Yr(e,t).label)).join(" , "),Fg=(0,l.when)((0,l.propSatisfies)((0,l.gt)(l.__,1),"length"),(0,l.join)(" – ")),Mg=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(En().number),Fg)),(0,l.join)(","))(e.values);return`${hg(e)}: ${t}`},xg=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(w),Fg)),(0,l.join)(","))(e.values);return`${hg(e)}: ${t}`},$g=e=>t=>`${hg(t)}: ${Tg(e,t).join(", ")}`,Vg=e=>t=>{const r=mg(e,t);return`${hg(t)}: ${r.join(", ")}`},Gg=(0,l.curry)(((e,t,r)=>(0,l.map)((0,l.cond)([[jg,kg(e)],[Dg,Mg],[Cg,xg],[Lg,$g(e)],[l.T,Vg(t)]]),r))),Wg=(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){Ug(e,t,r[t])}))}return e}({},t,{attrType:Eg(e,t,n)}))),Gg(e,r))(t),Bg=new RegExp(`^${En().text("Search")}`),Yg=(e,t,r,n)=>{let{uiState:i}=t;const{facets:a,keyword:o,advanced:s,readableQuery:u}=i;return(0,l.isEmpty)(s)?[...Wg(e,a,r,n),...o?[o.value]:[]]:[(0,l.replace)(Bg,"",u)]},qg=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values)(un),Hg=e=>(e=>qg.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]=Xu(t);return e.replace(r,i).replace(n,a)}),e))(e),Qg=(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}`})),Kg={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},Jg=e=>[Kg.geoPolygon,Kg.onMapMove].includes(e),Xg=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},zg=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},Zg=(e,t)=>Jg(e)?t.map(Xg):[zg(t)],e_=e=>Jg(e)?En().text("Geo Polygon"):En().text("Geo Location"),t_=e=>{switch(e){case Kg.geoLocation:return"geoLocation";case Kg.geoPolygon:case Kg.onMapMove:return"geoPolygon"}},r_={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},n_=e=>En().text(e),i_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[Zr.EQUALS]:"=",[Zr.NOT_EQUALS]:"≠",[Zr.STARTS_WITH]:"*",[Zr.MISSING_VALUE]:En().text("missing value"),[Zr.HAS_ALL]:En().text("has all"),[Zr.IN_RANGE]:En().text("in range"),[Zr.FULL_TEXT]:En().text("full text"),[Zr.EXISTS]:En().text("exists"),[Zr.COUNT_EQUALS]:`${En().text("count")} =`,[Zr.COUNT_NOT_EQUALS]:`${En().text("count")} ≠`,[Zr.COUNT_LT]:`${En().text("count")} <`,[Zr.COUNT_LTE]:`${En().text("count")} <=`,[Zr.COUNT_GT]:`${En().text("count")} >`,[Zr.COUNT_RANGE]:En().text("count range"),[Zr.LT]:"<",[Zr.LTE]:"<=",[Zr.GT]:">",[Zr.GTE]:">=",[Zr.IN_FILE]:En().text("in file"),[Zr.NOT_IN_FILE]:En().text("not in file"),[Zr.CONTAINS]:"~",[en.LIST_EQUALS]:"=",[en.NOT_LIST_EQUALS]:"≠",[en.LIST_EQUALS_CASE_SENSITIVE]:"=",[en.NOT_LIST_EQUALS_CASE_SENSITIVE]:"≠"}[e]||En().text(e.toLowerCase())},a_=e=>({type:r_.operator,text:e}),o_=e=>({type:r_.operator,text:n_(e)}),s_=e=>({type:r_.attributeLabel,text:e}),l_=e=>({type:r_.specialAttributeLabel,text:e}),u_=e=>({type:r_.attributeFilter,text:i_(e)}),c_=e=>({type:r_.attributeValue,text:e}),p_=e=>({type:r_.entityTypeLabel,text:e}),d_=()=>({type:r_.space,text:" "}),y_=()=>({type:r_.bracket,text:"("}),f_=()=>({type:r_.bracket,text:")"}),T_=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),E_=(0,l.curry)(((e,t)=>t.map(T_(e)))),m_=(0,l.curry)(((e,t,r)=>[e,...r,t])),h_=m_(y_(),f_()),b_=m_(d_(),d_()),O_=(0,l.curry)(((e,t)=>[e,...t])),v_=e=>O_(p_(e)),g_=e=>O_(p_(`${e}: `)),__=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=Su(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=Pu(s),a=Ru(s);!r&&t&&n&&(i.push(y_()),r=!0),i.push(o),r&&a&&(i.push(f_()),r=!1);const l=e?o_(s):a_(s);i.push(...b_([l]))}else i.push(o),r&&(i.push(f_()),r=!1)}return i}},A_=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),N_=(0,l.pipe)(__({localizable:!1}),A_),P_=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},R_=e=>{let{data:t,values:r,filter:n}=e;return t&&Oc({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},S_=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(R_)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),w_=(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)&&lr(e.data.attrType)})(e)&&[Zr.HAS_ALL,Zr.EQUALS,Zr.NOT_EQUALS].includes(e.filter))),(0,l.map)((e=>({type:sr((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})))),uv),I_=(e,t)=>(0,l.pipe)(w_,cv(t))(e),U_=(0,l.pathEq)(["data","fieldName"],wn.type.name),C_=(0,l.path)(["data","entityTypeUri"]),D_=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),L_=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(ls(e)),attributes:(0,l.filter)((0,l.pipe)(C_,(0,l.anyPass)([l.isNil,ls(e),r=>{const n=(t.entityTypes||[]).filter(ls(e));return(n.length>1?Jr(e,n):null)===r&&!!Yr(e,r)}])))})(t))))),j_=e=>(0,l.pipe)((0,l.prop)("filter"),yu,(0,l.equals)(e)),k_=(0,l.curry)(((e,t,r,n,i,a)=>{const o=ll(n.fieldName)||n.attrType,s=Yu(o,i),u=pv({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>lr(s),()=>(0,l.is)(Object,a)&&a.lookupCode?nv(a.lookupCode,a.value):av(r,sr(o),a)],[()=>cl(s),()=>bo(e,n.entityTypeUri,a)],[()=>pl(s),()=>Vo(e,a)],[()=>ml(s),()=>Bo(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>br(c)||gr(c)),Vu),c_)()})),F_=(e,t,r,n)=>{const i=k_(e,t,r,n.data,n.filter);return(0,l.cond)([[j_(0),(0,l.always)([])],[(0,l.both)(j_(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[d_(),i(r),{type:r_.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[d_(),...(0,l.pipe)(l.flatten,(0,l.map)(i),E_({type:r_.punctuationMark,text:", "}))(t)]}]])(n)},M_=(e,t)=>{const r=!!ll(e.data.fieldName);return(0,l.pipe)(P_,r?l_:s_)(e,t)},x_=(e,t,r,n,i)=>[M_(n,i),d_(),u_(n.filter),...F_(e,t,r,n)],$_=(0,l.addIndex)(l.map),V_=(0,l.propEq)("length",1),G_=(0,l.propSatisfies)((0,l.lt)(1),"length"),W_=(0,l.complement)(l.isEmpty),B_=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)(Uu,(0,l.filter)(R_),Cu,(0,l.map)((n=>({operand:x_(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,__()))(n)},Y_=(0,l.pipe)(B_,l.flatten),q_=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>Jd(e,{type:t}))).join(", ");return r?t(r):l.identity},u=B_(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(v_),(0,l.pipe)(s(g_),(0,l.unless)((()=>V_(u)||i),h_)))(u)},H_=(e,t,r,n)=>(0,l.pipe)(Uu,(0,l.filter)(S_),Cu,$_(((n,i,a)=>({operand:q_(e,t,r,n,V_(a)),operator:n.operator}))),__(),l.flatten)(n),Q_=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),__(),l.flatten),K_=e=>{let{searchType:t,values:[r]}=e;return Zg(t,r).join(", ")},J_=(e,t,r,n,i,a)=>{const o=(e=>e?[l_(e.isRawFilter?En().text("Raw filter"):En().text("Search")),...b_([u_(Zr.EQUALS)]),c_(`"${e.value}"`)]:[])(i),s=(e=>e?[l_(e_(e.searchType)),d_(),c_(K_(e))]:[])(a),u=(0,l.pipe)(H_,(0,l.when)((e=>G_(e)&&(W_(o)||W_(s))),h_))(e,t,r,n);return Q_([o,s,u])},X_=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),z_=(0,l.pipe)(J_,X_),Z_=(0,l.has)("attributes"),eA=Array.isArray,tA=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),rA=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=nA(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)(tA(a))),h_),(0,l.concat)(b_([a_(o)]))))(s)},nA=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return Z_(n)?rA(e,t,r,n,i):eA(n)?n.reduce(((n,a)=>n.concat(nA(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(b_([a_(n.operator)])))(x_(e,t,r,n,i))},iA=(e,t,r,n,i)=>(0,l.pipe)(nA,l.flatten)(e,t,r,n,i);function aA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){oA(e,t,r[t])}))}return e}function oA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sA=(0,l.complement)(U_),lA=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(U_),(0,l.map)((0,l.prop)("values")),l.flatten,l.uniq)(e),r=(0,l.pipe)((0,l.map)(C_),(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}},uA=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=lA(t);return(r||n)&&wu(t)},cA=(0,l.ifElse)((0,l.all)((0,l.has)("entityTypes")),l.identity,(0,l.pipe)((e=>{const t=[],r=e.filter((0,l.complement)(uA)),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(U_).some((0,l.propEq)("filter",Zr.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}=lA(r);if(uA(e))t.push(aA({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter(sA)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(U_,(0,l.pipe)((0,l.prop)("values"),l.flatten),(0,l.pipe)(C_,(e=>[e]),(0,l.reject)(l.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(sA),entityTypes:n,operator:i?a:e.operator,id:GO()()}}));t.push(...n)}var a;return t})(t))),[]))),pA={[Zr.EQUALS]:Zr.ON,[Zr.IN_RANGE]:Zr.WITHIN,[Zr.GTE]:Zr.AFTER,[Zr.GT]:Zr.AFTER,[Zr.LTE]:Zr.BEFORE,[Zr.LT]:Zr.BEFORE},dA=(0,l.curry)((e=>pA[e]||e)),yA=(0,l.curry)(((e,t)=>{switch(e){case Zr.LT:return[f()(t[0]).subtract(1,"day").valueOf()];case Zr.GT:return[f()(t[0]).add(1,"day").valueOf()];default:return t}})),fA=(0,l.pipe)((0,l.path)(["data","attrType","type"]),Er),TA=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>aA({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return fA(e)?(0,l.evolve)({filter:dA,values:yA(t)},e):e}))})))})),EA=(0,l.evolve)({values:(0,l.when)((0,l.pipe)((0,l.prop)(0),Hu),(0,l.map)(Xu))}),mA=(0,l.map)((0,l.cond)([[fA,EA],[l.T,l.identity]])),hA=(0,l.curryN)(3,((e,t,r,n,i)=>(0,l.pipe)((0,l.defaultTo)([]),cA,L_(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")),mA)})),TA,(0,l.reject)(D_))(r)));function bA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){OA(e,t,r[t])}))}return e}function OA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vA=(e,t)=>({data:{uri:Mt(e.fieldName)?Lt(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||wg(e),id:GO()(),values:Ig(e)}),gA=(0,l.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=ll(a,t,r)||dr(e,i);if(!s)return null;if(zt(s))return bA({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=Jd(e,{type:o}),i=(pr(e,Lt(a,o),o)||[]).map((0,l.pick)(["label","name"])).slice(0,-1);return bA({},n,{attrType:s,title:t,pathToTitle:Array.isArray(i)?[r,...(0,l.chain)((0,l.prop)("label"),i),t]:[r,t]})}})),_A=(0,l.curry)(((e,t,r,n)=>hA(gA,e,n,t,r)));function AA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){NA(e,t,r[t])}))}return e}function NA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const PA=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},RA=e=>"rdmLookups.not.resolved"===e?wn.notResolved.name:e,SA=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===an?Zr.IN_RANGE:on(a),u=RA(n),c=ll(u)||dr(e,i),p=(0,l.cond)([[()=>mu(s),(0,l.map)((0,l.when)((0,l.both)((0,l.has)("link"),(0,l.complement)((0,l.has)("filename"))),(e=>AA({},e,{filename:ev(e)}))))],[()=>gr(null==c?void 0:c.type),(0,l.map)(le)],[e=>Tu(s)&&!Array.isArray(e[0])&&!Er(null==c?void 0:c.type),ie],[l.T,l.identity]])(o);return{id:GO()(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===an?"and not":"and",filter:s,values:p}})),wA=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(SA(e,Jr(e,i)));return[{id:GO()(),operator:"or",attributes:a,entityTypes:i}]})),IA=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),UA=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([IA("from"),IA("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,()=>[]]]),CA=(e,t)=>{const r=(0,l.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return AA({},r,{values:UA(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?nl(e.fieldName,n):e.fieldName})},DA=(e,t)=>{if((0,l.has)("children")(e)){const r=CA(e,t);return e.children.reduce(((e,n)=>(e.push(DA(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return CA(e,t)},LA=(0,l.cond)([[(0,l.has)("searchParameters"),e=>{const t=[];return(0,l.has)("values",e)&&t.push(CA(e)),(0,l.propOr)([],"searchParameters",e).forEach((r=>t.push(AA({fieldName:e.fieldName},CA(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(DA,l.flatten)],[l.T,CA]]),jA=(0,l.pipe)((0,l.map)(LA),l.flatten),kA=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},FA=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=wA(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:jA(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>AA({},t,{type:Rg(e,t)}))).map((e=>AA({},e,{values:Ag(e)?kA(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 vA(r,t)})),operator:"or",id:GO()(),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=>({[RA(t)]:e[t]}))),l.mergeAll)(e)}(o),p=[AA({},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 _A(e,t,r,p)},MA=(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)(Og),(0,l.partition)(vg))(t),i=n.map((t=>bA({},t,{type:Rg(e,t)}))).map((e=>vA(e))),a=r.values||[];return[{attributes:i,operator:"or",id:GO()(),entityTypes:a}]})(e,a);return _A(e,t,r,o)})(e,t,r,n):FA(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},xA=e=>"2.0"===e.version?e.keyword:PA(e),$A=e=>(0,l.pathEq)(["object","uri"],e),VA=(e,t)=>(0,l.pipe)((0,l.find)($A(e)),(0,l.prop)("object"))(t),GA=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"),$A(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=VA(r.match,t)||n[r.match];return i?{label:wd((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return ho(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)},WA=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,l.pick)(["uri","type","label"],r),e}),{}),BA=(0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)]),YA=(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:wd((0,l.prop)("label",o)),matchRules:i.concat(a).map((function(t){return ho(e,o.type,t)||{label:t,uri:t}}))}})))(t),qA=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)},HA=(0,l.path)(["object","uri"]),QA=e=>{let t=[];return{addChild:e=>{t=(0,l.append)(e,t)},getValue:()=>e,getChildren:()=>t,removeChild:e=>{t=(0,l.without)([e],t)}}},KA=e=>e.getValue(),JA=(e,t)=>{let r=null;if(t(e.getValue()))return e;const n=e.getChildren();for(let e=0;e<n.length&&(r=JA(n[e],t),!r);e++);return r},XA=(e,t)=>{const r=[],n=(0,l.pipe)(KA,t),i=(0,l.pipe)(l.map,l.flatten),a=e.getChildren();a.some(n)&&r.push(e);const o=i((0,l.partialRight)(XA,[t]),a);return r.push.apply(r,o),r};function zA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ZA(e,t,r[t])}))}return e}function ZA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const eN=(e,t)=>!!e[t],tN=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},rN=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||[]])},nN=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return zA({},t,{[r.uri]:zA({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:rN(null==o?void 0:o.parents,n),children:rN(null==o?void 0:o.children,i),values:rN(null==o?void 0:o.values,a,(0,l.prop)("uri"))})})},iN=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=Yr(r,t)||_i(r,t),i=(0,l.either)((0,l.both)((0,l.prop)("dependentLookupAttributes"),(0,l.prop)("dependentLookupCode")),(0,l.prop)("children"));return Xo(r,n,i).flatMap(Zo).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>dr(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=nN({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>nN({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},aN=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!gt(e.uri)&&St(e.type)&&St(t)&&!t.startsWith(e.type))(n,t))return e;const i=js(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(Os),(0,l.map)(tN))(i);return nN({structure:e,attrType:e[t].attrType,values:a})}),t)},oN=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 eN(e,r)}));return r||n?t.filter(Os).reduce(((e,t)=>oN({structure:e,attributeValue:t})),e):e}),t);{const e=r;return eN(t,e.type)?nN({structure:t,attrType:t[e.type].attrType,values:[tN(e)]}):t}},sN=e=>{let{structure:t,uri:r}=e;return(0,l.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?zA({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},lN=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=js(i,n,r)||[];return a.length?nN({structure:t,attrType:t[r].attrType,values:a.filter(Os).map(tN)}):t},uN=(e,t,r)=>{const n=Nt(e),i=Nt(t);return n===i?((e,t)=>{const r=Vt(t),n=Vt(e);return It(n,r)||((e,t)=>xt(e)&&!xt(t)&&It(t,e))(n,r)})(e,t):!(!r||!$t(t))&&YE(r,i).includes(n)},cN=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},pN=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?WE(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return uN(r,t,o)}))},dN=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>dN(e,t,r)))))},yN=(e,t,r,n)=>{let{uri:i,value:a}=r;return{type:e,uri:i,lookupValue:a,autopopulate:i!==t&&cN(n,e)}},fN=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s}=e;const l=t[r],u=Nt(n),c=BE(u,o,i,a),p=dN("children",t,l),d=dN("parents",t,l),y=p.flatMap((e=>dN("parents",t,e))).filter((e=>![...d,l,...p].includes(e))),f=p.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return uN(t,n,c)})).map((t=>yN(e.attrType.uri,n,t,s)))));if(!f.length)return[];const T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return uN(n,t,c)||Nt(t)!==u&&uN(t,n,c)})).map((t=>yN(e.attrType.uri,n,t,s))))),E=y.flatMap((e=>{const r=dN("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)&&uN(n,t,c)}))})).map((t=>yN(e.attrType.uri,n,t,s)))}));return[...l.values.filter((e=>{let{uri:t}=e;return uN(t,n,c)})).map((e=>yN(r,n,e,s))),...T,...E,...f]},TN=async e=>{let{attributeType:t,attributePresentations:r,value:n}=e;const i=pv({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=>Rd(e,t.dataLabelPattern))),o=e=>Object.values(e[0])[0],s=(0,l.pipe)(o,i),u=(0,l.cond)([[rr,()=>a(n)],[lr,()=>(e=>{const r=o(e),n=sr(t);return nu([{codeValue:r,type:n}]).then((e=>{if(Array.isArray(e))return av(e[0],n,r)}))})(n)],[l.T,()=>s(n)]]);return await u(t)},EN=e=>{let{value:t,attributeType:r,entityType:n=""}=e,i=[{fieldName:"type",filter:Zr.EQUALS,values:[n]}];return Array.isArray(t)?i=i.concat(mN(r,t)):i.push(hN([t],r)),i},mN=(e,t)=>{const r=Zt(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=rr(i)?mN(i,t[r]):[hN(t[r],i)];return e.push(...a),e}}),[])},hN=(e,t)=>e&&e.length&&!(0,l.isNil)(e[0])&&""!==e[0]?{fieldName:or(t.uri),filter:t.type===nt.TYPE_BLOB?Zr.FULL_TEXT:Zr.EQUALS,values:e}:{fieldName:or(t.uri),filter:Zr.MISSING_VALUE},bN={AttributesDiff:o,AttributesEditor:a,HistoryManager:s},ON={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=3937.js.map