@prismicio/editor-ui 0.4.33 → 0.4.34-alpha-dialog-animation-callback.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Dialog/Dialog.d.ts +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +29 -27
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -486,7 +486,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
486
486
|
border-left: 0;
|
|
487
487
|
border-right: 0;
|
|
488
488
|
}
|
|
489
|
-
`,vj=1,yj=3,$j=function(t){JF(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.imageRef=f.createRef(),n.videoRef=f.createRef(),n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc=document,n.currentWindow=window,n.state={cropSize:null,hasWheelJustStarted:!1},n.preventZoomSafari=function(r){return r.preventDefault()},n.cleanEvents=function(){n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd)},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var r=n.computeSizes();r&&(n.emitCropData(),n.setInitialCrop(r)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(r){if(n.props.initialCroppedAreaPercentages){var o=hj(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),i=o.crop,a=o.zoom;n.props.onCropChange(i),n.props.onZoomChange&&n.props.onZoomChange(a)}else if(n.props.initialCroppedAreaPixels){var s=mj(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),i=s.crop,a=s.zoom;n.props.onCropChange(i),n.props.onZoomChange&&n.props.onZoomChange(a)}},n.computeSizes=function(){var r,o,i,a,s,l,c=n.imageRef.current||n.videoRef.current;if(c&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect();var d=n.containerRect.width/n.containerRect.height,u=((r=n.imageRef.current)===null||r===void 0?void 0:r.naturalWidth)||((o=n.videoRef.current)===null||o===void 0?void 0:o.videoWidth)||0,h=((i=n.imageRef.current)===null||i===void 0?void 0:i.naturalHeight)||((a=n.videoRef.current)===null||a===void 0?void 0:a.videoHeight)||0,p=c.offsetWidth<u||c.offsetHeight<h,m=u/h,b=void 0;if(p)switch(n.props.objectFit){default:case"contain":b=d>m?{width:n.containerRect.height*m,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/m};break;case"horizontal-cover":b={width:n.containerRect.width,height:n.containerRect.width/m};break;case"vertical-cover":b={width:n.containerRect.height*m,height:n.containerRect.height};break;case"auto-cover":b=u>h?{width:n.containerRect.width,height:n.containerRect.width/m}:{width:n.containerRect.height*m,height:n.containerRect.height};break}else b={width:c.offsetWidth,height:c.offsetHeight};n.mediaSize=Ze(Ze({},b),{naturalWidth:u,naturalHeight:h}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var v=n.props.cropSize?n.props.cropSize:lj(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(((s=n.state.cropSize)===null||s===void 0?void 0:s.height)!==v.height||((l=n.state.cropSize)===null||l===void 0?void 0:l.width)!==v.width)&&n.props.onCropSizeChange&&n.props.onCropSizeChange(v),n.setState({cropSize:v},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(v),v}},n.onMouseDown=function(r){r.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.onDragStart(e.getMousePoint(r))},n.onMouseMove=function(r){return n.onDrag(e.getMousePoint(r))},n.onTouchStart=function(r){n.isTouching=!0,!(n.props.onTouchRequest&&!n.props.onTouchRequest(r))&&(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),r.touches.length===2?n.onPinchStart(r):r.touches.length===1&&n.onDragStart(e.getTouchPoint(r.touches[0])))},n.onTouchMove=function(r){r.preventDefault(),r.touches.length===2?n.onPinchMove(r):r.touches.length===1&&n.onDrag(e.getTouchPoint(r.touches[0]))},n.onGestureStart=function(r){r.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation},n.onGestureMove=function(r){if(r.preventDefault(),!n.isTouching){var o=e.getMousePoint(r),i=n.gestureZoomStart-1+r.scale;if(n.setNewZoom(i,o,{shouldUpdatePosition:!0}),n.props.onRotationChange){var a=n.gestureRotationStart+r.rotation;n.props.onRotationChange(a)}}},n.onGestureEnd=function(r){n.cleanEvents()},n.onDragStart=function(r){var o,i,a=r.x,s=r.y;n.dragStartPosition={x:a,y:s},n.dragStartCrop=Ze({},n.props.crop),(i=(o=n.props).onInteractionStart)===null||i===void 0||i.call(o)},n.onDrag=function(r){var o=r.x,i=r.y;n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame(function(){if(n.state.cropSize&&!(o===void 0||i===void 0)){var a=o-n.dragStartPosition.x,s=i-n.dragStartPosition.y,l={x:n.dragStartCrop.x+a,y:n.dragStartCrop.y+s},c=n.props.restrictPosition?Cs(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(c)}})},n.onDragStopped=function(){var r,o;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),(o=(r=n.props).onInteractionEnd)===null||o===void 0||o.call(r)},n.onWheel=function(r){if(!(n.props.onWheelRequest&&!n.props.onWheelRequest(r))){r.preventDefault();var o=e.getMousePoint(r),i=sj(r).pixelY,a=n.props.zoom-i*n.props.zoomSpeed/200;n.setNewZoom(a,o,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},function(){var s,l;return(l=(s=n.props).onInteractionStart)===null||l===void 0?void 0:l.call(s)}),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout(function(){return n.setState({hasWheelJustStarted:!1},function(){var s,l;return(l=(s=n.props).onInteractionEnd)===null||l===void 0?void 0:l.call(s)})},250)}},n.getPointOnContainer=function(r){var o=r.x,i=r.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(o-n.containerRect.left),y:n.containerRect.height/2-(i-n.containerRect.top)}},n.getPointOnMedia=function(r){var o=r.x,i=r.y,a=n.props,s=a.crop,l=a.zoom;return{x:(o+s.x)/l,y:(i+s.y)/l}},n.setNewZoom=function(r,o,i){var a=(i===void 0?{}:i).shouldUpdatePosition,s=a===void 0?!0:a;if(!(!n.state.cropSize||!n.props.onZoomChange)){var l=xc(r,n.props.minZoom,n.props.maxZoom);if(s){var c=n.getPointOnContainer(o),d=n.getPointOnMedia(c),u={x:d.x*l-c.x,y:d.y*l-c.y},h=n.props.restrictPosition?Cs(u,n.mediaSize,n.state.cropSize,l,n.props.rotation):u;n.props.onCropChange(h)}n.props.onZoomChange(l)}},n.getCropData=function(){if(!n.state.cropSize)return null;var r=n.props.restrictPosition?Cs(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;return dj(r,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition)},n.emitCropData=function(){var r=n.getCropData();if(r){var o=r.croppedAreaPercentages,i=r.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(o,i),n.props.onCropAreaChange&&n.props.onCropAreaChange(o,i)}},n.emitCropAreaChange=function(){var r=n.getCropData();if(r){var o=r.croppedAreaPercentages,i=r.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(o,i)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var r=n.props.restrictPosition?Cs(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(r),n.emitCropData()}},n}return e.prototype.componentDidMount=function(){this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=bj,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef)},e.prototype.componentWillUnmount=function(){var n;this.currentWindow.removeEventListener("resize",this.computeSizes),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((n=this.styleRef.parentNode)===null||n===void 0||n.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},e.prototype.componentDidUpdate=function(n){var r,o,i,a,s,l,c,d,u;n.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):n.aspect!==this.props.aspect?this.computeSizes():n.zoom!==this.props.zoom?this.recomputeCropPosition():((r=n.cropSize)===null||r===void 0?void 0:r.height)!==((o=this.props.cropSize)===null||o===void 0?void 0:o.height)||((i=n.cropSize)===null||i===void 0?void 0:i.width)!==((a=this.props.cropSize)===null||a===void 0?void 0:a.width)?this.computeSizes():(((s=n.crop)===null||s===void 0?void 0:s.x)!==((l=this.props.crop)===null||l===void 0?void 0:l.x)||((c=n.crop)===null||c===void 0?void 0:c.y)!==((d=this.props.crop)===null||d===void 0?void 0:d.y))&&this.emitCropAreaChange(),n.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),n.video!==this.props.video&&((u=this.videoRef.current)===null||u===void 0||u.load())},e.prototype.getAspect=function(){var n=this.props,r=n.cropSize,o=n.aspect;return r?r.width/r.height:o},e.prototype.onPinchStart=function(n){var r=e.getTouchPoint(n.touches[0]),o=e.getTouchPoint(n.touches[1]);this.lastPinchDistance=I0(r,o),this.lastPinchRotation=N0(r,o),this.onDragStart(A0(r,o))},e.prototype.onPinchMove=function(n){var r=this,o=e.getTouchPoint(n.touches[0]),i=e.getTouchPoint(n.touches[1]),a=A0(o,i);this.onDrag(a),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var s=I0(o,i),l=r.props.zoom*(s/r.lastPinchDistance);r.setNewZoom(l,a,{shouldUpdatePosition:!1}),r.lastPinchDistance=s;var c=N0(o,i),d=r.props.rotation+(c-r.lastPinchRotation);r.props.onRotationChange&&r.props.onRotationChange(d),r.lastPinchRotation=c})},e.prototype.render=function(){var n=this,r=this.props,o=r.image,i=r.video,a=r.mediaProps,s=r.transform,l=r.crop,c=l.x,d=l.y,u=r.rotation,h=r.zoom,p=r.cropShape,m=r.showGrid,b=r.style,v=b.containerStyle,y=b.cropAreaStyle,$=b.mediaStyle,x=r.classes,C=x.containerClassName,w=x.cropAreaClassName,D=x.mediaClassName,E=r.objectFit;return f.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(M){return n.containerRef=M},"data-testid":"container",style:v,className:ws("reactEasyCrop_Container",C)},o?f.createElement("img",Ze({alt:"",className:ws("reactEasyCrop_Image",E==="contain"&&"reactEasyCrop_Contain",E==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",E==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",E==="auto-cover"&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),D)},a,{src:o,ref:this.imageRef,style:Ze(Ze({},$),{transform:s||"translate("+c+"px, "+d+"px) rotate("+u+"deg) scale("+h+")"}),onLoad:this.onMediaLoad})):i&&f.createElement("video",Ze({autoPlay:!0,loop:!0,muted:!0,className:ws("reactEasyCrop_Video",E==="contain"&&"reactEasyCrop_Contain",E==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",E==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",E==="auto-cover"&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),D)},a,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:Ze(Ze({},$),{transform:s||"translate("+c+"px, "+d+"px) rotate("+u+"deg) scale("+h+")"}),controls:!1}),(Array.isArray(i)?i:[{src:i}]).map(function(_){return f.createElement("source",Ze({key:_.src},_))})),this.state.cropSize&&f.createElement("div",{style:Ze(Ze({},y),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:ws("reactEasyCrop_CropArea",p==="round"&&"reactEasyCrop_CropAreaRound",m&&"reactEasyCrop_CropAreaGrid",w)}))},e.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:yj,minZoom:vj,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},e.getMousePoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},e.getTouchPoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},e}(f.Component);const xj=$j,Cj="_cropperContainer_h5pvp_1 _checkerboard_19dw7_1",wj="_media_h5pvp_15",_j="_cropArea_h5pvp_21",Sj="_cropperReady_h5pvp_61",_s={cropperContainer:Cj,media:wj,cropArea:_j,cropperReady:Sj,"fade-in":"_fade-in_h5pvp_1"},Ej=t=>{const[e,n]=f.useState(!1);return g.jsx(xj,{...t,disableAutomaticStylesInjection:!0,classes:{containerClassName:z(_s.cropperContainer,e&&_s.cropperReady),cropAreaClassName:_s.cropArea,mediaClassName:_s.media},onMediaLoaded:()=>n(!0)})},kj="_timeField_xn8xl_1",Dj="_segments_xn8xl_13",L0={timeField:kj,segments:Dj};function Pj(t){const{defaultValue:e,minValue:n,onChange:r,sx:o}=t,i=f.useRef(null),a=st(),s=Dh(),l=gR({locale:s,placeholderValue:qo(a).set({second:0}),defaultValue:e,minValue:n==="now"?qo(a):void 0,onChange:r,shouldForceLeadingZeros:!0}),{fieldProps:c}=nR({"aria-labelledby":"time-field"},l,i);return g.jsxs("div",{className:L0.timeField,style:o,children:[g.jsx(le,{name:"schedule",size:"medium",color:"grey11"}),g.jsx("div",{...c,className:L0.segments,ref:i,children:l.segments.map((d,u)=>g.jsx(r3,{segment:d,state:l},u))})]})}const Mj="_actionContainer_15ig0_1",Tj={actionContainer:Mj};function Rj(t){const{value:e,minValue:n,minTime:r,onSubmit:o,disabled:i=!1,triggerSize:a="small",label:s,fallback:l="No date selected"}=t,[c,d]=f.useState(v5(e??new Date,st())),u=f.useRef(null),h=Dh(),p=e&&SM(e==null?void 0:e.toISOString()),m={"aria-labelledby":"date-picker",placeholderValue:void 0,value:c,onChange:d},b=v$({...m,shouldCloseOnSelect:!1}),{calendarProps:v}=p$(m,b,u);function y(){b.setOpen(!b.isOpen)}function $(M){var I;(I=v.onChange)==null||I.call(v,M)}function x(M){var I;b.setTimeValue(M),(I=v.onChange)==null||I.call(v,b.dateValue)}function C(){o==null||o(b.dateValue.toDate(st())),y()}const w=r==="now"?Ij(c):!0,D=n==="today"?c>ro(st()):!0,E=D&&w;function _(){return D?w?"":"The time must be after now":"The date must be after today"}return g.jsx(di,{open:b.isOpen,align:"start",sideOffset:4,anchor:g.jsx(Se,{ref:u,size:a,color:"grey",onClick:y,disabled:i,hiddenLabel:s,children:e?vg.prettyPrintDate(e,h):l}),onInteractOutside:y,onEscapeKeyDown:y,children:g.jsxs(ve,{flexDirection:"column",gap:8,backgroundColor:"grey1",borderRadius:4,border:!0,boxShadow:"3",children:[g.jsx(e3,{value:v.value??void 0,onValueChange:$,minValue:n,border:!1}),g.jsxs("div",{className:Tj.actionContainer,children:[g.jsx(Pj,{defaultValue:p,onChange:x,sx:{flexGrow:1}}),g.jsx(ao,{content:_(),visible:!E,children:g.jsx(Se,{onClick:C,disabled:!E,children:"Apply"})})]})]})})}function Ij(t){const e=t.toDate(st()),n=e.getHours(),r=e.getMinutes(),o=qo(st()).toDate(),i=o.getHours(),a=o.getMinutes();function s(l){return l.getDate()===o.getDate()&&l.getMonth()===o.getMonth()&&l.getFullYear()===o.getFullYear()}return s(e)?n>i||n===i&&r>a:!0}const l7="Dialog",[c7,IQ]=hn(l7),[Nj,bn]=c7(l7),Aj=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!0}=t,s=f.useRef(null),l=f.useRef(null),[c=!1,d]=dr({prop:r,defaultProp:o,onChange:i});return f.createElement(Nj,{scope:e,triggerRef:s,contentRef:l,contentId:Pn(),titleId:Pn(),descriptionId:Pn(),open:c,onOpenChange:d,onOpenToggle:f.useCallback(()=>d(u=>!u),[d]),modal:a},n)},Lj="DialogTrigger",Oj=f.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=bn(Lj,n),i=Ee(e,o.triggerRef);return f.createElement(ye.button,F({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":np(o.open)},r,{ref:i,onClick:oe(t.onClick,o.onOpenToggle)}))}),d7="DialogPortal",[Vj,u7]=c7(d7,{forceMount:void 0}),Fj=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:o}=t,i=bn(d7,e);return f.createElement(Vj,{scope:e,forceMount:n},f.Children.map(r,a=>f.createElement(pn,{present:n||i.open},f.createElement(Ca,{asChild:!0,container:o},a))))},vf="DialogOverlay",jj=f.forwardRef((t,e)=>{const n=u7(vf,t.__scopeDialog),{forceMount:r=n.forceMount,...o}=t,i=bn(vf,t.__scopeDialog);return i.modal?f.createElement(pn,{present:r||i.open},f.createElement(Bj,F({},o,{ref:e}))):null}),Bj=f.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=bn(vf,n);return f.createElement(Qf,{as:zr,allowPinchZoom:!0,shards:[o.contentRef]},f.createElement(ye.div,F({"data-state":np(o.open)},r,{ref:e,style:{pointerEvents:"auto",...r.style}})))}),ma="DialogContent",Hj=f.forwardRef((t,e)=>{const n=u7(ma,t.__scopeDialog),{forceMount:r=n.forceMount,...o}=t,i=bn(ma,t.__scopeDialog);return f.createElement(pn,{present:r||i.open},i.modal?f.createElement(zj,F({},o,{ref:e})):f.createElement(Kj,F({},o,{ref:e})))}),zj=f.forwardRef((t,e)=>{const n=bn(ma,t.__scopeDialog),r=f.useRef(null),o=Ee(e,n.contentRef,r);return f.useEffect(()=>{const i=r.current;if(i)return Wl(i)},[]),f.createElement(f7,F({},t,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:oe(t.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:oe(t.onPointerDownOutside,i=>{const a=i.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&i.preventDefault()}),onFocusOutside:oe(t.onFocusOutside,i=>i.preventDefault())}))}),Kj=f.forwardRef((t,e)=>{const n=bn(ma,t.__scopeDialog),r=f.useRef(!1),o=f.useRef(!1);return f.createElement(f7,F({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a;if((a=t.onCloseAutoFocus)===null||a===void 0||a.call(t,i),!i.defaultPrevented){var s;r.current||(s=n.triggerRef.current)===null||s===void 0||s.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var a,s;(a=t.onInteractOutside)===null||a===void 0||a.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((s=n.triggerRef.current)===null||s===void 0?void 0:s.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),f7=f.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=t,s=bn(ma,n),l=f.useRef(null),c=Ee(e,l);return Bf(),f.createElement(f.Fragment,null,f.createElement(Hl,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},f.createElement(xa,F({role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":np(s.open)},a,{ref:c,onDismiss:()=>s.onOpenChange(!1)}))),!1)}),Wj="DialogTitle",Zj=f.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=bn(Wj,n);return f.createElement(ye.h2,F({id:o.titleId},r,{ref:e}))}),Uj="DialogClose",Gj=f.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=bn(Uj,n);return f.createElement(ye.button,F({type:"button"},r,{ref:e,onClick:oe(t.onClick,()=>o.onOpenChange(!1))}))});function np(t){return t?"open":"closed"}const h7=Aj,p7=Oj,m7=Fj,qj=jj,g7=Hj,Yj=Zj,b7=Gj,Jj="_overlay_12fyf_1",Xj="_container_12fyf_23",Qj="_child_12fyf_76",eB="_header_12fyf_128",tB="_headerIcon_12fyf_142",nB="_closeButton_12fyf_147",rB="_content_12fyf_153",oB="_actions_12fyf_165",iB="_footer_12fyf_177",aB="_link_12fyf_181",dt={overlay:Jj,"fade-in":"_fade-in_12fyf_1","fade-out":"_fade-out_12fyf_1",container:Xj,"container-large":"_container-large_12fyf_52","container-small":"_container-small_12fyf_57","container-center":"_container-center_12fyf_61","position-center-in":"_position-center-in_12fyf_1","position-center-out":"_position-center-out_12fyf_1",child:Qj,"position-child-center-in":"_position-child-center-in_12fyf_1","position-child-center-out":"_position-child-center-out_12fyf_1","container-top":"_container-top_12fyf_89","position-top-in":"_position-top-in_12fyf_1","position-top-out":"_position-top-out_12fyf_1","container-bottomRight":"_container-bottomRight_12fyf_115","position-bottom-right-in":"_position-bottom-right-in_12fyf_1","position-bottom-right-out":"_position-bottom-right-out_12fyf_1",header:eB,headerIcon:tB,closeButton:nB,content:rB,"contentPadding-16":"_contentPadding-16_12fyf_161",actions:oB,footer:iB,link:aB},sB="_container_1xbd4_1",lB="_fadeIn_1xbd4_1",cB="_fadeOut_1xbd4_1",dB={container:sB,fadeIn:lB,fadeOut:cB};function uB(t){const{trigger:e,children:n,onAnimationEnd:r,onEscapeKeyDown:o,...i}=t;return g.jsxs(h7,{...i,children:[e&&g.jsx(p7,{asChild:!0,children:e}),g.jsx(m7,{children:g.jsx(g7,{className:dB.container,onAnimationEnd:r,onEscapeKeyDown:o,children:n})})]})}function fB(t){const{trigger:e,children:n,renderTooltip:r=y=>y,onAnimationEnd:o,size:i="large",hasClose:a=!0,modal:s=!0,position:l="top",onPointerDownOutside:c,...d}=t;function u(y){(i==="fullscreen"||s===!1)&&y.preventDefault()}const h=bB(),p=f.useRef(null);if(i==="fullscreen")return g.jsx(uB,{...t,onEscapeKeyDown:u});const m=i==="large"||i==="small",b=m?void 0:i,v=g.jsxs(g7,{style:{...b,top:h},className:z(dt.container,dt[`container-${l}`],m&&dt[`container-${i}`],h&&dt.child),onAnimationEnd:o,onEscapeKeyDown:u,onOpenAutoFocus:u,onCloseAutoFocus:u,onInteractOutside:u,onPointerDownOutside:c,ref:p,children:[g.jsx(v7.Provider,{value:{parentDialog:p},children:n}),a&&g.jsx("div",{className:dt.closeButton,children:g.jsx(b7,{asChild:!0,children:g.jsx(mt,{icon:"close",hiddenLabel:"Close dialog"})})})]});return g.jsxs(h7,{modal:s,...d,children:[r(e&&g.jsx(p7,{asChild:!0,children:e})),g.jsx(m7,{children:s?g.jsx(qj,{className:dt.overlay,children:v}):v})]})}const hB=t=>{const{icon:e,onIconClick:n,title:r}=t;return g.jsxs("header",{className:dt.header,children:[e&&g.jsx(pB,{icon:e,onClick:n}),g.jsx(Yj,{asChild:!0,children:g.jsx(J,{noSelect:!0,component:"span",variant:"bold",children:r})})]})};function pB(t){const{icon:e,onClick:n}=t;return n?g.jsx(mt,{icon:e,onClick:n}):g.jsx("div",{className:dt.headerIcon,children:g.jsx(le,{name:e,size:"medium",color:"grey11"})})}function mB(t){const{children:e,padding:n,...r}=t;return g.jsx("section",{...r,className:z(dt.content,n&&dt[`contentPadding-${n}`]),children:e})}const gB=t=>{const{ok:e,cancel:n,link:r,size:o="large",asFooter:i}=t;return g.jsxs("section",{className:z(dt.actions,i&&dt.footer),children:[r&&g.jsx(J,{className:dt.link,variant:"small",children:r}),n&&g.jsx(b7,{asChild:!0,children:g.jsx(Se,{color:"grey",size:o,onClick:n.onClick,children:n.text})}),g.jsx(ao,{visible:!!e.disabledTooltip,content:e.disabledTooltip??"",children:g.jsx(Se,{size:o,loading:e.loading,disabled:e.disabled,onClick:e.onClick,color:e.color??"purple",children:e.text})})]})},v7=f.createContext({parentDialog:null});function bB(){var o;const{parentDialog:t}=f.useContext(v7),e=(o=t==null?void 0:t.current)==null?void 0:o.getBoundingClientRect();if(!e)return;const{height:n,top:r}=e;return n/2+r}function y7(t){const e=t+"CollectionProvider",[n,r]=Vn(e),[o,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:m,children:b}=p,v=f.useRef(null),y=f.useRef(new Map).current;return f.createElement(o,{scope:m,itemMap:y,collectionRef:v},b)},s=t+"CollectionSlot",l=f.forwardRef((p,m)=>{const{scope:b,children:v}=p,y=i(s,b),$=pt(m,y.collectionRef);return f.createElement(il,{ref:$},v)}),c=t+"CollectionItemSlot",d="data-radix-collection-item",u=f.forwardRef((p,m)=>{const{scope:b,children:v,...y}=p,$=f.useRef(null),x=pt(m,$),C=i(c,b);return f.useEffect(()=>(C.itemMap.set($,{ref:$,...y}),()=>void C.itemMap.delete($))),f.createElement(il,{[d]:"",ref:x},v)});function h(p){const m=i(t+"CollectionConsumer",p);return f.useCallback(()=>{const v=m.collectionRef.current;if(!v)return[];const y=Array.from(v.querySelectorAll(`[${d}]`));return Array.from(m.itemMap.values()).sort((C,w)=>y.indexOf(C.ref.current)-y.indexOf(w.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:a,Slot:l,ItemSlot:u},h,r]}const Ol=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},vB=S["useId".toString()]||(()=>{});let yB=0;function $B(t){const[e,n]=S.useState(vB());return Ol(()=>{t||n(r=>r??String(yB++))},[t]),t||(e?`radix-${e}`:"")}const xB=f.createContext(void 0);function Fa(t){const e=f.useContext(xB);return t||e||"ltr"}const Fd="rovingFocusGroup.onEntryFocus",CB={bubbles:!1,cancelable:!0},rp="RovingFocusGroup",[yf,$7,wB]=y7(rp),[_B,ui]=Vn(rp,[wB]),[SB,EB]=_B(rp),kB=f.forwardRef((t,e)=>f.createElement(yf.Provider,{scope:t.__scopeRovingFocusGroup},f.createElement(yf.Slot,{scope:t.__scopeRovingFocusGroup},f.createElement(DB,F({},t,{ref:e}))))),DB=f.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,...d}=t,u=f.useRef(null),h=pt(e,u),p=Fa(i),[m=null,b]=io({prop:a,defaultProp:s,onChange:l}),[v,y]=f.useState(!1),$=Ph(c),x=$7(n),C=f.useRef(!1),[w,D]=f.useState(0);return f.useEffect(()=>{const E=u.current;if(E)return E.addEventListener(Fd,$),()=>E.removeEventListener(Fd,$)},[$]),f.createElement(SB,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:m,onItemFocus:f.useCallback(E=>b(E),[b]),onItemShiftTab:f.useCallback(()=>y(!0),[]),onFocusableItemAdd:f.useCallback(()=>D(E=>E+1),[]),onFocusableItemRemove:f.useCallback(()=>D(E=>E-1),[])},f.createElement(Ae.div,F({tabIndex:v||w===0?-1:0,"data-orientation":r},d,{ref:h,style:{outline:"none",...t.style},onMouseDown:We(t.onMouseDown,()=>{C.current=!0}),onFocus:We(t.onFocus,E=>{const _=!C.current;if(E.target===E.currentTarget&&_&&!v){const M=new CustomEvent(Fd,CB);if(E.currentTarget.dispatchEvent(M),!M.defaultPrevented){const I=x().filter(L=>L.focusable),k=I.find(L=>L.active),O=I.find(L=>L.id===m),T=[k,O,...I].filter(Boolean).map(L=>L.ref.current);x7(T)}}C.current=!1}),onBlur:We(t.onBlur,()=>y(!1))})))}),PB="RovingFocusGroupItem",MB=f.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,...i}=t,a=$B(),s=EB(PB,n),l=s.currentTabStopId===a,c=$7(n),{onFocusableItemAdd:d,onFocusableItemRemove:u}=s;return f.useEffect(()=>{if(r)return d(),()=>u()},[r,d,u]),f.createElement(yf.ItemSlot,{scope:n,id:a,focusable:r,active:o},f.createElement(Ae.span,F({tabIndex:l?0:-1,"data-orientation":s.orientation},i,{ref:e,onMouseDown:We(t.onMouseDown,h=>{r?s.onItemFocus(a):h.preventDefault()}),onFocus:We(t.onFocus,()=>s.onItemFocus(a)),onKeyDown:We(t.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){s.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const p=IB(h,s.orientation,s.dir);if(p!==void 0){h.preventDefault();let b=c().filter(v=>v.focusable).map(v=>v.ref.current);if(p==="last")b.reverse();else if(p==="prev"||p==="next"){p==="prev"&&b.reverse();const v=b.indexOf(h.currentTarget);b=s.loop?NB(b,v+1):b.slice(v+1)}setTimeout(()=>x7(b))}})})))}),TB={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function RB(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function IB(t,e,n){const r=RB(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return TB[r]}function x7(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function NB(t,e){return t.map((n,r)=>t[(e+r)%t.length])}const op=kB,ip=MB;function ap(t){const[e,n]=f.useState(void 0);return Ol(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,s;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,s=c.blockSize}else a=t.offsetWidth,s=t.offsetHeight;n({width:a,height:s})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}function sp(t){const e=f.useRef({value:t,previous:t});return f.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function AB(t,e){return f.useReducer((n,r)=>{const o=e[n][r];return o??n},t)}const C7=t=>{const{present:e,children:n}=t,r=LB(e),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),i=pt(r.ref,o.ref);return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:i}):null};C7.displayName="Presence";function LB(t){const[e,n]=f.useState(),r=f.useRef({}),o=f.useRef(t),i=f.useRef("none"),a=t?"mounted":"unmounted",[s,l]=AB(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const c=Ss(r.current);i.current=s==="mounted"?c:"none"},[s]),Ol(()=>{const c=r.current,d=o.current;if(d!==t){const h=i.current,p=Ss(c);t?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,l]),Ol(()=>{if(e){const c=u=>{const p=Ss(r.current).includes(u.animationName);u.target===e&&p&&Ut.flushSync(()=>l("ANIMATION_END"))},d=u=>{u.target===e&&(i.current=Ss(r.current))};return e.addEventListener("animationstart",d),e.addEventListener("animationcancel",c),e.addEventListener("animationend",c),()=>{e.removeEventListener("animationstart",d),e.removeEventListener("animationcancel",c),e.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:f.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Ss(t){return(t==null?void 0:t.animationName)||"none"}const w7="Radio",[OB,_7]=Vn(w7),[VB,FB]=OB(w7),jB=f.forwardRef((t,e)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:a,value:s="on",onCheck:l,...c}=t,[d,u]=f.useState(null),h=pt(e,b=>u(b)),p=f.useRef(!1),m=d?!!d.closest("form"):!0;return f.createElement(VB,{scope:n,checked:o,disabled:a},f.createElement(Ae.button,F({type:"button",role:"radio","aria-checked":o,"data-state":S7(o),"data-disabled":a?"":void 0,disabled:a,value:s},c,{ref:h,onClick:We(t.onClick,b=>{o||l==null||l(),m&&(p.current=b.isPropagationStopped(),p.current||b.stopPropagation())})})),m&&f.createElement(zB,{control:d,bubbles:!p.current,name:r,value:s,checked:o,required:i,disabled:a,style:{transform:"translateX(-100%)"}}))}),BB="RadioIndicator",HB=f.forwardRef((t,e)=>{const{__scopeRadio:n,forceMount:r,...o}=t,i=FB(BB,n);return f.createElement(C7,{present:r||i.checked},f.createElement(Ae.span,F({"data-state":S7(i.checked),"data-disabled":i.disabled?"":void 0},o,{ref:e})))}),zB=t=>{const{control:e,checked:n,bubbles:r=!0,...o}=t,i=f.useRef(null),a=sp(n),s=ap(e);return f.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(c,"checked").set;if(a!==n&&u){const h=new Event("click",{bubbles:r});u.call(l,n),l.dispatchEvent(h)}},[a,n,r]),f.createElement("input",F({type:"radio","aria-hidden":!0,defaultChecked:n},o,{tabIndex:-1,ref:i,style:{...t.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function S7(t){return t?"checked":"unchecked"}const KB=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],E7="RadioGroup",[WB,NQ]=Vn(E7,[ui,_7]),k7=ui(),D7=_7(),[ZB,UB]=WB(E7),GB=f.forwardRef((t,e)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:a=!1,disabled:s=!1,orientation:l,dir:c,loop:d=!0,onValueChange:u,...h}=t,p=k7(n),m=Fa(c),[b,v]=io({prop:i,defaultProp:o,onChange:u});return f.createElement(ZB,{scope:n,name:r,required:a,disabled:s,value:b,onValueChange:v},f.createElement(op,F({asChild:!0},p,{orientation:l,dir:m,loop:d}),f.createElement(Ae.div,F({role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":s?"":void 0,dir:m},h,{ref:e}))))}),qB="RadioGroupItem",YB=f.forwardRef((t,e)=>{const{__scopeRadioGroup:n,disabled:r,...o}=t,i=UB(qB,n),a=i.disabled||r,s=k7(n),l=D7(n),c=f.useRef(null),d=pt(e,c),u=i.value===o.value,h=f.useRef(!1);return f.useEffect(()=>{const p=b=>{KB.includes(b.key)&&(h.current=!0)},m=()=>h.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",m)}},[]),f.createElement(ip,F({asChild:!0},s,{focusable:!a,active:u}),f.createElement(jB,F({disabled:a,required:i.required,checked:u},l,o,{name:i.name,ref:d,onCheck:()=>i.onValueChange(o.value),onKeyDown:We(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:We(o.onFocus,()=>{var p;h.current&&((p=c.current)===null||p===void 0||p.click())})})))}),JB=f.forwardRef((t,e)=>{const{__scopeRadioGroup:n,...r}=t,o=D7(n);return f.createElement(HB,F({},o,r,{ref:e}))}),P7=GB,M7=YB,XB=JB,QB="_root_8nb1w_1",eH="_footer_8nb1w_28",tH="_groupRoot_8nb1w_33",nH="_item_8nb1w_40",rH="_uniformPadding_8nb1w_67",oH="_itemIcon_8nb1w_79",iH="_itemTextContainer_8nb1w_90",It={root:QB,"width-large":"_width-large_8nb1w_14","width-auto":"_width-auto_8nb1w_17","padding-medium":"_padding-medium_8nb1w_21","padding-small":"_padding-small_8nb1w_24",footer:eH,groupRoot:tH,item:nH,uniformPadding:rH,"inlinePadding-icon":"_inlinePadding-icon_8nb1w_71","inlinePadding-default":"_inlinePadding-default_8nb1w_74",itemIcon:oH,itemTextContainer:iH},aH=({value:t,onValueChange:e,children:n,width:r="large",padding:o="medium",footer:i})=>g.jsxs("aside",{className:It.root,children:[g.jsx(P7,{className:z(It.groupRoot,It[`width-${r}`],It[`padding-${o}`]),value:t,onValueChange:e,orientation:"vertical",children:n}),i&&g.jsx("div",{className:z(It.footer,It[`padding-${o}`]),children:i})]}),sH=({value:t,icon:e,title:n,subtitle:r})=>{const o=n||r,i=z(It.item,It[`inlinePadding-${e?"icon":"default"}`],!o&&It.uniformPadding);return g.jsxs(M7,{className:i,value:t,children:[e&&g.jsx("div",{className:It.itemIcon,children:g.jsx(le,{name:e,size:"medium",color:"grey11"})}),o&&g.jsxs("div",{className:It.itemTextContainer,children:[g.jsx(J,{variant:"bold",color:"grey12",noWrap:!0,children:n}),g.jsx(J,{variant:"small",color:"grey11",noWrap:!0,children:r})]})]})},lH="_root_15mfy_1",cH="_grey_15mfy_11",dH="_green_15mfy_16",uH="_amber_15mfy_21",fH="_purple_15mfy_26",O0={root:lH,grey:cH,green:dH,amber:uH,purple:fH};function hH(t){const{color:e,role:n="status"}=t;return g.jsx("div",{role:n,className:z(O0.root,O0[e])})}function xe(t,e,{checkForDefaultPrevented:n=!0}={}){return function(o){if(t==null||t(o),n===!1||!o.defaultPrevented)return e==null?void 0:e(o)}}function pH(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function Cc(...t){return e=>t.forEach(n=>pH(n,e))}function kt(...t){return S.useCallback(Cc(...t),t)}function ja(t,e=[]){let n=[];function r(i,a){const s=S.createContext(a),l=n.length;n=[...n,a];function c(u){const{scope:h,children:p,...m}=u,b=(h==null?void 0:h[t][l])||s,v=S.useMemo(()=>m,Object.values(m));return g.jsx(b.Provider,{value:v,children:p})}function d(u,h){const p=(h==null?void 0:h[t][l])||s,m=S.useContext(p);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,d]}const o=()=>{const i=n.map(a=>S.createContext(a));return function(s){const l=(s==null?void 0:s[t])||i;return S.useMemo(()=>({[`__scope${t}`]:{...s,[t]:l}}),[s,l])}};return o.scopeName=t,[r,mH(o,...e)]}function mH(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const u=l(i)[`__scope${c}`];return{...s,...u}},{});return S.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}function fr(t){const e=S.useRef(t);return S.useEffect(()=>{e.current=t}),S.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function T7({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,o]=gH({defaultProp:e,onChange:n}),i=t!==void 0,a=i?t:r,s=fr(n),l=S.useCallback(c=>{if(i){const u=typeof c=="function"?c(t):c;u!==t&&s(u)}else o(c)},[i,t,o,s]);return[a,l]}function gH({defaultProp:t,onChange:e}){const n=S.useState(t),[r]=n,o=S.useRef(r),i=fr(e);return S.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var ga=S.forwardRef((t,e)=>{const{children:n,...r}=t,o=S.Children.toArray(n),i=o.find(vH);if(i){const a=i.props.children,s=o.map(l=>l===i?S.Children.count(a)>1?S.Children.only(null):S.isValidElement(a)?a.props.children:null:l);return g.jsx($f,{...r,ref:e,children:S.isValidElement(a)?S.cloneElement(a,void 0,s):null})}return g.jsx($f,{...r,ref:e,children:n})});ga.displayName="Slot";var $f=S.forwardRef((t,e)=>{const{children:n,...r}=t;if(S.isValidElement(n)){const o=$H(n);return S.cloneElement(n,{...yH(r,n.props),ref:e?Cc(e,o):o})}return S.Children.count(n)>1?S.Children.only(null):null});$f.displayName="SlotClone";var bH=({children:t})=>g.jsx(g.Fragment,{children:t});function vH(t){return S.isValidElement(t)&&t.type===bH}function yH(t,e){const n={...e};for(const r in e){const o=t[r],i=e[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...t,...n}}function $H(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var xH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],bt=xH.reduce((t,e)=>{const n=S.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?ga:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(s,{...a,ref:o})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function CH(t,e){t&&Nf.flushSync(()=>t.dispatchEvent(e))}function R7(t){const e=t+"CollectionProvider",[n,r]=ja(e),[o,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:m,children:b}=p,v=f.useRef(null),y=f.useRef(new Map).current;return g.jsx(o,{scope:m,itemMap:y,collectionRef:v,children:b})};a.displayName=e;const s=t+"CollectionSlot",l=f.forwardRef((p,m)=>{const{scope:b,children:v}=p,y=i(s,b),$=kt(m,y.collectionRef);return g.jsx(ga,{ref:$,children:v})});l.displayName=s;const c=t+"CollectionItemSlot",d="data-radix-collection-item",u=f.forwardRef((p,m)=>{const{scope:b,children:v,...y}=p,$=f.useRef(null),x=kt(m,$),C=i(c,b);return f.useEffect(()=>(C.itemMap.set($,{ref:$,...y}),()=>void C.itemMap.delete($))),g.jsx(ga,{[d]:"",ref:x,children:v})});u.displayName=c;function h(p){const m=i(t+"CollectionConsumer",p);return f.useCallback(()=>{const v=m.collectionRef.current;if(!v)return[];const y=Array.from(v.querySelectorAll(`[${d}]`));return Array.from(m.itemMap.values()).sort((C,w)=>y.indexOf(C.ref.current)-y.indexOf(w.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:a,Slot:l,ItemSlot:u},h,r]}var wH=S.createContext(void 0);function I7(t){const e=S.useContext(wH);return t||e||"ltr"}var jd=0;function _H(){S.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??V0()),document.body.insertAdjacentElement("beforeend",t[1]??V0()),jd++,()=>{jd===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),jd--}},[])}function V0(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}var Bd="focusScope.autoFocusOnMount",Hd="focusScope.autoFocusOnUnmount",F0={bubbles:!1,cancelable:!0},SH="FocusScope",N7=S.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=t,[s,l]=S.useState(null),c=fr(o),d=fr(i),u=S.useRef(null),h=kt(e,b=>l(b)),p=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(r){let b=function(x){if(p.paused||!s)return;const C=x.target;s.contains(C)?u.current=C:Wn(u.current,{select:!0})},v=function(x){if(p.paused||!s)return;const C=x.relatedTarget;C!==null&&(s.contains(C)||Wn(u.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const w of x)w.removedNodes.length>0&&Wn(s)};document.addEventListener("focusin",b),document.addEventListener("focusout",v);const $=new MutationObserver(y);return s&&$.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",v),$.disconnect()}}},[r,s,p.paused]),S.useEffect(()=>{if(s){B0.add(p);const b=document.activeElement;if(!s.contains(b)){const y=new CustomEvent(Bd,F0);s.addEventListener(Bd,c),s.dispatchEvent(y),y.defaultPrevented||(EH(TH(A7(s)),{select:!0}),document.activeElement===b&&Wn(s))}return()=>{s.removeEventListener(Bd,c),setTimeout(()=>{const y=new CustomEvent(Hd,F0);s.addEventListener(Hd,d),s.dispatchEvent(y),y.defaultPrevented||Wn(b??document.body,{select:!0}),s.removeEventListener(Hd,d),B0.remove(p)},0)}}},[s,c,d,p]);const m=S.useCallback(b=>{if(!n&&!r||p.paused)return;const v=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,y=document.activeElement;if(v&&y){const $=b.currentTarget,[x,C]=kH($);x&&C?!b.shiftKey&&y===C?(b.preventDefault(),n&&Wn(x,{select:!0})):b.shiftKey&&y===x&&(b.preventDefault(),n&&Wn(C,{select:!0})):y===$&&b.preventDefault()}},[n,r,p.paused]);return g.jsx(bt.div,{tabIndex:-1,...a,ref:h,onKeyDown:m})});N7.displayName=SH;function EH(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Wn(r,{select:e}),document.activeElement!==n)return}function kH(t){const e=A7(t),n=j0(e,t),r=j0(e.reverse(),t);return[n,r]}function A7(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function j0(t,e){for(const n of t)if(!DH(n,{upTo:e}))return n}function DH(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function PH(t){return t instanceof HTMLInputElement&&"select"in t}function Wn(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&PH(t)&&e&&t.select()}}var B0=MH();function MH(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=H0(t,e),t.unshift(e)},remove(e){var n;t=H0(t,e),(n=t[0])==null||n.resume()}}}function H0(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function TH(t){return t.filter(e=>e.tagName!=="A")}var eo=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},RH=S["useId".toString()]||(()=>{}),IH=0;function xf(t){const[e,n]=S.useState(RH());return eo(()=>{t||n(r=>r??String(IH++))},[t]),t||(e?`radix-${e}`:"")}var NH="Arrow",L7=S.forwardRef((t,e)=>{const{children:n,width:r=10,height:o=5,...i}=t;return g.jsx(bt.svg,{...i,ref:e,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});L7.displayName=NH;var AH=L7;function LH(t){const[e,n]=S.useState(void 0);return eo(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,s;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,s=c.blockSize}else a=t.offsetWidth,s=t.offsetHeight;n({width:a,height:s})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var lp="Popper",[O7,V7]=ja(lp),[OH,F7]=O7(lp),j7=t=>{const{__scopePopper:e,children:n}=t,[r,o]=S.useState(null);return g.jsx(OH,{scope:e,anchor:r,onAnchorChange:o,children:n})};j7.displayName=lp;var B7="PopperAnchor",H7=S.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...o}=t,i=F7(B7,n),a=S.useRef(null),s=kt(e,a);return S.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:g.jsx(bt.div,{...o,ref:s})});H7.displayName=B7;var cp="PopperContent",[VH,FH]=O7(cp),z7=S.forwardRef((t,e)=>{var Y,re,se,ie,de,j;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:u="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:m,...b}=t,v=F7(cp,n),[y,$]=S.useState(null),x=kt(e,ue=>$(ue)),[C,w]=S.useState(null),D=LH(C),E=(D==null?void 0:D.width)??0,_=(D==null?void 0:D.height)??0,M=r+(i!=="center"?"-"+i:""),I=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},k=Array.isArray(c)?c:[c],O=k.length>0,R={padding:I,boundary:k.filter(BH),altBoundary:O},{refs:T,floatingStyles:L,placement:V,isPositioned:N,middlewareData:W}=l2({strategy:"fixed",placement:M,whileElementsMounted:(...ue)=>i2(...ue,{animationFrame:p==="always"}),elements:{reference:v.anchor},middleware:[Gg({mainAxis:o+_,alignmentAxis:a}),l&&Yg({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Jg():void 0,...R}),l&&Zg({...R}),Xg({...R,apply:({elements:ue,rects:Ce,availableWidth:ke,availableHeight:Le})=>{const{width:rt,height:Gt}=Ce.reference,Oe=ue.floating.style;Oe.setProperty("--radix-popper-available-width",`${ke}px`),Oe.setProperty("--radix-popper-available-height",`${Le}px`),Oe.setProperty("--radix-popper-anchor-width",`${rt}px`),Oe.setProperty("--radix-popper-anchor-height",`${Gt}px`)}}),C&&a2({element:C,padding:s}),HH({arrowWidth:E,arrowHeight:_}),h&&Ug({strategy:"referenceHidden",...R})]}),[A,Z]=Z7(V),q=fr(m);eo(()=>{N&&(q==null||q())},[N,q]);const Q=(Y=W.arrow)==null?void 0:Y.x,K=(re=W.arrow)==null?void 0:re.y,ne=((se=W.arrow)==null?void 0:se.centerOffset)!==0,[ce,ae]=S.useState();return eo(()=>{y&&ae(window.getComputedStyle(y).zIndex)},[y]),g.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:N?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[(ie=W.transformOrigin)==null?void 0:ie.x,(de=W.transformOrigin)==null?void 0:de.y].join(" "),...((j=W.hide)==null?void 0:j.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:g.jsx(VH,{scope:n,placedSide:A,onArrowChange:w,arrowX:Q,arrowY:K,shouldHideArrow:ne,children:g.jsx(bt.div,{"data-side":A,"data-align":Z,...b,ref:x,style:{...b.style,animation:N?void 0:"none"}})})})});z7.displayName=cp;var K7="PopperArrow",jH={top:"bottom",right:"left",bottom:"top",left:"right"},W7=S.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,i=FH(K7,r),a=jH[i.placedSide];return g.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:g.jsx(AH,{...o,ref:n,style:{...o.style,display:"block"}})})});W7.displayName=K7;function BH(t){return t!==null}var HH=t=>({name:"transformOrigin",options:t,fn(e){var v,y,$;const{placement:n,rects:r,middlewareData:o}=e,a=((v=o.arrow)==null?void 0:v.centerOffset)!==0,s=a?0:t.arrowWidth,l=a?0:t.arrowHeight,[c,d]=Z7(n),u={start:"0%",center:"50%",end:"100%"}[d],h=(((y=o.arrow)==null?void 0:y.x)??0)+s/2,p=((($=o.arrow)==null?void 0:$.y)??0)+l/2;let m="",b="";return c==="bottom"?(m=a?u:`${h}px`,b=`${-l}px`):c==="top"?(m=a?u:`${h}px`,b=`${r.floating.height+l}px`):c==="right"?(m=`${-l}px`,b=a?u:`${p}px`):c==="left"&&(m=`${r.floating.width+l}px`,b=a?u:`${p}px`),{data:{x:m,y:b}}}});function Z7(t){const[e,n="center"]=t.split("-");return[e,n]}var zH=j7,KH=H7,WH=z7,ZH=W7,UH="Portal",U7=S.forwardRef((t,e)=>{var s;const{container:n,...r}=t,[o,i]=S.useState(!1);eo(()=>i(!0),[]);const a=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return a?Ut.createPortal(g.jsx(bt.div,{...r,ref:e}),a):null});U7.displayName=UH;function GH(t,e){return S.useReducer((n,r)=>e[n][r]??n,t)}var Ba=t=>{const{present:e,children:n}=t,r=qH(e),o=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),i=kt(r.ref,YH(o));return typeof n=="function"||r.isPresent?S.cloneElement(o,{ref:i}):null};Ba.displayName="Presence";function qH(t){const[e,n]=S.useState(),r=S.useRef({}),o=S.useRef(t),i=S.useRef("none"),a=t?"mounted":"unmounted",[s,l]=GH(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const c=Es(r.current);i.current=s==="mounted"?c:"none"},[s]),eo(()=>{const c=r.current,d=o.current;if(d!==t){const h=i.current,p=Es(c);t?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,l]),eo(()=>{if(e){const c=u=>{const p=Es(r.current).includes(u.animationName);u.target===e&&p&&Nf.flushSync(()=>l("ANIMATION_END"))},d=u=>{u.target===e&&(i.current=Es(r.current))};return e.addEventListener("animationstart",d),e.addEventListener("animationcancel",c),e.addEventListener("animationend",c),()=>{e.removeEventListener("animationstart",d),e.removeEventListener("animationcancel",c),e.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:S.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Es(t){return(t==null?void 0:t.animationName)||"none"}function YH(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var zd="rovingFocusGroup.onEntryFocus",JH={bubbles:!1,cancelable:!0},wc="RovingFocusGroup",[Cf,G7,XH]=R7(wc),[QH,q7]=ja(wc,[XH]),[ez,tz]=QH(wc),Y7=S.forwardRef((t,e)=>g.jsx(Cf.Provider,{scope:t.__scopeRovingFocusGroup,children:g.jsx(Cf.Slot,{scope:t.__scopeRovingFocusGroup,children:g.jsx(nz,{...t,ref:e})})}));Y7.displayName=wc;var nz=S.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:d=!1,...u}=t,h=S.useRef(null),p=kt(e,h),m=I7(i),[b=null,v]=T7({prop:a,defaultProp:s,onChange:l}),[y,$]=S.useState(!1),x=fr(c),C=G7(n),w=S.useRef(!1),[D,E]=S.useState(0);return S.useEffect(()=>{const _=h.current;if(_)return _.addEventListener(zd,x),()=>_.removeEventListener(zd,x)},[x]),g.jsx(ez,{scope:n,orientation:r,dir:m,loop:o,currentTabStopId:b,onItemFocus:S.useCallback(_=>v(_),[v]),onItemShiftTab:S.useCallback(()=>$(!0),[]),onFocusableItemAdd:S.useCallback(()=>E(_=>_+1),[]),onFocusableItemRemove:S.useCallback(()=>E(_=>_-1),[]),children:g.jsx(bt.div,{tabIndex:y||D===0?-1:0,"data-orientation":r,...u,ref:p,style:{outline:"none",...t.style},onMouseDown:xe(t.onMouseDown,()=>{w.current=!0}),onFocus:xe(t.onFocus,_=>{const M=!w.current;if(_.target===_.currentTarget&&M&&!y){const I=new CustomEvent(zd,JH);if(_.currentTarget.dispatchEvent(I),!I.defaultPrevented){const k=C().filter(V=>V.focusable),O=k.find(V=>V.active),R=k.find(V=>V.id===b),L=[O,R,...k].filter(Boolean).map(V=>V.ref.current);Q7(L,d)}}w.current=!1}),onBlur:xe(t.onBlur,()=>$(!1))})})}),J7="RovingFocusGroupItem",X7=S.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...a}=t,s=xf(),l=i||s,c=tz(J7,n),d=c.currentTabStopId===l,u=G7(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=c;return S.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),g.jsx(Cf.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:g.jsx(bt.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...a,ref:e,onMouseDown:xe(t.onMouseDown,m=>{r?c.onItemFocus(l):m.preventDefault()}),onFocus:xe(t.onFocus,()=>c.onItemFocus(l)),onKeyDown:xe(t.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){c.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const b=iz(m,c.orientation,c.dir);if(b!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let y=u().filter($=>$.focusable).map($=>$.ref.current);if(b==="last")y.reverse();else if(b==="prev"||b==="next"){b==="prev"&&y.reverse();const $=y.indexOf(m.currentTarget);y=c.loop?az(y,$+1):y.slice($+1)}setTimeout(()=>Q7(y))}})})})});X7.displayName=J7;var rz={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function oz(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function iz(t,e,n){const r=oz(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return rz[r]}function Q7(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function az(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var sz=Y7,lz=X7,eC=Yf(),Kd=function(){},_c=S.forwardRef(function(t,e){var n=S.useRef(null),r=S.useState({onScrollCapture:Kd,onWheelCapture:Kd,onTouchMoveCapture:Kd}),o=r[0],i=r[1],a=t.forwardProps,s=t.children,l=t.className,c=t.removeScrollBar,d=t.enabled,u=t.shards,h=t.sideCar,p=t.noIsolation,m=t.inert,b=t.allowPinchZoom,v=t.as,y=v===void 0?"div":v,$=t.gapMode,x=Zl(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=h,w=qf([n,e]),D=Me(Me({},x),o);return S.createElement(S.Fragment,null,d&&S.createElement(C,{sideCar:eC,removeScrollBar:c,shards:u,noIsolation:p,inert:m,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:$}),a?S.cloneElement(S.Children.only(s),Me(Me({},D),{ref:w})):S.createElement(y,Me({},D,{className:l,ref:w}),s))});_c.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};_c.classNames={fullWidth:jo,zeroRight:Fo};var wf=!1;if(typeof window<"u")try{var ks=Object.defineProperty({},"passive",{get:function(){return wf=!0,!0}});window.addEventListener("test",ks,ks),window.removeEventListener("test",ks,ks)}catch{wf=!1}var _o=wf?{passive:!1}:!1,cz=function(t){return t.tagName==="TEXTAREA"},tC=function(t,e){var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!cz(t)&&n[e]==="visible")},dz=function(t){return tC(t,"overflowY")},uz=function(t){return tC(t,"overflowX")},z0=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=nC(t,r);if(o){var i=rC(t,r),a=i[1],s=i[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},fz=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},hz=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},nC=function(t,e){return t==="v"?dz(e):uz(e)},rC=function(t,e){return t==="v"?fz(e):hz(e)},pz=function(t,e){return t==="h"&&e==="rtl"?-1:1},mz=function(t,e,n,r,o){var i=pz(t,window.getComputedStyle(e).direction),a=i*r,s=n.target,l=e.contains(s),c=!1,d=a>0,u=0,h=0;do{var p=rC(t,s),m=p[0],b=p[1],v=p[2],y=b-v-i*m;(m||y)&&nC(t,s)&&(u+=y,h+=m),s instanceof ShadowRoot?s=s.host:s=s.parentNode}while(!l&&s!==document.body||l&&(e.contains(s)||e===s));return(d&&(o&&Math.abs(u)<1||!o&&a>u)||!d&&(o&&Math.abs(h)<1||!o&&-a>h))&&(c=!0),c},Ds=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},K0=function(t){return[t.deltaX,t.deltaY]},W0=function(t){return t&&"current"in t?t.current:t},gz=function(t,e){return t[0]===e[0]&&t[1]===e[1]},bz=function(t){return`
|
|
489
|
+
`,vj=1,yj=3,$j=function(t){JF(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.imageRef=f.createRef(),n.videoRef=f.createRef(),n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc=document,n.currentWindow=window,n.state={cropSize:null,hasWheelJustStarted:!1},n.preventZoomSafari=function(r){return r.preventDefault()},n.cleanEvents=function(){n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd)},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var r=n.computeSizes();r&&(n.emitCropData(),n.setInitialCrop(r)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(r){if(n.props.initialCroppedAreaPercentages){var o=hj(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),i=o.crop,a=o.zoom;n.props.onCropChange(i),n.props.onZoomChange&&n.props.onZoomChange(a)}else if(n.props.initialCroppedAreaPixels){var s=mj(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),i=s.crop,a=s.zoom;n.props.onCropChange(i),n.props.onZoomChange&&n.props.onZoomChange(a)}},n.computeSizes=function(){var r,o,i,a,s,l,c=n.imageRef.current||n.videoRef.current;if(c&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect();var d=n.containerRect.width/n.containerRect.height,u=((r=n.imageRef.current)===null||r===void 0?void 0:r.naturalWidth)||((o=n.videoRef.current)===null||o===void 0?void 0:o.videoWidth)||0,h=((i=n.imageRef.current)===null||i===void 0?void 0:i.naturalHeight)||((a=n.videoRef.current)===null||a===void 0?void 0:a.videoHeight)||0,p=c.offsetWidth<u||c.offsetHeight<h,m=u/h,b=void 0;if(p)switch(n.props.objectFit){default:case"contain":b=d>m?{width:n.containerRect.height*m,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/m};break;case"horizontal-cover":b={width:n.containerRect.width,height:n.containerRect.width/m};break;case"vertical-cover":b={width:n.containerRect.height*m,height:n.containerRect.height};break;case"auto-cover":b=u>h?{width:n.containerRect.width,height:n.containerRect.width/m}:{width:n.containerRect.height*m,height:n.containerRect.height};break}else b={width:c.offsetWidth,height:c.offsetHeight};n.mediaSize=Ze(Ze({},b),{naturalWidth:u,naturalHeight:h}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var v=n.props.cropSize?n.props.cropSize:lj(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(((s=n.state.cropSize)===null||s===void 0?void 0:s.height)!==v.height||((l=n.state.cropSize)===null||l===void 0?void 0:l.width)!==v.width)&&n.props.onCropSizeChange&&n.props.onCropSizeChange(v),n.setState({cropSize:v},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(v),v}},n.onMouseDown=function(r){r.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.onDragStart(e.getMousePoint(r))},n.onMouseMove=function(r){return n.onDrag(e.getMousePoint(r))},n.onTouchStart=function(r){n.isTouching=!0,!(n.props.onTouchRequest&&!n.props.onTouchRequest(r))&&(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),r.touches.length===2?n.onPinchStart(r):r.touches.length===1&&n.onDragStart(e.getTouchPoint(r.touches[0])))},n.onTouchMove=function(r){r.preventDefault(),r.touches.length===2?n.onPinchMove(r):r.touches.length===1&&n.onDrag(e.getTouchPoint(r.touches[0]))},n.onGestureStart=function(r){r.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation},n.onGestureMove=function(r){if(r.preventDefault(),!n.isTouching){var o=e.getMousePoint(r),i=n.gestureZoomStart-1+r.scale;if(n.setNewZoom(i,o,{shouldUpdatePosition:!0}),n.props.onRotationChange){var a=n.gestureRotationStart+r.rotation;n.props.onRotationChange(a)}}},n.onGestureEnd=function(r){n.cleanEvents()},n.onDragStart=function(r){var o,i,a=r.x,s=r.y;n.dragStartPosition={x:a,y:s},n.dragStartCrop=Ze({},n.props.crop),(i=(o=n.props).onInteractionStart)===null||i===void 0||i.call(o)},n.onDrag=function(r){var o=r.x,i=r.y;n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame(function(){if(n.state.cropSize&&!(o===void 0||i===void 0)){var a=o-n.dragStartPosition.x,s=i-n.dragStartPosition.y,l={x:n.dragStartCrop.x+a,y:n.dragStartCrop.y+s},c=n.props.restrictPosition?Cs(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(c)}})},n.onDragStopped=function(){var r,o;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),(o=(r=n.props).onInteractionEnd)===null||o===void 0||o.call(r)},n.onWheel=function(r){if(!(n.props.onWheelRequest&&!n.props.onWheelRequest(r))){r.preventDefault();var o=e.getMousePoint(r),i=sj(r).pixelY,a=n.props.zoom-i*n.props.zoomSpeed/200;n.setNewZoom(a,o,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},function(){var s,l;return(l=(s=n.props).onInteractionStart)===null||l===void 0?void 0:l.call(s)}),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout(function(){return n.setState({hasWheelJustStarted:!1},function(){var s,l;return(l=(s=n.props).onInteractionEnd)===null||l===void 0?void 0:l.call(s)})},250)}},n.getPointOnContainer=function(r){var o=r.x,i=r.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(o-n.containerRect.left),y:n.containerRect.height/2-(i-n.containerRect.top)}},n.getPointOnMedia=function(r){var o=r.x,i=r.y,a=n.props,s=a.crop,l=a.zoom;return{x:(o+s.x)/l,y:(i+s.y)/l}},n.setNewZoom=function(r,o,i){var a=(i===void 0?{}:i).shouldUpdatePosition,s=a===void 0?!0:a;if(!(!n.state.cropSize||!n.props.onZoomChange)){var l=xc(r,n.props.minZoom,n.props.maxZoom);if(s){var c=n.getPointOnContainer(o),d=n.getPointOnMedia(c),u={x:d.x*l-c.x,y:d.y*l-c.y},h=n.props.restrictPosition?Cs(u,n.mediaSize,n.state.cropSize,l,n.props.rotation):u;n.props.onCropChange(h)}n.props.onZoomChange(l)}},n.getCropData=function(){if(!n.state.cropSize)return null;var r=n.props.restrictPosition?Cs(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;return dj(r,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition)},n.emitCropData=function(){var r=n.getCropData();if(r){var o=r.croppedAreaPercentages,i=r.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(o,i),n.props.onCropAreaChange&&n.props.onCropAreaChange(o,i)}},n.emitCropAreaChange=function(){var r=n.getCropData();if(r){var o=r.croppedAreaPercentages,i=r.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(o,i)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var r=n.props.restrictPosition?Cs(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(r),n.emitCropData()}},n}return e.prototype.componentDidMount=function(){this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=bj,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef)},e.prototype.componentWillUnmount=function(){var n;this.currentWindow.removeEventListener("resize",this.computeSizes),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((n=this.styleRef.parentNode)===null||n===void 0||n.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},e.prototype.componentDidUpdate=function(n){var r,o,i,a,s,l,c,d,u;n.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):n.aspect!==this.props.aspect?this.computeSizes():n.zoom!==this.props.zoom?this.recomputeCropPosition():((r=n.cropSize)===null||r===void 0?void 0:r.height)!==((o=this.props.cropSize)===null||o===void 0?void 0:o.height)||((i=n.cropSize)===null||i===void 0?void 0:i.width)!==((a=this.props.cropSize)===null||a===void 0?void 0:a.width)?this.computeSizes():(((s=n.crop)===null||s===void 0?void 0:s.x)!==((l=this.props.crop)===null||l===void 0?void 0:l.x)||((c=n.crop)===null||c===void 0?void 0:c.y)!==((d=this.props.crop)===null||d===void 0?void 0:d.y))&&this.emitCropAreaChange(),n.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),n.video!==this.props.video&&((u=this.videoRef.current)===null||u===void 0||u.load())},e.prototype.getAspect=function(){var n=this.props,r=n.cropSize,o=n.aspect;return r?r.width/r.height:o},e.prototype.onPinchStart=function(n){var r=e.getTouchPoint(n.touches[0]),o=e.getTouchPoint(n.touches[1]);this.lastPinchDistance=I0(r,o),this.lastPinchRotation=N0(r,o),this.onDragStart(A0(r,o))},e.prototype.onPinchMove=function(n){var r=this,o=e.getTouchPoint(n.touches[0]),i=e.getTouchPoint(n.touches[1]),a=A0(o,i);this.onDrag(a),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var s=I0(o,i),l=r.props.zoom*(s/r.lastPinchDistance);r.setNewZoom(l,a,{shouldUpdatePosition:!1}),r.lastPinchDistance=s;var c=N0(o,i),d=r.props.rotation+(c-r.lastPinchRotation);r.props.onRotationChange&&r.props.onRotationChange(d),r.lastPinchRotation=c})},e.prototype.render=function(){var n=this,r=this.props,o=r.image,i=r.video,a=r.mediaProps,s=r.transform,l=r.crop,c=l.x,d=l.y,u=r.rotation,h=r.zoom,p=r.cropShape,m=r.showGrid,b=r.style,v=b.containerStyle,y=b.cropAreaStyle,$=b.mediaStyle,x=r.classes,C=x.containerClassName,w=x.cropAreaClassName,D=x.mediaClassName,E=r.objectFit;return f.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(M){return n.containerRef=M},"data-testid":"container",style:v,className:ws("reactEasyCrop_Container",C)},o?f.createElement("img",Ze({alt:"",className:ws("reactEasyCrop_Image",E==="contain"&&"reactEasyCrop_Contain",E==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",E==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",E==="auto-cover"&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),D)},a,{src:o,ref:this.imageRef,style:Ze(Ze({},$),{transform:s||"translate("+c+"px, "+d+"px) rotate("+u+"deg) scale("+h+")"}),onLoad:this.onMediaLoad})):i&&f.createElement("video",Ze({autoPlay:!0,loop:!0,muted:!0,className:ws("reactEasyCrop_Video",E==="contain"&&"reactEasyCrop_Contain",E==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",E==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",E==="auto-cover"&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),D)},a,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:Ze(Ze({},$),{transform:s||"translate("+c+"px, "+d+"px) rotate("+u+"deg) scale("+h+")"}),controls:!1}),(Array.isArray(i)?i:[{src:i}]).map(function(_){return f.createElement("source",Ze({key:_.src},_))})),this.state.cropSize&&f.createElement("div",{style:Ze(Ze({},y),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:ws("reactEasyCrop_CropArea",p==="round"&&"reactEasyCrop_CropAreaRound",m&&"reactEasyCrop_CropAreaGrid",w)}))},e.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:yj,minZoom:vj,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},e.getMousePoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},e.getTouchPoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},e}(f.Component);const xj=$j,Cj="_cropperContainer_h5pvp_1 _checkerboard_19dw7_1",wj="_media_h5pvp_15",_j="_cropArea_h5pvp_21",Sj="_cropperReady_h5pvp_61",_s={cropperContainer:Cj,media:wj,cropArea:_j,cropperReady:Sj,"fade-in":"_fade-in_h5pvp_1"},Ej=t=>{const[e,n]=f.useState(!1);return g.jsx(xj,{...t,disableAutomaticStylesInjection:!0,classes:{containerClassName:z(_s.cropperContainer,e&&_s.cropperReady),cropAreaClassName:_s.cropArea,mediaClassName:_s.media},onMediaLoaded:()=>n(!0)})},kj="_timeField_xn8xl_1",Dj="_segments_xn8xl_13",L0={timeField:kj,segments:Dj};function Pj(t){const{defaultValue:e,minValue:n,onChange:r,sx:o}=t,i=f.useRef(null),a=st(),s=Dh(),l=gR({locale:s,placeholderValue:qo(a).set({second:0}),defaultValue:e,minValue:n==="now"?qo(a):void 0,onChange:r,shouldForceLeadingZeros:!0}),{fieldProps:c}=nR({"aria-labelledby":"time-field"},l,i);return g.jsxs("div",{className:L0.timeField,style:o,children:[g.jsx(le,{name:"schedule",size:"medium",color:"grey11"}),g.jsx("div",{...c,className:L0.segments,ref:i,children:l.segments.map((d,u)=>g.jsx(r3,{segment:d,state:l},u))})]})}const Mj="_actionContainer_15ig0_1",Tj={actionContainer:Mj};function Rj(t){const{value:e,minValue:n,minTime:r,onSubmit:o,disabled:i=!1,triggerSize:a="small",label:s,fallback:l="No date selected"}=t,[c,d]=f.useState(v5(e??new Date,st())),u=f.useRef(null),h=Dh(),p=e&&SM(e==null?void 0:e.toISOString()),m={"aria-labelledby":"date-picker",placeholderValue:void 0,value:c,onChange:d},b=v$({...m,shouldCloseOnSelect:!1}),{calendarProps:v}=p$(m,b,u);function y(){b.setOpen(!b.isOpen)}function $(M){var I;(I=v.onChange)==null||I.call(v,M)}function x(M){var I;b.setTimeValue(M),(I=v.onChange)==null||I.call(v,b.dateValue)}function C(){o==null||o(b.dateValue.toDate(st())),y()}const w=r==="now"?Ij(c):!0,D=n==="today"?c>ro(st()):!0,E=D&&w;function _(){return D?w?"":"The time must be after now":"The date must be after today"}return g.jsx(di,{open:b.isOpen,align:"start",sideOffset:4,anchor:g.jsx(Se,{ref:u,size:a,color:"grey",onClick:y,disabled:i,hiddenLabel:s,children:e?vg.prettyPrintDate(e,h):l}),onInteractOutside:y,onEscapeKeyDown:y,children:g.jsxs(ve,{flexDirection:"column",gap:8,backgroundColor:"grey1",borderRadius:4,border:!0,boxShadow:"3",children:[g.jsx(e3,{value:v.value??void 0,onValueChange:$,minValue:n,border:!1}),g.jsxs("div",{className:Tj.actionContainer,children:[g.jsx(Pj,{defaultValue:p,onChange:x,sx:{flexGrow:1}}),g.jsx(ao,{content:_(),visible:!E,children:g.jsx(Se,{onClick:C,disabled:!E,children:"Apply"})})]})]})})}function Ij(t){const e=t.toDate(st()),n=e.getHours(),r=e.getMinutes(),o=qo(st()).toDate(),i=o.getHours(),a=o.getMinutes();function s(l){return l.getDate()===o.getDate()&&l.getMonth()===o.getMonth()&&l.getFullYear()===o.getFullYear()}return s(e)?n>i||n===i&&r>a:!0}const l7="Dialog",[c7,IQ]=hn(l7),[Nj,bn]=c7(l7),Aj=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!0}=t,s=f.useRef(null),l=f.useRef(null),[c=!1,d]=dr({prop:r,defaultProp:o,onChange:i});return f.createElement(Nj,{scope:e,triggerRef:s,contentRef:l,contentId:Pn(),titleId:Pn(),descriptionId:Pn(),open:c,onOpenChange:d,onOpenToggle:f.useCallback(()=>d(u=>!u),[d]),modal:a},n)},Lj="DialogTrigger",Oj=f.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=bn(Lj,n),i=Ee(e,o.triggerRef);return f.createElement(ye.button,F({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":np(o.open)},r,{ref:i,onClick:oe(t.onClick,o.onOpenToggle)}))}),d7="DialogPortal",[Vj,u7]=c7(d7,{forceMount:void 0}),Fj=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:o}=t,i=bn(d7,e);return f.createElement(Vj,{scope:e,forceMount:n},f.Children.map(r,a=>f.createElement(pn,{present:n||i.open},f.createElement(Ca,{asChild:!0,container:o},a))))},vf="DialogOverlay",jj=f.forwardRef((t,e)=>{const n=u7(vf,t.__scopeDialog),{forceMount:r=n.forceMount,...o}=t,i=bn(vf,t.__scopeDialog);return i.modal?f.createElement(pn,{present:r||i.open},f.createElement(Bj,F({},o,{ref:e}))):null}),Bj=f.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=bn(vf,n);return f.createElement(Qf,{as:zr,allowPinchZoom:!0,shards:[o.contentRef]},f.createElement(ye.div,F({"data-state":np(o.open)},r,{ref:e,style:{pointerEvents:"auto",...r.style}})))}),ma="DialogContent",Hj=f.forwardRef((t,e)=>{const n=u7(ma,t.__scopeDialog),{forceMount:r=n.forceMount,...o}=t,i=bn(ma,t.__scopeDialog);return f.createElement(pn,{present:r||i.open},i.modal?f.createElement(zj,F({},o,{ref:e})):f.createElement(Kj,F({},o,{ref:e})))}),zj=f.forwardRef((t,e)=>{const n=bn(ma,t.__scopeDialog),r=f.useRef(null),o=Ee(e,n.contentRef,r);return f.useEffect(()=>{const i=r.current;if(i)return Wl(i)},[]),f.createElement(f7,F({},t,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:oe(t.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:oe(t.onPointerDownOutside,i=>{const a=i.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&i.preventDefault()}),onFocusOutside:oe(t.onFocusOutside,i=>i.preventDefault())}))}),Kj=f.forwardRef((t,e)=>{const n=bn(ma,t.__scopeDialog),r=f.useRef(!1),o=f.useRef(!1);return f.createElement(f7,F({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a;if((a=t.onCloseAutoFocus)===null||a===void 0||a.call(t,i),!i.defaultPrevented){var s;r.current||(s=n.triggerRef.current)===null||s===void 0||s.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var a,s;(a=t.onInteractOutside)===null||a===void 0||a.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((s=n.triggerRef.current)===null||s===void 0?void 0:s.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),f7=f.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=t,s=bn(ma,n),l=f.useRef(null),c=Ee(e,l);return Bf(),f.createElement(f.Fragment,null,f.createElement(Hl,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},f.createElement(xa,F({role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":np(s.open)},a,{ref:c,onDismiss:()=>s.onOpenChange(!1)}))),!1)}),Wj="DialogTitle",Zj=f.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=bn(Wj,n);return f.createElement(ye.h2,F({id:o.titleId},r,{ref:e}))}),Uj="DialogClose",Gj=f.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=bn(Uj,n);return f.createElement(ye.button,F({type:"button"},r,{ref:e,onClick:oe(t.onClick,()=>o.onOpenChange(!1))}))});function np(t){return t?"open":"closed"}const h7=Aj,p7=Oj,m7=Fj,qj=jj,g7=Hj,Yj=Zj,b7=Gj,Jj="_overlay_12fyf_1",Xj="_container_12fyf_23",Qj="_child_12fyf_76",eB="_header_12fyf_128",tB="_headerIcon_12fyf_142",nB="_closeButton_12fyf_147",rB="_content_12fyf_153",oB="_actions_12fyf_165",iB="_footer_12fyf_177",aB="_link_12fyf_181",dt={overlay:Jj,"fade-in":"_fade-in_12fyf_1","fade-out":"_fade-out_12fyf_1",container:Xj,"container-large":"_container-large_12fyf_52","container-small":"_container-small_12fyf_57","container-center":"_container-center_12fyf_61","position-center-in":"_position-center-in_12fyf_1","position-center-out":"_position-center-out_12fyf_1",child:Qj,"position-child-center-in":"_position-child-center-in_12fyf_1","position-child-center-out":"_position-child-center-out_12fyf_1","container-top":"_container-top_12fyf_89","position-top-in":"_position-top-in_12fyf_1","position-top-out":"_position-top-out_12fyf_1","container-bottomRight":"_container-bottomRight_12fyf_115","position-bottom-right-in":"_position-bottom-right-in_12fyf_1","position-bottom-right-out":"_position-bottom-right-out_12fyf_1",header:eB,headerIcon:tB,closeButton:nB,content:rB,"contentPadding-16":"_contentPadding-16_12fyf_161",actions:oB,footer:iB,link:aB},sB="_container_1xbd4_1",lB="_fadeIn_1xbd4_1",cB="_fadeOut_1xbd4_1",dB={container:sB,fadeIn:lB,fadeOut:cB};function uB(t){const{trigger:e,children:n,onAnimationEnd:r,onEscapeKeyDown:o,...i}=t;return g.jsxs(h7,{...i,children:[e&&g.jsx(p7,{asChild:!0,children:e}),g.jsx(m7,{children:g.jsx(g7,{className:dB.container,onAnimationEnd:r,onEscapeKeyDown:o,children:n})})]})}function fB(t){const{trigger:e,children:n,renderTooltip:r=$=>$,onAnimationEnd:o,onAnimationStart:i,size:a="large",hasClose:s=!0,modal:l=!0,position:c="top",onPointerDownOutside:d,...u}=t;function h($){(a==="fullscreen"||l===!1)&&$.preventDefault()}const p=bB(),m=f.useRef(null);if(a==="fullscreen")return g.jsx(uB,{...t,onEscapeKeyDown:h});const b=a==="large"||a==="small",v=b?void 0:a,y=g.jsxs(g7,{style:{...v,top:p},className:z(dt.container,dt[`container-${c}`],b&&dt[`container-${a}`],p&&dt.child),onAnimationStart:i,onAnimationEnd:o,onEscapeKeyDown:h,onOpenAutoFocus:h,onCloseAutoFocus:h,onInteractOutside:h,onPointerDownOutside:d,ref:m,children:[g.jsx(v7.Provider,{value:{parentDialog:m},children:n}),s&&g.jsx("div",{className:dt.closeButton,children:g.jsx(b7,{asChild:!0,children:g.jsx(mt,{icon:"close",hiddenLabel:"Close dialog"})})})]});return g.jsxs(h7,{modal:l,...u,children:[r(e&&g.jsx(p7,{asChild:!0,children:e})),g.jsx(m7,{children:l?g.jsx(qj,{className:dt.overlay,children:y}):y})]})}const hB=t=>{const{icon:e,onIconClick:n,title:r}=t;return g.jsxs("header",{className:dt.header,children:[e&&g.jsx(pB,{icon:e,onClick:n}),g.jsx(Yj,{asChild:!0,children:g.jsx(J,{noSelect:!0,component:"span",variant:"bold",children:r})})]})};function pB(t){const{icon:e,onClick:n}=t;return n?g.jsx(mt,{icon:e,onClick:n}):g.jsx("div",{className:dt.headerIcon,children:g.jsx(le,{name:e,size:"medium",color:"grey11"})})}function mB(t){const{children:e,padding:n,...r}=t;return g.jsx("section",{...r,className:z(dt.content,n&&dt[`contentPadding-${n}`]),children:e})}const gB=t=>{const{ok:e,cancel:n,link:r,size:o="large",asFooter:i}=t;return g.jsxs("section",{className:z(dt.actions,i&&dt.footer),children:[r&&g.jsx(J,{className:dt.link,variant:"small",children:r}),n&&g.jsx(b7,{asChild:!0,children:g.jsx(Se,{color:"grey",size:o,onClick:n.onClick,children:n.text})}),g.jsx(ao,{visible:!!e.disabledTooltip,content:e.disabledTooltip??"",children:g.jsx(Se,{size:o,loading:e.loading,disabled:e.disabled,onClick:e.onClick,color:e.color??"purple",children:e.text})})]})},v7=f.createContext({parentDialog:null});function bB(){var o;const{parentDialog:t}=f.useContext(v7),e=(o=t==null?void 0:t.current)==null?void 0:o.getBoundingClientRect();if(!e)return;const{height:n,top:r}=e;return n/2+r}function y7(t){const e=t+"CollectionProvider",[n,r]=Vn(e),[o,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:m,children:b}=p,v=f.useRef(null),y=f.useRef(new Map).current;return f.createElement(o,{scope:m,itemMap:y,collectionRef:v},b)},s=t+"CollectionSlot",l=f.forwardRef((p,m)=>{const{scope:b,children:v}=p,y=i(s,b),$=pt(m,y.collectionRef);return f.createElement(il,{ref:$},v)}),c=t+"CollectionItemSlot",d="data-radix-collection-item",u=f.forwardRef((p,m)=>{const{scope:b,children:v,...y}=p,$=f.useRef(null),x=pt(m,$),C=i(c,b);return f.useEffect(()=>(C.itemMap.set($,{ref:$,...y}),()=>void C.itemMap.delete($))),f.createElement(il,{[d]:"",ref:x},v)});function h(p){const m=i(t+"CollectionConsumer",p);return f.useCallback(()=>{const v=m.collectionRef.current;if(!v)return[];const y=Array.from(v.querySelectorAll(`[${d}]`));return Array.from(m.itemMap.values()).sort((C,w)=>y.indexOf(C.ref.current)-y.indexOf(w.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:a,Slot:l,ItemSlot:u},h,r]}const Ol=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},vB=S["useId".toString()]||(()=>{});let yB=0;function $B(t){const[e,n]=S.useState(vB());return Ol(()=>{t||n(r=>r??String(yB++))},[t]),t||(e?`radix-${e}`:"")}const xB=f.createContext(void 0);function Fa(t){const e=f.useContext(xB);return t||e||"ltr"}const Fd="rovingFocusGroup.onEntryFocus",CB={bubbles:!1,cancelable:!0},rp="RovingFocusGroup",[yf,$7,wB]=y7(rp),[_B,ui]=Vn(rp,[wB]),[SB,EB]=_B(rp),kB=f.forwardRef((t,e)=>f.createElement(yf.Provider,{scope:t.__scopeRovingFocusGroup},f.createElement(yf.Slot,{scope:t.__scopeRovingFocusGroup},f.createElement(DB,F({},t,{ref:e}))))),DB=f.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,...d}=t,u=f.useRef(null),h=pt(e,u),p=Fa(i),[m=null,b]=io({prop:a,defaultProp:s,onChange:l}),[v,y]=f.useState(!1),$=Ph(c),x=$7(n),C=f.useRef(!1),[w,D]=f.useState(0);return f.useEffect(()=>{const E=u.current;if(E)return E.addEventListener(Fd,$),()=>E.removeEventListener(Fd,$)},[$]),f.createElement(SB,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:m,onItemFocus:f.useCallback(E=>b(E),[b]),onItemShiftTab:f.useCallback(()=>y(!0),[]),onFocusableItemAdd:f.useCallback(()=>D(E=>E+1),[]),onFocusableItemRemove:f.useCallback(()=>D(E=>E-1),[])},f.createElement(Ae.div,F({tabIndex:v||w===0?-1:0,"data-orientation":r},d,{ref:h,style:{outline:"none",...t.style},onMouseDown:We(t.onMouseDown,()=>{C.current=!0}),onFocus:We(t.onFocus,E=>{const _=!C.current;if(E.target===E.currentTarget&&_&&!v){const M=new CustomEvent(Fd,CB);if(E.currentTarget.dispatchEvent(M),!M.defaultPrevented){const I=x().filter(L=>L.focusable),k=I.find(L=>L.active),O=I.find(L=>L.id===m),T=[k,O,...I].filter(Boolean).map(L=>L.ref.current);x7(T)}}C.current=!1}),onBlur:We(t.onBlur,()=>y(!1))})))}),PB="RovingFocusGroupItem",MB=f.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,...i}=t,a=$B(),s=EB(PB,n),l=s.currentTabStopId===a,c=$7(n),{onFocusableItemAdd:d,onFocusableItemRemove:u}=s;return f.useEffect(()=>{if(r)return d(),()=>u()},[r,d,u]),f.createElement(yf.ItemSlot,{scope:n,id:a,focusable:r,active:o},f.createElement(Ae.span,F({tabIndex:l?0:-1,"data-orientation":s.orientation},i,{ref:e,onMouseDown:We(t.onMouseDown,h=>{r?s.onItemFocus(a):h.preventDefault()}),onFocus:We(t.onFocus,()=>s.onItemFocus(a)),onKeyDown:We(t.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){s.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const p=IB(h,s.orientation,s.dir);if(p!==void 0){h.preventDefault();let b=c().filter(v=>v.focusable).map(v=>v.ref.current);if(p==="last")b.reverse();else if(p==="prev"||p==="next"){p==="prev"&&b.reverse();const v=b.indexOf(h.currentTarget);b=s.loop?NB(b,v+1):b.slice(v+1)}setTimeout(()=>x7(b))}})})))}),TB={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function RB(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function IB(t,e,n){const r=RB(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return TB[r]}function x7(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function NB(t,e){return t.map((n,r)=>t[(e+r)%t.length])}const op=kB,ip=MB;function ap(t){const[e,n]=f.useState(void 0);return Ol(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,s;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,s=c.blockSize}else a=t.offsetWidth,s=t.offsetHeight;n({width:a,height:s})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}function sp(t){const e=f.useRef({value:t,previous:t});return f.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function AB(t,e){return f.useReducer((n,r)=>{const o=e[n][r];return o??n},t)}const C7=t=>{const{present:e,children:n}=t,r=LB(e),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),i=pt(r.ref,o.ref);return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:i}):null};C7.displayName="Presence";function LB(t){const[e,n]=f.useState(),r=f.useRef({}),o=f.useRef(t),i=f.useRef("none"),a=t?"mounted":"unmounted",[s,l]=AB(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const c=Ss(r.current);i.current=s==="mounted"?c:"none"},[s]),Ol(()=>{const c=r.current,d=o.current;if(d!==t){const h=i.current,p=Ss(c);t?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,l]),Ol(()=>{if(e){const c=u=>{const p=Ss(r.current).includes(u.animationName);u.target===e&&p&&Ut.flushSync(()=>l("ANIMATION_END"))},d=u=>{u.target===e&&(i.current=Ss(r.current))};return e.addEventListener("animationstart",d),e.addEventListener("animationcancel",c),e.addEventListener("animationend",c),()=>{e.removeEventListener("animationstart",d),e.removeEventListener("animationcancel",c),e.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:f.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Ss(t){return(t==null?void 0:t.animationName)||"none"}const w7="Radio",[OB,_7]=Vn(w7),[VB,FB]=OB(w7),jB=f.forwardRef((t,e)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:a,value:s="on",onCheck:l,...c}=t,[d,u]=f.useState(null),h=pt(e,b=>u(b)),p=f.useRef(!1),m=d?!!d.closest("form"):!0;return f.createElement(VB,{scope:n,checked:o,disabled:a},f.createElement(Ae.button,F({type:"button",role:"radio","aria-checked":o,"data-state":S7(o),"data-disabled":a?"":void 0,disabled:a,value:s},c,{ref:h,onClick:We(t.onClick,b=>{o||l==null||l(),m&&(p.current=b.isPropagationStopped(),p.current||b.stopPropagation())})})),m&&f.createElement(zB,{control:d,bubbles:!p.current,name:r,value:s,checked:o,required:i,disabled:a,style:{transform:"translateX(-100%)"}}))}),BB="RadioIndicator",HB=f.forwardRef((t,e)=>{const{__scopeRadio:n,forceMount:r,...o}=t,i=FB(BB,n);return f.createElement(C7,{present:r||i.checked},f.createElement(Ae.span,F({"data-state":S7(i.checked),"data-disabled":i.disabled?"":void 0},o,{ref:e})))}),zB=t=>{const{control:e,checked:n,bubbles:r=!0,...o}=t,i=f.useRef(null),a=sp(n),s=ap(e);return f.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(c,"checked").set;if(a!==n&&u){const h=new Event("click",{bubbles:r});u.call(l,n),l.dispatchEvent(h)}},[a,n,r]),f.createElement("input",F({type:"radio","aria-hidden":!0,defaultChecked:n},o,{tabIndex:-1,ref:i,style:{...t.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function S7(t){return t?"checked":"unchecked"}const KB=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],E7="RadioGroup",[WB,NQ]=Vn(E7,[ui,_7]),k7=ui(),D7=_7(),[ZB,UB]=WB(E7),GB=f.forwardRef((t,e)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:a=!1,disabled:s=!1,orientation:l,dir:c,loop:d=!0,onValueChange:u,...h}=t,p=k7(n),m=Fa(c),[b,v]=io({prop:i,defaultProp:o,onChange:u});return f.createElement(ZB,{scope:n,name:r,required:a,disabled:s,value:b,onValueChange:v},f.createElement(op,F({asChild:!0},p,{orientation:l,dir:m,loop:d}),f.createElement(Ae.div,F({role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":s?"":void 0,dir:m},h,{ref:e}))))}),qB="RadioGroupItem",YB=f.forwardRef((t,e)=>{const{__scopeRadioGroup:n,disabled:r,...o}=t,i=UB(qB,n),a=i.disabled||r,s=k7(n),l=D7(n),c=f.useRef(null),d=pt(e,c),u=i.value===o.value,h=f.useRef(!1);return f.useEffect(()=>{const p=b=>{KB.includes(b.key)&&(h.current=!0)},m=()=>h.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",m)}},[]),f.createElement(ip,F({asChild:!0},s,{focusable:!a,active:u}),f.createElement(jB,F({disabled:a,required:i.required,checked:u},l,o,{name:i.name,ref:d,onCheck:()=>i.onValueChange(o.value),onKeyDown:We(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:We(o.onFocus,()=>{var p;h.current&&((p=c.current)===null||p===void 0||p.click())})})))}),JB=f.forwardRef((t,e)=>{const{__scopeRadioGroup:n,...r}=t,o=D7(n);return f.createElement(HB,F({},o,r,{ref:e}))}),P7=GB,M7=YB,XB=JB,QB="_root_8nb1w_1",eH="_footer_8nb1w_28",tH="_groupRoot_8nb1w_33",nH="_item_8nb1w_40",rH="_uniformPadding_8nb1w_67",oH="_itemIcon_8nb1w_79",iH="_itemTextContainer_8nb1w_90",It={root:QB,"width-large":"_width-large_8nb1w_14","width-auto":"_width-auto_8nb1w_17","padding-medium":"_padding-medium_8nb1w_21","padding-small":"_padding-small_8nb1w_24",footer:eH,groupRoot:tH,item:nH,uniformPadding:rH,"inlinePadding-icon":"_inlinePadding-icon_8nb1w_71","inlinePadding-default":"_inlinePadding-default_8nb1w_74",itemIcon:oH,itemTextContainer:iH},aH=({value:t,onValueChange:e,children:n,width:r="large",padding:o="medium",footer:i})=>g.jsxs("aside",{className:It.root,children:[g.jsx(P7,{className:z(It.groupRoot,It[`width-${r}`],It[`padding-${o}`]),value:t,onValueChange:e,orientation:"vertical",children:n}),i&&g.jsx("div",{className:z(It.footer,It[`padding-${o}`]),children:i})]}),sH=({value:t,icon:e,title:n,subtitle:r})=>{const o=n||r,i=z(It.item,It[`inlinePadding-${e?"icon":"default"}`],!o&&It.uniformPadding);return g.jsxs(M7,{className:i,value:t,children:[e&&g.jsx("div",{className:It.itemIcon,children:g.jsx(le,{name:e,size:"medium",color:"grey11"})}),o&&g.jsxs("div",{className:It.itemTextContainer,children:[g.jsx(J,{variant:"bold",color:"grey12",noWrap:!0,children:n}),g.jsx(J,{variant:"small",color:"grey11",noWrap:!0,children:r})]})]})},lH="_root_15mfy_1",cH="_grey_15mfy_11",dH="_green_15mfy_16",uH="_amber_15mfy_21",fH="_purple_15mfy_26",O0={root:lH,grey:cH,green:dH,amber:uH,purple:fH};function hH(t){const{color:e,role:n="status"}=t;return g.jsx("div",{role:n,className:z(O0.root,O0[e])})}function xe(t,e,{checkForDefaultPrevented:n=!0}={}){return function(o){if(t==null||t(o),n===!1||!o.defaultPrevented)return e==null?void 0:e(o)}}function pH(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function Cc(...t){return e=>t.forEach(n=>pH(n,e))}function kt(...t){return S.useCallback(Cc(...t),t)}function ja(t,e=[]){let n=[];function r(i,a){const s=S.createContext(a),l=n.length;n=[...n,a];function c(u){const{scope:h,children:p,...m}=u,b=(h==null?void 0:h[t][l])||s,v=S.useMemo(()=>m,Object.values(m));return g.jsx(b.Provider,{value:v,children:p})}function d(u,h){const p=(h==null?void 0:h[t][l])||s,m=S.useContext(p);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,d]}const o=()=>{const i=n.map(a=>S.createContext(a));return function(s){const l=(s==null?void 0:s[t])||i;return S.useMemo(()=>({[`__scope${t}`]:{...s,[t]:l}}),[s,l])}};return o.scopeName=t,[r,mH(o,...e)]}function mH(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const u=l(i)[`__scope${c}`];return{...s,...u}},{});return S.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}function fr(t){const e=S.useRef(t);return S.useEffect(()=>{e.current=t}),S.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function T7({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,o]=gH({defaultProp:e,onChange:n}),i=t!==void 0,a=i?t:r,s=fr(n),l=S.useCallback(c=>{if(i){const u=typeof c=="function"?c(t):c;u!==t&&s(u)}else o(c)},[i,t,o,s]);return[a,l]}function gH({defaultProp:t,onChange:e}){const n=S.useState(t),[r]=n,o=S.useRef(r),i=fr(e);return S.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var ga=S.forwardRef((t,e)=>{const{children:n,...r}=t,o=S.Children.toArray(n),i=o.find(vH);if(i){const a=i.props.children,s=o.map(l=>l===i?S.Children.count(a)>1?S.Children.only(null):S.isValidElement(a)?a.props.children:null:l);return g.jsx($f,{...r,ref:e,children:S.isValidElement(a)?S.cloneElement(a,void 0,s):null})}return g.jsx($f,{...r,ref:e,children:n})});ga.displayName="Slot";var $f=S.forwardRef((t,e)=>{const{children:n,...r}=t;if(S.isValidElement(n)){const o=$H(n);return S.cloneElement(n,{...yH(r,n.props),ref:e?Cc(e,o):o})}return S.Children.count(n)>1?S.Children.only(null):null});$f.displayName="SlotClone";var bH=({children:t})=>g.jsx(g.Fragment,{children:t});function vH(t){return S.isValidElement(t)&&t.type===bH}function yH(t,e){const n={...e};for(const r in e){const o=t[r],i=e[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...t,...n}}function $H(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var xH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],bt=xH.reduce((t,e)=>{const n=S.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?ga:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(s,{...a,ref:o})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function CH(t,e){t&&Nf.flushSync(()=>t.dispatchEvent(e))}function R7(t){const e=t+"CollectionProvider",[n,r]=ja(e),[o,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:m,children:b}=p,v=f.useRef(null),y=f.useRef(new Map).current;return g.jsx(o,{scope:m,itemMap:y,collectionRef:v,children:b})};a.displayName=e;const s=t+"CollectionSlot",l=f.forwardRef((p,m)=>{const{scope:b,children:v}=p,y=i(s,b),$=kt(m,y.collectionRef);return g.jsx(ga,{ref:$,children:v})});l.displayName=s;const c=t+"CollectionItemSlot",d="data-radix-collection-item",u=f.forwardRef((p,m)=>{const{scope:b,children:v,...y}=p,$=f.useRef(null),x=kt(m,$),C=i(c,b);return f.useEffect(()=>(C.itemMap.set($,{ref:$,...y}),()=>void C.itemMap.delete($))),g.jsx(ga,{[d]:"",ref:x,children:v})});u.displayName=c;function h(p){const m=i(t+"CollectionConsumer",p);return f.useCallback(()=>{const v=m.collectionRef.current;if(!v)return[];const y=Array.from(v.querySelectorAll(`[${d}]`));return Array.from(m.itemMap.values()).sort((C,w)=>y.indexOf(C.ref.current)-y.indexOf(w.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:a,Slot:l,ItemSlot:u},h,r]}var wH=S.createContext(void 0);function I7(t){const e=S.useContext(wH);return t||e||"ltr"}var jd=0;function _H(){S.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??V0()),document.body.insertAdjacentElement("beforeend",t[1]??V0()),jd++,()=>{jd===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),jd--}},[])}function V0(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}var Bd="focusScope.autoFocusOnMount",Hd="focusScope.autoFocusOnUnmount",F0={bubbles:!1,cancelable:!0},SH="FocusScope",N7=S.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=t,[s,l]=S.useState(null),c=fr(o),d=fr(i),u=S.useRef(null),h=kt(e,b=>l(b)),p=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(r){let b=function(x){if(p.paused||!s)return;const C=x.target;s.contains(C)?u.current=C:Wn(u.current,{select:!0})},v=function(x){if(p.paused||!s)return;const C=x.relatedTarget;C!==null&&(s.contains(C)||Wn(u.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const w of x)w.removedNodes.length>0&&Wn(s)};document.addEventListener("focusin",b),document.addEventListener("focusout",v);const $=new MutationObserver(y);return s&&$.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",v),$.disconnect()}}},[r,s,p.paused]),S.useEffect(()=>{if(s){B0.add(p);const b=document.activeElement;if(!s.contains(b)){const y=new CustomEvent(Bd,F0);s.addEventListener(Bd,c),s.dispatchEvent(y),y.defaultPrevented||(EH(TH(A7(s)),{select:!0}),document.activeElement===b&&Wn(s))}return()=>{s.removeEventListener(Bd,c),setTimeout(()=>{const y=new CustomEvent(Hd,F0);s.addEventListener(Hd,d),s.dispatchEvent(y),y.defaultPrevented||Wn(b??document.body,{select:!0}),s.removeEventListener(Hd,d),B0.remove(p)},0)}}},[s,c,d,p]);const m=S.useCallback(b=>{if(!n&&!r||p.paused)return;const v=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,y=document.activeElement;if(v&&y){const $=b.currentTarget,[x,C]=kH($);x&&C?!b.shiftKey&&y===C?(b.preventDefault(),n&&Wn(x,{select:!0})):b.shiftKey&&y===x&&(b.preventDefault(),n&&Wn(C,{select:!0})):y===$&&b.preventDefault()}},[n,r,p.paused]);return g.jsx(bt.div,{tabIndex:-1,...a,ref:h,onKeyDown:m})});N7.displayName=SH;function EH(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Wn(r,{select:e}),document.activeElement!==n)return}function kH(t){const e=A7(t),n=j0(e,t),r=j0(e.reverse(),t);return[n,r]}function A7(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function j0(t,e){for(const n of t)if(!DH(n,{upTo:e}))return n}function DH(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function PH(t){return t instanceof HTMLInputElement&&"select"in t}function Wn(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&PH(t)&&e&&t.select()}}var B0=MH();function MH(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=H0(t,e),t.unshift(e)},remove(e){var n;t=H0(t,e),(n=t[0])==null||n.resume()}}}function H0(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function TH(t){return t.filter(e=>e.tagName!=="A")}var eo=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},RH=S["useId".toString()]||(()=>{}),IH=0;function xf(t){const[e,n]=S.useState(RH());return eo(()=>{t||n(r=>r??String(IH++))},[t]),t||(e?`radix-${e}`:"")}var NH="Arrow",L7=S.forwardRef((t,e)=>{const{children:n,width:r=10,height:o=5,...i}=t;return g.jsx(bt.svg,{...i,ref:e,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});L7.displayName=NH;var AH=L7;function LH(t){const[e,n]=S.useState(void 0);return eo(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,s;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,s=c.blockSize}else a=t.offsetWidth,s=t.offsetHeight;n({width:a,height:s})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var lp="Popper",[O7,V7]=ja(lp),[OH,F7]=O7(lp),j7=t=>{const{__scopePopper:e,children:n}=t,[r,o]=S.useState(null);return g.jsx(OH,{scope:e,anchor:r,onAnchorChange:o,children:n})};j7.displayName=lp;var B7="PopperAnchor",H7=S.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...o}=t,i=F7(B7,n),a=S.useRef(null),s=kt(e,a);return S.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:g.jsx(bt.div,{...o,ref:s})});H7.displayName=B7;var cp="PopperContent",[VH,FH]=O7(cp),z7=S.forwardRef((t,e)=>{var Y,re,se,ie,de,j;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:u="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:m,...b}=t,v=F7(cp,n),[y,$]=S.useState(null),x=kt(e,ue=>$(ue)),[C,w]=S.useState(null),D=LH(C),E=(D==null?void 0:D.width)??0,_=(D==null?void 0:D.height)??0,M=r+(i!=="center"?"-"+i:""),I=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},k=Array.isArray(c)?c:[c],O=k.length>0,R={padding:I,boundary:k.filter(BH),altBoundary:O},{refs:T,floatingStyles:L,placement:V,isPositioned:N,middlewareData:W}=l2({strategy:"fixed",placement:M,whileElementsMounted:(...ue)=>i2(...ue,{animationFrame:p==="always"}),elements:{reference:v.anchor},middleware:[Gg({mainAxis:o+_,alignmentAxis:a}),l&&Yg({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Jg():void 0,...R}),l&&Zg({...R}),Xg({...R,apply:({elements:ue,rects:Ce,availableWidth:ke,availableHeight:Le})=>{const{width:rt,height:Gt}=Ce.reference,Oe=ue.floating.style;Oe.setProperty("--radix-popper-available-width",`${ke}px`),Oe.setProperty("--radix-popper-available-height",`${Le}px`),Oe.setProperty("--radix-popper-anchor-width",`${rt}px`),Oe.setProperty("--radix-popper-anchor-height",`${Gt}px`)}}),C&&a2({element:C,padding:s}),HH({arrowWidth:E,arrowHeight:_}),h&&Ug({strategy:"referenceHidden",...R})]}),[A,Z]=Z7(V),q=fr(m);eo(()=>{N&&(q==null||q())},[N,q]);const Q=(Y=W.arrow)==null?void 0:Y.x,K=(re=W.arrow)==null?void 0:re.y,ne=((se=W.arrow)==null?void 0:se.centerOffset)!==0,[ce,ae]=S.useState();return eo(()=>{y&&ae(window.getComputedStyle(y).zIndex)},[y]),g.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:N?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[(ie=W.transformOrigin)==null?void 0:ie.x,(de=W.transformOrigin)==null?void 0:de.y].join(" "),...((j=W.hide)==null?void 0:j.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:g.jsx(VH,{scope:n,placedSide:A,onArrowChange:w,arrowX:Q,arrowY:K,shouldHideArrow:ne,children:g.jsx(bt.div,{"data-side":A,"data-align":Z,...b,ref:x,style:{...b.style,animation:N?void 0:"none"}})})})});z7.displayName=cp;var K7="PopperArrow",jH={top:"bottom",right:"left",bottom:"top",left:"right"},W7=S.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,i=FH(K7,r),a=jH[i.placedSide];return g.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:g.jsx(AH,{...o,ref:n,style:{...o.style,display:"block"}})})});W7.displayName=K7;function BH(t){return t!==null}var HH=t=>({name:"transformOrigin",options:t,fn(e){var v,y,$;const{placement:n,rects:r,middlewareData:o}=e,a=((v=o.arrow)==null?void 0:v.centerOffset)!==0,s=a?0:t.arrowWidth,l=a?0:t.arrowHeight,[c,d]=Z7(n),u={start:"0%",center:"50%",end:"100%"}[d],h=(((y=o.arrow)==null?void 0:y.x)??0)+s/2,p=((($=o.arrow)==null?void 0:$.y)??0)+l/2;let m="",b="";return c==="bottom"?(m=a?u:`${h}px`,b=`${-l}px`):c==="top"?(m=a?u:`${h}px`,b=`${r.floating.height+l}px`):c==="right"?(m=`${-l}px`,b=a?u:`${p}px`):c==="left"&&(m=`${r.floating.width+l}px`,b=a?u:`${p}px`),{data:{x:m,y:b}}}});function Z7(t){const[e,n="center"]=t.split("-");return[e,n]}var zH=j7,KH=H7,WH=z7,ZH=W7,UH="Portal",U7=S.forwardRef((t,e)=>{var s;const{container:n,...r}=t,[o,i]=S.useState(!1);eo(()=>i(!0),[]);const a=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return a?Ut.createPortal(g.jsx(bt.div,{...r,ref:e}),a):null});U7.displayName=UH;function GH(t,e){return S.useReducer((n,r)=>e[n][r]??n,t)}var Ba=t=>{const{present:e,children:n}=t,r=qH(e),o=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),i=kt(r.ref,YH(o));return typeof n=="function"||r.isPresent?S.cloneElement(o,{ref:i}):null};Ba.displayName="Presence";function qH(t){const[e,n]=S.useState(),r=S.useRef({}),o=S.useRef(t),i=S.useRef("none"),a=t?"mounted":"unmounted",[s,l]=GH(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const c=Es(r.current);i.current=s==="mounted"?c:"none"},[s]),eo(()=>{const c=r.current,d=o.current;if(d!==t){const h=i.current,p=Es(c);t?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,l]),eo(()=>{if(e){const c=u=>{const p=Es(r.current).includes(u.animationName);u.target===e&&p&&Nf.flushSync(()=>l("ANIMATION_END"))},d=u=>{u.target===e&&(i.current=Es(r.current))};return e.addEventListener("animationstart",d),e.addEventListener("animationcancel",c),e.addEventListener("animationend",c),()=>{e.removeEventListener("animationstart",d),e.removeEventListener("animationcancel",c),e.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:S.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Es(t){return(t==null?void 0:t.animationName)||"none"}function YH(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var zd="rovingFocusGroup.onEntryFocus",JH={bubbles:!1,cancelable:!0},wc="RovingFocusGroup",[Cf,G7,XH]=R7(wc),[QH,q7]=ja(wc,[XH]),[ez,tz]=QH(wc),Y7=S.forwardRef((t,e)=>g.jsx(Cf.Provider,{scope:t.__scopeRovingFocusGroup,children:g.jsx(Cf.Slot,{scope:t.__scopeRovingFocusGroup,children:g.jsx(nz,{...t,ref:e})})}));Y7.displayName=wc;var nz=S.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:d=!1,...u}=t,h=S.useRef(null),p=kt(e,h),m=I7(i),[b=null,v]=T7({prop:a,defaultProp:s,onChange:l}),[y,$]=S.useState(!1),x=fr(c),C=G7(n),w=S.useRef(!1),[D,E]=S.useState(0);return S.useEffect(()=>{const _=h.current;if(_)return _.addEventListener(zd,x),()=>_.removeEventListener(zd,x)},[x]),g.jsx(ez,{scope:n,orientation:r,dir:m,loop:o,currentTabStopId:b,onItemFocus:S.useCallback(_=>v(_),[v]),onItemShiftTab:S.useCallback(()=>$(!0),[]),onFocusableItemAdd:S.useCallback(()=>E(_=>_+1),[]),onFocusableItemRemove:S.useCallback(()=>E(_=>_-1),[]),children:g.jsx(bt.div,{tabIndex:y||D===0?-1:0,"data-orientation":r,...u,ref:p,style:{outline:"none",...t.style},onMouseDown:xe(t.onMouseDown,()=>{w.current=!0}),onFocus:xe(t.onFocus,_=>{const M=!w.current;if(_.target===_.currentTarget&&M&&!y){const I=new CustomEvent(zd,JH);if(_.currentTarget.dispatchEvent(I),!I.defaultPrevented){const k=C().filter(V=>V.focusable),O=k.find(V=>V.active),R=k.find(V=>V.id===b),L=[O,R,...k].filter(Boolean).map(V=>V.ref.current);Q7(L,d)}}w.current=!1}),onBlur:xe(t.onBlur,()=>$(!1))})})}),J7="RovingFocusGroupItem",X7=S.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...a}=t,s=xf(),l=i||s,c=tz(J7,n),d=c.currentTabStopId===l,u=G7(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=c;return S.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),g.jsx(Cf.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:g.jsx(bt.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...a,ref:e,onMouseDown:xe(t.onMouseDown,m=>{r?c.onItemFocus(l):m.preventDefault()}),onFocus:xe(t.onFocus,()=>c.onItemFocus(l)),onKeyDown:xe(t.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){c.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const b=iz(m,c.orientation,c.dir);if(b!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let y=u().filter($=>$.focusable).map($=>$.ref.current);if(b==="last")y.reverse();else if(b==="prev"||b==="next"){b==="prev"&&y.reverse();const $=y.indexOf(m.currentTarget);y=c.loop?az(y,$+1):y.slice($+1)}setTimeout(()=>Q7(y))}})})})});X7.displayName=J7;var rz={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function oz(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function iz(t,e,n){const r=oz(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return rz[r]}function Q7(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function az(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var sz=Y7,lz=X7,eC=Yf(),Kd=function(){},_c=S.forwardRef(function(t,e){var n=S.useRef(null),r=S.useState({onScrollCapture:Kd,onWheelCapture:Kd,onTouchMoveCapture:Kd}),o=r[0],i=r[1],a=t.forwardProps,s=t.children,l=t.className,c=t.removeScrollBar,d=t.enabled,u=t.shards,h=t.sideCar,p=t.noIsolation,m=t.inert,b=t.allowPinchZoom,v=t.as,y=v===void 0?"div":v,$=t.gapMode,x=Zl(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=h,w=qf([n,e]),D=Me(Me({},x),o);return S.createElement(S.Fragment,null,d&&S.createElement(C,{sideCar:eC,removeScrollBar:c,shards:u,noIsolation:p,inert:m,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:$}),a?S.cloneElement(S.Children.only(s),Me(Me({},D),{ref:w})):S.createElement(y,Me({},D,{className:l,ref:w}),s))});_c.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};_c.classNames={fullWidth:jo,zeroRight:Fo};var wf=!1;if(typeof window<"u")try{var ks=Object.defineProperty({},"passive",{get:function(){return wf=!0,!0}});window.addEventListener("test",ks,ks),window.removeEventListener("test",ks,ks)}catch{wf=!1}var _o=wf?{passive:!1}:!1,cz=function(t){return t.tagName==="TEXTAREA"},tC=function(t,e){var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!cz(t)&&n[e]==="visible")},dz=function(t){return tC(t,"overflowY")},uz=function(t){return tC(t,"overflowX")},z0=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=nC(t,r);if(o){var i=rC(t,r),a=i[1],s=i[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},fz=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},hz=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},nC=function(t,e){return t==="v"?dz(e):uz(e)},rC=function(t,e){return t==="v"?fz(e):hz(e)},pz=function(t,e){return t==="h"&&e==="rtl"?-1:1},mz=function(t,e,n,r,o){var i=pz(t,window.getComputedStyle(e).direction),a=i*r,s=n.target,l=e.contains(s),c=!1,d=a>0,u=0,h=0;do{var p=rC(t,s),m=p[0],b=p[1],v=p[2],y=b-v-i*m;(m||y)&&nC(t,s)&&(u+=y,h+=m),s instanceof ShadowRoot?s=s.host:s=s.parentNode}while(!l&&s!==document.body||l&&(e.contains(s)||e===s));return(d&&(o&&Math.abs(u)<1||!o&&a>u)||!d&&(o&&Math.abs(h)<1||!o&&-a>h))&&(c=!0),c},Ds=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},K0=function(t){return[t.deltaX,t.deltaY]},W0=function(t){return t&&"current"in t?t.current:t},gz=function(t,e){return t[0]===e[0]&&t[1]===e[1]},bz=function(t){return`
|
|
490
490
|
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
491
491
|
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
492
492
|
`)},vz=0,So=[];function yz(t){var e=S.useRef([]),n=S.useRef([0,0]),r=S.useRef(),o=S.useState(vz++)[0],i=S.useState(Gl)[0],a=S.useRef(t);S.useEffect(function(){a.current=t},[t]),S.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var b=Gf([t.lockRef.current],(t.shards||[]).map(W0),!0).filter(Boolean);return b.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var s=S.useCallback(function(b,v){if("touches"in b&&b.touches.length===2)return!a.current.allowPinchZoom;var y=Ds(b),$=n.current,x="deltaX"in b?b.deltaX:$[0]-y[0],C="deltaY"in b?b.deltaY:$[1]-y[1],w,D=b.target,E=Math.abs(x)>Math.abs(C)?"h":"v";if("touches"in b&&E==="h"&&D.type==="range")return!1;var _=z0(E,D);if(!_)return!0;if(_?w=E:(w=E==="v"?"h":"v",_=z0(E,D)),!_)return!1;if(!r.current&&"changedTouches"in b&&(x||C)&&(r.current=w),!w)return!0;var M=r.current||w;return mz(M,v,b,M==="h"?x:C,!0)},[]),l=S.useCallback(function(b){var v=b;if(!(!So.length||So[So.length-1]!==i)){var y="deltaY"in v?K0(v):Ds(v),$=e.current.filter(function(w){return w.name===v.type&&(w.target===v.target||v.target===w.shadowParent)&&gz(w.delta,y)})[0];if($&&$.should){v.cancelable&&v.preventDefault();return}if(!$){var x=(a.current.shards||[]).map(W0).filter(Boolean).filter(function(w){return w.contains(v.target)}),C=x.length>0?s(v,x[0]):!a.current.noIsolation;C&&v.cancelable&&v.preventDefault()}}},[]),c=S.useCallback(function(b,v,y,$){var x={name:b,delta:v,target:y,should:$,shadowParent:$z(y)};e.current.push(x),setTimeout(function(){e.current=e.current.filter(function(C){return C!==x})},1)},[]),d=S.useCallback(function(b){n.current=Ds(b),r.current=void 0},[]),u=S.useCallback(function(b){c(b.type,K0(b),b.target,s(b,t.lockRef.current))},[]),h=S.useCallback(function(b){c(b.type,Ds(b),b.target,s(b,t.lockRef.current))},[]);S.useEffect(function(){return So.push(i),t.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:h}),document.addEventListener("wheel",l,_o),document.addEventListener("touchmove",l,_o),document.addEventListener("touchstart",d,_o),function(){So=So.filter(function(b){return b!==i}),document.removeEventListener("wheel",l,_o),document.removeEventListener("touchmove",l,_o),document.removeEventListener("touchstart",d,_o)}},[]);var p=t.removeScrollBar,m=t.inert;return S.createElement(S.Fragment,null,m?S.createElement(i,{styles:bz(o)}):null,p?S.createElement(Xf,{gapMode:t.gapMode}):null)}function $z(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const xz=Jf(eC,yz);var oC=S.forwardRef(function(t,e){return S.createElement(_c,Me({},t,{ref:e,sideCar:xz}))});oC.classNames=_c.classNames;const Cz=oC;var _f=["Enter"," "],wz=["ArrowDown","PageUp","Home"],iC=["ArrowUp","PageDown","End"],_z=[...wz,...iC],Sz={ltr:[..._f,"ArrowRight"],rtl:[..._f,"ArrowLeft"]},Ez={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ha="Menu",[ba,kz,Dz]=R7(Ha),[so,aC]=ja(Ha,[Dz,V7,q7]),Sc=V7(),sC=q7(),[Pz,lo]=so(Ha),[Mz,za]=so(Ha),lC=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:i,modal:a=!0}=t,s=Sc(e),[l,c]=S.useState(null),d=S.useRef(!1),u=fr(i),h=I7(o);return S.useEffect(()=>{const p=()=>{d.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>d.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),g.jsx(zH,{...s,children:g.jsx(Pz,{scope:e,open:n,onOpenChange:u,content:l,onContentChange:c,children:g.jsx(Mz,{scope:e,onClose:S.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:d,dir:h,modal:a,children:r})})})};lC.displayName=Ha;var Tz="MenuAnchor",dp=S.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=Sc(n);return g.jsx(KH,{...o,...r,ref:e})});dp.displayName=Tz;var up="MenuPortal",[Rz,cC]=so(up,{forceMount:void 0}),dC=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,i=lo(up,e);return g.jsx(Rz,{scope:e,forceMount:n,children:g.jsx(Ba,{present:n||i.open,children:g.jsx(U7,{asChild:!0,container:o,children:r})})})};dC.displayName=up;var Et="MenuContent",[Iz,fp]=so(Et),uC=S.forwardRef((t,e)=>{const n=cC(Et,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,i=lo(Et,t.__scopeMenu),a=za(Et,t.__scopeMenu);return g.jsx(ba.Provider,{scope:t.__scopeMenu,children:g.jsx(Ba,{present:r||i.open,children:g.jsx(ba.Slot,{scope:t.__scopeMenu,children:a.modal?g.jsx(Nz,{...o,ref:e}):g.jsx(Az,{...o,ref:e})})})})}),Nz=S.forwardRef((t,e)=>{const n=lo(Et,t.__scopeMenu),r=S.useRef(null),o=kt(e,r);return S.useEffect(()=>{const i=r.current;if(i)return Wl(i)},[]),g.jsx(hp,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:xe(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Az=S.forwardRef((t,e)=>{const n=lo(Et,t.__scopeMenu);return g.jsx(hp,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),hp=S.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:h,onDismiss:p,disableOutsideScroll:m,...b}=t,v=lo(Et,n),y=za(Et,n),$=Sc(n),x=sC(n),C=kz(n),[w,D]=S.useState(null),E=S.useRef(null),_=kt(e,E,v.onContentChange),M=S.useRef(0),I=S.useRef(""),k=S.useRef(0),O=S.useRef(null),R=S.useRef("right"),T=S.useRef(0),L=m?Cz:S.Fragment,V=m?{as:ga,allowPinchZoom:!0}:void 0,N=A=>{var Y,re;const Z=I.current+A,q=C().filter(se=>!se.disabled),Q=document.activeElement,K=(Y=q.find(se=>se.ref.current===Q))==null?void 0:Y.textValue,ne=q.map(se=>se.textValue),ce=Uz(ne,Z,K),ae=(re=q.find(se=>se.textValue===ce))==null?void 0:re.ref.current;(function se(ie){I.current=ie,window.clearTimeout(M.current),ie!==""&&(M.current=window.setTimeout(()=>se(""),1e3))})(Z),ae&&setTimeout(()=>ae.focus())};S.useEffect(()=>()=>window.clearTimeout(M.current),[]),_H();const W=S.useCallback(A=>{var q,Q;return R.current===((q=O.current)==null?void 0:q.side)&&qz(A,(Q=O.current)==null?void 0:Q.area)},[]);return g.jsx(Iz,{scope:n,searchRef:I,onItemEnter:S.useCallback(A=>{W(A)&&A.preventDefault()},[W]),onItemLeave:S.useCallback(A=>{var Z;W(A)||((Z=E.current)==null||Z.focus(),D(null))},[W]),onTriggerLeave:S.useCallback(A=>{W(A)&&A.preventDefault()},[W]),pointerGraceTimerRef:k,onPointerGraceIntentChange:S.useCallback(A=>{O.current=A},[]),children:g.jsx(L,{...V,children:g.jsx(N7,{asChild:!0,trapped:o,onMountAutoFocus:xe(i,A=>{var Z;A.preventDefault(),(Z=E.current)==null||Z.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:g.jsx(xa,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:h,onDismiss:p,children:g.jsx(sz,{asChild:!0,...x,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:w,onCurrentTabStopIdChange:D,onEntryFocus:xe(l,A=>{y.isUsingKeyboardRef.current||A.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(WH,{role:"menu","aria-orientation":"vertical","data-state":kC(v.open),"data-radix-menu-content":"",dir:y.dir,...$,...b,ref:_,style:{outline:"none",...b.style},onKeyDown:xe(b.onKeyDown,A=>{const q=A.target.closest("[data-radix-menu-content]")===A.currentTarget,Q=A.ctrlKey||A.altKey||A.metaKey,K=A.key.length===1;q&&(A.key==="Tab"&&A.preventDefault(),!Q&&K&&N(A.key));const ne=E.current;if(A.target!==ne||!_z.includes(A.key))return;A.preventDefault();const ae=C().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);iC.includes(A.key)&&ae.reverse(),Wz(ae)}),onBlur:xe(t.onBlur,A=>{A.currentTarget.contains(A.target)||(window.clearTimeout(M.current),I.current="")}),onPointerMove:xe(t.onPointerMove,va(A=>{const Z=A.target,q=T.current!==A.clientX;if(A.currentTarget.contains(Z)&&q){const Q=A.clientX>T.current?"right":"left";R.current=Q,T.current=A.clientX}}))})})})})})})});uC.displayName=Et;var Lz="MenuGroup",pp=S.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return g.jsx(bt.div,{role:"group",...r,ref:e})});pp.displayName=Lz;var Oz="MenuLabel",fC=S.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return g.jsx(bt.div,{...r,ref:e})});fC.displayName=Oz;var Vl="MenuItem",Z0="menu.itemSelect",Ec=S.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...o}=t,i=S.useRef(null),a=za(Vl,t.__scopeMenu),s=fp(Vl,t.__scopeMenu),l=kt(e,i),c=S.useRef(!1),d=()=>{const u=i.current;if(!n&&u){const h=new CustomEvent(Z0,{bubbles:!0,cancelable:!0});u.addEventListener(Z0,p=>r==null?void 0:r(p),{once:!0}),CH(u,h),h.defaultPrevented?c.current=!1:a.onClose()}};return g.jsx(hC,{...o,ref:l,disabled:n,onClick:xe(t.onClick,d),onPointerDown:u=>{var h;(h=t.onPointerDown)==null||h.call(t,u),c.current=!0},onPointerUp:xe(t.onPointerUp,u=>{var h;c.current||(h=u.currentTarget)==null||h.click()}),onKeyDown:xe(t.onKeyDown,u=>{const h=s.searchRef.current!=="";n||h&&u.key===" "||_f.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});Ec.displayName=Vl;var hC=S.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=t,a=fp(Vl,n),s=sC(n),l=S.useRef(null),c=kt(e,l),[d,u]=S.useState(!1),[h,p]=S.useState("");return S.useEffect(()=>{const m=l.current;m&&p((m.textContent??"").trim())},[i.children]),g.jsx(ba.ItemSlot,{scope:n,disabled:r,textValue:o??h,children:g.jsx(lz,{asChild:!0,...s,focusable:!r,children:g.jsx(bt.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:xe(t.onPointerMove,va(m=>{r?a.onItemLeave(m):(a.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:xe(t.onPointerLeave,va(m=>a.onItemLeave(m))),onFocus:xe(t.onFocus,()=>u(!0)),onBlur:xe(t.onBlur,()=>u(!1))})})})}),Vz="MenuCheckboxItem",pC=S.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...o}=t;return g.jsx(yC,{scope:t.__scopeMenu,checked:n,children:g.jsx(Ec,{role:"menuitemcheckbox","aria-checked":Fl(n)?"mixed":n,...o,ref:e,"data-state":gp(n),onSelect:xe(o.onSelect,()=>r==null?void 0:r(Fl(n)?!0:!n),{checkForDefaultPrevented:!1})})})});pC.displayName=Vz;var mC="MenuRadioGroup",[Fz,jz]=so(mC,{value:void 0,onValueChange:()=>{}}),gC=S.forwardRef((t,e)=>{const{value:n,onValueChange:r,...o}=t,i=fr(r);return g.jsx(Fz,{scope:t.__scopeMenu,value:n,onValueChange:i,children:g.jsx(pp,{...o,ref:e})})});gC.displayName=mC;var bC="MenuRadioItem",vC=S.forwardRef((t,e)=>{const{value:n,...r}=t,o=jz(bC,t.__scopeMenu),i=n===o.value;return g.jsx(yC,{scope:t.__scopeMenu,checked:i,children:g.jsx(Ec,{role:"menuitemradio","aria-checked":i,...r,ref:e,"data-state":gp(i),onSelect:xe(r.onSelect,()=>{var a;return(a=o.onValueChange)==null?void 0:a.call(o,n)},{checkForDefaultPrevented:!1})})})});vC.displayName=bC;var mp="MenuItemIndicator",[yC,Bz]=so(mp,{checked:!1}),$C=S.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...o}=t,i=Bz(mp,n);return g.jsx(Ba,{present:r||Fl(i.checked)||i.checked===!0,children:g.jsx(bt.span,{...o,ref:e,"data-state":gp(i.checked)})})});$C.displayName=mp;var Hz="MenuSeparator",xC=S.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return g.jsx(bt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});xC.displayName=Hz;var zz="MenuArrow",CC=S.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=Sc(n);return g.jsx(ZH,{...o,...r,ref:e})});CC.displayName=zz;var Kz="MenuSub",[AQ,wC]=so(Kz),Vi="MenuSubTrigger",_C=S.forwardRef((t,e)=>{const n=lo(Vi,t.__scopeMenu),r=za(Vi,t.__scopeMenu),o=wC(Vi,t.__scopeMenu),i=fp(Vi,t.__scopeMenu),a=S.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=i,c={__scopeMenu:t.__scopeMenu},d=S.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return S.useEffect(()=>d,[d]),S.useEffect(()=>{const u=s.current;return()=>{window.clearTimeout(u),l(null)}},[s,l]),g.jsx(dp,{asChild:!0,...c,children:g.jsx(hC,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":kC(n.open),...t,ref:Cc(e,o.onTriggerChange),onClick:u=>{var h;(h=t.onClick)==null||h.call(t,u),!(t.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:xe(t.onPointerMove,va(u=>{i.onItemEnter(u),!u.defaultPrevented&&!t.disabled&&!n.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:xe(t.onPointerLeave,va(u=>{var p,m;d();const h=(p=n.content)==null?void 0:p.getBoundingClientRect();if(h){const b=(m=n.content)==null?void 0:m.dataset.side,v=b==="right",y=v?-5:5,$=h[v?"left":"right"],x=h[v?"right":"left"];i.onPointerGraceIntentChange({area:[{x:u.clientX+y,y:u.clientY},{x:$,y:h.top},{x,y:h.top},{x,y:h.bottom},{x:$,y:h.bottom}],side:b}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(u),u.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:xe(t.onKeyDown,u=>{var p;const h=i.searchRef.current!=="";t.disabled||h&&u.key===" "||Sz[r.dir].includes(u.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),u.preventDefault())})})})});_C.displayName=Vi;var SC="MenuSubContent",EC=S.forwardRef((t,e)=>{const n=cC(Et,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,i=lo(Et,t.__scopeMenu),a=za(Et,t.__scopeMenu),s=wC(SC,t.__scopeMenu),l=S.useRef(null),c=kt(e,l);return g.jsx(ba.Provider,{scope:t.__scopeMenu,children:g.jsx(Ba,{present:r||i.open,children:g.jsx(ba.Slot,{scope:t.__scopeMenu,children:g.jsx(hp,{id:s.contentId,"aria-labelledby":s.triggerId,...o,ref:c,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var u;a.isUsingKeyboardRef.current&&((u=l.current)==null||u.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:xe(t.onFocusOutside,d=>{d.target!==s.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:xe(t.onEscapeKeyDown,d=>{a.onClose(),d.preventDefault()}),onKeyDown:xe(t.onKeyDown,d=>{var p;const u=d.currentTarget.contains(d.target),h=Ez[a.dir].includes(d.key);u&&h&&(i.onOpenChange(!1),(p=s.trigger)==null||p.focus(),d.preventDefault())})})})})})});EC.displayName=SC;function kC(t){return t?"open":"closed"}function Fl(t){return t==="indeterminate"}function gp(t){return Fl(t)?"indeterminate":t?"checked":"unchecked"}function Wz(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function Zz(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function Uz(t,e,n){const o=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let a=Zz(t,Math.max(i,0));o.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Gz(t,e){const{x:n,y:r}=t;let o=!1;for(let i=0,a=e.length-1;i<e.length;a=i++){const s=e[i].x,l=e[i].y,c=e[a].x,d=e[a].y;l>r!=d>r&&n<(c-s)*(r-l)/(d-l)+s&&(o=!o)}return o}function qz(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return Gz(n,e)}function va(t){return e=>e.pointerType==="mouse"?t(e):void 0}var Yz=lC,Jz=dp,Xz=dC,Qz=uC,eK=pp,tK=fC,nK=Ec,rK=pC,oK=gC,iK=vC,aK=$C,sK=xC,lK=CC,cK=_C,dK=EC,bp="DropdownMenu",[uK,LQ]=ja(bp,[aC]),nt=aC(),[fK,DC]=uK(bp),PC=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:a,modal:s=!0}=t,l=nt(e),c=S.useRef(null),[d=!1,u]=T7({prop:o,defaultProp:i,onChange:a});return g.jsx(fK,{scope:e,triggerId:xf(),triggerRef:c,contentId:xf(),open:d,onOpenChange:u,onOpenToggle:S.useCallback(()=>u(h=>!h),[u]),modal:s,children:g.jsx(Yz,{...l,open:d,onOpenChange:u,dir:r,modal:s,children:n})})};PC.displayName=bp;var MC="DropdownMenuTrigger",TC=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=t,i=DC(MC,n),a=nt(n);return g.jsx(Jz,{asChild:!0,...a,children:g.jsx(bt.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Cc(e,i.triggerRef),onPointerDown:xe(t.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(i.onOpenToggle(),i.open||s.preventDefault())}),onKeyDown:xe(t.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&i.onOpenToggle(),s.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});TC.displayName=MC;var hK="DropdownMenuPortal",RC=t=>{const{__scopeDropdownMenu:e,...n}=t,r=nt(e);return g.jsx(Xz,{...r,...n})};RC.displayName=hK;var IC="DropdownMenuContent",NC=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=DC(IC,n),i=nt(n),a=S.useRef(!1);return g.jsx(Qz,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:e,onCloseAutoFocus:xe(t.onCloseAutoFocus,s=>{var l;a.current||(l=o.triggerRef.current)==null||l.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:xe(t.onInteractOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;(!o.modal||d)&&(a.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});NC.displayName=IC;var pK="DropdownMenuGroup",mK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=nt(n);return g.jsx(eK,{...o,...r,ref:e})});mK.displayName=pK;var gK="DropdownMenuLabel",AC=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=nt(n);return g.jsx(tK,{...o,...r,ref:e})});AC.displayName=gK;var bK="DropdownMenuItem",LC=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=nt(n);return g.jsx(nK,{...o,...r,ref:e})});LC.displayName=bK;var vK="DropdownMenuCheckboxItem",yK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=nt(n);return g.jsx(rK,{...o,...r,ref:e})});yK.displayName=vK;var $K="DropdownMenuRadioGroup",xK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=nt(n);return g.jsx(oK,{...o,...r,ref:e})});xK.displayName=$K;var CK="DropdownMenuRadioItem",wK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=nt(n);return g.jsx(iK,{...o,...r,ref:e})});wK.displayName=CK;var _K="DropdownMenuItemIndicator",SK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=nt(n);return g.jsx(aK,{...o,...r,ref:e})});SK.displayName=_K;var EK="DropdownMenuSeparator",kK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=nt(n);return g.jsx(sK,{...o,...r,ref:e})});kK.displayName=EK;var DK="DropdownMenuArrow",PK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=nt(n);return g.jsx(lK,{...o,...r,ref:e})});PK.displayName=DK;var MK="DropdownMenuSubTrigger",TK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=nt(n);return g.jsx(cK,{...o,...r,ref:e})});TK.displayName=MK;var RK="DropdownMenuSubContent",IK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=nt(n);return g.jsx(dK,{...o,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});IK.displayName=RK;var NK=PC,AK=TC,LK=RC,OK=NC,VK=AC,U0=LC;const FK="_content_1pz2s_1",jK="_border_1pz2s_13",BK="_itemIcon_1pz2s_38",HK="_item_1pz2s_38 _variant-small_17xe9_37 _base_17xe9_8",zK="_itemText_1pz2s_85",KK="_label_1pz2s_99 _variant-small_17xe9_37 _base_17xe9_8",nn={content:FK,border:jK,"content-height-256":"_content-height-256_1pz2s_20","content-height-400":"_content-height-400_1pz2s_25","content-width-128":"_content-width-128_1pz2s_30","content-width-256":"_content-width-256_1pz2s_34",itemIcon:BK,item:HK,itemText:zK,"item-color-grey":"_item-color-grey_1pz2s_91","item-color-tomato":"_item-color-tomato_1pz2s_95",label:KK};function vp(t){const{open:e,onOpenChange:n,modal:r=!1,children:o}=t;return g.jsx(NK,{modal:r,open:e,onOpenChange:n,children:o})}function yp(t){const e=On(),{disabled:n=e==null?void 0:e.disabled,children:r,...o}=t;return g.jsx(AK,{...o,asChild:!0,disabled:n,children:r})}function $p(t){const{minWidth:e=128,maxHeight:n,asPortal:r=!0,avoidCollisions:o,collisionPadding:i=0,children:a,align:s,side:l,border:c=!0,childrenFocusScope:d=!1,...u}=t,h=g.jsx(Hl,{asChild:!0,loop:!0,trapped:!0,children:a}),p=g.jsx(OK,{...u,className:z(nn.content,nn[`content-width-${e}`],n&&nn[`content-height-${n}`],c&&nn.border),sideOffset:parseFloat(De.space[4]),avoidCollisions:o,collisionPadding:i,align:s,side:l,children:d?h:a});return r?g.jsx(LK,{children:p}):p}function WK(t){const{children:e,endIcon:n,shortcut:r,startIcon:o,disabled:i,color:a="grey",description:s,onMouseOverChange:l,onSelect:c,textValue:d,renderTooltip:u=v=>v,...h}=t,p={disabled:i,...h,onSelect:c,textValue:d,onMouseEnter:l&&(()=>l(!0)),onMouseLeave:l&&(()=>l(!1))},m=f.isValidElement(o)?f.cloneElement(o,{className:z(o.props.className,nn.itemIcon)}):null,b=f.isValidElement(n)?f.cloneElement(n,{className:z(n.props.className,nn.itemIcon)}):null;return s?g.jsx(g.Fragment,{children:u(g.jsx(U0,{...p,asChild:!0,children:g.jsx(_g,{color:a,description:s,disabled:i,endAdornment:r&&g.jsx(J,{color:"inherit",component:"kbd",variant:"inherit",children:r}),renderStartIcon:m?()=>m:void 0,renderEndIcon:b?()=>b:void 0,children:e})}))}):g.jsx(g.Fragment,{children:u(g.jsxs(U0,{...p,className:z(nn.item,nn[`item-color-${a}`]),children:[m,g.jsx("span",{className:nn.itemText,children:g.jsx(J,{component:"span",color:ZK[a],children:e})}),b,r?g.jsx(J,{color:"inherit",component:"kbd",children:r}):null]}))})}function OC({children:t}){return g.jsx(VK,{className:nn.label,children:g.jsx(J,{component:"span",children:t})})}const ZK={grey:"grey12",tomato:"tomato11"},UK="_root_18b8b_1",GK="_input_18b8b_5",G0={root:UK,input:GK};function qK(t){const{"aria-label":e,onChange:n,color:r="grey12",variant:o="normal",...i}=t,a=z(G0.input,Mt[`variant-${o}`]);return g.jsx("div",{className:G0.root,children:g.jsx("input",{...i,"aria-label":e,className:a,style:{color:De.color[r]},onChange:s=>n==null?void 0:n(s.currentTarget.value),inputMode:"text"})})}function YK(t){const{title:e,description:n,errorImageSrc:r,sx:o}=t,i=f.useContext(Hr.ErrorBoundaryContext);return g.jsxs(I2,{style:o,children:[r&&g.jsx(L2,{children:g.jsx("img",{src:r,alt:"Error"})}),g.jsx(N2,{size:"big",children:e}),g.jsx(A2,{children:n}),g.jsx(O2,{children:g.jsx(Se,{onClick:i==null?void 0:i.reset,children:"Try again"})})]})}let q0=()=>!1;class JK extends f.Component{constructor(n){super(n);qa(this,"registerRequest",(n,r)=>{var a;const o=Hr.argsKey(n,r),i=this.state.requests;i.has(n)||i.set(n,new Map),(a=i.get(n))==null||a.set(o,r)});qa(this,"reset",()=>{this.state.requests.forEach((n,r)=>{n.forEach(o=>Hr.cache.clear(r,o))}),this.setState({error:void 0,handleError:void 0,requests:new Map})});qa(this,"renderChildren",()=>{const{children:n,renderError:r=()=>null}=this.props,{error:o,handleError:i}=this.state;return o?i?r(o,this.reset):null:n});this.state={requests:new Map}}static registerGlobalErrorInterceptor(n){q0=n}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n){const r=!q0(n,this.reset);this.setState({error:n,handleError:r}),setTimeout(()=>{var o,i;return(i=(o=this.props).onError)==null?void 0:i.call(o,n)})}render(){return g.jsx(XK,{reset:this.reset,registerRequest:this.registerRequest,children:this.renderChildren()})}}function XK(t){const{children:e,reset:n,registerRequest:r}=t,o=f.useMemo(()=>({reset:n,registerRequest:r}),[n,r]);return g.jsx(Hr.ErrorBoundaryContext.Provider,{value:o,children:e})}const QK=f.forwardRef((t,e)=>f.createElement(Ae.label,F({},t,{ref:e,onMouseDown:n=>{var r;(r=t.onMouseDown)===null||r===void 0||r.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault()}}))),eW=QK,tW="_root_kv4z5_1",nW="_selected_kv4z5_13",rW="_children_kv4z5_19",oW="_top_kv4z5_23",iW="_side_kv4z5_27",aW="_icon_kv4z5_31",sW="_label_kv4z5_45",lW="_control_kv4z5_65",cW="_footer_kv4z5_84",dW="_disabled_kv4z5_90",sn={root:tW,selected:nW,children:rW,top:oW,side:iW,icon:aW,label:sW,control:lW,footer:cW,disabled:dW},uW=f.forwardRef(function(e,n){const{children:r,labelPosition:o="top",onMouseOverChange:i,footer:a,selected:s,...l}=e;return g.jsxs("div",{className:z(sn.root,s&&sn.selected),children:[g.jsx("div",{...l,className:z(sn.children,sn[o]),ref:n,onMouseEnter:i&&(()=>i(!0)),onMouseLeave:i&&(()=>i(!1)),children:g.jsx(VC.Provider,{value:{labelPosition:o},children:r})}),a]})});function fW(t){const{name:e,disabled:n}=t;return g.jsx("div",{className:z(sn.icon,n&&sn.disabled),children:g.jsx(le,{name:e,size:"small",color:"grey11"})})}function hW(t){const{children:e,...n}=t,{labelPosition:r}=gW(),o=r==="top"?"extraSmall":"normal";return g.jsx(eW,{...n,className:sn.label,children:g.jsx(J,{color:"grey11",component:"span",variant:o,children:e})})}function pW(t){const{children:e,disabled:n}=t;return g.jsx("div",{className:z(sn.control,n&&sn.disabled),children:e})}function mW(t){const{children:e}=t;return g.jsx("div",{className:sn.footer,children:e})}const VC=f.createContext(void 0);function gW(){const t=f.useContext(VC);if(!t)throw new Error("FieldContext is mandatory.");return t}const bW="_fieldSet_1ama6_1",vW="_fieldSetContent_1ama6_17",yW="_legend_1ama6_33",Ps={fieldSet:bW,fieldSetContent:vW,"border-normal":"_border-normal_1ama6_24","border-selected":"_border-selected_1ama6_28",legend:yW};function $W(t){const{selected:e,children:n,legend:r,id:o,name:i,onFocus:a,header:s}=t;return g.jsxs("fieldset",{className:z(Ps.fieldSet,Ps[`border-${e?"selected":"normal"}`]),id:o,name:i,onFocus:a,children:[g.jsxs("header",{className:Ps.legend,children:[g.jsx(J,{component:"span",variant:"smallBold",children:r}),s]}),g.jsx("div",{className:Ps.fieldSetContent,children:n})]})}const xW="_root_x856h_1",CW="_dropTarget_x856h_7",wW="_dropzone_x856h_12",_W="_overlay_x856h_19",SW="_overlayContainer_x856h_25",EW="_fadeIn_x856h_1",_i={root:xW,dropTarget:CW,dropzone:wW,overlay:_W,overlayContainer:SW,fadeIn:EW},Sf={applicationAll:"application/*",imageAll:"image/*",videoAll:"video/*",audioAll:"audio/*",csv:"text/csv",txt:"text/plain"};function Y0(t,e){return e==="image"?t.startsWith(J0(Sf.imageAll)):Object.values(Sf).some(n=>t.startsWith(J0(n)))}function J0(t){return t.endsWith("/*")?t.slice(0,-1):t}function kW(t){const{onFilesSelected:e,overlay:n,children:r,assetType:o="all"}=t,[i,a]=f.useState(!1);function s(h){return h.dataTransfer.items?o==="all"?!0:[...h.dataTransfer.items].every(m=>Y0(m.type,o)):!1}function l(h){h.preventDefault();const p=s(h);a(p)}function c(h){h.preventDefault();const p=s(h);a(p)}function d(h){h.preventDefault(),a(!1)}async function u(h){h.preventDefault();const p=s(h);if(!h.dataTransfer.items||!p)return;const m=[...h.dataTransfer.items].filter(v=>v.kind==="file"&&(o==="all"?!0:Y0(v.type,o))),b=(await Promise.all(m.map(v=>v.getAsFile()))).filter(If.isDefined);a(!1),e(b)}return g.jsxs("div",{className:z(_i.root,i&&_i.dropTarget),children:[g.jsx("div",{"aria-label":"dropzone",onDragEnter:l,onDragLeave:d,onDragOver:c,onDrop:u,className:_i.dropzone,children:r}),i&&g.jsx("div",{className:_i.overlayContainer,children:g.jsx("div",{className:_i.overlay,children:n})})]})}function DW(t){const{onFilesSelected:e,disabled:n,assetType:r="all",renderButton:o,...i}=t,a=f.useRef(null),s=r==="all"?"*":[Sf.imageAll].toString();function l(){var d;(d=a.current)==null||d.click()}function c(d){const u=d.target.files,h=Array.from(u??[]);d.currentTarget.value="",e(h)}return g.jsxs(g.Fragment,{children:[g.jsx("input",{ref:a,type:"file",onChange:c,disabled:n,accept:s,multiple:!0,style:{display:"none"}}),o?o(l):g.jsx(Se,{disabled:n,...i,onClick:l})]})}const PW="_skeleton_1rejs_1",MW="_pulse_1rejs_1",TW="_hasChildren_1rejs_6",Ms={skeleton:PW,pulse:MW,hasChildren:TW,"color-grey1":"_color-grey1_1rejs_15","color-grey5":"_color-grey5_1rejs_18","radius-0":"_radius-0_1rejs_22","radius-4":"_radius-4_1rejs_25","radius-6":"_radius-6_1rejs_28","radius-12":"_radius-12_1rejs_31","radius-100%":"_radius-100%_1rejs_34"};function ya(t){const{height:e,component:n="span",width:r,color:o="grey5",borderRadius:i=6,children:a,sx:s}=t;return f.createElement(n,{className:z(Ms.skeleton,a&&Ms.hasChildren,Ms[`radius-${i}`],Ms[`color-${o}`]),style:{...s,width:r,height:e}},a)}const RW="_filterField_7g88y_1",IW="_inputContainer_7g88y_23",NW="_labelContainer_7g88y_30",AW="_tagsContainer_7g88y_37",LW="_input_7g88y_23 _variant-normal_17xe9_12 _base_17xe9_8",OW="_footerWrapper_7g88y_60",VW="_footer_7g88y_60",FW="_optionsContainer_7g88y_83",Tt={filterField:RW,"shadow-open":"_shadow-open_7g88y_9","shadow-closed":"_shadow-closed_7g88y_18",inputContainer:IW,labelContainer:NW,tagsContainer:AW,input:LW,footerWrapper:OW,footer:VW,optionsContainer:FW};function jW(t){const{selectedValues:e,onSelectedValuesChange:n,setOpen:r,fieldRef:o,fixedSelectedValues:i}=t,[a,s]=f.useState(""),l=i.size>0;function c(p){return n(p===-1?jt.slice(e,0,e.size-1):jt.filter(e,m=>m.id!==p.id))}function d(){a===""&&c(-1)}f.useEffect(()=>{function p(m){if(l)return;const b=ge.refContainsTarget(o,m.target);r(b),b||s("")}return document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}},[r,o,l]);function u(p){p.code==="Escape"&&(r(!1),s(""))}function h(){return l?"":e.size+i.size===0?"Empty":"Type something..."}return{deleteItemFromValue:c,onBackspace:d,onKeyDown:u,searchText:a,setSearchText:s,isFieldLocked:l,inputPlaceholder:h()}}function BW(t){const{open:e,setOpen:n,label:r,icon:o,selectedValues:i,fixedSelectedValues:a=new Set,onSelectedValuesChange:s,...l}=t,c=f.useRef(null),{deleteItemFromValue:d,onBackspace:u,onKeyDown:h,setSearchText:p,searchText:m,isFieldLocked:b,inputPlaceholder:v}=jW({fieldRef:c,onSelectedValuesChange:s,selectedValues:i,setOpen:n,fixedSelectedValues:a});return g.jsxs("div",{role:"button",className:z(Tt.filterField,Tt[`shadow-${e?"open":"closed"}`]),ref:c,onKeyDown:h,tabIndex:0,children:[g.jsxs("div",{className:Tt.inputContainer,children:[g.jsxs("div",{className:Tt.labelContainer,children:[g.jsx(le,{name:o,size:"medium",color:"grey11"}),g.jsx(J,{variant:"emphasized",color:"grey11",children:r})]}),g.jsxs("div",{className:Tt.tagsContainer,children:[jt.map(a,y=>g.jsx(ht,{title:y.label,maxWidth:150,size:"medium",selected:!0,icon:"lock"},y.id)),jt.map(i,y=>g.jsx(ht,{title:y.label,color:"purple",maxWidth:150,size:"medium",onClose:()=>d(y),selected:!0},y.id)),g.jsx("input",{className:Tt.input,style:{color:De.color[e?"grey12":"grey11"],cursor:De.cursor[b?"notAllowed":"text"]},disabled:b,inputMode:"text",onFocus:()=>n(!0),placeholder:v,onKeyDown:y=>{y.key==="Backspace"&&u()},value:m,onChange:y=>p(y.currentTarget.value)})]})]}),e&&g.jsx("div",{className:Tt.footerWrapper,children:g.jsx(zW,{label:r,onSelectedValuesChange:s,searchText:m,fixedSelectedValues:a,selectedValues:i,...l})})]})}function HW(t,e,n){function r(i){return!jt.some(e,a=>a.id===i.id)}function o(i,a){return i.label.toLowerCase().includes(a.toLowerCase())}return jt.filter(t,i=>r(i)&&o(i,n))}function zW(t){const{label:e,searchText:n,values:r,selectedValues:o,fixedSelectedValues:i=new Set,onSelectedValuesChange:a,mode:s,onErrorRetry:l,multiple:c=!0}=t;function d(u){if(!(!c&&o.size>0))return a(jt.add(o,u))}return s==="loading"?g.jsx(KW,{}):s==="error"?g.jsx(WW,{label:e,onErrorRetry:l}):g.jsxs("div",{className:Tt.footer,children:[g.jsxs(J,{color:"grey11",variant:"emphasized",children:["Choose ",e]}),g.jsx("div",{className:Tt.optionsContainer,children:jt.map(HW(r,new Set([...o,...i]),n),u=>g.jsx(ht,{title:u.label,onClick:()=>d(u),size:"medium",maxWidth:150},u.id))})]})}function KW(){return g.jsxs("div",{className:Tt.footer,children:[g.jsx(ya,{height:24,width:80,borderRadius:6}),g.jsx(ya,{height:24,width:60,borderRadius:6})]})}function WW(t){const{label:e,onErrorRetry:n}=t;return g.jsx("div",{className:Tt.footer,children:g.jsxs(ve,{justifyContent:"space-between",children:[g.jsxs(ve,{gap:8,children:[g.jsx(le,{name:"alert",size:"large",color:"tomato11"}),g.jsxs(J,{color:"tomato11",children:["Failed to load ",e]})]}),n&&g.jsx(Se,{endIcon:"refresh",color:"tomato",onClick:n,invisible:!0,children:"Retry"})]})})}const ZW="_root_1lytw_1",UW={root:ZW};function GW(t){const{sx:e}=t;return g.jsx("div",{className:UW.root,style:e})}const FC=f.createContext({itemsCount:0}),qW=({itemsCount:t,children:e})=>{const n=f.useMemo(()=>({itemsCount:t}),[t]);return g.jsx(FC.Provider,{value:n,children:e})},YW=()=>f.useContext(FC),JW="_group_6hhnw_1",XW="_header_6hhnw_19",QW="_footer_6hhnw_34",Ts={group:JW,"border-default":"_border-default_6hhnw_11","border-dragging":"_border-dragging_6hhnw_14",header:XW,footer:QW};function eZ(t){const{title:e,items:n,getItemKey:r,addItemButtonTitle:o,maxItems:i=Number.MAX_SAFE_INTEGER,children:a,dnd:s,onAddItem:l}=t,[c,d]=f.useState(!1),u=n.length<i;return g.jsx(qW,{itemsCount:n.length,children:g.jsxs("article",{className:z(Ts.group,Ts[`border-${c?"dragging":"default"}`]),children:[g.jsx("header",{className:Ts.header,children:g.jsxs(J,{component:"span",variant:"smallBold",children:[e," ",g.jsxs(J,{variant:"normal",color:"grey11",children:["• ",n.length]})]})}),g.jsx(jf,{ariaLabel:"Group",items:n,getItemKey:r,dnd:{...s,onDragChange:d},children:a}),g.jsx("footer",{className:Ts.footer,children:u&&g.jsx(Se,{size:"large",color:"grey",startIcon:"add",onClick:l,children:o})})]})})}const tZ="_groupItem_1nchh_1",nZ="_header_1nchh_10",rZ="_headerIcon_1nchh_24",oZ="_content_1nchh_31",Rs={groupItem:tZ,header:nZ,headerIcon:rZ,content:oZ};function iZ(t){const{index:e=0,title:n,onMove:r,onDelete:o,children:i}=t,{itemsCount:a}=YW(),s=a>1;return g.jsxs("article",{className:Rs.groupItem,children:[g.jsxs("header",{className:Rs.header,draggable:s,children:[g.jsx(le,{className:Rs.headerIcon,name:"viewDay"}),g.jsx(J,{color:"grey11",variant:"small",component:"span",children:n}),g.jsxs(cn,{sx:{marginLeft:"auto"},size:"small",color:"grey",children:[s&&g.jsxs(cn,{density:"compact",children:[g.jsx(Se,{disabled:e===0,startIcon:"arrowUpward",onClick:()=>r==null?void 0:r({index:e,offset:-1})}),g.jsx(Se,{disabled:e===a-1,startIcon:"arrowDownward",onClick:()=>r==null?void 0:r({index:e,offset:1})})]}),g.jsx(Se,{startIcon:"delete",onClick:()=>o==null?void 0:o({index:e})}),s&&g.jsx(le,{name:"dragIndicator",color:"grey8",size:"small",sx:{alignSelf:"center"}})]})]}),g.jsx("section",{className:Rs.content,children:i})]})}const aZ="_hairlineButton_1vvsn_1",sZ="_line_1vvsn_32",lZ="_firstLine_1vvsn_39",cZ="_secondLine_1vvsn_44",dZ="_icon_1vvsn_58",uZ="_iconChildren_1vvsn_80",Yt={hairlineButton:aZ,"root-mode-normal":"_root-mode-normal_1vvsn_24","root-mode-drop":"_root-mode-drop_1vvsn_28",line:sZ,firstLine:lZ,secondLine:cZ,"line-mode-normal":"_line-mode-normal_1vvsn_49","line-mode-drop":"_line-mode-drop_1vvsn_53",icon:dZ,"icon-mode-normal":"_icon-mode-normal_1vvsn_70","icon-mode-drop":"_icon-mode-drop_1vvsn_75",iconChildren:uZ},fZ=f.forwardRef(function(e,n){const{icon:r,dropMode:o,disabled:i=!1,sx:a,...s}=e,l=o?"drop":"normal";return g.jsxs("button",{...s,className:z(Yt.hairlineButton,Yt[`root-mode-${l}`]),style:a,disabled:i,ref:n,children:[g.jsx("div",{className:z(Yt.line,Yt.firstLine,Yt[`line-mode-${l}`])}),g.jsx("div",{className:z(Yt.icon,Yt[`icon-mode-${l}`]),children:g.jsx(le,{name:r,size:"large",color:"grey2"})}),g.jsx("div",{className:z(Yt.line,Yt.secondLine,Yt[`line-mode-${l}`])})]})}),hZ="_root_10pxe_1",pZ="_disabled_10pxe_13",mZ="_selected_10pxe_37",Wd={root:hZ,disabled:pZ,selected:mZ};function gZ(t){const{text:e,selected:n,disabled:r=!1,renderLink:o}=t;return g.jsx("div",{className:z(Wd.root,r&&Wd.disabled,n&&Wd.selected),children:o(g.jsx(J,{component:"span",variant:"emphasized",noSelect:!0,color:"grey11",children:e}))})}function bZ(t){const{children:e,heightEstimate:n=200,keepLoaded:r=!1,gap:o}=t,i=f.useRef(null),a=vZ({ref:i,keepLoaded:r});return yZ({ref:i,show:a}),g.jsx(ve,{ref:i,flexDirection:"column",height:a?"auto":n,gap:o,children:a&&e})}function vZ(t){const{ref:e,keepLoaded:n}=t,r=ge.useInView(e,{once:n}),[o,i]=f.useState(r);return f.useLayoutEffect(()=>{if(r)return i(!0);if(!e.current||n)return;let a;const s=Ft.getScrollableAncestor(e.current);let l=s.scrollTop;function c(){a=window.setTimeout(()=>{if(e.current&&!Ft.isElementInView(e.current)){if(l==s.scrollTop)return i(!1);l=s.scrollTop,c()}},2e3)}return c(),()=>clearTimeout(a)},[r,e,n]),o}function yZ(t){const{ref:e,show:n}=t,[r,o]=f.useState({previousHeight:0});ge.useOnChange(n,()=>{var a;const i=(a=e.current)==null?void 0:a.clientHeight;i&&o({previousHeight:i})}),f.useLayoutEffect(()=>{if(r.previousHeight===0||!e.current)return;const i=Ft.getScrollableAncestor(e.current);if(!i||Ft.getOffsetTopRelativeTo(e.current,i)>=i.scrollTop)return;const l=e.current.clientHeight-r.previousHeight;i.scrollTop+=l},[r,e])}const $Z="_line_uonvi_1",xZ="_grey_uonvi_14",CZ="_green_uonvi_18",wZ="_amber_uonvi_22",_Z="_purple_uonvi_26",Zd={line:$Z,"thickness-2":"_thickness-2_uonvi_7","thickness-4":"_thickness-4_uonvi_10",grey:xZ,green:CZ,amber:wZ,purple:_Z};function SZ(t){const{color:e,role:n="status",thickness:r=4,sx:o}=t;return g.jsx("div",{role:n,className:z(Zd.line,Zd[e],Zd[`thickness-${r}`]),style:o})}const EZ="_circledIcon_e58lf_1",kZ="_header_e58lf_14",jC={circledIcon:EZ,header:kZ};function DZ(t){const{description:e,onEdit:n,largeIconName:r="public",onUnlink:o,loading:i,error:a}=t,s=a?g.jsx(IZ,{}):g.jsx(RZ,{...t,largeIconName:r,loading:i});return g.jsxs(ve,{flexDirection:"column",backgroundColor:"grey1",borderRadius:6,boxShadow:"3",border:!0,width:420,padding:16,gap:16,children:[g.jsxs("div",{className:jC.header,children:[s,g.jsxs(cn,{size:"medium",color:"grey",sx:{justifySelf:"end"},children:[n&&g.jsx(Se,{startIcon:"edit",onClick:n}),o&&g.jsx(Se,{startIcon:"linkOff",onClick:o})]})]}),!a&&g.jsx(TZ,{description:e,loading:i})]})}function PZ(t){const{url:e,title:n,loading:r}=t;return r?g.jsx(BC,{height:16,width:80}):n?g.jsx(J,{variant:"smallBold",href:e.toString(),children:n}):null}function MZ(t){const{subTitle:e,loading:n}=t;return n?g.jsx(ve,{padding:{block:2},children:g.jsx(BC,{height:12,width:60})}):e?g.jsx(J,{variant:"small",color:"grey11",noWrap:!0,children:e}):null}function TZ(t){const{description:e,loading:n}=t;return!e||n?null:g.jsx(J,{variant:"small",color:"grey11",children:e})}function RZ(t){const{largeIconName:e,title:n,url:r,loading:o,subTitle:i}=t;return g.jsxs(g.Fragment,{children:[g.jsx(Nh,{largeIconName:e,smallIconName:"link"}),g.jsxs(ve,{flexDirection:"column",minWidth:0,children:[g.jsx(PZ,{title:n,url:r,loading:o}),g.jsx(MZ,{subTitle:i,loading:o})]})]})}function IZ(){return g.jsxs(ve,{alignItems:"center",gap:8,children:[g.jsx("div",{className:jC.circledIcon,children:g.jsx(le,{name:"alert",color:"tomato11",size:"medium"})}),g.jsx(J,{color:"tomato11",children:"Failed to load linked document data"})]})}function BC(t){const{width:e,height:n}=t;return g.jsx(ya,{color:"grey5",borderRadius:6,width:e,height:n})}function NZ(t){const{onEdit:e,onUnlink:n,url:r,title:o,subTitle:i}=t;return g.jsx(LZ,{children:g.jsxs(ve,{flexDirection:"column",justifyContent:"space-between",gap:8,children:[g.jsx(OZ,{url:r,title:o,subTitle:i,onEdit:e,onUnlink:n}),r&&g.jsx(V2,{sx:{width:"100%"},children:g.jsx(ql,{children:g.jsx(AZ,{children:g.jsx(wa,{src:r,alt:o,sizing:"contain"})})})})]})})}function AZ(t){const{children:e}=t;return g.jsx(ve,{flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",height:327,children:e})}function LZ(t){const{children:e}=t;return g.jsx(ve,{flexDirection:"column",backgroundColor:"grey1",borderRadius:6,boxShadow:"3",border:!0,width:433,padding:16,gap:16,children:e})}function OZ(t){const{url:e,title:n,subTitle:r,onEdit:o,onUnlink:i}=t;return g.jsxs(ve,{flexDirection:"row",justifyContent:"space-between",gap:8,children:[g.jsxs(ve,{gap:8,minWidth:0,children:[g.jsx(Nh,{largeIconName:"image",smallIconName:"link"}),g.jsxs(ve,{flexDirection:"column",minWidth:0,children:[g.jsx(J,{noWrap:!0,variant:"smallBold",href:e,inline:!0,children:n}),g.jsx(J,{variant:"small",color:"grey11",children:r})]})]}),g.jsxs(cn,{size:"medium",color:"grey",children:[o&&g.jsx(VZ,{onEdit:o}),i&&g.jsx(FZ,{onUnlink:i})]})]})}function VZ(t){const{onEdit:e}=t;return g.jsx(ao,{content:"Edit link",side:"top",stableMount:!0,zIndexHack:!0,children:g.jsx(Se,{startIcon:"edit",onClick:e})})}function FZ(t){const{onUnlink:e}=t;return g.jsx(ao,{content:"Remove link",side:"top",stableMount:!0,zIndexHack:!0,children:g.jsx(Se,{startIcon:"linkOff",onClick:e})})}const jZ="_list_qiiqm_1",BZ="_item_qiiqm_6",HC={list:jZ,item:BZ};function HZ(t){const{children:e,sx:n}=t;return g.jsx("ul",{className:HC.list,style:n,children:e})}function zZ(t){const{children:e}=t;return g.jsx("li",{className:HC.item,children:g.jsx(J,{component:"span",children:e})})}const Ud="data:image/svg+xml,%3csvg%20width='48'%20height='60'%20viewBox='0%200%2048%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0.5%208C0.5%203.85786%203.85786%200.5%208%200.5H33.5931C34.5214%200.5%2035.4116%200.868749%2036.068%201.52513L46.4749%2011.932C47.1313%2012.5884%2047.5%2013.4786%2047.5%2014.4069V52C47.5%2056.1421%2044.1421%2059.5%2040%2059.5H8C3.85787%2059.5%200.5%2056.1421%200.5%2052V8Z'%20fill='%23F5F2FF'%20stroke='%23AA99EC'/%3e%3cpath%20d='M47.5%2012.913L47.5%2013L40.5%2013C37.4624%2013%2035%2010.5376%2035%207.5L35%200.500001L35.087%200.500001L47.5%2012.913Z'%20fill='%23D7CFF9'%20stroke='%23AA99EC'/%3e%3cpath%20d='M21%2039C19.9%2039%2018.9583%2038.6083%2018.175%2037.825C17.3917%2037.0417%2017%2036.1%2017%2035C17%2033.9%2017.3917%2032.9583%2018.175%2032.175C18.9583%2031.3917%2019.9%2031%2021%2031C21.3833%2031%2021.7375%2031.0458%2022.0625%2031.1375C22.3875%2031.2292%2022.7%2031.3667%2023%2031.55V21H29V25H25V35C25%2036.1%2024.6083%2037.0417%2023.825%2037.825C23.0417%2038.6083%2022.1%2039%2021%2039Z'%20fill='%235746AF'/%3e%3c/svg%3e",Fi="data:image/svg+xml,%3csvg%20width='48'%20height='60'%20viewBox='0%200%2048%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0.5%208C0.5%203.85786%203.85786%200.5%208%200.5H33.5931C34.5214%200.5%2035.4116%200.868749%2036.068%201.52513L46.4749%2011.932C47.1313%2012.5884%2047.5%2013.4786%2047.5%2014.4069V52C47.5%2056.1421%2044.1421%2059.5%2040%2059.5H8C3.85787%2059.5%200.5%2056.1421%200.5%2052V8Z'%20fill='%23F5F2FF'%20stroke='%23AA99EC'/%3e%3cpath%20d='M47.5%2012.913L47.5%2013L40.5%2013C37.4624%2013%2035%2010.5376%2035%207.5L35%200.500001L35.087%200.500001L47.5%2012.913Z'%20fill='%23D7CFF9'%20stroke='%23AA99EC'/%3e%3cpath%20d='M30%2033.75C30%2035.4833%2029.3917%2036.9583%2028.175%2038.175C26.9583%2039.3917%2025.4833%2040%2023.75%2040C22.0167%2040%2020.5417%2039.3917%2019.325%2038.175C18.1083%2036.9583%2017.5%2035.4833%2017.5%2033.75V24.5C17.5%2023.25%2017.9375%2022.1875%2018.8125%2021.3125C19.6875%2020.4375%2020.75%2020%2022%2020C23.25%2020%2024.3125%2020.4375%2025.1875%2021.3125C26.0625%2022.1875%2026.5%2023.25%2026.5%2024.5V33.25C26.5%2034.0167%2026.2333%2034.6667%2025.7%2035.2C25.1667%2035.7333%2024.5167%2036%2023.75%2036C22.9833%2036%2022.3333%2035.7333%2021.8%2035.2C21.2667%2034.6667%2021%2034.0167%2021%2033.25V24H23V33.25C23%2033.4667%2023.0708%2033.6458%2023.2125%2033.7875C23.3542%2033.9292%2023.5333%2034%2023.75%2034C23.9667%2034%2024.1458%2033.9292%2024.2875%2033.7875C24.4292%2033.6458%2024.5%2033.4667%2024.5%2033.25V24.5C24.4833%2023.8%2024.2375%2023.2083%2023.7625%2022.725C23.2875%2022.2417%2022.7%2022%2022%2022C21.3%2022%2020.7083%2022.2417%2020.225%2022.725C19.7417%2023.2083%2019.5%2023.8%2019.5%2024.5V33.75C19.4833%2034.9333%2019.8917%2035.9375%2020.725%2036.7625C21.5583%2037.5875%2022.5667%2038%2023.75%2038C24.9167%2038%2025.9083%2037.5875%2026.725%2036.7625C27.5417%2035.9375%2027.9667%2034.9333%2028%2033.75V24H30V33.75Z'%20fill='%235746AF'/%3e%3c/svg%3e",Si="data:image/svg+xml,%3csvg%20width='48'%20height='60'%20viewBox='0%200%2048%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0.5%208C0.5%203.85786%203.85786%200.5%208%200.5H33.5931C34.5214%200.5%2035.4116%200.868749%2036.068%201.52513L46.4749%2011.932C47.1313%2012.5884%2047.5%2013.4786%2047.5%2014.4069V52C47.5%2056.1421%2044.1421%2059.5%2040%2059.5H8C3.85787%2059.5%200.5%2056.1421%200.5%2052V8Z'%20fill='%23F5F2FF'%20stroke='%23AA99EC'/%3e%3cpath%20d='M16%2022L18%2026H21L19%2022H21L23%2026H26L24%2022H26L28%2026H31L29%2022H32C32.55%2022%2033.0208%2022.1958%2033.4125%2022.5875C33.8042%2022.9792%2034%2023.45%2034%2024V36C34%2036.55%2033.8042%2037.0208%2033.4125%2037.4125C33.0208%2037.8042%2032.55%2038%2032%2038H16C15.45%2038%2014.9792%2037.8042%2014.5875%2037.4125C14.1958%2037.0208%2014%2036.55%2014%2036V24C14%2023.45%2014.1958%2022.9792%2014.5875%2022.5875C14.9792%2022.1958%2015.45%2022%2016%2022ZM16%2028V36H32V28H16Z'%20fill='%235746AF'/%3e%3cpath%20d='M47.5%2012.913L47.5%2013L40.5%2013C37.4624%2013%2035%2010.5376%2035%207.5L35%200.500001L35.087%200.500001L47.5%2012.913Z'%20fill='%23D7CFF9'%20stroke='%23AA99EC'/%3e%3c/svg%3e",KZ="_root_18g44_1",WZ="_progress_18g44_8",ZZ="_indicator_18g44_21",Is={root:KZ,progress:WZ,indicator:ZZ,"indicator-idle":"_indicator-idle_18g44_31","indicator-uploading":"_indicator-uploading_18g44_35","indicator-success":"_indicator-success_18g44_41","indicator-error":"_indicator-error_18g44_46"},X0={idle:0,uploading:90,success:100,error:100};function zC(t){const{status:e}=t;return g.jsx("div",{className:Is.root,children:g.jsx(Fg,{className:Is.progress,value:X0[e],children:g.jsx(jg,{className:z(Is.indicator,Is[`indicator-${e}`]),style:{transform:`translateX(-${100-X0[e]}%)`}})})})}const UZ="_overflowContainer_1fq3x_1",GZ="_overflowItem_1fq3x_8",qZ="_invisibleItemContainer_1fq3x_18",YZ="_invisibleAdornmentContainer_1fq3x_26";const KC=f.createContext({numberOfVisibleItems:0});function WC(t){const{children:e,gap:n=8}=t,{numberOfVisibleItems:r,invisibleItemsContainerRef:o,adornmentsContainerRef:i,items:a,adornments:s}=JZ(e,n),l=r<a.length,c=a.slice(0,r),d=f.useMemo(()=>({numberOfVisibleItems:r}),[r]);return g.jsx("div",{style:{"--OverflowContainer-gap":De.space[n]},className:UZ,children:g.jsxs(KC.Provider,{value:d,children:[g.jsx("div",{ref:o,"aria-hidden":!0,className:qZ,children:a}),g.jsx("div",{ref:i,"aria-hidden":!0,className:YZ,children:s}),g.jsxs(ve,{overflow:"hidden",width:"100%",children:[c,l&&s]})]})})}function xp(t){const{children:e}=t;return g.jsx("div",{className:GZ,children:e})}function Cp(t){const{adornment:e}=t,{numberOfVisibleItems:n}=f.useContext(KC);return g.jsx(ve,{flexShrink:0,children:e({numberOfVisibleItems:n})})}function JZ(t,e){const n=f.Children.toArray(t),r=n.filter(d=>ge.isComponentOfType(d,xp)),o=n.filter(d=>ge.isComponentOfType(d,Cp)),i=f.useRef(null),a=f.useRef(null),[s,l]=f.useState(r.length),c=ge.useStableCallback(()=>{const d=i.current;if(!d)throw new Error("invisible items container ref not assigned");const u=a.current;if(!u)throw new Error("adornment container ref not assigned");let h=d.clientWidth;const p=Array.from(d.children).map(v=>v.clientWidth),m=u.clientWidth;let b=0;for(const[v,y]of p.entries()){if(h-=y,b=v+1,h>=0&&v===p.length-1)break;if(h<=0){for(m>0?h-=m:v!==p.length-1&&(h+=e);h<0&&b!==0;)h+=p[b-1]||0,b--;break}}s!==b&&l(b)});return f.useLayoutEffect(()=>{const d=i.current;if(!d)throw new Error("invisible items container ref not assigned");const u=new ResizeObserver(c);return u.observe(d),()=>{u.unobserve(d),u.disconnect()}},[c]),f.useLayoutEffect(c,[f.Children.count(t),c]),{numberOfVisibleItems:s,items:r,adornments:o,invisibleItemsContainerRef:i,adornmentsContainerRef:a}}const XZ="_root_s98m8_1",QZ="_checkboxWrapper_s98m8_27",eU="_textContainer_s98m8_46",tU="_selected_s98m8_50",Ef={root:XZ,checkboxWrapper:QZ,textContainer:eU,selected:tU},Q0=186,nU={pdf:Fi,csv:Fi,txt:Fi,application:Fi,mp4:Si,mov:Si,avi:Si,mkv:Si,video:Si,mp3:Ud,wav:Ud,audio:Ud};function rU(t){const{["aria-label"]:e,url:n,filename:r,filenameHighlight:o,selected:i=!1,loading:a=!1,status:s="idle",extension:l,tags:c,onAddTag:d,width:u,height:h,size:p,kind:m,alt:b,onCheckedChange:v,onCardClick:y,onAddTagClick:$}=t;function x(){return l==="pdf"&&p?`${p}kb`:u&&h?`${u}x${h}`:""}function C(E){a||y==null||y(E)}function w(E){(E.code==="Enter"||E.code==="Space")&&(E.preventDefault(),C(E))}const D=o??r;return g.jsxs(ve,{"aria-label":e,children:[g.jsxs("div",{role:"button",tabIndex:0,onKeyDown:w,onClick:C,className:z(Ef.root,i&&Ef.selected),children:[g.jsx(ve,{flexDirection:"column",width:"100%",children:g.jsx(oU,{extension:l,url:n,filename:r,loading:a,kind:m,alt:b})}),g.jsxs(ve,{flexDirection:"column",width:"100%",alignItems:"flex-start",opacity:a?.3:1,children:[g.jsx(e7,{content:D,contentVersion:D,decorations:{em:"highlight",p:"emphasized"},readOnly:!0}),g.jsx(J,{variant:"small",color:"grey11",sx:{height:16},children:x()}),g.jsx(zC,{status:s}),g.jsxs(ve,{width:"100%",alignItems:"center",gap:8,children:[g.jsx(aU,{extension:l}),$&&!(c!=null&&c.length)&&g.jsx(ht,{title:"Add a tag",color:"purple",size:"medium",icon:"add",onClick:E=>{E==null||E.stopPropagation(),!(a||s==="error"||s==="uploading")&&$()}}),g.jsx(iU,{tags:c,onAddTag:d})]})]})]}),g.jsx(sU,{checked:i,onCheckedChange:v,disabled:a})]})}function oU(t){const{extension:e,url:n,filename:r,loading:o,kind:i,alt:a}=t,s=i!=null&&i.startsWith("image")?void 0:UC(e),l=o?.3:1;return s?g.jsx(ve,{width:"100%",height:Q0,backgroundColor:"purple2",justifyContent:"center",alignItems:"center",opacity:l,children:g.jsx(ZC,{extension:e,filename:r})}):g.jsx(ql,{children:g.jsx(ve,{flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",height:Q0,width:"100%",opacity:l,children:g.jsx(wa,{src:n,alt:a||r,sizing:"contain"})})})}function ZC(t){const{extension:e,filename:n}=t,r=UC(e);return g.jsx("img",{src:r,alt:n})}function UC(t){var e;return t?(e=Object.entries(nU).find(([n])=>t.startsWith(n)))==null?void 0:e[1]:Fi}function iU(t){const{tags:e,onAddTag:n}=t;function r(a){a==null||a.stopPropagation(),n==null||n()}const o=15,i=!e||e.length===0;return!n&&i?null:i?g.jsx(ht,{title:"Add a tag +",color:"purple",onClick:r}):g.jsxs(WC,{children:[e.slice(0,o).map(({name:a,id:s})=>g.jsx(xp,{children:g.jsx(ht,{title:a,color:"purple",size:"medium"})},s)),g.jsx(Cp,{adornment:({numberOfVisibleItems:a})=>g.jsx(ht,{title:`+${e.length-a}`,color:"purple",size:"medium"})})]})}function aU(t){const{extension:e}=t;return e?g.jsx(ht,{size:"medium",title:(e==null?void 0:e.toUpperCase())??"",selected:!0}):null}function sU(t){const{checked:e,disabled:n,onCheckedChange:r}=t;function o(a){n||r==null||r(!e,a)}function i(a){(a.code==="Enter"||a.code==="Space")&&(a.preventDefault(),o(a))}return g.jsx(ao,{content:e?"Unselect":"Select",delayDuration:500,children:g.jsx("div",{role:"presentation",className:Ef.checkboxWrapper,onClick:o,onKeyDown:i,children:g.jsx(W2,{onCheckedChange:r,checked:e,onClick:a=>a.stopPropagation(),disabled:n})})})}function lU(t){const{max:e,min:n,onValueChange:r,value:o,...i}=t,[a,s]=f.useState(),l=String(a??o??"");function c(u){uU(u)&&s(u)}function d(){if(a===void 0)return;if(s(void 0),a==="")return r==null?void 0:r(void 0);const u=Number(a.replace(",","."));if(Number.isNaN(u))return;const h=bg.clamp(u,{min:n,max:e});h!==o&&(r==null||r(h))}return g.jsx(Ia,{...i,endAdornment:g.jsx(cU,{min:n,max:e}),inputMode:"decimal",onBlur:d,onValueChange:c,value:l})}function cU(t){const{min:e,max:n}=t;if(e===void 0&&n===void 0)return null;const r=[e!==void 0?`Min: ${e}`:"",n!==void 0?`Max: ${n}`:""].filter(If.isDefined).join(" ");return g.jsx(ht,{title:r,maxWidth:150})}const dU=/^[-+]?[0-9]*[.,]?[0-9]*$/;function uU(t){return dU.test(t)}function fU(t){return g.jsx(dS,{...t})}const hU="_radioItem_1hyjm_1",pU="_radioBigCard_wlj7j_3",mU="_iconContainer_wlj7j_32",gU="_texts_wlj7j_46",bU="_title_wlj7j_52",Ns={radioItem:hU,radioBigCard:pU,iconContainer:mU,texts:gU,title:bU},vU="_root_inbrr_1",yU={root:vU};function $U(t){const{values:e,selectedValue:n,disabled:r=!1,evenItemSize:o=!1,sx:i,renderItem:a,onChange:s}=t;return g.jsx(P7,{className:yU.root,style:i,disabled:r,value:n,onValueChange:s,children:e.map(l=>g.jsx(GC.Provider,{value:{value:l,isSelected:l===n,evenItemSize:o},children:a(l)},l))})}const GC=f.createContext(void 0);function qC(){const t=f.useContext(GC);if(!t)throw new Error("useRadioItem must be used within a RadioGroup");return t}const xU="_radioItem_1hyjm_1",CU="_evenSize_1hyjm_5",eg={radioItem:xU,evenSize:CU};function wp(t){const{disabled:e,children:n}=t,{value:r,evenItemSize:o}=qC();return g.jsx(M7,{value:r,disabled:e,className:z(eg.radioItem,o&&eg.evenSize),children:n})}function wU(t){const{icon:e,title:n,badge:r,description:o,disabled:i=!1}=t,{isSelected:a}=qC();return g.jsx(wp,{disabled:i,children:g.jsxs("div",{className:Ns.radioBigCard,children:[g.jsx("div",{className:Ns.iconContainer,children:g.jsx(le,{name:e,size:"large",color:a?"purple9":"grey9"})}),g.jsxs("div",{className:Ns.texts,children:[g.jsxs("div",{className:Ns.title,children:[g.jsx(J,{variant:"h4",color:a?"purple12":"grey12",children:n}),r&&g.jsx(ht,{size:"medium",color:"green",icon:r.icon,title:r.title})]}),g.jsx(J,{variant:"normal",color:a?"purple12":"grey11",children:o})]})]})})}const _U="_radioItem_1hyjm_1",SU="_root_3e6j3_3",EU="_root_194ix_4",kU="_circle_194ix_18",DU="_indicator_194ix_52",Gd={radioItem:_U,radioCard:SU,root:EU,circle:kU,indicator:DU};function YC(t){const{label:e,disabled:n=!1,decorative:r=!1}=t;function o(i){return r?i:g.jsx(wp,{disabled:n,children:i})}return o(g.jsxs("div",{className:Gd.root,children:[g.jsx("div",{className:Gd.circle,children:g.jsx(XB,{className:Gd.indicator})}),e&&g.jsx(J,{children:e})]}))}const PU="_radioItem_1hyjm_1",MU="_root_3e6j3_3",TU={radioItem:PU,root:MU};function RU(t){const{title:e,disabled:n=!1}=t;return g.jsx(wp,{disabled:n,children:g.jsxs("div",{className:TU.root,children:[g.jsx(YC,{decorative:!0}),g.jsx(J,{variant:"h4",children:e})]})})}const IU="_root_e1s96_1",NU="_horizontal_e1s96_33",AU="_spacing_e1s96_37",LU="_vertical_e1s96_43",OU="_content_e1s96_54",VU="_gradient_e1s96_66",Yn={root:IU,horizontal:NU,spacing:AU,vertical:LU,content:OU,gradient:VU},As=De.size.scrollbar;function FU(t){const e=t==="vertical";return{icon:{start:e?"expandLess":"chevronLeft",end:e?"expandMore":"chevronRight"},placement:{start:{top:0,left:0,right:e?As:void 0,bottom:e?void 0:As},end:{bottom:e?0:As,right:e?As:0,top:e?void 0:0,left:e?0:void 0}},clientSize:e?"clientHeight":"clientWidth",scrollSize:e?"scrollHeight":"scrollWidth",scrollPosition:e?"scrollTop":"scrollLeft"}}function jU(t){const{children:e,scrollAreaRef:n,direction:r="vertical"}=t,{clientSize:o,scrollPosition:i,scrollSize:a,icon:s,placement:l}=FU(r),[c,d]=f.useState(!1),[u,h]=f.useState(!1),p=f.useRef(!1);function m($){p.current=$}f.useEffect(()=>{if(!n.current)return;const $=n.current,x=$[a]>$[o],C=$[i]>=$[a]-$[o];h(x&&!C);const w=$[i]>0;d(w)},[n,e,o,i,a]);function b($){p.current&&(v($),requestAnimationFrame(()=>b($)))}function v($){if(!n.current)return;const x=n.current,C=2;switch($){case"start":x[i]-=C;break;case"end":x[i]+=C;break}}function y($){const x=$.currentTarget.children[0];if(!x)return;const C=x[i],w=C>0,D=C>=x[a]-x[o];d(w),h(!D),(!w||D)&&m(!1)}return g.jsxs(ve,{overflow:"hidden",position:"relative",width:"100%",flexDirection:r==="vertical"?"row":"column",children:[g.jsx("div",{onScrollCapture:y,style:{width:"100%",overflowX:"auto"},children:e}),g.jsx(fu,{animation:{name:"fade"},children:c&&g.jsx(ve,{position:"absolute",backgroundColor:"grey2",alignItems:"center",...l.start,children:g.jsx("div",{className:Yn.gradient,children:g.jsx(mt,{icon:s.start,onMouseDown:()=>{m(!0),b("start")},onMouseUp:()=>m(!1)})})})}),g.jsx(fu,{animation:{name:"fade"},children:u&&g.jsx(ve,{position:"absolute",backgroundColor:"grey2",alignItems:"center",...l.end,children:g.jsx("div",{className:Yn.gradient,children:g.jsx(mt,{icon:s.end,onMouseDown:()=>{m(!0),b("end")},onMouseUp:()=>m(!1)})})})})]})}const JC=f.forwardRef(function(e,n){const{["aria-label"]:r,children:o,direction:i="vertical",onScrollToBottom:a,controls:s=!1,threshold:l,className:c,style:d}=e,[u,h]=f.useState(!1),p=f.useRef(null),{width:m,height:b}=BU();function v($){if(!a)return;const x=Ft.isScrolledToBottom($.currentTarget,l);if(u!==x)return x&&a(),h(x)}const y=g.jsx("div",{"aria-label":r,ref:ge.composeRefs(n,p),onScroll:v,className:z(Yn.root,Yn[i],(m===0||b===0)&&Yn.spacing,c),children:g.jsx("div",{className:z(Yn.content,Yn[i]),style:d,children:o})});return s?g.jsx(jU,{scrollAreaRef:p,direction:i,children:y}):y});function BU(){var s;const t=f.useRef(!1),e=f.useRef(0),n=f.useRef(0);if(t.current)return{width:e.current,height:n.current};const r=document.createElement("div");r.classList.add(Yn.root),r.style.visibility="hidden",r.style.overflow="scroll",document.body.appendChild(r);const o=document.createElement("div");r.appendChild(o);const i=r.offsetWidth-o.offsetWidth,a=r.offsetHeight-o.offsetHeight;return(s=r.parentNode)==null||s.removeChild(r),t.current=!0,e.current=i,n.current=a,{width:i,height:a}}function tg(t,[e,n]){return Math.min(n,Math.max(e,t))}function XC(t){const e=t+"CollectionProvider",[n,r]=hn(e),[o,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:m,children:b}=p,v=f.useRef(null),y=f.useRef(new Map).current;return f.createElement(o,{scope:m,itemMap:y,collectionRef:v},b)},s=t+"CollectionSlot",l=f.forwardRef((p,m)=>{const{scope:b,children:v}=p,y=i(s,b),$=Ee(m,y.collectionRef);return f.createElement(zr,{ref:$},v)}),c=t+"CollectionItemSlot",d="data-radix-collection-item",u=f.forwardRef((p,m)=>{const{scope:b,children:v,...y}=p,$=f.useRef(null),x=Ee(m,$),C=i(c,b);return f.useEffect(()=>(C.itemMap.set($,{ref:$,...y}),()=>void C.itemMap.delete($))),f.createElement(zr,{[d]:"",ref:x},v)});function h(p){const m=i(t+"CollectionConsumer",p);return f.useCallback(()=>{const v=m.collectionRef.current;if(!v)return[];const y=Array.from(v.querySelectorAll(`[${d}]`));return Array.from(m.itemMap.values()).sort((C,w)=>y.indexOf(C.ref.current)-y.indexOf(w.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:a,Slot:l,ItemSlot:u},h,r]}const HU=f.createContext(void 0);function _p(t){const e=f.useContext(HU);return t||e||"ltr"}const zU=[" ","Enter","ArrowUp","ArrowDown"],KU=[" ","Enter"],kc="Select",[Dc,Pc,WU]=XC(kc),[fi,OQ]=hn(kc,[WU,li]),Sp=li(),[ZU,co]=fi(kc),[UU,GU]=fi(kc),qU=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:o,onOpenChange:i,value:a,defaultValue:s,onValueChange:l,dir:c,name:d,autoComplete:u,disabled:h,required:p}=t,m=Sp(e),[b,v]=f.useState(null),[y,$]=f.useState(null),[x,C]=f.useState(!1),w=_p(c),[D=!1,E]=dr({prop:r,defaultProp:o,onChange:i}),[_,M]=dr({prop:a,defaultProp:s,onChange:l}),I=f.useRef(null),k=b?!!b.closest("form"):!0,[O,R]=f.useState(new Set),T=Array.from(O).map(L=>L.props.value).join(";");return f.createElement(Wf,m,f.createElement(ZU,{required:p,scope:e,trigger:b,onTriggerChange:v,valueNode:y,onValueNodeChange:$,valueNodeHasChildren:x,onValueNodeHasChildrenChange:C,contentId:Pn(),value:_,onValueChange:M,open:D,onOpenChange:E,dir:w,triggerPointerDownPosRef:I,disabled:h},f.createElement(Dc.Provider,{scope:e},f.createElement(UU,{scope:t.__scopeSelect,onNativeOptionAdd:f.useCallback(L=>{R(V=>new Set(V).add(L))},[]),onNativeOptionRemove:f.useCallback(L=>{R(V=>{const N=new Set(V);return N.delete(L),N})},[])},n)),k?f.createElement(r4,{key:T,"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:u,value:_,onChange:L=>M(L.target.value),disabled:h},_===void 0?f.createElement("option",{value:""}):null,Array.from(O)):null))},YU="SelectTrigger",JU=f.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...o}=t,i=Sp(n),a=co(YU,n),s=a.disabled||r,l=Ee(e,a.onTriggerChange),c=Pc(n),[d,u,h]=o4(m=>{const b=c().filter($=>!$.disabled),v=b.find($=>$.value===a.value),y=i4(b,m,v);y!==void 0&&a.onValueChange(y.value)}),p=()=>{s||(a.onOpenChange(!0),h())};return f.createElement(Zf,F({asChild:!0},i),f.createElement(ye.button,F({type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":n4(a.value)?"":void 0},o,{ref:l,onClick:oe(o.onClick,m=>{m.currentTarget.focus()}),onPointerDown:oe(o.onPointerDown,m=>{const b=m.target;b.hasPointerCapture(m.pointerId)&&b.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&(p(),a.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)},m.preventDefault())}),onKeyDown:oe(o.onKeyDown,m=>{const b=d.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&u(m.key),!(b&&m.key===" ")&&zU.includes(m.key)&&(p(),m.preventDefault())})})))}),XU="SelectValue",QU=f.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:a="",...s}=t,l=co(XU,n),{onValueNodeHasChildrenChange:c}=l,d=i!==void 0,u=Ee(e,l.onValueNodeChange);return qe(()=>{c(d)},[c,d]),f.createElement(ye.span,F({},s,{ref:u,style:{pointerEvents:"none"}}),n4(l.value)?f.createElement(f.Fragment,null,a):i)}),eG=f.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...o}=t;return f.createElement(ye.span,F({"aria-hidden":!0},o,{ref:e}),r||"▼")}),tG=t=>f.createElement(Ca,F({asChild:!0},t)),ai="SelectContent",nG=f.forwardRef((t,e)=>{const n=co(ai,t.__scopeSelect),[r,o]=f.useState();if(qe(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Ut.createPortal(f.createElement(QC,{scope:t.__scopeSelect},f.createElement(Dc.Slot,{scope:t.__scopeSelect},f.createElement("div",null,t.children))),i):null}return f.createElement(rG,F({},t,{ref:e}))}),Sn=10,[QC,uo]=fi(ai),rG=f.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:a,side:s,sideOffset:l,align:c,alignOffset:d,arrowPadding:u,collisionBoundary:h,collisionPadding:p,sticky:m,hideWhenDetached:b,avoidCollisions:v,...y}=t,$=co(ai,n),[x,C]=f.useState(null),[w,D]=f.useState(null),E=Ee(e,Y=>C(Y)),[_,M]=f.useState(null),[I,k]=f.useState(null),O=Pc(n),[R,T]=f.useState(!1),L=f.useRef(!1);f.useEffect(()=>{if(x)return Wl(x)},[x]),Bf();const V=f.useCallback(Y=>{const[re,...se]=O().map(j=>j.ref.current),[ie]=se.slice(-1),de=document.activeElement;for(const j of Y)if(j===de||(j==null||j.scrollIntoView({block:"nearest"}),j===re&&w&&(w.scrollTop=0),j===ie&&w&&(w.scrollTop=w.scrollHeight),j==null||j.focus(),document.activeElement!==de))return},[O,w]),N=f.useCallback(()=>V([_,x]),[V,_,x]);f.useEffect(()=>{R&&N()},[R,N]);const{onOpenChange:W,triggerPointerDownPosRef:A}=$;f.useEffect(()=>{if(x){let Y={x:0,y:0};const re=ie=>{var de,j,ue,Ce;Y={x:Math.abs(Math.round(ie.pageX)-((de=(j=A.current)===null||j===void 0?void 0:j.x)!==null&&de!==void 0?de:0)),y:Math.abs(Math.round(ie.pageY)-((ue=(Ce=A.current)===null||Ce===void 0?void 0:Ce.y)!==null&&ue!==void 0?ue:0))}},se=ie=>{Y.x<=10&&Y.y<=10?ie.preventDefault():x.contains(ie.target)||W(!1),document.removeEventListener("pointermove",re),A.current=null};return A.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",se,{capture:!0})}}},[x,W,A]),f.useEffect(()=>{const Y=()=>W(!1);return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[W]);const[Z,q]=o4(Y=>{const re=O().filter(de=>!de.disabled),se=re.find(de=>de.ref.current===document.activeElement),ie=i4(re,Y,se);ie&&setTimeout(()=>ie.ref.current.focus())}),Q=f.useCallback((Y,re,se)=>{const ie=!L.current&&!se;($.value!==void 0&&$.value===re||ie)&&(M(Y),ie&&(L.current=!0))},[$.value]),K=f.useCallback(()=>x==null?void 0:x.focus(),[x]),ne=f.useCallback((Y,re,se)=>{const ie=!L.current&&!se;($.value!==void 0&&$.value===re||ie)&&k(Y)},[$.value]),ce=r==="popper"?ng:oG,ae=ce===ng?{side:s,sideOffset:l,align:c,alignOffset:d,arrowPadding:u,collisionBoundary:h,collisionPadding:p,sticky:m,hideWhenDetached:b,avoidCollisions:v}:{};return f.createElement(QC,{scope:n,content:x,viewport:w,onViewportChange:D,itemRefCallback:Q,selectedItem:_,onItemLeave:K,itemTextRefCallback:ne,focusSelectedItem:N,selectedItemText:I,position:r,isPositioned:R,searchRef:Z},f.createElement(Qf,{as:zr,allowPinchZoom:!0},f.createElement(Hl,{asChild:!0,trapped:$.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:oe(o,Y=>{var re;(re=$.trigger)===null||re===void 0||re.focus({preventScroll:!0}),Y.preventDefault()})},f.createElement(xa,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>$.onOpenChange(!1)},f.createElement(ce,F({role:"listbox",id:$.contentId,"data-state":$.open?"open":"closed",dir:$.dir,onContextMenu:Y=>Y.preventDefault()},y,ae,{onPlaced:()=>T(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:oe(y.onKeyDown,Y=>{const re=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!re&&Y.key.length===1&&q(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let ie=O().filter(de=>!de.disabled).map(de=>de.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const de=Y.target,j=ie.indexOf(de);ie=ie.slice(j+1)}setTimeout(()=>V(ie)),Y.preventDefault()}})}))))))}),oG=f.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...o}=t,i=co(ai,n),a=uo(ai,n),[s,l]=f.useState(null),[c,d]=f.useState(null),u=Ee(e,E=>d(E)),h=Pc(n),p=f.useRef(!1),m=f.useRef(!0),{viewport:b,selectedItem:v,selectedItemText:y,focusSelectedItem:$}=a,x=f.useCallback(()=>{if(i.trigger&&i.valueNode&&s&&c&&b&&v&&y){const E=i.trigger.getBoundingClientRect(),_=c.getBoundingClientRect(),M=i.valueNode.getBoundingClientRect(),I=y.getBoundingClientRect();if(i.dir!=="rtl"){const de=I.left-_.left,j=M.left-de,ue=E.left-j,Ce=E.width+ue,ke=Math.max(Ce,_.width),Le=window.innerWidth-Sn,rt=tg(j,[Sn,Le-ke]);s.style.minWidth=Ce+"px",s.style.left=rt+"px"}else{const de=_.right-I.right,j=window.innerWidth-M.right-de,ue=window.innerWidth-E.right-j,Ce=E.width+ue,ke=Math.max(Ce,_.width),Le=window.innerWidth-Sn,rt=tg(j,[Sn,Le-ke]);s.style.minWidth=Ce+"px",s.style.right=rt+"px"}const k=h(),O=window.innerHeight-Sn*2,R=b.scrollHeight,T=window.getComputedStyle(c),L=parseInt(T.borderTopWidth,10),V=parseInt(T.paddingTop,10),N=parseInt(T.borderBottomWidth,10),W=parseInt(T.paddingBottom,10),A=L+V+R+W+N,Z=Math.min(v.offsetHeight*5,A),q=window.getComputedStyle(b),Q=parseInt(q.paddingTop,10),K=parseInt(q.paddingBottom,10),ne=E.top+E.height/2-Sn,ce=O-ne,ae=v.offsetHeight/2,Y=v.offsetTop+ae,re=L+V+Y,se=A-re;if(re<=ne){const de=v===k[k.length-1].ref.current;s.style.bottom="0px";const j=c.clientHeight-b.offsetTop-b.offsetHeight,ue=Math.max(ce,ae+(de?K:0)+j+N),Ce=re+ue;s.style.height=Ce+"px"}else{const de=v===k[0].ref.current;s.style.top="0px";const ue=Math.max(ne,L+b.offsetTop+(de?Q:0)+ae)+se;s.style.height=ue+"px",b.scrollTop=re-ne+b.offsetTop}s.style.margin=`${Sn}px 0`,s.style.minHeight=Z+"px",s.style.maxHeight=O+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[h,i.trigger,i.valueNode,s,c,b,v,y,i.dir,r]);qe(()=>x(),[x]);const[C,w]=f.useState();qe(()=>{c&&w(window.getComputedStyle(c).zIndex)},[c]);const D=f.useCallback(E=>{E&&m.current===!0&&(x(),$==null||$(),m.current=!1)},[x,$]);return f.createElement(iG,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:D},f.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C}},f.createElement(ye.div,F({},o,{ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}}))))}),ng=f.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Sn,...i}=t,a=Sp(n);return f.createElement(Uf,F({},a,i,{ref:e,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.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)"}}))}),[iG,Ep]=fi(ai,{}),rg="SelectViewport",aG=f.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=uo(rg,n),i=Ep(rg,n),a=Ee(e,o.onViewportChange),s=f.useRef(0);return f.createElement(f.Fragment,null,f.createElement("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}"}}),f.createElement(Dc.Slot,{scope:n},f.createElement(ye.div,F({"data-radix-select-viewport":"",role:"presentation"},r,{ref:a,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:oe(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:u}=i;if(u!=null&&u.current&&d){const h=Math.abs(s.current-c.scrollTop);if(h>0){const p=window.innerHeight-Sn*2,m=parseFloat(d.style.minHeight),b=parseFloat(d.style.height),v=Math.max(m,b);if(v<p){const y=v+h,$=Math.min(p,y),x=y-$;d.style.height=$+"px",d.style.bottom==="0px"&&(c.scrollTop=x>0?x:0,d.style.justifyContent="flex-end")}}}s.current=c.scrollTop})}))))}),sG="SelectGroup";fi(sG);const kf="SelectItem",[lG,e4]=fi(kf),cG=f.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...a}=t,s=co(kf,n),l=uo(kf,n),c=s.value===r,[d,u]=f.useState(i??""),[h,p]=f.useState(!1),m=Ee(e,y=>{var $;return($=l.itemRefCallback)===null||$===void 0?void 0:$.call(l,y,r,o)}),b=Pn(),v=()=>{o||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return f.createElement(lG,{scope:n,value:r,disabled:o,textId:b,isSelected:c,onItemTextChange:f.useCallback(y=>{u($=>{var x;return $||((x=y==null?void 0:y.textContent)!==null&&x!==void 0?x:"").trim()})},[])},f.createElement(Dc.ItemSlot,{scope:n,value:r,disabled:o,textValue:d},f.createElement(ye.div,F({role:"option","aria-labelledby":b,"data-highlighted":h?"":void 0,"aria-selected":c&&h,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1},a,{ref:m,onFocus:oe(a.onFocus,()=>p(!0)),onBlur:oe(a.onBlur,()=>p(!1)),onPointerUp:oe(a.onPointerUp,v),onPointerMove:oe(a.onPointerMove,y=>{if(o){var $;($=l.onItemLeave)===null||$===void 0||$.call(l)}else y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:oe(a.onPointerLeave,y=>{if(y.currentTarget===document.activeElement){var $;($=l.onItemLeave)===null||$===void 0||$.call(l)}}),onKeyDown:oe(a.onKeyDown,y=>{var $;(($=l.searchRef)===null||$===void 0?void 0:$.current)!==""&&y.key===" "||(KU.includes(y.key)&&v(),y.key===" "&&y.preventDefault())})}))))}),Ls="SelectItemText",dG=f.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:o,...i}=t,a=co(Ls,n),s=uo(Ls,n),l=e4(Ls,n),c=GU(Ls,n),[d,u]=f.useState(null),h=Ee(e,y=>u(y),l.onItemTextChange,y=>{var $;return($=s.itemTextRefCallback)===null||$===void 0?void 0:$.call(s,y,l.value,l.disabled)}),p=d==null?void 0:d.textContent,m=f.useMemo(()=>f.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},p),[l.disabled,l.value,p]),{onNativeOptionAdd:b,onNativeOptionRemove:v}=c;return qe(()=>(b(m),()=>v(m)),[b,v,m]),f.createElement(f.Fragment,null,f.createElement(ye.span,F({id:l.textId},i,{ref:h})),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Ut.createPortal(i.children,a.valueNode):null)}),uG="SelectItemIndicator",fG=f.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return e4(uG,n).isSelected?f.createElement(ye.span,F({"aria-hidden":!0},r,{ref:e})):null}),og="SelectScrollUpButton",hG=f.forwardRef((t,e)=>{const n=uo(og,t.__scopeSelect),r=Ep(og,t.__scopeSelect),[o,i]=f.useState(!1),a=Ee(e,r.onScrollButtonChange);return qe(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=s.scrollTop>0;i(c)};const s=n.viewport;return l(),s.addEventListener("scroll",l),()=>s.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?f.createElement(t4,F({},t,{ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}})):null}),ig="SelectScrollDownButton",pG=f.forwardRef((t,e)=>{const n=uo(ig,t.__scopeSelect),r=Ep(ig,t.__scopeSelect),[o,i]=f.useState(!1),a=Ee(e,r.onScrollButtonChange);return qe(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=s.scrollHeight-s.clientHeight,d=Math.ceil(s.scrollTop)<c;i(d)};const s=n.viewport;return l(),s.addEventListener("scroll",l),()=>s.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?f.createElement(t4,F({},t,{ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}})):null}),t4=f.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=t,i=uo("SelectScrollButton",n),a=f.useRef(null),s=Pc(n),l=f.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return f.useEffect(()=>()=>l(),[l]),qe(()=>{var c;const d=s().find(u=>u.ref.current===document.activeElement);d==null||(c=d.ref.current)===null||c===void 0||c.scrollIntoView({block:"nearest"})},[s]),f.createElement(ye.div,F({"aria-hidden":!0},o,{ref:e,style:{flexShrink:0,...o.style},onPointerDown:oe(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:oe(o.onPointerMove,()=>{var c;(c=i.onItemLeave)===null||c===void 0||c.call(i),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:oe(o.onPointerLeave,()=>{l()})}))});function n4(t){return t===""||t===void 0}const r4=f.forwardRef((t,e)=>{const{value:n,...r}=t,o=f.useRef(null),i=Ee(e,o),a=H2(n);return f.useEffect(()=>{const s=o.current,l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==n&&d){const u=new Event("change",{bubbles:!0});d.call(s,n),s.dispatchEvent(u)}},[a,n]),f.createElement(Lf,{asChild:!0},f.createElement("select",F({},r,{ref:i,defaultValue:n})))});r4.displayName="BubbleSelect";function o4(t){const e=Bt(t),n=f.useRef(""),r=f.useRef(0),o=f.useCallback(a=>{const s=n.current+a;e(s),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(s)},[e]),i=f.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return f.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function i4(t,e,n){const o=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let a=mG(t,Math.max(i,0));o.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function mG(t,e){return t.map((n,r)=>t[(e+r)%t.length])}const gG=qU,a4=JU,s4=QU,bG=eG,vG=tG,yG=nG,$G=aG,xG=cG,CG=dG,wG=fG,_G=hG,SG=pG,EG="_content_93jyc_1",kG="_constrainContentWidth_93jyc_17",DG="_contentChild_93jyc_21",PG="_scrollButton_93jyc_33 _contentChild_93jyc_21",MG="_scrollUpButton_93jyc_44 _scrollButton_93jyc_33 _contentChild_93jyc_21",TG="_scrollDownButton_93jyc_58 _scrollButton_93jyc_33 _contentChild_93jyc_21",RG="_scrollButtonIcon_93jyc_72",IG="_item_93jyc_76 _contentChild_93jyc_21",NG="_itemIndicator_93jyc_105",AG="_itemText_93jyc_116",yt={content:EG,constrainContentWidth:kG,contentChild:DG,scrollButton:PG,scrollUpButton:MG,scrollDownButton:TG,scrollButtonIcon:RG,item:IG,"itemPadding-small":"_itemPadding-small_93jyc_92","itemPadding-medium":"_itemPadding-medium_93jyc_96","itemPadding-large":"_itemPadding-large_93jyc_100",itemIndicator:NG,itemText:AG};function l4(t){const e=On(),{children:n,disabled:r=(e==null?void 0:e.disabled)??!1,id:o,placeholder:i,color:a=(e==null?void 0:e.color)??"purple",size:s=(e==null?void 0:e.size)??"medium",renderTrigger:l=({button:M})=>M,startIcon:c,renderStartIcon:d,endIcon:u="arrowDropDown",constrainContentWidth:h,side:p,sideOffset:m,flexContent:b,boldTriggerText:v=!1,sx:y,name:$,autoComplete:x,value:C,onValueChange:w}=t,D=h?"popper":"item-aligned",E=!C&&a==="grey"?"placeholder":void 0,_=g.jsx(a4,{asChild:!0,disabled:r,id:o,children:g.jsx(Se,{sx:y,startIcon:c,renderStartIcon:d,endIcon:u,renderEndIcon:LG,size:s,color:a,textColor:E,textWeight:v?"bold":"normal",disabled:r,flexContent:b,children:g.jsx(s4,{placeholder:i})})});return g.jsxs(gG,{name:$,autoComplete:x,value:C,onValueChange:w,children:[l({button:_,disabled:r}),g.jsx(vG,{children:g.jsxs(yG,{collisionPadding:parseFloat(De.space[16]),position:D,side:p,sideOffset:m,className:z(yt.content,h&&yt.constrainContentWidth),children:[g.jsx($G,{children:n}),g.jsx(_G,{className:z(yt.scrollButton,yt.scrollUpButton),children:g.jsx(le,{className:yt.scrollButtonIcon,name:"keyboardArrowUp",size:"large"})}),g.jsx(SG,{className:z(yt.scrollButton,yt.scrollDownButton),children:g.jsx(le,{className:yt.scrollButtonIcon,name:"keyboardArrowDown",size:"large"})})]})})]})}function c4(t){const{children:e,icon:n,renderStartIcon:r=s=>s,size:o="medium",value:i,...a}=t;return g.jsxs(xG,{...a,value:i,className:z(yt.item,yt[`itemPadding-${o}`]),children:[r(n&&g.jsx(le,{name:n,size:"small"})),g.jsx(J,{component:"span",className:yt.itemText,noWrap:!0,children:g.jsx(CG,{children:e})}),g.jsx(wG,{asChild:!0,className:yt.itemIndicator,children:g.jsx(le,{name:"check"})})]})}function LG(t){return g.jsx(bG,{asChild:!0,children:t})}const OG="_root_1aoi1_1",VG={root:OG};function FG(t){const{id:e,disabled:n,placeholder:r}=t;return g.jsx(a4,{asChild:!0,disabled:n,id:e,children:g.jsxs("button",{className:VG.root,disabled:n,children:[g.jsx(J,{children:g.jsx(s4,{placeholder:r})}),g.jsx(le,{name:"unfoldMore",color:"grey11",size:"small"})]})})}const jG="_cardBase_1hmhy_1",ag={cardBase:jG,"card-default":"_card-default_1hmhy_15","card-selected":"_card-selected_1hmhy_28"};function BG(t){const{selected:e,onSelect:n,children:r}=t;return g.jsx("button",{className:z(ag.cardBase,ag[`card-${e?"selected":"default"}`]),role:"menuitemradio","aria-checked":e,onClick:n,children:r})}const Df="horizontal",HG=["horizontal","vertical"],d4=f.forwardRef((t,e)=>{const{decorative:n,orientation:r=Df,...o}=t,i=u4(r)?r:Df,s=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return f.createElement(Ae.div,F({"data-orientation":i},s,o,{ref:e}))});d4.propTypes={orientation(t,e,n){const r=t[e],o=String(r);return r&&!u4(r)?new Error(zG(o,n)):null}};function zG(t,e){return`Invalid prop \`orientation\` of value \`${t}\` supplied to \`${e}\`, expected one of:
|
package/dist/index.es.js
CHANGED
|
@@ -31664,47 +31664,49 @@ function pQ(t) {
|
|
|
31664
31664
|
const {
|
|
31665
31665
|
trigger: e,
|
|
31666
31666
|
children: n,
|
|
31667
|
-
renderTooltip: r = (
|
|
31667
|
+
renderTooltip: r = (y) => y,
|
|
31668
31668
|
onAnimationEnd: o,
|
|
31669
|
-
|
|
31670
|
-
|
|
31671
|
-
|
|
31672
|
-
|
|
31673
|
-
|
|
31674
|
-
|
|
31669
|
+
onAnimationStart: i,
|
|
31670
|
+
size: a = "large",
|
|
31671
|
+
hasClose: s = !0,
|
|
31672
|
+
modal: l = !0,
|
|
31673
|
+
position: c = "top",
|
|
31674
|
+
onPointerDownOutside: d,
|
|
31675
|
+
...u
|
|
31675
31676
|
} = t;
|
|
31676
|
-
function
|
|
31677
|
-
(
|
|
31677
|
+
function f(y) {
|
|
31678
|
+
(a === "fullscreen" || l === !1) && y.preventDefault();
|
|
31678
31679
|
}
|
|
31679
|
-
const
|
|
31680
|
-
if (
|
|
31681
|
-
return /* @__PURE__ */ m.jsx(fB, { ...t, onEscapeKeyDown:
|
|
31682
|
-
const
|
|
31680
|
+
const h = pB(), p = I(null);
|
|
31681
|
+
if (a === "fullscreen")
|
|
31682
|
+
return /* @__PURE__ */ m.jsx(fB, { ...t, onEscapeKeyDown: f });
|
|
31683
|
+
const g = a === "large" || a === "small", b = g ? void 0 : a, v = /* @__PURE__ */ m.jsxs(
|
|
31683
31684
|
w7,
|
|
31684
31685
|
{
|
|
31685
|
-
style: { ...
|
|
31686
|
+
style: { ...b, top: h },
|
|
31686
31687
|
className: U(
|
|
31687
31688
|
yt.container,
|
|
31688
|
-
yt[`container-${
|
|
31689
|
-
|
|
31690
|
-
|
|
31689
|
+
yt[`container-${c}`],
|
|
31690
|
+
g && yt[`container-${a}`],
|
|
31691
|
+
h && yt.child
|
|
31691
31692
|
),
|
|
31693
|
+
onAnimationStart: i,
|
|
31692
31694
|
onAnimationEnd: o,
|
|
31693
|
-
onEscapeKeyDown:
|
|
31694
|
-
onOpenAutoFocus:
|
|
31695
|
-
onCloseAutoFocus:
|
|
31696
|
-
onInteractOutside:
|
|
31697
|
-
onPointerDownOutside:
|
|
31698
|
-
ref:
|
|
31695
|
+
onEscapeKeyDown: f,
|
|
31696
|
+
onOpenAutoFocus: f,
|
|
31697
|
+
onCloseAutoFocus: f,
|
|
31698
|
+
onInteractOutside: f,
|
|
31699
|
+
onPointerDownOutside: d,
|
|
31700
|
+
ref: p,
|
|
31699
31701
|
children: [
|
|
31700
|
-
/* @__PURE__ */ m.jsx(S7.Provider, { value: { parentDialog:
|
|
31701
|
-
|
|
31702
|
+
/* @__PURE__ */ m.jsx(S7.Provider, { value: { parentDialog: p }, children: n }),
|
|
31703
|
+
s && /* @__PURE__ */ m.jsx("div", { className: yt.closeButton, children: /* @__PURE__ */ m.jsx(_7, { asChild: !0, children: /* @__PURE__ */ m.jsx(Ot, { icon: "close", hiddenLabel: "Close dialog" }) }) })
|
|
31702
31704
|
]
|
|
31703
31705
|
}
|
|
31704
31706
|
);
|
|
31705
|
-
return /* @__PURE__ */ m.jsxs($7, { modal:
|
|
31707
|
+
return /* @__PURE__ */ m.jsxs($7, { modal: l, ...u, children: [
|
|
31706
31708
|
r(e && /* @__PURE__ */ m.jsx(x7, { asChild: !0, children: e })),
|
|
31707
|
-
/* @__PURE__ */ m.jsx(C7, { children:
|
|
31709
|
+
/* @__PURE__ */ m.jsx(C7, { children: l ? /* @__PURE__ */ m.jsx(YF, { className: yt.overlay, children: v }) : v })
|
|
31708
31710
|
] });
|
|
31709
31711
|
}
|
|
31710
31712
|
const mQ = (t) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
3
|
"@internationalized/date": "3.5.0",
|
|
4
|
-
"@prismicio/editor-support": "0.4.
|
|
4
|
+
"@prismicio/editor-support": "0.4.34",
|
|
5
5
|
"@radix-ui/react-avatar": "1.0.4",
|
|
6
6
|
"@radix-ui/react-checkbox": "1.0.4",
|
|
7
7
|
"@radix-ui/react-dialog": "1.0.5",
|
|
@@ -118,5 +118,5 @@
|
|
|
118
118
|
"sideEffects": false,
|
|
119
119
|
"stableVersion": "0.0.0",
|
|
120
120
|
"types": "./dist/index.d.ts",
|
|
121
|
-
"version": "0.4.
|
|
121
|
+
"version": "0.4.34-alpha-dialog-animation-callback.0"
|
|
122
122
|
}
|