easea-app-widget 1.0.6 → 1.0.7

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/widget.es.js CHANGED
@@ -18334,7 +18334,7 @@ const $P = (e) => typeof e == "object" && e !== null && ("disabled" in e ? typeo
18334
18334
  ref: h,
18335
18335
  className: xt(
18336
18336
  "bg-background fixed flex flex-col top-0 bottom-0 w-full sm:max-w-[400px] transition-all duration-300 sm:shadow-xl overflow-hidden",
18337
- `z-${HE}`,
18337
+ `z-[${HE}]`,
18338
18338
  e === "left" ? "left-0" : "right-0",
18339
18339
  t ? e === "left" ? "left-0" : "right-0" : e === "left" ? "-left-full" : "-right-full"
18340
18340
  ),
@@ -18351,7 +18351,7 @@ const $P = (e) => typeof e == "object" && e !== null && ("disabled" in e ? typeo
18351
18351
  className: xt(
18352
18352
  "bg-foreground/50 fixed flex top-0 left-0 flex-col w-full h-full",
18353
18353
  e ? "block" : "hidden",
18354
- `z-${HE - 1}`
18354
+ `z-[${HE - 1}]`
18355
18355
  )
18356
18356
  }
18357
18357
  );
@@ -174,7 +174,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
174
174
  `)},fN=function(){var e=parseInt(document.body.getAttribute(_c)||"0",10);return isFinite(e)?e:0},mj=function(){C.useEffect(function(){return document.body.setAttribute(_c,(fN()+1).toString()),function(){var e=fN()-1;e<=0?document.body.removeAttribute(_c):document.body.setAttribute(_c,e.toString())}},[])},gj=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,r=i===void 0?"margin":i;mj();var s=C.useMemo(function(){return fj(r)},[r]);return C.createElement(hj,{styles:pj(s,!t,r,n?"":"!important")})},O0=!1;if(typeof window<"u")try{var Jm=Object.defineProperty({},"passive",{get:function(){return O0=!0,!0}});window.addEventListener("test",Jm,Jm),window.removeEventListener("test",Jm,Jm)}catch{O0=!1}var Tc=O0?{passive:!1}:!1,vj=function(e){return e.tagName==="TEXTAREA"},hN=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!vj(e)&&n[t]==="visible")},yj=function(e){return hN(e,"overflowY")},bj=function(e){return hN(e,"overflowX")},pN=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var r=mN(e,i);if(r){var s=gN(e,i),c=s[1],h=s[2];if(c>h)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},wj=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},xj=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},mN=function(e,t){return e==="v"?yj(t):bj(t)},gN=function(e,t){return e==="v"?wj(t):xj(t)},Sj=function(e,t){return e==="h"&&t==="rtl"?-1:1},Aj=function(e,t,n,i,r){var s=Sj(e,window.getComputedStyle(t).direction),c=s*i,h=n.target,m=t.contains(h),v=!1,b=c>0,w=0,S=0;do{if(!h)break;var N=gN(e,h),A=N[0],O=N[1],_=N[2],M=O-_-s*A;(A||M)&&mN(e,h)&&(w+=M,S+=A);var I=h.parentNode;h=I&&I.nodeType===Node.DOCUMENT_FRAGMENT_NODE?I.host:I}while(!m&&h!==document.body||m&&(t.contains(h)||t===h));return(b&&Math.abs(w)<1||!b&&Math.abs(S)<1)&&(v=!0),v},eg=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},vN=function(e){return[e.deltaX,e.deltaY]},yN=function(e){return e&&"current"in e?e.current:e},Oj=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Nj=function(e){return`
175
175
  .block-interactivity-`.concat(e,` {pointer-events: none;}
176
176
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
177
- `)},kj=0,Cc=[];function Ej(e){var t=C.useRef([]),n=C.useRef([0,0]),i=C.useRef(),r=C.useState(kj++)[0],s=C.useState(dN)[0],c=C.useRef(e);C.useEffect(function(){c.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var O=q4([e.lockRef.current],(e.shards||[]).map(yN),!0).filter(Boolean);return O.forEach(function(_){return _.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),O.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var h=C.useCallback(function(O,_){if("touches"in O&&O.touches.length===2||O.type==="wheel"&&O.ctrlKey)return!c.current.allowPinchZoom;var M=eg(O),I=n.current,j="deltaX"in O?O.deltaX:I[0]-M[0],H="deltaY"in O?O.deltaY:I[1]-M[1],U,$=O.target,L=Math.abs(j)>Math.abs(H)?"h":"v";if("touches"in O&&L==="h"&&$.type==="range")return!1;var Q=pN(L,$);if(!Q)return!0;if(Q?U=L:(U=L==="v"?"h":"v",Q=pN(L,$)),!Q)return!1;if(!i.current&&"changedTouches"in O&&(j||H)&&(i.current=U),!U)return!0;var re=i.current||U;return Aj(re,_,O,re==="h"?j:H)},[]),m=C.useCallback(function(O){var _=O;if(!(!Cc.length||Cc[Cc.length-1]!==s)){var M="deltaY"in _?vN(_):eg(_),I=t.current.filter(function(U){return U.name===_.type&&(U.target===_.target||_.target===U.shadowParent)&&Oj(U.delta,M)})[0];if(I&&I.should){_.cancelable&&_.preventDefault();return}if(!I){var j=(c.current.shards||[]).map(yN).filter(Boolean).filter(function(U){return U.contains(_.target)}),H=j.length>0?h(_,j[0]):!c.current.noIsolation;H&&_.cancelable&&_.preventDefault()}}},[]),v=C.useCallback(function(O,_,M,I){var j={name:O,delta:_,target:M,should:I,shadowParent:Dj(M)};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(H){return H!==j})},1)},[]),b=C.useCallback(function(O){n.current=eg(O),i.current=void 0},[]),w=C.useCallback(function(O){v(O.type,vN(O),O.target,h(O,e.lockRef.current))},[]),S=C.useCallback(function(O){v(O.type,eg(O),O.target,h(O,e.lockRef.current))},[]);C.useEffect(function(){return Cc.push(s),e.setCallbacks({onScrollCapture:w,onWheelCapture:w,onTouchMoveCapture:S}),document.addEventListener("wheel",m,Tc),document.addEventListener("touchmove",m,Tc),document.addEventListener("touchstart",b,Tc),function(){Cc=Cc.filter(function(O){return O!==s}),document.removeEventListener("wheel",m,Tc),document.removeEventListener("touchmove",m,Tc),document.removeEventListener("touchstart",b,Tc)}},[]);var N=e.removeScrollBar,A=e.inert;return C.createElement(C.Fragment,null,A?C.createElement(s,{styles:Nj(r)}):null,N?C.createElement(gj,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Dj(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const _j=rj(cN,Ej);var bN=C.forwardRef(function(e,t){return C.createElement(Xm,qa({},e,{ref:t,sideCar:_j}))});bN.classNames=Xm.classNames;var Tj=[" ","Enter","ArrowUp","ArrowDown"],Cj=[" ","Enter"],Ul="Select",[tg,ng,zj]=dO(Ul),[zc,CW]=Ac(Ul,[zj,VO]),rg=VO(),[Ij,Ds]=zc(Ul),[Mj,Rj]=zc(Ul),wN=e=>{const{__scopeSelect:t,children:n,open:i,defaultOpen:r,onOpenChange:s,value:c,defaultValue:h,onValueChange:m,dir:v,name:b,autoComplete:w,disabled:S,required:N,form:A}=e,O=rg(t),[_,M]=C.useState(null),[I,j]=C.useState(null),[H,U]=C.useState(!1),$=n0(v),[L,Q]=Ym({prop:i,defaultProp:r??!1,onChange:s,caller:Ul}),[re,W]=Ym({prop:c,defaultProp:h,onChange:m,caller:Ul}),X=C.useRef(null),ne=_?A||!!_.closest("form"):!0,[F,V]=C.useState(new Set),te=Array.from(F).map(P=>P.props.value).join(";");return E.jsx(R4,{...O,children:E.jsxs(Ij,{required:N,scope:t,trigger:_,onTriggerChange:M,valueNode:I,onValueNodeChange:j,valueNodeHasChildren:H,onValueNodeHasChildrenChange:U,contentId:jm(),value:re,onValueChange:W,open:L,onOpenChange:Q,dir:$,triggerPointerDownPosRef:X,disabled:S,children:[E.jsx(tg.Provider,{scope:t,children:E.jsx(Mj,{scope:e.__scopeSelect,onNativeOptionAdd:C.useCallback(P=>{V(ee=>new Set(ee).add(P))},[]),onNativeOptionRemove:C.useCallback(P=>{V(ee=>{const Y=new Set(ee);return Y.delete(P),Y})},[]),children:n})}),ne?E.jsxs(FN,{"aria-hidden":!0,required:N,tabIndex:-1,name:b,autoComplete:w,value:re,onChange:P=>W(P.target.value),disabled:S,form:A,children:[re===void 0?E.jsx("option",{value:""}):null,Array.from(F)]},te):null]})})};wN.displayName=Ul;var xN="SelectTrigger",SN=C.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:i=!1,...r}=e,s=rg(n),c=Ds(xN,n),h=c.disabled||i,m=Mn(t,c.onTriggerChange),v=ng(n),b=C.useRef("touch"),[w,S,N]=QN(O=>{const _=v().filter(j=>!j.disabled),M=_.find(j=>j.value===c.value),I=GN(_,O,M);I!==void 0&&c.onValueChange(I.value)}),A=O=>{h||(c.onOpenChange(!0),N()),O&&(c.triggerPointerDownPosRef.current={x:Math.round(O.pageX),y:Math.round(O.pageY)})};return E.jsx(j4,{asChild:!0,...s,children:E.jsx(hn.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:h,"data-disabled":h?"":void 0,"data-placeholder":HN(c.value)?"":void 0,...r,ref:m,onClick:an(r.onClick,O=>{O.currentTarget.focus(),b.current!=="mouse"&&A(O)}),onPointerDown:an(r.onPointerDown,O=>{b.current=O.pointerType;const _=O.target;_.hasPointerCapture(O.pointerId)&&_.releasePointerCapture(O.pointerId),O.button===0&&O.ctrlKey===!1&&O.pointerType==="mouse"&&(A(O),O.preventDefault())}),onKeyDown:an(r.onKeyDown,O=>{const _=w.current!=="";!(O.ctrlKey||O.altKey||O.metaKey)&&O.key.length===1&&S(O.key),!(_&&O.key===" ")&&Tj.includes(O.key)&&(A(),O.preventDefault())})})})});SN.displayName=xN;var AN="SelectValue",ON=C.forwardRef((e,t)=>{const{__scopeSelect:n,className:i,style:r,children:s,placeholder:c="",...h}=e,m=Ds(AN,n),{onValueNodeHasChildrenChange:v}=m,b=s!==void 0,w=Mn(t,m.onValueNodeChange);return Br(()=>{v(b)},[v,b]),E.jsx(hn.span,{...h,ref:w,style:{pointerEvents:"none"},children:HN(m.value)?E.jsx(E.Fragment,{children:c}):s})});ON.displayName=AN;var jj="SelectIcon",NN=C.forwardRef((e,t)=>{const{__scopeSelect:n,children:i,...r}=e;return E.jsx(hn.span,{"aria-hidden":!0,...r,ref:t,children:i||"▼"})});NN.displayName=jj;var Ll="SelectContent",kN=C.forwardRef((e,t)=>{const n=Ds(Ll,e.__scopeSelect),[i,r]=C.useState();if(Br(()=>{r(new DocumentFragment)},[]),!n.open){const s=i;return s?Uf.createPortal(E.jsx(EN,{scope:e.__scopeSelect,children:E.jsx(tg.Slot,{scope:e.__scopeSelect,children:E.jsx("div",{children:e.children})})}),s):null}return E.jsx(DN,{...e,ref:t})});kN.displayName=Ll;var ma=10,[EN,_s]=zc(Ll),Pj="SelectContentImpl",Uj=If("SelectContent.RemoveScroll"),DN=C.forwardRef((e,t)=>{const{__scopeSelect:n,position:i="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:c,side:h,sideOffset:m,align:v,alignOffset:b,arrowPadding:w,collisionBoundary:S,collisionPadding:N,sticky:A,hideWhenDetached:O,avoidCollisions:_,...M}=e,I=Ds(Ll,n),[j,H]=C.useState(null),[U,$]=C.useState(null),L=Mn(t,Te=>H(Te)),[Q,re]=C.useState(null),[W,X]=C.useState(null),ne=ng(n),[F,V]=C.useState(!1),te=C.useRef(!1);C.useEffect(()=>{if(j)return Y4(j)},[j]),s6();const P=C.useCallback(Te=>{const[Be,...ot]=ne().map(wt=>wt.ref.current),[dt]=ot.slice(-1),ht=document.activeElement;for(const wt of Te)if(wt===ht||(wt?.scrollIntoView({block:"nearest"}),wt===Be&&U&&(U.scrollTop=0),wt===dt&&U&&(U.scrollTop=U.scrollHeight),wt?.focus(),document.activeElement!==ht))return},[ne,U]),ee=C.useCallback(()=>P([Q,j]),[P,Q,j]);C.useEffect(()=>{F&&ee()},[F,ee]);const{onOpenChange:Y,triggerPointerDownPosRef:me}=I;C.useEffect(()=>{if(j){let Te={x:0,y:0};const Be=dt=>{Te={x:Math.abs(Math.round(dt.pageX)-(me.current?.x??0)),y:Math.abs(Math.round(dt.pageY)-(me.current?.y??0))}},ot=dt=>{Te.x<=10&&Te.y<=10?dt.preventDefault():j.contains(dt.target)||Y(!1),document.removeEventListener("pointermove",Be),me.current=null};return me.current!==null&&(document.addEventListener("pointermove",Be),document.addEventListener("pointerup",ot,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Be),document.removeEventListener("pointerup",ot,{capture:!0})}}},[j,Y,me]),C.useEffect(()=>{const Te=()=>Y(!1);return window.addEventListener("blur",Te),window.addEventListener("resize",Te),()=>{window.removeEventListener("blur",Te),window.removeEventListener("resize",Te)}},[Y]);const[B,ae]=QN(Te=>{const Be=ne().filter(ht=>!ht.disabled),ot=Be.find(ht=>ht.ref.current===document.activeElement),dt=GN(Be,Te,ot);dt&&setTimeout(()=>dt.ref.current.focus())}),Ne=C.useCallback((Te,Be,ot)=>{const dt=!te.current&&!ot;(I.value!==void 0&&I.value===Be||dt)&&(re(Te),dt&&(te.current=!0))},[I.value]),be=C.useCallback(()=>j?.focus(),[j]),De=C.useCallback((Te,Be,ot)=>{const dt=!te.current&&!ot;(I.value!==void 0&&I.value===Be||dt)&&X(Te)},[I.value]),Re=i==="popper"?N0:_N,je=Re===N0?{side:h,sideOffset:m,align:v,alignOffset:b,arrowPadding:w,collisionBoundary:S,collisionPadding:N,sticky:A,hideWhenDetached:O,avoidCollisions:_}:{};return E.jsx(EN,{scope:n,content:j,viewport:U,onViewportChange:$,itemRefCallback:Ne,selectedItem:Q,onItemLeave:be,itemTextRefCallback:De,focusSelectedItem:ee,selectedItemText:W,position:i,isPositioned:F,searchRef:B,children:E.jsx(bN,{as:Uj,allowPinchZoom:!0,children:E.jsx(bO,{asChild:!0,trapped:I.open,onMountAutoFocus:Te=>{Te.preventDefault()},onUnmountAutoFocus:an(r,Te=>{I.trigger?.focus({preventScroll:!0}),Te.preventDefault()}),children:E.jsx(pO,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:Te=>Te.preventDefault(),onDismiss:()=>I.onOpenChange(!1),children:E.jsx(Re,{role:"listbox",id:I.contentId,"data-state":I.open?"open":"closed",dir:I.dir,onContextMenu:Te=>Te.preventDefault(),...M,...je,onPlaced:()=>V(!0),ref:L,style:{display:"flex",flexDirection:"column",outline:"none",...M.style},onKeyDown:an(M.onKeyDown,Te=>{const Be=Te.ctrlKey||Te.altKey||Te.metaKey;if(Te.key==="Tab"&&Te.preventDefault(),!Be&&Te.key.length===1&&ae(Te.key),["ArrowUp","ArrowDown","Home","End"].includes(Te.key)){let dt=ne().filter(ht=>!ht.disabled).map(ht=>ht.ref.current);if(["ArrowUp","End"].includes(Te.key)&&(dt=dt.slice().reverse()),["ArrowUp","ArrowDown"].includes(Te.key)){const ht=Te.target,wt=dt.indexOf(ht);dt=dt.slice(wt+1)}setTimeout(()=>P(dt)),Te.preventDefault()}})})})})})})});DN.displayName=Pj;var Lj="SelectItemAlignedPosition",_N=C.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:i,...r}=e,s=Ds(Ll,n),c=_s(Ll,n),[h,m]=C.useState(null),[v,b]=C.useState(null),w=Mn(t,L=>b(L)),S=ng(n),N=C.useRef(!1),A=C.useRef(!0),{viewport:O,selectedItem:_,selectedItemText:M,focusSelectedItem:I}=c,j=C.useCallback(()=>{if(s.trigger&&s.valueNode&&h&&v&&O&&_&&M){const L=s.trigger.getBoundingClientRect(),Q=v.getBoundingClientRect(),re=s.valueNode.getBoundingClientRect(),W=M.getBoundingClientRect();if(s.dir!=="rtl"){const ht=W.left-Q.left,wt=re.left-ht,vn=L.left-wt,Vt=L.width+vn,cr=Math.max(Vt,Q.width),Mi=window.innerWidth-ma,en=cO(wt,[ma,Math.max(ma,Mi-cr)]);h.style.minWidth=Vt+"px",h.style.left=en+"px"}else{const ht=Q.right-W.right,wt=window.innerWidth-re.right-ht,vn=window.innerWidth-L.right-wt,Vt=L.width+vn,cr=Math.max(Vt,Q.width),Mi=window.innerWidth-ma,en=cO(wt,[ma,Math.max(ma,Mi-cr)]);h.style.minWidth=Vt+"px",h.style.right=en+"px"}const X=S(),ne=window.innerHeight-ma*2,F=O.scrollHeight,V=window.getComputedStyle(v),te=parseInt(V.borderTopWidth,10),P=parseInt(V.paddingTop,10),ee=parseInt(V.borderBottomWidth,10),Y=parseInt(V.paddingBottom,10),me=te+P+F+Y+ee,B=Math.min(_.offsetHeight*5,me),ae=window.getComputedStyle(O),Ne=parseInt(ae.paddingTop,10),be=parseInt(ae.paddingBottom,10),De=L.top+L.height/2-ma,Re=ne-De,je=_.offsetHeight/2,Te=_.offsetTop+je,Be=te+P+Te,ot=me-Be;if(Be<=De){const ht=X.length>0&&_===X[X.length-1].ref.current;h.style.bottom="0px";const wt=v.clientHeight-O.offsetTop-O.offsetHeight,vn=Math.max(Re,je+(ht?be:0)+wt+ee),Vt=Be+vn;h.style.height=Vt+"px"}else{const ht=X.length>0&&_===X[0].ref.current;h.style.top="0px";const vn=Math.max(De,te+O.offsetTop+(ht?Ne:0)+je)+ot;h.style.height=vn+"px",O.scrollTop=Be-De+O.offsetTop}h.style.margin=`${ma}px 0`,h.style.minHeight=B+"px",h.style.maxHeight=ne+"px",i?.(),requestAnimationFrame(()=>N.current=!0)}},[S,s.trigger,s.valueNode,h,v,O,_,M,s.dir,i]);Br(()=>j(),[j]);const[H,U]=C.useState();Br(()=>{v&&U(window.getComputedStyle(v).zIndex)},[v]);const $=C.useCallback(L=>{L&&A.current===!0&&(j(),I?.(),A.current=!1)},[j,I]);return E.jsx(Fj,{scope:n,contentWrapper:h,shouldExpandOnScrollRef:N,onScrollButtonChange:$,children:E.jsx("div",{ref:m,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:H},children:E.jsx(hn.div,{...r,ref:w,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});_N.displayName=Lj;var Bj="SelectPopperPosition",N0=C.forwardRef((e,t)=>{const{__scopeSelect:n,align:i="start",collisionPadding:r=ma,...s}=e,c=rg(n);return E.jsx(P4,{...c,...s,ref:t,align:i,collisionPadding:r,style:{boxSizing:"border-box",...s.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)"}})});N0.displayName=Bj;var[Fj,k0]=zc(Ll,{}),E0="SelectViewport",TN=C.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:i,...r}=e,s=_s(E0,n),c=k0(E0,n),h=Mn(t,s.onViewportChange),m=C.useRef(0);return E.jsxs(E.Fragment,{children:[E.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),E.jsx(tg.Slot,{scope:n,children:E.jsx(hn.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:h,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:an(r.onScroll,v=>{const b=v.currentTarget,{contentWrapper:w,shouldExpandOnScrollRef:S}=c;if(S?.current&&w){const N=Math.abs(m.current-b.scrollTop);if(N>0){const A=window.innerHeight-ma*2,O=parseFloat(w.style.minHeight),_=parseFloat(w.style.height),M=Math.max(O,_);if(M<A){const I=M+N,j=Math.min(A,I),H=I-j;w.style.height=j+"px",w.style.bottom==="0px"&&(b.scrollTop=H>0?H:0,w.style.justifyContent="flex-end")}}}m.current=b.scrollTop})})})]})});TN.displayName=E0;var CN="SelectGroup",[Hj,Qj]=zc(CN),Gj=C.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e,r=jm();return E.jsx(Hj,{scope:n,id:r,children:E.jsx(hn.div,{role:"group","aria-labelledby":r,...i,ref:t})})});Gj.displayName=CN;var zN="SelectLabel",Zj=C.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e,r=Qj(zN,n);return E.jsx(hn.div,{id:r.id,...i,ref:t})});Zj.displayName=zN;var ig="SelectItem",[Wj,IN]=zc(ig),MN=C.forwardRef((e,t)=>{const{__scopeSelect:n,value:i,disabled:r=!1,textValue:s,...c}=e,h=Ds(ig,n),m=_s(ig,n),v=h.value===i,[b,w]=C.useState(s??""),[S,N]=C.useState(!1),A=Mn(t,I=>m.itemRefCallback?.(I,i,r)),O=jm(),_=C.useRef("touch"),M=()=>{r||(h.onValueChange(i),h.onOpenChange(!1))};if(i==="")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 E.jsx(Wj,{scope:n,value:i,disabled:r,textId:O,isSelected:v,onItemTextChange:C.useCallback(I=>{w(j=>j||(I?.textContent??"").trim())},[]),children:E.jsx(tg.ItemSlot,{scope:n,value:i,disabled:r,textValue:b,children:E.jsx(hn.div,{role:"option","aria-labelledby":O,"data-highlighted":S?"":void 0,"aria-selected":v&&S,"data-state":v?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...c,ref:A,onFocus:an(c.onFocus,()=>N(!0)),onBlur:an(c.onBlur,()=>N(!1)),onClick:an(c.onClick,()=>{_.current!=="mouse"&&M()}),onPointerUp:an(c.onPointerUp,()=>{_.current==="mouse"&&M()}),onPointerDown:an(c.onPointerDown,I=>{_.current=I.pointerType}),onPointerMove:an(c.onPointerMove,I=>{_.current=I.pointerType,r?m.onItemLeave?.():_.current==="mouse"&&I.currentTarget.focus({preventScroll:!0})}),onPointerLeave:an(c.onPointerLeave,I=>{I.currentTarget===document.activeElement&&m.onItemLeave?.()}),onKeyDown:an(c.onKeyDown,I=>{m.searchRef?.current!==""&&I.key===" "||(Cj.includes(I.key)&&M(),I.key===" "&&I.preventDefault())})})})})});MN.displayName=ig;var Hf="SelectItemText",RN=C.forwardRef((e,t)=>{const{__scopeSelect:n,className:i,style:r,...s}=e,c=Ds(Hf,n),h=_s(Hf,n),m=IN(Hf,n),v=Rj(Hf,n),[b,w]=C.useState(null),S=Mn(t,M=>w(M),m.onItemTextChange,M=>h.itemTextRefCallback?.(M,m.value,m.disabled)),N=b?.textContent,A=C.useMemo(()=>E.jsx("option",{value:m.value,disabled:m.disabled,children:N},m.value),[m.disabled,m.value,N]),{onNativeOptionAdd:O,onNativeOptionRemove:_}=v;return Br(()=>(O(A),()=>_(A)),[O,_,A]),E.jsxs(E.Fragment,{children:[E.jsx(hn.span,{id:m.textId,...s,ref:S}),m.isSelected&&c.valueNode&&!c.valueNodeHasChildren?Uf.createPortal(s.children,c.valueNode):null]})});RN.displayName=Hf;var jN="SelectItemIndicator",PN=C.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e;return IN(jN,n).isSelected?E.jsx(hn.span,{"aria-hidden":!0,...i,ref:t}):null});PN.displayName=jN;var D0="SelectScrollUpButton",UN=C.forwardRef((e,t)=>{const n=_s(D0,e.__scopeSelect),i=k0(D0,e.__scopeSelect),[r,s]=C.useState(!1),c=Mn(t,i.onScrollButtonChange);return Br(()=>{if(n.viewport&&n.isPositioned){let h=function(){const v=m.scrollTop>0;s(v)};const m=n.viewport;return h(),m.addEventListener("scroll",h),()=>m.removeEventListener("scroll",h)}},[n.viewport,n.isPositioned]),r?E.jsx(BN,{...e,ref:c,onAutoScroll:()=>{const{viewport:h,selectedItem:m}=n;h&&m&&(h.scrollTop=h.scrollTop-m.offsetHeight)}}):null});UN.displayName=D0;var _0="SelectScrollDownButton",LN=C.forwardRef((e,t)=>{const n=_s(_0,e.__scopeSelect),i=k0(_0,e.__scopeSelect),[r,s]=C.useState(!1),c=Mn(t,i.onScrollButtonChange);return Br(()=>{if(n.viewport&&n.isPositioned){let h=function(){const v=m.scrollHeight-m.clientHeight,b=Math.ceil(m.scrollTop)<v;s(b)};const m=n.viewport;return h(),m.addEventListener("scroll",h),()=>m.removeEventListener("scroll",h)}},[n.viewport,n.isPositioned]),r?E.jsx(BN,{...e,ref:c,onAutoScroll:()=>{const{viewport:h,selectedItem:m}=n;h&&m&&(h.scrollTop=h.scrollTop+m.offsetHeight)}}):null});LN.displayName=_0;var BN=C.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:i,...r}=e,s=_s("SelectScrollButton",n),c=C.useRef(null),h=ng(n),m=C.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return C.useEffect(()=>()=>m(),[m]),Br(()=>{h().find(b=>b.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[h]),E.jsx(hn.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:an(r.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(i,50))}),onPointerMove:an(r.onPointerMove,()=>{s.onItemLeave?.(),c.current===null&&(c.current=window.setInterval(i,50))}),onPointerLeave:an(r.onPointerLeave,()=>{m()})})}),Yj="SelectSeparator",qj=C.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e;return E.jsx(hn.div,{"aria-hidden":!0,...i,ref:t})});qj.displayName=Yj;var T0="SelectArrow",Vj=C.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e,r=rg(n),s=Ds(T0,n),c=_s(T0,n);return s.open&&c.position==="popper"?E.jsx(U4,{...r,...i,ref:t}):null});Vj.displayName=T0;var $j="SelectBubbleInput",FN=C.forwardRef(({__scopeSelect:e,value:t,...n},i)=>{const r=C.useRef(null),s=Mn(i,r),c=iN(t);return C.useEffect(()=>{const h=r.current;if(!h)return;const m=window.HTMLSelectElement.prototype,b=Object.getOwnPropertyDescriptor(m,"value").set;if(c!==t&&b){const w=new Event("change",{bubbles:!0});b.call(h,t),h.dispatchEvent(w)}},[c,t]),E.jsx(hn.select,{...n,style:{...aN,...n.style},ref:s,defaultValue:t})});FN.displayName=$j;function HN(e){return e===""||e===void 0}function QN(e){const t=Os(e),n=C.useRef(""),i=C.useRef(0),r=C.useCallback(c=>{const h=n.current+c;t(h),(function m(v){n.current=v,window.clearTimeout(i.current),v!==""&&(i.current=window.setTimeout(()=>m(""),1e3))})(h)},[t]),s=C.useCallback(()=>{n.current="",window.clearTimeout(i.current)},[]);return C.useEffect(()=>()=>window.clearTimeout(i.current),[]),[n,r,s]}function GN(e,t,n){const r=t.length>1&&Array.from(t).every(v=>v===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let c=Kj(e,Math.max(s,0));r.length===1&&(c=c.filter(v=>v!==n));const m=c.find(v=>v.textValue.toLowerCase().startsWith(r.toLowerCase()));return m!==n?m:void 0}function Kj(e,t){return e.map((n,i)=>e[(t+i)%e.length])}var Xj=wN,Jj=SN,eP=ON,tP=NN,nP=kN,rP=TN,iP=MN,aP=RN,oP=PN,sP=UN,lP=LN;function uP({...e}){return E.jsx(Xj,{"data-slot":"select",...e})}function cP({...e}){return E.jsx(eP,{"data-slot":"select-value",...e})}function dP({className:e,size:t="default",children:n,...i}){return E.jsxs(Jj,{"data-slot":"select-trigger","data-size":t,className:bt("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-brand border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-12 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...i,children:[n,E.jsx(tP,{asChild:!0,children:E.jsx(VA,{className:"size-4 opacity-50"})})]})}function fP({className:e,children:t,position:n="popper",...i}){return E.jsxs(nP,{"data-slot":"select-content",className:bt("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-[99999] max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...i,children:[E.jsx(hP,{}),E.jsx(rP,{className:bt("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),E.jsx(pP,{})]})}function ZN({className:e,children:t,...n}){return E.jsxs(iP,{"data-slot":"select-item",className:bt("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[E.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:E.jsx(oP,{children:E.jsx(mR,{className:"size-4"})})}),E.jsx(aP,{children:t})]})}function hP({className:e,...t}){return E.jsx(sP,{"data-slot":"select-scroll-up-button",className:bt("flex cursor-default items-center justify-center py-1",e),...t,children:E.jsx(gR,{className:"size-4"})})}function pP({className:e,...t}){return E.jsx(lP,{"data-slot":"select-scroll-down-button",className:bt("flex cursor-default items-center justify-center py-1",e),...t,children:E.jsx(VA,{className:"size-4"})})}const mP=e=>typeof e=="object"&&e!==null&&("disabled"in e?typeof e.disabled=="boolean":!0),gP=({size:e="default",onChange:t,options:n,getValue:i,getLabel:r,placeholder:s,onBlur:c,noOptionsText:h,...m})=>E.jsxs(uP,{...m,onValueChange:v=>{t?.(v)},children:[E.jsx(dP,{size:e,children:E.jsx(cP,{onBlur:c,placeholder:s})}),E.jsx(fP,{position:"popper",children:n.length===0?E.jsx(ZN,{value:"No options",disabled:!0,children:h||"No options available"}):n.map(v=>E.jsx(ZN,{value:i(v),disabled:mP(v)?v.disabled:void 0,children:r(v)},i(v)))})]}),vP=[{label:"EN",value:"en"},{label:"IT",value:"it"}],yP=()=>{const{i18n:e}=Tn(),[t,n]=C.useState(e.language),i=r=>{e.changeLanguage(r),n(r)};return E.jsx(gP,{size:"sm",options:vP,getLabel:({label:r})=>r,getValue:({value:r})=>r,value:t,onChange:i})},bP=({showBackButton:e=!1,onBack:t})=>{const{t:n}=Tn(),i=C.useContext(WA);return E.jsxs("div",{className:bt("flex bg-background py-1 px-4 justify-end sticky z-20 top-0 gap-4 border-b",e&&"justify-between"),children:[e&&E.jsx(mr,{"aria-label":n("go_back"),variant:"ghost",size:"icon",onClick:t,children:E.jsx(hR,{})}),E.jsxs("div",{className:"flex gap-4",children:[E.jsx(yP,{}),E.jsx(mr,{"aria-label":n("close_drawer"),variant:"ghost",size:"icon",onClick:i?.close,children:E.jsx(KA,{})})]})]})},WN=2147483647,wP=({direction:e,open:t,setOpen:n,children:i,disableFocusTrap:r=!1,showHeaderBackButton:s=!1,onBack:c})=>{const h=C.useRef(null);return C.useEffect(()=>{t?(document.body.style.overflow="hidden",h.current?.focus()):document.body.style.overflow="auto"},[t]),E.jsx(WA.Provider,{value:{close:()=>n(!1)},children:E.jsxs("div",{children:[E.jsx(xP,{open:t}),E.jsx(ZA.FocusTrap,{active:!r&&t,children:E.jsxs("div",{ref:h,className:bt("bg-background fixed flex flex-col top-0 bottom-0 w-full sm:max-w-[400px] transition-all duration-300 sm:shadow-xl overflow-hidden",`z-${WN}`,e==="left"?"left-0":"right-0",t?e==="left"?"left-0":"right-0":e==="left"?"-left-full":"-right-full"),children:[E.jsx(bP,{showBackButton:s,onBack:c}),E.jsx("div",{className:"flex flex-1 flex-col overflow-scroll",children:i})]})})]})})},xP=({open:e})=>E.jsx("div",{className:bt("bg-foreground/50 fixed flex top-0 left-0 flex-col w-full h-full",e?"block":"hidden",`z-${WN-1}`)});class Bl extends Error{response;request;constructor(t,n){const i=`${Bl.extractMessage(t)}: ${JSON.stringify({response:t,request:n})}`;super(i),Object.setPrototypeOf(this,Bl.prototype),this.response=t,this.request=n,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Bl)}static extractMessage(t){return t.errors?.[0]?.message??`GraphQL Error (Code: ${String(t.status)})`}}const YN=e=>e.toUpperCase(),C0=e=>typeof e=="function"?e():e,qN=(e,t)=>e.map((n,i)=>[n,t[i]]),Ic=e=>{let t={};return e instanceof Headers?t=SP(e):Array.isArray(e)?e.forEach(([n,i])=>{n&&i!==void 0&&(t[n]=i)}):e&&(t=e),t},SP=e=>{const t={};return e.forEach((n,i)=>{t[i]=n}),t},AP=e=>{try{const t=e();return OP(t)?t.catch(n=>VN(n)):t}catch(t){return VN(t)}},VN=e=>e instanceof Error?e:new Error(String(e)),OP=e=>typeof e=="object"&&e!==null&&"then"in e&&typeof e.then=="function"&&"catch"in e&&typeof e.catch=="function"&&"finally"in e&&typeof e.finally=="function",z0=e=>{throw new Error(`Unhandled case: ${String(e)}`)},ag=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),NP=(e,t)=>e.documents?e:{documents:e,requestHeaders:t,signal:void 0},kP=(e,t,n)=>e.query?e:{query:e,variables:t,requestHeaders:n,signal:void 0};function og(e,t){if(!!!e)throw new Error(t)}function EP(e){return typeof e=="object"&&e!==null}function DP(e,t){if(!!!e)throw new Error("Unexpected invariant triggered.")}const _P=/\r\n|[\n\r]/g;function I0(e,t){let n=0,i=1;for(const r of e.body.matchAll(_P)){if(typeof r.index=="number"||DP(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}function TP(e){return $N(e.source,I0(e.source,e.start))}function $N(e,t){const n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,s=e.locationOffset.line-1,c=t.line+s,h=t.line===1?n:0,m=t.column+h,v=`${e.name}:${c}:${m}
177
+ `)},kj=0,Cc=[];function Ej(e){var t=C.useRef([]),n=C.useRef([0,0]),i=C.useRef(),r=C.useState(kj++)[0],s=C.useState(dN)[0],c=C.useRef(e);C.useEffect(function(){c.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var O=q4([e.lockRef.current],(e.shards||[]).map(yN),!0).filter(Boolean);return O.forEach(function(_){return _.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),O.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var h=C.useCallback(function(O,_){if("touches"in O&&O.touches.length===2||O.type==="wheel"&&O.ctrlKey)return!c.current.allowPinchZoom;var M=eg(O),I=n.current,j="deltaX"in O?O.deltaX:I[0]-M[0],H="deltaY"in O?O.deltaY:I[1]-M[1],U,$=O.target,L=Math.abs(j)>Math.abs(H)?"h":"v";if("touches"in O&&L==="h"&&$.type==="range")return!1;var Q=pN(L,$);if(!Q)return!0;if(Q?U=L:(U=L==="v"?"h":"v",Q=pN(L,$)),!Q)return!1;if(!i.current&&"changedTouches"in O&&(j||H)&&(i.current=U),!U)return!0;var re=i.current||U;return Aj(re,_,O,re==="h"?j:H)},[]),m=C.useCallback(function(O){var _=O;if(!(!Cc.length||Cc[Cc.length-1]!==s)){var M="deltaY"in _?vN(_):eg(_),I=t.current.filter(function(U){return U.name===_.type&&(U.target===_.target||_.target===U.shadowParent)&&Oj(U.delta,M)})[0];if(I&&I.should){_.cancelable&&_.preventDefault();return}if(!I){var j=(c.current.shards||[]).map(yN).filter(Boolean).filter(function(U){return U.contains(_.target)}),H=j.length>0?h(_,j[0]):!c.current.noIsolation;H&&_.cancelable&&_.preventDefault()}}},[]),v=C.useCallback(function(O,_,M,I){var j={name:O,delta:_,target:M,should:I,shadowParent:Dj(M)};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(H){return H!==j})},1)},[]),b=C.useCallback(function(O){n.current=eg(O),i.current=void 0},[]),w=C.useCallback(function(O){v(O.type,vN(O),O.target,h(O,e.lockRef.current))},[]),S=C.useCallback(function(O){v(O.type,eg(O),O.target,h(O,e.lockRef.current))},[]);C.useEffect(function(){return Cc.push(s),e.setCallbacks({onScrollCapture:w,onWheelCapture:w,onTouchMoveCapture:S}),document.addEventListener("wheel",m,Tc),document.addEventListener("touchmove",m,Tc),document.addEventListener("touchstart",b,Tc),function(){Cc=Cc.filter(function(O){return O!==s}),document.removeEventListener("wheel",m,Tc),document.removeEventListener("touchmove",m,Tc),document.removeEventListener("touchstart",b,Tc)}},[]);var N=e.removeScrollBar,A=e.inert;return C.createElement(C.Fragment,null,A?C.createElement(s,{styles:Nj(r)}):null,N?C.createElement(gj,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Dj(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const _j=rj(cN,Ej);var bN=C.forwardRef(function(e,t){return C.createElement(Xm,qa({},e,{ref:t,sideCar:_j}))});bN.classNames=Xm.classNames;var Tj=[" ","Enter","ArrowUp","ArrowDown"],Cj=[" ","Enter"],Ul="Select",[tg,ng,zj]=dO(Ul),[zc,CW]=Ac(Ul,[zj,VO]),rg=VO(),[Ij,Ds]=zc(Ul),[Mj,Rj]=zc(Ul),wN=e=>{const{__scopeSelect:t,children:n,open:i,defaultOpen:r,onOpenChange:s,value:c,defaultValue:h,onValueChange:m,dir:v,name:b,autoComplete:w,disabled:S,required:N,form:A}=e,O=rg(t),[_,M]=C.useState(null),[I,j]=C.useState(null),[H,U]=C.useState(!1),$=n0(v),[L,Q]=Ym({prop:i,defaultProp:r??!1,onChange:s,caller:Ul}),[re,W]=Ym({prop:c,defaultProp:h,onChange:m,caller:Ul}),X=C.useRef(null),ne=_?A||!!_.closest("form"):!0,[F,V]=C.useState(new Set),te=Array.from(F).map(P=>P.props.value).join(";");return E.jsx(R4,{...O,children:E.jsxs(Ij,{required:N,scope:t,trigger:_,onTriggerChange:M,valueNode:I,onValueNodeChange:j,valueNodeHasChildren:H,onValueNodeHasChildrenChange:U,contentId:jm(),value:re,onValueChange:W,open:L,onOpenChange:Q,dir:$,triggerPointerDownPosRef:X,disabled:S,children:[E.jsx(tg.Provider,{scope:t,children:E.jsx(Mj,{scope:e.__scopeSelect,onNativeOptionAdd:C.useCallback(P=>{V(ee=>new Set(ee).add(P))},[]),onNativeOptionRemove:C.useCallback(P=>{V(ee=>{const Y=new Set(ee);return Y.delete(P),Y})},[]),children:n})}),ne?E.jsxs(FN,{"aria-hidden":!0,required:N,tabIndex:-1,name:b,autoComplete:w,value:re,onChange:P=>W(P.target.value),disabled:S,form:A,children:[re===void 0?E.jsx("option",{value:""}):null,Array.from(F)]},te):null]})})};wN.displayName=Ul;var xN="SelectTrigger",SN=C.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:i=!1,...r}=e,s=rg(n),c=Ds(xN,n),h=c.disabled||i,m=Mn(t,c.onTriggerChange),v=ng(n),b=C.useRef("touch"),[w,S,N]=QN(O=>{const _=v().filter(j=>!j.disabled),M=_.find(j=>j.value===c.value),I=GN(_,O,M);I!==void 0&&c.onValueChange(I.value)}),A=O=>{h||(c.onOpenChange(!0),N()),O&&(c.triggerPointerDownPosRef.current={x:Math.round(O.pageX),y:Math.round(O.pageY)})};return E.jsx(j4,{asChild:!0,...s,children:E.jsx(hn.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:h,"data-disabled":h?"":void 0,"data-placeholder":HN(c.value)?"":void 0,...r,ref:m,onClick:an(r.onClick,O=>{O.currentTarget.focus(),b.current!=="mouse"&&A(O)}),onPointerDown:an(r.onPointerDown,O=>{b.current=O.pointerType;const _=O.target;_.hasPointerCapture(O.pointerId)&&_.releasePointerCapture(O.pointerId),O.button===0&&O.ctrlKey===!1&&O.pointerType==="mouse"&&(A(O),O.preventDefault())}),onKeyDown:an(r.onKeyDown,O=>{const _=w.current!=="";!(O.ctrlKey||O.altKey||O.metaKey)&&O.key.length===1&&S(O.key),!(_&&O.key===" ")&&Tj.includes(O.key)&&(A(),O.preventDefault())})})})});SN.displayName=xN;var AN="SelectValue",ON=C.forwardRef((e,t)=>{const{__scopeSelect:n,className:i,style:r,children:s,placeholder:c="",...h}=e,m=Ds(AN,n),{onValueNodeHasChildrenChange:v}=m,b=s!==void 0,w=Mn(t,m.onValueNodeChange);return Br(()=>{v(b)},[v,b]),E.jsx(hn.span,{...h,ref:w,style:{pointerEvents:"none"},children:HN(m.value)?E.jsx(E.Fragment,{children:c}):s})});ON.displayName=AN;var jj="SelectIcon",NN=C.forwardRef((e,t)=>{const{__scopeSelect:n,children:i,...r}=e;return E.jsx(hn.span,{"aria-hidden":!0,...r,ref:t,children:i||"▼"})});NN.displayName=jj;var Ll="SelectContent",kN=C.forwardRef((e,t)=>{const n=Ds(Ll,e.__scopeSelect),[i,r]=C.useState();if(Br(()=>{r(new DocumentFragment)},[]),!n.open){const s=i;return s?Uf.createPortal(E.jsx(EN,{scope:e.__scopeSelect,children:E.jsx(tg.Slot,{scope:e.__scopeSelect,children:E.jsx("div",{children:e.children})})}),s):null}return E.jsx(DN,{...e,ref:t})});kN.displayName=Ll;var ma=10,[EN,_s]=zc(Ll),Pj="SelectContentImpl",Uj=If("SelectContent.RemoveScroll"),DN=C.forwardRef((e,t)=>{const{__scopeSelect:n,position:i="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:c,side:h,sideOffset:m,align:v,alignOffset:b,arrowPadding:w,collisionBoundary:S,collisionPadding:N,sticky:A,hideWhenDetached:O,avoidCollisions:_,...M}=e,I=Ds(Ll,n),[j,H]=C.useState(null),[U,$]=C.useState(null),L=Mn(t,Te=>H(Te)),[Q,re]=C.useState(null),[W,X]=C.useState(null),ne=ng(n),[F,V]=C.useState(!1),te=C.useRef(!1);C.useEffect(()=>{if(j)return Y4(j)},[j]),s6();const P=C.useCallback(Te=>{const[Be,...ot]=ne().map(wt=>wt.ref.current),[dt]=ot.slice(-1),ht=document.activeElement;for(const wt of Te)if(wt===ht||(wt?.scrollIntoView({block:"nearest"}),wt===Be&&U&&(U.scrollTop=0),wt===dt&&U&&(U.scrollTop=U.scrollHeight),wt?.focus(),document.activeElement!==ht))return},[ne,U]),ee=C.useCallback(()=>P([Q,j]),[P,Q,j]);C.useEffect(()=>{F&&ee()},[F,ee]);const{onOpenChange:Y,triggerPointerDownPosRef:me}=I;C.useEffect(()=>{if(j){let Te={x:0,y:0};const Be=dt=>{Te={x:Math.abs(Math.round(dt.pageX)-(me.current?.x??0)),y:Math.abs(Math.round(dt.pageY)-(me.current?.y??0))}},ot=dt=>{Te.x<=10&&Te.y<=10?dt.preventDefault():j.contains(dt.target)||Y(!1),document.removeEventListener("pointermove",Be),me.current=null};return me.current!==null&&(document.addEventListener("pointermove",Be),document.addEventListener("pointerup",ot,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Be),document.removeEventListener("pointerup",ot,{capture:!0})}}},[j,Y,me]),C.useEffect(()=>{const Te=()=>Y(!1);return window.addEventListener("blur",Te),window.addEventListener("resize",Te),()=>{window.removeEventListener("blur",Te),window.removeEventListener("resize",Te)}},[Y]);const[B,ae]=QN(Te=>{const Be=ne().filter(ht=>!ht.disabled),ot=Be.find(ht=>ht.ref.current===document.activeElement),dt=GN(Be,Te,ot);dt&&setTimeout(()=>dt.ref.current.focus())}),Ne=C.useCallback((Te,Be,ot)=>{const dt=!te.current&&!ot;(I.value!==void 0&&I.value===Be||dt)&&(re(Te),dt&&(te.current=!0))},[I.value]),be=C.useCallback(()=>j?.focus(),[j]),De=C.useCallback((Te,Be,ot)=>{const dt=!te.current&&!ot;(I.value!==void 0&&I.value===Be||dt)&&X(Te)},[I.value]),Re=i==="popper"?N0:_N,je=Re===N0?{side:h,sideOffset:m,align:v,alignOffset:b,arrowPadding:w,collisionBoundary:S,collisionPadding:N,sticky:A,hideWhenDetached:O,avoidCollisions:_}:{};return E.jsx(EN,{scope:n,content:j,viewport:U,onViewportChange:$,itemRefCallback:Ne,selectedItem:Q,onItemLeave:be,itemTextRefCallback:De,focusSelectedItem:ee,selectedItemText:W,position:i,isPositioned:F,searchRef:B,children:E.jsx(bN,{as:Uj,allowPinchZoom:!0,children:E.jsx(bO,{asChild:!0,trapped:I.open,onMountAutoFocus:Te=>{Te.preventDefault()},onUnmountAutoFocus:an(r,Te=>{I.trigger?.focus({preventScroll:!0}),Te.preventDefault()}),children:E.jsx(pO,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:Te=>Te.preventDefault(),onDismiss:()=>I.onOpenChange(!1),children:E.jsx(Re,{role:"listbox",id:I.contentId,"data-state":I.open?"open":"closed",dir:I.dir,onContextMenu:Te=>Te.preventDefault(),...M,...je,onPlaced:()=>V(!0),ref:L,style:{display:"flex",flexDirection:"column",outline:"none",...M.style},onKeyDown:an(M.onKeyDown,Te=>{const Be=Te.ctrlKey||Te.altKey||Te.metaKey;if(Te.key==="Tab"&&Te.preventDefault(),!Be&&Te.key.length===1&&ae(Te.key),["ArrowUp","ArrowDown","Home","End"].includes(Te.key)){let dt=ne().filter(ht=>!ht.disabled).map(ht=>ht.ref.current);if(["ArrowUp","End"].includes(Te.key)&&(dt=dt.slice().reverse()),["ArrowUp","ArrowDown"].includes(Te.key)){const ht=Te.target,wt=dt.indexOf(ht);dt=dt.slice(wt+1)}setTimeout(()=>P(dt)),Te.preventDefault()}})})})})})})});DN.displayName=Pj;var Lj="SelectItemAlignedPosition",_N=C.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:i,...r}=e,s=Ds(Ll,n),c=_s(Ll,n),[h,m]=C.useState(null),[v,b]=C.useState(null),w=Mn(t,L=>b(L)),S=ng(n),N=C.useRef(!1),A=C.useRef(!0),{viewport:O,selectedItem:_,selectedItemText:M,focusSelectedItem:I}=c,j=C.useCallback(()=>{if(s.trigger&&s.valueNode&&h&&v&&O&&_&&M){const L=s.trigger.getBoundingClientRect(),Q=v.getBoundingClientRect(),re=s.valueNode.getBoundingClientRect(),W=M.getBoundingClientRect();if(s.dir!=="rtl"){const ht=W.left-Q.left,wt=re.left-ht,vn=L.left-wt,Vt=L.width+vn,cr=Math.max(Vt,Q.width),Mi=window.innerWidth-ma,en=cO(wt,[ma,Math.max(ma,Mi-cr)]);h.style.minWidth=Vt+"px",h.style.left=en+"px"}else{const ht=Q.right-W.right,wt=window.innerWidth-re.right-ht,vn=window.innerWidth-L.right-wt,Vt=L.width+vn,cr=Math.max(Vt,Q.width),Mi=window.innerWidth-ma,en=cO(wt,[ma,Math.max(ma,Mi-cr)]);h.style.minWidth=Vt+"px",h.style.right=en+"px"}const X=S(),ne=window.innerHeight-ma*2,F=O.scrollHeight,V=window.getComputedStyle(v),te=parseInt(V.borderTopWidth,10),P=parseInt(V.paddingTop,10),ee=parseInt(V.borderBottomWidth,10),Y=parseInt(V.paddingBottom,10),me=te+P+F+Y+ee,B=Math.min(_.offsetHeight*5,me),ae=window.getComputedStyle(O),Ne=parseInt(ae.paddingTop,10),be=parseInt(ae.paddingBottom,10),De=L.top+L.height/2-ma,Re=ne-De,je=_.offsetHeight/2,Te=_.offsetTop+je,Be=te+P+Te,ot=me-Be;if(Be<=De){const ht=X.length>0&&_===X[X.length-1].ref.current;h.style.bottom="0px";const wt=v.clientHeight-O.offsetTop-O.offsetHeight,vn=Math.max(Re,je+(ht?be:0)+wt+ee),Vt=Be+vn;h.style.height=Vt+"px"}else{const ht=X.length>0&&_===X[0].ref.current;h.style.top="0px";const vn=Math.max(De,te+O.offsetTop+(ht?Ne:0)+je)+ot;h.style.height=vn+"px",O.scrollTop=Be-De+O.offsetTop}h.style.margin=`${ma}px 0`,h.style.minHeight=B+"px",h.style.maxHeight=ne+"px",i?.(),requestAnimationFrame(()=>N.current=!0)}},[S,s.trigger,s.valueNode,h,v,O,_,M,s.dir,i]);Br(()=>j(),[j]);const[H,U]=C.useState();Br(()=>{v&&U(window.getComputedStyle(v).zIndex)},[v]);const $=C.useCallback(L=>{L&&A.current===!0&&(j(),I?.(),A.current=!1)},[j,I]);return E.jsx(Fj,{scope:n,contentWrapper:h,shouldExpandOnScrollRef:N,onScrollButtonChange:$,children:E.jsx("div",{ref:m,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:H},children:E.jsx(hn.div,{...r,ref:w,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});_N.displayName=Lj;var Bj="SelectPopperPosition",N0=C.forwardRef((e,t)=>{const{__scopeSelect:n,align:i="start",collisionPadding:r=ma,...s}=e,c=rg(n);return E.jsx(P4,{...c,...s,ref:t,align:i,collisionPadding:r,style:{boxSizing:"border-box",...s.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)"}})});N0.displayName=Bj;var[Fj,k0]=zc(Ll,{}),E0="SelectViewport",TN=C.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:i,...r}=e,s=_s(E0,n),c=k0(E0,n),h=Mn(t,s.onViewportChange),m=C.useRef(0);return E.jsxs(E.Fragment,{children:[E.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),E.jsx(tg.Slot,{scope:n,children:E.jsx(hn.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:h,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:an(r.onScroll,v=>{const b=v.currentTarget,{contentWrapper:w,shouldExpandOnScrollRef:S}=c;if(S?.current&&w){const N=Math.abs(m.current-b.scrollTop);if(N>0){const A=window.innerHeight-ma*2,O=parseFloat(w.style.minHeight),_=parseFloat(w.style.height),M=Math.max(O,_);if(M<A){const I=M+N,j=Math.min(A,I),H=I-j;w.style.height=j+"px",w.style.bottom==="0px"&&(b.scrollTop=H>0?H:0,w.style.justifyContent="flex-end")}}}m.current=b.scrollTop})})})]})});TN.displayName=E0;var CN="SelectGroup",[Hj,Qj]=zc(CN),Gj=C.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e,r=jm();return E.jsx(Hj,{scope:n,id:r,children:E.jsx(hn.div,{role:"group","aria-labelledby":r,...i,ref:t})})});Gj.displayName=CN;var zN="SelectLabel",Zj=C.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e,r=Qj(zN,n);return E.jsx(hn.div,{id:r.id,...i,ref:t})});Zj.displayName=zN;var ig="SelectItem",[Wj,IN]=zc(ig),MN=C.forwardRef((e,t)=>{const{__scopeSelect:n,value:i,disabled:r=!1,textValue:s,...c}=e,h=Ds(ig,n),m=_s(ig,n),v=h.value===i,[b,w]=C.useState(s??""),[S,N]=C.useState(!1),A=Mn(t,I=>m.itemRefCallback?.(I,i,r)),O=jm(),_=C.useRef("touch"),M=()=>{r||(h.onValueChange(i),h.onOpenChange(!1))};if(i==="")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 E.jsx(Wj,{scope:n,value:i,disabled:r,textId:O,isSelected:v,onItemTextChange:C.useCallback(I=>{w(j=>j||(I?.textContent??"").trim())},[]),children:E.jsx(tg.ItemSlot,{scope:n,value:i,disabled:r,textValue:b,children:E.jsx(hn.div,{role:"option","aria-labelledby":O,"data-highlighted":S?"":void 0,"aria-selected":v&&S,"data-state":v?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...c,ref:A,onFocus:an(c.onFocus,()=>N(!0)),onBlur:an(c.onBlur,()=>N(!1)),onClick:an(c.onClick,()=>{_.current!=="mouse"&&M()}),onPointerUp:an(c.onPointerUp,()=>{_.current==="mouse"&&M()}),onPointerDown:an(c.onPointerDown,I=>{_.current=I.pointerType}),onPointerMove:an(c.onPointerMove,I=>{_.current=I.pointerType,r?m.onItemLeave?.():_.current==="mouse"&&I.currentTarget.focus({preventScroll:!0})}),onPointerLeave:an(c.onPointerLeave,I=>{I.currentTarget===document.activeElement&&m.onItemLeave?.()}),onKeyDown:an(c.onKeyDown,I=>{m.searchRef?.current!==""&&I.key===" "||(Cj.includes(I.key)&&M(),I.key===" "&&I.preventDefault())})})})})});MN.displayName=ig;var Hf="SelectItemText",RN=C.forwardRef((e,t)=>{const{__scopeSelect:n,className:i,style:r,...s}=e,c=Ds(Hf,n),h=_s(Hf,n),m=IN(Hf,n),v=Rj(Hf,n),[b,w]=C.useState(null),S=Mn(t,M=>w(M),m.onItemTextChange,M=>h.itemTextRefCallback?.(M,m.value,m.disabled)),N=b?.textContent,A=C.useMemo(()=>E.jsx("option",{value:m.value,disabled:m.disabled,children:N},m.value),[m.disabled,m.value,N]),{onNativeOptionAdd:O,onNativeOptionRemove:_}=v;return Br(()=>(O(A),()=>_(A)),[O,_,A]),E.jsxs(E.Fragment,{children:[E.jsx(hn.span,{id:m.textId,...s,ref:S}),m.isSelected&&c.valueNode&&!c.valueNodeHasChildren?Uf.createPortal(s.children,c.valueNode):null]})});RN.displayName=Hf;var jN="SelectItemIndicator",PN=C.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e;return IN(jN,n).isSelected?E.jsx(hn.span,{"aria-hidden":!0,...i,ref:t}):null});PN.displayName=jN;var D0="SelectScrollUpButton",UN=C.forwardRef((e,t)=>{const n=_s(D0,e.__scopeSelect),i=k0(D0,e.__scopeSelect),[r,s]=C.useState(!1),c=Mn(t,i.onScrollButtonChange);return Br(()=>{if(n.viewport&&n.isPositioned){let h=function(){const v=m.scrollTop>0;s(v)};const m=n.viewport;return h(),m.addEventListener("scroll",h),()=>m.removeEventListener("scroll",h)}},[n.viewport,n.isPositioned]),r?E.jsx(BN,{...e,ref:c,onAutoScroll:()=>{const{viewport:h,selectedItem:m}=n;h&&m&&(h.scrollTop=h.scrollTop-m.offsetHeight)}}):null});UN.displayName=D0;var _0="SelectScrollDownButton",LN=C.forwardRef((e,t)=>{const n=_s(_0,e.__scopeSelect),i=k0(_0,e.__scopeSelect),[r,s]=C.useState(!1),c=Mn(t,i.onScrollButtonChange);return Br(()=>{if(n.viewport&&n.isPositioned){let h=function(){const v=m.scrollHeight-m.clientHeight,b=Math.ceil(m.scrollTop)<v;s(b)};const m=n.viewport;return h(),m.addEventListener("scroll",h),()=>m.removeEventListener("scroll",h)}},[n.viewport,n.isPositioned]),r?E.jsx(BN,{...e,ref:c,onAutoScroll:()=>{const{viewport:h,selectedItem:m}=n;h&&m&&(h.scrollTop=h.scrollTop+m.offsetHeight)}}):null});LN.displayName=_0;var BN=C.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:i,...r}=e,s=_s("SelectScrollButton",n),c=C.useRef(null),h=ng(n),m=C.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return C.useEffect(()=>()=>m(),[m]),Br(()=>{h().find(b=>b.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[h]),E.jsx(hn.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:an(r.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(i,50))}),onPointerMove:an(r.onPointerMove,()=>{s.onItemLeave?.(),c.current===null&&(c.current=window.setInterval(i,50))}),onPointerLeave:an(r.onPointerLeave,()=>{m()})})}),Yj="SelectSeparator",qj=C.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e;return E.jsx(hn.div,{"aria-hidden":!0,...i,ref:t})});qj.displayName=Yj;var T0="SelectArrow",Vj=C.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e,r=rg(n),s=Ds(T0,n),c=_s(T0,n);return s.open&&c.position==="popper"?E.jsx(U4,{...r,...i,ref:t}):null});Vj.displayName=T0;var $j="SelectBubbleInput",FN=C.forwardRef(({__scopeSelect:e,value:t,...n},i)=>{const r=C.useRef(null),s=Mn(i,r),c=iN(t);return C.useEffect(()=>{const h=r.current;if(!h)return;const m=window.HTMLSelectElement.prototype,b=Object.getOwnPropertyDescriptor(m,"value").set;if(c!==t&&b){const w=new Event("change",{bubbles:!0});b.call(h,t),h.dispatchEvent(w)}},[c,t]),E.jsx(hn.select,{...n,style:{...aN,...n.style},ref:s,defaultValue:t})});FN.displayName=$j;function HN(e){return e===""||e===void 0}function QN(e){const t=Os(e),n=C.useRef(""),i=C.useRef(0),r=C.useCallback(c=>{const h=n.current+c;t(h),(function m(v){n.current=v,window.clearTimeout(i.current),v!==""&&(i.current=window.setTimeout(()=>m(""),1e3))})(h)},[t]),s=C.useCallback(()=>{n.current="",window.clearTimeout(i.current)},[]);return C.useEffect(()=>()=>window.clearTimeout(i.current),[]),[n,r,s]}function GN(e,t,n){const r=t.length>1&&Array.from(t).every(v=>v===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let c=Kj(e,Math.max(s,0));r.length===1&&(c=c.filter(v=>v!==n));const m=c.find(v=>v.textValue.toLowerCase().startsWith(r.toLowerCase()));return m!==n?m:void 0}function Kj(e,t){return e.map((n,i)=>e[(t+i)%e.length])}var Xj=wN,Jj=SN,eP=ON,tP=NN,nP=kN,rP=TN,iP=MN,aP=RN,oP=PN,sP=UN,lP=LN;function uP({...e}){return E.jsx(Xj,{"data-slot":"select",...e})}function cP({...e}){return E.jsx(eP,{"data-slot":"select-value",...e})}function dP({className:e,size:t="default",children:n,...i}){return E.jsxs(Jj,{"data-slot":"select-trigger","data-size":t,className:bt("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-brand border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-12 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...i,children:[n,E.jsx(tP,{asChild:!0,children:E.jsx(VA,{className:"size-4 opacity-50"})})]})}function fP({className:e,children:t,position:n="popper",...i}){return E.jsxs(nP,{"data-slot":"select-content",className:bt("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-[99999] max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...i,children:[E.jsx(hP,{}),E.jsx(rP,{className:bt("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),E.jsx(pP,{})]})}function ZN({className:e,children:t,...n}){return E.jsxs(iP,{"data-slot":"select-item",className:bt("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[E.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:E.jsx(oP,{children:E.jsx(mR,{className:"size-4"})})}),E.jsx(aP,{children:t})]})}function hP({className:e,...t}){return E.jsx(sP,{"data-slot":"select-scroll-up-button",className:bt("flex cursor-default items-center justify-center py-1",e),...t,children:E.jsx(gR,{className:"size-4"})})}function pP({className:e,...t}){return E.jsx(lP,{"data-slot":"select-scroll-down-button",className:bt("flex cursor-default items-center justify-center py-1",e),...t,children:E.jsx(VA,{className:"size-4"})})}const mP=e=>typeof e=="object"&&e!==null&&("disabled"in e?typeof e.disabled=="boolean":!0),gP=({size:e="default",onChange:t,options:n,getValue:i,getLabel:r,placeholder:s,onBlur:c,noOptionsText:h,...m})=>E.jsxs(uP,{...m,onValueChange:v=>{t?.(v)},children:[E.jsx(dP,{size:e,children:E.jsx(cP,{onBlur:c,placeholder:s})}),E.jsx(fP,{position:"popper",children:n.length===0?E.jsx(ZN,{value:"No options",disabled:!0,children:h||"No options available"}):n.map(v=>E.jsx(ZN,{value:i(v),disabled:mP(v)?v.disabled:void 0,children:r(v)},i(v)))})]}),vP=[{label:"EN",value:"en"},{label:"IT",value:"it"}],yP=()=>{const{i18n:e}=Tn(),[t,n]=C.useState(e.language),i=r=>{e.changeLanguage(r),n(r)};return E.jsx(gP,{size:"sm",options:vP,getLabel:({label:r})=>r,getValue:({value:r})=>r,value:t,onChange:i})},bP=({showBackButton:e=!1,onBack:t})=>{const{t:n}=Tn(),i=C.useContext(WA);return E.jsxs("div",{className:bt("flex bg-background py-1 px-4 justify-end sticky z-20 top-0 gap-4 border-b",e&&"justify-between"),children:[e&&E.jsx(mr,{"aria-label":n("go_back"),variant:"ghost",size:"icon",onClick:t,children:E.jsx(hR,{})}),E.jsxs("div",{className:"flex gap-4",children:[E.jsx(yP,{}),E.jsx(mr,{"aria-label":n("close_drawer"),variant:"ghost",size:"icon",onClick:i?.close,children:E.jsx(KA,{})})]})]})},WN=2147483647,wP=({direction:e,open:t,setOpen:n,children:i,disableFocusTrap:r=!1,showHeaderBackButton:s=!1,onBack:c})=>{const h=C.useRef(null);return C.useEffect(()=>{t?(document.body.style.overflow="hidden",h.current?.focus()):document.body.style.overflow="auto"},[t]),E.jsx(WA.Provider,{value:{close:()=>n(!1)},children:E.jsxs("div",{children:[E.jsx(xP,{open:t}),E.jsx(ZA.FocusTrap,{active:!r&&t,children:E.jsxs("div",{ref:h,className:bt("bg-background fixed flex flex-col top-0 bottom-0 w-full sm:max-w-[400px] transition-all duration-300 sm:shadow-xl overflow-hidden",`z-[${WN}]`,e==="left"?"left-0":"right-0",t?e==="left"?"left-0":"right-0":e==="left"?"-left-full":"-right-full"),children:[E.jsx(bP,{showBackButton:s,onBack:c}),E.jsx("div",{className:"flex flex-1 flex-col overflow-scroll",children:i})]})})]})})},xP=({open:e})=>E.jsx("div",{className:bt("bg-foreground/50 fixed flex top-0 left-0 flex-col w-full h-full",e?"block":"hidden",`z-[${WN-1}]`)});class Bl extends Error{response;request;constructor(t,n){const i=`${Bl.extractMessage(t)}: ${JSON.stringify({response:t,request:n})}`;super(i),Object.setPrototypeOf(this,Bl.prototype),this.response=t,this.request=n,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Bl)}static extractMessage(t){return t.errors?.[0]?.message??`GraphQL Error (Code: ${String(t.status)})`}}const YN=e=>e.toUpperCase(),C0=e=>typeof e=="function"?e():e,qN=(e,t)=>e.map((n,i)=>[n,t[i]]),Ic=e=>{let t={};return e instanceof Headers?t=SP(e):Array.isArray(e)?e.forEach(([n,i])=>{n&&i!==void 0&&(t[n]=i)}):e&&(t=e),t},SP=e=>{const t={};return e.forEach((n,i)=>{t[i]=n}),t},AP=e=>{try{const t=e();return OP(t)?t.catch(n=>VN(n)):t}catch(t){return VN(t)}},VN=e=>e instanceof Error?e:new Error(String(e)),OP=e=>typeof e=="object"&&e!==null&&"then"in e&&typeof e.then=="function"&&"catch"in e&&typeof e.catch=="function"&&"finally"in e&&typeof e.finally=="function",z0=e=>{throw new Error(`Unhandled case: ${String(e)}`)},ag=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),NP=(e,t)=>e.documents?e:{documents:e,requestHeaders:t,signal:void 0},kP=(e,t,n)=>e.query?e:{query:e,variables:t,requestHeaders:n,signal:void 0};function og(e,t){if(!!!e)throw new Error(t)}function EP(e){return typeof e=="object"&&e!==null}function DP(e,t){if(!!!e)throw new Error("Unexpected invariant triggered.")}const _P=/\r\n|[\n\r]/g;function I0(e,t){let n=0,i=1;for(const r of e.body.matchAll(_P)){if(typeof r.index=="number"||DP(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}function TP(e){return $N(e.source,I0(e.source,e.start))}function $N(e,t){const n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,s=e.locationOffset.line-1,c=t.line+s,h=t.line===1?n:0,m=t.column+h,v=`${e.name}:${c}:${m}
178
178
  `,b=i.split(/\r\n|[\n\r]/g),w=b[r];if(w.length>120){const S=Math.floor(m/80),N=m%80,A=[];for(let O=0;O<w.length;O+=80)A.push(w.slice(O,O+80));return v+KN([[`${c} |`,A[0]],...A.slice(1,S+1).map(O=>["|",O]),["|","^".padStart(N)],["|",A[S+1]]])}return v+KN([[`${c-1} |`,b[r-1]],[`${c} |`,w],["|","^".padStart(m)],[`${c+1} |`,b[r+1]]])}function KN(e){const t=e.filter(([i,r])=>r!==void 0),n=Math.max(...t.map(([i])=>i.length));return t.map(([i,r])=>i.padStart(n)+(r?" "+r:"")).join(`
179
179
  `)}function CP(e){const t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}class M0 extends Error{constructor(t,...n){var i,r,s;const{nodes:c,source:h,positions:m,path:v,originalError:b,extensions:w}=CP(n);super(t),this.name="GraphQLError",this.path=v??void 0,this.originalError=b??void 0,this.nodes=XN(Array.isArray(c)?c:c?[c]:void 0);const S=XN((i=this.nodes)===null||i===void 0?void 0:i.map(A=>A.loc).filter(A=>A!=null));this.source=h??(S==null||(r=S[0])===null||r===void 0?void 0:r.source),this.positions=m??S?.map(A=>A.start),this.locations=m&&h?m.map(A=>I0(h,A)):S?.map(A=>I0(A.source,A.start));const N=EP(b?.extensions)?b?.extensions:void 0;this.extensions=(s=w??N)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),b!=null&&b.stack?Object.defineProperty(this,"stack",{value:b.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,M0):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(t+=`
180
180
 
@@ -174,7 +174,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
174
174
  `)},hN=function(){var e=parseInt(document.body.getAttribute(_c)||"0",10);return isFinite(e)?e:0},mj=function(){C.useEffect(function(){return document.body.setAttribute(_c,(hN()+1).toString()),function(){var e=hN()-1;e<=0?document.body.removeAttribute(_c):document.body.setAttribute(_c,e.toString())}},[])},gj=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,r=i===void 0?"margin":i;mj();var s=C.useMemo(function(){return fj(r)},[r]);return C.createElement(hj,{styles:pj(s,!t,r,n?"":"!important")})},N0=!1;if(typeof window<"u")try{var eg=Object.defineProperty({},"passive",{get:function(){return N0=!0,!0}});window.addEventListener("test",eg,eg),window.removeEventListener("test",eg,eg)}catch{N0=!1}var Tc=N0?{passive:!1}:!1,vj=function(e){return e.tagName==="TEXTAREA"},pN=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!vj(e)&&n[t]==="visible")},yj=function(e){return pN(e,"overflowY")},bj=function(e){return pN(e,"overflowX")},mN=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var r=gN(e,i);if(r){var s=vN(e,i),c=s[1],h=s[2];if(c>h)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},wj=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},xj=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},gN=function(e,t){return e==="v"?yj(t):bj(t)},vN=function(e,t){return e==="v"?wj(t):xj(t)},Sj=function(e,t){return e==="h"&&t==="rtl"?-1:1},Aj=function(e,t,n,i,r){var s=Sj(e,window.getComputedStyle(t).direction),c=s*i,h=n.target,m=t.contains(h),v=!1,b=c>0,w=0,S=0;do{if(!h)break;var N=vN(e,h),A=N[0],O=N[1],_=N[2],M=O-_-s*A;(A||M)&&gN(e,h)&&(w+=M,S+=A);var I=h.parentNode;h=I&&I.nodeType===Node.DOCUMENT_FRAGMENT_NODE?I.host:I}while(!m&&h!==document.body||m&&(t.contains(h)||t===h));return(b&&Math.abs(w)<1||!b&&Math.abs(S)<1)&&(v=!0),v},tg=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},yN=function(e){return[e.deltaX,e.deltaY]},bN=function(e){return e&&"current"in e?e.current:e},Oj=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Nj=function(e){return`
175
175
  .block-interactivity-`.concat(e,` {pointer-events: none;}
176
176
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
177
- `)},kj=0,Cc=[];function Ej(e){var t=C.useRef([]),n=C.useRef([0,0]),i=C.useRef(),r=C.useState(kj++)[0],s=C.useState(fN)[0],c=C.useRef(e);C.useEffect(function(){c.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var O=q4([e.lockRef.current],(e.shards||[]).map(bN),!0).filter(Boolean);return O.forEach(function(_){return _.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),O.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var h=C.useCallback(function(O,_){if("touches"in O&&O.touches.length===2||O.type==="wheel"&&O.ctrlKey)return!c.current.allowPinchZoom;var M=tg(O),I=n.current,j="deltaX"in O?O.deltaX:I[0]-M[0],H="deltaY"in O?O.deltaY:I[1]-M[1],U,$=O.target,L=Math.abs(j)>Math.abs(H)?"h":"v";if("touches"in O&&L==="h"&&$.type==="range")return!1;var Q=mN(L,$);if(!Q)return!0;if(Q?U=L:(U=L==="v"?"h":"v",Q=mN(L,$)),!Q)return!1;if(!i.current&&"changedTouches"in O&&(j||H)&&(i.current=U),!U)return!0;var re=i.current||U;return Aj(re,_,O,re==="h"?j:H)},[]),m=C.useCallback(function(O){var _=O;if(!(!Cc.length||Cc[Cc.length-1]!==s)){var M="deltaY"in _?yN(_):tg(_),I=t.current.filter(function(U){return U.name===_.type&&(U.target===_.target||_.target===U.shadowParent)&&Oj(U.delta,M)})[0];if(I&&I.should){_.cancelable&&_.preventDefault();return}if(!I){var j=(c.current.shards||[]).map(bN).filter(Boolean).filter(function(U){return U.contains(_.target)}),H=j.length>0?h(_,j[0]):!c.current.noIsolation;H&&_.cancelable&&_.preventDefault()}}},[]),v=C.useCallback(function(O,_,M,I){var j={name:O,delta:_,target:M,should:I,shadowParent:Dj(M)};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(H){return H!==j})},1)},[]),b=C.useCallback(function(O){n.current=tg(O),i.current=void 0},[]),w=C.useCallback(function(O){v(O.type,yN(O),O.target,h(O,e.lockRef.current))},[]),S=C.useCallback(function(O){v(O.type,tg(O),O.target,h(O,e.lockRef.current))},[]);C.useEffect(function(){return Cc.push(s),e.setCallbacks({onScrollCapture:w,onWheelCapture:w,onTouchMoveCapture:S}),document.addEventListener("wheel",m,Tc),document.addEventListener("touchmove",m,Tc),document.addEventListener("touchstart",b,Tc),function(){Cc=Cc.filter(function(O){return O!==s}),document.removeEventListener("wheel",m,Tc),document.removeEventListener("touchmove",m,Tc),document.removeEventListener("touchstart",b,Tc)}},[]);var N=e.removeScrollBar,A=e.inert;return C.createElement(C.Fragment,null,A?C.createElement(s,{styles:Nj(r)}):null,N?C.createElement(gj,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Dj(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const _j=rj(dN,Ej);var wN=C.forwardRef(function(e,t){return C.createElement(Jm,qa({},e,{ref:t,sideCar:_j}))});wN.classNames=Jm.classNames;var Tj=[" ","Enter","ArrowUp","ArrowDown"],Cj=[" ","Enter"],Ul="Select",[ng,rg,zj]=fO(Ul),[zc,CW]=Ac(Ul,[zj,$O]),ig=$O(),[Ij,Ds]=zc(Ul),[Mj,Rj]=zc(Ul),xN=e=>{const{__scopeSelect:t,children:n,open:i,defaultOpen:r,onOpenChange:s,value:c,defaultValue:h,onValueChange:m,dir:v,name:b,autoComplete:w,disabled:S,required:N,form:A}=e,O=ig(t),[_,M]=C.useState(null),[I,j]=C.useState(null),[H,U]=C.useState(!1),$=r0(v),[L,Q]=qm({prop:i,defaultProp:r??!1,onChange:s,caller:Ul}),[re,W]=qm({prop:c,defaultProp:h,onChange:m,caller:Ul}),X=C.useRef(null),ne=_?A||!!_.closest("form"):!0,[F,V]=C.useState(new Set),te=Array.from(F).map(P=>P.props.value).join(";");return E.jsx(R4,{...O,children:E.jsxs(Ij,{required:N,scope:t,trigger:_,onTriggerChange:M,valueNode:I,onValueNodeChange:j,valueNodeHasChildren:H,onValueNodeHasChildrenChange:U,contentId:Pm(),value:re,onValueChange:W,open:L,onOpenChange:Q,dir:$,triggerPointerDownPosRef:X,disabled:S,children:[E.jsx(ng.Provider,{scope:t,children:E.jsx(Mj,{scope:e.__scopeSelect,onNativeOptionAdd:C.useCallback(P=>{V(ee=>new Set(ee).add(P))},[]),onNativeOptionRemove:C.useCallback(P=>{V(ee=>{const Y=new Set(ee);return Y.delete(P),Y})},[]),children:n})}),ne?E.jsxs(HN,{"aria-hidden":!0,required:N,tabIndex:-1,name:b,autoComplete:w,value:re,onChange:P=>W(P.target.value),disabled:S,form:A,children:[re===void 0?E.jsx("option",{value:""}):null,Array.from(F)]},te):null]})})};xN.displayName=Ul;var SN="SelectTrigger",AN=C.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:i=!1,...r}=e,s=ig(n),c=Ds(SN,n),h=c.disabled||i,m=Mn(t,c.onTriggerChange),v=rg(n),b=C.useRef("touch"),[w,S,N]=GN(O=>{const _=v().filter(j=>!j.disabled),M=_.find(j=>j.value===c.value),I=ZN(_,O,M);I!==void 0&&c.onValueChange(I.value)}),A=O=>{h||(c.onOpenChange(!0),N()),O&&(c.triggerPointerDownPosRef.current={x:Math.round(O.pageX),y:Math.round(O.pageY)})};return E.jsx(j4,{asChild:!0,...s,children:E.jsx(hn.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:h,"data-disabled":h?"":void 0,"data-placeholder":QN(c.value)?"":void 0,...r,ref:m,onClick:an(r.onClick,O=>{O.currentTarget.focus(),b.current!=="mouse"&&A(O)}),onPointerDown:an(r.onPointerDown,O=>{b.current=O.pointerType;const _=O.target;_.hasPointerCapture(O.pointerId)&&_.releasePointerCapture(O.pointerId),O.button===0&&O.ctrlKey===!1&&O.pointerType==="mouse"&&(A(O),O.preventDefault())}),onKeyDown:an(r.onKeyDown,O=>{const _=w.current!=="";!(O.ctrlKey||O.altKey||O.metaKey)&&O.key.length===1&&S(O.key),!(_&&O.key===" ")&&Tj.includes(O.key)&&(A(),O.preventDefault())})})})});AN.displayName=SN;var ON="SelectValue",NN=C.forwardRef((e,t)=>{const{__scopeSelect:n,className:i,style:r,children:s,placeholder:c="",...h}=e,m=Ds(ON,n),{onValueNodeHasChildrenChange:v}=m,b=s!==void 0,w=Mn(t,m.onValueNodeChange);return Br(()=>{v(b)},[v,b]),E.jsx(hn.span,{...h,ref:w,style:{pointerEvents:"none"},children:QN(m.value)?E.jsx(E.Fragment,{children:c}):s})});NN.displayName=ON;var jj="SelectIcon",kN=C.forwardRef((e,t)=>{const{__scopeSelect:n,children:i,...r}=e;return E.jsx(hn.span,{"aria-hidden":!0,...r,ref:t,children:i||"▼"})});kN.displayName=jj;var Ll="SelectContent",EN=C.forwardRef((e,t)=>{const n=Ds(Ll,e.__scopeSelect),[i,r]=C.useState();if(Br(()=>{r(new DocumentFragment)},[]),!n.open){const s=i;return s?Uf.createPortal(E.jsx(DN,{scope:e.__scopeSelect,children:E.jsx(ng.Slot,{scope:e.__scopeSelect,children:E.jsx("div",{children:e.children})})}),s):null}return E.jsx(_N,{...e,ref:t})});EN.displayName=Ll;var ma=10,[DN,_s]=zc(Ll),Pj="SelectContentImpl",Uj=If("SelectContent.RemoveScroll"),_N=C.forwardRef((e,t)=>{const{__scopeSelect:n,position:i="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:c,side:h,sideOffset:m,align:v,alignOffset:b,arrowPadding:w,collisionBoundary:S,collisionPadding:N,sticky:A,hideWhenDetached:O,avoidCollisions:_,...M}=e,I=Ds(Ll,n),[j,H]=C.useState(null),[U,$]=C.useState(null),L=Mn(t,Te=>H(Te)),[Q,re]=C.useState(null),[W,X]=C.useState(null),ne=rg(n),[F,V]=C.useState(!1),te=C.useRef(!1);C.useEffect(()=>{if(j)return Y4(j)},[j]),s6();const P=C.useCallback(Te=>{const[Be,...ot]=ne().map(wt=>wt.ref.current),[dt]=ot.slice(-1),ht=document.activeElement;for(const wt of Te)if(wt===ht||(wt?.scrollIntoView({block:"nearest"}),wt===Be&&U&&(U.scrollTop=0),wt===dt&&U&&(U.scrollTop=U.scrollHeight),wt?.focus(),document.activeElement!==ht))return},[ne,U]),ee=C.useCallback(()=>P([Q,j]),[P,Q,j]);C.useEffect(()=>{F&&ee()},[F,ee]);const{onOpenChange:Y,triggerPointerDownPosRef:me}=I;C.useEffect(()=>{if(j){let Te={x:0,y:0};const Be=dt=>{Te={x:Math.abs(Math.round(dt.pageX)-(me.current?.x??0)),y:Math.abs(Math.round(dt.pageY)-(me.current?.y??0))}},ot=dt=>{Te.x<=10&&Te.y<=10?dt.preventDefault():j.contains(dt.target)||Y(!1),document.removeEventListener("pointermove",Be),me.current=null};return me.current!==null&&(document.addEventListener("pointermove",Be),document.addEventListener("pointerup",ot,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Be),document.removeEventListener("pointerup",ot,{capture:!0})}}},[j,Y,me]),C.useEffect(()=>{const Te=()=>Y(!1);return window.addEventListener("blur",Te),window.addEventListener("resize",Te),()=>{window.removeEventListener("blur",Te),window.removeEventListener("resize",Te)}},[Y]);const[B,ae]=GN(Te=>{const Be=ne().filter(ht=>!ht.disabled),ot=Be.find(ht=>ht.ref.current===document.activeElement),dt=ZN(Be,Te,ot);dt&&setTimeout(()=>dt.ref.current.focus())}),Ne=C.useCallback((Te,Be,ot)=>{const dt=!te.current&&!ot;(I.value!==void 0&&I.value===Be||dt)&&(re(Te),dt&&(te.current=!0))},[I.value]),be=C.useCallback(()=>j?.focus(),[j]),De=C.useCallback((Te,Be,ot)=>{const dt=!te.current&&!ot;(I.value!==void 0&&I.value===Be||dt)&&X(Te)},[I.value]),Re=i==="popper"?k0:TN,je=Re===k0?{side:h,sideOffset:m,align:v,alignOffset:b,arrowPadding:w,collisionBoundary:S,collisionPadding:N,sticky:A,hideWhenDetached:O,avoidCollisions:_}:{};return E.jsx(DN,{scope:n,content:j,viewport:U,onViewportChange:$,itemRefCallback:Ne,selectedItem:Q,onItemLeave:be,itemTextRefCallback:De,focusSelectedItem:ee,selectedItemText:W,position:i,isPositioned:F,searchRef:B,children:E.jsx(wN,{as:Uj,allowPinchZoom:!0,children:E.jsx(wO,{asChild:!0,trapped:I.open,onMountAutoFocus:Te=>{Te.preventDefault()},onUnmountAutoFocus:an(r,Te=>{I.trigger?.focus({preventScroll:!0}),Te.preventDefault()}),children:E.jsx(mO,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:Te=>Te.preventDefault(),onDismiss:()=>I.onOpenChange(!1),children:E.jsx(Re,{role:"listbox",id:I.contentId,"data-state":I.open?"open":"closed",dir:I.dir,onContextMenu:Te=>Te.preventDefault(),...M,...je,onPlaced:()=>V(!0),ref:L,style:{display:"flex",flexDirection:"column",outline:"none",...M.style},onKeyDown:an(M.onKeyDown,Te=>{const Be=Te.ctrlKey||Te.altKey||Te.metaKey;if(Te.key==="Tab"&&Te.preventDefault(),!Be&&Te.key.length===1&&ae(Te.key),["ArrowUp","ArrowDown","Home","End"].includes(Te.key)){let dt=ne().filter(ht=>!ht.disabled).map(ht=>ht.ref.current);if(["ArrowUp","End"].includes(Te.key)&&(dt=dt.slice().reverse()),["ArrowUp","ArrowDown"].includes(Te.key)){const ht=Te.target,wt=dt.indexOf(ht);dt=dt.slice(wt+1)}setTimeout(()=>P(dt)),Te.preventDefault()}})})})})})})});_N.displayName=Pj;var Lj="SelectItemAlignedPosition",TN=C.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:i,...r}=e,s=Ds(Ll,n),c=_s(Ll,n),[h,m]=C.useState(null),[v,b]=C.useState(null),w=Mn(t,L=>b(L)),S=rg(n),N=C.useRef(!1),A=C.useRef(!0),{viewport:O,selectedItem:_,selectedItemText:M,focusSelectedItem:I}=c,j=C.useCallback(()=>{if(s.trigger&&s.valueNode&&h&&v&&O&&_&&M){const L=s.trigger.getBoundingClientRect(),Q=v.getBoundingClientRect(),re=s.valueNode.getBoundingClientRect(),W=M.getBoundingClientRect();if(s.dir!=="rtl"){const ht=W.left-Q.left,wt=re.left-ht,vn=L.left-wt,Vt=L.width+vn,cr=Math.max(Vt,Q.width),Mi=window.innerWidth-ma,en=dO(wt,[ma,Math.max(ma,Mi-cr)]);h.style.minWidth=Vt+"px",h.style.left=en+"px"}else{const ht=Q.right-W.right,wt=window.innerWidth-re.right-ht,vn=window.innerWidth-L.right-wt,Vt=L.width+vn,cr=Math.max(Vt,Q.width),Mi=window.innerWidth-ma,en=dO(wt,[ma,Math.max(ma,Mi-cr)]);h.style.minWidth=Vt+"px",h.style.right=en+"px"}const X=S(),ne=window.innerHeight-ma*2,F=O.scrollHeight,V=window.getComputedStyle(v),te=parseInt(V.borderTopWidth,10),P=parseInt(V.paddingTop,10),ee=parseInt(V.borderBottomWidth,10),Y=parseInt(V.paddingBottom,10),me=te+P+F+Y+ee,B=Math.min(_.offsetHeight*5,me),ae=window.getComputedStyle(O),Ne=parseInt(ae.paddingTop,10),be=parseInt(ae.paddingBottom,10),De=L.top+L.height/2-ma,Re=ne-De,je=_.offsetHeight/2,Te=_.offsetTop+je,Be=te+P+Te,ot=me-Be;if(Be<=De){const ht=X.length>0&&_===X[X.length-1].ref.current;h.style.bottom="0px";const wt=v.clientHeight-O.offsetTop-O.offsetHeight,vn=Math.max(Re,je+(ht?be:0)+wt+ee),Vt=Be+vn;h.style.height=Vt+"px"}else{const ht=X.length>0&&_===X[0].ref.current;h.style.top="0px";const vn=Math.max(De,te+O.offsetTop+(ht?Ne:0)+je)+ot;h.style.height=vn+"px",O.scrollTop=Be-De+O.offsetTop}h.style.margin=`${ma}px 0`,h.style.minHeight=B+"px",h.style.maxHeight=ne+"px",i?.(),requestAnimationFrame(()=>N.current=!0)}},[S,s.trigger,s.valueNode,h,v,O,_,M,s.dir,i]);Br(()=>j(),[j]);const[H,U]=C.useState();Br(()=>{v&&U(window.getComputedStyle(v).zIndex)},[v]);const $=C.useCallback(L=>{L&&A.current===!0&&(j(),I?.(),A.current=!1)},[j,I]);return E.jsx(Fj,{scope:n,contentWrapper:h,shouldExpandOnScrollRef:N,onScrollButtonChange:$,children:E.jsx("div",{ref:m,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:H},children:E.jsx(hn.div,{...r,ref:w,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});TN.displayName=Lj;var Bj="SelectPopperPosition",k0=C.forwardRef((e,t)=>{const{__scopeSelect:n,align:i="start",collisionPadding:r=ma,...s}=e,c=ig(n);return E.jsx(P4,{...c,...s,ref:t,align:i,collisionPadding:r,style:{boxSizing:"border-box",...s.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)"}})});k0.displayName=Bj;var[Fj,E0]=zc(Ll,{}),D0="SelectViewport",CN=C.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:i,...r}=e,s=_s(D0,n),c=E0(D0,n),h=Mn(t,s.onViewportChange),m=C.useRef(0);return E.jsxs(E.Fragment,{children:[E.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),E.jsx(ng.Slot,{scope:n,children:E.jsx(hn.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:h,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:an(r.onScroll,v=>{const b=v.currentTarget,{contentWrapper:w,shouldExpandOnScrollRef:S}=c;if(S?.current&&w){const N=Math.abs(m.current-b.scrollTop);if(N>0){const A=window.innerHeight-ma*2,O=parseFloat(w.style.minHeight),_=parseFloat(w.style.height),M=Math.max(O,_);if(M<A){const I=M+N,j=Math.min(A,I),H=I-j;w.style.height=j+"px",w.style.bottom==="0px"&&(b.scrollTop=H>0?H:0,w.style.justifyContent="flex-end")}}}m.current=b.scrollTop})})})]})});CN.displayName=D0;var zN="SelectGroup",[Hj,Qj]=zc(zN),Gj=C.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e,r=Pm();return E.jsx(Hj,{scope:n,id:r,children:E.jsx(hn.div,{role:"group","aria-labelledby":r,...i,ref:t})})});Gj.displayName=zN;var IN="SelectLabel",Zj=C.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e,r=Qj(IN,n);return E.jsx(hn.div,{id:r.id,...i,ref:t})});Zj.displayName=IN;var ag="SelectItem",[Wj,MN]=zc(ag),RN=C.forwardRef((e,t)=>{const{__scopeSelect:n,value:i,disabled:r=!1,textValue:s,...c}=e,h=Ds(ag,n),m=_s(ag,n),v=h.value===i,[b,w]=C.useState(s??""),[S,N]=C.useState(!1),A=Mn(t,I=>m.itemRefCallback?.(I,i,r)),O=Pm(),_=C.useRef("touch"),M=()=>{r||(h.onValueChange(i),h.onOpenChange(!1))};if(i==="")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 E.jsx(Wj,{scope:n,value:i,disabled:r,textId:O,isSelected:v,onItemTextChange:C.useCallback(I=>{w(j=>j||(I?.textContent??"").trim())},[]),children:E.jsx(ng.ItemSlot,{scope:n,value:i,disabled:r,textValue:b,children:E.jsx(hn.div,{role:"option","aria-labelledby":O,"data-highlighted":S?"":void 0,"aria-selected":v&&S,"data-state":v?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...c,ref:A,onFocus:an(c.onFocus,()=>N(!0)),onBlur:an(c.onBlur,()=>N(!1)),onClick:an(c.onClick,()=>{_.current!=="mouse"&&M()}),onPointerUp:an(c.onPointerUp,()=>{_.current==="mouse"&&M()}),onPointerDown:an(c.onPointerDown,I=>{_.current=I.pointerType}),onPointerMove:an(c.onPointerMove,I=>{_.current=I.pointerType,r?m.onItemLeave?.():_.current==="mouse"&&I.currentTarget.focus({preventScroll:!0})}),onPointerLeave:an(c.onPointerLeave,I=>{I.currentTarget===document.activeElement&&m.onItemLeave?.()}),onKeyDown:an(c.onKeyDown,I=>{m.searchRef?.current!==""&&I.key===" "||(Cj.includes(I.key)&&M(),I.key===" "&&I.preventDefault())})})})})});RN.displayName=ag;var Hf="SelectItemText",jN=C.forwardRef((e,t)=>{const{__scopeSelect:n,className:i,style:r,...s}=e,c=Ds(Hf,n),h=_s(Hf,n),m=MN(Hf,n),v=Rj(Hf,n),[b,w]=C.useState(null),S=Mn(t,M=>w(M),m.onItemTextChange,M=>h.itemTextRefCallback?.(M,m.value,m.disabled)),N=b?.textContent,A=C.useMemo(()=>E.jsx("option",{value:m.value,disabled:m.disabled,children:N},m.value),[m.disabled,m.value,N]),{onNativeOptionAdd:O,onNativeOptionRemove:_}=v;return Br(()=>(O(A),()=>_(A)),[O,_,A]),E.jsxs(E.Fragment,{children:[E.jsx(hn.span,{id:m.textId,...s,ref:S}),m.isSelected&&c.valueNode&&!c.valueNodeHasChildren?Uf.createPortal(s.children,c.valueNode):null]})});jN.displayName=Hf;var PN="SelectItemIndicator",UN=C.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e;return MN(PN,n).isSelected?E.jsx(hn.span,{"aria-hidden":!0,...i,ref:t}):null});UN.displayName=PN;var _0="SelectScrollUpButton",LN=C.forwardRef((e,t)=>{const n=_s(_0,e.__scopeSelect),i=E0(_0,e.__scopeSelect),[r,s]=C.useState(!1),c=Mn(t,i.onScrollButtonChange);return Br(()=>{if(n.viewport&&n.isPositioned){let h=function(){const v=m.scrollTop>0;s(v)};const m=n.viewport;return h(),m.addEventListener("scroll",h),()=>m.removeEventListener("scroll",h)}},[n.viewport,n.isPositioned]),r?E.jsx(FN,{...e,ref:c,onAutoScroll:()=>{const{viewport:h,selectedItem:m}=n;h&&m&&(h.scrollTop=h.scrollTop-m.offsetHeight)}}):null});LN.displayName=_0;var T0="SelectScrollDownButton",BN=C.forwardRef((e,t)=>{const n=_s(T0,e.__scopeSelect),i=E0(T0,e.__scopeSelect),[r,s]=C.useState(!1),c=Mn(t,i.onScrollButtonChange);return Br(()=>{if(n.viewport&&n.isPositioned){let h=function(){const v=m.scrollHeight-m.clientHeight,b=Math.ceil(m.scrollTop)<v;s(b)};const m=n.viewport;return h(),m.addEventListener("scroll",h),()=>m.removeEventListener("scroll",h)}},[n.viewport,n.isPositioned]),r?E.jsx(FN,{...e,ref:c,onAutoScroll:()=>{const{viewport:h,selectedItem:m}=n;h&&m&&(h.scrollTop=h.scrollTop+m.offsetHeight)}}):null});BN.displayName=T0;var FN=C.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:i,...r}=e,s=_s("SelectScrollButton",n),c=C.useRef(null),h=rg(n),m=C.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return C.useEffect(()=>()=>m(),[m]),Br(()=>{h().find(b=>b.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[h]),E.jsx(hn.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:an(r.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(i,50))}),onPointerMove:an(r.onPointerMove,()=>{s.onItemLeave?.(),c.current===null&&(c.current=window.setInterval(i,50))}),onPointerLeave:an(r.onPointerLeave,()=>{m()})})}),Yj="SelectSeparator",qj=C.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e;return E.jsx(hn.div,{"aria-hidden":!0,...i,ref:t})});qj.displayName=Yj;var C0="SelectArrow",Vj=C.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e,r=ig(n),s=Ds(C0,n),c=_s(C0,n);return s.open&&c.position==="popper"?E.jsx(U4,{...r,...i,ref:t}):null});Vj.displayName=C0;var $j="SelectBubbleInput",HN=C.forwardRef(({__scopeSelect:e,value:t,...n},i)=>{const r=C.useRef(null),s=Mn(i,r),c=aN(t);return C.useEffect(()=>{const h=r.current;if(!h)return;const m=window.HTMLSelectElement.prototype,b=Object.getOwnPropertyDescriptor(m,"value").set;if(c!==t&&b){const w=new Event("change",{bubbles:!0});b.call(h,t),h.dispatchEvent(w)}},[c,t]),E.jsx(hn.select,{...n,style:{...oN,...n.style},ref:s,defaultValue:t})});HN.displayName=$j;function QN(e){return e===""||e===void 0}function GN(e){const t=Os(e),n=C.useRef(""),i=C.useRef(0),r=C.useCallback(c=>{const h=n.current+c;t(h),(function m(v){n.current=v,window.clearTimeout(i.current),v!==""&&(i.current=window.setTimeout(()=>m(""),1e3))})(h)},[t]),s=C.useCallback(()=>{n.current="",window.clearTimeout(i.current)},[]);return C.useEffect(()=>()=>window.clearTimeout(i.current),[]),[n,r,s]}function ZN(e,t,n){const r=t.length>1&&Array.from(t).every(v=>v===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let c=Kj(e,Math.max(s,0));r.length===1&&(c=c.filter(v=>v!==n));const m=c.find(v=>v.textValue.toLowerCase().startsWith(r.toLowerCase()));return m!==n?m:void 0}function Kj(e,t){return e.map((n,i)=>e[(t+i)%e.length])}var Xj=xN,Jj=AN,eP=NN,tP=kN,nP=EN,rP=CN,iP=RN,aP=jN,oP=UN,sP=LN,lP=BN;function uP({...e}){return E.jsx(Xj,{"data-slot":"select",...e})}function cP({...e}){return E.jsx(eP,{"data-slot":"select-value",...e})}function dP({className:e,size:t="default",children:n,...i}){return E.jsxs(Jj,{"data-slot":"select-trigger","data-size":t,className:bt("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-brand border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-12 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...i,children:[n,E.jsx(tP,{asChild:!0,children:E.jsx($A,{className:"size-4 opacity-50"})})]})}function fP({className:e,children:t,position:n="popper",...i}){return E.jsxs(nP,{"data-slot":"select-content",className:bt("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-[99999] max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...i,children:[E.jsx(hP,{}),E.jsx(rP,{className:bt("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),E.jsx(pP,{})]})}function WN({className:e,children:t,...n}){return E.jsxs(iP,{"data-slot":"select-item",className:bt("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[E.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:E.jsx(oP,{children:E.jsx(mR,{className:"size-4"})})}),E.jsx(aP,{children:t})]})}function hP({className:e,...t}){return E.jsx(sP,{"data-slot":"select-scroll-up-button",className:bt("flex cursor-default items-center justify-center py-1",e),...t,children:E.jsx(gR,{className:"size-4"})})}function pP({className:e,...t}){return E.jsx(lP,{"data-slot":"select-scroll-down-button",className:bt("flex cursor-default items-center justify-center py-1",e),...t,children:E.jsx($A,{className:"size-4"})})}const mP=e=>typeof e=="object"&&e!==null&&("disabled"in e?typeof e.disabled=="boolean":!0),gP=({size:e="default",onChange:t,options:n,getValue:i,getLabel:r,placeholder:s,onBlur:c,noOptionsText:h,...m})=>E.jsxs(uP,{...m,onValueChange:v=>{t?.(v)},children:[E.jsx(dP,{size:e,children:E.jsx(cP,{onBlur:c,placeholder:s})}),E.jsx(fP,{position:"popper",children:n.length===0?E.jsx(WN,{value:"No options",disabled:!0,children:h||"No options available"}):n.map(v=>E.jsx(WN,{value:i(v),disabled:mP(v)?v.disabled:void 0,children:r(v)},i(v)))})]}),vP=[{label:"EN",value:"en"},{label:"IT",value:"it"}],yP=()=>{const{i18n:e}=Tn(),[t,n]=C.useState(e.language),i=r=>{e.changeLanguage(r),n(r)};return E.jsx(gP,{size:"sm",options:vP,getLabel:({label:r})=>r,getValue:({value:r})=>r,value:t,onChange:i})},bP=({showBackButton:e=!1,onBack:t})=>{const{t:n}=Tn(),i=C.useContext(YA);return E.jsxs("div",{className:bt("flex bg-background py-1 px-4 justify-end sticky z-20 top-0 gap-4 border-b",e&&"justify-between"),children:[e&&E.jsx(mr,{"aria-label":n("go_back"),variant:"ghost",size:"icon",onClick:t,children:E.jsx(hR,{})}),E.jsxs("div",{className:"flex gap-4",children:[E.jsx(yP,{}),E.jsx(mr,{"aria-label":n("close_drawer"),variant:"ghost",size:"icon",onClick:i?.close,children:E.jsx(XA,{})})]})]})},YN=2147483647,wP=({direction:e,open:t,setOpen:n,children:i,disableFocusTrap:r=!1,showHeaderBackButton:s=!1,onBack:c})=>{const h=C.useRef(null);return C.useEffect(()=>{t?(document.body.style.overflow="hidden",h.current?.focus()):document.body.style.overflow="auto"},[t]),E.jsx(YA.Provider,{value:{close:()=>n(!1)},children:E.jsxs("div",{children:[E.jsx(xP,{open:t}),E.jsx(WA.FocusTrap,{active:!r&&t,children:E.jsxs("div",{ref:h,className:bt("bg-background fixed flex flex-col top-0 bottom-0 w-full sm:max-w-[400px] transition-all duration-300 sm:shadow-xl overflow-hidden",`z-${YN}`,e==="left"?"left-0":"right-0",t?e==="left"?"left-0":"right-0":e==="left"?"-left-full":"-right-full"),children:[E.jsx(bP,{showBackButton:s,onBack:c}),E.jsx("div",{className:"flex flex-1 flex-col overflow-scroll",children:i})]})})]})})},xP=({open:e})=>E.jsx("div",{className:bt("bg-foreground/50 fixed flex top-0 left-0 flex-col w-full h-full",e?"block":"hidden",`z-${YN-1}`)});class Bl extends Error{response;request;constructor(t,n){const i=`${Bl.extractMessage(t)}: ${JSON.stringify({response:t,request:n})}`;super(i),Object.setPrototypeOf(this,Bl.prototype),this.response=t,this.request=n,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Bl)}static extractMessage(t){return t.errors?.[0]?.message??`GraphQL Error (Code: ${String(t.status)})`}}const qN=e=>e.toUpperCase(),z0=e=>typeof e=="function"?e():e,VN=(e,t)=>e.map((n,i)=>[n,t[i]]),Ic=e=>{let t={};return e instanceof Headers?t=SP(e):Array.isArray(e)?e.forEach(([n,i])=>{n&&i!==void 0&&(t[n]=i)}):e&&(t=e),t},SP=e=>{const t={};return e.forEach((n,i)=>{t[i]=n}),t},AP=e=>{try{const t=e();return OP(t)?t.catch(n=>$N(n)):t}catch(t){return $N(t)}},$N=e=>e instanceof Error?e:new Error(String(e)),OP=e=>typeof e=="object"&&e!==null&&"then"in e&&typeof e.then=="function"&&"catch"in e&&typeof e.catch=="function"&&"finally"in e&&typeof e.finally=="function",I0=e=>{throw new Error(`Unhandled case: ${String(e)}`)},og=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),NP=(e,t)=>e.documents?e:{documents:e,requestHeaders:t,signal:void 0},kP=(e,t,n)=>e.query?e:{query:e,variables:t,requestHeaders:n,signal:void 0};function sg(e,t){if(!!!e)throw new Error(t)}function EP(e){return typeof e=="object"&&e!==null}function DP(e,t){if(!!!e)throw new Error("Unexpected invariant triggered.")}const _P=/\r\n|[\n\r]/g;function M0(e,t){let n=0,i=1;for(const r of e.body.matchAll(_P)){if(typeof r.index=="number"||DP(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}function TP(e){return KN(e.source,M0(e.source,e.start))}function KN(e,t){const n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,s=e.locationOffset.line-1,c=t.line+s,h=t.line===1?n:0,m=t.column+h,v=`${e.name}:${c}:${m}
177
+ `)},kj=0,Cc=[];function Ej(e){var t=C.useRef([]),n=C.useRef([0,0]),i=C.useRef(),r=C.useState(kj++)[0],s=C.useState(fN)[0],c=C.useRef(e);C.useEffect(function(){c.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var O=q4([e.lockRef.current],(e.shards||[]).map(bN),!0).filter(Boolean);return O.forEach(function(_){return _.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),O.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var h=C.useCallback(function(O,_){if("touches"in O&&O.touches.length===2||O.type==="wheel"&&O.ctrlKey)return!c.current.allowPinchZoom;var M=tg(O),I=n.current,j="deltaX"in O?O.deltaX:I[0]-M[0],H="deltaY"in O?O.deltaY:I[1]-M[1],U,$=O.target,L=Math.abs(j)>Math.abs(H)?"h":"v";if("touches"in O&&L==="h"&&$.type==="range")return!1;var Q=mN(L,$);if(!Q)return!0;if(Q?U=L:(U=L==="v"?"h":"v",Q=mN(L,$)),!Q)return!1;if(!i.current&&"changedTouches"in O&&(j||H)&&(i.current=U),!U)return!0;var re=i.current||U;return Aj(re,_,O,re==="h"?j:H)},[]),m=C.useCallback(function(O){var _=O;if(!(!Cc.length||Cc[Cc.length-1]!==s)){var M="deltaY"in _?yN(_):tg(_),I=t.current.filter(function(U){return U.name===_.type&&(U.target===_.target||_.target===U.shadowParent)&&Oj(U.delta,M)})[0];if(I&&I.should){_.cancelable&&_.preventDefault();return}if(!I){var j=(c.current.shards||[]).map(bN).filter(Boolean).filter(function(U){return U.contains(_.target)}),H=j.length>0?h(_,j[0]):!c.current.noIsolation;H&&_.cancelable&&_.preventDefault()}}},[]),v=C.useCallback(function(O,_,M,I){var j={name:O,delta:_,target:M,should:I,shadowParent:Dj(M)};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(H){return H!==j})},1)},[]),b=C.useCallback(function(O){n.current=tg(O),i.current=void 0},[]),w=C.useCallback(function(O){v(O.type,yN(O),O.target,h(O,e.lockRef.current))},[]),S=C.useCallback(function(O){v(O.type,tg(O),O.target,h(O,e.lockRef.current))},[]);C.useEffect(function(){return Cc.push(s),e.setCallbacks({onScrollCapture:w,onWheelCapture:w,onTouchMoveCapture:S}),document.addEventListener("wheel",m,Tc),document.addEventListener("touchmove",m,Tc),document.addEventListener("touchstart",b,Tc),function(){Cc=Cc.filter(function(O){return O!==s}),document.removeEventListener("wheel",m,Tc),document.removeEventListener("touchmove",m,Tc),document.removeEventListener("touchstart",b,Tc)}},[]);var N=e.removeScrollBar,A=e.inert;return C.createElement(C.Fragment,null,A?C.createElement(s,{styles:Nj(r)}):null,N?C.createElement(gj,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Dj(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const _j=rj(dN,Ej);var wN=C.forwardRef(function(e,t){return C.createElement(Jm,qa({},e,{ref:t,sideCar:_j}))});wN.classNames=Jm.classNames;var Tj=[" ","Enter","ArrowUp","ArrowDown"],Cj=[" ","Enter"],Ul="Select",[ng,rg,zj]=fO(Ul),[zc,CW]=Ac(Ul,[zj,$O]),ig=$O(),[Ij,Ds]=zc(Ul),[Mj,Rj]=zc(Ul),xN=e=>{const{__scopeSelect:t,children:n,open:i,defaultOpen:r,onOpenChange:s,value:c,defaultValue:h,onValueChange:m,dir:v,name:b,autoComplete:w,disabled:S,required:N,form:A}=e,O=ig(t),[_,M]=C.useState(null),[I,j]=C.useState(null),[H,U]=C.useState(!1),$=r0(v),[L,Q]=qm({prop:i,defaultProp:r??!1,onChange:s,caller:Ul}),[re,W]=qm({prop:c,defaultProp:h,onChange:m,caller:Ul}),X=C.useRef(null),ne=_?A||!!_.closest("form"):!0,[F,V]=C.useState(new Set),te=Array.from(F).map(P=>P.props.value).join(";");return E.jsx(R4,{...O,children:E.jsxs(Ij,{required:N,scope:t,trigger:_,onTriggerChange:M,valueNode:I,onValueNodeChange:j,valueNodeHasChildren:H,onValueNodeHasChildrenChange:U,contentId:Pm(),value:re,onValueChange:W,open:L,onOpenChange:Q,dir:$,triggerPointerDownPosRef:X,disabled:S,children:[E.jsx(ng.Provider,{scope:t,children:E.jsx(Mj,{scope:e.__scopeSelect,onNativeOptionAdd:C.useCallback(P=>{V(ee=>new Set(ee).add(P))},[]),onNativeOptionRemove:C.useCallback(P=>{V(ee=>{const Y=new Set(ee);return Y.delete(P),Y})},[]),children:n})}),ne?E.jsxs(HN,{"aria-hidden":!0,required:N,tabIndex:-1,name:b,autoComplete:w,value:re,onChange:P=>W(P.target.value),disabled:S,form:A,children:[re===void 0?E.jsx("option",{value:""}):null,Array.from(F)]},te):null]})})};xN.displayName=Ul;var SN="SelectTrigger",AN=C.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:i=!1,...r}=e,s=ig(n),c=Ds(SN,n),h=c.disabled||i,m=Mn(t,c.onTriggerChange),v=rg(n),b=C.useRef("touch"),[w,S,N]=GN(O=>{const _=v().filter(j=>!j.disabled),M=_.find(j=>j.value===c.value),I=ZN(_,O,M);I!==void 0&&c.onValueChange(I.value)}),A=O=>{h||(c.onOpenChange(!0),N()),O&&(c.triggerPointerDownPosRef.current={x:Math.round(O.pageX),y:Math.round(O.pageY)})};return E.jsx(j4,{asChild:!0,...s,children:E.jsx(hn.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:h,"data-disabled":h?"":void 0,"data-placeholder":QN(c.value)?"":void 0,...r,ref:m,onClick:an(r.onClick,O=>{O.currentTarget.focus(),b.current!=="mouse"&&A(O)}),onPointerDown:an(r.onPointerDown,O=>{b.current=O.pointerType;const _=O.target;_.hasPointerCapture(O.pointerId)&&_.releasePointerCapture(O.pointerId),O.button===0&&O.ctrlKey===!1&&O.pointerType==="mouse"&&(A(O),O.preventDefault())}),onKeyDown:an(r.onKeyDown,O=>{const _=w.current!=="";!(O.ctrlKey||O.altKey||O.metaKey)&&O.key.length===1&&S(O.key),!(_&&O.key===" ")&&Tj.includes(O.key)&&(A(),O.preventDefault())})})})});AN.displayName=SN;var ON="SelectValue",NN=C.forwardRef((e,t)=>{const{__scopeSelect:n,className:i,style:r,children:s,placeholder:c="",...h}=e,m=Ds(ON,n),{onValueNodeHasChildrenChange:v}=m,b=s!==void 0,w=Mn(t,m.onValueNodeChange);return Br(()=>{v(b)},[v,b]),E.jsx(hn.span,{...h,ref:w,style:{pointerEvents:"none"},children:QN(m.value)?E.jsx(E.Fragment,{children:c}):s})});NN.displayName=ON;var jj="SelectIcon",kN=C.forwardRef((e,t)=>{const{__scopeSelect:n,children:i,...r}=e;return E.jsx(hn.span,{"aria-hidden":!0,...r,ref:t,children:i||"▼"})});kN.displayName=jj;var Ll="SelectContent",EN=C.forwardRef((e,t)=>{const n=Ds(Ll,e.__scopeSelect),[i,r]=C.useState();if(Br(()=>{r(new DocumentFragment)},[]),!n.open){const s=i;return s?Uf.createPortal(E.jsx(DN,{scope:e.__scopeSelect,children:E.jsx(ng.Slot,{scope:e.__scopeSelect,children:E.jsx("div",{children:e.children})})}),s):null}return E.jsx(_N,{...e,ref:t})});EN.displayName=Ll;var ma=10,[DN,_s]=zc(Ll),Pj="SelectContentImpl",Uj=If("SelectContent.RemoveScroll"),_N=C.forwardRef((e,t)=>{const{__scopeSelect:n,position:i="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:c,side:h,sideOffset:m,align:v,alignOffset:b,arrowPadding:w,collisionBoundary:S,collisionPadding:N,sticky:A,hideWhenDetached:O,avoidCollisions:_,...M}=e,I=Ds(Ll,n),[j,H]=C.useState(null),[U,$]=C.useState(null),L=Mn(t,Te=>H(Te)),[Q,re]=C.useState(null),[W,X]=C.useState(null),ne=rg(n),[F,V]=C.useState(!1),te=C.useRef(!1);C.useEffect(()=>{if(j)return Y4(j)},[j]),s6();const P=C.useCallback(Te=>{const[Be,...ot]=ne().map(wt=>wt.ref.current),[dt]=ot.slice(-1),ht=document.activeElement;for(const wt of Te)if(wt===ht||(wt?.scrollIntoView({block:"nearest"}),wt===Be&&U&&(U.scrollTop=0),wt===dt&&U&&(U.scrollTop=U.scrollHeight),wt?.focus(),document.activeElement!==ht))return},[ne,U]),ee=C.useCallback(()=>P([Q,j]),[P,Q,j]);C.useEffect(()=>{F&&ee()},[F,ee]);const{onOpenChange:Y,triggerPointerDownPosRef:me}=I;C.useEffect(()=>{if(j){let Te={x:0,y:0};const Be=dt=>{Te={x:Math.abs(Math.round(dt.pageX)-(me.current?.x??0)),y:Math.abs(Math.round(dt.pageY)-(me.current?.y??0))}},ot=dt=>{Te.x<=10&&Te.y<=10?dt.preventDefault():j.contains(dt.target)||Y(!1),document.removeEventListener("pointermove",Be),me.current=null};return me.current!==null&&(document.addEventListener("pointermove",Be),document.addEventListener("pointerup",ot,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Be),document.removeEventListener("pointerup",ot,{capture:!0})}}},[j,Y,me]),C.useEffect(()=>{const Te=()=>Y(!1);return window.addEventListener("blur",Te),window.addEventListener("resize",Te),()=>{window.removeEventListener("blur",Te),window.removeEventListener("resize",Te)}},[Y]);const[B,ae]=GN(Te=>{const Be=ne().filter(ht=>!ht.disabled),ot=Be.find(ht=>ht.ref.current===document.activeElement),dt=ZN(Be,Te,ot);dt&&setTimeout(()=>dt.ref.current.focus())}),Ne=C.useCallback((Te,Be,ot)=>{const dt=!te.current&&!ot;(I.value!==void 0&&I.value===Be||dt)&&(re(Te),dt&&(te.current=!0))},[I.value]),be=C.useCallback(()=>j?.focus(),[j]),De=C.useCallback((Te,Be,ot)=>{const dt=!te.current&&!ot;(I.value!==void 0&&I.value===Be||dt)&&X(Te)},[I.value]),Re=i==="popper"?k0:TN,je=Re===k0?{side:h,sideOffset:m,align:v,alignOffset:b,arrowPadding:w,collisionBoundary:S,collisionPadding:N,sticky:A,hideWhenDetached:O,avoidCollisions:_}:{};return E.jsx(DN,{scope:n,content:j,viewport:U,onViewportChange:$,itemRefCallback:Ne,selectedItem:Q,onItemLeave:be,itemTextRefCallback:De,focusSelectedItem:ee,selectedItemText:W,position:i,isPositioned:F,searchRef:B,children:E.jsx(wN,{as:Uj,allowPinchZoom:!0,children:E.jsx(wO,{asChild:!0,trapped:I.open,onMountAutoFocus:Te=>{Te.preventDefault()},onUnmountAutoFocus:an(r,Te=>{I.trigger?.focus({preventScroll:!0}),Te.preventDefault()}),children:E.jsx(mO,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:Te=>Te.preventDefault(),onDismiss:()=>I.onOpenChange(!1),children:E.jsx(Re,{role:"listbox",id:I.contentId,"data-state":I.open?"open":"closed",dir:I.dir,onContextMenu:Te=>Te.preventDefault(),...M,...je,onPlaced:()=>V(!0),ref:L,style:{display:"flex",flexDirection:"column",outline:"none",...M.style},onKeyDown:an(M.onKeyDown,Te=>{const Be=Te.ctrlKey||Te.altKey||Te.metaKey;if(Te.key==="Tab"&&Te.preventDefault(),!Be&&Te.key.length===1&&ae(Te.key),["ArrowUp","ArrowDown","Home","End"].includes(Te.key)){let dt=ne().filter(ht=>!ht.disabled).map(ht=>ht.ref.current);if(["ArrowUp","End"].includes(Te.key)&&(dt=dt.slice().reverse()),["ArrowUp","ArrowDown"].includes(Te.key)){const ht=Te.target,wt=dt.indexOf(ht);dt=dt.slice(wt+1)}setTimeout(()=>P(dt)),Te.preventDefault()}})})})})})})});_N.displayName=Pj;var Lj="SelectItemAlignedPosition",TN=C.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:i,...r}=e,s=Ds(Ll,n),c=_s(Ll,n),[h,m]=C.useState(null),[v,b]=C.useState(null),w=Mn(t,L=>b(L)),S=rg(n),N=C.useRef(!1),A=C.useRef(!0),{viewport:O,selectedItem:_,selectedItemText:M,focusSelectedItem:I}=c,j=C.useCallback(()=>{if(s.trigger&&s.valueNode&&h&&v&&O&&_&&M){const L=s.trigger.getBoundingClientRect(),Q=v.getBoundingClientRect(),re=s.valueNode.getBoundingClientRect(),W=M.getBoundingClientRect();if(s.dir!=="rtl"){const ht=W.left-Q.left,wt=re.left-ht,vn=L.left-wt,Vt=L.width+vn,cr=Math.max(Vt,Q.width),Mi=window.innerWidth-ma,en=dO(wt,[ma,Math.max(ma,Mi-cr)]);h.style.minWidth=Vt+"px",h.style.left=en+"px"}else{const ht=Q.right-W.right,wt=window.innerWidth-re.right-ht,vn=window.innerWidth-L.right-wt,Vt=L.width+vn,cr=Math.max(Vt,Q.width),Mi=window.innerWidth-ma,en=dO(wt,[ma,Math.max(ma,Mi-cr)]);h.style.minWidth=Vt+"px",h.style.right=en+"px"}const X=S(),ne=window.innerHeight-ma*2,F=O.scrollHeight,V=window.getComputedStyle(v),te=parseInt(V.borderTopWidth,10),P=parseInt(V.paddingTop,10),ee=parseInt(V.borderBottomWidth,10),Y=parseInt(V.paddingBottom,10),me=te+P+F+Y+ee,B=Math.min(_.offsetHeight*5,me),ae=window.getComputedStyle(O),Ne=parseInt(ae.paddingTop,10),be=parseInt(ae.paddingBottom,10),De=L.top+L.height/2-ma,Re=ne-De,je=_.offsetHeight/2,Te=_.offsetTop+je,Be=te+P+Te,ot=me-Be;if(Be<=De){const ht=X.length>0&&_===X[X.length-1].ref.current;h.style.bottom="0px";const wt=v.clientHeight-O.offsetTop-O.offsetHeight,vn=Math.max(Re,je+(ht?be:0)+wt+ee),Vt=Be+vn;h.style.height=Vt+"px"}else{const ht=X.length>0&&_===X[0].ref.current;h.style.top="0px";const vn=Math.max(De,te+O.offsetTop+(ht?Ne:0)+je)+ot;h.style.height=vn+"px",O.scrollTop=Be-De+O.offsetTop}h.style.margin=`${ma}px 0`,h.style.minHeight=B+"px",h.style.maxHeight=ne+"px",i?.(),requestAnimationFrame(()=>N.current=!0)}},[S,s.trigger,s.valueNode,h,v,O,_,M,s.dir,i]);Br(()=>j(),[j]);const[H,U]=C.useState();Br(()=>{v&&U(window.getComputedStyle(v).zIndex)},[v]);const $=C.useCallback(L=>{L&&A.current===!0&&(j(),I?.(),A.current=!1)},[j,I]);return E.jsx(Fj,{scope:n,contentWrapper:h,shouldExpandOnScrollRef:N,onScrollButtonChange:$,children:E.jsx("div",{ref:m,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:H},children:E.jsx(hn.div,{...r,ref:w,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});TN.displayName=Lj;var Bj="SelectPopperPosition",k0=C.forwardRef((e,t)=>{const{__scopeSelect:n,align:i="start",collisionPadding:r=ma,...s}=e,c=ig(n);return E.jsx(P4,{...c,...s,ref:t,align:i,collisionPadding:r,style:{boxSizing:"border-box",...s.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)"}})});k0.displayName=Bj;var[Fj,E0]=zc(Ll,{}),D0="SelectViewport",CN=C.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:i,...r}=e,s=_s(D0,n),c=E0(D0,n),h=Mn(t,s.onViewportChange),m=C.useRef(0);return E.jsxs(E.Fragment,{children:[E.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),E.jsx(ng.Slot,{scope:n,children:E.jsx(hn.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:h,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:an(r.onScroll,v=>{const b=v.currentTarget,{contentWrapper:w,shouldExpandOnScrollRef:S}=c;if(S?.current&&w){const N=Math.abs(m.current-b.scrollTop);if(N>0){const A=window.innerHeight-ma*2,O=parseFloat(w.style.minHeight),_=parseFloat(w.style.height),M=Math.max(O,_);if(M<A){const I=M+N,j=Math.min(A,I),H=I-j;w.style.height=j+"px",w.style.bottom==="0px"&&(b.scrollTop=H>0?H:0,w.style.justifyContent="flex-end")}}}m.current=b.scrollTop})})})]})});CN.displayName=D0;var zN="SelectGroup",[Hj,Qj]=zc(zN),Gj=C.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e,r=Pm();return E.jsx(Hj,{scope:n,id:r,children:E.jsx(hn.div,{role:"group","aria-labelledby":r,...i,ref:t})})});Gj.displayName=zN;var IN="SelectLabel",Zj=C.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e,r=Qj(IN,n);return E.jsx(hn.div,{id:r.id,...i,ref:t})});Zj.displayName=IN;var ag="SelectItem",[Wj,MN]=zc(ag),RN=C.forwardRef((e,t)=>{const{__scopeSelect:n,value:i,disabled:r=!1,textValue:s,...c}=e,h=Ds(ag,n),m=_s(ag,n),v=h.value===i,[b,w]=C.useState(s??""),[S,N]=C.useState(!1),A=Mn(t,I=>m.itemRefCallback?.(I,i,r)),O=Pm(),_=C.useRef("touch"),M=()=>{r||(h.onValueChange(i),h.onOpenChange(!1))};if(i==="")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 E.jsx(Wj,{scope:n,value:i,disabled:r,textId:O,isSelected:v,onItemTextChange:C.useCallback(I=>{w(j=>j||(I?.textContent??"").trim())},[]),children:E.jsx(ng.ItemSlot,{scope:n,value:i,disabled:r,textValue:b,children:E.jsx(hn.div,{role:"option","aria-labelledby":O,"data-highlighted":S?"":void 0,"aria-selected":v&&S,"data-state":v?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...c,ref:A,onFocus:an(c.onFocus,()=>N(!0)),onBlur:an(c.onBlur,()=>N(!1)),onClick:an(c.onClick,()=>{_.current!=="mouse"&&M()}),onPointerUp:an(c.onPointerUp,()=>{_.current==="mouse"&&M()}),onPointerDown:an(c.onPointerDown,I=>{_.current=I.pointerType}),onPointerMove:an(c.onPointerMove,I=>{_.current=I.pointerType,r?m.onItemLeave?.():_.current==="mouse"&&I.currentTarget.focus({preventScroll:!0})}),onPointerLeave:an(c.onPointerLeave,I=>{I.currentTarget===document.activeElement&&m.onItemLeave?.()}),onKeyDown:an(c.onKeyDown,I=>{m.searchRef?.current!==""&&I.key===" "||(Cj.includes(I.key)&&M(),I.key===" "&&I.preventDefault())})})})})});RN.displayName=ag;var Hf="SelectItemText",jN=C.forwardRef((e,t)=>{const{__scopeSelect:n,className:i,style:r,...s}=e,c=Ds(Hf,n),h=_s(Hf,n),m=MN(Hf,n),v=Rj(Hf,n),[b,w]=C.useState(null),S=Mn(t,M=>w(M),m.onItemTextChange,M=>h.itemTextRefCallback?.(M,m.value,m.disabled)),N=b?.textContent,A=C.useMemo(()=>E.jsx("option",{value:m.value,disabled:m.disabled,children:N},m.value),[m.disabled,m.value,N]),{onNativeOptionAdd:O,onNativeOptionRemove:_}=v;return Br(()=>(O(A),()=>_(A)),[O,_,A]),E.jsxs(E.Fragment,{children:[E.jsx(hn.span,{id:m.textId,...s,ref:S}),m.isSelected&&c.valueNode&&!c.valueNodeHasChildren?Uf.createPortal(s.children,c.valueNode):null]})});jN.displayName=Hf;var PN="SelectItemIndicator",UN=C.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e;return MN(PN,n).isSelected?E.jsx(hn.span,{"aria-hidden":!0,...i,ref:t}):null});UN.displayName=PN;var _0="SelectScrollUpButton",LN=C.forwardRef((e,t)=>{const n=_s(_0,e.__scopeSelect),i=E0(_0,e.__scopeSelect),[r,s]=C.useState(!1),c=Mn(t,i.onScrollButtonChange);return Br(()=>{if(n.viewport&&n.isPositioned){let h=function(){const v=m.scrollTop>0;s(v)};const m=n.viewport;return h(),m.addEventListener("scroll",h),()=>m.removeEventListener("scroll",h)}},[n.viewport,n.isPositioned]),r?E.jsx(FN,{...e,ref:c,onAutoScroll:()=>{const{viewport:h,selectedItem:m}=n;h&&m&&(h.scrollTop=h.scrollTop-m.offsetHeight)}}):null});LN.displayName=_0;var T0="SelectScrollDownButton",BN=C.forwardRef((e,t)=>{const n=_s(T0,e.__scopeSelect),i=E0(T0,e.__scopeSelect),[r,s]=C.useState(!1),c=Mn(t,i.onScrollButtonChange);return Br(()=>{if(n.viewport&&n.isPositioned){let h=function(){const v=m.scrollHeight-m.clientHeight,b=Math.ceil(m.scrollTop)<v;s(b)};const m=n.viewport;return h(),m.addEventListener("scroll",h),()=>m.removeEventListener("scroll",h)}},[n.viewport,n.isPositioned]),r?E.jsx(FN,{...e,ref:c,onAutoScroll:()=>{const{viewport:h,selectedItem:m}=n;h&&m&&(h.scrollTop=h.scrollTop+m.offsetHeight)}}):null});BN.displayName=T0;var FN=C.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:i,...r}=e,s=_s("SelectScrollButton",n),c=C.useRef(null),h=rg(n),m=C.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return C.useEffect(()=>()=>m(),[m]),Br(()=>{h().find(b=>b.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[h]),E.jsx(hn.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:an(r.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(i,50))}),onPointerMove:an(r.onPointerMove,()=>{s.onItemLeave?.(),c.current===null&&(c.current=window.setInterval(i,50))}),onPointerLeave:an(r.onPointerLeave,()=>{m()})})}),Yj="SelectSeparator",qj=C.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e;return E.jsx(hn.div,{"aria-hidden":!0,...i,ref:t})});qj.displayName=Yj;var C0="SelectArrow",Vj=C.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e,r=ig(n),s=Ds(C0,n),c=_s(C0,n);return s.open&&c.position==="popper"?E.jsx(U4,{...r,...i,ref:t}):null});Vj.displayName=C0;var $j="SelectBubbleInput",HN=C.forwardRef(({__scopeSelect:e,value:t,...n},i)=>{const r=C.useRef(null),s=Mn(i,r),c=aN(t);return C.useEffect(()=>{const h=r.current;if(!h)return;const m=window.HTMLSelectElement.prototype,b=Object.getOwnPropertyDescriptor(m,"value").set;if(c!==t&&b){const w=new Event("change",{bubbles:!0});b.call(h,t),h.dispatchEvent(w)}},[c,t]),E.jsx(hn.select,{...n,style:{...oN,...n.style},ref:s,defaultValue:t})});HN.displayName=$j;function QN(e){return e===""||e===void 0}function GN(e){const t=Os(e),n=C.useRef(""),i=C.useRef(0),r=C.useCallback(c=>{const h=n.current+c;t(h),(function m(v){n.current=v,window.clearTimeout(i.current),v!==""&&(i.current=window.setTimeout(()=>m(""),1e3))})(h)},[t]),s=C.useCallback(()=>{n.current="",window.clearTimeout(i.current)},[]);return C.useEffect(()=>()=>window.clearTimeout(i.current),[]),[n,r,s]}function ZN(e,t,n){const r=t.length>1&&Array.from(t).every(v=>v===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let c=Kj(e,Math.max(s,0));r.length===1&&(c=c.filter(v=>v!==n));const m=c.find(v=>v.textValue.toLowerCase().startsWith(r.toLowerCase()));return m!==n?m:void 0}function Kj(e,t){return e.map((n,i)=>e[(t+i)%e.length])}var Xj=xN,Jj=AN,eP=NN,tP=kN,nP=EN,rP=CN,iP=RN,aP=jN,oP=UN,sP=LN,lP=BN;function uP({...e}){return E.jsx(Xj,{"data-slot":"select",...e})}function cP({...e}){return E.jsx(eP,{"data-slot":"select-value",...e})}function dP({className:e,size:t="default",children:n,...i}){return E.jsxs(Jj,{"data-slot":"select-trigger","data-size":t,className:bt("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-brand border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-12 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...i,children:[n,E.jsx(tP,{asChild:!0,children:E.jsx($A,{className:"size-4 opacity-50"})})]})}function fP({className:e,children:t,position:n="popper",...i}){return E.jsxs(nP,{"data-slot":"select-content",className:bt("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-[99999] max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...i,children:[E.jsx(hP,{}),E.jsx(rP,{className:bt("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),E.jsx(pP,{})]})}function WN({className:e,children:t,...n}){return E.jsxs(iP,{"data-slot":"select-item",className:bt("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[E.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:E.jsx(oP,{children:E.jsx(mR,{className:"size-4"})})}),E.jsx(aP,{children:t})]})}function hP({className:e,...t}){return E.jsx(sP,{"data-slot":"select-scroll-up-button",className:bt("flex cursor-default items-center justify-center py-1",e),...t,children:E.jsx(gR,{className:"size-4"})})}function pP({className:e,...t}){return E.jsx(lP,{"data-slot":"select-scroll-down-button",className:bt("flex cursor-default items-center justify-center py-1",e),...t,children:E.jsx($A,{className:"size-4"})})}const mP=e=>typeof e=="object"&&e!==null&&("disabled"in e?typeof e.disabled=="boolean":!0),gP=({size:e="default",onChange:t,options:n,getValue:i,getLabel:r,placeholder:s,onBlur:c,noOptionsText:h,...m})=>E.jsxs(uP,{...m,onValueChange:v=>{t?.(v)},children:[E.jsx(dP,{size:e,children:E.jsx(cP,{onBlur:c,placeholder:s})}),E.jsx(fP,{position:"popper",children:n.length===0?E.jsx(WN,{value:"No options",disabled:!0,children:h||"No options available"}):n.map(v=>E.jsx(WN,{value:i(v),disabled:mP(v)?v.disabled:void 0,children:r(v)},i(v)))})]}),vP=[{label:"EN",value:"en"},{label:"IT",value:"it"}],yP=()=>{const{i18n:e}=Tn(),[t,n]=C.useState(e.language),i=r=>{e.changeLanguage(r),n(r)};return E.jsx(gP,{size:"sm",options:vP,getLabel:({label:r})=>r,getValue:({value:r})=>r,value:t,onChange:i})},bP=({showBackButton:e=!1,onBack:t})=>{const{t:n}=Tn(),i=C.useContext(YA);return E.jsxs("div",{className:bt("flex bg-background py-1 px-4 justify-end sticky z-20 top-0 gap-4 border-b",e&&"justify-between"),children:[e&&E.jsx(mr,{"aria-label":n("go_back"),variant:"ghost",size:"icon",onClick:t,children:E.jsx(hR,{})}),E.jsxs("div",{className:"flex gap-4",children:[E.jsx(yP,{}),E.jsx(mr,{"aria-label":n("close_drawer"),variant:"ghost",size:"icon",onClick:i?.close,children:E.jsx(XA,{})})]})]})},YN=2147483647,wP=({direction:e,open:t,setOpen:n,children:i,disableFocusTrap:r=!1,showHeaderBackButton:s=!1,onBack:c})=>{const h=C.useRef(null);return C.useEffect(()=>{t?(document.body.style.overflow="hidden",h.current?.focus()):document.body.style.overflow="auto"},[t]),E.jsx(YA.Provider,{value:{close:()=>n(!1)},children:E.jsxs("div",{children:[E.jsx(xP,{open:t}),E.jsx(WA.FocusTrap,{active:!r&&t,children:E.jsxs("div",{ref:h,className:bt("bg-background fixed flex flex-col top-0 bottom-0 w-full sm:max-w-[400px] transition-all duration-300 sm:shadow-xl overflow-hidden",`z-[${YN}]`,e==="left"?"left-0":"right-0",t?e==="left"?"left-0":"right-0":e==="left"?"-left-full":"-right-full"),children:[E.jsx(bP,{showBackButton:s,onBack:c}),E.jsx("div",{className:"flex flex-1 flex-col overflow-scroll",children:i})]})})]})})},xP=({open:e})=>E.jsx("div",{className:bt("bg-foreground/50 fixed flex top-0 left-0 flex-col w-full h-full",e?"block":"hidden",`z-[${YN-1}]`)});class Bl extends Error{response;request;constructor(t,n){const i=`${Bl.extractMessage(t)}: ${JSON.stringify({response:t,request:n})}`;super(i),Object.setPrototypeOf(this,Bl.prototype),this.response=t,this.request=n,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Bl)}static extractMessage(t){return t.errors?.[0]?.message??`GraphQL Error (Code: ${String(t.status)})`}}const qN=e=>e.toUpperCase(),z0=e=>typeof e=="function"?e():e,VN=(e,t)=>e.map((n,i)=>[n,t[i]]),Ic=e=>{let t={};return e instanceof Headers?t=SP(e):Array.isArray(e)?e.forEach(([n,i])=>{n&&i!==void 0&&(t[n]=i)}):e&&(t=e),t},SP=e=>{const t={};return e.forEach((n,i)=>{t[i]=n}),t},AP=e=>{try{const t=e();return OP(t)?t.catch(n=>$N(n)):t}catch(t){return $N(t)}},$N=e=>e instanceof Error?e:new Error(String(e)),OP=e=>typeof e=="object"&&e!==null&&"then"in e&&typeof e.then=="function"&&"catch"in e&&typeof e.catch=="function"&&"finally"in e&&typeof e.finally=="function",I0=e=>{throw new Error(`Unhandled case: ${String(e)}`)},og=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),NP=(e,t)=>e.documents?e:{documents:e,requestHeaders:t,signal:void 0},kP=(e,t,n)=>e.query?e:{query:e,variables:t,requestHeaders:n,signal:void 0};function sg(e,t){if(!!!e)throw new Error(t)}function EP(e){return typeof e=="object"&&e!==null}function DP(e,t){if(!!!e)throw new Error("Unexpected invariant triggered.")}const _P=/\r\n|[\n\r]/g;function M0(e,t){let n=0,i=1;for(const r of e.body.matchAll(_P)){if(typeof r.index=="number"||DP(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}function TP(e){return KN(e.source,M0(e.source,e.start))}function KN(e,t){const n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,s=e.locationOffset.line-1,c=t.line+s,h=t.line===1?n:0,m=t.column+h,v=`${e.name}:${c}:${m}
178
178
  `,b=i.split(/\r\n|[\n\r]/g),w=b[r];if(w.length>120){const S=Math.floor(m/80),N=m%80,A=[];for(let O=0;O<w.length;O+=80)A.push(w.slice(O,O+80));return v+XN([[`${c} |`,A[0]],...A.slice(1,S+1).map(O=>["|",O]),["|","^".padStart(N)],["|",A[S+1]]])}return v+XN([[`${c-1} |`,b[r-1]],[`${c} |`,w],["|","^".padStart(m)],[`${c+1} |`,b[r+1]]])}function XN(e){const t=e.filter(([i,r])=>r!==void 0),n=Math.max(...t.map(([i])=>i.length));return t.map(([i,r])=>i.padStart(n)+(r?" "+r:"")).join(`
179
179
  `)}function CP(e){const t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}class R0 extends Error{constructor(t,...n){var i,r,s;const{nodes:c,source:h,positions:m,path:v,originalError:b,extensions:w}=CP(n);super(t),this.name="GraphQLError",this.path=v??void 0,this.originalError=b??void 0,this.nodes=JN(Array.isArray(c)?c:c?[c]:void 0);const S=JN((i=this.nodes)===null||i===void 0?void 0:i.map(A=>A.loc).filter(A=>A!=null));this.source=h??(S==null||(r=S[0])===null||r===void 0?void 0:r.source),this.positions=m??S?.map(A=>A.start),this.locations=m&&h?m.map(A=>M0(h,A)):S?.map(A=>M0(A.source,A.start));const N=EP(b?.extensions)?b?.extensions:void 0;this.extensions=(s=w??N)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),b!=null&&b.stack?Object.defineProperty(this,"stack",{value:b.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,R0):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(t+=`
180
180
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "easea-app-widget",
3
3
  "private": false,
4
- "version": "1.0.6",
4
+ "version": "1.0.7",
5
5
  "type": "module",
6
6
  "description": "Easea App widget allow you to get a booking box into yor website",
7
7
  "main": "dist/widget-bundle.umd.js",