1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[86699],{41969:function(e,t){"use strict";t.Qc=function(e,t){let a=new s,r=e.length;if(r<2)return a;let i=t?.decode||d,n=0;do{let t=function(e,t,a){let r=e.indexOf("=",t);return r<a?r:-1}(e,n,r);if(-1===t)break;let l=function(e,t,a){let r=e.indexOf(";",t);return -1===r?a:r}(e,n,r);if(t>l){n=e.lastIndexOf(";",t-1)+1;continue}let s=c(e,n,t);void 0===a[s]&&(a[s]=i(c(e,t+1,l))),n=l+1}while(n<r);return a},t.qC=o,t.qC=o;let a=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,r=/^[\u0021-\u003A\u003C-\u007E]*$/,i=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,n=/^[\u0020-\u003A\u003D-\u007E]*$/,l=Object.prototype.toString,s=(()=>{let e=function(){};return e.prototype=Object.create(null),e})();function o(e,t,s){let o="object"==typeof e?e:{...s,name:e,value:String(t)},c=("object"==typeof t?t:s)?.encode||encodeURIComponent;if(!a.test(o.name))throw TypeError(`argument name is invalid: ${o.name}`);let d=o.value?c(o.value):"";if(!r.test(d))throw TypeError(`argument val is invalid: ${o.value}`);let m=o.name+"="+d;if(void 0!==o.maxAge){if(!Number.isInteger(o.maxAge))throw TypeError(`option maxAge is invalid: ${o.maxAge}`);m+="; Max-Age="+o.maxAge}if(o.domain){if(!i.test(o.domain))throw TypeError(`option domain is invalid: ${o.domain}`);m+="; Domain="+o.domain}if(o.path){if(!n.test(o.path))throw TypeError(`option path is invalid: ${o.path}`);m+="; Path="+o.path}if(o.expires){var u;if(u=o.expires,"[object Date]"!==l.call(u)||!Number.isFinite(o.expires.valueOf()))throw TypeError(`option expires is invali
1d: ${o.expires}`);m+="; Expires="+o.expires.toUTCString()}if(o.httpOnly&&(m+="; HttpOnly"),o.secure&&(m+="; Secure"),o.partitioned&&(m+="; Partitioned"),o.priority)switch("string"==typeof o.priority?o.priority.toLowerCase():void 0){case"low":m+="; Priority=Low";break;case"medium":m+="; Priority=Medium";break;case"high":m+="; Priority=High";break;default:throw TypeError(`option priority is invalid: ${o.priority}`)}if(o.sameSite)switch("string"==typeof o.sameSite?o.sameSite.toLowerCase():o.sameSite){case!0:case"strict":m+="; SameSite=Strict";break;case"lax":m+="; SameSite=Lax";break;case"none":m+="; SameSite=None";break;default:throw TypeError(`option sameSite is invalid: ${o.sameSite}`)}return m}function c(e,t,a){let r=t,i=a;do{let t=e.charCodeAt(r);if(32!==t&&9!==t)break}while(++r<i);for(;i>r;){let t=e.charCodeAt(i-1);if(32!==t&&9!==t)break;i--}return e.slice(r,i)}function d(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(t){return e}}},47732:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/app/slack/connected",function(){return a(50088)}])},9393:function(e,t,a){"use strict";a.d(t,{Z:function(){return i}});var r=a(79619);function i({className:e}){return(0,r.jsxs)("svg",{className:e,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg","aria-label":"Slack Logo",children:[(0,r.jsxs)("g",{clipPath:"url(#clip0_slack)",children:[(0,r.jsx)("path",{d:"M3.46201 10.1898C3.46201 11.12 2.711 11.8718 1.78179 11.8718C0.852572 11.8718 0.101562 11.12 0.101562 10.1898C0.101562 9.2596 0.852572 8.50781 1.78179 8.50781H3.46201V10.1898ZM4.30212 10.1898C4.30212 9.2596 5.05313 8.50781 5.98235 8.50781C6.91156 8.50781 7.66257 9.2596 7.66257 10.1898V14.3947C7.66257 15.3249 6.91156 16.0767 5.98235 16.0767C5.05313 16.0767 4.30212 15.3249 4.30212 14.3947V10.1898Z",fill:"#E01E5A"}),(0,r.jsx)("path",{d:"M5.9814 3.44208C5.05219 3.44208 4.30118 2.69029 4.30118 1.7601C4.30118 0.829918 5.05219 0.078125 5.9814 0.078125C6.91062 0.078125 7.66163 0.829918 7.66163 1.7601V3.44208H5.9814ZM5.9814 4.29581C6.91062 4.29581 7.66163 5.0476 7.66163 5.97779C7.66163 6.90797 6.91062 7.65976 5.9814 7.65976H1.76811C0.8389 7.65976 0.0878906 6.90797 0.0878906 5.97779C0.0878906 5.0476 0.8389 4.29581 1.76811 4.29581H5.9814Z",fill:"#36C5F0"}),(0,r.jsx)("path",{d:"M12.7142 5.97779C12.7142 5.0476 13.4652 4.29581 14.3945 4.29581C15.3237 4.29581 16.0747 5.0476 16.0747 5.97779C16.0747 6.90797 15.3237 7.65976 14.3945 7.65976H12.7142V5.97779ZM11.8741 5.97779C11.8741 6.90797 11.1231 7.65976 10.1939 7.65976C9.26468 7.65976 8.51367 6.90797 8.51367 5.97779V1.7601C8.51367 0.829918 9.26468 0.078125 10.1939 0.078125C11.1231 0.078125 11.8741 0.829918 11.8741 1.7601V5.97779Z",fill:"#2EB67D"}),(0,r.jsx)("path",{d:"M10.1939 12.7128C11.1231 12.7128 11.8741 13.4645 11.8741 14.3947C11.8741 15.3249 11.1231 16.0767 10.1939 16.0767C9.26468 16.0767 8.51367 15.3249 8.51367 14.3947V12.7128H10.1939ZM10.1939 11.8718C9.26468 11.8718 8.51367 11.12 8.51367 10.1898C8.51367 9.2596 9.26468 8.50781 10.1939 8.50781H14.4072C15.3364 8.50781 16.0874 9.2596 16.0874 10.1898C16.0874 11.12 15.3364 11.8718 14.4072 11.8718H10.1939Z",fill:"#ECB22E"})]}),(0,r.jsx)("defs",{children:(0,r.jsx)("clipPath",{id:"clip0_slack",children:(0,r.jsx)("rect",{width:"16",height:"16",fill:"white"})})})]})}a(54128)},87675:function(e,t,a){"use strict";var r=a(79619),i=a(9965);t.Z=({size:e="sm",color:t,className:a,children:n})=>{let l,s,o;switch(e){case"sm":l="py-2 pl-3 pr-4",o="text-xs";break;case"lg":l="py-5 pl-4 pr-5",o="text-md";break;default:l="py-4 pl-4 pr-5",o="text-sm"}switch(t){case"yellow":s="border-yellow-400";break;case"red":s="border-red-400";break;default:s="border-cyan-600"}return(0,r.jsx)("div",{className:(0,i.Z)(l,o,s,"border-l-4 bg-gray-200/50 leading-none text-gray-800",a),children:n})}},50088:function(e,t,a){"use strict";a.r(t),a.d(t,{__N_SSP:function(){return x}});var r=a(79619),i=a(54128),n=a(82385),l=a.n(n),s=a(29009),o=a(59850),c=a(79486),d=a(9393),m=a(87675);a(24702);var u=a(28651),p=a(44922);let h={access_denied:"Slack authorization was cancelled.",oauth_error:"Slack returned an error. Please try again from the Slack App Directory.",missing_code:"Invalid request: missing authorization code.",exchange_failed:"Could not complete the connection. Please try installing from Slack again."};var x=!0;t.default=function({userId:e,team:t,teamsWithBots:a}){let{slack_team_id:n,slack_team_name:x,slack_enterprise_name:f,error:g}=(0,s.useRouter)().query,[y,w]=(0,i.useState)(null),[b,v]=(0,i.useState)(null),[j,C]=(0,i.useState)({}),k=async t=>{v(null),w(t);let a=j[t]||null;try{let r=await fetch("/api/slack/oauth/claim",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slack_team_id:n,teamId:t,defaultBotId:a||void 0})}),i=await r.json().catch(()=>({}));if(!r.ok)throw Error(i.message||"Failed to connect");await fetch(`/api/users/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentTeam:t})}),window.location.href="/app/api#slack-settings"}catch(e){v(e.message||"Something went wrong."),w(null)}},N=g?h[g]||h.oauth_error:null;
1return(0,r.jsx)(o.Z,{page:"Slack",title:"Connect Slack",team:t,children:(0,r.jsxs)("div",{className:"mx-auto max-w-lg space-y-6",children:[N&&(0,r.jsxs)(m.Z,{color:"red",size:"md",className:"flex items-start gap-3 leading-normal",children:[(0,r.jsx)(u.Z,{className:"mt-0.5 h-6 w-6 flex-shrink-0 text-red-600"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"font-medium text-red-800",children:"Connection failed"}),(0,r.jsx)("p",{className:"mt-1 text-sm text-red-700",children:N}),(0,r.jsx)(l(),{href:"/app/api",className:"mt-2 inline-block text-sm font-medium text-red-700 underline hover:text-red-800",children:"Go to Integrations"})]})]}),!g&&!n&&(0,r.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white p-6 text-center",children:[(0,r.jsx)("p",{className:"text-gray-600",children:"No pending Slack connection. Install the app from your teamâs Integrations page."}),(0,r.jsx)(l(),{href:"/app/api#slack-settings",className:"mt-4 inline-block text-cyan-600 hover:text-cyan-800 font-medium",children:"Go to Integrations"})]}),!g&&n&&(0,r.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white p-6",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,r.jsx)(d.Z,{className:"h-10 w-10 flex-shrink-0"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Connect Slack to a team"}),(0,r.jsxs)("p",{className:"text-sm text-gray-600",children:["Connect ",(0,r.jsx)("strong",{children:x||"Slack workspace"}),f?` (${f})`:""," to one of your teams."]})]})]}),b&&(0,r.jsx)(m.Z,{color:"red",className:"mb-3 leading-normal",children:b}),0===(a||[]).length?(0,r.jsx)("p",{className:"text-sm text-gray-600",children:"You donât have permission to add Slack to any team. Ask a team owner or admin to connect Slack."}):(0,r.jsx)("ul",{className:"space-y-3",children:(a||[]).slice().sort((e,a)=>e.team.id===t?.id?-1:a.team.id===t?.id?1:0).map(({team:e,bots:a})=>(0,r.jsxs)("li",{className:"rounded-md border border-gray-200 bg-gray-50 px-4 py-3 space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[(0,r.jsxs)("span",{className:"font-medium text-gray-900",children:[e.name,e.id===t?.id&&(0,r.jsx)("span",{className:"ml-2 text-xs font-normal text-gray-500",children:"(current team)"})]}),(0,r.jsx)("button",{type:"button",onClick:()=>k(e.id),disabled:!!y,className:"inline-flex items-center gap-1.5 rounded-md bg-emerald-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-emerald-700 disabled:opacity-50 disabled:pointer-events-none",children:y===e.id?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.Z,{className:"h-4 w-4"}),"Connectingâ¦"]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.Z,{className:"h-4 w-4"}),"Connect here"]})})]}),a.length>0&&(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("label",{htmlFor:`default-bot-${e.id}`,className:"text-sm text-gray-600 whitespace-nowrap",children:"Default bot:"}),(0,r.jsxs)("select",{id:`default-bot-${e.id}`,value:j[e.id]??"",onChange:t=>C(a=>({...a,[e.id]:t.target.value||""})),className:"block rounded-md border border-gray-300 bg-white py-1.5 pl-2 pr-8 text-sm text-gray-900 focus:border-cyan-500 focus:ring-cyan-500",children:[(0,r.jsx)("option",{value:"",children:"None (set later)"}),a.map(e=>(0,r.jsx)("option",{value:e.id,children:e.name||e.id},e.id))]})]})]},e.id))}),(0,r.jsx)("p",{className:"mt-4 text-xs text-gray-500",children:"If the connection link has expired, install again from the Slack App Directory. After connecting, you can change the default bot and channel routing in that teamâs Integrations â Slack."})]})]})})}},15178:function(e,t,a){"use strict";var r=a(54128);let i=r.forwardRef(function({title:e,titleId:t,...a},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":t},a),e?r.createElement("title",{id:t},e):null,r.createElement("path",{fillRule:"evenodd",d:"M12.53 16.28a.75.75 0 0 1-1.06 0l-7.5-7.5a.75.75 0 0 1 1.06-1.06L12 14.69l6.97-6.97a.75.75 0 1 1 1.06 1.06l-7.5 7.5Z",clipRule:"evenodd"}))});t.Z=i},97841:function(e,t,a){"use strict";var r=a(54128);let i=r.forwardRef(function({title:e,titleId:t,...a},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"
1currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":t},a),e?r.createElement("title",{id:t},e):null,r.createElement("path",{fillRule:"evenodd",d:"M7.72 12.53a.75.75 0 0 1 0-1.06l7.5-7.5a.75.75 0 1 1 1.06 1.06L9.31 12l6.97 6.97a.75.75 0 1 1-1.06 1.06l-7.5-7.5Z",clipRule:"evenodd"}))});t.Z=i},25309:function(e,t,a){"use strict";var r=a(54128);let i=r.forwardRef(function({title:e,titleId:t,...a},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":t},a),e?r.createElement("title",{id:t},e):null,r.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))});t.Z=i}},function(e){e.O(0,[59850,49774,92888,40179],function(){return e(e.s=47732)}),_N_E=e.O()}]);
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.