pkgviz 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/fallback-build-manifest.json +3 -3
  4. package/.next/server/app/_global-error.html +1 -1
  5. package/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  9. package/.next/server/app/_not-found.html +1 -1
  10. package/.next/server/app/_not-found.rsc +1 -1
  11. package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  12. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  13. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  14. package/.next/server/app/page.js.nft.json +1 -1
  15. package/.next/server/app/page_client-reference-manifest.js +1 -1
  16. package/.next/server/chunks/ssr/_1rh2tf9._.js +1 -1
  17. package/.next/server/chunks/ssr/_1rh2tf9._.js.map +1 -1
  18. package/.next/server/middleware-build-manifest.js +3 -3
  19. package/.next/server/pages/404.html +1 -1
  20. package/.next/server/pages/500.html +1 -1
  21. package/.next/static/chunks/{2sswp23h6zh08.js → 0_j-_aavigxqr.js} +1 -1
  22. package/package.json +1 -1
  23. package/src/features/graph-view/utils/projectVisibleGraph.ts +17 -2
  24. /package/.next/static/{rjdzHqzPw2GCNhDbjcu0- → qznDSVYlkQxVdRx-TE_Wk}/_buildManifest.js +0 -0
  25. /package/.next/static/{rjdzHqzPw2GCNhDbjcu0- → qznDSVYlkQxVdRx-TE_Wk}/_clientMiddlewareManifest.js +0 -0
  26. /package/.next/static/{rjdzHqzPw2GCNhDbjcu0- → qznDSVYlkQxVdRx-TE_Wk}/_ssgManifest.js +0 -0
@@ -342,4 +342,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
342
342
  `).concat(e.picking?`if(outColor.a == 0.0) discard;
343
343
  else outColor = vIndex;`:"",`
344
344
  }
345
- `));i.aPosition=t.getAttribLocation(i,"aPosition"),i.aIndex=t.getAttribLocation(i,"aIndex"),i.aVertType=t.getAttribLocation(i,"aVertType"),i.aTransform=t.getAttribLocation(i,"aTransform"),i.aAtlasId=t.getAttribLocation(i,"aAtlasId"),i.aTex=t.getAttribLocation(i,"aTex"),i.aPointAPointB=t.getAttribLocation(i,"aPointAPointB"),i.aPointCPointD=t.getAttribLocation(i,"aPointCPointD"),i.aLineWidth=t.getAttribLocation(i,"aLineWidth"),i.aColor=t.getAttribLocation(i,"aColor"),i.aCornerRadius=t.getAttribLocation(i,"aCornerRadius"),i.aBorderColor=t.getAttribLocation(i,"aBorderColor"),i.uPanZoomMatrix=t.getUniformLocation(i,"uPanZoomMatrix"),i.uAtlasSize=t.getUniformLocation(i,"uAtlasSize"),i.uBGColor=t.getUniformLocation(i,"uBGColor"),i.uZoom=t.getUniformLocation(i,"uZoom"),i.uTextures=[];for(var a=0;a<this.batchManager.getMaxAtlasesPerBatch();a++)i.uTextures.push(t.getUniformLocation(i,"uTexture".concat(a)));return i}},{key:"_createVAO",value:function(){var e,t,n,r,i,a,o=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=o.length/2;var c=this.maxInstances,s=this.gl,u=this.program,l=s.createVertexArray();return s.bindVertexArray(l),e=u.aPosition,n=(t=n0(lD(s,"vec2"),2))[0],i=lR(s,r=t[1],o),a=s.createBuffer(),s.bindBuffer(s.ARRAY_BUFFER,a),s.bufferData(s.ARRAY_BUFFER,i,s.STATIC_DRAW),r===s.FLOAT?s.vertexAttribPointer(e,n,r,!1,0,0):r===s.INT&&s.vertexAttribIPointer(e,n,r,0,0),s.enableVertexAttribArray(e),s.bindBuffer(s.ARRAY_BUFFER,null),this.transformBuffer=function(e,t,n){for(var r=new Float32Array(9*t),i=Array(t),a=0;a<t;a++){var o=9*a*4;i[a]=new Float32Array(r.buffer,o,9)}var c=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,c),e.bufferData(e.ARRAY_BUFFER,r.byteLength,e.DYNAMIC_DRAW);for(var s=0;s<3;s++){var u=n+s;e.enableVertexAttribArray(u),e.vertexAttribPointer(u,3,e.FLOAT,!1,36,12*s),e.vertexAttribDivisor(u,1)}return e.bindBuffer(e.ARRAY_BUFFER,null),c.getMatrixView=function(e){return i[e]},c.setData=function(e,t){i[t].set(e,0)},c.bufferSubData=function(){e.bindBuffer(e.ARRAY_BUFFER,c),e.bufferSubData(e.ARRAY_BUFFER,0,r)},c}(s,c,u.aTransform),this.indexBuffer=l_(s,c,"vec4",u.aIndex),this.vertTypeBuffer=l_(s,c,"int",u.aVertType),this.atlasIdBuffer=l_(s,c,"int",u.aAtlasId),this.texBuffer=l_(s,c,"vec4",u.aTex),this.pointAPointBBuffer=l_(s,c,"vec4",u.aPointAPointB),this.pointCPointDBuffer=l_(s,c,"vec4",u.aPointCPointD),this.lineWidthBuffer=l_(s,c,"vec2",u.aLineWidth),this.colorBuffer=l_(s,c,"vec4",u.aColor),this.cornerRadiusBuffer=l_(s,c,"vec4",u.aCornerRadius),this.borderColorBuffer=l_(s,c,"vec4",u.aBorderColor),s.bindVertexArray(null),l}},{key:"buffers",get:function(){var e=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(e){return rx(e,"Buffer")}).map(function(t){return e[t]})),this._buffers}},{key:"startFrame",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:lJ;this.panZoomMatrix=e,this.renderTarget=t,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(e,t){return!!e.visible()&&(!t||!t.isVisible||t.isVisible(e))}},{key:"drawTexture",value:function(e,t,n){var r=this.atlasManager,i=this.batchManager,a=r.getRenderTypeOpts(n);if(this._isVisible(e,a)&&(!e.isEdge()||this._isValidEdge(e))){if(this.renderTarget.picking&&a.getTexPickingMode){var o=a.getTexPickingMode(e);if(1===o)return;if(2==o)return void this.drawPickingRectangle(e,t,n)}var c,s=nZ(r.getAtlasInfo(e,n));try{for(s.s();!(c=s.n()).done;){var u=c.value,{atlas:l,tex1:h,tex2:f}=u;i.canAddToCurrentBatch(l)||this.endBatch();for(var d=i.getAtlasIndexForBatch(l),b=0,g=[[h,!0],[f,!1]];b<g.length;b++){var w=n0(g[b],2),p=w[0],v=w[1];if(0!=p.w){var y=this.instanceCount;this.vertTypeBuffer.getView(y)[0]=0;var k=this.indexBuffer.getView(y);lL(t,k),this.atlasIdBuffer.getView(y)[0]=d;var x=this.texBuffer.getView(y);x[0]=p.x,x[1]=p.y,x[2]=p.w,x[3]=p.h;var E=this.transformBuffer.getMatrixView(y);this.setTransformMatrix(e,E,a,u,v),this.instanceCount++,!v&&this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(e){s.e(e)}finally{s.f()}}}},{key:"setTransformMatrix",value:function(e,t,n,r){var i=!(arguments.length>4)||void 0===arguments[4]||arguments[4],a=0;if(n.shapeProps&&n.shapeProps.padding&&(a=e.pstyle(n.shapeProps.padding).pfValue),r){var{bb:o,tex1:c,tex2:s}=r,u=c.w/(c.w+s.w);i||(u=1-u);var l=this._getAdjustedBB(o,a,i,u);this._applyTransformMatrix(t,l,n,e)}else{var h=n.getBoundingBox(e),f=this._getAdjustedBB(h,a,!0,1);this._applyTransformMatrix(t,f,n,e)}}},{key:"_applyTransformMatrix",value:function(e,t,n,r){l$(e);var i,a,o=n.getRotation?n.getRotation(r):0;if(0!==o){var{x:c,y:s}=n.getRotationPoint(r);lK(e,e,[c,s]),lH(e,e,o);var u=n.getRotationOffset(r);i=u.x+(t.xOffset||0),a=u.y+(t.yOffset||0)}else i=t.x1,a=t.y1;lK(e,e,[i,a]),lz(e,e,[t.w,t.h])}},{key:"_getAdjustedBB",value:function(e,t,n,r){var{x1:i,y1:a,w:o,h:c,yOffset:s}=e;t&&(i-=t,a-=t,o+=2*t,c+=2*t);var u=0,l=o*r;return n&&r<1?o=l:!n&&r<1&&(i+=u=o-l,o=l),{x1:i,y1:a,w:o,h:c,xOffset:u,yOffset:s}}},{key:"drawPickingRectangle",value:function(e,t,n){var r=this.atlasManager.getRenderTypeOpts(n),i=this.instanceCount;this.vertTypeBuffer.getView(i)[0]=4,lL(t,this.indexBuffer.getView(i)),lN([0,0,0],1,this.colorBuffer.getView(i));var a=this.transformBuffer.getMatrixView(i);this.setTransformMatrix(e,a,r),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(e,t,n){var r=this.simpleShapeOptions.get(n);if(this._isVisible(e,r)){var i=r.shapeProps,a=this._getVertTypeForShape(e,i.shape);if(void 0===a||r.isSimple&&!r.isSimple(e,this.renderTarget))return void this.drawTexture(e,t,n);var o=this.instanceCount;if(this.vertTypeBuffer.getView(o)[0]=a,5===a||6===a){var c=r.getBoundingBox(e),s=this._getCornerRadius(e,i.radius,c),u=this.cornerRadiusBuffer.getView(o);u[0]=s,u[1]=s,u[2]=s,u[3]=s,6===a&&(u[0]=0,u[2]=0)}lL(t,this.indexBuffer.getView(o));var l=this.renderTarget.picking?1:"node-body"===n?e.effectiveOpacity():1,h=this.renderTarget.picking?1:e.pstyle(i.opacity).value*l;lN(e.pstyle(i.color).value,h,this.colorBuffer.getView(o));var f=this.lineWidthBuffer.getView(o);if(f[0]=0,f[1]=0,i.border){var d=e.pstyle("border-width").value;if(d>0){lN(e.pstyle("border-color").value,l*e.pstyle("border-opacity").value,this.borderColorBuffer.getView(o));var b=e.pstyle("border-position").value;if("inside"===b)f[0]=0,f[1]=-d;else if("outside"===b)f[0]=d,f[1]=0;else{var g=d/2;f[0]=g,f[1]=-g}}}var w=this.transformBuffer.getMatrixView(o);this.setTransformMatrix(e,w,r),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(e,t){switch(e.pstyle(t).value){case"rectangle":return 4;case"ellipse":return 7;case"roundrectangle":case"round-rectangle":return 5;case"bottom-round-rectangle":return 6;default:return}}},{key:"_getCornerRadius",value:function(e,t,n){var{w:r,h:i}=n;return"auto"===e.pstyle(t).value?aT(r,i):Math.min(e.pstyle(t).pfValue,i/2,r/2)}},{key:"drawEdgeArrow",value:function(e,t,n){if(e.visible()){var r,i,a,o=e._private.rscratch;if(("source"===n?(r=o.arrowStartX,i=o.arrowStartY,a=o.srcArrowAngle):(r=o.arrowEndX,i=o.arrowEndY,a=o.tgtArrowAngle),!(isNaN(r)||null==r||isNaN(i)||null==i||isNaN(a))&&null!=a)&&"none"!==e.pstyle(n+"-arrow-shape").value){var c=e.pstyle(n+"-arrow-color").value,s=e.pstyle("opacity").value,u=e.pstyle("line-opacity").value,l=e.pstyle("width").pfValue,h=e.pstyle("arrow-scale").value,f=this.r.getArrowWidth(l,h),d=this.instanceCount,b=this.transformBuffer.getMatrixView(d);l$(b),lK(b,b,[r,i]),lz(b,b,[f,f]),lH(b,b,a),this.vertTypeBuffer.getView(d)[0]=3,lL(t,this.indexBuffer.getView(d)),lN(c,s*u,this.colorBuffer.getView(d)),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}},{key:"drawEdgeLine",value:function(e,t){if(e.visible()){var n=this._getEdgePoints(e);if(n){var r=e.pstyle("opacity").value,i=e.pstyle("line-opacity").value,a=e.pstyle("width").pfValue,o=e.pstyle("line-color").value,c=r*i;if(n.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),4==n.length){var s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=1,lL(t,this.indexBuffer.getView(s)),lN(o,c,this.colorBuffer.getView(s)),this.lineWidthBuffer.getView(s)[0]=a;var u=this.pointAPointBBuffer.getView(s);u[0]=n[0],u[1]=n[1],u[2]=n[2],u[3]=n[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var l=0;l<n.length-2;l+=2){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=2,lL(t,this.indexBuffer.getView(h)),lN(o,c,this.colorBuffer.getView(h)),this.lineWidthBuffer.getView(h)[0]=a;var f=n[l-2],d=n[l-1],b=n[l],g=n[l+1],w=n[l+2],p=n[l+3],v=n[l+4],y=n[l+5];0==l&&(f=2*b-w+.001,d=2*g-p+.001),l==n.length-4&&(v=2*w-b+.001,y=2*p-g+.001);var k=this.pointAPointBBuffer.getView(h);k[0]=f,k[1]=d,k[2]=b,k[3]=g;var x=this.pointCPointDBuffer.getView(h);x[0]=w,x[1]=p,x[2]=v,x[3]=y,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(e){var t=e._private.rscratch;return!(t.badLine||null==t.allpts||isNaN(t.allpts[0]))}},{key:"_getEdgePoints",value:function(e){var t=e._private.rscratch;if(this._isValidEdge(e)){var n=t.allpts;if(4==n.length)return n;var r=this._getNumSegments(e);return this._getCurveSegmentPoints(n,r)}}},{key:"_getNumSegments",value:function(e){return Math.min(15,this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(e,t){if(4==e.length)return e;for(var n=Array((t+1)*2),r=0;r<=t;r++)if(0==r)n[0]=e[0],n[1]=e[1];else if(r==t)n[2*r]=e[e.length-2],n[2*r+1]=e[e.length-1];else{var i=r/t;this._setCurvePoint(e,i,n,2*r)}return n}},{key:"_setCurvePoint",value:function(e,t,n,r){if(e.length<=2)n[r]=e[0],n[r+1]=e[1];else{for(var i=Array(e.length-2),a=0;a<i.length;a+=2){var o=(1-t)*e[a]+t*e[a+2],c=(1-t)*e[a+1]+t*e[a+3];i[a]=o,i[a+1]=c}return this._setCurvePoint(i,t,n,r)}}},{key:"endBatch",value:function(){var e=this.gl,t=this.vao,n=this.vertexCount,r=this.instanceCount;if(0!==r){var i,a,o=this.renderTarget.picking?this.pickingProgram:this.program;e.useProgram(o),e.bindVertexArray(t);var c,s=nZ(this.buffers);try{for(s.s();!(c=s.n()).done;)c.value.bufferSubData(r)}catch(e){s.e(e)}finally{s.f()}for(var u=this.batchManager.getAtlases(),l=0;l<u.length;l++)u[l].bufferIfNeeded(e);for(var h=0;h<u.length;h++)e.activeTexture(e.TEXTURE0+h),e.bindTexture(e.TEXTURE_2D,u[h].texture),e.uniform1i(o.uTextures[h],h);e.uniform1f(o.uZoom,(a=(i=this.r).pixelRatio,i.cy.zoom()*a)),e.uniformMatrix3fv(o.uPanZoomMatrix,!1,this.panZoomMatrix),e.uniform1i(o.uAtlasSize,this.batchManager.getAtlasSize());var f=lN(this.bgColor,1);e.uniform4fv(o.uBGColor,f),e.drawArraysInstanced(e.TRIANGLES,0,n,r),e.bindVertexArray(null),e.bindTexture(e.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count:r,atlasCount:u.length}),this.startBatch()}}},{key:"getDebugInfo",value:function(){var e=this.atlasManager.getDebugInfo(),t=e.reduce(function(e,t){return e+t.atlasCount},0),n=this.batchDebugInfo,r=n.reduce(function(e,t){return e+t.count},0);return{atlasInfo:e,totalAtlases:t,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:n.length,batchInfo:n,totalInstances:r}}}]),l0={};function l2(e,t){return ig(e._private.rscratch,"labelWrapCachedLines",t)||[]}l0.initWebgl=function(e,t){var n,r,i,a,o,c,s,u,l=this,h=l.data.contexts[l.WEBGL];e.bgColor=rN((n=l.cy.container())&&n.style&&n.style.backgroundColor||"white"),e.webglTexSize=Math.min(e.webglTexSize,h.getParameter(h.MAX_TEXTURE_SIZE)),e.webglTexRows=Math.min(e.webglTexRows,54),e.webglTexRowsNodes=Math.min(e.webglTexRowsNodes,54),e.webglBatchSize=Math.min(e.webglBatchSize,16384),e.webglTexPerBatch=Math.min(e.webglTexPerBatch,h.getParameter(h.MAX_TEXTURE_IMAGE_UNITS)),l.webglDebug=e.webglDebug,l.webglDebugShowAtlases=e.webglDebugShowAtlases,s=h.createFramebuffer(),h.bindFramebuffer(h.FRAMEBUFFER,s),u=h.createTexture(),h.bindTexture(h.TEXTURE_2D,u),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MIN_FILTER,h.LINEAR),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_S,h.CLAMP_TO_EDGE),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_T,h.CLAMP_TO_EDGE),h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,u,0),h.bindFramebuffer(h.FRAMEBUFFER,null),s.setFramebufferAttachmentSizes=function(e,t){h.bindTexture(h.TEXTURE_2D,u),h.texImage2D(h.TEXTURE_2D,0,h.RGBA,e,t,0,h.RGBA,h.UNSIGNED_BYTE,null)},l.pickingFrameBuffer=s,l.pickingFrameBuffer.needsDraw=!0,l.drawing=new l1(l,h,e);var f=function(e){return function(t){return l.getTextAngle(t,e)}},d=function(e){return function(t){var n=t.pstyle(e);return n&&n.value}},b=function(e){return function(t){return t.pstyle("".concat(e,"-opacity")).value>0}},g=function(e){return"yes"===e.pstyle("text-events").strValue?2:1},w=function(e){var{x:t,y:n}=e.position(),r=e.outerWidth(),i=e.outerHeight();return{w:r,h:i,x1:t-r/2,y1:n-i/2}};l.drawing.addAtlasCollection("node",{texRows:e.webglTexRowsNodes}),l.drawing.addAtlasCollection("label",{texRows:e.webglTexRows}),l.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:t.getStyleKey,getBoundingBox:t.getElementBox,drawElement:t.drawElement}),l.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:w,isSimple:lO,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),l.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:w,isVisible:b("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),l.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:w,isVisible:b("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),l.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:g,getKey:l3(t.getLabelKey,null),getBoundingBox:l4(t.getLabelBox,null),drawClipped:!0,drawElement:t.drawLabel,getRotation:f(null),getRotationPoint:t.getLabelRotationPoint,getRotationOffset:t.getLabelRotationOffset,isVisible:d("label")}),l.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:g,getKey:l3(t.getSourceLabelKey,"source"),getBoundingBox:l4(t.getSourceLabelBox,"source"),drawClipped:!0,drawElement:t.drawSourceLabel,getRotation:f("source"),getRotationPoint:t.getSourceLabelRotationPoint,getRotationOffset:t.getSourceLabelRotationOffset,isVisible:d("source-label")}),l.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:g,getKey:l3(t.getTargetLabelKey,"target"),getBoundingBox:l4(t.getTargetLabelBox,"target"),drawClipped:!0,drawElement:t.drawTargetLabel,getRotation:f("target"),getRotationPoint:t.getTargetLabelRotationPoint,getRotationOffset:t.getTargetLabelRotationOffset,isVisible:d("target-label")});var p=rV(function(){console.log("garbage collect flag set"),l.data.gc=!0},1e4);l.onUpdateEleCalcs(function(e,t){var n=!1;t&&t.length>0&&(n|=l.drawing.invalidate(t)),n&&p()}),i=(r=l).render,r.render=function(e){e=e||{};var t,n,a,o,c=r.cy;r.webgl&&(c.zoom()>7.99?((n=(t=r).data.contexts[t.WEBGL]).clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT),i.call(r,e)):(a=r,(o=function(e){e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,a.canvasWidth,a.canvasHeight),e.restore()})(a.data.contexts[a.NODE]),o(a.data.contexts[a.DRAG]),l8(r,e,lJ)))},a=r.matchCanvasSize,r.matchCanvasSize=function(e){a.call(r,e),r.pickingFrameBuffer.setFramebufferAttachmentSizes(r.canvasWidth,r.canvasHeight),r.pickingFrameBuffer.needsDraw=!0},r.findNearestElements=function(e,t,n,i){return function(e,t,n){var r,i,a,o=function(e,t,n){var{pan:r,zoom:i}=lA(e),a=n0((f=t*i+r.x,d=n*i+r.y,[f,d=Math.round(e.canvasHeight-d)]),2),o=a[0],c=a[1],s=e.data.contexts[e.WEBGL];s.bindFramebuffer(s.FRAMEBUFFER,e.pickingFrameBuffer),e.pickingFrameBuffer.needsDraw&&(s.viewport(0,0,s.canvas.width,s.canvas.height),l8(e,null,lZ),e.pickingFrameBuffer.needsDraw=!1);var u=new Uint8Array(144);s.readPixels(o-3,c-3,6,6,s.RGBA,s.UNSIGNED_BYTE,u),s.bindFramebuffer(s.FRAMEBUFFER,null);for(var l=new Set,h=0;h<36;h++){var f,d,b,g=(b=u.slice(4*h,4*h+4))[0]+(b[1]<<8)+(b[2]<<16)+(b[3]<<24)-1;g>=0&&l.add(g)}return l}(e,t,n),c=e.getCachedZSortedEles(),s=nZ(o);try{for(s.s();!(a=s.n()).done;){var u=c[a.value];if(!r&&u.isNode()&&(r=u),!i&&u.isEdge()&&(i=u),r&&i)break}}catch(e){s.e(e)}finally{s.f()}return[r,i].filter(Boolean)}(r,e,t)},o=r.invalidateCachedZSortedEles,r.invalidateCachedZSortedEles=function(){o.call(r),r.pickingFrameBuffer.needsDraw=!0},c=r.notify,r.notify=function(e,t){c.call(r,e,t),"viewport"===e||"bounds"===e?r.pickingFrameBuffer.needsDraw=!0:"background"===e&&r.drawing.invalidate(t,{type:"node-body"})}};var l3=function(e,t){return function(n){var r=e(n),i=l2(n,t);return i.length>1?i.map(function(e,t){return"".concat(r,"_").concat(t)}):r}},l4=function(e,t){return function(n,r){var i=e(n);if("string"==typeof r){var a=r.indexOf("_");if(a>0){var o=Number(r.substring(a+1)),c=l2(n,t),s=i.h/c.length,u=s*o,l=i.y1+u;return{x1:i.x1,w:i.w,y1:l,h:s,yOffset:u}}}return i}};function l5(e,t){var n=e.canvasWidth,r=e.canvasHeight,{pan:i,zoom:a}=lA(e);t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,n,r),t.translate(i.x,i.y),t.scale(a,a)}function l6(e,t,n){var r=e.drawing;t+=1,n.isNode()?(r.drawNode(n,t,"node-underlay"),r.drawNode(n,t,"node-body"),r.drawTexture(n,t,"label"),r.drawNode(n,t,"node-overlay")):(r.drawEdgeLine(n,t),r.drawEdgeArrow(n,t,"source"),r.drawEdgeArrow(n,t,"target"),r.drawTexture(n,t,"label"),r.drawTexture(n,t,"edge-source-label"),r.drawTexture(n,t,"edge-target-label"))}function l8(e,t,n){e.webglDebug&&(p=performance.now());var r=e.drawing,i=0;if(n.screen&&e.data.canvasNeedsRedraw[e.SELECT_BOX]&&e.drawSelectionRectangle(t,function(t){return l5(e,t)}),e.data.canvasNeedsRedraw[e.NODE]||n.picking){var a,o,c,s=e.data.contexts[e.WEBGL];n.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var u=function(e){var t,n,r,i,a,o,c,s,u,l,h,f,d,b,g,w,p,v,y=e.canvasWidth,k=e.canvasHeight,{pan:x,zoom:E}=lA(e),S=lF();lK(S,S,[x.x,x.y]),lz(S,S,[E,E]);var T=lF();T[0]=2/y,T[1]=0,T[2]=0,T[3]=0,T[4]=-2/k,T[5]=0,T[6]=-1,T[7]=1,T[8]=1;var C=lF();return t=T[0],n=T[1],r=T[2],i=T[3],a=T[4],o=T[5],c=T[6],s=T[7],u=T[8],l=S[0],h=S[1],f=S[2],d=S[3],b=S[4],g=S[5],w=S[6],p=S[7],v=S[8],C[0]=l*t+h*i+f*c,C[1]=l*n+h*a+f*s,C[2]=l*r+h*o+f*u,C[3]=d*t+b*i+g*c,C[4]=d*n+b*a+g*s,C[5]=d*r+b*o+g*u,C[6]=w*t+p*i+v*c,C[7]=w*n+p*a+v*s,C[8]=w*r+p*o+v*u,C}(e),l=e.getCachedZSortedEles();if(i=l.length,r.startFrame(u,n),n.screen){for(var h=0;h<l.nondrag.length;h++)l6(e,h,l.nondrag[h]);for(var f=0;f<l.drag.length;f++)l6(e,f,l.drag[f])}else if(n.picking)for(var d=0;d<l.length;d++)l6(e,d,l[d]);r.endFrame(),n.screen&&e.webglDebugShowAtlases&&((a=e.data.contexts[e.NODE]).save(),l5(e,a),a.strokeStyle="rgba(0, 0, 0, 0.3)",a.beginPath(),a.moveTo(-1e3,0),a.lineTo(1e3,0),a.stroke(),a.beginPath(),a.moveTo(0,-1e3),a.lineTo(0,1e3),a.stroke(),a.restore(),c=0,(o=function(t,n,r){for(var i=t.atlasManager.getAtlasCollection(n),a=e.data.contexts[e.NODE],o=i.atlases,c=0;c<o.length;c++){var s=o[c].canvas;if(s){var u=s.width,l=s.height,h=u*c,f=s.height*r;a.save(),a.scale(.4,.4),a.drawImage(s,h,f),a.strokeStyle="black",a.rect(h,f,u,l),a.stroke(),a.restore()}}})(e.drawing,"node",c++),o(e.drawing,"label",c++)),e.data.canvasNeedsRedraw[e.NODE]=!1,e.data.canvasNeedsRedraw[e.DRAG]=!1}if(e.webglDebug){var b=Math.ceil(performance.now()-p),g=r.getDebugInfo(),w=["".concat(i," elements"),"".concat(g.totalInstances," instances"),"".concat(g.batchCount," batches"),"".concat(g.totalAtlases," atlases"),"".concat(g.wrappedCount," wrapped textures"),"".concat(g.simpleCount," simple shapes")].join(", ");console.log("WebGL (".concat(n.name,") - frame time ").concat(b,"ms")),console.log("Totals:"),console.log(" ".concat(w)),console.log("Texture Atlases Used:");var p,v,y=nZ(g.atlasInfo);try{for(y.s();!(v=y.n()).done;){var k=v.value;console.log(" ".concat(k.type,": ").concat(k.keyCount," keys, ").concat(k.atlasCount," atlases"))}}catch(e){y.e(e)}finally{y.f()}console.log("")}e.data.gc&&(console.log("Garbage Collect!"),e.data.gc=!1,r.gc())}var l9={};l9.drawPolygonPath=function(e,t,n,r,i,a){var o=r/2,c=i/2;e.beginPath&&e.beginPath(),e.moveTo(t+o*a[0],n+c*a[1]);for(var s=1;s<a.length/2;s++)e.lineTo(t+o*a[2*s],n+c*a[2*s+1]);e.closePath()},l9.drawRoundPolygonPath=function(e,t,n,r,i,a,o){o.forEach(function(t){return uR(e,t)}),e.closePath()},l9.drawRoundRectanglePath=function(e,t,n,r,i,a){var o=r/2,c=i/2,s="auto"===a?aT(r,i):Math.min(a,c,o);e.beginPath&&e.beginPath(),e.moveTo(t,n-c),e.arcTo(t+o,n-c,t+o,n,s),e.arcTo(t+o,n+c,t,n+c,s),e.arcTo(t-o,n+c,t-o,n,s),e.arcTo(t-o,n-c,t,n-c,s),e.lineTo(t,n-c),e.closePath()},l9.drawBottomRoundRectanglePath=function(e,t,n,r,i,a){var o=r/2,c=i/2,s="auto"===a?aT(r,i):a;e.beginPath&&e.beginPath(),e.moveTo(t,n-c),e.lineTo(t+o,n-c),e.lineTo(t+o,n),e.arcTo(t+o,n+c,t,n+c,s),e.arcTo(t-o,n+c,t-o,n,s),e.lineTo(t-o,n-c),e.lineTo(t,n-c),e.closePath()},l9.drawCutRectanglePath=function(e,t,n,r,i,a,o){var c=r/2,s=i/2,u="auto"===o?aM():o;e.beginPath&&e.beginPath(),e.moveTo(t-c+u,n-s),e.lineTo(t+c-u,n-s),e.lineTo(t+c,n-s+u),e.lineTo(t+c,n+s-u),e.lineTo(t+c-u,n+s),e.lineTo(t-c+u,n+s),e.lineTo(t-c,n+s-u),e.lineTo(t-c,n-s+u),e.closePath()},l9.drawBarrelPath=function(e,t,n,r,i){var a=r/2,o=i/2,c=t-a,s=t+a,u=n-o,l=n+o,h=aP(r,i),f=h.widthOffset,d=h.heightOffset,b=h.ctrlPtOffsetPct*f;e.beginPath&&e.beginPath(),e.moveTo(c,u+d),e.lineTo(c,l-d),e.quadraticCurveTo(c+b,l,c+f,l),e.lineTo(s-f,l),e.quadraticCurveTo(s-b,l,s,l-d),e.lineTo(s,u+d),e.quadraticCurveTo(s-b,u,s-f,u),e.lineTo(c+f,u),e.quadraticCurveTo(c+b,u,c,u+d),e.closePath()};var l7={},he={},ht=Math.PI/40;for(t6=0*Math.PI;t6<2*Math.PI;t6+=ht)l7[t6]=Math.sin(t6),he[t6]=Math.cos(t6);l9.drawEllipsePath=function(e,t,n,r,i){if(e.beginPath&&e.beginPath(),e.ellipse)e.ellipse(t,n,r/2,i/2,0,0,2*Math.PI);else for(var a,o,c=r/2,s=i/2,u=0*Math.PI;u<2*Math.PI;u+=ht)a=t-c*l7[u]*0+c*he[u]*1,o=n+s*he[u]*0+s*l7[u]*1,0===u?e.moveTo(a,o):e.lineTo(a,o);e.closePath()};var hn={};function hr(e){var t=e.indexOf(",");return e.substr(t+1)}function hi(e,t,n){var r=function(){return t.toDataURL(n,e.quality)};switch(e.output){case"blob-promise":return new oL(function(r,i){try{t.toBlob(function(e){null!=e?r(e):i(Error("`canvas.toBlob()` sent a null value in its callback"))},n,e.quality)}catch(e){i(e)}});case"blob":return function(e,t){for(var n=atob(e),r=new ArrayBuffer(n.length),i=new Uint8Array(r),a=0;a<n.length;a++)i[a]=n.charCodeAt(a);return new Blob([r],{type:t})}(hr(r()),n);case"base64":return hr(r());default:return r()}}hn.createBuffer=function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,[n,n.getContext("2d")]},hn.bufferCanvasImage=function(e){var t=this.cy,n=t.mutableElements().boundingBox(),r=this.findContainerClientCoords(),i=e.full?Math.ceil(n.w):r[2],a=e.full?Math.ceil(n.h):r[3],o=rc(e.maxWidth)||rc(e.maxHeight),c=this.getPixelRatio(),s=1;if(void 0!==e.scale)i*=e.scale,a*=e.scale,s=e.scale;else if(o){var u=1/0,l=1/0;rc(e.maxWidth)&&(u=s*e.maxWidth/i),rc(e.maxHeight)&&(l=s*e.maxHeight/a),i*=s=Math.min(u,l),a*=s}o||(i*=c,a*=c,s*=c);var h=document.createElement("canvas");h.width=i,h.height=a,h.style.width=i+"px",h.style.height=a+"px";var f=h.getContext("2d");if(i>0&&a>0){f.clearRect(0,0,i,a),f.globalCompositeOperation="source-over";var d=this.getCachedZSortedEles();if(e.full)f.translate(-n.x1*s,-n.y1*s),f.scale(s,s),this.drawElements(f,d),f.scale(1/s,1/s),f.translate(n.x1*s,n.y1*s);else{var b=t.pan(),g={x:b.x*s,y:b.y*s};s*=t.zoom(),f.translate(g.x,g.y),f.scale(s,s),this.drawElements(f,d),f.scale(1/s,1/s),f.translate(-g.x,-g.y)}e.bg&&(f.globalCompositeOperation="destination-over",f.fillStyle=e.bg,f.rect(0,0,i,a),f.fill())}return h},hn.png=function(e){return hi(e,this.bufferCanvasImage(e),"image/png")},hn.jpg=function(e){return hi(e,this.bufferCanvasImage(e),"image/jpeg")};var ha={};ha.nodeShapeImpl=function(e,t,n,r,i,a,o,c){switch(e){case"ellipse":return this.drawEllipsePath(t,n,r,i,a);case"polygon":return this.drawPolygonPath(t,n,r,i,a,o);case"round-polygon":return this.drawRoundPolygonPath(t,n,r,i,a,o,c);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,n,r,i,a,c);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,n,r,i,a,o,c);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,n,r,i,a,c);case"barrel":return this.drawBarrelPath(t,n,r,i,a)}};var ho=hc.prototype;function hc(e){var t=this,n=t.cy.window().document;e.webgl&&(ho.CANVAS_LAYERS=t.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),t.data={canvases:Array(ho.CANVAS_LAYERS),contexts:Array(ho.CANVAS_LAYERS),canvasNeedsRedraw:Array(ho.CANVAS_LAYERS),bufferCanvases:Array(ho.BUFFER_COUNT),bufferContexts:Array(ho.CANVAS_LAYERS)};var r="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";t.data.canvasContainer=n.createElement("div");var a=t.data.canvasContainer.style;t.data.canvasContainer.style[r]=i,a.position="relative",a.zIndex="0",a.overflow="hidden";var o=e.cy.container();o.appendChild(t.data.canvasContainer),o.style[r]=i;var c={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};n8&&n8.userAgent.match(/msie|trident|edge/i)&&(c["-ms-touch-action"]="none",c["touch-action"]="none");for(var s=0;s<ho.CANVAS_LAYERS;s++){var u=t.data.canvases[s]=n.createElement("canvas"),l=ho.CANVAS_TYPES[s];t.data.contexts[s]=u.getContext(l),t.data.contexts[s]||ir("Could not create canvas of type "+l),Object.keys(c).forEach(function(e){u.style[e]=c[e]}),u.style.position="absolute",u.setAttribute("data-id","layer"+s),u.style.zIndex=String(ho.CANVAS_LAYERS-s),t.data.canvasContainer.appendChild(u),t.data.canvasNeedsRedraw[s]=!1}t.data.topCanvas=t.data.canvases[0],t.data.canvases[ho.NODE].setAttribute("data-id","layer"+ho.NODE+"-node"),t.data.canvases[ho.SELECT_BOX].setAttribute("data-id","layer"+ho.SELECT_BOX+"-selectbox"),t.data.canvases[ho.DRAG].setAttribute("data-id","layer"+ho.DRAG+"-drag"),t.data.canvases[ho.WEBGL]&&t.data.canvases[ho.WEBGL].setAttribute("data-id","layer"+ho.WEBGL+"-webgl");for(var s=0;s<ho.BUFFER_COUNT;s++)t.data.bufferCanvases[s]=n.createElement("canvas"),t.data.bufferContexts[s]=t.data.bufferCanvases[s].getContext("2d"),t.data.bufferCanvases[s].style.position="absolute",t.data.bufferCanvases[s].setAttribute("data-id","buffer"+s),t.data.bufferCanvases[s].style.zIndex=String(-s-1),t.data.bufferCanvases[s].style.visibility="hidden";t.pathsEnabled=!0;var h=iZ(),f=function(e){return{x:-e.w/2,y:-e.h/2}},d=function(e){return e[0]._private.nodeKey},b=function(e){return e[0]._private.labelStyleKey},g=function(e){return e[0]._private.sourceLabelStyleKey},w=function(e){return e[0]._private.targetLabelStyleKey},p=function(e,n,r,i,a){return t.drawElement(e,n,r,!1,!1,a)},v=function(e,n,r,i,a){return t.drawElementText(e,n,r,i,"main",a)},y=function(e,n,r,i,a){return t.drawElementText(e,n,r,i,"source",a)},k=function(e,n,r,i,a){return t.drawElementText(e,n,r,i,"target",a)},x=function(e){return e.boundingBox(),e[0]._private.bodyBounds},E=function(e){return e.boundingBox(),e[0]._private.labelBounds.main||h},S=function(e){return e.boundingBox(),e[0]._private.labelBounds.source||h},T=function(e){return e.boundingBox(),e[0]._private.labelBounds.target||h},C=function(e,t){return t},M=function(e){var t;return{x:((t=x(e)).x1+t.x2)/2,y:(t.y1+t.y2)/2}},P=function(e,t,n){var r=e?e+"-":"";return{x:t.x+n.pstyle(r+"text-margin-x").pfValue,y:t.y+n.pstyle(r+"text-margin-y").pfValue}},j=function(e,t,n){var r=e[0]._private.rscratch;return{x:r[t],y:r[n]}},I=function(e){return P("",j(e,"labelX","labelY"),e)},A=function(e){return P("source",j(e,"sourceLabelX","sourceLabelY"),e)},O=function(e){return P("target",j(e,"targetLabelX","targetLabelY"),e)},N=function(e){return f(x(e))},L=function(e){return f(S(e))},D=function(e){return f(T(e))},R=function(e){var t=E(e),n=f(E(e));if(e.isNode()){switch(cm(e.pstyle("text-halign").value)){case"left":n.x=-t.w-(t.leftPad||0);break;case"right":n.x=-(t.rightPad||0)}switch(cy(e.pstyle("text-valign").value)){case"top":n.y=-t.h-(t.topPad||0);break;case"bottom":n.y=-(t.botPad||0)}}return n},_=t.data.eleTxrCache=new lr(t,{getKey:d,doesEleInvalidateKey:function(e){var t=e[0]._private;return t.oldBackgroundTimestamp!==t.backgroundTimestamp},drawElement:p,getBoundingBox:x,getRotationPoint:M,getRotationOffset:N,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),B=t.data.lblTxrCache=new lr(t,{getKey:b,drawElement:v,getBoundingBox:E,getRotationPoint:I,getRotationOffset:R,isVisible:C}),F=t.data.slbTxrCache=new lr(t,{getKey:g,drawElement:y,getBoundingBox:S,getRotationPoint:A,getRotationOffset:L,isVisible:C}),$=t.data.tlbTxrCache=new lr(t,{getKey:w,drawElement:k,getBoundingBox:T,getRotationPoint:O,getRotationOffset:D,isVisible:C}),K=t.data.lyrTxrCache=new la(t);t.onUpdateEleCalcs(function(e,t){_.invalidateElements(t),B.invalidateElements(t),F.invalidateElements(t),$.invalidateElements(t),K.invalidateElements(t);for(var n=0;n<t.length;n++){var r=t[n]._private;r.oldBackgroundTimestamp=r.backgroundTimestamp}});var H=function(e){for(var t=0;t<e.length;t++)K.enqueueElementRefinement(e[t].ele)};_.onDequeue(H),B.onDequeue(H),F.onDequeue(H),$.onDequeue(H),e.webgl&&t.initWebgl(e,{getStyleKey:d,getLabelKey:b,getSourceLabelKey:g,getTargetLabelKey:w,drawElement:p,drawLabel:v,drawSourceLabel:y,drawTargetLabel:k,getElementBox:x,getLabelBox:E,getSourceLabelBox:S,getTargetLabelBox:T,getElementRotationPoint:M,getElementRotationOffset:N,getLabelRotationPoint:I,getSourceLabelRotationPoint:A,getTargetLabelRotationPoint:O,getLabelRotationOffset:R,getSourceLabelRotationOffset:L,getTargetLabelRotationOffset:D})}ho.CANVAS_LAYERS=3,ho.SELECT_BOX=0,ho.DRAG=1,ho.NODE=2,ho.WEBGL=3,ho.CANVAS_TYPES=["2d","2d","2d","webgl2"],ho.BUFFER_COUNT=3,ho.TEXTURE_BUFFER=0,ho.MOTIONBLUR_BUFFER_NODE=1,ho.MOTIONBLUR_BUFFER_DRAG=2,ho.redrawHint=function(e,t){switch(e){case"eles":this.data.canvasNeedsRedraw[ho.NODE]=t;break;case"drag":this.data.canvasNeedsRedraw[ho.DRAG]=t;break;case"select":this.data.canvasNeedsRedraw[ho.SELECT_BOX]=t;break;case"gc":this.data.gc=!0}};var hs="u">typeof Path2D;ho.path2dEnabled=function(e){if(void 0===e)return this.pathsEnabled;this.pathsEnabled=!!e},ho.usePaths=function(){return hs&&this.pathsEnabled},ho.setImgSmoothing=function(e,t){null!=e.imageSmoothingEnabled?e.imageSmoothingEnabled=t:(e.webkitImageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t)},ho.getImgSmoothing=function(e){return null!=e.imageSmoothingEnabled?e.imageSmoothingEnabled:e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled},ho.makeOffscreenCanvas=function(e,t){var n;return("u"<typeof OffscreenCanvas?"undefined":n4(OffscreenCanvas))!=="undefined"?n=new OffscreenCanvas(e,t):((n=this.cy.window().document.createElement("canvas")).width=e,n.height=t),n},[ls,lb,lk,lE,lS,lC,lP,l0,l9,hn,ha].forEach(function(e){rj(ho,e)});var hu=[{name:"null",impl:uT},{name:"base",impl:u6},{name:"canvas",impl:hc}],hl={},hh={};function hf(e,t,n){var r=n,i=function(n){ia("Can not register `"+t+"` for `"+e+"` since `"+n+"` already exists in the prototype and can not be overridden")};if("core"===e)if(sX.prototype[t])return i(t);else sX.prototype[t]=n;else if("collection"===e)if(sp.prototype[t])return i(t);else sp.prototype[t]=n;else if("layout"===e){for(var a=function(e){this.options=e,n.call(this,e),ro(this._private)||(this._private={}),this._private.cy=e.cy,this._private.listeners=[],this.createEmitter()},o=a.prototype=Object.create(n.prototype),c=[],s=0;s<c.length;s++){var u=c[s];o[u]=o[u]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this});var l=n.prototype.stop;o.stop=function(){var e=this.options;if(e&&e.animate){var t=this.animations;if(t)for(var n=0;n<t.length;n++)t[n].stop()}return l?l.call(this):this.emit("layoutstop"),this},o.destroy||(o.destroy=function(){return this}),o.cy=function(){return this._private.cy};var h=function(e){return e._private.cy},f={addEventFields:function(e,t){t.layout=e,t.cy=h(e),t.target=e},bubble:function(){return!0},parent:function(e){return h(e)}};rj(o,{createEmitter:function(){return this._private.emitter=new cQ(f,this),this},emitter:function(){return this._private.emitter},on:function(e,t){return this.emitter().on(e,t),this},one:function(e,t){return this.emitter().one(e,t),this},once:function(e,t){return this.emitter().one(e,t),this},removeListener:function(e,t){return this.emitter().removeListener(e,t),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(e,t){return this.emitter().emit(e,t),this}}),oQ.eventAliasesOn(o),r=a}else if("renderer"===e&&"null"!==t&&"base"!==t){var d=hd("renderer","base"),b=d.prototype,g=n.prototype,w=function(){d.apply(this,arguments),n.apply(this,arguments)},p=w.prototype;for(var v in b){var y=b[v];if(null!=g[v])return i(v);p[v]=y}for(var k in g)p[k]=g[k];b.clientFunctions.forEach(function(e){p[e]=p[e]||function(){ir("Renderer does not implement `renderer."+e+"()` on its prototype")}}),r=w}else if("__proto__"===e||"constructor"===e||"prototype"===e)return ir(e+" is an illegal type to be registered, possibly lead to prototype pollutions");return rD({map:hl,keys:[e,t],value:r})}function hd(e,t){return rR({map:hl,keys:[e,t]})}function hb(e,t,n,r,i){return rD({map:hh,keys:[e,t,n,r],value:i})}function hg(e,t,n,r){return rR({map:hh,keys:[e,t,n,r]})}var hw=function(){return 2==arguments.length?hd.apply(null,arguments):3==arguments.length?hf.apply(null,arguments):4==arguments.length?hg.apply(null,arguments):5==arguments.length?hb.apply(null,arguments):void ir("Invalid extension access syntax")};sX.prototype.extension=hw,[{type:"layout",extensions:uS},{type:"renderer",extensions:hu}].forEach(function(e){e.extensions.forEach(function(t){hf(e.type,t.name,t.impl)})});var hp=function(){if(!(this instanceof hp))return new hp;this.length=0},hv=hp.prototype;hv.instanceString=function(){return"stylesheet"},hv.selector=function(e){return this[this.length++]={selector:e,properties:[]},this},hv.css=function(e,t){var n=this.length-1;if(rr(e))this[n].properties.push({name:e,value:t});else if(ro(e))for(var r=Object.keys(e),i=0;i<r.length;i++){var a=r[i],o=e[a];if(null!=o){var c=sV.properties[a]||sV.properties[rm(a)];if(null!=c){var s=c.name;this[n].properties.push({name:s,value:o})}}}return this},hv.style=hv.css,hv.generateStyle=function(e){var t=new sV(e);return this.appendToStyle(t)},hv.appendToStyle=function(e){for(var t=0;t<this.length;t++){var n=this[t],r=n.selector,i=n.properties;e.selector(r);for(var a=0;a<i.length;a++){var o=i[a];e.css(o.name,o.value)}}return e};var hm=function(e){return(void 0===e&&(e={}),ro(e))?new sX(e):rr(e)?hw.apply(hw,arguments):void 0};function hy(e,t,n,r){return hx.map(([i,a])=>{let o=e=>{var i,o,c,s;let u=e.target;"object"==typeof(i=u)&&null!==i&&"id"in i&&"function"==typeof i.id&&(o=n.current,c=t,s={id:u.id(),type:a},"node"===c?o.onNodeEvent?.(s):o.onEdgeEvent?.(s),r())};return e.on(i,t,o),{cytoscapeEvent:i,handler:o}})}function hk(e,t,n){for(let{cytoscapeEvent:r,handler:i}of n)e.off(r,t,i)}hm.use=function(e){var t=Array.prototype.slice.call(arguments,1);return t.unshift(hm),e.apply(null,t),this},hm.warnings=function(e){return ii(e)},hm.version="3.34.3",hm.stylesheet=hm.Stylesheet=hp;var hx=[["tap","press"],["dbltap","double-press"],["select","select"],["unselect","unselect"],["mouseover","pointer-enter"],["mouseout","pointer-leave"]];function hE(e,t,n,r){e.batch(()=>{e.nodes().not(":parent").positions(e=>{let i=t.get(e.id())??e.position();return{x:n.x+(i.x-n.x)*r,y:n.y+(i.y-n.y)*r}})})}function hS(e,t){let n=e.nodes().map(e=>({id:e.id(),box:e.boundingBox({includeLabels:!0,includeOverlays:!1,includeUnderlays:!1})})).sort((e,t)=>e.box.x1-t.box.x1),r={remaining:2e5};for(let[e,i]of n.entries())for(let a=e+1;a<n.length;a+=1){let e=n.at(a);if(!e||e.box.x1>=i.box.x2+8)break;if(--r.remaining<0||!(t.get(i.id)?.has(e.id)||t.get(e.id)?.has(i.id))&&i.box.y1<e.box.y2+8&&e.box.y1<i.box.y2+8)return!0}return!1}function hT(e,t){let n=t.min*t.scale;e.minZoom(Math.min(e.minZoom(),n)),e.maxZoom(Math.max(n,t.max*t.scale,t.readableZoom)),e.minZoom(n)}function hC(e,t){return void 0!==e&&Number.isFinite(e)&&e>0?e:t}function hM(e,t){e.zoom({level:t,renderedPosition:{x:e.width()/2,y:e.height()/2}})}function hP(e){let t=globalThis.requestAnimationFrame;t?t(e):setTimeout(e,0)}function hj(e){return JSON.stringify(e.nodes().map(e=>{if(e.isParent())return[e.id()];let t=e.layoutDimensions({nodeDimensionsIncludeLabels:!0});return[e.id(),t.w,t.h]}))}function hI(e,t){return JSON.stringify([e.map(e=>[e.id,e.parentId??null]).sort(),t.map(e=>[e.id??null,e.source,e.target]).sort()])}function hA(e,t){if(e.destroyed())return[];let n=e.zoom();return e.nodes().map(e=>({hovered:t.has(e.id()),id:e.id(),position:e.renderedPosition(),selected:e.selected(),zoom:n}))}var hO=((e,t)=>{var n=null!=e&&"object"==typeof e;if(n){var r=d??=new WeakMap,i=r.get(e);if(i)return i}t=null!=e?nH(nz(e)):{};let a=e&&e.__esModule&&nq.call(e,"default")?t:nV(t,"default",{value:e,enumerable:!0});if(e&&"object"==typeof e||"function"==typeof e)for(let t of nU(e))nq.call(a,t)||nV(a,t,{get:nG.bind(e,t),enumerable:!0});return n&&r.set(e,a),a})(nW()),hN=null!=Object.assign?Object.assign.bind(Object):function(e,...t){return t.forEach(t=>{Object.keys(t).forEach(n=>e[n]=t[n])}),e},hL={nodeDimensionsIncludeLabels:!1,fit:!0,padding:20,animate:!1,animateFilter:function(){return!0},animationDuration:500,animationEasing:void 0,transform:function(e,t){return t},ready:void 0,stop:void 0,nodeLayoutOptions:void 0,elk:{algorithm:void 0},priority:function(){return null}},hD={},hR=function(e,t){let n=e.layoutDimensions(t),r=e.parent(),i=e.scratch("elk"),a={x:i.x,y:i.y};for(;r.nonempty();){let e=r.scratch("elk");a.x+=e.x,a.y+=e.y,r=r.parent()}return a.x+=n.w/2,a.y+=n.h/2,a},h_=function(e,t){let n={_cyEle:e,id:e.id()};if(t.nodeLayoutOptions&&(n.layoutOptions=t.nodeLayoutOptions(e)),!e.isParent()){let r=e.layoutDimensions(t),i=e.position();n.x=i.x-r.w/2,n.y=i.y-r.h/2,n.width=r.w,n.height=r.h}return e.scratch("elk",n),n},hB=function(e){let t={_cyEle:e,id:e.id(),source:e.data("source"),target:e.data("target")};return e.scratch("elk",t),t},hF=function(e,t,n){let r=[],i=[],a={},o={id:"root",children:[],edges:[]};for(let t=0;t<e.length;t++){let i=e[t],o=h_(i,n);r.push(o),a[i.id()]=o}for(let e=0;e<t.length;e++){let n=t[e],r=hB(n);i.push(r),a[n.id()]=r}for(let e=0;e<r.length;e++){let t=r[e],n=t._cyEle;if(n.isChild()){let e=a[n.parent().id()];(e.children=e.children||[]).push(t)}else o.children.push(t)}for(let e=0;e<i.length;e++){let t=i[e];o.edges.push(t)}return o},h$=class{constructor(e){const t=e.elk,{cy:n}=e;this.options=hN({},hL,e),this.options.elk=hN({aspectRatio:n.width()/n.height()},hL.elk,t,hD)}run(){let e=this,{options:t}=this,{eles:n}=t,r=n.nodes(),i=n.edges(),a=new hO.default,o=hF(r,i,t);return o.layoutOptions=t.elk,a.layout(o).then(()=>{r.filter(e=>!e.isParent()).layoutPositions(e,t,e=>hR(e,t))}),this}stop(){return this}destroy(){return this}};function hK(e){Object.assign(this,new h$(e))}function hH(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function hz(e){return{...e.layoutOptions??{},name:e.layout,spacingFactor:e.spacingFactor,nodeDimensionsIncludeLabels:!0,fit:!1,animate:!1}}function hV(e,t,n){let r=new Set,i=n.get(t);for(;void 0!==i&&!r.has(i);){if(i===e)return!0;r.add(i),i=n.get(i)}return!1}function hU(e,t){let n=e.generationRef.current+1;e.generationRef.current=n,e.layoutRunningRef.current=!0,e.cy.resize(),e.layoutRef.current=function(e,t,n){if("elk"===t.layout){var r,i;let a,o,c,s,u,l;return r=hz(t),(l=hm({headless:!0,styleEnabled:!0,elements:(i=e).elements().map(e=>{let t=e.data();return{data:hH(t)?{...t}:{},classes:e.classes()}}),style:[{selector:"node",style:{label:"",padding:"0px","border-width":0}}]})).batch(()=>{i.nodes().forEach(e=>{if(e.isParent()){let t=e.style("padding");"string"==typeof t&&l.getElementById(e.id()).style({padding:t});return}let t=e.layoutDimensions({nodeDimensionsIncludeLabels:!0});l.getElementById(e.id()).style({width:t.w,height:t.h})})}),a=l,o={stopped:!1},c="elk"in r?r.elk:void 0,s={...r,fit:!1,animate:!1,elk:{aspectRatio:e.width()/Math.max(e.height(),1),...hH(c)?c:{}}},(u=a.layout(s)).one("layoutstop",()=>{try{if(o.stopped||e.destroyed())return;e.batch(()=>{e.nodes().not(":parent").positions(e=>a.getElementById(e.id()).position())}),n()}finally{a.destroy()}}),u.run(),{stop(){o.stopped=!0}}}let a=e.layout(hz(t)),o=()=>n();return a.one("layoutstop",o),a.run(),{stop(){var e=a,t=o;e.off("layoutstop",t);try{e.stop()}catch{}}}}(e.cy,{layout:t.layout??"concentric",layoutOptions:t.layoutOptions,spacingFactor:t.spacingFactor??1},()=>{var t,r;return t=e,r=n,void hP(()=>{var e,n,i;if(t.cy.destroyed()||r!==t.generationRef.current)return;if(t.loopSizer.update(),t.layoutRef.current=null,t.cy.resize(),t.layoutRunningRef.current=!1,!((i=t.cy).width()>0&&i.height()>0))return;let a=t.latestUpdateRef.current;if(null===a)return;let o=hI(a.nodes,a.edges),c=(e=t.readyRef.current,n=o!==t.settledTopologyRef.current,!e||n);t.viewport.settle(c),t.settledTopologyRef.current=o;let s=t.fitRequestRef.current;t.fitRequestRef.current=null,s&&hq(t,s),hW(t),t.readyRef.current||(t.readyRef.current=!0,t.callbacksRef.current.onReady?.(t.controller)),t.callbacksRef.current.onLayoutComplete?.(t.controller)})})}function hq(e,t){if(e.cy.destroyed())return;if(e.layoutRunningRef.current){e.fitRequestRef.current=t;return}let n=e.latestUpdateRef.current;if(!n)return;let r=e.optimizedSpacingRef.current??n.spacingFactor??1,i=function(e,t){let n=e.nodes(":childless");if(n.length<2||e.nodes().length>2e3||n.filter(":locked").length>0)return t;let r=new Map(e.nodes().map(e=>[e.id(),new Set(e.ancestors().map(e=>e.id()))]));if(hS(e,r))return t;let i=new Map(n.map(e=>[e.id(),{...e.position()}])),a=n.boundingBox(),o={x:(a.x1+a.x2)/2,y:(a.y1+a.y2)/2},c={low:Math.min(1,.1/t),high:1};for(let t of Array.from({length:8},(e,t)=>t)){let n=0===t?c.low:(c.low+c.high)/2;if(hE(e,i,o,n),hS(e,r)?c.low=n:c.high=n,c.high===c.low)break}return hE(e,i,o,c.high),t*c.high}(e.cy,r);e.geometryRef.current=hj(e.cy),e.loopSizer.update(),e.viewport.settle(!1),e.controller.fit({...t,optimizeSpacing:!1}),i!==r&&(e.optimizedSpacingRef.current=i,e.callbacksRef.current.onSpacingFactorChange?.(i)),hW(e)}function hG(e){e.generationRef.current+=1,e.layoutRunningRef.current=!1,e.layoutRef.current?.stop(),e.layoutRef.current=null}function hX(e,t,n){let r=e.getElementById(t);r.empty()||r.style({height:n.height,width:n.width})}function hW(e){if(0===e.renderedNodeListeners.size)return;let t=hA(e.cy,e.hoveredNodeIds);for(let n of e.renderedNodeListeners)n(t)}function hY(e){let t=ne.default.useMemo(()=>new Map(e.nodes.map(e=>[e.id,e])),[e.nodes]);return(0,t7.jsx)("div",{"aria-hidden":!0,style:{inset:0,overflow:"hidden",pointerEvents:"none",position:"absolute"},children:e.renderedNodes.map(n=>{let r=t.get(n.id);return r?(0,t7.jsx)(hQ,{node:r,renderedNode:n,renderNode:e.renderNode,onNodeEvent:e.onNodeEvent,onNodeSize:e.onNodeSize},r.id):null})})}function hQ(e){let t=ne.default.useRef(null),{node:n,onNodeSize:r,renderedNode:i}=e;return ne.default.useLayoutEffect(()=>{let e=t.current;if(null===e)return;hJ(e,n.id,r);let i=globalThis.ResizeObserver??null;if(null===i)return;let a=new i(()=>hJ(e,n.id,r));return a.observe(e),()=>a.disconnect()},[n.id,r]),(0,t7.jsx)("div",{ref:e=>{t.current=e},style:{left:i.position.x,pointerEvents:"auto",position:"absolute",top:i.position.y,transform:`translate(-50%, -50%) scale(${i.zoom})`,transformOrigin:"center"},onClick:()=>e.onNodeEvent(n.id,"press"),onDoubleClick:()=>e.onNodeEvent(n.id,"double-press"),onMouseEnter:()=>e.onNodeEvent(n.id,"pointer-enter"),onMouseLeave:()=>e.onNodeEvent(n.id,"pointer-leave"),children:e.renderNode({hovered:i.hovered,node:n,selected:i.selected,zoom:i.zoom})})}function hJ(e,t,n){"number"!=typeof e.offsetWidth||"number"!=typeof e.offsetHeight||e.offsetWidth<=0||e.offsetHeight<=0||n(t,{width:e.offsetWidth,height:e.offsetHeight})}function hZ(e){let{containerRef:t,renderedNodes:n,runtimeRef:r}=function(e){var t,n,r,i,a,o,c,s,u,l,h;let f=ne.default.useRef(null),d=ne.default.useRef(null),b=function(e){var t;let n=ne.default.useRef({onEdgeEvent:(t=e).onEdgeEvent,onLayoutComplete:t.onLayoutComplete,onNodeEvent:t.onNodeEvent,onReady:t.onReady,onViewportChange:t.onViewportChange,onSpacingFactorChange:t.onSpacingFactorChange}),{onEdgeEvent:r,onLayoutComplete:i,onNodeEvent:a,onReady:o,onViewportChange:c,onSpacingFactorChange:s}=e;return ne.default.useEffect(()=>{n.current={onEdgeEvent:r,onLayoutComplete:i,onNodeEvent:a,onReady:o,onViewportChange:c,onSpacingFactorChange:s}},[r,i,a,o,c,s]),n}(e),[g,w]=ne.default.useState([]);return t=f,n=d,r=b,ne.default.useEffect(()=>{let e,i=t.current;if(null===i)return;let a=(e=function(e,t,n){var r,i;let a,o,c,s,u,l,h={current:50},f=(r=e=>hq(k,e),a={scale:1,relative:!1,min:.05,max:2,readableSize:0,fitSize:1/0,readableZoom:0,fitZoom:1/0},{controller:o={fit(t){t?.optimizeSpacing&&!t.nodeIds?.length&&r?r(t):function(e,t={},n=1/0){if(e.destroyed())return;let r=function(e,t){if(void 0===t||0===t.length)return e.nodes();let n=new Set(t);return e.nodes().filter(e=>n.has(e.id()))}(e,t.nodeIds);!r.empty()&&(e.fit(r,t.padding??50),e.zoom()>n&&(e.zoom(n),e.center(r)))}(e,{nodeIds:t?.nodeIds,padding:t?.padding??h.current},a.fitZoom)},getViewport:()=>({pan:e.pan(),zoom:e.zoom()/a.scale}),getZoomRange:()=>({min:e.minZoom()/a.scale,max:e.maxZoom()/a.scale}),setPan(t){e.pan(t)},setZoom(t){hM(e,t*a.scale)},zoomBy(t){hM(e,e.zoom()*t)}},configure(t){a.relative="fit-relative"===t.zoomMode,a.min=t.minZoom??.05,a.max=t.maxZoom??2,a.readableSize=hC(t.minReadableLabelSize,0),a.fitSize=hC(t.maxFitLabelSize,1/0),a.relative||(a.scale=1),hT(e,a)},settle(t){let n=e.zoom()/a.scale,r=e.nodes().filter(e=>!e.isParent()&&!!e.style("label")).map(e=>Number.parseFloat(String(e.style("font-size")))).filter(e=>Number.isFinite(e)&&e>0);a.readableZoom=r.length?a.readableSize/r.reduce((e,t)=>Math.min(e,t),1/0):0,a.fitZoom=r.length?a.fitSize/r.reduce((e,t)=>Math.max(e,t),0):1/0,a.scale=a.relative?Math.min(function(e,t){if(e.nodes().empty())return 1;let n=e.nodes().boundingBox(),r=e.width()-2*t,i=e.height()-2*t;return r<=0||i<=0||n.w<=0||n.h<=0?1:Math.min(r/n.w,i/n.h)}(e,h.current),a.fitZoom):1,hT(e,a),t?o.fit():a.relative&&(hM(e,n*a.scale),e.center(e.nodes()))}}),{controller:d}=f,b={current:!1},g={current:!1},w=new Set,p={fitRequestRef:{current:null},optimizedSpacingRef:{current:null},callbacksRef:n,controller:d,viewport:f,cy:e,fitPaddingRef:h,generationRef:{current:0},geometryRef:{current:null},hoveredNodeIds:new Set,latestUpdateRef:{current:null},layoutRef:{current:null},layoutRunningRef:b,nodeSizes:new Map,labelSizedNodeIds:new Set,loopSizer:(c=new Map,{reset:function(){for(let t of c.keys())e.getElementById(t).removeStyle("control-point-step-size control-point-distances");c.clear()},update:function(){let t=e.edges(":loop"),n=new Set(t.map(e=>e.id()));for(let t of c.keys())n.has(t)||(e.getElementById(t).removeStyle("control-point-step-size control-point-distances"),c.delete(t));e.batch(()=>{t.forEach(e=>{let t=e.source(),n=c.get(e.id())??{step:Number.parseFloat(String(e.style("control-point-step-size")))||40,distance:Number.parseFloat(String(e.style("control-point-distances")))||40};c.set(e.id(),n);let r=Math.max(16,e.width()*Number.parseFloat(String(e.style("arrow-scale")))*2),i=(Math.hypot(t.outerWidth(),t.outerHeight())/2+r)/1.4,a=Math.max(n.step,i),o=Math.max(n.distance,i);Number.parseFloat(String(e.style("control-point-step-size")))!==a&&e.style("control-point-step-size",a),Number.parseFloat(String(e.style("control-point-distances")))!==o&&e.style("control-point-distances",o)})})}}),readyRef:g,settledTopologyRef:{current:null},relayoutScheduledRef:{current:!1},renderedNodeListeners:w},v=(s=hy(e,"node",n,i=()=>hW(p)),u=hy(e,"edge",n,i),l=()=>{n.current.onViewportChange?.(d.getViewport()),i()},e.on("zoom pan",l),()=>{hk(e,"node",s),hk(e,"edge",u),e.off("zoom pan",l)}),y=function(e){let t=globalThis.ResizeObserver??null;if(null===t)return null;let n={height:-1,width:-1},r=new t(t=>{var r,i,a;let o=t.at(0);void 0===o||(r=n,i=o.contentRect,r.height===i.height&&r.width===i.width)||(n.height=o.contentRect.height,n.width=o.contentRect.width,e.readyRef.current&&!e.layoutRunningRef.current&&(a=e,hP(()=>{a.cy.destroyed()||a.layoutRunningRef.current||(a.cy.resize(),a.settleViewport(),a.onViewportSettled())})))});return r.observe(e.container),r}({container:t,cy:e,settleViewport:()=>f.settle(!0),layoutRunningRef:b,onViewportSettled:()=>hW(p),readyRef:g}),k={...p,resizeObserver:y,unbindEvents:v};return k}(hm({container:i,elements:[],minZoom:.05,maxZoom:2,selectionType:"additive",userPanningEnabled:!0}),i,r),{destroy:()=>{var t;return t=e,void(t.resizeObserver?.disconnect(),hG(t),t.unbindEvents(),t.renderedNodeListeners.clear(),t.cy.destroyed()||t.cy.destroy())},handleOverlayNodeEvent:(t,n)=>{var r,i,a;return r=e,i=t,void("pointer-enter"===(a=n)&&r.hoveredNodeIds.add(i),"pointer-leave"===a&&r.hoveredNodeIds.delete(i),"press"===a&&r.cy.getElementById(i).select(),r.callbacksRef.current.onNodeEvent?.({id:i,type:a}),hW(r))},setNodeSize:(t,n)=>{var r,i,a,o;let c;return r=e,i=t,a=n,c=r.nodeSizes.get(i),void((c?.width!==a.width||c.height!==a.height)&&(r.nodeSizes.set(i,a),hX(r.cy,i,a),(o=r).relayoutScheduledRef.current||(o.relayoutScheduledRef.current=!0,hP(()=>{o.relayoutScheduledRef.current=!1;let e=o.latestUpdateRef.current;null===e||o.cy.destroyed()||(hG(o),hU(o,e))}))))},setSelectedNodeIds:t=>(function(e,t){if(e.cy.destroyed()||void 0===t)return;let n=new Set(t);e.cy.nodes().forEach(e=>{n.has(e.id())?e.select():e.unselect()}),hW(e)})(e,t),subscribeRenderedNodes:t=>{var n,r;return n=e,r=t,n.renderedNodeListeners.add(r),r(hA(n.cy,n.hoveredNodeIds)),()=>{n.renderedNodeListeners.delete(r)}},update:t=>(function(e,t){if(e.cy.destroyed())return;let n=e.latestUpdateRef.current,r=null!==e.optimizedSpacingRef.current&&e.optimizedSpacingRef.current===t.spacingFactor,i=r&&n?{...n,spacingFactor:t.spacingFactor}:n;r&&(e.optimizedSpacingRef.current=null),e.latestUpdateRef.current=t,e.fitPaddingRef.current=t.fitPadding??50,e.viewport.configure(t),e.cy.batch(()=>{var n,r,a;let o;(i?.nodes!==t.nodes||i.edges!==t.edges)&&function(e,t,n){let r,i;if(e.destroyed())return;let a=(r=new Set(t.map(e=>e.id)),i=new Map(t.flatMap(e=>e.parentId?[[e.id,e.parentId]]:[])),[...t.map(e=>({group:"nodes",classes:e.classes??"",data:{...e.data??{},id:e.id,label:e.label??e.id,parent:e.parentId}})),...n.flatMap((e,t)=>{var n,a,o,c;return n=e,a=t,o=r,c=i,!o.has(n.source)||!o.has(n.target)||hV(n.source,n.target,c)||hV(n.target,n.source,c)?[]:[{group:"edges",classes:n.classes??"",data:{...n.data??{},id:n.id??`${n.source}->${n.target}:${a}`,source:n.source,target:n.target}}]})]);e.batch(()=>{for(let t of a){let n=e.getElementById(t.data.id??""),r=n.data(),i=Object.keys(hH(r)?r:{}).filter(e=>!Object.hasOwn(t.data,e));i.length>0&&n.removeData(i.join(" "))}e.json({elements:a})})}(e.cy,t.nodes,t.edges),(i?.styleRules!==t.styleRules||i?.richNodeRendering!==t.richNodeRendering)&&(e.loopSizer.reset(),n=e.cy,r=t.styleRules,a=t.richNodeRendering,o=[...r??[]],a&&o.push({selector:"node",style:{"background-opacity":0,"border-width":0,label:"","overlay-opacity":0}}),o.length>0&&n.style(o).update())}),function(e,t,n){if(!n){for(let n of t)e.getElementById(n).removeStyle("width height");t.clear();return}let r=new Set;for(let n of(e.nodes(":childless").forEach(e=>{let t=e.boundingBox({includeNodes:!1,includeEdges:!1,includeLabels:!0,includeOverlays:!1,includeUnderlays:!1});if(t.w<=0||t.h<=0)return;let n=Math.ceil(t.w),i=Math.ceil(t.h);(e.width()!==n||e.height()!==i)&&e.style({width:n,height:i}),r.add(e.id())}),t))r.has(n)||(e.getElementById(n).removeStyle("width height"),t.delete(n));for(let e of r)t.add(e)}(e.cy,e.labelSizedNodeIds,!0===t.sizeNodesToLabels&&!t.richNodeRendering),function(e){for(let[t,n]of e.nodeSizes)hX(e.cy,t,n)}(e),e.loopSizer.update();let a=hj(e.cy),o=a!==e.geometryRef.current||null===i||i.layout!==t.layout||i.spacingFactor!==t.spacingFactor||i.layoutOptions!==t.layoutOptions||i.richNodeRendering!==t.richNodeRendering||hI(i.nodes,i.edges)!==hI(t.nodes,t.edges);if(e.geometryRef.current=a,!o){(i?.zoomMode!==t.zoomMode||i?.fitPadding!==t.fitPadding||i?.minZoom!==t.minZoom||i?.maxZoom!==t.maxZoom||i?.minReadableLabelSize!==t.minReadableLabelSize||i?.maxFitLabelSize!==t.maxFitLabelSize)&&e.viewport.settle(i?.zoomMode!==t.zoomMode),hW(e),e.layoutRunningRef.current||e.callbacksRef.current.onLayoutComplete?.(e.controller);return}hG(e),e.fitRequestRef.current=null,e.optimizedSpacingRef.current=null,hU(e,t)})(e,t)});return n.current=a,()=>{a.destroy(),n.current=null}},[r,t,n]),function(e,t){let{edges:n,fitPadding:r,layout:i,layoutOptions:a,maxZoom:o,minReadableLabelSize:c,maxFitLabelSize:s,minZoom:u,zoomMode:l,sizeNodesToLabels:h,nodes:f,renderNode:d,spacingFactor:b,styleRules:g}=t;ne.default.useEffect(()=>{e.current?.update({edges:n,fitPadding:r,layout:i,layoutOptions:a,maxZoom:o,minReadableLabelSize:c,maxFitLabelSize:s,minZoom:u,zoomMode:l,sizeNodesToLabels:h,nodes:f,richNodeRendering:void 0!==d,spacingFactor:b,styleRules:g})},[n,r,i,a,o,c,s,u,l,h,f,d,e,b,g])}(d,e),i=d,a=e.selectedNodeIds,ne.default.useEffect(()=>{i.current?.setSelectedNodeIds(a)},[i,a]),o=d,c=e.renderNode,s=w,ne.default.useEffect(()=>{let e=o.current;return null===e||void 0===c?void s([]):e.subscribeRenderedNodes(s)},[c,o,s]),u=d,l=e.nodes,h=e.getNodeSize,ne.default.useEffect(()=>{let e=u.current;if(null!==e&&void 0!==h)for(let t of l){let n=h(t);n&&e.setNodeSize(t.id,n)}},[h,l,u]),{containerRef:f,renderedNodes:g,runtimeRef:d}}(e);return(0,t7.jsxs)("div",{"aria-label":e.ariaLabel??"Graph",className:e.className,role:"application",style:{height:"100%",minHeight:0,minWidth:0,position:"relative",width:"100%",...e.style},children:[(0,t7.jsx)("div",{ref:t,style:{height:"100%",width:"100%"}}),e.renderNode?(0,t7.jsx)(hY,{nodes:e.nodes,renderedNodes:n,renderNode:e.renderNode,onNodeEvent:(e,t)=>r.current?.handleOverlayNodeEvent(e,t),onNodeSize:(e,t)=>r.current?.setNodeSize(e,t)}):null]})}function h1(e,t){let n=new Map,r=new Set;return new Map([...new Set([...e.keys(),...e.values()])].map(i=>{let a=function i(a){let o=n.get(a);if(void 0!==o)return o;if(r.has(a))return 0;r.add(a);let c=t.has(a)?void 0:e.get(a),s=void 0===c?0:i(c)+1;return r.delete(a),n.set(a,s),s}(i),o=h0(a),c=0===a?0:h0(a-1);return[i,(o-c)/(1-c)]}))}function h0(e){return .04+.14*e/(e+3)}function h2(e){let t=e.data.id;return"string"==typeof t?t:null}function h3(e,t,n){let r=new Set,i=n.get(t);for(;void 0!==i&&!r.has(i);){if(i===e)return!0;r.add(i),i=n.get(i)}return!1}function h4(e){return"string"==typeof e?e:Array.isArray(e)?e.filter(e=>"string"==typeof e).join(" "):""}function h5(e,...t){return[e,...t].filter(e=>e&&e.length>0).join(" ").trim()}function h6(e){return"string"==typeof e&&e.length>0?e:void 0}Object.setPrototypeOf(hK.prototype,h$.prototype),hm("layout","elk",hK);let h8={light:{canvasBg:"#ffffff",edge:"#000",weightXs:"#000",weightMd:"#000",weightXl:"#000",nodeBg:"#E8F1FF",nodeBorder:"#0B5FFF",nodeBorderVendor:"#E2D5FF",nodeBgVendor:"#D1C4FF",nodeText:"#0B5FFF",compoundBg:"#7892B3",selectedFill:"#0B5FFF",selectedFillVendor:"#a025aa",selectedRing:"#0B5FFF",selectedText:"#FFF"},dark:{canvasBg:"#171717",edge:"#707070",weightXs:"#5A5A5A",weightMd:"#8A8A8A",weightXl:"#C0C0C0",nodeBg:"#1E2533",nodeBgVendor:"#241431",nodeBorder:"#2A3A4A",nodeBorderVendor:"#351542",nodeText:"#E8F0FF",compoundBg:"#A9BCD5",selectedFill:"#2E6FFF",selectedFillVendor:"#4E25AA",selectedRing:"#BBD3FF",selectedText:"#FFFFFF"}};function h9(e){return{selector:e.selector,style:{..."style"in e?e.style:e.css}}}let h7=na("circle-dot-dashed",[["path",{d:"M10.1 2.18a9.93 9.93 0 0 1 3.8 0",key:"1qdqn0"}],["path",{d:"M17.6 3.71a9.95 9.95 0 0 1 2.69 2.7",key:"1bq7p6"}],["path",{d:"M21.82 10.1a9.93 9.93 0 0 1 0 3.8",key:"1rlaqf"}],["path",{d:"M20.29 17.6a9.95 9.95 0 0 1-2.7 2.69",key:"1xk03u"}],["path",{d:"M13.9 21.82a9.94 9.94 0 0 1-3.8 0",key:"l7re25"}],["path",{d:"M6.4 20.29a9.95 9.95 0 0 1-2.69-2.7",key:"1v18p6"}],["path",{d:"M2.18 13.9a9.93 9.93 0 0 1 0-3.8",key:"xdo6bj"}],["path",{d:"M3.71 6.4a9.95 9.95 0 0 1 2.7-2.69",key:"1jjmaz"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);function fe({controller:e,maxZoom:t,minZoom:n,zoom:r}){return(0,t7.jsxs)("div",{className:"flex shrink-0 items-center justify-center gap-2 border-t border-t-gray-200 p-4 dark:border-t-gray-800",children:[(0,t7.jsx)("label",{htmlFor:"zoom",children:"Zoom:"}),(0,t7.jsx)("button",{type:"button",title:"Fit graph and optimize spacing for readability","aria-label":"Fit graph and optimize spacing for readability",onClick:()=>e?.fit({optimizeSpacing:!0}),className:"p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-800",children:(0,t7.jsx)(h7,{className:"cursor-pointer"})}),(0,t7.jsx)("input",{id:"zoom",type:"range",min:n,max:t,step:"any",value:r,onChange:r=>{if(null===e)return;let i=Number.parseFloat(r.target.value);e.setZoom(Math.min(t,Math.max(n,i)))},className:"w-64"}),(0,t7.jsxs)("span",{className:"text-sm",children:[(100*r).toFixed(0),"%"]})]})}function ft(e,t,n,r){return r?e||t||n?[e?"highlight":"",t?"highlight-outgoer":"",n?"highlight-incomer":""].filter(Boolean).join(" "):"hushed":""}function fn(e){return"boolean"==typeof e.data.isIntrinsic?e.data.isIntrinsic:!(Array.isArray(e.classes)?e.classes:(e.classes??"").split(/\s+/)).includes("isVendor")}function fr(e){let t=[...e].sort(),n=[];for(let e of t)n.some(t=>e.startsWith(t+"."))||n.push(e);return n}function fi(e,t){if(t.has(e))return e;let n=e.split(".");for(;n.length>1;){n.pop();let e=n.join(".");if(t.has(e))return e}return e}function fa(e){let t=e.nodes.filter(e=>!!e.data.isIntrinsic),n=new Set(t.map(e=>e.data.id));return{nodes:t,edges:e.edges.filter(e=>n.has(e.data.source)&&n.has(e.data.target))}}let fo={breadthfirst:{name:"breadthfirst",animate:!1,animationDuration:500,animationEasing:void 0,avoidOverlap:!0,boundingBox:void 0,circle:!1,depthSort:void 0,directed:!0,direction:"downward",fit:!0,grid:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,ready:void 0,stop:void 0,transform:function(e,t){return t}},circle:{name:"circle",fit:!0,avoidOverlap:!0,sort:(e,t)=>e.data("id").localeCompare(t.data("id"))},concentric:{name:"concentric",avoidOverlap:!0,fit:!0,padding:30,sort:(e,t)=>e.data("id").localeCompare(t.data("id"))},elk:{name:"elk",elk:{algorithm:"layered","elk.direction":"DOWN","elk.hierarchyHandling":"INCLUDE_CHILDREN"},animate:!0,animateFilter:function(){return!0},animationDuration:500,animationEasing:void 0,fit:!0,nodeDimensionsIncludeLabels:!1,nodeLayoutOptions:void 0,transform:function(e,t){return t},ready:void 0,stop:void 0,priority:function(){return null}},grid:{name:"grid",avoidOverlap:!0,sort:(e,t)=>e.data("id").localeCompare(t.data("id"))}};function fc(e){var t,n;let r,i,a,o=nP(),{resolvedTheme:c}=(0,nl.useTheme)(),s="dark"===c?"dark":"light",u=function(e){let{currentPackage:t,elements:n,preservePackageScope:r,setCurrentPackage:i,setMaxSubPackageDepth:a,setSubPackageDepth:o,showCompoundNodes:c,showVendorPackages:s,subPackageDepth:u}=e,l=(0,ne.useMemo)(()=>{var e,i;let a,o,l,h;return null===n?null:(o=function(e,t=!1,n=1){let r=e.nodes.map(e=>e.data.id),i=new Set(r),a=new Set(fr(r)),o=new Map;for(let e of r){let t=function(e,t,n,r){if(n<=1)return e;let i=e.split(".").length,a=t.split("."),o=Math.min(i+(n-1),a.length);for(let e=o;e>=i;e--){let t=a.slice(0,e).join(".");if(r.has(t))return t}return e}(fi(e,a),e,n,i);o.set(e,t)}let c=new Set(o.values()),s=e.nodes.filter(e=>c.has(e.data.id)),u=new Map,l=new Map;for(let n of e.edges){let e=n.data.source,r=n.data.target,i=o.get(e)??e,a=o.get(r)??r;if(!c.has(i)||!c.has(a)||!t&&i===a)continue;let s=`${i}->${a}`,h=l.get(s)??[];if(h.push(n.data.id??`${e}->${r}`),l.set(s,h),u.has(s)){let e=u.get(s),t=n.data.weight??1;e.data.weight=(e.data.weight??0)+t}else u.set(s,{...n,data:{...n.data,id:s,originalEdgeIds:h,source:i,target:a,weight:n.data.weight??1}})}return{nodes:s,edges:Array.from(u.values())}}(a=function(e,t){let n=t.replace(/\.+$/,"");if(!n)return e;let r=n+".",i=new Set(e.nodes.filter(e=>{let t=e.data.id??"";return fn(e)&&t.startsWith(r)}).map(e=>e.data.id)),a=new Set(e.edges.flatMap(e=>i.has(e.data.source)||i.has(e.data.target)?[e.data.source,e.data.target]:[])),o=e.nodes.filter(e=>i.has(e.data.id)||!fn(e)&&a.has(String(e.data.id))),c=new Set(o.map(e=>e.data.id));return{nodes:o,edges:e.edges.filter(e=>c.has(e.data.source)&&c.has(e.data.target))}}(function({nodes:e,edges:t},n,r){return{nodes:e.map(e=>{var t,i,a;let o,c,s;return t=e,i=n,a=r,o=t.data.idInactive??t.data.id,c=t.data.parentInactive??t.data.parent,s={...t.data,idInactive:o,name:i?String(o).split(".").pop():String(o).slice(a.length?a.length+1:0)},i?{...t,data:{...s,parent:c,parentInactive:void 0}}:{...t,data:{...s,parent:void 0,parentInactive:c}}}),edges:t}}((e={currentPackage:t,elements:n,preservePackageScope:r,showCompoundNodes:c,showVendorPackages:s,subPackageDepth:u}).elements,e.showCompoundNodes,e.currentPackage),e.currentPackage.replace(/\//g,".")),!0,e.subPackageDepth),l=e.showVendorPackages?o:fa(o),{elements:(i=e.showCompoundNodes?l:function(e){let t=new Set(e.edges.flatMap(e=>[e.data.source,e.data.target])),n=new Set;for(let t of e.nodes.filter(fn)){let e=String(t.data.id??"").split(".");for(let t=1;t<e.length;t+=1)n.add(e.slice(0,t).join("."))}return{nodes:e.nodes.filter(e=>!fn(e)||!n.has(String(e.data.id))||t.has(String(e.data.id))),edges:e.edges}}(l),h=e.currentPackage.replaceAll("/","."),{nodes:i.nodes.map(e=>({group:"nodes",classes:e.classes??"",data:{...e.data,label:function(e,t){if(!t)return e;if(e===t)return e.split(".").at(-1)??e;let n=t+".";return e.startsWith(n)?e.slice(n.length):e}(String(e.data.id??""),h)}})),edges:i.edges}),maxSubPackageDepth:Math.max(1,function(e){let t=e.nodes.map(e=>String(e.data.id));if(0===t.length)return 0;let n=new Set(fr(t)),r=1;for(let e of t){let t=fi(e,n),i=e.split(".").length-t.split(".").length+1;i>r&&(r=i)}return r}(e.showVendorPackages?a:fa(a))),redirectPackage:function(e){let t=e.currentPackage.replaceAll("/",".");if(e.preservePackageScope)return null;let n=function(e,t){let n=new Map;for(let e of t.nodes.filter(fn)){let t=String(e.data.id??"");if(!t)continue;let r=t.lastIndexOf("."),i=r<0?"":t.slice(0,r),a=n.get(i)??[];a.push(t),n.set(i,a)}return function e(t,n,r){let i=n.get(t)??[],a=i[0];return 1!==i.length||!a||r.has(a)||!n.has(a)?t:e(a,n,r)}(e,n,new Set(t.edges.flatMap(e=>[e.data.source,e.data.target])))}(t,e.elements);return n===t?null:n}(e)})},[t,n,r,c,s,u]);return(0,ne.useEffect)(()=>{null!==l&&(a(l.maxSubPackageDepth),null===l.redirectPackage&&u>l.maxSubPackageDepth&&o(l.maxSubPackageDepth),null!==l.redirectPackage&&i(l.redirectPackage))},[l,i,a,o,u]),l?.redirectPackage===null?l.elements:null}({currentPackage:e.currentPackage,elements:e.packageGraph,preservePackageScope:e.cycleHighlights.length>0,setCurrentPackage:e.setCurrentPackage,setMaxSubPackageDepth:o.setMaxSubPackageDepth,setSubPackageDepth:o.setSubPackageDepth,showCompoundNodes:o.showCompoundNodes,showVendorPackages:o.showVendorPackages,subPackageDepth:o.subPackageDepth});!function(e){let t=(0,ne.useRef)(null),{cycleHighlights:n,currentPackage:r,setCurrentPackage:i,setSubPackageDepth:a,subPackageDepth:o,visibleElements:c}=e;(0,ne.useEffect)(()=>(function(e,t){if(null===e.visibleElements)return;if(0===e.cycleHighlights.length){t.current=null;return}let n=e.cycleHighlights.map(e=>e.id).sort().join("|");t.current===n||!function(e){if(null===e.visibleElements)return!1;let t=[...new Set(e.cycleHighlights.flatMap(e=>e.cycle.packages))],n=new Set(e.visibleElements.nodes.map(e=>h2(e)).filter(e=>null!==e));if(t.every(e=>n.has(e)))return!1;let r=function(e){let t=[...new Set(e.flatMap(e=>e.cycle.packages))];if(0===t.length)return null;let n=t.map(e=>e.split(".")),[r,...i]=n,a=r.findIndex((e,t)=>i.some(n=>n.at(t)!==e)),o=-1===a?r.length:a,c=r.slice(0,o),s=t.includes(c.join("."))?c.slice(0,-1):c;return{currentPackage:s.join("."),packageDepth:Math.max(1,...n.map(e=>e.length-s.length))}}(e.cycleHighlights);if(!r)return!1;let i=e.currentPackage.replace(/\//g,"."),a=r.currentPackage!==i,o=r.packageDepth>e.subPackageDepth;return a&&e.setCurrentPackage(r.currentPackage),o&&e.setSubPackageDepth(r.packageDepth),a||o}(e)&&(t.current=n)})({cycleHighlights:n,currentPackage:r,setCurrentPackage:i,setSubPackageDepth:a,subPackageDepth:o,visibleElements:c},t),[n,r,i,a,o,c])}({cycleHighlights:e.cycleHighlights,currentPackage:e.currentPackage,setCurrentPackage:e.setCurrentPackage,setSubPackageDepth:o.setSubPackageDepth,subPackageDepth:o.subPackageDepth,visibleElements:u});let l=(t={cycleHighlights:e.cycleHighlights,layout:o.cytoscapeLayout,packageGraph:e.packageGraph,theme:s,visibleElements:u},r=(0,ne.useMemo)(()=>{var e,n,r,i,a;let o,c,s,u,l,h,f;return null===t.visibleElements?null:(e=t.packageGraph,n=t.visibleElements,r=t.cycleHighlights,o=new Set(n.nodes.map(e=>h2(e)).filter(e=>null!==e)),i=n,a=o,s=function(e,t){let n=new Set;for(let r of e.edges){let e=h6(r.data.source),i=h6(r.data.target);e&&i&&(h3(e,i,t)?n.add(i):h3(i,e,t)&&n.add(e))}return n}(n,c=new Map(i.nodes.flatMap(e=>{let t=h2(e),n=h6(e.data.parent);return t&&n&&a.has(n)?[[t,n]]:[]}))),u=function(e){let t=new Set;for(let n of e.nodes){let e=h2(n);if(null!==e)for(let n=e.lastIndexOf(".");n>=0&&(t.add(e.slice(0,n)),0!==n);n=e.lastIndexOf(".",n-1));}return t}(e),l=new Set([...o].filter(e=>u.has(e))),f={cycles:(h=function(e){let t=new Map,n=new Map;for(let r of e){for(let e of r.cycle.packages)t.set(e,r.color);r.cycle.edges.toReversed().forEach((e,t)=>{let i=n.get(e.from)??new Map;i.set(e.to,{color:r.color,step:r.cycle.edges.length-t}),n.set(e.from,i)})}return{edges:n,nodes:t}}(r)).nodes,opacity:h1(c,s)},{edges:n.edges.flatMap(e=>(function(e,t){let n=h6(e.data.source),r=h6(e.data.target);if(!n||!r)return[];let i=t.get(n)?.get(r);return[{id:h6(e.data.id),source:n,target:r,classes:h5(h4(e.classes),i?"auditCycle":void 0),data:{...e.data,...i?{auditCycleColor:i.color,auditCycleStep:String(i.step)}:{}}}]})(e,h.edges)),nodes:n.nodes.flatMap(e=>(function(e,t,n,r,i){let a=h2(e);if(null===a)return[];let o=i.cycles.get(a),c=n.has(a)?void 0:t.get(a),s=h6(e.data.label)??h6(e.data.name)??a;return[{id:a,label:s,parentId:c,classes:h5(h4(e.classes),r.has(a)?"isParent":void 0,void 0!==o?"auditCycle":void 0),data:{...e.data,compoundFillOpacity:i.opacity.get(a)??.04,parent:c,...void 0!==o?{auditCycleColor:o}:{}}}]})(e,c,s,l,f)),parentNodeIds:l})},[t.cycleHighlights,t.packageGraph,t.visibleElements]),i=(0,ne.useMemo)(()=>{var e,n,r,i;return null===t.visibleElements?[]:(e=t.visibleElements,n=t.theme,r=t.layout,[...function(e,t){var n,r,i,a,o,c,s,u;let l,h=h8[t],{thresholds:f}=function(e="linear",t){var n;if(!t)return{thresholds:[],counts:[]};let r=t.edges.map(e=>Number(e.data.weight)),i=(n=t,n?.edges.reduce((e,t)=>t.data.weight>e?t.data.weight:e,0)??0),a=[],o=[,,,].fill(0);if("linear"===e){for(let e=1;e<3;e++)a.push(e*i/3);a.push(i)}else if("log"===e){let e=Math.log(i);for(let t=1;t<3;t++)a.push(Math.exp(t*e/3));a.push(i)}else if("quantile"===e){let e=[...r].sort((e,t)=>e-t);for(let t=1;t<3;t++){let n=Math.floor(t*e.length/3);a.push(e[n])}a.push(i)}return r.forEach(e=>{for(let t=0;t<a.length;t++)if(e<=a[t]){o[t]++;break}}),{thresholds:a.map(Math.round),counts:o}}("linear",e);return[{selector:"node",style:{shape:"bottom-round-rectangle","background-color":(n=h).nodeBg,"border-color":n.nodeBorder,color:n.nodeText,label:"data(label)","text-valign":"center","text-halign":"center",width:24,height:24,padding:"12px","border-width":1,"font-size":"14px","overlay-opacity":0}},{selector:"node.isVendor",style:{"background-color":n.nodeBgVendor}},{selector:"node:childless.hushed",style:{opacity:.2}},{selector:"node.highlight-outgoer, node.highlight-incomer",style:{"border-color":(r=h).selectedRing,opacity:1}},{selector:"node:childless.highlight",style:{"background-color":r.selectedFill,color:r.selectedText,opacity:1}},{selector:"node.auditCycle",style:{"border-color":"data(auditCycleColor)","border-width":5,opacity:1,"underlay-color":"data(auditCycleColor)","underlay-opacity":.18,"underlay-padding":4,"z-index":999}},{selector:"node.isParent",style:{"font-weight":"bold"}},{selector:"node:selected",style:{"background-color":(i=h).selectedFill,"border-color":i.selectedRing,"outline-color":i.selectedRing,"outline-width":2,color:i.selectedText,"background-opacity":1,opacity:1,"overlay-opacity":0}},{selector:"node.isVendor:selected",style:{"background-color":i.selectedFillVendor}},{selector:"node:parent, node:parent:selected",style:{"background-opacity":.04,"background-color":(a=h).compoundBg,color:a.nodeText,"border-width":1,"border-opacity":.35,"border-color":a.nodeBorder,"text-valign":"top","text-margin-y":-5,padding:"16px","text-background-color":a.canvasBg,"text-background-opacity":.85,"text-background-padding":"3px","text-halign":"center","font-size":14,"font-weight":"bold","font-style":"italic",label:"data(label)"}},{selector:"node:parent.isVendor, node:parent.isVendor:selected",style:{"background-color":a.nodeBgVendor,"border-color":a.nodeBorderVendor}},{selector:"node:parent.auditCycle, node:parent.auditCycle:selected",style:{"underlay-opacity":0,"border-color":"data(auditCycleColor)","border-opacity":.8,"outline-color":"data(auditCycleColor)","outline-width":2,color:"data(auditCycleColor)"}},...(l=new Set((o=e).nodes.map(e=>e.data.id)),[...new Set(h1(new Map(o.nodes.flatMap(e=>{let{id:t,parent:n}=e.data;return"string"==typeof t&&"string"==typeof n&&l.has(n)?[[t,n]]:[]})),new Set).values())].map(e=>({selector:`node:parent[compoundFillOpacity = ${e}]`,style:{"background-opacity":e}}))),{selector:"edge",style:{"arrow-scale":1,"target-arrow-color":(c=h).edge,"target-arrow-shape":"chevron","target-arrow-fill":"filled","line-color":c.edge,"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line",opacity:1,"line-opacity":1}},{selector:"edge.hushed",style:{opacity:.04}},{selector:"edge.highlight-outgoer, edge.highlight-incomer, edge.highlight-dependency",style:{opacity:1,"line-opacity":1,width:4,"line-color":c.weightXl,"target-arrow-color":c.weightXl,"source-arrow-color":c.weightXl}},...(s=h,u=f,[{selector:"edge[weight <= 1]",style:{label:""}},{selector:`edge[weight > 1][weight <= ${u[0]}]`,style:{width:1,"line-color":s.weightXs,"target-arrow-color":s.weightXs}},{selector:`edge[weight > ${u[0]}][weight <= ${u[1]}]`,style:{width:4,"arrow-scale":2,"line-color":s.weightMd,"target-arrow-color":s.weightMd}},{selector:`edge[weight > ${u[1]}]`,style:{width:8,"line-color":s.weightXl,"target-arrow-color":s.weightXl}}]),{selector:"edge.auditCycle",style:{width:6,opacity:1,"line-opacity":1,"arrow-scale":1.5,"line-color":"data(auditCycleColor)","target-arrow-color":"data(auditCycleColor)",color:"data(auditCycleColor)",label:"data(auditCycleStep)","font-size":12,"font-weight":"bold","text-background-color":h.canvasBg,"text-background-opacity":.9,"text-background-padding":"3px","z-compound-depth":"top","z-index-compare":"manual","z-index":9999}}]}(e,n),..."breadthfirst"===(i=r)?[]:"circle"===i?[{selector:"node",style:{shape:"barrel"}},{selector:"edge",style:{}}]:"elk"===i?[{selector:"node",style:{"edge-distances":"intersection"}}]:"grid"===i?[{selector:"node",style:{shape:"rectangle"}},{selector:"edge",style:{"text-margin-x":0,"text-margin-y":0}}]:[{selector:"node",style:{}}]].map(h9))},[t.layout,t.theme,t.visibleElements]),a=(0,ne.useMemo)(()=>({...fo[t.layout]}),[t.layout]),{layout:"breadthfirst"===(n=t.layout)?"breadthfirst":"circle"===n?"circle":"elk"===n?"elk":"grid"===n?"grid":"concentric",layoutOptions:a,model:r,styles:i});return null===l.model?null:(0,t7.jsx)(fs,{...e,layout:l.layout,layoutOptions:l.layoutOptions,model:l.model,onSpacingFactorChange:o.setCytoscapeLayoutSpacing,spacingFactor:o.cytoscapeLayoutSpacing,styles:l.styles,theme:s})}function fs(e){let t=function(e){let[t,n]=(0,ne.useState)(null),r=(0,ne.useRef)(null),[i,a]=(0,ne.useState)({zoom:1,min:.5,max:2}),o=(0,ne.useRef)(e),c=e=>{let{zoom:t}=e.getViewport(),{min:n,max:r}=e.getZoomRange();a(e=>e.zoom===t&&e.min===n&&e.max===r?e:{zoom:t,min:n,max:r})};return{controller:t,handleLayoutComplete:t=>{let n=o.current!==e;o.current=e,n&&t.fit(),c(t)},handleReady:e=>{r.current=e,n(e),c(e)},handleViewportChange:()=>{null!==r.current&&c(r.current)},...i}}(e.layout),n=function(e,t){let n=(0,ne.useMemo)(()=>{let t=new Set(e.map(e=>e.parentId));return new Set(e.filter(e=>!t.has(e.id)).map(e=>e.id))},[e]),[r,i]=(0,ne.useState)({leafIds:n,interaction:{hoveredNodeId:null,selectedNodeIds:[]}});return r.leafIds!==n&&i({leafIds:n,interaction:{hoveredNodeId:null,selectedNodeIds:r.interaction.selectedNodeIds.filter(e=>n.has(e))}}),{...(0,ne.useMemo)(()=>(function(e,t,n){var r;let i,a,o,c=new Set(null===n.hoveredNodeId?n.selectedNodeIds:[n.hoveredNodeId]);if(0===c.size)return{nodes:e,edges:t};let s=(r=e.map(e=>e.id),i=new Set,a=new Set,o=t.map(e=>{let t=c.has(e.source),n=c.has(e.target);return t&&i.add(e.target),n&&a.add(e.source),ft(!1,t,n,c.size>0)}),{nodeClasses:r.map(e=>ft(c.has(e),i.has(e),a.has(e),c.size>0)),edgeClasses:o});return{nodes:e.map((e,t)=>({...e,classes:[e.classes,s.nodeClasses.at(t)].filter(Boolean).join(" ")})),edges:t.map((e,t)=>({...e,classes:[e.classes,s.edgeClasses.at(t)].filter(Boolean).join(" ")}))}})(e,t,r.interaction),[e,t,r.interaction]),handleNodeEvent:e=>{let{id:t,type:r}=e;n.has(t)&&"press"!==r&&"double-press"!==r&&i(e=>{let i=function(e,t){if("pointer-enter"===t.type)return e.hoveredNodeId===t.id?e:{...e,hoveredNodeId:t.id};if("pointer-leave"===t.type)return e.hoveredNodeId===t.id?{...e,hoveredNodeId:null}:e;let n=e.selectedNodeIds.includes(t.id);return"select"===t.type===n?e:{...e,selectedNodeIds:"select"===t.type?[...e.selectedNodeIds,t.id]:e.selectedNodeIds.filter(e=>e!==t.id)}}(e.interaction,{id:t,type:r});return i===e.interaction?e:{leafIds:n,interaction:i}})}}}(e.model.nodes,e.model.edges);return(0,t7.jsxs)("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-2 overflow-hidden px-8",children:[(0,t7.jsxs)("div",{className:"relative min-h-0 flex-1 overflow-hidden",children:[(0,t7.jsx)(hZ,{edges:n.edges,layout:e.layout,layoutOptions:e.layoutOptions,maxZoom:2,minZoom:.5,minReadableLabelSize:24,maxFitLabelSize:24,nodes:n.nodes,zoomMode:"fit-relative",sizeNodesToLabels:!0,onLayoutComplete:t.handleLayoutComplete,onNodeEvent:t=>{n.handleNodeEvent(t),"double-press"===t.type&&e.model.parentNodeIds.has(t.id)&&e.setCurrentPackage(t.id)},onReady:t.handleReady,onViewportChange:t.handleViewportChange,onSpacingFactorChange:e.onSpacingFactorChange,spacingFactor:e.spacingFactor,style:{background:h8[e.theme].canvasBg},styleRules:e.styles}),e.overlay]}),(0,t7.jsx)(fe,{controller:t.controller,maxZoom:t.max,minZoom:t.min,zoom:t.zoom})]})}function fu({currentPackage:e,cycleHighlights:t,cycleInspection:n,packageGraph:r,setCurrentPackage:i,onCloseInspection:a}){return r?(0,t7.jsx)(fc,{currentPackage:e,setCurrentPackage:i,packageGraph:r,cycleHighlights:t,overlay:null===n?null:(0,t7.jsx)(nB,{inspection:n,onClose:a})}):(0,t7.jsx)(nR,{})}let fl=na("download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);var fh=e.i(95187);let ff=(0,fh.createServerReference)("00dd67a4ba1bcf78f3cedeb701bbc3c2b232ecfe3c",fh.callServer,void 0,fh.findSourceMapURL,"downloadAuditJsonAction"),fd=(0,fh.createServerReference)("0023c8b3e427892f617b2ac6f61a5b056d50295372",fh.callServer,void 0,fh.findSourceMapURL,"downloadAuditXmlAction");function fb({children:e}){return(0,t7.jsx)("div",{className:"ml-3 border-b border-b-neutral-200 bg-white px-3 py-2 dark:border-b-neutral-800 dark:bg-neutral-900",children:e})}function fg(){return(0,t7.jsxs)("div",{className:"pt-3",children:[(0,t7.jsx)(fb,{children:(0,t7.jsx)(fw,{format:"JSON",mimeType:"application/json",onExport:ff})}),(0,t7.jsx)(fb,{children:(0,t7.jsx)(fw,{format:"XML",mimeType:"application/xml",onExport:fd})})]})}function fw({format:e,mimeType:t,onExport:n}){return(0,t7.jsxs)("button",{type:"button",onClick:async()=>{let{data:e,filename:r}=await n(),i=new Blob([e],{type:t}),a=URL.createObjectURL(i),o=document.createElement("a");o.href=a,o.download=r,o.click(),URL.revokeObjectURL(a)},className:"flex cursor-pointer items-center text-xs hover:text-blue-600 dark:hover:text-blue-400",children:[(0,t7.jsx)(fl,{size:10,className:"mr-1.5"}),(0,t7.jsx)("span",{children:e})]})}let fp=na("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);var fv=e.i(74080);function fm(e,[t,n]){return Math.min(n,Math.max(t,e))}(0,Object.defineProperty)(fm,"name",{value:"clamp",configurable:!0});var fy=Object.defineProperty,fk=(e,t)=>fy(e,"name",{value:t,configurable:!0}),fx=!!("u">typeof window&&window.document&&window.document.createElement);function fE(e,t,{checkForDefaultPrevented:n=!0}={}){return fk(function(r){if(e?.(r),!1===n||!r||!r.defaultPrevented)return t?.(r)},"handleEvent")}function fS(e){if(!fx)throw Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}function fT(e){return"IFRAME"===e.tagName}fk(fE,"composeEventHandlers"),fk(function(e){if(!fx)throw Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window},"getOwnerWindow"),fk(fS,"getOwnerDocument"),fk(function e(t,n=!1){let{activeElement:r}=fS(t);if(!r?.nodeName)return null;if(fT(r)&&r.contentDocument)return e(r.contentDocument.body,n);if(n){let e=r.getAttribute("aria-activedescendant");if(e){let t=fS(r).getElementById(e);if(t)return t}}return r},"getActiveElement"),fk(fT,"isFrame");var fC=Object.defineProperty,fM=(e,t)=>fC(e,"name",{value:t,configurable:!0});function fP(e,t=[]){let n=[];function r(t,r){let i=ne.createContext(r);i.displayName=t+"Context";let a=n.length;n=[...n,r];let o=fM(t=>{let{scope:n,children:r,...o}=t,c=n?.[e]?.[a]||i,s=ne.useMemo(()=>o,Object.values(o));return(0,t7.jsx)(c.Provider,{value:s,children:r})},"Provider");function c(n,o,s={}){let{optional:u=!1}=s,l=o?.[e]?.[a]||i,h=ne.useContext(l);if(h)return h;if(void 0!==r)return r;if(!u)throw Error(`\`${n}\` must be used within \`${t}\``)}return o.displayName=t+"Provider",fM(c,"useContext"),[o,c]}fM(r,"createContext");let i=fM(()=>{let t=n.map(e=>ne.createContext(e));return fM(function(n){let r=n?.[e]||t;return ne.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},"useScope")},"createScope");return i.scopeName=e,[r,fj(i,...t)]}function fj(...e){let t=e[0];if(1===e.length)return t;let n=fM(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return fM(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return ne.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}fM(function(e,t){let n=ne.createContext(t);n.displayName=e+"Context";let r=fM(e=>{let{children:t,...r}=e,i=ne.useMemo(()=>r,Object.values(r));return(0,t7.jsx)(n.Provider,{value:i,children:t})},"Provider");function i(r,a={}){let{optional:o=!1}=a,c=ne.useContext(n);if(c)return c;if(void 0!==t)return t;if(!o)throw Error(`\`${r}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",fM(i,"useContext"),[r,i]},"createContext"),fM(fP,"createContextScope"),fM(fj,"composeContextScopes");var fI=Object.defineProperty,fA=(e,t)=>fI(e,"name",{value:t,configurable:!0});function fO(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function fN(...e){return t=>{let n=!1,r=e.map(e=>{let r=fO(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];"function"==typeof n?n():fO(e[t],null)}}}}function fL(...e){return ne.useCallback(fN(...e),e)}fA(fO,"setRef"),fA(fN,"composeRefs"),fA(fL,"useComposedRefs");var fD=Object.defineProperty,fR=(e,t)=>fD(e,"name",{value:t,configurable:!0});function f_(e){let t=ne.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,c=[];fV(r)&&"function"==typeof fX&&(r=fX(r._payload)),ne.Children.forEach(r,e=>{if(fH(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;fV(t)&&"function"==typeof fX&&(t=fX(t._payload)),a=fF(e,t),c.push(a?.props?.children)}else c.push(e)}),a?a=ne.cloneElement(a,void 0,c):!o&&1===ne.Children.count(r)&&ne.isValidElement(r)&&(a=r);let s=a?fK(a):void 0,u=fL(n,s);if(!a){if(r||0===r)throw Error(o?fG(e):fq(e));return r}let l=f$(i,a.props??{});return a.type!==ne.Fragment&&(l.ref=n?u:s),ne.cloneElement(a,l)});return t.displayName=`${e}.Slot`,t}fR(f_,"createSlot");var fB=Symbol.for("radix.slottable");fR(function(e){let t=fR(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=fB,t},"createSlottable");var fF=fR((e,t)=>{if("child"in e.props){let t=e.props.child;return ne.isValidElement(t)?ne.cloneElement(t,void 0,e.props.children(t.props.children)):null}return ne.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function f$(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):"style"===r?n[r]={...i,...a}:"className"===r&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function fK(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(n=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function fH(e){return ne.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===fB}fR(f$,"mergeProps"),fR(fK,"getElementRef"),fR(fH,"isSlottable");var fz=Symbol.for("react.lazy");function fV(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===fz&&"_payload"in e&&fU(e._payload)}function fU(e){return"object"==typeof e&&null!==e&&"then"in e}fR(fV,"isLazyComponent"),fR(fU,"isPromiseLike");var fq=fR(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),fG=fR(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),fX=ne[" use ".trim().toString()],fW=Object.defineProperty,fY=(e,t)=>fW(e,"name",{value:t,configurable:!0});function fQ(e){let t=e+"CollectionProvider",[n,r]=fP(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=fY(e=>{let{scope:t,children:n}=e,r=ne.useRef(null),a=ne.useRef(new Map).current;return(0,t7.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},"CollectionProvider");o.displayName=t;let c=e+"CollectionSlot",s=f_(c),u=ne.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=fL(t,a(c,n).collectionRef);return(0,t7.jsx)(s,{ref:i,children:r})});u.displayName=c;let l=e+"CollectionItemSlot",h="data-radix-collection-item",f=f_(l),d=ne.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=ne.useRef(null),c=fL(t,o),s=a(l,n);return ne.useEffect(()=>(s.itemMap.set(o,{ref:o,...i}),()=>void s.itemMap.delete(o))),(0,t7.jsx)(f,{...{[h]:""},ref:c,children:r})});function b(t){let n=a(e+"CollectionConsumer",t);return ne.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${h}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return d.displayName=l,fY(b,"useCollection"),[{Provider:o,Slot:u,ItemSlot:d},b,r]}fY(fQ,"createCollection");var fJ=new WeakMap,fZ=class e extends Map{static{fY(this,"OrderedDict")}#e;constructor(e){super(e),this.#e=[...super.keys()],fJ.set(this,!0)}set(e,t){return fJ.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r,i=this.has(t),a=this.#e.length,o=f2(e),c=o>=0?o:a+o,s=c<0||c>=a?-1:c;if(s===this.size||i&&s===this.size-1||-1===s)return this.set(t,n),this;let u=this.size+ +!i;o<0&&c++;let l=[...this.#e],h=!1;for(let e=c;e<u;e++)if(c===e){let a=l[e];l[e]===t&&(a=l[e+1]),i&&this.delete(t),r=this.get(a),this.set(t,n)}else{h||l[e-1]!==t||(h=!0);let n=l[h?e:e-1],i=r;r=this.get(n),this.delete(n),this.set(n,i)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return -1===r?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return -1===r?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=f1(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=f1(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return f1(this.#e,e)}from(e,t){let n=this.indexOf(e);if(-1===n)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(-1===n)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return -1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=0===r&&1===e.length?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&1===e.length?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(void 0===t)return r;t<0&&(t+=this.size),void 0!==n&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function f1(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let n=f0(e,t);return -1===n?void 0:e[n]}function f0(e,t){let n=e.length,r=f2(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}function f2(e){return e!=e||0===e?0:Math.trunc(e)}function f3(e,t){if(e===t)return!0;if("object"!=typeof e||"object"!=typeof t||null==e||null==t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}function f4(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function f5(e,t){return e[1].element&&t[1].element?f4(e[1].element,t[1].element)?-1:1:0}function f6(e){return new MutationObserver(t=>{for(let n of t)if("childList"===n.type)return void e()})}fY(f1,"at"),fY(f0,"toSafeIndex"),fY(f2,"toSafeInteger"),fY(function(e){let t=e+"CollectionProvider",[n,r]=fP(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new fZ,setItemMap:fY(()=>void 0,"setItemMap")}),o=fY(({state:e,...t})=>e?(0,t7.jsx)(s,{...t,state:e}):(0,t7.jsx)(c,{...t}),"CollectionProvider");o.displayName=t;let c=fY(e=>{let t=g();return(0,t7.jsx)(s,{...e,state:t})},"CollectionInit");c.displayName=t+"Init";let s=fY(e=>{let{scope:t,children:n,state:r}=e,a=ne.useRef(null),[o,c]=ne.useState(null),s=fL(a,c),[u,l]=r;return ne.useEffect(()=>{if(!o)return;let e=f6(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,t7.jsx)(i,{scope:t,itemMap:u,setItemMap:l,collectionRef:s,collectionRefObject:a,collectionElement:o,children:n})},"CollectionProviderImpl");s.displayName=t+"Impl";let u=e+"CollectionSlot",l=f_(u),h=ne.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=fL(t,a(u,n).collectionRef);return(0,t7.jsx)(l,{ref:i,children:r})});h.displayName=u;let f=e+"CollectionItemSlot",d=f_(f),b=ne.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=ne.useRef(null),[c,s]=ne.useState(null),u=fL(t,o,s),{setItemMap:l}=a(f,n),h=ne.useRef(i);f3(h.current,i)||(h.current=i);let b=h.current;return ne.useEffect(()=>(l(e=>c?e.has(c)?e.set(c,{...b,element:c}).toSorted(f5):(e.set(c,{...b,element:c}),e.toSorted(f5)):e),()=>{l(e=>c&&e.has(c)?(e.delete(c),new fZ(e)):e)}),[c,b,l]),(0,t7.jsx)(d,{"data-radix-collection-item":"",ref:u,children:r})});function g(){return ne.useState(new fZ)}function w(t){let{itemMap:n}=a(e+"CollectionConsumer",t);return n}return b.displayName=f,fY(g,"useInitCollection"),fY(w,"useCollection"),[{Provider:o,Slot:h,ItemSlot:b},{createCollectionScope:r,useCollection:w,useInitCollection:g}]},"createCollection"),fY(f3,"shallowEqual"),fY(f4,"isElementPreceding"),fY(f5,"sortByDocumentPosition"),fY(f6,"getChildListObserver");var f8=Object.defineProperty,f9=ne.createContext(void 0);function f7(e){let t=ne.useContext(f9);return e||t||"ltr"}f8(f7,"name",{value:"useDirection",configurable:!0});var de=Object.defineProperty,dt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=f_(`Primitive.${t}`),r=ne.forwardRef((e,r)=>{let{asChild:i,...a}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t7.jsx)(i?n:t,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function dn(e,t){e&&fv.flushSync(()=>e.dispatchEvent(t))}function dr(e){let t=ne.useRef(e);return ne.useEffect(()=>{t.current=e}),ne.useMemo(()=>(...e)=>t.current?.(...e),[])}de(dn,"name",{value:"dispatchDiscreteCustomEvent",configurable:!0}),(0,Object.defineProperty)(dr,"name",{value:"useCallbackRef",configurable:!0});var di=Object.defineProperty,da=(e,t)=>di(e,"name",{value:t,configurable:!0}),dc="dismissableLayer.update",ds=ne.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),du=ne.forwardRef(da(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:c,onDismiss:s,...u}=e,l=ne.useContext(ds),[h,f]=ne.useState(null),d=h?.ownerDocument??globalThis?.document,[,b]=ne.useState({}),g=fL(t,f),w=Array.from(l.layers),[p]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=p?w.indexOf(p):-1,y=h?w.indexOf(h):-1,k=l.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,E=ne.useRef(!1),S=dh(e=>{a?.(e),c?.(e),e.defaultPrevented||s?.()},{ownerDocument:d,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:E,dismissableSurfaces:l.dismissableSurfaces,shouldHandlePointerDownOutside:ne.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...l.branches].some(t=>t.contains(e));return x&&!t},[l.branches,x])}),T=df(e=>{if(r&&E.current)return;let t=e.target;![...l.branches].some(e=>e.contains(t))&&(o?.(e),c?.(e),e.defaultPrevented||s?.())},d),C=!!h&&y===w.length-1,M=dr(e=>{"Escape"===e.key&&(i?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))});return ne.useEffect(()=>{if(C)return d.addEventListener("keydown",M,{capture:!0}),()=>d.removeEventListener("keydown",M,{capture:!0})},[d,C,M]),ne.useEffect(()=>{if(h)return n&&(0===l.layersWithOutsidePointerEventsDisabled.size&&(t8=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(h)),l.layers.add(h),dd(),()=>{n&&(l.layersWithOutsidePointerEventsDisabled.delete(h),0===l.layersWithOutsidePointerEventsDisabled.size&&(d.body.style.pointerEvents=t8))}},[h,d,n,l]),ne.useEffect(()=>()=>{h&&(l.layers.delete(h),l.layersWithOutsidePointerEventsDisabled.delete(h),dd())},[h,l]),ne.useEffect(()=>{let e=da(()=>b({}),"handleUpdate");return document.addEventListener(dc,e),()=>document.removeEventListener(dc,e)},[]),(0,t7.jsx)(dt.div,{...u,ref:g,style:{pointerEvents:k?x?"auto":"none":void 0,...e.style},onFocusCapture:fE(e.onFocusCapture,T.onFocusCapture),onBlurCapture:fE(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:fE(e.onPointerDownCapture,S.onPointerDownCapture)})},"DismissableLayer"));da(function(){let e=ne.useContext(ds),[t,n]=ne.useState(null);return ne.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n},"useDismissableLayerSurface");var dl=da(()=>!0,"IS_TRUE");function dh(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=dl}=t,c=dr(e),s=ne.useRef(!1),u=ne.useRef(!1),l=ne.useRef(new Map),h=ne.useRef(()=>{});return ne.useEffect(()=>{function e(){u.current=!1,i.current=!1,l.current.clear()}function t(){return Array.from(l.current.values()).some(Boolean)}function f(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||l.current.set(e.type,!0),"click"===e.type&&window.setTimeout(()=>{u.current&&h.current()},0)}function d(e){u.current&&l.current.set(e.type,!1)}da(e,"resetOutsideInteraction"),da(t,"isOutsideInteractionIntercepted"),da(f,"handleInteractionCapture"),da(d,"handleInteractionBubble");let b=da(a=>{if(a.target&&!s.current){let f=function(){n.removeEventListener("click",h.current);let r=t();e(),r||db("dismissableLayer.pointerDownOutside",c,d,{discrete:!0})};if(da(f,"handleAndDispatchPointerDownOutsideEvent"),!o(a.target)){n.removeEventListener("click",h.current),e(),s.current=!1;return}let d={originalEvent:a};u.current=!0,i.current=r&&0===a.button,l.current.clear(),r&&0===a.button?(n.removeEventListener("click",h.current),h.current=f,n.addEventListener("click",h.current,{once:!0})):f()}else n.removeEventListener("click",h.current),e();s.current=!1},"handlePointerDown"),g=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let e of g)n.addEventListener(e,f,!0),n.addEventListener(e,d);let w=window.setTimeout(()=>{n.addEventListener("pointerdown",b)},0);return()=>{for(let e of(window.clearTimeout(w),n.removeEventListener("pointerdown",b),n.removeEventListener("click",h.current),g))n.removeEventListener(e,f,!0),n.removeEventListener(e,d)}},[n,c,r,i,a,o]),{onPointerDownCapture:da(()=>s.current=!0,"onPointerDownCapture")}}function df(e,t=globalThis?.document){let n=dr(e),r=ne.useRef(!1);return ne.useEffect(()=>{let e=da(e=>{e.target&&!r.current&&db("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:da(()=>r.current=!0,"onFocusCapture"),onBlurCapture:da(()=>r.current=!1,"onBlurCapture")}}function dd(){let e=new CustomEvent(dc);document.dispatchEvent(e)}function db(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?dn(i,a):i.dispatchEvent(a)}da(dh,"usePointerDownOutside"),da(df,"useFocusOutside"),da(dd,"dispatchUpdate"),da(db,"handleAndDispatchCustomEvent");var dg=Object.defineProperty,dw=(e,t)=>dg(e,"name",{value:t,configurable:!0}),dp=0,dv=null;function dm(){ne.useEffect(()=>{dv||(dv={start:dy(),end:dy()});let{start:e,end:t}=dv;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),dp++,()=>{1===dp&&(dv?.start.remove(),dv?.end.remove(),dv=null),dp=Math.max(0,dp-1)}},[])}function dy(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}dw(function(e){return dm(),e.children},"FocusGuards"),dw(dm,"useFocusGuards"),dw(dy,"createFocusGuard");var dk=Object.defineProperty,dx=(e,t)=>dk(e,"name",{value:t,configurable:!0}),dE="focusScope.autoFocusOnMount",dS="focusScope.autoFocusOnUnmount",dT={bubbles:!1,cancelable:!0},dC=ne.forwardRef(dx(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[c,s]=ne.useState(null),u=dr(i),l=dr(a),h=ne.useRef(null),f=fL(t,s),d=ne.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;ne.useEffect(()=>{if(r){let e=function(e){if(d.paused||!c)return;let t=e.target;c.contains(t)?h.current=t:dN(h.current,{select:!0})},t=function(e){if(d.paused||!c)return;let t=e.relatedTarget;null!==t&&(c.contains(t)||dN(h.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&dN(c)};dx(e,"handleFocusIn"),dx(t,"handleFocusOut"),dx(n,"handleMutations"),document.addEventListener("focusin",e),document.addEventListener("focusout",t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[r,c,d.paused]),ne.useEffect(()=>{if(c){dL.add(d);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(dE,dT);c.addEventListener(dE,u),c.dispatchEvent(t),t.defaultPrevented||(dM(d_(dj(c)),{select:!0}),document.activeElement===e&&dN(c))}return()=>{c.removeEventListener(dE,u),setTimeout(()=>{let t=new CustomEvent(dS,dT);c.addEventListener(dS,l),c.dispatchEvent(t),t.defaultPrevented||dN(e??document.body,{select:!0}),c.removeEventListener(dS,l),dL.remove(d)},0)}}},[c,u,l,d]);let b=ne.useCallback(e=>{if(!n&&!r||d.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=dP(t);r&&a?e.shiftKey||i!==a?e.shiftKey&&i===r&&(e.preventDefault(),n&&dN(a,{select:!0})):(e.preventDefault(),n&&dN(r,{select:!0})):i===t&&e.preventDefault()}},[n,r,d.paused]);return(0,t7.jsx)(dt.div,{tabIndex:-1,...o,ref:f,onKeyDown:b})},"FocusScope"));function dM(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(dN(r,{select:t}),document.activeElement!==n)return}function dP(e){let t=dj(e);return[dI(t,e),dI(t.reverse(),e)]}function dj(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:dx(e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}function dI(e,t){let n="function"==typeof t.checkVisibility&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):dA(r,{upTo:t})))return r}function dA(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function dO(e){return e instanceof HTMLInputElement&&"select"in e}function dN(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&dO(e)&&t&&e.select()}}dx(dM,"focusFirst"),dx(dP,"getTabbableEdges"),dx(dj,"getTabbableCandidates"),dx(dI,"findVisible"),dx(dA,"isHidden"),dx(dO,"isSelectableInput"),dx(dN,"focus");var dL=dD();function dD(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),(e=dR(e,t)).unshift(t)},remove(t){e=dR(e,t),e[0]?.resume()}}}function dR(e,t){let n=[...e],r=n.indexOf(t);return -1!==r&&n.splice(r,1),n}function d_(e){return e.filter(e=>"A"!==e.tagName)}dx(dD,"createFocusScopesStack"),dx(dR,"arrayRemove"),dx(d_,"removeLinks");var dB=globalThis?.document?ne.useLayoutEffect:()=>{},dF=Object.defineProperty,d$=ne[" useId ".trim().toString()]||(()=>void 0),dK=0;function dH(e){let[t,n]=ne.useState(d$());return dB(()=>{e||n(e=>e??String(dK++))},[e]),e||(t?`radix-${t}`:"")}dF(dH,"name",{value:"useId",configurable:!0});let dz=["top","right","bottom","left"],dV=Math.min,dU=Math.max,dq=Math.round,dG=Math.floor,dX=e=>({x:e,y:e}),dW={left:"right",right:"left",bottom:"top",top:"bottom"};function dY(e,t){return"function"==typeof e?e(t):e}function dQ(e){return e.split("-")[0]}function dJ(e){return e.split("-")[1]}function dZ(e){return"x"===e?"y":"x"}function d1(e){return"y"===e?"height":"width"}function d0(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function d2(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let d3=["left","right"],d4=["right","left"],d5=["top","bottom"],d6=["bottom","top"];function d8(e){let t=dQ(e);return dW[t]+e.slice(t.length)}function d9(e){var t,n,r,i;return"number"!=typeof e?{top:null!=(t=e.top)?t:0,right:null!=(n=e.right)?n:0,bottom:null!=(r=e.bottom)?r:0,left:null!=(i=e.left)?i:0}:{top:e,right:e,bottom:e,left:e}}function d7(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function be(e,t,n){let r,{reference:i,floating:a}=e,o=d0(t),c=dZ(d0(t)),s=d1(c),u=dQ(t),l=i.x+i.width/2-a.width/2,h=i.y+i.height/2-a.height/2,f=i[s]/2-a[s]/2;switch(u){case"top":r={x:l,y:i.y-a.height};break;case"bottom":r={x:l,y:i.y+i.height};break;case"right":r={x:i.x+i.width,y:h};break;case"left":r={x:i.x-a.width,y:h};break;default:r={x:i.x,y:i.y}}let d=dJ(t);return d&&(r[c]+=f*("end"===d?1:-1)*(n&&"y"===o?-1:1)),r}async function bt(e,t){var n;void 0===t&&(t={});let{x:r,y:i,platform:a,rects:o,elements:c,strategy:s}=e,{boundary:u="clippingAncestors",rootBoundary:l="viewport",elementContext:h="floating",altBoundary:f=!1,padding:d=0}=dY(t,e),b=d9(d),g=c[f?"floating"===h?"reference":"floating":h],w=d7(await a.getClippingRect({element:null==(n=await (null==a.isElement?void 0:a.isElement(g)))||n?g:g.contextElement||await (null==a.getDocumentElement?void 0:a.getDocumentElement(c.floating)),boundary:u,rootBoundary:l,strategy:s})),p="floating"===h?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,v=await (null==a.getOffsetParent?void 0:a.getOffsetParent(c.floating)),y=await (null==a.isElement?void 0:a.isElement(v))&&await (null==a.getScale?void 0:a.getScale(v))||{x:1,y:1},k=d7(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:p,offsetParent:v,strategy:s}):p);return{top:(w.top-k.top+b.top)/y.y,bottom:(k.bottom-w.bottom+b.bottom)/y.y,left:(w.left-k.left+b.left)/y.x,right:(k.right-w.right+b.right)/y.x}}let bn=async(e,t,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,c=o.detectOverflow?o:{...o,detectOverflow:bt},s=await (null==o.isRTL?void 0:o.isRTL(t)),u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:l,y:h}=be(u,r,s),f=r,d=0,b={};for(let n=0;n<a.length;n++){let g=a[n];if(!g)continue;let{name:w,fn:p}=g,{x:v,y:y,data:k,reset:x}=await p({x:l,y:h,initialPlacement:r,placement:f,strategy:i,middlewareData:b,rects:u,platform:c,elements:{reference:e,floating:t}});l=null!=v?v:l,h=null!=y?y:h,b[w]={...b[w],...k},x&&d<50&&(d++,"object"==typeof x&&(x.placement&&(f=x.placement),x.rects&&(u=!0===x.rects?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:l,y:h}=be(u,f,s)),n=-1)}return{x:l,y:h,placement:f,strategy:i,middlewareData:b}};function br(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bi(e){return dz.some(t=>e[t]>=0)}let ba=new Set(["left","top"]);async function bo(e,t){let{placement:n,platform:r,elements:i}=e,a=await (null==r.isRTL?void 0:r.isRTL(i.floating)),o=dQ(n),c=dJ(n),s="y"===d0(n),u=ba.has(o)?-1:1,l=a&&s?-1:1,h=dY(t,e),{mainAxis:f,crossAxis:d,alignmentAxis:b}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&"number"==typeof b&&(d="end"===c?-1*b:b),s?{x:d*l,y:f*u}:{x:f*u,y:d*l}}function bc(){return"u">typeof window}function bs(e){return bh(e)?(e.nodeName||"").toLowerCase():"#document"}function bu(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function bl(e){var t;return null==(t=(bh(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function bh(e){return!!bc()&&(e instanceof Node||e instanceof bu(e).Node)}function bf(e){return!!bc()&&(e instanceof Element||e instanceof bu(e).Element)}function bd(e){return!!bc()&&(e instanceof HTMLElement||e instanceof bu(e).HTMLElement)}function bb(e){return!(!bc()||"u"<typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof bu(e).ShadowRoot)}function bg(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=bE(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==i&&"contents"!==i}function bw(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}let bp=/transform|translate|scale|rotate|perspective|filter/,bv=/paint|layout|strict|content/,bm=e=>!!e&&"none"!==e;function by(e){let t=bf(e)?bE(e):e;return bm(t.transform)||bm(t.translate)||bm(t.scale)||bm(t.rotate)||bm(t.perspective)||!bk()&&(bm(t.backdropFilter)||bm(t.filter))||bp.test(t.willChange||"")||bv.test(t.contain||"")}function bk(){return null==t&&(t="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),t}function bx(e){return/^(html|body|#document)$/.test(bs(e))}function bE(e){return bu(e).getComputedStyle(e)}function bS(e){return bf(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bT(e){if("html"===bs(e))return e;let t=e.assignedSlot||e.parentNode||bb(e)&&e.host||bl(e);return bb(t)?t.host:t}function bC(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);let i=function e(t){let n=bT(t);return bx(n)?(t.ownerDocument||t).body:bd(n)&&bg(n)?n:e(n)}(e),a=i===(null==(r=e.ownerDocument)?void 0:r.body),o=bu(i);if(!a)return t.concat(i,bC(i,[],n));{let e=bM(o);return t.concat(o,o.visualViewport||[],bg(i)?i:[],e&&n?bC(e):[])}}function bM(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bP(e){let t=bE(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=bd(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,c=dq(n)!==a||dq(r)!==o;return c&&(n=a,r=o),{width:n,height:r,$:c}}function bj(e){return bf(e)?e:e.contextElement}function bI(e){let t=bj(e);if(!bd(t))return dX(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=bP(t),o=(a?dq(n.width):n.width)/r,c=(a?dq(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),c&&Number.isFinite(c)||(c=1),{x:o,y:c}}let bA=dX(0);function bO(e){let t=bu(e);return bk()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:bA}function bN(e,t,n,r){var i;void 0===t&&(t=!1),void 0===n&&(n=!1);let a=e.getBoundingClientRect(),o=bj(e),c=dX(1);t&&(r?bf(r)&&(c=bI(r)):c=bI(e));let s=(void 0===(i=n)&&(i=!1),r&&i&&r===bu(o))?bO(o):dX(0),u=(a.left+s.x)/c.x,l=(a.top+s.y)/c.y,h=a.width/c.x,f=a.height/c.y;if(o&&r){let e=bu(o),t=bf(r)?bu(r):r,n=e,i=bM(n);for(;i&&t!==n;){let e=bI(i),t=i.getBoundingClientRect(),r=bE(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;u*=e.x,l*=e.y,h*=e.x,f*=e.y,u+=a,l+=o,i=bM(n=bu(i))}}return d7({width:h,height:f,x:u,y:l})}function bL(e,t){let n=bS(e).scrollLeft;return t?t.left+n:bN(bl(e)).left+n}function bD(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-bL(e,n),y:n.top+t.scrollTop}}function bR(e,t,n){var r;let i;if("viewport"===t||"layoutViewport"===t)i=function(e,t,n){void 0===n&&(n="viewport");let r="layoutViewport"===n,i=bu(e),a=bl(e),o=i.visualViewport,c=a.clientWidth,s=a.clientHeight,u=0,l=0;if(o){let e=!bk()||"fixed"===t;r?e||(u=-o.offsetLeft,l=-o.offsetTop):(c=o.width,s=o.height,e&&(u=o.offsetLeft,l=o.offsetTop))}if(0>=bL(a)){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o="stable both-edges"===getComputedStyle(a).scrollbarGutter?i/2:i;o<=25&&(c-=o)}return{width:c,height:s,x:u,y:l}}(e,n,t);else if("document"===t){let t,n,a,o,c,s;t=bS(r=bl(e)),n=r.ownerDocument.body,a=dU(r.scrollWidth,r.clientWidth,n.scrollWidth,n.clientWidth),o=dU(r.scrollHeight,r.clientHeight,n.scrollHeight,n.clientHeight),c=-t.scrollLeft+bL(r),s=-t.scrollTop,"rtl"===bE(n).direction&&(c+=dU(r.clientWidth,n.clientWidth)-a),i={width:a,height:o,x:c,y:s}}else if(bf(t)){let e,r,a,o,c,s;r=(e=bN(t,!0,"fixed"===n)).top+t.clientTop,a=e.left+t.clientLeft,o=bI(t),c=t.clientWidth*o.x,s=t.clientHeight*o.y,i={width:c,height:s,x:a*o.x,y:r*o.y}}else{let n=bO(e);i={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return d7(i)}function b_(e){return"static"===bE(e).position}function bB(e,t){if(!bd(e)||"fixed"===bE(e).position)return null;if(t)return t(e);let n=e.offsetParent;return bl(e)===n&&(n=n.ownerDocument.body),n}function bF(e,t){var n;let r=bu(e);if(bw(e))return r;if(!bd(e)){let t=bT(e);for(;t&&!bx(t);){if(bf(t)&&!b_(t))return t;t=bT(t)}return r}let i=bB(e,t);for(;i&&(n=i,/^(table|td|th)$/.test(bs(n)))&&b_(i);)i=bB(i,t);return i&&bx(i)&&b_(i)&&!by(i)?r:i||function(e){let t=bT(e);for(;bd(t)&&!bx(t);){if(by(t))return t;if(bw(t))break;t=bT(t)}return null}(e)||r}let b$=async function(e){let t=this.getOffsetParent||bF,n=this.getDimensions,r=await n(e.floating);return{reference:function(e,t,n){let r=bd(t),i=bl(t),a="fixed"===n,o=bN(e,!0,a,t),c={scrollLeft:0,scrollTop:0},s=dX(0);if((r||!a)&&(("body"!==bs(t)||bg(i))&&(c=bS(t)),r)){let e=bN(t,!0,a,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}!r&&i&&(s.x=bL(i));let u=!i||r||a?dX(0):bD(i,c);return{x:o.left+c.scrollLeft-s.x-u.x,y:o.top+c.scrollTop-s.y-u.y,width:o.width,height:o.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},bK={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a="fixed"===i,o=bl(r),c=!!t&&bw(t.floating);if(r===o||c&&a)return n;let s={scrollLeft:0,scrollTop:0},u=dX(1),l=dX(0),h=bd(r);if((h||!a)&&(("body"!==bs(r)||bg(o))&&(s=bS(r)),h)){let e=bN(r);u=bI(r),l.x=e.x+r.clientLeft,l.y=e.y+r.clientTop}let f=!o||h||a?dX(0):bD(o,s);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-s.scrollLeft*u.x+l.x+f.x,y:n.y*u.y-s.scrollTop*u.y+l.y+f.y}},getDocumentElement:bl,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[..."clippingAncestors"===n?bw(t)?[]:function(e,t){let n=t.get(e);if(n)return n;let r=bC(e,[],!1).filter(e=>bf(e)&&"body"!==bs(e)),i=null,a="fixed"===bE(e).position,o=a?bT(e):e;for(;bf(o)&&!bx(o);){let e=bE(o),t=by(o),n=i?i.position:a?"fixed":"";t||"fixed"!==n&&("absolute"!==n||"static"!==e.position)?i=e:r=r.filter(e=>e!==o),o=bT(o)}return t.set(e,r),r}(t,this._c):[].concat(n),r],o=bR(t,a[0],i),c=o.top,s=o.right,u=o.bottom,l=o.left;for(let e=1;e<a.length;e++){let n=bR(t,a[e],i);c=dU(n.top,c),s=dV(n.right,s),u=dV(n.bottom,u),l=dU(n.left,l)}return{width:s-l,height:u-c,x:l,y:c}},getOffsetParent:bF,getElementRects:b$,getClientRects:function(e){return e.getClientRects?Array.from(e.getClientRects()):[]},getDimensions:function(e){let{width:t,height:n}=bP(e);return{width:t,height:n}},getScale:bI,isElement:bf,isRTL:function(e){return"rtl"===bE(e).direction}};function bH(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}let bz=e=>({name:"arrow",options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:c,middlewareData:s}=t,{element:u,padding:l=0}=dY(e,t)||{};if(null==u)return{};let h=d9(l),f={x:n,y:r},d=dZ(d0(i)),b=d1(d),g=await o.getDimensions(u),w="y"===d,p=w?"clientHeight":"clientWidth",v=a.reference[b]+a.reference[d]-f[d]-a.floating[b],y=f[d]-a.reference[d],k=await (null==o.getOffsetParent?void 0:o.getOffsetParent(u)),x=k?k[p]:0;x&&await (null==o.isElement?void 0:o.isElement(k))||(x=c.floating[p]||a.floating[b]);let E=x/2-g[b]/2-1,S=dV(h[w?"top":"left"],E),T=dV(h[w?"bottom":"right"],E),C=x-g[b]-T,M=x/2-g[b]/2+(v/2-y/2),P=dU(S,dV(M,C)),j=!s.arrow&&null!=dJ(i)&&M!==P&&a.reference[b]/2-(M<S?S:T)-g[b]/2<0,I=j?M<S?M-S:M-C:0;return{[d]:f[d]+I,data:{[d]:P,centerOffset:M-P-I,...j&&{alignmentOffset:I}},reset:j}}});var bV="u">typeof document?ne.useLayoutEffect:function(){};function bU(e,t){let n,r,i;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(r=n;0!=r--;)if(!bU(e[r],t[r]))return!1;return!0}if((n=(i=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!({}).hasOwnProperty.call(t,i[r]))return!1;for(r=n;0!=r--;){let n=i[r];if(("_owner"!==n||!e.$$typeof)&&!bU(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function bq(e){return"u"<typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bG(e,t){let n=bq(e);return Math.round(t*n)/n}function bX(e){let t=ne.useRef(e);return bV(()=>{t.current=e}),t}var bW=Object.defineProperty,bY=ne.forwardRef(bW(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,t7.jsx)(dt.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:(0,t7.jsx)("polygon",{points:"0,0 30,0 15,10"})})},"name",{value:"Arrow",configurable:!0}));function bQ(e){let[t,n]=ne.useState(void 0);return dB(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,i;if(!Array.isArray(t)||!t.length)return;let a=t[0];if("borderBoxSize"in a){let e=a.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,i=t.blockSize}else r=e.offsetWidth,i=e.offsetHeight;n({width:r,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}(0,Object.defineProperty)(bQ,"name",{value:"useSize",configurable:!0});var bJ=Object.defineProperty,bZ=(e,t)=>bJ(e,"name",{value:t,configurable:!0}),b1="Popper",[b0,b2]=fP(b1),[b3,b4]=b0(b1),b5=bZ(e=>{let{__scopePopper:t,children:n}=e,[r,i]=ne.useState(null),[a,o]=ne.useState(void 0);return(0,t7.jsx)(b3,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},"Popper"),b6=ne.forwardRef(bZ(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=b4("PopperAnchor",n),o=ne.useRef(null),c=a.onAnchorChange,s=fL(t,ne.useCallback(e=>{o.current=e,e&&c(e)},[c])),u=ne.useRef(null);ne.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&c(u.current)});let l=a.placementState&&ga(a.placementState),h=l?.[0],f=l?.[1];return r?null:(0,t7.jsx)(dt.div,{"data-radix-popper-side":h,"data-radix-popper-align":f,...i,ref:s})},"PopperAnchor")),b8="PopperContent",[b9,b7]=b0(b8),ge=ne.forwardRef(bZ(function(e,t){var n,r,i,a,o,c,s,u,l,h,f,d,b;let g,w,p,v,y,k,{__scopePopper:x,side:E="bottom",sideOffset:S=0,align:T="center",alignOffset:C=0,arrowPadding:M=0,avoidCollisions:P=!0,collisionBoundary:j=[],collisionPadding:I=0,sticky:A="partial",hideWhenDetached:O=!1,updatePositionStrategy:N="optimized",onPlaced:L,...D}=e,R=b4(b8,x),[_,B]=ne.useState(null),F=fL(t,B),[$,K]=ne.useState(null),H=bQ($),z=H?.width??0,V=H?.height??0,U="number"==typeof I?I:{top:0,right:0,bottom:0,left:0,...I},q=Array.isArray(j)?j:[j],G=q.length>0,X={padding:U,boundary:q.filter(gr),altBoundary:G},{refs:W,floatingStyles:Y,placement:Q,isPositioned:J,middlewareData:Z}=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:c=!0,whileElementsMounted:s,open:u}=e,[l,h]=ne.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,d]=ne.useState(r);bU(f,r)||d(r);let[b,g]=ne.useState(null),[w,p]=ne.useState(null),v=ne.useCallback(e=>{e!==E.current&&(E.current=e,g(e))},[]),y=ne.useCallback(e=>{e!==S.current&&(S.current=e,p(e))},[]),k=a||b,x=o||w,E=ne.useRef(null),S=ne.useRef(null),T=ne.useRef(l),C=null!=s,M=bX(s),P=bX(i),j=bX(u),I=ne.useCallback(()=>{var e,r;let i,a,o;if(!E.current||!S.current)return;let c={placement:t,strategy:n,middleware:f};P.current&&(c.platform=P.current),(e=E.current,r=S.current,i=new Map,a=null!=c?c:{},o={...bK,...a.platform,_c:i},bn(e,r,{...a,platform:o})).then(e=>{let t={...e,isPositioned:!1!==j.current};A.current&&!bU(T.current,t)&&(T.current=t,fv.flushSync(()=>{h(t)}))})},[f,t,n,P,j]);bV(()=>{!1===u&&T.current.isPositioned&&(T.current.isPositioned=!1,h(e=>({...e,isPositioned:!1})))},[u]);let A=ne.useRef(!1);bV(()=>(A.current=!0,()=>{A.current=!1}),[]),bV(()=>{if(k&&(E.current=k),x&&(S.current=x),k&&x){if(M.current)return M.current(k,x,I);I()}},[k,x,I,M,C]);let O=ne.useMemo(()=>({reference:E,floating:S,setReference:v,setFloating:y}),[v,y]),N=ne.useMemo(()=>({reference:k,floating:x}),[k,x]),L=ne.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=bG(N.floating,l.x),r=bG(N.floating,l.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...bq(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,c,N.floating,l.x,l.y]);return ne.useMemo(()=>({...l,update:I,refs:O,elements:N,floatingStyles:L}),[l,I,O,N,L])}({strategy:"fixed",placement:E+("center"!==T?"-"+T:""),whileElementsMounted:bZ((...e)=>(function(e,t,n,r){let i;void 0===r&&(r={});let{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:c="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:u=!1}=r,l=bj(e),h=a||o?[...l?bC(l):[],...t?bC(t):[]]:[];h.forEach(e=>{a&&e.addEventListener("scroll",n),o&&e.addEventListener("resize",n)});let f=l&&s?function(e,t,n){let r,i=null,a=bl(e);function o(){var e;clearTimeout(r),null==(e=i)||e.disconnect(),i=null}function c(n,s){void 0===n&&(n=!1),void 0===s&&(s=1),o();let u=e.getBoundingClientRect(),{left:l,top:h,width:f,height:d}=u;if(n||t(),!f||!d)return;let b={rootMargin:-dG(h)+"px "+-dG(a.clientWidth-(l+f))+"px "+-dG(a.clientHeight-(h+d))+"px "+-dG(l)+"px",threshold:dU(0,dV(1,s))||1},g=!0;function w(t){let n=t[0].intersectionRatio;if(!bH(u,e.getBoundingClientRect()))return c();if(n!==s){if(!g)return c();n?c(!1,n):r=setTimeout(()=>{c(!1,1e-7)},1e3)}g=!1}try{i=new IntersectionObserver(w,{...b,root:a.ownerDocument})}catch(e){i=new IntersectionObserver(w,b)}i.observe(e)}let s=bu(e),u=()=>c(n);return s.addEventListener("resize",u),c(!0),()=>{s.removeEventListener("resize",u),o()}}(l,n,o):null,d=-1,b=null;c&&(b=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&b&&t&&(b.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var e;null==(e=b)||e.observe(t)})),n()}),l&&!u&&b.observe(l),t&&b.observe(t));let g=u?bN(e):null;return u&&function t(){let r=bN(e);g&&!bH(g,r)&&n(),g=r,i=requestAnimationFrame(t)}(),n(),()=>{var e;h.forEach(e=>{a&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)}),null==f||f(),null==(e=b)||e.disconnect(),b=null,u&&cancelAnimationFrame(i)}})(...e,{animationFrame:"always"===N}),"whileElementsMounted"),elements:{reference:R.anchor},middleware:[{name:(g={name:"offset",options:r=n={mainAxis:S+V,alignmentAxis:C},async fn(e){var t,n;let{x:i,y:a,placement:o,middlewareData:c}=e,s=await bo(e,r);return o===(null==(t=c.offset)?void 0:t.placement)&&null!=(n=c.arrow)&&n.alignmentOffset?{}:{x:i+s.x,y:a+s.y,data:{...s,placement:o}}}}).name,fn:g.fn,options:[n,void 0]},P&&{name:(w={name:"shift",options:o=a={mainAxis:!0,crossAxis:!1,limiter:"partial"===A?{fn:(i=void 0,{options:i={},fn(e){var t,n,r,a;let{x:o,y:c,placement:s,rects:u,middlewareData:l}=e,{offset:h=0,mainAxis:f=!0,crossAxis:d=!0}=dY(i,e),b={x:o,y:c},g=d0(s),w=dZ(g),p=b[w],v=b[g],y=dY(h,e),k="number"==typeof y?{mainAxis:y,crossAxis:0}:{mainAxis:null!=(t=y.mainAxis)?t:0,crossAxis:null!=(n=y.crossAxis)?n:0};if(f){let e="y"===w?"height":"width",t=u.reference[w]-u.floating[e]+k.mainAxis,n=u.reference[w]+u.reference[e]-k.mainAxis;p<t?p=t:p>n&&(p=n)}if(d){let e="y"===w?"width":"height",t=ba.has(dQ(s)),n=u.reference[g]-u.floating[e]+(t&&(null==(r=l.offset)?void 0:r[g])||0)+(t?0:k.crossAxis),i=u.reference[g]+u.reference[e]+(t?0:(null==(a=l.offset)?void 0:a[g])||0)-(t?k.crossAxis:0);v<n?v=n:v>i&&(v=i)}return{[w]:p,[g]:v}}}).fn,options:[void 0,void 0]}:void 0,...X},async fn(e){let{x:t,y:n,placement:r,platform:i}=e,{mainAxis:a=!0,crossAxis:c=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=dY(o,e),l={x:t,y:n},h=await i.detectOverflow(e,u),f=d0(r),d=dZ(f),b=l[d],g=l[f],w=(e,t)=>dU(t+h["y"===e?"top":"left"],dV(t,t-h["y"===e?"bottom":"right"]));a&&(b=w(d,b)),c&&(g=w(f,g));let p=s.fn({...e,[d]:b,[f]:g});return{...p,data:{x:p.x-t,y:p.y-n,enabled:{[d]:a,[f]:c}}}}}).name,fn:w.fn,options:[a,void 0]},P&&{name:(p={name:"flip",options:s=c={...X},async fn(e){var t,n,r,i,a,o,c,u;let l,h,f,{placement:d,middlewareData:b,rects:g,initialPlacement:w,platform:p,elements:v}=e,{mainAxis:y=!0,crossAxis:k=!0,fallbackPlacements:x,fallbackStrategy:E="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:T=!0,...C}=dY(s,e);if(null!=(t=b.arrow)&&t.alignmentOffset)return{};let M=dQ(d),P=d0(w),j=dQ(w)===w,I=await (null==p.isRTL?void 0:p.isRTL(v.floating)),A=x||(j||!T?[d8(w)]:(l=d8(w),[d2(w),l,d2(l)])),O="none"!==S;!x&&O&&A.push(...(h=dJ(w),f=function(e,t,n){switch(e){case"top":case"bottom":if(n)return t?d4:d3;return t?d3:d4;case"left":case"right":return t?d5:d6;default:return[]}}(dQ(w),"start"===S,I),h&&(f=f.map(e=>e+"-"+h),T&&(f=f.concat(f.map(d2)))),f));let N=[w,...A],L=await p.detectOverflow(e,C),D=[],R=(null==(n=b.flip)?void 0:n.overflows)||[];if(y&&D.push(L[M]),k){let e,t,n,r,i=(o=d,c=g,void 0===(u=I)&&(u=!1),e=dJ(o),n=d1(t=dZ(d0(o))),r="x"===t?e===(u?"end":"start")?"right":"left":"start"===e?"bottom":"top",c.reference[n]>c.floating[n]&&(r=d8(r)),[r,d8(r)]);D.push(L[i[0]],L[i[1]])}if(R=[...R,{placement:d,overflows:D}],!D.every(e=>e<=0)){let e=((null==(r=b.flip)?void 0:r.index)||0)+1,t=N[e];if(t&&("alignment"!==k||P===d0(t)||R.every(e=>d0(e.placement)!==P||e.overflows[0]>0)))return{data:{index:e,overflows:R},reset:{placement:t}};let n=null==(i=R.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:i.placement;if(!n)switch(E){case"bestFit":{let e=null==(a=R.filter(e=>{if(O){let t=d0(e.placement);return t===P||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:a[0];e&&(n=e);break}case"initialPlacement":n=w}if(d!==n)return{reset:{placement:n}}}return{}}}).name,fn:p.fn,options:[c,void 0]},{name:(v={name:"size",options:l=u={...X,apply:bZ(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty("--radix-popper-available-width",`${n}px`),o.setProperty("--radix-popper-available-height",`${r}px`),o.setProperty("--radix-popper-anchor-width",`${i}px`),o.setProperty("--radix-popper-anchor-height",`${a}px`)},"apply")},async fn(e){let t,n,{placement:r,rects:i,platform:a,elements:o}=e,{apply:c=()=>{},...s}=dY(l,e),u=await a.detectOverflow(e,s),h=dQ(r),f=dJ(r),d="y"===d0(r),{width:b,height:g}=i.floating;"top"===h||"bottom"===h?(t=h,n=f===(await (null==a.isRTL?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(n=h,t="end"===f?"top":"bottom");let w=g-u.top-u.bottom,p=b-u.left-u.right,v=dV(g-u[t],w),y=dV(b-u[n],p),k=e.middlewareData.shift,x=!k,E=v,S=y;null!=k&&k.enabled.x&&(S=p),null!=k&&k.enabled.y&&(E=w),x&&!f&&(d?S=b-2*dU(u.left,u.right):E=g-2*dU(u.top,u.bottom)),await c({...e,availableWidth:S,availableHeight:E});let T=await a.getDimensions(o.floating);return b!==T.width||g!==T.height?{reset:{rects:!0}}:{}}}).name,fn:v.fn,options:[u,void 0]},$&&{name:(y={name:"arrow",options:f=h={element:$,padding:M},fn(e){let{element:t,padding:n}="function"==typeof f?f(e):f;return t&&({}).hasOwnProperty.call(t,"current")?null!=t.current?bz({element:t.current,padding:n}).fn(e):{}:t?bz({element:t,padding:n}).fn(e):{}}}).name,fn:y.fn,options:[h,void 0]},gi({arrowWidth:z,arrowHeight:V}),O&&{name:(k={name:"hide",options:b=d={strategy:"referenceHidden",...X,boundary:G?X.boundary:void 0},async fn(e){let{rects:t,platform:n}=e,{strategy:r="referenceHidden",...i}=dY(b,e);switch(r){case"referenceHidden":{let r=br(await n.detectOverflow(e,{...i,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:bi(r)}}}case"escaped":{let r=br(await n.detectOverflow(e,{...i,altBoundary:!0}),t.floating);return{data:{escapedOffsets:r,escaped:bi(r)}}}default:return{}}}}).name,fn:k.fn,options:[d,void 0]}]}),ee=R.setPlacementState;dB(()=>(ee(Q),()=>{ee(void 0)}),[Q,ee]);let[et,en]=ga(Q),er=dr(L);dB(()=>{J&&er?.()},[J,er]);let ei=Z.arrow?.x,ea=Z.arrow?.y,eo=Z.arrow?.centerOffset!==0,[ec,es]=ne.useState();return dB(()=>{_&&es(window.getComputedStyle(_).zIndex)},[_]),(0,t7.jsx)("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:J?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ec,"--radix-popper-transform-origin":[Z.transformOrigin?.x,Z.transformOrigin?.y].join(" "),...Z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,t7.jsx)(b9,{scope:x,placedSide:et,placedAlign:en,onArrowChange:K,arrowX:ei,arrowY:ea,shouldHideArrow:eo,children:(0,t7.jsx)(dt.div,{"data-side":et,"data-align":en,...D,ref:F,style:{...D.style,animation:J?D.style?.animation:"none"}})})})},"PopperContent")),gt={top:"bottom",right:"left",bottom:"top",left:"right"},gn=ne.forwardRef(bZ(function(e,t){let{__scopePopper:n,...r}=e,i=b7("PopperArrow",n),a=gt[i.placedSide];return(0,t7.jsx)("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:(0,t7.jsx)(bY,{...r,ref:t,style:{...r.style,display:"block"}})})},"PopperArrow"));function gr(e){return null!==e}bZ(gr,"isNotNull");var gi=bZ(e=>({name:"transformOrigin",options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[s,u]=ga(n),l={start:"0%",center:"50%",end:"100%"}[u],h=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+c/2,d="",b="";return"bottom"===s?(d=a?l:`${h}px`,b=`${-c}px`):"top"===s?(d=a?l:`${h}px`,b=`${r.floating.height+c}px`):"right"===s?(d=`${-c}px`,b=a?l:`${f}px`):"left"===s&&(d=`${r.floating.width+c}px`,b=a?l:`${f}px`),{data:{x:d,y:b}}}}),"transformOrigin");function ga(e){let[t,n="center"]=e.split("-");return[t,n]}bZ(ga,"getSideAndAlignFromPlacement");var go=Object.defineProperty,gc=ne.forwardRef(go(function(e,t){let{container:n,...r}=e,[i,a]=ne.useState(!1);dB(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?fv.createPortal((0,t7.jsx)(dt.div,{...r,ref:t}),o):null},"name",{value:"Portal",configurable:!0})),gs=Object.defineProperty,gu=(e,t)=>gs(e,"name",{value:t,configurable:!0});function gl(e,t){return ne.useReducer((e,n)=>t[e][n]??e,e)}gu(gl,"useStateMachine");var gh=gu(e=>{let{present:t,children:n}=e,r=gf(t),i="function"==typeof n?n({present:r.isPresent}):ne.Children.only(n),a=gb(r.ref,gw(i));return"function"==typeof n||r.isPresent?ne.cloneElement(i,{ref:a}):null},"Presence");function gf(e){let[t,n]=ne.useState(),r=ne.useRef(null),i=ne.useRef(e),a=ne.useRef("none"),o=ne.useRef(void 0),[c,s]=gl(e?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return ne.useEffect(()=>{"mounted"===c?(a.current=o.current??gg(r.current),o.current=void 0):a.current="none"},[c]),dB(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,c=gg(t);e?(o.current=c,s("MOUNT")):"none"===c||t?.display==="none"?s("UNMOUNT"):n&&r!==c?s("ANIMATION_OUT"):s("UNMOUNT"),i.current=e}},[e,s]),dB(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=gu(a=>{let o=gg(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s("ANIMATION_END"),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)})}},"handleAnimationEnd"),c=gu(e=>{e.target===t&&(a.current=gg(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",c),t.addEventListener("animationcancel",o),t.addEventListener("animationend",o),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",c),t.removeEventListener("animationcancel",o),t.removeEventListener("animationend",o)}}s("ANIMATION_END")},[t,s]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:ne.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=gg(t)}else r.current=null;n(e)},[])}}function gd(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function gb(...e){let t=ne.useRef(e);return t.current=e,ne.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=gd(t,e);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];"function"==typeof t?t():gd(n[e],null)}}},[])}function gg(e){return e?.animationName||"none"}function gw(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(n=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}gu(gf,"usePresence"),gu(gd,"setRef"),gu(gb,"useStableComposedRefs"),gu(gg,"getAnimationName"),gu(gw,"getElementRef");var gp=Object.defineProperty,gv=ne[" useEffectEvent ".trim().toString()],gm=ne[" useInsertionEffect ".trim().toString()];function gy(e){if("function"==typeof gv)return gv(e);let t=ne.useRef(()=>{throw Error("Cannot call an event handler while rendering.")});return"function"==typeof gm?gm(()=>{t.current=e}):dB(()=>{t.current=e}),ne.useMemo(()=>(...e)=>t.current?.(...e),[])}gp(gy,"name",{value:"useEffectEvent",configurable:!0});var gk=Object.defineProperty,gx=(e,t)=>gk(e,"name",{value:t,configurable:!0}),gE=ne[" useInsertionEffect ".trim().toString()]||dB;function gS({prop:e,defaultProp:t,onChange:n=gx(()=>{},"onChange"),caller:r}){let[i,a,o]=gT({defaultProp:t,onChange:n}),c=void 0!==e,s=c?e:i;return[s,ne.useCallback(t=>{if(c){let n=gC(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[c,e,a,o])]}function gT({defaultProp:e,onChange:t}){let[n,r]=ne.useState(e),i=ne.useRef(n),a=ne.useRef(t);return gE(()=>{a.current=t},[t]),ne.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function gC(e){return"function"==typeof e}gx(gS,"useControllableState"),gx(gT,"useUncontrolledState"),gx(gC,"isFunction");var gM=Symbol("RADIX:SYNC_STATE");function gP(e){let t=ne.useRef({value:e,previous:e});return ne.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}gx(function(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:c}=t,s=void 0!==i,u=gy(o),l=[{...n,state:a}];r&&l.push(r);let[h,f]=ne.useReducer((t,n)=>{if(n.type===gM)return{...t,state:n.state};let r=e(t,n);return s&&!Object.is(r.state,t.state)&&u(r.state),r},...l),d=h.state,b=ne.useRef(d);ne.useEffect(()=>{b.current!==d&&(b.current=d,s||u(d))},[d,b,s]);let g=ne.useMemo(()=>void 0!==i?{...h,state:i}:h,[h,i]);return ne.useEffect(()=>{s&&!Object.is(i,h.state)&&f({type:gM,state:i})},[i,h.state,s]),[g,f]},"useControllableStateReducer"),(0,Object.defineProperty)(gP,"name",{value:"usePrevious",configurable:!0});var gj=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),gI=new WeakMap,gA=new WeakMap,gO={},gN=0,gL=function(e){return e&&(e.host||gL(e.parentNode))},gD=function(e,t,n,r){var i=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var n=gL(e);return n&&t.contains(n)?n:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});gO[n]||(gO[n]=new WeakMap);var a=gO[n],o=[],c=new Set,s=new Set(i),u=function(e){!e||c.has(e)||(c.add(e),u(e.parentNode))};i.forEach(u);var l=function(e){!e||s.has(e)||Array.prototype.forEach.call(e.children,function(e){if(c.has(e))l(e);else try{var t=e.getAttribute(r),i=null!==t&&"false"!==t,s=(gI.get(e)||0)+1,u=(a.get(e)||0)+1;gI.set(e,s),a.set(e,u),o.push(e),1===s&&i&&gA.set(e,!0),1===u&&e.setAttribute(n,"true"),i||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return l(t),c.clear(),gN++,function(){o.forEach(function(e){var t=gI.get(e)-1,i=a.get(e)-1;gI.set(e,t),a.set(e,i),t||(gA.has(e)||e.removeAttribute(r),gA.delete(e)),i||e.removeAttribute(n)}),--gN||(gI=new WeakMap,gI=new WeakMap,gA=new WeakMap,gO={})}},gR=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||("u"<typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),gD(r,i,n,"aria-hidden")):function(){return null}},g_=function(){return(g_=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function gB(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var gF=("function"==typeof SuppressedError&&SuppressedError,"right-scroll-bar-position"),g$="width-before-scroll-bar";function gK(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var gH="u">typeof window?ne.useLayoutEffect:ne.useEffect,gz=new WeakMap,gV=(void 0===c&&(c={}),(void 0===s&&(s=function(e){return e}),u=[],l=!1,h={read:function(){if(l)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return u.length?u[u.length-1]:null},useMedium:function(e){var t=s(e,l);return u.push(t),function(){u=u.filter(function(e){return e!==t})}},assignSyncMedium:function(e){for(l=!0;u.length;){var t=u;u=[],t.forEach(e)}u={push:function(t){return e(t)},filter:function(){return u}}},assignMedium:function(e){l=!0;var t=[];if(u.length){var n=u;u=[],n.forEach(e),t=u}var r=function(){var n=t;t=[],n.forEach(e)},i=function(){return Promise.resolve().then(r)};i(),u={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),u}}}}).options=g_({async:!0,ssr:!1},c),h),gU=function(){},gq=ne.forwardRef(function(e,t){var n,r,i,a,o=ne.useRef(null),c=ne.useState({onScrollCapture:gU,onWheelCapture:gU,onTouchMoveCapture:gU}),s=c[0],u=c[1],l=e.forwardProps,h=e.children,f=e.className,d=e.removeScrollBar,b=e.enabled,g=e.shards,w=e.sideCar,p=e.noRelative,v=e.noIsolation,y=e.inert,k=e.allowPinchZoom,x=e.as,E=e.gapMode,S=gB(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=(n=[o,t],r=function(e){return n.forEach(function(t){return gK(t,e)})},(i=(0,ne.useState)(function(){return{value:null,callback:r,facade:{get current(){return i.value},set current(value){var e=i.value;e!==value&&(i.value=value,i.callback(value,e))}}}})[0]).callback=r,a=i.facade,gH(function(){var e=gz.get(a);if(e){var t=new Set(e),r=new Set(n),i=a.current;t.forEach(function(e){r.has(e)||gK(e,null)}),r.forEach(function(e){t.has(e)||gK(e,i)})}gz.set(a,n)},[n]),a),C=g_(g_({},S),s);return ne.createElement(ne.Fragment,null,b&&ne.createElement(w,{sideCar:gV,removeScrollBar:d,shards:g,noRelative:p,noIsolation:v,inert:y,setCallbacks:u,allowPinchZoom:!!k,lockRef:o,gapMode:E}),l?ne.cloneElement(ne.Children.only(h),g_(g_({},C),{ref:T})):ne.createElement(void 0===x?"div":x,g_({},C,{className:f,ref:T}),h))});gq.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},gq.classNames={fullWidth:g$,zeroRight:gF};var gG=function(e){var t=e.sideCar,n=gB(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error("Sidecar medium not found");return ne.createElement(r,g_({},n))};gG.isSideCarExport=!0;var gX=function(){var e=0,t=null;return{add:function(n){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=t9||("u">typeof __webpack_nonce__?__webpack_nonce__:void 0);return t&&e.setAttribute("nonce",t),e}())){var r,i;(r=t).styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n)),i=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(i)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},gW=function(){var e=gX();return function(t,n){ne.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},gY=function(){var e=gW();return function(t){return e(t.styles,t.dynamic),null}},gQ={left:0,top:0,right:0,gap:0},gJ=function(e){return parseInt(e||"",10)||0},gZ=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],i=t["padding"===e?"paddingRight":"marginRight"];return[gJ(n),gJ(r),gJ(i)]},g1=function(e){if(void 0===e&&(e="margin"),"u"<typeof window)return gQ;var t=gZ(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},g0=gY(),g2="data-scroll-locked",g3=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,c=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(c,"px ").concat(r,";\n }\n body[").concat(g2,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(i,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(o,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(c,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(gF," {\n right: ").concat(c,"px ").concat(r,";\n }\n \n .").concat(g$," {\n margin-right: ").concat(c,"px ").concat(r,";\n }\n \n .").concat(gF," .").concat(gF," {\n right: 0 ").concat(r,";\n }\n \n .").concat(g$," .").concat(g$," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(g2,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(c,"px;\n }\n")},g4=function(){var e=parseInt(document.body.getAttribute(g2)||"0",10);return isFinite(e)?e:0},g5=function(){ne.useEffect(function(){return document.body.setAttribute(g2,(g4()+1).toString()),function(){var e=g4()-1;e<=0?document.body.removeAttribute(g2):document.body.setAttribute(g2,e.toString())}},[])},g6=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=void 0===r?"margin":r;g5();var a=ne.useMemo(function(){return g1(i)},[i]);return ne.createElement(g0,{styles:g3(a,!t,i,n?"":"!important")})},g8=!1;if("u">typeof window)try{var g9=Object.defineProperty({},"passive",{get:function(){return g8=!0,!0}});window.addEventListener("test",g9,g9),window.removeEventListener("test",g9,g9)}catch(e){g8=!1}var g7=!!g8&&{passive:!1},we=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&(n.overflowY!==n.overflowX||"TEXTAREA"===e.tagName||"visible"!==n[t])},wt=function(e,t){var n=t.ownerDocument,r=t;do{if("u">typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),wn(e,r)){var i=wr(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body)return!1},wn=function(e,t){return"v"===e?we(t,"overflowY"):we(t,"overflowX")},wr=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},wi=function(e,t,n,r,i){var a,o=(a=window.getComputedStyle(t).direction,"h"===e&&"rtl"===a?-1:1),c=o*r,s=n.target,u=t.contains(s),l=!1,h=c>0,f=0,d=0;do{if(!s)break;var b=wr(e,s),g=b[0],w=b[1]-b[2]-o*g;(g||w)&&wn(e,s)&&(f+=w,d+=g);var p=s.parentNode;s=p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE?p.host:p}while(!u&&s!==document.body||u&&(t.contains(s)||t===s))return h&&(i&&1>Math.abs(f)||!i&&c>f)?l=!0:!h&&(i&&1>Math.abs(d)||!i&&-c>d)&&(l=!0),l},wa=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},wo=function(e){return[e.deltaX,e.deltaY]},wc=function(e){return e&&"current"in e?e.current:e},ws=0,wu=[];let wl=(f=function(e){var t=ne.useRef([]),n=ne.useRef([0,0]),r=ne.useRef(),i=ne.useState(ws++)[0],a=ne.useState(gY)[0],o=ne.useRef(e);ne.useEffect(function(){o.current=e},[e]),ne.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var t=(function(e,t,n){if(n||2==arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))})([e.lockRef.current],(e.shards||[]).map(wc),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var c=ne.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!o.current.allowPinchZoom;var i,a=wa(e),c=n.current,s="deltaX"in e?e.deltaX:c[0]-a[0],u="deltaY"in e?e.deltaY:c[1]-a[1],l=e.target,h=Math.abs(s)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===h&&"range"===l.type)return!1;var f=window.getSelection(),d=f&&f.anchorNode;if(d&&(d===l||d.contains(l)))return!1;var b=wt(h,l);if(!b)return!0;if(b?i=h:(i="v"===h?"h":"v",b=wt(h,l)),!b)return!1;if(!r.current&&"changedTouches"in e&&(s||u)&&(r.current=i),!i)return!0;var g=r.current||i;return wi(g,t,e,"h"===g?s:u,!0)},[]),s=ne.useCallback(function(e){if(wu.length&&wu[wu.length-1]===a){var n="deltaY"in e?wo(e):wa(e),r=t.current.filter(function(t){var r;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(r=t.delta,r[0]===n[0]&&r[1]===n[1])})[0];if(r&&r.should){e.cancelable&&e.preventDefault();return}if(!r){var i=(o.current.shards||[]).map(wc).filter(Boolean).filter(function(t){return t.contains(e.target)});(i.length>0?c(e,i[0]):!o.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),u=ne.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),l=ne.useCallback(function(e){n.current=wa(e),r.current=void 0},[]),h=ne.useCallback(function(t){u(t.type,wo(t),t.target,c(t,e.lockRef.current))},[]),f=ne.useCallback(function(t){u(t.type,wa(t),t.target,c(t,e.lockRef.current))},[]);ne.useEffect(function(){return wu.push(a),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",s,g7),document.addEventListener("touchmove",s,g7),document.addEventListener("touchstart",l,g7),function(){wu=wu.filter(function(e){return e!==a}),document.removeEventListener("wheel",s,g7),document.removeEventListener("touchmove",s,g7),document.removeEventListener("touchstart",l,g7)}},[]);var d=e.removeScrollBar,b=e.inert;return ne.createElement(ne.Fragment,null,b?ne.createElement(a,{styles:"\n .block-interactivity-".concat(i," {pointer-events: none;}\n .allow-interactivity-").concat(i," {pointer-events: all;}\n")}):null,d?ne.createElement(g6,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},gV.useMedium(f),gG);var wh=ne.forwardRef(function(e,t){return ne.createElement(gq,g_({},e,{ref:t,sideCar:wl}))});wh.classNames=gq.classNames;var wf=Object.defineProperty,wd=(e,t)=>wf(e,"name",{value:t,configurable:!0}),wb=[" ","Enter","ArrowUp","ArrowDown"],wg=[" ","Enter"],ww="Select",[wp,wv,wm]=fQ(ww),[wy,wk]=fP(ww,[wm,b2]),wx=b2(),[wE,wS]=wy(ww),[wT,wC]=wy(ww);function wM(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:c,onValueChange:s,dir:u,name:l,autoComplete:h,disabled:f,required:d,form:b,internal_do_not_use_render:g}=e,w=wx(t),[p,v]=ne.useState(null),[y,k]=ne.useState(null),[x,E]=ne.useState(!1),S=f7(u),[T,C]=gS({prop:r,defaultProp:i??!1,onChange:a,caller:ww}),[M,P]=gS({prop:o,defaultProp:c,onChange:s,caller:ww}),j=ne.useRef(null),I=ne.useRef(M);ne.useEffect(()=>{let e=b?p?.ownerDocument.getElementById(b):p?.form;if(e instanceof HTMLFormElement){let t=wd(()=>P(I.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[b,p,P]);let A=!p||!!b||!!p.closest("form"),[O,N]=ne.useState(new Set),L=dH(),D=Array.from(O).map(e=>e.props.value).join(";"),R=ne.useCallback(e=>{N(t=>new Set(t).add(e))},[]),_=ne.useCallback(e=>{N(t=>{let n=new Set(t);return n.delete(e),n})},[]),B={required:d,trigger:p,onTriggerChange:v,valueNode:y,onValueNodeChange:k,valueNodeHasChildren:x,onValueNodeHasChildrenChange:E,contentId:L,value:M,onValueChange:P,open:T,onOpenChange:C,dir:S,triggerPointerDownPosRef:j,disabled:f,name:l,autoComplete:h,form:b,nativeOptions:O,nativeSelectKey:D,isFormControl:A};return(0,t7.jsx)(b5,{...w,children:(0,t7.jsx)(wE,{scope:t,...B,children:(0,t7.jsx)(wp.Provider,{scope:t,children:(0,t7.jsx)(wT,{scope:t,onNativeOptionAdd:R,onNativeOptionRemove:_,children:pr(g)?g(B):n})})})})}wd(wM,"SelectProvider");var wP=wd(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,t7.jsx)(wM,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,t7.jsxs)(t7.Fragment,{children:[n,e?(0,t7.jsx)(pn,{__scopeSelect:t}):null]})})},"Select"),wj=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=wx(n),o=wS("SelectTrigger",n),c=o.disabled||r,s=fL(t,o.onTriggerChange),u=wv(n),l=ne.useRef("touch"),[h,f,d]=pa(e=>{let t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===o.value),r=po(t,e,n);void 0!==r&&o.onValueChange(r.value)}),b=wd(e=>{c||(o.onOpenChange(!0),d()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},"handleOpen");return(0,t7.jsx)(b6,{asChild:!0,...a,children:(0,t7.jsx)(dt.button,{type:"button",role:"combobox","aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":pi(o.value)?"":void 0,...i,ref:s,onClick:fE(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==l.current&&b(e)}),onPointerDown:fE(i.onPointerDown,e=>{l.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(b(e),e.preventDefault())}),onKeyDown:fE(i.onKeyDown,e=>{let t=""!==h.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||f(e.key),(!t||" "!==e.key)&&wb.includes(e.key)&&(b(),e.preventDefault())})})})},"SelectTrigger")),wI=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o="",...c}=e,s=wS("SelectValue",n),{onValueNodeHasChildrenChange:u}=s,l=void 0!==a,h=fL(t,s.onValueNodeChange);dB(()=>{u(l)},[u,l]);let f=pi(s.value);return(0,t7.jsx)(dt.span,{...c,asChild:!f&&c.asChild,ref:h,style:{pointerEvents:"none"},children:(0,t7.jsx)(ne.Fragment,{children:f?o:a},f?"placeholder":"value")})},"SelectValue")),wA=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,t7.jsx)(dt.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})},"SelectIcon")),[wO,wN]=wy("SelectPortal",{forceMount:void 0}),wL=wd(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,t7.jsx)(wO,{scope:e.__scopeSelect,forceMount:n,children:(0,t7.jsx)(gc,{asChild:!0,...r})})},"SelectPortal"),wD="SelectContent",wR=ne.forwardRef(wd(function(e,t){let n=wN(wD,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=wS(wD,e.__scopeSelect),[o,c]=ne.useState();return dB(()=>{c(new DocumentFragment)},[]),(0,t7.jsx)(gh,{present:r||a.open,children:({present:e})=>e?(0,t7.jsx)(wK,{...i,ref:t}):(0,t7.jsx)(w_,{...i,fragment:o})})},"SelectContent")),w_=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?fv.createPortal((0,t7.jsx)(wB,{scope:n,children:(0,t7.jsx)(wp.Slot,{scope:n,children:(0,t7.jsx)("div",{ref:t,children:r})})}),i):null},"SelectContentFragment")),[wB,wF]=wy(wD),w$=f_("SelectContent.RemoveScroll"),wK=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n}=e,{position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:c,sideOffset:s,align:u,alignOffset:l,arrowPadding:h,collisionBoundary:f,collisionPadding:d,sticky:b,hideWhenDetached:g,avoidCollisions:w,...p}=e,v=wS(wD,n),[y,k]=ne.useState(null),[x,E]=ne.useState(null),S=fL(t,k),[T,C]=ne.useState(null),[M,P]=ne.useState(null),j=wv(n),[I,A]=ne.useState(!1),O=ne.useRef(!1);ne.useEffect(()=>{if(y)return gR(y)},[y]),dm();let N=ne.useCallback(e=>{let[t,...n]=j().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:"nearest"}),n===t&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[j,x]),L=ne.useCallback(()=>N([T,y]),[N,T,y]);ne.useEffect(()=>{I&&L()},[I,L]);let{onOpenChange:D,triggerPointerDownPosRef:R}=v;ne.useEffect(()=>{if(y){let e={x:0,y:0},t=wd(t=>{e={x:Math.abs(Math.round(t.pageX)-(R.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(R.current?.y??0))}},"handlePointerMove"),n=wd(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(y)||D(!1),document.removeEventListener("pointermove",t),R.current=null},"handlePointerUp");return null!==R.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[y,D,R]),ne.useEffect(()=>{let e=wd(()=>D(!1),"close");return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[D]);let[_,B]=pa(e=>{let t=j().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=po(t,e,n);r&&setTimeout(()=>r.ref.current?.focus())}),F=ne.useCallback((e,t,n)=>{let r=!O.current&&!n;(void 0!==v.value&&v.value===t||r)&&(C(e),r&&(O.current=!0))},[v.value]),$=ne.useCallback(()=>y?.focus(),[y]),K=ne.useCallback((e,t,n)=>{let r=!O.current&&!n;(void 0!==v.value&&v.value===t||r)&&P(e)},[v.value]),H="popper"===r?wz:wH;return(0,t7.jsx)(wB,{scope:n,content:y,viewport:x,onViewportChange:E,itemRefCallback:F,selectedItem:T,onItemLeave:$,itemTextRefCallback:K,focusSelectedItem:L,selectedItemText:M,position:r,isPositioned:I,searchRef:_,children:(0,t7.jsx)(wh,{as:w$,allowPinchZoom:!0,children:(0,t7.jsx)(dC,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:fE(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,t7.jsx)(du,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,t7.jsx)(H,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:e=>e.preventDefault(),...p,...H===wz?{side:c,sideOffset:s,align:u,alignOffset:l,arrowPadding:h,collisionBoundary:f,collisionPadding:d,sticky:b,hideWhenDetached:g,avoidCollisions:w}:{},onPlaced:()=>A(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...p.style},onKeyDown:fE(p.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||B(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=j().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>N(t)),e.preventDefault()}})})})})})})},"SelectContentImpl")),wH=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=wS(wD,n),o=wF(wD,n),[c,s]=ne.useState(null),[u,l]=ne.useState(null),h=fL(t,l),f=wv(n),d=ne.useRef(!1),b=ne.useRef(!0),{viewport:g,selectedItem:w,selectedItemText:p,focusSelectedItem:v}=o,y=ne.useCallback(()=>{if(a.trigger&&a.valueNode&&c&&u&&g&&w&&p){let e=a.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=p.getBoundingClientRect();if("rtl"!==a.dir){let r=i.left-t.left,a=n.left-r,o=e.left-a,s=e.width+o,u=Math.max(s,t.width),l=fm(a,[10,Math.max(10,window.innerWidth-10-u)]);c.style.minWidth=s+"px",c.style.left=l+"px"}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,s=e.width+o,u=Math.max(s,t.width),l=fm(a,[10,Math.max(10,window.innerWidth-10-u)]);c.style.minWidth=s+"px",c.style.right=l+"px"}let o=f(),s=window.innerHeight-20,l=g.scrollHeight,h=window.getComputedStyle(u),b=parseInt(h.borderTopWidth,10),v=parseInt(h.paddingTop,10),y=parseInt(h.borderBottomWidth,10),k=b+v+l+parseInt(h.paddingBottom,10)+y,x=Math.min(5*w.offsetHeight,k),E=window.getComputedStyle(g),S=parseInt(E.paddingTop,10),T=parseInt(E.paddingBottom,10),C=e.top+e.height/2-10,M=w.offsetHeight/2,P=b+v+(w.offsetTop+M);if(P<=C){let e=o.length>0&&w===o[o.length-1].ref.current;c.style.bottom="0px";let t=Math.max(s-C,M+(e?T:0)+(u.clientHeight-g.offsetTop-g.offsetHeight)+y);c.style.height=P+t+"px"}else{let e=o.length>0&&w===o[0].ref.current;c.style.top="0px";let t=Math.max(C,b+g.offsetTop+(e?S:0)+M);c.style.height=t+(k-P)+"px",g.scrollTop=P-C+g.offsetTop}c.style.margin="10px 0",c.style.minHeight=x+"px",c.style.maxHeight=s+"px",r?.(),requestAnimationFrame(()=>d.current=!0)}},[f,a.trigger,a.valueNode,c,u,g,w,p,a.dir,r]);dB(()=>y(),[y]);let[k,x]=ne.useState();dB(()=>{u&&x(window.getComputedStyle(u).zIndex)},[u]);let E=ne.useCallback(e=>{e&&!0===b.current&&(y(),v?.(),b.current=!1)},[y,v]);return(0,t7.jsx)(wV,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:d,onScrollButtonChange:E,children:(0,t7.jsx)("div",{ref:s,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:(0,t7.jsx)(dt.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})},"SelectItemAlignedPosition")),wz=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,align:r="start",collisionPadding:i=10,...a}=e,o=wx(n);return(0,t7.jsx)(ge,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[wV,wU]=wy(wD,{}),wq="SelectViewport",wG=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=wF(wq,n),o=wU(wq,n),c=fL(t,a.onViewportChange),s=ne.useRef(0);return(0,t7.jsxs)(t7.Fragment,{children:[(0,t7.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),(0,t7.jsx)(wp.Slot,{scope:n,children:(0,t7.jsx)(dt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:fE(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(s.current-t.scrollTop);if(e>0){let r=window.innerHeight-20,i=Math.max(parseFloat(n.style.minHeight),parseFloat(n.style.height));if(i<r){let a=i+e,o=Math.min(r,a),c=a-o;n.style.height=o+"px","0px"===n.style.bottom&&(t.scrollTop=c>0?c:0,n.style.justifyContent="flex-end")}}}s.current=t.scrollTop})})})]})},"SelectViewport")),[wX,wW]=wy("SelectGroup"),wY=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,...r}=e,i=dH();return(0,t7.jsx)(wX,{scope:n,id:i,children:(0,t7.jsx)(dt.div,{role:"group","aria-labelledby":i,...r,ref:t})})},"SelectGroup")),wQ=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,...r}=e,i=wW("SelectLabel",n);return(0,t7.jsx)(dt.div,{id:i.id,...r,ref:t})},"SelectLabel")),wJ="SelectItem",[wZ,w1]=wy(wJ),w0=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,c=wS(wJ,n),s=wF(wJ,n),u=c.value===r,[l,h]=ne.useState(a??""),[f,d]=ne.useState(!1),b=fL(t,dr(e=>s.itemRefCallback?.(e,r,i))),g=dH(),w=ne.useRef("touch"),p=wd(()=>{i||(c.onValueChange(r),c.onOpenChange(!1))},"handleSelect");return(0,t7.jsx)(wZ,{scope:n,value:r,disabled:i,textId:g,isSelected:u,onItemTextChange:ne.useCallback(e=>{h(t=>t||(e?.textContent??"").trim())},[]),children:(0,t7.jsx)(wp.ItemSlot,{scope:n,value:r,disabled:i,textValue:l,children:(0,t7.jsx)(dt.div,{role:"option","aria-labelledby":g,"data-highlighted":f?"":void 0,"aria-selected":u&&f,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:b,onFocus:fE(o.onFocus,()=>d(!0)),onBlur:fE(o.onBlur,()=>d(!1)),onClick:fE(o.onClick,()=>{"mouse"!==w.current&&p()}),onPointerUp:fE(o.onPointerUp,()=>{"mouse"===w.current&&p()}),onPointerDown:fE(o.onPointerDown,e=>{w.current=e.pointerType}),onPointerMove:fE(o.onPointerMove,e=>{w.current=e.pointerType,i?s.onItemLeave?.():"mouse"===w.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:fE(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&s.onItemLeave?.()}),onKeyDown:fE(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(s.searchRef?.current===""||" "!==e.key)&&(wg.includes(e.key)&&p()," "===e.key&&e.preventDefault())})})})})},"SelectItem")),w2="SelectItemText",w3=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=wS(w2,n),c=wF(w2,n),s=w1(w2,n),u=wC(w2,n),[l,h]=ne.useState(null),f=dr(e=>c.itemTextRefCallback?.(e,s.value,s.disabled)),d=fL(t,h,s.onItemTextChange,f),b=l?.textContent,g=ne.useMemo(()=>(0,t7.jsx)("option",{value:s.value,disabled:s.disabled,children:b},s.value),[s.disabled,s.value,b]),{onNativeOptionAdd:w,onNativeOptionRemove:p}=u;return dB(()=>(w(g),()=>p(g)),[w,p,g]),(0,t7.jsxs)(t7.Fragment,{children:[(0,t7.jsx)(dt.span,{id:s.textId,...a,ref:d}),s.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!pi(o.value)?fv.createPortal(a.children,o.valueNode):null]})},"SelectItemText")),w4=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,...r}=e;return w1("SelectItemIndicator",n).isSelected?(0,t7.jsx)(dt.span,{"aria-hidden":!0,...r,ref:t}):null},"SelectItemIndicator")),w5="SelectScrollUpButton",w6=ne.forwardRef(wd(function(e,t){let n=wF(w5,e.__scopeSelect),r=wU(w5,e.__scopeSelect),[i,a]=ne.useState(!1),o=fL(t,r.onScrollButtonChange);return dB(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)};wd(e,"handleScroll");let t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),i?(0,t7.jsx)(w7,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null},"SelectScrollUpButton")),w8="SelectScrollDownButton",w9=ne.forwardRef(wd(function(e,t){let n=wF(w8,e.__scopeSelect),r=wU(w8,e.__scopeSelect),[i,a]=ne.useState(!1),o=fL(t,r.onScrollButtonChange);return dB(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)};wd(e,"handleScroll");let t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),i?(0,t7.jsx)(w7,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null},"SelectScrollDownButton")),w7=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=wF("SelectScrollButton",n),o=ne.useRef(null),c=wv(n),s=ne.useCallback(()=>{null!==o.current&&(window.clearInterval(o.current),o.current=null)},[]);return ne.useEffect(()=>()=>s(),[s]),dB(()=>{let e=c().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[c]),(0,t7.jsx)(dt.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:fE(i.onPointerDown,()=>{null===o.current&&(o.current=window.setInterval(r,50))}),onPointerMove:fE(i.onPointerMove,()=>{a.onItemLeave?.(),null===o.current&&(o.current=window.setInterval(r,50))}),onPointerLeave:fE(i.onPointerLeave,()=>{s()})})},"SelectScrollButtonImpl")),pe=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,...r}=e;return(0,t7.jsx)(dt.div,{"aria-hidden":!0,...r,ref:t})},"SelectSeparator")),pt=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,...r}=e,i=wx(n);return"popper"===wF("SelectArrow",n).position?(0,t7.jsx)(gn,{...i,...r,ref:t}):null},"SelectArrow")),pn=ne.forwardRef(wd(function({__scopeSelect:e,...t},n){let r=wS("SelectBubbleInput",e),{value:i,onValueChange:a,required:o,disabled:c,name:s,autoComplete:u,form:l}=r,{nativeOptions:h,nativeSelectKey:f}=r,d=ne.useRef(null),b=fL(n,d),g=i??"",w=gP(g),p=Array.from(h).some(e=>(e.props.value??"")==="");return ne.useEffect(()=>{let e=d.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(w!==g&&t){let n=new Event("change",{bubbles:!0});t.call(e,g),e.dispatchEvent(n)}},[w,g]),(0,t7.jsxs)(dt.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:s,autoComplete:u,disabled:c,form:l,onChange:e=>a(e.target.value),...t,style:{...gj,...t.style},ref:b,defaultValue:g,children:[pi(i)&&!p?(0,t7.jsx)("option",{value:""}):null,Array.from(h)]},f)},"SelectBubbleInput"));function pr(e){return"function"==typeof e}function pi(e){return""===e||void 0===e}function pa(e){let t=dr(e),n=ne.useRef(""),r=ne.useRef(0),i=ne.useCallback(e=>{t(n.current+e)},[t]),a=ne.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return ne.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function po(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=pc(e,Math.max(i,0));1===r.length&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o!==n?o:void 0}function pc(e,t){return e.map((n,r)=>e[(t+r)%e.length])}wd(pr,"isFunction"),wd(pi,"shouldShowPlaceholder"),wd(pa,"useTypeaheadSearch"),wd(po,"findNextItem"),wd(pc,"wrapArray"),e.s(["Arrow",0,pt,"Content",0,wR,"Group",0,wY,"Icon",0,wA,"Item",0,w0,"ItemIndicator",0,w4,"ItemText",0,w3,"Label",0,wQ,"Portal",0,wL,"Root",0,wP,"ScrollDownButton",0,w9,"ScrollUpButton",0,w6,"Select",0,wP,"SelectArrow",0,pt,"SelectContent",0,wR,"SelectGroup",0,wY,"SelectIcon",0,wA,"SelectItem",0,w0,"SelectItemIndicator",0,w4,"SelectItemText",0,w3,"SelectLabel",0,wQ,"SelectPortal",0,wL,"SelectScrollDownButton",0,w9,"SelectScrollUpButton",0,w6,"SelectSeparator",0,pe,"SelectTrigger",0,wj,"SelectValue",0,wI,"SelectViewport",0,wG,"Separator",0,pe,"Trigger",0,wj,"Value",0,wI,"Viewport",0,wG,"createSelectScope",0,wk,"unstable_BubbleInput",0,pn,"unstable_Provider",0,wM,"unstable_SelectBubbleInput",0,pn,"unstable_SelectProvider",0,wM],29402);var ps=e.i(29402),ps=ps,pu=Object.defineProperty,pl=(e,t)=>pu(e,"name",{value:t,configurable:!0}),ph=["PageUp","PageDown"],pf=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],pd={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},pb="Slider",[pg,pw,pp]=fQ(pb),[pv,pm]=fP(pb,[pp]),[py,pk]=pv(pb),px=ne.forwardRef(pl(function(e,t){let{name:n,min:r=0,max:i=100,step:a=1,orientation:o="horizontal",disabled:c=!1,minStepsBetweenThumbs:s=0,defaultValue:u=[r],value:l,onValueChange:h=pl(()=>{},"onValueChange"),onValueCommit:f=pl(()=>{},"onValueCommit"),inverted:d=!1,form:b,...g}=e,w=ne.useRef(new Set),p=ne.useRef(0),v=ne.useRef(!1),y="horizontal"===o,[k,x]=ne.useState(null),E=fL(t,x),[S=[],T]=gS({prop:l,defaultProp:u,onChange:pl(e=>{let t=[...w.current];t[p.current]?.focus({preventScroll:!0,focusVisible:v.current}),v.current=!1,h(e)},"onChange")}),C=ne.useRef(S),M=ne.useRef(S);function P(e){let t=pK(S,e);A(e,t)}function j(e){A(e,p.current)}function I(){String(S)!==String(C.current)&&f(S)}function A(e,t,{commit:n}={commit:!1}){let o=pq(a),c=fm(pG(Math.round((e-r)/a)*a+r,o),[r,i]);T((e=[])=>{let r=pB(e,c,t);if(!pV(r,s*a))return e;{p.current=r.indexOf(c);let t=String(r)!==String(e);return t&&n&&f(r),t?r:e}})}return ne.useEffect(()=>{let e=b?k?.ownerDocument.getElementById(b):k?.closest("form");if(e instanceof HTMLFormElement){let t=pl(()=>T(M.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[k,b,T]),pl(P,"handleSlideStart"),pl(j,"handleSlideMove"),pl(I,"handleSlideEnd"),pl(A,"updateValues"),(0,t7.jsx)(py,{scope:e.__scopeSlider,name:n,disabled:c,min:r,max:i,valueIndexToChangeRef:p,thumbs:w.current,values:S,orientation:o,form:b,children:(0,t7.jsx)(pg.Provider,{scope:e.__scopeSlider,children:(0,t7.jsx)(pg.Slot,{scope:e.__scopeSlider,children:(0,t7.jsx)(y?pT:pC,{"aria-disabled":c,"data-disabled":c?"":void 0,...g,ref:E,onPointerDown:fE(g.onPointerDown,()=>{c||(C.current=S,v.current=!1)}),min:r,max:i,inverted:d,onSlideStart:c?void 0:P,onSlideMove:c?void 0:j,onSlideEnd:c?void 0:I,onHomeKeyDown:()=>{c||(v.current=!0,A(r,0,{commit:!0}))},onEndKeyDown:()=>{c||(v.current=!0,A(i,S.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!c){v.current=!0;let n=ph.includes(e.key)||e.shiftKey&&pf.includes(e.key),i=p.current;A(pX(S[i],{min:r,step:a,direction:t,multiplier:n?10:1}),i,{commit:!0})}}})})})})},"Slider")),[pE,pS]=pv(pb,{startEdge:"left",endEdge:"right",size:"width",direction:1}),pT=ne.forwardRef(pl(function(e,t){let{min:n,max:r,dir:i,inverted:a,onSlideStart:o,onSlideMove:c,onSlideEnd:s,onStepKeyDown:u,...l}=e,[h,f]=ne.useState(null),d=fL(t,f),b=ne.useRef(void 0),g=f7(i),w="ltr"===g,p=w&&!a||!w&&a;function v(e){let t=b.current||h.getBoundingClientRect(),i=pU([0,t.width],p?[n,r]:[r,n]);return b.current=t,i(e-t.left)}return pl(v,"getValueFromPointer"),(0,t7.jsx)(pE,{scope:e.__scopeSlider,startEdge:p?"left":"right",endEdge:p?"right":"left",direction:p?1:-1,size:"width",children:(0,t7.jsx)(pM,{dir:g,"data-orientation":"horizontal",...l,ref:d,style:{...l.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{let t=v(e.clientX);o?.(t)},onSlideMove:e=>{let t=v(e.clientX);c?.(t)},onSlideEnd:()=>{b.current=void 0,s?.()},onStepKeyDown:e=>{let t=pd[p?"from-left":"from-right"].includes(e.key);u?.({event:e,direction:t?-1:1})}})})},"SliderHorizontal")),pC=ne.forwardRef(pl(function(e,t){let{min:n,max:r,inverted:i,onSlideStart:a,onSlideMove:o,onSlideEnd:c,onStepKeyDown:s,...u}=e,l=ne.useRef(null),h=fL(t,l),f=ne.useRef(void 0),d=!i;function b(e){let t=f.current||l.current.getBoundingClientRect(),i=pU([0,t.height],d?[r,n]:[n,r]);return f.current=t,i(e-t.top)}return pl(b,"getValueFromPointer"),(0,t7.jsx)(pE,{scope:e.__scopeSlider,startEdge:d?"bottom":"top",endEdge:d?"top":"bottom",size:"height",direction:d?1:-1,children:(0,t7.jsx)(pM,{"data-orientation":"vertical",...u,ref:h,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{let t=b(e.clientY);a?.(t)},onSlideMove:e=>{let t=b(e.clientY);o?.(t)},onSlideEnd:()=>{f.current=void 0,c?.()},onStepKeyDown:e=>{let t=pd[d?"from-bottom":"from-top"].includes(e.key);s?.({event:e,direction:t?-1:1})}})})},"SliderVertical")),pM=ne.forwardRef(pl(function(e,t){let{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:c,onStepKeyDown:s,...u}=e,l=pk(pb,n);return(0,t7.jsx)(dt.span,{...u,ref:t,onKeyDown:fE(e.onKeyDown,e=>{"Home"===e.key?(o(e),e.preventDefault()):"End"===e.key?(c(e),e.preventDefault()):ph.concat(pf).includes(e.key)&&(s(e),e.preventDefault())}),onPointerDown:fE(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),l.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):r(e)}),onPointerMove:fE(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:fE(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})},"SliderImpl")),pP=ne.forwardRef(pl(function(e,t){let{__scopeSlider:n,...r}=e,i=pk("SliderTrack",n);return(0,t7.jsx)(dt.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:t})},"SliderTrack")),pj="SliderRange",pI=ne.forwardRef(pl(function(e,t){let{__scopeSlider:n,...r}=e,i=pk(pj,n),a=pS(pj,n),o=fL(t,ne.useRef(null)),c=i.values.length,s=i.values.map(e=>pF(e,i.min,i.max)),u=c>1?Math.min(...s):0,l=100-Math.max(...s);return(0,t7.jsx)(dt.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:o,style:{...e.style,[a.startEdge]:u+"%",[a.endEdge]:l+"%"}})},"SliderRange")),[pA,pO]=pv("SliderThumb");function pN(e){let{__scopeSlider:t,name:n,children:r,internal_do_not_use_render:i}=e,a=pk("SliderThumbProvider",t),o=pw(t),[c,s]=ne.useState(null),u=ne.useMemo(()=>c?o().findIndex(e=>e.ref.current===c):-1,[o,c]),l=bQ(c),h=!c||!!a.form||!!c.closest("form"),f=a.values[u],d=n??(a.name?a.name+(a.values.length>1?"[]":""):void 0),b=void 0===f?0:pF(f,a.min,a.max);ne.useEffect(()=>{if(c)return a.thumbs.add(c),()=>{a.thumbs.delete(c)}},[c,a.thumbs]);let g={value:f,name:d,form:a.form,isFormControl:h,index:u,thumb:c,onThumbChange:s,percent:b,size:l};return(0,t7.jsx)(pA,{scope:t,...g,children:pW(i)?i(g):r})}pl(pN,"SliderThumbProvider");var pL="SliderThumbTrigger",pD=ne.forwardRef(pl(function(e,t){let{__scopeSlider:n,...r}=e,i=pk(pL,n),a=pS(pL,n),{index:o,value:c,percent:s,size:u,onThumbChange:l}=pO(pL,n),h=fL(t,l),f=p$(o,i.values.length),d=u?.[a.size],b=d?pH(d,s,a.direction):0;return(0,t7.jsx)("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${s}% + ${b}px)`},children:(0,t7.jsx)(pg.ItemSlot,{scope:n,children:(0,t7.jsx)(dt.span,{role:"slider","aria-label":e["aria-label"]||f,"aria-valuemin":i.min,"aria-valuenow":c,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...r,ref:h,style:void 0===c?{display:"none"}:e.style,onFocus:fE(e.onFocus,()=>{i.valueIndexToChangeRef.current=o})})})})},"SliderThumbTrigger")),pR=ne.forwardRef(pl(function(e,t){let{__scopeSlider:n,name:r,...i}=e;return(0,t7.jsx)(pN,{__scopeSlider:n,name:r,internal_do_not_use_render:({index:e,isFormControl:r})=>(0,t7.jsxs)(t7.Fragment,{children:[(0,t7.jsx)(pD,{...i,ref:t,__scopeSlider:n}),r?(0,t7.jsx)(p_,{__scopeSlider:n},e):null]})})},"SliderThumb")),p_=ne.forwardRef(pl(function({__scopeSlider:e,...t},n){let{value:r,name:i,form:a}=pO("SliderBubbleInput",e),o=ne.useRef(null),c=fL(o,n),s=gP(r);return ne.useEffect(()=>{let e=o.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value").set;if(s!==r&&t){let n=new Event("input",{bubbles:!0});t.call(e,r),e.dispatchEvent(n)}},[s,r]),(0,t7.jsx)(dt.input,{style:{display:"none"},name:i,form:a,...t,ref:c,defaultValue:r})},"SliderBubbleInput"));function pB(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}function pF(e,t,n){return fm(100/(n-t)*(e-t),[0,100])}function p$(e,t){return t>2?`Value ${e+1} of ${t}`:2===t?["Minimum","Maximum"][e]:void 0}function pK(e,t){if(1===e.length)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}function pH(e,t,n){let r=e/2,i=pU([0,50],[0,r]);return(r-i(t)*n)*n}function pz(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function pV(e,t){return!(t>0)||Math.min(...pz(e))>=t}function pU(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function pq(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes("e")){let[e,n]=t.split("e"),r=e.split(".")[1]||"",i=Number(n);return Math.max(0,r.length-i)}let n=t.split(".")[1];return n?n.length:0}function pG(e,t){let n=Math.pow(10,t);return Math.round(e*n)/n}function pX(e,{min:t,step:n,direction:r,multiplier:i}){let a,o=pq(n),c=(e-t)/n,s=Math.round(c);return a=pG(s*n+t,o)===pG(e,o)?s+i*r:r>0?Math.ceil(c):Math.floor(c),pG(a*n+t,o)}function pW(e){return"function"==typeof e}pl(pB,"getNextSortedValues"),pl(pF,"convertValueToPercentage"),pl(p$,"getLabel"),pl(pK,"getClosestValueIndex"),pl(pH,"getThumbInBoundsOffset"),pl(pz,"getStepsBetweenValues"),pl(pV,"hasMinStepsBetweenValues"),pl(pU,"linearScale"),pl(pq,"getDecimalCount"),pl(pG,"roundValue"),pl(pX,"getNextStepValue"),pl(pW,"isFunction"),e.s(["Range",0,pI,"Root",0,px,"Slider",0,px,"SliderRange",0,pI,"SliderThumb",0,pR,"SliderTrack",0,pP,"Thumb",0,pR,"Track",0,pP,"createSliderScope",0,pm,"unstable_BubbleInput",0,p_,"unstable_SliderBubbleInput",0,p_,"unstable_SliderThumbProvider",0,pN,"unstable_SliderThumbTrigger",0,pD,"unstable_ThumbProvider",0,pN,"unstable_ThumbTrigger",0,pD],44729);var pY=e.i(44729),pY=pY;function pQ({children:e,title:t}){return(0,t7.jsxs)("section",{children:[(0,t7.jsx)("h3",{className:"mx-6 mt-6 mb-2 text-sm font-bold",children:t}),e]})}var pJ=Object.defineProperty,pZ=(e,t)=>pJ(e,"name",{value:t,configurable:!0}),p1="Switch",[p0,p2]=fP(p1),[p3,p4]=p0(p1);function p5(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:c,onCheckedChange:s,required:u,value:l="on",internal_do_not_use_render:h}=e,[f,d]=gS({prop:n,defaultProp:i??!1,onChange:s,caller:p1}),[b,g]=ne.useState(null),[w,p]=ne.useState(null),v=ne.useRef(!1),[y,k]=ne.useReducer(e=>e+1,0),x=!b||!!o||!!b.closest("form"),E={checked:f,setChecked:d,disabled:a,control:b,setControl:g,name:c,form:o,value:l,hasConsumerStoppedPropagationRef:v,userInteractionCount:y,onUserInteraction:k,required:u,defaultChecked:i,isFormControl:x,bubbleInput:w,setBubbleInput:p};return(0,t7.jsx)(p3,{scope:t,...E,children:ve(h)?h(E):r})}pZ(p5,"SwitchProvider");var p6=ne.forwardRef(pZ(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,form:a,value:o,disabled:c,checked:s,required:u,setControl:l,setChecked:h,hasConsumerStoppedPropagationRef:f,onUserInteraction:d,isFormControl:b,bubbleInput:g}=p4("SwitchTrigger",e),w=fL(r,l),p=ne.useRef(s);return ne.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=pZ(()=>h(p.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[i,a,h]),(0,t7.jsx)(dt.button,{type:"button",role:"switch","aria-checked":s,"aria-required":u,"data-state":vt(s),"data-disabled":c?"":void 0,disabled:c,value:o,...n,ref:w,onClick:fE(t,e=>{d(),h(e=>!e),g&&b&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},"SwitchTrigger")),p8=ne.forwardRef(pZ(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:c,value:s,onCheckedChange:u,form:l,...h}=e;return(0,t7.jsx)(p5,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:c,required:o,onCheckedChange:u,name:r,form:l,value:s,internal_do_not_use_render:({isFormControl:e})=>(0,t7.jsxs)(t7.Fragment,{children:[(0,t7.jsx)(p6,{...h,ref:t,__scopeSwitch:n}),e&&(0,t7.jsx)(p7,{__scopeSwitch:n})]})})},"Switch")),p9=ne.forwardRef(pZ(function(e,t){let{__scopeSwitch:n,...r}=e,i=p4("SwitchThumb",n);return(0,t7.jsx)(dt.span,{"data-state":vt(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})},"SwitchThumb")),p7=ne.forwardRef(pZ(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:c,defaultChecked:s,required:u,disabled:l,name:h,value:f,form:d,bubbleInput:b,setBubbleInput:g}=p4("SwitchBubbleInput",e),w=fL(r,g),p=bQ(i),v=ne.useRef(!1),y=ne.useRef(c),k=ne.useRef(o);ne.useEffect(()=>{if(!b)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=o!==k.current;k.current=o;let n=y.current!==c;y.current=c;let r=!(t&&a.current);if(n&&e){v.current=!t;let n=new Event("click",{bubbles:r});e.call(b,c),b.dispatchEvent(n),v.current=!1}},[b,c,a,o]);let x=ne.useRef(c);return(0,t7.jsx)(dt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??x.current,required:u,disabled:l,name:h,value:f,form:d,...n,tabIndex:-1,ref:w,onClick:fE(t,e=>{v.current&&e.stopPropagation()}),style:{...n.style,...p,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function ve(e){return"function"==typeof e}function vt(e){return e?"checked":"unchecked"}pZ(ve,"isFunction"),pZ(vt,"getState"),e.s(["Root",0,p8,"Switch",0,p8,"SwitchThumb",0,p9,"Thumb",0,p9,"createSwitchScope",0,p2,"unstable_BubbleInput",0,p7,"unstable_Provider",0,p5,"unstable_SwitchBubbleInput",0,p7,"unstable_SwitchProvider",0,p5,"unstable_SwitchTrigger",0,p6,"unstable_Trigger",0,p6],57287);var vn=e.i(57287),vn=vn;function vr({ariaLabel:e,checkedColor:t,id:n,onToggle:r,value:i}){return(0,t7.jsxs)(vn.Root,{"aria-label":e,className:"relative h-[18px] w-[42px] shrink-0 cursor-pointer rounded-full bg-neutral-200 outline-none data-[state=checked]:bg-neutral-200 dark:bg-neutral-800 dark:data-[state=checked]:bg-gray-700",id:n,checked:i,onCheckedChange:r,children:[i&&t?(0,t7.jsx)("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-full opacity-25",style:{backgroundColor:t}}):null,(0,t7.jsx)(vn.Thumb,{className:"relative block size-[16px] translate-x-0.5 rounded-full bg-neutral-500 transition-transform duration-100 will-change-transform data-[state=checked]:translate-x-[24px] data-[state=checked]:bg-blue-500 dark:bg-neutral-500 dark:data-[state=checked]:bg-white",style:i&&t?{backgroundColor:t}:void 0})]})}function vi({id:e,label:t,value:n,onToggle:r}){return(0,t7.jsxs)("div",{className:"flex h-[20px] items-center justify-between",children:[(0,t7.jsx)("label",{className:"pr-[15px] leading-none whitespace-nowrap text-foreground",htmlFor:e,children:t}),(0,t7.jsx)(vr,{ariaLabel:t,id:e,onToggle:r,value:n})]})}function va(){return(0,t7.jsxs)(t7.Fragment,{children:[(0,t7.jsx)(vo,{}),(0,t7.jsx)(vc,{}),(0,t7.jsx)(vs,{}),(0,t7.jsx)(vu,{})]})}function vo(){let{showCompoundNodes:e,showVendorPackages:t,toggleShowCompoundNodes:n,toggleShowVendorPackages:r}=nP();return(0,t7.jsxs)(pQ,{title:nd("settings.filter"),children:[(0,t7.jsx)(fb,{children:(0,t7.jsx)(vi,{id:"switch-show-vendor-packages",label:nd("settings.showVendorPackages"),onToggle:r,value:t})}),(0,t7.jsx)(fb,{children:(0,t7.jsx)(vi,{id:"switch-show-compound-nodes",label:nd("settings.showCompoundNodes"),onToggle:n,value:e})})]})}function vc(){let{maxSubPackageDepth:e,setSubPackageDepth:t,subPackageDepth:n}=nP();return(0,t7.jsx)(pQ,{title:nd("settings.subPackageDepth")+": "+n,children:(0,t7.jsx)(fb,{children:(0,t7.jsx)(vl,{ariaLabel:nd("settings.subPackageDepth"),max:e,min:1,step:1,value:n,onValueChange:t})})})}function vs(){let{cytoscapeLayout:e,setCytoscapeLayout:t}=nP();return(0,t7.jsx)(pQ,{title:nd("settings.layout"),children:(0,t7.jsx)(fb,{children:(0,t7.jsxs)(ps.Root,{value:e,onValueChange:e=>{("breadthfirst"===e||"circle"===e||"concentric"===e||"elk"===e||"grid"===e)&&ne.default.startTransition(()=>t(e))},children:[(0,t7.jsxs)(ps.Trigger,{"aria-label":nd("cytoscapeLayout"),className:"inline-flex h-9 w-full items-center justify-between rounded-md border px-3",children:[(0,t7.jsx)(ps.Value,{className:"text-foreground"}),(0,t7.jsx)(ps.Icon,{children:(0,t7.jsx)(fp,{size:16})})]}),(0,t7.jsx)(ps.Portal,{children:(0,t7.jsx)(ps.Content,{position:"popper",side:"bottom",align:"start",sideOffset:6,className:"z-50 min-w-(--radix-select-trigger-width) rounded-md border bg-white shadow-md dark:bg-neutral-900",children:(0,t7.jsx)(ps.Viewport,{className:"p-1",children:(0,t7.jsx)(ps.Group,{children:["breadthfirst","circle","concentric","elk","grid"].map(e=>(0,t7.jsx)(ps.Item,{value:e,textValue:nd(e),className:"rounded px-2 py-1.5 hover:bg-neutral-100 dark:hover:bg-neutral-800",children:(0,t7.jsx)(ps.ItemText,{children:nd(e)})},e))})})})})]})})})}function vu(){let{cytoscapeLayoutSpacing:e,setCytoscapeLayoutSpacing:t}=nP();return(0,t7.jsx)(pQ,{title:nd("settings.layoutSpacing")+": "+e.toFixed(2),children:(0,t7.jsx)(fb,{children:(0,t7.jsx)(vl,{ariaLabel:nd("settings.layoutSpacing"),max:1,min:.1,step:.01,value:e,onValueChange:t})})})}function vl({ariaLabel:e,max:t,min:n,onValueChange:r,step:i,value:a}){return(0,t7.jsxs)(pY.Root,{min:n,max:t,step:i,value:[a],onValueChange:([e])=>r(e),"aria-label":e,className:"relative flex h-5 w-full touch-none select-none items-center",children:[(0,t7.jsx)(pY.Track,{className:"relative h-1.5 grow rounded-full bg-neutral-200 dark:bg-neutral-800",children:(0,t7.jsx)(pY.Range,{className:"absolute h-1.5 rounded-full bg-blue-600 dark:bg-blue-400"})}),(0,t7.jsx)(pY.Thumb,{className:"block h-4 w-4 rounded-full border border-neutral-300 bg-white shadow focus:outline-none focus:ring-2 focus:ring-blue-500 dark:border-neutral-600 dark:bg-neutral-100"})]})}function vh({children:e}){return(0,t7.jsx)("aside",{className:"flex min-h-0 w-[18rem] min-w-[18rem] max-w-[18rem] shrink-0 self-stretch flex-col overflow-hidden border-r border-r-neutral-200 bg-neutral-100 md:pt-14 dark:border-r-neutral-800 dark:bg-neutral-950",children:e})}var vf=Object.defineProperty,vd=(e,t)=>vf(e,"name",{value:t,configurable:!0}),vb=!1;function vg(){let[e,t]=ne.useState(vb);return ne.useEffect(()=>{vb||(vb=!0,t(!0))},[]),e}vd(vg,"useIsHydrated");var vw=ne[" useSyncExternalStore ".trim().toString()];function vp(){return()=>{}}function vv(){return vw(vp,()=>!0,()=>!1)}vd(vp,"subscribe"),vd(vv,"useIsHydratedModern");var vm="function"==typeof vw?vv:vg,vy=Object.defineProperty,vk=(e,t)=>vy(e,"name",{value:t,configurable:!0}),vx="rovingFocusGroup.onEntryFocus",vE={bubbles:!1,cancelable:!0},vS="RovingFocusGroup",[vT,vC,vM]=fQ(vS),[vP,vj]=fP(vS,[vM]),[vI,vA]=vP(vS),vO=ne.forwardRef(vk(function(e,t){return(0,t7.jsx)(vT.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,t7.jsx)(vT.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,t7.jsx)(vN,{...e,ref:t})})})},"RovingFocusGroup")),vN=ne.forwardRef(vk(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:s,onEntryFocus:u,preventScrollOnEntryFocus:l=!1,...h}=e,f=ne.useRef(null),d=fL(t,f),b=f7(a),[g,w]=gS({prop:o,defaultProp:c??null,onChange:s,caller:vS}),[p,v]=ne.useState(!1),y=dr(u),k=vC(n),x=ne.useRef(!1),[E,S]=ne.useState(0);return ne.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(vx,y),()=>e.removeEventListener(vx,y)},[y]),(0,t7.jsx)(vI,{scope:n,orientation:r,dir:b,loop:i,currentTabStopId:g,onItemFocus:ne.useCallback(e=>w(e),[w]),onItemShiftTab:ne.useCallback(()=>v(!0),[]),onFocusableItemAdd:ne.useCallback(()=>S(e=>e+1),[]),onFocusableItemRemove:ne.useCallback(()=>S(e=>e-1),[]),children:(0,t7.jsx)(dt.div,{tabIndex:p||0===E?-1:0,"data-orientation":r,...h,ref:d,style:{outline:"none",...e.style},onMouseDown:fE(e.onMouseDown,()=>{x.current=!0}),onFocus:fE(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!p){let t=new CustomEvent(vx,vE);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=k().filter(e=>e.focusable);vB([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),l)}}x.current=!1}),onBlur:fE(e.onBlur,()=>v(!1))})})},"RovingFocusGroupImpl")),vL=ne.forwardRef(vk(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...c}=e,s=dH(),u=a||s,l=vA("RovingFocusGroupItem",n),h=l.currentTabStopId===u,f=vC(n),{onFocusableItemAdd:d,onFocusableItemRemove:b,currentTabStopId:g}=l,w=vm();return dB(()=>{if(w&&r)return d(),()=>b()},[w,r,d,b]),ne.useEffect(()=>{if(!w&&r)return d(),()=>b()},[w,r,d,b]),(0,t7.jsx)(vT.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:(0,t7.jsx)(dt.span,{tabIndex:h?0:-1,"data-orientation":l.orientation,...c,ref:t,onMouseDown:fE(e.onMouseDown,e=>{r?l.onItemFocus(u):e.preventDefault()}),onFocus:fE(e.onFocus,()=>l.onItemFocus(u)),onKeyDown:fE(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void l.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=v_(e,l.orientation,l.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)n.reverse();else if("prev"===t||"next"===t){"prev"===t&&n.reverse();let r=n.indexOf(e.currentTarget);n=l.loop?vF(n,r+1):n.slice(r+1)}setTimeout(()=>vB(n))}}),children:"function"==typeof o?o({isCurrentTabStop:h,hasTabStop:null!=g}):o})})},"RovingFocusGroupItem")),vD={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function vR(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}function v_(e,t,n){let r=vR(e.key,n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(r))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)))return vD[r]}function vB(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function vF(e,t){return e.map((n,r)=>e[(t+r)%e.length])}vk(vR,"getDirectionAwareKey"),vk(v_,"getFocusIntent"),vk(vB,"focusFirst"),vk(vF,"wrapArray");var v$=Object.defineProperty,vK=(e,t)=>v$(e,"name",{value:t,configurable:!0}),vH="Tabs",[vz,vV]=fP(vH,[vj]),vU=vj(),[vq,vG]=vz(vH),vX=ne.forwardRef(vK(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o="horizontal",dir:c,activationMode:s="automatic",...u}=e,l=f7(c),[h,f]=gS({prop:r,onChange:i,defaultProp:a??"",caller:vH});return(0,t7.jsx)(vq,{scope:n,baseId:dH(),value:h,onValueChange:f,orientation:o,dir:l,activationMode:s,children:(0,t7.jsx)(dt.div,{dir:l,"data-orientation":o,...u,ref:t})})},"Tabs")),vW=ne.forwardRef(vK(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=vG("TabsList",n),o=vU(n);return(0,t7.jsx)(vO,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,t7.jsx)(dt.div,{role:"tablist","aria-orientation":a.orientation,...i,ref:t})})},"TabsList")),vY=ne.forwardRef(vK(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=vG("TabsTrigger",n),c=vU(n),s=vJ(o.baseId,r),u=vZ(o.baseId,r),l=r===o.value;return(0,t7.jsx)(vL,{asChild:!0,...c,focusable:!i,active:l,children:(0,t7.jsx)(dt.button,{type:"button",role:"tab","aria-selected":l,"aria-controls":u,"data-state":l?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:s,...a,ref:t,onMouseDown:fE(e.onMouseDown,e=>{i||0!==e.button||!1!==e.ctrlKey?e.preventDefault():o.onValueChange(r)}),onKeyDown:fE(e.onKeyDown,e=>{!i&&e.target===e.currentTarget&&[" ","Enter"].includes(e.key)&&o.onValueChange(r)}),onFocus:fE(e.onFocus,()=>{let e="manual"!==o.activationMode;l||i||!e||o.onValueChange(r)})})})},"TabsTrigger")),vQ=ne.forwardRef(vK(function(e,t){let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,c=vG("TabsContent",n),s=vJ(c.baseId,r),u=vZ(c.baseId,r),l=r===c.value,h=ne.useRef(l);return ne.useEffect(()=>{let e=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,t7.jsx)(gh,{present:i||l,children:({present:n})=>(0,t7.jsx)(dt.div,{"data-state":l?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":s,hidden:!n,id:u,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:n&&a})})},"TabsContent"));function vJ(e,t){return`${e}-trigger-${t}`}function vZ(e,t){return`${e}-content-${t}`}vK(vJ,"makeTriggerId"),vK(vZ,"makeContentId"),e.s(["Content",0,vQ,"List",0,vW,"Root",0,vX,"Tabs",0,vX,"TabsContent",0,vQ,"TabsList",0,vW,"TabsTrigger",0,vY,"Trigger",0,vY,"createTabsScope",0,vV],26209);var v1=e.i(26209),v1=v1;function v0({count:e,tone:t="neutral"}){return(0,t7.jsx)("span",{className:"inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full border px-1 text-[10px] font-semibold leading-none "+("danger"===t?"border-red-300 bg-red-50 text-red-700 dark:border-red-900 dark:bg-red-950 dark:text-red-300":"border-neutral-300 text-neutral-700 dark:border-neutral-700 dark:text-neutral-200"),children:e})}function v2({ariaLabel:e,onValueChange:t,tabs:n,value:r}){return(0,t7.jsxs)(v1.Root,{value:r??"",onValueChange:t,className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[(0,t7.jsx)(v1.List,{"aria-label":e,className:"ml-3 flex shrink-0 border-b border-neutral-200 dark:border-neutral-800",children:n.map(e=>(0,t7.jsxs)(v1.Trigger,{value:e.id,disabled:e.disabled,className:"flex flex-1 items-center justify-center gap-1.5 border-b-2 border-transparent px-3 py-2 text-xs text-neutral-500 disabled:cursor-default disabled:opacity-40 data-[state=active]:border-blue-600 data-[state=active]:text-neutral-900 dark:text-neutral-400 dark:data-[state=active]:border-blue-400 dark:data-[state=active]:text-neutral-100",children:[(0,t7.jsx)("span",{children:e.label}),e.badge?(0,t7.jsx)(v0,{count:e.badge,tone:e.badgeTone}):null]},e.id))}),n.map(e=>(0,t7.jsx)(v1.Content,{value:e.id,className:"min-h-0 flex-1 overflow-y-auto border-b border-neutral-200 pb-3 outline-none dark:border-neutral-800",children:e.content},e.id))]})}function v3({cycles:e,cycleSelection:t,inspectedCycleId:n,onCycleInspectionChange:r}){return(0,t7.jsx)(pQ,{title:(0,t7.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t7.jsx)("span",{children:nd("audit.rule.cyclicDependencies")}),(0,t7.jsxs)("span",{className:"text-xs font-normal text-neutral-500 dark:text-neutral-400",children:[e.length," ",nd("audit.cycles")]})]}),children:e.map((e,i)=>(0,t7.jsx)(fb,{children:(0,t7.jsx)(v4,{color:nA(i),cycle:e,index:i,inspected:n===nO(e),selected:t.selectedIds.includes(nO(e)),onInspect:()=>{var t;return r(n===nO(e)?null:(t=nd("audit.cycle")+" "+(i+1),{...nN(e,i),label:t}))},onSelectedChange:i=>{t.setSelected(nO(e),i),i||n!==nO(e)||r(null)}})},nO(e)))})}function v4({color:e,cycle:t,index:n,inspected:r,onInspect:i,onSelectedChange:a,selected:o}){let c=t.packages.join(" → "),s=new Set(t.packages).size,u=nd("audit.cycle")+" "+(n+1);return(0,t7.jsxs)("div",{className:"flex items-start gap-2 rounded px-1 py-1",style:o||r?{backgroundColor:e+"1a"}:void 0,children:[(0,t7.jsxs)("button",{type:"button",onClick:i,"aria-expanded":r,className:"min-w-0 flex-1 cursor-pointer rounded text-left focus-visible:outline-2 focus-visible:outline-offset-2",style:r?{boxShadow:`inset 3px 0 ${e}`,paddingLeft:6}:void 0,title:c,children:[(0,t7.jsxs)("span",{className:"flex items-center gap-1.5 text-xs font-medium",children:[(0,t7.jsx)("span",{children:u}),(0,t7.jsxs)("span",{className:"ml-auto shrink-0 text-[10px] font-normal text-neutral-500 dark:text-neutral-400",children:[s," pkg"]})]}),(0,t7.jsx)("code",{className:"mt-1 block truncate text-[11px] text-neutral-500 dark:text-neutral-400",children:c})]}),(0,t7.jsx)(vr,{ariaLabel:u,checkedColor:e,id:"switch-audit-cycle-"+n,onToggle:()=>a(!o),value:o})]})}function v5({evaluation:e,cycleSelection:t,inspectedCycleId:n,onCycleInspectionChange:r}){return(0,t7.jsx)(t7.Fragment,{children:e.rules.filter(e=>"failed"===e.status).map(i=>(0,t7.jsx)(v6,{evaluation:e,rule:i,cycleSelection:t,inspectedCycleId:n,onCycleInspectionChange:r},i.id))})}function v6({evaluation:e,cycleSelection:t,inspectedCycleId:n,onCycleInspectionChange:r,rule:i}){return"cyclic-dependencies"===i.id?(0,t7.jsx)(v3,{cycles:e.cyclicPackages,cycleSelection:t,inspectedCycleId:n,onCycleInspectionChange:r}):(0,t7.jsx)(pQ,{title:i.id,children:i.details.map((e,t)=>(0,t7.jsx)(fb,{children:(0,t7.jsx)("code",{className:"block truncate text-[11px]",title:e,children:e})},e+":"+t))})}function v8({evaluation:e,cycleSelection:t,inspectedCycleId:n,onCycleInspectionChange:r}){return(0,t7.jsx)(v5,{evaluation:e,cycleSelection:t,inspectedCycleId:n,onCycleInspectionChange:r})}function v9({expanded:e,hasChildren:t,variant:n}){return"chevron"!==n||t?(0,t7.jsx)("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round",strokeLinecap:"round",children:(0,t7.jsx)("path",{d:"chevron"===n?e?"m5 8 5 5 5-5":"m8 5 5 5-5 5":t?e?"M2 7V4h6l2 2h8v2 M2 8h17l-3 9H2z":"M2 4h6l2 2h8v11H2z":"M5 2h6l4 4v12H5z M11 2v5h4"})}):null}function v7(e){var t,n,r,i;let{node:a}=e,o=void 0!==a.children&&a.children.length>0,c=e.expandedIds.includes(a.id),s=e.selectedId===a.id,u=e.renderItem?.({node:a,depth:e.depth,selected:s,expanded:c,hasChildren:o})??(0,t7.jsx)(me,{node:a,showIcon:"chevron"===e.expansionIndicator});return(0,t7.jsxs)(t7.Fragment,{children:[(0,t7.jsxs)("div",{"aria-disabled":!0===a.disabled||void 0,"aria-expanded":o?c:void 0,"aria-selected":s,onClick:()=>{var t;(t=e).node.disabled||t.onSelect?.(t.node.id)},onKeyDown:t=>{var n,r;return n=t,void((r=e).node.disabled||"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),r.onSelect?.(r.node.id)))},role:"treeitem",tabIndex:a.disabled||void 0===e.onSelect?void 0:0,style:(t=e.depth,n=s,r=a.disabled,i=void 0!==e.onSelect,{...mi,background:n?"color-mix(in srgb, currentColor 10%, transparent)":"transparent",cursor:r?"default":i?"pointer":"inherit",opacity:r?.5:1,paddingLeft:16*t+6}),children:[(0,t7.jsx)(mn,{disabled:a.disabled,expanded:c,indicator:e.expansionIndicator,hasChildren:o,nodeId:a.id,onToggleExpand:e.onToggleExpand}),u,(0,t7.jsx)(mt,{actions:a.actions})]}),o&&c?(0,t7.jsx)(mr,{...e}):null]})}function me({node:e,showIcon:t}){return(0,t7.jsxs)(t7.Fragment,{children:[t&&void 0!==e.icon?(0,t7.jsx)("span",{"aria-hidden":"true",style:mo,children:e.icon}):null,(0,t7.jsx)("span",{style:mc,children:e.label}),void 0===e.meta?null:(0,t7.jsx)("span",{style:ms,children:e.meta})]})}function mt({actions:e}){return void 0===e?null:(0,t7.jsx)("span",{onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),style:ma,children:e})}function mn(e){let t=(0,t7.jsx)(v9,{expanded:e.expanded,hasChildren:e.hasChildren,variant:e.indicator});return e.hasChildren?(0,t7.jsx)("button",{"aria-label":e.expanded?"Collapse":"Expand",disabled:e.disabled,onKeyDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),e.onToggleExpand(e.nodeId)},style:mu,type:"button",children:t}):(0,t7.jsx)("span",{"aria-hidden":"true",style:mu,children:t})}function mr(e){return(0,t7.jsx)("div",{role:"group",children:e.node.children?.map(t=>(0,ne.createElement)(v7,{...e,key:t.id,depth:e.depth+1,node:t}))})}var mi={alignItems:"center",borderRadius:6,display:"flex",gap:6,minHeight:28,paddingRight:4,userSelect:"none"},ma={display:"inline-flex",flexShrink:0},mo=ma,mc={flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},ms={flexShrink:0,opacity:.65},mu={alignItems:"center",appearance:"none",background:"transparent",border:0,color:"inherit",cursor:"pointer",display:"inline-flex",flexShrink:0,font:"inherit",height:24,justifyContent:"center",padding:0,width:24};function ml({nodes:e,selectedId:t,expandedIds:n,defaultExpandedIds:r,onSelect:i,onExpandedChange:a,renderItem:o,expansionIndicator:c="folder",className:s,style:u,ariaLabel:l="Tree"}){let[h,f]=ne.default.useState(r??[]),d=void 0!==n,b=d?n:h,g=ne.default.useCallback(e=>{let t=b.includes(e)?b.filter(t=>t!==e):[...b,e];d||f(t),a?.(t)},[b,d,a]);return(0,t7.jsx)("div",{"aria-label":l,className:s,role:"tree",style:{...mh,...u},children:e.map(e=>(0,t7.jsx)(v7,{depth:0,expandedIds:b,expansionIndicator:c,node:e,onSelect:i,onToggleExpand:g,renderItem:o,selectedId:t},e.id))})}var mh={display:"flex",flexDirection:"column",minWidth:0};let mf=na("file-code-2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]),md=na("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);function mb(e,t){for(let n of e){if(n.id===t)return n;let e=n.children?mb(n.children,t):null;if(e)return e}return null}function mg(e,t,n){if(null===t)return n;let r=mb(e,t);return[...new Set([...n,...function e(t,n,r){for(let i of t){if(i.id===n)return r;if(!i.children)continue;let t=e(i.children,n,[...r,i.id]);if(null!==t)return t}return null}(e,t,[])??[],...r?.kind==="directory"?[t]:[]])]}function mw({nodes:e,onSelect:t,selectedId:n}){let r=ne.default.useMemo(()=>e.map(mp),[e]),i=function(e,t){let[n,r]=(0,ne.useState)(()=>({nodes:e,selectedId:t,ids:mg(e,t,e.filter(e=>"directory"===e.kind).map(e=>e.id))}));return(n.nodes!==e||n.selectedId!==t)&&r({nodes:e,selectedId:t,ids:mg(e,t,n.ids)}),{expandedIds:n.ids,onExpandedChange:n=>r({nodes:e,selectedId:t,ids:n})}}(e,n);return(0,t7.jsx)("div",{className:"px-2 pt-2 text-xs",children:(0,t7.jsx)(ml,{ariaLabel:"Project tree",expansionIndicator:"folder",expandedIds:i.expandedIds,nodes:r,selectedId:n??void 0,onExpandedChange:i.onExpandedChange,onSelect:n=>{let r=mb(e,n);r&&t(r)}})})}function mp(e){return{id:e.id,label:e.label,icon:"directory"===e.kind?(0,t7.jsx)(md,{"aria-hidden":!0,size:14}):(0,t7.jsx)(mf,{"aria-hidden":!0,size:14}),...e.children?{children:e.children.map(mp)}:{}}}function mv(e){let[t,n]=ne.default.useState("tree");return(0,t7.jsxs)(vh,{children:[(0,t7.jsx)(mm,{activeTool:t,evaluation:e.evaluation,cycleSelection:e.cycleSelection,inspectedCycleId:e.inspectedCycleId,onCycleInspectionChange:e.onCycleInspectionChange,onProjectTreeSelect:e.onProjectTreeSelect,onValueChange:r=>{"rules"===t&&"rules"!==r&&e.onCycleInspectionChange(null),n(r)},projectTree:e.projectTree,selectedTreeId:e.selectedTreeId}),(0,t7.jsx)("div",{className:"shrink-0",children:(0,t7.jsx)(va,{})})]})}function mm({activeTool:e,evaluation:t,cycleSelection:n,inspectedCycleId:r,onCycleInspectionChange:i,onProjectTreeSelect:a,onValueChange:o,projectTree:c,selectedTreeId:s}){let u=t?.rules.filter(e=>"failed"===e.status).length??0,l=t?.rules.filter(e=>"failed"===e.status).reduce((e,n)=>e+("cyclic-dependencies"===n.id?t.cyclicPackages.length:n.details.length),0)??0;return(0,t7.jsx)(v2,{ariaLabel:nd("sidebar.tools"),value:e,onValueChange:o,tabs:[{id:"tree",label:nd("settings.tree"),content:(0,t7.jsx)(mw,{nodes:c,selectedId:s,onSelect:a})},{id:"rules",label:`${nd("settings.rules")} \xb7 ${l} ${nd("audit.findings")}`,disabled:0===u,content:null===t?null:(0,t7.jsx)(v8,{evaluation:t,cycleSelection:n,inspectedCycleId:r,onCycleInspectionChange:i})},{id:"export",label:nd("settings.export"),content:(0,t7.jsx)(fg,{})}]})}let my=[];e.s(["default",0,function({project:e}){let[t,n]=(0,ne.useState)(""),r=e.ok?e.value.graph:null,i=e.ok?e.value.tree:[],[a,o]=(0,ne.useState)(null),c=e.ok?e.value.evaluation:null,s=e.ok?null:e.error,u=function(e){let[t,n]=nm("pkgviz:cycles:v1:/Users/a_rtiphishl_e/git/_java/coderadar/coderadar-core","{}"),r=(0,ne.useMemo)(()=>nL(t),[t]),i=nT().showCycles,a=(0,ne.useMemo)(()=>{let t;return t=new Map(nj(r)?Object.entries(r):[]),e.flatMap(e=>{let n=nO(e),r=t.get(n);return("boolean"==typeof r?r:i)?[n]:[]})},[e,r,i]),o=(0,ne.useMemo)(()=>e.flatMap((e,t)=>{let n=nO(e);return a.includes(n)?[nN(e,t)]:[]}),[e,a]),c=(0,ne.useCallback)((e,t)=>{n(n=>JSON.stringify({...nL(n),[e]:t}))},[n]);return(0,ne.useMemo)(()=>({highlights:o,selectedIds:a,setSelected:c}),[o,a,c])}(c?.cyclicPackages??my),[l,h]=(0,ne.useState)(null),f=e=>{let t,r=e.replaceAll("/",".").replace(/^\.+|\.+$/g,""),a=(t=function e(t,n){return t.flatMap(t=>[...t.children?e(t.children,n):[],...t.graphPackage===n?[t]:[]])}(i,r)).find(e=>"directory"===e.kind)??t.at(0)??null;n(r),o(a?.id??null)};return(0,t7.jsxs)(t7.Fragment,{children:[(0,t7.jsx)(nw,{title:"nav.packages",children:(0,t7.jsx)(nu,{path:t.replace(/\./g,"/"),onNavigate:f})}),(0,t7.jsx)(nM,{children:(0,t7.jsxs)("main",{"data-testid":"main",className:"flex min-h-0 min-w-0 flex-1 flex-row overflow-hidden dark:bg-[#171717]",children:[(0,t7.jsx)(mv,{evaluation:c,projectTree:i,selectedTreeId:a,onProjectTreeSelect:e=>{o(e.id),n(function(e,t,n){let r=e.graphPackage.replaceAll("/",".").replace(/^\.+|\.+$/g,"");if(!r)return n;let i=r+".";return t.some(e=>e.startsWith(i))?r:n}(e,r?.nodes.map(e=>String(e.data.id??""))??[],t))},cycleSelection:u,inspectedCycleId:l?.id??null,onCycleInspectionChange:h}),s?(0,t7.jsx)(np,{message:s}):(0,t7.jsx)(fu,{currentPackage:t,cycleHighlights:u.highlights,cycleInspection:l,packageGraph:r,setCurrentPackage:f,onCloseInspection:()=>h(null)})]})})]})}],93668)}]);
345
+ `));i.aPosition=t.getAttribLocation(i,"aPosition"),i.aIndex=t.getAttribLocation(i,"aIndex"),i.aVertType=t.getAttribLocation(i,"aVertType"),i.aTransform=t.getAttribLocation(i,"aTransform"),i.aAtlasId=t.getAttribLocation(i,"aAtlasId"),i.aTex=t.getAttribLocation(i,"aTex"),i.aPointAPointB=t.getAttribLocation(i,"aPointAPointB"),i.aPointCPointD=t.getAttribLocation(i,"aPointCPointD"),i.aLineWidth=t.getAttribLocation(i,"aLineWidth"),i.aColor=t.getAttribLocation(i,"aColor"),i.aCornerRadius=t.getAttribLocation(i,"aCornerRadius"),i.aBorderColor=t.getAttribLocation(i,"aBorderColor"),i.uPanZoomMatrix=t.getUniformLocation(i,"uPanZoomMatrix"),i.uAtlasSize=t.getUniformLocation(i,"uAtlasSize"),i.uBGColor=t.getUniformLocation(i,"uBGColor"),i.uZoom=t.getUniformLocation(i,"uZoom"),i.uTextures=[];for(var a=0;a<this.batchManager.getMaxAtlasesPerBatch();a++)i.uTextures.push(t.getUniformLocation(i,"uTexture".concat(a)));return i}},{key:"_createVAO",value:function(){var e,t,n,r,i,a,o=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=o.length/2;var c=this.maxInstances,s=this.gl,u=this.program,l=s.createVertexArray();return s.bindVertexArray(l),e=u.aPosition,n=(t=n0(lD(s,"vec2"),2))[0],i=lR(s,r=t[1],o),a=s.createBuffer(),s.bindBuffer(s.ARRAY_BUFFER,a),s.bufferData(s.ARRAY_BUFFER,i,s.STATIC_DRAW),r===s.FLOAT?s.vertexAttribPointer(e,n,r,!1,0,0):r===s.INT&&s.vertexAttribIPointer(e,n,r,0,0),s.enableVertexAttribArray(e),s.bindBuffer(s.ARRAY_BUFFER,null),this.transformBuffer=function(e,t,n){for(var r=new Float32Array(9*t),i=Array(t),a=0;a<t;a++){var o=9*a*4;i[a]=new Float32Array(r.buffer,o,9)}var c=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,c),e.bufferData(e.ARRAY_BUFFER,r.byteLength,e.DYNAMIC_DRAW);for(var s=0;s<3;s++){var u=n+s;e.enableVertexAttribArray(u),e.vertexAttribPointer(u,3,e.FLOAT,!1,36,12*s),e.vertexAttribDivisor(u,1)}return e.bindBuffer(e.ARRAY_BUFFER,null),c.getMatrixView=function(e){return i[e]},c.setData=function(e,t){i[t].set(e,0)},c.bufferSubData=function(){e.bindBuffer(e.ARRAY_BUFFER,c),e.bufferSubData(e.ARRAY_BUFFER,0,r)},c}(s,c,u.aTransform),this.indexBuffer=l_(s,c,"vec4",u.aIndex),this.vertTypeBuffer=l_(s,c,"int",u.aVertType),this.atlasIdBuffer=l_(s,c,"int",u.aAtlasId),this.texBuffer=l_(s,c,"vec4",u.aTex),this.pointAPointBBuffer=l_(s,c,"vec4",u.aPointAPointB),this.pointCPointDBuffer=l_(s,c,"vec4",u.aPointCPointD),this.lineWidthBuffer=l_(s,c,"vec2",u.aLineWidth),this.colorBuffer=l_(s,c,"vec4",u.aColor),this.cornerRadiusBuffer=l_(s,c,"vec4",u.aCornerRadius),this.borderColorBuffer=l_(s,c,"vec4",u.aBorderColor),s.bindVertexArray(null),l}},{key:"buffers",get:function(){var e=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(e){return rx(e,"Buffer")}).map(function(t){return e[t]})),this._buffers}},{key:"startFrame",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:lJ;this.panZoomMatrix=e,this.renderTarget=t,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(e,t){return!!e.visible()&&(!t||!t.isVisible||t.isVisible(e))}},{key:"drawTexture",value:function(e,t,n){var r=this.atlasManager,i=this.batchManager,a=r.getRenderTypeOpts(n);if(this._isVisible(e,a)&&(!e.isEdge()||this._isValidEdge(e))){if(this.renderTarget.picking&&a.getTexPickingMode){var o=a.getTexPickingMode(e);if(1===o)return;if(2==o)return void this.drawPickingRectangle(e,t,n)}var c,s=nZ(r.getAtlasInfo(e,n));try{for(s.s();!(c=s.n()).done;){var u=c.value,{atlas:l,tex1:h,tex2:f}=u;i.canAddToCurrentBatch(l)||this.endBatch();for(var d=i.getAtlasIndexForBatch(l),b=0,g=[[h,!0],[f,!1]];b<g.length;b++){var w=n0(g[b],2),p=w[0],v=w[1];if(0!=p.w){var y=this.instanceCount;this.vertTypeBuffer.getView(y)[0]=0;var k=this.indexBuffer.getView(y);lL(t,k),this.atlasIdBuffer.getView(y)[0]=d;var x=this.texBuffer.getView(y);x[0]=p.x,x[1]=p.y,x[2]=p.w,x[3]=p.h;var E=this.transformBuffer.getMatrixView(y);this.setTransformMatrix(e,E,a,u,v),this.instanceCount++,!v&&this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(e){s.e(e)}finally{s.f()}}}},{key:"setTransformMatrix",value:function(e,t,n,r){var i=!(arguments.length>4)||void 0===arguments[4]||arguments[4],a=0;if(n.shapeProps&&n.shapeProps.padding&&(a=e.pstyle(n.shapeProps.padding).pfValue),r){var{bb:o,tex1:c,tex2:s}=r,u=c.w/(c.w+s.w);i||(u=1-u);var l=this._getAdjustedBB(o,a,i,u);this._applyTransformMatrix(t,l,n,e)}else{var h=n.getBoundingBox(e),f=this._getAdjustedBB(h,a,!0,1);this._applyTransformMatrix(t,f,n,e)}}},{key:"_applyTransformMatrix",value:function(e,t,n,r){l$(e);var i,a,o=n.getRotation?n.getRotation(r):0;if(0!==o){var{x:c,y:s}=n.getRotationPoint(r);lK(e,e,[c,s]),lH(e,e,o);var u=n.getRotationOffset(r);i=u.x+(t.xOffset||0),a=u.y+(t.yOffset||0)}else i=t.x1,a=t.y1;lK(e,e,[i,a]),lz(e,e,[t.w,t.h])}},{key:"_getAdjustedBB",value:function(e,t,n,r){var{x1:i,y1:a,w:o,h:c,yOffset:s}=e;t&&(i-=t,a-=t,o+=2*t,c+=2*t);var u=0,l=o*r;return n&&r<1?o=l:!n&&r<1&&(i+=u=o-l,o=l),{x1:i,y1:a,w:o,h:c,xOffset:u,yOffset:s}}},{key:"drawPickingRectangle",value:function(e,t,n){var r=this.atlasManager.getRenderTypeOpts(n),i=this.instanceCount;this.vertTypeBuffer.getView(i)[0]=4,lL(t,this.indexBuffer.getView(i)),lN([0,0,0],1,this.colorBuffer.getView(i));var a=this.transformBuffer.getMatrixView(i);this.setTransformMatrix(e,a,r),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(e,t,n){var r=this.simpleShapeOptions.get(n);if(this._isVisible(e,r)){var i=r.shapeProps,a=this._getVertTypeForShape(e,i.shape);if(void 0===a||r.isSimple&&!r.isSimple(e,this.renderTarget))return void this.drawTexture(e,t,n);var o=this.instanceCount;if(this.vertTypeBuffer.getView(o)[0]=a,5===a||6===a){var c=r.getBoundingBox(e),s=this._getCornerRadius(e,i.radius,c),u=this.cornerRadiusBuffer.getView(o);u[0]=s,u[1]=s,u[2]=s,u[3]=s,6===a&&(u[0]=0,u[2]=0)}lL(t,this.indexBuffer.getView(o));var l=this.renderTarget.picking?1:"node-body"===n?e.effectiveOpacity():1,h=this.renderTarget.picking?1:e.pstyle(i.opacity).value*l;lN(e.pstyle(i.color).value,h,this.colorBuffer.getView(o));var f=this.lineWidthBuffer.getView(o);if(f[0]=0,f[1]=0,i.border){var d=e.pstyle("border-width").value;if(d>0){lN(e.pstyle("border-color").value,l*e.pstyle("border-opacity").value,this.borderColorBuffer.getView(o));var b=e.pstyle("border-position").value;if("inside"===b)f[0]=0,f[1]=-d;else if("outside"===b)f[0]=d,f[1]=0;else{var g=d/2;f[0]=g,f[1]=-g}}}var w=this.transformBuffer.getMatrixView(o);this.setTransformMatrix(e,w,r),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(e,t){switch(e.pstyle(t).value){case"rectangle":return 4;case"ellipse":return 7;case"roundrectangle":case"round-rectangle":return 5;case"bottom-round-rectangle":return 6;default:return}}},{key:"_getCornerRadius",value:function(e,t,n){var{w:r,h:i}=n;return"auto"===e.pstyle(t).value?aT(r,i):Math.min(e.pstyle(t).pfValue,i/2,r/2)}},{key:"drawEdgeArrow",value:function(e,t,n){if(e.visible()){var r,i,a,o=e._private.rscratch;if(("source"===n?(r=o.arrowStartX,i=o.arrowStartY,a=o.srcArrowAngle):(r=o.arrowEndX,i=o.arrowEndY,a=o.tgtArrowAngle),!(isNaN(r)||null==r||isNaN(i)||null==i||isNaN(a))&&null!=a)&&"none"!==e.pstyle(n+"-arrow-shape").value){var c=e.pstyle(n+"-arrow-color").value,s=e.pstyle("opacity").value,u=e.pstyle("line-opacity").value,l=e.pstyle("width").pfValue,h=e.pstyle("arrow-scale").value,f=this.r.getArrowWidth(l,h),d=this.instanceCount,b=this.transformBuffer.getMatrixView(d);l$(b),lK(b,b,[r,i]),lz(b,b,[f,f]),lH(b,b,a),this.vertTypeBuffer.getView(d)[0]=3,lL(t,this.indexBuffer.getView(d)),lN(c,s*u,this.colorBuffer.getView(d)),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}},{key:"drawEdgeLine",value:function(e,t){if(e.visible()){var n=this._getEdgePoints(e);if(n){var r=e.pstyle("opacity").value,i=e.pstyle("line-opacity").value,a=e.pstyle("width").pfValue,o=e.pstyle("line-color").value,c=r*i;if(n.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),4==n.length){var s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=1,lL(t,this.indexBuffer.getView(s)),lN(o,c,this.colorBuffer.getView(s)),this.lineWidthBuffer.getView(s)[0]=a;var u=this.pointAPointBBuffer.getView(s);u[0]=n[0],u[1]=n[1],u[2]=n[2],u[3]=n[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var l=0;l<n.length-2;l+=2){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=2,lL(t,this.indexBuffer.getView(h)),lN(o,c,this.colorBuffer.getView(h)),this.lineWidthBuffer.getView(h)[0]=a;var f=n[l-2],d=n[l-1],b=n[l],g=n[l+1],w=n[l+2],p=n[l+3],v=n[l+4],y=n[l+5];0==l&&(f=2*b-w+.001,d=2*g-p+.001),l==n.length-4&&(v=2*w-b+.001,y=2*p-g+.001);var k=this.pointAPointBBuffer.getView(h);k[0]=f,k[1]=d,k[2]=b,k[3]=g;var x=this.pointCPointDBuffer.getView(h);x[0]=w,x[1]=p,x[2]=v,x[3]=y,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(e){var t=e._private.rscratch;return!(t.badLine||null==t.allpts||isNaN(t.allpts[0]))}},{key:"_getEdgePoints",value:function(e){var t=e._private.rscratch;if(this._isValidEdge(e)){var n=t.allpts;if(4==n.length)return n;var r=this._getNumSegments(e);return this._getCurveSegmentPoints(n,r)}}},{key:"_getNumSegments",value:function(e){return Math.min(15,this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(e,t){if(4==e.length)return e;for(var n=Array((t+1)*2),r=0;r<=t;r++)if(0==r)n[0]=e[0],n[1]=e[1];else if(r==t)n[2*r]=e[e.length-2],n[2*r+1]=e[e.length-1];else{var i=r/t;this._setCurvePoint(e,i,n,2*r)}return n}},{key:"_setCurvePoint",value:function(e,t,n,r){if(e.length<=2)n[r]=e[0],n[r+1]=e[1];else{for(var i=Array(e.length-2),a=0;a<i.length;a+=2){var o=(1-t)*e[a]+t*e[a+2],c=(1-t)*e[a+1]+t*e[a+3];i[a]=o,i[a+1]=c}return this._setCurvePoint(i,t,n,r)}}},{key:"endBatch",value:function(){var e=this.gl,t=this.vao,n=this.vertexCount,r=this.instanceCount;if(0!==r){var i,a,o=this.renderTarget.picking?this.pickingProgram:this.program;e.useProgram(o),e.bindVertexArray(t);var c,s=nZ(this.buffers);try{for(s.s();!(c=s.n()).done;)c.value.bufferSubData(r)}catch(e){s.e(e)}finally{s.f()}for(var u=this.batchManager.getAtlases(),l=0;l<u.length;l++)u[l].bufferIfNeeded(e);for(var h=0;h<u.length;h++)e.activeTexture(e.TEXTURE0+h),e.bindTexture(e.TEXTURE_2D,u[h].texture),e.uniform1i(o.uTextures[h],h);e.uniform1f(o.uZoom,(a=(i=this.r).pixelRatio,i.cy.zoom()*a)),e.uniformMatrix3fv(o.uPanZoomMatrix,!1,this.panZoomMatrix),e.uniform1i(o.uAtlasSize,this.batchManager.getAtlasSize());var f=lN(this.bgColor,1);e.uniform4fv(o.uBGColor,f),e.drawArraysInstanced(e.TRIANGLES,0,n,r),e.bindVertexArray(null),e.bindTexture(e.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count:r,atlasCount:u.length}),this.startBatch()}}},{key:"getDebugInfo",value:function(){var e=this.atlasManager.getDebugInfo(),t=e.reduce(function(e,t){return e+t.atlasCount},0),n=this.batchDebugInfo,r=n.reduce(function(e,t){return e+t.count},0);return{atlasInfo:e,totalAtlases:t,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:n.length,batchInfo:n,totalInstances:r}}}]),l0={};function l2(e,t){return ig(e._private.rscratch,"labelWrapCachedLines",t)||[]}l0.initWebgl=function(e,t){var n,r,i,a,o,c,s,u,l=this,h=l.data.contexts[l.WEBGL];e.bgColor=rN((n=l.cy.container())&&n.style&&n.style.backgroundColor||"white"),e.webglTexSize=Math.min(e.webglTexSize,h.getParameter(h.MAX_TEXTURE_SIZE)),e.webglTexRows=Math.min(e.webglTexRows,54),e.webglTexRowsNodes=Math.min(e.webglTexRowsNodes,54),e.webglBatchSize=Math.min(e.webglBatchSize,16384),e.webglTexPerBatch=Math.min(e.webglTexPerBatch,h.getParameter(h.MAX_TEXTURE_IMAGE_UNITS)),l.webglDebug=e.webglDebug,l.webglDebugShowAtlases=e.webglDebugShowAtlases,s=h.createFramebuffer(),h.bindFramebuffer(h.FRAMEBUFFER,s),u=h.createTexture(),h.bindTexture(h.TEXTURE_2D,u),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MIN_FILTER,h.LINEAR),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_S,h.CLAMP_TO_EDGE),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_T,h.CLAMP_TO_EDGE),h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,u,0),h.bindFramebuffer(h.FRAMEBUFFER,null),s.setFramebufferAttachmentSizes=function(e,t){h.bindTexture(h.TEXTURE_2D,u),h.texImage2D(h.TEXTURE_2D,0,h.RGBA,e,t,0,h.RGBA,h.UNSIGNED_BYTE,null)},l.pickingFrameBuffer=s,l.pickingFrameBuffer.needsDraw=!0,l.drawing=new l1(l,h,e);var f=function(e){return function(t){return l.getTextAngle(t,e)}},d=function(e){return function(t){var n=t.pstyle(e);return n&&n.value}},b=function(e){return function(t){return t.pstyle("".concat(e,"-opacity")).value>0}},g=function(e){return"yes"===e.pstyle("text-events").strValue?2:1},w=function(e){var{x:t,y:n}=e.position(),r=e.outerWidth(),i=e.outerHeight();return{w:r,h:i,x1:t-r/2,y1:n-i/2}};l.drawing.addAtlasCollection("node",{texRows:e.webglTexRowsNodes}),l.drawing.addAtlasCollection("label",{texRows:e.webglTexRows}),l.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:t.getStyleKey,getBoundingBox:t.getElementBox,drawElement:t.drawElement}),l.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:w,isSimple:lO,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),l.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:w,isVisible:b("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),l.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:w,isVisible:b("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),l.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:g,getKey:l3(t.getLabelKey,null),getBoundingBox:l4(t.getLabelBox,null),drawClipped:!0,drawElement:t.drawLabel,getRotation:f(null),getRotationPoint:t.getLabelRotationPoint,getRotationOffset:t.getLabelRotationOffset,isVisible:d("label")}),l.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:g,getKey:l3(t.getSourceLabelKey,"source"),getBoundingBox:l4(t.getSourceLabelBox,"source"),drawClipped:!0,drawElement:t.drawSourceLabel,getRotation:f("source"),getRotationPoint:t.getSourceLabelRotationPoint,getRotationOffset:t.getSourceLabelRotationOffset,isVisible:d("source-label")}),l.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:g,getKey:l3(t.getTargetLabelKey,"target"),getBoundingBox:l4(t.getTargetLabelBox,"target"),drawClipped:!0,drawElement:t.drawTargetLabel,getRotation:f("target"),getRotationPoint:t.getTargetLabelRotationPoint,getRotationOffset:t.getTargetLabelRotationOffset,isVisible:d("target-label")});var p=rV(function(){console.log("garbage collect flag set"),l.data.gc=!0},1e4);l.onUpdateEleCalcs(function(e,t){var n=!1;t&&t.length>0&&(n|=l.drawing.invalidate(t)),n&&p()}),i=(r=l).render,r.render=function(e){e=e||{};var t,n,a,o,c=r.cy;r.webgl&&(c.zoom()>7.99?((n=(t=r).data.contexts[t.WEBGL]).clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT),i.call(r,e)):(a=r,(o=function(e){e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,a.canvasWidth,a.canvasHeight),e.restore()})(a.data.contexts[a.NODE]),o(a.data.contexts[a.DRAG]),l8(r,e,lJ)))},a=r.matchCanvasSize,r.matchCanvasSize=function(e){a.call(r,e),r.pickingFrameBuffer.setFramebufferAttachmentSizes(r.canvasWidth,r.canvasHeight),r.pickingFrameBuffer.needsDraw=!0},r.findNearestElements=function(e,t,n,i){return function(e,t,n){var r,i,a,o=function(e,t,n){var{pan:r,zoom:i}=lA(e),a=n0((f=t*i+r.x,d=n*i+r.y,[f,d=Math.round(e.canvasHeight-d)]),2),o=a[0],c=a[1],s=e.data.contexts[e.WEBGL];s.bindFramebuffer(s.FRAMEBUFFER,e.pickingFrameBuffer),e.pickingFrameBuffer.needsDraw&&(s.viewport(0,0,s.canvas.width,s.canvas.height),l8(e,null,lZ),e.pickingFrameBuffer.needsDraw=!1);var u=new Uint8Array(144);s.readPixels(o-3,c-3,6,6,s.RGBA,s.UNSIGNED_BYTE,u),s.bindFramebuffer(s.FRAMEBUFFER,null);for(var l=new Set,h=0;h<36;h++){var f,d,b,g=(b=u.slice(4*h,4*h+4))[0]+(b[1]<<8)+(b[2]<<16)+(b[3]<<24)-1;g>=0&&l.add(g)}return l}(e,t,n),c=e.getCachedZSortedEles(),s=nZ(o);try{for(s.s();!(a=s.n()).done;){var u=c[a.value];if(!r&&u.isNode()&&(r=u),!i&&u.isEdge()&&(i=u),r&&i)break}}catch(e){s.e(e)}finally{s.f()}return[r,i].filter(Boolean)}(r,e,t)},o=r.invalidateCachedZSortedEles,r.invalidateCachedZSortedEles=function(){o.call(r),r.pickingFrameBuffer.needsDraw=!0},c=r.notify,r.notify=function(e,t){c.call(r,e,t),"viewport"===e||"bounds"===e?r.pickingFrameBuffer.needsDraw=!0:"background"===e&&r.drawing.invalidate(t,{type:"node-body"})}};var l3=function(e,t){return function(n){var r=e(n),i=l2(n,t);return i.length>1?i.map(function(e,t){return"".concat(r,"_").concat(t)}):r}},l4=function(e,t){return function(n,r){var i=e(n);if("string"==typeof r){var a=r.indexOf("_");if(a>0){var o=Number(r.substring(a+1)),c=l2(n,t),s=i.h/c.length,u=s*o,l=i.y1+u;return{x1:i.x1,w:i.w,y1:l,h:s,yOffset:u}}}return i}};function l5(e,t){var n=e.canvasWidth,r=e.canvasHeight,{pan:i,zoom:a}=lA(e);t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,n,r),t.translate(i.x,i.y),t.scale(a,a)}function l6(e,t,n){var r=e.drawing;t+=1,n.isNode()?(r.drawNode(n,t,"node-underlay"),r.drawNode(n,t,"node-body"),r.drawTexture(n,t,"label"),r.drawNode(n,t,"node-overlay")):(r.drawEdgeLine(n,t),r.drawEdgeArrow(n,t,"source"),r.drawEdgeArrow(n,t,"target"),r.drawTexture(n,t,"label"),r.drawTexture(n,t,"edge-source-label"),r.drawTexture(n,t,"edge-target-label"))}function l8(e,t,n){e.webglDebug&&(p=performance.now());var r=e.drawing,i=0;if(n.screen&&e.data.canvasNeedsRedraw[e.SELECT_BOX]&&e.drawSelectionRectangle(t,function(t){return l5(e,t)}),e.data.canvasNeedsRedraw[e.NODE]||n.picking){var a,o,c,s=e.data.contexts[e.WEBGL];n.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var u=function(e){var t,n,r,i,a,o,c,s,u,l,h,f,d,b,g,w,p,v,y=e.canvasWidth,k=e.canvasHeight,{pan:x,zoom:E}=lA(e),S=lF();lK(S,S,[x.x,x.y]),lz(S,S,[E,E]);var T=lF();T[0]=2/y,T[1]=0,T[2]=0,T[3]=0,T[4]=-2/k,T[5]=0,T[6]=-1,T[7]=1,T[8]=1;var C=lF();return t=T[0],n=T[1],r=T[2],i=T[3],a=T[4],o=T[5],c=T[6],s=T[7],u=T[8],l=S[0],h=S[1],f=S[2],d=S[3],b=S[4],g=S[5],w=S[6],p=S[7],v=S[8],C[0]=l*t+h*i+f*c,C[1]=l*n+h*a+f*s,C[2]=l*r+h*o+f*u,C[3]=d*t+b*i+g*c,C[4]=d*n+b*a+g*s,C[5]=d*r+b*o+g*u,C[6]=w*t+p*i+v*c,C[7]=w*n+p*a+v*s,C[8]=w*r+p*o+v*u,C}(e),l=e.getCachedZSortedEles();if(i=l.length,r.startFrame(u,n),n.screen){for(var h=0;h<l.nondrag.length;h++)l6(e,h,l.nondrag[h]);for(var f=0;f<l.drag.length;f++)l6(e,f,l.drag[f])}else if(n.picking)for(var d=0;d<l.length;d++)l6(e,d,l[d]);r.endFrame(),n.screen&&e.webglDebugShowAtlases&&((a=e.data.contexts[e.NODE]).save(),l5(e,a),a.strokeStyle="rgba(0, 0, 0, 0.3)",a.beginPath(),a.moveTo(-1e3,0),a.lineTo(1e3,0),a.stroke(),a.beginPath(),a.moveTo(0,-1e3),a.lineTo(0,1e3),a.stroke(),a.restore(),c=0,(o=function(t,n,r){for(var i=t.atlasManager.getAtlasCollection(n),a=e.data.contexts[e.NODE],o=i.atlases,c=0;c<o.length;c++){var s=o[c].canvas;if(s){var u=s.width,l=s.height,h=u*c,f=s.height*r;a.save(),a.scale(.4,.4),a.drawImage(s,h,f),a.strokeStyle="black",a.rect(h,f,u,l),a.stroke(),a.restore()}}})(e.drawing,"node",c++),o(e.drawing,"label",c++)),e.data.canvasNeedsRedraw[e.NODE]=!1,e.data.canvasNeedsRedraw[e.DRAG]=!1}if(e.webglDebug){var b=Math.ceil(performance.now()-p),g=r.getDebugInfo(),w=["".concat(i," elements"),"".concat(g.totalInstances," instances"),"".concat(g.batchCount," batches"),"".concat(g.totalAtlases," atlases"),"".concat(g.wrappedCount," wrapped textures"),"".concat(g.simpleCount," simple shapes")].join(", ");console.log("WebGL (".concat(n.name,") - frame time ").concat(b,"ms")),console.log("Totals:"),console.log(" ".concat(w)),console.log("Texture Atlases Used:");var p,v,y=nZ(g.atlasInfo);try{for(y.s();!(v=y.n()).done;){var k=v.value;console.log(" ".concat(k.type,": ").concat(k.keyCount," keys, ").concat(k.atlasCount," atlases"))}}catch(e){y.e(e)}finally{y.f()}console.log("")}e.data.gc&&(console.log("Garbage Collect!"),e.data.gc=!1,r.gc())}var l9={};l9.drawPolygonPath=function(e,t,n,r,i,a){var o=r/2,c=i/2;e.beginPath&&e.beginPath(),e.moveTo(t+o*a[0],n+c*a[1]);for(var s=1;s<a.length/2;s++)e.lineTo(t+o*a[2*s],n+c*a[2*s+1]);e.closePath()},l9.drawRoundPolygonPath=function(e,t,n,r,i,a,o){o.forEach(function(t){return uR(e,t)}),e.closePath()},l9.drawRoundRectanglePath=function(e,t,n,r,i,a){var o=r/2,c=i/2,s="auto"===a?aT(r,i):Math.min(a,c,o);e.beginPath&&e.beginPath(),e.moveTo(t,n-c),e.arcTo(t+o,n-c,t+o,n,s),e.arcTo(t+o,n+c,t,n+c,s),e.arcTo(t-o,n+c,t-o,n,s),e.arcTo(t-o,n-c,t,n-c,s),e.lineTo(t,n-c),e.closePath()},l9.drawBottomRoundRectanglePath=function(e,t,n,r,i,a){var o=r/2,c=i/2,s="auto"===a?aT(r,i):a;e.beginPath&&e.beginPath(),e.moveTo(t,n-c),e.lineTo(t+o,n-c),e.lineTo(t+o,n),e.arcTo(t+o,n+c,t,n+c,s),e.arcTo(t-o,n+c,t-o,n,s),e.lineTo(t-o,n-c),e.lineTo(t,n-c),e.closePath()},l9.drawCutRectanglePath=function(e,t,n,r,i,a,o){var c=r/2,s=i/2,u="auto"===o?aM():o;e.beginPath&&e.beginPath(),e.moveTo(t-c+u,n-s),e.lineTo(t+c-u,n-s),e.lineTo(t+c,n-s+u),e.lineTo(t+c,n+s-u),e.lineTo(t+c-u,n+s),e.lineTo(t-c+u,n+s),e.lineTo(t-c,n+s-u),e.lineTo(t-c,n-s+u),e.closePath()},l9.drawBarrelPath=function(e,t,n,r,i){var a=r/2,o=i/2,c=t-a,s=t+a,u=n-o,l=n+o,h=aP(r,i),f=h.widthOffset,d=h.heightOffset,b=h.ctrlPtOffsetPct*f;e.beginPath&&e.beginPath(),e.moveTo(c,u+d),e.lineTo(c,l-d),e.quadraticCurveTo(c+b,l,c+f,l),e.lineTo(s-f,l),e.quadraticCurveTo(s-b,l,s,l-d),e.lineTo(s,u+d),e.quadraticCurveTo(s-b,u,s-f,u),e.lineTo(c+f,u),e.quadraticCurveTo(c+b,u,c,u+d),e.closePath()};var l7={},he={},ht=Math.PI/40;for(t6=0*Math.PI;t6<2*Math.PI;t6+=ht)l7[t6]=Math.sin(t6),he[t6]=Math.cos(t6);l9.drawEllipsePath=function(e,t,n,r,i){if(e.beginPath&&e.beginPath(),e.ellipse)e.ellipse(t,n,r/2,i/2,0,0,2*Math.PI);else for(var a,o,c=r/2,s=i/2,u=0*Math.PI;u<2*Math.PI;u+=ht)a=t-c*l7[u]*0+c*he[u]*1,o=n+s*he[u]*0+s*l7[u]*1,0===u?e.moveTo(a,o):e.lineTo(a,o);e.closePath()};var hn={};function hr(e){var t=e.indexOf(",");return e.substr(t+1)}function hi(e,t,n){var r=function(){return t.toDataURL(n,e.quality)};switch(e.output){case"blob-promise":return new oL(function(r,i){try{t.toBlob(function(e){null!=e?r(e):i(Error("`canvas.toBlob()` sent a null value in its callback"))},n,e.quality)}catch(e){i(e)}});case"blob":return function(e,t){for(var n=atob(e),r=new ArrayBuffer(n.length),i=new Uint8Array(r),a=0;a<n.length;a++)i[a]=n.charCodeAt(a);return new Blob([r],{type:t})}(hr(r()),n);case"base64":return hr(r());default:return r()}}hn.createBuffer=function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,[n,n.getContext("2d")]},hn.bufferCanvasImage=function(e){var t=this.cy,n=t.mutableElements().boundingBox(),r=this.findContainerClientCoords(),i=e.full?Math.ceil(n.w):r[2],a=e.full?Math.ceil(n.h):r[3],o=rc(e.maxWidth)||rc(e.maxHeight),c=this.getPixelRatio(),s=1;if(void 0!==e.scale)i*=e.scale,a*=e.scale,s=e.scale;else if(o){var u=1/0,l=1/0;rc(e.maxWidth)&&(u=s*e.maxWidth/i),rc(e.maxHeight)&&(l=s*e.maxHeight/a),i*=s=Math.min(u,l),a*=s}o||(i*=c,a*=c,s*=c);var h=document.createElement("canvas");h.width=i,h.height=a,h.style.width=i+"px",h.style.height=a+"px";var f=h.getContext("2d");if(i>0&&a>0){f.clearRect(0,0,i,a),f.globalCompositeOperation="source-over";var d=this.getCachedZSortedEles();if(e.full)f.translate(-n.x1*s,-n.y1*s),f.scale(s,s),this.drawElements(f,d),f.scale(1/s,1/s),f.translate(n.x1*s,n.y1*s);else{var b=t.pan(),g={x:b.x*s,y:b.y*s};s*=t.zoom(),f.translate(g.x,g.y),f.scale(s,s),this.drawElements(f,d),f.scale(1/s,1/s),f.translate(-g.x,-g.y)}e.bg&&(f.globalCompositeOperation="destination-over",f.fillStyle=e.bg,f.rect(0,0,i,a),f.fill())}return h},hn.png=function(e){return hi(e,this.bufferCanvasImage(e),"image/png")},hn.jpg=function(e){return hi(e,this.bufferCanvasImage(e),"image/jpeg")};var ha={};ha.nodeShapeImpl=function(e,t,n,r,i,a,o,c){switch(e){case"ellipse":return this.drawEllipsePath(t,n,r,i,a);case"polygon":return this.drawPolygonPath(t,n,r,i,a,o);case"round-polygon":return this.drawRoundPolygonPath(t,n,r,i,a,o,c);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,n,r,i,a,c);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,n,r,i,a,o,c);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,n,r,i,a,c);case"barrel":return this.drawBarrelPath(t,n,r,i,a)}};var ho=hc.prototype;function hc(e){var t=this,n=t.cy.window().document;e.webgl&&(ho.CANVAS_LAYERS=t.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),t.data={canvases:Array(ho.CANVAS_LAYERS),contexts:Array(ho.CANVAS_LAYERS),canvasNeedsRedraw:Array(ho.CANVAS_LAYERS),bufferCanvases:Array(ho.BUFFER_COUNT),bufferContexts:Array(ho.CANVAS_LAYERS)};var r="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";t.data.canvasContainer=n.createElement("div");var a=t.data.canvasContainer.style;t.data.canvasContainer.style[r]=i,a.position="relative",a.zIndex="0",a.overflow="hidden";var o=e.cy.container();o.appendChild(t.data.canvasContainer),o.style[r]=i;var c={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};n8&&n8.userAgent.match(/msie|trident|edge/i)&&(c["-ms-touch-action"]="none",c["touch-action"]="none");for(var s=0;s<ho.CANVAS_LAYERS;s++){var u=t.data.canvases[s]=n.createElement("canvas"),l=ho.CANVAS_TYPES[s];t.data.contexts[s]=u.getContext(l),t.data.contexts[s]||ir("Could not create canvas of type "+l),Object.keys(c).forEach(function(e){u.style[e]=c[e]}),u.style.position="absolute",u.setAttribute("data-id","layer"+s),u.style.zIndex=String(ho.CANVAS_LAYERS-s),t.data.canvasContainer.appendChild(u),t.data.canvasNeedsRedraw[s]=!1}t.data.topCanvas=t.data.canvases[0],t.data.canvases[ho.NODE].setAttribute("data-id","layer"+ho.NODE+"-node"),t.data.canvases[ho.SELECT_BOX].setAttribute("data-id","layer"+ho.SELECT_BOX+"-selectbox"),t.data.canvases[ho.DRAG].setAttribute("data-id","layer"+ho.DRAG+"-drag"),t.data.canvases[ho.WEBGL]&&t.data.canvases[ho.WEBGL].setAttribute("data-id","layer"+ho.WEBGL+"-webgl");for(var s=0;s<ho.BUFFER_COUNT;s++)t.data.bufferCanvases[s]=n.createElement("canvas"),t.data.bufferContexts[s]=t.data.bufferCanvases[s].getContext("2d"),t.data.bufferCanvases[s].style.position="absolute",t.data.bufferCanvases[s].setAttribute("data-id","buffer"+s),t.data.bufferCanvases[s].style.zIndex=String(-s-1),t.data.bufferCanvases[s].style.visibility="hidden";t.pathsEnabled=!0;var h=iZ(),f=function(e){return{x:-e.w/2,y:-e.h/2}},d=function(e){return e[0]._private.nodeKey},b=function(e){return e[0]._private.labelStyleKey},g=function(e){return e[0]._private.sourceLabelStyleKey},w=function(e){return e[0]._private.targetLabelStyleKey},p=function(e,n,r,i,a){return t.drawElement(e,n,r,!1,!1,a)},v=function(e,n,r,i,a){return t.drawElementText(e,n,r,i,"main",a)},y=function(e,n,r,i,a){return t.drawElementText(e,n,r,i,"source",a)},k=function(e,n,r,i,a){return t.drawElementText(e,n,r,i,"target",a)},x=function(e){return e.boundingBox(),e[0]._private.bodyBounds},E=function(e){return e.boundingBox(),e[0]._private.labelBounds.main||h},S=function(e){return e.boundingBox(),e[0]._private.labelBounds.source||h},T=function(e){return e.boundingBox(),e[0]._private.labelBounds.target||h},C=function(e,t){return t},M=function(e){var t;return{x:((t=x(e)).x1+t.x2)/2,y:(t.y1+t.y2)/2}},P=function(e,t,n){var r=e?e+"-":"";return{x:t.x+n.pstyle(r+"text-margin-x").pfValue,y:t.y+n.pstyle(r+"text-margin-y").pfValue}},j=function(e,t,n){var r=e[0]._private.rscratch;return{x:r[t],y:r[n]}},I=function(e){return P("",j(e,"labelX","labelY"),e)},A=function(e){return P("source",j(e,"sourceLabelX","sourceLabelY"),e)},O=function(e){return P("target",j(e,"targetLabelX","targetLabelY"),e)},N=function(e){return f(x(e))},L=function(e){return f(S(e))},D=function(e){return f(T(e))},R=function(e){var t=E(e),n=f(E(e));if(e.isNode()){switch(cm(e.pstyle("text-halign").value)){case"left":n.x=-t.w-(t.leftPad||0);break;case"right":n.x=-(t.rightPad||0)}switch(cy(e.pstyle("text-valign").value)){case"top":n.y=-t.h-(t.topPad||0);break;case"bottom":n.y=-(t.botPad||0)}}return n},_=t.data.eleTxrCache=new lr(t,{getKey:d,doesEleInvalidateKey:function(e){var t=e[0]._private;return t.oldBackgroundTimestamp!==t.backgroundTimestamp},drawElement:p,getBoundingBox:x,getRotationPoint:M,getRotationOffset:N,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),B=t.data.lblTxrCache=new lr(t,{getKey:b,drawElement:v,getBoundingBox:E,getRotationPoint:I,getRotationOffset:R,isVisible:C}),F=t.data.slbTxrCache=new lr(t,{getKey:g,drawElement:y,getBoundingBox:S,getRotationPoint:A,getRotationOffset:L,isVisible:C}),$=t.data.tlbTxrCache=new lr(t,{getKey:w,drawElement:k,getBoundingBox:T,getRotationPoint:O,getRotationOffset:D,isVisible:C}),K=t.data.lyrTxrCache=new la(t);t.onUpdateEleCalcs(function(e,t){_.invalidateElements(t),B.invalidateElements(t),F.invalidateElements(t),$.invalidateElements(t),K.invalidateElements(t);for(var n=0;n<t.length;n++){var r=t[n]._private;r.oldBackgroundTimestamp=r.backgroundTimestamp}});var H=function(e){for(var t=0;t<e.length;t++)K.enqueueElementRefinement(e[t].ele)};_.onDequeue(H),B.onDequeue(H),F.onDequeue(H),$.onDequeue(H),e.webgl&&t.initWebgl(e,{getStyleKey:d,getLabelKey:b,getSourceLabelKey:g,getTargetLabelKey:w,drawElement:p,drawLabel:v,drawSourceLabel:y,drawTargetLabel:k,getElementBox:x,getLabelBox:E,getSourceLabelBox:S,getTargetLabelBox:T,getElementRotationPoint:M,getElementRotationOffset:N,getLabelRotationPoint:I,getSourceLabelRotationPoint:A,getTargetLabelRotationPoint:O,getLabelRotationOffset:R,getSourceLabelRotationOffset:L,getTargetLabelRotationOffset:D})}ho.CANVAS_LAYERS=3,ho.SELECT_BOX=0,ho.DRAG=1,ho.NODE=2,ho.WEBGL=3,ho.CANVAS_TYPES=["2d","2d","2d","webgl2"],ho.BUFFER_COUNT=3,ho.TEXTURE_BUFFER=0,ho.MOTIONBLUR_BUFFER_NODE=1,ho.MOTIONBLUR_BUFFER_DRAG=2,ho.redrawHint=function(e,t){switch(e){case"eles":this.data.canvasNeedsRedraw[ho.NODE]=t;break;case"drag":this.data.canvasNeedsRedraw[ho.DRAG]=t;break;case"select":this.data.canvasNeedsRedraw[ho.SELECT_BOX]=t;break;case"gc":this.data.gc=!0}};var hs="u">typeof Path2D;ho.path2dEnabled=function(e){if(void 0===e)return this.pathsEnabled;this.pathsEnabled=!!e},ho.usePaths=function(){return hs&&this.pathsEnabled},ho.setImgSmoothing=function(e,t){null!=e.imageSmoothingEnabled?e.imageSmoothingEnabled=t:(e.webkitImageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t)},ho.getImgSmoothing=function(e){return null!=e.imageSmoothingEnabled?e.imageSmoothingEnabled:e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled},ho.makeOffscreenCanvas=function(e,t){var n;return("u"<typeof OffscreenCanvas?"undefined":n4(OffscreenCanvas))!=="undefined"?n=new OffscreenCanvas(e,t):((n=this.cy.window().document.createElement("canvas")).width=e,n.height=t),n},[ls,lb,lk,lE,lS,lC,lP,l0,l9,hn,ha].forEach(function(e){rj(ho,e)});var hu=[{name:"null",impl:uT},{name:"base",impl:u6},{name:"canvas",impl:hc}],hl={},hh={};function hf(e,t,n){var r=n,i=function(n){ia("Can not register `"+t+"` for `"+e+"` since `"+n+"` already exists in the prototype and can not be overridden")};if("core"===e)if(sX.prototype[t])return i(t);else sX.prototype[t]=n;else if("collection"===e)if(sp.prototype[t])return i(t);else sp.prototype[t]=n;else if("layout"===e){for(var a=function(e){this.options=e,n.call(this,e),ro(this._private)||(this._private={}),this._private.cy=e.cy,this._private.listeners=[],this.createEmitter()},o=a.prototype=Object.create(n.prototype),c=[],s=0;s<c.length;s++){var u=c[s];o[u]=o[u]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this});var l=n.prototype.stop;o.stop=function(){var e=this.options;if(e&&e.animate){var t=this.animations;if(t)for(var n=0;n<t.length;n++)t[n].stop()}return l?l.call(this):this.emit("layoutstop"),this},o.destroy||(o.destroy=function(){return this}),o.cy=function(){return this._private.cy};var h=function(e){return e._private.cy},f={addEventFields:function(e,t){t.layout=e,t.cy=h(e),t.target=e},bubble:function(){return!0},parent:function(e){return h(e)}};rj(o,{createEmitter:function(){return this._private.emitter=new cQ(f,this),this},emitter:function(){return this._private.emitter},on:function(e,t){return this.emitter().on(e,t),this},one:function(e,t){return this.emitter().one(e,t),this},once:function(e,t){return this.emitter().one(e,t),this},removeListener:function(e,t){return this.emitter().removeListener(e,t),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(e,t){return this.emitter().emit(e,t),this}}),oQ.eventAliasesOn(o),r=a}else if("renderer"===e&&"null"!==t&&"base"!==t){var d=hd("renderer","base"),b=d.prototype,g=n.prototype,w=function(){d.apply(this,arguments),n.apply(this,arguments)},p=w.prototype;for(var v in b){var y=b[v];if(null!=g[v])return i(v);p[v]=y}for(var k in g)p[k]=g[k];b.clientFunctions.forEach(function(e){p[e]=p[e]||function(){ir("Renderer does not implement `renderer."+e+"()` on its prototype")}}),r=w}else if("__proto__"===e||"constructor"===e||"prototype"===e)return ir(e+" is an illegal type to be registered, possibly lead to prototype pollutions");return rD({map:hl,keys:[e,t],value:r})}function hd(e,t){return rR({map:hl,keys:[e,t]})}function hb(e,t,n,r,i){return rD({map:hh,keys:[e,t,n,r],value:i})}function hg(e,t,n,r){return rR({map:hh,keys:[e,t,n,r]})}var hw=function(){return 2==arguments.length?hd.apply(null,arguments):3==arguments.length?hf.apply(null,arguments):4==arguments.length?hg.apply(null,arguments):5==arguments.length?hb.apply(null,arguments):void ir("Invalid extension access syntax")};sX.prototype.extension=hw,[{type:"layout",extensions:uS},{type:"renderer",extensions:hu}].forEach(function(e){e.extensions.forEach(function(t){hf(e.type,t.name,t.impl)})});var hp=function(){if(!(this instanceof hp))return new hp;this.length=0},hv=hp.prototype;hv.instanceString=function(){return"stylesheet"},hv.selector=function(e){return this[this.length++]={selector:e,properties:[]},this},hv.css=function(e,t){var n=this.length-1;if(rr(e))this[n].properties.push({name:e,value:t});else if(ro(e))for(var r=Object.keys(e),i=0;i<r.length;i++){var a=r[i],o=e[a];if(null!=o){var c=sV.properties[a]||sV.properties[rm(a)];if(null!=c){var s=c.name;this[n].properties.push({name:s,value:o})}}}return this},hv.style=hv.css,hv.generateStyle=function(e){var t=new sV(e);return this.appendToStyle(t)},hv.appendToStyle=function(e){for(var t=0;t<this.length;t++){var n=this[t],r=n.selector,i=n.properties;e.selector(r);for(var a=0;a<i.length;a++){var o=i[a];e.css(o.name,o.value)}}return e};var hm=function(e){return(void 0===e&&(e={}),ro(e))?new sX(e):rr(e)?hw.apply(hw,arguments):void 0};function hy(e,t,n,r){return hx.map(([i,a])=>{let o=e=>{var i,o,c,s;let u=e.target;"object"==typeof(i=u)&&null!==i&&"id"in i&&"function"==typeof i.id&&(o=n.current,c=t,s={id:u.id(),type:a},"node"===c?o.onNodeEvent?.(s):o.onEdgeEvent?.(s),r())};return e.on(i,t,o),{cytoscapeEvent:i,handler:o}})}function hk(e,t,n){for(let{cytoscapeEvent:r,handler:i}of n)e.off(r,t,i)}hm.use=function(e){var t=Array.prototype.slice.call(arguments,1);return t.unshift(hm),e.apply(null,t),this},hm.warnings=function(e){return ii(e)},hm.version="3.34.3",hm.stylesheet=hm.Stylesheet=hp;var hx=[["tap","press"],["dbltap","double-press"],["select","select"],["unselect","unselect"],["mouseover","pointer-enter"],["mouseout","pointer-leave"]];function hE(e,t,n,r){e.batch(()=>{e.nodes().not(":parent").positions(e=>{let i=t.get(e.id())??e.position();return{x:n.x+(i.x-n.x)*r,y:n.y+(i.y-n.y)*r}})})}function hS(e,t){let n=e.nodes().map(e=>({id:e.id(),box:e.boundingBox({includeLabels:!0,includeOverlays:!1,includeUnderlays:!1})})).sort((e,t)=>e.box.x1-t.box.x1),r={remaining:2e5};for(let[e,i]of n.entries())for(let a=e+1;a<n.length;a+=1){let e=n.at(a);if(!e||e.box.x1>=i.box.x2+8)break;if(--r.remaining<0||!(t.get(i.id)?.has(e.id)||t.get(e.id)?.has(i.id))&&i.box.y1<e.box.y2+8&&e.box.y1<i.box.y2+8)return!0}return!1}function hT(e,t){let n=t.min*t.scale;e.minZoom(Math.min(e.minZoom(),n)),e.maxZoom(Math.max(n,t.max*t.scale,t.readableZoom)),e.minZoom(n)}function hC(e,t){return void 0!==e&&Number.isFinite(e)&&e>0?e:t}function hM(e,t){e.zoom({level:t,renderedPosition:{x:e.width()/2,y:e.height()/2}})}function hP(e){let t=globalThis.requestAnimationFrame;t?t(e):setTimeout(e,0)}function hj(e){return JSON.stringify(e.nodes().map(e=>{if(e.isParent())return[e.id()];let t=e.layoutDimensions({nodeDimensionsIncludeLabels:!0});return[e.id(),t.w,t.h]}))}function hI(e,t){return JSON.stringify([e.map(e=>[e.id,e.parentId??null]).sort(),t.map(e=>[e.id??null,e.source,e.target]).sort()])}function hA(e,t){if(e.destroyed())return[];let n=e.zoom();return e.nodes().map(e=>({hovered:t.has(e.id()),id:e.id(),position:e.renderedPosition(),selected:e.selected(),zoom:n}))}var hO=((e,t)=>{var n=null!=e&&"object"==typeof e;if(n){var r=d??=new WeakMap,i=r.get(e);if(i)return i}t=null!=e?nH(nz(e)):{};let a=e&&e.__esModule&&nq.call(e,"default")?t:nV(t,"default",{value:e,enumerable:!0});if(e&&"object"==typeof e||"function"==typeof e)for(let t of nU(e))nq.call(a,t)||nV(a,t,{get:nG.bind(e,t),enumerable:!0});return n&&r.set(e,a),a})(nW()),hN=null!=Object.assign?Object.assign.bind(Object):function(e,...t){return t.forEach(t=>{Object.keys(t).forEach(n=>e[n]=t[n])}),e},hL={nodeDimensionsIncludeLabels:!1,fit:!0,padding:20,animate:!1,animateFilter:function(){return!0},animationDuration:500,animationEasing:void 0,transform:function(e,t){return t},ready:void 0,stop:void 0,nodeLayoutOptions:void 0,elk:{algorithm:void 0},priority:function(){return null}},hD={},hR=function(e,t){let n=e.layoutDimensions(t),r=e.parent(),i=e.scratch("elk"),a={x:i.x,y:i.y};for(;r.nonempty();){let e=r.scratch("elk");a.x+=e.x,a.y+=e.y,r=r.parent()}return a.x+=n.w/2,a.y+=n.h/2,a},h_=function(e,t){let n={_cyEle:e,id:e.id()};if(t.nodeLayoutOptions&&(n.layoutOptions=t.nodeLayoutOptions(e)),!e.isParent()){let r=e.layoutDimensions(t),i=e.position();n.x=i.x-r.w/2,n.y=i.y-r.h/2,n.width=r.w,n.height=r.h}return e.scratch("elk",n),n},hB=function(e){let t={_cyEle:e,id:e.id(),source:e.data("source"),target:e.data("target")};return e.scratch("elk",t),t},hF=function(e,t,n){let r=[],i=[],a={},o={id:"root",children:[],edges:[]};for(let t=0;t<e.length;t++){let i=e[t],o=h_(i,n);r.push(o),a[i.id()]=o}for(let e=0;e<t.length;e++){let n=t[e],r=hB(n);i.push(r),a[n.id()]=r}for(let e=0;e<r.length;e++){let t=r[e],n=t._cyEle;if(n.isChild()){let e=a[n.parent().id()];(e.children=e.children||[]).push(t)}else o.children.push(t)}for(let e=0;e<i.length;e++){let t=i[e];o.edges.push(t)}return o},h$=class{constructor(e){const t=e.elk,{cy:n}=e;this.options=hN({},hL,e),this.options.elk=hN({aspectRatio:n.width()/n.height()},hL.elk,t,hD)}run(){let e=this,{options:t}=this,{eles:n}=t,r=n.nodes(),i=n.edges(),a=new hO.default,o=hF(r,i,t);return o.layoutOptions=t.elk,a.layout(o).then(()=>{r.filter(e=>!e.isParent()).layoutPositions(e,t,e=>hR(e,t))}),this}stop(){return this}destroy(){return this}};function hK(e){Object.assign(this,new h$(e))}function hH(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function hz(e){return{...e.layoutOptions??{},name:e.layout,spacingFactor:e.spacingFactor,nodeDimensionsIncludeLabels:!0,fit:!1,animate:!1}}function hV(e,t,n){let r=new Set,i=n.get(t);for(;void 0!==i&&!r.has(i);){if(i===e)return!0;r.add(i),i=n.get(i)}return!1}function hU(e,t){let n=e.generationRef.current+1;e.generationRef.current=n,e.layoutRunningRef.current=!0,e.cy.resize(),e.layoutRef.current=function(e,t,n){if("elk"===t.layout){var r,i;let a,o,c,s,u,l;return r=hz(t),(l=hm({headless:!0,styleEnabled:!0,elements:(i=e).elements().map(e=>{let t=e.data();return{data:hH(t)?{...t}:{},classes:e.classes()}}),style:[{selector:"node",style:{label:"",padding:"0px","border-width":0}}]})).batch(()=>{i.nodes().forEach(e=>{if(e.isParent()){let t=e.style("padding");"string"==typeof t&&l.getElementById(e.id()).style({padding:t});return}let t=e.layoutDimensions({nodeDimensionsIncludeLabels:!0});l.getElementById(e.id()).style({width:t.w,height:t.h})})}),a=l,o={stopped:!1},c="elk"in r?r.elk:void 0,s={...r,fit:!1,animate:!1,elk:{aspectRatio:e.width()/Math.max(e.height(),1),...hH(c)?c:{}}},(u=a.layout(s)).one("layoutstop",()=>{try{if(o.stopped||e.destroyed())return;e.batch(()=>{e.nodes().not(":parent").positions(e=>a.getElementById(e.id()).position())}),n()}finally{a.destroy()}}),u.run(),{stop(){o.stopped=!0}}}let a=e.layout(hz(t)),o=()=>n();return a.one("layoutstop",o),a.run(),{stop(){var e=a,t=o;e.off("layoutstop",t);try{e.stop()}catch{}}}}(e.cy,{layout:t.layout??"concentric",layoutOptions:t.layoutOptions,spacingFactor:t.spacingFactor??1},()=>{var t,r;return t=e,r=n,void hP(()=>{var e,n,i;if(t.cy.destroyed()||r!==t.generationRef.current)return;if(t.loopSizer.update(),t.layoutRef.current=null,t.cy.resize(),t.layoutRunningRef.current=!1,!((i=t.cy).width()>0&&i.height()>0))return;let a=t.latestUpdateRef.current;if(null===a)return;let o=hI(a.nodes,a.edges),c=(e=t.readyRef.current,n=o!==t.settledTopologyRef.current,!e||n);t.viewport.settle(c),t.settledTopologyRef.current=o;let s=t.fitRequestRef.current;t.fitRequestRef.current=null,s&&hq(t,s),hW(t),t.readyRef.current||(t.readyRef.current=!0,t.callbacksRef.current.onReady?.(t.controller)),t.callbacksRef.current.onLayoutComplete?.(t.controller)})})}function hq(e,t){if(e.cy.destroyed())return;if(e.layoutRunningRef.current){e.fitRequestRef.current=t;return}let n=e.latestUpdateRef.current;if(!n)return;let r=e.optimizedSpacingRef.current??n.spacingFactor??1,i=function(e,t){let n=e.nodes(":childless");if(n.length<2||e.nodes().length>2e3||n.filter(":locked").length>0)return t;let r=new Map(e.nodes().map(e=>[e.id(),new Set(e.ancestors().map(e=>e.id()))]));if(hS(e,r))return t;let i=new Map(n.map(e=>[e.id(),{...e.position()}])),a=n.boundingBox(),o={x:(a.x1+a.x2)/2,y:(a.y1+a.y2)/2},c={low:Math.min(1,.1/t),high:1};for(let t of Array.from({length:8},(e,t)=>t)){let n=0===t?c.low:(c.low+c.high)/2;if(hE(e,i,o,n),hS(e,r)?c.low=n:c.high=n,c.high===c.low)break}return hE(e,i,o,c.high),t*c.high}(e.cy,r);e.geometryRef.current=hj(e.cy),e.loopSizer.update(),e.viewport.settle(!1),e.controller.fit({...t,optimizeSpacing:!1}),i!==r&&(e.optimizedSpacingRef.current=i,e.callbacksRef.current.onSpacingFactorChange?.(i)),hW(e)}function hG(e){e.generationRef.current+=1,e.layoutRunningRef.current=!1,e.layoutRef.current?.stop(),e.layoutRef.current=null}function hX(e,t,n){let r=e.getElementById(t);r.empty()||r.style({height:n.height,width:n.width})}function hW(e){if(0===e.renderedNodeListeners.size)return;let t=hA(e.cy,e.hoveredNodeIds);for(let n of e.renderedNodeListeners)n(t)}function hY(e){let t=ne.default.useMemo(()=>new Map(e.nodes.map(e=>[e.id,e])),[e.nodes]);return(0,t7.jsx)("div",{"aria-hidden":!0,style:{inset:0,overflow:"hidden",pointerEvents:"none",position:"absolute"},children:e.renderedNodes.map(n=>{let r=t.get(n.id);return r?(0,t7.jsx)(hQ,{node:r,renderedNode:n,renderNode:e.renderNode,onNodeEvent:e.onNodeEvent,onNodeSize:e.onNodeSize},r.id):null})})}function hQ(e){let t=ne.default.useRef(null),{node:n,onNodeSize:r,renderedNode:i}=e;return ne.default.useLayoutEffect(()=>{let e=t.current;if(null===e)return;hJ(e,n.id,r);let i=globalThis.ResizeObserver??null;if(null===i)return;let a=new i(()=>hJ(e,n.id,r));return a.observe(e),()=>a.disconnect()},[n.id,r]),(0,t7.jsx)("div",{ref:e=>{t.current=e},style:{left:i.position.x,pointerEvents:"auto",position:"absolute",top:i.position.y,transform:`translate(-50%, -50%) scale(${i.zoom})`,transformOrigin:"center"},onClick:()=>e.onNodeEvent(n.id,"press"),onDoubleClick:()=>e.onNodeEvent(n.id,"double-press"),onMouseEnter:()=>e.onNodeEvent(n.id,"pointer-enter"),onMouseLeave:()=>e.onNodeEvent(n.id,"pointer-leave"),children:e.renderNode({hovered:i.hovered,node:n,selected:i.selected,zoom:i.zoom})})}function hJ(e,t,n){"number"!=typeof e.offsetWidth||"number"!=typeof e.offsetHeight||e.offsetWidth<=0||e.offsetHeight<=0||n(t,{width:e.offsetWidth,height:e.offsetHeight})}function hZ(e){let{containerRef:t,renderedNodes:n,runtimeRef:r}=function(e){var t,n,r,i,a,o,c,s,u,l,h;let f=ne.default.useRef(null),d=ne.default.useRef(null),b=function(e){var t;let n=ne.default.useRef({onEdgeEvent:(t=e).onEdgeEvent,onLayoutComplete:t.onLayoutComplete,onNodeEvent:t.onNodeEvent,onReady:t.onReady,onViewportChange:t.onViewportChange,onSpacingFactorChange:t.onSpacingFactorChange}),{onEdgeEvent:r,onLayoutComplete:i,onNodeEvent:a,onReady:o,onViewportChange:c,onSpacingFactorChange:s}=e;return ne.default.useEffect(()=>{n.current={onEdgeEvent:r,onLayoutComplete:i,onNodeEvent:a,onReady:o,onViewportChange:c,onSpacingFactorChange:s}},[r,i,a,o,c,s]),n}(e),[g,w]=ne.default.useState([]);return t=f,n=d,r=b,ne.default.useEffect(()=>{let e,i=t.current;if(null===i)return;let a=(e=function(e,t,n){var r,i;let a,o,c,s,u,l,h={current:50},f=(r=e=>hq(k,e),a={scale:1,relative:!1,min:.05,max:2,readableSize:0,fitSize:1/0,readableZoom:0,fitZoom:1/0},{controller:o={fit(t){t?.optimizeSpacing&&!t.nodeIds?.length&&r?r(t):function(e,t={},n=1/0){if(e.destroyed())return;let r=function(e,t){if(void 0===t||0===t.length)return e.nodes();let n=new Set(t);return e.nodes().filter(e=>n.has(e.id()))}(e,t.nodeIds);!r.empty()&&(e.fit(r,t.padding??50),e.zoom()>n&&(e.zoom(n),e.center(r)))}(e,{nodeIds:t?.nodeIds,padding:t?.padding??h.current},a.fitZoom)},getViewport:()=>({pan:e.pan(),zoom:e.zoom()/a.scale}),getZoomRange:()=>({min:e.minZoom()/a.scale,max:e.maxZoom()/a.scale}),setPan(t){e.pan(t)},setZoom(t){hM(e,t*a.scale)},zoomBy(t){hM(e,e.zoom()*t)}},configure(t){a.relative="fit-relative"===t.zoomMode,a.min=t.minZoom??.05,a.max=t.maxZoom??2,a.readableSize=hC(t.minReadableLabelSize,0),a.fitSize=hC(t.maxFitLabelSize,1/0),a.relative||(a.scale=1),hT(e,a)},settle(t){let n=e.zoom()/a.scale,r=e.nodes().filter(e=>!e.isParent()&&!!e.style("label")).map(e=>Number.parseFloat(String(e.style("font-size")))).filter(e=>Number.isFinite(e)&&e>0);a.readableZoom=r.length?a.readableSize/r.reduce((e,t)=>Math.min(e,t),1/0):0,a.fitZoom=r.length?a.fitSize/r.reduce((e,t)=>Math.max(e,t),0):1/0,a.scale=a.relative?Math.min(function(e,t){if(e.nodes().empty())return 1;let n=e.nodes().boundingBox(),r=e.width()-2*t,i=e.height()-2*t;return r<=0||i<=0||n.w<=0||n.h<=0?1:Math.min(r/n.w,i/n.h)}(e,h.current),a.fitZoom):1,hT(e,a),t?o.fit():a.relative&&(hM(e,n*a.scale),e.center(e.nodes()))}}),{controller:d}=f,b={current:!1},g={current:!1},w=new Set,p={fitRequestRef:{current:null},optimizedSpacingRef:{current:null},callbacksRef:n,controller:d,viewport:f,cy:e,fitPaddingRef:h,generationRef:{current:0},geometryRef:{current:null},hoveredNodeIds:new Set,latestUpdateRef:{current:null},layoutRef:{current:null},layoutRunningRef:b,nodeSizes:new Map,labelSizedNodeIds:new Set,loopSizer:(c=new Map,{reset:function(){for(let t of c.keys())e.getElementById(t).removeStyle("control-point-step-size control-point-distances");c.clear()},update:function(){let t=e.edges(":loop"),n=new Set(t.map(e=>e.id()));for(let t of c.keys())n.has(t)||(e.getElementById(t).removeStyle("control-point-step-size control-point-distances"),c.delete(t));e.batch(()=>{t.forEach(e=>{let t=e.source(),n=c.get(e.id())??{step:Number.parseFloat(String(e.style("control-point-step-size")))||40,distance:Number.parseFloat(String(e.style("control-point-distances")))||40};c.set(e.id(),n);let r=Math.max(16,e.width()*Number.parseFloat(String(e.style("arrow-scale")))*2),i=(Math.hypot(t.outerWidth(),t.outerHeight())/2+r)/1.4,a=Math.max(n.step,i),o=Math.max(n.distance,i);Number.parseFloat(String(e.style("control-point-step-size")))!==a&&e.style("control-point-step-size",a),Number.parseFloat(String(e.style("control-point-distances")))!==o&&e.style("control-point-distances",o)})})}}),readyRef:g,settledTopologyRef:{current:null},relayoutScheduledRef:{current:!1},renderedNodeListeners:w},v=(s=hy(e,"node",n,i=()=>hW(p)),u=hy(e,"edge",n,i),l=()=>{n.current.onViewportChange?.(d.getViewport()),i()},e.on("zoom pan",l),()=>{hk(e,"node",s),hk(e,"edge",u),e.off("zoom pan",l)}),y=function(e){let t=globalThis.ResizeObserver??null;if(null===t)return null;let n={height:-1,width:-1},r=new t(t=>{var r,i,a;let o=t.at(0);void 0===o||(r=n,i=o.contentRect,r.height===i.height&&r.width===i.width)||(n.height=o.contentRect.height,n.width=o.contentRect.width,e.readyRef.current&&!e.layoutRunningRef.current&&(a=e,hP(()=>{a.cy.destroyed()||a.layoutRunningRef.current||(a.cy.resize(),a.settleViewport(),a.onViewportSettled())})))});return r.observe(e.container),r}({container:t,cy:e,settleViewport:()=>f.settle(!0),layoutRunningRef:b,onViewportSettled:()=>hW(p),readyRef:g}),k={...p,resizeObserver:y,unbindEvents:v};return k}(hm({container:i,elements:[],minZoom:.05,maxZoom:2,selectionType:"additive",userPanningEnabled:!0}),i,r),{destroy:()=>{var t;return t=e,void(t.resizeObserver?.disconnect(),hG(t),t.unbindEvents(),t.renderedNodeListeners.clear(),t.cy.destroyed()||t.cy.destroy())},handleOverlayNodeEvent:(t,n)=>{var r,i,a;return r=e,i=t,void("pointer-enter"===(a=n)&&r.hoveredNodeIds.add(i),"pointer-leave"===a&&r.hoveredNodeIds.delete(i),"press"===a&&r.cy.getElementById(i).select(),r.callbacksRef.current.onNodeEvent?.({id:i,type:a}),hW(r))},setNodeSize:(t,n)=>{var r,i,a,o;let c;return r=e,i=t,a=n,c=r.nodeSizes.get(i),void((c?.width!==a.width||c.height!==a.height)&&(r.nodeSizes.set(i,a),hX(r.cy,i,a),(o=r).relayoutScheduledRef.current||(o.relayoutScheduledRef.current=!0,hP(()=>{o.relayoutScheduledRef.current=!1;let e=o.latestUpdateRef.current;null===e||o.cy.destroyed()||(hG(o),hU(o,e))}))))},setSelectedNodeIds:t=>(function(e,t){if(e.cy.destroyed()||void 0===t)return;let n=new Set(t);e.cy.nodes().forEach(e=>{n.has(e.id())?e.select():e.unselect()}),hW(e)})(e,t),subscribeRenderedNodes:t=>{var n,r;return n=e,r=t,n.renderedNodeListeners.add(r),r(hA(n.cy,n.hoveredNodeIds)),()=>{n.renderedNodeListeners.delete(r)}},update:t=>(function(e,t){if(e.cy.destroyed())return;let n=e.latestUpdateRef.current,r=null!==e.optimizedSpacingRef.current&&e.optimizedSpacingRef.current===t.spacingFactor,i=r&&n?{...n,spacingFactor:t.spacingFactor}:n;r&&(e.optimizedSpacingRef.current=null),e.latestUpdateRef.current=t,e.fitPaddingRef.current=t.fitPadding??50,e.viewport.configure(t),e.cy.batch(()=>{var n,r,a;let o;(i?.nodes!==t.nodes||i.edges!==t.edges)&&function(e,t,n){let r,i;if(e.destroyed())return;let a=(r=new Set(t.map(e=>e.id)),i=new Map(t.flatMap(e=>e.parentId?[[e.id,e.parentId]]:[])),[...t.map(e=>({group:"nodes",classes:e.classes??"",data:{...e.data??{},id:e.id,label:e.label??e.id,parent:e.parentId}})),...n.flatMap((e,t)=>{var n,a,o,c;return n=e,a=t,o=r,c=i,!o.has(n.source)||!o.has(n.target)||hV(n.source,n.target,c)||hV(n.target,n.source,c)?[]:[{group:"edges",classes:n.classes??"",data:{...n.data??{},id:n.id??`${n.source}->${n.target}:${a}`,source:n.source,target:n.target}}]})]);e.batch(()=>{for(let t of a){let n=e.getElementById(t.data.id??""),r=n.data(),i=Object.keys(hH(r)?r:{}).filter(e=>!Object.hasOwn(t.data,e));i.length>0&&n.removeData(i.join(" "))}e.json({elements:a})})}(e.cy,t.nodes,t.edges),(i?.styleRules!==t.styleRules||i?.richNodeRendering!==t.richNodeRendering)&&(e.loopSizer.reset(),n=e.cy,r=t.styleRules,a=t.richNodeRendering,o=[...r??[]],a&&o.push({selector:"node",style:{"background-opacity":0,"border-width":0,label:"","overlay-opacity":0}}),o.length>0&&n.style(o).update())}),function(e,t,n){if(!n){for(let n of t)e.getElementById(n).removeStyle("width height");t.clear();return}let r=new Set;for(let n of(e.nodes(":childless").forEach(e=>{let t=e.boundingBox({includeNodes:!1,includeEdges:!1,includeLabels:!0,includeOverlays:!1,includeUnderlays:!1});if(t.w<=0||t.h<=0)return;let n=Math.ceil(t.w),i=Math.ceil(t.h);(e.width()!==n||e.height()!==i)&&e.style({width:n,height:i}),r.add(e.id())}),t))r.has(n)||(e.getElementById(n).removeStyle("width height"),t.delete(n));for(let e of r)t.add(e)}(e.cy,e.labelSizedNodeIds,!0===t.sizeNodesToLabels&&!t.richNodeRendering),function(e){for(let[t,n]of e.nodeSizes)hX(e.cy,t,n)}(e),e.loopSizer.update();let a=hj(e.cy),o=a!==e.geometryRef.current||null===i||i.layout!==t.layout||i.spacingFactor!==t.spacingFactor||i.layoutOptions!==t.layoutOptions||i.richNodeRendering!==t.richNodeRendering||hI(i.nodes,i.edges)!==hI(t.nodes,t.edges);if(e.geometryRef.current=a,!o){(i?.zoomMode!==t.zoomMode||i?.fitPadding!==t.fitPadding||i?.minZoom!==t.minZoom||i?.maxZoom!==t.maxZoom||i?.minReadableLabelSize!==t.minReadableLabelSize||i?.maxFitLabelSize!==t.maxFitLabelSize)&&e.viewport.settle(i?.zoomMode!==t.zoomMode),hW(e),e.layoutRunningRef.current||e.callbacksRef.current.onLayoutComplete?.(e.controller);return}hG(e),e.fitRequestRef.current=null,e.optimizedSpacingRef.current=null,hU(e,t)})(e,t)});return n.current=a,()=>{a.destroy(),n.current=null}},[r,t,n]),function(e,t){let{edges:n,fitPadding:r,layout:i,layoutOptions:a,maxZoom:o,minReadableLabelSize:c,maxFitLabelSize:s,minZoom:u,zoomMode:l,sizeNodesToLabels:h,nodes:f,renderNode:d,spacingFactor:b,styleRules:g}=t;ne.default.useEffect(()=>{e.current?.update({edges:n,fitPadding:r,layout:i,layoutOptions:a,maxZoom:o,minReadableLabelSize:c,maxFitLabelSize:s,minZoom:u,zoomMode:l,sizeNodesToLabels:h,nodes:f,richNodeRendering:void 0!==d,spacingFactor:b,styleRules:g})},[n,r,i,a,o,c,s,u,l,h,f,d,e,b,g])}(d,e),i=d,a=e.selectedNodeIds,ne.default.useEffect(()=>{i.current?.setSelectedNodeIds(a)},[i,a]),o=d,c=e.renderNode,s=w,ne.default.useEffect(()=>{let e=o.current;return null===e||void 0===c?void s([]):e.subscribeRenderedNodes(s)},[c,o,s]),u=d,l=e.nodes,h=e.getNodeSize,ne.default.useEffect(()=>{let e=u.current;if(null!==e&&void 0!==h)for(let t of l){let n=h(t);n&&e.setNodeSize(t.id,n)}},[h,l,u]),{containerRef:f,renderedNodes:g,runtimeRef:d}}(e);return(0,t7.jsxs)("div",{"aria-label":e.ariaLabel??"Graph",className:e.className,role:"application",style:{height:"100%",minHeight:0,minWidth:0,position:"relative",width:"100%",...e.style},children:[(0,t7.jsx)("div",{ref:t,style:{height:"100%",width:"100%"}}),e.renderNode?(0,t7.jsx)(hY,{nodes:e.nodes,renderedNodes:n,renderNode:e.renderNode,onNodeEvent:(e,t)=>r.current?.handleOverlayNodeEvent(e,t),onNodeSize:(e,t)=>r.current?.setNodeSize(e,t)}):null]})}function h1(e,t){let n=new Map,r=new Set;return new Map([...new Set([...e.keys(),...e.values()])].map(i=>{let a=function i(a){let o=n.get(a);if(void 0!==o)return o;if(r.has(a))return 0;r.add(a);let c=t.has(a)?void 0:e.get(a),s=void 0===c?0:i(c)+1;return r.delete(a),n.set(a,s),s}(i),o=h0(a),c=0===a?0:h0(a-1);return[i,(o-c)/(1-c)]}))}function h0(e){return .04+.14*e/(e+3)}function h2(e){let t=e.data.id;return"string"==typeof t?t:null}function h3(e,t,n){let r=new Set,i=n.get(t);for(;void 0!==i&&!r.has(i);){if(i===e)return!0;r.add(i),i=n.get(i)}return!1}function h4(e){return"string"==typeof e?e:Array.isArray(e)?e.filter(e=>"string"==typeof e).join(" "):""}function h5(e,...t){return[e,...t].filter(e=>e&&e.length>0).join(" ").trim()}function h6(e){return"string"==typeof e&&e.length>0?e:void 0}Object.setPrototypeOf(hK.prototype,h$.prototype),hm("layout","elk",hK);let h8={light:{canvasBg:"#ffffff",edge:"#000",weightXs:"#000",weightMd:"#000",weightXl:"#000",nodeBg:"#E8F1FF",nodeBorder:"#0B5FFF",nodeBorderVendor:"#E2D5FF",nodeBgVendor:"#D1C4FF",nodeText:"#0B5FFF",compoundBg:"#7892B3",selectedFill:"#0B5FFF",selectedFillVendor:"#a025aa",selectedRing:"#0B5FFF",selectedText:"#FFF"},dark:{canvasBg:"#171717",edge:"#707070",weightXs:"#5A5A5A",weightMd:"#8A8A8A",weightXl:"#C0C0C0",nodeBg:"#1E2533",nodeBgVendor:"#241431",nodeBorder:"#2A3A4A",nodeBorderVendor:"#351542",nodeText:"#E8F0FF",compoundBg:"#A9BCD5",selectedFill:"#2E6FFF",selectedFillVendor:"#4E25AA",selectedRing:"#BBD3FF",selectedText:"#FFFFFF"}};function h9(e){return{selector:e.selector,style:{..."style"in e?e.style:e.css}}}let h7=na("circle-dot-dashed",[["path",{d:"M10.1 2.18a9.93 9.93 0 0 1 3.8 0",key:"1qdqn0"}],["path",{d:"M17.6 3.71a9.95 9.95 0 0 1 2.69 2.7",key:"1bq7p6"}],["path",{d:"M21.82 10.1a9.93 9.93 0 0 1 0 3.8",key:"1rlaqf"}],["path",{d:"M20.29 17.6a9.95 9.95 0 0 1-2.7 2.69",key:"1xk03u"}],["path",{d:"M13.9 21.82a9.94 9.94 0 0 1-3.8 0",key:"l7re25"}],["path",{d:"M6.4 20.29a9.95 9.95 0 0 1-2.69-2.7",key:"1v18p6"}],["path",{d:"M2.18 13.9a9.93 9.93 0 0 1 0-3.8",key:"xdo6bj"}],["path",{d:"M3.71 6.4a9.95 9.95 0 0 1 2.7-2.69",key:"1jjmaz"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);function fe({controller:e,maxZoom:t,minZoom:n,zoom:r}){return(0,t7.jsxs)("div",{className:"flex shrink-0 items-center justify-center gap-2 border-t border-t-gray-200 p-4 dark:border-t-gray-800",children:[(0,t7.jsx)("label",{htmlFor:"zoom",children:"Zoom:"}),(0,t7.jsx)("button",{type:"button",title:"Fit graph and optimize spacing for readability","aria-label":"Fit graph and optimize spacing for readability",onClick:()=>e?.fit({optimizeSpacing:!0}),className:"p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-800",children:(0,t7.jsx)(h7,{className:"cursor-pointer"})}),(0,t7.jsx)("input",{id:"zoom",type:"range",min:n,max:t,step:"any",value:r,onChange:r=>{if(null===e)return;let i=Number.parseFloat(r.target.value);e.setZoom(Math.min(t,Math.max(n,i)))},className:"w-64"}),(0,t7.jsxs)("span",{className:"text-sm",children:[(100*r).toFixed(0),"%"]})]})}function ft(e,t,n,r){return r?e||t||n?[e?"highlight":"",t?"highlight-outgoer":"",n?"highlight-incomer":""].filter(Boolean).join(" "):"hushed":""}function fn(e){return"boolean"==typeof e.data.isIntrinsic?e.data.isIntrinsic:!(Array.isArray(e.classes)?e.classes:(e.classes??"").split(/\s+/)).includes("isVendor")}function fr(e){let t=[...e].sort(),n=[];for(let e of t)n.some(t=>e.startsWith(t+"."))||n.push(e);return n}function fi(e,t){if(t.has(e))return e;let n=e.split(".");for(;n.length>1;){n.pop();let e=n.join(".");if(t.has(e))return e}return e}function fa(e){let t=e.nodes.filter(e=>!!e.data.isIntrinsic),n=new Set(t.map(e=>e.data.id));return{nodes:t,edges:e.edges.filter(e=>n.has(e.data.source)&&n.has(e.data.target))}}let fo={breadthfirst:{name:"breadthfirst",animate:!1,animationDuration:500,animationEasing:void 0,avoidOverlap:!0,boundingBox:void 0,circle:!1,depthSort:void 0,directed:!0,direction:"downward",fit:!0,grid:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,ready:void 0,stop:void 0,transform:function(e,t){return t}},circle:{name:"circle",fit:!0,avoidOverlap:!0,sort:(e,t)=>e.data("id").localeCompare(t.data("id"))},concentric:{name:"concentric",avoidOverlap:!0,fit:!0,padding:30,sort:(e,t)=>e.data("id").localeCompare(t.data("id"))},elk:{name:"elk",elk:{algorithm:"layered","elk.direction":"DOWN","elk.hierarchyHandling":"INCLUDE_CHILDREN"},animate:!0,animateFilter:function(){return!0},animationDuration:500,animationEasing:void 0,fit:!0,nodeDimensionsIncludeLabels:!1,nodeLayoutOptions:void 0,transform:function(e,t){return t},ready:void 0,stop:void 0,priority:function(){return null}},grid:{name:"grid",avoidOverlap:!0,sort:(e,t)=>e.data("id").localeCompare(t.data("id"))}};function fc(e){var t,n;let r,i,a,o=nP(),{resolvedTheme:c}=(0,nl.useTheme)(),s="dark"===c?"dark":"light",u=function(e){let{currentPackage:t,elements:n,preservePackageScope:r,setCurrentPackage:i,setMaxSubPackageDepth:a,setSubPackageDepth:o,showCompoundNodes:c,showVendorPackages:s,subPackageDepth:u}=e,l=(0,ne.useMemo)(()=>{var e,i;let a,o,l,h,f;return null===n?null:(o=function(e,t=!1,n=1){let r=e.nodes.map(e=>e.data.id),i=new Set(r),a=new Set(fr(r)),o=new Map;for(let e of r){let t=function(e,t,n,r){if(n<=1)return e;let i=e.split(".").length,a=t.split("."),o=Math.min(i+(n-1),a.length);for(let e=o;e>=i;e--){let t=a.slice(0,e).join(".");if(r.has(t))return t}return e}(fi(e,a),e,n,i);o.set(e,t)}let c=new Set(o.values()),s=e.nodes.filter(e=>c.has(e.data.id)),u=new Map,l=new Map;for(let n of e.edges){let e=n.data.source,r=n.data.target,i=o.get(e)??e,a=o.get(r)??r;if(!c.has(i)||!c.has(a)||!t&&i===a)continue;let s=`${i}->${a}`,h=l.get(s)??[];if(h.push(n.data.id??`${e}->${r}`),l.set(s,h),u.has(s)){let e=u.get(s),t=n.data.weight??1;e.data.weight=(e.data.weight??0)+t}else u.set(s,{...n,data:{...n.data,id:s,originalEdgeIds:h,source:i,target:a,weight:n.data.weight??1}})}return{nodes:s,edges:Array.from(u.values())}}(a=function(e,t){let n=t.replace(/\.+$/,"");if(!n)return e;let r=n+".",i=new Set(e.nodes.filter(e=>{let t=e.data.id??"";return fn(e)&&t.startsWith(r)}).map(e=>e.data.id)),a=new Set(e.edges.flatMap(e=>i.has(e.data.source)||i.has(e.data.target)?[e.data.source,e.data.target]:[])),o=e.nodes.filter(e=>i.has(e.data.id)||!fn(e)&&a.has(String(e.data.id))),c=new Set(o.map(e=>e.data.id));return{nodes:o,edges:e.edges.filter(e=>c.has(e.data.source)&&c.has(e.data.target))}}(function({nodes:e,edges:t},n,r){return{nodes:e.map(e=>{var t,i,a;let o,c,s;return t=e,i=n,a=r,o=t.data.idInactive??t.data.id,c=t.data.parentInactive??t.data.parent,s={...t.data,idInactive:o,name:i?String(o).split(".").pop():String(o).slice(a.length?a.length+1:0)},i?{...t,data:{...s,parent:c,parentInactive:void 0}}:{...t,data:{...s,parent:void 0,parentInactive:c}}}),edges:t}}((e={currentPackage:t,elements:n,preservePackageScope:r,showCompoundNodes:c,showVendorPackages:s,subPackageDepth:u}).elements,e.showCompoundNodes,e.currentPackage),e.currentPackage.replace(/\//g,".")),!0,e.subPackageDepth),l=e.showVendorPackages?o:fa(o),{elements:(i=e.showCompoundNodes?l:function(e){let t=new Set(e.edges.flatMap(e=>[e.data.source,e.data.target])),n=new Set;for(let t of e.nodes.filter(fn)){let e=String(t.data.id??"").split(".");for(let t=1;t<e.length;t+=1)n.add(e.slice(0,t).join("."))}return{nodes:e.nodes.filter(e=>!fn(e)||!n.has(String(e.data.id))||t.has(String(e.data.id))),edges:e.edges}}(l),h=e.currentPackage.replaceAll("/","."),f=new Set(i.nodes.map(e=>String(e.data.id??""))),{nodes:i.nodes.map(e=>{var t,n,r;let i,a;return{group:"nodes",classes:e.classes??"",data:{...e.data,label:(t=e,n=h,r=f,i=String(t.data.id??""),(a="string"==typeof t.data.parent?t.data.parent:"")&&r.has(a)&&i.startsWith(`${a}.`)?i.slice(a.length+1):function(e,t){if(!t)return e;if(e===t)return e.split(".").at(-1)??e;let n=t+".";return e.startsWith(n)?e.slice(n.length):e}(i,n))}}}),edges:i.edges}),maxSubPackageDepth:Math.max(1,function(e){let t=e.nodes.map(e=>String(e.data.id));if(0===t.length)return 0;let n=new Set(fr(t)),r=1;for(let e of t){let t=fi(e,n),i=e.split(".").length-t.split(".").length+1;i>r&&(r=i)}return r}(e.showVendorPackages?a:fa(a))),redirectPackage:function(e){let t=e.currentPackage.replaceAll("/",".");if(e.preservePackageScope)return null;let n=function(e,t){let n=new Map;for(let e of t.nodes.filter(fn)){let t=String(e.data.id??"");if(!t)continue;let r=t.lastIndexOf("."),i=r<0?"":t.slice(0,r),a=n.get(i)??[];a.push(t),n.set(i,a)}return function e(t,n,r){let i=n.get(t)??[],a=i[0];return 1!==i.length||!a||r.has(a)||!n.has(a)?t:e(a,n,r)}(e,n,new Set(t.edges.flatMap(e=>[e.data.source,e.data.target])))}(t,e.elements);return n===t?null:n}(e)})},[t,n,r,c,s,u]);return(0,ne.useEffect)(()=>{null!==l&&(a(l.maxSubPackageDepth),null===l.redirectPackage&&u>l.maxSubPackageDepth&&o(l.maxSubPackageDepth),null!==l.redirectPackage&&i(l.redirectPackage))},[l,i,a,o,u]),l?.redirectPackage===null?l.elements:null}({currentPackage:e.currentPackage,elements:e.packageGraph,preservePackageScope:e.cycleHighlights.length>0,setCurrentPackage:e.setCurrentPackage,setMaxSubPackageDepth:o.setMaxSubPackageDepth,setSubPackageDepth:o.setSubPackageDepth,showCompoundNodes:o.showCompoundNodes,showVendorPackages:o.showVendorPackages,subPackageDepth:o.subPackageDepth});!function(e){let t=(0,ne.useRef)(null),{cycleHighlights:n,currentPackage:r,setCurrentPackage:i,setSubPackageDepth:a,subPackageDepth:o,visibleElements:c}=e;(0,ne.useEffect)(()=>(function(e,t){if(null===e.visibleElements)return;if(0===e.cycleHighlights.length){t.current=null;return}let n=e.cycleHighlights.map(e=>e.id).sort().join("|");t.current===n||!function(e){if(null===e.visibleElements)return!1;let t=[...new Set(e.cycleHighlights.flatMap(e=>e.cycle.packages))],n=new Set(e.visibleElements.nodes.map(e=>h2(e)).filter(e=>null!==e));if(t.every(e=>n.has(e)))return!1;let r=function(e){let t=[...new Set(e.flatMap(e=>e.cycle.packages))];if(0===t.length)return null;let n=t.map(e=>e.split(".")),[r,...i]=n,a=r.findIndex((e,t)=>i.some(n=>n.at(t)!==e)),o=-1===a?r.length:a,c=r.slice(0,o),s=t.includes(c.join("."))?c.slice(0,-1):c;return{currentPackage:s.join("."),packageDepth:Math.max(1,...n.map(e=>e.length-s.length))}}(e.cycleHighlights);if(!r)return!1;let i=e.currentPackage.replace(/\//g,"."),a=r.currentPackage!==i,o=r.packageDepth>e.subPackageDepth;return a&&e.setCurrentPackage(r.currentPackage),o&&e.setSubPackageDepth(r.packageDepth),a||o}(e)&&(t.current=n)})({cycleHighlights:n,currentPackage:r,setCurrentPackage:i,setSubPackageDepth:a,subPackageDepth:o,visibleElements:c},t),[n,r,i,a,o,c])}({cycleHighlights:e.cycleHighlights,currentPackage:e.currentPackage,setCurrentPackage:e.setCurrentPackage,setSubPackageDepth:o.setSubPackageDepth,subPackageDepth:o.subPackageDepth,visibleElements:u});let l=(t={cycleHighlights:e.cycleHighlights,layout:o.cytoscapeLayout,packageGraph:e.packageGraph,theme:s,visibleElements:u},r=(0,ne.useMemo)(()=>{var e,n,r,i,a;let o,c,s,u,l,h,f;return null===t.visibleElements?null:(e=t.packageGraph,n=t.visibleElements,r=t.cycleHighlights,o=new Set(n.nodes.map(e=>h2(e)).filter(e=>null!==e)),i=n,a=o,s=function(e,t){let n=new Set;for(let r of e.edges){let e=h6(r.data.source),i=h6(r.data.target);e&&i&&(h3(e,i,t)?n.add(i):h3(i,e,t)&&n.add(e))}return n}(n,c=new Map(i.nodes.flatMap(e=>{let t=h2(e),n=h6(e.data.parent);return t&&n&&a.has(n)?[[t,n]]:[]}))),u=function(e){let t=new Set;for(let n of e.nodes){let e=h2(n);if(null!==e)for(let n=e.lastIndexOf(".");n>=0&&(t.add(e.slice(0,n)),0!==n);n=e.lastIndexOf(".",n-1));}return t}(e),l=new Set([...o].filter(e=>u.has(e))),f={cycles:(h=function(e){let t=new Map,n=new Map;for(let r of e){for(let e of r.cycle.packages)t.set(e,r.color);r.cycle.edges.toReversed().forEach((e,t)=>{let i=n.get(e.from)??new Map;i.set(e.to,{color:r.color,step:r.cycle.edges.length-t}),n.set(e.from,i)})}return{edges:n,nodes:t}}(r)).nodes,opacity:h1(c,s)},{edges:n.edges.flatMap(e=>(function(e,t){let n=h6(e.data.source),r=h6(e.data.target);if(!n||!r)return[];let i=t.get(n)?.get(r);return[{id:h6(e.data.id),source:n,target:r,classes:h5(h4(e.classes),i?"auditCycle":void 0),data:{...e.data,...i?{auditCycleColor:i.color,auditCycleStep:String(i.step)}:{}}}]})(e,h.edges)),nodes:n.nodes.flatMap(e=>(function(e,t,n,r,i){let a=h2(e);if(null===a)return[];let o=i.cycles.get(a),c=n.has(a)?void 0:t.get(a),s=h6(e.data.label)??h6(e.data.name)??a;return[{id:a,label:s,parentId:c,classes:h5(h4(e.classes),r.has(a)?"isParent":void 0,void 0!==o?"auditCycle":void 0),data:{...e.data,compoundFillOpacity:i.opacity.get(a)??.04,parent:c,...void 0!==o?{auditCycleColor:o}:{}}}]})(e,c,s,l,f)),parentNodeIds:l})},[t.cycleHighlights,t.packageGraph,t.visibleElements]),i=(0,ne.useMemo)(()=>{var e,n,r,i;return null===t.visibleElements?[]:(e=t.visibleElements,n=t.theme,r=t.layout,[...function(e,t){var n,r,i,a,o,c,s,u;let l,h=h8[t],{thresholds:f}=function(e="linear",t){var n;if(!t)return{thresholds:[],counts:[]};let r=t.edges.map(e=>Number(e.data.weight)),i=(n=t,n?.edges.reduce((e,t)=>t.data.weight>e?t.data.weight:e,0)??0),a=[],o=[,,,].fill(0);if("linear"===e){for(let e=1;e<3;e++)a.push(e*i/3);a.push(i)}else if("log"===e){let e=Math.log(i);for(let t=1;t<3;t++)a.push(Math.exp(t*e/3));a.push(i)}else if("quantile"===e){let e=[...r].sort((e,t)=>e-t);for(let t=1;t<3;t++){let n=Math.floor(t*e.length/3);a.push(e[n])}a.push(i)}return r.forEach(e=>{for(let t=0;t<a.length;t++)if(e<=a[t]){o[t]++;break}}),{thresholds:a.map(Math.round),counts:o}}("linear",e);return[{selector:"node",style:{shape:"bottom-round-rectangle","background-color":(n=h).nodeBg,"border-color":n.nodeBorder,color:n.nodeText,label:"data(label)","text-valign":"center","text-halign":"center",width:24,height:24,padding:"12px","border-width":1,"font-size":"14px","overlay-opacity":0}},{selector:"node.isVendor",style:{"background-color":n.nodeBgVendor}},{selector:"node:childless.hushed",style:{opacity:.2}},{selector:"node.highlight-outgoer, node.highlight-incomer",style:{"border-color":(r=h).selectedRing,opacity:1}},{selector:"node:childless.highlight",style:{"background-color":r.selectedFill,color:r.selectedText,opacity:1}},{selector:"node.auditCycle",style:{"border-color":"data(auditCycleColor)","border-width":5,opacity:1,"underlay-color":"data(auditCycleColor)","underlay-opacity":.18,"underlay-padding":4,"z-index":999}},{selector:"node.isParent",style:{"font-weight":"bold"}},{selector:"node:selected",style:{"background-color":(i=h).selectedFill,"border-color":i.selectedRing,"outline-color":i.selectedRing,"outline-width":2,color:i.selectedText,"background-opacity":1,opacity:1,"overlay-opacity":0}},{selector:"node.isVendor:selected",style:{"background-color":i.selectedFillVendor}},{selector:"node:parent, node:parent:selected",style:{"background-opacity":.04,"background-color":(a=h).compoundBg,color:a.nodeText,"border-width":1,"border-opacity":.35,"border-color":a.nodeBorder,"text-valign":"top","text-margin-y":-5,padding:"16px","text-background-color":a.canvasBg,"text-background-opacity":.85,"text-background-padding":"3px","text-halign":"center","font-size":14,"font-weight":"bold","font-style":"italic",label:"data(label)"}},{selector:"node:parent.isVendor, node:parent.isVendor:selected",style:{"background-color":a.nodeBgVendor,"border-color":a.nodeBorderVendor}},{selector:"node:parent.auditCycle, node:parent.auditCycle:selected",style:{"underlay-opacity":0,"border-color":"data(auditCycleColor)","border-opacity":.8,"outline-color":"data(auditCycleColor)","outline-width":2,color:"data(auditCycleColor)"}},...(l=new Set((o=e).nodes.map(e=>e.data.id)),[...new Set(h1(new Map(o.nodes.flatMap(e=>{let{id:t,parent:n}=e.data;return"string"==typeof t&&"string"==typeof n&&l.has(n)?[[t,n]]:[]})),new Set).values())].map(e=>({selector:`node:parent[compoundFillOpacity = ${e}]`,style:{"background-opacity":e}}))),{selector:"edge",style:{"arrow-scale":1,"target-arrow-color":(c=h).edge,"target-arrow-shape":"chevron","target-arrow-fill":"filled","line-color":c.edge,"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line",opacity:1,"line-opacity":1}},{selector:"edge.hushed",style:{opacity:.04}},{selector:"edge.highlight-outgoer, edge.highlight-incomer, edge.highlight-dependency",style:{opacity:1,"line-opacity":1,width:4,"line-color":c.weightXl,"target-arrow-color":c.weightXl,"source-arrow-color":c.weightXl}},...(s=h,u=f,[{selector:"edge[weight <= 1]",style:{label:""}},{selector:`edge[weight > 1][weight <= ${u[0]}]`,style:{width:1,"line-color":s.weightXs,"target-arrow-color":s.weightXs}},{selector:`edge[weight > ${u[0]}][weight <= ${u[1]}]`,style:{width:4,"arrow-scale":2,"line-color":s.weightMd,"target-arrow-color":s.weightMd}},{selector:`edge[weight > ${u[1]}]`,style:{width:8,"line-color":s.weightXl,"target-arrow-color":s.weightXl}}]),{selector:"edge.auditCycle",style:{width:6,opacity:1,"line-opacity":1,"arrow-scale":1.5,"line-color":"data(auditCycleColor)","target-arrow-color":"data(auditCycleColor)",color:"data(auditCycleColor)",label:"data(auditCycleStep)","font-size":12,"font-weight":"bold","text-background-color":h.canvasBg,"text-background-opacity":.9,"text-background-padding":"3px","z-compound-depth":"top","z-index-compare":"manual","z-index":9999}}]}(e,n),..."breadthfirst"===(i=r)?[]:"circle"===i?[{selector:"node",style:{shape:"barrel"}},{selector:"edge",style:{}}]:"elk"===i?[{selector:"node",style:{"edge-distances":"intersection"}}]:"grid"===i?[{selector:"node",style:{shape:"rectangle"}},{selector:"edge",style:{"text-margin-x":0,"text-margin-y":0}}]:[{selector:"node",style:{}}]].map(h9))},[t.layout,t.theme,t.visibleElements]),a=(0,ne.useMemo)(()=>({...fo[t.layout]}),[t.layout]),{layout:"breadthfirst"===(n=t.layout)?"breadthfirst":"circle"===n?"circle":"elk"===n?"elk":"grid"===n?"grid":"concentric",layoutOptions:a,model:r,styles:i});return null===l.model?null:(0,t7.jsx)(fs,{...e,layout:l.layout,layoutOptions:l.layoutOptions,model:l.model,onSpacingFactorChange:o.setCytoscapeLayoutSpacing,spacingFactor:o.cytoscapeLayoutSpacing,styles:l.styles,theme:s})}function fs(e){let t=function(e){let[t,n]=(0,ne.useState)(null),r=(0,ne.useRef)(null),[i,a]=(0,ne.useState)({zoom:1,min:.5,max:2}),o=(0,ne.useRef)(e),c=e=>{let{zoom:t}=e.getViewport(),{min:n,max:r}=e.getZoomRange();a(e=>e.zoom===t&&e.min===n&&e.max===r?e:{zoom:t,min:n,max:r})};return{controller:t,handleLayoutComplete:t=>{let n=o.current!==e;o.current=e,n&&t.fit(),c(t)},handleReady:e=>{r.current=e,n(e),c(e)},handleViewportChange:()=>{null!==r.current&&c(r.current)},...i}}(e.layout),n=function(e,t){let n=(0,ne.useMemo)(()=>{let t=new Set(e.map(e=>e.parentId));return new Set(e.filter(e=>!t.has(e.id)).map(e=>e.id))},[e]),[r,i]=(0,ne.useState)({leafIds:n,interaction:{hoveredNodeId:null,selectedNodeIds:[]}});return r.leafIds!==n&&i({leafIds:n,interaction:{hoveredNodeId:null,selectedNodeIds:r.interaction.selectedNodeIds.filter(e=>n.has(e))}}),{...(0,ne.useMemo)(()=>(function(e,t,n){var r;let i,a,o,c=new Set(null===n.hoveredNodeId?n.selectedNodeIds:[n.hoveredNodeId]);if(0===c.size)return{nodes:e,edges:t};let s=(r=e.map(e=>e.id),i=new Set,a=new Set,o=t.map(e=>{let t=c.has(e.source),n=c.has(e.target);return t&&i.add(e.target),n&&a.add(e.source),ft(!1,t,n,c.size>0)}),{nodeClasses:r.map(e=>ft(c.has(e),i.has(e),a.has(e),c.size>0)),edgeClasses:o});return{nodes:e.map((e,t)=>({...e,classes:[e.classes,s.nodeClasses.at(t)].filter(Boolean).join(" ")})),edges:t.map((e,t)=>({...e,classes:[e.classes,s.edgeClasses.at(t)].filter(Boolean).join(" ")}))}})(e,t,r.interaction),[e,t,r.interaction]),handleNodeEvent:e=>{let{id:t,type:r}=e;n.has(t)&&"press"!==r&&"double-press"!==r&&i(e=>{let i=function(e,t){if("pointer-enter"===t.type)return e.hoveredNodeId===t.id?e:{...e,hoveredNodeId:t.id};if("pointer-leave"===t.type)return e.hoveredNodeId===t.id?{...e,hoveredNodeId:null}:e;let n=e.selectedNodeIds.includes(t.id);return"select"===t.type===n?e:{...e,selectedNodeIds:"select"===t.type?[...e.selectedNodeIds,t.id]:e.selectedNodeIds.filter(e=>e!==t.id)}}(e.interaction,{id:t,type:r});return i===e.interaction?e:{leafIds:n,interaction:i}})}}}(e.model.nodes,e.model.edges);return(0,t7.jsxs)("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-2 overflow-hidden px-8",children:[(0,t7.jsxs)("div",{className:"relative min-h-0 flex-1 overflow-hidden",children:[(0,t7.jsx)(hZ,{edges:n.edges,layout:e.layout,layoutOptions:e.layoutOptions,maxZoom:2,minZoom:.5,minReadableLabelSize:24,maxFitLabelSize:24,nodes:n.nodes,zoomMode:"fit-relative",sizeNodesToLabels:!0,onLayoutComplete:t.handleLayoutComplete,onNodeEvent:t=>{n.handleNodeEvent(t),"double-press"===t.type&&e.model.parentNodeIds.has(t.id)&&e.setCurrentPackage(t.id)},onReady:t.handleReady,onViewportChange:t.handleViewportChange,onSpacingFactorChange:e.onSpacingFactorChange,spacingFactor:e.spacingFactor,style:{background:h8[e.theme].canvasBg},styleRules:e.styles}),e.overlay]}),(0,t7.jsx)(fe,{controller:t.controller,maxZoom:t.max,minZoom:t.min,zoom:t.zoom})]})}function fu({currentPackage:e,cycleHighlights:t,cycleInspection:n,packageGraph:r,setCurrentPackage:i,onCloseInspection:a}){return r?(0,t7.jsx)(fc,{currentPackage:e,setCurrentPackage:i,packageGraph:r,cycleHighlights:t,overlay:null===n?null:(0,t7.jsx)(nB,{inspection:n,onClose:a})}):(0,t7.jsx)(nR,{})}let fl=na("download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);var fh=e.i(95187);let ff=(0,fh.createServerReference)("00dd67a4ba1bcf78f3cedeb701bbc3c2b232ecfe3c",fh.callServer,void 0,fh.findSourceMapURL,"downloadAuditJsonAction"),fd=(0,fh.createServerReference)("0023c8b3e427892f617b2ac6f61a5b056d50295372",fh.callServer,void 0,fh.findSourceMapURL,"downloadAuditXmlAction");function fb({children:e}){return(0,t7.jsx)("div",{className:"ml-3 border-b border-b-neutral-200 bg-white px-3 py-2 dark:border-b-neutral-800 dark:bg-neutral-900",children:e})}function fg(){return(0,t7.jsxs)("div",{className:"pt-3",children:[(0,t7.jsx)(fb,{children:(0,t7.jsx)(fw,{format:"JSON",mimeType:"application/json",onExport:ff})}),(0,t7.jsx)(fb,{children:(0,t7.jsx)(fw,{format:"XML",mimeType:"application/xml",onExport:fd})})]})}function fw({format:e,mimeType:t,onExport:n}){return(0,t7.jsxs)("button",{type:"button",onClick:async()=>{let{data:e,filename:r}=await n(),i=new Blob([e],{type:t}),a=URL.createObjectURL(i),o=document.createElement("a");o.href=a,o.download=r,o.click(),URL.revokeObjectURL(a)},className:"flex cursor-pointer items-center text-xs hover:text-blue-600 dark:hover:text-blue-400",children:[(0,t7.jsx)(fl,{size:10,className:"mr-1.5"}),(0,t7.jsx)("span",{children:e})]})}let fp=na("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);var fv=e.i(74080);function fm(e,[t,n]){return Math.min(n,Math.max(t,e))}(0,Object.defineProperty)(fm,"name",{value:"clamp",configurable:!0});var fy=Object.defineProperty,fk=(e,t)=>fy(e,"name",{value:t,configurable:!0}),fx=!!("u">typeof window&&window.document&&window.document.createElement);function fE(e,t,{checkForDefaultPrevented:n=!0}={}){return fk(function(r){if(e?.(r),!1===n||!r||!r.defaultPrevented)return t?.(r)},"handleEvent")}function fS(e){if(!fx)throw Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}function fT(e){return"IFRAME"===e.tagName}fk(fE,"composeEventHandlers"),fk(function(e){if(!fx)throw Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window},"getOwnerWindow"),fk(fS,"getOwnerDocument"),fk(function e(t,n=!1){let{activeElement:r}=fS(t);if(!r?.nodeName)return null;if(fT(r)&&r.contentDocument)return e(r.contentDocument.body,n);if(n){let e=r.getAttribute("aria-activedescendant");if(e){let t=fS(r).getElementById(e);if(t)return t}}return r},"getActiveElement"),fk(fT,"isFrame");var fC=Object.defineProperty,fM=(e,t)=>fC(e,"name",{value:t,configurable:!0});function fP(e,t=[]){let n=[];function r(t,r){let i=ne.createContext(r);i.displayName=t+"Context";let a=n.length;n=[...n,r];let o=fM(t=>{let{scope:n,children:r,...o}=t,c=n?.[e]?.[a]||i,s=ne.useMemo(()=>o,Object.values(o));return(0,t7.jsx)(c.Provider,{value:s,children:r})},"Provider");function c(n,o,s={}){let{optional:u=!1}=s,l=o?.[e]?.[a]||i,h=ne.useContext(l);if(h)return h;if(void 0!==r)return r;if(!u)throw Error(`\`${n}\` must be used within \`${t}\``)}return o.displayName=t+"Provider",fM(c,"useContext"),[o,c]}fM(r,"createContext");let i=fM(()=>{let t=n.map(e=>ne.createContext(e));return fM(function(n){let r=n?.[e]||t;return ne.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},"useScope")},"createScope");return i.scopeName=e,[r,fj(i,...t)]}function fj(...e){let t=e[0];if(1===e.length)return t;let n=fM(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return fM(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return ne.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}fM(function(e,t){let n=ne.createContext(t);n.displayName=e+"Context";let r=fM(e=>{let{children:t,...r}=e,i=ne.useMemo(()=>r,Object.values(r));return(0,t7.jsx)(n.Provider,{value:i,children:t})},"Provider");function i(r,a={}){let{optional:o=!1}=a,c=ne.useContext(n);if(c)return c;if(void 0!==t)return t;if(!o)throw Error(`\`${r}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",fM(i,"useContext"),[r,i]},"createContext"),fM(fP,"createContextScope"),fM(fj,"composeContextScopes");var fI=Object.defineProperty,fA=(e,t)=>fI(e,"name",{value:t,configurable:!0});function fO(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function fN(...e){return t=>{let n=!1,r=e.map(e=>{let r=fO(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];"function"==typeof n?n():fO(e[t],null)}}}}function fL(...e){return ne.useCallback(fN(...e),e)}fA(fO,"setRef"),fA(fN,"composeRefs"),fA(fL,"useComposedRefs");var fD=Object.defineProperty,fR=(e,t)=>fD(e,"name",{value:t,configurable:!0});function f_(e){let t=ne.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,c=[];fV(r)&&"function"==typeof fX&&(r=fX(r._payload)),ne.Children.forEach(r,e=>{if(fH(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;fV(t)&&"function"==typeof fX&&(t=fX(t._payload)),a=fF(e,t),c.push(a?.props?.children)}else c.push(e)}),a?a=ne.cloneElement(a,void 0,c):!o&&1===ne.Children.count(r)&&ne.isValidElement(r)&&(a=r);let s=a?fK(a):void 0,u=fL(n,s);if(!a){if(r||0===r)throw Error(o?fG(e):fq(e));return r}let l=f$(i,a.props??{});return a.type!==ne.Fragment&&(l.ref=n?u:s),ne.cloneElement(a,l)});return t.displayName=`${e}.Slot`,t}fR(f_,"createSlot");var fB=Symbol.for("radix.slottable");fR(function(e){let t=fR(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=fB,t},"createSlottable");var fF=fR((e,t)=>{if("child"in e.props){let t=e.props.child;return ne.isValidElement(t)?ne.cloneElement(t,void 0,e.props.children(t.props.children)):null}return ne.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function f$(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):"style"===r?n[r]={...i,...a}:"className"===r&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function fK(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(n=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function fH(e){return ne.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===fB}fR(f$,"mergeProps"),fR(fK,"getElementRef"),fR(fH,"isSlottable");var fz=Symbol.for("react.lazy");function fV(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===fz&&"_payload"in e&&fU(e._payload)}function fU(e){return"object"==typeof e&&null!==e&&"then"in e}fR(fV,"isLazyComponent"),fR(fU,"isPromiseLike");var fq=fR(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),fG=fR(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),fX=ne[" use ".trim().toString()],fW=Object.defineProperty,fY=(e,t)=>fW(e,"name",{value:t,configurable:!0});function fQ(e){let t=e+"CollectionProvider",[n,r]=fP(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=fY(e=>{let{scope:t,children:n}=e,r=ne.useRef(null),a=ne.useRef(new Map).current;return(0,t7.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},"CollectionProvider");o.displayName=t;let c=e+"CollectionSlot",s=f_(c),u=ne.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=fL(t,a(c,n).collectionRef);return(0,t7.jsx)(s,{ref:i,children:r})});u.displayName=c;let l=e+"CollectionItemSlot",h="data-radix-collection-item",f=f_(l),d=ne.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=ne.useRef(null),c=fL(t,o),s=a(l,n);return ne.useEffect(()=>(s.itemMap.set(o,{ref:o,...i}),()=>void s.itemMap.delete(o))),(0,t7.jsx)(f,{...{[h]:""},ref:c,children:r})});function b(t){let n=a(e+"CollectionConsumer",t);return ne.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${h}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return d.displayName=l,fY(b,"useCollection"),[{Provider:o,Slot:u,ItemSlot:d},b,r]}fY(fQ,"createCollection");var fJ=new WeakMap,fZ=class e extends Map{static{fY(this,"OrderedDict")}#e;constructor(e){super(e),this.#e=[...super.keys()],fJ.set(this,!0)}set(e,t){return fJ.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r,i=this.has(t),a=this.#e.length,o=f2(e),c=o>=0?o:a+o,s=c<0||c>=a?-1:c;if(s===this.size||i&&s===this.size-1||-1===s)return this.set(t,n),this;let u=this.size+ +!i;o<0&&c++;let l=[...this.#e],h=!1;for(let e=c;e<u;e++)if(c===e){let a=l[e];l[e]===t&&(a=l[e+1]),i&&this.delete(t),r=this.get(a),this.set(t,n)}else{h||l[e-1]!==t||(h=!0);let n=l[h?e:e-1],i=r;r=this.get(n),this.delete(n),this.set(n,i)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return -1===r?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return -1===r?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=f1(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=f1(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return f1(this.#e,e)}from(e,t){let n=this.indexOf(e);if(-1===n)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(-1===n)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return -1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=0===r&&1===e.length?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&1===e.length?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(void 0===t)return r;t<0&&(t+=this.size),void 0!==n&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function f1(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let n=f0(e,t);return -1===n?void 0:e[n]}function f0(e,t){let n=e.length,r=f2(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}function f2(e){return e!=e||0===e?0:Math.trunc(e)}function f3(e,t){if(e===t)return!0;if("object"!=typeof e||"object"!=typeof t||null==e||null==t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}function f4(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function f5(e,t){return e[1].element&&t[1].element?f4(e[1].element,t[1].element)?-1:1:0}function f6(e){return new MutationObserver(t=>{for(let n of t)if("childList"===n.type)return void e()})}fY(f1,"at"),fY(f0,"toSafeIndex"),fY(f2,"toSafeInteger"),fY(function(e){let t=e+"CollectionProvider",[n,r]=fP(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new fZ,setItemMap:fY(()=>void 0,"setItemMap")}),o=fY(({state:e,...t})=>e?(0,t7.jsx)(s,{...t,state:e}):(0,t7.jsx)(c,{...t}),"CollectionProvider");o.displayName=t;let c=fY(e=>{let t=g();return(0,t7.jsx)(s,{...e,state:t})},"CollectionInit");c.displayName=t+"Init";let s=fY(e=>{let{scope:t,children:n,state:r}=e,a=ne.useRef(null),[o,c]=ne.useState(null),s=fL(a,c),[u,l]=r;return ne.useEffect(()=>{if(!o)return;let e=f6(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,t7.jsx)(i,{scope:t,itemMap:u,setItemMap:l,collectionRef:s,collectionRefObject:a,collectionElement:o,children:n})},"CollectionProviderImpl");s.displayName=t+"Impl";let u=e+"CollectionSlot",l=f_(u),h=ne.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=fL(t,a(u,n).collectionRef);return(0,t7.jsx)(l,{ref:i,children:r})});h.displayName=u;let f=e+"CollectionItemSlot",d=f_(f),b=ne.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=ne.useRef(null),[c,s]=ne.useState(null),u=fL(t,o,s),{setItemMap:l}=a(f,n),h=ne.useRef(i);f3(h.current,i)||(h.current=i);let b=h.current;return ne.useEffect(()=>(l(e=>c?e.has(c)?e.set(c,{...b,element:c}).toSorted(f5):(e.set(c,{...b,element:c}),e.toSorted(f5)):e),()=>{l(e=>c&&e.has(c)?(e.delete(c),new fZ(e)):e)}),[c,b,l]),(0,t7.jsx)(d,{"data-radix-collection-item":"",ref:u,children:r})});function g(){return ne.useState(new fZ)}function w(t){let{itemMap:n}=a(e+"CollectionConsumer",t);return n}return b.displayName=f,fY(g,"useInitCollection"),fY(w,"useCollection"),[{Provider:o,Slot:h,ItemSlot:b},{createCollectionScope:r,useCollection:w,useInitCollection:g}]},"createCollection"),fY(f3,"shallowEqual"),fY(f4,"isElementPreceding"),fY(f5,"sortByDocumentPosition"),fY(f6,"getChildListObserver");var f8=Object.defineProperty,f9=ne.createContext(void 0);function f7(e){let t=ne.useContext(f9);return e||t||"ltr"}f8(f7,"name",{value:"useDirection",configurable:!0});var de=Object.defineProperty,dt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=f_(`Primitive.${t}`),r=ne.forwardRef((e,r)=>{let{asChild:i,...a}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t7.jsx)(i?n:t,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function dn(e,t){e&&fv.flushSync(()=>e.dispatchEvent(t))}function dr(e){let t=ne.useRef(e);return ne.useEffect(()=>{t.current=e}),ne.useMemo(()=>(...e)=>t.current?.(...e),[])}de(dn,"name",{value:"dispatchDiscreteCustomEvent",configurable:!0}),(0,Object.defineProperty)(dr,"name",{value:"useCallbackRef",configurable:!0});var di=Object.defineProperty,da=(e,t)=>di(e,"name",{value:t,configurable:!0}),dc="dismissableLayer.update",ds=ne.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),du=ne.forwardRef(da(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:c,onDismiss:s,...u}=e,l=ne.useContext(ds),[h,f]=ne.useState(null),d=h?.ownerDocument??globalThis?.document,[,b]=ne.useState({}),g=fL(t,f),w=Array.from(l.layers),[p]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=p?w.indexOf(p):-1,y=h?w.indexOf(h):-1,k=l.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,E=ne.useRef(!1),S=dh(e=>{a?.(e),c?.(e),e.defaultPrevented||s?.()},{ownerDocument:d,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:E,dismissableSurfaces:l.dismissableSurfaces,shouldHandlePointerDownOutside:ne.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...l.branches].some(t=>t.contains(e));return x&&!t},[l.branches,x])}),T=df(e=>{if(r&&E.current)return;let t=e.target;![...l.branches].some(e=>e.contains(t))&&(o?.(e),c?.(e),e.defaultPrevented||s?.())},d),C=!!h&&y===w.length-1,M=dr(e=>{"Escape"===e.key&&(i?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))});return ne.useEffect(()=>{if(C)return d.addEventListener("keydown",M,{capture:!0}),()=>d.removeEventListener("keydown",M,{capture:!0})},[d,C,M]),ne.useEffect(()=>{if(h)return n&&(0===l.layersWithOutsidePointerEventsDisabled.size&&(t8=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(h)),l.layers.add(h),dd(),()=>{n&&(l.layersWithOutsidePointerEventsDisabled.delete(h),0===l.layersWithOutsidePointerEventsDisabled.size&&(d.body.style.pointerEvents=t8))}},[h,d,n,l]),ne.useEffect(()=>()=>{h&&(l.layers.delete(h),l.layersWithOutsidePointerEventsDisabled.delete(h),dd())},[h,l]),ne.useEffect(()=>{let e=da(()=>b({}),"handleUpdate");return document.addEventListener(dc,e),()=>document.removeEventListener(dc,e)},[]),(0,t7.jsx)(dt.div,{...u,ref:g,style:{pointerEvents:k?x?"auto":"none":void 0,...e.style},onFocusCapture:fE(e.onFocusCapture,T.onFocusCapture),onBlurCapture:fE(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:fE(e.onPointerDownCapture,S.onPointerDownCapture)})},"DismissableLayer"));da(function(){let e=ne.useContext(ds),[t,n]=ne.useState(null);return ne.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n},"useDismissableLayerSurface");var dl=da(()=>!0,"IS_TRUE");function dh(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=dl}=t,c=dr(e),s=ne.useRef(!1),u=ne.useRef(!1),l=ne.useRef(new Map),h=ne.useRef(()=>{});return ne.useEffect(()=>{function e(){u.current=!1,i.current=!1,l.current.clear()}function t(){return Array.from(l.current.values()).some(Boolean)}function f(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||l.current.set(e.type,!0),"click"===e.type&&window.setTimeout(()=>{u.current&&h.current()},0)}function d(e){u.current&&l.current.set(e.type,!1)}da(e,"resetOutsideInteraction"),da(t,"isOutsideInteractionIntercepted"),da(f,"handleInteractionCapture"),da(d,"handleInteractionBubble");let b=da(a=>{if(a.target&&!s.current){let f=function(){n.removeEventListener("click",h.current);let r=t();e(),r||db("dismissableLayer.pointerDownOutside",c,d,{discrete:!0})};if(da(f,"handleAndDispatchPointerDownOutsideEvent"),!o(a.target)){n.removeEventListener("click",h.current),e(),s.current=!1;return}let d={originalEvent:a};u.current=!0,i.current=r&&0===a.button,l.current.clear(),r&&0===a.button?(n.removeEventListener("click",h.current),h.current=f,n.addEventListener("click",h.current,{once:!0})):f()}else n.removeEventListener("click",h.current),e();s.current=!1},"handlePointerDown"),g=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let e of g)n.addEventListener(e,f,!0),n.addEventListener(e,d);let w=window.setTimeout(()=>{n.addEventListener("pointerdown",b)},0);return()=>{for(let e of(window.clearTimeout(w),n.removeEventListener("pointerdown",b),n.removeEventListener("click",h.current),g))n.removeEventListener(e,f,!0),n.removeEventListener(e,d)}},[n,c,r,i,a,o]),{onPointerDownCapture:da(()=>s.current=!0,"onPointerDownCapture")}}function df(e,t=globalThis?.document){let n=dr(e),r=ne.useRef(!1);return ne.useEffect(()=>{let e=da(e=>{e.target&&!r.current&&db("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:da(()=>r.current=!0,"onFocusCapture"),onBlurCapture:da(()=>r.current=!1,"onBlurCapture")}}function dd(){let e=new CustomEvent(dc);document.dispatchEvent(e)}function db(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?dn(i,a):i.dispatchEvent(a)}da(dh,"usePointerDownOutside"),da(df,"useFocusOutside"),da(dd,"dispatchUpdate"),da(db,"handleAndDispatchCustomEvent");var dg=Object.defineProperty,dw=(e,t)=>dg(e,"name",{value:t,configurable:!0}),dp=0,dv=null;function dm(){ne.useEffect(()=>{dv||(dv={start:dy(),end:dy()});let{start:e,end:t}=dv;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),dp++,()=>{1===dp&&(dv?.start.remove(),dv?.end.remove(),dv=null),dp=Math.max(0,dp-1)}},[])}function dy(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}dw(function(e){return dm(),e.children},"FocusGuards"),dw(dm,"useFocusGuards"),dw(dy,"createFocusGuard");var dk=Object.defineProperty,dx=(e,t)=>dk(e,"name",{value:t,configurable:!0}),dE="focusScope.autoFocusOnMount",dS="focusScope.autoFocusOnUnmount",dT={bubbles:!1,cancelable:!0},dC=ne.forwardRef(dx(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[c,s]=ne.useState(null),u=dr(i),l=dr(a),h=ne.useRef(null),f=fL(t,s),d=ne.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;ne.useEffect(()=>{if(r){let e=function(e){if(d.paused||!c)return;let t=e.target;c.contains(t)?h.current=t:dN(h.current,{select:!0})},t=function(e){if(d.paused||!c)return;let t=e.relatedTarget;null!==t&&(c.contains(t)||dN(h.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&dN(c)};dx(e,"handleFocusIn"),dx(t,"handleFocusOut"),dx(n,"handleMutations"),document.addEventListener("focusin",e),document.addEventListener("focusout",t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[r,c,d.paused]),ne.useEffect(()=>{if(c){dL.add(d);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(dE,dT);c.addEventListener(dE,u),c.dispatchEvent(t),t.defaultPrevented||(dM(d_(dj(c)),{select:!0}),document.activeElement===e&&dN(c))}return()=>{c.removeEventListener(dE,u),setTimeout(()=>{let t=new CustomEvent(dS,dT);c.addEventListener(dS,l),c.dispatchEvent(t),t.defaultPrevented||dN(e??document.body,{select:!0}),c.removeEventListener(dS,l),dL.remove(d)},0)}}},[c,u,l,d]);let b=ne.useCallback(e=>{if(!n&&!r||d.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=dP(t);r&&a?e.shiftKey||i!==a?e.shiftKey&&i===r&&(e.preventDefault(),n&&dN(a,{select:!0})):(e.preventDefault(),n&&dN(r,{select:!0})):i===t&&e.preventDefault()}},[n,r,d.paused]);return(0,t7.jsx)(dt.div,{tabIndex:-1,...o,ref:f,onKeyDown:b})},"FocusScope"));function dM(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(dN(r,{select:t}),document.activeElement!==n)return}function dP(e){let t=dj(e);return[dI(t,e),dI(t.reverse(),e)]}function dj(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:dx(e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}function dI(e,t){let n="function"==typeof t.checkVisibility&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):dA(r,{upTo:t})))return r}function dA(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function dO(e){return e instanceof HTMLInputElement&&"select"in e}function dN(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&dO(e)&&t&&e.select()}}dx(dM,"focusFirst"),dx(dP,"getTabbableEdges"),dx(dj,"getTabbableCandidates"),dx(dI,"findVisible"),dx(dA,"isHidden"),dx(dO,"isSelectableInput"),dx(dN,"focus");var dL=dD();function dD(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),(e=dR(e,t)).unshift(t)},remove(t){e=dR(e,t),e[0]?.resume()}}}function dR(e,t){let n=[...e],r=n.indexOf(t);return -1!==r&&n.splice(r,1),n}function d_(e){return e.filter(e=>"A"!==e.tagName)}dx(dD,"createFocusScopesStack"),dx(dR,"arrayRemove"),dx(d_,"removeLinks");var dB=globalThis?.document?ne.useLayoutEffect:()=>{},dF=Object.defineProperty,d$=ne[" useId ".trim().toString()]||(()=>void 0),dK=0;function dH(e){let[t,n]=ne.useState(d$());return dB(()=>{e||n(e=>e??String(dK++))},[e]),e||(t?`radix-${t}`:"")}dF(dH,"name",{value:"useId",configurable:!0});let dz=["top","right","bottom","left"],dV=Math.min,dU=Math.max,dq=Math.round,dG=Math.floor,dX=e=>({x:e,y:e}),dW={left:"right",right:"left",bottom:"top",top:"bottom"};function dY(e,t){return"function"==typeof e?e(t):e}function dQ(e){return e.split("-")[0]}function dJ(e){return e.split("-")[1]}function dZ(e){return"x"===e?"y":"x"}function d1(e){return"y"===e?"height":"width"}function d0(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function d2(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let d3=["left","right"],d4=["right","left"],d5=["top","bottom"],d6=["bottom","top"];function d8(e){let t=dQ(e);return dW[t]+e.slice(t.length)}function d9(e){var t,n,r,i;return"number"!=typeof e?{top:null!=(t=e.top)?t:0,right:null!=(n=e.right)?n:0,bottom:null!=(r=e.bottom)?r:0,left:null!=(i=e.left)?i:0}:{top:e,right:e,bottom:e,left:e}}function d7(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function be(e,t,n){let r,{reference:i,floating:a}=e,o=d0(t),c=dZ(d0(t)),s=d1(c),u=dQ(t),l=i.x+i.width/2-a.width/2,h=i.y+i.height/2-a.height/2,f=i[s]/2-a[s]/2;switch(u){case"top":r={x:l,y:i.y-a.height};break;case"bottom":r={x:l,y:i.y+i.height};break;case"right":r={x:i.x+i.width,y:h};break;case"left":r={x:i.x-a.width,y:h};break;default:r={x:i.x,y:i.y}}let d=dJ(t);return d&&(r[c]+=f*("end"===d?1:-1)*(n&&"y"===o?-1:1)),r}async function bt(e,t){var n;void 0===t&&(t={});let{x:r,y:i,platform:a,rects:o,elements:c,strategy:s}=e,{boundary:u="clippingAncestors",rootBoundary:l="viewport",elementContext:h="floating",altBoundary:f=!1,padding:d=0}=dY(t,e),b=d9(d),g=c[f?"floating"===h?"reference":"floating":h],w=d7(await a.getClippingRect({element:null==(n=await (null==a.isElement?void 0:a.isElement(g)))||n?g:g.contextElement||await (null==a.getDocumentElement?void 0:a.getDocumentElement(c.floating)),boundary:u,rootBoundary:l,strategy:s})),p="floating"===h?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,v=await (null==a.getOffsetParent?void 0:a.getOffsetParent(c.floating)),y=await (null==a.isElement?void 0:a.isElement(v))&&await (null==a.getScale?void 0:a.getScale(v))||{x:1,y:1},k=d7(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:p,offsetParent:v,strategy:s}):p);return{top:(w.top-k.top+b.top)/y.y,bottom:(k.bottom-w.bottom+b.bottom)/y.y,left:(w.left-k.left+b.left)/y.x,right:(k.right-w.right+b.right)/y.x}}let bn=async(e,t,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,c=o.detectOverflow?o:{...o,detectOverflow:bt},s=await (null==o.isRTL?void 0:o.isRTL(t)),u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:l,y:h}=be(u,r,s),f=r,d=0,b={};for(let n=0;n<a.length;n++){let g=a[n];if(!g)continue;let{name:w,fn:p}=g,{x:v,y:y,data:k,reset:x}=await p({x:l,y:h,initialPlacement:r,placement:f,strategy:i,middlewareData:b,rects:u,platform:c,elements:{reference:e,floating:t}});l=null!=v?v:l,h=null!=y?y:h,b[w]={...b[w],...k},x&&d<50&&(d++,"object"==typeof x&&(x.placement&&(f=x.placement),x.rects&&(u=!0===x.rects?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:l,y:h}=be(u,f,s)),n=-1)}return{x:l,y:h,placement:f,strategy:i,middlewareData:b}};function br(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bi(e){return dz.some(t=>e[t]>=0)}let ba=new Set(["left","top"]);async function bo(e,t){let{placement:n,platform:r,elements:i}=e,a=await (null==r.isRTL?void 0:r.isRTL(i.floating)),o=dQ(n),c=dJ(n),s="y"===d0(n),u=ba.has(o)?-1:1,l=a&&s?-1:1,h=dY(t,e),{mainAxis:f,crossAxis:d,alignmentAxis:b}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&"number"==typeof b&&(d="end"===c?-1*b:b),s?{x:d*l,y:f*u}:{x:f*u,y:d*l}}function bc(){return"u">typeof window}function bs(e){return bh(e)?(e.nodeName||"").toLowerCase():"#document"}function bu(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function bl(e){var t;return null==(t=(bh(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function bh(e){return!!bc()&&(e instanceof Node||e instanceof bu(e).Node)}function bf(e){return!!bc()&&(e instanceof Element||e instanceof bu(e).Element)}function bd(e){return!!bc()&&(e instanceof HTMLElement||e instanceof bu(e).HTMLElement)}function bb(e){return!(!bc()||"u"<typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof bu(e).ShadowRoot)}function bg(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=bE(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==i&&"contents"!==i}function bw(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}let bp=/transform|translate|scale|rotate|perspective|filter/,bv=/paint|layout|strict|content/,bm=e=>!!e&&"none"!==e;function by(e){let t=bf(e)?bE(e):e;return bm(t.transform)||bm(t.translate)||bm(t.scale)||bm(t.rotate)||bm(t.perspective)||!bk()&&(bm(t.backdropFilter)||bm(t.filter))||bp.test(t.willChange||"")||bv.test(t.contain||"")}function bk(){return null==t&&(t="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),t}function bx(e){return/^(html|body|#document)$/.test(bs(e))}function bE(e){return bu(e).getComputedStyle(e)}function bS(e){return bf(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bT(e){if("html"===bs(e))return e;let t=e.assignedSlot||e.parentNode||bb(e)&&e.host||bl(e);return bb(t)?t.host:t}function bC(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);let i=function e(t){let n=bT(t);return bx(n)?(t.ownerDocument||t).body:bd(n)&&bg(n)?n:e(n)}(e),a=i===(null==(r=e.ownerDocument)?void 0:r.body),o=bu(i);if(!a)return t.concat(i,bC(i,[],n));{let e=bM(o);return t.concat(o,o.visualViewport||[],bg(i)?i:[],e&&n?bC(e):[])}}function bM(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bP(e){let t=bE(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=bd(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,c=dq(n)!==a||dq(r)!==o;return c&&(n=a,r=o),{width:n,height:r,$:c}}function bj(e){return bf(e)?e:e.contextElement}function bI(e){let t=bj(e);if(!bd(t))return dX(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=bP(t),o=(a?dq(n.width):n.width)/r,c=(a?dq(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),c&&Number.isFinite(c)||(c=1),{x:o,y:c}}let bA=dX(0);function bO(e){let t=bu(e);return bk()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:bA}function bN(e,t,n,r){var i;void 0===t&&(t=!1),void 0===n&&(n=!1);let a=e.getBoundingClientRect(),o=bj(e),c=dX(1);t&&(r?bf(r)&&(c=bI(r)):c=bI(e));let s=(void 0===(i=n)&&(i=!1),r&&i&&r===bu(o))?bO(o):dX(0),u=(a.left+s.x)/c.x,l=(a.top+s.y)/c.y,h=a.width/c.x,f=a.height/c.y;if(o&&r){let e=bu(o),t=bf(r)?bu(r):r,n=e,i=bM(n);for(;i&&t!==n;){let e=bI(i),t=i.getBoundingClientRect(),r=bE(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;u*=e.x,l*=e.y,h*=e.x,f*=e.y,u+=a,l+=o,i=bM(n=bu(i))}}return d7({width:h,height:f,x:u,y:l})}function bL(e,t){let n=bS(e).scrollLeft;return t?t.left+n:bN(bl(e)).left+n}function bD(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-bL(e,n),y:n.top+t.scrollTop}}function bR(e,t,n){var r;let i;if("viewport"===t||"layoutViewport"===t)i=function(e,t,n){void 0===n&&(n="viewport");let r="layoutViewport"===n,i=bu(e),a=bl(e),o=i.visualViewport,c=a.clientWidth,s=a.clientHeight,u=0,l=0;if(o){let e=!bk()||"fixed"===t;r?e||(u=-o.offsetLeft,l=-o.offsetTop):(c=o.width,s=o.height,e&&(u=o.offsetLeft,l=o.offsetTop))}if(0>=bL(a)){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o="stable both-edges"===getComputedStyle(a).scrollbarGutter?i/2:i;o<=25&&(c-=o)}return{width:c,height:s,x:u,y:l}}(e,n,t);else if("document"===t){let t,n,a,o,c,s;t=bS(r=bl(e)),n=r.ownerDocument.body,a=dU(r.scrollWidth,r.clientWidth,n.scrollWidth,n.clientWidth),o=dU(r.scrollHeight,r.clientHeight,n.scrollHeight,n.clientHeight),c=-t.scrollLeft+bL(r),s=-t.scrollTop,"rtl"===bE(n).direction&&(c+=dU(r.clientWidth,n.clientWidth)-a),i={width:a,height:o,x:c,y:s}}else if(bf(t)){let e,r,a,o,c,s;r=(e=bN(t,!0,"fixed"===n)).top+t.clientTop,a=e.left+t.clientLeft,o=bI(t),c=t.clientWidth*o.x,s=t.clientHeight*o.y,i={width:c,height:s,x:a*o.x,y:r*o.y}}else{let n=bO(e);i={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return d7(i)}function b_(e){return"static"===bE(e).position}function bB(e,t){if(!bd(e)||"fixed"===bE(e).position)return null;if(t)return t(e);let n=e.offsetParent;return bl(e)===n&&(n=n.ownerDocument.body),n}function bF(e,t){var n;let r=bu(e);if(bw(e))return r;if(!bd(e)){let t=bT(e);for(;t&&!bx(t);){if(bf(t)&&!b_(t))return t;t=bT(t)}return r}let i=bB(e,t);for(;i&&(n=i,/^(table|td|th)$/.test(bs(n)))&&b_(i);)i=bB(i,t);return i&&bx(i)&&b_(i)&&!by(i)?r:i||function(e){let t=bT(e);for(;bd(t)&&!bx(t);){if(by(t))return t;if(bw(t))break;t=bT(t)}return null}(e)||r}let b$=async function(e){let t=this.getOffsetParent||bF,n=this.getDimensions,r=await n(e.floating);return{reference:function(e,t,n){let r=bd(t),i=bl(t),a="fixed"===n,o=bN(e,!0,a,t),c={scrollLeft:0,scrollTop:0},s=dX(0);if((r||!a)&&(("body"!==bs(t)||bg(i))&&(c=bS(t)),r)){let e=bN(t,!0,a,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}!r&&i&&(s.x=bL(i));let u=!i||r||a?dX(0):bD(i,c);return{x:o.left+c.scrollLeft-s.x-u.x,y:o.top+c.scrollTop-s.y-u.y,width:o.width,height:o.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},bK={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a="fixed"===i,o=bl(r),c=!!t&&bw(t.floating);if(r===o||c&&a)return n;let s={scrollLeft:0,scrollTop:0},u=dX(1),l=dX(0),h=bd(r);if((h||!a)&&(("body"!==bs(r)||bg(o))&&(s=bS(r)),h)){let e=bN(r);u=bI(r),l.x=e.x+r.clientLeft,l.y=e.y+r.clientTop}let f=!o||h||a?dX(0):bD(o,s);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-s.scrollLeft*u.x+l.x+f.x,y:n.y*u.y-s.scrollTop*u.y+l.y+f.y}},getDocumentElement:bl,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[..."clippingAncestors"===n?bw(t)?[]:function(e,t){let n=t.get(e);if(n)return n;let r=bC(e,[],!1).filter(e=>bf(e)&&"body"!==bs(e)),i=null,a="fixed"===bE(e).position,o=a?bT(e):e;for(;bf(o)&&!bx(o);){let e=bE(o),t=by(o),n=i?i.position:a?"fixed":"";t||"fixed"!==n&&("absolute"!==n||"static"!==e.position)?i=e:r=r.filter(e=>e!==o),o=bT(o)}return t.set(e,r),r}(t,this._c):[].concat(n),r],o=bR(t,a[0],i),c=o.top,s=o.right,u=o.bottom,l=o.left;for(let e=1;e<a.length;e++){let n=bR(t,a[e],i);c=dU(n.top,c),s=dV(n.right,s),u=dV(n.bottom,u),l=dU(n.left,l)}return{width:s-l,height:u-c,x:l,y:c}},getOffsetParent:bF,getElementRects:b$,getClientRects:function(e){return e.getClientRects?Array.from(e.getClientRects()):[]},getDimensions:function(e){let{width:t,height:n}=bP(e);return{width:t,height:n}},getScale:bI,isElement:bf,isRTL:function(e){return"rtl"===bE(e).direction}};function bH(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}let bz=e=>({name:"arrow",options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:c,middlewareData:s}=t,{element:u,padding:l=0}=dY(e,t)||{};if(null==u)return{};let h=d9(l),f={x:n,y:r},d=dZ(d0(i)),b=d1(d),g=await o.getDimensions(u),w="y"===d,p=w?"clientHeight":"clientWidth",v=a.reference[b]+a.reference[d]-f[d]-a.floating[b],y=f[d]-a.reference[d],k=await (null==o.getOffsetParent?void 0:o.getOffsetParent(u)),x=k?k[p]:0;x&&await (null==o.isElement?void 0:o.isElement(k))||(x=c.floating[p]||a.floating[b]);let E=x/2-g[b]/2-1,S=dV(h[w?"top":"left"],E),T=dV(h[w?"bottom":"right"],E),C=x-g[b]-T,M=x/2-g[b]/2+(v/2-y/2),P=dU(S,dV(M,C)),j=!s.arrow&&null!=dJ(i)&&M!==P&&a.reference[b]/2-(M<S?S:T)-g[b]/2<0,I=j?M<S?M-S:M-C:0;return{[d]:f[d]+I,data:{[d]:P,centerOffset:M-P-I,...j&&{alignmentOffset:I}},reset:j}}});var bV="u">typeof document?ne.useLayoutEffect:function(){};function bU(e,t){let n,r,i;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(r=n;0!=r--;)if(!bU(e[r],t[r]))return!1;return!0}if((n=(i=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!({}).hasOwnProperty.call(t,i[r]))return!1;for(r=n;0!=r--;){let n=i[r];if(("_owner"!==n||!e.$$typeof)&&!bU(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function bq(e){return"u"<typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bG(e,t){let n=bq(e);return Math.round(t*n)/n}function bX(e){let t=ne.useRef(e);return bV(()=>{t.current=e}),t}var bW=Object.defineProperty,bY=ne.forwardRef(bW(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,t7.jsx)(dt.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:(0,t7.jsx)("polygon",{points:"0,0 30,0 15,10"})})},"name",{value:"Arrow",configurable:!0}));function bQ(e){let[t,n]=ne.useState(void 0);return dB(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,i;if(!Array.isArray(t)||!t.length)return;let a=t[0];if("borderBoxSize"in a){let e=a.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,i=t.blockSize}else r=e.offsetWidth,i=e.offsetHeight;n({width:r,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}(0,Object.defineProperty)(bQ,"name",{value:"useSize",configurable:!0});var bJ=Object.defineProperty,bZ=(e,t)=>bJ(e,"name",{value:t,configurable:!0}),b1="Popper",[b0,b2]=fP(b1),[b3,b4]=b0(b1),b5=bZ(e=>{let{__scopePopper:t,children:n}=e,[r,i]=ne.useState(null),[a,o]=ne.useState(void 0);return(0,t7.jsx)(b3,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},"Popper"),b6=ne.forwardRef(bZ(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=b4("PopperAnchor",n),o=ne.useRef(null),c=a.onAnchorChange,s=fL(t,ne.useCallback(e=>{o.current=e,e&&c(e)},[c])),u=ne.useRef(null);ne.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&c(u.current)});let l=a.placementState&&ga(a.placementState),h=l?.[0],f=l?.[1];return r?null:(0,t7.jsx)(dt.div,{"data-radix-popper-side":h,"data-radix-popper-align":f,...i,ref:s})},"PopperAnchor")),b8="PopperContent",[b9,b7]=b0(b8),ge=ne.forwardRef(bZ(function(e,t){var n,r,i,a,o,c,s,u,l,h,f,d,b;let g,w,p,v,y,k,{__scopePopper:x,side:E="bottom",sideOffset:S=0,align:T="center",alignOffset:C=0,arrowPadding:M=0,avoidCollisions:P=!0,collisionBoundary:j=[],collisionPadding:I=0,sticky:A="partial",hideWhenDetached:O=!1,updatePositionStrategy:N="optimized",onPlaced:L,...D}=e,R=b4(b8,x),[_,B]=ne.useState(null),F=fL(t,B),[$,K]=ne.useState(null),H=bQ($),z=H?.width??0,V=H?.height??0,U="number"==typeof I?I:{top:0,right:0,bottom:0,left:0,...I},q=Array.isArray(j)?j:[j],G=q.length>0,X={padding:U,boundary:q.filter(gr),altBoundary:G},{refs:W,floatingStyles:Y,placement:Q,isPositioned:J,middlewareData:Z}=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:c=!0,whileElementsMounted:s,open:u}=e,[l,h]=ne.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,d]=ne.useState(r);bU(f,r)||d(r);let[b,g]=ne.useState(null),[w,p]=ne.useState(null),v=ne.useCallback(e=>{e!==E.current&&(E.current=e,g(e))},[]),y=ne.useCallback(e=>{e!==S.current&&(S.current=e,p(e))},[]),k=a||b,x=o||w,E=ne.useRef(null),S=ne.useRef(null),T=ne.useRef(l),C=null!=s,M=bX(s),P=bX(i),j=bX(u),I=ne.useCallback(()=>{var e,r;let i,a,o;if(!E.current||!S.current)return;let c={placement:t,strategy:n,middleware:f};P.current&&(c.platform=P.current),(e=E.current,r=S.current,i=new Map,a=null!=c?c:{},o={...bK,...a.platform,_c:i},bn(e,r,{...a,platform:o})).then(e=>{let t={...e,isPositioned:!1!==j.current};A.current&&!bU(T.current,t)&&(T.current=t,fv.flushSync(()=>{h(t)}))})},[f,t,n,P,j]);bV(()=>{!1===u&&T.current.isPositioned&&(T.current.isPositioned=!1,h(e=>({...e,isPositioned:!1})))},[u]);let A=ne.useRef(!1);bV(()=>(A.current=!0,()=>{A.current=!1}),[]),bV(()=>{if(k&&(E.current=k),x&&(S.current=x),k&&x){if(M.current)return M.current(k,x,I);I()}},[k,x,I,M,C]);let O=ne.useMemo(()=>({reference:E,floating:S,setReference:v,setFloating:y}),[v,y]),N=ne.useMemo(()=>({reference:k,floating:x}),[k,x]),L=ne.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=bG(N.floating,l.x),r=bG(N.floating,l.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...bq(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,c,N.floating,l.x,l.y]);return ne.useMemo(()=>({...l,update:I,refs:O,elements:N,floatingStyles:L}),[l,I,O,N,L])}({strategy:"fixed",placement:E+("center"!==T?"-"+T:""),whileElementsMounted:bZ((...e)=>(function(e,t,n,r){let i;void 0===r&&(r={});let{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:c="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:u=!1}=r,l=bj(e),h=a||o?[...l?bC(l):[],...t?bC(t):[]]:[];h.forEach(e=>{a&&e.addEventListener("scroll",n),o&&e.addEventListener("resize",n)});let f=l&&s?function(e,t,n){let r,i=null,a=bl(e);function o(){var e;clearTimeout(r),null==(e=i)||e.disconnect(),i=null}function c(n,s){void 0===n&&(n=!1),void 0===s&&(s=1),o();let u=e.getBoundingClientRect(),{left:l,top:h,width:f,height:d}=u;if(n||t(),!f||!d)return;let b={rootMargin:-dG(h)+"px "+-dG(a.clientWidth-(l+f))+"px "+-dG(a.clientHeight-(h+d))+"px "+-dG(l)+"px",threshold:dU(0,dV(1,s))||1},g=!0;function w(t){let n=t[0].intersectionRatio;if(!bH(u,e.getBoundingClientRect()))return c();if(n!==s){if(!g)return c();n?c(!1,n):r=setTimeout(()=>{c(!1,1e-7)},1e3)}g=!1}try{i=new IntersectionObserver(w,{...b,root:a.ownerDocument})}catch(e){i=new IntersectionObserver(w,b)}i.observe(e)}let s=bu(e),u=()=>c(n);return s.addEventListener("resize",u),c(!0),()=>{s.removeEventListener("resize",u),o()}}(l,n,o):null,d=-1,b=null;c&&(b=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&b&&t&&(b.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var e;null==(e=b)||e.observe(t)})),n()}),l&&!u&&b.observe(l),t&&b.observe(t));let g=u?bN(e):null;return u&&function t(){let r=bN(e);g&&!bH(g,r)&&n(),g=r,i=requestAnimationFrame(t)}(),n(),()=>{var e;h.forEach(e=>{a&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)}),null==f||f(),null==(e=b)||e.disconnect(),b=null,u&&cancelAnimationFrame(i)}})(...e,{animationFrame:"always"===N}),"whileElementsMounted"),elements:{reference:R.anchor},middleware:[{name:(g={name:"offset",options:r=n={mainAxis:S+V,alignmentAxis:C},async fn(e){var t,n;let{x:i,y:a,placement:o,middlewareData:c}=e,s=await bo(e,r);return o===(null==(t=c.offset)?void 0:t.placement)&&null!=(n=c.arrow)&&n.alignmentOffset?{}:{x:i+s.x,y:a+s.y,data:{...s,placement:o}}}}).name,fn:g.fn,options:[n,void 0]},P&&{name:(w={name:"shift",options:o=a={mainAxis:!0,crossAxis:!1,limiter:"partial"===A?{fn:(i=void 0,{options:i={},fn(e){var t,n,r,a;let{x:o,y:c,placement:s,rects:u,middlewareData:l}=e,{offset:h=0,mainAxis:f=!0,crossAxis:d=!0}=dY(i,e),b={x:o,y:c},g=d0(s),w=dZ(g),p=b[w],v=b[g],y=dY(h,e),k="number"==typeof y?{mainAxis:y,crossAxis:0}:{mainAxis:null!=(t=y.mainAxis)?t:0,crossAxis:null!=(n=y.crossAxis)?n:0};if(f){let e="y"===w?"height":"width",t=u.reference[w]-u.floating[e]+k.mainAxis,n=u.reference[w]+u.reference[e]-k.mainAxis;p<t?p=t:p>n&&(p=n)}if(d){let e="y"===w?"width":"height",t=ba.has(dQ(s)),n=u.reference[g]-u.floating[e]+(t&&(null==(r=l.offset)?void 0:r[g])||0)+(t?0:k.crossAxis),i=u.reference[g]+u.reference[e]+(t?0:(null==(a=l.offset)?void 0:a[g])||0)-(t?k.crossAxis:0);v<n?v=n:v>i&&(v=i)}return{[w]:p,[g]:v}}}).fn,options:[void 0,void 0]}:void 0,...X},async fn(e){let{x:t,y:n,placement:r,platform:i}=e,{mainAxis:a=!0,crossAxis:c=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=dY(o,e),l={x:t,y:n},h=await i.detectOverflow(e,u),f=d0(r),d=dZ(f),b=l[d],g=l[f],w=(e,t)=>dU(t+h["y"===e?"top":"left"],dV(t,t-h["y"===e?"bottom":"right"]));a&&(b=w(d,b)),c&&(g=w(f,g));let p=s.fn({...e,[d]:b,[f]:g});return{...p,data:{x:p.x-t,y:p.y-n,enabled:{[d]:a,[f]:c}}}}}).name,fn:w.fn,options:[a,void 0]},P&&{name:(p={name:"flip",options:s=c={...X},async fn(e){var t,n,r,i,a,o,c,u;let l,h,f,{placement:d,middlewareData:b,rects:g,initialPlacement:w,platform:p,elements:v}=e,{mainAxis:y=!0,crossAxis:k=!0,fallbackPlacements:x,fallbackStrategy:E="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:T=!0,...C}=dY(s,e);if(null!=(t=b.arrow)&&t.alignmentOffset)return{};let M=dQ(d),P=d0(w),j=dQ(w)===w,I=await (null==p.isRTL?void 0:p.isRTL(v.floating)),A=x||(j||!T?[d8(w)]:(l=d8(w),[d2(w),l,d2(l)])),O="none"!==S;!x&&O&&A.push(...(h=dJ(w),f=function(e,t,n){switch(e){case"top":case"bottom":if(n)return t?d4:d3;return t?d3:d4;case"left":case"right":return t?d5:d6;default:return[]}}(dQ(w),"start"===S,I),h&&(f=f.map(e=>e+"-"+h),T&&(f=f.concat(f.map(d2)))),f));let N=[w,...A],L=await p.detectOverflow(e,C),D=[],R=(null==(n=b.flip)?void 0:n.overflows)||[];if(y&&D.push(L[M]),k){let e,t,n,r,i=(o=d,c=g,void 0===(u=I)&&(u=!1),e=dJ(o),n=d1(t=dZ(d0(o))),r="x"===t?e===(u?"end":"start")?"right":"left":"start"===e?"bottom":"top",c.reference[n]>c.floating[n]&&(r=d8(r)),[r,d8(r)]);D.push(L[i[0]],L[i[1]])}if(R=[...R,{placement:d,overflows:D}],!D.every(e=>e<=0)){let e=((null==(r=b.flip)?void 0:r.index)||0)+1,t=N[e];if(t&&("alignment"!==k||P===d0(t)||R.every(e=>d0(e.placement)!==P||e.overflows[0]>0)))return{data:{index:e,overflows:R},reset:{placement:t}};let n=null==(i=R.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:i.placement;if(!n)switch(E){case"bestFit":{let e=null==(a=R.filter(e=>{if(O){let t=d0(e.placement);return t===P||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:a[0];e&&(n=e);break}case"initialPlacement":n=w}if(d!==n)return{reset:{placement:n}}}return{}}}).name,fn:p.fn,options:[c,void 0]},{name:(v={name:"size",options:l=u={...X,apply:bZ(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty("--radix-popper-available-width",`${n}px`),o.setProperty("--radix-popper-available-height",`${r}px`),o.setProperty("--radix-popper-anchor-width",`${i}px`),o.setProperty("--radix-popper-anchor-height",`${a}px`)},"apply")},async fn(e){let t,n,{placement:r,rects:i,platform:a,elements:o}=e,{apply:c=()=>{},...s}=dY(l,e),u=await a.detectOverflow(e,s),h=dQ(r),f=dJ(r),d="y"===d0(r),{width:b,height:g}=i.floating;"top"===h||"bottom"===h?(t=h,n=f===(await (null==a.isRTL?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(n=h,t="end"===f?"top":"bottom");let w=g-u.top-u.bottom,p=b-u.left-u.right,v=dV(g-u[t],w),y=dV(b-u[n],p),k=e.middlewareData.shift,x=!k,E=v,S=y;null!=k&&k.enabled.x&&(S=p),null!=k&&k.enabled.y&&(E=w),x&&!f&&(d?S=b-2*dU(u.left,u.right):E=g-2*dU(u.top,u.bottom)),await c({...e,availableWidth:S,availableHeight:E});let T=await a.getDimensions(o.floating);return b!==T.width||g!==T.height?{reset:{rects:!0}}:{}}}).name,fn:v.fn,options:[u,void 0]},$&&{name:(y={name:"arrow",options:f=h={element:$,padding:M},fn(e){let{element:t,padding:n}="function"==typeof f?f(e):f;return t&&({}).hasOwnProperty.call(t,"current")?null!=t.current?bz({element:t.current,padding:n}).fn(e):{}:t?bz({element:t,padding:n}).fn(e):{}}}).name,fn:y.fn,options:[h,void 0]},gi({arrowWidth:z,arrowHeight:V}),O&&{name:(k={name:"hide",options:b=d={strategy:"referenceHidden",...X,boundary:G?X.boundary:void 0},async fn(e){let{rects:t,platform:n}=e,{strategy:r="referenceHidden",...i}=dY(b,e);switch(r){case"referenceHidden":{let r=br(await n.detectOverflow(e,{...i,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:bi(r)}}}case"escaped":{let r=br(await n.detectOverflow(e,{...i,altBoundary:!0}),t.floating);return{data:{escapedOffsets:r,escaped:bi(r)}}}default:return{}}}}).name,fn:k.fn,options:[d,void 0]}]}),ee=R.setPlacementState;dB(()=>(ee(Q),()=>{ee(void 0)}),[Q,ee]);let[et,en]=ga(Q),er=dr(L);dB(()=>{J&&er?.()},[J,er]);let ei=Z.arrow?.x,ea=Z.arrow?.y,eo=Z.arrow?.centerOffset!==0,[ec,es]=ne.useState();return dB(()=>{_&&es(window.getComputedStyle(_).zIndex)},[_]),(0,t7.jsx)("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:J?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ec,"--radix-popper-transform-origin":[Z.transformOrigin?.x,Z.transformOrigin?.y].join(" "),...Z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,t7.jsx)(b9,{scope:x,placedSide:et,placedAlign:en,onArrowChange:K,arrowX:ei,arrowY:ea,shouldHideArrow:eo,children:(0,t7.jsx)(dt.div,{"data-side":et,"data-align":en,...D,ref:F,style:{...D.style,animation:J?D.style?.animation:"none"}})})})},"PopperContent")),gt={top:"bottom",right:"left",bottom:"top",left:"right"},gn=ne.forwardRef(bZ(function(e,t){let{__scopePopper:n,...r}=e,i=b7("PopperArrow",n),a=gt[i.placedSide];return(0,t7.jsx)("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:(0,t7.jsx)(bY,{...r,ref:t,style:{...r.style,display:"block"}})})},"PopperArrow"));function gr(e){return null!==e}bZ(gr,"isNotNull");var gi=bZ(e=>({name:"transformOrigin",options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[s,u]=ga(n),l={start:"0%",center:"50%",end:"100%"}[u],h=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+c/2,d="",b="";return"bottom"===s?(d=a?l:`${h}px`,b=`${-c}px`):"top"===s?(d=a?l:`${h}px`,b=`${r.floating.height+c}px`):"right"===s?(d=`${-c}px`,b=a?l:`${f}px`):"left"===s&&(d=`${r.floating.width+c}px`,b=a?l:`${f}px`),{data:{x:d,y:b}}}}),"transformOrigin");function ga(e){let[t,n="center"]=e.split("-");return[t,n]}bZ(ga,"getSideAndAlignFromPlacement");var go=Object.defineProperty,gc=ne.forwardRef(go(function(e,t){let{container:n,...r}=e,[i,a]=ne.useState(!1);dB(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?fv.createPortal((0,t7.jsx)(dt.div,{...r,ref:t}),o):null},"name",{value:"Portal",configurable:!0})),gs=Object.defineProperty,gu=(e,t)=>gs(e,"name",{value:t,configurable:!0});function gl(e,t){return ne.useReducer((e,n)=>t[e][n]??e,e)}gu(gl,"useStateMachine");var gh=gu(e=>{let{present:t,children:n}=e,r=gf(t),i="function"==typeof n?n({present:r.isPresent}):ne.Children.only(n),a=gb(r.ref,gw(i));return"function"==typeof n||r.isPresent?ne.cloneElement(i,{ref:a}):null},"Presence");function gf(e){let[t,n]=ne.useState(),r=ne.useRef(null),i=ne.useRef(e),a=ne.useRef("none"),o=ne.useRef(void 0),[c,s]=gl(e?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return ne.useEffect(()=>{"mounted"===c?(a.current=o.current??gg(r.current),o.current=void 0):a.current="none"},[c]),dB(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,c=gg(t);e?(o.current=c,s("MOUNT")):"none"===c||t?.display==="none"?s("UNMOUNT"):n&&r!==c?s("ANIMATION_OUT"):s("UNMOUNT"),i.current=e}},[e,s]),dB(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=gu(a=>{let o=gg(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s("ANIMATION_END"),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)})}},"handleAnimationEnd"),c=gu(e=>{e.target===t&&(a.current=gg(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",c),t.addEventListener("animationcancel",o),t.addEventListener("animationend",o),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",c),t.removeEventListener("animationcancel",o),t.removeEventListener("animationend",o)}}s("ANIMATION_END")},[t,s]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:ne.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=gg(t)}else r.current=null;n(e)},[])}}function gd(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function gb(...e){let t=ne.useRef(e);return t.current=e,ne.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=gd(t,e);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];"function"==typeof t?t():gd(n[e],null)}}},[])}function gg(e){return e?.animationName||"none"}function gw(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(n=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}gu(gf,"usePresence"),gu(gd,"setRef"),gu(gb,"useStableComposedRefs"),gu(gg,"getAnimationName"),gu(gw,"getElementRef");var gp=Object.defineProperty,gv=ne[" useEffectEvent ".trim().toString()],gm=ne[" useInsertionEffect ".trim().toString()];function gy(e){if("function"==typeof gv)return gv(e);let t=ne.useRef(()=>{throw Error("Cannot call an event handler while rendering.")});return"function"==typeof gm?gm(()=>{t.current=e}):dB(()=>{t.current=e}),ne.useMemo(()=>(...e)=>t.current?.(...e),[])}gp(gy,"name",{value:"useEffectEvent",configurable:!0});var gk=Object.defineProperty,gx=(e,t)=>gk(e,"name",{value:t,configurable:!0}),gE=ne[" useInsertionEffect ".trim().toString()]||dB;function gS({prop:e,defaultProp:t,onChange:n=gx(()=>{},"onChange"),caller:r}){let[i,a,o]=gT({defaultProp:t,onChange:n}),c=void 0!==e,s=c?e:i;return[s,ne.useCallback(t=>{if(c){let n=gC(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[c,e,a,o])]}function gT({defaultProp:e,onChange:t}){let[n,r]=ne.useState(e),i=ne.useRef(n),a=ne.useRef(t);return gE(()=>{a.current=t},[t]),ne.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function gC(e){return"function"==typeof e}gx(gS,"useControllableState"),gx(gT,"useUncontrolledState"),gx(gC,"isFunction");var gM=Symbol("RADIX:SYNC_STATE");function gP(e){let t=ne.useRef({value:e,previous:e});return ne.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}gx(function(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:c}=t,s=void 0!==i,u=gy(o),l=[{...n,state:a}];r&&l.push(r);let[h,f]=ne.useReducer((t,n)=>{if(n.type===gM)return{...t,state:n.state};let r=e(t,n);return s&&!Object.is(r.state,t.state)&&u(r.state),r},...l),d=h.state,b=ne.useRef(d);ne.useEffect(()=>{b.current!==d&&(b.current=d,s||u(d))},[d,b,s]);let g=ne.useMemo(()=>void 0!==i?{...h,state:i}:h,[h,i]);return ne.useEffect(()=>{s&&!Object.is(i,h.state)&&f({type:gM,state:i})},[i,h.state,s]),[g,f]},"useControllableStateReducer"),(0,Object.defineProperty)(gP,"name",{value:"usePrevious",configurable:!0});var gj=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),gI=new WeakMap,gA=new WeakMap,gO={},gN=0,gL=function(e){return e&&(e.host||gL(e.parentNode))},gD=function(e,t,n,r){var i=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var n=gL(e);return n&&t.contains(n)?n:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});gO[n]||(gO[n]=new WeakMap);var a=gO[n],o=[],c=new Set,s=new Set(i),u=function(e){!e||c.has(e)||(c.add(e),u(e.parentNode))};i.forEach(u);var l=function(e){!e||s.has(e)||Array.prototype.forEach.call(e.children,function(e){if(c.has(e))l(e);else try{var t=e.getAttribute(r),i=null!==t&&"false"!==t,s=(gI.get(e)||0)+1,u=(a.get(e)||0)+1;gI.set(e,s),a.set(e,u),o.push(e),1===s&&i&&gA.set(e,!0),1===u&&e.setAttribute(n,"true"),i||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return l(t),c.clear(),gN++,function(){o.forEach(function(e){var t=gI.get(e)-1,i=a.get(e)-1;gI.set(e,t),a.set(e,i),t||(gA.has(e)||e.removeAttribute(r),gA.delete(e)),i||e.removeAttribute(n)}),--gN||(gI=new WeakMap,gI=new WeakMap,gA=new WeakMap,gO={})}},gR=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||("u"<typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),gD(r,i,n,"aria-hidden")):function(){return null}},g_=function(){return(g_=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function gB(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var gF=("function"==typeof SuppressedError&&SuppressedError,"right-scroll-bar-position"),g$="width-before-scroll-bar";function gK(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var gH="u">typeof window?ne.useLayoutEffect:ne.useEffect,gz=new WeakMap,gV=(void 0===c&&(c={}),(void 0===s&&(s=function(e){return e}),u=[],l=!1,h={read:function(){if(l)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return u.length?u[u.length-1]:null},useMedium:function(e){var t=s(e,l);return u.push(t),function(){u=u.filter(function(e){return e!==t})}},assignSyncMedium:function(e){for(l=!0;u.length;){var t=u;u=[],t.forEach(e)}u={push:function(t){return e(t)},filter:function(){return u}}},assignMedium:function(e){l=!0;var t=[];if(u.length){var n=u;u=[],n.forEach(e),t=u}var r=function(){var n=t;t=[],n.forEach(e)},i=function(){return Promise.resolve().then(r)};i(),u={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),u}}}}).options=g_({async:!0,ssr:!1},c),h),gU=function(){},gq=ne.forwardRef(function(e,t){var n,r,i,a,o=ne.useRef(null),c=ne.useState({onScrollCapture:gU,onWheelCapture:gU,onTouchMoveCapture:gU}),s=c[0],u=c[1],l=e.forwardProps,h=e.children,f=e.className,d=e.removeScrollBar,b=e.enabled,g=e.shards,w=e.sideCar,p=e.noRelative,v=e.noIsolation,y=e.inert,k=e.allowPinchZoom,x=e.as,E=e.gapMode,S=gB(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=(n=[o,t],r=function(e){return n.forEach(function(t){return gK(t,e)})},(i=(0,ne.useState)(function(){return{value:null,callback:r,facade:{get current(){return i.value},set current(value){var e=i.value;e!==value&&(i.value=value,i.callback(value,e))}}}})[0]).callback=r,a=i.facade,gH(function(){var e=gz.get(a);if(e){var t=new Set(e),r=new Set(n),i=a.current;t.forEach(function(e){r.has(e)||gK(e,null)}),r.forEach(function(e){t.has(e)||gK(e,i)})}gz.set(a,n)},[n]),a),C=g_(g_({},S),s);return ne.createElement(ne.Fragment,null,b&&ne.createElement(w,{sideCar:gV,removeScrollBar:d,shards:g,noRelative:p,noIsolation:v,inert:y,setCallbacks:u,allowPinchZoom:!!k,lockRef:o,gapMode:E}),l?ne.cloneElement(ne.Children.only(h),g_(g_({},C),{ref:T})):ne.createElement(void 0===x?"div":x,g_({},C,{className:f,ref:T}),h))});gq.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},gq.classNames={fullWidth:g$,zeroRight:gF};var gG=function(e){var t=e.sideCar,n=gB(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error("Sidecar medium not found");return ne.createElement(r,g_({},n))};gG.isSideCarExport=!0;var gX=function(){var e=0,t=null;return{add:function(n){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=t9||("u">typeof __webpack_nonce__?__webpack_nonce__:void 0);return t&&e.setAttribute("nonce",t),e}())){var r,i;(r=t).styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n)),i=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(i)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},gW=function(){var e=gX();return function(t,n){ne.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},gY=function(){var e=gW();return function(t){return e(t.styles,t.dynamic),null}},gQ={left:0,top:0,right:0,gap:0},gJ=function(e){return parseInt(e||"",10)||0},gZ=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],i=t["padding"===e?"paddingRight":"marginRight"];return[gJ(n),gJ(r),gJ(i)]},g1=function(e){if(void 0===e&&(e="margin"),"u"<typeof window)return gQ;var t=gZ(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},g0=gY(),g2="data-scroll-locked",g3=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,c=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(c,"px ").concat(r,";\n }\n body[").concat(g2,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(i,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(o,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(c,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(gF," {\n right: ").concat(c,"px ").concat(r,";\n }\n \n .").concat(g$," {\n margin-right: ").concat(c,"px ").concat(r,";\n }\n \n .").concat(gF," .").concat(gF," {\n right: 0 ").concat(r,";\n }\n \n .").concat(g$," .").concat(g$," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(g2,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(c,"px;\n }\n")},g4=function(){var e=parseInt(document.body.getAttribute(g2)||"0",10);return isFinite(e)?e:0},g5=function(){ne.useEffect(function(){return document.body.setAttribute(g2,(g4()+1).toString()),function(){var e=g4()-1;e<=0?document.body.removeAttribute(g2):document.body.setAttribute(g2,e.toString())}},[])},g6=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=void 0===r?"margin":r;g5();var a=ne.useMemo(function(){return g1(i)},[i]);return ne.createElement(g0,{styles:g3(a,!t,i,n?"":"!important")})},g8=!1;if("u">typeof window)try{var g9=Object.defineProperty({},"passive",{get:function(){return g8=!0,!0}});window.addEventListener("test",g9,g9),window.removeEventListener("test",g9,g9)}catch(e){g8=!1}var g7=!!g8&&{passive:!1},we=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&(n.overflowY!==n.overflowX||"TEXTAREA"===e.tagName||"visible"!==n[t])},wt=function(e,t){var n=t.ownerDocument,r=t;do{if("u">typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),wn(e,r)){var i=wr(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body)return!1},wn=function(e,t){return"v"===e?we(t,"overflowY"):we(t,"overflowX")},wr=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},wi=function(e,t,n,r,i){var a,o=(a=window.getComputedStyle(t).direction,"h"===e&&"rtl"===a?-1:1),c=o*r,s=n.target,u=t.contains(s),l=!1,h=c>0,f=0,d=0;do{if(!s)break;var b=wr(e,s),g=b[0],w=b[1]-b[2]-o*g;(g||w)&&wn(e,s)&&(f+=w,d+=g);var p=s.parentNode;s=p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE?p.host:p}while(!u&&s!==document.body||u&&(t.contains(s)||t===s))return h&&(i&&1>Math.abs(f)||!i&&c>f)?l=!0:!h&&(i&&1>Math.abs(d)||!i&&-c>d)&&(l=!0),l},wa=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},wo=function(e){return[e.deltaX,e.deltaY]},wc=function(e){return e&&"current"in e?e.current:e},ws=0,wu=[];let wl=(f=function(e){var t=ne.useRef([]),n=ne.useRef([0,0]),r=ne.useRef(),i=ne.useState(ws++)[0],a=ne.useState(gY)[0],o=ne.useRef(e);ne.useEffect(function(){o.current=e},[e]),ne.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var t=(function(e,t,n){if(n||2==arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))})([e.lockRef.current],(e.shards||[]).map(wc),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var c=ne.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!o.current.allowPinchZoom;var i,a=wa(e),c=n.current,s="deltaX"in e?e.deltaX:c[0]-a[0],u="deltaY"in e?e.deltaY:c[1]-a[1],l=e.target,h=Math.abs(s)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===h&&"range"===l.type)return!1;var f=window.getSelection(),d=f&&f.anchorNode;if(d&&(d===l||d.contains(l)))return!1;var b=wt(h,l);if(!b)return!0;if(b?i=h:(i="v"===h?"h":"v",b=wt(h,l)),!b)return!1;if(!r.current&&"changedTouches"in e&&(s||u)&&(r.current=i),!i)return!0;var g=r.current||i;return wi(g,t,e,"h"===g?s:u,!0)},[]),s=ne.useCallback(function(e){if(wu.length&&wu[wu.length-1]===a){var n="deltaY"in e?wo(e):wa(e),r=t.current.filter(function(t){var r;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(r=t.delta,r[0]===n[0]&&r[1]===n[1])})[0];if(r&&r.should){e.cancelable&&e.preventDefault();return}if(!r){var i=(o.current.shards||[]).map(wc).filter(Boolean).filter(function(t){return t.contains(e.target)});(i.length>0?c(e,i[0]):!o.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),u=ne.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),l=ne.useCallback(function(e){n.current=wa(e),r.current=void 0},[]),h=ne.useCallback(function(t){u(t.type,wo(t),t.target,c(t,e.lockRef.current))},[]),f=ne.useCallback(function(t){u(t.type,wa(t),t.target,c(t,e.lockRef.current))},[]);ne.useEffect(function(){return wu.push(a),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",s,g7),document.addEventListener("touchmove",s,g7),document.addEventListener("touchstart",l,g7),function(){wu=wu.filter(function(e){return e!==a}),document.removeEventListener("wheel",s,g7),document.removeEventListener("touchmove",s,g7),document.removeEventListener("touchstart",l,g7)}},[]);var d=e.removeScrollBar,b=e.inert;return ne.createElement(ne.Fragment,null,b?ne.createElement(a,{styles:"\n .block-interactivity-".concat(i," {pointer-events: none;}\n .allow-interactivity-").concat(i," {pointer-events: all;}\n")}):null,d?ne.createElement(g6,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},gV.useMedium(f),gG);var wh=ne.forwardRef(function(e,t){return ne.createElement(gq,g_({},e,{ref:t,sideCar:wl}))});wh.classNames=gq.classNames;var wf=Object.defineProperty,wd=(e,t)=>wf(e,"name",{value:t,configurable:!0}),wb=[" ","Enter","ArrowUp","ArrowDown"],wg=[" ","Enter"],ww="Select",[wp,wv,wm]=fQ(ww),[wy,wk]=fP(ww,[wm,b2]),wx=b2(),[wE,wS]=wy(ww),[wT,wC]=wy(ww);function wM(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:c,onValueChange:s,dir:u,name:l,autoComplete:h,disabled:f,required:d,form:b,internal_do_not_use_render:g}=e,w=wx(t),[p,v]=ne.useState(null),[y,k]=ne.useState(null),[x,E]=ne.useState(!1),S=f7(u),[T,C]=gS({prop:r,defaultProp:i??!1,onChange:a,caller:ww}),[M,P]=gS({prop:o,defaultProp:c,onChange:s,caller:ww}),j=ne.useRef(null),I=ne.useRef(M);ne.useEffect(()=>{let e=b?p?.ownerDocument.getElementById(b):p?.form;if(e instanceof HTMLFormElement){let t=wd(()=>P(I.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[b,p,P]);let A=!p||!!b||!!p.closest("form"),[O,N]=ne.useState(new Set),L=dH(),D=Array.from(O).map(e=>e.props.value).join(";"),R=ne.useCallback(e=>{N(t=>new Set(t).add(e))},[]),_=ne.useCallback(e=>{N(t=>{let n=new Set(t);return n.delete(e),n})},[]),B={required:d,trigger:p,onTriggerChange:v,valueNode:y,onValueNodeChange:k,valueNodeHasChildren:x,onValueNodeHasChildrenChange:E,contentId:L,value:M,onValueChange:P,open:T,onOpenChange:C,dir:S,triggerPointerDownPosRef:j,disabled:f,name:l,autoComplete:h,form:b,nativeOptions:O,nativeSelectKey:D,isFormControl:A};return(0,t7.jsx)(b5,{...w,children:(0,t7.jsx)(wE,{scope:t,...B,children:(0,t7.jsx)(wp.Provider,{scope:t,children:(0,t7.jsx)(wT,{scope:t,onNativeOptionAdd:R,onNativeOptionRemove:_,children:pr(g)?g(B):n})})})})}wd(wM,"SelectProvider");var wP=wd(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,t7.jsx)(wM,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,t7.jsxs)(t7.Fragment,{children:[n,e?(0,t7.jsx)(pn,{__scopeSelect:t}):null]})})},"Select"),wj=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=wx(n),o=wS("SelectTrigger",n),c=o.disabled||r,s=fL(t,o.onTriggerChange),u=wv(n),l=ne.useRef("touch"),[h,f,d]=pa(e=>{let t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===o.value),r=po(t,e,n);void 0!==r&&o.onValueChange(r.value)}),b=wd(e=>{c||(o.onOpenChange(!0),d()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},"handleOpen");return(0,t7.jsx)(b6,{asChild:!0,...a,children:(0,t7.jsx)(dt.button,{type:"button",role:"combobox","aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":pi(o.value)?"":void 0,...i,ref:s,onClick:fE(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==l.current&&b(e)}),onPointerDown:fE(i.onPointerDown,e=>{l.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(b(e),e.preventDefault())}),onKeyDown:fE(i.onKeyDown,e=>{let t=""!==h.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||f(e.key),(!t||" "!==e.key)&&wb.includes(e.key)&&(b(),e.preventDefault())})})})},"SelectTrigger")),wI=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o="",...c}=e,s=wS("SelectValue",n),{onValueNodeHasChildrenChange:u}=s,l=void 0!==a,h=fL(t,s.onValueNodeChange);dB(()=>{u(l)},[u,l]);let f=pi(s.value);return(0,t7.jsx)(dt.span,{...c,asChild:!f&&c.asChild,ref:h,style:{pointerEvents:"none"},children:(0,t7.jsx)(ne.Fragment,{children:f?o:a},f?"placeholder":"value")})},"SelectValue")),wA=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,t7.jsx)(dt.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})},"SelectIcon")),[wO,wN]=wy("SelectPortal",{forceMount:void 0}),wL=wd(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,t7.jsx)(wO,{scope:e.__scopeSelect,forceMount:n,children:(0,t7.jsx)(gc,{asChild:!0,...r})})},"SelectPortal"),wD="SelectContent",wR=ne.forwardRef(wd(function(e,t){let n=wN(wD,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=wS(wD,e.__scopeSelect),[o,c]=ne.useState();return dB(()=>{c(new DocumentFragment)},[]),(0,t7.jsx)(gh,{present:r||a.open,children:({present:e})=>e?(0,t7.jsx)(wK,{...i,ref:t}):(0,t7.jsx)(w_,{...i,fragment:o})})},"SelectContent")),w_=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?fv.createPortal((0,t7.jsx)(wB,{scope:n,children:(0,t7.jsx)(wp.Slot,{scope:n,children:(0,t7.jsx)("div",{ref:t,children:r})})}),i):null},"SelectContentFragment")),[wB,wF]=wy(wD),w$=f_("SelectContent.RemoveScroll"),wK=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n}=e,{position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:c,sideOffset:s,align:u,alignOffset:l,arrowPadding:h,collisionBoundary:f,collisionPadding:d,sticky:b,hideWhenDetached:g,avoidCollisions:w,...p}=e,v=wS(wD,n),[y,k]=ne.useState(null),[x,E]=ne.useState(null),S=fL(t,k),[T,C]=ne.useState(null),[M,P]=ne.useState(null),j=wv(n),[I,A]=ne.useState(!1),O=ne.useRef(!1);ne.useEffect(()=>{if(y)return gR(y)},[y]),dm();let N=ne.useCallback(e=>{let[t,...n]=j().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:"nearest"}),n===t&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[j,x]),L=ne.useCallback(()=>N([T,y]),[N,T,y]);ne.useEffect(()=>{I&&L()},[I,L]);let{onOpenChange:D,triggerPointerDownPosRef:R}=v;ne.useEffect(()=>{if(y){let e={x:0,y:0},t=wd(t=>{e={x:Math.abs(Math.round(t.pageX)-(R.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(R.current?.y??0))}},"handlePointerMove"),n=wd(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(y)||D(!1),document.removeEventListener("pointermove",t),R.current=null},"handlePointerUp");return null!==R.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[y,D,R]),ne.useEffect(()=>{let e=wd(()=>D(!1),"close");return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[D]);let[_,B]=pa(e=>{let t=j().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=po(t,e,n);r&&setTimeout(()=>r.ref.current?.focus())}),F=ne.useCallback((e,t,n)=>{let r=!O.current&&!n;(void 0!==v.value&&v.value===t||r)&&(C(e),r&&(O.current=!0))},[v.value]),$=ne.useCallback(()=>y?.focus(),[y]),K=ne.useCallback((e,t,n)=>{let r=!O.current&&!n;(void 0!==v.value&&v.value===t||r)&&P(e)},[v.value]),H="popper"===r?wz:wH;return(0,t7.jsx)(wB,{scope:n,content:y,viewport:x,onViewportChange:E,itemRefCallback:F,selectedItem:T,onItemLeave:$,itemTextRefCallback:K,focusSelectedItem:L,selectedItemText:M,position:r,isPositioned:I,searchRef:_,children:(0,t7.jsx)(wh,{as:w$,allowPinchZoom:!0,children:(0,t7.jsx)(dC,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:fE(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,t7.jsx)(du,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,t7.jsx)(H,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:e=>e.preventDefault(),...p,...H===wz?{side:c,sideOffset:s,align:u,alignOffset:l,arrowPadding:h,collisionBoundary:f,collisionPadding:d,sticky:b,hideWhenDetached:g,avoidCollisions:w}:{},onPlaced:()=>A(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...p.style},onKeyDown:fE(p.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||B(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=j().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>N(t)),e.preventDefault()}})})})})})})},"SelectContentImpl")),wH=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=wS(wD,n),o=wF(wD,n),[c,s]=ne.useState(null),[u,l]=ne.useState(null),h=fL(t,l),f=wv(n),d=ne.useRef(!1),b=ne.useRef(!0),{viewport:g,selectedItem:w,selectedItemText:p,focusSelectedItem:v}=o,y=ne.useCallback(()=>{if(a.trigger&&a.valueNode&&c&&u&&g&&w&&p){let e=a.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=p.getBoundingClientRect();if("rtl"!==a.dir){let r=i.left-t.left,a=n.left-r,o=e.left-a,s=e.width+o,u=Math.max(s,t.width),l=fm(a,[10,Math.max(10,window.innerWidth-10-u)]);c.style.minWidth=s+"px",c.style.left=l+"px"}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,s=e.width+o,u=Math.max(s,t.width),l=fm(a,[10,Math.max(10,window.innerWidth-10-u)]);c.style.minWidth=s+"px",c.style.right=l+"px"}let o=f(),s=window.innerHeight-20,l=g.scrollHeight,h=window.getComputedStyle(u),b=parseInt(h.borderTopWidth,10),v=parseInt(h.paddingTop,10),y=parseInt(h.borderBottomWidth,10),k=b+v+l+parseInt(h.paddingBottom,10)+y,x=Math.min(5*w.offsetHeight,k),E=window.getComputedStyle(g),S=parseInt(E.paddingTop,10),T=parseInt(E.paddingBottom,10),C=e.top+e.height/2-10,M=w.offsetHeight/2,P=b+v+(w.offsetTop+M);if(P<=C){let e=o.length>0&&w===o[o.length-1].ref.current;c.style.bottom="0px";let t=Math.max(s-C,M+(e?T:0)+(u.clientHeight-g.offsetTop-g.offsetHeight)+y);c.style.height=P+t+"px"}else{let e=o.length>0&&w===o[0].ref.current;c.style.top="0px";let t=Math.max(C,b+g.offsetTop+(e?S:0)+M);c.style.height=t+(k-P)+"px",g.scrollTop=P-C+g.offsetTop}c.style.margin="10px 0",c.style.minHeight=x+"px",c.style.maxHeight=s+"px",r?.(),requestAnimationFrame(()=>d.current=!0)}},[f,a.trigger,a.valueNode,c,u,g,w,p,a.dir,r]);dB(()=>y(),[y]);let[k,x]=ne.useState();dB(()=>{u&&x(window.getComputedStyle(u).zIndex)},[u]);let E=ne.useCallback(e=>{e&&!0===b.current&&(y(),v?.(),b.current=!1)},[y,v]);return(0,t7.jsx)(wV,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:d,onScrollButtonChange:E,children:(0,t7.jsx)("div",{ref:s,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:(0,t7.jsx)(dt.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})},"SelectItemAlignedPosition")),wz=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,align:r="start",collisionPadding:i=10,...a}=e,o=wx(n);return(0,t7.jsx)(ge,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[wV,wU]=wy(wD,{}),wq="SelectViewport",wG=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=wF(wq,n),o=wU(wq,n),c=fL(t,a.onViewportChange),s=ne.useRef(0);return(0,t7.jsxs)(t7.Fragment,{children:[(0,t7.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),(0,t7.jsx)(wp.Slot,{scope:n,children:(0,t7.jsx)(dt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:fE(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(s.current-t.scrollTop);if(e>0){let r=window.innerHeight-20,i=Math.max(parseFloat(n.style.minHeight),parseFloat(n.style.height));if(i<r){let a=i+e,o=Math.min(r,a),c=a-o;n.style.height=o+"px","0px"===n.style.bottom&&(t.scrollTop=c>0?c:0,n.style.justifyContent="flex-end")}}}s.current=t.scrollTop})})})]})},"SelectViewport")),[wX,wW]=wy("SelectGroup"),wY=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,...r}=e,i=dH();return(0,t7.jsx)(wX,{scope:n,id:i,children:(0,t7.jsx)(dt.div,{role:"group","aria-labelledby":i,...r,ref:t})})},"SelectGroup")),wQ=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,...r}=e,i=wW("SelectLabel",n);return(0,t7.jsx)(dt.div,{id:i.id,...r,ref:t})},"SelectLabel")),wJ="SelectItem",[wZ,w1]=wy(wJ),w0=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,c=wS(wJ,n),s=wF(wJ,n),u=c.value===r,[l,h]=ne.useState(a??""),[f,d]=ne.useState(!1),b=fL(t,dr(e=>s.itemRefCallback?.(e,r,i))),g=dH(),w=ne.useRef("touch"),p=wd(()=>{i||(c.onValueChange(r),c.onOpenChange(!1))},"handleSelect");return(0,t7.jsx)(wZ,{scope:n,value:r,disabled:i,textId:g,isSelected:u,onItemTextChange:ne.useCallback(e=>{h(t=>t||(e?.textContent??"").trim())},[]),children:(0,t7.jsx)(wp.ItemSlot,{scope:n,value:r,disabled:i,textValue:l,children:(0,t7.jsx)(dt.div,{role:"option","aria-labelledby":g,"data-highlighted":f?"":void 0,"aria-selected":u&&f,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:b,onFocus:fE(o.onFocus,()=>d(!0)),onBlur:fE(o.onBlur,()=>d(!1)),onClick:fE(o.onClick,()=>{"mouse"!==w.current&&p()}),onPointerUp:fE(o.onPointerUp,()=>{"mouse"===w.current&&p()}),onPointerDown:fE(o.onPointerDown,e=>{w.current=e.pointerType}),onPointerMove:fE(o.onPointerMove,e=>{w.current=e.pointerType,i?s.onItemLeave?.():"mouse"===w.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:fE(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&s.onItemLeave?.()}),onKeyDown:fE(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(s.searchRef?.current===""||" "!==e.key)&&(wg.includes(e.key)&&p()," "===e.key&&e.preventDefault())})})})})},"SelectItem")),w2="SelectItemText",w3=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=wS(w2,n),c=wF(w2,n),s=w1(w2,n),u=wC(w2,n),[l,h]=ne.useState(null),f=dr(e=>c.itemTextRefCallback?.(e,s.value,s.disabled)),d=fL(t,h,s.onItemTextChange,f),b=l?.textContent,g=ne.useMemo(()=>(0,t7.jsx)("option",{value:s.value,disabled:s.disabled,children:b},s.value),[s.disabled,s.value,b]),{onNativeOptionAdd:w,onNativeOptionRemove:p}=u;return dB(()=>(w(g),()=>p(g)),[w,p,g]),(0,t7.jsxs)(t7.Fragment,{children:[(0,t7.jsx)(dt.span,{id:s.textId,...a,ref:d}),s.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!pi(o.value)?fv.createPortal(a.children,o.valueNode):null]})},"SelectItemText")),w4=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,...r}=e;return w1("SelectItemIndicator",n).isSelected?(0,t7.jsx)(dt.span,{"aria-hidden":!0,...r,ref:t}):null},"SelectItemIndicator")),w5="SelectScrollUpButton",w6=ne.forwardRef(wd(function(e,t){let n=wF(w5,e.__scopeSelect),r=wU(w5,e.__scopeSelect),[i,a]=ne.useState(!1),o=fL(t,r.onScrollButtonChange);return dB(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)};wd(e,"handleScroll");let t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),i?(0,t7.jsx)(w7,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null},"SelectScrollUpButton")),w8="SelectScrollDownButton",w9=ne.forwardRef(wd(function(e,t){let n=wF(w8,e.__scopeSelect),r=wU(w8,e.__scopeSelect),[i,a]=ne.useState(!1),o=fL(t,r.onScrollButtonChange);return dB(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)};wd(e,"handleScroll");let t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),i?(0,t7.jsx)(w7,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null},"SelectScrollDownButton")),w7=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=wF("SelectScrollButton",n),o=ne.useRef(null),c=wv(n),s=ne.useCallback(()=>{null!==o.current&&(window.clearInterval(o.current),o.current=null)},[]);return ne.useEffect(()=>()=>s(),[s]),dB(()=>{let e=c().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[c]),(0,t7.jsx)(dt.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:fE(i.onPointerDown,()=>{null===o.current&&(o.current=window.setInterval(r,50))}),onPointerMove:fE(i.onPointerMove,()=>{a.onItemLeave?.(),null===o.current&&(o.current=window.setInterval(r,50))}),onPointerLeave:fE(i.onPointerLeave,()=>{s()})})},"SelectScrollButtonImpl")),pe=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,...r}=e;return(0,t7.jsx)(dt.div,{"aria-hidden":!0,...r,ref:t})},"SelectSeparator")),pt=ne.forwardRef(wd(function(e,t){let{__scopeSelect:n,...r}=e,i=wx(n);return"popper"===wF("SelectArrow",n).position?(0,t7.jsx)(gn,{...i,...r,ref:t}):null},"SelectArrow")),pn=ne.forwardRef(wd(function({__scopeSelect:e,...t},n){let r=wS("SelectBubbleInput",e),{value:i,onValueChange:a,required:o,disabled:c,name:s,autoComplete:u,form:l}=r,{nativeOptions:h,nativeSelectKey:f}=r,d=ne.useRef(null),b=fL(n,d),g=i??"",w=gP(g),p=Array.from(h).some(e=>(e.props.value??"")==="");return ne.useEffect(()=>{let e=d.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(w!==g&&t){let n=new Event("change",{bubbles:!0});t.call(e,g),e.dispatchEvent(n)}},[w,g]),(0,t7.jsxs)(dt.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:s,autoComplete:u,disabled:c,form:l,onChange:e=>a(e.target.value),...t,style:{...gj,...t.style},ref:b,defaultValue:g,children:[pi(i)&&!p?(0,t7.jsx)("option",{value:""}):null,Array.from(h)]},f)},"SelectBubbleInput"));function pr(e){return"function"==typeof e}function pi(e){return""===e||void 0===e}function pa(e){let t=dr(e),n=ne.useRef(""),r=ne.useRef(0),i=ne.useCallback(e=>{t(n.current+e)},[t]),a=ne.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return ne.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function po(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=pc(e,Math.max(i,0));1===r.length&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o!==n?o:void 0}function pc(e,t){return e.map((n,r)=>e[(t+r)%e.length])}wd(pr,"isFunction"),wd(pi,"shouldShowPlaceholder"),wd(pa,"useTypeaheadSearch"),wd(po,"findNextItem"),wd(pc,"wrapArray"),e.s(["Arrow",0,pt,"Content",0,wR,"Group",0,wY,"Icon",0,wA,"Item",0,w0,"ItemIndicator",0,w4,"ItemText",0,w3,"Label",0,wQ,"Portal",0,wL,"Root",0,wP,"ScrollDownButton",0,w9,"ScrollUpButton",0,w6,"Select",0,wP,"SelectArrow",0,pt,"SelectContent",0,wR,"SelectGroup",0,wY,"SelectIcon",0,wA,"SelectItem",0,w0,"SelectItemIndicator",0,w4,"SelectItemText",0,w3,"SelectLabel",0,wQ,"SelectPortal",0,wL,"SelectScrollDownButton",0,w9,"SelectScrollUpButton",0,w6,"SelectSeparator",0,pe,"SelectTrigger",0,wj,"SelectValue",0,wI,"SelectViewport",0,wG,"Separator",0,pe,"Trigger",0,wj,"Value",0,wI,"Viewport",0,wG,"createSelectScope",0,wk,"unstable_BubbleInput",0,pn,"unstable_Provider",0,wM,"unstable_SelectBubbleInput",0,pn,"unstable_SelectProvider",0,wM],29402);var ps=e.i(29402),ps=ps,pu=Object.defineProperty,pl=(e,t)=>pu(e,"name",{value:t,configurable:!0}),ph=["PageUp","PageDown"],pf=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],pd={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},pb="Slider",[pg,pw,pp]=fQ(pb),[pv,pm]=fP(pb,[pp]),[py,pk]=pv(pb),px=ne.forwardRef(pl(function(e,t){let{name:n,min:r=0,max:i=100,step:a=1,orientation:o="horizontal",disabled:c=!1,minStepsBetweenThumbs:s=0,defaultValue:u=[r],value:l,onValueChange:h=pl(()=>{},"onValueChange"),onValueCommit:f=pl(()=>{},"onValueCommit"),inverted:d=!1,form:b,...g}=e,w=ne.useRef(new Set),p=ne.useRef(0),v=ne.useRef(!1),y="horizontal"===o,[k,x]=ne.useState(null),E=fL(t,x),[S=[],T]=gS({prop:l,defaultProp:u,onChange:pl(e=>{let t=[...w.current];t[p.current]?.focus({preventScroll:!0,focusVisible:v.current}),v.current=!1,h(e)},"onChange")}),C=ne.useRef(S),M=ne.useRef(S);function P(e){let t=pK(S,e);A(e,t)}function j(e){A(e,p.current)}function I(){String(S)!==String(C.current)&&f(S)}function A(e,t,{commit:n}={commit:!1}){let o=pq(a),c=fm(pG(Math.round((e-r)/a)*a+r,o),[r,i]);T((e=[])=>{let r=pB(e,c,t);if(!pV(r,s*a))return e;{p.current=r.indexOf(c);let t=String(r)!==String(e);return t&&n&&f(r),t?r:e}})}return ne.useEffect(()=>{let e=b?k?.ownerDocument.getElementById(b):k?.closest("form");if(e instanceof HTMLFormElement){let t=pl(()=>T(M.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[k,b,T]),pl(P,"handleSlideStart"),pl(j,"handleSlideMove"),pl(I,"handleSlideEnd"),pl(A,"updateValues"),(0,t7.jsx)(py,{scope:e.__scopeSlider,name:n,disabled:c,min:r,max:i,valueIndexToChangeRef:p,thumbs:w.current,values:S,orientation:o,form:b,children:(0,t7.jsx)(pg.Provider,{scope:e.__scopeSlider,children:(0,t7.jsx)(pg.Slot,{scope:e.__scopeSlider,children:(0,t7.jsx)(y?pT:pC,{"aria-disabled":c,"data-disabled":c?"":void 0,...g,ref:E,onPointerDown:fE(g.onPointerDown,()=>{c||(C.current=S,v.current=!1)}),min:r,max:i,inverted:d,onSlideStart:c?void 0:P,onSlideMove:c?void 0:j,onSlideEnd:c?void 0:I,onHomeKeyDown:()=>{c||(v.current=!0,A(r,0,{commit:!0}))},onEndKeyDown:()=>{c||(v.current=!0,A(i,S.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!c){v.current=!0;let n=ph.includes(e.key)||e.shiftKey&&pf.includes(e.key),i=p.current;A(pX(S[i],{min:r,step:a,direction:t,multiplier:n?10:1}),i,{commit:!0})}}})})})})},"Slider")),[pE,pS]=pv(pb,{startEdge:"left",endEdge:"right",size:"width",direction:1}),pT=ne.forwardRef(pl(function(e,t){let{min:n,max:r,dir:i,inverted:a,onSlideStart:o,onSlideMove:c,onSlideEnd:s,onStepKeyDown:u,...l}=e,[h,f]=ne.useState(null),d=fL(t,f),b=ne.useRef(void 0),g=f7(i),w="ltr"===g,p=w&&!a||!w&&a;function v(e){let t=b.current||h.getBoundingClientRect(),i=pU([0,t.width],p?[n,r]:[r,n]);return b.current=t,i(e-t.left)}return pl(v,"getValueFromPointer"),(0,t7.jsx)(pE,{scope:e.__scopeSlider,startEdge:p?"left":"right",endEdge:p?"right":"left",direction:p?1:-1,size:"width",children:(0,t7.jsx)(pM,{dir:g,"data-orientation":"horizontal",...l,ref:d,style:{...l.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{let t=v(e.clientX);o?.(t)},onSlideMove:e=>{let t=v(e.clientX);c?.(t)},onSlideEnd:()=>{b.current=void 0,s?.()},onStepKeyDown:e=>{let t=pd[p?"from-left":"from-right"].includes(e.key);u?.({event:e,direction:t?-1:1})}})})},"SliderHorizontal")),pC=ne.forwardRef(pl(function(e,t){let{min:n,max:r,inverted:i,onSlideStart:a,onSlideMove:o,onSlideEnd:c,onStepKeyDown:s,...u}=e,l=ne.useRef(null),h=fL(t,l),f=ne.useRef(void 0),d=!i;function b(e){let t=f.current||l.current.getBoundingClientRect(),i=pU([0,t.height],d?[r,n]:[n,r]);return f.current=t,i(e-t.top)}return pl(b,"getValueFromPointer"),(0,t7.jsx)(pE,{scope:e.__scopeSlider,startEdge:d?"bottom":"top",endEdge:d?"top":"bottom",size:"height",direction:d?1:-1,children:(0,t7.jsx)(pM,{"data-orientation":"vertical",...u,ref:h,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{let t=b(e.clientY);a?.(t)},onSlideMove:e=>{let t=b(e.clientY);o?.(t)},onSlideEnd:()=>{f.current=void 0,c?.()},onStepKeyDown:e=>{let t=pd[d?"from-bottom":"from-top"].includes(e.key);s?.({event:e,direction:t?-1:1})}})})},"SliderVertical")),pM=ne.forwardRef(pl(function(e,t){let{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:c,onStepKeyDown:s,...u}=e,l=pk(pb,n);return(0,t7.jsx)(dt.span,{...u,ref:t,onKeyDown:fE(e.onKeyDown,e=>{"Home"===e.key?(o(e),e.preventDefault()):"End"===e.key?(c(e),e.preventDefault()):ph.concat(pf).includes(e.key)&&(s(e),e.preventDefault())}),onPointerDown:fE(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),l.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):r(e)}),onPointerMove:fE(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:fE(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})},"SliderImpl")),pP=ne.forwardRef(pl(function(e,t){let{__scopeSlider:n,...r}=e,i=pk("SliderTrack",n);return(0,t7.jsx)(dt.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:t})},"SliderTrack")),pj="SliderRange",pI=ne.forwardRef(pl(function(e,t){let{__scopeSlider:n,...r}=e,i=pk(pj,n),a=pS(pj,n),o=fL(t,ne.useRef(null)),c=i.values.length,s=i.values.map(e=>pF(e,i.min,i.max)),u=c>1?Math.min(...s):0,l=100-Math.max(...s);return(0,t7.jsx)(dt.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:o,style:{...e.style,[a.startEdge]:u+"%",[a.endEdge]:l+"%"}})},"SliderRange")),[pA,pO]=pv("SliderThumb");function pN(e){let{__scopeSlider:t,name:n,children:r,internal_do_not_use_render:i}=e,a=pk("SliderThumbProvider",t),o=pw(t),[c,s]=ne.useState(null),u=ne.useMemo(()=>c?o().findIndex(e=>e.ref.current===c):-1,[o,c]),l=bQ(c),h=!c||!!a.form||!!c.closest("form"),f=a.values[u],d=n??(a.name?a.name+(a.values.length>1?"[]":""):void 0),b=void 0===f?0:pF(f,a.min,a.max);ne.useEffect(()=>{if(c)return a.thumbs.add(c),()=>{a.thumbs.delete(c)}},[c,a.thumbs]);let g={value:f,name:d,form:a.form,isFormControl:h,index:u,thumb:c,onThumbChange:s,percent:b,size:l};return(0,t7.jsx)(pA,{scope:t,...g,children:pW(i)?i(g):r})}pl(pN,"SliderThumbProvider");var pL="SliderThumbTrigger",pD=ne.forwardRef(pl(function(e,t){let{__scopeSlider:n,...r}=e,i=pk(pL,n),a=pS(pL,n),{index:o,value:c,percent:s,size:u,onThumbChange:l}=pO(pL,n),h=fL(t,l),f=p$(o,i.values.length),d=u?.[a.size],b=d?pH(d,s,a.direction):0;return(0,t7.jsx)("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${s}% + ${b}px)`},children:(0,t7.jsx)(pg.ItemSlot,{scope:n,children:(0,t7.jsx)(dt.span,{role:"slider","aria-label":e["aria-label"]||f,"aria-valuemin":i.min,"aria-valuenow":c,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...r,ref:h,style:void 0===c?{display:"none"}:e.style,onFocus:fE(e.onFocus,()=>{i.valueIndexToChangeRef.current=o})})})})},"SliderThumbTrigger")),pR=ne.forwardRef(pl(function(e,t){let{__scopeSlider:n,name:r,...i}=e;return(0,t7.jsx)(pN,{__scopeSlider:n,name:r,internal_do_not_use_render:({index:e,isFormControl:r})=>(0,t7.jsxs)(t7.Fragment,{children:[(0,t7.jsx)(pD,{...i,ref:t,__scopeSlider:n}),r?(0,t7.jsx)(p_,{__scopeSlider:n},e):null]})})},"SliderThumb")),p_=ne.forwardRef(pl(function({__scopeSlider:e,...t},n){let{value:r,name:i,form:a}=pO("SliderBubbleInput",e),o=ne.useRef(null),c=fL(o,n),s=gP(r);return ne.useEffect(()=>{let e=o.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value").set;if(s!==r&&t){let n=new Event("input",{bubbles:!0});t.call(e,r),e.dispatchEvent(n)}},[s,r]),(0,t7.jsx)(dt.input,{style:{display:"none"},name:i,form:a,...t,ref:c,defaultValue:r})},"SliderBubbleInput"));function pB(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}function pF(e,t,n){return fm(100/(n-t)*(e-t),[0,100])}function p$(e,t){return t>2?`Value ${e+1} of ${t}`:2===t?["Minimum","Maximum"][e]:void 0}function pK(e,t){if(1===e.length)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}function pH(e,t,n){let r=e/2,i=pU([0,50],[0,r]);return(r-i(t)*n)*n}function pz(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function pV(e,t){return!(t>0)||Math.min(...pz(e))>=t}function pU(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function pq(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes("e")){let[e,n]=t.split("e"),r=e.split(".")[1]||"",i=Number(n);return Math.max(0,r.length-i)}let n=t.split(".")[1];return n?n.length:0}function pG(e,t){let n=Math.pow(10,t);return Math.round(e*n)/n}function pX(e,{min:t,step:n,direction:r,multiplier:i}){let a,o=pq(n),c=(e-t)/n,s=Math.round(c);return a=pG(s*n+t,o)===pG(e,o)?s+i*r:r>0?Math.ceil(c):Math.floor(c),pG(a*n+t,o)}function pW(e){return"function"==typeof e}pl(pB,"getNextSortedValues"),pl(pF,"convertValueToPercentage"),pl(p$,"getLabel"),pl(pK,"getClosestValueIndex"),pl(pH,"getThumbInBoundsOffset"),pl(pz,"getStepsBetweenValues"),pl(pV,"hasMinStepsBetweenValues"),pl(pU,"linearScale"),pl(pq,"getDecimalCount"),pl(pG,"roundValue"),pl(pX,"getNextStepValue"),pl(pW,"isFunction"),e.s(["Range",0,pI,"Root",0,px,"Slider",0,px,"SliderRange",0,pI,"SliderThumb",0,pR,"SliderTrack",0,pP,"Thumb",0,pR,"Track",0,pP,"createSliderScope",0,pm,"unstable_BubbleInput",0,p_,"unstable_SliderBubbleInput",0,p_,"unstable_SliderThumbProvider",0,pN,"unstable_SliderThumbTrigger",0,pD,"unstable_ThumbProvider",0,pN,"unstable_ThumbTrigger",0,pD],44729);var pY=e.i(44729),pY=pY;function pQ({children:e,title:t}){return(0,t7.jsxs)("section",{children:[(0,t7.jsx)("h3",{className:"mx-6 mt-6 mb-2 text-sm font-bold",children:t}),e]})}var pJ=Object.defineProperty,pZ=(e,t)=>pJ(e,"name",{value:t,configurable:!0}),p1="Switch",[p0,p2]=fP(p1),[p3,p4]=p0(p1);function p5(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:c,onCheckedChange:s,required:u,value:l="on",internal_do_not_use_render:h}=e,[f,d]=gS({prop:n,defaultProp:i??!1,onChange:s,caller:p1}),[b,g]=ne.useState(null),[w,p]=ne.useState(null),v=ne.useRef(!1),[y,k]=ne.useReducer(e=>e+1,0),x=!b||!!o||!!b.closest("form"),E={checked:f,setChecked:d,disabled:a,control:b,setControl:g,name:c,form:o,value:l,hasConsumerStoppedPropagationRef:v,userInteractionCount:y,onUserInteraction:k,required:u,defaultChecked:i,isFormControl:x,bubbleInput:w,setBubbleInput:p};return(0,t7.jsx)(p3,{scope:t,...E,children:ve(h)?h(E):r})}pZ(p5,"SwitchProvider");var p6=ne.forwardRef(pZ(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,form:a,value:o,disabled:c,checked:s,required:u,setControl:l,setChecked:h,hasConsumerStoppedPropagationRef:f,onUserInteraction:d,isFormControl:b,bubbleInput:g}=p4("SwitchTrigger",e),w=fL(r,l),p=ne.useRef(s);return ne.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=pZ(()=>h(p.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[i,a,h]),(0,t7.jsx)(dt.button,{type:"button",role:"switch","aria-checked":s,"aria-required":u,"data-state":vt(s),"data-disabled":c?"":void 0,disabled:c,value:o,...n,ref:w,onClick:fE(t,e=>{d(),h(e=>!e),g&&b&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},"SwitchTrigger")),p8=ne.forwardRef(pZ(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:c,value:s,onCheckedChange:u,form:l,...h}=e;return(0,t7.jsx)(p5,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:c,required:o,onCheckedChange:u,name:r,form:l,value:s,internal_do_not_use_render:({isFormControl:e})=>(0,t7.jsxs)(t7.Fragment,{children:[(0,t7.jsx)(p6,{...h,ref:t,__scopeSwitch:n}),e&&(0,t7.jsx)(p7,{__scopeSwitch:n})]})})},"Switch")),p9=ne.forwardRef(pZ(function(e,t){let{__scopeSwitch:n,...r}=e,i=p4("SwitchThumb",n);return(0,t7.jsx)(dt.span,{"data-state":vt(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})},"SwitchThumb")),p7=ne.forwardRef(pZ(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:c,defaultChecked:s,required:u,disabled:l,name:h,value:f,form:d,bubbleInput:b,setBubbleInput:g}=p4("SwitchBubbleInput",e),w=fL(r,g),p=bQ(i),v=ne.useRef(!1),y=ne.useRef(c),k=ne.useRef(o);ne.useEffect(()=>{if(!b)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=o!==k.current;k.current=o;let n=y.current!==c;y.current=c;let r=!(t&&a.current);if(n&&e){v.current=!t;let n=new Event("click",{bubbles:r});e.call(b,c),b.dispatchEvent(n),v.current=!1}},[b,c,a,o]);let x=ne.useRef(c);return(0,t7.jsx)(dt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??x.current,required:u,disabled:l,name:h,value:f,form:d,...n,tabIndex:-1,ref:w,onClick:fE(t,e=>{v.current&&e.stopPropagation()}),style:{...n.style,...p,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function ve(e){return"function"==typeof e}function vt(e){return e?"checked":"unchecked"}pZ(ve,"isFunction"),pZ(vt,"getState"),e.s(["Root",0,p8,"Switch",0,p8,"SwitchThumb",0,p9,"Thumb",0,p9,"createSwitchScope",0,p2,"unstable_BubbleInput",0,p7,"unstable_Provider",0,p5,"unstable_SwitchBubbleInput",0,p7,"unstable_SwitchProvider",0,p5,"unstable_SwitchTrigger",0,p6,"unstable_Trigger",0,p6],57287);var vn=e.i(57287),vn=vn;function vr({ariaLabel:e,checkedColor:t,id:n,onToggle:r,value:i}){return(0,t7.jsxs)(vn.Root,{"aria-label":e,className:"relative h-[18px] w-[42px] shrink-0 cursor-pointer rounded-full bg-neutral-200 outline-none data-[state=checked]:bg-neutral-200 dark:bg-neutral-800 dark:data-[state=checked]:bg-gray-700",id:n,checked:i,onCheckedChange:r,children:[i&&t?(0,t7.jsx)("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-full opacity-25",style:{backgroundColor:t}}):null,(0,t7.jsx)(vn.Thumb,{className:"relative block size-[16px] translate-x-0.5 rounded-full bg-neutral-500 transition-transform duration-100 will-change-transform data-[state=checked]:translate-x-[24px] data-[state=checked]:bg-blue-500 dark:bg-neutral-500 dark:data-[state=checked]:bg-white",style:i&&t?{backgroundColor:t}:void 0})]})}function vi({id:e,label:t,value:n,onToggle:r}){return(0,t7.jsxs)("div",{className:"flex h-[20px] items-center justify-between",children:[(0,t7.jsx)("label",{className:"pr-[15px] leading-none whitespace-nowrap text-foreground",htmlFor:e,children:t}),(0,t7.jsx)(vr,{ariaLabel:t,id:e,onToggle:r,value:n})]})}function va(){return(0,t7.jsxs)(t7.Fragment,{children:[(0,t7.jsx)(vo,{}),(0,t7.jsx)(vc,{}),(0,t7.jsx)(vs,{}),(0,t7.jsx)(vu,{})]})}function vo(){let{showCompoundNodes:e,showVendorPackages:t,toggleShowCompoundNodes:n,toggleShowVendorPackages:r}=nP();return(0,t7.jsxs)(pQ,{title:nd("settings.filter"),children:[(0,t7.jsx)(fb,{children:(0,t7.jsx)(vi,{id:"switch-show-vendor-packages",label:nd("settings.showVendorPackages"),onToggle:r,value:t})}),(0,t7.jsx)(fb,{children:(0,t7.jsx)(vi,{id:"switch-show-compound-nodes",label:nd("settings.showCompoundNodes"),onToggle:n,value:e})})]})}function vc(){let{maxSubPackageDepth:e,setSubPackageDepth:t,subPackageDepth:n}=nP();return(0,t7.jsx)(pQ,{title:nd("settings.subPackageDepth")+": "+n,children:(0,t7.jsx)(fb,{children:(0,t7.jsx)(vl,{ariaLabel:nd("settings.subPackageDepth"),max:e,min:1,step:1,value:n,onValueChange:t})})})}function vs(){let{cytoscapeLayout:e,setCytoscapeLayout:t}=nP();return(0,t7.jsx)(pQ,{title:nd("settings.layout"),children:(0,t7.jsx)(fb,{children:(0,t7.jsxs)(ps.Root,{value:e,onValueChange:e=>{("breadthfirst"===e||"circle"===e||"concentric"===e||"elk"===e||"grid"===e)&&ne.default.startTransition(()=>t(e))},children:[(0,t7.jsxs)(ps.Trigger,{"aria-label":nd("cytoscapeLayout"),className:"inline-flex h-9 w-full items-center justify-between rounded-md border px-3",children:[(0,t7.jsx)(ps.Value,{className:"text-foreground"}),(0,t7.jsx)(ps.Icon,{children:(0,t7.jsx)(fp,{size:16})})]}),(0,t7.jsx)(ps.Portal,{children:(0,t7.jsx)(ps.Content,{position:"popper",side:"bottom",align:"start",sideOffset:6,className:"z-50 min-w-(--radix-select-trigger-width) rounded-md border bg-white shadow-md dark:bg-neutral-900",children:(0,t7.jsx)(ps.Viewport,{className:"p-1",children:(0,t7.jsx)(ps.Group,{children:["breadthfirst","circle","concentric","elk","grid"].map(e=>(0,t7.jsx)(ps.Item,{value:e,textValue:nd(e),className:"rounded px-2 py-1.5 hover:bg-neutral-100 dark:hover:bg-neutral-800",children:(0,t7.jsx)(ps.ItemText,{children:nd(e)})},e))})})})})]})})})}function vu(){let{cytoscapeLayoutSpacing:e,setCytoscapeLayoutSpacing:t}=nP();return(0,t7.jsx)(pQ,{title:nd("settings.layoutSpacing")+": "+e.toFixed(2),children:(0,t7.jsx)(fb,{children:(0,t7.jsx)(vl,{ariaLabel:nd("settings.layoutSpacing"),max:1,min:.1,step:.01,value:e,onValueChange:t})})})}function vl({ariaLabel:e,max:t,min:n,onValueChange:r,step:i,value:a}){return(0,t7.jsxs)(pY.Root,{min:n,max:t,step:i,value:[a],onValueChange:([e])=>r(e),"aria-label":e,className:"relative flex h-5 w-full touch-none select-none items-center",children:[(0,t7.jsx)(pY.Track,{className:"relative h-1.5 grow rounded-full bg-neutral-200 dark:bg-neutral-800",children:(0,t7.jsx)(pY.Range,{className:"absolute h-1.5 rounded-full bg-blue-600 dark:bg-blue-400"})}),(0,t7.jsx)(pY.Thumb,{className:"block h-4 w-4 rounded-full border border-neutral-300 bg-white shadow focus:outline-none focus:ring-2 focus:ring-blue-500 dark:border-neutral-600 dark:bg-neutral-100"})]})}function vh({children:e}){return(0,t7.jsx)("aside",{className:"flex min-h-0 w-[18rem] min-w-[18rem] max-w-[18rem] shrink-0 self-stretch flex-col overflow-hidden border-r border-r-neutral-200 bg-neutral-100 md:pt-14 dark:border-r-neutral-800 dark:bg-neutral-950",children:e})}var vf=Object.defineProperty,vd=(e,t)=>vf(e,"name",{value:t,configurable:!0}),vb=!1;function vg(){let[e,t]=ne.useState(vb);return ne.useEffect(()=>{vb||(vb=!0,t(!0))},[]),e}vd(vg,"useIsHydrated");var vw=ne[" useSyncExternalStore ".trim().toString()];function vp(){return()=>{}}function vv(){return vw(vp,()=>!0,()=>!1)}vd(vp,"subscribe"),vd(vv,"useIsHydratedModern");var vm="function"==typeof vw?vv:vg,vy=Object.defineProperty,vk=(e,t)=>vy(e,"name",{value:t,configurable:!0}),vx="rovingFocusGroup.onEntryFocus",vE={bubbles:!1,cancelable:!0},vS="RovingFocusGroup",[vT,vC,vM]=fQ(vS),[vP,vj]=fP(vS,[vM]),[vI,vA]=vP(vS),vO=ne.forwardRef(vk(function(e,t){return(0,t7.jsx)(vT.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,t7.jsx)(vT.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,t7.jsx)(vN,{...e,ref:t})})})},"RovingFocusGroup")),vN=ne.forwardRef(vk(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:s,onEntryFocus:u,preventScrollOnEntryFocus:l=!1,...h}=e,f=ne.useRef(null),d=fL(t,f),b=f7(a),[g,w]=gS({prop:o,defaultProp:c??null,onChange:s,caller:vS}),[p,v]=ne.useState(!1),y=dr(u),k=vC(n),x=ne.useRef(!1),[E,S]=ne.useState(0);return ne.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(vx,y),()=>e.removeEventListener(vx,y)},[y]),(0,t7.jsx)(vI,{scope:n,orientation:r,dir:b,loop:i,currentTabStopId:g,onItemFocus:ne.useCallback(e=>w(e),[w]),onItemShiftTab:ne.useCallback(()=>v(!0),[]),onFocusableItemAdd:ne.useCallback(()=>S(e=>e+1),[]),onFocusableItemRemove:ne.useCallback(()=>S(e=>e-1),[]),children:(0,t7.jsx)(dt.div,{tabIndex:p||0===E?-1:0,"data-orientation":r,...h,ref:d,style:{outline:"none",...e.style},onMouseDown:fE(e.onMouseDown,()=>{x.current=!0}),onFocus:fE(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!p){let t=new CustomEvent(vx,vE);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=k().filter(e=>e.focusable);vB([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),l)}}x.current=!1}),onBlur:fE(e.onBlur,()=>v(!1))})})},"RovingFocusGroupImpl")),vL=ne.forwardRef(vk(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...c}=e,s=dH(),u=a||s,l=vA("RovingFocusGroupItem",n),h=l.currentTabStopId===u,f=vC(n),{onFocusableItemAdd:d,onFocusableItemRemove:b,currentTabStopId:g}=l,w=vm();return dB(()=>{if(w&&r)return d(),()=>b()},[w,r,d,b]),ne.useEffect(()=>{if(!w&&r)return d(),()=>b()},[w,r,d,b]),(0,t7.jsx)(vT.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:(0,t7.jsx)(dt.span,{tabIndex:h?0:-1,"data-orientation":l.orientation,...c,ref:t,onMouseDown:fE(e.onMouseDown,e=>{r?l.onItemFocus(u):e.preventDefault()}),onFocus:fE(e.onFocus,()=>l.onItemFocus(u)),onKeyDown:fE(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void l.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=v_(e,l.orientation,l.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)n.reverse();else if("prev"===t||"next"===t){"prev"===t&&n.reverse();let r=n.indexOf(e.currentTarget);n=l.loop?vF(n,r+1):n.slice(r+1)}setTimeout(()=>vB(n))}}),children:"function"==typeof o?o({isCurrentTabStop:h,hasTabStop:null!=g}):o})})},"RovingFocusGroupItem")),vD={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function vR(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}function v_(e,t,n){let r=vR(e.key,n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(r))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)))return vD[r]}function vB(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function vF(e,t){return e.map((n,r)=>e[(t+r)%e.length])}vk(vR,"getDirectionAwareKey"),vk(v_,"getFocusIntent"),vk(vB,"focusFirst"),vk(vF,"wrapArray");var v$=Object.defineProperty,vK=(e,t)=>v$(e,"name",{value:t,configurable:!0}),vH="Tabs",[vz,vV]=fP(vH,[vj]),vU=vj(),[vq,vG]=vz(vH),vX=ne.forwardRef(vK(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o="horizontal",dir:c,activationMode:s="automatic",...u}=e,l=f7(c),[h,f]=gS({prop:r,onChange:i,defaultProp:a??"",caller:vH});return(0,t7.jsx)(vq,{scope:n,baseId:dH(),value:h,onValueChange:f,orientation:o,dir:l,activationMode:s,children:(0,t7.jsx)(dt.div,{dir:l,"data-orientation":o,...u,ref:t})})},"Tabs")),vW=ne.forwardRef(vK(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=vG("TabsList",n),o=vU(n);return(0,t7.jsx)(vO,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,t7.jsx)(dt.div,{role:"tablist","aria-orientation":a.orientation,...i,ref:t})})},"TabsList")),vY=ne.forwardRef(vK(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=vG("TabsTrigger",n),c=vU(n),s=vJ(o.baseId,r),u=vZ(o.baseId,r),l=r===o.value;return(0,t7.jsx)(vL,{asChild:!0,...c,focusable:!i,active:l,children:(0,t7.jsx)(dt.button,{type:"button",role:"tab","aria-selected":l,"aria-controls":u,"data-state":l?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:s,...a,ref:t,onMouseDown:fE(e.onMouseDown,e=>{i||0!==e.button||!1!==e.ctrlKey?e.preventDefault():o.onValueChange(r)}),onKeyDown:fE(e.onKeyDown,e=>{!i&&e.target===e.currentTarget&&[" ","Enter"].includes(e.key)&&o.onValueChange(r)}),onFocus:fE(e.onFocus,()=>{let e="manual"!==o.activationMode;l||i||!e||o.onValueChange(r)})})})},"TabsTrigger")),vQ=ne.forwardRef(vK(function(e,t){let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,c=vG("TabsContent",n),s=vJ(c.baseId,r),u=vZ(c.baseId,r),l=r===c.value,h=ne.useRef(l);return ne.useEffect(()=>{let e=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,t7.jsx)(gh,{present:i||l,children:({present:n})=>(0,t7.jsx)(dt.div,{"data-state":l?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":s,hidden:!n,id:u,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:n&&a})})},"TabsContent"));function vJ(e,t){return`${e}-trigger-${t}`}function vZ(e,t){return`${e}-content-${t}`}vK(vJ,"makeTriggerId"),vK(vZ,"makeContentId"),e.s(["Content",0,vQ,"List",0,vW,"Root",0,vX,"Tabs",0,vX,"TabsContent",0,vQ,"TabsList",0,vW,"TabsTrigger",0,vY,"Trigger",0,vY,"createTabsScope",0,vV],26209);var v1=e.i(26209),v1=v1;function v0({count:e,tone:t="neutral"}){return(0,t7.jsx)("span",{className:"inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full border px-1 text-[10px] font-semibold leading-none "+("danger"===t?"border-red-300 bg-red-50 text-red-700 dark:border-red-900 dark:bg-red-950 dark:text-red-300":"border-neutral-300 text-neutral-700 dark:border-neutral-700 dark:text-neutral-200"),children:e})}function v2({ariaLabel:e,onValueChange:t,tabs:n,value:r}){return(0,t7.jsxs)(v1.Root,{value:r??"",onValueChange:t,className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[(0,t7.jsx)(v1.List,{"aria-label":e,className:"ml-3 flex shrink-0 border-b border-neutral-200 dark:border-neutral-800",children:n.map(e=>(0,t7.jsxs)(v1.Trigger,{value:e.id,disabled:e.disabled,className:"flex flex-1 items-center justify-center gap-1.5 border-b-2 border-transparent px-3 py-2 text-xs text-neutral-500 disabled:cursor-default disabled:opacity-40 data-[state=active]:border-blue-600 data-[state=active]:text-neutral-900 dark:text-neutral-400 dark:data-[state=active]:border-blue-400 dark:data-[state=active]:text-neutral-100",children:[(0,t7.jsx)("span",{children:e.label}),e.badge?(0,t7.jsx)(v0,{count:e.badge,tone:e.badgeTone}):null]},e.id))}),n.map(e=>(0,t7.jsx)(v1.Content,{value:e.id,className:"min-h-0 flex-1 overflow-y-auto border-b border-neutral-200 pb-3 outline-none dark:border-neutral-800",children:e.content},e.id))]})}function v3({cycles:e,cycleSelection:t,inspectedCycleId:n,onCycleInspectionChange:r}){return(0,t7.jsx)(pQ,{title:(0,t7.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t7.jsx)("span",{children:nd("audit.rule.cyclicDependencies")}),(0,t7.jsxs)("span",{className:"text-xs font-normal text-neutral-500 dark:text-neutral-400",children:[e.length," ",nd("audit.cycles")]})]}),children:e.map((e,i)=>(0,t7.jsx)(fb,{children:(0,t7.jsx)(v4,{color:nA(i),cycle:e,index:i,inspected:n===nO(e),selected:t.selectedIds.includes(nO(e)),onInspect:()=>{var t;return r(n===nO(e)?null:(t=nd("audit.cycle")+" "+(i+1),{...nN(e,i),label:t}))},onSelectedChange:i=>{t.setSelected(nO(e),i),i||n!==nO(e)||r(null)}})},nO(e)))})}function v4({color:e,cycle:t,index:n,inspected:r,onInspect:i,onSelectedChange:a,selected:o}){let c=t.packages.join(" → "),s=new Set(t.packages).size,u=nd("audit.cycle")+" "+(n+1);return(0,t7.jsxs)("div",{className:"flex items-start gap-2 rounded px-1 py-1",style:o||r?{backgroundColor:e+"1a"}:void 0,children:[(0,t7.jsxs)("button",{type:"button",onClick:i,"aria-expanded":r,className:"min-w-0 flex-1 cursor-pointer rounded text-left focus-visible:outline-2 focus-visible:outline-offset-2",style:r?{boxShadow:`inset 3px 0 ${e}`,paddingLeft:6}:void 0,title:c,children:[(0,t7.jsxs)("span",{className:"flex items-center gap-1.5 text-xs font-medium",children:[(0,t7.jsx)("span",{children:u}),(0,t7.jsxs)("span",{className:"ml-auto shrink-0 text-[10px] font-normal text-neutral-500 dark:text-neutral-400",children:[s," pkg"]})]}),(0,t7.jsx)("code",{className:"mt-1 block truncate text-[11px] text-neutral-500 dark:text-neutral-400",children:c})]}),(0,t7.jsx)(vr,{ariaLabel:u,checkedColor:e,id:"switch-audit-cycle-"+n,onToggle:()=>a(!o),value:o})]})}function v5({evaluation:e,cycleSelection:t,inspectedCycleId:n,onCycleInspectionChange:r}){return(0,t7.jsx)(t7.Fragment,{children:e.rules.filter(e=>"failed"===e.status).map(i=>(0,t7.jsx)(v6,{evaluation:e,rule:i,cycleSelection:t,inspectedCycleId:n,onCycleInspectionChange:r},i.id))})}function v6({evaluation:e,cycleSelection:t,inspectedCycleId:n,onCycleInspectionChange:r,rule:i}){return"cyclic-dependencies"===i.id?(0,t7.jsx)(v3,{cycles:e.cyclicPackages,cycleSelection:t,inspectedCycleId:n,onCycleInspectionChange:r}):(0,t7.jsx)(pQ,{title:i.id,children:i.details.map((e,t)=>(0,t7.jsx)(fb,{children:(0,t7.jsx)("code",{className:"block truncate text-[11px]",title:e,children:e})},e+":"+t))})}function v8({evaluation:e,cycleSelection:t,inspectedCycleId:n,onCycleInspectionChange:r}){return(0,t7.jsx)(v5,{evaluation:e,cycleSelection:t,inspectedCycleId:n,onCycleInspectionChange:r})}function v9({expanded:e,hasChildren:t,variant:n}){return"chevron"!==n||t?(0,t7.jsx)("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round",strokeLinecap:"round",children:(0,t7.jsx)("path",{d:"chevron"===n?e?"m5 8 5 5 5-5":"m8 5 5 5-5 5":t?e?"M2 7V4h6l2 2h8v2 M2 8h17l-3 9H2z":"M2 4h6l2 2h8v11H2z":"M5 2h6l4 4v12H5z M11 2v5h4"})}):null}function v7(e){var t,n,r,i;let{node:a}=e,o=void 0!==a.children&&a.children.length>0,c=e.expandedIds.includes(a.id),s=e.selectedId===a.id,u=e.renderItem?.({node:a,depth:e.depth,selected:s,expanded:c,hasChildren:o})??(0,t7.jsx)(me,{node:a,showIcon:"chevron"===e.expansionIndicator});return(0,t7.jsxs)(t7.Fragment,{children:[(0,t7.jsxs)("div",{"aria-disabled":!0===a.disabled||void 0,"aria-expanded":o?c:void 0,"aria-selected":s,onClick:()=>{var t;(t=e).node.disabled||t.onSelect?.(t.node.id)},onKeyDown:t=>{var n,r;return n=t,void((r=e).node.disabled||"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),r.onSelect?.(r.node.id)))},role:"treeitem",tabIndex:a.disabled||void 0===e.onSelect?void 0:0,style:(t=e.depth,n=s,r=a.disabled,i=void 0!==e.onSelect,{...mi,background:n?"color-mix(in srgb, currentColor 10%, transparent)":"transparent",cursor:r?"default":i?"pointer":"inherit",opacity:r?.5:1,paddingLeft:16*t+6}),children:[(0,t7.jsx)(mn,{disabled:a.disabled,expanded:c,indicator:e.expansionIndicator,hasChildren:o,nodeId:a.id,onToggleExpand:e.onToggleExpand}),u,(0,t7.jsx)(mt,{actions:a.actions})]}),o&&c?(0,t7.jsx)(mr,{...e}):null]})}function me({node:e,showIcon:t}){return(0,t7.jsxs)(t7.Fragment,{children:[t&&void 0!==e.icon?(0,t7.jsx)("span",{"aria-hidden":"true",style:mo,children:e.icon}):null,(0,t7.jsx)("span",{style:mc,children:e.label}),void 0===e.meta?null:(0,t7.jsx)("span",{style:ms,children:e.meta})]})}function mt({actions:e}){return void 0===e?null:(0,t7.jsx)("span",{onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),style:ma,children:e})}function mn(e){let t=(0,t7.jsx)(v9,{expanded:e.expanded,hasChildren:e.hasChildren,variant:e.indicator});return e.hasChildren?(0,t7.jsx)("button",{"aria-label":e.expanded?"Collapse":"Expand",disabled:e.disabled,onKeyDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),e.onToggleExpand(e.nodeId)},style:mu,type:"button",children:t}):(0,t7.jsx)("span",{"aria-hidden":"true",style:mu,children:t})}function mr(e){return(0,t7.jsx)("div",{role:"group",children:e.node.children?.map(t=>(0,ne.createElement)(v7,{...e,key:t.id,depth:e.depth+1,node:t}))})}var mi={alignItems:"center",borderRadius:6,display:"flex",gap:6,minHeight:28,paddingRight:4,userSelect:"none"},ma={display:"inline-flex",flexShrink:0},mo=ma,mc={flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},ms={flexShrink:0,opacity:.65},mu={alignItems:"center",appearance:"none",background:"transparent",border:0,color:"inherit",cursor:"pointer",display:"inline-flex",flexShrink:0,font:"inherit",height:24,justifyContent:"center",padding:0,width:24};function ml({nodes:e,selectedId:t,expandedIds:n,defaultExpandedIds:r,onSelect:i,onExpandedChange:a,renderItem:o,expansionIndicator:c="folder",className:s,style:u,ariaLabel:l="Tree"}){let[h,f]=ne.default.useState(r??[]),d=void 0!==n,b=d?n:h,g=ne.default.useCallback(e=>{let t=b.includes(e)?b.filter(t=>t!==e):[...b,e];d||f(t),a?.(t)},[b,d,a]);return(0,t7.jsx)("div",{"aria-label":l,className:s,role:"tree",style:{...mh,...u},children:e.map(e=>(0,t7.jsx)(v7,{depth:0,expandedIds:b,expansionIndicator:c,node:e,onSelect:i,onToggleExpand:g,renderItem:o,selectedId:t},e.id))})}var mh={display:"flex",flexDirection:"column",minWidth:0};let mf=na("file-code-2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]),md=na("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);function mb(e,t){for(let n of e){if(n.id===t)return n;let e=n.children?mb(n.children,t):null;if(e)return e}return null}function mg(e,t,n){if(null===t)return n;let r=mb(e,t);return[...new Set([...n,...function e(t,n,r){for(let i of t){if(i.id===n)return r;if(!i.children)continue;let t=e(i.children,n,[...r,i.id]);if(null!==t)return t}return null}(e,t,[])??[],...r?.kind==="directory"?[t]:[]])]}function mw({nodes:e,onSelect:t,selectedId:n}){let r=ne.default.useMemo(()=>e.map(mp),[e]),i=function(e,t){let[n,r]=(0,ne.useState)(()=>({nodes:e,selectedId:t,ids:mg(e,t,e.filter(e=>"directory"===e.kind).map(e=>e.id))}));return(n.nodes!==e||n.selectedId!==t)&&r({nodes:e,selectedId:t,ids:mg(e,t,n.ids)}),{expandedIds:n.ids,onExpandedChange:n=>r({nodes:e,selectedId:t,ids:n})}}(e,n);return(0,t7.jsx)("div",{className:"px-2 pt-2 text-xs",children:(0,t7.jsx)(ml,{ariaLabel:"Project tree",expansionIndicator:"folder",expandedIds:i.expandedIds,nodes:r,selectedId:n??void 0,onExpandedChange:i.onExpandedChange,onSelect:n=>{let r=mb(e,n);r&&t(r)}})})}function mp(e){return{id:e.id,label:e.label,icon:"directory"===e.kind?(0,t7.jsx)(md,{"aria-hidden":!0,size:14}):(0,t7.jsx)(mf,{"aria-hidden":!0,size:14}),...e.children?{children:e.children.map(mp)}:{}}}function mv(e){let[t,n]=ne.default.useState("tree");return(0,t7.jsxs)(vh,{children:[(0,t7.jsx)(mm,{activeTool:t,evaluation:e.evaluation,cycleSelection:e.cycleSelection,inspectedCycleId:e.inspectedCycleId,onCycleInspectionChange:e.onCycleInspectionChange,onProjectTreeSelect:e.onProjectTreeSelect,onValueChange:r=>{"rules"===t&&"rules"!==r&&e.onCycleInspectionChange(null),n(r)},projectTree:e.projectTree,selectedTreeId:e.selectedTreeId}),(0,t7.jsx)("div",{className:"shrink-0",children:(0,t7.jsx)(va,{})})]})}function mm({activeTool:e,evaluation:t,cycleSelection:n,inspectedCycleId:r,onCycleInspectionChange:i,onProjectTreeSelect:a,onValueChange:o,projectTree:c,selectedTreeId:s}){let u=t?.rules.filter(e=>"failed"===e.status).length??0,l=t?.rules.filter(e=>"failed"===e.status).reduce((e,n)=>e+("cyclic-dependencies"===n.id?t.cyclicPackages.length:n.details.length),0)??0;return(0,t7.jsx)(v2,{ariaLabel:nd("sidebar.tools"),value:e,onValueChange:o,tabs:[{id:"tree",label:nd("settings.tree"),content:(0,t7.jsx)(mw,{nodes:c,selectedId:s,onSelect:a})},{id:"rules",label:`${nd("settings.rules")} \xb7 ${l} ${nd("audit.findings")}`,disabled:0===u,content:null===t?null:(0,t7.jsx)(v8,{evaluation:t,cycleSelection:n,inspectedCycleId:r,onCycleInspectionChange:i})},{id:"export",label:nd("settings.export"),content:(0,t7.jsx)(fg,{})}]})}let my=[];e.s(["default",0,function({project:e}){let[t,n]=(0,ne.useState)(""),r=e.ok?e.value.graph:null,i=e.ok?e.value.tree:[],[a,o]=(0,ne.useState)(null),c=e.ok?e.value.evaluation:null,s=e.ok?null:e.error,u=function(e){let[t,n]=nm("pkgviz:cycles:v1:/Users/a_rtiphishl_e/git/_java/coderadar/coderadar-core","{}"),r=(0,ne.useMemo)(()=>nL(t),[t]),i=nT().showCycles,a=(0,ne.useMemo)(()=>{let t;return t=new Map(nj(r)?Object.entries(r):[]),e.flatMap(e=>{let n=nO(e),r=t.get(n);return("boolean"==typeof r?r:i)?[n]:[]})},[e,r,i]),o=(0,ne.useMemo)(()=>e.flatMap((e,t)=>{let n=nO(e);return a.includes(n)?[nN(e,t)]:[]}),[e,a]),c=(0,ne.useCallback)((e,t)=>{n(n=>JSON.stringify({...nL(n),[e]:t}))},[n]);return(0,ne.useMemo)(()=>({highlights:o,selectedIds:a,setSelected:c}),[o,a,c])}(c?.cyclicPackages??my),[l,h]=(0,ne.useState)(null),f=e=>{let t,r=e.replaceAll("/",".").replace(/^\.+|\.+$/g,""),a=(t=function e(t,n){return t.flatMap(t=>[...t.children?e(t.children,n):[],...t.graphPackage===n?[t]:[]])}(i,r)).find(e=>"directory"===e.kind)??t.at(0)??null;n(r),o(a?.id??null)};return(0,t7.jsxs)(t7.Fragment,{children:[(0,t7.jsx)(nw,{title:"nav.packages",children:(0,t7.jsx)(nu,{path:t.replace(/\./g,"/"),onNavigate:f})}),(0,t7.jsx)(nM,{children:(0,t7.jsxs)("main",{"data-testid":"main",className:"flex min-h-0 min-w-0 flex-1 flex-row overflow-hidden dark:bg-[#171717]",children:[(0,t7.jsx)(mv,{evaluation:c,projectTree:i,selectedTreeId:a,onProjectTreeSelect:e=>{o(e.id),n(function(e,t,n){let r=e.graphPackage.replaceAll("/",".").replace(/^\.+|\.+$/g,"");if(!r)return n;let i=r+".";return t.some(e=>e.startsWith(i))?r:n}(e,r?.nodes.map(e=>String(e.data.id??""))??[],t))},cycleSelection:u,inspectedCycleId:l?.id??null,onCycleInspectionChange:h}),s?(0,t7.jsx)(np,{message:s}):(0,t7.jsx)(fu,{currentPackage:t,cycleHighlights:u.highlights,cycleInspection:l,packageGraph:r,setCurrentPackage:f,onCloseInspection:()=>h(null)})]})})]})}],93668)}]);