@opencx/widget 3.0.3 → 3.0.4
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/basic.cjs +1 -1
- package/dist/basic.cjs.map +1 -1
- package/dist/basic.js +6 -6
- package/dist/basic.js.map +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +2 -2
- package/dist/src/headless/react/hooks/useContact.d.ts +1 -1
- package/dist/src/headless/react/hooks/useMessages.d.ts +1 -1
- package/dist/src/headless/react/hooks/useSession.d.ts +2 -1
- package/dist/{useUploadFiles-gTXt3hYW.cjs → useUploadFiles-DV8T3EPO.cjs} +4 -4
- package/dist/useUploadFiles-DV8T3EPO.cjs.map +1 -0
- package/dist/{useUploadFiles-D-VrK2va.js → useUploadFiles-LHQ541t5.js} +99 -99
- package/dist/useUploadFiles-LHQ541t5.js.map +1 -0
- package/dist-embed/script.js +4 -4
- package/dist-embed/script.js.map +1 -1
- package/package.json +2 -2
- package/dist/useUploadFiles-D-VrK2va.js.map +0 -1
- package/dist/useUploadFiles-gTXt3hYW.cjs.map +0 -1
package/dist-embed/script.js
CHANGED
|
@@ -14,7 +14,7 @@ var fie=Object.defineProperty;var JI=at=>{throw TypeError(at)};var pie=(at,gt,wt
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var yO=y,vO=Symbol.for("react.element"),bO=Symbol.for("react.fragment"),xO=Object.prototype.hasOwnProperty,EO=yO.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,TO={key:!0,ref:!0,__self:!0,__source:!0};function av(e,t,n){var r,i={},a=null,o=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)xO.call(t,r)&&!TO.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:vO,type:e,key:a,ref:o,props:i,_owner:EO.current}}gc.Fragment=bO,gc.jsx=av,gc.jsxs=av,Yy.exports=gc;var T=Yy.exports;const ov="3.0.3";function bc(e){"@babel/helpers - typeof";return bc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bc(e)}var _O=/^\s+/,SO=/\s+$/;function fe(e,t){if(e=e||"",t=t||{},e instanceof fe)return e;if(!(this instanceof fe))return new fe(e,t);var n=CO(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}fe.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),n,r,i,a,o,s;return n=t.r/255,r=t.g/255,i=t.b/255,n<=.03928?a=n/12.92:a=Math.pow((n+.055)/1.055,2.4),r<=.03928?o=r/12.92:o=Math.pow((r+.055)/1.055,2.4),i<=.03928?s=i/12.92:s=Math.pow((i+.055)/1.055,2.4),.2126*a+.7152*o+.0722*s},setAlpha:function(t){return this._a=fv(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=lv(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=lv(this._r,this._g,this._b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.v*100);return this._a==1?"hsv("+n+", "+r+"%, "+i+"%)":"hsva("+n+", "+r+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var t=sv(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=sv(this._r,this._g,this._b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.l*100);return this._a==1?"hsl("+n+", "+r+"%, "+i+"%)":"hsla("+n+", "+r+"%, "+i+"%, "+this._roundA+")"},toHex:function(t){return uv(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return NO(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(ot(this._r,255)*100)+"%",g:Math.round(ot(this._g,255)*100)+"%",b:Math.round(ot(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(ot(this._r,255)*100)+"%, "+Math.round(ot(this._g,255)*100)+"%, "+Math.round(ot(this._b,255)*100)+"%)":"rgba("+Math.round(ot(this._r,255)*100)+"%, "+Math.round(ot(this._g,255)*100)+"%, "+Math.round(ot(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:HO[uv(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var n="#"+cv(this._r,this._g,this._b,this._a),r=n,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=fe(t);r="#"+cv(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+n+",endColorstr="+r+")"},toString:function(t){var n=!!t;t=t||this._format;var r=!1,i=this._a<1&&this._a>=0,a=!n&&i&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return a?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return fe(this.toString())},_applyModification:function(t,n){var r=t.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(DO,arguments)},brighten:function(){return this._applyModification(LO,arguments)},darken:function(){return this._applyModification(MO,arguments)},desaturate:function(){return this._applyModification(PO,arguments)},saturate:function(){return this._applyModification(IO,arguments)},greyscale:function(){return this._applyModification(OO,arguments)},spin:function(){return this._applyModification(FO,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(UO,arguments)},complement:function(){return this._applyCombination(BO,arguments)},monochromatic:function(){return this._applyCombination(zO,arguments)},splitcomplement:function(){return this._applyCombination(jO,arguments)},triad:function(){return this._applyCombination(dv,[3])},tetrad:function(){return this._applyCombination(dv,[4])}},fe.fromRatio=function(e,t){if(bc(e)=="object"){var n={};for(var r in e)e.hasOwnProperty(r)&&(r==="a"?n[r]=e[r]:n[r]=Qs(e[r]));e=n}return fe(e,t)};function CO(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,a=null,o=!1,s=!1;return typeof e=="string"&&(e=YO(e)),bc(e)=="object"&&(Zr(e.r)&&Zr(e.g)&&Zr(e.b)?(t=kO(e.r,e.g,e.b),o=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Zr(e.h)&&Zr(e.s)&&Zr(e.v)?(r=Qs(e.s),i=Qs(e.v),t=RO(e.h,r,i),o=!0,s="hsv"):Zr(e.h)&&Zr(e.s)&&Zr(e.l)&&(r=Qs(e.s),a=Qs(e.l),t=AO(e.h,r,a),o=!0,s="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=fv(n),{ok:o,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}function kO(e,t,n){return{r:ot(e,255)*255,g:ot(t,255)*255,b:ot(n,255)*255}}function sv(e,t,n){e=ot(e,255),t=ot(t,255),n=ot(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),a,o,s=(r+i)/2;if(r==i)a=o=0;else{var l=r-i;switch(o=s>.5?l/(2-r-i):l/(r+i),r){case e:a=(t-n)/l+(t<n?6:0);break;case t:a=(n-e)/l+2;break;case n:a=(e-t)/l+4;break}a/=6}return{h:a,s:o,l:s}}function AO(e,t,n){var r,i,a;e=ot(e,360),t=ot(t,100),n=ot(n,100);function o(u,c,d){return d<0&&(d+=1),d>1&&(d-=1),d<1/6?u+(c-u)*6*d:d<1/2?c:d<2/3?u+(c-u)*(2/3-d)*6:u}if(t===0)r=i=a=n;else{var s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;r=o(l,s,e+1/3),i=o(l,s,e),a=o(l,s,e-1/3)}return{r:r*255,g:i*255,b:a*255}}function lv(e,t,n){e=ot(e,255),t=ot(t,255),n=ot(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),a,o,s=r,l=r-i;if(o=r===0?0:l/r,r==i)a=0;else{switch(r){case e:a=(t-n)/l+(t<n?6:0);break;case t:a=(n-e)/l+2;break;case n:a=(e-t)/l+4;break}a/=6}return{h:a,s:o,v:s}}function RO(e,t,n){e=ot(e,360)*6,t=ot(t,100),n=ot(n,100);var r=Math.floor(e),i=e-r,a=n*(1-t),o=n*(1-i*t),s=n*(1-(1-i)*t),l=r%6,u=[n,o,a,a,s,n][l],c=[s,n,n,o,a,a][l],d=[a,a,s,n,n,o][l];return{r:u*255,g:c*255,b:d*255}}function uv(e,t,n,r){var i=[fr(Math.round(e).toString(16)),fr(Math.round(t).toString(16)),fr(Math.round(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function NO(e,t,n,r,i){var a=[fr(Math.round(e).toString(16)),fr(Math.round(t).toString(16)),fr(Math.round(n).toString(16)),fr(pv(r))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function cv(e,t,n,r){var i=[fr(pv(r)),fr(Math.round(e).toString(16)),fr(Math.round(t).toString(16)),fr(Math.round(n).toString(16))];return i.join("")}fe.equals=function(e,t){return!e||!t?!1:fe(e).toRgbString()==fe(t).toRgbString()},fe.random=function(){return fe.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function PO(e,t){t=t===0?0:t||10;var n=fe(e).toHsl();return n.s-=t/100,n.s=xc(n.s),fe(n)}function IO(e,t){t=t===0?0:t||10;var n=fe(e).toHsl();return n.s+=t/100,n.s=xc(n.s),fe(n)}function OO(e){return fe(e).desaturate(100)}function DO(e,t){t=t===0?0:t||10;var n=fe(e).toHsl();return n.l+=t/100,n.l=xc(n.l),fe(n)}function LO(e,t){t=t===0?0:t||10;var n=fe(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),fe(n)}function MO(e,t){t=t===0?0:t||10;var n=fe(e).toHsl();return n.l-=t/100,n.l=xc(n.l),fe(n)}function FO(e,t){var n=fe(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,fe(n)}function BO(e){var t=fe(e).toHsl();return t.h=(t.h+180)%360,fe(t)}function dv(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=fe(e).toHsl(),r=[fe(e)],i=360/t,a=1;a<t;a++)r.push(fe({h:(n.h+a*i)%360,s:n.s,l:n.l}));return r}function jO(e){var t=fe(e).toHsl(),n=t.h;return[fe(e),fe({h:(n+72)%360,s:t.s,l:t.l}),fe({h:(n+216)%360,s:t.s,l:t.l})]}function UO(e,t,n){t=t||6,n=n||30;var r=fe(e).toHsl(),i=360/n,a=[fe(e)];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,a.push(fe(r));return a}function zO(e,t){t=t||6;for(var n=fe(e).toHsv(),r=n.h,i=n.s,a=n.v,o=[],s=1/t;t--;)o.push(fe({h:r,s:i,v:a})),a=(a+s)%1;return o}fe.mix=function(e,t,n){n=n===0?0:n||50;var r=fe(e).toRgb(),i=fe(t).toRgb(),a=n/100,o={r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a};return fe(o)},fe.readability=function(e,t){var n=fe(e),r=fe(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},fe.isReadable=function(e,t,n){var r=fe.readability(e,t),i,a;switch(a=!1,i=qO(n),i.level+i.size){case"AAsmall":case"AAAlarge":a=r>=4.5;break;case"AAlarge":a=r>=3;break;case"AAAsmall":a=r>=7;break}return a},fe.mostReadable=function(e,t,n){var r=null,i=0,a,o,s,l;n=n||{},o=n.includeFallbackColors,s=n.level,l=n.size;for(var u=0;u<t.length;u++)a=fe.readability(e,t[u]),a>i&&(i=a,r=fe(t[u]));return fe.isReadable(e,r,{level:s,size:l})||!o?r:(n.includeFallbackColors=!1,fe.mostReadable(e,["#fff","#000"],n))};var ph=fe.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},HO=fe.hexNames=VO(ph);function VO(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function fv(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function ot(e,t){$O(e)&&(e="100%");var n=WO(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function xc(e){return Math.min(1,Math.max(0,e))}function In(e){return parseInt(e,16)}function $O(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function WO(e){return typeof e=="string"&&e.indexOf("%")!=-1}function fr(e){return e.length==1?"0"+e:""+e}function Qs(e){return e<=1&&(e=e*100+"%"),e}function pv(e){return Math.round(parseFloat(e)*255).toString(16)}function hv(e){return In(e)/255}var pr=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",n="(?:"+t+")|(?:"+e+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",i="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Zr(e){return!!pr.CSS_UNIT.exec(e)}function YO(e){e=e.replace(_O,"").replace(SO,"").toLowerCase();var t=!1;if(ph[e])e=ph[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=pr.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=pr.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=pr.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=pr.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=pr.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=pr.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=pr.hex8.exec(e))?{r:In(n[1]),g:In(n[2]),b:In(n[3]),a:hv(n[4]),format:t?"name":"hex8"}:(n=pr.hex6.exec(e))?{r:In(n[1]),g:In(n[2]),b:In(n[3]),format:t?"name":"hex"}:(n=pr.hex4.exec(e))?{r:In(n[1]+""+n[1]),g:In(n[2]+""+n[2]),b:In(n[3]+""+n[3]),a:hv(n[4]+""+n[4]),format:t?"name":"hex8"}:(n=pr.hex3.exec(e))?{r:In(n[1]+""+n[1]),g:In(n[2]+""+n[2]),b:In(n[3]+""+n[3]),format:t?"name":"hex"}:!1}function qO(e){var t,n;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:t,size:n}}const GO=400,KO=600,hh={widgetMinHeight:"min-h-[400px]",widgetMaxHeight:"max-h-[600px]",widgetHeight:"h-[600px]"},mv=({primary:e="hsl(0, 0%, 0%)"})=>{const t=fe(e).toHsl(),n=fe(e).isLight()?"240 10% 3.9%":"0 0% 100%";return{"--opencx-primary":`${t.h} ${t.s}% ${t.l}%`,"--opencx-primary-foreground":n,"--opencx-background":"0 0% 100%","--opencx-foreground":"240 10% 3.9%","--opencx-accent":"240 4.8% 95.9%","--opencx-accent-foreground":"240 5.9% 10%","--opencx-destructive":"0 84.2% 60.2%","--opencx-destructive-foreground":"0 0% 98%","--opencx-secondary":"240 4.8% 95.9%","--opencx-secondary-foreground":"240 5.9% 10%","--opencx-muted":"240 4.8% 95.9%","--opencx-muted-foreground":"240 3.8% 46.1%","--opencx-input":"240 5.9% 90%","--opencx-border":"240 5.9% 90%","--opencx-ring":"240 5.9% 10%"}};function XO(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}function Zs(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const mh=e=>Array.isArray(e);function gv(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function Js(e){return typeof e=="string"||Array.isArray(e)}function wv(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function gh(e,t,n,r){if(typeof t=="function"){const[i,a]=wv(r);t=t(n!==void 0?n:e.custom,i,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,a]=wv(r);t=t(n!==void 0?n:e.custom,i,a)}return t}function Ec(e,t,n){const r=e.getProps();return gh(r,t,n!==void 0?n:r.custom,e)}const wh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],yh=["initial",...wh],el=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ri=new Set(el),Jr=e=>e*1e3,ei=e=>e/1e3,QO={type:"spring",stiffness:500,damping:25,restSpeed:10},ZO=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),JO={type:"keyframes",duration:.8},e6={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},t6=(e,{keyframes:t})=>t.length>2?JO:Ri.has(e)?e.startsWith("scale")?ZO(t[1]):QO:e6;function vh(e,t){return e?e[t]||e.default||e:void 0}const n6={skipAnimations:!1,useManualTiming:!1},r6=e=>e!==null;function Tc(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(r6),a=t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const qt=e=>e;function i6(e){let t=new Set,n=new Set,r=!1,i=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function s(u){a.has(u)&&(l.schedule(u),e()),u(o)}const l={schedule:(u,c=!1,d=!1)=>{const p=d&&r?t:n;return c&&a.add(u),p.has(u)||p.add(u),u},cancel:u=>{n.delete(u),a.delete(u)},process:u=>{if(o=u,r){i=!0;return}r=!0,[t,n]=[n,t],n.clear(),t.forEach(s),r=!1,i&&(i=!1,l.process(u))}};return l}const _c=["read","resolveKeyframes","update","preRender","render","postRender"],a6=40;function yv(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=_c.reduce((w,v)=>(w[v]=i6(a),w),{}),{read:s,resolveKeyframes:l,update:u,preRender:c,render:d,postRender:f}=o,p=()=>{const w=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(w-i.timestamp,a6),1),i.timestamp=w,i.isProcessing=!0,s.process(i),l.process(i),u.process(i),c.process(i),d.process(i),f.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(p))},m=()=>{n=!0,r=!0,i.isProcessing||e(p)};return{schedule:_c.reduce((w,v)=>{const b=o[v];return w[v]=(E,_=!1,S=!1)=>(n||m(),b.schedule(E,_,S)),w},{}),cancel:w=>{for(let v=0;v<_c.length;v++)o[_c[v]].cancel(w)},state:i,steps:o}}const{schedule:Xe,cancel:Ni,state:Ut,steps:bh}=yv(typeof requestAnimationFrame<"u"?requestAnimationFrame:qt,!0),vv=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,o6=1e-7,s6=12;function l6(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=vv(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>o6&&++s<s6);return o}function tl(e,t,n,r){if(e===t&&n===r)return qt;const i=a=>l6(a,0,1,e,n);return a=>a===0||a===1?a:vv(i(a),t,r)}const bv=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,xv=e=>t=>1-e(1-t),Ev=tl(.33,1.53,.69,.99),xh=xv(Ev),Tv=bv(xh),_v=e=>(e*=2)<1?.5*xh(e):.5*(2-Math.pow(2,-10*(e-1))),Eh=e=>1-Math.sin(Math.acos(e)),Sv=xv(Eh),Cv=bv(Eh),kv=e=>/^0[^.\s]+$/u.test(e);function u6(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||kv(e):!0}let Th=qt;const Av=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Rv=e=>t=>typeof t=="string"&&t.startsWith(e),Nv=Rv("--"),c6=Rv("var(--"),_h=e=>c6(e)?d6.test(e.split("/*")[0].trim()):!1,d6=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,f6=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function p6(e){const t=f6.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function Pv(e,t,n=1){const[r,i]=p6(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const o=a.trim();return Av(o)?parseFloat(o):o}return _h(i)?Pv(i,t,n+1):i}const Pi=(e,t,n)=>n>t?t:n<e?e:n,So={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},nl={...So,transform:e=>Pi(0,1,e)},Sc={...So,default:1},rl=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ii=rl("deg"),Pr=rl("%"),we=rl("px"),h6=rl("vh"),m6=rl("vw"),Iv={...Pr,parse:e=>Pr.parse(e)/100,transform:e=>Pr.transform(e*100)},g6=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Ov=e=>e===So||e===we,Dv=(e,t)=>parseFloat(e.split(", ")[t]),Lv=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return Dv(i[1],t);{const a=r.match(/^matrix\((.+)\)$/u);return a?Dv(a[1],e):0}},w6=new Set(["x","y","z"]),y6=el.filter(e=>!w6.has(e));function v6(e){const t=[];return y6.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Co={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Lv(4,13),y:Lv(5,14)};Co.translateX=Co.x,Co.translateY=Co.y;const Mv=e=>t=>t.test(e),Fv=[So,we,Pr,Ii,m6,h6,{test:e=>e==="auto",parse:e=>e}],Bv=e=>Fv.find(Mv(e)),La=new Set;let Sh=!1,Ch=!1;function jv(){if(Ch){const e=Array.from(La).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=v6(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([a,o])=>{var s;(s=r.getValue(a))===null||s===void 0||s.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Ch=!1,Sh=!1,La.forEach(e=>e.complete()),La.clear()}function Uv(){La.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ch=!0)})}function b6(){Uv(),jv()}class kh{constructor(t,n,r,i,a,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=a,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(La.add(this),Sh||(Sh=!0,Xe.read(Uv),Xe.resolveKeyframes(jv))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let a=0;a<t.length;a++)if(t[a]===null)if(a===0){const o=i==null?void 0:i.get(),s=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const l=r.readValue(n,s);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=s),i&&o===void 0&&i.set(t[0])}else t[a]=t[a-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),La.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,La.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const il=e=>Math.round(e*1e5)/1e5,Ah=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function x6(e){return e==null}const E6=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Rh=(e,t)=>n=>!!(typeof n=="string"&&E6.test(n)&&n.startsWith(e)||t&&!x6(n)&&Object.prototype.hasOwnProperty.call(n,t)),zv=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,a,o,s]=r.match(Ah);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s!==void 0?parseFloat(s):1}},T6=e=>Pi(0,255,e),Nh={...So,transform:e=>Math.round(T6(e))},Ma={test:Rh("rgb","red"),parse:zv("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Nh.transform(e)+", "+Nh.transform(t)+", "+Nh.transform(n)+", "+il(nl.transform(r))+")"};function _6(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const Ph={test:Rh("#"),parse:_6,transform:Ma.transform},ko={test:Rh("hsl","hue"),parse:zv("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Pr.transform(il(t))+", "+Pr.transform(il(n))+", "+il(nl.transform(r))+")"},Gt={test:e=>Ma.test(e)||Ph.test(e)||ko.test(e),parse:e=>Ma.test(e)?Ma.parse(e):ko.test(e)?ko.parse(e):Ph.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ma.transform(e):ko.transform(e)},S6=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function C6(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Ah))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(S6))===null||n===void 0?void 0:n.length)||0)>0}const Hv="number",Vv="color",k6="var",A6="var(",$v="${}",R6=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function al(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let a=0;const s=t.replace(R6,l=>(Gt.test(l)?(r.color.push(a),i.push(Vv),n.push(Gt.parse(l))):l.startsWith(A6)?(r.var.push(a),i.push(k6),n.push(l)):(r.number.push(a),i.push(Hv),n.push(parseFloat(l))),++a,$v)).split($v);return{values:n,split:s,indexes:r,types:i}}function Wv(e){return al(e).values}function Yv(e){const{split:t,types:n}=al(e),r=t.length;return i=>{let a="";for(let o=0;o<r;o++)if(a+=t[o],i[o]!==void 0){const s=n[o];s===Hv?a+=il(i[o]):s===Vv?a+=Gt.transform(i[o]):a+=i[o]}return a}}const N6=e=>typeof e=="number"?0:e;function P6(e){const t=Wv(e);return Yv(e)(t.map(N6))}const Oi={test:C6,parse:Wv,createTransformer:Yv,getAnimatableNone:P6},I6=new Set(["brightness","contrast","saturate","opacity"]);function O6(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Ah)||[];if(!r)return e;const i=n.replace(r,"");let a=I6.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+i+")"}const D6=/\b([a-z-]*)\(.*?\)/gu,Ih={...Oi,getAnimatableNone:e=>{const t=e.match(D6);return t?t.map(O6).join(" "):e}},L6={borderWidth:we,borderTopWidth:we,borderRightWidth:we,borderBottomWidth:we,borderLeftWidth:we,borderRadius:we,radius:we,borderTopLeftRadius:we,borderTopRightRadius:we,borderBottomRightRadius:we,borderBottomLeftRadius:we,width:we,maxWidth:we,height:we,maxHeight:we,top:we,right:we,bottom:we,left:we,padding:we,paddingTop:we,paddingRight:we,paddingBottom:we,paddingLeft:we,margin:we,marginTop:we,marginRight:we,marginBottom:we,marginLeft:we,backgroundPositionX:we,backgroundPositionY:we},M6={rotate:Ii,rotateX:Ii,rotateY:Ii,rotateZ:Ii,scale:Sc,scaleX:Sc,scaleY:Sc,scaleZ:Sc,skew:Ii,skewX:Ii,skewY:Ii,distance:we,translateX:we,translateY:we,translateZ:we,x:we,y:we,z:we,perspective:we,transformPerspective:we,opacity:nl,originX:Iv,originY:Iv,originZ:we},qv={...So,transform:Math.round},Oh={...L6,...M6,zIndex:qv,size:we,fillOpacity:nl,strokeOpacity:nl,numOctaves:qv},F6={...Oh,color:Gt,backgroundColor:Gt,outlineColor:Gt,fill:Gt,stroke:Gt,borderColor:Gt,borderTopColor:Gt,borderRightColor:Gt,borderBottomColor:Gt,borderLeftColor:Gt,filter:Ih,WebkitFilter:Ih},Dh=e=>F6[e];function Gv(e,t){let n=Dh(e);return n!==Ih&&(n=Oi),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const B6=new Set(["auto","none","0"]);function j6(e,t,n){let r=0,i;for(;r<e.length&&!i;){const a=e[r];typeof a=="string"&&!B6.has(a)&&al(a).values.length&&(i=e[r]),r++}if(i&&n)for(const a of t)e[a]=Gv(n,i)}class Kv extends kh{constructor(t,n,r,i,a){super(t,n,r,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let u=t[l];if(typeof u=="string"&&(u=u.trim(),_h(u))){const c=Pv(u,n.current);c!==void 0&&(t[l]=c),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!g6.has(r)||t.length!==2)return;const[i,a]=t,o=Bv(i),s=Bv(a);if(o!==s)if(Ov(o)&&Ov(s))for(let l=0;l<t.length;l++){const u=t[l];typeof u=="string"&&(t[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)u6(t[i])&&r.push(i);r.length&&j6(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Co[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const a=n.getValue(r);a&&a.jump(this.measuredOrigin,!1);const o=i.length-1,s=i[o];i[o]=Co[r](n.measureViewportBox(),window.getComputedStyle(n.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,u])=>{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function Lh(e){return typeof e=="function"}let Cc;function U6(){Cc=void 0}const Ir={now:()=>(Cc===void 0&&Ir.set(Ut.isProcessing||n6.useManualTiming?Ut.timestamp:performance.now()),Cc),set:e=>{Cc=e,queueMicrotask(U6)}},Xv=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Oi.test(e)||e==="0")&&!e.startsWith("url("));function z6(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function H6(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],o=Xv(i,t),s=Xv(a,t);return!o||!s?!1:z6(e)||(n==="spring"||Lh(n))&&r}const V6=40;class Qv{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",...s}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Ir.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:a,repeatType:o,...s},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>V6?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&b6(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Ir.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:a,delay:o,onComplete:s,onUpdate:l,isGenerator:u}=this.options;if(!u&&!H6(t,r,i,a))if(o)this.options.duration=0;else{l==null||l(Tc(t,this.options,n)),s==null||s(),this.resolveFinishedPromise();return}const c=this.initPlayback(t,n);c!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...c},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}function Zv(e,t){return t?e*(1e3/t):0}const $6=5;function Jv(e,t,n){const r=Math.max(t-$6,0);return Zv(n-e(r),t-r)}const Mh=.001,W6=.01,Y6=10,q6=.05,G6=1;function K6({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,a,o=1-t;o=Pi(q6,G6,o),e=Pi(W6,Y6,ei(e)),o<1?(i=u=>{const c=u*o,d=c*e,f=c-n,p=Fh(u,o),m=Math.exp(-d);return Mh-f/p*m},a=u=>{const d=u*o*e,f=d*n+n,p=Math.pow(o,2)*Math.pow(u,2)*e,m=Math.exp(-d),g=Fh(Math.pow(u,2),o);return(-i(u)+Mh>0?-1:1)*((f-p)*m)/g}):(i=u=>{const c=Math.exp(-u*e),d=(u-n)*e+1;return-Mh+c*d},a=u=>{const c=Math.exp(-u*e),d=(n-u)*(e*e);return c*d});const s=5/e,l=Q6(i,a,s);if(e=Jr(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const X6=12;function Q6(e,t,n){let r=n;for(let i=1;i<X6;i++)r=r-e(r)/t(r);return r}function Fh(e,t){return e*Math.sqrt(1-t*t)}const Z6=["duration","bounce"],J6=["stiffness","damping","mass"];function eb(e,t){return t.some(n=>e[n]!==void 0)}function e4(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!eb(e,J6)&&eb(e,Z6)){const n=K6(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}function tb({keyframes:e,restDelta:t,restSpeed:n,...r}){const i=e[0],a=e[e.length-1],o={done:!1,value:i},{stiffness:s,damping:l,mass:u,duration:c,velocity:d,isResolvedFromDuration:f}=e4({...r,velocity:-ei(r.velocity||0)}),p=d||0,m=l/(2*Math.sqrt(s*u)),g=a-i,x=ei(Math.sqrt(s/u)),w=Math.abs(g)<5;n||(n=w?.01:2),t||(t=w?.005:.5);let v;if(m<1){const b=Fh(x,m);v=E=>{const _=Math.exp(-m*x*E);return a-_*((p+m*x*g)/b*Math.sin(b*E)+g*Math.cos(b*E))}}else if(m===1)v=b=>a-Math.exp(-x*b)*(g+(p+x*g)*b);else{const b=x*Math.sqrt(m*m-1);v=E=>{const _=Math.exp(-m*x*E),S=Math.min(b*E,300);return a-_*((p+m*x*g)*Math.sinh(S)+b*g*Math.cosh(S))/b}}return{calculatedDuration:f&&c||null,next:b=>{const E=v(b);if(f)o.done=b>=c;else{let _=0;m<1&&(_=b===0?Jr(p):Jv(v,b,E));const S=Math.abs(_)<=n,I=Math.abs(a-E)<=t;o.done=S&&I}return o.value=o.done?a:E,o}}}function nb({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:l,restDelta:u=.5,restSpeed:c}){const d=e[0],f={done:!1,value:d},p=D=>s!==void 0&&D<s||l!==void 0&&D>l,m=D=>s===void 0?l:l===void 0||Math.abs(s-D)<Math.abs(l-D)?s:l;let g=n*t;const x=d+g,w=o===void 0?x:o(x);w!==x&&(g=w-d);const v=D=>-g*Math.exp(-D/r),b=D=>w+v(D),E=D=>{const V=v(D),N=b(D);f.done=Math.abs(V)<=u,f.value=f.done?w:N};let _,S;const I=D=>{p(f.value)&&(_=D,S=tb({keyframes:[f.value,m(f.value)],velocity:Jv(b,D,f.value),damping:i,stiffness:a,restDelta:u,restSpeed:c}))};return I(0),{calculatedDuration:null,next:D=>{let V=!1;return!S&&_===void 0&&(V=!0,E(D),I(D)),_!==void 0&&D>=_?S.next(D-_):(!V&&E(D),f)}}}const t4=tl(.42,0,1,1),n4=tl(0,0,.58,1),rb=tl(.42,0,.58,1),r4=e=>Array.isArray(e)&&typeof e[0]!="number",Bh=e=>Array.isArray(e)&&typeof e[0]=="number",ib={linear:qt,easeIn:t4,easeInOut:rb,easeOut:n4,circIn:Eh,circInOut:Cv,circOut:Sv,backIn:xh,backInOut:Tv,backOut:Ev,anticipate:_v},ab=e=>{if(Bh(e)){Th(e.length===4);const[t,n,r,i]=e;return tl(t,n,r,i)}else if(typeof e=="string")return Th(ib[e]!==void 0),ib[e];return e},i4=(e,t)=>n=>t(e(n)),ti=(...e)=>e.reduce(i4),Ao=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},ut=(e,t,n)=>e+(t-e)*n;function jh(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function a4({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;i=jh(l,s,e+1/3),a=jh(l,s,e),o=jh(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function kc(e,t){return n=>n>0?t:e}const Uh=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},o4=[Ph,Ma,ko],s4=e=>o4.find(t=>t.test(e));function ob(e){const t=s4(e);if(!t)return!1;let n=t.parse(e);return t===ko&&(n=a4(n)),n}const sb=(e,t)=>{const n=ob(e),r=ob(t);if(!n||!r)return kc(e,t);const i={...n};return a=>(i.red=Uh(n.red,r.red,a),i.green=Uh(n.green,r.green,a),i.blue=Uh(n.blue,r.blue,a),i.alpha=ut(n.alpha,r.alpha,a),Ma.transform(i))},zh=new Set(["none","hidden"]);function l4(e,t){return zh.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function u4(e,t){return n=>ut(e,t,n)}function Hh(e){return typeof e=="number"?u4:typeof e=="string"?_h(e)?kc:Gt.test(e)?sb:f4:Array.isArray(e)?lb:typeof e=="object"?Gt.test(e)?sb:c4:kc}function lb(e,t){const n=[...e],r=n.length,i=e.map((a,o)=>Hh(a)(a,t[o]));return a=>{for(let o=0;o<r;o++)n[o]=i[o](a);return n}}function c4(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Hh(e[i])(e[i],t[i]));return i=>{for(const a in r)n[a]=r[a](i);return n}}function d4(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const o=t.types[a],s=e.indexes[o][i[o]],l=(n=e.values[s])!==null&&n!==void 0?n:0;r[a]=l,i[o]++}return r}const f4=(e,t)=>{const n=Oi.createTransformer(t),r=al(e),i=al(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?zh.has(e)&&!i.values.length||zh.has(t)&&!r.values.length?l4(e,t):ti(lb(d4(r,i),i.values),n):kc(e,t)};function ub(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ut(e,t,n):Hh(e)(e,t)}function p4(e,t,n){const r=[],i=n||ub,a=e.length-1;for(let o=0;o<a;o++){let s=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||qt:t;s=ti(l,s)}r.push(s)}return r}function h4(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const a=e.length;if(Th(a===t.length),a===1)return()=>t[0];if(a===2&&e[0]===e[1])return()=>t[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=p4(t,r,i),s=o.length,l=u=>{let c=0;if(s>1)for(;c<e.length-2&&!(u<e[c+1]);c++);const d=Ao(e[c],e[c+1],u);return o[c](d)};return n?u=>l(Pi(e[0],e[a-1],u)):l}function m4(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Ao(0,t,r);e.push(ut(n,1,i))}}function g4(e){const t=[0];return m4(t,e.length-1),t}function w4(e,t){return e.map(n=>n*t)}function y4(e,t){return e.map(()=>t||rb).splice(0,e.length-1)}function Ac({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=r4(r)?r.map(ab):ab(r),a={done:!1,value:t[0]},o=w4(n&&n.length===t.length?n:g4(t),e),s=h4(o,t,{ease:Array.isArray(i)?i:y4(t,i)});return{calculatedDuration:e,next:l=>(a.value=s(l),a.done=l>=e,a)}}const cb=2e4;function v4(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<cb;)t+=n,r=e.next(t);return t>=cb?1/0:t}const b4=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Xe.update(t,!0),stop:()=>Ni(t),now:()=>Ut.isProcessing?Ut.timestamp:Ir.now()}},x4={decay:nb,inertia:nb,tween:Ac,keyframes:Ac,spring:tb},E4=e=>e/100;class Vh extends Qv{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:i,keyframes:a}=this.options,o=(i==null?void 0:i.KeyframeResolver)||kh,s=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new o(a,s,n,r,i),this.resolver.scheduleResolve()}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:a,velocity:o=0}=this.options,s=Lh(n)?n:x4[n]||Ac;let l,u;s!==Ac&&typeof t[0]!="number"&&(l=ti(E4,ub(t[0],t[1])),t=[0,100]);const c=s({...this.options,keyframes:t});a==="mirror"&&(u=s({...this.options,keyframes:[...t].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=v4(c));const{calculatedDuration:d}=c,f=d+i,p=f*(r+1)-i;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:d,resolvedDuration:f,totalDuration:p}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:D}=this.options;return{done:!0,value:D[D.length-1]}}const{finalKeyframe:i,generator:a,mirroredGenerator:o,mapPercentToKeyframes:s,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:d}=r;if(this.startTime===null)return a.next(0);const{delay:f,repeat:p,repeatType:m,repeatDelay:g,onUpdate:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-c/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const w=this.currentTime-f*(this.speed>=0?1:-1),v=this.speed>=0?w<0:w>c;this.currentTime=Math.max(w,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let b=this.currentTime,E=a;if(p){const D=Math.min(this.currentTime,c)/d;let V=Math.floor(D),N=D%1;!N&&D>=1&&(N=1),N===1&&V--,V=Math.min(V,p+1),!!(V%2)&&(m==="reverse"?(N=1-N,g&&(N-=g/d)):m==="mirror"&&(E=o)),b=Pi(0,1,N)*d}const _=v?{done:!1,value:l[0]}:E.next(b);s&&(_.value=s(_.value));let{done:S}=_;!v&&u!==null&&(S=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const I=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return I&&i!==void 0&&(_.value=Tc(l,this.options,i)),x&&x(_.value),I&&this.finish(),_}get duration(){const{resolved:t}=this;return t?ei(t.calculatedDuration):0}get time(){return ei(this.currentTime)}set time(t){t=Jr(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ei(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=b4,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const db=new Set(["opacity","clipPath","filter","transform"]),T4=10,_4=(e,t)=>{let n="";const r=Math.max(Math.round(t/T4),2);for(let i=0;i<r;i++)n+=e(Ao(0,r-1,i))+", ";return`linear(${n.substring(0,n.length-2)})`};function $h(e){let t;return()=>(t===void 0&&(t=e()),t)}const S4={linearEasing:void 0};function C4(e,t){const n=$h(e);return()=>{var r;return(r=S4[t])!==null&&r!==void 0?r:n()}}const Rc=C4(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");function fb(e){return!!(typeof e=="function"&&Rc()||!e||typeof e=="string"&&(e in Wh||Rc())||Bh(e)||Array.isArray(e)&&e.every(fb))}const ol=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Wh={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ol([0,.65,.55,1]),circOut:ol([.55,0,1,.45]),backIn:ol([.31,.01,.66,-.59]),backOut:ol([.33,1.53,.69,.99])};function pb(e,t){if(e)return typeof e=="function"&&Rc()?_4(e,t):Bh(e)?ol(e):Array.isArray(e)?e.map(n=>pb(n,t)||Wh.easeOut):Wh[e]}function k4(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:s,times:l}={}){const u={[t]:n};l&&(u.offset=l);const c=pb(s,i);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:r,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"})}function hb(e,t){e.timeline=t,e.onfinish=null}const A4=$h(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Nc=10,R4=2e4;function N4(e){return Lh(e.type)||e.type==="spring"||!fb(e.ease)}function P4(e,t){const n=new Vh({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let a=0;for(;!r.done&&a<R4;)r=n.sample(a),i.push(r.value),a+=Nc;return{times:void 0,keyframes:i,duration:a-Nc,ease:"linear"}}const mb={anticipate:_v,backInOut:Tv,circInOut:Cv};function I4(e){return e in mb}class gb extends Qv{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:a}=this.options;this.resolver=new Kv(a,(o,s)=>this.onKeyframesResolved(o,s),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){var r;let{duration:i=300,times:a,ease:o,type:s,motionValue:l,name:u,startTime:c}=this.options;if(!(!((r=l.owner)===null||r===void 0)&&r.current))return!1;if(typeof o=="string"&&Rc()&&I4(o)&&(o=mb[o]),N4(this.options)){const{onComplete:f,onUpdate:p,motionValue:m,element:g,...x}=this.options,w=P4(t,x);t=w.keyframes,t.length===1&&(t[1]=t[0]),i=w.duration,a=w.times,o=w.ease,s="keyframes"}const d=k4(l.owner.current,u,t,{...this.options,duration:i,times:a,ease:o});return d.startTime=c??this.calcStartTime(),this.pendingTimeline?(hb(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(Tc(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:i,times:a,type:s,ease:o,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return ei(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return ei(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Jr(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return qt;const{animation:r}=n;hb(r,t)}return qt}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:a,ease:o,times:s}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:c,onComplete:d,element:f,...p}=this.options,m=new Vh({...p,keyframes:r,duration:i,type:a,ease:o,times:s,isGenerator:!0}),g=Jr(this.time);u.setWithVelocity(m.sample(g-Nc).value,m.sample(g).value,Nc)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:a,damping:o,type:s}=t;return A4()&&r&&db.has(r)&&n&&n.owner&&n.owner.current instanceof HTMLElement&&!n.owner.getProps().onUpdate&&!i&&a!=="mirror"&&o!==0&&s!=="inertia"}}const O4=$h(()=>window.ScrollTimeline!==void 0);class D4{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}then(t,n){return Promise.all(this.animations).then(t).catch(n)}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>O4()&&i.attachTimeline?i.attachTimeline(t):n(i));return()=>{r.forEach((i,a)=>{i&&i(),this.animations[a].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function L4({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:s,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const Yh=(e,t,n,r={},i,a)=>o=>{const s=vh(r,e)||{},l=s.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Jr(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-u,onUpdate:f=>{t.set(f),s.onUpdate&&s.onUpdate(f)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};L4(s)||(c={...c,...t6(e,c)}),c.duration&&(c.duration=Jr(c.duration)),c.repeatDelay&&(c.repeatDelay=Jr(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let d=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(d=!0)),d&&!a&&t.get()!==void 0){const f=Tc(c.keyframes,s);if(f!==void 0)return Xe.update(()=>{c.onUpdate(f),c.onComplete()}),new D4([])}return!a&&gb.supports(c)?new gb(c):new Vh(c)},M4=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),F4=e=>mh(e)?e[e.length-1]||0:e;function qh(e,t){e.indexOf(t)===-1&&e.push(t)}function Gh(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Kh{constructor(){this.subscriptions=[]}add(t){return qh(this.subscriptions,t),()=>Gh(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let a=0;a<i;a++){const o=this.subscriptions[a];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const wb=30,B4=e=>!isNaN(parseFloat(e));class j4{constructor(t,n={}){this.version="11.11.9",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const a=Ir.now();this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Ir.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=B4(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Kh);const r=this.events[t].add(n);return t==="change"?()=>{r(),Xe.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ir.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>wb)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,wb);return Zv(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function sl(e,t){return new j4(e,t)}function U4(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,sl(n))}function z4(e,t){const n=Ec(e,t);let{transitionEnd:r={},transition:i={},...a}=n||{};a={...a,...r};for(const o in a){const s=F4(a[o]);U4(e,o,s)}}const Pc=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),yb="data-"+Pc("framerAppearId");function vb(e){return e.props[yb]}const Kt=e=>!!(e&&e.getVelocity);function H4(e){return!!(Kt(e)&&e.add)}function Xh(e,t){if(!e.applyWillChange)return;const n=e.getValue("willChange");if(H4(n))return n.add(t)}function V4({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function bb(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var a;let{transition:o=e.getDefaultTransition(),transitionEnd:s,...l}=t;r&&(o=r);const u=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const d in l){const f=e.getValue(d,(a=e.latestValues[d])!==null&&a!==void 0?a:null),p=l[d];if(p===void 0||c&&V4(c,d))continue;const m={delay:n,...vh(o||{},d)};let g=!1;if(window.MotionHandoffAnimation){const w=vb(e);if(w){const v=window.MotionHandoffAnimation(w,d,Xe);v!==null&&(m.startTime=v,g=!0)}}Xh(e,d),f.start(Yh(d,f,p,e.shouldReduceMotion&&Ri.has(d)?{type:!1}:m,e,g));const x=f.animation;x&&u.push(x)}return s&&Promise.all(u).then(()=>{Xe.update(()=>{s&&z4(e,s)})}),u}function Qh(e,t,n={}){var r;const i=Ec(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(a=n.transitionOverride);const o=i?()=>Promise.all(bb(e,i,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:d,staggerDirection:f}=a;return $4(e,t,c+u,d,f,n)}:()=>Promise.resolve(),{when:l}=a;if(l){const[u,c]=l==="beforeChildren"?[o,s]:[s,o];return u().then(()=>c())}else return Promise.all([o(),s(n.delay)])}function $4(e,t,n=0,r=0,i=1,a){const o=[],s=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>s-u*r;return Array.from(e.variantChildren).sort(W4).forEach((u,c)=>{u.notify("AnimationStart",t),o.push(Qh(u,t,{...a,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function W4(e,t){return e.sortNodePosition(t)}function Y4(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(a=>Qh(e,a,n));r=Promise.all(i)}else if(typeof t=="string")r=Qh(e,t,n);else{const i=typeof t=="function"?Ec(e,t,n.custom):t;r=Promise.all(bb(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const q4=yh.length;function xb(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?xb(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<q4;n++){const r=yh[n],i=e.props[r];(Js(i)||i===!1)&&(t[r]=i)}return t}const G4=[...wh].reverse(),K4=wh.length;function X4(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Y4(e,n,r)))}function Q4(e){let t=X4(e),n=Eb(),r=!0;const i=l=>(u,c)=>{var d;const f=Ec(e,c,l==="exit"?(d=e.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(f){const{transition:p,transitionEnd:m,...g}=f;u={...u,...g,...m}}return u};function a(l){t=l(e)}function o(l){const{props:u}=e,c=xb(e.parent)||{},d=[],f=new Set;let p={},m=1/0;for(let x=0;x<K4;x++){const w=G4[x],v=n[w],b=u[w]!==void 0?u[w]:c[w],E=Js(b),_=w===l?v.isActive:null;_===!1&&(m=x);let S=b===c[w]&&b!==u[w]&&E;if(S&&r&&e.manuallyAnimateOnMount&&(S=!1),v.protectedKeys={...p},!v.isActive&&_===null||!b&&!v.prevProp||Zs(b)||typeof b=="boolean")continue;const I=Z4(v.prevProp,b);let D=I||w===l&&v.isActive&&!S&&E||x>m&&E,V=!1;const N=Array.isArray(b)?b:[b];let $=N.reduce(i(w),{});_===!1&&($={});const{prevResolvedValues:z={}}=v,X={...z,...$},Y=ee=>{D=!0,f.has(ee)&&(V=!0,f.delete(ee)),v.needsAnimating[ee]=!0;const F=e.getValue(ee);F&&(F.liveStyle=!1)};for(const ee in X){const F=$[ee],B=z[ee];if(p.hasOwnProperty(ee))continue;let k=!1;mh(F)&&mh(B)?k=!gv(F,B):k=F!==B,k?F!=null?Y(ee):f.add(ee):F!==void 0&&f.has(ee)?Y(ee):v.protectedKeys[ee]=!0}v.prevProp=b,v.prevResolvedValues=$,v.isActive&&(p={...p,...$}),r&&e.blockInitialAnimation&&(D=!1),D&&(!(S&&I)||V)&&d.push(...N.map(ee=>({animation:ee,options:{type:w}})))}if(f.size){const x={};f.forEach(w=>{const v=e.getBaseTarget(w),b=e.getValue(w);b&&(b.liveStyle=!0),x[w]=v??null}),d.push({animation:x})}let g=!!d.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(g=!1),r=!1,g?t(d):Promise.resolve()}function s(l,u){var c;if(n[l].isActive===u)return Promise.resolve();(c=e.variantChildren)===null||c===void 0||c.forEach(f=>{var p;return(p=f.animationState)===null||p===void 0?void 0:p.setActive(l,u)}),n[l].isActive=u;const d=o(l);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:o,setActive:s,setAnimateFunction:a,getState:()=>n,reset:()=>{n=Eb(),r=!0}}}function Z4(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!gv(t,e):!1}function Fa(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Eb(){return{animate:Fa(!0),whileInView:Fa(),whileHover:Fa(),whileTap:Fa(),whileDrag:Fa(),whileFocus:Fa(),exit:Fa()}}class Di{constructor(t){this.isMounted=!1,this.node=t}update(){}}class J4 extends Di{constructor(t){super(t),t.animationState||(t.animationState=Q4(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Zs(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let e5=0;class t5 extends Di{constructor(){super(...arguments),this.id=e5++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const n5={animation:{Feature:J4},exit:{Feature:t5}},Tb=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Ic(e,t="page"){return{point:{x:e[`${t}X`],y:e[`${t}Y`]}}}const r5=e=>t=>Tb(t)&&e(t,Ic(t));function ni(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function ri(e,t,n,r){return ni(e,t,r5(n),r)}const _b=(e,t)=>Math.abs(e-t);function i5(e,t){const n=_b(e.x,t.x),r=_b(e.y,t.y);return Math.sqrt(n**2+r**2)}class Sb{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:a=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Jh(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=i5(d.offset,{x:0,y:0})>=3;if(!f&&!p)return;const{point:m}=d,{timestamp:g}=Ut;this.history.push({...m,timestamp:g});const{onStart:x,onMove:w}=this.handlers;f||(x&&x(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Zh(f,this.transformPagePoint),Xe.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Jh(d.type==="pointercancel"?this.lastMoveEventInfo:Zh(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,x),m&&m(d,x)},!Tb(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=Ic(t),s=Zh(o,this.transformPagePoint),{point:l}=s,{timestamp:u}=Ut;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=n;c&&c(t,Jh(s,this.history)),this.removeListeners=ti(ri(this.contextWindow,"pointermove",this.handlePointerMove),ri(this.contextWindow,"pointerup",this.handlePointerUp),ri(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Ni(this.updatePoint)}}function Zh(e,t){return t?{point:t(e.point)}:e}function Cb(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Jh({point:e},t){return{point:e,delta:Cb(e,kb(t)),offset:Cb(e,a5(t)),velocity:o5(t,.1)}}function a5(e){return e[0]}function kb(e){return e[e.length-1]}function o5(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=kb(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Jr(t)));)n--;if(!r)return{x:0,y:0};const a=ei(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Ab(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const Rb=Ab("dragHorizontal"),Nb=Ab("dragVertical");function Pb(e){let t=!1;if(e==="y")t=Nb();else if(e==="x")t=Rb();else{const n=Rb(),r=Nb();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function Ib(){const e=Pb(!0);return e?(e(),!1):!0}function Ro(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}const Ob=1e-4,s5=1-Ob,l5=1+Ob,Db=.01,u5=0-Db,c5=0+Db;function On(e){return e.max-e.min}function d5(e,t,n){return Math.abs(e-t)<=n}function Lb(e,t,n,r=.5){e.origin=r,e.originPoint=ut(t.min,t.max,e.origin),e.scale=On(n)/On(t),e.translate=ut(n.min,n.max,e.origin)-e.originPoint,(e.scale>=s5&&e.scale<=l5||isNaN(e.scale))&&(e.scale=1),(e.translate>=u5&&e.translate<=c5||isNaN(e.translate))&&(e.translate=0)}function ll(e,t,n,r){Lb(e.x,t.x,n.x,r?r.originX:void 0),Lb(e.y,t.y,n.y,r?r.originY:void 0)}function Mb(e,t,n){e.min=n.min+t.min,e.max=e.min+On(t)}function f5(e,t,n){Mb(e.x,t.x,n.x),Mb(e.y,t.y,n.y)}function Fb(e,t,n){e.min=t.min-n.min,e.max=e.min+On(t)}function ul(e,t,n){Fb(e.x,t.x,n.x),Fb(e.y,t.y,n.y)}function p5(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ut(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ut(n,e,r.max):Math.min(e,n)),e}function Bb(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function h5(e,{top:t,left:n,bottom:r,right:i}){return{x:Bb(e.x,n,i),y:Bb(e.y,t,r)}}function jb(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function m5(e,t){return{x:jb(e.x,t.x),y:jb(e.y,t.y)}}function g5(e,t){let n=.5;const r=On(e),i=On(t);return i>r?n=Ao(t.min,t.max-r,e.min):r>i&&(n=Ao(e.min,e.max-i,t.min)),Pi(0,1,n)}function w5(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const em=.35;function y5(e=em){return e===!1?e=0:e===!0&&(e=em),{x:Ub(e,"left","right"),y:Ub(e,"top","bottom")}}function Ub(e,t,n){return{min:zb(e,t),max:zb(e,n)}}function zb(e,t){return typeof e=="number"?e:e[t]||0}const Hb=()=>({translate:0,scale:1,origin:0,originPoint:0}),No=()=>({x:Hb(),y:Hb()}),Vb=()=>({min:0,max:0}),Et=()=>({x:Vb(),y:Vb()});function Kn(e){return[e("x"),e("y")]}function $b({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function v5({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function b5(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function tm(e){return e===void 0||e===1}function nm({scale:e,scaleX:t,scaleY:n}){return!tm(e)||!tm(t)||!tm(n)}function Ba(e){return nm(e)||Wb(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Wb(e){return Yb(e.x)||Yb(e.y)}function Yb(e){return e&&e!=="0%"}function Oc(e,t,n){const r=e-n,i=t*r;return n+i}function qb(e,t,n,r,i){return i!==void 0&&(e=Oc(e,i,r)),Oc(e,n,r)+t}function rm(e,t=0,n=1,r,i){e.min=qb(e.min,t,n,r,i),e.max=qb(e.max,t,n,r,i)}function Gb(e,{x:t,y:n}){rm(e.x,t.translate,t.scale,t.originPoint),rm(e.y,n.translate,n.scale,n.originPoint)}const Kb=.999999999999,Xb=1.0000000000001;function x5(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;const{visualElement:l}=a.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Io(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Gb(e,o)),r&&Ba(a.latestValues)&&Io(e,a.latestValues))}t.x<Xb&&t.x>Kb&&(t.x=1),t.y<Xb&&t.y>Kb&&(t.y=1)}function Po(e,t){e.min=e.min+t,e.max=e.max+t}function Qb(e,t,n,r,i=.5){const a=ut(e.min,e.max,i);rm(e,t,n,a,r)}function Io(e,t){Qb(e.x,t.x,t.scaleX,t.scale,t.originX),Qb(e.y,t.y,t.scaleY,t.scale,t.originY)}function Zb(e,t){return $b(b5(e.getBoundingClientRect(),t))}function E5(e,t,n){const r=Zb(e,n),{scroll:i}=t;return i&&(Po(r.x,i.offset.x),Po(r.y,i.offset.y)),r}const Jb=({current:e})=>e?e.ownerDocument.defaultView:null,T5=new WeakMap;class _5{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Et(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=c=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Ic(c,"page").point)},a=(c,d)=>{const{drag:f,dragPropagation:p,onDragStart:m}=this.getProps();if(f&&!p&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Pb(f),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Kn(x=>{let w=this.getAxisMotionValue(x).get()||0;if(Pr.test(w)){const{projection:v}=this.visualElement;if(v&&v.layout){const b=v.layout.layoutBox[x];b&&(w=On(b)*(parseFloat(w)/100))}}this.originPoint[x]=w}),m&&Xe.postRender(()=>m(c,d)),Xh(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},o=(c,d)=>{const{dragPropagation:f,dragDirectionLock:p,onDirectionLock:m,onDrag:g}=this.getProps();if(!f&&!this.openGlobalLock)return;const{offset:x}=d;if(p&&this.currentDirection===null){this.currentDirection=S5(x),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",d.point,x),this.updateAxis("y",d.point,x),this.visualElement.render(),g&&g(c,d)},s=(c,d)=>this.stop(c,d),l=()=>Kn(c=>{var d;return this.getAnimationState(c)==="paused"&&((d=this.getAxisMotionValue(c).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Sb(t,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:Jb(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&Xe.postRender(()=>a(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Dc(t,i,this.currentDirection))return;const a=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=p5(o,this.constraints[t],this.elastic[t])),a.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,a=this.constraints;n&&Ro(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=h5(i.layoutBox,n):this.constraints=!1,this.elastic=y5(r),a!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Kn(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=w5(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ro(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=E5(r,i.root,this.visualElement.getTransformPagePoint());let o=m5(i.layout.layoutBox,a);if(n){const s=n(v5(o));this.hasMutatedConstraints=!!s,s&&(o=$b(s))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=Kn(c=>{if(!Dc(c,n,this.currentDirection))return;let d=l&&l[c]||{};o&&(d={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,m={type:"inertia",velocity:r?t[c]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...a,...d};return this.startAxisValueAnimation(c,m)});return Promise.all(u).then(s)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Xh(this.visualElement,t),r.start(Yh(t,r,0,n,this.visualElement,!1))}stopAnimation(){Kn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Kn(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Kn(n=>{const{drag:r}=this.getProps();if(!Dc(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:s}=i.layout.layoutBox[n];a.set(t[n]-ut(o,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ro(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Kn(o=>{const s=this.getAxisMotionValue(o);if(s&&this.constraints!==!1){const l=s.get();i[o]=g5({min:l,max:l},this.constraints[o])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Kn(o=>{if(!Dc(o,t,null))return;const s=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];s.set(ut(l,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;T5.set(this.visualElement,this);const t=this.visualElement.current,n=ri(t,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Ro(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,a=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Xe.read(r);const o=ni(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Kn(c=>{const d=this.getAxisMotionValue(c);d&&(this.originPoint[c]+=l[c].translate,d.set(d.get()+l[c].translate))}),this.visualElement.render())});return()=>{o(),n(),a(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:o=em,dragMomentum:s=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:a,dragElastic:o,dragMomentum:s}}}function Dc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function S5(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class C5 extends Di{constructor(t){super(t),this.removeGroupControls=qt,this.removeListeners=qt,this.controls=new _5(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||qt}unmount(){this.removeGroupControls(),this.removeListeners()}}const ex=e=>(t,n)=>{e&&Xe.postRender(()=>e(t,n))};class k5 extends Di{constructor(){super(...arguments),this.removePointerDownListener=qt}onPointerDown(t){this.session=new Sb(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Jb(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:ex(t),onStart:ex(n),onMove:r,onEnd:(a,o)=>{delete this.session,i&&Xe.postRender(()=>i(a,o))}}}mount(){this.removePointerDownListener=ri(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Lc=y.createContext(null);function A5(){const e=y.useContext(Lc);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=y.useId();y.useEffect(()=>r(i),[]);const a=y.useCallback(()=>n&&n(i),[i,n]);return!t&&n?[!1,a]:[!0]}const im=y.createContext({}),tx=y.createContext({}),Mc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function nx(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const cl={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(we.test(e))e=parseFloat(e);else return e;const n=nx(e,t.target.x),r=nx(e,t.target.y);return`${n}% ${r}%`}},R5={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=Oi.parse(e);if(i.length>5)return r;const a=Oi.createTransformer(e),o=typeof i[0]!="number"?1:0,s=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=l;const u=ut(s,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),a(i)}},Fc={};function N5(e){Object.assign(Fc,e)}const{schedule:am,cancel:gie}=yv(queueMicrotask,!1);class P5 extends y.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:a}=t;N5(I5),a&&(n.group&&n.group.add(a),r&&r.register&&i&&r.register(a),a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),Mc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:a}=this.props,o=r.projection;return o&&(o.isPresent=a,i||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?o.promote():o.relegate()||Xe.postRender(()=>{const s=o.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),am.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function rx(e){const[t,n]=A5(),r=y.useContext(im);return T.jsx(P5,{...e,layoutGroup:r,switchLayoutGroup:y.useContext(tx),isPresent:t,safeToRemove:n})}const I5={borderRadius:{...cl,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:cl,borderTopRightRadius:cl,borderBottomLeftRadius:cl,borderBottomRightRadius:cl,boxShadow:R5},ix=["TopLeft","TopRight","BottomLeft","BottomRight"],O5=ix.length,ax=e=>typeof e=="string"?parseFloat(e):e,ox=e=>typeof e=="number"||we.test(e);function D5(e,t,n,r,i,a){i?(e.opacity=ut(0,n.opacity!==void 0?n.opacity:1,L5(r)),e.opacityExit=ut(t.opacity!==void 0?t.opacity:1,0,M5(r))):a&&(e.opacity=ut(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<O5;o++){const s=`border${ix[o]}Radius`;let l=sx(t,s),u=sx(n,s);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||ox(l)===ox(u)?(e[s]=Math.max(ut(ax(l),ax(u),r),0),(Pr.test(u)||Pr.test(l))&&(e[s]+="%")):e[s]=u}(t.rotate||n.rotate)&&(e.rotate=ut(t.rotate||0,n.rotate||0,r))}function sx(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const L5=lx(0,.5,Sv),M5=lx(.5,.95,qt);function lx(e,t,n){return r=>r<e?0:r>t?1:n(Ao(e,t,r))}function ux(e,t){e.min=t.min,e.max=t.max}function Xn(e,t){ux(e.x,t.x),ux(e.y,t.y)}function cx(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function dx(e,t,n,r,i){return e-=t,e=Oc(e,1/n,r),i!==void 0&&(e=Oc(e,1/i,r)),e}function F5(e,t=0,n=1,r=.5,i,a=e,o=e){if(Pr.test(t)&&(t=parseFloat(t),t=ut(o.min,o.max,t/100)-o.min),typeof t!="number")return;let s=ut(a.min,a.max,r);e===a&&(s-=t),e.min=dx(e.min,t,n,s,i),e.max=dx(e.max,t,n,s,i)}function fx(e,t,[n,r,i],a,o){F5(e,t[n],t[r],t[i],t.scale,a,o)}const B5=["x","scaleX","originX"],j5=["y","scaleY","originY"];function px(e,t,n,r){fx(e.x,t,B5,n?n.x:void 0,r?r.x:void 0),fx(e.y,t,j5,n?n.y:void 0,r?r.y:void 0)}function hx(e){return e.translate===0&&e.scale===1}function mx(e){return hx(e.x)&&hx(e.y)}function gx(e,t){return e.min===t.min&&e.max===t.max}function U5(e,t){return gx(e.x,t.x)&&gx(e.y,t.y)}function wx(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function yx(e,t){return wx(e.x,t.x)&&wx(e.y,t.y)}function vx(e){return On(e.x)/On(e.y)}function bx(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class z5{constructor(){this.members=[]}add(t){qh(this.members,t),t.scheduleRender()}remove(t){if(Gh(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const a=this.members[i];if(a.isPresent!==!1){r=a;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function H5(e,t,n){let r="";const i=e.x.translate/t.x,a=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:d,rotateY:f,skewX:p,skewY:m}=n;u&&(r=`perspective(${u}px) ${r}`),c&&(r+=`rotate(${c}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),p&&(r+=`skewX(${p}deg) `),m&&(r+=`skewY(${m}deg) `)}const s=e.x.scale*t.x,l=e.y.scale*t.y;return(s!==1||l!==1)&&(r+=`scale(${s}, ${l})`),r||"none"}const V5=(e,t)=>e.depth-t.depth;class $5{constructor(){this.children=[],this.isDirty=!1}add(t){qh(this.children,t),this.isDirty=!0}remove(t){Gh(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(V5),this.isDirty=!1,this.children.forEach(t)}}function Bc(e){const t=Kt(e)?e.get():e;return M4(t)?t.toValue():t}function W5(e,t){const n=Ir.now(),r=({timestamp:i})=>{const a=i-n;a>=t&&(Ni(r),e(a-t))};return Xe.read(r,!0),()=>Ni(r)}function Y5(e){return e instanceof SVGElement&&e.tagName!=="svg"}function q5(e,t,n){const r=Kt(e)?e:sl(e);return r.start(Yh("",r,t,n)),r.animation}const ja={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},dl=typeof window<"u"&&window.MotionDebug!==void 0,om=["","X","Y","Z"],G5={visibility:"hidden"},xx=1e3;let K5=0;function sm(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Ex(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=vb(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Xe,!(i||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Ex(r)}function Tx({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},s=t==null?void 0:t()){this.id=K5++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,dl&&(ja.totalNodes=ja.resolvedTargetDeltas=ja.recalculatedProjection=0),this.nodes.forEach(Z5),this.nodes.forEach(rD),this.nodes.forEach(iD),this.nodes.forEach(J5),dl&&window.MotionDebug.record(ja)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new $5)}addEventListener(o,s){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Kh),this.eventHandlers.get(o).add(s)}notifyListeners(o,...s){const l=this.eventHandlers.get(o);l&&l.notify(...s)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,s=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Y5(o),this.instance=o;const{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),s&&(u||l)&&(this.isLayoutDirty=!0),e){let d;const f=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=W5(f,250),Mc.hasAnimatedSinceResize&&(Mc.hasAnimatedSinceResize=!1,this.nodes.forEach(Sx))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:p,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||uD,{onLayoutAnimationStart:x,onLayoutAnimationComplete:w}=c.getProps(),v=!this.targetLayout||!yx(this.targetLayout,m)||p,b=!f&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||b||f&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,b);const E={...vh(g,"layout"),onPlay:x,onComplete:w};(c.shouldReduceMotion||this.options.layoutRoot)&&(E.delay=0,E.type=!1),this.startAnimation(E)}else f||Sx(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Ni(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(aD),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Ex(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const d=this.path[c];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:s,layout:l}=this.options;if(s===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(_x);return}this.isUpdating||this.nodes.forEach(tD),this.isUpdating=!1,this.nodes.forEach(nD),this.nodes.forEach(X5),this.nodes.forEach(Q5),this.clearAllSnapshots();const s=Ir.now();Ut.delta=Pi(0,1e3/60,s-Ut.timestamp),Ut.timestamp=s,Ut.isProcessing=!0,bh.update.process(Ut),bh.preRender.process(Ut),bh.render.process(Ut),Ut.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,am.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(eD),this.sharedNodes.forEach(oD)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Xe.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Xe.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Et(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:s}=this.options;s&&s.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let s=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(s=!1),s){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,s=this.projectionDelta&&!mx(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&(s||Ba(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const s=this.measurePageBox();let l=this.removeElementScroll(s);return o&&(l=this.removeTransform(l)),cD(l),{animationId:this.root.animationId,measuredBox:s,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:s}=this.options;if(!s)return Et();const l=s.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(dD))){const{scroll:c}=this.root;c&&(Po(l.x,c.offset.x),Po(l.y,c.offset.y))}return l}removeElementScroll(o){var s;const l=Et();if(Xn(l,o),!((s=this.scroll)===null||s===void 0)&&s.wasRoot)return l;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:d,options:f}=c;c!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&Xn(l,o),Po(l.x,d.offset.x),Po(l.y,d.offset.y))}return l}applyTransform(o,s=!1){const l=Et();Xn(l,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];!s&&c.options.layoutScroll&&c.scroll&&c!==c.root&&Io(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),Ba(c.latestValues)&&Io(l,c.latestValues)}return Ba(this.latestValues)&&Io(l,this.latestValues),l}removeTransform(o){const s=Et();Xn(s,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!Ba(u.latestValues))continue;nm(u.latestValues)&&u.updateSnapshot();const c=Et(),d=u.measurePageBox();Xn(c,d),px(s,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return Ba(this.latestValues)&&px(s,this.latestValues),s}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ut.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var s;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=Ut.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Et(),this.relativeTargetOrigin=Et(),ul(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),Xn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Et(),this.targetWithTransforms=Et()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),f5(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Xn(this.target,this.layout.layoutBox),Gb(this.target,this.targetDelta)):Xn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Et(),this.relativeTargetOrigin=Et(),ul(this.relativeTargetOrigin,this.target,p.target),Xn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}dl&&ja.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||nm(this.parent.latestValues)||Wb(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const s=this.getLead(),l=!!this.resumingFrom||this!==s;let u=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Ut.timestamp&&(u=!1),u)return;const{layout:c,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||d))return;Xn(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,p=this.treeScale.y;x5(this.layoutCorrected,this.treeScale,this.path,l),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=Et());const{target:m}=s;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(cx(this.prevProjectionDelta.x,this.projectionDelta.x),cx(this.prevProjectionDelta.y,this.projectionDelta.y)),ll(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==p||!bx(this.projectionDelta.x,this.prevProjectionDelta.x)||!bx(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m)),dl&&ja.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var s;if((s=this.options.visualElement)===null||s===void 0||s.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=No(),this.projectionDelta=No(),this.projectionDeltaWithTransform=No()}setAnimationOrigin(o,s=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},d=No();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!s;const f=Et(),p=l?l.source:void 0,m=this.layout?this.layout.source:void 0,g=p!==m,x=this.getStack(),w=!x||x.members.length<=1,v=!!(g&&!w&&this.options.crossfade===!0&&!this.path.some(lD));this.animationProgress=0;let b;this.mixTargetDelta=E=>{const _=E/1e3;Cx(d.x,o.x,_),Cx(d.y,o.y,_),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ul(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),sD(this.relativeTarget,this.relativeTargetOrigin,f,_),b&&U5(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=Et()),Xn(b,this.relativeTarget)),g&&(this.animationValues=c,D5(c,u,this.latestValues,_,v,w)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=_},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Ni(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Xe.update(()=>{Mc.hasAnimatedSinceResize=!0,this.currentAnimation=q5(0,xx,{...o,onUpdate:s=>{this.mixTargetDelta(s),o.onUpdate&&o.onUpdate(s)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(xx),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:s,target:l,layout:u,latestValues:c}=o;if(!(!s||!l||!u)){if(this!==o&&this.layout&&u&&Px(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Et();const d=On(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const f=On(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}Xn(s,l),Io(s,c),ll(this.projectionDeltaWithTransform,this.layoutCorrected,s,c)}}registerSharedNode(o,s){this.sharedNodes.has(o)||this.sharedNodes.set(o,new z5),this.sharedNodes.get(o).add(s);const u=s.options.initialPromotionConfig;s.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(s):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:s}=this.options;return s?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:s}=this.options;return s?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:s,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let s=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(s=!0),!s)return;const u={};l.z&&sm("z",o,u,this.animationValues);for(let c=0;c<om.length;c++)sm(`rotate${om[c]}`,o,u,this.animationValues),sm(`skew${om[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);o.scheduleRender()}getProjectionStyles(o){var s,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return G5;const u={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=Bc(o==null?void 0:o.pointerEvents)||"",u.transform=c?c(this.latestValues,""):"none",u;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const g={};return this.options.layoutId&&(g.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,g.pointerEvents=Bc(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Ba(this.latestValues)&&(g.transform=c?c({},""):"none",this.hasProjected=!1),g}const f=d.animationValues||d.latestValues;this.applyTransformsToTarget(),u.transform=H5(this.projectionDeltaWithTransform,this.treeScale,f),c&&(u.transform=c(f,u.transform));const{x:p,y:m}=this.projectionDelta;u.transformOrigin=`${p.origin*100}% ${m.origin*100}% 0`,d.animationValues?u.opacity=d===this?(l=(s=f.opacity)!==null&&s!==void 0?s:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:u.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const g in Fc){if(f[g]===void 0)continue;const{correct:x,applyTo:w}=Fc[g],v=u.transform==="none"?f[g]:x(f[g],d);if(w){const b=w.length;for(let E=0;E<b;E++)u[w[E]]=v}else u[g]=v}return this.options.layoutId&&(u.pointerEvents=d===this?Bc(o==null?void 0:o.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var s;return(s=o.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(_x),this.root.sharedNodes.clear()}}}function X5(e){e.updateLayout()}function Q5(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:a}=e.options,o=n.source!==e.layout.source;a==="size"?Kn(d=>{const f=o?n.measuredBox[d]:n.layoutBox[d],p=On(f);f.min=r[d].min,f.max=f.min+p}):Px(a,n.layoutBox,r)&&Kn(d=>{const f=o?n.measuredBox[d]:n.layoutBox[d],p=On(r[d]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+p)});const s=No();ll(s,r,n.layoutBox);const l=No();o?ll(l,e.applyTransform(i,!0),n.measuredBox):ll(l,r,n.layoutBox);const u=!mx(s);let c=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:p}=d;if(f&&p){const m=Et();ul(m,n.layoutBox,f.layoutBox);const g=Et();ul(g,r,p.layoutBox),yx(m,g)||(c=!0),d.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=m,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:s,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Z5(e){dl&&ja.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function J5(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function eD(e){e.clearSnapshot()}function _x(e){e.clearMeasurements()}function tD(e){e.isLayoutDirty=!1}function nD(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Sx(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function rD(e){e.resolveTargetDelta()}function iD(e){e.calcProjection()}function aD(e){e.resetSkewAndRotation()}function oD(e){e.removeLeadSnapshot()}function Cx(e,t,n){e.translate=ut(t.translate,0,n),e.scale=ut(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function kx(e,t,n,r){e.min=ut(t.min,n.min,r),e.max=ut(t.max,n.max,r)}function sD(e,t,n,r){kx(e.x,t.x,n.x,r),kx(e.y,t.y,n.y,r)}function lD(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const uD={duration:.45,ease:[.4,0,.1,1]},Ax=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Rx=Ax("applewebkit/")&&!Ax("chrome/")?Math.round:qt;function Nx(e){e.min=Rx(e.min),e.max=Rx(e.max)}function cD(e){Nx(e.x),Nx(e.y)}function Px(e,t,n){return e==="position"||e==="preserve-aspect"&&!d5(vx(t),vx(n),.2)}function dD(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const fD=Tx({attachResizeListener:(e,t)=>ni(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),lm={current:void 0},Ix=Tx({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!lm.current){const e=new fD({});e.mount(window),e.setOptions({layoutScroll:!0}),lm.current=e}return lm.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),pD={pan:{Feature:k5},drag:{Feature:C5,ProjectionNode:Ix,MeasureLayout:rx}};function Ox(e,t){const n=t?"pointerenter":"pointerleave",r=t?"onHoverStart":"onHoverEnd",i=(a,o)=>{if(a.pointerType==="touch"||Ib())return;const s=e.getProps();e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",t);const l=s[r];l&&Xe.postRender(()=>l(a,o))};return ri(e.current,n,i,{passive:!e.getProps()[r]})}class hD extends Di{mount(){this.unmount=ti(Ox(this.node,!0),Ox(this.node,!1))}unmount(){}}class mD extends Di{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ti(ni(this.node.current,"focus",()=>this.onFocus()),ni(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Dx=(e,t)=>t?e===t?!0:Dx(e,t.parentElement):!1;function um(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Ic(n))}class gD extends Di{constructor(){super(...arguments),this.removeStartListeners=qt,this.removeEndListeners=qt,this.removeAccessibleListeners=qt,this.startPointerPress=(t,n)=>{if(this.isPressing)return;this.removeEndListeners();const r=this.node.getProps(),a=ri(window,"pointerup",(s,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c,globalTapTarget:d}=this.node.getProps(),f=!d&&!Dx(this.node.current,s.target)?c:u;f&&Xe.update(()=>f(s,l))},{passive:!(r.onTap||r.onPointerUp)}),o=ri(window,"pointercancel",(s,l)=>this.cancelPress(s,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=ti(a,o),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=a=>{if(a.key!=="Enter"||this.isPressing)return;const o=s=>{s.key!=="Enter"||!this.checkPressEnd()||um("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&Xe.postRender(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=ni(this.node.current,"keyup",o),um("down",(s,l)=>{this.startPress(s,l)})},n=ni(this.node.current,"keydown",t),r=()=>{this.isPressing&&um("cancel",(a,o)=>this.cancelPress(a,o))},i=ni(this.node.current,"blur",r);this.removeAccessibleListeners=ti(n,i)}}startPress(t,n){this.isPressing=!0;const{onTapStart:r,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&Xe.postRender(()=>r(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Ib()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&Xe.postRender(()=>r(t,n))}mount(){const t=this.node.getProps(),n=ri(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=ni(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=ti(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const cm=new WeakMap,dm=new WeakMap,wD=e=>{const t=cm.get(e.target);t&&t(e)},yD=e=>{e.forEach(wD)};function vD({root:e,...t}){const n=e||document;dm.has(n)||dm.set(n,{});const r=dm.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(yD,{root:e,...t})),r[i]}function bD(e,t,n){const r=vD(t);return cm.set(e,n),r.observe(e),()=>{cm.delete(e),r.unobserve(e)}}const xD={some:0,all:1};class ED extends Di{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:a}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:xD[i]},s=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,a&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=u?c:d;f&&f(l)};return bD(this.node.current,o,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(TD(t,n))&&this.startObserver()}unmount(){}}function TD({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const _D={inView:{Feature:ED},tap:{Feature:gD},focus:{Feature:mD},hover:{Feature:hD}},SD={layout:{ProjectionNode:Ix,MeasureLayout:rx}},fm=y.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),jc=y.createContext({}),pm=typeof window<"u",Lx=pm?y.useLayoutEffect:y.useEffect,Mx=y.createContext({strict:!1});function CD(e,t,n,r,i){var a,o;const{visualElement:s}=y.useContext(jc),l=y.useContext(Mx),u=y.useContext(Lc),c=y.useContext(fm).reducedMotion,d=y.useRef();r=r||l.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:s,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:c}));const f=d.current,p=y.useContext(tx);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&kD(d.current,n,i,p),y.useInsertionEffect(()=>{f&&f.update(n,u)});const m=n[yb],g=y.useRef(!!m&&!(!((a=window.MotionHandoffIsComplete)===null||a===void 0)&&a.call(window,m))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,m)));return Lx(()=>{f&&(window.MotionIsMounted=!0,f.updateFeatures(),am.render(f.render),g.current&&f.animationState&&f.animationState.animateChanges())}),y.useEffect(()=>{f&&(!g.current&&f.animationState&&f.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{var x;(x=window.MotionHandoffMarkAsComplete)===null||x===void 0||x.call(window,m)}),g.current=!1))}),f}function kD(e,t,n,r){const{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:l,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Fx(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Ro(s),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function Fx(e){if(e)return e.options.allowProjection!==!1?e.projection:Fx(e.parent)}function AD(e,t,n){return y.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Ro(n)&&(n.current=r))},[t])}function Uc(e){return Zs(e.animate)||yh.some(t=>Js(e[t]))}function Bx(e){return!!(Uc(e)||e.variants)}function RD(e,t){if(Uc(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Js(n)?n:void 0,animate:Js(r)?r:void 0}}return e.inherit!==!1?t:{}}function ND(e){const{initial:t,animate:n}=RD(e,y.useContext(jc));return y.useMemo(()=>({initial:t,animate:n}),[jx(t),jx(n)])}function jx(e){return Array.isArray(e)?e.join(" "):e}const Ux={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Oo={};for(const e in Ux)Oo[e]={isEnabled:t=>Ux[e].some(n=>!!t[n])};function PD(e){for(const t in e)Oo[t]={...Oo[t],...e[t]}}const ID=Symbol.for("motionComponentSymbol");function OD({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&PD(e);function a(s,l){let u;const c={...y.useContext(fm),...s,layoutId:DD(s)},{isStatic:d}=c,f=ND(s),p=r(s,d);if(!d&&pm){LD();const m=MD(c);u=m.MeasureLayout,f.visualElement=CD(i,p,c,t,m.ProjectionNode)}return T.jsxs(jc.Provider,{value:f,children:[u&&f.visualElement?T.jsx(u,{visualElement:f.visualElement,...c}):null,n(i,s,AD(p,f.visualElement,l),p,d,f.visualElement)]})}const o=y.forwardRef(a);return o[ID]=i,o}function DD({layoutId:e}){const t=y.useContext(im).id;return t&&e!==void 0?t+"-"+e:e}function LD(e,t){y.useContext(Mx).strict}function MD(e){const{drag:t,layout:n}=Oo;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const FD=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function hm(e){return typeof e!="string"||e.includes("-")?!1:!!(FD.indexOf(e)>-1||/[A-Z]/u.test(e))}function zx(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const a in n)e.style.setProperty(a,n[a])}const Hx=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Vx(e,t,n,r){zx(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(Hx.has(i)?i:Pc(i),t.attrs[i])}function $x(e,{layout:t,layoutId:n}){return Ri.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Fc[e]||e==="opacity")}function mm(e,t,n){var r;const{style:i}=e,a={};for(const o in i)(Kt(i[o])||t.style&&Kt(t.style[o])||$x(o,e)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(a[o]=i[o]);return n&&i&&typeof i.willChange=="string"&&(n.applyWillChange=!1),a}function Wx(e,t,n){const r=mm(e,t,n);for(const i in e)if(Kt(e[i])||Kt(t[i])){const a=el.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[a]=e[i]}return r}function gm(e){const t=y.useRef(null);return t.current===null&&(t.current=e()),t.current}function BD(e){if(Ri.has(e))return"transform";if(db.has(e))return Pc(e)}function jD({applyWillChange:e=!1,scrapeMotionValuesFromProps:t,createRenderState:n,onMount:r},i,a,o,s){const l={latestValues:UD(i,a,o,s?!1:e,t),renderState:n()};return r&&(l.mount=u=>r(i,u,l)),l}const Yx=e=>(t,n)=>{const r=y.useContext(jc),i=y.useContext(Lc),a=()=>jD(e,t,r,i,n);return n?a():gm(a)};function qx(e,t,n){const r=Array.isArray(t)?t:[t];for(let i=0;i<r.length;i++){const a=gh(e,r[i]);if(a){const{transitionEnd:o,transition:s,...l}=a;n(l,o)}}}function UD(e,t,n,r,i){var a;const o={},s=new Set,l=r&&((a=e.style)===null||a===void 0?void 0:a.willChange)===void 0,u=i(e,{});for(const x in u)o[x]=Bc(u[x]);let{initial:c,animate:d}=e;const f=Uc(e),p=Bx(e);t&&p&&!f&&e.inherit!==!1&&(c===void 0&&(c=t.initial),d===void 0&&(d=t.animate));let m=n?n.initial===!1:!1;m=m||c===!1;const g=m?d:c;return g&&typeof g!="boolean"&&!Zs(g)&&qx(e,g,(x,w)=>{for(const v in x){let b=x[v];if(Array.isArray(b)){const E=m?b.length-1:0;b=b[E]}b!==null&&(o[v]=b)}for(const v in w)o[v]=w[v]}),l&&(d&&c!==!1&&!Zs(d)&&qx(e,d,x=>{for(const w in x){const v=BD(w);v&&s.add(v)}}),s.size&&(o.willChange=Array.from(s).join(","))),o}const wm=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Gx=()=>({...wm(),attrs:{}}),Kx=(e,t)=>t&&typeof e=="number"?t.transform(e):e,zD={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},HD=el.length;function VD(e,t,n){let r="",i=!0;for(let a=0;a<HD;a++){const o=el[a],s=e[o];if(s===void 0)continue;let l=!0;if(typeof s=="number"?l=s===(o.startsWith("scale")?1:0):l=parseFloat(s)===0,!l||n){const u=Kx(s,Oh[o]);if(!l){i=!1;const c=zD[o]||o;r+=`${c}(${u}) `}n&&(t[o]=u)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function ym(e,t,n){const{style:r,vars:i,transformOrigin:a}=e;let o=!1,s=!1;for(const l in t){const u=t[l];if(Ri.has(l)){o=!0;continue}else if(Nv(l)){i[l]=u;continue}else{const c=Kx(u,Oh[l]);l.startsWith("origin")?(s=!0,a[l]=c):r[l]=c}}if(t.transform||(o||n?r.transform=VD(t,e.transform,n):r.transform&&(r.transform="none")),s){const{originX:l="50%",originY:u="50%",originZ:c=0}=a;r.transformOrigin=`${l} ${u} ${c}`}}function Xx(e,t,n){return typeof e=="string"?e:we.transform(t+n*e)}function $D(e,t,n){const r=Xx(t,e.x,e.width),i=Xx(n,e.y,e.height);return`${r} ${i}`}const WD={offset:"stroke-dashoffset",array:"stroke-dasharray"},YD={offset:"strokeDashoffset",array:"strokeDasharray"};function qD(e,t,n=1,r=0,i=!0){e.pathLength=1;const a=i?WD:YD;e[a.offset]=we.transform(-r);const o=we.transform(t),s=we.transform(n);e[a.array]=`${o} ${s}`}function vm(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:a,pathLength:o,pathSpacing:s=1,pathOffset:l=0,...u},c,d){if(ym(e,u,d),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:p,dimensions:m}=e;f.transform&&(m&&(p.transform=f.transform),delete f.transform),m&&(i!==void 0||a!==void 0||p.transform)&&(p.transformOrigin=$D(m,i!==void 0?i:.5,a!==void 0?a:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&qD(f,o,s,l,!1)}const bm=e=>typeof e=="string"&&e.toLowerCase()==="svg",GD={useVisualState:Yx({scrapeMotionValuesFromProps:Wx,createRenderState:Gx,onMount:(e,t,{renderState:n,latestValues:r})=>{Xe.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),Xe.render(()=>{vm(n,r,bm(t.tagName),e.transformTemplate),Vx(t,n)})}})},KD={useVisualState:Yx({applyWillChange:!0,scrapeMotionValuesFromProps:mm,createRenderState:wm})};function Qx(e,t,n){for(const r in t)!Kt(t[r])&&!$x(r,n)&&(e[r]=t[r])}function XD({transformTemplate:e},t){return y.useMemo(()=>{const n=wm();return ym(n,t,e),Object.assign({},n.vars,n.style)},[t])}function QD(e,t){const n=e.style||{},r={};return Qx(r,n,e),Object.assign(r,XD(e,t)),r}function ZD(e,t){const n={},r=QD(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const JD=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function zc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||JD.has(e)}let Zx=e=>!zc(e);function eL(e){e&&(Zx=t=>t.startsWith("on")?!zc(t):e(t))}try{eL(require("@emotion/is-prop-valid").default)}catch{}function tL(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(Zx(i)||n===!0&&zc(i)||!t&&!zc(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function nL(e,t,n,r){const i=y.useMemo(()=>{const a=Gx();return vm(a,t,bm(r),e.transformTemplate),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};Qx(a,e.style,e),i.style={...a,...i.style}}return i}function rL(e=!1){return(n,r,i,{latestValues:a},o)=>{const l=(hm(n)?nL:ZD)(r,a,o,n),u=tL(r,typeof n=="string",e),c=n!==y.Fragment?{...u,...l,ref:i}:{},{children:d}=r,f=y.useMemo(()=>Kt(d)?d.get():d,[d]);return y.createElement(n,{...c,children:f})}}function iL(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...hm(r)?GD:KD,preloadedFeatures:e,useRender:rL(i),createVisualElement:t,Component:r};return OD(o)}}const xm={current:null},Jx={current:!1};function aL(){if(Jx.current=!0,!!pm)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>xm.current=e.matches;e.addListener(t),t()}else xm.current=!1}function oL(e,t,n){for(const r in t){const i=t[r],a=n[r];if(Kt(i))e.addValue(r,i);else if(Kt(a))e.addValue(r,sl(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,sl(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const eE=new WeakMap,sL=[...Fv,Gt,Oi],lL=e=>sL.find(Mv(e)),tE=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class uL{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:a,visualState:o},s={}){this.applyWillChange=!1,this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=kh,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=Ir.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,Xe.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=Uc(n),this.isVariantNode=Bx(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const p=d[f];l[f]!==void 0&&Kt(p)&&p.set(l[f],!1)}}mount(t){this.current=t,eE.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),Jx.current||aL(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:xm.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){eE.delete(this.current),this.projection&&this.projection.unmount(),Ni(this.notifyUpdate),Ni(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Ri.has(t),i=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&Xe.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),a=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),a(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Oo){const n=Oo[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Et()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<tE.length;r++){const i=tE[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,o=t[a];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=oL(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=sl(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(Av(i)||kv(i))?i=parseFloat(i):!lL(i)&&Oi.test(n)&&(i=Gv(t,n)),this.setBaseTarget(t,Kt(i)?i.get():i)),Kt(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const o=gh(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(i=o[t])}if(r&&i!==void 0)return i;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!Kt(a)?a:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Kh),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class nE extends uL{constructor(){super(...arguments),this.KeyframeResolver=Kv}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}}function cL(e){return window.getComputedStyle(e)}class dL extends nE{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=zx}readValueFromInstance(t,n){if(Ri.has(n)){const r=Dh(n);return r&&r.default||0}else{const r=cL(t),i=(Nv(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Zb(t,n)}build(t,n,r){ym(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return mm(t,n,r)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Kt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class fL extends nE{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Et}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ri.has(n)){const r=Dh(n);return r&&r.default||0}return n=Hx.has(n)?n:Pc(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Wx(t,n,r)}build(t,n,r){vm(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){Vx(t,n,r,i)}mount(t){this.isSVGTag=bm(t.tagName),super.mount(t)}}const pL=(e,t)=>hm(e)?new fL(t):new dL(t,{allowProjection:e!==y.Fragment}),hL=iL({...n5,..._D,...pD,...SD},pL),Ua=XO(hL);class mL extends y.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function gL({children:e,isPresent:t}){const n=y.useId(),r=y.useRef(null),i=y.useRef({width:0,height:0,top:0,left:0}),{nonce:a}=y.useContext(fm);return y.useInsertionEffect(()=>{const{width:o,height:s,top:l,left:u}=i.current;if(t||!r.current||!o||!s)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return a&&(c.nonce=a),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`
|
|
17
|
+
*/var yO=y,vO=Symbol.for("react.element"),bO=Symbol.for("react.fragment"),xO=Object.prototype.hasOwnProperty,EO=yO.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,TO={key:!0,ref:!0,__self:!0,__source:!0};function av(e,t,n){var r,i={},a=null,o=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)xO.call(t,r)&&!TO.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:vO,type:e,key:a,ref:o,props:i,_owner:EO.current}}gc.Fragment=bO,gc.jsx=av,gc.jsxs=av,Yy.exports=gc;var T=Yy.exports;const ov="3.0.4";function bc(e){"@babel/helpers - typeof";return bc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bc(e)}var _O=/^\s+/,SO=/\s+$/;function fe(e,t){if(e=e||"",t=t||{},e instanceof fe)return e;if(!(this instanceof fe))return new fe(e,t);var n=CO(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}fe.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),n,r,i,a,o,s;return n=t.r/255,r=t.g/255,i=t.b/255,n<=.03928?a=n/12.92:a=Math.pow((n+.055)/1.055,2.4),r<=.03928?o=r/12.92:o=Math.pow((r+.055)/1.055,2.4),i<=.03928?s=i/12.92:s=Math.pow((i+.055)/1.055,2.4),.2126*a+.7152*o+.0722*s},setAlpha:function(t){return this._a=fv(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=lv(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=lv(this._r,this._g,this._b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.v*100);return this._a==1?"hsv("+n+", "+r+"%, "+i+"%)":"hsva("+n+", "+r+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var t=sv(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=sv(this._r,this._g,this._b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.l*100);return this._a==1?"hsl("+n+", "+r+"%, "+i+"%)":"hsla("+n+", "+r+"%, "+i+"%, "+this._roundA+")"},toHex:function(t){return uv(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return NO(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(ot(this._r,255)*100)+"%",g:Math.round(ot(this._g,255)*100)+"%",b:Math.round(ot(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(ot(this._r,255)*100)+"%, "+Math.round(ot(this._g,255)*100)+"%, "+Math.round(ot(this._b,255)*100)+"%)":"rgba("+Math.round(ot(this._r,255)*100)+"%, "+Math.round(ot(this._g,255)*100)+"%, "+Math.round(ot(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:HO[uv(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var n="#"+cv(this._r,this._g,this._b,this._a),r=n,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=fe(t);r="#"+cv(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+n+",endColorstr="+r+")"},toString:function(t){var n=!!t;t=t||this._format;var r=!1,i=this._a<1&&this._a>=0,a=!n&&i&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return a?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return fe(this.toString())},_applyModification:function(t,n){var r=t.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(DO,arguments)},brighten:function(){return this._applyModification(LO,arguments)},darken:function(){return this._applyModification(MO,arguments)},desaturate:function(){return this._applyModification(PO,arguments)},saturate:function(){return this._applyModification(IO,arguments)},greyscale:function(){return this._applyModification(OO,arguments)},spin:function(){return this._applyModification(FO,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(UO,arguments)},complement:function(){return this._applyCombination(BO,arguments)},monochromatic:function(){return this._applyCombination(zO,arguments)},splitcomplement:function(){return this._applyCombination(jO,arguments)},triad:function(){return this._applyCombination(dv,[3])},tetrad:function(){return this._applyCombination(dv,[4])}},fe.fromRatio=function(e,t){if(bc(e)=="object"){var n={};for(var r in e)e.hasOwnProperty(r)&&(r==="a"?n[r]=e[r]:n[r]=Qs(e[r]));e=n}return fe(e,t)};function CO(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,a=null,o=!1,s=!1;return typeof e=="string"&&(e=YO(e)),bc(e)=="object"&&(Zr(e.r)&&Zr(e.g)&&Zr(e.b)?(t=kO(e.r,e.g,e.b),o=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Zr(e.h)&&Zr(e.s)&&Zr(e.v)?(r=Qs(e.s),i=Qs(e.v),t=RO(e.h,r,i),o=!0,s="hsv"):Zr(e.h)&&Zr(e.s)&&Zr(e.l)&&(r=Qs(e.s),a=Qs(e.l),t=AO(e.h,r,a),o=!0,s="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=fv(n),{ok:o,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}function kO(e,t,n){return{r:ot(e,255)*255,g:ot(t,255)*255,b:ot(n,255)*255}}function sv(e,t,n){e=ot(e,255),t=ot(t,255),n=ot(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),a,o,s=(r+i)/2;if(r==i)a=o=0;else{var l=r-i;switch(o=s>.5?l/(2-r-i):l/(r+i),r){case e:a=(t-n)/l+(t<n?6:0);break;case t:a=(n-e)/l+2;break;case n:a=(e-t)/l+4;break}a/=6}return{h:a,s:o,l:s}}function AO(e,t,n){var r,i,a;e=ot(e,360),t=ot(t,100),n=ot(n,100);function o(u,c,d){return d<0&&(d+=1),d>1&&(d-=1),d<1/6?u+(c-u)*6*d:d<1/2?c:d<2/3?u+(c-u)*(2/3-d)*6:u}if(t===0)r=i=a=n;else{var s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;r=o(l,s,e+1/3),i=o(l,s,e),a=o(l,s,e-1/3)}return{r:r*255,g:i*255,b:a*255}}function lv(e,t,n){e=ot(e,255),t=ot(t,255),n=ot(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),a,o,s=r,l=r-i;if(o=r===0?0:l/r,r==i)a=0;else{switch(r){case e:a=(t-n)/l+(t<n?6:0);break;case t:a=(n-e)/l+2;break;case n:a=(e-t)/l+4;break}a/=6}return{h:a,s:o,v:s}}function RO(e,t,n){e=ot(e,360)*6,t=ot(t,100),n=ot(n,100);var r=Math.floor(e),i=e-r,a=n*(1-t),o=n*(1-i*t),s=n*(1-(1-i)*t),l=r%6,u=[n,o,a,a,s,n][l],c=[s,n,n,o,a,a][l],d=[a,a,s,n,n,o][l];return{r:u*255,g:c*255,b:d*255}}function uv(e,t,n,r){var i=[fr(Math.round(e).toString(16)),fr(Math.round(t).toString(16)),fr(Math.round(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function NO(e,t,n,r,i){var a=[fr(Math.round(e).toString(16)),fr(Math.round(t).toString(16)),fr(Math.round(n).toString(16)),fr(pv(r))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function cv(e,t,n,r){var i=[fr(pv(r)),fr(Math.round(e).toString(16)),fr(Math.round(t).toString(16)),fr(Math.round(n).toString(16))];return i.join("")}fe.equals=function(e,t){return!e||!t?!1:fe(e).toRgbString()==fe(t).toRgbString()},fe.random=function(){return fe.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function PO(e,t){t=t===0?0:t||10;var n=fe(e).toHsl();return n.s-=t/100,n.s=xc(n.s),fe(n)}function IO(e,t){t=t===0?0:t||10;var n=fe(e).toHsl();return n.s+=t/100,n.s=xc(n.s),fe(n)}function OO(e){return fe(e).desaturate(100)}function DO(e,t){t=t===0?0:t||10;var n=fe(e).toHsl();return n.l+=t/100,n.l=xc(n.l),fe(n)}function LO(e,t){t=t===0?0:t||10;var n=fe(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),fe(n)}function MO(e,t){t=t===0?0:t||10;var n=fe(e).toHsl();return n.l-=t/100,n.l=xc(n.l),fe(n)}function FO(e,t){var n=fe(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,fe(n)}function BO(e){var t=fe(e).toHsl();return t.h=(t.h+180)%360,fe(t)}function dv(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=fe(e).toHsl(),r=[fe(e)],i=360/t,a=1;a<t;a++)r.push(fe({h:(n.h+a*i)%360,s:n.s,l:n.l}));return r}function jO(e){var t=fe(e).toHsl(),n=t.h;return[fe(e),fe({h:(n+72)%360,s:t.s,l:t.l}),fe({h:(n+216)%360,s:t.s,l:t.l})]}function UO(e,t,n){t=t||6,n=n||30;var r=fe(e).toHsl(),i=360/n,a=[fe(e)];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,a.push(fe(r));return a}function zO(e,t){t=t||6;for(var n=fe(e).toHsv(),r=n.h,i=n.s,a=n.v,o=[],s=1/t;t--;)o.push(fe({h:r,s:i,v:a})),a=(a+s)%1;return o}fe.mix=function(e,t,n){n=n===0?0:n||50;var r=fe(e).toRgb(),i=fe(t).toRgb(),a=n/100,o={r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a};return fe(o)},fe.readability=function(e,t){var n=fe(e),r=fe(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},fe.isReadable=function(e,t,n){var r=fe.readability(e,t),i,a;switch(a=!1,i=qO(n),i.level+i.size){case"AAsmall":case"AAAlarge":a=r>=4.5;break;case"AAlarge":a=r>=3;break;case"AAAsmall":a=r>=7;break}return a},fe.mostReadable=function(e,t,n){var r=null,i=0,a,o,s,l;n=n||{},o=n.includeFallbackColors,s=n.level,l=n.size;for(var u=0;u<t.length;u++)a=fe.readability(e,t[u]),a>i&&(i=a,r=fe(t[u]));return fe.isReadable(e,r,{level:s,size:l})||!o?r:(n.includeFallbackColors=!1,fe.mostReadable(e,["#fff","#000"],n))};var ph=fe.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},HO=fe.hexNames=VO(ph);function VO(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function fv(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function ot(e,t){$O(e)&&(e="100%");var n=WO(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function xc(e){return Math.min(1,Math.max(0,e))}function In(e){return parseInt(e,16)}function $O(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function WO(e){return typeof e=="string"&&e.indexOf("%")!=-1}function fr(e){return e.length==1?"0"+e:""+e}function Qs(e){return e<=1&&(e=e*100+"%"),e}function pv(e){return Math.round(parseFloat(e)*255).toString(16)}function hv(e){return In(e)/255}var pr=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",n="(?:"+t+")|(?:"+e+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",i="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Zr(e){return!!pr.CSS_UNIT.exec(e)}function YO(e){e=e.replace(_O,"").replace(SO,"").toLowerCase();var t=!1;if(ph[e])e=ph[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=pr.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=pr.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=pr.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=pr.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=pr.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=pr.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=pr.hex8.exec(e))?{r:In(n[1]),g:In(n[2]),b:In(n[3]),a:hv(n[4]),format:t?"name":"hex8"}:(n=pr.hex6.exec(e))?{r:In(n[1]),g:In(n[2]),b:In(n[3]),format:t?"name":"hex"}:(n=pr.hex4.exec(e))?{r:In(n[1]+""+n[1]),g:In(n[2]+""+n[2]),b:In(n[3]+""+n[3]),a:hv(n[4]+""+n[4]),format:t?"name":"hex8"}:(n=pr.hex3.exec(e))?{r:In(n[1]+""+n[1]),g:In(n[2]+""+n[2]),b:In(n[3]+""+n[3]),format:t?"name":"hex"}:!1}function qO(e){var t,n;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:t,size:n}}const GO=400,KO=600,hh={widgetMinHeight:"min-h-[400px]",widgetMaxHeight:"max-h-[600px]",widgetHeight:"h-[600px]"},mv=({primary:e="hsl(0, 0%, 0%)"})=>{const t=fe(e).toHsl(),n=fe(e).isLight()?"240 10% 3.9%":"0 0% 100%";return{"--opencx-primary":`${t.h} ${t.s}% ${t.l}%`,"--opencx-primary-foreground":n,"--opencx-background":"0 0% 100%","--opencx-foreground":"240 10% 3.9%","--opencx-accent":"240 4.8% 95.9%","--opencx-accent-foreground":"240 5.9% 10%","--opencx-destructive":"0 84.2% 60.2%","--opencx-destructive-foreground":"0 0% 98%","--opencx-secondary":"240 4.8% 95.9%","--opencx-secondary-foreground":"240 5.9% 10%","--opencx-muted":"240 4.8% 95.9%","--opencx-muted-foreground":"240 3.8% 46.1%","--opencx-input":"240 5.9% 90%","--opencx-border":"240 5.9% 90%","--opencx-ring":"240 5.9% 10%"}};function XO(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}function Zs(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const mh=e=>Array.isArray(e);function gv(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function Js(e){return typeof e=="string"||Array.isArray(e)}function wv(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function gh(e,t,n,r){if(typeof t=="function"){const[i,a]=wv(r);t=t(n!==void 0?n:e.custom,i,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,a]=wv(r);t=t(n!==void 0?n:e.custom,i,a)}return t}function Ec(e,t,n){const r=e.getProps();return gh(r,t,n!==void 0?n:r.custom,e)}const wh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],yh=["initial",...wh],el=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ri=new Set(el),Jr=e=>e*1e3,ei=e=>e/1e3,QO={type:"spring",stiffness:500,damping:25,restSpeed:10},ZO=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),JO={type:"keyframes",duration:.8},e6={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},t6=(e,{keyframes:t})=>t.length>2?JO:Ri.has(e)?e.startsWith("scale")?ZO(t[1]):QO:e6;function vh(e,t){return e?e[t]||e.default||e:void 0}const n6={skipAnimations:!1,useManualTiming:!1},r6=e=>e!==null;function Tc(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(r6),a=t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const qt=e=>e;function i6(e){let t=new Set,n=new Set,r=!1,i=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function s(u){a.has(u)&&(l.schedule(u),e()),u(o)}const l={schedule:(u,c=!1,d=!1)=>{const p=d&&r?t:n;return c&&a.add(u),p.has(u)||p.add(u),u},cancel:u=>{n.delete(u),a.delete(u)},process:u=>{if(o=u,r){i=!0;return}r=!0,[t,n]=[n,t],n.clear(),t.forEach(s),r=!1,i&&(i=!1,l.process(u))}};return l}const _c=["read","resolveKeyframes","update","preRender","render","postRender"],a6=40;function yv(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=_c.reduce((w,v)=>(w[v]=i6(a),w),{}),{read:s,resolveKeyframes:l,update:u,preRender:c,render:d,postRender:f}=o,p=()=>{const w=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(w-i.timestamp,a6),1),i.timestamp=w,i.isProcessing=!0,s.process(i),l.process(i),u.process(i),c.process(i),d.process(i),f.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(p))},m=()=>{n=!0,r=!0,i.isProcessing||e(p)};return{schedule:_c.reduce((w,v)=>{const b=o[v];return w[v]=(E,_=!1,S=!1)=>(n||m(),b.schedule(E,_,S)),w},{}),cancel:w=>{for(let v=0;v<_c.length;v++)o[_c[v]].cancel(w)},state:i,steps:o}}const{schedule:Xe,cancel:Ni,state:Ut,steps:bh}=yv(typeof requestAnimationFrame<"u"?requestAnimationFrame:qt,!0),vv=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,o6=1e-7,s6=12;function l6(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=vv(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>o6&&++s<s6);return o}function tl(e,t,n,r){if(e===t&&n===r)return qt;const i=a=>l6(a,0,1,e,n);return a=>a===0||a===1?a:vv(i(a),t,r)}const bv=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,xv=e=>t=>1-e(1-t),Ev=tl(.33,1.53,.69,.99),xh=xv(Ev),Tv=bv(xh),_v=e=>(e*=2)<1?.5*xh(e):.5*(2-Math.pow(2,-10*(e-1))),Eh=e=>1-Math.sin(Math.acos(e)),Sv=xv(Eh),Cv=bv(Eh),kv=e=>/^0[^.\s]+$/u.test(e);function u6(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||kv(e):!0}let Th=qt;const Av=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Rv=e=>t=>typeof t=="string"&&t.startsWith(e),Nv=Rv("--"),c6=Rv("var(--"),_h=e=>c6(e)?d6.test(e.split("/*")[0].trim()):!1,d6=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,f6=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function p6(e){const t=f6.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function Pv(e,t,n=1){const[r,i]=p6(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const o=a.trim();return Av(o)?parseFloat(o):o}return _h(i)?Pv(i,t,n+1):i}const Pi=(e,t,n)=>n>t?t:n<e?e:n,So={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},nl={...So,transform:e=>Pi(0,1,e)},Sc={...So,default:1},rl=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ii=rl("deg"),Pr=rl("%"),we=rl("px"),h6=rl("vh"),m6=rl("vw"),Iv={...Pr,parse:e=>Pr.parse(e)/100,transform:e=>Pr.transform(e*100)},g6=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Ov=e=>e===So||e===we,Dv=(e,t)=>parseFloat(e.split(", ")[t]),Lv=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return Dv(i[1],t);{const a=r.match(/^matrix\((.+)\)$/u);return a?Dv(a[1],e):0}},w6=new Set(["x","y","z"]),y6=el.filter(e=>!w6.has(e));function v6(e){const t=[];return y6.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Co={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Lv(4,13),y:Lv(5,14)};Co.translateX=Co.x,Co.translateY=Co.y;const Mv=e=>t=>t.test(e),Fv=[So,we,Pr,Ii,m6,h6,{test:e=>e==="auto",parse:e=>e}],Bv=e=>Fv.find(Mv(e)),La=new Set;let Sh=!1,Ch=!1;function jv(){if(Ch){const e=Array.from(La).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=v6(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([a,o])=>{var s;(s=r.getValue(a))===null||s===void 0||s.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Ch=!1,Sh=!1,La.forEach(e=>e.complete()),La.clear()}function Uv(){La.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ch=!0)})}function b6(){Uv(),jv()}class kh{constructor(t,n,r,i,a,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=a,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(La.add(this),Sh||(Sh=!0,Xe.read(Uv),Xe.resolveKeyframes(jv))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let a=0;a<t.length;a++)if(t[a]===null)if(a===0){const o=i==null?void 0:i.get(),s=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const l=r.readValue(n,s);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=s),i&&o===void 0&&i.set(t[0])}else t[a]=t[a-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),La.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,La.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const il=e=>Math.round(e*1e5)/1e5,Ah=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function x6(e){return e==null}const E6=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Rh=(e,t)=>n=>!!(typeof n=="string"&&E6.test(n)&&n.startsWith(e)||t&&!x6(n)&&Object.prototype.hasOwnProperty.call(n,t)),zv=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,a,o,s]=r.match(Ah);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s!==void 0?parseFloat(s):1}},T6=e=>Pi(0,255,e),Nh={...So,transform:e=>Math.round(T6(e))},Ma={test:Rh("rgb","red"),parse:zv("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Nh.transform(e)+", "+Nh.transform(t)+", "+Nh.transform(n)+", "+il(nl.transform(r))+")"};function _6(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const Ph={test:Rh("#"),parse:_6,transform:Ma.transform},ko={test:Rh("hsl","hue"),parse:zv("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Pr.transform(il(t))+", "+Pr.transform(il(n))+", "+il(nl.transform(r))+")"},Gt={test:e=>Ma.test(e)||Ph.test(e)||ko.test(e),parse:e=>Ma.test(e)?Ma.parse(e):ko.test(e)?ko.parse(e):Ph.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ma.transform(e):ko.transform(e)},S6=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function C6(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Ah))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(S6))===null||n===void 0?void 0:n.length)||0)>0}const Hv="number",Vv="color",k6="var",A6="var(",$v="${}",R6=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function al(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let a=0;const s=t.replace(R6,l=>(Gt.test(l)?(r.color.push(a),i.push(Vv),n.push(Gt.parse(l))):l.startsWith(A6)?(r.var.push(a),i.push(k6),n.push(l)):(r.number.push(a),i.push(Hv),n.push(parseFloat(l))),++a,$v)).split($v);return{values:n,split:s,indexes:r,types:i}}function Wv(e){return al(e).values}function Yv(e){const{split:t,types:n}=al(e),r=t.length;return i=>{let a="";for(let o=0;o<r;o++)if(a+=t[o],i[o]!==void 0){const s=n[o];s===Hv?a+=il(i[o]):s===Vv?a+=Gt.transform(i[o]):a+=i[o]}return a}}const N6=e=>typeof e=="number"?0:e;function P6(e){const t=Wv(e);return Yv(e)(t.map(N6))}const Oi={test:C6,parse:Wv,createTransformer:Yv,getAnimatableNone:P6},I6=new Set(["brightness","contrast","saturate","opacity"]);function O6(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Ah)||[];if(!r)return e;const i=n.replace(r,"");let a=I6.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+i+")"}const D6=/\b([a-z-]*)\(.*?\)/gu,Ih={...Oi,getAnimatableNone:e=>{const t=e.match(D6);return t?t.map(O6).join(" "):e}},L6={borderWidth:we,borderTopWidth:we,borderRightWidth:we,borderBottomWidth:we,borderLeftWidth:we,borderRadius:we,radius:we,borderTopLeftRadius:we,borderTopRightRadius:we,borderBottomRightRadius:we,borderBottomLeftRadius:we,width:we,maxWidth:we,height:we,maxHeight:we,top:we,right:we,bottom:we,left:we,padding:we,paddingTop:we,paddingRight:we,paddingBottom:we,paddingLeft:we,margin:we,marginTop:we,marginRight:we,marginBottom:we,marginLeft:we,backgroundPositionX:we,backgroundPositionY:we},M6={rotate:Ii,rotateX:Ii,rotateY:Ii,rotateZ:Ii,scale:Sc,scaleX:Sc,scaleY:Sc,scaleZ:Sc,skew:Ii,skewX:Ii,skewY:Ii,distance:we,translateX:we,translateY:we,translateZ:we,x:we,y:we,z:we,perspective:we,transformPerspective:we,opacity:nl,originX:Iv,originY:Iv,originZ:we},qv={...So,transform:Math.round},Oh={...L6,...M6,zIndex:qv,size:we,fillOpacity:nl,strokeOpacity:nl,numOctaves:qv},F6={...Oh,color:Gt,backgroundColor:Gt,outlineColor:Gt,fill:Gt,stroke:Gt,borderColor:Gt,borderTopColor:Gt,borderRightColor:Gt,borderBottomColor:Gt,borderLeftColor:Gt,filter:Ih,WebkitFilter:Ih},Dh=e=>F6[e];function Gv(e,t){let n=Dh(e);return n!==Ih&&(n=Oi),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const B6=new Set(["auto","none","0"]);function j6(e,t,n){let r=0,i;for(;r<e.length&&!i;){const a=e[r];typeof a=="string"&&!B6.has(a)&&al(a).values.length&&(i=e[r]),r++}if(i&&n)for(const a of t)e[a]=Gv(n,i)}class Kv extends kh{constructor(t,n,r,i,a){super(t,n,r,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let u=t[l];if(typeof u=="string"&&(u=u.trim(),_h(u))){const c=Pv(u,n.current);c!==void 0&&(t[l]=c),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!g6.has(r)||t.length!==2)return;const[i,a]=t,o=Bv(i),s=Bv(a);if(o!==s)if(Ov(o)&&Ov(s))for(let l=0;l<t.length;l++){const u=t[l];typeof u=="string"&&(t[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)u6(t[i])&&r.push(i);r.length&&j6(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Co[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const a=n.getValue(r);a&&a.jump(this.measuredOrigin,!1);const o=i.length-1,s=i[o];i[o]=Co[r](n.measureViewportBox(),window.getComputedStyle(n.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,u])=>{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function Lh(e){return typeof e=="function"}let Cc;function U6(){Cc=void 0}const Ir={now:()=>(Cc===void 0&&Ir.set(Ut.isProcessing||n6.useManualTiming?Ut.timestamp:performance.now()),Cc),set:e=>{Cc=e,queueMicrotask(U6)}},Xv=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Oi.test(e)||e==="0")&&!e.startsWith("url("));function z6(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function H6(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],o=Xv(i,t),s=Xv(a,t);return!o||!s?!1:z6(e)||(n==="spring"||Lh(n))&&r}const V6=40;class Qv{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",...s}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Ir.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:a,repeatType:o,...s},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>V6?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&b6(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Ir.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:a,delay:o,onComplete:s,onUpdate:l,isGenerator:u}=this.options;if(!u&&!H6(t,r,i,a))if(o)this.options.duration=0;else{l==null||l(Tc(t,this.options,n)),s==null||s(),this.resolveFinishedPromise();return}const c=this.initPlayback(t,n);c!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...c},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}function Zv(e,t){return t?e*(1e3/t):0}const $6=5;function Jv(e,t,n){const r=Math.max(t-$6,0);return Zv(n-e(r),t-r)}const Mh=.001,W6=.01,Y6=10,q6=.05,G6=1;function K6({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,a,o=1-t;o=Pi(q6,G6,o),e=Pi(W6,Y6,ei(e)),o<1?(i=u=>{const c=u*o,d=c*e,f=c-n,p=Fh(u,o),m=Math.exp(-d);return Mh-f/p*m},a=u=>{const d=u*o*e,f=d*n+n,p=Math.pow(o,2)*Math.pow(u,2)*e,m=Math.exp(-d),g=Fh(Math.pow(u,2),o);return(-i(u)+Mh>0?-1:1)*((f-p)*m)/g}):(i=u=>{const c=Math.exp(-u*e),d=(u-n)*e+1;return-Mh+c*d},a=u=>{const c=Math.exp(-u*e),d=(n-u)*(e*e);return c*d});const s=5/e,l=Q6(i,a,s);if(e=Jr(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const X6=12;function Q6(e,t,n){let r=n;for(let i=1;i<X6;i++)r=r-e(r)/t(r);return r}function Fh(e,t){return e*Math.sqrt(1-t*t)}const Z6=["duration","bounce"],J6=["stiffness","damping","mass"];function eb(e,t){return t.some(n=>e[n]!==void 0)}function e4(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!eb(e,J6)&&eb(e,Z6)){const n=K6(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}function tb({keyframes:e,restDelta:t,restSpeed:n,...r}){const i=e[0],a=e[e.length-1],o={done:!1,value:i},{stiffness:s,damping:l,mass:u,duration:c,velocity:d,isResolvedFromDuration:f}=e4({...r,velocity:-ei(r.velocity||0)}),p=d||0,m=l/(2*Math.sqrt(s*u)),g=a-i,x=ei(Math.sqrt(s/u)),w=Math.abs(g)<5;n||(n=w?.01:2),t||(t=w?.005:.5);let v;if(m<1){const b=Fh(x,m);v=E=>{const _=Math.exp(-m*x*E);return a-_*((p+m*x*g)/b*Math.sin(b*E)+g*Math.cos(b*E))}}else if(m===1)v=b=>a-Math.exp(-x*b)*(g+(p+x*g)*b);else{const b=x*Math.sqrt(m*m-1);v=E=>{const _=Math.exp(-m*x*E),S=Math.min(b*E,300);return a-_*((p+m*x*g)*Math.sinh(S)+b*g*Math.cosh(S))/b}}return{calculatedDuration:f&&c||null,next:b=>{const E=v(b);if(f)o.done=b>=c;else{let _=0;m<1&&(_=b===0?Jr(p):Jv(v,b,E));const S=Math.abs(_)<=n,I=Math.abs(a-E)<=t;o.done=S&&I}return o.value=o.done?a:E,o}}}function nb({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:l,restDelta:u=.5,restSpeed:c}){const d=e[0],f={done:!1,value:d},p=D=>s!==void 0&&D<s||l!==void 0&&D>l,m=D=>s===void 0?l:l===void 0||Math.abs(s-D)<Math.abs(l-D)?s:l;let g=n*t;const x=d+g,w=o===void 0?x:o(x);w!==x&&(g=w-d);const v=D=>-g*Math.exp(-D/r),b=D=>w+v(D),E=D=>{const V=v(D),N=b(D);f.done=Math.abs(V)<=u,f.value=f.done?w:N};let _,S;const I=D=>{p(f.value)&&(_=D,S=tb({keyframes:[f.value,m(f.value)],velocity:Jv(b,D,f.value),damping:i,stiffness:a,restDelta:u,restSpeed:c}))};return I(0),{calculatedDuration:null,next:D=>{let V=!1;return!S&&_===void 0&&(V=!0,E(D),I(D)),_!==void 0&&D>=_?S.next(D-_):(!V&&E(D),f)}}}const t4=tl(.42,0,1,1),n4=tl(0,0,.58,1),rb=tl(.42,0,.58,1),r4=e=>Array.isArray(e)&&typeof e[0]!="number",Bh=e=>Array.isArray(e)&&typeof e[0]=="number",ib={linear:qt,easeIn:t4,easeInOut:rb,easeOut:n4,circIn:Eh,circInOut:Cv,circOut:Sv,backIn:xh,backInOut:Tv,backOut:Ev,anticipate:_v},ab=e=>{if(Bh(e)){Th(e.length===4);const[t,n,r,i]=e;return tl(t,n,r,i)}else if(typeof e=="string")return Th(ib[e]!==void 0),ib[e];return e},i4=(e,t)=>n=>t(e(n)),ti=(...e)=>e.reduce(i4),Ao=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},ut=(e,t,n)=>e+(t-e)*n;function jh(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function a4({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;i=jh(l,s,e+1/3),a=jh(l,s,e),o=jh(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function kc(e,t){return n=>n>0?t:e}const Uh=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},o4=[Ph,Ma,ko],s4=e=>o4.find(t=>t.test(e));function ob(e){const t=s4(e);if(!t)return!1;let n=t.parse(e);return t===ko&&(n=a4(n)),n}const sb=(e,t)=>{const n=ob(e),r=ob(t);if(!n||!r)return kc(e,t);const i={...n};return a=>(i.red=Uh(n.red,r.red,a),i.green=Uh(n.green,r.green,a),i.blue=Uh(n.blue,r.blue,a),i.alpha=ut(n.alpha,r.alpha,a),Ma.transform(i))},zh=new Set(["none","hidden"]);function l4(e,t){return zh.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function u4(e,t){return n=>ut(e,t,n)}function Hh(e){return typeof e=="number"?u4:typeof e=="string"?_h(e)?kc:Gt.test(e)?sb:f4:Array.isArray(e)?lb:typeof e=="object"?Gt.test(e)?sb:c4:kc}function lb(e,t){const n=[...e],r=n.length,i=e.map((a,o)=>Hh(a)(a,t[o]));return a=>{for(let o=0;o<r;o++)n[o]=i[o](a);return n}}function c4(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Hh(e[i])(e[i],t[i]));return i=>{for(const a in r)n[a]=r[a](i);return n}}function d4(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const o=t.types[a],s=e.indexes[o][i[o]],l=(n=e.values[s])!==null&&n!==void 0?n:0;r[a]=l,i[o]++}return r}const f4=(e,t)=>{const n=Oi.createTransformer(t),r=al(e),i=al(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?zh.has(e)&&!i.values.length||zh.has(t)&&!r.values.length?l4(e,t):ti(lb(d4(r,i),i.values),n):kc(e,t)};function ub(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ut(e,t,n):Hh(e)(e,t)}function p4(e,t,n){const r=[],i=n||ub,a=e.length-1;for(let o=0;o<a;o++){let s=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||qt:t;s=ti(l,s)}r.push(s)}return r}function h4(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const a=e.length;if(Th(a===t.length),a===1)return()=>t[0];if(a===2&&e[0]===e[1])return()=>t[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=p4(t,r,i),s=o.length,l=u=>{let c=0;if(s>1)for(;c<e.length-2&&!(u<e[c+1]);c++);const d=Ao(e[c],e[c+1],u);return o[c](d)};return n?u=>l(Pi(e[0],e[a-1],u)):l}function m4(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Ao(0,t,r);e.push(ut(n,1,i))}}function g4(e){const t=[0];return m4(t,e.length-1),t}function w4(e,t){return e.map(n=>n*t)}function y4(e,t){return e.map(()=>t||rb).splice(0,e.length-1)}function Ac({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=r4(r)?r.map(ab):ab(r),a={done:!1,value:t[0]},o=w4(n&&n.length===t.length?n:g4(t),e),s=h4(o,t,{ease:Array.isArray(i)?i:y4(t,i)});return{calculatedDuration:e,next:l=>(a.value=s(l),a.done=l>=e,a)}}const cb=2e4;function v4(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<cb;)t+=n,r=e.next(t);return t>=cb?1/0:t}const b4=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Xe.update(t,!0),stop:()=>Ni(t),now:()=>Ut.isProcessing?Ut.timestamp:Ir.now()}},x4={decay:nb,inertia:nb,tween:Ac,keyframes:Ac,spring:tb},E4=e=>e/100;class Vh extends Qv{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:i,keyframes:a}=this.options,o=(i==null?void 0:i.KeyframeResolver)||kh,s=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new o(a,s,n,r,i),this.resolver.scheduleResolve()}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:a,velocity:o=0}=this.options,s=Lh(n)?n:x4[n]||Ac;let l,u;s!==Ac&&typeof t[0]!="number"&&(l=ti(E4,ub(t[0],t[1])),t=[0,100]);const c=s({...this.options,keyframes:t});a==="mirror"&&(u=s({...this.options,keyframes:[...t].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=v4(c));const{calculatedDuration:d}=c,f=d+i,p=f*(r+1)-i;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:d,resolvedDuration:f,totalDuration:p}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:D}=this.options;return{done:!0,value:D[D.length-1]}}const{finalKeyframe:i,generator:a,mirroredGenerator:o,mapPercentToKeyframes:s,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:d}=r;if(this.startTime===null)return a.next(0);const{delay:f,repeat:p,repeatType:m,repeatDelay:g,onUpdate:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-c/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const w=this.currentTime-f*(this.speed>=0?1:-1),v=this.speed>=0?w<0:w>c;this.currentTime=Math.max(w,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let b=this.currentTime,E=a;if(p){const D=Math.min(this.currentTime,c)/d;let V=Math.floor(D),N=D%1;!N&&D>=1&&(N=1),N===1&&V--,V=Math.min(V,p+1),!!(V%2)&&(m==="reverse"?(N=1-N,g&&(N-=g/d)):m==="mirror"&&(E=o)),b=Pi(0,1,N)*d}const _=v?{done:!1,value:l[0]}:E.next(b);s&&(_.value=s(_.value));let{done:S}=_;!v&&u!==null&&(S=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const I=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return I&&i!==void 0&&(_.value=Tc(l,this.options,i)),x&&x(_.value),I&&this.finish(),_}get duration(){const{resolved:t}=this;return t?ei(t.calculatedDuration):0}get time(){return ei(this.currentTime)}set time(t){t=Jr(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ei(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=b4,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const db=new Set(["opacity","clipPath","filter","transform"]),T4=10,_4=(e,t)=>{let n="";const r=Math.max(Math.round(t/T4),2);for(let i=0;i<r;i++)n+=e(Ao(0,r-1,i))+", ";return`linear(${n.substring(0,n.length-2)})`};function $h(e){let t;return()=>(t===void 0&&(t=e()),t)}const S4={linearEasing:void 0};function C4(e,t){const n=$h(e);return()=>{var r;return(r=S4[t])!==null&&r!==void 0?r:n()}}const Rc=C4(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");function fb(e){return!!(typeof e=="function"&&Rc()||!e||typeof e=="string"&&(e in Wh||Rc())||Bh(e)||Array.isArray(e)&&e.every(fb))}const ol=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Wh={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ol([0,.65,.55,1]),circOut:ol([.55,0,1,.45]),backIn:ol([.31,.01,.66,-.59]),backOut:ol([.33,1.53,.69,.99])};function pb(e,t){if(e)return typeof e=="function"&&Rc()?_4(e,t):Bh(e)?ol(e):Array.isArray(e)?e.map(n=>pb(n,t)||Wh.easeOut):Wh[e]}function k4(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:s,times:l}={}){const u={[t]:n};l&&(u.offset=l);const c=pb(s,i);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:r,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"})}function hb(e,t){e.timeline=t,e.onfinish=null}const A4=$h(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Nc=10,R4=2e4;function N4(e){return Lh(e.type)||e.type==="spring"||!fb(e.ease)}function P4(e,t){const n=new Vh({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let a=0;for(;!r.done&&a<R4;)r=n.sample(a),i.push(r.value),a+=Nc;return{times:void 0,keyframes:i,duration:a-Nc,ease:"linear"}}const mb={anticipate:_v,backInOut:Tv,circInOut:Cv};function I4(e){return e in mb}class gb extends Qv{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:a}=this.options;this.resolver=new Kv(a,(o,s)=>this.onKeyframesResolved(o,s),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){var r;let{duration:i=300,times:a,ease:o,type:s,motionValue:l,name:u,startTime:c}=this.options;if(!(!((r=l.owner)===null||r===void 0)&&r.current))return!1;if(typeof o=="string"&&Rc()&&I4(o)&&(o=mb[o]),N4(this.options)){const{onComplete:f,onUpdate:p,motionValue:m,element:g,...x}=this.options,w=P4(t,x);t=w.keyframes,t.length===1&&(t[1]=t[0]),i=w.duration,a=w.times,o=w.ease,s="keyframes"}const d=k4(l.owner.current,u,t,{...this.options,duration:i,times:a,ease:o});return d.startTime=c??this.calcStartTime(),this.pendingTimeline?(hb(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(Tc(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:i,times:a,type:s,ease:o,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return ei(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return ei(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Jr(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return qt;const{animation:r}=n;hb(r,t)}return qt}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:a,ease:o,times:s}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:c,onComplete:d,element:f,...p}=this.options,m=new Vh({...p,keyframes:r,duration:i,type:a,ease:o,times:s,isGenerator:!0}),g=Jr(this.time);u.setWithVelocity(m.sample(g-Nc).value,m.sample(g).value,Nc)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:a,damping:o,type:s}=t;return A4()&&r&&db.has(r)&&n&&n.owner&&n.owner.current instanceof HTMLElement&&!n.owner.getProps().onUpdate&&!i&&a!=="mirror"&&o!==0&&s!=="inertia"}}const O4=$h(()=>window.ScrollTimeline!==void 0);class D4{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}then(t,n){return Promise.all(this.animations).then(t).catch(n)}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>O4()&&i.attachTimeline?i.attachTimeline(t):n(i));return()=>{r.forEach((i,a)=>{i&&i(),this.animations[a].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function L4({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:s,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const Yh=(e,t,n,r={},i,a)=>o=>{const s=vh(r,e)||{},l=s.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Jr(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-u,onUpdate:f=>{t.set(f),s.onUpdate&&s.onUpdate(f)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};L4(s)||(c={...c,...t6(e,c)}),c.duration&&(c.duration=Jr(c.duration)),c.repeatDelay&&(c.repeatDelay=Jr(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let d=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(d=!0)),d&&!a&&t.get()!==void 0){const f=Tc(c.keyframes,s);if(f!==void 0)return Xe.update(()=>{c.onUpdate(f),c.onComplete()}),new D4([])}return!a&&gb.supports(c)?new gb(c):new Vh(c)},M4=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),F4=e=>mh(e)?e[e.length-1]||0:e;function qh(e,t){e.indexOf(t)===-1&&e.push(t)}function Gh(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Kh{constructor(){this.subscriptions=[]}add(t){return qh(this.subscriptions,t),()=>Gh(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let a=0;a<i;a++){const o=this.subscriptions[a];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const wb=30,B4=e=>!isNaN(parseFloat(e));class j4{constructor(t,n={}){this.version="11.11.9",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const a=Ir.now();this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Ir.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=B4(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Kh);const r=this.events[t].add(n);return t==="change"?()=>{r(),Xe.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ir.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>wb)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,wb);return Zv(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function sl(e,t){return new j4(e,t)}function U4(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,sl(n))}function z4(e,t){const n=Ec(e,t);let{transitionEnd:r={},transition:i={},...a}=n||{};a={...a,...r};for(const o in a){const s=F4(a[o]);U4(e,o,s)}}const Pc=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),yb="data-"+Pc("framerAppearId");function vb(e){return e.props[yb]}const Kt=e=>!!(e&&e.getVelocity);function H4(e){return!!(Kt(e)&&e.add)}function Xh(e,t){if(!e.applyWillChange)return;const n=e.getValue("willChange");if(H4(n))return n.add(t)}function V4({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function bb(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var a;let{transition:o=e.getDefaultTransition(),transitionEnd:s,...l}=t;r&&(o=r);const u=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const d in l){const f=e.getValue(d,(a=e.latestValues[d])!==null&&a!==void 0?a:null),p=l[d];if(p===void 0||c&&V4(c,d))continue;const m={delay:n,...vh(o||{},d)};let g=!1;if(window.MotionHandoffAnimation){const w=vb(e);if(w){const v=window.MotionHandoffAnimation(w,d,Xe);v!==null&&(m.startTime=v,g=!0)}}Xh(e,d),f.start(Yh(d,f,p,e.shouldReduceMotion&&Ri.has(d)?{type:!1}:m,e,g));const x=f.animation;x&&u.push(x)}return s&&Promise.all(u).then(()=>{Xe.update(()=>{s&&z4(e,s)})}),u}function Qh(e,t,n={}){var r;const i=Ec(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(a=n.transitionOverride);const o=i?()=>Promise.all(bb(e,i,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:d,staggerDirection:f}=a;return $4(e,t,c+u,d,f,n)}:()=>Promise.resolve(),{when:l}=a;if(l){const[u,c]=l==="beforeChildren"?[o,s]:[s,o];return u().then(()=>c())}else return Promise.all([o(),s(n.delay)])}function $4(e,t,n=0,r=0,i=1,a){const o=[],s=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>s-u*r;return Array.from(e.variantChildren).sort(W4).forEach((u,c)=>{u.notify("AnimationStart",t),o.push(Qh(u,t,{...a,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function W4(e,t){return e.sortNodePosition(t)}function Y4(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(a=>Qh(e,a,n));r=Promise.all(i)}else if(typeof t=="string")r=Qh(e,t,n);else{const i=typeof t=="function"?Ec(e,t,n.custom):t;r=Promise.all(bb(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const q4=yh.length;function xb(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?xb(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<q4;n++){const r=yh[n],i=e.props[r];(Js(i)||i===!1)&&(t[r]=i)}return t}const G4=[...wh].reverse(),K4=wh.length;function X4(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Y4(e,n,r)))}function Q4(e){let t=X4(e),n=Eb(),r=!0;const i=l=>(u,c)=>{var d;const f=Ec(e,c,l==="exit"?(d=e.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(f){const{transition:p,transitionEnd:m,...g}=f;u={...u,...g,...m}}return u};function a(l){t=l(e)}function o(l){const{props:u}=e,c=xb(e.parent)||{},d=[],f=new Set;let p={},m=1/0;for(let x=0;x<K4;x++){const w=G4[x],v=n[w],b=u[w]!==void 0?u[w]:c[w],E=Js(b),_=w===l?v.isActive:null;_===!1&&(m=x);let S=b===c[w]&&b!==u[w]&&E;if(S&&r&&e.manuallyAnimateOnMount&&(S=!1),v.protectedKeys={...p},!v.isActive&&_===null||!b&&!v.prevProp||Zs(b)||typeof b=="boolean")continue;const I=Z4(v.prevProp,b);let D=I||w===l&&v.isActive&&!S&&E||x>m&&E,V=!1;const N=Array.isArray(b)?b:[b];let $=N.reduce(i(w),{});_===!1&&($={});const{prevResolvedValues:z={}}=v,X={...z,...$},Y=ee=>{D=!0,f.has(ee)&&(V=!0,f.delete(ee)),v.needsAnimating[ee]=!0;const F=e.getValue(ee);F&&(F.liveStyle=!1)};for(const ee in X){const F=$[ee],B=z[ee];if(p.hasOwnProperty(ee))continue;let k=!1;mh(F)&&mh(B)?k=!gv(F,B):k=F!==B,k?F!=null?Y(ee):f.add(ee):F!==void 0&&f.has(ee)?Y(ee):v.protectedKeys[ee]=!0}v.prevProp=b,v.prevResolvedValues=$,v.isActive&&(p={...p,...$}),r&&e.blockInitialAnimation&&(D=!1),D&&(!(S&&I)||V)&&d.push(...N.map(ee=>({animation:ee,options:{type:w}})))}if(f.size){const x={};f.forEach(w=>{const v=e.getBaseTarget(w),b=e.getValue(w);b&&(b.liveStyle=!0),x[w]=v??null}),d.push({animation:x})}let g=!!d.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(g=!1),r=!1,g?t(d):Promise.resolve()}function s(l,u){var c;if(n[l].isActive===u)return Promise.resolve();(c=e.variantChildren)===null||c===void 0||c.forEach(f=>{var p;return(p=f.animationState)===null||p===void 0?void 0:p.setActive(l,u)}),n[l].isActive=u;const d=o(l);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:o,setActive:s,setAnimateFunction:a,getState:()=>n,reset:()=>{n=Eb(),r=!0}}}function Z4(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!gv(t,e):!1}function Fa(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Eb(){return{animate:Fa(!0),whileInView:Fa(),whileHover:Fa(),whileTap:Fa(),whileDrag:Fa(),whileFocus:Fa(),exit:Fa()}}class Di{constructor(t){this.isMounted=!1,this.node=t}update(){}}class J4 extends Di{constructor(t){super(t),t.animationState||(t.animationState=Q4(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Zs(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let e5=0;class t5 extends Di{constructor(){super(...arguments),this.id=e5++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const n5={animation:{Feature:J4},exit:{Feature:t5}},Tb=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Ic(e,t="page"){return{point:{x:e[`${t}X`],y:e[`${t}Y`]}}}const r5=e=>t=>Tb(t)&&e(t,Ic(t));function ni(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function ri(e,t,n,r){return ni(e,t,r5(n),r)}const _b=(e,t)=>Math.abs(e-t);function i5(e,t){const n=_b(e.x,t.x),r=_b(e.y,t.y);return Math.sqrt(n**2+r**2)}class Sb{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:a=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Jh(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=i5(d.offset,{x:0,y:0})>=3;if(!f&&!p)return;const{point:m}=d,{timestamp:g}=Ut;this.history.push({...m,timestamp:g});const{onStart:x,onMove:w}=this.handlers;f||(x&&x(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Zh(f,this.transformPagePoint),Xe.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Jh(d.type==="pointercancel"?this.lastMoveEventInfo:Zh(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,x),m&&m(d,x)},!Tb(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=Ic(t),s=Zh(o,this.transformPagePoint),{point:l}=s,{timestamp:u}=Ut;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=n;c&&c(t,Jh(s,this.history)),this.removeListeners=ti(ri(this.contextWindow,"pointermove",this.handlePointerMove),ri(this.contextWindow,"pointerup",this.handlePointerUp),ri(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Ni(this.updatePoint)}}function Zh(e,t){return t?{point:t(e.point)}:e}function Cb(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Jh({point:e},t){return{point:e,delta:Cb(e,kb(t)),offset:Cb(e,a5(t)),velocity:o5(t,.1)}}function a5(e){return e[0]}function kb(e){return e[e.length-1]}function o5(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=kb(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Jr(t)));)n--;if(!r)return{x:0,y:0};const a=ei(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Ab(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const Rb=Ab("dragHorizontal"),Nb=Ab("dragVertical");function Pb(e){let t=!1;if(e==="y")t=Nb();else if(e==="x")t=Rb();else{const n=Rb(),r=Nb();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function Ib(){const e=Pb(!0);return e?(e(),!1):!0}function Ro(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}const Ob=1e-4,s5=1-Ob,l5=1+Ob,Db=.01,u5=0-Db,c5=0+Db;function On(e){return e.max-e.min}function d5(e,t,n){return Math.abs(e-t)<=n}function Lb(e,t,n,r=.5){e.origin=r,e.originPoint=ut(t.min,t.max,e.origin),e.scale=On(n)/On(t),e.translate=ut(n.min,n.max,e.origin)-e.originPoint,(e.scale>=s5&&e.scale<=l5||isNaN(e.scale))&&(e.scale=1),(e.translate>=u5&&e.translate<=c5||isNaN(e.translate))&&(e.translate=0)}function ll(e,t,n,r){Lb(e.x,t.x,n.x,r?r.originX:void 0),Lb(e.y,t.y,n.y,r?r.originY:void 0)}function Mb(e,t,n){e.min=n.min+t.min,e.max=e.min+On(t)}function f5(e,t,n){Mb(e.x,t.x,n.x),Mb(e.y,t.y,n.y)}function Fb(e,t,n){e.min=t.min-n.min,e.max=e.min+On(t)}function ul(e,t,n){Fb(e.x,t.x,n.x),Fb(e.y,t.y,n.y)}function p5(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ut(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ut(n,e,r.max):Math.min(e,n)),e}function Bb(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function h5(e,{top:t,left:n,bottom:r,right:i}){return{x:Bb(e.x,n,i),y:Bb(e.y,t,r)}}function jb(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function m5(e,t){return{x:jb(e.x,t.x),y:jb(e.y,t.y)}}function g5(e,t){let n=.5;const r=On(e),i=On(t);return i>r?n=Ao(t.min,t.max-r,e.min):r>i&&(n=Ao(e.min,e.max-i,t.min)),Pi(0,1,n)}function w5(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const em=.35;function y5(e=em){return e===!1?e=0:e===!0&&(e=em),{x:Ub(e,"left","right"),y:Ub(e,"top","bottom")}}function Ub(e,t,n){return{min:zb(e,t),max:zb(e,n)}}function zb(e,t){return typeof e=="number"?e:e[t]||0}const Hb=()=>({translate:0,scale:1,origin:0,originPoint:0}),No=()=>({x:Hb(),y:Hb()}),Vb=()=>({min:0,max:0}),Et=()=>({x:Vb(),y:Vb()});function Kn(e){return[e("x"),e("y")]}function $b({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function v5({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function b5(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function tm(e){return e===void 0||e===1}function nm({scale:e,scaleX:t,scaleY:n}){return!tm(e)||!tm(t)||!tm(n)}function Ba(e){return nm(e)||Wb(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Wb(e){return Yb(e.x)||Yb(e.y)}function Yb(e){return e&&e!=="0%"}function Oc(e,t,n){const r=e-n,i=t*r;return n+i}function qb(e,t,n,r,i){return i!==void 0&&(e=Oc(e,i,r)),Oc(e,n,r)+t}function rm(e,t=0,n=1,r,i){e.min=qb(e.min,t,n,r,i),e.max=qb(e.max,t,n,r,i)}function Gb(e,{x:t,y:n}){rm(e.x,t.translate,t.scale,t.originPoint),rm(e.y,n.translate,n.scale,n.originPoint)}const Kb=.999999999999,Xb=1.0000000000001;function x5(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;const{visualElement:l}=a.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Io(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Gb(e,o)),r&&Ba(a.latestValues)&&Io(e,a.latestValues))}t.x<Xb&&t.x>Kb&&(t.x=1),t.y<Xb&&t.y>Kb&&(t.y=1)}function Po(e,t){e.min=e.min+t,e.max=e.max+t}function Qb(e,t,n,r,i=.5){const a=ut(e.min,e.max,i);rm(e,t,n,a,r)}function Io(e,t){Qb(e.x,t.x,t.scaleX,t.scale,t.originX),Qb(e.y,t.y,t.scaleY,t.scale,t.originY)}function Zb(e,t){return $b(b5(e.getBoundingClientRect(),t))}function E5(e,t,n){const r=Zb(e,n),{scroll:i}=t;return i&&(Po(r.x,i.offset.x),Po(r.y,i.offset.y)),r}const Jb=({current:e})=>e?e.ownerDocument.defaultView:null,T5=new WeakMap;class _5{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Et(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=c=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Ic(c,"page").point)},a=(c,d)=>{const{drag:f,dragPropagation:p,onDragStart:m}=this.getProps();if(f&&!p&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Pb(f),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Kn(x=>{let w=this.getAxisMotionValue(x).get()||0;if(Pr.test(w)){const{projection:v}=this.visualElement;if(v&&v.layout){const b=v.layout.layoutBox[x];b&&(w=On(b)*(parseFloat(w)/100))}}this.originPoint[x]=w}),m&&Xe.postRender(()=>m(c,d)),Xh(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},o=(c,d)=>{const{dragPropagation:f,dragDirectionLock:p,onDirectionLock:m,onDrag:g}=this.getProps();if(!f&&!this.openGlobalLock)return;const{offset:x}=d;if(p&&this.currentDirection===null){this.currentDirection=S5(x),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",d.point,x),this.updateAxis("y",d.point,x),this.visualElement.render(),g&&g(c,d)},s=(c,d)=>this.stop(c,d),l=()=>Kn(c=>{var d;return this.getAnimationState(c)==="paused"&&((d=this.getAxisMotionValue(c).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Sb(t,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:Jb(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&Xe.postRender(()=>a(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Dc(t,i,this.currentDirection))return;const a=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=p5(o,this.constraints[t],this.elastic[t])),a.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,a=this.constraints;n&&Ro(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=h5(i.layoutBox,n):this.constraints=!1,this.elastic=y5(r),a!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Kn(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=w5(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ro(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=E5(r,i.root,this.visualElement.getTransformPagePoint());let o=m5(i.layout.layoutBox,a);if(n){const s=n(v5(o));this.hasMutatedConstraints=!!s,s&&(o=$b(s))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=Kn(c=>{if(!Dc(c,n,this.currentDirection))return;let d=l&&l[c]||{};o&&(d={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,m={type:"inertia",velocity:r?t[c]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...a,...d};return this.startAxisValueAnimation(c,m)});return Promise.all(u).then(s)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Xh(this.visualElement,t),r.start(Yh(t,r,0,n,this.visualElement,!1))}stopAnimation(){Kn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Kn(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Kn(n=>{const{drag:r}=this.getProps();if(!Dc(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:s}=i.layout.layoutBox[n];a.set(t[n]-ut(o,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ro(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Kn(o=>{const s=this.getAxisMotionValue(o);if(s&&this.constraints!==!1){const l=s.get();i[o]=g5({min:l,max:l},this.constraints[o])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Kn(o=>{if(!Dc(o,t,null))return;const s=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];s.set(ut(l,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;T5.set(this.visualElement,this);const t=this.visualElement.current,n=ri(t,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Ro(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,a=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Xe.read(r);const o=ni(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Kn(c=>{const d=this.getAxisMotionValue(c);d&&(this.originPoint[c]+=l[c].translate,d.set(d.get()+l[c].translate))}),this.visualElement.render())});return()=>{o(),n(),a(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:o=em,dragMomentum:s=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:a,dragElastic:o,dragMomentum:s}}}function Dc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function S5(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class C5 extends Di{constructor(t){super(t),this.removeGroupControls=qt,this.removeListeners=qt,this.controls=new _5(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||qt}unmount(){this.removeGroupControls(),this.removeListeners()}}const ex=e=>(t,n)=>{e&&Xe.postRender(()=>e(t,n))};class k5 extends Di{constructor(){super(...arguments),this.removePointerDownListener=qt}onPointerDown(t){this.session=new Sb(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Jb(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:ex(t),onStart:ex(n),onMove:r,onEnd:(a,o)=>{delete this.session,i&&Xe.postRender(()=>i(a,o))}}}mount(){this.removePointerDownListener=ri(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Lc=y.createContext(null);function A5(){const e=y.useContext(Lc);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=y.useId();y.useEffect(()=>r(i),[]);const a=y.useCallback(()=>n&&n(i),[i,n]);return!t&&n?[!1,a]:[!0]}const im=y.createContext({}),tx=y.createContext({}),Mc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function nx(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const cl={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(we.test(e))e=parseFloat(e);else return e;const n=nx(e,t.target.x),r=nx(e,t.target.y);return`${n}% ${r}%`}},R5={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=Oi.parse(e);if(i.length>5)return r;const a=Oi.createTransformer(e),o=typeof i[0]!="number"?1:0,s=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=l;const u=ut(s,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),a(i)}},Fc={};function N5(e){Object.assign(Fc,e)}const{schedule:am,cancel:gie}=yv(queueMicrotask,!1);class P5 extends y.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:a}=t;N5(I5),a&&(n.group&&n.group.add(a),r&&r.register&&i&&r.register(a),a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),Mc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:a}=this.props,o=r.projection;return o&&(o.isPresent=a,i||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?o.promote():o.relegate()||Xe.postRender(()=>{const s=o.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),am.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function rx(e){const[t,n]=A5(),r=y.useContext(im);return T.jsx(P5,{...e,layoutGroup:r,switchLayoutGroup:y.useContext(tx),isPresent:t,safeToRemove:n})}const I5={borderRadius:{...cl,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:cl,borderTopRightRadius:cl,borderBottomLeftRadius:cl,borderBottomRightRadius:cl,boxShadow:R5},ix=["TopLeft","TopRight","BottomLeft","BottomRight"],O5=ix.length,ax=e=>typeof e=="string"?parseFloat(e):e,ox=e=>typeof e=="number"||we.test(e);function D5(e,t,n,r,i,a){i?(e.opacity=ut(0,n.opacity!==void 0?n.opacity:1,L5(r)),e.opacityExit=ut(t.opacity!==void 0?t.opacity:1,0,M5(r))):a&&(e.opacity=ut(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<O5;o++){const s=`border${ix[o]}Radius`;let l=sx(t,s),u=sx(n,s);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||ox(l)===ox(u)?(e[s]=Math.max(ut(ax(l),ax(u),r),0),(Pr.test(u)||Pr.test(l))&&(e[s]+="%")):e[s]=u}(t.rotate||n.rotate)&&(e.rotate=ut(t.rotate||0,n.rotate||0,r))}function sx(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const L5=lx(0,.5,Sv),M5=lx(.5,.95,qt);function lx(e,t,n){return r=>r<e?0:r>t?1:n(Ao(e,t,r))}function ux(e,t){e.min=t.min,e.max=t.max}function Xn(e,t){ux(e.x,t.x),ux(e.y,t.y)}function cx(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function dx(e,t,n,r,i){return e-=t,e=Oc(e,1/n,r),i!==void 0&&(e=Oc(e,1/i,r)),e}function F5(e,t=0,n=1,r=.5,i,a=e,o=e){if(Pr.test(t)&&(t=parseFloat(t),t=ut(o.min,o.max,t/100)-o.min),typeof t!="number")return;let s=ut(a.min,a.max,r);e===a&&(s-=t),e.min=dx(e.min,t,n,s,i),e.max=dx(e.max,t,n,s,i)}function fx(e,t,[n,r,i],a,o){F5(e,t[n],t[r],t[i],t.scale,a,o)}const B5=["x","scaleX","originX"],j5=["y","scaleY","originY"];function px(e,t,n,r){fx(e.x,t,B5,n?n.x:void 0,r?r.x:void 0),fx(e.y,t,j5,n?n.y:void 0,r?r.y:void 0)}function hx(e){return e.translate===0&&e.scale===1}function mx(e){return hx(e.x)&&hx(e.y)}function gx(e,t){return e.min===t.min&&e.max===t.max}function U5(e,t){return gx(e.x,t.x)&&gx(e.y,t.y)}function wx(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function yx(e,t){return wx(e.x,t.x)&&wx(e.y,t.y)}function vx(e){return On(e.x)/On(e.y)}function bx(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class z5{constructor(){this.members=[]}add(t){qh(this.members,t),t.scheduleRender()}remove(t){if(Gh(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const a=this.members[i];if(a.isPresent!==!1){r=a;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function H5(e,t,n){let r="";const i=e.x.translate/t.x,a=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:d,rotateY:f,skewX:p,skewY:m}=n;u&&(r=`perspective(${u}px) ${r}`),c&&(r+=`rotate(${c}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),p&&(r+=`skewX(${p}deg) `),m&&(r+=`skewY(${m}deg) `)}const s=e.x.scale*t.x,l=e.y.scale*t.y;return(s!==1||l!==1)&&(r+=`scale(${s}, ${l})`),r||"none"}const V5=(e,t)=>e.depth-t.depth;class $5{constructor(){this.children=[],this.isDirty=!1}add(t){qh(this.children,t),this.isDirty=!0}remove(t){Gh(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(V5),this.isDirty=!1,this.children.forEach(t)}}function Bc(e){const t=Kt(e)?e.get():e;return M4(t)?t.toValue():t}function W5(e,t){const n=Ir.now(),r=({timestamp:i})=>{const a=i-n;a>=t&&(Ni(r),e(a-t))};return Xe.read(r,!0),()=>Ni(r)}function Y5(e){return e instanceof SVGElement&&e.tagName!=="svg"}function q5(e,t,n){const r=Kt(e)?e:sl(e);return r.start(Yh("",r,t,n)),r.animation}const ja={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},dl=typeof window<"u"&&window.MotionDebug!==void 0,om=["","X","Y","Z"],G5={visibility:"hidden"},xx=1e3;let K5=0;function sm(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Ex(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=vb(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Xe,!(i||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Ex(r)}function Tx({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},s=t==null?void 0:t()){this.id=K5++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,dl&&(ja.totalNodes=ja.resolvedTargetDeltas=ja.recalculatedProjection=0),this.nodes.forEach(Z5),this.nodes.forEach(rD),this.nodes.forEach(iD),this.nodes.forEach(J5),dl&&window.MotionDebug.record(ja)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new $5)}addEventListener(o,s){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Kh),this.eventHandlers.get(o).add(s)}notifyListeners(o,...s){const l=this.eventHandlers.get(o);l&&l.notify(...s)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,s=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Y5(o),this.instance=o;const{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),s&&(u||l)&&(this.isLayoutDirty=!0),e){let d;const f=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=W5(f,250),Mc.hasAnimatedSinceResize&&(Mc.hasAnimatedSinceResize=!1,this.nodes.forEach(Sx))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:p,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||uD,{onLayoutAnimationStart:x,onLayoutAnimationComplete:w}=c.getProps(),v=!this.targetLayout||!yx(this.targetLayout,m)||p,b=!f&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||b||f&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,b);const E={...vh(g,"layout"),onPlay:x,onComplete:w};(c.shouldReduceMotion||this.options.layoutRoot)&&(E.delay=0,E.type=!1),this.startAnimation(E)}else f||Sx(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Ni(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(aD),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Ex(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const d=this.path[c];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:s,layout:l}=this.options;if(s===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(_x);return}this.isUpdating||this.nodes.forEach(tD),this.isUpdating=!1,this.nodes.forEach(nD),this.nodes.forEach(X5),this.nodes.forEach(Q5),this.clearAllSnapshots();const s=Ir.now();Ut.delta=Pi(0,1e3/60,s-Ut.timestamp),Ut.timestamp=s,Ut.isProcessing=!0,bh.update.process(Ut),bh.preRender.process(Ut),bh.render.process(Ut),Ut.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,am.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(eD),this.sharedNodes.forEach(oD)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Xe.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Xe.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Et(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:s}=this.options;s&&s.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let s=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(s=!1),s){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,s=this.projectionDelta&&!mx(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&(s||Ba(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const s=this.measurePageBox();let l=this.removeElementScroll(s);return o&&(l=this.removeTransform(l)),cD(l),{animationId:this.root.animationId,measuredBox:s,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:s}=this.options;if(!s)return Et();const l=s.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(dD))){const{scroll:c}=this.root;c&&(Po(l.x,c.offset.x),Po(l.y,c.offset.y))}return l}removeElementScroll(o){var s;const l=Et();if(Xn(l,o),!((s=this.scroll)===null||s===void 0)&&s.wasRoot)return l;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:d,options:f}=c;c!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&Xn(l,o),Po(l.x,d.offset.x),Po(l.y,d.offset.y))}return l}applyTransform(o,s=!1){const l=Et();Xn(l,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];!s&&c.options.layoutScroll&&c.scroll&&c!==c.root&&Io(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),Ba(c.latestValues)&&Io(l,c.latestValues)}return Ba(this.latestValues)&&Io(l,this.latestValues),l}removeTransform(o){const s=Et();Xn(s,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!Ba(u.latestValues))continue;nm(u.latestValues)&&u.updateSnapshot();const c=Et(),d=u.measurePageBox();Xn(c,d),px(s,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return Ba(this.latestValues)&&px(s,this.latestValues),s}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ut.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var s;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=Ut.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Et(),this.relativeTargetOrigin=Et(),ul(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),Xn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Et(),this.targetWithTransforms=Et()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),f5(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Xn(this.target,this.layout.layoutBox),Gb(this.target,this.targetDelta)):Xn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Et(),this.relativeTargetOrigin=Et(),ul(this.relativeTargetOrigin,this.target,p.target),Xn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}dl&&ja.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||nm(this.parent.latestValues)||Wb(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const s=this.getLead(),l=!!this.resumingFrom||this!==s;let u=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Ut.timestamp&&(u=!1),u)return;const{layout:c,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||d))return;Xn(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,p=this.treeScale.y;x5(this.layoutCorrected,this.treeScale,this.path,l),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=Et());const{target:m}=s;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(cx(this.prevProjectionDelta.x,this.projectionDelta.x),cx(this.prevProjectionDelta.y,this.projectionDelta.y)),ll(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==p||!bx(this.projectionDelta.x,this.prevProjectionDelta.x)||!bx(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m)),dl&&ja.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var s;if((s=this.options.visualElement)===null||s===void 0||s.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=No(),this.projectionDelta=No(),this.projectionDeltaWithTransform=No()}setAnimationOrigin(o,s=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},d=No();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!s;const f=Et(),p=l?l.source:void 0,m=this.layout?this.layout.source:void 0,g=p!==m,x=this.getStack(),w=!x||x.members.length<=1,v=!!(g&&!w&&this.options.crossfade===!0&&!this.path.some(lD));this.animationProgress=0;let b;this.mixTargetDelta=E=>{const _=E/1e3;Cx(d.x,o.x,_),Cx(d.y,o.y,_),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ul(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),sD(this.relativeTarget,this.relativeTargetOrigin,f,_),b&&U5(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=Et()),Xn(b,this.relativeTarget)),g&&(this.animationValues=c,D5(c,u,this.latestValues,_,v,w)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=_},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Ni(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Xe.update(()=>{Mc.hasAnimatedSinceResize=!0,this.currentAnimation=q5(0,xx,{...o,onUpdate:s=>{this.mixTargetDelta(s),o.onUpdate&&o.onUpdate(s)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(xx),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:s,target:l,layout:u,latestValues:c}=o;if(!(!s||!l||!u)){if(this!==o&&this.layout&&u&&Px(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Et();const d=On(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const f=On(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}Xn(s,l),Io(s,c),ll(this.projectionDeltaWithTransform,this.layoutCorrected,s,c)}}registerSharedNode(o,s){this.sharedNodes.has(o)||this.sharedNodes.set(o,new z5),this.sharedNodes.get(o).add(s);const u=s.options.initialPromotionConfig;s.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(s):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:s}=this.options;return s?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:s}=this.options;return s?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:s,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let s=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(s=!0),!s)return;const u={};l.z&&sm("z",o,u,this.animationValues);for(let c=0;c<om.length;c++)sm(`rotate${om[c]}`,o,u,this.animationValues),sm(`skew${om[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);o.scheduleRender()}getProjectionStyles(o){var s,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return G5;const u={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=Bc(o==null?void 0:o.pointerEvents)||"",u.transform=c?c(this.latestValues,""):"none",u;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const g={};return this.options.layoutId&&(g.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,g.pointerEvents=Bc(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Ba(this.latestValues)&&(g.transform=c?c({},""):"none",this.hasProjected=!1),g}const f=d.animationValues||d.latestValues;this.applyTransformsToTarget(),u.transform=H5(this.projectionDeltaWithTransform,this.treeScale,f),c&&(u.transform=c(f,u.transform));const{x:p,y:m}=this.projectionDelta;u.transformOrigin=`${p.origin*100}% ${m.origin*100}% 0`,d.animationValues?u.opacity=d===this?(l=(s=f.opacity)!==null&&s!==void 0?s:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:u.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const g in Fc){if(f[g]===void 0)continue;const{correct:x,applyTo:w}=Fc[g],v=u.transform==="none"?f[g]:x(f[g],d);if(w){const b=w.length;for(let E=0;E<b;E++)u[w[E]]=v}else u[g]=v}return this.options.layoutId&&(u.pointerEvents=d===this?Bc(o==null?void 0:o.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var s;return(s=o.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(_x),this.root.sharedNodes.clear()}}}function X5(e){e.updateLayout()}function Q5(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:a}=e.options,o=n.source!==e.layout.source;a==="size"?Kn(d=>{const f=o?n.measuredBox[d]:n.layoutBox[d],p=On(f);f.min=r[d].min,f.max=f.min+p}):Px(a,n.layoutBox,r)&&Kn(d=>{const f=o?n.measuredBox[d]:n.layoutBox[d],p=On(r[d]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+p)});const s=No();ll(s,r,n.layoutBox);const l=No();o?ll(l,e.applyTransform(i,!0),n.measuredBox):ll(l,r,n.layoutBox);const u=!mx(s);let c=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:p}=d;if(f&&p){const m=Et();ul(m,n.layoutBox,f.layoutBox);const g=Et();ul(g,r,p.layoutBox),yx(m,g)||(c=!0),d.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=m,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:s,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Z5(e){dl&&ja.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function J5(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function eD(e){e.clearSnapshot()}function _x(e){e.clearMeasurements()}function tD(e){e.isLayoutDirty=!1}function nD(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Sx(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function rD(e){e.resolveTargetDelta()}function iD(e){e.calcProjection()}function aD(e){e.resetSkewAndRotation()}function oD(e){e.removeLeadSnapshot()}function Cx(e,t,n){e.translate=ut(t.translate,0,n),e.scale=ut(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function kx(e,t,n,r){e.min=ut(t.min,n.min,r),e.max=ut(t.max,n.max,r)}function sD(e,t,n,r){kx(e.x,t.x,n.x,r),kx(e.y,t.y,n.y,r)}function lD(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const uD={duration:.45,ease:[.4,0,.1,1]},Ax=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Rx=Ax("applewebkit/")&&!Ax("chrome/")?Math.round:qt;function Nx(e){e.min=Rx(e.min),e.max=Rx(e.max)}function cD(e){Nx(e.x),Nx(e.y)}function Px(e,t,n){return e==="position"||e==="preserve-aspect"&&!d5(vx(t),vx(n),.2)}function dD(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const fD=Tx({attachResizeListener:(e,t)=>ni(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),lm={current:void 0},Ix=Tx({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!lm.current){const e=new fD({});e.mount(window),e.setOptions({layoutScroll:!0}),lm.current=e}return lm.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),pD={pan:{Feature:k5},drag:{Feature:C5,ProjectionNode:Ix,MeasureLayout:rx}};function Ox(e,t){const n=t?"pointerenter":"pointerleave",r=t?"onHoverStart":"onHoverEnd",i=(a,o)=>{if(a.pointerType==="touch"||Ib())return;const s=e.getProps();e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",t);const l=s[r];l&&Xe.postRender(()=>l(a,o))};return ri(e.current,n,i,{passive:!e.getProps()[r]})}class hD extends Di{mount(){this.unmount=ti(Ox(this.node,!0),Ox(this.node,!1))}unmount(){}}class mD extends Di{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ti(ni(this.node.current,"focus",()=>this.onFocus()),ni(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Dx=(e,t)=>t?e===t?!0:Dx(e,t.parentElement):!1;function um(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Ic(n))}class gD extends Di{constructor(){super(...arguments),this.removeStartListeners=qt,this.removeEndListeners=qt,this.removeAccessibleListeners=qt,this.startPointerPress=(t,n)=>{if(this.isPressing)return;this.removeEndListeners();const r=this.node.getProps(),a=ri(window,"pointerup",(s,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c,globalTapTarget:d}=this.node.getProps(),f=!d&&!Dx(this.node.current,s.target)?c:u;f&&Xe.update(()=>f(s,l))},{passive:!(r.onTap||r.onPointerUp)}),o=ri(window,"pointercancel",(s,l)=>this.cancelPress(s,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=ti(a,o),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=a=>{if(a.key!=="Enter"||this.isPressing)return;const o=s=>{s.key!=="Enter"||!this.checkPressEnd()||um("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&Xe.postRender(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=ni(this.node.current,"keyup",o),um("down",(s,l)=>{this.startPress(s,l)})},n=ni(this.node.current,"keydown",t),r=()=>{this.isPressing&&um("cancel",(a,o)=>this.cancelPress(a,o))},i=ni(this.node.current,"blur",r);this.removeAccessibleListeners=ti(n,i)}}startPress(t,n){this.isPressing=!0;const{onTapStart:r,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&Xe.postRender(()=>r(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Ib()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&Xe.postRender(()=>r(t,n))}mount(){const t=this.node.getProps(),n=ri(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=ni(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=ti(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const cm=new WeakMap,dm=new WeakMap,wD=e=>{const t=cm.get(e.target);t&&t(e)},yD=e=>{e.forEach(wD)};function vD({root:e,...t}){const n=e||document;dm.has(n)||dm.set(n,{});const r=dm.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(yD,{root:e,...t})),r[i]}function bD(e,t,n){const r=vD(t);return cm.set(e,n),r.observe(e),()=>{cm.delete(e),r.unobserve(e)}}const xD={some:0,all:1};class ED extends Di{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:a}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:xD[i]},s=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,a&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=u?c:d;f&&f(l)};return bD(this.node.current,o,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(TD(t,n))&&this.startObserver()}unmount(){}}function TD({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const _D={inView:{Feature:ED},tap:{Feature:gD},focus:{Feature:mD},hover:{Feature:hD}},SD={layout:{ProjectionNode:Ix,MeasureLayout:rx}},fm=y.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),jc=y.createContext({}),pm=typeof window<"u",Lx=pm?y.useLayoutEffect:y.useEffect,Mx=y.createContext({strict:!1});function CD(e,t,n,r,i){var a,o;const{visualElement:s}=y.useContext(jc),l=y.useContext(Mx),u=y.useContext(Lc),c=y.useContext(fm).reducedMotion,d=y.useRef();r=r||l.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:s,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:c}));const f=d.current,p=y.useContext(tx);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&kD(d.current,n,i,p),y.useInsertionEffect(()=>{f&&f.update(n,u)});const m=n[yb],g=y.useRef(!!m&&!(!((a=window.MotionHandoffIsComplete)===null||a===void 0)&&a.call(window,m))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,m)));return Lx(()=>{f&&(window.MotionIsMounted=!0,f.updateFeatures(),am.render(f.render),g.current&&f.animationState&&f.animationState.animateChanges())}),y.useEffect(()=>{f&&(!g.current&&f.animationState&&f.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{var x;(x=window.MotionHandoffMarkAsComplete)===null||x===void 0||x.call(window,m)}),g.current=!1))}),f}function kD(e,t,n,r){const{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:l,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Fx(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Ro(s),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function Fx(e){if(e)return e.options.allowProjection!==!1?e.projection:Fx(e.parent)}function AD(e,t,n){return y.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Ro(n)&&(n.current=r))},[t])}function Uc(e){return Zs(e.animate)||yh.some(t=>Js(e[t]))}function Bx(e){return!!(Uc(e)||e.variants)}function RD(e,t){if(Uc(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Js(n)?n:void 0,animate:Js(r)?r:void 0}}return e.inherit!==!1?t:{}}function ND(e){const{initial:t,animate:n}=RD(e,y.useContext(jc));return y.useMemo(()=>({initial:t,animate:n}),[jx(t),jx(n)])}function jx(e){return Array.isArray(e)?e.join(" "):e}const Ux={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Oo={};for(const e in Ux)Oo[e]={isEnabled:t=>Ux[e].some(n=>!!t[n])};function PD(e){for(const t in e)Oo[t]={...Oo[t],...e[t]}}const ID=Symbol.for("motionComponentSymbol");function OD({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&PD(e);function a(s,l){let u;const c={...y.useContext(fm),...s,layoutId:DD(s)},{isStatic:d}=c,f=ND(s),p=r(s,d);if(!d&&pm){LD();const m=MD(c);u=m.MeasureLayout,f.visualElement=CD(i,p,c,t,m.ProjectionNode)}return T.jsxs(jc.Provider,{value:f,children:[u&&f.visualElement?T.jsx(u,{visualElement:f.visualElement,...c}):null,n(i,s,AD(p,f.visualElement,l),p,d,f.visualElement)]})}const o=y.forwardRef(a);return o[ID]=i,o}function DD({layoutId:e}){const t=y.useContext(im).id;return t&&e!==void 0?t+"-"+e:e}function LD(e,t){y.useContext(Mx).strict}function MD(e){const{drag:t,layout:n}=Oo;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const FD=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function hm(e){return typeof e!="string"||e.includes("-")?!1:!!(FD.indexOf(e)>-1||/[A-Z]/u.test(e))}function zx(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const a in n)e.style.setProperty(a,n[a])}const Hx=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Vx(e,t,n,r){zx(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(Hx.has(i)?i:Pc(i),t.attrs[i])}function $x(e,{layout:t,layoutId:n}){return Ri.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Fc[e]||e==="opacity")}function mm(e,t,n){var r;const{style:i}=e,a={};for(const o in i)(Kt(i[o])||t.style&&Kt(t.style[o])||$x(o,e)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(a[o]=i[o]);return n&&i&&typeof i.willChange=="string"&&(n.applyWillChange=!1),a}function Wx(e,t,n){const r=mm(e,t,n);for(const i in e)if(Kt(e[i])||Kt(t[i])){const a=el.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[a]=e[i]}return r}function gm(e){const t=y.useRef(null);return t.current===null&&(t.current=e()),t.current}function BD(e){if(Ri.has(e))return"transform";if(db.has(e))return Pc(e)}function jD({applyWillChange:e=!1,scrapeMotionValuesFromProps:t,createRenderState:n,onMount:r},i,a,o,s){const l={latestValues:UD(i,a,o,s?!1:e,t),renderState:n()};return r&&(l.mount=u=>r(i,u,l)),l}const Yx=e=>(t,n)=>{const r=y.useContext(jc),i=y.useContext(Lc),a=()=>jD(e,t,r,i,n);return n?a():gm(a)};function qx(e,t,n){const r=Array.isArray(t)?t:[t];for(let i=0;i<r.length;i++){const a=gh(e,r[i]);if(a){const{transitionEnd:o,transition:s,...l}=a;n(l,o)}}}function UD(e,t,n,r,i){var a;const o={},s=new Set,l=r&&((a=e.style)===null||a===void 0?void 0:a.willChange)===void 0,u=i(e,{});for(const x in u)o[x]=Bc(u[x]);let{initial:c,animate:d}=e;const f=Uc(e),p=Bx(e);t&&p&&!f&&e.inherit!==!1&&(c===void 0&&(c=t.initial),d===void 0&&(d=t.animate));let m=n?n.initial===!1:!1;m=m||c===!1;const g=m?d:c;return g&&typeof g!="boolean"&&!Zs(g)&&qx(e,g,(x,w)=>{for(const v in x){let b=x[v];if(Array.isArray(b)){const E=m?b.length-1:0;b=b[E]}b!==null&&(o[v]=b)}for(const v in w)o[v]=w[v]}),l&&(d&&c!==!1&&!Zs(d)&&qx(e,d,x=>{for(const w in x){const v=BD(w);v&&s.add(v)}}),s.size&&(o.willChange=Array.from(s).join(","))),o}const wm=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Gx=()=>({...wm(),attrs:{}}),Kx=(e,t)=>t&&typeof e=="number"?t.transform(e):e,zD={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},HD=el.length;function VD(e,t,n){let r="",i=!0;for(let a=0;a<HD;a++){const o=el[a],s=e[o];if(s===void 0)continue;let l=!0;if(typeof s=="number"?l=s===(o.startsWith("scale")?1:0):l=parseFloat(s)===0,!l||n){const u=Kx(s,Oh[o]);if(!l){i=!1;const c=zD[o]||o;r+=`${c}(${u}) `}n&&(t[o]=u)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function ym(e,t,n){const{style:r,vars:i,transformOrigin:a}=e;let o=!1,s=!1;for(const l in t){const u=t[l];if(Ri.has(l)){o=!0;continue}else if(Nv(l)){i[l]=u;continue}else{const c=Kx(u,Oh[l]);l.startsWith("origin")?(s=!0,a[l]=c):r[l]=c}}if(t.transform||(o||n?r.transform=VD(t,e.transform,n):r.transform&&(r.transform="none")),s){const{originX:l="50%",originY:u="50%",originZ:c=0}=a;r.transformOrigin=`${l} ${u} ${c}`}}function Xx(e,t,n){return typeof e=="string"?e:we.transform(t+n*e)}function $D(e,t,n){const r=Xx(t,e.x,e.width),i=Xx(n,e.y,e.height);return`${r} ${i}`}const WD={offset:"stroke-dashoffset",array:"stroke-dasharray"},YD={offset:"strokeDashoffset",array:"strokeDasharray"};function qD(e,t,n=1,r=0,i=!0){e.pathLength=1;const a=i?WD:YD;e[a.offset]=we.transform(-r);const o=we.transform(t),s=we.transform(n);e[a.array]=`${o} ${s}`}function vm(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:a,pathLength:o,pathSpacing:s=1,pathOffset:l=0,...u},c,d){if(ym(e,u,d),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:p,dimensions:m}=e;f.transform&&(m&&(p.transform=f.transform),delete f.transform),m&&(i!==void 0||a!==void 0||p.transform)&&(p.transformOrigin=$D(m,i!==void 0?i:.5,a!==void 0?a:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&qD(f,o,s,l,!1)}const bm=e=>typeof e=="string"&&e.toLowerCase()==="svg",GD={useVisualState:Yx({scrapeMotionValuesFromProps:Wx,createRenderState:Gx,onMount:(e,t,{renderState:n,latestValues:r})=>{Xe.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),Xe.render(()=>{vm(n,r,bm(t.tagName),e.transformTemplate),Vx(t,n)})}})},KD={useVisualState:Yx({applyWillChange:!0,scrapeMotionValuesFromProps:mm,createRenderState:wm})};function Qx(e,t,n){for(const r in t)!Kt(t[r])&&!$x(r,n)&&(e[r]=t[r])}function XD({transformTemplate:e},t){return y.useMemo(()=>{const n=wm();return ym(n,t,e),Object.assign({},n.vars,n.style)},[t])}function QD(e,t){const n=e.style||{},r={};return Qx(r,n,e),Object.assign(r,XD(e,t)),r}function ZD(e,t){const n={},r=QD(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const JD=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function zc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||JD.has(e)}let Zx=e=>!zc(e);function eL(e){e&&(Zx=t=>t.startsWith("on")?!zc(t):e(t))}try{eL(require("@emotion/is-prop-valid").default)}catch{}function tL(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(Zx(i)||n===!0&&zc(i)||!t&&!zc(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function nL(e,t,n,r){const i=y.useMemo(()=>{const a=Gx();return vm(a,t,bm(r),e.transformTemplate),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};Qx(a,e.style,e),i.style={...a,...i.style}}return i}function rL(e=!1){return(n,r,i,{latestValues:a},o)=>{const l=(hm(n)?nL:ZD)(r,a,o,n),u=tL(r,typeof n=="string",e),c=n!==y.Fragment?{...u,...l,ref:i}:{},{children:d}=r,f=y.useMemo(()=>Kt(d)?d.get():d,[d]);return y.createElement(n,{...c,children:f})}}function iL(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...hm(r)?GD:KD,preloadedFeatures:e,useRender:rL(i),createVisualElement:t,Component:r};return OD(o)}}const xm={current:null},Jx={current:!1};function aL(){if(Jx.current=!0,!!pm)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>xm.current=e.matches;e.addListener(t),t()}else xm.current=!1}function oL(e,t,n){for(const r in t){const i=t[r],a=n[r];if(Kt(i))e.addValue(r,i);else if(Kt(a))e.addValue(r,sl(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,sl(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const eE=new WeakMap,sL=[...Fv,Gt,Oi],lL=e=>sL.find(Mv(e)),tE=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class uL{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:a,visualState:o},s={}){this.applyWillChange=!1,this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=kh,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=Ir.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,Xe.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=Uc(n),this.isVariantNode=Bx(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const p=d[f];l[f]!==void 0&&Kt(p)&&p.set(l[f],!1)}}mount(t){this.current=t,eE.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),Jx.current||aL(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:xm.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){eE.delete(this.current),this.projection&&this.projection.unmount(),Ni(this.notifyUpdate),Ni(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Ri.has(t),i=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&Xe.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),a=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),a(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Oo){const n=Oo[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Et()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<tE.length;r++){const i=tE[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,o=t[a];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=oL(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=sl(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(Av(i)||kv(i))?i=parseFloat(i):!lL(i)&&Oi.test(n)&&(i=Gv(t,n)),this.setBaseTarget(t,Kt(i)?i.get():i)),Kt(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const o=gh(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(i=o[t])}if(r&&i!==void 0)return i;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!Kt(a)?a:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Kh),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class nE extends uL{constructor(){super(...arguments),this.KeyframeResolver=Kv}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}}function cL(e){return window.getComputedStyle(e)}class dL extends nE{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=zx}readValueFromInstance(t,n){if(Ri.has(n)){const r=Dh(n);return r&&r.default||0}else{const r=cL(t),i=(Nv(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Zb(t,n)}build(t,n,r){ym(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return mm(t,n,r)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Kt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class fL extends nE{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Et}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ri.has(n)){const r=Dh(n);return r&&r.default||0}return n=Hx.has(n)?n:Pc(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Wx(t,n,r)}build(t,n,r){vm(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){Vx(t,n,r,i)}mount(t){this.isSVGTag=bm(t.tagName),super.mount(t)}}const pL=(e,t)=>hm(e)?new fL(t):new dL(t,{allowProjection:e!==y.Fragment}),hL=iL({...n5,..._D,...pD,...SD},pL),Ua=XO(hL);class mL extends y.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function gL({children:e,isPresent:t}){const n=y.useId(),r=y.useRef(null),i=y.useRef({width:0,height:0,top:0,left:0}),{nonce:a}=y.useContext(fm);return y.useInsertionEffect(()=>{const{width:o,height:s,top:l,left:u}=i.current;if(t||!r.current||!o||!s)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return a&&(c.nonce=a),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`
|
|
18
18
|
[data-motion-pop-id="${n}"] {
|
|
19
19
|
position: absolute !important;
|
|
20
20
|
width: ${o}px !important;
|
|
@@ -297,7 +297,7 @@ to {
|
|
|
297
297
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[kT]=this[kT]={accessors:{}}).accessors,i=this.prototype;function a(o){const s=vl(o);r[s]||(xF(i,o),r[s]=!0)}return H.isArray(t)?t.forEach(a):a(t),this}}wn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),H.reduceDescriptors(wn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),H.freezeMethods(wn);function Wm(e,t){const n=this||yl,r=t||n,i=wn.from(r.headers);let a=r.data;return H.forEach(e,function(s){a=s.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function AT(e){return!!(e&&e.__CANCEL__)}function Fo(e,t,n){Se.call(this,e??"canceled",Se.ERR_CANCELED,t,n),this.name="CanceledError"}H.inherits(Fo,Se,{__CANCEL__:!0});function RT(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Se("Request failed with status code "+n.status,[Se.ERR_BAD_REQUEST,Se.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function EF(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function TF(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,a=0,o;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),c=r[a];o||(o=u),n[i]=l,r[i]=u;let d=a,f=0;for(;d!==i;)f+=n[d++],d=d%e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),u-o<t)return;const p=c&&u-c;return p?Math.round(f*1e3/p):void 0}}function _F(e,t){let n=0,r=1e3/t,i,a;const o=(u,c=Date.now())=>{n=c,i=null,a&&(clearTimeout(a),a=null),e.apply(null,u)};return[(...u)=>{const c=Date.now(),d=c-n;d>=r?o(u,c):(i=u,a||(a=setTimeout(()=>{a=null,o(i)},r-d)))},()=>i&&o(i)]}const ad=(e,t,n=3)=>{let r=0;const i=TF(50,250);return _F(a=>{const o=a.loaded,s=a.lengthComputable?a.total:void 0,l=o-r,u=i(l),c=o<=s;r=o;const d={loaded:o,total:s,progress:s?o/s:void 0,bytes:l,rate:u||void 0,estimated:u&&s&&c?(s-o)/u:void 0,event:a,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(d)},n)},NT=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},PT=e=>(...t)=>H.asap(()=>e(...t)),SF=Xt.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Xt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Xt.origin),Xt.navigator&&/(msie|trident)/i.test(Xt.navigator.userAgent)):()=>!0,CF=Xt.hasStandardBrowserEnv?{write(e,t,n,r,i,a){const o=[e+"="+encodeURIComponent(t)];H.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),H.isString(r)&&o.push("path="+r),H.isString(i)&&o.push("domain="+i),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function kF(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function AF(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function IT(e,t){return e&&!kF(t)?AF(e,t):t}const OT=e=>e instanceof wn?{...e}:e;function Va(e,t){t=t||{};const n={};function r(u,c,d,f){return H.isPlainObject(u)&&H.isPlainObject(c)?H.merge.call({caseless:f},u,c):H.isPlainObject(c)?H.merge({},c):H.isArray(c)?c.slice():c}function i(u,c,d,f){if(H.isUndefined(c)){if(!H.isUndefined(u))return r(void 0,u,d,f)}else return r(u,c,d,f)}function a(u,c){if(!H.isUndefined(c))return r(void 0,c)}function o(u,c){if(H.isUndefined(c)){if(!H.isUndefined(u))return r(void 0,u)}else return r(void 0,c)}function s(u,c,d){if(d in t)return r(u,c);if(d in e)return r(void 0,u)}const l={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(u,c,d)=>i(OT(u),OT(c),d,!0)};return H.forEach(Object.keys(Object.assign({},e,t)),function(c){const d=l[c]||i,f=d(e[c],t[c],c);H.isUndefined(f)&&d!==s||(n[c]=f)}),n}const DT=e=>{const t=Va({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:s}=t;t.headers=o=wn.from(o),t.url=TT(IT(t.baseURL,t.url),e.params,e.paramsSerializer),s&&o.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let l;if(H.isFormData(n)){if(Xt.hasStandardBrowserEnv||Xt.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[u,...c]=l?l.split(";").map(d=>d.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...c].join("; "))}}if(Xt.hasStandardBrowserEnv&&(r&&H.isFunction(r)&&(r=r(t)),r||r!==!1&&SF(t.url))){const u=i&&a&&CF.read(a);u&&o.set(i,u)}return t},RF=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const i=DT(e);let a=i.data;const o=wn.from(i.headers).normalize();let{responseType:s,onUploadProgress:l,onDownloadProgress:u}=i,c,d,f,p,m;function g(){p&&p(),m&&m(),i.cancelToken&&i.cancelToken.unsubscribe(c),i.signal&&i.signal.removeEventListener("abort",c)}let x=new XMLHttpRequest;x.open(i.method.toUpperCase(),i.url,!0),x.timeout=i.timeout;function w(){if(!x)return;const b=wn.from("getAllResponseHeaders"in x&&x.getAllResponseHeaders()),_={data:!s||s==="text"||s==="json"?x.responseText:x.response,status:x.status,statusText:x.statusText,headers:b,config:e,request:x};RT(function(I){n(I),g()},function(I){r(I),g()},_),x=null}"onloadend"in x?x.onloadend=w:x.onreadystatechange=function(){!x||x.readyState!==4||x.status===0&&!(x.responseURL&&x.responseURL.indexOf("file:")===0)||setTimeout(w)},x.onabort=function(){x&&(r(new Se("Request aborted",Se.ECONNABORTED,e,x)),x=null)},x.onerror=function(){r(new Se("Network Error",Se.ERR_NETWORK,e,x)),x=null},x.ontimeout=function(){let E=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const _=i.transitional||ST;i.timeoutErrorMessage&&(E=i.timeoutErrorMessage),r(new Se(E,_.clarifyTimeoutError?Se.ETIMEDOUT:Se.ECONNABORTED,e,x)),x=null},a===void 0&&o.setContentType(null),"setRequestHeader"in x&&H.forEach(o.toJSON(),function(E,_){x.setRequestHeader(_,E)}),H.isUndefined(i.withCredentials)||(x.withCredentials=!!i.withCredentials),s&&s!=="json"&&(x.responseType=i.responseType),u&&([f,m]=ad(u,!0),x.addEventListener("progress",f)),l&&x.upload&&([d,p]=ad(l),x.upload.addEventListener("progress",d),x.upload.addEventListener("loadend",p)),(i.cancelToken||i.signal)&&(c=b=>{x&&(r(!b||b.type?new Fo(null,e,x):b),x.abort(),x=null)},i.cancelToken&&i.cancelToken.subscribe(c),i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c)));const v=EF(i.url);if(v&&Xt.protocols.indexOf(v)===-1){r(new Se("Unsupported protocol "+v+":",Se.ERR_BAD_REQUEST,e));return}x.send(a||null)})},NF=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const a=function(u){if(!i){i=!0,s();const c=u instanceof Error?u:this.reason;r.abort(c instanceof Se?c:new Fo(c instanceof Error?c.message:c))}};let o=t&&setTimeout(()=>{o=null,a(new Se(`timeout ${t} of ms exceeded`,Se.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(a):u.removeEventListener("abort",a)}),e=null)};e.forEach(u=>u.addEventListener("abort",a));const{signal:l}=r;return l.unsubscribe=()=>H.asap(s),l}},PF=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},IF=async function*(e,t){for await(const n of OF(e))yield*PF(n,t)},OF=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},LT=(e,t,n,r)=>{const i=IF(e,t);let a=0,o,s=l=>{o||(o=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:u,value:c}=await i.next();if(u){s(),l.close();return}let d=c.byteLength;if(n){let f=a+=d;n(f)}l.enqueue(new Uint8Array(c))}catch(u){throw s(u),u}},cancel(l){return s(l),i.return()}},{highWaterMark:2})},od=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",MT=od&&typeof ReadableStream=="function",DF=od&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),FT=(e,...t)=>{try{return!!e(...t)}catch{return!1}},LF=MT&&FT(()=>{let e=!1;const t=new Request(Xt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),BT=64*1024,Ym=MT&&FT(()=>H.isReadableStream(new Response("").body)),sd={stream:Ym&&(e=>e.body)};od&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!sd[t]&&(sd[t]=H.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new Se(`Response type '${t}' is not supported`,Se.ERR_NOT_SUPPORT,r)})})})(new Response);const MF=async e=>{if(e==null)return 0;if(H.isBlob(e))return e.size;if(H.isSpecCompliantForm(e))return(await new Request(Xt.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(H.isArrayBufferView(e)||H.isArrayBuffer(e))return e.byteLength;if(H.isURLSearchParams(e)&&(e=e+""),H.isString(e))return(await DF(e)).byteLength},FF=async(e,t)=>{const n=H.toFiniteNumber(e.getContentLength());return n??MF(t)},qm={http:iF,xhr:RF,fetch:od&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:a,timeout:o,onDownloadProgress:s,onUploadProgress:l,responseType:u,headers:c,withCredentials:d="same-origin",fetchOptions:f}=DT(e);u=u?(u+"").toLowerCase():"text";let p=NF([i,a&&a.toAbortSignal()],o),m;const g=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let x;try{if(l&&LF&&n!=="get"&&n!=="head"&&(x=await FF(c,r))!==0){let _=new Request(t,{method:"POST",body:r,duplex:"half"}),S;if(H.isFormData(r)&&(S=_.headers.get("content-type"))&&c.setContentType(S),_.body){const[I,D]=NT(x,ad(PT(l)));r=LT(_.body,BT,I,D)}}H.isString(d)||(d=d?"include":"omit");const w="credentials"in Request.prototype;m=new Request(t,{...f,signal:p,method:n.toUpperCase(),headers:c.normalize().toJSON(),body:r,duplex:"half",credentials:w?d:void 0});let v=await fetch(m);const b=Ym&&(u==="stream"||u==="response");if(Ym&&(s||b&&g)){const _={};["status","statusText","headers"].forEach(V=>{_[V]=v[V]});const S=H.toFiniteNumber(v.headers.get("content-length")),[I,D]=s&&NT(S,ad(PT(s),!0))||[];v=new Response(LT(v.body,BT,I,()=>{D&&D(),g&&g()}),_)}u=u||"text";let E=await sd[H.findKey(sd,u)||"text"](v,e);return!b&&g&&g(),await new Promise((_,S)=>{RT(_,S,{data:E,headers:wn.from(v.headers),status:v.status,statusText:v.statusText,config:e,request:m})})}catch(w){throw g&&g(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new Se("Network Error",Se.ERR_NETWORK,e,m),{cause:w.cause||w}):Se.from(w,w&&w.code,e,m)}})};H.forEach(qm,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const jT=e=>`- ${e}`,BF=e=>H.isFunction(e)||e===null||e===!1,UT={getAdapter:e=>{e=H.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let a=0;a<t;a++){n=e[a];let o;if(r=n,!BF(n)&&(r=qm[(o=String(n)).toLowerCase()],r===void 0))throw new Se(`Unknown adapter '${o}'`);if(r)break;i[o||"#"+a]=r}if(!r){const a=Object.entries(i).map(([s,l])=>`adapter ${s} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=t?a.length>1?`since :
|
|
298
298
|
`+a.map(jT).join(`
|
|
299
299
|
`):" "+jT(a[0]):"as no adapter specified";throw new Se("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:qm};function Gm(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Fo(null,e)}function zT(e){return Gm(e),e.headers=wn.from(e.headers),e.data=Wm.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),UT.getAdapter(e.adapter||yl.adapter)(e).then(function(r){return Gm(e),r.data=Wm.call(e,e.transformResponse,r),r.headers=wn.from(r.headers),r},function(r){return AT(r)||(Gm(e),r&&r.response&&(r.response.data=Wm.call(e,e.transformResponse,r.response),r.response.headers=wn.from(r.response.headers))),Promise.reject(r)})}const HT="1.7.9",ld={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ld[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const VT={};ld.transitional=function(t,n,r){function i(a,o){return"[Axios v"+HT+"] Transitional option '"+a+"'"+o+(r?". "+r:"")}return(a,o,s)=>{if(t===!1)throw new Se(i(o," has been removed"+(n?" in "+n:"")),Se.ERR_DEPRECATED);return n&&!VT[o]&&(VT[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(a,o,s):!0}},ld.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function jF(e,t,n){if(typeof e!="object")throw new Se("options must be an object",Se.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const a=r[i],o=t[a];if(o){const s=e[a],l=s===void 0||o(s,a,e);if(l!==!0)throw new Se("option "+a+" must be "+l,Se.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Se("Unknown option "+a,Se.ERR_BAD_OPTION)}}const ud={assertOptions:jF,validators:ld},Dr=ud.validators;class $a{constructor(t){this.defaults=t,this.interceptors={request:new _T,response:new _T}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const a=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?a&&!String(r.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
300
|
-
`+a):r.stack=a}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Va(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:a}=n;r!==void 0&&ud.assertOptions(r,{silentJSONParsing:Dr.transitional(Dr.boolean),forcedJSONParsing:Dr.transitional(Dr.boolean),clarifyTimeoutError:Dr.transitional(Dr.boolean)},!1),i!=null&&(H.isFunction(i)?n.paramsSerializer={serialize:i}:ud.assertOptions(i,{encode:Dr.function,serialize:Dr.function},!0)),ud.assertOptions(n,{baseUrl:Dr.spelling("baseURL"),withXsrfToken:Dr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=a&&H.merge(a.common,a[n.method]);a&&H.forEach(["delete","get","head","post","put","patch","common"],m=>{delete a[m]}),n.headers=wn.concat(o,a);const s=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(l=l&&g.synchronous,s.unshift(g.fulfilled,g.rejected))});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let c,d=0,f;if(!l){const m=[zT.bind(this),void 0];for(m.unshift.apply(m,s),m.push.apply(m,u),f=m.length,c=Promise.resolve(n);d<f;)c=c.then(m[d++],m[d++]);return c}f=s.length;let p=n;for(d=0;d<f;){const m=s[d++],g=s[d++];try{p=m(p)}catch(x){g.call(this,x);break}}try{c=zT.call(this,p)}catch(m){return Promise.reject(m)}for(d=0,f=u.length;d<f;)c=c.then(u[d++],u[d++]);return c}getUri(t){t=Va(this.defaults,t);const n=IT(t.baseURL,t.url);return TT(n,t.params,t.paramsSerializer)}}H.forEach(["delete","get","head","options"],function(t){$a.prototype[t]=function(n,r){return this.request(Va(r||{},{method:t,url:n,data:(r||{}).data}))}}),H.forEach(["post","put","patch"],function(t){function n(r){return function(a,o,s){return this.request(Va(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:o}))}}$a.prototype[t]=n(),$a.prototype[t+"Form"]=n(!0)});class Km{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(i=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](i);r._listeners=null}),this.promise.then=i=>{let a;const o=new Promise(s=>{r.subscribe(s),a=s}).then(i);return o.cancel=function(){r.unsubscribe(a)},o},t(function(a,o,s){r.reason||(r.reason=new Fo(a,o,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Km(function(i){t=i}),cancel:t}}}function UF(e){return function(n){return e.apply(null,n)}}function zF(e){return H.isObject(e)&&e.isAxiosError===!0}const Xm={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Xm).forEach(([e,t])=>{Xm[t]=e});function $T(e){const t=new $a(e),n=sT($a.prototype.request,t);return H.extend(n,$a.prototype,t,{allOwnKeys:!0}),H.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return $T(Va(e,i))},n}const Ct=$T(yl);Ct.Axios=$a,Ct.CanceledError=Fo,Ct.CancelToken=Km,Ct.isCancel=AT,Ct.VERSION=HT,Ct.toFormData=rd,Ct.AxiosError=Se,Ct.Cancel=Ct.CanceledError,Ct.all=function(t){return Promise.all(t)},Ct.spread=UF,Ct.isAxiosError=zF,Ct.mergeConfig=Va,Ct.AxiosHeaders=wn,Ct.formToJSON=e=>CT(H.isHTMLForm(e)?new FormData(e):e),Ct.getAdapter=UT.getAdapter,Ct.HttpStatusCode=Xm,Ct.default=Ct;const HF=/\{[^{}]+\}/g,VF=()=>{var e,t;return typeof process=="object"&&Number.parseInt((t=(e=process==null?void 0:process.versions)==null?void 0:e.node)==null?void 0:t.substring(0,2))>=18&&process.versions.undici};function $F(){return Math.random().toString(36).slice(2,11)}function WF(e){let{baseUrl:t="",Request:n=globalThis.Request,fetch:r=globalThis.fetch,querySerializer:i,bodySerializer:a,headers:o,requestInitExt:s=void 0,...l}={...e};s=VF()?s:void 0,t=GT(t);const u=[];async function c(d,f){const{baseUrl:p,fetch:m=r,Request:g=n,headers:x,params:w={},parseAs:v="json",querySerializer:b,bodySerializer:E=a??qF,body:_,...S}=f||{};p&&(t=GT(p));let I=typeof i=="function"?i:qT(i);b&&(I=typeof b=="function"?b:qT({...typeof i=="object"?i:{},...b}));const D=_===void 0?void 0:E(_),V=D===void 0||D instanceof FormData?{}:{"Content-Type":"application/json"},N={redirect:"follow",...l,...S,body:D,headers:KF(V,o,x,w.header)};let $,z,X=new n(GF(d,{baseUrl:t,params:w,querySerializer:I}),N);for(const re in S)re in X||(X[re]=S[re]);if(u.length){$=$F(),z=Object.freeze({baseUrl:t,fetch:m,parseAs:v,querySerializer:I,bodySerializer:E});for(const re of u)if(re&&typeof re=="object"&&typeof re.onRequest=="function"){const ee=await re.onRequest({request:X,schemaPath:d,params:w,options:z,id:$});if(ee){if(!(ee instanceof n))throw new Error("onRequest: must return new Request() when modifying the request");X=ee}}}let Y;try{Y=await m(X,s)}catch(re){let ee=re;if(u.length)for(let F=u.length-1;F>=0;F--){const B=u[F];if(B&&typeof B=="object"&&typeof B.onError=="function"){const k=await B.onError({request:X,error:ee,schemaPath:d,params:w,options:z,id:$});if(k){if(k instanceof Response){ee=void 0,Y=k;break}if(k instanceof Error){ee=k;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(ee)throw ee}if(u.length)for(let re=u.length-1;re>=0;re--){const ee=u[re];if(ee&&typeof ee=="object"&&typeof ee.onResponse=="function"){const F=await ee.onResponse({request:X,response:Y,schemaPath:d,params:w,options:z,id:$});if(F){if(!(F instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");Y=F}}}if(Y.status===204||Y.headers.get("Content-Length")==="0")return Y.ok?{data:void 0,response:Y}:{error:void 0,response:Y};if(Y.ok)return v==="stream"?{data:Y.body,response:Y}:{data:await Y[v](),response:Y};let ne=await Y.text();try{ne=JSON.parse(ne)}catch{}return{error:ne,response:Y}}return{request(d,f,p){return c(f,{...p,method:d.toUpperCase()})},GET(d,f){return c(d,{...f,method:"GET"})},PUT(d,f){return c(d,{...f,method:"PUT"})},POST(d,f){return c(d,{...f,method:"POST"})},DELETE(d,f){return c(d,{...f,method:"DELETE"})},OPTIONS(d,f){return c(d,{...f,method:"OPTIONS"})},HEAD(d,f){return c(d,{...f,method:"HEAD"})},PATCH(d,f){return c(d,{...f,method:"PATCH"})},TRACE(d,f){return c(d,{...f,method:"TRACE"})},use(...d){for(const f of d)if(f){if(typeof f!="object"||!("onRequest"in f||"onResponse"in f||"onError"in f))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");u.push(f)}},eject(...d){for(const f of d){const p=u.indexOf(f);p!==-1&&u.splice(p,1)}}}}function cd(e,t,n){if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${(n==null?void 0:n.allowReserved)===!0?t:encodeURIComponent(t)}`}function WT(e,t,n){if(!t||typeof t!="object")return"";const r=[],i={simple:",",label:".",matrix:";"}[n.style]||"&";if(n.style!=="deepObject"&&n.explode===!1){for(const s in t)r.push(s,n.allowReserved===!0?t[s]:encodeURIComponent(t[s]));const o=r.join(",");switch(n.style){case"form":return`${e}=${o}`;case"label":return`.${o}`;case"matrix":return`;${e}=${o}`;default:return o}}for(const o in t){const s=n.style==="deepObject"?`${e}[${o}]`:o;r.push(cd(s,t[o],n))}const a=r.join(i);return n.style==="label"||n.style==="matrix"?`${i}${a}`:a}function YT(e,t,n){if(!Array.isArray(t))return"";if(n.explode===!1){const a={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[n.style]||",",o=(n.allowReserved===!0?t:t.map(s=>encodeURIComponent(s))).join(a);switch(n.style){case"simple":return o;case"label":return`.${o}`;case"matrix":return`;${e}=${o}`;default:return`${e}=${o}`}}const r={simple:",",label:".",matrix:";"}[n.style]||"&",i=[];for(const a of t)n.style==="simple"||n.style==="label"?i.push(n.allowReserved===!0?a:encodeURIComponent(a)):i.push(cd(e,a,n));return n.style==="label"||n.style==="matrix"?`${r}${i.join(r)}`:i.join(r)}function qT(e){return function(n){const r=[];if(n&&typeof n=="object")for(const i in n){const a=n[i];if(a!=null){if(Array.isArray(a)){if(a.length===0)continue;r.push(YT(i,a,{style:"form",explode:!0,...e==null?void 0:e.array,allowReserved:(e==null?void 0:e.allowReserved)||!1}));continue}if(typeof a=="object"){r.push(WT(i,a,{style:"deepObject",explode:!0,...e==null?void 0:e.object,allowReserved:(e==null?void 0:e.allowReserved)||!1}));continue}r.push(cd(i,a,e))}}return r.join("&")}}function YF(e,t){let n=e;for(const r of e.match(HF)??[]){let i=r.substring(1,r.length-1),a=!1,o="simple";if(i.endsWith("*")&&(a=!0,i=i.substring(0,i.length-1)),i.startsWith(".")?(o="label",i=i.substring(1)):i.startsWith(";")&&(o="matrix",i=i.substring(1)),!t||t[i]===void 0||t[i]===null)continue;const s=t[i];if(Array.isArray(s)){n=n.replace(r,YT(i,s,{style:o,explode:a}));continue}if(typeof s=="object"){n=n.replace(r,WT(i,s,{style:o,explode:a}));continue}if(o==="matrix"){n=n.replace(r,`;${cd(i,s)}`);continue}n=n.replace(r,o==="label"?`.${encodeURIComponent(s)}`:encodeURIComponent(s))}return n}function qF(e){return e instanceof FormData?e:JSON.stringify(e)}function GF(e,t){var i;let n=`${t.baseUrl}${e}`;(i=t.params)!=null&&i.path&&(n=YF(n,t.params.path));let r=t.querySerializer(t.params.query??{});return r.startsWith("?")&&(r=r.substring(1)),r&&(n+=`?${r}`),n}function KF(...e){const t=new Headers;for(const n of e){if(!n||typeof n!="object")continue;const r=n instanceof Headers?n.entries():Object.entries(n);for(const[i,a]of r)if(a===null)t.delete(i);else if(Array.isArray(a))for(const o of a)t.append(i,o);else a!==void 0&&t.set(i,a)}return t}function GT(e){return e.endsWith("/")?e.substring(0,e.length-1):e}const XF=e=>{console.log(e.error)},QF=e=>{const t=WF({baseUrl:e.baseUrl}),n={onRequest:e.onRequest,onResponse:e.onResponse,onError:e.onError||XF};return t.use(n),t};class ZF{constructor({config:t}){ce(this,"client");ce(this,"uploadFileClient");ce(this,"config");ce(this,"constructClientOptions",t=>{const n=this.config.apiUrl||"https://api.open.cx",r={"X-Bot-Token":this.config.token,"Content-Type":"application/json",Accept:"application/json",Authorization:t?`Bearer ${t}`:void 0};return{baseUrl:n,headers:r}});ce(this,"createOpenAPIClient",({baseUrl:t,headers:n})=>QF({baseUrl:t,onRequest:({request:r})=>{Object.entries(n).forEach(([i,a])=>{a&&r.headers.set(i,a)})}}));ce(this,"createAxiosUploadClient",({baseUrl:t,headers:n})=>Ct.create({baseURL:`${t}/backend/widget/v2/upload`,headers:n}));ce(this,"setAuthToken",t=>{const{baseUrl:n,headers:r}=this.constructClientOptions(t);this.client=this.createOpenAPIClient({baseUrl:n,headers:r}),this.uploadFileClient=this.createAxiosUploadClient({baseUrl:n,headers:r})});ce(this,"widgetPrelude",async()=>await this.client.GET("/backend/widget/v2/prelude",{params:{header:{"X-Bot-Token":this.config.token}}}));ce(this,"sendMessage",async(t,n)=>await this.client.POST("/backend/widget/v2/chat/send",{body:t,signal:n}));ce(this,"getSessionHistory",async({sessionId:t,lastMessageTimestamp:n,abortSignal:r})=>{const i=n?{lastMessageTimestamp:n}:void 0;return await this.client.GET("/backend/widget/v2/session/history/{sessionId}",{params:{path:{sessionId:t},query:i},signal:r})});ce(this,"createUnverifiedContact",async t=>await this.client.POST("/backend/widget/v2/contact/create-unverified",{params:{header:{"x-bot-token":this.config.token}},body:t}));ce(this,"createSession",async()=>await this.client.POST("/backend/widget/v2/create-session"));ce(this,"getSession",async({sessionId:t,abortSignal:n})=>await this.client.GET("/backend/widget/v2/session/{sessionId}",{params:{path:{sessionId:t}},signal:n}));ce(this,"uploadFile",async(t,n={})=>{const r=new FormData;r.append("file",t.file);const{data:i}=await this.uploadFileClient.post("",r,{headers:{"Content-Type":"multipart/form-data"},...n});return i});ce(this,"vote",async t=>await this.client.POST("/backend/widget/v2/chat/vote",{body:t}));this.config=t;const{baseUrl:n,headers:r}=this.constructClientOptions(t.contactToken);this.client=this.createOpenAPIClient({baseUrl:n,headers:r}),this.uploadFileClient=this.createAxiosUploadClient({baseUrl:n,headers:r})}}var dd={exports:{}};dd.exports,function(e,t){var n=200,r="__lodash_hash_undefined__",i=1,a=2,o=9007199254740991,s="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",d="[object Date]",f="[object Error]",p="[object Function]",m="[object GeneratorFunction]",g="[object Map]",x="[object Number]",w="[object Null]",v="[object Object]",b="[object Promise]",E="[object Proxy]",_="[object RegExp]",S="[object Set]",I="[object String]",D="[object Symbol]",V="[object Undefined]",N="[object WeakMap]",$="[object ArrayBuffer]",z="[object DataView]",X="[object Float32Array]",Y="[object Float64Array]",ne="[object Int8Array]",re="[object Int16Array]",ee="[object Int32Array]",F="[object Uint8Array]",B="[object Uint8ClampedArray]",k="[object Uint16Array]",ie="[object Uint32Array]",he=/[\\^$.*+?()[\]{}|]/g,O=/^\[object .+?Constructor\]$/,Pe=/^(?:0|[1-9]\d*)$/,ge={};ge[X]=ge[Y]=ge[ne]=ge[re]=ge[ee]=ge[F]=ge[B]=ge[k]=ge[ie]=!0,ge[s]=ge[l]=ge[$]=ge[c]=ge[z]=ge[d]=ge[f]=ge[p]=ge[g]=ge[x]=ge[v]=ge[_]=ge[S]=ge[I]=ge[N]=!1;var ve=typeof wt=="object"&&wt&&wt.Object===Object&&wt,$e=typeof self=="object"&&self&&self.Object===Object&&self,Ve=ve||$e||Function("return this")(),We=t&&!t.nodeType&&t,Ge=We&&!0&&e&&!e.nodeType&&e,St=Ge&&Ge.exports===We,Te=St&&ve.process,xe=function(){try{return Te&&Te.binding&&Te.binding("util")}catch{}}(),Ye=xe&&xe.isTypedArray;function ze(A,L){for(var W=-1,le=A==null?0:A.length,it=0,Re=[];++W<le;){var xt=A[W];L(xt,W,A)&&(Re[it++]=xt)}return Re}function vt(A,L){for(var W=-1,le=L.length,it=A.length;++W<le;)A[it+W]=L[W];return A}function bt(A,L){for(var W=-1,le=A==null?0:A.length;++W<le;)if(L(A[W],W,A))return!0;return!1}function Ke(A,L){for(var W=-1,le=Array(A);++W<A;)le[W]=L(W);return le}function Le(A){return function(L){return A(L)}}function It(A,L){return A.has(L)}function Aa(A,L){return A==null?void 0:A[L]}function Ra(A){var L=-1,W=Array(A.size);return A.forEach(function(le,it){W[++L]=[it,le]}),W}function Na(A,L){return function(W){return A(L(W))}}function te(A){var L=-1,W=Array(A.size);return A.forEach(function(le){W[++L]=le}),W}var de=Array.prototype,j=Function.prototype,q=Object.prototype,ue=Ve["__core-js_shared__"],_e=j.toString,Ee=q.hasOwnProperty,Bt=function(){var A=/[^.]+$/.exec(ue&&ue.keys&&ue.keys.IE_PROTO||"");return A?"Symbol(src)_1."+A:""}(),Nn=q.toString,pn=RegExp("^"+_e.call(Ee).replace(he,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Yn=St?Ve.Buffer:void 0,Pn=Ve.Symbol,Rt=Ve.Uint8Array,qn=q.propertyIsEnumerable,hn=de.splice,Ci=Pn?Pn.toStringTag:void 0,zI=Object.getOwnPropertySymbols,gre=Yn?Yn.isBuffer:void 0,wre=Na(Object.keys,Object),jy=Ks(Ve,"DataView"),dc=Ks(Ve,"Map"),Uy=Ks(Ve,"Promise"),zy=Ks(Ve,"Set"),Hy=Ks(Ve,"WeakMap"),fc=Ks(Object,"create"),yre=xo(jy),vre=xo(dc),bre=xo(Uy),xre=xo(zy),Ere=xo(Hy),HI=Pn?Pn.prototype:void 0,Vy=HI?HI.valueOf:void 0;function vo(A){var L=-1,W=A==null?0:A.length;for(this.clear();++L<W;){var le=A[L];this.set(le[0],le[1])}}function Tre(){this.__data__=fc?fc(null):{},this.size=0}function _re(A){var L=this.has(A)&&delete this.__data__[A];return this.size-=L?1:0,L}function Sre(A){var L=this.__data__;if(fc){var W=L[A];return W===r?void 0:W}return Ee.call(L,A)?L[A]:void 0}function Cre(A){var L=this.__data__;return fc?L[A]!==void 0:Ee.call(L,A)}function kre(A,L){var W=this.__data__;return this.size+=this.has(A)?0:1,W[A]=fc&&L===void 0?r:L,this}vo.prototype.clear=Tre,vo.prototype.delete=_re,vo.prototype.get=Sre,vo.prototype.has=Cre,vo.prototype.set=kre;function ki(A){var L=-1,W=A==null?0:A.length;for(this.clear();++L<W;){var le=A[L];this.set(le[0],le[1])}}function Are(){this.__data__=[],this.size=0}function Rre(A){var L=this.__data__,W=rh(L,A);if(W<0)return!1;var le=L.length-1;return W==le?L.pop():hn.call(L,W,1),--this.size,!0}function Nre(A){var L=this.__data__,W=rh(L,A);return W<0?void 0:L[W][1]}function Pre(A){return rh(this.__data__,A)>-1}function Ire(A,L){var W=this.__data__,le=rh(W,A);return le<0?(++this.size,W.push([A,L])):W[le][1]=L,this}ki.prototype.clear=Are,ki.prototype.delete=Rre,ki.prototype.get=Nre,ki.prototype.has=Pre,ki.prototype.set=Ire;function bo(A){var L=-1,W=A==null?0:A.length;for(this.clear();++L<W;){var le=A[L];this.set(le[0],le[1])}}function Ore(){this.size=0,this.__data__={hash:new vo,map:new(dc||ki),string:new vo}}function Dre(A){var L=ih(this,A).delete(A);return this.size-=L?1:0,L}function Lre(A){return ih(this,A).get(A)}function Mre(A){return ih(this,A).has(A)}function Fre(A,L){var W=ih(this,A),le=W.size;return W.set(A,L),this.size+=W.size==le?0:1,this}bo.prototype.clear=Ore,bo.prototype.delete=Dre,bo.prototype.get=Lre,bo.prototype.has=Mre,bo.prototype.set=Fre;function nh(A){var L=-1,W=A==null?0:A.length;for(this.__data__=new bo;++L<W;)this.add(A[L])}function Bre(A){return this.__data__.set(A,r),this}function jre(A){return this.__data__.has(A)}nh.prototype.add=nh.prototype.push=Bre,nh.prototype.has=jre;function Pa(A){var L=this.__data__=new ki(A);this.size=L.size}function Ure(){this.__data__=new ki,this.size=0}function zre(A){var L=this.__data__,W=L.delete(A);return this.size=L.size,W}function Hre(A){return this.__data__.get(A)}function Vre(A){return this.__data__.has(A)}function $re(A,L){var W=this.__data__;if(W instanceof ki){var le=W.__data__;if(!dc||le.length<n-1)return le.push([A,L]),this.size=++W.size,this;W=this.__data__=new bo(le)}return W.set(A,L),this.size=W.size,this}Pa.prototype.clear=Ure,Pa.prototype.delete=zre,Pa.prototype.get=Hre,Pa.prototype.has=Vre,Pa.prototype.set=$re;function Wre(A,L){var W=ah(A),le=!W&&oie(A),it=!W&&!le&&$y(A),Re=!W&&!le&&!it&&QI(A),xt=W||le||it||Re,jt=xt?Ke(A.length,String):[],Yt=jt.length;for(var mt in A)Ee.call(A,mt)&&!(xt&&(mt=="length"||it&&(mt=="offset"||mt=="parent")||Re&&(mt=="buffer"||mt=="byteLength"||mt=="byteOffset")||tie(mt,Yt)))&&jt.push(mt);return jt}function rh(A,L){for(var W=A.length;W--;)if(qI(A[W][0],L))return W;return-1}function Yre(A,L,W){var le=L(A);return ah(A)?le:vt(le,W(A))}function pc(A){return A==null?A===void 0?V:w:Ci&&Ci in Object(A)?Jre(A):aie(A)}function VI(A){return hc(A)&&pc(A)==s}function $I(A,L,W,le,it){return A===L?!0:A==null||L==null||!hc(A)&&!hc(L)?A!==A&&L!==L:qre(A,L,W,le,$I,it)}function qre(A,L,W,le,it,Re){var xt=ah(A),jt=ah(L),Yt=xt?l:Ia(A),mt=jt?l:Ia(L);Yt=Yt==s?v:Yt,mt=mt==s?v:mt;var Gn=Yt==v,Nr=mt==v,on=Yt==mt;if(on&&$y(A)){if(!$y(L))return!1;xt=!0,Gn=!1}if(on&&!Gn)return Re||(Re=new Pa),xt||QI(A)?WI(A,L,W,le,it,Re):Qre(A,L,Yt,W,le,it,Re);if(!(W&i)){var cr=Gn&&Ee.call(A,"__wrapped__"),dr=Nr&&Ee.call(L,"__wrapped__");if(cr||dr){var Oa=cr?A.value():A,Ai=dr?L.value():L;return Re||(Re=new Pa),it(Oa,Ai,W,le,Re)}}return on?(Re||(Re=new Pa),Zre(A,L,W,le,it,Re)):!1}function Gre(A){if(!XI(A)||rie(A))return!1;var L=GI(A)?pn:O;return L.test(xo(A))}function Kre(A){return hc(A)&&KI(A.length)&&!!ge[pc(A)]}function Xre(A){if(!iie(A))return wre(A);var L=[];for(var W in Object(A))Ee.call(A,W)&&W!="constructor"&&L.push(W);return L}function WI(A,L,W,le,it,Re){var xt=W&i,jt=A.length,Yt=L.length;if(jt!=Yt&&!(xt&&Yt>jt))return!1;var mt=Re.get(A);if(mt&&Re.get(L))return mt==L;var Gn=-1,Nr=!0,on=W&a?new nh:void 0;for(Re.set(A,L),Re.set(L,A);++Gn<jt;){var cr=A[Gn],dr=L[Gn];if(le)var Oa=xt?le(dr,cr,Gn,L,A,Re):le(cr,dr,Gn,A,L,Re);if(Oa!==void 0){if(Oa)continue;Nr=!1;break}if(on){if(!bt(L,function(Ai,Eo){if(!It(on,Eo)&&(cr===Ai||it(cr,Ai,W,le,Re)))return on.push(Eo)})){Nr=!1;break}}else if(!(cr===dr||it(cr,dr,W,le,Re))){Nr=!1;break}}return Re.delete(A),Re.delete(L),Nr}function Qre(A,L,W,le,it,Re,xt){switch(W){case z:if(A.byteLength!=L.byteLength||A.byteOffset!=L.byteOffset)return!1;A=A.buffer,L=L.buffer;case $:return!(A.byteLength!=L.byteLength||!Re(new Rt(A),new Rt(L)));case c:case d:case x:return qI(+A,+L);case f:return A.name==L.name&&A.message==L.message;case _:case I:return A==L+"";case g:var jt=Ra;case S:var Yt=le&i;if(jt||(jt=te),A.size!=L.size&&!Yt)return!1;var mt=xt.get(A);if(mt)return mt==L;le|=a,xt.set(A,L);var Gn=WI(jt(A),jt(L),le,it,Re,xt);return xt.delete(A),Gn;case D:if(Vy)return Vy.call(A)==Vy.call(L)}return!1}function Zre(A,L,W,le,it,Re){var xt=W&i,jt=YI(A),Yt=jt.length,mt=YI(L),Gn=mt.length;if(Yt!=Gn&&!xt)return!1;for(var Nr=Yt;Nr--;){var on=jt[Nr];if(!(xt?on in L:Ee.call(L,on)))return!1}var cr=Re.get(A);if(cr&&Re.get(L))return cr==L;var dr=!0;Re.set(A,L),Re.set(L,A);for(var Oa=xt;++Nr<Yt;){on=jt[Nr];var Ai=A[on],Eo=L[on];if(le)var ZI=xt?le(Eo,Ai,on,L,A,Re):le(Ai,Eo,on,A,L,Re);if(!(ZI===void 0?Ai===Eo||it(Ai,Eo,W,le,Re):ZI)){dr=!1;break}Oa||(Oa=on=="constructor")}if(dr&&!Oa){var oh=A.constructor,sh=L.constructor;oh!=sh&&"constructor"in A&&"constructor"in L&&!(typeof oh=="function"&&oh instanceof oh&&typeof sh=="function"&&sh instanceof sh)&&(dr=!1)}return Re.delete(A),Re.delete(L),dr}function YI(A){return Yre(A,uie,eie)}function ih(A,L){var W=A.__data__;return nie(L)?W[typeof L=="string"?"string":"hash"]:W.map}function Ks(A,L){var W=Aa(A,L);return Gre(W)?W:void 0}function Jre(A){var L=Ee.call(A,Ci),W=A[Ci];try{A[Ci]=void 0;var le=!0}catch{}var it=Nn.call(A);return le&&(L?A[Ci]=W:delete A[Ci]),it}var eie=zI?function(A){return A==null?[]:(A=Object(A),ze(zI(A),function(L){return qn.call(A,L)}))}:cie,Ia=pc;(jy&&Ia(new jy(new ArrayBuffer(1)))!=z||dc&&Ia(new dc)!=g||Uy&&Ia(Uy.resolve())!=b||zy&&Ia(new zy)!=S||Hy&&Ia(new Hy)!=N)&&(Ia=function(A){var L=pc(A),W=L==v?A.constructor:void 0,le=W?xo(W):"";if(le)switch(le){case yre:return z;case vre:return g;case bre:return b;case xre:return S;case Ere:return N}return L});function tie(A,L){return L=L??o,!!L&&(typeof A=="number"||Pe.test(A))&&A>-1&&A%1==0&&A<L}function nie(A){var L=typeof A;return L=="string"||L=="number"||L=="symbol"||L=="boolean"?A!=="__proto__":A===null}function rie(A){return!!Bt&&Bt in A}function iie(A){var L=A&&A.constructor,W=typeof L=="function"&&L.prototype||q;return A===W}function aie(A){return Nn.call(A)}function xo(A){if(A!=null){try{return _e.call(A)}catch{}try{return A+""}catch{}}return""}function qI(A,L){return A===L||A!==A&&L!==L}var oie=VI(function(){return arguments}())?VI:function(A){return hc(A)&&Ee.call(A,"callee")&&!qn.call(A,"callee")},ah=Array.isArray;function sie(A){return A!=null&&KI(A.length)&&!GI(A)}var $y=gre||die;function lie(A,L){return $I(A,L)}function GI(A){if(!XI(A))return!1;var L=pc(A);return L==p||L==m||L==u||L==E}function KI(A){return typeof A=="number"&&A>-1&&A%1==0&&A<=o}function XI(A){var L=typeof A;return A!=null&&(L=="object"||L=="function")}function hc(A){return A!=null&&typeof A=="object"}var QI=Ye?Le(Ye):Kre;function uie(A){return sie(A)?Wre(A):Xre(A)}function cie(){return[]}function die(){return!1}e.exports=lie}(dd,dd.exports);var JF=dd.exports;const e9=Da(JF);class fd{constructor(t){ce(this,"subscribers",new Set);Wy(this,Qr);ce(this,"initialState");Wy(this,Gs);ce(this,"lifecycleListeners",new Map);ce(this,"emitLifecycle",(t,n)=>{const r=this.lifecycleListeners.get(t);if(r){const i={type:t,timestamp:Date.now(),data:n};r.forEach(a=>{try{a(i)}catch{}})}});ce(this,"notifySubscribers",t=>{Array.from(this.subscribers).forEach(r=>{try{r(t)}catch(i){this.emitLifecycle("error",{error:i})}})});ce(this,"subscribe",t=>(this.subscribers.add(t),()=>{this.subscribers.delete(t)}));ce(this,"onLifecycle",(t,n)=>{this.lifecycleListeners.has(t)||this.lifecycleListeners.set(t,new Set);const r=this.lifecycleListeners.get(t);return r.add(n),()=>{r.delete(n),r.size===0&&this.lifecycleListeners.delete(t)}});ce(this,"get",()=>To(this,Qr));ce(this,"set",t=>{this.emitLifecycle("beforeUpdate",{previousState:To(this,Qr),nextState:t}),e9(To(this,Qr),t)||(mc(this,Qr,t),mc(this,Gs,Date.now()),this.emitLifecycle("stateChange",{state:t}),this.notifySubscribers(t)),this.emitLifecycle("afterUpdate",{state:t})});ce(this,"setPartial",t=>{if(t==null)return;const n={...To(this,Qr),...t};this.set(n)});ce(this,"clear",()=>{this.emitLifecycle("destroy"),this.subscribers=new Set,this.lifecycleListeners=new Map});ce(this,"reset",()=>{this.set(this.initialState)});ce(this,"lastUpdated",()=>To(this,Gs));mc(this,Qr,t),this.initialState=t,mc(this,Gs,Date.now()),this.emitLifecycle("init",{initialState:To(this,Qr)})}}Qr=new WeakMap,Gs=new WeakMap;class t9{constructor({config:t,api:n}){ce(this,"config");ce(this,"api");ce(this,"state");ce(this,"shouldCollectData",()=>{var n;return!!(!((n=this.state.get().contact)!=null&&n.token)&&this.config.collectUserData)});ce(this,"autoCreateUnverifiedUser",async()=>{var t,n;await this.createUnverifiedContact({name:((t=this.config.user)==null?void 0:t.name)||"Anonymous",email:(n=this.config.user)==null?void 0:n.email})});ce(this,"createUnverifiedContact",async t=>{try{this.state.setPartial({isCreatingUnverifiedContact:!0,isErrorCreatingUnverifiedContact:!1});const{data:n}=await this.api.createUnverifiedContact(t);n!=null&&n.token?(this.state.setPartial({contact:{token:n.token}}),this.api.setAuthToken(n.token)):this.state.setPartial({isErrorCreatingUnverifiedContact:!0})}finally{this.state.setPartial({isCreatingUnverifiedContact:!1})}});this.config=t,this.api=n,this.state=new fd({contact:t.contactToken?{token:t.contactToken}:null,isCreatingUnverifiedContact:!1,isErrorCreatingUnverifiedContact:!1}),!t.contactToken&&!t.collectUserData&&this.autoCreateUnverifiedUser()}}class KT{constructor(){ce(this,"state",new fd({isPolling:!1,isError:!1}));ce(this,"abortController",new AbortController);ce(this,"reset",()=>{var t;this.abortController.abort("Resetting poller"),(t=this.stopPolling)==null||t.call(this),this.stopPolling=null});ce(this,"stopPolling",null);ce(this,"startPolling",(t,n)=>{if(this.stopPolling)return;const r=[],i=async()=>{this.abortController=new AbortController,this.state.setPartial({isPolling:!0});try{await t(this.abortController.signal)}catch(a){if(this.abortController.signal.aborted)return;console.error("Failed to poll:",a),this.state.setPartial({isError:!0})}finally{this.state.setPartial({isPolling:!1})}this.abortController.signal.aborted?console.log("Poller aborted, not scheduling anymore"):r.push(setTimeout(i,n))};i(),this.stopPolling=()=>{r.forEach(clearTimeout),this.state.reset()}})}}const zt=[];for(let e=0;e<256;++e)zt.push((e+256).toString(16).slice(1));function n9(e,t=0){return(zt[e[t+0]]+zt[e[t+1]]+zt[e[t+2]]+zt[e[t+3]]+"-"+zt[e[t+4]]+zt[e[t+5]]+"-"+zt[e[t+6]]+zt[e[t+7]]+"-"+zt[e[t+8]]+zt[e[t+9]]+"-"+zt[e[t+10]]+zt[e[t+11]]+zt[e[t+12]]+zt[e[t+13]]+zt[e[t+14]]+zt[e[t+15]]).toLowerCase()}let Qm;const r9=new Uint8Array(16);function i9(){if(!Qm){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Qm=crypto.getRandomValues.bind(crypto)}return Qm(r9)}const XT={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function QT(e,t,n){var i;if(XT.randomUUID&&!t&&!e)return XT.randomUUID();e=e||{};const r=e.random??((i=e.rng)==null?void 0:i.call(e))??i9();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,n9(r)}function pd(){return QT()}class a9{constructor(t){ce(this,"api");ce(this,"poller",new KT);ce(this,"state",new fd({session:null,isCreatingSession:!1}));ce(this,"reset",async()=>{this.state.reset(),this.poller.reset()});ce(this,"registerPolling",()=>{this.state.subscribe(({session:t})=>{t!=null&&t.id?this.poller.startPolling(async n=>{const{data:r}=await this.fetch(t.id,n);r&&this.state.setPartial({session:r})},1e3):this.poller.reset()})});ce(this,"createSession",async()=>{this.state.setPartial({session:null,isCreatingSession:!0});const{data:t,error:n}=await this.api.createSession();return t?(this.state.setPartial({session:t,isCreatingSession:!1}),t):(console.error("Failed to create session:",n),null)});ce(this,"fetch",async(t,n)=>this.api.getSession({sessionId:t,abortSignal:n}));this.api=t,this.registerPolling()}}class Bo{constructor({config:t,api:n,sessionCtx:r}){ce(this,"config");ce(this,"api");ce(this,"sessionCtx");ce(this,"poller",new KT);ce(this,"state",new fd({messages:[],isSendingMessage:!1,suggestedReplies:null}));ce(this,"sendMessageAbortController",new AbortController);ce(this,"reset",()=>{this.sendMessageAbortController.abort("Resetting chat"),this.state.reset(),this.poller.reset()});ce(this,"registerPolling",()=>{this.sessionCtx.state.subscribe(({session:t})=>{t!=null&&t.id?this.poller.startPolling(async n=>{await this.fetchAndSetHistory(t.id,n)},1e3):this.poller.reset()})});ce(this,"sendMessage",async t=>{var i,a,o,s,l,u;this.sendMessageAbortController=new AbortController;const n=this.state.get().isSendingMessage,r=((i=this.sessionCtx.state.get().session)==null?void 0:i.assignee.kind)==="ai";if(n&&r){console.warn("Cannot send messages while awaiting AI response");return}this.state.setPartial({suggestedReplies:null});try{this.state.setPartial({isSendingMessage:!0});const c=Bo.toUserMessage(t.content,t.attachments||void 0),d=this.state.get().messages;if(this.state.setPartial({messages:[...d,c]}),!((a=this.sessionCtx.state.get().session)!=null&&a.id)&&!await this.sessionCtx.createSession()){console.error("Failed to create session");return}const f=(o=this.sessionCtx.state.get().session)==null?void 0:o.id;if(!f)return;const{data:p}=await this.api.sendMessage({uuid:c.id,bot_token:this.config.token,headers:this.config.headers,query_params:this.config.queryParams,session_id:f,user:this.config.user,...t},this.sendMessageAbortController.signal);if(p!=null&&p.success){const m=Bo.toBotMessage(p);if(m){const g=this.state.get().messages;if(!!g.some(w=>w.id===m.id))return;this.state.setPartial({messages:[...g,m]})}else(s=p.options)!=null&&s.value&&((l=p.options)==null?void 0:l.value.length)>0&&this.state.setPartial({suggestedReplies:p.options.value})}else{const m=Bo.toErrorMessage(((u=p==null?void 0:p.error)==null?void 0:u.message)||"Unknown error occurred"),g=this.state.get().messages;this.state.setPartial({messages:[...g,m]})}}catch(c){this.sendMessageAbortController.signal.aborted||console.error("Failed to send message:",c)}finally{this.state.setPartial({isSendingMessage:!1})}});ce(this,"fetchAndSetHistory",async(t,n)=>{var a;const r=(a=this.state.get().messages.at(-1))==null?void 0:a.timestamp,{data:i}=await this.api.getSessionHistory({sessionId:t,lastMessageTimestamp:r,abortSignal:n});if(i&&i.length>0){const o=this.state.get().messages,s=i.map(Bo.mapHistoryToMessage).filter(l=>!o.some(u=>u.id===l.id));this.state.setPartial({messages:[...o,...s]})}});this.config=t,this.api=n,this.sessionCtx=r,this.registerPolling()}static mapHistoryToMessage(t){const n={id:t.publicId,timestamp:t.sentAt||"",attachments:t.attachments||void 0};return t.sender.kind==="user"?{...n,type:"FROM_USER",content:t.content.text||"",deliveredAt:t.sentAt||""}:t.sender.kind==="agent"?{...n,type:"FROM_AGENT",component:"agent_message",data:{message:t.content.text||""}}:{...n,type:"FROM_BOT",component:"bot_message",agent:{id:null,name:t.sender.name||"",isAi:t.sender.kind==="ai",avatar:t.sender.avatar||null},data:{message:t.content.text}}}static toUserMessage(t,n){return{id:pd(),type:"FROM_USER",content:t,deliveredAt:new Date().toISOString(),attachments:n,timestamp:new Date().toISOString()}}static toBotMessage(t){if(t.success&&t.autopilotResponse)return{type:"FROM_BOT",id:t.autopilotResponse.id||pd(),timestamp:new Date().toISOString(),component:"bot_message",data:{message:t.autopilotResponse.value.content}};if(t.success&&t.uiResponse){const n=t.uiResponse.value;return{type:"FROM_BOT",id:pd(),timestamp:new Date().toISOString(),component:n.name,data:n.request_response}}return null}static toErrorMessage(t){return{type:"FROM_BOT",id:pd(),timestamp:new Date().toISOString(),component:"TEXT",data:{message:t,variant:"error"}}}}class o9{constructor({config:t}){ce(this,"config");ce(this,"api");ce(this,"contactCtx");ce(this,"sessionCtx");ce(this,"messageCtx");ce(this,"resetChat",()=>{this.sessionCtx.reset(),this.messageCtx.reset()});this.config=t,this.api=new ZF({config:t}),this.contactCtx=new t9({api:this.api,config:this.config}),this.sessionCtx=new a9(this.api),this.messageCtx=new Bo({config:this.config,api:this.api,sessionCtx:this.sessionCtx})}}const[Qn,s9]=y8();function l9({options:e,children:t,components:n}){const r=y.useMemo(()=>new o9({config:e}),[e]),i=y.useMemo(()=>new w8({components:n}),[n]);return T.jsx(s9,{value:{widgetCtx:r,components:n,componentStore:i,version:ov},children:t})}function bl(){const{widgetCtx:e}=Qn();return e.config}function Zm(e){return y.useSyncExternalStore(e.subscribe,e.get,e.get)}function ZT(){const{widgetCtx:e}=Qn();return{state:Zm(e.contactCtx.state),contactCtx:e.contactCtx}}function hd(){const{widgetCtx:e}=Qn();return{messages:Zm(e.messageCtx.state),messageCtx:e.messageCtx}}function md(){const{widgetCtx:e}=Qn();return{session:Zm(e.sessionCtx.state)}}function JT(){var r;const{session:e}=md(),{messages:t}=hd();return{isAwaitingBotReply:(!((r=e.session)!=null&&r.isHandedOff)||e.session.assignee.kind==="ai"||e.isCreatingSession)&&t.isSendingMessage}}var e2={exports:{}},t2={};/**
|
|
300
|
+
`+a):r.stack=a}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Va(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:a}=n;r!==void 0&&ud.assertOptions(r,{silentJSONParsing:Dr.transitional(Dr.boolean),forcedJSONParsing:Dr.transitional(Dr.boolean),clarifyTimeoutError:Dr.transitional(Dr.boolean)},!1),i!=null&&(H.isFunction(i)?n.paramsSerializer={serialize:i}:ud.assertOptions(i,{encode:Dr.function,serialize:Dr.function},!0)),ud.assertOptions(n,{baseUrl:Dr.spelling("baseURL"),withXsrfToken:Dr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=a&&H.merge(a.common,a[n.method]);a&&H.forEach(["delete","get","head","post","put","patch","common"],m=>{delete a[m]}),n.headers=wn.concat(o,a);const s=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(l=l&&g.synchronous,s.unshift(g.fulfilled,g.rejected))});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let c,d=0,f;if(!l){const m=[zT.bind(this),void 0];for(m.unshift.apply(m,s),m.push.apply(m,u),f=m.length,c=Promise.resolve(n);d<f;)c=c.then(m[d++],m[d++]);return c}f=s.length;let p=n;for(d=0;d<f;){const m=s[d++],g=s[d++];try{p=m(p)}catch(x){g.call(this,x);break}}try{c=zT.call(this,p)}catch(m){return Promise.reject(m)}for(d=0,f=u.length;d<f;)c=c.then(u[d++],u[d++]);return c}getUri(t){t=Va(this.defaults,t);const n=IT(t.baseURL,t.url);return TT(n,t.params,t.paramsSerializer)}}H.forEach(["delete","get","head","options"],function(t){$a.prototype[t]=function(n,r){return this.request(Va(r||{},{method:t,url:n,data:(r||{}).data}))}}),H.forEach(["post","put","patch"],function(t){function n(r){return function(a,o,s){return this.request(Va(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:o}))}}$a.prototype[t]=n(),$a.prototype[t+"Form"]=n(!0)});class Km{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(i=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](i);r._listeners=null}),this.promise.then=i=>{let a;const o=new Promise(s=>{r.subscribe(s),a=s}).then(i);return o.cancel=function(){r.unsubscribe(a)},o},t(function(a,o,s){r.reason||(r.reason=new Fo(a,o,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Km(function(i){t=i}),cancel:t}}}function UF(e){return function(n){return e.apply(null,n)}}function zF(e){return H.isObject(e)&&e.isAxiosError===!0}const Xm={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Xm).forEach(([e,t])=>{Xm[t]=e});function $T(e){const t=new $a(e),n=sT($a.prototype.request,t);return H.extend(n,$a.prototype,t,{allOwnKeys:!0}),H.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return $T(Va(e,i))},n}const Ct=$T(yl);Ct.Axios=$a,Ct.CanceledError=Fo,Ct.CancelToken=Km,Ct.isCancel=AT,Ct.VERSION=HT,Ct.toFormData=rd,Ct.AxiosError=Se,Ct.Cancel=Ct.CanceledError,Ct.all=function(t){return Promise.all(t)},Ct.spread=UF,Ct.isAxiosError=zF,Ct.mergeConfig=Va,Ct.AxiosHeaders=wn,Ct.formToJSON=e=>CT(H.isHTMLForm(e)?new FormData(e):e),Ct.getAdapter=UT.getAdapter,Ct.HttpStatusCode=Xm,Ct.default=Ct;const HF=/\{[^{}]+\}/g,VF=()=>{var e,t;return typeof process=="object"&&Number.parseInt((t=(e=process==null?void 0:process.versions)==null?void 0:e.node)==null?void 0:t.substring(0,2))>=18&&process.versions.undici};function $F(){return Math.random().toString(36).slice(2,11)}function WF(e){let{baseUrl:t="",Request:n=globalThis.Request,fetch:r=globalThis.fetch,querySerializer:i,bodySerializer:a,headers:o,requestInitExt:s=void 0,...l}={...e};s=VF()?s:void 0,t=GT(t);const u=[];async function c(d,f){const{baseUrl:p,fetch:m=r,Request:g=n,headers:x,params:w={},parseAs:v="json",querySerializer:b,bodySerializer:E=a??qF,body:_,...S}=f||{};p&&(t=GT(p));let I=typeof i=="function"?i:qT(i);b&&(I=typeof b=="function"?b:qT({...typeof i=="object"?i:{},...b}));const D=_===void 0?void 0:E(_),V=D===void 0||D instanceof FormData?{}:{"Content-Type":"application/json"},N={redirect:"follow",...l,...S,body:D,headers:KF(V,o,x,w.header)};let $,z,X=new n(GF(d,{baseUrl:t,params:w,querySerializer:I}),N);for(const re in S)re in X||(X[re]=S[re]);if(u.length){$=$F(),z=Object.freeze({baseUrl:t,fetch:m,parseAs:v,querySerializer:I,bodySerializer:E});for(const re of u)if(re&&typeof re=="object"&&typeof re.onRequest=="function"){const ee=await re.onRequest({request:X,schemaPath:d,params:w,options:z,id:$});if(ee){if(!(ee instanceof n))throw new Error("onRequest: must return new Request() when modifying the request");X=ee}}}let Y;try{Y=await m(X,s)}catch(re){let ee=re;if(u.length)for(let F=u.length-1;F>=0;F--){const B=u[F];if(B&&typeof B=="object"&&typeof B.onError=="function"){const k=await B.onError({request:X,error:ee,schemaPath:d,params:w,options:z,id:$});if(k){if(k instanceof Response){ee=void 0,Y=k;break}if(k instanceof Error){ee=k;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(ee)throw ee}if(u.length)for(let re=u.length-1;re>=0;re--){const ee=u[re];if(ee&&typeof ee=="object"&&typeof ee.onResponse=="function"){const F=await ee.onResponse({request:X,response:Y,schemaPath:d,params:w,options:z,id:$});if(F){if(!(F instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");Y=F}}}if(Y.status===204||Y.headers.get("Content-Length")==="0")return Y.ok?{data:void 0,response:Y}:{error:void 0,response:Y};if(Y.ok)return v==="stream"?{data:Y.body,response:Y}:{data:await Y[v](),response:Y};let ne=await Y.text();try{ne=JSON.parse(ne)}catch{}return{error:ne,response:Y}}return{request(d,f,p){return c(f,{...p,method:d.toUpperCase()})},GET(d,f){return c(d,{...f,method:"GET"})},PUT(d,f){return c(d,{...f,method:"PUT"})},POST(d,f){return c(d,{...f,method:"POST"})},DELETE(d,f){return c(d,{...f,method:"DELETE"})},OPTIONS(d,f){return c(d,{...f,method:"OPTIONS"})},HEAD(d,f){return c(d,{...f,method:"HEAD"})},PATCH(d,f){return c(d,{...f,method:"PATCH"})},TRACE(d,f){return c(d,{...f,method:"TRACE"})},use(...d){for(const f of d)if(f){if(typeof f!="object"||!("onRequest"in f||"onResponse"in f||"onError"in f))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");u.push(f)}},eject(...d){for(const f of d){const p=u.indexOf(f);p!==-1&&u.splice(p,1)}}}}function cd(e,t,n){if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${(n==null?void 0:n.allowReserved)===!0?t:encodeURIComponent(t)}`}function WT(e,t,n){if(!t||typeof t!="object")return"";const r=[],i={simple:",",label:".",matrix:";"}[n.style]||"&";if(n.style!=="deepObject"&&n.explode===!1){for(const s in t)r.push(s,n.allowReserved===!0?t[s]:encodeURIComponent(t[s]));const o=r.join(",");switch(n.style){case"form":return`${e}=${o}`;case"label":return`.${o}`;case"matrix":return`;${e}=${o}`;default:return o}}for(const o in t){const s=n.style==="deepObject"?`${e}[${o}]`:o;r.push(cd(s,t[o],n))}const a=r.join(i);return n.style==="label"||n.style==="matrix"?`${i}${a}`:a}function YT(e,t,n){if(!Array.isArray(t))return"";if(n.explode===!1){const a={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[n.style]||",",o=(n.allowReserved===!0?t:t.map(s=>encodeURIComponent(s))).join(a);switch(n.style){case"simple":return o;case"label":return`.${o}`;case"matrix":return`;${e}=${o}`;default:return`${e}=${o}`}}const r={simple:",",label:".",matrix:";"}[n.style]||"&",i=[];for(const a of t)n.style==="simple"||n.style==="label"?i.push(n.allowReserved===!0?a:encodeURIComponent(a)):i.push(cd(e,a,n));return n.style==="label"||n.style==="matrix"?`${r}${i.join(r)}`:i.join(r)}function qT(e){return function(n){const r=[];if(n&&typeof n=="object")for(const i in n){const a=n[i];if(a!=null){if(Array.isArray(a)){if(a.length===0)continue;r.push(YT(i,a,{style:"form",explode:!0,...e==null?void 0:e.array,allowReserved:(e==null?void 0:e.allowReserved)||!1}));continue}if(typeof a=="object"){r.push(WT(i,a,{style:"deepObject",explode:!0,...e==null?void 0:e.object,allowReserved:(e==null?void 0:e.allowReserved)||!1}));continue}r.push(cd(i,a,e))}}return r.join("&")}}function YF(e,t){let n=e;for(const r of e.match(HF)??[]){let i=r.substring(1,r.length-1),a=!1,o="simple";if(i.endsWith("*")&&(a=!0,i=i.substring(0,i.length-1)),i.startsWith(".")?(o="label",i=i.substring(1)):i.startsWith(";")&&(o="matrix",i=i.substring(1)),!t||t[i]===void 0||t[i]===null)continue;const s=t[i];if(Array.isArray(s)){n=n.replace(r,YT(i,s,{style:o,explode:a}));continue}if(typeof s=="object"){n=n.replace(r,WT(i,s,{style:o,explode:a}));continue}if(o==="matrix"){n=n.replace(r,`;${cd(i,s)}`);continue}n=n.replace(r,o==="label"?`.${encodeURIComponent(s)}`:encodeURIComponent(s))}return n}function qF(e){return e instanceof FormData?e:JSON.stringify(e)}function GF(e,t){var i;let n=`${t.baseUrl}${e}`;(i=t.params)!=null&&i.path&&(n=YF(n,t.params.path));let r=t.querySerializer(t.params.query??{});return r.startsWith("?")&&(r=r.substring(1)),r&&(n+=`?${r}`),n}function KF(...e){const t=new Headers;for(const n of e){if(!n||typeof n!="object")continue;const r=n instanceof Headers?n.entries():Object.entries(n);for(const[i,a]of r)if(a===null)t.delete(i);else if(Array.isArray(a))for(const o of a)t.append(i,o);else a!==void 0&&t.set(i,a)}return t}function GT(e){return e.endsWith("/")?e.substring(0,e.length-1):e}const XF=e=>{console.log(e.error)},QF=e=>{const t=WF({baseUrl:e.baseUrl}),n={onRequest:e.onRequest,onResponse:e.onResponse,onError:e.onError||XF};return t.use(n),t};class ZF{constructor({config:t}){ce(this,"client");ce(this,"uploadFileClient");ce(this,"config");ce(this,"constructClientOptions",t=>{const n=this.config.apiUrl||"https://api.open.cx",r={"X-Bot-Token":this.config.token,"Content-Type":"application/json",Accept:"application/json",Authorization:t?`Bearer ${t}`:void 0};return{baseUrl:n,headers:r}});ce(this,"createOpenAPIClient",({baseUrl:t,headers:n})=>QF({baseUrl:t,onRequest:({request:r})=>{Object.entries(n).forEach(([i,a])=>{a&&r.headers.set(i,a)})}}));ce(this,"createAxiosUploadClient",({baseUrl:t,headers:n})=>Ct.create({baseURL:`${t}/backend/widget/v2/upload`,headers:n}));ce(this,"setAuthToken",t=>{const{baseUrl:n,headers:r}=this.constructClientOptions(t);this.client=this.createOpenAPIClient({baseUrl:n,headers:r}),this.uploadFileClient=this.createAxiosUploadClient({baseUrl:n,headers:r})});ce(this,"widgetPrelude",async()=>await this.client.GET("/backend/widget/v2/prelude",{params:{header:{"X-Bot-Token":this.config.token}}}));ce(this,"sendMessage",async(t,n)=>await this.client.POST("/backend/widget/v2/chat/send",{body:t,signal:n}));ce(this,"getSessionHistory",async({sessionId:t,lastMessageTimestamp:n,abortSignal:r})=>{const i=n?{lastMessageTimestamp:n}:void 0;return await this.client.GET("/backend/widget/v2/session/history/{sessionId}",{params:{path:{sessionId:t},query:i},signal:r})});ce(this,"createUnverifiedContact",async t=>await this.client.POST("/backend/widget/v2/contact/create-unverified",{params:{header:{"x-bot-token":this.config.token}},body:t}));ce(this,"createSession",async()=>await this.client.POST("/backend/widget/v2/create-session"));ce(this,"getSession",async({sessionId:t,abortSignal:n})=>await this.client.GET("/backend/widget/v2/session/{sessionId}",{params:{path:{sessionId:t}},signal:n}));ce(this,"uploadFile",async(t,n={})=>{const r=new FormData;r.append("file",t.file);const{data:i}=await this.uploadFileClient.post("",r,{headers:{"Content-Type":"multipart/form-data"},...n});return i});ce(this,"vote",async t=>await this.client.POST("/backend/widget/v2/chat/vote",{body:t}));this.config=t;const{baseUrl:n,headers:r}=this.constructClientOptions(t.contactToken);this.client=this.createOpenAPIClient({baseUrl:n,headers:r}),this.uploadFileClient=this.createAxiosUploadClient({baseUrl:n,headers:r})}}var dd={exports:{}};dd.exports,function(e,t){var n=200,r="__lodash_hash_undefined__",i=1,a=2,o=9007199254740991,s="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",d="[object Date]",f="[object Error]",p="[object Function]",m="[object GeneratorFunction]",g="[object Map]",x="[object Number]",w="[object Null]",v="[object Object]",b="[object Promise]",E="[object Proxy]",_="[object RegExp]",S="[object Set]",I="[object String]",D="[object Symbol]",V="[object Undefined]",N="[object WeakMap]",$="[object ArrayBuffer]",z="[object DataView]",X="[object Float32Array]",Y="[object Float64Array]",ne="[object Int8Array]",re="[object Int16Array]",ee="[object Int32Array]",F="[object Uint8Array]",B="[object Uint8ClampedArray]",k="[object Uint16Array]",ie="[object Uint32Array]",he=/[\\^$.*+?()[\]{}|]/g,O=/^\[object .+?Constructor\]$/,Pe=/^(?:0|[1-9]\d*)$/,ge={};ge[X]=ge[Y]=ge[ne]=ge[re]=ge[ee]=ge[F]=ge[B]=ge[k]=ge[ie]=!0,ge[s]=ge[l]=ge[$]=ge[c]=ge[z]=ge[d]=ge[f]=ge[p]=ge[g]=ge[x]=ge[v]=ge[_]=ge[S]=ge[I]=ge[N]=!1;var ve=typeof wt=="object"&&wt&&wt.Object===Object&&wt,$e=typeof self=="object"&&self&&self.Object===Object&&self,Ve=ve||$e||Function("return this")(),We=t&&!t.nodeType&&t,Ge=We&&!0&&e&&!e.nodeType&&e,St=Ge&&Ge.exports===We,Te=St&&ve.process,xe=function(){try{return Te&&Te.binding&&Te.binding("util")}catch{}}(),Ye=xe&&xe.isTypedArray;function ze(A,L){for(var W=-1,le=A==null?0:A.length,it=0,Re=[];++W<le;){var xt=A[W];L(xt,W,A)&&(Re[it++]=xt)}return Re}function vt(A,L){for(var W=-1,le=L.length,it=A.length;++W<le;)A[it+W]=L[W];return A}function bt(A,L){for(var W=-1,le=A==null?0:A.length;++W<le;)if(L(A[W],W,A))return!0;return!1}function Ke(A,L){for(var W=-1,le=Array(A);++W<A;)le[W]=L(W);return le}function Le(A){return function(L){return A(L)}}function It(A,L){return A.has(L)}function Aa(A,L){return A==null?void 0:A[L]}function Ra(A){var L=-1,W=Array(A.size);return A.forEach(function(le,it){W[++L]=[it,le]}),W}function Na(A,L){return function(W){return A(L(W))}}function te(A){var L=-1,W=Array(A.size);return A.forEach(function(le){W[++L]=le}),W}var de=Array.prototype,j=Function.prototype,q=Object.prototype,ue=Ve["__core-js_shared__"],_e=j.toString,Ee=q.hasOwnProperty,Bt=function(){var A=/[^.]+$/.exec(ue&&ue.keys&&ue.keys.IE_PROTO||"");return A?"Symbol(src)_1."+A:""}(),Nn=q.toString,pn=RegExp("^"+_e.call(Ee).replace(he,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Yn=St?Ve.Buffer:void 0,Pn=Ve.Symbol,Rt=Ve.Uint8Array,qn=q.propertyIsEnumerable,hn=de.splice,Ci=Pn?Pn.toStringTag:void 0,zI=Object.getOwnPropertySymbols,gre=Yn?Yn.isBuffer:void 0,wre=Na(Object.keys,Object),jy=Ks(Ve,"DataView"),dc=Ks(Ve,"Map"),Uy=Ks(Ve,"Promise"),zy=Ks(Ve,"Set"),Hy=Ks(Ve,"WeakMap"),fc=Ks(Object,"create"),yre=xo(jy),vre=xo(dc),bre=xo(Uy),xre=xo(zy),Ere=xo(Hy),HI=Pn?Pn.prototype:void 0,Vy=HI?HI.valueOf:void 0;function vo(A){var L=-1,W=A==null?0:A.length;for(this.clear();++L<W;){var le=A[L];this.set(le[0],le[1])}}function Tre(){this.__data__=fc?fc(null):{},this.size=0}function _re(A){var L=this.has(A)&&delete this.__data__[A];return this.size-=L?1:0,L}function Sre(A){var L=this.__data__;if(fc){var W=L[A];return W===r?void 0:W}return Ee.call(L,A)?L[A]:void 0}function Cre(A){var L=this.__data__;return fc?L[A]!==void 0:Ee.call(L,A)}function kre(A,L){var W=this.__data__;return this.size+=this.has(A)?0:1,W[A]=fc&&L===void 0?r:L,this}vo.prototype.clear=Tre,vo.prototype.delete=_re,vo.prototype.get=Sre,vo.prototype.has=Cre,vo.prototype.set=kre;function ki(A){var L=-1,W=A==null?0:A.length;for(this.clear();++L<W;){var le=A[L];this.set(le[0],le[1])}}function Are(){this.__data__=[],this.size=0}function Rre(A){var L=this.__data__,W=rh(L,A);if(W<0)return!1;var le=L.length-1;return W==le?L.pop():hn.call(L,W,1),--this.size,!0}function Nre(A){var L=this.__data__,W=rh(L,A);return W<0?void 0:L[W][1]}function Pre(A){return rh(this.__data__,A)>-1}function Ire(A,L){var W=this.__data__,le=rh(W,A);return le<0?(++this.size,W.push([A,L])):W[le][1]=L,this}ki.prototype.clear=Are,ki.prototype.delete=Rre,ki.prototype.get=Nre,ki.prototype.has=Pre,ki.prototype.set=Ire;function bo(A){var L=-1,W=A==null?0:A.length;for(this.clear();++L<W;){var le=A[L];this.set(le[0],le[1])}}function Ore(){this.size=0,this.__data__={hash:new vo,map:new(dc||ki),string:new vo}}function Dre(A){var L=ih(this,A).delete(A);return this.size-=L?1:0,L}function Lre(A){return ih(this,A).get(A)}function Mre(A){return ih(this,A).has(A)}function Fre(A,L){var W=ih(this,A),le=W.size;return W.set(A,L),this.size+=W.size==le?0:1,this}bo.prototype.clear=Ore,bo.prototype.delete=Dre,bo.prototype.get=Lre,bo.prototype.has=Mre,bo.prototype.set=Fre;function nh(A){var L=-1,W=A==null?0:A.length;for(this.__data__=new bo;++L<W;)this.add(A[L])}function Bre(A){return this.__data__.set(A,r),this}function jre(A){return this.__data__.has(A)}nh.prototype.add=nh.prototype.push=Bre,nh.prototype.has=jre;function Pa(A){var L=this.__data__=new ki(A);this.size=L.size}function Ure(){this.__data__=new ki,this.size=0}function zre(A){var L=this.__data__,W=L.delete(A);return this.size=L.size,W}function Hre(A){return this.__data__.get(A)}function Vre(A){return this.__data__.has(A)}function $re(A,L){var W=this.__data__;if(W instanceof ki){var le=W.__data__;if(!dc||le.length<n-1)return le.push([A,L]),this.size=++W.size,this;W=this.__data__=new bo(le)}return W.set(A,L),this.size=W.size,this}Pa.prototype.clear=Ure,Pa.prototype.delete=zre,Pa.prototype.get=Hre,Pa.prototype.has=Vre,Pa.prototype.set=$re;function Wre(A,L){var W=ah(A),le=!W&&oie(A),it=!W&&!le&&$y(A),Re=!W&&!le&&!it&&QI(A),xt=W||le||it||Re,jt=xt?Ke(A.length,String):[],Yt=jt.length;for(var mt in A)Ee.call(A,mt)&&!(xt&&(mt=="length"||it&&(mt=="offset"||mt=="parent")||Re&&(mt=="buffer"||mt=="byteLength"||mt=="byteOffset")||tie(mt,Yt)))&&jt.push(mt);return jt}function rh(A,L){for(var W=A.length;W--;)if(qI(A[W][0],L))return W;return-1}function Yre(A,L,W){var le=L(A);return ah(A)?le:vt(le,W(A))}function pc(A){return A==null?A===void 0?V:w:Ci&&Ci in Object(A)?Jre(A):aie(A)}function VI(A){return hc(A)&&pc(A)==s}function $I(A,L,W,le,it){return A===L?!0:A==null||L==null||!hc(A)&&!hc(L)?A!==A&&L!==L:qre(A,L,W,le,$I,it)}function qre(A,L,W,le,it,Re){var xt=ah(A),jt=ah(L),Yt=xt?l:Ia(A),mt=jt?l:Ia(L);Yt=Yt==s?v:Yt,mt=mt==s?v:mt;var Gn=Yt==v,Nr=mt==v,on=Yt==mt;if(on&&$y(A)){if(!$y(L))return!1;xt=!0,Gn=!1}if(on&&!Gn)return Re||(Re=new Pa),xt||QI(A)?WI(A,L,W,le,it,Re):Qre(A,L,Yt,W,le,it,Re);if(!(W&i)){var cr=Gn&&Ee.call(A,"__wrapped__"),dr=Nr&&Ee.call(L,"__wrapped__");if(cr||dr){var Oa=cr?A.value():A,Ai=dr?L.value():L;return Re||(Re=new Pa),it(Oa,Ai,W,le,Re)}}return on?(Re||(Re=new Pa),Zre(A,L,W,le,it,Re)):!1}function Gre(A){if(!XI(A)||rie(A))return!1;var L=GI(A)?pn:O;return L.test(xo(A))}function Kre(A){return hc(A)&&KI(A.length)&&!!ge[pc(A)]}function Xre(A){if(!iie(A))return wre(A);var L=[];for(var W in Object(A))Ee.call(A,W)&&W!="constructor"&&L.push(W);return L}function WI(A,L,W,le,it,Re){var xt=W&i,jt=A.length,Yt=L.length;if(jt!=Yt&&!(xt&&Yt>jt))return!1;var mt=Re.get(A);if(mt&&Re.get(L))return mt==L;var Gn=-1,Nr=!0,on=W&a?new nh:void 0;for(Re.set(A,L),Re.set(L,A);++Gn<jt;){var cr=A[Gn],dr=L[Gn];if(le)var Oa=xt?le(dr,cr,Gn,L,A,Re):le(cr,dr,Gn,A,L,Re);if(Oa!==void 0){if(Oa)continue;Nr=!1;break}if(on){if(!bt(L,function(Ai,Eo){if(!It(on,Eo)&&(cr===Ai||it(cr,Ai,W,le,Re)))return on.push(Eo)})){Nr=!1;break}}else if(!(cr===dr||it(cr,dr,W,le,Re))){Nr=!1;break}}return Re.delete(A),Re.delete(L),Nr}function Qre(A,L,W,le,it,Re,xt){switch(W){case z:if(A.byteLength!=L.byteLength||A.byteOffset!=L.byteOffset)return!1;A=A.buffer,L=L.buffer;case $:return!(A.byteLength!=L.byteLength||!Re(new Rt(A),new Rt(L)));case c:case d:case x:return qI(+A,+L);case f:return A.name==L.name&&A.message==L.message;case _:case I:return A==L+"";case g:var jt=Ra;case S:var Yt=le&i;if(jt||(jt=te),A.size!=L.size&&!Yt)return!1;var mt=xt.get(A);if(mt)return mt==L;le|=a,xt.set(A,L);var Gn=WI(jt(A),jt(L),le,it,Re,xt);return xt.delete(A),Gn;case D:if(Vy)return Vy.call(A)==Vy.call(L)}return!1}function Zre(A,L,W,le,it,Re){var xt=W&i,jt=YI(A),Yt=jt.length,mt=YI(L),Gn=mt.length;if(Yt!=Gn&&!xt)return!1;for(var Nr=Yt;Nr--;){var on=jt[Nr];if(!(xt?on in L:Ee.call(L,on)))return!1}var cr=Re.get(A);if(cr&&Re.get(L))return cr==L;var dr=!0;Re.set(A,L),Re.set(L,A);for(var Oa=xt;++Nr<Yt;){on=jt[Nr];var Ai=A[on],Eo=L[on];if(le)var ZI=xt?le(Eo,Ai,on,L,A,Re):le(Ai,Eo,on,A,L,Re);if(!(ZI===void 0?Ai===Eo||it(Ai,Eo,W,le,Re):ZI)){dr=!1;break}Oa||(Oa=on=="constructor")}if(dr&&!Oa){var oh=A.constructor,sh=L.constructor;oh!=sh&&"constructor"in A&&"constructor"in L&&!(typeof oh=="function"&&oh instanceof oh&&typeof sh=="function"&&sh instanceof sh)&&(dr=!1)}return Re.delete(A),Re.delete(L),dr}function YI(A){return Yre(A,uie,eie)}function ih(A,L){var W=A.__data__;return nie(L)?W[typeof L=="string"?"string":"hash"]:W.map}function Ks(A,L){var W=Aa(A,L);return Gre(W)?W:void 0}function Jre(A){var L=Ee.call(A,Ci),W=A[Ci];try{A[Ci]=void 0;var le=!0}catch{}var it=Nn.call(A);return le&&(L?A[Ci]=W:delete A[Ci]),it}var eie=zI?function(A){return A==null?[]:(A=Object(A),ze(zI(A),function(L){return qn.call(A,L)}))}:cie,Ia=pc;(jy&&Ia(new jy(new ArrayBuffer(1)))!=z||dc&&Ia(new dc)!=g||Uy&&Ia(Uy.resolve())!=b||zy&&Ia(new zy)!=S||Hy&&Ia(new Hy)!=N)&&(Ia=function(A){var L=pc(A),W=L==v?A.constructor:void 0,le=W?xo(W):"";if(le)switch(le){case yre:return z;case vre:return g;case bre:return b;case xre:return S;case Ere:return N}return L});function tie(A,L){return L=L??o,!!L&&(typeof A=="number"||Pe.test(A))&&A>-1&&A%1==0&&A<L}function nie(A){var L=typeof A;return L=="string"||L=="number"||L=="symbol"||L=="boolean"?A!=="__proto__":A===null}function rie(A){return!!Bt&&Bt in A}function iie(A){var L=A&&A.constructor,W=typeof L=="function"&&L.prototype||q;return A===W}function aie(A){return Nn.call(A)}function xo(A){if(A!=null){try{return _e.call(A)}catch{}try{return A+""}catch{}}return""}function qI(A,L){return A===L||A!==A&&L!==L}var oie=VI(function(){return arguments}())?VI:function(A){return hc(A)&&Ee.call(A,"callee")&&!qn.call(A,"callee")},ah=Array.isArray;function sie(A){return A!=null&&KI(A.length)&&!GI(A)}var $y=gre||die;function lie(A,L){return $I(A,L)}function GI(A){if(!XI(A))return!1;var L=pc(A);return L==p||L==m||L==u||L==E}function KI(A){return typeof A=="number"&&A>-1&&A%1==0&&A<=o}function XI(A){var L=typeof A;return A!=null&&(L=="object"||L=="function")}function hc(A){return A!=null&&typeof A=="object"}var QI=Ye?Le(Ye):Kre;function uie(A){return sie(A)?Wre(A):Xre(A)}function cie(){return[]}function die(){return!1}e.exports=lie}(dd,dd.exports);var JF=dd.exports;const e9=Da(JF);class fd{constructor(t){ce(this,"subscribers",new Set);Wy(this,Qr);ce(this,"initialState");Wy(this,Gs);ce(this,"lifecycleListeners",new Map);ce(this,"emitLifecycle",(t,n)=>{const r=this.lifecycleListeners.get(t);if(r){const i={type:t,timestamp:Date.now(),data:n};r.forEach(a=>{try{a(i)}catch{}})}});ce(this,"notifySubscribers",t=>{Array.from(this.subscribers).forEach(r=>{try{r(t)}catch(i){this.emitLifecycle("error",{error:i})}})});ce(this,"subscribe",t=>(this.subscribers.add(t),()=>{this.subscribers.delete(t)}));ce(this,"onLifecycle",(t,n)=>{this.lifecycleListeners.has(t)||this.lifecycleListeners.set(t,new Set);const r=this.lifecycleListeners.get(t);return r.add(n),()=>{r.delete(n),r.size===0&&this.lifecycleListeners.delete(t)}});ce(this,"get",()=>To(this,Qr));ce(this,"set",t=>{this.emitLifecycle("beforeUpdate",{previousState:To(this,Qr),nextState:t}),e9(To(this,Qr),t)||(mc(this,Qr,t),mc(this,Gs,Date.now()),this.emitLifecycle("stateChange",{state:t}),this.notifySubscribers(t)),this.emitLifecycle("afterUpdate",{state:t})});ce(this,"setPartial",t=>{if(t==null)return;const n={...To(this,Qr),...t};this.set(n)});ce(this,"clear",()=>{this.emitLifecycle("destroy"),this.subscribers=new Set,this.lifecycleListeners=new Map});ce(this,"reset",()=>{this.set(this.initialState)});ce(this,"lastUpdated",()=>To(this,Gs));mc(this,Qr,t),this.initialState=t,mc(this,Gs,Date.now()),this.emitLifecycle("init",{initialState:To(this,Qr)})}}Qr=new WeakMap,Gs=new WeakMap;class t9{constructor({config:t,api:n}){ce(this,"config");ce(this,"api");ce(this,"state");ce(this,"shouldCollectData",()=>{var n;return!!(!((n=this.state.get().contact)!=null&&n.token)&&this.config.collectUserData)});ce(this,"autoCreateUnverifiedUser",async()=>{var t,n;await this.createUnverifiedContact({name:((t=this.config.user)==null?void 0:t.name)||"Anonymous",email:(n=this.config.user)==null?void 0:n.email})});ce(this,"createUnverifiedContact",async t=>{try{this.state.setPartial({isCreatingUnverifiedContact:!0,isErrorCreatingUnverifiedContact:!1});const{data:n}=await this.api.createUnverifiedContact(t);n!=null&&n.token?(this.state.setPartial({contact:{token:n.token}}),this.api.setAuthToken(n.token)):this.state.setPartial({isErrorCreatingUnverifiedContact:!0})}finally{this.state.setPartial({isCreatingUnverifiedContact:!1})}});this.config=t,this.api=n,this.state=new fd({contact:t.contactToken?{token:t.contactToken}:null,isCreatingUnverifiedContact:!1,isErrorCreatingUnverifiedContact:!1}),!t.contactToken&&!t.collectUserData&&this.autoCreateUnverifiedUser()}}class KT{constructor(){ce(this,"state",new fd({isPolling:!1,isError:!1}));ce(this,"abortController",new AbortController);ce(this,"reset",()=>{var t;this.abortController.abort("Resetting poller"),(t=this.stopPolling)==null||t.call(this),this.stopPolling=null});ce(this,"stopPolling",null);ce(this,"startPolling",(t,n)=>{if(this.stopPolling)return;const r=[],i=async()=>{this.abortController=new AbortController,this.state.setPartial({isPolling:!0});try{await t(this.abortController.signal)}catch(a){if(this.abortController.signal.aborted)return;console.error("Failed to poll:",a),this.state.setPartial({isError:!0})}finally{this.state.setPartial({isPolling:!1})}this.abortController.signal.aborted?console.log("Poller aborted, not scheduling anymore"):r.push(setTimeout(i,n))};i(),this.stopPolling=()=>{r.forEach(clearTimeout),this.state.reset()}})}}const zt=[];for(let e=0;e<256;++e)zt.push((e+256).toString(16).slice(1));function n9(e,t=0){return(zt[e[t+0]]+zt[e[t+1]]+zt[e[t+2]]+zt[e[t+3]]+"-"+zt[e[t+4]]+zt[e[t+5]]+"-"+zt[e[t+6]]+zt[e[t+7]]+"-"+zt[e[t+8]]+zt[e[t+9]]+"-"+zt[e[t+10]]+zt[e[t+11]]+zt[e[t+12]]+zt[e[t+13]]+zt[e[t+14]]+zt[e[t+15]]).toLowerCase()}let Qm;const r9=new Uint8Array(16);function i9(){if(!Qm){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Qm=crypto.getRandomValues.bind(crypto)}return Qm(r9)}const XT={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function QT(e,t,n){var i;if(XT.randomUUID&&!t&&!e)return XT.randomUUID();e=e||{};const r=e.random??((i=e.rng)==null?void 0:i.call(e))??i9();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,n9(r)}function pd(){return QT()}class a9{constructor(t){ce(this,"api");ce(this,"poller",new KT);ce(this,"state",new fd({session:null,isCreatingSession:!1}));ce(this,"reset",async()=>{this.state.reset(),this.poller.reset()});ce(this,"registerPolling",()=>{this.state.subscribe(({session:t})=>{t!=null&&t.id?this.poller.startPolling(async n=>{const{data:r}=await this.fetch(t.id,n);r&&this.state.setPartial({session:r})},1e3):this.poller.reset()})});ce(this,"createSession",async()=>{this.state.setPartial({session:null,isCreatingSession:!0});const{data:t,error:n}=await this.api.createSession();return t?(this.state.setPartial({session:t,isCreatingSession:!1}),t):(console.error("Failed to create session:",n),null)});ce(this,"fetch",async(t,n)=>this.api.getSession({sessionId:t,abortSignal:n}));this.api=t,this.registerPolling()}}class Bo{constructor({config:t,api:n,sessionCtx:r}){ce(this,"config");ce(this,"api");ce(this,"sessionCtx");ce(this,"poller",new KT);ce(this,"state",new fd({messages:[],isSendingMessage:!1,suggestedReplies:null}));ce(this,"sendMessageAbortController",new AbortController);ce(this,"reset",()=>{this.sendMessageAbortController.abort("Resetting chat"),this.state.reset(),this.poller.reset()});ce(this,"registerPolling",()=>{this.sessionCtx.state.subscribe(({session:t})=>{t!=null&&t.id?this.poller.startPolling(async n=>{await this.fetchAndSetHistory(t.id,n)},1e3):this.poller.reset()})});ce(this,"sendMessage",async t=>{var i,a,o,s,l,u;this.sendMessageAbortController=new AbortController;const n=this.state.get().isSendingMessage,r=((i=this.sessionCtx.state.get().session)==null?void 0:i.assignee.kind)==="ai";if(n&&r){console.warn("Cannot send messages while awaiting AI response");return}this.state.setPartial({suggestedReplies:null});try{this.state.setPartial({isSendingMessage:!0});const c=Bo.toUserMessage(t.content,t.attachments||void 0),d=this.state.get().messages;if(this.state.setPartial({messages:[...d,c]}),!((a=this.sessionCtx.state.get().session)!=null&&a.id)&&!await this.sessionCtx.createSession()){console.error("Failed to create session");return}const f=(o=this.sessionCtx.state.get().session)==null?void 0:o.id;if(!f)return;const{data:p}=await this.api.sendMessage({uuid:c.id,bot_token:this.config.token,headers:this.config.headers,query_params:this.config.queryParams,session_id:f,user:this.config.user,...t},this.sendMessageAbortController.signal);if(p!=null&&p.success){const m=Bo.toBotMessage(p);if(m){const g=this.state.get().messages;if(!!g.some(w=>w.id===m.id))return;this.state.setPartial({messages:[...g,m]})}else(s=p.options)!=null&&s.value&&((l=p.options)==null?void 0:l.value.length)>0&&this.state.setPartial({suggestedReplies:p.options.value})}else{const m=Bo.toErrorMessage(((u=p==null?void 0:p.error)==null?void 0:u.message)||"Unknown error occurred"),g=this.state.get().messages;this.state.setPartial({messages:[...g,m]})}}catch(c){this.sendMessageAbortController.signal.aborted||console.error("Failed to send message:",c)}finally{this.state.setPartial({isSendingMessage:!1})}});ce(this,"fetchAndSetHistory",async(t,n)=>{var a;const r=(a=this.state.get().messages.at(-1))==null?void 0:a.timestamp,{data:i}=await this.api.getSessionHistory({sessionId:t,lastMessageTimestamp:r,abortSignal:n});if(i&&i.length>0){const o=this.state.get().messages,s=i.map(Bo.mapHistoryToMessage).filter(l=>!o.some(u=>u.id===l.id));this.state.setPartial({messages:[...o,...s]})}});this.config=t,this.api=n,this.sessionCtx=r,this.registerPolling()}static mapHistoryToMessage(t){const n={id:t.publicId,timestamp:t.sentAt||"",attachments:t.attachments||void 0};return t.sender.kind==="user"?{...n,type:"FROM_USER",content:t.content.text||"",deliveredAt:t.sentAt||""}:t.sender.kind==="agent"?{...n,type:"FROM_AGENT",component:"agent_message",data:{message:t.content.text||""}}:{...n,type:"FROM_BOT",component:"bot_message",agent:{id:null,name:t.sender.name||"",isAi:t.sender.kind==="ai",avatar:t.sender.avatar||null},data:{message:t.content.text}}}static toUserMessage(t,n){return{id:pd(),type:"FROM_USER",content:t,deliveredAt:new Date().toISOString(),attachments:n,timestamp:new Date().toISOString()}}static toBotMessage(t){if(t.success&&t.autopilotResponse)return{type:"FROM_BOT",id:t.autopilotResponse.id||pd(),timestamp:new Date().toISOString(),component:"bot_message",data:{message:t.autopilotResponse.value.content}};if(t.success&&t.uiResponse){const n=t.uiResponse.value;return{type:"FROM_BOT",id:pd(),timestamp:new Date().toISOString(),component:n.name,data:n.request_response}}return null}static toErrorMessage(t){return{type:"FROM_BOT",id:pd(),timestamp:new Date().toISOString(),component:"TEXT",data:{message:t,variant:"error"}}}}class o9{constructor({config:t}){ce(this,"config");ce(this,"api");ce(this,"contactCtx");ce(this,"sessionCtx");ce(this,"messageCtx");ce(this,"resetChat",()=>{this.sessionCtx.reset(),this.messageCtx.reset()});this.config=t,this.api=new ZF({config:t}),this.contactCtx=new t9({api:this.api,config:this.config}),this.sessionCtx=new a9(this.api),this.messageCtx=new Bo({config:this.config,api:this.api,sessionCtx:this.sessionCtx})}}const[Qn,s9]=y8();function l9({options:e,children:t,components:n}){const r=y.useMemo(()=>new o9({config:e}),[e]),i=y.useMemo(()=>new w8({components:n}),[n]);return T.jsx(s9,{value:{widgetCtx:r,components:n,componentStore:i,version:ov},children:t})}function bl(){const{widgetCtx:e}=Qn();return e.config}function Zm(e){return y.useSyncExternalStore(e.subscribe,e.get,e.get)}function ZT(){const{widgetCtx:e}=Qn();return{contactState:Zm(e.contactCtx.state),contactCtx:e.contactCtx}}function hd(){const{widgetCtx:e}=Qn();return{messagesState:Zm(e.messageCtx.state),messageCtx:e.messageCtx}}function md(){const{widgetCtx:e}=Qn();return{sessionState:Zm(e.sessionCtx.state),sessionCtx:e.sessionCtx}}function JT(){var r;const{sessionState:e}=md(),{messagesState:t}=hd();return{isAwaitingBotReply:(!((r=e.session)!=null&&r.isHandedOff)||e.session.assignee.kind==="ai"||e.isCreatingSession)&&t.isSendingMessage}}var e2={exports:{}},t2={};/**
|
|
301
301
|
* @license React
|
|
302
302
|
* use-sync-external-store-shim.production.min.js
|
|
303
303
|
*
|
|
@@ -328,7 +328,7 @@ to {
|
|
|
328
328
|
`+i[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=s);break}}}finally{Cg=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Cl(e):""}function s7(e){switch(e.tag){case 5:return Cl(e.type);case 16:return Cl("Lazy");case 13:return Cl("Suspense");case 19:return Cl("SuspenseList");case 0:case 2:case 15:return e=kg(e.type,!1),e;case 11:return e=kg(e.type.render,!1),e;case 1:return e=kg(e.type,!0),e;default:return""}}function Ag(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ho:return"Fragment";case zo:return"Portal";case bg:return"Profiler";case vg:return"StrictMode";case Eg:return"Suspense";case Tg:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case T2:return(e.displayName||"Context")+".Consumer";case E2:return(e._context.displayName||"Context")+".Provider";case xg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case _g:return t=e.displayName||null,t!==null?t:Ag(e.type)||"Memo";case zi:t=e._payload,e=e._init;try{return Ag(e(t))}catch{}}return null}function l7(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ag(t);case 8:return t===vg?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Hi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function C2(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function u7(e){var t=C2(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function xd(e){e._valueTracker||(e._valueTracker=u7(e))}function k2(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=C2(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ed(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Rg(e,t){var n=t.checked;return dt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function A2(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Hi(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function R2(e,t){t=t.checked,t!=null&&yg(e,"checked",t,!1)}function Ng(e,t){R2(e,t);var n=Hi(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Pg(e,t.type,n):t.hasOwnProperty("defaultValue")&&Pg(e,t.type,Hi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function N2(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Pg(e,t,n){(t!=="number"||Ed(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var kl=Array.isArray;function Vo(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Hi(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Ig(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Q(91));return dt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function P2(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(Q(92));if(kl(n)){if(1<n.length)throw Error(Q(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Hi(n)}}function I2(e,t){var n=Hi(t.value),r=Hi(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function O2(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function D2(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Og(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?D2(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Td,L2=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Td=Td||document.createElement("div"),Td.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Td.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Al(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Rl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},c7=["Webkit","ms","Moz","O"];Object.keys(Rl).forEach(function(e){c7.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Rl[t]=Rl[e]})});function M2(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Rl.hasOwnProperty(e)&&Rl[e]?(""+t).trim():t+"px"}function F2(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=M2(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var d7=dt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Dg(e,t){if(t){if(d7[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Q(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Q(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Q(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Q(62))}}function Lg(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Mg=null;function Fg(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Bg=null,$o=null,Wo=null;function B2(e){if(e=Ql(e)){if(typeof Bg!="function")throw Error(Q(280));var t=e.stateNode;t&&(t=Yd(t),Bg(e.stateNode,e.type,t))}}function j2(e){$o?Wo?Wo.push(e):Wo=[e]:$o=e}function U2(){if($o){var e=$o,t=Wo;if(Wo=$o=null,B2(e),t)for(e=0;e<t.length;e++)B2(t[e])}}function z2(e,t){return e(t)}function H2(){}var jg=!1;function V2(e,t,n){if(jg)return e(t,n);jg=!0;try{return z2(e,t,n)}finally{jg=!1,($o!==null||Wo!==null)&&(H2(),U2())}}function Nl(e,t){var n=e.stateNode;if(n===null)return null;var r=Yd(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(Q(231,t,typeof n));return n}var Ug=!1;if(li)try{var Pl={};Object.defineProperty(Pl,"passive",{get:function(){Ug=!0}}),window.addEventListener("test",Pl,Pl),window.removeEventListener("test",Pl,Pl)}catch{Ug=!1}function f7(e,t,n,r,i,a,o,s,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var Il=!1,_d=null,Sd=!1,zg=null,p7={onError:function(e){Il=!0,_d=e}};function h7(e,t,n,r,i,a,o,s,l){Il=!1,_d=null,f7.apply(p7,arguments)}function m7(e,t,n,r,i,a,o,s,l){if(h7.apply(this,arguments),Il){if(Il){var u=_d;Il=!1,_d=null}else throw Error(Q(198));Sd||(Sd=!0,zg=u)}}function Ya(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function $2(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function W2(e){if(Ya(e)!==e)throw Error(Q(188))}function g7(e){var t=e.alternate;if(!t){if(t=Ya(e),t===null)throw Error(Q(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return W2(i),e;if(a===r)return W2(i),t;a=a.sibling}throw Error(Q(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,s=i.child;s;){if(s===n){o=!0,n=i,r=a;break}if(s===r){o=!0,r=i,n=a;break}s=s.sibling}if(!o){for(s=a.child;s;){if(s===n){o=!0,n=a,r=i;break}if(s===r){o=!0,r=a,n=i;break}s=s.sibling}if(!o)throw Error(Q(189))}}if(n.alternate!==r)throw Error(Q(190))}if(n.tag!==3)throw Error(Q(188));return n.stateNode.current===n?e:t}function Y2(e){return e=g7(e),e!==null?q2(e):null}function q2(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=q2(e);if(t!==null)return t;e=e.sibling}return null}var G2=Mn.unstable_scheduleCallback,K2=Mn.unstable_cancelCallback,w7=Mn.unstable_shouldYield,y7=Mn.unstable_requestPaint,Tt=Mn.unstable_now,v7=Mn.unstable_getCurrentPriorityLevel,Hg=Mn.unstable_ImmediatePriority,X2=Mn.unstable_UserBlockingPriority,Cd=Mn.unstable_NormalPriority,b7=Mn.unstable_LowPriority,Q2=Mn.unstable_IdlePriority,kd=null,Fr=null;function x7(e){if(Fr&&typeof Fr.onCommitFiberRoot=="function")try{Fr.onCommitFiberRoot(kd,e,void 0,(e.current.flags&128)===128)}catch{}}var gr=Math.clz32?Math.clz32:_7,E7=Math.log,T7=Math.LN2;function _7(e){return e>>>=0,e===0?32:31-(E7(e)/T7|0)|0}var Ad=64,Rd=4194304;function Ol(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Nd(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s!==0?r=Ol(s):(a&=o,a!==0&&(r=Ol(a)))}else o=n&~i,o!==0?r=Ol(o):a!==0&&(r=Ol(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-gr(t),i=1<<n,r|=e[n],t&=~i;return r}function S7(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function C7(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-gr(a),s=1<<o,l=i[o];l===-1?(!(s&n)||s&r)&&(i[o]=S7(s,t)):l<=t&&(e.expiredLanes|=s),a&=~s}}function Vg(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Z2(){var e=Ad;return Ad<<=1,!(Ad&4194240)&&(Ad=64),e}function $g(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Dl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-gr(t),e[t]=n}function k7(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-gr(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function Wg(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-gr(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var qe=0;function J2(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var e_,Yg,t_,n_,r_,qg=!1,Pd=[],Vi=null,$i=null,Wi=null,Ll=new Map,Ml=new Map,Yi=[],A7="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function i_(e,t){switch(e){case"focusin":case"focusout":Vi=null;break;case"dragenter":case"dragleave":$i=null;break;case"mouseover":case"mouseout":Wi=null;break;case"pointerover":case"pointerout":Ll.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ml.delete(t.pointerId)}}function Fl(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ql(t),t!==null&&Yg(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function R7(e,t,n,r,i){switch(t){case"focusin":return Vi=Fl(Vi,e,t,n,r,i),!0;case"dragenter":return $i=Fl($i,e,t,n,r,i),!0;case"mouseover":return Wi=Fl(Wi,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return Ll.set(a,Fl(Ll.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,Ml.set(a,Fl(Ml.get(a)||null,e,t,n,r,i)),!0}return!1}function a_(e){var t=qa(e.target);if(t!==null){var n=Ya(t);if(n!==null){if(t=n.tag,t===13){if(t=$2(n),t!==null){e.blockedOn=t,r_(e.priority,function(){t_(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Id(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Kg(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Mg=r,n.target.dispatchEvent(r),Mg=null}else return t=Ql(n),t!==null&&Yg(t),e.blockedOn=n,!1;t.shift()}return!0}function o_(e,t,n){Id(e)&&n.delete(t)}function N7(){qg=!1,Vi!==null&&Id(Vi)&&(Vi=null),$i!==null&&Id($i)&&($i=null),Wi!==null&&Id(Wi)&&(Wi=null),Ll.forEach(o_),Ml.forEach(o_)}function Bl(e,t){e.blockedOn===t&&(e.blockedOn=null,qg||(qg=!0,Mn.unstable_scheduleCallback(Mn.unstable_NormalPriority,N7)))}function jl(e){function t(i){return Bl(i,e)}if(0<Pd.length){Bl(Pd[0],e);for(var n=1;n<Pd.length;n++){var r=Pd[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Vi!==null&&Bl(Vi,e),$i!==null&&Bl($i,e),Wi!==null&&Bl(Wi,e),Ll.forEach(t),Ml.forEach(t),n=0;n<Yi.length;n++)r=Yi[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Yi.length&&(n=Yi[0],n.blockedOn===null);)a_(n),n.blockedOn===null&&Yi.shift()}var Yo=ui.ReactCurrentBatchConfig,Od=!0;function P7(e,t,n,r){var i=qe,a=Yo.transition;Yo.transition=null;try{qe=1,Gg(e,t,n,r)}finally{qe=i,Yo.transition=a}}function I7(e,t,n,r){var i=qe,a=Yo.transition;Yo.transition=null;try{qe=4,Gg(e,t,n,r)}finally{qe=i,Yo.transition=a}}function Gg(e,t,n,r){if(Od){var i=Kg(e,t,n,r);if(i===null)f0(e,t,r,Dd,n),i_(e,r);else if(R7(i,e,t,n,r))r.stopPropagation();else if(i_(e,r),t&4&&-1<A7.indexOf(e)){for(;i!==null;){var a=Ql(i);if(a!==null&&e_(a),a=Kg(e,t,n,r),a===null&&f0(e,t,r,Dd,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else f0(e,t,r,null,n)}}var Dd=null;function Kg(e,t,n,r){if(Dd=null,e=Fg(r),e=qa(e),e!==null)if(t=Ya(e),t===null)e=null;else if(n=t.tag,n===13){if(e=$2(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Dd=e,null}function s_(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(v7()){case Hg:return 1;case X2:return 4;case Cd:case b7:return 16;case Q2:return 536870912;default:return 16}default:return 16}}var qi=null,Xg=null,Ld=null;function l_(){if(Ld)return Ld;var e,t=Xg,n=t.length,r,i="value"in qi?qi.value:qi.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Ld=i.slice(e,1<r?1-r:void 0)}function Md(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Fd(){return!0}function u_(){return!1}function Fn(e){function t(n,r,i,a,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(n=e[s],this[s]=n?n(a):a[s]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Fd:u_,this.isPropagationStopped=u_,this}return dt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Fd)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Fd)},persist:function(){},isPersistent:Fd}),t}var qo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qg=Fn(qo),Ul=dt({},qo,{view:0,detail:0}),O7=Fn(Ul),Zg,Jg,zl,Bd=dt({},Ul,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:t0,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==zl&&(zl&&e.type==="mousemove"?(Zg=e.screenX-zl.screenX,Jg=e.screenY-zl.screenY):Jg=Zg=0,zl=e),Zg)},movementY:function(e){return"movementY"in e?e.movementY:Jg}}),c_=Fn(Bd),D7=dt({},Bd,{dataTransfer:0}),L7=Fn(D7),M7=dt({},Ul,{relatedTarget:0}),e0=Fn(M7),F7=dt({},qo,{animationName:0,elapsedTime:0,pseudoElement:0}),B7=Fn(F7),j7=dt({},qo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),U7=Fn(j7),z7=dt({},qo,{data:0}),d_=Fn(z7),H7={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},V7={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},$7={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function W7(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=$7[e])?!!t[e]:!1}function t0(){return W7}var Y7=dt({},Ul,{key:function(e){if(e.key){var t=H7[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Md(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?V7[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:t0,charCode:function(e){return e.type==="keypress"?Md(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Md(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),q7=Fn(Y7),G7=dt({},Bd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),f_=Fn(G7),K7=dt({},Ul,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:t0}),X7=Fn(K7),Q7=dt({},qo,{propertyName:0,elapsedTime:0,pseudoElement:0}),Z7=Fn(Q7),J7=dt({},Bd,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),eB=Fn(J7),tB=[9,13,27,32],n0=li&&"CompositionEvent"in window,Hl=null;li&&"documentMode"in document&&(Hl=document.documentMode);var nB=li&&"TextEvent"in window&&!Hl,p_=li&&(!n0||Hl&&8<Hl&&11>=Hl),h_=" ",m_=!1;function g_(e,t){switch(e){case"keyup":return tB.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function w_(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Go=!1;function rB(e,t){switch(e){case"compositionend":return w_(t);case"keypress":return t.which!==32?null:(m_=!0,h_);case"textInput":return e=t.data,e===h_&&m_?null:e;default:return null}}function iB(e,t){if(Go)return e==="compositionend"||!n0&&g_(e,t)?(e=l_(),Ld=Xg=qi=null,Go=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return p_&&t.locale!=="ko"?null:t.data;default:return null}}var aB={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function y_(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!aB[e.type]:t==="textarea"}function v_(e,t,n,r){j2(r),t=Vd(t,"onChange"),0<t.length&&(n=new Qg("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Vl=null,$l=null;function oB(e){F_(e,0)}function jd(e){var t=Jo(e);if(k2(t))return e}function sB(e,t){if(e==="change")return t}var b_=!1;if(li){var r0;if(li){var i0="oninput"in document;if(!i0){var x_=document.createElement("div");x_.setAttribute("oninput","return;"),i0=typeof x_.oninput=="function"}r0=i0}else r0=!1;b_=r0&&(!document.documentMode||9<document.documentMode)}function E_(){Vl&&(Vl.detachEvent("onpropertychange",T_),$l=Vl=null)}function T_(e){if(e.propertyName==="value"&&jd($l)){var t=[];v_(t,$l,e,Fg(e)),V2(oB,t)}}function lB(e,t,n){e==="focusin"?(E_(),Vl=t,$l=n,Vl.attachEvent("onpropertychange",T_)):e==="focusout"&&E_()}function uB(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return jd($l)}function cB(e,t){if(e==="click")return jd(t)}function dB(e,t){if(e==="input"||e==="change")return jd(t)}function fB(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var wr=typeof Object.is=="function"?Object.is:fB;function Wl(e,t){if(wr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!mg.call(t,i)||!wr(e[i],t[i]))return!1}return!0}function __(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function S_(e,t){var n=__(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=__(n)}}function C_(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?C_(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function k_(){for(var e=window,t=Ed();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ed(e.document)}return t}function a0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function pB(e){var t=k_(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&C_(n.ownerDocument.documentElement,n)){if(r!==null&&a0(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=S_(n,a);var o=S_(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var hB=li&&"documentMode"in document&&11>=document.documentMode,Ko=null,o0=null,Yl=null,s0=!1;function A_(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;s0||Ko==null||Ko!==Ed(r)||(r=Ko,"selectionStart"in r&&a0(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Yl&&Wl(Yl,r)||(Yl=r,r=Vd(o0,"onSelect"),0<r.length&&(t=new Qg("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Ko)))}function Ud(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Xo={animationend:Ud("Animation","AnimationEnd"),animationiteration:Ud("Animation","AnimationIteration"),animationstart:Ud("Animation","AnimationStart"),transitionend:Ud("Transition","TransitionEnd")},l0={},R_={};li&&(R_=document.createElement("div").style,"AnimationEvent"in window||(delete Xo.animationend.animation,delete Xo.animationiteration.animation,delete Xo.animationstart.animation),"TransitionEvent"in window||delete Xo.transitionend.transition);function zd(e){if(l0[e])return l0[e];if(!Xo[e])return e;var t=Xo[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in R_)return l0[e]=t[n];return e}var N_=zd("animationend"),P_=zd("animationiteration"),I_=zd("animationstart"),O_=zd("transitionend"),D_=new Map,L_="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Gi(e,t){D_.set(e,t),Wa(t,[e])}for(var u0=0;u0<L_.length;u0++){var c0=L_[u0],mB=c0.toLowerCase(),gB=c0[0].toUpperCase()+c0.slice(1);Gi(mB,"on"+gB)}Gi(N_,"onAnimationEnd"),Gi(P_,"onAnimationIteration"),Gi(I_,"onAnimationStart"),Gi("dblclick","onDoubleClick"),Gi("focusin","onFocus"),Gi("focusout","onBlur"),Gi(O_,"onTransitionEnd"),Uo("onMouseEnter",["mouseout","mouseover"]),Uo("onMouseLeave",["mouseout","mouseover"]),Uo("onPointerEnter",["pointerout","pointerover"]),Uo("onPointerLeave",["pointerout","pointerover"]),Wa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Wa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Wa("onBeforeInput",["compositionend","keypress","textInput","paste"]),Wa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Wa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Wa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ql="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),wB=new Set("cancel close invalid load scroll toggle".split(" ").concat(ql));function M_(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,m7(r,t,void 0,e),e.currentTarget=null}function F_(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==a&&i.isPropagationStopped())break e;M_(i,s,u),a=l}else for(o=0;o<r.length;o++){if(s=r[o],l=s.instance,u=s.currentTarget,s=s.listener,l!==a&&i.isPropagationStopped())break e;M_(i,s,u),a=l}}}if(Sd)throw e=zg,Sd=!1,zg=null,e}function tt(e,t){var n=t[y0];n===void 0&&(n=t[y0]=new Set);var r=e+"__bubble";n.has(r)||(B_(t,e,2,!1),n.add(r))}function d0(e,t,n){var r=0;t&&(r|=4),B_(n,e,r,t)}var Hd="_reactListening"+Math.random().toString(36).slice(2);function Gl(e){if(!e[Hd]){e[Hd]=!0,v2.forEach(function(n){n!=="selectionchange"&&(wB.has(n)||d0(n,!1,e),d0(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hd]||(t[Hd]=!0,d0("selectionchange",!1,t))}}function B_(e,t,n,r){switch(s_(t)){case 1:var i=P7;break;case 4:i=I7;break;default:i=Gg}n=i.bind(null,t,n,e),i=void 0,!Ug||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function f0(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;s!==null;){if(o=qa(s),o===null)return;if(l=o.tag,l===5||l===6){r=a=o;continue e}s=s.parentNode}}r=r.return}V2(function(){var u=a,c=Fg(n),d=[];e:{var f=D_.get(e);if(f!==void 0){var p=Qg,m=e;switch(e){case"keypress":if(Md(n)===0)break e;case"keydown":case"keyup":p=q7;break;case"focusin":m="focus",p=e0;break;case"focusout":m="blur",p=e0;break;case"beforeblur":case"afterblur":p=e0;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=c_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=L7;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=X7;break;case N_:case P_:case I_:p=B7;break;case O_:p=Z7;break;case"scroll":p=O7;break;case"wheel":p=eB;break;case"copy":case"cut":case"paste":p=U7;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=f_}var g=(t&4)!==0,x=!g&&e==="scroll",w=g?f!==null?f+"Capture":null:f;g=[];for(var v=u,b;v!==null;){b=v;var E=b.stateNode;if(b.tag===5&&E!==null&&(b=E,w!==null&&(E=Nl(v,w),E!=null&&g.push(Kl(v,E,b)))),x)break;v=v.return}0<g.length&&(f=new p(f,m,null,n,c),d.push({event:f,listeners:g}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&n!==Mg&&(m=n.relatedTarget||n.fromElement)&&(qa(m)||m[ci]))break e;if((p||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=u,m=m?qa(m):null,m!==null&&(x=Ya(m),m!==x||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=u),p!==m)){if(g=c_,E="onMouseLeave",w="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(g=f_,E="onPointerLeave",w="onPointerEnter",v="pointer"),x=p==null?f:Jo(p),b=m==null?f:Jo(m),f=new g(E,v+"leave",p,n,c),f.target=x,f.relatedTarget=b,E=null,qa(c)===u&&(g=new g(w,v+"enter",m,n,c),g.target=b,g.relatedTarget=x,E=g),x=E,p&&m)t:{for(g=p,w=m,v=0,b=g;b;b=Qo(b))v++;for(b=0,E=w;E;E=Qo(E))b++;for(;0<v-b;)g=Qo(g),v--;for(;0<b-v;)w=Qo(w),b--;for(;v--;){if(g===w||w!==null&&g===w.alternate)break t;g=Qo(g),w=Qo(w)}g=null}else g=null;p!==null&&j_(d,f,p,g,!1),m!==null&&x!==null&&j_(d,x,m,g,!0)}}e:{if(f=u?Jo(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var _=sB;else if(y_(f))if(b_)_=dB;else{_=uB;var S=lB}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(_=cB);if(_&&(_=_(e,u))){v_(d,_,n,c);break e}S&&S(e,f,u),e==="focusout"&&(S=f._wrapperState)&&S.controlled&&f.type==="number"&&Pg(f,"number",f.value)}switch(S=u?Jo(u):window,e){case"focusin":(y_(S)||S.contentEditable==="true")&&(Ko=S,o0=u,Yl=null);break;case"focusout":Yl=o0=Ko=null;break;case"mousedown":s0=!0;break;case"contextmenu":case"mouseup":case"dragend":s0=!1,A_(d,n,c);break;case"selectionchange":if(hB)break;case"keydown":case"keyup":A_(d,n,c)}var I;if(n0)e:{switch(e){case"compositionstart":var D="onCompositionStart";break e;case"compositionend":D="onCompositionEnd";break e;case"compositionupdate":D="onCompositionUpdate";break e}D=void 0}else Go?g_(e,n)&&(D="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(D="onCompositionStart");D&&(p_&&n.locale!=="ko"&&(Go||D!=="onCompositionStart"?D==="onCompositionEnd"&&Go&&(I=l_()):(qi=c,Xg="value"in qi?qi.value:qi.textContent,Go=!0)),S=Vd(u,D),0<S.length&&(D=new d_(D,e,null,n,c),d.push({event:D,listeners:S}),I?D.data=I:(I=w_(n),I!==null&&(D.data=I)))),(I=nB?rB(e,n):iB(e,n))&&(u=Vd(u,"onBeforeInput"),0<u.length&&(c=new d_("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=I))}F_(d,t)})}function Kl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Vd(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=Nl(e,n),a!=null&&r.unshift(Kl(e,a,i)),a=Nl(e,t),a!=null&&r.push(Kl(e,a,i))),e=e.return}return r}function Qo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function j_(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,l=s.alternate,u=s.stateNode;if(l!==null&&l===r)break;s.tag===5&&u!==null&&(s=u,i?(l=Nl(n,a),l!=null&&o.unshift(Kl(n,l,s))):i||(l=Nl(n,a),l!=null&&o.push(Kl(n,l,s)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var yB=/\r\n?/g,vB=/\u0000|\uFFFD/g;function U_(e){return(typeof e=="string"?e:""+e).replace(yB,`
|
|
329
329
|
`).replace(vB,"")}function $d(e,t,n){if(t=U_(t),U_(e)!==t&&n)throw Error(Q(425))}function Wd(){}var p0=null,h0=null;function m0(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var g0=typeof setTimeout=="function"?setTimeout:void 0,bB=typeof clearTimeout=="function"?clearTimeout:void 0,z_=typeof Promise=="function"?Promise:void 0,xB=typeof queueMicrotask=="function"?queueMicrotask:typeof z_<"u"?function(e){return z_.resolve(null).then(e).catch(EB)}:g0;function EB(e){setTimeout(function(){throw e})}function w0(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),jl(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);jl(t)}function Ki(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function H_(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Zo=Math.random().toString(36).slice(2),Br="__reactFiber$"+Zo,Xl="__reactProps$"+Zo,ci="__reactContainer$"+Zo,y0="__reactEvents$"+Zo,TB="__reactListeners$"+Zo,_B="__reactHandles$"+Zo;function qa(e){var t=e[Br];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ci]||n[Br]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=H_(e);e!==null;){if(n=e[Br])return n;e=H_(e)}return t}e=n,n=e.parentNode}return null}function Ql(e){return e=e[Br]||e[ci],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Jo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Q(33))}function Yd(e){return e[Xl]||null}var v0=[],es=-1;function Xi(e){return{current:e}}function nt(e){0>es||(e.current=v0[es],v0[es]=null,es--)}function Je(e,t){es++,v0[es]=e.current,e.current=t}var Qi={},Qt=Xi(Qi),bn=Xi(!1),Ga=Qi;function ts(e,t){var n=e.type.contextTypes;if(!n)return Qi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function xn(e){return e=e.childContextTypes,e!=null}function qd(){nt(bn),nt(Qt)}function V_(e,t,n){if(Qt.current!==Qi)throw Error(Q(168));Je(Qt,t),Je(bn,n)}function $_(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(Q(108,l7(e)||"Unknown",i));return dt({},n,r)}function Gd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Qi,Ga=Qt.current,Je(Qt,e),Je(bn,bn.current),!0}function W_(e,t,n){var r=e.stateNode;if(!r)throw Error(Q(169));n?(e=$_(e,t,Ga),r.__reactInternalMemoizedMergedChildContext=e,nt(bn),nt(Qt),Je(Qt,e)):nt(bn),Je(bn,n)}var di=null,Kd=!1,b0=!1;function Y_(e){di===null?di=[e]:di.push(e)}function SB(e){Kd=!0,Y_(e)}function Zi(){if(!b0&&di!==null){b0=!0;var e=0,t=qe;try{var n=di;for(qe=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}di=null,Kd=!1}catch(i){throw di!==null&&(di=di.slice(e+1)),G2(Hg,Zi),i}finally{qe=t,b0=!1}}return null}var ns=[],rs=0,Xd=null,Qd=0,Zn=[],Jn=0,Ka=null,fi=1,pi="";function Xa(e,t){ns[rs++]=Qd,ns[rs++]=Xd,Xd=e,Qd=t}function q_(e,t,n){Zn[Jn++]=fi,Zn[Jn++]=pi,Zn[Jn++]=Ka,Ka=e;var r=fi;e=pi;var i=32-gr(r)-1;r&=~(1<<i),n+=1;var a=32-gr(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,fi=1<<32-gr(t)+i|n<<i|r,pi=a+e}else fi=1<<a|n<<i|r,pi=e}function x0(e){e.return!==null&&(Xa(e,1),q_(e,1,0))}function E0(e){for(;e===Xd;)Xd=ns[--rs],ns[rs]=null,Qd=ns[--rs],ns[rs]=null;for(;e===Ka;)Ka=Zn[--Jn],Zn[Jn]=null,pi=Zn[--Jn],Zn[Jn]=null,fi=Zn[--Jn],Zn[Jn]=null}var Bn=null,jn=null,st=!1,yr=null;function G_(e,t){var n=rr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function K_(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Bn=e,jn=Ki(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Bn=e,jn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ka!==null?{id:fi,overflow:pi}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=rr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Bn=e,jn=null,!0):!1;default:return!1}}function T0(e){return(e.mode&1)!==0&&(e.flags&128)===0}function _0(e){if(st){var t=jn;if(t){var n=t;if(!K_(e,t)){if(T0(e))throw Error(Q(418));t=Ki(n.nextSibling);var r=Bn;t&&K_(e,t)?G_(r,n):(e.flags=e.flags&-4097|2,st=!1,Bn=e)}}else{if(T0(e))throw Error(Q(418));e.flags=e.flags&-4097|2,st=!1,Bn=e}}}function X_(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Bn=e}function Zd(e){if(e!==Bn)return!1;if(!st)return X_(e),st=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!m0(e.type,e.memoizedProps)),t&&(t=jn)){if(T0(e))throw Q_(),Error(Q(418));for(;t;)G_(e,t),t=Ki(t.nextSibling)}if(X_(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Q(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){jn=Ki(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}jn=null}}else jn=Bn?Ki(e.stateNode.nextSibling):null;return!0}function Q_(){for(var e=jn;e;)e=Ki(e.nextSibling)}function is(){jn=Bn=null,st=!1}function S0(e){yr===null?yr=[e]:yr.push(e)}var CB=ui.ReactCurrentBatchConfig;function Zl(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(Q(309));var r=n.stateNode}if(!r)throw Error(Q(147,e));var i=r,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(o){var s=i.refs;o===null?delete s[a]:s[a]=o},t._stringRef=a,t)}if(typeof e!="string")throw Error(Q(284));if(!n._owner)throw Error(Q(290,e))}return e}function Jd(e,t){throw e=Object.prototype.toString.call(t),Error(Q(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Z_(e){var t=e._init;return t(e._payload)}function J_(e){function t(w,v){if(e){var b=w.deletions;b===null?(w.deletions=[v],w.flags|=16):b.push(v)}}function n(w,v){if(!e)return null;for(;v!==null;)t(w,v),v=v.sibling;return null}function r(w,v){for(w=new Map;v!==null;)v.key!==null?w.set(v.key,v):w.set(v.index,v),v=v.sibling;return w}function i(w,v){return w=oa(w,v),w.index=0,w.sibling=null,w}function a(w,v,b){return w.index=b,e?(b=w.alternate,b!==null?(b=b.index,b<v?(w.flags|=2,v):b):(w.flags|=2,v)):(w.flags|=1048576,v)}function o(w){return e&&w.alternate===null&&(w.flags|=2),w}function s(w,v,b,E){return v===null||v.tag!==6?(v=gw(b,w.mode,E),v.return=w,v):(v=i(v,b),v.return=w,v)}function l(w,v,b,E){var _=b.type;return _===Ho?c(w,v,b.props.children,E,b.key):v!==null&&(v.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===zi&&Z_(_)===v.type)?(E=i(v,b.props),E.ref=Zl(w,v,b),E.return=w,E):(E=_f(b.type,b.key,b.props,null,w.mode,E),E.ref=Zl(w,v,b),E.return=w,E)}function u(w,v,b,E){return v===null||v.tag!==4||v.stateNode.containerInfo!==b.containerInfo||v.stateNode.implementation!==b.implementation?(v=ww(b,w.mode,E),v.return=w,v):(v=i(v,b.children||[]),v.return=w,v)}function c(w,v,b,E,_){return v===null||v.tag!==7?(v=io(b,w.mode,E,_),v.return=w,v):(v=i(v,b),v.return=w,v)}function d(w,v,b){if(typeof v=="string"&&v!==""||typeof v=="number")return v=gw(""+v,w.mode,b),v.return=w,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case bd:return b=_f(v.type,v.key,v.props,null,w.mode,b),b.ref=Zl(w,null,v),b.return=w,b;case zo:return v=ww(v,w.mode,b),v.return=w,v;case zi:var E=v._init;return d(w,E(v._payload),b)}if(kl(v)||Sl(v))return v=io(v,w.mode,b,null),v.return=w,v;Jd(w,v)}return null}function f(w,v,b,E){var _=v!==null?v.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return _!==null?null:s(w,v,""+b,E);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case bd:return b.key===_?l(w,v,b,E):null;case zo:return b.key===_?u(w,v,b,E):null;case zi:return _=b._init,f(w,v,_(b._payload),E)}if(kl(b)||Sl(b))return _!==null?null:c(w,v,b,E,null);Jd(w,b)}return null}function p(w,v,b,E,_){if(typeof E=="string"&&E!==""||typeof E=="number")return w=w.get(b)||null,s(v,w,""+E,_);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case bd:return w=w.get(E.key===null?b:E.key)||null,l(v,w,E,_);case zo:return w=w.get(E.key===null?b:E.key)||null,u(v,w,E,_);case zi:var S=E._init;return p(w,v,b,S(E._payload),_)}if(kl(E)||Sl(E))return w=w.get(b)||null,c(v,w,E,_,null);Jd(v,E)}return null}function m(w,v,b,E){for(var _=null,S=null,I=v,D=v=0,V=null;I!==null&&D<b.length;D++){I.index>D?(V=I,I=null):V=I.sibling;var N=f(w,I,b[D],E);if(N===null){I===null&&(I=V);break}e&&I&&N.alternate===null&&t(w,I),v=a(N,v,D),S===null?_=N:S.sibling=N,S=N,I=V}if(D===b.length)return n(w,I),st&&Xa(w,D),_;if(I===null){for(;D<b.length;D++)I=d(w,b[D],E),I!==null&&(v=a(I,v,D),S===null?_=I:S.sibling=I,S=I);return st&&Xa(w,D),_}for(I=r(w,I);D<b.length;D++)V=p(I,w,D,b[D],E),V!==null&&(e&&V.alternate!==null&&I.delete(V.key===null?D:V.key),v=a(V,v,D),S===null?_=V:S.sibling=V,S=V);return e&&I.forEach(function($){return t(w,$)}),st&&Xa(w,D),_}function g(w,v,b,E){var _=Sl(b);if(typeof _!="function")throw Error(Q(150));if(b=_.call(b),b==null)throw Error(Q(151));for(var S=_=null,I=v,D=v=0,V=null,N=b.next();I!==null&&!N.done;D++,N=b.next()){I.index>D?(V=I,I=null):V=I.sibling;var $=f(w,I,N.value,E);if($===null){I===null&&(I=V);break}e&&I&&$.alternate===null&&t(w,I),v=a($,v,D),S===null?_=$:S.sibling=$,S=$,I=V}if(N.done)return n(w,I),st&&Xa(w,D),_;if(I===null){for(;!N.done;D++,N=b.next())N=d(w,N.value,E),N!==null&&(v=a(N,v,D),S===null?_=N:S.sibling=N,S=N);return st&&Xa(w,D),_}for(I=r(w,I);!N.done;D++,N=b.next())N=p(I,w,D,N.value,E),N!==null&&(e&&N.alternate!==null&&I.delete(N.key===null?D:N.key),v=a(N,v,D),S===null?_=N:S.sibling=N,S=N);return e&&I.forEach(function(z){return t(w,z)}),st&&Xa(w,D),_}function x(w,v,b,E){if(typeof b=="object"&&b!==null&&b.type===Ho&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case bd:e:{for(var _=b.key,S=v;S!==null;){if(S.key===_){if(_=b.type,_===Ho){if(S.tag===7){n(w,S.sibling),v=i(S,b.props.children),v.return=w,w=v;break e}}else if(S.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===zi&&Z_(_)===S.type){n(w,S.sibling),v=i(S,b.props),v.ref=Zl(w,S,b),v.return=w,w=v;break e}n(w,S);break}else t(w,S);S=S.sibling}b.type===Ho?(v=io(b.props.children,w.mode,E,b.key),v.return=w,w=v):(E=_f(b.type,b.key,b.props,null,w.mode,E),E.ref=Zl(w,v,b),E.return=w,w=E)}return o(w);case zo:e:{for(S=b.key;v!==null;){if(v.key===S)if(v.tag===4&&v.stateNode.containerInfo===b.containerInfo&&v.stateNode.implementation===b.implementation){n(w,v.sibling),v=i(v,b.children||[]),v.return=w,w=v;break e}else{n(w,v);break}else t(w,v);v=v.sibling}v=ww(b,w.mode,E),v.return=w,w=v}return o(w);case zi:return S=b._init,x(w,v,S(b._payload),E)}if(kl(b))return m(w,v,b,E);if(Sl(b))return g(w,v,b,E);Jd(w,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,v!==null&&v.tag===6?(n(w,v.sibling),v=i(v,b),v.return=w,w=v):(n(w,v),v=gw(b,w.mode,E),v.return=w,w=v),o(w)):n(w,v)}return x}var as=J_(!0),eS=J_(!1),ef=Xi(null),tf=null,os=null,C0=null;function k0(){C0=os=tf=null}function A0(e){var t=ef.current;nt(ef),e._currentValue=t}function R0(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ss(e,t){tf=e,C0=os=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(En=!0),e.firstContext=null)}function er(e){var t=e._currentValue;if(C0!==e)if(e={context:e,memoizedValue:t,next:null},os===null){if(tf===null)throw Error(Q(308));os=e,tf.dependencies={lanes:0,firstContext:e}}else os=os.next=e;return t}var Qa=null;function N0(e){Qa===null?Qa=[e]:Qa.push(e)}function tS(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,N0(t)):(n.next=i.next,i.next=n),t.interleaved=n,hi(e,r)}function hi(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ji=!1;function P0(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function nS(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function mi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ea(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ue&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,hi(e,n)}return i=r.interleaved,i===null?(t.next=t,N0(r)):(t.next=i.next,i.next=t),r.interleaved=t,hi(e,n)}function nf(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Wg(e,n)}}function rS(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function rf(e,t,n,r){var i=e.updateQueue;Ji=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,u=l.next;l.next=null,o===null?a=u:o.next=u,o=l;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==o&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(a!==null){var d=i.baseState;o=0,c=u=l=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var m=e,g=s;switch(f=t,p=n,g.tag){case 1:if(m=g.payload,typeof m=="function"){d=m.call(p,d,f);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m=="function"?m.call(p,d,f):m,f==null)break e;d=dt({},d,f);break e;case 2:Ji=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=p,l=d):c=c.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(c===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);eo|=o,e.lanes=o,e.memoizedState=d}}function iS(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(Q(191,i));i.call(r)}}}var Jl={},jr=Xi(Jl),eu=Xi(Jl),tu=Xi(Jl);function Za(e){if(e===Jl)throw Error(Q(174));return e}function I0(e,t){switch(Je(tu,t),Je(eu,e),Je(jr,Jl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Og(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Og(t,e)}nt(jr),Je(jr,t)}function ls(){nt(jr),nt(eu),nt(tu)}function aS(e){Za(tu.current);var t=Za(jr.current),n=Og(t,e.type);t!==n&&(Je(eu,e),Je(jr,n))}function O0(e){eu.current===e&&(nt(jr),nt(eu))}var ft=Xi(0);function af(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var D0=[];function L0(){for(var e=0;e<D0.length;e++)D0[e]._workInProgressVersionPrimary=null;D0.length=0}var of=ui.ReactCurrentDispatcher,M0=ui.ReactCurrentBatchConfig,Ja=0,pt=null,Nt=null,Dt=null,sf=!1,nu=!1,ru=0,kB=0;function Zt(){throw Error(Q(321))}function F0(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!wr(e[n],t[n]))return!1;return!0}function B0(e,t,n,r,i,a){if(Ja=a,pt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,of.current=e===null||e.memoizedState===null?PB:IB,e=n(r,i),nu){a=0;do{if(nu=!1,ru=0,25<=a)throw Error(Q(301));a+=1,Dt=Nt=null,t.updateQueue=null,of.current=OB,e=n(r,i)}while(nu)}if(of.current=cf,t=Nt!==null&&Nt.next!==null,Ja=0,Dt=Nt=pt=null,sf=!1,t)throw Error(Q(300));return e}function j0(){var e=ru!==0;return ru=0,e}function Ur(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Dt===null?pt.memoizedState=Dt=e:Dt=Dt.next=e,Dt}function tr(){if(Nt===null){var e=pt.alternate;e=e!==null?e.memoizedState:null}else e=Nt.next;var t=Dt===null?pt.memoizedState:Dt.next;if(t!==null)Dt=t,Nt=e;else{if(e===null)throw Error(Q(310));Nt=e,e={memoizedState:Nt.memoizedState,baseState:Nt.baseState,baseQueue:Nt.baseQueue,queue:Nt.queue,next:null},Dt===null?pt.memoizedState=Dt=e:Dt=Dt.next=e}return Dt}function iu(e,t){return typeof t=="function"?t(e):t}function U0(e){var t=tr(),n=t.queue;if(n===null)throw Error(Q(311));n.lastRenderedReducer=e;var r=Nt,i=r.baseQueue,a=n.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}r.baseQueue=i=a,n.pending=null}if(i!==null){a=i.next,r=r.baseState;var s=o=null,l=null,u=a;do{var c=u.lane;if((Ja&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(s=l=d,o=r):l=l.next=d,pt.lanes|=c,eo|=c}u=u.next}while(u!==null&&u!==a);l===null?o=r:l.next=s,wr(r,t.memoizedState)||(En=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do a=i.lane,pt.lanes|=a,eo|=a,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function z0(e){var t=tr(),n=t.queue;if(n===null)throw Error(Q(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);wr(a,t.memoizedState)||(En=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function oS(){}function sS(e,t){var n=pt,r=tr(),i=t(),a=!wr(r.memoizedState,i);if(a&&(r.memoizedState=i,En=!0),r=r.queue,H0(cS.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||Dt!==null&&Dt.memoizedState.tag&1){if(n.flags|=2048,au(9,uS.bind(null,n,r,i,t),void 0,null),Lt===null)throw Error(Q(349));Ja&30||lS(n,t,i)}return i}function lS(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=pt.updateQueue,t===null?(t={lastEffect:null,stores:null},pt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function uS(e,t,n,r){t.value=n,t.getSnapshot=r,dS(t)&&fS(e)}function cS(e,t,n){return n(function(){dS(t)&&fS(e)})}function dS(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!wr(e,n)}catch{return!0}}function fS(e){var t=hi(e,1);t!==null&&Er(t,e,1,-1)}function pS(e){var t=Ur();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:iu,lastRenderedState:e},t.queue=e,e=e.dispatch=NB.bind(null,pt,e),[t.memoizedState,e]}function au(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=pt.updateQueue,t===null?(t={lastEffect:null,stores:null},pt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function hS(){return tr().memoizedState}function lf(e,t,n,r){var i=Ur();pt.flags|=e,i.memoizedState=au(1|t,n,void 0,r===void 0?null:r)}function uf(e,t,n,r){var i=tr();r=r===void 0?null:r;var a=void 0;if(Nt!==null){var o=Nt.memoizedState;if(a=o.destroy,r!==null&&F0(r,o.deps)){i.memoizedState=au(t,n,a,r);return}}pt.flags|=e,i.memoizedState=au(1|t,n,a,r)}function mS(e,t){return lf(8390656,8,e,t)}function H0(e,t){return uf(2048,8,e,t)}function gS(e,t){return uf(4,2,e,t)}function wS(e,t){return uf(4,4,e,t)}function yS(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function vS(e,t,n){return n=n!=null?n.concat([e]):null,uf(4,4,yS.bind(null,t,e),n)}function V0(){}function bS(e,t){var n=tr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&F0(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function xS(e,t){var n=tr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&F0(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ES(e,t,n){return Ja&21?(wr(n,t)||(n=Z2(),pt.lanes|=n,eo|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,En=!0),e.memoizedState=n)}function AB(e,t){var n=qe;qe=n!==0&&4>n?n:4,e(!0);var r=M0.transition;M0.transition={};try{e(!1),t()}finally{qe=n,M0.transition=r}}function TS(){return tr().memoizedState}function RB(e,t,n){var r=ia(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},_S(e))SS(t,n);else if(n=tS(e,t,n,r),n!==null){var i=cn();Er(n,e,r,i),CS(n,t,r)}}function NB(e,t,n){var r=ia(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(_S(e))SS(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,wr(s,o)){var l=t.interleaved;l===null?(i.next=i,N0(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=tS(e,t,i,r),n!==null&&(i=cn(),Er(n,e,r,i),CS(n,t,r))}}function _S(e){var t=e.alternate;return e===pt||t!==null&&t===pt}function SS(e,t){nu=sf=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function CS(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Wg(e,n)}}var cf={readContext:er,useCallback:Zt,useContext:Zt,useEffect:Zt,useImperativeHandle:Zt,useInsertionEffect:Zt,useLayoutEffect:Zt,useMemo:Zt,useReducer:Zt,useRef:Zt,useState:Zt,useDebugValue:Zt,useDeferredValue:Zt,useTransition:Zt,useMutableSource:Zt,useSyncExternalStore:Zt,useId:Zt,unstable_isNewReconciler:!1},PB={readContext:er,useCallback:function(e,t){return Ur().memoizedState=[e,t===void 0?null:t],e},useContext:er,useEffect:mS,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,lf(4194308,4,yS.bind(null,t,e),n)},useLayoutEffect:function(e,t){return lf(4194308,4,e,t)},useInsertionEffect:function(e,t){return lf(4,2,e,t)},useMemo:function(e,t){var n=Ur();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ur();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=RB.bind(null,pt,e),[r.memoizedState,e]},useRef:function(e){var t=Ur();return e={current:e},t.memoizedState=e},useState:pS,useDebugValue:V0,useDeferredValue:function(e){return Ur().memoizedState=e},useTransition:function(){var e=pS(!1),t=e[0];return e=AB.bind(null,e[1]),Ur().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=pt,i=Ur();if(st){if(n===void 0)throw Error(Q(407));n=n()}else{if(n=t(),Lt===null)throw Error(Q(349));Ja&30||lS(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,mS(cS.bind(null,r,a,e),[e]),r.flags|=2048,au(9,uS.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Ur(),t=Lt.identifierPrefix;if(st){var n=pi,r=fi;n=(r&~(1<<32-gr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ru++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=kB++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},IB={readContext:er,useCallback:bS,useContext:er,useEffect:H0,useImperativeHandle:vS,useInsertionEffect:gS,useLayoutEffect:wS,useMemo:xS,useReducer:U0,useRef:hS,useState:function(){return U0(iu)},useDebugValue:V0,useDeferredValue:function(e){var t=tr();return ES(t,Nt.memoizedState,e)},useTransition:function(){var e=U0(iu)[0],t=tr().memoizedState;return[e,t]},useMutableSource:oS,useSyncExternalStore:sS,useId:TS,unstable_isNewReconciler:!1},OB={readContext:er,useCallback:bS,useContext:er,useEffect:H0,useImperativeHandle:vS,useInsertionEffect:gS,useLayoutEffect:wS,useMemo:xS,useReducer:z0,useRef:hS,useState:function(){return z0(iu)},useDebugValue:V0,useDeferredValue:function(e){var t=tr();return Nt===null?t.memoizedState=e:ES(t,Nt.memoizedState,e)},useTransition:function(){var e=z0(iu)[0],t=tr().memoizedState;return[e,t]},useMutableSource:oS,useSyncExternalStore:sS,useId:TS,unstable_isNewReconciler:!1};function vr(e,t){if(e&&e.defaultProps){t=dt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function $0(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:dt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var df={isMounted:function(e){return(e=e._reactInternals)?Ya(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=cn(),i=ia(e),a=mi(r,i);a.payload=t,n!=null&&(a.callback=n),t=ea(e,a,i),t!==null&&(Er(t,e,i,r),nf(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=cn(),i=ia(e),a=mi(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=ea(e,a,i),t!==null&&(Er(t,e,i,r),nf(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=cn(),r=ia(e),i=mi(n,r);i.tag=2,t!=null&&(i.callback=t),t=ea(e,i,r),t!==null&&(Er(t,e,r,n),nf(t,e,r))}};function kS(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Wl(n,r)||!Wl(i,a):!0}function AS(e,t,n){var r=!1,i=Qi,a=t.contextType;return typeof a=="object"&&a!==null?a=er(a):(i=xn(t)?Ga:Qt.current,r=t.contextTypes,a=(r=r!=null)?ts(e,i):Qi),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=df,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function RS(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&df.enqueueReplaceState(t,t.state,null)}function W0(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},P0(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=er(a):(a=xn(t)?Ga:Qt.current,i.context=ts(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&($0(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&df.enqueueReplaceState(i,i.state,null),rf(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function us(e,t){try{var n="",r=t;do n+=s7(r),r=r.return;while(r);var i=n}catch(a){i=`
|
|
330
330
|
Error generating stack: `+a.message+`
|
|
331
|
-
`+a.stack}return{value:e,source:t,stack:i,digest:null}}function Y0(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function q0(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var DB=typeof WeakMap=="function"?WeakMap:Map;function NS(e,t,n){n=mi(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){yf||(yf=!0,lw=r),q0(e,t)},n}function PS(e,t,n){n=mi(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){q0(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){q0(e,t),typeof r!="function"&&(na===null?na=new Set([this]):na.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function IS(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new DB;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=GB.bind(null,e,t,n),t.then(e,e))}function OS(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function DS(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=mi(-1,1),t.tag=2,ea(n,t,1))),n.lanes|=1),e)}var LB=ui.ReactCurrentOwner,En=!1;function un(e,t,n,r){t.child=e===null?eS(t,null,n,r):as(t,e.child,n,r)}function LS(e,t,n,r,i){n=n.render;var a=t.ref;return ss(t,i),r=B0(e,t,n,r,a,i),n=j0(),e!==null&&!En?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,gi(e,t,i)):(st&&n&&x0(t),t.flags|=1,un(e,t,r,i),t.child)}function MS(e,t,n,r,i){if(e===null){var a=n.type;return typeof a=="function"&&!mw(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,FS(e,t,a,r,i)):(e=_f(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var o=a.memoizedProps;if(n=n.compare,n=n!==null?n:Wl,n(o,r)&&e.ref===t.ref)return gi(e,t,i)}return t.flags|=1,e=oa(a,r),e.ref=t.ref,e.return=t,t.child=e}function FS(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Wl(a,r)&&e.ref===t.ref)if(En=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(En=!0);else return t.lanes=e.lanes,gi(e,t,i)}return G0(e,t,n,r,i)}function BS(e,t,n){var r=t.pendingProps,i=r.children,a=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Je(ds,Un),Un|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Je(ds,Un),Un|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,Je(ds,Un),Un|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,Je(ds,Un),Un|=r;return un(e,t,i,n),t.child}function jS(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function G0(e,t,n,r,i){var a=xn(n)?Ga:Qt.current;return a=ts(t,a),ss(t,i),n=B0(e,t,n,r,a,i),r=j0(),e!==null&&!En?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,gi(e,t,i)):(st&&r&&x0(t),t.flags|=1,un(e,t,n,i),t.child)}function US(e,t,n,r,i){if(xn(n)){var a=!0;Gd(t)}else a=!1;if(ss(t,i),t.stateNode===null)pf(e,t),AS(t,n,r),W0(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var l=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=er(u):(u=xn(n)?Ga:Qt.current,u=ts(t,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==r||l!==u)&&RS(t,o,r,u),Ji=!1;var f=t.memoizedState;o.state=f,rf(t,r,o,i),l=t.memoizedState,s!==r||f!==l||bn.current||Ji?(typeof c=="function"&&($0(t,n,c,r),l=t.memoizedState),(s=Ji||kS(t,n,s,r,f,l,u))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=u,r=s):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,nS(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:vr(t.type,s),o.props=u,d=t.pendingProps,f=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=er(l):(l=xn(n)?Ga:Qt.current,l=ts(t,l));var p=n.getDerivedStateFromProps;(c=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==d||f!==l)&&RS(t,o,r,l),Ji=!1,f=t.memoizedState,o.state=f,rf(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||bn.current||Ji?(typeof p=="function"&&($0(t,n,p,r),m=t.memoizedState),(u=Ji||kS(t,n,u,r,f,m,l)||!1)?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,m,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=l,r=u):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return K0(e,t,n,r,a,i)}function K0(e,t,n,r,i,a){jS(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&W_(t,n,!1),gi(e,t,a);r=t.stateNode,LB.current=t;var s=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=as(t,e.child,null,a),t.child=as(t,null,s,a)):un(e,t,s,a),t.memoizedState=r.state,i&&W_(t,n,!0),t.child}function zS(e){var t=e.stateNode;t.pendingContext?V_(e,t.pendingContext,t.pendingContext!==t.context):t.context&&V_(e,t.context,!1),I0(e,t.containerInfo)}function HS(e,t,n,r,i){return is(),S0(i),t.flags|=256,un(e,t,n,r),t.child}var X0={dehydrated:null,treeContext:null,retryLane:0};function Q0(e){return{baseLanes:e,cachePool:null,transitions:null}}function VS(e,t,n){var r=t.pendingProps,i=ft.current,a=!1,o=(t.flags&128)!==0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Je(ft,i&1),e===null)return _0(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:"hidden",children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=Sf(o,r,0,null),e=io(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Q0(n),t.memoizedState=X0,e):Z0(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return MB(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=oa(i,l),r.subtreeFlags=i.subtreeFlags&14680064),s!==null?a=oa(s,a):(a=io(a,o,n,null),a.flags|=2),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?Q0(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=X0,r}return a=e.child,e=a.sibling,r=oa(a,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Z0(e,t){return t=Sf({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ff(e,t,n,r){return r!==null&&S0(r),as(t,e.child,null,n),e=Z0(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function MB(e,t,n,r,i,a,o){if(n)return t.flags&256?(t.flags&=-257,r=Y0(Error(Q(422))),ff(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,i=t.mode,r=Sf({mode:"visible",children:r.children},i,0,null),a=io(a,i,o,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&as(t,e.child,null,o),t.child.memoizedState=Q0(o),t.memoizedState=X0,a);if(!(t.mode&1))return ff(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var s=r.dgst;return r=s,a=Error(Q(419)),r=Y0(a,r,void 0),ff(e,t,o,r)}if(s=(o&e.childLanes)!==0,En||s){if(r=Lt,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,hi(e,i),Er(r,e,i,-1))}return hw(),r=Y0(Error(Q(421))),ff(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=KB.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,jn=Ki(i.nextSibling),Bn=t,st=!0,yr=null,e!==null&&(Zn[Jn++]=fi,Zn[Jn++]=pi,Zn[Jn++]=Ka,fi=e.id,pi=e.overflow,Ka=t),t=Z0(t,r.children),t.flags|=4096,t)}function $S(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),R0(e.return,t,n)}function J0(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function WS(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(un(e,t,r.children,n),r=ft.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&$S(e,n,t);else if(e.tag===19)$S(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Je(ft,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&af(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),J0(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&af(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}J0(t,!0,n,null,a);break;case"together":J0(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function pf(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function gi(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),eo|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Q(153));if(t.child!==null){for(e=t.child,n=oa(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=oa(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function FB(e,t,n){switch(t.tag){case 3:zS(t),is();break;case 5:aS(t);break;case 1:xn(t.type)&&Gd(t);break;case 4:I0(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Je(ef,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Je(ft,ft.current&1),t.flags|=128,null):n&t.child.childLanes?VS(e,t,n):(Je(ft,ft.current&1),e=gi(e,t,n),e!==null?e.sibling:null);Je(ft,ft.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return WS(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Je(ft,ft.current),r)break;return null;case 22:case 23:return t.lanes=0,BS(e,t,n)}return gi(e,t,n)}var YS,ew,qS,GS;YS=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},ew=function(){},qS=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Za(jr.current);var a=null;switch(n){case"input":i=Rg(e,i),r=Rg(e,r),a=[];break;case"select":i=dt({},i,{value:void 0}),r=dt({},r,{value:void 0}),a=[];break;case"textarea":i=Ig(e,i),r=Ig(e,r),a=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Wd)}Dg(n,r);var o;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var s=i[u];for(o in s)s.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(_l.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in r){var l=r[u];if(s=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==s&&(l!=null||s!=null))if(u==="style")if(s){for(o in s)!s.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&s[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(a||(a=[]),a.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,s=s?s.__html:void 0,l!=null&&s!==l&&(a=a||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(a=a||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(_l.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&tt("scroll",e),a||s===l||(a=[])):(a=a||[]).push(u,l))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}},GS=function(e,t,n,r){n!==r&&(t.flags|=4)};function ou(e,t){if(!st)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Jt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function BB(e,t,n){var r=t.pendingProps;switch(E0(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Jt(t),null;case 1:return xn(t.type)&&qd(),Jt(t),null;case 3:return r=t.stateNode,ls(),nt(bn),nt(Qt),L0(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Zd(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,yr!==null&&(dw(yr),yr=null))),ew(e,t),Jt(t),null;case 5:O0(t);var i=Za(tu.current);if(n=t.type,e!==null&&t.stateNode!=null)qS(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(Q(166));return Jt(t),null}if(e=Za(jr.current),Zd(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[Br]=t,r[Xl]=a,e=(t.mode&1)!==0,n){case"dialog":tt("cancel",r),tt("close",r);break;case"iframe":case"object":case"embed":tt("load",r);break;case"video":case"audio":for(i=0;i<ql.length;i++)tt(ql[i],r);break;case"source":tt("error",r);break;case"img":case"image":case"link":tt("error",r),tt("load",r);break;case"details":tt("toggle",r);break;case"input":A2(r,a),tt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},tt("invalid",r);break;case"textarea":P2(r,a),tt("invalid",r)}Dg(n,a),i=null;for(var o in a)if(a.hasOwnProperty(o)){var s=a[o];o==="children"?typeof s=="string"?r.textContent!==s&&(a.suppressHydrationWarning!==!0&&$d(r.textContent,s,e),i=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(a.suppressHydrationWarning!==!0&&$d(r.textContent,s,e),i=["children",""+s]):_l.hasOwnProperty(o)&&s!=null&&o==="onScroll"&&tt("scroll",r)}switch(n){case"input":xd(r),N2(r,a,!0);break;case"textarea":xd(r),O2(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=Wd)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=D2(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Br]=t,e[Xl]=r,YS(e,t,!1,!1),t.stateNode=e;e:{switch(o=Lg(n,r),n){case"dialog":tt("cancel",e),tt("close",e),i=r;break;case"iframe":case"object":case"embed":tt("load",e),i=r;break;case"video":case"audio":for(i=0;i<ql.length;i++)tt(ql[i],e);i=r;break;case"source":tt("error",e),i=r;break;case"img":case"image":case"link":tt("error",e),tt("load",e),i=r;break;case"details":tt("toggle",e),i=r;break;case"input":A2(e,r),i=Rg(e,r),tt("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=dt({},r,{value:void 0}),tt("invalid",e);break;case"textarea":P2(e,r),i=Ig(e,r),tt("invalid",e);break;default:i=r}Dg(n,i),s=i;for(a in s)if(s.hasOwnProperty(a)){var l=s[a];a==="style"?F2(e,l):a==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&L2(e,l)):a==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Al(e,l):typeof l=="number"&&Al(e,""+l):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(_l.hasOwnProperty(a)?l!=null&&a==="onScroll"&&tt("scroll",e):l!=null&&yg(e,a,l,o))}switch(n){case"input":xd(e),N2(e,r,!1);break;case"textarea":xd(e),O2(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Hi(r.value));break;case"select":e.multiple=!!r.multiple,a=r.value,a!=null?Vo(e,!!r.multiple,a,!1):r.defaultValue!=null&&Vo(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Wd)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Jt(t),null;case 6:if(e&&t.stateNode!=null)GS(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(Q(166));if(n=Za(tu.current),Za(jr.current),Zd(t)){if(r=t.stateNode,n=t.memoizedProps,r[Br]=t,(a=r.nodeValue!==n)&&(e=Bn,e!==null))switch(e.tag){case 3:$d(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&$d(r.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Br]=t,t.stateNode=r}return Jt(t),null;case 13:if(nt(ft),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(st&&jn!==null&&t.mode&1&&!(t.flags&128))Q_(),is(),t.flags|=98560,a=!1;else if(a=Zd(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(Q(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(Q(317));a[Br]=t}else is(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Jt(t),a=!1}else yr!==null&&(dw(yr),yr=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ft.current&1?Pt===0&&(Pt=3):hw())),t.updateQueue!==null&&(t.flags|=4),Jt(t),null);case 4:return ls(),ew(e,t),e===null&&Gl(t.stateNode.containerInfo),Jt(t),null;case 10:return A0(t.type._context),Jt(t),null;case 17:return xn(t.type)&&qd(),Jt(t),null;case 19:if(nt(ft),a=t.memoizedState,a===null)return Jt(t),null;if(r=(t.flags&128)!==0,o=a.rendering,o===null)if(r)ou(a,!1);else{if(Pt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=af(e),o!==null){for(t.flags|=128,ou(a,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)a=n,e=r,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Je(ft,ft.current&1|2),t.child}e=e.sibling}a.tail!==null&&Tt()>fs&&(t.flags|=128,r=!0,ou(a,!1),t.lanes=4194304)}else{if(!r)if(e=af(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ou(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!st)return Jt(t),null}else 2*Tt()-a.renderingStartTime>fs&&n!==1073741824&&(t.flags|=128,r=!0,ou(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(n=a.last,n!==null?n.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Tt(),t.sibling=null,n=ft.current,Je(ft,r?n&1|2:n&1),t):(Jt(t),null);case 22:case 23:return pw(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Un&1073741824&&(Jt(t),t.subtreeFlags&6&&(t.flags|=8192)):Jt(t),null;case 24:return null;case 25:return null}throw Error(Q(156,t.tag))}function jB(e,t){switch(E0(t),t.tag){case 1:return xn(t.type)&&qd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ls(),nt(bn),nt(Qt),L0(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return O0(t),null;case 13:if(nt(ft),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Q(340));is()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return nt(ft),null;case 4:return ls(),null;case 10:return A0(t.type._context),null;case 22:case 23:return pw(),null;case 24:return null;default:return null}}var hf=!1,en=!1,UB=typeof WeakSet=="function"?WeakSet:Set,se=null;function cs(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){yt(e,t,r)}else n.current=null}function tw(e,t,n){try{n()}catch(r){yt(e,t,r)}}var KS=!1;function zB(e,t){if(p0=Od,e=k_(),a0(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,s=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var p;d!==n||i!==0&&d.nodeType!==3||(s=o+i),d!==a||r!==0&&d.nodeType!==3||(l=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++u===i&&(s=o),f===a&&++c===r&&(l=o),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(h0={focusedElem:e,selectionRange:n},Od=!1,se=t;se!==null;)if(t=se,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,se=e;else for(;se!==null;){t=se;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var g=m.memoizedProps,x=m.memoizedState,w=t.stateNode,v=w.getSnapshotBeforeUpdate(t.elementType===t.type?g:vr(t.type,g),x);w.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Q(163))}}catch(E){yt(t,t.return,E)}if(e=t.sibling,e!==null){e.return=t.return,se=e;break}se=t.return}return m=KS,KS=!1,m}function su(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&tw(t,n,a)}i=i.next}while(i!==r)}}function mf(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function nw(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function XS(e){var t=e.alternate;t!==null&&(e.alternate=null,XS(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Br],delete t[Xl],delete t[y0],delete t[TB],delete t[_B])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function QS(e){return e.tag===5||e.tag===3||e.tag===4}function ZS(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||QS(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function rw(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Wd));else if(r!==4&&(e=e.child,e!==null))for(rw(e,t,n),e=e.sibling;e!==null;)rw(e,t,n),e=e.sibling}function iw(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(iw(e,t,n),e=e.sibling;e!==null;)iw(e,t,n),e=e.sibling}var Vt=null,br=!1;function ta(e,t,n){for(n=n.child;n!==null;)JS(e,t,n),n=n.sibling}function JS(e,t,n){if(Fr&&typeof Fr.onCommitFiberUnmount=="function")try{Fr.onCommitFiberUnmount(kd,n)}catch{}switch(n.tag){case 5:en||cs(n,t);case 6:var r=Vt,i=br;Vt=null,ta(e,t,n),Vt=r,br=i,Vt!==null&&(br?(e=Vt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Vt.removeChild(n.stateNode));break;case 18:Vt!==null&&(br?(e=Vt,n=n.stateNode,e.nodeType===8?w0(e.parentNode,n):e.nodeType===1&&w0(e,n),jl(e)):w0(Vt,n.stateNode));break;case 4:r=Vt,i=br,Vt=n.stateNode.containerInfo,br=!0,ta(e,t,n),Vt=r,br=i;break;case 0:case 11:case 14:case 15:if(!en&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&tw(n,t,o),i=i.next}while(i!==r)}ta(e,t,n);break;case 1:if(!en&&(cs(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){yt(n,t,s)}ta(e,t,n);break;case 21:ta(e,t,n);break;case 22:n.mode&1?(en=(r=en)||n.memoizedState!==null,ta(e,t,n),en=r):ta(e,t,n);break;default:ta(e,t,n)}}function eC(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new UB),t.forEach(function(r){var i=XB.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function xr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var a=e,o=t,s=o;e:for(;s!==null;){switch(s.tag){case 5:Vt=s.stateNode,br=!1;break e;case 3:Vt=s.stateNode.containerInfo,br=!0;break e;case 4:Vt=s.stateNode.containerInfo,br=!0;break e}s=s.return}if(Vt===null)throw Error(Q(160));JS(a,o,i),Vt=null,br=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){yt(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)tC(t,e),t=t.sibling}function tC(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(xr(t,e),zr(e),r&4){try{su(3,e,e.return),mf(3,e)}catch(g){yt(e,e.return,g)}try{su(5,e,e.return)}catch(g){yt(e,e.return,g)}}break;case 1:xr(t,e),zr(e),r&512&&n!==null&&cs(n,n.return);break;case 5:if(xr(t,e),zr(e),r&512&&n!==null&&cs(n,n.return),e.flags&32){var i=e.stateNode;try{Al(i,"")}catch(g){yt(e,e.return,g)}}if(r&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,o=n!==null?n.memoizedProps:a,s=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{s==="input"&&a.type==="radio"&&a.name!=null&&R2(i,a),Lg(s,o);var u=Lg(s,a);for(o=0;o<l.length;o+=2){var c=l[o],d=l[o+1];c==="style"?F2(i,d):c==="dangerouslySetInnerHTML"?L2(i,d):c==="children"?Al(i,d):yg(i,c,d,u)}switch(s){case"input":Ng(i,a);break;case"textarea":I2(i,a);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var p=a.value;p!=null?Vo(i,!!a.multiple,p,!1):f!==!!a.multiple&&(a.defaultValue!=null?Vo(i,!!a.multiple,a.defaultValue,!0):Vo(i,!!a.multiple,a.multiple?[]:"",!1))}i[Xl]=a}catch(g){yt(e,e.return,g)}}break;case 6:if(xr(t,e),zr(e),r&4){if(e.stateNode===null)throw Error(Q(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(g){yt(e,e.return,g)}}break;case 3:if(xr(t,e),zr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{jl(t.containerInfo)}catch(g){yt(e,e.return,g)}break;case 4:xr(t,e),zr(e);break;case 13:xr(t,e),zr(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(sw=Tt())),r&4&&eC(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(en=(u=en)||c,xr(t,e),en=u):xr(t,e),zr(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(se=e,c=e.child;c!==null;){for(d=se=c;se!==null;){switch(f=se,p=f.child,f.tag){case 0:case 11:case 14:case 15:su(4,f,f.return);break;case 1:cs(f,f.return);var m=f.stateNode;if(typeof m.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(g){yt(r,n,g)}}break;case 5:cs(f,f.return);break;case 22:if(f.memoizedState!==null){iC(d);continue}}p!==null?(p.return=f,se=p):iC(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{i=d.stateNode,u?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(s=d.stateNode,l=d.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,s.style.display=M2("display",o))}catch(g){yt(e,e.return,g)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(g){yt(e,e.return,g)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:xr(t,e),zr(e),r&4&&eC(e);break;case 21:break;default:xr(t,e),zr(e)}}function zr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(QS(n)){var r=n;break e}n=n.return}throw Error(Q(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Al(i,""),r.flags&=-33);var a=ZS(e);iw(e,a,i);break;case 3:case 4:var o=r.stateNode.containerInfo,s=ZS(e);rw(e,s,o);break;default:throw Error(Q(161))}}catch(l){yt(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function HB(e,t,n){se=e,nC(e)}function nC(e,t,n){for(var r=(e.mode&1)!==0;se!==null;){var i=se,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||hf;if(!o){var s=i.alternate,l=s!==null&&s.memoizedState!==null||en;s=hf;var u=en;if(hf=o,(en=l)&&!u)for(se=i;se!==null;)o=se,l=o.child,o.tag===22&&o.memoizedState!==null?aC(i):l!==null?(l.return=o,se=l):aC(i);for(;a!==null;)se=a,nC(a),a=a.sibling;se=i,hf=s,en=u}rC(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,se=a):rC(e)}}function rC(e){for(;se!==null;){var t=se;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:en||mf(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!en)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:vr(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&iS(t,a,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}iS(t,o,n)}break;case 5:var s=t.stateNode;if(n===null&&t.flags&4){n=s;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&jl(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Q(163))}en||t.flags&512&&nw(t)}catch(f){yt(t,t.return,f)}}if(t===e){se=null;break}if(n=t.sibling,n!==null){n.return=t.return,se=n;break}se=t.return}}function iC(e){for(;se!==null;){var t=se;if(t===e){se=null;break}var n=t.sibling;if(n!==null){n.return=t.return,se=n;break}se=t.return}}function aC(e){for(;se!==null;){var t=se;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{mf(4,t)}catch(l){yt(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){yt(t,i,l)}}var a=t.return;try{nw(t)}catch(l){yt(t,a,l)}break;case 5:var o=t.return;try{nw(t)}catch(l){yt(t,o,l)}}}catch(l){yt(t,t.return,l)}if(t===e){se=null;break}var s=t.sibling;if(s!==null){s.return=t.return,se=s;break}se=t.return}}var VB=Math.ceil,gf=ui.ReactCurrentDispatcher,aw=ui.ReactCurrentOwner,nr=ui.ReactCurrentBatchConfig,Ue=0,Lt=null,kt=null,$t=0,Un=0,ds=Xi(0),Pt=0,lu=null,eo=0,wf=0,ow=0,uu=null,Tn=null,sw=0,fs=1/0,wi=null,yf=!1,lw=null,na=null,vf=!1,ra=null,bf=0,cu=0,uw=null,xf=-1,Ef=0;function cn(){return Ue&6?Tt():xf!==-1?xf:xf=Tt()}function ia(e){return e.mode&1?Ue&2&&$t!==0?$t&-$t:CB.transition!==null?(Ef===0&&(Ef=Z2()),Ef):(e=qe,e!==0||(e=window.event,e=e===void 0?16:s_(e.type)),e):1}function Er(e,t,n,r){if(50<cu)throw cu=0,uw=null,Error(Q(185));Dl(e,n,r),(!(Ue&2)||e!==Lt)&&(e===Lt&&(!(Ue&2)&&(wf|=n),Pt===4&&aa(e,$t)),_n(e,r),n===1&&Ue===0&&!(t.mode&1)&&(fs=Tt()+500,Kd&&Zi()))}function _n(e,t){var n=e.callbackNode;C7(e,t);var r=Nd(e,e===Lt?$t:0);if(r===0)n!==null&&K2(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&K2(n),t===1)e.tag===0?SB(sC.bind(null,e)):Y_(sC.bind(null,e)),xB(function(){!(Ue&6)&&Zi()}),n=null;else{switch(J2(r)){case 1:n=Hg;break;case 4:n=X2;break;case 16:n=Cd;break;case 536870912:n=Q2;break;default:n=Cd}n=mC(n,oC.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function oC(e,t){if(xf=-1,Ef=0,Ue&6)throw Error(Q(327));var n=e.callbackNode;if(ps()&&e.callbackNode!==n)return null;var r=Nd(e,e===Lt?$t:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Tf(e,r);else{t=r;var i=Ue;Ue|=2;var a=uC();(Lt!==e||$t!==t)&&(wi=null,fs=Tt()+500,no(e,t));do try{YB();break}catch(s){lC(e,s)}while(!0);k0(),gf.current=a,Ue=i,kt!==null?t=0:(Lt=null,$t=0,t=Pt)}if(t!==0){if(t===2&&(i=Vg(e),i!==0&&(r=i,t=cw(e,i))),t===1)throw n=lu,no(e,0),aa(e,r),_n(e,Tt()),n;if(t===6)aa(e,r);else{if(i=e.current.alternate,!(r&30)&&!$B(i)&&(t=Tf(e,r),t===2&&(a=Vg(e),a!==0&&(r=a,t=cw(e,a))),t===1))throw n=lu,no(e,0),aa(e,r),_n(e,Tt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(Q(345));case 2:ro(e,Tn,wi);break;case 3:if(aa(e,r),(r&130023424)===r&&(t=sw+500-Tt(),10<t)){if(Nd(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){cn(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=g0(ro.bind(null,e,Tn,wi),t);break}ro(e,Tn,wi);break;case 4:if(aa(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-gr(r);a=1<<o,o=t[o],o>i&&(i=o),r&=~a}if(r=i,r=Tt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*VB(r/1960))-r,10<r){e.timeoutHandle=g0(ro.bind(null,e,Tn,wi),r);break}ro(e,Tn,wi);break;case 5:ro(e,Tn,wi);break;default:throw Error(Q(329))}}}return _n(e,Tt()),e.callbackNode===n?oC.bind(null,e):null}function cw(e,t){var n=uu;return e.current.memoizedState.isDehydrated&&(no(e,t).flags|=256),e=Tf(e,t),e!==2&&(t=Tn,Tn=n,t!==null&&dw(t)),e}function dw(e){Tn===null?Tn=e:Tn.push.apply(Tn,e)}function $B(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!wr(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function aa(e,t){for(t&=~ow,t&=~wf,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-gr(t),r=1<<n;e[n]=-1,t&=~r}}function sC(e){if(Ue&6)throw Error(Q(327));ps();var t=Nd(e,0);if(!(t&1))return _n(e,Tt()),null;var n=Tf(e,t);if(e.tag!==0&&n===2){var r=Vg(e);r!==0&&(t=r,n=cw(e,r))}if(n===1)throw n=lu,no(e,0),aa(e,t),_n(e,Tt()),n;if(n===6)throw Error(Q(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ro(e,Tn,wi),_n(e,Tt()),null}function fw(e,t){var n=Ue;Ue|=1;try{return e(t)}finally{Ue=n,Ue===0&&(fs=Tt()+500,Kd&&Zi())}}function to(e){ra!==null&&ra.tag===0&&!(Ue&6)&&ps();var t=Ue;Ue|=1;var n=nr.transition,r=qe;try{if(nr.transition=null,qe=1,e)return e()}finally{qe=r,nr.transition=n,Ue=t,!(Ue&6)&&Zi()}}function pw(){Un=ds.current,nt(ds)}function no(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,bB(n)),kt!==null)for(n=kt.return;n!==null;){var r=n;switch(E0(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&qd();break;case 3:ls(),nt(bn),nt(Qt),L0();break;case 5:O0(r);break;case 4:ls();break;case 13:nt(ft);break;case 19:nt(ft);break;case 10:A0(r.type._context);break;case 22:case 23:pw()}n=n.return}if(Lt=e,kt=e=oa(e.current,null),$t=Un=t,Pt=0,lu=null,ow=wf=eo=0,Tn=uu=null,Qa!==null){for(t=0;t<Qa.length;t++)if(n=Qa[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}Qa=null}return e}function lC(e,t){do{var n=kt;try{if(k0(),of.current=cf,sf){for(var r=pt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}sf=!1}if(Ja=0,Dt=Nt=pt=null,nu=!1,ru=0,aw.current=null,n===null||n.return===null){Pt=1,lu=t,kt=null;break}e:{var a=e,o=n.return,s=n,l=t;if(t=$t,s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=s,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var p=OS(o);if(p!==null){p.flags&=-257,DS(p,o,s,a,t),p.mode&1&&IS(a,u,t),t=p,l=u;var m=t.updateQueue;if(m===null){var g=new Set;g.add(l),t.updateQueue=g}else m.add(l);break e}else{if(!(t&1)){IS(a,u,t),hw();break e}l=Error(Q(426))}}else if(st&&s.mode&1){var x=OS(o);if(x!==null){!(x.flags&65536)&&(x.flags|=256),DS(x,o,s,a,t),S0(us(l,s));break e}}a=l=us(l,s),Pt!==4&&(Pt=2),uu===null?uu=[a]:uu.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var w=NS(a,l,t);rS(a,w);break e;case 1:s=l;var v=a.type,b=a.stateNode;if(!(a.flags&128)&&(typeof v.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(na===null||!na.has(b)))){a.flags|=65536,t&=-t,a.lanes|=t;var E=PS(a,s,t);rS(a,E);break e}}a=a.return}while(a!==null)}dC(n)}catch(_){t=_,kt===n&&n!==null&&(kt=n=n.return);continue}break}while(!0)}function uC(){var e=gf.current;return gf.current=cf,e===null?cf:e}function hw(){(Pt===0||Pt===3||Pt===2)&&(Pt=4),Lt===null||!(eo&268435455)&&!(wf&268435455)||aa(Lt,$t)}function Tf(e,t){var n=Ue;Ue|=2;var r=uC();(Lt!==e||$t!==t)&&(wi=null,no(e,t));do try{WB();break}catch(i){lC(e,i)}while(!0);if(k0(),Ue=n,gf.current=r,kt!==null)throw Error(Q(261));return Lt=null,$t=0,Pt}function WB(){for(;kt!==null;)cC(kt)}function YB(){for(;kt!==null&&!w7();)cC(kt)}function cC(e){var t=hC(e.alternate,e,Un);e.memoizedProps=e.pendingProps,t===null?dC(e):kt=t,aw.current=null}function dC(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=jB(n,t),n!==null){n.flags&=32767,kt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Pt=6,kt=null;return}}else if(n=BB(n,t,Un),n!==null){kt=n;return}if(t=t.sibling,t!==null){kt=t;return}kt=t=e}while(t!==null);Pt===0&&(Pt=5)}function ro(e,t,n){var r=qe,i=nr.transition;try{nr.transition=null,qe=1,qB(e,t,n,r)}finally{nr.transition=i,qe=r}return null}function qB(e,t,n,r){do ps();while(ra!==null);if(Ue&6)throw Error(Q(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(Q(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(k7(e,a),e===Lt&&(kt=Lt=null,$t=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||vf||(vf=!0,mC(Cd,function(){return ps(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=nr.transition,nr.transition=null;var o=qe;qe=1;var s=Ue;Ue|=4,aw.current=null,zB(e,n),tC(n,e),pB(h0),Od=!!p0,h0=p0=null,e.current=n,HB(n),y7(),Ue=s,qe=o,nr.transition=a}else e.current=n;if(vf&&(vf=!1,ra=e,bf=i),a=e.pendingLanes,a===0&&(na=null),x7(n.stateNode),_n(e,Tt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(yf)throw yf=!1,e=lw,lw=null,e;return bf&1&&e.tag!==0&&ps(),a=e.pendingLanes,a&1?e===uw?cu++:(cu=0,uw=e):cu=0,Zi(),null}function ps(){if(ra!==null){var e=J2(bf),t=nr.transition,n=qe;try{if(nr.transition=null,qe=16>e?16:e,ra===null)var r=!1;else{if(e=ra,ra=null,bf=0,Ue&6)throw Error(Q(331));var i=Ue;for(Ue|=4,se=e.current;se!==null;){var a=se,o=a.child;if(se.flags&16){var s=a.deletions;if(s!==null){for(var l=0;l<s.length;l++){var u=s[l];for(se=u;se!==null;){var c=se;switch(c.tag){case 0:case 11:case 15:su(8,c,a)}var d=c.child;if(d!==null)d.return=c,se=d;else for(;se!==null;){c=se;var f=c.sibling,p=c.return;if(XS(c),c===u){se=null;break}if(f!==null){f.return=p,se=f;break}se=p}}}var m=a.alternate;if(m!==null){var g=m.child;if(g!==null){m.child=null;do{var x=g.sibling;g.sibling=null,g=x}while(g!==null)}}se=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,se=o;else e:for(;se!==null;){if(a=se,a.flags&2048)switch(a.tag){case 0:case 11:case 15:su(9,a,a.return)}var w=a.sibling;if(w!==null){w.return=a.return,se=w;break e}se=a.return}}var v=e.current;for(se=v;se!==null;){o=se;var b=o.child;if(o.subtreeFlags&2064&&b!==null)b.return=o,se=b;else e:for(o=v;se!==null;){if(s=se,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:mf(9,s)}}catch(_){yt(s,s.return,_)}if(s===o){se=null;break e}var E=s.sibling;if(E!==null){E.return=s.return,se=E;break e}se=s.return}}if(Ue=i,Zi(),Fr&&typeof Fr.onPostCommitFiberRoot=="function")try{Fr.onPostCommitFiberRoot(kd,e)}catch{}r=!0}return r}finally{qe=n,nr.transition=t}}return!1}function fC(e,t,n){t=us(n,t),t=NS(e,t,1),e=ea(e,t,1),t=cn(),e!==null&&(Dl(e,1,t),_n(e,t))}function yt(e,t,n){if(e.tag===3)fC(e,e,n);else for(;t!==null;){if(t.tag===3){fC(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(na===null||!na.has(r))){e=us(n,e),e=PS(t,e,1),t=ea(t,e,1),e=cn(),t!==null&&(Dl(t,1,e),_n(t,e));break}}t=t.return}}function GB(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=cn(),e.pingedLanes|=e.suspendedLanes&n,Lt===e&&($t&n)===n&&(Pt===4||Pt===3&&($t&130023424)===$t&&500>Tt()-sw?no(e,0):ow|=n),_n(e,t)}function pC(e,t){t===0&&(e.mode&1?(t=Rd,Rd<<=1,!(Rd&130023424)&&(Rd=4194304)):t=1);var n=cn();e=hi(e,t),e!==null&&(Dl(e,t,n),_n(e,n))}function KB(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),pC(e,n)}function XB(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Q(314))}r!==null&&r.delete(t),pC(e,n)}var hC;hC=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||bn.current)En=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return En=!1,FB(e,t,n);En=!!(e.flags&131072)}else En=!1,st&&t.flags&1048576&&q_(t,Qd,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;pf(e,t),e=t.pendingProps;var i=ts(t,Qt.current);ss(t,n),i=B0(null,t,r,e,i,n);var a=j0();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,xn(r)?(a=!0,Gd(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,P0(t),i.updater=df,t.stateNode=i,i._reactInternals=t,W0(t,r,e,n),t=K0(null,t,r,!0,a,n)):(t.tag=0,st&&a&&x0(t),un(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(pf(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=ZB(r),e=vr(r,e),i){case 0:t=G0(null,t,r,e,n);break e;case 1:t=US(null,t,r,e,n);break e;case 11:t=LS(null,t,r,e,n);break e;case 14:t=MS(null,t,r,vr(r.type,e),n);break e}throw Error(Q(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vr(r,i),G0(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vr(r,i),US(e,t,r,i,n);case 3:e:{if(zS(t),e===null)throw Error(Q(387));r=t.pendingProps,a=t.memoizedState,i=a.element,nS(e,t),rf(t,r,null,n);var o=t.memoizedState;if(r=o.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=us(Error(Q(423)),t),t=HS(e,t,r,n,i);break e}else if(r!==i){i=us(Error(Q(424)),t),t=HS(e,t,r,n,i);break e}else for(jn=Ki(t.stateNode.containerInfo.firstChild),Bn=t,st=!0,yr=null,n=eS(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(is(),r===i){t=gi(e,t,n);break e}un(e,t,r,n)}t=t.child}return t;case 5:return aS(t),e===null&&_0(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,m0(r,i)?o=null:a!==null&&m0(r,a)&&(t.flags|=32),jS(e,t),un(e,t,o,n),t.child;case 6:return e===null&&_0(t),null;case 13:return VS(e,t,n);case 4:return I0(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=as(t,null,r,n):un(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vr(r,i),LS(e,t,r,i,n);case 7:return un(e,t,t.pendingProps,n),t.child;case 8:return un(e,t,t.pendingProps.children,n),t.child;case 12:return un(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,Je(ef,r._currentValue),r._currentValue=o,a!==null)if(wr(a.value,o)){if(a.children===i.children&&!bn.current){t=gi(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){o=a.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(a.tag===1){l=mi(-1,n&-n),l.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),R0(a.return,n,t),s.lanes|=n;break}l=l.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(Q(341));o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),R0(o,n,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}un(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,ss(t,n),i=er(i),r=r(i),t.flags|=1,un(e,t,r,n),t.child;case 14:return r=t.type,i=vr(r,t.pendingProps),i=vr(r.type,i),MS(e,t,r,i,n);case 15:return FS(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vr(r,i),pf(e,t),t.tag=1,xn(r)?(e=!0,Gd(t)):e=!1,ss(t,n),AS(t,r,i),W0(t,r,i,n),K0(null,t,r,!0,e,n);case 19:return WS(e,t,n);case 22:return BS(e,t,n)}throw Error(Q(156,t.tag))};function mC(e,t){return G2(e,t)}function QB(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rr(e,t,n,r){return new QB(e,t,n,r)}function mw(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ZB(e){if(typeof e=="function")return mw(e)?1:0;if(e!=null){if(e=e.$$typeof,e===xg)return 11;if(e===_g)return 14}return 2}function oa(e,t){var n=e.alternate;return n===null?(n=rr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function _f(e,t,n,r,i,a){var o=2;if(r=e,typeof e=="function")mw(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ho:return io(n.children,i,a,t);case vg:o=8,i|=8;break;case bg:return e=rr(12,n,t,i|2),e.elementType=bg,e.lanes=a,e;case Eg:return e=rr(13,n,t,i),e.elementType=Eg,e.lanes=a,e;case Tg:return e=rr(19,n,t,i),e.elementType=Tg,e.lanes=a,e;case _2:return Sf(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case E2:o=10;break e;case T2:o=9;break e;case xg:o=11;break e;case _g:o=14;break e;case zi:o=16,r=null;break e}throw Error(Q(130,e==null?e:typeof e,""))}return t=rr(o,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function io(e,t,n,r){return e=rr(7,e,r,t),e.lanes=n,e}function Sf(e,t,n,r){return e=rr(22,e,r,t),e.elementType=_2,e.lanes=n,e.stateNode={isHidden:!1},e}function gw(e,t,n){return e=rr(6,e,null,t),e.lanes=n,e}function ww(e,t,n){return t=rr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function JB(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=$g(0),this.expirationTimes=$g(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$g(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function yw(e,t,n,r,i,a,o,s,l){return e=new JB(e,t,n,s,l),t===1?(t=1,a===!0&&(t|=8)):t=0,a=rr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},P0(a),e}function ej(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:zo,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function gC(e){if(!e)return Qi;e=e._reactInternals;e:{if(Ya(e)!==e||e.tag!==1)throw Error(Q(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(xn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Q(171))}if(e.tag===1){var n=e.type;if(xn(n))return $_(e,n,t)}return t}function wC(e,t,n,r,i,a,o,s,l){return e=yw(n,r,!0,e,i,a,o,s,l),e.context=gC(null),n=e.current,r=cn(),i=ia(n),a=mi(r,i),a.callback=t??null,ea(n,a,i),e.current.lanes=i,Dl(e,i,r),_n(e,r),e}function Cf(e,t,n,r){var i=t.current,a=cn(),o=ia(i);return n=gC(n),t.context===null?t.context=n:t.pendingContext=n,t=mi(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ea(i,t,o),e!==null&&(Er(e,i,o,a),nf(e,i,o)),o}function kf(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function yC(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function vw(e,t){yC(e,t),(e=e.alternate)&&yC(e,t)}function tj(){return null}var vC=typeof reportError=="function"?reportError:function(e){console.error(e)};function bw(e){this._internalRoot=e}Af.prototype.render=bw.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Q(409));Cf(e,t,null,null)},Af.prototype.unmount=bw.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;to(function(){Cf(null,e,null,null)}),t[ci]=null}};function Af(e){this._internalRoot=e}Af.prototype.unstable_scheduleHydration=function(e){if(e){var t=n_();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Yi.length&&t!==0&&t<Yi[n].priority;n++);Yi.splice(n,0,e),n===0&&a_(e)}};function xw(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Rf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function bC(){}function nj(e,t,n,r,i){if(i){if(typeof r=="function"){var a=r;r=function(){var u=kf(o);a.call(u)}}var o=wC(t,r,e,0,null,!1,!1,"",bC);return e._reactRootContainer=o,e[ci]=o.current,Gl(e.nodeType===8?e.parentNode:e),to(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var s=r;r=function(){var u=kf(l);s.call(u)}}var l=yw(e,0,!1,null,null,!1,!1,"",bC);return e._reactRootContainer=l,e[ci]=l.current,Gl(e.nodeType===8?e.parentNode:e),to(function(){Cf(t,l,n,r)}),l}function Nf(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i=="function"){var s=i;i=function(){var l=kf(o);s.call(l)}}Cf(t,o,e,i)}else o=nj(n,t,e,i,r);return kf(o)}e_=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ol(t.pendingLanes);n!==0&&(Wg(t,n|1),_n(t,Tt()),!(Ue&6)&&(fs=Tt()+500,Zi()))}break;case 13:to(function(){var r=hi(e,1);if(r!==null){var i=cn();Er(r,e,1,i)}}),vw(e,1)}},Yg=function(e){if(e.tag===13){var t=hi(e,134217728);if(t!==null){var n=cn();Er(t,e,134217728,n)}vw(e,134217728)}},t_=function(e){if(e.tag===13){var t=ia(e),n=hi(e,t);if(n!==null){var r=cn();Er(n,e,t,r)}vw(e,t)}},n_=function(){return qe},r_=function(e,t){var n=qe;try{return qe=e,t()}finally{qe=n}},Bg=function(e,t,n){switch(t){case"input":if(Ng(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=Yd(r);if(!i)throw Error(Q(90));k2(r),Ng(r,i)}}}break;case"textarea":I2(e,n);break;case"select":t=n.value,t!=null&&Vo(e,!!n.multiple,t,!1)}},z2=fw,H2=to;var rj={usingClientEntryPoint:!1,Events:[Ql,Jo,Yd,j2,U2,fw]},du={findFiberByHostInstance:qa,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ij={bundleType:du.bundleType,version:du.version,rendererPackageName:du.rendererPackageName,rendererConfig:du.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ui.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Y2(e),e===null?null:e.stateNode},findFiberByHostInstance:du.findFiberByHostInstance||tj,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Pf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pf.isDisabled&&Pf.supportsFiber)try{kd=Pf.inject(ij),Fr=Pf}catch{}}Ln.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=rj,Ln.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!xw(t))throw Error(Q(200));return ej(e,t,null,n)},Ln.createRoot=function(e,t){if(!xw(e))throw Error(Q(299));var n=!1,r="",i=vC;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=yw(e,1,!1,null,null,n,!1,r,i),e[ci]=t.current,Gl(e.nodeType===8?e.parentNode:e),new bw(t)},Ln.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Q(188)):(e=Object.keys(e).join(","),Error(Q(268,e)));return e=Y2(t),e=e===null?null:e.stateNode,e},Ln.flushSync=function(e){return to(e)},Ln.hydrate=function(e,t,n){if(!Rf(t))throw Error(Q(200));return Nf(null,e,t,!0,n)},Ln.hydrateRoot=function(e,t,n){if(!xw(e))throw Error(Q(405));var r=n!=null&&n.hydratedSources||null,i=!1,a="",o=vC;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=wC(t,null,e,1,n??null,i,!1,a,o),e[ci]=t.current,Gl(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new Af(t)},Ln.render=function(e,t,n){if(!Rf(t))throw Error(Q(200));return Nf(null,e,t,!1,n)},Ln.unmountComponentAtNode=function(e){if(!Rf(e))throw Error(Q(40));return e._reactRootContainer?(to(function(){Nf(null,null,e,!1,function(){e._reactRootContainer=null,e[ci]=null})}),!0):!1},Ln.unstable_batchedUpdates=fw,Ln.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Rf(n))throw Error(Q(200));if(e==null||e._reactInternals===void 0)throw Error(Q(38));return Nf(e,t,n,!1,r)},Ln.version="18.3.1-next-f1338f8080-20240426";function xC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(xC)}catch(e){console.error(e)}}xC(),g2.exports=Ln;var hs=g2.exports,If=y.forwardRef((e,t)=>{const{children:n,...r}=e,i=y.Children.toArray(n),a=i.find(aj);if(a){const o=a.props.children,s=i.map(l=>l===a?y.Children.count(o)>1?y.Children.only(null):y.isValidElement(o)?o.props.children:null:l);return T.jsx(Ew,{...r,ref:t,children:y.isValidElement(o)?y.cloneElement(o,void 0,s):null})}return T.jsx(Ew,{...r,ref:t,children:n})});If.displayName="Slot";var Ew=y.forwardRef((e,t)=>{const{children:n,...r}=e;if(y.isValidElement(n)){const i=sj(n);return y.cloneElement(n,{...oj(r,n.props),ref:t?m2(t,i):i})}return y.Children.count(n)>1?y.Children.only(null):null});Ew.displayName="SlotClone";var EC=({children:e})=>T.jsx(T.Fragment,{children:e});function aj(e){return y.isValidElement(e)&&e.type===EC}function oj(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...s)=>{a(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function sj(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var lj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],zn=lj.reduce((e,t)=>{const n=y.forwardRef((r,i)=>{const{asChild:a,...o}=r,s=a?If:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),T.jsx(s,{...o,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function uj(e,t){e&&hs.flushSync(()=>e.dispatchEvent(t))}function Wt(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function TC(e,t=globalThis==null?void 0:globalThis.document){const n=Wt(e);y.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var cj="DismissableLayer",Tw="dismissableLayer.update",dj="dismissableLayer.pointerDownOutside",fj="dismissableLayer.focusOutside",_C,SC=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),_w=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...l}=e,u=y.useContext(SC),[c,d]=y.useState(null),f=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=y.useState({}),m=Mr(t,I=>d(I)),g=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),w=g.indexOf(x),v=c?g.indexOf(c):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,E=v>=w,_=mj(I=>{const D=I.target,V=[...u.branches].some(N=>N.contains(D));!E||V||(i==null||i(I),o==null||o(I),I.defaultPrevented||s==null||s())},f),S=gj(I=>{const D=I.target;[...u.branches].some(N=>N.contains(D))||(a==null||a(I),o==null||o(I),I.defaultPrevented||s==null||s())},f);return TC(I=>{v===u.layers.size-1&&(r==null||r(I),!I.defaultPrevented&&s&&(I.preventDefault(),s()))},f),y.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(_C=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),CC(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=_C)}},[c,f,n,u]),y.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),CC())},[c,u]),y.useEffect(()=>{const I=()=>p({});return document.addEventListener(Tw,I),()=>document.removeEventListener(Tw,I)},[]),T.jsx(zn.div,{...l,ref:m,style:{pointerEvents:b?E?"auto":"none":void 0,...e.style},onFocusCapture:vn(e.onFocusCapture,S.onFocusCapture),onBlurCapture:vn(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:vn(e.onPointerDownCapture,_.onPointerDownCapture)})});_w.displayName=cj;var pj="DismissableLayerBranch",hj=y.forwardRef((e,t)=>{const n=y.useContext(SC),r=y.useRef(null),i=Mr(t,r);return y.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),T.jsx(zn.div,{...e,ref:i})});hj.displayName=pj;function mj(e,t=globalThis==null?void 0:globalThis.document){const n=Wt(e),r=y.useRef(!1),i=y.useRef(()=>{});return y.useEffect(()=>{const a=s=>{if(s.target&&!r.current){let l=function(){kC(dj,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function gj(e,t=globalThis==null?void 0:globalThis.document){const n=Wt(e),r=y.useRef(!1);return y.useEffect(()=>{const i=a=>{a.target&&!r.current&&kC(fj,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function CC(){const e=new CustomEvent(Tw);document.dispatchEvent(e)}function kC(e,t,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?uj(i,a):i.dispatchEvent(a)}var ir=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},wj=wO.useId||(()=>{}),yj=0;function fu(e){const[t,n]=y.useState(wj());return ir(()=>{e||n(r=>r??String(yj++))},[e]),e||(t?`radix-${t}`:"")}const vj=["top","right","bottom","left"],sa=Math.min,Hn=Math.max,Of=Math.round,Df=Math.floor,la=e=>({x:e,y:e}),bj={left:"right",right:"left",bottom:"top",top:"bottom"},xj={start:"end",end:"start"};function Sw(e,t,n){return Hn(e,sa(t,n))}function yi(e,t){return typeof e=="function"?e(t):e}function vi(e){return e.split("-")[0]}function ms(e){return e.split("-")[1]}function Cw(e){return e==="x"?"y":"x"}function kw(e){return e==="y"?"height":"width"}function ua(e){return["top","bottom"].includes(vi(e))?"y":"x"}function Aw(e){return Cw(ua(e))}function Ej(e,t,n){n===void 0&&(n=!1);const r=ms(e),i=Aw(e),a=kw(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Lf(o)),[o,Lf(o)]}function Tj(e){const t=Lf(e);return[Rw(e),t,Rw(t)]}function Rw(e){return e.replace(/start|end/g,t=>xj[t])}function _j(e,t,n){const r=["left","right"],i=["right","left"],a=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?a:o;default:return[]}}function Sj(e,t,n,r){const i=ms(e);let a=_j(vi(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(Rw)))),a}function Lf(e){return e.replace(/left|right|bottom|top/g,t=>bj[t])}function Cj(e){return{top:0,right:0,bottom:0,left:0,...e}}function AC(e){return typeof e!="number"?Cj(e):{top:e,right:e,bottom:e,left:e}}function Mf(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function RC(e,t,n){let{reference:r,floating:i}=e;const a=ua(t),o=Aw(t),s=kw(o),l=vi(t),u=a==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2;let p;switch(l){case"top":p={x:c,y:r.y-i.height};break;case"bottom":p={x:c,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(ms(t)){case"start":p[o]-=f*(n&&u?-1:1);break;case"end":p[o]+=f*(n&&u?-1:1);break}return p}const kj=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,s=a.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=RC(u,r,l),f=r,p={},m=0;for(let g=0;g<s.length;g++){const{name:x,fn:w}=s[g],{x:v,y:b,data:E,reset:_}=await w({x:c,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:u,platform:o,elements:{reference:e,floating:t}});c=v??c,d=b??d,p={...p,[x]:{...p[x],...E}},_&&m<=50&&(m++,typeof _=="object"&&(_.placement&&(f=_.placement),_.rects&&(u=_.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):_.rects),{x:c,y:d}=RC(u,f,l)),g=-1)}return{x:c,y:d,placement:f,strategy:i,middlewareData:p}};async function pu(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:o,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=yi(t,e),m=AC(p),x=s[f?d==="floating"?"reference":"floating":d],w=Mf(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(x)))==null||n?x:x.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),v=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),E=await(a.isElement==null?void 0:a.isElement(b))?await(a.getScale==null?void 0:a.getScale(b))||{x:1,y:1}:{x:1,y:1},_=Mf(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:b,strategy:l}):v);return{top:(w.top-_.top+m.top)/E.y,bottom:(_.bottom-w.bottom+m.bottom)/E.y,left:(w.left-_.left+m.left)/E.x,right:(_.right-w.right+m.right)/E.x}}const Aj=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:l}=t,{element:u,padding:c=0}=yi(e,t)||{};if(u==null)return{};const d=AC(c),f={x:n,y:r},p=Aw(i),m=kw(p),g=await o.getDimensions(u),x=p==="y",w=x?"top":"left",v=x?"bottom":"right",b=x?"clientHeight":"clientWidth",E=a.reference[m]+a.reference[p]-f[p]-a.floating[m],_=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let I=S?S[b]:0;(!I||!await(o.isElement==null?void 0:o.isElement(S)))&&(I=s.floating[b]||a.floating[m]);const D=E/2-_/2,V=I/2-g[m]/2-1,N=sa(d[w],V),$=sa(d[v],V),z=N,X=I-g[m]-$,Y=I/2-g[m]/2+D,ne=Sw(z,Y,X),re=!l.arrow&&ms(i)!=null&&Y!==ne&&a.reference[m]/2-(Y<z?N:$)-g[m]/2<0,ee=re?Y<z?Y-z:Y-X:0;return{[p]:f[p]+ee,data:{[p]:ne,centerOffset:Y-ne-ee,...re&&{alignmentOffset:ee}},reset:re}}}),Rj=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...x}=yi(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const w=vi(i),v=ua(s),b=vi(s)===s,E=await(l.isRTL==null?void 0:l.isRTL(u.floating)),_=f||(b||!g?[Lf(s)]:Tj(s)),S=m!=="none";!f&&S&&_.push(...Sj(s,g,m,E));const I=[s,..._],D=await pu(t,x),V=[];let N=((r=a.flip)==null?void 0:r.overflows)||[];if(c&&V.push(D[w]),d){const Y=Ej(i,o,E);V.push(D[Y[0]],D[Y[1]])}if(N=[...N,{placement:i,overflows:V}],!V.every(Y=>Y<=0)){var $,z;const Y=((($=a.flip)==null?void 0:$.index)||0)+1,ne=I[Y];if(ne)return{data:{index:Y,overflows:N},reset:{placement:ne}};let re=(z=N.filter(ee=>ee.overflows[0]<=0).sort((ee,F)=>ee.overflows[1]-F.overflows[1])[0])==null?void 0:z.placement;if(!re)switch(p){case"bestFit":{var X;const ee=(X=N.filter(F=>{if(S){const B=ua(F.placement);return B===v||B==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(B=>B>0).reduce((B,k)=>B+k,0)]).sort((F,B)=>F[1]-B[1])[0])==null?void 0:X[0];ee&&(re=ee);break}case"initialPlacement":re=s;break}if(i!==re)return{reset:{placement:re}}}return{}}}};function NC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function PC(e){return vj.some(t=>e[t]>=0)}const Nj=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=yi(e,t);switch(r){case"referenceHidden":{const a=await pu(t,{...i,elementContext:"reference"}),o=NC(a,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:PC(o)}}}case"escaped":{const a=await pu(t,{...i,altBoundary:!0}),o=NC(a,n.floating);return{data:{escapedOffsets:o,escaped:PC(o)}}}default:return{}}}}};async function Pj(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=vi(n),s=ms(n),l=ua(n)==="y",u=["left","top"].includes(o)?-1:1,c=a&&l?-1:1,d=yi(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m=="number"&&(p=s==="end"?m*-1:m),l?{x:p*c,y:f*u}:{x:f*u,y:p*c}}const Ij=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:o,middlewareData:s}=t,l=await Pj(t,e);return o===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}},Oj=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:x=>{let{x:w,y:v}=x;return{x:w,y:v}}},...l}=yi(e,t),u={x:n,y:r},c=await pu(t,l),d=ua(vi(i)),f=Cw(d);let p=u[f],m=u[d];if(a){const x=f==="y"?"top":"left",w=f==="y"?"bottom":"right",v=p+c[x],b=p-c[w];p=Sw(v,p,b)}if(o){const x=d==="y"?"top":"left",w=d==="y"?"bottom":"right",v=m+c[x],b=m-c[w];m=Sw(v,m,b)}const g=s.fn({...t,[f]:p,[d]:m});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[f]:a,[d]:o}}}}}},Dj=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=yi(e,t),c={x:n,y:r},d=ua(i),f=Cw(d);let p=c[f],m=c[d];const g=yi(s,t),x=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const b=f==="y"?"height":"width",E=a.reference[f]-a.floating[b]+x.mainAxis,_=a.reference[f]+a.reference[b]-x.mainAxis;p<E?p=E:p>_&&(p=_)}if(u){var w,v;const b=f==="y"?"width":"height",E=["top","left"].includes(vi(i)),_=a.reference[d]-a.floating[b]+(E&&((w=o.offset)==null?void 0:w[d])||0)+(E?0:x.crossAxis),S=a.reference[d]+a.reference[b]+(E?0:((v=o.offset)==null?void 0:v[d])||0)-(E?x.crossAxis:0);m<_?m=_:m>S&&(m=S)}return{[f]:p,[d]:m}}}},Lj=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:a,platform:o,elements:s}=t,{apply:l=()=>{},...u}=yi(e,t),c=await pu(t,u),d=vi(i),f=ms(i),p=ua(i)==="y",{width:m,height:g}=a.floating;let x,w;d==="top"||d==="bottom"?(x=d,w=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(w=d,x=f==="end"?"top":"bottom");const v=g-c.top-c.bottom,b=m-c.left-c.right,E=sa(g-c[x],v),_=sa(m-c[w],b),S=!t.middlewareData.shift;let I=E,D=_;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(I=v),S&&!f){const N=Hn(c.left,0),$=Hn(c.right,0),z=Hn(c.top,0),X=Hn(c.bottom,0);p?D=m-2*(N!==0||$!==0?N+$:Hn(c.left,c.right)):I=g-2*(z!==0||X!==0?z+X:Hn(c.top,c.bottom))}await l({...t,availableWidth:D,availableHeight:I});const V=await o.getDimensions(s.floating);return m!==V.width||g!==V.height?{reset:{rects:!0}}:{}}}};function Ff(){return typeof window<"u"}function gs(e){return IC(e)?(e.nodeName||"").toLowerCase():"#document"}function Vn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Hr(e){var t;return(t=(IC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function IC(e){return Ff()?e instanceof Node||e instanceof Vn(e).Node:!1}function Tr(e){return Ff()?e instanceof Element||e instanceof Vn(e).Element:!1}function Vr(e){return Ff()?e instanceof HTMLElement||e instanceof Vn(e).HTMLElement:!1}function OC(e){return!Ff()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Vn(e).ShadowRoot}function hu(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=_r(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function Mj(e){return["table","td","th"].includes(gs(e))}function Bf(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Nw(e){const t=Pw(),n=Tr(e)?_r(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Fj(e){let t=ca(e);for(;Vr(t)&&!ws(t);){if(Nw(t))return t;if(Bf(t))return null;t=ca(t)}return null}function Pw(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ws(e){return["html","body","#document"].includes(gs(e))}function _r(e){return Vn(e).getComputedStyle(e)}function jf(e){return Tr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ca(e){if(gs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||OC(e)&&e.host||Hr(e);return OC(t)?t.host:t}function DC(e){const t=ca(e);return ws(t)?e.ownerDocument?e.ownerDocument.body:e.body:Vr(t)&&hu(t)?t:DC(t)}function mu(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=DC(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=Vn(i);if(a){const s=Iw(o);return t.concat(o,o.visualViewport||[],hu(i)?i:[],s&&n?mu(s):[])}return t.concat(i,mu(i,[],n))}function Iw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function LC(e){const t=_r(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Vr(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Of(n)!==a||Of(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ow(e){return Tr(e)?e:e.contextElement}function ys(e){const t=Ow(e);if(!Vr(t))return la(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=LC(t);let o=(a?Of(n.width):n.width)/r,s=(a?Of(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const Bj=la(0);function MC(e){const t=Vn(e);return!Pw()||!t.visualViewport?Bj:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function jj(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Vn(e)?!1:t}function ao(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=Ow(e);let o=la(1);t&&(r?Tr(r)&&(o=ys(r)):o=ys(e));const s=jj(a,n,r)?MC(a):la(0);let l=(i.left+s.x)/o.x,u=(i.top+s.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(a){const f=Vn(a),p=r&&Tr(r)?Vn(r):r;let m=f,g=Iw(m);for(;g&&r&&p!==m;){const x=ys(g),w=g.getBoundingClientRect(),v=_r(g),b=w.left+(g.clientLeft+parseFloat(v.paddingLeft))*x.x,E=w.top+(g.clientTop+parseFloat(v.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,d*=x.y,l+=b,u+=E,m=Vn(g),g=Iw(m)}}return Mf({width:c,height:d,x:l,y:u})}function Uj(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=Hr(r),s=t?Bf(t.floating):!1;if(r===o||s&&a)return n;let l={scrollLeft:0,scrollTop:0},u=la(1);const c=la(0),d=Vr(r);if((d||!d&&!a)&&((gs(r)!=="body"||hu(o))&&(l=jf(r)),Vr(r))){const f=ao(r);u=ys(r),c.x=f.x+r.clientLeft,c.y=f.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x,y:n.y*u.y-l.scrollTop*u.y+c.y}}function zj(e){return Array.from(e.getClientRects())}function Dw(e,t){const n=jf(e).scrollLeft;return t?t.left+n:ao(Hr(e)).left+n}function Hj(e){const t=Hr(e),n=jf(e),r=e.ownerDocument.body,i=Hn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Hn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Dw(e);const s=-n.scrollTop;return _r(r).direction==="rtl"&&(o+=Hn(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function Vj(e,t){const n=Vn(e),r=Hr(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;const u=Pw();(!u||u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s,y:l}}function $j(e,t){const n=ao(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Vr(e)?ys(e):la(1),o=e.clientWidth*a.x,s=e.clientHeight*a.y,l=i*a.x,u=r*a.y;return{width:o,height:s,x:l,y:u}}function FC(e,t,n){let r;if(t==="viewport")r=Vj(e,n);else if(t==="document")r=Hj(Hr(e));else if(Tr(t))r=$j(t,n);else{const i=MC(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return Mf(r)}function BC(e,t){const n=ca(e);return n===t||!Tr(n)||ws(n)?!1:_r(n).position==="fixed"||BC(n,t)}function Wj(e,t){const n=t.get(e);if(n)return n;let r=mu(e,[],!1).filter(s=>Tr(s)&&gs(s)!=="body"),i=null;const a=_r(e).position==="fixed";let o=a?ca(e):e;for(;Tr(o)&&!ws(o);){const s=_r(o),l=Nw(o);!l&&s.position==="fixed"&&(i=null),(a?!l&&!i:!l&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||hu(o)&&!l&&BC(e,o))?r=r.filter(c=>c!==o):i=s,o=ca(o)}return t.set(e,r),r}function Yj(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?Bf(t)?[]:Wj(t,this._c):[].concat(n),r],s=o[0],l=o.reduce((u,c)=>{const d=FC(t,c,i);return u.top=Hn(d.top,u.top),u.right=sa(d.right,u.right),u.bottom=sa(d.bottom,u.bottom),u.left=Hn(d.left,u.left),u},FC(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function qj(e){const{width:t,height:n}=LC(e);return{width:t,height:n}}function Gj(e,t,n){const r=Vr(t),i=Hr(t),a=n==="fixed",o=ao(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=la(0);if(r||!r&&!a)if((gs(t)!=="body"||hu(i))&&(s=jf(t)),r){const p=ao(t,!0,a,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else i&&(l.x=Dw(i));let u=0,c=0;if(i&&!r&&!a){const p=i.getBoundingClientRect();c=p.top+s.scrollTop,u=p.left+s.scrollLeft-Dw(i,p)}const d=o.left+s.scrollLeft-l.x-u,f=o.top+s.scrollTop-l.y-c;return{x:d,y:f,width:o.width,height:o.height}}function Lw(e){return _r(e).position==="static"}function jC(e,t){if(!Vr(e)||_r(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Hr(e)===n&&(n=n.ownerDocument.body),n}function UC(e,t){const n=Vn(e);if(Bf(e))return n;if(!Vr(e)){let i=ca(e);for(;i&&!ws(i);){if(Tr(i)&&!Lw(i))return i;i=ca(i)}return n}let r=jC(e,t);for(;r&&Mj(r)&&Lw(r);)r=jC(r,t);return r&&ws(r)&&Lw(r)&&!Nw(r)?n:r||Fj(e)||n}const Kj=async function(e){const t=this.getOffsetParent||UC,n=this.getDimensions,r=await n(e.floating);return{reference:Gj(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Xj(e){return _r(e).direction==="rtl"}const Qj={convertOffsetParentRelativeRectToViewportRelativeRect:Uj,getDocumentElement:Hr,getClippingRect:Yj,getOffsetParent:UC,getElementRects:Kj,getClientRects:zj,getDimensions:qj,getScale:ys,isElement:Tr,isRTL:Xj};function Zj(e,t){let n=null,r;const i=Hr(e);function a(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function o(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const{left:u,top:c,width:d,height:f}=e.getBoundingClientRect();if(s||t(),!d||!f)return;const p=Df(c),m=Df(i.clientWidth-(u+d)),g=Df(i.clientHeight-(c+f)),x=Df(u),v={rootMargin:-p+"px "+-m+"px "+-g+"px "+-x+"px",threshold:Hn(0,sa(1,l))||1};let b=!0;function E(_){const S=_[0].intersectionRatio;if(S!==l){if(!b)return o();S?o(!1,S):r=setTimeout(()=>{o(!1,1e-7)},1e3)}b=!1}try{n=new IntersectionObserver(E,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(E,v)}n.observe(e)}return o(!0),a}function zC(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Ow(e),c=i||a?[...u?mu(u):[],...mu(t)]:[];c.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),a&&w.addEventListener("resize",n)});const d=u&&s?Zj(u,n):null;let f=-1,p=null;o&&(p=new ResizeObserver(w=>{let[v]=w;v&&v.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(t)})),n()}),u&&!l&&p.observe(u),p.observe(t));let m,g=l?ao(e):null;l&&x();function x(){const w=ao(e);g&&(w.x!==g.x||w.y!==g.y||w.width!==g.width||w.height!==g.height)&&n(),g=w,m=requestAnimationFrame(x)}return n(),()=>{var w;c.forEach(v=>{i&&v.removeEventListener("scroll",n),a&&v.removeEventListener("resize",n)}),d==null||d(),(w=p)==null||w.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const Jj=Ij,eU=Oj,tU=Rj,nU=Lj,rU=Nj,HC=Aj,iU=Dj,aU=(e,t,n)=>{const r=new Map,i={platform:Qj,...n},a={...i.platform,_c:r};return kj(e,t,{...i,platform:a})};var Uf=typeof document<"u"?y.useLayoutEffect:y.useEffect;function zf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!zf(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const a=i[r];if(!(a==="_owner"&&e.$$typeof)&&!zf(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function VC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $C(e,t){const n=VC(e);return Math.round(t*n)/n}function Mw(e){const t=y.useRef(e);return Uf(()=>{t.current=e}),t}function WC(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[c,d]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=y.useState(r);zf(f,r)||p(r);const[m,g]=y.useState(null),[x,w]=y.useState(null),v=y.useCallback(F=>{F!==S.current&&(S.current=F,g(F))},[]),b=y.useCallback(F=>{F!==I.current&&(I.current=F,w(F))},[]),E=a||m,_=o||x,S=y.useRef(null),I=y.useRef(null),D=y.useRef(c),V=l!=null,N=Mw(l),$=Mw(i),z=Mw(u),X=y.useCallback(()=>{if(!S.current||!I.current)return;const F={placement:t,strategy:n,middleware:f};$.current&&(F.platform=$.current),aU(S.current,I.current,F).then(B=>{const k={...B,isPositioned:z.current!==!1};Y.current&&!zf(D.current,k)&&(D.current=k,hs.flushSync(()=>{d(k)}))})},[f,t,n,$,z]);Uf(()=>{u===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,d(F=>({...F,isPositioned:!1})))},[u]);const Y=y.useRef(!1);Uf(()=>(Y.current=!0,()=>{Y.current=!1}),[]),Uf(()=>{if(E&&(S.current=E),_&&(I.current=_),E&&_){if(N.current)return N.current(E,_,X);X()}},[E,_,X,N,V]);const ne=y.useMemo(()=>({reference:S,floating:I,setReference:v,setFloating:b}),[v,b]),re=y.useMemo(()=>({reference:E,floating:_}),[E,_]),ee=y.useMemo(()=>{const F={position:n,left:0,top:0};if(!re.floating)return F;const B=$C(re.floating,c.x),k=$C(re.floating,c.y);return s?{...F,transform:"translate("+B+"px, "+k+"px)",...VC(re.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:B,top:k}},[n,s,re.floating,c.x,c.y]);return y.useMemo(()=>({...c,update:X,refs:ne,elements:re,floatingStyles:ee}),[c,X,ne,re,ee])}const oU=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?HC({element:r.current,padding:i}).fn(n):{}:r?HC({element:r,padding:i}).fn(n):{}}}},YC=(e,t)=>({...Jj(e),options:[e,t]}),qC=(e,t)=>({...eU(e),options:[e,t]}),GC=(e,t)=>({...iU(e),options:[e,t]}),KC=(e,t)=>({...tU(e),options:[e,t]}),XC=(e,t)=>({...nU(e),options:[e,t]}),QC=(e,t)=>({...rU(e),options:[e,t]}),ZC=(e,t)=>({...oU(e),options:[e,t]});var sU="Arrow",JC=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...a}=e;return T.jsx(zn.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:T.jsx("polygon",{points:"0,0 30,0 15,10"})})});JC.displayName=sU;var lU=JC;function uU(e,t=[]){let n=[];function r(a,o){const s=y.createContext(o),l=n.length;n=[...n,o];function u(d){const{scope:f,children:p,...m}=d,g=(f==null?void 0:f[e][l])||s,x=y.useMemo(()=>m,Object.values(m));return T.jsx(g.Provider,{value:x,children:p})}function c(d,f){const p=(f==null?void 0:f[e][l])||s,m=y.useContext(p);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${a}\``)}return u.displayName=a+"Provider",[u,c]}const i=()=>{const a=n.map(o=>y.createContext(o));return function(s){const l=(s==null?void 0:s[e])||a;return y.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,cU(i,...t)]}function cU(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const o=r.reduce((s,{useScope:l,scopeName:u})=>{const d=l(a)[`__scope${u}`];return{...s,...d}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function ek(e){const[t,n]=y.useState(void 0);return ir(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let o,s;if("borderBoxSize"in a){const l=a.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,s=u.blockSize}else o=e.offsetWidth,s=e.offsetHeight;n({width:o,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Fw="Popper",[tk,Hf]=uU(Fw),[dU,nk]=tk(Fw),rk=e=>{const{__scopePopper:t,children:n}=e,[r,i]=y.useState(null);return T.jsx(dU,{scope:t,anchor:r,onAnchorChange:i,children:n})};rk.displayName=Fw;var ik="PopperAnchor",ak=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,a=nk(ik,n),o=y.useRef(null),s=Mr(t,o);return y.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:T.jsx(zn.div,{...i,ref:s})});ak.displayName=ik;var Bw="PopperContent",[fU,pU]=tk(Bw),ok=y.forwardRef((e,t)=>{var $e,Ve,We,Ge,St,Te;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:o=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:m,...g}=e,x=nk(Bw,n),[w,v]=y.useState(null),b=Mr(t,xe=>v(xe)),[E,_]=y.useState(null),S=ek(E),I=(S==null?void 0:S.width)??0,D=(S==null?void 0:S.height)??0,V=r+(a!=="center"?"-"+a:""),N=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},$=Array.isArray(u)?u:[u],z=$.length>0,X={padding:N,boundary:$.filter(mU),altBoundary:z},{refs:Y,floatingStyles:ne,placement:re,isPositioned:ee,middlewareData:F}=WC({strategy:"fixed",placement:V,whileElementsMounted:(...xe)=>zC(...xe,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[YC({mainAxis:i+D,alignmentAxis:o}),l&&qC({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?GC():void 0,...X}),l&&KC({...X}),XC({...X,apply:({elements:xe,rects:Ye,availableWidth:ze,availableHeight:vt})=>{const{width:bt,height:Ke}=Ye.reference,Le=xe.floating.style;Le.setProperty("--radix-popper-available-width",`${ze}px`),Le.setProperty("--radix-popper-available-height",`${vt}px`),Le.setProperty("--radix-popper-anchor-width",`${bt}px`),Le.setProperty("--radix-popper-anchor-height",`${Ke}px`)}}),E&&ZC({element:E,padding:s}),gU({arrowWidth:I,arrowHeight:D}),f&&QC({strategy:"referenceHidden",...X})]}),[B,k]=uk(re),ie=Wt(m);ir(()=>{ee&&(ie==null||ie())},[ee,ie]);const he=($e=F.arrow)==null?void 0:$e.x,O=(Ve=F.arrow)==null?void 0:Ve.y,Pe=((We=F.arrow)==null?void 0:We.centerOffset)!==0,[ge,ve]=y.useState();return ir(()=>{w&&ve(window.getComputedStyle(w).zIndex)},[w]),T.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...ne,transform:ee?ne.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[(Ge=F.transformOrigin)==null?void 0:Ge.x,(St=F.transformOrigin)==null?void 0:St.y].join(" "),...((Te=F.hide)==null?void 0:Te.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:T.jsx(fU,{scope:n,placedSide:B,onArrowChange:_,arrowX:he,arrowY:O,shouldHideArrow:Pe,children:T.jsx(zn.div,{"data-side":B,"data-align":k,...g,ref:b,style:{...g.style,animation:ee?void 0:"none"}})})})});ok.displayName=Bw;var sk="PopperArrow",hU={top:"bottom",right:"left",bottom:"top",left:"right"},lk=y.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,a=pU(sk,r),o=hU[a.placedSide];return T.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:T.jsx(lU,{...i,ref:n,style:{...i.style,display:"block"}})})});lk.displayName=sk;function mU(e){return e!==null}var gU=e=>({name:"transformOrigin",options:e,fn(t){var x,w,v;const{placement:n,rects:r,middlewareData:i}=t,o=((x=i.arrow)==null?void 0:x.centerOffset)!==0,s=o?0:e.arrowWidth,l=o?0:e.arrowHeight,[u,c]=uk(n),d={start:"0%",center:"50%",end:"100%"}[c],f=(((w=i.arrow)==null?void 0:w.x)??0)+s/2,p=(((v=i.arrow)==null?void 0:v.y)??0)+l/2;let m="",g="";return u==="bottom"?(m=o?d:`${f}px`,g=`${-l}px`):u==="top"?(m=o?d:`${f}px`,g=`${r.floating.height+l}px`):u==="right"?(m=`${-l}px`,g=o?d:`${p}px`):u==="left"&&(m=`${r.floating.width+l}px`,g=o?d:`${p}px`),{data:{x:m,y:g}}}});function uk(e){const[t,n="center"]=e.split("-");return[t,n]}var ck=rk,jw=ak,dk=ok,fk=lk;function wU(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var Uw=e=>{const{present:t,children:n}=e,r=yU(t),i=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),a=Mr(r.ref,vU(i));return typeof n=="function"||r.isPresent?y.cloneElement(i,{ref:a}):null};Uw.displayName="Presence";function yU(e){const[t,n]=y.useState(),r=y.useRef({}),i=y.useRef(e),a=y.useRef("none"),o=e?"mounted":"unmounted",[s,l]=wU(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const u=Vf(r.current);a.current=s==="mounted"?u:"none"},[s]),ir(()=>{const u=r.current,c=i.current;if(c!==e){const f=a.current,p=Vf(u);e?l("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),ir(()=>{if(t){let u;const c=t.ownerDocument.defaultView??window,d=p=>{const g=Vf(r.current).includes(p.animationName);if(p.target===t&&g&&(l("ANIMATION_END"),!i.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},f=p=>{p.target===t&&(a.current=Vf(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{c.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:y.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Vf(e){return(e==null?void 0:e.animationName)||"none"}function vU(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function $f({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=bU({defaultProp:t,onChange:n}),a=e!==void 0,o=a?e:r,s=Wt(n),l=y.useCallback(u=>{if(a){const d=typeof u=="function"?u(e):u;d!==e&&s(d)}else i(u)},[a,e,i,s]);return[o,l]}function bU({defaultProp:e,onChange:t}){const n=y.useState(e),[r]=n,i=y.useRef(r),a=Wt(t);return y.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}var xU="VisuallyHidden",pk=y.forwardRef((e,t)=>T.jsx(zn.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));pk.displayName=xU;var EU=pk,[Wf,kie]=Ui("Tooltip",[Hf]),Yf=Hf(),hk="TooltipProvider",TU=700,zw="tooltip.open",[_U,Hw]=Wf(hk),mk=e=>{const{__scopeTooltip:t,delayDuration:n=TU,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,[o,s]=y.useState(!0),l=y.useRef(!1),u=y.useRef(0);return y.useEffect(()=>{const c=u.current;return()=>window.clearTimeout(c)},[]),T.jsx(_U,{scope:t,isOpenDelayed:o,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(u.current),s(!1)},[]),onClose:y.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>s(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:y.useCallback(c=>{l.current=c},[]),disableHoverableContent:i,children:a})};mk.displayName=hk;var qf="Tooltip",[SU,Gf]=Wf(qf),gk=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,l=Hw(qf,e.__scopeTooltip),u=Yf(t),[c,d]=y.useState(null),f=fu(),p=y.useRef(0),m=o??l.disableHoverableContent,g=s??l.delayDuration,x=y.useRef(!1),[w=!1,v]=$f({prop:r,defaultProp:i,onChange:I=>{I?(l.onOpen(),document.dispatchEvent(new CustomEvent(zw))):l.onClose(),a==null||a(I)}}),b=y.useMemo(()=>w?x.current?"delayed-open":"instant-open":"closed",[w]),E=y.useCallback(()=>{window.clearTimeout(p.current),x.current=!1,v(!0)},[v]),_=y.useCallback(()=>{window.clearTimeout(p.current),v(!1)},[v]),S=y.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{x.current=!0,v(!0)},g)},[g,v]);return y.useEffect(()=>()=>window.clearTimeout(p.current),[]),T.jsx(ck,{...u,children:T.jsx(SU,{scope:t,contentId:f,open:w,stateAttribute:b,trigger:c,onTriggerChange:d,onTriggerEnter:y.useCallback(()=>{l.isOpenDelayed?S():E()},[l.isOpenDelayed,S,E]),onTriggerLeave:y.useCallback(()=>{m?_():window.clearTimeout(p.current)},[_,m]),onOpen:E,onClose:_,disableHoverableContent:m,children:n})})};gk.displayName=qf;var Vw="TooltipTrigger",wk=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Gf(Vw,n),a=Hw(Vw,n),o=Yf(n),s=y.useRef(null),l=Mr(t,s,i.onTriggerChange),u=y.useRef(!1),c=y.useRef(!1),d=y.useCallback(()=>u.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),T.jsx(jw,{asChild:!0,...o,children:T.jsx(zn.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:vn(e.onPointerMove,f=>{f.pointerType!=="touch"&&!c.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),c.current=!0)}),onPointerLeave:vn(e.onPointerLeave,()=>{i.onTriggerLeave(),c.current=!1}),onPointerDown:vn(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:vn(e.onFocus,()=>{u.current||i.onOpen()}),onBlur:vn(e.onBlur,i.onClose),onClick:vn(e.onClick,i.onClose)})})});wk.displayName=Vw;var CU="TooltipPortal",[Aie,kU]=Wf(CU,{forceMount:void 0}),vs="TooltipContent",yk=y.forwardRef((e,t)=>{const n=kU(vs,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...a}=e,o=Gf(vs,e.__scopeTooltip);return T.jsx(Uw,{present:r||o.open,children:o.disableHoverableContent?T.jsx(vk,{side:i,...a,ref:t}):T.jsx(AU,{side:i,...a,ref:t})})}),AU=y.forwardRef((e,t)=>{const n=Gf(vs,e.__scopeTooltip),r=Hw(vs,e.__scopeTooltip),i=y.useRef(null),a=Mr(t,i),[o,s]=y.useState(null),{trigger:l,onClose:u}=n,c=i.current,{onPointerInTransitChange:d}=r,f=y.useCallback(()=>{s(null),d(!1)},[d]),p=y.useCallback((m,g)=>{const x=m.currentTarget,w={x:m.clientX,y:m.clientY},v=IU(w,x.getBoundingClientRect()),b=OU(w,v),E=DU(g.getBoundingClientRect()),_=MU([...b,...E]);s(_),d(!0)},[d]);return y.useEffect(()=>()=>f(),[f]),y.useEffect(()=>{if(l&&c){const m=x=>p(x,c),g=x=>p(x,l);return l.addEventListener("pointerleave",m),c.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",m),c.removeEventListener("pointerleave",g)}}},[l,c,p,f]),y.useEffect(()=>{if(o){const m=g=>{const x=g.target,w={x:g.clientX,y:g.clientY},v=(l==null?void 0:l.contains(x))||(c==null?void 0:c.contains(x)),b=!LU(w,o);v?f():b&&(f(),u())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,c,o,u,f]),T.jsx(vk,{...e,ref:a})}),[RU,NU]=Wf(qf,{isInside:!1}),vk=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,l=Gf(vs,n),u=Yf(n),{onClose:c}=l;return y.useEffect(()=>(document.addEventListener(zw,c),()=>document.removeEventListener(zw,c)),[c]),y.useEffect(()=>{if(l.trigger){const d=f=>{const p=f.target;p!=null&&p.contains(l.trigger)&&c()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,c]),T.jsx(_w,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:c,children:T.jsxs(dk,{"data-state":l.stateAttribute,...u,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[T.jsx(EC,{children:r}),T.jsx(RU,{scope:n,isInside:!0,children:T.jsx(EU,{id:l.contentId,role:"tooltip",children:i||r})})]})})});yk.displayName=vs;var bk="TooltipArrow",PU=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Yf(n);return NU(bk,n).isInside?null:T.jsx(fk,{...i,...r,ref:t})});PU.displayName=bk;function IU(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function OU(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function DU(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function LU(e,t){const{x:n,y:r}=e;let i=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const s=t[a].x,l=t[a].y,u=t[o].x,c=t[o].y;l>r!=c>r&&n<(u-s)*(r-l)/(c-l)+s&&(i=!i)}return i}function MU(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),FU(t)}function FU(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const a=t[t.length-1],o=t[t.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const a=n[n.length-1],o=n[n.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var BU=mk,jU=gk,UU=wk,xk=yk;function Ek(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Ek(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function zU(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ek(e))&&(r&&(r+=" "),r+=t);return r}const $w="-",HU=e=>{const t=$U(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const s=o.split($w);return s[0]===""&&s.length!==1&&s.shift(),Tk(s,t)||VU(o)},getConflictingClassGroupIds:(o,s)=>{const l=n[o]||[];return s&&r[o]?[...l,...r[o]]:l}}},Tk=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Tk(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const a=e.join($w);return(o=t.validators.find(({validator:s})=>s(a)))==null?void 0:o.classGroupId},_k=/^\[(.+)\]$/,VU=e=>{if(_k.test(e)){const t=_k.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},$U=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return YU(Object.entries(e.classGroups),n).forEach(([a,o])=>{Ww(o,r,a,t)}),r},Ww=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const a=i===""?t:Sk(t,i);a.classGroupId=n;return}if(typeof i=="function"){if(WU(i)){Ww(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([a,o])=>{Ww(o,Sk(t,a),n,r)})})},Sk=(e,t)=>{let n=e;return t.split($w).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},WU=e=>e.isThemeGetter,YU=(e,t)=>t?e.map(([n,r])=>{const i=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([o,s])=>[t+o,s])):a);return[n,i]}):e,qU=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(a,o)=>{n.set(a,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let o=n.get(a);if(o!==void 0)return o;if((o=r.get(a))!==void 0)return i(a,o),o},set(a,o){n.has(a)?n.set(a,o):i(a,o)}}},Ck="!",GU=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,o=s=>{const l=[];let u=0,c=0,d;for(let x=0;x<s.length;x++){let w=s[x];if(u===0){if(w===i&&(r||s.slice(x,x+a)===t)){l.push(s.slice(c,x)),c=x+a;continue}if(w==="/"){d=x;continue}}w==="["?u++:w==="]"&&u--}const f=l.length===0?s:s.substring(c),p=f.startsWith(Ck),m=p?f.substring(1):f,g=d&&d>c?d-c:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:g}};return n?s=>n({className:s,parseClassName:o}):o},KU=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},XU=e=>({cache:qU(e.cacheSize),parseClassName:GU(e),...HU(e)}),QU=/\s+/,ZU=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(QU);let s="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(u);let m=!!p,g=r(m?f.substring(0,p):f);if(!g){if(!m){s=u+(s.length>0?" "+s:s);continue}if(g=r(f),!g){s=u+(s.length>0?" "+s:s);continue}m=!1}const x=KU(c).join(":"),w=d?x+Ck:x,v=w+g;if(a.includes(v))continue;a.push(v);const b=i(g,m);for(let E=0;E<b.length;++E){const _=b[E];a.push(w+_)}s=u+(s.length>0?" "+s:s)}return s};function JU(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=kk(t))&&(r&&(r+=" "),r+=n);return r}const kk=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=kk(e[r]))&&(n&&(n+=" "),n+=t);return n};function ez(e,...t){let n,r,i,a=o;function o(l){const u=t.reduce((c,d)=>d(c),e());return n=XU(u),r=n.cache.get,i=n.cache.set,a=s,s(l)}function s(l){const u=r(l);if(u)return u;const c=ZU(l,n);return i(l,c),c}return function(){return a(JU.apply(null,arguments))}}const rt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ak=/^\[(?:([a-z-]+):)?(.+)\]$/i,tz=/^\d+\/\d+$/,nz=new Set(["px","full","screen"]),rz=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,iz=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,az=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,oz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,bi=e=>bs(e)||nz.has(e)||tz.test(e),da=e=>xs(e,"length",mz),bs=e=>!!e&&!Number.isNaN(Number(e)),Yw=e=>xs(e,"number",bs),gu=e=>!!e&&Number.isInteger(Number(e)),lz=e=>e.endsWith("%")&&bs(e.slice(0,-1)),Ae=e=>Ak.test(e),fa=e=>rz.test(e),uz=new Set(["length","size","percentage"]),cz=e=>xs(e,uz,Rk),dz=e=>xs(e,"position",Rk),fz=new Set(["image","url"]),pz=e=>xs(e,fz,wz),hz=e=>xs(e,"",gz),wu=()=>!0,xs=(e,t,n)=>{const r=Ak.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},mz=e=>iz.test(e)&&!az.test(e),Rk=()=>!1,gz=e=>oz.test(e),wz=e=>sz.test(e),yz=ez(()=>{const e=rt("colors"),t=rt("spacing"),n=rt("blur"),r=rt("brightness"),i=rt("borderColor"),a=rt("borderRadius"),o=rt("borderSpacing"),s=rt("borderWidth"),l=rt("contrast"),u=rt("grayscale"),c=rt("hueRotate"),d=rt("invert"),f=rt("gap"),p=rt("gradientColorStops"),m=rt("gradientColorStopPositions"),g=rt("inset"),x=rt("margin"),w=rt("opacity"),v=rt("padding"),b=rt("saturate"),E=rt("scale"),_=rt("sepia"),S=rt("skew"),I=rt("space"),D=rt("translate"),V=()=>["auto","contain","none"],N=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto",Ae,t],z=()=>[Ae,t],X=()=>["",bi,da],Y=()=>["auto",bs,Ae],ne=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],re=()=>["solid","dashed","dotted","double","none"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],F=()=>["start","end","center","between","around","evenly","stretch"],B=()=>["","0",Ae],k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ie=()=>[bs,Ae];return{cacheSize:500,separator:":",theme:{colors:[wu],spacing:[bi,da],blur:["none","",fa,Ae],brightness:ie(),borderColor:[e],borderRadius:["none","","full",fa,Ae],borderSpacing:z(),borderWidth:X(),contrast:ie(),grayscale:B(),hueRotate:ie(),invert:B(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[lz,da],inset:$(),margin:$(),opacity:ie(),padding:z(),saturate:ie(),scale:ie(),sepia:B(),skew:ie(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",Ae]}],container:["container"],columns:[{columns:[fa]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ne(),Ae]}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",gu,Ae]}],basis:[{basis:$()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ae]}],grow:[{grow:B()}],shrink:[{shrink:B()}],order:[{order:["first","last","none",gu,Ae]}],"grid-cols":[{"grid-cols":[wu]}],"col-start-end":[{col:["auto",{span:["full",gu,Ae]},Ae]}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":[wu]}],"row-start-end":[{row:["auto",{span:[gu,Ae]},Ae]}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ae]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ae]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...F()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...F(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...F(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[I]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[I]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ae,t]}],"min-w":[{"min-w":[Ae,t,"min","max","fit"]}],"max-w":[{"max-w":[Ae,t,"none","full","min","max","fit","prose",{screen:[fa]},fa]}],h:[{h:[Ae,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ae,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ae,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ae,t,"auto","min","max","fit"]}],"font-size":[{text:["base",fa,da]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Yw]}],"font-family":[{font:[wu]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ae]}],"line-clamp":[{"line-clamp":["none",bs,Yw]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",bi,Ae]}],"list-image":[{"list-image":["none",Ae]}],"list-style-type":[{list:["none","disc","decimal",Ae]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",bi,da]}],"underline-offset":[{"underline-offset":["auto",bi,Ae]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ae]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ae]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ne(),dz]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",cz]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},pz]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...re(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:re()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...re()]}],"outline-offset":[{"outline-offset":[bi,Ae]}],"outline-w":[{outline:[bi,da]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[bi,da]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",fa,hz]}],"shadow-color":[{shadow:[wu]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...ee(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ee()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",fa,Ae]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ae]}],duration:[{duration:ie()}],ease:[{ease:["linear","in","out","in-out",Ae]}],delay:[{delay:ie()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ae]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[gu,Ae]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ae]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ae]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ae]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[bi,da,Yw]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});function Me(...e){return yz(zU(e))}const vz=BU,bz=jU,xz=UU,Nk=y.forwardRef(({className:e,sideOffset:t=4,...n},r)=>T.jsx(xk,{ref:r,sideOffset:t,className:Me("z-50 overflow-hidden max-w-xs rounded-xl bg-black border text-primary-foreground p-2 text-center align-middle text-xs shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",e),...n}));Nk.displayName=xk.displayName;function qw({children:e,content:t,side:n,align:r}){return T.jsxs(bz,{children:[T.jsx(xz,{asChild:!0,children:e}),T.jsx(Nk,{side:n,align:r,collisionPadding:8,avoidCollisions:!0,children:t})]})}const Pk={en:{ok:"OK",yes:"Yes",no:"No",agree:"Agree",cancel:"Cancel","yes-exit":"Yes, exit","yes-reset":"Yes, reset","no-cancel":"No, cancel","are-you-sure":"Are you sure?",recording:"Recording...","thank-you":"Thank you","sorry-try-again":"Sorry, please try again","error-occurred":"An error occurred","please-try-again":"Please try again","write-a-message":"Write a message...","send-message":"Send message",connected:"Connected",connecting:"Connecting",reconnecting:"Reconnecting",reconnected:"Reconnected",disconnecting:"Disconnecting",disconnected:"Disconnected",error:"Error","persist-session":"Persist session",settings:"Settings",close:"Close",help:"Help",chat:"Chat",send:"Send",copy:"Copy",copied:"Copied","sound-effects":"Sound effects",language:"Language",select:"Select",agent:"Agent",user:"User",bot:"Bot","reset-conversation-confirm":"Are you sure you want to reset the conversation?","close-widget":"Close widget","got-any-questions":"Got any questions? Chat with us!","typical-response-time":"Typically respond in less than 1 minute","session-closed-lead":"Your issue has been resolved!","create-new-ticket":"Create new ticket",exit:"Exit","reset-conversation":"Reset conversation","welcome-title":"Welcome to our support chat","welcome-description":"We're here to help! Start a conversation and we'll get back to you as soon as possible.","your-name":"Your name","your-email":"Your email address","start-chat":"Talk to support","starting-chat":"Connecting...","hello-greeting":"Hi there!"},ar:{ok:"حسنا",yes:"نعم",no:"لا",agree:"موافق",cancel:"إلغاء","yes-exit":"نعم، اخرج","yes-reset":"نعم، إعادة تعيين","no-cancel":"لا، إلغاء","are-you-sure":"هل أنت متأكد؟",recording:"تسجيل","thank-you":"شكرا","sorry-try-again":"عذرا، حاول مرة أخرى","error-occurred":"حدث خطأ","please-try-again":"يرجى المحاولة مرة أخرى","write-a-message":"اكتب رسالة...","send-message":"إرسال رسالة",connected:"متصل",connecting:"جاري الاتصال",reconnecting:"جاري إعادة الاتصال",reconnected:"تم إعادة الاتصال",disconnecting:"جاري قطع الاتصال",disconnected:"قطع الاتصال",error:"خطأ","persist-session":"حفظ الجلسة",settings:"إعدادات",close:"إغلاق",help:"مساعدة",chat:"محادثة",send:"إرسال",copy:"نسخ",copied:"تم النسخ","sound-effects":"التاثيرات الصوتية",language:"اللغة",select:"اختر",agent:"الوكيل",user:"المستخدم",bot:"البوت","reset-conversation-confirm":"هل أنت متأكد من أنك تريد إعادة تعيين المحادثة؟","close-widget":"إغلاق الودجة","got-any-questions":"هل لديك أي أسئلة؟ تحدث معنا!","typical-response-time":"عادة ما نرد في أقل من دقيقة واحدة","session-closed-lead":"تم حل مشكلتك!",exit:"خروج","create-new-ticket":"إنشاء تذكرة جديدة","reset-conversation":"إعادة تعيين المحادثة","welcome-title":"مرحبًا بك في دردشة الدعم الخاصة بنا","welcome-description":"نحن هنا للمساعدة! ابدأ محادثة وسنرد عليك في أقرب وقت ممكن.","your-name":"اسمك","your-email":"عنوان بريدك الإلكتروني","start-chat":"تحدث إلى الدعم","starting-chat":"جاري الاتصال...","hello-greeting":"مرحبًا! كيف يمكننا مساعدتك اليوم؟"},nl:{ok:"OK",yes:"Ja",no:"Nee",agree:"Akkoord",cancel:"Annuleren","yes-exit":"Ja, afsluiten","yes-reset":"Ja, resetten","no-cancel":"Nee, annuleren","are-you-sure":"Weet u het zeker?",recording:"Opname...","thank-you":"Dank u","sorry-try-again":"Sorry, probeer het opnieuw","error-occurred":"Er is een fout opgetreden","please-try-again":"Probeer het opnieuw","write-a-message":"Schrijf een bericht...","send-message":"Bericht verzenden",connected:"Verbonden",connecting:"Verbinding maken",reconnecting:"Opnieuw verbinding maken",reconnected:"Opnieuw verbonden",disconnecting:"Verbinding verbreken",disconnected:"Verbinding verbroken",error:"Fout","persist-session":"Sessie behouden",settings:"Instellingen",close:"Sluiten",help:"Help",chat:"Chat",send:"Verzenden",copy:"Kopiëren",copied:"Gekopieerd","sound-effects":"Geluidseffecten",language:"Taal",select:"Selecteren",agent:"Agent",user:"Gebruiker",bot:"Bot","reset-conversation-confirm":"Weet u zeker dat u het gesprek wilt resetten?","close-widget":"Widget sluiten","got-any-questions":"Heeft u vragen? Chat met ons!","typical-response-time":"We reageren doorgaans binnen 1 minuut","session-closed-lead":"Uw probleem is opgelost!","create-new-ticket":"Nieuw ticket aanmaken",exit:"Afsluiten","reset-conversation":"Gesprek resetten","welcome-title":"Welkom bij onze supportchat","welcome-description":"We zijn hier om te helpen! Begin een gesprek en we nemen zo snel mogelijk contact met u op.","your-name":"Uw naam","your-email":"Uw e-mailadres","start-chat":"Praat met ondersteuning","starting-chat":"Verbinding maken...","hello-greeting":"Hallo! Hoe kunnen we u vandaag helpen?"},fr:{ok:"D'accord",yes:"Oui",no:"Non",agree:"Accepter",cancel:"Annuler","yes-exit":"Oui, quitter","yes-reset":"Oui, réinitialiser","no-cancel":"Non, annuler","are-you-sure":"Êtes-vous sûr ?",recording:"Enregistrement...","thank-you":"Merci","sorry-try-again":"Désolé, veuillez réessayer","error-occurred":"Une erreur s'est produite","please-try-again":"Veuillez réessayer","write-a-message":"Écrivez un message...","send-message":"Envoyer le message",connected:"Connecté",connecting:"Connexion en cours",reconnecting:"Reconnexion en cours",reconnected:"Reconnecté",disconnecting:"Déconnexion en cours",disconnected:"Déconnecté",error:"Erreur","persist-session":"Conserver la session",settings:"Paramètres",close:"Fermer",help:"Aide",chat:"Chat",send:"Envoyer",copy:"Copier",copied:"Copié","sound-effects":"Effets sonores",language:"Langue",select:"Sélectionner",agent:"Agent",user:"Utilisateur",bot:"Bot","reset-conversation-confirm":"Êtes-vous sûr de vouloir réinitialiser la conversation ?","close-widget":"Fermer le widget","got-any-questions":"Vous avez des questions ? Chattez avec nous !","typical-response-time":"Nous répondons généralement en moins d'une minute","session-closed-lead":"Votre problème a été résolu !","create-new-ticket":"Créer un nouveau ticket",exit:"Sortie","reset-conversation":"Réinitialiser la conversation","welcome-title":"Bienvenue dans notre chat de support","welcome-description":"Nous sommes là pour vous aider ! Commencez une conversation et nous vous répondrons dès que possible.","your-name":"Votre nom","your-email":"Votre adresse e-mail","start-chat":"Parler au support","starting-chat":"Connexion...","hello-greeting":"Bonjour ! Comment pouvons-nous vous aider aujourd'hui ?"},de:{ok:"OK",yes:"Ja",no:"Nein",agree:"Zustimmen",cancel:"Stornieren","yes-exit":"Ja, beenden","yes-reset":"Ja, zurücksetzen","no-cancel":"Nein, abbrechen","are-you-sure":"Sind Sie sicher?",recording:"Aufnahme läuft","thank-you":"Vielen Dank","sorry-try-again":"Entschuldigung, bitte versuchen Sie es erneut","error-occurred":"Ein Fehler ist aufgetreten","please-try-again":"Bitte versuchen Sie es erneut","write-a-message":"Nachricht schreiben...","send-message":"Nachricht senden",connected:"Verbunden",connecting:"Verbindung wird hergestellt",reconnecting:"Verbindung wird wiederhergestellt",reconnected:"Wieder verbunden",disconnecting:"Verbindung wird getrennt",disconnected:"Verbindung getrennt",error:"Fehler","persist-session":"Sitzung beibehalten",settings:"Einstellungen",close:"Schließen",help:"Hilfe",chat:"Chat",send:"Senden",copy:"Kopieren",copied:"Kopiert","sound-effects":"Soundeffekte",language:"Sprache",select:"Auswählen",agent:"Agent",user:"Benutzer",bot:"Bot","got-any-questions":"Haben Sie Fragen? Chatten Sie mit uns!","typical-response-time":"Üblicherweise antworten wir in weniger als 1 Minute","reset-conversation-confirm":"Möchten Sie die Konversation wirklich zurücksetzen?","close-widget":"Widget schließen","session-closed-lead":"Ihr Problem wurde gelöst!","create-new-ticket":"Neues Ticket erstellen",exit:"Beenden","reset-conversation":"Konversation zurücksetzen","welcome-title":"Willkommen in unserem Support-Chat","welcome-description":"Wir sind hier, um zu helfen! Beginnen Sie ein Gespräch und wir werden so schnell wie möglich antworten.","your-name":"Ihr Name","your-email":"Ihre E-Mail-Adresse","start-chat":"Mit dem Support sprechen","starting-chat":"Verbindung wird hergestellt...","hello-greeting":"Hallo! Wie können wir Ihnen heute helfen?"},pt:{ok:"OK",yes:"Sim",no:"Não",agree:"Concordo",cancel:"Cancelar","yes-exit":"Sim, sair","yes-reset":"Sim, redefinir","no-cancel":"Não, cancelar","are-you-sure":"Você tem certeza?",recording:"Gravando...","thank-you":"Obrigado","sorry-try-again":"Desculpe, tente novamente","error-occurred":"Ocorreu um erro","please-try-again":"Por favor, tente novamente","write-a-message":"Escreva uma mensagem...","send-message":"Enviar mensagem",connected:"Conectado",connecting:"Conectando",reconnecting:"Reconectando",reconnected:"Reconectado",disconnecting:"Desconectando",disconnected:"Desconectado",error:"Erro","persist-session":"Persistir sessão",settings:"Configurações",close:"Fechar",help:"Ajuda",chat:"Bate-papo",send:"Enviar",copy:"Copiar",copied:"Copiado","sound-effects":"Efeitos sonoros",language:"Idioma",select:"Selecionar",agent:"Agente",user:"Usuário",bot:"Bot","reset-conversation-confirm":"Você tem certeza de que deseja redefinir a conversa?","close-widget":"Fechar widget","got-any-questions":"Tem alguma dúvida? Converse conosco!","typical-response-time":"Geralmente respondemos em menos de 1 minuto","session-closed-lead":"Seu problema foi resolvido!","create-new-ticket":"Criar novo ticket",exit:"Sair","reset-conversation":"Redefinir conversa","welcome-title":"Bem-vindo ao nosso chat de suporte","welcome-description":"Estamos aqui para ajudar! Inicie uma conversa e responderemos o mais rápido possível.","your-name":"Seu nome","your-email":"Seu endereço de email","start-chat":"Falar com o suporte","starting-chat":"Conectando...","hello-greeting":"Olá! Como podemos ajudar você hoje?"}},Ez=Object.keys(Pk),Tz=e=>Ez.includes(e);function _z(e,t){const n=Pk[t];return n&&n[e]||""}function Kf(){const{widgetCtx:{config:e}}=Qn();return y.useMemo(()=>{const n=Tz(e.language)?e.language:"en";return{get:r=>_z(r,n),lang:n}},[e.language])}const Sz=10,Cz={right:(e,t)=>({initial:{opacity:0,x:-e,...t.initial},animate:{opacity:1,x:0,...t.animate},exit:{opacity:0,x:e,...t.exit}}),left:(e,t)=>({initial:{opacity:0,x:e,...t.initial},animate:{opacity:1,x:0,...t.animate},exit:{opacity:0,x:-e,...t.exit}}),up:(e,t)=>({initial:{opacity:0,y:e,...t.initial},animate:{opacity:1,y:0,...t.animate},exit:{opacity:0,y:-e,...t.exit}}),down:(e,t)=>({initial:{opacity:0,y:-e,...t.initial},animate:{opacity:1,y:0,...t.animate},exit:{opacity:0,y:e,...t.exit}})},xi=y.forwardRef(({fadeIn:e="down",distance:t=Sz,children:n,snapExit:r=!1,overrides:i={},...a},o)=>{const s=e?Cz[e](t,i):{};return r&&s.exit&&typeof s.exit=="object"&&!Array.isArray(s.exit)&&(s.exit.transition={duration:0}),T.jsx(Ua.div,{ref:o,...a,...s,children:n})});xi.displayName="MotionDiv";function Ik(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Ik(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function kz(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Ik(e))&&(r&&(r+=" "),r+=t);return r}const Ok=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Dk=kz,Az=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Dk(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(u=>{const c=n==null?void 0:n[u],d=a==null?void 0:a[u];if(c===null)return null;const f=Ok(c)||Ok(d);return i[u][f]}),s=n&&Object.entries(n).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:f,...p}=c;return Object.entries(p).every(m=>{let[g,x]=m;return Array.isArray(x)?x.includes({...a,...s}[g]):{...a,...s}[g]===x})?[...u,d,f]:u},[]);return Dk(e,o,l,n==null?void 0:n.class,n==null?void 0:n.className)},Lk={x:2,y:2},Rz={1:"scale-[1]","1.01":"scale-[1.01]","1.02":"scale-[1.02]","1.1":"scale-[1.1]"},Xf=y.memo(y.forwardRef(({children:e,className:t,scale:n="1.02",off:r=!1},i)=>{const[a,o]=y.useState(!1),[s,l]=y.useState({x:0,y:0});if(r||/translate/.test(e.props.className||""))return e;const c=m=>{var D,V;const{clientX:g,clientY:x}=m,w=m.currentTarget.getBoundingClientRect(),v=g-(w.left+w.width/2),b=x-(w.top+w.height/2),E=Math.max(-1,Math.min(1,v/(w.width/2))),_=Math.max(-1,Math.min(1,b/(w.height/2))),S=E*Lk.x,I=_*Lk.y;l({x:S,y:I}),(V=(D=e.props).onMouseMove)==null||V.call(D,m)},d=()=>{var m,g;o(!0),(g=(m=e.props).onMouseEnter)==null||g.call(m)},f=()=>{var m,g;o(!1),l({x:0,y:0}),(g=(m=e.props).onMouseLeave)==null||g.call(m)},p={"--opencx-wobble-x":a?`${s.x}px`:"0px","--opencx-wobble-y":a?`${s.y}px`:"0px"};return y.cloneElement(e,{ref:i,onMouseMove:c,onMouseEnter:d,onMouseLeave:f,style:{...p,...e.props.style},className:Me("translate-x-[var(--opencx-wobble-x)]","translate-y-[var(--opencx-wobble-y)]",`hover:${Rz[n]}`,t,e.props.className,"transition-all ease-out")})}));Xf.displayName="Wobble";const Nz=Az(Me("inline-flex shrink-0 items-center justify-center gap-2","text-sm font-medium whitespace-nowrap","ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50","shadow-sm active:shadow-none active:scale-95 hover:active:scale-95","rounded-xl","border","transition"),{variants:{variant:{default:"border-primary bg-primary text-primary-foreground",destructive:"border-destructive bg-destructive text-destructive-foreground",outline:"bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground",ghost:"border-transparent shadow-none hover:bg-accent hover:text-accent-foreground",link:"border-transparent shadow-none text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-8 px-3 text-xs",lg:"h-11 px-8",icon:"h-10 w-10",fit:"size-fit p-2"}},defaultVariants:{variant:"default",size:"default"}}),pa=y.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>{const o=r?If:"button";return T.jsx(Xf,{ref:a,children:T.jsx(o,{className:Me(Nz({variant:t,size:n,className:e})),...i})})});pa.displayName="Button";function Pz({file:{status:e,file:t,error:n},onCancel:r}){const[i,a]=y.useState(null);y.useEffect(()=>{if(!t.type.startsWith("image/"))return;const l=new FileReader;return l.onload=()=>a(l.result),l.onerror=()=>console.error("Error reading file"),l.readAsDataURL(t),()=>l.abort()},[t]);const o=()=>{switch(e){case"uploading":return T.jsx(PL,{className:"size-4 animate-spin"});case"error":return T.jsx(SL,{className:"size-4 text-destructive"});default:return null}},s=()=>{const l=t.type.split("/")[0];return l==="image"&&i?T.jsx("img",{src:typeof i=="string"?i:"",className:"object-cover bg-secondary size-full",alt:t.name}):l==="audio"?T.jsx(RL,{}):T.jsx(NL,{})};return T.jsx(qw,{side:"bottom",content:e==="error"?T.jsxs("span",{className:"text-destructive",children:["Failed to upload: ",n]}):t.name,children:T.jsxs("div",{"data-test":"file-display",className:Me(e==="uploading"&&"opacity-50","group","size-12 border rounded-2xl overflow-hidden relative","flex items-center justify-center shrink-0"),children:[T.jsx("div",{className:"absolute inset-0 flex items-center justify-center","data-test":"file-status",children:o()}),T.jsx("button",{"data-test":"file-cancel-button",className:Me("absolute bg-black/50 inset-0 size-full z-10 opacity-0","flex items-center justify-center","opacity-0 group-hover:opacity-100 transition"),onClick:r,children:T.jsx(oE,{className:"size-4 text-primary-foreground"})}),T.jsx(s,{})]})})}const Mk=Me("rounded-3xl");function Iz(){var E;const e=y.useRef(null),{messageCtx:t}=hd(),{session:n}=md(),r=Kf(),[i,a]=y.useState(""),{allFiles:o,emptyTheFiles:s,handleCancelUpload:l,appendFiles:u,isUploading:c,successFiles:d}=Z9(),f=!!((E=n.session)!=null&&E.isHandedOff),{isAwaitingBotReply:p}=JT(),m=_=>{f&&u(_)},g=async()=>{if(p)return;if(c){const S="please wait for the file(s) to upload";oT.error(S),console.info(S)}const _=i.trim();_&&(a(""),s(),await t.sendMessage({content:_,attachments:d.map(S=>({url:S.fileUrl,type:S.file.type,name:S.file.name,id:S.id,size:S.file.size}))}))},{getRootProps:x,getInputProps:w,open:v}=eT({onDrop:m,noClick:!0,onDropRejected(){if(f){const _="unsupported file type, or the file is too large";oT.error(_),console.error(_)}},maxSize:5*1024*1024,accept:{"text/*":[".txt"],"image/*":[".png",".jpg",".jpeg",".gif"],"application/pdf":[".pdf"]}}),b=_=>{const S=_.clipboardData;S&&S.files.length>0&&m(Array.from(S.files))};return T.jsxs("div",{className:"p-2 relative space-y-1",...x(),"data-test":"chat-input-container",children:[T.jsx("input",{...w()}),T.jsxs("div",{className:Me(Mk,"relative space-y-2 border transition-all shadow py-2"),"data-test":"chat-input-wrapper",children:[T.jsx("div",{className:"flex items-center gap-1 px-2","data-test":"file-attachments-container",children:T.jsx(fl,{mode:"popLayout",children:o.map(_=>T.jsx(xi,{snapExit:!0,children:T.jsx(Pz,{onCancel:()=>l(_.id),file:_})},_.id))})}),T.jsx("textarea",{onPaste:b,ref:e,id:"chat-input",dir:"auto",value:i,rows:3,"data-test":"chat-message-input",className:Me(Mk,"w-full px-3","resize-none","bg-transparent outline-none","text-sm"),onChange:_=>a(_.target.value),onKeyDown:async _=>{_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),g())},placeholder:r.get("write-a-message")}),T.jsxs("div",{className:"px-2 flex justify-between","data-test":"chat-input-actions",children:[T.jsx(qw,{side:"top",align:"start",content:"attach files, (maximum size 5mb)",children:T.jsx(pa,{onClick:()=>{f&&v()},size:"fit",variant:"outline","data-test":"attach-file-button",className:Me("disabled:opacity-0","rounded-full size-8 flex items-center justify-center p-0"),disabled:!f,children:T.jsx(IL,{className:"size-4"})})}),T.jsx(qw,{content:"send message",side:"top",align:"end",children:T.jsx(pa,{size:"fit",onClick:g,disabled:p||c,"data-test":"send-message-button",className:"rounded-full size-8 flex items-center justify-center p-0",children:p?T.jsx(CL,{className:"size-4 animate-spin animate-iteration-infinite","data-test":"sending-message-indicator"}):T.jsx(aE,{className:"size-4 rtl:-scale-100"})})})]})]})]})}function Oz(){const{widgetCtx:e}=Qn(),t=Kf();return T.jsx("div",{className:"p-2","data-test":"session-closed-container",children:T.jsxs("div",{className:"p-2 bg-background rounded-3xl border shadow-2xl space-y-2","data-test":"session-closed-content",children:[T.jsxs("div",{className:"flex items-center gap-1","data-test":"session-closed-header",children:[T.jsx(EL,{className:"size-4 text-emerald-500"}),T.jsx("h2",{className:"text-sm font-medium",dir:"auto",children:t.get("session-closed-lead")})]}),T.jsx("div",{children:T.jsx(pa,{onClick:e.resetChat,className:"rounded-2xl w-full","data-test":"create-new-ticket-button",children:t.get("create-new-ticket")})})]})})}function Dz(){var t;const{session:e}=md();return T.jsx("div",{children:T.jsx(fl,{mode:"wait",children:e.session&&!((t=e.session)!=null&&t.isOpened)?T.jsx(xi,{className:"overflow-hidden",overrides:{initial:{height:0},animate:{height:"auto"},exit:{height:0}},children:T.jsx(Oz,{})},"session-closed"):T.jsx(xi,{className:"overflow-hidden",overrides:{initial:{height:0},animate:{height:"auto"},exit:{height:0}},children:T.jsx(Iz,{})},"chat-input")})})}function Fe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Fk(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Qf(...e){return t=>{let n=!1;const r=e.map(i=>{const a=Fk(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():Fk(e[i],null)}}}}function Sn(...e){return y.useCallback(Qf(...e),e)}var yu=y.forwardRef((e,t)=>{const{children:n,...r}=e,i=y.Children.toArray(n),a=i.find(Mz);if(a){const o=a.props.children,s=i.map(l=>l===a?y.Children.count(o)>1?y.Children.only(null):y.isValidElement(o)?o.props.children:null:l);return T.jsx(Gw,{...r,ref:t,children:y.isValidElement(o)?y.cloneElement(o,void 0,s):null})}return T.jsx(Gw,{...r,ref:t,children:n})});yu.displayName="Slot";var Gw=y.forwardRef((e,t)=>{const{children:n,...r}=e;if(y.isValidElement(n)){const i=Bz(n);return y.cloneElement(n,{...Fz(r,n.props),ref:t?Qf(t,i):i})}return y.Children.count(n)>1?y.Children.only(null):null});Gw.displayName="SlotClone";var Lz=({children:e})=>T.jsx(T.Fragment,{children:e});function Mz(e){return y.isValidElement(e)&&e.type===Lz}function Fz(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...s)=>{a(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function Bz(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var jz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Cn=jz.reduce((e,t)=>{const n=y.forwardRef((r,i)=>{const{asChild:a,...o}=r,s=a?yu:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),T.jsx(s,{...o,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Bk(e,t){e&&hs.flushSync(()=>e.dispatchEvent(t))}function jk(e){const t=e+"CollectionProvider",[n,r]=Ui(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:m,children:g}=p,x=mn.useRef(null),w=mn.useRef(new Map).current;return T.jsx(i,{scope:m,itemMap:w,collectionRef:x,children:g})};o.displayName=t;const s=e+"CollectionSlot",l=mn.forwardRef((p,m)=>{const{scope:g,children:x}=p,w=a(s,g),v=Sn(m,w.collectionRef);return T.jsx(yu,{ref:v,children:x})});l.displayName=s;const u=e+"CollectionItemSlot",c="data-radix-collection-item",d=mn.forwardRef((p,m)=>{const{scope:g,children:x,...w}=p,v=mn.useRef(null),b=Sn(m,v),E=a(u,g);return mn.useEffect(()=>(E.itemMap.set(v,{ref:v,...w}),()=>void E.itemMap.delete(v))),T.jsx(yu,{[c]:"",ref:b,children:x})});d.displayName=u;function f(p){const m=a(e+"CollectionConsumer",p);return mn.useCallback(()=>{const x=m.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${c}]`));return Array.from(m.itemMap.values()).sort((E,_)=>w.indexOf(E.ref.current)-w.indexOf(_.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:o,Slot:l,ItemSlot:d},f,r]}var Uz=y.createContext(void 0);function Uk(e){const t=y.useContext(Uz);return e||t||"ltr"}var zz="DismissableLayer",Kw="dismissableLayer.update",Hz="dismissableLayer.pointerDownOutside",Vz="dismissableLayer.focusOutside",zk,Hk=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Vk=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...l}=e,u=y.useContext(Hk),[c,d]=y.useState(null),f=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=y.useState({}),m=Sn(t,I=>d(I)),g=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),w=g.indexOf(x),v=c?g.indexOf(c):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,E=v>=w,_=Yz(I=>{const D=I.target,V=[...u.branches].some(N=>N.contains(D));!E||V||(i==null||i(I),o==null||o(I),I.defaultPrevented||s==null||s())},f),S=qz(I=>{const D=I.target;[...u.branches].some(N=>N.contains(D))||(a==null||a(I),o==null||o(I),I.defaultPrevented||s==null||s())},f);return TC(I=>{v===u.layers.size-1&&(r==null||r(I),!I.defaultPrevented&&s&&(I.preventDefault(),s()))},f),y.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(zk=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),$k(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=zk)}},[c,f,n,u]),y.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),$k())},[c,u]),y.useEffect(()=>{const I=()=>p({});return document.addEventListener(Kw,I),()=>document.removeEventListener(Kw,I)},[]),T.jsx(Cn.div,{...l,ref:m,style:{pointerEvents:b?E?"auto":"none":void 0,...e.style},onFocusCapture:Fe(e.onFocusCapture,S.onFocusCapture),onBlurCapture:Fe(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:Fe(e.onPointerDownCapture,_.onPointerDownCapture)})});Vk.displayName=zz;var $z="DismissableLayerBranch",Wz=y.forwardRef((e,t)=>{const n=y.useContext(Hk),r=y.useRef(null),i=Sn(t,r);return y.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),T.jsx(Cn.div,{...e,ref:i})});Wz.displayName=$z;function Yz(e,t=globalThis==null?void 0:globalThis.document){const n=Wt(e),r=y.useRef(!1),i=y.useRef(()=>{});return y.useEffect(()=>{const a=s=>{if(s.target&&!r.current){let l=function(){Wk(Hz,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function qz(e,t=globalThis==null?void 0:globalThis.document){const n=Wt(e),r=y.useRef(!1);return y.useEffect(()=>{const i=a=>{a.target&&!r.current&&Wk(Vz,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function $k(){const e=new CustomEvent(Kw);document.dispatchEvent(e)}function Wk(e,t,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Bk(i,a):i.dispatchEvent(a)}var Xw=0;function Yk(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??qk()),document.body.insertAdjacentElement("beforeend",e[1]??qk()),Xw++,()=>{Xw===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Xw--}},[])}function qk(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Qw="focusScope.autoFocusOnMount",Zw="focusScope.autoFocusOnUnmount",Gk={bubbles:!1,cancelable:!0},Gz="FocusScope",Kk=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,l]=y.useState(null),u=Wt(i),c=Wt(a),d=y.useRef(null),f=Sn(t,g=>l(g)),p=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let g=function(b){if(p.paused||!s)return;const E=b.target;s.contains(E)?d.current=E:ha(d.current,{select:!0})},x=function(b){if(p.paused||!s)return;const E=b.relatedTarget;E!==null&&(s.contains(E)||ha(d.current,{select:!0}))},w=function(b){if(document.activeElement===document.body)for(const _ of b)_.removedNodes.length>0&&ha(s)};document.addEventListener("focusin",g),document.addEventListener("focusout",x);const v=new MutationObserver(w);return s&&v.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",x),v.disconnect()}}},[r,s,p.paused]),y.useEffect(()=>{if(s){Zk.add(p);const g=document.activeElement;if(!s.contains(g)){const w=new CustomEvent(Qw,Gk);s.addEventListener(Qw,u),s.dispatchEvent(w),w.defaultPrevented||(Kz(eH(Xk(s)),{select:!0}),document.activeElement===g&&ha(s))}return()=>{s.removeEventListener(Qw,u),setTimeout(()=>{const w=new CustomEvent(Zw,Gk);s.addEventListener(Zw,c),s.dispatchEvent(w),w.defaultPrevented||ha(g??document.body,{select:!0}),s.removeEventListener(Zw,c),Zk.remove(p)},0)}}},[s,u,c,p]);const m=y.useCallback(g=>{if(!n&&!r||p.paused)return;const x=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,w=document.activeElement;if(x&&w){const v=g.currentTarget,[b,E]=Xz(v);b&&E?!g.shiftKey&&w===E?(g.preventDefault(),n&&ha(b,{select:!0})):g.shiftKey&&w===b&&(g.preventDefault(),n&&ha(E,{select:!0})):w===v&&g.preventDefault()}},[n,r,p.paused]);return T.jsx(Cn.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});Kk.displayName=Gz;function Kz(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ha(r,{select:t}),document.activeElement!==n)return}function Xz(e){const t=Xk(e),n=Qk(t,e),r=Qk(t.reverse(),e);return[n,r]}function Xk(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Qk(e,t){for(const n of e)if(!Qz(n,{upTo:t}))return n}function Qz(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Zz(e){return e instanceof HTMLInputElement&&"select"in e}function ha(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Zz(e)&&t&&e.select()}}var Zk=Jz();function Jz(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Jk(e,t),e.unshift(t)},remove(t){var n;e=Jk(e,t),(n=e[0])==null||n.resume()}}}function Jk(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function eH(e){return e.filter(t=>t.tagName!=="A")}var tH="Arrow",eA=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...a}=e;return T.jsx(Cn.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:T.jsx("polygon",{points:"0,0 30,0 15,10"})})});eA.displayName=tH;var nH=eA,Jw="Popper",[tA,nA]=Ui(Jw),[rH,rA]=tA(Jw),iA=e=>{const{__scopePopper:t,children:n}=e,[r,i]=y.useState(null);return T.jsx(rH,{scope:t,anchor:r,onAnchorChange:i,children:n})};iA.displayName=Jw;var aA="PopperAnchor",oA=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,a=rA(aA,n),o=y.useRef(null),s=Sn(t,o);return y.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:T.jsx(Cn.div,{...i,ref:s})});oA.displayName=aA;var e1="PopperContent",[iH,aH]=tA(e1),sA=y.forwardRef((e,t)=>{var $e,Ve,We,Ge,St,Te;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:o=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:m,...g}=e,x=rA(e1,n),[w,v]=y.useState(null),b=Sn(t,xe=>v(xe)),[E,_]=y.useState(null),S=ek(E),I=(S==null?void 0:S.width)??0,D=(S==null?void 0:S.height)??0,V=r+(a!=="center"?"-"+a:""),N=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},$=Array.isArray(u)?u:[u],z=$.length>0,X={padding:N,boundary:$.filter(sH),altBoundary:z},{refs:Y,floatingStyles:ne,placement:re,isPositioned:ee,middlewareData:F}=WC({strategy:"fixed",placement:V,whileElementsMounted:(...xe)=>zC(...xe,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[YC({mainAxis:i+D,alignmentAxis:o}),l&&qC({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?GC():void 0,...X}),l&&KC({...X}),XC({...X,apply:({elements:xe,rects:Ye,availableWidth:ze,availableHeight:vt})=>{const{width:bt,height:Ke}=Ye.reference,Le=xe.floating.style;Le.setProperty("--radix-popper-available-width",`${ze}px`),Le.setProperty("--radix-popper-available-height",`${vt}px`),Le.setProperty("--radix-popper-anchor-width",`${bt}px`),Le.setProperty("--radix-popper-anchor-height",`${Ke}px`)}}),E&&ZC({element:E,padding:s}),lH({arrowWidth:I,arrowHeight:D}),f&&QC({strategy:"referenceHidden",...X})]}),[B,k]=cA(re),ie=Wt(m);ir(()=>{ee&&(ie==null||ie())},[ee,ie]);const he=($e=F.arrow)==null?void 0:$e.x,O=(Ve=F.arrow)==null?void 0:Ve.y,Pe=((We=F.arrow)==null?void 0:We.centerOffset)!==0,[ge,ve]=y.useState();return ir(()=>{w&&ve(window.getComputedStyle(w).zIndex)},[w]),T.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...ne,transform:ee?ne.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[(Ge=F.transformOrigin)==null?void 0:Ge.x,(St=F.transformOrigin)==null?void 0:St.y].join(" "),...((Te=F.hide)==null?void 0:Te.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:T.jsx(iH,{scope:n,placedSide:B,onArrowChange:_,arrowX:he,arrowY:O,shouldHideArrow:Pe,children:T.jsx(Cn.div,{"data-side":B,"data-align":k,...g,ref:b,style:{...g.style,animation:ee?void 0:"none"}})})})});sA.displayName=e1;var lA="PopperArrow",oH={top:"bottom",right:"left",bottom:"top",left:"right"},uA=y.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,a=aH(lA,r),o=oH[a.placedSide];return T.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:T.jsx(nH,{...i,ref:n,style:{...i.style,display:"block"}})})});uA.displayName=lA;function sH(e){return e!==null}var lH=e=>({name:"transformOrigin",options:e,fn(t){var x,w,v;const{placement:n,rects:r,middlewareData:i}=t,o=((x=i.arrow)==null?void 0:x.centerOffset)!==0,s=o?0:e.arrowWidth,l=o?0:e.arrowHeight,[u,c]=cA(n),d={start:"0%",center:"50%",end:"100%"}[c],f=(((w=i.arrow)==null?void 0:w.x)??0)+s/2,p=(((v=i.arrow)==null?void 0:v.y)??0)+l/2;let m="",g="";return u==="bottom"?(m=o?d:`${f}px`,g=`${-l}px`):u==="top"?(m=o?d:`${f}px`,g=`${r.floating.height+l}px`):u==="right"?(m=`${-l}px`,g=o?d:`${p}px`):u==="left"&&(m=`${r.floating.width+l}px`,g=o?d:`${p}px`),{data:{x:m,y:g}}}});function cA(e){const[t,n="center"]=e.split("-");return[t,n]}var uH=iA,cH=oA,dH=sA,fH=uA;function pH(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var Zf=e=>{const{present:t,children:n}=e,r=hH(t),i=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),a=Sn(r.ref,mH(i));return typeof n=="function"||r.isPresent?y.cloneElement(i,{ref:a}):null};Zf.displayName="Presence";function hH(e){const[t,n]=y.useState(),r=y.useRef({}),i=y.useRef(e),a=y.useRef("none"),o=e?"mounted":"unmounted",[s,l]=pH(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const u=Jf(r.current);a.current=s==="mounted"?u:"none"},[s]),ir(()=>{const u=r.current,c=i.current;if(c!==e){const f=a.current,p=Jf(u);e?l("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),ir(()=>{if(t){let u;const c=t.ownerDocument.defaultView??window,d=p=>{const g=Jf(r.current).includes(p.animationName);if(p.target===t&&g&&(l("ANIMATION_END"),!i.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},f=p=>{p.target===t&&(a.current=Jf(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{c.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:y.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Jf(e){return(e==null?void 0:e.animationName)||"none"}function mH(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var t1="rovingFocusGroup.onEntryFocus",gH={bubbles:!1,cancelable:!0},ep="RovingFocusGroup",[n1,dA,wH]=jk(ep),[yH,fA]=Ui(ep,[wH]),[vH,bH]=yH(ep),pA=y.forwardRef((e,t)=>T.jsx(n1.Provider,{scope:e.__scopeRovingFocusGroup,children:T.jsx(n1.Slot,{scope:e.__scopeRovingFocusGroup,children:T.jsx(xH,{...e,ref:t})})}));pA.displayName=ep;var xH=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...d}=e,f=y.useRef(null),p=Sn(t,f),m=Uk(a),[g=null,x]=$f({prop:o,defaultProp:s,onChange:l}),[w,v]=y.useState(!1),b=Wt(u),E=dA(n),_=y.useRef(!1),[S,I]=y.useState(0);return y.useEffect(()=>{const D=f.current;if(D)return D.addEventListener(t1,b),()=>D.removeEventListener(t1,b)},[b]),T.jsx(vH,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:g,onItemFocus:y.useCallback(D=>x(D),[x]),onItemShiftTab:y.useCallback(()=>v(!0),[]),onFocusableItemAdd:y.useCallback(()=>I(D=>D+1),[]),onFocusableItemRemove:y.useCallback(()=>I(D=>D-1),[]),children:T.jsx(Cn.div,{tabIndex:w||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:Fe(e.onMouseDown,()=>{_.current=!0}),onFocus:Fe(e.onFocus,D=>{const V=!_.current;if(D.target===D.currentTarget&&V&&!w){const N=new CustomEvent(t1,gH);if(D.currentTarget.dispatchEvent(N),!N.defaultPrevented){const $=E().filter(re=>re.focusable),z=$.find(re=>re.active),X=$.find(re=>re.id===g),ne=[z,X,...$].filter(Boolean).map(re=>re.ref.current);gA(ne,c)}}_.current=!1}),onBlur:Fe(e.onBlur,()=>v(!1))})})}),hA="RovingFocusGroupItem",mA=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,...o}=e,s=fu(),l=a||s,u=bH(hA,n),c=u.currentTabStopId===l,d=dA(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=u;return y.useEffect(()=>{if(r)return f(),()=>p()},[r,f,p]),T.jsx(n1.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:T.jsx(Cn.span,{tabIndex:c?0:-1,"data-orientation":u.orientation,...o,ref:t,onMouseDown:Fe(e.onMouseDown,m=>{r?u.onItemFocus(l):m.preventDefault()}),onFocus:Fe(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Fe(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){u.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const g=_H(m,u.orientation,u.dir);if(g!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let w=d().filter(v=>v.focusable).map(v=>v.ref.current);if(g==="last")w.reverse();else if(g==="prev"||g==="next"){g==="prev"&&w.reverse();const v=w.indexOf(m.currentTarget);w=u.loop?SH(w,v+1):w.slice(v+1)}setTimeout(()=>gA(w))}})})})});mA.displayName=hA;var EH={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function TH(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function _H(e,t,n){const r=TH(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return EH[r]}function gA(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function SH(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var CH=pA,kH=mA,AH=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Es=new WeakMap,tp=new WeakMap,np={},r1=0,wA=function(e){return e&&(e.host||wA(e.parentNode))},RH=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=wA(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},NH=function(e,t,n,r){var i=RH(t,Array.isArray(e)?e:[e]);np[n]||(np[n]=new WeakMap);var a=np[n],o=[],s=new Set,l=new Set(i),u=function(d){!d||s.has(d)||(s.add(d),u(d.parentNode))};i.forEach(u);var c=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(s.has(f))c(f);else try{var p=f.getAttribute(r),m=p!==null&&p!=="false",g=(Es.get(f)||0)+1,x=(a.get(f)||0)+1;Es.set(f,g),a.set(f,x),o.push(f),g===1&&m&&tp.set(f,!0),x===1&&f.setAttribute(n,"true"),m||f.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",f,w)}})};return c(t),s.clear(),r1++,function(){o.forEach(function(d){var f=Es.get(d)-1,p=a.get(d)-1;Es.set(d,f),a.set(d,p),f||(tp.has(d)||d.removeAttribute(r),tp.delete(d)),p||d.removeAttribute(n)}),r1--,r1||(Es=new WeakMap,Es=new WeakMap,tp=new WeakMap,np={})}},yA=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=AH(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),NH(r,i,n,"aria-hidden")):function(){return null}},rp="right-scroll-bar-position",ip="width-before-scroll-bar",PH="with-scroll-bars-hidden",IH="--removed-body-scroll-bar-size";function i1(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function OH(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var DH=typeof window<"u"?y.useLayoutEffect:y.useEffect,vA=new WeakMap;function LH(e,t){var n=OH(null,function(r){return e.forEach(function(i){return i1(i,r)})});return DH(function(){var r=vA.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;i.forEach(function(s){a.has(s)||i1(s,null)}),a.forEach(function(s){i.has(s)||i1(s,o)})}vA.set(n,e)},[e]),n}function MH(e){return e}function FH(e,t){t===void 0&&(t=MH);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var o=t(a,r);return n.push(o),function(){n=n.filter(function(s){return s!==o})}},assignSyncMedium:function(a){for(r=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(s){return a(s)},filter:function(){return n}}},assignMedium:function(a){r=!0;var o=[];if(n.length){var s=n;n=[],s.forEach(a),o=n}var l=function(){var c=o;o=[],c.forEach(a)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(c){o.push(c),u()},filter:function(c){return o=o.filter(c),n}}}};return i}function bA(e){e===void 0&&(e={});var t=FH(null);return t.options=Ot({async:!0,ssr:!1},e),t}var xA=function(e){var t=e.sideCar,n=pl(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return y.createElement(r,Ot({},n))};xA.isSideCarExport=!0;function EA(e,t){return e.useMedium(t),xA}var TA=bA(),a1=function(){},ap=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:a1,onWheelCapture:a1,onTouchMoveCapture:a1}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,c=e.enabled,d=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,g=e.allowPinchZoom,x=e.as,w=x===void 0?"div":x,v=e.gapMode,b=pl(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=f,_=LH([n,t]),S=Ot(Ot({},b),i);return y.createElement(y.Fragment,null,c&&y.createElement(E,{sideCar:TA,removeScrollBar:u,shards:d,noIsolation:p,inert:m,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:v}),o?y.cloneElement(y.Children.only(s),Ot(Ot({},S),{ref:_})):y.createElement(w,Ot({},S,{className:l,ref:_}),s))});ap.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ap.classNames={fullWidth:ip,zeroRight:rp};var _A=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function BH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=_A();return t&&e.setAttribute("nonce",t),e}function jH(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function UH(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var zH=function(){var e=0,t=null;return{add:function(n){e==0&&(t=BH())&&(jH(t,n),UH(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},HH=function(){var e=zH();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},VH=function(){var e=HH(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},$H={left:0,top:0,right:0,gap:0},o1=function(e){return parseInt(e||"",10)||0},WH=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[o1(n),o1(r),o1(i)]},YH=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return $H;var t=WH(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},qH=VH(),Ts="data-scroll-locked",GH=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n="margin"),`
|
|
331
|
+
`+a.stack}return{value:e,source:t,stack:i,digest:null}}function Y0(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function q0(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var DB=typeof WeakMap=="function"?WeakMap:Map;function NS(e,t,n){n=mi(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){yf||(yf=!0,lw=r),q0(e,t)},n}function PS(e,t,n){n=mi(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){q0(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){q0(e,t),typeof r!="function"&&(na===null?na=new Set([this]):na.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function IS(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new DB;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=GB.bind(null,e,t,n),t.then(e,e))}function OS(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function DS(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=mi(-1,1),t.tag=2,ea(n,t,1))),n.lanes|=1),e)}var LB=ui.ReactCurrentOwner,En=!1;function un(e,t,n,r){t.child=e===null?eS(t,null,n,r):as(t,e.child,n,r)}function LS(e,t,n,r,i){n=n.render;var a=t.ref;return ss(t,i),r=B0(e,t,n,r,a,i),n=j0(),e!==null&&!En?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,gi(e,t,i)):(st&&n&&x0(t),t.flags|=1,un(e,t,r,i),t.child)}function MS(e,t,n,r,i){if(e===null){var a=n.type;return typeof a=="function"&&!mw(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,FS(e,t,a,r,i)):(e=_f(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var o=a.memoizedProps;if(n=n.compare,n=n!==null?n:Wl,n(o,r)&&e.ref===t.ref)return gi(e,t,i)}return t.flags|=1,e=oa(a,r),e.ref=t.ref,e.return=t,t.child=e}function FS(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Wl(a,r)&&e.ref===t.ref)if(En=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(En=!0);else return t.lanes=e.lanes,gi(e,t,i)}return G0(e,t,n,r,i)}function BS(e,t,n){var r=t.pendingProps,i=r.children,a=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Je(ds,Un),Un|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Je(ds,Un),Un|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,Je(ds,Un),Un|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,Je(ds,Un),Un|=r;return un(e,t,i,n),t.child}function jS(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function G0(e,t,n,r,i){var a=xn(n)?Ga:Qt.current;return a=ts(t,a),ss(t,i),n=B0(e,t,n,r,a,i),r=j0(),e!==null&&!En?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,gi(e,t,i)):(st&&r&&x0(t),t.flags|=1,un(e,t,n,i),t.child)}function US(e,t,n,r,i){if(xn(n)){var a=!0;Gd(t)}else a=!1;if(ss(t,i),t.stateNode===null)pf(e,t),AS(t,n,r),W0(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var l=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=er(u):(u=xn(n)?Ga:Qt.current,u=ts(t,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==r||l!==u)&&RS(t,o,r,u),Ji=!1;var f=t.memoizedState;o.state=f,rf(t,r,o,i),l=t.memoizedState,s!==r||f!==l||bn.current||Ji?(typeof c=="function"&&($0(t,n,c,r),l=t.memoizedState),(s=Ji||kS(t,n,s,r,f,l,u))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=u,r=s):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,nS(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:vr(t.type,s),o.props=u,d=t.pendingProps,f=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=er(l):(l=xn(n)?Ga:Qt.current,l=ts(t,l));var p=n.getDerivedStateFromProps;(c=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==d||f!==l)&&RS(t,o,r,l),Ji=!1,f=t.memoizedState,o.state=f,rf(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||bn.current||Ji?(typeof p=="function"&&($0(t,n,p,r),m=t.memoizedState),(u=Ji||kS(t,n,u,r,f,m,l)||!1)?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,m,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=l,r=u):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return K0(e,t,n,r,a,i)}function K0(e,t,n,r,i,a){jS(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&W_(t,n,!1),gi(e,t,a);r=t.stateNode,LB.current=t;var s=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=as(t,e.child,null,a),t.child=as(t,null,s,a)):un(e,t,s,a),t.memoizedState=r.state,i&&W_(t,n,!0),t.child}function zS(e){var t=e.stateNode;t.pendingContext?V_(e,t.pendingContext,t.pendingContext!==t.context):t.context&&V_(e,t.context,!1),I0(e,t.containerInfo)}function HS(e,t,n,r,i){return is(),S0(i),t.flags|=256,un(e,t,n,r),t.child}var X0={dehydrated:null,treeContext:null,retryLane:0};function Q0(e){return{baseLanes:e,cachePool:null,transitions:null}}function VS(e,t,n){var r=t.pendingProps,i=ft.current,a=!1,o=(t.flags&128)!==0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Je(ft,i&1),e===null)return _0(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:"hidden",children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=Sf(o,r,0,null),e=io(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Q0(n),t.memoizedState=X0,e):Z0(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return MB(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=oa(i,l),r.subtreeFlags=i.subtreeFlags&14680064),s!==null?a=oa(s,a):(a=io(a,o,n,null),a.flags|=2),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?Q0(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=X0,r}return a=e.child,e=a.sibling,r=oa(a,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Z0(e,t){return t=Sf({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ff(e,t,n,r){return r!==null&&S0(r),as(t,e.child,null,n),e=Z0(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function MB(e,t,n,r,i,a,o){if(n)return t.flags&256?(t.flags&=-257,r=Y0(Error(Q(422))),ff(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,i=t.mode,r=Sf({mode:"visible",children:r.children},i,0,null),a=io(a,i,o,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&as(t,e.child,null,o),t.child.memoizedState=Q0(o),t.memoizedState=X0,a);if(!(t.mode&1))return ff(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var s=r.dgst;return r=s,a=Error(Q(419)),r=Y0(a,r,void 0),ff(e,t,o,r)}if(s=(o&e.childLanes)!==0,En||s){if(r=Lt,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,hi(e,i),Er(r,e,i,-1))}return hw(),r=Y0(Error(Q(421))),ff(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=KB.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,jn=Ki(i.nextSibling),Bn=t,st=!0,yr=null,e!==null&&(Zn[Jn++]=fi,Zn[Jn++]=pi,Zn[Jn++]=Ka,fi=e.id,pi=e.overflow,Ka=t),t=Z0(t,r.children),t.flags|=4096,t)}function $S(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),R0(e.return,t,n)}function J0(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function WS(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(un(e,t,r.children,n),r=ft.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&$S(e,n,t);else if(e.tag===19)$S(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Je(ft,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&af(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),J0(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&af(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}J0(t,!0,n,null,a);break;case"together":J0(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function pf(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function gi(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),eo|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Q(153));if(t.child!==null){for(e=t.child,n=oa(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=oa(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function FB(e,t,n){switch(t.tag){case 3:zS(t),is();break;case 5:aS(t);break;case 1:xn(t.type)&&Gd(t);break;case 4:I0(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Je(ef,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Je(ft,ft.current&1),t.flags|=128,null):n&t.child.childLanes?VS(e,t,n):(Je(ft,ft.current&1),e=gi(e,t,n),e!==null?e.sibling:null);Je(ft,ft.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return WS(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Je(ft,ft.current),r)break;return null;case 22:case 23:return t.lanes=0,BS(e,t,n)}return gi(e,t,n)}var YS,ew,qS,GS;YS=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},ew=function(){},qS=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Za(jr.current);var a=null;switch(n){case"input":i=Rg(e,i),r=Rg(e,r),a=[];break;case"select":i=dt({},i,{value:void 0}),r=dt({},r,{value:void 0}),a=[];break;case"textarea":i=Ig(e,i),r=Ig(e,r),a=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Wd)}Dg(n,r);var o;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var s=i[u];for(o in s)s.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(_l.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in r){var l=r[u];if(s=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==s&&(l!=null||s!=null))if(u==="style")if(s){for(o in s)!s.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&s[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(a||(a=[]),a.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,s=s?s.__html:void 0,l!=null&&s!==l&&(a=a||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(a=a||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(_l.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&tt("scroll",e),a||s===l||(a=[])):(a=a||[]).push(u,l))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}},GS=function(e,t,n,r){n!==r&&(t.flags|=4)};function ou(e,t){if(!st)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Jt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function BB(e,t,n){var r=t.pendingProps;switch(E0(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Jt(t),null;case 1:return xn(t.type)&&qd(),Jt(t),null;case 3:return r=t.stateNode,ls(),nt(bn),nt(Qt),L0(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Zd(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,yr!==null&&(dw(yr),yr=null))),ew(e,t),Jt(t),null;case 5:O0(t);var i=Za(tu.current);if(n=t.type,e!==null&&t.stateNode!=null)qS(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(Q(166));return Jt(t),null}if(e=Za(jr.current),Zd(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[Br]=t,r[Xl]=a,e=(t.mode&1)!==0,n){case"dialog":tt("cancel",r),tt("close",r);break;case"iframe":case"object":case"embed":tt("load",r);break;case"video":case"audio":for(i=0;i<ql.length;i++)tt(ql[i],r);break;case"source":tt("error",r);break;case"img":case"image":case"link":tt("error",r),tt("load",r);break;case"details":tt("toggle",r);break;case"input":A2(r,a),tt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},tt("invalid",r);break;case"textarea":P2(r,a),tt("invalid",r)}Dg(n,a),i=null;for(var o in a)if(a.hasOwnProperty(o)){var s=a[o];o==="children"?typeof s=="string"?r.textContent!==s&&(a.suppressHydrationWarning!==!0&&$d(r.textContent,s,e),i=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(a.suppressHydrationWarning!==!0&&$d(r.textContent,s,e),i=["children",""+s]):_l.hasOwnProperty(o)&&s!=null&&o==="onScroll"&&tt("scroll",r)}switch(n){case"input":xd(r),N2(r,a,!0);break;case"textarea":xd(r),O2(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=Wd)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=D2(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Br]=t,e[Xl]=r,YS(e,t,!1,!1),t.stateNode=e;e:{switch(o=Lg(n,r),n){case"dialog":tt("cancel",e),tt("close",e),i=r;break;case"iframe":case"object":case"embed":tt("load",e),i=r;break;case"video":case"audio":for(i=0;i<ql.length;i++)tt(ql[i],e);i=r;break;case"source":tt("error",e),i=r;break;case"img":case"image":case"link":tt("error",e),tt("load",e),i=r;break;case"details":tt("toggle",e),i=r;break;case"input":A2(e,r),i=Rg(e,r),tt("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=dt({},r,{value:void 0}),tt("invalid",e);break;case"textarea":P2(e,r),i=Ig(e,r),tt("invalid",e);break;default:i=r}Dg(n,i),s=i;for(a in s)if(s.hasOwnProperty(a)){var l=s[a];a==="style"?F2(e,l):a==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&L2(e,l)):a==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Al(e,l):typeof l=="number"&&Al(e,""+l):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(_l.hasOwnProperty(a)?l!=null&&a==="onScroll"&&tt("scroll",e):l!=null&&yg(e,a,l,o))}switch(n){case"input":xd(e),N2(e,r,!1);break;case"textarea":xd(e),O2(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Hi(r.value));break;case"select":e.multiple=!!r.multiple,a=r.value,a!=null?Vo(e,!!r.multiple,a,!1):r.defaultValue!=null&&Vo(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Wd)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Jt(t),null;case 6:if(e&&t.stateNode!=null)GS(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(Q(166));if(n=Za(tu.current),Za(jr.current),Zd(t)){if(r=t.stateNode,n=t.memoizedProps,r[Br]=t,(a=r.nodeValue!==n)&&(e=Bn,e!==null))switch(e.tag){case 3:$d(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&$d(r.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Br]=t,t.stateNode=r}return Jt(t),null;case 13:if(nt(ft),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(st&&jn!==null&&t.mode&1&&!(t.flags&128))Q_(),is(),t.flags|=98560,a=!1;else if(a=Zd(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(Q(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(Q(317));a[Br]=t}else is(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Jt(t),a=!1}else yr!==null&&(dw(yr),yr=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ft.current&1?Pt===0&&(Pt=3):hw())),t.updateQueue!==null&&(t.flags|=4),Jt(t),null);case 4:return ls(),ew(e,t),e===null&&Gl(t.stateNode.containerInfo),Jt(t),null;case 10:return A0(t.type._context),Jt(t),null;case 17:return xn(t.type)&&qd(),Jt(t),null;case 19:if(nt(ft),a=t.memoizedState,a===null)return Jt(t),null;if(r=(t.flags&128)!==0,o=a.rendering,o===null)if(r)ou(a,!1);else{if(Pt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=af(e),o!==null){for(t.flags|=128,ou(a,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)a=n,e=r,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Je(ft,ft.current&1|2),t.child}e=e.sibling}a.tail!==null&&Tt()>fs&&(t.flags|=128,r=!0,ou(a,!1),t.lanes=4194304)}else{if(!r)if(e=af(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ou(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!st)return Jt(t),null}else 2*Tt()-a.renderingStartTime>fs&&n!==1073741824&&(t.flags|=128,r=!0,ou(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(n=a.last,n!==null?n.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Tt(),t.sibling=null,n=ft.current,Je(ft,r?n&1|2:n&1),t):(Jt(t),null);case 22:case 23:return pw(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Un&1073741824&&(Jt(t),t.subtreeFlags&6&&(t.flags|=8192)):Jt(t),null;case 24:return null;case 25:return null}throw Error(Q(156,t.tag))}function jB(e,t){switch(E0(t),t.tag){case 1:return xn(t.type)&&qd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ls(),nt(bn),nt(Qt),L0(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return O0(t),null;case 13:if(nt(ft),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Q(340));is()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return nt(ft),null;case 4:return ls(),null;case 10:return A0(t.type._context),null;case 22:case 23:return pw(),null;case 24:return null;default:return null}}var hf=!1,en=!1,UB=typeof WeakSet=="function"?WeakSet:Set,se=null;function cs(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){yt(e,t,r)}else n.current=null}function tw(e,t,n){try{n()}catch(r){yt(e,t,r)}}var KS=!1;function zB(e,t){if(p0=Od,e=k_(),a0(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,s=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var p;d!==n||i!==0&&d.nodeType!==3||(s=o+i),d!==a||r!==0&&d.nodeType!==3||(l=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++u===i&&(s=o),f===a&&++c===r&&(l=o),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(h0={focusedElem:e,selectionRange:n},Od=!1,se=t;se!==null;)if(t=se,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,se=e;else for(;se!==null;){t=se;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var g=m.memoizedProps,x=m.memoizedState,w=t.stateNode,v=w.getSnapshotBeforeUpdate(t.elementType===t.type?g:vr(t.type,g),x);w.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Q(163))}}catch(E){yt(t,t.return,E)}if(e=t.sibling,e!==null){e.return=t.return,se=e;break}se=t.return}return m=KS,KS=!1,m}function su(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&tw(t,n,a)}i=i.next}while(i!==r)}}function mf(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function nw(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function XS(e){var t=e.alternate;t!==null&&(e.alternate=null,XS(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Br],delete t[Xl],delete t[y0],delete t[TB],delete t[_B])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function QS(e){return e.tag===5||e.tag===3||e.tag===4}function ZS(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||QS(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function rw(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Wd));else if(r!==4&&(e=e.child,e!==null))for(rw(e,t,n),e=e.sibling;e!==null;)rw(e,t,n),e=e.sibling}function iw(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(iw(e,t,n),e=e.sibling;e!==null;)iw(e,t,n),e=e.sibling}var Vt=null,br=!1;function ta(e,t,n){for(n=n.child;n!==null;)JS(e,t,n),n=n.sibling}function JS(e,t,n){if(Fr&&typeof Fr.onCommitFiberUnmount=="function")try{Fr.onCommitFiberUnmount(kd,n)}catch{}switch(n.tag){case 5:en||cs(n,t);case 6:var r=Vt,i=br;Vt=null,ta(e,t,n),Vt=r,br=i,Vt!==null&&(br?(e=Vt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Vt.removeChild(n.stateNode));break;case 18:Vt!==null&&(br?(e=Vt,n=n.stateNode,e.nodeType===8?w0(e.parentNode,n):e.nodeType===1&&w0(e,n),jl(e)):w0(Vt,n.stateNode));break;case 4:r=Vt,i=br,Vt=n.stateNode.containerInfo,br=!0,ta(e,t,n),Vt=r,br=i;break;case 0:case 11:case 14:case 15:if(!en&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&tw(n,t,o),i=i.next}while(i!==r)}ta(e,t,n);break;case 1:if(!en&&(cs(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){yt(n,t,s)}ta(e,t,n);break;case 21:ta(e,t,n);break;case 22:n.mode&1?(en=(r=en)||n.memoizedState!==null,ta(e,t,n),en=r):ta(e,t,n);break;default:ta(e,t,n)}}function eC(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new UB),t.forEach(function(r){var i=XB.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function xr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var a=e,o=t,s=o;e:for(;s!==null;){switch(s.tag){case 5:Vt=s.stateNode,br=!1;break e;case 3:Vt=s.stateNode.containerInfo,br=!0;break e;case 4:Vt=s.stateNode.containerInfo,br=!0;break e}s=s.return}if(Vt===null)throw Error(Q(160));JS(a,o,i),Vt=null,br=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){yt(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)tC(t,e),t=t.sibling}function tC(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(xr(t,e),zr(e),r&4){try{su(3,e,e.return),mf(3,e)}catch(g){yt(e,e.return,g)}try{su(5,e,e.return)}catch(g){yt(e,e.return,g)}}break;case 1:xr(t,e),zr(e),r&512&&n!==null&&cs(n,n.return);break;case 5:if(xr(t,e),zr(e),r&512&&n!==null&&cs(n,n.return),e.flags&32){var i=e.stateNode;try{Al(i,"")}catch(g){yt(e,e.return,g)}}if(r&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,o=n!==null?n.memoizedProps:a,s=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{s==="input"&&a.type==="radio"&&a.name!=null&&R2(i,a),Lg(s,o);var u=Lg(s,a);for(o=0;o<l.length;o+=2){var c=l[o],d=l[o+1];c==="style"?F2(i,d):c==="dangerouslySetInnerHTML"?L2(i,d):c==="children"?Al(i,d):yg(i,c,d,u)}switch(s){case"input":Ng(i,a);break;case"textarea":I2(i,a);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var p=a.value;p!=null?Vo(i,!!a.multiple,p,!1):f!==!!a.multiple&&(a.defaultValue!=null?Vo(i,!!a.multiple,a.defaultValue,!0):Vo(i,!!a.multiple,a.multiple?[]:"",!1))}i[Xl]=a}catch(g){yt(e,e.return,g)}}break;case 6:if(xr(t,e),zr(e),r&4){if(e.stateNode===null)throw Error(Q(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(g){yt(e,e.return,g)}}break;case 3:if(xr(t,e),zr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{jl(t.containerInfo)}catch(g){yt(e,e.return,g)}break;case 4:xr(t,e),zr(e);break;case 13:xr(t,e),zr(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(sw=Tt())),r&4&&eC(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(en=(u=en)||c,xr(t,e),en=u):xr(t,e),zr(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(se=e,c=e.child;c!==null;){for(d=se=c;se!==null;){switch(f=se,p=f.child,f.tag){case 0:case 11:case 14:case 15:su(4,f,f.return);break;case 1:cs(f,f.return);var m=f.stateNode;if(typeof m.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(g){yt(r,n,g)}}break;case 5:cs(f,f.return);break;case 22:if(f.memoizedState!==null){iC(d);continue}}p!==null?(p.return=f,se=p):iC(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{i=d.stateNode,u?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(s=d.stateNode,l=d.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,s.style.display=M2("display",o))}catch(g){yt(e,e.return,g)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(g){yt(e,e.return,g)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:xr(t,e),zr(e),r&4&&eC(e);break;case 21:break;default:xr(t,e),zr(e)}}function zr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(QS(n)){var r=n;break e}n=n.return}throw Error(Q(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Al(i,""),r.flags&=-33);var a=ZS(e);iw(e,a,i);break;case 3:case 4:var o=r.stateNode.containerInfo,s=ZS(e);rw(e,s,o);break;default:throw Error(Q(161))}}catch(l){yt(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function HB(e,t,n){se=e,nC(e)}function nC(e,t,n){for(var r=(e.mode&1)!==0;se!==null;){var i=se,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||hf;if(!o){var s=i.alternate,l=s!==null&&s.memoizedState!==null||en;s=hf;var u=en;if(hf=o,(en=l)&&!u)for(se=i;se!==null;)o=se,l=o.child,o.tag===22&&o.memoizedState!==null?aC(i):l!==null?(l.return=o,se=l):aC(i);for(;a!==null;)se=a,nC(a),a=a.sibling;se=i,hf=s,en=u}rC(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,se=a):rC(e)}}function rC(e){for(;se!==null;){var t=se;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:en||mf(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!en)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:vr(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&iS(t,a,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}iS(t,o,n)}break;case 5:var s=t.stateNode;if(n===null&&t.flags&4){n=s;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&jl(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Q(163))}en||t.flags&512&&nw(t)}catch(f){yt(t,t.return,f)}}if(t===e){se=null;break}if(n=t.sibling,n!==null){n.return=t.return,se=n;break}se=t.return}}function iC(e){for(;se!==null;){var t=se;if(t===e){se=null;break}var n=t.sibling;if(n!==null){n.return=t.return,se=n;break}se=t.return}}function aC(e){for(;se!==null;){var t=se;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{mf(4,t)}catch(l){yt(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){yt(t,i,l)}}var a=t.return;try{nw(t)}catch(l){yt(t,a,l)}break;case 5:var o=t.return;try{nw(t)}catch(l){yt(t,o,l)}}}catch(l){yt(t,t.return,l)}if(t===e){se=null;break}var s=t.sibling;if(s!==null){s.return=t.return,se=s;break}se=t.return}}var VB=Math.ceil,gf=ui.ReactCurrentDispatcher,aw=ui.ReactCurrentOwner,nr=ui.ReactCurrentBatchConfig,Ue=0,Lt=null,kt=null,$t=0,Un=0,ds=Xi(0),Pt=0,lu=null,eo=0,wf=0,ow=0,uu=null,Tn=null,sw=0,fs=1/0,wi=null,yf=!1,lw=null,na=null,vf=!1,ra=null,bf=0,cu=0,uw=null,xf=-1,Ef=0;function cn(){return Ue&6?Tt():xf!==-1?xf:xf=Tt()}function ia(e){return e.mode&1?Ue&2&&$t!==0?$t&-$t:CB.transition!==null?(Ef===0&&(Ef=Z2()),Ef):(e=qe,e!==0||(e=window.event,e=e===void 0?16:s_(e.type)),e):1}function Er(e,t,n,r){if(50<cu)throw cu=0,uw=null,Error(Q(185));Dl(e,n,r),(!(Ue&2)||e!==Lt)&&(e===Lt&&(!(Ue&2)&&(wf|=n),Pt===4&&aa(e,$t)),_n(e,r),n===1&&Ue===0&&!(t.mode&1)&&(fs=Tt()+500,Kd&&Zi()))}function _n(e,t){var n=e.callbackNode;C7(e,t);var r=Nd(e,e===Lt?$t:0);if(r===0)n!==null&&K2(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&K2(n),t===1)e.tag===0?SB(sC.bind(null,e)):Y_(sC.bind(null,e)),xB(function(){!(Ue&6)&&Zi()}),n=null;else{switch(J2(r)){case 1:n=Hg;break;case 4:n=X2;break;case 16:n=Cd;break;case 536870912:n=Q2;break;default:n=Cd}n=mC(n,oC.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function oC(e,t){if(xf=-1,Ef=0,Ue&6)throw Error(Q(327));var n=e.callbackNode;if(ps()&&e.callbackNode!==n)return null;var r=Nd(e,e===Lt?$t:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Tf(e,r);else{t=r;var i=Ue;Ue|=2;var a=uC();(Lt!==e||$t!==t)&&(wi=null,fs=Tt()+500,no(e,t));do try{YB();break}catch(s){lC(e,s)}while(!0);k0(),gf.current=a,Ue=i,kt!==null?t=0:(Lt=null,$t=0,t=Pt)}if(t!==0){if(t===2&&(i=Vg(e),i!==0&&(r=i,t=cw(e,i))),t===1)throw n=lu,no(e,0),aa(e,r),_n(e,Tt()),n;if(t===6)aa(e,r);else{if(i=e.current.alternate,!(r&30)&&!$B(i)&&(t=Tf(e,r),t===2&&(a=Vg(e),a!==0&&(r=a,t=cw(e,a))),t===1))throw n=lu,no(e,0),aa(e,r),_n(e,Tt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(Q(345));case 2:ro(e,Tn,wi);break;case 3:if(aa(e,r),(r&130023424)===r&&(t=sw+500-Tt(),10<t)){if(Nd(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){cn(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=g0(ro.bind(null,e,Tn,wi),t);break}ro(e,Tn,wi);break;case 4:if(aa(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-gr(r);a=1<<o,o=t[o],o>i&&(i=o),r&=~a}if(r=i,r=Tt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*VB(r/1960))-r,10<r){e.timeoutHandle=g0(ro.bind(null,e,Tn,wi),r);break}ro(e,Tn,wi);break;case 5:ro(e,Tn,wi);break;default:throw Error(Q(329))}}}return _n(e,Tt()),e.callbackNode===n?oC.bind(null,e):null}function cw(e,t){var n=uu;return e.current.memoizedState.isDehydrated&&(no(e,t).flags|=256),e=Tf(e,t),e!==2&&(t=Tn,Tn=n,t!==null&&dw(t)),e}function dw(e){Tn===null?Tn=e:Tn.push.apply(Tn,e)}function $B(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!wr(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function aa(e,t){for(t&=~ow,t&=~wf,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-gr(t),r=1<<n;e[n]=-1,t&=~r}}function sC(e){if(Ue&6)throw Error(Q(327));ps();var t=Nd(e,0);if(!(t&1))return _n(e,Tt()),null;var n=Tf(e,t);if(e.tag!==0&&n===2){var r=Vg(e);r!==0&&(t=r,n=cw(e,r))}if(n===1)throw n=lu,no(e,0),aa(e,t),_n(e,Tt()),n;if(n===6)throw Error(Q(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ro(e,Tn,wi),_n(e,Tt()),null}function fw(e,t){var n=Ue;Ue|=1;try{return e(t)}finally{Ue=n,Ue===0&&(fs=Tt()+500,Kd&&Zi())}}function to(e){ra!==null&&ra.tag===0&&!(Ue&6)&&ps();var t=Ue;Ue|=1;var n=nr.transition,r=qe;try{if(nr.transition=null,qe=1,e)return e()}finally{qe=r,nr.transition=n,Ue=t,!(Ue&6)&&Zi()}}function pw(){Un=ds.current,nt(ds)}function no(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,bB(n)),kt!==null)for(n=kt.return;n!==null;){var r=n;switch(E0(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&qd();break;case 3:ls(),nt(bn),nt(Qt),L0();break;case 5:O0(r);break;case 4:ls();break;case 13:nt(ft);break;case 19:nt(ft);break;case 10:A0(r.type._context);break;case 22:case 23:pw()}n=n.return}if(Lt=e,kt=e=oa(e.current,null),$t=Un=t,Pt=0,lu=null,ow=wf=eo=0,Tn=uu=null,Qa!==null){for(t=0;t<Qa.length;t++)if(n=Qa[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}Qa=null}return e}function lC(e,t){do{var n=kt;try{if(k0(),of.current=cf,sf){for(var r=pt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}sf=!1}if(Ja=0,Dt=Nt=pt=null,nu=!1,ru=0,aw.current=null,n===null||n.return===null){Pt=1,lu=t,kt=null;break}e:{var a=e,o=n.return,s=n,l=t;if(t=$t,s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=s,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var p=OS(o);if(p!==null){p.flags&=-257,DS(p,o,s,a,t),p.mode&1&&IS(a,u,t),t=p,l=u;var m=t.updateQueue;if(m===null){var g=new Set;g.add(l),t.updateQueue=g}else m.add(l);break e}else{if(!(t&1)){IS(a,u,t),hw();break e}l=Error(Q(426))}}else if(st&&s.mode&1){var x=OS(o);if(x!==null){!(x.flags&65536)&&(x.flags|=256),DS(x,o,s,a,t),S0(us(l,s));break e}}a=l=us(l,s),Pt!==4&&(Pt=2),uu===null?uu=[a]:uu.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var w=NS(a,l,t);rS(a,w);break e;case 1:s=l;var v=a.type,b=a.stateNode;if(!(a.flags&128)&&(typeof v.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(na===null||!na.has(b)))){a.flags|=65536,t&=-t,a.lanes|=t;var E=PS(a,s,t);rS(a,E);break e}}a=a.return}while(a!==null)}dC(n)}catch(_){t=_,kt===n&&n!==null&&(kt=n=n.return);continue}break}while(!0)}function uC(){var e=gf.current;return gf.current=cf,e===null?cf:e}function hw(){(Pt===0||Pt===3||Pt===2)&&(Pt=4),Lt===null||!(eo&268435455)&&!(wf&268435455)||aa(Lt,$t)}function Tf(e,t){var n=Ue;Ue|=2;var r=uC();(Lt!==e||$t!==t)&&(wi=null,no(e,t));do try{WB();break}catch(i){lC(e,i)}while(!0);if(k0(),Ue=n,gf.current=r,kt!==null)throw Error(Q(261));return Lt=null,$t=0,Pt}function WB(){for(;kt!==null;)cC(kt)}function YB(){for(;kt!==null&&!w7();)cC(kt)}function cC(e){var t=hC(e.alternate,e,Un);e.memoizedProps=e.pendingProps,t===null?dC(e):kt=t,aw.current=null}function dC(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=jB(n,t),n!==null){n.flags&=32767,kt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Pt=6,kt=null;return}}else if(n=BB(n,t,Un),n!==null){kt=n;return}if(t=t.sibling,t!==null){kt=t;return}kt=t=e}while(t!==null);Pt===0&&(Pt=5)}function ro(e,t,n){var r=qe,i=nr.transition;try{nr.transition=null,qe=1,qB(e,t,n,r)}finally{nr.transition=i,qe=r}return null}function qB(e,t,n,r){do ps();while(ra!==null);if(Ue&6)throw Error(Q(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(Q(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(k7(e,a),e===Lt&&(kt=Lt=null,$t=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||vf||(vf=!0,mC(Cd,function(){return ps(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=nr.transition,nr.transition=null;var o=qe;qe=1;var s=Ue;Ue|=4,aw.current=null,zB(e,n),tC(n,e),pB(h0),Od=!!p0,h0=p0=null,e.current=n,HB(n),y7(),Ue=s,qe=o,nr.transition=a}else e.current=n;if(vf&&(vf=!1,ra=e,bf=i),a=e.pendingLanes,a===0&&(na=null),x7(n.stateNode),_n(e,Tt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(yf)throw yf=!1,e=lw,lw=null,e;return bf&1&&e.tag!==0&&ps(),a=e.pendingLanes,a&1?e===uw?cu++:(cu=0,uw=e):cu=0,Zi(),null}function ps(){if(ra!==null){var e=J2(bf),t=nr.transition,n=qe;try{if(nr.transition=null,qe=16>e?16:e,ra===null)var r=!1;else{if(e=ra,ra=null,bf=0,Ue&6)throw Error(Q(331));var i=Ue;for(Ue|=4,se=e.current;se!==null;){var a=se,o=a.child;if(se.flags&16){var s=a.deletions;if(s!==null){for(var l=0;l<s.length;l++){var u=s[l];for(se=u;se!==null;){var c=se;switch(c.tag){case 0:case 11:case 15:su(8,c,a)}var d=c.child;if(d!==null)d.return=c,se=d;else for(;se!==null;){c=se;var f=c.sibling,p=c.return;if(XS(c),c===u){se=null;break}if(f!==null){f.return=p,se=f;break}se=p}}}var m=a.alternate;if(m!==null){var g=m.child;if(g!==null){m.child=null;do{var x=g.sibling;g.sibling=null,g=x}while(g!==null)}}se=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,se=o;else e:for(;se!==null;){if(a=se,a.flags&2048)switch(a.tag){case 0:case 11:case 15:su(9,a,a.return)}var w=a.sibling;if(w!==null){w.return=a.return,se=w;break e}se=a.return}}var v=e.current;for(se=v;se!==null;){o=se;var b=o.child;if(o.subtreeFlags&2064&&b!==null)b.return=o,se=b;else e:for(o=v;se!==null;){if(s=se,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:mf(9,s)}}catch(_){yt(s,s.return,_)}if(s===o){se=null;break e}var E=s.sibling;if(E!==null){E.return=s.return,se=E;break e}se=s.return}}if(Ue=i,Zi(),Fr&&typeof Fr.onPostCommitFiberRoot=="function")try{Fr.onPostCommitFiberRoot(kd,e)}catch{}r=!0}return r}finally{qe=n,nr.transition=t}}return!1}function fC(e,t,n){t=us(n,t),t=NS(e,t,1),e=ea(e,t,1),t=cn(),e!==null&&(Dl(e,1,t),_n(e,t))}function yt(e,t,n){if(e.tag===3)fC(e,e,n);else for(;t!==null;){if(t.tag===3){fC(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(na===null||!na.has(r))){e=us(n,e),e=PS(t,e,1),t=ea(t,e,1),e=cn(),t!==null&&(Dl(t,1,e),_n(t,e));break}}t=t.return}}function GB(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=cn(),e.pingedLanes|=e.suspendedLanes&n,Lt===e&&($t&n)===n&&(Pt===4||Pt===3&&($t&130023424)===$t&&500>Tt()-sw?no(e,0):ow|=n),_n(e,t)}function pC(e,t){t===0&&(e.mode&1?(t=Rd,Rd<<=1,!(Rd&130023424)&&(Rd=4194304)):t=1);var n=cn();e=hi(e,t),e!==null&&(Dl(e,t,n),_n(e,n))}function KB(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),pC(e,n)}function XB(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Q(314))}r!==null&&r.delete(t),pC(e,n)}var hC;hC=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||bn.current)En=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return En=!1,FB(e,t,n);En=!!(e.flags&131072)}else En=!1,st&&t.flags&1048576&&q_(t,Qd,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;pf(e,t),e=t.pendingProps;var i=ts(t,Qt.current);ss(t,n),i=B0(null,t,r,e,i,n);var a=j0();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,xn(r)?(a=!0,Gd(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,P0(t),i.updater=df,t.stateNode=i,i._reactInternals=t,W0(t,r,e,n),t=K0(null,t,r,!0,a,n)):(t.tag=0,st&&a&&x0(t),un(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(pf(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=ZB(r),e=vr(r,e),i){case 0:t=G0(null,t,r,e,n);break e;case 1:t=US(null,t,r,e,n);break e;case 11:t=LS(null,t,r,e,n);break e;case 14:t=MS(null,t,r,vr(r.type,e),n);break e}throw Error(Q(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vr(r,i),G0(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vr(r,i),US(e,t,r,i,n);case 3:e:{if(zS(t),e===null)throw Error(Q(387));r=t.pendingProps,a=t.memoizedState,i=a.element,nS(e,t),rf(t,r,null,n);var o=t.memoizedState;if(r=o.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=us(Error(Q(423)),t),t=HS(e,t,r,n,i);break e}else if(r!==i){i=us(Error(Q(424)),t),t=HS(e,t,r,n,i);break e}else for(jn=Ki(t.stateNode.containerInfo.firstChild),Bn=t,st=!0,yr=null,n=eS(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(is(),r===i){t=gi(e,t,n);break e}un(e,t,r,n)}t=t.child}return t;case 5:return aS(t),e===null&&_0(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,m0(r,i)?o=null:a!==null&&m0(r,a)&&(t.flags|=32),jS(e,t),un(e,t,o,n),t.child;case 6:return e===null&&_0(t),null;case 13:return VS(e,t,n);case 4:return I0(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=as(t,null,r,n):un(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vr(r,i),LS(e,t,r,i,n);case 7:return un(e,t,t.pendingProps,n),t.child;case 8:return un(e,t,t.pendingProps.children,n),t.child;case 12:return un(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,Je(ef,r._currentValue),r._currentValue=o,a!==null)if(wr(a.value,o)){if(a.children===i.children&&!bn.current){t=gi(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){o=a.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(a.tag===1){l=mi(-1,n&-n),l.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),R0(a.return,n,t),s.lanes|=n;break}l=l.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(Q(341));o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),R0(o,n,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}un(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,ss(t,n),i=er(i),r=r(i),t.flags|=1,un(e,t,r,n),t.child;case 14:return r=t.type,i=vr(r,t.pendingProps),i=vr(r.type,i),MS(e,t,r,i,n);case 15:return FS(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vr(r,i),pf(e,t),t.tag=1,xn(r)?(e=!0,Gd(t)):e=!1,ss(t,n),AS(t,r,i),W0(t,r,i,n),K0(null,t,r,!0,e,n);case 19:return WS(e,t,n);case 22:return BS(e,t,n)}throw Error(Q(156,t.tag))};function mC(e,t){return G2(e,t)}function QB(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rr(e,t,n,r){return new QB(e,t,n,r)}function mw(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ZB(e){if(typeof e=="function")return mw(e)?1:0;if(e!=null){if(e=e.$$typeof,e===xg)return 11;if(e===_g)return 14}return 2}function oa(e,t){var n=e.alternate;return n===null?(n=rr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function _f(e,t,n,r,i,a){var o=2;if(r=e,typeof e=="function")mw(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ho:return io(n.children,i,a,t);case vg:o=8,i|=8;break;case bg:return e=rr(12,n,t,i|2),e.elementType=bg,e.lanes=a,e;case Eg:return e=rr(13,n,t,i),e.elementType=Eg,e.lanes=a,e;case Tg:return e=rr(19,n,t,i),e.elementType=Tg,e.lanes=a,e;case _2:return Sf(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case E2:o=10;break e;case T2:o=9;break e;case xg:o=11;break e;case _g:o=14;break e;case zi:o=16,r=null;break e}throw Error(Q(130,e==null?e:typeof e,""))}return t=rr(o,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function io(e,t,n,r){return e=rr(7,e,r,t),e.lanes=n,e}function Sf(e,t,n,r){return e=rr(22,e,r,t),e.elementType=_2,e.lanes=n,e.stateNode={isHidden:!1},e}function gw(e,t,n){return e=rr(6,e,null,t),e.lanes=n,e}function ww(e,t,n){return t=rr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function JB(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=$g(0),this.expirationTimes=$g(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$g(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function yw(e,t,n,r,i,a,o,s,l){return e=new JB(e,t,n,s,l),t===1?(t=1,a===!0&&(t|=8)):t=0,a=rr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},P0(a),e}function ej(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:zo,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function gC(e){if(!e)return Qi;e=e._reactInternals;e:{if(Ya(e)!==e||e.tag!==1)throw Error(Q(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(xn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Q(171))}if(e.tag===1){var n=e.type;if(xn(n))return $_(e,n,t)}return t}function wC(e,t,n,r,i,a,o,s,l){return e=yw(n,r,!0,e,i,a,o,s,l),e.context=gC(null),n=e.current,r=cn(),i=ia(n),a=mi(r,i),a.callback=t??null,ea(n,a,i),e.current.lanes=i,Dl(e,i,r),_n(e,r),e}function Cf(e,t,n,r){var i=t.current,a=cn(),o=ia(i);return n=gC(n),t.context===null?t.context=n:t.pendingContext=n,t=mi(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ea(i,t,o),e!==null&&(Er(e,i,o,a),nf(e,i,o)),o}function kf(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function yC(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function vw(e,t){yC(e,t),(e=e.alternate)&&yC(e,t)}function tj(){return null}var vC=typeof reportError=="function"?reportError:function(e){console.error(e)};function bw(e){this._internalRoot=e}Af.prototype.render=bw.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Q(409));Cf(e,t,null,null)},Af.prototype.unmount=bw.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;to(function(){Cf(null,e,null,null)}),t[ci]=null}};function Af(e){this._internalRoot=e}Af.prototype.unstable_scheduleHydration=function(e){if(e){var t=n_();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Yi.length&&t!==0&&t<Yi[n].priority;n++);Yi.splice(n,0,e),n===0&&a_(e)}};function xw(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Rf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function bC(){}function nj(e,t,n,r,i){if(i){if(typeof r=="function"){var a=r;r=function(){var u=kf(o);a.call(u)}}var o=wC(t,r,e,0,null,!1,!1,"",bC);return e._reactRootContainer=o,e[ci]=o.current,Gl(e.nodeType===8?e.parentNode:e),to(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var s=r;r=function(){var u=kf(l);s.call(u)}}var l=yw(e,0,!1,null,null,!1,!1,"",bC);return e._reactRootContainer=l,e[ci]=l.current,Gl(e.nodeType===8?e.parentNode:e),to(function(){Cf(t,l,n,r)}),l}function Nf(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i=="function"){var s=i;i=function(){var l=kf(o);s.call(l)}}Cf(t,o,e,i)}else o=nj(n,t,e,i,r);return kf(o)}e_=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ol(t.pendingLanes);n!==0&&(Wg(t,n|1),_n(t,Tt()),!(Ue&6)&&(fs=Tt()+500,Zi()))}break;case 13:to(function(){var r=hi(e,1);if(r!==null){var i=cn();Er(r,e,1,i)}}),vw(e,1)}},Yg=function(e){if(e.tag===13){var t=hi(e,134217728);if(t!==null){var n=cn();Er(t,e,134217728,n)}vw(e,134217728)}},t_=function(e){if(e.tag===13){var t=ia(e),n=hi(e,t);if(n!==null){var r=cn();Er(n,e,t,r)}vw(e,t)}},n_=function(){return qe},r_=function(e,t){var n=qe;try{return qe=e,t()}finally{qe=n}},Bg=function(e,t,n){switch(t){case"input":if(Ng(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=Yd(r);if(!i)throw Error(Q(90));k2(r),Ng(r,i)}}}break;case"textarea":I2(e,n);break;case"select":t=n.value,t!=null&&Vo(e,!!n.multiple,t,!1)}},z2=fw,H2=to;var rj={usingClientEntryPoint:!1,Events:[Ql,Jo,Yd,j2,U2,fw]},du={findFiberByHostInstance:qa,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ij={bundleType:du.bundleType,version:du.version,rendererPackageName:du.rendererPackageName,rendererConfig:du.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ui.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Y2(e),e===null?null:e.stateNode},findFiberByHostInstance:du.findFiberByHostInstance||tj,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Pf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pf.isDisabled&&Pf.supportsFiber)try{kd=Pf.inject(ij),Fr=Pf}catch{}}Ln.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=rj,Ln.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!xw(t))throw Error(Q(200));return ej(e,t,null,n)},Ln.createRoot=function(e,t){if(!xw(e))throw Error(Q(299));var n=!1,r="",i=vC;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=yw(e,1,!1,null,null,n,!1,r,i),e[ci]=t.current,Gl(e.nodeType===8?e.parentNode:e),new bw(t)},Ln.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Q(188)):(e=Object.keys(e).join(","),Error(Q(268,e)));return e=Y2(t),e=e===null?null:e.stateNode,e},Ln.flushSync=function(e){return to(e)},Ln.hydrate=function(e,t,n){if(!Rf(t))throw Error(Q(200));return Nf(null,e,t,!0,n)},Ln.hydrateRoot=function(e,t,n){if(!xw(e))throw Error(Q(405));var r=n!=null&&n.hydratedSources||null,i=!1,a="",o=vC;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=wC(t,null,e,1,n??null,i,!1,a,o),e[ci]=t.current,Gl(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new Af(t)},Ln.render=function(e,t,n){if(!Rf(t))throw Error(Q(200));return Nf(null,e,t,!1,n)},Ln.unmountComponentAtNode=function(e){if(!Rf(e))throw Error(Q(40));return e._reactRootContainer?(to(function(){Nf(null,null,e,!1,function(){e._reactRootContainer=null,e[ci]=null})}),!0):!1},Ln.unstable_batchedUpdates=fw,Ln.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Rf(n))throw Error(Q(200));if(e==null||e._reactInternals===void 0)throw Error(Q(38));return Nf(e,t,n,!1,r)},Ln.version="18.3.1-next-f1338f8080-20240426";function xC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(xC)}catch(e){console.error(e)}}xC(),g2.exports=Ln;var hs=g2.exports,If=y.forwardRef((e,t)=>{const{children:n,...r}=e,i=y.Children.toArray(n),a=i.find(aj);if(a){const o=a.props.children,s=i.map(l=>l===a?y.Children.count(o)>1?y.Children.only(null):y.isValidElement(o)?o.props.children:null:l);return T.jsx(Ew,{...r,ref:t,children:y.isValidElement(o)?y.cloneElement(o,void 0,s):null})}return T.jsx(Ew,{...r,ref:t,children:n})});If.displayName="Slot";var Ew=y.forwardRef((e,t)=>{const{children:n,...r}=e;if(y.isValidElement(n)){const i=sj(n);return y.cloneElement(n,{...oj(r,n.props),ref:t?m2(t,i):i})}return y.Children.count(n)>1?y.Children.only(null):null});Ew.displayName="SlotClone";var EC=({children:e})=>T.jsx(T.Fragment,{children:e});function aj(e){return y.isValidElement(e)&&e.type===EC}function oj(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...s)=>{a(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function sj(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var lj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],zn=lj.reduce((e,t)=>{const n=y.forwardRef((r,i)=>{const{asChild:a,...o}=r,s=a?If:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),T.jsx(s,{...o,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function uj(e,t){e&&hs.flushSync(()=>e.dispatchEvent(t))}function Wt(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function TC(e,t=globalThis==null?void 0:globalThis.document){const n=Wt(e);y.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var cj="DismissableLayer",Tw="dismissableLayer.update",dj="dismissableLayer.pointerDownOutside",fj="dismissableLayer.focusOutside",_C,SC=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),_w=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...l}=e,u=y.useContext(SC),[c,d]=y.useState(null),f=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=y.useState({}),m=Mr(t,I=>d(I)),g=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),w=g.indexOf(x),v=c?g.indexOf(c):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,E=v>=w,_=mj(I=>{const D=I.target,V=[...u.branches].some(N=>N.contains(D));!E||V||(i==null||i(I),o==null||o(I),I.defaultPrevented||s==null||s())},f),S=gj(I=>{const D=I.target;[...u.branches].some(N=>N.contains(D))||(a==null||a(I),o==null||o(I),I.defaultPrevented||s==null||s())},f);return TC(I=>{v===u.layers.size-1&&(r==null||r(I),!I.defaultPrevented&&s&&(I.preventDefault(),s()))},f),y.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(_C=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),CC(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=_C)}},[c,f,n,u]),y.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),CC())},[c,u]),y.useEffect(()=>{const I=()=>p({});return document.addEventListener(Tw,I),()=>document.removeEventListener(Tw,I)},[]),T.jsx(zn.div,{...l,ref:m,style:{pointerEvents:b?E?"auto":"none":void 0,...e.style},onFocusCapture:vn(e.onFocusCapture,S.onFocusCapture),onBlurCapture:vn(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:vn(e.onPointerDownCapture,_.onPointerDownCapture)})});_w.displayName=cj;var pj="DismissableLayerBranch",hj=y.forwardRef((e,t)=>{const n=y.useContext(SC),r=y.useRef(null),i=Mr(t,r);return y.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),T.jsx(zn.div,{...e,ref:i})});hj.displayName=pj;function mj(e,t=globalThis==null?void 0:globalThis.document){const n=Wt(e),r=y.useRef(!1),i=y.useRef(()=>{});return y.useEffect(()=>{const a=s=>{if(s.target&&!r.current){let l=function(){kC(dj,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function gj(e,t=globalThis==null?void 0:globalThis.document){const n=Wt(e),r=y.useRef(!1);return y.useEffect(()=>{const i=a=>{a.target&&!r.current&&kC(fj,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function CC(){const e=new CustomEvent(Tw);document.dispatchEvent(e)}function kC(e,t,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?uj(i,a):i.dispatchEvent(a)}var ir=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},wj=wO.useId||(()=>{}),yj=0;function fu(e){const[t,n]=y.useState(wj());return ir(()=>{e||n(r=>r??String(yj++))},[e]),e||(t?`radix-${t}`:"")}const vj=["top","right","bottom","left"],sa=Math.min,Hn=Math.max,Of=Math.round,Df=Math.floor,la=e=>({x:e,y:e}),bj={left:"right",right:"left",bottom:"top",top:"bottom"},xj={start:"end",end:"start"};function Sw(e,t,n){return Hn(e,sa(t,n))}function yi(e,t){return typeof e=="function"?e(t):e}function vi(e){return e.split("-")[0]}function ms(e){return e.split("-")[1]}function Cw(e){return e==="x"?"y":"x"}function kw(e){return e==="y"?"height":"width"}function ua(e){return["top","bottom"].includes(vi(e))?"y":"x"}function Aw(e){return Cw(ua(e))}function Ej(e,t,n){n===void 0&&(n=!1);const r=ms(e),i=Aw(e),a=kw(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Lf(o)),[o,Lf(o)]}function Tj(e){const t=Lf(e);return[Rw(e),t,Rw(t)]}function Rw(e){return e.replace(/start|end/g,t=>xj[t])}function _j(e,t,n){const r=["left","right"],i=["right","left"],a=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?a:o;default:return[]}}function Sj(e,t,n,r){const i=ms(e);let a=_j(vi(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(Rw)))),a}function Lf(e){return e.replace(/left|right|bottom|top/g,t=>bj[t])}function Cj(e){return{top:0,right:0,bottom:0,left:0,...e}}function AC(e){return typeof e!="number"?Cj(e):{top:e,right:e,bottom:e,left:e}}function Mf(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function RC(e,t,n){let{reference:r,floating:i}=e;const a=ua(t),o=Aw(t),s=kw(o),l=vi(t),u=a==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2;let p;switch(l){case"top":p={x:c,y:r.y-i.height};break;case"bottom":p={x:c,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(ms(t)){case"start":p[o]-=f*(n&&u?-1:1);break;case"end":p[o]+=f*(n&&u?-1:1);break}return p}const kj=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,s=a.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=RC(u,r,l),f=r,p={},m=0;for(let g=0;g<s.length;g++){const{name:x,fn:w}=s[g],{x:v,y:b,data:E,reset:_}=await w({x:c,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:u,platform:o,elements:{reference:e,floating:t}});c=v??c,d=b??d,p={...p,[x]:{...p[x],...E}},_&&m<=50&&(m++,typeof _=="object"&&(_.placement&&(f=_.placement),_.rects&&(u=_.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):_.rects),{x:c,y:d}=RC(u,f,l)),g=-1)}return{x:c,y:d,placement:f,strategy:i,middlewareData:p}};async function pu(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:o,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=yi(t,e),m=AC(p),x=s[f?d==="floating"?"reference":"floating":d],w=Mf(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(x)))==null||n?x:x.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),v=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),E=await(a.isElement==null?void 0:a.isElement(b))?await(a.getScale==null?void 0:a.getScale(b))||{x:1,y:1}:{x:1,y:1},_=Mf(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:b,strategy:l}):v);return{top:(w.top-_.top+m.top)/E.y,bottom:(_.bottom-w.bottom+m.bottom)/E.y,left:(w.left-_.left+m.left)/E.x,right:(_.right-w.right+m.right)/E.x}}const Aj=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:l}=t,{element:u,padding:c=0}=yi(e,t)||{};if(u==null)return{};const d=AC(c),f={x:n,y:r},p=Aw(i),m=kw(p),g=await o.getDimensions(u),x=p==="y",w=x?"top":"left",v=x?"bottom":"right",b=x?"clientHeight":"clientWidth",E=a.reference[m]+a.reference[p]-f[p]-a.floating[m],_=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let I=S?S[b]:0;(!I||!await(o.isElement==null?void 0:o.isElement(S)))&&(I=s.floating[b]||a.floating[m]);const D=E/2-_/2,V=I/2-g[m]/2-1,N=sa(d[w],V),$=sa(d[v],V),z=N,X=I-g[m]-$,Y=I/2-g[m]/2+D,ne=Sw(z,Y,X),re=!l.arrow&&ms(i)!=null&&Y!==ne&&a.reference[m]/2-(Y<z?N:$)-g[m]/2<0,ee=re?Y<z?Y-z:Y-X:0;return{[p]:f[p]+ee,data:{[p]:ne,centerOffset:Y-ne-ee,...re&&{alignmentOffset:ee}},reset:re}}}),Rj=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...x}=yi(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const w=vi(i),v=ua(s),b=vi(s)===s,E=await(l.isRTL==null?void 0:l.isRTL(u.floating)),_=f||(b||!g?[Lf(s)]:Tj(s)),S=m!=="none";!f&&S&&_.push(...Sj(s,g,m,E));const I=[s,..._],D=await pu(t,x),V=[];let N=((r=a.flip)==null?void 0:r.overflows)||[];if(c&&V.push(D[w]),d){const Y=Ej(i,o,E);V.push(D[Y[0]],D[Y[1]])}if(N=[...N,{placement:i,overflows:V}],!V.every(Y=>Y<=0)){var $,z;const Y=((($=a.flip)==null?void 0:$.index)||0)+1,ne=I[Y];if(ne)return{data:{index:Y,overflows:N},reset:{placement:ne}};let re=(z=N.filter(ee=>ee.overflows[0]<=0).sort((ee,F)=>ee.overflows[1]-F.overflows[1])[0])==null?void 0:z.placement;if(!re)switch(p){case"bestFit":{var X;const ee=(X=N.filter(F=>{if(S){const B=ua(F.placement);return B===v||B==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(B=>B>0).reduce((B,k)=>B+k,0)]).sort((F,B)=>F[1]-B[1])[0])==null?void 0:X[0];ee&&(re=ee);break}case"initialPlacement":re=s;break}if(i!==re)return{reset:{placement:re}}}return{}}}};function NC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function PC(e){return vj.some(t=>e[t]>=0)}const Nj=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=yi(e,t);switch(r){case"referenceHidden":{const a=await pu(t,{...i,elementContext:"reference"}),o=NC(a,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:PC(o)}}}case"escaped":{const a=await pu(t,{...i,altBoundary:!0}),o=NC(a,n.floating);return{data:{escapedOffsets:o,escaped:PC(o)}}}default:return{}}}}};async function Pj(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=vi(n),s=ms(n),l=ua(n)==="y",u=["left","top"].includes(o)?-1:1,c=a&&l?-1:1,d=yi(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m=="number"&&(p=s==="end"?m*-1:m),l?{x:p*c,y:f*u}:{x:f*u,y:p*c}}const Ij=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:o,middlewareData:s}=t,l=await Pj(t,e);return o===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}},Oj=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:x=>{let{x:w,y:v}=x;return{x:w,y:v}}},...l}=yi(e,t),u={x:n,y:r},c=await pu(t,l),d=ua(vi(i)),f=Cw(d);let p=u[f],m=u[d];if(a){const x=f==="y"?"top":"left",w=f==="y"?"bottom":"right",v=p+c[x],b=p-c[w];p=Sw(v,p,b)}if(o){const x=d==="y"?"top":"left",w=d==="y"?"bottom":"right",v=m+c[x],b=m-c[w];m=Sw(v,m,b)}const g=s.fn({...t,[f]:p,[d]:m});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[f]:a,[d]:o}}}}}},Dj=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=yi(e,t),c={x:n,y:r},d=ua(i),f=Cw(d);let p=c[f],m=c[d];const g=yi(s,t),x=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const b=f==="y"?"height":"width",E=a.reference[f]-a.floating[b]+x.mainAxis,_=a.reference[f]+a.reference[b]-x.mainAxis;p<E?p=E:p>_&&(p=_)}if(u){var w,v;const b=f==="y"?"width":"height",E=["top","left"].includes(vi(i)),_=a.reference[d]-a.floating[b]+(E&&((w=o.offset)==null?void 0:w[d])||0)+(E?0:x.crossAxis),S=a.reference[d]+a.reference[b]+(E?0:((v=o.offset)==null?void 0:v[d])||0)-(E?x.crossAxis:0);m<_?m=_:m>S&&(m=S)}return{[f]:p,[d]:m}}}},Lj=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:a,platform:o,elements:s}=t,{apply:l=()=>{},...u}=yi(e,t),c=await pu(t,u),d=vi(i),f=ms(i),p=ua(i)==="y",{width:m,height:g}=a.floating;let x,w;d==="top"||d==="bottom"?(x=d,w=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(w=d,x=f==="end"?"top":"bottom");const v=g-c.top-c.bottom,b=m-c.left-c.right,E=sa(g-c[x],v),_=sa(m-c[w],b),S=!t.middlewareData.shift;let I=E,D=_;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(I=v),S&&!f){const N=Hn(c.left,0),$=Hn(c.right,0),z=Hn(c.top,0),X=Hn(c.bottom,0);p?D=m-2*(N!==0||$!==0?N+$:Hn(c.left,c.right)):I=g-2*(z!==0||X!==0?z+X:Hn(c.top,c.bottom))}await l({...t,availableWidth:D,availableHeight:I});const V=await o.getDimensions(s.floating);return m!==V.width||g!==V.height?{reset:{rects:!0}}:{}}}};function Ff(){return typeof window<"u"}function gs(e){return IC(e)?(e.nodeName||"").toLowerCase():"#document"}function Vn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Hr(e){var t;return(t=(IC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function IC(e){return Ff()?e instanceof Node||e instanceof Vn(e).Node:!1}function Tr(e){return Ff()?e instanceof Element||e instanceof Vn(e).Element:!1}function Vr(e){return Ff()?e instanceof HTMLElement||e instanceof Vn(e).HTMLElement:!1}function OC(e){return!Ff()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Vn(e).ShadowRoot}function hu(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=_r(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function Mj(e){return["table","td","th"].includes(gs(e))}function Bf(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Nw(e){const t=Pw(),n=Tr(e)?_r(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Fj(e){let t=ca(e);for(;Vr(t)&&!ws(t);){if(Nw(t))return t;if(Bf(t))return null;t=ca(t)}return null}function Pw(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ws(e){return["html","body","#document"].includes(gs(e))}function _r(e){return Vn(e).getComputedStyle(e)}function jf(e){return Tr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ca(e){if(gs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||OC(e)&&e.host||Hr(e);return OC(t)?t.host:t}function DC(e){const t=ca(e);return ws(t)?e.ownerDocument?e.ownerDocument.body:e.body:Vr(t)&&hu(t)?t:DC(t)}function mu(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=DC(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=Vn(i);if(a){const s=Iw(o);return t.concat(o,o.visualViewport||[],hu(i)?i:[],s&&n?mu(s):[])}return t.concat(i,mu(i,[],n))}function Iw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function LC(e){const t=_r(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Vr(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Of(n)!==a||Of(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ow(e){return Tr(e)?e:e.contextElement}function ys(e){const t=Ow(e);if(!Vr(t))return la(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=LC(t);let o=(a?Of(n.width):n.width)/r,s=(a?Of(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const Bj=la(0);function MC(e){const t=Vn(e);return!Pw()||!t.visualViewport?Bj:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function jj(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Vn(e)?!1:t}function ao(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=Ow(e);let o=la(1);t&&(r?Tr(r)&&(o=ys(r)):o=ys(e));const s=jj(a,n,r)?MC(a):la(0);let l=(i.left+s.x)/o.x,u=(i.top+s.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(a){const f=Vn(a),p=r&&Tr(r)?Vn(r):r;let m=f,g=Iw(m);for(;g&&r&&p!==m;){const x=ys(g),w=g.getBoundingClientRect(),v=_r(g),b=w.left+(g.clientLeft+parseFloat(v.paddingLeft))*x.x,E=w.top+(g.clientTop+parseFloat(v.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,d*=x.y,l+=b,u+=E,m=Vn(g),g=Iw(m)}}return Mf({width:c,height:d,x:l,y:u})}function Uj(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=Hr(r),s=t?Bf(t.floating):!1;if(r===o||s&&a)return n;let l={scrollLeft:0,scrollTop:0},u=la(1);const c=la(0),d=Vr(r);if((d||!d&&!a)&&((gs(r)!=="body"||hu(o))&&(l=jf(r)),Vr(r))){const f=ao(r);u=ys(r),c.x=f.x+r.clientLeft,c.y=f.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x,y:n.y*u.y-l.scrollTop*u.y+c.y}}function zj(e){return Array.from(e.getClientRects())}function Dw(e,t){const n=jf(e).scrollLeft;return t?t.left+n:ao(Hr(e)).left+n}function Hj(e){const t=Hr(e),n=jf(e),r=e.ownerDocument.body,i=Hn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Hn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Dw(e);const s=-n.scrollTop;return _r(r).direction==="rtl"&&(o+=Hn(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function Vj(e,t){const n=Vn(e),r=Hr(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;const u=Pw();(!u||u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s,y:l}}function $j(e,t){const n=ao(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Vr(e)?ys(e):la(1),o=e.clientWidth*a.x,s=e.clientHeight*a.y,l=i*a.x,u=r*a.y;return{width:o,height:s,x:l,y:u}}function FC(e,t,n){let r;if(t==="viewport")r=Vj(e,n);else if(t==="document")r=Hj(Hr(e));else if(Tr(t))r=$j(t,n);else{const i=MC(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return Mf(r)}function BC(e,t){const n=ca(e);return n===t||!Tr(n)||ws(n)?!1:_r(n).position==="fixed"||BC(n,t)}function Wj(e,t){const n=t.get(e);if(n)return n;let r=mu(e,[],!1).filter(s=>Tr(s)&&gs(s)!=="body"),i=null;const a=_r(e).position==="fixed";let o=a?ca(e):e;for(;Tr(o)&&!ws(o);){const s=_r(o),l=Nw(o);!l&&s.position==="fixed"&&(i=null),(a?!l&&!i:!l&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||hu(o)&&!l&&BC(e,o))?r=r.filter(c=>c!==o):i=s,o=ca(o)}return t.set(e,r),r}function Yj(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?Bf(t)?[]:Wj(t,this._c):[].concat(n),r],s=o[0],l=o.reduce((u,c)=>{const d=FC(t,c,i);return u.top=Hn(d.top,u.top),u.right=sa(d.right,u.right),u.bottom=sa(d.bottom,u.bottom),u.left=Hn(d.left,u.left),u},FC(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function qj(e){const{width:t,height:n}=LC(e);return{width:t,height:n}}function Gj(e,t,n){const r=Vr(t),i=Hr(t),a=n==="fixed",o=ao(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=la(0);if(r||!r&&!a)if((gs(t)!=="body"||hu(i))&&(s=jf(t)),r){const p=ao(t,!0,a,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else i&&(l.x=Dw(i));let u=0,c=0;if(i&&!r&&!a){const p=i.getBoundingClientRect();c=p.top+s.scrollTop,u=p.left+s.scrollLeft-Dw(i,p)}const d=o.left+s.scrollLeft-l.x-u,f=o.top+s.scrollTop-l.y-c;return{x:d,y:f,width:o.width,height:o.height}}function Lw(e){return _r(e).position==="static"}function jC(e,t){if(!Vr(e)||_r(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Hr(e)===n&&(n=n.ownerDocument.body),n}function UC(e,t){const n=Vn(e);if(Bf(e))return n;if(!Vr(e)){let i=ca(e);for(;i&&!ws(i);){if(Tr(i)&&!Lw(i))return i;i=ca(i)}return n}let r=jC(e,t);for(;r&&Mj(r)&&Lw(r);)r=jC(r,t);return r&&ws(r)&&Lw(r)&&!Nw(r)?n:r||Fj(e)||n}const Kj=async function(e){const t=this.getOffsetParent||UC,n=this.getDimensions,r=await n(e.floating);return{reference:Gj(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Xj(e){return _r(e).direction==="rtl"}const Qj={convertOffsetParentRelativeRectToViewportRelativeRect:Uj,getDocumentElement:Hr,getClippingRect:Yj,getOffsetParent:UC,getElementRects:Kj,getClientRects:zj,getDimensions:qj,getScale:ys,isElement:Tr,isRTL:Xj};function Zj(e,t){let n=null,r;const i=Hr(e);function a(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function o(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const{left:u,top:c,width:d,height:f}=e.getBoundingClientRect();if(s||t(),!d||!f)return;const p=Df(c),m=Df(i.clientWidth-(u+d)),g=Df(i.clientHeight-(c+f)),x=Df(u),v={rootMargin:-p+"px "+-m+"px "+-g+"px "+-x+"px",threshold:Hn(0,sa(1,l))||1};let b=!0;function E(_){const S=_[0].intersectionRatio;if(S!==l){if(!b)return o();S?o(!1,S):r=setTimeout(()=>{o(!1,1e-7)},1e3)}b=!1}try{n=new IntersectionObserver(E,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(E,v)}n.observe(e)}return o(!0),a}function zC(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Ow(e),c=i||a?[...u?mu(u):[],...mu(t)]:[];c.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),a&&w.addEventListener("resize",n)});const d=u&&s?Zj(u,n):null;let f=-1,p=null;o&&(p=new ResizeObserver(w=>{let[v]=w;v&&v.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(t)})),n()}),u&&!l&&p.observe(u),p.observe(t));let m,g=l?ao(e):null;l&&x();function x(){const w=ao(e);g&&(w.x!==g.x||w.y!==g.y||w.width!==g.width||w.height!==g.height)&&n(),g=w,m=requestAnimationFrame(x)}return n(),()=>{var w;c.forEach(v=>{i&&v.removeEventListener("scroll",n),a&&v.removeEventListener("resize",n)}),d==null||d(),(w=p)==null||w.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const Jj=Ij,eU=Oj,tU=Rj,nU=Lj,rU=Nj,HC=Aj,iU=Dj,aU=(e,t,n)=>{const r=new Map,i={platform:Qj,...n},a={...i.platform,_c:r};return kj(e,t,{...i,platform:a})};var Uf=typeof document<"u"?y.useLayoutEffect:y.useEffect;function zf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!zf(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const a=i[r];if(!(a==="_owner"&&e.$$typeof)&&!zf(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function VC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $C(e,t){const n=VC(e);return Math.round(t*n)/n}function Mw(e){const t=y.useRef(e);return Uf(()=>{t.current=e}),t}function WC(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[c,d]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=y.useState(r);zf(f,r)||p(r);const[m,g]=y.useState(null),[x,w]=y.useState(null),v=y.useCallback(F=>{F!==S.current&&(S.current=F,g(F))},[]),b=y.useCallback(F=>{F!==I.current&&(I.current=F,w(F))},[]),E=a||m,_=o||x,S=y.useRef(null),I=y.useRef(null),D=y.useRef(c),V=l!=null,N=Mw(l),$=Mw(i),z=Mw(u),X=y.useCallback(()=>{if(!S.current||!I.current)return;const F={placement:t,strategy:n,middleware:f};$.current&&(F.platform=$.current),aU(S.current,I.current,F).then(B=>{const k={...B,isPositioned:z.current!==!1};Y.current&&!zf(D.current,k)&&(D.current=k,hs.flushSync(()=>{d(k)}))})},[f,t,n,$,z]);Uf(()=>{u===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,d(F=>({...F,isPositioned:!1})))},[u]);const Y=y.useRef(!1);Uf(()=>(Y.current=!0,()=>{Y.current=!1}),[]),Uf(()=>{if(E&&(S.current=E),_&&(I.current=_),E&&_){if(N.current)return N.current(E,_,X);X()}},[E,_,X,N,V]);const ne=y.useMemo(()=>({reference:S,floating:I,setReference:v,setFloating:b}),[v,b]),re=y.useMemo(()=>({reference:E,floating:_}),[E,_]),ee=y.useMemo(()=>{const F={position:n,left:0,top:0};if(!re.floating)return F;const B=$C(re.floating,c.x),k=$C(re.floating,c.y);return s?{...F,transform:"translate("+B+"px, "+k+"px)",...VC(re.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:B,top:k}},[n,s,re.floating,c.x,c.y]);return y.useMemo(()=>({...c,update:X,refs:ne,elements:re,floatingStyles:ee}),[c,X,ne,re,ee])}const oU=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?HC({element:r.current,padding:i}).fn(n):{}:r?HC({element:r,padding:i}).fn(n):{}}}},YC=(e,t)=>({...Jj(e),options:[e,t]}),qC=(e,t)=>({...eU(e),options:[e,t]}),GC=(e,t)=>({...iU(e),options:[e,t]}),KC=(e,t)=>({...tU(e),options:[e,t]}),XC=(e,t)=>({...nU(e),options:[e,t]}),QC=(e,t)=>({...rU(e),options:[e,t]}),ZC=(e,t)=>({...oU(e),options:[e,t]});var sU="Arrow",JC=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...a}=e;return T.jsx(zn.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:T.jsx("polygon",{points:"0,0 30,0 15,10"})})});JC.displayName=sU;var lU=JC;function uU(e,t=[]){let n=[];function r(a,o){const s=y.createContext(o),l=n.length;n=[...n,o];function u(d){const{scope:f,children:p,...m}=d,g=(f==null?void 0:f[e][l])||s,x=y.useMemo(()=>m,Object.values(m));return T.jsx(g.Provider,{value:x,children:p})}function c(d,f){const p=(f==null?void 0:f[e][l])||s,m=y.useContext(p);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${a}\``)}return u.displayName=a+"Provider",[u,c]}const i=()=>{const a=n.map(o=>y.createContext(o));return function(s){const l=(s==null?void 0:s[e])||a;return y.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,cU(i,...t)]}function cU(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const o=r.reduce((s,{useScope:l,scopeName:u})=>{const d=l(a)[`__scope${u}`];return{...s,...d}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function ek(e){const[t,n]=y.useState(void 0);return ir(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let o,s;if("borderBoxSize"in a){const l=a.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,s=u.blockSize}else o=e.offsetWidth,s=e.offsetHeight;n({width:o,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Fw="Popper",[tk,Hf]=uU(Fw),[dU,nk]=tk(Fw),rk=e=>{const{__scopePopper:t,children:n}=e,[r,i]=y.useState(null);return T.jsx(dU,{scope:t,anchor:r,onAnchorChange:i,children:n})};rk.displayName=Fw;var ik="PopperAnchor",ak=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,a=nk(ik,n),o=y.useRef(null),s=Mr(t,o);return y.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:T.jsx(zn.div,{...i,ref:s})});ak.displayName=ik;var Bw="PopperContent",[fU,pU]=tk(Bw),ok=y.forwardRef((e,t)=>{var $e,Ve,We,Ge,St,Te;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:o=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:m,...g}=e,x=nk(Bw,n),[w,v]=y.useState(null),b=Mr(t,xe=>v(xe)),[E,_]=y.useState(null),S=ek(E),I=(S==null?void 0:S.width)??0,D=(S==null?void 0:S.height)??0,V=r+(a!=="center"?"-"+a:""),N=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},$=Array.isArray(u)?u:[u],z=$.length>0,X={padding:N,boundary:$.filter(mU),altBoundary:z},{refs:Y,floatingStyles:ne,placement:re,isPositioned:ee,middlewareData:F}=WC({strategy:"fixed",placement:V,whileElementsMounted:(...xe)=>zC(...xe,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[YC({mainAxis:i+D,alignmentAxis:o}),l&&qC({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?GC():void 0,...X}),l&&KC({...X}),XC({...X,apply:({elements:xe,rects:Ye,availableWidth:ze,availableHeight:vt})=>{const{width:bt,height:Ke}=Ye.reference,Le=xe.floating.style;Le.setProperty("--radix-popper-available-width",`${ze}px`),Le.setProperty("--radix-popper-available-height",`${vt}px`),Le.setProperty("--radix-popper-anchor-width",`${bt}px`),Le.setProperty("--radix-popper-anchor-height",`${Ke}px`)}}),E&&ZC({element:E,padding:s}),gU({arrowWidth:I,arrowHeight:D}),f&&QC({strategy:"referenceHidden",...X})]}),[B,k]=uk(re),ie=Wt(m);ir(()=>{ee&&(ie==null||ie())},[ee,ie]);const he=($e=F.arrow)==null?void 0:$e.x,O=(Ve=F.arrow)==null?void 0:Ve.y,Pe=((We=F.arrow)==null?void 0:We.centerOffset)!==0,[ge,ve]=y.useState();return ir(()=>{w&&ve(window.getComputedStyle(w).zIndex)},[w]),T.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...ne,transform:ee?ne.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[(Ge=F.transformOrigin)==null?void 0:Ge.x,(St=F.transformOrigin)==null?void 0:St.y].join(" "),...((Te=F.hide)==null?void 0:Te.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:T.jsx(fU,{scope:n,placedSide:B,onArrowChange:_,arrowX:he,arrowY:O,shouldHideArrow:Pe,children:T.jsx(zn.div,{"data-side":B,"data-align":k,...g,ref:b,style:{...g.style,animation:ee?void 0:"none"}})})})});ok.displayName=Bw;var sk="PopperArrow",hU={top:"bottom",right:"left",bottom:"top",left:"right"},lk=y.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,a=pU(sk,r),o=hU[a.placedSide];return T.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:T.jsx(lU,{...i,ref:n,style:{...i.style,display:"block"}})})});lk.displayName=sk;function mU(e){return e!==null}var gU=e=>({name:"transformOrigin",options:e,fn(t){var x,w,v;const{placement:n,rects:r,middlewareData:i}=t,o=((x=i.arrow)==null?void 0:x.centerOffset)!==0,s=o?0:e.arrowWidth,l=o?0:e.arrowHeight,[u,c]=uk(n),d={start:"0%",center:"50%",end:"100%"}[c],f=(((w=i.arrow)==null?void 0:w.x)??0)+s/2,p=(((v=i.arrow)==null?void 0:v.y)??0)+l/2;let m="",g="";return u==="bottom"?(m=o?d:`${f}px`,g=`${-l}px`):u==="top"?(m=o?d:`${f}px`,g=`${r.floating.height+l}px`):u==="right"?(m=`${-l}px`,g=o?d:`${p}px`):u==="left"&&(m=`${r.floating.width+l}px`,g=o?d:`${p}px`),{data:{x:m,y:g}}}});function uk(e){const[t,n="center"]=e.split("-");return[t,n]}var ck=rk,jw=ak,dk=ok,fk=lk;function wU(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var Uw=e=>{const{present:t,children:n}=e,r=yU(t),i=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),a=Mr(r.ref,vU(i));return typeof n=="function"||r.isPresent?y.cloneElement(i,{ref:a}):null};Uw.displayName="Presence";function yU(e){const[t,n]=y.useState(),r=y.useRef({}),i=y.useRef(e),a=y.useRef("none"),o=e?"mounted":"unmounted",[s,l]=wU(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const u=Vf(r.current);a.current=s==="mounted"?u:"none"},[s]),ir(()=>{const u=r.current,c=i.current;if(c!==e){const f=a.current,p=Vf(u);e?l("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),ir(()=>{if(t){let u;const c=t.ownerDocument.defaultView??window,d=p=>{const g=Vf(r.current).includes(p.animationName);if(p.target===t&&g&&(l("ANIMATION_END"),!i.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},f=p=>{p.target===t&&(a.current=Vf(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{c.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:y.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Vf(e){return(e==null?void 0:e.animationName)||"none"}function vU(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function $f({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=bU({defaultProp:t,onChange:n}),a=e!==void 0,o=a?e:r,s=Wt(n),l=y.useCallback(u=>{if(a){const d=typeof u=="function"?u(e):u;d!==e&&s(d)}else i(u)},[a,e,i,s]);return[o,l]}function bU({defaultProp:e,onChange:t}){const n=y.useState(e),[r]=n,i=y.useRef(r),a=Wt(t);return y.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}var xU="VisuallyHidden",pk=y.forwardRef((e,t)=>T.jsx(zn.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));pk.displayName=xU;var EU=pk,[Wf,kie]=Ui("Tooltip",[Hf]),Yf=Hf(),hk="TooltipProvider",TU=700,zw="tooltip.open",[_U,Hw]=Wf(hk),mk=e=>{const{__scopeTooltip:t,delayDuration:n=TU,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,[o,s]=y.useState(!0),l=y.useRef(!1),u=y.useRef(0);return y.useEffect(()=>{const c=u.current;return()=>window.clearTimeout(c)},[]),T.jsx(_U,{scope:t,isOpenDelayed:o,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(u.current),s(!1)},[]),onClose:y.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>s(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:y.useCallback(c=>{l.current=c},[]),disableHoverableContent:i,children:a})};mk.displayName=hk;var qf="Tooltip",[SU,Gf]=Wf(qf),gk=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,l=Hw(qf,e.__scopeTooltip),u=Yf(t),[c,d]=y.useState(null),f=fu(),p=y.useRef(0),m=o??l.disableHoverableContent,g=s??l.delayDuration,x=y.useRef(!1),[w=!1,v]=$f({prop:r,defaultProp:i,onChange:I=>{I?(l.onOpen(),document.dispatchEvent(new CustomEvent(zw))):l.onClose(),a==null||a(I)}}),b=y.useMemo(()=>w?x.current?"delayed-open":"instant-open":"closed",[w]),E=y.useCallback(()=>{window.clearTimeout(p.current),x.current=!1,v(!0)},[v]),_=y.useCallback(()=>{window.clearTimeout(p.current),v(!1)},[v]),S=y.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{x.current=!0,v(!0)},g)},[g,v]);return y.useEffect(()=>()=>window.clearTimeout(p.current),[]),T.jsx(ck,{...u,children:T.jsx(SU,{scope:t,contentId:f,open:w,stateAttribute:b,trigger:c,onTriggerChange:d,onTriggerEnter:y.useCallback(()=>{l.isOpenDelayed?S():E()},[l.isOpenDelayed,S,E]),onTriggerLeave:y.useCallback(()=>{m?_():window.clearTimeout(p.current)},[_,m]),onOpen:E,onClose:_,disableHoverableContent:m,children:n})})};gk.displayName=qf;var Vw="TooltipTrigger",wk=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Gf(Vw,n),a=Hw(Vw,n),o=Yf(n),s=y.useRef(null),l=Mr(t,s,i.onTriggerChange),u=y.useRef(!1),c=y.useRef(!1),d=y.useCallback(()=>u.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),T.jsx(jw,{asChild:!0,...o,children:T.jsx(zn.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:vn(e.onPointerMove,f=>{f.pointerType!=="touch"&&!c.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),c.current=!0)}),onPointerLeave:vn(e.onPointerLeave,()=>{i.onTriggerLeave(),c.current=!1}),onPointerDown:vn(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:vn(e.onFocus,()=>{u.current||i.onOpen()}),onBlur:vn(e.onBlur,i.onClose),onClick:vn(e.onClick,i.onClose)})})});wk.displayName=Vw;var CU="TooltipPortal",[Aie,kU]=Wf(CU,{forceMount:void 0}),vs="TooltipContent",yk=y.forwardRef((e,t)=>{const n=kU(vs,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...a}=e,o=Gf(vs,e.__scopeTooltip);return T.jsx(Uw,{present:r||o.open,children:o.disableHoverableContent?T.jsx(vk,{side:i,...a,ref:t}):T.jsx(AU,{side:i,...a,ref:t})})}),AU=y.forwardRef((e,t)=>{const n=Gf(vs,e.__scopeTooltip),r=Hw(vs,e.__scopeTooltip),i=y.useRef(null),a=Mr(t,i),[o,s]=y.useState(null),{trigger:l,onClose:u}=n,c=i.current,{onPointerInTransitChange:d}=r,f=y.useCallback(()=>{s(null),d(!1)},[d]),p=y.useCallback((m,g)=>{const x=m.currentTarget,w={x:m.clientX,y:m.clientY},v=IU(w,x.getBoundingClientRect()),b=OU(w,v),E=DU(g.getBoundingClientRect()),_=MU([...b,...E]);s(_),d(!0)},[d]);return y.useEffect(()=>()=>f(),[f]),y.useEffect(()=>{if(l&&c){const m=x=>p(x,c),g=x=>p(x,l);return l.addEventListener("pointerleave",m),c.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",m),c.removeEventListener("pointerleave",g)}}},[l,c,p,f]),y.useEffect(()=>{if(o){const m=g=>{const x=g.target,w={x:g.clientX,y:g.clientY},v=(l==null?void 0:l.contains(x))||(c==null?void 0:c.contains(x)),b=!LU(w,o);v?f():b&&(f(),u())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,c,o,u,f]),T.jsx(vk,{...e,ref:a})}),[RU,NU]=Wf(qf,{isInside:!1}),vk=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,l=Gf(vs,n),u=Yf(n),{onClose:c}=l;return y.useEffect(()=>(document.addEventListener(zw,c),()=>document.removeEventListener(zw,c)),[c]),y.useEffect(()=>{if(l.trigger){const d=f=>{const p=f.target;p!=null&&p.contains(l.trigger)&&c()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,c]),T.jsx(_w,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:c,children:T.jsxs(dk,{"data-state":l.stateAttribute,...u,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[T.jsx(EC,{children:r}),T.jsx(RU,{scope:n,isInside:!0,children:T.jsx(EU,{id:l.contentId,role:"tooltip",children:i||r})})]})})});yk.displayName=vs;var bk="TooltipArrow",PU=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Yf(n);return NU(bk,n).isInside?null:T.jsx(fk,{...i,...r,ref:t})});PU.displayName=bk;function IU(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function OU(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function DU(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function LU(e,t){const{x:n,y:r}=e;let i=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const s=t[a].x,l=t[a].y,u=t[o].x,c=t[o].y;l>r!=c>r&&n<(u-s)*(r-l)/(c-l)+s&&(i=!i)}return i}function MU(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),FU(t)}function FU(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const a=t[t.length-1],o=t[t.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const a=n[n.length-1],o=n[n.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var BU=mk,jU=gk,UU=wk,xk=yk;function Ek(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Ek(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function zU(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ek(e))&&(r&&(r+=" "),r+=t);return r}const $w="-",HU=e=>{const t=$U(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const s=o.split($w);return s[0]===""&&s.length!==1&&s.shift(),Tk(s,t)||VU(o)},getConflictingClassGroupIds:(o,s)=>{const l=n[o]||[];return s&&r[o]?[...l,...r[o]]:l}}},Tk=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Tk(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const a=e.join($w);return(o=t.validators.find(({validator:s})=>s(a)))==null?void 0:o.classGroupId},_k=/^\[(.+)\]$/,VU=e=>{if(_k.test(e)){const t=_k.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},$U=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return YU(Object.entries(e.classGroups),n).forEach(([a,o])=>{Ww(o,r,a,t)}),r},Ww=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const a=i===""?t:Sk(t,i);a.classGroupId=n;return}if(typeof i=="function"){if(WU(i)){Ww(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([a,o])=>{Ww(o,Sk(t,a),n,r)})})},Sk=(e,t)=>{let n=e;return t.split($w).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},WU=e=>e.isThemeGetter,YU=(e,t)=>t?e.map(([n,r])=>{const i=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([o,s])=>[t+o,s])):a);return[n,i]}):e,qU=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(a,o)=>{n.set(a,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let o=n.get(a);if(o!==void 0)return o;if((o=r.get(a))!==void 0)return i(a,o),o},set(a,o){n.has(a)?n.set(a,o):i(a,o)}}},Ck="!",GU=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,o=s=>{const l=[];let u=0,c=0,d;for(let x=0;x<s.length;x++){let w=s[x];if(u===0){if(w===i&&(r||s.slice(x,x+a)===t)){l.push(s.slice(c,x)),c=x+a;continue}if(w==="/"){d=x;continue}}w==="["?u++:w==="]"&&u--}const f=l.length===0?s:s.substring(c),p=f.startsWith(Ck),m=p?f.substring(1):f,g=d&&d>c?d-c:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:g}};return n?s=>n({className:s,parseClassName:o}):o},KU=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},XU=e=>({cache:qU(e.cacheSize),parseClassName:GU(e),...HU(e)}),QU=/\s+/,ZU=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(QU);let s="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(u);let m=!!p,g=r(m?f.substring(0,p):f);if(!g){if(!m){s=u+(s.length>0?" "+s:s);continue}if(g=r(f),!g){s=u+(s.length>0?" "+s:s);continue}m=!1}const x=KU(c).join(":"),w=d?x+Ck:x,v=w+g;if(a.includes(v))continue;a.push(v);const b=i(g,m);for(let E=0;E<b.length;++E){const _=b[E];a.push(w+_)}s=u+(s.length>0?" "+s:s)}return s};function JU(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=kk(t))&&(r&&(r+=" "),r+=n);return r}const kk=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=kk(e[r]))&&(n&&(n+=" "),n+=t);return n};function ez(e,...t){let n,r,i,a=o;function o(l){const u=t.reduce((c,d)=>d(c),e());return n=XU(u),r=n.cache.get,i=n.cache.set,a=s,s(l)}function s(l){const u=r(l);if(u)return u;const c=ZU(l,n);return i(l,c),c}return function(){return a(JU.apply(null,arguments))}}const rt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ak=/^\[(?:([a-z-]+):)?(.+)\]$/i,tz=/^\d+\/\d+$/,nz=new Set(["px","full","screen"]),rz=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,iz=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,az=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,oz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,bi=e=>bs(e)||nz.has(e)||tz.test(e),da=e=>xs(e,"length",mz),bs=e=>!!e&&!Number.isNaN(Number(e)),Yw=e=>xs(e,"number",bs),gu=e=>!!e&&Number.isInteger(Number(e)),lz=e=>e.endsWith("%")&&bs(e.slice(0,-1)),Ae=e=>Ak.test(e),fa=e=>rz.test(e),uz=new Set(["length","size","percentage"]),cz=e=>xs(e,uz,Rk),dz=e=>xs(e,"position",Rk),fz=new Set(["image","url"]),pz=e=>xs(e,fz,wz),hz=e=>xs(e,"",gz),wu=()=>!0,xs=(e,t,n)=>{const r=Ak.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},mz=e=>iz.test(e)&&!az.test(e),Rk=()=>!1,gz=e=>oz.test(e),wz=e=>sz.test(e),yz=ez(()=>{const e=rt("colors"),t=rt("spacing"),n=rt("blur"),r=rt("brightness"),i=rt("borderColor"),a=rt("borderRadius"),o=rt("borderSpacing"),s=rt("borderWidth"),l=rt("contrast"),u=rt("grayscale"),c=rt("hueRotate"),d=rt("invert"),f=rt("gap"),p=rt("gradientColorStops"),m=rt("gradientColorStopPositions"),g=rt("inset"),x=rt("margin"),w=rt("opacity"),v=rt("padding"),b=rt("saturate"),E=rt("scale"),_=rt("sepia"),S=rt("skew"),I=rt("space"),D=rt("translate"),V=()=>["auto","contain","none"],N=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto",Ae,t],z=()=>[Ae,t],X=()=>["",bi,da],Y=()=>["auto",bs,Ae],ne=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],re=()=>["solid","dashed","dotted","double","none"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],F=()=>["start","end","center","between","around","evenly","stretch"],B=()=>["","0",Ae],k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ie=()=>[bs,Ae];return{cacheSize:500,separator:":",theme:{colors:[wu],spacing:[bi,da],blur:["none","",fa,Ae],brightness:ie(),borderColor:[e],borderRadius:["none","","full",fa,Ae],borderSpacing:z(),borderWidth:X(),contrast:ie(),grayscale:B(),hueRotate:ie(),invert:B(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[lz,da],inset:$(),margin:$(),opacity:ie(),padding:z(),saturate:ie(),scale:ie(),sepia:B(),skew:ie(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",Ae]}],container:["container"],columns:[{columns:[fa]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ne(),Ae]}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",gu,Ae]}],basis:[{basis:$()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ae]}],grow:[{grow:B()}],shrink:[{shrink:B()}],order:[{order:["first","last","none",gu,Ae]}],"grid-cols":[{"grid-cols":[wu]}],"col-start-end":[{col:["auto",{span:["full",gu,Ae]},Ae]}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":[wu]}],"row-start-end":[{row:["auto",{span:[gu,Ae]},Ae]}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ae]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ae]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...F()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...F(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...F(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[I]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[I]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ae,t]}],"min-w":[{"min-w":[Ae,t,"min","max","fit"]}],"max-w":[{"max-w":[Ae,t,"none","full","min","max","fit","prose",{screen:[fa]},fa]}],h:[{h:[Ae,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ae,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ae,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ae,t,"auto","min","max","fit"]}],"font-size":[{text:["base",fa,da]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Yw]}],"font-family":[{font:[wu]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ae]}],"line-clamp":[{"line-clamp":["none",bs,Yw]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",bi,Ae]}],"list-image":[{"list-image":["none",Ae]}],"list-style-type":[{list:["none","disc","decimal",Ae]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",bi,da]}],"underline-offset":[{"underline-offset":["auto",bi,Ae]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ae]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ae]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ne(),dz]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",cz]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},pz]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...re(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:re()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...re()]}],"outline-offset":[{"outline-offset":[bi,Ae]}],"outline-w":[{outline:[bi,da]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[bi,da]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",fa,hz]}],"shadow-color":[{shadow:[wu]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...ee(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ee()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",fa,Ae]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ae]}],duration:[{duration:ie()}],ease:[{ease:["linear","in","out","in-out",Ae]}],delay:[{delay:ie()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ae]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[gu,Ae]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ae]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ae]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ae]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[bi,da,Yw]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});function Me(...e){return yz(zU(e))}const vz=BU,bz=jU,xz=UU,Nk=y.forwardRef(({className:e,sideOffset:t=4,...n},r)=>T.jsx(xk,{ref:r,sideOffset:t,className:Me("z-50 overflow-hidden max-w-xs rounded-xl bg-black border text-primary-foreground p-2 text-center align-middle text-xs shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",e),...n}));Nk.displayName=xk.displayName;function qw({children:e,content:t,side:n,align:r}){return T.jsxs(bz,{children:[T.jsx(xz,{asChild:!0,children:e}),T.jsx(Nk,{side:n,align:r,collisionPadding:8,avoidCollisions:!0,children:t})]})}const Pk={en:{ok:"OK",yes:"Yes",no:"No",agree:"Agree",cancel:"Cancel","yes-exit":"Yes, exit","yes-reset":"Yes, reset","no-cancel":"No, cancel","are-you-sure":"Are you sure?",recording:"Recording...","thank-you":"Thank you","sorry-try-again":"Sorry, please try again","error-occurred":"An error occurred","please-try-again":"Please try again","write-a-message":"Write a message...","send-message":"Send message",connected:"Connected",connecting:"Connecting",reconnecting:"Reconnecting",reconnected:"Reconnected",disconnecting:"Disconnecting",disconnected:"Disconnected",error:"Error","persist-session":"Persist session",settings:"Settings",close:"Close",help:"Help",chat:"Chat",send:"Send",copy:"Copy",copied:"Copied","sound-effects":"Sound effects",language:"Language",select:"Select",agent:"Agent",user:"User",bot:"Bot","reset-conversation-confirm":"Are you sure you want to reset the conversation?","close-widget":"Close widget","got-any-questions":"Got any questions? Chat with us!","typical-response-time":"Typically respond in less than 1 minute","session-closed-lead":"Your issue has been resolved!","create-new-ticket":"Create new ticket",exit:"Exit","reset-conversation":"Reset conversation","welcome-title":"Welcome to our support chat","welcome-description":"We're here to help! Start a conversation and we'll get back to you as soon as possible.","your-name":"Your name","your-email":"Your email address","start-chat":"Talk to support","starting-chat":"Connecting...","hello-greeting":"Hi there!"},ar:{ok:"حسنا",yes:"نعم",no:"لا",agree:"موافق",cancel:"إلغاء","yes-exit":"نعم، اخرج","yes-reset":"نعم، إعادة تعيين","no-cancel":"لا، إلغاء","are-you-sure":"هل أنت متأكد؟",recording:"تسجيل","thank-you":"شكرا","sorry-try-again":"عذرا، حاول مرة أخرى","error-occurred":"حدث خطأ","please-try-again":"يرجى المحاولة مرة أخرى","write-a-message":"اكتب رسالة...","send-message":"إرسال رسالة",connected:"متصل",connecting:"جاري الاتصال",reconnecting:"جاري إعادة الاتصال",reconnected:"تم إعادة الاتصال",disconnecting:"جاري قطع الاتصال",disconnected:"قطع الاتصال",error:"خطأ","persist-session":"حفظ الجلسة",settings:"إعدادات",close:"إغلاق",help:"مساعدة",chat:"محادثة",send:"إرسال",copy:"نسخ",copied:"تم النسخ","sound-effects":"التاثيرات الصوتية",language:"اللغة",select:"اختر",agent:"الوكيل",user:"المستخدم",bot:"البوت","reset-conversation-confirm":"هل أنت متأكد من أنك تريد إعادة تعيين المحادثة؟","close-widget":"إغلاق الودجة","got-any-questions":"هل لديك أي أسئلة؟ تحدث معنا!","typical-response-time":"عادة ما نرد في أقل من دقيقة واحدة","session-closed-lead":"تم حل مشكلتك!",exit:"خروج","create-new-ticket":"إنشاء تذكرة جديدة","reset-conversation":"إعادة تعيين المحادثة","welcome-title":"مرحبًا بك في دردشة الدعم الخاصة بنا","welcome-description":"نحن هنا للمساعدة! ابدأ محادثة وسنرد عليك في أقرب وقت ممكن.","your-name":"اسمك","your-email":"عنوان بريدك الإلكتروني","start-chat":"تحدث إلى الدعم","starting-chat":"جاري الاتصال...","hello-greeting":"مرحبًا! كيف يمكننا مساعدتك اليوم؟"},nl:{ok:"OK",yes:"Ja",no:"Nee",agree:"Akkoord",cancel:"Annuleren","yes-exit":"Ja, afsluiten","yes-reset":"Ja, resetten","no-cancel":"Nee, annuleren","are-you-sure":"Weet u het zeker?",recording:"Opname...","thank-you":"Dank u","sorry-try-again":"Sorry, probeer het opnieuw","error-occurred":"Er is een fout opgetreden","please-try-again":"Probeer het opnieuw","write-a-message":"Schrijf een bericht...","send-message":"Bericht verzenden",connected:"Verbonden",connecting:"Verbinding maken",reconnecting:"Opnieuw verbinding maken",reconnected:"Opnieuw verbonden",disconnecting:"Verbinding verbreken",disconnected:"Verbinding verbroken",error:"Fout","persist-session":"Sessie behouden",settings:"Instellingen",close:"Sluiten",help:"Help",chat:"Chat",send:"Verzenden",copy:"Kopiëren",copied:"Gekopieerd","sound-effects":"Geluidseffecten",language:"Taal",select:"Selecteren",agent:"Agent",user:"Gebruiker",bot:"Bot","reset-conversation-confirm":"Weet u zeker dat u het gesprek wilt resetten?","close-widget":"Widget sluiten","got-any-questions":"Heeft u vragen? Chat met ons!","typical-response-time":"We reageren doorgaans binnen 1 minuut","session-closed-lead":"Uw probleem is opgelost!","create-new-ticket":"Nieuw ticket aanmaken",exit:"Afsluiten","reset-conversation":"Gesprek resetten","welcome-title":"Welkom bij onze supportchat","welcome-description":"We zijn hier om te helpen! Begin een gesprek en we nemen zo snel mogelijk contact met u op.","your-name":"Uw naam","your-email":"Uw e-mailadres","start-chat":"Praat met ondersteuning","starting-chat":"Verbinding maken...","hello-greeting":"Hallo! Hoe kunnen we u vandaag helpen?"},fr:{ok:"D'accord",yes:"Oui",no:"Non",agree:"Accepter",cancel:"Annuler","yes-exit":"Oui, quitter","yes-reset":"Oui, réinitialiser","no-cancel":"Non, annuler","are-you-sure":"Êtes-vous sûr ?",recording:"Enregistrement...","thank-you":"Merci","sorry-try-again":"Désolé, veuillez réessayer","error-occurred":"Une erreur s'est produite","please-try-again":"Veuillez réessayer","write-a-message":"Écrivez un message...","send-message":"Envoyer le message",connected:"Connecté",connecting:"Connexion en cours",reconnecting:"Reconnexion en cours",reconnected:"Reconnecté",disconnecting:"Déconnexion en cours",disconnected:"Déconnecté",error:"Erreur","persist-session":"Conserver la session",settings:"Paramètres",close:"Fermer",help:"Aide",chat:"Chat",send:"Envoyer",copy:"Copier",copied:"Copié","sound-effects":"Effets sonores",language:"Langue",select:"Sélectionner",agent:"Agent",user:"Utilisateur",bot:"Bot","reset-conversation-confirm":"Êtes-vous sûr de vouloir réinitialiser la conversation ?","close-widget":"Fermer le widget","got-any-questions":"Vous avez des questions ? Chattez avec nous !","typical-response-time":"Nous répondons généralement en moins d'une minute","session-closed-lead":"Votre problème a été résolu !","create-new-ticket":"Créer un nouveau ticket",exit:"Sortie","reset-conversation":"Réinitialiser la conversation","welcome-title":"Bienvenue dans notre chat de support","welcome-description":"Nous sommes là pour vous aider ! Commencez une conversation et nous vous répondrons dès que possible.","your-name":"Votre nom","your-email":"Votre adresse e-mail","start-chat":"Parler au support","starting-chat":"Connexion...","hello-greeting":"Bonjour ! Comment pouvons-nous vous aider aujourd'hui ?"},de:{ok:"OK",yes:"Ja",no:"Nein",agree:"Zustimmen",cancel:"Stornieren","yes-exit":"Ja, beenden","yes-reset":"Ja, zurücksetzen","no-cancel":"Nein, abbrechen","are-you-sure":"Sind Sie sicher?",recording:"Aufnahme läuft","thank-you":"Vielen Dank","sorry-try-again":"Entschuldigung, bitte versuchen Sie es erneut","error-occurred":"Ein Fehler ist aufgetreten","please-try-again":"Bitte versuchen Sie es erneut","write-a-message":"Nachricht schreiben...","send-message":"Nachricht senden",connected:"Verbunden",connecting:"Verbindung wird hergestellt",reconnecting:"Verbindung wird wiederhergestellt",reconnected:"Wieder verbunden",disconnecting:"Verbindung wird getrennt",disconnected:"Verbindung getrennt",error:"Fehler","persist-session":"Sitzung beibehalten",settings:"Einstellungen",close:"Schließen",help:"Hilfe",chat:"Chat",send:"Senden",copy:"Kopieren",copied:"Kopiert","sound-effects":"Soundeffekte",language:"Sprache",select:"Auswählen",agent:"Agent",user:"Benutzer",bot:"Bot","got-any-questions":"Haben Sie Fragen? Chatten Sie mit uns!","typical-response-time":"Üblicherweise antworten wir in weniger als 1 Minute","reset-conversation-confirm":"Möchten Sie die Konversation wirklich zurücksetzen?","close-widget":"Widget schließen","session-closed-lead":"Ihr Problem wurde gelöst!","create-new-ticket":"Neues Ticket erstellen",exit:"Beenden","reset-conversation":"Konversation zurücksetzen","welcome-title":"Willkommen in unserem Support-Chat","welcome-description":"Wir sind hier, um zu helfen! Beginnen Sie ein Gespräch und wir werden so schnell wie möglich antworten.","your-name":"Ihr Name","your-email":"Ihre E-Mail-Adresse","start-chat":"Mit dem Support sprechen","starting-chat":"Verbindung wird hergestellt...","hello-greeting":"Hallo! Wie können wir Ihnen heute helfen?"},pt:{ok:"OK",yes:"Sim",no:"Não",agree:"Concordo",cancel:"Cancelar","yes-exit":"Sim, sair","yes-reset":"Sim, redefinir","no-cancel":"Não, cancelar","are-you-sure":"Você tem certeza?",recording:"Gravando...","thank-you":"Obrigado","sorry-try-again":"Desculpe, tente novamente","error-occurred":"Ocorreu um erro","please-try-again":"Por favor, tente novamente","write-a-message":"Escreva uma mensagem...","send-message":"Enviar mensagem",connected:"Conectado",connecting:"Conectando",reconnecting:"Reconectando",reconnected:"Reconectado",disconnecting:"Desconectando",disconnected:"Desconectado",error:"Erro","persist-session":"Persistir sessão",settings:"Configurações",close:"Fechar",help:"Ajuda",chat:"Bate-papo",send:"Enviar",copy:"Copiar",copied:"Copiado","sound-effects":"Efeitos sonoros",language:"Idioma",select:"Selecionar",agent:"Agente",user:"Usuário",bot:"Bot","reset-conversation-confirm":"Você tem certeza de que deseja redefinir a conversa?","close-widget":"Fechar widget","got-any-questions":"Tem alguma dúvida? Converse conosco!","typical-response-time":"Geralmente respondemos em menos de 1 minuto","session-closed-lead":"Seu problema foi resolvido!","create-new-ticket":"Criar novo ticket",exit:"Sair","reset-conversation":"Redefinir conversa","welcome-title":"Bem-vindo ao nosso chat de suporte","welcome-description":"Estamos aqui para ajudar! Inicie uma conversa e responderemos o mais rápido possível.","your-name":"Seu nome","your-email":"Seu endereço de email","start-chat":"Falar com o suporte","starting-chat":"Conectando...","hello-greeting":"Olá! Como podemos ajudar você hoje?"}},Ez=Object.keys(Pk),Tz=e=>Ez.includes(e);function _z(e,t){const n=Pk[t];return n&&n[e]||""}function Kf(){const{widgetCtx:{config:e}}=Qn();return y.useMemo(()=>{const n=Tz(e.language)?e.language:"en";return{get:r=>_z(r,n),lang:n}},[e.language])}const Sz=10,Cz={right:(e,t)=>({initial:{opacity:0,x:-e,...t.initial},animate:{opacity:1,x:0,...t.animate},exit:{opacity:0,x:e,...t.exit}}),left:(e,t)=>({initial:{opacity:0,x:e,...t.initial},animate:{opacity:1,x:0,...t.animate},exit:{opacity:0,x:-e,...t.exit}}),up:(e,t)=>({initial:{opacity:0,y:e,...t.initial},animate:{opacity:1,y:0,...t.animate},exit:{opacity:0,y:-e,...t.exit}}),down:(e,t)=>({initial:{opacity:0,y:-e,...t.initial},animate:{opacity:1,y:0,...t.animate},exit:{opacity:0,y:e,...t.exit}})},xi=y.forwardRef(({fadeIn:e="down",distance:t=Sz,children:n,snapExit:r=!1,overrides:i={},...a},o)=>{const s=e?Cz[e](t,i):{};return r&&s.exit&&typeof s.exit=="object"&&!Array.isArray(s.exit)&&(s.exit.transition={duration:0}),T.jsx(Ua.div,{ref:o,...a,...s,children:n})});xi.displayName="MotionDiv";function Ik(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Ik(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function kz(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Ik(e))&&(r&&(r+=" "),r+=t);return r}const Ok=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Dk=kz,Az=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Dk(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(u=>{const c=n==null?void 0:n[u],d=a==null?void 0:a[u];if(c===null)return null;const f=Ok(c)||Ok(d);return i[u][f]}),s=n&&Object.entries(n).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:f,...p}=c;return Object.entries(p).every(m=>{let[g,x]=m;return Array.isArray(x)?x.includes({...a,...s}[g]):{...a,...s}[g]===x})?[...u,d,f]:u},[]);return Dk(e,o,l,n==null?void 0:n.class,n==null?void 0:n.className)},Lk={x:2,y:2},Rz={1:"scale-[1]","1.01":"scale-[1.01]","1.02":"scale-[1.02]","1.1":"scale-[1.1]"},Xf=y.memo(y.forwardRef(({children:e,className:t,scale:n="1.02",off:r=!1},i)=>{const[a,o]=y.useState(!1),[s,l]=y.useState({x:0,y:0});if(r||/translate/.test(e.props.className||""))return e;const c=m=>{var D,V;const{clientX:g,clientY:x}=m,w=m.currentTarget.getBoundingClientRect(),v=g-(w.left+w.width/2),b=x-(w.top+w.height/2),E=Math.max(-1,Math.min(1,v/(w.width/2))),_=Math.max(-1,Math.min(1,b/(w.height/2))),S=E*Lk.x,I=_*Lk.y;l({x:S,y:I}),(V=(D=e.props).onMouseMove)==null||V.call(D,m)},d=()=>{var m,g;o(!0),(g=(m=e.props).onMouseEnter)==null||g.call(m)},f=()=>{var m,g;o(!1),l({x:0,y:0}),(g=(m=e.props).onMouseLeave)==null||g.call(m)},p={"--opencx-wobble-x":a?`${s.x}px`:"0px","--opencx-wobble-y":a?`${s.y}px`:"0px"};return y.cloneElement(e,{ref:i,onMouseMove:c,onMouseEnter:d,onMouseLeave:f,style:{...p,...e.props.style},className:Me("translate-x-[var(--opencx-wobble-x)]","translate-y-[var(--opencx-wobble-y)]",`hover:${Rz[n]}`,t,e.props.className,"transition-all ease-out")})}));Xf.displayName="Wobble";const Nz=Az(Me("inline-flex shrink-0 items-center justify-center gap-2","text-sm font-medium whitespace-nowrap","ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50","shadow-sm active:shadow-none active:scale-95 hover:active:scale-95","rounded-xl","border","transition"),{variants:{variant:{default:"border-primary bg-primary text-primary-foreground",destructive:"border-destructive bg-destructive text-destructive-foreground",outline:"bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground",ghost:"border-transparent shadow-none hover:bg-accent hover:text-accent-foreground",link:"border-transparent shadow-none text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-8 px-3 text-xs",lg:"h-11 px-8",icon:"h-10 w-10",fit:"size-fit p-2"}},defaultVariants:{variant:"default",size:"default"}}),pa=y.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>{const o=r?If:"button";return T.jsx(Xf,{ref:a,children:T.jsx(o,{className:Me(Nz({variant:t,size:n,className:e})),...i})})});pa.displayName="Button";function Pz({file:{status:e,file:t,error:n},onCancel:r}){const[i,a]=y.useState(null);y.useEffect(()=>{if(!t.type.startsWith("image/"))return;const l=new FileReader;return l.onload=()=>a(l.result),l.onerror=()=>console.error("Error reading file"),l.readAsDataURL(t),()=>l.abort()},[t]);const o=()=>{switch(e){case"uploading":return T.jsx(PL,{className:"size-4 animate-spin"});case"error":return T.jsx(SL,{className:"size-4 text-destructive"});default:return null}},s=()=>{const l=t.type.split("/")[0];return l==="image"&&i?T.jsx("img",{src:typeof i=="string"?i:"",className:"object-cover bg-secondary size-full",alt:t.name}):l==="audio"?T.jsx(RL,{}):T.jsx(NL,{})};return T.jsx(qw,{side:"bottom",content:e==="error"?T.jsxs("span",{className:"text-destructive",children:["Failed to upload: ",n]}):t.name,children:T.jsxs("div",{"data-test":"file-display",className:Me(e==="uploading"&&"opacity-50","group","size-12 border rounded-2xl overflow-hidden relative","flex items-center justify-center shrink-0"),children:[T.jsx("div",{className:"absolute inset-0 flex items-center justify-center","data-test":"file-status",children:o()}),T.jsx("button",{"data-test":"file-cancel-button",className:Me("absolute bg-black/50 inset-0 size-full z-10 opacity-0","flex items-center justify-center","opacity-0 group-hover:opacity-100 transition"),onClick:r,children:T.jsx(oE,{className:"size-4 text-primary-foreground"})}),T.jsx(s,{})]})})}const Mk=Me("rounded-3xl");function Iz(){var E;const e=y.useRef(null),{messageCtx:t}=hd(),{sessionState:n}=md(),r=Kf(),[i,a]=y.useState(""),{allFiles:o,emptyTheFiles:s,handleCancelUpload:l,appendFiles:u,isUploading:c,successFiles:d}=Z9(),f=!!((E=n.session)!=null&&E.isHandedOff),{isAwaitingBotReply:p}=JT(),m=_=>{f&&u(_)},g=async()=>{if(p)return;if(c){const S="please wait for the file(s) to upload";oT.error(S),console.info(S)}const _=i.trim();_&&(a(""),s(),await t.sendMessage({content:_,attachments:d.map(S=>({url:S.fileUrl,type:S.file.type,name:S.file.name,id:S.id,size:S.file.size}))}))},{getRootProps:x,getInputProps:w,open:v}=eT({onDrop:m,noClick:!0,onDropRejected(){if(f){const _="unsupported file type, or the file is too large";oT.error(_),console.error(_)}},maxSize:5*1024*1024,accept:{"text/*":[".txt"],"image/*":[".png",".jpg",".jpeg",".gif"],"application/pdf":[".pdf"]}}),b=_=>{const S=_.clipboardData;S&&S.files.length>0&&m(Array.from(S.files))};return T.jsxs("div",{className:"p-2 relative space-y-1",...x(),"data-test":"chat-input-container",children:[T.jsx("input",{...w()}),T.jsxs("div",{className:Me(Mk,"relative space-y-2 border transition-all shadow py-2"),"data-test":"chat-input-wrapper",children:[T.jsx("div",{className:"flex items-center gap-1 px-2","data-test":"file-attachments-container",children:T.jsx(fl,{mode:"popLayout",children:o.map(_=>T.jsx(xi,{snapExit:!0,children:T.jsx(Pz,{onCancel:()=>l(_.id),file:_})},_.id))})}),T.jsx("textarea",{onPaste:b,ref:e,id:"chat-input",dir:"auto",value:i,rows:3,"data-test":"chat-message-input",className:Me(Mk,"w-full px-3","resize-none","bg-transparent outline-none","text-sm"),onChange:_=>a(_.target.value),onKeyDown:async _=>{_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),g())},placeholder:r.get("write-a-message")}),T.jsxs("div",{className:"px-2 flex justify-between","data-test":"chat-input-actions",children:[T.jsx(qw,{side:"top",align:"start",content:"attach files, (maximum size 5mb)",children:T.jsx(pa,{onClick:()=>{f&&v()},size:"fit",variant:"outline","data-test":"attach-file-button",className:Me("disabled:opacity-0","rounded-full size-8 flex items-center justify-center p-0"),disabled:!f,children:T.jsx(IL,{className:"size-4"})})}),T.jsx(qw,{content:"send message",side:"top",align:"end",children:T.jsx(pa,{size:"fit",onClick:g,disabled:p||c,"data-test":"send-message-button",className:"rounded-full size-8 flex items-center justify-center p-0",children:p?T.jsx(CL,{className:"size-4 animate-spin animate-iteration-infinite","data-test":"sending-message-indicator"}):T.jsx(aE,{className:"size-4 rtl:-scale-100"})})})]})]})]})}function Oz(){const{widgetCtx:e}=Qn(),t=Kf();return T.jsx("div",{className:"p-2","data-test":"session-closed-container",children:T.jsxs("div",{className:"p-2 bg-background rounded-3xl border shadow-2xl space-y-2","data-test":"session-closed-content",children:[T.jsxs("div",{className:"flex items-center gap-1","data-test":"session-closed-header",children:[T.jsx(EL,{className:"size-4 text-emerald-500"}),T.jsx("h2",{className:"text-sm font-medium",dir:"auto",children:t.get("session-closed-lead")})]}),T.jsx("div",{children:T.jsx(pa,{onClick:e.resetChat,className:"rounded-2xl w-full","data-test":"create-new-ticket-button",children:t.get("create-new-ticket")})})]})})}function Dz(){var t;const{sessionState:e}=md();return T.jsx("div",{children:T.jsx(fl,{mode:"wait",children:e.session&&!((t=e.session)!=null&&t.isOpened)?T.jsx(xi,{className:"overflow-hidden",overrides:{initial:{height:0},animate:{height:"auto"},exit:{height:0}},children:T.jsx(Oz,{})},"session-closed"):T.jsx(xi,{className:"overflow-hidden",overrides:{initial:{height:0},animate:{height:"auto"},exit:{height:0}},children:T.jsx(Iz,{})},"chat-input")})})}function Fe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Fk(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Qf(...e){return t=>{let n=!1;const r=e.map(i=>{const a=Fk(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():Fk(e[i],null)}}}}function Sn(...e){return y.useCallback(Qf(...e),e)}var yu=y.forwardRef((e,t)=>{const{children:n,...r}=e,i=y.Children.toArray(n),a=i.find(Mz);if(a){const o=a.props.children,s=i.map(l=>l===a?y.Children.count(o)>1?y.Children.only(null):y.isValidElement(o)?o.props.children:null:l);return T.jsx(Gw,{...r,ref:t,children:y.isValidElement(o)?y.cloneElement(o,void 0,s):null})}return T.jsx(Gw,{...r,ref:t,children:n})});yu.displayName="Slot";var Gw=y.forwardRef((e,t)=>{const{children:n,...r}=e;if(y.isValidElement(n)){const i=Bz(n);return y.cloneElement(n,{...Fz(r,n.props),ref:t?Qf(t,i):i})}return y.Children.count(n)>1?y.Children.only(null):null});Gw.displayName="SlotClone";var Lz=({children:e})=>T.jsx(T.Fragment,{children:e});function Mz(e){return y.isValidElement(e)&&e.type===Lz}function Fz(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...s)=>{a(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function Bz(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var jz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Cn=jz.reduce((e,t)=>{const n=y.forwardRef((r,i)=>{const{asChild:a,...o}=r,s=a?yu:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),T.jsx(s,{...o,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Bk(e,t){e&&hs.flushSync(()=>e.dispatchEvent(t))}function jk(e){const t=e+"CollectionProvider",[n,r]=Ui(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:m,children:g}=p,x=mn.useRef(null),w=mn.useRef(new Map).current;return T.jsx(i,{scope:m,itemMap:w,collectionRef:x,children:g})};o.displayName=t;const s=e+"CollectionSlot",l=mn.forwardRef((p,m)=>{const{scope:g,children:x}=p,w=a(s,g),v=Sn(m,w.collectionRef);return T.jsx(yu,{ref:v,children:x})});l.displayName=s;const u=e+"CollectionItemSlot",c="data-radix-collection-item",d=mn.forwardRef((p,m)=>{const{scope:g,children:x,...w}=p,v=mn.useRef(null),b=Sn(m,v),E=a(u,g);return mn.useEffect(()=>(E.itemMap.set(v,{ref:v,...w}),()=>void E.itemMap.delete(v))),T.jsx(yu,{[c]:"",ref:b,children:x})});d.displayName=u;function f(p){const m=a(e+"CollectionConsumer",p);return mn.useCallback(()=>{const x=m.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${c}]`));return Array.from(m.itemMap.values()).sort((E,_)=>w.indexOf(E.ref.current)-w.indexOf(_.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:o,Slot:l,ItemSlot:d},f,r]}var Uz=y.createContext(void 0);function Uk(e){const t=y.useContext(Uz);return e||t||"ltr"}var zz="DismissableLayer",Kw="dismissableLayer.update",Hz="dismissableLayer.pointerDownOutside",Vz="dismissableLayer.focusOutside",zk,Hk=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Vk=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...l}=e,u=y.useContext(Hk),[c,d]=y.useState(null),f=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=y.useState({}),m=Sn(t,I=>d(I)),g=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),w=g.indexOf(x),v=c?g.indexOf(c):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,E=v>=w,_=Yz(I=>{const D=I.target,V=[...u.branches].some(N=>N.contains(D));!E||V||(i==null||i(I),o==null||o(I),I.defaultPrevented||s==null||s())},f),S=qz(I=>{const D=I.target;[...u.branches].some(N=>N.contains(D))||(a==null||a(I),o==null||o(I),I.defaultPrevented||s==null||s())},f);return TC(I=>{v===u.layers.size-1&&(r==null||r(I),!I.defaultPrevented&&s&&(I.preventDefault(),s()))},f),y.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(zk=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),$k(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=zk)}},[c,f,n,u]),y.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),$k())},[c,u]),y.useEffect(()=>{const I=()=>p({});return document.addEventListener(Kw,I),()=>document.removeEventListener(Kw,I)},[]),T.jsx(Cn.div,{...l,ref:m,style:{pointerEvents:b?E?"auto":"none":void 0,...e.style},onFocusCapture:Fe(e.onFocusCapture,S.onFocusCapture),onBlurCapture:Fe(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:Fe(e.onPointerDownCapture,_.onPointerDownCapture)})});Vk.displayName=zz;var $z="DismissableLayerBranch",Wz=y.forwardRef((e,t)=>{const n=y.useContext(Hk),r=y.useRef(null),i=Sn(t,r);return y.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),T.jsx(Cn.div,{...e,ref:i})});Wz.displayName=$z;function Yz(e,t=globalThis==null?void 0:globalThis.document){const n=Wt(e),r=y.useRef(!1),i=y.useRef(()=>{});return y.useEffect(()=>{const a=s=>{if(s.target&&!r.current){let l=function(){Wk(Hz,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function qz(e,t=globalThis==null?void 0:globalThis.document){const n=Wt(e),r=y.useRef(!1);return y.useEffect(()=>{const i=a=>{a.target&&!r.current&&Wk(Vz,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function $k(){const e=new CustomEvent(Kw);document.dispatchEvent(e)}function Wk(e,t,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Bk(i,a):i.dispatchEvent(a)}var Xw=0;function Yk(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??qk()),document.body.insertAdjacentElement("beforeend",e[1]??qk()),Xw++,()=>{Xw===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Xw--}},[])}function qk(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Qw="focusScope.autoFocusOnMount",Zw="focusScope.autoFocusOnUnmount",Gk={bubbles:!1,cancelable:!0},Gz="FocusScope",Kk=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,l]=y.useState(null),u=Wt(i),c=Wt(a),d=y.useRef(null),f=Sn(t,g=>l(g)),p=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let g=function(b){if(p.paused||!s)return;const E=b.target;s.contains(E)?d.current=E:ha(d.current,{select:!0})},x=function(b){if(p.paused||!s)return;const E=b.relatedTarget;E!==null&&(s.contains(E)||ha(d.current,{select:!0}))},w=function(b){if(document.activeElement===document.body)for(const _ of b)_.removedNodes.length>0&&ha(s)};document.addEventListener("focusin",g),document.addEventListener("focusout",x);const v=new MutationObserver(w);return s&&v.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",x),v.disconnect()}}},[r,s,p.paused]),y.useEffect(()=>{if(s){Zk.add(p);const g=document.activeElement;if(!s.contains(g)){const w=new CustomEvent(Qw,Gk);s.addEventListener(Qw,u),s.dispatchEvent(w),w.defaultPrevented||(Kz(eH(Xk(s)),{select:!0}),document.activeElement===g&&ha(s))}return()=>{s.removeEventListener(Qw,u),setTimeout(()=>{const w=new CustomEvent(Zw,Gk);s.addEventListener(Zw,c),s.dispatchEvent(w),w.defaultPrevented||ha(g??document.body,{select:!0}),s.removeEventListener(Zw,c),Zk.remove(p)},0)}}},[s,u,c,p]);const m=y.useCallback(g=>{if(!n&&!r||p.paused)return;const x=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,w=document.activeElement;if(x&&w){const v=g.currentTarget,[b,E]=Xz(v);b&&E?!g.shiftKey&&w===E?(g.preventDefault(),n&&ha(b,{select:!0})):g.shiftKey&&w===b&&(g.preventDefault(),n&&ha(E,{select:!0})):w===v&&g.preventDefault()}},[n,r,p.paused]);return T.jsx(Cn.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});Kk.displayName=Gz;function Kz(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ha(r,{select:t}),document.activeElement!==n)return}function Xz(e){const t=Xk(e),n=Qk(t,e),r=Qk(t.reverse(),e);return[n,r]}function Xk(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Qk(e,t){for(const n of e)if(!Qz(n,{upTo:t}))return n}function Qz(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Zz(e){return e instanceof HTMLInputElement&&"select"in e}function ha(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Zz(e)&&t&&e.select()}}var Zk=Jz();function Jz(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Jk(e,t),e.unshift(t)},remove(t){var n;e=Jk(e,t),(n=e[0])==null||n.resume()}}}function Jk(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function eH(e){return e.filter(t=>t.tagName!=="A")}var tH="Arrow",eA=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...a}=e;return T.jsx(Cn.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:T.jsx("polygon",{points:"0,0 30,0 15,10"})})});eA.displayName=tH;var nH=eA,Jw="Popper",[tA,nA]=Ui(Jw),[rH,rA]=tA(Jw),iA=e=>{const{__scopePopper:t,children:n}=e,[r,i]=y.useState(null);return T.jsx(rH,{scope:t,anchor:r,onAnchorChange:i,children:n})};iA.displayName=Jw;var aA="PopperAnchor",oA=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,a=rA(aA,n),o=y.useRef(null),s=Sn(t,o);return y.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:T.jsx(Cn.div,{...i,ref:s})});oA.displayName=aA;var e1="PopperContent",[iH,aH]=tA(e1),sA=y.forwardRef((e,t)=>{var $e,Ve,We,Ge,St,Te;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:o=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:m,...g}=e,x=rA(e1,n),[w,v]=y.useState(null),b=Sn(t,xe=>v(xe)),[E,_]=y.useState(null),S=ek(E),I=(S==null?void 0:S.width)??0,D=(S==null?void 0:S.height)??0,V=r+(a!=="center"?"-"+a:""),N=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},$=Array.isArray(u)?u:[u],z=$.length>0,X={padding:N,boundary:$.filter(sH),altBoundary:z},{refs:Y,floatingStyles:ne,placement:re,isPositioned:ee,middlewareData:F}=WC({strategy:"fixed",placement:V,whileElementsMounted:(...xe)=>zC(...xe,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[YC({mainAxis:i+D,alignmentAxis:o}),l&&qC({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?GC():void 0,...X}),l&&KC({...X}),XC({...X,apply:({elements:xe,rects:Ye,availableWidth:ze,availableHeight:vt})=>{const{width:bt,height:Ke}=Ye.reference,Le=xe.floating.style;Le.setProperty("--radix-popper-available-width",`${ze}px`),Le.setProperty("--radix-popper-available-height",`${vt}px`),Le.setProperty("--radix-popper-anchor-width",`${bt}px`),Le.setProperty("--radix-popper-anchor-height",`${Ke}px`)}}),E&&ZC({element:E,padding:s}),lH({arrowWidth:I,arrowHeight:D}),f&&QC({strategy:"referenceHidden",...X})]}),[B,k]=cA(re),ie=Wt(m);ir(()=>{ee&&(ie==null||ie())},[ee,ie]);const he=($e=F.arrow)==null?void 0:$e.x,O=(Ve=F.arrow)==null?void 0:Ve.y,Pe=((We=F.arrow)==null?void 0:We.centerOffset)!==0,[ge,ve]=y.useState();return ir(()=>{w&&ve(window.getComputedStyle(w).zIndex)},[w]),T.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...ne,transform:ee?ne.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[(Ge=F.transformOrigin)==null?void 0:Ge.x,(St=F.transformOrigin)==null?void 0:St.y].join(" "),...((Te=F.hide)==null?void 0:Te.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:T.jsx(iH,{scope:n,placedSide:B,onArrowChange:_,arrowX:he,arrowY:O,shouldHideArrow:Pe,children:T.jsx(Cn.div,{"data-side":B,"data-align":k,...g,ref:b,style:{...g.style,animation:ee?void 0:"none"}})})})});sA.displayName=e1;var lA="PopperArrow",oH={top:"bottom",right:"left",bottom:"top",left:"right"},uA=y.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,a=aH(lA,r),o=oH[a.placedSide];return T.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:T.jsx(nH,{...i,ref:n,style:{...i.style,display:"block"}})})});uA.displayName=lA;function sH(e){return e!==null}var lH=e=>({name:"transformOrigin",options:e,fn(t){var x,w,v;const{placement:n,rects:r,middlewareData:i}=t,o=((x=i.arrow)==null?void 0:x.centerOffset)!==0,s=o?0:e.arrowWidth,l=o?0:e.arrowHeight,[u,c]=cA(n),d={start:"0%",center:"50%",end:"100%"}[c],f=(((w=i.arrow)==null?void 0:w.x)??0)+s/2,p=(((v=i.arrow)==null?void 0:v.y)??0)+l/2;let m="",g="";return u==="bottom"?(m=o?d:`${f}px`,g=`${-l}px`):u==="top"?(m=o?d:`${f}px`,g=`${r.floating.height+l}px`):u==="right"?(m=`${-l}px`,g=o?d:`${p}px`):u==="left"&&(m=`${r.floating.width+l}px`,g=o?d:`${p}px`),{data:{x:m,y:g}}}});function cA(e){const[t,n="center"]=e.split("-");return[t,n]}var uH=iA,cH=oA,dH=sA,fH=uA;function pH(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var Zf=e=>{const{present:t,children:n}=e,r=hH(t),i=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),a=Sn(r.ref,mH(i));return typeof n=="function"||r.isPresent?y.cloneElement(i,{ref:a}):null};Zf.displayName="Presence";function hH(e){const[t,n]=y.useState(),r=y.useRef({}),i=y.useRef(e),a=y.useRef("none"),o=e?"mounted":"unmounted",[s,l]=pH(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const u=Jf(r.current);a.current=s==="mounted"?u:"none"},[s]),ir(()=>{const u=r.current,c=i.current;if(c!==e){const f=a.current,p=Jf(u);e?l("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),ir(()=>{if(t){let u;const c=t.ownerDocument.defaultView??window,d=p=>{const g=Jf(r.current).includes(p.animationName);if(p.target===t&&g&&(l("ANIMATION_END"),!i.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},f=p=>{p.target===t&&(a.current=Jf(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{c.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:y.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Jf(e){return(e==null?void 0:e.animationName)||"none"}function mH(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var t1="rovingFocusGroup.onEntryFocus",gH={bubbles:!1,cancelable:!0},ep="RovingFocusGroup",[n1,dA,wH]=jk(ep),[yH,fA]=Ui(ep,[wH]),[vH,bH]=yH(ep),pA=y.forwardRef((e,t)=>T.jsx(n1.Provider,{scope:e.__scopeRovingFocusGroup,children:T.jsx(n1.Slot,{scope:e.__scopeRovingFocusGroup,children:T.jsx(xH,{...e,ref:t})})}));pA.displayName=ep;var xH=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...d}=e,f=y.useRef(null),p=Sn(t,f),m=Uk(a),[g=null,x]=$f({prop:o,defaultProp:s,onChange:l}),[w,v]=y.useState(!1),b=Wt(u),E=dA(n),_=y.useRef(!1),[S,I]=y.useState(0);return y.useEffect(()=>{const D=f.current;if(D)return D.addEventListener(t1,b),()=>D.removeEventListener(t1,b)},[b]),T.jsx(vH,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:g,onItemFocus:y.useCallback(D=>x(D),[x]),onItemShiftTab:y.useCallback(()=>v(!0),[]),onFocusableItemAdd:y.useCallback(()=>I(D=>D+1),[]),onFocusableItemRemove:y.useCallback(()=>I(D=>D-1),[]),children:T.jsx(Cn.div,{tabIndex:w||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:Fe(e.onMouseDown,()=>{_.current=!0}),onFocus:Fe(e.onFocus,D=>{const V=!_.current;if(D.target===D.currentTarget&&V&&!w){const N=new CustomEvent(t1,gH);if(D.currentTarget.dispatchEvent(N),!N.defaultPrevented){const $=E().filter(re=>re.focusable),z=$.find(re=>re.active),X=$.find(re=>re.id===g),ne=[z,X,...$].filter(Boolean).map(re=>re.ref.current);gA(ne,c)}}_.current=!1}),onBlur:Fe(e.onBlur,()=>v(!1))})})}),hA="RovingFocusGroupItem",mA=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,...o}=e,s=fu(),l=a||s,u=bH(hA,n),c=u.currentTabStopId===l,d=dA(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=u;return y.useEffect(()=>{if(r)return f(),()=>p()},[r,f,p]),T.jsx(n1.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:T.jsx(Cn.span,{tabIndex:c?0:-1,"data-orientation":u.orientation,...o,ref:t,onMouseDown:Fe(e.onMouseDown,m=>{r?u.onItemFocus(l):m.preventDefault()}),onFocus:Fe(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Fe(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){u.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const g=_H(m,u.orientation,u.dir);if(g!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let w=d().filter(v=>v.focusable).map(v=>v.ref.current);if(g==="last")w.reverse();else if(g==="prev"||g==="next"){g==="prev"&&w.reverse();const v=w.indexOf(m.currentTarget);w=u.loop?SH(w,v+1):w.slice(v+1)}setTimeout(()=>gA(w))}})})})});mA.displayName=hA;var EH={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function TH(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function _H(e,t,n){const r=TH(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return EH[r]}function gA(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function SH(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var CH=pA,kH=mA,AH=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Es=new WeakMap,tp=new WeakMap,np={},r1=0,wA=function(e){return e&&(e.host||wA(e.parentNode))},RH=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=wA(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},NH=function(e,t,n,r){var i=RH(t,Array.isArray(e)?e:[e]);np[n]||(np[n]=new WeakMap);var a=np[n],o=[],s=new Set,l=new Set(i),u=function(d){!d||s.has(d)||(s.add(d),u(d.parentNode))};i.forEach(u);var c=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(s.has(f))c(f);else try{var p=f.getAttribute(r),m=p!==null&&p!=="false",g=(Es.get(f)||0)+1,x=(a.get(f)||0)+1;Es.set(f,g),a.set(f,x),o.push(f),g===1&&m&&tp.set(f,!0),x===1&&f.setAttribute(n,"true"),m||f.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",f,w)}})};return c(t),s.clear(),r1++,function(){o.forEach(function(d){var f=Es.get(d)-1,p=a.get(d)-1;Es.set(d,f),a.set(d,p),f||(tp.has(d)||d.removeAttribute(r),tp.delete(d)),p||d.removeAttribute(n)}),r1--,r1||(Es=new WeakMap,Es=new WeakMap,tp=new WeakMap,np={})}},yA=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=AH(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),NH(r,i,n,"aria-hidden")):function(){return null}},rp="right-scroll-bar-position",ip="width-before-scroll-bar",PH="with-scroll-bars-hidden",IH="--removed-body-scroll-bar-size";function i1(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function OH(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var DH=typeof window<"u"?y.useLayoutEffect:y.useEffect,vA=new WeakMap;function LH(e,t){var n=OH(null,function(r){return e.forEach(function(i){return i1(i,r)})});return DH(function(){var r=vA.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;i.forEach(function(s){a.has(s)||i1(s,null)}),a.forEach(function(s){i.has(s)||i1(s,o)})}vA.set(n,e)},[e]),n}function MH(e){return e}function FH(e,t){t===void 0&&(t=MH);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var o=t(a,r);return n.push(o),function(){n=n.filter(function(s){return s!==o})}},assignSyncMedium:function(a){for(r=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(s){return a(s)},filter:function(){return n}}},assignMedium:function(a){r=!0;var o=[];if(n.length){var s=n;n=[],s.forEach(a),o=n}var l=function(){var c=o;o=[],c.forEach(a)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(c){o.push(c),u()},filter:function(c){return o=o.filter(c),n}}}};return i}function bA(e){e===void 0&&(e={});var t=FH(null);return t.options=Ot({async:!0,ssr:!1},e),t}var xA=function(e){var t=e.sideCar,n=pl(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return y.createElement(r,Ot({},n))};xA.isSideCarExport=!0;function EA(e,t){return e.useMedium(t),xA}var TA=bA(),a1=function(){},ap=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:a1,onWheelCapture:a1,onTouchMoveCapture:a1}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,c=e.enabled,d=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,g=e.allowPinchZoom,x=e.as,w=x===void 0?"div":x,v=e.gapMode,b=pl(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=f,_=LH([n,t]),S=Ot(Ot({},b),i);return y.createElement(y.Fragment,null,c&&y.createElement(E,{sideCar:TA,removeScrollBar:u,shards:d,noIsolation:p,inert:m,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:v}),o?y.cloneElement(y.Children.only(s),Ot(Ot({},S),{ref:_})):y.createElement(w,Ot({},S,{className:l,ref:_}),s))});ap.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ap.classNames={fullWidth:ip,zeroRight:rp};var _A=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function BH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=_A();return t&&e.setAttribute("nonce",t),e}function jH(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function UH(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var zH=function(){var e=0,t=null;return{add:function(n){e==0&&(t=BH())&&(jH(t,n),UH(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},HH=function(){var e=zH();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},VH=function(){var e=HH(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},$H={left:0,top:0,right:0,gap:0},o1=function(e){return parseInt(e||"",10)||0},WH=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[o1(n),o1(r),o1(i)]},YH=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return $H;var t=WH(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},qH=VH(),Ts="data-scroll-locked",GH=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n="margin"),`
|
|
332
332
|
.`.concat(PH,` {
|
|
333
333
|
overflow: hidden `).concat(r,`;
|
|
334
334
|
padding-right: `).concat(s,"px ").concat(r,`;
|
|
@@ -368,7 +368,7 @@ Error generating stack: `+a.message+`
|
|
|
368
368
|
`)},SA=function(){var e=parseInt(document.body.getAttribute(Ts)||"0",10);return isFinite(e)?e:0},KH=function(){y.useEffect(function(){return document.body.setAttribute(Ts,(SA()+1).toString()),function(){var e=SA()-1;e<=0?document.body.removeAttribute(Ts):document.body.setAttribute(Ts,e.toString())}},[])},XH=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;KH();var a=y.useMemo(function(){return YH(i)},[i]);return y.createElement(qH,{styles:GH(a,!t,i,n?"":"!important")})};function QH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=_A();return t&&e.setAttribute("nonce",t),e}function ZH(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function JH(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var eV=function(){var e=0,t=null;return{add:function(n){e==0&&(t=QH())&&(ZH(t,n),JH(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},tV=function(){var e=eV();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},s1=function(){var e=tV(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},l1=!1;if(typeof window<"u")try{var op=Object.defineProperty({},"passive",{get:function(){return l1=!0,!0}});window.addEventListener("test",op,op),window.removeEventListener("test",op,op)}catch{l1=!1}var _s=l1?{passive:!1}:!1,nV=function(e){return e.tagName==="TEXTAREA"},CA=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!nV(e)&&n[t]==="visible")},rV=function(e){return CA(e,"overflowY")},iV=function(e){return CA(e,"overflowX")},kA=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=AA(e,r);if(i){var a=RA(e,r),o=a[1],s=a[2];if(o>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},aV=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},oV=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},AA=function(e,t){return e==="v"?rV(t):iV(t)},RA=function(e,t){return e==="v"?aV(t):oV(t)},sV=function(e,t){return e==="h"&&t==="rtl"?-1:1},lV=function(e,t,n,r,i){var a=sV(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,l=t.contains(s),u=!1,c=o>0,d=0,f=0;do{var p=RA(e,s),m=p[0],g=p[1],x=p[2],w=g-x-a*m;(m||w)&&AA(e,s)&&(d+=w,f+=m),s instanceof ShadowRoot?s=s.host:s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(c&&(Math.abs(d)<1||!i)||!c&&(Math.abs(f)<1||!i))&&(u=!0),u},sp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},NA=function(e){return[e.deltaX,e.deltaY]},PA=function(e){return e&&"current"in e?e.current:e},uV=function(e,t){return e[0]===t[0]&&e[1]===t[1]},cV=function(e){return`
|
|
369
369
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
370
370
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
371
|
-
`)},dV=0,Ss=[];function fV(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),i=y.useState(dV++)[0],a=y.useState(s1)[0],o=y.useRef(e);y.useEffect(function(){o.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var g=Wc([e.lockRef.current],(e.shards||[]).map(PA),!0).filter(Boolean);return g.forEach(function(x){return x.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),g.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=y.useCallback(function(g,x){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!o.current.allowPinchZoom;var w=sp(g),v=n.current,b="deltaX"in g?g.deltaX:v[0]-w[0],E="deltaY"in g?g.deltaY:v[1]-w[1],_,S=g.target,I=Math.abs(b)>Math.abs(E)?"h":"v";if("touches"in g&&I==="h"&&S.type==="range")return!1;var D=kA(I,S);if(!D)return!0;if(D?_=I:(_=I==="v"?"h":"v",D=kA(I,S)),!D)return!1;if(!r.current&&"changedTouches"in g&&(b||E)&&(r.current=_),!_)return!0;var V=r.current||_;return lV(V,x,g,V==="h"?b:E,!0)},[]),l=y.useCallback(function(g){var x=g;if(!(!Ss.length||Ss[Ss.length-1]!==a)){var w="deltaY"in x?NA(x):sp(x),v=t.current.filter(function(_){return _.name===x.type&&(_.target===x.target||x.target===_.shadowParent)&&uV(_.delta,w)})[0];if(v&&v.should){x.cancelable&&x.preventDefault();return}if(!v){var b=(o.current.shards||[]).map(PA).filter(Boolean).filter(function(_){return _.contains(x.target)}),E=b.length>0?s(x,b[0]):!o.current.noIsolation;E&&x.cancelable&&x.preventDefault()}}},[]),u=y.useCallback(function(g,x,w,v){var b={name:g,delta:x,target:w,should:v,shadowParent:pV(w)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(E){return E!==b})},1)},[]),c=y.useCallback(function(g){n.current=sp(g),r.current=void 0},[]),d=y.useCallback(function(g){u(g.type,NA(g),g.target,s(g,e.lockRef.current))},[]),f=y.useCallback(function(g){u(g.type,sp(g),g.target,s(g,e.lockRef.current))},[]);y.useEffect(function(){return Ss.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,_s),document.addEventListener("touchmove",l,_s),document.addEventListener("touchstart",c,_s),function(){Ss=Ss.filter(function(g){return g!==a}),document.removeEventListener("wheel",l,_s),document.removeEventListener("touchmove",l,_s),document.removeEventListener("touchstart",c,_s)}},[]);var p=e.removeScrollBar,m=e.inert;return y.createElement(y.Fragment,null,m?y.createElement(a,{styles:cV(i)}):null,p?y.createElement(XH,{gapMode:e.gapMode}):null)}function pV(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const hV=EA(TA,fV);var IA=y.forwardRef(function(e,t){return y.createElement(ap,Ot({},e,{ref:t,sideCar:hV}))});IA.classNames=ap.classNames;var u1=["Enter"," "],mV=["ArrowDown","PageUp","Home"],OA=["ArrowUp","PageDown","End"],gV=[...mV,...OA],wV={ltr:[...u1,"ArrowRight"],rtl:[...u1,"ArrowLeft"]},yV={ltr:["ArrowLeft"],rtl:["ArrowRight"]},vu="Menu",[bu,vV,bV]=jk(vu),[oo,DA]=Ui(vu,[bV,nA,fA]),lp=nA(),LA=fA(),[xV,Cs]=oo(vu),[EV,xu]=oo(vu),MA=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=lp(t),[l,u]=y.useState(null),c=y.useRef(!1),d=Wt(a),f=Uk(i);return y.useEffect(()=>{const p=()=>{c.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>c.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),T.jsx(uH,{...s,children:T.jsx(xV,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:u,children:T.jsx(EV,{scope:t,onClose:y.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:c,dir:f,modal:o,children:r})})})};MA.displayName=vu;var TV="MenuAnchor",c1=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=lp(n);return T.jsx(cH,{...i,...r,ref:t})});c1.displayName=TV;var _V="MenuPortal",[Uie,FA]=oo(_V,{forceMount:void 0}),ar="MenuContent",[SV,d1]=oo(ar),BA=y.forwardRef((e,t)=>{const n=FA(ar,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Cs(ar,e.__scopeMenu),o=xu(ar,e.__scopeMenu);return T.jsx(bu.Provider,{scope:e.__scopeMenu,children:T.jsx(Zf,{present:r||a.open,children:T.jsx(bu.Slot,{scope:e.__scopeMenu,children:o.modal?T.jsx(CV,{...i,ref:t}):T.jsx(kV,{...i,ref:t})})})})}),CV=y.forwardRef((e,t)=>{const n=Cs(ar,e.__scopeMenu),r=y.useRef(null),i=Sn(t,r);return y.useEffect(()=>{const a=r.current;if(a)return yA(a)},[]),T.jsx(f1,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Fe(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),kV=y.forwardRef((e,t)=>{const n=Cs(ar,e.__scopeMenu);return T.jsx(f1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),f1=y.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...g}=e,x=Cs(ar,n),w=xu(ar,n),v=lp(n),b=LA(n),E=vV(n),[_,S]=y.useState(null),I=y.useRef(null),D=Sn(t,I,x.onContentChange),V=y.useRef(0),N=y.useRef(""),$=y.useRef(0),z=y.useRef(null),X=y.useRef("right"),Y=y.useRef(0),ne=m?IA:y.Fragment,re=m?{as:yu,allowPinchZoom:!0}:void 0,ee=B=>{var $e,Ve;const k=N.current+B,ie=E().filter(We=>!We.disabled),he=document.activeElement,O=($e=ie.find(We=>We.ref.current===he))==null?void 0:$e.textValue,Pe=ie.map(We=>We.textValue),ge=jV(Pe,k,O),ve=(Ve=ie.find(We=>We.textValue===ge))==null?void 0:Ve.ref.current;(function We(Ge){N.current=Ge,window.clearTimeout(V.current),Ge!==""&&(V.current=window.setTimeout(()=>We(""),1e3))})(k),ve&&setTimeout(()=>ve.focus())};y.useEffect(()=>()=>window.clearTimeout(V.current),[]),Yk();const F=y.useCallback(B=>{var ie,he;return X.current===((ie=z.current)==null?void 0:ie.side)&&zV(B,(he=z.current)==null?void 0:he.area)},[]);return T.jsx(SV,{scope:n,searchRef:N,onItemEnter:y.useCallback(B=>{F(B)&&B.preventDefault()},[F]),onItemLeave:y.useCallback(B=>{var k;F(B)||((k=I.current)==null||k.focus(),S(null))},[F]),onTriggerLeave:y.useCallback(B=>{F(B)&&B.preventDefault()},[F]),pointerGraceTimerRef:$,onPointerGraceIntentChange:y.useCallback(B=>{z.current=B},[]),children:T.jsx(ne,{...re,children:T.jsx(Kk,{asChild:!0,trapped:i,onMountAutoFocus:Fe(a,B=>{var k;B.preventDefault(),(k=I.current)==null||k.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:T.jsx(Vk,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:T.jsx(CH,{asChild:!0,...b,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:_,onCurrentTabStopIdChange:S,onEntryFocus:Fe(l,B=>{w.isUsingKeyboardRef.current||B.preventDefault()}),preventScrollOnEntryFocus:!0,children:T.jsx(dH,{role:"menu","aria-orientation":"vertical","data-state":t3(x.open),"data-radix-menu-content":"",dir:w.dir,...v,...g,ref:D,style:{outline:"none",...g.style},onKeyDown:Fe(g.onKeyDown,B=>{const ie=B.target.closest("[data-radix-menu-content]")===B.currentTarget,he=B.ctrlKey||B.altKey||B.metaKey,O=B.key.length===1;ie&&(B.key==="Tab"&&B.preventDefault(),!he&&O&&ee(B.key));const Pe=I.current;if(B.target!==Pe||!gV.includes(B.key))return;B.preventDefault();const ve=E().filter($e=>!$e.disabled).map($e=>$e.ref.current);OA.includes(B.key)&&ve.reverse(),FV(ve)}),onBlur:Fe(e.onBlur,B=>{B.currentTarget.contains(B.target)||(window.clearTimeout(V.current),N.current="")}),onPointerMove:Fe(e.onPointerMove,Tu(B=>{const k=B.target,ie=Y.current!==B.clientX;if(B.currentTarget.contains(k)&&ie){const he=B.clientX>Y.current?"right":"left";X.current=he,Y.current=B.clientX}}))})})})})})})});BA.displayName=ar;var AV="MenuGroup",p1=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return T.jsx(Cn.div,{role:"group",...r,ref:t})});p1.displayName=AV;var RV="MenuLabel",jA=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return T.jsx(Cn.div,{...r,ref:t})});jA.displayName=RV;var up="MenuItem",UA="menu.itemSelect",cp=y.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,a=y.useRef(null),o=xu(up,e.__scopeMenu),s=d1(up,e.__scopeMenu),l=Sn(t,a),u=y.useRef(!1),c=()=>{const d=a.current;if(!n&&d){const f=new CustomEvent(UA,{bubbles:!0,cancelable:!0});d.addEventListener(UA,p=>r==null?void 0:r(p),{once:!0}),Bk(d,f),f.defaultPrevented?u.current=!1:o.onClose()}};return T.jsx(zA,{...i,ref:l,disabled:n,onClick:Fe(e.onClick,c),onPointerDown:d=>{var f;(f=e.onPointerDown)==null||f.call(e,d),u.current=!0},onPointerUp:Fe(e.onPointerUp,d=>{var f;u.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:Fe(e.onKeyDown,d=>{const f=s.searchRef.current!=="";n||f&&d.key===" "||u1.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});cp.displayName=up;var zA=y.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=d1(up,n),s=LA(n),l=y.useRef(null),u=Sn(t,l),[c,d]=y.useState(!1),[f,p]=y.useState("");return y.useEffect(()=>{const m=l.current;m&&p((m.textContent??"").trim())},[a.children]),T.jsx(bu.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:T.jsx(kH,{asChild:!0,...s,focusable:!r,children:T.jsx(Cn.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:u,onPointerMove:Fe(e.onPointerMove,Tu(m=>{r?o.onItemLeave(m):(o.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Fe(e.onPointerLeave,Tu(m=>o.onItemLeave(m))),onFocus:Fe(e.onFocus,()=>d(!0)),onBlur:Fe(e.onBlur,()=>d(!1))})})})}),NV="MenuCheckboxItem",HA=y.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return T.jsx(qA,{scope:e.__scopeMenu,checked:n,children:T.jsx(cp,{role:"menuitemcheckbox","aria-checked":dp(n)?"mixed":n,...i,ref:t,"data-state":m1(n),onSelect:Fe(i.onSelect,()=>r==null?void 0:r(dp(n)?!0:!n),{checkForDefaultPrevented:!1})})})});HA.displayName=NV;var VA="MenuRadioGroup",[PV,IV]=oo(VA,{value:void 0,onValueChange:()=>{}}),$A=y.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,a=Wt(r);return T.jsx(PV,{scope:e.__scopeMenu,value:n,onValueChange:a,children:T.jsx(p1,{...i,ref:t})})});$A.displayName=VA;var WA="MenuRadioItem",YA=y.forwardRef((e,t)=>{const{value:n,...r}=e,i=IV(WA,e.__scopeMenu),a=n===i.value;return T.jsx(qA,{scope:e.__scopeMenu,checked:a,children:T.jsx(cp,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":m1(a),onSelect:Fe(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});YA.displayName=WA;var h1="MenuItemIndicator",[qA,OV]=oo(h1,{checked:!1}),GA=y.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,a=OV(h1,n);return T.jsx(Zf,{present:r||dp(a.checked)||a.checked===!0,children:T.jsx(Cn.span,{...i,ref:t,"data-state":m1(a.checked)})})});GA.displayName=h1;var DV="MenuSeparator",KA=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return T.jsx(Cn.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});KA.displayName=DV;var LV="MenuArrow",XA=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=lp(n);return T.jsx(fH,{...i,...r,ref:t})});XA.displayName=LV;var MV="MenuSub",[zie,QA]=oo(MV),Eu="MenuSubTrigger",ZA=y.forwardRef((e,t)=>{const n=Cs(Eu,e.__scopeMenu),r=xu(Eu,e.__scopeMenu),i=QA(Eu,e.__scopeMenu),a=d1(Eu,e.__scopeMenu),o=y.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=a,u={__scopeMenu:e.__scopeMenu},c=y.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return y.useEffect(()=>c,[c]),y.useEffect(()=>{const d=s.current;return()=>{window.clearTimeout(d),l(null)}},[s,l]),T.jsx(c1,{asChild:!0,...u,children:T.jsx(zA,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":t3(n.open),...e,ref:Qf(t,i.onTriggerChange),onClick:d=>{var f;(f=e.onClick)==null||f.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Fe(e.onPointerMove,Tu(d=>{a.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),c()},100))})),onPointerLeave:Fe(e.onPointerLeave,Tu(d=>{var p,m;c();const f=(p=n.content)==null?void 0:p.getBoundingClientRect();if(f){const g=(m=n.content)==null?void 0:m.dataset.side,x=g==="right",w=x?-5:5,v=f[x?"left":"right"],b=f[x?"right":"left"];a.onPointerGraceIntentChange({area:[{x:d.clientX+w,y:d.clientY},{x:v,y:f.top},{x:b,y:f.top},{x:b,y:f.bottom},{x:v,y:f.bottom}],side:g}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(d),d.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Fe(e.onKeyDown,d=>{var p;const f=a.searchRef.current!=="";e.disabled||f&&d.key===" "||wV[r.dir].includes(d.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),d.preventDefault())})})})});ZA.displayName=Eu;var JA="MenuSubContent",e3=y.forwardRef((e,t)=>{const n=FA(ar,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Cs(ar,e.__scopeMenu),o=xu(ar,e.__scopeMenu),s=QA(JA,e.__scopeMenu),l=y.useRef(null),u=Sn(t,l);return T.jsx(bu.Provider,{scope:e.__scopeMenu,children:T.jsx(Zf,{present:r||a.open,children:T.jsx(bu.Slot,{scope:e.__scopeMenu,children:T.jsx(f1,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:c=>{var d;o.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),c.preventDefault()},onCloseAutoFocus:c=>c.preventDefault(),onFocusOutside:Fe(e.onFocusOutside,c=>{c.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Fe(e.onEscapeKeyDown,c=>{o.onClose(),c.preventDefault()}),onKeyDown:Fe(e.onKeyDown,c=>{var p;const d=c.currentTarget.contains(c.target),f=yV[o.dir].includes(c.key);d&&f&&(a.onOpenChange(!1),(p=s.trigger)==null||p.focus(),c.preventDefault())})})})})})});e3.displayName=JA;function t3(e){return e?"open":"closed"}function dp(e){return e==="indeterminate"}function m1(e){return dp(e)?"indeterminate":e?"checked":"unchecked"}function FV(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function BV(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function jV(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=BV(e,Math.max(a,0));i.length===1&&(o=o.filter(u=>u!==n));const l=o.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function UV(e,t){const{x:n,y:r}=e;let i=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const s=t[a].x,l=t[a].y,u=t[o].x,c=t[o].y;l>r!=c>r&&n<(u-s)*(r-l)/(c-l)+s&&(i=!i)}return i}function zV(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return UV(n,t)}function Tu(e){return t=>t.pointerType==="mouse"?e(t):void 0}var HV=MA,VV=c1,$V=BA,WV=p1,YV=jA,qV=cp,GV=HA,KV=$A,XV=YA,QV=GA,ZV=KA,JV=XA,e$=ZA,t$=e3,g1="DropdownMenu",[n$,Hie]=Ui(g1,[DA]),kn=DA(),[r$,n3]=n$(g1),r3=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,l=kn(t),u=y.useRef(null),[c=!1,d]=$f({prop:i,defaultProp:a,onChange:o});return T.jsx(r$,{scope:t,triggerId:fu(),triggerRef:u,contentId:fu(),open:c,onOpenChange:d,onOpenToggle:y.useCallback(()=>d(f=>!f),[d]),modal:s,children:T.jsx(HV,{...l,open:c,onOpenChange:d,dir:r,modal:s,children:n})})};r3.displayName=g1;var i3="DropdownMenuTrigger",a3=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=n3(i3,n),o=kn(n);return T.jsx(VV,{asChild:!0,...o,children:T.jsx(Cn.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:Qf(t,a.triggerRef),onPointerDown:Fe(e.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(a.onOpenToggle(),a.open||s.preventDefault())}),onKeyDown:Fe(e.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&a.onOpenToggle(),s.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});a3.displayName=i3;var o3="DropdownMenuContent",s3=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=n3(o3,n),a=kn(n),o=y.useRef(!1);return T.jsx($V,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:Fe(e.onCloseAutoFocus,s=>{var l;o.current||(l=i.triggerRef.current)==null||l.focus(),o.current=!1,s.preventDefault()}),onInteractOutside:Fe(e.onInteractOutside,s=>{const l=s.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,c=l.button===2||u;(!i.modal||c)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});s3.displayName=o3;var i$="DropdownMenuGroup",l3=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return T.jsx(WV,{...i,...r,ref:t})});l3.displayName=i$;var a$="DropdownMenuLabel",u3=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return T.jsx(YV,{...i,...r,ref:t})});u3.displayName=a$;var o$="DropdownMenuItem",c3=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return T.jsx(qV,{...i,...r,ref:t})});c3.displayName=o$;var s$="DropdownMenuCheckboxItem",d3=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return T.jsx(GV,{...i,...r,ref:t})});d3.displayName=s$;var l$="DropdownMenuRadioGroup",u$=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return T.jsx(KV,{...i,...r,ref:t})});u$.displayName=l$;var c$="DropdownMenuRadioItem",f3=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return T.jsx(XV,{...i,...r,ref:t})});f3.displayName=c$;var d$="DropdownMenuItemIndicator",p3=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return T.jsx(QV,{...i,...r,ref:t})});p3.displayName=d$;var f$="DropdownMenuSeparator",h3=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return T.jsx(ZV,{...i,...r,ref:t})});h3.displayName=f$;var p$="DropdownMenuArrow",h$=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return T.jsx(JV,{...i,...r,ref:t})});h$.displayName=p$;var m$="DropdownMenuSubTrigger",m3=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return T.jsx(e$,{...i,...r,ref:t})});m3.displayName=m$;var g$="DropdownMenuSubContent",g3=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return T.jsx(t$,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});g3.displayName=g$;var w$=r3,y$=a3,w3=s3,v$=l3,y3=u3,v3=c3,b3=d3,x3=f3,E3=p3,T3=h3,_3=m3,S3=g3;const b$=w$,x$=y$,E$=v$,T$=y.forwardRef(({className:e,inset:t,children:n,...r},i)=>T.jsxs(_3,{ref:i,className:Me("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r,children:[n,T.jsx(_L,{className:"ml-auto"})]}));T$.displayName=_3.displayName;const _$=y.forwardRef(({className:e,...t},n)=>T.jsx(S3,{ref:n,className:Me("z-50 min-w-[8rem] overflow-hidden rounded-2xl border bg-background p-1 text-foreground shadow-2xl 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",e),...t}));_$.displayName=S3.displayName;const C3=y.forwardRef(({className:e,sideOffset:t=4,...n},r)=>T.jsx(w3,{ref:r,sideOffset:t,className:Me("z-50 min-w-[8rem] overflow-hidden rounded-2xl border bg-background p-1 text-foreground shadow-2xl","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",e),...n}));C3.displayName=w3.displayName;const k3=y.forwardRef(({className:e,inset:t,...n},r)=>T.jsx(xi,{children:T.jsx(v3,{ref:r,className:Me("relative flex cursor-default select-none items-center gap-2 rounded-xl px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n})}));k3.displayName=v3.displayName;const S$=y.forwardRef(({className:e,children:t,checked:n,...r},i)=>T.jsxs(b3,{ref:i,className:Me("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[T.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:T.jsx(E3,{children:T.jsx(TL,{className:"h-4 w-4"})})}),t]}));S$.displayName=b3.displayName;const C$=y.forwardRef(({className:e,children:t,...n},r)=>T.jsxs(x3,{ref:r,className:Me("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[T.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:T.jsx(E3,{children:T.jsx(kL,{className:"h-2 w-2 fill-current"})})}),t]}));C$.displayName=x3.displayName;const k$=y.forwardRef(({className:e,inset:t,...n},r)=>T.jsx(y3,{ref:r,className:Me("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));k$.displayName=y3.displayName;const A$=y.forwardRef(({className:e,...t},n)=>T.jsx(T3,{ref:n,className:Me("-mx-1 my-1 h-px bg-muted",e),...t}));A$.displayName=T3.displayName;function R$({className:e,...t}){return T.jsx("div",{className:Me("animate-pulse rounded-md bg-secondary",e),...t})}function N$(){const e=Kf(),[t,n]=y.useState(!1),{widgetCtx:r}=Qn();return T.jsxs(b$,{open:t,onOpenChange:n,children:[T.jsx(x$,{asChild:!0,children:T.jsx(pa,{variant:"ghost",size:"fit",className:"rounded-full",children:T.jsx(AL,{className:"size-4"})})}),T.jsx(C3,{align:"end",className:"min-w-56",children:T.jsx(E$,{children:T.jsxs(k3,{onSelect:()=>{r.resetChat(),n(!1)},children:[T.jsx(Ua.div,{initial:{opacity:0,x:-4,rotate:360},animate:{opacity:1,x:0,rotate:0},children:T.jsx(OL,{})}),e.get("reset-conversation")]})})})]})}function P$(){var n;const{data:e,isLoading:t}=fg();return T.jsx("header",{className:"p-2 border-b bg-background",children:T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("div",{className:"flex-1 pl-2",children:t?T.jsx(R$,{className:"h-4 w-2/3"}):T.jsx("h2",{className:"font-semibold",children:(n=e==null?void 0:e.data)==null?void 0:n.organizationName})}),T.jsx(N$,{})]})})}function I$(e){const t=[];let n=null;return e.forEach(r=>{var i,a,o,s;(!n||((i=n[0])==null?void 0:i.type)!==r.type)&&(n=[],t.push(n)),((a=n[0])==null?void 0:a.type)==="FROM_AGENT"&&r.type==="FROM_AGENT"&&((o=r.agent)==null?void 0:o.id)!==((s=n[0].agent)==null?void 0:s.id)&&(n=[],t.push(n)),n.push(r)}),t}function O$(e){var t;return((t=e==null?void 0:e[0])==null?void 0:t.type)==="FROM_USER"}function D$(e){var t;return((t=e==null?void 0:e[0])==null?void 0:t.type)==="FROM_BOT"}function L$(e){var t;return((t=e==null?void 0:e[0])==null?void 0:t.type)==="FROM_AGENT"}function w1({message:e,Wrapper:t,wrapperProps:n}){const{componentStore:r}=Qn(),i=r.getComponent(e.component,!1);return i?t?y.createElement(t,{...n,key:e.id,"data-test":`message-wrapper-${e.id}`},T.jsx(i,{...e,id:e.id})):T.jsx("div",{"data-test":`message-${e.id}`,children:y.createElement(i,{...e,id:e.id,key:e.id})}):null}function y1({children:e,className:t,messageId:n}){return T.jsx("div",{className:Me("w-fit space-y-2",t),"data-test":`message-wrapper-${n}`,children:T.jsx("div",{"data-test":"message-content-wrapper",className:Me("w-fit p-2 rounded-2xl text-sm","bg-secondary border shadow-sm"),children:e})})}const fp=43200,A3=1440,R3=Symbol.for("constructDateFrom");function N3(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&R3 in e?e[R3](t):e instanceof Date?new e.constructor(t):new Date(t)}function ma(e,t){return N3(e,e)}let M$={};function F$(){return M$}function P3(e){const t=ma(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function v1(e,...t){const n=N3.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function pp(e,t){const n=+ma(e)-+ma(t);return n<0?-1:n>0?1:n}function B$(e,t,n){const[r,i]=v1(n==null?void 0:n.in,e,t),a=r.getFullYear()-i.getFullYear(),o=r.getMonth()-i.getMonth();return a*12+o}function j$(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function U$(e,t){return+ma(e)-+ma(t)}function z$(e,t){const n=ma(e);return n.setHours(23,59,59,999),n}function H$(e,t){const n=ma(e),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function V$(e,t){const n=ma(e);return+z$(n)==+H$(n)}function $$(e,t,n){const[r,i,a]=v1(n==null?void 0:n.in,e,e,t),o=pp(i,a),s=Math.abs(B$(i,a));if(s<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-o*s);let l=pp(i,a)===-o;V$(r)&&s===1&&pp(r,a)===1&&(l=!1);const u=o*(s-+l);return u===0?0:u}function W$(e,t,n){const r=U$(e,t)/1e3;return j$(n==null?void 0:n.roundingMethod)(r)}const Y$={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},q$=(e,t,n)=>{let r;const i=Y$[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function b1(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const G$={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},K$={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},X$={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Q$={date:b1({formats:G$,defaultWidth:"full"}),time:b1({formats:K$,defaultWidth:"full"}),dateTime:b1({formats:X$,defaultWidth:"full"})},Z$={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},J$=(e,t,n,r)=>Z$[e];function _u(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,s=n!=null&&n.width?String(n.width):o;i=e.formattingValues[s]||e.formattingValues[o]}else{const o=e.defaultWidth,s=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[s]||e.values[o]}const a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}const eW={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},tW={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},nW={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},rW={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},iW={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},aW={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},oW={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:_u({values:eW,defaultWidth:"wide"}),quarter:_u({values:tW,defaultWidth:"wide",argumentCallback:e=>e-1}),month:_u({values:nW,defaultWidth:"wide"}),day:_u({values:rW,defaultWidth:"wide"}),dayPeriod:_u({values:iW,defaultWidth:"wide",formattingValues:aW,defaultFormattingWidth:"wide"})};function Su(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;const o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?lW(s,d=>d.test(o)):sW(s,d=>d.test(o));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const c=t.slice(o.length);return{value:u,rest:c}}}function sW(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function lW(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function uW(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;const s=t.slice(i.length);return{value:o,rest:s}}}const cW=/^(\d+)(th|st|nd|rd)?/i,dW=/\d+/i,fW={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},pW={any:[/^b/i,/^(a|c)/i]},hW={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},mW={any:[/1/i,/2/i,/3/i,/4/i]},gW={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},wW={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},yW={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},vW={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},bW={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},xW={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},EW={ordinalNumber:uW({matchPattern:cW,parsePattern:dW,valueCallback:e=>parseInt(e,10)}),era:Su({matchPatterns:fW,defaultMatchWidth:"wide",parsePatterns:pW,defaultParseWidth:"any"}),quarter:Su({matchPatterns:hW,defaultMatchWidth:"wide",parsePatterns:mW,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Su({matchPatterns:gW,defaultMatchWidth:"wide",parsePatterns:wW,defaultParseWidth:"any"}),day:Su({matchPatterns:yW,defaultMatchWidth:"wide",parsePatterns:vW,defaultParseWidth:"any"}),dayPeriod:Su({matchPatterns:bW,defaultMatchWidth:"any",parsePatterns:xW,defaultParseWidth:"any"})},TW={code:"en-US",formatDistance:q$,formatLong:Q$,formatRelative:J$,localize:oW,match:EW,options:{weekStartsOn:0,firstWeekContainsDate:1}};function _W(e,t,n){const r=F$(),i=(n==null?void 0:n.locale)??r.locale??TW,a=2520,o=pp(e,t);if(isNaN(o))throw new RangeError("Invalid time value");const s=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:o}),[l,u]=v1(n==null?void 0:n.in,...o>0?[t,e]:[e,t]),c=W$(u,l),d=(P3(u)-P3(l))/1e3,f=Math.round((c-d)/60);let p;if(f<2)return n!=null&&n.includeSeconds?c<5?i.formatDistance("lessThanXSeconds",5,s):c<10?i.formatDistance("lessThanXSeconds",10,s):c<20?i.formatDistance("lessThanXSeconds",20,s):c<40?i.formatDistance("halfAMinute",0,s):c<60?i.formatDistance("lessThanXMinutes",1,s):i.formatDistance("xMinutes",1,s):f===0?i.formatDistance("lessThanXMinutes",1,s):i.formatDistance("xMinutes",f,s);if(f<45)return i.formatDistance("xMinutes",f,s);if(f<90)return i.formatDistance("aboutXHours",1,s);if(f<A3){const m=Math.round(f/60);return i.formatDistance("aboutXHours",m,s)}else{if(f<a)return i.formatDistance("xDays",1,s);if(f<fp){const m=Math.round(f/A3);return i.formatDistance("xDays",m,s)}else if(f<fp*2)return p=Math.round(f/fp),i.formatDistance("aboutXMonths",p,s)}if(p=$$(u,l),p<12){const m=Math.round(f/fp);return i.formatDistance("xMonths",m,s)}else{const m=p%12,g=Math.trunc(p/12);return m<3?i.formatDistance("aboutXYears",g,s):m<9?i.formatDistance("overXYears",g,s):i.formatDistance("almostXYears",g+1,s)}}var x1="Avatar",[SW,$ie]=Ui(x1),[CW,I3]=SW(x1),O3=y.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,a]=y.useState("idle");return T.jsx(CW,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:a,children:T.jsx(zn.span,{...r,ref:t})})});O3.displayName=x1;var D3="AvatarImage",L3=y.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...a}=e,o=I3(D3,n),s=kW(r,a.referrerPolicy),l=Wt(u=>{i(u),o.onImageLoadingStatusChange(u)});return ir(()=>{s!=="idle"&&l(s)},[s,l]),s==="loaded"?T.jsx(zn.img,{...a,ref:t,src:r}):null});L3.displayName=D3;var M3="AvatarFallback",F3=y.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,a=I3(M3,n),[o,s]=y.useState(r===void 0);return y.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(l)}},[r]),o&&a.imageLoadingStatus!=="loaded"?T.jsx(zn.span,{...i,ref:t}):null});F3.displayName=M3;function kW(e,t){const[n,r]=y.useState("idle");return ir(()=>{if(!e){r("error");return}let i=!0;const a=new window.Image,o=s=>()=>{i&&r(s)};return r("loading"),a.onload=o("loaded"),a.onerror=o("error"),a.src=e,t&&(a.referrerPolicy=t),()=>{i=!1}},[e,t]),n}var B3=O3,j3=L3,U3=F3;const hp=y.forwardRef(({className:e,...t},n)=>T.jsx(B3,{ref:n,className:Me("relative flex size-6 aspect-square shrink-0 overflow-hidden rounded-full border bg-secondary",e),...t}));hp.displayName=B3.displayName;const E1=y.forwardRef(({className:e,...t},n)=>T.jsx(j3,{ref:n,className:Me("aspect-square h-full w-full",e),...t}));E1.displayName=j3.displayName;const z3=y.forwardRef(({className:e,...t},n)=>T.jsx(U3,{ref:n,className:Me("flex size-full text-sm items-center justify-center rounded-lg",e),...t}));z3.displayName=U3.displayName;function H3({attachment:e}){const{name:t,size:n,type:r,url:i}=e,a=r.startsWith("image/"),o=r.startsWith("video/"),s=r.startsWith("audio/");return T.jsxs("div",{className:"size-fit gap-2 border shrink-0 rounded-2xl overflow-hidden",children:[a&&T.jsx("img",{loading:"lazy",src:i,className:"object-cover size-16"}),o&&T.jsxs("video",{controls:!0,children:[T.jsx("source",{src:i,type:r}),"Your browser does not support the video tag."]}),s&&T.jsxs("audio",{controls:!0,className:"w-full mt-2 rounded-md border",children:[T.jsx("source",{src:i,type:r}),"Your browser does not support the audio tag."]}),!a&&!o&&!s&&T.jsxs("div",{className:"flex items-center gap-2 p-2",children:[T.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 line-clamp-2 underline hover:text-blue-600",children:t}),T.jsxs("span",{className:"text-sm text-gray-500 whitespace-nowrap",children:[(n/1024).toFixed(2)," KB"]})]})]})}function AW({message:e}){var t;return y.useMemo(()=>e.deliveredAt?_W(new Date(e.deliveredAt),new Date,{addSuffix:!0}):null,[e.deliveredAt]),T.jsxs("div",{className:"flex flex-col items-end gap-1",children:[T.jsx("div",{className:Me("w-fit p-2 rounded-2xl text-sm","bg-primary text-primary-foreground border shadow-sm"),children:e.content}),e.attachments&&e.attachments.length>0&&T.jsx("div",{className:"flex gap-1 flex-wrap justify-end",children:(t=e.attachments)==null?void 0:t.map(n=>T.jsx(H3,{attachment:n},n.id))})]})}function RW({messages:e}){const{user:t}=bl();return T.jsxs("div",{className:Me("group","flex flex-col gap-2 justify-end items-end","pl-8"),children:[T.jsx(hp,{className:"bg-primary text-primary-foreground",children:T.jsx(E1,{src:t==null?void 0:t.avatarUrl,alt:(t==null?void 0:t.name)||"User avatar"})}),e.map(n=>T.jsx(AW,{message:n},n.id))]})}function NW({messages:e,agent:t}){const{session:n}=md();return T.jsxs("div",{className:Me("flex flex-col items-start gap-2","pr-8"),children:[T.jsx(hp,{children:T.jsx(E1,{src:(t==null?void 0:t.avatar)??"",alt:"Agent Icon"})}),e.map(r=>{var i;return T.jsx(w1,{message:r,Wrapper:y1,wrapperProps:{messageId:r.id,sessionId:(i=n.session)==null?void 0:i.id}},r.id)})]})}function PW(){var u;const{messages:{messages:e}}=hd(),{isAwaitingBotReply:t}=JT(),{componentStore:n}=Qn(),r=bl(),i=y.useMemo(()=>I$(e),[e.length]),a=n.getComponent("loading"),o=y.useRef(null);function s(){setTimeout(()=>{const c=o.current;c&&(c.scrollTop=c.scrollHeight)},0)}y.useEffect(()=>{s()},[e]);const l=e.length===0;return T.jsxs("div",{"data-messages":!0,ref:o,className:"max-h-full scroll-smooth relative flex-1 p-2 space-y-2 overflow-auto",children:[l&&(((u=r.initialMessages)==null?void 0:u.map((c,d)=>T.jsx(w1,{message:{component:"bot_message",data:{message:c},id:`initial-${d}`,type:"FROM_BOT",timestamp:Date.now().toString()},Wrapper:y1},d)))??T.jsx(w1,{message:{component:"bot_message",data:{message:"Hello, how can I help?"},id:"default-welcome",type:"FROM_BOT",agent:r.bot,timestamp:Date.now().toString()},Wrapper:y1},"default-welcome")),i.map((c,d)=>{var p,m;if(!((p=c==null?void 0:c[0])==null?void 0:p.type))return null;if(O$(c))return T.jsx(RW,{messages:c},d);if(D$(c)||L$(c)){const g=(m=c[0])==null?void 0:m.agent;return T.jsx(NW,{messages:c,agent:g},d)}return null}),t&&T.jsx(a,{})]})}const IW="[data-chat-widget-content-root]";function V3({fallbackHeight:e}){const t=y.useRef(null);return y.useEffect(()=>{const n=document.querySelector(IW);if(n&&t.current){const r=t.current;let i;const a=new ResizeObserver(()=>{i=requestAnimationFrame(()=>{const o=Math.max(r.offsetHeight,e);n.style.setProperty("--opencx-widget-height",o.toFixed(1)+"px")})});return a.observe(r),()=>{cancelAnimationFrame(i),a.unobserve(r)}}},[]),{observedElementRef:t}}function OW({options:e,onKeyboardClick:t}){return T.jsx("div",{className:"flex items-center gap-2 p-2 flex-wrap",children:e.map((n,r)=>T.jsx(pa,{onClick:()=>t(n),className:"flex-1 rounded-full",size:"sm",children:n},r))})}function DW(){var o,s;const{messages:e,messageCtx:t}=hd(),r=(s=(o=fg().data)==null?void 0:o.data)==null?void 0:s.initialQuestions,{observedElementRef:i}=V3({fallbackHeight:KO}),a=e.messages.length===0;return T.jsx("div",{ref:i,"data-test":"chat-screen",className:Me(hh.widgetHeight,"w-full flex flex-col overflow-hidden bg-background z-10 origin-bottom absolute bottom-0 inset-x-0"),children:T.jsxs("div",{className:"w-full h-full justify-between flex flex-col relative","data-test":"chat-screen-content",style:{background:"linear-gradient(333.89deg, rgba(75, 240, 171, 0.8) 58%, rgba(75, 240, 171, 0) 85.74%), linear-gradient(113.43deg, #46B1FF 19.77%, #1883FF 65.81%)"},children:[T.jsx(P$,{}),T.jsxs("div",{className:"flex bg-background shadow-lg flex-col w-full flex-1 overflow-auto","data-test":"chat-main-container",children:[T.jsx(PW,{}),T.jsxs("footer",{"data-test":"chat-footer",children:[e.suggestedReplies&&T.jsx(OW,{"data-test":"chat-keyboard",options:e.suggestedReplies,onKeyboardClick:l=>{const u=l.trim();u&&t.sendMessage({content:u})}}),a&&r&&T.jsx("div",{className:"flex items-center flex-row justify-end gap-2 flex-wrap px-2","data-test":"initial-questions-container",children:r==null?void 0:r.map((l,u)=>T.jsx(pa,{dir:"auto",variant:"outline",size:"sm","data-test":`initial-question-${u}`,onClick:()=>{t.sendMessage({content:l})},children:l},u))}),T.jsx(Dz,{})]})]})]})})}var Be;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const a={};for(const o of i)a[o]=o;return a},e.getValidEnumValues=i=>{const a=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),o={};for(const s of a)o[s]=i[s];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(a){return i[a]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&a.push(o);return a},e.find=(i,a)=>{for(const o of i)if(a(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}e.joinValues=r,e.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(Be||(Be={}));var T1;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(T1||(T1={}));const oe=Be.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ga=e=>{switch(typeof e){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return isNaN(e)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"symbol":return oe.symbol;case"object":return Array.isArray(e)?oe.array:e===null?oe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?oe.promise:typeof Map<"u"&&e instanceof Map?oe.map:typeof Set<"u"&&e instanceof Set?oe.set:typeof Date<"u"&&e instanceof Date?oe.date:oe.object;default:return oe.unknown}},Z=Be.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),LW=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class $n extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(a){return a.message},r={_errors:[]},i=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let s=r,l=0;for(;l<o.path.length;){const u=o.path[l];l===o.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(n(o))):s[u]=s[u]||{_errors:[]},s=s[u],l++}}};return i(this),r}static assert(t){if(!(t instanceof $n))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Be.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}$n.create=e=>new $n(e);const ks=(e,t)=>{let n;switch(e.code){case Z.invalid_type:e.received===oe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Z.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Be.jsonStringifyReplacer)}`;break;case Z.unrecognized_keys:n=`Unrecognized key(s) in object: ${Be.joinValues(e.keys,", ")}`;break;case Z.invalid_union:n="Invalid input";break;case Z.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Be.joinValues(e.options)}`;break;case Z.invalid_enum_value:n=`Invalid enum value. Expected ${Be.joinValues(e.options)}, received '${e.received}'`;break;case Z.invalid_arguments:n="Invalid function arguments";break;case Z.invalid_return_type:n="Invalid function return type";break;case Z.invalid_date:n="Invalid date";break;case Z.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Be.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Z.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Z.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Z.custom:n="Invalid input";break;case Z.invalid_intersection_types:n="Intersection results could not be merged";break;case Z.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Z.not_finite:n="Number must be finite";break;default:n=t.defaultError,Be.assertNever(e)}return{message:n}};let $3=ks;function MW(e){$3=e}function mp(){return $3}const gp=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)s=u(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}},FW=[];function ae(e,t){const n=mp(),r=gp({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===ks?void 0:ks].filter(i=>!!i)});e.common.issues.push(r)}class tn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return be;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const a=await i.key,o=await i.value;r.push({key:a,value:o})}return tn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:a,value:o}=i;if(a.status==="aborted"||o.status==="aborted")return be;a.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[a.value]=o.value)}return{status:t.value,value:r}}}const be=Object.freeze({status:"aborted"}),As=e=>({status:"dirty",value:e}),dn=e=>({status:"valid",value:e}),_1=e=>e.status==="aborted",S1=e=>e.status==="dirty",Cu=e=>e.status==="valid",ku=e=>typeof Promise<"u"&&e instanceof Promise;function wp(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function W3(e,t,n,r,i){if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}typeof SuppressedError=="function"&&SuppressedError;var pe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(pe||(pe={}));var Au,Ru;class $r{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Y3=(e,t)=>{if(Cu(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new $n(e.common.issues);return this._error=n,this._error}}};function Ce(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(o,s)=>{var l,u;const{message:c}=e;return o.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:(l=c??r)!==null&&l!==void 0?l:s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:(u=c??n)!==null&&u!==void 0?u:s.defaultError}},description:i}}class Ne{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return ga(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:ga(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new tn,ctx:{common:t.parent.common,data:t.data,parsedType:ga(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(ku(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ga(t)},a=this._parseSync({data:t,path:i.path,parent:i});return Y3(i,a)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ga(t)},i=this._parse({data:t,path:r.path,parent:r}),a=await(ku(i)?i:Promise.resolve(i));return Y3(r,a)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,a)=>{const o=t(i),s=()=>a.addIssue({code:Z.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new kr({schema:this,typeName:ye.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Yr.create(this,this._def)}nullable(){return ba.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Cr.create(this,this._def)}promise(){return Is.create(this,this._def)}or(t){return Ou.create([this,t],this._def)}and(t){return Du.create(this,t,this._def)}transform(t){return new kr({...Ce(this._def),schema:this,typeName:ye.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new ju({...Ce(this._def),innerType:this,defaultValue:n,typeName:ye.ZodDefault})}brand(){return new A1({typeName:ye.ZodBranded,type:this,...Ce(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Uu({...Ce(this._def),innerType:this,catchValue:n,typeName:ye.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return zu.create(this,t)}readonly(){return Hu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const BW=/^c[^\s-]{8,}$/i,jW=/^[0-9a-z]+$/,UW=/^[0-9A-HJKMNP-TV-Z]{26}$/,zW=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,HW=/^[a-z0-9_-]{21}$/i,VW=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,$W=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,WW="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let C1;const YW=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,qW=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,GW=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,q3="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",KW=new RegExp(`^${q3}$`);function G3(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function XW(e){return new RegExp(`^${G3(e)}$`)}function K3(e){let t=`${q3}T${G3(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function QW(e,t){return!!((t==="v4"||!t)&&YW.test(e)||(t==="v6"||!t)&&qW.test(e))}class Sr extends Ne{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==oe.string){const a=this._getOrReturnCtx(t);return ae(a,{code:Z.invalid_type,expected:oe.string,received:a.parsedType}),be}const r=new tn;let i;for(const a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(i=this._getOrReturnCtx(t,i),ae(i,{code:Z.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")t.data.length>a.value&&(i=this._getOrReturnCtx(t,i),ae(i,{code:Z.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const o=t.data.length>a.value,s=t.data.length<a.value;(o||s)&&(i=this._getOrReturnCtx(t,i),o?ae(i,{code:Z.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&ae(i,{code:Z.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")$W.test(t.data)||(i=this._getOrReturnCtx(t,i),ae(i,{validation:"email",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")C1||(C1=new RegExp(WW,"u")),C1.test(t.data)||(i=this._getOrReturnCtx(t,i),ae(i,{validation:"emoji",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")zW.test(t.data)||(i=this._getOrReturnCtx(t,i),ae(i,{validation:"uuid",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")HW.test(t.data)||(i=this._getOrReturnCtx(t,i),ae(i,{validation:"nanoid",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")BW.test(t.data)||(i=this._getOrReturnCtx(t,i),ae(i,{validation:"cuid",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")jW.test(t.data)||(i=this._getOrReturnCtx(t,i),ae(i,{validation:"cuid2",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")UW.test(t.data)||(i=this._getOrReturnCtx(t,i),ae(i,{validation:"ulid",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),ae(i,{validation:"url",code:Z.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),ae(i,{validation:"regex",code:Z.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(t,i),ae(i,{code:Z.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(i=this._getOrReturnCtx(t,i),ae(i,{code:Z.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(i=this._getOrReturnCtx(t,i),ae(i,{code:Z.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?K3(a).test(t.data)||(i=this._getOrReturnCtx(t,i),ae(i,{code:Z.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?KW.test(t.data)||(i=this._getOrReturnCtx(t,i),ae(i,{code:Z.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?XW(a).test(t.data)||(i=this._getOrReturnCtx(t,i),ae(i,{code:Z.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?VW.test(t.data)||(i=this._getOrReturnCtx(t,i),ae(i,{validation:"duration",code:Z.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?QW(t.data,a.version)||(i=this._getOrReturnCtx(t,i),ae(i,{validation:"ip",code:Z.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?GW.test(t.data)||(i=this._getOrReturnCtx(t,i),ae(i,{validation:"base64",code:Z.invalid_string,message:a.message}),r.dirty()):Be.assertNever(a);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:Z.invalid_string,...pe.errToObj(r)})}_addCheck(t){return new Sr({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...pe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...pe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...pe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...pe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...pe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...pe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...pe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...pe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...pe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...pe.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...pe.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...pe.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...pe.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...pe.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...pe.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...pe.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...pe.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...pe.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...pe.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...pe.errToObj(n)})}nonempty(t){return this.min(1,pe.errToObj(t))}trim(){return new Sr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Sr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Sr({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Sr.create=e=>{var t;return new Sr({checks:[],typeName:ye.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ce(e)})};function ZW(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,a=parseInt(e.toFixed(i).replace(".","")),o=parseInt(t.toFixed(i).replace(".",""));return a%o/Math.pow(10,i)}class wa extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==oe.number){const a=this._getOrReturnCtx(t);return ae(a,{code:Z.invalid_type,expected:oe.number,received:a.parsedType}),be}let r;const i=new tn;for(const a of this._def.checks)a.kind==="int"?Be.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ae(r,{code:Z.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),ae(r,{code:Z.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),ae(r,{code:Z.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?ZW(t.data,a.value)!==0&&(r=this._getOrReturnCtx(t,r),ae(r,{code:Z.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ae(r,{code:Z.not_finite,message:a.message}),i.dirty()):Be.assertNever(a);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,pe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,pe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,pe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,pe.toString(n))}setLimit(t,n,r,i){return new wa({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:pe.toString(i)}]})}_addCheck(t){return new wa({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:pe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:pe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:pe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:pe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:pe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:pe.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:pe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:pe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:pe.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Be.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}wa.create=e=>new wa({checks:[],typeName:ye.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Ce(e)});class ya extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==oe.bigint){const a=this._getOrReturnCtx(t);return ae(a,{code:Z.invalid_type,expected:oe.bigint,received:a.parsedType}),be}let r;const i=new tn;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),ae(r,{code:Z.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),ae(r,{code:Z.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ae(r,{code:Z.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):Be.assertNever(a);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,pe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,pe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,pe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,pe.toString(n))}setLimit(t,n,r,i){return new ya({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:pe.toString(i)}]})}_addCheck(t){return new ya({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:pe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:pe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:pe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:pe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:pe.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}ya.create=e=>{var t;return new ya({checks:[],typeName:ye.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ce(e)})};class Nu extends Ne{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==oe.boolean){const r=this._getOrReturnCtx(t);return ae(r,{code:Z.invalid_type,expected:oe.boolean,received:r.parsedType}),be}return dn(t.data)}}Nu.create=e=>new Nu({typeName:ye.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Ce(e)});class so extends Ne{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==oe.date){const a=this._getOrReturnCtx(t);return ae(a,{code:Z.invalid_type,expected:oe.date,received:a.parsedType}),be}if(isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return ae(a,{code:Z.invalid_date}),be}const r=new tn;let i;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(i=this._getOrReturnCtx(t,i),ae(i,{code:Z.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(i=this._getOrReturnCtx(t,i),ae(i,{code:Z.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):Be.assertNever(a);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new so({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:pe.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:pe.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}so.create=e=>new so({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ye.ZodDate,...Ce(e)});class yp extends Ne{_parse(t){if(this._getType(t)!==oe.symbol){const r=this._getOrReturnCtx(t);return ae(r,{code:Z.invalid_type,expected:oe.symbol,received:r.parsedType}),be}return dn(t.data)}}yp.create=e=>new yp({typeName:ye.ZodSymbol,...Ce(e)});class Pu extends Ne{_parse(t){if(this._getType(t)!==oe.undefined){const r=this._getOrReturnCtx(t);return ae(r,{code:Z.invalid_type,expected:oe.undefined,received:r.parsedType}),be}return dn(t.data)}}Pu.create=e=>new Pu({typeName:ye.ZodUndefined,...Ce(e)});class Iu extends Ne{_parse(t){if(this._getType(t)!==oe.null){const r=this._getOrReturnCtx(t);return ae(r,{code:Z.invalid_type,expected:oe.null,received:r.parsedType}),be}return dn(t.data)}}Iu.create=e=>new Iu({typeName:ye.ZodNull,...Ce(e)});class Rs extends Ne{constructor(){super(...arguments),this._any=!0}_parse(t){return dn(t.data)}}Rs.create=e=>new Rs({typeName:ye.ZodAny,...Ce(e)});class lo extends Ne{constructor(){super(...arguments),this._unknown=!0}_parse(t){return dn(t.data)}}lo.create=e=>new lo({typeName:ye.ZodUnknown,...Ce(e)});class Ei extends Ne{_parse(t){const n=this._getOrReturnCtx(t);return ae(n,{code:Z.invalid_type,expected:oe.never,received:n.parsedType}),be}}Ei.create=e=>new Ei({typeName:ye.ZodNever,...Ce(e)});class vp extends Ne{_parse(t){if(this._getType(t)!==oe.undefined){const r=this._getOrReturnCtx(t);return ae(r,{code:Z.invalid_type,expected:oe.void,received:r.parsedType}),be}return dn(t.data)}}vp.create=e=>new vp({typeName:ye.ZodVoid,...Ce(e)});class Cr extends Ne{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==oe.array)return ae(n,{code:Z.invalid_type,expected:oe.array,received:n.parsedType}),be;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,s=n.data.length<i.exactLength.value;(o||s)&&(ae(n,{code:o?Z.too_big:Z.too_small,minimum:s?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(ae(n,{code:Z.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(ae(n,{code:Z.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,s)=>i.type._parseAsync(new $r(n,o,n.path,s)))).then(o=>tn.mergeArray(r,o));const a=[...n.data].map((o,s)=>i.type._parseSync(new $r(n,o,n.path,s)));return tn.mergeArray(r,a)}get element(){return this._def.type}min(t,n){return new Cr({...this._def,minLength:{value:t,message:pe.toString(n)}})}max(t,n){return new Cr({...this._def,maxLength:{value:t,message:pe.toString(n)}})}length(t,n){return new Cr({...this._def,exactLength:{value:t,message:pe.toString(n)}})}nonempty(t){return this.min(1,t)}}Cr.create=(e,t)=>new Cr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ye.ZodArray,...Ce(t)});function Ns(e){if(e instanceof ht){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Yr.create(Ns(r))}return new ht({...e._def,shape:()=>t})}else return e instanceof Cr?new Cr({...e._def,type:Ns(e.element)}):e instanceof Yr?Yr.create(Ns(e.unwrap())):e instanceof ba?ba.create(Ns(e.unwrap())):e instanceof Wr?Wr.create(e.items.map(t=>Ns(t))):e}class ht extends Ne{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Be.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==oe.object){const u=this._getOrReturnCtx(t);return ae(u,{code:Z.invalid_type,expected:oe.object,received:u.parsedType}),be}const{status:r,ctx:i}=this._processInputParams(t),{shape:a,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof Ei&&this._def.unknownKeys==="strip"))for(const u in i.data)o.includes(u)||s.push(u);const l=[];for(const u of o){const c=a[u],d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new $r(i,d,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Ei){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of s)l.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(u==="strict")s.length>0&&(ae(i,{code:Z.unrecognized_keys,keys:s}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of s){const d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new $r(i,d,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of l){const d=await c.key,f=await c.value;u.push({key:d,value:f,alwaysSet:c.alwaysSet})}return u}).then(u=>tn.mergeObjectSync(r,u)):tn.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return pe.errToObj,new ht({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,a,o,s;const l=(o=(a=(i=this._def).errorMap)===null||a===void 0?void 0:a.call(i,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(s=pe.errToObj(t).message)!==null&&s!==void 0?s:l}:{message:l}}}:{}})}strip(){return new ht({...this._def,unknownKeys:"strip"})}passthrough(){return new ht({...this._def,unknownKeys:"passthrough"})}extend(t){return new ht({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ht({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ye.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new ht({...this._def,catchall:t})}pick(t){const n={};return Be.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new ht({...this._def,shape:()=>n})}omit(t){const n={};return Be.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new ht({...this._def,shape:()=>n})}deepPartial(){return Ns(this)}partial(t){const n={};return Be.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new ht({...this._def,shape:()=>n})}required(t){const n={};return Be.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof Yr;)a=a._def.innerType;n[r]=a}}),new ht({...this._def,shape:()=>n})}keyof(){return X3(Be.objectKeys(this.shape))}}ht.create=(e,t)=>new ht({shape:()=>e,unknownKeys:"strip",catchall:Ei.create(),typeName:ye.ZodObject,...Ce(t)}),ht.strictCreate=(e,t)=>new ht({shape:()=>e,unknownKeys:"strict",catchall:Ei.create(),typeName:ye.ZodObject,...Ce(t)}),ht.lazycreate=(e,t)=>new ht({shape:e,unknownKeys:"strip",catchall:Ei.create(),typeName:ye.ZodObject,...Ce(t)});class Ou extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(a){for(const s of a)if(s.result.status==="valid")return s.result;for(const s of a)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const o=a.map(s=>new $n(s.ctx.common.issues));return ae(n,{code:Z.invalid_union,unionErrors:o}),be}if(n.common.async)return Promise.all(r.map(async a=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let a;const o=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},c=l._parseSync({data:n.data,path:n.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!a&&(a={result:c,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(l=>new $n(l));return ae(n,{code:Z.invalid_union,unionErrors:s}),be}}get options(){return this._def.options}}Ou.create=(e,t)=>new Ou({options:e,typeName:ye.ZodUnion,...Ce(t)});const Ti=e=>e instanceof Mu?Ti(e.schema):e instanceof kr?Ti(e.innerType()):e instanceof Fu?[e.value]:e instanceof va?e.options:e instanceof Bu?Be.objectValues(e.enum):e instanceof ju?Ti(e._def.innerType):e instanceof Pu?[void 0]:e instanceof Iu?[null]:e instanceof Yr?[void 0,...Ti(e.unwrap())]:e instanceof ba?[null,...Ti(e.unwrap())]:e instanceof A1||e instanceof Hu?Ti(e.unwrap()):e instanceof Uu?Ti(e._def.innerType):[];class bp extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.object)return ae(n,{code:Z.invalid_type,expected:oe.object,received:n.parsedType}),be;const r=this.discriminator,i=n.data[r],a=this.optionsMap.get(i);return a?n.common.async?a._parseAsync({data:n.data,path:n.path,parent:n}):a._parseSync({data:n.data,path:n.path,parent:n}):(ae(n,{code:Z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),be)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const a of n){const o=Ti(a.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const s of o){if(i.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);i.set(s,a)}}return new bp({typeName:ye.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Ce(r)})}}function k1(e,t){const n=ga(e),r=ga(t);if(e===t)return{valid:!0,data:e};if(n===oe.object&&r===oe.object){const i=Be.objectKeys(t),a=Be.objectKeys(e).filter(s=>i.indexOf(s)!==-1),o={...e,...t};for(const s of a){const l=k1(e[s],t[s]);if(!l.valid)return{valid:!1};o[s]=l.data}return{valid:!0,data:o}}else if(n===oe.array&&r===oe.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let a=0;a<e.length;a++){const o=e[a],s=t[a],l=k1(o,s);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===oe.date&&r===oe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Du extends Ne{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(a,o)=>{if(_1(a)||_1(o))return be;const s=k1(a.value,o.value);return s.valid?((S1(a)||S1(o))&&n.dirty(),{status:n.value,value:s.data}):(ae(r,{code:Z.invalid_intersection_types}),be)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,o])=>i(a,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Du.create=(e,t,n)=>new Du({left:e,right:t,typeName:ye.ZodIntersection,...Ce(n)});class Wr extends Ne{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.array)return ae(r,{code:Z.invalid_type,expected:oe.array,received:r.parsedType}),be;if(r.data.length<this._def.items.length)return ae(r,{code:Z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),be;!this._def.rest&&r.data.length>this._def.items.length&&(ae(r,{code:Z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...r.data].map((o,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new $r(r,o,r.path,s)):null}).filter(o=>!!o);return r.common.async?Promise.all(a).then(o=>tn.mergeArray(n,o)):tn.mergeArray(n,a)}get items(){return this._def.items}rest(t){return new Wr({...this._def,rest:t})}}Wr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Wr({items:e,typeName:ye.ZodTuple,rest:null,...Ce(t)})};class Lu extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.object)return ae(r,{code:Z.invalid_type,expected:oe.object,received:r.parsedType}),be;const i=[],a=this._def.keyType,o=this._def.valueType;for(const s in r.data)i.push({key:a._parse(new $r(r,s,r.path,s)),value:o._parse(new $r(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?tn.mergeObjectAsync(n,i):tn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Ne?new Lu({keyType:t,valueType:n,typeName:ye.ZodRecord,...Ce(r)}):new Lu({keyType:Sr.create(),valueType:t,typeName:ye.ZodRecord,...Ce(n)})}}class xp extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.map)return ae(r,{code:Z.invalid_type,expected:oe.map,received:r.parsedType}),be;const i=this._def.keyType,a=this._def.valueType,o=[...r.data.entries()].map(([s,l],u)=>({key:i._parse(new $r(r,s,r.path,[u,"key"])),value:a._parse(new $r(r,l,r.path,[u,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return be;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(u.value,c.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const l of o){const u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return be;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(u.value,c.value)}return{status:n.value,value:s}}}}xp.create=(e,t,n)=>new xp({valueType:t,keyType:e,typeName:ye.ZodMap,...Ce(n)});class uo extends Ne{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.set)return ae(r,{code:Z.invalid_type,expected:oe.set,received:r.parsedType}),be;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(ae(r,{code:Z.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(ae(r,{code:Z.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const a=this._def.valueType;function o(l){const u=new Set;for(const c of l){if(c.status==="aborted")return be;c.status==="dirty"&&n.dirty(),u.add(c.value)}return{status:n.value,value:u}}const s=[...r.data.values()].map((l,u)=>a._parse(new $r(r,l,r.path,u)));return r.common.async?Promise.all(s).then(l=>o(l)):o(s)}min(t,n){return new uo({...this._def,minSize:{value:t,message:pe.toString(n)}})}max(t,n){return new uo({...this._def,maxSize:{value:t,message:pe.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}uo.create=(e,t)=>new uo({valueType:e,minSize:null,maxSize:null,typeName:ye.ZodSet,...Ce(t)});class Ps extends Ne{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.function)return ae(n,{code:Z.invalid_type,expected:oe.function,received:n.parsedType}),be;function r(s,l){return gp({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,mp(),ks].filter(u=>!!u),issueData:{code:Z.invalid_arguments,argumentsError:l}})}function i(s,l){return gp({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,mp(),ks].filter(u=>!!u),issueData:{code:Z.invalid_return_type,returnTypeError:l}})}const a={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof Is){const s=this;return dn(async function(...l){const u=new $n([]),c=await s._def.args.parseAsync(l,a).catch(p=>{throw u.addIssue(r(l,p)),u}),d=await Reflect.apply(o,this,c);return await s._def.returns._def.type.parseAsync(d,a).catch(p=>{throw u.addIssue(i(d,p)),u})})}else{const s=this;return dn(function(...l){const u=s._def.args.safeParse(l,a);if(!u.success)throw new $n([r(l,u.error)]);const c=Reflect.apply(o,this,u.data),d=s._def.returns.safeParse(c,a);if(!d.success)throw new $n([i(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Ps({...this._def,args:Wr.create(t).rest(lo.create())})}returns(t){return new Ps({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Ps({args:t||Wr.create([]).rest(lo.create()),returns:n||lo.create(),typeName:ye.ZodFunction,...Ce(r)})}}class Mu extends Ne{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Mu.create=(e,t)=>new Mu({getter:e,typeName:ye.ZodLazy,...Ce(t)});class Fu extends Ne{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ae(n,{received:n.data,code:Z.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:t.data}}get value(){return this._def.value}}Fu.create=(e,t)=>new Fu({value:e,typeName:ye.ZodLiteral,...Ce(t)});function X3(e,t){return new va({values:e,typeName:ye.ZodEnum,...Ce(t)})}class va extends Ne{constructor(){super(...arguments),Au.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ae(n,{expected:Be.joinValues(r),received:n.parsedType,code:Z.invalid_type}),be}if(wp(this,Au)||W3(this,Au,new Set(this._def.values)),!wp(this,Au).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return ae(n,{received:n.data,code:Z.invalid_enum_value,options:r}),be}return dn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return va.create(t,{...this._def,...n})}exclude(t,n=this._def){return va.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Au=new WeakMap,va.create=X3;class Bu extends Ne{constructor(){super(...arguments),Ru.set(this,void 0)}_parse(t){const n=Be.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==oe.string&&r.parsedType!==oe.number){const i=Be.objectValues(n);return ae(r,{expected:Be.joinValues(i),received:r.parsedType,code:Z.invalid_type}),be}if(wp(this,Ru)||W3(this,Ru,new Set(Be.getValidEnumValues(this._def.values))),!wp(this,Ru).has(t.data)){const i=Be.objectValues(n);return ae(r,{received:r.data,code:Z.invalid_enum_value,options:i}),be}return dn(t.data)}get enum(){return this._def.values}}Ru=new WeakMap,Bu.create=(e,t)=>new Bu({values:e,typeName:ye.ZodNativeEnum,...Ce(t)});class Is extends Ne{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.promise&&n.common.async===!1)return ae(n,{code:Z.invalid_type,expected:oe.promise,received:n.parsedType}),be;const r=n.parsedType===oe.promise?n.data:Promise.resolve(n.data);return dn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Is.create=(e,t)=>new Is({type:e,typeName:ye.ZodPromise,...Ce(t)});class kr extends Ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ye.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,a={addIssue:o=>{ae(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const o=i.transform(r.data,a);if(r.common.async)return Promise.resolve(o).then(async s=>{if(n.value==="aborted")return be;const l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?be:l.status==="dirty"||n.value==="dirty"?As(l.value):l});{if(n.value==="aborted")return be;const s=this._def.schema._parseSync({data:o,path:r.path,parent:r});return s.status==="aborted"?be:s.status==="dirty"||n.value==="dirty"?As(s.value):s}}if(i.type==="refinement"){const o=s=>{const l=i.refinement(s,a);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?be:(s.status==="dirty"&&n.dirty(),o(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?be:(s.status==="dirty"&&n.dirty(),o(s.value).then(()=>({status:n.value,value:s.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Cu(o))return o;const s=i.transform(o.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Cu(o)?Promise.resolve(i.transform(o.value,a)).then(s=>({status:n.value,value:s})):o);Be.assertNever(i)}}kr.create=(e,t,n)=>new kr({schema:e,typeName:ye.ZodEffects,effect:t,...Ce(n)}),kr.createWithPreprocess=(e,t,n)=>new kr({schema:t,effect:{type:"preprocess",transform:e},typeName:ye.ZodEffects,...Ce(n)});class Yr extends Ne{_parse(t){return this._getType(t)===oe.undefined?dn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Yr.create=(e,t)=>new Yr({innerType:e,typeName:ye.ZodOptional,...Ce(t)});class ba extends Ne{_parse(t){return this._getType(t)===oe.null?dn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ba.create=(e,t)=>new ba({innerType:e,typeName:ye.ZodNullable,...Ce(t)});class ju extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ju.create=(e,t)=>new ju({innerType:e,typeName:ye.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ce(t)});class Uu extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ku(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new $n(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new $n(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Uu.create=(e,t)=>new Uu({innerType:e,typeName:ye.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ce(t)});class Ep extends Ne{_parse(t){if(this._getType(t)!==oe.nan){const r=this._getOrReturnCtx(t);return ae(r,{code:Z.invalid_type,expected:oe.nan,received:r.parsedType}),be}return{status:"valid",value:t.data}}}Ep.create=e=>new Ep({typeName:ye.ZodNaN,...Ce(e)});const JW=Symbol("zod_brand");class A1 extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class zu extends Ne{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?be:a.status==="dirty"?(n.dirty(),As(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?be:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new zu({in:t,out:n,typeName:ye.ZodPipeline})}}class Hu extends Ne{_parse(t){const n=this._def.innerType._parse(t),r=i=>(Cu(i)&&(i.value=Object.freeze(i.value)),i);return ku(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}Hu.create=(e,t)=>new Hu({innerType:e,typeName:ye.ZodReadonly,...Ce(t)});function Q3(e,t={},n){return e?Rs.create().superRefine((r,i)=>{var a,o;if(!e(r)){const s=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(o=(a=s.fatal)!==null&&a!==void 0?a:n)!==null&&o!==void 0?o:!0,u=typeof s=="string"?{message:s}:s;i.addIssue({code:"custom",...u,fatal:l})}}):Rs.create()}const eY={object:ht.lazycreate};var ye;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ye||(ye={}));const tY=(e,t={message:`Input not instance of ${e.name}`})=>Q3(n=>n instanceof e,t),Z3=Sr.create,J3=wa.create,nY=Ep.create,rY=ya.create,eR=Nu.create,iY=so.create,aY=yp.create,oY=Pu.create,sY=Iu.create,lY=Rs.create,uY=lo.create,cY=Ei.create,dY=vp.create,fY=Cr.create,pY=ht.create,hY=ht.strictCreate,mY=Ou.create,gY=bp.create,wY=Du.create,yY=Wr.create,vY=Lu.create,bY=xp.create,xY=uo.create,EY=Ps.create,TY=Mu.create,_Y=Fu.create,SY=va.create,CY=Bu.create,kY=Is.create,tR=kr.create,AY=Yr.create,RY=ba.create,NY=kr.createWithPreprocess,PY=zu.create;var R1=Object.freeze({__proto__:null,defaultErrorMap:ks,setErrorMap:MW,getErrorMap:mp,makeIssue:gp,EMPTY_PATH:FW,addIssueToContext:ae,ParseStatus:tn,INVALID:be,DIRTY:As,OK:dn,isAborted:_1,isDirty:S1,isValid:Cu,isAsync:ku,get util(){return Be},get objectUtil(){return T1},ZodParsedType:oe,getParsedType:ga,ZodType:Ne,datetimeRegex:K3,ZodString:Sr,ZodNumber:wa,ZodBigInt:ya,ZodBoolean:Nu,ZodDate:so,ZodSymbol:yp,ZodUndefined:Pu,ZodNull:Iu,ZodAny:Rs,ZodUnknown:lo,ZodNever:Ei,ZodVoid:vp,ZodArray:Cr,ZodObject:ht,ZodUnion:Ou,ZodDiscriminatedUnion:bp,ZodIntersection:Du,ZodTuple:Wr,ZodRecord:Lu,ZodMap:xp,ZodSet:uo,ZodFunction:Ps,ZodLazy:Mu,ZodLiteral:Fu,ZodEnum:va,ZodNativeEnum:Bu,ZodPromise:Is,ZodEffects:kr,ZodTransformer:kr,ZodOptional:Yr,ZodNullable:ba,ZodDefault:ju,ZodCatch:Uu,ZodNaN:Ep,BRAND:JW,ZodBranded:A1,ZodPipeline:zu,ZodReadonly:Hu,custom:Q3,Schema:Ne,ZodSchema:Ne,late:eY,get ZodFirstPartyTypeKind(){return ye},coerce:{string:e=>Sr.create({...e,coerce:!0}),number:e=>wa.create({...e,coerce:!0}),boolean:e=>Nu.create({...e,coerce:!0}),bigint:e=>ya.create({...e,coerce:!0}),date:e=>so.create({...e,coerce:!0})},any:lY,array:fY,bigint:rY,boolean:eR,date:iY,discriminatedUnion:gY,effect:tR,enum:SY,function:EY,instanceof:tY,intersection:wY,lazy:TY,literal:_Y,map:bY,nan:nY,nativeEnum:CY,never:cY,null:sY,nullable:RY,number:J3,object:pY,oboolean:()=>eR().optional(),onumber:()=>J3().optional(),optional:AY,ostring:()=>Z3().optional(),pipeline:PY,preprocess:NY,promise:kY,record:vY,set:xY,strictObject:hY,string:Z3,symbol:aY,transformer:tR,tuple:yY,undefined:oY,union:mY,unknown:uY,void:dY,NEVER:be,ZodIssueCode:Z,quotelessJson:LW,ZodError:$n});const N1=y.forwardRef(({className:e,type:t,...n},r)=>T.jsx(Xf,{ref:r,children:T.jsx("input",{type:t,className:Me("flex w-full rounded-xl border border-input bg-background p-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-primary-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 transition",e),...n})}));N1.displayName="Input";const IY=R1.object({name:R1.string().min(2),email:R1.string().email()});function OY(){var s,l,u;const{contactCtx:e}=ZT(),t=bl(),n=Kf(),{data:r}=fg(),{observedElementRef:i}=V3({fallbackHeight:GO}),[a,o]=Q9(async c=>{c.preventDefault();const d=new FormData(c.currentTarget),f=Object.fromEntries(d.entries()),p=IY.safeParse(f);p.success&&await e.createUnverifiedContact({email:p.data.email,name:p.data.name})});return T.jsxs("div",{ref:i,"data-test":"welcome-screen",className:Me(hh.widgetMinHeight,"h-fit bg-primary rounded-3xl flex flex-col"),children:[T.jsxs("div",{className:"flex-1 flex flex-col px-4 py-12 text-start space-y-4 relative z-10","data-test":"welcome-header",children:[T.jsx("div",{className:"flex items-center justify-between w-full mb-2","data-test":"welcome-logo-container",children:(s=t.assets)!=null&&s.organizationLogo?T.jsx("img",{src:(l=t.assets)==null?void 0:l.organizationLogo,alt:"Company Logo",className:"h-8 w-auto object-contain","data-test":"organization-logo"}):T.jsx("h2",{className:"font-bold text-xl text-primary-foreground","data-test":"organization-name",children:(u=r==null?void 0:r.data)==null?void 0:u.organizationName})}),T.jsxs("div",{className:"space-y-2","data-test":"welcome-content",children:[T.jsx("h1",{className:"text-2xl font-bold text-primary-foreground","data-test":"welcome-title",children:n.get("welcome-title")}),T.jsx("p",{className:"text-primary-foreground/90 text-sm max-w-[320px] leading-relaxed","data-test":"welcome-description",children:n.get("welcome-description")})]})]}),T.jsx("div",{className:"p-2 bg-background rounded-3xl","data-test":"welcome-form-container",children:T.jsxs("form",{onSubmit:o,className:"space-y-2","data-test":"welcome-form",children:[T.jsxs("div",{className:"space-y-2",children:[T.jsx(N1,{required:!0,dir:"auto",autoFocus:!0,placeholder:n.get("your-name"),name:"name",className:"rounded-3xl pl-3","data-test":"name-input"}),T.jsx(N1,{required:!0,dir:"auto",type:"email",placeholder:n.get("your-email"),name:"email",className:"rounded-3xl pl-3","data-test":"email-input"})]}),T.jsxs(pa,{disabled:a.loading,className:"w-full rounded-3xl","data-test":"start-chat-button",children:[a.loading?n.get("starting-chat"):n.get("start-chat"),T.jsx(aE,{className:"size-4"})]})]})})]})}function DY(){const{contactCtx:e}=ZT(),t=e.shouldCollectData();return T.jsx("div",{className:"bg-background size-full","data-test":"root-screen",children:T.jsx(fl,{mode:"wait",children:t?T.jsx(xi,{fadeIn:"right",className:"size-full",snapExit:!0,"data-test":"welcome-screen-container",children:T.jsx(OY,{})},"welcome-screen"):T.jsx(xi,{fadeIn:"right",className:"size-full",snapExit:!0,"data-test":"chat-screen-container",children:T.jsx(DW,{})},"chat-screen")})})}var P1="focusScope.autoFocusOnMount",I1="focusScope.autoFocusOnUnmount",nR={bubbles:!1,cancelable:!0},LY="FocusScope",rR=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,l]=y.useState(null),u=Wt(i),c=Wt(a),d=y.useRef(null),f=Mr(t,g=>l(g)),p=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let g=function(b){if(p.paused||!s)return;const E=b.target;s.contains(E)?d.current=E:xa(d.current,{select:!0})},x=function(b){if(p.paused||!s)return;const E=b.relatedTarget;E!==null&&(s.contains(E)||xa(d.current,{select:!0}))},w=function(b){if(document.activeElement===document.body)for(const _ of b)_.removedNodes.length>0&&xa(s)};document.addEventListener("focusin",g),document.addEventListener("focusout",x);const v=new MutationObserver(w);return s&&v.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",x),v.disconnect()}}},[r,s,p.paused]),y.useEffect(()=>{if(s){oR.add(p);const g=document.activeElement;if(!s.contains(g)){const w=new CustomEvent(P1,nR);s.addEventListener(P1,u),s.dispatchEvent(w),w.defaultPrevented||(MY(zY(iR(s)),{select:!0}),document.activeElement===g&&xa(s))}return()=>{s.removeEventListener(P1,u),setTimeout(()=>{const w=new CustomEvent(I1,nR);s.addEventListener(I1,c),s.dispatchEvent(w),w.defaultPrevented||xa(g??document.body,{select:!0}),s.removeEventListener(I1,c),oR.remove(p)},0)}}},[s,u,c,p]);const m=y.useCallback(g=>{if(!n&&!r||p.paused)return;const x=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,w=document.activeElement;if(x&&w){const v=g.currentTarget,[b,E]=FY(v);b&&E?!g.shiftKey&&w===E?(g.preventDefault(),n&&xa(b,{select:!0})):g.shiftKey&&w===b&&(g.preventDefault(),n&&xa(E,{select:!0})):w===v&&g.preventDefault()}},[n,r,p.paused]);return T.jsx(zn.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});rR.displayName=LY;function MY(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(xa(r,{select:t}),document.activeElement!==n)return}function FY(e){const t=iR(e),n=aR(t,e),r=aR(t.reverse(),e);return[n,r]}function iR(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function aR(e,t){for(const n of e)if(!BY(n,{upTo:t}))return n}function BY(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function jY(e){return e instanceof HTMLInputElement&&"select"in e}function xa(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&jY(e)&&t&&e.select()}}var oR=UY();function UY(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=sR(e,t),e.unshift(t)},remove(t){var n;e=sR(e,t),(n=e[0])==null||n.resume()}}}function sR(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function zY(e){return e.filter(t=>t.tagName!=="A")}var Tp="right-scroll-bar-position",_p="width-before-scroll-bar",HY="with-scroll-bars-hidden",VY="--removed-body-scroll-bar-size";function O1(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function $Y(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var WY=typeof window<"u"?y.useLayoutEffect:y.useEffect,lR=new WeakMap;function YY(e,t){var n=$Y(null,function(r){return e.forEach(function(i){return O1(i,r)})});return WY(function(){var r=lR.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;i.forEach(function(s){a.has(s)||O1(s,null)}),a.forEach(function(s){i.has(s)||O1(s,o)})}lR.set(n,e)},[e]),n}var uR=bA(),D1=function(){},Sp=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:D1,onWheelCapture:D1,onTouchMoveCapture:D1}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,c=e.enabled,d=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,g=e.allowPinchZoom,x=e.as,w=x===void 0?"div":x,v=e.gapMode,b=pl(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=f,_=YY([n,t]),S=Ot(Ot({},b),i);return y.createElement(y.Fragment,null,c&&y.createElement(E,{sideCar:uR,removeScrollBar:u,shards:d,noIsolation:p,inert:m,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:v}),o?y.cloneElement(y.Children.only(s),Ot(Ot({},S),{ref:_})):y.createElement(w,Ot({},S,{className:l,ref:_}),s))});Sp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Sp.classNames={fullWidth:_p,zeroRight:Tp};var qY={left:0,top:0,right:0,gap:0},L1=function(e){return parseInt(e||"",10)||0},GY=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[L1(n),L1(r),L1(i)]},KY=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return qY;var t=GY(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},XY=s1(),Os="data-scroll-locked",QY=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n="margin"),`
|
|
371
|
+
`)},dV=0,Ss=[];function fV(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),i=y.useState(dV++)[0],a=y.useState(s1)[0],o=y.useRef(e);y.useEffect(function(){o.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var g=Wc([e.lockRef.current],(e.shards||[]).map(PA),!0).filter(Boolean);return g.forEach(function(x){return x.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),g.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=y.useCallback(function(g,x){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!o.current.allowPinchZoom;var w=sp(g),v=n.current,b="deltaX"in g?g.deltaX:v[0]-w[0],E="deltaY"in g?g.deltaY:v[1]-w[1],_,S=g.target,I=Math.abs(b)>Math.abs(E)?"h":"v";if("touches"in g&&I==="h"&&S.type==="range")return!1;var D=kA(I,S);if(!D)return!0;if(D?_=I:(_=I==="v"?"h":"v",D=kA(I,S)),!D)return!1;if(!r.current&&"changedTouches"in g&&(b||E)&&(r.current=_),!_)return!0;var V=r.current||_;return lV(V,x,g,V==="h"?b:E,!0)},[]),l=y.useCallback(function(g){var x=g;if(!(!Ss.length||Ss[Ss.length-1]!==a)){var w="deltaY"in x?NA(x):sp(x),v=t.current.filter(function(_){return _.name===x.type&&(_.target===x.target||x.target===_.shadowParent)&&uV(_.delta,w)})[0];if(v&&v.should){x.cancelable&&x.preventDefault();return}if(!v){var b=(o.current.shards||[]).map(PA).filter(Boolean).filter(function(_){return _.contains(x.target)}),E=b.length>0?s(x,b[0]):!o.current.noIsolation;E&&x.cancelable&&x.preventDefault()}}},[]),u=y.useCallback(function(g,x,w,v){var b={name:g,delta:x,target:w,should:v,shadowParent:pV(w)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(E){return E!==b})},1)},[]),c=y.useCallback(function(g){n.current=sp(g),r.current=void 0},[]),d=y.useCallback(function(g){u(g.type,NA(g),g.target,s(g,e.lockRef.current))},[]),f=y.useCallback(function(g){u(g.type,sp(g),g.target,s(g,e.lockRef.current))},[]);y.useEffect(function(){return Ss.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,_s),document.addEventListener("touchmove",l,_s),document.addEventListener("touchstart",c,_s),function(){Ss=Ss.filter(function(g){return g!==a}),document.removeEventListener("wheel",l,_s),document.removeEventListener("touchmove",l,_s),document.removeEventListener("touchstart",c,_s)}},[]);var p=e.removeScrollBar,m=e.inert;return y.createElement(y.Fragment,null,m?y.createElement(a,{styles:cV(i)}):null,p?y.createElement(XH,{gapMode:e.gapMode}):null)}function pV(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const hV=EA(TA,fV);var IA=y.forwardRef(function(e,t){return y.createElement(ap,Ot({},e,{ref:t,sideCar:hV}))});IA.classNames=ap.classNames;var u1=["Enter"," "],mV=["ArrowDown","PageUp","Home"],OA=["ArrowUp","PageDown","End"],gV=[...mV,...OA],wV={ltr:[...u1,"ArrowRight"],rtl:[...u1,"ArrowLeft"]},yV={ltr:["ArrowLeft"],rtl:["ArrowRight"]},vu="Menu",[bu,vV,bV]=jk(vu),[oo,DA]=Ui(vu,[bV,nA,fA]),lp=nA(),LA=fA(),[xV,Cs]=oo(vu),[EV,xu]=oo(vu),MA=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=lp(t),[l,u]=y.useState(null),c=y.useRef(!1),d=Wt(a),f=Uk(i);return y.useEffect(()=>{const p=()=>{c.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>c.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),T.jsx(uH,{...s,children:T.jsx(xV,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:u,children:T.jsx(EV,{scope:t,onClose:y.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:c,dir:f,modal:o,children:r})})})};MA.displayName=vu;var TV="MenuAnchor",c1=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=lp(n);return T.jsx(cH,{...i,...r,ref:t})});c1.displayName=TV;var _V="MenuPortal",[Uie,FA]=oo(_V,{forceMount:void 0}),ar="MenuContent",[SV,d1]=oo(ar),BA=y.forwardRef((e,t)=>{const n=FA(ar,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Cs(ar,e.__scopeMenu),o=xu(ar,e.__scopeMenu);return T.jsx(bu.Provider,{scope:e.__scopeMenu,children:T.jsx(Zf,{present:r||a.open,children:T.jsx(bu.Slot,{scope:e.__scopeMenu,children:o.modal?T.jsx(CV,{...i,ref:t}):T.jsx(kV,{...i,ref:t})})})})}),CV=y.forwardRef((e,t)=>{const n=Cs(ar,e.__scopeMenu),r=y.useRef(null),i=Sn(t,r);return y.useEffect(()=>{const a=r.current;if(a)return yA(a)},[]),T.jsx(f1,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Fe(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),kV=y.forwardRef((e,t)=>{const n=Cs(ar,e.__scopeMenu);return T.jsx(f1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),f1=y.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...g}=e,x=Cs(ar,n),w=xu(ar,n),v=lp(n),b=LA(n),E=vV(n),[_,S]=y.useState(null),I=y.useRef(null),D=Sn(t,I,x.onContentChange),V=y.useRef(0),N=y.useRef(""),$=y.useRef(0),z=y.useRef(null),X=y.useRef("right"),Y=y.useRef(0),ne=m?IA:y.Fragment,re=m?{as:yu,allowPinchZoom:!0}:void 0,ee=B=>{var $e,Ve;const k=N.current+B,ie=E().filter(We=>!We.disabled),he=document.activeElement,O=($e=ie.find(We=>We.ref.current===he))==null?void 0:$e.textValue,Pe=ie.map(We=>We.textValue),ge=jV(Pe,k,O),ve=(Ve=ie.find(We=>We.textValue===ge))==null?void 0:Ve.ref.current;(function We(Ge){N.current=Ge,window.clearTimeout(V.current),Ge!==""&&(V.current=window.setTimeout(()=>We(""),1e3))})(k),ve&&setTimeout(()=>ve.focus())};y.useEffect(()=>()=>window.clearTimeout(V.current),[]),Yk();const F=y.useCallback(B=>{var ie,he;return X.current===((ie=z.current)==null?void 0:ie.side)&&zV(B,(he=z.current)==null?void 0:he.area)},[]);return T.jsx(SV,{scope:n,searchRef:N,onItemEnter:y.useCallback(B=>{F(B)&&B.preventDefault()},[F]),onItemLeave:y.useCallback(B=>{var k;F(B)||((k=I.current)==null||k.focus(),S(null))},[F]),onTriggerLeave:y.useCallback(B=>{F(B)&&B.preventDefault()},[F]),pointerGraceTimerRef:$,onPointerGraceIntentChange:y.useCallback(B=>{z.current=B},[]),children:T.jsx(ne,{...re,children:T.jsx(Kk,{asChild:!0,trapped:i,onMountAutoFocus:Fe(a,B=>{var k;B.preventDefault(),(k=I.current)==null||k.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:T.jsx(Vk,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:T.jsx(CH,{asChild:!0,...b,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:_,onCurrentTabStopIdChange:S,onEntryFocus:Fe(l,B=>{w.isUsingKeyboardRef.current||B.preventDefault()}),preventScrollOnEntryFocus:!0,children:T.jsx(dH,{role:"menu","aria-orientation":"vertical","data-state":t3(x.open),"data-radix-menu-content":"",dir:w.dir,...v,...g,ref:D,style:{outline:"none",...g.style},onKeyDown:Fe(g.onKeyDown,B=>{const ie=B.target.closest("[data-radix-menu-content]")===B.currentTarget,he=B.ctrlKey||B.altKey||B.metaKey,O=B.key.length===1;ie&&(B.key==="Tab"&&B.preventDefault(),!he&&O&&ee(B.key));const Pe=I.current;if(B.target!==Pe||!gV.includes(B.key))return;B.preventDefault();const ve=E().filter($e=>!$e.disabled).map($e=>$e.ref.current);OA.includes(B.key)&&ve.reverse(),FV(ve)}),onBlur:Fe(e.onBlur,B=>{B.currentTarget.contains(B.target)||(window.clearTimeout(V.current),N.current="")}),onPointerMove:Fe(e.onPointerMove,Tu(B=>{const k=B.target,ie=Y.current!==B.clientX;if(B.currentTarget.contains(k)&&ie){const he=B.clientX>Y.current?"right":"left";X.current=he,Y.current=B.clientX}}))})})})})})})});BA.displayName=ar;var AV="MenuGroup",p1=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return T.jsx(Cn.div,{role:"group",...r,ref:t})});p1.displayName=AV;var RV="MenuLabel",jA=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return T.jsx(Cn.div,{...r,ref:t})});jA.displayName=RV;var up="MenuItem",UA="menu.itemSelect",cp=y.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,a=y.useRef(null),o=xu(up,e.__scopeMenu),s=d1(up,e.__scopeMenu),l=Sn(t,a),u=y.useRef(!1),c=()=>{const d=a.current;if(!n&&d){const f=new CustomEvent(UA,{bubbles:!0,cancelable:!0});d.addEventListener(UA,p=>r==null?void 0:r(p),{once:!0}),Bk(d,f),f.defaultPrevented?u.current=!1:o.onClose()}};return T.jsx(zA,{...i,ref:l,disabled:n,onClick:Fe(e.onClick,c),onPointerDown:d=>{var f;(f=e.onPointerDown)==null||f.call(e,d),u.current=!0},onPointerUp:Fe(e.onPointerUp,d=>{var f;u.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:Fe(e.onKeyDown,d=>{const f=s.searchRef.current!=="";n||f&&d.key===" "||u1.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});cp.displayName=up;var zA=y.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=d1(up,n),s=LA(n),l=y.useRef(null),u=Sn(t,l),[c,d]=y.useState(!1),[f,p]=y.useState("");return y.useEffect(()=>{const m=l.current;m&&p((m.textContent??"").trim())},[a.children]),T.jsx(bu.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:T.jsx(kH,{asChild:!0,...s,focusable:!r,children:T.jsx(Cn.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:u,onPointerMove:Fe(e.onPointerMove,Tu(m=>{r?o.onItemLeave(m):(o.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Fe(e.onPointerLeave,Tu(m=>o.onItemLeave(m))),onFocus:Fe(e.onFocus,()=>d(!0)),onBlur:Fe(e.onBlur,()=>d(!1))})})})}),NV="MenuCheckboxItem",HA=y.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return T.jsx(qA,{scope:e.__scopeMenu,checked:n,children:T.jsx(cp,{role:"menuitemcheckbox","aria-checked":dp(n)?"mixed":n,...i,ref:t,"data-state":m1(n),onSelect:Fe(i.onSelect,()=>r==null?void 0:r(dp(n)?!0:!n),{checkForDefaultPrevented:!1})})})});HA.displayName=NV;var VA="MenuRadioGroup",[PV,IV]=oo(VA,{value:void 0,onValueChange:()=>{}}),$A=y.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,a=Wt(r);return T.jsx(PV,{scope:e.__scopeMenu,value:n,onValueChange:a,children:T.jsx(p1,{...i,ref:t})})});$A.displayName=VA;var WA="MenuRadioItem",YA=y.forwardRef((e,t)=>{const{value:n,...r}=e,i=IV(WA,e.__scopeMenu),a=n===i.value;return T.jsx(qA,{scope:e.__scopeMenu,checked:a,children:T.jsx(cp,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":m1(a),onSelect:Fe(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});YA.displayName=WA;var h1="MenuItemIndicator",[qA,OV]=oo(h1,{checked:!1}),GA=y.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,a=OV(h1,n);return T.jsx(Zf,{present:r||dp(a.checked)||a.checked===!0,children:T.jsx(Cn.span,{...i,ref:t,"data-state":m1(a.checked)})})});GA.displayName=h1;var DV="MenuSeparator",KA=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return T.jsx(Cn.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});KA.displayName=DV;var LV="MenuArrow",XA=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=lp(n);return T.jsx(fH,{...i,...r,ref:t})});XA.displayName=LV;var MV="MenuSub",[zie,QA]=oo(MV),Eu="MenuSubTrigger",ZA=y.forwardRef((e,t)=>{const n=Cs(Eu,e.__scopeMenu),r=xu(Eu,e.__scopeMenu),i=QA(Eu,e.__scopeMenu),a=d1(Eu,e.__scopeMenu),o=y.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=a,u={__scopeMenu:e.__scopeMenu},c=y.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return y.useEffect(()=>c,[c]),y.useEffect(()=>{const d=s.current;return()=>{window.clearTimeout(d),l(null)}},[s,l]),T.jsx(c1,{asChild:!0,...u,children:T.jsx(zA,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":t3(n.open),...e,ref:Qf(t,i.onTriggerChange),onClick:d=>{var f;(f=e.onClick)==null||f.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Fe(e.onPointerMove,Tu(d=>{a.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),c()},100))})),onPointerLeave:Fe(e.onPointerLeave,Tu(d=>{var p,m;c();const f=(p=n.content)==null?void 0:p.getBoundingClientRect();if(f){const g=(m=n.content)==null?void 0:m.dataset.side,x=g==="right",w=x?-5:5,v=f[x?"left":"right"],b=f[x?"right":"left"];a.onPointerGraceIntentChange({area:[{x:d.clientX+w,y:d.clientY},{x:v,y:f.top},{x:b,y:f.top},{x:b,y:f.bottom},{x:v,y:f.bottom}],side:g}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(d),d.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Fe(e.onKeyDown,d=>{var p;const f=a.searchRef.current!=="";e.disabled||f&&d.key===" "||wV[r.dir].includes(d.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),d.preventDefault())})})})});ZA.displayName=Eu;var JA="MenuSubContent",e3=y.forwardRef((e,t)=>{const n=FA(ar,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Cs(ar,e.__scopeMenu),o=xu(ar,e.__scopeMenu),s=QA(JA,e.__scopeMenu),l=y.useRef(null),u=Sn(t,l);return T.jsx(bu.Provider,{scope:e.__scopeMenu,children:T.jsx(Zf,{present:r||a.open,children:T.jsx(bu.Slot,{scope:e.__scopeMenu,children:T.jsx(f1,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:c=>{var d;o.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),c.preventDefault()},onCloseAutoFocus:c=>c.preventDefault(),onFocusOutside:Fe(e.onFocusOutside,c=>{c.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Fe(e.onEscapeKeyDown,c=>{o.onClose(),c.preventDefault()}),onKeyDown:Fe(e.onKeyDown,c=>{var p;const d=c.currentTarget.contains(c.target),f=yV[o.dir].includes(c.key);d&&f&&(a.onOpenChange(!1),(p=s.trigger)==null||p.focus(),c.preventDefault())})})})})})});e3.displayName=JA;function t3(e){return e?"open":"closed"}function dp(e){return e==="indeterminate"}function m1(e){return dp(e)?"indeterminate":e?"checked":"unchecked"}function FV(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function BV(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function jV(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=BV(e,Math.max(a,0));i.length===1&&(o=o.filter(u=>u!==n));const l=o.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function UV(e,t){const{x:n,y:r}=e;let i=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const s=t[a].x,l=t[a].y,u=t[o].x,c=t[o].y;l>r!=c>r&&n<(u-s)*(r-l)/(c-l)+s&&(i=!i)}return i}function zV(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return UV(n,t)}function Tu(e){return t=>t.pointerType==="mouse"?e(t):void 0}var HV=MA,VV=c1,$V=BA,WV=p1,YV=jA,qV=cp,GV=HA,KV=$A,XV=YA,QV=GA,ZV=KA,JV=XA,e$=ZA,t$=e3,g1="DropdownMenu",[n$,Hie]=Ui(g1,[DA]),kn=DA(),[r$,n3]=n$(g1),r3=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,l=kn(t),u=y.useRef(null),[c=!1,d]=$f({prop:i,defaultProp:a,onChange:o});return T.jsx(r$,{scope:t,triggerId:fu(),triggerRef:u,contentId:fu(),open:c,onOpenChange:d,onOpenToggle:y.useCallback(()=>d(f=>!f),[d]),modal:s,children:T.jsx(HV,{...l,open:c,onOpenChange:d,dir:r,modal:s,children:n})})};r3.displayName=g1;var i3="DropdownMenuTrigger",a3=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=n3(i3,n),o=kn(n);return T.jsx(VV,{asChild:!0,...o,children:T.jsx(Cn.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:Qf(t,a.triggerRef),onPointerDown:Fe(e.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(a.onOpenToggle(),a.open||s.preventDefault())}),onKeyDown:Fe(e.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&a.onOpenToggle(),s.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});a3.displayName=i3;var o3="DropdownMenuContent",s3=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=n3(o3,n),a=kn(n),o=y.useRef(!1);return T.jsx($V,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:Fe(e.onCloseAutoFocus,s=>{var l;o.current||(l=i.triggerRef.current)==null||l.focus(),o.current=!1,s.preventDefault()}),onInteractOutside:Fe(e.onInteractOutside,s=>{const l=s.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,c=l.button===2||u;(!i.modal||c)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});s3.displayName=o3;var i$="DropdownMenuGroup",l3=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return T.jsx(WV,{...i,...r,ref:t})});l3.displayName=i$;var a$="DropdownMenuLabel",u3=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return T.jsx(YV,{...i,...r,ref:t})});u3.displayName=a$;var o$="DropdownMenuItem",c3=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return T.jsx(qV,{...i,...r,ref:t})});c3.displayName=o$;var s$="DropdownMenuCheckboxItem",d3=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return T.jsx(GV,{...i,...r,ref:t})});d3.displayName=s$;var l$="DropdownMenuRadioGroup",u$=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return T.jsx(KV,{...i,...r,ref:t})});u$.displayName=l$;var c$="DropdownMenuRadioItem",f3=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return T.jsx(XV,{...i,...r,ref:t})});f3.displayName=c$;var d$="DropdownMenuItemIndicator",p3=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return T.jsx(QV,{...i,...r,ref:t})});p3.displayName=d$;var f$="DropdownMenuSeparator",h3=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return T.jsx(ZV,{...i,...r,ref:t})});h3.displayName=f$;var p$="DropdownMenuArrow",h$=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return T.jsx(JV,{...i,...r,ref:t})});h$.displayName=p$;var m$="DropdownMenuSubTrigger",m3=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return T.jsx(e$,{...i,...r,ref:t})});m3.displayName=m$;var g$="DropdownMenuSubContent",g3=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return T.jsx(t$,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});g3.displayName=g$;var w$=r3,y$=a3,w3=s3,v$=l3,y3=u3,v3=c3,b3=d3,x3=f3,E3=p3,T3=h3,_3=m3,S3=g3;const b$=w$,x$=y$,E$=v$,T$=y.forwardRef(({className:e,inset:t,children:n,...r},i)=>T.jsxs(_3,{ref:i,className:Me("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r,children:[n,T.jsx(_L,{className:"ml-auto"})]}));T$.displayName=_3.displayName;const _$=y.forwardRef(({className:e,...t},n)=>T.jsx(S3,{ref:n,className:Me("z-50 min-w-[8rem] overflow-hidden rounded-2xl border bg-background p-1 text-foreground shadow-2xl 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",e),...t}));_$.displayName=S3.displayName;const C3=y.forwardRef(({className:e,sideOffset:t=4,...n},r)=>T.jsx(w3,{ref:r,sideOffset:t,className:Me("z-50 min-w-[8rem] overflow-hidden rounded-2xl border bg-background p-1 text-foreground shadow-2xl","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",e),...n}));C3.displayName=w3.displayName;const k3=y.forwardRef(({className:e,inset:t,...n},r)=>T.jsx(xi,{children:T.jsx(v3,{ref:r,className:Me("relative flex cursor-default select-none items-center gap-2 rounded-xl px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n})}));k3.displayName=v3.displayName;const S$=y.forwardRef(({className:e,children:t,checked:n,...r},i)=>T.jsxs(b3,{ref:i,className:Me("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[T.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:T.jsx(E3,{children:T.jsx(TL,{className:"h-4 w-4"})})}),t]}));S$.displayName=b3.displayName;const C$=y.forwardRef(({className:e,children:t,...n},r)=>T.jsxs(x3,{ref:r,className:Me("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[T.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:T.jsx(E3,{children:T.jsx(kL,{className:"h-2 w-2 fill-current"})})}),t]}));C$.displayName=x3.displayName;const k$=y.forwardRef(({className:e,inset:t,...n},r)=>T.jsx(y3,{ref:r,className:Me("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));k$.displayName=y3.displayName;const A$=y.forwardRef(({className:e,...t},n)=>T.jsx(T3,{ref:n,className:Me("-mx-1 my-1 h-px bg-muted",e),...t}));A$.displayName=T3.displayName;function R$({className:e,...t}){return T.jsx("div",{className:Me("animate-pulse rounded-md bg-secondary",e),...t})}function N$(){const e=Kf(),[t,n]=y.useState(!1),{widgetCtx:r}=Qn();return T.jsxs(b$,{open:t,onOpenChange:n,children:[T.jsx(x$,{asChild:!0,children:T.jsx(pa,{variant:"ghost",size:"fit",className:"rounded-full",children:T.jsx(AL,{className:"size-4"})})}),T.jsx(C3,{align:"end",className:"min-w-56",children:T.jsx(E$,{children:T.jsxs(k3,{onSelect:()=>{r.resetChat(),n(!1)},children:[T.jsx(Ua.div,{initial:{opacity:0,x:-4,rotate:360},animate:{opacity:1,x:0,rotate:0},children:T.jsx(OL,{})}),e.get("reset-conversation")]})})})]})}function P$(){var n;const{data:e,isLoading:t}=fg();return T.jsx("header",{className:"p-2 border-b bg-background",children:T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("div",{className:"flex-1 pl-2",children:t?T.jsx(R$,{className:"h-4 w-2/3"}):T.jsx("h2",{className:"font-semibold",children:(n=e==null?void 0:e.data)==null?void 0:n.organizationName})}),T.jsx(N$,{})]})})}function I$(e){const t=[];let n=null;return e.forEach(r=>{var i,a,o,s;(!n||((i=n[0])==null?void 0:i.type)!==r.type)&&(n=[],t.push(n)),((a=n[0])==null?void 0:a.type)==="FROM_AGENT"&&r.type==="FROM_AGENT"&&((o=r.agent)==null?void 0:o.id)!==((s=n[0].agent)==null?void 0:s.id)&&(n=[],t.push(n)),n.push(r)}),t}function O$(e){var t;return((t=e==null?void 0:e[0])==null?void 0:t.type)==="FROM_USER"}function D$(e){var t;return((t=e==null?void 0:e[0])==null?void 0:t.type)==="FROM_BOT"}function L$(e){var t;return((t=e==null?void 0:e[0])==null?void 0:t.type)==="FROM_AGENT"}function w1({message:e,Wrapper:t,wrapperProps:n}){const{componentStore:r}=Qn(),i=r.getComponent(e.component,!1);return i?t?y.createElement(t,{...n,key:e.id,"data-test":`message-wrapper-${e.id}`},T.jsx(i,{...e,id:e.id})):T.jsx("div",{"data-test":`message-${e.id}`,children:y.createElement(i,{...e,id:e.id,key:e.id})}):null}function y1({children:e,className:t,messageId:n}){return T.jsx("div",{className:Me("w-fit space-y-2",t),"data-test":`message-wrapper-${n}`,children:T.jsx("div",{"data-test":"message-content-wrapper",className:Me("w-fit p-2 rounded-2xl text-sm","bg-secondary border shadow-sm"),children:e})})}const fp=43200,A3=1440,R3=Symbol.for("constructDateFrom");function N3(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&R3 in e?e[R3](t):e instanceof Date?new e.constructor(t):new Date(t)}function ma(e,t){return N3(e,e)}let M$={};function F$(){return M$}function P3(e){const t=ma(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function v1(e,...t){const n=N3.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function pp(e,t){const n=+ma(e)-+ma(t);return n<0?-1:n>0?1:n}function B$(e,t,n){const[r,i]=v1(n==null?void 0:n.in,e,t),a=r.getFullYear()-i.getFullYear(),o=r.getMonth()-i.getMonth();return a*12+o}function j$(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function U$(e,t){return+ma(e)-+ma(t)}function z$(e,t){const n=ma(e);return n.setHours(23,59,59,999),n}function H$(e,t){const n=ma(e),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function V$(e,t){const n=ma(e);return+z$(n)==+H$(n)}function $$(e,t,n){const[r,i,a]=v1(n==null?void 0:n.in,e,e,t),o=pp(i,a),s=Math.abs(B$(i,a));if(s<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-o*s);let l=pp(i,a)===-o;V$(r)&&s===1&&pp(r,a)===1&&(l=!1);const u=o*(s-+l);return u===0?0:u}function W$(e,t,n){const r=U$(e,t)/1e3;return j$(n==null?void 0:n.roundingMethod)(r)}const Y$={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},q$=(e,t,n)=>{let r;const i=Y$[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function b1(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const G$={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},K$={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},X$={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Q$={date:b1({formats:G$,defaultWidth:"full"}),time:b1({formats:K$,defaultWidth:"full"}),dateTime:b1({formats:X$,defaultWidth:"full"})},Z$={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},J$=(e,t,n,r)=>Z$[e];function _u(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,s=n!=null&&n.width?String(n.width):o;i=e.formattingValues[s]||e.formattingValues[o]}else{const o=e.defaultWidth,s=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[s]||e.values[o]}const a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}const eW={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},tW={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},nW={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},rW={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},iW={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},aW={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},oW={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:_u({values:eW,defaultWidth:"wide"}),quarter:_u({values:tW,defaultWidth:"wide",argumentCallback:e=>e-1}),month:_u({values:nW,defaultWidth:"wide"}),day:_u({values:rW,defaultWidth:"wide"}),dayPeriod:_u({values:iW,defaultWidth:"wide",formattingValues:aW,defaultFormattingWidth:"wide"})};function Su(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;const o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?lW(s,d=>d.test(o)):sW(s,d=>d.test(o));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const c=t.slice(o.length);return{value:u,rest:c}}}function sW(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function lW(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function uW(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;const s=t.slice(i.length);return{value:o,rest:s}}}const cW=/^(\d+)(th|st|nd|rd)?/i,dW=/\d+/i,fW={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},pW={any:[/^b/i,/^(a|c)/i]},hW={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},mW={any:[/1/i,/2/i,/3/i,/4/i]},gW={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},wW={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},yW={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},vW={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},bW={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},xW={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},EW={ordinalNumber:uW({matchPattern:cW,parsePattern:dW,valueCallback:e=>parseInt(e,10)}),era:Su({matchPatterns:fW,defaultMatchWidth:"wide",parsePatterns:pW,defaultParseWidth:"any"}),quarter:Su({matchPatterns:hW,defaultMatchWidth:"wide",parsePatterns:mW,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Su({matchPatterns:gW,defaultMatchWidth:"wide",parsePatterns:wW,defaultParseWidth:"any"}),day:Su({matchPatterns:yW,defaultMatchWidth:"wide",parsePatterns:vW,defaultParseWidth:"any"}),dayPeriod:Su({matchPatterns:bW,defaultMatchWidth:"any",parsePatterns:xW,defaultParseWidth:"any"})},TW={code:"en-US",formatDistance:q$,formatLong:Q$,formatRelative:J$,localize:oW,match:EW,options:{weekStartsOn:0,firstWeekContainsDate:1}};function _W(e,t,n){const r=F$(),i=(n==null?void 0:n.locale)??r.locale??TW,a=2520,o=pp(e,t);if(isNaN(o))throw new RangeError("Invalid time value");const s=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:o}),[l,u]=v1(n==null?void 0:n.in,...o>0?[t,e]:[e,t]),c=W$(u,l),d=(P3(u)-P3(l))/1e3,f=Math.round((c-d)/60);let p;if(f<2)return n!=null&&n.includeSeconds?c<5?i.formatDistance("lessThanXSeconds",5,s):c<10?i.formatDistance("lessThanXSeconds",10,s):c<20?i.formatDistance("lessThanXSeconds",20,s):c<40?i.formatDistance("halfAMinute",0,s):c<60?i.formatDistance("lessThanXMinutes",1,s):i.formatDistance("xMinutes",1,s):f===0?i.formatDistance("lessThanXMinutes",1,s):i.formatDistance("xMinutes",f,s);if(f<45)return i.formatDistance("xMinutes",f,s);if(f<90)return i.formatDistance("aboutXHours",1,s);if(f<A3){const m=Math.round(f/60);return i.formatDistance("aboutXHours",m,s)}else{if(f<a)return i.formatDistance("xDays",1,s);if(f<fp){const m=Math.round(f/A3);return i.formatDistance("xDays",m,s)}else if(f<fp*2)return p=Math.round(f/fp),i.formatDistance("aboutXMonths",p,s)}if(p=$$(u,l),p<12){const m=Math.round(f/fp);return i.formatDistance("xMonths",m,s)}else{const m=p%12,g=Math.trunc(p/12);return m<3?i.formatDistance("aboutXYears",g,s):m<9?i.formatDistance("overXYears",g,s):i.formatDistance("almostXYears",g+1,s)}}var x1="Avatar",[SW,$ie]=Ui(x1),[CW,I3]=SW(x1),O3=y.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,a]=y.useState("idle");return T.jsx(CW,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:a,children:T.jsx(zn.span,{...r,ref:t})})});O3.displayName=x1;var D3="AvatarImage",L3=y.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...a}=e,o=I3(D3,n),s=kW(r,a.referrerPolicy),l=Wt(u=>{i(u),o.onImageLoadingStatusChange(u)});return ir(()=>{s!=="idle"&&l(s)},[s,l]),s==="loaded"?T.jsx(zn.img,{...a,ref:t,src:r}):null});L3.displayName=D3;var M3="AvatarFallback",F3=y.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,a=I3(M3,n),[o,s]=y.useState(r===void 0);return y.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(l)}},[r]),o&&a.imageLoadingStatus!=="loaded"?T.jsx(zn.span,{...i,ref:t}):null});F3.displayName=M3;function kW(e,t){const[n,r]=y.useState("idle");return ir(()=>{if(!e){r("error");return}let i=!0;const a=new window.Image,o=s=>()=>{i&&r(s)};return r("loading"),a.onload=o("loaded"),a.onerror=o("error"),a.src=e,t&&(a.referrerPolicy=t),()=>{i=!1}},[e,t]),n}var B3=O3,j3=L3,U3=F3;const hp=y.forwardRef(({className:e,...t},n)=>T.jsx(B3,{ref:n,className:Me("relative flex size-6 aspect-square shrink-0 overflow-hidden rounded-full border bg-secondary",e),...t}));hp.displayName=B3.displayName;const E1=y.forwardRef(({className:e,...t},n)=>T.jsx(j3,{ref:n,className:Me("aspect-square h-full w-full",e),...t}));E1.displayName=j3.displayName;const z3=y.forwardRef(({className:e,...t},n)=>T.jsx(U3,{ref:n,className:Me("flex size-full text-sm items-center justify-center rounded-lg",e),...t}));z3.displayName=U3.displayName;function H3({attachment:e}){const{name:t,size:n,type:r,url:i}=e,a=r.startsWith("image/"),o=r.startsWith("video/"),s=r.startsWith("audio/");return T.jsxs("div",{className:"size-fit gap-2 border shrink-0 rounded-2xl overflow-hidden",children:[a&&T.jsx("img",{loading:"lazy",src:i,className:"object-cover size-16"}),o&&T.jsxs("video",{controls:!0,children:[T.jsx("source",{src:i,type:r}),"Your browser does not support the video tag."]}),s&&T.jsxs("audio",{controls:!0,className:"w-full mt-2 rounded-md border",children:[T.jsx("source",{src:i,type:r}),"Your browser does not support the audio tag."]}),!a&&!o&&!s&&T.jsxs("div",{className:"flex items-center gap-2 p-2",children:[T.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 line-clamp-2 underline hover:text-blue-600",children:t}),T.jsxs("span",{className:"text-sm text-gray-500 whitespace-nowrap",children:[(n/1024).toFixed(2)," KB"]})]})]})}function AW({message:e}){var t;return y.useMemo(()=>e.deliveredAt?_W(new Date(e.deliveredAt),new Date,{addSuffix:!0}):null,[e.deliveredAt]),T.jsxs("div",{className:"flex flex-col items-end gap-1",children:[T.jsx("div",{className:Me("w-fit p-2 rounded-2xl text-sm","bg-primary text-primary-foreground border shadow-sm"),children:e.content}),e.attachments&&e.attachments.length>0&&T.jsx("div",{className:"flex gap-1 flex-wrap justify-end",children:(t=e.attachments)==null?void 0:t.map(n=>T.jsx(H3,{attachment:n},n.id))})]})}function RW({messages:e}){const{user:t}=bl();return T.jsxs("div",{className:Me("group","flex flex-col gap-2 justify-end items-end","pl-8"),children:[T.jsx(hp,{className:"bg-primary text-primary-foreground",children:T.jsx(E1,{src:t==null?void 0:t.avatarUrl,alt:(t==null?void 0:t.name)||"User avatar"})}),e.map(n=>T.jsx(AW,{message:n},n.id))]})}function NW({messages:e,agent:t}){const{sessionState:n}=md();return T.jsxs("div",{className:Me("flex flex-col items-start gap-2","pr-8"),children:[T.jsx(hp,{children:T.jsx(E1,{src:(t==null?void 0:t.avatar)??"",alt:"Agent Icon"})}),e.map(r=>{var i;return T.jsx(w1,{message:r,Wrapper:y1,wrapperProps:{messageId:r.id,sessionId:(i=n.session)==null?void 0:i.id}},r.id)})]})}function PW(){var u;const{messagesState:{messages:e}}=hd(),{isAwaitingBotReply:t}=JT(),{componentStore:n}=Qn(),r=bl(),i=y.useMemo(()=>I$(e),[e.length]),a=n.getComponent("loading"),o=y.useRef(null);function s(){setTimeout(()=>{const c=o.current;c&&(c.scrollTop=c.scrollHeight)},0)}y.useEffect(()=>{s()},[e]);const l=e.length===0;return T.jsxs("div",{"data-messages":!0,ref:o,className:"max-h-full scroll-smooth relative flex-1 p-2 space-y-2 overflow-auto",children:[l&&(((u=r.initialMessages)==null?void 0:u.map((c,d)=>T.jsx(w1,{message:{component:"bot_message",data:{message:c},id:`initial-${d}`,type:"FROM_BOT",timestamp:Date.now().toString()},Wrapper:y1},d)))??T.jsx(w1,{message:{component:"bot_message",data:{message:"Hello, how can I help?"},id:"default-welcome",type:"FROM_BOT",agent:r.bot,timestamp:Date.now().toString()},Wrapper:y1},"default-welcome")),i.map((c,d)=>{var p,m;if(!((p=c==null?void 0:c[0])==null?void 0:p.type))return null;if(O$(c))return T.jsx(RW,{messages:c},d);if(D$(c)||L$(c)){const g=(m=c[0])==null?void 0:m.agent;return T.jsx(NW,{messages:c,agent:g},d)}return null}),t&&T.jsx(a,{})]})}const IW="[data-chat-widget-content-root]";function V3({fallbackHeight:e}){const t=y.useRef(null);return y.useEffect(()=>{const n=document.querySelector(IW);if(n&&t.current){const r=t.current;let i;const a=new ResizeObserver(()=>{i=requestAnimationFrame(()=>{const o=Math.max(r.offsetHeight,e);n.style.setProperty("--opencx-widget-height",o.toFixed(1)+"px")})});return a.observe(r),()=>{cancelAnimationFrame(i),a.unobserve(r)}}},[]),{observedElementRef:t}}function OW({options:e,onKeyboardClick:t}){return T.jsx("div",{className:"flex items-center gap-2 p-2 flex-wrap",children:e.map((n,r)=>T.jsx(pa,{onClick:()=>t(n),className:"flex-1 rounded-full",size:"sm",children:n},r))})}function DW(){var o,s;const{messagesState:e,messageCtx:t}=hd(),r=(s=(o=fg().data)==null?void 0:o.data)==null?void 0:s.initialQuestions,{observedElementRef:i}=V3({fallbackHeight:KO}),a=e.messages.length===0;return T.jsx("div",{ref:i,"data-test":"chat-screen",className:Me(hh.widgetHeight,"w-full flex flex-col overflow-hidden bg-background z-10 origin-bottom absolute bottom-0 inset-x-0"),children:T.jsxs("div",{className:"w-full h-full justify-between flex flex-col relative","data-test":"chat-screen-content",style:{background:"linear-gradient(333.89deg, rgba(75, 240, 171, 0.8) 58%, rgba(75, 240, 171, 0) 85.74%), linear-gradient(113.43deg, #46B1FF 19.77%, #1883FF 65.81%)"},children:[T.jsx(P$,{}),T.jsxs("div",{className:"flex bg-background shadow-lg flex-col w-full flex-1 overflow-auto","data-test":"chat-main-container",children:[T.jsx(PW,{}),T.jsxs("footer",{"data-test":"chat-footer",children:[e.suggestedReplies&&T.jsx(OW,{"data-test":"chat-keyboard",options:e.suggestedReplies,onKeyboardClick:l=>{const u=l.trim();u&&t.sendMessage({content:u})}}),a&&r&&T.jsx("div",{className:"flex items-center flex-row justify-end gap-2 flex-wrap px-2","data-test":"initial-questions-container",children:r==null?void 0:r.map((l,u)=>T.jsx(pa,{dir:"auto",variant:"outline",size:"sm","data-test":`initial-question-${u}`,onClick:()=>{t.sendMessage({content:l})},children:l},u))}),T.jsx(Dz,{})]})]})]})})}var Be;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const a={};for(const o of i)a[o]=o;return a},e.getValidEnumValues=i=>{const a=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),o={};for(const s of a)o[s]=i[s];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(a){return i[a]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&a.push(o);return a},e.find=(i,a)=>{for(const o of i)if(a(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}e.joinValues=r,e.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(Be||(Be={}));var T1;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(T1||(T1={}));const oe=Be.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ga=e=>{switch(typeof e){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return isNaN(e)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"symbol":return oe.symbol;case"object":return Array.isArray(e)?oe.array:e===null?oe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?oe.promise:typeof Map<"u"&&e instanceof Map?oe.map:typeof Set<"u"&&e instanceof Set?oe.set:typeof Date<"u"&&e instanceof Date?oe.date:oe.object;default:return oe.unknown}},Z=Be.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),LW=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class $n extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(a){return a.message},r={_errors:[]},i=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let s=r,l=0;for(;l<o.path.length;){const u=o.path[l];l===o.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(n(o))):s[u]=s[u]||{_errors:[]},s=s[u],l++}}};return i(this),r}static assert(t){if(!(t instanceof $n))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Be.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}$n.create=e=>new $n(e);const ks=(e,t)=>{let n;switch(e.code){case Z.invalid_type:e.received===oe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Z.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Be.jsonStringifyReplacer)}`;break;case Z.unrecognized_keys:n=`Unrecognized key(s) in object: ${Be.joinValues(e.keys,", ")}`;break;case Z.invalid_union:n="Invalid input";break;case Z.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Be.joinValues(e.options)}`;break;case Z.invalid_enum_value:n=`Invalid enum value. Expected ${Be.joinValues(e.options)}, received '${e.received}'`;break;case Z.invalid_arguments:n="Invalid function arguments";break;case Z.invalid_return_type:n="Invalid function return type";break;case Z.invalid_date:n="Invalid date";break;case Z.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Be.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Z.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Z.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Z.custom:n="Invalid input";break;case Z.invalid_intersection_types:n="Intersection results could not be merged";break;case Z.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Z.not_finite:n="Number must be finite";break;default:n=t.defaultError,Be.assertNever(e)}return{message:n}};let $3=ks;function MW(e){$3=e}function mp(){return $3}const gp=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)s=u(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}},FW=[];function ae(e,t){const n=mp(),r=gp({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===ks?void 0:ks].filter(i=>!!i)});e.common.issues.push(r)}class tn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return be;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const a=await i.key,o=await i.value;r.push({key:a,value:o})}return tn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:a,value:o}=i;if(a.status==="aborted"||o.status==="aborted")return be;a.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[a.value]=o.value)}return{status:t.value,value:r}}}const be=Object.freeze({status:"aborted"}),As=e=>({status:"dirty",value:e}),dn=e=>({status:"valid",value:e}),_1=e=>e.status==="aborted",S1=e=>e.status==="dirty",Cu=e=>e.status==="valid",ku=e=>typeof Promise<"u"&&e instanceof Promise;function wp(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function W3(e,t,n,r,i){if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}typeof SuppressedError=="function"&&SuppressedError;var pe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(pe||(pe={}));var Au,Ru;class $r{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Y3=(e,t)=>{if(Cu(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new $n(e.common.issues);return this._error=n,this._error}}};function Ce(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(o,s)=>{var l,u;const{message:c}=e;return o.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:(l=c??r)!==null&&l!==void 0?l:s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:(u=c??n)!==null&&u!==void 0?u:s.defaultError}},description:i}}class Ne{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return ga(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:ga(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new tn,ctx:{common:t.parent.common,data:t.data,parsedType:ga(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(ku(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ga(t)},a=this._parseSync({data:t,path:i.path,parent:i});return Y3(i,a)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ga(t)},i=this._parse({data:t,path:r.path,parent:r}),a=await(ku(i)?i:Promise.resolve(i));return Y3(r,a)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,a)=>{const o=t(i),s=()=>a.addIssue({code:Z.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new kr({schema:this,typeName:ye.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Yr.create(this,this._def)}nullable(){return ba.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Cr.create(this,this._def)}promise(){return Is.create(this,this._def)}or(t){return Ou.create([this,t],this._def)}and(t){return Du.create(this,t,this._def)}transform(t){return new kr({...Ce(this._def),schema:this,typeName:ye.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new ju({...Ce(this._def),innerType:this,defaultValue:n,typeName:ye.ZodDefault})}brand(){return new A1({typeName:ye.ZodBranded,type:this,...Ce(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Uu({...Ce(this._def),innerType:this,catchValue:n,typeName:ye.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return zu.create(this,t)}readonly(){return Hu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const BW=/^c[^\s-]{8,}$/i,jW=/^[0-9a-z]+$/,UW=/^[0-9A-HJKMNP-TV-Z]{26}$/,zW=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,HW=/^[a-z0-9_-]{21}$/i,VW=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,$W=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,WW="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let C1;const YW=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,qW=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,GW=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,q3="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",KW=new RegExp(`^${q3}$`);function G3(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function XW(e){return new RegExp(`^${G3(e)}$`)}function K3(e){let t=`${q3}T${G3(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function QW(e,t){return!!((t==="v4"||!t)&&YW.test(e)||(t==="v6"||!t)&&qW.test(e))}class Sr extends Ne{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==oe.string){const a=this._getOrReturnCtx(t);return ae(a,{code:Z.invalid_type,expected:oe.string,received:a.parsedType}),be}const r=new tn;let i;for(const a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(i=this._getOrReturnCtx(t,i),ae(i,{code:Z.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")t.data.length>a.value&&(i=this._getOrReturnCtx(t,i),ae(i,{code:Z.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const o=t.data.length>a.value,s=t.data.length<a.value;(o||s)&&(i=this._getOrReturnCtx(t,i),o?ae(i,{code:Z.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&ae(i,{code:Z.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")$W.test(t.data)||(i=this._getOrReturnCtx(t,i),ae(i,{validation:"email",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")C1||(C1=new RegExp(WW,"u")),C1.test(t.data)||(i=this._getOrReturnCtx(t,i),ae(i,{validation:"emoji",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")zW.test(t.data)||(i=this._getOrReturnCtx(t,i),ae(i,{validation:"uuid",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")HW.test(t.data)||(i=this._getOrReturnCtx(t,i),ae(i,{validation:"nanoid",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")BW.test(t.data)||(i=this._getOrReturnCtx(t,i),ae(i,{validation:"cuid",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")jW.test(t.data)||(i=this._getOrReturnCtx(t,i),ae(i,{validation:"cuid2",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")UW.test(t.data)||(i=this._getOrReturnCtx(t,i),ae(i,{validation:"ulid",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),ae(i,{validation:"url",code:Z.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),ae(i,{validation:"regex",code:Z.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(t,i),ae(i,{code:Z.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(i=this._getOrReturnCtx(t,i),ae(i,{code:Z.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(i=this._getOrReturnCtx(t,i),ae(i,{code:Z.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?K3(a).test(t.data)||(i=this._getOrReturnCtx(t,i),ae(i,{code:Z.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?KW.test(t.data)||(i=this._getOrReturnCtx(t,i),ae(i,{code:Z.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?XW(a).test(t.data)||(i=this._getOrReturnCtx(t,i),ae(i,{code:Z.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?VW.test(t.data)||(i=this._getOrReturnCtx(t,i),ae(i,{validation:"duration",code:Z.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?QW(t.data,a.version)||(i=this._getOrReturnCtx(t,i),ae(i,{validation:"ip",code:Z.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?GW.test(t.data)||(i=this._getOrReturnCtx(t,i),ae(i,{validation:"base64",code:Z.invalid_string,message:a.message}),r.dirty()):Be.assertNever(a);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:Z.invalid_string,...pe.errToObj(r)})}_addCheck(t){return new Sr({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...pe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...pe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...pe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...pe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...pe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...pe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...pe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...pe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...pe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...pe.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...pe.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...pe.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...pe.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...pe.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...pe.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...pe.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...pe.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...pe.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...pe.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...pe.errToObj(n)})}nonempty(t){return this.min(1,pe.errToObj(t))}trim(){return new Sr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Sr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Sr({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Sr.create=e=>{var t;return new Sr({checks:[],typeName:ye.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ce(e)})};function ZW(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,a=parseInt(e.toFixed(i).replace(".","")),o=parseInt(t.toFixed(i).replace(".",""));return a%o/Math.pow(10,i)}class wa extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==oe.number){const a=this._getOrReturnCtx(t);return ae(a,{code:Z.invalid_type,expected:oe.number,received:a.parsedType}),be}let r;const i=new tn;for(const a of this._def.checks)a.kind==="int"?Be.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ae(r,{code:Z.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),ae(r,{code:Z.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),ae(r,{code:Z.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?ZW(t.data,a.value)!==0&&(r=this._getOrReturnCtx(t,r),ae(r,{code:Z.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ae(r,{code:Z.not_finite,message:a.message}),i.dirty()):Be.assertNever(a);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,pe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,pe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,pe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,pe.toString(n))}setLimit(t,n,r,i){return new wa({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:pe.toString(i)}]})}_addCheck(t){return new wa({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:pe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:pe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:pe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:pe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:pe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:pe.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:pe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:pe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:pe.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Be.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}wa.create=e=>new wa({checks:[],typeName:ye.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Ce(e)});class ya extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==oe.bigint){const a=this._getOrReturnCtx(t);return ae(a,{code:Z.invalid_type,expected:oe.bigint,received:a.parsedType}),be}let r;const i=new tn;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),ae(r,{code:Z.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),ae(r,{code:Z.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ae(r,{code:Z.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):Be.assertNever(a);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,pe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,pe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,pe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,pe.toString(n))}setLimit(t,n,r,i){return new ya({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:pe.toString(i)}]})}_addCheck(t){return new ya({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:pe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:pe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:pe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:pe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:pe.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}ya.create=e=>{var t;return new ya({checks:[],typeName:ye.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ce(e)})};class Nu extends Ne{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==oe.boolean){const r=this._getOrReturnCtx(t);return ae(r,{code:Z.invalid_type,expected:oe.boolean,received:r.parsedType}),be}return dn(t.data)}}Nu.create=e=>new Nu({typeName:ye.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Ce(e)});class so extends Ne{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==oe.date){const a=this._getOrReturnCtx(t);return ae(a,{code:Z.invalid_type,expected:oe.date,received:a.parsedType}),be}if(isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return ae(a,{code:Z.invalid_date}),be}const r=new tn;let i;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(i=this._getOrReturnCtx(t,i),ae(i,{code:Z.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(i=this._getOrReturnCtx(t,i),ae(i,{code:Z.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):Be.assertNever(a);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new so({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:pe.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:pe.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}so.create=e=>new so({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ye.ZodDate,...Ce(e)});class yp extends Ne{_parse(t){if(this._getType(t)!==oe.symbol){const r=this._getOrReturnCtx(t);return ae(r,{code:Z.invalid_type,expected:oe.symbol,received:r.parsedType}),be}return dn(t.data)}}yp.create=e=>new yp({typeName:ye.ZodSymbol,...Ce(e)});class Pu extends Ne{_parse(t){if(this._getType(t)!==oe.undefined){const r=this._getOrReturnCtx(t);return ae(r,{code:Z.invalid_type,expected:oe.undefined,received:r.parsedType}),be}return dn(t.data)}}Pu.create=e=>new Pu({typeName:ye.ZodUndefined,...Ce(e)});class Iu extends Ne{_parse(t){if(this._getType(t)!==oe.null){const r=this._getOrReturnCtx(t);return ae(r,{code:Z.invalid_type,expected:oe.null,received:r.parsedType}),be}return dn(t.data)}}Iu.create=e=>new Iu({typeName:ye.ZodNull,...Ce(e)});class Rs extends Ne{constructor(){super(...arguments),this._any=!0}_parse(t){return dn(t.data)}}Rs.create=e=>new Rs({typeName:ye.ZodAny,...Ce(e)});class lo extends Ne{constructor(){super(...arguments),this._unknown=!0}_parse(t){return dn(t.data)}}lo.create=e=>new lo({typeName:ye.ZodUnknown,...Ce(e)});class Ei extends Ne{_parse(t){const n=this._getOrReturnCtx(t);return ae(n,{code:Z.invalid_type,expected:oe.never,received:n.parsedType}),be}}Ei.create=e=>new Ei({typeName:ye.ZodNever,...Ce(e)});class vp extends Ne{_parse(t){if(this._getType(t)!==oe.undefined){const r=this._getOrReturnCtx(t);return ae(r,{code:Z.invalid_type,expected:oe.void,received:r.parsedType}),be}return dn(t.data)}}vp.create=e=>new vp({typeName:ye.ZodVoid,...Ce(e)});class Cr extends Ne{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==oe.array)return ae(n,{code:Z.invalid_type,expected:oe.array,received:n.parsedType}),be;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,s=n.data.length<i.exactLength.value;(o||s)&&(ae(n,{code:o?Z.too_big:Z.too_small,minimum:s?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(ae(n,{code:Z.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(ae(n,{code:Z.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,s)=>i.type._parseAsync(new $r(n,o,n.path,s)))).then(o=>tn.mergeArray(r,o));const a=[...n.data].map((o,s)=>i.type._parseSync(new $r(n,o,n.path,s)));return tn.mergeArray(r,a)}get element(){return this._def.type}min(t,n){return new Cr({...this._def,minLength:{value:t,message:pe.toString(n)}})}max(t,n){return new Cr({...this._def,maxLength:{value:t,message:pe.toString(n)}})}length(t,n){return new Cr({...this._def,exactLength:{value:t,message:pe.toString(n)}})}nonempty(t){return this.min(1,t)}}Cr.create=(e,t)=>new Cr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ye.ZodArray,...Ce(t)});function Ns(e){if(e instanceof ht){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Yr.create(Ns(r))}return new ht({...e._def,shape:()=>t})}else return e instanceof Cr?new Cr({...e._def,type:Ns(e.element)}):e instanceof Yr?Yr.create(Ns(e.unwrap())):e instanceof ba?ba.create(Ns(e.unwrap())):e instanceof Wr?Wr.create(e.items.map(t=>Ns(t))):e}class ht extends Ne{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Be.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==oe.object){const u=this._getOrReturnCtx(t);return ae(u,{code:Z.invalid_type,expected:oe.object,received:u.parsedType}),be}const{status:r,ctx:i}=this._processInputParams(t),{shape:a,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof Ei&&this._def.unknownKeys==="strip"))for(const u in i.data)o.includes(u)||s.push(u);const l=[];for(const u of o){const c=a[u],d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new $r(i,d,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Ei){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of s)l.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(u==="strict")s.length>0&&(ae(i,{code:Z.unrecognized_keys,keys:s}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of s){const d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new $r(i,d,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of l){const d=await c.key,f=await c.value;u.push({key:d,value:f,alwaysSet:c.alwaysSet})}return u}).then(u=>tn.mergeObjectSync(r,u)):tn.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return pe.errToObj,new ht({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,a,o,s;const l=(o=(a=(i=this._def).errorMap)===null||a===void 0?void 0:a.call(i,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(s=pe.errToObj(t).message)!==null&&s!==void 0?s:l}:{message:l}}}:{}})}strip(){return new ht({...this._def,unknownKeys:"strip"})}passthrough(){return new ht({...this._def,unknownKeys:"passthrough"})}extend(t){return new ht({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ht({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ye.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new ht({...this._def,catchall:t})}pick(t){const n={};return Be.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new ht({...this._def,shape:()=>n})}omit(t){const n={};return Be.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new ht({...this._def,shape:()=>n})}deepPartial(){return Ns(this)}partial(t){const n={};return Be.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new ht({...this._def,shape:()=>n})}required(t){const n={};return Be.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof Yr;)a=a._def.innerType;n[r]=a}}),new ht({...this._def,shape:()=>n})}keyof(){return X3(Be.objectKeys(this.shape))}}ht.create=(e,t)=>new ht({shape:()=>e,unknownKeys:"strip",catchall:Ei.create(),typeName:ye.ZodObject,...Ce(t)}),ht.strictCreate=(e,t)=>new ht({shape:()=>e,unknownKeys:"strict",catchall:Ei.create(),typeName:ye.ZodObject,...Ce(t)}),ht.lazycreate=(e,t)=>new ht({shape:e,unknownKeys:"strip",catchall:Ei.create(),typeName:ye.ZodObject,...Ce(t)});class Ou extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(a){for(const s of a)if(s.result.status==="valid")return s.result;for(const s of a)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const o=a.map(s=>new $n(s.ctx.common.issues));return ae(n,{code:Z.invalid_union,unionErrors:o}),be}if(n.common.async)return Promise.all(r.map(async a=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let a;const o=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},c=l._parseSync({data:n.data,path:n.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!a&&(a={result:c,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(l=>new $n(l));return ae(n,{code:Z.invalid_union,unionErrors:s}),be}}get options(){return this._def.options}}Ou.create=(e,t)=>new Ou({options:e,typeName:ye.ZodUnion,...Ce(t)});const Ti=e=>e instanceof Mu?Ti(e.schema):e instanceof kr?Ti(e.innerType()):e instanceof Fu?[e.value]:e instanceof va?e.options:e instanceof Bu?Be.objectValues(e.enum):e instanceof ju?Ti(e._def.innerType):e instanceof Pu?[void 0]:e instanceof Iu?[null]:e instanceof Yr?[void 0,...Ti(e.unwrap())]:e instanceof ba?[null,...Ti(e.unwrap())]:e instanceof A1||e instanceof Hu?Ti(e.unwrap()):e instanceof Uu?Ti(e._def.innerType):[];class bp extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.object)return ae(n,{code:Z.invalid_type,expected:oe.object,received:n.parsedType}),be;const r=this.discriminator,i=n.data[r],a=this.optionsMap.get(i);return a?n.common.async?a._parseAsync({data:n.data,path:n.path,parent:n}):a._parseSync({data:n.data,path:n.path,parent:n}):(ae(n,{code:Z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),be)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const a of n){const o=Ti(a.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const s of o){if(i.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);i.set(s,a)}}return new bp({typeName:ye.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Ce(r)})}}function k1(e,t){const n=ga(e),r=ga(t);if(e===t)return{valid:!0,data:e};if(n===oe.object&&r===oe.object){const i=Be.objectKeys(t),a=Be.objectKeys(e).filter(s=>i.indexOf(s)!==-1),o={...e,...t};for(const s of a){const l=k1(e[s],t[s]);if(!l.valid)return{valid:!1};o[s]=l.data}return{valid:!0,data:o}}else if(n===oe.array&&r===oe.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let a=0;a<e.length;a++){const o=e[a],s=t[a],l=k1(o,s);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===oe.date&&r===oe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Du extends Ne{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(a,o)=>{if(_1(a)||_1(o))return be;const s=k1(a.value,o.value);return s.valid?((S1(a)||S1(o))&&n.dirty(),{status:n.value,value:s.data}):(ae(r,{code:Z.invalid_intersection_types}),be)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,o])=>i(a,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Du.create=(e,t,n)=>new Du({left:e,right:t,typeName:ye.ZodIntersection,...Ce(n)});class Wr extends Ne{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.array)return ae(r,{code:Z.invalid_type,expected:oe.array,received:r.parsedType}),be;if(r.data.length<this._def.items.length)return ae(r,{code:Z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),be;!this._def.rest&&r.data.length>this._def.items.length&&(ae(r,{code:Z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...r.data].map((o,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new $r(r,o,r.path,s)):null}).filter(o=>!!o);return r.common.async?Promise.all(a).then(o=>tn.mergeArray(n,o)):tn.mergeArray(n,a)}get items(){return this._def.items}rest(t){return new Wr({...this._def,rest:t})}}Wr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Wr({items:e,typeName:ye.ZodTuple,rest:null,...Ce(t)})};class Lu extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.object)return ae(r,{code:Z.invalid_type,expected:oe.object,received:r.parsedType}),be;const i=[],a=this._def.keyType,o=this._def.valueType;for(const s in r.data)i.push({key:a._parse(new $r(r,s,r.path,s)),value:o._parse(new $r(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?tn.mergeObjectAsync(n,i):tn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Ne?new Lu({keyType:t,valueType:n,typeName:ye.ZodRecord,...Ce(r)}):new Lu({keyType:Sr.create(),valueType:t,typeName:ye.ZodRecord,...Ce(n)})}}class xp extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.map)return ae(r,{code:Z.invalid_type,expected:oe.map,received:r.parsedType}),be;const i=this._def.keyType,a=this._def.valueType,o=[...r.data.entries()].map(([s,l],u)=>({key:i._parse(new $r(r,s,r.path,[u,"key"])),value:a._parse(new $r(r,l,r.path,[u,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return be;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(u.value,c.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const l of o){const u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return be;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(u.value,c.value)}return{status:n.value,value:s}}}}xp.create=(e,t,n)=>new xp({valueType:t,keyType:e,typeName:ye.ZodMap,...Ce(n)});class uo extends Ne{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.set)return ae(r,{code:Z.invalid_type,expected:oe.set,received:r.parsedType}),be;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(ae(r,{code:Z.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(ae(r,{code:Z.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const a=this._def.valueType;function o(l){const u=new Set;for(const c of l){if(c.status==="aborted")return be;c.status==="dirty"&&n.dirty(),u.add(c.value)}return{status:n.value,value:u}}const s=[...r.data.values()].map((l,u)=>a._parse(new $r(r,l,r.path,u)));return r.common.async?Promise.all(s).then(l=>o(l)):o(s)}min(t,n){return new uo({...this._def,minSize:{value:t,message:pe.toString(n)}})}max(t,n){return new uo({...this._def,maxSize:{value:t,message:pe.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}uo.create=(e,t)=>new uo({valueType:e,minSize:null,maxSize:null,typeName:ye.ZodSet,...Ce(t)});class Ps extends Ne{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.function)return ae(n,{code:Z.invalid_type,expected:oe.function,received:n.parsedType}),be;function r(s,l){return gp({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,mp(),ks].filter(u=>!!u),issueData:{code:Z.invalid_arguments,argumentsError:l}})}function i(s,l){return gp({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,mp(),ks].filter(u=>!!u),issueData:{code:Z.invalid_return_type,returnTypeError:l}})}const a={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof Is){const s=this;return dn(async function(...l){const u=new $n([]),c=await s._def.args.parseAsync(l,a).catch(p=>{throw u.addIssue(r(l,p)),u}),d=await Reflect.apply(o,this,c);return await s._def.returns._def.type.parseAsync(d,a).catch(p=>{throw u.addIssue(i(d,p)),u})})}else{const s=this;return dn(function(...l){const u=s._def.args.safeParse(l,a);if(!u.success)throw new $n([r(l,u.error)]);const c=Reflect.apply(o,this,u.data),d=s._def.returns.safeParse(c,a);if(!d.success)throw new $n([i(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Ps({...this._def,args:Wr.create(t).rest(lo.create())})}returns(t){return new Ps({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Ps({args:t||Wr.create([]).rest(lo.create()),returns:n||lo.create(),typeName:ye.ZodFunction,...Ce(r)})}}class Mu extends Ne{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Mu.create=(e,t)=>new Mu({getter:e,typeName:ye.ZodLazy,...Ce(t)});class Fu extends Ne{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ae(n,{received:n.data,code:Z.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:t.data}}get value(){return this._def.value}}Fu.create=(e,t)=>new Fu({value:e,typeName:ye.ZodLiteral,...Ce(t)});function X3(e,t){return new va({values:e,typeName:ye.ZodEnum,...Ce(t)})}class va extends Ne{constructor(){super(...arguments),Au.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ae(n,{expected:Be.joinValues(r),received:n.parsedType,code:Z.invalid_type}),be}if(wp(this,Au)||W3(this,Au,new Set(this._def.values)),!wp(this,Au).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return ae(n,{received:n.data,code:Z.invalid_enum_value,options:r}),be}return dn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return va.create(t,{...this._def,...n})}exclude(t,n=this._def){return va.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Au=new WeakMap,va.create=X3;class Bu extends Ne{constructor(){super(...arguments),Ru.set(this,void 0)}_parse(t){const n=Be.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==oe.string&&r.parsedType!==oe.number){const i=Be.objectValues(n);return ae(r,{expected:Be.joinValues(i),received:r.parsedType,code:Z.invalid_type}),be}if(wp(this,Ru)||W3(this,Ru,new Set(Be.getValidEnumValues(this._def.values))),!wp(this,Ru).has(t.data)){const i=Be.objectValues(n);return ae(r,{received:r.data,code:Z.invalid_enum_value,options:i}),be}return dn(t.data)}get enum(){return this._def.values}}Ru=new WeakMap,Bu.create=(e,t)=>new Bu({values:e,typeName:ye.ZodNativeEnum,...Ce(t)});class Is extends Ne{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.promise&&n.common.async===!1)return ae(n,{code:Z.invalid_type,expected:oe.promise,received:n.parsedType}),be;const r=n.parsedType===oe.promise?n.data:Promise.resolve(n.data);return dn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Is.create=(e,t)=>new Is({type:e,typeName:ye.ZodPromise,...Ce(t)});class kr extends Ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ye.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,a={addIssue:o=>{ae(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const o=i.transform(r.data,a);if(r.common.async)return Promise.resolve(o).then(async s=>{if(n.value==="aborted")return be;const l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?be:l.status==="dirty"||n.value==="dirty"?As(l.value):l});{if(n.value==="aborted")return be;const s=this._def.schema._parseSync({data:o,path:r.path,parent:r});return s.status==="aborted"?be:s.status==="dirty"||n.value==="dirty"?As(s.value):s}}if(i.type==="refinement"){const o=s=>{const l=i.refinement(s,a);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?be:(s.status==="dirty"&&n.dirty(),o(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?be:(s.status==="dirty"&&n.dirty(),o(s.value).then(()=>({status:n.value,value:s.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Cu(o))return o;const s=i.transform(o.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Cu(o)?Promise.resolve(i.transform(o.value,a)).then(s=>({status:n.value,value:s})):o);Be.assertNever(i)}}kr.create=(e,t,n)=>new kr({schema:e,typeName:ye.ZodEffects,effect:t,...Ce(n)}),kr.createWithPreprocess=(e,t,n)=>new kr({schema:t,effect:{type:"preprocess",transform:e},typeName:ye.ZodEffects,...Ce(n)});class Yr extends Ne{_parse(t){return this._getType(t)===oe.undefined?dn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Yr.create=(e,t)=>new Yr({innerType:e,typeName:ye.ZodOptional,...Ce(t)});class ba extends Ne{_parse(t){return this._getType(t)===oe.null?dn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ba.create=(e,t)=>new ba({innerType:e,typeName:ye.ZodNullable,...Ce(t)});class ju extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ju.create=(e,t)=>new ju({innerType:e,typeName:ye.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ce(t)});class Uu extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ku(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new $n(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new $n(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Uu.create=(e,t)=>new Uu({innerType:e,typeName:ye.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ce(t)});class Ep extends Ne{_parse(t){if(this._getType(t)!==oe.nan){const r=this._getOrReturnCtx(t);return ae(r,{code:Z.invalid_type,expected:oe.nan,received:r.parsedType}),be}return{status:"valid",value:t.data}}}Ep.create=e=>new Ep({typeName:ye.ZodNaN,...Ce(e)});const JW=Symbol("zod_brand");class A1 extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class zu extends Ne{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?be:a.status==="dirty"?(n.dirty(),As(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?be:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new zu({in:t,out:n,typeName:ye.ZodPipeline})}}class Hu extends Ne{_parse(t){const n=this._def.innerType._parse(t),r=i=>(Cu(i)&&(i.value=Object.freeze(i.value)),i);return ku(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}Hu.create=(e,t)=>new Hu({innerType:e,typeName:ye.ZodReadonly,...Ce(t)});function Q3(e,t={},n){return e?Rs.create().superRefine((r,i)=>{var a,o;if(!e(r)){const s=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(o=(a=s.fatal)!==null&&a!==void 0?a:n)!==null&&o!==void 0?o:!0,u=typeof s=="string"?{message:s}:s;i.addIssue({code:"custom",...u,fatal:l})}}):Rs.create()}const eY={object:ht.lazycreate};var ye;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ye||(ye={}));const tY=(e,t={message:`Input not instance of ${e.name}`})=>Q3(n=>n instanceof e,t),Z3=Sr.create,J3=wa.create,nY=Ep.create,rY=ya.create,eR=Nu.create,iY=so.create,aY=yp.create,oY=Pu.create,sY=Iu.create,lY=Rs.create,uY=lo.create,cY=Ei.create,dY=vp.create,fY=Cr.create,pY=ht.create,hY=ht.strictCreate,mY=Ou.create,gY=bp.create,wY=Du.create,yY=Wr.create,vY=Lu.create,bY=xp.create,xY=uo.create,EY=Ps.create,TY=Mu.create,_Y=Fu.create,SY=va.create,CY=Bu.create,kY=Is.create,tR=kr.create,AY=Yr.create,RY=ba.create,NY=kr.createWithPreprocess,PY=zu.create;var R1=Object.freeze({__proto__:null,defaultErrorMap:ks,setErrorMap:MW,getErrorMap:mp,makeIssue:gp,EMPTY_PATH:FW,addIssueToContext:ae,ParseStatus:tn,INVALID:be,DIRTY:As,OK:dn,isAborted:_1,isDirty:S1,isValid:Cu,isAsync:ku,get util(){return Be},get objectUtil(){return T1},ZodParsedType:oe,getParsedType:ga,ZodType:Ne,datetimeRegex:K3,ZodString:Sr,ZodNumber:wa,ZodBigInt:ya,ZodBoolean:Nu,ZodDate:so,ZodSymbol:yp,ZodUndefined:Pu,ZodNull:Iu,ZodAny:Rs,ZodUnknown:lo,ZodNever:Ei,ZodVoid:vp,ZodArray:Cr,ZodObject:ht,ZodUnion:Ou,ZodDiscriminatedUnion:bp,ZodIntersection:Du,ZodTuple:Wr,ZodRecord:Lu,ZodMap:xp,ZodSet:uo,ZodFunction:Ps,ZodLazy:Mu,ZodLiteral:Fu,ZodEnum:va,ZodNativeEnum:Bu,ZodPromise:Is,ZodEffects:kr,ZodTransformer:kr,ZodOptional:Yr,ZodNullable:ba,ZodDefault:ju,ZodCatch:Uu,ZodNaN:Ep,BRAND:JW,ZodBranded:A1,ZodPipeline:zu,ZodReadonly:Hu,custom:Q3,Schema:Ne,ZodSchema:Ne,late:eY,get ZodFirstPartyTypeKind(){return ye},coerce:{string:e=>Sr.create({...e,coerce:!0}),number:e=>wa.create({...e,coerce:!0}),boolean:e=>Nu.create({...e,coerce:!0}),bigint:e=>ya.create({...e,coerce:!0}),date:e=>so.create({...e,coerce:!0})},any:lY,array:fY,bigint:rY,boolean:eR,date:iY,discriminatedUnion:gY,effect:tR,enum:SY,function:EY,instanceof:tY,intersection:wY,lazy:TY,literal:_Y,map:bY,nan:nY,nativeEnum:CY,never:cY,null:sY,nullable:RY,number:J3,object:pY,oboolean:()=>eR().optional(),onumber:()=>J3().optional(),optional:AY,ostring:()=>Z3().optional(),pipeline:PY,preprocess:NY,promise:kY,record:vY,set:xY,strictObject:hY,string:Z3,symbol:aY,transformer:tR,tuple:yY,undefined:oY,union:mY,unknown:uY,void:dY,NEVER:be,ZodIssueCode:Z,quotelessJson:LW,ZodError:$n});const N1=y.forwardRef(({className:e,type:t,...n},r)=>T.jsx(Xf,{ref:r,children:T.jsx("input",{type:t,className:Me("flex w-full rounded-xl border border-input bg-background p-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-primary-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 transition",e),...n})}));N1.displayName="Input";const IY=R1.object({name:R1.string().min(2),email:R1.string().email()});function OY(){var s,l,u;const{contactCtx:e}=ZT(),t=bl(),n=Kf(),{data:r}=fg(),{observedElementRef:i}=V3({fallbackHeight:GO}),[a,o]=Q9(async c=>{c.preventDefault();const d=new FormData(c.currentTarget),f=Object.fromEntries(d.entries()),p=IY.safeParse(f);p.success&&await e.createUnverifiedContact({email:p.data.email,name:p.data.name})});return T.jsxs("div",{ref:i,"data-test":"welcome-screen",className:Me(hh.widgetMinHeight,"h-fit bg-primary rounded-3xl flex flex-col"),children:[T.jsxs("div",{className:"flex-1 flex flex-col px-4 py-12 text-start space-y-4 relative z-10","data-test":"welcome-header",children:[T.jsx("div",{className:"flex items-center justify-between w-full mb-2","data-test":"welcome-logo-container",children:(s=t.assets)!=null&&s.organizationLogo?T.jsx("img",{src:(l=t.assets)==null?void 0:l.organizationLogo,alt:"Company Logo",className:"h-8 w-auto object-contain","data-test":"organization-logo"}):T.jsx("h2",{className:"font-bold text-xl text-primary-foreground","data-test":"organization-name",children:(u=r==null?void 0:r.data)==null?void 0:u.organizationName})}),T.jsxs("div",{className:"space-y-2","data-test":"welcome-content",children:[T.jsx("h1",{className:"text-2xl font-bold text-primary-foreground","data-test":"welcome-title",children:n.get("welcome-title")}),T.jsx("p",{className:"text-primary-foreground/90 text-sm max-w-[320px] leading-relaxed","data-test":"welcome-description",children:n.get("welcome-description")})]})]}),T.jsx("div",{className:"p-2 bg-background rounded-3xl","data-test":"welcome-form-container",children:T.jsxs("form",{onSubmit:o,className:"space-y-2","data-test":"welcome-form",children:[T.jsxs("div",{className:"space-y-2",children:[T.jsx(N1,{required:!0,dir:"auto",autoFocus:!0,placeholder:n.get("your-name"),name:"name",className:"rounded-3xl pl-3","data-test":"name-input"}),T.jsx(N1,{required:!0,dir:"auto",type:"email",placeholder:n.get("your-email"),name:"email",className:"rounded-3xl pl-3","data-test":"email-input"})]}),T.jsxs(pa,{disabled:a.loading,className:"w-full rounded-3xl","data-test":"start-chat-button",children:[a.loading?n.get("starting-chat"):n.get("start-chat"),T.jsx(aE,{className:"size-4"})]})]})})]})}function DY(){const{contactCtx:e}=ZT(),t=e.shouldCollectData();return T.jsx("div",{className:"bg-background size-full","data-test":"root-screen",children:T.jsx(fl,{mode:"wait",children:t?T.jsx(xi,{fadeIn:"right",className:"size-full",snapExit:!0,"data-test":"welcome-screen-container",children:T.jsx(OY,{})},"welcome-screen"):T.jsx(xi,{fadeIn:"right",className:"size-full",snapExit:!0,"data-test":"chat-screen-container",children:T.jsx(DW,{})},"chat-screen")})})}var P1="focusScope.autoFocusOnMount",I1="focusScope.autoFocusOnUnmount",nR={bubbles:!1,cancelable:!0},LY="FocusScope",rR=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,l]=y.useState(null),u=Wt(i),c=Wt(a),d=y.useRef(null),f=Mr(t,g=>l(g)),p=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let g=function(b){if(p.paused||!s)return;const E=b.target;s.contains(E)?d.current=E:xa(d.current,{select:!0})},x=function(b){if(p.paused||!s)return;const E=b.relatedTarget;E!==null&&(s.contains(E)||xa(d.current,{select:!0}))},w=function(b){if(document.activeElement===document.body)for(const _ of b)_.removedNodes.length>0&&xa(s)};document.addEventListener("focusin",g),document.addEventListener("focusout",x);const v=new MutationObserver(w);return s&&v.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",x),v.disconnect()}}},[r,s,p.paused]),y.useEffect(()=>{if(s){oR.add(p);const g=document.activeElement;if(!s.contains(g)){const w=new CustomEvent(P1,nR);s.addEventListener(P1,u),s.dispatchEvent(w),w.defaultPrevented||(MY(zY(iR(s)),{select:!0}),document.activeElement===g&&xa(s))}return()=>{s.removeEventListener(P1,u),setTimeout(()=>{const w=new CustomEvent(I1,nR);s.addEventListener(I1,c),s.dispatchEvent(w),w.defaultPrevented||xa(g??document.body,{select:!0}),s.removeEventListener(I1,c),oR.remove(p)},0)}}},[s,u,c,p]);const m=y.useCallback(g=>{if(!n&&!r||p.paused)return;const x=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,w=document.activeElement;if(x&&w){const v=g.currentTarget,[b,E]=FY(v);b&&E?!g.shiftKey&&w===E?(g.preventDefault(),n&&xa(b,{select:!0})):g.shiftKey&&w===b&&(g.preventDefault(),n&&xa(E,{select:!0})):w===v&&g.preventDefault()}},[n,r,p.paused]);return T.jsx(zn.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});rR.displayName=LY;function MY(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(xa(r,{select:t}),document.activeElement!==n)return}function FY(e){const t=iR(e),n=aR(t,e),r=aR(t.reverse(),e);return[n,r]}function iR(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function aR(e,t){for(const n of e)if(!BY(n,{upTo:t}))return n}function BY(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function jY(e){return e instanceof HTMLInputElement&&"select"in e}function xa(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&jY(e)&&t&&e.select()}}var oR=UY();function UY(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=sR(e,t),e.unshift(t)},remove(t){var n;e=sR(e,t),(n=e[0])==null||n.resume()}}}function sR(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function zY(e){return e.filter(t=>t.tagName!=="A")}var Tp="right-scroll-bar-position",_p="width-before-scroll-bar",HY="with-scroll-bars-hidden",VY="--removed-body-scroll-bar-size";function O1(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function $Y(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var WY=typeof window<"u"?y.useLayoutEffect:y.useEffect,lR=new WeakMap;function YY(e,t){var n=$Y(null,function(r){return e.forEach(function(i){return O1(i,r)})});return WY(function(){var r=lR.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;i.forEach(function(s){a.has(s)||O1(s,null)}),a.forEach(function(s){i.has(s)||O1(s,o)})}lR.set(n,e)},[e]),n}var uR=bA(),D1=function(){},Sp=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:D1,onWheelCapture:D1,onTouchMoveCapture:D1}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,c=e.enabled,d=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,g=e.allowPinchZoom,x=e.as,w=x===void 0?"div":x,v=e.gapMode,b=pl(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=f,_=YY([n,t]),S=Ot(Ot({},b),i);return y.createElement(y.Fragment,null,c&&y.createElement(E,{sideCar:uR,removeScrollBar:u,shards:d,noIsolation:p,inert:m,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:v}),o?y.cloneElement(y.Children.only(s),Ot(Ot({},S),{ref:_})):y.createElement(w,Ot({},S,{className:l,ref:_}),s))});Sp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Sp.classNames={fullWidth:_p,zeroRight:Tp};var qY={left:0,top:0,right:0,gap:0},L1=function(e){return parseInt(e||"",10)||0},GY=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[L1(n),L1(r),L1(i)]},KY=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return qY;var t=GY(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},XY=s1(),Os="data-scroll-locked",QY=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n="margin"),`
|
|
372
372
|
.`.concat(HY,` {
|
|
373
373
|
overflow: hidden `).concat(r,`;
|
|
374
374
|
padding-right: `).concat(s,"px ").concat(r,`;
|