PageSourceSearch

https://dashboard.zayda.io/build/assets/popup-n0ygCOEg.js

js zayda.io collected 2026-10-02 00:12:54 UTC 9,254 bytes, 1 lines download raw bytes

1import{r as g,b as S,o as O,Z as r,V as l,X as t,a3 as R,a5 as j,_ as m,a6 as p,a8 as q,ab as B,a0 as C,a1 as D}from"./vendor-fullcalendar-BHFk4sf6.js";import{d as z,a as h}from"./app-Bju7U51j.js";import{a as F}from"./confirmDialog-DjYIYQt9.js";import{n as E}from"./integrationStatusEvents-DgcM3C2U.js";import{c as L}from"./integrationAccess-DveZ8bzX.js";/* empty css            */import"./vendor-quill-AaUhdfzq.js";const G={class:"fixed inset-0 bg-black bg-opacity-50 z-[995]"},H={class:"absolute top-0 right-0 w-full md:w-2/3 lg:w-1/1 h-full bg-white shadow-lg overflow-y-auto deal_sidebar"},W={class:"flex justify-between items-center p-4 py-2 border-b bg-white sticky top-0 z-10"},X={class:"flex items-center gap-2"},Z={key:0,class:"text-xs font-medium px-2 py-0.5 rounded-full bg-emerald-100 text-emerald-800"},J={key:1,class:"text-xs font-medium px-2 py-0.5 rounded-full bg-gray-100 text-gray-600"},K={class:"px-5 py-4 max-w-3xl"},Q={key:0,class:"text-sm text-gray-500 py-8"},Y={class:"border-b border-gray-200 mb-4"},ee={key:0,class:"space-y-4"},te={class:"border border-gray-200 rounded-lg p-4 bg-white"},se={class:"flex items-center justify-between gap-3"},ae={class:"text-sm font-medium text-gray-900"},oe=["disabled"],ne={key:0,class:"border border-gray-200 rounded-lg p-4 bg-gray-50"},re={class:"flex items-center justify-between gap-3"},le={class:"min-w-0"},ie={class:"text-sm text-gray-700 truncate"},de={key:0,class:"text-xs text-gray-500 mt-1"},ce={key:1,class:"text-xs text-gray-500 mt-1"},pe={class:"shrink-0"},ue=["disabled"],me={key:1,class:"space-y-4"},be={class:"rounded-lg border border-indigo-100 bg-indigo-50 p-5"},ye={class:"mt-5 space-y-4"},xe={key:0,class:"text-xs text-red-600 mt-1"},ve={key:0,class:"text-xs text-red-600 mt-1"},ge={key:0,class:"text-xs text-red-600 mt-1"},fe={class:"mt-5 flex justify-end"},_e=["disabled"],Pe={__name:"popup",emits:["close"],setup(ke){const{canManage:I,applyIntegrationAccess:V}=L(),y=z.useToast(),f=(typeof window<"u"?window.location.origin:"").replace(/\/$/,""),_=g(!0),c=g(!1),x=g(!1),u=g(null),b=g("overview"),o=S({}),a=S({brand_name:"",api_id:"",api_secret:""}),A=s=>{if(!s)return"";try{return new Date(s).toLocaleString()}catch{return s}},M=()=>Object.keys(o).forEach(s=>delete o[s]),k=s=>{o[s]&&String(a[s]||"").trim()&&delete o[s]},N=()=>(M(),a.brand_name.trim()||(o.brand_name="Brand name is required."),a.api_id.trim()||(o.api_id="Caller Desk API ID is required."),a.api_secret.trim()||(o.api_secret="Caller Desk API secret is required."),Object.keys(o).length===0),w=async()=>{var s;_.value=!0;try{const{data:e}=await h.get(`${f}/customer/caller-desk-integration/status`);x.value=!!(e!=null&&e.connected),V(e),u.value=(e==null?void 0:e.data)||null,(s=u.value)!=null&&s.brand_name&&(a.brand_name=u.value.brand_name)}catch{y.error("Could not load Caller Desk status.")}finally{_.value=!1}},T=async()=>{var s,e,i,v;if(N()){c.value=!0;try{const{data:d}=await h.post(`${f}/customer/caller-desk-integration/connect`,{brand_name:a.brand_name.trim(),api_id:a.api_id.trim(),api_secret:a.api_secret.trim()});y.success((d==null?void 0:d.message)||"Caller Desk connected."),E("callerdesk",!0),a.api_id="",a.api_secret="",b.value="overview",await w()}catch(d){const n=((e=(s=d==null?void 0:d.response)==null?void 0:s.data)==null?void 0:e.errors)||{};Object.keys(n).forEach($=>{var P;o[$]=((P=n[$])==null?void 0:P[0])||"This field is invalid."}),y.error(((v=(i=d==null?void 0:d.response)==null?void 0:i.data)==null?void 0:v.message)||"Could not connect Caller Desk.")}finally{c.value=!1}}},U=async()=>{var s,e;if(I.value&&await F({title:"Disconnect Caller Desk?",message:"Caller Desk call logs and activity syncing will stop until you connect it again.",confirmText:"Disconnect"})){c.value=!0;try{const{data:i}=await h.delete(`${f}/customer/caller-desk-integration`);y.success((i==null?void 0:i.message)||"Caller Desk disconnected."),E("callerdesk",!1),a.brand_name="",a.api_id="",a.api_secret="",await w()}catch(i){y.error(((e=(s=i==null?void 0:i.response)==null?void 0:s.data)==null?void 0:e.message)||"Failed to disconnect Caller Desk.")}finally{c.value=!1}}};return O(w),(s,e)=>{var i,v,d;return l(),r("div",G,[t("div",H,[t("div",W,[t("div",X,[e[10]||(e[10]=t("h2",{class:"text-lg font-semibold"},"Caller Desk",-1)),x.value?(l(),r("span",Z,"Connected")):(l(),r("span",J,"Not connected"))]),t("button",{type:"button",class:"text-gray-900 text-2xl",onClick:e[0]||(e[0]=n=>s.$emit("close"))},"×")]),t("div",K,[_.value?(l(),r("div",Q,"Loading Caller Desk status...")):(l(),r(R,{key:1},[t("div",Y,[t("button",{type:"button",class:j(["px-3 py-2 text-sm font-medium border-b-2",b.value==="overview"?"border-purple-600 text-purple-700":"border-transparent text-gray-500"]),onClick:e[1]||(e[1]=n=>b.value="overview")},"Overview",2),t("button",{type:"button",class:j(["px-3 py-2 text-sm font-medium border-b-2",b.value==="items"?"border-purple-600 text-purple-700":"border-transparent text-gray-500"]),onClick:e[2]||(e[2]=n=>b.value="items")},"Items",2)]),b.value==="overview"?(l(),r("div",ee,[t("div",te,[t("div",se,[t("div",null,[e[11]||(e[11]=t("p",{class:"text-[10px] font-semibold uppercase tracking-wide text-gray-500 mb-1"},"Next action",-1)),t("p",ae,p(x.value?"Connected":"Connect your Caller Desk Cloudphony account"),1)]),x.value?m("",!0):(l(),r("button",{key:0,t
1ype:"button",class:"btn btn-purple disabled:opacity-60",disabled:c.value,onClick:e[3]||(e[3]=n=>b.value="items")},"Set up",8,oe))])]),x.value?(l(),r("div",ne,[t("div",re,[t("div",le,[e[12]||(e[12]=t("p",{class:"text-sm font-semibold text-gray-900"},"Connected Caller Desk account",-1)),t("p",ie,p(((i=u.value)==null?void 0:i.brand_name)||"Caller Desk connection"),1),(v=u.value)!=null&&v.connected_at?(l(),r("p",de,"Connected on "+p(A(u.value.connected_at)),1)):m("",!0),(d=u.value)!=null&&d.last_synced_at?(l(),r("p",ce,"Last synced "+p(A(u.value.last_synced_at)),1)):m("",!0)]),t("div",pe,[q(I)?(l(),r("button",{key:0,type:"button",class:"px-4 py-2 rounded bg-red-50 text-red-700 hover:bg-red-100 disabled:opacity-60 text-sm",disabled:c.value,onClick:U},p(c.value?"Working...":"Disconnect"),9,ue)):m("",!0)])])])):m("",!0)])):(l(),r("div",me,[t("div",be,[e[16]||(e[16]=B('<p class="text-base font-semibold text-gray-900">Connect your Caller Desk account</p><p class="mt-1 text-sm text-gray-600">Paste your Caller Desk API ID and API secret along with a brand name to identify this connection.</p><div class="mt-4 rounded-md bg-white border border-gray-200 p-4 text-sm text-gray-700"><p class="text-xs font-bold uppercase text-gray-500 mb-2">Used for</p><p>Routing call activity from your Caller Desk account into CRM: call logs, agent activity, and lead attribution.</p><p class="text-xs font-bold uppercase text-gray-500 mt-4 mb-2">How it works</p><ol class="list-decimal pl-5 space-y-1"><li>Generate API ID and API secret from your Caller Desk admin console.</li><li>Paste both here along with a brand name to identify the connection.</li><li>CRM validates and saves the credentials for sync workflows.</li><li>After connection, sync Caller Desk call activity into CRM.</li></ol></div>',3)),t("div",ye,[t("div",null,[e[13]||(e[13]=t("label",{class:"block text-sm font-semibold text-gray-800 mb-1"},"Brand name",-1)),C(t("input",{"onUpdate:modelValue":e[4]||(e[4]=n=>a.brand_name=n),type:"text",class:"w-full border border-gray-200 rounded px-3 py-2 text-sm",placeholder:"Give this connection a name to identify",onInput:e[5]||(e[5]=n=>k("brand_name"))},null,544),[[D,a.brand_name]]),o.brand_name?(l(),r("p",xe,p(o.brand_name),1)):m("",!0)]),t("div",null,[e[14]||(e[14]=t("label",{class:"block text-sm font-semibold text-gray-800 mb-1"},"Caller Desk API ID",-1)),C(t("input",{"onUpdate:modelValue":e[6]||(e[6]=n=>a.api_id=n),type:"text",autocomplete:"off",class:"w-full border border-gray-200 rounded px-3 py-2 text-sm",placeholder:"Enter Caller Desk API ID",onInput:e[7]||(e[7]=n=>k("api_id"))},null,544),[[D,a.api_id]]),o.api_id?(l(),r("p",ve,p(o.api_id),1)):m("",!0)]),t("div",null,[e[15]||(e[15]=t("label",{class:"block text-sm font-semibold text-gray-800 mb-1"},"Caller Desk API secret",-1)),C(t("input",{"onUpdate:modelValue":e[8]||(e[8]=n=>a.api_secret=n),type:"password",autocomplete:"off",class:"w-full border border-gray-200 rounded px-3 py-2 text-sm",placeholder:"Add your Caller Desk API Secret",onInput:e[9]||(e[9]=n=>k("api_secret"))},null,544),[[D,a.api_secret]]),o.api_secret?(l(),r("p",ge,p(o.api_secret),1)):m("",!0)])]),t("div",fe,[t("button",{type:"button",class:"btn btn-purple disabled:opacity-60",disabled:c.value,onClick:T},p(c.value?"Connecting...":"Connect Caller Desk"),9,_e)])]),e[17]||(e[17]=B('<div class="border border-gray-200 rounded-lg p-4 bg-white"><div class="flex items-center justify-between"><div><p class="text-sm font-semibold text-gray-900">0 items</p><p class="text-xs text-gray-500">Issues appear first</p></div><div class="flex gap-2 text-xs"><span class="px-2 py-1 rounded-full border border-violet-200 text-violet-700 bg-violet-50">By status</span><span class="px-2 py-1 rounded-full border border-gray-200 text-gray-500">By name</span></div></div><p class="text-center text-sm text-gray-400 py-8">Nothing to show yet</p></div>',1))]))],64))])])])}}};export{Pe as default};

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.