PageSourceSearch

https://www.promoamp.com/_app/immutable/nodes/50.CG5FrRxq.js

js promoamp.com collected 2026-09-25 18:44:43 UTC 5,105 bytes, 3 lines download raw bytes

1import"../chunks/NZTpNUN0.js";import{p as ae,l as S,v as W,a as o,b as oe,s as se,c as f,f as h,e as ne,n as g,r as u,d as s,i as F,g as O,o as t,j as r,t as ie}from"../chunks/CswluXHk.js";import{s as le}from"../chunks/D5MUd0dc.js";import{i as Y}from"../chunks/Cvwav-Rz.js";import{c as _}from"../chunks/DCqg9Lcd.js";import{d as pe,a as ce}from"../chunks/BnZqlU5Q.js";import{g as de}from"../chunks/CdQ3TTyj.js";import{p as me}from"../chunks/BfpkmJ9v.js";import"../chunks/aH0YTA77.js";import{t as P}from"../chunks/CFi-xeDB.js";import{B as q}from"../chunks/DltdByd6.js";import{I as M}from"../chunks/DuX34-Zw.js";import{C as fe}from"../chunks/BFGY4aR1.js";import{C as ue}from"../chunks/C3F0Z4bJ.js";import{C as ve,a as ge,b as ye}from"../chunks/DQXZ4mXD.js";import{C as _e}from"../chunks/BcsrqGLJ.js";import{A as he}from"../chunks/r7UZdRXb.js";var we=h("<!> <!>",1),$e=h('<p class="text-red-500 text-sm"> </p>'),xe=h(`<form class="space-y-4"><div class="space-y-4"><div class="space-y-2"><label for="apiKey" class="text-sm font-medium">API Key</label> <!> <p class="text-sm text-gray-500">Your SwipeOne API key can be found in your SwipeOne settings.</p></div> <div class="space-y-2"><label for="workspaceId" class="text-sm font-medium">Workspace ID</label> <!> <p class="text-sm text-gray-500">Your SwipeOne workspace ID can be found in your workspace
2              settings.</p></div></div> <!></form>`),be=h('<div class="flex items-center gap-4"><p class="text-sm text-gray-500">Need help? <a href="https://docs.swipeone.com/en/articles/10545314-contacts" target="_blank" rel="noopener noreferrer" class="text-blue-500 hover:underline">Learn how to get your API key</a></p></div> <div class="space-x-2"><!> <!></div>',1),ke=h("<!> <!> <!>",1),Ie=h('<div class="mb-20"><button class="flex items-center text-sm text-gray-600 hover:text-gray-900 mb-4"><!> Back to Integrations</button> <!></div>');function qe(z,L){ae(L,!0);const G=()=>ne(me,"$page",H),[H,Q]=se(),{swipeoneIntegration:E,team:R}=L.data;let w=S(W(E?.config?.api_key||"")),$=S(W(E?.config?.workspace_id||"")),p=S(""),A=S(!1),j=S(!1);async function U(){try{if(t(p,""),t(A,!0),!r(w)||!r($)){t(p,"API Key and Workspace ID are required");return}const e=await fetch("/api/install/swipeone",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({teamId:R.id,config:{api_key:r(w),workspace_id:r($)}})}),x=await e.json();if(!e.ok)throw new Error(x.error||"Failed to save integration");P.success("SwipeOne integration saved successfully",{position:"top-right"})}catch(e){console.error("Error saving SwipeOne integration:",e),t(p,e.message||"Failed to save integration",!0),P.error(r(p),{position:"top-right"})}finally{t(A,!1)}}async function V(){try{t(j,!0);const e=await fetch("/api/install/swipeone",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({teamId:R.id})}),x=await e.json();if(!e.ok)throw new Error(x.error||"Failed to remove integration");t(w,""),t($,""),P.success("SwipeOne integration removed successfully",{position:"top-right"})}catch(e){console.error("Error removing SwipeOne integration:",e),t(p,e.message||"Failed to remove integration",!0),P.error(r(p),{position:"top-right"})}finally{t(j,!1)}}var D=Ie(),C=f(D),X=f(C);he(X,{class:"w-4 h-4 mr-1"}),g(),u(C);var Z=s(C,2);_(Z,()=>fe,(e,x)=>{x(e,{class:"my-4",children:(ee,Se)=>{var T=ke(),B=F(T);_(B,()=>ve,(b,k)=>{k(b,{children:(I,J)=>{var n=we(),i=F(n);_(i,()=>ge,(v,d)=>{d(v,{class:"text-lg font-semibold",children:(a,y)=>{g();var m=O("SwipeOne Integration");o(a,m)},$$slots:{default:!0}})});var c=s(i,2);_(c,()=>ye,(v,d)=>{d(v,{children:(a,y)=>{g();var m=O("Connect your SwipeOne CRM to sync contacts and manage customer segments.");o(a,m)},$$slots:{default:!0}})}),o(I,n)},$$slots:{default:!0}})});var N=s(B,2);_(N,()=>ue,(b,k)=>{k(b,{children:(I,J)=>{var n=xe(),i=f(n),c=f(i),v=s(f(c),2);M(v,{id:"apiKey",type:"text",placeholder:"Enter your SwipeOne API key",class:"w-full",get value(){return r(w)},set value(l){t(w,l,!0)}}),g(2),u(c);var d=s(c,2),a=s(f(d),2);M(a,{id:"workspaceId",type:"text",placeholder:"Enter your SwipeOne workspace ID",class:"w-full",get value(){return r($)},set value(l){t($,l,!0)}}),g(2),u(d),u(i);var y=s(i,2);{var m=l=>{var K=$e(),re=f(K,!0);u(K),ie(()=>le(re,r(p))),o(l,K)};Y(y,l=>{r(p)&&l(m)})}u(n),o(I,n)},$$slots:{default:!0}})});var te=s(N,2);_(te,()=>_e,(b,k)=>{k(b,{class:"flex justify-between items-center border-t bg-gray-50 rounded-b-[11px] py-4",children:(I,J)=>{var n=be(),i=s(F(n),2),c=f(i);{var v=a=>{q(a,{variant:"destructive",onclick:V,get isLoading(){return r(j)},children:(y,m)=>{g();var l=O("Remove Connection");o(y,l)},$$slots:{default:!0}})};Y(c,a=>{E?.config?.api_key&&a(v)})}var d=s(c,2);q(d,{type:"button",onclick:U,get isLoading(){return r(A)},children:(a,y)=>{g();var m=O("Save Integration");o(a,m)},$$slots:{default:!0}}),u(i),o(I,n)},$$slots:{default:!0}})}),o(ee,T)},$$slots:{default:!0}})}),u(D),ce("click",C,()=>de(`/brand/${G().params.teamSlug}/settings/integrations`)),o(z,D),oe(),Q()}pe(["click"]);export{qe as component};
3//# sourceMappingURL=50.CG5FrRxq.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.