@friggframework/ui 1.3.0--canary.325.d77546e.0 → 1.3.0--canary.325.de65868.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +8 -8
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -399,5 +399,5 @@ const theme2 = createTheme({ palette: {
|
|
|
399
399
|
|
|
400
400
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
401
401
|
|
|
402
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},$Ie="DialogDescriptionWarning",CIe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${MN($Ie).contentName}}.`;return x.useEffect(()=>{var a;const s=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},TIe=bN,SIe=wN,DN=$N,IN=CN,RN=SN,NN=_N,AN=ON;const EIe=TIe,_Ie=SIe,PIe=AN,jN=x.forwardRef(({className:e,...t},n)=>C.jsx(DN,{ref:n,className:yt("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));jN.displayName=DN.displayName;const LN=x.forwardRef(({className:e,children:t,...n},r)=>C.jsxs(_Ie,{children:[C.jsx(jN,{}),C.jsxs(IN,{ref:r,className:yt("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,C.jsxs(AN,{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:[C.jsx(nw,{className:"h-4 w-4"}),C.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));LN.displayName=IN.displayName;const FN=({className:e,...t})=>C.jsx("div",{className:yt("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});FN.displayName="DialogHeader";const VN=({className:e,...t})=>C.jsx("div",{className:yt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});VN.displayName="DialogFooter";const zN=x.forwardRef(({className:e,...t},n)=>C.jsx(RN,{ref:n,className:yt("text-lg font-semibold leading-none tracking-tight",e),...t}));zN.displayName=RN.displayName;const BN=x.forwardRef(({className:e,...t},n)=>C.jsx(NN,{ref:n,className:yt("text-sm text-muted-foreground",e),...t}));BN.displayName=NN.displayName;const UN=x.forwardRef(({className:e,...t},n)=>C.jsx("div",{className:"relative w-full overflow-auto",children:C.jsx("table",{ref:n,className:yt("w-full caption-bottom text-sm",e),...t})}));UN.displayName="Table";const WN=x.forwardRef(({className:e,...t},n)=>C.jsx("thead",{ref:n,className:yt("[&_tr]:border-b",e),...t}));WN.displayName="TableHeader";const HN=x.forwardRef(({className:e,...t},n)=>C.jsx("tbody",{ref:n,className:yt("[&_tr:last-child]:border-0",e),...t}));HN.displayName="TableBody";const OIe=x.forwardRef(({className:e,...t},n)=>C.jsx("tfoot",{ref:n,className:yt("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));OIe.displayName="TableFooter";const Sx=x.forwardRef(({className:e,...t},n)=>C.jsx("tr",{ref:n,className:yt("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Sx.displayName="TableRow";const qN=x.forwardRef(({className:e,...t},n)=>C.jsx("th",{ref:n,className:yt("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));qN.displayName="TableHead";const GN=x.forwardRef(({className:e,...t},n)=>C.jsx("td",{ref:n,className:yt("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));GN.displayName="TableCell";const kIe=x.forwardRef(({className:e,...t},n)=>C.jsx("caption",{ref:n,className:yt("mt-4 text-sm text-muted-foreground",e),...t}));kIe.displayName="TableCaption";const MIe=({friggBaseUrl:e,authToken:t,integrationId:n})=>{const[r,s]=O.useState([]),[a,i]=O.useState([]),{toast:l}=wm();return O.useEffect(()=>{(async()=>{if(t){let d=await new jo(e,t).getSampleData(n);if(d&&d.error){l({variant:"destructive",title:"Oops",description:d.error});return}d.constructor!==Array&&(d=d.data);const f=d&&d.length?Object.keys(d[0]):[],p=f&&f.length?d:[];s(f),i(p)}})()},[t,e,n,l]),r.length>0?C.jsx("div",{className:"m-3 border rounded",children:C.jsxs(UN,{children:[C.jsx(WN,{children:C.jsx(Sx,{children:r.map((c,u)=>C.jsx(qN,{children:c},u))})}),C.jsx(HN,{children:a.map((c,u)=>C.jsx(Sx,{children:Object.values(c).map((d,f)=>C.jsx(GN,{children:`${d}`},f))},u))})]})}):C.jsx("div",{className:"flex w-full justify-center m-5",children:C.jsx("h1",{className:"text-lg",children:"No data available"})})},DIe=({isOpen:e,setOpen:t,friggBaseUrl:n,authToken:r,integrationId:s})=>C.jsx(EIe,{open:e,onOpenChange:t,children:C.jsxs(LN,{children:[C.jsxs(FN,{children:[C.jsx(zN,{children:"Integration Sample Data"}),C.jsx(BN,{children:"See the sample data provided by your integration."})]}),C.jsx("div",{className:"flex items-center space-x-2",children:C.jsx(MIe,{friggBaseUrl:n,authToken:r,integrationId:s})}),C.jsx(VN,{className:"sm:justify-start",children:C.jsx(PIe,{asChild:!0,children:C.jsx(Ao,{type:"button",variant:"secondary",children:"Close"})})})]})});function IIe({disconnectIntegration:e,userActions:t,integrationConfiguration:n,integrationId:r,navigateToSampleDataFn:s,friggBaseUrl:a,authToken:i}){const[l,c]=O.useState(!1),[u,d]=O.useState({}),[f,p]=O.useState(!1),g=async()=>{await e()};function b(){c(!1)}async function m(v){if(v.action==="SAMPLE_DATA"){await h();return}y(v)}const h=async()=>{if(s!==void 0){s(r);return}p(!0)};function y(v){c(!0),d({action:v.action,title:v.title,description:v.description})}return C.jsxs(C.Fragment,{children:[C.jsxs(wV,{children:[C.jsx($V,{children:C.jsx(tw,{})}),C.jsxs(aC,{children:[C.jsx(iC,{children:C.jsxs("div",{className:"flex",children:[C.jsx(Dj,{className:"mr-2 h-4 w-4"})," ",C.jsx("span",{children:"Quick Actions"})]})}),C.jsx(ud,{}),t.map(v=>C.jsx(cd,{onClick:()=>m(v),children:v.title},v.title)),n&&C.jsxs(C.Fragment,{children:[C.jsx(ud,{}),C.jsx(cd,{onClick:n,children:"Configure Integration"})]}),C.jsx(ud,{}),C.jsxs(cd,{onClick:g,className:"text-destructive focus:text-destructive",children:[C.jsx(Mj,{className:"mr-2 h-4 w-4"}),C.jsx("p",{children:"Disconnect"})]})]})]}),l?C.jsx(pIe,{closeConfigModal:b,integrationId:r,userActionDetails:u,friggBaseUrl:a,authToken:i}):null,C.jsx(DIe,{isOpen:f,setOpen:p,integrationId:r,friggBaseUrl:a,authToken:i})]})}function RIe(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Ex="Switch",[NIe,PAe]=is(Ex),[AIe,jIe]=NIe(Ex),KN=x.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:a,required:i,disabled:l,value:c="on",onCheckedChange:u,...d}=e,[f,p]=x.useState(null),g=an(t,v=>p(v)),b=x.useRef(!1),m=f?!!f.closest("form"):!0,[h=!1,y]=wl({prop:s,defaultProp:a,onChange:u});return C.jsxs(AIe,{scope:n,checked:h,disabled:l,children:[C.jsx(Mt.button,{type:"button",role:"switch","aria-checked":h,"aria-required":i,"data-state":XN(h),"data-disabled":l?"":void 0,disabled:l,value:c,...d,ref:g,onClick:Ye(e.onClick,v=>{y($=>!$),m&&(b.current=v.isPropagationStopped(),b.current||v.stopPropagation())})}),m&&C.jsx(LIe,{control:f,bubbles:!b.current,name:r,value:c,checked:h,required:i,disabled:l,style:{transform:"translateX(-100%)"}})]})});KN.displayName=Ex;var YN="SwitchThumb",JN=x.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=jIe(YN,n);return C.jsx(Mt.span,{"data-state":XN(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});JN.displayName=YN;var LIe=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,a=x.useRef(null),i=RIe(n),l=Nw(t);return x.useEffect(()=>{const c=a.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(i!==n&&f){const p=new Event("click",{bubbles:r});f.call(c,n),c.dispatchEvent(p)}},[i,n,r]),C.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:a,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function XN(e){return e?"checked":"unchecked"}var ZN=KN,FIe=JN;const QN=x.forwardRef(({className:e,...t},n)=>C.jsx(ZN,{className:yt("peer inline-flex h-6 w-11 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-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:C.jsx(FIe,{className:yt("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));QN.displayName=ZN.displayName;function eA(e){const{authToken:t,refreshIntegrations:n,friggBaseUrl:r,navigateToSampleDataFn:s}=e,{name:a,description:i,icon:l}=e.data.display,{type:c,status:u,id:d}=e.data,[f,p]=O.useState(!1),[g,b]=O.useState(u),[m,h]=O.useState(!1),[y,v]=O.useState(!1),[$,S]=O.useState([]),w=new jo(r,t);O.useEffect(()=>{const U=[{title:"Get Sample Data",action:"SAMPLE_DATA"}];Object.keys(e.data.userActions||{}).map(V=>{U.push({title:e.data.userActions[V].title,description:e.data.userActions[V].description,action:V})}),S(U)},[e.data.userActions]);const P=async()=>{p(!0);const U=await w.getAuthorizeRequirements(c,"");if(U.type==="oauth2"&&(window.location.href=U.url),U.type!=="oauth2"){let V=U.data;for(const A of Object.entries(V.uiSchema))A["ui:widget"]||(A["ui:widget"]="text");k()}};function k(){h(!0)}function N(){h(!1),p(!1)}function I(){v(!0)}function F(){v(!1),p(!1)}const W=async()=>{await w.deleteIntegration(e.data.id),p(!0),b(!1),await n(e),p(!1)};return C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"flex flex-nowrap p-4 bg-white rounded-lg shadow-xs","data-testid":"integration-horizontal",children:[C.jsxs("div",{className:"flex flex-1",children:[C.jsx("img",{className:"mr-3 w-[80px] h-[80px] rounded-lg",alt:a,src:l}),C.jsxs("div",{className:"pr-1 overflow-hidden",children:[C.jsx("p",{className:"w-full text-lg font-semibold text-gray-700 truncate ...",children:a}),C.jsx("p",{className:"pt-2 text-sm font-medium text-gray-600",children:i}),g&&g==="NEEDS_CONFIG"&&C.jsxs("p",{className:"inline-flex pt-2 text-xs font-medium text-orange-500 gap-1",children:[C.jsx(kj,{className:"w-4 h-4"})," Configure"]})]})]}),C.jsx("div",{children:C.jsx("div",{className:"flex flex-col h-full align-items-end",children:g?C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"flex-1",children:C.jsx("label",{htmlFor:a,className:"flex items-center cursor-pointer",children:C.jsx(QN,{name:a,id:a,checked:!0})})}),C.jsx("div",{className:"flex flex-row-reverse",children:C.jsx(IIe,{userActions:$,integrationConfiguration:I,disconnectIntegration:W,integrationId:d,navigateToSampleDataFn:s,friggBaseUrl:r,authToken:t})})]}):C.jsx(Ao,{onClick:P,children:f?C.jsx(js,{}):"Connect"})})})]}),m?C.jsx(lIe,{isAuthModalOpen:m,closeAuthModal:N,refreshIntegrations:n,name:a,type:c,friggBaseUrl:r,authToken:t}):null,y?C.jsx(dIe,{isConfigModalOpen:y,closeConfigModal:F,name:a,refreshIntegrations:()=>n(e),integrationId:e.data.id,friggBaseUrl:r,authToken:t}):null]})}function ns({layout:e}){return C.jsxs(C.Fragment,{children:[e=="default-horizontal"&&C.jsxs("div",{"data-testid":"skeleton-horizontal",className:"flex p-4 bg-gray-200 rounded-lg shadow-xs animate-pulse",children:[C.jsx("div",{className:"mr-4 w-20 h-20 bg-gray-400 rounded-lg overflow-hidden animate-pulse"}),C.jsxs("div",{children:[C.jsx("p",{className:"h-6 w-20 bg-gray-400 animate-pulse"}),C.jsx("p",{className:"mb-2 mt-2 h-4 w-16 bg-gray-400 animate-pulse"})]}),C.jsx("div",{className:"ml-auto",children:C.jsx("div",{className:"relative",children:C.jsx("div",{className:"px-3 py-2 h-10 w-16 bg-gray-400 animate-pulse"})})})]}),e=="default-vertical"&&C.jsxs("div",{"data-testid":"skeleton-vertical",className:"flex flex-col items-center p-4 bg-gray-200 rounded-lg shadow-xs animate-pulse",children:[C.jsx("div",{className:"w-[120px] h-[120px] mt-4 bg-gray-400 rounded-full animate-pulse"}),C.jsx("div",{className:"mt-4 w-36 h-10 bg-gray-400 animate-pulse"}),C.jsx("div",{className:"mb-6 mt-2 w-16 h-6 bg-gray-400 animate-pulse"}),C.jsx("div",{className:"items-center pb-3",children:C.jsx("div",{className:"relative",children:C.jsx("div",{className:"w-40 h-14 bg-gray-400 rounded-lg"})})})]})]})}const VIe=e=>{const t=[],n=zIe(e);return tA(e).forEach(s=>{const a=n.filter(i=>i.type===s.type);a.length>0?a.forEach(i=>{t.push(i)}):t.push(s)}),t},zIe=e=>{const t=[];return e.integrations.forEach(n=>{const r={...n},s=r.entities[1].id,a=BIe(s,e);r.type=a,r.display=UIe(a,e),t.push(r)}),t},BIe=(e,t)=>{const r=t.entities.authorized.find(s=>s.id===e);if(r)return r.type;throw Error(`getTypeForId() ERR - entityId ${e} does not exist in authorized entities!`)},UIe=(e,t)=>{const r=tA(t).find(s=>s.type===e);if(r)return r.display;throw Error(`getDisplayForType() ERR - type ${e} does not exist in possible integrations!`)},tA=e=>e.entities.options,WIe=e=>{const[t,n]=O.useState([]),[r,s]=O.useState([]),[a,i]=O.useState(!0),l=O.useCallback(async()=>{const p=await new jo(e.friggBaseUrl,e.authToken).listIntegrations();if(p.error&&console.log("Something went wrong while fetching integrations, please try again later."),p.integrations){const g=VIe(p);s(g)}},[e.authToken,e.friggBaseUrl]);O.useEffect(()=>{if(!e.authToken){console.log("Authentication token is required to fetch integrations.");return}l().then(()=>i(!1))},[l,e.authToken]);const c=f=>{const p=[f,...t];n(p)},u=f=>{if(e.componentLayout==="default-horizontal")return C.jsx(eA,{data:f,handleInstall:c,refreshIntegrations:l,friggBaseUrl:e.friggBaseUrl,authToken:e.authToken,navigateToSampleDataFn:e.navigateToSampleDataFn},`combined-integration-${f.type}`);if(e.componentLayout==="default-vertical")return C.jsx(nA,{data:f,handleInstall:c,refreshIntegrations:l,friggBaseUrl:e.friggBaseUrl},`combined-integration-${f.type}`)},d=f=>e.integrationType==="Recently added"?f.map(p=>u(p)):e.integrationType==="Installed"?t.map(p=>u(p)):f.filter(p=>p.display.description===e.integrationType).map(p=>u(p));return C.jsxs(C.Fragment,{children:[a&&C.jsxs("div",{className:"grid gap-6 lg:col-span-1 lg:grid-cols-1 xl:col-span-2 xl:grid-cols-2 2xl:col-span-3 2xl:grid-cols-3",children:[C.jsx(ns,{layout:e.componentLayout}),C.jsx(ns,{layout:e.componentLayout}),C.jsx(ns,{layout:e.componentLayout}),C.jsx(ns,{layout:e.componentLayout}),C.jsx(ns,{layout:e.componentLayout}),C.jsx(ns,{layout:e.componentLayout}),C.jsx(ns,{layout:e.componentLayout}),C.jsx(ns,{layout:e.componentLayout}),C.jsx(ns,{layout:e.componentLayout})]}),d(r).length===0?C.jsxs("p",{children:["No ",e.integrationType," integrations found."]}):d(r)]})};function nA(e){const{name:t,description:n,category:r,icon:s}=e.data.display,{hasUserConfig:a,type:i}=e.data,{authToken:l,refreshIntegrations:c}=e,[u,d]=O.useState(!1),[f,p]=O.useState(""),[g,b]=O.useState([]),m=new jo(e.friggBaseUrl,l),h=async()=>{d(!0);const w=await m.getAuthorizeRequirements(i,"");w.type==="oauth2"&&(window.location.href=w.url),w.type!=="oauth2"&&y()},y=()=>{v()},v=()=>{let w;switch(e.data.status){case"NEEDS_CONFIG":w="INITIAL";break;case"ENABLED":w="CONFIGURE";break;default:w="AUTHORIZE"}return w},$=async()=>{alert("Implement sample data fetching logic here")},S=async()=>{await m.deleteIntegration(e.data.id),(await m.listIntegrations()).error||alert("Integration disconnected successfully"),b([]),p("")};return C.jsx(C.Fragment,{children:C.jsxs("div",{className:"flex flex-col items-center p-4 bg-white rounded-lg shadow-xs","data-testid":"integration-vertical",children:[C.jsxs("div",{className:"flex w-full h-[24px]",children:[C.jsx("div",{className:"inline-flex relative mr-auto",children:f&&f==="NEEDS_CONFIG"&&C.jsxs("p",{className:"inline-flex text-xs font-medium text-red-300 text-center",children:[C.jsx(_j,{className:"w-4 h-4 mr-1"})," Configure"]})}),C.jsx("div",{className:"inline-flex relative justify-end ml-auto",children:f&&f==="ENABLED"||f==="NEEDS_CONFIG"&&C.jsx(Ij,{getSampleData:$,disconnectIntegration:S,name:t,hasUserConfig:a})})]}),C.jsx("img",{className:"w-[120px] h-[120px] rounded-full",alt:t,src:s}),C.jsxs("div",{className:"pr-1 pt-4 pb-4 overflow-hidden",children:[C.jsx("p",{className:"w-full text-2xl font-semibold text-gray-700 text-center truncate ...",children:t}),C.jsx("p",{className:"w-full pt-2 text-md font-medium text-gray-600 text-center",children:n})]}),C.jsx("div",{className:"items-center pb-3",children:C.jsxs("div",{className:"relative",children:[f&&f==="ENABLED"||f==="NEEDS_CONFIG"&&C.jsx("button",{onClick:S,className:"w-full px-5 py-3 font-medium leading-5 text-center text-primary transition-colors duration-150 rounded-lg border-2 border-purple-400 hover:border-purple-600 hover:bg-purple-600 hover:text-white focus:outline-none focus:shadow-outline-purple",children:"Disconnect"}),!f&&C.jsx(Ao,{onClick:h,children:u?C.jsx(js,{}):"Connect"})]})})]})})}const rA="%[a-f0-9]{2}",oA=new RegExp("("+rA+")|([^%]+?)","gi"),sA=new RegExp("("+rA+")+","gi");function _x(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;t=t||1;const n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],_x(n),_x(r))}function HIe(e){try{return decodeURIComponent(e)}catch{let t=e.match(oA)||[];for(let n=1;n<t.length;n++)e=_x(t,n).join(""),t=e.match(oA)||[];return e}}function qIe(e){const t={"%FE%FF":"��","%FF%FE":"��"};let n=sA.exec(e);for(;n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{const s=HIe(n[0]);s!==n[0]&&(t[n[0]]=s)}n=sA.exec(e)}t["%C2"]="�";const r=Object.keys(t);for(const s of r)e=e.replace(new RegExp(s,"g"),t[s]);return e}function GIe(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return qIe(e)}}function KIe(e,t){const n={};if(Array.isArray(t))for(const r of t){const s=Object.getOwnPropertyDescriptor(e,r);s!=null&&s.enumerable&&Object.defineProperty(n,r,s)}else for(const r of Reflect.ownKeys(e)){const s=Object.getOwnPropertyDescriptor(e,r);if(s.enumerable){const a=e[r];t(r,a,e)&&Object.defineProperty(n,r,s)}}return n}function aA(e,t){if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e===""||t==="")return[];const n=e.indexOf(t);return n===-1?[]:[e.slice(0,n),e.slice(n+t.length)]}const YIe=e=>e==null,JIe=e=>encodeURIComponent(e).replaceAll(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),Px=Symbol("encodeFragmentIdentifier");function XIe(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const s=n.length;return r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[un(t,e),"[",s,"]"].join("")]:[...n,[un(t,e),"[",un(s,e),"]=",un(r,e)].join("")]};case"bracket":return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[un(t,e),"[]"].join("")]:[...n,[un(t,e),"[]=",un(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[un(t,e),":list="].join("")]:[...n,[un(t,e),":list=",un(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t=e.arrayFormat==="bracket-separator"?"[]=":"=";return n=>(r,s)=>s===void 0||e.skipNull&&s===null||e.skipEmptyString&&s===""?r:(s=s===null?"":s,r.length===0?[[un(n,e),t,un(s,e)].join("")]:[[r,un(s,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,un(t,e)]:[...n,[un(t,e),"=",un(r,e)].join("")]}}function ZIe(e){let t;switch(e.arrayFormat){case"index":return(n,r,s)=>{if(t=/\[(\d*)]$/.exec(n),n=n.replace(/\[\d*]$/,""),!t){s[n]=r;return}s[n]===void 0&&(s[n]={}),s[n][t[1]]=r};case"bracket":return(n,r,s)=>{if(t=/(\[])$/.exec(n),n=n.replace(/\[]$/,""),!t){s[n]=r;return}if(s[n]===void 0){s[n]=[r];return}s[n]=[...s[n],r]};case"colon-list-separator":return(n,r,s)=>{if(t=/(:list)$/.exec(n),n=n.replace(/:list$/,""),!t){s[n]=r;return}if(s[n]===void 0){s[n]=[r];return}s[n]=[...s[n],r]};case"comma":case"separator":return(n,r,s)=>{const a=typeof r=="string"&&r.includes(e.arrayFormatSeparator),i=typeof r=="string"&&!a&&rs(r,e).includes(e.arrayFormatSeparator);r=i?rs(r,e):r;const l=a||i?r.split(e.arrayFormatSeparator).map(c=>rs(c,e)):r===null?r:rs(r,e);s[n]=l};case"bracket-separator":return(n,r,s)=>{const a=/(\[])$/.test(n);if(n=n.replace(/\[]$/,""),!a){s[n]=r&&rs(r,e);return}const i=r===null?[]:r.split(e.arrayFormatSeparator).map(l=>rs(l,e));if(s[n]===void 0){s[n]=i;return}s[n]=[...s[n],...i]};default:return(n,r,s)=>{if(s[n]===void 0){s[n]=r;return}s[n]=[...[s[n]].flat(),r]}}}function iA(e){if(typeof e!="string"||e.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function un(e,t){return t.encode?t.strict?JIe(e):encodeURIComponent(e):e}function rs(e,t){return t.decode?GIe(e):e}function lA(e){return Array.isArray(e)?e.sort():typeof e=="object"?lA(Object.keys(e)).sort((t,n)=>Number(t)-Number(n)).map(t=>e[t]):e}function cA(e){const t=e.indexOf("#");return t!==-1&&(e=e.slice(0,t)),e}function QIe(e){let t="";const n=e.indexOf("#");return n!==-1&&(t=e.slice(n)),t}function uA(e,t,n){return n==="string"&&typeof e=="string"?e:typeof n=="function"&&typeof e=="string"?n(e):t.parseBooleans&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")?e.toLowerCase()==="true":n==="number"&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""||t.parseNumbers&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?Number(e):e}function Ox(e){e=cA(e);const t=e.indexOf("?");return t===-1?"":e.slice(t+1)}function kx(e,t){t={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,types:Object.create(null),...t},iA(t.arrayFormatSeparator);const n=ZIe(t),r=Object.create(null);if(typeof e!="string"||(e=e.trim().replace(/^[?#&]/,""),!e))return r;for(const s of e.split("&")){if(s==="")continue;const a=t.decode?s.replaceAll("+"," "):s;let[i,l]=aA(a,"=");i===void 0&&(i=a),l=l===void 0?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?l:rs(l,t),n(rs(i,t),l,r)}for(const[s,a]of Object.entries(r))if(typeof a=="object"&&a!==null&&t.types[s]!=="string")for(const[i,l]of Object.entries(a)){const c=t.types[s]?t.types[s].replace("[]",""):void 0;a[i]=uA(l,t,c)}else typeof a=="object"&&a!==null&&t.types[s]==="string"?r[s]=Object.values(a).join(t.arrayFormatSeparator):r[s]=uA(a,t,t.types[s]);return t.sort===!1?r:(t.sort===!0?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce((s,a)=>{const i=r[a];return s[a]=i&&typeof i=="object"&&!Array.isArray(i)?lA(i):i,s},Object.create(null))}function dA(e,t){if(!e)return"";t={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...t},iA(t.arrayFormatSeparator);const n=i=>t.skipNull&&YIe(e[i])||t.skipEmptyString&&e[i]==="",r=XIe(t),s={};for(const[i,l]of Object.entries(e))n(i)||(s[i]=l);const a=Object.keys(s);return t.sort!==!1&&a.sort(t.sort),a.map(i=>{const l=e[i];return l===void 0?"":l===null?un(i,t):Array.isArray(l)?l.length===0&&t.arrayFormat==="bracket-separator"?un(i,t)+"[]":l.reduce(r(i),[]).join("&"):un(i,t)+"="+un(l,t)}).filter(i=>i.length>0).join("&")}function fA(e,t){var s;t={decode:!0,...t};let[n,r]=aA(e,"#");return n===void 0&&(n=e),{url:((s=n==null?void 0:n.split("?"))==null?void 0:s[0])??"",query:kx(Ox(e),t),...t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:rs(r,t)}:{}}}function pA(e,t){t={encode:!0,strict:!0,[Px]:!0,...t};const n=cA(e.url).split("?")[0]||"",r=Ox(e.url),s={...kx(r,{sort:!1}),...e.query};let a=dA(s,t);a&&(a=`?${a}`);let i=QIe(e.url);if(typeof e.fragmentIdentifier=="string"){const l=new URL(n);l.hash=e.fragmentIdentifier,i=t[Px]?l.hash:`#${e.fragmentIdentifier}`}return`${n}${a}${i}`}function mA(e,t,n){n={parseFragmentIdentifier:!0,[Px]:!1,...n};const{url:r,query:s,fragmentIdentifier:a}=fA(e,n);return pA({url:r,query:KIe(s,t),fragmentIdentifier:a},n)}function eRe(e,t,n){const r=Array.isArray(t)?s=>!t.includes(s):(s,a)=>!t(s,a);return mA(e,r,n)}const tRe=Object.freeze(Object.defineProperty({__proto__:null,exclude:eRe,extract:Ox,parse:kx,parseUrl:fA,pick:mA,stringify:dA,stringifyUrl:pA},Symbol.toStringTag,{value:"Module"})),nRe=e=>(O.useEffect(()=>{(async()=>{const n=new jo(e.friggBaseUrl,e.authToken),r=tRe.parse(window.location.search);if(r.code){const s=await n.listIntegrations(),a=await n.authorize(e.app,{code:r.code});if(a!=null&&a.error){alert(a.error),e.redirectToUrl();return}const i={type:e.app,category:"CRM"},l=s.entities.authorized.find(u=>u.type===e.primaryEntityName),c=await n.createIntegration(l.id??a.entity_id,a.entity_id,i);if(c.error){alert(c.error);return}e.redirectToUrl()}})()},[e.app,e.redirectToUrl]),C.jsx("div",{className:"container",children:C.jsx("div",{id:"card-wrap",className:"card",children:C.jsx("div",{className:"card-body",children:C.jsx(js,{})})})}));var rRe="VisuallyHidden",Mx=x.forwardRef((e,t)=>C.jsx(Mt.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Mx.displayName=rRe;var oRe="ToastProvider",[hA,sRe,aRe]=Mm("Toast"),[gA,OAe]=is("Toast",[aRe]),[kAe,Cm]=gA(oRe),yA="ToastViewport",iRe=["F8"],Dx="toast.viewportPause",Ix="toast.viewportResume",bA=x.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=iRe,label:s="Notifications ({hotkey})",...a}=e,i=Cm(yA,n),l=sRe(n),c=x.useRef(null),u=x.useRef(null),d=x.useRef(null),f=x.useRef(null),p=an(t,f,i.onViewportChange),g=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=i.toastCount>0;x.useEffect(()=>{const h=y=>{var $;r.every(S=>y[S]||y.code===S)&&(($=f.current)==null||$.focus())};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[r]),x.useEffect(()=>{const h=c.current,y=f.current;if(b&&h&&y){const v=()=>{if(!i.isClosePausedRef.current){const P=new CustomEvent(Dx);y.dispatchEvent(P),i.isClosePausedRef.current=!0}},$=()=>{if(i.isClosePausedRef.current){const P=new CustomEvent(Ix);y.dispatchEvent(P),i.isClosePausedRef.current=!1}},S=P=>{!h.contains(P.relatedTarget)&&$()},w=()=>{h.contains(document.activeElement)||$()};return h.addEventListener("focusin",v),h.addEventListener("focusout",S),h.addEventListener("pointermove",v),h.addEventListener("pointerleave",w),window.addEventListener("blur",v),window.addEventListener("focus",$),()=>{h.removeEventListener("focusin",v),h.removeEventListener("focusout",S),h.removeEventListener("pointermove",v),h.removeEventListener("pointerleave",w),window.removeEventListener("blur",v),window.removeEventListener("focus",$)}}},[b,i.isClosePausedRef]);const m=x.useCallback(({tabbingDirection:h})=>{const v=l().map($=>{const S=$.ref.current,w=[S,...xRe(S)];return h==="forwards"?w:w.reverse()});return(h==="forwards"?v.reverse():v).flat()},[l]);return x.useEffect(()=>{const h=f.current;if(h){const y=v=>{var w,P,k;const $=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!$){const N=document.activeElement,I=v.shiftKey;if(v.target===h&&I){(w=u.current)==null||w.focus();return}const U=m({tabbingDirection:I?"backwards":"forwards"}),V=U.findIndex(A=>A===N);Ax(U.slice(V+1))?v.preventDefault():I?(P=u.current)==null||P.focus():(k=d.current)==null||k.focus()}};return h.addEventListener("keydown",y),()=>h.removeEventListener("keydown",y)}},[l,m]),C.jsxs(Gj,{ref:c,role:"region","aria-label":s.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&C.jsx(Rx,{ref:u,onFocusFromOutsideViewport:()=>{const h=m({tabbingDirection:"forwards"});Ax(h)}}),C.jsx(hA.Slot,{scope:n,children:C.jsx(Mt.ol,{tabIndex:-1,...a,ref:p})}),b&&C.jsx(Rx,{ref:d,onFocusFromOutsideViewport:()=>{const h=m({tabbingDirection:"backwards"});Ax(h)}})]})});bA.displayName=yA;var vA="ToastFocusProxy",Rx=x.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=e,a=Cm(vA,n);return C.jsx(Mx,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:i=>{var u;const l=i.relatedTarget;!((u=a.viewport)!=null&&u.contains(l))&&r()}})});Rx.displayName=vA;var Tm="Toast",lRe="toast.swipeStart",cRe="toast.swipeMove",uRe="toast.swipeCancel",dRe="toast.swipeEnd",xA=x.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:a,...i}=e,[l=!0,c]=wl({prop:r,defaultProp:s,onChange:a});return C.jsx(zo,{present:n||l,children:C.jsx(mRe,{open:l,...i,ref:t,onClose:()=>c(!1),onPause:Vn(e.onPause),onResume:Vn(e.onResume),onSwipeStart:Ye(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ye(e.onSwipeMove,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:Ye(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ye(e.onSwipeEnd,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),c(!1)})})})});xA.displayName=Tm;var[fRe,pRe]=gA(Tm,{onClose(){}}),mRe=x.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:a,onClose:i,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:p,onSwipeEnd:g,...b}=e,m=Cm(Tm,n),[h,y]=x.useState(null),v=an(t,A=>y(A)),$=x.useRef(null),S=x.useRef(null),w=s||m.duration,P=x.useRef(0),k=x.useRef(w),N=x.useRef(0),{onToastAdd:I,onToastRemove:F}=m,W=Vn(()=>{var L;(h==null?void 0:h.contains(document.activeElement))&&((L=m.viewport)==null||L.focus()),i()}),U=x.useCallback(A=>{!A||A===1/0||(window.clearTimeout(N.current),P.current=new Date().getTime(),N.current=window.setTimeout(W,A))},[W]);x.useEffect(()=>{const A=m.viewport;if(A){const L=()=>{U(k.current),u==null||u()},q=()=>{const G=new Date().getTime()-P.current;k.current=k.current-G,window.clearTimeout(N.current),c==null||c()};return A.addEventListener(Dx,q),A.addEventListener(Ix,L),()=>{A.removeEventListener(Dx,q),A.removeEventListener(Ix,L)}}},[m.viewport,w,c,u,U]),x.useEffect(()=>{a&&!m.isClosePausedRef.current&&U(w)},[a,w,m.isClosePausedRef,U]),x.useEffect(()=>(I(),()=>F()),[I,F]);const V=x.useMemo(()=>h?_A(h):null,[h]);return m.viewport?C.jsxs(C.Fragment,{children:[V&&C.jsx(hRe,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:V}),C.jsx(fRe,{scope:n,onClose:W,children:gl.createPortal(C.jsx(hA.ItemSlot,{scope:n,children:C.jsx(qj,{asChild:!0,onEscapeKeyDown:Ye(l,()=>{m.isFocusedToastEscapeKeyDownRef.current||W(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:C.jsx(Mt.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":m.swipeDirection,...b,ref:v,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Ye(e.onKeyDown,A=>{A.key==="Escape"&&(l==null||l(A.nativeEvent),A.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,W()))}),onPointerDown:Ye(e.onPointerDown,A=>{A.button===0&&($.current={x:A.clientX,y:A.clientY})}),onPointerMove:Ye(e.onPointerMove,A=>{if(!$.current)return;const L=A.clientX-$.current.x,q=A.clientY-$.current.y,G=!!S.current,Y=["left","right"].includes(m.swipeDirection),K=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,j=Y?K(0,L):0,M=Y?0:K(0,q),B=A.pointerType==="touch"?10:2,R={x:j,y:M},T={originalEvent:A,delta:R};G?(S.current=R,Sm(cRe,f,T,{discrete:!1})):PA(R,m.swipeDirection,B)?(S.current=R,Sm(lRe,d,T,{discrete:!1}),A.target.setPointerCapture(A.pointerId)):(Math.abs(L)>B||Math.abs(q)>B)&&($.current=null)}),onPointerUp:Ye(e.onPointerUp,A=>{const L=S.current,q=A.target;if(q.hasPointerCapture(A.pointerId)&&q.releasePointerCapture(A.pointerId),S.current=null,$.current=null,L){const G=A.currentTarget,Y={originalEvent:A,delta:L};PA(L,m.swipeDirection,m.swipeThreshold)?Sm(dRe,g,Y,{discrete:!0}):Sm(uRe,p,Y,{discrete:!0}),G.addEventListener("click",K=>K.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),hRe=e=>{const{__scopeToast:t,children:n,...r}=e,s=Cm(Tm,t),[a,i]=x.useState(!1),[l,c]=x.useState(!1);return bRe(()=>i(!0)),x.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:C.jsx(Yu,{asChild:!0,children:C.jsx(Mx,{...r,children:a&&C.jsxs(C.Fragment,{children:[s.label," ",n]})})})},gRe="ToastTitle",wA=x.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return C.jsx(Mt.div,{...r,ref:t})});wA.displayName=gRe;var yRe="ToastDescription",$A=x.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return C.jsx(Mt.div,{...r,ref:t})});$A.displayName=yRe;var CA="ToastAction",TA=x.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?C.jsx(EA,{altText:n,asChild:!0,children:C.jsx(Nx,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${CA}\`. Expected non-empty \`string\`.`),null)});TA.displayName=CA;var SA="ToastClose",Nx=x.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,s=pRe(SA,n);return C.jsx(EA,{asChild:!0,children:C.jsx(Mt.button,{type:"button",...r,ref:t,onClick:Ye(e.onClick,s.onClose)})})});Nx.displayName=SA;var EA=x.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...s}=e;return C.jsx(Mt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:t})});function _A(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),vRe(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",a=r.dataset.radixToastAnnounceExclude==="";if(!s)if(a){const i=r.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(..._A(r))}}),t}function Sm(e,t,n,{discrete:r}){const s=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?km(s,a):s.dispatchEvent(a)}var PA=(e,t,n=0)=>{const r=Math.abs(e.x),s=Math.abs(e.y),a=r>s;return t==="left"||t==="right"?a&&r>n:!a&&s>n};function bRe(e=()=>{}){const t=Vn(e);cs(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function vRe(e){return e.nodeType===e.ELEMENT_NODE}function xRe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ax(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var OA=bA,kA=xA,MA=wA,DA=$A,IA=TA,RA=Nx;const wRe=x.forwardRef(({className:e,...t},n)=>C.jsx(OA,{ref:n,className:yt("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}));wRe.displayName=OA.displayName;const $Re=Wx("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 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 text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),CRe=x.forwardRef(({className:e,variant:t,...n},r)=>C.jsx(kA,{ref:r,className:yt($Re({variant:t}),e),...n}));CRe.displayName=kA.displayName;const TRe=x.forwardRef(({className:e,...t},n)=>C.jsx(IA,{ref:n,className:yt("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 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}));TRe.displayName=IA.displayName;const SRe=x.forwardRef(({className:e,...t},n)=>C.jsx(RA,{ref:n,className:yt("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 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:C.jsx(nw,{className:"h-4 w-4"})}));SRe.displayName=RA.displayName;const ERe=x.forwardRef(({className:e,...t},n)=>C.jsx(MA,{ref:n,className:yt("text-sm font-semibold",e),...t}));ERe.displayName=MA.displayName;const _Re=x.forwardRef(({className:e,...t},n)=>C.jsx(DA,{ref:n,className:yt("text-sm opacity-90",e),...t}));_Re.displayName=DA.displayName,Yn.Button=Ao,Yn.Input=Qx,Yn.IntegrationHorizontal=eA,Yn.IntegrationList=WIe,Yn.IntegrationVertical=nA,Yn.LoadingSpinner=js,Yn.RedirectFromAuth=nRe,Object.defineProperty(Yn,Symbol.toStringTag,{value:"Module"})});
|
|
402
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},$Ie="DialogDescriptionWarning",CIe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${MN($Ie).contentName}}.`;return x.useEffect(()=>{var a;const s=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},TIe=bN,SIe=wN,DN=$N,IN=CN,RN=SN,NN=_N,AN=ON;const EIe=TIe,_Ie=SIe,PIe=AN,jN=x.forwardRef(({className:e,...t},n)=>C.jsx(DN,{ref:n,className:yt("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));jN.displayName=DN.displayName;const LN=x.forwardRef(({className:e,children:t,...n},r)=>C.jsxs(_Ie,{children:[C.jsx(jN,{}),C.jsxs(IN,{ref:r,className:yt("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,C.jsxs(AN,{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:[C.jsx(nw,{className:"h-4 w-4"}),C.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));LN.displayName=IN.displayName;const FN=({className:e,...t})=>C.jsx("div",{className:yt("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});FN.displayName="DialogHeader";const VN=({className:e,...t})=>C.jsx("div",{className:yt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});VN.displayName="DialogFooter";const zN=x.forwardRef(({className:e,...t},n)=>C.jsx(RN,{ref:n,className:yt("text-lg font-semibold leading-none tracking-tight",e),...t}));zN.displayName=RN.displayName;const BN=x.forwardRef(({className:e,...t},n)=>C.jsx(NN,{ref:n,className:yt("text-sm text-muted-foreground",e),...t}));BN.displayName=NN.displayName;const UN=x.forwardRef(({className:e,...t},n)=>C.jsx("div",{className:"relative w-full overflow-auto",children:C.jsx("table",{ref:n,className:yt("w-full caption-bottom text-sm",e),...t})}));UN.displayName="Table";const WN=x.forwardRef(({className:e,...t},n)=>C.jsx("thead",{ref:n,className:yt("[&_tr]:border-b",e),...t}));WN.displayName="TableHeader";const HN=x.forwardRef(({className:e,...t},n)=>C.jsx("tbody",{ref:n,className:yt("[&_tr:last-child]:border-0",e),...t}));HN.displayName="TableBody";const OIe=x.forwardRef(({className:e,...t},n)=>C.jsx("tfoot",{ref:n,className:yt("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));OIe.displayName="TableFooter";const Sx=x.forwardRef(({className:e,...t},n)=>C.jsx("tr",{ref:n,className:yt("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Sx.displayName="TableRow";const qN=x.forwardRef(({className:e,...t},n)=>C.jsx("th",{ref:n,className:yt("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));qN.displayName="TableHead";const GN=x.forwardRef(({className:e,...t},n)=>C.jsx("td",{ref:n,className:yt("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));GN.displayName="TableCell";const kIe=x.forwardRef(({className:e,...t},n)=>C.jsx("caption",{ref:n,className:yt("mt-4 text-sm text-muted-foreground",e),...t}));kIe.displayName="TableCaption";const MIe=({friggBaseUrl:e,authToken:t,integrationId:n})=>{const[r,s]=O.useState([]),[a,i]=O.useState([]),{toast:l}=wm();return O.useEffect(()=>{(async()=>{if(t){let d=await new jo(e,t).getSampleData(n);if(d&&d.error){l({variant:"destructive",title:"Oops",description:d.error});return}d.constructor!==Array&&(d=d.data);const f=d&&d.length?Object.keys(d[0]):[],p=f&&f.length?d:[];s(f),i(p)}})()},[t,e,n,l]),r.length>0?C.jsx("div",{className:"m-3 border rounded",children:C.jsxs(UN,{children:[C.jsx(WN,{children:C.jsx(Sx,{children:r.map((c,u)=>C.jsx(qN,{children:c},u))})}),C.jsx(HN,{children:a.map((c,u)=>C.jsx(Sx,{children:Object.values(c).map((d,f)=>C.jsx(GN,{children:`${d}`},f))},u))})]})}):C.jsx("div",{className:"flex w-full justify-center m-5",children:C.jsx("h1",{className:"text-lg",children:"No data available"})})},DIe=({isOpen:e,setOpen:t,friggBaseUrl:n,authToken:r,integrationId:s})=>C.jsx(EIe,{open:e,onOpenChange:t,children:C.jsxs(LN,{children:[C.jsxs(FN,{children:[C.jsx(zN,{children:"Integration Sample Data"}),C.jsx(BN,{children:"See the sample data provided by your integration."})]}),C.jsx("div",{className:"flex items-center space-x-2",children:C.jsx(MIe,{friggBaseUrl:n,authToken:r,integrationId:s})}),C.jsx(VN,{className:"sm:justify-start",children:C.jsx(PIe,{asChild:!0,children:C.jsx(Ao,{type:"button",variant:"secondary",children:"Close"})})})]})});function IIe({disconnectIntegration:e,userActions:t,integrationConfiguration:n,integrationId:r,navigateToSampleDataFn:s,friggBaseUrl:a,authToken:i}){const[l,c]=O.useState(!1),[u,d]=O.useState({}),[f,p]=O.useState(!1),g=async()=>{await e()};function b(){c(!1)}async function m(v){if(v.action==="SAMPLE_DATA"){await h();return}y(v)}const h=async()=>{if(s!==void 0){s(r);return}p(!0)};function y(v){c(!0),d({action:v.action,title:v.title,description:v.description})}return C.jsxs(C.Fragment,{children:[C.jsxs(wV,{children:[C.jsx($V,{children:C.jsx(tw,{})}),C.jsxs(aC,{children:[C.jsx(iC,{children:C.jsxs("div",{className:"flex",children:[C.jsx(Dj,{className:"mr-2 h-4 w-4"})," ",C.jsx("span",{children:"Quick Actions"})]})}),C.jsx(ud,{}),t.map(v=>C.jsx(cd,{onClick:()=>m(v),children:v.title},v.title)),n&&C.jsxs(C.Fragment,{children:[C.jsx(ud,{}),C.jsx(cd,{onClick:n,children:"Configure Integration"})]}),C.jsx(ud,{}),C.jsxs(cd,{onClick:g,className:"text-destructive focus:text-destructive",children:[C.jsx(Mj,{className:"mr-2 h-4 w-4"}),C.jsx("p",{children:"Disconnect"})]})]})]}),l?C.jsx(pIe,{closeConfigModal:b,integrationId:r,userActionDetails:u,friggBaseUrl:a,authToken:i}):null,C.jsx(DIe,{isOpen:f,setOpen:p,integrationId:r,friggBaseUrl:a,authToken:i})]})}function RIe(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Ex="Switch",[NIe,PAe]=is(Ex),[AIe,jIe]=NIe(Ex),KN=x.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:a,required:i,disabled:l,value:c="on",onCheckedChange:u,...d}=e,[f,p]=x.useState(null),g=an(t,v=>p(v)),b=x.useRef(!1),m=f?!!f.closest("form"):!0,[h=!1,y]=wl({prop:s,defaultProp:a,onChange:u});return C.jsxs(AIe,{scope:n,checked:h,disabled:l,children:[C.jsx(Mt.button,{type:"button",role:"switch","aria-checked":h,"aria-required":i,"data-state":XN(h),"data-disabled":l?"":void 0,disabled:l,value:c,...d,ref:g,onClick:Ye(e.onClick,v=>{y($=>!$),m&&(b.current=v.isPropagationStopped(),b.current||v.stopPropagation())})}),m&&C.jsx(LIe,{control:f,bubbles:!b.current,name:r,value:c,checked:h,required:i,disabled:l,style:{transform:"translateX(-100%)"}})]})});KN.displayName=Ex;var YN="SwitchThumb",JN=x.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=jIe(YN,n);return C.jsx(Mt.span,{"data-state":XN(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});JN.displayName=YN;var LIe=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,a=x.useRef(null),i=RIe(n),l=Nw(t);return x.useEffect(()=>{const c=a.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(i!==n&&f){const p=new Event("click",{bubbles:r});f.call(c,n),c.dispatchEvent(p)}},[i,n,r]),C.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:a,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function XN(e){return e?"checked":"unchecked"}var ZN=KN,FIe=JN;const QN=x.forwardRef(({className:e,...t},n)=>C.jsx(ZN,{className:yt("peer inline-flex h-6 w-11 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-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:C.jsx(FIe,{className:yt("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));QN.displayName=ZN.displayName;function eA(e){const{authToken:t,refreshIntegrations:n,friggBaseUrl:r,navigateToSampleDataFn:s}=e,{name:a,description:i,icon:l}=e.data.display,{type:c,status:u,id:d}=e.data,[f,p]=O.useState(!1),[g,b]=O.useState(u),[m,h]=O.useState(!1),[y,v]=O.useState(!1),[$,S]=O.useState([]),w=new jo(r,t);O.useEffect(()=>{const U=[{title:"Get Sample Data",action:"SAMPLE_DATA"}];Object.keys(e.data.userActions||{}).map(V=>{U.push({title:e.data.userActions[V].title,description:e.data.userActions[V].description,action:V})}),S(U)},[e.data.userActions]);const P=async()=>{p(!0);const U=await w.getAuthorizeRequirements(c,"");if(U.type==="oauth2"&&(window.location.href=U.url),U.type!=="oauth2"){let V=U.data;for(const A of Object.entries(V.uiSchema))A["ui:widget"]||(A["ui:widget"]="text");k()}};function k(){h(!0)}function N(){h(!1),p(!1)}function I(){v(!0)}function F(){v(!1),p(!1)}const W=async()=>{await w.deleteIntegration(e.data.id),p(!0),b(!1),await n(e),p(!1)};return C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"flex flex-nowrap p-4 bg-white rounded-lg shadow-xs","data-testid":"integration-horizontal",children:[C.jsxs("div",{className:"flex flex-1",children:[C.jsx("img",{className:"mr-3 w-[80px] h-[80px] rounded-lg",alt:a,src:l}),C.jsxs("div",{className:"pr-1 overflow-hidden",children:[C.jsx("p",{className:"w-full text-lg font-semibold text-gray-700 truncate ...",children:a}),C.jsx("p",{className:"pt-2 text-sm font-medium text-gray-600",children:i}),g&&g==="NEEDS_CONFIG"&&C.jsxs("p",{className:"inline-flex pt-2 text-xs font-medium text-orange-500 gap-1",children:[C.jsx(kj,{className:"w-4 h-4"})," Configure"]})]})]}),C.jsx("div",{children:C.jsx("div",{className:"flex flex-col h-full align-items-end",children:g?C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"flex-1",children:C.jsx("label",{htmlFor:a,className:"flex items-center cursor-pointer",children:C.jsx(QN,{name:a,id:a,checked:!0})})}),C.jsx("div",{className:"flex flex-row-reverse",children:C.jsx(IIe,{userActions:$,integrationConfiguration:I,disconnectIntegration:W,integrationId:d,navigateToSampleDataFn:s,friggBaseUrl:r,authToken:t})})]}):C.jsx(Ao,{onClick:P,children:f?C.jsx(js,{}):"Connect"})})})]}),m?C.jsx(lIe,{isAuthModalOpen:m,closeAuthModal:N,refreshIntegrations:n,name:a,type:c,friggBaseUrl:r,authToken:t}):null,y?C.jsx(dIe,{isConfigModalOpen:y,closeConfigModal:F,name:a,refreshIntegrations:()=>n(e),integrationId:e.data.id,friggBaseUrl:r,authToken:t}):null]})}function ns({layout:e}){return C.jsxs(C.Fragment,{children:[e=="default-horizontal"&&C.jsxs("div",{"data-testid":"skeleton-horizontal",className:"flex p-4 bg-gray-200 rounded-lg shadow-xs animate-pulse",children:[C.jsx("div",{className:"mr-4 w-20 h-20 bg-gray-400 rounded-lg overflow-hidden animate-pulse"}),C.jsxs("div",{children:[C.jsx("p",{className:"h-6 w-20 bg-gray-400 animate-pulse"}),C.jsx("p",{className:"mb-2 mt-2 h-4 w-16 bg-gray-400 animate-pulse"})]}),C.jsx("div",{className:"ml-auto",children:C.jsx("div",{className:"relative",children:C.jsx("div",{className:"px-3 py-2 h-10 w-16 bg-gray-400 animate-pulse"})})})]}),e=="default-vertical"&&C.jsxs("div",{"data-testid":"skeleton-vertical",className:"flex flex-col items-center p-4 bg-gray-200 rounded-lg shadow-xs animate-pulse",children:[C.jsx("div",{className:"w-[120px] h-[120px] mt-4 bg-gray-400 rounded-full animate-pulse"}),C.jsx("div",{className:"mt-4 w-36 h-10 bg-gray-400 animate-pulse"}),C.jsx("div",{className:"mb-6 mt-2 w-16 h-6 bg-gray-400 animate-pulse"}),C.jsx("div",{className:"items-center pb-3",children:C.jsx("div",{className:"relative",children:C.jsx("div",{className:"w-40 h-14 bg-gray-400 rounded-lg"})})})]})]})}const VIe=e=>{const t=[],n=zIe(e);return tA(e).forEach(s=>{const a=n.filter(i=>i.type===s.type);a.length>0?a.forEach(i=>{t.push(i)}):t.push(s)}),t},zIe=e=>{const t=[];return e.integrations.forEach(n=>{const r={...n},s=r.entities[1].id,a=BIe(s,e);r.type=a,r.display=UIe(a,e),t.push(r)}),t},BIe=(e,t)=>{const r=t.entities.authorized.find(s=>s.id===e);if(r)return r.type;throw Error(`getTypeForId() ERR - entityId ${e} does not exist in authorized entities!`)},UIe=(e,t)=>{const r=tA(t).find(s=>s.type===e);if(r)return r.display;throw Error(`getDisplayForType() ERR - type ${e} does not exist in possible integrations!`)},tA=e=>e.entities.options,WIe=e=>{const[t,n]=O.useState([]),[r,s]=O.useState([]),[a,i]=O.useState(!0),l=O.useCallback(async()=>{const p=await new jo(e.friggBaseUrl,e.authToken).listIntegrations();if(p.error&&console.log("Something went wrong while fetching integrations, please try again later."),p.integrations){const g=VIe(p);s(g)}},[e.authToken,e.friggBaseUrl]);O.useEffect(()=>{if(!e.authToken){console.log("Authentication token is required to fetch integrations.");return}l().then(()=>i(!1))},[l,e.authToken]);const c=f=>{const p=[f,...t];n(p)},u=f=>{if(e.componentLayout==="default-horizontal")return C.jsx(eA,{data:f,handleInstall:c,refreshIntegrations:l,friggBaseUrl:e.friggBaseUrl,authToken:e.authToken,navigateToSampleDataFn:e.navigateToSampleDataFn},`combined-integration-${f.type}`);if(e.componentLayout==="default-vertical")return C.jsx(nA,{data:f,handleInstall:c,refreshIntegrations:l,friggBaseUrl:e.friggBaseUrl},`combined-integration-${f.type}`)},d=f=>e.integrationType==="Recently added"?f.map(p=>u(p)):e.integrationType==="Installed"?t.map(p=>u(p)):f.filter(p=>p.display.description===e.integrationType).map(p=>u(p));return C.jsxs(C.Fragment,{children:[a&&C.jsxs("div",{className:"grid gap-6 lg:col-span-1 lg:grid-cols-1 xl:col-span-2 xl:grid-cols-2 2xl:col-span-3 2xl:grid-cols-3",children:[C.jsx(ns,{layout:e.componentLayout}),C.jsx(ns,{layout:e.componentLayout}),C.jsx(ns,{layout:e.componentLayout}),C.jsx(ns,{layout:e.componentLayout}),C.jsx(ns,{layout:e.componentLayout}),C.jsx(ns,{layout:e.componentLayout}),C.jsx(ns,{layout:e.componentLayout}),C.jsx(ns,{layout:e.componentLayout}),C.jsx(ns,{layout:e.componentLayout})]}),d(r).length===0?C.jsxs("p",{children:["No ",e.integrationType," integrations found."]}):d(r)]})};function nA(e){const{name:t,description:n,category:r,icon:s}=e.data.display,{hasUserConfig:a,type:i}=e.data,{authToken:l,refreshIntegrations:c}=e,[u,d]=O.useState(!1),[f,p]=O.useState(""),[g,b]=O.useState([]),m=new jo(e.friggBaseUrl,l),h=async()=>{d(!0);const w=await m.getAuthorizeRequirements(i,"");w.type==="oauth2"&&(window.location.href=w.url),w.type!=="oauth2"&&y()},y=()=>{v()},v=()=>{let w;switch(e.data.status){case"NEEDS_CONFIG":w="INITIAL";break;case"ENABLED":w="CONFIGURE";break;default:w="AUTHORIZE"}return w},$=async()=>{alert("Implement sample data fetching logic here")},S=async()=>{await m.deleteIntegration(e.data.id),(await m.listIntegrations()).error||alert("Integration disconnected successfully"),b([]),p("")};return C.jsx(C.Fragment,{children:C.jsxs("div",{className:"flex flex-col items-center p-4 bg-white rounded-lg shadow-xs","data-testid":"integration-vertical",children:[C.jsxs("div",{className:"flex w-full h-[24px]",children:[C.jsx("div",{className:"inline-flex relative mr-auto",children:f&&f==="NEEDS_CONFIG"&&C.jsxs("p",{className:"inline-flex text-xs font-medium text-red-300 text-center",children:[C.jsx(_j,{className:"w-4 h-4 mr-1"})," Configure"]})}),C.jsx("div",{className:"inline-flex relative justify-end ml-auto",children:f&&f==="ENABLED"||f==="NEEDS_CONFIG"&&C.jsx(Ij,{getSampleData:$,disconnectIntegration:S,name:t,hasUserConfig:a})})]}),C.jsx("img",{className:"w-[120px] h-[120px] rounded-full",alt:t,src:s}),C.jsxs("div",{className:"pr-1 pt-4 pb-4 overflow-hidden",children:[C.jsx("p",{className:"w-full text-2xl font-semibold text-gray-700 text-center truncate ...",children:t}),C.jsx("p",{className:"w-full pt-2 text-md font-medium text-gray-600 text-center",children:n})]}),C.jsx("div",{className:"items-center pb-3",children:C.jsxs("div",{className:"relative",children:[f&&f==="ENABLED"||f==="NEEDS_CONFIG"&&C.jsx("button",{onClick:S,className:"w-full px-5 py-3 font-medium leading-5 text-center text-primary transition-colors duration-150 rounded-lg border-2 border-purple-400 hover:border-purple-600 hover:bg-purple-600 hover:text-white focus:outline-none focus:shadow-outline-purple",children:"Disconnect"}),!f&&C.jsx(Ao,{onClick:h,children:u?C.jsx(js,{}):"Connect"})]})})]})})}const rA="%[a-f0-9]{2}",oA=new RegExp("("+rA+")|([^%]+?)","gi"),sA=new RegExp("("+rA+")+","gi");function _x(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;t=t||1;const n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],_x(n),_x(r))}function HIe(e){try{return decodeURIComponent(e)}catch{let t=e.match(oA)||[];for(let n=1;n<t.length;n++)e=_x(t,n).join(""),t=e.match(oA)||[];return e}}function qIe(e){const t={"%FE%FF":"��","%FF%FE":"��"};let n=sA.exec(e);for(;n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{const s=HIe(n[0]);s!==n[0]&&(t[n[0]]=s)}n=sA.exec(e)}t["%C2"]="�";const r=Object.keys(t);for(const s of r)e=e.replace(new RegExp(s,"g"),t[s]);return e}function GIe(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return qIe(e)}}function KIe(e,t){const n={};if(Array.isArray(t))for(const r of t){const s=Object.getOwnPropertyDescriptor(e,r);s!=null&&s.enumerable&&Object.defineProperty(n,r,s)}else for(const r of Reflect.ownKeys(e)){const s=Object.getOwnPropertyDescriptor(e,r);if(s.enumerable){const a=e[r];t(r,a,e)&&Object.defineProperty(n,r,s)}}return n}function aA(e,t){if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e===""||t==="")return[];const n=e.indexOf(t);return n===-1?[]:[e.slice(0,n),e.slice(n+t.length)]}const YIe=e=>e==null,JIe=e=>encodeURIComponent(e).replaceAll(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),Px=Symbol("encodeFragmentIdentifier");function XIe(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const s=n.length;return r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[un(t,e),"[",s,"]"].join("")]:[...n,[un(t,e),"[",un(s,e),"]=",un(r,e)].join("")]};case"bracket":return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[un(t,e),"[]"].join("")]:[...n,[un(t,e),"[]=",un(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[un(t,e),":list="].join("")]:[...n,[un(t,e),":list=",un(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t=e.arrayFormat==="bracket-separator"?"[]=":"=";return n=>(r,s)=>s===void 0||e.skipNull&&s===null||e.skipEmptyString&&s===""?r:(s=s===null?"":s,r.length===0?[[un(n,e),t,un(s,e)].join("")]:[[r,un(s,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,un(t,e)]:[...n,[un(t,e),"=",un(r,e)].join("")]}}function ZIe(e){let t;switch(e.arrayFormat){case"index":return(n,r,s)=>{if(t=/\[(\d*)]$/.exec(n),n=n.replace(/\[\d*]$/,""),!t){s[n]=r;return}s[n]===void 0&&(s[n]={}),s[n][t[1]]=r};case"bracket":return(n,r,s)=>{if(t=/(\[])$/.exec(n),n=n.replace(/\[]$/,""),!t){s[n]=r;return}if(s[n]===void 0){s[n]=[r];return}s[n]=[...s[n],r]};case"colon-list-separator":return(n,r,s)=>{if(t=/(:list)$/.exec(n),n=n.replace(/:list$/,""),!t){s[n]=r;return}if(s[n]===void 0){s[n]=[r];return}s[n]=[...s[n],r]};case"comma":case"separator":return(n,r,s)=>{const a=typeof r=="string"&&r.includes(e.arrayFormatSeparator),i=typeof r=="string"&&!a&&rs(r,e).includes(e.arrayFormatSeparator);r=i?rs(r,e):r;const l=a||i?r.split(e.arrayFormatSeparator).map(c=>rs(c,e)):r===null?r:rs(r,e);s[n]=l};case"bracket-separator":return(n,r,s)=>{const a=/(\[])$/.test(n);if(n=n.replace(/\[]$/,""),!a){s[n]=r&&rs(r,e);return}const i=r===null?[]:r.split(e.arrayFormatSeparator).map(l=>rs(l,e));if(s[n]===void 0){s[n]=i;return}s[n]=[...s[n],...i]};default:return(n,r,s)=>{if(s[n]===void 0){s[n]=r;return}s[n]=[...[s[n]].flat(),r]}}}function iA(e){if(typeof e!="string"||e.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function un(e,t){return t.encode?t.strict?JIe(e):encodeURIComponent(e):e}function rs(e,t){return t.decode?GIe(e):e}function lA(e){return Array.isArray(e)?e.sort():typeof e=="object"?lA(Object.keys(e)).sort((t,n)=>Number(t)-Number(n)).map(t=>e[t]):e}function cA(e){const t=e.indexOf("#");return t!==-1&&(e=e.slice(0,t)),e}function QIe(e){let t="";const n=e.indexOf("#");return n!==-1&&(t=e.slice(n)),t}function uA(e,t,n){return n==="string"&&typeof e=="string"?e:typeof n=="function"&&typeof e=="string"?n(e):t.parseBooleans&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")?e.toLowerCase()==="true":n==="number"&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""||t.parseNumbers&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?Number(e):e}function Ox(e){e=cA(e);const t=e.indexOf("?");return t===-1?"":e.slice(t+1)}function kx(e,t){t={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,types:Object.create(null),...t},iA(t.arrayFormatSeparator);const n=ZIe(t),r=Object.create(null);if(typeof e!="string"||(e=e.trim().replace(/^[?#&]/,""),!e))return r;for(const s of e.split("&")){if(s==="")continue;const a=t.decode?s.replaceAll("+"," "):s;let[i,l]=aA(a,"=");i===void 0&&(i=a),l=l===void 0?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?l:rs(l,t),n(rs(i,t),l,r)}for(const[s,a]of Object.entries(r))if(typeof a=="object"&&a!==null&&t.types[s]!=="string")for(const[i,l]of Object.entries(a)){const c=t.types[s]?t.types[s].replace("[]",""):void 0;a[i]=uA(l,t,c)}else typeof a=="object"&&a!==null&&t.types[s]==="string"?r[s]=Object.values(a).join(t.arrayFormatSeparator):r[s]=uA(a,t,t.types[s]);return t.sort===!1?r:(t.sort===!0?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce((s,a)=>{const i=r[a];return s[a]=i&&typeof i=="object"&&!Array.isArray(i)?lA(i):i,s},Object.create(null))}function dA(e,t){if(!e)return"";t={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...t},iA(t.arrayFormatSeparator);const n=i=>t.skipNull&&YIe(e[i])||t.skipEmptyString&&e[i]==="",r=XIe(t),s={};for(const[i,l]of Object.entries(e))n(i)||(s[i]=l);const a=Object.keys(s);return t.sort!==!1&&a.sort(t.sort),a.map(i=>{const l=e[i];return l===void 0?"":l===null?un(i,t):Array.isArray(l)?l.length===0&&t.arrayFormat==="bracket-separator"?un(i,t)+"[]":l.reduce(r(i),[]).join("&"):un(i,t)+"="+un(l,t)}).filter(i=>i.length>0).join("&")}function fA(e,t){var s;t={decode:!0,...t};let[n,r]=aA(e,"#");return n===void 0&&(n=e),{url:((s=n==null?void 0:n.split("?"))==null?void 0:s[0])??"",query:kx(Ox(e),t),...t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:rs(r,t)}:{}}}function pA(e,t){t={encode:!0,strict:!0,[Px]:!0,...t};const n=cA(e.url).split("?")[0]||"",r=Ox(e.url),s={...kx(r,{sort:!1}),...e.query};let a=dA(s,t);a&&(a=`?${a}`);let i=QIe(e.url);if(typeof e.fragmentIdentifier=="string"){const l=new URL(n);l.hash=e.fragmentIdentifier,i=t[Px]?l.hash:`#${e.fragmentIdentifier}`}return`${n}${a}${i}`}function mA(e,t,n){n={parseFragmentIdentifier:!0,[Px]:!1,...n};const{url:r,query:s,fragmentIdentifier:a}=fA(e,n);return pA({url:r,query:KIe(s,t),fragmentIdentifier:a},n)}function eRe(e,t,n){const r=Array.isArray(t)?s=>!t.includes(s):(s,a)=>!t(s,a);return mA(e,r,n)}const tRe=Object.freeze(Object.defineProperty({__proto__:null,exclude:eRe,extract:Ox,parse:kx,parseUrl:fA,pick:mA,stringify:dA,stringifyUrl:pA},Symbol.toStringTag,{value:"Module"})),nRe=e=>(O.useEffect(()=>{(async()=>{const n=new jo(e.friggBaseUrl,e.authToken),r=tRe.parse(window.location.search);if(r.code){const s=await n.authorize(e.app,{code:r.code}),a=await n.listIntegrations();if(s!=null&&s.error){alert(s.error),e.redirectToUrl();return}const i={type:e.app,category:"CRM"},l=a.entities.authorized.find(u=>u.type===e.primaryEntityName),c=await n.createIntegration(l.id??s.entity_id,s.entity_id,i);if(c.error){alert(c.error);return}e.redirectToUrl()}})()},[]),C.jsx("div",{className:"flex items-center justify-center h-screen w-screen",children:C.jsx(js,{})}));var rRe="VisuallyHidden",Mx=x.forwardRef((e,t)=>C.jsx(Mt.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Mx.displayName=rRe;var oRe="ToastProvider",[hA,sRe,aRe]=Mm("Toast"),[gA,OAe]=is("Toast",[aRe]),[kAe,Cm]=gA(oRe),yA="ToastViewport",iRe=["F8"],Dx="toast.viewportPause",Ix="toast.viewportResume",bA=x.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=iRe,label:s="Notifications ({hotkey})",...a}=e,i=Cm(yA,n),l=sRe(n),c=x.useRef(null),u=x.useRef(null),d=x.useRef(null),f=x.useRef(null),p=an(t,f,i.onViewportChange),g=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=i.toastCount>0;x.useEffect(()=>{const h=y=>{var $;r.every(S=>y[S]||y.code===S)&&(($=f.current)==null||$.focus())};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[r]),x.useEffect(()=>{const h=c.current,y=f.current;if(b&&h&&y){const v=()=>{if(!i.isClosePausedRef.current){const P=new CustomEvent(Dx);y.dispatchEvent(P),i.isClosePausedRef.current=!0}},$=()=>{if(i.isClosePausedRef.current){const P=new CustomEvent(Ix);y.dispatchEvent(P),i.isClosePausedRef.current=!1}},S=P=>{!h.contains(P.relatedTarget)&&$()},w=()=>{h.contains(document.activeElement)||$()};return h.addEventListener("focusin",v),h.addEventListener("focusout",S),h.addEventListener("pointermove",v),h.addEventListener("pointerleave",w),window.addEventListener("blur",v),window.addEventListener("focus",$),()=>{h.removeEventListener("focusin",v),h.removeEventListener("focusout",S),h.removeEventListener("pointermove",v),h.removeEventListener("pointerleave",w),window.removeEventListener("blur",v),window.removeEventListener("focus",$)}}},[b,i.isClosePausedRef]);const m=x.useCallback(({tabbingDirection:h})=>{const v=l().map($=>{const S=$.ref.current,w=[S,...xRe(S)];return h==="forwards"?w:w.reverse()});return(h==="forwards"?v.reverse():v).flat()},[l]);return x.useEffect(()=>{const h=f.current;if(h){const y=v=>{var w,P,k;const $=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!$){const N=document.activeElement,I=v.shiftKey;if(v.target===h&&I){(w=u.current)==null||w.focus();return}const U=m({tabbingDirection:I?"backwards":"forwards"}),V=U.findIndex(A=>A===N);Ax(U.slice(V+1))?v.preventDefault():I?(P=u.current)==null||P.focus():(k=d.current)==null||k.focus()}};return h.addEventListener("keydown",y),()=>h.removeEventListener("keydown",y)}},[l,m]),C.jsxs(Gj,{ref:c,role:"region","aria-label":s.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&C.jsx(Rx,{ref:u,onFocusFromOutsideViewport:()=>{const h=m({tabbingDirection:"forwards"});Ax(h)}}),C.jsx(hA.Slot,{scope:n,children:C.jsx(Mt.ol,{tabIndex:-1,...a,ref:p})}),b&&C.jsx(Rx,{ref:d,onFocusFromOutsideViewport:()=>{const h=m({tabbingDirection:"backwards"});Ax(h)}})]})});bA.displayName=yA;var vA="ToastFocusProxy",Rx=x.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=e,a=Cm(vA,n);return C.jsx(Mx,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:i=>{var u;const l=i.relatedTarget;!((u=a.viewport)!=null&&u.contains(l))&&r()}})});Rx.displayName=vA;var Tm="Toast",lRe="toast.swipeStart",cRe="toast.swipeMove",uRe="toast.swipeCancel",dRe="toast.swipeEnd",xA=x.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:a,...i}=e,[l=!0,c]=wl({prop:r,defaultProp:s,onChange:a});return C.jsx(zo,{present:n||l,children:C.jsx(mRe,{open:l,...i,ref:t,onClose:()=>c(!1),onPause:Vn(e.onPause),onResume:Vn(e.onResume),onSwipeStart:Ye(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ye(e.onSwipeMove,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:Ye(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ye(e.onSwipeEnd,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),c(!1)})})})});xA.displayName=Tm;var[fRe,pRe]=gA(Tm,{onClose(){}}),mRe=x.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:a,onClose:i,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:p,onSwipeEnd:g,...b}=e,m=Cm(Tm,n),[h,y]=x.useState(null),v=an(t,A=>y(A)),$=x.useRef(null),S=x.useRef(null),w=s||m.duration,P=x.useRef(0),k=x.useRef(w),N=x.useRef(0),{onToastAdd:I,onToastRemove:F}=m,W=Vn(()=>{var L;(h==null?void 0:h.contains(document.activeElement))&&((L=m.viewport)==null||L.focus()),i()}),U=x.useCallback(A=>{!A||A===1/0||(window.clearTimeout(N.current),P.current=new Date().getTime(),N.current=window.setTimeout(W,A))},[W]);x.useEffect(()=>{const A=m.viewport;if(A){const L=()=>{U(k.current),u==null||u()},q=()=>{const G=new Date().getTime()-P.current;k.current=k.current-G,window.clearTimeout(N.current),c==null||c()};return A.addEventListener(Dx,q),A.addEventListener(Ix,L),()=>{A.removeEventListener(Dx,q),A.removeEventListener(Ix,L)}}},[m.viewport,w,c,u,U]),x.useEffect(()=>{a&&!m.isClosePausedRef.current&&U(w)},[a,w,m.isClosePausedRef,U]),x.useEffect(()=>(I(),()=>F()),[I,F]);const V=x.useMemo(()=>h?_A(h):null,[h]);return m.viewport?C.jsxs(C.Fragment,{children:[V&&C.jsx(hRe,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:V}),C.jsx(fRe,{scope:n,onClose:W,children:gl.createPortal(C.jsx(hA.ItemSlot,{scope:n,children:C.jsx(qj,{asChild:!0,onEscapeKeyDown:Ye(l,()=>{m.isFocusedToastEscapeKeyDownRef.current||W(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:C.jsx(Mt.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":m.swipeDirection,...b,ref:v,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Ye(e.onKeyDown,A=>{A.key==="Escape"&&(l==null||l(A.nativeEvent),A.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,W()))}),onPointerDown:Ye(e.onPointerDown,A=>{A.button===0&&($.current={x:A.clientX,y:A.clientY})}),onPointerMove:Ye(e.onPointerMove,A=>{if(!$.current)return;const L=A.clientX-$.current.x,q=A.clientY-$.current.y,G=!!S.current,Y=["left","right"].includes(m.swipeDirection),K=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,j=Y?K(0,L):0,M=Y?0:K(0,q),B=A.pointerType==="touch"?10:2,R={x:j,y:M},T={originalEvent:A,delta:R};G?(S.current=R,Sm(cRe,f,T,{discrete:!1})):PA(R,m.swipeDirection,B)?(S.current=R,Sm(lRe,d,T,{discrete:!1}),A.target.setPointerCapture(A.pointerId)):(Math.abs(L)>B||Math.abs(q)>B)&&($.current=null)}),onPointerUp:Ye(e.onPointerUp,A=>{const L=S.current,q=A.target;if(q.hasPointerCapture(A.pointerId)&&q.releasePointerCapture(A.pointerId),S.current=null,$.current=null,L){const G=A.currentTarget,Y={originalEvent:A,delta:L};PA(L,m.swipeDirection,m.swipeThreshold)?Sm(dRe,g,Y,{discrete:!0}):Sm(uRe,p,Y,{discrete:!0}),G.addEventListener("click",K=>K.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),hRe=e=>{const{__scopeToast:t,children:n,...r}=e,s=Cm(Tm,t),[a,i]=x.useState(!1),[l,c]=x.useState(!1);return bRe(()=>i(!0)),x.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:C.jsx(Yu,{asChild:!0,children:C.jsx(Mx,{...r,children:a&&C.jsxs(C.Fragment,{children:[s.label," ",n]})})})},gRe="ToastTitle",wA=x.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return C.jsx(Mt.div,{...r,ref:t})});wA.displayName=gRe;var yRe="ToastDescription",$A=x.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return C.jsx(Mt.div,{...r,ref:t})});$A.displayName=yRe;var CA="ToastAction",TA=x.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?C.jsx(EA,{altText:n,asChild:!0,children:C.jsx(Nx,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${CA}\`. Expected non-empty \`string\`.`),null)});TA.displayName=CA;var SA="ToastClose",Nx=x.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,s=pRe(SA,n);return C.jsx(EA,{asChild:!0,children:C.jsx(Mt.button,{type:"button",...r,ref:t,onClick:Ye(e.onClick,s.onClose)})})});Nx.displayName=SA;var EA=x.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...s}=e;return C.jsx(Mt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:t})});function _A(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),vRe(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",a=r.dataset.radixToastAnnounceExclude==="";if(!s)if(a){const i=r.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(..._A(r))}}),t}function Sm(e,t,n,{discrete:r}){const s=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?km(s,a):s.dispatchEvent(a)}var PA=(e,t,n=0)=>{const r=Math.abs(e.x),s=Math.abs(e.y),a=r>s;return t==="left"||t==="right"?a&&r>n:!a&&s>n};function bRe(e=()=>{}){const t=Vn(e);cs(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function vRe(e){return e.nodeType===e.ELEMENT_NODE}function xRe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ax(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var OA=bA,kA=xA,MA=wA,DA=$A,IA=TA,RA=Nx;const wRe=x.forwardRef(({className:e,...t},n)=>C.jsx(OA,{ref:n,className:yt("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}));wRe.displayName=OA.displayName;const $Re=Wx("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 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 text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),CRe=x.forwardRef(({className:e,variant:t,...n},r)=>C.jsx(kA,{ref:r,className:yt($Re({variant:t}),e),...n}));CRe.displayName=kA.displayName;const TRe=x.forwardRef(({className:e,...t},n)=>C.jsx(IA,{ref:n,className:yt("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 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}));TRe.displayName=IA.displayName;const SRe=x.forwardRef(({className:e,...t},n)=>C.jsx(RA,{ref:n,className:yt("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 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:C.jsx(nw,{className:"h-4 w-4"})}));SRe.displayName=RA.displayName;const ERe=x.forwardRef(({className:e,...t},n)=>C.jsx(MA,{ref:n,className:yt("text-sm font-semibold",e),...t}));ERe.displayName=MA.displayName;const _Re=x.forwardRef(({className:e,...t},n)=>C.jsx(DA,{ref:n,className:yt("text-sm opacity-90",e),...t}));_Re.displayName=DA.displayName,Yn.Button=Ao,Yn.Input=Qx,Yn.IntegrationHorizontal=eA,Yn.IntegrationList=WIe,Yn.IntegrationVertical=nA,Yn.LoadingSpinner=js,Yn.RedirectFromAuth=nRe,Object.defineProperty(Yn,Symbol.toStringTag,{value:"Module"})});
|
|
403
403
|
//# sourceMappingURL=index.umd.js.map
|