react-semaphor 0.0.198 → 0.0.199
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/chunks/dashboard-plus-9A42WcJb.js +210 -0
- package/dist/chunks/{dashboard-plus-gibgO8pQ.js → dashboard-plus-Wujd_Iex.js} +392 -378
- package/dist/chunks/{index-ZPzRMi0w.js → index-NINsx4a4.js} +7 -7
- package/dist/chunks/{index-CQrzHhoZ.js → index-SN72ZAGK.js} +18 -18
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/dashboard.d.ts +1 -1
- package/dist/types/main.d.ts +1 -1
- package/dist/types/surfboard.d.ts +1 -1
- package/dist/types/types.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunks/dashboard-plus-it5xuE8z.js +0 -210
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var g9=Object.defineProperty;var m9=(e,t,n)=>t in e?g9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ne=(e,t,n)=>(m9(e,typeof t!="symbol"?t+"":t,n),n),ab=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var re=(e,t,n)=>(ab(e,t,"read from private field"),n?n.call(e):t.get(e)),Xe=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Ve=(e,t,n,r)=>(ab(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var Th=(e,t,n,r)=>({set _(o){Ve(e,t,o,n)},get _(){return re(e,t,r)}}),Ct=(e,t,n)=>(ab(e,t,"access private method"),n);const m=require("react"),Qo=require("react-dom");function
|
|
1
|
+
"use strict";var g9=Object.defineProperty;var m9=(e,t,n)=>t in e?g9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ne=(e,t,n)=>(m9(e,typeof t!="symbol"?t+"":t,n),n),ab=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var re=(e,t,n)=>(ab(e,t,"read from private field"),n?n.call(e):t.get(e)),Xe=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Ve=(e,t,n,r)=>(ab(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var Th=(e,t,n,r)=>({set _(o){Ve(e,t,o,n)},get _(){return re(e,t,r)}}),Ct=(e,t,n)=>(ab(e,t,"access private method"),n);const m=require("react"),Qo=require("react-dom");function B2(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const ge=B2(m),v9=B2(Qo);var zs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Uc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Fx(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var W0={exports:{}},yu={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.development.js
|
|
4
4
|
*
|
|
@@ -24,7 +24,7 @@ Check the top-level render call using <`+ce+">.")}return Z}}function Zo(D,Z){{if
|
|
|
24
24
|
*
|
|
25
25
|
* This source code is licensed under the MIT license found in the
|
|
26
26
|
* LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/var GC;function y9(){if(GC)return xu;GC=1;var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var u,f={},p=null,g=null;c!==void 0&&(p=""+c),l.key!==void 0&&(p=""+l.key),l.ref!==void 0&&(g=l.ref);for(u in l)r.call(l,u)&&!i.hasOwnProperty(u)&&(f[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)f[u]===void 0&&(f[u]=l[u]);return{$$typeof:t,type:a,key:p,ref:g,props:f,_owner:o.current}}return xu.Fragment=n,xu.jsx=s,xu.jsxs=s,xu}process.env.NODE_ENV==="production"?W0.exports=y9():W0.exports=b9();var O=W0.exports;function VT(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=VT(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Xp(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=VT(e))&&(r&&(r+=" "),r+=t);return r}const x9=Object.freeze(Object.defineProperty({__proto__:null,clsx:Xp,default:Xp},Symbol.toStringTag,{value:"Module"})),zx="-";function w9(e){const t=S9(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(s){const a=s.split(zx);return a[0]===""&&a.length!==1&&a.shift(),HT(a,t)||_9(s)}function i(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function HT(e,t){var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?HT(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(zx);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId}const YC=/^\[(.+)\]$/;function _9(e){if(YC.test(e)){const t=YC.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function S9(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return E9(Object.entries(e.classGroups),n).forEach(([i,s])=>{U0(s,r,i,t)}),r}function U0(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:KC(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(C9(o)){U0(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{U0(s,KC(t,i),n,r)})})}function KC(e,t){let n=e;return t.split(zx).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function C9(e){return e.isThemeGetter}function E9(e,t){return t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e}function R9(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function o(i,s){n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)}return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}}const WT="!";function O9(e){const t=e.separator,n=t.length===1,r=t[0],o=t.length;return function(s){const a=[];let l=0,c=0,u;for(let b=0;b<s.length;b++){let x=s[b];if(l===0){if(x===r&&(n||s.slice(b,b+o)===t)){a.push(s.slice(c,b)),c=b+o;continue}if(x==="/"){u=b;continue}}x==="["?l++:x==="]"&&l--}const f=a.length===0?s:s.substring(c),p=f.startsWith(WT),g=p?f.substring(1):f,v=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:v}}}function P9(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}function T9(e){return{cache:R9(e.cacheSize),splitModifiers:O9(e),...w9(e)}}const D9=/\s+/;function $9(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(D9).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:u}=n(s);let f=r(u?c.substring(0,u):c),p=!!u;if(!f){if(!u)return{isTailwindClass:!1,originalClassName:s};if(f=r(c),!f)return{isTailwindClass:!1,originalClassName:s};p=!1}const g=P9(a).join(":");return{isTailwindClass:!0,modifierId:l?g+WT:g,classGroupId:f,originalClassName:s,hasPostfixModifier:p}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=s,u=a+l;return i.has(u)?!1:(i.add(u),o(l,c).forEach(f=>i.add(a+f)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function k9(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=UT(t))&&(r&&(r+=" "),r+=n);return r}function UT(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=UT(e[r]))&&(n&&(n+=" "),n+=t);return n}function M9(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((u,f)=>f(u),e());return n=T9(c),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=$9(l,n);return o(l,u),u}return function(){return i(k9.apply(null,arguments))}}function un(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const qT=/^\[(?:([a-z-]+):)?(.+)\]$/i,A9=/^\d+\/\d+$/,I9=new Set(["px","full","screen"]),N9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,L9=/\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$/,F9=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,z9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Bo(e){return Ba(e)||I9.has(e)||A9.test(e)}function Os(e){return qc(e,"length",G9)}function Ba(e){return!!e&&!Number.isNaN(Number(e))}function Dh(e){return qc(e,"number",Ba)}function wu(e){return!!e&&Number.isInteger(Number(e))}function j9(e){return e.endsWith("%")&&Ba(e.slice(0,-1))}function wt(e){return qT.test(e)}function Ps(e){return N9.test(e)}const B9=new Set(["length","size","percentage"]);function V9(e){return qc(e,B9,GT)}function H9(e){return qc(e,"position",GT)}const W9=new Set(["image","url"]);function U9(e){return qc(e,W9,K9)}function q9(e){return qc(e,"",Y9)}function _u(){return!0}function qc(e,t,n){const r=qT.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function G9(e){return L9.test(e)}function GT(){return!1}function Y9(e){return F9.test(e)}function K9(e){return z9.test(e)}function X9(){const e=un("colors"),t=un("spacing"),n=un("blur"),r=un("brightness"),o=un("borderColor"),i=un("borderRadius"),s=un("borderSpacing"),a=un("borderWidth"),l=un("contrast"),c=un("grayscale"),u=un("hueRotate"),f=un("invert"),p=un("gap"),g=un("gradientColorStops"),v=un("gradientColorStopPositions"),b=un("inset"),x=un("margin"),w=un("opacity"),_=un("padding"),S=un("saturate"),R=un("scale"),C=un("sepia"),P=un("skew"),A=un("space"),M=un("translate"),T=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",wt,t],j=()=>[wt,t],X=()=>["",Bo,Os],G=()=>["auto",Ba,wt],B=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],J=()=>["solid","dashed","dotted","double","none"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],Y=()=>["start","end","center","between","around","evenly","stretch"],te=()=>["","0",wt],$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],V=()=>[Ba,Dh],Q=()=>[Ba,wt];return{cacheSize:500,separator:":",theme:{colors:[_u],spacing:[Bo,Os],blur:["none","",Ps,wt],brightness:V(),borderColor:[e],borderRadius:["none","","full",Ps,wt],borderSpacing:j(),borderWidth:X(),contrast:V(),grayscale:te(),hueRotate:Q(),invert:te(),gap:j(),gradientColorStops:[e],gradientColorStopPositions:[j9,Os],inset:F(),margin:F(),opacity:V(),padding:j(),saturate:V(),scale:V(),sepia:te(),skew:Q(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",wt]}],container:["container"],columns:[{columns:[Ps]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"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"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...B(),wt]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",wu,wt]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",wt]}],grow:[{grow:te()}],shrink:[{shrink:te()}],order:[{order:["first","last","none",wu,wt]}],"grid-cols":[{"grid-cols":[_u]}],"col-start-end":[{col:["auto",{span:["full",wu,wt]},wt]}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":[_u]}],"row-start-end":[{row:["auto",{span:[wu,wt]},wt]}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",wt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",wt]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...Y()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Y(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Y(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[_]}],px:[{px:[_]}],py:[{py:[_]}],ps:[{ps:[_]}],pe:[{pe:[_]}],pt:[{pt:[_]}],pr:[{pr:[_]}],pb:[{pb:[_]}],pl:[{pl:[_]}],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":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",wt,t]}],"min-w":[{"min-w":["min","max","fit",wt,Bo]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[Ps]},Ps,wt]}],h:[{h:[wt,t,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",Bo,wt]}],"max-h":[{"max-h":[wt,t,"min","max","fit"]}],"font-size":[{text:["base",Ps,Os]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Dh]}],"font-family":[{font:[_u]}],"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",wt]}],"line-clamp":[{"line-clamp":["none",Ba,Dh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Bo,wt]}],"list-image":[{"list-image":["none",wt]}],"list-style-type":[{list:["none","disc","decimal",wt]}],"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:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Bo,Os]}],"underline-offset":[{"underline-offset":["auto",Bo,wt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",wt]}],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",wt]}],"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:[...B(),H9]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",V9]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},U9]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"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":[w]}],"border-style":[{border:[...J(),"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":[w]}],"divide-style":[{divide:J()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...J()]}],"outline-offset":[{"outline-offset":[Bo,wt]}],"outline-w":[{outline:[Bo,Os]}],"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":[Bo,Os]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ps,q9]}],"shadow-color":[{shadow:[_u]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":H()}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ps,wt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[S]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"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",wt]}],duration:[{duration:Q()}],ease:[{ease:["linear","in","out","in-out",wt]}],delay:[{delay:Q()}],animate:[{animate:["none","spin","ping","pulse","bounce",wt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[R]}],"scale-x":[{"scale-x":[R]}],"scale-y":[{"scale-y":[R]}],rotate:[{rotate:[wu,wt]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",wt]}],accent:[{accent:["auto",e]}],appearance:["appearance-none"],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",wt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",wt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Bo,Os,Dh]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"]},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"],"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 Q9=M9(X9);class J9 extends Error{}J9.prototype.name="InvalidTokenError";function Pe(...e){return Q9(Xp(e))}async function Z9(e,t,n={}){try{const r=new URLSearchParams(n).toString(),o=`${e}?${r}`,i=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!i.ok){const a=await i.json();throw new Error((a==null?void 0:a.error)||`HTTP error! status: ${i.status}`)}return await i.json()}catch(r){throw console.error("Error during fetch:",r),r}}async function gf(e,t,n={}){try{const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(n)});return r.ok?await r.json():r.json().then(i=>{throw console.log(i.detail||"Unknown error occurred"),new Error((i==null?void 0:i.error)||`HTTP error! status: ${r.status}`)})}catch(r){throw console.error("Error during fetch:",r),r}}function e8(e){var t;if(navigator.clipboard&&e.current)navigator.clipboard.writeText(e.current.innerText).then(()=>console.log("Content copied to clipboard")).catch(n=>console.error("Failed to copy: ",n));else{const n=document.createElement("textarea");n.value=((t=e==null?void 0:e.current)==null?void 0:t.innerText)??"",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n),console.log("Content copied to clipboard")}}function YT(e,t){if(!e)return"";const n=/\{\{\s*ref\('([^']+)'\)\s*\}\}/g;return e.replace(n,(o,i)=>t8(i,t))}function t8(e,t){const n=t==null?void 0:t.find(r=>r.name===e);return n?`(${n.sql}) as ${n.name}`:(console.log(e),`'${e}_table'`)}function n8(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Mp="focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";var r8={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const XC=e=>{let t;const n=new Set,r=(l,c)=>{const u=typeof l=="function"?l(t):l;if(!Object.is(u,t)){const f=t;t=c??(typeof u!="object"||u===null)?u:Object.assign({},t,u),n.forEach(p=>p(t,f))}},o=()=>t,a={setState:r,getState:o,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(r8?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,o,a),a},o8=e=>e?XC(e):XC;var q0={exports:{}},lb={},$h={exports:{}},cb={};/**
|
|
27
|
+
*/var GC;function y9(){if(GC)return xu;GC=1;var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var u,f={},p=null,g=null;c!==void 0&&(p=""+c),l.key!==void 0&&(p=""+l.key),l.ref!==void 0&&(g=l.ref);for(u in l)r.call(l,u)&&!i.hasOwnProperty(u)&&(f[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)f[u]===void 0&&(f[u]=l[u]);return{$$typeof:t,type:a,key:p,ref:g,props:f,_owner:o.current}}return xu.Fragment=n,xu.jsx=s,xu.jsxs=s,xu}process.env.NODE_ENV==="production"?W0.exports=y9():W0.exports=b9();var O=W0.exports;function V2(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=V2(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Xp(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=V2(e))&&(r&&(r+=" "),r+=t);return r}const x9=Object.freeze(Object.defineProperty({__proto__:null,clsx:Xp,default:Xp},Symbol.toStringTag,{value:"Module"})),zx="-";function w9(e){const t=S9(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(s){const a=s.split(zx);return a[0]===""&&a.length!==1&&a.shift(),H2(a,t)||_9(s)}function i(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function H2(e,t){var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?H2(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(zx);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId}const YC=/^\[(.+)\]$/;function _9(e){if(YC.test(e)){const t=YC.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function S9(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return E9(Object.entries(e.classGroups),n).forEach(([i,s])=>{U0(s,r,i,t)}),r}function U0(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:KC(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(C9(o)){U0(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{U0(s,KC(t,i),n,r)})})}function KC(e,t){let n=e;return t.split(zx).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function C9(e){return e.isThemeGetter}function E9(e,t){return t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e}function R9(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function o(i,s){n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)}return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}}const W2="!";function O9(e){const t=e.separator,n=t.length===1,r=t[0],o=t.length;return function(s){const a=[];let l=0,c=0,u;for(let b=0;b<s.length;b++){let x=s[b];if(l===0){if(x===r&&(n||s.slice(b,b+o)===t)){a.push(s.slice(c,b)),c=b+o;continue}if(x==="/"){u=b;continue}}x==="["?l++:x==="]"&&l--}const f=a.length===0?s:s.substring(c),p=f.startsWith(W2),g=p?f.substring(1):f,v=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:v}}}function P9(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}function T9(e){return{cache:R9(e.cacheSize),splitModifiers:O9(e),...w9(e)}}const D9=/\s+/;function $9(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(D9).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:u}=n(s);let f=r(u?c.substring(0,u):c),p=!!u;if(!f){if(!u)return{isTailwindClass:!1,originalClassName:s};if(f=r(c),!f)return{isTailwindClass:!1,originalClassName:s};p=!1}const g=P9(a).join(":");return{isTailwindClass:!0,modifierId:l?g+W2:g,classGroupId:f,originalClassName:s,hasPostfixModifier:p}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=s,u=a+l;return i.has(u)?!1:(i.add(u),o(l,c).forEach(f=>i.add(a+f)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function k9(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=U2(t))&&(r&&(r+=" "),r+=n);return r}function U2(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=U2(e[r]))&&(n&&(n+=" "),n+=t);return n}function M9(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((u,f)=>f(u),e());return n=T9(c),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=$9(l,n);return o(l,u),u}return function(){return i(k9.apply(null,arguments))}}function un(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const q2=/^\[(?:([a-z-]+):)?(.+)\]$/i,A9=/^\d+\/\d+$/,I9=new Set(["px","full","screen"]),N9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,L9=/\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$/,F9=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,z9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Bo(e){return Ba(e)||I9.has(e)||A9.test(e)}function Os(e){return qc(e,"length",G9)}function Ba(e){return!!e&&!Number.isNaN(Number(e))}function Dh(e){return qc(e,"number",Ba)}function wu(e){return!!e&&Number.isInteger(Number(e))}function j9(e){return e.endsWith("%")&&Ba(e.slice(0,-1))}function wt(e){return q2.test(e)}function Ps(e){return N9.test(e)}const B9=new Set(["length","size","percentage"]);function V9(e){return qc(e,B9,G2)}function H9(e){return qc(e,"position",G2)}const W9=new Set(["image","url"]);function U9(e){return qc(e,W9,K9)}function q9(e){return qc(e,"",Y9)}function _u(){return!0}function qc(e,t,n){const r=q2.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function G9(e){return L9.test(e)}function G2(){return!1}function Y9(e){return F9.test(e)}function K9(e){return z9.test(e)}function X9(){const e=un("colors"),t=un("spacing"),n=un("blur"),r=un("brightness"),o=un("borderColor"),i=un("borderRadius"),s=un("borderSpacing"),a=un("borderWidth"),l=un("contrast"),c=un("grayscale"),u=un("hueRotate"),f=un("invert"),p=un("gap"),g=un("gradientColorStops"),v=un("gradientColorStopPositions"),b=un("inset"),x=un("margin"),w=un("opacity"),_=un("padding"),S=un("saturate"),R=un("scale"),C=un("sepia"),P=un("skew"),A=un("space"),M=un("translate"),T=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",wt,t],j=()=>[wt,t],X=()=>["",Bo,Os],G=()=>["auto",Ba,wt],B=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],J=()=>["solid","dashed","dotted","double","none"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],Y=()=>["start","end","center","between","around","evenly","stretch"],te=()=>["","0",wt],$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],V=()=>[Ba,Dh],Q=()=>[Ba,wt];return{cacheSize:500,separator:":",theme:{colors:[_u],spacing:[Bo,Os],blur:["none","",Ps,wt],brightness:V(),borderColor:[e],borderRadius:["none","","full",Ps,wt],borderSpacing:j(),borderWidth:X(),contrast:V(),grayscale:te(),hueRotate:Q(),invert:te(),gap:j(),gradientColorStops:[e],gradientColorStopPositions:[j9,Os],inset:F(),margin:F(),opacity:V(),padding:j(),saturate:V(),scale:V(),sepia:te(),skew:Q(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",wt]}],container:["container"],columns:[{columns:[Ps]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"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"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...B(),wt]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",wu,wt]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",wt]}],grow:[{grow:te()}],shrink:[{shrink:te()}],order:[{order:["first","last","none",wu,wt]}],"grid-cols":[{"grid-cols":[_u]}],"col-start-end":[{col:["auto",{span:["full",wu,wt]},wt]}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":[_u]}],"row-start-end":[{row:["auto",{span:[wu,wt]},wt]}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",wt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",wt]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...Y()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Y(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Y(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[_]}],px:[{px:[_]}],py:[{py:[_]}],ps:[{ps:[_]}],pe:[{pe:[_]}],pt:[{pt:[_]}],pr:[{pr:[_]}],pb:[{pb:[_]}],pl:[{pl:[_]}],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":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",wt,t]}],"min-w":[{"min-w":["min","max","fit",wt,Bo]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[Ps]},Ps,wt]}],h:[{h:[wt,t,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",Bo,wt]}],"max-h":[{"max-h":[wt,t,"min","max","fit"]}],"font-size":[{text:["base",Ps,Os]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Dh]}],"font-family":[{font:[_u]}],"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",wt]}],"line-clamp":[{"line-clamp":["none",Ba,Dh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Bo,wt]}],"list-image":[{"list-image":["none",wt]}],"list-style-type":[{list:["none","disc","decimal",wt]}],"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:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Bo,Os]}],"underline-offset":[{"underline-offset":["auto",Bo,wt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",wt]}],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",wt]}],"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:[...B(),H9]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",V9]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},U9]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"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":[w]}],"border-style":[{border:[...J(),"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":[w]}],"divide-style":[{divide:J()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...J()]}],"outline-offset":[{"outline-offset":[Bo,wt]}],"outline-w":[{outline:[Bo,Os]}],"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":[Bo,Os]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ps,q9]}],"shadow-color":[{shadow:[_u]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":H()}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ps,wt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[S]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"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",wt]}],duration:[{duration:Q()}],ease:[{ease:["linear","in","out","in-out",wt]}],delay:[{delay:Q()}],animate:[{animate:["none","spin","ping","pulse","bounce",wt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[R]}],"scale-x":[{"scale-x":[R]}],"scale-y":[{"scale-y":[R]}],rotate:[{rotate:[wu,wt]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",wt]}],accent:[{accent:["auto",e]}],appearance:["appearance-none"],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",wt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",wt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Bo,Os,Dh]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"]},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"],"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 Q9=M9(X9);class J9 extends Error{}J9.prototype.name="InvalidTokenError";function Pe(...e){return Q9(Xp(e))}async function Z9(e,t,n={}){try{const r=new URLSearchParams(n).toString(),o=`${e}?${r}`,i=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!i.ok){const a=await i.json();throw new Error((a==null?void 0:a.error)||`HTTP error! status: ${i.status}`)}return await i.json()}catch(r){throw console.error("Error during fetch:",r),r}}async function gf(e,t,n={}){try{const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(n)});return r.ok?await r.json():r.json().then(i=>{throw console.log(i.detail||"Unknown error occurred"),new Error((i==null?void 0:i.error)||`HTTP error! status: ${r.status}`)})}catch(r){throw console.error("Error during fetch:",r),r}}function e8(e){var t;if(navigator.clipboard&&e.current)navigator.clipboard.writeText(e.current.innerText).then(()=>console.log("Content copied to clipboard")).catch(n=>console.error("Failed to copy: ",n));else{const n=document.createElement("textarea");n.value=((t=e==null?void 0:e.current)==null?void 0:t.innerText)??"",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n),console.log("Content copied to clipboard")}}function Y2(e,t){if(!e)return"";const n=/\{\{\s*ref\('([^']+)'\)\s*\}\}/g;return e.replace(n,(o,i)=>t8(i,t))}function t8(e,t){const n=t==null?void 0:t.find(r=>r.name===e);return n?`(${n.sql}) as ${n.name}`:(console.log(e),`'${e}_table'`)}function n8(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Mp="focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";var r8={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const XC=e=>{let t;const n=new Set,r=(l,c)=>{const u=typeof l=="function"?l(t):l;if(!Object.is(u,t)){const f=t;t=c??(typeof u!="object"||u===null)?u:Object.assign({},t,u),n.forEach(p=>p(t,f))}},o=()=>t,a={setState:r,getState:o,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(r8?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,o,a),a},o8=e=>e?XC(e):XC;var q0={exports:{}},lb={},$h={exports:{}},cb={};/**
|
|
28
28
|
* @license React
|
|
29
29
|
* use-sync-external-store-shim.development.js
|
|
30
30
|
*
|
|
@@ -56,10 +56,10 @@ Check the top-level render call using <`+ce+">.")}return Z}}function Zo(D,Z){{if
|
|
|
56
56
|
*
|
|
57
57
|
* This source code is licensed under the MIT license found in the
|
|
58
58
|
* LICENSE file in the root directory of this source tree.
|
|
59
|
-
*/var tE;function l8(){if(tE)return db;tE=1;var e=m,t=jx();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return db.useSyncExternalStoreWithSelector=function(c,u,f,p,g){var v=i(null);if(v.current===null){var b={hasValue:!1,value:null};v.current=b}else b=v.current;v=a(function(){function w(P){if(!_){if(_=!0,S=P,P=p(P),g!==void 0&&b.hasValue){var A=b.value;if(g(A,P))return R=A}return R=P}if(A=R,r(S,P))return A;var M=p(P);return g!==void 0&&g(A,M)?A:(S=P,R=M)}var _=!1,S,R,C=f===void 0?null:f;return[function(){return w(u())},C===null?void 0:function(){return w(C())}]},[u,f,p,g]);var x=o(c,v[0],v[1]);return s(function(){b.hasValue=!0,b.value=x},[x]),l(x),x},db}process.env.NODE_ENV==="production"?q0.exports=l8():q0.exports=a8();var c8=q0.exports;const u8=Uc(c8);var KT={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:d8}=m,{useSyncExternalStoreWithSelector:f8}=u8;let nE=!1;function h8(e,t=e.getState,n){(KT?"production":void 0)!=="production"&&n&&!nE&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),nE=!0);const r=f8(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return d8(r),r}const rE=e=>{(KT?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?o8(e):e,n=(r,o)=>h8(t,r,o);return Object.assign(n,t),n},XT=e=>e?rE(e):rE;var QT=Symbol.for("immer-nothing"),oE=Symbol.for("immer-draftable"),ao=Symbol.for("immer-state"),p8=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function Mr(e,...t){if(process.env.NODE_ENV!=="production"){const n=p8[e],r=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Tc=Object.getPrototypeOf;function Dc(e){return!!e&&!!e[ao]}function al(e){var t;return e?JT(e)||Array.isArray(e)||!!e[oE]||!!((t=e.constructor)!=null&&t[oE])||zg(e)||jg(e):!1}var g8=Object.prototype.constructor.toString();function JT(e){if(!e||typeof e!="object")return!1;const t=Tc(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===g8}function fd(e,t){Fg(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function Fg(e){const t=e[ao];return t?t.type_:Array.isArray(e)?1:zg(e)?2:jg(e)?3:0}function G0(e,t){return Fg(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ZT(e,t,n){const r=Fg(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function m8(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function zg(e){return e instanceof Map}function jg(e){return e instanceof Set}function Ma(e){return e.copy_||e.base_}function Y0(e,t){if(zg(e))return new Map(e);if(jg(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&JT(e))return Tc(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[ao];let r=Reflect.ownKeys(n);for(let o=0;o<r.length;o++){const i=r[o],s=n[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[i]})}return Object.create(Tc(e),n)}function Bx(e,t=!1){return Bg(e)||Dc(e)||!al(e)||(Fg(e)>1&&(e.set=e.add=e.clear=e.delete=v8),Object.freeze(e),t&&fd(e,(n,r)=>Bx(r,!0))),e}function v8(){Mr(2)}function Bg(e){return Object.isFrozen(e)}var b8={};function ll(e){const t=b8[e];return t||Mr(0,e),t}var hd;function e2(){return hd}function y8(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function iE(e,t){t&&(ll("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function K0(e){X0(e),e.drafts_.forEach(x8),e.drafts_=null}function X0(e){e===hd&&(hd=e.parent_)}function sE(e){return hd=y8(hd,e)}function x8(e){const t=e[ao];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function aE(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[ao].modified_&&(K0(t),Mr(4)),al(e)&&(e=Qp(t,e),t.parent_||Jp(t,e)),t.patches_&&ll("Patches").generateReplacementPatches_(n[ao].base_,e,t.patches_,t.inversePatches_)):e=Qp(t,n,[]),K0(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==QT?e:void 0}function Qp(e,t,n){if(Bg(t))return t;const r=t[ao];if(!r)return fd(t,(o,i)=>lE(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return Jp(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const o=r.copy_;let i=o,s=!1;r.type_===3&&(i=new Set(o),o.clear(),s=!0),fd(i,(a,l)=>lE(e,r,o,a,l,n,s)),Jp(e,o,!1),n&&e.patches_&&ll("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function lE(e,t,n,r,o,i,s){if(process.env.NODE_ENV!=="production"&&o===n&&Mr(5),Dc(o)){const a=i&&t&&t.type_!==3&&!G0(t.assigned_,r)?i.concat(r):void 0,l=Qp(e,o,a);if(ZT(n,r,l),Dc(l))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(al(o)&&!Bg(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Qp(e,o),(!t||!t.scope_.parent_)&&Jp(e,o)}}function Jp(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Bx(t,n)}function w8(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:e2(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=Vx;n&&(o=[r],i=pd);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}var Vx={get(e,t){if(t===ao)return e;const n=Ma(e);if(!G0(n,t))return _8(e,n,t);const r=n[t];return e.finalized_||!al(r)?r:r===fb(e.base_,t)?(hb(e),e.copy_[t]=J0(r,e)):r},has(e,t){return t in Ma(e)},ownKeys(e){return Reflect.ownKeys(Ma(e))},set(e,t,n){const r=t2(Ma(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=fb(Ma(e),t),i=o==null?void 0:o[ao];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(m8(n,o)&&(n!==void 0||G0(e.base_,t)))return!0;hb(e),Q0(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return fb(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,hb(e),Q0(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Ma(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Mr(11)},getPrototypeOf(e){return Tc(e.base_)},setPrototypeOf(){Mr(12)}},pd={};fd(Vx,(e,t)=>{pd[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});pd.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Mr(13),pd.set.call(this,e,t,void 0)};pd.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Mr(14),Vx.set.call(this,e[0],t,n,e[0])};function fb(e,t){const n=e[ao];return(n?Ma(n):e)[t]}function _8(e,t,n){var o;const r=t2(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function t2(e,t){if(!(t in e))return;let n=Tc(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Tc(n)}}function Q0(e){e.modified_||(e.modified_=!0,e.parent_&&Q0(e.parent_))}function hb(e){e.copy_||(e.copy_=Y0(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var S8=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const s=this;return function(l=i,...c){return s.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&Mr(6),r!==void 0&&typeof r!="function"&&Mr(7);let o;if(al(t)){const i=sE(this),s=J0(t,void 0);let a=!0;try{o=n(s),a=!1}finally{a?K0(i):X0(i)}return iE(i,r),aE(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===QT&&(o=void 0),this.autoFreeze_&&Bx(o,!0),r){const i=[],s=[];ll("Patches").generateReplacementPatches_(t,o,i,s),r(i,s)}return o}else Mr(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,o;return[this.produce(t,n,(s,a)=>{r=s,o=a}),r,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){al(e)||Mr(8),Dc(e)&&(e=C8(e));const t=sE(this),n=J0(e,void 0);return n[ao].isManual_=!0,X0(t),n}finishDraft(e,t){const n=e&&e[ao];(!n||!n.isManual_)&&Mr(9);const{scope_:r}=n;return iE(r,t),aE(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));const r=ll("Patches").applyPatches_;return Dc(e)?r(e,t):this.produce(e,o=>r(o,t))}};function J0(e,t){const n=zg(e)?ll("MapSet").proxyMap_(e,t):jg(e)?ll("MapSet").proxySet_(e,t):w8(e,t);return(t?t.scope_:e2()).drafts_.push(n),n}function C8(e){return Dc(e)||Mr(10,e),n2(e)}function n2(e){if(!al(e)||Bg(e))return e;const t=e[ao];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Y0(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Y0(e,!0);return fd(n,(r,o)=>{ZT(n,r,n2(o))}),t&&(t.finalized_=!1),n}var lo=new S8,E8=lo.produce;lo.produceWithPatches.bind(lo);lo.setAutoFreeze.bind(lo);lo.setUseStrictShallowCopy.bind(lo);lo.applyPatches.bind(lo);lo.createDraft.bind(lo);lo.finishDraft.bind(lo);const R8=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const a=typeof o=="function"?E8(o):o;return t(a,i,...s)},e(r.setState,n,r)),r2=R8;var Z0,kh=Qo;if(process.env.NODE_ENV==="production")Z0=kh.createRoot,kh.hydrateRoot;else{var cE=kh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Z0=function(e,t){cE.usingClientEntryPoint=!0;try{return kh.createRoot(e,t)}finally{cE.usingClientEntryPoint=!1}}}var o2={},i2={},Hx={exports:{}},dn=String,s2=function(){return{isColorSupported:!1,reset:dn,bold:dn,dim:dn,italic:dn,underline:dn,inverse:dn,hidden:dn,strikethrough:dn,black:dn,red:dn,green:dn,yellow:dn,blue:dn,magenta:dn,cyan:dn,white:dn,gray:dn,bgBlack:dn,bgRed:dn,bgGreen:dn,bgYellow:dn,bgBlue:dn,bgMagenta:dn,bgCyan:dn,bgWhite:dn}};Hx.exports=s2();Hx.exports.createColors=s2;var O8=Hx.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var u in c)Object.defineProperty(l,u,{enumerable:!0,get:c[u]})}t(e,{dim:function(){return s},default:function(){return a}});const n=r(O8);function r(l){return l&&l.__esModule?l:{default:l}}let o=new Set;function i(l,c,u){typeof process<"u"&&process.env.JEST_WORKER_ID||u&&o.has(u)||(u&&o.add(u),console.warn(""),c.forEach(f=>console.warn(l,"-",f)))}function s(l){return n.default.dim(l)}const a={info(l,c){i(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[c,l])},warn(l,c){i(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[c,l])},risk(l,c){i(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[c,l])}}})(i2);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const t=n(i2);function n(i){return i&&i.__esModule?i:{default:i}}function r({version:i,from:s,to:a}){t.default.warn(`${s}-color-renamed`,[`As of Tailwind CSS ${i}, \`${s}\` has been renamed to \`${a}\`.`,"Update your configuration file to silence this warning."])}const o={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})(o2);let pb=o2;var P8=(pb.__esModule?pb:{default:pb}).default;const Bt=Uc(P8),a2=`import pandas as pd
|
|
59
|
+
*/var tE;function l8(){if(tE)return db;tE=1;var e=m,t=jx();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return db.useSyncExternalStoreWithSelector=function(c,u,f,p,g){var v=i(null);if(v.current===null){var b={hasValue:!1,value:null};v.current=b}else b=v.current;v=a(function(){function w(P){if(!_){if(_=!0,S=P,P=p(P),g!==void 0&&b.hasValue){var A=b.value;if(g(A,P))return R=A}return R=P}if(A=R,r(S,P))return A;var M=p(P);return g!==void 0&&g(A,M)?A:(S=P,R=M)}var _=!1,S,R,C=f===void 0?null:f;return[function(){return w(u())},C===null?void 0:function(){return w(C())}]},[u,f,p,g]);var x=o(c,v[0],v[1]);return s(function(){b.hasValue=!0,b.value=x},[x]),l(x),x},db}process.env.NODE_ENV==="production"?q0.exports=l8():q0.exports=a8();var c8=q0.exports;const u8=Uc(c8);var K2={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:d8}=m,{useSyncExternalStoreWithSelector:f8}=u8;let nE=!1;function h8(e,t=e.getState,n){(K2?"production":void 0)!=="production"&&n&&!nE&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),nE=!0);const r=f8(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return d8(r),r}const rE=e=>{(K2?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?o8(e):e,n=(r,o)=>h8(t,r,o);return Object.assign(n,t),n},X2=e=>e?rE(e):rE;var Q2=Symbol.for("immer-nothing"),oE=Symbol.for("immer-draftable"),ao=Symbol.for("immer-state"),p8=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function Mr(e,...t){if(process.env.NODE_ENV!=="production"){const n=p8[e],r=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Tc=Object.getPrototypeOf;function Dc(e){return!!e&&!!e[ao]}function al(e){var t;return e?J2(e)||Array.isArray(e)||!!e[oE]||!!((t=e.constructor)!=null&&t[oE])||zg(e)||jg(e):!1}var g8=Object.prototype.constructor.toString();function J2(e){if(!e||typeof e!="object")return!1;const t=Tc(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===g8}function fd(e,t){Fg(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function Fg(e){const t=e[ao];return t?t.type_:Array.isArray(e)?1:zg(e)?2:jg(e)?3:0}function G0(e,t){return Fg(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Z2(e,t,n){const r=Fg(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function m8(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function zg(e){return e instanceof Map}function jg(e){return e instanceof Set}function Ma(e){return e.copy_||e.base_}function Y0(e,t){if(zg(e))return new Map(e);if(jg(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&J2(e))return Tc(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[ao];let r=Reflect.ownKeys(n);for(let o=0;o<r.length;o++){const i=r[o],s=n[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[i]})}return Object.create(Tc(e),n)}function Bx(e,t=!1){return Bg(e)||Dc(e)||!al(e)||(Fg(e)>1&&(e.set=e.add=e.clear=e.delete=v8),Object.freeze(e),t&&fd(e,(n,r)=>Bx(r,!0))),e}function v8(){Mr(2)}function Bg(e){return Object.isFrozen(e)}var b8={};function ll(e){const t=b8[e];return t||Mr(0,e),t}var hd;function eT(){return hd}function y8(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function iE(e,t){t&&(ll("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function K0(e){X0(e),e.drafts_.forEach(x8),e.drafts_=null}function X0(e){e===hd&&(hd=e.parent_)}function sE(e){return hd=y8(hd,e)}function x8(e){const t=e[ao];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function aE(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[ao].modified_&&(K0(t),Mr(4)),al(e)&&(e=Qp(t,e),t.parent_||Jp(t,e)),t.patches_&&ll("Patches").generateReplacementPatches_(n[ao].base_,e,t.patches_,t.inversePatches_)):e=Qp(t,n,[]),K0(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Q2?e:void 0}function Qp(e,t,n){if(Bg(t))return t;const r=t[ao];if(!r)return fd(t,(o,i)=>lE(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return Jp(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const o=r.copy_;let i=o,s=!1;r.type_===3&&(i=new Set(o),o.clear(),s=!0),fd(i,(a,l)=>lE(e,r,o,a,l,n,s)),Jp(e,o,!1),n&&e.patches_&&ll("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function lE(e,t,n,r,o,i,s){if(process.env.NODE_ENV!=="production"&&o===n&&Mr(5),Dc(o)){const a=i&&t&&t.type_!==3&&!G0(t.assigned_,r)?i.concat(r):void 0,l=Qp(e,o,a);if(Z2(n,r,l),Dc(l))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(al(o)&&!Bg(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Qp(e,o),(!t||!t.scope_.parent_)&&Jp(e,o)}}function Jp(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Bx(t,n)}function w8(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:eT(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=Vx;n&&(o=[r],i=pd);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}var Vx={get(e,t){if(t===ao)return e;const n=Ma(e);if(!G0(n,t))return _8(e,n,t);const r=n[t];return e.finalized_||!al(r)?r:r===fb(e.base_,t)?(hb(e),e.copy_[t]=J0(r,e)):r},has(e,t){return t in Ma(e)},ownKeys(e){return Reflect.ownKeys(Ma(e))},set(e,t,n){const r=tT(Ma(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=fb(Ma(e),t),i=o==null?void 0:o[ao];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(m8(n,o)&&(n!==void 0||G0(e.base_,t)))return!0;hb(e),Q0(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return fb(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,hb(e),Q0(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Ma(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Mr(11)},getPrototypeOf(e){return Tc(e.base_)},setPrototypeOf(){Mr(12)}},pd={};fd(Vx,(e,t)=>{pd[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});pd.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Mr(13),pd.set.call(this,e,t,void 0)};pd.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Mr(14),Vx.set.call(this,e[0],t,n,e[0])};function fb(e,t){const n=e[ao];return(n?Ma(n):e)[t]}function _8(e,t,n){var o;const r=tT(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function tT(e,t){if(!(t in e))return;let n=Tc(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Tc(n)}}function Q0(e){e.modified_||(e.modified_=!0,e.parent_&&Q0(e.parent_))}function hb(e){e.copy_||(e.copy_=Y0(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var S8=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const s=this;return function(l=i,...c){return s.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&Mr(6),r!==void 0&&typeof r!="function"&&Mr(7);let o;if(al(t)){const i=sE(this),s=J0(t,void 0);let a=!0;try{o=n(s),a=!1}finally{a?K0(i):X0(i)}return iE(i,r),aE(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===Q2&&(o=void 0),this.autoFreeze_&&Bx(o,!0),r){const i=[],s=[];ll("Patches").generateReplacementPatches_(t,o,i,s),r(i,s)}return o}else Mr(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,o;return[this.produce(t,n,(s,a)=>{r=s,o=a}),r,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){al(e)||Mr(8),Dc(e)&&(e=C8(e));const t=sE(this),n=J0(e,void 0);return n[ao].isManual_=!0,X0(t),n}finishDraft(e,t){const n=e&&e[ao];(!n||!n.isManual_)&&Mr(9);const{scope_:r}=n;return iE(r,t),aE(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));const r=ll("Patches").applyPatches_;return Dc(e)?r(e,t):this.produce(e,o=>r(o,t))}};function J0(e,t){const n=zg(e)?ll("MapSet").proxyMap_(e,t):jg(e)?ll("MapSet").proxySet_(e,t):w8(e,t);return(t?t.scope_:eT()).drafts_.push(n),n}function C8(e){return Dc(e)||Mr(10,e),nT(e)}function nT(e){if(!al(e)||Bg(e))return e;const t=e[ao];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Y0(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Y0(e,!0);return fd(n,(r,o)=>{Z2(n,r,nT(o))}),t&&(t.finalized_=!1),n}var lo=new S8,E8=lo.produce;lo.produceWithPatches.bind(lo);lo.setAutoFreeze.bind(lo);lo.setUseStrictShallowCopy.bind(lo);lo.applyPatches.bind(lo);lo.createDraft.bind(lo);lo.finishDraft.bind(lo);const R8=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const a=typeof o=="function"?E8(o):o;return t(a,i,...s)},e(r.setState,n,r)),rT=R8;var Z0,kh=Qo;if(process.env.NODE_ENV==="production")Z0=kh.createRoot,kh.hydrateRoot;else{var cE=kh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Z0=function(e,t){cE.usingClientEntryPoint=!0;try{return kh.createRoot(e,t)}finally{cE.usingClientEntryPoint=!1}}}var oT={},iT={},Hx={exports:{}},dn=String,sT=function(){return{isColorSupported:!1,reset:dn,bold:dn,dim:dn,italic:dn,underline:dn,inverse:dn,hidden:dn,strikethrough:dn,black:dn,red:dn,green:dn,yellow:dn,blue:dn,magenta:dn,cyan:dn,white:dn,gray:dn,bgBlack:dn,bgRed:dn,bgGreen:dn,bgYellow:dn,bgBlue:dn,bgMagenta:dn,bgCyan:dn,bgWhite:dn}};Hx.exports=sT();Hx.exports.createColors=sT;var O8=Hx.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var u in c)Object.defineProperty(l,u,{enumerable:!0,get:c[u]})}t(e,{dim:function(){return s},default:function(){return a}});const n=r(O8);function r(l){return l&&l.__esModule?l:{default:l}}let o=new Set;function i(l,c,u){typeof process<"u"&&process.env.JEST_WORKER_ID||u&&o.has(u)||(u&&o.add(u),console.warn(""),c.forEach(f=>console.warn(l,"-",f)))}function s(l){return n.default.dim(l)}const a={info(l,c){i(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[c,l])},warn(l,c){i(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[c,l])},risk(l,c){i(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[c,l])}}})(iT);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const t=n(iT);function n(i){return i&&i.__esModule?i:{default:i}}function r({version:i,from:s,to:a}){t.default.warn(`${s}-color-renamed`,[`As of Tailwind CSS ${i}, \`${s}\` has been renamed to \`${a}\`.`,"Update your configuration file to silence this warning."])}const o={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})(oT);let pb=oT;var P8=(pb.__esModule?pb:{default:pb}).default;const Bt=Uc(P8),aT=`import pandas as pd
|
|
60
60
|
df = pd.DataFrame(data) # 'data' contains the query result
|
|
61
61
|
result = df.to_dict('records') # must return 'result' as [dict] type
|
|
62
|
-
`,ey=[{locale:"en-US",currency:"USD",currencyName:"US Dollar"},{locale:"en-GB",currency:"GBP",currencyName:"British Pound"},{locale:"en-CA",currency:"CAD",currencyName:"Canadian Dollar"},{locale:"en-AU",currency:"AUD",currencyName:"Australian Dollar"},{locale:"en-IN",currency:"INR",currencyName:"Indian Rupee"},{locale:"ja-JP",currency:"JPY",currencyName:"Japanese Yen"},{locale:"de-DE",currency:"EUR",currencyName:"Germany (Eurozone)"},{locale:"fr-FR",currency:"EUR",currencyName:"France (Eurozone)"},{locale:"es-ES",currency:"EUR",currencyName:"Spain (Eurozone)"},{locale:"it-IT",currency:"EUR",currencyName:"Italy (Eurozone)"},{locale:"fi-FI",currency:"EUR",currencyName:"Finland (Eurozone)"},{locale:"nl-NL",currency:"EUR",currencyName:"Netherlands (Eurozone)"},{locale:"zh-CN",currency:"CNY",currencyName:"Chinese Yuan"},{locale:"ru-RU",currency:"RUB",currencyName:"Russian Ruble"},{locale:"pt-BR",currency:"BRL",currencyName:"Brazilian Real"},{locale:"ko-KR",currency:"KRW",currencyName:"South Korean Won"},{locale:"ar-SA",currency:"SAR",currencyName:"Saudi Riyal"},{locale:"sv-SE",currency:"SEK",currencyName:"Swedish Krona"},{locale:"no-NO",currency:"NOK",currencyName:"Norwegian Krone"},{locale:"da-DK",currency:"DKK",currencyName:"Danish Krone"},{locale:"pl-PL",currency:"PLN",currencyName:"Polish Zloty"},{locale:"tr-TR",currency:"TRY",currencyName:"Turkish Lira"},{locale:"he-IL",currency:"ILS",currencyName:"Israeli Shekel"},{locale:"th-TH",currency:"THB",currencyName:"Thai Baht"},{locale:"vi-VN",currency:"VND",currencyName:"Vietnamese Dong"},{locale:"id-ID",currency:"IDR",currencyName:"Indonesian Rupiah"},{locale:"mx-MX",currency:"MXN",currencyName:"Mexican Peso"},{locale:"za-ZA",currency:"ZAR",currencyName:"South African Rand"},{locale:"sg-SG",currency:"SGD",currencyName:"Singapore Dollar"},{locale:"hk-HK",currency:"HKD",currencyName:"Hong Kong Dollar"},{locale:"ch-CH",currency:"CHF",currencyName:"Swiss Franc"},{locale:"my-MY",currency:"MYR",currencyName:"Malaysian Ringgit"},{locale:"ph-PH",currency:"PHP",currencyName:"Philippine Peso"},{locale:"eg-EG",currency:"EGP",currencyName:"Egyptian Pound"},{locale:"nz-NZ",currency:"NZD",currencyName:"New Zealand Dollar"}],T8=[{label:"English",locales:[{code:"en-US",name:"US English"},{code:"en-GB",name:"British English"},{code:"en-AU",name:"Australian English"},{code:"en-CA",name:"Canadian English"}]},{label:"French",locales:[{code:"fr-FR",name:"France French"},{code:"fr-CA",name:"Canadian French"}]},{label:"Spanish",locales:[{code:"es-ES",name:"Spain Spanish"},{code:"es-MX",name:"Mexican Spanish"},{code:"es-419",name:"Latin American Spanish"}]},{label:"German",locales:[{code:"de-DE",name:"Germany German"},{code:"de-CH",name:"Swiss German"}]},{label:"Chinese",locales:[{code:"zh-CN",name:"Simplified Chinese (China)"},{code:"zh-TW",name:"Traditional Chinese (Taiwan)"},{code:"zh-HK",name:"Hong Kong Chinese"}]},{label:"Japanese",locales:[{code:"ja-JP",name:"Japanese"}]},{label:"Arabic",locales:[{code:"ar-EG",name:"Egypt Arabic"},{code:"ar-SA",name:"Saudi Arabia Arabic"}]},{label:"Russian",locales:[{code:"ru-RU",name:"Russian"}]},{label:"Portuguese",locales:[{code:"pt-PT",name:"Portugal Portuguese"},{code:"pt-BR",name:"Brazil Portuguese"}]},{label:"Indian Languages",locales:[{code:"hi-IN",name:"Hindi (India)"},{code:"ta-IN",name:"Tamil (India)"}]},{label:"Korean",locales:[{code:"ko-KR",name:"Korean"}]},{label:"Italian",locales:[{code:"it-IT",name:"Italian (Italy)"}]},{label:"Dutch",locales:[{code:"nl-NL",name:"Dutch (Netherlands)"}]},{label:"Swedish",locales:[{code:"sv-SE",name:"Swedish (Sweden)"}]},{label:"Turkish",locales:[{code:"tr-TR",name:"Turkish (Turkey)"}]},{label:"Hebrew",locales:[{code:"he-IL",name:"Hebrew (Israel)"}]},{label:"Thai",locales:[{code:"th-TH",name:"Thai (Thailand)"}]},{label:"Polish",locales:[{code:"pl-PL",name:"Polish (Poland)"}]},{label:"Greek",locales:[{code:"el-GR",name:"Greek (Greece)"}]},{label:"Norwegian",locales:[{code:"no-NO",name:"Norwegian (Norway)"}]}],
|
|
62
|
+
`,ey=[{locale:"en-US",currency:"USD",currencyName:"US Dollar"},{locale:"en-GB",currency:"GBP",currencyName:"British Pound"},{locale:"en-CA",currency:"CAD",currencyName:"Canadian Dollar"},{locale:"en-AU",currency:"AUD",currencyName:"Australian Dollar"},{locale:"en-IN",currency:"INR",currencyName:"Indian Rupee"},{locale:"ja-JP",currency:"JPY",currencyName:"Japanese Yen"},{locale:"de-DE",currency:"EUR",currencyName:"Germany (Eurozone)"},{locale:"fr-FR",currency:"EUR",currencyName:"France (Eurozone)"},{locale:"es-ES",currency:"EUR",currencyName:"Spain (Eurozone)"},{locale:"it-IT",currency:"EUR",currencyName:"Italy (Eurozone)"},{locale:"fi-FI",currency:"EUR",currencyName:"Finland (Eurozone)"},{locale:"nl-NL",currency:"EUR",currencyName:"Netherlands (Eurozone)"},{locale:"zh-CN",currency:"CNY",currencyName:"Chinese Yuan"},{locale:"ru-RU",currency:"RUB",currencyName:"Russian Ruble"},{locale:"pt-BR",currency:"BRL",currencyName:"Brazilian Real"},{locale:"ko-KR",currency:"KRW",currencyName:"South Korean Won"},{locale:"ar-SA",currency:"SAR",currencyName:"Saudi Riyal"},{locale:"sv-SE",currency:"SEK",currencyName:"Swedish Krona"},{locale:"no-NO",currency:"NOK",currencyName:"Norwegian Krone"},{locale:"da-DK",currency:"DKK",currencyName:"Danish Krone"},{locale:"pl-PL",currency:"PLN",currencyName:"Polish Zloty"},{locale:"tr-TR",currency:"TRY",currencyName:"Turkish Lira"},{locale:"he-IL",currency:"ILS",currencyName:"Israeli Shekel"},{locale:"th-TH",currency:"THB",currencyName:"Thai Baht"},{locale:"vi-VN",currency:"VND",currencyName:"Vietnamese Dong"},{locale:"id-ID",currency:"IDR",currencyName:"Indonesian Rupiah"},{locale:"mx-MX",currency:"MXN",currencyName:"Mexican Peso"},{locale:"za-ZA",currency:"ZAR",currencyName:"South African Rand"},{locale:"sg-SG",currency:"SGD",currencyName:"Singapore Dollar"},{locale:"hk-HK",currency:"HKD",currencyName:"Hong Kong Dollar"},{locale:"ch-CH",currency:"CHF",currencyName:"Swiss Franc"},{locale:"my-MY",currency:"MYR",currencyName:"Malaysian Ringgit"},{locale:"ph-PH",currency:"PHP",currencyName:"Philippine Peso"},{locale:"eg-EG",currency:"EGP",currencyName:"Egyptian Pound"},{locale:"nz-NZ",currency:"NZD",currencyName:"New Zealand Dollar"}],T8=[{label:"English",locales:[{code:"en-US",name:"US English"},{code:"en-GB",name:"British English"},{code:"en-AU",name:"Australian English"},{code:"en-CA",name:"Canadian English"}]},{label:"French",locales:[{code:"fr-FR",name:"France French"},{code:"fr-CA",name:"Canadian French"}]},{label:"Spanish",locales:[{code:"es-ES",name:"Spain Spanish"},{code:"es-MX",name:"Mexican Spanish"},{code:"es-419",name:"Latin American Spanish"}]},{label:"German",locales:[{code:"de-DE",name:"Germany German"},{code:"de-CH",name:"Swiss German"}]},{label:"Chinese",locales:[{code:"zh-CN",name:"Simplified Chinese (China)"},{code:"zh-TW",name:"Traditional Chinese (Taiwan)"},{code:"zh-HK",name:"Hong Kong Chinese"}]},{label:"Japanese",locales:[{code:"ja-JP",name:"Japanese"}]},{label:"Arabic",locales:[{code:"ar-EG",name:"Egypt Arabic"},{code:"ar-SA",name:"Saudi Arabia Arabic"}]},{label:"Russian",locales:[{code:"ru-RU",name:"Russian"}]},{label:"Portuguese",locales:[{code:"pt-PT",name:"Portugal Portuguese"},{code:"pt-BR",name:"Brazil Portuguese"}]},{label:"Indian Languages",locales:[{code:"hi-IN",name:"Hindi (India)"},{code:"ta-IN",name:"Tamil (India)"}]},{label:"Korean",locales:[{code:"ko-KR",name:"Korean"}]},{label:"Italian",locales:[{code:"it-IT",name:"Italian (Italy)"}]},{label:"Dutch",locales:[{code:"nl-NL",name:"Dutch (Netherlands)"}]},{label:"Swedish",locales:[{code:"sv-SE",name:"Swedish (Sweden)"}]},{label:"Turkish",locales:[{code:"tr-TR",name:"Turkish (Turkey)"}]},{label:"Hebrew",locales:[{code:"he-IL",name:"Hebrew (Israel)"}]},{label:"Thai",locales:[{code:"th-TH",name:"Thai (Thailand)"}]},{label:"Polish",locales:[{code:"pl-PL",name:"Polish (Poland)"}]},{label:"Greek",locales:[{code:"el-GR",name:"Greek (Greece)"}]},{label:"Norwegian",locales:[{code:"no-NO",name:"Norwegian (Norway)"}]}],lT=["lg","md","sm","xs","xxs"],ty={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[Bt.blue[500],Bt.teal[500],Bt.amber[500],Bt.red[500],Bt.indigo[500],Bt.green[500]],borderColor:[Bt.blue[500],Bt.teal[500],Bt.amber[500],Bt.red[500],Bt.indigo[500],Bt.green[500]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:ny},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:4,usePointStyle:!0,pointStyle:"rectRounded",boxPadding:4},legend:{position:"top",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},scales:{y:{grid:{display:!0},title:{display:!0,text:""},beginAtZero:!0,ticks:{precision:0}},x:{grid:{display:!0},title:{display:!0}}},layout:{padding:{top:-40}},borderRadius:2,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{backgroundColor:[Bt.blue[500],Bt.teal[500],Bt.amber[500],Bt.red[500],Bt.indigo[500],Bt.green[500]],borderColor:[Bt.blue[500],Bt.teal[500],Bt.amber[500],Bt.red[500],Bt.indigo[500],Bt.green[500]],datalables:{color:ny}},options:{plugins:{tooltip:{backgroundColor:"#000",bodyColor:"#fff",borderWidth:.25,titleColor:"#fff",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4}},datalabels:{display:!1},scales:{x:{grid:{display:!0,color:Bt.slate[800]}},y:{grid:{display:!0,color:Bt.slate[800]}}}}}}};function ny(e){var r,o,i,s,a,l;const t=(a=(s=(i=(o=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:o._config)==null?void 0:i.options)==null?void 0:s.plugins)==null?void 0:a.datalabels;let n=(l=e==null?void 0:e.dataset)==null?void 0:l.backgroundColor;return(t==null?void 0:t.align)==="end"&&(t==null?void 0:t.anchor)==="end"&&(n=gd()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=gd()),md(n)}function gd(){return Ie.getState().theme==="dark"?"#000000":"#FFFFFF"}function md(e){let t=0,n=0,r=0,o=0;const i=u=>{if(!u)return Bt.gray[500];const f=u.replace("#",""),p=parseInt(f.substring(0,2),16),g=parseInt(f.substring(2,4),16),v=parseInt(f.substring(4,6),16);t+=p,n+=g,r+=v,o++};Array.isArray(e)?e.forEach(u=>{i(u)}):i(e);const s=t/o,a=n/o,l=r/o;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}const Vg=["text","enum","varchar","nvarchar","nvarchar2","char","character","longtext","nchar","char varying","nchar varying","character varying","string"],$c=["number","integer","int","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8"],mf=["date","datetime","time","timestamp","timestamp without time zone","timestamp_ns"],Wx=["boolean"];function Ux(e){return e.match(/[A-Z]/)?`"${e}"`:e}function D8(e,t,n){const{measures:r,dimensions:o}=e,i=r==null?void 0:r.map(c=>`${c.calc}(${c.name}) as ${c.calc}_${c.name.replace(/"/g,"")}`).join(", "),s=(o==null?void 0:o.join(", "))||"";let a="";const l=cT(t,n);if(i&&s)return a=`SELECT ${s}, COUNT(*) as count, ${i} FROM ${l} GROUP BY ${s} ORDER BY ${s} DESC`,a;if(!i&&s)return a=`SELECT ${s}, COUNT(*) as count FROM ${l} GROUP BY ${s} ORDER BY ${s} DESC`,a;if(i&&!s)return a=`SELECT ${i} FROM ${l}`,a}function $8(e,t,n="AVG"){var i,s,a,l;let r={};const o=Ux(e.column_name);return Vg.includes(e.data_type)&&(((i=t.dimensions)==null?void 0:i.includes(o))?r={...t,dimensions:(s=t.dimensions)==null?void 0:s.filter(u=>u!==o)}:r={...t,dimensions:[...t.dimensions||[],o]}),$c.includes(e.data_type)&&(((a=t.measures)==null?void 0:a.some(u=>u.name===o&&u.calc===n))?r={...t,measures:(l=t.measures)==null?void 0:l.filter(u=>!(u.name===o&&u.calc===n))}:r={...t,measures:[...t.measures||[],{name:o,calc:n||"SUM"}]}),r}function Zp(e){return Vg.includes(e.dataType)?"string":$c.includes(e.dataType)?"number":mf.includes(e.dataType)?"date":Wx.includes(e.dataType)?"boolean":"string"}function k8(e){let t;const n=e.data_type.toLowerCase();return Vg.includes(n)?t="T":$c.includes(n)?t="#":mf.includes(n)?t="D":Wx.includes(n)?t="B":t="?",t}function M8(e,t){const{dimensions:n,measures:r}=t,o=n==null?void 0:n.includes(e.column_name),i=r==null?void 0:r.some(s=>s.name===e.column_name);return o||i}function cT(e,t){return t==="api"||e===Ux("NA")||e==="public"?t:e?`${e}.${t}`:`${t}`}const A8=e=>{const t=new Date(e);return!isNaN(t.getTime())},I8=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),vd=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?A8(e)?t="date":I8(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function N8({get:e,dataPoint:t,card:n}){var p;const{addOrUpdateFilterValue:r,addFilteringCard:o,removeFilterValue:i,replaceFilterValue:s,removeFilteringCard:a}=e().actions,l=e().filteringCards,{columnName:c,columnValue:u}=t,f={filterId:n.id,connectionId:n==null?void 0:n.connectionId,tableName:n.lastSelectedTable,name:c,expression:(p=n.preferences)==null?void 0:p.filterOnClickField,valueType:vd(u),operation:"=",values:[u]};if(l!=null&&l.find(g=>g.id===n.id)){const g=n.id;if(u==null){a(n),i(g);return}else s(f)}o(n),r(f)}var eg={exports:{}};/**
|
|
63
63
|
* @license
|
|
64
64
|
* Lodash <https://lodash.com/>
|
|
65
65
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
@@ -85,7 +85,7 @@ __p += '`),At&&(Ee+=`' +
|
|
|
85
85
|
function print() { __p += __j.call(arguments, '') }
|
|
86
86
|
`:`;
|
|
87
87
|
`)+Ee+`return __p
|
|
88
|
-
}`;var xt=HC(function(){return zt(z,Ye+"return "+Ee).apply(n,W)});if(xt.source=Ee,Xv(xt))throw xt;return xt}function _6(d){return Ut(d).toLowerCase()}function S6(d){return Ut(d).toUpperCase()}function C6(d,h,y){if(d=Ut(d),d&&(y||h===n))return J_(d);if(!d||!(h=Vr(h)))return d;var E=Lo(d),k=Lo(h),z=Z_(E,k),W=eS(E,k)+1;return Es(E,z,W).join("")}function E6(d,h,y){if(d=Ut(d),d&&(y||h===n))return d.slice(0,nS(d)+1);if(!d||!(h=Vr(h)))return d;var E=Lo(d),k=eS(E,Lo(h))+1;return Es(E,0,k).join("")}function R6(d,h,y){if(d=Ut(d),d&&(y||h===n))return d.replace(jn,"");if(!d||!(h=Vr(h)))return d;var E=Lo(d),k=Z_(E,Lo(h));return Es(E,k).join("")}function O6(d,h){var y=I,E=F;if(wn(h)){var k="separator"in h?h.separator:k;y="length"in h?gt(h.length):y,E="omission"in h?Vr(h.omission):E}d=Ut(d);var z=d.length;if(Tl(d)){var W=Lo(d);z=W.length}if(y>=z)return d;var K=y-Dl(E);if(K<1)return E;var oe=W?Es(W,0,K).join(""):d.slice(0,K);if(k===n)return oe+E;if(W&&(K+=oe.length-K),Qv(k)){if(d.slice(K).search(k)){var xe,we=oe;for(k.global||(k=hv(k.source,Ut(qe.exec(k))+"g")),k.lastIndex=0;xe=k.exec(we);)var Ee=xe.index;oe=oe.slice(0,Ee===n?K:Ee)}}else if(d.indexOf(Vr(k),K)!=K){var ze=oe.lastIndexOf(k);ze>-1&&(oe=oe.slice(0,ze))}return oe+E}function P6(d){return d=Ut(d),d&&Rn.test(d)?d.replace(Xt,rL):d}var T6=Ll(function(d,h,y){return d+(y?" ":"")+h.toUpperCase()}),eb=WS("toUpperCase");function VC(d,h,y){return d=Ut(d),h=y?n:h,h===n?JN(d)?sL(d):HN(d):d.match(h)||[]}var HC=St(function(d,h){try{return jr(d,n,h)}catch(y){return Xv(y)?y:new ct(y)}}),D6=Li(function(d,h){return mo(h,function(y){y=oi(y),Ii(d,y,Yv(d[y],d))}),d});function $6(d){var h=d==null?0:d.length,y=Je();return d=h?yn(d,function(E){if(typeof E[1]!="function")throw new vo(s);return[y(E[0]),E[1]]}):[],St(function(E){for(var k=-1;++k<h;){var z=d[k];if(jr(z[0],this,E))return jr(z[1],this,E)}})}function k6(d){return r3(yo(d,f))}function tb(d){return function(){return d}}function M6(d,h){return d==null||d!==d?h:d}var A6=qS(),I6=qS(!0);function Cr(d){return d}function nb(d){return _S(typeof d=="function"?d:yo(d,f))}function N6(d){return CS(yo(d,f))}function L6(d,h){return ES(d,yo(h,f))}var F6=St(function(d,h){return function(y){return fu(y,d,h)}}),z6=St(function(d,h){return function(y){return fu(d,y,h)}});function rb(d,h,y){var E=Vn(h),k=ch(h,E);y==null&&!(wn(h)&&(k.length||!E.length))&&(y=h,h=d,d=this,k=ch(h,Vn(h)));var z=!(wn(y)&&"chain"in y)||!!y.chain,W=zi(d);return mo(k,function(K){var oe=h[K];d[K]=oe,W&&(d.prototype[K]=function(){var xe=this.__chain__;if(z||xe){var we=d(this.__wrapped__),Ee=we.__actions__=wr(this.__actions__);return Ee.push({func:oe,args:arguments,thisArg:d}),we.__chain__=xe,we}return oe.apply(d,ys([this.value()],arguments))})}),d}function j6(){return Yn._===this&&(Yn._=fL),this}function ob(){}function B6(d){return d=gt(d),St(function(h){return RS(h,d)})}var V6=Iv(yn),H6=Iv(G_),W6=Iv(sv);function WC(d){return Vv(d)?av(oi(d)):x3(d)}function U6(d){return function(h){return d==null?n:wa(d,h)}}var q6=YS(),G6=YS(!0);function ib(){return[]}function sb(){return!1}function Y6(){return{}}function K6(){return""}function X6(){return!0}function Q6(d,h){if(d=gt(d),d<1||d>Y)return[];var y=V,E=nr(d,V);h=Je(h),d-=V;for(var k=uv(E,h);++y<d;)h(y);return k}function J6(d){return ut(d)?yn(d,oi):Hr(d)?[d]:wr(uC(Ut(d)))}function Z6(d){var h=++uL;return Ut(d)+h}var e9=gh(function(d,h){return d+h},0),t9=Nv("ceil"),n9=gh(function(d,h){return d/h},1),r9=Nv("floor");function o9(d){return d&&d.length?lh(d,Cr,wv):n}function i9(d,h){return d&&d.length?lh(d,Je(h,2),wv):n}function s9(d){return X_(d,Cr)}function a9(d,h){return X_(d,Je(h,2))}function l9(d){return d&&d.length?lh(d,Cr,Ev):n}function c9(d,h){return d&&d.length?lh(d,Je(h,2),Ev):n}var u9=gh(function(d,h){return d*h},1),d9=Nv("round"),f9=gh(function(d,h){return d-h},0);function h9(d){return d&&d.length?cv(d,Cr):0}function p9(d,h){return d&&d.length?cv(d,Je(h,2)):0}return L.after=NF,L.ary=wC,L.assign=S4,L.assignIn=IC,L.assignInWith=Ph,L.assignWith=C4,L.at=E4,L.before=_C,L.bind=Yv,L.bindAll=D6,L.bindKey=SC,L.castArray=YF,L.chain=bC,L.chunk=r7,L.compact=o7,L.concat=i7,L.cond=$6,L.conforms=k6,L.constant=tb,L.countBy=hF,L.create=R4,L.curry=CC,L.curryRight=EC,L.debounce=RC,L.defaults=O4,L.defaultsDeep=P4,L.defer=LF,L.delay=FF,L.difference=s7,L.differenceBy=a7,L.differenceWith=l7,L.drop=c7,L.dropRight=u7,L.dropRightWhile=d7,L.dropWhile=f7,L.fill=h7,L.filter=gF,L.flatMap=bF,L.flatMapDeep=yF,L.flatMapDepth=xF,L.flatten=pC,L.flattenDeep=p7,L.flattenDepth=g7,L.flip=zF,L.flow=A6,L.flowRight=I6,L.fromPairs=m7,L.functions=I4,L.functionsIn=N4,L.groupBy=wF,L.initial=b7,L.intersection=y7,L.intersectionBy=x7,L.intersectionWith=w7,L.invert=F4,L.invertBy=z4,L.invokeMap=SF,L.iteratee=nb,L.keyBy=CF,L.keys=Vn,L.keysIn=Sr,L.map=_h,L.mapKeys=B4,L.mapValues=V4,L.matches=N6,L.matchesProperty=L6,L.memoize=Ch,L.merge=H4,L.mergeWith=NC,L.method=F6,L.methodOf=z6,L.mixin=rb,L.negate=Eh,L.nthArg=B6,L.omit=W4,L.omitBy=U4,L.once=jF,L.orderBy=EF,L.over=V6,L.overArgs=BF,L.overEvery=H6,L.overSome=W6,L.partial=Kv,L.partialRight=OC,L.partition=RF,L.pick=q4,L.pickBy=LC,L.property=WC,L.propertyOf=U6,L.pull=E7,L.pullAll=mC,L.pullAllBy=R7,L.pullAllWith=O7,L.pullAt=P7,L.range=q6,L.rangeRight=G6,L.rearg=VF,L.reject=TF,L.remove=T7,L.rest=HF,L.reverse=qv,L.sampleSize=$F,L.set=Y4,L.setWith=K4,L.shuffle=kF,L.slice=D7,L.sortBy=IF,L.sortedUniq=L7,L.sortedUniqBy=F7,L.split=b6,L.spread=WF,L.tail=z7,L.take=j7,L.takeRight=B7,L.takeRightWhile=V7,L.takeWhile=H7,L.tap=oF,L.throttle=UF,L.thru=wh,L.toArray=kC,L.toPairs=FC,L.toPairsIn=zC,L.toPath=J6,L.toPlainObject=AC,L.transform=X4,L.unary=qF,L.union=W7,L.unionBy=U7,L.unionWith=q7,L.uniq=G7,L.uniqBy=Y7,L.uniqWith=K7,L.unset=Q4,L.unzip=Gv,L.unzipWith=vC,L.update=J4,L.updateWith=Z4,L.values=jl,L.valuesIn=e6,L.without=X7,L.words=VC,L.wrap=GF,L.xor=Q7,L.xorBy=J7,L.xorWith=Z7,L.zip=eF,L.zipObject=tF,L.zipObjectDeep=nF,L.zipWith=rF,L.entries=FC,L.entriesIn=zC,L.extend=IC,L.extendWith=Ph,rb(L,L),L.add=e9,L.attempt=HC,L.camelCase=o6,L.capitalize=jC,L.ceil=t9,L.clamp=t6,L.clone=KF,L.cloneDeep=QF,L.cloneDeepWith=JF,L.cloneWith=XF,L.conformsTo=ZF,L.deburr=BC,L.defaultTo=M6,L.divide=n9,L.endsWith=i6,L.eq=zo,L.escape=s6,L.escapeRegExp=a6,L.every=pF,L.find=mF,L.findIndex=fC,L.findKey=T4,L.findLast=vF,L.findLastIndex=hC,L.findLastKey=D4,L.floor=r9,L.forEach=yC,L.forEachRight=xC,L.forIn=$4,L.forInRight=k4,L.forOwn=M4,L.forOwnRight=A4,L.get=Jv,L.gt=e4,L.gte=t4,L.has=L4,L.hasIn=Zv,L.head=gC,L.identity=Cr,L.includes=_F,L.indexOf=v7,L.inRange=n6,L.invoke=j4,L.isArguments=Ca,L.isArray=ut,L.isArrayBuffer=n4,L.isArrayLike=_r,L.isArrayLikeObject=On,L.isBoolean=r4,L.isBuffer=Rs,L.isDate=o4,L.isElement=i4,L.isEmpty=s4,L.isEqual=a4,L.isEqualWith=l4,L.isError=Xv,L.isFinite=c4,L.isFunction=zi,L.isInteger=PC,L.isLength=Rh,L.isMap=TC,L.isMatch=u4,L.isMatchWith=d4,L.isNaN=f4,L.isNative=h4,L.isNil=g4,L.isNull=p4,L.isNumber=DC,L.isObject=wn,L.isObjectLike=Sn,L.isPlainObject=bu,L.isRegExp=Qv,L.isSafeInteger=m4,L.isSet=$C,L.isString=Oh,L.isSymbol=Hr,L.isTypedArray=zl,L.isUndefined=v4,L.isWeakMap=b4,L.isWeakSet=y4,L.join=_7,L.kebabCase=l6,L.last=wo,L.lastIndexOf=S7,L.lowerCase=c6,L.lowerFirst=u6,L.lt=x4,L.lte=w4,L.max=o9,L.maxBy=i9,L.mean=s9,L.meanBy=a9,L.min=l9,L.minBy=c9,L.stubArray=ib,L.stubFalse=sb,L.stubObject=Y6,L.stubString=K6,L.stubTrue=X6,L.multiply=u9,L.nth=C7,L.noConflict=j6,L.noop=ob,L.now=Sh,L.pad=d6,L.padEnd=f6,L.padStart=h6,L.parseInt=p6,L.random=r6,L.reduce=OF,L.reduceRight=PF,L.repeat=g6,L.replace=m6,L.result=G4,L.round=d9,L.runInContext=ne,L.sample=DF,L.size=MF,L.snakeCase=v6,L.some=AF,L.sortedIndex=$7,L.sortedIndexBy=k7,L.sortedIndexOf=M7,L.sortedLastIndex=A7,L.sortedLastIndexBy=I7,L.sortedLastIndexOf=N7,L.startCase=y6,L.startsWith=x6,L.subtract=f9,L.sum=h9,L.sumBy=p9,L.template=w6,L.times=Q6,L.toFinite=ji,L.toInteger=gt,L.toLength=MC,L.toLower=_6,L.toNumber=_o,L.toSafeInteger=_4,L.toString=Ut,L.toUpper=S6,L.trim=C6,L.trimEnd=E6,L.trimStart=R6,L.truncate=O6,L.unescape=P6,L.uniqueId=Z6,L.upperCase=T6,L.upperFirst=eb,L.each=yC,L.eachRight=xC,L.first=gC,rb(L,function(){var d={};return ni(L,function(h,y){Qt.call(L.prototype,y)||(d[y]=h)}),d}(),{chain:!1}),L.VERSION=r,mo(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){L[d].placeholder=L}),mo(["drop","take"],function(d,h){Mt.prototype[d]=function(y){y=y===n?1:In(gt(y),0);var E=this.__filtered__&&!h?new Mt(this):this.clone();return E.__filtered__?E.__takeCount__=nr(y,E.__takeCount__):E.__views__.push({size:nr(y,V),type:d+(E.__dir__<0?"Right":"")}),E},Mt.prototype[d+"Right"]=function(y){return this.reverse()[d](y).reverse()}}),mo(["filter","map","takeWhile"],function(d,h){var y=h+1,E=y==G||y==J;Mt.prototype[d]=function(k){var z=this.clone();return z.__iteratees__.push({iteratee:Je(k,3),type:y}),z.__filtered__=z.__filtered__||E,z}}),mo(["head","last"],function(d,h){var y="take"+(h?"Right":"");Mt.prototype[d]=function(){return this[y](1).value()[0]}}),mo(["initial","tail"],function(d,h){var y="drop"+(h?"":"Right");Mt.prototype[d]=function(){return this.__filtered__?new Mt(this):this[y](1)}}),Mt.prototype.compact=function(){return this.filter(Cr)},Mt.prototype.find=function(d){return this.filter(d).head()},Mt.prototype.findLast=function(d){return this.reverse().find(d)},Mt.prototype.invokeMap=St(function(d,h){return typeof d=="function"?new Mt(this):this.map(function(y){return fu(y,d,h)})}),Mt.prototype.reject=function(d){return this.filter(Eh(Je(d)))},Mt.prototype.slice=function(d,h){d=gt(d);var y=this;return y.__filtered__&&(d>0||h<0)?new Mt(y):(d<0?y=y.takeRight(-d):d&&(y=y.drop(d)),h!==n&&(h=gt(h),y=h<0?y.dropRight(-h):y.take(h-d)),y)},Mt.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},Mt.prototype.toArray=function(){return this.take(V)},ni(Mt.prototype,function(d,h){var y=/^(?:filter|find|map|reject)|While$/.test(h),E=/^(?:head|last)$/.test(h),k=L[E?"take"+(h=="last"?"Right":""):h],z=E||/^find/.test(h);k&&(L.prototype[h]=function(){var W=this.__wrapped__,K=E?[1]:arguments,oe=W instanceof Mt,xe=K[0],we=oe||ut(W),Ee=function(Pt){var At=k.apply(L,ys([Pt],K));return E&&ze?At[0]:At};we&&y&&typeof xe=="function"&&xe.length!=1&&(oe=we=!1);var ze=this.__chain__,Ye=!!this.__actions__.length,et=z&&!ze,xt=oe&&!Ye;if(!z&&we){W=xt?W:new Mt(this);var tt=d.apply(W,K);return tt.__actions__.push({func:wh,args:[Ee],thisArg:n}),new bo(tt,ze)}return et&&xt?d.apply(this,K):(tt=this.thru(Ee),et?E?tt.value()[0]:tt.value():tt)})}),mo(["pop","push","shift","sort","splice","unshift"],function(d){var h=Gf[d],y=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",E=/^(?:pop|shift)$/.test(d);L.prototype[d]=function(){var k=arguments;if(E&&!this.__chain__){var z=this.value();return h.apply(ut(z)?z:[],k)}return this[y](function(W){return h.apply(ut(W)?W:[],k)})}}),ni(Mt.prototype,function(d,h){var y=L[h];if(y){var E=y.name+"";Qt.call(Al,E)||(Al[E]=[]),Al[E].push({name:h,func:y})}}),Al[ph(n,w).name]=[{name:"wrapper",func:n}],Mt.prototype.clone=PL,Mt.prototype.reverse=TL,Mt.prototype.value=DL,L.prototype.at=iF,L.prototype.chain=sF,L.prototype.commit=aF,L.prototype.next=lF,L.prototype.plant=uF,L.prototype.reverse=dF,L.prototype.toJSON=L.prototype.valueOf=L.prototype.value=fF,L.prototype.first=L.prototype.head,iu&&(L.prototype[iu]=cF),L},$l=aL();ma?((ma.exports=$l)._=$l,nv._=$l):Yn._=$l}).call(zs)})(eg,eg.exports);var tc=eg.exports;const os=Uc(tc);function uE({id:e,layouts:t,initialHeight:n,y:r,x:o,w:i,minH:s}){const a={i:e,x:o??0,y:r??1/0,w:i||20,h:n||35,minW:6,minH:s||10};t||(t={}),l2.forEach(l=>{t!=null&&t[l]||(t={...t,[l]:[]}),t[l].push(a)})}function dE(e,t){t&&l2.forEach(n=>{t!=null&&t[n]&&(t[n]=t[n].filter(r=>r.i!==e))})}const Ie=XT()(r2((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:ty},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{setGlobalStyle:n=>{e(r=>{r.dashboard.globalStyle=n})},setAIScopeTables:n=>{e(r=>{r.dashboard.aiScopeTables=n})},setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&tc.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.python=r)})})},addBaseQuery:n=>{e(r=>{var o;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(o=r.dashboard.baseQueries)==null||o.push(n)})},removeBaseQuery:n=>{e(r=>{var i,s;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(a=>a.id===n);o!=null&&o>-1&&((s=r.dashboard.baseQueries)==null||s.splice(o,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},addFilteringCard:n=>{e(r=>{var o;(o=r.filteringCards)==null||o.push(n)})},removeFilteringCard:n=>{e(r=>{var i,s;const o=(i=r.filteringCards)==null?void 0:i.findIndex(a=>a.id===n.id);o!==void 0&&o>-1&&((s=r.filteringCards)==null||s.splice(o,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setBookmarkKey:n=>{e(()=>({bookmarkKey:n}))},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setCardTitle:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&tc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(p=>p.id===r);u&&(u.title=o)})})},setCardInfo:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&tc.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.info=r)})})},setCardDescription:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&tc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(p=>p.id===r);u&&(u.description=o)})})},setCardSql:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(p=>p.id===r);f&&(f.sql=o,(u=i.onUpdateCard)==null||u.call(i,f,n))}})},setFrameCardData:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&tc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(p=>p.id===r);u&&(u.data=o)})})},setSheetLayout:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layout=r)})},setSheetLayouts:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layouts=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1?r.filterValues.splice(o,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(o=>{var s,a,l;const i=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(c=>c.filterId===o.filterId);i!==void 0&&i>-1?(a=r.filterValues)==null||a.splice(i,1,o):(l=r.filterValues)==null||l.push(o)}):r.filterValues=n})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.filter(i=>i.filterId!==n&&!i.filterId.startsWith(n));r.filterValues=o}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1&&r.filterValues.splice(o,1,n)}})},addFilter:n=>{e(r=>{var i,s;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n];const o=(s=r.dashboard.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId);uE({id:n.id,layouts:o==null?void 0:o.layouts,y:0,initialHeight:8,minH:7,w:10})})},removeFilter:n=>{e(r=>{var o,i,s;if(r.dashboard.filters){const a=(o=r.dashboard.filters)==null?void 0:o.findIndex(l=>l.id===n);if(a>-1){(i=r.dashboard.filters)==null||i.splice(a,1);const l=(s=r.dashboard.sheets)==null?void 0:s.find(c=>c.id===r.selectedSheetId);dE(n,l==null?void 0:l.layouts)}}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,f,p;const s=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(g=>g.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(g=>g.id===r);if(a){const g=(f=a.cards)==null?void 0:f.findIndex(v=>v.id===o.id);g>-1&&((p=a.cards)==null||p.splice(g,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n.id);s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){s.frames||(s.frames=[]),(c=s.frames)==null||c.push(r);let f=1/0,p=0;o==="start"&&(f=0),uE({id:r.id,layouts:s.layouts,minH:10,x:p,y:f}),(u=i.onAddFrame)==null||u.call(i,r,n)}})},removeFrame:(n,r)=>{e(o=>{var s,a,l,c,u;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(i){const f=(l=i.frames)==null?void 0:l.findIndex(p=>p.id===r);console.log(f),typeof f=="number"&&f>-1&&((c=i.frames)==null||c.splice(f,1),(u=i.layout)==null||u.splice(f,1),dE(r,i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,c,u;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n),s=(c=i==null?void 0:i.frames)==null?void 0:c.findIndex(f=>f.id===r.id);i&&((u=i.frames)==null||u.splice(s,1,r))})},updateCard:(n,r)=>{e(o=>{var a,l,c,u,f;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(p=>p.id===r.id);i&&((u=i.cards)==null||u.splice(s,1,r),(f=o.onUpdateCard)==null||f.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,c,u,f,p;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(g=>g.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(g=>g.id===r.id);i&&((u=i.cards)==null||u.splice(s,1),(f=i.layout)==null||f.splice(s,1),(p=o.onRemoveCard)==null||p.call(o,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);i&&(((l=i.cards)==null?void 0:l.find(u=>u.id===r))?o.selectedCardId=r:o.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(o=>o.id===t().selectedSheetId)},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(s=>s.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const c=(i=a[l].cards)==null?void 0:i.find(u=>u.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},handleDataPointClickAction:(n,r)=>{N8({card:n,dataPoint:r,set:e,get:t})}}}))),Ci=()=>Ie(e=>e.actions);var vf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},kc=typeof window>"u"||"Deno"in window;function Oo(){}function L8(e,t){return typeof e=="function"?e(t):e}function ry(e){return typeof e=="number"&&e>=0&&e!==1/0}function u2(e,t){return Math.max(e+(t||0)-Date.now(),0)}function fE(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==qx(s,t.options))return!1}else if(!yd(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function hE(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(bd(t.options.mutationKey)!==bd(i))return!1}else if(!yd(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function qx(e,t){return((t==null?void 0:t.queryKeyHashFn)||bd)(e)}function bd(e){return JSON.stringify(e,(t,n)=>iy(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function yd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!yd(e[n],t[n])):!1}function d2(e,t){if(e===t)return e;const n=pE(e)&&pE(t);if(n||iy(e)&&iy(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:i[c];!n&&e[u]===void 0&&t[u]===void 0&&r.includes(u)?(a[u]=void 0,l++):(a[u]=d2(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function oy(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function pE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function iy(e){if(!gE(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!gE(n)||!n.hasOwnProperty("isPrototypeOf"))}function gE(e){return Object.prototype.toString.call(e)==="[object Object]"}function F8(e){return new Promise(t=>{setTimeout(t,e)})}function sy(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?d2(e,t):t}function z8(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function j8(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var qa,js,pc,kT,B8=(kT=class extends vf{constructor(){super();Xe(this,qa,void 0);Xe(this,js,void 0);Xe(this,pc,void 0);Ve(this,pc,t=>{if(!kc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){re(this,js)||this.setEventListener(re(this,pc))}onUnsubscribe(){var t;this.hasListeners()||((t=re(this,js))==null||t.call(this),Ve(this,js,void 0))}setEventListener(t){var n;Ve(this,pc,t),(n=re(this,js))==null||n.call(this),Ve(this,js,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){re(this,qa)!==t&&(Ve(this,qa,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof re(this,qa)=="boolean"?re(this,qa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},qa=new WeakMap,js=new WeakMap,pc=new WeakMap,kT),tg=new B8,gc,Bs,mc,MT,V8=(MT=class extends vf{constructor(){super();Xe(this,gc,!0);Xe(this,Bs,void 0);Xe(this,mc,void 0);Ve(this,mc,t=>{if(!kc&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){re(this,Bs)||this.setEventListener(re(this,mc))}onUnsubscribe(){var t;this.hasListeners()||((t=re(this,Bs))==null||t.call(this),Ve(this,Bs,void 0))}setEventListener(t){var n;Ve(this,mc,t),(n=re(this,Bs))==null||n.call(this),Ve(this,Bs,t(this.setOnline.bind(this)))}setOnline(t){re(this,gc)!==t&&(Ve(this,gc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return re(this,gc)}},gc=new WeakMap,Bs=new WeakMap,mc=new WeakMap,MT),ng=new V8;function H8(e){return Math.min(1e3*2**e,3e4)}function Hg(e){return(e??"online")==="online"?ng.isOnline():!0}var f2=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function gb(e){return e instanceof f2}function h2(e){let t=!1,n=0,r=!1,o,i,s;const a=new Promise((x,w)=>{i=x,s=w}),l=x=>{var w;r||(g(new f2(x)),(w=e.abort)==null||w.call(e))},c=()=>{t=!0},u=()=>{t=!1},f=()=>!tg.isFocused()||e.networkMode!=="always"&&!ng.isOnline(),p=x=>{var w;r||(r=!0,(w=e.onSuccess)==null||w.call(e,x),o==null||o(),i(x))},g=x=>{var w;r||(r=!0,(w=e.onError)==null||w.call(e,x),o==null||o(),s(x))},v=()=>new Promise(x=>{var w;o=_=>{const S=r||!f();return S&&x(_),S},(w=e.onPause)==null||w.call(e)}).then(()=>{var x;o=void 0,r||(x=e.onContinue)==null||x.call(e)}),b=()=>{if(r)return;let x;try{x=e.fn()}catch(w){x=Promise.reject(w)}Promise.resolve(x).then(p).catch(w=>{var P;if(r)return;const _=e.retry??(kc?0:3),S=e.retryDelay??H8,R=typeof S=="function"?S(n,w):S,C=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,w);if(t||!C){g(w);return}n++,(P=e.onFail)==null||P.call(e,n,w),F8(R).then(()=>{if(f())return v()}).then(()=>{t?g(w):b()})})};return Hg(e.networkMode)?b():v().then(b),{promise:a,cancel:l,continue:()=>(o==null?void 0:o())?a:Promise.resolve(),cancelRetry:c,continueRetry:u}}function W8(){let e=[],t=0,n=p=>{p()},r=p=>{p()},o=p=>setTimeout(p,0);const i=p=>{o=p},s=p=>{let g;t++;try{g=p()}finally{t--,t||c()}return g},a=p=>{t?e.push(p):o(()=>{n(p)})},l=p=>(...g)=>{a(()=>{p(...g)})},c=()=>{const p=e;e=[],p.length&&o(()=>{r(()=>{p.forEach(g=>{n(g)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:p=>{n=p},setBatchNotifyFunction:p=>{r=p},setScheduler:i}}var Jn=W8(),Ga,AT,p2=(AT=class{constructor(){Xe(this,Ga,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ry(this.gcTime)&&Ve(this,Ga,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(kc?1/0:5*60*1e3))}clearGcTimeout(){re(this,Ga)&&(clearTimeout(re(this,Ga)),Ve(this,Ga,void 0))}},Ga=new WeakMap,AT),vc,bc,Co,Vs,Eo,Hn,nf,Ya,yc,Ap,Wo,Ui,IT,U8=(IT=class extends p2{constructor(t){super();Xe(this,yc);Xe(this,Wo);Xe(this,vc,void 0);Xe(this,bc,void 0);Xe(this,Co,void 0);Xe(this,Vs,void 0);Xe(this,Eo,void 0);Xe(this,Hn,void 0);Xe(this,nf,void 0);Xe(this,Ya,void 0);Ve(this,Ya,!1),Ve(this,nf,t.defaultOptions),Ct(this,yc,Ap).call(this,t.options),Ve(this,Hn,[]),Ve(this,Co,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ve(this,vc,t.state||q8(this.options)),this.state=re(this,vc),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!re(this,Hn).length&&this.state.fetchStatus==="idle"&&re(this,Co).remove(this)}setData(t,n){const r=sy(this.state.data,t,this.options);return Ct(this,Wo,Ui).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ct(this,Wo,Ui).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=re(this,Vs);return(r=re(this,Eo))==null||r.cancel(t),n?n.then(Oo).catch(Oo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(re(this,vc))}isActive(){return re(this,Hn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||re(this,Hn).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!u2(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=re(this,Hn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=re(this,Eo))==null||n.continue()}onOnline(){var n;const t=re(this,Hn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=re(this,Eo))==null||n.continue()}addObserver(t){re(this,Hn).includes(t)||(re(this,Hn).push(t),this.clearGcTimeout(),re(this,Co).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){re(this,Hn).includes(t)&&(Ve(this,Hn,re(this,Hn).filter(n=>n!==t)),re(this,Hn).length||(re(this,Eo)&&(re(this,Ya)?re(this,Eo).cancel({revert:!0}):re(this,Eo).cancelRetry()),this.scheduleGc()),re(this,Co).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return re(this,Hn).length}invalidate(){this.state.isInvalidated||Ct(this,Wo,Ui).call(this,{type:"invalidate"})}fetch(t,n){var c,u,f,p;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(re(this,Vs))return(c=re(this,Eo))==null||c.continueRetry(),re(this,Vs)}if(t&&Ct(this,yc,Ap).call(this,t),!this.options.queryFn){const g=re(this,Hn).find(v=>v.options.queryFn);g&&Ct(this,yc,Ap).call(this,g.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o={queryKey:this.queryKey,meta:this.meta},i=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(Ve(this,Ya,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(Ve(this,Ya,!1),this.options.persister?this.options.persister(this.options.queryFn,o,this):this.options.queryFn(o)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(a),(u=this.options.behavior)==null||u.onFetch(a,this),Ve(this,bc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&Ct(this,Wo,Ui).call(this,{type:"fetch",meta:(p=a.fetchOptions)==null?void 0:p.meta});const l=g=>{var v,b,x,w;gb(g)&&g.silent||Ct(this,Wo,Ui).call(this,{type:"error",error:g}),gb(g)||((b=(v=re(this,Co).config).onError)==null||b.call(v,g,this),(w=(x=re(this,Co).config).onSettled)==null||w.call(x,this.state.data,g,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Ve(this,Eo,h2({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:g=>{var v,b,x,w;if(typeof g>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}this.setData(g),(b=(v=re(this,Co).config).onSuccess)==null||b.call(v,g,this),(w=(x=re(this,Co).config).onSettled)==null||w.call(x,g,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(g,v)=>{Ct(this,Wo,Ui).call(this,{type:"failed",failureCount:g,error:v})},onPause:()=>{Ct(this,Wo,Ui).call(this,{type:"pause"})},onContinue:()=>{Ct(this,Wo,Ui).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Ve(this,Vs,re(this,Eo).promise),re(this,Vs)}},vc=new WeakMap,bc=new WeakMap,Co=new WeakMap,Vs=new WeakMap,Eo=new WeakMap,Hn=new WeakMap,nf=new WeakMap,Ya=new WeakMap,yc=new WeakSet,Ap=function(t){this.options={...re(this,nf),...t},this.updateGcTime(this.options.gcTime)},Wo=new WeakSet,Ui=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:Hg(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return gb(o)&&o.revert&&re(this,bc)?{...re(this,bc),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Jn.batch(()=>{re(this,Hn).forEach(r=>{r.onQueryUpdate()}),re(this,Co).notify({query:this,type:"updated",action:t})})},IT);function q8(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ci,NT,g2=(NT=class extends vf{constructor(t={}){super();Xe(this,ci,void 0);this.config=t,Ve(this,ci,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??qx(o,n);let s=this.get(i);return s||(s=new U8({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){re(this,ci).has(t.queryHash)||(re(this,ci).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=re(this,ci).get(t.queryHash);n&&(t.destroy(),n===t&&re(this,ci).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Jn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return re(this,ci).get(t)}getAll(){return[...re(this,ci).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>fE(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>fE(t,r)):n}notify(t){Jn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Jn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Jn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ci=new WeakMap,NT),ui,rf,Xr,xc,di,Is,LT,G8=(LT=class extends p2{constructor(t){super();Xe(this,di);Xe(this,ui,void 0);Xe(this,rf,void 0);Xe(this,Xr,void 0);Xe(this,xc,void 0);this.mutationId=t.mutationId,Ve(this,rf,t.defaultOptions),Ve(this,Xr,t.mutationCache),Ve(this,ui,[]),this.state=t.state||Y8(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...re(this,rf),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){re(this,ui).includes(t)||(re(this,ui).push(t),this.clearGcTimeout(),re(this,Xr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ve(this,ui,re(this,ui).filter(n=>n!==t)),this.scheduleGc(),re(this,Xr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){re(this,ui).length||(this.state.status==="pending"?this.scheduleGc():re(this,Xr).remove(this))}continue(){var t;return((t=re(this,xc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,f,p,g,v,b,x,w,_,S,R,C,P,A;const n=()=>(Ve(this,xc,h2({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(M,T)=>{Ct(this,di,Is).call(this,{type:"failed",failureCount:M,error:T})},onPause:()=>{Ct(this,di,Is).call(this,{type:"pause"})},onContinue:()=>{Ct(this,di,Is).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),re(this,xc).promise),r=this.state.status==="pending";try{if(!r){Ct(this,di,Is).call(this,{type:"pending",variables:t}),await((i=(o=re(this,Xr).config).onMutate)==null?void 0:i.call(o,t,this));const T=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));T!==this.state.context&&Ct(this,di,Is).call(this,{type:"pending",context:T,variables:t})}const M=await n();return await((c=(l=re(this,Xr).config).onSuccess)==null?void 0:c.call(l,M,t,this.state.context,this)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,M,t,this.state.context)),await((g=(p=re(this,Xr).config).onSettled)==null?void 0:g.call(p,M,null,this.state.variables,this.state.context,this)),await((b=(v=this.options).onSettled)==null?void 0:b.call(v,M,null,t,this.state.context)),Ct(this,di,Is).call(this,{type:"success",data:M}),M}catch(M){try{throw await((w=(x=re(this,Xr).config).onError)==null?void 0:w.call(x,M,t,this.state.context,this)),await((S=(_=this.options).onError)==null?void 0:S.call(_,M,t,this.state.context)),await((C=(R=re(this,Xr).config).onSettled)==null?void 0:C.call(R,void 0,M,this.state.variables,this.state.context,this)),await((A=(P=this.options).onSettled)==null?void 0:A.call(P,void 0,M,t,this.state.context)),M}finally{Ct(this,di,Is).call(this,{type:"error",error:M})}}}},ui=new WeakMap,rf=new WeakMap,Xr=new WeakMap,xc=new WeakMap,di=new WeakSet,Is=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Hg(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Jn.batch(()=>{re(this,ui).forEach(r=>{r.onMutationUpdate(t)}),re(this,Xr).notify({mutation:this,type:"updated",action:t})})},LT);function Y8(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ro,of,Ka,FT,K8=(FT=class extends vf{constructor(t={}){super();Xe(this,Ro,void 0);Xe(this,of,void 0);Xe(this,Ka,void 0);this.config=t,Ve(this,Ro,[]),Ve(this,of,0)}build(t,n,r){const o=new G8({mutationCache:this,mutationId:++Th(this,of)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){re(this,Ro).push(t),this.notify({type:"added",mutation:t})}remove(t){Ve(this,Ro,re(this,Ro).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){Jn.batch(()=>{re(this,Ro).forEach(t=>{this.remove(t)})})}getAll(){return re(this,Ro)}find(t){const n={exact:!0,...t};return re(this,Ro).find(r=>hE(n,r))}findAll(t={}){return re(this,Ro).filter(n=>hE(t,n))}notify(t){Jn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Ve(this,Ka,(re(this,Ka)??Promise.resolve()).then(()=>{const t=re(this,Ro).filter(n=>n.state.isPaused);return Jn.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Oo)),Promise.resolve()))}).then(()=>{Ve(this,Ka,void 0)})),re(this,Ka)}},Ro=new WeakMap,of=new WeakMap,Ka=new WeakMap,FT);function X8(e){return{onFetch:(t,n)=>{const r=async()=>{var v,b,x,w,_;const o=t.options,i=(x=(b=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:b.fetchMore)==null?void 0:x.direction,s=((w=t.state.data)==null?void 0:w.pages)||[],a=((_=t.state.data)==null?void 0:_.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const u=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},f=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),p=async(S,R,C)=>{if(c)return Promise.reject();if(R==null&&S.pages.length)return Promise.resolve(S);const P={queryKey:t.queryKey,pageParam:R,direction:C?"backward":"forward",meta:t.options.meta};u(P);const A=await f(P),{maxPages:M}=t.options,T=C?j8:z8;return{pages:T(S.pages,A,M),pageParams:T(S.pageParams,R,M)}};let g;if(i&&s.length){const S=i==="backward",R=S?Q8:mE,C={pages:s,pageParams:a},P=R(o,C);g=await p(C,P,S)}else{g=await p(l,a[0]??o.initialPageParam);const S=e??s.length;for(let R=1;R<S;R++){const C=mE(o,g);g=await p(g,C)}}return g};t.options.persister?t.fetchFn=()=>{var o,i;return(i=(o=t.options).persister)==null?void 0:i.call(o,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function mE(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function Q8(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var Nn,Hs,Ws,wc,_c,Us,Sc,Cc,zT,J8=(zT=class{constructor(e={}){Xe(this,Nn,void 0);Xe(this,Hs,void 0);Xe(this,Ws,void 0);Xe(this,wc,void 0);Xe(this,_c,void 0);Xe(this,Us,void 0);Xe(this,Sc,void 0);Xe(this,Cc,void 0);Ve(this,Nn,e.queryCache||new g2),Ve(this,Hs,e.mutationCache||new K8),Ve(this,Ws,e.defaultOptions||{}),Ve(this,wc,new Map),Ve(this,_c,new Map),Ve(this,Us,0)}mount(){Th(this,Us)._++,re(this,Us)===1&&(Ve(this,Sc,tg.subscribe(()=>{tg.isFocused()&&(this.resumePausedMutations(),re(this,Nn).onFocus())})),Ve(this,Cc,ng.subscribe(()=>{ng.isOnline()&&(this.resumePausedMutations(),re(this,Nn).onOnline())})))}unmount(){var e,t;Th(this,Us)._--,re(this,Us)===0&&((e=re(this,Sc))==null||e.call(this),Ve(this,Sc,void 0),(t=re(this,Cc))==null||t.call(this),Ve(this,Cc,void 0))}isFetching(e){return re(this,Nn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return re(this,Hs).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=re(this,Nn).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=re(this,Nn).find({queryKey:e}),o=r==null?void 0:r.state.data,i=L8(t,o);if(typeof i>"u")return;const s=this.defaultQueryOptions({queryKey:e});return re(this,Nn).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Jn.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=re(this,Nn).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=re(this,Nn);Jn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=re(this,Nn),r={type:"active",...e};return Jn.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=Jn.batch(()=>re(this,Nn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Oo).catch(Oo)}invalidateQueries(e={},t={}){return Jn.batch(()=>{if(re(this,Nn).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=Jn.batch(()=>re(this,Nn).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Oo)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Oo)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=re(this,Nn).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Oo).catch(Oo)}fetchInfiniteQuery(e){return e.behavior=X8(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Oo).catch(Oo)}resumePausedMutations(){return re(this,Hs).resumePausedMutations()}getQueryCache(){return re(this,Nn)}getMutationCache(){return re(this,Hs)}getDefaultOptions(){return re(this,Ws)}setDefaultOptions(e){Ve(this,Ws,e)}setQueryDefaults(e,t){re(this,wc).set(bd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...re(this,wc).values()];let n={};return t.forEach(r=>{yd(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){re(this,_c).set(bd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...re(this,_c).values()];let n={};return t.forEach(r=>{yd(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...re(this,Ws).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=qx(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...re(this,Ws).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){re(this,Nn).clear(),re(this,Hs).clear()}},Nn=new WeakMap,Hs=new WeakMap,Ws=new WeakMap,wc=new WeakMap,_c=new WeakMap,Us=new WeakMap,Sc=new WeakMap,Cc=new WeakMap,zT),Dr,fn,sf,vr,Xa,Ec,fi,af,Rc,Oc,Qa,Ja,qs,Pc,Za,Hu,lf,ay,cf,ly,uf,cy,df,uy,ff,dy,hf,fy,pf,hy,Lg,m2,jT,Z8=(jT=class extends vf{constructor(t,n){super();Xe(this,Za);Xe(this,lf);Xe(this,cf);Xe(this,uf);Xe(this,df);Xe(this,ff);Xe(this,hf);Xe(this,pf);Xe(this,Lg);Xe(this,Dr,void 0);Xe(this,fn,void 0);Xe(this,sf,void 0);Xe(this,vr,void 0);Xe(this,Xa,void 0);Xe(this,Ec,void 0);Xe(this,fi,void 0);Xe(this,af,void 0);Xe(this,Rc,void 0);Xe(this,Oc,void 0);Xe(this,Qa,void 0);Xe(this,Ja,void 0);Xe(this,qs,void 0);Xe(this,Pc,new Set);this.options=n,Ve(this,Dr,t),Ve(this,fi,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(re(this,fn).addObserver(this),vE(re(this,fn),this.options)?Ct(this,Za,Hu).call(this):this.updateResult(),Ct(this,df,uy).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return py(re(this,fn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return py(re(this,fn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ct(this,ff,dy).call(this),Ct(this,hf,fy).call(this),re(this,fn).removeObserver(this)}setOptions(t,n){const r=this.options,o=re(this,fn);if(this.options=re(this,Dr).defaultQueryOptions(t),oy(r,this.options)||re(this,Dr).getQueryCache().notify({type:"observerOptionsUpdated",query:re(this,fn),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),Ct(this,pf,hy).call(this);const i=this.hasListeners();i&&bE(re(this,fn),o,this.options,r)&&Ct(this,Za,Hu).call(this),this.updateResult(n),i&&(re(this,fn)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&Ct(this,lf,ay).call(this);const s=Ct(this,cf,ly).call(this);i&&(re(this,fn)!==o||this.options.enabled!==r.enabled||s!==re(this,qs))&&Ct(this,uf,cy).call(this,s)}getOptimisticResult(t){const n=re(this,Dr).getQueryCache().build(re(this,Dr),t),r=this.createResult(n,t);return tz(this,r)&&(Ve(this,vr,r),Ve(this,Ec,this.options),Ve(this,Xa,re(this,fn).state)),r}getCurrentResult(){return re(this,vr)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(re(this,Pc).add(r),t[r])})}),n}getCurrentQuery(){return re(this,fn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=re(this,Dr).defaultQueryOptions(t),r=re(this,Dr).getQueryCache().build(re(this,Dr),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ct(this,Za,Hu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),re(this,vr)))}createResult(t,n){var P;const r=re(this,fn),o=this.options,i=re(this,vr),s=re(this,Xa),a=re(this,Ec),c=t!==r?t.state:re(this,sf),{state:u}=t;let{error:f,errorUpdatedAt:p,fetchStatus:g,status:v}=u,b=!1,x;if(n._optimisticResults){const A=this.hasListeners(),M=!A&&vE(t,n),T=A&&bE(t,r,n,o);(M||T)&&(g=Hg(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(v="pending")),n._optimisticResults==="isRestoring"&&(g="idle")}if(n.select&&typeof u.data<"u")if(i&&u.data===(s==null?void 0:s.data)&&n.select===re(this,af))x=re(this,Rc);else try{Ve(this,af,n.select),x=n.select(u.data),x=sy(i==null?void 0:i.data,x,n),Ve(this,Rc,x),Ve(this,fi,null)}catch(A){Ve(this,fi,A)}else x=u.data;if(typeof n.placeholderData<"u"&&typeof x>"u"&&v==="pending"){let A;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))A=i.data;else if(A=typeof n.placeholderData=="function"?n.placeholderData((P=re(this,Oc))==null?void 0:P.state.data,re(this,Oc)):n.placeholderData,n.select&&typeof A<"u")try{A=n.select(A),Ve(this,fi,null)}catch(M){Ve(this,fi,M)}typeof A<"u"&&(v="success",x=sy(i==null?void 0:i.data,A,n),b=!0)}re(this,fi)&&(f=re(this,fi),x=re(this,Rc),p=Date.now(),v="error");const w=g==="fetching",_=v==="pending",S=v==="error",R=_&&w;return{status:v,fetchStatus:g,isPending:_,isSuccess:v==="success",isError:S,isInitialLoading:R,isLoading:R,data:x,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:w,isRefetching:w&&!_,isLoadingError:S&&u.dataUpdatedAt===0,isPaused:g==="paused",isPlaceholderData:b,isRefetchError:S&&u.dataUpdatedAt!==0,isStale:Gx(t,n),refetch:this.refetch}}updateResult(t){const n=re(this,vr),r=this.createResult(re(this,fn),this.options);if(Ve(this,Xa,re(this,fn).state),Ve(this,Ec,this.options),re(this,Xa).data!==void 0&&Ve(this,Oc,re(this,fn)),oy(r,n))return;Ve(this,vr,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!re(this,Pc).size)return!0;const l=new Set(a??re(this,Pc));return this.options.throwOnError&&l.add("error"),Object.keys(re(this,vr)).some(c=>{const u=c;return re(this,vr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),Ct(this,Lg,m2).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ct(this,df,uy).call(this)}},Dr=new WeakMap,fn=new WeakMap,sf=new WeakMap,vr=new WeakMap,Xa=new WeakMap,Ec=new WeakMap,fi=new WeakMap,af=new WeakMap,Rc=new WeakMap,Oc=new WeakMap,Qa=new WeakMap,Ja=new WeakMap,qs=new WeakMap,Pc=new WeakMap,Za=new WeakSet,Hu=function(t){Ct(this,pf,hy).call(this);let n=re(this,fn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Oo)),n},lf=new WeakSet,ay=function(){if(Ct(this,ff,dy).call(this),kc||re(this,vr).isStale||!ry(this.options.staleTime))return;const n=u2(re(this,vr).dataUpdatedAt,this.options.staleTime)+1;Ve(this,Qa,setTimeout(()=>{re(this,vr).isStale||this.updateResult()},n))},cf=new WeakSet,ly=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(re(this,fn)):this.options.refetchInterval)??!1},uf=new WeakSet,cy=function(t){Ct(this,hf,fy).call(this),Ve(this,qs,t),!(kc||this.options.enabled===!1||!ry(re(this,qs))||re(this,qs)===0)&&Ve(this,Ja,setInterval(()=>{(this.options.refetchIntervalInBackground||tg.isFocused())&&Ct(this,Za,Hu).call(this)},re(this,qs)))},df=new WeakSet,uy=function(){Ct(this,lf,ay).call(this),Ct(this,uf,cy).call(this,Ct(this,cf,ly).call(this))},ff=new WeakSet,dy=function(){re(this,Qa)&&(clearTimeout(re(this,Qa)),Ve(this,Qa,void 0))},hf=new WeakSet,fy=function(){re(this,Ja)&&(clearInterval(re(this,Ja)),Ve(this,Ja,void 0))},pf=new WeakSet,hy=function(){const t=re(this,Dr).getQueryCache().build(re(this,Dr),this.options);if(t===re(this,fn))return;const n=re(this,fn);Ve(this,fn,t),Ve(this,sf,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Lg=new WeakSet,m2=function(t){Jn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(re(this,vr))}),re(this,Dr).getQueryCache().notify({query:re(this,fn),type:"observerResultsUpdated"})})},jT);function ez(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function vE(e,t){return ez(e,t)||e.state.dataUpdatedAt>0&&py(e,t,t.refetchOnMount)}function py(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Gx(e,t)}return!1}function bE(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Gx(e,n)}function Gx(e,t){return e.isStaleByTime(t.staleTime)}function tz(e,t){return!oy(e.getCurrentResult(),t)}var v2=ge.createContext(void 0),b2=e=>{const t=ge.useContext(v2);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},nz=({client:e,children:t})=>(ge.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),ge.createElement(v2.Provider,{value:e},t)),y2=ge.createContext(!1),rz=()=>ge.useContext(y2);y2.Provider;function oz(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var iz=ge.createContext(oz()),sz=()=>ge.useContext(iz);function az(e,t){return typeof e=="function"?e(...t):!!e}var lz=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},cz=e=>{ge.useEffect(()=>{e.clearReset()},[e])},uz=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&az(n,[e.error,r]),dz=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},fz=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,hz=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function pz(e,t,n){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=b2(n),o=rz(),i=sz(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",dz(s),lz(s,i),cz(i);const[a]=ge.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(ge.useSyncExternalStore(ge.useCallback(c=>{const u=o?()=>{}:a.subscribe(Jn.batchCalls(c));return a.updateResult(),u},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),ge.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),fz(s,l))throw hz(s,a,i);if(uz({result:l,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function bf(e,t){return pz(e,Z8,t)}const gz={theme:"system",setTheme:()=>null},x2=m.createContext(gz);function mz({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=m.useState(()=>localStorage.getItem(n)||t);m.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),o==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(o)},[o]);const s={theme:o,setTheme:a=>{localStorage.setItem(n,a),i(a)}};return O.jsx(x2.Provider,{...r,value:s,children:e})}const w2=()=>{const e=m.useContext(x2);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function vz(e){return await(await fetch("https://semaphor.cloud/api/v1/dashboard",{headers:{Authorization:`Bearer ${e}`}})).json()}function _2(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function yE(e,t){const n=_2(e);return n==="dark"?os.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function bz({authToken:e,customStyle:t,currentTheme:n,onSave:r,onEvent:o}){const{data:i,refetch:s,isLoading:a,isError:l}=bf({queryKey:["dashboard",e==null?void 0:e.accessToken],queryFn:()=>vz(e==null?void 0:e.accessToken),enabled:!1}),{theme:c,setTheme:u}=w2(),f=Ie(A=>A.dashboard.globalStyle),{setDashboard:p,setSelectedSheetId:g,setStyle:v,setOnSaveFunction:b}=Ie(A=>A.actions);Ie(A=>A.actions.setCustomCards);const x=Ie(A=>A.actions.setFilterValues),w=Ie(A=>A.actions.setBookmarkKey),_=Ie(A=>A.actions.setAuthToken),S=Ie(A=>A.actions.setThemeStyle),R=Ie(A=>A.actions.setDashboardTheme),C=Ie(A=>A.actions.setOnEvent);m.useEffect(()=>{if(c){const A=_2(c);R(A)}},[c,R]),m.useEffect(()=>{n&&u(n)},[n,u]);function P(){const A=os.cloneDeep(ty),M=os.merge(A,f);if(t){const T=os.merge(M,t),I=yE(c,T);S(I),v(T)}else{const T=yE(c,M);S(T),v(ty)}}return m.useEffect(()=>{i&&i.dashboard&&P()},[c,t,f]),m.useEffect(()=>{var F;if(!i||!i.dashboard)return;const A=i.dashboard,M=u5(A.id),T=JSON.parse(localStorage.getItem(M)||"[]"),I=T.find(j=>j.default===!0);if(I)p(I.template),P(),w(I.name),I.filterValues&&x(I.filterValues);else{p(A),P();const j=T.find(X=>(X==null?void 0:X.name)==="Original");j?j.template=A:T.push({name:"Original",template:A,default:!1}),localStorage.setItem(M,JSON.stringify(T))}g((F=A.sheets)==null?void 0:F[0].id)},[i,p,g,x,w]),m.useEffect(()=>{r&&b(r),o&&C(o)},[r,b,o,C]),m.useEffect(()=>{e&&e.accessToken&&(_(e),s())},[e,s,_]),{isLoading:a,isError:l}}function Wg({className:e,...t}){return O.jsx("div",{className:Pe("animate-pulse rounded-md bg-muted",e),...t})}const Yx=ge.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Pe("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Yx.displayName="Card";const Ug=ge.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Pe("flex flex-col space-y-1.5 p-6",e),...t}));Ug.displayName="CardHeader";const yf=ge.forwardRef(({className:e,...t},n)=>O.jsx("h3",{ref:n,className:Pe("text-2xl font-semibold leading-none tracking-tight",e),...t}));yf.displayName="CardTitle";const Kx=ge.forwardRef(({className:e,...t},n)=>O.jsx("p",{ref:n,className:Pe("text-sm text-muted-foreground",e),...t}));Kx.displayName="CardDescription";const qg=ge.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Pe("px-6 pt-0",e),...t}));qg.displayName="CardContent";const Xx=ge.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Pe("flex items-center p-6 pt-0",e),...t}));Xx.displayName="CardFooter";function S2({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:f,...p}){Ie(w=>w.selectedSheetId);const g=Ie(w=>w.themeStyle),v=Ie(w=>w.isSessionExpired),{isLoading:b,isError:x}=bz({authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r});return b||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?O.jsx(o,{message:"loading"}):O.jsx("div",{className:"flex items-center gap-3",children:O.jsx(Wg,{className:"h-1 w-full dark:h-[2px]"})})):x?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),O.jsx(i,{})):O.jsx("div",{children:"Error"})):v?(r==null||r({type:"error",message:"Session Expired"}),O.jsx("div",{className:"flex h-full items-center justify-center",children:O.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[O.jsx(yf,{children:"Session Expired"}),O.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):O.jsx("div",{className:Pe("flex h-full grow flex-col justify-between",g==null?void 0:g.dashboardPanel,e),role:"dashboard-panel",...p})}function fe(){return fe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fe.apply(this,arguments)}function De(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Gn(e,t=[]){let n=[];function r(i,s){const a=m.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:p,children:g,...v}=f,b=(p==null?void 0:p[e][l])||a,x=m.useMemo(()=>v,Object.values(v));return m.createElement(b.Provider,{value:x},g)}function u(f,p){const g=(p==null?void 0:p[e][l])||a,v=m.useContext(g);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>m.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,yz(o,...t)]}function yz(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(i)[`__scope${c}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function xz(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Gg(...e){return t=>e.forEach(n=>xz(n,t))}function ft(...e){return m.useCallback(Gg(...e),e)}const ss=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(wz);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(gy,fe({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(gy,fe({},r,{ref:t}),n)});ss.displayName="Slot";const gy=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{..._z(r,n.props),ref:t?Gg(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});gy.displayName="SlotClone";const C2=({children:e})=>m.createElement(m.Fragment,null,e);function wz(e){return m.isValidElement(e)&&e.type===C2}function _z(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Yg(e){const t=e+"CollectionProvider",[n,r]=Gn(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=g=>{const{scope:v,children:b}=g,x=m.useRef(null),w=m.useRef(new Map).current;return m.createElement(o,{scope:v,itemMap:w,collectionRef:x},b)},a=e+"CollectionSlot",l=m.forwardRef((g,v)=>{const{scope:b,children:x}=g,w=i(a,b),_=ft(v,w.collectionRef);return m.createElement(ss,{ref:_},x)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",f=m.forwardRef((g,v)=>{const{scope:b,children:x,...w}=g,_=m.useRef(null),S=ft(v,_),R=i(c,b);return m.useEffect(()=>(R.itemMap.set(_,{ref:_,...w}),()=>void R.itemMap.delete(_))),m.createElement(ss,{[u]:"",ref:S},x)});function p(g){const v=i(e+"CollectionConsumer",g);return m.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${u}]`));return Array.from(v.itemMap.values()).sort((R,C)=>w.indexOf(R.ref.current)-w.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},p,r]}const cr=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},Sz=ge.useId||(()=>{});let Cz=0;function Nr(e){const[t,n]=ge.useState(Sz());return cr(()=>{e||n(r=>r??String(Cz++))},[e]),e||(t?`radix-${t}`:"")}const Ez=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Qe=Ez.reduce((e,t)=>{const n=m.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?ss:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,fe({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function E2(e,t){e&&Qo.flushSync(()=>e.dispatchEvent(t))}function Fn(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function ur({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Rz({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Fn(n),l=m.useCallback(c=>{if(i){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else o(c)},[i,e,o,a]);return[s,l]}function Rz({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,o=m.useRef(r),i=Fn(t);return m.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const Oz=m.createContext(void 0);function ml(e){const t=m.useContext(Oz);return e||t||"ltr"}const mb="rovingFocusGroup.onEntryFocus",Pz={bubbles:!1,cancelable:!0},Qx="RovingFocusGroup",[my,R2,Tz]=Yg(Qx),[Dz,Gc]=Gn(Qx,[Tz]),[$z,kz]=Dz(Qx),Mz=m.forwardRef((e,t)=>m.createElement(my.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(my.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(Az,fe({},e,{ref:t}))))),Az=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=e,f=m.useRef(null),p=ft(t,f),g=ml(i),[v=null,b]=ur({prop:s,defaultProp:a,onChange:l}),[x,w]=m.useState(!1),_=Fn(c),S=R2(n),R=m.useRef(!1),[C,P]=m.useState(0);return m.useEffect(()=>{const A=f.current;if(A)return A.addEventListener(mb,_),()=>A.removeEventListener(mb,_)},[_]),m.createElement($z,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:v,onItemFocus:m.useCallback(A=>b(A),[b]),onItemShiftTab:m.useCallback(()=>w(!0),[]),onFocusableItemAdd:m.useCallback(()=>P(A=>A+1),[]),onFocusableItemRemove:m.useCallback(()=>P(A=>A-1),[])},m.createElement(Qe.div,fe({tabIndex:x||C===0?-1:0,"data-orientation":r},u,{ref:p,style:{outline:"none",...e.style},onMouseDown:De(e.onMouseDown,()=>{R.current=!0}),onFocus:De(e.onFocus,A=>{const M=!R.current;if(A.target===A.currentTarget&&M&&!x){const T=new CustomEvent(mb,Pz);if(A.currentTarget.dispatchEvent(T),!T.defaultPrevented){const I=S().filter(B=>B.focusable),F=I.find(B=>B.active),j=I.find(B=>B.id===v),G=[F,j,...I].filter(Boolean).map(B=>B.ref.current);O2(G)}}R.current=!1}),onBlur:De(e.onBlur,()=>w(!1))})))}),Iz="RovingFocusGroupItem",Nz=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Nr(),l=i||a,c=kz(Iz,n),u=c.currentTabStopId===l,f=R2(n),{onFocusableItemAdd:p,onFocusableItemRemove:g}=c;return m.useEffect(()=>{if(r)return p(),()=>g()},[r,p,g]),m.createElement(my.ItemSlot,{scope:n,id:l,focusable:r,active:o},m.createElement(Qe.span,fe({tabIndex:u?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:De(e.onMouseDown,v=>{r?c.onItemFocus(l):v.preventDefault()}),onFocus:De(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:De(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const b=zz(v,c.orientation,c.dir);if(b!==void 0){v.preventDefault();let w=f().filter(_=>_.focusable).map(_=>_.ref.current);if(b==="last")w.reverse();else if(b==="prev"||b==="next"){b==="prev"&&w.reverse();const _=w.indexOf(v.currentTarget);w=c.loop?jz(w,_+1):w.slice(_+1)}setTimeout(()=>O2(w))}})})))}),Lz={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Fz(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function zz(e,t,n){const r=Fz(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Lz[r]}function O2(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function jz(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const Jx=Mz,Zx=Nz;function Bz(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Mn=e=>{const{present:t,children:n}=e,r=Vz(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=ft(r.ref,o.ref);return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:i}):null};Mn.displayName="Presence";function Vz(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),i=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Bz(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=Mh(r.current);i.current=a==="mounted"?c:"none"},[a]),cr(()=>{const c=r.current,u=o.current;if(u!==e){const p=i.current,g=Mh(c);e?l("MOUNT"):g==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&p!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),cr(()=>{if(t){const c=f=>{const g=Mh(r.current).includes(f.animationName);f.target===t&&g&&Qo.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(i.current=Mh(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Mh(e){return(e==null?void 0:e.animationName)||"none"}const P2="Tabs",[Hz,Hge]=Gn(P2,[Gc]),T2=Gc(),[Wz,ew]=Hz(P2),Uz=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=ml(a),[f,p]=ur({prop:r,onChange:o,defaultProp:i});return m.createElement(Wz,{scope:n,baseId:Nr(),value:f,onValueChange:p,orientation:s,dir:u,activationMode:l},m.createElement(Qe.div,fe({dir:u,"data-orientation":s},c,{ref:t})))}),qz="TabsList",Gz=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=ew(qz,n),s=T2(n);return m.createElement(Jx,fe({asChild:!0},s,{orientation:i.orientation,dir:i.dir,loop:r}),m.createElement(Qe.div,fe({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),Yz="TabsTrigger",Kz=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=ew(Yz,n),a=T2(n),l=D2(s.baseId,r),c=$2(s.baseId,r),u=r===s.value;return m.createElement(Zx,fe({asChild:!0},a,{focusable:!o,active:u}),m.createElement(Qe.button,fe({type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l},i,{ref:t,onMouseDown:De(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:De(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:De(e.onFocus,()=>{const f=s.activationMode!=="manual";!u&&!o&&f&&s.onValueChange(r)})})))}),Xz="TabsContent",Qz=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=ew(Xz,n),l=D2(a.baseId,r),c=$2(a.baseId,r),u=r===a.value,f=m.useRef(u);return m.useEffect(()=>{const p=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(p)},[]),m.createElement(Mn,{present:o||u},({present:p})=>m.createElement(Qe.div,fe({"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:c,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0}}),p&&i))});function D2(e,t){return`${e}-trigger-${t}`}function $2(e,t){return`${e}-content-${t}`}const Jz=Uz,k2=Gz,M2=Kz,A2=Qz,I2=Jz,N2=ge.forwardRef(({className:e,...t},n)=>O.jsx(k2,{ref:n,className:Pe("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));N2.displayName=k2.displayName;const L2=ge.forwardRef(({className:e,...t},n)=>O.jsx(M2,{ref:n,className:Pe("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));L2.displayName=M2.displayName;const tw=ge.forwardRef(({className:e,...t},n)=>O.jsx(A2,{ref:n,className:Pe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));tw.displayName=A2.displayName;var F2={exports:{}},xf={},vy={exports:{}};(function(e,t){(function(n,r){r(t)})(zs,function(n){function r(ie){return function(ae,ye,q,be,_e,Oe,Te){return ie(ae,ye,Te)}}function o(ie){return function(ae,ye,q,be){if(!ae||!ye||typeof ae!="object"||typeof ye!="object")return ie(ae,ye,q,be);var _e=be.get(ae),Oe=be.get(ye);if(_e&&Oe)return _e===ye&&Oe===ae;be.set(ae,ye),be.set(ye,ae);var Te=ie(ae,ye,q,be);return be.delete(ae),be.delete(ye),Te}}function i(ie,ee){var ae={};for(var ye in ie)ae[ye]=ie[ye];for(var ye in ee)ae[ye]=ee[ye];return ae}function s(ie){return ie.constructor===Object||ie.constructor==null}function a(ie){return typeof ie.then=="function"}function l(ie,ee){return ie===ee||ie!==ie&&ee!==ee}var c="[object Arguments]",u="[object Boolean]",f="[object Date]",p="[object RegExp]",g="[object Map]",v="[object Number]",b="[object Object]",x="[object Set]",w="[object String]",_=Object.prototype.toString;function S(ie){var ee=ie.areArraysEqual,ae=ie.areDatesEqual,ye=ie.areMapsEqual,q=ie.areObjectsEqual,be=ie.areRegExpsEqual,_e=ie.areSetsEqual,Oe=ie.createIsNestedEqual,Te=Oe(Ue);function Ue(Be,Ae,Ke){if(Be===Ae)return!0;if(!Be||!Ae||typeof Be!="object"||typeof Ae!="object")return Be!==Be&&Ae!==Ae;if(s(Be)&&s(Ae))return q(Be,Ae,Te,Ke);var lt=Array.isArray(Be),It=Array.isArray(Ae);if(lt||It)return lt===It&&ee(Be,Ae,Te,Ke);var $t=_.call(Be);return $t!==_.call(Ae)?!1:$t===f?ae(Be,Ae,Te,Ke):$t===p?be(Be,Ae,Te,Ke):$t===g?ye(Be,Ae,Te,Ke):$t===x?_e(Be,Ae,Te,Ke):$t===b||$t===c?a(Be)||a(Ae)?!1:q(Be,Ae,Te,Ke):$t===u||$t===v||$t===w?l(Be.valueOf(),Ae.valueOf()):!1}return Ue}function R(ie,ee,ae,ye){var q=ie.length;if(ee.length!==q)return!1;for(;q-- >0;)if(!ae(ie[q],ee[q],q,q,ie,ee,ye))return!1;return!0}var C=o(R);function P(ie,ee){return l(ie.valueOf(),ee.valueOf())}function A(ie,ee,ae,ye){var q=ie.size===ee.size;if(!q)return!1;if(!ie.size)return!0;var be={},_e=0;return ie.forEach(function(Oe,Te){if(q){var Ue=!1,Be=0;ee.forEach(function(Ae,Ke){!Ue&&!be[Be]&&(Ue=ae(Te,Ke,_e,Be,ie,ee,ye)&&ae(Oe,Ae,Te,Ke,ie,ee,ye))&&(be[Be]=!0),Be++}),_e++,q=Ue}}),q}var M=o(A),T="_owner",I=Object.prototype.hasOwnProperty;function F(ie,ee,ae,ye){var q=Object.keys(ie),be=q.length;if(Object.keys(ee).length!==be)return!1;for(var _e;be-- >0;){if(_e=q[be],_e===T){var Oe=!!ie.$$typeof,Te=!!ee.$$typeof;if((Oe||Te)&&Oe!==Te)return!1}if(!I.call(ee,_e)||!ae(ie[_e],ee[_e],_e,_e,ie,ee,ye))return!1}return!0}var j=o(F);function X(ie,ee){return ie.source===ee.source&&ie.flags===ee.flags}function G(ie,ee,ae,ye){var q=ie.size===ee.size;if(!q)return!1;if(!ie.size)return!0;var be={};return ie.forEach(function(_e,Oe){if(q){var Te=!1,Ue=0;ee.forEach(function(Be,Ae){!Te&&!be[Ue]&&(Te=ae(_e,Be,Oe,Ae,ie,ee,ye))&&(be[Ue]=!0),Ue++}),q=Te}}),q}var B=o(G),J=Object.freeze({areArraysEqual:R,areDatesEqual:P,areMapsEqual:A,areObjectsEqual:F,areRegExpsEqual:X,areSetsEqual:G,createIsNestedEqual:r}),H=Object.freeze({areArraysEqual:C,areDatesEqual:P,areMapsEqual:M,areObjectsEqual:j,areRegExpsEqual:X,areSetsEqual:B,createIsNestedEqual:r}),Y=S(J);function te(ie,ee){return Y(ie,ee,void 0)}var $=S(i(J,{createIsNestedEqual:function(){return l}}));function V(ie,ee){return $(ie,ee,void 0)}var Q=S(H);function N(ie,ee){return Q(ie,ee,new WeakMap)}var le=S(i(H,{createIsNestedEqual:function(){return l}}));function se(ie,ee){return le(ie,ee,new WeakMap)}function ue(ie){return S(i(J,ie(J)))}function he(ie){var ee=S(i(H,ie(H)));return function(ae,ye,q){return q===void 0&&(q=new WeakMap),ee(ae,ye,q)}}n.circularDeepEqual=N,n.circularShallowEqual=se,n.createCustomCircularEqual=he,n.createCustomEqual=ue,n.deepEqual=te,n.sameValueZeroEqual=l,n.shallowEqual=V,Object.defineProperty(n,"__esModule",{value:!0})})})(vy,vy.exports);var nw=vy.exports;const rw=Fx(x9);var Ot={},Zz=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.bottom=ow;Ot.childrenEqual=rj;Ot.cloneLayout=z2;Ot.cloneLayoutItem=el;Ot.collides=Kg;Ot.compact=B2;Ot.compactItem=V2;Ot.compactType=vj;Ot.correctBounds=H2;Ot.fastPositionEqual=ij;Ot.fastRGLPropsEqual=void 0;Ot.getAllCollisions=W2;Ot.getFirstCollision=Va;Ot.getLayoutItem=iw;Ot.getStatics=sw;Ot.modifyLayout=j2;Ot.moveElement=Uu;Ot.moveElementAwayFromCollision=yy;Ot.noop=void 0;Ot.perc=aj;Ot.resizeItemInDirection=hj;Ot.setTopLeft=gj;Ot.setTransform=pj;Ot.sortLayoutItems=fw;Ot.sortLayoutItemsByColRow=K2;Ot.sortLayoutItemsByRowCol=Y2;Ot.synchronizeLayoutWithChildren=mj;Ot.validateLayout=X2;Ot.withLayoutItem=nj;var xE=nw,Wu=ej(m);function ej(e){return e&&e.__esModule?e:{default:e}}const tj=process.env.NODE_ENV==="production";function ow(e){let t=0,n;for(let r=0,o=e.length;r<o;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function z2(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=el(e[n]);return t}function j2(e,t){const n=Array(e.length);for(let r=0,o=e.length;r<o;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function nj(e,t,n){let r=iw(e,t);return r?(r=n(el(r)),e=j2(e,r),[e,r]):[e,null]}function el(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}function rj(e,t){return(0,xE.deepEqual)(Wu.default.Children.map(e,n=>n==null?void 0:n.key),Wu.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,xE.deepEqual)(Wu.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),Wu.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const oj=Zz;Ot.fastRGLPropsEqual=oj;function ij(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Kg(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function B2(e,t,n,r){const o=sw(e),i=fw(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=el(i[a]);c.static||(c=V2(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const sj={x:"w",y:"h"};function by(e,t,n,r){const o=sj[r];t[r]+=1;const i=e.map(s=>s.i).indexOf(t.i);for(let s=i+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;Kg(t,a)&&by(e,a,n+t[o],r)}}t[r]=n}function V2(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(ow(e),t.y);t.y>0&&!Va(e,t);)t.y--;else if(a)for(;t.x>0&&!Va(e,t);)t.x--;let l;for(;(l=Va(e,t))&&!(n===null&&i);)if(a?by(o,t,l.x+l.w,"x"):by(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Va(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function H2(e,t){const n=sw(e);for(let r=0,o=e.length;r<o;r++){const i=e[r];if(i.x+i.w>t.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;Va(n,i);)i.y++}return e}function iw(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Va(e,t){for(let n=0,r=e.length;n<r;n++)if(Kg(e[n],t))return e[n]}function W2(e,t){return e.filter(n=>Kg(n,t))}function sw(e){return e.filter(t=>t.static)}function Uu(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;"Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(t.y,"]");const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let f=fw(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(f=f.reverse());const g=W2(f,t),v=g.length>0;if(v&&l)return z2(e);if(v&&i)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=u,t.moved=!1,e;for(let b=0,x=g.length;b<x;b++){const w=g[b];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(w.i," at [").concat(w.x,",").concat(w.y,"]"),!w.moved&&(w.static?e=yy(e,w,t,o,s):e=yy(e,t,w,o,s))}return e}function yy(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const f={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},p=Va(e,f),g=p&&p.y+p.h>t.y,v=p&&t.x+t.w>p.x;if(p){if(g&&a)return Uu(e,n,void 0,t.y+1,r,l,o);if(g&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(v&&s)return Uu(e,t,n.x,void 0,r,l,o)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(f.x,",").concat(f.y,"]."),Uu(e,n,s?f.x:void 0,a?f.y:void 0,r,l,o)}const c=s?n.x+1:void 0,u=a?n.y+1:void 0;return c==null&&u==null?e:Uu(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function aj(e){return e*100+"%"}const U2=(e,t,n,r)=>e+n>r?t:n,q2=(e,t,n)=>e<0?t:n,G2=e=>Math.max(0,e),aw=e=>Math.max(0,e),lw=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:q2(s,e.height,o),top:aw(s)}},cw=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:U2(e.left,e.width,s,n),left:G2(o)}},uw=(e,t,n)=>{let{top:r,height:o,width:i}=t;const s=e.left-(i-e.width);return{height:o,width:s<0?e.width:U2(e.left,e.width,i,n),top:aw(r),left:G2(s)}},dw=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:q2(r,e.height,i),top:aw(r)}},lj=function(){return lw(arguments.length<=0?void 0:arguments[0],cw(...arguments))},cj=function(){return lw(arguments.length<=0?void 0:arguments[0],uw(...arguments))},uj=function(){return dw(arguments.length<=0?void 0:arguments[0],cw(...arguments))},dj=function(){return dw(arguments.length<=0?void 0:arguments[0],uw(...arguments))},fj={n:lw,ne:lj,e:cw,se:uj,s:dw,sw:dj,w:uw,nw:cj};function hj(e,t,n,r){const o=fj[e];return o?o(t,{...t,...n},r):n}function pj(e){let{top:t,left:n,width:r,height:o}=e;const i="translate(".concat(n,"px,").concat(t,"px)");return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function gj(e){let{top:t,left:n,width:r,height:o}=e;return{top:"".concat(t,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function fw(e,t){return t==="horizontal"?K2(e):t==="vertical"?Y2(e):e}function Y2(e){return e.slice(0).sort(function(t,n){return t.y>n.y||t.y===n.y&&t.x>n.x?1:t.y===n.y&&t.x===n.x?0:-1})}function K2(e){return e.slice(0).sort(function(t,n){return t.x>n.x||t.x===n.x&&t.y>n.y?1:-1})}function mj(e,t,n,r,o){e=e||[];const i=[];Wu.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=iw(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(el(l)):c?(tj||X2([c],"ReactGridLayout.children"),i.push(el({...c,i:a.key}))):i.push(el({w:1,h:1,x:0,y:ow(i),i:String(a.key)}))});const s=H2(i,{cols:n});return o?s:B2(s,r,n)}function X2(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,o=e.length;r<o;r++){const i=e[r];for(let s=0;s<n.length;s++)if(typeof i[n[s]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[s]+" must be a number!")}}function vj(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const bj=()=>{};Ot.noop=bj;var Ei={};Object.defineProperty(Ei,"__esModule",{value:!0});Ei.calcGridColWidth=Xg;Ei.calcGridItemPosition=yj;Ei.calcGridItemWHPx=xy;Ei.calcWH=wj;Ei.calcXY=xj;Ei.clamp=Ha;function Xg(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function xy(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function yj(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=Xg(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=xy(r,c,s[0]),u.height=xy(o,l,s[1])),i&&i.dragging?(u.top=Math.round(i.dragging.top),u.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(u.top=Math.round(i.resizing.top),u.left=Math.round(i.resizing.left)):(u.top=Math.round((l+s[1])*n+a[1]),u.left=Math.round((c+s[0])*t+a[0])),u}function xj(e,t,n,r,o){const{margin:i,cols:s,rowHeight:a,maxRows:l}=e,c=Xg(e);let u=Math.round((n-i[0])/(c+i[0])),f=Math.round((t-i[1])/(a+i[1]));return u=Ha(u,0,s-r),f=Ha(f,0,l-o),{x:u,y:f}}function wj(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=Xg(e);let f=Math.round((t+s[0])/(u+s[0])),p=Math.round((n+s[1])/(c+s[1])),g=Ha(f,0,l-r),v=Ha(p,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(g=Ha(f,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(v=Ha(p,0,a)),{w:g,h:v}}function Ha(e,t,n){return Math.max(Math.min(e,n),t)}var Qg={},wy={exports:{}},vb,wE;function hw(){if(wE)return vb;wE=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return vb=e,vb}var bb,_E;function _j(){if(_E)return bb;_E=1;var e=hw();function t(){}function n(){}return n.resetWarningCache=t,bb=function(){function r(s,a,l,c,u,f){if(f!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},bb}var Ah={exports:{}},qt={};/** @license React v16.13.1
|
|
88
|
+
}`;var xt=HC(function(){return zt(z,Ye+"return "+Ee).apply(n,W)});if(xt.source=Ee,Xv(xt))throw xt;return xt}function _6(d){return Ut(d).toLowerCase()}function S6(d){return Ut(d).toUpperCase()}function C6(d,h,y){if(d=Ut(d),d&&(y||h===n))return J_(d);if(!d||!(h=Vr(h)))return d;var E=Lo(d),k=Lo(h),z=Z_(E,k),W=eS(E,k)+1;return Es(E,z,W).join("")}function E6(d,h,y){if(d=Ut(d),d&&(y||h===n))return d.slice(0,nS(d)+1);if(!d||!(h=Vr(h)))return d;var E=Lo(d),k=eS(E,Lo(h))+1;return Es(E,0,k).join("")}function R6(d,h,y){if(d=Ut(d),d&&(y||h===n))return d.replace(jn,"");if(!d||!(h=Vr(h)))return d;var E=Lo(d),k=Z_(E,Lo(h));return Es(E,k).join("")}function O6(d,h){var y=I,E=F;if(wn(h)){var k="separator"in h?h.separator:k;y="length"in h?gt(h.length):y,E="omission"in h?Vr(h.omission):E}d=Ut(d);var z=d.length;if(Tl(d)){var W=Lo(d);z=W.length}if(y>=z)return d;var K=y-Dl(E);if(K<1)return E;var oe=W?Es(W,0,K).join(""):d.slice(0,K);if(k===n)return oe+E;if(W&&(K+=oe.length-K),Qv(k)){if(d.slice(K).search(k)){var xe,we=oe;for(k.global||(k=hv(k.source,Ut(qe.exec(k))+"g")),k.lastIndex=0;xe=k.exec(we);)var Ee=xe.index;oe=oe.slice(0,Ee===n?K:Ee)}}else if(d.indexOf(Vr(k),K)!=K){var ze=oe.lastIndexOf(k);ze>-1&&(oe=oe.slice(0,ze))}return oe+E}function P6(d){return d=Ut(d),d&&Rn.test(d)?d.replace(Xt,rL):d}var T6=Ll(function(d,h,y){return d+(y?" ":"")+h.toUpperCase()}),eb=WS("toUpperCase");function VC(d,h,y){return d=Ut(d),h=y?n:h,h===n?JN(d)?sL(d):HN(d):d.match(h)||[]}var HC=St(function(d,h){try{return jr(d,n,h)}catch(y){return Xv(y)?y:new ct(y)}}),D6=Li(function(d,h){return mo(h,function(y){y=oi(y),Ii(d,y,Yv(d[y],d))}),d});function $6(d){var h=d==null?0:d.length,y=Je();return d=h?yn(d,function(E){if(typeof E[1]!="function")throw new vo(s);return[y(E[0]),E[1]]}):[],St(function(E){for(var k=-1;++k<h;){var z=d[k];if(jr(z[0],this,E))return jr(z[1],this,E)}})}function k6(d){return r3(yo(d,f))}function tb(d){return function(){return d}}function M6(d,h){return d==null||d!==d?h:d}var A6=qS(),I6=qS(!0);function Cr(d){return d}function nb(d){return _S(typeof d=="function"?d:yo(d,f))}function N6(d){return CS(yo(d,f))}function L6(d,h){return ES(d,yo(h,f))}var F6=St(function(d,h){return function(y){return fu(y,d,h)}}),z6=St(function(d,h){return function(y){return fu(d,y,h)}});function rb(d,h,y){var E=Vn(h),k=ch(h,E);y==null&&!(wn(h)&&(k.length||!E.length))&&(y=h,h=d,d=this,k=ch(h,Vn(h)));var z=!(wn(y)&&"chain"in y)||!!y.chain,W=zi(d);return mo(k,function(K){var oe=h[K];d[K]=oe,W&&(d.prototype[K]=function(){var xe=this.__chain__;if(z||xe){var we=d(this.__wrapped__),Ee=we.__actions__=wr(this.__actions__);return Ee.push({func:oe,args:arguments,thisArg:d}),we.__chain__=xe,we}return oe.apply(d,ys([this.value()],arguments))})}),d}function j6(){return Yn._===this&&(Yn._=fL),this}function ob(){}function B6(d){return d=gt(d),St(function(h){return RS(h,d)})}var V6=Iv(yn),H6=Iv(G_),W6=Iv(sv);function WC(d){return Vv(d)?av(oi(d)):x3(d)}function U6(d){return function(h){return d==null?n:wa(d,h)}}var q6=YS(),G6=YS(!0);function ib(){return[]}function sb(){return!1}function Y6(){return{}}function K6(){return""}function X6(){return!0}function Q6(d,h){if(d=gt(d),d<1||d>Y)return[];var y=V,E=nr(d,V);h=Je(h),d-=V;for(var k=uv(E,h);++y<d;)h(y);return k}function J6(d){return ut(d)?yn(d,oi):Hr(d)?[d]:wr(uC(Ut(d)))}function Z6(d){var h=++uL;return Ut(d)+h}var e9=gh(function(d,h){return d+h},0),t9=Nv("ceil"),n9=gh(function(d,h){return d/h},1),r9=Nv("floor");function o9(d){return d&&d.length?lh(d,Cr,wv):n}function i9(d,h){return d&&d.length?lh(d,Je(h,2),wv):n}function s9(d){return X_(d,Cr)}function a9(d,h){return X_(d,Je(h,2))}function l9(d){return d&&d.length?lh(d,Cr,Ev):n}function c9(d,h){return d&&d.length?lh(d,Je(h,2),Ev):n}var u9=gh(function(d,h){return d*h},1),d9=Nv("round"),f9=gh(function(d,h){return d-h},0);function h9(d){return d&&d.length?cv(d,Cr):0}function p9(d,h){return d&&d.length?cv(d,Je(h,2)):0}return L.after=NF,L.ary=wC,L.assign=S4,L.assignIn=IC,L.assignInWith=Ph,L.assignWith=C4,L.at=E4,L.before=_C,L.bind=Yv,L.bindAll=D6,L.bindKey=SC,L.castArray=YF,L.chain=bC,L.chunk=r7,L.compact=o7,L.concat=i7,L.cond=$6,L.conforms=k6,L.constant=tb,L.countBy=hF,L.create=R4,L.curry=CC,L.curryRight=EC,L.debounce=RC,L.defaults=O4,L.defaultsDeep=P4,L.defer=LF,L.delay=FF,L.difference=s7,L.differenceBy=a7,L.differenceWith=l7,L.drop=c7,L.dropRight=u7,L.dropRightWhile=d7,L.dropWhile=f7,L.fill=h7,L.filter=gF,L.flatMap=bF,L.flatMapDeep=yF,L.flatMapDepth=xF,L.flatten=pC,L.flattenDeep=p7,L.flattenDepth=g7,L.flip=zF,L.flow=A6,L.flowRight=I6,L.fromPairs=m7,L.functions=I4,L.functionsIn=N4,L.groupBy=wF,L.initial=b7,L.intersection=y7,L.intersectionBy=x7,L.intersectionWith=w7,L.invert=F4,L.invertBy=z4,L.invokeMap=SF,L.iteratee=nb,L.keyBy=CF,L.keys=Vn,L.keysIn=Sr,L.map=_h,L.mapKeys=B4,L.mapValues=V4,L.matches=N6,L.matchesProperty=L6,L.memoize=Ch,L.merge=H4,L.mergeWith=NC,L.method=F6,L.methodOf=z6,L.mixin=rb,L.negate=Eh,L.nthArg=B6,L.omit=W4,L.omitBy=U4,L.once=jF,L.orderBy=EF,L.over=V6,L.overArgs=BF,L.overEvery=H6,L.overSome=W6,L.partial=Kv,L.partialRight=OC,L.partition=RF,L.pick=q4,L.pickBy=LC,L.property=WC,L.propertyOf=U6,L.pull=E7,L.pullAll=mC,L.pullAllBy=R7,L.pullAllWith=O7,L.pullAt=P7,L.range=q6,L.rangeRight=G6,L.rearg=VF,L.reject=TF,L.remove=T7,L.rest=HF,L.reverse=qv,L.sampleSize=$F,L.set=Y4,L.setWith=K4,L.shuffle=kF,L.slice=D7,L.sortBy=IF,L.sortedUniq=L7,L.sortedUniqBy=F7,L.split=b6,L.spread=WF,L.tail=z7,L.take=j7,L.takeRight=B7,L.takeRightWhile=V7,L.takeWhile=H7,L.tap=oF,L.throttle=UF,L.thru=wh,L.toArray=kC,L.toPairs=FC,L.toPairsIn=zC,L.toPath=J6,L.toPlainObject=AC,L.transform=X4,L.unary=qF,L.union=W7,L.unionBy=U7,L.unionWith=q7,L.uniq=G7,L.uniqBy=Y7,L.uniqWith=K7,L.unset=Q4,L.unzip=Gv,L.unzipWith=vC,L.update=J4,L.updateWith=Z4,L.values=jl,L.valuesIn=e6,L.without=X7,L.words=VC,L.wrap=GF,L.xor=Q7,L.xorBy=J7,L.xorWith=Z7,L.zip=eF,L.zipObject=tF,L.zipObjectDeep=nF,L.zipWith=rF,L.entries=FC,L.entriesIn=zC,L.extend=IC,L.extendWith=Ph,rb(L,L),L.add=e9,L.attempt=HC,L.camelCase=o6,L.capitalize=jC,L.ceil=t9,L.clamp=t6,L.clone=KF,L.cloneDeep=QF,L.cloneDeepWith=JF,L.cloneWith=XF,L.conformsTo=ZF,L.deburr=BC,L.defaultTo=M6,L.divide=n9,L.endsWith=i6,L.eq=zo,L.escape=s6,L.escapeRegExp=a6,L.every=pF,L.find=mF,L.findIndex=fC,L.findKey=T4,L.findLast=vF,L.findLastIndex=hC,L.findLastKey=D4,L.floor=r9,L.forEach=yC,L.forEachRight=xC,L.forIn=$4,L.forInRight=k4,L.forOwn=M4,L.forOwnRight=A4,L.get=Jv,L.gt=e4,L.gte=t4,L.has=L4,L.hasIn=Zv,L.head=gC,L.identity=Cr,L.includes=_F,L.indexOf=v7,L.inRange=n6,L.invoke=j4,L.isArguments=Ca,L.isArray=ut,L.isArrayBuffer=n4,L.isArrayLike=_r,L.isArrayLikeObject=On,L.isBoolean=r4,L.isBuffer=Rs,L.isDate=o4,L.isElement=i4,L.isEmpty=s4,L.isEqual=a4,L.isEqualWith=l4,L.isError=Xv,L.isFinite=c4,L.isFunction=zi,L.isInteger=PC,L.isLength=Rh,L.isMap=TC,L.isMatch=u4,L.isMatchWith=d4,L.isNaN=f4,L.isNative=h4,L.isNil=g4,L.isNull=p4,L.isNumber=DC,L.isObject=wn,L.isObjectLike=Sn,L.isPlainObject=bu,L.isRegExp=Qv,L.isSafeInteger=m4,L.isSet=$C,L.isString=Oh,L.isSymbol=Hr,L.isTypedArray=zl,L.isUndefined=v4,L.isWeakMap=b4,L.isWeakSet=y4,L.join=_7,L.kebabCase=l6,L.last=wo,L.lastIndexOf=S7,L.lowerCase=c6,L.lowerFirst=u6,L.lt=x4,L.lte=w4,L.max=o9,L.maxBy=i9,L.mean=s9,L.meanBy=a9,L.min=l9,L.minBy=c9,L.stubArray=ib,L.stubFalse=sb,L.stubObject=Y6,L.stubString=K6,L.stubTrue=X6,L.multiply=u9,L.nth=C7,L.noConflict=j6,L.noop=ob,L.now=Sh,L.pad=d6,L.padEnd=f6,L.padStart=h6,L.parseInt=p6,L.random=r6,L.reduce=OF,L.reduceRight=PF,L.repeat=g6,L.replace=m6,L.result=G4,L.round=d9,L.runInContext=ne,L.sample=DF,L.size=MF,L.snakeCase=v6,L.some=AF,L.sortedIndex=$7,L.sortedIndexBy=k7,L.sortedIndexOf=M7,L.sortedLastIndex=A7,L.sortedLastIndexBy=I7,L.sortedLastIndexOf=N7,L.startCase=y6,L.startsWith=x6,L.subtract=f9,L.sum=h9,L.sumBy=p9,L.template=w6,L.times=Q6,L.toFinite=ji,L.toInteger=gt,L.toLength=MC,L.toLower=_6,L.toNumber=_o,L.toSafeInteger=_4,L.toString=Ut,L.toUpper=S6,L.trim=C6,L.trimEnd=E6,L.trimStart=R6,L.truncate=O6,L.unescape=P6,L.uniqueId=Z6,L.upperCase=T6,L.upperFirst=eb,L.each=yC,L.eachRight=xC,L.first=gC,rb(L,function(){var d={};return ni(L,function(h,y){Qt.call(L.prototype,y)||(d[y]=h)}),d}(),{chain:!1}),L.VERSION=r,mo(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){L[d].placeholder=L}),mo(["drop","take"],function(d,h){Mt.prototype[d]=function(y){y=y===n?1:In(gt(y),0);var E=this.__filtered__&&!h?new Mt(this):this.clone();return E.__filtered__?E.__takeCount__=nr(y,E.__takeCount__):E.__views__.push({size:nr(y,V),type:d+(E.__dir__<0?"Right":"")}),E},Mt.prototype[d+"Right"]=function(y){return this.reverse()[d](y).reverse()}}),mo(["filter","map","takeWhile"],function(d,h){var y=h+1,E=y==G||y==J;Mt.prototype[d]=function(k){var z=this.clone();return z.__iteratees__.push({iteratee:Je(k,3),type:y}),z.__filtered__=z.__filtered__||E,z}}),mo(["head","last"],function(d,h){var y="take"+(h?"Right":"");Mt.prototype[d]=function(){return this[y](1).value()[0]}}),mo(["initial","tail"],function(d,h){var y="drop"+(h?"":"Right");Mt.prototype[d]=function(){return this.__filtered__?new Mt(this):this[y](1)}}),Mt.prototype.compact=function(){return this.filter(Cr)},Mt.prototype.find=function(d){return this.filter(d).head()},Mt.prototype.findLast=function(d){return this.reverse().find(d)},Mt.prototype.invokeMap=St(function(d,h){return typeof d=="function"?new Mt(this):this.map(function(y){return fu(y,d,h)})}),Mt.prototype.reject=function(d){return this.filter(Eh(Je(d)))},Mt.prototype.slice=function(d,h){d=gt(d);var y=this;return y.__filtered__&&(d>0||h<0)?new Mt(y):(d<0?y=y.takeRight(-d):d&&(y=y.drop(d)),h!==n&&(h=gt(h),y=h<0?y.dropRight(-h):y.take(h-d)),y)},Mt.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},Mt.prototype.toArray=function(){return this.take(V)},ni(Mt.prototype,function(d,h){var y=/^(?:filter|find|map|reject)|While$/.test(h),E=/^(?:head|last)$/.test(h),k=L[E?"take"+(h=="last"?"Right":""):h],z=E||/^find/.test(h);k&&(L.prototype[h]=function(){var W=this.__wrapped__,K=E?[1]:arguments,oe=W instanceof Mt,xe=K[0],we=oe||ut(W),Ee=function(Pt){var At=k.apply(L,ys([Pt],K));return E&&ze?At[0]:At};we&&y&&typeof xe=="function"&&xe.length!=1&&(oe=we=!1);var ze=this.__chain__,Ye=!!this.__actions__.length,et=z&&!ze,xt=oe&&!Ye;if(!z&&we){W=xt?W:new Mt(this);var tt=d.apply(W,K);return tt.__actions__.push({func:wh,args:[Ee],thisArg:n}),new bo(tt,ze)}return et&&xt?d.apply(this,K):(tt=this.thru(Ee),et?E?tt.value()[0]:tt.value():tt)})}),mo(["pop","push","shift","sort","splice","unshift"],function(d){var h=Gf[d],y=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",E=/^(?:pop|shift)$/.test(d);L.prototype[d]=function(){var k=arguments;if(E&&!this.__chain__){var z=this.value();return h.apply(ut(z)?z:[],k)}return this[y](function(W){return h.apply(ut(W)?W:[],k)})}}),ni(Mt.prototype,function(d,h){var y=L[h];if(y){var E=y.name+"";Qt.call(Al,E)||(Al[E]=[]),Al[E].push({name:h,func:y})}}),Al[ph(n,w).name]=[{name:"wrapper",func:n}],Mt.prototype.clone=PL,Mt.prototype.reverse=TL,Mt.prototype.value=DL,L.prototype.at=iF,L.prototype.chain=sF,L.prototype.commit=aF,L.prototype.next=lF,L.prototype.plant=uF,L.prototype.reverse=dF,L.prototype.toJSON=L.prototype.valueOf=L.prototype.value=fF,L.prototype.first=L.prototype.head,iu&&(L.prototype[iu]=cF),L},$l=aL();ma?((ma.exports=$l)._=$l,nv._=$l):Yn._=$l}).call(zs)})(eg,eg.exports);var tc=eg.exports;const os=Uc(tc);function uE({id:e,layouts:t,initialHeight:n,y:r,x:o,w:i,minH:s}){const a={i:e,x:o??0,y:r??1/0,w:i||20,h:n||35,minW:6,minH:s||10};t||(t={}),lT.forEach(l=>{t!=null&&t[l]||(t={...t,[l]:[]}),t[l].push(a)})}function dE(e,t){t&&lT.forEach(n=>{t!=null&&t[n]&&(t[n]=t[n].filter(r=>r.i!==e))})}const Ie=X2()(rT((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:ty},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{setGlobalStyle:n=>{e(r=>{r.dashboard.globalStyle=n})},setAIScopeTables:n=>{e(r=>{r.dashboard.aiScopeTables=n})},setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&tc.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.python=r)})})},addBaseQuery:n=>{e(r=>{var o;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(o=r.dashboard.baseQueries)==null||o.push(n)})},removeBaseQuery:n=>{e(r=>{var i,s;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(a=>a.id===n);o!=null&&o>-1&&((s=r.dashboard.baseQueries)==null||s.splice(o,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},addFilteringCard:n=>{e(r=>{var o;(o=r.filteringCards)==null||o.push(n)})},removeFilteringCard:n=>{e(r=>{var i,s;const o=(i=r.filteringCards)==null?void 0:i.findIndex(a=>a.id===n.id);o!==void 0&&o>-1&&((s=r.filteringCards)==null||s.splice(o,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setBookmarkKey:n=>{e(()=>({bookmarkKey:n}))},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setCardTitle:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&tc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(p=>p.id===r);u&&(u.title=o)})})},setCardInfo:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&tc.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.info=r)})})},setCardDescription:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&tc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(p=>p.id===r);u&&(u.description=o)})})},setCardSql:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(p=>p.id===r);f&&(f.sql=o,(u=i.onUpdateCard)==null||u.call(i,f,n))}})},setFrameCardData:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&tc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(p=>p.id===r);u&&(u.data=o)})})},setSheetLayout:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layout=r)})},setSheetLayouts:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layouts=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1?r.filterValues.splice(o,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(o=>{var s,a,l;const i=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(c=>c.filterId===o.filterId);i!==void 0&&i>-1?(a=r.filterValues)==null||a.splice(i,1,o):(l=r.filterValues)==null||l.push(o)}):r.filterValues=n})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.filter(i=>i.filterId!==n&&!i.filterId.startsWith(n));r.filterValues=o}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1&&r.filterValues.splice(o,1,n)}})},addFilter:n=>{e(r=>{var i,s;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n];const o=(s=r.dashboard.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId);uE({id:n.id,layouts:o==null?void 0:o.layouts,y:0,initialHeight:8,minH:7,w:10})})},removeFilter:n=>{e(r=>{var o,i,s;if(r.dashboard.filters){const a=(o=r.dashboard.filters)==null?void 0:o.findIndex(l=>l.id===n);if(a>-1){(i=r.dashboard.filters)==null||i.splice(a,1);const l=(s=r.dashboard.sheets)==null?void 0:s.find(c=>c.id===r.selectedSheetId);dE(n,l==null?void 0:l.layouts)}}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,f,p;const s=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(g=>g.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(g=>g.id===r);if(a){const g=(f=a.cards)==null?void 0:f.findIndex(v=>v.id===o.id);g>-1&&((p=a.cards)==null||p.splice(g,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n.id);s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){s.frames||(s.frames=[]),(c=s.frames)==null||c.push(r);let f=1/0,p=0;o==="start"&&(f=0),uE({id:r.id,layouts:s.layouts,minH:10,x:p,y:f}),(u=i.onAddFrame)==null||u.call(i,r,n)}})},removeFrame:(n,r)=>{e(o=>{var s,a,l,c,u;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(i){const f=(l=i.frames)==null?void 0:l.findIndex(p=>p.id===r);console.log(f),typeof f=="number"&&f>-1&&((c=i.frames)==null||c.splice(f,1),(u=i.layout)==null||u.splice(f,1),dE(r,i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,c,u;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n),s=(c=i==null?void 0:i.frames)==null?void 0:c.findIndex(f=>f.id===r.id);i&&((u=i.frames)==null||u.splice(s,1,r))})},updateCard:(n,r)=>{e(o=>{var a,l,c,u,f;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(p=>p.id===r.id);i&&((u=i.cards)==null||u.splice(s,1,r),(f=o.onUpdateCard)==null||f.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,c,u,f,p;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(g=>g.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(g=>g.id===r.id);i&&((u=i.cards)==null||u.splice(s,1),(f=i.layout)==null||f.splice(s,1),(p=o.onRemoveCard)==null||p.call(o,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);i&&(((l=i.cards)==null?void 0:l.find(u=>u.id===r))?o.selectedCardId=r:o.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(o=>o.id===t().selectedSheetId)},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(s=>s.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const c=(i=a[l].cards)==null?void 0:i.find(u=>u.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},handleDataPointClickAction:(n,r)=>{N8({card:n,dataPoint:r,set:e,get:t})}}}))),Ci=()=>Ie(e=>e.actions);var vf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},kc=typeof window>"u"||"Deno"in window;function Oo(){}function L8(e,t){return typeof e=="function"?e(t):e}function ry(e){return typeof e=="number"&&e>=0&&e!==1/0}function uT(e,t){return Math.max(e+(t||0)-Date.now(),0)}function fE(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==qx(s,t.options))return!1}else if(!yd(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function hE(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(bd(t.options.mutationKey)!==bd(i))return!1}else if(!yd(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function qx(e,t){return((t==null?void 0:t.queryKeyHashFn)||bd)(e)}function bd(e){return JSON.stringify(e,(t,n)=>iy(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function yd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!yd(e[n],t[n])):!1}function dT(e,t){if(e===t)return e;const n=pE(e)&&pE(t);if(n||iy(e)&&iy(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:i[c];!n&&e[u]===void 0&&t[u]===void 0&&r.includes(u)?(a[u]=void 0,l++):(a[u]=dT(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function oy(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function pE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function iy(e){if(!gE(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!gE(n)||!n.hasOwnProperty("isPrototypeOf"))}function gE(e){return Object.prototype.toString.call(e)==="[object Object]"}function F8(e){return new Promise(t=>{setTimeout(t,e)})}function sy(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?dT(e,t):t}function z8(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function j8(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var qa,js,pc,k2,B8=(k2=class extends vf{constructor(){super();Xe(this,qa,void 0);Xe(this,js,void 0);Xe(this,pc,void 0);Ve(this,pc,t=>{if(!kc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){re(this,js)||this.setEventListener(re(this,pc))}onUnsubscribe(){var t;this.hasListeners()||((t=re(this,js))==null||t.call(this),Ve(this,js,void 0))}setEventListener(t){var n;Ve(this,pc,t),(n=re(this,js))==null||n.call(this),Ve(this,js,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){re(this,qa)!==t&&(Ve(this,qa,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof re(this,qa)=="boolean"?re(this,qa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},qa=new WeakMap,js=new WeakMap,pc=new WeakMap,k2),tg=new B8,gc,Bs,mc,M2,V8=(M2=class extends vf{constructor(){super();Xe(this,gc,!0);Xe(this,Bs,void 0);Xe(this,mc,void 0);Ve(this,mc,t=>{if(!kc&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){re(this,Bs)||this.setEventListener(re(this,mc))}onUnsubscribe(){var t;this.hasListeners()||((t=re(this,Bs))==null||t.call(this),Ve(this,Bs,void 0))}setEventListener(t){var n;Ve(this,mc,t),(n=re(this,Bs))==null||n.call(this),Ve(this,Bs,t(this.setOnline.bind(this)))}setOnline(t){re(this,gc)!==t&&(Ve(this,gc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return re(this,gc)}},gc=new WeakMap,Bs=new WeakMap,mc=new WeakMap,M2),ng=new V8;function H8(e){return Math.min(1e3*2**e,3e4)}function Hg(e){return(e??"online")==="online"?ng.isOnline():!0}var fT=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function gb(e){return e instanceof fT}function hT(e){let t=!1,n=0,r=!1,o,i,s;const a=new Promise((x,w)=>{i=x,s=w}),l=x=>{var w;r||(g(new fT(x)),(w=e.abort)==null||w.call(e))},c=()=>{t=!0},u=()=>{t=!1},f=()=>!tg.isFocused()||e.networkMode!=="always"&&!ng.isOnline(),p=x=>{var w;r||(r=!0,(w=e.onSuccess)==null||w.call(e,x),o==null||o(),i(x))},g=x=>{var w;r||(r=!0,(w=e.onError)==null||w.call(e,x),o==null||o(),s(x))},v=()=>new Promise(x=>{var w;o=_=>{const S=r||!f();return S&&x(_),S},(w=e.onPause)==null||w.call(e)}).then(()=>{var x;o=void 0,r||(x=e.onContinue)==null||x.call(e)}),b=()=>{if(r)return;let x;try{x=e.fn()}catch(w){x=Promise.reject(w)}Promise.resolve(x).then(p).catch(w=>{var P;if(r)return;const _=e.retry??(kc?0:3),S=e.retryDelay??H8,R=typeof S=="function"?S(n,w):S,C=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,w);if(t||!C){g(w);return}n++,(P=e.onFail)==null||P.call(e,n,w),F8(R).then(()=>{if(f())return v()}).then(()=>{t?g(w):b()})})};return Hg(e.networkMode)?b():v().then(b),{promise:a,cancel:l,continue:()=>(o==null?void 0:o())?a:Promise.resolve(),cancelRetry:c,continueRetry:u}}function W8(){let e=[],t=0,n=p=>{p()},r=p=>{p()},o=p=>setTimeout(p,0);const i=p=>{o=p},s=p=>{let g;t++;try{g=p()}finally{t--,t||c()}return g},a=p=>{t?e.push(p):o(()=>{n(p)})},l=p=>(...g)=>{a(()=>{p(...g)})},c=()=>{const p=e;e=[],p.length&&o(()=>{r(()=>{p.forEach(g=>{n(g)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:p=>{n=p},setBatchNotifyFunction:p=>{r=p},setScheduler:i}}var Jn=W8(),Ga,A2,pT=(A2=class{constructor(){Xe(this,Ga,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ry(this.gcTime)&&Ve(this,Ga,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(kc?1/0:5*60*1e3))}clearGcTimeout(){re(this,Ga)&&(clearTimeout(re(this,Ga)),Ve(this,Ga,void 0))}},Ga=new WeakMap,A2),vc,bc,Co,Vs,Eo,Hn,nf,Ya,yc,Ap,Wo,Ui,I2,U8=(I2=class extends pT{constructor(t){super();Xe(this,yc);Xe(this,Wo);Xe(this,vc,void 0);Xe(this,bc,void 0);Xe(this,Co,void 0);Xe(this,Vs,void 0);Xe(this,Eo,void 0);Xe(this,Hn,void 0);Xe(this,nf,void 0);Xe(this,Ya,void 0);Ve(this,Ya,!1),Ve(this,nf,t.defaultOptions),Ct(this,yc,Ap).call(this,t.options),Ve(this,Hn,[]),Ve(this,Co,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ve(this,vc,t.state||q8(this.options)),this.state=re(this,vc),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!re(this,Hn).length&&this.state.fetchStatus==="idle"&&re(this,Co).remove(this)}setData(t,n){const r=sy(this.state.data,t,this.options);return Ct(this,Wo,Ui).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ct(this,Wo,Ui).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=re(this,Vs);return(r=re(this,Eo))==null||r.cancel(t),n?n.then(Oo).catch(Oo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(re(this,vc))}isActive(){return re(this,Hn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||re(this,Hn).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!uT(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=re(this,Hn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=re(this,Eo))==null||n.continue()}onOnline(){var n;const t=re(this,Hn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=re(this,Eo))==null||n.continue()}addObserver(t){re(this,Hn).includes(t)||(re(this,Hn).push(t),this.clearGcTimeout(),re(this,Co).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){re(this,Hn).includes(t)&&(Ve(this,Hn,re(this,Hn).filter(n=>n!==t)),re(this,Hn).length||(re(this,Eo)&&(re(this,Ya)?re(this,Eo).cancel({revert:!0}):re(this,Eo).cancelRetry()),this.scheduleGc()),re(this,Co).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return re(this,Hn).length}invalidate(){this.state.isInvalidated||Ct(this,Wo,Ui).call(this,{type:"invalidate"})}fetch(t,n){var c,u,f,p;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(re(this,Vs))return(c=re(this,Eo))==null||c.continueRetry(),re(this,Vs)}if(t&&Ct(this,yc,Ap).call(this,t),!this.options.queryFn){const g=re(this,Hn).find(v=>v.options.queryFn);g&&Ct(this,yc,Ap).call(this,g.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o={queryKey:this.queryKey,meta:this.meta},i=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(Ve(this,Ya,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(Ve(this,Ya,!1),this.options.persister?this.options.persister(this.options.queryFn,o,this):this.options.queryFn(o)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(a),(u=this.options.behavior)==null||u.onFetch(a,this),Ve(this,bc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&Ct(this,Wo,Ui).call(this,{type:"fetch",meta:(p=a.fetchOptions)==null?void 0:p.meta});const l=g=>{var v,b,x,w;gb(g)&&g.silent||Ct(this,Wo,Ui).call(this,{type:"error",error:g}),gb(g)||((b=(v=re(this,Co).config).onError)==null||b.call(v,g,this),(w=(x=re(this,Co).config).onSettled)==null||w.call(x,this.state.data,g,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Ve(this,Eo,hT({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:g=>{var v,b,x,w;if(typeof g>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}this.setData(g),(b=(v=re(this,Co).config).onSuccess)==null||b.call(v,g,this),(w=(x=re(this,Co).config).onSettled)==null||w.call(x,g,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(g,v)=>{Ct(this,Wo,Ui).call(this,{type:"failed",failureCount:g,error:v})},onPause:()=>{Ct(this,Wo,Ui).call(this,{type:"pause"})},onContinue:()=>{Ct(this,Wo,Ui).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Ve(this,Vs,re(this,Eo).promise),re(this,Vs)}},vc=new WeakMap,bc=new WeakMap,Co=new WeakMap,Vs=new WeakMap,Eo=new WeakMap,Hn=new WeakMap,nf=new WeakMap,Ya=new WeakMap,yc=new WeakSet,Ap=function(t){this.options={...re(this,nf),...t},this.updateGcTime(this.options.gcTime)},Wo=new WeakSet,Ui=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:Hg(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return gb(o)&&o.revert&&re(this,bc)?{...re(this,bc),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Jn.batch(()=>{re(this,Hn).forEach(r=>{r.onQueryUpdate()}),re(this,Co).notify({query:this,type:"updated",action:t})})},I2);function q8(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ci,N2,gT=(N2=class extends vf{constructor(t={}){super();Xe(this,ci,void 0);this.config=t,Ve(this,ci,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??qx(o,n);let s=this.get(i);return s||(s=new U8({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){re(this,ci).has(t.queryHash)||(re(this,ci).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=re(this,ci).get(t.queryHash);n&&(t.destroy(),n===t&&re(this,ci).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Jn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return re(this,ci).get(t)}getAll(){return[...re(this,ci).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>fE(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>fE(t,r)):n}notify(t){Jn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Jn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Jn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ci=new WeakMap,N2),ui,rf,Xr,xc,di,Is,L2,G8=(L2=class extends pT{constructor(t){super();Xe(this,di);Xe(this,ui,void 0);Xe(this,rf,void 0);Xe(this,Xr,void 0);Xe(this,xc,void 0);this.mutationId=t.mutationId,Ve(this,rf,t.defaultOptions),Ve(this,Xr,t.mutationCache),Ve(this,ui,[]),this.state=t.state||Y8(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...re(this,rf),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){re(this,ui).includes(t)||(re(this,ui).push(t),this.clearGcTimeout(),re(this,Xr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ve(this,ui,re(this,ui).filter(n=>n!==t)),this.scheduleGc(),re(this,Xr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){re(this,ui).length||(this.state.status==="pending"?this.scheduleGc():re(this,Xr).remove(this))}continue(){var t;return((t=re(this,xc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,f,p,g,v,b,x,w,_,S,R,C,P,A;const n=()=>(Ve(this,xc,hT({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(M,T)=>{Ct(this,di,Is).call(this,{type:"failed",failureCount:M,error:T})},onPause:()=>{Ct(this,di,Is).call(this,{type:"pause"})},onContinue:()=>{Ct(this,di,Is).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),re(this,xc).promise),r=this.state.status==="pending";try{if(!r){Ct(this,di,Is).call(this,{type:"pending",variables:t}),await((i=(o=re(this,Xr).config).onMutate)==null?void 0:i.call(o,t,this));const T=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));T!==this.state.context&&Ct(this,di,Is).call(this,{type:"pending",context:T,variables:t})}const M=await n();return await((c=(l=re(this,Xr).config).onSuccess)==null?void 0:c.call(l,M,t,this.state.context,this)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,M,t,this.state.context)),await((g=(p=re(this,Xr).config).onSettled)==null?void 0:g.call(p,M,null,this.state.variables,this.state.context,this)),await((b=(v=this.options).onSettled)==null?void 0:b.call(v,M,null,t,this.state.context)),Ct(this,di,Is).call(this,{type:"success",data:M}),M}catch(M){try{throw await((w=(x=re(this,Xr).config).onError)==null?void 0:w.call(x,M,t,this.state.context,this)),await((S=(_=this.options).onError)==null?void 0:S.call(_,M,t,this.state.context)),await((C=(R=re(this,Xr).config).onSettled)==null?void 0:C.call(R,void 0,M,this.state.variables,this.state.context,this)),await((A=(P=this.options).onSettled)==null?void 0:A.call(P,void 0,M,t,this.state.context)),M}finally{Ct(this,di,Is).call(this,{type:"error",error:M})}}}},ui=new WeakMap,rf=new WeakMap,Xr=new WeakMap,xc=new WeakMap,di=new WeakSet,Is=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Hg(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Jn.batch(()=>{re(this,ui).forEach(r=>{r.onMutationUpdate(t)}),re(this,Xr).notify({mutation:this,type:"updated",action:t})})},L2);function Y8(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ro,of,Ka,F2,K8=(F2=class extends vf{constructor(t={}){super();Xe(this,Ro,void 0);Xe(this,of,void 0);Xe(this,Ka,void 0);this.config=t,Ve(this,Ro,[]),Ve(this,of,0)}build(t,n,r){const o=new G8({mutationCache:this,mutationId:++Th(this,of)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){re(this,Ro).push(t),this.notify({type:"added",mutation:t})}remove(t){Ve(this,Ro,re(this,Ro).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){Jn.batch(()=>{re(this,Ro).forEach(t=>{this.remove(t)})})}getAll(){return re(this,Ro)}find(t){const n={exact:!0,...t};return re(this,Ro).find(r=>hE(n,r))}findAll(t={}){return re(this,Ro).filter(n=>hE(t,n))}notify(t){Jn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Ve(this,Ka,(re(this,Ka)??Promise.resolve()).then(()=>{const t=re(this,Ro).filter(n=>n.state.isPaused);return Jn.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Oo)),Promise.resolve()))}).then(()=>{Ve(this,Ka,void 0)})),re(this,Ka)}},Ro=new WeakMap,of=new WeakMap,Ka=new WeakMap,F2);function X8(e){return{onFetch:(t,n)=>{const r=async()=>{var v,b,x,w,_;const o=t.options,i=(x=(b=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:b.fetchMore)==null?void 0:x.direction,s=((w=t.state.data)==null?void 0:w.pages)||[],a=((_=t.state.data)==null?void 0:_.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const u=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},f=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),p=async(S,R,C)=>{if(c)return Promise.reject();if(R==null&&S.pages.length)return Promise.resolve(S);const P={queryKey:t.queryKey,pageParam:R,direction:C?"backward":"forward",meta:t.options.meta};u(P);const A=await f(P),{maxPages:M}=t.options,T=C?j8:z8;return{pages:T(S.pages,A,M),pageParams:T(S.pageParams,R,M)}};let g;if(i&&s.length){const S=i==="backward",R=S?Q8:mE,C={pages:s,pageParams:a},P=R(o,C);g=await p(C,P,S)}else{g=await p(l,a[0]??o.initialPageParam);const S=e??s.length;for(let R=1;R<S;R++){const C=mE(o,g);g=await p(g,C)}}return g};t.options.persister?t.fetchFn=()=>{var o,i;return(i=(o=t.options).persister)==null?void 0:i.call(o,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function mE(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function Q8(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var Nn,Hs,Ws,wc,_c,Us,Sc,Cc,z2,J8=(z2=class{constructor(e={}){Xe(this,Nn,void 0);Xe(this,Hs,void 0);Xe(this,Ws,void 0);Xe(this,wc,void 0);Xe(this,_c,void 0);Xe(this,Us,void 0);Xe(this,Sc,void 0);Xe(this,Cc,void 0);Ve(this,Nn,e.queryCache||new gT),Ve(this,Hs,e.mutationCache||new K8),Ve(this,Ws,e.defaultOptions||{}),Ve(this,wc,new Map),Ve(this,_c,new Map),Ve(this,Us,0)}mount(){Th(this,Us)._++,re(this,Us)===1&&(Ve(this,Sc,tg.subscribe(()=>{tg.isFocused()&&(this.resumePausedMutations(),re(this,Nn).onFocus())})),Ve(this,Cc,ng.subscribe(()=>{ng.isOnline()&&(this.resumePausedMutations(),re(this,Nn).onOnline())})))}unmount(){var e,t;Th(this,Us)._--,re(this,Us)===0&&((e=re(this,Sc))==null||e.call(this),Ve(this,Sc,void 0),(t=re(this,Cc))==null||t.call(this),Ve(this,Cc,void 0))}isFetching(e){return re(this,Nn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return re(this,Hs).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=re(this,Nn).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=re(this,Nn).find({queryKey:e}),o=r==null?void 0:r.state.data,i=L8(t,o);if(typeof i>"u")return;const s=this.defaultQueryOptions({queryKey:e});return re(this,Nn).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Jn.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=re(this,Nn).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=re(this,Nn);Jn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=re(this,Nn),r={type:"active",...e};return Jn.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=Jn.batch(()=>re(this,Nn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Oo).catch(Oo)}invalidateQueries(e={},t={}){return Jn.batch(()=>{if(re(this,Nn).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=Jn.batch(()=>re(this,Nn).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Oo)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Oo)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=re(this,Nn).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Oo).catch(Oo)}fetchInfiniteQuery(e){return e.behavior=X8(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Oo).catch(Oo)}resumePausedMutations(){return re(this,Hs).resumePausedMutations()}getQueryCache(){return re(this,Nn)}getMutationCache(){return re(this,Hs)}getDefaultOptions(){return re(this,Ws)}setDefaultOptions(e){Ve(this,Ws,e)}setQueryDefaults(e,t){re(this,wc).set(bd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...re(this,wc).values()];let n={};return t.forEach(r=>{yd(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){re(this,_c).set(bd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...re(this,_c).values()];let n={};return t.forEach(r=>{yd(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...re(this,Ws).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=qx(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...re(this,Ws).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){re(this,Nn).clear(),re(this,Hs).clear()}},Nn=new WeakMap,Hs=new WeakMap,Ws=new WeakMap,wc=new WeakMap,_c=new WeakMap,Us=new WeakMap,Sc=new WeakMap,Cc=new WeakMap,z2),Dr,fn,sf,vr,Xa,Ec,fi,af,Rc,Oc,Qa,Ja,qs,Pc,Za,Hu,lf,ay,cf,ly,uf,cy,df,uy,ff,dy,hf,fy,pf,hy,Lg,mT,j2,Z8=(j2=class extends vf{constructor(t,n){super();Xe(this,Za);Xe(this,lf);Xe(this,cf);Xe(this,uf);Xe(this,df);Xe(this,ff);Xe(this,hf);Xe(this,pf);Xe(this,Lg);Xe(this,Dr,void 0);Xe(this,fn,void 0);Xe(this,sf,void 0);Xe(this,vr,void 0);Xe(this,Xa,void 0);Xe(this,Ec,void 0);Xe(this,fi,void 0);Xe(this,af,void 0);Xe(this,Rc,void 0);Xe(this,Oc,void 0);Xe(this,Qa,void 0);Xe(this,Ja,void 0);Xe(this,qs,void 0);Xe(this,Pc,new Set);this.options=n,Ve(this,Dr,t),Ve(this,fi,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(re(this,fn).addObserver(this),vE(re(this,fn),this.options)?Ct(this,Za,Hu).call(this):this.updateResult(),Ct(this,df,uy).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return py(re(this,fn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return py(re(this,fn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ct(this,ff,dy).call(this),Ct(this,hf,fy).call(this),re(this,fn).removeObserver(this)}setOptions(t,n){const r=this.options,o=re(this,fn);if(this.options=re(this,Dr).defaultQueryOptions(t),oy(r,this.options)||re(this,Dr).getQueryCache().notify({type:"observerOptionsUpdated",query:re(this,fn),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),Ct(this,pf,hy).call(this);const i=this.hasListeners();i&&bE(re(this,fn),o,this.options,r)&&Ct(this,Za,Hu).call(this),this.updateResult(n),i&&(re(this,fn)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&Ct(this,lf,ay).call(this);const s=Ct(this,cf,ly).call(this);i&&(re(this,fn)!==o||this.options.enabled!==r.enabled||s!==re(this,qs))&&Ct(this,uf,cy).call(this,s)}getOptimisticResult(t){const n=re(this,Dr).getQueryCache().build(re(this,Dr),t),r=this.createResult(n,t);return tz(this,r)&&(Ve(this,vr,r),Ve(this,Ec,this.options),Ve(this,Xa,re(this,fn).state)),r}getCurrentResult(){return re(this,vr)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(re(this,Pc).add(r),t[r])})}),n}getCurrentQuery(){return re(this,fn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=re(this,Dr).defaultQueryOptions(t),r=re(this,Dr).getQueryCache().build(re(this,Dr),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ct(this,Za,Hu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),re(this,vr)))}createResult(t,n){var P;const r=re(this,fn),o=this.options,i=re(this,vr),s=re(this,Xa),a=re(this,Ec),c=t!==r?t.state:re(this,sf),{state:u}=t;let{error:f,errorUpdatedAt:p,fetchStatus:g,status:v}=u,b=!1,x;if(n._optimisticResults){const A=this.hasListeners(),M=!A&&vE(t,n),T=A&&bE(t,r,n,o);(M||T)&&(g=Hg(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(v="pending")),n._optimisticResults==="isRestoring"&&(g="idle")}if(n.select&&typeof u.data<"u")if(i&&u.data===(s==null?void 0:s.data)&&n.select===re(this,af))x=re(this,Rc);else try{Ve(this,af,n.select),x=n.select(u.data),x=sy(i==null?void 0:i.data,x,n),Ve(this,Rc,x),Ve(this,fi,null)}catch(A){Ve(this,fi,A)}else x=u.data;if(typeof n.placeholderData<"u"&&typeof x>"u"&&v==="pending"){let A;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))A=i.data;else if(A=typeof n.placeholderData=="function"?n.placeholderData((P=re(this,Oc))==null?void 0:P.state.data,re(this,Oc)):n.placeholderData,n.select&&typeof A<"u")try{A=n.select(A),Ve(this,fi,null)}catch(M){Ve(this,fi,M)}typeof A<"u"&&(v="success",x=sy(i==null?void 0:i.data,A,n),b=!0)}re(this,fi)&&(f=re(this,fi),x=re(this,Rc),p=Date.now(),v="error");const w=g==="fetching",_=v==="pending",S=v==="error",R=_&&w;return{status:v,fetchStatus:g,isPending:_,isSuccess:v==="success",isError:S,isInitialLoading:R,isLoading:R,data:x,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:w,isRefetching:w&&!_,isLoadingError:S&&u.dataUpdatedAt===0,isPaused:g==="paused",isPlaceholderData:b,isRefetchError:S&&u.dataUpdatedAt!==0,isStale:Gx(t,n),refetch:this.refetch}}updateResult(t){const n=re(this,vr),r=this.createResult(re(this,fn),this.options);if(Ve(this,Xa,re(this,fn).state),Ve(this,Ec,this.options),re(this,Xa).data!==void 0&&Ve(this,Oc,re(this,fn)),oy(r,n))return;Ve(this,vr,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!re(this,Pc).size)return!0;const l=new Set(a??re(this,Pc));return this.options.throwOnError&&l.add("error"),Object.keys(re(this,vr)).some(c=>{const u=c;return re(this,vr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),Ct(this,Lg,mT).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ct(this,df,uy).call(this)}},Dr=new WeakMap,fn=new WeakMap,sf=new WeakMap,vr=new WeakMap,Xa=new WeakMap,Ec=new WeakMap,fi=new WeakMap,af=new WeakMap,Rc=new WeakMap,Oc=new WeakMap,Qa=new WeakMap,Ja=new WeakMap,qs=new WeakMap,Pc=new WeakMap,Za=new WeakSet,Hu=function(t){Ct(this,pf,hy).call(this);let n=re(this,fn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Oo)),n},lf=new WeakSet,ay=function(){if(Ct(this,ff,dy).call(this),kc||re(this,vr).isStale||!ry(this.options.staleTime))return;const n=uT(re(this,vr).dataUpdatedAt,this.options.staleTime)+1;Ve(this,Qa,setTimeout(()=>{re(this,vr).isStale||this.updateResult()},n))},cf=new WeakSet,ly=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(re(this,fn)):this.options.refetchInterval)??!1},uf=new WeakSet,cy=function(t){Ct(this,hf,fy).call(this),Ve(this,qs,t),!(kc||this.options.enabled===!1||!ry(re(this,qs))||re(this,qs)===0)&&Ve(this,Ja,setInterval(()=>{(this.options.refetchIntervalInBackground||tg.isFocused())&&Ct(this,Za,Hu).call(this)},re(this,qs)))},df=new WeakSet,uy=function(){Ct(this,lf,ay).call(this),Ct(this,uf,cy).call(this,Ct(this,cf,ly).call(this))},ff=new WeakSet,dy=function(){re(this,Qa)&&(clearTimeout(re(this,Qa)),Ve(this,Qa,void 0))},hf=new WeakSet,fy=function(){re(this,Ja)&&(clearInterval(re(this,Ja)),Ve(this,Ja,void 0))},pf=new WeakSet,hy=function(){const t=re(this,Dr).getQueryCache().build(re(this,Dr),this.options);if(t===re(this,fn))return;const n=re(this,fn);Ve(this,fn,t),Ve(this,sf,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Lg=new WeakSet,mT=function(t){Jn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(re(this,vr))}),re(this,Dr).getQueryCache().notify({query:re(this,fn),type:"observerResultsUpdated"})})},j2);function ez(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function vE(e,t){return ez(e,t)||e.state.dataUpdatedAt>0&&py(e,t,t.refetchOnMount)}function py(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Gx(e,t)}return!1}function bE(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Gx(e,n)}function Gx(e,t){return e.isStaleByTime(t.staleTime)}function tz(e,t){return!oy(e.getCurrentResult(),t)}var vT=ge.createContext(void 0),bT=e=>{const t=ge.useContext(vT);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},nz=({client:e,children:t})=>(ge.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),ge.createElement(vT.Provider,{value:e},t)),yT=ge.createContext(!1),rz=()=>ge.useContext(yT);yT.Provider;function oz(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var iz=ge.createContext(oz()),sz=()=>ge.useContext(iz);function az(e,t){return typeof e=="function"?e(...t):!!e}var lz=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},cz=e=>{ge.useEffect(()=>{e.clearReset()},[e])},uz=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&az(n,[e.error,r]),dz=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},fz=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,hz=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function pz(e,t,n){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=bT(n),o=rz(),i=sz(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",dz(s),lz(s,i),cz(i);const[a]=ge.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(ge.useSyncExternalStore(ge.useCallback(c=>{const u=o?()=>{}:a.subscribe(Jn.batchCalls(c));return a.updateResult(),u},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),ge.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),fz(s,l))throw hz(s,a,i);if(uz({result:l,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function bf(e,t){return pz(e,Z8,t)}const gz={theme:"system",setTheme:()=>null},xT=m.createContext(gz);function mz({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=m.useState(()=>localStorage.getItem(n)||t);m.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),o==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(o)},[o]);const s={theme:o,setTheme:a=>{localStorage.setItem(n,a),i(a)}};return O.jsx(xT.Provider,{...r,value:s,children:e})}const wT=()=>{const e=m.useContext(xT);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function vz(e){return await(await fetch("https://semaphor.cloud/api/v1/dashboard",{headers:{Authorization:`Bearer ${e}`}})).json()}function _T(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function yE(e,t){const n=_T(e);return n==="dark"?os.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function bz({authToken:e,customStyle:t,currentTheme:n,onSave:r,onEvent:o}){const{data:i,refetch:s,isLoading:a,isError:l}=bf({queryKey:["dashboard",e==null?void 0:e.accessToken],queryFn:()=>vz(e==null?void 0:e.accessToken),enabled:!1}),{theme:c,setTheme:u}=wT(),f=Ie(A=>A.dashboard.globalStyle),{setDashboard:p,setSelectedSheetId:g,setStyle:v,setOnSaveFunction:b}=Ie(A=>A.actions);Ie(A=>A.actions.setCustomCards);const x=Ie(A=>A.actions.setFilterValues),w=Ie(A=>A.actions.setBookmarkKey),_=Ie(A=>A.actions.setAuthToken),S=Ie(A=>A.actions.setThemeStyle),R=Ie(A=>A.actions.setDashboardTheme),C=Ie(A=>A.actions.setOnEvent);m.useEffect(()=>{if(c){const A=_T(c);R(A)}},[c,R]),m.useEffect(()=>{n&&u(n)},[n,u]);function P(){const A=os.cloneDeep(ty),M=os.merge(A,f);if(t){const T=os.merge(M,t),I=yE(c,T);S(I),v(T)}else{const T=yE(c,M);S(T),v(ty)}}return m.useEffect(()=>{i&&i.dashboard&&P()},[c,t,f]),m.useEffect(()=>{var F;if(!i||!i.dashboard)return;const A=i.dashboard,M=u5(A.id),T=JSON.parse(localStorage.getItem(M)||"[]"),I=T.find(j=>j.default===!0);if(I)p(I.template),P(),w(I.name),I.filterValues&&x(I.filterValues);else{p(A),P();const j=T.find(X=>(X==null?void 0:X.name)==="Original");j?j.template=A:T.push({name:"Original",template:A,default:!1}),localStorage.setItem(M,JSON.stringify(T))}g((F=A.sheets)==null?void 0:F[0].id)},[i,p,g,x,w]),m.useEffect(()=>{r&&b(r),o&&C(o)},[r,b,o,C]),m.useEffect(()=>{e&&e.accessToken&&(_(e),s())},[e,s,_]),{isLoading:a,isError:l}}function Wg({className:e,...t}){return O.jsx("div",{className:Pe("animate-pulse rounded-md bg-muted",e),...t})}const Yx=ge.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Pe("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Yx.displayName="Card";const Ug=ge.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Pe("flex flex-col space-y-1.5 p-6",e),...t}));Ug.displayName="CardHeader";const yf=ge.forwardRef(({className:e,...t},n)=>O.jsx("h3",{ref:n,className:Pe("text-2xl font-semibold leading-none tracking-tight",e),...t}));yf.displayName="CardTitle";const Kx=ge.forwardRef(({className:e,...t},n)=>O.jsx("p",{ref:n,className:Pe("text-sm text-muted-foreground",e),...t}));Kx.displayName="CardDescription";const qg=ge.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Pe("px-6 pt-0",e),...t}));qg.displayName="CardContent";const Xx=ge.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Pe("flex items-center p-6 pt-0",e),...t}));Xx.displayName="CardFooter";function ST({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:f,...p}){Ie(w=>w.selectedSheetId);const g=Ie(w=>w.themeStyle),v=Ie(w=>w.isSessionExpired),{isLoading:b,isError:x}=bz({authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r});return b||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?O.jsx(o,{message:"loading"}):O.jsx("div",{className:"flex items-center gap-3",children:O.jsx(Wg,{className:"h-1 w-full dark:h-[2px]"})})):x?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),O.jsx(i,{})):O.jsx("div",{children:"Error"})):v?(r==null||r({type:"error",message:"Session Expired"}),O.jsx("div",{className:"flex h-full items-center justify-center",children:O.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[O.jsx(yf,{children:"Session Expired"}),O.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):O.jsx("div",{className:Pe("flex h-full grow flex-col justify-between",g==null?void 0:g.dashboardPanel,e),role:"dashboard-panel",...p})}function fe(){return fe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fe.apply(this,arguments)}function De(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Gn(e,t=[]){let n=[];function r(i,s){const a=m.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:p,children:g,...v}=f,b=(p==null?void 0:p[e][l])||a,x=m.useMemo(()=>v,Object.values(v));return m.createElement(b.Provider,{value:x},g)}function u(f,p){const g=(p==null?void 0:p[e][l])||a,v=m.useContext(g);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>m.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,yz(o,...t)]}function yz(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(i)[`__scope${c}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function xz(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Gg(...e){return t=>e.forEach(n=>xz(n,t))}function ft(...e){return m.useCallback(Gg(...e),e)}const ss=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(wz);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(gy,fe({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(gy,fe({},r,{ref:t}),n)});ss.displayName="Slot";const gy=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{..._z(r,n.props),ref:t?Gg(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});gy.displayName="SlotClone";const CT=({children:e})=>m.createElement(m.Fragment,null,e);function wz(e){return m.isValidElement(e)&&e.type===CT}function _z(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Yg(e){const t=e+"CollectionProvider",[n,r]=Gn(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=g=>{const{scope:v,children:b}=g,x=m.useRef(null),w=m.useRef(new Map).current;return m.createElement(o,{scope:v,itemMap:w,collectionRef:x},b)},a=e+"CollectionSlot",l=m.forwardRef((g,v)=>{const{scope:b,children:x}=g,w=i(a,b),_=ft(v,w.collectionRef);return m.createElement(ss,{ref:_},x)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",f=m.forwardRef((g,v)=>{const{scope:b,children:x,...w}=g,_=m.useRef(null),S=ft(v,_),R=i(c,b);return m.useEffect(()=>(R.itemMap.set(_,{ref:_,...w}),()=>void R.itemMap.delete(_))),m.createElement(ss,{[u]:"",ref:S},x)});function p(g){const v=i(e+"CollectionConsumer",g);return m.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${u}]`));return Array.from(v.itemMap.values()).sort((R,C)=>w.indexOf(R.ref.current)-w.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},p,r]}const cr=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},Sz=ge.useId||(()=>{});let Cz=0;function Nr(e){const[t,n]=ge.useState(Sz());return cr(()=>{e||n(r=>r??String(Cz++))},[e]),e||(t?`radix-${t}`:"")}const Ez=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Qe=Ez.reduce((e,t)=>{const n=m.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?ss:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,fe({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ET(e,t){e&&Qo.flushSync(()=>e.dispatchEvent(t))}function Fn(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function ur({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Rz({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Fn(n),l=m.useCallback(c=>{if(i){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else o(c)},[i,e,o,a]);return[s,l]}function Rz({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,o=m.useRef(r),i=Fn(t);return m.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const Oz=m.createContext(void 0);function ml(e){const t=m.useContext(Oz);return e||t||"ltr"}const mb="rovingFocusGroup.onEntryFocus",Pz={bubbles:!1,cancelable:!0},Qx="RovingFocusGroup",[my,RT,Tz]=Yg(Qx),[Dz,Gc]=Gn(Qx,[Tz]),[$z,kz]=Dz(Qx),Mz=m.forwardRef((e,t)=>m.createElement(my.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(my.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(Az,fe({},e,{ref:t}))))),Az=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=e,f=m.useRef(null),p=ft(t,f),g=ml(i),[v=null,b]=ur({prop:s,defaultProp:a,onChange:l}),[x,w]=m.useState(!1),_=Fn(c),S=RT(n),R=m.useRef(!1),[C,P]=m.useState(0);return m.useEffect(()=>{const A=f.current;if(A)return A.addEventListener(mb,_),()=>A.removeEventListener(mb,_)},[_]),m.createElement($z,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:v,onItemFocus:m.useCallback(A=>b(A),[b]),onItemShiftTab:m.useCallback(()=>w(!0),[]),onFocusableItemAdd:m.useCallback(()=>P(A=>A+1),[]),onFocusableItemRemove:m.useCallback(()=>P(A=>A-1),[])},m.createElement(Qe.div,fe({tabIndex:x||C===0?-1:0,"data-orientation":r},u,{ref:p,style:{outline:"none",...e.style},onMouseDown:De(e.onMouseDown,()=>{R.current=!0}),onFocus:De(e.onFocus,A=>{const M=!R.current;if(A.target===A.currentTarget&&M&&!x){const T=new CustomEvent(mb,Pz);if(A.currentTarget.dispatchEvent(T),!T.defaultPrevented){const I=S().filter(B=>B.focusable),F=I.find(B=>B.active),j=I.find(B=>B.id===v),G=[F,j,...I].filter(Boolean).map(B=>B.ref.current);OT(G)}}R.current=!1}),onBlur:De(e.onBlur,()=>w(!1))})))}),Iz="RovingFocusGroupItem",Nz=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Nr(),l=i||a,c=kz(Iz,n),u=c.currentTabStopId===l,f=RT(n),{onFocusableItemAdd:p,onFocusableItemRemove:g}=c;return m.useEffect(()=>{if(r)return p(),()=>g()},[r,p,g]),m.createElement(my.ItemSlot,{scope:n,id:l,focusable:r,active:o},m.createElement(Qe.span,fe({tabIndex:u?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:De(e.onMouseDown,v=>{r?c.onItemFocus(l):v.preventDefault()}),onFocus:De(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:De(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const b=zz(v,c.orientation,c.dir);if(b!==void 0){v.preventDefault();let w=f().filter(_=>_.focusable).map(_=>_.ref.current);if(b==="last")w.reverse();else if(b==="prev"||b==="next"){b==="prev"&&w.reverse();const _=w.indexOf(v.currentTarget);w=c.loop?jz(w,_+1):w.slice(_+1)}setTimeout(()=>OT(w))}})})))}),Lz={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Fz(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function zz(e,t,n){const r=Fz(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Lz[r]}function OT(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function jz(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const Jx=Mz,Zx=Nz;function Bz(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Mn=e=>{const{present:t,children:n}=e,r=Vz(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=ft(r.ref,o.ref);return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:i}):null};Mn.displayName="Presence";function Vz(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),i=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Bz(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=Mh(r.current);i.current=a==="mounted"?c:"none"},[a]),cr(()=>{const c=r.current,u=o.current;if(u!==e){const p=i.current,g=Mh(c);e?l("MOUNT"):g==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&p!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),cr(()=>{if(t){const c=f=>{const g=Mh(r.current).includes(f.animationName);f.target===t&&g&&Qo.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(i.current=Mh(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Mh(e){return(e==null?void 0:e.animationName)||"none"}const PT="Tabs",[Hz,Hge]=Gn(PT,[Gc]),TT=Gc(),[Wz,ew]=Hz(PT),Uz=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=ml(a),[f,p]=ur({prop:r,onChange:o,defaultProp:i});return m.createElement(Wz,{scope:n,baseId:Nr(),value:f,onValueChange:p,orientation:s,dir:u,activationMode:l},m.createElement(Qe.div,fe({dir:u,"data-orientation":s},c,{ref:t})))}),qz="TabsList",Gz=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=ew(qz,n),s=TT(n);return m.createElement(Jx,fe({asChild:!0},s,{orientation:i.orientation,dir:i.dir,loop:r}),m.createElement(Qe.div,fe({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),Yz="TabsTrigger",Kz=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=ew(Yz,n),a=TT(n),l=DT(s.baseId,r),c=$T(s.baseId,r),u=r===s.value;return m.createElement(Zx,fe({asChild:!0},a,{focusable:!o,active:u}),m.createElement(Qe.button,fe({type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l},i,{ref:t,onMouseDown:De(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:De(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:De(e.onFocus,()=>{const f=s.activationMode!=="manual";!u&&!o&&f&&s.onValueChange(r)})})))}),Xz="TabsContent",Qz=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=ew(Xz,n),l=DT(a.baseId,r),c=$T(a.baseId,r),u=r===a.value,f=m.useRef(u);return m.useEffect(()=>{const p=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(p)},[]),m.createElement(Mn,{present:o||u},({present:p})=>m.createElement(Qe.div,fe({"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:c,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0}}),p&&i))});function DT(e,t){return`${e}-trigger-${t}`}function $T(e,t){return`${e}-content-${t}`}const Jz=Uz,kT=Gz,MT=Kz,AT=Qz,IT=Jz,NT=ge.forwardRef(({className:e,...t},n)=>O.jsx(kT,{ref:n,className:Pe("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));NT.displayName=kT.displayName;const LT=ge.forwardRef(({className:e,...t},n)=>O.jsx(MT,{ref:n,className:Pe("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));LT.displayName=MT.displayName;const tw=ge.forwardRef(({className:e,...t},n)=>O.jsx(AT,{ref:n,className:Pe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));tw.displayName=AT.displayName;var FT={exports:{}},xf={},vy={exports:{}};(function(e,t){(function(n,r){r(t)})(zs,function(n){function r(ie){return function(ae,ye,q,be,_e,Oe,Te){return ie(ae,ye,Te)}}function o(ie){return function(ae,ye,q,be){if(!ae||!ye||typeof ae!="object"||typeof ye!="object")return ie(ae,ye,q,be);var _e=be.get(ae),Oe=be.get(ye);if(_e&&Oe)return _e===ye&&Oe===ae;be.set(ae,ye),be.set(ye,ae);var Te=ie(ae,ye,q,be);return be.delete(ae),be.delete(ye),Te}}function i(ie,ee){var ae={};for(var ye in ie)ae[ye]=ie[ye];for(var ye in ee)ae[ye]=ee[ye];return ae}function s(ie){return ie.constructor===Object||ie.constructor==null}function a(ie){return typeof ie.then=="function"}function l(ie,ee){return ie===ee||ie!==ie&&ee!==ee}var c="[object Arguments]",u="[object Boolean]",f="[object Date]",p="[object RegExp]",g="[object Map]",v="[object Number]",b="[object Object]",x="[object Set]",w="[object String]",_=Object.prototype.toString;function S(ie){var ee=ie.areArraysEqual,ae=ie.areDatesEqual,ye=ie.areMapsEqual,q=ie.areObjectsEqual,be=ie.areRegExpsEqual,_e=ie.areSetsEqual,Oe=ie.createIsNestedEqual,Te=Oe(Ue);function Ue(Be,Ae,Ke){if(Be===Ae)return!0;if(!Be||!Ae||typeof Be!="object"||typeof Ae!="object")return Be!==Be&&Ae!==Ae;if(s(Be)&&s(Ae))return q(Be,Ae,Te,Ke);var lt=Array.isArray(Be),It=Array.isArray(Ae);if(lt||It)return lt===It&&ee(Be,Ae,Te,Ke);var $t=_.call(Be);return $t!==_.call(Ae)?!1:$t===f?ae(Be,Ae,Te,Ke):$t===p?be(Be,Ae,Te,Ke):$t===g?ye(Be,Ae,Te,Ke):$t===x?_e(Be,Ae,Te,Ke):$t===b||$t===c?a(Be)||a(Ae)?!1:q(Be,Ae,Te,Ke):$t===u||$t===v||$t===w?l(Be.valueOf(),Ae.valueOf()):!1}return Ue}function R(ie,ee,ae,ye){var q=ie.length;if(ee.length!==q)return!1;for(;q-- >0;)if(!ae(ie[q],ee[q],q,q,ie,ee,ye))return!1;return!0}var C=o(R);function P(ie,ee){return l(ie.valueOf(),ee.valueOf())}function A(ie,ee,ae,ye){var q=ie.size===ee.size;if(!q)return!1;if(!ie.size)return!0;var be={},_e=0;return ie.forEach(function(Oe,Te){if(q){var Ue=!1,Be=0;ee.forEach(function(Ae,Ke){!Ue&&!be[Be]&&(Ue=ae(Te,Ke,_e,Be,ie,ee,ye)&&ae(Oe,Ae,Te,Ke,ie,ee,ye))&&(be[Be]=!0),Be++}),_e++,q=Ue}}),q}var M=o(A),T="_owner",I=Object.prototype.hasOwnProperty;function F(ie,ee,ae,ye){var q=Object.keys(ie),be=q.length;if(Object.keys(ee).length!==be)return!1;for(var _e;be-- >0;){if(_e=q[be],_e===T){var Oe=!!ie.$$typeof,Te=!!ee.$$typeof;if((Oe||Te)&&Oe!==Te)return!1}if(!I.call(ee,_e)||!ae(ie[_e],ee[_e],_e,_e,ie,ee,ye))return!1}return!0}var j=o(F);function X(ie,ee){return ie.source===ee.source&&ie.flags===ee.flags}function G(ie,ee,ae,ye){var q=ie.size===ee.size;if(!q)return!1;if(!ie.size)return!0;var be={};return ie.forEach(function(_e,Oe){if(q){var Te=!1,Ue=0;ee.forEach(function(Be,Ae){!Te&&!be[Ue]&&(Te=ae(_e,Be,Oe,Ae,ie,ee,ye))&&(be[Ue]=!0),Ue++}),q=Te}}),q}var B=o(G),J=Object.freeze({areArraysEqual:R,areDatesEqual:P,areMapsEqual:A,areObjectsEqual:F,areRegExpsEqual:X,areSetsEqual:G,createIsNestedEqual:r}),H=Object.freeze({areArraysEqual:C,areDatesEqual:P,areMapsEqual:M,areObjectsEqual:j,areRegExpsEqual:X,areSetsEqual:B,createIsNestedEqual:r}),Y=S(J);function te(ie,ee){return Y(ie,ee,void 0)}var $=S(i(J,{createIsNestedEqual:function(){return l}}));function V(ie,ee){return $(ie,ee,void 0)}var Q=S(H);function N(ie,ee){return Q(ie,ee,new WeakMap)}var le=S(i(H,{createIsNestedEqual:function(){return l}}));function se(ie,ee){return le(ie,ee,new WeakMap)}function ue(ie){return S(i(J,ie(J)))}function he(ie){var ee=S(i(H,ie(H)));return function(ae,ye,q){return q===void 0&&(q=new WeakMap),ee(ae,ye,q)}}n.circularDeepEqual=N,n.circularShallowEqual=se,n.createCustomCircularEqual=he,n.createCustomEqual=ue,n.deepEqual=te,n.sameValueZeroEqual=l,n.shallowEqual=V,Object.defineProperty(n,"__esModule",{value:!0})})})(vy,vy.exports);var nw=vy.exports;const rw=Fx(x9);var Ot={},Zz=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.bottom=ow;Ot.childrenEqual=rj;Ot.cloneLayout=zT;Ot.cloneLayoutItem=el;Ot.collides=Kg;Ot.compact=BT;Ot.compactItem=VT;Ot.compactType=vj;Ot.correctBounds=HT;Ot.fastPositionEqual=ij;Ot.fastRGLPropsEqual=void 0;Ot.getAllCollisions=WT;Ot.getFirstCollision=Va;Ot.getLayoutItem=iw;Ot.getStatics=sw;Ot.modifyLayout=jT;Ot.moveElement=Uu;Ot.moveElementAwayFromCollision=yy;Ot.noop=void 0;Ot.perc=aj;Ot.resizeItemInDirection=hj;Ot.setTopLeft=gj;Ot.setTransform=pj;Ot.sortLayoutItems=fw;Ot.sortLayoutItemsByColRow=KT;Ot.sortLayoutItemsByRowCol=YT;Ot.synchronizeLayoutWithChildren=mj;Ot.validateLayout=XT;Ot.withLayoutItem=nj;var xE=nw,Wu=ej(m);function ej(e){return e&&e.__esModule?e:{default:e}}const tj=process.env.NODE_ENV==="production";function ow(e){let t=0,n;for(let r=0,o=e.length;r<o;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function zT(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=el(e[n]);return t}function jT(e,t){const n=Array(e.length);for(let r=0,o=e.length;r<o;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function nj(e,t,n){let r=iw(e,t);return r?(r=n(el(r)),e=jT(e,r),[e,r]):[e,null]}function el(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}function rj(e,t){return(0,xE.deepEqual)(Wu.default.Children.map(e,n=>n==null?void 0:n.key),Wu.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,xE.deepEqual)(Wu.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),Wu.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const oj=Zz;Ot.fastRGLPropsEqual=oj;function ij(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Kg(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function BT(e,t,n,r){const o=sw(e),i=fw(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=el(i[a]);c.static||(c=VT(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const sj={x:"w",y:"h"};function by(e,t,n,r){const o=sj[r];t[r]+=1;const i=e.map(s=>s.i).indexOf(t.i);for(let s=i+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;Kg(t,a)&&by(e,a,n+t[o],r)}}t[r]=n}function VT(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(ow(e),t.y);t.y>0&&!Va(e,t);)t.y--;else if(a)for(;t.x>0&&!Va(e,t);)t.x--;let l;for(;(l=Va(e,t))&&!(n===null&&i);)if(a?by(o,t,l.x+l.w,"x"):by(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Va(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function HT(e,t){const n=sw(e);for(let r=0,o=e.length;r<o;r++){const i=e[r];if(i.x+i.w>t.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;Va(n,i);)i.y++}return e}function iw(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Va(e,t){for(let n=0,r=e.length;n<r;n++)if(Kg(e[n],t))return e[n]}function WT(e,t){return e.filter(n=>Kg(n,t))}function sw(e){return e.filter(t=>t.static)}function Uu(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;"Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(t.y,"]");const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let f=fw(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(f=f.reverse());const g=WT(f,t),v=g.length>0;if(v&&l)return zT(e);if(v&&i)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=u,t.moved=!1,e;for(let b=0,x=g.length;b<x;b++){const w=g[b];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(w.i," at [").concat(w.x,",").concat(w.y,"]"),!w.moved&&(w.static?e=yy(e,w,t,o,s):e=yy(e,t,w,o,s))}return e}function yy(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const f={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},p=Va(e,f),g=p&&p.y+p.h>t.y,v=p&&t.x+t.w>p.x;if(p){if(g&&a)return Uu(e,n,void 0,t.y+1,r,l,o);if(g&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(v&&s)return Uu(e,t,n.x,void 0,r,l,o)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(f.x,",").concat(f.y,"]."),Uu(e,n,s?f.x:void 0,a?f.y:void 0,r,l,o)}const c=s?n.x+1:void 0,u=a?n.y+1:void 0;return c==null&&u==null?e:Uu(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function aj(e){return e*100+"%"}const UT=(e,t,n,r)=>e+n>r?t:n,qT=(e,t,n)=>e<0?t:n,GT=e=>Math.max(0,e),aw=e=>Math.max(0,e),lw=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:qT(s,e.height,o),top:aw(s)}},cw=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:UT(e.left,e.width,s,n),left:GT(o)}},uw=(e,t,n)=>{let{top:r,height:o,width:i}=t;const s=e.left-(i-e.width);return{height:o,width:s<0?e.width:UT(e.left,e.width,i,n),top:aw(r),left:GT(s)}},dw=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:qT(r,e.height,i),top:aw(r)}},lj=function(){return lw(arguments.length<=0?void 0:arguments[0],cw(...arguments))},cj=function(){return lw(arguments.length<=0?void 0:arguments[0],uw(...arguments))},uj=function(){return dw(arguments.length<=0?void 0:arguments[0],cw(...arguments))},dj=function(){return dw(arguments.length<=0?void 0:arguments[0],uw(...arguments))},fj={n:lw,ne:lj,e:cw,se:uj,s:dw,sw:dj,w:uw,nw:cj};function hj(e,t,n,r){const o=fj[e];return o?o(t,{...t,...n},r):n}function pj(e){let{top:t,left:n,width:r,height:o}=e;const i="translate(".concat(n,"px,").concat(t,"px)");return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function gj(e){let{top:t,left:n,width:r,height:o}=e;return{top:"".concat(t,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function fw(e,t){return t==="horizontal"?KT(e):t==="vertical"?YT(e):e}function YT(e){return e.slice(0).sort(function(t,n){return t.y>n.y||t.y===n.y&&t.x>n.x?1:t.y===n.y&&t.x===n.x?0:-1})}function KT(e){return e.slice(0).sort(function(t,n){return t.x>n.x||t.x===n.x&&t.y>n.y?1:-1})}function mj(e,t,n,r,o){e=e||[];const i=[];Wu.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=iw(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(el(l)):c?(tj||XT([c],"ReactGridLayout.children"),i.push(el({...c,i:a.key}))):i.push(el({w:1,h:1,x:0,y:ow(i),i:String(a.key)}))});const s=HT(i,{cols:n});return o?s:BT(s,r,n)}function XT(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,o=e.length;r<o;r++){const i=e[r];for(let s=0;s<n.length;s++)if(typeof i[n[s]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[s]+" must be a number!")}}function vj(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const bj=()=>{};Ot.noop=bj;var Ei={};Object.defineProperty(Ei,"__esModule",{value:!0});Ei.calcGridColWidth=Xg;Ei.calcGridItemPosition=yj;Ei.calcGridItemWHPx=xy;Ei.calcWH=wj;Ei.calcXY=xj;Ei.clamp=Ha;function Xg(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function xy(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function yj(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=Xg(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=xy(r,c,s[0]),u.height=xy(o,l,s[1])),i&&i.dragging?(u.top=Math.round(i.dragging.top),u.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(u.top=Math.round(i.resizing.top),u.left=Math.round(i.resizing.left)):(u.top=Math.round((l+s[1])*n+a[1]),u.left=Math.round((c+s[0])*t+a[0])),u}function xj(e,t,n,r,o){const{margin:i,cols:s,rowHeight:a,maxRows:l}=e,c=Xg(e);let u=Math.round((n-i[0])/(c+i[0])),f=Math.round((t-i[1])/(a+i[1]));return u=Ha(u,0,s-r),f=Ha(f,0,l-o),{x:u,y:f}}function wj(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=Xg(e);let f=Math.round((t+s[0])/(u+s[0])),p=Math.round((n+s[1])/(c+s[1])),g=Ha(f,0,l-r),v=Ha(p,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(g=Ha(f,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(v=Ha(p,0,a)),{w:g,h:v}}function Ha(e,t,n){return Math.max(Math.min(e,n),t)}var Qg={},wy={exports:{}},vb,wE;function hw(){if(wE)return vb;wE=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return vb=e,vb}var bb,_E;function _j(){if(_E)return bb;_E=1;var e=hw();function t(){}function n(){}return n.resetWarningCache=t,bb=function(){function r(s,a,l,c,u,f){if(f!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},bb}var Ah={exports:{}},qt={};/** @license React v16.13.1
|
|
89
89
|
* react-is.development.js
|
|
90
90
|
*
|
|
91
91
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -99,14 +99,14 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
99
99
|
*
|
|
100
100
|
* This source code is licensed under the MIT license found in the
|
|
101
101
|
* LICENSE file in the root directory of this source tree.
|
|
102
|
-
*/var CE;function Cj(){if(CE)return Gt;CE=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,_=e?Symbol.for("react.scope"):60119;function S(C){if(typeof C=="object"&&C!==null){var P=C.$$typeof;switch(P){case t:switch(C=C.type,C){case l:case c:case r:case i:case o:case f:return C;default:switch(C=C&&C.$$typeof,C){case a:case u:case v:case g:case s:return C;default:return P}}case n:return P}}}function R(C){return S(C)===c}return Gt.AsyncMode=l,Gt.ConcurrentMode=c,Gt.ContextConsumer=a,Gt.ContextProvider=s,Gt.Element=t,Gt.ForwardRef=u,Gt.Fragment=r,Gt.Lazy=v,Gt.Memo=g,Gt.Portal=n,Gt.Profiler=i,Gt.StrictMode=o,Gt.Suspense=f,Gt.isAsyncMode=function(C){return R(C)||S(C)===l},Gt.isConcurrentMode=R,Gt.isContextConsumer=function(C){return S(C)===a},Gt.isContextProvider=function(C){return S(C)===s},Gt.isElement=function(C){return typeof C=="object"&&C!==null&&C.$$typeof===t},Gt.isForwardRef=function(C){return S(C)===u},Gt.isFragment=function(C){return S(C)===r},Gt.isLazy=function(C){return S(C)===v},Gt.isMemo=function(C){return S(C)===g},Gt.isPortal=function(C){return S(C)===n},Gt.isProfiler=function(C){return S(C)===i},Gt.isStrictMode=function(C){return S(C)===o},Gt.isSuspense=function(C){return S(C)===f},Gt.isValidElementType=function(C){return typeof C=="string"||typeof C=="function"||C===r||C===c||C===i||C===o||C===f||C===p||typeof C=="object"&&C!==null&&(C.$$typeof===v||C.$$typeof===g||C.$$typeof===s||C.$$typeof===a||C.$$typeof===u||C.$$typeof===x||C.$$typeof===w||C.$$typeof===_||C.$$typeof===b)},Gt.typeOf=S,Gt}var EE;function
|
|
102
|
+
*/var CE;function Cj(){if(CE)return Gt;CE=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,_=e?Symbol.for("react.scope"):60119;function S(C){if(typeof C=="object"&&C!==null){var P=C.$$typeof;switch(P){case t:switch(C=C.type,C){case l:case c:case r:case i:case o:case f:return C;default:switch(C=C&&C.$$typeof,C){case a:case u:case v:case g:case s:return C;default:return P}}case n:return P}}}function R(C){return S(C)===c}return Gt.AsyncMode=l,Gt.ConcurrentMode=c,Gt.ContextConsumer=a,Gt.ContextProvider=s,Gt.Element=t,Gt.ForwardRef=u,Gt.Fragment=r,Gt.Lazy=v,Gt.Memo=g,Gt.Portal=n,Gt.Profiler=i,Gt.StrictMode=o,Gt.Suspense=f,Gt.isAsyncMode=function(C){return R(C)||S(C)===l},Gt.isConcurrentMode=R,Gt.isContextConsumer=function(C){return S(C)===a},Gt.isContextProvider=function(C){return S(C)===s},Gt.isElement=function(C){return typeof C=="object"&&C!==null&&C.$$typeof===t},Gt.isForwardRef=function(C){return S(C)===u},Gt.isFragment=function(C){return S(C)===r},Gt.isLazy=function(C){return S(C)===v},Gt.isMemo=function(C){return S(C)===g},Gt.isPortal=function(C){return S(C)===n},Gt.isProfiler=function(C){return S(C)===i},Gt.isStrictMode=function(C){return S(C)===o},Gt.isSuspense=function(C){return S(C)===f},Gt.isValidElementType=function(C){return typeof C=="string"||typeof C=="function"||C===r||C===c||C===i||C===o||C===f||C===p||typeof C=="object"&&C!==null&&(C.$$typeof===v||C.$$typeof===g||C.$$typeof===s||C.$$typeof===a||C.$$typeof===u||C.$$typeof===x||C.$$typeof===w||C.$$typeof===_||C.$$typeof===b)},Gt.typeOf=S,Gt}var EE;function QT(){return EE||(EE=1,process.env.NODE_ENV==="production"?Ah.exports=Cj():Ah.exports=Sj()),Ah.exports}/*
|
|
103
103
|
object-assign
|
|
104
104
|
(c) Sindre Sorhus
|
|
105
105
|
@license MIT
|
|
106
|
-
*/var yb,RE;function Ej(){if(RE)return yb;RE=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return yb=o()?Object.assign:function(i,s){for(var a,l=r(i),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var f in a)t.call(a,f)&&(l[f]=a[f]);if(e){c=e(a);for(var p=0;p<c.length;p++)n.call(a,c[p])&&(l[c[p]]=a[c[p]])}}return l},yb}var xb,OE;function
|
|
107
|
-
Valid keys: `+JSON.stringify(Object.keys($),null," "));var q=ye(he,ae,le,se,ue+"."+ae,n);if(q)return q}return null}return x(V)}function G($){switch(typeof $){case"number":case"string":case"undefined":return!0;case"boolean":return!$;case"object":if(Array.isArray($))return $.every(G);if($===null||a($))return!0;var V=f($);if(V){var Q=V.call($),N;if(V!==$.entries){for(;!(N=Q.next()).done;)if(!G(N.value))return!1}else for(;!(N=Q.next()).done;){var le=N.value;if(le&&!G(le[1]))return!1}}else return!1;return!0;default:return!1}}function B($,V){return $==="symbol"?!0:V?V["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&V instanceof Symbol:!1}function J($){var V=typeof $;return Array.isArray($)?"array":$ instanceof RegExp?"object":B(V,$)?"symbol":V}function H($){if(typeof $>"u"||$===null)return""+$;var V=J($);if(V==="object"){if($ instanceof Date)return"date";if($ instanceof RegExp)return"regexp"}return V}function Y($){var V=H($);switch(V){case"array":case"object":return"an "+V;case"boolean":case"date":case"regexp":return"a "+V;default:return V}}function te($){return!$.constructor||!$.constructor.name?p:$.constructor.name}return g.checkPropTypes=o,g.resetWarningCache=o.resetWarningCache,g.PropTypes=g,g},_b}if(process.env.NODE_ENV!=="production"){var Pj=
|
|
106
|
+
*/var yb,RE;function Ej(){if(RE)return yb;RE=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return yb=o()?Object.assign:function(i,s){for(var a,l=r(i),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var f in a)t.call(a,f)&&(l[f]=a[f]);if(e){c=e(a);for(var p=0;p<c.length;p++)n.call(a,c[p])&&(l[c[p]]=a[c[p]])}}return l},yb}var xb,OE;function JT(){return OE||(OE=1,xb=Function.call.bind(Object.prototype.hasOwnProperty)),xb}var wb,PE;function Rj(){if(PE)return wb;PE=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=hw(),n={},r=JT();e=function(i){var s="Warning: "+i;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function o(i,s,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in i)if(r(i,u)){var f;try{if(typeof i[u]!="function"){var p=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}f=i[u](s,u,l,a,null,t)}catch(v){f=v}if(f&&!(f instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var g=c?c():"";e("Failed "+a+" type: "+f.message+(g??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},wb=o,wb}var _b,TE;function Oj(){if(TE)return _b;TE=1;var e=QT(),t=Ej(),n=hw(),r=JT(),o=Rj(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return _b=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f($){var V=$&&(c&&$[c]||$[u]);if(typeof V=="function")return V}var p="<<anonymous>>",g={array:w("array"),bigint:w("bigint"),bool:w("boolean"),func:w("function"),number:w("number"),object:w("object"),string:w("string"),symbol:w("symbol"),any:_(),arrayOf:S,element:R(),elementType:C(),instanceOf:P,node:I(),objectOf:M,oneOf:A,oneOfType:T,shape:j,exact:X};function v($,V){return $===V?$!==0||1/$===1/V:$!==$&&V!==V}function b($,V){this.message=$,this.data=V&&typeof V=="object"?V:{},this.stack=""}b.prototype=Error.prototype;function x($){if(process.env.NODE_ENV!=="production")var V={},Q=0;function N(se,ue,he,ie,ee,ae,ye){if(ie=ie||p,ae=ae||he,ye!==n){if(l){var q=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw q.name="Invariant Violation",q}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var be=ie+":"+he;!V[be]&&Q<3&&(i("You are manually calling a React.PropTypes validation function for the `"+ae+"` prop on `"+ie+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),V[be]=!0,Q++)}}return ue[he]==null?se?ue[he]===null?new b("The "+ee+" `"+ae+"` is marked as required "+("in `"+ie+"`, but its value is `null`.")):new b("The "+ee+" `"+ae+"` is marked as required in "+("`"+ie+"`, but its value is `undefined`.")):null:$(ue,he,ie,ee,ae)}var le=N.bind(null,!1);return le.isRequired=N.bind(null,!0),le}function w($){function V(Q,N,le,se,ue,he){var ie=Q[N],ee=J(ie);if(ee!==$){var ae=H(ie);return new b("Invalid "+se+" `"+ue+"` of type "+("`"+ae+"` supplied to `"+le+"`, expected ")+("`"+$+"`."),{expectedType:$})}return null}return x(V)}function _(){return x(s)}function S($){function V(Q,N,le,se,ue){if(typeof $!="function")return new b("Property `"+ue+"` of component `"+le+"` has invalid PropType notation inside arrayOf.");var he=Q[N];if(!Array.isArray(he)){var ie=J(he);return new b("Invalid "+se+" `"+ue+"` of type "+("`"+ie+"` supplied to `"+le+"`, expected an array."))}for(var ee=0;ee<he.length;ee++){var ae=$(he,ee,le,se,ue+"["+ee+"]",n);if(ae instanceof Error)return ae}return null}return x(V)}function R(){function $(V,Q,N,le,se){var ue=V[Q];if(!a(ue)){var he=J(ue);return new b("Invalid "+le+" `"+se+"` of type "+("`"+he+"` supplied to `"+N+"`, expected a single ReactElement."))}return null}return x($)}function C(){function $(V,Q,N,le,se){var ue=V[Q];if(!e.isValidElementType(ue)){var he=J(ue);return new b("Invalid "+le+" `"+se+"` of type "+("`"+he+"` supplied to `"+N+"`, expected a single ReactElement type."))}return null}return x($)}function P($){function V(Q,N,le,se,ue){if(!(Q[N]instanceof $)){var he=$.name||p,ie=te(Q[N]);return new b("Invalid "+se+" `"+ue+"` of type "+("`"+ie+"` supplied to `"+le+"`, expected ")+("instance of `"+he+"`."))}return null}return x(V)}function A($){if(!Array.isArray($))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),s;function V(Q,N,le,se,ue){for(var he=Q[N],ie=0;ie<$.length;ie++)if(v(he,$[ie]))return null;var ee=JSON.stringify($,function(ye,q){var be=H(q);return be==="symbol"?String(q):q});return new b("Invalid "+se+" `"+ue+"` of value `"+String(he)+"` "+("supplied to `"+le+"`, expected one of "+ee+"."))}return x(V)}function M($){function V(Q,N,le,se,ue){if(typeof $!="function")return new b("Property `"+ue+"` of component `"+le+"` has invalid PropType notation inside objectOf.");var he=Q[N],ie=J(he);if(ie!=="object")return new b("Invalid "+se+" `"+ue+"` of type "+("`"+ie+"` supplied to `"+le+"`, expected an object."));for(var ee in he)if(r(he,ee)){var ae=$(he,ee,le,se,ue+"."+ee,n);if(ae instanceof Error)return ae}return null}return x(V)}function T($){if(!Array.isArray($))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var V=0;V<$.length;V++){var Q=$[V];if(typeof Q!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Y(Q)+" at index "+V+"."),s}function N(le,se,ue,he,ie){for(var ee=[],ae=0;ae<$.length;ae++){var ye=$[ae],q=ye(le,se,ue,he,ie,n);if(q==null)return null;q.data&&r(q.data,"expectedType")&&ee.push(q.data.expectedType)}var be=ee.length>0?", expected one of type ["+ee.join(", ")+"]":"";return new b("Invalid "+he+" `"+ie+"` supplied to "+("`"+ue+"`"+be+"."))}return x(N)}function I(){function $(V,Q,N,le,se){return G(V[Q])?null:new b("Invalid "+le+" `"+se+"` supplied to "+("`"+N+"`, expected a ReactNode."))}return x($)}function F($,V,Q,N,le){return new b(($||"React class")+": "+V+" type `"+Q+"."+N+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+le+"`.")}function j($){function V(Q,N,le,se,ue){var he=Q[N],ie=J(he);if(ie!=="object")return new b("Invalid "+se+" `"+ue+"` of type `"+ie+"` "+("supplied to `"+le+"`, expected `object`."));for(var ee in $){var ae=$[ee];if(typeof ae!="function")return F(le,se,ue,ee,H(ae));var ye=ae(he,ee,le,se,ue+"."+ee,n);if(ye)return ye}return null}return x(V)}function X($){function V(Q,N,le,se,ue){var he=Q[N],ie=J(he);if(ie!=="object")return new b("Invalid "+se+" `"+ue+"` of type `"+ie+"` "+("supplied to `"+le+"`, expected `object`."));var ee=t({},Q[N],$);for(var ae in ee){var ye=$[ae];if(r($,ae)&&typeof ye!="function")return F(le,se,ue,ae,H(ye));if(!ye)return new b("Invalid "+se+" `"+ue+"` key `"+ae+"` supplied to `"+le+"`.\nBad object: "+JSON.stringify(Q[N],null," ")+`
|
|
107
|
+
Valid keys: `+JSON.stringify(Object.keys($),null," "));var q=ye(he,ae,le,se,ue+"."+ae,n);if(q)return q}return null}return x(V)}function G($){switch(typeof $){case"number":case"string":case"undefined":return!0;case"boolean":return!$;case"object":if(Array.isArray($))return $.every(G);if($===null||a($))return!0;var V=f($);if(V){var Q=V.call($),N;if(V!==$.entries){for(;!(N=Q.next()).done;)if(!G(N.value))return!1}else for(;!(N=Q.next()).done;){var le=N.value;if(le&&!G(le[1]))return!1}}else return!1;return!0;default:return!1}}function B($,V){return $==="symbol"?!0:V?V["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&V instanceof Symbol:!1}function J($){var V=typeof $;return Array.isArray($)?"array":$ instanceof RegExp?"object":B(V,$)?"symbol":V}function H($){if(typeof $>"u"||$===null)return""+$;var V=J($);if(V==="object"){if($ instanceof Date)return"date";if($ instanceof RegExp)return"regexp"}return V}function Y($){var V=H($);switch(V){case"array":case"object":return"an "+V;case"boolean":case"date":case"regexp":return"a "+V;default:return V}}function te($){return!$.constructor||!$.constructor.name?p:$.constructor.name}return g.checkPropTypes=o,g.resetWarningCache=o.resetWarningCache,g.PropTypes=g,g},_b}if(process.env.NODE_ENV!=="production"){var Pj=QT(),Tj=!0;wy.exports=Oj()(Pj.isElement,Tj)}else wy.exports=_j()();var ua=wy.exports,Jg={exports:{}},ZT={};function eD(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=eD(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function DE(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=eD(e))&&(r&&(r+=" "),r+=t);return r}const Dj=Object.freeze(Object.defineProperty({__proto__:null,clsx:DE,default:DE},Symbol.toStringTag,{value:"Module"})),$j=Fx(Dj);var En={},Ri={};Object.defineProperty(Ri,"__esModule",{value:!0});Ri.dontSetMe=Nj;Ri.findInArray=kj;Ri.int=Ij;Ri.isFunction=Mj;Ri.isNum=Aj;function kj(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function Mj(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function Aj(e){return typeof e=="number"&&!isNaN(e)}function Ij(e){return parseInt(e,10)}function Nj(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))}var vl={};Object.defineProperty(vl,"__esModule",{value:!0});vl.browserPrefixToKey=nD;vl.browserPrefixToStyle=Lj;vl.default=void 0;vl.getPrefix=tD;const Sb=["Moz","Webkit","O","ms"];function tD(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;r<Sb.length;r++)if(nD(t,Sb[r])in n)return Sb[r];return""}function nD(e,t){return t?"".concat(t).concat(Fj(e)):e}function Lj(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function Fj(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]==="-"?n=!0:t+=e[r];return t}vl.default=tD();Object.defineProperty(En,"__esModule",{value:!0});En.addClassName=iD;En.addEvent=Bj;En.addUserSelectStyles=Jj;En.createCSSTransform=Yj;En.createSVGTransform=Kj;En.getTouch=Xj;En.getTouchIdentifier=Qj;En.getTranslation=pw;En.innerHeight=Uj;En.innerWidth=qj;En.matchesSelector=oD;En.matchesSelectorAndParentsTo=jj;En.offsetXYFromParent=Gj;En.outerHeight=Hj;En.outerWidth=Wj;En.removeClassName=sD;En.removeEvent=Vj;En.removeUserSelectStyles=Zj;var io=Ri,$E=zj(vl);function rD(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(rD=function(r){return r?n:t})(e)}function zj(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=rD(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}let Ih="";function oD(e,t){return Ih||(Ih=(0,io.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,io.isFunction)(e[n])})),(0,io.isFunction)(e[Ih])?e[Ih](t):!1}function jj(e,t,n){let r=e;do{if(oD(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function Bj(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function Vj(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function Hj(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,io.int)(n.borderTopWidth),t+=(0,io.int)(n.borderBottomWidth),t}function Wj(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,io.int)(n.borderLeftWidth),t+=(0,io.int)(n.borderRightWidth),t}function Uj(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,io.int)(n.paddingTop),t-=(0,io.int)(n.paddingBottom),t}function qj(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,io.int)(n.paddingLeft),t-=(0,io.int)(n.paddingRight),t}function Gj(e,t,n){const o=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-o.left)/n,s=(e.clientY+t.scrollTop-o.top)/n;return{x:i,y:s}}function Yj(e,t){const n=pw(e,t,"px");return{[(0,$E.browserPrefixToKey)("transform",$E.default)]:n}}function Kj(e,t){return pw(e,t,"")}function pw(e,t,n){let{x:r,y:o}=e,i="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(t){const s="".concat(typeof t.x=="string"?t.x:t.x+n),a="".concat(typeof t.y=="string"?t.y:t.y+n);i="translate(".concat(s,", ").concat(a,")")+i}return i}function Xj(e,t){return e.targetTouches&&(0,io.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,io.findInArray)(e.changedTouches,n=>t===n.identifier)}function Qj(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function Jj(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
108
108
|
`,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
109
|
-
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&iD(e.body,"react-draggable-transparent-selection")}function Zj(e){if(e)try{if(e.body&&sD(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function iD(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function sD(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Oi={};Object.defineProperty(Oi,"__esModule",{value:!0});Oi.canDragX=nB;Oi.canDragY=rB;Oi.createCoreData=iB;Oi.createDraggableData=sB;Oi.getBoundPosition=eB;Oi.getControlPosition=oB;Oi.snapToGrid=tB;var qr=Ri,oc=En;function eB(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:aB(r);const o=gw(e);if(typeof r=="string"){const{ownerDocument:i}=o,s=i.defaultView;let a;if(r==="parent"?a=o.parentNode:a=i.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=s.getComputedStyle(o),u=s.getComputedStyle(l);r={left:-o.offsetLeft+(0,qr.int)(u.paddingLeft)+(0,qr.int)(c.marginLeft),top:-o.offsetTop+(0,qr.int)(u.paddingTop)+(0,qr.int)(c.marginTop),right:(0,oc.innerWidth)(l)-(0,oc.outerWidth)(o)-o.offsetLeft+(0,qr.int)(u.paddingRight)-(0,qr.int)(c.marginRight),bottom:(0,oc.innerHeight)(l)-(0,oc.outerHeight)(o)-o.offsetTop+(0,qr.int)(u.paddingBottom)-(0,qr.int)(c.marginBottom)}}return(0,qr.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,qr.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,qr.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,qr.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function tB(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function nB(e){return e.props.axis==="both"||e.props.axis==="x"}function rB(e){return e.props.axis==="both"||e.props.axis==="y"}function oB(e,t,n){const r=typeof t=="number"?(0,oc.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=gw(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,oc.offsetXYFromParent)(r||e,i,n.props.scale)}function iB(e,t,n){const r=!(0,qr.isNum)(e.lastX),o=gw(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function sB(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function aB(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function gw(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Zg={},em={};Object.defineProperty(em,"__esModule",{value:!0});em.default=lB;function lB(){}Object.defineProperty(Zg,"__esModule",{value:!0});Zg.default=void 0;var Cb=uB(m),Er=mw(ua),cB=mw(Qo),or=En,Ts=Oi,Eb=Ri,Su=mw(em);function mw(e){return e&&e.__esModule?e:{default:e}}function aD(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(aD=function(r){return r?n:t})(e)}function uB(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=aD(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function mr(e,t,n){return t=dB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dB(e){var t=fB(e,"string");return typeof t=="symbol"?t:String(t)}function fB(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Vo={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Ds=Vo.mouse,tm=class extends Cb.Component{constructor(){super(...arguments),mr(this,"dragging",!1),mr(this,"lastX",NaN),mr(this,"lastY",NaN),mr(this,"touchIdentifier",null),mr(this,"mounted",!1),mr(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,or.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,or.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,or.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,Ts.getControlPosition)(t,o,this);if(i==null)return;const{x:s,y:a}=i,l=(0,Ts.createCoreData)(this,s,a);(0,Su.default)("DraggableCore: handleDragStart: %j",l),(0,Su.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,or.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,or.addEvent)(r,Ds.move,this.handleDrag),(0,or.addEvent)(r,Ds.stop,this.handleDragStop))}),mr(this,"handleDrag",t=>{const n=(0,Ts.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX,l=o-this.lastY;if([a,l]=(0,Ts.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,o=this.lastY+l}const i=(0,Ts.createCoreData)(this,r,o);if((0,Su.default)("DraggableCore: handleDrag: %j",i),this.props.onDrag(t,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=o}),mr(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,Ts.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=o-this.lastY||0;[l,c]=(0,Ts.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,o=this.lastY+c}const i=(0,Ts.createCoreData)(this,r,o);if(this.props.onStop(t,i)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,or.removeUserSelectStyles)(a.ownerDocument),(0,Su.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,Su.default)("DraggableCore: Removing handlers"),(0,or.removeEvent)(a.ownerDocument,Ds.move,this.handleDrag),(0,or.removeEvent)(a.ownerDocument,Ds.stop,this.handleDragStop))}),mr(this,"onMouseDown",t=>(Ds=Vo.mouse,this.handleDragStart(t))),mr(this,"onMouseUp",t=>(Ds=Vo.mouse,this.handleDragStop(t))),mr(this,"onTouchStart",t=>(Ds=Vo.touch,this.handleDragStart(t))),mr(this,"onTouchEnd",t=>(Ds=Vo.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,or.addEvent)(t,Vo.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,or.removeEvent)(n,Vo.mouse.move,this.handleDrag),(0,or.removeEvent)(n,Vo.touch.move,this.handleDrag),(0,or.removeEvent)(n,Vo.mouse.stop,this.handleDragStop),(0,or.removeEvent)(n,Vo.touch.stop,this.handleDragStop),(0,or.removeEvent)(t,Vo.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,or.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:cB.default.findDOMNode(this)}render(){return Cb.cloneElement(Cb.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Zg.default=tm;mr(tm,"displayName","DraggableCore");mr(tm,"propTypes",{allowAnyClick:Er.default.bool,children:Er.default.node.isRequired,disabled:Er.default.bool,enableUserSelectHack:Er.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:Er.default.arrayOf(Er.default.number),handle:Er.default.string,cancel:Er.default.string,nodeRef:Er.default.object,onStart:Er.default.func,onDrag:Er.default.func,onStop:Er.default.func,onMouseDown:Er.default.func,scale:Er.default.number,className:Eb.dontSetMe,style:Eb.dontSetMe,transform:Eb.dontSetMe});mr(tm,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=p(m),n=u(ua),r=u(Qo),o=u($j),i=En,s=Oi,a=Ri,l=u(Zg),c=u(em);function u(_){return _&&_.__esModule?_:{default:_}}function f(_){if(typeof WeakMap!="function")return null;var S=new WeakMap,R=new WeakMap;return(f=function(C){return C?R:S})(_)}function p(_,S){if(!S&&_&&_.__esModule)return _;if(_===null||typeof _!="object"&&typeof _!="function")return{default:_};var R=f(S);if(R&&R.has(_))return R.get(_);var C={},P=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var A in _)if(A!=="default"&&Object.prototype.hasOwnProperty.call(_,A)){var M=P?Object.getOwnPropertyDescriptor(_,A):null;M&&(M.get||M.set)?Object.defineProperty(C,A,M):C[A]=_[A]}return C.default=_,R&&R.set(_,C),C}function g(){return g=Object.assign?Object.assign.bind():function(_){for(var S=1;S<arguments.length;S++){var R=arguments[S];for(var C in R)Object.prototype.hasOwnProperty.call(R,C)&&(_[C]=R[C])}return _},g.apply(this,arguments)}function v(_,S,R){return S=b(S),S in _?Object.defineProperty(_,S,{value:R,enumerable:!0,configurable:!0,writable:!0}):_[S]=R,_}function b(_){var S=x(_,"string");return typeof S=="symbol"?S:String(S)}function x(_,S){if(typeof _!="object"||_===null)return _;var R=_[Symbol.toPrimitive];if(R!==void 0){var C=R.call(_,S||"default");if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(_)}class w extends t.Component{static getDerivedStateFromProps(S,R){let{position:C}=S,{prevPropsPosition:P}=R;return C&&(!P||C.x!==P.x||C.y!==P.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:C,prevPropsPosition:P}),{x:C.x,y:C.y,prevPropsPosition:{...C}}):null}constructor(S){super(S),v(this,"onDragStart",(R,C)=>{if((0,c.default)("Draggable: onDragStart: %j",C),this.props.onStart(R,(0,s.createDraggableData)(this,C))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),v(this,"onDrag",(R,C)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",C);const P=(0,s.createDraggableData)(this,C),A={x:P.x,y:P.y,slackX:0,slackY:0};if(this.props.bounds){const{x:T,y:I}=A;A.x+=this.state.slackX,A.y+=this.state.slackY;const[F,j]=(0,s.getBoundPosition)(this,A.x,A.y);A.x=F,A.y=j,A.slackX=this.state.slackX+(T-A.x),A.slackY=this.state.slackY+(I-A.y),P.x=A.x,P.y=A.y,P.deltaX=A.x-this.state.x,P.deltaY=A.y-this.state.y}if(this.props.onDrag(R,P)===!1)return!1;this.setState(A)}),v(this,"onDragStop",(R,C)=>{if(!this.state.dragging||this.props.onStop(R,(0,s.createDraggableData)(this,C))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",C);const A={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:T,y:I}=this.props.position;A.x=T,A.y=I}this.setState(A)}),this.state={dragging:!1,dragged:!1,x:S.position?S.position.x:S.defaultPosition.x,y:S.position?S.position.y:S.defaultPosition.y,prevPropsPosition:{...S.position},slackX:0,slackY:0,isElementSVG:!1},S.position&&!(S.onDrag||S.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var S,R;return(S=(R=this.props)===null||R===void 0||(R=R.nodeRef)===null||R===void 0?void 0:R.current)!==null&&S!==void 0?S:r.default.findDOMNode(this)}render(){const{axis:S,bounds:R,children:C,defaultPosition:P,defaultClassName:A,defaultClassNameDragging:M,defaultClassNameDragged:T,position:I,positionOffset:F,scale:j,...X}=this.props;let G={},B=null;const H=!!!I||this.state.dragging,Y=I||P,te={x:(0,s.canDragX)(this)&&H?this.state.x:Y.x,y:(0,s.canDragY)(this)&&H?this.state.y:Y.y};this.state.isElementSVG?B=(0,i.createSVGTransform)(te,F):G=(0,i.createCSSTransform)(te,F);const $=(0,o.default)(C.props.className||"",A,{[M]:this.state.dragging,[T]:this.state.dragged});return t.createElement(l.default,g({},X,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(C),{className:$,style:{...C.props.style,...G},transform:B}))}}e.default=w,v(w,"displayName","Draggable"),v(w,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),v(w,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(Z2);const{default:lD,DraggableCore:hB}=Z2;Jg.exports=lD;Jg.exports.default=lD;Jg.exports.DraggableCore=hB;var cD=Jg.exports,nm={exports:{}},wf={},vw={};vw.__esModule=!0;vw.cloneElement=yB;var pB=gB(m);function gB(e){return e&&e.__esModule?e:{default:e}}function kE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function ME(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kE(Object(n),!0).forEach(function(r){mB(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mB(e,t,n){return t=vB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vB(e){var t=bB(e,"string");return typeof t=="symbol"?t:String(t)}function bB(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yB(e,t){return t.style&&e.props.style&&(t.style=ME(ME({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),pB.default.cloneElement(e,t)}var _f={};_f.__esModule=!0;_f.resizableProps=void 0;var mt=xB(ua);function xB(e){return e&&e.__esModule?e:{default:e}}var wB={axis:mt.default.oneOf(["both","x","y","none"]),className:mt.default.string,children:mt.default.element.isRequired,draggableOpts:mt.default.shape({allowAnyClick:mt.default.bool,cancel:mt.default.string,children:mt.default.node,disabled:mt.default.bool,enableUserSelectHack:mt.default.bool,offsetParent:mt.default.node,grid:mt.default.arrayOf(mt.default.number),handle:mt.default.string,nodeRef:mt.default.object,onStart:mt.default.func,onDrag:mt.default.func,onStop:mt.default.func,onMouseDown:mt.default.func,scale:mt.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="y"){var i;return(i=mt.default.number).isRequired.apply(i,n)}return mt.default.number.apply(mt.default,n)},handle:mt.default.oneOfType([mt.default.node,mt.default.func]),handleSize:mt.default.arrayOf(mt.default.number),lockAspectRatio:mt.default.bool,maxConstraints:mt.default.arrayOf(mt.default.number),minConstraints:mt.default.arrayOf(mt.default.number),onResizeStop:mt.default.func,onResizeStart:mt.default.func,onResize:mt.default.func,resizeHandles:mt.default.arrayOf(mt.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:mt.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="x"){var i;return(i=mt.default.number).isRequired.apply(i,n)}return mt.default.number.apply(mt.default,n)}};_f.resizableProps=wB;wf.__esModule=!0;wf.default=void 0;var Cu=RB(m),_B=cD,SB=vw,CB=_f,EB=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function uD(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(uD=function(o){return o?n:t})(e)}function RB(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=uD(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function _y(){return _y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_y.apply(this,arguments)}function OB(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function AE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Rb(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AE(Object(n),!0).forEach(function(r){PB(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function PB(e,t,n){return t=TB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TB(e){var t=DB(e,"string");return typeof t=="symbol"?t:String(t)}function DB(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $B(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Sy(e,t)}function Sy(e,t){return Sy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Sy(e,t)}var bw=function(e){$B(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,i){var s=this.props,a=s.minConstraints,l=s.maxConstraints,c=s.lockAspectRatio;if(!a&&!l&&!c)return[o,i];if(c){var u=this.props.width/this.props.height,f=o-this.props.width,p=i-this.props.height;Math.abs(f)>Math.abs(p*u)?i=o/u:o=i*u}var g=o,v=i,b=this.slack||[0,0],x=b[0],w=b[1];return o+=x,i+=w,a&&(o=Math.max(a[0],o),i=Math.max(a[1],i)),l&&(o=Math.min(l[0],o),i=Math.min(l[1],i)),this.slack=[x+(g-o),w+(v-i)],[o,i]},n.resizeHandler=function(o,i){var s=this;return function(a,l){var c=l.node,u=l.deltaX,f=l.deltaY;o==="onResizeStart"&&s.resetData();var p=(s.props.axis==="both"||s.props.axis==="x")&&i!=="n"&&i!=="s",g=(s.props.axis==="both"||s.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!p&&!g)){var v=i[0],b=i[i.length-1],x=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(b==="w"){var w=x.left-s.lastHandleRect.left;u+=w}if(v==="n"){var _=x.top-s.lastHandleRect.top;f+=_}}s.lastHandleRect=x,b==="w"&&(u=-u),v==="n"&&(f=-f);var S=s.props.width+(p?u/s.props.transformScale:0),R=s.props.height+(g?f/s.props.transformScale:0),C=s.runConstraints(S,R);S=C[0],R=C[1];var P=S!==s.props.width||R!==s.props.height,A=typeof s.props[o]=="function"?s.props[o]:null,M=o==="onResize"&&!P;A&&!M&&(a.persist==null||a.persist(),A(a,{node:c,size:{width:S,height:R},handle:i})),o==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(o,i){var s=this.props.handle;if(!s)return Cu.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+o,ref:i});if(typeof s=="function")return s(o,i);var a=typeof s.type=="string",l=Rb({ref:i},a?{}:{handleAxis:o});return Cu.cloneElement(s,l)},n.render=function(){var o=this,i=this.props,s=i.children,a=i.className,l=i.draggableOpts;i.width,i.height,i.handle,i.handleSize,i.lockAspectRatio,i.axis,i.minConstraints,i.maxConstraints,i.onResize,i.onResizeStop,i.onResizeStart;var c=i.resizeHandles;i.transformScale;var u=OB(i,EB);return(0,SB.cloneElement)(s,Rb(Rb({},u),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(f){var p,g=(p=o.handleRefs[f])!=null?p:o.handleRefs[f]=Cu.createRef();return Cu.createElement(_B.DraggableCore,_y({},l,{nodeRef:g,key:"resizableHandle-"+f,onStop:o.resizeHandler("onResizeStop",f),onStart:o.resizeHandler("onResizeStart",f),onDrag:o.resizeHandler("onResize",f)}),o.renderResizeHandle(f,g))}))}))},t}(Cu.Component);wf.default=bw;bw.propTypes=CB.resizableProps;bw.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var rm={};rm.__esModule=!0;rm.default=void 0;var Ob=NB(m),kB=dD(ua),MB=dD(wf),AB=_f,IB=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function dD(e){return e&&e.__esModule?e:{default:e}}function fD(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(fD=function(o){return o?n:t})(e)}function NB(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=fD(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Cy(){return Cy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Cy.apply(this,arguments)}function IE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function rg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IE(Object(n),!0).forEach(function(r){LB(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LB(e,t,n){return t=FB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FB(e){var t=zB(e,"string");return typeof t=="symbol"?t:String(t)}function zB(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jB(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function BB(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ey(e,t)}function Ey(e,t){return Ey=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Ey(e,t)}var hD=function(e){BB(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(a,l){var c=l.size;r.props.onResize?(a.persist==null||a.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(a,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(o,i){return i.propsWidth!==o.width||i.propsHeight!==o.height?{width:o.width,height:o.height,propsWidth:o.width,propsHeight:o.height}:null};var n=t.prototype;return n.render=function(){var o=this.props,i=o.handle,s=o.handleSize;o.onResize;var a=o.onResizeStart,l=o.onResizeStop,c=o.draggableOpts,u=o.minConstraints,f=o.maxConstraints,p=o.lockAspectRatio,g=o.axis;o.width,o.height;var v=o.resizeHandles,b=o.style,x=o.transformScale,w=jB(o,IB);return Ob.createElement(MB.default,{axis:g,draggableOpts:c,handle:i,handleSize:s,height:this.state.height,lockAspectRatio:p,maxConstraints:f,minConstraints:u,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:v,transformScale:x,width:this.state.width},Ob.createElement("div",Cy({},w,{style:rg(rg({},b),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(Ob.Component);rm.default=hD;hD.propTypes=rg(rg({},AB.resizableProps),{},{children:kB.default.element});nm.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};nm.exports.Resizable=wf.default;nm.exports.ResizableBox=rm.default;var VB=nm.exports,is={};Object.defineProperty(is,"__esModule",{value:!0});is.resizeHandleType=is.resizeHandleAxesType=is.default=void 0;var _t=pD(ua),HB=pD(m);function pD(e){return e&&e.__esModule?e:{default:e}}const gD=_t.default.arrayOf(_t.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));is.resizeHandleAxesType=gD;const mD=_t.default.oneOfType([_t.default.node,_t.default.func]);is.resizeHandleType=mD;var WB={className:_t.default.string,style:_t.default.object,width:_t.default.number,autoSize:_t.default.bool,cols:_t.default.number,draggableCancel:_t.default.string,draggableHandle:_t.default.string,verticalCompact:function(e){e.verticalCompact===!1&&process.env.NODE_ENV!=="production"&&console.warn('`verticalCompact` on <ReactGridLayout> is deprecated and will be removed soon. Use `compactType`: "horizontal" | "vertical" | null.')},compactType:_t.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&Ot.validateLayout(t,"layout")},margin:_t.default.arrayOf(_t.default.number),containerPadding:_t.default.arrayOf(_t.default.number),rowHeight:_t.default.number,maxRows:_t.default.number,isBounded:_t.default.bool,isDraggable:_t.default.bool,isResizable:_t.default.bool,allowOverlap:_t.default.bool,preventCollision:_t.default.bool,useCSSTransforms:_t.default.bool,transformScale:_t.default.number,isDroppable:_t.default.bool,resizeHandles:gD,resizeHandle:mD,onLayoutChange:_t.default.func,onDragStart:_t.default.func,onDrag:_t.default.func,onDragStop:_t.default.func,onResizeStart:_t.default.func,onResize:_t.default.func,onResizeStop:_t.default.func,onDrop:_t.default.func,droppingItem:_t.default.shape({i:_t.default.string.isRequired,w:_t.default.number.isRequired,h:_t.default.number.isRequired}),children:function(e,t){const n=e[t],r={};HB.default.Children.forEach(n,function(o){if((o==null?void 0:o.key)!=null){if(r[o.key])throw new Error('Duplicate child key "'+o.key+'" found! This will cause problems in ReactGridLayout.');r[o.key]=!0}})},innerRef:_t.default.any};is.default=WB;Object.defineProperty(Qg,"__esModule",{value:!0});Qg.default=void 0;var Bl=yw(m),jt=yw(ua),UB=cD,qB=VB,Vl=Ot,Xn=Ei,NE=is,GB=yw(rw);function yw(e){return e&&e.__esModule?e:{default:e}}function si(e,t,n){return t=YB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YB(e){var t=KB(e,"string");return typeof t=="symbol"?t:String(t)}function KB(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class xw extends Bl.default.Component{constructor(){super(...arguments),si(this,"state",{resizing:null,dragging:null,className:""}),si(this,"elementRef",Bl.default.createRef()),si(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:o,transformScale:i}=this.props;if(!o)return;const s={top:0,left:0},{offsetParent:a}=r;if(!a)return;const l=a.getBoundingClientRect(),c=r.getBoundingClientRect(),u=c.left/i,f=l.left/i,p=c.top/i,g=l.top/i;s.left=u-f+a.scrollLeft,s.top=p-g+a.scrollTop,this.setState({dragging:s});const{x:v,y:b}=(0,Xn.calcXY)(this.getPositionParams(),s.top,s.left,this.props.w,this.props.h);return o.call(this,this.props.i,v,b,{e:t,node:r,newPosition:s})}),si(this,"onDrag",(t,n)=>{let{node:r,deltaX:o,deltaY:i}=n;const{onDrag:s}=this.props;if(!s)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let a=this.state.dragging.top+i,l=this.state.dragging.left+o;const{isBounded:c,i:u,w:f,h:p,containerWidth:g}=this.props,v=this.getPositionParams();if(c){const{offsetParent:_}=r;if(_){const{margin:S,rowHeight:R}=this.props,C=_.clientHeight-(0,Xn.calcGridItemWHPx)(p,R,S[1]);a=(0,Xn.clamp)(a,0,C);const P=(0,Xn.calcGridColWidth)(v),A=g-(0,Xn.calcGridItemWHPx)(f,P,S[0]);l=(0,Xn.clamp)(l,0,A)}}const b={top:a,left:l};this.setState({dragging:b});const{x,y:w}=(0,Xn.calcXY)(v,a,l,f,p);return s.call(this,u,x,w,{e:t,node:r,newPosition:b})}),si(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:o}=this.props;if(!o)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:i,h:s,i:a}=this.props,{left:l,top:c}=this.state.dragging,u={top:c,left:l};this.setState({dragging:null});const{x:f,y:p}=(0,Xn.calcXY)(this.getPositionParams(),c,l,i,s);return o.call(this,a,f,p,{e:t,node:r,newPosition:u})}),si(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),si(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),si(this,"onResize",(t,n,r)=>this.onResizeHandler(t,n,r,"onResize"))}shouldComponentUpdate(t,n){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const r=(0,Xn.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,Xn.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,Vl.fastPositionEqual)(r,o)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const o=t.droppingPosition||{left:0,top:0},{dragging:i}=this.state,s=i&&n.left!==o.left||n.top!==o.top;if(!i)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(s){const a=n.left-i.left,l=n.top-i.top;this.onDrag(n.e,{node:r,deltaX:a,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:n,containerWidth:r,useCSSTransforms:o}=this.props;let i;return o?i=(0,Vl.setTransform)(t):(i=(0,Vl.setTopLeft)(t),n&&(i.left=(0,Vl.perc)(t.left/r),i.width=(0,Vl.perc)(t.width/r))),i}mixinDraggable(t,n){return Bl.default.createElement(UB.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,o)=>n(r,o,t)}mixinResizable(t,n,r){const{cols:o,minW:i,minH:s,maxW:a,maxH:l,transformScale:c,resizeHandles:u,resizeHandle:f}=this.props,p=this.getPositionParams(),g=(0,Xn.calcGridItemPosition)(p,0,0,o,0).width,v=(0,Xn.calcGridItemPosition)(p,0,0,i,s),b=(0,Xn.calcGridItemPosition)(p,0,0,a,l),x=[v.width,v.height],w=[Math.min(b.width,g),Math.min(b.height,1/0)];return Bl.default.createElement(qB.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:x,maxConstraints:w,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:u,handle:f},t)}onResizeHandler(t,n,r,o){let{node:i,size:s,handle:a}=n;const l=this.props[o];if(!l)return;const{x:c,y:u,i:f,maxH:p,minH:g,containerWidth:v}=this.props,{minW:b,maxW:x}=this.props;let w=s;i&&(w=(0,Vl.resizeItemInDirection)(a,r,s,v),this.setState({resizing:o==="onResizeStop"?null:w}));let{w:_,h:S}=(0,Xn.calcWH)(this.getPositionParams(),w.width,w.height,c,u,a);_=(0,Xn.clamp)(_,Math.max(b,1),x),S=(0,Xn.clamp)(S,g,p),l.call(this,f,_,S,{e:t,node:i,size:w,handle:a})}render(){const{x:t,y:n,w:r,h:o,isDraggable:i,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,c=(0,Xn.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),u=Bl.default.Children.only(this.props.children);let f=Bl.default.cloneElement(u,{ref:this.elementRef,className:(0,GB.default)("react-grid-item",u.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":i,"react-draggable-dragging":!!this.state.dragging,dropping:!!a,cssTransforms:l}),style:{...this.props.style,...u.props.style,...this.createStyle(c)}});return f=this.mixinResizable(f,c,s),f=this.mixinDraggable(f,i),f}}Qg.default=xw;si(xw,"propTypes",{children:jt.default.element,cols:jt.default.number.isRequired,containerWidth:jt.default.number.isRequired,rowHeight:jt.default.number.isRequired,margin:jt.default.array.isRequired,maxRows:jt.default.number.isRequired,containerPadding:jt.default.array.isRequired,x:jt.default.number.isRequired,y:jt.default.number.isRequired,w:jt.default.number.isRequired,h:jt.default.number.isRequired,minW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minWidth not Number");if(n>e.w||n>e.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxWidth not Number");if(n<e.w||n<e.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minHeight not Number");if(n>e.h||n>e.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxHeight not Number");if(n<e.h||n<e.minH)return new Error("maxHeight smaller than item height/minHeight")},i:jt.default.string.isRequired,resizeHandles:NE.resizeHandleAxesType,resizeHandle:NE.resizeHandleType,onDragStop:jt.default.func,onDragStart:jt.default.func,onDrag:jt.default.func,onResizeStop:jt.default.func,onResizeStart:jt.default.func,onResize:jt.default.func,isDraggable:jt.default.bool.isRequired,isResizable:jt.default.bool.isRequired,isBounded:jt.default.bool.isRequired,static:jt.default.bool,useCSSTransforms:jt.default.bool.isRequired,transformScale:jt.default.number,className:jt.default.string,handle:jt.default.string,cancel:jt.default.string,droppingPosition:jt.default.shape({e:jt.default.object.isRequired,left:jt.default.number.isRequired,top:jt.default.number.isRequired})});si(xw,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty(xf,"__esModule",{value:!0});xf.default=void 0;var Ea=ZB(m),Pb=nw,XB=ww(rw),it=Ot,QB=Ei,LE=ww(Qg),JB=ww(is);function ww(e){return e&&e.__esModule?e:{default:e}}function vD(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(vD=function(r){return r?n:t})(e)}function ZB(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=vD(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function ir(e,t,n){return t=eV(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eV(e){var t=tV(e,"string");return typeof t=="symbol"?t:String(t)}function tV(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const FE="react-grid-layout";let bD=!1;try{bD=/firefox/i.test(navigator.userAgent)}catch{}class om extends Ea.Component{constructor(){super(...arguments),ir(this,"state",{activeDrag:null,layout:(0,it.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,it.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),ir(this,"dragEnterCounter",0),ir(this,"onDragStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,it.getLayoutItem)(a,t);if(l)return this.setState({oldDragItem:(0,it.cloneLayoutItem)(l),oldLayout:a}),this.props.onDragStart(a,l,l,null,i,s)}),ir(this,"onDrag",(t,n,r,o)=>{let{e:i,node:s}=o;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:u,preventCollision:f}=this.props,p=(0,it.getLayoutItem)(l,t);if(!p)return;const g={w:p.w,h:p.h,x:p.x,y:p.y,placeholder:!0,i:t},v=!0;l=(0,it.moveElement)(l,p,n,r,v,f,(0,it.compactType)(this.props),c,u),this.props.onDrag(l,a,p,g,i,s),this.setState({layout:u?l:(0,it.compact)(l,(0,it.compactType)(this.props),c),activeDrag:g})}),ir(this,"onDragStop",(t,n,r,o)=>{let{e:i,node:s}=o;if(!this.state.activeDrag)return;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:u,allowOverlap:f}=this.props,p=(0,it.getLayoutItem)(l,t);if(!p)return;const g=!0;l=(0,it.moveElement)(l,p,n,r,g,u,(0,it.compactType)(this.props),c,f);const v=f?l:(0,it.compact)(l,(0,it.compactType)(this.props),c);this.props.onDragStop(v,a,p,null,i,s);const{oldLayout:b}=this.state;this.setState({activeDrag:null,layout:v,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(v,b)}),ir(this,"onResizeStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,it.getLayoutItem)(a,t);l&&(this.setState({oldResizeItem:(0,it.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(a,l,l,null,i,s))}),ir(this,"onResize",(t,n,r,o)=>{let{e:i,node:s,size:a,handle:l}=o;const{oldResizeItem:c}=this.state;let{layout:u}=this.state;const{cols:f,preventCollision:p,allowOverlap:g}=this.props;let v=!1,b,x,w;const[_,S]=(0,it.withLayoutItem)(u,t,C=>{let P;return x=C.x,w=C.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(x=C.x+(C.w-n),n=C.x!==x&&x<0?C.w:n,x=x<0?0:x),["ne","n","nw"].indexOf(l)!==-1&&(w=C.y+(C.h-r),r=C.y!==w&&w<0?C.h:r,w=w<0?0:w),v=!0),p&&!g&&(P=(0,it.getAllCollisions)(u,{...C,w:n,h:r,x,y:w}).filter(M=>M.i!==C.i).length>0,P&&(w=C.y,r=C.h,x=C.x,n=C.w,v=!1)),C.w=n,C.h=r,C});if(!S)return;b=_,v&&(b=(0,it.moveElement)(_,S,x,w,!0,this.props.preventCollision,(0,it.compactType)(this.props),f,g));const R={w:S.w,h:S.h,x:S.x,y:S.y,static:!0,i:t};this.props.onResize(b,c,S,R,i,s),this.setState({layout:g?b:(0,it.compact)(b,(0,it.compactType)(this.props),f),activeDrag:R})}),ir(this,"onResizeStop",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a,oldResizeItem:l}=this.state,{cols:c,allowOverlap:u}=this.props,f=(0,it.getLayoutItem)(a,t),p=u?a:(0,it.compact)(a,(0,it.compactType)(this.props),c);this.props.onResizeStop(p,l,f,null,i,s);const{oldLayout:g}=this.state;this.setState({activeDrag:null,layout:p,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(p,g)}),ir(this,"onDragOver",t=>{var n;if(t.preventDefault(),t.stopPropagation(),bD&&!((n=t.nativeEvent.target)!==null&&n!==void 0&&n.classList.contains(FE)))return!1;const{droppingItem:r,onDropDragOver:o,margin:i,cols:s,rowHeight:a,maxRows:l,width:c,containerPadding:u,transformScale:f}=this.props,p=o==null?void 0:o(t);if(p===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const g={...r,...p},{layout:v}=this.state,{layerX:b,layerY:x}=t.nativeEvent,w={left:b/f,top:x/f,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:_,top:S}=this.state.droppingPosition;(_!=b||S!=x)&&this.setState({droppingPosition:w})}}else{const _={cols:s,margin:i,maxRows:l,rowHeight:a,containerWidth:c,containerPadding:u||i},S=(0,QB.calcXY)(_,x,b,g.w,g.h);this.setState({droppingDOMNode:Ea.createElement("div",{key:g.i}),droppingPosition:w,layout:[...v,{...g,x:S.x,y:S.y,static:!1,isDraggable:!0}]})}}),ir(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,o=(0,it.compact)(r.filter(i=>i.i!==t.i),(0,it.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),ir(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),ir(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),ir(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,o=r.find(i=>i.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,o,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,Pb.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,it.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,it.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,it.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,it.fastRGLPropsEqual)(this.props,t,Pb.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,o=n.layout;this.onLayoutMaybeChanged(r,o)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,it.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(t,n){n||(n=this.state.layout),(0,Pb.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:o,containerPadding:i,rowHeight:s,maxRows:a,useCSSTransforms:l,transformScale:c}=this.props;return Ea.createElement(LE.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:"react-grid-placeholder ".concat(this.state.resizing?"placeholder-resizing":""),containerWidth:n,cols:r,margin:o,containerPadding:i||o,maxRows:a,rowHeight:s,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},Ea.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,it.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:o,cols:i,margin:s,containerPadding:a,rowHeight:l,maxRows:c,isDraggable:u,isResizable:f,isBounded:p,useCSSTransforms:g,transformScale:v,draggableCancel:b,draggableHandle:x,resizeHandles:w,resizeHandle:_}=this.props,{mounted:S,droppingPosition:R}=this.state,C=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&u,P=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&f,A=r.resizeHandles||w,M=C&&p&&r.isBounded!==!1;return Ea.createElement(LE.default,{containerWidth:o,cols:i,margin:s,containerPadding:a||s,maxRows:c,rowHeight:l,cancel:b,handle:x,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:C,isResizable:P,isBounded:M,useCSSTransforms:g&&S,usePercentages:!S,transformScale:v,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?R:void 0,resizeHandles:A,resizeHandle:_},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,XB.default)(FE,t),s={height:this.containerHeight(),...n};return Ea.createElement("div",{ref:o,className:i,style:s,onDrop:r?this.onDrop:it.noop,onDragLeave:r?this.onDragLeave:it.noop,onDragEnter:r?this.onDragEnter:it.noop,onDragOver:r?this.onDragOver:it.noop},Ea.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}xf.default=om;ir(om,"displayName","ReactGridLayout");ir(om,"propTypes",JB.default);ir(om,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:it.noop,onDragStart:it.noop,onDrag:it.noop,onDragStop:it.noop,onResizeStart:it.noop,onResize:it.noop,onResizeStop:it.noop,onDrop:it.noop,onDropDragOver:it.noop});var im={},bl={};Object.defineProperty(bl,"__esModule",{value:!0});bl.findOrGenerateResponsiveLayout=oV;bl.getBreakpointFromWidth=nV;bl.getColsFromBreakpoint=rV;bl.sortBreakpoints=_w;var Nh=Ot;function nV(e,t){const n=_w(e);let r=n[0];for(let o=1,i=n.length;o<i;o++){const s=n[o];t>e[s]&&(r=s)}return r}function rV(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function oV(e,t,n,r,o,i){if(e[n])return(0,Nh.cloneLayout)(e[n]);let s=e[r];const a=_w(t),l=a.slice(a.indexOf(n));for(let c=0,u=l.length;c<u;c++){const f=l[c];if(e[f]){s=e[f];break}}return s=(0,Nh.cloneLayout)(s||[]),(0,Nh.compact)((0,Nh.correctBounds)(s,{cols:o}),i,o)}function _w(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(im,"__esModule",{value:!0});im.default=void 0;var zE=sV(m),Rr=yD(ua),Tb=nw,lc=Ot,Ra=bl,iV=yD(xf);function yD(e){return e&&e.__esModule?e:{default:e}}function xD(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(xD=function(r){return r?n:t})(e)}function sV(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=xD(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Ry(){return Ry=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ry.apply(this,arguments)}function og(e,t,n){return t=aV(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aV(e){var t=lV(e,"string");return typeof t=="symbol"?t:String(t)}function lV(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const jE=e=>Object.prototype.toString.call(e);function Lh(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class Sw extends zE.Component{constructor(){super(...arguments),og(this,"state",this.generateInitialState()),og(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:o}=this.props,i=(0,Ra.getBreakpointFromWidth)(n,t),s=(0,Ra.getColsFromBreakpoint)(i,o),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,Ra.findOrGenerateResponsiveLayout)(r,n,i,i,s,a),breakpoint:i,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,Tb.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,Ra.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,o,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,Tb.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,Tb.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:o,compactType:i}=this.props,s=this.props.breakpoint||(0,Ra.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,Ra.getColsFromBreakpoint)(s,r),c={...o};if(a!==s||t.breakpoints!==n||t.cols!==r){a in c||(c[a]=(0,lc.cloneLayout)(this.state.layout));let p=(0,Ra.findOrGenerateResponsiveLayout)(c,n,s,a,l,i);p=(0,lc.synchronizeLayoutWithChildren)(p,this.props.children,l,i,this.props.allowOverlap),c[s]=p,this.props.onLayoutChange(p,c),this.props.onBreakpointChange(s,l),this.setState({breakpoint:s,layout:p,cols:l})}const u=Lh(this.props.margin,s),f=Lh(this.props.containerPadding,s);this.props.onWidthChange(this.props.width,u,l,f)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:o,margin:i,containerPadding:s,onBreakpointChange:a,onLayoutChange:l,onWidthChange:c,...u}=this.props;return zE.createElement(iV.default,Ry({},u,{margin:Lh(i,this.state.breakpoint),containerPadding:Lh(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}im.default=Sw;og(Sw,"propTypes",{breakpoint:Rr.default.string,breakpoints:Rr.default.object,allowOverlap:Rr.default.bool,cols:Rr.default.object,margin:Rr.default.oneOfType([Rr.default.array,Rr.default.object]),containerPadding:Rr.default.oneOfType([Rr.default.array,Rr.default.object]),layouts(e,t){if(jE(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+jE(e[t]));Object.keys(e[t]).forEach(n=>{if(!(n in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,lc.validateLayout)(e.layouts[n],"layouts."+n)})},width:Rr.default.number.isRequired,onBreakpointChange:Rr.default.func,onLayoutChange:Rr.default.func,onWidthChange:Rr.default.func});og(Sw,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:lc.noop,onLayoutChange:lc.noop,onWidthChange:lc.noop});var Cw={},wD=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,i){return o[0]===n?(r=i,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,i=this.__entries__;o<i.length;o++){var s=i[o];n.call(r,s[1],s[0])}},t}()}(),Oy=typeof window<"u"&&typeof document<"u"&&window.document===document,ig=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),cV=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(ig):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),uV=2;function dV(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&a()}function s(){cV(i)}function a(){var l=Date.now();if(n){if(l-o<uV)return;r=!0}else n=!0,r=!1,setTimeout(s,t);o=l}return a}var fV=20,hV=["top","right","bottom","left","width","height","size","weight"],pV=typeof MutationObserver<"u",gV=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=dV(this.refresh.bind(this),fV)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!Oy||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),pV?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Oy||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=hV.some(function(i){return!!~r.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),_D=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},Mc=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||ig},SD=sm(0,0,0,0);function sg(e){return parseFloat(e)||0}function BE(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var i=e["border-"+o+"-width"];return r+sg(i)},0)}function mV(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var i=o[r],s=e["padding-"+i];n[i]=sg(s)}return n}function vV(e){var t=e.getBBox();return sm(0,0,t.width,t.height)}function bV(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return SD;var r=Mc(e).getComputedStyle(e),o=mV(r),i=o.left+o.right,s=o.top+o.bottom,a=sg(r.width),l=sg(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+i)!==t&&(a-=BE(r,"left","right")+i),Math.round(l+s)!==n&&(l-=BE(r,"top","bottom")+s)),!xV(e)){var c=Math.round(a+i)-t,u=Math.round(l+s)-n;Math.abs(c)!==1&&(a-=c),Math.abs(u)!==1&&(l-=u)}return sm(o.left,o.top,a,l)}var yV=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Mc(e).SVGGraphicsElement}:function(e){return e instanceof Mc(e).SVGElement&&typeof e.getBBox=="function"}}();function xV(e){return e===Mc(e).document.documentElement}function wV(e){return Oy?yV(e)?vV(e):bV(e):SD}function _V(e){var t=e.x,n=e.y,r=e.width,o=e.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,s=Object.create(i.prototype);return _D(s,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),s}function sm(e,t,n,r){return{x:e,y:t,width:n,height:r}}var SV=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=sm(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=wV(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),CV=function(){function e(t,n){var r=_V(n);_D(this,{target:t,contentRect:r})}return e}(),EV=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new wD,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Mc(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new SV(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Mc(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new CV(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),CD=typeof WeakMap<"u"?new WeakMap:new wD,ED=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=gV.getInstance(),r=new EV(t,n,this);CD.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){ED.prototype[e]=function(){var t;return(t=CD.get(this))[e].apply(t,arguments)}});var RV=function(){return typeof ig.ResizeObserver<"u"?ig.ResizeObserver:ED}();const OV=Object.freeze(Object.defineProperty({__proto__:null,default:RV},Symbol.toStringTag,{value:"Module"})),PV=Fx(OV);Object.defineProperty(Cw,"__esModule",{value:!0});Cw.default=NV;var Fh=kV(m),TV=Ew(ua),DV=Ew(PV),$V=Ew(rw);function Ew(e){return e&&e.__esModule?e:{default:e}}function RD(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(RD=function(r){return r?n:t})(e)}function kV(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=RD(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Py(){return Py=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Py.apply(this,arguments)}function Hl(e,t,n){return t=MV(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MV(e){var t=AV(e,"string");return typeof t=="symbol"?t:String(t)}function AV(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const IV="react-grid-layout";function NV(e){var t;return t=class extends Fh.Component{constructor(){super(...arguments),Hl(this,"state",{width:1280}),Hl(this,"elementRef",Fh.createRef()),Hl(this,"mounted",!1),Hl(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new DV.default(o=>{if(this.elementRef.current instanceof HTMLElement){const s=o[0].contentRect.width;this.setState({width:s})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...o}=this.props;return r&&!this.mounted?Fh.createElement("div",{className:(0,$V.default)(this.props.className,IV),style:this.props.style,ref:this.elementRef}):Fh.createElement(e,Py({innerRef:this.elementRef},o,this.state))}},Hl(t,"defaultProps",{measureBeforeMount:!1}),Hl(t,"propTypes",{measureBeforeMount:TV.default.bool}),t}(function(e){e.exports=xf.default,e.exports.utils=Ot,e.exports.calculateUtils=Ei,e.exports.Responsive=im.default,e.exports.Responsive.utils=bl,e.exports.WidthProvider=Cw.default})(F2);var VE=F2.exports;function na({children:e,className:t,text:n,onSave:r,type:o="input"}){const[i,s]=m.useState(!1),[a,l]=m.useState(n),c=Ie(p=>p.isDashboardEditing),u=p=>{p.stopPropagation(),c&&s(!0)};function f(){return o==="textarea"?O.jsx("textarea",{className:Pe(" grow px-2 py-1 text-sm bg-background outline-[0.5px] outline-dashed outline-primary/50 rounded-sm",t),onChange:p=>l(p.target.value),value:a,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:p=>{p.key==="Enter"&&p.shiftKey||(p.key==="Enter"||p.key==="Tab")&&(s(!1),r(a))}}):O.jsx("input",{onMouseDown:p=>p.stopPropagation(),type:"text",className:Pe("px-2 py-1 text-sm bg-background outline-[0.5px] outline-dashed outline-primary/50 rounded-sm",t),onChange:p=>l(p.target.value),value:a,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:p=>{(p.key==="Enter"||p.key==="Tab")&&(s(!1),r(a))}})}return O.jsx("div",{className:"flex",role:"editable",onDoubleClick:u,children:i?f():e})}/*!
|
|
109
|
+
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&iD(e.body,"react-draggable-transparent-selection")}function Zj(e){if(e)try{if(e.body&&sD(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function iD(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function sD(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Oi={};Object.defineProperty(Oi,"__esModule",{value:!0});Oi.canDragX=nB;Oi.canDragY=rB;Oi.createCoreData=iB;Oi.createDraggableData=sB;Oi.getBoundPosition=eB;Oi.getControlPosition=oB;Oi.snapToGrid=tB;var qr=Ri,oc=En;function eB(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:aB(r);const o=gw(e);if(typeof r=="string"){const{ownerDocument:i}=o,s=i.defaultView;let a;if(r==="parent"?a=o.parentNode:a=i.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=s.getComputedStyle(o),u=s.getComputedStyle(l);r={left:-o.offsetLeft+(0,qr.int)(u.paddingLeft)+(0,qr.int)(c.marginLeft),top:-o.offsetTop+(0,qr.int)(u.paddingTop)+(0,qr.int)(c.marginTop),right:(0,oc.innerWidth)(l)-(0,oc.outerWidth)(o)-o.offsetLeft+(0,qr.int)(u.paddingRight)-(0,qr.int)(c.marginRight),bottom:(0,oc.innerHeight)(l)-(0,oc.outerHeight)(o)-o.offsetTop+(0,qr.int)(u.paddingBottom)-(0,qr.int)(c.marginBottom)}}return(0,qr.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,qr.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,qr.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,qr.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function tB(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function nB(e){return e.props.axis==="both"||e.props.axis==="x"}function rB(e){return e.props.axis==="both"||e.props.axis==="y"}function oB(e,t,n){const r=typeof t=="number"?(0,oc.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=gw(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,oc.offsetXYFromParent)(r||e,i,n.props.scale)}function iB(e,t,n){const r=!(0,qr.isNum)(e.lastX),o=gw(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function sB(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function aB(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function gw(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Zg={},em={};Object.defineProperty(em,"__esModule",{value:!0});em.default=lB;function lB(){}Object.defineProperty(Zg,"__esModule",{value:!0});Zg.default=void 0;var Cb=uB(m),Er=mw(ua),cB=mw(Qo),or=En,Ts=Oi,Eb=Ri,Su=mw(em);function mw(e){return e&&e.__esModule?e:{default:e}}function aD(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(aD=function(r){return r?n:t})(e)}function uB(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=aD(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function mr(e,t,n){return t=dB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dB(e){var t=fB(e,"string");return typeof t=="symbol"?t:String(t)}function fB(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Vo={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Ds=Vo.mouse,tm=class extends Cb.Component{constructor(){super(...arguments),mr(this,"dragging",!1),mr(this,"lastX",NaN),mr(this,"lastY",NaN),mr(this,"touchIdentifier",null),mr(this,"mounted",!1),mr(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,or.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,or.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,or.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,Ts.getControlPosition)(t,o,this);if(i==null)return;const{x:s,y:a}=i,l=(0,Ts.createCoreData)(this,s,a);(0,Su.default)("DraggableCore: handleDragStart: %j",l),(0,Su.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,or.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,or.addEvent)(r,Ds.move,this.handleDrag),(0,or.addEvent)(r,Ds.stop,this.handleDragStop))}),mr(this,"handleDrag",t=>{const n=(0,Ts.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX,l=o-this.lastY;if([a,l]=(0,Ts.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,o=this.lastY+l}const i=(0,Ts.createCoreData)(this,r,o);if((0,Su.default)("DraggableCore: handleDrag: %j",i),this.props.onDrag(t,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=o}),mr(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,Ts.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=o-this.lastY||0;[l,c]=(0,Ts.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,o=this.lastY+c}const i=(0,Ts.createCoreData)(this,r,o);if(this.props.onStop(t,i)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,or.removeUserSelectStyles)(a.ownerDocument),(0,Su.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,Su.default)("DraggableCore: Removing handlers"),(0,or.removeEvent)(a.ownerDocument,Ds.move,this.handleDrag),(0,or.removeEvent)(a.ownerDocument,Ds.stop,this.handleDragStop))}),mr(this,"onMouseDown",t=>(Ds=Vo.mouse,this.handleDragStart(t))),mr(this,"onMouseUp",t=>(Ds=Vo.mouse,this.handleDragStop(t))),mr(this,"onTouchStart",t=>(Ds=Vo.touch,this.handleDragStart(t))),mr(this,"onTouchEnd",t=>(Ds=Vo.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,or.addEvent)(t,Vo.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,or.removeEvent)(n,Vo.mouse.move,this.handleDrag),(0,or.removeEvent)(n,Vo.touch.move,this.handleDrag),(0,or.removeEvent)(n,Vo.mouse.stop,this.handleDragStop),(0,or.removeEvent)(n,Vo.touch.stop,this.handleDragStop),(0,or.removeEvent)(t,Vo.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,or.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:cB.default.findDOMNode(this)}render(){return Cb.cloneElement(Cb.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Zg.default=tm;mr(tm,"displayName","DraggableCore");mr(tm,"propTypes",{allowAnyClick:Er.default.bool,children:Er.default.node.isRequired,disabled:Er.default.bool,enableUserSelectHack:Er.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:Er.default.arrayOf(Er.default.number),handle:Er.default.string,cancel:Er.default.string,nodeRef:Er.default.object,onStart:Er.default.func,onDrag:Er.default.func,onStop:Er.default.func,onMouseDown:Er.default.func,scale:Er.default.number,className:Eb.dontSetMe,style:Eb.dontSetMe,transform:Eb.dontSetMe});mr(tm,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=p(m),n=u(ua),r=u(Qo),o=u($j),i=En,s=Oi,a=Ri,l=u(Zg),c=u(em);function u(_){return _&&_.__esModule?_:{default:_}}function f(_){if(typeof WeakMap!="function")return null;var S=new WeakMap,R=new WeakMap;return(f=function(C){return C?R:S})(_)}function p(_,S){if(!S&&_&&_.__esModule)return _;if(_===null||typeof _!="object"&&typeof _!="function")return{default:_};var R=f(S);if(R&&R.has(_))return R.get(_);var C={},P=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var A in _)if(A!=="default"&&Object.prototype.hasOwnProperty.call(_,A)){var M=P?Object.getOwnPropertyDescriptor(_,A):null;M&&(M.get||M.set)?Object.defineProperty(C,A,M):C[A]=_[A]}return C.default=_,R&&R.set(_,C),C}function g(){return g=Object.assign?Object.assign.bind():function(_){for(var S=1;S<arguments.length;S++){var R=arguments[S];for(var C in R)Object.prototype.hasOwnProperty.call(R,C)&&(_[C]=R[C])}return _},g.apply(this,arguments)}function v(_,S,R){return S=b(S),S in _?Object.defineProperty(_,S,{value:R,enumerable:!0,configurable:!0,writable:!0}):_[S]=R,_}function b(_){var S=x(_,"string");return typeof S=="symbol"?S:String(S)}function x(_,S){if(typeof _!="object"||_===null)return _;var R=_[Symbol.toPrimitive];if(R!==void 0){var C=R.call(_,S||"default");if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(_)}class w extends t.Component{static getDerivedStateFromProps(S,R){let{position:C}=S,{prevPropsPosition:P}=R;return C&&(!P||C.x!==P.x||C.y!==P.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:C,prevPropsPosition:P}),{x:C.x,y:C.y,prevPropsPosition:{...C}}):null}constructor(S){super(S),v(this,"onDragStart",(R,C)=>{if((0,c.default)("Draggable: onDragStart: %j",C),this.props.onStart(R,(0,s.createDraggableData)(this,C))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),v(this,"onDrag",(R,C)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",C);const P=(0,s.createDraggableData)(this,C),A={x:P.x,y:P.y,slackX:0,slackY:0};if(this.props.bounds){const{x:T,y:I}=A;A.x+=this.state.slackX,A.y+=this.state.slackY;const[F,j]=(0,s.getBoundPosition)(this,A.x,A.y);A.x=F,A.y=j,A.slackX=this.state.slackX+(T-A.x),A.slackY=this.state.slackY+(I-A.y),P.x=A.x,P.y=A.y,P.deltaX=A.x-this.state.x,P.deltaY=A.y-this.state.y}if(this.props.onDrag(R,P)===!1)return!1;this.setState(A)}),v(this,"onDragStop",(R,C)=>{if(!this.state.dragging||this.props.onStop(R,(0,s.createDraggableData)(this,C))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",C);const A={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:T,y:I}=this.props.position;A.x=T,A.y=I}this.setState(A)}),this.state={dragging:!1,dragged:!1,x:S.position?S.position.x:S.defaultPosition.x,y:S.position?S.position.y:S.defaultPosition.y,prevPropsPosition:{...S.position},slackX:0,slackY:0,isElementSVG:!1},S.position&&!(S.onDrag||S.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var S,R;return(S=(R=this.props)===null||R===void 0||(R=R.nodeRef)===null||R===void 0?void 0:R.current)!==null&&S!==void 0?S:r.default.findDOMNode(this)}render(){const{axis:S,bounds:R,children:C,defaultPosition:P,defaultClassName:A,defaultClassNameDragging:M,defaultClassNameDragged:T,position:I,positionOffset:F,scale:j,...X}=this.props;let G={},B=null;const H=!!!I||this.state.dragging,Y=I||P,te={x:(0,s.canDragX)(this)&&H?this.state.x:Y.x,y:(0,s.canDragY)(this)&&H?this.state.y:Y.y};this.state.isElementSVG?B=(0,i.createSVGTransform)(te,F):G=(0,i.createCSSTransform)(te,F);const $=(0,o.default)(C.props.className||"",A,{[M]:this.state.dragging,[T]:this.state.dragged});return t.createElement(l.default,g({},X,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(C),{className:$,style:{...C.props.style,...G},transform:B}))}}e.default=w,v(w,"displayName","Draggable"),v(w,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),v(w,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(ZT);const{default:lD,DraggableCore:hB}=ZT;Jg.exports=lD;Jg.exports.default=lD;Jg.exports.DraggableCore=hB;var cD=Jg.exports,nm={exports:{}},wf={},vw={};vw.__esModule=!0;vw.cloneElement=yB;var pB=gB(m);function gB(e){return e&&e.__esModule?e:{default:e}}function kE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function ME(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kE(Object(n),!0).forEach(function(r){mB(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mB(e,t,n){return t=vB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vB(e){var t=bB(e,"string");return typeof t=="symbol"?t:String(t)}function bB(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yB(e,t){return t.style&&e.props.style&&(t.style=ME(ME({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),pB.default.cloneElement(e,t)}var _f={};_f.__esModule=!0;_f.resizableProps=void 0;var mt=xB(ua);function xB(e){return e&&e.__esModule?e:{default:e}}var wB={axis:mt.default.oneOf(["both","x","y","none"]),className:mt.default.string,children:mt.default.element.isRequired,draggableOpts:mt.default.shape({allowAnyClick:mt.default.bool,cancel:mt.default.string,children:mt.default.node,disabled:mt.default.bool,enableUserSelectHack:mt.default.bool,offsetParent:mt.default.node,grid:mt.default.arrayOf(mt.default.number),handle:mt.default.string,nodeRef:mt.default.object,onStart:mt.default.func,onDrag:mt.default.func,onStop:mt.default.func,onMouseDown:mt.default.func,scale:mt.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="y"){var i;return(i=mt.default.number).isRequired.apply(i,n)}return mt.default.number.apply(mt.default,n)},handle:mt.default.oneOfType([mt.default.node,mt.default.func]),handleSize:mt.default.arrayOf(mt.default.number),lockAspectRatio:mt.default.bool,maxConstraints:mt.default.arrayOf(mt.default.number),minConstraints:mt.default.arrayOf(mt.default.number),onResizeStop:mt.default.func,onResizeStart:mt.default.func,onResize:mt.default.func,resizeHandles:mt.default.arrayOf(mt.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:mt.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="x"){var i;return(i=mt.default.number).isRequired.apply(i,n)}return mt.default.number.apply(mt.default,n)}};_f.resizableProps=wB;wf.__esModule=!0;wf.default=void 0;var Cu=RB(m),_B=cD,SB=vw,CB=_f,EB=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function uD(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(uD=function(o){return o?n:t})(e)}function RB(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=uD(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function _y(){return _y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_y.apply(this,arguments)}function OB(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function AE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Rb(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AE(Object(n),!0).forEach(function(r){PB(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function PB(e,t,n){return t=TB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TB(e){var t=DB(e,"string");return typeof t=="symbol"?t:String(t)}function DB(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $B(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Sy(e,t)}function Sy(e,t){return Sy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Sy(e,t)}var bw=function(e){$B(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,i){var s=this.props,a=s.minConstraints,l=s.maxConstraints,c=s.lockAspectRatio;if(!a&&!l&&!c)return[o,i];if(c){var u=this.props.width/this.props.height,f=o-this.props.width,p=i-this.props.height;Math.abs(f)>Math.abs(p*u)?i=o/u:o=i*u}var g=o,v=i,b=this.slack||[0,0],x=b[0],w=b[1];return o+=x,i+=w,a&&(o=Math.max(a[0],o),i=Math.max(a[1],i)),l&&(o=Math.min(l[0],o),i=Math.min(l[1],i)),this.slack=[x+(g-o),w+(v-i)],[o,i]},n.resizeHandler=function(o,i){var s=this;return function(a,l){var c=l.node,u=l.deltaX,f=l.deltaY;o==="onResizeStart"&&s.resetData();var p=(s.props.axis==="both"||s.props.axis==="x")&&i!=="n"&&i!=="s",g=(s.props.axis==="both"||s.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!p&&!g)){var v=i[0],b=i[i.length-1],x=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(b==="w"){var w=x.left-s.lastHandleRect.left;u+=w}if(v==="n"){var _=x.top-s.lastHandleRect.top;f+=_}}s.lastHandleRect=x,b==="w"&&(u=-u),v==="n"&&(f=-f);var S=s.props.width+(p?u/s.props.transformScale:0),R=s.props.height+(g?f/s.props.transformScale:0),C=s.runConstraints(S,R);S=C[0],R=C[1];var P=S!==s.props.width||R!==s.props.height,A=typeof s.props[o]=="function"?s.props[o]:null,M=o==="onResize"&&!P;A&&!M&&(a.persist==null||a.persist(),A(a,{node:c,size:{width:S,height:R},handle:i})),o==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(o,i){var s=this.props.handle;if(!s)return Cu.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+o,ref:i});if(typeof s=="function")return s(o,i);var a=typeof s.type=="string",l=Rb({ref:i},a?{}:{handleAxis:o});return Cu.cloneElement(s,l)},n.render=function(){var o=this,i=this.props,s=i.children,a=i.className,l=i.draggableOpts;i.width,i.height,i.handle,i.handleSize,i.lockAspectRatio,i.axis,i.minConstraints,i.maxConstraints,i.onResize,i.onResizeStop,i.onResizeStart;var c=i.resizeHandles;i.transformScale;var u=OB(i,EB);return(0,SB.cloneElement)(s,Rb(Rb({},u),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(f){var p,g=(p=o.handleRefs[f])!=null?p:o.handleRefs[f]=Cu.createRef();return Cu.createElement(_B.DraggableCore,_y({},l,{nodeRef:g,key:"resizableHandle-"+f,onStop:o.resizeHandler("onResizeStop",f),onStart:o.resizeHandler("onResizeStart",f),onDrag:o.resizeHandler("onResize",f)}),o.renderResizeHandle(f,g))}))}))},t}(Cu.Component);wf.default=bw;bw.propTypes=CB.resizableProps;bw.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var rm={};rm.__esModule=!0;rm.default=void 0;var Ob=NB(m),kB=dD(ua),MB=dD(wf),AB=_f,IB=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function dD(e){return e&&e.__esModule?e:{default:e}}function fD(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(fD=function(o){return o?n:t})(e)}function NB(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=fD(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Cy(){return Cy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Cy.apply(this,arguments)}function IE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function rg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IE(Object(n),!0).forEach(function(r){LB(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LB(e,t,n){return t=FB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FB(e){var t=zB(e,"string");return typeof t=="symbol"?t:String(t)}function zB(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jB(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function BB(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ey(e,t)}function Ey(e,t){return Ey=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Ey(e,t)}var hD=function(e){BB(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(a,l){var c=l.size;r.props.onResize?(a.persist==null||a.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(a,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(o,i){return i.propsWidth!==o.width||i.propsHeight!==o.height?{width:o.width,height:o.height,propsWidth:o.width,propsHeight:o.height}:null};var n=t.prototype;return n.render=function(){var o=this.props,i=o.handle,s=o.handleSize;o.onResize;var a=o.onResizeStart,l=o.onResizeStop,c=o.draggableOpts,u=o.minConstraints,f=o.maxConstraints,p=o.lockAspectRatio,g=o.axis;o.width,o.height;var v=o.resizeHandles,b=o.style,x=o.transformScale,w=jB(o,IB);return Ob.createElement(MB.default,{axis:g,draggableOpts:c,handle:i,handleSize:s,height:this.state.height,lockAspectRatio:p,maxConstraints:f,minConstraints:u,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:v,transformScale:x,width:this.state.width},Ob.createElement("div",Cy({},w,{style:rg(rg({},b),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(Ob.Component);rm.default=hD;hD.propTypes=rg(rg({},AB.resizableProps),{},{children:kB.default.element});nm.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};nm.exports.Resizable=wf.default;nm.exports.ResizableBox=rm.default;var VB=nm.exports,is={};Object.defineProperty(is,"__esModule",{value:!0});is.resizeHandleType=is.resizeHandleAxesType=is.default=void 0;var _t=pD(ua),HB=pD(m);function pD(e){return e&&e.__esModule?e:{default:e}}const gD=_t.default.arrayOf(_t.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));is.resizeHandleAxesType=gD;const mD=_t.default.oneOfType([_t.default.node,_t.default.func]);is.resizeHandleType=mD;var WB={className:_t.default.string,style:_t.default.object,width:_t.default.number,autoSize:_t.default.bool,cols:_t.default.number,draggableCancel:_t.default.string,draggableHandle:_t.default.string,verticalCompact:function(e){e.verticalCompact===!1&&process.env.NODE_ENV!=="production"&&console.warn('`verticalCompact` on <ReactGridLayout> is deprecated and will be removed soon. Use `compactType`: "horizontal" | "vertical" | null.')},compactType:_t.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&Ot.validateLayout(t,"layout")},margin:_t.default.arrayOf(_t.default.number),containerPadding:_t.default.arrayOf(_t.default.number),rowHeight:_t.default.number,maxRows:_t.default.number,isBounded:_t.default.bool,isDraggable:_t.default.bool,isResizable:_t.default.bool,allowOverlap:_t.default.bool,preventCollision:_t.default.bool,useCSSTransforms:_t.default.bool,transformScale:_t.default.number,isDroppable:_t.default.bool,resizeHandles:gD,resizeHandle:mD,onLayoutChange:_t.default.func,onDragStart:_t.default.func,onDrag:_t.default.func,onDragStop:_t.default.func,onResizeStart:_t.default.func,onResize:_t.default.func,onResizeStop:_t.default.func,onDrop:_t.default.func,droppingItem:_t.default.shape({i:_t.default.string.isRequired,w:_t.default.number.isRequired,h:_t.default.number.isRequired}),children:function(e,t){const n=e[t],r={};HB.default.Children.forEach(n,function(o){if((o==null?void 0:o.key)!=null){if(r[o.key])throw new Error('Duplicate child key "'+o.key+'" found! This will cause problems in ReactGridLayout.');r[o.key]=!0}})},innerRef:_t.default.any};is.default=WB;Object.defineProperty(Qg,"__esModule",{value:!0});Qg.default=void 0;var Bl=yw(m),jt=yw(ua),UB=cD,qB=VB,Vl=Ot,Xn=Ei,NE=is,GB=yw(rw);function yw(e){return e&&e.__esModule?e:{default:e}}function si(e,t,n){return t=YB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YB(e){var t=KB(e,"string");return typeof t=="symbol"?t:String(t)}function KB(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class xw extends Bl.default.Component{constructor(){super(...arguments),si(this,"state",{resizing:null,dragging:null,className:""}),si(this,"elementRef",Bl.default.createRef()),si(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:o,transformScale:i}=this.props;if(!o)return;const s={top:0,left:0},{offsetParent:a}=r;if(!a)return;const l=a.getBoundingClientRect(),c=r.getBoundingClientRect(),u=c.left/i,f=l.left/i,p=c.top/i,g=l.top/i;s.left=u-f+a.scrollLeft,s.top=p-g+a.scrollTop,this.setState({dragging:s});const{x:v,y:b}=(0,Xn.calcXY)(this.getPositionParams(),s.top,s.left,this.props.w,this.props.h);return o.call(this,this.props.i,v,b,{e:t,node:r,newPosition:s})}),si(this,"onDrag",(t,n)=>{let{node:r,deltaX:o,deltaY:i}=n;const{onDrag:s}=this.props;if(!s)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let a=this.state.dragging.top+i,l=this.state.dragging.left+o;const{isBounded:c,i:u,w:f,h:p,containerWidth:g}=this.props,v=this.getPositionParams();if(c){const{offsetParent:_}=r;if(_){const{margin:S,rowHeight:R}=this.props,C=_.clientHeight-(0,Xn.calcGridItemWHPx)(p,R,S[1]);a=(0,Xn.clamp)(a,0,C);const P=(0,Xn.calcGridColWidth)(v),A=g-(0,Xn.calcGridItemWHPx)(f,P,S[0]);l=(0,Xn.clamp)(l,0,A)}}const b={top:a,left:l};this.setState({dragging:b});const{x,y:w}=(0,Xn.calcXY)(v,a,l,f,p);return s.call(this,u,x,w,{e:t,node:r,newPosition:b})}),si(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:o}=this.props;if(!o)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:i,h:s,i:a}=this.props,{left:l,top:c}=this.state.dragging,u={top:c,left:l};this.setState({dragging:null});const{x:f,y:p}=(0,Xn.calcXY)(this.getPositionParams(),c,l,i,s);return o.call(this,a,f,p,{e:t,node:r,newPosition:u})}),si(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),si(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),si(this,"onResize",(t,n,r)=>this.onResizeHandler(t,n,r,"onResize"))}shouldComponentUpdate(t,n){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const r=(0,Xn.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,Xn.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,Vl.fastPositionEqual)(r,o)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const o=t.droppingPosition||{left:0,top:0},{dragging:i}=this.state,s=i&&n.left!==o.left||n.top!==o.top;if(!i)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(s){const a=n.left-i.left,l=n.top-i.top;this.onDrag(n.e,{node:r,deltaX:a,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:n,containerWidth:r,useCSSTransforms:o}=this.props;let i;return o?i=(0,Vl.setTransform)(t):(i=(0,Vl.setTopLeft)(t),n&&(i.left=(0,Vl.perc)(t.left/r),i.width=(0,Vl.perc)(t.width/r))),i}mixinDraggable(t,n){return Bl.default.createElement(UB.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,o)=>n(r,o,t)}mixinResizable(t,n,r){const{cols:o,minW:i,minH:s,maxW:a,maxH:l,transformScale:c,resizeHandles:u,resizeHandle:f}=this.props,p=this.getPositionParams(),g=(0,Xn.calcGridItemPosition)(p,0,0,o,0).width,v=(0,Xn.calcGridItemPosition)(p,0,0,i,s),b=(0,Xn.calcGridItemPosition)(p,0,0,a,l),x=[v.width,v.height],w=[Math.min(b.width,g),Math.min(b.height,1/0)];return Bl.default.createElement(qB.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:x,maxConstraints:w,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:u,handle:f},t)}onResizeHandler(t,n,r,o){let{node:i,size:s,handle:a}=n;const l=this.props[o];if(!l)return;const{x:c,y:u,i:f,maxH:p,minH:g,containerWidth:v}=this.props,{minW:b,maxW:x}=this.props;let w=s;i&&(w=(0,Vl.resizeItemInDirection)(a,r,s,v),this.setState({resizing:o==="onResizeStop"?null:w}));let{w:_,h:S}=(0,Xn.calcWH)(this.getPositionParams(),w.width,w.height,c,u,a);_=(0,Xn.clamp)(_,Math.max(b,1),x),S=(0,Xn.clamp)(S,g,p),l.call(this,f,_,S,{e:t,node:i,size:w,handle:a})}render(){const{x:t,y:n,w:r,h:o,isDraggable:i,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,c=(0,Xn.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),u=Bl.default.Children.only(this.props.children);let f=Bl.default.cloneElement(u,{ref:this.elementRef,className:(0,GB.default)("react-grid-item",u.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":i,"react-draggable-dragging":!!this.state.dragging,dropping:!!a,cssTransforms:l}),style:{...this.props.style,...u.props.style,...this.createStyle(c)}});return f=this.mixinResizable(f,c,s),f=this.mixinDraggable(f,i),f}}Qg.default=xw;si(xw,"propTypes",{children:jt.default.element,cols:jt.default.number.isRequired,containerWidth:jt.default.number.isRequired,rowHeight:jt.default.number.isRequired,margin:jt.default.array.isRequired,maxRows:jt.default.number.isRequired,containerPadding:jt.default.array.isRequired,x:jt.default.number.isRequired,y:jt.default.number.isRequired,w:jt.default.number.isRequired,h:jt.default.number.isRequired,minW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minWidth not Number");if(n>e.w||n>e.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxWidth not Number");if(n<e.w||n<e.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minHeight not Number");if(n>e.h||n>e.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxHeight not Number");if(n<e.h||n<e.minH)return new Error("maxHeight smaller than item height/minHeight")},i:jt.default.string.isRequired,resizeHandles:NE.resizeHandleAxesType,resizeHandle:NE.resizeHandleType,onDragStop:jt.default.func,onDragStart:jt.default.func,onDrag:jt.default.func,onResizeStop:jt.default.func,onResizeStart:jt.default.func,onResize:jt.default.func,isDraggable:jt.default.bool.isRequired,isResizable:jt.default.bool.isRequired,isBounded:jt.default.bool.isRequired,static:jt.default.bool,useCSSTransforms:jt.default.bool.isRequired,transformScale:jt.default.number,className:jt.default.string,handle:jt.default.string,cancel:jt.default.string,droppingPosition:jt.default.shape({e:jt.default.object.isRequired,left:jt.default.number.isRequired,top:jt.default.number.isRequired})});si(xw,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty(xf,"__esModule",{value:!0});xf.default=void 0;var Ea=ZB(m),Pb=nw,XB=ww(rw),it=Ot,QB=Ei,LE=ww(Qg),JB=ww(is);function ww(e){return e&&e.__esModule?e:{default:e}}function vD(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(vD=function(r){return r?n:t})(e)}function ZB(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=vD(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function ir(e,t,n){return t=eV(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eV(e){var t=tV(e,"string");return typeof t=="symbol"?t:String(t)}function tV(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const FE="react-grid-layout";let bD=!1;try{bD=/firefox/i.test(navigator.userAgent)}catch{}class om extends Ea.Component{constructor(){super(...arguments),ir(this,"state",{activeDrag:null,layout:(0,it.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,it.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),ir(this,"dragEnterCounter",0),ir(this,"onDragStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,it.getLayoutItem)(a,t);if(l)return this.setState({oldDragItem:(0,it.cloneLayoutItem)(l),oldLayout:a}),this.props.onDragStart(a,l,l,null,i,s)}),ir(this,"onDrag",(t,n,r,o)=>{let{e:i,node:s}=o;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:u,preventCollision:f}=this.props,p=(0,it.getLayoutItem)(l,t);if(!p)return;const g={w:p.w,h:p.h,x:p.x,y:p.y,placeholder:!0,i:t},v=!0;l=(0,it.moveElement)(l,p,n,r,v,f,(0,it.compactType)(this.props),c,u),this.props.onDrag(l,a,p,g,i,s),this.setState({layout:u?l:(0,it.compact)(l,(0,it.compactType)(this.props),c),activeDrag:g})}),ir(this,"onDragStop",(t,n,r,o)=>{let{e:i,node:s}=o;if(!this.state.activeDrag)return;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:u,allowOverlap:f}=this.props,p=(0,it.getLayoutItem)(l,t);if(!p)return;const g=!0;l=(0,it.moveElement)(l,p,n,r,g,u,(0,it.compactType)(this.props),c,f);const v=f?l:(0,it.compact)(l,(0,it.compactType)(this.props),c);this.props.onDragStop(v,a,p,null,i,s);const{oldLayout:b}=this.state;this.setState({activeDrag:null,layout:v,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(v,b)}),ir(this,"onResizeStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,it.getLayoutItem)(a,t);l&&(this.setState({oldResizeItem:(0,it.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(a,l,l,null,i,s))}),ir(this,"onResize",(t,n,r,o)=>{let{e:i,node:s,size:a,handle:l}=o;const{oldResizeItem:c}=this.state;let{layout:u}=this.state;const{cols:f,preventCollision:p,allowOverlap:g}=this.props;let v=!1,b,x,w;const[_,S]=(0,it.withLayoutItem)(u,t,C=>{let P;return x=C.x,w=C.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(x=C.x+(C.w-n),n=C.x!==x&&x<0?C.w:n,x=x<0?0:x),["ne","n","nw"].indexOf(l)!==-1&&(w=C.y+(C.h-r),r=C.y!==w&&w<0?C.h:r,w=w<0?0:w),v=!0),p&&!g&&(P=(0,it.getAllCollisions)(u,{...C,w:n,h:r,x,y:w}).filter(M=>M.i!==C.i).length>0,P&&(w=C.y,r=C.h,x=C.x,n=C.w,v=!1)),C.w=n,C.h=r,C});if(!S)return;b=_,v&&(b=(0,it.moveElement)(_,S,x,w,!0,this.props.preventCollision,(0,it.compactType)(this.props),f,g));const R={w:S.w,h:S.h,x:S.x,y:S.y,static:!0,i:t};this.props.onResize(b,c,S,R,i,s),this.setState({layout:g?b:(0,it.compact)(b,(0,it.compactType)(this.props),f),activeDrag:R})}),ir(this,"onResizeStop",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a,oldResizeItem:l}=this.state,{cols:c,allowOverlap:u}=this.props,f=(0,it.getLayoutItem)(a,t),p=u?a:(0,it.compact)(a,(0,it.compactType)(this.props),c);this.props.onResizeStop(p,l,f,null,i,s);const{oldLayout:g}=this.state;this.setState({activeDrag:null,layout:p,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(p,g)}),ir(this,"onDragOver",t=>{var n;if(t.preventDefault(),t.stopPropagation(),bD&&!((n=t.nativeEvent.target)!==null&&n!==void 0&&n.classList.contains(FE)))return!1;const{droppingItem:r,onDropDragOver:o,margin:i,cols:s,rowHeight:a,maxRows:l,width:c,containerPadding:u,transformScale:f}=this.props,p=o==null?void 0:o(t);if(p===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const g={...r,...p},{layout:v}=this.state,{layerX:b,layerY:x}=t.nativeEvent,w={left:b/f,top:x/f,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:_,top:S}=this.state.droppingPosition;(_!=b||S!=x)&&this.setState({droppingPosition:w})}}else{const _={cols:s,margin:i,maxRows:l,rowHeight:a,containerWidth:c,containerPadding:u||i},S=(0,QB.calcXY)(_,x,b,g.w,g.h);this.setState({droppingDOMNode:Ea.createElement("div",{key:g.i}),droppingPosition:w,layout:[...v,{...g,x:S.x,y:S.y,static:!1,isDraggable:!0}]})}}),ir(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,o=(0,it.compact)(r.filter(i=>i.i!==t.i),(0,it.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),ir(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),ir(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),ir(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,o=r.find(i=>i.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,o,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,Pb.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,it.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,it.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,it.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,it.fastRGLPropsEqual)(this.props,t,Pb.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,o=n.layout;this.onLayoutMaybeChanged(r,o)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,it.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(t,n){n||(n=this.state.layout),(0,Pb.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:o,containerPadding:i,rowHeight:s,maxRows:a,useCSSTransforms:l,transformScale:c}=this.props;return Ea.createElement(LE.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:"react-grid-placeholder ".concat(this.state.resizing?"placeholder-resizing":""),containerWidth:n,cols:r,margin:o,containerPadding:i||o,maxRows:a,rowHeight:s,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},Ea.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,it.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:o,cols:i,margin:s,containerPadding:a,rowHeight:l,maxRows:c,isDraggable:u,isResizable:f,isBounded:p,useCSSTransforms:g,transformScale:v,draggableCancel:b,draggableHandle:x,resizeHandles:w,resizeHandle:_}=this.props,{mounted:S,droppingPosition:R}=this.state,C=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&u,P=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&f,A=r.resizeHandles||w,M=C&&p&&r.isBounded!==!1;return Ea.createElement(LE.default,{containerWidth:o,cols:i,margin:s,containerPadding:a||s,maxRows:c,rowHeight:l,cancel:b,handle:x,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:C,isResizable:P,isBounded:M,useCSSTransforms:g&&S,usePercentages:!S,transformScale:v,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?R:void 0,resizeHandles:A,resizeHandle:_},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,XB.default)(FE,t),s={height:this.containerHeight(),...n};return Ea.createElement("div",{ref:o,className:i,style:s,onDrop:r?this.onDrop:it.noop,onDragLeave:r?this.onDragLeave:it.noop,onDragEnter:r?this.onDragEnter:it.noop,onDragOver:r?this.onDragOver:it.noop},Ea.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}xf.default=om;ir(om,"displayName","ReactGridLayout");ir(om,"propTypes",JB.default);ir(om,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:it.noop,onDragStart:it.noop,onDrag:it.noop,onDragStop:it.noop,onResizeStart:it.noop,onResize:it.noop,onResizeStop:it.noop,onDrop:it.noop,onDropDragOver:it.noop});var im={},bl={};Object.defineProperty(bl,"__esModule",{value:!0});bl.findOrGenerateResponsiveLayout=oV;bl.getBreakpointFromWidth=nV;bl.getColsFromBreakpoint=rV;bl.sortBreakpoints=_w;var Nh=Ot;function nV(e,t){const n=_w(e);let r=n[0];for(let o=1,i=n.length;o<i;o++){const s=n[o];t>e[s]&&(r=s)}return r}function rV(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function oV(e,t,n,r,o,i){if(e[n])return(0,Nh.cloneLayout)(e[n]);let s=e[r];const a=_w(t),l=a.slice(a.indexOf(n));for(let c=0,u=l.length;c<u;c++){const f=l[c];if(e[f]){s=e[f];break}}return s=(0,Nh.cloneLayout)(s||[]),(0,Nh.compact)((0,Nh.correctBounds)(s,{cols:o}),i,o)}function _w(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(im,"__esModule",{value:!0});im.default=void 0;var zE=sV(m),Rr=yD(ua),Tb=nw,lc=Ot,Ra=bl,iV=yD(xf);function yD(e){return e&&e.__esModule?e:{default:e}}function xD(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(xD=function(r){return r?n:t})(e)}function sV(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=xD(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Ry(){return Ry=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ry.apply(this,arguments)}function og(e,t,n){return t=aV(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aV(e){var t=lV(e,"string");return typeof t=="symbol"?t:String(t)}function lV(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const jE=e=>Object.prototype.toString.call(e);function Lh(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class Sw extends zE.Component{constructor(){super(...arguments),og(this,"state",this.generateInitialState()),og(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:o}=this.props,i=(0,Ra.getBreakpointFromWidth)(n,t),s=(0,Ra.getColsFromBreakpoint)(i,o),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,Ra.findOrGenerateResponsiveLayout)(r,n,i,i,s,a),breakpoint:i,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,Tb.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,Ra.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,o,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,Tb.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,Tb.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:o,compactType:i}=this.props,s=this.props.breakpoint||(0,Ra.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,Ra.getColsFromBreakpoint)(s,r),c={...o};if(a!==s||t.breakpoints!==n||t.cols!==r){a in c||(c[a]=(0,lc.cloneLayout)(this.state.layout));let p=(0,Ra.findOrGenerateResponsiveLayout)(c,n,s,a,l,i);p=(0,lc.synchronizeLayoutWithChildren)(p,this.props.children,l,i,this.props.allowOverlap),c[s]=p,this.props.onLayoutChange(p,c),this.props.onBreakpointChange(s,l),this.setState({breakpoint:s,layout:p,cols:l})}const u=Lh(this.props.margin,s),f=Lh(this.props.containerPadding,s);this.props.onWidthChange(this.props.width,u,l,f)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:o,margin:i,containerPadding:s,onBreakpointChange:a,onLayoutChange:l,onWidthChange:c,...u}=this.props;return zE.createElement(iV.default,Ry({},u,{margin:Lh(i,this.state.breakpoint),containerPadding:Lh(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}im.default=Sw;og(Sw,"propTypes",{breakpoint:Rr.default.string,breakpoints:Rr.default.object,allowOverlap:Rr.default.bool,cols:Rr.default.object,margin:Rr.default.oneOfType([Rr.default.array,Rr.default.object]),containerPadding:Rr.default.oneOfType([Rr.default.array,Rr.default.object]),layouts(e,t){if(jE(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+jE(e[t]));Object.keys(e[t]).forEach(n=>{if(!(n in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,lc.validateLayout)(e.layouts[n],"layouts."+n)})},width:Rr.default.number.isRequired,onBreakpointChange:Rr.default.func,onLayoutChange:Rr.default.func,onWidthChange:Rr.default.func});og(Sw,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:lc.noop,onLayoutChange:lc.noop,onWidthChange:lc.noop});var Cw={},wD=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,i){return o[0]===n?(r=i,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,i=this.__entries__;o<i.length;o++){var s=i[o];n.call(r,s[1],s[0])}},t}()}(),Oy=typeof window<"u"&&typeof document<"u"&&window.document===document,ig=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),cV=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(ig):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),uV=2;function dV(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&a()}function s(){cV(i)}function a(){var l=Date.now();if(n){if(l-o<uV)return;r=!0}else n=!0,r=!1,setTimeout(s,t);o=l}return a}var fV=20,hV=["top","right","bottom","left","width","height","size","weight"],pV=typeof MutationObserver<"u",gV=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=dV(this.refresh.bind(this),fV)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!Oy||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),pV?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Oy||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=hV.some(function(i){return!!~r.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),_D=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},Mc=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||ig},SD=sm(0,0,0,0);function sg(e){return parseFloat(e)||0}function BE(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var i=e["border-"+o+"-width"];return r+sg(i)},0)}function mV(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var i=o[r],s=e["padding-"+i];n[i]=sg(s)}return n}function vV(e){var t=e.getBBox();return sm(0,0,t.width,t.height)}function bV(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return SD;var r=Mc(e).getComputedStyle(e),o=mV(r),i=o.left+o.right,s=o.top+o.bottom,a=sg(r.width),l=sg(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+i)!==t&&(a-=BE(r,"left","right")+i),Math.round(l+s)!==n&&(l-=BE(r,"top","bottom")+s)),!xV(e)){var c=Math.round(a+i)-t,u=Math.round(l+s)-n;Math.abs(c)!==1&&(a-=c),Math.abs(u)!==1&&(l-=u)}return sm(o.left,o.top,a,l)}var yV=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Mc(e).SVGGraphicsElement}:function(e){return e instanceof Mc(e).SVGElement&&typeof e.getBBox=="function"}}();function xV(e){return e===Mc(e).document.documentElement}function wV(e){return Oy?yV(e)?vV(e):bV(e):SD}function _V(e){var t=e.x,n=e.y,r=e.width,o=e.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,s=Object.create(i.prototype);return _D(s,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),s}function sm(e,t,n,r){return{x:e,y:t,width:n,height:r}}var SV=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=sm(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=wV(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),CV=function(){function e(t,n){var r=_V(n);_D(this,{target:t,contentRect:r})}return e}(),EV=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new wD,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Mc(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new SV(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Mc(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new CV(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),CD=typeof WeakMap<"u"?new WeakMap:new wD,ED=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=gV.getInstance(),r=new EV(t,n,this);CD.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){ED.prototype[e]=function(){var t;return(t=CD.get(this))[e].apply(t,arguments)}});var RV=function(){return typeof ig.ResizeObserver<"u"?ig.ResizeObserver:ED}();const OV=Object.freeze(Object.defineProperty({__proto__:null,default:RV},Symbol.toStringTag,{value:"Module"})),PV=Fx(OV);Object.defineProperty(Cw,"__esModule",{value:!0});Cw.default=NV;var Fh=kV(m),TV=Ew(ua),DV=Ew(PV),$V=Ew(rw);function Ew(e){return e&&e.__esModule?e:{default:e}}function RD(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(RD=function(r){return r?n:t})(e)}function kV(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=RD(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Py(){return Py=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Py.apply(this,arguments)}function Hl(e,t,n){return t=MV(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MV(e){var t=AV(e,"string");return typeof t=="symbol"?t:String(t)}function AV(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const IV="react-grid-layout";function NV(e){var t;return t=class extends Fh.Component{constructor(){super(...arguments),Hl(this,"state",{width:1280}),Hl(this,"elementRef",Fh.createRef()),Hl(this,"mounted",!1),Hl(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new DV.default(o=>{if(this.elementRef.current instanceof HTMLElement){const s=o[0].contentRect.width;this.setState({width:s})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...o}=this.props;return r&&!this.mounted?Fh.createElement("div",{className:(0,$V.default)(this.props.className,IV),style:this.props.style,ref:this.elementRef}):Fh.createElement(e,Py({innerRef:this.elementRef},o,this.state))}},Hl(t,"defaultProps",{measureBeforeMount:!1}),Hl(t,"propTypes",{measureBeforeMount:TV.default.bool}),t}(function(e){e.exports=xf.default,e.exports.utils=Ot,e.exports.calculateUtils=Ei,e.exports.Responsive=im.default,e.exports.Responsive.utils=bl,e.exports.WidthProvider=Cw.default})(FT);var VE=FT.exports;function na({children:e,className:t,text:n,onSave:r,type:o="input"}){const[i,s]=m.useState(!1),[a,l]=m.useState(n),c=Ie(p=>p.isDashboardEditing),u=p=>{p.stopPropagation(),c&&s(!0)};function f(){return o==="textarea"?O.jsx("textarea",{className:Pe(" grow px-2 py-1 text-sm bg-background outline-[0.5px] outline-dashed outline-primary/50 rounded-sm",t),onChange:p=>l(p.target.value),value:a,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:p=>{p.key==="Enter"&&p.shiftKey||(p.key==="Enter"||p.key==="Tab")&&(s(!1),r(a))}}):O.jsx("input",{onMouseDown:p=>p.stopPropagation(),type:"text",className:Pe("px-2 py-1 text-sm bg-background outline-[0.5px] outline-dashed outline-primary/50 rounded-sm",t),onChange:p=>l(p.target.value),value:a,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:p=>{(p.key==="Enter"||p.key==="Tab")&&(s(!1),r(a))}})}return O.jsx("div",{className:"flex",role:"editable",onDoubleClick:u,children:i?f():e})}/*!
|
|
110
110
|
* @kurkle/color v0.3.2
|
|
111
111
|
* https://github.com/kurkle/color#readme
|
|
112
112
|
* (c) 2023 Jukka Kurkela
|
|
@@ -129,7 +129,7 @@ Valid keys: `+JSON.stringify(Object.keys($),null," "));var q=ye(he,ae,le,se,ue+
|
|
|
129
129
|
* (c) 2017-2022 chartjs-plugin-datalabels contributors
|
|
130
130
|
* Released under the MIT license
|
|
131
131
|
*/var hO=function(){if(typeof window<"u"){if(window.devicePixelRatio)return window.devicePixelRatio;var e=window.screen;if(e)return(e.deviceXDPI||1)/(e.logicalXDPI||1)}return 1}(),sd={toTextLines:function(e){var t=[],n;for(e=[].concat(e);e.length;)n=e.pop(),typeof n=="string"?t.unshift.apply(t,n.split(`
|
|
132
|
-
`)):Array.isArray(n)?e.push.apply(e,n):Rt(e)||t.unshift(""+n);return t},textSize:function(e,t,n){var r=[].concat(t),o=r.length,i=e.font,s=0,a;for(e.font=n.string,a=0;a<o;++a)s=Math.max(e.measureText(r[a]).width,s);return e.font=i,{height:o*n.lineHeight,width:s}},bound:function(e,t,n){return Math.max(e,Math.min(t,n))},arrayDiff:function(e,t){var n=e.slice(),r=[],o,i,s,a;for(o=0,s=t.length;o<s;++o)a=t[o],i=n.indexOf(a),i===-1?r.push([a,1]):n.splice(i,1);for(o=0,s=n.length;o<s;++o)r.push([n[o],-1]);return r},rasterize:function(e){return Math.round(e*hO)/hO}};function Vb(e,t){var n=t.x,r=t.y;if(n===null)return{x:0,y:-1};if(r===null)return{x:1,y:0};var o=e.x-n,i=e.y-r,s=Math.sqrt(o*o+i*i);return{x:s?o/s:0,y:s?i/s:-1}}function VG(e,t,n,r,o){switch(o){case"center":n=r=0;break;case"bottom":n=0,r=1;break;case"right":n=1,r=0;break;case"left":n=-1,r=0;break;case"top":n=0,r=-1;break;case"start":n=-n,r=-r;break;case"end":break;default:o*=Math.PI/180,n=Math.cos(o),r=Math.sin(o);break}return{x:e,y:t,vx:n,vy:r}}var HG=0,S$=1,C$=2,E$=4,R$=8;function Zh(e,t,n){var r=HG;return e<n.left?r|=S$:e>n.right&&(r|=C$),t<n.top?r|=R$:t>n.bottom&&(r|=E$),r}function WG(e,t){for(var n=e.x0,r=e.y0,o=e.x1,i=e.y1,s=Zh(n,r,t),a=Zh(o,i,t),l,c,u;!(!(s|a)||s&a);)l=s||a,l&R$?(c=n+(o-n)*(t.top-r)/(i-r),u=t.top):l&E$?(c=n+(o-n)*(t.bottom-r)/(i-r),u=t.bottom):l&C$?(u=r+(i-r)*(t.right-n)/(o-n),c=t.right):l&S$&&(u=r+(i-r)*(t.left-n)/(o-n),c=t.left),l===s?(n=c,r=u,s=Zh(n,r,t)):(o=c,i=u,a=Zh(o,i,t));return{x0:n,x1:o,y0:r,y1:i}}function ep(e,t){var n=t.anchor,r=e,o,i;return t.clamp&&(r=WG(r,t.area)),n==="start"?(o=r.x0,i=r.y0):n==="end"?(o=r.x1,i=r.y1):(o=(r.x0+r.x1)/2,i=(r.y0+r.y1)/2),VG(o,i,e.vx,e.vy,t.align)}var tp={arc:function(e,t){var n=(e.startAngle+e.endAngle)/2,r=Math.cos(n),o=Math.sin(n),i=e.innerRadius,s=e.outerRadius;return ep({x0:e.x+r*i,y0:e.y+o*i,x1:e.x+r*s,y1:e.y+o*s,vx:r,vy:o},t)},point:function(e,t){var n=Vb(e,t.origin),r=n.x*e.options.radius,o=n.y*e.options.radius;return ep({x0:e.x-r,y0:e.y-o,x1:e.x+r,y1:e.y+o,vx:n.x,vy:n.y},t)},bar:function(e,t){var n=Vb(e,t.origin),r=e.x,o=e.y,i=0,s=0;return e.horizontal?(r=Math.min(e.x,e.base),i=Math.abs(e.base-e.x)):(o=Math.min(e.y,e.base),s=Math.abs(e.base-e.y)),ep({x0:r,y0:o+s,x1:r+i,y1:o,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=Vb(e,t.origin);return ep({x0:e.x,y0:e.y,x1:e.x+(e.width||0),y1:e.y+(e.height||0),vx:n.x,vy:n.y},t)}},rs=sd.rasterize;function UG(e){var t=e.borderWidth||0,n=e.padding,r=e.size.height,o=e.size.width,i=-o/2,s=-r/2;return{frame:{x:i-n.left-t,y:s-n.top-t,w:o+n.width+t*2,h:r+n.height+t*2},text:{x:i,y:s,w:o,h:r}}}function qG(e,t){var n=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!n)return null;if(n.xCenter!==void 0&&n.yCenter!==void 0)return{x:n.xCenter,y:n.yCenter};var r=n.getBasePixel();return e.horizontal?{x:r,y:null}:{x:null,y:r}}function GG(e){return e instanceof ic?tp.arc:e instanceof od?tp.point:e instanceof id?tp.bar:tp.fallback}function YG(e,t,n,r,o,i){var s=Math.PI/2;if(i){var a=Math.min(i,o/2,r/2),l=t+a,c=n+a,u=t+r-a,f=n+o-a;e.moveTo(t,c),l<u&&c<f?(e.arc(l,c,a,-Math.PI,-s),e.arc(u,c,a,-s,0),e.arc(u,f,a,0,s),e.arc(l,f,a,s,Math.PI)):l<u?(e.moveTo(l,n),e.arc(u,c,a,-s,s),e.arc(l,c,a,s,Math.PI+s)):c<f?(e.arc(l,c,a,-Math.PI,0),e.arc(l,f,a,0,Math.PI)):e.arc(l,c,a,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,r,o)}function KG(e,t,n){var r=n.backgroundColor,o=n.borderColor,i=n.borderWidth;!r&&(!o||!i)||(e.beginPath(),YG(e,rs(t.x)+i/2,rs(t.y)+i/2,rs(t.w)-i,rs(t.h)-i,n.borderRadius),e.closePath(),r&&(e.fillStyle=r,e.fill()),o&&i&&(e.strokeStyle=o,e.lineWidth=i,e.lineJoin="miter",e.stroke()))}function XG(e,t,n){var r=n.lineHeight,o=e.w,i=e.x,s=e.y+r/2;return t==="center"?i+=o/2:(t==="end"||t==="right")&&(i+=o),{h:r,w:o,x:i,y:s}}function QG(e,t,n){var r=e.shadowBlur,o=n.stroked,i=rs(n.x),s=rs(n.y),a=rs(n.w);o&&e.strokeText(t,i,s,a),n.filled&&(r&&o&&(e.shadowBlur=0),e.fillText(t,i,s,a),r&&o&&(e.shadowBlur=r))}function JG(e,t,n,r){var o=r.textAlign,i=r.color,s=!!i,a=r.font,l=t.length,c=r.textStrokeColor,u=r.textStrokeWidth,f=c&&u,p;if(!(!l||!s&&!f))for(n=XG(n,o,a),e.font=a.string,e.textAlign=o,e.textBaseline="middle",e.shadowBlur=r.textShadowBlur,e.shadowColor=r.textShadowColor,s&&(e.fillStyle=i),f&&(e.lineJoin="round",e.lineWidth=u,e.strokeStyle=c),p=0,l=t.length;p<l;++p)QG(e,t[p],{stroked:f,filled:s,w:n.w,x:n.x,y:n.y+n.h*p})}var O$=function(e,t,n,r){var o=this;o._config=e,o._index=r,o._model=null,o._rects=null,o._ctx=t,o._el=n};xi(O$.prototype,{_modelize:function(e,t,n,r){var o=this,i=o._index,s=kn(hn([n.font,{}],r,i)),a=hn([n.color,_n.color],r,i);return{align:hn([n.align,"center"],r,i),anchor:hn([n.anchor,"center"],r,i),area:r.chart.chartArea,backgroundColor:hn([n.backgroundColor,null],r,i),borderColor:hn([n.borderColor,null],r,i),borderRadius:hn([n.borderRadius,0],r,i),borderWidth:hn([n.borderWidth,0],r,i),clamp:hn([n.clamp,!1],r,i),clip:hn([n.clip,!1],r,i),color:a,display:e,font:s,lines:t,offset:hn([n.offset,4],r,i),opacity:hn([n.opacity,1],r,i),origin:qG(o._el,r),padding:er(hn([n.padding,4],r,i)),positioner:GG(o._el),rotation:hn([n.rotation,0],r,i)*(Math.PI/180),size:sd.textSize(o._ctx,t,s),textAlign:hn([n.textAlign,"start"],r,i),textShadowBlur:hn([n.textShadowBlur,0],r,i),textShadowColor:hn([n.textShadowColor,a],r,i),textStrokeColor:hn([n.textStrokeColor,a],r,i),textStrokeWidth:hn([n.textStrokeWidth,0],r,i)}},update:function(e){var t=this,n=null,r=null,o=t._index,i=t._config,s,a,l,c=hn([i.display,!0],e,o);c&&(s=e.dataset.data[o],a=dt(en(i.formatter,[s,e]),s),l=Rt(a)?[]:sd.toTextLines(a),l.length&&(n=t._modelize(c,l,i,e),r=UG(n))),t._model=n,t._rects=r},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(e,t){var n=this,r=e.ctx,o=n._model,i=n._rects,s;this.visible()&&(r.save(),o.clip&&(s=o.area,r.beginPath(),r.rect(s.left,s.top,s.right-s.left,s.bottom-s.top),r.clip()),r.globalAlpha=sd.bound(0,o.opacity,1),r.translate(rs(t.x),rs(t.y)),r.rotate(o.rotation),KG(r,i.frame,o),JG(r,o.lines,i.text,o),r.restore())}});var ZG=Number.MIN_SAFE_INTEGER||-9007199254740991,eY=Number.MAX_SAFE_INTEGER||9007199254740991;function Du(e,t,n){var r=Math.cos(n),o=Math.sin(n),i=t.x,s=t.y;return{x:i+r*(e.x-i)-o*(e.y-s),y:s+o*(e.x-i)+r*(e.y-s)}}function pO(e,t){var n=eY,r=ZG,o=t.origin,i,s,a,l,c;for(i=0;i<e.length;++i)s=e[i],a=s.x-o.x,l=s.y-o.y,c=t.vx*a+t.vy*l,n=Math.min(n,c),r=Math.max(r,c);return{min:n,max:r}}function np(e,t){var n=t.x-e.x,r=t.y-e.y,o=Math.sqrt(n*n+r*r);return{vx:(t.x-e.x)/o,vy:(t.y-e.y)/o,origin:e,ln:o}}var P$=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};xi(P$.prototype,{center:function(){var e=this._rect;return{x:e.x+e.w/2,y:e.y+e.h/2}},update:function(e,t,n){this._rotation=n,this._rect={x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h}},contains:function(e){var t=this,n=1,r=t._rect;return e=Du(e,t.center(),-t._rotation),!(e.x<r.x-n||e.y<r.y-n||e.x>r.x+r.w+n*2||e.y>r.y+r.h+n*2)},intersects:function(e){var t=this._points(),n=e._points(),r=[np(t[0],t[1]),np(t[0],t[3])],o,i,s;for(this._rotation!==e._rotation&&r.push(np(n[0],n[1]),np(n[0],n[3])),o=0;o<r.length;++o)if(i=pO(t,r[o]),s=pO(n,r[o]),i.max<s.min||s.max<i.min)return!1;return!0},_points:function(){var e=this,t=e._rect,n=e._rotation,r=e.center();return[Du({x:t.x,y:t.y},r,n),Du({x:t.x+t.w,y:t.y},r,n),Du({x:t.x+t.w,y:t.y+t.h},r,n),Du({x:t.x,y:t.y+t.h},r,n)]}});function T$(e,t,n){var r=t.positioner(e,t),o=r.vx,i=r.vy;if(!o&&!i)return{x:r.x,y:r.y};var s=n.w,a=n.h,l=t.rotation,c=Math.abs(s/2*Math.cos(l))+Math.abs(a/2*Math.sin(l)),u=Math.abs(s/2*Math.sin(l))+Math.abs(a/2*Math.cos(l)),f=1/Math.max(Math.abs(o),Math.abs(i));return c*=o*f,u*=i*f,c+=t.offset*o,u+=t.offset*i,{x:r.x+c,y:r.y+u}}function tY(e,t){var n,r,o,i;for(n=e.length-1;n>=0;--n)for(o=e[n].$layout,r=n-1;r>=0&&o._visible;--r)i=e[r].$layout,i._visible&&o._box.intersects(i._box)&&t(o,i);return e}function nY(e){var t,n,r,o,i,s,a;for(t=0,n=e.length;t<n;++t)r=e[t],o=r.$layout,o._visible&&(a=new Proxy(r._el,{get:(l,c)=>l.getProps([c],!0)[c]}),i=r.geometry(),s=T$(a,r.model(),i),o._box.update(s,i,r.rotation()));return tY(e,function(l,c){var u=l._hidable,f=c._hidable;u&&f||f?c._visible=!1:u&&(l._visible=!1)})}var ad={prepare:function(e){var t=[],n,r,o,i,s;for(n=0,o=e.length;n<o;++n)for(r=0,i=e[n].length;r<i;++r)s=e[n][r],t.push(s),s.$layout={_box:new P$,_hidable:!1,_visible:!0,_set:n,_idx:s._index};return t.sort(function(a,l){var c=a.$layout,u=l.$layout;return c._idx===u._idx?u._set-c._set:u._idx-c._idx}),this.update(t),t},update:function(e){var t=!1,n,r,o,i,s;for(n=0,r=e.length;n<r;++n)o=e[n],i=o.model(),s=o.$layout,s._hidable=i&&i.display==="auto",s._visible=o.visible(),t|=s._hidable;t&&nY(e)},lookup:function(e,t){var n,r;for(n=e.length-1;n>=0;--n)if(r=e[n].$layout,r&&r._visible&&r._box.contains(t))return e[n];return null},draw:function(e,t){var n,r,o,i,s,a;for(n=0,r=t.length;n<r;++n)o=t[n],i=o.$layout,i._visible&&(s=o.geometry(),a=T$(o._el,o.model(),s),i._box.update(a,s,o.rotation()),o.draw(e,a))}},rY=function(e){if(Rt(e))return null;var t=e,n,r,o;if(Dt(e))if(!Rt(e.label))t=e.label;else if(!Rt(e.r))t=e.r;else for(t="",n=Object.keys(e),o=0,r=n.length;o<r;++o)t+=(o!==0?", ":"")+n[o]+": "+e[n[o]];return""+t},oY={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:rY,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},Tr="$datalabels",D$="$default";function iY(e,t){var n=e.datalabels,r={},o=[],i,s;return n===!1?null:(n===!0&&(n={}),t=xi({},[t,n]),i=t.labels||{},s=Object.keys(i),delete t.labels,s.length?s.forEach(function(a){i[a]&&o.push(xi({},[t,i[a],{_key:a}]))}):o.push(t),r=o.reduce(function(a,l){return Yt(l.listeners||{},function(c,u){a[u]=a[u]||{},a[u][l._key||D$]=c}),delete l.listeners,a},{}),{labels:o,listeners:r})}function Wy(e,t,n,r){if(t){var o=n.$context,i=n.$groups,s;t[i._set]&&(s=t[i._set][i._key],s&&en(s,[o,r])===!0&&(e[Tr]._dirty=!0,n.update(o)))}}function sY(e,t,n,r,o){var i,s;!n&&!r||(n?r?n!==r&&(s=i=!0):s=!0:i=!0,s&&Wy(e,t.leave,n,o),i&&Wy(e,t.enter,r,o))}function aY(e,t){var n=e[Tr],r=n._listeners,o,i;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")i=ad.lookup(n._labels,t);else if(t.type!=="mouseout")return;o=n._hovered,n._hovered=i,sY(e,r,o,i,t)}}function lY(e,t){var n=e[Tr],r=n._listeners.click,o=r&&ad.lookup(n._labels,t);o&&Wy(e,r,o,t)}var cY={id:"datalabels",defaults:oY,beforeInit:function(e){e[Tr]={_actives:[]}},beforeUpdate:function(e){var t=e[Tr];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,o=e[Tr],i=o._datasets[r]=[],s=e.isDatasetVisible(r),a=e.data.datasets[r],l=iY(a,n),c=t.meta.data||[],u=e.ctx,f,p,g,v,b,x,w,_;for(u.save(),f=0,g=c.length;f<g;++f)if(w=c[f],w[Tr]=[],s&&w&&e.getDataVisibility(f)&&!w.skip)for(p=0,v=l.labels.length;p<v;++p)b=l.labels[p],x=b._key,_=new O$(b,u,w,f),_.$groups={_set:r,_key:x||D$},_.$context={active:!1,chart:e,dataIndex:f,dataset:a,datasetIndex:r},_.update(_.$context),w[Tr].push(_),i.push(_);u.restore(),xi(o._listeners,l.listeners,{merger:function(S,R,C){R[S]=R[S]||{},R[S][t.index]=C[S],o._listened=!0}})},afterUpdate:function(e){e[Tr]._labels=ad.prepare(e[Tr]._datasets)},afterDatasetsDraw:function(e){ad.draw(e,e[Tr]._labels)},beforeEvent:function(e,t){if(e[Tr]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":aY(e,n);break;case"click":lY(e,n);break}}},afterEvent:function(e){var t=e[Tr],n=t._actives,r=t._actives=e.getActiveElements(),o=sd.arrayDiff(n,r),i,s,a,l,c,u,f;for(i=0,s=o.length;i<s;++i)if(c=o[i],c[1])for(f=c[0].element[Tr]||[],a=0,l=f.length;a<l;++a)u=f[a],u.$context.active=c[1]===1,u.update(u.$context);(t._dirty||o.length)&&(ad.update(t._labels),e.render()),delete t._dirty}};Po.register(...BG);Po.register(cY);function Hw({cfg:e,onDatapointClick:t}){var a;const n=m.useRef(null),[r,o]=m.useState(),i=Ie(l=>l.themeStyle);m.useEffect(()=>{var u,f,p,g;(f=(u=i==null?void 0:i.chart)==null?void 0:u.font)!=null&&f.family&&(Po.defaults.font={...Po.defaults.font,...(p=i==null?void 0:i.chart)==null?void 0:p.font}),e.options&&(e.options.responsive=!0,e.options.maintainAspectRatio=!1);const l=(g=n==null?void 0:n.current)==null?void 0:g.getContext("2d");if(!l)return;let c;try{c=new Po(l,e),o(c)}catch(v){console.log("error creating chart",v)}return()=>{c&&c.destroy()}},[(a=i==null?void 0:i.chart)==null?void 0:a.font]);function s(l){var u,f;if(!r)return;const c=r==null?void 0:r.getElementsAtEventForMode(l,"nearest",{intersect:!0},!0);if(c&&c.length>0){const p=c[0].datasetIndex,g=c[0].index,v=(f=(u=c[0].element)==null?void 0:u.$context)==null?void 0:f.raw;t==null||t(r,p,g,v)}}return O.jsx("div",{onClick:s,className:"relative h-[99%]",children:O.jsx("canvas",{ref:n})})}function zr(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var uY=["color"],$$=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,uY);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),dY=["color"],fY=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,dY);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),hY=["color"],pY=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,hY);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M5 2V1H10V2H5ZM4.75 0C4.33579 0 4 0.335786 4 0.75V1H3.5C2.67157 1 2 1.67157 2 2.5V12.5C2 13.3284 2.67157 14 3.5 14H7V13H3.5C3.22386 13 3 12.7761 3 12.5V2.5C3 2.22386 3.22386 2 3.5 2H4V2.25C4 2.66421 4.33579 3 4.75 3H10.25C10.6642 3 11 2.66421 11 2.25V2H11.5C11.7761 2 12 2.22386 12 2.5V7H13V2.5C13 1.67157 12.3284 1 11.5 1H11V0.75C11 0.335786 10.6642 0 10.25 0H4.75ZM9 8.5C9 8.77614 8.77614 9 8.5 9C8.22386 9 8 8.77614 8 8.5C8 8.22386 8.22386 8 8.5 8C8.77614 8 9 8.22386 9 8.5ZM10.5 9C10.7761 9 11 8.77614 11 8.5C11 8.22386 10.7761 8 10.5 8C10.2239 8 10 8.22386 10 8.5C10 8.77614 10.2239 9 10.5 9ZM13 8.5C13 8.77614 12.7761 9 12.5 9C12.2239 9 12 8.77614 12 8.5C12 8.22386 12.2239 8 12.5 8C12.7761 8 13 8.22386 13 8.5ZM14.5 9C14.7761 9 15 8.77614 15 8.5C15 8.22386 14.7761 8 14.5 8C14.2239 8 14 8.22386 14 8.5C14 8.77614 14.2239 9 14.5 9ZM15 10.5C15 10.7761 14.7761 11 14.5 11C14.2239 11 14 10.7761 14 10.5C14 10.2239 14.2239 10 14.5 10C14.7761 10 15 10.2239 15 10.5ZM14.5 13C14.7761 13 15 12.7761 15 12.5C15 12.2239 14.7761 12 14.5 12C14.2239 12 14 12.2239 14 12.5C14 12.7761 14.2239 13 14.5 13ZM14.5 15C14.7761 15 15 14.7761 15 14.5C15 14.2239 14.7761 14 14.5 14C14.2239 14 14 14.2239 14 14.5C14 14.7761 14.2239 15 14.5 15ZM8.5 11C8.77614 11 9 10.7761 9 10.5C9 10.2239 8.77614 10 8.5 10C8.22386 10 8 10.2239 8 10.5C8 10.7761 8.22386 11 8.5 11ZM9 12.5C9 12.7761 8.77614 13 8.5 13C8.22386 13 8 12.7761 8 12.5C8 12.2239 8.22386 12 8.5 12C8.77614 12 9 12.2239 9 12.5ZM8.5 15C8.77614 15 9 14.7761 9 14.5C9 14.2239 8.77614 14 8.5 14C8.22386 14 8 14.2239 8 14.5C8 14.7761 8.22386 15 8.5 15ZM11 14.5C11 14.7761 10.7761 15 10.5 15C10.2239 15 10 14.7761 10 14.5C10 14.2239 10.2239 14 10.5 14C10.7761 14 11 14.2239 11 14.5ZM12.5 15C12.7761 15 13 14.7761 13 14.5C13 14.2239 12.7761 14 12.5 14C12.2239 14 12 14.2239 12 14.5C12 14.7761 12.2239 15 12.5 15Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),gY=["color"],k$=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,gY);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),mY=["color"],vY=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,mY);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z",fill:r}))}),bY=["color"],yY=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,bY);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M14.7649 6.07596C14.9991 6.22231 15.0703 6.53079 14.9239 6.76495C14.4849 7.46743 13.9632 8.10645 13.3702 8.66305L14.5712 9.86406C14.7664 10.0593 14.7664 10.3759 14.5712 10.5712C14.3759 10.7664 14.0593 10.7664 13.8641 10.5712L12.6011 9.30817C11.805 9.90283 10.9089 10.3621 9.93375 10.651L10.383 12.3277C10.4544 12.5944 10.2961 12.8685 10.0294 12.94C9.76267 13.0115 9.4885 12.8532 9.41704 12.5865L8.95917 10.8775C8.48743 10.958 8.00036 10.9999 7.50001 10.9999C6.99965 10.9999 6.51257 10.958 6.04082 10.8775L5.58299 12.5864C5.51153 12.8532 5.23737 13.0115 4.97064 12.94C4.7039 12.8686 4.5456 12.5944 4.61706 12.3277L5.06625 10.651C4.09111 10.3621 3.19503 9.90282 2.3989 9.30815L1.1359 10.5712C0.940638 10.7664 0.624058 10.7664 0.428798 10.5712C0.233537 10.3759 0.233537 10.0593 0.428798 9.86405L1.62982 8.66303C1.03682 8.10643 0.515113 7.46742 0.0760677 6.76495C-0.0702867 6.53079 0.000898544 6.22231 0.235065 6.07596C0.469231 5.9296 0.777703 6.00079 0.924058 6.23496C1.40354 7.00213 1.989 7.68057 2.66233 8.2427C2.67315 8.25096 2.6837 8.25972 2.69397 8.26898C4.00897 9.35527 5.65537 9.99991 7.50001 9.99991C10.3078 9.99991 12.6564 8.5063 14.076 6.23495C14.2223 6.00079 14.5308 5.9296 14.7649 6.07596Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),xY=["color"],wY=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,xY);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),_Y=["color"],SY=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,_Y);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),CY=["color"],M$=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,CY);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),EY=["color"],RY=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,EY);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M3.24182 2.32181C3.3919 2.23132 3.5784 2.22601 3.73338 2.30781L12.7334 7.05781C12.8974 7.14436 13 7.31457 13 7.5C13 7.68543 12.8974 7.85564 12.7334 7.94219L3.73338 12.6922C3.5784 12.774 3.3919 12.7687 3.24182 12.6782C3.09175 12.5877 3 12.4252 3 12.25V2.75C3 2.57476 3.09175 2.4123 3.24182 2.32181ZM4 3.57925V11.4207L11.4288 7.5L4 3.57925Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),OY=["color"],PY=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,OY);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M10.3004 7.49991C10.3004 8.4943 9.49426 9.30041 8.49988 9.30041C7.50549 9.30041 6.69938 8.4943 6.69938 7.49991C6.69938 6.50553 7.50549 5.69942 8.49988 5.69942C9.49426 5.69942 10.3004 6.50553 10.3004 7.49991ZM11.205 8C10.9699 9.28029 9.84816 10.2504 8.49988 10.2504C7.1516 10.2504 6.0299 9.28029 5.79473 8H0.5C0.223858 8 0 7.77614 0 7.5C0 7.22386 0.223858 7 0.5 7H5.7947C6.0298 5.71962 7.15154 4.74942 8.49988 4.74942C9.84822 4.74942 10.97 5.71962 11.2051 7H14.5C14.7761 7 15 7.22386 15 7.5C15 7.77614 14.7761 8 14.5 8H11.205Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),TY=["color"],DY=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,TY);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M2 3C2 2.44772 2.44772 2 3 2H12C12.5523 2 13 2.44772 13 3V12C13 12.5523 12.5523 13 12 13H3C2.44772 13 2 12.5523 2 12V3ZM12 3H3V12H12V3Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),$Y=["color"],Ww=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,$Y);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:r}))}),kY=["color"],Uw=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,kY);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:r}))});let rp;const MY=new Uint8Array(16);function AY(){if(!rp&&(rp=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!rp))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return rp(MY)}const Qn=[];for(let e=0;e<256;++e)Qn.push((e+256).toString(16).slice(1));function IY(e,t=0){return Qn[e[t+0]]+Qn[e[t+1]]+Qn[e[t+2]]+Qn[e[t+3]]+"-"+Qn[e[t+4]]+Qn[e[t+5]]+"-"+Qn[e[t+6]]+Qn[e[t+7]]+"-"+Qn[e[t+8]]+Qn[e[t+9]]+"-"+Qn[e[t+10]]+Qn[e[t+11]]+Qn[e[t+12]]+Qn[e[t+13]]+Qn[e[t+14]]+Qn[e[t+15]]}const NY=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),gO={randomUUID:NY};function dl(e,t,n){if(gO.randomUUID&&!t&&!e)return gO.randomUUID();e=e||{};const r=e.random||(e.rng||AY)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let o=0;o<16;++o)t[n+o]=r[o];return t}return IY(r)}const $r=XT()(r2((e,t)=>({isShowingVisual:!0,runSql:!1,sqlGen:{},sql:"",isSqlRunning:!1,queryResultColumns:[],showFilters:!1,applyFilters:!1,filterValues:[{filterId:"sample-filter-id",valueType:"string",name:"",operation:"in",values:[""]}],card:{id:dl(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:dl(),cards:[],activeCardId:""},actions:{setChartOrientation:n=>{e(r=>{var s,a,l,c,u,f;const o=r.card.preferences;let i={};((s=o==null?void 0:o.chartOptions)==null?void 0:s.indexAxis)!==n&&(i={x:(l=(a=o==null?void 0:o.chartOptions)==null?void 0:a.scales)==null?void 0:l.y,y:(u=(c=o==null?void 0:o.chartOptions)==null?void 0:c.scales)==null?void 0:u.x}),r.card.preferences={...o,chartOptions:{...o==null?void 0:o.chartOptions,scales:{...(f=o==null?void 0:o.chartOptions)==null?void 0:f.scales,...i},indexAxis:n}}})},setCustomVisualCode:n=>{e(r=>{r.card.preferences={...r.card.preferences,customVisualCode:n}})},setNumberFormat:(n,r,o,i)=>{e(s=>{var a,l,c;s.card.preferences={...(a=s.card)==null?void 0:a.preferences,formatNumber:{...(c=(l=s.card)==null?void 0:l.preferences)==null?void 0:c.formatNumber,decimalPlaces:n,currency:r,locale:o,suffix:i,enabled:!0}}})},setColorRanges:n=>{e(r=>{var o,i;r.card.preferences={...r.card.preferences,formatNumber:{...(i=(o=r.card)==null?void 0:o.preferences)==null?void 0:i.formatNumber,colorRanges:n}}})},setQueryError:n=>{e(r=>{r.queryError=n})},setQueryResultColumns:n=>{e(r=>{r.queryResultColumns=n})},setCardPreferences:n=>{e(r=>{r.card.preferences=n})},setFilterOnClickColumnIndex:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClickColumnIndex:n}})},setFilterOnClickField:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClick:!0,filterOnClickField:n}})},setCardRefreshInterval:n=>{e(r=>{r.card.refreshInterval=n})},setIsShowingVisual:n=>{e({isShowingVisual:n})},setRunSql:n=>{e({runSql:n})},setIsSqlRunning:n=>{e({isSqlRunning:n})},setFrame:n=>{e({frame:n})},setCard:n=>{e({card:n})},setCardType:n=>{e(r=>{var o;r.card.type=n,n==="range"&&(r.card.preferences={...r.card.preferences,chartOptions:{...(o=r.card.preferences)==null?void 0:o.chartOptions,indexAxis:"y"}})})},setCardSql:n=>{e(r=>{r.card.sql=n})},setCardPython:n=>{e(r=>{r.card.python=n})},setPythonStdOut:n=>{e(r=>{r.pythonStdOut=n})},setCardCustomCfg:n=>{e(r=>{r.card.customCfg=n})},setCardCfg:n=>{e(r=>{r.card.cfg=n})},setShowFilters:n=>{e(r=>{r.showFilters=n})},setApplyFilters:n=>{e(r=>{r.applyFilters=n})},setFilterValues:n=>{e(r=>{r.filterValues=n})},setSqlGen:n=>{e(r=>{r.sqlGen=n})},setSqlGenMeasure:(n,r)=>{e(o=>{o.sqlGen.measures=[...o.sqlGen.measures||[],{name:n,calc:r}]})},setSqlGenDimension:n=>{e(r=>{r.sqlGen.dimensions=[...r.sqlGen.dimensions||[],n]})},setCardData:n=>{e(r=>{r.card.data=n})},setSelectedConnectionId:n=>{var r,o;e(i=>{i.selectedConnectionId=n,i.card.connectionId=n}),(o=(r=t()).onConnectionChange)==null||o.call(r,n)},setSelectedDatabaseName:n=>{var r,o;e(i=>{i.selectedDatabaseName=n,i.card.lastSelectedDatabase=n}),(o=(r=t()).onDatabaseChange)==null||o.call(r,n)},setSelectedSchemaName:n=>{var r,o;e(i=>{i.selectedSchemaName=n,i.card.lastSelectedSchema=n}),(o=(r=t()).onSchemaChange)==null||o.call(r,n)},setSelectedTableName:n=>{var r,o;e(i=>{i.selectedTableName=n,i.card.lastSelectedTable=n}),(o=(r=t()).onTableChange)==null||o.call(r,n)},setCurrentColumns:n=>{e(r=>{r.currentColumns=n})},setOnConnectionChange:n=>{e({onConnectionChange:n})},setOnDatabaseChange:n=>{e({onDatabaseChange:n})},setOnSchemaChange:n=>{e({onSchemaChange:n})},setOnTableChange:n=>{e({onTableChange:n})},setOnSave:n=>{e({onSave:n})},setOnClose:n=>{e({onClose:n})}}}))),fm=()=>$r(e=>e.actions);function LY(e,t,n){var l,c,u,f;const r=n==null?void 0:n.datasetOptions,o=Ie.getState().themeStyle,i=(c=(l=o==null?void 0:o.chart)==null?void 0:l.dataset)==null?void 0:c.backgroundColor,s=(f=(u=o==null?void 0:o.chart)==null?void 0:u.dataset)==null?void 0:f.borderColor;return e.map((p,g)=>{var _;const v=r==null?void 0:r.find(S=>S.idx===g),b=i==null?void 0:i[g%i.length],x=s==null?void 0:s[g%s.length];return{label:p.charAt(0).toUpperCase()+p.slice(1),data:t.map(S=>S[p]),...v,datalabels:{...v==null?void 0:v.datalabels,color:FY((_=v==null?void 0:v.datalabels)==null?void 0:_.align,b)},backgroundColor:b,borderColor:x}})}function FY(e,t){return md(e==="end"||e==="start"?gd():t)}function zY(e){var a,l,c,u;const{metricKeys:t,dimensionKeys:n}=ar(e);let r=[];const o=Ie.getState().themeStyle,i=(l=(a=o==null?void 0:o.chart)==null?void 0:a.dataset)==null?void 0:l.backgroundColor,s=(u=(c=o==null?void 0:o.chart)==null?void 0:c.dataset)==null?void 0:u.borderColor;if((n==null?void 0:n.length)===1){const f=e.map(p=>({x:p[t[0]],y:p[t[1]],r:p[t[2]],label:p[n==null?void 0:n[0]]}));r=[{label:n==null?void 0:n[0],data:f}]}return(n==null?void 0:n.length)>1&&(r=[...new Set(e.map(p=>p[n==null?void 0:n[1]]))].map((p,g)=>{const v=e.filter(b=>b[n==null?void 0:n[1]]===p);return{label:p,data:v.map(b=>({x:b[t[0]],y:b[t[1]],r:b[t[2]],label:b[n==null?void 0:n[0]]})),backgroundColor:i==null?void 0:i[g%i.length],borderColor:s==null?void 0:s[g%s.length]}})),r}function jY(e){var c,u,f,p;const{dimensionKeys:t,metricKeys:n}=ar(e),r=Ie.getState().themeStyle,o=(u=(c=r==null?void 0:r.chart)==null?void 0:c.dataset)==null?void 0:u.backgroundColor,i=(p=(f=r==null?void 0:r.chart)==null?void 0:f.dataset)==null?void 0:p.borderColor,s=t==null?void 0:t[1];return[...new Set(e.map(g=>g==null?void 0:g[s]))].map((g,v)=>({label:g,data:e.filter(b=>(b==null?void 0:b[s])===g).map(b=>[b==null?void 0:b[n[0]],b==null?void 0:b[n[1]],b==null?void 0:b[n[2]]]),backgroundColor:o==null?void 0:o[v%o.length],borderColor:i==null?void 0:i[v%i.length],borderSkipped:!1}))}function BY(e,t){var s,a,l,c;const n=Ie.getState().themeStyle,r=(a=(s=n==null?void 0:n.chart)==null?void 0:s.dataset)==null?void 0:a.backgroundColor,o=(c=(l=n==null?void 0:n.chart)==null?void 0:l.dataset)==null?void 0:c.borderColor;return e.map(u=>({label:u.charAt(0).toUpperCase()+u.slice(1),data:t.map(f=>f[u]),backgroundColor:t.map((f,p)=>r==null?void 0:r[p%r.length]),borderColor:t.map((f,p)=>o==null?void 0:o[p%o.length])}))}function VY(e){let t=-1,n=0;return e.forEach((r,o)=>{const i=Object.keys(r).length;i>n&&(t=o,n=i)}),t}function ar(e){if(e.length===0)return{keys:[],dimensionKeys:[],metricKeys:[]};const t=VY(e),n=Object.keys(e[t]),r=n.filter(i=>{var s,a,l,c,u,f,p,g;return!!(typeof((s=e==null?void 0:e[t])==null?void 0:s[i])&&typeof((a=e==null?void 0:e[t])==null?void 0:a[i])=="string"||typeof((l=e==null?void 0:e[0])==null?void 0:l[i])&&typeof((c=e==null?void 0:e[0])==null?void 0:c[i])=="string"||typeof((u=e==null?void 0:e[1])==null?void 0:u[i])&&typeof((f=e==null?void 0:e[1])==null?void 0:f[i])=="string"||typeof((p=e==null?void 0:e[2])==null?void 0:p[i])&&typeof((g=e==null?void 0:e[2])==null?void 0:g[i])=="string")});r.length===0&&r.push(n[0]);const o=n.filter(i=>{var s,a;return((s=e==null?void 0:e[t])==null?void 0:s[i])===+((a=e==null?void 0:e[t])==null?void 0:a[i])});return{keys:n,dimensionKeys:r,metricKeys:o}}function Vp(e,t){var r;const n=(r=t==null?void 0:t.data)==null?void 0:r.datasets;return n&&n.length>0?e.map((i,s)=>({...i,...n[s],data:i.data,label:i.label})):e}function gg({dataArray:e,groupKey:t,pivotKey:n,valueKey:r}){const o=e.reduce((i,s)=>{const a=s[t],l=s[n],c=s[r];return i[a]||(i[a]={[t]:a}),i[a][l]=c,i},{});return Object.values(o)}function Yi(e,t){var s;const n=Ie.getState().themeStyle,r=(s=n==null?void 0:n.chart)==null?void 0:s.options,o=os.cloneDeep(r);return os.merge(o,e,t)}function Uy(e,t){return e.map(n=>n[t]?n[t]:"BLANK")}/**
|
|
132
|
+
`)):Array.isArray(n)?e.push.apply(e,n):Rt(e)||t.unshift(""+n);return t},textSize:function(e,t,n){var r=[].concat(t),o=r.length,i=e.font,s=0,a;for(e.font=n.string,a=0;a<o;++a)s=Math.max(e.measureText(r[a]).width,s);return e.font=i,{height:o*n.lineHeight,width:s}},bound:function(e,t,n){return Math.max(e,Math.min(t,n))},arrayDiff:function(e,t){var n=e.slice(),r=[],o,i,s,a;for(o=0,s=t.length;o<s;++o)a=t[o],i=n.indexOf(a),i===-1?r.push([a,1]):n.splice(i,1);for(o=0,s=n.length;o<s;++o)r.push([n[o],-1]);return r},rasterize:function(e){return Math.round(e*hO)/hO}};function Vb(e,t){var n=t.x,r=t.y;if(n===null)return{x:0,y:-1};if(r===null)return{x:1,y:0};var o=e.x-n,i=e.y-r,s=Math.sqrt(o*o+i*i);return{x:s?o/s:0,y:s?i/s:-1}}function VG(e,t,n,r,o){switch(o){case"center":n=r=0;break;case"bottom":n=0,r=1;break;case"right":n=1,r=0;break;case"left":n=-1,r=0;break;case"top":n=0,r=-1;break;case"start":n=-n,r=-r;break;case"end":break;default:o*=Math.PI/180,n=Math.cos(o),r=Math.sin(o);break}return{x:e,y:t,vx:n,vy:r}}var HG=0,S$=1,C$=2,E$=4,R$=8;function Zh(e,t,n){var r=HG;return e<n.left?r|=S$:e>n.right&&(r|=C$),t<n.top?r|=R$:t>n.bottom&&(r|=E$),r}function WG(e,t){for(var n=e.x0,r=e.y0,o=e.x1,i=e.y1,s=Zh(n,r,t),a=Zh(o,i,t),l,c,u;!(!(s|a)||s&a);)l=s||a,l&R$?(c=n+(o-n)*(t.top-r)/(i-r),u=t.top):l&E$?(c=n+(o-n)*(t.bottom-r)/(i-r),u=t.bottom):l&C$?(u=r+(i-r)*(t.right-n)/(o-n),c=t.right):l&S$&&(u=r+(i-r)*(t.left-n)/(o-n),c=t.left),l===s?(n=c,r=u,s=Zh(n,r,t)):(o=c,i=u,a=Zh(o,i,t));return{x0:n,x1:o,y0:r,y1:i}}function ep(e,t){var n=t.anchor,r=e,o,i;return t.clamp&&(r=WG(r,t.area)),n==="start"?(o=r.x0,i=r.y0):n==="end"?(o=r.x1,i=r.y1):(o=(r.x0+r.x1)/2,i=(r.y0+r.y1)/2),VG(o,i,e.vx,e.vy,t.align)}var tp={arc:function(e,t){var n=(e.startAngle+e.endAngle)/2,r=Math.cos(n),o=Math.sin(n),i=e.innerRadius,s=e.outerRadius;return ep({x0:e.x+r*i,y0:e.y+o*i,x1:e.x+r*s,y1:e.y+o*s,vx:r,vy:o},t)},point:function(e,t){var n=Vb(e,t.origin),r=n.x*e.options.radius,o=n.y*e.options.radius;return ep({x0:e.x-r,y0:e.y-o,x1:e.x+r,y1:e.y+o,vx:n.x,vy:n.y},t)},bar:function(e,t){var n=Vb(e,t.origin),r=e.x,o=e.y,i=0,s=0;return e.horizontal?(r=Math.min(e.x,e.base),i=Math.abs(e.base-e.x)):(o=Math.min(e.y,e.base),s=Math.abs(e.base-e.y)),ep({x0:r,y0:o+s,x1:r+i,y1:o,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=Vb(e,t.origin);return ep({x0:e.x,y0:e.y,x1:e.x+(e.width||0),y1:e.y+(e.height||0),vx:n.x,vy:n.y},t)}},rs=sd.rasterize;function UG(e){var t=e.borderWidth||0,n=e.padding,r=e.size.height,o=e.size.width,i=-o/2,s=-r/2;return{frame:{x:i-n.left-t,y:s-n.top-t,w:o+n.width+t*2,h:r+n.height+t*2},text:{x:i,y:s,w:o,h:r}}}function qG(e,t){var n=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!n)return null;if(n.xCenter!==void 0&&n.yCenter!==void 0)return{x:n.xCenter,y:n.yCenter};var r=n.getBasePixel();return e.horizontal?{x:r,y:null}:{x:null,y:r}}function GG(e){return e instanceof ic?tp.arc:e instanceof od?tp.point:e instanceof id?tp.bar:tp.fallback}function YG(e,t,n,r,o,i){var s=Math.PI/2;if(i){var a=Math.min(i,o/2,r/2),l=t+a,c=n+a,u=t+r-a,f=n+o-a;e.moveTo(t,c),l<u&&c<f?(e.arc(l,c,a,-Math.PI,-s),e.arc(u,c,a,-s,0),e.arc(u,f,a,0,s),e.arc(l,f,a,s,Math.PI)):l<u?(e.moveTo(l,n),e.arc(u,c,a,-s,s),e.arc(l,c,a,s,Math.PI+s)):c<f?(e.arc(l,c,a,-Math.PI,0),e.arc(l,f,a,0,Math.PI)):e.arc(l,c,a,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,r,o)}function KG(e,t,n){var r=n.backgroundColor,o=n.borderColor,i=n.borderWidth;!r&&(!o||!i)||(e.beginPath(),YG(e,rs(t.x)+i/2,rs(t.y)+i/2,rs(t.w)-i,rs(t.h)-i,n.borderRadius),e.closePath(),r&&(e.fillStyle=r,e.fill()),o&&i&&(e.strokeStyle=o,e.lineWidth=i,e.lineJoin="miter",e.stroke()))}function XG(e,t,n){var r=n.lineHeight,o=e.w,i=e.x,s=e.y+r/2;return t==="center"?i+=o/2:(t==="end"||t==="right")&&(i+=o),{h:r,w:o,x:i,y:s}}function QG(e,t,n){var r=e.shadowBlur,o=n.stroked,i=rs(n.x),s=rs(n.y),a=rs(n.w);o&&e.strokeText(t,i,s,a),n.filled&&(r&&o&&(e.shadowBlur=0),e.fillText(t,i,s,a),r&&o&&(e.shadowBlur=r))}function JG(e,t,n,r){var o=r.textAlign,i=r.color,s=!!i,a=r.font,l=t.length,c=r.textStrokeColor,u=r.textStrokeWidth,f=c&&u,p;if(!(!l||!s&&!f))for(n=XG(n,o,a),e.font=a.string,e.textAlign=o,e.textBaseline="middle",e.shadowBlur=r.textShadowBlur,e.shadowColor=r.textShadowColor,s&&(e.fillStyle=i),f&&(e.lineJoin="round",e.lineWidth=u,e.strokeStyle=c),p=0,l=t.length;p<l;++p)QG(e,t[p],{stroked:f,filled:s,w:n.w,x:n.x,y:n.y+n.h*p})}var O$=function(e,t,n,r){var o=this;o._config=e,o._index=r,o._model=null,o._rects=null,o._ctx=t,o._el=n};xi(O$.prototype,{_modelize:function(e,t,n,r){var o=this,i=o._index,s=kn(hn([n.font,{}],r,i)),a=hn([n.color,_n.color],r,i);return{align:hn([n.align,"center"],r,i),anchor:hn([n.anchor,"center"],r,i),area:r.chart.chartArea,backgroundColor:hn([n.backgroundColor,null],r,i),borderColor:hn([n.borderColor,null],r,i),borderRadius:hn([n.borderRadius,0],r,i),borderWidth:hn([n.borderWidth,0],r,i),clamp:hn([n.clamp,!1],r,i),clip:hn([n.clip,!1],r,i),color:a,display:e,font:s,lines:t,offset:hn([n.offset,4],r,i),opacity:hn([n.opacity,1],r,i),origin:qG(o._el,r),padding:er(hn([n.padding,4],r,i)),positioner:GG(o._el),rotation:hn([n.rotation,0],r,i)*(Math.PI/180),size:sd.textSize(o._ctx,t,s),textAlign:hn([n.textAlign,"start"],r,i),textShadowBlur:hn([n.textShadowBlur,0],r,i),textShadowColor:hn([n.textShadowColor,a],r,i),textStrokeColor:hn([n.textStrokeColor,a],r,i),textStrokeWidth:hn([n.textStrokeWidth,0],r,i)}},update:function(e){var t=this,n=null,r=null,o=t._index,i=t._config,s,a,l,c=hn([i.display,!0],e,o);c&&(s=e.dataset.data[o],a=dt(en(i.formatter,[s,e]),s),l=Rt(a)?[]:sd.toTextLines(a),l.length&&(n=t._modelize(c,l,i,e),r=UG(n))),t._model=n,t._rects=r},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(e,t){var n=this,r=e.ctx,o=n._model,i=n._rects,s;this.visible()&&(r.save(),o.clip&&(s=o.area,r.beginPath(),r.rect(s.left,s.top,s.right-s.left,s.bottom-s.top),r.clip()),r.globalAlpha=sd.bound(0,o.opacity,1),r.translate(rs(t.x),rs(t.y)),r.rotate(o.rotation),KG(r,i.frame,o),JG(r,o.lines,i.text,o),r.restore())}});var ZG=Number.MIN_SAFE_INTEGER||-9007199254740991,eY=Number.MAX_SAFE_INTEGER||9007199254740991;function Du(e,t,n){var r=Math.cos(n),o=Math.sin(n),i=t.x,s=t.y;return{x:i+r*(e.x-i)-o*(e.y-s),y:s+o*(e.x-i)+r*(e.y-s)}}function pO(e,t){var n=eY,r=ZG,o=t.origin,i,s,a,l,c;for(i=0;i<e.length;++i)s=e[i],a=s.x-o.x,l=s.y-o.y,c=t.vx*a+t.vy*l,n=Math.min(n,c),r=Math.max(r,c);return{min:n,max:r}}function np(e,t){var n=t.x-e.x,r=t.y-e.y,o=Math.sqrt(n*n+r*r);return{vx:(t.x-e.x)/o,vy:(t.y-e.y)/o,origin:e,ln:o}}var P$=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};xi(P$.prototype,{center:function(){var e=this._rect;return{x:e.x+e.w/2,y:e.y+e.h/2}},update:function(e,t,n){this._rotation=n,this._rect={x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h}},contains:function(e){var t=this,n=1,r=t._rect;return e=Du(e,t.center(),-t._rotation),!(e.x<r.x-n||e.y<r.y-n||e.x>r.x+r.w+n*2||e.y>r.y+r.h+n*2)},intersects:function(e){var t=this._points(),n=e._points(),r=[np(t[0],t[1]),np(t[0],t[3])],o,i,s;for(this._rotation!==e._rotation&&r.push(np(n[0],n[1]),np(n[0],n[3])),o=0;o<r.length;++o)if(i=pO(t,r[o]),s=pO(n,r[o]),i.max<s.min||s.max<i.min)return!1;return!0},_points:function(){var e=this,t=e._rect,n=e._rotation,r=e.center();return[Du({x:t.x,y:t.y},r,n),Du({x:t.x+t.w,y:t.y},r,n),Du({x:t.x+t.w,y:t.y+t.h},r,n),Du({x:t.x,y:t.y+t.h},r,n)]}});function T$(e,t,n){var r=t.positioner(e,t),o=r.vx,i=r.vy;if(!o&&!i)return{x:r.x,y:r.y};var s=n.w,a=n.h,l=t.rotation,c=Math.abs(s/2*Math.cos(l))+Math.abs(a/2*Math.sin(l)),u=Math.abs(s/2*Math.sin(l))+Math.abs(a/2*Math.cos(l)),f=1/Math.max(Math.abs(o),Math.abs(i));return c*=o*f,u*=i*f,c+=t.offset*o,u+=t.offset*i,{x:r.x+c,y:r.y+u}}function tY(e,t){var n,r,o,i;for(n=e.length-1;n>=0;--n)for(o=e[n].$layout,r=n-1;r>=0&&o._visible;--r)i=e[r].$layout,i._visible&&o._box.intersects(i._box)&&t(o,i);return e}function nY(e){var t,n,r,o,i,s,a;for(t=0,n=e.length;t<n;++t)r=e[t],o=r.$layout,o._visible&&(a=new Proxy(r._el,{get:(l,c)=>l.getProps([c],!0)[c]}),i=r.geometry(),s=T$(a,r.model(),i),o._box.update(s,i,r.rotation()));return tY(e,function(l,c){var u=l._hidable,f=c._hidable;u&&f||f?c._visible=!1:u&&(l._visible=!1)})}var ad={prepare:function(e){var t=[],n,r,o,i,s;for(n=0,o=e.length;n<o;++n)for(r=0,i=e[n].length;r<i;++r)s=e[n][r],t.push(s),s.$layout={_box:new P$,_hidable:!1,_visible:!0,_set:n,_idx:s._index};return t.sort(function(a,l){var c=a.$layout,u=l.$layout;return c._idx===u._idx?u._set-c._set:u._idx-c._idx}),this.update(t),t},update:function(e){var t=!1,n,r,o,i,s;for(n=0,r=e.length;n<r;++n)o=e[n],i=o.model(),s=o.$layout,s._hidable=i&&i.display==="auto",s._visible=o.visible(),t|=s._hidable;t&&nY(e)},lookup:function(e,t){var n,r;for(n=e.length-1;n>=0;--n)if(r=e[n].$layout,r&&r._visible&&r._box.contains(t))return e[n];return null},draw:function(e,t){var n,r,o,i,s,a;for(n=0,r=t.length;n<r;++n)o=t[n],i=o.$layout,i._visible&&(s=o.geometry(),a=T$(o._el,o.model(),s),i._box.update(a,s,o.rotation()),o.draw(e,a))}},rY=function(e){if(Rt(e))return null;var t=e,n,r,o;if(Dt(e))if(!Rt(e.label))t=e.label;else if(!Rt(e.r))t=e.r;else for(t="",n=Object.keys(e),o=0,r=n.length;o<r;++o)t+=(o!==0?", ":"")+n[o]+": "+e[n[o]];return""+t},oY={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:rY,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},Tr="$datalabels",D$="$default";function iY(e,t){var n=e.datalabels,r={},o=[],i,s;return n===!1?null:(n===!0&&(n={}),t=xi({},[t,n]),i=t.labels||{},s=Object.keys(i),delete t.labels,s.length?s.forEach(function(a){i[a]&&o.push(xi({},[t,i[a],{_key:a}]))}):o.push(t),r=o.reduce(function(a,l){return Yt(l.listeners||{},function(c,u){a[u]=a[u]||{},a[u][l._key||D$]=c}),delete l.listeners,a},{}),{labels:o,listeners:r})}function Wy(e,t,n,r){if(t){var o=n.$context,i=n.$groups,s;t[i._set]&&(s=t[i._set][i._key],s&&en(s,[o,r])===!0&&(e[Tr]._dirty=!0,n.update(o)))}}function sY(e,t,n,r,o){var i,s;!n&&!r||(n?r?n!==r&&(s=i=!0):s=!0:i=!0,s&&Wy(e,t.leave,n,o),i&&Wy(e,t.enter,r,o))}function aY(e,t){var n=e[Tr],r=n._listeners,o,i;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")i=ad.lookup(n._labels,t);else if(t.type!=="mouseout")return;o=n._hovered,n._hovered=i,sY(e,r,o,i,t)}}function lY(e,t){var n=e[Tr],r=n._listeners.click,o=r&&ad.lookup(n._labels,t);o&&Wy(e,r,o,t)}var cY={id:"datalabels",defaults:oY,beforeInit:function(e){e[Tr]={_actives:[]}},beforeUpdate:function(e){var t=e[Tr];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,o=e[Tr],i=o._datasets[r]=[],s=e.isDatasetVisible(r),a=e.data.datasets[r],l=iY(a,n),c=t.meta.data||[],u=e.ctx,f,p,g,v,b,x,w,_;for(u.save(),f=0,g=c.length;f<g;++f)if(w=c[f],w[Tr]=[],s&&w&&e.getDataVisibility(f)&&!w.skip)for(p=0,v=l.labels.length;p<v;++p)b=l.labels[p],x=b._key,_=new O$(b,u,w,f),_.$groups={_set:r,_key:x||D$},_.$context={active:!1,chart:e,dataIndex:f,dataset:a,datasetIndex:r},_.update(_.$context),w[Tr].push(_),i.push(_);u.restore(),xi(o._listeners,l.listeners,{merger:function(S,R,C){R[S]=R[S]||{},R[S][t.index]=C[S],o._listened=!0}})},afterUpdate:function(e){e[Tr]._labels=ad.prepare(e[Tr]._datasets)},afterDatasetsDraw:function(e){ad.draw(e,e[Tr]._labels)},beforeEvent:function(e,t){if(e[Tr]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":aY(e,n);break;case"click":lY(e,n);break}}},afterEvent:function(e){var t=e[Tr],n=t._actives,r=t._actives=e.getActiveElements(),o=sd.arrayDiff(n,r),i,s,a,l,c,u,f;for(i=0,s=o.length;i<s;++i)if(c=o[i],c[1])for(f=c[0].element[Tr]||[],a=0,l=f.length;a<l;++a)u=f[a],u.$context.active=c[1]===1,u.update(u.$context);(t._dirty||o.length)&&(ad.update(t._labels),e.render()),delete t._dirty}};Po.register(...BG);Po.register(cY);function Hw({cfg:e,onDatapointClick:t}){var a;const n=m.useRef(null),[r,o]=m.useState(),i=Ie(l=>l.themeStyle);m.useEffect(()=>{var u,f,p,g;(f=(u=i==null?void 0:i.chart)==null?void 0:u.font)!=null&&f.family&&(Po.defaults.font={...Po.defaults.font,...(p=i==null?void 0:i.chart)==null?void 0:p.font}),e.options&&(e.options.responsive=!0,e.options.maintainAspectRatio=!1);const l=(g=n==null?void 0:n.current)==null?void 0:g.getContext("2d");if(!l)return;let c;try{c=new Po(l,e),o(c)}catch(v){console.log("error creating chart",v)}return()=>{c&&c.destroy()}},[(a=i==null?void 0:i.chart)==null?void 0:a.font]);function s(l){var u,f;if(!r)return;const c=r==null?void 0:r.getElementsAtEventForMode(l,"nearest",{intersect:!0},!0);if(c&&c.length>0){const p=c[0].datasetIndex,g=c[0].index,v=(f=(u=c[0].element)==null?void 0:u.$context)==null?void 0:f.raw;t==null||t(r,p,g,v)}}return O.jsx("div",{onClick:s,className:"relative h-[99%]",children:O.jsx("canvas",{ref:n})})}function zr(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var uY=["color"],$$=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,uY);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),dY=["color"],fY=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,dY);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),hY=["color"],pY=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,hY);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M5 2V1H10V2H5ZM4.75 0C4.33579 0 4 0.335786 4 0.75V1H3.5C2.67157 1 2 1.67157 2 2.5V12.5C2 13.3284 2.67157 14 3.5 14H7V13H3.5C3.22386 13 3 12.7761 3 12.5V2.5C3 2.22386 3.22386 2 3.5 2H4V2.25C4 2.66421 4.33579 3 4.75 3H10.25C10.6642 3 11 2.66421 11 2.25V2H11.5C11.7761 2 12 2.22386 12 2.5V7H13V2.5C13 1.67157 12.3284 1 11.5 1H11V0.75C11 0.335786 10.6642 0 10.25 0H4.75ZM9 8.5C9 8.77614 8.77614 9 8.5 9C8.22386 9 8 8.77614 8 8.5C8 8.22386 8.22386 8 8.5 8C8.77614 8 9 8.22386 9 8.5ZM10.5 9C10.7761 9 11 8.77614 11 8.5C11 8.22386 10.7761 8 10.5 8C10.2239 8 10 8.22386 10 8.5C10 8.77614 10.2239 9 10.5 9ZM13 8.5C13 8.77614 12.7761 9 12.5 9C12.2239 9 12 8.77614 12 8.5C12 8.22386 12.2239 8 12.5 8C12.7761 8 13 8.22386 13 8.5ZM14.5 9C14.7761 9 15 8.77614 15 8.5C15 8.22386 14.7761 8 14.5 8C14.2239 8 14 8.22386 14 8.5C14 8.77614 14.2239 9 14.5 9ZM15 10.5C15 10.7761 14.7761 11 14.5 11C14.2239 11 14 10.7761 14 10.5C14 10.2239 14.2239 10 14.5 10C14.7761 10 15 10.2239 15 10.5ZM14.5 13C14.7761 13 15 12.7761 15 12.5C15 12.2239 14.7761 12 14.5 12C14.2239 12 14 12.2239 14 12.5C14 12.7761 14.2239 13 14.5 13ZM14.5 15C14.7761 15 15 14.7761 15 14.5C15 14.2239 14.7761 14 14.5 14C14.2239 14 14 14.2239 14 14.5C14 14.7761 14.2239 15 14.5 15ZM8.5 11C8.77614 11 9 10.7761 9 10.5C9 10.2239 8.77614 10 8.5 10C8.22386 10 8 10.2239 8 10.5C8 10.7761 8.22386 11 8.5 11ZM9 12.5C9 12.7761 8.77614 13 8.5 13C8.22386 13 8 12.7761 8 12.5C8 12.2239 8.22386 12 8.5 12C8.77614 12 9 12.2239 9 12.5ZM8.5 15C8.77614 15 9 14.7761 9 14.5C9 14.2239 8.77614 14 8.5 14C8.22386 14 8 14.2239 8 14.5C8 14.7761 8.22386 15 8.5 15ZM11 14.5C11 14.7761 10.7761 15 10.5 15C10.2239 15 10 14.7761 10 14.5C10 14.2239 10.2239 14 10.5 14C10.7761 14 11 14.2239 11 14.5ZM12.5 15C12.7761 15 13 14.7761 13 14.5C13 14.2239 12.7761 14 12.5 14C12.2239 14 12 14.2239 12 14.5C12 14.7761 12.2239 15 12.5 15Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),gY=["color"],k$=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,gY);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),mY=["color"],vY=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,mY);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z",fill:r}))}),bY=["color"],yY=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,bY);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M14.7649 6.07596C14.9991 6.22231 15.0703 6.53079 14.9239 6.76495C14.4849 7.46743 13.9632 8.10645 13.3702 8.66305L14.5712 9.86406C14.7664 10.0593 14.7664 10.3759 14.5712 10.5712C14.3759 10.7664 14.0593 10.7664 13.8641 10.5712L12.6011 9.30817C11.805 9.90283 10.9089 10.3621 9.93375 10.651L10.383 12.3277C10.4544 12.5944 10.2961 12.8685 10.0294 12.94C9.76267 13.0115 9.4885 12.8532 9.41704 12.5865L8.95917 10.8775C8.48743 10.958 8.00036 10.9999 7.50001 10.9999C6.99965 10.9999 6.51257 10.958 6.04082 10.8775L5.58299 12.5864C5.51153 12.8532 5.23737 13.0115 4.97064 12.94C4.7039 12.8686 4.5456 12.5944 4.61706 12.3277L5.06625 10.651C4.09111 10.3621 3.19503 9.90282 2.3989 9.30815L1.1359 10.5712C0.940638 10.7664 0.624058 10.7664 0.428798 10.5712C0.233537 10.3759 0.233537 10.0593 0.428798 9.86405L1.62982 8.66303C1.03682 8.10643 0.515113 7.46742 0.0760677 6.76495C-0.0702867 6.53079 0.000898544 6.22231 0.235065 6.07596C0.469231 5.9296 0.777703 6.00079 0.924058 6.23496C1.40354 7.00213 1.989 7.68057 2.66233 8.2427C2.67315 8.25096 2.6837 8.25972 2.69397 8.26898C4.00897 9.35527 5.65537 9.99991 7.50001 9.99991C10.3078 9.99991 12.6564 8.5063 14.076 6.23495C14.2223 6.00079 14.5308 5.9296 14.7649 6.07596Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),xY=["color"],wY=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,xY);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),_Y=["color"],SY=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,_Y);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),CY=["color"],M$=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,CY);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),EY=["color"],RY=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,EY);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M3.24182 2.32181C3.3919 2.23132 3.5784 2.22601 3.73338 2.30781L12.7334 7.05781C12.8974 7.14436 13 7.31457 13 7.5C13 7.68543 12.8974 7.85564 12.7334 7.94219L3.73338 12.6922C3.5784 12.774 3.3919 12.7687 3.24182 12.6782C3.09175 12.5877 3 12.4252 3 12.25V2.75C3 2.57476 3.09175 2.4123 3.24182 2.32181ZM4 3.57925V11.4207L11.4288 7.5L4 3.57925Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),OY=["color"],PY=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,OY);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M10.3004 7.49991C10.3004 8.4943 9.49426 9.30041 8.49988 9.30041C7.50549 9.30041 6.69938 8.4943 6.69938 7.49991C6.69938 6.50553 7.50549 5.69942 8.49988 5.69942C9.49426 5.69942 10.3004 6.50553 10.3004 7.49991ZM11.205 8C10.9699 9.28029 9.84816 10.2504 8.49988 10.2504C7.1516 10.2504 6.0299 9.28029 5.79473 8H0.5C0.223858 8 0 7.77614 0 7.5C0 7.22386 0.223858 7 0.5 7H5.7947C6.0298 5.71962 7.15154 4.74942 8.49988 4.74942C9.84822 4.74942 10.97 5.71962 11.2051 7H14.5C14.7761 7 15 7.22386 15 7.5C15 7.77614 14.7761 8 14.5 8H11.205Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),TY=["color"],DY=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,TY);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M2 3C2 2.44772 2.44772 2 3 2H12C12.5523 2 13 2.44772 13 3V12C13 12.5523 12.5523 13 12 13H3C2.44772 13 2 12.5523 2 12V3ZM12 3H3V12H12V3Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),$Y=["color"],Ww=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,$Y);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:r}))}),kY=["color"],Uw=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,kY);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:r}))});let rp;const MY=new Uint8Array(16);function AY(){if(!rp&&(rp=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!rp))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return rp(MY)}const Qn=[];for(let e=0;e<256;++e)Qn.push((e+256).toString(16).slice(1));function IY(e,t=0){return Qn[e[t+0]]+Qn[e[t+1]]+Qn[e[t+2]]+Qn[e[t+3]]+"-"+Qn[e[t+4]]+Qn[e[t+5]]+"-"+Qn[e[t+6]]+Qn[e[t+7]]+"-"+Qn[e[t+8]]+Qn[e[t+9]]+"-"+Qn[e[t+10]]+Qn[e[t+11]]+Qn[e[t+12]]+Qn[e[t+13]]+Qn[e[t+14]]+Qn[e[t+15]]}const NY=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),gO={randomUUID:NY};function dl(e,t,n){if(gO.randomUUID&&!t&&!e)return gO.randomUUID();e=e||{};const r=e.random||(e.rng||AY)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let o=0;o<16;++o)t[n+o]=r[o];return t}return IY(r)}const $r=X2()(rT((e,t)=>({isShowingVisual:!0,runSql:!1,sqlGen:{},sql:"",isSqlRunning:!1,queryResultColumns:[],showFilters:!1,applyFilters:!1,filterValues:[{filterId:"sample-filter-id",valueType:"string",name:"",operation:"in",values:[""]}],card:{id:dl(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:dl(),cards:[],activeCardId:""},actions:{setChartOrientation:n=>{e(r=>{var s,a,l,c,u,f;const o=r.card.preferences;let i={};((s=o==null?void 0:o.chartOptions)==null?void 0:s.indexAxis)!==n&&(i={x:(l=(a=o==null?void 0:o.chartOptions)==null?void 0:a.scales)==null?void 0:l.y,y:(u=(c=o==null?void 0:o.chartOptions)==null?void 0:c.scales)==null?void 0:u.x}),r.card.preferences={...o,chartOptions:{...o==null?void 0:o.chartOptions,scales:{...(f=o==null?void 0:o.chartOptions)==null?void 0:f.scales,...i},indexAxis:n}}})},setCustomVisualCode:n=>{e(r=>{r.card.preferences={...r.card.preferences,customVisualCode:n}})},setNumberFormat:(n,r,o,i)=>{e(s=>{var a,l,c;s.card.preferences={...(a=s.card)==null?void 0:a.preferences,formatNumber:{...(c=(l=s.card)==null?void 0:l.preferences)==null?void 0:c.formatNumber,decimalPlaces:n,currency:r,locale:o,suffix:i,enabled:!0}}})},setColorRanges:n=>{e(r=>{var o,i;r.card.preferences={...r.card.preferences,formatNumber:{...(i=(o=r.card)==null?void 0:o.preferences)==null?void 0:i.formatNumber,colorRanges:n}}})},setQueryError:n=>{e(r=>{r.queryError=n})},setQueryResultColumns:n=>{e(r=>{r.queryResultColumns=n})},setCardPreferences:n=>{e(r=>{r.card.preferences=n})},setFilterOnClickColumnIndex:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClickColumnIndex:n}})},setFilterOnClickField:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClick:!0,filterOnClickField:n}})},setCardRefreshInterval:n=>{e(r=>{r.card.refreshInterval=n})},setIsShowingVisual:n=>{e({isShowingVisual:n})},setRunSql:n=>{e({runSql:n})},setIsSqlRunning:n=>{e({isSqlRunning:n})},setFrame:n=>{e({frame:n})},setCard:n=>{e({card:n})},setCardType:n=>{e(r=>{var o;r.card.type=n,n==="range"&&(r.card.preferences={...r.card.preferences,chartOptions:{...(o=r.card.preferences)==null?void 0:o.chartOptions,indexAxis:"y"}})})},setCardSql:n=>{e(r=>{r.card.sql=n})},setCardPython:n=>{e(r=>{r.card.python=n})},setPythonStdOut:n=>{e(r=>{r.pythonStdOut=n})},setCardCustomCfg:n=>{e(r=>{r.card.customCfg=n})},setCardCfg:n=>{e(r=>{r.card.cfg=n})},setShowFilters:n=>{e(r=>{r.showFilters=n})},setApplyFilters:n=>{e(r=>{r.applyFilters=n})},setFilterValues:n=>{e(r=>{r.filterValues=n})},setSqlGen:n=>{e(r=>{r.sqlGen=n})},setSqlGenMeasure:(n,r)=>{e(o=>{o.sqlGen.measures=[...o.sqlGen.measures||[],{name:n,calc:r}]})},setSqlGenDimension:n=>{e(r=>{r.sqlGen.dimensions=[...r.sqlGen.dimensions||[],n]})},setCardData:n=>{e(r=>{r.card.data=n})},setSelectedConnectionId:n=>{var r,o;e(i=>{i.selectedConnectionId=n,i.card.connectionId=n}),(o=(r=t()).onConnectionChange)==null||o.call(r,n)},setSelectedDatabaseName:n=>{var r,o;e(i=>{i.selectedDatabaseName=n,i.card.lastSelectedDatabase=n}),(o=(r=t()).onDatabaseChange)==null||o.call(r,n)},setSelectedSchemaName:n=>{var r,o;e(i=>{i.selectedSchemaName=n,i.card.lastSelectedSchema=n}),(o=(r=t()).onSchemaChange)==null||o.call(r,n)},setSelectedTableName:n=>{var r,o;e(i=>{i.selectedTableName=n,i.card.lastSelectedTable=n}),(o=(r=t()).onTableChange)==null||o.call(r,n)},setCurrentColumns:n=>{e(r=>{r.currentColumns=n})},setOnConnectionChange:n=>{e({onConnectionChange:n})},setOnDatabaseChange:n=>{e({onDatabaseChange:n})},setOnSchemaChange:n=>{e({onSchemaChange:n})},setOnTableChange:n=>{e({onTableChange:n})},setOnSave:n=>{e({onSave:n})},setOnClose:n=>{e({onClose:n})}}}))),fm=()=>$r(e=>e.actions);function LY(e,t,n){var l,c,u,f;const r=n==null?void 0:n.datasetOptions,o=Ie.getState().themeStyle,i=(c=(l=o==null?void 0:o.chart)==null?void 0:l.dataset)==null?void 0:c.backgroundColor,s=(f=(u=o==null?void 0:o.chart)==null?void 0:u.dataset)==null?void 0:f.borderColor;return e.map((p,g)=>{var _;const v=r==null?void 0:r.find(S=>S.idx===g),b=i==null?void 0:i[g%i.length],x=s==null?void 0:s[g%s.length];return{label:p.charAt(0).toUpperCase()+p.slice(1),data:t.map(S=>S[p]),...v,datalabels:{...v==null?void 0:v.datalabels,color:FY((_=v==null?void 0:v.datalabels)==null?void 0:_.align,b)},backgroundColor:b,borderColor:x}})}function FY(e,t){return md(e==="end"||e==="start"?gd():t)}function zY(e){var a,l,c,u;const{metricKeys:t,dimensionKeys:n}=ar(e);let r=[];const o=Ie.getState().themeStyle,i=(l=(a=o==null?void 0:o.chart)==null?void 0:a.dataset)==null?void 0:l.backgroundColor,s=(u=(c=o==null?void 0:o.chart)==null?void 0:c.dataset)==null?void 0:u.borderColor;if((n==null?void 0:n.length)===1){const f=e.map(p=>({x:p[t[0]],y:p[t[1]],r:p[t[2]],label:p[n==null?void 0:n[0]]}));r=[{label:n==null?void 0:n[0],data:f}]}return(n==null?void 0:n.length)>1&&(r=[...new Set(e.map(p=>p[n==null?void 0:n[1]]))].map((p,g)=>{const v=e.filter(b=>b[n==null?void 0:n[1]]===p);return{label:p,data:v.map(b=>({x:b[t[0]],y:b[t[1]],r:b[t[2]],label:b[n==null?void 0:n[0]]})),backgroundColor:i==null?void 0:i[g%i.length],borderColor:s==null?void 0:s[g%s.length]}})),r}function jY(e){var c,u,f,p;const{dimensionKeys:t,metricKeys:n}=ar(e),r=Ie.getState().themeStyle,o=(u=(c=r==null?void 0:r.chart)==null?void 0:c.dataset)==null?void 0:u.backgroundColor,i=(p=(f=r==null?void 0:r.chart)==null?void 0:f.dataset)==null?void 0:p.borderColor,s=t==null?void 0:t[1];return[...new Set(e.map(g=>g==null?void 0:g[s]))].map((g,v)=>({label:g,data:e.filter(b=>(b==null?void 0:b[s])===g).map(b=>[b==null?void 0:b[n[0]],b==null?void 0:b[n[1]],b==null?void 0:b[n[2]]]),backgroundColor:o==null?void 0:o[v%o.length],borderColor:i==null?void 0:i[v%i.length],borderSkipped:!1}))}function BY(e,t){var s,a,l,c;const n=Ie.getState().themeStyle,r=(a=(s=n==null?void 0:n.chart)==null?void 0:s.dataset)==null?void 0:a.backgroundColor,o=(c=(l=n==null?void 0:n.chart)==null?void 0:l.dataset)==null?void 0:c.borderColor;return e.map(u=>({label:u.charAt(0).toUpperCase()+u.slice(1),data:t.map(f=>f[u]),backgroundColor:t.map((f,p)=>r==null?void 0:r[p%r.length]),borderColor:t.map((f,p)=>o==null?void 0:o[p%o.length])}))}function VY(e){let t=-1,n=0;return e.forEach((r,o)=>{const i=Object.keys(r).length;i>n&&(t=o,n=i)}),t}function ar(e){if(e.length===0)return{keys:[],dimensionKeys:[],metricKeys:[]};const t=VY(e),n=Object.keys(e[t]),r=n.filter(i=>{var s,a,l,c,u,f,p,g;return!!(typeof((s=e==null?void 0:e[t])==null?void 0:s[i])&&typeof((a=e==null?void 0:e[t])==null?void 0:a[i])=="string"||typeof((l=e==null?void 0:e[0])==null?void 0:l[i])&&typeof((c=e==null?void 0:e[0])==null?void 0:c[i])=="string"||typeof((u=e==null?void 0:e[1])==null?void 0:u[i])&&typeof((f=e==null?void 0:e[1])==null?void 0:f[i])=="string"||typeof((p=e==null?void 0:e[2])==null?void 0:p[i])&&typeof((g=e==null?void 0:e[2])==null?void 0:g[i])=="string")});r.length===0&&r.push(n[0]);const o=n.filter(i=>{var s,a;return((s=e==null?void 0:e[t])==null?void 0:s[i])===+((a=e==null?void 0:e[t])==null?void 0:a[i])});return{keys:n,dimensionKeys:r,metricKeys:o}}function Vp(e,t){var r;const n=(r=t==null?void 0:t.data)==null?void 0:r.datasets;return n&&n.length>0?e.map((i,s)=>({...i,...n[s],data:i.data,label:i.label})):e}function gg({dataArray:e,groupKey:t,pivotKey:n,valueKey:r}){const o=e.reduce((i,s)=>{const a=s[t],l=s[n],c=s[r];return i[a]||(i[a]={[t]:a}),i[a][l]=c,i},{});return Object.values(o)}function Yi(e,t){var s;const n=Ie.getState().themeStyle,r=(s=n==null?void 0:n.chart)==null?void 0:s.options,o=os.cloneDeep(r);return os.merge(o,e,t)}function Uy(e,t){return e.map(n=>n[t]?n[t]:"BLANK")}/**
|
|
133
133
|
* @license lucide-react v0.379.0 - ISC
|
|
134
134
|
*
|
|
135
135
|
* This source code is licensed under the ISC license.
|
|
@@ -250,7 +250,7 @@ Valid keys: `+JSON.stringify(Object.keys($),null," "));var q=ye(he,ae,le,se,ue+
|
|
|
250
250
|
* This source code is licensed under the ISC license.
|
|
251
251
|
* See the LICENSE file in the root directory of this source tree.
|
|
252
252
|
*/const Kw=Dn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),eK=({data:e,filename:t="output.csv"})=>{const n=()=>{if(e.length===0)return;const r=[],o=Object.keys(e[0]);r.push(o.join(","));for(const c of e){const u=o.map(f=>`"${(""+c[f]).replace(/"/g,'""')}"`);r.push(u.join(","))}const i=r.join(`
|
|
253
|
-
`),s=new Blob([i],{type:"text/csv"}),a=window.URL.createObjectURL(s),l=document.createElement("a");l.setAttribute("hidden",""),l.setAttribute("href",a),l.setAttribute("download",t),document.body.appendChild(l),l.click(),document.body.removeChild(l)};return O.jsx(GY,{onClick:n,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})};function tK({frame:e}){var _;const t=Ie(S=>S.isDashboardEditing),n=Ie(S=>S.filterValues),r=Ie(S=>S.isVisualEditing),o=Ie(S=>S.selectedSheetId);Ie(S=>S.currentBreakpoint);const{removeFrame:i}=Ie(S=>S.actions),s=Ie(S=>S.actions.setIsVisualEditing),a=$r(S=>S.actions.setFilterValues),l=$r(S=>S.actions.setApplyFilters),{setCard:c,setFrame:u,setQueryResultColumns:f}=$r(S=>S.actions),p=$r(S=>S.actions.setSelectedConnectionId),g=$r(S=>S.actions.setSelectedDatabaseName),v=$r(S=>S.actions.setSelectedSchemaName),b=$r(S=>S.actions.setSelectedTableName),x=e.cards.find(S=>S.id===e.activeCardId);function w(){s(!r),c(x);const{dimensionKeys:S}=ar((x==null?void 0:x.data)||[]);f(S),u(e),x!=null&&x.connectionId&&p(x==null?void 0:x.connectionId),x!=null&&x.lastSelectedDatabase&&g(x==null?void 0:x.lastSelectedDatabase),x!=null&&x.lastSelectedSchema&&v(x==null?void 0:x.lastSelectedSchema),x!=null&&x.lastSelectedTable&&b(x==null?void 0:x.lastSelectedTable),n&&(a(n),l(!0))}return O.jsx("section",{className:"absolute right-2 top-2 z-10",children:O.jsxs("div",{className:"flex items-center gap-2",children:[t&&(r?O.jsx(yY,{onClick:()=>{s(!r)},className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"}):O.jsx(wY,{role:"edit-visual",onClick:w,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})),t&&O.jsx(k$,{onClick:()=>i(o,e.id),className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"}),((_=x.preferences)==null?void 0:_.allowDownload)===!0&&O.jsx(eK,{data:(x==null?void 0:x.data)||[],filename:x.title})]})})}function nK(e,t=globalThis==null?void 0:globalThis.document){const n=Fn(e);m.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const Gy="dismissableLayer.update",rK="dismissableLayer.pointerDownOutside",oK="dismissableLayer.focusOutside";let mO;const iK=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Yc=m.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...c}=e,u=m.useContext(iK),[f,p]=m.useState(null),g=(n=f==null?void 0:f.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,v]=m.useState({}),b=ft(t,M=>p(M)),x=Array.from(u.layers),[w]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),_=x.indexOf(w),S=f?x.indexOf(f):-1,R=u.layersWithOutsidePointerEventsDisabled.size>0,C=S>=_,P=sK(M=>{const T=M.target,I=[...u.branches].some(F=>F.contains(T));!C||I||(i==null||i(M),a==null||a(M),M.defaultPrevented||l==null||l())},g),A=aK(M=>{const T=M.target;[...u.branches].some(F=>F.contains(T))||(s==null||s(M),a==null||a(M),M.defaultPrevented||l==null||l())},g);return nK(M=>{S===u.layers.size-1&&(o==null||o(M),!M.defaultPrevented&&l&&(M.preventDefault(),l()))},g),m.useEffect(()=>{if(f)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(mO=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),vO(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=mO)}},[f,g,r,u]),m.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),vO())},[f,u]),m.useEffect(()=>{const M=()=>v({});return document.addEventListener(Gy,M),()=>document.removeEventListener(Gy,M)},[]),m.createElement(Qe.div,fe({},c,{ref:b,style:{pointerEvents:R?C?"auto":"none":void 0,...e.style},onFocusCapture:De(e.onFocusCapture,A.onFocusCapture),onBlurCapture:De(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:De(e.onPointerDownCapture,P.onPointerDownCapture)}))});function sK(e,t=globalThis==null?void 0:globalThis.document){const n=Fn(e),r=m.useRef(!1),o=m.useRef(()=>{});return m.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let c=function(){j$(rK,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function aK(e,t=globalThis==null?void 0:globalThis.document){const n=Fn(e),r=m.useRef(!1);return m.useEffect(()=>{const o=i=>{i.target&&!r.current&&j$(oK,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function vO(){const e=new CustomEvent(Gy);document.dispatchEvent(e)}function j$(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?E2(o,i):o.dispatchEvent(i)}const lK=["top","right","bottom","left"],ia=Math.min,no=Math.max,mg=Math.round,op=Math.floor,sa=e=>({x:e,y:e}),cK={left:"right",right:"left",bottom:"top",top:"bottom"},uK={start:"end",end:"start"};function Yy(e,t,n){return no(e,ia(t,n))}function as(e,t){return typeof e=="function"?e(t):e}function ls(e){return e.split("-")[0]}function Kc(e){return e.split("-")[1]}function Xw(e){return e==="x"?"y":"x"}function Qw(e){return e==="y"?"height":"width"}function Xc(e){return["top","bottom"].includes(ls(e))?"y":"x"}function Jw(e){return Xw(Xc(e))}function dK(e,t,n){n===void 0&&(n=!1);const r=Kc(e),o=Jw(e),i=Qw(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=vg(s)),[s,vg(s)]}function fK(e){const t=vg(e);return[Ky(e),t,Ky(t)]}function Ky(e){return e.replace(/start|end/g,t=>uK[t])}function hK(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function pK(e,t,n,r){const o=Kc(e);let i=hK(ls(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Ky)))),i}function vg(e){return e.replace(/left|right|bottom|top/g,t=>cK[t])}function gK(e){return{top:0,right:0,bottom:0,left:0,...e}}function B$(e){return typeof e!="number"?gK(e):{top:e,right:e,bottom:e,left:e}}function bg(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function bO(e,t,n){let{reference:r,floating:o}=e;const i=Xc(t),s=Jw(t),a=Qw(s),l=ls(t),c=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let g;switch(l){case"top":g={x:u,y:r.y-o.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:f};break;case"left":g={x:r.x-o.width,y:f};break;default:g={x:r.x,y:r.y}}switch(Kc(t)){case"start":g[s]-=p*(n&&c?-1:1);break;case"end":g[s]+=p*(n&&c?-1:1);break}return g}const mK=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=bO(c,r,l),p=r,g={},v=0;for(let b=0;b<a.length;b++){const{name:x,fn:w}=a[b],{x:_,y:S,data:R,reset:C}=await w({x:u,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:g,rects:c,platform:s,elements:{reference:e,floating:t}});if(u=_??u,f=S??f,g={...g,[x]:{...g[x],...R}},C&&v<=50){v++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(c=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:f}=bO(c,p,l)),b=-1;continue}}return{x:u,y:f,placement:p,strategy:o,middlewareData:g}};async function Od(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:g=0}=as(t,e),v=B$(g),x=a[p?f==="floating"?"reference":"floating":f],w=bg(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),_=f==="floating"?{...s.floating,x:r,y:o}:s.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),R=await(i.isElement==null?void 0:i.isElement(S))?await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1}:{x:1,y:1},C=bg(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:_,offsetParent:S,strategy:l}):_);return{top:(w.top-C.top+v.top)/R.y,bottom:(C.bottom-w.bottom+v.bottom)/R.y,left:(w.left-C.left+v.left)/R.x,right:(C.right-w.right+v.right)/R.x}}const yO=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=as(e,t)||{};if(c==null)return{};const f=B$(u),p={x:n,y:r},g=Jw(o),v=Qw(g),b=await s.getDimensions(c),x=g==="y",w=x?"top":"left",_=x?"bottom":"right",S=x?"clientHeight":"clientWidth",R=i.reference[v]+i.reference[g]-p[g]-i.floating[v],C=p[g]-i.reference[g],P=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let A=P?P[S]:0;(!A||!await(s.isElement==null?void 0:s.isElement(P)))&&(A=a.floating[S]||i.floating[v]);const M=R/2-C/2,T=A/2-b[v]/2-1,I=ia(f[w],T),F=ia(f[_],T),j=I,X=A-b[v]-F,G=A/2-b[v]/2+M,B=Yy(j,G,X),J=!l.arrow&&Kc(o)!=null&&G!=B&&i.reference[v]/2-(G<j?I:F)-b[v]/2<0,H=J?G<j?G-j:G-X:0;return{[g]:p[g]+H,data:{[g]:B,centerOffset:G-B-H,...J&&{alignmentOffset:H}},reset:J}}}),vK=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:b=!0,...x}=as(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=ls(o),_=ls(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),R=p||(_||!b?[vg(a)]:fK(a));!p&&v!=="none"&&R.push(...pK(a,b,v,S));const C=[a,...R],P=await Od(t,x),A=[];let M=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&A.push(P[w]),f){const j=dK(o,s,S);A.push(P[j[0]],P[j[1]])}if(M=[...M,{placement:o,overflows:A}],!A.every(j=>j<=0)){var T,I;const j=(((T=i.flip)==null?void 0:T.index)||0)+1,X=C[j];if(X)return{data:{index:j,overflows:M},reset:{placement:X}};let G=(I=M.filter(B=>B.overflows[0]<=0).sort((B,J)=>B.overflows[1]-J.overflows[1])[0])==null?void 0:I.placement;if(!G)switch(g){case"bestFit":{var F;const B=(F=M.map(J=>[J.placement,J.overflows.filter(H=>H>0).reduce((H,Y)=>H+Y,0)]).sort((J,H)=>J[1]-H[1])[0])==null?void 0:F[0];B&&(G=B);break}case"initialPlacement":G=a;break}if(o!==G)return{reset:{placement:G}}}return{}}}};function xO(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wO(e){return lK.some(t=>e[t]>=0)}const bK=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=as(e,t);switch(r){case"referenceHidden":{const i=await Od(t,{...o,elementContext:"reference"}),s=xO(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:wO(s)}}}case"escaped":{const i=await Od(t,{...o,altBoundary:!0}),s=xO(i,n.floating);return{data:{escapedOffsets:s,escaped:wO(s)}}}default:return{}}}}};async function yK(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=ls(n),a=Kc(n),l=Xc(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,f=as(t,e);let{mainAxis:p,crossAxis:g,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof v=="number"&&(g=a==="end"?v*-1:v),l?{x:g*u,y:p*c}:{x:p*c,y:g*u}}const xK=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await yK(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},wK=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:x=>{let{x:w,y:_}=x;return{x:w,y:_}}},...l}=as(e,t),c={x:n,y:r},u=await Od(t,l),f=Xc(ls(o)),p=Xw(f);let g=c[p],v=c[f];if(i){const x=p==="y"?"top":"left",w=p==="y"?"bottom":"right",_=g+u[x],S=g-u[w];g=Yy(_,g,S)}if(s){const x=f==="y"?"top":"left",w=f==="y"?"bottom":"right",_=v+u[x],S=v-u[w];v=Yy(_,v,S)}const b=a.fn({...t,[p]:g,[f]:v});return{...b,data:{x:b.x-n,y:b.y-r}}}}},_K=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=as(e,t),u={x:n,y:r},f=Xc(o),p=Xw(f);let g=u[p],v=u[f];const b=as(a,t),x=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const S=p==="y"?"height":"width",R=i.reference[p]-i.floating[S]+x.mainAxis,C=i.reference[p]+i.reference[S]-x.mainAxis;g<R?g=R:g>C&&(g=C)}if(c){var w,_;const S=p==="y"?"width":"height",R=["top","left"].includes(ls(o)),C=i.reference[f]-i.floating[S]+(R&&((w=s.offset)==null?void 0:w[f])||0)+(R?0:x.crossAxis),P=i.reference[f]+i.reference[S]+(R?0:((_=s.offset)==null?void 0:_[f])||0)-(R?x.crossAxis:0);v<C?v=C:v>P&&(v=P)}return{[p]:g,[f]:v}}}},SK=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=as(e,t),l=await Od(t,a),c=ls(n),u=Kc(n),f=Xc(n)==="y",{width:p,height:g}=r.floating;let v,b;c==="top"||c==="bottom"?(v=c,b=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(b=c,v=u==="end"?"top":"bottom");const x=g-l[v],w=p-l[b],_=!t.middlewareData.shift;let S=x,R=w;if(f){const P=p-l.left-l.right;R=u||_?ia(w,P):P}else{const P=g-l.top-l.bottom;S=u||_?ia(x,P):P}if(_&&!u){const P=no(l.left,0),A=no(l.right,0),M=no(l.top,0),T=no(l.bottom,0);f?R=p-2*(P!==0||A!==0?P+A:no(l.left,l.right)):S=g-2*(M!==0||T!==0?M+T:no(l.top,l.bottom))}await s({...t,availableWidth:R,availableHeight:S});const C=await o.getDimensions(i.floating);return p!==C.width||g!==C.height?{reset:{rects:!0}}:{}}}};function aa(e){return V$(e)?(e.nodeName||"").toLowerCase():"#document"}function so(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ds(e){var t;return(t=(V$(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function V$(e){return e instanceof Node||e instanceof so(e).Node}function cs(e){return e instanceof Element||e instanceof so(e).Element}function wi(e){return e instanceof HTMLElement||e instanceof so(e).HTMLElement}function _O(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof so(e).ShadowRoot}function Of(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=$o(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function CK(e){return["table","td","th"].includes(aa(e))}function Zw(e){const t=e1(),n=$o(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 EK(e){let t=Lc(e);for(;wi(t)&&!pm(t);){if(Zw(t))return t;t=Lc(t)}return null}function e1(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function pm(e){return["html","body","#document"].includes(aa(e))}function $o(e){return so(e).getComputedStyle(e)}function gm(e){return cs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Lc(e){if(aa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_O(e)&&e.host||ds(e);return _O(t)?t.host:t}function H$(e){const t=Lc(e);return pm(t)?e.ownerDocument?e.ownerDocument.body:e.body:wi(t)&&Of(t)?t:H$(t)}function Pd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=H$(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=so(o);return i?t.concat(s,s.visualViewport||[],Of(o)?o:[],s.frameElement&&n?Pd(s.frameElement):[]):t.concat(o,Pd(o,[],n))}function W$(e){const t=$o(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=wi(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=mg(n)!==i||mg(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function t1(e){return cs(e)?e:e.contextElement}function uc(e){const t=t1(e);if(!wi(t))return sa(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=W$(t);let s=(i?mg(n.width):n.width)/r,a=(i?mg(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const RK=sa(0);function U$(e){const t=so(e);return!e1()||!t.visualViewport?RK:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function OK(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==so(e)?!1:t}function fl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=t1(e);let s=sa(1);t&&(r?cs(r)&&(s=uc(r)):s=uc(e));const a=OK(i,n,r)?U$(i):sa(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const p=so(i),g=r&&cs(r)?so(r):r;let v=p.frameElement;for(;v&&r&&g!==p;){const b=uc(v),x=v.getBoundingClientRect(),w=$o(v),_=x.left+(v.clientLeft+parseFloat(w.paddingLeft))*b.x,S=x.top+(v.clientTop+parseFloat(w.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,f*=b.y,l+=_,c+=S,v=so(v).frameElement}}return bg({width:u,height:f,x:l,y:c})}function PK(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=wi(n),i=ds(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},a=sa(1);const l=sa(0);if((o||!o&&r!=="fixed")&&((aa(n)!=="body"||Of(i))&&(s=gm(n)),wi(n))){const c=fl(n);a=uc(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+l.x,y:t.y*a.y-s.scrollTop*a.y+l.y}}function TK(e){return Array.from(e.getClientRects())}function q$(e){return fl(ds(e)).left+gm(e).scrollLeft}function DK(e){const t=ds(e),n=gm(e),r=e.ownerDocument.body,o=no(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=no(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+q$(e);const a=-n.scrollTop;return $o(r).direction==="rtl"&&(s+=no(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function $K(e,t){const n=so(e),r=ds(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=e1();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function kK(e,t){const n=fl(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=wi(e)?uc(e):sa(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function SO(e,t,n){let r;if(t==="viewport")r=$K(e,n);else if(t==="document")r=DK(ds(e));else if(cs(t))r=kK(t,n);else{const o=U$(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return bg(r)}function G$(e,t){const n=Lc(e);return n===t||!cs(n)||pm(n)?!1:$o(n).position==="fixed"||G$(n,t)}function MK(e,t){const n=t.get(e);if(n)return n;let r=Pd(e,[],!1).filter(a=>cs(a)&&aa(a)!=="body"),o=null;const i=$o(e).position==="fixed";let s=i?Lc(e):e;for(;cs(s)&&!pm(s);){const a=$o(s),l=Zw(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Of(s)&&!l&&G$(e,s))?r=r.filter(u=>u!==s):o=a,s=Lc(s)}return t.set(e,r),r}function AK(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?MK(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const f=SO(t,u,o);return c.top=no(f.top,c.top),c.right=ia(f.right,c.right),c.bottom=ia(f.bottom,c.bottom),c.left=no(f.left,c.left),c},SO(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function IK(e){return W$(e)}function NK(e,t,n){const r=wi(t),o=ds(t),i=n==="fixed",s=fl(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=sa(0);if(r||!r&&!i)if((aa(t)!=="body"||Of(o))&&(a=gm(t)),r){const c=fl(t,!0,i,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else o&&(l.x=q$(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function CO(e,t){return!wi(e)||$o(e).position==="fixed"?null:t?t(e):e.offsetParent}function Y$(e,t){const n=so(e);if(!wi(e))return n;let r=CO(e,t);for(;r&&CK(r)&&$o(r).position==="static";)r=CO(r,t);return r&&(aa(r)==="html"||aa(r)==="body"&&$o(r).position==="static"&&!Zw(r))?n:r||EK(e)||n}const LK=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||Y$,i=this.getDimensions;return{reference:NK(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function FK(e){return $o(e).direction==="rtl"}const zK={convertOffsetParentRelativeRectToViewportRelativeRect:PK,getDocumentElement:ds,getClippingRect:AK,getOffsetParent:Y$,getElementRects:LK,getClientRects:TK,getDimensions:IK,getScale:uc,isElement:cs,isRTL:FK};function jK(e,t){let n=null,r;const o=ds(e);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:f,height:p}=e.getBoundingClientRect();if(a||t(),!f||!p)return;const g=op(u),v=op(o.clientWidth-(c+f)),b=op(o.clientHeight-(u+p)),x=op(c),_={rootMargin:-g+"px "+-v+"px "+-b+"px "+-x+"px",threshold:no(0,ia(1,l))||1};let S=!0;function R(C){const P=C[0].intersectionRatio;if(P!==l){if(!S)return s();P?s(!1,P):r=setTimeout(()=>{s(!1,1e-7)},100)}S=!1}try{n=new IntersectionObserver(R,{..._,root:o.ownerDocument})}catch{n=new IntersectionObserver(R,_)}n.observe(e)}return s(!0),i}function BK(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=t1(e),u=o||i?[...c?Pd(c):[],...Pd(t)]:[];u.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const f=c&&a?jK(c,n):null;let p=-1,g=null;s&&(g=new ResizeObserver(w=>{let[_]=w;_&&_.target===c&&g&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{g&&g.observe(t)})),n()}),c&&!l&&g.observe(c),g.observe(t));let v,b=l?fl(e):null;l&&x();function x(){const w=fl(e);b&&(w.x!==b.x||w.y!==b.y||w.width!==b.width||w.height!==b.height)&&n(),b=w,v=requestAnimationFrame(x)}return n(),()=>{u.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),f&&f(),g&&g.disconnect(),g=null,l&&cancelAnimationFrame(v)}}const VK=(e,t,n)=>{const r=new Map,o={platform:zK,...n},i={...o.platform,_c:r};return mK(e,t,{...o,platform:i})},HK=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?yO({element:r.current,padding:o}).fn(n):{}:r?yO({element:r,padding:o}).fn(n):{}}}};var Hp=typeof document<"u"?m.useLayoutEffect:m.useEffect;function yg(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,o;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(!yg(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!yg(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function K$(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function EO(e,t){const n=K$(e);return Math.round(t*n)/n}function RO(e){const t=ge.useRef(e);return Hp(()=>{t.current=e}),t}function WK(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,f]=ge.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,g]=ge.useState(r);yg(p,r)||g(r);const[v,b]=ge.useState(null),[x,w]=ge.useState(null),_=ge.useCallback(J=>{J!=P.current&&(P.current=J,b(J))},[b]),S=ge.useCallback(J=>{J!==A.current&&(A.current=J,w(J))},[w]),R=i||v,C=s||x,P=ge.useRef(null),A=ge.useRef(null),M=ge.useRef(u),T=RO(l),I=RO(o),F=ge.useCallback(()=>{if(!P.current||!A.current)return;const J={placement:t,strategy:n,middleware:p};I.current&&(J.platform=I.current),VK(P.current,A.current,J).then(H=>{const Y={...H,isPositioned:!0};j.current&&!yg(M.current,Y)&&(M.current=Y,v9.flushSync(()=>{f(Y)}))})},[p,t,n,I]);Hp(()=>{c===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,f(J=>({...J,isPositioned:!1})))},[c]);const j=ge.useRef(!1);Hp(()=>(j.current=!0,()=>{j.current=!1}),[]),Hp(()=>{if(R&&(P.current=R),C&&(A.current=C),R&&C){if(T.current)return T.current(R,C,F);F()}},[R,C,F,T]);const X=ge.useMemo(()=>({reference:P,floating:A,setReference:_,setFloating:S}),[_,S]),G=ge.useMemo(()=>({reference:R,floating:C}),[R,C]),B=ge.useMemo(()=>{const J={position:n,left:0,top:0};if(!G.floating)return J;const H=EO(G.floating,u.x),Y=EO(G.floating,u.y);return a?{...J,transform:"translate("+H+"px, "+Y+"px)",...K$(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:Y}},[n,a,G.floating,u.x,u.y]);return ge.useMemo(()=>({...u,update:F,refs:X,elements:G,floatingStyles:B}),[u,F,X,G,B])}function mm(e){const[t,n]=m.useState(void 0);return cr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const X$="Popper",[Q$,Pi]=Gn(X$),[UK,J$]=Q$(X$),qK=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return m.createElement(UK,{scope:t,anchor:r,onAnchorChange:o},n)},GK="PopperAnchor",YK=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=J$(GK,n),s=m.useRef(null),a=ft(t,s);return m.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:m.createElement(Qe.div,fe({},o,{ref:a}))}),Z$="PopperContent",[KK,Yge]=Q$(Z$),XK=m.forwardRef((e,t)=>{var n,r,o,i,s,a,l,c;const{__scopePopper:u,side:f="bottom",sideOffset:p=0,align:g="center",alignOffset:v=0,arrowPadding:b=0,avoidCollisions:x=!0,collisionBoundary:w=[],collisionPadding:_=0,sticky:S="partial",hideWhenDetached:R=!1,updatePositionStrategy:C="optimized",onPlaced:P,...A}=e,M=J$(Z$,u),[T,I]=m.useState(null),F=ft(t,Oe=>I(Oe)),[j,X]=m.useState(null),G=mm(j),B=(n=G==null?void 0:G.width)!==null&&n!==void 0?n:0,J=(r=G==null?void 0:G.height)!==null&&r!==void 0?r:0,H=f+(g!=="center"?"-"+g:""),Y=typeof _=="number"?_:{top:0,right:0,bottom:0,left:0,..._},te=Array.isArray(w)?w:[w],$=te.length>0,V={padding:Y,boundary:te.filter(QK),altBoundary:$},{refs:Q,floatingStyles:N,placement:le,isPositioned:se,middlewareData:ue}=WK({strategy:"fixed",placement:H,whileElementsMounted:(...Oe)=>BK(...Oe,{animationFrame:C==="always"}),elements:{reference:M.anchor},middleware:[xK({mainAxis:p+J,alignmentAxis:v}),x&&wK({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?_K():void 0,...V}),x&&vK({...V}),SK({...V,apply:({elements:Oe,rects:Te,availableWidth:Ue,availableHeight:Be})=>{const{width:Ae,height:Ke}=Te.reference,lt=Oe.floating.style;lt.setProperty("--radix-popper-available-width",`${Ue}px`),lt.setProperty("--radix-popper-available-height",`${Be}px`),lt.setProperty("--radix-popper-anchor-width",`${Ae}px`),lt.setProperty("--radix-popper-anchor-height",`${Ke}px`)}}),j&&HK({element:j,padding:b}),JK({arrowWidth:B,arrowHeight:J}),R&&bK({strategy:"referenceHidden",...V})]}),[he,ie]=ek(le),ee=Fn(P);cr(()=>{se&&(ee==null||ee())},[se,ee]);const ae=(o=ue.arrow)===null||o===void 0?void 0:o.x,ye=(i=ue.arrow)===null||i===void 0?void 0:i.y,q=((s=ue.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[be,_e]=m.useState();return cr(()=>{T&&_e(window.getComputedStyle(T).zIndex)},[T]),m.createElement("div",{ref:Q.setFloating,"data-radix-popper-content-wrapper":"",style:{...N,transform:se?N.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[(a=ue.transformOrigin)===null||a===void 0?void 0:a.x,(l=ue.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},m.createElement(KK,{scope:u,placedSide:he,onArrowChange:X,arrowX:ae,arrowY:ye,shouldHideArrow:q},m.createElement(Qe.div,fe({"data-side":he,"data-align":ie},A,{ref:F,style:{...A.style,animation:se?void 0:"none",opacity:(c=ue.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function QK(e){return e!==null}const JK=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,s;const{placement:a,rects:l,middlewareData:c}=t,f=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,p=f?0:e.arrowWidth,g=f?0:e.arrowHeight,[v,b]=ek(a),x={start:"0%",center:"50%",end:"100%"}[b],w=((r=(o=c.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+p/2,_=((i=(s=c.arrow)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)+g/2;let S="",R="";return v==="bottom"?(S=f?x:`${w}px`,R=`${-g}px`):v==="top"?(S=f?x:`${w}px`,R=`${l.floating.height+g}px`):v==="right"?(S=`${-g}px`,R=f?x:`${_}px`):v==="left"&&(S=`${l.floating.width+g}px`,R=f?x:`${_}px`),{data:{x:S,y:R}}}});function ek(e){const[t,n="center"]=e.split("-");return[t,n]}const Pf=qK,Tf=YK,Df=XK,vm=m.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?Qo.createPortal(m.createElement(Qe.div,fe({},o,{ref:t})),r):null}),tk=m.forwardRef((e,t)=>m.createElement(Qe.span,fe({},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}}))),ZK=tk,[bm,Kge]=Gn("Tooltip",[Pi]),n1=Pi(),eX="TooltipProvider",tX=700,Xy="tooltip.open",[nX,r1]=bm(eX),rX=e=>{const{__scopeTooltip:t,delayDuration:n=tX,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[s,a]=m.useState(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),m.createElement(nX,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(u=>{l.current=u},[]),disableHoverableContent:o},i)},o1="Tooltip",[oX,ym]=bm(o1),iX=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=r1(o1,e.__scopeTooltip),c=n1(t),[u,f]=m.useState(null),p=Nr(),g=m.useRef(0),v=s??l.disableHoverableContent,b=a??l.delayDuration,x=m.useRef(!1),[w=!1,_]=ur({prop:r,defaultProp:o,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(Xy))):l.onClose(),i==null||i(A)}}),S=m.useMemo(()=>w?x.current?"delayed-open":"instant-open":"closed",[w]),R=m.useCallback(()=>{window.clearTimeout(g.current),x.current=!1,_(!0)},[_]),C=m.useCallback(()=>{window.clearTimeout(g.current),_(!1)},[_]),P=m.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{x.current=!0,_(!0)},b)},[b,_]);return m.useEffect(()=>()=>window.clearTimeout(g.current),[]),m.createElement(Pf,c,m.createElement(oX,{scope:t,contentId:p,open:w,stateAttribute:S,trigger:u,onTriggerChange:f,onTriggerEnter:m.useCallback(()=>{l.isOpenDelayed?P():R()},[l.isOpenDelayed,P,R]),onTriggerLeave:m.useCallback(()=>{v?C():window.clearTimeout(g.current)},[C,v]),onOpen:R,onClose:C,disableHoverableContent:v},n))},OO="TooltipTrigger",nk=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=ym(OO,n),i=r1(OO,n),s=n1(n),a=m.useRef(null),l=ft(t,a,o.onTriggerChange),c=m.useRef(!1),u=m.useRef(!1),f=m.useCallback(()=>c.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),m.createElement(Tf,fe({asChild:!0},s),m.createElement(Qe.button,fe({"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute},r,{ref:l,onPointerMove:De(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:De(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:De(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:De(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:De(e.onBlur,o.onClose),onClick:De(e.onClick,o.onClose)})))}),sX="TooltipPortal",[Xge,aX]=bm(sX,{forceMount:void 0}),Td="TooltipContent",lX=m.forwardRef((e,t)=>{const n=aX(Td,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=ym(Td,e.__scopeTooltip);return m.createElement(Mn,{present:r||s.open},s.disableHoverableContent?m.createElement(rk,fe({side:o},i,{ref:t})):m.createElement(cX,fe({side:o},i,{ref:t})))}),cX=m.forwardRef((e,t)=>{const n=ym(Td,e.__scopeTooltip),r=r1(Td,e.__scopeTooltip),o=m.useRef(null),i=ft(t,o),[s,a]=m.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:f}=r,p=m.useCallback(()=>{a(null),f(!1)},[f]),g=m.useCallback((v,b)=>{const x=v.currentTarget,w={x:v.clientX,y:v.clientY},_=dX(w,x.getBoundingClientRect()),S=fX(w,_),R=hX(b.getBoundingClientRect()),C=gX([...S,...R]);a(C),f(!0)},[f]);return m.useEffect(()=>()=>p(),[p]),m.useEffect(()=>{if(l&&u){const v=x=>g(x,u),b=x=>g(x,l);return l.addEventListener("pointerleave",v),u.addEventListener("pointerleave",b),()=>{l.removeEventListener("pointerleave",v),u.removeEventListener("pointerleave",b)}}},[l,u,g,p]),m.useEffect(()=>{if(s){const v=b=>{const x=b.target,w={x:b.clientX,y:b.clientY},_=(l==null?void 0:l.contains(x))||(u==null?void 0:u.contains(x)),S=!pX(w,s);_?p():S&&(p(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,u,s,c,p]),m.createElement(rk,fe({},e,{ref:i}))}),[uX,Qge]=bm(o1,{isInside:!1}),rk=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=ym(Td,n),c=n1(n),{onClose:u}=l;return m.useEffect(()=>(document.addEventListener(Xy,u),()=>document.removeEventListener(Xy,u)),[u]),m.useEffect(()=>{if(l.trigger){const f=p=>{const g=p.target;g!=null&&g.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),m.createElement(Yc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:u},m.createElement(Df,fe({"data-state":l.stateAttribute},c,a,{ref:t,style:{...a.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)"}}),m.createElement(C2,null,r),m.createElement(uX,{scope:n,isInside:!0},m.createElement(ZK,{id:l.contentId,role:"tooltip"},o||r))))});function dX(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function fX(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 hX(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function pX(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function gX(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),mX(t)}function mX(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}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)}const vX=rX,bX=iX,yX=nk,ok=lX,xX=vX,ik=bX,sk=yX,i1=ge.forwardRef(({className:e,sideOffset:t=4,...n},r)=>O.jsx(ok,{ref:r,sideOffset:t,className:Pe("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground 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}));i1.displayName=ok.displayName;function rl({number:e,decimalPlaces:t=0,useSuffix:n=!1,customSuffix:r="",currency:o="",locale:i="en-US"}){let s=1,a=r,l=i;const c=t;n&&!r&&(e>=1e9?(s=1e9,a="B"):e>=1e7&&i==="en-IN"?(s=1e7,a="Cr"):e>=1e5&&i==="en-IN"?(s=1e5,a="L"):e>=1e6?(s=1e6,a="M"):e>=1e3&&(s=1e3,a="K"));const u=e/s,f={maximumFractionDigits:c,minimumFractionDigits:c};if(o){f.style="currency",f.currency=o;try{new Intl.NumberFormat(i,f).format(0)}catch{f.currency="USD"}}try{new Intl.NumberFormat(i,f).format(0)}catch{l="en-US"}let g=new Intl.NumberFormat(l,f).format(u);return n&&(g+=a),g}function ak(e,t){if(!t)return"";const n=t.find(r=>e>=r.start&&e<=r.end);return(n==null?void 0:n.color)||""}function lk({card:e,isLoading:t}){var w,_,S,R,C,P,A,M,T,I,F,j,X,G,B,J,H,Y,te,$,V,Q,N,le;const n=Ie(se=>se.actions.setCardTitle),r=Ie(se=>se.actions.setCardDescription),o=Ie(se=>se.isVisualEditing),i=$r(se=>se.card),s=$r(se=>se.actions.setCard);$r(se=>se.actions.setNumberFormat);const a=Ie(se=>se.selectedSheetId),l=e.data,c=(_=(w=e.preferences)==null?void 0:w.formatNumber)==null?void 0:_.colorRanges,{metricKeys:u}=ar(l||[]),f=(S=l==null?void 0:l[0])==null?void 0:S[u==null?void 0:u[0]],p=(R=l==null?void 0:l[0])==null?void 0:R[u==null?void 0:u[1]],g=!!e.data&&e.data.length>0;function v(se){o?s({...i,title:se}):n(a,e.id,se)}function b(se){o?s({...i,description:se}):r(a,e.id,se)}const x=p&&p-f!==0?(f-p)/p:null;return O.jsxs("div",{className:"kpi-card flex grow flex-col overflow-scroll",children:[O.jsxs(Ug,{className:"grow pb-3",children:[O.jsx(na,{text:o?i.title:e.title,onSave:v,children:O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx(yf,{className:"text-base font-medium text-muted-foreground",children:e.title}),!e.refreshInterval&&t&&O.jsx(Gw,{className:"h-4 w-4 animate-spin text-muted-foreground"})]})}),g&&O.jsxs("div",{className:"flex flex-wrap items-end gap-3 text-foreground",children:[O.jsx("p",{style:{color:ak(f,c)},className:"text-3xl font-semibold",children:rl({number:f,decimalPlaces:((P=(C=e.preferences)==null?void 0:C.formatNumber)==null?void 0:P.decimalPlaces)||0,useSuffix:!!((M=(A=e.preferences)==null?void 0:A.formatNumber)!=null&&M.suffix),customSuffix:((I=(T=e.preferences)==null?void 0:T.formatNumber)==null?void 0:I.suffix)||"",locale:((j=(F=e.preferences)==null?void 0:F.formatNumber)==null?void 0:j.locale)||"",currency:((G=(X=e.preferences)==null?void 0:X.formatNumber)==null?void 0:G.currency)||""})}),p&&O.jsxs("span",{className:"min-w-fit text-base font-normal text-muted-foreground",children:["from ",rl({number:p,decimalPlaces:((J=(B=e.preferences)==null?void 0:B.formatNumber)==null?void 0:J.decimalPlaces)||0,useSuffix:!!((Y=(H=e.preferences)==null?void 0:H.formatNumber)!=null&&Y.suffix),customSuffix:(($=(te=e.preferences)==null?void 0:te.formatNumber)==null?void 0:$.suffix)||"",locale:((Q=(V=e.preferences)==null?void 0:V.formatNumber)==null?void 0:Q.locale)||"",currency:((le=(N=e.preferences)==null?void 0:N.formatNumber)==null?void 0:le.currency)||""})]})]})]}),x&&O.jsxs(qg,{className:"grow items-start gap-1 pb-4 text-sm",children:[O.jsx(wX,{children:x}),O.jsxs("div",{className:"flex gap-1 text-muted-foreground",children:[x>0?"up ":"down ",O.jsx(na,{text:e.description||"",onSave:b,children:e.description})]})]})]})}function wX({children:e}){const t=e>0?O.jsx(Uw,{className:"h-4 w-4"}):O.jsx(Ww,{className:"h-4 w-4"}),n=`${Math.abs(e*100).toFixed(0)}%`;return O.jsxs("div",{className:Pe("flex items-center",{"text-green-600":e>0,"text-destructive":e<0}),children:[t,O.jsx("span",{className:"ml-[1px]",children:n})]})}var Fc=1e3,zc=Fc*60,jc=zc*60,hl=jc*24,_X=hl*7,SX=hl*365.25,CX=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return EX(e);if(n==="number"&&isFinite(e))return t.long?OX(e):RX(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function EX(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*SX;case"weeks":case"week":case"w":return n*_X;case"days":case"day":case"d":return n*hl;case"hours":case"hour":case"hrs":case"hr":case"h":return n*jc;case"minutes":case"minute":case"mins":case"min":case"m":return n*zc;case"seconds":case"second":case"secs":case"sec":case"s":return n*Fc;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function RX(e){var t=Math.abs(e);return t>=hl?Math.round(e/hl)+"d":t>=jc?Math.round(e/jc)+"h":t>=zc?Math.round(e/zc)+"m":t>=Fc?Math.round(e/Fc)+"s":e+"ms"}function OX(e){var t=Math.abs(e);return t>=hl?ip(e,t,hl,"day"):t>=jc?ip(e,t,jc,"hour"):t>=zc?ip(e,t,zc,"minute"):t>=Fc?ip(e,t,Fc,"second"):e+" ms"}function ip(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}const PX=Uc(CX);function ck({children:e}){const{setIsSessionExpired:t}=Ci(),n=new J8({queryCache:new g2({onError:r=>{console.error(`Something went wrong: ${r.message}`),r.message==="invalid token"&&t(!0)}}),defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});return O.jsx(nz,{client:n,children:e})}const TX={id:"",authToken:void 0},uk=m.createContext(TX),dk=({children:e,dashboardProps:t})=>O.jsx(ck,{children:O.jsx(uk.Provider,{value:t,children:e})});function fa(){const e=m.useContext(uk);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function DX(e){Ie(c=>c.bookmarkKey);const t=Ie(c=>c.dashboard.baseQueries),{authToken:n}=fa(),r=Ie(c=>c.authToken),o=Ie(c=>c.filterValues),i=Ie(c=>c.isDashboardEditing),s=PX((e==null?void 0:e.refreshInterval)||"0"),a=YT(e.sql,t);return bf({queryKey:[e.id,a],queryFn:()=>gf("https://semaphor.cloud/api/v1/query",(n==null?void 0:n.accessToken)||(r==null?void 0:r.accessToken)||"",{connection_id:e.connectionId,sql:a,python:e.python===a2?"":e.python,active_filters:o}),refetchInterval:s,enabled:!!e.connectionId&&!i})}function $a({data:e,cfg:t,customCfg:n,preferences:r}){const{dimensionKeys:o,metricKeys:i}=ar(e),s=LY(i,e,r),a=Vp(s,n),l=o[0],c=Uy(e,l);s1(r,t),fk(r);const u=hk(t,r),f=os.merge((t==null?void 0:t.options)||{},r==null?void 0:r.chartOptions),p=os.merge(u,f),g=Yi(p,(n==null?void 0:n.options)||{});return{type:(n==null?void 0:n.type)||(t==null?void 0:t.type)||"bar",data:{labels:c,datasets:a},options:g}}function s1(e,t){var o,i,s;const n=((o=t==null?void 0:t.options)==null?void 0:o.indexAxis)==="y"?"x":"y";return(i=e==null?void 0:e.chartOptions)!=null&&i.indexAxis?((s=e==null?void 0:e.chartOptions)==null?void 0:s.indexAxis)==="x"?"y":"x":n}function fk(e){var n,r;return(n=e==null?void 0:e.chartOptions)!=null&&n.indexAxis?((r=e==null?void 0:e.chartOptions)==null?void 0:r.indexAxis)==="x"?"x":"y":"x"}function hk(e,t){var i,s,a,l,c,u,f,p,g,v,b,x;const n=s1(t,e),r=fk(t);return{...e==null?void 0:e.options,scales:{...(i=e==null?void 0:e.options)==null?void 0:i.scales,[n]:{...(a=(s=e==null?void 0:e.options)==null?void 0:s.scales)==null?void 0:a[n],ticks:{...(u=(c=(l=e==null?void 0:e.options)==null?void 0:l.scales)==null?void 0:c[n])==null?void 0:u.ticks,callback:w=>{var _,S,R,C;return rl({number:Number(w),decimalPlaces:((_=t==null?void 0:t.numberAxisFormat)==null?void 0:_.decimalPlaces)||0,useSuffix:!!((S=t==null?void 0:t.numberAxisFormat)!=null&&S.suffix),customSuffix:"",locale:((R=t==null?void 0:t.numberAxisFormat)==null?void 0:R.locale)||"",currency:((C=t==null?void 0:t.numberAxisFormat)==null?void 0:C.currency)||""})}}},[r]:{...(g=(p=(f=e==null?void 0:e.options)==null?void 0:f.scales)==null?void 0:p[r])==null?void 0:g.ticks,callback:null}},plugins:{...(v=e==null?void 0:e.options)==null?void 0:v.plugins,datalabels:{...(x=(b=e==null?void 0:e.options)==null?void 0:b.plugins)==null?void 0:x.datalabels,formatter:function(w){var _,S,R,C;return rl({number:Number(w),decimalPlaces:((_=t==null?void 0:t.numberAxisFormat)==null?void 0:_.decimalPlaces)||0,useSuffix:!!((S=t==null?void 0:t.numberAxisFormat)!=null&&S.suffix),customSuffix:"",locale:((R=t==null?void 0:t.numberAxisFormat)==null?void 0:R.locale)||"",currency:((C=t==null?void 0:t.numberAxisFormat)==null?void 0:C.currency)||""})}}}}}function $X(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0},y:{display:!0}}}}}function kX(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{beginAtZero:!0,stack:1,reverse:!0},y:{stacked:!0,beginAtZero:!0}}}}}function MX(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function AX(e,t=!1){return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0,beginAtZero:!1},y:{display:!0,stacked:t}}}}}function IX(e){var n,r,o,i;return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{...(r=(n=e==null?void 0:e.options)==null?void 0:n.scales)==null?void 0:r.x,display:!0,stacked:!0},y:{...(i=(o=e==null?void 0:e.options)==null?void 0:o.scales)==null?void 0:i.y,display:!0,stacked:!0}}}}}function NX(e){return{...e,type:"line",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function LX(e,t){var r;return{...t,type:e,options:{...t==null?void 0:t.options,scales:{x:{display:!1},y:{display:!1}},plugins:{...(r=t==null?void 0:t.options)==null?void 0:r.plugins,legend:{position:"top",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},borderRadius:0}}}function FX(e){return{...e,type:"radar",options:{...e==null?void 0:e.options,scales:{x:{display:!1},y:{display:!1}}}}}function zX(e){const n=new Function("getDatalabelColor",e)(ny);return{options:n==null?void 0:n.options,plugins:(n==null?void 0:n.plugins)||[]}}function a1({data:e,cardType:t="bar",cfg:n,customCfg:r,provider:o="chartjs",userSettings:i,preferences:s}){var a,l,c;if(t==="bar"){const u=MX(n);return $a({data:e,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="horizontalBar"){const u=$X(n);return $a({data:e,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="pyramid"){const u=kX(n),{dimensionKeys:f,metricKeys:p}=ar(e),g=gg({dataArray:e,groupKey:f[0],pivotKey:f[1],valueKey:p[0]}),v=$a({data:g,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s}),b="x2";return{...v,data:{...v.data,datasets:v.data.datasets.map((w,_)=>_===1?{...w,xAxisID:b}:w)},options:{...v.options,scales:{...(a=v==null?void 0:v.options)==null?void 0:a.scales,[b]:{beginAtZero:!0,stack:1}}}}}if(t==="stackedBar"){const u=IX(n),{dimensionKeys:f,metricKeys:p}=ar(e),g=gg({dataArray:e,groupKey:f[0],pivotKey:f[1],valueKey:p[0]});return $a({data:g,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="line"){const u=NX(n);return $a({data:e,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="range"){const u=AX(n),f=jY(e),p=Vp(f,r),{plugins:g,options:v}=zX((s==null?void 0:s.customVisualCode)||""),b=Yi((u==null?void 0:u.options)||{},(n==null?void 0:n.options)||{}),x=Yi(b,(s==null?void 0:s.chartOptions)||{}),w=Yi(x,(r==null?void 0:r.options)||{}),_=Yi(w,v),S=hk(n,s),R=Yi(_,S),C={...R,plugins:{...R==null?void 0:R.plugins,datalabels:{...(l=R==null?void 0:R.plugins)==null?void 0:l.datalabels,formatter:(I,F)=>I.map(X=>{var G,B,J,H;return rl({number:Number(X),decimalPlaces:((G=s==null?void 0:s.numberAxisFormat)==null?void 0:G.decimalPlaces)||0,useSuffix:!!((B=s==null?void 0:s.numberAxisFormat)!=null&&B.suffix),customSuffix:"",locale:((J=s==null?void 0:s.numberAxisFormat)==null?void 0:J.locale)||"",currency:((H=s==null?void 0:s.numberAxisFormat)==null?void 0:H.currency)||""})}).slice(0,2).join(" - ")}}},{dimensionKeys:P}=ar(e),A=P[0];return{type:"bar",data:{labels:[...new Set(Uy(e,A))],datasets:p},options:C,plugins:[...g]}}if(t==="pie"||t==="doughnut"||t==="polarArea"){const u=LX(t,n),{dimensionKeys:f,metricKeys:p}=ar(e),g=BY(p,e),v=Vp(g,r),b=f[0],x=Uy(e,b),w=Yi((u==null?void 0:u.options)||{},(r==null?void 0:r.options)||{}),_=Yi(w,(s==null?void 0:s.chartOptions)||{}),S={..._,plugins:{..._.plugins,datalabels:{...(c=_.plugins)==null?void 0:c.datalabels,formatter:(P,A)=>{var M,T,I,F;return rl({number:Number(P),decimalPlaces:((M=s==null?void 0:s.numberAxisFormat)==null?void 0:M.decimalPlaces)||0,useSuffix:!!((T=s==null?void 0:s.numberAxisFormat)!=null&&T.suffix),customSuffix:"",locale:((I=s==null?void 0:s.numberAxisFormat)==null?void 0:I.locale)||"",currency:((F=s==null?void 0:s.numberAxisFormat)==null?void 0:F.currency)||""})}}}};return{type:t,data:{labels:x,datasets:v},options:S,plugins:[t==="doughnut"?{id:"doughnutLabel",beforeDatasetsDraw:function(P,A,M){var J,H,Y,te;const{ctx:T,data:I}=P;T.save();const F=P.getDatasetMeta(0).data[0].x,j=P.getDatasetMeta(0).data[0].y,X=md(gd());T.font="1.2rem Arial",T.fontWeight="bolder",T.fillStyle=X,T.textAlign="center",T.textBaseline="middle";const G=I.datasets[0].data.reduce(($,V)=>$+V,0),B=rl({number:Number(G),decimalPlaces:((J=s==null?void 0:s.numberAxisFormat)==null?void 0:J.decimalPlaces)||0,useSuffix:!!((H=s==null?void 0:s.numberAxisFormat)!=null&&H.suffix),customSuffix:"",locale:((Y=s==null?void 0:s.numberAxisFormat)==null?void 0:Y.locale)||"",currency:((te=s==null?void 0:s.numberAxisFormat)==null?void 0:te.currency)||""});T.fillText(B,F,j)}}:""]}}if(t==="radar"){const u=FX(n);return $a({data:e,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="bubble"||t==="scatter"){const{metricKeys:u}=ar(e);if(u.length<3){console.log("Bubble charts require 3 numeric columns");return}const f=zY(e),p=Vp(f,r),g={plugins:{datalabels:{display:!0}},scales:{x:{title:{display:!0,text:u[0]},beginAtZero:!0,ticks:{precision:0}},y:{title:{display:!0,text:u[1]},beginAtZero:!0,ticks:{precision:0}}}},v=Yi(g,(r==null?void 0:r.options)||{});return{type:t,data:{datasets:p},options:v}}return $a({data:e,cfg:n,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}function jX({chart:e,elementIndex:t,datasetIndex:n,cardType:r,cfg:o,apply:i}){const s=Ie.getState().theme;if(!o)return;const a=s==="dark"?"rgb(238,238,238,0.2)":"rgb(238,238,238,0.8)";["bar","line","horizontalBar","bubble","scatter"].includes(r)&&VX(e,t,o,i,a),["pie","doughnut","polarArea"].includes(r)&&HX(e,t,o,i,a),["stackedBar","pyramid"].includes(r)&&BX({chart:e,elementIndex:t,datasetIndex:n,cfg:o,apply:i,blurColor:a})}function BX(e){var a,l,c,u;const{chart:t,elementIndex:n,datasetIndex:r,cfg:o,apply:i,blurColor:s}=e;i?(l=(a=t==null?void 0:t.data)==null?void 0:a.datasets)==null||l.forEach((f,p)=>{var g,v;typeof f.backgroundColor=="string"&&(f.backgroundColor=new Array(f.data.length).fill(f.backgroundColor),f.borderColor=new Array(f.data.length).fill(f.borderColor)),f.backgroundColor=(g=f==null?void 0:f.backgroundColor)==null?void 0:g.map((b,x)=>x===n&&p===r?b:s),f.borderColor=(v=f==null?void 0:f.borderColor)==null?void 0:v.map((b,x)=>x===n&&p===r?b:s)}):(u=(c=t==null?void 0:t.data)==null?void 0:c.datasets)==null||u.forEach((f,p)=>{var g,v,b,x,w,_;f.backgroundColor=new Array(f.data.length).fill((b=(v=(g=o==null?void 0:o.data)==null?void 0:g.datasets)==null?void 0:v[p])==null?void 0:b.backgroundColor),f.borderColor=new Array(f.data.length).fill((_=(w=(x=o==null?void 0:o.data)==null?void 0:x.datasets)==null?void 0:w[p])==null?void 0:_.borderColor)}),t==null||t.update()}function VX(e,t,n,r,o){var i,s,a,l;console.log("clicked index",t),r?(s=(i=e==null?void 0:e.data)==null?void 0:i.datasets)==null||s.forEach(c=>{var u,f;typeof c.backgroundColor=="string"&&(c.backgroundColor=new Array(c.data.length).fill(c.backgroundColor),c.borderColor=new Array(c.data.length).fill(c.borderColor)),c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((p,g)=>g===t?p:o),c.borderColor=(f=c==null?void 0:c.borderColor)==null?void 0:f.map((p,g)=>g===t?p:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var f,p,g,v,b,x;c.backgroundColor=new Array(c.data.length).fill((g=(p=(f=n==null?void 0:n.data)==null?void 0:f.datasets)==null?void 0:p[u])==null?void 0:g.backgroundColor),c.borderColor=new Array(c.data.length).fill((x=(b=(v=n==null?void 0:n.data)==null?void 0:v.datasets)==null?void 0:b[u])==null?void 0:x.borderColor)}),e==null||e.update()}function HX(e,t,n,r,o){var i,s,a,l;r?(s=(i=e==null?void 0:e.data)==null?void 0:i.datasets)==null||s.forEach(c=>{var u,f;c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((p,g)=>g===t?p:o),c.borderColor=(f=c==null?void 0:c.borderColor)==null?void 0:f.map((p,g)=>g===t?p:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var f,p,g,v,b,x,w,_;typeof c.backgroundColor=="string"&&(c.backgroundColor=(g=(p=(f=n==null?void 0:n.data)==null?void 0:f.datasets)==null?void 0:p[u])==null?void 0:g.backgroundColor,c.borderColor=(x=(b=(v=n==null?void 0:n.data)==null?void 0:v.datasets)==null?void 0:b[u])==null?void 0:x.borderColor),c.backgroundColor=(w=c==null?void 0:c.backgroundColor)==null?void 0:w.map((S,R)=>{var C;return(C=n.data.datasets[u].backgroundColor)==null?void 0:C[R]}),c.borderColor=(_=c==null?void 0:c.borderColor)==null?void 0:_.map((S,R)=>{var C;return(C=n.data.datasets[u].borderColor)==null?void 0:C[R]})}),e==null||e.update()}function WX(e,t,n,r){var o,i;try{if(!e||!e.data)return;const{dimensionKeys:s,metricKeys:a}=ar(e.data);if(["bar","horizontalBar","line","pie","doughnut","radar","polarArea"].includes(e.type)){const l=s[0],c=(o=e.data[n])==null?void 0:o[l];return[{columnName:l,columnValue:c,metric:a[t],value:r}]}if(["stackedBar","pyramid"].includes(e.type)){const l=gg({dataArray:e.data,groupKey:s[0],pivotKey:s[1],valueKey:a[0]}),c=s[0],u=(i=l[n])==null?void 0:i[c],f=s[1],{metricKeys:p}=ar(l),g=p[t];return[{columnName:c,columnValue:u,metric:a[0],value:r},{columnName:f,columnValue:g,metric:a[0],value:r}]}if(e.type==="bubble"||e.type==="scatter"){const l=s[0],c=r.label;return[{columnName:l,columnValue:c,metric1:a[0],value1:r.x,metric2:a[1],value2:r.y,metric3:a==null?void 0:a[2],value3:r==null?void 0:r.r}]}}catch(s){console.error("Error in getAdhocFilter",s)}}function UX(e){var s,a;const[t]=m.useState({id:"",title:"",type:"bar",data:[]}),{getCard:n}=Ci(),r=n(e),o=l1(r||t),i={...r,data:((s=o==null?void 0:o.data)==null?void 0:s.records)||[]};return{...o,data:((a=o==null?void 0:o.data)==null?void 0:a.records)||[],card:i}}function l1(e){var F,j,X;const{onChartElementClicked:t}=fa(),[n,r]=m.useState(0),o=((F=e==null?void 0:e.preferences)==null?void 0:F.filterOnClickColumnIndex)===void 0?0:(j=e.preferences)==null?void 0:j.filterOnClickColumnIndex,i=Ie(G=>G.bookmarkKey);Ie(G=>G.isVisualEditing);const s=Ie(G=>G.filteringCards),a=Ie(G=>G.selectedSheetId);Ie(G=>G.selectedCardId),Ie(G=>G.isDashboardEditing);const l=Ie(G=>G.themeStyle),c=Ie(G=>G.filterValues),u=(X=e==null?void 0:e.preferences)==null?void 0:X.onClickFilter,{addFrame:f,addFilteringCard:p,setFrameCardData:g,getSelectedFrame:v,addOrUpdateFilterValue:b,addOrUpdateFilterValues:x,removeFilterValue:w,removeFilteringCard:_}=Ci(),{data:S,isLoading:R,isFetching:C,isError:P,refetch:A}=DX(e),M=s==null?void 0:s.find(G=>G.id===e.id);let T;e.data&&e.data.length>0&&(T=a1({data:e.data,cardType:e.type,cfg:e.cfg,customCfg:e.customCfg,preferences:e.preferences})),m.useEffect(()=>{!S||!S.records||g(a,e.id,(S==null?void 0:S.records)||[])},[S,a,e.id,g,c]),m.useEffect(()=>{e.data&&r(n+1)},[e.data,e.type,e.cfg,e.customCfg,e.preferences,l]),m.useEffect(()=>{e.connectionId&&!M&&A()},[c,i]);function I(G,B,J,H){var $,V;let Y=!1;if(!e.data)return;const te=WX(e,B,J,H);if(console.log("fieldValues",te),t==null||t(e,te),!!((($=e==null?void 0:e.preferences)==null?void 0:$.onClickFilter)??[]).length){if(M){const Q=e.id;w(Q),_(e)}else{if(Y=!0,!te)return;const Q=[];te.forEach((N,le)=>{const se=u==null?void 0:u.find(he=>he.columnIndex===le);if(!se)return;const ue={filterId:e.id+"-"+N.columnName,connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:N.columnName,expression:se.expression,valueType:vd(te[se.columnIndex].columnValue),operation:"=",values:[te[se.columnIndex].columnValue]};Q.push(ue)}),e.id,e==null||e.connectionId,e.lastSelectedTable,te[o].columnName,(V=e.preferences)==null||V.filterOnClickField,vd(te[o].columnValue),te[o].columnValue,x(Q),p(e)}jX({chart:G,elementIndex:J,datasetIndex:B,cardType:e.type,cfg:T,apply:Y})}}return{isError:P,isLoading:R,isFetching:C,data:S,visualKey:n,handleDatapointClick:I,cfg:T}}function qX(e,t){const n=Ie(u=>u.selectedSheetId),r=Ie(u=>u.selectedFrameId),o=Ie(u=>u.isDashboardEditing),i=Ie(u=>u.isVisualEditing),{addFrame:s,getSelectedFrame:a,setSelectedFrameId:l}=Ie(u=>u.actions);m.useEffect(()=>{const u=p=>{if(o&&((p.metaKey||p.ctrlKey)&&p.key==="c"&&navigator.clipboard.writeText(JSON.stringify(a())),(p.ctrlKey||p.metaKey)&&p.key==="v"))try{navigator.clipboard.readText().then(g=>{try{const v=JSON.parse(g);if(v&&v.id){v.id=dl();const b=v.activeCardId;v.cards.forEach(x=>{const w=x.id;x.id=dl(),w===b&&(v.activeCardId=x.id,x.title=`${x.title} (Copy)`)}),s(n,v),l(v.id)}}catch(v){console.error("Failed to parse clipboard contents: ",v)}})}catch(g){console.error("Failed to read clipboard contents: ",g)}},f=t==null?void 0:t.current;return f==null||f.addEventListener("keydown",u),()=>{f==null||f.removeEventListener("keydown",u)}},[o,n,a,s,t,l]),m.useEffect(()=>{r===e.id&&o&&!i&&c()},[r,e.id,o,i]);function c(){const u=t==null?void 0:t.current;u==null||u.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}let Hb;const pk="HoverCard",[gk,Jge]=Gn(pk,[Pi]),c1=Pi(),[GX,u1]=gk(pk),YX=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:s=700,closeDelay:a=300}=e,l=c1(t),c=m.useRef(0),u=m.useRef(0),f=m.useRef(!1),p=m.useRef(!1),[g=!1,v]=ur({prop:r,defaultProp:o,onChange:i}),b=m.useCallback(()=>{clearTimeout(u.current),c.current=window.setTimeout(()=>v(!0),s)},[s,v]),x=m.useCallback(()=>{clearTimeout(c.current),!f.current&&!p.current&&(u.current=window.setTimeout(()=>v(!1),a))},[a,v]),w=m.useCallback(()=>v(!1),[v]);return m.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(u.current)},[]),m.createElement(GX,{scope:t,open:g,onOpenChange:v,onOpen:b,onClose:x,onDismiss:w,hasSelectionRef:f,isPointerDownOnContentRef:p},m.createElement(Pf,l,n))},KX="HoverCardTrigger",XX=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=u1(KX,n),i=c1(n);return m.createElement(Tf,fe({asChild:!0},i),m.createElement(Qe.a,fe({"data-state":o.open?"open":"closed"},r,{ref:t,onPointerEnter:De(e.onPointerEnter,xg(o.onOpen)),onPointerLeave:De(e.onPointerLeave,xg(o.onClose)),onFocus:De(e.onFocus,o.onOpen),onBlur:De(e.onBlur,o.onClose),onTouchStart:De(e.onTouchStart,s=>s.preventDefault())})))}),QX="HoverCardPortal",[Zge,JX]=gk(QX,{forceMount:void 0}),Qy="HoverCardContent",ZX=m.forwardRef((e,t)=>{const n=JX(Qy,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,i=u1(Qy,e.__scopeHoverCard);return m.createElement(Mn,{present:r||i.open},m.createElement(eQ,fe({"data-state":i.open?"open":"closed"},o,{onPointerEnter:De(e.onPointerEnter,xg(i.onOpen)),onPointerLeave:De(e.onPointerLeave,xg(i.onClose)),ref:t})))}),eQ=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,...a}=e,l=u1(Qy,n),c=c1(n),u=m.useRef(null),f=ft(t,u),[p,g]=m.useState(!1);return m.useEffect(()=>{if(p){const v=document.body;return Hb=v.style.userSelect||v.style.webkitUserSelect,v.style.userSelect="none",v.style.webkitUserSelect="none",()=>{v.style.userSelect=Hb,v.style.webkitUserSelect=Hb}}},[p]),m.useEffect(()=>{if(u.current){const v=()=>{g(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var b;((b=document.getSelection())===null||b===void 0?void 0:b.toString())!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",v),()=>{document.removeEventListener("pointerup",v),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),m.useEffect(()=>{u.current&&tQ(u.current).forEach(b=>b.setAttribute("tabindex","-1"))}),m.createElement(Yc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:De(i,v=>{v.preventDefault()}),onDismiss:l.onDismiss},m.createElement(Df,fe({},c,a,{onPointerDown:De(a.onPointerDown,v=>{v.currentTarget.contains(v.target)&&g(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:f,style:{...a.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})))});function xg(e){return t=>t.pointerType==="touch"?void 0:e()}function tQ(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}const nQ=YX,rQ=XX,mk=ZX,d1=nQ,f1=rQ,xm=ge.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>O.jsx(mk,{ref:o,align:t,sideOffset:n,className:Pe("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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),...r}));xm.displayName=mk.displayName;function oQ({card:e}){const{setCardInfo:t}=Ci();return O.jsxs(d1,{openDelay:0,children:[O.jsx(f1,{children:O.jsx(KY,{className:"size-4 text-muted-foreground/40"})}),O.jsx(xm,{align:"start",className:"w-[300px]",onMouseDown:n=>n.stopPropagation(),children:O.jsx(na,{type:"textarea",text:e.info||"",onSave:n=>t(e.id,n),children:O.jsx("p",{className:"text-sm text-muted-foreground",children:e.info||"Double-click to add info"})})})]})}const h1=ge.forwardRef(({className:e,containerClassName:t,containerStyle:n,...r},o)=>O.jsx("div",{style:n,className:Pe("relative w-full overflow-auto",t),children:O.jsx("table",{ref:o,className:Pe("w-full caption-bottom text-sm",e),...r})}));h1.displayName="Table";const p1=ge.forwardRef(({className:e,...t},n)=>O.jsx("thead",{ref:n,className:Pe("[&_tr]:border-b",e),...t}));p1.displayName="TableHeader";const g1=ge.forwardRef(({className:e,...t},n)=>O.jsx("tbody",{ref:n,className:Pe("[&_tr:last-child]:border-0",e),...t}));g1.displayName="TableBody";const iQ=ge.forwardRef(({className:e,...t},n)=>O.jsx("tfoot",{ref:n,className:Pe("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));iQ.displayName="TableFooter";const ld=ge.forwardRef(({className:e,...t},n)=>O.jsx("tr",{ref:n,className:Pe("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));ld.displayName="TableRow";const m1=ge.forwardRef(({className:e,...t},n)=>O.jsx("th",{ref:n,className:Pe("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));m1.displayName="TableHead";const wg=ge.forwardRef(({className:e,...t},n)=>O.jsx("td",{ref:n,className:Pe("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));wg.displayName="TableCell";const sQ=ge.forwardRef(({className:e,...t},n)=>O.jsx("caption",{ref:n,className:Pe("mt-4 text-sm text-muted-foreground",e),...t}));sQ.displayName="TableCaption";/**
|
|
253
|
+
`),s=new Blob([i],{type:"text/csv"}),a=window.URL.createObjectURL(s),l=document.createElement("a");l.setAttribute("hidden",""),l.setAttribute("href",a),l.setAttribute("download",t),document.body.appendChild(l),l.click(),document.body.removeChild(l)};return O.jsx(GY,{onClick:n,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})};function tK({frame:e}){var _;const t=Ie(S=>S.isDashboardEditing),n=Ie(S=>S.filterValues),r=Ie(S=>S.isVisualEditing),o=Ie(S=>S.selectedSheetId);Ie(S=>S.currentBreakpoint);const{removeFrame:i}=Ie(S=>S.actions),s=Ie(S=>S.actions.setIsVisualEditing),a=$r(S=>S.actions.setFilterValues),l=$r(S=>S.actions.setApplyFilters),{setCard:c,setFrame:u,setQueryResultColumns:f}=$r(S=>S.actions),p=$r(S=>S.actions.setSelectedConnectionId),g=$r(S=>S.actions.setSelectedDatabaseName),v=$r(S=>S.actions.setSelectedSchemaName),b=$r(S=>S.actions.setSelectedTableName),x=e.cards.find(S=>S.id===e.activeCardId);function w(){s(!r),c(x);const{dimensionKeys:S}=ar((x==null?void 0:x.data)||[]);f(S),u(e),x!=null&&x.connectionId&&p(x==null?void 0:x.connectionId),x!=null&&x.lastSelectedDatabase&&g(x==null?void 0:x.lastSelectedDatabase),x!=null&&x.lastSelectedSchema&&v(x==null?void 0:x.lastSelectedSchema),x!=null&&x.lastSelectedTable&&b(x==null?void 0:x.lastSelectedTable),n&&(a(n),l(!0))}return O.jsx("section",{className:"absolute right-2 top-2 z-10",children:O.jsxs("div",{className:"flex items-center gap-2",children:[t&&(r?O.jsx(yY,{onClick:()=>{s(!r)},className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"}):O.jsx(wY,{role:"edit-visual",onClick:w,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})),t&&O.jsx(k$,{onClick:()=>i(o,e.id),className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"}),((_=x.preferences)==null?void 0:_.allowDownload)===!0&&O.jsx(eK,{data:(x==null?void 0:x.data)||[],filename:x.title})]})})}function nK(e,t=globalThis==null?void 0:globalThis.document){const n=Fn(e);m.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const Gy="dismissableLayer.update",rK="dismissableLayer.pointerDownOutside",oK="dismissableLayer.focusOutside";let mO;const iK=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Yc=m.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...c}=e,u=m.useContext(iK),[f,p]=m.useState(null),g=(n=f==null?void 0:f.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,v]=m.useState({}),b=ft(t,M=>p(M)),x=Array.from(u.layers),[w]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),_=x.indexOf(w),S=f?x.indexOf(f):-1,R=u.layersWithOutsidePointerEventsDisabled.size>0,C=S>=_,P=sK(M=>{const T=M.target,I=[...u.branches].some(F=>F.contains(T));!C||I||(i==null||i(M),a==null||a(M),M.defaultPrevented||l==null||l())},g),A=aK(M=>{const T=M.target;[...u.branches].some(F=>F.contains(T))||(s==null||s(M),a==null||a(M),M.defaultPrevented||l==null||l())},g);return nK(M=>{S===u.layers.size-1&&(o==null||o(M),!M.defaultPrevented&&l&&(M.preventDefault(),l()))},g),m.useEffect(()=>{if(f)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(mO=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),vO(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=mO)}},[f,g,r,u]),m.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),vO())},[f,u]),m.useEffect(()=>{const M=()=>v({});return document.addEventListener(Gy,M),()=>document.removeEventListener(Gy,M)},[]),m.createElement(Qe.div,fe({},c,{ref:b,style:{pointerEvents:R?C?"auto":"none":void 0,...e.style},onFocusCapture:De(e.onFocusCapture,A.onFocusCapture),onBlurCapture:De(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:De(e.onPointerDownCapture,P.onPointerDownCapture)}))});function sK(e,t=globalThis==null?void 0:globalThis.document){const n=Fn(e),r=m.useRef(!1),o=m.useRef(()=>{});return m.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let c=function(){j$(rK,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function aK(e,t=globalThis==null?void 0:globalThis.document){const n=Fn(e),r=m.useRef(!1);return m.useEffect(()=>{const o=i=>{i.target&&!r.current&&j$(oK,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function vO(){const e=new CustomEvent(Gy);document.dispatchEvent(e)}function j$(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?ET(o,i):o.dispatchEvent(i)}const lK=["top","right","bottom","left"],ia=Math.min,no=Math.max,mg=Math.round,op=Math.floor,sa=e=>({x:e,y:e}),cK={left:"right",right:"left",bottom:"top",top:"bottom"},uK={start:"end",end:"start"};function Yy(e,t,n){return no(e,ia(t,n))}function as(e,t){return typeof e=="function"?e(t):e}function ls(e){return e.split("-")[0]}function Kc(e){return e.split("-")[1]}function Xw(e){return e==="x"?"y":"x"}function Qw(e){return e==="y"?"height":"width"}function Xc(e){return["top","bottom"].includes(ls(e))?"y":"x"}function Jw(e){return Xw(Xc(e))}function dK(e,t,n){n===void 0&&(n=!1);const r=Kc(e),o=Jw(e),i=Qw(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=vg(s)),[s,vg(s)]}function fK(e){const t=vg(e);return[Ky(e),t,Ky(t)]}function Ky(e){return e.replace(/start|end/g,t=>uK[t])}function hK(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function pK(e,t,n,r){const o=Kc(e);let i=hK(ls(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Ky)))),i}function vg(e){return e.replace(/left|right|bottom|top/g,t=>cK[t])}function gK(e){return{top:0,right:0,bottom:0,left:0,...e}}function B$(e){return typeof e!="number"?gK(e):{top:e,right:e,bottom:e,left:e}}function bg(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function bO(e,t,n){let{reference:r,floating:o}=e;const i=Xc(t),s=Jw(t),a=Qw(s),l=ls(t),c=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let g;switch(l){case"top":g={x:u,y:r.y-o.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:f};break;case"left":g={x:r.x-o.width,y:f};break;default:g={x:r.x,y:r.y}}switch(Kc(t)){case"start":g[s]-=p*(n&&c?-1:1);break;case"end":g[s]+=p*(n&&c?-1:1);break}return g}const mK=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=bO(c,r,l),p=r,g={},v=0;for(let b=0;b<a.length;b++){const{name:x,fn:w}=a[b],{x:_,y:S,data:R,reset:C}=await w({x:u,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:g,rects:c,platform:s,elements:{reference:e,floating:t}});if(u=_??u,f=S??f,g={...g,[x]:{...g[x],...R}},C&&v<=50){v++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(c=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:f}=bO(c,p,l)),b=-1;continue}}return{x:u,y:f,placement:p,strategy:o,middlewareData:g}};async function Od(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:g=0}=as(t,e),v=B$(g),x=a[p?f==="floating"?"reference":"floating":f],w=bg(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),_=f==="floating"?{...s.floating,x:r,y:o}:s.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),R=await(i.isElement==null?void 0:i.isElement(S))?await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1}:{x:1,y:1},C=bg(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:_,offsetParent:S,strategy:l}):_);return{top:(w.top-C.top+v.top)/R.y,bottom:(C.bottom-w.bottom+v.bottom)/R.y,left:(w.left-C.left+v.left)/R.x,right:(C.right-w.right+v.right)/R.x}}const yO=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=as(e,t)||{};if(c==null)return{};const f=B$(u),p={x:n,y:r},g=Jw(o),v=Qw(g),b=await s.getDimensions(c),x=g==="y",w=x?"top":"left",_=x?"bottom":"right",S=x?"clientHeight":"clientWidth",R=i.reference[v]+i.reference[g]-p[g]-i.floating[v],C=p[g]-i.reference[g],P=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let A=P?P[S]:0;(!A||!await(s.isElement==null?void 0:s.isElement(P)))&&(A=a.floating[S]||i.floating[v]);const M=R/2-C/2,T=A/2-b[v]/2-1,I=ia(f[w],T),F=ia(f[_],T),j=I,X=A-b[v]-F,G=A/2-b[v]/2+M,B=Yy(j,G,X),J=!l.arrow&&Kc(o)!=null&&G!=B&&i.reference[v]/2-(G<j?I:F)-b[v]/2<0,H=J?G<j?G-j:G-X:0;return{[g]:p[g]+H,data:{[g]:B,centerOffset:G-B-H,...J&&{alignmentOffset:H}},reset:J}}}),vK=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:b=!0,...x}=as(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=ls(o),_=ls(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),R=p||(_||!b?[vg(a)]:fK(a));!p&&v!=="none"&&R.push(...pK(a,b,v,S));const C=[a,...R],P=await Od(t,x),A=[];let M=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&A.push(P[w]),f){const j=dK(o,s,S);A.push(P[j[0]],P[j[1]])}if(M=[...M,{placement:o,overflows:A}],!A.every(j=>j<=0)){var T,I;const j=(((T=i.flip)==null?void 0:T.index)||0)+1,X=C[j];if(X)return{data:{index:j,overflows:M},reset:{placement:X}};let G=(I=M.filter(B=>B.overflows[0]<=0).sort((B,J)=>B.overflows[1]-J.overflows[1])[0])==null?void 0:I.placement;if(!G)switch(g){case"bestFit":{var F;const B=(F=M.map(J=>[J.placement,J.overflows.filter(H=>H>0).reduce((H,Y)=>H+Y,0)]).sort((J,H)=>J[1]-H[1])[0])==null?void 0:F[0];B&&(G=B);break}case"initialPlacement":G=a;break}if(o!==G)return{reset:{placement:G}}}return{}}}};function xO(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wO(e){return lK.some(t=>e[t]>=0)}const bK=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=as(e,t);switch(r){case"referenceHidden":{const i=await Od(t,{...o,elementContext:"reference"}),s=xO(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:wO(s)}}}case"escaped":{const i=await Od(t,{...o,altBoundary:!0}),s=xO(i,n.floating);return{data:{escapedOffsets:s,escaped:wO(s)}}}default:return{}}}}};async function yK(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=ls(n),a=Kc(n),l=Xc(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,f=as(t,e);let{mainAxis:p,crossAxis:g,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof v=="number"&&(g=a==="end"?v*-1:v),l?{x:g*u,y:p*c}:{x:p*c,y:g*u}}const xK=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await yK(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},wK=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:x=>{let{x:w,y:_}=x;return{x:w,y:_}}},...l}=as(e,t),c={x:n,y:r},u=await Od(t,l),f=Xc(ls(o)),p=Xw(f);let g=c[p],v=c[f];if(i){const x=p==="y"?"top":"left",w=p==="y"?"bottom":"right",_=g+u[x],S=g-u[w];g=Yy(_,g,S)}if(s){const x=f==="y"?"top":"left",w=f==="y"?"bottom":"right",_=v+u[x],S=v-u[w];v=Yy(_,v,S)}const b=a.fn({...t,[p]:g,[f]:v});return{...b,data:{x:b.x-n,y:b.y-r}}}}},_K=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=as(e,t),u={x:n,y:r},f=Xc(o),p=Xw(f);let g=u[p],v=u[f];const b=as(a,t),x=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const S=p==="y"?"height":"width",R=i.reference[p]-i.floating[S]+x.mainAxis,C=i.reference[p]+i.reference[S]-x.mainAxis;g<R?g=R:g>C&&(g=C)}if(c){var w,_;const S=p==="y"?"width":"height",R=["top","left"].includes(ls(o)),C=i.reference[f]-i.floating[S]+(R&&((w=s.offset)==null?void 0:w[f])||0)+(R?0:x.crossAxis),P=i.reference[f]+i.reference[S]+(R?0:((_=s.offset)==null?void 0:_[f])||0)-(R?x.crossAxis:0);v<C?v=C:v>P&&(v=P)}return{[p]:g,[f]:v}}}},SK=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=as(e,t),l=await Od(t,a),c=ls(n),u=Kc(n),f=Xc(n)==="y",{width:p,height:g}=r.floating;let v,b;c==="top"||c==="bottom"?(v=c,b=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(b=c,v=u==="end"?"top":"bottom");const x=g-l[v],w=p-l[b],_=!t.middlewareData.shift;let S=x,R=w;if(f){const P=p-l.left-l.right;R=u||_?ia(w,P):P}else{const P=g-l.top-l.bottom;S=u||_?ia(x,P):P}if(_&&!u){const P=no(l.left,0),A=no(l.right,0),M=no(l.top,0),T=no(l.bottom,0);f?R=p-2*(P!==0||A!==0?P+A:no(l.left,l.right)):S=g-2*(M!==0||T!==0?M+T:no(l.top,l.bottom))}await s({...t,availableWidth:R,availableHeight:S});const C=await o.getDimensions(i.floating);return p!==C.width||g!==C.height?{reset:{rects:!0}}:{}}}};function aa(e){return V$(e)?(e.nodeName||"").toLowerCase():"#document"}function so(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ds(e){var t;return(t=(V$(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function V$(e){return e instanceof Node||e instanceof so(e).Node}function cs(e){return e instanceof Element||e instanceof so(e).Element}function wi(e){return e instanceof HTMLElement||e instanceof so(e).HTMLElement}function _O(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof so(e).ShadowRoot}function Of(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=$o(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function CK(e){return["table","td","th"].includes(aa(e))}function Zw(e){const t=e1(),n=$o(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 EK(e){let t=Lc(e);for(;wi(t)&&!pm(t);){if(Zw(t))return t;t=Lc(t)}return null}function e1(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function pm(e){return["html","body","#document"].includes(aa(e))}function $o(e){return so(e).getComputedStyle(e)}function gm(e){return cs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Lc(e){if(aa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_O(e)&&e.host||ds(e);return _O(t)?t.host:t}function H$(e){const t=Lc(e);return pm(t)?e.ownerDocument?e.ownerDocument.body:e.body:wi(t)&&Of(t)?t:H$(t)}function Pd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=H$(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=so(o);return i?t.concat(s,s.visualViewport||[],Of(o)?o:[],s.frameElement&&n?Pd(s.frameElement):[]):t.concat(o,Pd(o,[],n))}function W$(e){const t=$o(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=wi(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=mg(n)!==i||mg(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function t1(e){return cs(e)?e:e.contextElement}function uc(e){const t=t1(e);if(!wi(t))return sa(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=W$(t);let s=(i?mg(n.width):n.width)/r,a=(i?mg(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const RK=sa(0);function U$(e){const t=so(e);return!e1()||!t.visualViewport?RK:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function OK(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==so(e)?!1:t}function fl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=t1(e);let s=sa(1);t&&(r?cs(r)&&(s=uc(r)):s=uc(e));const a=OK(i,n,r)?U$(i):sa(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const p=so(i),g=r&&cs(r)?so(r):r;let v=p.frameElement;for(;v&&r&&g!==p;){const b=uc(v),x=v.getBoundingClientRect(),w=$o(v),_=x.left+(v.clientLeft+parseFloat(w.paddingLeft))*b.x,S=x.top+(v.clientTop+parseFloat(w.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,f*=b.y,l+=_,c+=S,v=so(v).frameElement}}return bg({width:u,height:f,x:l,y:c})}function PK(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=wi(n),i=ds(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},a=sa(1);const l=sa(0);if((o||!o&&r!=="fixed")&&((aa(n)!=="body"||Of(i))&&(s=gm(n)),wi(n))){const c=fl(n);a=uc(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+l.x,y:t.y*a.y-s.scrollTop*a.y+l.y}}function TK(e){return Array.from(e.getClientRects())}function q$(e){return fl(ds(e)).left+gm(e).scrollLeft}function DK(e){const t=ds(e),n=gm(e),r=e.ownerDocument.body,o=no(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=no(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+q$(e);const a=-n.scrollTop;return $o(r).direction==="rtl"&&(s+=no(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function $K(e,t){const n=so(e),r=ds(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=e1();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function kK(e,t){const n=fl(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=wi(e)?uc(e):sa(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function SO(e,t,n){let r;if(t==="viewport")r=$K(e,n);else if(t==="document")r=DK(ds(e));else if(cs(t))r=kK(t,n);else{const o=U$(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return bg(r)}function G$(e,t){const n=Lc(e);return n===t||!cs(n)||pm(n)?!1:$o(n).position==="fixed"||G$(n,t)}function MK(e,t){const n=t.get(e);if(n)return n;let r=Pd(e,[],!1).filter(a=>cs(a)&&aa(a)!=="body"),o=null;const i=$o(e).position==="fixed";let s=i?Lc(e):e;for(;cs(s)&&!pm(s);){const a=$o(s),l=Zw(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Of(s)&&!l&&G$(e,s))?r=r.filter(u=>u!==s):o=a,s=Lc(s)}return t.set(e,r),r}function AK(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?MK(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const f=SO(t,u,o);return c.top=no(f.top,c.top),c.right=ia(f.right,c.right),c.bottom=ia(f.bottom,c.bottom),c.left=no(f.left,c.left),c},SO(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function IK(e){return W$(e)}function NK(e,t,n){const r=wi(t),o=ds(t),i=n==="fixed",s=fl(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=sa(0);if(r||!r&&!i)if((aa(t)!=="body"||Of(o))&&(a=gm(t)),r){const c=fl(t,!0,i,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else o&&(l.x=q$(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function CO(e,t){return!wi(e)||$o(e).position==="fixed"?null:t?t(e):e.offsetParent}function Y$(e,t){const n=so(e);if(!wi(e))return n;let r=CO(e,t);for(;r&&CK(r)&&$o(r).position==="static";)r=CO(r,t);return r&&(aa(r)==="html"||aa(r)==="body"&&$o(r).position==="static"&&!Zw(r))?n:r||EK(e)||n}const LK=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||Y$,i=this.getDimensions;return{reference:NK(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function FK(e){return $o(e).direction==="rtl"}const zK={convertOffsetParentRelativeRectToViewportRelativeRect:PK,getDocumentElement:ds,getClippingRect:AK,getOffsetParent:Y$,getElementRects:LK,getClientRects:TK,getDimensions:IK,getScale:uc,isElement:cs,isRTL:FK};function jK(e,t){let n=null,r;const o=ds(e);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:f,height:p}=e.getBoundingClientRect();if(a||t(),!f||!p)return;const g=op(u),v=op(o.clientWidth-(c+f)),b=op(o.clientHeight-(u+p)),x=op(c),_={rootMargin:-g+"px "+-v+"px "+-b+"px "+-x+"px",threshold:no(0,ia(1,l))||1};let S=!0;function R(C){const P=C[0].intersectionRatio;if(P!==l){if(!S)return s();P?s(!1,P):r=setTimeout(()=>{s(!1,1e-7)},100)}S=!1}try{n=new IntersectionObserver(R,{..._,root:o.ownerDocument})}catch{n=new IntersectionObserver(R,_)}n.observe(e)}return s(!0),i}function BK(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=t1(e),u=o||i?[...c?Pd(c):[],...Pd(t)]:[];u.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const f=c&&a?jK(c,n):null;let p=-1,g=null;s&&(g=new ResizeObserver(w=>{let[_]=w;_&&_.target===c&&g&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{g&&g.observe(t)})),n()}),c&&!l&&g.observe(c),g.observe(t));let v,b=l?fl(e):null;l&&x();function x(){const w=fl(e);b&&(w.x!==b.x||w.y!==b.y||w.width!==b.width||w.height!==b.height)&&n(),b=w,v=requestAnimationFrame(x)}return n(),()=>{u.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),f&&f(),g&&g.disconnect(),g=null,l&&cancelAnimationFrame(v)}}const VK=(e,t,n)=>{const r=new Map,o={platform:zK,...n},i={...o.platform,_c:r};return mK(e,t,{...o,platform:i})},HK=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?yO({element:r.current,padding:o}).fn(n):{}:r?yO({element:r,padding:o}).fn(n):{}}}};var Hp=typeof document<"u"?m.useLayoutEffect:m.useEffect;function yg(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,o;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(!yg(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!yg(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function K$(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function EO(e,t){const n=K$(e);return Math.round(t*n)/n}function RO(e){const t=ge.useRef(e);return Hp(()=>{t.current=e}),t}function WK(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,f]=ge.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,g]=ge.useState(r);yg(p,r)||g(r);const[v,b]=ge.useState(null),[x,w]=ge.useState(null),_=ge.useCallback(J=>{J!=P.current&&(P.current=J,b(J))},[b]),S=ge.useCallback(J=>{J!==A.current&&(A.current=J,w(J))},[w]),R=i||v,C=s||x,P=ge.useRef(null),A=ge.useRef(null),M=ge.useRef(u),T=RO(l),I=RO(o),F=ge.useCallback(()=>{if(!P.current||!A.current)return;const J={placement:t,strategy:n,middleware:p};I.current&&(J.platform=I.current),VK(P.current,A.current,J).then(H=>{const Y={...H,isPositioned:!0};j.current&&!yg(M.current,Y)&&(M.current=Y,v9.flushSync(()=>{f(Y)}))})},[p,t,n,I]);Hp(()=>{c===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,f(J=>({...J,isPositioned:!1})))},[c]);const j=ge.useRef(!1);Hp(()=>(j.current=!0,()=>{j.current=!1}),[]),Hp(()=>{if(R&&(P.current=R),C&&(A.current=C),R&&C){if(T.current)return T.current(R,C,F);F()}},[R,C,F,T]);const X=ge.useMemo(()=>({reference:P,floating:A,setReference:_,setFloating:S}),[_,S]),G=ge.useMemo(()=>({reference:R,floating:C}),[R,C]),B=ge.useMemo(()=>{const J={position:n,left:0,top:0};if(!G.floating)return J;const H=EO(G.floating,u.x),Y=EO(G.floating,u.y);return a?{...J,transform:"translate("+H+"px, "+Y+"px)",...K$(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:Y}},[n,a,G.floating,u.x,u.y]);return ge.useMemo(()=>({...u,update:F,refs:X,elements:G,floatingStyles:B}),[u,F,X,G,B])}function mm(e){const[t,n]=m.useState(void 0);return cr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const X$="Popper",[Q$,Pi]=Gn(X$),[UK,J$]=Q$(X$),qK=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return m.createElement(UK,{scope:t,anchor:r,onAnchorChange:o},n)},GK="PopperAnchor",YK=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=J$(GK,n),s=m.useRef(null),a=ft(t,s);return m.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:m.createElement(Qe.div,fe({},o,{ref:a}))}),Z$="PopperContent",[KK,Yge]=Q$(Z$),XK=m.forwardRef((e,t)=>{var n,r,o,i,s,a,l,c;const{__scopePopper:u,side:f="bottom",sideOffset:p=0,align:g="center",alignOffset:v=0,arrowPadding:b=0,avoidCollisions:x=!0,collisionBoundary:w=[],collisionPadding:_=0,sticky:S="partial",hideWhenDetached:R=!1,updatePositionStrategy:C="optimized",onPlaced:P,...A}=e,M=J$(Z$,u),[T,I]=m.useState(null),F=ft(t,Oe=>I(Oe)),[j,X]=m.useState(null),G=mm(j),B=(n=G==null?void 0:G.width)!==null&&n!==void 0?n:0,J=(r=G==null?void 0:G.height)!==null&&r!==void 0?r:0,H=f+(g!=="center"?"-"+g:""),Y=typeof _=="number"?_:{top:0,right:0,bottom:0,left:0,..._},te=Array.isArray(w)?w:[w],$=te.length>0,V={padding:Y,boundary:te.filter(QK),altBoundary:$},{refs:Q,floatingStyles:N,placement:le,isPositioned:se,middlewareData:ue}=WK({strategy:"fixed",placement:H,whileElementsMounted:(...Oe)=>BK(...Oe,{animationFrame:C==="always"}),elements:{reference:M.anchor},middleware:[xK({mainAxis:p+J,alignmentAxis:v}),x&&wK({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?_K():void 0,...V}),x&&vK({...V}),SK({...V,apply:({elements:Oe,rects:Te,availableWidth:Ue,availableHeight:Be})=>{const{width:Ae,height:Ke}=Te.reference,lt=Oe.floating.style;lt.setProperty("--radix-popper-available-width",`${Ue}px`),lt.setProperty("--radix-popper-available-height",`${Be}px`),lt.setProperty("--radix-popper-anchor-width",`${Ae}px`),lt.setProperty("--radix-popper-anchor-height",`${Ke}px`)}}),j&&HK({element:j,padding:b}),JK({arrowWidth:B,arrowHeight:J}),R&&bK({strategy:"referenceHidden",...V})]}),[he,ie]=ek(le),ee=Fn(P);cr(()=>{se&&(ee==null||ee())},[se,ee]);const ae=(o=ue.arrow)===null||o===void 0?void 0:o.x,ye=(i=ue.arrow)===null||i===void 0?void 0:i.y,q=((s=ue.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[be,_e]=m.useState();return cr(()=>{T&&_e(window.getComputedStyle(T).zIndex)},[T]),m.createElement("div",{ref:Q.setFloating,"data-radix-popper-content-wrapper":"",style:{...N,transform:se?N.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[(a=ue.transformOrigin)===null||a===void 0?void 0:a.x,(l=ue.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},m.createElement(KK,{scope:u,placedSide:he,onArrowChange:X,arrowX:ae,arrowY:ye,shouldHideArrow:q},m.createElement(Qe.div,fe({"data-side":he,"data-align":ie},A,{ref:F,style:{...A.style,animation:se?void 0:"none",opacity:(c=ue.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function QK(e){return e!==null}const JK=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,s;const{placement:a,rects:l,middlewareData:c}=t,f=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,p=f?0:e.arrowWidth,g=f?0:e.arrowHeight,[v,b]=ek(a),x={start:"0%",center:"50%",end:"100%"}[b],w=((r=(o=c.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+p/2,_=((i=(s=c.arrow)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)+g/2;let S="",R="";return v==="bottom"?(S=f?x:`${w}px`,R=`${-g}px`):v==="top"?(S=f?x:`${w}px`,R=`${l.floating.height+g}px`):v==="right"?(S=`${-g}px`,R=f?x:`${_}px`):v==="left"&&(S=`${l.floating.width+g}px`,R=f?x:`${_}px`),{data:{x:S,y:R}}}});function ek(e){const[t,n="center"]=e.split("-");return[t,n]}const Pf=qK,Tf=YK,Df=XK,vm=m.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?Qo.createPortal(m.createElement(Qe.div,fe({},o,{ref:t})),r):null}),tk=m.forwardRef((e,t)=>m.createElement(Qe.span,fe({},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}}))),ZK=tk,[bm,Kge]=Gn("Tooltip",[Pi]),n1=Pi(),eX="TooltipProvider",tX=700,Xy="tooltip.open",[nX,r1]=bm(eX),rX=e=>{const{__scopeTooltip:t,delayDuration:n=tX,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[s,a]=m.useState(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),m.createElement(nX,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(u=>{l.current=u},[]),disableHoverableContent:o},i)},o1="Tooltip",[oX,ym]=bm(o1),iX=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=r1(o1,e.__scopeTooltip),c=n1(t),[u,f]=m.useState(null),p=Nr(),g=m.useRef(0),v=s??l.disableHoverableContent,b=a??l.delayDuration,x=m.useRef(!1),[w=!1,_]=ur({prop:r,defaultProp:o,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(Xy))):l.onClose(),i==null||i(A)}}),S=m.useMemo(()=>w?x.current?"delayed-open":"instant-open":"closed",[w]),R=m.useCallback(()=>{window.clearTimeout(g.current),x.current=!1,_(!0)},[_]),C=m.useCallback(()=>{window.clearTimeout(g.current),_(!1)},[_]),P=m.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{x.current=!0,_(!0)},b)},[b,_]);return m.useEffect(()=>()=>window.clearTimeout(g.current),[]),m.createElement(Pf,c,m.createElement(oX,{scope:t,contentId:p,open:w,stateAttribute:S,trigger:u,onTriggerChange:f,onTriggerEnter:m.useCallback(()=>{l.isOpenDelayed?P():R()},[l.isOpenDelayed,P,R]),onTriggerLeave:m.useCallback(()=>{v?C():window.clearTimeout(g.current)},[C,v]),onOpen:R,onClose:C,disableHoverableContent:v},n))},OO="TooltipTrigger",nk=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=ym(OO,n),i=r1(OO,n),s=n1(n),a=m.useRef(null),l=ft(t,a,o.onTriggerChange),c=m.useRef(!1),u=m.useRef(!1),f=m.useCallback(()=>c.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),m.createElement(Tf,fe({asChild:!0},s),m.createElement(Qe.button,fe({"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute},r,{ref:l,onPointerMove:De(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:De(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:De(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:De(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:De(e.onBlur,o.onClose),onClick:De(e.onClick,o.onClose)})))}),sX="TooltipPortal",[Xge,aX]=bm(sX,{forceMount:void 0}),Td="TooltipContent",lX=m.forwardRef((e,t)=>{const n=aX(Td,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=ym(Td,e.__scopeTooltip);return m.createElement(Mn,{present:r||s.open},s.disableHoverableContent?m.createElement(rk,fe({side:o},i,{ref:t})):m.createElement(cX,fe({side:o},i,{ref:t})))}),cX=m.forwardRef((e,t)=>{const n=ym(Td,e.__scopeTooltip),r=r1(Td,e.__scopeTooltip),o=m.useRef(null),i=ft(t,o),[s,a]=m.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:f}=r,p=m.useCallback(()=>{a(null),f(!1)},[f]),g=m.useCallback((v,b)=>{const x=v.currentTarget,w={x:v.clientX,y:v.clientY},_=dX(w,x.getBoundingClientRect()),S=fX(w,_),R=hX(b.getBoundingClientRect()),C=gX([...S,...R]);a(C),f(!0)},[f]);return m.useEffect(()=>()=>p(),[p]),m.useEffect(()=>{if(l&&u){const v=x=>g(x,u),b=x=>g(x,l);return l.addEventListener("pointerleave",v),u.addEventListener("pointerleave",b),()=>{l.removeEventListener("pointerleave",v),u.removeEventListener("pointerleave",b)}}},[l,u,g,p]),m.useEffect(()=>{if(s){const v=b=>{const x=b.target,w={x:b.clientX,y:b.clientY},_=(l==null?void 0:l.contains(x))||(u==null?void 0:u.contains(x)),S=!pX(w,s);_?p():S&&(p(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,u,s,c,p]),m.createElement(rk,fe({},e,{ref:i}))}),[uX,Qge]=bm(o1,{isInside:!1}),rk=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=ym(Td,n),c=n1(n),{onClose:u}=l;return m.useEffect(()=>(document.addEventListener(Xy,u),()=>document.removeEventListener(Xy,u)),[u]),m.useEffect(()=>{if(l.trigger){const f=p=>{const g=p.target;g!=null&&g.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),m.createElement(Yc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:u},m.createElement(Df,fe({"data-state":l.stateAttribute},c,a,{ref:t,style:{...a.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)"}}),m.createElement(CT,null,r),m.createElement(uX,{scope:n,isInside:!0},m.createElement(ZK,{id:l.contentId,role:"tooltip"},o||r))))});function dX(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function fX(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 hX(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function pX(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function gX(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),mX(t)}function mX(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}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)}const vX=rX,bX=iX,yX=nk,ok=lX,xX=vX,ik=bX,sk=yX,i1=ge.forwardRef(({className:e,sideOffset:t=4,...n},r)=>O.jsx(ok,{ref:r,sideOffset:t,className:Pe("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground 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}));i1.displayName=ok.displayName;function rl({number:e,decimalPlaces:t=0,useSuffix:n=!1,customSuffix:r="",currency:o="",locale:i="en-US"}){let s=1,a=r,l=i;const c=t;n&&!r&&(e>=1e9?(s=1e9,a="B"):e>=1e7&&i==="en-IN"?(s=1e7,a="Cr"):e>=1e5&&i==="en-IN"?(s=1e5,a="L"):e>=1e6?(s=1e6,a="M"):e>=1e3&&(s=1e3,a="K"));const u=e/s,f={maximumFractionDigits:c,minimumFractionDigits:c};if(o){f.style="currency",f.currency=o;try{new Intl.NumberFormat(i,f).format(0)}catch{f.currency="USD"}}try{new Intl.NumberFormat(i,f).format(0)}catch{l="en-US"}let g=new Intl.NumberFormat(l,f).format(u);return n&&(g+=a),g}function ak(e,t){if(!t)return"";const n=t.find(r=>e>=r.start&&e<=r.end);return(n==null?void 0:n.color)||""}function lk({card:e,isLoading:t}){var w,_,S,R,C,P,A,M,T,I,F,j,X,G,B,J,H,Y,te,$,V,Q,N,le;const n=Ie(se=>se.actions.setCardTitle),r=Ie(se=>se.actions.setCardDescription),o=Ie(se=>se.isVisualEditing),i=$r(se=>se.card),s=$r(se=>se.actions.setCard);$r(se=>se.actions.setNumberFormat);const a=Ie(se=>se.selectedSheetId),l=e.data,c=(_=(w=e.preferences)==null?void 0:w.formatNumber)==null?void 0:_.colorRanges,{metricKeys:u}=ar(l||[]),f=(S=l==null?void 0:l[0])==null?void 0:S[u==null?void 0:u[0]],p=(R=l==null?void 0:l[0])==null?void 0:R[u==null?void 0:u[1]],g=!!e.data&&e.data.length>0;function v(se){o?s({...i,title:se}):n(a,e.id,se)}function b(se){o?s({...i,description:se}):r(a,e.id,se)}const x=p&&p-f!==0?(f-p)/p:null;return O.jsxs("div",{className:"kpi-card flex grow flex-col overflow-scroll",children:[O.jsxs(Ug,{className:"grow pb-3",children:[O.jsx(na,{text:o?i.title:e.title,onSave:v,children:O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx(yf,{className:"text-base font-medium text-muted-foreground",children:e.title}),!e.refreshInterval&&t&&O.jsx(Gw,{className:"h-4 w-4 animate-spin text-muted-foreground"})]})}),g&&O.jsxs("div",{className:"flex flex-wrap items-end gap-3 text-foreground",children:[O.jsx("p",{style:{color:ak(f,c)},className:"text-3xl font-semibold",children:rl({number:f,decimalPlaces:((P=(C=e.preferences)==null?void 0:C.formatNumber)==null?void 0:P.decimalPlaces)||0,useSuffix:!!((M=(A=e.preferences)==null?void 0:A.formatNumber)!=null&&M.suffix),customSuffix:((I=(T=e.preferences)==null?void 0:T.formatNumber)==null?void 0:I.suffix)||"",locale:((j=(F=e.preferences)==null?void 0:F.formatNumber)==null?void 0:j.locale)||"",currency:((G=(X=e.preferences)==null?void 0:X.formatNumber)==null?void 0:G.currency)||""})}),p&&O.jsxs("span",{className:"min-w-fit text-base font-normal text-muted-foreground",children:["from ",rl({number:p,decimalPlaces:((J=(B=e.preferences)==null?void 0:B.formatNumber)==null?void 0:J.decimalPlaces)||0,useSuffix:!!((Y=(H=e.preferences)==null?void 0:H.formatNumber)!=null&&Y.suffix),customSuffix:(($=(te=e.preferences)==null?void 0:te.formatNumber)==null?void 0:$.suffix)||"",locale:((Q=(V=e.preferences)==null?void 0:V.formatNumber)==null?void 0:Q.locale)||"",currency:((le=(N=e.preferences)==null?void 0:N.formatNumber)==null?void 0:le.currency)||""})]})]})]}),x&&O.jsxs(qg,{className:"grow items-start gap-1 pb-4 text-sm",children:[O.jsx(wX,{children:x}),O.jsxs("div",{className:"flex gap-1 text-muted-foreground",children:[x>0?"up ":"down ",O.jsx(na,{text:e.description||"",onSave:b,children:e.description})]})]})]})}function wX({children:e}){const t=e>0?O.jsx(Uw,{className:"h-4 w-4"}):O.jsx(Ww,{className:"h-4 w-4"}),n=`${Math.abs(e*100).toFixed(0)}%`;return O.jsxs("div",{className:Pe("flex items-center",{"text-green-600":e>0,"text-destructive":e<0}),children:[t,O.jsx("span",{className:"ml-[1px]",children:n})]})}var Fc=1e3,zc=Fc*60,jc=zc*60,hl=jc*24,_X=hl*7,SX=hl*365.25,CX=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return EX(e);if(n==="number"&&isFinite(e))return t.long?OX(e):RX(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function EX(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*SX;case"weeks":case"week":case"w":return n*_X;case"days":case"day":case"d":return n*hl;case"hours":case"hour":case"hrs":case"hr":case"h":return n*jc;case"minutes":case"minute":case"mins":case"min":case"m":return n*zc;case"seconds":case"second":case"secs":case"sec":case"s":return n*Fc;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function RX(e){var t=Math.abs(e);return t>=hl?Math.round(e/hl)+"d":t>=jc?Math.round(e/jc)+"h":t>=zc?Math.round(e/zc)+"m":t>=Fc?Math.round(e/Fc)+"s":e+"ms"}function OX(e){var t=Math.abs(e);return t>=hl?ip(e,t,hl,"day"):t>=jc?ip(e,t,jc,"hour"):t>=zc?ip(e,t,zc,"minute"):t>=Fc?ip(e,t,Fc,"second"):e+" ms"}function ip(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}const PX=Uc(CX);function ck({children:e}){const{setIsSessionExpired:t}=Ci(),n=new J8({queryCache:new gT({onError:r=>{console.error(`Something went wrong: ${r.message}`),r.message==="invalid token"&&t(!0)}}),defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});return O.jsx(nz,{client:n,children:e})}const TX={id:"",authToken:void 0},uk=m.createContext(TX),dk=({children:e,dashboardProps:t})=>O.jsx(ck,{children:O.jsx(uk.Provider,{value:t,children:e})});function fa(){const e=m.useContext(uk);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function DX(e){Ie(c=>c.bookmarkKey);const t=Ie(c=>c.dashboard.baseQueries),{authToken:n}=fa(),r=Ie(c=>c.authToken),o=Ie(c=>c.filterValues),i=Ie(c=>c.isDashboardEditing),s=PX((e==null?void 0:e.refreshInterval)||"0"),a=Y2(e.sql,t);return bf({queryKey:[e.id,a],queryFn:()=>gf("https://semaphor.cloud/api/v1/query",(n==null?void 0:n.accessToken)||(r==null?void 0:r.accessToken)||"",{connection_id:e.connectionId,sql:a,python:e.python===aT?"":e.python,active_filters:o}),refetchInterval:s,enabled:!!e.connectionId&&!i})}function $a({data:e,cfg:t,customCfg:n,preferences:r}){const{dimensionKeys:o,metricKeys:i}=ar(e),s=LY(i,e,r),a=Vp(s,n),l=o[0],c=Uy(e,l);s1(r,t),fk(r);const u=hk(t,r),f=os.merge((t==null?void 0:t.options)||{},r==null?void 0:r.chartOptions),p=os.merge(u,f),g=Yi(p,(n==null?void 0:n.options)||{});return{type:(n==null?void 0:n.type)||(t==null?void 0:t.type)||"bar",data:{labels:c,datasets:a},options:g}}function s1(e,t){var o,i,s;const n=((o=t==null?void 0:t.options)==null?void 0:o.indexAxis)==="y"?"x":"y";return(i=e==null?void 0:e.chartOptions)!=null&&i.indexAxis?((s=e==null?void 0:e.chartOptions)==null?void 0:s.indexAxis)==="x"?"y":"x":n}function fk(e){var n,r;return(n=e==null?void 0:e.chartOptions)!=null&&n.indexAxis?((r=e==null?void 0:e.chartOptions)==null?void 0:r.indexAxis)==="x"?"x":"y":"x"}function hk(e,t){var i,s,a,l,c,u,f,p,g,v,b,x;const n=s1(t,e),r=fk(t);return{...e==null?void 0:e.options,scales:{...(i=e==null?void 0:e.options)==null?void 0:i.scales,[n]:{...(a=(s=e==null?void 0:e.options)==null?void 0:s.scales)==null?void 0:a[n],ticks:{...(u=(c=(l=e==null?void 0:e.options)==null?void 0:l.scales)==null?void 0:c[n])==null?void 0:u.ticks,callback:w=>{var _,S,R,C;return rl({number:Number(w),decimalPlaces:((_=t==null?void 0:t.numberAxisFormat)==null?void 0:_.decimalPlaces)||0,useSuffix:!!((S=t==null?void 0:t.numberAxisFormat)!=null&&S.suffix),customSuffix:"",locale:((R=t==null?void 0:t.numberAxisFormat)==null?void 0:R.locale)||"",currency:((C=t==null?void 0:t.numberAxisFormat)==null?void 0:C.currency)||""})}}},[r]:{...(g=(p=(f=e==null?void 0:e.options)==null?void 0:f.scales)==null?void 0:p[r])==null?void 0:g.ticks,callback:null}},plugins:{...(v=e==null?void 0:e.options)==null?void 0:v.plugins,datalabels:{...(x=(b=e==null?void 0:e.options)==null?void 0:b.plugins)==null?void 0:x.datalabels,formatter:function(w){var _,S,R,C;return rl({number:Number(w),decimalPlaces:((_=t==null?void 0:t.numberAxisFormat)==null?void 0:_.decimalPlaces)||0,useSuffix:!!((S=t==null?void 0:t.numberAxisFormat)!=null&&S.suffix),customSuffix:"",locale:((R=t==null?void 0:t.numberAxisFormat)==null?void 0:R.locale)||"",currency:((C=t==null?void 0:t.numberAxisFormat)==null?void 0:C.currency)||""})}}}}}function $X(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0},y:{display:!0}}}}}function kX(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{beginAtZero:!0,stack:1,reverse:!0},y:{stacked:!0,beginAtZero:!0}}}}}function MX(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function AX(e,t=!1){return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0,beginAtZero:!1},y:{display:!0,stacked:t}}}}}function IX(e,t){var r,o,i,s;return{...e,type:t==="stackedBar"?"bar":"line",options:{...e==null?void 0:e.options,scales:{x:{...(o=(r=e==null?void 0:e.options)==null?void 0:r.scales)==null?void 0:o.x,display:!0,stacked:!0},y:{...(s=(i=e==null?void 0:e.options)==null?void 0:i.scales)==null?void 0:s.y,display:!0,stacked:!0}}}}}function NX(e){return{...e,type:"line",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function LX(e,t){var r;return{...t,type:e,options:{...t==null?void 0:t.options,scales:{x:{display:!1},y:{display:!1}},plugins:{...(r=t==null?void 0:t.options)==null?void 0:r.plugins,legend:{position:"top",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},borderRadius:0}}}function FX(e){return{...e,type:"radar",options:{...e==null?void 0:e.options,scales:{x:{display:!1},y:{display:!1}}}}}function zX(e){const n=new Function("getDatalabelColor",e)(ny);return{options:n==null?void 0:n.options,plugins:(n==null?void 0:n.plugins)||[]}}function a1({data:e,cardType:t="bar",cfg:n,customCfg:r,provider:o="chartjs",userSettings:i,preferences:s}){var a,l,c;if(t==="bar"){const u=MX(n);return $a({data:e,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="horizontalBar"){const u=$X(n);return $a({data:e,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="pyramid"){const u=kX(n),{dimensionKeys:f,metricKeys:p}=ar(e),g=gg({dataArray:e,groupKey:f[0],pivotKey:f[1],valueKey:p[0]}),v=$a({data:g,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s}),b="x2";return{...v,data:{...v.data,datasets:v.data.datasets.map((w,_)=>_===1?{...w,xAxisID:b}:w)},options:{...v.options,scales:{...(a=v==null?void 0:v.options)==null?void 0:a.scales,[b]:{beginAtZero:!0,stack:1}}}}}if(t==="stackedBar"||t==="stackedLine"){const u=IX(n,t),{dimensionKeys:f,metricKeys:p}=ar(e),g=gg({dataArray:e,groupKey:f[0],pivotKey:f[1],valueKey:p[0]});return $a({data:g,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="line"){const u=NX(n);return $a({data:e,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="range"){const u=AX(n),f=jY(e),p=Vp(f,r),{plugins:g,options:v}=zX((s==null?void 0:s.customVisualCode)||""),b=Yi((u==null?void 0:u.options)||{},(n==null?void 0:n.options)||{}),x=Yi(b,(s==null?void 0:s.chartOptions)||{}),w=Yi(x,(r==null?void 0:r.options)||{}),_=Yi(w,v),S=hk(n,s),R=Yi(_,S),C={...R,plugins:{...R==null?void 0:R.plugins,datalabels:{...(l=R==null?void 0:R.plugins)==null?void 0:l.datalabels,formatter:(I,F)=>I.map(X=>{var G,B,J,H;return rl({number:Number(X),decimalPlaces:((G=s==null?void 0:s.numberAxisFormat)==null?void 0:G.decimalPlaces)||0,useSuffix:!!((B=s==null?void 0:s.numberAxisFormat)!=null&&B.suffix),customSuffix:"",locale:((J=s==null?void 0:s.numberAxisFormat)==null?void 0:J.locale)||"",currency:((H=s==null?void 0:s.numberAxisFormat)==null?void 0:H.currency)||""})}).slice(0,2).join(" - ")}}},{dimensionKeys:P}=ar(e),A=P[0];return{type:"bar",data:{labels:[...new Set(Uy(e,A))],datasets:p},options:C,plugins:[...g]}}if(t==="pie"||t==="doughnut"||t==="polarArea"){const u=LX(t,n),{dimensionKeys:f,metricKeys:p}=ar(e),g=BY(p,e),v=Vp(g,r),b=f[0],x=Uy(e,b),w=Yi((u==null?void 0:u.options)||{},(r==null?void 0:r.options)||{}),_=Yi(w,(s==null?void 0:s.chartOptions)||{}),S={..._,plugins:{..._.plugins,datalabels:{...(c=_.plugins)==null?void 0:c.datalabels,formatter:(P,A)=>{var M,T,I,F;return rl({number:Number(P),decimalPlaces:((M=s==null?void 0:s.numberAxisFormat)==null?void 0:M.decimalPlaces)||0,useSuffix:!!((T=s==null?void 0:s.numberAxisFormat)!=null&&T.suffix),customSuffix:"",locale:((I=s==null?void 0:s.numberAxisFormat)==null?void 0:I.locale)||"",currency:((F=s==null?void 0:s.numberAxisFormat)==null?void 0:F.currency)||""})}}}};return{type:t,data:{labels:x,datasets:v},options:S,plugins:[t==="doughnut"?{id:"doughnutLabel",beforeDatasetsDraw:function(P,A,M){var J,H,Y,te;const{ctx:T,data:I}=P;T.save();const F=P.getDatasetMeta(0).data[0].x,j=P.getDatasetMeta(0).data[0].y,X=md(gd());T.font="1.2rem Arial",T.fontWeight="bolder",T.fillStyle=X,T.textAlign="center",T.textBaseline="middle";const G=I.datasets[0].data.reduce(($,V)=>$+V,0),B=rl({number:Number(G),decimalPlaces:((J=s==null?void 0:s.numberAxisFormat)==null?void 0:J.decimalPlaces)||0,useSuffix:!!((H=s==null?void 0:s.numberAxisFormat)!=null&&H.suffix),customSuffix:"",locale:((Y=s==null?void 0:s.numberAxisFormat)==null?void 0:Y.locale)||"",currency:((te=s==null?void 0:s.numberAxisFormat)==null?void 0:te.currency)||""});T.fillText(B,F,j)}}:""]}}if(t==="radar"){const u=FX(n);return $a({data:e,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="bubble"||t==="scatter"){const{metricKeys:u}=ar(e);if(u.length<3){console.log("Bubble charts require 3 numeric columns");return}const f=zY(e),p=Vp(f,r),g={plugins:{datalabels:{display:!0}},scales:{x:{title:{display:!0,text:u[0]},beginAtZero:!0,ticks:{precision:0}},y:{title:{display:!0,text:u[1]},beginAtZero:!0,ticks:{precision:0}}}},v=Yi(g,(r==null?void 0:r.options)||{});return{type:t,data:{datasets:p},options:v}}return $a({data:e,cfg:n,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}function jX({chart:e,elementIndex:t,datasetIndex:n,cardType:r,cfg:o,apply:i}){const s=Ie.getState().theme;if(!o)return;const a=s==="dark"?"rgb(238,238,238,0.2)":"rgb(238,238,238,0.8)";["bar","line","horizontalBar","bubble","scatter"].includes(r)&&VX(e,t,o,i,a),["pie","doughnut","polarArea"].includes(r)&&HX(e,t,o,i,a),["stackedBar","pyramid"].includes(r)&&BX({chart:e,elementIndex:t,datasetIndex:n,cfg:o,apply:i,blurColor:a})}function BX(e){var a,l,c,u;const{chart:t,elementIndex:n,datasetIndex:r,cfg:o,apply:i,blurColor:s}=e;i?(l=(a=t==null?void 0:t.data)==null?void 0:a.datasets)==null||l.forEach((f,p)=>{var g,v;typeof f.backgroundColor=="string"&&(f.backgroundColor=new Array(f.data.length).fill(f.backgroundColor),f.borderColor=new Array(f.data.length).fill(f.borderColor)),f.backgroundColor=(g=f==null?void 0:f.backgroundColor)==null?void 0:g.map((b,x)=>x===n&&p===r?b:s),f.borderColor=(v=f==null?void 0:f.borderColor)==null?void 0:v.map((b,x)=>x===n&&p===r?b:s)}):(u=(c=t==null?void 0:t.data)==null?void 0:c.datasets)==null||u.forEach((f,p)=>{var g,v,b,x,w,_;f.backgroundColor=new Array(f.data.length).fill((b=(v=(g=o==null?void 0:o.data)==null?void 0:g.datasets)==null?void 0:v[p])==null?void 0:b.backgroundColor),f.borderColor=new Array(f.data.length).fill((_=(w=(x=o==null?void 0:o.data)==null?void 0:x.datasets)==null?void 0:w[p])==null?void 0:_.borderColor)}),t==null||t.update()}function VX(e,t,n,r,o){var i,s,a,l;console.log("clicked index",t),r?(s=(i=e==null?void 0:e.data)==null?void 0:i.datasets)==null||s.forEach(c=>{var u,f;typeof c.backgroundColor=="string"&&(c.backgroundColor=new Array(c.data.length).fill(c.backgroundColor),c.borderColor=new Array(c.data.length).fill(c.borderColor)),c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((p,g)=>g===t?p:o),c.borderColor=(f=c==null?void 0:c.borderColor)==null?void 0:f.map((p,g)=>g===t?p:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var f,p,g,v,b,x;c.backgroundColor=new Array(c.data.length).fill((g=(p=(f=n==null?void 0:n.data)==null?void 0:f.datasets)==null?void 0:p[u])==null?void 0:g.backgroundColor),c.borderColor=new Array(c.data.length).fill((x=(b=(v=n==null?void 0:n.data)==null?void 0:v.datasets)==null?void 0:b[u])==null?void 0:x.borderColor)}),e==null||e.update()}function HX(e,t,n,r,o){var i,s,a,l;r?(s=(i=e==null?void 0:e.data)==null?void 0:i.datasets)==null||s.forEach(c=>{var u,f;c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((p,g)=>g===t?p:o),c.borderColor=(f=c==null?void 0:c.borderColor)==null?void 0:f.map((p,g)=>g===t?p:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var f,p,g,v,b,x,w,_;typeof c.backgroundColor=="string"&&(c.backgroundColor=(g=(p=(f=n==null?void 0:n.data)==null?void 0:f.datasets)==null?void 0:p[u])==null?void 0:g.backgroundColor,c.borderColor=(x=(b=(v=n==null?void 0:n.data)==null?void 0:v.datasets)==null?void 0:b[u])==null?void 0:x.borderColor),c.backgroundColor=(w=c==null?void 0:c.backgroundColor)==null?void 0:w.map((S,R)=>{var C;return(C=n.data.datasets[u].backgroundColor)==null?void 0:C[R]}),c.borderColor=(_=c==null?void 0:c.borderColor)==null?void 0:_.map((S,R)=>{var C;return(C=n.data.datasets[u].borderColor)==null?void 0:C[R]})}),e==null||e.update()}function WX(e,t,n,r){var o,i;try{if(!e||!e.data)return;const{dimensionKeys:s,metricKeys:a}=ar(e.data);if(["bar","horizontalBar","line","pie","doughnut","radar","polarArea"].includes(e.type)){const l=s[0],c=(o=e.data[n])==null?void 0:o[l];return[{columnName:l,columnValue:c,metric:a[t],value:r}]}if(["stackedBar","pyramid"].includes(e.type)){const l=gg({dataArray:e.data,groupKey:s[0],pivotKey:s[1],valueKey:a[0]}),c=s[0],u=(i=l[n])==null?void 0:i[c],f=s[1],{metricKeys:p}=ar(l),g=p[t];return[{columnName:c,columnValue:u,metric:a[0],value:r},{columnName:f,columnValue:g,metric:a[0],value:r}]}if(e.type==="bubble"||e.type==="scatter"){const l=s[0],c=r.label;return[{columnName:l,columnValue:c,metric1:a[0],value1:r.x,metric2:a[1],value2:r.y,metric3:a==null?void 0:a[2],value3:r==null?void 0:r.r}]}}catch(s){console.error("Error in getAdhocFilter",s)}}function UX(e){var s,a;const[t]=m.useState({id:"",title:"",type:"bar",data:[]}),{getCard:n}=Ci(),r=n(e),o=l1(r||t),i={...r,data:((s=o==null?void 0:o.data)==null?void 0:s.records)||[]};return{...o,data:((a=o==null?void 0:o.data)==null?void 0:a.records)||[],card:i}}function l1(e){var F,j,X;const{onChartElementClicked:t}=fa(),[n,r]=m.useState(0),o=((F=e==null?void 0:e.preferences)==null?void 0:F.filterOnClickColumnIndex)===void 0?0:(j=e.preferences)==null?void 0:j.filterOnClickColumnIndex,i=Ie(G=>G.bookmarkKey);Ie(G=>G.isVisualEditing);const s=Ie(G=>G.filteringCards),a=Ie(G=>G.selectedSheetId);Ie(G=>G.selectedCardId),Ie(G=>G.isDashboardEditing);const l=Ie(G=>G.themeStyle),c=Ie(G=>G.filterValues),u=(X=e==null?void 0:e.preferences)==null?void 0:X.onClickFilter,{addFrame:f,addFilteringCard:p,setFrameCardData:g,getSelectedFrame:v,addOrUpdateFilterValue:b,addOrUpdateFilterValues:x,removeFilterValue:w,removeFilteringCard:_}=Ci(),{data:S,isLoading:R,isFetching:C,isError:P,refetch:A}=DX(e),M=s==null?void 0:s.find(G=>G.id===e.id);let T;e.data&&e.data.length>0&&(T=a1({data:e.data,cardType:e.type,cfg:e.cfg,customCfg:e.customCfg,preferences:e.preferences})),m.useEffect(()=>{!S||!S.records||g(a,e.id,(S==null?void 0:S.records)||[])},[S,a,e.id,g,c]),m.useEffect(()=>{e.data&&r(n+1)},[e.data,e.type,e.cfg,e.customCfg,e.preferences,l]),m.useEffect(()=>{e.connectionId&&!M&&A()},[c,i]);function I(G,B,J,H){var $,V;let Y=!1;if(!e.data)return;const te=WX(e,B,J,H);if(console.log("fieldValues",te),t==null||t(e,te),!!((($=e==null?void 0:e.preferences)==null?void 0:$.onClickFilter)??[]).length){if(M){const Q=e.id;w(Q),_(e)}else{if(Y=!0,!te)return;const Q=[];te.forEach((N,le)=>{const se=u==null?void 0:u.find(he=>he.columnIndex===le);if(!se)return;const ue={filterId:e.id+"-"+N.columnName,connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:N.columnName,expression:se.expression,valueType:vd(te[se.columnIndex].columnValue),operation:"=",values:[te[se.columnIndex].columnValue]};Q.push(ue)}),e.id,e==null||e.connectionId,e.lastSelectedTable,te[o].columnName,(V=e.preferences)==null||V.filterOnClickField,vd(te[o].columnValue),te[o].columnValue,x(Q),p(e)}jX({chart:G,elementIndex:J,datasetIndex:B,cardType:e.type,cfg:T,apply:Y})}}return{isError:P,isLoading:R,isFetching:C,data:S,visualKey:n,handleDatapointClick:I,cfg:T}}function qX(e,t){const n=Ie(u=>u.selectedSheetId),r=Ie(u=>u.selectedFrameId),o=Ie(u=>u.isDashboardEditing),i=Ie(u=>u.isVisualEditing),{addFrame:s,getSelectedFrame:a,setSelectedFrameId:l}=Ie(u=>u.actions);m.useEffect(()=>{const u=p=>{if(o&&((p.metaKey||p.ctrlKey)&&p.key==="c"&&navigator.clipboard.writeText(JSON.stringify(a())),(p.ctrlKey||p.metaKey)&&p.key==="v"))try{navigator.clipboard.readText().then(g=>{try{const v=JSON.parse(g);if(v&&v.id){v.id=dl();const b=v.activeCardId;v.cards.forEach(x=>{const w=x.id;x.id=dl(),w===b&&(v.activeCardId=x.id,x.title=`${x.title} (Copy)`)}),s(n,v),l(v.id)}}catch(v){console.error("Failed to parse clipboard contents: ",v)}})}catch(g){console.error("Failed to read clipboard contents: ",g)}},f=t==null?void 0:t.current;return f==null||f.addEventListener("keydown",u),()=>{f==null||f.removeEventListener("keydown",u)}},[o,n,a,s,t,l]),m.useEffect(()=>{r===e.id&&o&&!i&&c()},[r,e.id,o,i]);function c(){const u=t==null?void 0:t.current;u==null||u.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}let Hb;const pk="HoverCard",[gk,Jge]=Gn(pk,[Pi]),c1=Pi(),[GX,u1]=gk(pk),YX=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:s=700,closeDelay:a=300}=e,l=c1(t),c=m.useRef(0),u=m.useRef(0),f=m.useRef(!1),p=m.useRef(!1),[g=!1,v]=ur({prop:r,defaultProp:o,onChange:i}),b=m.useCallback(()=>{clearTimeout(u.current),c.current=window.setTimeout(()=>v(!0),s)},[s,v]),x=m.useCallback(()=>{clearTimeout(c.current),!f.current&&!p.current&&(u.current=window.setTimeout(()=>v(!1),a))},[a,v]),w=m.useCallback(()=>v(!1),[v]);return m.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(u.current)},[]),m.createElement(GX,{scope:t,open:g,onOpenChange:v,onOpen:b,onClose:x,onDismiss:w,hasSelectionRef:f,isPointerDownOnContentRef:p},m.createElement(Pf,l,n))},KX="HoverCardTrigger",XX=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=u1(KX,n),i=c1(n);return m.createElement(Tf,fe({asChild:!0},i),m.createElement(Qe.a,fe({"data-state":o.open?"open":"closed"},r,{ref:t,onPointerEnter:De(e.onPointerEnter,xg(o.onOpen)),onPointerLeave:De(e.onPointerLeave,xg(o.onClose)),onFocus:De(e.onFocus,o.onOpen),onBlur:De(e.onBlur,o.onClose),onTouchStart:De(e.onTouchStart,s=>s.preventDefault())})))}),QX="HoverCardPortal",[Zge,JX]=gk(QX,{forceMount:void 0}),Qy="HoverCardContent",ZX=m.forwardRef((e,t)=>{const n=JX(Qy,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,i=u1(Qy,e.__scopeHoverCard);return m.createElement(Mn,{present:r||i.open},m.createElement(eQ,fe({"data-state":i.open?"open":"closed"},o,{onPointerEnter:De(e.onPointerEnter,xg(i.onOpen)),onPointerLeave:De(e.onPointerLeave,xg(i.onClose)),ref:t})))}),eQ=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,...a}=e,l=u1(Qy,n),c=c1(n),u=m.useRef(null),f=ft(t,u),[p,g]=m.useState(!1);return m.useEffect(()=>{if(p){const v=document.body;return Hb=v.style.userSelect||v.style.webkitUserSelect,v.style.userSelect="none",v.style.webkitUserSelect="none",()=>{v.style.userSelect=Hb,v.style.webkitUserSelect=Hb}}},[p]),m.useEffect(()=>{if(u.current){const v=()=>{g(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var b;((b=document.getSelection())===null||b===void 0?void 0:b.toString())!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",v),()=>{document.removeEventListener("pointerup",v),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),m.useEffect(()=>{u.current&&tQ(u.current).forEach(b=>b.setAttribute("tabindex","-1"))}),m.createElement(Yc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:De(i,v=>{v.preventDefault()}),onDismiss:l.onDismiss},m.createElement(Df,fe({},c,a,{onPointerDown:De(a.onPointerDown,v=>{v.currentTarget.contains(v.target)&&g(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:f,style:{...a.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})))});function xg(e){return t=>t.pointerType==="touch"?void 0:e()}function tQ(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}const nQ=YX,rQ=XX,mk=ZX,d1=nQ,f1=rQ,xm=ge.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>O.jsx(mk,{ref:o,align:t,sideOffset:n,className:Pe("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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),...r}));xm.displayName=mk.displayName;function oQ({card:e}){const{setCardInfo:t}=Ci();return O.jsxs(d1,{openDelay:0,children:[O.jsx(f1,{children:O.jsx(KY,{className:"size-4 text-muted-foreground/40"})}),O.jsx(xm,{align:"start",className:"w-[300px]",onMouseDown:n=>n.stopPropagation(),children:O.jsx(na,{type:"textarea",text:e.info||"",onSave:n=>t(e.id,n),children:O.jsx("p",{className:"text-sm text-muted-foreground",children:e.info||"Double-click to add info"})})})]})}const h1=ge.forwardRef(({className:e,containerClassName:t,containerStyle:n,...r},o)=>O.jsx("div",{style:n,className:Pe("relative w-full overflow-auto",t),children:O.jsx("table",{ref:o,className:Pe("w-full caption-bottom text-sm",e),...r})}));h1.displayName="Table";const p1=ge.forwardRef(({className:e,...t},n)=>O.jsx("thead",{ref:n,className:Pe("[&_tr]:border-b",e),...t}));p1.displayName="TableHeader";const g1=ge.forwardRef(({className:e,...t},n)=>O.jsx("tbody",{ref:n,className:Pe("[&_tr:last-child]:border-0",e),...t}));g1.displayName="TableBody";const iQ=ge.forwardRef(({className:e,...t},n)=>O.jsx("tfoot",{ref:n,className:Pe("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));iQ.displayName="TableFooter";const ld=ge.forwardRef(({className:e,...t},n)=>O.jsx("tr",{ref:n,className:Pe("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));ld.displayName="TableRow";const m1=ge.forwardRef(({className:e,...t},n)=>O.jsx("th",{ref:n,className:Pe("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));m1.displayName="TableHead";const wg=ge.forwardRef(({className:e,...t},n)=>O.jsx("td",{ref:n,className:Pe("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));wg.displayName="TableCell";const sQ=ge.forwardRef(({className:e,...t},n)=>O.jsx("caption",{ref:n,className:Pe("mt-4 text-sm text-muted-foreground",e),...t}));sQ.displayName="TableCaption";/**
|
|
254
254
|
* table-core
|
|
255
255
|
*
|
|
256
256
|
* Copyright (c) TanStack
|
|
@@ -402,15 +402,15 @@ Check the top-level render call using <`+ce+">.")}return Z}}function Zo(D,Z){{if
|
|
|
402
402
|
`}]}function bce(e,t){const n=t.value?t.value+`
|
|
403
403
|
`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function yce(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xce(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wce(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=tu(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=i+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function _ce(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Sce(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function rI(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),i=o[0];i&&i.type==="text"?i.value="["+i.value:o.unshift({type:"text",value:"["});const s=o[o.length-1];return s&&s.type==="text"?s.value+=r:o.push({type:"text",value:r}),o}function Cce(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return rI(e,t);const o={src:tu(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)}function Ece(e,t){const n={src:tu(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Rce(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Oce(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return rI(e,t);const o={href:tu(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function Pce(e,t){const n={href:tu(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Tce(e,t,n){const r=e.all(t),o=n?Dce(n):oI(t),i={},s=[];if(typeof t.checked=="boolean"){const u=r[0];let f;u&&u.type==="element"&&u.tagName==="p"?f=u:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(o||a!==0||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
|
|
404
404
|
`}),u.type==="element"&&u.tagName==="p"&&!o?s.push(...u.children):s.push(u)}const l=r[r.length-1];l&&(o||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
|
|
405
|
-
`});const c={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,c),e.applyData(t,c)}function Dce(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=oI(n[r])}return t}function oI(e){const t=e.spread;return t??e.children.length>1}function $ce(e,t){const n={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<r.length;){const s=r[o];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function kce(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Mce(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Ace(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ice(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),o.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Z1(t.children[1]),l=LA(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),o.push(s)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)}function Nce(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const f=t.children[l],p={},g=s?s[l]:void 0;g&&(p.align=g);let v={type:"element",tagName:i,properties:p,children:[]};f&&(v.children=e.all(f),e.patch(f,v),v=e.applyData(f,v)),c.push(v)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function Lce(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const QP=9,JP=32;function Fce(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(ZP(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(ZP(t.slice(o),o>0,!1)),i.join("")}function ZP(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===QP||i===JP;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===QP||i===JP;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function zce(e,t){const n={type:"text",value:Fce(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function jce(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Bce={blockquote:mce,break:vce,code:bce,delete:yce,emphasis:xce,footnoteReference:wce,heading:_ce,html:Sce,imageReference:Cce,image:Ece,inlineCode:Rce,linkReference:Oce,link:Pce,listItem:Tce,list:$ce,paragraph:kce,root:Mce,strong:Ace,table:Ice,tableCell:Lce,tableRow:Nce,text:zce,thematicBreak:jce,toml:_p,yaml:_p,definition:_p,footnoteDefinition:_p};function _p(){}const iI=-1,Hm=0,$g=1,kg=2,s_=3,a_=4,l_=5,c_=6,sI=7,aI=8,
|
|
405
|
+
`});const c={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,c),e.applyData(t,c)}function Dce(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=oI(n[r])}return t}function oI(e){const t=e.spread;return t??e.children.length>1}function $ce(e,t){const n={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<r.length;){const s=r[o];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function kce(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Mce(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Ace(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ice(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),o.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Z1(t.children[1]),l=LA(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),o.push(s)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)}function Nce(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const f=t.children[l],p={},g=s?s[l]:void 0;g&&(p.align=g);let v={type:"element",tagName:i,properties:p,children:[]};f&&(v.children=e.all(f),e.patch(f,v),v=e.applyData(f,v)),c.push(v)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function Lce(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const QP=9,JP=32;function Fce(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(ZP(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(ZP(t.slice(o),o>0,!1)),i.join("")}function ZP(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===QP||i===JP;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===QP||i===JP;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function zce(e,t){const n={type:"text",value:Fce(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function jce(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Bce={blockquote:mce,break:vce,code:bce,delete:yce,emphasis:xce,footnoteReference:wce,heading:_ce,html:Sce,imageReference:Cce,image:Ece,inlineCode:Rce,linkReference:Oce,link:Pce,listItem:Tce,list:$ce,paragraph:kce,root:Mce,strong:Ace,table:Ice,tableCell:Lce,tableRow:Nce,text:zce,thematicBreak:jce,toml:_p,yaml:_p,definition:_p,footnoteDefinition:_p};function _p(){}const iI=-1,Hm=0,$g=1,kg=2,s_=3,a_=4,l_=5,c_=6,sI=7,aI=8,e2=typeof self=="object"?self:globalThis,Vce=(e,t)=>{const n=(o,i)=>(e.set(i,o),o),r=o=>{if(e.has(o))return e.get(o);const[i,s]=t[o];switch(i){case Hm:case iI:return n(s,o);case $g:{const a=n([],o);for(const l of s)a.push(r(l));return a}case kg:{const a=n({},o);for(const[l,c]of s)a[r(l)]=r(c);return a}case s_:return n(new Date(s),o);case a_:{const{source:a,flags:l}=s;return n(new RegExp(a,l),o)}case l_:{const a=n(new Map,o);for(const[l,c]of s)a.set(r(l),r(c));return a}case c_:{const a=n(new Set,o);for(const l of s)a.add(r(l));return a}case sI:{const{name:a,message:l}=s;return n(new e2[a](l),o)}case aI:return n(BigInt(s),o);case"BigInt":return n(Object(BigInt(s)),o)}return n(new e2[i](s),o)};return r},t2=e=>Vce(new Map,e)(0),Jl="",{toString:Hce}={},{keys:Wce}=Object,Vu=e=>{const t=typeof e;if(t!=="object"||!e)return[Hm,t];const n=Hce.call(e).slice(8,-1);switch(n){case"Array":return[$g,Jl];case"Object":return[kg,Jl];case"Date":return[s_,Jl];case"RegExp":return[a_,Jl];case"Map":return[l_,Jl];case"Set":return[c_,Jl]}return n.includes("Array")?[$g,n]:n.includes("Error")?[sI,n]:[kg,n]},Sp=([e,t])=>e===Hm&&(t==="function"||t==="symbol"),Uce=(e,t,n,r)=>{const o=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},i=s=>{if(n.has(s))return n.get(s);let[a,l]=Vu(s);switch(a){case Hm:{let u=s;switch(l){case"bigint":a=aI,u=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return o([iI],s)}return o([a,u],s)}case $g:{if(l)return o([l,[...s]],s);const u=[],f=o([a,u],s);for(const p of s)u.push(i(p));return f}case kg:{if(l)switch(l){case"BigInt":return o([l,s.toString()],s);case"Boolean":case"Number":case"String":return o([l,s.valueOf()],s)}if(t&&"toJSON"in s)return i(s.toJSON());const u=[],f=o([a,u],s);for(const p of Wce(s))(e||!Sp(Vu(s[p])))&&u.push([i(p),i(s[p])]);return f}case s_:return o([a,s.toISOString()],s);case a_:{const{source:u,flags:f}=s;return o([a,{source:u,flags:f}],s)}case l_:{const u=[],f=o([a,u],s);for(const[p,g]of s)(e||!(Sp(Vu(p))||Sp(Vu(g))))&&u.push([i(p),i(g)]);return f}case c_:{const u=[],f=o([a,u],s);for(const p of s)(e||!Sp(Vu(p)))&&u.push(i(p));return f}}const{message:c}=s;return o([a,{name:l,message:c}],s)};return i},n2=(e,{json:t,lossy:n}={})=>{const r=[];return Uce(!(t||n),!!t,new Map,r)(e),r},Mg=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?t2(n2(e,t)):structuredClone(e):(e,t)=>t2(n2(e,t));function qce(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Gce(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Yce(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||qce,r=e.options.footnoteBackLabel||Gce,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),f=String(c.identifier).toUpperCase(),p=tu(f.toLowerCase());let g=0;const v=[],b=e.footnoteCounts.get(f);for(;b!==void 0&&++g<=b;){v.length>0&&v.push({type:"text",value:" "});let _=typeof n=="string"?n:n(l,g);typeof _=="string"&&(_={type:"text",value:_}),v.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,g),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const x=u[u.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const _=x.children[x.children.length-1];_&&_.type==="text"?_.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...v)}else u.push(...v);const w={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(u,!0)};e.patch(c,w),a.push(w)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...Mg(s),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
406
406
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
407
|
-
`}]}}const lI=function(e){if(e==null)return Jce;if(typeof e=="function")return Wm(e);if(typeof e=="object")return Array.isArray(e)?Kce(e):Xce(e);if(typeof e=="string")return Qce(e);throw new Error("Expected function, string, or object as test")};function Kce(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=lI(e[n]);return Wm(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function Xce(e){const t=e;return Wm(n);function n(r){const o=r;let i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function Qce(e){return Wm(t);function t(n){return n&&n.type===e}}function Wm(e){return t;function t(n,r,o){return!!(Zce(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function Jce(){return!0}function Zce(e){return e!==null&&typeof e=="object"&&"type"in e}const cI=[],eue=!0,
|
|
407
|
+
`}]}}const lI=function(e){if(e==null)return Jce;if(typeof e=="function")return Wm(e);if(typeof e=="object")return Array.isArray(e)?Kce(e):Xce(e);if(typeof e=="string")return Qce(e);throw new Error("Expected function, string, or object as test")};function Kce(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=lI(e[n]);return Wm(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function Xce(e){const t=e;return Wm(n);function n(r){const o=r;let i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function Qce(e){return Wm(t);function t(n){return n&&n.type===e}}function Wm(e){return t;function t(n,r,o){return!!(Zce(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function Jce(){return!0}function Zce(e){return e!==null&&typeof e=="object"&&"type"in e}const cI=[],eue=!0,r2=!1,tue="skip";function nue(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const i=lI(o),s=r?-1:1;a(e,void 0,[])();function a(l,c,u){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const g=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(g?"<"+g+">":""))+")"})}return p;function p(){let g=cI,v,b,x;if((!t||i(l,c,u[u.length-1]||void 0))&&(g=rue(n(l,u)),g[0]===r2))return g;if("children"in l&&l.children){const w=l;if(w.children&&g[0]!==tue)for(b=(r?w.children.length:-1)+s,x=u.concat(w);b>-1&&b<w.children.length;){const _=w.children[b];if(v=a(_,b,x)(),v[0]===r2)return v;b=typeof v[1]=="number"?v[1]:b+s}}return g}}}function rue(e){return Array.isArray(e)?e:typeof e=="number"?[eue,e]:e==null?cI:[e]}function uI(e,t,n,r){let o,i,s;typeof t=="function"&&typeof n!="function"?(i=void 0,s=t,o=n):(i=t,s=n,o=r),nue(e,i,a,o);function a(l,c){const u=c[c.length-1],f=u?u.children.indexOf(l):void 0;return s(l,f,u)}}const Px={}.hasOwnProperty,oue={};function iue(e,t){const n=t||oue,r=new Map,o=new Map,i=new Map,s={...Bce,...n.handlers},a={all:c,applyData:aue,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:s,one:l,options:n,patch:sue,wrap:cue};return uI(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const f=u.type==="definition"?r:o,p=String(u.identifier).toUpperCase();f.has(p)||f.set(p,u)}}),a;function l(u,f){const p=u.type,g=a.handlers[p];if(Px.call(a.handlers,p)&&g)return g(a,u,f);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in u){const{children:b,...x}=u,w=Mg(x);return w.children=a.all(u),w}return Mg(u)}return(a.options.unknownHandler||lue)(a,u,f)}function c(u){const f=[];if("children"in u){const p=u.children;let g=-1;for(;++g<p.length;){const v=a.one(p[g],u);if(v){if(g&&p[g-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=o2(v.value)),!Array.isArray(v)&&v.type==="element")){const b=v.children[0];b&&b.type==="text"&&(b.value=o2(b.value))}Array.isArray(v)?f.push(...v):f.push(v)}}}return f}}function sue(e,t){e.position&&(t.position=Vse(e))}function aue(e,t){let n=t;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&i&&Object.assign(n.properties,Mg(i)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function lue(e,t){const n=t.data||{},r="value"in t&&!(Px.call(n,"hProperties")||Px.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function cue(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
408
408
|
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
409
409
|
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
410
|
-
`}),n}function
|
|
411
|
-
`},o),i}function uue(e,t){return e&&"run"in e?async function(n,r){const o=iT(n,{file:r,...t});await e.run(o,r)}:function(n,r){return iT(n,{file:r,...t||e})}}function sT(e){if(e)throw e}var Kp=Object.prototype.hasOwnProperty,dI=Object.prototype.toString,aT=Object.defineProperty,lT=Object.getOwnPropertyDescriptor,cT=function(t){return typeof Array.isArray=="function"?Array.isArray(t):dI.call(t)==="[object Array]"},uT=function(t){if(!t||dI.call(t)!=="[object Object]")return!1;var n=Kp.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Kp.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var o;for(o in t);return typeof o>"u"||Kp.call(t,o)},dT=function(t,n){aT&&n.name==="__proto__"?aT(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},fT=function(t,n){if(n==="__proto__")if(Kp.call(t,n)){if(lT)return lT(t,n).value}else return;return t[n]},due=function e(){var t,n,r,o,i,s,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=fT(a,n),o=fT(t,n),a!==o&&(u&&o&&(uT(o)||(i=cT(o)))?(i?(i=!1,s=r&&cT(r)?r:[]):s=r&&uT(r)?r:{},dT(a,{name:n,newValue:e(u,s,o)})):typeof o<"u"&&dT(a,{name:n,newValue:o}));return a};const D0=Uc(due);function Tx(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function fue(){const e=[],t={run:n,use:r};return t;function n(...o){let i=-1;const s=o.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...o);function a(l,...c){const u=e[++i];let f=-1;if(l){s(l);return}for(;++f<o.length;)(c[f]===null||c[f]===void 0)&&(c[f]=o[f]);o=c,u?hue(u,a)(...c):s(null,...c)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function hue(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(o);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return o(u)}a||(l instanceof Promise?l.then(i,o):l instanceof Error?o(l):i(l))}function o(s,...a){n||(n=!0,t(s,...a))}function i(s){o(null,s)}}const li={basename:pue,dirname:gue,extname:mue,join:vue,sep:"/"};function pue(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');jf(e);let n=0,r=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else r<0&&(i=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else s<0&&(i=!0,s=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(r=o):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function gue(e){if(jf(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function mue(e){jf(e);let t=e.length,n=-1,r=0,o=-1,i=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||n<0||i===0||i===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function vue(...e){let t=-1,n;for(;++t<e.length;)jf(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":bue(n)}function bue(e){jf(e);const t=e.codePointAt(0)===47;let n=yue(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function yue(e,t){let n="",r=0,o=-1,i=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(o===s-1||i===1))if(o!==s-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),o=s,i=0;continue}}else if(n.length>0){n="",r=0,o=s,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,s):n=e.slice(o+1,s),r=s-o-1;o=s,i=0}else a===46&&i>-1?i++:i=-1}return n}function jf(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const xue={cwd:wue};function wue(){return"/"}function Dx(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function _ue(e){if(typeof e=="string")e=new URL(e);else if(!Dx(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Sue(e)}function Sue(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const $0=["history","path","basename","stem","extname","dirname"];class fI{constructor(t){let n;t?Dx(t)?n={path:t}:typeof t=="string"||Cue(t)?n={value:t}:n=t:n={},this.cwd=xue.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<$0.length;){const i=$0[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let o;for(o in n)$0.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?li.basename(this.path):void 0}set basename(t){M0(t,"basename"),k0(t,"basename"),this.path=li.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?li.dirname(this.path):void 0}set dirname(t){hT(this.basename,"dirname"),this.path=li.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?li.extname(this.path):void 0}set extname(t){if(k0(t,"extname"),hT(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=li.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Dx(t)&&(t=_ue(t)),M0(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?li.basename(this.path,this.extname):void 0}set stem(t){M0(t,"stem"),k0(t,"stem"),this.path=li.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new dr(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function k0(e,t){if(e&&e.includes(li.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+li.sep+"`")}function M0(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function hT(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Cue(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Eue=function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};Object.setPrototypeOf(i,r);const s=Object.getOwnPropertyNames(o);for(const a of s){const l=Object.getOwnPropertyDescriptor(o,a);l&&Object.defineProperty(i,a,l)}return i},Rue={}.hasOwnProperty;class u_ extends Eue{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=fue()}copy(){const t=new u_;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(D0(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(N0("data",this.frozen),this.namespace[t]=n,this):Rue.call(this.namespace,t)&&this.namespace[t]||void 0:t?(N0("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Cp(t),r=this.parser||this.Parser;return A0("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),A0("process",this.parser||this.Parser),I0("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,s){const a=Cp(t),l=r.parse(a);r.run(l,a,function(u,f,p){if(u||!f||!p)return c(u);const g=f,v=r.stringify(g,p);Tue(v)?p.value=v:p.result=v,c(u,p)});function c(u,f){u||!f?s(u):i?i(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),A0("processSync",this.parser||this.Parser),I0("processSync",this.compiler||this.Compiler),this.process(t,o),gT("processSync","process",n),r;function o(i,s){n=!0,sT(i),r=s}}run(t,n,r){pT(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(s,a){const l=Cp(n);o.run(t,l,c);function c(u,f,p){const g=f||t;u?a(u):s?s(g):r(void 0,g,p)}}}runSync(t,n){let r=!1,o;return this.run(t,n,i),gT("runSync","run",r),o;function i(s,a){sT(s),o=a,r=!0}}stringify(t,n){this.freeze();const r=Cp(n),o=this.compiler||this.Compiler;return I0("stringify",o),pT(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(N0("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...f]=c;l(u,f)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(o.settings=D0(!0,o.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const f=c[u];i(f)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let f=-1,p=-1;for(;++f<r.length;)if(r[f][0]===c){p=f;break}if(p===-1)r.push([c,...u]);else if(u.length>0){let[g,...v]=u;const b=r[p][1];Tx(b)&&Tx(g)&&(g=D0(!0,b,g)),r[p]=[c,g,...v]}}}}const Oue=new u_().freeze();function A0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function I0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function N0(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function pT(e){if(!Tx(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function gT(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Cp(e){return Pue(e)?e:new fI(e)}function Pue(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Tue(e){return typeof e=="string"||Due(e)}function Due(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const $ue="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",mT=[],vT={allowDangerousHtml:!0},kue=/^(https?|ircs?|mailto|xmpp)$/i,Mue=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function hI(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",o=e.className,i=e.components,s=e.disallowedElements,a=e.rehypePlugins||mT,l=e.remarkPlugins||mT,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...vT}:vT,u=e.skipHtml,f=e.unwrapDisallowed,p=e.urlTransform||Aue,g=Oue().use(gce).use(l).use(uue,c).use(a),v=new fI;typeof r=="string"&&(v.value=r);for(const _ of Mue)Object.hasOwn(e,_.from)&&(""+_.from+(_.to?"use `"+_.to+"` instead":"remove it")+$ue+_.id,void 0);const b=g.parse(v);let x=g.runSync(b,v);return o&&(x={type:"element",tagName:"div",properties:{className:o},children:x.type==="root"?x.children:[x]}),uI(x,w),Yse(x,{Fragment:O.Fragment,components:i,ignoreInvalidStyle:!0,jsx:O.jsx,jsxs:O.jsxs,passKeys:!0,passNode:!0});function w(_,S,R){if(_.type==="raw"&&R&&typeof S=="number")return u?R.children.splice(S,1):R.children[S]={type:"text",value:_.value},S;if(_.type==="element"){let C;for(C in O0)if(Object.hasOwn(O0,C)&&Object.hasOwn(_.properties,C)){const P=_.properties[C],A=O0[C];(A===null||A.includes(_.tagName))&&(_.properties[C]=p(String(P||""),C,_))}}if(_.type==="element"){let C=t?!t.includes(_.tagName):s?s.includes(_.tagName):!1;if(!C&&n&&typeof S=="number"&&(C=!n(_,S,R)),C&&R&&typeof S=="number")return f&&_.children?R.children.splice(S,1,..._.children):R.children.splice(S,1),S}}}function Aue(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t<0||o>-1&&t>o||n>-1&&t>n||r>-1&&t>r||kue.test(e.slice(0,t))?e:""}function Iue(){const e=m.useRef(null),[t,n]=m.useState(""),[r,o]=m.useState(!1),i=Ie(T=>T.dashboard.aiScopeTables);fm();const s=Ie(T=>T.selectedSheetId),{addFrame:a,setSelectedFrameId:l,setIsDashboardEditing:c}=Ci(),{authToken:u}=fa(),f=b2(),{messages:p,input:g,handleInputChange:v,handleSubmit:b,addToolResult:x,stop:w,isLoading:_}=Nie({api:"https://semaphor.cloud/api/v1/chat",headers:{Authorization:`Bearer ${u==null?void 0:u.accessToken}`},maxToolRoundtrips:5,async onToolCall({toolCall:T}){if(R(T.toolName),T.toolName==="getLocation"){const I=["New York","Los Angeles","Chicago","San Francisco"];return I[Math.floor(Math.random()*I.length)]}if(T.toolName==="getTables")return JSON.stringify(i||[]);if(T.toolName==="getData"){console.log(T.args);const I=T.args;if(!(I!=null&&I.sql)||!(I!=null&&I.connectionId))return"Please provide sql, connectionId and table";const F=await f.fetchQuery({queryKey:["chat",I.connectionId,I.sql],queryFn:()=>gf("https://semaphor.cloud/api/v1/query",(u==null?void 0:u.accessToken)||(u==null?void 0:u.accessToken)||"",{connection_id:I.connectionId,sql:I.sql})});return n("Summarizing"),JSON.stringify(F)}},onFinish(T,I){console.log("onFinish",T,I),T.content&&n("")}}),S=()=>{var T;(T=e.current)==null||T.scrollIntoView({behavior:"smooth"})};m.useEffect(()=>{S()},[p]);function R(T){T==="getTables"&&n("Initializing"),T==="getSchemas"&&n("Analyzing"),T==="getData"&&n("Fetching")}function C(T){const I=T.toolInvocations||[];return I.length===0||I.find(j=>j.toolName==="getData"&&"result"in j)?!0:r}function P(T){return T==null?void 0:T.map(I=>{var j;const F=I.role==="user";return C(I)?O.jsxs("div",{className:Pe("relative rounded-md bg-background px-4 py-4 text-sm text-foreground/80",{"bg-muted":F}),children:[O.jsx("div",{className:"space-y-2",children:O.jsxs("div",{className:"flex shrink-0 items-start gap-3",children:[O.jsx("div",{className:"text-muted-foreground",children:F?O.jsx(ZY,{className:"size-5 shrink-0"}):O.jsx(qy,{className:"size-5 shrink-0"})}),O.jsx("div",{children:O.jsx(hI,{components:Nue,children:I.content})})]})}),(j=I.toolInvocations)==null?void 0:j.map(X=>{const G=X.toolCallId;return"result"in X?O.jsx("div",{children:A(X)},G):O.jsxs("div",{children:["Calling ",X.toolName,"..."]},G)})]},I.id):null})}function A(T){if("result"in T){let I;try{const F=JSON.parse(T.result);if(I=O.jsx("pre",{className:"whitespace-normal text-xs",children:JSON.stringify(F,null,2)}),T.toolName==="getData"){console.log(T);const j=a1({cardType:T.args.chartType,data:F.records});return O.jsxs("div",{className:"space-y-2",children:[r&&O.jsxs("div",{children:[O.jsx("span",{className:"font-semibold text-blue-700",children:"Tool call"})," ",`${T.toolName}: `,I]}),O.jsxs("div",{className:"flex h-[350px] w-[99%] grow flex-col py-2",children:[O.jsx(yr,{onClick:()=>{const X=T.args.chartTitle,G=T.args.connectionId;M({sql:T.args.sql,data:F.records,cardType:T.args.chartType,cardCfg:j,cardTitle:X,connectionId:G})},variant:"secondary",size:"sm",className:"absolute right-3 top-3",children:"Add"}),j&&O.jsx(Hw,{cfg:j})]})]})}}catch{I=O.jsx("span",{children:T.result})}return O.jsxs("div",{children:[O.jsx("span",{className:"font-semibold text-blue-700",children:"Tool call"})," ",`${T.toolName}: `,I]})}return`Calling ${T.toolName}...`}function M({sql:T,data:I,cardCfg:F,cardTitle:j,connectionId:X,cardType:G}){if(!s)return;const B={id:dl(),title:j||"Title",description:"Description",preferences:{onClickFilter:[{columnIndex:0,expression:""}],chartOptions:{indexAxis:G==="horizontalBar"?"y":"x"}},type:F.type,cfg:F,sql:T,data:I,connectionId:X},J={id:dl(),cards:[B],activeCardId:B.id};c(!0),a(s,J,"start"),l(J.id)}return O.jsxs("div",{className:"flex h-full grow flex-col justify-between break-words rounded-md bg-muted/30 px-6 py-8",children:[O.jsxs("div",{className:"flex items-center gap-3",children:[O.jsx(Un,{className:"flex items-center gap-2 text-xl",children:"Assistant"}),O.jsxs(d1,{openDelay:700,children:[O.jsx(f1,{children:O.jsx(QY,{className:"size-4 text-muted-foreground"})}),O.jsx(xm,{className:"w-70",children:O.jsxs("div",{className:"flex justify-between space-x-2 text-muted-foreground",children:[O.jsx(qy,{className:"size-5"}),O.jsxs("div",{className:"space-y-1",children:[O.jsx("p",{className:"text-sm",children:i&&(i==null?void 0:i.length)>0?"I can analyze following datasets":"No datasets in scope"}),O.jsx("div",{className:"space-y-2 pt-2",children:i==null?void 0:i.map((T,I)=>O.jsxs("div",{className:"flex gap-2 text-xs",children:[O.jsx(z$,{className:"size-4 opacity-70"}),O.jsx("span",{children:T.tableName})]},I))})]})]})})]}),!1]}),O.jsx(km,{className:"my-4"}),O.jsx("div",{className:"",children:O.jsxs("form",{className:"mb-1 flex w-full grow items-center justify-between gap-2 rounded-md",onSubmit:b,children:[O.jsxs("div",{className:"flex w-full items-center justify-between rounded-md border bg-background",children:[O.jsx(dc,{className:"w-full border-none focus-visible:ring-0 focus-visible:ring-offset-0",value:g,disabled:_,placeholder:"What can I help you with?",onChange:v}),O.jsx("button",{className:"mr-3",children:O.jsx(M$,{className:"size-4 text-muted-foreground/70 hover:text-muted-foreground"})})]}),_&&O.jsx(yr,{size:"sm",className:"rounded-full",onClick:()=>w(),children:O.jsx(DY,{className:"size-2.5 bg-background"})})]})}),O.jsxs(X1,{className:"flex flex-1 basis-0 flex-col flex-wrap justify-end",children:[O.jsxs("div",{className:"flex items-center text-xs text-foreground/90",children:[_&&t!==""&&O.jsx(vY,{className:"size-10 animate-pulse"}),t]}),O.jsx("div",{className:"flex flex-col-reverse gap-2 py-2",children:P(p)}),O.jsx(jm,{orientation:"vertical"})]})]})}const Nue={li:({node:e,...t})=>O.jsx("li",{className:"my-2 ml-5 list-disc rounded-md bg-muted/50 px-2 py-1",...t}),pre:({node:e,...t})=>O.jsx("pre",{className:"word my-2 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/50 p-2 text-xs text-foreground/80",...t})},{createElement:Wc,createContext:Lue,createRef:ime,forwardRef:pI,useCallback:Yr,useContext:gI,useEffect:il,useImperativeHandle:mI,useLayoutEffect:Fue,useMemo:zue,useRef:Do,useState:Ag}=ge,bT=ge.useId,Um=Lue(null);Um.displayName="PanelGroupContext";const Kd=Fue,jue=typeof bT=="function"?bT:()=>null;let Bue=0;function d_(e=null){const t=jue(),n=Do(e||t||null);return n.current===null&&(n.current=""+Bue++),e??n.current}function vI({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:o,forwardedRef:i,id:s,maxSize:a,minSize:l,onCollapse:c,onExpand:u,onResize:f,order:p,style:g,tagName:v="div",...b}){const x=gI(Um);if(x===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:w,expandPanel:_,getPanelSize:S,getPanelStyle:R,groupId:C,isPanelCollapsed:P,registerPanel:A,resizePanel:M,unregisterPanel:T}=x,I=d_(s),F=Do({callbacks:{onCollapse:c,onExpand:u,onResize:f},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:a,minSize:l},id:I,idIsFromProps:s!==void 0,order:p});Do({didLogMissingDefaultSizeWarning:!1}),Kd(()=>{const{callbacks:X,constraints:G}=F.current;F.current.id=I,F.current.idIsFromProps=s!==void 0,F.current.order=p,X.onCollapse=c,X.onExpand=u,X.onResize=f,G.collapsedSize=n,G.collapsible=r,G.defaultSize=o,G.maxSize=a,G.minSize=l}),Kd(()=>{const X=F.current;return A(X),()=>{T(X)}},[p,I,A,T]),mI(i,()=>({collapse:()=>{w(F.current)},expand:()=>{_(F.current)},getId(){return I},getSize(){return S(F.current)},isCollapsed(){return P(F.current)},isExpanded(){return!P(F.current)},resize:X=>{M(F.current,X)}}),[w,_,S,P,I,M]);const j=R(F.current,o);return Wc(v,{...b,children:e,className:t,style:{...j,...g},"data-panel":"","data-panel-id":I,"data-panel-group-id":C,"data-panel-collapsible":void 0,"data-panel-size":void 0})}const bI=pI((e,t)=>Wc(vI,{...e,forwardedRef:t}));vI.displayName="Panel";bI.displayName="forwardRef(Panel)";function bt(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}const yI=10;function Xd(e,t,n=yI){e=parseFloat(e.toFixed(n)),t=parseFloat(t.toFixed(n));const r=e-t;return r===0?0:r>0?1:-1}function Jr(e,t,n){return Xd(e,t,n)===0}function sc({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];bt(r!=null);let{collapsedSize:o=0,collapsible:i,maxSize:s=100,minSize:a=0}=r;if(Xd(n,a)<0)if(i){const l=(o+a)/2;Xd(n,l)<0?n=o:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(yI)),n}function Xu({delta:e,layout:t,panelConstraints:n,pivotIndices:r,trigger:o}){if(Jr(e,0))return t;const i=[...t],[s,a]=r;bt(s!=null),bt(a!=null);let l=0;if(o==="keyboard"){{const u=e<0?a:s,f=n[u];if(bt(f),f.collapsible){const p=t[u];bt(p!=null);const g=n[u];bt(g);const{collapsedSize:v=0,minSize:b=0}=g;if(Jr(p,v)){const x=b-p;Xd(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const u=e<0?s:a,f=n[u];bt(f);const{collapsible:p}=f;if(p){const g=t[u];bt(g!=null);const v=n[u];bt(v);const{collapsedSize:b=0,minSize:x=0}=v;if(Jr(g,x)){const w=g-b;Xd(w,Math.abs(e))>0&&(e=e<0?0-w:w)}}}}{const u=e<0?1:-1;let f=e<0?a:s,p=0;for(;;){const v=t[f];bt(v!=null);const x=sc({panelConstraints:n,panelIndex:f,size:100})-v;if(p+=x,f+=u,f<0||f>=n.length)break}const g=Math.min(Math.abs(e),Math.abs(p));e=e<0?0-g:g}{let f=e<0?s:a;for(;f>=0&&f<n.length;){const p=Math.abs(e)-Math.abs(l),g=t[f];bt(g!=null);const v=g-p,b=sc({panelConstraints:n,panelIndex:f,size:v});if(!Jr(g,b)&&(l+=g-b,i[f]=b,l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(Jr(l,0))return t;{const u=e<0?a:s,f=t[u];bt(f!=null);const p=f+l,g=sc({panelConstraints:n,panelIndex:u,size:p});if(i[u]=g,!Jr(g,p)){let v=p-g,x=e<0?a:s;for(;x>=0&&x<n.length;){const w=i[x];bt(w!=null);const _=w+v,S=sc({panelConstraints:n,panelIndex:x,size:_});if(Jr(w,S)||(v-=S-w,i[x]=S),Jr(v,0))break;e>0?x--:x++}}}const c=i.reduce((u,f)=>f+u,0);return Jr(c,100)?i:t}function Vue({layout:e,panelsArray:t,pivotIndices:n}){let r=0,o=100,i=0,s=0;const a=n[0];bt(a!=null),t.forEach((f,p)=>{const{constraints:g}=f,{maxSize:v=100,minSize:b=0}=g;p===a?(r=b,o=v):(i+=b,s+=v)});const l=Math.min(o,100-i),c=Math.max(r,100-s),u=e[a];return{valueMax:l,valueMin:c,valueNow:u}}function Qd(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function xI(e,t){const r=Qd(e).findIndex(o=>o.getAttribute("data-panel-resize-handle-id")===t);return r??null}function wI(e,t){const n=xI(e,t);return n!=null?[n,n+1]:[-1,-1]}function _I(e){const t=document.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return t||null}function qm(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function Hue(e,t,n){var r,o,i,s;const a=qm(t),l=Qd(e),c=a?l.indexOf(a):-1,u=(r=(o=n[c])===null||o===void 0?void 0:o.id)!==null&&r!==void 0?r:null,f=(i=(s=n[c+1])===null||s===void 0?void 0:s.id)!==null&&i!==void 0?i:null;return[u,f]}function Wue({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,setLayout:i}){Do({didWarnAboutMissingResizeHandle:!1}),Kd(()=>{const s=Qd(n);for(let a=0;a<o.length-1;a++){const{valueMax:l,valueMin:c,valueNow:u}=Vue({layout:r,panelsArray:o,pivotIndices:[a,a+1]}),f=s[a];if(f!=null){const p=o[a];bt(p),f.setAttribute("aria-controls",p.id),f.setAttribute("aria-valuemax",""+Math.round(l)),f.setAttribute("aria-valuemin",""+Math.round(c)),f.setAttribute("aria-valuenow",u!=null?""+Math.round(u):"")}}return()=>{s.forEach((a,l)=>{a.removeAttribute("aria-controls"),a.removeAttribute("aria-valuemax"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuenow")})}},[n,r,o]),il(()=>{const s=t.current;bt(s);const{panelDataArray:a}=s,l=_I(n);bt(l!=null,`No group found for id "${n}"`);const c=Qd(n);bt(c);const u=c.map(f=>{const p=f.getAttribute("data-panel-resize-handle-id");bt(p);const[g,v]=Hue(n,p,a);if(g==null||v==null)return()=>{};const b=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const w=a.findIndex(_=>_.id===g);if(w>=0){const _=a[w];bt(_);const S=r[w],{collapsedSize:R=0,collapsible:C,minSize:P=0}=_.constraints;if(S!=null&&C){const A=Xu({delta:Jr(S,R)?P-R:R-S,layout:r,panelConstraints:a.map(M=>M.constraints),pivotIndices:wI(n,p),trigger:"keyboard"});r!==A&&i(A)}}break}}};return f.addEventListener("keydown",b),()=>{f.removeEventListener("keydown",b)}});return()=>{u.forEach(f=>f())}},[e,t,n,r,o,i])}function yT(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function SI(e){return e.type==="keydown"}function CI(e){return e.type.startsWith("mouse")}function EI(e){return e.type.startsWith("touch")}function RI(e,t){const n=e==="horizontal";if(CI(t))return n?t.clientX:t.clientY;if(EI(t)){const r=t.touches[0];return bt(r),n?r.screenX:r.screenY}else throw Error(`Unsupported event type "${t.type}"`)}function Uue(e,t,n,r){const o=n==="horizontal",i=qm(t);bt(i);const s=i.getAttribute("data-panel-group-id");bt(s);let{initialCursorPosition:a}=r;const l=RI(n,e),c=_I(s);bt(c);const u=c.getBoundingClientRect(),f=o?u.width:u.height;return(l-a)/f*100}function que(e,t,n,r,o){if(SI(e)){const i=n==="horizontal";let s=0;e.shiftKey?s=100:o!=null?s=o:s=10;let a=0;switch(e.key){case"ArrowDown":a=i?0:s;break;case"ArrowLeft":a=i?-s:0;break;case"ArrowRight":a=i?s:0;break;case"ArrowUp":a=i?0:-s;break;case"End":a=100;break;case"Home":a=-100;break}return a}else return r==null?0:Uue(e,t,n,r)}function Gue({panelDataArray:e}){const t=Array(e.length),n=e.map(i=>i.constraints);let r=0,o=100;for(let i=0;i<e.length;i++){const s=n[i];bt(s);const{defaultSize:a}=s;a!=null&&(r++,t[i]=a,o-=a)}for(let i=0;i<e.length;i++){const s=n[i];bt(s);const{defaultSize:a}=s;if(a!=null)continue;const l=e.length-r,c=o/l;r++,t[i]=c,o-=c}return t}function Zl(e,t,n){t.forEach((r,o)=>{const i=e[o];bt(i);const{callbacks:s,constraints:a,id:l}=i,{collapsedSize:c=0,collapsible:u}=a,f=n[l];if(f==null||r!==f){n[l]=r;const{onCollapse:p,onExpand:g,onResize:v}=s;v&&v(r,f),u&&(p||g)&&(g&&(f==null||f===c)&&r!==c&&g(),p&&(f==null||f!==c)&&r===c&&p())}})}function Ep(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function Yue({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:o,precision:i=3}){const s=n[o];let a;return s==null?a=e??"1":r.length===1?a="1":a=s.toPrecision(i),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}let $x=null,Ua=null;function OI(e){switch(e){case"horizontal":return"ew-resize";case"horizontal-max":return"w-resize";case"horizontal-min":return"e-resize";case"vertical":return"ns-resize";case"vertical-max":return"n-resize";case"vertical-min":return"s-resize"}}function Kue(){Ua!==null&&(document.head.removeChild(Ua),$x=null,Ua=null)}function L0(e){if($x===e)return;$x=e;const t=OI(e);Ua===null&&(Ua=document.createElement("style"),document.head.appendChild(Ua)),Ua.innerHTML=`*{cursor: ${t}!important;}`}function Xue(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function xT(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function PI(e){return`react-resizable-panels:${e}`}function TI(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:o,order:i}=t;return o?r:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function DI(e,t){try{const n=PI(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function Que(e,t,n){var r,o;const i=(r=DI(e,n))!==null&&r!==void 0?r:{},s=TI(t);return(o=i[s])!==null&&o!==void 0?o:null}function Jue(e,t,n,r,o){var i;const s=PI(e),a=TI(t),l=(i=DI(e,o))!==null&&i!==void 0?i:{};l[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{o.setItem(s,JSON.stringify(l))}catch(c){console.error(c)}}function wT({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((i,s)=>i+s,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!Jr(r,100))for(let i=0;i<t.length;i++){const s=n[i];bt(s!=null);const a=100/r*s;n[i]=a}let o=0;for(let i=0;i<t.length;i++){const s=n[i];bt(s!=null);const a=sc({panelConstraints:t,panelIndex:i,size:s});s!=a&&(o+=s-a,n[i]=a)}if(!Jr(o,0))for(let i=0;i<t.length;i++){const s=n[i];bt(s!=null);const a=s+o,l=sc({panelConstraints:t,panelIndex:i,size:a});if(s!==l&&(o-=l-s,n[i]=l,Jr(o,0)))break}return n}const Zue=100,Qu={getItem:e=>(xT(Qu),Qu.getItem(e)),setItem:(e,t)=>{xT(Qu),Qu.setItem(e,t)}},_T={};function $I({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:i=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=Qu,style:c,tagName:u="div",...f}){const p=d_(i),[g,v]=Ag(null),[b,x]=Ag([]),w=Do({}),_=Do(new Map),S=Do(0),R=Do({autoSaveId:e,direction:r,dragState:g,id:p,keyboardResizeBy:a,onLayout:s,storage:l}),C=Do({layout:b,panelDataArray:[],panelDataArrayChanged:!1});Do({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),mI(o,()=>({getId:()=>R.current.id,getLayout:()=>{const{layout:$}=C.current;return $},setLayout:$=>{const{onLayout:V}=R.current,{layout:Q,panelDataArray:N}=C.current,le=wT({layout:$,panelConstraints:N.map(se=>se.constraints)});yT(Q,le)||(x(le),C.current.layout=le,V&&V(le),Zl(N,le,w.current))}}),[]),Kd(()=>{R.current.autoSaveId=e,R.current.direction=r,R.current.dragState=g,R.current.id=p,R.current.onLayout=s,R.current.storage=l}),Wue({committedValuesRef:R,eagerValuesRef:C,groupId:p,layout:b,panelDataArray:C.current.panelDataArray,setLayout:x}),il(()=>{const{panelDataArray:$}=C.current;if(e){if(b.length===0||b.length!==$.length)return;let V=_T[e];V==null&&(V=Xue(Jue,Zue),_T[e]=V);const Q=[...$],N=new Map(_.current);V(e,Q,N,b,l)}},[e,b,l]),il(()=>{});const P=Yr($=>{const{onLayout:V}=R.current,{layout:Q,panelDataArray:N}=C.current;if($.constraints.collapsible){const le=N.map(ie=>ie.constraints),{collapsedSize:se=0,panelSize:ue,pivotIndices:he}=ec(N,$,Q);if(bt(ue!=null),ue!==se){_.current.set($.id,ue);const ee=rc(N,$)===N.length-1?ue-se:se-ue,ae=Xu({delta:ee,layout:Q,panelConstraints:le,pivotIndices:he,trigger:"imperative-api"});Ep(Q,ae)||(x(ae),C.current.layout=ae,V&&V(ae),Zl(N,ae,w.current))}}},[]),A=Yr($=>{const{onLayout:V}=R.current,{layout:Q,panelDataArray:N}=C.current;if($.constraints.collapsible){const le=N.map(ee=>ee.constraints),{collapsedSize:se=0,panelSize:ue,minSize:he=0,pivotIndices:ie}=ec(N,$,Q);if(ue===se){const ee=_.current.get($.id),ae=ee!=null&&ee>=he?ee:he,q=rc(N,$)===N.length-1?ue-ae:ae-ue,be=Xu({delta:q,layout:Q,panelConstraints:le,pivotIndices:ie,trigger:"imperative-api"});Ep(Q,be)||(x(be),C.current.layout=be,V&&V(be),Zl(N,be,w.current))}}},[]),M=Yr($=>{const{layout:V,panelDataArray:Q}=C.current,{panelSize:N}=ec(Q,$,V);return bt(N!=null),N},[]),T=Yr(($,V)=>{const{panelDataArray:Q}=C.current,N=rc(Q,$);return Yue({defaultSize:V,dragState:g,layout:b,panelData:Q,panelIndex:N})},[g,b]),I=Yr($=>{const{layout:V,panelDataArray:Q}=C.current,{collapsedSize:N=0,collapsible:le,panelSize:se}=ec(Q,$,V);return le===!0&&se===N},[]),F=Yr($=>{const{layout:V,panelDataArray:Q}=C.current,{collapsedSize:N=0,collapsible:le,panelSize:se}=ec(Q,$,V);return bt(se!=null),!le||se>N},[]),j=Yr($=>{const{panelDataArray:V}=C.current;V.push($),V.sort((Q,N)=>{const le=Q.order,se=N.order;return le==null&&se==null?0:le==null?-1:se==null?1:le-se}),C.current.panelDataArrayChanged=!0},[]);Kd(()=>{if(C.current.panelDataArrayChanged){C.current.panelDataArrayChanged=!1;const{autoSaveId:$,onLayout:V,storage:Q}=R.current,{layout:N,panelDataArray:le}=C.current;let se=null;if($){const he=Que($,le,Q);he&&(_.current=new Map(Object.entries(he.expandToSizes)),se=he.layout)}se==null&&(se=Gue({panelDataArray:le}));const ue=wT({layout:se,panelConstraints:le.map(he=>he.constraints)});yT(N,ue)||(x(ue),C.current.layout=ue,V&&V(ue),Zl(le,ue,w.current))}});const X=Yr($=>function(Q){Q.preventDefault();const{direction:N,dragState:le,id:se,keyboardResizeBy:ue,onLayout:he}=R.current,{layout:ie,panelDataArray:ee}=C.current,{initialLayout:ae}=le??{},ye=wI(se,$);let q=que(Q,$,N,le,ue);if(q===0)return;const be=N==="horizontal";document.dir==="rtl"&&be&&(q=-q);const _e=ee.map(Ue=>Ue.constraints),Oe=Xu({delta:q,layout:ae??ie,panelConstraints:_e,pivotIndices:ye,trigger:SI(Q)?"keyboard":"mouse-or-touch"}),Te=!Ep(ie,Oe);(CI(Q)||EI(Q))&&S.current!=q&&(S.current=q,L0(Te?be?"horizontal":"vertical":be?q<0?"horizontal-min":"horizontal-max":q<0?"vertical-min":"vertical-max")),Te&&(x(Oe),C.current.layout=Oe,he&&he(Oe),Zl(ee,Oe,w.current))},[]),G=Yr(($,V)=>{const{onLayout:Q}=R.current,{layout:N,panelDataArray:le}=C.current,se=le.map(ye=>ye.constraints),{panelSize:ue,pivotIndices:he}=ec(le,$,N);bt(ue!=null);const ee=rc(le,$)===le.length-1?ue-V:V-ue,ae=Xu({delta:ee,layout:N,panelConstraints:se,pivotIndices:he,trigger:"imperative-api"});Ep(N,ae)||(x(ae),C.current.layout=ae,Q&&Q(ae),Zl(le,ae,w.current))},[]),B=Yr(($,V)=>{const{direction:Q}=R.current,{layout:N}=C.current,le=qm($);bt(le);const se=RI(Q,V);v({dragHandleId:$,dragHandleRect:le.getBoundingClientRect(),initialCursorPosition:se,initialLayout:N})},[]),J=Yr(()=>{Kue(),v(null)},[]),H=Yr($=>{const{panelDataArray:V}=C.current,Q=rc(V,$);Q>=0&&(V.splice(Q,1),delete w.current[$.id],C.current.panelDataArrayChanged=!0)},[]),Y=zue(()=>({collapsePanel:P,direction:r,dragState:g,expandPanel:A,getPanelSize:M,getPanelStyle:T,groupId:p,isPanelCollapsed:I,isPanelExpanded:F,registerPanel:j,registerResizeHandle:X,resizePanel:G,startDragging:B,stopDragging:J,unregisterPanel:H}),[P,g,r,A,M,T,p,I,F,j,X,G,B,J,H]),te={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Wc(Um.Provider,{value:Y},Wc(u,{...f,children:t,className:n,style:{...te,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":p}))}const kI=pI((e,t)=>Wc($I,{...e,forwardedRef:t}));$I.displayName="PanelGroup";kI.displayName="forwardRef(PanelGroup)";function rc(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function ec(e,t,n){const r=e.map(c=>c.constraints),o=rc(e,t),i=r[o],a=o===e.length-1?[o-1,o]:[o,o+1],l=n[o];return{...i,panelSize:l,pivotIndices:a}}function ede({disabled:e,handleId:t,resizeHandler:n}){il(()=>{if(e||n==null)return;const r=qm(t);if(r==null)return;const o=i=>{if(!i.defaultPrevented)switch(i.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{i.preventDefault(),n(i);break}case"F6":{i.preventDefault();const s=r.getAttribute("data-panel-group-id");bt(s);const a=Qd(s),l=xI(s,t);bt(l!==null);const c=i.shiftKey?l>0?l-1:a.length-1:l+1<a.length?l+1:0;a[c].focus();break}}};return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[e,t,n])}function f_({children:e=null,className:t="",disabled:n=!1,id:r,onDragging:o,style:i={},tabIndex:s=0,tagName:a="div",...l}){const c=Do(null),u=Do({onDragging:o});il(()=>{u.current.onDragging=o});const f=gI(Um);if(f===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:p,dragState:g,groupId:v,registerResizeHandle:b,startDragging:x,stopDragging:w}=f,_=d_(r),S=(g==null?void 0:g.dragHandleId)===_,[R,C]=Ag(!1),[P,A]=Ag(null),M=Yr(()=>{const I=c.current;bt(I),I.blur(),w();const{onDragging:F}=u.current;F&&F(!1)},[w]);il(()=>{if(n)A(null);else{const I=b(_);A(()=>I)}},[n,_,b]),il(()=>{if(n||P==null||!S)return;const I=G=>{P(G)},F=G=>{P(G)},j=c.current;bt(j);const X=j.ownerDocument;return X.body.addEventListener("contextmenu",M),X.body.addEventListener("mousemove",I),X.body.addEventListener("touchmove",I),X.body.addEventListener("mouseleave",F),window.addEventListener("mouseup",M),window.addEventListener("touchend",M),()=>{X.body.removeEventListener("contextmenu",M),X.body.removeEventListener("mousemove",I),X.body.removeEventListener("touchmove",I),X.body.removeEventListener("mouseleave",F),window.removeEventListener("mouseup",M),window.removeEventListener("touchend",M)}},[p,n,S,P,M]),ede({disabled:n,handleId:_,resizeHandler:P});const T={cursor:OI(p),touchAction:"none",userSelect:"none"};return Wc(a,{...l,children:e,className:t,onBlur:()=>C(!1),onFocus:()=>C(!0),onMouseDown:I=>{x(_,I.nativeEvent);const F=u.current;bt(F);const{onDragging:j}=F;j&&j(!0)},onMouseUp:M,onTouchCancel:M,onTouchEnd:M,onTouchStart:I=>{x(_,I.nativeEvent);const F=u.current;bt(F);const{onDragging:j}=F;j&&j(!0)},ref:c,role:"separator",style:{...T,...i},tabIndex:s,"data-panel-group-direction":p,"data-panel-group-id":v,"data-resize-handle":"","data-resize-handle-active":S?"pointer":R?"keyboard":void 0,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":_})}f_.displayName="PanelResizeHandle";const MI=({className:e,...t})=>O.jsx(kI,{className:Pe("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),kx=bI,tde=({withHandle:e,className:t,...n})=>O.jsx(f_,{className:Pe("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...n,children:e&&O.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:O.jsx(YY,{className:"h-2.5 w-2.5"})})}),nde=({withHandle:e,className:t,onTabClick:n,open:r,...o})=>O.jsx(f_,{className:Pe("relative flex w-px items-start justify-end bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",{"justify-start":r},t),...o,children:e&&O.jsx("div",{className:Pe("z-50 flex items-center justify-start",{"border-l":r}),children:O.jsx(yr,{variant:"secondary",className:Pe("h-7 p-1",{"rounded-bl-none rounded-br-md rounded-tl-none rounded-tr-md":r,"mt-2 rounded-bl-md rounded-br-none rounded-tl-md rounded-tr-none":!r}),onClick:()=>n(!r),children:r?O.jsx(qw,{className:"size-4"}):O.jsx(N$,{className:"size-4"})})})});function AI(){const e=Ie(c=>{var u;return(u=c.dashboard)==null?void 0:u.sheets}),{showAssistant:t}=fa(),n=m.useRef(null),[r,o]=m.useState(!1);Ie(c=>c.isDashboardEditing);const i=Ie(c=>c.themeStyle);Ie(c=>c.isVisualEditing);const s=Ie(c=>c.selectedSheetId),a=Ie(c=>c.actions.setSelectedSheetId);if(!e)return null;function l(c){var u,f;c?((u=n.current)==null||u.resize(35),o(!0)):(o(!1),(f=n.current)==null||f.resize(0))}return O.jsx(I2,{role:"dashboard-tabs-container",className:Pe("relative flex grow",i==null?void 0:i.dashboardTabsContainer),onValueChange:c=>{a(c)},value:s||e[0].id,children:O.jsxs(MI,{direction:"horizontal",children:[O.jsx(kx,{children:O.jsx("div",{style:{},className:"bg-muted",children:e==null?void 0:e.map(c=>O.jsx(tw,{className:"mt-0",value:c.id,children:O.jsx(Boe,{})},c.id))})}),t===!0&&O.jsxs(O.Fragment,{children:[O.jsx(nde,{open:r,onTabClick:l,withHandle:!0}),O.jsx(kx,{onResize:c=>{c<1?o(!1):r||o(!0)},defaultSize:0,ref:n,children:O.jsx(Iue,{})})]})]})})}function II({children:e}){return O.jsx(mz,{defaultTheme:"system",storageKey:"vite-ui-theme",children:O.jsx(xX,{delayDuration:0,children:e})})}function NI(e){return O.jsx(dk,{dashboardProps:e,children:O.jsx(II,{children:O.jsx(S2,{...e,children:O.jsx(AI,{})})})})}const Mx=["Enter"," "],rde=["ArrowDown","PageUp","Home"],LI=["ArrowUp","PageDown","End"],ode=[...rde,...LI],ide={ltr:[...Mx,"ArrowRight"],rtl:[...Mx,"ArrowLeft"]},sde={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Gm="Menu",[Jd,ade,lde]=Yg(Gm),[El,FI]=Gn(Gm,[lde,Pi,Gc]),h_=Pi(),zI=Gc(),[cde,Rl]=El(Gm),[ude,Bf]=El(Gm),dde=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=h_(t),[l,c]=m.useState(null),u=m.useRef(!1),f=Fn(i),p=ml(o);return m.useEffect(()=>{const g=()=>{u.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>u.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),m.createElement(Pf,a,m.createElement(cde,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:c},m.createElement(ude,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:u,dir:p,modal:s},r)))},jI=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=h_(n);return m.createElement(Tf,fe({},o,r,{ref:t}))}),BI="MenuPortal",[fde,VI]=El(BI,{forceMount:void 0}),hde=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Rl(BI,t);return m.createElement(fde,{scope:t,forceMount:n},m.createElement(Mn,{present:n||i.open},m.createElement(vm,{asChild:!0,container:o},r)))},Yo="MenuContent",[pde,p_]=El(Yo),gde=m.forwardRef((e,t)=>{const n=VI(Yo,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Rl(Yo,e.__scopeMenu),s=Bf(Yo,e.__scopeMenu);return m.createElement(Jd.Provider,{scope:e.__scopeMenu},m.createElement(Mn,{present:r||i.open},m.createElement(Jd.Slot,{scope:e.__scopeMenu},s.modal?m.createElement(mde,fe({},o,{ref:t})):m.createElement(vde,fe({},o,{ref:t})))))}),mde=m.forwardRef((e,t)=>{const n=Rl(Yo,e.__scopeMenu),r=m.useRef(null),o=ft(t,r);return m.useEffect(()=>{const i=r.current;if(i)return Cm(i)},[]),m.createElement(g_,fe({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:De(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),vde=m.forwardRef((e,t)=>{const n=Rl(Yo,e.__scopeMenu);return m.createElement(g_,fe({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),g_=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:g,disableOutsideScroll:v,...b}=e,x=Rl(Yo,n),w=Bf(Yo,n),_=h_(n),S=zI(n),R=ade(n),[C,P]=m.useState(null),A=m.useRef(null),M=ft(t,A,x.onContentChange),T=m.useRef(0),I=m.useRef(""),F=m.useRef(0),j=m.useRef(null),X=m.useRef("right"),G=m.useRef(0),B=v?Rm:m.Fragment,J=v?{as:ss,allowPinchZoom:!0}:void 0,H=te=>{var $,V;const Q=I.current+te,N=R().filter(ee=>!ee.disabled),le=document.activeElement,se=($=N.find(ee=>ee.ref.current===le))===null||$===void 0?void 0:$.textValue,ue=N.map(ee=>ee.textValue),he=Nde(ue,Q,se),ie=(V=N.find(ee=>ee.textValue===he))===null||V===void 0?void 0:V.ref.current;(function ee(ae){I.current=ae,window.clearTimeout(T.current),ae!==""&&(T.current=window.setTimeout(()=>ee(""),1e3))})(Q),ie&&setTimeout(()=>ie.focus())};m.useEffect(()=>()=>window.clearTimeout(T.current),[]),wm();const Y=m.useCallback(te=>{var $,V;return X.current===(($=j.current)===null||$===void 0?void 0:$.side)&&Fde(te,(V=j.current)===null||V===void 0?void 0:V.area)},[]);return m.createElement(pde,{scope:n,searchRef:I,onItemEnter:m.useCallback(te=>{Y(te)&&te.preventDefault()},[Y]),onItemLeave:m.useCallback(te=>{var $;Y(te)||(($=A.current)===null||$===void 0||$.focus(),P(null))},[Y]),onTriggerLeave:m.useCallback(te=>{Y(te)&&te.preventDefault()},[Y]),pointerGraceTimerRef:F,onPointerGraceIntentChange:m.useCallback(te=>{j.current=te},[])},m.createElement(B,J,m.createElement(_m,{asChild:!0,trapped:o,onMountAutoFocus:De(i,te=>{var $;te.preventDefault(),($=A.current)===null||$===void 0||$.focus()}),onUnmountAutoFocus:s},m.createElement(Yc,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:g},m.createElement(Jx,fe({asChild:!0},S,{dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:P,onEntryFocus:De(l,te=>{w.isUsingKeyboardRef.current||te.preventDefault()})}),m.createElement(Df,fe({role:"menu","aria-orientation":"vertical","data-state":GI(x.open),"data-radix-menu-content":"",dir:w.dir},_,b,{ref:M,style:{outline:"none",...b.style},onKeyDown:De(b.onKeyDown,te=>{const V=te.target.closest("[data-radix-menu-content]")===te.currentTarget,Q=te.ctrlKey||te.altKey||te.metaKey,N=te.key.length===1;V&&(te.key==="Tab"&&te.preventDefault(),!Q&&N&&H(te.key));const le=A.current;if(te.target!==le||!ode.includes(te.key))return;te.preventDefault();const ue=R().filter(he=>!he.disabled).map(he=>he.ref.current);LI.includes(te.key)&&ue.reverse(),Ade(ue)}),onBlur:De(e.onBlur,te=>{te.currentTarget.contains(te.target)||(window.clearTimeout(T.current),I.current="")}),onPointerMove:De(e.onPointerMove,Zd(te=>{const $=te.target,V=G.current!==te.clientX;if(te.currentTarget.contains($)&&V){const Q=te.clientX>G.current?"right":"left";X.current=Q,G.current=te.clientX}}))})))))))}),bde=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,fe({role:"group"},r,{ref:t}))}),yde=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,fe({},r,{ref:t}))}),Ax="MenuItem",ST="menu.itemSelect",m_=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=m.useRef(null),s=Bf(Ax,e.__scopeMenu),a=p_(Ax,e.__scopeMenu),l=ft(t,i),c=m.useRef(!1),u=()=>{const f=i.current;if(!n&&f){const p=new CustomEvent(ST,{bubbles:!0,cancelable:!0});f.addEventListener(ST,g=>r==null?void 0:r(g),{once:!0}),E2(f,p),p.defaultPrevented?c.current=!1:s.onClose()}};return m.createElement(HI,fe({},o,{ref:l,disabled:n,onClick:De(e.onClick,u),onPointerDown:f=>{var p;(p=e.onPointerDown)===null||p===void 0||p.call(e,f),c.current=!0},onPointerUp:De(e.onPointerUp,f=>{var p;c.current||(p=f.currentTarget)===null||p===void 0||p.click()}),onKeyDown:De(e.onKeyDown,f=>{const p=a.searchRef.current!=="";n||p&&f.key===" "||Mx.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),HI=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=p_(Ax,n),a=zI(n),l=m.useRef(null),c=ft(t,l),[u,f]=m.useState(!1),[p,g]=m.useState("");return m.useEffect(()=>{const v=l.current;if(v){var b;g(((b=v.textContent)!==null&&b!==void 0?b:"").trim())}},[i.children]),m.createElement(Jd.ItemSlot,{scope:n,disabled:r,textValue:o??p},m.createElement(Zx,fe({asChild:!0},a,{focusable:!r}),m.createElement(Qe.div,fe({role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},i,{ref:c,onPointerMove:De(e.onPointerMove,Zd(v=>{r?s.onItemLeave(v):(s.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus())})),onPointerLeave:De(e.onPointerLeave,Zd(v=>s.onItemLeave(v))),onFocus:De(e.onFocus,()=>f(!0)),onBlur:De(e.onBlur,()=>f(!1))}))))}),xde=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return m.createElement(UI,{scope:e.__scopeMenu,checked:n},m.createElement(m_,fe({role:"menuitemcheckbox","aria-checked":Ig(n)?"mixed":n},o,{ref:t,"data-state":v_(n),onSelect:De(o.onSelect,()=>r==null?void 0:r(Ig(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),wde="MenuRadioGroup",[_de,Sde]=El(wde,{value:void 0,onValueChange:()=>{}}),Cde=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=Fn(r);return m.createElement(_de,{scope:e.__scopeMenu,value:n,onValueChange:i},m.createElement(bde,fe({},o,{ref:t})))}),Ede="MenuRadioItem",Rde=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=Sde(Ede,e.__scopeMenu),i=n===o.value;return m.createElement(UI,{scope:e.__scopeMenu,checked:i},m.createElement(m_,fe({role:"menuitemradio","aria-checked":i},r,{ref:t,"data-state":v_(i),onSelect:De(r.onSelect,()=>{var s;return(s=o.onValueChange)===null||s===void 0?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})))}),WI="MenuItemIndicator",[UI,Ode]=El(WI,{checked:!1}),Pde=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=Ode(WI,n);return m.createElement(Mn,{present:r||Ig(i.checked)||i.checked===!0},m.createElement(Qe.span,fe({},o,{ref:t,"data-state":v_(i.checked)})))}),Tde=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,fe({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),Dde="MenuSub",[sme,qI]=El(Dde),Rp="MenuSubTrigger",$de=m.forwardRef((e,t)=>{const n=Rl(Rp,e.__scopeMenu),r=Bf(Rp,e.__scopeMenu),o=qI(Rp,e.__scopeMenu),i=p_(Rp,e.__scopeMenu),s=m.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},u=m.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return m.useEffect(()=>u,[u]),m.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),m.createElement(jI,fe({asChild:!0},c),m.createElement(HI,fe({id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":GI(n.open)},e,{ref:Gg(t,o.onTriggerChange),onClick:f=>{var p;(p=e.onClick)===null||p===void 0||p.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:De(e.onPointerMove,Zd(f=>{i.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:De(e.onPointerLeave,Zd(f=>{var p;u();const g=(p=n.content)===null||p===void 0?void 0:p.getBoundingClientRect();if(g){var v;const b=(v=n.content)===null||v===void 0?void 0:v.dataset.side,x=b==="right",w=x?-5:5,_=g[x?"left":"right"],S=g[x?"right":"left"];i.onPointerGraceIntentChange({area:[{x:f.clientX+w,y:f.clientY},{x:_,y:g.top},{x:S,y:g.top},{x:S,y:g.bottom},{x:_,y:g.bottom}],side:b}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(f),f.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:De(e.onKeyDown,f=>{const p=i.searchRef.current!=="";if(!(e.disabled||p&&f.key===" ")&&ide[r.dir].includes(f.key)){var g;n.onOpenChange(!0),(g=n.content)===null||g===void 0||g.focus(),f.preventDefault()}})})))}),kde="MenuSubContent",Mde=m.forwardRef((e,t)=>{const n=VI(Yo,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Rl(Yo,e.__scopeMenu),s=Bf(Yo,e.__scopeMenu),a=qI(kde,e.__scopeMenu),l=m.useRef(null),c=ft(t,l);return m.createElement(Jd.Provider,{scope:e.__scopeMenu},m.createElement(Mn,{present:r||i.open},m.createElement(Jd.Slot,{scope:e.__scopeMenu},m.createElement(g_,fe({id:a.contentId,"aria-labelledby":a.triggerId},o,{ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var f;s.isUsingKeyboardRef.current&&((f=l.current)===null||f===void 0||f.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:De(e.onFocusOutside,u=>{u.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:De(e.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:De(e.onKeyDown,u=>{const f=u.currentTarget.contains(u.target),p=sde[s.dir].includes(u.key);if(f&&p){var g;i.onOpenChange(!1),(g=a.trigger)===null||g===void 0||g.focus(),u.preventDefault()}})})))))});function GI(e){return e?"open":"closed"}function Ig(e){return e==="indeterminate"}function v_(e){return Ig(e)?"indeterminate":e?"checked":"unchecked"}function Ade(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Ide(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Nde(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=Ide(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Lde(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function Fde(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Lde(n,t)}function Zd(e){return t=>t.pointerType==="mouse"?e(t):void 0}const zde=dde,jde=jI,Bde=hde,Vde=gde,Hde=yde,Wde=m_,Ude=xde,qde=Cde,Gde=Rde,Yde=Pde,Kde=Tde,Xde=$de,Qde=Mde,YI="DropdownMenu",[Jde,ame]=Gn(YI,[FI]),ho=FI(),[Zde,KI]=Jde(YI),efe=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=ho(t),c=m.useRef(null),[u=!1,f]=ur({prop:o,defaultProp:i,onChange:s});return m.createElement(Zde,{scope:t,triggerId:Nr(),triggerRef:c,contentId:Nr(),open:u,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(p=>!p),[f]),modal:a},m.createElement(zde,fe({},l,{open:u,onOpenChange:f,dir:r,modal:a}),n))},tfe="DropdownMenuTrigger",nfe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=KI(tfe,n),s=ho(n);return m.createElement(jde,fe({asChild:!0},s),m.createElement(Qe.button,fe({type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},o,{ref:Gg(t,i.triggerRef),onPointerDown:De(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:De(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})))}),rfe=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ho(t);return m.createElement(Bde,fe({},r,n))},ofe="DropdownMenuContent",ife=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=KI(ofe,n),i=ho(n),s=m.useRef(!1);return m.createElement(Vde,fe({id:o.contentId,"aria-labelledby":o.triggerId},i,r,{ref:t,onCloseAutoFocus:De(e.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)===null||l===void 0||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:De(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(s.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)"}}))}),sfe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Hde,fe({},o,r,{ref:t}))}),afe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Wde,fe({},o,r,{ref:t}))}),lfe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Ude,fe({},o,r,{ref:t}))}),cfe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(qde,fe({},o,r,{ref:t}))}),ufe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Gde,fe({},o,r,{ref:t}))}),dfe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Yde,fe({},o,r,{ref:t}))}),ffe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Kde,fe({},o,r,{ref:t}))}),hfe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Xde,fe({},o,r,{ref:t}))}),pfe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Qde,fe({},o,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)"}}))}),gfe=efe,mfe=nfe,vfe=rfe,XI=ife,QI=sfe,JI=afe,ZI=lfe,bfe=cfe,e5=ufe,t5=dfe,n5=ffe,r5=hfe,o5=pfe,yfe=gfe,xfe=mfe,wfe=bfe,_fe=ge.forwardRef(({className:e,inset:t,children:n,...r},o)=>O.jsxs(r5,{ref:o,className:Pe("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,O.jsx(qw,{className:"ml-auto h-4 w-4"})]}));_fe.displayName=r5.displayName;const Sfe=ge.forwardRef(({className:e,...t},n)=>O.jsx(o5,{ref:n,className:Pe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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}));Sfe.displayName=o5.displayName;const i5=ge.forwardRef(({className:e,sideOffset:t=4,...n},r)=>O.jsx(vfe,{children:O.jsx(XI,{ref:r,sideOffset:t,className:Pe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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})}));i5.displayName=XI.displayName;const Cfe=ge.forwardRef(({className:e,inset:t,...n},r)=>O.jsx(JI,{ref:r,className:Pe("relative flex cursor-default select-none items-center rounded-sm 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",t&&"pl-8",e),...n}));Cfe.displayName=JI.displayName;const Efe=ge.forwardRef(({className:e,children:t,checked:n,...r},o)=>O.jsxs(ZI,{ref:o,className:Pe("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:[O.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:O.jsx(t5,{children:O.jsx(Rf,{className:"h-4 w-4"})})}),t]}));Efe.displayName=ZI.displayName;const s5=ge.forwardRef(({className:e,children:t,...n},r)=>O.jsxs(e5,{ref:r,className:Pe("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:[O.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:O.jsx(t5,{children:O.jsx(L$,{className:"h-2 w-2 fill-current"})})}),t]}));s5.displayName=e5.displayName;const a5=ge.forwardRef(({className:e,inset:t,...n},r)=>O.jsx(QI,{ref:r,className:Pe("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));a5.displayName=QI.displayName;const l5=ge.forwardRef(({className:e,...t},n)=>O.jsx(n5,{ref:n,className:Pe("-mx-1 my-1 h-px bg-muted",e),...t}));l5.displayName=n5.displayName;function Rfe(e){var t;return{...e,sheets:(t=e==null?void 0:e.sheets)==null?void 0:t.map(n=>{var r;return{...n,frames:(r=n.frames)==null?void 0:r.map(o=>{var i;return{...o,cards:(i=o.cards)==null?void 0:i.map(s=>c5(s))}})}})}}function c5(e){var t,n,r,o;return{...e,cfg:{...e.cfg,data:{...(t=e.cfg)==null?void 0:t.data,labels:[],datasets:(o=(r=(n=e.cfg)==null?void 0:n.data)==null?void 0:r.datasets)==null?void 0:o.map(i=>({...i,data:[]}))}},customCfg:Ofe(e.customCfg),data:[]}}function Ofe(e){var t,n;return e?{...e,data:{...e==null?void 0:e.data,labels:[],datasets:(n=(t=e==null?void 0:e.data)==null?void 0:t.datasets)==null?void 0:n.map(r=>({...r,data:[]}))}}:null}function u5(e){return`semaphor:bookmark:${e}`}const d5="Dialog",[f5,lme]=Gn(d5),[Pfe,Jo]=f5(d5),Tfe=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=m.useRef(null),l=m.useRef(null),[c=!1,u]=ur({prop:r,defaultProp:o,onChange:i});return m.createElement(Pfe,{scope:t,triggerRef:a,contentRef:l,contentId:Nr(),titleId:Nr(),descriptionId:Nr(),open:c,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(f=>!f),[u]),modal:s},n)},Dfe="DialogTrigger",$fe=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Jo(Dfe,n),i=ft(t,o.triggerRef);return m.createElement(Qe.button,fe({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":b_(o.open)},r,{ref:i,onClick:De(e.onClick,o.onOpenToggle)}))}),h5="DialogPortal",[kfe,p5]=f5(h5,{forceMount:void 0}),Mfe=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Jo(h5,t);return m.createElement(kfe,{scope:t,forceMount:n},m.Children.map(r,s=>m.createElement(Mn,{present:n||i.open},m.createElement(vm,{asChild:!0,container:o},s))))},Ix="DialogOverlay",Afe=m.forwardRef((e,t)=>{const n=p5(Ix,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Jo(Ix,e.__scopeDialog);return i.modal?m.createElement(Mn,{present:r||i.open},m.createElement(Ife,fe({},o,{ref:t}))):null}),Ife=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Jo(Ix,n);return m.createElement(Rm,{as:ss,allowPinchZoom:!0,shards:[o.contentRef]},m.createElement(Qe.div,fe({"data-state":b_(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),ef="DialogContent",Nfe=m.forwardRef((e,t)=>{const n=p5(ef,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Jo(ef,e.__scopeDialog);return m.createElement(Mn,{present:r||i.open},i.modal?m.createElement(Lfe,fe({},o,{ref:t})):m.createElement(Ffe,fe({},o,{ref:t})))}),Lfe=m.forwardRef((e,t)=>{const n=Jo(ef,e.__scopeDialog),r=m.useRef(null),o=ft(t,n.contentRef,r);return m.useEffect(()=>{const i=r.current;if(i)return Cm(i)},[]),m.createElement(g5,fe({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:De(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:De(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:De(e.onFocusOutside,i=>i.preventDefault())}))}),Ffe=m.forwardRef((e,t)=>{const n=Jo(ef,e.__scopeDialog),r=m.useRef(!1),o=m.useRef(!1);return m.createElement(g5,fe({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),g5=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=Jo(ef,n),l=m.useRef(null),c=ft(t,l);return wm(),m.createElement(m.Fragment,null,m.createElement(_m,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(Yc,fe({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":b_(a.open)},s,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),zfe="DialogTitle",jfe=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Jo(zfe,n);return m.createElement(Qe.h2,fe({id:o.titleId},r,{ref:t}))}),Bfe="DialogDescription",Vfe=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Jo(Bfe,n);return m.createElement(Qe.p,fe({id:o.descriptionId},r,{ref:t}))}),Hfe="DialogClose",Wfe=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Jo(Hfe,n);return m.createElement(Qe.button,fe({type:"button"},r,{ref:t,onClick:De(e.onClick,()=>o.onOpenChange(!1))}))});function b_(e){return e?"open":"closed"}const Ufe=Tfe,qfe=$fe,Gfe=Mfe,m5=Afe,v5=Nfe,b5=jfe,y5=Vfe,Yfe=Wfe,Kfe=Ufe,Xfe=qfe,Qfe=Gfe,x5=ge.forwardRef(({className:e,...t},n)=>O.jsx(m5,{ref:n,className:Pe("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));x5.displayName=m5.displayName;const w5=ge.forwardRef(({className:e,children:t,...n},r)=>O.jsxs(Qfe,{children:[O.jsx(x5,{}),O.jsxs(v5,{ref:r,className:Pe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,O.jsxs(Yfe,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[O.jsx(Kw,{className:"h-4 w-4"}),O.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));w5.displayName=v5.displayName;const _5=({className:e,...t})=>O.jsx("div",{className:Pe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});_5.displayName="DialogHeader";const S5=({className:e,...t})=>O.jsx("div",{className:Pe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});S5.displayName="DialogFooter";const C5=ge.forwardRef(({className:e,...t},n)=>O.jsx(b5,{ref:n,className:Pe("text-lg font-semibold leading-none tracking-tight",e),...t}));C5.displayName=b5.displayName;const E5=ge.forwardRef(({className:e,...t},n)=>O.jsx(y5,{ref:n,className:Pe("text-sm text-muted-foreground",e),...t}));E5.displayName=y5.displayName;const R5="Checkbox",[Jfe,cme]=Gn(R5),[Zfe,ehe]=Jfe(R5),the=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,...u}=e,[f,p]=m.useState(null),g=ft(t,S=>p(S)),v=m.useRef(!1),b=f?!!f.closest("form"):!0,[x=!1,w]=ur({prop:o,defaultProp:i,onChange:c}),_=m.useRef(x);return m.useEffect(()=>{const S=f==null?void 0:f.form;if(S){const R=()=>w(_.current);return S.addEventListener("reset",R),()=>S.removeEventListener("reset",R)}},[f,w]),m.createElement(Zfe,{scope:n,state:x,disabled:a},m.createElement(Qe.button,fe({type:"button",role:"checkbox","aria-checked":sl(x)?"mixed":x,"aria-required":s,"data-state":O5(x),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:g,onKeyDown:De(e.onKeyDown,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:De(e.onClick,S=>{w(R=>sl(R)?!0:!R),b&&(v.current=S.isPropagationStopped(),v.current||S.stopPropagation())})})),b&&m.createElement(ohe,{control:f,bubbles:!v.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),nhe="CheckboxIndicator",rhe=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=ehe(nhe,n);return m.createElement(Mn,{present:r||sl(i.state)||i.state===!0},m.createElement(Qe.span,fe({"data-state":O5(i.state),"data-disabled":i.disabled?"":void 0},o,{ref:t,style:{pointerEvents:"none",...e.style}})))}),ohe=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=Sm(n),a=mm(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const p=new Event("click",{bubbles:r});l.indeterminate=sl(n),f.call(l,sl(n)?!1:n),l.dispatchEvent(p)}},[s,n,r]),m.createElement("input",fe({type:"checkbox","aria-hidden":!0,defaultChecked:sl(n)?!1:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function sl(e){return e==="indeterminate"}function O5(e){return sl(e)?"indeterminate":e?"checked":"unchecked"}const P5=the,ihe=rhe,T5=ge.forwardRef(({className:e,...t},n)=>O.jsx(P5,{ref:n,className:Pe("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:O.jsx(ihe,{className:Pe("flex items-center justify-center text-current"),children:O.jsx(Rf,{className:"h-4 w-4"})})}));T5.displayName=P5.displayName;const D5=m.forwardRef(({className:e,...t},n)=>O.jsx("div",{role:"editor-panel",ref:n,className:Pe("flex grow h-full",e),...t}));D5.displayName="EditorPanel";const $5=m.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Pe(" flex flex-col space-y-2 w-[270px]",e),...t}));$5.displayName="EditorAside";const k5=m.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Pe(" grow",e),...t}));k5.displayName="EditorMain";var she=e=>{switch(e){case"success":return che;case"info":return dhe;case"warning":return uhe;case"error":return fhe;default:return null}},ahe=Array(12).fill(0),lhe=({visible:e})=>m.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},m.createElement("div",{className:"sonner-spinner"},ahe.map((t,n)=>m.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),che=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),uhe=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),dhe=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),fhe=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),hhe=()=>{let[e,t]=m.useState(document.hidden);return m.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Nx=1,phe=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Nx++,i=this.toasts.find(a=>a.id===o),s=e.dismissible===void 0?!0:e.dismissible;return i?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...e,id:o,title:n}),{...a,...e,id:o,dismissible:s,title:n}):a):this.addToast({title:n,...r,dismissible:s,id:o}),o},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),o=n!==void 0;return r.then(async i=>{if(mhe(i)&&!i.ok){o=!1;let s=typeof t.error=="function"?await t.error(`HTTP error! status: ${i.status}`):t.error,a=typeof t.description=="function"?await t.description(`HTTP error! status: ${i.status}`):t.description;this.create({id:n,type:"error",message:s,description:a})}else if(t.success!==void 0){o=!1;let s=typeof t.success=="function"?await t.success(i):t.success,a=typeof t.description=="function"?await t.description(i):t.description;this.create({id:n,type:"success",message:s,description:a})}}).catch(async i=>{if(t.error!==void 0){o=!1;let s=typeof t.error=="function"?await t.error(i):t.error,a=typeof t.description=="function"?await t.description(i):t.description;this.create({id:n,type:"error",message:s,description:a})}}).finally(()=>{var i;o&&(this.dismiss(n),n=void 0),(i=t.finally)==null||i.call(t)}),n},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||Nx++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},Zr=new phe,ghe=(e,t)=>{let n=(t==null?void 0:t.id)||Nx++;return Zr.addToast({title:e,...t,id:n}),n},mhe=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",vhe=ghe,bhe=()=>Zr.toasts,yhe=Object.assign(vhe,{success:Zr.success,info:Zr.info,warning:Zr.warning,error:Zr.error,custom:Zr.custom,message:Zr.message,promise:Zr.promise,dismiss:Zr.dismiss,loading:Zr.loading},{getHistory:bhe});function xhe(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}xhe(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
412
|
-
`);function Op(e){return e.label!==void 0}var whe=3,_he="32px",She=4e3,Che=356,Ehe=14,Rhe=20,Ohe=200;function Phe(...e){return e.filter(Boolean).join(" ")}var The=e=>{var t,n,r,o,i,s,a,l,c,u;let{invert:f,toast:p,unstyled:g,interacting:v,setHeights:b,visibleToasts:x,heights:w,index:_,toasts:S,expanded:R,removeToast:C,defaultRichColors:P,closeButton:A,style:M,cancelButtonStyle:T,actionButtonStyle:I,className:F="",descriptionClassName:j="",duration:X,position:G,gap:B,loadingIcon:J,expandByDefault:H,classNames:Y,icons:te,closeButtonAriaLabel:$="Close toast",pauseWhenPageIsHidden:V,cn:Q}=e,[N,le]=m.useState(!1),[se,ue]=m.useState(!1),[he,ie]=m.useState(!1),[ee,ae]=m.useState(!1),[ye,q]=m.useState(0),[be,_e]=m.useState(0),Oe=m.useRef(null),Te=m.useRef(null),Ue=_===0,Be=_+1<=x,Ae=p.type,Ke=p.dismissible!==!1,lt=p.className||"",It=p.descriptionClassName||"",$t=m.useMemo(()=>w.findIndex(nt=>nt.toastId===p.id)||0,[w,p.id]),Ht=m.useMemo(()=>{var nt;return(nt=p.closeButton)!=null?nt:A},[p.closeButton,A]),de=m.useMemo(()=>p.duration||X||She,[p.duration,X]),Ce=m.useRef(0),Le=m.useRef(0),Ge=m.useRef(0),Ze=m.useRef(null),[Wt,Zt]=G.split("-"),Kt=m.useMemo(()=>w.reduce((nt,pt,kt)=>kt>=$t?nt:nt+pt.height,0),[w,$t]),vn=hhe(),ln=p.invert||f,Lt=Ae==="loading";Le.current=m.useMemo(()=>$t*B+Kt,[$t,Kt]),m.useEffect(()=>{le(!0)},[]),m.useLayoutEffect(()=>{if(!N)return;let nt=Te.current,pt=nt.style.height;nt.style.height="auto";let kt=nt.getBoundingClientRect().height;nt.style.height=pt,_e(kt),b(Xt=>Xt.find(yt=>yt.toastId===p.id)?Xt.map(yt=>yt.toastId===p.id?{...yt,height:kt}:yt):[{toastId:p.id,height:kt,position:p.position},...Xt])},[N,p.title,p.description,b,p.id]);let tn=m.useCallback(()=>{ue(!0),q(Le.current),b(nt=>nt.filter(pt=>pt.toastId!==p.id)),setTimeout(()=>{C(p)},Ohe)},[p,C,b,Le]);m.useEffect(()=>{if(p.promise&&Ae==="loading"||p.duration===1/0||p.type==="loading")return;let nt,pt=de;return R||v||V&&vn?(()=>{if(Ge.current<Ce.current){let kt=new Date().getTime()-Ce.current;pt=pt-kt}Ge.current=new Date().getTime()})():pt!==1/0&&(Ce.current=new Date().getTime(),nt=setTimeout(()=>{var kt;(kt=p.onAutoClose)==null||kt.call(p,p),tn()},pt)),()=>clearTimeout(nt)},[R,v,H,p,de,tn,p.promise,Ae,V,vn]),m.useEffect(()=>{let nt=Te.current;if(nt){let pt=nt.getBoundingClientRect().height;return _e(pt),b(kt=>[{toastId:p.id,height:pt,position:p.position},...kt]),()=>b(kt=>kt.filter(Xt=>Xt.toastId!==p.id))}},[b,p.id]),m.useEffect(()=>{p.delete&&tn()},[tn,p.delete]);function xn(){return te!=null&&te.loading?m.createElement("div",{className:"sonner-loader","data-visible":Ae==="loading"},te.loading):J?m.createElement("div",{className:"sonner-loader","data-visible":Ae==="loading"},J):m.createElement(lhe,{visible:Ae==="loading"})}return m.createElement("li",{"aria-live":p.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:Te,className:Q(F,lt,Y==null?void 0:Y.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,Y==null?void 0:Y.default,Y==null?void 0:Y[Ae],(n=p==null?void 0:p.classNames)==null?void 0:n[Ae]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:P,"data-styled":!(p.jsx||p.unstyled||g),"data-mounted":N,"data-promise":!!p.promise,"data-removed":se,"data-visible":Be,"data-y-position":Wt,"data-x-position":Zt,"data-index":_,"data-front":Ue,"data-swiping":he,"data-dismissible":Ke,"data-type":Ae,"data-invert":ln,"data-swipe-out":ee,"data-expanded":!!(R||H&&N),style:{"--index":_,"--toasts-before":_,"--z-index":S.length-_,"--offset":`${se?ye:Le.current}px`,"--initial-height":H?"auto":`${be}px`,...M,...p.style},onPointerDown:nt=>{Lt||!Ke||(Oe.current=new Date,q(Le.current),nt.target.setPointerCapture(nt.pointerId),nt.target.tagName!=="BUTTON"&&(ie(!0),Ze.current={x:nt.clientX,y:nt.clientY}))},onPointerUp:()=>{var nt,pt,kt,Xt;if(ee||!Ke)return;Ze.current=null;let yt=Number(((nt=Te.current)==null?void 0:nt.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Rn=new Date().getTime()-((pt=Oe.current)==null?void 0:pt.getTime()),Io=Math.abs(yt)/Rn;if(Math.abs(yt)>=Rhe||Io>.11){q(Le.current),(kt=p.onDismiss)==null||kt.call(p,p),tn(),ae(!0);return}(Xt=Te.current)==null||Xt.style.setProperty("--swipe-amount","0px"),ie(!1)},onPointerMove:nt=>{var pt;if(!Ze.current||!Ke)return;let kt=nt.clientY-Ze.current.y,Xt=nt.clientX-Ze.current.x,yt=(Wt==="top"?Math.min:Math.max)(0,kt),Rn=nt.pointerType==="touch"?10:2;Math.abs(yt)>Rn?(pt=Te.current)==null||pt.style.setProperty("--swipe-amount",`${kt}px`):Math.abs(Xt)>Rn&&(Ze.current=null)}},Ht&&!p.jsx?m.createElement("button",{"aria-label":$,"data-disabled":Lt,"data-close-button":!0,onClick:Lt||!Ke?()=>{}:()=>{var nt;tn(),(nt=p.onDismiss)==null||nt.call(p,p)},className:Q(Y==null?void 0:Y.closeButton,(o=p==null?void 0:p.classNames)==null?void 0:o.closeButton)},m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},m.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),m.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,p.jsx||m.isValidElement(p.title)?p.jsx||p.title:m.createElement(m.Fragment,null,Ae||p.icon||p.promise?m.createElement("div",{"data-icon":"",className:Q(Y==null?void 0:Y.icon,(i=p==null?void 0:p.classNames)==null?void 0:i.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||xn():null,p.type!=="loading"?p.icon||(te==null?void 0:te[Ae])||she(Ae):null):null,m.createElement("div",{"data-content":"",className:Q(Y==null?void 0:Y.content,(s=p==null?void 0:p.classNames)==null?void 0:s.content)},m.createElement("div",{"data-title":"",className:Q(Y==null?void 0:Y.title,(a=p==null?void 0:p.classNames)==null?void 0:a.title)},p.title),p.description?m.createElement("div",{"data-description":"",className:Q(j,It,Y==null?void 0:Y.description,(l=p==null?void 0:p.classNames)==null?void 0:l.description)},p.description):null),m.isValidElement(p.cancel)?p.cancel:p.cancel&&Op(p.cancel)?m.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||T,onClick:nt=>{var pt,kt;Op(p.cancel)&&Ke&&((kt=(pt=p.cancel).onClick)==null||kt.call(pt,nt),tn())},className:Q(Y==null?void 0:Y.cancelButton,(c=p==null?void 0:p.classNames)==null?void 0:c.cancelButton)},p.cancel.label):null,m.isValidElement(p.action)?p.action:p.action&&Op(p.action)?m.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||I,onClick:nt=>{var pt,kt;Op(p.action)&&(nt.defaultPrevented||((kt=(pt=p.action).onClick)==null||kt.call(pt,nt),tn()))},className:Q(Y==null?void 0:Y.actionButton,(u=p==null?void 0:p.classNames)==null?void 0:u.actionButton)},p.action.label):null))};function CT(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var Dhe=e=>{let{invert:t,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:o,closeButton:i,className:s,offset:a,theme:l="light",richColors:c,duration:u,style:f,visibleToasts:p=whe,toastOptions:g,dir:v=CT(),gap:b=Ehe,loadingIcon:x,icons:w,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:S,cn:R=Phe}=e,[C,P]=m.useState([]),A=m.useMemo(()=>Array.from(new Set([n].concat(C.filter(V=>V.position).map(V=>V.position)))),[C,n]),[M,T]=m.useState([]),[I,F]=m.useState(!1),[j,X]=m.useState(!1),[G,B]=m.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),J=m.useRef(null),H=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),Y=m.useRef(null),te=m.useRef(!1),$=m.useCallback(V=>{var Q;(Q=C.find(N=>N.id===V.id))!=null&&Q.delete||Zr.dismiss(V.id),P(N=>N.filter(({id:le})=>le!==V.id))},[C]);return m.useEffect(()=>Zr.subscribe(V=>{if(V.dismiss){P(Q=>Q.map(N=>N.id===V.id?{...N,delete:!0}:N));return}setTimeout(()=>{Qo.flushSync(()=>{P(Q=>{let N=Q.findIndex(le=>le.id===V.id);return N!==-1?[...Q.slice(0,N),{...Q[N],...V},...Q.slice(N+1)]:[V,...Q]})})})}),[]),m.useEffect(()=>{if(l!=="system"){B(l);return}l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?B("dark"):B("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:V})=>{B(V?"dark":"light")})},[l]),m.useEffect(()=>{C.length<=1&&F(!1)},[C]),m.useEffect(()=>{let V=Q=>{var N,le;r.every(se=>Q[se]||Q.code===se)&&(F(!0),(N=J.current)==null||N.focus()),Q.code==="Escape"&&(document.activeElement===J.current||(le=J.current)!=null&&le.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[r]),m.useEffect(()=>{if(J.current)return()=>{Y.current&&(Y.current.focus({preventScroll:!0}),Y.current=null,te.current=!1)}},[J.current]),C.length?m.createElement("section",{"aria-label":`${_} ${H}`,tabIndex:-1},A.map((V,Q)=>{var N;let[le,se]=V.split("-");return m.createElement("ol",{key:V,dir:v==="auto"?CT():v,tabIndex:-1,ref:J,className:s,"data-sonner-toaster":!0,"data-theme":G,"data-y-position":le,"data-x-position":se,style:{"--front-toast-height":`${((N=M[0])==null?void 0:N.height)||0}px`,"--offset":typeof a=="number"?`${a}px`:a||_he,"--width":`${Che}px`,"--gap":`${b}px`,...f},onBlur:ue=>{te.current&&!ue.currentTarget.contains(ue.relatedTarget)&&(te.current=!1,Y.current&&(Y.current.focus({preventScroll:!0}),Y.current=null))},onFocus:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||te.current||(te.current=!0,Y.current=ue.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{j||F(!1)},onPointerDown:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||X(!0)},onPointerUp:()=>X(!1)},C.filter(ue=>!ue.position&&Q===0||ue.position===V).map((ue,he)=>{var ie,ee;return m.createElement(The,{key:ue.id,icons:w,index:he,toast:ue,defaultRichColors:c,duration:(ie=g==null?void 0:g.duration)!=null?ie:u,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:t,visibleToasts:p,closeButton:(ee=g==null?void 0:g.closeButton)!=null?ee:i,interacting:j,position:V,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:$,toasts:C.filter(ae=>ae.position==ue.position),heights:M.filter(ae=>ae.position==ue.position),setHeights:T,expandByDefault:o,gap:b,loadingIcon:x,expanded:I,pauseWhenPageIsHidden:S,cn:R})}))})):null};function $he(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ET(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function RT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ET(Object(n),!0).forEach(function(r){$he(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ET(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function khe(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function Mhe(e,t){if(e==null)return{};var n=khe(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ahe(e,t){return Ihe(e)||Nhe(e,t)||Lhe(e,t)||Fhe()}function Ihe(e){if(Array.isArray(e))return e}function Nhe(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,o=!1,i=void 0;try{for(var s=e[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(n.push(a.value),!(t&&n.length===t));r=!0);}catch(l){o=!0,i=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(o)throw i}}return n}}function Lhe(e,t){if(e){if(typeof e=="string")return OT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return OT(e,t)}}function OT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Fhe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
413
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zhe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function
|
|
410
|
+
`}),n}function o2(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function i2(e,t){const n=iue(e,t),r=n.one(e,void 0),o=Yce(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:`
|
|
411
|
+
`},o),i}function uue(e,t){return e&&"run"in e?async function(n,r){const o=i2(n,{file:r,...t});await e.run(o,r)}:function(n,r){return i2(n,{file:r,...t||e})}}function s2(e){if(e)throw e}var Kp=Object.prototype.hasOwnProperty,dI=Object.prototype.toString,a2=Object.defineProperty,l2=Object.getOwnPropertyDescriptor,c2=function(t){return typeof Array.isArray=="function"?Array.isArray(t):dI.call(t)==="[object Array]"},u2=function(t){if(!t||dI.call(t)!=="[object Object]")return!1;var n=Kp.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Kp.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var o;for(o in t);return typeof o>"u"||Kp.call(t,o)},d2=function(t,n){a2&&n.name==="__proto__"?a2(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},f2=function(t,n){if(n==="__proto__")if(Kp.call(t,n)){if(l2)return l2(t,n).value}else return;return t[n]},due=function e(){var t,n,r,o,i,s,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=f2(a,n),o=f2(t,n),a!==o&&(u&&o&&(u2(o)||(i=c2(o)))?(i?(i=!1,s=r&&c2(r)?r:[]):s=r&&u2(r)?r:{},d2(a,{name:n,newValue:e(u,s,o)})):typeof o<"u"&&d2(a,{name:n,newValue:o}));return a};const D0=Uc(due);function Tx(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function fue(){const e=[],t={run:n,use:r};return t;function n(...o){let i=-1;const s=o.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...o);function a(l,...c){const u=e[++i];let f=-1;if(l){s(l);return}for(;++f<o.length;)(c[f]===null||c[f]===void 0)&&(c[f]=o[f]);o=c,u?hue(u,a)(...c):s(null,...c)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function hue(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(o);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return o(u)}a||(l instanceof Promise?l.then(i,o):l instanceof Error?o(l):i(l))}function o(s,...a){n||(n=!0,t(s,...a))}function i(s){o(null,s)}}const li={basename:pue,dirname:gue,extname:mue,join:vue,sep:"/"};function pue(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');jf(e);let n=0,r=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else r<0&&(i=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else s<0&&(i=!0,s=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(r=o):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function gue(e){if(jf(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function mue(e){jf(e);let t=e.length,n=-1,r=0,o=-1,i=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||n<0||i===0||i===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function vue(...e){let t=-1,n;for(;++t<e.length;)jf(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":bue(n)}function bue(e){jf(e);const t=e.codePointAt(0)===47;let n=yue(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function yue(e,t){let n="",r=0,o=-1,i=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(o===s-1||i===1))if(o!==s-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),o=s,i=0;continue}}else if(n.length>0){n="",r=0,o=s,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,s):n=e.slice(o+1,s),r=s-o-1;o=s,i=0}else a===46&&i>-1?i++:i=-1}return n}function jf(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const xue={cwd:wue};function wue(){return"/"}function Dx(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function _ue(e){if(typeof e=="string")e=new URL(e);else if(!Dx(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Sue(e)}function Sue(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const $0=["history","path","basename","stem","extname","dirname"];class fI{constructor(t){let n;t?Dx(t)?n={path:t}:typeof t=="string"||Cue(t)?n={value:t}:n=t:n={},this.cwd=xue.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<$0.length;){const i=$0[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let o;for(o in n)$0.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?li.basename(this.path):void 0}set basename(t){M0(t,"basename"),k0(t,"basename"),this.path=li.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?li.dirname(this.path):void 0}set dirname(t){h2(this.basename,"dirname"),this.path=li.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?li.extname(this.path):void 0}set extname(t){if(k0(t,"extname"),h2(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=li.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Dx(t)&&(t=_ue(t)),M0(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?li.basename(this.path,this.extname):void 0}set stem(t){M0(t,"stem"),k0(t,"stem"),this.path=li.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new dr(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function k0(e,t){if(e&&e.includes(li.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+li.sep+"`")}function M0(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function h2(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Cue(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Eue=function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};Object.setPrototypeOf(i,r);const s=Object.getOwnPropertyNames(o);for(const a of s){const l=Object.getOwnPropertyDescriptor(o,a);l&&Object.defineProperty(i,a,l)}return i},Rue={}.hasOwnProperty;class u_ extends Eue{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=fue()}copy(){const t=new u_;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(D0(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(N0("data",this.frozen),this.namespace[t]=n,this):Rue.call(this.namespace,t)&&this.namespace[t]||void 0:t?(N0("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Cp(t),r=this.parser||this.Parser;return A0("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),A0("process",this.parser||this.Parser),I0("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,s){const a=Cp(t),l=r.parse(a);r.run(l,a,function(u,f,p){if(u||!f||!p)return c(u);const g=f,v=r.stringify(g,p);Tue(v)?p.value=v:p.result=v,c(u,p)});function c(u,f){u||!f?s(u):i?i(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),A0("processSync",this.parser||this.Parser),I0("processSync",this.compiler||this.Compiler),this.process(t,o),g2("processSync","process",n),r;function o(i,s){n=!0,s2(i),r=s}}run(t,n,r){p2(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(s,a){const l=Cp(n);o.run(t,l,c);function c(u,f,p){const g=f||t;u?a(u):s?s(g):r(void 0,g,p)}}}runSync(t,n){let r=!1,o;return this.run(t,n,i),g2("runSync","run",r),o;function i(s,a){s2(s),o=a,r=!0}}stringify(t,n){this.freeze();const r=Cp(n),o=this.compiler||this.Compiler;return I0("stringify",o),p2(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(N0("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...f]=c;l(u,f)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(o.settings=D0(!0,o.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const f=c[u];i(f)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let f=-1,p=-1;for(;++f<r.length;)if(r[f][0]===c){p=f;break}if(p===-1)r.push([c,...u]);else if(u.length>0){let[g,...v]=u;const b=r[p][1];Tx(b)&&Tx(g)&&(g=D0(!0,b,g)),r[p]=[c,g,...v]}}}}const Oue=new u_().freeze();function A0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function I0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function N0(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function p2(e){if(!Tx(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function g2(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Cp(e){return Pue(e)?e:new fI(e)}function Pue(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Tue(e){return typeof e=="string"||Due(e)}function Due(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const $ue="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",m2=[],v2={allowDangerousHtml:!0},kue=/^(https?|ircs?|mailto|xmpp)$/i,Mue=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function hI(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",o=e.className,i=e.components,s=e.disallowedElements,a=e.rehypePlugins||m2,l=e.remarkPlugins||m2,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...v2}:v2,u=e.skipHtml,f=e.unwrapDisallowed,p=e.urlTransform||Aue,g=Oue().use(gce).use(l).use(uue,c).use(a),v=new fI;typeof r=="string"&&(v.value=r);for(const _ of Mue)Object.hasOwn(e,_.from)&&(""+_.from+(_.to?"use `"+_.to+"` instead":"remove it")+$ue+_.id,void 0);const b=g.parse(v);let x=g.runSync(b,v);return o&&(x={type:"element",tagName:"div",properties:{className:o},children:x.type==="root"?x.children:[x]}),uI(x,w),Yse(x,{Fragment:O.Fragment,components:i,ignoreInvalidStyle:!0,jsx:O.jsx,jsxs:O.jsxs,passKeys:!0,passNode:!0});function w(_,S,R){if(_.type==="raw"&&R&&typeof S=="number")return u?R.children.splice(S,1):R.children[S]={type:"text",value:_.value},S;if(_.type==="element"){let C;for(C in O0)if(Object.hasOwn(O0,C)&&Object.hasOwn(_.properties,C)){const P=_.properties[C],A=O0[C];(A===null||A.includes(_.tagName))&&(_.properties[C]=p(String(P||""),C,_))}}if(_.type==="element"){let C=t?!t.includes(_.tagName):s?s.includes(_.tagName):!1;if(!C&&n&&typeof S=="number"&&(C=!n(_,S,R)),C&&R&&typeof S=="number")return f&&_.children?R.children.splice(S,1,..._.children):R.children.splice(S,1),S}}}function Aue(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t<0||o>-1&&t>o||n>-1&&t>n||r>-1&&t>r||kue.test(e.slice(0,t))?e:""}function Iue(){const e=m.useRef(null),[t,n]=m.useState(""),[r,o]=m.useState(!1),i=Ie(T=>T.dashboard.aiScopeTables);fm();const s=Ie(T=>T.selectedSheetId),{addFrame:a,setSelectedFrameId:l,setIsDashboardEditing:c}=Ci(),{authToken:u}=fa(),f=bT(),{messages:p,input:g,handleInputChange:v,handleSubmit:b,addToolResult:x,stop:w,isLoading:_}=Nie({api:"https://semaphor.cloud/api/v1/chat",headers:{Authorization:`Bearer ${u==null?void 0:u.accessToken}`},maxToolRoundtrips:5,async onToolCall({toolCall:T}){if(R(T.toolName),T.toolName==="getLocation"){const I=["New York","Los Angeles","Chicago","San Francisco"];return I[Math.floor(Math.random()*I.length)]}if(T.toolName==="getTables")return JSON.stringify(i||[]);if(T.toolName==="getData"){console.log(T.args);const I=T.args;if(!(I!=null&&I.sql)||!(I!=null&&I.connectionId))return"Please provide sql, connectionId and table";const F=await f.fetchQuery({queryKey:["chat",I.connectionId,I.sql],queryFn:()=>gf("https://semaphor.cloud/api/v1/query",(u==null?void 0:u.accessToken)||(u==null?void 0:u.accessToken)||"",{connection_id:I.connectionId,sql:I.sql})});return n("Summarizing"),JSON.stringify(F)}},onFinish(T,I){console.log("onFinish",T,I),T.content&&n("")}}),S=()=>{var T;(T=e.current)==null||T.scrollIntoView({behavior:"smooth"})};m.useEffect(()=>{S()},[p]);function R(T){T==="getTables"&&n("Initializing"),T==="getSchemas"&&n("Analyzing"),T==="getData"&&n("Fetching")}function C(T){const I=T.toolInvocations||[];return I.length===0||I.find(j=>j.toolName==="getData"&&"result"in j)?!0:r}function P(T){return T==null?void 0:T.map(I=>{var j;const F=I.role==="user";return C(I)?O.jsxs("div",{className:Pe("relative rounded-md bg-background px-4 py-4 text-sm text-foreground/80",{"bg-muted":F}),children:[O.jsx("div",{className:"space-y-2",children:O.jsxs("div",{className:"flex shrink-0 items-start gap-3",children:[O.jsx("div",{className:"text-muted-foreground",children:F?O.jsx(ZY,{className:"size-5 shrink-0"}):O.jsx(qy,{className:"size-5 shrink-0"})}),O.jsx("div",{children:O.jsx(hI,{components:Nue,children:I.content})})]})}),(j=I.toolInvocations)==null?void 0:j.map(X=>{const G=X.toolCallId;return"result"in X?O.jsx("div",{children:A(X)},G):O.jsxs("div",{children:["Calling ",X.toolName,"..."]},G)})]},I.id):null})}function A(T){if("result"in T){let I;try{const F=JSON.parse(T.result);if(I=O.jsx("pre",{className:"whitespace-normal text-xs",children:JSON.stringify(F,null,2)}),T.toolName==="getData"){console.log(T);const j=a1({cardType:T.args.chartType,data:F.records});return O.jsxs("div",{className:"space-y-2",children:[r&&O.jsxs("div",{children:[O.jsx("span",{className:"font-semibold text-blue-700",children:"Tool call"})," ",`${T.toolName}: `,I]}),O.jsxs("div",{className:"flex h-[350px] w-[99%] grow flex-col py-2",children:[O.jsx(yr,{onClick:()=>{const X=T.args.chartTitle,G=T.args.connectionId;M({sql:T.args.sql,data:F.records,cardType:T.args.chartType,cardCfg:j,cardTitle:X,connectionId:G})},variant:"secondary",size:"sm",className:"absolute right-3 top-3",children:"Add"}),j&&O.jsx(Hw,{cfg:j})]})]})}}catch{I=O.jsx("span",{children:T.result})}return O.jsxs("div",{children:[O.jsx("span",{className:"font-semibold text-blue-700",children:"Tool call"})," ",`${T.toolName}: `,I]})}return`Calling ${T.toolName}...`}function M({sql:T,data:I,cardCfg:F,cardTitle:j,connectionId:X,cardType:G}){if(!s)return;const B={id:dl(),title:j||"Title",description:"Description",preferences:{onClickFilter:[{columnIndex:0,expression:""}],chartOptions:{indexAxis:G==="horizontalBar"?"y":"x"}},type:F.type,cfg:F,sql:T,data:I,connectionId:X},J={id:dl(),cards:[B],activeCardId:B.id};c(!0),a(s,J,"start"),l(J.id)}return O.jsxs("div",{className:"flex h-full grow flex-col justify-between break-words rounded-md bg-muted/30 px-6 py-8",children:[O.jsxs("div",{className:"flex items-center gap-3",children:[O.jsx(Un,{className:"flex items-center gap-2 text-xl",children:"Assistant"}),O.jsxs(d1,{openDelay:700,children:[O.jsx(f1,{children:O.jsx(QY,{className:"size-4 text-muted-foreground"})}),O.jsx(xm,{className:"w-70",children:O.jsxs("div",{className:"flex justify-between space-x-2 text-muted-foreground",children:[O.jsx(qy,{className:"size-5"}),O.jsxs("div",{className:"space-y-1",children:[O.jsx("p",{className:"text-sm",children:i&&(i==null?void 0:i.length)>0?"I can analyze following datasets":"No datasets in scope"}),O.jsx("div",{className:"space-y-2 pt-2",children:i==null?void 0:i.map((T,I)=>O.jsxs("div",{className:"flex gap-2 text-xs",children:[O.jsx(z$,{className:"size-4 opacity-70"}),O.jsx("span",{children:T.tableName})]},I))})]})]})})]}),!1]}),O.jsx(km,{className:"my-4"}),O.jsx("div",{className:"",children:O.jsxs("form",{className:"mb-1 flex w-full grow items-center justify-between gap-2 rounded-md",onSubmit:b,children:[O.jsxs("div",{className:"flex w-full items-center justify-between rounded-md border bg-background",children:[O.jsx(dc,{className:"w-full border-none focus-visible:ring-0 focus-visible:ring-offset-0",value:g,disabled:_,placeholder:"What can I help you with?",onChange:v}),O.jsx("button",{className:"mr-3",children:O.jsx(M$,{className:"size-4 text-muted-foreground/70 hover:text-muted-foreground"})})]}),_&&O.jsx(yr,{size:"sm",className:"rounded-full",onClick:()=>w(),children:O.jsx(DY,{className:"size-2.5 bg-background"})})]})}),O.jsxs(X1,{className:"flex flex-1 basis-0 flex-col flex-wrap justify-end",children:[O.jsxs("div",{className:"flex items-center text-xs text-foreground/90",children:[_&&t!==""&&O.jsx(vY,{className:"size-10 animate-pulse"}),t]}),O.jsx("div",{className:"flex flex-col-reverse gap-2 py-2",children:P(p)}),O.jsx(jm,{orientation:"vertical"})]})]})}const Nue={li:({node:e,...t})=>O.jsx("li",{className:"my-2 ml-5 list-disc rounded-md bg-muted/50 px-2 py-1",...t}),pre:({node:e,...t})=>O.jsx("pre",{className:"word my-2 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/50 p-2 text-xs text-foreground/80",...t})},{createElement:Wc,createContext:Lue,createRef:ime,forwardRef:pI,useCallback:Yr,useContext:gI,useEffect:il,useImperativeHandle:mI,useLayoutEffect:Fue,useMemo:zue,useRef:Do,useState:Ag}=ge,b2=ge.useId,Um=Lue(null);Um.displayName="PanelGroupContext";const Kd=Fue,jue=typeof b2=="function"?b2:()=>null;let Bue=0;function d_(e=null){const t=jue(),n=Do(e||t||null);return n.current===null&&(n.current=""+Bue++),e??n.current}function vI({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:o,forwardedRef:i,id:s,maxSize:a,minSize:l,onCollapse:c,onExpand:u,onResize:f,order:p,style:g,tagName:v="div",...b}){const x=gI(Um);if(x===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:w,expandPanel:_,getPanelSize:S,getPanelStyle:R,groupId:C,isPanelCollapsed:P,registerPanel:A,resizePanel:M,unregisterPanel:T}=x,I=d_(s),F=Do({callbacks:{onCollapse:c,onExpand:u,onResize:f},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:a,minSize:l},id:I,idIsFromProps:s!==void 0,order:p});Do({didLogMissingDefaultSizeWarning:!1}),Kd(()=>{const{callbacks:X,constraints:G}=F.current;F.current.id=I,F.current.idIsFromProps=s!==void 0,F.current.order=p,X.onCollapse=c,X.onExpand=u,X.onResize=f,G.collapsedSize=n,G.collapsible=r,G.defaultSize=o,G.maxSize=a,G.minSize=l}),Kd(()=>{const X=F.current;return A(X),()=>{T(X)}},[p,I,A,T]),mI(i,()=>({collapse:()=>{w(F.current)},expand:()=>{_(F.current)},getId(){return I},getSize(){return S(F.current)},isCollapsed(){return P(F.current)},isExpanded(){return!P(F.current)},resize:X=>{M(F.current,X)}}),[w,_,S,P,I,M]);const j=R(F.current,o);return Wc(v,{...b,children:e,className:t,style:{...j,...g},"data-panel":"","data-panel-id":I,"data-panel-group-id":C,"data-panel-collapsible":void 0,"data-panel-size":void 0})}const bI=pI((e,t)=>Wc(vI,{...e,forwardedRef:t}));vI.displayName="Panel";bI.displayName="forwardRef(Panel)";function bt(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}const yI=10;function Xd(e,t,n=yI){e=parseFloat(e.toFixed(n)),t=parseFloat(t.toFixed(n));const r=e-t;return r===0?0:r>0?1:-1}function Jr(e,t,n){return Xd(e,t,n)===0}function sc({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];bt(r!=null);let{collapsedSize:o=0,collapsible:i,maxSize:s=100,minSize:a=0}=r;if(Xd(n,a)<0)if(i){const l=(o+a)/2;Xd(n,l)<0?n=o:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(yI)),n}function Xu({delta:e,layout:t,panelConstraints:n,pivotIndices:r,trigger:o}){if(Jr(e,0))return t;const i=[...t],[s,a]=r;bt(s!=null),bt(a!=null);let l=0;if(o==="keyboard"){{const u=e<0?a:s,f=n[u];if(bt(f),f.collapsible){const p=t[u];bt(p!=null);const g=n[u];bt(g);const{collapsedSize:v=0,minSize:b=0}=g;if(Jr(p,v)){const x=b-p;Xd(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const u=e<0?s:a,f=n[u];bt(f);const{collapsible:p}=f;if(p){const g=t[u];bt(g!=null);const v=n[u];bt(v);const{collapsedSize:b=0,minSize:x=0}=v;if(Jr(g,x)){const w=g-b;Xd(w,Math.abs(e))>0&&(e=e<0?0-w:w)}}}}{const u=e<0?1:-1;let f=e<0?a:s,p=0;for(;;){const v=t[f];bt(v!=null);const x=sc({panelConstraints:n,panelIndex:f,size:100})-v;if(p+=x,f+=u,f<0||f>=n.length)break}const g=Math.min(Math.abs(e),Math.abs(p));e=e<0?0-g:g}{let f=e<0?s:a;for(;f>=0&&f<n.length;){const p=Math.abs(e)-Math.abs(l),g=t[f];bt(g!=null);const v=g-p,b=sc({panelConstraints:n,panelIndex:f,size:v});if(!Jr(g,b)&&(l+=g-b,i[f]=b,l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(Jr(l,0))return t;{const u=e<0?a:s,f=t[u];bt(f!=null);const p=f+l,g=sc({panelConstraints:n,panelIndex:u,size:p});if(i[u]=g,!Jr(g,p)){let v=p-g,x=e<0?a:s;for(;x>=0&&x<n.length;){const w=i[x];bt(w!=null);const _=w+v,S=sc({panelConstraints:n,panelIndex:x,size:_});if(Jr(w,S)||(v-=S-w,i[x]=S),Jr(v,0))break;e>0?x--:x++}}}const c=i.reduce((u,f)=>f+u,0);return Jr(c,100)?i:t}function Vue({layout:e,panelsArray:t,pivotIndices:n}){let r=0,o=100,i=0,s=0;const a=n[0];bt(a!=null),t.forEach((f,p)=>{const{constraints:g}=f,{maxSize:v=100,minSize:b=0}=g;p===a?(r=b,o=v):(i+=b,s+=v)});const l=Math.min(o,100-i),c=Math.max(r,100-s),u=e[a];return{valueMax:l,valueMin:c,valueNow:u}}function Qd(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function xI(e,t){const r=Qd(e).findIndex(o=>o.getAttribute("data-panel-resize-handle-id")===t);return r??null}function wI(e,t){const n=xI(e,t);return n!=null?[n,n+1]:[-1,-1]}function _I(e){const t=document.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return t||null}function qm(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function Hue(e,t,n){var r,o,i,s;const a=qm(t),l=Qd(e),c=a?l.indexOf(a):-1,u=(r=(o=n[c])===null||o===void 0?void 0:o.id)!==null&&r!==void 0?r:null,f=(i=(s=n[c+1])===null||s===void 0?void 0:s.id)!==null&&i!==void 0?i:null;return[u,f]}function Wue({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,setLayout:i}){Do({didWarnAboutMissingResizeHandle:!1}),Kd(()=>{const s=Qd(n);for(let a=0;a<o.length-1;a++){const{valueMax:l,valueMin:c,valueNow:u}=Vue({layout:r,panelsArray:o,pivotIndices:[a,a+1]}),f=s[a];if(f!=null){const p=o[a];bt(p),f.setAttribute("aria-controls",p.id),f.setAttribute("aria-valuemax",""+Math.round(l)),f.setAttribute("aria-valuemin",""+Math.round(c)),f.setAttribute("aria-valuenow",u!=null?""+Math.round(u):"")}}return()=>{s.forEach((a,l)=>{a.removeAttribute("aria-controls"),a.removeAttribute("aria-valuemax"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuenow")})}},[n,r,o]),il(()=>{const s=t.current;bt(s);const{panelDataArray:a}=s,l=_I(n);bt(l!=null,`No group found for id "${n}"`);const c=Qd(n);bt(c);const u=c.map(f=>{const p=f.getAttribute("data-panel-resize-handle-id");bt(p);const[g,v]=Hue(n,p,a);if(g==null||v==null)return()=>{};const b=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const w=a.findIndex(_=>_.id===g);if(w>=0){const _=a[w];bt(_);const S=r[w],{collapsedSize:R=0,collapsible:C,minSize:P=0}=_.constraints;if(S!=null&&C){const A=Xu({delta:Jr(S,R)?P-R:R-S,layout:r,panelConstraints:a.map(M=>M.constraints),pivotIndices:wI(n,p),trigger:"keyboard"});r!==A&&i(A)}}break}}};return f.addEventListener("keydown",b),()=>{f.removeEventListener("keydown",b)}});return()=>{u.forEach(f=>f())}},[e,t,n,r,o,i])}function y2(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function SI(e){return e.type==="keydown"}function CI(e){return e.type.startsWith("mouse")}function EI(e){return e.type.startsWith("touch")}function RI(e,t){const n=e==="horizontal";if(CI(t))return n?t.clientX:t.clientY;if(EI(t)){const r=t.touches[0];return bt(r),n?r.screenX:r.screenY}else throw Error(`Unsupported event type "${t.type}"`)}function Uue(e,t,n,r){const o=n==="horizontal",i=qm(t);bt(i);const s=i.getAttribute("data-panel-group-id");bt(s);let{initialCursorPosition:a}=r;const l=RI(n,e),c=_I(s);bt(c);const u=c.getBoundingClientRect(),f=o?u.width:u.height;return(l-a)/f*100}function que(e,t,n,r,o){if(SI(e)){const i=n==="horizontal";let s=0;e.shiftKey?s=100:o!=null?s=o:s=10;let a=0;switch(e.key){case"ArrowDown":a=i?0:s;break;case"ArrowLeft":a=i?-s:0;break;case"ArrowRight":a=i?s:0;break;case"ArrowUp":a=i?0:-s;break;case"End":a=100;break;case"Home":a=-100;break}return a}else return r==null?0:Uue(e,t,n,r)}function Gue({panelDataArray:e}){const t=Array(e.length),n=e.map(i=>i.constraints);let r=0,o=100;for(let i=0;i<e.length;i++){const s=n[i];bt(s);const{defaultSize:a}=s;a!=null&&(r++,t[i]=a,o-=a)}for(let i=0;i<e.length;i++){const s=n[i];bt(s);const{defaultSize:a}=s;if(a!=null)continue;const l=e.length-r,c=o/l;r++,t[i]=c,o-=c}return t}function Zl(e,t,n){t.forEach((r,o)=>{const i=e[o];bt(i);const{callbacks:s,constraints:a,id:l}=i,{collapsedSize:c=0,collapsible:u}=a,f=n[l];if(f==null||r!==f){n[l]=r;const{onCollapse:p,onExpand:g,onResize:v}=s;v&&v(r,f),u&&(p||g)&&(g&&(f==null||f===c)&&r!==c&&g(),p&&(f==null||f!==c)&&r===c&&p())}})}function Ep(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function Yue({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:o,precision:i=3}){const s=n[o];let a;return s==null?a=e??"1":r.length===1?a="1":a=s.toPrecision(i),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}let $x=null,Ua=null;function OI(e){switch(e){case"horizontal":return"ew-resize";case"horizontal-max":return"w-resize";case"horizontal-min":return"e-resize";case"vertical":return"ns-resize";case"vertical-max":return"n-resize";case"vertical-min":return"s-resize"}}function Kue(){Ua!==null&&(document.head.removeChild(Ua),$x=null,Ua=null)}function L0(e){if($x===e)return;$x=e;const t=OI(e);Ua===null&&(Ua=document.createElement("style"),document.head.appendChild(Ua)),Ua.innerHTML=`*{cursor: ${t}!important;}`}function Xue(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function x2(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function PI(e){return`react-resizable-panels:${e}`}function TI(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:o,order:i}=t;return o?r:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function DI(e,t){try{const n=PI(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function Que(e,t,n){var r,o;const i=(r=DI(e,n))!==null&&r!==void 0?r:{},s=TI(t);return(o=i[s])!==null&&o!==void 0?o:null}function Jue(e,t,n,r,o){var i;const s=PI(e),a=TI(t),l=(i=DI(e,o))!==null&&i!==void 0?i:{};l[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{o.setItem(s,JSON.stringify(l))}catch(c){console.error(c)}}function w2({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((i,s)=>i+s,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!Jr(r,100))for(let i=0;i<t.length;i++){const s=n[i];bt(s!=null);const a=100/r*s;n[i]=a}let o=0;for(let i=0;i<t.length;i++){const s=n[i];bt(s!=null);const a=sc({panelConstraints:t,panelIndex:i,size:s});s!=a&&(o+=s-a,n[i]=a)}if(!Jr(o,0))for(let i=0;i<t.length;i++){const s=n[i];bt(s!=null);const a=s+o,l=sc({panelConstraints:t,panelIndex:i,size:a});if(s!==l&&(o-=l-s,n[i]=l,Jr(o,0)))break}return n}const Zue=100,Qu={getItem:e=>(x2(Qu),Qu.getItem(e)),setItem:(e,t)=>{x2(Qu),Qu.setItem(e,t)}},_2={};function $I({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:i=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=Qu,style:c,tagName:u="div",...f}){const p=d_(i),[g,v]=Ag(null),[b,x]=Ag([]),w=Do({}),_=Do(new Map),S=Do(0),R=Do({autoSaveId:e,direction:r,dragState:g,id:p,keyboardResizeBy:a,onLayout:s,storage:l}),C=Do({layout:b,panelDataArray:[],panelDataArrayChanged:!1});Do({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),mI(o,()=>({getId:()=>R.current.id,getLayout:()=>{const{layout:$}=C.current;return $},setLayout:$=>{const{onLayout:V}=R.current,{layout:Q,panelDataArray:N}=C.current,le=w2({layout:$,panelConstraints:N.map(se=>se.constraints)});y2(Q,le)||(x(le),C.current.layout=le,V&&V(le),Zl(N,le,w.current))}}),[]),Kd(()=>{R.current.autoSaveId=e,R.current.direction=r,R.current.dragState=g,R.current.id=p,R.current.onLayout=s,R.current.storage=l}),Wue({committedValuesRef:R,eagerValuesRef:C,groupId:p,layout:b,panelDataArray:C.current.panelDataArray,setLayout:x}),il(()=>{const{panelDataArray:$}=C.current;if(e){if(b.length===0||b.length!==$.length)return;let V=_2[e];V==null&&(V=Xue(Jue,Zue),_2[e]=V);const Q=[...$],N=new Map(_.current);V(e,Q,N,b,l)}},[e,b,l]),il(()=>{});const P=Yr($=>{const{onLayout:V}=R.current,{layout:Q,panelDataArray:N}=C.current;if($.constraints.collapsible){const le=N.map(ie=>ie.constraints),{collapsedSize:se=0,panelSize:ue,pivotIndices:he}=ec(N,$,Q);if(bt(ue!=null),ue!==se){_.current.set($.id,ue);const ee=rc(N,$)===N.length-1?ue-se:se-ue,ae=Xu({delta:ee,layout:Q,panelConstraints:le,pivotIndices:he,trigger:"imperative-api"});Ep(Q,ae)||(x(ae),C.current.layout=ae,V&&V(ae),Zl(N,ae,w.current))}}},[]),A=Yr($=>{const{onLayout:V}=R.current,{layout:Q,panelDataArray:N}=C.current;if($.constraints.collapsible){const le=N.map(ee=>ee.constraints),{collapsedSize:se=0,panelSize:ue,minSize:he=0,pivotIndices:ie}=ec(N,$,Q);if(ue===se){const ee=_.current.get($.id),ae=ee!=null&&ee>=he?ee:he,q=rc(N,$)===N.length-1?ue-ae:ae-ue,be=Xu({delta:q,layout:Q,panelConstraints:le,pivotIndices:ie,trigger:"imperative-api"});Ep(Q,be)||(x(be),C.current.layout=be,V&&V(be),Zl(N,be,w.current))}}},[]),M=Yr($=>{const{layout:V,panelDataArray:Q}=C.current,{panelSize:N}=ec(Q,$,V);return bt(N!=null),N},[]),T=Yr(($,V)=>{const{panelDataArray:Q}=C.current,N=rc(Q,$);return Yue({defaultSize:V,dragState:g,layout:b,panelData:Q,panelIndex:N})},[g,b]),I=Yr($=>{const{layout:V,panelDataArray:Q}=C.current,{collapsedSize:N=0,collapsible:le,panelSize:se}=ec(Q,$,V);return le===!0&&se===N},[]),F=Yr($=>{const{layout:V,panelDataArray:Q}=C.current,{collapsedSize:N=0,collapsible:le,panelSize:se}=ec(Q,$,V);return bt(se!=null),!le||se>N},[]),j=Yr($=>{const{panelDataArray:V}=C.current;V.push($),V.sort((Q,N)=>{const le=Q.order,se=N.order;return le==null&&se==null?0:le==null?-1:se==null?1:le-se}),C.current.panelDataArrayChanged=!0},[]);Kd(()=>{if(C.current.panelDataArrayChanged){C.current.panelDataArrayChanged=!1;const{autoSaveId:$,onLayout:V,storage:Q}=R.current,{layout:N,panelDataArray:le}=C.current;let se=null;if($){const he=Que($,le,Q);he&&(_.current=new Map(Object.entries(he.expandToSizes)),se=he.layout)}se==null&&(se=Gue({panelDataArray:le}));const ue=w2({layout:se,panelConstraints:le.map(he=>he.constraints)});y2(N,ue)||(x(ue),C.current.layout=ue,V&&V(ue),Zl(le,ue,w.current))}});const X=Yr($=>function(Q){Q.preventDefault();const{direction:N,dragState:le,id:se,keyboardResizeBy:ue,onLayout:he}=R.current,{layout:ie,panelDataArray:ee}=C.current,{initialLayout:ae}=le??{},ye=wI(se,$);let q=que(Q,$,N,le,ue);if(q===0)return;const be=N==="horizontal";document.dir==="rtl"&&be&&(q=-q);const _e=ee.map(Ue=>Ue.constraints),Oe=Xu({delta:q,layout:ae??ie,panelConstraints:_e,pivotIndices:ye,trigger:SI(Q)?"keyboard":"mouse-or-touch"}),Te=!Ep(ie,Oe);(CI(Q)||EI(Q))&&S.current!=q&&(S.current=q,L0(Te?be?"horizontal":"vertical":be?q<0?"horizontal-min":"horizontal-max":q<0?"vertical-min":"vertical-max")),Te&&(x(Oe),C.current.layout=Oe,he&&he(Oe),Zl(ee,Oe,w.current))},[]),G=Yr(($,V)=>{const{onLayout:Q}=R.current,{layout:N,panelDataArray:le}=C.current,se=le.map(ye=>ye.constraints),{panelSize:ue,pivotIndices:he}=ec(le,$,N);bt(ue!=null);const ee=rc(le,$)===le.length-1?ue-V:V-ue,ae=Xu({delta:ee,layout:N,panelConstraints:se,pivotIndices:he,trigger:"imperative-api"});Ep(N,ae)||(x(ae),C.current.layout=ae,Q&&Q(ae),Zl(le,ae,w.current))},[]),B=Yr(($,V)=>{const{direction:Q}=R.current,{layout:N}=C.current,le=qm($);bt(le);const se=RI(Q,V);v({dragHandleId:$,dragHandleRect:le.getBoundingClientRect(),initialCursorPosition:se,initialLayout:N})},[]),J=Yr(()=>{Kue(),v(null)},[]),H=Yr($=>{const{panelDataArray:V}=C.current,Q=rc(V,$);Q>=0&&(V.splice(Q,1),delete w.current[$.id],C.current.panelDataArrayChanged=!0)},[]),Y=zue(()=>({collapsePanel:P,direction:r,dragState:g,expandPanel:A,getPanelSize:M,getPanelStyle:T,groupId:p,isPanelCollapsed:I,isPanelExpanded:F,registerPanel:j,registerResizeHandle:X,resizePanel:G,startDragging:B,stopDragging:J,unregisterPanel:H}),[P,g,r,A,M,T,p,I,F,j,X,G,B,J,H]),te={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Wc(Um.Provider,{value:Y},Wc(u,{...f,children:t,className:n,style:{...te,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":p}))}const kI=pI((e,t)=>Wc($I,{...e,forwardedRef:t}));$I.displayName="PanelGroup";kI.displayName="forwardRef(PanelGroup)";function rc(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function ec(e,t,n){const r=e.map(c=>c.constraints),o=rc(e,t),i=r[o],a=o===e.length-1?[o-1,o]:[o,o+1],l=n[o];return{...i,panelSize:l,pivotIndices:a}}function ede({disabled:e,handleId:t,resizeHandler:n}){il(()=>{if(e||n==null)return;const r=qm(t);if(r==null)return;const o=i=>{if(!i.defaultPrevented)switch(i.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{i.preventDefault(),n(i);break}case"F6":{i.preventDefault();const s=r.getAttribute("data-panel-group-id");bt(s);const a=Qd(s),l=xI(s,t);bt(l!==null);const c=i.shiftKey?l>0?l-1:a.length-1:l+1<a.length?l+1:0;a[c].focus();break}}};return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[e,t,n])}function f_({children:e=null,className:t="",disabled:n=!1,id:r,onDragging:o,style:i={},tabIndex:s=0,tagName:a="div",...l}){const c=Do(null),u=Do({onDragging:o});il(()=>{u.current.onDragging=o});const f=gI(Um);if(f===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:p,dragState:g,groupId:v,registerResizeHandle:b,startDragging:x,stopDragging:w}=f,_=d_(r),S=(g==null?void 0:g.dragHandleId)===_,[R,C]=Ag(!1),[P,A]=Ag(null),M=Yr(()=>{const I=c.current;bt(I),I.blur(),w();const{onDragging:F}=u.current;F&&F(!1)},[w]);il(()=>{if(n)A(null);else{const I=b(_);A(()=>I)}},[n,_,b]),il(()=>{if(n||P==null||!S)return;const I=G=>{P(G)},F=G=>{P(G)},j=c.current;bt(j);const X=j.ownerDocument;return X.body.addEventListener("contextmenu",M),X.body.addEventListener("mousemove",I),X.body.addEventListener("touchmove",I),X.body.addEventListener("mouseleave",F),window.addEventListener("mouseup",M),window.addEventListener("touchend",M),()=>{X.body.removeEventListener("contextmenu",M),X.body.removeEventListener("mousemove",I),X.body.removeEventListener("touchmove",I),X.body.removeEventListener("mouseleave",F),window.removeEventListener("mouseup",M),window.removeEventListener("touchend",M)}},[p,n,S,P,M]),ede({disabled:n,handleId:_,resizeHandler:P});const T={cursor:OI(p),touchAction:"none",userSelect:"none"};return Wc(a,{...l,children:e,className:t,onBlur:()=>C(!1),onFocus:()=>C(!0),onMouseDown:I=>{x(_,I.nativeEvent);const F=u.current;bt(F);const{onDragging:j}=F;j&&j(!0)},onMouseUp:M,onTouchCancel:M,onTouchEnd:M,onTouchStart:I=>{x(_,I.nativeEvent);const F=u.current;bt(F);const{onDragging:j}=F;j&&j(!0)},ref:c,role:"separator",style:{...T,...i},tabIndex:s,"data-panel-group-direction":p,"data-panel-group-id":v,"data-resize-handle":"","data-resize-handle-active":S?"pointer":R?"keyboard":void 0,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":_})}f_.displayName="PanelResizeHandle";const MI=({className:e,...t})=>O.jsx(kI,{className:Pe("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),kx=bI,tde=({withHandle:e,className:t,...n})=>O.jsx(f_,{className:Pe("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...n,children:e&&O.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:O.jsx(YY,{className:"h-2.5 w-2.5"})})}),nde=({withHandle:e,className:t,onTabClick:n,open:r,...o})=>O.jsx(f_,{className:Pe("relative flex w-px items-start justify-end bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",{"justify-start":r},t),...o,children:e&&O.jsx("div",{className:Pe("z-50 flex items-center justify-start",{"border-l":r}),children:O.jsx(yr,{variant:"secondary",className:Pe("h-7 p-1",{"rounded-bl-none rounded-br-md rounded-tl-none rounded-tr-md":r,"mt-2 rounded-bl-md rounded-br-none rounded-tl-md rounded-tr-none":!r}),onClick:()=>n(!r),children:r?O.jsx(qw,{className:"size-4"}):O.jsx(N$,{className:"size-4"})})})});function AI(){const e=Ie(c=>{var u;return(u=c.dashboard)==null?void 0:u.sheets}),{showAssistant:t}=fa(),n=m.useRef(null),[r,o]=m.useState(!1);Ie(c=>c.isDashboardEditing);const i=Ie(c=>c.themeStyle);Ie(c=>c.isVisualEditing);const s=Ie(c=>c.selectedSheetId),a=Ie(c=>c.actions.setSelectedSheetId);if(!e)return null;function l(c){var u,f;c?((u=n.current)==null||u.resize(35),o(!0)):(o(!1),(f=n.current)==null||f.resize(0))}return O.jsx(IT,{role:"dashboard-tabs-container",className:Pe("relative flex grow",i==null?void 0:i.dashboardTabsContainer),onValueChange:c=>{a(c)},value:s||e[0].id,children:O.jsxs(MI,{direction:"horizontal",children:[O.jsx(kx,{children:O.jsx("div",{style:{},className:"bg-muted",children:e==null?void 0:e.map(c=>O.jsx(tw,{className:"mt-0",value:c.id,children:O.jsx(Boe,{})},c.id))})}),t===!0&&O.jsxs(O.Fragment,{children:[O.jsx(nde,{open:r,onTabClick:l,withHandle:!0}),O.jsx(kx,{onResize:c=>{c<1?o(!1):r||o(!0)},defaultSize:0,ref:n,children:O.jsx(Iue,{})})]})]})})}function II({children:e}){return O.jsx(mz,{defaultTheme:"system",storageKey:"vite-ui-theme",children:O.jsx(xX,{delayDuration:0,children:e})})}function NI(e){return O.jsx(dk,{dashboardProps:e,children:O.jsx(II,{children:O.jsx(ST,{...e,children:O.jsx(AI,{})})})})}const Mx=["Enter"," "],rde=["ArrowDown","PageUp","Home"],LI=["ArrowUp","PageDown","End"],ode=[...rde,...LI],ide={ltr:[...Mx,"ArrowRight"],rtl:[...Mx,"ArrowLeft"]},sde={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Gm="Menu",[Jd,ade,lde]=Yg(Gm),[El,FI]=Gn(Gm,[lde,Pi,Gc]),h_=Pi(),zI=Gc(),[cde,Rl]=El(Gm),[ude,Bf]=El(Gm),dde=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=h_(t),[l,c]=m.useState(null),u=m.useRef(!1),f=Fn(i),p=ml(o);return m.useEffect(()=>{const g=()=>{u.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>u.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),m.createElement(Pf,a,m.createElement(cde,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:c},m.createElement(ude,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:u,dir:p,modal:s},r)))},jI=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=h_(n);return m.createElement(Tf,fe({},o,r,{ref:t}))}),BI="MenuPortal",[fde,VI]=El(BI,{forceMount:void 0}),hde=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Rl(BI,t);return m.createElement(fde,{scope:t,forceMount:n},m.createElement(Mn,{present:n||i.open},m.createElement(vm,{asChild:!0,container:o},r)))},Yo="MenuContent",[pde,p_]=El(Yo),gde=m.forwardRef((e,t)=>{const n=VI(Yo,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Rl(Yo,e.__scopeMenu),s=Bf(Yo,e.__scopeMenu);return m.createElement(Jd.Provider,{scope:e.__scopeMenu},m.createElement(Mn,{present:r||i.open},m.createElement(Jd.Slot,{scope:e.__scopeMenu},s.modal?m.createElement(mde,fe({},o,{ref:t})):m.createElement(vde,fe({},o,{ref:t})))))}),mde=m.forwardRef((e,t)=>{const n=Rl(Yo,e.__scopeMenu),r=m.useRef(null),o=ft(t,r);return m.useEffect(()=>{const i=r.current;if(i)return Cm(i)},[]),m.createElement(g_,fe({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:De(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),vde=m.forwardRef((e,t)=>{const n=Rl(Yo,e.__scopeMenu);return m.createElement(g_,fe({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),g_=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:g,disableOutsideScroll:v,...b}=e,x=Rl(Yo,n),w=Bf(Yo,n),_=h_(n),S=zI(n),R=ade(n),[C,P]=m.useState(null),A=m.useRef(null),M=ft(t,A,x.onContentChange),T=m.useRef(0),I=m.useRef(""),F=m.useRef(0),j=m.useRef(null),X=m.useRef("right"),G=m.useRef(0),B=v?Rm:m.Fragment,J=v?{as:ss,allowPinchZoom:!0}:void 0,H=te=>{var $,V;const Q=I.current+te,N=R().filter(ee=>!ee.disabled),le=document.activeElement,se=($=N.find(ee=>ee.ref.current===le))===null||$===void 0?void 0:$.textValue,ue=N.map(ee=>ee.textValue),he=Nde(ue,Q,se),ie=(V=N.find(ee=>ee.textValue===he))===null||V===void 0?void 0:V.ref.current;(function ee(ae){I.current=ae,window.clearTimeout(T.current),ae!==""&&(T.current=window.setTimeout(()=>ee(""),1e3))})(Q),ie&&setTimeout(()=>ie.focus())};m.useEffect(()=>()=>window.clearTimeout(T.current),[]),wm();const Y=m.useCallback(te=>{var $,V;return X.current===(($=j.current)===null||$===void 0?void 0:$.side)&&Fde(te,(V=j.current)===null||V===void 0?void 0:V.area)},[]);return m.createElement(pde,{scope:n,searchRef:I,onItemEnter:m.useCallback(te=>{Y(te)&&te.preventDefault()},[Y]),onItemLeave:m.useCallback(te=>{var $;Y(te)||(($=A.current)===null||$===void 0||$.focus(),P(null))},[Y]),onTriggerLeave:m.useCallback(te=>{Y(te)&&te.preventDefault()},[Y]),pointerGraceTimerRef:F,onPointerGraceIntentChange:m.useCallback(te=>{j.current=te},[])},m.createElement(B,J,m.createElement(_m,{asChild:!0,trapped:o,onMountAutoFocus:De(i,te=>{var $;te.preventDefault(),($=A.current)===null||$===void 0||$.focus()}),onUnmountAutoFocus:s},m.createElement(Yc,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:g},m.createElement(Jx,fe({asChild:!0},S,{dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:P,onEntryFocus:De(l,te=>{w.isUsingKeyboardRef.current||te.preventDefault()})}),m.createElement(Df,fe({role:"menu","aria-orientation":"vertical","data-state":GI(x.open),"data-radix-menu-content":"",dir:w.dir},_,b,{ref:M,style:{outline:"none",...b.style},onKeyDown:De(b.onKeyDown,te=>{const V=te.target.closest("[data-radix-menu-content]")===te.currentTarget,Q=te.ctrlKey||te.altKey||te.metaKey,N=te.key.length===1;V&&(te.key==="Tab"&&te.preventDefault(),!Q&&N&&H(te.key));const le=A.current;if(te.target!==le||!ode.includes(te.key))return;te.preventDefault();const ue=R().filter(he=>!he.disabled).map(he=>he.ref.current);LI.includes(te.key)&&ue.reverse(),Ade(ue)}),onBlur:De(e.onBlur,te=>{te.currentTarget.contains(te.target)||(window.clearTimeout(T.current),I.current="")}),onPointerMove:De(e.onPointerMove,Zd(te=>{const $=te.target,V=G.current!==te.clientX;if(te.currentTarget.contains($)&&V){const Q=te.clientX>G.current?"right":"left";X.current=Q,G.current=te.clientX}}))})))))))}),bde=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,fe({role:"group"},r,{ref:t}))}),yde=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,fe({},r,{ref:t}))}),Ax="MenuItem",S2="menu.itemSelect",m_=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=m.useRef(null),s=Bf(Ax,e.__scopeMenu),a=p_(Ax,e.__scopeMenu),l=ft(t,i),c=m.useRef(!1),u=()=>{const f=i.current;if(!n&&f){const p=new CustomEvent(S2,{bubbles:!0,cancelable:!0});f.addEventListener(S2,g=>r==null?void 0:r(g),{once:!0}),ET(f,p),p.defaultPrevented?c.current=!1:s.onClose()}};return m.createElement(HI,fe({},o,{ref:l,disabled:n,onClick:De(e.onClick,u),onPointerDown:f=>{var p;(p=e.onPointerDown)===null||p===void 0||p.call(e,f),c.current=!0},onPointerUp:De(e.onPointerUp,f=>{var p;c.current||(p=f.currentTarget)===null||p===void 0||p.click()}),onKeyDown:De(e.onKeyDown,f=>{const p=a.searchRef.current!=="";n||p&&f.key===" "||Mx.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),HI=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=p_(Ax,n),a=zI(n),l=m.useRef(null),c=ft(t,l),[u,f]=m.useState(!1),[p,g]=m.useState("");return m.useEffect(()=>{const v=l.current;if(v){var b;g(((b=v.textContent)!==null&&b!==void 0?b:"").trim())}},[i.children]),m.createElement(Jd.ItemSlot,{scope:n,disabled:r,textValue:o??p},m.createElement(Zx,fe({asChild:!0},a,{focusable:!r}),m.createElement(Qe.div,fe({role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},i,{ref:c,onPointerMove:De(e.onPointerMove,Zd(v=>{r?s.onItemLeave(v):(s.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus())})),onPointerLeave:De(e.onPointerLeave,Zd(v=>s.onItemLeave(v))),onFocus:De(e.onFocus,()=>f(!0)),onBlur:De(e.onBlur,()=>f(!1))}))))}),xde=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return m.createElement(UI,{scope:e.__scopeMenu,checked:n},m.createElement(m_,fe({role:"menuitemcheckbox","aria-checked":Ig(n)?"mixed":n},o,{ref:t,"data-state":v_(n),onSelect:De(o.onSelect,()=>r==null?void 0:r(Ig(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),wde="MenuRadioGroup",[_de,Sde]=El(wde,{value:void 0,onValueChange:()=>{}}),Cde=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=Fn(r);return m.createElement(_de,{scope:e.__scopeMenu,value:n,onValueChange:i},m.createElement(bde,fe({},o,{ref:t})))}),Ede="MenuRadioItem",Rde=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=Sde(Ede,e.__scopeMenu),i=n===o.value;return m.createElement(UI,{scope:e.__scopeMenu,checked:i},m.createElement(m_,fe({role:"menuitemradio","aria-checked":i},r,{ref:t,"data-state":v_(i),onSelect:De(r.onSelect,()=>{var s;return(s=o.onValueChange)===null||s===void 0?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})))}),WI="MenuItemIndicator",[UI,Ode]=El(WI,{checked:!1}),Pde=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=Ode(WI,n);return m.createElement(Mn,{present:r||Ig(i.checked)||i.checked===!0},m.createElement(Qe.span,fe({},o,{ref:t,"data-state":v_(i.checked)})))}),Tde=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,fe({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),Dde="MenuSub",[sme,qI]=El(Dde),Rp="MenuSubTrigger",$de=m.forwardRef((e,t)=>{const n=Rl(Rp,e.__scopeMenu),r=Bf(Rp,e.__scopeMenu),o=qI(Rp,e.__scopeMenu),i=p_(Rp,e.__scopeMenu),s=m.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},u=m.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return m.useEffect(()=>u,[u]),m.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),m.createElement(jI,fe({asChild:!0},c),m.createElement(HI,fe({id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":GI(n.open)},e,{ref:Gg(t,o.onTriggerChange),onClick:f=>{var p;(p=e.onClick)===null||p===void 0||p.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:De(e.onPointerMove,Zd(f=>{i.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:De(e.onPointerLeave,Zd(f=>{var p;u();const g=(p=n.content)===null||p===void 0?void 0:p.getBoundingClientRect();if(g){var v;const b=(v=n.content)===null||v===void 0?void 0:v.dataset.side,x=b==="right",w=x?-5:5,_=g[x?"left":"right"],S=g[x?"right":"left"];i.onPointerGraceIntentChange({area:[{x:f.clientX+w,y:f.clientY},{x:_,y:g.top},{x:S,y:g.top},{x:S,y:g.bottom},{x:_,y:g.bottom}],side:b}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(f),f.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:De(e.onKeyDown,f=>{const p=i.searchRef.current!=="";if(!(e.disabled||p&&f.key===" ")&&ide[r.dir].includes(f.key)){var g;n.onOpenChange(!0),(g=n.content)===null||g===void 0||g.focus(),f.preventDefault()}})})))}),kde="MenuSubContent",Mde=m.forwardRef((e,t)=>{const n=VI(Yo,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Rl(Yo,e.__scopeMenu),s=Bf(Yo,e.__scopeMenu),a=qI(kde,e.__scopeMenu),l=m.useRef(null),c=ft(t,l);return m.createElement(Jd.Provider,{scope:e.__scopeMenu},m.createElement(Mn,{present:r||i.open},m.createElement(Jd.Slot,{scope:e.__scopeMenu},m.createElement(g_,fe({id:a.contentId,"aria-labelledby":a.triggerId},o,{ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var f;s.isUsingKeyboardRef.current&&((f=l.current)===null||f===void 0||f.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:De(e.onFocusOutside,u=>{u.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:De(e.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:De(e.onKeyDown,u=>{const f=u.currentTarget.contains(u.target),p=sde[s.dir].includes(u.key);if(f&&p){var g;i.onOpenChange(!1),(g=a.trigger)===null||g===void 0||g.focus(),u.preventDefault()}})})))))});function GI(e){return e?"open":"closed"}function Ig(e){return e==="indeterminate"}function v_(e){return Ig(e)?"indeterminate":e?"checked":"unchecked"}function Ade(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Ide(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Nde(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=Ide(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Lde(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function Fde(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Lde(n,t)}function Zd(e){return t=>t.pointerType==="mouse"?e(t):void 0}const zde=dde,jde=jI,Bde=hde,Vde=gde,Hde=yde,Wde=m_,Ude=xde,qde=Cde,Gde=Rde,Yde=Pde,Kde=Tde,Xde=$de,Qde=Mde,YI="DropdownMenu",[Jde,ame]=Gn(YI,[FI]),ho=FI(),[Zde,KI]=Jde(YI),efe=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=ho(t),c=m.useRef(null),[u=!1,f]=ur({prop:o,defaultProp:i,onChange:s});return m.createElement(Zde,{scope:t,triggerId:Nr(),triggerRef:c,contentId:Nr(),open:u,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(p=>!p),[f]),modal:a},m.createElement(zde,fe({},l,{open:u,onOpenChange:f,dir:r,modal:a}),n))},tfe="DropdownMenuTrigger",nfe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=KI(tfe,n),s=ho(n);return m.createElement(jde,fe({asChild:!0},s),m.createElement(Qe.button,fe({type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},o,{ref:Gg(t,i.triggerRef),onPointerDown:De(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:De(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})))}),rfe=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ho(t);return m.createElement(Bde,fe({},r,n))},ofe="DropdownMenuContent",ife=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=KI(ofe,n),i=ho(n),s=m.useRef(!1);return m.createElement(Vde,fe({id:o.contentId,"aria-labelledby":o.triggerId},i,r,{ref:t,onCloseAutoFocus:De(e.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)===null||l===void 0||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:De(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(s.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)"}}))}),sfe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Hde,fe({},o,r,{ref:t}))}),afe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Wde,fe({},o,r,{ref:t}))}),lfe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Ude,fe({},o,r,{ref:t}))}),cfe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(qde,fe({},o,r,{ref:t}))}),ufe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Gde,fe({},o,r,{ref:t}))}),dfe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Yde,fe({},o,r,{ref:t}))}),ffe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Kde,fe({},o,r,{ref:t}))}),hfe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Xde,fe({},o,r,{ref:t}))}),pfe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Qde,fe({},o,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)"}}))}),gfe=efe,mfe=nfe,vfe=rfe,XI=ife,QI=sfe,JI=afe,ZI=lfe,bfe=cfe,e5=ufe,t5=dfe,n5=ffe,r5=hfe,o5=pfe,yfe=gfe,xfe=mfe,wfe=bfe,_fe=ge.forwardRef(({className:e,inset:t,children:n,...r},o)=>O.jsxs(r5,{ref:o,className:Pe("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,O.jsx(qw,{className:"ml-auto h-4 w-4"})]}));_fe.displayName=r5.displayName;const Sfe=ge.forwardRef(({className:e,...t},n)=>O.jsx(o5,{ref:n,className:Pe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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}));Sfe.displayName=o5.displayName;const i5=ge.forwardRef(({className:e,sideOffset:t=4,...n},r)=>O.jsx(vfe,{children:O.jsx(XI,{ref:r,sideOffset:t,className:Pe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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})}));i5.displayName=XI.displayName;const Cfe=ge.forwardRef(({className:e,inset:t,...n},r)=>O.jsx(JI,{ref:r,className:Pe("relative flex cursor-default select-none items-center rounded-sm 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",t&&"pl-8",e),...n}));Cfe.displayName=JI.displayName;const Efe=ge.forwardRef(({className:e,children:t,checked:n,...r},o)=>O.jsxs(ZI,{ref:o,className:Pe("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:[O.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:O.jsx(t5,{children:O.jsx(Rf,{className:"h-4 w-4"})})}),t]}));Efe.displayName=ZI.displayName;const s5=ge.forwardRef(({className:e,children:t,...n},r)=>O.jsxs(e5,{ref:r,className:Pe("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:[O.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:O.jsx(t5,{children:O.jsx(L$,{className:"h-2 w-2 fill-current"})})}),t]}));s5.displayName=e5.displayName;const a5=ge.forwardRef(({className:e,inset:t,...n},r)=>O.jsx(QI,{ref:r,className:Pe("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));a5.displayName=QI.displayName;const l5=ge.forwardRef(({className:e,...t},n)=>O.jsx(n5,{ref:n,className:Pe("-mx-1 my-1 h-px bg-muted",e),...t}));l5.displayName=n5.displayName;function Rfe(e){var t;return{...e,sheets:(t=e==null?void 0:e.sheets)==null?void 0:t.map(n=>{var r;return{...n,frames:(r=n.frames)==null?void 0:r.map(o=>{var i;return{...o,cards:(i=o.cards)==null?void 0:i.map(s=>c5(s))}})}})}}function c5(e){var t,n,r,o;return{...e,cfg:{...e.cfg,data:{...(t=e.cfg)==null?void 0:t.data,labels:[],datasets:(o=(r=(n=e.cfg)==null?void 0:n.data)==null?void 0:r.datasets)==null?void 0:o.map(i=>({...i,data:[]}))}},customCfg:Ofe(e.customCfg),data:[]}}function Ofe(e){var t,n;return e?{...e,data:{...e==null?void 0:e.data,labels:[],datasets:(n=(t=e==null?void 0:e.data)==null?void 0:t.datasets)==null?void 0:n.map(r=>({...r,data:[]}))}}:null}function u5(e){return`semaphor:bookmark:${e}`}const d5="Dialog",[f5,lme]=Gn(d5),[Pfe,Jo]=f5(d5),Tfe=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=m.useRef(null),l=m.useRef(null),[c=!1,u]=ur({prop:r,defaultProp:o,onChange:i});return m.createElement(Pfe,{scope:t,triggerRef:a,contentRef:l,contentId:Nr(),titleId:Nr(),descriptionId:Nr(),open:c,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(f=>!f),[u]),modal:s},n)},Dfe="DialogTrigger",$fe=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Jo(Dfe,n),i=ft(t,o.triggerRef);return m.createElement(Qe.button,fe({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":b_(o.open)},r,{ref:i,onClick:De(e.onClick,o.onOpenToggle)}))}),h5="DialogPortal",[kfe,p5]=f5(h5,{forceMount:void 0}),Mfe=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Jo(h5,t);return m.createElement(kfe,{scope:t,forceMount:n},m.Children.map(r,s=>m.createElement(Mn,{present:n||i.open},m.createElement(vm,{asChild:!0,container:o},s))))},Ix="DialogOverlay",Afe=m.forwardRef((e,t)=>{const n=p5(Ix,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Jo(Ix,e.__scopeDialog);return i.modal?m.createElement(Mn,{present:r||i.open},m.createElement(Ife,fe({},o,{ref:t}))):null}),Ife=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Jo(Ix,n);return m.createElement(Rm,{as:ss,allowPinchZoom:!0,shards:[o.contentRef]},m.createElement(Qe.div,fe({"data-state":b_(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),ef="DialogContent",Nfe=m.forwardRef((e,t)=>{const n=p5(ef,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Jo(ef,e.__scopeDialog);return m.createElement(Mn,{present:r||i.open},i.modal?m.createElement(Lfe,fe({},o,{ref:t})):m.createElement(Ffe,fe({},o,{ref:t})))}),Lfe=m.forwardRef((e,t)=>{const n=Jo(ef,e.__scopeDialog),r=m.useRef(null),o=ft(t,n.contentRef,r);return m.useEffect(()=>{const i=r.current;if(i)return Cm(i)},[]),m.createElement(g5,fe({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:De(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:De(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:De(e.onFocusOutside,i=>i.preventDefault())}))}),Ffe=m.forwardRef((e,t)=>{const n=Jo(ef,e.__scopeDialog),r=m.useRef(!1),o=m.useRef(!1);return m.createElement(g5,fe({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),g5=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=Jo(ef,n),l=m.useRef(null),c=ft(t,l);return wm(),m.createElement(m.Fragment,null,m.createElement(_m,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(Yc,fe({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":b_(a.open)},s,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),zfe="DialogTitle",jfe=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Jo(zfe,n);return m.createElement(Qe.h2,fe({id:o.titleId},r,{ref:t}))}),Bfe="DialogDescription",Vfe=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Jo(Bfe,n);return m.createElement(Qe.p,fe({id:o.descriptionId},r,{ref:t}))}),Hfe="DialogClose",Wfe=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Jo(Hfe,n);return m.createElement(Qe.button,fe({type:"button"},r,{ref:t,onClick:De(e.onClick,()=>o.onOpenChange(!1))}))});function b_(e){return e?"open":"closed"}const Ufe=Tfe,qfe=$fe,Gfe=Mfe,m5=Afe,v5=Nfe,b5=jfe,y5=Vfe,Yfe=Wfe,Kfe=Ufe,Xfe=qfe,Qfe=Gfe,x5=ge.forwardRef(({className:e,...t},n)=>O.jsx(m5,{ref:n,className:Pe("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));x5.displayName=m5.displayName;const w5=ge.forwardRef(({className:e,children:t,...n},r)=>O.jsxs(Qfe,{children:[O.jsx(x5,{}),O.jsxs(v5,{ref:r,className:Pe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,O.jsxs(Yfe,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[O.jsx(Kw,{className:"h-4 w-4"}),O.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));w5.displayName=v5.displayName;const _5=({className:e,...t})=>O.jsx("div",{className:Pe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});_5.displayName="DialogHeader";const S5=({className:e,...t})=>O.jsx("div",{className:Pe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});S5.displayName="DialogFooter";const C5=ge.forwardRef(({className:e,...t},n)=>O.jsx(b5,{ref:n,className:Pe("text-lg font-semibold leading-none tracking-tight",e),...t}));C5.displayName=b5.displayName;const E5=ge.forwardRef(({className:e,...t},n)=>O.jsx(y5,{ref:n,className:Pe("text-sm text-muted-foreground",e),...t}));E5.displayName=y5.displayName;const R5="Checkbox",[Jfe,cme]=Gn(R5),[Zfe,ehe]=Jfe(R5),the=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,...u}=e,[f,p]=m.useState(null),g=ft(t,S=>p(S)),v=m.useRef(!1),b=f?!!f.closest("form"):!0,[x=!1,w]=ur({prop:o,defaultProp:i,onChange:c}),_=m.useRef(x);return m.useEffect(()=>{const S=f==null?void 0:f.form;if(S){const R=()=>w(_.current);return S.addEventListener("reset",R),()=>S.removeEventListener("reset",R)}},[f,w]),m.createElement(Zfe,{scope:n,state:x,disabled:a},m.createElement(Qe.button,fe({type:"button",role:"checkbox","aria-checked":sl(x)?"mixed":x,"aria-required":s,"data-state":O5(x),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:g,onKeyDown:De(e.onKeyDown,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:De(e.onClick,S=>{w(R=>sl(R)?!0:!R),b&&(v.current=S.isPropagationStopped(),v.current||S.stopPropagation())})})),b&&m.createElement(ohe,{control:f,bubbles:!v.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),nhe="CheckboxIndicator",rhe=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=ehe(nhe,n);return m.createElement(Mn,{present:r||sl(i.state)||i.state===!0},m.createElement(Qe.span,fe({"data-state":O5(i.state),"data-disabled":i.disabled?"":void 0},o,{ref:t,style:{pointerEvents:"none",...e.style}})))}),ohe=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=Sm(n),a=mm(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const p=new Event("click",{bubbles:r});l.indeterminate=sl(n),f.call(l,sl(n)?!1:n),l.dispatchEvent(p)}},[s,n,r]),m.createElement("input",fe({type:"checkbox","aria-hidden":!0,defaultChecked:sl(n)?!1:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function sl(e){return e==="indeterminate"}function O5(e){return sl(e)?"indeterminate":e?"checked":"unchecked"}const P5=the,ihe=rhe,T5=ge.forwardRef(({className:e,...t},n)=>O.jsx(P5,{ref:n,className:Pe("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:O.jsx(ihe,{className:Pe("flex items-center justify-center text-current"),children:O.jsx(Rf,{className:"h-4 w-4"})})}));T5.displayName=P5.displayName;const D5=m.forwardRef(({className:e,...t},n)=>O.jsx("div",{role:"editor-panel",ref:n,className:Pe("flex grow h-full",e),...t}));D5.displayName="EditorPanel";const $5=m.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Pe(" flex flex-col space-y-2 w-[270px]",e),...t}));$5.displayName="EditorAside";const k5=m.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Pe(" grow",e),...t}));k5.displayName="EditorMain";var she=e=>{switch(e){case"success":return che;case"info":return dhe;case"warning":return uhe;case"error":return fhe;default:return null}},ahe=Array(12).fill(0),lhe=({visible:e})=>m.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},m.createElement("div",{className:"sonner-spinner"},ahe.map((t,n)=>m.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),che=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),uhe=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),dhe=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),fhe=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),hhe=()=>{let[e,t]=m.useState(document.hidden);return m.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Nx=1,phe=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Nx++,i=this.toasts.find(a=>a.id===o),s=e.dismissible===void 0?!0:e.dismissible;return i?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...e,id:o,title:n}),{...a,...e,id:o,dismissible:s,title:n}):a):this.addToast({title:n,...r,dismissible:s,id:o}),o},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),o=n!==void 0;return r.then(async i=>{if(mhe(i)&&!i.ok){o=!1;let s=typeof t.error=="function"?await t.error(`HTTP error! status: ${i.status}`):t.error,a=typeof t.description=="function"?await t.description(`HTTP error! status: ${i.status}`):t.description;this.create({id:n,type:"error",message:s,description:a})}else if(t.success!==void 0){o=!1;let s=typeof t.success=="function"?await t.success(i):t.success,a=typeof t.description=="function"?await t.description(i):t.description;this.create({id:n,type:"success",message:s,description:a})}}).catch(async i=>{if(t.error!==void 0){o=!1;let s=typeof t.error=="function"?await t.error(i):t.error,a=typeof t.description=="function"?await t.description(i):t.description;this.create({id:n,type:"error",message:s,description:a})}}).finally(()=>{var i;o&&(this.dismiss(n),n=void 0),(i=t.finally)==null||i.call(t)}),n},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||Nx++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},Zr=new phe,ghe=(e,t)=>{let n=(t==null?void 0:t.id)||Nx++;return Zr.addToast({title:e,...t,id:n}),n},mhe=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",vhe=ghe,bhe=()=>Zr.toasts,yhe=Object.assign(vhe,{success:Zr.success,info:Zr.info,warning:Zr.warning,error:Zr.error,custom:Zr.custom,message:Zr.message,promise:Zr.promise,dismiss:Zr.dismiss,loading:Zr.loading},{getHistory:bhe});function xhe(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}xhe(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
412
|
+
`);function Op(e){return e.label!==void 0}var whe=3,_he="32px",She=4e3,Che=356,Ehe=14,Rhe=20,Ohe=200;function Phe(...e){return e.filter(Boolean).join(" ")}var The=e=>{var t,n,r,o,i,s,a,l,c,u;let{invert:f,toast:p,unstyled:g,interacting:v,setHeights:b,visibleToasts:x,heights:w,index:_,toasts:S,expanded:R,removeToast:C,defaultRichColors:P,closeButton:A,style:M,cancelButtonStyle:T,actionButtonStyle:I,className:F="",descriptionClassName:j="",duration:X,position:G,gap:B,loadingIcon:J,expandByDefault:H,classNames:Y,icons:te,closeButtonAriaLabel:$="Close toast",pauseWhenPageIsHidden:V,cn:Q}=e,[N,le]=m.useState(!1),[se,ue]=m.useState(!1),[he,ie]=m.useState(!1),[ee,ae]=m.useState(!1),[ye,q]=m.useState(0),[be,_e]=m.useState(0),Oe=m.useRef(null),Te=m.useRef(null),Ue=_===0,Be=_+1<=x,Ae=p.type,Ke=p.dismissible!==!1,lt=p.className||"",It=p.descriptionClassName||"",$t=m.useMemo(()=>w.findIndex(nt=>nt.toastId===p.id)||0,[w,p.id]),Ht=m.useMemo(()=>{var nt;return(nt=p.closeButton)!=null?nt:A},[p.closeButton,A]),de=m.useMemo(()=>p.duration||X||She,[p.duration,X]),Ce=m.useRef(0),Le=m.useRef(0),Ge=m.useRef(0),Ze=m.useRef(null),[Wt,Zt]=G.split("-"),Kt=m.useMemo(()=>w.reduce((nt,pt,kt)=>kt>=$t?nt:nt+pt.height,0),[w,$t]),vn=hhe(),ln=p.invert||f,Lt=Ae==="loading";Le.current=m.useMemo(()=>$t*B+Kt,[$t,Kt]),m.useEffect(()=>{le(!0)},[]),m.useLayoutEffect(()=>{if(!N)return;let nt=Te.current,pt=nt.style.height;nt.style.height="auto";let kt=nt.getBoundingClientRect().height;nt.style.height=pt,_e(kt),b(Xt=>Xt.find(yt=>yt.toastId===p.id)?Xt.map(yt=>yt.toastId===p.id?{...yt,height:kt}:yt):[{toastId:p.id,height:kt,position:p.position},...Xt])},[N,p.title,p.description,b,p.id]);let tn=m.useCallback(()=>{ue(!0),q(Le.current),b(nt=>nt.filter(pt=>pt.toastId!==p.id)),setTimeout(()=>{C(p)},Ohe)},[p,C,b,Le]);m.useEffect(()=>{if(p.promise&&Ae==="loading"||p.duration===1/0||p.type==="loading")return;let nt,pt=de;return R||v||V&&vn?(()=>{if(Ge.current<Ce.current){let kt=new Date().getTime()-Ce.current;pt=pt-kt}Ge.current=new Date().getTime()})():pt!==1/0&&(Ce.current=new Date().getTime(),nt=setTimeout(()=>{var kt;(kt=p.onAutoClose)==null||kt.call(p,p),tn()},pt)),()=>clearTimeout(nt)},[R,v,H,p,de,tn,p.promise,Ae,V,vn]),m.useEffect(()=>{let nt=Te.current;if(nt){let pt=nt.getBoundingClientRect().height;return _e(pt),b(kt=>[{toastId:p.id,height:pt,position:p.position},...kt]),()=>b(kt=>kt.filter(Xt=>Xt.toastId!==p.id))}},[b,p.id]),m.useEffect(()=>{p.delete&&tn()},[tn,p.delete]);function xn(){return te!=null&&te.loading?m.createElement("div",{className:"sonner-loader","data-visible":Ae==="loading"},te.loading):J?m.createElement("div",{className:"sonner-loader","data-visible":Ae==="loading"},J):m.createElement(lhe,{visible:Ae==="loading"})}return m.createElement("li",{"aria-live":p.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:Te,className:Q(F,lt,Y==null?void 0:Y.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,Y==null?void 0:Y.default,Y==null?void 0:Y[Ae],(n=p==null?void 0:p.classNames)==null?void 0:n[Ae]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:P,"data-styled":!(p.jsx||p.unstyled||g),"data-mounted":N,"data-promise":!!p.promise,"data-removed":se,"data-visible":Be,"data-y-position":Wt,"data-x-position":Zt,"data-index":_,"data-front":Ue,"data-swiping":he,"data-dismissible":Ke,"data-type":Ae,"data-invert":ln,"data-swipe-out":ee,"data-expanded":!!(R||H&&N),style:{"--index":_,"--toasts-before":_,"--z-index":S.length-_,"--offset":`${se?ye:Le.current}px`,"--initial-height":H?"auto":`${be}px`,...M,...p.style},onPointerDown:nt=>{Lt||!Ke||(Oe.current=new Date,q(Le.current),nt.target.setPointerCapture(nt.pointerId),nt.target.tagName!=="BUTTON"&&(ie(!0),Ze.current={x:nt.clientX,y:nt.clientY}))},onPointerUp:()=>{var nt,pt,kt,Xt;if(ee||!Ke)return;Ze.current=null;let yt=Number(((nt=Te.current)==null?void 0:nt.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Rn=new Date().getTime()-((pt=Oe.current)==null?void 0:pt.getTime()),Io=Math.abs(yt)/Rn;if(Math.abs(yt)>=Rhe||Io>.11){q(Le.current),(kt=p.onDismiss)==null||kt.call(p,p),tn(),ae(!0);return}(Xt=Te.current)==null||Xt.style.setProperty("--swipe-amount","0px"),ie(!1)},onPointerMove:nt=>{var pt;if(!Ze.current||!Ke)return;let kt=nt.clientY-Ze.current.y,Xt=nt.clientX-Ze.current.x,yt=(Wt==="top"?Math.min:Math.max)(0,kt),Rn=nt.pointerType==="touch"?10:2;Math.abs(yt)>Rn?(pt=Te.current)==null||pt.style.setProperty("--swipe-amount",`${kt}px`):Math.abs(Xt)>Rn&&(Ze.current=null)}},Ht&&!p.jsx?m.createElement("button",{"aria-label":$,"data-disabled":Lt,"data-close-button":!0,onClick:Lt||!Ke?()=>{}:()=>{var nt;tn(),(nt=p.onDismiss)==null||nt.call(p,p)},className:Q(Y==null?void 0:Y.closeButton,(o=p==null?void 0:p.classNames)==null?void 0:o.closeButton)},m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},m.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),m.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,p.jsx||m.isValidElement(p.title)?p.jsx||p.title:m.createElement(m.Fragment,null,Ae||p.icon||p.promise?m.createElement("div",{"data-icon":"",className:Q(Y==null?void 0:Y.icon,(i=p==null?void 0:p.classNames)==null?void 0:i.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||xn():null,p.type!=="loading"?p.icon||(te==null?void 0:te[Ae])||she(Ae):null):null,m.createElement("div",{"data-content":"",className:Q(Y==null?void 0:Y.content,(s=p==null?void 0:p.classNames)==null?void 0:s.content)},m.createElement("div",{"data-title":"",className:Q(Y==null?void 0:Y.title,(a=p==null?void 0:p.classNames)==null?void 0:a.title)},p.title),p.description?m.createElement("div",{"data-description":"",className:Q(j,It,Y==null?void 0:Y.description,(l=p==null?void 0:p.classNames)==null?void 0:l.description)},p.description):null),m.isValidElement(p.cancel)?p.cancel:p.cancel&&Op(p.cancel)?m.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||T,onClick:nt=>{var pt,kt;Op(p.cancel)&&Ke&&((kt=(pt=p.cancel).onClick)==null||kt.call(pt,nt),tn())},className:Q(Y==null?void 0:Y.cancelButton,(c=p==null?void 0:p.classNames)==null?void 0:c.cancelButton)},p.cancel.label):null,m.isValidElement(p.action)?p.action:p.action&&Op(p.action)?m.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||I,onClick:nt=>{var pt,kt;Op(p.action)&&(nt.defaultPrevented||((kt=(pt=p.action).onClick)==null||kt.call(pt,nt),tn()))},className:Q(Y==null?void 0:Y.actionButton,(u=p==null?void 0:p.classNames)==null?void 0:u.actionButton)},p.action.label):null))};function C2(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var Dhe=e=>{let{invert:t,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:o,closeButton:i,className:s,offset:a,theme:l="light",richColors:c,duration:u,style:f,visibleToasts:p=whe,toastOptions:g,dir:v=C2(),gap:b=Ehe,loadingIcon:x,icons:w,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:S,cn:R=Phe}=e,[C,P]=m.useState([]),A=m.useMemo(()=>Array.from(new Set([n].concat(C.filter(V=>V.position).map(V=>V.position)))),[C,n]),[M,T]=m.useState([]),[I,F]=m.useState(!1),[j,X]=m.useState(!1),[G,B]=m.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),J=m.useRef(null),H=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),Y=m.useRef(null),te=m.useRef(!1),$=m.useCallback(V=>{var Q;(Q=C.find(N=>N.id===V.id))!=null&&Q.delete||Zr.dismiss(V.id),P(N=>N.filter(({id:le})=>le!==V.id))},[C]);return m.useEffect(()=>Zr.subscribe(V=>{if(V.dismiss){P(Q=>Q.map(N=>N.id===V.id?{...N,delete:!0}:N));return}setTimeout(()=>{Qo.flushSync(()=>{P(Q=>{let N=Q.findIndex(le=>le.id===V.id);return N!==-1?[...Q.slice(0,N),{...Q[N],...V},...Q.slice(N+1)]:[V,...Q]})})})}),[]),m.useEffect(()=>{if(l!=="system"){B(l);return}l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?B("dark"):B("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:V})=>{B(V?"dark":"light")})},[l]),m.useEffect(()=>{C.length<=1&&F(!1)},[C]),m.useEffect(()=>{let V=Q=>{var N,le;r.every(se=>Q[se]||Q.code===se)&&(F(!0),(N=J.current)==null||N.focus()),Q.code==="Escape"&&(document.activeElement===J.current||(le=J.current)!=null&&le.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[r]),m.useEffect(()=>{if(J.current)return()=>{Y.current&&(Y.current.focus({preventScroll:!0}),Y.current=null,te.current=!1)}},[J.current]),C.length?m.createElement("section",{"aria-label":`${_} ${H}`,tabIndex:-1},A.map((V,Q)=>{var N;let[le,se]=V.split("-");return m.createElement("ol",{key:V,dir:v==="auto"?C2():v,tabIndex:-1,ref:J,className:s,"data-sonner-toaster":!0,"data-theme":G,"data-y-position":le,"data-x-position":se,style:{"--front-toast-height":`${((N=M[0])==null?void 0:N.height)||0}px`,"--offset":typeof a=="number"?`${a}px`:a||_he,"--width":`${Che}px`,"--gap":`${b}px`,...f},onBlur:ue=>{te.current&&!ue.currentTarget.contains(ue.relatedTarget)&&(te.current=!1,Y.current&&(Y.current.focus({preventScroll:!0}),Y.current=null))},onFocus:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||te.current||(te.current=!0,Y.current=ue.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{j||F(!1)},onPointerDown:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||X(!0)},onPointerUp:()=>X(!1)},C.filter(ue=>!ue.position&&Q===0||ue.position===V).map((ue,he)=>{var ie,ee;return m.createElement(The,{key:ue.id,icons:w,index:he,toast:ue,defaultRichColors:c,duration:(ie=g==null?void 0:g.duration)!=null?ie:u,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:t,visibleToasts:p,closeButton:(ee=g==null?void 0:g.closeButton)!=null?ee:i,interacting:j,position:V,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:$,toasts:C.filter(ae=>ae.position==ue.position),heights:M.filter(ae=>ae.position==ue.position),setHeights:T,expandByDefault:o,gap:b,loadingIcon:x,expanded:I,pauseWhenPageIsHidden:S,cn:R})}))})):null};function $he(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function R2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?E2(Object(n),!0).forEach(function(r){$he(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function khe(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function Mhe(e,t){if(e==null)return{};var n=khe(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ahe(e,t){return Ihe(e)||Nhe(e,t)||Lhe(e,t)||Fhe()}function Ihe(e){if(Array.isArray(e))return e}function Nhe(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,o=!1,i=void 0;try{for(var s=e[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(n.push(a.value),!(t&&n.length===t));r=!0);}catch(l){o=!0,i=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(o)throw i}}return n}}function Lhe(e,t){if(e){if(typeof e=="string")return O2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return O2(e,t)}}function O2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Fhe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
413
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zhe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function T2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?P2(Object(n),!0).forEach(function(r){zhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jhe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(o,i){return i(o)},r)}}function Ju(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(o,a))}}}function Ng(e){return{}.toString.call(e).includes("Object")}function Bhe(e){return!Object.keys(e).length}function tf(e){return typeof e=="function"}function Vhe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Hhe(e,t){return Ng(t)||ta("changeType"),Object.keys(t).some(function(n){return!Vhe(e,n)})&&ta("changeField"),t}function Whe(e){tf(e)||ta("selectorType")}function Uhe(e){tf(e)||Ng(e)||ta("handlerType"),Ng(e)&&Object.values(e).some(function(t){return!tf(t)})&&ta("handlersType")}function qhe(e){e||ta("initialIsRequired"),Ng(e)||ta("initialType"),Bhe(e)&&ta("initialContent")}function Ghe(e,t){throw new Error(e[t]||e.default)}var Yhe={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},ta=Ju(Ghe)(Yhe),Pp={changes:Hhe,selector:Whe,handler:Uhe,initial:qhe};function Khe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Pp.initial(e),Pp.handler(t);var n={current:e},r=Ju(Jhe)(n,t),o=Ju(Qhe)(n),i=Ju(Pp.changes)(e),s=Ju(Xhe)(n);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return Pp.selector(c),c(n.current)}function l(c){jhe(r,o,i,s)(c)}return[a,l]}function Xhe(e,t){return tf(t)?t(e.current):t}function Qhe(e,t){return e.current=T2(T2({},e.current),t),t}function Jhe(e,t,n){return tf(t)?t(e.current):Object.keys(n).forEach(function(r){var o;return(o=t[r])===null||o===void 0?void 0:o.call(t,e.current[r])}),n}var Zhe={create:Khe},epe={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function tpe(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(o,a))}}}function npe(e){return{}.toString.call(e).includes("Object")}function rpe(e){return e||D2("configIsRequired"),npe(e)||D2("configType"),e.urls?(ope(),{paths:{vs:e.urls.monacoBase}}):e}function ope(){console.warn(M5.deprecation)}function ipe(e,t){throw new Error(e[t]||e.default)}var M5={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
414
414
|
You are using deprecated way of configuration.
|
|
415
415
|
|
|
416
416
|
Instead of using
|
|
@@ -419,4 +419,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
419
419
|
monaco.config({ paths: { vs: '...' } })
|
|
420
420
|
|
|
421
421
|
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
422
|
-
`},DT=tpe(ipe)(M5),spe={config:rpe},ape=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){return n.reduceRight(function(i,s){return s(i)},o)}};function A5(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],A5(e[n],t[n]))}),RT(RT({},e),t)}var lpe={type:"cancelation",msg:"operation is manually canceled"};function F0(e){var t=!1,n=new Promise(function(r,o){e.then(function(i){return t?o(lpe):r(i)}),e.catch(o)});return n.cancel=function(){return t=!0},n}var cpe=Zhe.create({config:epe,isInitialized:!1,resolve:null,reject:null,monaco:null}),I5=Ahe(cpe,2),Vf=I5[0],Ym=I5[1];function upe(e){var t=spe.config(e),n=t.monaco,r=Mhe(t,["monaco"]);Ym(function(o){return{config:A5(o.config,r),monaco:n}})}function dpe(){var e=Vf(function(t){var n=t.monaco,r=t.isInitialized,o=t.resolve;return{monaco:n,isInitialized:r,resolve:o}});if(!e.isInitialized){if(Ym({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),F0(z0);if(window.monaco&&window.monaco.editor)return N5(window.monaco),e.resolve(window.monaco),F0(z0);ape(fpe,ppe)(gpe)}return F0(z0)}function fpe(e){return document.body.appendChild(e)}function hpe(e){var t=document.createElement("script");return e&&(t.src=e),t}function ppe(e){var t=Vf(function(r){var o=r.config,i=r.reject;return{config:o,reject:i}}),n=hpe("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function gpe(){var e=Vf(function(n){var r=n.config,o=n.resolve,i=n.reject;return{config:r,resolve:o,reject:i}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){N5(n),e.resolve(n)},function(n){e.reject(n)})}function N5(e){Vf().monaco||Ym({monaco:e})}function mpe(){return Vf(function(e){var t=e.monaco;return t})}var z0=new Promise(function(e,t){return Ym({resolve:e,reject:t})}),L5={config:upe,init:dpe,__getMonacoInstance:mpe},vpe={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},j0=vpe,bpe={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},ype=bpe;function xpe({children:e}){return m.createElement("div",{style:ype.container},e)}var wpe=xpe,_pe=wpe;function Spe({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:i,wrapperProps:s}){return m.createElement("section",{style:{...j0.wrapper,width:e,height:t},...s},!n&&m.createElement(_pe,null,r),m.createElement("div",{ref:o,style:{...j0.fullWidth,...!n&&j0.hide},className:i}))}var Cpe=Spe,F5=m.memo(Cpe);function Epe(e){m.useEffect(e,[])}var z5=Epe;function Rpe(e,t,n=!0){let r=m.useRef(!0);m.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var to=Rpe;function dd(){}function ac(e,t,n,r){return Ope(e,r)||Ppe(e,t,n,r)}function Ope(e,t){return e.editor.getModel(j5(e,t))}function Ppe(e,t,n,r){return e.editor.createModel(t,n,r?j5(e,r):void 0)}function j5(e,t){return e.Uri.parse(t)}function Tpe({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:u="Loading...",options:f={},height:p="100%",width:g="100%",className:v,wrapperProps:b={},beforeMount:x=dd,onMount:w=dd}){let[_,S]=m.useState(!1),[R,C]=m.useState(!0),P=m.useRef(null),A=m.useRef(null),M=m.useRef(null),T=m.useRef(w),I=m.useRef(x),F=m.useRef(!1);z5(()=>{let B=L5.init();return B.then(J=>(A.current=J)&&C(!1)).catch(J=>(J==null?void 0:J.type)!=="cancelation"&&console.error("Monaco initialization: error:",J)),()=>P.current?G():B.cancel()}),to(()=>{if(P.current&&A.current){let B=P.current.getOriginalEditor(),J=ac(A.current,e||"",r||n||"text",i||"");J!==B.getModel()&&B.setModel(J)}},[i],_),to(()=>{if(P.current&&A.current){let B=P.current.getModifiedEditor(),J=ac(A.current,t||"",o||n||"text",s||"");J!==B.getModel()&&B.setModel(J)}},[s],_),to(()=>{let B=P.current.getModifiedEditor();B.getOption(A.current.editor.EditorOption.readOnly)?B.setValue(t||""):t!==B.getValue()&&(B.executeEdits("",[{range:B.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),B.pushUndoStop())},[t],_),to(()=>{var B,J;(J=(B=P.current)==null?void 0:B.getModel())==null||J.original.setValue(e||"")},[e],_),to(()=>{let{original:B,modified:J}=P.current.getModel();A.current.editor.setModelLanguage(B,r||n||"text"),A.current.editor.setModelLanguage(J,o||n||"text")},[n,r,o],_),to(()=>{var B;(B=A.current)==null||B.editor.setTheme(c)},[c],_),to(()=>{var B;(B=P.current)==null||B.updateOptions(f)},[f],_);let j=m.useCallback(()=>{var H;if(!A.current)return;I.current(A.current);let B=ac(A.current,e||"",r||n||"text",i||""),J=ac(A.current,t||"",o||n||"text",s||"");(H=P.current)==null||H.setModel({original:B,modified:J})},[n,t,o,e,r,i,s]),X=m.useCallback(()=>{var B;!F.current&&M.current&&(P.current=A.current.editor.createDiffEditor(M.current,{automaticLayout:!0,...f}),j(),(B=A.current)==null||B.editor.setTheme(c),S(!0),F.current=!0)},[f,c,j]);m.useEffect(()=>{_&&T.current(P.current,A.current)},[_]),m.useEffect(()=>{!R&&!_&&X()},[R,_,X]);function G(){var J,H,Y,te;let B=(J=P.current)==null?void 0:J.getModel();a||((H=B==null?void 0:B.original)==null||H.dispose()),l||((Y=B==null?void 0:B.modified)==null||Y.dispose()),(te=P.current)==null||te.dispose()}return m.createElement(F5,{width:g,height:p,isEditorReady:_,loading:u,_ref:M,className:v,wrapperProps:b})}var Dpe=Tpe;m.memo(Dpe);function $pe(e){let t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}var kpe=$pe,Tp=new Map;function Mpe({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:o,path:i,theme:s="light",line:a,loading:l="Loading...",options:c={},overrideServices:u={},saveViewState:f=!0,keepCurrentModel:p=!1,width:g="100%",height:v="100%",className:b,wrapperProps:x={},beforeMount:w=dd,onMount:_=dd,onChange:S,onValidate:R=dd}){let[C,P]=m.useState(!1),[A,M]=m.useState(!0),T=m.useRef(null),I=m.useRef(null),F=m.useRef(null),j=m.useRef(_),X=m.useRef(w),G=m.useRef(),B=m.useRef(r),J=kpe(i),H=m.useRef(!1),Y=m.useRef(!1);z5(()=>{let V=L5.init();return V.then(Q=>(T.current=Q)&&M(!1)).catch(Q=>(Q==null?void 0:Q.type)!=="cancelation"&&console.error("Monaco initialization: error:",Q)),()=>I.current?$():V.cancel()}),to(()=>{var Q,N,le,se;let V=ac(T.current,e||r||"",t||o||"",i||n||"");V!==((Q=I.current)==null?void 0:Q.getModel())&&(f&&Tp.set(J,(N=I.current)==null?void 0:N.saveViewState()),(le=I.current)==null||le.setModel(V),f&&((se=I.current)==null||se.restoreViewState(Tp.get(i))))},[i],C),to(()=>{var V;(V=I.current)==null||V.updateOptions(c)},[c],C),to(()=>{!I.current||r===void 0||(I.current.getOption(T.current.editor.EditorOption.readOnly)?I.current.setValue(r):r!==I.current.getValue()&&(Y.current=!0,I.current.executeEdits("",[{range:I.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),I.current.pushUndoStop(),Y.current=!1))},[r],C),to(()=>{var Q,N;let V=(Q=I.current)==null?void 0:Q.getModel();V&&o&&((N=T.current)==null||N.editor.setModelLanguage(V,o))},[o],C),to(()=>{var V;a!==void 0&&((V=I.current)==null||V.revealLine(a))},[a],C),to(()=>{var V;(V=T.current)==null||V.editor.setTheme(s)},[s],C);let te=m.useCallback(()=>{var V;if(!(!F.current||!T.current)&&!H.current){X.current(T.current);let Q=i||n,N=ac(T.current,r||e||"",t||o||"",Q||"");I.current=(V=T.current)==null?void 0:V.editor.create(F.current,{model:N,automaticLayout:!0,...c},u),f&&I.current.restoreViewState(Tp.get(Q)),T.current.editor.setTheme(s),a!==void 0&&I.current.revealLine(a),P(!0),H.current=!0}},[e,t,n,r,o,i,c,u,f,s,a]);m.useEffect(()=>{C&&j.current(I.current,T.current)},[C]),m.useEffect(()=>{!A&&!C&&te()},[A,C,te]),B.current=r,m.useEffect(()=>{var V,Q;C&&S&&((V=G.current)==null||V.dispose(),G.current=(Q=I.current)==null?void 0:Q.onDidChangeModelContent(N=>{Y.current||S(I.current.getValue(),N)}))},[C,S]),m.useEffect(()=>{if(C){let V=T.current.editor.onDidChangeMarkers(Q=>{var le;let N=(le=I.current.getModel())==null?void 0:le.uri;if(N&&Q.find(se=>se.path===N.path)){let se=T.current.editor.getModelMarkers({resource:N});R==null||R(se)}});return()=>{V==null||V.dispose()}}return()=>{}},[C,R]);function $(){var V,Q;(V=G.current)==null||V.dispose(),p?f&&Tp.set(i,I.current.saveViewState()):(Q=I.current.getModel())==null||Q.dispose(),I.current.dispose()}return m.createElement(F5,{width:g,height:v,isEditorReady:C,loading:l,_ref:F,className:b,wrapperProps:x})}var Ape=Mpe,B5=m.memo(Ape),Ipe=B5;const V5="Collapsible",[Npe,H5]=Gn(V5),[Lpe,y_]=Npe(V5),Fpe=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l=!1,c]=ur({prop:r,defaultProp:o,onChange:s});return m.createElement(Lpe,{scope:n,disabled:i,contentId:Nr(),open:l,onOpenToggle:m.useCallback(()=>c(u=>!u),[c])},m.createElement(Qe.div,fe({"data-state":x_(l),"data-disabled":i?"":void 0},a,{ref:t})))}),zpe="CollapsibleTrigger",jpe=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=y_(zpe,n);return m.createElement(Qe.button,fe({type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":x_(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled},r,{ref:t,onClick:De(e.onClick,o.onOpenToggle)}))}),W5="CollapsibleContent",Bpe=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=y_(W5,e.__scopeCollapsible);return m.createElement(Mn,{present:n||o.open},({present:i})=>m.createElement(Vpe,fe({},r,{ref:t,present:i})))}),Vpe=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=y_(W5,n),[a,l]=m.useState(r),c=m.useRef(null),u=ft(t,c),f=m.useRef(0),p=f.current,g=m.useRef(0),v=g.current,b=s.open||a,x=m.useRef(b),w=m.useRef();return m.useEffect(()=>{const _=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(_)},[]),cr(()=>{const _=c.current;if(_){w.current=w.current||{transitionDuration:_.style.transitionDuration,animationName:_.style.animationName},_.style.transitionDuration="0s",_.style.animationName="none";const S=_.getBoundingClientRect();f.current=S.height,g.current=S.width,x.current||(_.style.transitionDuration=w.current.transitionDuration,_.style.animationName=w.current.animationName),l(r)}},[s.open,r]),m.createElement(Qe.div,fe({"data-state":x_(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!b},i,{ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style}}),b&&o)});function x_(e){return e?"open":"closed"}const Hpe=Fpe,Wpe=jpe,Upe=Bpe,pa="Accordion",qpe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[w_,Gpe,Ype]=Yg(pa),[Km,ume]=Gn(pa,[Ype,H5]),__=H5(),U5=m.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return m.createElement(w_.Provider,{scope:e.__scopeAccordion},n==="multiple"?m.createElement(Jpe,fe({},i,{ref:t})):m.createElement(Qpe,fe({},o,{ref:t})))});U5.propTypes={type(e){const t=e.value||e.defaultValue;return e.type&&!["single","multiple"].includes(e.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):e.type==="multiple"&&typeof t=="string"?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):e.type==="single"&&Array.isArray(t)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[q5,Kpe]=Km(pa),[G5,Xpe]=Km(pa,{collapsible:!1}),Qpe=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...s}=e,[a,l]=ur({prop:n,defaultProp:r,onChange:o});return m.createElement(q5,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:m.useCallback(()=>i&&l(""),[i,l])},m.createElement(G5,{scope:e.__scopeAccordion,collapsible:i},m.createElement(Y5,fe({},s,{ref:t}))))}),Jpe=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[s=[],a]=ur({prop:n,defaultProp:r,onChange:o}),l=m.useCallback(u=>a((f=[])=>[...f,u]),[a]),c=m.useCallback(u=>a((f=[])=>f.filter(p=>p!==u)),[a]);return m.createElement(q5,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c},m.createElement(G5,{scope:e.__scopeAccordion,collapsible:!0},m.createElement(Y5,fe({},i,{ref:t}))))}),[Zpe,Xm]=Km(pa),Y5=m.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...s}=e,a=m.useRef(null),l=ft(a,t),c=Gpe(n),f=ml(o)==="ltr",p=De(e.onKeyDown,g=>{var v;if(!qpe.includes(g.key))return;const b=g.target,x=c().filter(T=>{var I;return!((I=T.ref.current)!==null&&I!==void 0&&I.disabled)}),w=x.findIndex(T=>T.ref.current===b),_=x.length;if(w===-1)return;g.preventDefault();let S=w;const R=0,C=_-1,P=()=>{S=w+1,S>C&&(S=R)},A=()=>{S=w-1,S<R&&(S=C)};switch(g.key){case"Home":S=R;break;case"End":S=C;break;case"ArrowRight":i==="horizontal"&&(f?P():A());break;case"ArrowDown":i==="vertical"&&P();break;case"ArrowLeft":i==="horizontal"&&(f?A():P());break;case"ArrowUp":i==="vertical"&&A();break}const M=S%_;(v=x[M].ref.current)===null||v===void 0||v.focus()});return m.createElement(Zpe,{scope:n,disabled:r,direction:o,orientation:i},m.createElement(w_.Slot,{scope:n},m.createElement(Qe.div,fe({},s,{"data-orientation":i,ref:l,onKeyDown:r?void 0:p}))))}),Lx="AccordionItem",[ege,S_]=Km(Lx),tge=m.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=Xm(Lx,n),s=Kpe(Lx,n),a=__(n),l=Nr(),c=r&&s.value.includes(r)||!1,u=i.disabled||e.disabled;return m.createElement(ege,{scope:n,open:c,disabled:u,triggerId:l},m.createElement(Hpe,fe({"data-orientation":i.orientation,"data-state":K5(c)},a,o,{ref:t,disabled:u,open:c,onOpenChange:f=>{f?s.onItemOpen(r):s.onItemClose(r)}})))}),nge="AccordionHeader",rge=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Xm(pa,n),i=S_(nge,n);return m.createElement(Qe.h3,fe({"data-orientation":o.orientation,"data-state":K5(i.open),"data-disabled":i.disabled?"":void 0},r,{ref:t}))}),$T="AccordionTrigger",oge=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Xm(pa,n),i=S_($T,n),s=Xpe($T,n),a=__(n);return m.createElement(w_.ItemSlot,{scope:n},m.createElement(Wpe,fe({"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId},a,r,{ref:t})))}),ige="AccordionContent",sge=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Xm(pa,n),i=S_(ige,n),s=__(n);return m.createElement(Upe,fe({role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation},s,r,{ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}}))});function K5(e){return e?"open":"closed"}const age=U5,lge=tge,cge=rge,X5=oge,Q5=sge,uge=age,J5=ge.forwardRef(({className:e,...t},n)=>O.jsx(lge,{ref:n,className:Pe("border-b",e),...t}));J5.displayName="AccordionItem";const Z5=ge.forwardRef(({className:e,children:t,...n},r)=>O.jsx(cge,{className:"flex",children:O.jsxs(X5,{ref:r,className:Pe("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,O.jsx(hm,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Z5.displayName=X5.displayName;const eN=ge.forwardRef(({className:e,children:t,...n},r)=>O.jsx(Q5,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:O.jsx("div",{className:Pe("pb-4 pt-0",e),children:t})}));eN.displayName=Q5.displayName;const tN="Radio",[dge,nN]=Gn(tN),[fge,hge]=dge(tN),pge=m.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:s,value:a="on",onCheck:l,...c}=e,[u,f]=m.useState(null),p=ft(t,b=>f(b)),g=m.useRef(!1),v=u?!!u.closest("form"):!0;return m.createElement(fge,{scope:n,checked:o,disabled:s},m.createElement(Qe.button,fe({type:"button",role:"radio","aria-checked":o,"data-state":rN(o),"data-disabled":s?"":void 0,disabled:s,value:a},c,{ref:p,onClick:De(e.onClick,b=>{o||l==null||l(),v&&(g.current=b.isPropagationStopped(),g.current||b.stopPropagation())})})),v&&m.createElement(vge,{control:u,bubbles:!g.current,name:r,value:a,checked:o,required:i,disabled:s,style:{transform:"translateX(-100%)"}}))}),gge="RadioIndicator",mge=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=hge(gge,n);return m.createElement(Mn,{present:r||i.checked},m.createElement(Qe.span,fe({"data-state":rN(i.checked),"data-disabled":i.disabled?"":void 0},o,{ref:t})))}),vge=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=Sm(n),a=mm(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const p=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(p)}},[s,n,r]),m.createElement("input",fe({type:"radio","aria-hidden":!0,defaultChecked:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function rN(e){return e?"checked":"unchecked"}const bge=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],oN="RadioGroup",[yge,dme]=Gn(oN,[Gc,nN]),iN=Gc(),sN=nN(),[xge,wge]=yge(oN),_ge=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:s=!1,disabled:a=!1,orientation:l,dir:c,loop:u=!0,onValueChange:f,...p}=e,g=iN(n),v=ml(c),[b,x]=ur({prop:i,defaultProp:o,onChange:f});return m.createElement(xge,{scope:n,name:r,required:s,disabled:a,value:b,onValueChange:x},m.createElement(Jx,fe({asChild:!0},g,{orientation:l,dir:v,loop:u}),m.createElement(Qe.div,fe({role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:v},p,{ref:t}))))}),Sge="RadioGroupItem",Cge=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=wge(Sge,n),s=i.disabled||r,a=iN(n),l=sN(n),c=m.useRef(null),u=ft(t,c),f=i.value===o.value,p=m.useRef(!1);return m.useEffect(()=>{const g=b=>{bge.includes(b.key)&&(p.current=!0)},v=()=>p.current=!1;return document.addEventListener("keydown",g),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",g),document.removeEventListener("keyup",v)}},[]),m.createElement(Zx,fe({asChild:!0},a,{focusable:!s,active:f}),m.createElement(pge,fe({disabled:s,required:i.required,checked:f},l,o,{name:i.name,ref:u,onCheck:()=>i.onValueChange(o.value),onKeyDown:De(g=>{g.key==="Enter"&&g.preventDefault()}),onFocus:De(o.onFocus,()=>{var g;p.current&&((g=c.current)===null||g===void 0||g.click())})})))}),Ege=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=sN(n);return m.createElement(mge,fe({},o,r,{ref:t}))}),aN=_ge,lN=Cge,Rge=Ege,cN=ge.forwardRef(({className:e,...t},n)=>O.jsx(aN,{className:Pe("grid gap-2",e),...t,ref:n}));cN.displayName=aN.displayName;const uN=ge.forwardRef(({className:e,...t},n)=>O.jsx(lN,{ref:n,className:Pe("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:O.jsx(Rge,{className:"flex items-center justify-center",children:O.jsx(L$,{className:"h-2.5 w-2.5 fill-current text-current"})})}));uN.displayName=lN.displayName;var Oge=Object.defineProperty,Pge=(e,t,n)=>t in e?Oge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Dp=(e,t,n)=>(Pge(e,typeof t!="symbol"?t+"":t,n),n);const Tge={stringify:e=>e,parse:e=>e},Dge={stringify:e=>`${e}`,parse:e=>parseFloat(e)},$ge={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},kge={stringify:e=>e.name,parse:(e,t)=>{const n=(()=>{if(typeof window<"u"&&e in window)return window[e];if(typeof global<"u"&&e in global)return global[e]})();return typeof n=="function"?n.bind(t):void 0}},Mge={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},B0={string:Tge,number:Dge,boolean:$ge,function:kge,json:Mge},V0=Symbol.for("r2wc.render"),$p=Symbol.for("r2wc.connected"),ka=Symbol.for("r2wc.context"),As=Symbol.for("r2wc.props");function Age(e,t,n){var r,o,i;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]);const s=(Array.isArray(t.props)?t.props.slice():Object.keys(t.props)).filter(f=>f!=="container"),a={},l={},c={};for(const f of s){a[f]=Array.isArray(t.props)?"string":t.props[f];const p=Ige(f);l[f]=p,c[p]=f}class u extends HTMLElement{constructor(){super(),Dp(this,r,!0),Dp(this,o),Dp(this,i,{}),Dp(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[As].container=this.container;for(const p of s){const g=l[p],v=this.getAttribute(g),b=a[p],x=B0[b];v&&x!=null&&x.parse&&(this[As][p]=x.parse(v,this))}}static get observedAttributes(){return Object.keys(c)}connectedCallback(){this[$p]=!0,this[V0]()}disconnectedCallback(){this[$p]=!1,this[ka]&&n.unmount(this[ka]),delete this[ka]}attributeChangedCallback(p,g,v){const b=c[p],x=a[b],w=B0[x];b in a&&w!=null&&w.parse&&(this[As][b]=w.parse(v,this),this[V0]())}[(r=$p,o=ka,i=As,V0)](){this[$p]&&(this[ka]?n.update(this[ka],this[As]):this[ka]=n.mount(this.container,e,this[As]))}}for(const f of s){const p=l[f],g=a[f];Object.defineProperty(u.prototype,f,{enumerable:!0,configurable:!0,get(){return this[As][f]},set(v){this[As][f]=v;const b=B0[g];if(b!=null&&b.stringify){const x=b.stringify(v);this.getAttribute(p)!==x&&this.setAttribute(p,x)}}})}return u}function Ige(e=""){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Nge(e,t,n){const r=Z0(e),o=m.createElement(t,n);return r.render(o),{root:r,ReactComponent:t}}function Lge({root:e,ReactComponent:t},n){const r=m.createElement(t,n);e.render(r)}function Fge({root:e}){e.unmount()}function zge(e,t={}){return Age(e,t,{mount:Nge,update:Lge,unmount:Fge})}const jge={id:"string",version:"string",authToken:"json",currentTheme:"string",customCards:"json",customStyle:"json",onChartElementClicked:"function",onEvent:"function",onSave:"function",LoadingComponent:"function",ErrorComponent:"function",showAssistant:"boolean"},Bge=zge(NI,{props:jge});exports.$57acba87d6e25586$export$ccf8d8d7bbf3c2cc=pA;exports.$a093c7e1ec25a057$export$8c610744efcf8a1d=nk;exports.Accordion=uge;exports.AccordionContent=eN;exports.AccordionItem=J5;exports.AccordionTrigger=Z5;exports.BOOLEAN_DATA_TYPES=Wx;exports.Bot=qy;exports.Button=yr;exports.Calendar=I$;exports.Card=Yx;exports.CardContent=qg;exports.CardDescription=Kx;exports.CardFooter=Xx;exports.CardHeader=Ug;exports.CardTitle=yf;exports.ChartJsVisual=Hw;exports.Check=Rf;exports.CheckIcon=$$;exports.Checkbox=T5;exports.ChevronDown=hm;exports.ClipboardCopyIcon=pY;exports.ColorFormat=cM;exports.Cross2Icon=k$;exports.DATE_DATA_TYPES=mf;exports.Dashboard=NI;exports.DashboardPanel=S2;exports.DashboardTabs=AI;exports.DashboardWC=Bge;exports.Dialog=Kfe;exports.DialogContent=w5;exports.DialogDescription=E5;exports.DialogFooter=S5;exports.DialogHeader=_5;exports.DialogTitle=C5;exports.DialogTrigger=Xfe;exports.DropdownMenu=yfe;exports.DropdownMenuContent=i5;exports.DropdownMenuLabel=a5;exports.DropdownMenuRadioGroup=wfe;exports.DropdownMenuRadioItem=s5;exports.DropdownMenuSeparator=l5;exports.DropdownMenuTrigger=xfe;exports.Editable=na;exports.EditorAside=$5;exports.EditorMain=k5;exports.EditorPanel=D5;exports.Ft=Ipe;exports.HoverCard=d1;exports.HoverCardContent=xm;exports.HoverCardTrigger=f1;exports.InfoCircledIcon=SY;exports.Input=dc;exports.Jt=yhe;exports.KPICard=lk;exports.LOCALE_CURRENCY_PAIRS=ey;exports.Label=Un;exports.LoaderCircle=Gw;exports.Markdown=hI;exports.NUMBER_DATA_TYPES=$c;exports.PYTHON_DEFAULT_CODE=a2;exports.PaperPlaneIcon=M$;exports.PlayIcon=RY;exports.Plus=F$;exports.Popover=Dm;exports.PopoverContent=$f;exports.PopoverTrigger=$m;exports.RadioGroup=cN;exports.RadioGroupItem=uN;exports.ResizableHandle=tde;exports.ResizablePanel=kx;exports.ResizablePanelGroup=MI;exports.ScrollArea=X1;exports.ScrollBar=jm;exports.Select=Ls;exports.SelectContent=Ji;exports.SelectGroup=nc;exports.SelectItem=Wn;exports.SelectLabel=Fa;exports.SelectSeparator=Sg;exports.SelectTrigger=Qi;exports.SelectValue=Fs;exports.SemaphorContextProvider=dk;exports.SemaphorQueryClient=ck;exports.Separator=km;exports.Settings=Yw;exports.SliderIcon=PY;exports.Switch=OA;exports.TEXT_DATA_TYPES=Vg;exports.Table=z$;exports.Table$1=h1;exports.TableBody=g1;exports.TableCell=wg;exports.TableHead=m1;exports.TableHeader=p1;exports.TableRow=ld;exports.TableVisual=dM;exports.Tabs=I2;exports.TabsContent=tw;exports.TabsList=N2;exports.TabsTrigger=L2;exports.Te=Dhe;exports.TextCard=vM;exports.Textarea=E1;exports.Toggle=C1;exports.Tooltip=ik;exports.TooltipContent=i1;exports.TooltipTrigger=sk;exports.TriangleDownIcon=Ww;exports.TriangleUpIcon=Uw;exports.UXProvider=II;exports.X=Kw;exports._=os;exports.cleanCard=c5;exports.cn=Pe;exports.copyToClipboard=e8;exports.createChartConfig=a1;exports.createLucideIcon=Dn;exports.createSqlGenConfig=$8;exports.de=B5;exports.flexRender=rx;exports.fmt=Ux;exports.getBookmarkKey=u5;exports.getCanvasBackgroundColor=gd;exports.getColumnDataType=k8;exports.getContrastColor=md;exports.getCoreRowModel=Rk;exports.getDashbaordStateWithoutData=Rfe;exports.getDefaultFilterSql=Foe;exports.getFilterValueType=Zp;exports.getKeys=ar;exports.getNumberAxis=s1;exports.getPaginationRowModel=Pk;exports.getQualifiedTableName=c2;exports.getRequest=Z9;exports.getSortedRowModel=Ok;exports.getSql=D8;exports.isColumnInSqlGen=M8;exports.jsxRuntimeExports=O;exports.pivotData=gg;exports.postRequest=gf;exports.resolveBaseQuery=YT;exports.resolveDataType=vd;exports.titleCase=n8;exports.useCard=UX;exports.useDashboardActions=Ci;exports.useDashboardCard=l1;exports.useDashboardStore=Ie;exports.useEditorActions=fm;exports.useEditorStore=$r;exports.useQuery=bf;exports.useReactTable=Tk;exports.useSemaphorContext=fa;exports.useTheme=w2;exports.v4=dl;
|
|
422
|
+
`},D2=tpe(ipe)(M5),spe={config:rpe},ape=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){return n.reduceRight(function(i,s){return s(i)},o)}};function A5(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],A5(e[n],t[n]))}),R2(R2({},e),t)}var lpe={type:"cancelation",msg:"operation is manually canceled"};function F0(e){var t=!1,n=new Promise(function(r,o){e.then(function(i){return t?o(lpe):r(i)}),e.catch(o)});return n.cancel=function(){return t=!0},n}var cpe=Zhe.create({config:epe,isInitialized:!1,resolve:null,reject:null,monaco:null}),I5=Ahe(cpe,2),Vf=I5[0],Ym=I5[1];function upe(e){var t=spe.config(e),n=t.monaco,r=Mhe(t,["monaco"]);Ym(function(o){return{config:A5(o.config,r),monaco:n}})}function dpe(){var e=Vf(function(t){var n=t.monaco,r=t.isInitialized,o=t.resolve;return{monaco:n,isInitialized:r,resolve:o}});if(!e.isInitialized){if(Ym({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),F0(z0);if(window.monaco&&window.monaco.editor)return N5(window.monaco),e.resolve(window.monaco),F0(z0);ape(fpe,ppe)(gpe)}return F0(z0)}function fpe(e){return document.body.appendChild(e)}function hpe(e){var t=document.createElement("script");return e&&(t.src=e),t}function ppe(e){var t=Vf(function(r){var o=r.config,i=r.reject;return{config:o,reject:i}}),n=hpe("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function gpe(){var e=Vf(function(n){var r=n.config,o=n.resolve,i=n.reject;return{config:r,resolve:o,reject:i}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){N5(n),e.resolve(n)},function(n){e.reject(n)})}function N5(e){Vf().monaco||Ym({monaco:e})}function mpe(){return Vf(function(e){var t=e.monaco;return t})}var z0=new Promise(function(e,t){return Ym({resolve:e,reject:t})}),L5={config:upe,init:dpe,__getMonacoInstance:mpe},vpe={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},j0=vpe,bpe={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},ype=bpe;function xpe({children:e}){return m.createElement("div",{style:ype.container},e)}var wpe=xpe,_pe=wpe;function Spe({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:i,wrapperProps:s}){return m.createElement("section",{style:{...j0.wrapper,width:e,height:t},...s},!n&&m.createElement(_pe,null,r),m.createElement("div",{ref:o,style:{...j0.fullWidth,...!n&&j0.hide},className:i}))}var Cpe=Spe,F5=m.memo(Cpe);function Epe(e){m.useEffect(e,[])}var z5=Epe;function Rpe(e,t,n=!0){let r=m.useRef(!0);m.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var to=Rpe;function dd(){}function ac(e,t,n,r){return Ope(e,r)||Ppe(e,t,n,r)}function Ope(e,t){return e.editor.getModel(j5(e,t))}function Ppe(e,t,n,r){return e.editor.createModel(t,n,r?j5(e,r):void 0)}function j5(e,t){return e.Uri.parse(t)}function Tpe({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:u="Loading...",options:f={},height:p="100%",width:g="100%",className:v,wrapperProps:b={},beforeMount:x=dd,onMount:w=dd}){let[_,S]=m.useState(!1),[R,C]=m.useState(!0),P=m.useRef(null),A=m.useRef(null),M=m.useRef(null),T=m.useRef(w),I=m.useRef(x),F=m.useRef(!1);z5(()=>{let B=L5.init();return B.then(J=>(A.current=J)&&C(!1)).catch(J=>(J==null?void 0:J.type)!=="cancelation"&&console.error("Monaco initialization: error:",J)),()=>P.current?G():B.cancel()}),to(()=>{if(P.current&&A.current){let B=P.current.getOriginalEditor(),J=ac(A.current,e||"",r||n||"text",i||"");J!==B.getModel()&&B.setModel(J)}},[i],_),to(()=>{if(P.current&&A.current){let B=P.current.getModifiedEditor(),J=ac(A.current,t||"",o||n||"text",s||"");J!==B.getModel()&&B.setModel(J)}},[s],_),to(()=>{let B=P.current.getModifiedEditor();B.getOption(A.current.editor.EditorOption.readOnly)?B.setValue(t||""):t!==B.getValue()&&(B.executeEdits("",[{range:B.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),B.pushUndoStop())},[t],_),to(()=>{var B,J;(J=(B=P.current)==null?void 0:B.getModel())==null||J.original.setValue(e||"")},[e],_),to(()=>{let{original:B,modified:J}=P.current.getModel();A.current.editor.setModelLanguage(B,r||n||"text"),A.current.editor.setModelLanguage(J,o||n||"text")},[n,r,o],_),to(()=>{var B;(B=A.current)==null||B.editor.setTheme(c)},[c],_),to(()=>{var B;(B=P.current)==null||B.updateOptions(f)},[f],_);let j=m.useCallback(()=>{var H;if(!A.current)return;I.current(A.current);let B=ac(A.current,e||"",r||n||"text",i||""),J=ac(A.current,t||"",o||n||"text",s||"");(H=P.current)==null||H.setModel({original:B,modified:J})},[n,t,o,e,r,i,s]),X=m.useCallback(()=>{var B;!F.current&&M.current&&(P.current=A.current.editor.createDiffEditor(M.current,{automaticLayout:!0,...f}),j(),(B=A.current)==null||B.editor.setTheme(c),S(!0),F.current=!0)},[f,c,j]);m.useEffect(()=>{_&&T.current(P.current,A.current)},[_]),m.useEffect(()=>{!R&&!_&&X()},[R,_,X]);function G(){var J,H,Y,te;let B=(J=P.current)==null?void 0:J.getModel();a||((H=B==null?void 0:B.original)==null||H.dispose()),l||((Y=B==null?void 0:B.modified)==null||Y.dispose()),(te=P.current)==null||te.dispose()}return m.createElement(F5,{width:g,height:p,isEditorReady:_,loading:u,_ref:M,className:v,wrapperProps:b})}var Dpe=Tpe;m.memo(Dpe);function $pe(e){let t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}var kpe=$pe,Tp=new Map;function Mpe({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:o,path:i,theme:s="light",line:a,loading:l="Loading...",options:c={},overrideServices:u={},saveViewState:f=!0,keepCurrentModel:p=!1,width:g="100%",height:v="100%",className:b,wrapperProps:x={},beforeMount:w=dd,onMount:_=dd,onChange:S,onValidate:R=dd}){let[C,P]=m.useState(!1),[A,M]=m.useState(!0),T=m.useRef(null),I=m.useRef(null),F=m.useRef(null),j=m.useRef(_),X=m.useRef(w),G=m.useRef(),B=m.useRef(r),J=kpe(i),H=m.useRef(!1),Y=m.useRef(!1);z5(()=>{let V=L5.init();return V.then(Q=>(T.current=Q)&&M(!1)).catch(Q=>(Q==null?void 0:Q.type)!=="cancelation"&&console.error("Monaco initialization: error:",Q)),()=>I.current?$():V.cancel()}),to(()=>{var Q,N,le,se;let V=ac(T.current,e||r||"",t||o||"",i||n||"");V!==((Q=I.current)==null?void 0:Q.getModel())&&(f&&Tp.set(J,(N=I.current)==null?void 0:N.saveViewState()),(le=I.current)==null||le.setModel(V),f&&((se=I.current)==null||se.restoreViewState(Tp.get(i))))},[i],C),to(()=>{var V;(V=I.current)==null||V.updateOptions(c)},[c],C),to(()=>{!I.current||r===void 0||(I.current.getOption(T.current.editor.EditorOption.readOnly)?I.current.setValue(r):r!==I.current.getValue()&&(Y.current=!0,I.current.executeEdits("",[{range:I.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),I.current.pushUndoStop(),Y.current=!1))},[r],C),to(()=>{var Q,N;let V=(Q=I.current)==null?void 0:Q.getModel();V&&o&&((N=T.current)==null||N.editor.setModelLanguage(V,o))},[o],C),to(()=>{var V;a!==void 0&&((V=I.current)==null||V.revealLine(a))},[a],C),to(()=>{var V;(V=T.current)==null||V.editor.setTheme(s)},[s],C);let te=m.useCallback(()=>{var V;if(!(!F.current||!T.current)&&!H.current){X.current(T.current);let Q=i||n,N=ac(T.current,r||e||"",t||o||"",Q||"");I.current=(V=T.current)==null?void 0:V.editor.create(F.current,{model:N,automaticLayout:!0,...c},u),f&&I.current.restoreViewState(Tp.get(Q)),T.current.editor.setTheme(s),a!==void 0&&I.current.revealLine(a),P(!0),H.current=!0}},[e,t,n,r,o,i,c,u,f,s,a]);m.useEffect(()=>{C&&j.current(I.current,T.current)},[C]),m.useEffect(()=>{!A&&!C&&te()},[A,C,te]),B.current=r,m.useEffect(()=>{var V,Q;C&&S&&((V=G.current)==null||V.dispose(),G.current=(Q=I.current)==null?void 0:Q.onDidChangeModelContent(N=>{Y.current||S(I.current.getValue(),N)}))},[C,S]),m.useEffect(()=>{if(C){let V=T.current.editor.onDidChangeMarkers(Q=>{var le;let N=(le=I.current.getModel())==null?void 0:le.uri;if(N&&Q.find(se=>se.path===N.path)){let se=T.current.editor.getModelMarkers({resource:N});R==null||R(se)}});return()=>{V==null||V.dispose()}}return()=>{}},[C,R]);function $(){var V,Q;(V=G.current)==null||V.dispose(),p?f&&Tp.set(i,I.current.saveViewState()):(Q=I.current.getModel())==null||Q.dispose(),I.current.dispose()}return m.createElement(F5,{width:g,height:v,isEditorReady:C,loading:l,_ref:F,className:b,wrapperProps:x})}var Ape=Mpe,B5=m.memo(Ape),Ipe=B5;const V5="Collapsible",[Npe,H5]=Gn(V5),[Lpe,y_]=Npe(V5),Fpe=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l=!1,c]=ur({prop:r,defaultProp:o,onChange:s});return m.createElement(Lpe,{scope:n,disabled:i,contentId:Nr(),open:l,onOpenToggle:m.useCallback(()=>c(u=>!u),[c])},m.createElement(Qe.div,fe({"data-state":x_(l),"data-disabled":i?"":void 0},a,{ref:t})))}),zpe="CollapsibleTrigger",jpe=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=y_(zpe,n);return m.createElement(Qe.button,fe({type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":x_(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled},r,{ref:t,onClick:De(e.onClick,o.onOpenToggle)}))}),W5="CollapsibleContent",Bpe=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=y_(W5,e.__scopeCollapsible);return m.createElement(Mn,{present:n||o.open},({present:i})=>m.createElement(Vpe,fe({},r,{ref:t,present:i})))}),Vpe=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=y_(W5,n),[a,l]=m.useState(r),c=m.useRef(null),u=ft(t,c),f=m.useRef(0),p=f.current,g=m.useRef(0),v=g.current,b=s.open||a,x=m.useRef(b),w=m.useRef();return m.useEffect(()=>{const _=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(_)},[]),cr(()=>{const _=c.current;if(_){w.current=w.current||{transitionDuration:_.style.transitionDuration,animationName:_.style.animationName},_.style.transitionDuration="0s",_.style.animationName="none";const S=_.getBoundingClientRect();f.current=S.height,g.current=S.width,x.current||(_.style.transitionDuration=w.current.transitionDuration,_.style.animationName=w.current.animationName),l(r)}},[s.open,r]),m.createElement(Qe.div,fe({"data-state":x_(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!b},i,{ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style}}),b&&o)});function x_(e){return e?"open":"closed"}const Hpe=Fpe,Wpe=jpe,Upe=Bpe,pa="Accordion",qpe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[w_,Gpe,Ype]=Yg(pa),[Km,ume]=Gn(pa,[Ype,H5]),__=H5(),U5=m.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return m.createElement(w_.Provider,{scope:e.__scopeAccordion},n==="multiple"?m.createElement(Jpe,fe({},i,{ref:t})):m.createElement(Qpe,fe({},o,{ref:t})))});U5.propTypes={type(e){const t=e.value||e.defaultValue;return e.type&&!["single","multiple"].includes(e.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):e.type==="multiple"&&typeof t=="string"?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):e.type==="single"&&Array.isArray(t)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[q5,Kpe]=Km(pa),[G5,Xpe]=Km(pa,{collapsible:!1}),Qpe=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...s}=e,[a,l]=ur({prop:n,defaultProp:r,onChange:o});return m.createElement(q5,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:m.useCallback(()=>i&&l(""),[i,l])},m.createElement(G5,{scope:e.__scopeAccordion,collapsible:i},m.createElement(Y5,fe({},s,{ref:t}))))}),Jpe=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[s=[],a]=ur({prop:n,defaultProp:r,onChange:o}),l=m.useCallback(u=>a((f=[])=>[...f,u]),[a]),c=m.useCallback(u=>a((f=[])=>f.filter(p=>p!==u)),[a]);return m.createElement(q5,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c},m.createElement(G5,{scope:e.__scopeAccordion,collapsible:!0},m.createElement(Y5,fe({},i,{ref:t}))))}),[Zpe,Xm]=Km(pa),Y5=m.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...s}=e,a=m.useRef(null),l=ft(a,t),c=Gpe(n),f=ml(o)==="ltr",p=De(e.onKeyDown,g=>{var v;if(!qpe.includes(g.key))return;const b=g.target,x=c().filter(T=>{var I;return!((I=T.ref.current)!==null&&I!==void 0&&I.disabled)}),w=x.findIndex(T=>T.ref.current===b),_=x.length;if(w===-1)return;g.preventDefault();let S=w;const R=0,C=_-1,P=()=>{S=w+1,S>C&&(S=R)},A=()=>{S=w-1,S<R&&(S=C)};switch(g.key){case"Home":S=R;break;case"End":S=C;break;case"ArrowRight":i==="horizontal"&&(f?P():A());break;case"ArrowDown":i==="vertical"&&P();break;case"ArrowLeft":i==="horizontal"&&(f?A():P());break;case"ArrowUp":i==="vertical"&&A();break}const M=S%_;(v=x[M].ref.current)===null||v===void 0||v.focus()});return m.createElement(Zpe,{scope:n,disabled:r,direction:o,orientation:i},m.createElement(w_.Slot,{scope:n},m.createElement(Qe.div,fe({},s,{"data-orientation":i,ref:l,onKeyDown:r?void 0:p}))))}),Lx="AccordionItem",[ege,S_]=Km(Lx),tge=m.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=Xm(Lx,n),s=Kpe(Lx,n),a=__(n),l=Nr(),c=r&&s.value.includes(r)||!1,u=i.disabled||e.disabled;return m.createElement(ege,{scope:n,open:c,disabled:u,triggerId:l},m.createElement(Hpe,fe({"data-orientation":i.orientation,"data-state":K5(c)},a,o,{ref:t,disabled:u,open:c,onOpenChange:f=>{f?s.onItemOpen(r):s.onItemClose(r)}})))}),nge="AccordionHeader",rge=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Xm(pa,n),i=S_(nge,n);return m.createElement(Qe.h3,fe({"data-orientation":o.orientation,"data-state":K5(i.open),"data-disabled":i.disabled?"":void 0},r,{ref:t}))}),$2="AccordionTrigger",oge=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Xm(pa,n),i=S_($2,n),s=Xpe($2,n),a=__(n);return m.createElement(w_.ItemSlot,{scope:n},m.createElement(Wpe,fe({"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId},a,r,{ref:t})))}),ige="AccordionContent",sge=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Xm(pa,n),i=S_(ige,n),s=__(n);return m.createElement(Upe,fe({role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation},s,r,{ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}}))});function K5(e){return e?"open":"closed"}const age=U5,lge=tge,cge=rge,X5=oge,Q5=sge,uge=age,J5=ge.forwardRef(({className:e,...t},n)=>O.jsx(lge,{ref:n,className:Pe("border-b",e),...t}));J5.displayName="AccordionItem";const Z5=ge.forwardRef(({className:e,children:t,...n},r)=>O.jsx(cge,{className:"flex",children:O.jsxs(X5,{ref:r,className:Pe("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,O.jsx(hm,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Z5.displayName=X5.displayName;const eN=ge.forwardRef(({className:e,children:t,...n},r)=>O.jsx(Q5,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:O.jsx("div",{className:Pe("pb-4 pt-0",e),children:t})}));eN.displayName=Q5.displayName;const tN="Radio",[dge,nN]=Gn(tN),[fge,hge]=dge(tN),pge=m.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:s,value:a="on",onCheck:l,...c}=e,[u,f]=m.useState(null),p=ft(t,b=>f(b)),g=m.useRef(!1),v=u?!!u.closest("form"):!0;return m.createElement(fge,{scope:n,checked:o,disabled:s},m.createElement(Qe.button,fe({type:"button",role:"radio","aria-checked":o,"data-state":rN(o),"data-disabled":s?"":void 0,disabled:s,value:a},c,{ref:p,onClick:De(e.onClick,b=>{o||l==null||l(),v&&(g.current=b.isPropagationStopped(),g.current||b.stopPropagation())})})),v&&m.createElement(vge,{control:u,bubbles:!g.current,name:r,value:a,checked:o,required:i,disabled:s,style:{transform:"translateX(-100%)"}}))}),gge="RadioIndicator",mge=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=hge(gge,n);return m.createElement(Mn,{present:r||i.checked},m.createElement(Qe.span,fe({"data-state":rN(i.checked),"data-disabled":i.disabled?"":void 0},o,{ref:t})))}),vge=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=Sm(n),a=mm(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const p=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(p)}},[s,n,r]),m.createElement("input",fe({type:"radio","aria-hidden":!0,defaultChecked:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function rN(e){return e?"checked":"unchecked"}const bge=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],oN="RadioGroup",[yge,dme]=Gn(oN,[Gc,nN]),iN=Gc(),sN=nN(),[xge,wge]=yge(oN),_ge=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:s=!1,disabled:a=!1,orientation:l,dir:c,loop:u=!0,onValueChange:f,...p}=e,g=iN(n),v=ml(c),[b,x]=ur({prop:i,defaultProp:o,onChange:f});return m.createElement(xge,{scope:n,name:r,required:s,disabled:a,value:b,onValueChange:x},m.createElement(Jx,fe({asChild:!0},g,{orientation:l,dir:v,loop:u}),m.createElement(Qe.div,fe({role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:v},p,{ref:t}))))}),Sge="RadioGroupItem",Cge=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=wge(Sge,n),s=i.disabled||r,a=iN(n),l=sN(n),c=m.useRef(null),u=ft(t,c),f=i.value===o.value,p=m.useRef(!1);return m.useEffect(()=>{const g=b=>{bge.includes(b.key)&&(p.current=!0)},v=()=>p.current=!1;return document.addEventListener("keydown",g),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",g),document.removeEventListener("keyup",v)}},[]),m.createElement(Zx,fe({asChild:!0},a,{focusable:!s,active:f}),m.createElement(pge,fe({disabled:s,required:i.required,checked:f},l,o,{name:i.name,ref:u,onCheck:()=>i.onValueChange(o.value),onKeyDown:De(g=>{g.key==="Enter"&&g.preventDefault()}),onFocus:De(o.onFocus,()=>{var g;p.current&&((g=c.current)===null||g===void 0||g.click())})})))}),Ege=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=sN(n);return m.createElement(mge,fe({},o,r,{ref:t}))}),aN=_ge,lN=Cge,Rge=Ege,cN=ge.forwardRef(({className:e,...t},n)=>O.jsx(aN,{className:Pe("grid gap-2",e),...t,ref:n}));cN.displayName=aN.displayName;const uN=ge.forwardRef(({className:e,...t},n)=>O.jsx(lN,{ref:n,className:Pe("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:O.jsx(Rge,{className:"flex items-center justify-center",children:O.jsx(L$,{className:"h-2.5 w-2.5 fill-current text-current"})})}));uN.displayName=lN.displayName;var Oge=Object.defineProperty,Pge=(e,t,n)=>t in e?Oge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Dp=(e,t,n)=>(Pge(e,typeof t!="symbol"?t+"":t,n),n);const Tge={stringify:e=>e,parse:e=>e},Dge={stringify:e=>`${e}`,parse:e=>parseFloat(e)},$ge={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},kge={stringify:e=>e.name,parse:(e,t)=>{const n=(()=>{if(typeof window<"u"&&e in window)return window[e];if(typeof global<"u"&&e in global)return global[e]})();return typeof n=="function"?n.bind(t):void 0}},Mge={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},B0={string:Tge,number:Dge,boolean:$ge,function:kge,json:Mge},V0=Symbol.for("r2wc.render"),$p=Symbol.for("r2wc.connected"),ka=Symbol.for("r2wc.context"),As=Symbol.for("r2wc.props");function Age(e,t,n){var r,o,i;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]);const s=(Array.isArray(t.props)?t.props.slice():Object.keys(t.props)).filter(f=>f!=="container"),a={},l={},c={};for(const f of s){a[f]=Array.isArray(t.props)?"string":t.props[f];const p=Ige(f);l[f]=p,c[p]=f}class u extends HTMLElement{constructor(){super(),Dp(this,r,!0),Dp(this,o),Dp(this,i,{}),Dp(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[As].container=this.container;for(const p of s){const g=l[p],v=this.getAttribute(g),b=a[p],x=B0[b];v&&x!=null&&x.parse&&(this[As][p]=x.parse(v,this))}}static get observedAttributes(){return Object.keys(c)}connectedCallback(){this[$p]=!0,this[V0]()}disconnectedCallback(){this[$p]=!1,this[ka]&&n.unmount(this[ka]),delete this[ka]}attributeChangedCallback(p,g,v){const b=c[p],x=a[b],w=B0[x];b in a&&w!=null&&w.parse&&(this[As][b]=w.parse(v,this),this[V0]())}[(r=$p,o=ka,i=As,V0)](){this[$p]&&(this[ka]?n.update(this[ka],this[As]):this[ka]=n.mount(this.container,e,this[As]))}}for(const f of s){const p=l[f],g=a[f];Object.defineProperty(u.prototype,f,{enumerable:!0,configurable:!0,get(){return this[As][f]},set(v){this[As][f]=v;const b=B0[g];if(b!=null&&b.stringify){const x=b.stringify(v);this.getAttribute(p)!==x&&this.setAttribute(p,x)}}})}return u}function Ige(e=""){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Nge(e,t,n){const r=Z0(e),o=m.createElement(t,n);return r.render(o),{root:r,ReactComponent:t}}function Lge({root:e,ReactComponent:t},n){const r=m.createElement(t,n);e.render(r)}function Fge({root:e}){e.unmount()}function zge(e,t={}){return Age(e,t,{mount:Nge,update:Lge,unmount:Fge})}const jge={id:"string",version:"string",authToken:"json",currentTheme:"string",customCards:"json",customStyle:"json",onChartElementClicked:"function",onEvent:"function",onSave:"function",LoadingComponent:"function",ErrorComponent:"function",showAssistant:"boolean"},Bge=zge(NI,{props:jge});exports.$57acba87d6e25586$export$ccf8d8d7bbf3c2cc=pA;exports.$a093c7e1ec25a057$export$8c610744efcf8a1d=nk;exports.Accordion=uge;exports.AccordionContent=eN;exports.AccordionItem=J5;exports.AccordionTrigger=Z5;exports.BOOLEAN_DATA_TYPES=Wx;exports.Bot=qy;exports.Button=yr;exports.Calendar=I$;exports.Card=Yx;exports.CardContent=qg;exports.CardDescription=Kx;exports.CardFooter=Xx;exports.CardHeader=Ug;exports.CardTitle=yf;exports.ChartJsVisual=Hw;exports.Check=Rf;exports.CheckIcon=$$;exports.Checkbox=T5;exports.ChevronDown=hm;exports.ClipboardCopyIcon=pY;exports.ColorFormat=cM;exports.Cross2Icon=k$;exports.DATE_DATA_TYPES=mf;exports.Dashboard=NI;exports.DashboardPanel=ST;exports.DashboardTabs=AI;exports.DashboardWC=Bge;exports.Dialog=Kfe;exports.DialogContent=w5;exports.DialogDescription=E5;exports.DialogFooter=S5;exports.DialogHeader=_5;exports.DialogTitle=C5;exports.DialogTrigger=Xfe;exports.DropdownMenu=yfe;exports.DropdownMenuContent=i5;exports.DropdownMenuLabel=a5;exports.DropdownMenuRadioGroup=wfe;exports.DropdownMenuRadioItem=s5;exports.DropdownMenuSeparator=l5;exports.DropdownMenuTrigger=xfe;exports.Editable=na;exports.EditorAside=$5;exports.EditorMain=k5;exports.EditorPanel=D5;exports.Ft=Ipe;exports.HoverCard=d1;exports.HoverCardContent=xm;exports.HoverCardTrigger=f1;exports.InfoCircledIcon=SY;exports.Input=dc;exports.Jt=yhe;exports.KPICard=lk;exports.LOCALE_CURRENCY_PAIRS=ey;exports.Label=Un;exports.LoaderCircle=Gw;exports.Markdown=hI;exports.NUMBER_DATA_TYPES=$c;exports.PYTHON_DEFAULT_CODE=aT;exports.PaperPlaneIcon=M$;exports.PlayIcon=RY;exports.Plus=F$;exports.Popover=Dm;exports.PopoverContent=$f;exports.PopoverTrigger=$m;exports.RadioGroup=cN;exports.RadioGroupItem=uN;exports.ResizableHandle=tde;exports.ResizablePanel=kx;exports.ResizablePanelGroup=MI;exports.ScrollArea=X1;exports.ScrollBar=jm;exports.Select=Ls;exports.SelectContent=Ji;exports.SelectGroup=nc;exports.SelectItem=Wn;exports.SelectLabel=Fa;exports.SelectSeparator=Sg;exports.SelectTrigger=Qi;exports.SelectValue=Fs;exports.SemaphorContextProvider=dk;exports.SemaphorQueryClient=ck;exports.Separator=km;exports.Settings=Yw;exports.SliderIcon=PY;exports.Switch=OA;exports.TEXT_DATA_TYPES=Vg;exports.Table=z$;exports.Table$1=h1;exports.TableBody=g1;exports.TableCell=wg;exports.TableHead=m1;exports.TableHeader=p1;exports.TableRow=ld;exports.TableVisual=dM;exports.Tabs=IT;exports.TabsContent=tw;exports.TabsList=NT;exports.TabsTrigger=LT;exports.Te=Dhe;exports.TextCard=vM;exports.Textarea=E1;exports.Toggle=C1;exports.Tooltip=ik;exports.TooltipContent=i1;exports.TooltipTrigger=sk;exports.TriangleDownIcon=Ww;exports.TriangleUpIcon=Uw;exports.UXProvider=II;exports.X=Kw;exports._=os;exports.cleanCard=c5;exports.cn=Pe;exports.copyToClipboard=e8;exports.createChartConfig=a1;exports.createLucideIcon=Dn;exports.createSqlGenConfig=$8;exports.de=B5;exports.flexRender=rx;exports.fmt=Ux;exports.getBookmarkKey=u5;exports.getCanvasBackgroundColor=gd;exports.getColumnDataType=k8;exports.getContrastColor=md;exports.getCoreRowModel=Rk;exports.getDashbaordStateWithoutData=Rfe;exports.getDefaultFilterSql=Foe;exports.getFilterValueType=Zp;exports.getKeys=ar;exports.getNumberAxis=s1;exports.getPaginationRowModel=Pk;exports.getQualifiedTableName=cT;exports.getRequest=Z9;exports.getSortedRowModel=Ok;exports.getSql=D8;exports.isColumnInSqlGen=M8;exports.jsxRuntimeExports=O;exports.pivotData=gg;exports.postRequest=gf;exports.resolveBaseQuery=Y2;exports.resolveDataType=vd;exports.titleCase=n8;exports.useCard=UX;exports.useDashboardActions=Ci;exports.useDashboardCard=l1;exports.useDashboardStore=Ie;exports.useEditorActions=fm;exports.useEditorStore=$r;exports.useQuery=bf;exports.useReactTable=Tk;exports.useSemaphorContext=fa;exports.useTheme=wT;exports.v4=dl;
|