1 |
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8507],{88739:function(e,t,r){"use strict";r.d(t,{v:function(){return S}});var n=r(52322),a=r(2784),s=r(61786),o=r(32079),i=r(34002),l=r(8609),d=r(55343),c=r(11772),u=r(51247),p=r(39097),f=r.n(p),h=r(5632),m=r(56958),x=r(750),g=r(34503),b=r(99959),v=r(48228),j=r(31696);async function y(e){let{message:t,pathname:r,projectRef:n,organizationSlug:a}=e,{data:s,error:o}=await (0,j.v_)("/platform/feedback/send",{body:{message:t,category:"Feedback",tags:["dashboard-feedback"],projectRef:n,organizationSlug:a,pathname:r}});return o&&(0,j.S3)(o),s}let N=function(){let{onError:e,...t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,v.D)(e=>y(e),{async onError(t,r,n){void 0===e?m.Am.error("Failed to submit feedback: ".concat(t.message)):e(t,r,n)},...t})};var w=r(82955),C=r(27208);let _=e=>{let t="image/png",r=atob(e.substr("data:".concat(t,";base64,").length)),n=[];for(let e=0;e<r.length;e+=1024){let t=r.slice(e,e+1024),a=Array(t.length);for(let e=0;e<t.length;e++)a[e]=t.charCodeAt(e);let s=new Uint8Array(a);n.push(s)}return new Blob(n,{type:t})},z=async(e,t)=>{let r=(0,C.eI)("https://obuldanrptloktxcffvn.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im9idWxkYW5ycHRsb2t0eGNmZnZuIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MTg2MTQ2ODUsImV4cCI6MjAzNDE5MDY4NX0.NFt49g6DFkc1X5khCzN5p01iAVo2TMxlx88cY1V0E2M",{auth:{persistSession:!1,autoRefreshToken:!1,multiTab:!1,detectSessionInUrl:!1,localStorage:{getItem:e=>void 0,setItem:(e,t)=>{},removeItem:e=>{}}}}),n=_(t),a="".concat(e||"no-project","/").concat((0,w.k$)(),".png"),{data:s,error:o}=await r.storage.from("feedback-attachments").upload(a,n,{cacheControl:"3600"});if(o){console.error("Failed to upload:",o);return}if(s){let{data:e}=await r.storage.from("feedback-attachments").createSignedUrls([s.path],31536e4);return null==e?void 0:e[0].signedUrl}};var k=e=>{let{feedback:t,screenshot:r,onClose:s,setFeedback:p,setScreenshot:v}=e,j="feedback_content",y="screenshot",C=(0,h.useRouter)(),{ref:k,slug:S}=(0,b.UO)(),I=(0,a.useRef)(null),[R,Z]=(0,a.useState)(!1),[E,D]=(0,a.useState)(!1),{mutate:P}=N({onSuccess:()=>{p(""),v(void 0),localStorage.removeItem(j),localStorage.removeItem(y),m.Am.success("Feedback sent. Thank you!\n\nPlease be aware that we do not provide responses to feedback. If you require assistance or a reply, consider submitting a support ticket.",{duration:8e3}),Z(!1)},onError:e=>{m.Am.error("Failed to submit feedback: ".concat(e.message)),Z(!1)}});(0,a.useEffect)(()=>{let e=localStorage.getItem(j);e&&p(e);let t=localStorage.getItem(y);t&&v(t)},[]),(0,a.useEffect)(()=>{localStorage.setItem(j,t)},[t]),(0,a.useEffect)(()=>{r&&localStorage.setItem(y,r)},[r]);let F=()=>{p(""),v(void 0),localStorage.removeItem(j),localStorage.removeItem(y)},A=async()=>{D(!0),await (0,w.Vs)(100),(0,i.YM)(document.body,{filter:function(e){var t;return!((null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]).length>0)||"feedback-widget"!==e.children[0].id}}).then(e=>{localStorage.setItem(y,e),v(e)}).catch(()=>m.Am.error("Failed to capture screenshot")).finally(()=>{D(!1)})},T=async e=>{e.persist();let[t]=e.target.files||e.dataTransfer.items,r=new FileReader;r.onload=function(e){var t;let r=null===(t=e.target)||void 0===t?void 0:t.result;"string"==typeof r&&(v(r),localStorage.setItem(y,r))},r.readAsDataURL(t),e.target.value=""},O=async()=>{let[e]=await navigator.clipboard.read();if(void 0===r&&"image/png"===e.types[0]){let t=await e.getType("image/png"),r=new FileReader;r.onload=function(e){var t;let r=null===(t=e.target)||void 0===t?void 0:t.result;"string"==typeof r&&(v(r),localStorage.setItem(y,r))},r.readAsDataURL(t)}},U=async()=>{if(0===t.length&&void 0!==r)return m.Am.error("Please include a message in your feedback.");if(t.length>0){Z(!0);let e=r?await z(k,r):void 0;P({projectRef:k,organizationSlug:S,message:void 0!==e?"".concat(t,"\n\nAttachments:\n").concat(e):t,pathname:C.asPath})}return s()};return(0,n.jsxs)("div",{id:"feedback-widget",className:"text-area-text-sm",children:[(0,n.jsx)(x.Z.TextArea,{className:"w-80 p-3",size:"small",placeholder:"Ideas on how to improve this page. Use the Support Form for technical issues.",rows:5,value:t,onChange:e=>p(e.target.value),onPaste:O}),(0,n.jsx)("div",{className:"w-full h-px bg-border"}),(0,n.jsxs)("div",{className:"w-80 space-y-3 px-3 py-2 pb-4",children:[(0,n.jsxs)("div",{className:"flex justify-between space-x-2",children:[(0,n.jsx)(o.z,{type:"default",onClick:()=>{F(),s()},children:"Cancel"}),(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,n.jsx)(o.z,{type:"default",onClick:F,children:"Clear"}),void 0!==r?(0,n.jsx)("div",{style:{backgroundImage:'url("'.concat(r,'")')},onClick:()=>{let e=_(r),t=URL.createObjectURL(e);window.open(t,"_blank")},className:"cursor-pointer rounded h-[26px] w-[30px] border border-control relative bg-cover bg-center bg-no-repeat",children:(0,n.jsx)("button",{className:"cursor-pointer rounded-full bg-red-900 h-3 w-3 flex items-center justify-center absolute -top-1 -right-1",onClick:e=>{e.stopPropagation(),v(void 0)},children:(0,n.jsx)(l.Z,{size:8,strokeWidth:3})})}):(0,n.jsxs)(g.h_,{children:[(0,n.jsx)(g.$F,{asChild:!0,children:(0,n.jsx)(o.z,{type:"default",disabled:E,loading:E,className:"px-2 py-1.5",children:(0,n.jsx)(d.Z,{size:14})})}),(0,n.jsxs)(g.AW,{side:"bottom",align:"end",children:[(0,n.jsxs)(g.Xi,{className:"flex gap-2",onSelect:()=>{I.current&&I.current.click()},children:[(0,n.jsx)(c.Z,{size:14}),"Upload screenshot"]},"upload-screenshot"),(0,n.jsxs)(g.Xi,{className:"flex gap-2",onSelect:()=>A(),children:[(0,n.jsx)(u.Z,{size:14}),"Capture screenshot"]},"capture-screenshot")]})]}),(0,n.jsx)("input",{type:"file",ref:I,className:"hidden",accept:"image/png",onChange:T}),(0,n.jsx)(o.z,{disabled:R,loading:R,onClick:U,children:"Send feedback"})]})]}),(0,n.jsxs)("p",{className:"text-xs text-foreground-light",children:["Have a technical issue? Contact"," ",(0,n.jsx)(f(),{href:"/support/new",children:(0,n.jsx)("span",{className:"cursor-pointer text-brand transition-colors hover:text-brand-600",children:"Supabase support"})})," ","or"," ",(0,n.jsx)("a",{href:"https://supabase.com/docs",target:"_blank",rel:"noreferrer",children:(0,n.jsx)("span",{className:"cursor-pointer text-brand transition-colors hover:text-brand-600",children:"browse our docs"})}),"."]})]})]})},S=()=>{let[e,t]=(0,a.useState)(!1),[r,i]=(0,a.useState)(""),[l,d]=(0,a.useState)();return(0,n.jsxs)(s.J2,{modal:!1,open:e,onOpenChange:e=>{t(e),e||d(void 0)},children:[(0,n.jsx)(s.xo,{asChild:!0,children:(0,n.jsx)(o.z,{asChild:!0,onClick:()=>t(e=>!e),type:"outline",children:(0,n.jsx)("span",{className:"hidden md:flex",children:"Feedback"})})}),(0,n.jsx)(s.yk,{side:"bottom",align:"end",className:"w-full p-0",children:(0,n.jsx)(k,{onClose:()=>t(!1),feedback:r,setFeedback:i,screenshot:l,setScreenshot:d})})]})}},72742:function(e,t,r){"use strict";var n=r(52322),a=r(24990),s=r(38421),o=r.n(s),i=r(39097),l=r.n(i),d=r(5632),c=r(38183),u=r(78976),p=r(19615),f=r(96958),h=r(28883),m=r(48694),x=r(89223),g=r(61786),b=r(32079),v=r(10012),j=r(27570);t.Z=()=>{var e;let t=(0,d.useRouter)(),{project:r}=(0,j.d2)(),s=null!==(e=null==r?void 0:r.parent_project_ref)&&void 0!==e?e:t.query.ref;return(0,n.jsxs)(g.J2,{children:[(0,n.jsxs)(a.fC,{delayDuration:0,children:[(0,n.jsx)(g.xo,{asChild:!0,children:(0,n.jsx)(a.xz,{asChild:!0,children:(0,n.jsx)("div",{className:"relative flex items-center",children:(0,n.jsx)(b.z,{id:"help-popover-button",type:"text",className:"px-1",icon:(0,n.jsx)(u.Z,{size:16,strokeWidth:1.5,className:"text-foreground-light"})})})})}),(0,n.jsx)(a.h_,{children:(0,n.jsxs)(a.VY,{side:"bottom",children:[(0,n.jsx)(a.Eh,{className:"radix-tooltip-arrow"}),(0,n.jsx)("div",{className:"rounded bg-alternative py-1 px-2 leading-none shadow space-y-2 border border-background",children:(0,n.jsx)("p",{className:"text-xs text-foreground",children:"Help"})})]})})]}),(0,n.jsxs)(g.yk,{className:"w-[400px] space-y-4 p-0 py-5",align:"end",side:"bottom",children:[(0,n.jsxs)("div",{className:"mb-5 space-y-4 px-5",children:[(0,n.jsx)("h5",{className:"text-foreground",children:"Need help with your project?"}),(0,n.jsx)("p",{className:"text-sm text-foreground-lighter",children:"For issues with your project hosted on supabase.com, or other inquiries about our hosted services."}),(0,n.jsxs)("div",{className:"space-x-1",children:[(0,n.jsx)(b.z,{asChild:!0,type:"default",icon:(0,n.jsx)(p.Z,{}),children:(0,n.jsx)(l(),{href:"https://supabase.com/docs/guides/platform/troubleshooting",target:"_blank",rel:"noreferrer",children:"Troubleshooting"})}),(0,n.jsx)(b.z,{asChild:!0,type:"text",size:"tiny",icon:(0,n.jsx)(f.Z,{}),children:(0,n.jsx)(l(),{href:"https://supabase.com/docs/",target:"_blank",rel:"noreferrer",children:"Docs"})}),(0,n.jsx)(b.z,{asChild:!0,type:"text",size:"tiny",icon:(0,n.jsx)(h.Z,{}),children:(0,n.jsx)(l(),{href:"https://status.supabase.com/",target:"_blank",rel:"noreferrer",children:"Supabase Status"})})]}),(0,n.jsx)("p",{className:"text-sm text-foreground-lighter",children:"Expected response time is based on your billing plan. Projects on paid plans are prioritized."}),(0,n.jsx)("div",{children:(0,n.jsx)(b.z,{asChild:!0,type:"default",icon:(0,n.jsx)(m.Z,{}),children:(0,n.jsx)(l(),{href:"/support/new".concat(s?"?ref=".concat(s):""),children:"Contact Support"})})})]}),(0,n.jsx)(v.Z.Separator,{}),(0,n.jsxs)("div",{className:"mb-4 space-y-2",children:[(0,n.jsxs)("div",{className:"mb-4 px-5",children:[(0,n.jsx)("h5",{className:"mb-2",children:"Reach out to the community"}),(0,n.jsx)("p",{className:"text-sm text-foreground-lighter",children:"For other support, including questions on our client libraries, advice, or best practices."})]}),(0,n.jsx)("div",{className:"px-5",children:(0,n.jsx)("div",{className:"relative space-y-2 overflow-hidden rounded px-5 py-4 pb-12 shadow-md",style:{background:"#404EED"},children:(0,n.jsxs)("a",{href:"https://discord.supabase.com",target:"_blank",rel:"noreferrer",className:"dark block cursor-pointer",children:[(0,n.jsx)(o(),{className:"absolute left-0 top-0 opacity-50",src:"".concat(t.basePath,"/img/support/discord-bg-small.jpg"),layout:"fill",objectFit:"cover",alt:"discord illustration header"}),(0,n.jsx)(b.z,{type:"secondary",icon:(0,n.jsx)(c.Z,{src:"".concat(t.basePath,"/img/discord-icon.svg"),className:"h-4 w-4"}),children:(0,n.jsx)("span",{style:{color:"#404EED"},children:"Join Discord server"})})]})})}),(0,n.jsx)("div",{className:"px-5",children:(0,n.jsx)("div",{className:"relative space-y-2 overflow-hidden rounded px-5 py-4 pb-12 shadow-md",children:(0,n.jsxs)("a",{href:"https://github.com/supabase/supabase/discussions",target:"_blank",rel:"noreferrer",className:"block cursor-pointer",children:[(0,n.jsx)(o(),{className:"absolute left-0 top-0 opacity-50",src:"".concat(t.basePath,"/img/support/github-bg.jpg?v-1"),layout:"fill",objectFit:"cover",alt:"discord illustration header"}),(0,n.jsx)(b.z,{type:"secondary",icon:(0,n.jsx)(x.Z,{}),children:"GitHub Discussions"})]})})})]})]})]})}},27570:function(e,t,r){"use strict";r.d(t,{C:function(){return h},Ml:function(){return f},d2:function(){return p},gY:function(){return m}});var n=r(52322),a=r(2784),s=r(99959),o=r(31779),i=r(99248),l=r(9109),d=r(83537),c=r(53475);let u=(0,a.createContext)({project:void 0,isLoading:!0}),p=()=>(0,a.useContext)(u),f=e=>{let{projectRef:t,children:r}=e,{data:s,isLoading:i}=(0,o.ix)({ref:t}),p=(0,a.useMemo)(()=>({project:s,isLoading:i}),[s,i]);return(0,n.jsx)(u.Provider,{value:p,children:(0,n.jsx)(c.UU,{children:(0,n.jsx)(l.L,{children:(0,n.jsx)(d.a9,{children:r},"role-impersonation-state-".concat(t))},"database-selector-state-".concat(t))},"table-editor-state-".concat(t))})},h=e=>{let{children:t}=e,{ref:r}=(0,s.UO)();return(0,n.jsx)(f,{projectRef:r,children:t})},m=()=>{let{project:e}=p();return(null==e?void 0:e.status)===i.S.ACTIVE_HEALTHY}},64725:function(e,t,r){"use strict";var n=r(52322),a=r(54383),s=r(2322);t.Z=function(e){let{organization:t,showTooltip:r=!0,tooltipText:o="This organization is managed by Vercel Marketplace.",size:i="small"}=e;if("vercel-marketplace"===t.managed_by){let e=(0,n.jsx)("svg",{className:(0,a.cn)("small"===i&&"w-2.5 h-2.5","medium"===i&&"w-3.5 h-3.5","large"===i&&"w-5 h-5"),viewBox:"0 0 76 65",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M37.5274 0L75.0548 65H0L37.5274 0Z",fill:"hsl(var(--foreground-default) / 1)"})});return r?(0,n.jsxs)(s.u,{children:[(0,n.jsx)(s.aJ,{asChild:!0,children:(0,n.jsx)("div",{className:(0,a.cn)("bg-surface-100 dark:bg-surface-200 border rounded flex items-center justify-center hover:bg-surface-400 dark:hover:bg-surface-400 hover:border-stronger flex-shrink-0","small"===i&&"h-5 w-5","medium"===i&&"w-7 h-7","large"===i&&"w-10 h-10"),children:e})}),(0,n.jsx)(s._v,{children:o})]}):(0,n.jsx)("div",{className:(0,a.cn)("bg-surface-100 dark:bg-surface-200 border rounded flex items-center justify-center flex-shrink-0","small"===i&&"h-5 w-5","medium"===i&&"w-7 h-7","large"===i&&"w-10 h-10"),children:e})}return null}},94896:function(e,t,r){"use strict";r.d(t,{U:function(){return n}});let n={orgSubscription:e=>["organizations",e,"subscription"],orgPlans:e=>["organizations",e,"plans"],addons:e=>["projects",e,"addons"]}},93463:function(e,t,r){"use strict";r.d(t,{Gl:function(){return d},Tt:function(){return c}});var n=r(59491),a=r(36492),s=r(31696),o=r(87175),i=r(94896);async function l(e,t){let{orgSlug:r}=e;if(!r)throw Error("orgSlug is required");let{error:n,data:a}=await (0,s.U2)("/platform/organizations/{slug}/billing/subscription",{params:{path:{slug:r}},signal:t});return n&&(0,s.S3)(n),a}let d=function(e){let{orgSlug:t}=e,{enabled:r=!0,...s}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d=(0,o.Xo)(n.KA.BILLING_READ,"stripe.subscriptions");return(0,a.a)(i.U.orgSubscription(t),e=>{let{signal:r}=e;return l({orgSlug:t},r)},{enabled:r&&d&&void 0!==t,...s})},c=e=>{let{data:t}=d({orgSlug:e},{enabled:(0,o.Xo)(n.KA.BILLING_READ,"stripe.subscriptions")});return(null==t?void 0:t.plan.id)==="enterprise"}},87175:function(e,t,r){"use strict";r.d(t,{G8:function(){return h},N4:function(){return b},Rc:function(){return m},Xo:function(){return g}});var n=r(99959),a=r(42330),s=r.n(a),o=r(31310),i=r(96551),l=r(99248),d=r(89823),c=r(26211),u=r(31779);let p=e=>"^".concat(e.replace(".","\\.").replace("%",".*"),"$");function f(e,t){return!e.filter(e=>e.restrictive).some(e=>{let{condition:r}=e;return null===r||s().apply(r,t)})&&e.filter(e=>!e.restrictive).some(e=>{let{condition:r}=e;return null===r||s().apply(r,t)})}function h(e,t,r,n,a,s){if(!e||!Array.isArray(e))return!1;if(s){let o=e.filter(e=>{var n;return e.organization_slug===a&&e.actions.some(e=>t?t.match(p(e)):null)&&e.resources.some(e=>r.match(p(e)))&&(null===(n=e.project_refs)||void 0===n?void 0:n.includes(s))});if(o.length>0)return f(o,{resource_name:r,...n})}return f(e.filter(e=>!e.project_refs||0===e.project_refs.length).filter(e=>e.organization_slug===a&&e.actions.some(e=>t?t.match(p(e)):null)&&e.resources.some(e=>r.match(p(e)))),{resource_name:r,...n})}function m(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return x(e,t,void 0,r)}function x(e,t,r){let n=!(arguments.length>3)||void 0===arguments[3]||arguments[3],a=(0,i.j)({enabled:void 0===e&&n}),s=void 0===e?a.data:e,o=(0,d.l)({enabled:void 0===t&&n}),l=void 0===t?o:{slug:t},u=null==l?void 0:l.slug,p=(0,c.V)({enabled:void 0===r&&n}),f=void 0===r||(null==p?void 0:p.parent_project_ref)?p:{ref:r,parent_project_ref:void 0};return{permissions:s,organizationSlug:u,projectRef:(null==f?void 0:f.parent_project_ref)?f.parent_project_ref:null==f?void 0:f.ref}}function g(e,t,r,a,s){return function(e,t,r,a){let s=(0,n.nu)(),{organizationSlug:o,projectRef:i,permissions:d}=null!=a?a:{},{permissions:c,organizationSlug:u,projectRef:p}=x(d,o,i,s);return!!s&&(!l.Qy||h(c,e,t,r,u,p))}(e,t,r,{organizationSlug:a,projectRef:void 0,permissions:s})}function b(){let e=(0,n.nu)(),{isFetched:t}=(0,i.j)({enabled:e}),{isFetched:r}=(0,o.tl)({enabled:e}),{ref:a}=(0,n.UO)(),{isFetched:s}=(0,u.ix)({ref:a},{enabled:!!a&&e});return!l.Qy||(a?e&&t&&r&&s:e&&t&&r)}},89823:function(e,t,r){"use strict";r.d(t,{l:function(){return l}});var n=r(99959),a=r(31310),s=r(2784),o=r(99248),i=r(26211);function l(){let{enabled:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,n.nu)(),{ref:r,slug:l}=(0,n.UO)(),{data:d}=(0,a.tl)({enabled:t&&e}),c=(0,i.N)(r),u=(0,s.useMemo)(()=>localStorage.getItem(o.dA.RECENTLY_VISITED_ORGANIZATION),[]);return(0,s.useMemo)(()=>null==d?void 0:d.find(e=>void 0!==l?e.slug===l:void 0!==c?e.id===c.organization_id:void 0!==u?e.slug===u:void 0),[d,c,l,u])}},9109:function(e,t,r){"use strict";r.d(t,{L:function(){return c},TF:function(){return u}});var n=r(52322),a=r(2784),s=r(9162),o=r(4741),i=r(99959);function l(){let e=(0,s.sj)({selectedDatabaseId:void 0,setSelectedDatabaseId:t=>{e.selectedDatabaseId=t}});return e}let d=(0,a.createContext)(l()),c=e=>{let{children:t}=e,r=(0,i.hS)(l);return(0,n.jsx)(d.Provider,{value:r,children:t})};function u(e){let t=(0,a.useContext)(d);return(0,o.R)(t,e)}},83537:function(e,t,r){"use strict";r.d(t,{Gm:function(){return m},Zp:function(){return x},a9:function(){return u},fN:function(){return p},gv:function(){return h},z6:function(){return f}});var n=r(52322),a=r(2784),s=r(9162),o=r(4741),i=r(99959),l=r(38591);function d(){let e=(0,s.sj)({role:void 0,setRole:t=>{e.role=t}});return e}let c=(0,a.createContext)(d()),u=e=>{let{children:t}=e,r=(0,i.hS)(d);return(0,n.jsx)(c.Provider,{value:r,children:t})};function p(e){let t=(0,a.useContext)(c);return(0,o.R)(t,e)}function f(){let e=(0,a.useContext)(c);return(0,a.useCallback)(()=>(0,s.CO)(e).role,[e])}function h(e){let t=(0,a.useContext)(c),r=(0,l.Z)(e);(0,a.useEffect)(()=>(0,s.Ld)(t,()=>{r.current((0,s.CO)(t).role)}),[t])}function m(e){return(null==e?void 0:e.type)==="postgrest"}function x(){return m(p().role)}},53475:function(e,t,r){"use strict";r.d(t,{UU:function(){return d},_2:function(){return c}});var n=r(52322),a=r(2784),s=r(9162),o=r(4741);let i=()=>{let e=(0,s.sj)({enforceExactCount:!1,setEnforceExactCount:t=>{e.enforceExactCount=t},page:1,setPage:t=>{e.page=t},rowsPerPage:100,setRowsPerPage:t=>{e.rowsPerPage=t},ui:{open:"none"},get sidePanel(){return"side-panel"===e.ui.open?e.ui.sidePanel:void 0},get confirmationDialog(){return"confirmation-dialog"===e.ui.open?e.ui.confirmationDialog:void 0},closeSidePanel:()=>{e.ui={open:"none"}},closeConfirmationDialog:()=>{e.ui={open:"none"}},onAddSchema:()=>{e.ui={open:"side-panel",sidePanel:{type:"schema",mode:"new"}}},onAddTable:()=>{e.ui={open:"side-panel",sidePanel:{type:"table",mode:"new"}}},onEditTable:()=>{e.ui={open:"side-panel",sidePanel:{type:"table",mode:"edit"}}},onDuplicateTable:()=>{e.ui={open:"side-panel",sidePanel:{type:"table",mode:"duplicate"}}},onDeleteTable:()=>{e.ui={open:"confirmation-dialog",confirmationDialog:{type:"table",isDeleteWithCascade:!1}}},onAddColumn:()=>{e.ui={open:"side-panel",sidePanel:{type:"column"}}},onEditColumn:t=>{e.ui={open:"side-panel",sidePanel:{type:"column",column:t}}},onDeleteColumn:t=>{e.ui={open:"confirmation-dialog",confirmationDialog:{type:"column",column:t,isDeleteWithCascade:!1}}},onAddRow:()=>{e.ui={open:"side-panel",sidePanel:{type:"row"}}},onEditRow:t=>{e.ui={open:"side-panel",sidePanel:{type:"row",row:t}}},onDeleteRows:function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{numRows:0,allRowsSelected:!1,callback:()=>{}},{numRows:n,allRowsSelected:a,callback:s}=r;e.ui={open:"confirmation-dialog",confirmationDialog:{type:"row",rows:t,numRows:n,allRowsSelected:a,callback:s}}},onExpandJSONEditor:t=>{e.ui={open:"side-panel",sidePanel:{type:"json",jsonValue:t}}},onExpandTextEditor:(t,r)=>{e.ui={open:"side-panel",sidePanel:{type:"cell",value:{column:t,row:r}}}},onEditForeignKeyColumnValue:t=>{e.ui={open:"side-panel",sidePanel:{type:"foreign-row-selector",foreignKey:t}}},onImportData:()=>{e.ui={open:"side-panel",sidePanel:{type:"csv-import"}}},toggleConfirmationIsWithCascade:t=>{"confirmation-dialog"===e.ui.open&&("column"===e.ui.confirmationDialog.type||"table"===e.ui.confirmationDialog.type)&&(e.ui.confirmationDialog.isDeleteWithCascade=null!=t?t:!e.ui.confirmationDialog.isDeleteWithCascade)}});return e},l=(0,a.createContext)(i()),d=e=>{let{children:t}=e,r=(0,a.useRef)(i()).current;return(0,n.jsx)(l.Provider,{value:r,children:t})},c=e=>{let t=(0,a.useContext)(l);return(0,o.R)(t,e)}},70780:function(e,t,r){"use strict";r.d(t,{G:function(){return i},o:function(){return o}});var n=r(52322),a=r(2784);let s=(0,a.createContext)({formContextOnChange:null,values:null,errors:null,handleBlur:null,touched:null,fieldLevelValidation:null}),o=e=>{let{formContextOnChange:t,values:r,errors:a,handleBlur:o,touched:i,fieldLevelValidation:l}=e;return(0,n.jsx)(s.Provider,{value:{formContextOnChange:t,values:r,errors:a,handleBlur:o,touched:i,fieldLevelValidation:l},children:e.children})},i=()=>{let e=(0,a.useContext)(s);if(void 0===e)throw Error("useFormContextOnChange must be used within a FormContextProvider.");return e}},750:function(e,t,r){"use strict";var n=r(52322),a=r(2784),s=r(25001),o=r(71653),i=r(67440),l=r(75109),d=r(46318),c=r(54383),u=r(32079),p=r(70780),f=r(94299);function h(e){let{autoComplete:t,autoFocus:r,className:h,inputClassName:m,iconContainerClassName:x,copy:g,defaultValue:b,descriptionText:v,disabled:j,error:y,icon:N,id:w="",name:C="",inputRef:_,label:z,afterLabel:k,beforeLabel:S,labelOptional:I,layout:R,onChange:Z,onBlur:E,onCopy:D,placeholder:P,type:F="text",value:A,style:T,reveal:O=!1,actions:U,size:L="medium",borderless:V=!1,validation:M,...Y}=e,[J,G]=(0,a.useState)("Copy"),[W,B]=(0,a.useState)(!0),X=(0,d.Z)("input"),{formContextOnChange:q,values:H,errors:Q,handleBlur:K,touched:$,fieldLevelValidation:ee}=(0,p.G)();H&&!A&&(A=H[w||C]),y||(Q&&!y&&(y=Q[w||C]),y=$&&$[w]?y:void 0),(0,a.useEffect)(()=>{M&&ee(w,M(A))},[]);let et=["peer/input",X.base];return y&&et.push(X.variants.error),y||et.push(X.variants.standard),L&&et.push(X.size[L]),N&&et.push(X.with_icon),j&&et.push(X.disabled),m&&et.push(m),(0,n.jsx)(s.l,{label:z,afterLabel:k,beforeLabel:S,labelOptional:I,layout:R,id:w,error:y,descriptionText:v,style:T,size:L,className:h,children:(0,n.jsxs)("div",{className:X.container,children:[(0,n.jsx)("input",{"data-size":L,autoComplete:t,autoFocus:r,defaultValue:b,disabled:j,id:w,name:C,onChange:function(e){Z&&Z(e),q&&q(e),M&&ee(w,M(e.target.value))},onBlur:function(e){K&&setTimeout(()=>{K(e)},100),E&&E(e)},onCopy:D,placeholder:P,ref:_,type:F,value:O&&W?l.aA:A,className:(0,c.cn)(et),...Y}),N&&(0,n.jsx)(i.Z,{size:L,icon:N,className:x}),g||y||U?(0,n.jsxs)("div",{className:X.actions_container,children:[y&&(0,n.jsx)(o.Z,{size:L}),g&&!(O&&W)?(0,n.jsx)(u.z,{size:"tiny",type:"default",icon:(0,n.jsx)(f.Z,{}),onClick:()=>{var e,t;return e=A,void(null===(t=navigator.clipboard.writeText(e))||void 0===t||t.then(function(){G("Copied"),setTimeout(function(){G("Copy")},3e3),null==D||D()},function(){G("Failed to copy")}))},children:J}):null,O&&W?(0,n.jsx)(u.z,{size:"tiny",type:"default",onClick:function(){B(!1)},children:"Reveal"}):null,U&&U]}):null]})})}h.TextArea=function(e){let{className:t,textAreaClassName:r,descriptionText:i,disabled:l,error:c,icon:h,id:m="",name:x="",label:g,afterLabel:b,beforeLabel:v,labelOptional:j,layout:y,onChange:N,onBlur:w,placeholder:C,value:_,style:z,rows:k=4,limit:S,size:I,borderless:R=!1,validation:Z,copy:E=!1,onCopy:D,actions:P,...F}=e,[A,T]=(0,a.useState)(0),[O,U]=(0,a.useState)("Copy"),{formContextOnChange:L,values:V,errors:M,handleBlur:Y,touched:J,fieldLevelValidation:G}=(0,p.G)();V&&!_&&(_=V[m||x]),c||(M&&!c&&(c=M[m||x]),c=J&&J[m||x]?c:void 0),(0,a.useEffect)(()=>{Z&&G(m,Z(_))},[]);let W=(0,d.Z)("input"),B=[W.base];return c&&B.push(W.variants.error),c||B.push(W.variants.standard),h&&B.push(W.with_icon),I&&B.push(W.size[I]),l&&B.push(W.disabled),r&&B.push(r),(0,n.jsx)(s.l,{className:t,label:g,afterLabel:b,beforeLabel:v,labelOptional:j,layout:y,id:m,error:c,descriptionText:i,style:z,size:I,children:(0,n.jsxs)("div",{className:W.container,children:[(0,n.jsx)("textarea",{disabled:l,id:m,name:x,rows:k,cols:100,placeholder:C,onChange:function(e){T(e.target.value.length),N&&N(e),L&&L(e),Z&&G(m,Z(e.target.value))},onBlur:function(e){Y&&setTimeout(()=>{Y(e)},100),w&&w(e)},onCopy:D,value:_,className:B.join(" "),maxLength:S,...F}),E||c||P?(0,n.jsx)("div",{className:W.textarea_actions_container,children:(0,n.jsxs)("div",{className:W.textarea_actions_container_items,children:[c&&(0,n.jsx)(o.Z,{size:I}),E&&(0,n.jsx)(u.z,{size:"tiny",type:"default",onClick:()=>(function(e){navigator.clipboard.writeText(e).then(function(){U("Copied"),setTimeout(function(){U("Copy")},3e3),null==D||D()},function(){U("Failed to copy")})})(_),icon:(0,n.jsx)(f.Z,{}),children:O}),P&&P]})}):null]})})},t.Z=h},10012:function(e,t,r){"use strict";var n=r(52322),a=r(75746);r(2784);var s=r(8609),o=r(46318);function i(e){let{align:t="center",ariaLabel:r,arrow:s=!1,children:i,className:l,defaultOpen:d=!1,modal:c,onOpenChange:u,open:p,overlay:f,side:h="bottom",sideOffset:m=6,style:x,header:g,footer:b,size:v="content",disabled:j,"data-testid":y}=e,N=(0,o.Z)("popover"),w=[N.content,N.size[v]];return l&&w.push(l),(0,n.jsxs)(a.fC,{defaultOpen:d,modal:c,onOpenChange:u,open:p,children:[(0,n.jsx)(a.xz,{disabled:j,className:N.trigger,"aria-label":r,"data-testid":y,children:i}),(0,n.jsx)(a.h_,{children:(0,n.jsxs)(a.VY,{sideOffset:m,side:h,align:t,className:w.join(" "),style:x,children:[s&&(0,n.jsx)(a.Eh,{offset:10}),g&&(0,n.jsx)("div",{className:N.header,children:g}),f,b&&(0,n.jsx)("div",{className:N.footer,children:b})]})})]})}i.Separator=function(){let e=(0,o.Z)("popover");return(0,n.jsx)("div",{className:e.separator})},i.Close=function(){let e=(0,o.Z)("popover");return(0,n.jsx)(a.x8,{className:e.close,children:(0,n.jsx)(s.Z,{size:14,strokeWidth:2})})},t.Z=i},81076:function(e,t,r){"use strict";r.d(t,{C:function(){return i}});var n=r(52322),a=r(10929);r(2784);var s=r(54383);let o=(0,a.j)("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs bg-opacity-10",{variants:{variant:{default:"bg-surface-200 text-foreground-light border border-strong",warning:"bg-warning text-warning-600 border border-warning-500",success:"bg-brand text-brand-600 border border-brand-500",destructive:"bg-destructive text-destructive-600 border border-destructive-500",brand:"bg-brand text-brand-600 border border-brand-500",secondary:"bg-secondary hover:bg-secondary/80 border-transparent text-secondary-foreground",outline:"bg-transparent text border border-foreground-muted"},size:{small:"px-2.5 py-0.5 text-xs",large:"px-3 py-0.5 rounded-full text-sm"},dot:{true:"-ml-0.5 mr-1.5 h-2 w-2 rounded-full"}},defaultVariants:{variant:"default",size:"small"}});function i(e){let{className:t,variant:r="default",size:a,dot:i=!1,children:l,...d}=e;return(0,n.jsxs)("div",{className:(0,s.cn)(o({variant:r,size:a}),t),...d,children:[i&&(0,n.jsx)("svg",{className:o({dot:i}),fill:"currentColor",viewBox:"0 0 8 8",children:(0,n.jsx)("circle",{cx:"4",cy:"4",r:"3"})}),l]})}},34503:function(e,t,r){"use strict";r.d(t,{$F:function(){return u},AW:function(){return b},Ju:function(){return N},KM:function(){return C},Ph:function(){return h},Qk:function(){return p},TG:function(){return g},VD:function(){return w},Xi:function(){return v},_x:function(){return m},bO:function(){return j},cq:function(){return f},h_:function(){return c},kt:function(){return x},qB:function(){return y}});var n=r(52322),a=r(40538),s=r(91179),o=r(76141),i=r(7968),l=r(2784),d=r(54383);let c=e=>(0,n.jsx)(a.fC,{modal:!1,...e}),u=a.xz,p=a.ZA,f=a.Uv,h=a.Tr,m=a.Ee,x=l.forwardRef((e,t)=>{let{className:r,inset:o,children:i,...l}=e;return(0,n.jsxs)(a.fF,{ref:t,className:(0,d.cn)("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-xs outline-none focus:bg-overlay-hover data-[state=open]:bg-overlay-hover data-[state=open]:text-strong",o&&"pl-8",r),...l,children:[i,(0,n.jsx)(s.Z,{className:"h-4 w-4 !ml-auto"})]})});x.displayName=a.fF.displayName;let g=l.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,n.jsx)(a.tu,{ref:t,className:(0,d.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border border-overlay bg-overlay p-1 text-foreground-light 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",r),...s})});g.displayName=a.tu.displayName;let b=l.forwardRef((e,t)=>{let{className:r,sideOffset:s=4,...o}=e;return(0,n.jsx)(a.Uv,{children:(0,n.jsx)(a.VY,{ref:t,sideOffset:s,className:(0,d.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border border-overlay bg-overlay p-1 text-foreground-light 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 w-64",r),...o})})});b.displayName=a.VY.displayName;let v=l.forwardRef((e,t)=>{let{className:r,inset:s,...o}=e;return(0,n.jsx)(a.ck,{ref:t,className:(0,d.cn)("relative flex select-none items-center rounded-sm px-2 py-1.5 text-xs outline-none transition-colors focus:bg-overlay-hover focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 cursor-pointer",s&&"pl-8",r),...o})});v.displayName=a.ck.displayName;let j=l.forwardRef((e,t)=>{let{className:r,children:s,checked:i,...l}=e;return(0,n.jsxs)(a.oC,{ref:t,className:(0,d.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-xs outline-none transition-colors focus:bg-overlay-hover focus:text-strong data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),checked:i,...l,children:[(0,n.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,n.jsx)(a.wU,{children:(0,n.jsx)(o.Z,{className:"h-4 w-4"})})}),s]})});j.displayName=a.oC.displayName;let y=l.forwardRef((e,t)=>{let{className:r,children:s,...o}=e;return(0,n.jsxs)(a.Rk,{ref:t,className:(0,d.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-xs outline-none transition-colors focus:bg-overlay-hover focus:text-strong data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),...o,children:[(0,n.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,n.jsx)(a.wU,{children:(0,n.jsx)(i.Z,{className:"h-2 w-2 fill-current"})})}),s]})});y.displayName=a.Rk.displayName;let N=l.forwardRef((e,t)=>{let{className:r,inset:s,...o}=e;return(0,n.jsx)(a.__,{ref:t,className:(0,d.cn)("px-2 py-1.5 text-xs text-foreground-light",s&&"pl-8",r),...o})});N.displayName=a.__.displayName;let w=l.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,n.jsx)(a.Z0,{ref:t,className:(0,d.cn)("-mx-1 my-1 h-px bg-border-overlay",r),...s})});w.displayName=a.Z0.displayName;let C=e=>{let{className:t,...r}=e;return(0,n.jsx)("span",{className:(0,d.cn)("ml-auto text-xs tracking-widest opacity-60",t),...r})};C.displayName="DropdownMenuShortcut"},6112:function(e,t,r){"use strict";r.d(t,{_:function(){return d}});var n=r(52322),a=r(23707),s=r(10929),o=r(2784),i=r(54383);let l=(0,s.j)("text-sm text leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=o.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,n.jsx)(a.f,{ref:t,className:(0,i.cn)(l(),r),...s})});d.displayName=a.f.displayName},61786:function(e,t,r){"use strict";r.d(t,{Fm:function(){return p},J2:function(){return d},xo:function(){return c},yk:function(){return u}});var n=r(52322),a=r(75746),s=r(2784),o=r(54383),i=r(59534),l=r.n(i);let d=a.fC,c=a.xz;a.ee;let u=s.forwardRef((e,t)=>{let{className:r,align:i="center",sideOffset:d=4,portal:c=!1,sameWidthAsTrigger:u=!1,...p}=e,f=c?a.h_:s.Fragment;return(0,n.jsx)(f,{children:(0,n.jsx)(a.VY,{ref:t,align:i,sideOffset:d,className:(0,o.cn)(u?l()["popover-trigger-width"]:"","z-50 w-72 rounded-md border border-overlay bg-overlay p-4 text-popover-foreground shadow-md outline-none animate-in 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",r),...p})})});u.displayName="PopoverContent";let p=s.forwardRef((e,t)=>{let{className:r,children:a,...s}=e;return(0,n.jsx)("div",{ref:t,...s,className:(0,o.cn)("w-full h-px bg-border-overlay",r)})});p.displayName="PopoverSeparator"},2322:function(e,t,r){"use strict";r.d(t,{_v:function(){return d},aJ:function(){return l},u:function(){return i}});var n=r(52322),a=r(24990),s=r(2784),o=r(54383);a.zt;let i=e=>(0,n.jsx)(a.fC,{delayDuration:180,...e}),l=a.xz,d=s.forwardRef((e,t)=>{let{className:r,sideOffset:s=4,...i}=e;return(0,n.jsx)(a.VY,{ref:t,sideOffset:s,...i,className:(0,o.cn)("z-50 overflow-hidden rounded-md border bg-alternative px-3 py-1.5 text-xs text-foreground shadow-md animate-in fade-in-50 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1",r)})});d.displayName=a.VY.displayName},25001:function(e,t,r){"use strict";r.d(t,{l:function(){return o}});var n=r(52322);r(2784);var a=r(18212),s=r(54383);function o(e){let{align:t="left",children:r,className:o,descriptionText:i,error:l,id:d,label:c,labelOptional:u,layout:p="vertical",style:f,labelLayout:h,responsive:m=!0,size:x="medium",beforeLabel:g,afterLabel:b,nonBoxInput:v=!c}=e,j=a.Z.form_layout,y="flex"===p,N=[];N.push(j.size[x]);let w=[],C=[];"horizontal"===p||h||y?"horizontal"===h?w.push(j.labels_horizontal_layout):w.push(j.labels_vertical_layout):w.push(j.labels_horizontal_layout),"horizontal"!==p?C.push(j.data_input_horizontal_layout):(C.push(j.data_input_vertical_layout),"right"===t&&C.push(j.data_input_vertical_layout__align_right)),y?(N.push(j.flex[t].base),"left"===t&&(w.push(j.flex.left.labels),C.push(j.flex.left.data_input)),"right"===t&&(w.push(j.flex.right.labels),C.push(j.flex.right.data_input))):N.push(j.container,m?j.responsive:j.non_responsive),o&&N.push(o);let _=!!(c||g||b),z=(0,n.jsx)("p",{"data-state":l?"show":"hide",className:[j.error.base,j.error.size[x]].join(" "),children:l}),k=i&&(0,n.jsx)("div",{className:[j.description.base,j.description.size[x]].join(" "),id:d+"-description",children:i});return(0,n.jsxs)("div",{className:N.join(" "),children:[y&&(0,n.jsx)("div",{className:j.flex[t].content,children:r}),_||u||"horizontal"===p?(0,n.jsxs)("div",{className:w.join(" "),children:[_&&(0,n.jsxs)("label",{className:(0,s.cn)(j.label.base,j.label.size[x],"break-all"),htmlFor:d,children:[g&&(0,n.jsx)("span",{className:[j.label_before.base,j.label_before.size[x]].join(" "),id:d+"-before",children:g}),c,b&&(0,n.jsx)("span",{className:[j.label_after.base,j.label_after.size[x]].join(" "),id:d+"-after",children:b})]}),u&&(0,n.jsx)("span",{className:[j.label_optional.base,j.label_optional.size[x]].join(" "),id:d+"-optional",children:u}),y&&(0,n.jsxs)(n.Fragment,{children:[k,z]})]}):null,!y&&(0,n.jsx)("div",{className:C.join(" "),style:f,children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:v&&c&&"vertical"===p?j.non_box_data_input_spacing_vertical:v&&c&&"horizontal"===p?j.non_box_data_input_spacing_horizontal:"",children:r}),z,k]})})]})}},71653:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(52322);r(2784);var a=r(46318),s=r(52006);let o={tiny:14,small:16,medium:20,large:24,xlarge:32};function i(e){let{style:t,size:r="medium"}=e,i=(0,a.Z)("inputErrorIcon");return(0,n.jsx)("div",{className:i.base,style:t,children:(0,n.jsx)(s.Z,{size:o[r],strokeWidth:2})})}},67440:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(52322);r(2784);var a=r(46318),s=r(54383);function o(e){let{icon:t,className:r,size:o}=e,i=(0,a.Z)("inputIconContainer");return(0,n.jsx)("div",{className:(0,s.cn)(i.base,i.size[o],r),children:t})}},59534:function(e){e.exports={"popover-trigger-width":"popover_popover-trigger-width__O8y9q"}}}]);
|