@chaibuilder/sdk 1.3.0 → 1.3.2

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/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "author": "Suraj Air",
6
6
  "license": "BSD-3-Clause",
7
7
  "homepage": "https://chaibuilder.com",
8
- "version": "1.3.0",
8
+ "version": "1.3.2",
9
9
  "type": "module",
10
10
  "repository": {
11
11
  "type": "git",
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-BYECrxsp.cjs"),k=require("@monaco-editor/react"),C=require("./context-menu-DfAXjmc8.cjs"),E=require("react-i18next"),i=require("react"),l=require("./index-C9LOYt3W.cjs"),R=require("@radix-ui/react-icons"),g=require("@react-hookz/web"),u=o=>{const n=document.createElement("div");return n.innerHTML=o,n.innerHTML};function v(){const{t:o}=E.useTranslation(),[n,d]=i.useState(!1),[c,x]=i.useState(""),[t,r]=l.useCodeEditor(),[a]=l.useSelectedBlockIds(),m=l.useUpdateBlocksProps(),p=l.useUpdateBlocksPropsRealtime(),j=g.useThrottledCallback(s=>{const b=u(s);p([t.blockId],{[t.blockProp]:b})},[],300),f=i.useCallback(()=>{if(n){const s=u(c);m([t.blockId],{[t.blockProp]:s})}},[n,c]);i.useEffect(()=>{a.includes(t==null?void 0:t.blockId)||(f(),r(null))},[a]);const h=()=>{r(null)};return e.jsxRuntimeExports.jsxs("div",{className:"h-full rounded-t-lg border-t-4 border-black bg-black text-white",children:[e.jsxRuntimeExports.jsx("button",{onClick:h,className:"fixed inset-0 z-[100000] cursor-default bg-gray-400/20"}),e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100001] h-full w-full flex-col gap-y-1",children:[e.jsxRuntimeExports.jsxs("div",{className:"-mt-1 flex items-center justify-between px-2 py-2",children:[e.jsxRuntimeExports.jsxs("h3",{className:"space-x-3 text-sm font-semibold",children:[e.jsxRuntimeExports.jsx("span",{children:o("HTML Code Editor |")}),e.jsxRuntimeExports.jsx("span",{className:"text-xs text-gray-400",children:o("Scripts will be only executed in preview and live mode.")})]}),e.jsxRuntimeExports.jsx("div",{className:"flex gap-x-2",children:e.jsxRuntimeExports.jsx(C.Button,{onClick:()=>r(null),size:"sm",variant:"destructive",className:"h-6 w-fit",children:e.jsxRuntimeExports.jsx(R.Cross2Icon,{})})})]}),e.jsxRuntimeExports.jsx(k,{onMount:s=>{s.setValue(t.initialCode)},onChange:s=>{d(!0),x(s),j(s)},height:"100%",defaultLanguage:"html",theme:"vs-dark",defaultValue:"",options:{minimap:{enabled:!1}}})]})]})}exports.default=v;
@@ -1,77 +0,0 @@
1
- import { j as e } from "./jsx-runtime-DGlMoOmv.js";
2
- import k from "@monaco-editor/react";
3
- import { B as C } from "./context-menu-BbqLeYFX.js";
4
- import { useTranslation as j } from "react-i18next";
5
- import { useState as r, useCallback as v, useEffect as g } from "react";
6
- import { u as y, a as N, b as T, c as E } from "./index-CcLk7_o6.js";
7
- import { Cross2Icon as w } from "@radix-ui/react-icons";
8
- import { useThrottledCallback as B } from "@react-hookz/web";
9
- const c = (l) => {
10
- const o = document.createElement("div");
11
- return o.innerHTML = l, o.innerHTML;
12
- };
13
- function U() {
14
- const { t: l } = j(), [o, d] = r(!1), [n, m] = r(""), [t, a] = y(), [i] = N(), u = T(), p = E(), f = B(
15
- (s) => {
16
- const b = c(s);
17
- p([t.blockId], { [t.blockProp]: b });
18
- },
19
- [],
20
- 300
21
- ), x = v(() => {
22
- if (o) {
23
- const s = c(n);
24
- u([t.blockId], { [t.blockProp]: s });
25
- }
26
- }, [o, n]);
27
- g(() => {
28
- i.includes(t == null ? void 0 : t.blockId) || (x(), a(null));
29
- }, [i]);
30
- const h = () => {
31
- a(null);
32
- };
33
- return /* @__PURE__ */ e.jsxs("div", { className: "h-full rounded-t-lg border-t-4 border-black bg-black text-white", children: [
34
- /* @__PURE__ */ e.jsx("button", { onClick: h, className: "fixed inset-0 z-[100000] cursor-default bg-gray-400/20" }),
35
- /* @__PURE__ */ e.jsxs("div", { className: "relative z-[100001] h-full w-full flex-col gap-y-1", children: [
36
- /* @__PURE__ */ e.jsxs("div", { className: "-mt-1 flex items-center justify-between px-2 py-2", children: [
37
- /* @__PURE__ */ e.jsxs("h3", { className: "space-x-3 text-sm font-semibold", children: [
38
- /* @__PURE__ */ e.jsx("span", { children: l("HTML Code Editor |") }),
39
- /* @__PURE__ */ e.jsx("span", { className: "text-xs text-gray-400", children: l("Scripts will be only executed in preview and live mode.") })
40
- ] }),
41
- /* @__PURE__ */ e.jsx("div", { className: "flex gap-x-2", children: /* @__PURE__ */ e.jsx(
42
- C,
43
- {
44
- onClick: () => a(null),
45
- size: "sm",
46
- variant: "destructive",
47
- className: "h-6 w-fit",
48
- children: /* @__PURE__ */ e.jsx(w, {})
49
- }
50
- ) })
51
- ] }),
52
- /* @__PURE__ */ e.jsx(
53
- k,
54
- {
55
- onMount: (s) => {
56
- s.setValue(t.initialCode);
57
- },
58
- onChange: (s) => {
59
- d(!0), m(s), f(s);
60
- },
61
- height: "100%",
62
- defaultLanguage: "html",
63
- theme: "vs-dark",
64
- defaultValue: "",
65
- options: {
66
- minimap: {
67
- enabled: !1
68
- }
69
- }
70
- }
71
- )
72
- ] })
73
- ] });
74
- }
75
- export {
76
- U as default
77
- };
@@ -1,113 +0,0 @@
1
- import { j as e } from "./jsx-runtime-DGlMoOmv.js";
2
- import c, { useMemo as w, Suspense as x } from "react";
3
- import { B as p, a6 as C, a7 as S, a8 as y, a9 as k, aq as m, al as g } from "./context-menu-BbqLeYFX.js";
4
- import { e as A, F as D, d as i, f as P, g as B, L as d, h as f, i as E } from "./index-CcLk7_o6.js";
5
- import { useTranslation as v } from "react-i18next";
6
- import { c as N } from "./iconBase-DHfFLkem.js";
7
- import { EyeOpenIcon as L, ChevronDownIcon as M } from "@radix-ui/react-icons";
8
- import { forEach as I, uniq as G, get as u, isEmpty as j, map as V } from "lodash-es";
9
- import "@chaibuilder/runtime";
10
- const F = () => {
11
- const { savePage: r, saveState: t } = A(), { t: a } = v(), n = /* @__PURE__ */ e.jsxs(
12
- p,
13
- {
14
- disabled: t === "SAVING",
15
- onClick: (s) => {
16
- s.preventDefault(), r();
17
- },
18
- className: N(
19
- "flex h-auto w-fit items-center gap-x-2 p-1 px-2",
20
- // UNSAVED sate
21
- "bg-gray-200 text-gray-500 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-400",
22
- {
23
- "animate-pulse bg-gray-300 text-gray-900": t === "SAVING",
24
- "bg-green-500 text-white hover:bg-green-600 hover:text-white dark:bg-green-600 dark:text-white": t === "SAVED"
25
- }
26
- ),
27
- size: "sm",
28
- variant: "outline",
29
- children: [
30
- /* @__PURE__ */ e.jsx(D, { className: "text-sm text-white" }),
31
- /* @__PURE__ */ e.jsx("span", { className: "text-sm", children: a(t === "SAVING" ? "Saving" : t === "SAVED" ? "Saved" : "Unsaved") })
32
- ]
33
- }
34
- );
35
- return /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: n });
36
- }, z = function() {
37
- const t = i("previewComponent"), [, a] = P(), { t: n } = v();
38
- return t ? /* @__PURE__ */ e.jsxs(
39
- p,
40
- {
41
- onClick: (s) => {
42
- s.preventDefault(), a(!0);
43
- },
44
- className: "flex h-auto w-fit items-center gap-x-2 p-1 px-2",
45
- size: "sm",
46
- variant: "outline",
47
- children: [
48
- /* @__PURE__ */ e.jsx(L, { className: "text-xs" }),
49
- /* @__PURE__ */ e.jsx("span", { className: "text-sm", children: n("Preview") })
50
- ]
51
- }
52
- ) : null;
53
- }, T = () => {
54
- const { fallbackLang: r, languages: t, selectedLang: a, setSelectedLang: n } = B(), s = (a == null ? void 0 : a.length) > 0 ? a : r, b = w(() => {
55
- const l = [];
56
- return I(G([r, ...t]), (o) => {
57
- const h = u(d, o);
58
- h && l.push({ key: o, value: h, default: o === r });
59
- }), l;
60
- }, [r, t]);
61
- return j(t) && s === "en" ? null : j(t) && s !== "en" ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-1 text-sm text-blue-500 hover:text-blue-600", children: [
62
- /* @__PURE__ */ e.jsx(f, { className: "h-4 w-4" }),
63
- u(d, s)
64
- ] }) : /* @__PURE__ */ e.jsxs(C, { children: [
65
- /* @__PURE__ */ e.jsx(S, { asChild: !0, children: /* @__PURE__ */ e.jsxs(p, { size: "sm", variant: "outline", className: "flex items-center gap-x-1 text-blue-500 hover:text-blue-600", children: [
66
- /* @__PURE__ */ e.jsx(f, { className: "h-4 w-4" }),
67
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
68
- /* @__PURE__ */ e.jsxs("div", { children: [
69
- " ",
70
- u(d, s)
71
- ] }),
72
- /* @__PURE__ */ e.jsx(M, { className: "h-4 w-4" })
73
- ] })
74
- ] }) }),
75
- /* @__PURE__ */ e.jsx(y, { className: "border-border", children: V(b, (l) => /* @__PURE__ */ e.jsxs(
76
- k,
77
- {
78
- className: N(
79
- "flex cursor-pointer items-center text-sm",
80
- l.key === s && "!bg-blue-500 text-white hover:!text-white"
81
- ),
82
- onClick: () => n(l.key),
83
- children: [
84
- /* @__PURE__ */ e.jsx("div", { children: l.value }),
85
- l.key === r ? /* @__PURE__ */ e.jsx(E, { className: "ml-2 h-4 w-4 text-yellow-400" }) : null
86
- ]
87
- }
88
- )) })
89
- ] });
90
- }, W = () => {
91
- const r = i("topBarComponents.left", []), t = i("topBarComponents.center", []), a = i("topBarComponents.right", []), n = i("editable", !0);
92
- return /* @__PURE__ */ e.jsxs("div", { className: "flex h-14 items-center justify-between px-2", children: [
93
- /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2 font-bold", children: c.Children.toArray(
94
- r.map((s) => /* @__PURE__ */ e.jsx(x, { fallback: /* @__PURE__ */ e.jsx(m, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(s, {}) }))
95
- ) }) }),
96
- /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2", children: c.Children.toArray(
97
- t.map((s) => /* @__PURE__ */ e.jsx(x, { fallback: /* @__PURE__ */ e.jsx(m, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(s, {}) }))
98
- ) }),
99
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-1", children: [
100
- /* @__PURE__ */ e.jsx(T, {}),
101
- /* @__PURE__ */ e.jsx(g, { orientation: "vertical" }),
102
- /* @__PURE__ */ e.jsx(z, {}),
103
- /* @__PURE__ */ e.jsx(g, { orientation: "vertical" }),
104
- n ? /* @__PURE__ */ e.jsx(F, {}) : null,
105
- c.Children.toArray(
106
- a.map((s) => /* @__PURE__ */ e.jsx(x, { fallback: /* @__PURE__ */ e.jsx(m, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(s, {}) }))
107
- )
108
- ] })
109
- ] });
110
- };
111
- export {
112
- W as default
113
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-BYECrxsp.cjs"),u=require("react"),x=require("./context-menu-DfAXjmc8.cjs"),s=require("./index-C9LOYt3W.cjs"),p=require("react-i18next"),j=require("./iconBase-Cn2BsTrq.cjs"),d=require("@radix-ui/react-icons"),a=require("lodash-es");require("@chaibuilder/runtime");const E=()=>{const{savePage:i,saveState:n}=s.useSavePage(),{t:r}=p.useTranslation(),o=e.jsxRuntimeExports.jsxs(x.Button,{disabled:n==="SAVING",onClick:t=>{t.preventDefault(),i()},className:j.cn("flex h-auto w-fit items-center gap-x-2 p-1 px-2","bg-gray-200 text-gray-500 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-400",{"animate-pulse bg-gray-300 text-gray-900":n==="SAVING","bg-green-500 text-white hover:bg-green-600 hover:text-white dark:bg-green-600 dark:text-white":n==="SAVED"}),size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx(s.FaCheck,{className:"text-sm text-white"}),e.jsxRuntimeExports.jsx("span",{className:"text-sm",children:r(n==="SAVING"?"Saving":n==="SAVED"?"Saved":"Unsaved")})]});return e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:o})},g=function(){const n=s.useBuilderProp("previewComponent"),[,r]=s.usePreviewMode(),{t:o}=p.useTranslation();return n?e.jsxRuntimeExports.jsxs(x.Button,{onClick:t=>{t.preventDefault(),r(!0)},className:"flex h-auto w-fit items-center gap-x-2 p-1 px-2",size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx(d.EyeOpenIcon,{className:"text-xs"}),e.jsxRuntimeExports.jsx("span",{className:"text-sm",children:o("Preview")})]}):null},v=()=>{const{fallbackLang:i,languages:n,selectedLang:r,setSelectedLang:o}=s.useLanguages(),t=(r==null?void 0:r.length)>0?r:i,h=u.useMemo(()=>{const l=[];return a.forEach(a.uniq([i,...n]),c=>{const m=a.get(s.LANGUAGES,c);m&&l.push({key:c,value:m,default:c===i})}),l},[i,n]);return a.isEmpty(n)&&t==="en"?null:a.isEmpty(n)&&t!=="en"?e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-1 text-sm text-blue-500 hover:text-blue-600",children:[e.jsxRuntimeExports.jsx(s.FaLanguage,{className:"h-4 w-4"}),a.get(s.LANGUAGES,t)]}):e.jsxRuntimeExports.jsxs(x.DropdownMenu,{children:[e.jsxRuntimeExports.jsx(x.DropdownMenuTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs(x.Button,{size:"sm",variant:"outline",className:"flex items-center gap-x-1 text-blue-500 hover:text-blue-600",children:[e.jsxRuntimeExports.jsx(s.FaLanguage,{className:"h-4 w-4"}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxRuntimeExports.jsxs("div",{children:[" ",a.get(s.LANGUAGES,t)]}),e.jsxRuntimeExports.jsx(d.ChevronDownIcon,{className:"h-4 w-4"})]})]})}),e.jsxRuntimeExports.jsx(x.DropdownMenuContent,{className:"border-border",children:a.map(h,l=>e.jsxRuntimeExports.jsxs(x.DropdownMenuItem,{className:j.cn("flex cursor-pointer items-center text-sm",l.key===t&&"!bg-blue-500 text-white hover:!text-white"),onClick:()=>o(l.key),children:[e.jsxRuntimeExports.jsx("div",{children:l.value}),l.key===i?e.jsxRuntimeExports.jsx(s.FaStar,{className:"ml-2 h-4 w-4 text-yellow-400"}):null]}))})]})},R=()=>{const i=s.useBuilderProp("topBarComponents.left",[]),n=s.useBuilderProp("topBarComponents.center",[]),r=s.useBuilderProp("topBarComponents.right",[]),o=s.useBuilderProp("editable",!0);return e.jsxRuntimeExports.jsxs("div",{className:"flex h-14 items-center justify-between px-2",children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2 font-bold",children:u.Children.toArray(i.map(t=>e.jsxRuntimeExports.jsx(u.Suspense,{fallback:e.jsxRuntimeExports.jsx(x.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:u.Children.toArray(n.map(t=>e.jsxRuntimeExports.jsx(u.Suspense,{fallback:e.jsxRuntimeExports.jsx(x.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxRuntimeExports.jsx(v,{}),e.jsxRuntimeExports.jsx(x.Separator,{orientation:"vertical"}),e.jsxRuntimeExports.jsx(g,{}),e.jsxRuntimeExports.jsx(x.Separator,{orientation:"vertical"}),o?e.jsxRuntimeExports.jsx(E,{}):null,u.Children.toArray(r.map(t=>e.jsxRuntimeExports.jsx(u.Suspense,{fallback:e.jsxRuntimeExports.jsx(x.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))]})]})};exports.default=R;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-BYECrxsp.cjs"),l=require("react"),p=require("lodash-es"),A=require("unsplash-js"),g=require("./context-menu-DfAXjmc8.cjs"),_=require("react-i18next"),v=require("./index-C9LOYt3W.cjs"),T=require("@react-hookz/web"),B=require("lucide-react"),b=async(h,f)=>new Promise((r,n)=>{A.createApi({accessKey:f}).search.getPhotos(h).then(o=>{r(o)}).catch(o=>n(o))}),L=({isModalView:h,onSelect:f})=>{const r=v.useBuilderProp("unsplashAccessKey",""),[n,j]=l.useState([]),[o,y]=l.useState(0),[i,w]=l.useState(),[c,k]=l.useState(),[C,E]=l.useState(0),[d,P]=T.useDebouncedState("",1e3),[m,u]=l.useState(!1),{t:R}=_.useTranslation(),I=async s=>{if(p.isEmpty(d))return;let a=o+1;u(!0),y(a);const x={query:d,page:a};i&&(x.orientation=i),c&&(x.color=c),b(x,r).then(t=>{var N,q,S;j(a===1?((N=t==null?void 0:t.response)==null?void 0:N.results)||[]:[...n,...((q=t==null?void 0:t.response)==null?void 0:q.results)||[]]),E((S=t==null?void 0:t.response)==null?void 0:S.total_pages),u(!1)}).catch(()=>{u(!1)})};return l.useEffect(()=>{if(!p.isEmpty(d)&&r){u(!0);const s={query:d,page:1};i&&(s.orientation=i),c&&(s.color=c),y(1),b(s,r).then(a=>{var x,t;j(((x=a==null?void 0:a.response)==null?void 0:x.results)||[]),E((t=a==null?void 0:a.response)==null?void 0:t.total_pages),u(!1)}).catch(()=>{u(!1)})}},[i,c,d,r]),p.isEmpty(r)?e.jsxRuntimeExports.jsx("div",{className:"flex h-full flex-col items-center justify-center",children:e.jsxRuntimeExports.jsxs("p",{className:"max-w-3xl text-center text-gray-500",children:["To enable Unsplash, kindly provide your",e.jsxRuntimeExports.jsx("a",{href:"https://unsplash.com/documentation#public-authentication",className:"px-1 underline hover:text-blue-400",target:"_blank",rel:"noopener noreferrer",children:"Unsplash Access Key"})]})}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("form",{className:"flex items-center gap-x-2 rounded-md border border-border bg-background p-px",children:[e.jsxRuntimeExports.jsx(g.Input,{type:"text",name:"query",className:"text-foreground",placeholder:'Try "dog" or "apple"',onChange:s=>P(s.target.value)}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(v.ChaiSelect,{className:"w-40",placeholder:R("Orientation"),options:[{value:"",label:"All"},{value:"landscape",label:"Landscape"},{value:"portrait",label:"Portrait"},{value:"squarish",label:"Square"}],defaultValue:i,onValueChange:s=>w(s)})}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(v.ChaiSelect,{placeholder:R("Color"),options:[{value:"",label:"All"},{value:"black_and_white",label:"Black and White"},{value:"black",label:"Black"},{value:"white",label:"White"},{value:"night",label:"Night"},{value:"warm",label:"Warm"},{value:"cool",label:"Cool"},{value:"sepia",label:"Sepia"}],defaultValue:c,onValueChange:s=>k(s)})})]}),e.jsxRuntimeExports.jsxs(g.ScrollArea,{className:`h-full ${h&&!p.isEmpty(n)?"-mx-2 flex flex-wrap px-2":"-mx-2 flex flex-col pb-8 pt-2"}`,children:[p.isEmpty(n)&&!m&&e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center py-6",children:[e.jsxRuntimeExports.jsx("div",{className:"font-medium",children:"No Data"}),e.jsxRuntimeExports.jsx("div",{className:"text-sm text-gray-500",children:"Enter query and press enter"})]}),h?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:n.map(s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>f(s.urls.regular),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",alt:s.alt_description,src:s.urls.small})})},s.id))}):n.map(s=>e.jsxRuntimeExports.jsx("div",{className:"w-full px-2 py-1",children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto cursor-pointer transition duration-300 ease-in-out hover:scale-105",alt:s.alt_description,src:s.urls.small})})},s.id)),m&&e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsxRuntimeExports.jsx(B.Loader,{className:"h-6 w-6 animate-spin"}),"  Loading..."]}),!p.isEmpty(n)&&o<C&&!m&&e.jsxRuntimeExports.jsx(g.Button,{size:"sm",variant:"link",className:"w-full",onClick:()=>I(),disabled:m,children:m?"":"Load More"})]})]})};exports.default=L;exports.fetchImage=b;
@@ -1,189 +0,0 @@
1
- import { j as e } from "./jsx-runtime-DGlMoOmv.js";
2
- import { useState as m, useEffect as q } from "react";
3
- import { isEmpty as p } from "lodash-es";
4
- import { createApi as B } from "unsplash-js";
5
- import { I as E, S as L, B as T } from "./context-menu-BbqLeYFX.js";
6
- import { useTranslation as D } from "react-i18next";
7
- import { d as F, C as k } from "./index-CcLk7_o6.js";
8
- import { useDebouncedState as K } from "@react-hookz/web";
9
- import { Loader as U } from "lucide-react";
10
- const C = async (x, g) => new Promise((t, o) => {
11
- B({ accessKey: g }).search.getPhotos(x).then((n) => {
12
- t(n);
13
- }).catch((n) => o(n));
14
- }), J = ({ isModalView: x, onSelect: g }) => {
15
- const t = F("unsplashAccessKey", ""), [o, f] = m([]), [n, v] = m(0), [r, P] = m(), [i, A] = m(), [I, b] = m(0), [h, S] = K("", 1e3), [u, c] = m(!1), { t: j } = D(), _ = async (a) => {
16
- if (p(h)) return;
17
- let l = n + 1;
18
- c(!0), v(l);
19
- const d = { query: h, page: l };
20
- r && (d.orientation = r), i && (d.color = i), C(d, t).then((s) => {
21
- var y, N, w;
22
- f(l === 1 ? ((y = s == null ? void 0 : s.response) == null ? void 0 : y.results) || [] : [...o, ...((N = s == null ? void 0 : s.response) == null ? void 0 : N.results) || []]), b((w = s == null ? void 0 : s.response) == null ? void 0 : w.total_pages), c(!1);
23
- }).catch(() => {
24
- c(!1);
25
- });
26
- };
27
- return q(() => {
28
- if (!p(h) && t) {
29
- c(!0);
30
- const a = { query: h, page: 1 };
31
- r && (a.orientation = r), i && (a.color = i), v(1), C(a, t).then((l) => {
32
- var d, s;
33
- f(((d = l == null ? void 0 : l.response) == null ? void 0 : d.results) || []), b((s = l == null ? void 0 : l.response) == null ? void 0 : s.total_pages), c(!1);
34
- }).catch(() => {
35
- c(!1);
36
- });
37
- }
38
- }, [r, i, h, t]), p(t) ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full flex-col items-center justify-center", children: /* @__PURE__ */ e.jsxs("p", { className: "max-w-3xl text-center text-gray-500", children: [
39
- "To enable Unsplash, kindly provide your",
40
- /* @__PURE__ */ e.jsx(
41
- "a",
42
- {
43
- href: "https://unsplash.com/documentation#public-authentication",
44
- className: "px-1 underline hover:text-blue-400",
45
- target: "_blank",
46
- rel: "noopener noreferrer",
47
- children: "Unsplash Access Key"
48
- }
49
- )
50
- ] }) }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
51
- /* @__PURE__ */ e.jsxs("form", { className: "flex items-center gap-x-2 rounded-md border border-border bg-background p-px", children: [
52
- /* @__PURE__ */ e.jsx(
53
- E,
54
- {
55
- type: "text",
56
- name: "query",
57
- className: "text-foreground",
58
- placeholder: 'Try "dog" or "apple"',
59
- onChange: (a) => S(a.target.value)
60
- }
61
- ),
62
- /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(
63
- k,
64
- {
65
- className: "w-40",
66
- placeholder: j("Orientation"),
67
- options: [
68
- {
69
- value: "",
70
- label: "All"
71
- },
72
- {
73
- value: "landscape",
74
- label: "Landscape"
75
- },
76
- {
77
- value: "portrait",
78
- label: "Portrait"
79
- },
80
- {
81
- value: "squarish",
82
- label: "Square"
83
- }
84
- ],
85
- defaultValue: r,
86
- onValueChange: (a) => P(a)
87
- }
88
- ) }),
89
- /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(
90
- k,
91
- {
92
- placeholder: j("Color"),
93
- options: [
94
- {
95
- value: "",
96
- label: "All"
97
- },
98
- {
99
- value: "black_and_white",
100
- label: "Black and White"
101
- },
102
- {
103
- value: "black",
104
- label: "Black"
105
- },
106
- {
107
- value: "white",
108
- label: "White"
109
- },
110
- {
111
- value: "night",
112
- label: "Night"
113
- },
114
- {
115
- value: "warm",
116
- label: "Warm"
117
- },
118
- {
119
- value: "cool",
120
- label: "Cool"
121
- },
122
- {
123
- value: "sepia",
124
- label: "Sepia"
125
- }
126
- ],
127
- defaultValue: i,
128
- onValueChange: (a) => A(a)
129
- }
130
- ) })
131
- ] }),
132
- /* @__PURE__ */ e.jsxs(
133
- L,
134
- {
135
- className: `h-full ${x && !p(o) ? "-mx-2 flex flex-wrap px-2" : "-mx-2 flex flex-col pb-8 pt-2"}`,
136
- children: [
137
- p(o) && !u && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [
138
- /* @__PURE__ */ e.jsx("div", { className: "font-medium", children: "No Data" }),
139
- /* @__PURE__ */ e.jsx("div", { className: "text-sm text-gray-500", children: "Enter query and press enter" })
140
- ] }),
141
- x ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: o.map((a) => /* @__PURE__ */ e.jsx(
142
- "div",
143
- {
144
- role: "button",
145
- tabIndex: 0,
146
- className: "my-1 flex",
147
- onClick: () => g(a.urls.regular),
148
- children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
149
- "img",
150
- {
151
- className: "h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",
152
- alt: a.alt_description,
153
- src: a.urls.small
154
- }
155
- ) })
156
- },
157
- a.id
158
- )) }) : o.map((a) => /* @__PURE__ */ e.jsx("div", { className: "w-full px-2 py-1", children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
159
- "img",
160
- {
161
- className: "h-auto cursor-pointer transition duration-300 ease-in-out hover:scale-105",
162
- alt: a.alt_description,
163
- src: a.urls.small
164
- }
165
- ) }) }, a.id)),
166
- u && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center py-8", children: [
167
- /* @__PURE__ */ e.jsx(U, { className: "h-6 w-6 animate-spin" }),
168
- "  Loading..."
169
- ] }),
170
- !p(o) && n < I && !u && /* @__PURE__ */ e.jsx(
171
- T,
172
- {
173
- size: "sm",
174
- variant: "link",
175
- className: "w-full",
176
- onClick: () => _(),
177
- disabled: u,
178
- children: u ? "" : "Load More"
179
- }
180
- )
181
- ]
182
- }
183
- )
184
- ] });
185
- };
186
- export {
187
- J as default,
188
- C as fetchImage
189
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-BYECrxsp.cjs"),r=require("react"),i=require("lodash-es"),R=require("jotai"),w=require("./context-menu-DfAXjmc8.cjs"),k=require("react-i18next"),b=require("./index-C9LOYt3W.cjs"),E=require("lucide-react"),S=R.atom([]),q=({isModalView:l,onSelect:x})=>{const{t}=k.useTranslation(),d=b.useBuilderProp("uploadMediaCallback"),c=b.useBuilderProp("fetchMediaCallback"),[n,m]=R.useAtom(S),[y,p]=r.useState(!1),[j,h]=r.useState(!1),[,N]=r.useState(),[f,u]=r.useState("");r.useEffect(()=>{(async()=>{if(!c)return;h(!0);const s=await c();m(s||[]),h(!1)})()},[]);const v=s=>{var a,o;if(u(""),s&&((o=(a=s==null?void 0:s.target)==null?void 0:a.files)==null?void 0:o.length)>0){const g=s.target.files[0];g.type.startsWith("image")?I(g):u(t("Please select an image"))}},I=async s=>{if(d){p(!0);try{const{url:a}=await d(s);x(a),N(void 0);const o=await c();m(o)}catch(a){m([]),u((a==null?void 0:a.message)||"Something went wrong.")}p(!1)}};return e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsxs("label",{htmlFor:l?"upload-in-modal":"upload-in-panel",children:[e.jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center rounded-lg",children:e.jsxRuntimeExports.jsxs("label",{htmlFor:"image-upload",className:"flex w-full cursor-pointer flex-col items-center justify-center rounded-lg border-2 border-dashed border-border",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center pb-6 pt-5",children:[e.jsxRuntimeExports.jsx(E.Upload,{className:"mb-3 h-10 w-10 text-gray-400"}),e.jsxRuntimeExports.jsx("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:e.jsxRuntimeExports.jsx("span",{className:"font-semibold",children:t("Click to upload")})}),e.jsxRuntimeExports.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:t("SVG, PNG, JPG or GIF (Max. 2mb)")})]}),y?e.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-full items-center justify-center",children:[e.jsxRuntimeExports.jsx(E.Loader,{className:"h-6 w-6 animate-spin"}),e.jsxRuntimeExports.jsx("span",{className:"ml-2 text-sm text-gray-500",children:t("Uploading...")})]}):null,f&&e.jsxRuntimeExports.jsx("p",{className:"pb-2 text-xs text-red-500",children:f||t("Something went wrong")})]})}),e.jsxRuntimeExports.jsx("input",{type:"file",id:"image-upload",accept:"image/*",hidden:!0,onChange:v})]}),e.jsxRuntimeExports.jsxs(w.ScrollArea,{className:`-mx-2 flex h-full flex-col pb-8 pt-2 ${l?"px-2":""} pt-2`,children:[i.isEmpty(n)&&j&&e.jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:e.jsxRuntimeExports.jsx("div",{className:"animate-pulse font-medium",children:t("Fetching...")})}),i.isEmpty(n)&&!j&&e.jsxRuntimeExports.jsxs("div",{className:"flex h-full flex-col items-center justify-center text-center",children:[e.jsxRuntimeExports.jsx("div",{className:"mb-4 h-12 rounded-full p-6"}),e.jsxRuntimeExports.jsx("h3",{className:"mb-2 text-sm font-semibold",children:t("No images found")}),e.jsxRuntimeExports.jsx("p",{className:"mb-4 max-w-sm text-muted-foreground",children:t("It looks like you haven't uploaded any images yet. Start by clicking the upload button above.")})]}),l?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:i.map(n,s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>x(s.url),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",alt:s.name,src:s.thumbUrl})})},s.id))}):i.map(n,s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"px-2 py-1",onClick:()=>x(s.url),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto w-full cursor-pointer transition duration-300 ease-in-out hover:scale-105",alt:s.name,src:s.url})})},s.id))]})]})};exports.default=q;
@@ -1,101 +0,0 @@
1
- import { j as e } from "./jsx-runtime-DGlMoOmv.js";
2
- import { useState as n, useEffect as k } from "react";
3
- import { isEmpty as j, map as b } from "lodash-es";
4
- import { atom as F, useAtom as U } from "jotai";
5
- import { S as C } from "./context-menu-BbqLeYFX.js";
6
- import { useTranslation as S } from "react-i18next";
7
- import { d as N } from "./index-CcLk7_o6.js";
8
- import { Upload as E, Loader as G } from "lucide-react";
9
- const P = F([]), $ = ({ isModalView: l, onSelect: i }) => {
10
- const { t } = S(), u = N("uploadMediaCallback"), d = N("fetchMediaCallback"), [r, c] = U(P), [y, x] = n(!1), [f, p] = n(!1), [, v] = n(), [h, m] = n("");
11
- k(() => {
12
- (async () => {
13
- if (!d) return;
14
- p(!0);
15
- const s = await d();
16
- c(s || []), p(!1);
17
- })();
18
- }, []);
19
- const w = (s) => {
20
- var a, o;
21
- if (m(""), s && ((o = (a = s == null ? void 0 : s.target) == null ? void 0 : a.files) == null ? void 0 : o.length) > 0) {
22
- const g = s.target.files[0];
23
- g.type.startsWith("image") ? I(g) : m(t("Please select an image"));
24
- }
25
- }, I = async (s) => {
26
- if (u) {
27
- x(!0);
28
- try {
29
- const { url: a } = await u(s);
30
- i(a), v(void 0);
31
- const o = await d();
32
- c(o);
33
- } catch (a) {
34
- c([]), m((a == null ? void 0 : a.message) || "Something went wrong.");
35
- }
36
- x(!1);
37
- }
38
- };
39
- return /* @__PURE__ */ e.jsxs("div", { children: [
40
- /* @__PURE__ */ e.jsxs("label", { htmlFor: l ? "upload-in-modal" : "upload-in-panel", children: [
41
- /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center rounded-lg", children: /* @__PURE__ */ e.jsxs(
42
- "label",
43
- {
44
- htmlFor: "image-upload",
45
- className: "flex w-full cursor-pointer flex-col items-center justify-center rounded-lg border-2 border-dashed border-border",
46
- children: [
47
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center pb-6 pt-5", children: [
48
- /* @__PURE__ */ e.jsx(E, { className: "mb-3 h-10 w-10 text-gray-400" }),
49
- /* @__PURE__ */ e.jsx("p", { className: "mb-2 text-sm text-gray-500 dark:text-gray-400", children: /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: t("Click to upload") }) }),
50
- /* @__PURE__ */ e.jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: t("SVG, PNG, JPG or GIF (Max. 2mb)") })
51
- ] }),
52
- y ? /* @__PURE__ */ e.jsxs("div", { className: "flex h-full w-full items-center justify-center", children: [
53
- /* @__PURE__ */ e.jsx(G, { className: "h-6 w-6 animate-spin" }),
54
- /* @__PURE__ */ e.jsx("span", { className: "ml-2 text-sm text-gray-500", children: t("Uploading...") })
55
- ] }) : null,
56
- h && /* @__PURE__ */ e.jsx("p", { className: "pb-2 text-xs text-red-500", children: h || t("Something went wrong") })
57
- ]
58
- }
59
- ) }),
60
- /* @__PURE__ */ e.jsx(
61
- "input",
62
- {
63
- type: "file",
64
- id: "image-upload",
65
- accept: "image/*",
66
- hidden: !0,
67
- onChange: w
68
- }
69
- )
70
- ] }),
71
- /* @__PURE__ */ e.jsxs(C, { className: `-mx-2 flex h-full flex-col pb-8 pt-2 ${l ? "px-2" : ""} pt-2`, children: [
72
- j(r) && f && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e.jsx("div", { className: "animate-pulse font-medium", children: t("Fetching...") }) }),
73
- j(r) && !f && /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col items-center justify-center text-center", children: [
74
- /* @__PURE__ */ e.jsx("div", { className: "mb-4 h-12 rounded-full p-6" }),
75
- /* @__PURE__ */ e.jsx("h3", { className: "mb-2 text-sm font-semibold", children: t("No images found") }),
76
- /* @__PURE__ */ e.jsx("p", { className: "mb-4 max-w-sm text-muted-foreground", children: t("It looks like you haven't uploaded any images yet. Start by clicking the upload button above.") })
77
- ] }),
78
- l ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: b(r, (s) => /* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "my-1 flex", onClick: () => i(s.url), children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
79
- "img",
80
- {
81
- className: "h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",
82
- alt: s.name,
83
- src: s.thumbUrl
84
- }
85
- ) }) }, s.id)) }) : b(r, (s) => (
86
- // TODO: Drag and Drop Image to Canvas from Here use `pic.url` for image quality
87
- /* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "px-2 py-1", onClick: () => i(s.url), children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
88
- "img",
89
- {
90
- className: "h-auto w-full cursor-pointer transition duration-300 ease-in-out hover:scale-105",
91
- alt: s.name,
92
- src: s.url
93
- }
94
- ) }) }, s.id)
95
- ))
96
- ] })
97
- ] });
98
- };
99
- export {
100
- $ as default
101
- };
@@ -1 +0,0 @@
1
- "use strict";const a=require("./jsx-runtime-BYECrxsp.cjs"),dt=require("@radix-ui/react-switch"),lt=require("react"),mt=require("@radix-ui/react-accordion"),g=require("@radix-ui/react-icons"),C=require("class-variance-authority"),ct=require("@radix-ui/react-alert-dialog"),pt=require("@radix-ui/react-slot"),ut=require("@radix-ui/react-label"),xt=require("@radix-ui/react-scroll-area"),ft=require("@radix-ui/react-tabs"),gt=require("@radix-ui/react-tooltip"),bt=require("@radix-ui/react-popover"),jt=require("@radix-ui/react-hover-card"),yt=require("@radix-ui/react-select"),ht=require("@radix-ui/react-dropdown-menu"),Nt=require("@radix-ui/react-separator"),Rt=require("@radix-ui/react-toast"),u=require("cmdk"),vt=require("@radix-ui/react-dialog"),wt=require("@radix-ui/react-context-menu"),Ct=require("clsx"),Et=require("tailwind-merge");function c(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const I=c(dt),r=c(lt),j=c(mt),p=c(ct),z=c(ut),b=c(xt),y=c(ft),h=c(gt),R=c(bt),E=c(jt),m=c(yt),i=c(ht),L=c(Nt),f=c(Rt),x=c(vt),d=c(wt),s=(...e)=>Et.twMerge(Ct.clsx(e)),O=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(I.Root,{className:s("peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-slate-900 data-[state=unchecked]:bg-slate-200 dark:focus-visible:ring-slate-800 dark:focus-visible:ring-offset-slate-950 dark:data-[state=checked]:bg-slate-50 dark:data-[state=unchecked]:bg-slate-800",e),...t,ref:o,children:a.jsxRuntimeExports.jsx(I.Thumb,{className:s("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0 dark:bg-slate-950")})}));O.displayName=I.Root.displayName;const T=C.cva("inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),q=r.forwardRef(({className:e,variant:t,size:o,asChild:n=!1,...l},S)=>{const it=n?pt.Slot:"button";return a.jsxRuntimeExports.jsx(it,{className:s(T({variant:t,size:o,className:e})),ref:S,...l})});q.displayName="Button";const Tt=j.Root,V=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(j.Item,{ref:o,className:s("border-b",e),...t}));V.displayName="AccordionItem";const G=r.forwardRef(({className:e,children:t,...o},n)=>a.jsxRuntimeExports.jsx(j.Header,{className:"flex",children:a.jsxRuntimeExports.jsxs(j.Trigger,{ref:n,className:s("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...o,children:[t,o.hideArrow?null:a.jsxRuntimeExports.jsx(g.ChevronDownIcon,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));G.displayName=j.Trigger.displayName;const H=r.forwardRef(({className:e,children:t,...o},n)=>a.jsxRuntimeExports.jsx(j.Content,{ref:n,className:s("text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",e),...o,children:a.jsxRuntimeExports.jsx("div",{className:"pb-4 pt-0",children:t})}));H.displayName=j.Content.displayName;const F=C.cva("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}}),St=({className:e,variant:t,...o})=>a.jsxRuntimeExports.jsx("div",{className:s(F({variant:t}),e),...o}),Dt=p.Root,Mt=p.Trigger,B=({className:e,...t})=>a.jsxRuntimeExports.jsx(p.Portal,{className:s(e),...t});B.displayName=p.Portal.displayName;const U=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(p.Overlay,{className:s("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,ref:o}));U.displayName=p.Overlay.displayName;const Q=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsxs(B,{children:[a.jsxRuntimeExports.jsx(U,{}),a.jsxRuntimeExports.jsx(p.Content,{ref:o,className:s("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 md:w-full",e),...t})]}));Q.displayName=p.Content.displayName;const X=({className:e,...t})=>a.jsxRuntimeExports.jsx("div",{className:s("flex flex-col space-y-2 text-center sm:text-left",e),...t});X.displayName="AlertDialogHeader";const Y=({className:e,...t})=>a.jsxRuntimeExports.jsx("div",{className:s("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Y.displayName="AlertDialogFooter";const J=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(p.Title,{ref:o,className:s("text-lg font-semibold",e),...t}));J.displayName=p.Title.displayName;const K=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(p.Description,{ref:o,className:s("text-sm text-muted-foreground",e),...t}));K.displayName=p.Description.displayName;const W=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(p.Action,{ref:o,className:s(T(),e),...t}));W.displayName=p.Action.displayName;const Z=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(p.Cancel,{ref:o,className:s(T({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Z.displayName=p.Cancel.displayName;const $=x.Root,It=x.Trigger,ee=({className:e,...t})=>a.jsxRuntimeExports.jsx(x.Portal,{className:s(e),...t});ee.displayName=x.Portal.displayName;const te=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(x.Overlay,{ref:o,className:s("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}));te.displayName=x.Overlay.displayName;const k=r.forwardRef(({className:e,children:t,...o},n)=>a.jsxRuntimeExports.jsxs(ee,{children:[a.jsxRuntimeExports.jsx(te,{}),a.jsxRuntimeExports.jsxs(x.Content,{ref:n,className:s("fixed left-[50%] top-[50%] z-[999] 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 md:w-full",e),...o,children:[t,a.jsxRuntimeExports.jsxs(x.Close,{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:[a.jsxRuntimeExports.jsx(g.Cross2Icon,{className:"h-4 w-4"}),a.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));k.displayName=x.Content.displayName;const oe=({className:e,...t})=>a.jsxRuntimeExports.jsx("div",{className:s("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});oe.displayName="DialogHeader";const ae=({className:e,...t})=>a.jsxRuntimeExports.jsx("div",{className:s("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ae.displayName="DialogFooter";const se=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(x.Title,{ref:o,className:s("text-lg font-semibold leading-none tracking-tight",e),...t}));se.displayName=x.Title.displayName;const re=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(x.Description,{ref:o,className:s("text-sm text-muted-foreground",e),...t}));re.displayName=x.Description.displayName;const ne=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx("div",{ref:o,className:s("rounded-xl border bg-card text-card-foreground shadow",e),...t}));ne.displayName="Card";const ie=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx("div",{ref:o,className:s("flex flex-col space-y-1.5 p-6",e),...t}));ie.displayName="CardHeader";const de=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx("h3",{ref:o,className:s("font-semibold leading-none tracking-tight",e),...t}));de.displayName="CardTitle";const le=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx("p",{ref:o,className:s("text-sm text-muted-foreground",e),...t}));le.displayName="CardDescription";const me=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx("div",{ref:o,className:s("p-6 pt-0",e),...t}));me.displayName="CardContent";const ce=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx("div",{ref:o,className:s(" flex items-center p-6 pt-0",e),...t}));ce.displayName="CardFooter";const pe=r.forwardRef(({className:e,type:t,...o},n)=>a.jsxRuntimeExports.jsx("input",{type:t,className:s("flex h-9 w-full rounded-md border border-border bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...o,autoCapitalize:"off",autoCorrect:"off",spellCheck:"false"}));pe.displayName="Input";const kt=C.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ue=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(z.Root,{ref:o,className:s(kt(),e),...t}));ue.displayName=z.Root.displayName;const xe=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx("textarea",{className:s("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...t,autoCapitalize:"off",autoCorrect:"off",spellCheck:"false"}));xe.displayName="Textarea";const fe=r.forwardRef(({className:e,children:t,...o},n)=>a.jsxRuntimeExports.jsxs(b.Root,{ref:n,className:s("relative overflow-hidden",e),...o,children:[a.jsxRuntimeExports.jsx(b.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),a.jsxRuntimeExports.jsx(A,{}),a.jsxRuntimeExports.jsx(b.Corner,{})]}));fe.displayName=b.Root.displayName;const A=r.forwardRef(({className:e,orientation:t="vertical",...o},n)=>a.jsxRuntimeExports.jsx(b.ScrollAreaScrollbar,{ref:n,orientation:t,className:s("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 border-t border-t-transparent p-[1px]",e),...o,children:a.jsxRuntimeExports.jsx(b.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));A.displayName=b.ScrollAreaScrollbar.displayName;const At=y.Root,ge=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(y.List,{ref:o,className:s("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));ge.displayName=y.List.displayName;const be=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(y.Trigger,{ref:o,className:s("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 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",e),...t}));be.displayName=y.Trigger.displayName;const je=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(y.Content,{ref:o,className:s("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));je.displayName=y.Content.displayName;const _t=h.Portal,Pt=h.Provider,zt=h.Root,Lt=h.Trigger,ye=r.forwardRef(({className:e,sideOffset:t=4,...o},n)=>a.jsxRuntimeExports.jsx(h.Content,{ref:n,sideOffset:t,className:s("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground 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),...o}));ye.displayName=h.Content.displayName;const Ot=R.Root,qt=R.Trigger,he=r.forwardRef(({className:e,align:t="center",sideOffset:o=4,...n},l)=>a.jsxRuntimeExports.jsx(R.Portal,{children:a.jsxRuntimeExports.jsx(R.Content,{ref:l,align:t,sideOffset:o,className:s("z-50 w-72 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),...n})}));he.displayName=R.Content.displayName;const Vt=E.Root,Gt=E.Trigger,Ne=r.forwardRef(({className:e,align:t="center",sideOffset:o=4,...n},l)=>a.jsxRuntimeExports.jsx(E.Content,{ref:l,align:t,sideOffset:o,className:s("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),...n}));Ne.displayName=E.Content.displayName;const Ht=m.Root,Ft=m.Group,Bt=m.Value,Re=r.forwardRef(({className:e,children:t,...o},n)=>a.jsxRuntimeExports.jsxs(m.Trigger,{ref:n,className:s("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...o,children:[t,a.jsxRuntimeExports.jsx(m.Icon,{asChild:!0,children:a.jsxRuntimeExports.jsx(g.CaretSortIcon,{className:"h-4 w-4 opacity-50"})})]}));Re.displayName=m.Trigger.displayName;const ve=r.forwardRef(({className:e,children:t,position:o="popper",...n},l)=>a.jsxRuntimeExports.jsx(m.Portal,{children:a.jsxRuntimeExports.jsx(m.Content,{ref:l,className:s("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover 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",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:o,...n,children:a.jsxRuntimeExports.jsx(m.Viewport,{className:s("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));ve.displayName=m.Content.displayName;const we=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(m.Label,{ref:o,className:s("px-2 py-1.5 text-sm font-semibold",e),...t}));we.displayName=m.Label.displayName;const Ce=r.forwardRef(({className:e,children:t,...o},n)=>a.jsxRuntimeExports.jsxs(m.Item,{ref:n,className:s("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[a.jsxRuntimeExports.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsxRuntimeExports.jsx(m.ItemIndicator,{children:a.jsxRuntimeExports.jsx(g.CheckIcon,{className:"h-4 w-4"})})}),a.jsxRuntimeExports.jsx(m.ItemText,{children:t})]}));Ce.displayName=m.Item.displayName;const Ee=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(m.Separator,{ref:o,className:s("-mx-1 my-1 h-px bg-muted",e),...t}));Ee.displayName=m.Separator.displayName;const Ut=i.Root,Qt=i.Trigger,Xt=i.Group,Yt=i.Portal,Jt=i.Sub,Kt=i.RadioGroup,Te=r.forwardRef(({className:e,inset:t,children:o,...n},l)=>a.jsxRuntimeExports.jsxs(i.SubTrigger,{ref:l,className:s("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),...n,children:[o,a.jsxRuntimeExports.jsx(g.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));Te.displayName=i.SubTrigger.displayName;const Se=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(i.SubContent,{ref:o,className:s("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}));Se.displayName=i.SubContent.displayName;const De=r.forwardRef(({className:e,sideOffset:t=4,...o},n)=>a.jsxRuntimeExports.jsx(i.Portal,{children:a.jsxRuntimeExports.jsx(i.Content,{ref:n,sideOffset:t,className:s("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),...o})}));De.displayName=i.Content.displayName;const Me=r.forwardRef(({className:e,inset:t,...o},n)=>a.jsxRuntimeExports.jsx(i.Item,{ref:n,className:s("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),...o}));Me.displayName=i.Item.displayName;const Ie=r.forwardRef(({className:e,children:t,checked:o,...n},l)=>a.jsxRuntimeExports.jsxs(i.CheckboxItem,{ref:l,className:s("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:o,...n,children:[a.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsxRuntimeExports.jsx(i.ItemIndicator,{children:a.jsxRuntimeExports.jsx(g.CheckIcon,{className:"h-4 w-4"})})}),t]}));Ie.displayName=i.CheckboxItem.displayName;const ke=r.forwardRef(({className:e,children:t,...o},n)=>a.jsxRuntimeExports.jsxs(i.RadioItem,{ref:n,className:s("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),...o,children:[a.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsxRuntimeExports.jsx(i.ItemIndicator,{children:a.jsxRuntimeExports.jsx(g.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));ke.displayName=i.RadioItem.displayName;const Ae=r.forwardRef(({className:e,inset:t,...o},n)=>a.jsxRuntimeExports.jsx(i.Label,{ref:n,className:s("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));Ae.displayName=i.Label.displayName;const _e=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(i.Separator,{ref:o,className:s("-mx-1 my-1 h-px bg-muted",e),...t}));_e.displayName=i.Separator.displayName;const Pe=({className:e,...t})=>a.jsxRuntimeExports.jsx("span",{className:s("ml-auto text-xs tracking-widest opacity-60",e),...t});Pe.displayName="DropdownMenuShortcut";const ze=r.forwardRef(({className:e,orientation:t="horizontal",decorative:o=!0,...n},l)=>a.jsxRuntimeExports.jsx(L.Root,{ref:l,decorative:o,orientation:t,className:s("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));ze.displayName=L.Root.displayName;const Wt=1,Zt=1e6;let D=0;function $t(){return D=(D+1)%Number.MAX_VALUE,D.toString()}const M=new Map,P=e=>{if(M.has(e))return;const t=setTimeout(()=>{M.delete(e),N({type:"REMOVE_TOAST",toastId:e})},Zt);M.set(e,t)},Le=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Wt)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(o=>o.id===t.toast.id?{...o,...t.toast}:o)};case"DISMISS_TOAST":{const{toastId:o}=t;return o?P(o):e.toasts.forEach(n=>{P(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===o||o===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(o=>o.id!==t.toastId)}}},v=[];let w={toasts:[]};function N(e){w=Le(w,e),v.forEach(t=>{t(w)})}function Oe({...e}){const t=$t(),o=l=>N({type:"UPDATE_TOAST",toast:{...l,id:t}}),n=()=>N({type:"DISMISS_TOAST",toastId:t});return N({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:l=>{l||n()}}}),{id:t,dismiss:n,update:o}}function qe(){const[e,t]=r.useState(w);return r.useEffect(()=>(v.push(t),()=>{const o=v.indexOf(t);o>-1&&v.splice(o,1)}),[e]),{...e,toast:Oe,dismiss:o=>N({type:"DISMISS_TOAST",toastId:o})}}const eo=f.Provider,Ve=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(f.Viewport,{ref:o,className:s("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));Ve.displayName=f.Viewport.displayName;const to=C.cva("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Ge=r.forwardRef(({className:e,variant:t,...o},n)=>a.jsxRuntimeExports.jsx(f.Root,{ref:n,className:s(to({variant:t}),e),...o}));Ge.displayName=f.Root.displayName;const oo=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(f.Action,{ref:o,className:s("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));oo.displayName=f.Action.displayName;const He=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(f.Close,{ref:o,className:s("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:a.jsxRuntimeExports.jsx(g.Cross2Icon,{className:"h-4 w-4"})}));He.displayName=f.Close.displayName;const Fe=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(f.Title,{ref:o,className:s("text-sm font-semibold [&+div]:text-xs",e),...t}));Fe.displayName=f.Title.displayName;const Be=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(f.Description,{ref:o,className:s("text-sm opacity-90",e),...t}));Be.displayName=f.Description.displayName;function ao(){const{toasts:e}=qe();return a.jsxRuntimeExports.jsxs(eo,{children:[e.map(({id:t,title:o,description:n,action:l,...S})=>a.jsxRuntimeExports.jsxs(Ge,{...S,children:[a.jsxRuntimeExports.jsxs("div",{className:"grid gap-1",children:[o&&a.jsxRuntimeExports.jsx(Fe,{children:o}),n&&a.jsxRuntimeExports.jsx(Be,{children:n})]}),l,a.jsxRuntimeExports.jsx(He,{})]},t)),a.jsxRuntimeExports.jsx(Ve,{})]})}const so=({className:e,...t})=>a.jsxRuntimeExports.jsx("div",{className:s("animate-pulse rounded-md bg-primary/10",e),...t}),_=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(u.Command,{ref:o,className:s("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));_.displayName=u.Command.displayName;const ro=({children:e,...t})=>a.jsxRuntimeExports.jsx($,{...t,children:a.jsxRuntimeExports.jsx(k,{className:"overflow-hidden p-0",children:a.jsxRuntimeExports.jsx(_,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),Ue=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[a.jsxRuntimeExports.jsx(g.MagnifyingGlassIcon,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),a.jsxRuntimeExports.jsx(u.Command.Input,{ref:o,className:s("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Ue.displayName=u.Command.Input.displayName;const Qe=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(u.Command.List,{ref:o,className:s("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));Qe.displayName=u.Command.List.displayName;const Xe=r.forwardRef((e,t)=>a.jsxRuntimeExports.jsx(u.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Xe.displayName=u.Command.Empty.displayName;const Ye=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(u.Command.Group,{ref:o,className:s("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Ye.displayName=u.Command.Group.displayName;const Je=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(u.Command.Separator,{ref:o,className:s("-mx-1 h-px bg-border",e),...t}));Je.displayName=u.Command.Separator.displayName;const Ke=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(u.Command.Item,{ref:o,className:s("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));Ke.displayName=u.Command.Item.displayName;const We=({className:e,...t})=>a.jsxRuntimeExports.jsx("span",{className:s("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});We.displayName="CommandShortcut";const no=d.Root,io=d.Trigger,lo=d.Group,mo=d.Portal,co=d.Sub,po=d.RadioGroup,Ze=r.forwardRef(({className:e,inset:t,children:o,...n},l)=>a.jsxRuntimeExports.jsxs(d.SubTrigger,{ref:l,className:s("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...n,children:[o,a.jsxRuntimeExports.jsx(g.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));Ze.displayName=d.SubTrigger.displayName;const $e=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(d.SubContent,{ref:o,className:s("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}));$e.displayName=d.SubContent.displayName;const et=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(d.Portal,{children:a.jsxRuntimeExports.jsx(d.Content,{ref:o,className:s("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),...t})}));et.displayName=d.Content.displayName;const tt=r.forwardRef(({className:e,inset:t,...o},n)=>a.jsxRuntimeExports.jsx(d.Item,{ref:n,className:s("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...o}));tt.displayName=d.Item.displayName;const ot=r.forwardRef(({className:e,children:t,checked:o,...n},l)=>a.jsxRuntimeExports.jsxs(d.CheckboxItem,{ref:l,className:s("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:o,...n,children:[a.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsxRuntimeExports.jsx(d.ItemIndicator,{children:a.jsxRuntimeExports.jsx(g.CheckIcon,{className:"h-4 w-4"})})}),t]}));ot.displayName=d.CheckboxItem.displayName;const at=r.forwardRef(({className:e,children:t,...o},n)=>a.jsxRuntimeExports.jsxs(d.RadioItem,{ref:n,className:s("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[a.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsxRuntimeExports.jsx(d.ItemIndicator,{children:a.jsxRuntimeExports.jsx(g.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));at.displayName=d.RadioItem.displayName;const st=r.forwardRef(({className:e,inset:t,...o},n)=>a.jsxRuntimeExports.jsx(d.Label,{ref:n,className:s("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...o}));st.displayName=d.Label.displayName;const rt=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(d.Separator,{ref:o,className:s("-mx-1 my-1 h-px bg-border",e),...t}));rt.displayName=d.Separator.displayName;const nt=({className:e,...t})=>a.jsxRuntimeExports.jsx("span",{className:s("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});nt.displayName="ContextMenuShortcut";exports.Accordion=Tt;exports.AccordionContent=H;exports.AccordionItem=V;exports.AccordionTrigger=G;exports.AlertDialog=Dt;exports.AlertDialogAction=W;exports.AlertDialogCancel=Z;exports.AlertDialogContent=Q;exports.AlertDialogDescription=K;exports.AlertDialogFooter=Y;exports.AlertDialogHeader=X;exports.AlertDialogTitle=J;exports.AlertDialogTrigger=Mt;exports.Badge=St;exports.Button=q;exports.Card=ne;exports.CardContent=me;exports.CardDescription=le;exports.CardFooter=ce;exports.CardHeader=ie;exports.CardTitle=de;exports.Command=_;exports.CommandDialog=ro;exports.CommandEmpty=Xe;exports.CommandGroup=Ye;exports.CommandInput=Ue;exports.CommandItem=Ke;exports.CommandList=Qe;exports.CommandSeparator=Je;exports.CommandShortcut=We;exports.ContextMenu=no;exports.ContextMenuCheckboxItem=ot;exports.ContextMenuContent=et;exports.ContextMenuGroup=lo;exports.ContextMenuItem=tt;exports.ContextMenuLabel=st;exports.ContextMenuPortal=mo;exports.ContextMenuRadioGroup=po;exports.ContextMenuRadioItem=at;exports.ContextMenuSeparator=rt;exports.ContextMenuShortcut=nt;exports.ContextMenuSub=co;exports.ContextMenuSubContent=$e;exports.ContextMenuSubTrigger=Ze;exports.ContextMenuTrigger=io;exports.Dialog=$;exports.DialogContent=k;exports.DialogDescription=re;exports.DialogFooter=ae;exports.DialogHeader=oe;exports.DialogTitle=se;exports.DialogTrigger=It;exports.DropdownMenu=Ut;exports.DropdownMenuCheckboxItem=Ie;exports.DropdownMenuContent=De;exports.DropdownMenuGroup=Xt;exports.DropdownMenuItem=Me;exports.DropdownMenuLabel=Ae;exports.DropdownMenuPortal=Yt;exports.DropdownMenuRadioGroup=Kt;exports.DropdownMenuRadioItem=ke;exports.DropdownMenuSeparator=_e;exports.DropdownMenuShortcut=Pe;exports.DropdownMenuSub=Jt;exports.DropdownMenuSubContent=Se;exports.DropdownMenuSubTrigger=Te;exports.DropdownMenuTrigger=Qt;exports.HoverCard=Vt;exports.HoverCardContent=Ne;exports.HoverCardTrigger=Gt;exports.Input=pe;exports.Label=ue;exports.Popover=Ot;exports.PopoverContent=he;exports.PopoverTrigger=qt;exports.ScrollArea=fe;exports.ScrollBar=A;exports.Select=Ht;exports.SelectContent=ve;exports.SelectGroup=Ft;exports.SelectItem=Ce;exports.SelectLabel=we;exports.SelectSeparator=Ee;exports.SelectTrigger=Re;exports.SelectValue=Bt;exports.Separator=ze;exports.Skeleton=so;exports.Switch=O;exports.Tabs=At;exports.TabsContent=je;exports.TabsList=ge;exports.TabsTrigger=be;exports.Textarea=xe;exports.Toaster=ao;exports.Tooltip=zt;exports.TooltipContent=ye;exports.TooltipPortal=_t;exports.TooltipProvider=Pt;exports.TooltipTrigger=Lt;exports.badgeVariants=F;exports.buttonVariants=T;exports.cn=s;exports.reducer=Le;exports.toast=Oe;exports.useToast=qe;