@offshorly/chatbot-frontend-package
Version:
AI chatbot frontend package of Offshorly
9 lines • 633 kB
JavaScript
import*as t from"react";import e,{useCallback as n,forwardRef as r,Children as i,isValidElement as o,createElement as s,cloneElement as a,Fragment as c,createContext as l,useMemo as u,useContext as h,useRef as f,useEffect as d,useState as p,useLayoutEffect as m,useReducer as g,useInsertionEffect as v,useId as y}from"react";import*as b from"react-dom";import w,{flushSync as x}from"react-dom";function S(){return S=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},S.apply(this,arguments)}function A(...t){return e=>t.forEach(t=>function(t,e){"function"==typeof t?t(e):null!=t&&(t.current=e)}(t,e))}function L(...t){return n(A(...t),t)}const N=/*#__PURE__*/r((t,e)=>{const{children:n,...r}=t,c=i.toArray(n),l=c.find(_);if(l){const t=l.props.children,n=c.map(e=>e===l?i.count(t)>1?i.only(null):/*#__PURE__*/o(t)?t.props.children:null:e);/*#__PURE__*/
return s(P,S({},r,{ref:e}),/*#__PURE__*/o(t)?/*#__PURE__*/a(t,void 0,n):null)}/*#__PURE__*/
return s(P,S({},r,{ref:e}),n)});N.displayName="Slot";const P=/*#__PURE__*/r((t,e)=>{const{children:n,...r}=t;/*#__PURE__*/
return o(n)?/*#__PURE__*/a(n,{...k(r,n.props),ref:e?A(e,n.ref):n.ref}):i.count(n)>1?i.only(null):null});P.displayName="SlotClone";const E=({children:t})=>/*#__PURE__*/s(c,null,t);function _(t){/*#__PURE__*/
return o(t)&&t.type===E}function k(t,e){const n={...e};for(const r in e){const i=t[r],o=e[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...t)=>{o(...t),i(...t)}:i&&(n[r]=i):"style"===r?n[r]={...i,...o}:"className"===r&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...t,...n}}function C(t){var e,n,r="";if("string"==typeof t||"number"==typeof t)r+=t;else if("object"==typeof t)if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=C(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function O(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=C(t))&&(r&&(r+=" "),r+=e);return r}const T=t=>"boolean"==typeof t?"".concat(t):0===t?"0":t,F=O,R="-";function I(t){const e=function(t){const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]},i=function(t,e){return e?t.map(([t,n])=>[t,n.map(t=>"string"==typeof t?e+t:"object"==typeof t?Object.fromEntries(Object.entries(t).map(([t,n])=>[e+t,n])):t)]):t}(Object.entries(t.classGroups),n);return i.forEach(([t,n])=>{D(n,r,t,e)}),r}(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:function(t){const n=t.split(R);return""===n[0]&&1!==n.length&&n.shift(),M(n,e)||function(t){if(j.test(t)){const e=j.exec(t)[1],n=e?.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}}(t)},getConflictingClassGroupIds:function(t,e){const i=n[t]||[];return e&&r[t]?[...i,...r[t]]:i}}}function M(t,e){if(0===t.length)return e.classGroupId;const n=e.nextPart.get(t[0]),r=n?M(t.slice(1),n):void 0;if(r)return r;if(0===e.validators.length)return;const i=t.join(R);return e.validators.find(({validator:t})=>t(i))?.classGroupId}const j=/^\[(.+)\]$/;function D(t,e,n,r){t.forEach(t=>{if("string"!=typeof t){if("function"==typeof t)return t.isThemeGetter?void D(t(r),e,n,r):void e.validators.push({validator:t,classGroupId:n});Object.entries(t).forEach(([t,i])=>{D(i,B(e,t),n,r)})}else(""===t?e:B(e,t)).classGroupId=n})}function B(t,e){let n=t;return e.split(R).forEach(t=>{n.nextPart.has(t)||n.nextPart.set(t,{nextPart:new Map,validators:[]}),n=n.nextPart.get(t)}),n}function q(t){if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;function i(i,o){n.set(i,o),e++,e>t&&(e=0,r=n,n=new Map)}return{get(t){let e=n.get(t);return void 0!==e?e:void 0!==(e=r.get(t))?(i(t,e),e):void 0},set(t,e){n.has(t)?n.set(t,e):i(t,e)}}}const U="!";function z(t){const e=t.separator,n=1===e.length,r=e[0],i=e.length;return function(t){const o=[];let s,a=0,c=0;for(let l=0;l<t.length;l++){let u=t[l];if(0===a){if(u===r&&(n||t.slice(l,l+i)===e)){o.push(t.slice(c,l)),c=l+i;continue}if("/"===u){s=l;continue}}"["===u?a++:"]"===u&&a--}const l=0===o.length?t:t.substring(c),u=l.startsWith(U);return{modifiers:o,hasImportantModifier:u,baseClassName:u?l.substring(1):l,maybePostfixModifierPosition:s&&s>c?s-c:void 0}}}const V=/\s+/;function H(){let t,e,n=0,r="";for(;n<arguments.length;)(t=arguments[n++])&&(e=W(t))&&(r&&(r+=" "),r+=e);return r}function W(t){if("string"==typeof t)return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=W(t[r]))&&(n&&(n+=" "),n+=e);return n}function G(t,...e){let n,r,i,o=function(a){const c=e.reduce((t,e)=>e(t),t());return n=function(t){return{cache:q(t.cacheSize),splitModifiers:z(t),...I(t)}}(c),r=n.cache.get,i=n.cache.set,o=s,s(a)};function s(t){const e=r(t);if(e)return e;const o=function(t,e){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:i}=e,o=new Set;return t.trim().split(V).map(t=>{const{modifiers:e,hasImportantModifier:i,baseClassName:o,maybePostfixModifierPosition:s}=n(t);let a=r(s?o.substring(0,s):o),c=Boolean(s);if(!a){if(!s)return{isTailwindClass:!1,originalClassName:t};if(a=r(o),!a)return{isTailwindClass:!1,originalClassName:t};c=!1}const l=function(t){if(t.length<=1)return t;const e=[];let n=[];return t.forEach(t=>{"["===t[0]?(e.push(...n.sort(),t),n=[]):n.push(t)}),e.push(...n.sort()),e}(e).join(":");return{isTailwindClass:!0,modifierId:i?l+U:l,classGroupId:a,originalClassName:t,hasPostfixModifier:c}}).reverse().filter(t=>{if(!t.isTailwindClass)return!0;const{modifierId:e,classGroupId:n,hasPostfixModifier:r}=t,s=e+n;return!o.has(s)&&(o.add(s),i(n,r).forEach(t=>o.add(e+t)),!0)}).reverse().map(t=>t.originalClassName).join(" ")}(t,n);return i(t,o),o}return function(){return o(H.apply(null,arguments))}}function K(t){const e=e=>e[t]||[];return e.isThemeGetter=!0,e}const $=/^\[(?:([a-z-]+):)?(.+)\]$/i,Y=/^\d+\/\d+$/,Q=/*#__PURE__*/new Set(["px","full","screen"]),X=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,J=/\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$/,Z=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,tt=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,et=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function nt(t){return it(t)||Q.has(t)||Y.test(t)}function rt(t){return vt(t,"length",yt)}function it(t){return Boolean(t)&&!Number.isNaN(Number(t))}function ot(t){return vt(t,"number",it)}function st(t){return Boolean(t)&&Number.isInteger(Number(t))}function at(t){return t.endsWith("%")&&it(t.slice(0,-1))}function ct(t){return $.test(t)}function lt(t){return X.test(t)}const ut=/*#__PURE__*/new Set(["length","size","percentage"]);function ht(t){return vt(t,ut,bt)}function ft(t){return vt(t,"position",bt)}const dt=/*#__PURE__*/new Set(["image","url"]);function pt(t){return vt(t,dt,xt)}function mt(t){return vt(t,"",wt)}function gt(){return!0}function vt(t,e,n){const r=$.exec(t);return!!r&&(r[1]?"string"==typeof e?r[1]===e:e.has(r[1]):n(r[2]))}function yt(t){return J.test(t)&&!Z.test(t)}function bt(){return!1}function wt(t){return tt.test(t)}function xt(t){return et.test(t)}function St(){const t=K("colors"),e=K("spacing"),n=K("blur"),r=K("brightness"),i=K("borderColor"),o=K("borderRadius"),s=K("borderSpacing"),a=K("borderWidth"),c=K("contrast"),l=K("grayscale"),u=K("hueRotate"),h=K("invert"),f=K("gap"),d=K("gradientColorStops"),p=K("gradientColorStopPositions"),m=K("inset"),g=K("margin"),v=K("opacity"),y=K("padding"),b=K("saturate"),w=K("scale"),x=K("sepia"),S=K("skew"),A=K("space"),L=K("translate"),N=()=>["auto",ct,e],P=()=>[ct,e],E=()=>["",nt,rt],_=()=>["auto",it,ct],k=()=>["","0",ct],C=()=>[it,ot],O=()=>[it,ct];return{cacheSize:500,separator:":",theme:{colors:[gt],spacing:[nt,rt],blur:["none","",lt,ct],brightness:C(),borderColor:[t],borderRadius:["none","","full",lt,ct],borderSpacing:P(),borderWidth:E(),contrast:C(),grayscale:k(),hueRotate:O(),invert:k(),gap:P(),gradientColorStops:[t],gradientColorStopPositions:[at,rt],inset:N(),margin:N(),opacity:C(),padding:P(),saturate:C(),scale:C(),sepia:k(),skew:O(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",ct]}],container:["container"],columns:[{columns:[lt]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"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:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",ct]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",st,ct]}],basis:[{basis:N()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ct]}],grow:[{grow:k()}],shrink:[{shrink:k()}],order:[{order:["first","last","none",st,ct]}],"grid-cols":[{"grid-cols":[gt]}],"col-start-end":[{col:["auto",{span:["full",st,ct]},ct]}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":[gt]}],"row-start-end":[{row:["auto",{span:[st,ct]},ct]}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ct]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ct]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ct,e]}],"min-w":[{"min-w":[ct,e,"min","max","fit"]}],"max-w":[{"max-w":[ct,e,"none","full","min","max","fit","prose",{screen:[lt]},lt]}],h:[{h:[ct,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ct,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ct,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ct,e,"auto","min","max","fit"]}],"font-size":[{text:["base",lt,rt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ot]}],"font-family":[{font:[gt]}],"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",ct]}],"line-clamp":[{"line-clamp":["none",it,ot]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",nt,ct]}],"list-image":[{"list-image":["none",ct]}],"list-style-type":[{list:["none","disc","decimal",ct]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",nt,rt]}],"underline-offset":[{"underline-offset":["auto",nt,ct]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ct]}],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",ct]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",ft]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ht]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},pt]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[d]}],"gradient-via":[{via:[d]}],"gradient-to":[{to:[d]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[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:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[nt,ct]}],"outline-w":[{outline:[nt,rt]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:E()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[nt,rt]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",lt,mt]}],"shadow-color":[{shadow:[gt]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"]}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",lt,ct]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[h]}],saturate:[{saturate:[b]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ct]}],duration:[{duration:O()}],ease:[{ease:["linear","in","out","in-out",ct]}],delay:[{delay:O()}],animate:[{animate:["none","spin","ping","pulse","bounce",ct]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[st,ct]}],"translate-x":[{"translate-x":[L]}],"translate-y":[{"translate-y":[L]}],"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",ct]}],accent:[{accent:["auto",t]}],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",ct]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",ct]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[nt,rt,ot]}],stroke:[{stroke:[t,"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-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"]}}}const At=/*#__PURE__*/G(St);function Lt(){return At(O([].slice.call(arguments)))}const Nt=(Pt="inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",Et={variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",ghostNoHover:"hover:bg-none hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}},t=>{var e;if(null==(null==Et?void 0:Et.variants))return F(Pt,null==t?void 0:t.class,null==t?void 0:t.className);const{variants:n,defaultVariants:r}=Et,i=Object.keys(n).map(e=>{const i=null==t?void 0:t[e],o=null==r?void 0:r[e];if(null===i)return null;const s=T(i)||T(o);return n[e][s]}),o=t&&Object.entries(t).reduce((t,e)=>{let[n,r]=e;return void 0===r||(t[n]=r),t},{}),s=null==Et||null===(e=Et.compoundVariants)||void 0===e?void 0:e.reduce((t,e)=>{let{class:n,className:i,...s}=e;return Object.entries(s).every(t=>{let[e,n]=t;return Array.isArray(n)?n.includes({...r,...o}[e]):{...r,...o}[e]===n})?[...t,n,i]:t},[]);return F(Pt,i,s,null==t?void 0:t.class,null==t?void 0:t.className)});var Pt,Et;const _t=t.forwardRef(({className:e,variant:n,size:r,asChild:i=!1,...o},s)=>t.createElement(i?N:"button",{className:Lt(Nt({variant:n,size:r,className:e})),ref:s,...o}));function kt({className:t,...n}){return e.createElement("div",{className:Lt("animate-pulse rounded-md bg-muted",t),...n})}_t.displayName="Button";var Ct={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Ot=(t,e)=>{const n=r(({color:n="currentColor",size:r=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:a="",children:c,...l},u)=>{return s("svg",{ref:u,...Ct,width:r,height:r,stroke:n,strokeWidth:o?24*Number(i)/Number(r):i,className:["lucide",`lucide-${h=t,h.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,a].join(" "),...l},[...e.map(([t,e])=>s(t,e)),...Array.isArray(c)?c:[c]]);var h});return n.displayName=`${t}`,n},Tt=Ot("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),Ft=Ot("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]),Rt=Ot("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),It=Ot("MessageSquarePlus",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M9 10h6",key:"9gxzsh"}]]),Mt=Ot("MicOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2",key:"80xlxr"}],["path",{d:"M5 10v2a7 7 0 0 0 12 5",key:"p2k8kg"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]),jt=Ot("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]),Dt=Ot("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]),Bt=Ot("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z",key:"ymcmye"}]]),qt=Ot("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),Ut=Ot("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]),zt=Ot("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]),Vt=Ot("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),Ht=Ot("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);class Wt extends e.Component{render(){const{getSummaryQuery:t,createSummaryMutation:n,quickMessages:r,loading:i}=this.props;return t.isLoading||n.isLoading||i?e.createElement("div",{className:"flex h-full flex-col justify-between p-6"},e.createElement("div",{className:"flex flex-col space-y-6"},e.createElement("div",{className:"space-y-4"},e.createElement(kt,{className:"h-8"}),e.createElement(kt,{className:"h-40"})),e.createElement("div",{className:"space-y-4"},e.createElement(kt,{className:"h-8"}),e.createElement(kt,{className:"h-40"})),e.createElement("div",{className:"space-y-4"},e.createElement(kt,{className:"h-8"}),e.createElement(kt,{className:"h-40"})))):e.createElement("div",{className:"flex flex-col space-y-6 p-6"},e.createElement("div",null,e.createElement("h4",{className:"scroll-m-20 text-xl font-semibold tracking-tight"},"Column Descriptions"),e.createElement("ul",{className:"ml-6 mt-6 list-disc [&>li]:mt-2"},Object.entries(t.data?.summary?.columnsDescriptions||{}).map(([t,n])=>e.createElement("li",{key:t},t,": ",n)))),e.createElement("div",null,e.createElement("h4",{className:"scroll-m-20 text-xl font-semibold tracking-tight"},"General Statistics"),e.createElement("p",{className:"leading-7 [&:not(:first-child)]:mt-6"},t.data?.summary?.generalStatistics)),e.createElement("div",null,e.createElement("h4",{className:"scroll-m-20 text-xl font-semibold tracking-tight"},"General Analysis"),e.createElement("p",{className:"leading-7 [&:not(:first-child)]:mt-6"},t.data?.summary?.generalAnalysis)),e.createElement("div",null,e.createElement("h4",{className:"scroll-m-20 text-xl font-semibold tracking-tight"},"Questions"),e.createElement("ul",{className:"ml-6 mt-6 list-disc [&>li]:mt-2"},r.slice(0,3).map(t=>e.createElement("li",{key:t},t)))),e.createElement("div",null,e.createElement("h4",{className:"scroll-m-20 text-xl font-semibold tracking-tight"},"Opportunities"),e.createElement("p",{className:"leading-7 [&:not(:first-child)]:mt-6"},t.data?.summary?.opportunities)),e.createElement("div",null,e.createElement("h4",{className:"scroll-m-20 text-xl font-semibold tracking-tight"},"Data Contents"),e.createElement("p",{className:"leading-7 [&:not(:first-child)]:mt-6"},t.data?.summary?.dataContents)),e.createElement(_t,{onClick:()=>n.mutate()},e.createElement(qt,{className:"mr-2 h-4 w-4"})," Re-analyze"))}}const Gt=t=>{if(!t)return"";const e=new Uint8Array(atob(t).split("").map(t=>t.charCodeAt(0)));return URL.createObjectURL(new Blob([e],{type:"image/png"}))};function Kt({index:t=0,message:n="",loading:r=!1,showSteps:i,isLatestMessage:o,input:s,isFavorite:a,handleCreateSteps:c,handleFavorites:l,onImageClick:u}){const h=t%2==0,f="relative mb-12 rounded-2xl border p-6 pb-12",d="absolute -bottom-6 left-4 flex aspect-square w-12 items-center justify-center rounded-2xl bg-blue-500 text-white";if(r)return e.createElement("div",{className:f},e.createElement("div",{className:"flex items-center space-x-2 pb-4"},e.createElement(Rt,{size:16,className:"animate-spin"}),e.createElement("p",{className:"text-muted-foreground"},"Hold on, I'm thinking...")),e.createElement("div",{className:d},e.createElement(Tt,null)));if(h)return e.createElement("div",{className:f},e.createElement("div",{className:"w-full flex justify-between gap-4"},e.createElement("p",{className:"break-words"},n),e.createElement("button",{className:"",onClick:()=>{l(n,a)},disabled:r},e.createElement(zt,a?{stroke:"black",fill:"yellow",size:20}:{size:20}))),e.createElement("div",{className:"absolute -bottom-6 right-4 flex aspect-square w-12 items-center justify-center rounded-2xl bg-primary text-white"},e.createElement(Vt,null)));const{image:p="",message:m=""}=JSON.parse(JSON.stringify(n)),g=Gt(p);return e.createElement("div",{className:f},e.createElement("p",{className:"whitespace-pre-line"},m.trim()),p?e.createElement("img",{className:"h-auto max-w-md",src:g,alt:"API response image",onClick:()=>{u(g)},style:{cursor:"pointer"}}):null,e.createElement("div",{className:d},e.createElement(Tt,null)),i&&o&&e.createElement(_t,{onClick:()=>function(t){try{return c(t),Promise.resolve()}catch(t){return Promise.reject(t)}}(s),size:"icon",variant:"default",className:"absolute right-8 h-8 w-28"},"Show Steps"))}function $t(t,e,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==t||t(r),!1===n||!r.defaultPrevented)return null==e?void 0:e(r)}}function Yt(t,e=[]){let n=[];const r=()=>{const e=n.map(t=>/*#__PURE__*/l(t));return function(n){const r=(null==n?void 0:n[t])||e;return u(()=>({[`__scope${t}`]:{...n,[t]:r}}),[n,r])}};return r.scopeName=t,[function(e,r){const i=/*#__PURE__*/l(r),o=n.length;function a(e){const{scope:n,children:r,...a}=e,c=(null==n?void 0:n[t][o])||i,l=u(()=>a,Object.values(a));/*#__PURE__*/
return s(c.Provider,{value:l},r)}return n=[...n,r],a.displayName=e+"Provider",[a,function(n,s){const a=h((null==s?void 0:s[t][o])||i);if(a)return a;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${e}\``)}]},Qt(r,...e)]}function Qt(...t){const e=t[0];if(1===t.length)return e;const n=()=>{const n=t.map(t=>({useScope:t(),scopeName:t.scopeName}));return function(t){const r=n.reduce((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]}),{});return u(()=>({[`__scope${e.scopeName}`]:r}),[r])}};return n.scopeName=e.scopeName,n}function Xt(t){const e=f(t);return d(()=>{e.current=t}),u(()=>(...t)=>{var n;return null===(n=e.current)||void 0===n?void 0:n.call(e,...t)},[])}function Jt({prop:t,defaultProp:e,onChange:r=(()=>{})}){const[i,o]=function({defaultProp:t,onChange:e}){const n=p(t),[r]=n,i=f(r),o=Xt(e);return d(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}({defaultProp:e,onChange:r}),s=void 0!==t,a=s?t:i,c=Xt(r);return[a,n(e=>{if(s){const n="function"==typeof e?e(t):e;n!==t&&c(n)}else o(e)},[s,t,o,c])]}const Zt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((t,e)=>{const n=/*#__PURE__*/r((t,n)=>{const{asChild:r,...i}=t,o=r?N:e;return d(()=>{window[Symbol.for("radix-ui")]=!0},[]),/*#__PURE__*/s(o,S({},i,{ref:n}))});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function te(t,e){t&&x(()=>t.dispatchEvent(e))}function ee(t){const n=t+"CollectionProvider",[r,i]=Yt(n),[o,s]=r(n,{collectionRef:{current:null},itemMap:new Map}),a=t+"CollectionSlot",c=t+"CollectionItemSlot",l="data-radix-collection-item";return[{Provider:t=>{const{scope:n,children:r}=t,i=e.useRef(null),s=e.useRef(new Map).current;/*#__PURE__*/
return e.createElement(o,{scope:n,itemMap:s,collectionRef:i},r)},Slot:/*#__PURE__*/e.forwardRef((t,n)=>{const{scope:r,children:i}=t,o=L(n,s(a,r).collectionRef);/*#__PURE__*/
return e.createElement(N,{ref:o},i)}),ItemSlot:/*#__PURE__*/e.forwardRef((t,n)=>{const{scope:r,children:i,...o}=t,a=e.useRef(null),u=L(n,a),h=s(c,r);return e.useEffect(()=>(h.itemMap.set(a,{ref:a,...o}),()=>{h.itemMap.delete(a)})),/*#__PURE__*/e.createElement(N,{[l]:"",ref:u},i)})},function(n){const r=s(t+"CollectionConsumer",n),i=e.useCallback(()=>{const t=r.collectionRef.current;if(!t)return[];const e=Array.from(t.querySelectorAll(`[${l}]`)),n=Array.from(r.itemMap.values()).sort((t,n)=>e.indexOf(t.ref.current)-e.indexOf(n.ref.current));return n},[r.collectionRef,r.itemMap]);return i},i]}const ne=/*#__PURE__*/l(void 0);function re(t){const e=h(ne);return t||e||"ltr"}const ie="dismissableLayer.update";let oe;const se=/*#__PURE__*/l({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ae=/*#__PURE__*/r((t,e)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:c,onDismiss:l,...u}=t,m=h(se),[g,v]=p(null),y=null!==(n=null==g?void 0:g.ownerDocument)&&void 0!==n?n:null===globalThis||void 0===globalThis?void 0:globalThis.document,[,b]=p({}),w=L(e,t=>v(t)),x=Array.from(m.layers),[A]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),N=x.indexOf(A),P=g?x.indexOf(g):-1,E=m.layersWithOutsidePointerEventsDisabled.size>0,_=P>=N,k=function(t,e=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const n=Xt(t),r=f(!1),i=f(()=>{});return d(()=>{const t=t=>{if(t.target&&!r.current){const s={originalEvent:t};function o(){le("dismissableLayer.pointerDownOutside",n,s,{discrete:!0})}"touch"===t.pointerType?(e.removeEventListener("click",i.current),i.current=o,e.addEventListener("click",i.current,{once:!0})):o()}else e.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",t)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",t),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}(t=>{const e=t.target,n=[...m.branches].some(t=>t.contains(e));_&&!n&&(null==o||o(t),null==c||c(t),t.defaultPrevented||null==l||l())},y),C=function(t,e=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const n=Xt(t),r=f(!1);return d(()=>{const t=t=>{t.target&&!r.current&&le("dismissableLayer.focusOutside",n,{originalEvent:t},{discrete:!1})};return e.addEventListener("focusin",t),()=>e.removeEventListener("focusin",t)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(t=>{const e=t.target;[...m.branches].some(t=>t.contains(e))||(null==a||a(t),null==c||c(t),t.defaultPrevented||null==l||l())},y);return function(t,e=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const n=Xt(t);d(()=>{const t=t=>{"Escape"===t.key&&n(t)};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)},[n,e])}(t=>{P===m.layers.size-1&&(null==i||i(t),!t.defaultPrevented&&l&&(t.preventDefault(),l()))},y),d(()=>{if(g)return r&&(0===m.layersWithOutsidePointerEventsDisabled.size&&(oe=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(g)),m.layers.add(g),ce(),()=>{r&&1===m.layersWithOutsidePointerEventsDisabled.size&&(y.body.style.pointerEvents=oe)}},[g,y,r,m]),d(()=>()=>{g&&(m.layers.delete(g),m.layersWithOutsidePointerEventsDisabled.delete(g),ce())},[g,m]),d(()=>{const t=()=>b({});return document.addEventListener(ie,t),()=>document.removeEventListener(ie,t)},[]),/*#__PURE__*/s(Zt.div,S({},u,{ref:w,style:{pointerEvents:E?_?"auto":"none":void 0,...t.style},onFocusCapture:$t(t.onFocusCapture,C.onFocusCapture),onBlurCapture:$t(t.onBlurCapture,C.onBlurCapture),onPointerDownCapture:$t(t.onPointerDownCapture,k.onPointerDownCapture)}))});function ce(){const t=new CustomEvent(ie);document.dispatchEvent(t)}function le(t,e,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?te(i,o):i.dispatchEvent(o)}let ue=0;function he(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}const fe="focusScope.autoFocusOnMount",de="focusScope.autoFocusOnUnmount",pe={bubbles:!1,cancelable:!0},me=/*#__PURE__*/r((t,e)=>{const{loop:r=!1,trapped:i=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...c}=t,[l,u]=p(null),h=Xt(o),m=Xt(a),g=f(null),v=L(e,t=>u(t)),y=f({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d(()=>{if(i){function t(t){if(y.paused||!l)return;const e=t.target;l.contains(e)?g.current=e:be(g.current,{select:!0})}function e(t){if(y.paused||!l)return;const e=t.relatedTarget;null!==e&&(l.contains(e)||be(g.current,{select:!0}))}document.addEventListener("focusin",t),document.addEventListener("focusout",e);const n=new MutationObserver(function(t){if(document.activeElement===document.body)for(const e of t)e.removedNodes.length>0&&be(l)});return l&&n.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",t),document.removeEventListener("focusout",e),n.disconnect()}}},[i,l,y.paused]),d(()=>{if(l){we.add(y);const t=document.activeElement;if(!l.contains(t)){const e=new CustomEvent(fe,pe);l.addEventListener(fe,h),l.dispatchEvent(e),e.defaultPrevented||(function(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(be(r,{select:e}),document.activeElement!==n)return}(ge(l).filter(t=>"A"!==t.tagName),{select:!0}),document.activeElement===t&&be(l))}return()=>{l.removeEventListener(fe,h),setTimeout(()=>{const e=new CustomEvent(de,pe);l.addEventListener(de,m),l.dispatchEvent(e),e.defaultPrevented||be(null!=t?t:document.body,{select:!0}),l.removeEventListener(de,m),we.remove(y)},0)}}},[l,h,m,y]);const b=n(t=>{if(!r&&!i)return;if(y.paused)return;const e=document.activeElement;if("Tab"===t.key&&!t.altKey&&!t.ctrlKey&&!t.metaKey&&e){const n=t.currentTarget,[i,o]=function(t){const e=ge(t);return[ve(e,t),ve(e.reverse(),t)]}(n);i&&o?t.shiftKey||e!==o?t.shiftKey&&e===i&&(t.preventDefault(),r&&be(o,{select:!0})):(t.preventDefault(),r&&be(i,{select:!0})):e===n&&t.preventDefault()}},[r,i,y.paused]);/*#__PURE__*/
return s(Zt.div,S({tabIndex:-1},c,{ref:v,onKeyDown:b}))});function ge(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:t=>t.disabled||t.hidden||"INPUT"===t.tagName&&"hidden"===t.type?NodeFilter.FILTER_SKIP:t.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)e.push(n.currentNode);return e}function ve(t,e){for(const n of t)if(!ye(n,{upTo:e}))return n}function ye(t,{upTo:e}){if("hidden"===getComputedStyle(t).visibility)return!0;for(;t;){if(void 0!==e&&t===e)return!1;if("none"===getComputedStyle(t).display)return!0;t=t.parentElement}return!1}function be(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&function(t){return t instanceof HTMLInputElement&&"select"in t}(t)&&e&&t.select()}}const we=function(){let t=[];return{add(e){const n=t[0];e!==n&&(null==n||n.pause()),t=xe(t,e),t.unshift(e)},remove(e){var n;t=xe(t,e),null===(n=t[0])||void 0===n||n.resume()}}}();function xe(t,e){const n=[...t],r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}const Se=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?m:()=>{},Ae=t["useId".toString()]||(()=>{});let Le=0;function Ne(e){const[n,r]=t.useState(Ae());return Se(()=>{e||r(t=>null!=t?t:String(Le++))},[e]),e||(n?`radix-${n}`:"")}const Pe=["top","right","bottom","left"],Ee=Math.min,_e=Math.max,ke=Math.round,Ce=Math.floor,Oe=t=>({x:t,y:t}),Te={left:"right",right:"left",bottom:"top",top:"bottom"},Fe={start:"end",end:"start"};function Re(t,e,n){return _e(t,Ee(e,n))}function Ie(t,e){return"function"==typeof t?t(e):t}function Me(t){return t.split("-")[0]}function je(t){return t.split("-")[1]}function De(t){return"x"===t?"y":"x"}function Be(t){return"y"===t?"height":"width"}function qe(t){return["top","bottom"].includes(Me(t))?"y":"x"}function Ue(t){return De(qe(t))}function ze(t){return t.replace(/start|end/g,t=>Fe[t])}function Ve(t){return t.replace(/left|right|bottom|top/g,t=>Te[t])}function He(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function We(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function Ge(t,e,n){let{reference:r,floating:i}=t;const o=qe(e),s=Ue(e),a=Be(s),c=Me(e),l="y"===o,u=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let d;switch(c){case"top":d={x:u,y:r.y-i.height};break;case"bottom":d={x:u,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:h};break;case"left":d={x:r.x-i.width,y:h};break;default:d={x:r.x,y:r.y}}switch(je(e)){case"start":d[s]-=f*(n&&l?-1:1);break;case"end":d[s]+=f*(n&&l?-1:1)}return d}async function Ke(t,e){var n;void 0===e&&(e={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:c}=t,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:f=!1,padding:d=0}=Ie(e,t),p=He(d),m=a[f?"floating"===h?"reference":"floating":h],g=We(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(m)))||n?m:m.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),v="floating"===h?{...s.floating,x:r,y:i}:s.reference,y=await(null==o.getOffsetParent?void 0:o.getOffsetParent(a.floating)),b=await(null==o.isElement?void 0:o.isElement(y))&&await(null==o.getScale?void 0:o.getScale(y))||{x:1,y:1},w=We(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:c}):v);return{top:(g.top-w.top+p.top)/b.y,bottom:(w.bottom-g.bottom+p.bottom)/b.y,left:(g.left-w.left+p.left)/b.x,right:(w.right-g.right+p.right)/b.x}}function $e(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Ye(t){return Pe.some(e=>t[e]>=0)}const Qe=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=e,c=await async function(t,e){const{placement:n,platform:r,elements:i}=t,o=await(null==r.isRTL?void 0:r.isRTL(i.floating)),s=Me(n),a=je(n),c="y"===qe(n),l=["left","top"].includes(s)?-1:1,u=o&&c?-1:1,h=Ie(e,t);let{mainAxis:f,crossAxis:d,alignmentAxis:p}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...h};return a&&"number"==typeof p&&(d="end"===a?-1*p:p),c?{x:d*u,y:f*l}:{x:f*l,y:d*u}}(e,t);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:i+c.x,y:o+c.y,data:{...c,placement:s}}}}};function Xe(t){return tn(t)?(t.nodeName||"").toLowerCase():"#document"}function Je(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function Ze(t){var e;return null==(e=(tn(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function tn(t){return t instanceof Node||t instanceof Je(t).Node}function en(t){return t instanceof Element||t instanceof Je(t).Element}function nn(t){return t instanceof HTMLElement||t instanceof Je(t).HTMLElement}function rn(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof Je(t).ShadowRoot)}function on(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=un(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function sn(t){return["table","td","th"].includes(Xe(t))}function an(t){const e=cn(),n=un(t);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some(t=>(n.willChange||"").includes(t))||["paint","layout","strict","content"].some(t=>(n.contain||"").includes(t))}function cn(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function ln(t){return["html","body","#document"].includes(Xe(t))}function un(t){return Je(t).getComputedStyle(t)}function hn(t){return en(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function fn(t){if("html"===Xe(t))return t;const e=t.assignedSlot||t.parentNode||rn(t)&&t.host||Ze(t);return rn(e)?e.host:e}function dn(t){const e=fn(t);return ln(e)?t.ownerDocument?t.ownerDocument.body:t.body:nn(e)&&on(e)?e:dn(e)}function pn(t,e,n){var r;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=dn(t),o=i===(null==(r=t.ownerDocument)?void 0:r.body),s=Je(i);return o?e.concat(s,s.visualViewport||[],on(i)?i:[],s.frameElement&&n?pn(s.frameElement):[]):e.concat(i,pn(i,[],n))}function mn(t){const e=un(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=nn(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,a=ke(n)!==o||ke(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function gn(t){return en(t)?t:t.contextElement}function vn(t){const e=gn(t);if(!nn(e))return Oe(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=mn(e);let s=(o?ke(n.width):n.width)/r,a=(o?ke(n.height):n.height)/i;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const yn=/*#__PURE__*/Oe(0);function bn(t){const e=Je(t);return cn()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:yn}function wn(t,e,n,r){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),o=gn(t);let s=Oe(1);e&&(r?en(r)&&(s=vn(r)):s=vn(t));const a=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==Je(t))&&e}(o,n,r)?bn(o):Oe(0);let c=(i.left+a.x)/s.x,l=(i.top+a.y)/s.y,u=i.width/s.x,h=i.height/s.y;if(o){const t=Je(o),e=r&&en(r)?Je(r):r;let n=t,i=n.frameElement;for(;i&&r&&e!==n;){const t=vn(i),e=i.getBoundingClientRect(),r=un(i),o=e.left+(i.clientLeft+parseFloat(r.paddingLeft))*t.x,s=e.top+(i.clientTop+parseFloat(r.paddingTop))*t.y;c*=t.x,l*=t.y,u*=t.x,h*=t.y,c+=o,l+=s,n=Je(i),i=n.frameElement}}return We({width:u,height:h,x:c,y:l})}const xn=[":popover-open",":modal"];function Sn(t){return xn.some(e=>{try{return t.matches(e)}catch(t){return!1}})}function An(t){return wn(Ze(t)).left+hn(t).scrollLeft}function Ln(t,e,n){let r;if("viewport"===e)r=function(t,e){const n=Je(t),r=Ze(t),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,c=0;if(i){o=i.width,s=i.height;const t=cn();(!t||t&&"fixed"===e)&&(a=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:a,y:c}}(t,n);else if("document"===e)r=function(t){const e=Ze(t),n=hn(t),r=t.ownerDocument.body,i=_e(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=_e(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+An(t);const a=-n.scrollTop;return"rtl"===un(r).direction&&(s+=_e(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}(Ze(t));else if(en(e))r=function(t,e){const n=wn(t,!0,"fixed"===e),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=nn(t)?vn(t):Oe(1);return{width:t.clientWidth*o.x,height:t.clientHeight*o.y,x:i*o.x,y:r*o.y}}(e,n);else{const n=bn(t);r={...e,x:e.x-n.x,y:e.y-n.y}}return We(r)}function Nn(t,e){const n=fn(t);return!(n===e||!en(n)||ln(n))&&("fixed"===un(n).position||Nn(n,e))}function Pn(t,e,n){const r=nn(e),i=Ze(e),o=