@rubytech/create-realagent 1.0.832 → 1.0.833
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +131 -9
- package/package.json +1 -1
- package/payload/platform/lib/admins-write/dist/index.d.ts +87 -0
- package/payload/platform/lib/admins-write/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/admins-write/dist/index.js +248 -0
- package/payload/platform/lib/admins-write/dist/index.js.map +1 -0
- package/payload/platform/lib/admins-write/src/index.ts +311 -0
- package/payload/platform/lib/admins-write/tsconfig.json +8 -0
- package/payload/platform/neo4j/migrations/009-conversation-archive-title.ts +197 -0
- package/payload/platform/neo4j/schema.cypher +1 -1
- package/payload/platform/package.json +2 -2
- package/payload/platform/plugins/admin/PLUGIN.md +1 -1
- package/payload/platform/plugins/admin/mcp/dist/index.js +37 -44
- package/payload/platform/plugins/admin/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/docs/references/internals.md +4 -3
- package/payload/platform/plugins/memory/bin/conversation-archive-ingest.mjs +215 -43
- package/payload/platform/plugins/memory/bin/conversation-archive-ingest.sh +7 -2
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/llm-classifier.test.js +75 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/llm-classifier.test.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.d.ts +16 -10
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.js +155 -100
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.d.ts +13 -5
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.js +53 -59
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest.d.ts +24 -7
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest.js +23 -5
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest.js.map +1 -1
- package/payload/platform/plugins/memory/skills/conversation-archive/SKILL.md +28 -8
- package/payload/platform/scripts/lib/resolve-account-dir.sh +3 -1
- package/payload/platform/scripts/migrate-import.sh +3 -1
- package/payload/platform/scripts/seed-neo4j.sh +13 -3
- package/payload/server/chunk-CRAIGEXY.js +654 -0
- package/payload/server/chunk-I2NOLBQA.js +2123 -0
- package/payload/server/chunk-IVTESKFR.js +9961 -0
- package/payload/server/chunk-KD3XP4IK.js +1116 -0
- package/payload/server/chunk-OJZPS4BL.js +367 -0
- package/payload/server/client-pool-J5BCVVI2.js +32 -0
- package/payload/server/cloudflare-task-tracker-XCUO4N74.js +19 -0
- package/payload/server/maxy-edge.js +6 -5
- package/payload/server/neo4j-migrations-5AN2U3YO.js +664 -0
- package/payload/server/public/assets/{admin-BNwPsMhJ.js → admin-CgGQafDG.js} +1 -1
- package/payload/server/public/assets/{graph-N_Bw-8oT.js → graph-BlrcvwWP.js} +1 -1
- package/payload/server/public/assets/{page-BKLGP-th.js → page-ClTUYMK8.js} +1 -1
- package/payload/server/public/graph.html +2 -2
- package/payload/server/public/index.html +2 -2
- package/payload/server/server.js +373 -167
- package/payload/platform/plugins/admin/mcp/dist/lib/review-tools.d.ts +0 -31
- package/payload/platform/plugins/admin/mcp/dist/lib/review-tools.d.ts.map +0 -1
- package/payload/platform/plugins/admin/mcp/dist/lib/review-tools.js +0 -666
- package/payload/platform/plugins/admin/mcp/dist/lib/review-tools.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/semantic-chunker.d.ts +0 -61
- package/payload/platform/plugins/memory/mcp/dist/lib/semantic-chunker.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/semantic-chunker.js +0 -266
- package/payload/platform/plugins/memory/mcp/dist/lib/semantic-chunker.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/whatsapp-export-insight-pass.d.ts +0 -27
- package/payload/platform/plugins/memory/mcp/dist/tools/whatsapp-export-insight-pass.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/whatsapp-export-insight-pass.js +0 -477
- package/payload/platform/plugins/memory/mcp/dist/tools/whatsapp-export-insight-pass.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/whatsapp-export-insight-write.d.ts +0 -27
- package/payload/platform/plugins/memory/mcp/dist/tools/whatsapp-export-insight-write.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/whatsapp-export-insight-write.js +0 -160
- package/payload/platform/plugins/memory/mcp/dist/tools/whatsapp-export-insight-write.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/whatsapp-export-parse.d.ts +0 -10
- package/payload/platform/plugins/memory/mcp/dist/tools/whatsapp-export-parse.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/whatsapp-export-parse.js +0 -29
- package/payload/platform/plugins/memory/mcp/dist/tools/whatsapp-export-parse.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/whatsapp-export-preview.d.ts +0 -28
- package/payload/platform/plugins/memory/mcp/dist/tools/whatsapp-export-preview.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/whatsapp-export-preview.js +0 -34
- package/payload/platform/plugins/memory/mcp/dist/tools/whatsapp-export-preview.js.map +0 -1
|
@@ -46,5 +46,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
46
46
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function I_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var L_=Up(`DELETE`);function R_(){var e=z_.apply(void 0,arguments);return V_(e),e}function z_(){var e=[...arguments];if(e.length<2)return e[0];var t;if(e.length>2)return z_.apply(void 0,Jp(t=[R_(e[0],e[1])]).call(t,Hp(Yp(e).call(e,2))));var n=e[0],r=e[1];if(n instanceof Date&&r instanceof Date)return n.setTime(r.getTime()),n;var i,a=F_(nm(r));try{for(a.s();!(i=a.n()).done;){var o=i.value;Object.prototype.propertyIsEnumerable.call(r,o)&&(r[o]===L_?delete n[o]:n[o]===null||r[o]===null||typeof n[o]!=`object`||typeof r[o]!=`object`||rm(n[o])||rm(r[o])?n[o]=B_(r[o]):n[o]=z_(n[o],r[o]))}}catch(e){a.e(e)}finally{a.f()}return n}function B_(e){return rm(e)?Kd(e).call(e,(function(e){return B_(e)})):typeof e==`object`&&e?e instanceof Date?new Date(e.getTime()):z_({},e):e}function V_(e){for(var t=0,n=om(e);t<n.length;t++){var r=n[t];e[r]===L_?delete e[r]:typeof e[r]==`object`&&e[r]!==null&&V_(e[r])}}var H_=typeof window<`u`?window.Hammer||P_:function(){return function(){var e=function(){};return{on:e,off:e,destroy:e,emit:e,get:()=>({set:e})}}()};function U_(e){var t,n=this;this._cleanupQueue=[],this.active=!1,this._dom={container:e,overlay:document.createElement(`div`)},this._dom.overlay.classList.add(`vis-overlay`),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push((function(){n._dom.overlay.parentNode.removeChild(n._dom.overlay)}));var r=H_(this._dom.overlay);r.on(`tap`,vd(t=this._onTapOverlay).call(t,this)),this._cleanupQueue.push((function(){r.destroy()}));var i=[`tap`,`doubletap`,`press`,`pinch`,`pan`,`panstart`,`panmove`,`panend`];_m(i).call(i,(function(e){r.on(e,(function(e){e.srcEvent.stopPropagation()}))})),document&&document.body&&(this._onClick=function(t){(function(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1})(t.target,e)||n.deactivate()},document.body.addEventListener(`click`,this._onClick),this._cleanupQueue.push((function(){document.body.removeEventListener(`click`,n._onClick)}))),this._escListener=function(e){(`key`in e?e.key===`Escape`:e.keyCode===27)&&n.deactivate()}}Bh(U_.prototype),U_.current=null,U_.prototype.destroy=function(){var e,t;this.deactivate();var n,r=F_(Dm(e=Jm(t=this._cleanupQueue).call(t,0)).call(e));try{for(r.s();!(n=r.n()).done;)(0,n.value)()}catch(e){r.e(e)}finally{r.f()}},U_.prototype.activate=function(){U_.current&&U_.current.deactivate(),U_.current=this,this.active=!0,this._dom.overlay.style.display=`none`,this._dom.container.classList.add(`vis-active`),this.emit(`change`),this.emit(`activate`),document.body.addEventListener(`keydown`,this._escListener)},U_.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display=`block`,this._dom.container.classList.remove(`vis-active`),document.body.removeEventListener(`keydown`,this._escListener),this.emit(`change`),this.emit(`deactivate`)},U_.prototype._onTapOverlay=function(e){this.activate(),e.srcEvent.stopPropagation()};var W_=Hr,G_=Ke,K_=TypeError,q_=function(e){if(W_(e))return e;throw new K_(G_(e)+` is not a constructor`)},J_=L,Y_=p,X_=cd,Z_=q_,Q_=Sn,$_=j,ev=sa,tv=s,nv=P(`Reflect`,`construct`),rv=Object.prototype,iv=[].push,av=tv((function(){function e(){}return!(nv((function(){}),[],e)instanceof e)})),ov=!tv((function(){nv((function(){}))})),sv=av||ov;J_({target:`Reflect`,stat:!0,forced:sv,sham:sv},{construct:function(e,t){Z_(e),Q_(t);var n=arguments.length<3?e:Z_(arguments[2]);if(ov&&!av)return nv(e,t,n);if(e===n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return Y_(iv,r,t),new(Y_(X_,e,r))}var i=n.prototype,a=ev($_(i)?i:rv),o=Y_(e,a,t);return $_(o)?o:a}});var cv=r(M.Reflect.construct),lv=r(M.Object.getOwnPropertySymbols),uv={exports:{}},dv=L,fv=s,pv=xe,mv=E.f,hv=D;dv({target:`Object`,stat:!0,forced:!hv||fv((function(){mv(1)})),sham:!hv},{getOwnPropertyDescriptor:function(e,t){return mv(pv(e),t)}});var gv=M.Object,_v=uv.exports=function(e,t){return gv.getOwnPropertyDescriptor(e,t)};gv.getOwnPropertyDescriptor.sham&&(_v.sham=!0);var vv=r(uv.exports),yv=tm,bv=xe,xv=E,Sv=hr;L({target:`Object`,stat:!0,sham:!D},{getOwnPropertyDescriptors:function(e){for(var t,n,r=bv(e),i=xv.f,a=yv(r),o={},s=0;a.length>s;)(n=i(r,t=a[s++]))!==void 0&&Sv(o,t,n);return o}});var Cv=r(M.Object.getOwnPropertyDescriptors),wv={exports:{}},Tv=L,Ev=D,Dv=gi.f;Tv({target:`Object`,stat:!0,forced:Object.defineProperties!==Dv,sham:!Ev},{defineProperties:Dv});var Ov=M.Object,kv=wv.exports=function(e,t){return Ov.defineProperties(e,t)};Ov.defineProperties.sham&&(kv.sham=!0);var Av=r(wv.exports),jv=r(Qn);function U(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}var Mv=mh,Nv=r(Mv);L({target:`Object`,stat:!0},{setPrototypeOf:_l});var Pv=M.Object.setPrototypeOf,Fv=r(Pv),Iv=r(_d);function Lv(e,t){var n;return Lv=Fv?Iv(n=Fv).call(n):function(e,t){return e.__proto__=t,e},Lv(e,t)}function Rv(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Nv(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),er(e,`prototype`,{writable:!1}),t&&Lv(e,t)}function zv(e,t){if(t&&(Ku(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return U(e)}var Bv=fh,Vv=r(Bv);function Hv(e){var t;return Hv=Fv?Iv(t=Vv).call(t):function(e){return e.__proto__||Vv(e)},Hv(e)}var Uv={exports:{}},Wv={exports:{}};(function(e){var t=Tu,n=Wu;function r(i){return e.exports=r=typeof t==`function`&&typeof n==`symbol`?function(e){return typeof e}:function(e){return e&&typeof t==`function`&&e.constructor===t&&e!==t.prototype?`symbol`:typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,r(i)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(Wv);var Gv=Wv.exports,Kv=gm,qv=_t,Jv=tm,Yv=E,Xv=_n,Zv=j,Qv=In,$v=Error,ey=v(``.replace),ty=String(new $v(`zxcasd`).stack),ny=/\n\s*at [^:]*:[^\n]*/,ry=ny.test(ty),iy=le,ay=!s((function(){var e=Error(`a`);return!(`stack`in e)||(Object.defineProperty(e,`stack`,iy(1,7)),e.stack!==7)})),oy=In,sy=function(e,t){if(ry&&typeof e==`string`&&!$v.prepareStackTrace)for(;t--;)e=ey(e,ny,``);return e},cy=ay,ly=Error.captureStackTrace,uy=gn,dy=k,fy=Sn,W=Ke,G=bf,py=lr,my=F,hy=Mf,gy=Ef,_y=mf,vy=TypeError,yy=function(e,t){this.stopped=e,this.result=t},by=yy.prototype,xy=function(e,t,n){var r,i,a,o,s,c,l,u=n&&n.that,d=!(!n||!n.AS_ENTRIES),f=!(!n||!n.IS_RECORD),p=!(!n||!n.IS_ITERATOR),m=!(!n||!n.INTERRUPTED),h=uy(t,u),g=function(e){return r&&_y(r,`normal`,e),new yy(!0,e)},_=function(e){return d?(fy(e),m?h(e[0],e[1],g):h(e[0],e[1])):m?h(e,g):h(e)};if(f)r=e.iterator;else if(p)r=e;else{if(!(i=gy(e)))throw new vy(W(e)+` is not iterable`);if(G(i)){for(a=0,o=py(e);o>a;a++)if((s=_(e[a]))&&my(by,s))return s;return new yy(!1)}r=hy(e,i)}for(c=f?e.next:r.next;!(l=dy(c,r)).done;){try{s=_(l.value)}catch(e){_y(r,`throw`,e)}if(typeof s==`object`&&s&&my(by,s))return s}return new yy(!1)},Sy=hi,Cy=L,wy=F,Ty=qc,Ey=_l,Dy=function(e,t,n){for(var r=Jv(t),i=Xv.f,a=Yv.f,o=0;o<r.length;o++){var s=r[o];qv(e,s)||n&&qv(n,s)||i(e,s,a(t,s))}},Oy=sa,ky=In,Ay=le,jy=function(e,t){Zv(t)&&`cause`in t&&Qv(e,`cause`,t.cause)},My=function(e,t,n,r){cy&&(ly?ly(e,t):oy(e,`stack`,sy(n,r)))},Ny=xy,Py=function(e,t){return e===void 0?arguments.length<2?``:t:Sy(e)},Fy=jt(`toStringTag`),Iy=Error,Ly=[].push,Ry=function(e,t){var n,r=wy(zy,this);Ey?n=Ey(new Iy,r?Ty(this):zy):(n=r?this:Oy(zy),ky(n,Fy,`Error`)),t!==void 0&&ky(n,`message`,Py(t)),My(n,Ry,n.stack,1),arguments.length>2&&jy(n,arguments[2]);var i=[];return Ny(e,Ly,{that:i}),ky(n,`errors`,i),n};Ey?Ey(Ry,Iy):Dy(Ry,Iy,{name:!0});var zy=Ry.prototype=Oy(Iy.prototype,{constructor:Ay(1,Ry),message:Ay(1,``),name:Ay(1,`AggregateError`)});Cy({global:!0,constructor:!0,arity:2},{AggregateError:Ry});var By,Vy,Hy,Uy,Wy=P,Gy=Da,Ky=D,qy=jt(`species`),Jy=function(e){var t=Wy(e);Ky&&t&&!t[qy]&&Gy(t,qy,{configurable:!0,get:function(){return this}})},Yy=F,Xy=TypeError,Zy=function(e,t){if(Yy(t,e))return e;throw new Xy(`Incorrect invocation`)},Qy=Sn,$y=q_,eb=he,tb=jt(`species`),nb=function(e,t){var n,r=Qy(e).constructor;return r===void 0||eb(n=Qy(r)[tb])?t:$y(n)},rb=/(?:ipad|iphone|ipod).*applewebkit/i.test(De),ib=o,ab=p,ob=gn,sb=T,cb=_t,lb=s,ub=Wi,db=qs,fb=Gt,pb=xh,mb=rb,hb=Od,gb=ib.setImmediate,_b=ib.clearImmediate,vb=ib.process,yb=ib.Dispatch,bb=ib.Function,xb=ib.MessageChannel,Sb=ib.String,Cb=0,wb={},Tb=`onreadystatechange`;lb((function(){By=ib.location}));var Eb=function(e){if(cb(wb,e)){var t=wb[e];delete wb[e],t()}},Db=function(e){return function(){Eb(e)}},Ob=function(e){Eb(e.data)},kb=function(e){ib.postMessage(Sb(e),By.protocol+`//`+By.host)};gb&&_b||(gb=function(e){pb(arguments.length,1);var t=sb(e)?e:bb(e),n=db(arguments,1);return wb[++Cb]=function(){ab(t,void 0,n)},Vy(Cb),Cb},_b=function(e){delete wb[e]},hb?Vy=function(e){vb.nextTick(Db(e))}:yb&&yb.now?Vy=function(e){yb.now(Db(e))}:xb&&!mb?(Uy=(Hy=new xb).port2,Hy.port1.onmessage=Ob,Vy=ob(Uy.postMessage,Uy)):ib.addEventListener&&sb(ib.postMessage)&&!ib.importScripts&&By&&By.protocol!==`file:`&&!lb(kb)?(Vy=kb,ib.addEventListener(`message`,Ob,!1)):Vy=Tb in fb(`script`)?function(e){ub.appendChild(fb(`script`))[Tb]=function(){ub.removeChild(this),Eb(e)}}:function(e){setTimeout(Db(e),0)});var Ab={set:gb,clear:_b},jb=function(){this.head=null,this.tail=null};jb.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return(this.head=e.next)===null&&(this.tail=null),e.item}};var Mb,Nb,Pb,Fb,Ib,Lb=jb,Rb=/ipad|iphone|ipod/i.test(De)&&typeof Pebble<`u`,zb=/web0s(?!.*chrome)/i.test(De),Bb=o,Vb=gn,Hb=E.f,Ub=Ab.set,Wb=Lb,Gb=rb,Kb=Rb,qb=zb,Jb=Od,Yb=Bb.MutationObserver||Bb.WebKitMutationObserver,Xb=Bb.document,Zb=Bb.process,Qb=Bb.Promise,$b=Hb(Bb,`queueMicrotask`),ex=$b&&$b.value;if(!ex){var tx=new Wb,nx=function(){var e,t;for(Jb&&(e=Zb.domain)&&e.exit();t=tx.get();)try{t()}catch(e){throw tx.head&&Mb(),e}e&&e.enter()};Gb||Jb||qb||!Yb||!Xb?!Kb&&Qb&&Qb.resolve?((Fb=Qb.resolve(void 0)).constructor=Qb,Ib=Vb(Fb.then,Fb),Mb=function(){Ib(nx)}):Jb?Mb=function(){Zb.nextTick(nx)}:(Ub=Vb(Ub,Bb),Mb=function(){Ub(nx)}):(Nb=!0,Pb=Xb.createTextNode(``),new Yb(nx).observe(Pb,{characterData:!0}),Mb=function(){Pb.data=Nb=!Nb}),ex=function(e){tx.head||Mb(),tx.add(e)}}var rx=ex,ix=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},ax=o.Promise,ox=typeof Deno==`object`&&Deno&&typeof Deno.version==`object`,sx=!ox&&!Od&&typeof window==`object`&&typeof document==`object`,cx=o,lx=ax,ux=T,dx=fn,fx=Or,px=jt,mx=sx,hx=ox,gx=Pe,_x=lx&&lx.prototype,vx=px(`species`),yx=!1,bx=ux(cx.PromiseRejectionEvent),xx={CONSTRUCTOR:dx(`Promise`,(function(){var e=fx(lx),t=e!==String(lx);if(!t&&gx===66||!_x.catch||!_x.finally)return!0;if(!gx||gx<51||!/native code/.test(e)){var n=new lx((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};if((n.constructor={})[vx]=r,!(yx=n.then((function(){}))instanceof r))return!0}return!t&&(mx||hx)&&!bx})),REJECTION_EVENT:bx,SUBCLASSING:yx},Sx={},Cx=Xe,wx=TypeError,Tx=function(e){var t,n;this.promise=new e((function(e,r){if(t!==void 0||n!==void 0)throw new wx(`Bad Promise constructor`);t=e,n=r})),this.resolve=Cx(t),this.reject=Cx(n)};Sx.f=function(e){return new Tx(e)};var Ex,Dx,Ox=L,kx=Od,Ax=o,jx=k,Mx=Ta,Nx=Xa,Px=Jy,Fx=Xe,Ix=T,Lx=j,Rx=Zy,zx=nb,Bx=Ab.set,Vx=rx,Hx=function(e,t){try{arguments.length===1?console.error(e):console.error(e,t)}catch{}},Ux=ix,Wx=Lb,Gx=po,Kx=ax,qx=xx,Jx=Sx,Yx=`Promise`,Xx=qx.CONSTRUCTOR,Zx=qx.REJECTION_EVENT,Qx=Gx.getterFor(Yx),$x=Gx.set,eS=Kx&&Kx.prototype,tS=Kx,nS=eS,rS=Ax.TypeError,iS=Ax.document,aS=Ax.process,oS=Jx.f,sS=oS,cS=!!(iS&&iS.createEvent&&Ax.dispatchEvent),lS=`unhandledrejection`,uS=function(e){var t;return!(!Lx(e)||!Ix(t=e.then))&&t},dS=function(e,t){var n,r,i,a=t.value,o=t.state===1,s=o?e.ok:e.fail,c=e.resolve,l=e.reject,u=e.domain;try{s?(o||(t.rejection===2&&gS(t),t.rejection=1),!0===s?n=a:(u&&u.enter(),n=s(a),u&&(u.exit(),i=!0)),n===e.promise?l(new rS(`Promise-chain cycle`)):(r=uS(n))?jx(r,n,c,l):c(n)):l(a)}catch(e){u&&!i&&u.exit(),l(e)}},fS=function(e,t){e.notified||(e.notified=!0,Vx((function(){for(var n,r=e.reactions;n=r.get();)dS(n,e);e.notified=!1,t&&!e.rejection&&mS(e)})))},pS=function(e,t,n){var r,i;cS?((r=iS.createEvent(`Event`)).promise=t,r.reason=n,r.initEvent(e,!1,!0),Ax.dispatchEvent(r)):r={promise:t,reason:n},!Zx&&(i=Ax[`on`+e])?i(r):e===lS&&Hx(`Unhandled promise rejection`,n)},mS=function(e){jx(Bx,Ax,(function(){var t,n=e.facade,r=e.value;if(hS(e)&&(t=Ux((function(){kx?aS.emit(`unhandledRejection`,r,n):pS(lS,n,r)})),e.rejection=kx||hS(e)?2:1,t.error))throw t.value}))},hS=function(e){return e.rejection!==1&&!e.parent},gS=function(e){jx(Bx,Ax,(function(){var t=e.facade;kx?aS.emit(`rejectionHandled`,t):pS(`rejectionhandled`,t,e.value)}))},_S=function(e,t,n){return function(r){e(t,r,n)}},vS=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,fS(e,!0))},yS=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw new rS(`Promise can't be resolved itself`);var r=uS(t);r?Vx((function(){var n={done:!1};try{jx(r,t,_S(yS,n,e),_S(vS,n,e))}catch(t){vS(n,t,e)}})):(e.value=t,e.state=1,fS(e,!1))}catch(t){vS({done:!1},t,e)}}};Xx&&(nS=(tS=function(e){Rx(this,nS),Fx(e),jx(Ex,this);var t=Qx(this);try{e(_S(yS,t),_S(vS,t))}catch(e){vS(t,e)}}).prototype,(Ex=function(e){$x(this,{type:Yx,done:!1,notified:!1,parent:!1,reactions:new Wx,rejection:!1,state:0,value:void 0})}).prototype=Mx(nS,`then`,(function(e,t){var n=Qx(this),r=oS(zx(this,tS));return n.parent=!0,r.ok=!Ix(e)||e,r.fail=Ix(t)&&t,r.domain=kx?aS.domain:void 0,n.state===0?n.reactions.add(r):Vx((function(){dS(r,n)})),r.promise})),Dx=function(){var e=new Ex,t=Qx(e);this.promise=e,this.resolve=_S(yS,t),this.reject=_S(vS,t)},Jx.f=oS=function(e){return e===tS||e===void 0?new Dx(e):sS(e)}),Ox({global:!0,constructor:!0,wrap:!0,forced:Xx},{Promise:tS}),Nx(tS,Yx,!1,!0),Px(Yx);var bS=ax,xS=xx.CONSTRUCTOR||!Jf((function(e){bS.all(e).then(void 0,(function(){}))})),SS=k,CS=Xe,wS=Sx,TS=ix,ES=xy;L({target:`Promise`,stat:!0,forced:xS},{all:function(e){var t=this,n=wS.f(t),r=n.resolve,i=n.reject,a=TS((function(){var n=CS(t.resolve),a=[],o=0,s=1;ES(e,(function(e){var c=o++,l=!1;s++,SS(n,t,e).then((function(e){l||(l=!0,a[c]=e,--s||r(a))}),i)})),--s||r(a)}));return a.error&&i(a.value),n.promise}});var DS=L,OS=xx.CONSTRUCTOR;ax&&ax.prototype,DS({target:`Promise`,proto:!0,forced:OS,real:!0},{catch:function(e){return this.then(void 0,e)}});var kS=k,AS=Xe,jS=Sx,MS=ix,NS=xy;L({target:`Promise`,stat:!0,forced:xS},{race:function(e){var t=this,n=jS.f(t),r=n.reject,i=MS((function(){var i=AS(t.resolve);NS(e,(function(e){kS(i,t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var PS=k,FS=Sx;L({target:`Promise`,stat:!0,forced:xx.CONSTRUCTOR},{reject:function(e){var t=FS.f(this);return PS(t.reject,void 0,e),t.promise}});var IS=Sn,LS=j,RS=Sx,zS=function(e,t){if(IS(e),LS(t)&&t.constructor===e)return t;var n=RS.f(e);return(0,n.resolve)(t),n.promise},BS=L,VS=ax,HS=xx.CONSTRUCTOR,US=zS,K=P(`Promise`),WS=!HS;BS({target:`Promise`,stat:!0,forced:!0},{resolve:function(e){return US(WS&&this===K?VS:this,e)}});var GS=k,KS=Xe,qS=Sx,q=ix,JS=xy;L({target:`Promise`,stat:!0,forced:xS},{allSettled:function(e){var t=this,n=qS.f(t),r=n.resolve,i=n.reject,a=q((function(){var n=KS(t.resolve),i=[],a=0,o=1;JS(e,(function(e){var s=a++,c=!1;o++,GS(n,t,e).then((function(e){c||(c=!0,i[s]={status:`fulfilled`,value:e},--o||r(i))}),(function(e){c||(c=!0,i[s]={status:`rejected`,reason:e},--o||r(i))}))})),--o||r(i)}));return a.error&&i(a.value),n.promise}});var YS=k,J=Xe,XS=P,ZS=Sx,QS=ix,$S=xy,eC=`No one promise resolved`;L({target:`Promise`,stat:!0,forced:xS},{any:function(e){var t=this,n=XS(`AggregateError`),r=ZS.f(t),i=r.resolve,a=r.reject,o=QS((function(){var r=J(t.resolve),o=[],s=0,c=1,l=!1;$S(e,(function(e){var u=s++,d=!1;c++,YS(r,t,e).then((function(e){d||l||(l=!0,i(e))}),(function(e){d||l||(d=!0,o[u]=e,--c||a(new n(o,eC)))}))})),--c||a(new n(o,eC))}));return o.error&&a(o.value),r.promise}});var tC=L,nC=ax,rC=s,iC=P,aC=T,oC=nb,sC=zS,cC=nC&&nC.prototype;tC({target:`Promise`,proto:!0,real:!0,forced:!!nC&&rC((function(){cC.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=oC(this,iC(`Promise`)),n=aC(e);return this.then(n?function(n){return sC(t,e()).then((function(){return n}))}:e,n?function(n){return sC(t,e()).then((function(){throw n}))}:e)}});var lC=M.Promise,uC=Sx;L({target:`Promise`,stat:!0},{withResolvers:function(){var e=uC.f(this);return{promise:e.promise,resolve:e.resolve,reject:e.reject}}});var dC=lC,fC=Sx,pC=ix;L({target:`Promise`,stat:!0,forced:!0},{try:function(e){var t=fC.f(this),n=pC(e);return(n.error?t.reject:t.resolve)(n.value),t.promise}});var mC=dC,hC=Em;(function(e){var t=Gv.default,n=$n,r=Tu,i=Mv,a=Bv,o=Kv,s=hp,c=Pv,l=mC,u=hC,d=Ip;function f(){e.exports=f=function(){return m},e.exports.__esModule=!0,e.exports.default=e.exports;var p,m={},h=Object.prototype,g=h.hasOwnProperty,_=n||function(e,t,n){e[t]=n.value},v=typeof r==`function`?r:{},y=v.iterator||`@@iterator`,b=v.asyncIterator||`@@asyncIterator`,x=v.toStringTag||`@@toStringTag`;function S(e,t,r){return n(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{S({},``)}catch{S=function(e,t,n){return e[t]=n}}function ee(e,t,n,r){var a=i((t&&t.prototype instanceof E?t:E).prototype);return _(a,`_invoke`,{value:se(e,n,new de(r||[]))}),a}function C(e,t,n){try{return{type:`normal`,arg:e.call(t,n)}}catch(e){return{type:`throw`,arg:e}}}m.wrap=ee;var te=`suspendedStart`,ne=`suspendedYield`,re=`executing`,w=`completed`,T={};function E(){}function D(){}function O(){}var ie={};S(ie,y,(function(){return this}));var k=a&&a(a(fe([])));k&&k!==h&&g.call(k,y)&&(ie=k);var A=O.prototype=E.prototype=i(ie);function ae(e){var t;o(t=[`next`,`throw`,`return`]).call(t,(function(t){S(e,t,(function(e){return this._invoke(t,e)}))}))}function oe(e,n){function r(i,a,o,s){var c=C(e[i],e,a);if(c.type!==`throw`){var l=c.arg,u=l.value;return u&&t(u)==`object`&&g.call(u,`__await`)?n.resolve(u.__await).then((function(e){r(`next`,e,o,s)}),(function(e){r(`throw`,e,o,s)})):n.resolve(u).then((function(e){l.value=e,o(l)}),(function(e){return r(`throw`,e,o,s)}))}s(c.arg)}var i;_(this,`_invoke`,{value:function(e,t){function a(){return new n((function(n,i){r(e,t,n,i)}))}return i=i?i.then(a,a):a()}})}function se(e,t,n){var r=te;return function(i,a){if(r===re)throw Error(`Generator is already running`);if(r===w){if(i===`throw`)throw a;return{value:p,done:!0}}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=ce(o,n);if(s){if(s===T)continue;return s}}if(n.method===`next`)n.sent=n._sent=n.arg;else if(n.method===`throw`){if(r===te)throw r=w,n.arg;n.dispatchException(n.arg)}else n.method===`return`&&n.abrupt(`return`,n.arg);r=re;var c=C(e,t,n);if(c.type===`normal`){if(r=n.done?w:ne,c.arg===T)continue;return{value:c.arg,done:n.done}}c.type===`throw`&&(r=w,n.method=`throw`,n.arg=c.arg)}}}function ce(e,t){var n=t.method,r=e.iterator[n];if(r===p)return t.delegate=null,n===`throw`&&e.iterator.return&&(t.method=`return`,t.arg=p,ce(e,t),t.method===`throw`)||n!==`return`&&(t.method=`throw`,t.arg=TypeError(`The iterator does not provide a '`+n+`' method`)),T;var i=C(r,e.iterator,t.arg);if(i.type===`throw`)return t.method=`throw`,t.arg=i.arg,t.delegate=null,T;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,t.method!==`return`&&(t.method=`next`,t.arg=p),t.delegate=null,T):a:(t.method=`throw`,t.arg=TypeError(`iterator result is not an object`),t.delegate=null,T)}function le(e){var t,n={tryLoc:e[0]};1 in e&&(n.catchLoc=e[1]),2 in e&&(n.finallyLoc=e[2],n.afterLoc=e[3]),s(t=this.tryEntries).call(t,n)}function ue(e){var t=e.completion||{};t.type=`normal`,delete t.arg,e.completion=t}function de(e){this.tryEntries=[{tryLoc:`root`}],o(e).call(e,le,this),this.reset(!0)}function fe(e){if(e||e===``){var n=e[y];if(n)return n.call(e);if(typeof e.next==`function`)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(g.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=p,t.done=!0,t};return i.next=i}}throw TypeError(t(e)+` is not iterable`)}return D.prototype=O,_(A,`constructor`,{value:O,configurable:!0}),_(O,`constructor`,{value:D,configurable:!0}),D.displayName=S(O,x,`GeneratorFunction`),m.isGeneratorFunction=function(e){var t=typeof e==`function`&&e.constructor;return!!t&&(t===D||(t.displayName||t.name)===`GeneratorFunction`)},m.mark=function(e){return c?c(e,O):(e.__proto__=O,S(e,x,`GeneratorFunction`)),e.prototype=i(A),e},m.awrap=function(e){return{__await:e}},ae(oe.prototype),S(oe.prototype,b,(function(){return this})),m.AsyncIterator=oe,m.async=function(e,t,n,r,i){i===void 0&&(i=l);var a=new oe(ee(e,t,n,r),i);return m.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},ae(A),S(A,x,`Generator`),S(A,y,(function(){return this})),S(A,`toString`,(function(){return`[object Generator]`})),m.keys=function(e){var t=Object(e),n=[];for(var r in t)s(n).call(n,r);return u(n).call(n),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},m.values=fe,de.prototype={constructor:de,reset:function(e){var t;if(this.prev=0,this.next=0,this.sent=this._sent=p,this.done=!1,this.delegate=null,this.method=`next`,this.arg=p,o(t=this.tryEntries).call(t,ue),!e)for(var n in this)n.charAt(0)===`t`&&g.call(this,n)&&!isNaN(+d(n).call(n,1))&&(this[n]=p)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if(e.type===`throw`)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return a.type=`throw`,a.arg=e,t.next=n,r&&(t.method=`next`,t.arg=p),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if(i.tryLoc===`root`)return n(`end`);if(i.tryLoc<=this.prev){var o=g.call(i,`catchLoc`),s=g.call(i,`finallyLoc`);if(o&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw Error(`try statement without catch or finally`);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&g.call(r,`finallyLoc`)&&this.prev<r.finallyLoc){var i=r;break}}i&&(e===`break`||e===`continue`)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method=`next`,this.next=i.finallyLoc,T):this.complete(a)},complete:function(e,t){if(e.type===`throw`)throw e.arg;return e.type===`break`||e.type===`continue`?this.next=e.arg:e.type===`return`?(this.rval=this.arg=e.arg,this.method=`return`,this.next=`end`):e.type===`normal`&&t&&(this.next=t),T},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),ue(n),T}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if(r.type===`throw`){var i=r.arg;ue(n)}return i}}throw Error(`illegal catch attempt`)},delegateYield:function(e,t,n){return this.delegate={iterator:fe(e),resultName:t,nextLoc:n},this.method===`next`&&(this.arg=p),T}},m}e.exports=f,e.exports.__esModule=!0,e.exports.default=e.exports})(Uv);var gC=(0,Uv.exports)(),_C=gC;try{regeneratorRuntime=gC}catch{typeof globalThis==`object`?globalThis.regeneratorRuntime=gC:Function(`r`,`regeneratorRuntime = r`)(gC)}var vC=r(_C),yC={exports:{}},bC=s((function(){if(typeof ArrayBuffer==`function`){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,`a`,{value:8})}})),xC=s,SC=j,CC=S,wC=bC,TC=Object.isExtensible,EC=xC((function(){TC(1)}))||wC?function(e){return!!SC(e)&&(!wC||CC(e)!==`ArrayBuffer`)&&(!TC||TC(e))}:TC,DC=!s((function(){return Object.isExtensible(Object.preventExtensions({}))})),OC=L,kC=v,AC=Ei,jC=j,MC=_t,NC=_n.f,PC=ca,FC=da,IC=EC,LC=DC,RC=!1,zC=St(`meta`),BC=0,VC=function(e){NC(e,zC,{value:{objectID:`O`+ BC++,weakData:{}}})},HC=yC.exports={enable:function(){HC.enable=function(){},RC=!0;var e=PC.f,t=kC([].splice),n={};n[zC]=1,e(n).length&&(PC.f=function(n){for(var r=e(n),i=0,a=r.length;i<a;i++)if(r[i]===zC){t(r,i,1);break}return r},OC({target:`Object`,stat:!0,forced:!0},{getOwnPropertyNames:FC.f}))},fastKey:function(e,t){if(!jC(e))return typeof e==`symbol`?e:(typeof e==`string`?`S`:`P`)+e;if(!MC(e,zC)){if(!IC(e))return`F`;if(!t)return`E`;VC(e)}return e[zC].objectID},getWeakData:function(e,t){if(!MC(e,zC)){if(!IC(e))return!0;if(!t)return!1;VC(e)}return e[zC].weakData},onFreeze:function(e){return LC&&RC&&IC(e)&&!MC(e,zC)&&VC(e),e}};AC[zC]=!0;var UC=yC.exports,WC=L,GC=o,KC=UC,qC=s,JC=In,YC=xy,XC=Zy,ZC=T,QC=j,$C=he,ew=Xa,tw=_n.f,nw=xo.forEach,rw=D,iw=po.set,aw=po.getterFor,ow=function(e,t,n){var r,i=e.indexOf(`Map`)!==-1,a=e.indexOf(`Weak`)!==-1,o=i?`set`:`add`,s=GC[e],c=s&&s.prototype,l={};if(rw&&ZC(s)&&(a||c.forEach&&!qC((function(){new s().entries().next()})))){var u=(r=t((function(t,n){iw(XC(t,u),{type:e,collection:new s}),$C(n)||YC(n,t[o],{that:t,AS_ENTRIES:i})}))).prototype,d=aw(e);nw([`add`,`clear`,`delete`,`forEach`,`get`,`has`,`set`,`keys`,`values`,`entries`],(function(e){var t=e===`add`||e===`set`;!(e in c)||a&&e===`clear`||JC(u,e,(function(n,r){var i=d(this).collection;if(!t&&a&&!QC(n))return e===`get`&&void 0;var o=i[e](n===0?0:n,r);return t?this:o}))})),a||tw(u,`size`,{configurable:!0,get:function(){return d(this).collection.size}})}else r=n.getConstructor(t,e,i,o),KC.enable();return ew(r,e,!1,!0),l[e]=r,WC({global:!0,forced:!0},l),a||n.setStrong(r,e,i),r},sw=Ta,cw=sa,lw=Da,uw=function(e,t,n){for(var r in t)n&&n.unsafe&&e[r]?e[r]=t[r]:sw(e,r,t[r],n);return e},dw=gn,fw=Zy,pw=he,mw=xy,hw=Pl,gw=Fl,_w=Jy,vw=D,yw=UC.fastKey,bw=po.set,xw=po.getterFor,Sw={getConstructor:function(e,t,n,r){var i=e((function(e,i){fw(e,a),bw(e,{type:t,index:cw(null),first:void 0,last:void 0,size:0}),vw||(e.size=0),pw(i)||mw(i,e[r],{that:e,AS_ENTRIES:n})})),a=i.prototype,o=xw(t),s=function(e,t,n){var r,i,a=o(e),s=c(e,t);return s?s.value=n:(a.last=s={index:i=yw(t,!0),key:t,value:n,previous:r=a.last,next:void 0,removed:!1},a.first||=s,r&&(r.next=s),vw?a.size++:e.size++,i!==`F`&&(a.index[i]=s)),e},c=function(e,t){var n,r=o(e),i=yw(t);if(i!==`F`)return r.index[i];for(n=r.first;n;n=n.next)if(n.key===t)return n};return uw(a,{clear:function(){for(var e=o(this),t=e.index,n=e.first;n;)n.removed=!0,n.previous&&=n.previous.next=void 0,delete t[n.index],n=n.next;e.first=e.last=void 0,vw?e.size=0:this.size=0},delete:function(e){var t=this,n=o(t),r=c(t,e);if(r){var i=r.next,a=r.previous;delete n.index[r.index],r.removed=!0,a&&(a.next=i),i&&(i.previous=a),n.first===r&&(n.first=i),n.last===r&&(n.last=a),vw?n.size--:t.size--}return!!r},forEach:function(e){for(var t,n=o(this),r=dw(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!c(this,e)}}),uw(a,n?{get:function(e){var t=c(this,e);return t&&t.value},set:function(e,t){return s(this,e===0?0:e,t)}}:{add:function(e){return s(this,e=e===0?0:e,e)}}),vw&&lw(a,`size`,{configurable:!0,get:function(){return o(this).size}}),i},setStrong:function(e,t,n){var r=t+` Iterator`,i=xw(t),a=xw(r);hw(e,t,(function(e,t){bw(this,{type:r,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=a(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?gw(t===`keys`?n.key:t===`values`?n.value:[n.key,n.value],!1):(e.target=void 0,gw(void 0,!0))}),n?`entries`:`values`,!n,!0),_w(t)}};ow(`Map`,(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),Sw);var Cw=r(M.Map),ww=xo.some;L({target:`Array`,proto:!0,forced:!Dd(`some`)},{some:function(e){return ww(this,e,arguments.length>1?arguments[1]:void 0)}});var Tw=fd(`Array`,`some`),Ew=F,Dw=Tw,Ow=Array.prototype,kw=r((function(e){var t=e.some;return e===Ow||Ew(Ow,e)&&t===Ow.some?Dw:t})),Aw=fd(`Array`,`keys`),jw=wr,Mw=_t,Nw=F,Pw=Aw,Fw=Array.prototype,Iw={DOMTokenList:!0,NodeList:!0},Lw=r((function(e){var t=e.keys;return e===Fw||Nw(Fw,e)&&t===Fw.keys||Mw(Iw,jw(e))?Pw:t})),Rw=_a,zw=Math.floor,Bw=function(e,t){var n=e.length,r=zw(n/2);return n<8?Vw(e,t):Hw(e,Bw(Rw(e,0,r),t),Bw(Rw(e,r),t),t)},Vw=function(e,t){for(var n,r,i=e.length,a=1;a<i;){for(r=a,n=e[a];r&&t(e[r-1],n)>0;)e[r]=e[--r];r!==a++&&(e[r]=n)}return e},Hw=function(e,t,n,r){for(var i=t.length,a=n.length,o=0,s=0;o<i||s<a;)e[o+s]=o<i&&s<a?r(t[o],n[s])<=0?t[o++]:n[s++]:o<i?t[o++]:n[s++];return e},Uw=Bw,Ww=De.match(/firefox\/(\d+)/i),Gw=!!Ww&&+Ww[1],Kw=/MSIE|Trident/.test(De),qw=De.match(/AppleWebKit\/(\d+)\./),Jw=!!qw&&+qw[1],Yw=L,Xw=v,Zw=Xe,Qw=mt,$w=lr,eT=Am,tT=hi,nT=s,rT=Uw,iT=Dd,aT=Gw,oT=Kw,sT=Pe,cT=Jw,lT=[],uT=Xw(lT.sort),dT=Xw(lT.push),fT=nT((function(){lT.sort(void 0)})),pT=nT((function(){lT.sort(null)})),mT=iT(`sort`),hT=!nT((function(){if(sT)return sT<70;if(!(aT&&aT>3)){if(oT)return!0;if(cT)return cT<603;var e,t,n,r,i=``;for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(r=0;r<47;r++)lT.push({k:t+r,v:n})}for(lT.sort((function(e,t){return t.v-e.v})),r=0;r<lT.length;r++)t=lT[r].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return i!==`DGBEFHACIJK`}}));Yw({target:`Array`,proto:!0,forced:fT||!pT||!mT||!hT},{sort:function(e){e!==void 0&&Zw(e);var t=Qw(this);if(hT)return e===void 0?uT(t):uT(t,e);var n,r,i=[],a=$w(t);for(r=0;r<a;r++)r in t&&dT(i,t[r]);for(rT(i,function(e){return function(t,n){return n===void 0?-1:t===void 0?1:e===void 0?tT(t)>tT(n)?1:-1:+e(t,n)||0}}(e)),n=$w(i),r=0;r<n;)t[r]=i[r++];for(;r<a;)eT(t,r++);return t}});var gT=fd(`Array`,`sort`),_T=F,vT=gT,yT=Array.prototype,bT=r((function(e){var t=e.sort;return e===yT||_T(yT,e)&&t===yT.sort?vT:t})),xT=fd(`Array`,`values`),ST=wr,CT=_t,wT=F,TT=xT,ET=Array.prototype,DT={DOMTokenList:!0,NodeList:!0},OT=r((function(e){var t=e.values;return e===ET||wT(ET,e)&&t===ET.values||CT(DT,ST(e))?TT:t})),kT=r(Uu),AT=fd(`Array`,`entries`),jT=wr,MT=_t,NT=F,PT=AT,FT=Array.prototype,IT={DOMTokenList:!0,NodeList:!0},LT=r((function(e){var t=e.entries;return e===FT||NT(FT,e)&&t===FT.entries||MT(IT,jT(e))?PT:t}));let RT,zT=new Uint8Array(16);function BT(){if(!RT&&(RT=typeof crypto<`u`&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!RT))throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);return RT(zT)}let VT=[];for(let e=0;e<256;++e)VT.push((e+256).toString(16).slice(1));var HT={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function UT(e,t,n){if(HT.randomUUID&&!t&&!e)return HT.randomUUID();let r=(e||={}).random||(e.rng||BT)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n||=0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return VT[e[t+0]]+VT[e[t+1]]+VT[e[t+2]]+VT[e[t+3]]+`-`+VT[e[t+4]]+VT[e[t+5]]+`-`+VT[e[t+6]]+VT[e[t+7]]+`-`+VT[e[t+8]]+VT[e[t+9]]+`-`+VT[e[t+10]]+VT[e[t+11]]+VT[e[t+12]]+VT[e[t+13]]+VT[e[t+14]]+VT[e[t+15]]}(r)}function WT(e){return typeof e==`string`||typeof e==`number`}var GT=function(){function e(n){t(this,e),Zu(this,`_queue`,[]),Zu(this,`_timeout`,null),Zu(this,`_extended`,null),this.delay=null,this.max=1/0,this.setOptions(n)}return Xu(e,[{key:`setOptions`,value:function(e){e&&e.delay!==void 0&&(this.delay=e.delay),e&&e.max!==void 0&&(this.max=e.max),this._flushIfNeeded()}},{key:`destroy`,value:function(){if(this.flush(),this._extended){for(var e=this._extended.object,t=this._extended.methods,n=0;n<t.length;n++){var r=t[n];r.original?e[r.name]=r.original:delete e[r.name]}this._extended=null}}},{key:`replace`,value:function(e,t){var n=this,r=e[t];if(!r)throw Error(`Method `+t+` undefined`);e[t]=function(){var e=[...arguments];n.queue({args:e,fn:r,context:this})}}},{key:`queue`,value:function(e){typeof e==`function`?this._queue.push({fn:e}):this._queue.push(e),this._flushIfNeeded()}},{key:`_flushIfNeeded`,value:function(){var e=this;this._queue.length>this.max&&this.flush(),this._timeout!=null&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&typeof this.delay==`number`&&(this._timeout=H((function(){e.flush()}),this.delay))}},{key:`flush`,value:function(){var e,t;_m(e=Jm(t=this._queue).call(t,0)).call(e,(function(e){e.fn.apply(e.context||e.fn,e.args||[])}))}}],[{key:`extend`,value:function(t,n){var r=new e(n);if(t.flush!==void 0)throw Error(`Target object already has a property flush`);t.flush=function(){r.flush()};var i=[{name:`flush`,original:void 0}];if(n&&n.replace)for(var a=0;a<n.replace.length;a++){var o=n.replace[a];i.push({name:o,original:t[o]}),r.replace(t,o)}return r._extended={object:t,methods:i},r}}]),e}(),KT=function(){function e(){t(this,e),Zu(this,`_subscribers`,{"*":[],add:[],remove:[],update:[]}),Zu(this,`subscribe`,e.prototype.on),Zu(this,`unsubscribe`,e.prototype.off)}return Xu(e,[{key:`_trigger`,value:function(e,t,n){var r,i;if(e===`*`)throw Error(`Cannot trigger event *`);_m(r=Jp(i=[]).call(i,Hp(this._subscribers[e]),Hp(this._subscribers[`*`]))).call(r,(function(r){r(e,t,n??null)}))}},{key:`on`,value:function(e,t){typeof t==`function`&&this._subscribers[e].push(t)}},{key:`off`,value:function(e,t){var n;this._subscribers[e]=Bd(n=this._subscribers[e]).call(n,(function(e){return e!==t}))}}]),e}();ow(`Set`,(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),Sw);var qT=r(M.Set),JT=r(Mf);function YT(e,t){var n=Up!==void 0&&$f(e)||e[`@@iterator`];if(!n){if(rm(e)||(n=function(e,t){var n;if(e){if(typeof e==`string`)return XT(e,t);var r=Yp(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return Xf(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return XT(e,t)}}(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
47
47
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function XT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ZT=function(e){function n(e){t(this,n),this._pairs=e}return Xu(n,[{key:e,value:vC.mark((function e(){var t,n,r,i,a;return vC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=YT(this._pairs),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=9;break}return r=Vp(n.value,2),i=r[0],a=r[1],e.next=7,[i,a];case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case`end`:return e.stop()}}),e,this,[[1,11,14,17]])}))},{key:`entries`,value:vC.mark((function e(){var t,n,r,i,a;return vC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=YT(this._pairs),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=9;break}return r=Vp(n.value,2),i=r[0],a=r[1],e.next=7,[i,a];case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case`end`:return e.stop()}}),e,this,[[1,11,14,17]])}))},{key:`keys`,value:vC.mark((function e(){var t,n,r,i;return vC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=YT(this._pairs),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=9;break}return r=Vp(n.value,1),i=r[0],e.next=7,i;case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case`end`:return e.stop()}}),e,this,[[1,11,14,17]])}))},{key:`values`,value:vC.mark((function e(){var t,n,r,i;return vC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=YT(this._pairs),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=9;break}return r=Vp(n.value,2),i=r[1],e.next=7,i;case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case`end`:return e.stop()}}),e,this,[[1,11,14,17]])}))},{key:`toIdArray`,value:function(){var e;return Kd(e=Hp(this._pairs)).call(e,(function(e){return e[0]}))}},{key:`toItemArray`,value:function(){var e;return Kd(e=Hp(this._pairs)).call(e,(function(e){return e[1]}))}},{key:`toEntryArray`,value:function(){return Hp(this._pairs)}},{key:`toObjectMap`,value:function(){var e,t=hh(null),n=YT(this._pairs);try{for(n.s();!(e=n.n()).done;){var r=Vp(e.value,2),i=r[0];t[i]=r[1]}}catch(e){n.e(e)}finally{n.f()}return t}},{key:`toMap`,value:function(){return new Cw(this._pairs)}},{key:`toIdSet`,value:function(){return new qT(this.toIdArray())}},{key:`toItemSet`,value:function(){return new qT(this.toItemArray())}},{key:`cache`,value:function(){return new n(Hp(this._pairs))}},{key:`distinct`,value:function(e){var t,n=new qT,r=YT(this._pairs);try{for(r.s();!(t=r.n()).done;){var i=Vp(t.value,2),a=i[0],o=i[1];n.add(e(o,a))}}catch(e){r.e(e)}finally{r.f()}return n}},{key:`filter`,value:function(e){var t=this._pairs;return new n({[kT]:()=>vC.mark((function n(){var r,i,a,o,s;return vC.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=YT(t),n.prev=1,r.s();case 3:if((i=r.n()).done){n.next=10;break}if(a=Vp(i.value,2),o=a[0],s=a[1],!e(s,o)){n.next=8;break}return n.next=8,[o,s];case 8:n.next=3;break;case 10:n.next=15;break;case 12:n.prev=12,n.t0=n.catch(1),r.e(n.t0);case 15:return n.prev=15,r.f(),n.finish(15);case 18:case`end`:return n.stop()}}),n,null,[[1,12,15,18]])}))()})}},{key:`forEach`,value:function(e){var t,n=YT(this._pairs);try{for(n.s();!(t=n.n()).done;){var r=Vp(t.value,2),i=r[0];e(r[1],i)}}catch(e){n.e(e)}finally{n.f()}}},{key:`map`,value:function(e){var t=this._pairs;return new n({[kT]:()=>vC.mark((function n(){var r,i,a,o,s;return vC.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=YT(t),n.prev=1,r.s();case 3:if((i=r.n()).done){n.next=9;break}return a=Vp(i.value,2),o=a[0],s=a[1],n.next=7,[o,e(s,o)];case 7:n.next=3;break;case 9:n.next=14;break;case 11:n.prev=11,n.t0=n.catch(1),r.e(n.t0);case 14:return n.prev=14,r.f(),n.finish(14);case 17:case`end`:return n.stop()}}),n,null,[[1,11,14,17]])}))()})}},{key:`max`,value:function(e){var t=JT(this._pairs),n=t.next();if(n.done)return null;for(var r=n.value[1],i=e(n.value[1],n.value[0]);!(n=t.next()).done;){var a=Vp(n.value,2),o=a[0],s=a[1],c=e(s,o);c>i&&(i=c,r=s)}return r}},{key:`min`,value:function(e){var t=JT(this._pairs),n=t.next();if(n.done)return null;for(var r=n.value[1],i=e(n.value[1],n.value[0]);!(n=t.next()).done;){var a=Vp(n.value,2),o=a[0],s=a[1],c=e(s,o);c<i&&(i=c,r=s)}return r}},{key:`reduce`,value:function(e,t){var n,r=YT(this._pairs);try{for(r.s();!(n=r.n()).done;){var i=Vp(n.value,2),a=i[0];t=e(t,i[1],a)}}catch(e){r.e(e)}finally{r.f()}return t}},{key:`sort`,value:function(e){var t=this;return new n({[kT]:function(){var n;return JT(bT(n=Hp(t._pairs)).call(n,(function(t,n){var r=Vp(t,2),i=r[0],a=r[1],o=Vp(n,2),s=o[0],c=o[1];return e(a,c,i,s)})))}})}}]),n}(kT);function QT(e,t){var n=om(e);if(lv){var r=lv(e);t&&(r=Bd(r).call(r,(function(t){return vv(e,t).enumerable}))),n.push.apply(n,r)}return n}function $T(e){for(var t=1;t<arguments.length;t++){var n,r,i=arguments[t]==null?{}:arguments[t];t%2?_m(n=QT(Object(i),!0)).call(n,(function(t){Zu(e,t,i[t])})):Cv?Av(e,Cv(i)):_m(r=QT(Object(i))).call(r,(function(t){jv(e,t,vv(i,t))}))}return e}function eE(e,t){var n=Up!==void 0&&$f(e)||e[`@@iterator`];if(!n){if(rm(e)||(n=function(e,t){var n;if(e){if(typeof e==`string`)return tE(e,t);var r=Yp(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return Xf(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tE(e,t)}}(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
48
48
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function tE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nE(e){var t=function(){if(typeof Reflect>`u`||!cv||cv.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(cv(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=Hv(e);if(t){var i=Hv(this).constructor;n=cv(r,arguments,i)}else n=r.apply(this,arguments);return zv(this,n)}}var rE=function(e){Rv(r,e);var n=nE(r);function r(e,i){var a;return t(this,r),Zu(U(a=n.call(this)),`_queue`,null),e&&!rm(e)&&(i=e,e=[]),a._options=i||{},a._data=new Cw,a.length=0,a._idProp=a._options.fieldId||`id`,e&&e.length&&a.add(e),a.setOptions(i),a}return Xu(r,[{key:`idProp`,get:function(){return this._idProp}},{key:`setOptions`,value:function(e){e&&e.queue!==void 0&&(!1===e.queue?this._queue&&=(this._queue.destroy(),null):(this._queue||=GT.extend(this,{replace:[`add`,`update`,`remove`]}),e.queue&&typeof e.queue==`object`&&this._queue.setOptions(e.queue)))}},{key:`add`,value:function(e,t){var n,r=this,i=[];if(rm(e)){var a=Kd(e).call(e,(function(e){return e[r._idProp]}));if(kw(a).call(a,(function(e){return r._data.has(e)})))throw Error(`A duplicate id was found in the parameter array.`);for(var o=0,s=e.length;o<s;o++)n=this._addItem(e[o]),i.push(n)}else{if(!e||typeof e!=`object`)throw Error(`Unknown dataType`);n=this._addItem(e),i.push(n)}return i.length&&this._trigger(`add`,{items:i},t),i}},{key:`update`,value:function(e,t){var n=this,r=[],i=[],a=[],o=[],s=this._idProp,c=function(e){var t=e[s];if(t!=null&&n._data.has(t)){var c=e,l=ch({},n._data.get(t)),u=n._updateItem(c);i.push(u),o.push(c),a.push(l)}else{var d=n._addItem(e);r.push(d)}};if(rm(e))for(var l=0,u=e.length;l<u;l++)e[l]&&typeof e[l]==`object`?c(e[l]):console.warn(`Ignoring input item, which is not an object at index `+l);else{if(!e||typeof e!=`object`)throw Error(`Unknown dataType`);c(e)}if(r.length&&this._trigger(`add`,{items:r},t),i.length){var d={items:i,oldData:a,data:o};this._trigger(`update`,d,t)}return Jp(r).call(r,i)}},{key:`updateOnly`,value:function(e,t){var n,r=this;rm(e)||(e=[e]);var i=Kd(n=Kd(e).call(e,(function(e){var t=r._data.get(e[r._idProp]);if(t==null)throw Error(`Updating non-existent items is not allowed.`);return{oldData:t,update:e}}))).call(n,(function(e){var t=e.oldData,n=e.update,i=t[r._idProp],a=function(e){for(var t,n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return R_.apply(void 0,Jp(t=[{},e]).call(t,r))}(t,n);return r._data.set(i,a),{id:i,oldData:t,updatedData:a}}));if(i.length){var a={items:Kd(i).call(i,(function(e){return e.id})),oldData:Kd(i).call(i,(function(e){return e.oldData})),data:Kd(i).call(i,(function(e){return e.updatedData}))};return this._trigger(`update`,a,t),a.items}return[]}},{key:`get`,value:function(e,t){var n=void 0,r=void 0,i=void 0;WT(e)?(n=e,i=t):rm(e)?(r=e,i=t):i=e;var a=i&&i.returnType===`Object`?`Object`:`Array`,o=i&&Bd(i),s=[],c=void 0,l=void 0,u=void 0;if(n!=null)(c=this._data.get(n))&&o&&!o(c)&&(c=void 0);else if(r!=null)for(var d=0,f=r.length;d<f;d++)(c=this._data.get(r[d]))==null||o&&!o(c)||s.push(c);else for(var p,m=0,h=(l=Hp(Lw(p=this._data).call(p))).length;m<h;m++)u=l[m],(c=this._data.get(u))==null||o&&!o(c)||s.push(c);if(i&&i.order&&n==null&&this._sort(s,i.order),i&&i.fields){var g=i.fields;if(n!=null&&c!=null)c=this._filterFields(c,g);else for(var _=0,v=s.length;_<v;_++)s[_]=this._filterFields(s[_],g)}if(a==`Object`){for(var y={},b=0,x=s.length;b<x;b++){var S=s[b];y[S[this._idProp]]=S}return y}return n==null?s:c??null}},{key:`getIds`,value:function(e){var t=this._data,n=e&&Bd(e),r=e&&e.order,i=Hp(Lw(t).call(t)),a=[];if(n)if(r){for(var o=[],s=0,c=i.length;s<c;s++){var l=i[s],u=this._data.get(l);u!=null&&n(u)&&o.push(u)}this._sort(o,r);for(var d=0,f=o.length;d<f;d++)a.push(o[d][this._idProp])}else for(var p=0,m=i.length;p<m;p++){var h=i[p],g=this._data.get(h);g!=null&&n(g)&&a.push(g[this._idProp])}else if(r){for(var _=[],v=0,y=i.length;v<y;v++){var b=i[v];_.push(t.get(b))}this._sort(_,r);for(var x=0,S=_.length;x<S;x++)a.push(_[x][this._idProp])}else for(var ee=0,C=i.length;ee<C;ee++){var te=i[ee],ne=t.get(te);ne!=null&&a.push(ne[this._idProp])}return a}},{key:`getDataSet`,value:function(){return this}},{key:`forEach`,value:function(e,t){var n=t&&Bd(t),r=this._data,i=Hp(Lw(r).call(r));if(t&&t.order)for(var a=this.get(t),o=0,s=a.length;o<s;o++){var c=a[o];e(c,c[this._idProp])}else for(var l=0,u=i.length;l<u;l++){var d=i[l],f=this._data.get(d);f==null||n&&!n(f)||e(f,d)}}},{key:`map`,value:function(e,t){for(var n=t&&Bd(t),r=[],i=this._data,a=Hp(Lw(i).call(i)),o=0,s=a.length;o<s;o++){var c=a[o],l=this._data.get(c);l==null||n&&!n(l)||r.push(e(l,c))}return t&&t.order&&this._sort(r,t.order),r}},{key:`_filterFields`,value:function(e,t){var n;return e&&Pd(n=rm(t)?t:om(t)).call(n,(function(t,n){return t[n]=e[n],t}),{})}},{key:`_sort`,value:function(e,t){if(typeof t==`string`){var n=t;bT(e).call(e,(function(e,t){var r=e[n],i=t[n];return r>i?1:r<i?-1:0}))}else{if(typeof t!=`function`)throw TypeError(`Order must be a function or a string`);bT(e).call(e,t)}}},{key:`remove`,value:function(e,t){for(var n=[],r=[],i=rm(e)?e:[e],a=0,o=i.length;a<o;a++){var s=this._remove(i[a]);if(s){var c=s[this._idProp];c!=null&&(n.push(c),r.push(s))}}return n.length&&this._trigger(`remove`,{items:n,oldData:r},t),n}},{key:`_remove`,value:function(e){var t;if(WT(e)?t=e:e&&typeof e==`object`&&(t=e[this._idProp]),t!=null&&this._data.has(t)){var n=this._data.get(t)||null;return this._data.delete(t),--this.length,n}return null}},{key:`clear`,value:function(e){for(var t,n=Hp(Lw(t=this._data).call(t)),r=[],i=0,a=n.length;i<a;i++)r.push(this._data.get(n[i]));return this._data.clear(),this.length=0,this._trigger(`remove`,{items:n,oldData:r},e),n}},{key:`max`,value:function(e){var t,n,r=null,i=null,a=eE(OT(t=this._data).call(t));try{for(a.s();!(n=a.n()).done;){var o=n.value,s=o[e];typeof s==`number`&&(i==null||s>i)&&(r=o,i=s)}}catch(e){a.e(e)}finally{a.f()}return r||null}},{key:`min`,value:function(e){var t,n,r=null,i=null,a=eE(OT(t=this._data).call(t));try{for(a.s();!(n=a.n()).done;){var o=n.value,s=o[e];typeof s==`number`&&(i==null||s<i)&&(r=o,i=s)}}catch(e){a.e(e)}finally{a.f()}return r||null}},{key:`distinct`,value:function(e){for(var t=this._data,n=Hp(Lw(t).call(t)),r=[],i=0,a=0,o=n.length;a<o;a++){for(var s=n[a],c=t.get(s)[e],l=!1,u=0;u<i;u++)if(r[u]==c){l=!0;break}l||c===void 0||(r[i]=c,i++)}return r}},{key:`_addItem`,value:function(e){var t=function(e,t){return e[t]??(e[t]=UT()),e}(e,this._idProp),n=t[this._idProp];if(this._data.has(n))throw Error(`Cannot add item: item with id `+n+` already exists`);return this._data.set(n,t),++this.length,n}},{key:`_updateItem`,value:function(e){var t=e[this._idProp];if(t==null)throw Error(`Cannot update item: item has no id (item: `+vh(e)+`)`);var n=this._data.get(t);if(!n)throw Error(`Cannot update item: no item with id `+t+` found`);return this._data.set(t,$T($T({},n),e)),t}},{key:`stream`,value:function(e){if(e){var t=this._data;return new ZT({[kT]:()=>vC.mark((function n(){var r,i,a,o;return vC.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=eE(e),n.prev=1,r.s();case 3:if((i=r.n()).done){n.next=11;break}if(a=i.value,(o=t.get(a))==null){n.next=9;break}return n.next=9,[a,o];case 9:n.next=3;break;case 11:n.next=16;break;case 13:n.prev=13,n.t0=n.catch(1),r.e(n.t0);case 16:return n.prev=16,r.f(),n.finish(16);case 19:case`end`:return n.stop()}}),n,null,[[1,13,16,19]])}))()})}var n;return new ZT({[kT]:vd(n=LT(this._data)).call(n,this._data)})}}]),r}(KT);function iE(e,t){var n=Up!==void 0&&$f(e)||e[`@@iterator`];if(!n){if(rm(e)||(n=function(e,t){var n;if(e){if(typeof e==`string`)return aE(e,t);var r=Yp(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return Xf(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return aE(e,t)}}(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
49
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function aE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oE(e){var t=function(){if(typeof Reflect>`u`||!cv||cv.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(cv(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=Hv(e);if(t){var i=Hv(this).constructor;n=cv(r,arguments,i)}else n=r.apply(this,arguments);return zv(this,n)}}var sE=function(e){Rv(r,e);var n=oE(r);function r(e,i){var a,o;return t(this,r),Zu(U(o=n.call(this)),`length`,0),Zu(U(o),`_ids`,new qT),o._options=i||{},o._listener=vd(a=o._onEvent).call(a,U(o)),o.setData(e),o}return Xu(r,[{key:`idProp`,get:function(){return this.getDataSet().idProp}},{key:`setData`,value:function(e){if(this._data){this._data.off&&this._data.off(`*`,this._listener);var t=this._data.getIds({filter:Bd(this._options)}),n=this._data.get(t);this._ids.clear(),this.length=0,this._trigger(`remove`,{items:t,oldData:n})}if(e!=null){this._data=e;for(var r=this._data.getIds({filter:Bd(this._options)}),i=0,a=r.length;i<a;i++){var o=r[i];this._ids.add(o)}this.length=r.length,this._trigger(`add`,{items:r})}else this._data=new rE;this._data.on&&this._data.on(`*`,this._listener)}},{key:`refresh`,value:function(){for(var e=this._data.getIds({filter:Bd(this._options)}),t=Hp(this._ids),n={},r=[],i=[],a=[],o=0,s=e.length;o<s;o++){var c=e[o];n[c]=!0,this._ids.has(c)||(r.push(c),this._ids.add(c))}for(var l=0,u=t.length;l<u;l++){var d=t[l],f=this._data.get(d);f==null?console.error(`If you see this, report it please.`):n[d]||(i.push(d),a.push(f),this._ids.delete(d))}this.length+=r.length-i.length,r.length&&this._trigger(`add`,{items:r}),i.length&&this._trigger(`remove`,{items:i,oldData:a})}},{key:`get`,value:function(e,t){if(this._data==null)return null;var n,r=null;WT(e)||rm(e)?(r=e,n=t):n=e;var i=ch({},this._options,n),a=Bd(this._options),o=n&&Bd(n);return a&&o&&(i.filter=function(e){return a(e)&&o(e)}),r==null?this._data.get(i):this._data.get(r,i)}},{key:`getIds`,value:function(e){if(this._data.length){var t,n=Bd(this._options),r=e==null?null:Bd(e);return t=r?n?function(e){return n(e)&&r(e)}:r:n,this._data.getIds({filter:t,order:e&&e.order})}return[]}},{key:`forEach`,value:function(e,t){if(this._data){var n,r,i=Bd(this._options),a=t&&Bd(t);r=a?i?function(e){return i(e)&&a(e)}:a:i,_m(n=this._data).call(n,e,{filter:r,order:t&&t.order})}}},{key:`map`,value:function(e,t){if(this._data){var n,r,i=Bd(this._options),a=t&&Bd(t);return r=a?i?function(e){return i(e)&&a(e)}:a:i,Kd(n=this._data).call(n,e,{filter:r,order:t&&t.order})}return[]}},{key:`getDataSet`,value:function(){return this._data.getDataSet()}},{key:`stream`,value:function(e){var t;return this._data.stream(e||{[kT]:vd(t=Lw(this._ids)).call(t,this._ids)})}},{key:`dispose`,value:function(){var e;(e=this._data)!=null&&e.off&&this._data.off(`*`,this._listener);var t,n=`This data view has already been disposed of.`,i={get:function(){throw Error(n)},set:function(){throw Error(n)},configurable:!1},a=iE(nm(r.prototype));try{for(a.s();!(t=a.n()).done;){var o=t.value;jv(this,o,i)}}catch(e){a.e(e)}finally{a.f()}}},{key:`_onEvent`,value:function(e,t,n){if(t&&t.items&&this._data){var r=t.items,i=[],a=[],o=[],s=[],c=[],l=[];switch(e){case`add`:for(var u=0,d=r.length;u<d;u++){var f=r[u];this.get(f)&&(this._ids.add(f),i.push(f))}break;case`update`:for(var p=0,m=r.length;p<m;p++){var h=r[p];this.get(h)?this._ids.has(h)?(a.push(h),c.push(t.data[p]),s.push(t.oldData[p])):(this._ids.add(h),i.push(h)):this._ids.has(h)&&(this._ids.delete(h),o.push(h),l.push(t.oldData[p]))}break;case`remove`:for(var g=0,_=r.length;g<_;g++){var v=r[g];this._ids.has(v)&&(this._ids.delete(v),o.push(v),l.push(t.oldData[g]))}}this.length+=i.length-o.length,i.length&&this._trigger(`add`,{items:i},n),a.length&&this._trigger(`update`,{items:a,oldData:s,data:c},n),o.length&&this._trigger(`remove`,{items:o,oldData:l},n)}}}]),r}(KT);function cE(e,t){return typeof t==`object`&&!!t&&e===t.idProp&&typeof t.add==`function`&&typeof t.clear==`function`&&typeof t.distinct==`function`&&typeof _m(t)==`function`&&typeof t.get==`function`&&typeof t.getDataSet==`function`&&typeof t.getIds==`function`&&typeof t.length==`number`&&typeof Kd(t)==`function`&&typeof t.max==`function`&&typeof t.min==`function`&&typeof t.off==`function`&&typeof t.on==`function`&&typeof t.remove==`function`&&typeof t.setOptions==`function`&&typeof t.stream==`function`&&typeof t.update==`function`&&typeof t.updateOnly==`function`}e.DELETE=L_,e.DataSet=rE,e.DataStream=ZT,e.DataView=sE,e.Queue=GT,e.createNewDataPipeFrom=function(e){return new uf(e)},e.isDataSetLike=cE,e.isDataViewLike=function(e,t){return typeof t==`object`&&!!t&&e===t.idProp&&typeof _m(t)==`function`&&typeof t.get==`function`&&typeof t.getDataSet==`function`&&typeof t.getIds==`function`&&typeof t.length==`number`&&typeof Kd(t)==`function`&&typeof t.off==`function`&&typeof t.on==`function`&&typeof t.stream==`function`&&cE(e,t.getDataSet())}}))})),C={LocalBusiness:`#4F6B8A`,Service:`#6B85A0`,PriceSpecification:`#8AA0B8`,OpeningHoursSpecification:`#A8BACE`,Organization:`#8A6B47`,Person:`#B86E4A`,UserProfile:`#D08960`,Preference:`#DFA67A`,AdminUser:`#8C5230`,AccessGrant:`#66381F`,KnowledgeDocument:`#6E8A5A`,ConversationArchive:`#82A06A`,Section:`#8AA876`,Chunk:`#A6C194`,DigitalDocument:`#5A7548`,CreativeWork:`#B5C9A2`,Question:`#C7D6B5`,FAQPage:`#95B385`,DefinedTerm:`#76906A`,Review:`#3F5A2E`,ImageObject:`#A0BB8C`,Conversation:`#6B5A85`,AdminConversation:`#4F4070`,PublicConversation:`#8A75A8`,Message:`#6B7280`,UserMessage:`#DFA67A`,AssistantMessage:`#C9A876`,ToolCall:`#B5ABCB`,Task:`#B0617A`,Project:`#8E4A60`,Event:`#C68095`,Workflow:`#3A6F77`,WorkflowStep:`#5A8E96`,WorkflowRun:`#7AAAB2`,StepResult:`#9CC4CB`,OnboardingState:`#7A5A8A`,Email:`#6F7F4A`,EmailAccount:`#91A063`,Agent:`#B8893D`},te=`#94A3B8`;Object.freeze(Object.keys(C)),Object.freeze(new Set([`Chunk`,`GraphPreference`])),Object.freeze(new Set(`LocalBusiness.Service.PriceSpecification.OpeningHoursSpecification.Organization.Person.UserProfile.Preference.AdminUser.AccessGrant.KnowledgeDocument.DigitalDocument.CreativeWork.Question.FAQPage.DefinedTerm.Review.ImageObject.AdminConversation.PublicConversation.Task.Project.Event.Workflow.OnboardingState.Email.EmailAccount.Agent`.split(`.`))),Object.freeze(new Set([`ToolCall`,`StepResult`,`WorkflowStep`,`WorkflowRun`])),Object.freeze(new Set([`HAS_TOOL_CALL`,`RUN_OF`,`HAS_STEP`,`HAS_RESULT`]));function ne(e){for(let t=1;t<e.length;t++)if(Object.prototype.hasOwnProperty.call(C,e[t]))return e[t];return e[0]??null}function re(e){return C[e]??`#94A3B8`}function w(e){let t=ne(e),n=t?re(t):te,r=0;for(let t=1;t<e.length;t++)Object.prototype.hasOwnProperty.call(C,e[t])&&r++;return{displayLabel:t,colour:n,driftCandidates:r}}function T(e,t){return e.length<10?[...e,t]:[e[0],...e.slice(e.length-8),t]}function E(e){return e.length<=1?e:e.slice(0,-1)}function D(e){return[e]}function O(e){let t=e[e.length-1];return t.kind===`filter`?`f:${[...t.selectedLabels].sort().join(`,`)}:${t.includeTrashed?1:0}:${t.includeAgentActions?1:0}`:`n:${t.rootElementId}`}function ie(e){let t=e[0];if(t.kind!==`filter`)throw Error(`view-stack invariant: root must be filter view`);return t}function k(e){return e.trashed===!0?`skip-trashed`:`pivot`}function A(e,t,n,r){let i=[],a=[];for(let o of e){let e=t.get(o.nodeId);if(!e)continue;a.push(o.nodeId);let{colour:s}=n(e.labels),c=e.trashed?`${s}40`:s;i.push({id:o.nodeId,borderWidth:3,color:{background:c,border:r}})}return{updates:i,inWindow:a}}function ae(e,t){let n=t.length>0?new Set(t):null,r=new Map,i=new Set,a=[];for(let t of e)n&&!t.labels.some(e=>n.has(e))||r.set(t.nodeId,{id:t.nodeId,labels:t.labels,properties:t.properties});for(let t of e)if(r.has(t.nodeId))for(let e of t.related){if(n&&!e.labels.some(e=>n.has(e)))continue;r.has(e.nodeId)||r.set(e.nodeId,{id:e.nodeId,labels:e.labels,properties:e.properties});let[o,s]=e.direction===`outgoing`?[t.nodeId,e.nodeId]:[e.nodeId,t.nodeId],c=`${o}|${s}|${e.relationship}`;i.has(c)||(i.add(c),a.push({id:c,from:o,to:s,type:e.relationship}))}return{nodes:[...r.values()],edges:a}}var oe=2e3;function se(e){let t=typeof e==`number`?e:Number(e);return!Number.isFinite(t)||t<=0?100:Math.min(Math.max(Math.floor(t),1),oe)}var ce=new Set([`Conversation`,`AdminConversation`,`PublicConversation`]),le=/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2})/,ue=/^\d{4}-\d{2}-\d{2}T(\d{2}:\d{2}:\d{2})/,de=/^(\d{4}-\d{2}-\d{2})T/,fe=24;function pe(e){let t=e.match(le);return t?`${t[1]} ${t[2]}`:null}function me(e){let t=e.match(ue);return t?t[1]:null}function he(e){let t=e.match(de);return t?t[1]:null}function ge(e){let t=e.properties,n=e.labels[0];if(n===`ToolCall`){let e=t.toolName;if(typeof e==`string`&&e.length>0)return e.length>24?e.slice(0,24)+`…`:e}else if(n===`WorkflowRun`){let e=t.startedAt;if(typeof e==`string`&&e.length>0){let t=pe(e);if(t)return t}}else if(n===`WorkflowStep`){let e=t.label;if(typeof e==`string`&&e.length>0)return e.length>24?e.slice(0,24)+`…`:e}else if(n===`Person`){let e=[typeof t.givenName==`string`?t.givenName:``,typeof t.familyName==`string`?t.familyName:``].filter(e=>e.length>0).join(` `);if(e.length>0)return e.length>24?e.slice(0,24)+`…`:e}else if(n===`Agent`){let e=typeof t.displayName==`string`?t.displayName:``,n=typeof t.slug==`string`?t.slug:``,r=e.length>0?e:n;if(r.length>0)return r.length>24?r.slice(0,24)+`…`:r}else if(n===`Message`){let e=typeof t.role==`string`?t.role:``,n=e===`user`?`user`:e===`assistant`?`asst`:e===`system`?`sys`:e===`tool`?`tool`:null,r=typeof t.createdAt==`string`?t.createdAt:``;if(n&&r){let e=me(r);if(e)return`${n} ${e}`}}for(let e of[`name`,`title`,`summary`,`givenName`,`subject`,`text`]){let n=t[e];if(typeof n==`string`&&n.length>0)return n.length>24?n.slice(0,24)+`…`:n}if(n===`Conversation`){let e=typeof t.conversationId==`string`?t.conversationId:null;if(e)return`Conv ${e.slice(0,8)}`}return n??`…`}function _e(e){let t=e.properties,n=e.labels[0];if(n===`ToolCall`){let e=t.toolName;if(typeof e==`string`&&e.length>0)return e}else if(n===`WorkflowRun`){let e=t.startedAt;if(typeof e==`string`&&e.length>0){let t=pe(e);if(t)return t}}else if(n===`WorkflowStep`){let e=t.label;if(typeof e==`string`&&e.length>0)return e}else if(n===`Person`){let e=[typeof t.givenName==`string`?t.givenName:``,typeof t.familyName==`string`?t.familyName:``].filter(e=>e.length>0).join(` `);if(e.length>0)return e}else if(n===`Agent`){let e=typeof t.displayName==`string`?t.displayName:``,n=typeof t.slug==`string`?t.slug:``,r=e.length>0?e:n;if(r.length>0)return r}for(let e of[`name`,`title`,`summary`,`givenName`,`subject`,`text`]){let n=t[e];if(typeof n==`string`&&n.length>0)return n}if(n===`Conversation`){let e=typeof t.conversationId==`string`?t.conversationId:null;if(e)return`Conv ${e.slice(0,8)}`}return n??`…`}function ve(e){if(e.length===0)return``;let t=e.split(/\s+/).filter(e=>e.length>0);if(t.length===0)return``;if(t.length===1){let e=t[0];return e.length<=fe?e:e.slice(0,fe-1)+`…`}let n=``,r=0;for(;r<t.length;){let e=n.length===0?t[r]:`${n} ${t[r]}`;if(e.length<=fe)n=e,r++;else break}if(n.length===0)return n=t[0].slice(0,fe-1)+`…`,n;if(r>=t.length)return n;let i=``;for(;r<t.length;){let e=i.length===0?t[r]:`${i} ${t[r]}`;if(e.length<=fe)i=e,r++;else break}if(r<t.length){let e=t.slice(r).join(` `);i=(i.length===0?e:`${i} ${e}`).slice(0,fe-1)+`…`}return`${n}\n${i}`}function ye(e,t){let n=e.labels[0];if(!n||!ce.has(n)||t<.7)return ge(e);let r=ve(_e(e));if(t<1.3)return r;let i=e.properties,a=typeof i.createdAt==`string`?i.createdAt:``,o=typeof i.messageCount==`number`?i.messageCount:null;if(a.length===0||o===null)return r;let s=he(a);return s===null?r:`${r}\n${s} · ${o} msgs`}function be(e){let t=e.properties,n=typeof t.createdAt==`string`?t.createdAt:``,r=typeof t.updatedAt==`string`?t.updatedAt:``,i=e.labels.join(` · `);return[_e(e),i,`id: ${e.id}`,n?`createdAt: ${n}`:``,r?`updatedAt: ${r}`:``].filter(e=>e.length>0).join(`
|
|
49
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function aE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oE(e){var t=function(){if(typeof Reflect>`u`||!cv||cv.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(cv(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=Hv(e);if(t){var i=Hv(this).constructor;n=cv(r,arguments,i)}else n=r.apply(this,arguments);return zv(this,n)}}var sE=function(e){Rv(r,e);var n=oE(r);function r(e,i){var a,o;return t(this,r),Zu(U(o=n.call(this)),`length`,0),Zu(U(o),`_ids`,new qT),o._options=i||{},o._listener=vd(a=o._onEvent).call(a,U(o)),o.setData(e),o}return Xu(r,[{key:`idProp`,get:function(){return this.getDataSet().idProp}},{key:`setData`,value:function(e){if(this._data){this._data.off&&this._data.off(`*`,this._listener);var t=this._data.getIds({filter:Bd(this._options)}),n=this._data.get(t);this._ids.clear(),this.length=0,this._trigger(`remove`,{items:t,oldData:n})}if(e!=null){this._data=e;for(var r=this._data.getIds({filter:Bd(this._options)}),i=0,a=r.length;i<a;i++){var o=r[i];this._ids.add(o)}this.length=r.length,this._trigger(`add`,{items:r})}else this._data=new rE;this._data.on&&this._data.on(`*`,this._listener)}},{key:`refresh`,value:function(){for(var e=this._data.getIds({filter:Bd(this._options)}),t=Hp(this._ids),n={},r=[],i=[],a=[],o=0,s=e.length;o<s;o++){var c=e[o];n[c]=!0,this._ids.has(c)||(r.push(c),this._ids.add(c))}for(var l=0,u=t.length;l<u;l++){var d=t[l],f=this._data.get(d);f==null?console.error(`If you see this, report it please.`):n[d]||(i.push(d),a.push(f),this._ids.delete(d))}this.length+=r.length-i.length,r.length&&this._trigger(`add`,{items:r}),i.length&&this._trigger(`remove`,{items:i,oldData:a})}},{key:`get`,value:function(e,t){if(this._data==null)return null;var n,r=null;WT(e)||rm(e)?(r=e,n=t):n=e;var i=ch({},this._options,n),a=Bd(this._options),o=n&&Bd(n);return a&&o&&(i.filter=function(e){return a(e)&&o(e)}),r==null?this._data.get(i):this._data.get(r,i)}},{key:`getIds`,value:function(e){if(this._data.length){var t,n=Bd(this._options),r=e==null?null:Bd(e);return t=r?n?function(e){return n(e)&&r(e)}:r:n,this._data.getIds({filter:t,order:e&&e.order})}return[]}},{key:`forEach`,value:function(e,t){if(this._data){var n,r,i=Bd(this._options),a=t&&Bd(t);r=a?i?function(e){return i(e)&&a(e)}:a:i,_m(n=this._data).call(n,e,{filter:r,order:t&&t.order})}}},{key:`map`,value:function(e,t){if(this._data){var n,r,i=Bd(this._options),a=t&&Bd(t);return r=a?i?function(e){return i(e)&&a(e)}:a:i,Kd(n=this._data).call(n,e,{filter:r,order:t&&t.order})}return[]}},{key:`getDataSet`,value:function(){return this._data.getDataSet()}},{key:`stream`,value:function(e){var t;return this._data.stream(e||{[kT]:vd(t=Lw(this._ids)).call(t,this._ids)})}},{key:`dispose`,value:function(){var e;(e=this._data)!=null&&e.off&&this._data.off(`*`,this._listener);var t,n=`This data view has already been disposed of.`,i={get:function(){throw Error(n)},set:function(){throw Error(n)},configurable:!1},a=iE(nm(r.prototype));try{for(a.s();!(t=a.n()).done;){var o=t.value;jv(this,o,i)}}catch(e){a.e(e)}finally{a.f()}}},{key:`_onEvent`,value:function(e,t,n){if(t&&t.items&&this._data){var r=t.items,i=[],a=[],o=[],s=[],c=[],l=[];switch(e){case`add`:for(var u=0,d=r.length;u<d;u++){var f=r[u];this.get(f)&&(this._ids.add(f),i.push(f))}break;case`update`:for(var p=0,m=r.length;p<m;p++){var h=r[p];this.get(h)?this._ids.has(h)?(a.push(h),c.push(t.data[p]),s.push(t.oldData[p])):(this._ids.add(h),i.push(h)):this._ids.has(h)&&(this._ids.delete(h),o.push(h),l.push(t.oldData[p]))}break;case`remove`:for(var g=0,_=r.length;g<_;g++){var v=r[g];this._ids.has(v)&&(this._ids.delete(v),o.push(v),l.push(t.oldData[g]))}}this.length+=i.length-o.length,i.length&&this._trigger(`add`,{items:i},n),a.length&&this._trigger(`update`,{items:a,oldData:s,data:c},n),o.length&&this._trigger(`remove`,{items:o,oldData:l},n)}}}]),r}(KT);function cE(e,t){return typeof t==`object`&&!!t&&e===t.idProp&&typeof t.add==`function`&&typeof t.clear==`function`&&typeof t.distinct==`function`&&typeof _m(t)==`function`&&typeof t.get==`function`&&typeof t.getDataSet==`function`&&typeof t.getIds==`function`&&typeof t.length==`number`&&typeof Kd(t)==`function`&&typeof t.max==`function`&&typeof t.min==`function`&&typeof t.off==`function`&&typeof t.on==`function`&&typeof t.remove==`function`&&typeof t.setOptions==`function`&&typeof t.stream==`function`&&typeof t.update==`function`&&typeof t.updateOnly==`function`}e.DELETE=L_,e.DataSet=rE,e.DataStream=ZT,e.DataView=sE,e.Queue=GT,e.createNewDataPipeFrom=function(e){return new uf(e)},e.isDataSetLike=cE,e.isDataViewLike=function(e,t){return typeof t==`object`&&!!t&&e===t.idProp&&typeof _m(t)==`function`&&typeof t.get==`function`&&typeof t.getDataSet==`function`&&typeof t.getIds==`function`&&typeof t.length==`number`&&typeof Kd(t)==`function`&&typeof t.off==`function`&&typeof t.on==`function`&&typeof t.stream==`function`&&cE(e,t.getDataSet())}}))})),C={LocalBusiness:`#4F6B8A`,Service:`#6B85A0`,PriceSpecification:`#8AA0B8`,OpeningHoursSpecification:`#A8BACE`,Organization:`#8A6B47`,Person:`#B86E4A`,UserProfile:`#D08960`,Preference:`#DFA67A`,AdminUser:`#8C5230`,AccessGrant:`#66381F`,KnowledgeDocument:`#6E8A5A`,ConversationArchive:`#82A06A`,Section:`#8AA876`,Chunk:`#A6C194`,DigitalDocument:`#5A7548`,CreativeWork:`#B5C9A2`,Question:`#C7D6B5`,FAQPage:`#95B385`,DefinedTerm:`#76906A`,Review:`#3F5A2E`,ImageObject:`#A0BB8C`,Conversation:`#6B5A85`,AdminConversation:`#4F4070`,PublicConversation:`#8A75A8`,Message:`#6B7280`,UserMessage:`#DFA67A`,AssistantMessage:`#C9A876`,ToolCall:`#B5ABCB`,Task:`#B0617A`,Project:`#8E4A60`,Event:`#C68095`,Workflow:`#3A6F77`,WorkflowStep:`#5A8E96`,WorkflowRun:`#7AAAB2`,StepResult:`#9CC4CB`,OnboardingState:`#7A5A8A`,Email:`#6F7F4A`,EmailAccount:`#91A063`,Agent:`#B8893D`},te=`#94A3B8`;Object.freeze(Object.keys(C)),Object.freeze(new Set([`Chunk`,`GraphPreference`])),Object.freeze(new Set(`LocalBusiness.Service.PriceSpecification.OpeningHoursSpecification.Organization.Person.UserProfile.Preference.AdminUser.AccessGrant.KnowledgeDocument.DigitalDocument.CreativeWork.Question.FAQPage.DefinedTerm.Review.ImageObject.AdminConversation.PublicConversation.Task.Project.Event.Workflow.OnboardingState.Email.EmailAccount.Agent`.split(`.`))),Object.freeze(new Set([`ToolCall`,`StepResult`,`WorkflowStep`,`WorkflowRun`])),Object.freeze(new Set([`HAS_TOOL_CALL`,`RUN_OF`,`HAS_STEP`,`HAS_RESULT`]));function ne(e){for(let t=1;t<e.length;t++)if(Object.prototype.hasOwnProperty.call(C,e[t]))return e[t];return e[0]??null}function re(e){return C[e]??`#94A3B8`}function w(e){let t=ne(e),n=t?re(t):te,r=0;for(let t=1;t<e.length;t++)Object.prototype.hasOwnProperty.call(C,e[t])&&r++;return{displayLabel:t,colour:n,driftCandidates:r}}function T(e,t){return e.length<10?[...e,t]:[e[0],...e.slice(e.length-8),t]}function E(e){return e.length<=1?e:e.slice(0,-1)}function D(e){return[e]}function O(e){let t=e[e.length-1];return t.kind===`filter`?`f:${[...t.selectedLabels].sort().join(`,`)}:${t.includeTrashed?1:0}:${t.includeAgentActions?1:0}`:`n:${t.rootElementId}`}function ie(e){let t=e[0];if(t.kind!==`filter`)throw Error(`view-stack invariant: root must be filter view`);return t}function k(e){return e.trashed===!0?`skip-trashed`:`pivot`}function A(e,t,n,r){let i=[],a=[];for(let o of e){let e=t.get(o.nodeId);if(!e)continue;a.push(o.nodeId);let{colour:s}=n(e.labels),c=e.trashed?`${s}40`:s;i.push({id:o.nodeId,borderWidth:3,color:{background:c,border:r}})}return{updates:i,inWindow:a}}function ae(e,t){let n=t.length>0?new Set(t):null,r=new Map,i=new Set,a=[];for(let t of e)n&&!t.labels.some(e=>n.has(e))||r.set(t.nodeId,{id:t.nodeId,labels:t.labels,properties:t.properties});for(let t of e)if(r.has(t.nodeId))for(let e of t.related){if(n&&!e.labels.some(e=>n.has(e)))continue;r.has(e.nodeId)||r.set(e.nodeId,{id:e.nodeId,labels:e.labels,properties:e.properties});let[o,s]=e.direction===`outgoing`?[t.nodeId,e.nodeId]:[e.nodeId,t.nodeId],c=`${o}|${s}|${e.relationship}`;i.has(c)||(i.add(c),a.push({id:c,from:o,to:s,type:e.relationship}))}return{nodes:[...r.values()],edges:a}}var oe=2e3;function se(e){let t=typeof e==`number`?e:Number(e);return!Number.isFinite(t)||t<=0?100:Math.min(Math.max(Math.floor(t),1),oe)}var ce=new Set([`Conversation`,`AdminConversation`,`PublicConversation`]),le=/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2})/,ue=/^\d{4}-\d{2}-\d{2}T(\d{2}:\d{2}:\d{2})/,de=/^(\d{4}-\d{2}-\d{2})T/,fe=24;function pe(e){let t=e.match(le);return t?`${t[1]} ${t[2]}`:null}function me(e){let t=e.match(ue);return t?t[1]:null}function he(e){let t=e.match(de);return t?t[1]:null}function ge(e){let t=e.properties,n=e.labels[0];if(n===`ToolCall`){let e=t.toolName;if(typeof e==`string`&&e.length>0)return e.length>24?e.slice(0,24)+`…`:e}else if(n===`WorkflowRun`){let e=t.startedAt;if(typeof e==`string`&&e.length>0){let t=pe(e);if(t)return t}}else if(n===`WorkflowStep`){let e=t.label;if(typeof e==`string`&&e.length>0)return e.length>24?e.slice(0,24)+`…`:e}else if(n===`Person`){let e=[typeof t.givenName==`string`?t.givenName:``,typeof t.familyName==`string`?t.familyName:``].filter(e=>e.length>0).join(` `);if(e.length>0)return e.length>24?e.slice(0,24)+`…`:e}else if(n===`Agent`){let e=typeof t.displayName==`string`?t.displayName:``,n=typeof t.slug==`string`?t.slug:``,r=e.length>0?e:n;if(r.length>0)return r.length>24?r.slice(0,24)+`…`:r}else if(n===`Message`){let e=typeof t.role==`string`?t.role:``,n=e===`user`?`user`:e===`assistant`?`asst`:e===`system`?`sys`:e===`tool`?`tool`:null,r=typeof t.createdAt==`string`?t.createdAt:``;if(n&&r){let e=me(r);if(e)return`${n} ${e}`}}else if(n===`ConversationArchive`){let e=typeof t.title==`string`?t.title:``;return e.length>0?e.length>24?e.slice(0,24)+`…`:e:n}for(let e of[`name`,`title`,`summary`,`givenName`,`subject`,`text`]){let n=t[e];if(typeof n==`string`&&n.length>0)return n.length>24?n.slice(0,24)+`…`:n}if(n===`Conversation`){let e=typeof t.conversationId==`string`?t.conversationId:null;if(e)return`Conv ${e.slice(0,8)}`}return n??`…`}function _e(e){let t=e.properties,n=e.labels[0];if(n===`ToolCall`){let e=t.toolName;if(typeof e==`string`&&e.length>0)return e}else if(n===`WorkflowRun`){let e=t.startedAt;if(typeof e==`string`&&e.length>0){let t=pe(e);if(t)return t}}else if(n===`WorkflowStep`){let e=t.label;if(typeof e==`string`&&e.length>0)return e}else if(n===`Person`){let e=[typeof t.givenName==`string`?t.givenName:``,typeof t.familyName==`string`?t.familyName:``].filter(e=>e.length>0).join(` `);if(e.length>0)return e}else if(n===`Agent`){let e=typeof t.displayName==`string`?t.displayName:``,n=typeof t.slug==`string`?t.slug:``,r=e.length>0?e:n;if(r.length>0)return r}else if(n===`ConversationArchive`){let e=typeof t.title==`string`?t.title:``;return e.length>0?e:n}for(let e of[`name`,`title`,`summary`,`givenName`,`subject`,`text`]){let n=t[e];if(typeof n==`string`&&n.length>0)return n}if(n===`Conversation`){let e=typeof t.conversationId==`string`?t.conversationId:null;if(e)return`Conv ${e.slice(0,8)}`}return n??`…`}function ve(e){if(e.length===0)return``;let t=e.split(/\s+/).filter(e=>e.length>0);if(t.length===0)return``;if(t.length===1){let e=t[0];return e.length<=fe?e:e.slice(0,fe-1)+`…`}let n=``,r=0;for(;r<t.length;){let e=n.length===0?t[r]:`${n} ${t[r]}`;if(e.length<=fe)n=e,r++;else break}if(n.length===0)return n=t[0].slice(0,fe-1)+`…`,n;if(r>=t.length)return n;let i=``;for(;r<t.length;){let e=i.length===0?t[r]:`${i} ${t[r]}`;if(e.length<=fe)i=e,r++;else break}if(r<t.length){let e=t.slice(r).join(` `);i=(i.length===0?e:`${i} ${e}`).slice(0,fe-1)+`…`}return`${n}\n${i}`}function ye(e,t){let n=e.labels[0];if(!n||!ce.has(n)||t<.7)return ge(e);let r=ve(_e(e));if(t<1.3)return r;let i=e.properties,a=typeof i.createdAt==`string`?i.createdAt:``,o=typeof i.messageCount==`number`?i.messageCount:null;if(a.length===0||o===null)return r;let s=he(a);return s===null?r:`${r}\n${s} · ${o} msgs`}function be(e){let t=e.properties,n=typeof t.createdAt==`string`?t.createdAt:``,r=typeof t.updatedAt==`string`?t.updatedAt:``,i=e.labels.join(` · `);return[_e(e),i,`id: ${e.id}`,n?`createdAt: ${n}`:``,r?`updatedAt: ${r}`:``].filter(e=>e.length>0).join(`
|
|
50
50
|
`)}var xe={solver:`barnesHut`,barnesHut:{gravitationalConstant:-2e3,centralGravity:.4,springLength:170,springConstant:.04},stabilization:{iterations:200}},Se=220,Ce=3;function j(e){let t=new Set(e.nodes.map(e=>e.id)),n=new Set;for(let r of e.edges)t.has(r.from)&&t.has(r.to)&&(n.add(r.from),n.add(r.to));let r=0;for(let t of e.nodes)n.has(t.id)||r++;if(!(e.nodes.length<=5||e.nodes.length>0&&r===e.nodes.length))return{physics:xe,nodePositions:new Map};let i=new Map,a=(Ce-1)*Se/2,o=(Math.ceil(e.nodes.length/Ce)-1)*Se/2;for(let t=0;t<e.nodes.length;t++){let n=t%Ce,r=Math.floor(t/Ce);i.set(e.nodes[t].id,{x:n*Se-a,y:r*Se-o})}return{physics:!1,nodePositions:i}}var M=e(r(),1),we=S(),Te=ee(),N=a();function Ee(e){return e<.7?`compact`:e<1.3?`wrapped`:`detailed`}var P=150,F=`#FBBF24`;function De(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}var Oe=`maxy-graph-search-limit-v1`,ke=250,Ae=1200;function je(){let[e,t]=(0,M.useState)(null),[n,r]=(0,M.useState)(!1),i=(0,M.useMemo)(()=>{if(typeof window>`u`)return null;let e=new URLSearchParams(window.location.search),t=e.get(`nodeId`);return t?{nodeId:t,nodeLabel:e.get(`label`)}:null},[]);return(0,M.useEffect)(()=>{i&&Re(`deep-link`,{nodeId:i.nodeId.length>16?i.nodeId.slice(0,16)+`…`:i.nodeId,label:i.nodeLabel??``})},[i]),(0,M.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!n){t(null),r(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(i=>{if(!e){if(i.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`;return}t(n),r(!0)}}).catch(()=>{e||(t(n),r(!0))}),()=>{e=!0}},[]),n?e?(0,N.jsxs)(`div`,{className:`data-page graph-page`,children:[(0,N.jsxs)(`header`,{className:`data-header`,children:[(0,N.jsxs)(`h1`,{className:`data-title`,children:[(0,N.jsx)(d,{size:18}),` Graph`]}),(0,N.jsx)(Me,{})]}),(0,N.jsx)(`main`,{className:`graph-main`,children:(0,N.jsx)(Ne,{sessionKey:e,initialFocus:i})})]}):(0,N.jsxs)(`div`,{className:`data-page`,children:[(0,N.jsx)(`header`,{className:`data-header`,children:(0,N.jsxs)(`h1`,{className:`data-title`,children:[(0,N.jsx)(d,{size:18}),` Graph`]})}),(0,N.jsxs)(`div`,{className:`data-empty`,children:[(0,N.jsx)(`p`,{children:`You are not signed in.`}),(0,N.jsxs)(`p`,{children:[`Open the `,(0,N.jsx)(`a`,{href:`/`,className:`data-link`,children:`main admin page`}),` and log in, then return here.`]})]})]}):(0,N.jsx)(`div`,{className:`data-page`,children:(0,N.jsxs)(`div`,{className:`data-loading`,children:[(0,N.jsx)(f,{size:18,className:`spin`}),` Loading…`]})})}function Me(){let[e,t]=(0,M.useState)(!1),n=(0,M.useRef)(null);(0,M.useEffect)(()=>{if(!e)return;let r=e=>{n.current&&(n.current.contains(e.target)||t(!1))},i=e=>{e.key===`Escape`&&t(!1)};return document.addEventListener(`mousedown`,r),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`mousedown`,r),document.removeEventListener(`keydown`,i)}},[e]);let r=(0,M.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]);return(0,N.jsxs)(`div`,{className:`chat-burger-wrap`,ref:n,children:[(0,N.jsx)(`button`,{type:`button`,className:`chat-burger`,onClick:()=>t(e=>!e),"aria-label":`Menu`,"aria-haspopup":`true`,"aria-expanded":e,children:(0,N.jsx)(o,{size:20})}),e&&(0,N.jsxs)(`div`,{className:`chat-menu`,children:[(0,N.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,onClick:()=>{t(!1),window.location.href=`/`},children:[(0,N.jsx)(s,{size:14}),` Chat`]}),(0,N.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,onClick:()=>{t(!1),window.location.href=`/data`},children:[(0,N.jsx)(l,{size:14}),` Data`]}),(0,N.jsx)(`div`,{className:`chat-menu-divider`}),(0,N.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,onClick:()=>{t(!1),r()},children:[(0,N.jsx)(u,{size:14}),` Log out`]})]})]})}function Ne({sessionKey:e,initialFocus:t=null,initialLabels:r=null}){let{adminFetch:i,sessionKey:a,sessionRefetchNonce:o,banner:s,reloadToLogin:l}=p({initialSessionKey:e,surface:`graph`}),u=(0,M.useRef)(null),d=(0,M.useRef)(null),v=(0,M.useRef)(null),x=(0,M.useRef)(null),S=(0,M.useRef)(new Map),ee=(0,M.useRef)([]),C=(0,M.useRef)(null),te=(0,M.useRef)(null),oe=(0,M.useRef)(null),le=(0,M.useRef)(null),ue=(0,M.useRef)(null),[de,fe]=(0,M.useState)([{kind:`filter`,selectedLabels:[],includeTrashed:!1,includeAgentActions:!1}]);(0,M.useEffect)(()=>{t?.nodeId&&fe(e=>{let n=e[e.length-1];return n.kind===`neighbourhood`&&n.rootElementId===t.nodeId?e:[e[0],{kind:`neighbourhood`,rootElementId:t.nodeId,rootLabel:t.nodeLabel}]})},[t?.nodeId,t?.nodeLabel]);let pe=r&&r.length>0?[...r].sort().join(`,`):null;(0,M.useEffect)(()=>{pe&&(xt.current=!0,fe([{kind:`filter`,selectedLabels:pe.split(`,`),includeTrashed:!1,includeAgentActions:!1}]))},[pe]);let[me,he]=(0,M.useState)(!1),[_e,ve]=(0,M.useState)(null),[xe,Se]=(0,M.useState)(null),[Ce,je]=(0,M.useState)(0),[Me,Ne]=(0,M.useState)(null),[ze,Be]=(0,M.useState)(!1),[Ve,He]=(0,M.useState)(!1),[Ue,We]=(0,M.useState)(null),[Ge,Ke]=(0,M.useState)(``),[qe,Je]=(0,M.useState)(``),[Ye,Xe]=(0,M.useState)(null),[Ze,Qe]=(0,M.useState)(null),[$e,et]=(0,M.useState)(()=>{if(typeof window>`u`)return 100;let e=window.localStorage.getItem(Oe);return e?se(e):100}),[tt,nt]=(0,M.useState)($e),[rt,it]=(0,M.useState)(`hybrid`),[at,ot]=(0,M.useState)(0),[st,ct]=(0,M.useState)(0),[lt,ut]=(0,M.useState)([]),[dt,ft]=(0,M.useState)({labels:[],includeTrashed:!1}),[pt,mt]=(0,M.useState)(!1),[ht,gt]=(0,M.useState)([]),[_t,vt]=(0,M.useState)([]),[yt,bt]=(0,M.useState)(!1),xt=(0,M.useRef)(!1),St=(0,M.useRef)(null),Ct=(0,M.useMemo)(()=>{let e=new Set;for(let t of S.current.values()){let n=ne(t.labels);n&&e.add(n)}return[...e].sort()},[Ce]);(0,M.useEffect)(()=>{let e=!1,t=i(`/api/admin/graph-labels-in-graph`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.json()}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-labels-in-graph`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}return{labels:[]}}),n=i(`/api/admin/graph-default-view`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.json()}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-default-view`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}return{labels:[],includeTrashed:!1}});return Promise.all([t,n]).then(([t,n])=>{if(!e&&(ut(t.labels),ft(n),!xt.current)){xt.current=!0;let e=new Set(t.labels.map(e=>e.label)),r=n.labels.filter(t=>e.has(t));(r.length>0||n.includeTrashed)&&fe(e=>[{kind:`filter`,selectedLabels:r,includeTrashed:n.includeTrashed,includeAgentActions:!1},...e.slice(1)])}}),()=>{e=!0}},[a,o,i]);let wt=de[0].kind===`filter`?de[0].includeAgentActions:!1;(0,M.useEffect)(()=>{if(!xt.current)return;let e=!1;return i(`/api/admin/graph-labels-in-graph?includeAgentActions=${wt?`1`:`0`}`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.json()}).then(t=>{e||ut(t.labels)}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-labels-in-graph-refetch`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}}),()=>{e=!0}},[a,o,wt,st,i]),(0,M.useEffect)(()=>{if(!pt)return;let e=e=>{St.current&&(St.current.contains(e.target)||mt(!1))},t=e=>{e.key===`Escape`&&mt(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[pt]);let Tt=(0,M.useCallback)(()=>{if(v.current)try{v.current.clear()}catch{}if(x.current)try{x.current.clear()}catch{}},[]),Et=(0,M.useCallback)((e,t)=>{We(null),i(`/api/admin/graph-delete`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e,by:`graph-drag-trash`})}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);Ne(null);try{d.current?.unselectAll()}catch{}fe(e=>[ie(e)]),ot(e=>e+1)}).catch(n=>{let r=n instanceof Error?n.message:String(n);We(`Failed to delete: ${r}`),He(!0),window.setTimeout(()=>He(!1),Ae);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-drag-delete`,elementId:e,label:t,msg:r}),keepalive:!0}).catch(()=>{})}catch{}})},[i]),Dt=de[de.length-1],Ot=(0,M.useMemo)(()=>O(de),[de]),kt=(0,M.useRef)(Ot);(0,M.useEffect)(()=>{kt.current=Ot},[Ot]);let At=(0,M.useRef)(de);(0,M.useEffect)(()=>{At.current=de},[de]),(0,M.useEffect)(()=>{if(Dt.kind===`filter`&&Dt.selectedLabels.length===0){C.current?.abort(),C.current=null,he(!1),ve(null),Se(null),je(0),S.current=new Map,Tt();return}if(Dt.kind===`filter`&&qe)return;let e=window.setTimeout(()=>{C.current?.abort();let e=new AbortController;C.current=e,he(!0),ve(null),Se(null),i(Fe(Dt,{includeAgentActions:ie(de).includeAgentActions,search:null,channel:ht,messageSublabel:_t}),{signal:e.signal}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(e.status===413)throw new Ie(t);if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(t=>{e.signal.aborted||(S.current=new Map(t.nodes.map(e=>[e.id,e])),je(t.nodes.length),jt(t.nodes,t.edges))}).catch(t=>{if(!e.signal.aborted){if(t instanceof Ie){Se(t.body),je(0),S.current=new Map,Tt();return}ve(t instanceof Error?t.message:String(t))}}).finally(()=>{e.signal.aborted||he(!1)})},ke);return()=>{window.clearTimeout(e)}},[a,Ot,at,o,qe,tt,ht,_t]),(0,M.useEffect)(()=>()=>{C.current?.abort(),d.current?.destroy(),d.current=null,ue.current!==null&&(clearTimeout(ue.current),ue.current=null)},[]);let jt=(0,M.useCallback)((e,t)=>{if(!u.current)return;ee.current=t;let n=new Set([`Message`,`UserMessage`,`AssistantMessage`]),r=e=>e.labels.some(e=>n.has(e)),i=new Map,a=e.filter(r);if(a.length>0){let e=new Set(a.map(e=>e.id)),n=new Map,r=new Set;for(let i of t)i.type===`NEXT`&&e.has(i.from)&&e.has(i.to)&&(n.set(i.from,i.to),r.add(i.to));let o=[],s=new Set;for(let e of a){if(r.has(e.id))continue;let t=e.id;for(;t&&!s.has(t);)s.add(t),o.push(t),t=n.get(t)}for(let e of a)s.has(e.id)||(o.push(e.id),s.add(e.id));let c=u.current?.clientWidth??1200,l=Math.max(c-160,300),d=Math.max(Math.floor(l/150),2);o.forEach((e,t)=>{let n=t%d,r=Math.floor(t/d);i.set(e,{x:n*150,y:r*90})})}let o=e.map(e=>{let t=e.labels[0]??`Unknown`,n=w(e.labels);n.displayLabel;let r=n.colour;n.driftCandidates;let a=i.get(e.id),o=a?{x:a.x,y:a.y,physics:!1}:{};return e.trashed?{id:e.id,label:ge(e),title:be(e),color:{background:`${r}40`,border:r},borderWidth:2,shapeProperties:{borderDashes:[6,4]},group:t,...o}:{id:e.id,label:ge(e),title:be(e),color:r,group:t,...o}}),s=new Set(o.map(e=>e.id)),c=t.filter(e=>e.type!==`PART_OF`||s.has(e.from)&&s.has(e.to)).map(e=>({id:e.id,from:e.from,to:e.to,label:e.type})),l=j({nodes:e,edges:t});v.current=new Te.DataSet(l.nodePositions.size>0?o.map(e=>{if(e.x!==void 0||e.y!==void 0)return e;let t=l.nodePositions.get(e.id);return t?{...e,x:t.x,y:t.y,physics:!1}:e}):o),x.current=new Te.DataSet(c);let f={autoResize:!0,layout:{improvedLayout:!1,randomSeed:De(kt.current)},physics:l.physics===!1?!1:{solver:l.physics.solver,barnesHut:l.physics.barnesHut,stabilization:l.physics.stabilization},nodes:{shape:`dot`,size:18,font:{color:`#1F2937`,size:12,face:`DM Sans, sans-serif`},scaling:{label:{enabled:!0,min:12,max:30,drawThreshold:0}},borderWidth:0,chosen:{node:e=>{e.size=20,e.borderWidth=3},label:e=>{e.size=14}}},edges:{arrows:{to:{enabled:!0,scaleFactor:.4}},color:{color:`#CBD5E1`,highlight:`#475569`},font:{color:`#64748B`,size:9,face:`DM Sans, sans-serif`,align:`middle`,strokeWidth:0},smooth:{enabled:!0,type:`continuous`,roundness:.4},width:1,chosen:{edge:!0,label:!1}},interaction:{hover:!0,tooltipDelay:150}};try{d.current?.destroy(),ue.current!==null&&(clearTimeout(ue.current),ue.current=null),le.current=null;let e=new we.Network(u.current,{nodes:v.current,edges:x.current},f);d.current=e,e.on(`zoom`,()=>{ue.current!==null&&clearTimeout(ue.current),ue.current=setTimeout(()=>{ue.current=null;let e=d.current,t=v.current;if(!e||!t)return;let n;try{n=e.getScale()}catch{return}let r=Ee(n);if(r===le.current)return;le.current=r;let i=[];for(let e of S.current.values()){let t=e.labels[0];if(!t||!ce.has(t))continue;let{colour:r}=w(e.labels),a=e.trashed?{background:`${r}40`,border:r}:r;i.push({id:e.id,label:ye(e,n),color:a})}i.length>0&&t.update(i),console.error(`[graph-page] zoom-tier scale=${n.toFixed(3)} tier=${r} conversations=${i.length}`)},P)}),e.on(`click`,e=>{let t=e.nodes[0];if(!t)return;let n=S.current.get(t);if(!n)return;if(k(n)===`skip-trashed`){Ne(n);return}let r=At.current[At.current.length-1];if(r.kind===`neighbourhood`&&r.rootElementId===t){Ne(e=>e?.id===t?null:n);return}Ne(null);let i={kind:`neighbourhood`,rootElementId:t,rootLabel:n.labels[0]??null};fe(e=>{let n=T(e,i),r=n.length-1;return n.length>e.length&&Re(`nav-push`,{depth:r,kind:i.kind,rootElementId:t}),n.length===10&&e.length===10&&Re(`view-stack-cap-hit`,{depth:10,rootElementId:t}),n})}),e.on(`deselectNode`,()=>{Ne(null)});let t=e=>{let t=u.current,n=te.current;if(!t||!n)return!1;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),a=r.left+e.x,o=r.top+e.y;return a>=i.left&&a<=i.right&&o>=i.top&&o<=i.bottom},n=u.current?.parentElement??null;e.on(`dragStart`,e=>{let t=e.nodes[0];if(!t){oe.current=null;return}oe.current=t,n?.classList.add(`graph-dragging`)}),e.on(`dragging`,e=>{if(!oe.current)return;let n=t(e.pointer.DOM);Be(e=>e===n?e:n)}),e.on(`dragEnd`,e=>{let r=oe.current;oe.current=null,Be(!1),n?.classList.remove(`graph-dragging`),r&&t(e.pointer.DOM)&&Et(r,S.current.get(r)?.labels[0]??`Unknown`)})}catch(e){let t=e instanceof Error?e.message:String(e);ve(`Visualisation failed to load: ${t}`);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-render`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}}},[]);(0,M.useEffect)(()=>{let e=Ge.trim();if(!e){Je(``),Xe(null),Qe(null),it(`hybrid`),d.current?.unselectAll();return}let t=setTimeout(()=>Je(e),300);return()=>clearTimeout(t)},[Ge]),(0,M.useEffect)(()=>{let e=setTimeout(()=>{let e=se($e);nt(e);try{window.localStorage.setItem(Oe,String(e))}catch{}},200);return()=>clearTimeout(e)},[$e]);let Mt=(0,M.useCallback)(e=>{let t=d.current,n=v.current;if(!t||!n)return;let{updates:r,inWindow:i}=A(e,S.current,w,F);r.length>0&&(n.update(r),t.fit({nodes:i,animation:{duration:400,easingFunction:`easeInOutQuad`}}))},[]),Nt=ie(de);(0,M.useEffect)(()=>{if(!qe||Dt.kind!==`filter`)return;let e=!1;Qe(null);let t=encodeURIComponent(Nt.selectedLabels.join(`,`));return i(`/api/admin/graph-search?q=${encodeURIComponent(qe)}&labels=${t}&limit=${tt}`).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(t=>{if(e)return;Xe(t.results);let n=t.mode===`bm25`?`bm25`:`hybrid`;if(it(n),n===`bm25`)try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-page`,msg:`[graph-page] search-result-degraded mode=bm25 query="${qe}"`}),keepalive:!0}).catch(()=>{})}catch{}let{nodes:r,edges:i}=ae(t.results,Nt.selectedLabels);S.current=new Map(r.map(e=>[e.id,e])),je(r.length),Se(null),jt(r,i),Mt(t.results)}).catch(t=>{e||Qe(t instanceof Error?t.message:String(t))}),()=>{e=!0}},[qe,tt,a,o,i,Mt,Dt.kind,Nt.selectedLabels,jt]);let Pt=(0,M.useCallback)(e=>{fe(t=>{let n=ie(t),r=new Set(n.selectedLabels);return r.has(e)?r.delete(e):r.add(e),D({kind:`filter`,selectedLabels:[...r].sort(),includeTrashed:n.includeTrashed,includeAgentActions:n.includeAgentActions})})},[]),Ft=(0,M.useCallback)(()=>{fe(e=>{let t=ie(e);return D({...t,includeTrashed:!t.includeTrashed})})},[]),It=(0,M.useCallback)(()=>{fe(e=>{let t=ie(e);return D({...t,includeAgentActions:!t.includeAgentActions})})},[]),Lt=(0,M.useCallback)(()=>{Ke(``),Je(``),Xe(null),Qe(null),it(`hybrid`);try{d.current?.unselectAll()}catch{}},[]),Rt=(0,M.useCallback)(()=>{fe(()=>D({kind:`filter`,selectedLabels:[],includeTrashed:!1,includeAgentActions:!1}))},[]),zt=(0,M.useCallback)(()=>{Ne(null);try{d.current?.unselectAll()}catch{}fe(e=>{let t=E(e);return t!==e&&Re(`nav-pop`,{depth:t.length-1}),t})},[]),Bt=(0,M.useCallback)(()=>{let e=ie(de),t={labels:[...e.selectedLabels].sort(),includeTrashed:e.includeTrashed};bt(!0),i(`/api/admin/graph-default-view`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}).then(async e=>{if(!e.ok){let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));throw Error(t.error??`HTTP ${e.status}`)}ft(t)}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-default-view-save`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}}).finally(()=>bt(!1))},[i,de]),Vt=(0,M.useCallback)(()=>{Ne(null);try{d.current?.unselectAll()}catch{}ot(e=>e+1)},[]),Ht=(0,M.useCallback)(()=>{Ne(null);try{d.current?.unselectAll()}catch{}fe(e=>[ie(e)]),ot(e=>e+1)},[]),Ut=(0,M.useCallback)(()=>{ot(e=>e+1),ct(e=>e+1)},[]),Wt=Dt.kind===`neighbourhood`,Gt=ie(de),Kt=Gt.selectedLabels,qt=Gt.includeTrashed,Jt=Gt.includeAgentActions,Yt=ht.join(`,`),Xt=_t.join(`,`),Zt=Kt.includes(`AdminConversation`)||Kt.includes(`PublicConversation`);(0,M.useEffect)(()=>{Zt&&console.info(`[graph-filter] subfacet-render channel=[${Yt}] sublabel=[${Xt}]`)},[Yt,Xt,Zt]);let Qt=(0,M.useMemo)(()=>{if(qt!==dt.includeTrashed||Kt.length!==dt.labels.length)return!0;for(let e=0;e<Kt.length;e++)if(Kt[e]!==dt.labels[e])return!0;return!1},[qt,Kt,dt]);return(0,N.jsxs)(N.Fragment,{children:[s&&(0,N.jsx)(`button`,{type:`button`,className:`graph-session-banner`,onClick:l,"data-reason":s.reason,children:s.message}),(0,N.jsxs)(`div`,{className:`graph-toolbar`,children:[(0,N.jsxs)(`div`,{className:`data-search-input graph-search-input`,children:[(0,N.jsx)(c,{size:14}),(0,N.jsx)(`input`,{type:`text`,placeholder:`Search nodes…`,value:Ge,onChange:e=>Ke(e.target.value),autoComplete:`off`,spellCheck:!1}),qe&&!Ye&&!Ze&&(0,N.jsx)(f,{size:14,className:`spin`}),Ge.length>0&&(0,N.jsx)(`button`,{type:`button`,className:`graph-search-clear`,onClick:Lt,"aria-label":`Clear search`,title:`Clear search`,children:(0,N.jsx)(b,{size:14})})]}),qe&&!Wt&&(0,N.jsxs)(`div`,{className:`graph-search-limit`,title:`Show top ${$e} matches (1-2000)`,children:[(0,N.jsxs)(`label`,{htmlFor:`graph-search-limit-slider`,className:`graph-search-limit-label`,children:[`Top `,$e]}),(0,N.jsx)(`input`,{id:`graph-search-limit-slider`,type:`range`,min:1,max:2e3,step:1,value:$e,onChange:e=>et(se(e.target.value)),"aria-label":`Maximum search results to render`})]}),(0,N.jsx)(`button`,{type:`button`,className:`graph-refresh-button`,onClick:Ut,disabled:me,"aria-label":`Refresh graph`,title:`Refresh graph`,children:(0,N.jsx)(_,{size:14,className:me?`spin`:void 0})}),!Wt&&(0,N.jsxs)(`div`,{className:`graph-filter-wrap`,ref:St,children:[(0,N.jsxs)(`button`,{type:`button`,className:`graph-filter-toggle${pt?` is-open`:``}${Kt.length>0||qt||Jt?` has-selection`:``}`,onClick:()=>mt(e=>!e),"aria-haspopup":`true`,"aria-expanded":pt,"aria-label":`Filter node types`,children:[(0,N.jsx)(y,{size:14}),(0,N.jsx)(`span`,{children:`Filter`}),Kt.length>0&&(0,N.jsx)(`span`,{className:`graph-filter-count`,children:Kt.length})]}),pt&&(0,N.jsxs)(`div`,{className:`graph-filter-popover`,role:`dialog`,"aria-label":`Node type filter`,children:[(0,N.jsxs)(`div`,{className:`graph-filter-popover-header`,children:[(0,N.jsxs)(`button`,{type:`button`,className:`graph-toggle-trashed${qt?` active`:``}`,onClick:Ft,"aria-pressed":qt,title:`Show trashed nodes — restored with Restore button on each node`,children:[(0,N.jsx)(g,{size:14}),` Show trashed`]}),(Kt.length>0||qt||Jt)&&(0,N.jsx)(`button`,{type:`button`,className:`graph-filter-clear`,onClick:Rt,"aria-label":`Clear filter selection`,title:`Clear filter selection`,children:(0,N.jsx)(b,{size:14})})]}),(0,N.jsx)(`div`,{className:`graph-toggle-agent-actions`,title:`Hide ToolCall, StepResult, WorkflowStep, WorkflowRun — agent-execution telemetry. Flip on for audit/debug.`,children:(0,N.jsx)(m,{checked:Jt,onChange:It,label:`Include agent actions`})}),lt.length===0&&(0,N.jsx)(`p`,{className:`graph-filter-popover-empty`,children:`No node types in your graph yet.`}),(0,N.jsx)(`div`,{className:`graph-filter-rows`,role:`group`,"aria-label":`Node type filter`,children:lt.map(({label:e,nodeCount:t})=>{let n=Kt.includes(e),r=re(e);return(0,N.jsxs)(`button`,{type:`button`,className:`graph-filter-row${n?` active`:``}`,onClick:()=>Pt(e),"aria-pressed":n,children:[(0,N.jsx)(`span`,{className:`graph-filter-row-swatch`,style:{backgroundColor:r}}),(0,N.jsx)(`span`,{className:`graph-filter-row-label`,children:e}),(0,N.jsx)(`span`,{className:`graph-filter-row-count`,children:t})]},e)})}),(Kt.includes(`AdminConversation`)||Kt.includes(`PublicConversation`))&&(0,N.jsxs)(`div`,{className:`graph-filter-subfacets`,children:[(0,N.jsxs)(`div`,{className:`graph-filter-subfacet-group`,role:`group`,"aria-label":`Conversation channel`,children:[(0,N.jsx)(`span`,{className:`graph-filter-subfacet-label`,children:`Channel`}),[`webchat`,`whatsapp`].map(e=>{let t=ht.includes(e);return(0,N.jsx)(`button`,{type:`button`,className:`graph-filter-subfacet-chip${t?` active`:``}`,onClick:()=>{gt(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},"aria-pressed":t,children:e===`webchat`?`Web`:`WhatsApp`},e)})]}),(0,N.jsxs)(`div`,{className:`graph-filter-subfacet-group`,role:`group`,"aria-label":`Message sublabel`,children:[(0,N.jsx)(`span`,{className:`graph-filter-subfacet-label`,children:`Message`}),[`UserMessage`,`AssistantMessage`,`WhatsAppMessage`].map(e=>{let t=_t.includes(e);return(0,N.jsx)(`button`,{type:`button`,className:`graph-filter-subfacet-chip${t?` active`:``}`,onClick:()=>{vt(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},"aria-pressed":t,children:e===`UserMessage`?`User`:e===`AssistantMessage`?`Assistant`:`WhatsApp`},e)})]})]}),(0,N.jsx)(`div`,{className:`graph-filter-popover-footer`,children:(0,N.jsx)(`button`,{type:`button`,className:`graph-filter-set-default`,onClick:Bt,disabled:!Qt||yt,children:yt?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(f,{size:12,className:`spin`}),` Saving…`]}):`Set default view`})})]})]}),(0,N.jsxs)(`div`,{className:`graph-meta`,children:[de.length>1&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`button`,{type:`button`,className:`graph-back-to-filter graph-back-desktop`,onClick:zt,children:`← Back`}),(0,N.jsx)(`button`,{type:`button`,className:`graph-back-to-filter graph-back-mobile`,onClick:zt,"aria-label":`Back`,children:(0,N.jsx)(h,{size:16})})]}),Ce>0&&(0,N.jsxs)(`span`,{className:`graph-meta-count`,children:[Ce,` node`,Ce===1?``:`s`]})]})]}),de.length>1&&(0,N.jsx)(Le,{viewStack:de}),qe&&rt===`bm25`&&!Ze&&(0,N.jsx)(`div`,{className:`graph-error-banner graph-search-degraded`,role:`status`,children:`Vector ranking unavailable — showing keyword-only results.`}),Ze&&(0,N.jsxs)(`div`,{className:`data-error graph-error-banner`,children:[`Search unavailable: `,Ze]}),Ye&&Ye.length===0&&!Ze&&(0,N.jsx)(`div`,{className:`graph-search-status`,children:`No matches in your graph.`}),(0,N.jsxs)(`div`,{className:`graph-canvas-wrap`,children:[me&&(0,N.jsxs)(`div`,{className:`graph-canvas-overlay`,children:[(0,N.jsx)(f,{size:20,className:`spin`}),` Loading your graph…`]}),_e&&!me&&(0,N.jsxs)(`div`,{className:`graph-canvas-overlay graph-canvas-error`,children:[(0,N.jsx)(`p`,{children:_e}),(0,N.jsx)(`button`,{type:`button`,className:`data-btn`,onClick:()=>{ve(null),ot(e=>e+1)},children:`Retry`})]}),xe&&!me&&(0,N.jsxs)(`div`,{className:`graph-canvas-overlay graph-canvas-error`,children:[(0,N.jsxs)(`p`,{children:[`Refine your filter — `,(0,N.jsx)(`strong`,{children:xe.matched}),` matches exceed the 2000 cap.`]}),(0,N.jsx)(`p`,{className:`graph-canvas-hint`,children:`Pick a more specific label combination, or narrow your brand's data.`})]}),!me&&!_e&&!xe&&Ce===0&&!Wt&&Kt.length===0&&(0,N.jsxs)(`div`,{className:`graph-canvas-overlay`,children:[(0,N.jsx)(y,{size:20}),(0,N.jsx)(`p`,{children:`Open Filter to pick a node type and see what's in your graph.`})]}),!me&&!_e&&!xe&&Ce===0&&!Wt&&Kt.length>0&&(0,N.jsx)(`div`,{className:`graph-canvas-overlay`,children:(0,N.jsxs)(`p`,{children:[`No `,Kt.join(`, `),` nodes in your graph yet.`]})}),(0,N.jsx)(`div`,{ref:u,className:`graph-canvas`}),Ce>0&&(0,N.jsx)(`div`,{ref:te,className:`graph-trash-drop-zone${ze?` is-hover`:``}${Ve?` is-error`:``}`,"aria-hidden":`true`,children:(0,N.jsx)(n,{size:18})}),Ue&&(0,N.jsxs)(`div`,{className:`graph-drag-error-banner`,role:`alert`,children:[(0,N.jsx)(`span`,{children:Ue}),(0,N.jsx)(`button`,{type:`button`,className:`graph-drag-error-dismiss`,onClick:()=>We(null),"aria-label":`Dismiss`,children:(0,N.jsx)(b,{size:14})})]})]}),Me&&(0,N.jsx)(Pe,{node:Me,edges:ee.current,nodesById:S.current,adminFetch:i,onClose:()=>{Ne(null);try{d.current?.unselectAll()}catch{}},onRestored:Vt,onTrashed:Ht}),Ce>0&&Ct.length>0&&(0,N.jsx)(`div`,{className:`graph-legend`,children:Ct.map(e=>(0,N.jsxs)(`div`,{className:`graph-legend-item`,children:[(0,N.jsx)(`span`,{className:`graph-legend-swatch`,style:{backgroundColor:re(e)}}),(0,N.jsx)(`span`,{children:e})]},e))})]})}function Pe({node:e,edges:t,nodesById:r,adminFetch:i,onClose:a,onRestored:o,onTrashed:s}){let c=Object.entries(e.properties).filter(([,e])=>e!=null),l=t.filter(t=>t.from===e.id||t.to===e.id),[u,d]=(0,M.useState)(!1),[p,m]=(0,M.useState)(null),[h,g]=(0,M.useState)(!1),[_,y]=(0,M.useState)(null);(0,M.useEffect)(()=>{d(!1),m(null),g(!1),y(null)},[e.id]);let x=(0,M.useCallback)(()=>{d(!0),m(null),i(`/api/admin/graph-restore`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e.id})}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);o()}).catch(e=>{m(e instanceof Error?e.message:String(e)),d(!1)})},[e.id,o,i]),S=(0,M.useCallback)(()=>{g(!0),y(null),i(`/api/admin/graph-delete`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e.id,by:`graph-side-panel-trash`})}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);s()}).catch(e=>{y(e instanceof Error?e.message:String(e)),g(!1)})},[e.id,s,i]);return(0,N.jsxs)(`aside`,{className:`graph-side-panel${e.trashed?` graph-side-panel-trashed`:``}`,children:[(0,N.jsxs)(`header`,{className:`graph-side-header`,children:[(0,N.jsx)(`div`,{children:(()=>{if(e.labels.some(e=>ce.has(e))){let t=_e(e),n=e.properties.createdAt,r=typeof n==`string`?n:``,i=r?pe(r):null,a=e.labels.join(` · `)+(e.trashed?` · Trashed`:``)+` · ${e.id}`;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`h2`,{className:`graph-side-name`,title:t,children:t}),i&&(0,N.jsx)(`div`,{className:`graph-side-created`,children:i}),(0,N.jsx)(`div`,{className:`graph-side-meta`,children:a})]})}return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`div`,{className:`graph-side-labels`,children:[e.labels.join(` · `),e.trashed?` · Trashed`:``]}),(0,N.jsx)(`div`,{className:`graph-side-id`,children:e.id})]})})()}),(0,N.jsx)(`button`,{type:`button`,className:`graph-side-close`,onClick:a,"aria-label":`Close`,children:(0,N.jsx)(b,{size:14})})]}),e.trashed&&(0,N.jsxs)(`dl`,{className:`graph-side-props graph-side-trash-meta`,children:[(0,N.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,N.jsx)(`dt`,{children:`trashedAt`}),(0,N.jsx)(`dd`,{children:Be(e.properties.trashedAt)})]}),(0,N.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,N.jsx)(`dt`,{children:`trashedBy`}),(0,N.jsx)(`dd`,{children:Be(e.properties.trashedBy)})]})]}),(0,N.jsxs)(`dl`,{className:`graph-side-props`,children:[c.length===0&&(0,N.jsx)(`div`,{className:`graph-side-empty`,children:`No properties.`}),c.map(([e,t])=>(0,N.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,N.jsx)(`dt`,{children:e}),(0,N.jsx)(`dd`,{children:Be(t)})]},e))]}),l.length>0&&(0,N.jsxs)(`section`,{className:`graph-side-edges`,children:[(0,N.jsxs)(`h3`,{className:`graph-side-edges-heading`,children:[`Connections (`,l.length,`)`]}),l.map(t=>{let n=t.from===e.id,i=n?t.to:t.from,a=r.get(i),o=a?ge(a):i,s=n?`→`:`←`,c=Object.entries(t.properties??{}).filter(([,e])=>e!=null&&e!==``);return(0,N.jsxs)(`div`,{className:`graph-side-edge`,children:[(0,N.jsxs)(`div`,{className:`graph-side-edge-header`,children:[(0,N.jsx)(`span`,{className:`graph-side-edge-type`,children:t.type}),(0,N.jsx)(`span`,{className:`graph-side-edge-arrow`,children:s}),(0,N.jsx)(`span`,{className:`graph-side-edge-other`,title:o,children:o})]}),c.length>0&&(0,N.jsx)(`dl`,{className:`graph-side-edge-props`,children:c.map(([e,t])=>(0,N.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,N.jsx)(`dt`,{children:e}),(0,N.jsx)(`dd`,{children:Be(t)})]},e))})]},t.id)})]}),e.trashed&&(0,N.jsxs)(`footer`,{className:`graph-side-footer`,children:[!u&&!p&&(0,N.jsxs)(`button`,{type:`button`,className:`graph-side-restore`,onClick:x,children:[(0,N.jsx)(v,{size:14}),` Restore`]}),u&&(0,N.jsx)(`div`,{className:`graph-delete-confirm`,children:(0,N.jsxs)(`p`,{children:[(0,N.jsx)(f,{size:14,className:`spin`}),` Restoring…`]})}),p&&(0,N.jsxs)(`div`,{className:`graph-delete-confirm graph-delete-confirm-error`,children:[(0,N.jsxs)(`p`,{children:[`Restore failed: `,p]}),(0,N.jsxs)(`div`,{className:`graph-delete-confirm-buttons`,children:[(0,N.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-cancel`,onClick:()=>{m(null)},children:`Close`}),(0,N.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-do`,onClick:x,children:`Retry`})]})]})]}),!e.trashed&&(0,N.jsxs)(`footer`,{className:`graph-side-footer`,children:[!h&&!_&&(0,N.jsxs)(`button`,{type:`button`,className:`graph-side-trash`,onClick:S,children:[(0,N.jsx)(n,{size:14}),` Trash`]}),h&&(0,N.jsx)(`div`,{className:`graph-delete-confirm`,children:(0,N.jsxs)(`p`,{children:[(0,N.jsx)(f,{size:14,className:`spin`}),` Trashing…`]})}),_&&(0,N.jsxs)(`div`,{className:`graph-delete-confirm graph-delete-confirm-error`,children:[(0,N.jsxs)(`p`,{children:[`Trash failed: `,_]}),(0,N.jsxs)(`div`,{className:`graph-delete-confirm-buttons`,children:[(0,N.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-cancel`,onClick:()=>{y(null)},children:`Close`}),(0,N.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-do`,onClick:S,children:`Retry`})]})]})]})]})}function Fe(e,t){let n=`/api/admin/graph-subgraph`,r=t.includeAgentActions?`&includeAgentActions=1`:``;if(e.kind===`neighbourhood`){let i=t.search&&t.search.q?`&q=${encodeURIComponent(t.search.q)}&limit=${t.search.limit}`:``;return`${n}?mode=neighbourhood&elementId=${encodeURIComponent(e.rootElementId)}${r}${i}`}return`${n}?mode=default&labels=${encodeURIComponent(e.selectedLabels.join(`,`))}${e.includeTrashed?`&includeTrashed=1`:``}${r}${t.channel&&t.channel.length>0?`&channel=${encodeURIComponent(t.channel.join(`,`))}`:``}${t.messageSublabel&&t.messageSublabel.length>0?`&messageSublabel=${encodeURIComponent(t.messageSublabel.join(`,`))}`:``}`}var Ie=class extends Error{body;constructor(e){super(e.error),this.body=e}};function Le({viewStack:e}){let t=e.map(e=>e.kind===`filter`?`Filter`:e.rootLabel??`Node`);return(0,N.jsx)(`div`,{className:`graph-breadcrumb`,role:`navigation`,"aria-label":`Graph navigation breadcrumb`,children:t.map((e,n)=>(0,N.jsxs)(`span`,{className:`graph-breadcrumb-item`,children:[n>0&&(0,N.jsx)(`span`,{className:`graph-breadcrumb-separator`,"aria-hidden":`true`,children:`›`}),(0,N.jsx)(`span`,{className:`graph-breadcrumb-label${n===t.length-1?` is-current`:``}`,children:e})]},n))})}function Re(e,t){let n=`[graph-page] ${e} ${Object.entries(t).map(([e,t])=>`${e}=${String(t)}`).join(` `)}`;try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-nav`,msg:n}),keepalive:!0}).catch(()=>{})}catch{}}function ze(e){let t=t=>{let n=e[t];if(n&&typeof n==`object`&&`low`in n){let e=n.low;return typeof e==`number`?e:null}return null},n=t(`year`),r=t(`month`),i=t(`day`);if(n===null||r===null||i===null)return null;let a=`${String(n).padStart(4,`0`)}-${String(r).padStart(2,`0`)}-${String(i).padStart(2,`0`)}`;if(!(`hour`in e))return a;let o=t(`hour`),s=t(`minute`),c=t(`second`);return o===null||s===null||c===null?a:`${a} ${String(o).padStart(2,`0`)}:${String(s).padStart(2,`0`)}:${String(c).padStart(2,`0`)}`}function Be(e){if(e==null)return``;if(Array.isArray(e))return e.length>8?`[${e.length} items]`:e.map(String).join(`, `);if(typeof e==`object`){if(`year`in e&&`month`in e&&`day`in e&&typeof e.year==`object`){let t=ze(e);if(t)return t}return JSON.stringify(e)}return String(e)}export{_ as a,v as i,je as n,b as r,Ne as t};
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Graph — Maxy</title>
|
|
7
7
|
<link rel="icon" href="/favicon.ico">
|
|
8
|
-
<script type="module" crossorigin src="/assets/graph-
|
|
8
|
+
<script type="module" crossorigin src="/assets/graph-BlrcvwWP.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/chunk-DD-I1_y5.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-DkaAusaX.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/Checkbox-CTGhpDKq.js">
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/useAdminFetch-DmHu0oCx.js">
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/page-
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/page-ClTUYMK8.js">
|
|
14
14
|
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-D4WovFYk.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Real Agent</title>
|
|
7
7
|
<link rel="icon" href="/favicon.ico">
|
|
8
|
-
<script type="module" crossorigin src="/assets/admin-
|
|
8
|
+
<script type="module" crossorigin src="/assets/admin-CgGQafDG.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/chunk-DD-I1_y5.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-DkaAusaX.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-qlgyTAkD.js">
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<link rel="modulepreload" crossorigin href="/assets/useVoiceRecorder-CSc_hxjV.js">
|
|
14
14
|
<link rel="modulepreload" crossorigin href="/assets/useAdminFetch-DmHu0oCx.js">
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/page-DkBfWy4C.js">
|
|
16
|
-
<link rel="modulepreload" crossorigin href="/assets/page-
|
|
16
|
+
<link rel="modulepreload" crossorigin href="/assets/page-ClTUYMK8.js">
|
|
17
17
|
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-D4WovFYk.css">
|
|
18
18
|
<link rel="stylesheet" crossorigin href="/assets/admin-CWMpccrR.css">
|
|
19
19
|
<link rel="stylesheet" href="/brand-defaults.css">
|