1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[994],{749:(e,t,n)=>{"use strict";n.d(t,{Dp:()=>r,EC:()=>l,L_:()=>s,b2:()=>i});var a=n(96944);let r=async e=>{let{id:t}=e;return(0,a.Z)().deleteOrganization({id:t}).then(e=>e.data.deleteOrganization)},l=async e=>{var t;return(0,a.Z)().CreateOrganization(e,{"recaptcha-token":null!=(t=e.input.recaptcha)?t:""}).then(e=>e.data.createOrganization.id)},i=async e=>(0,a.Z)().duplicateNameCheck(e).then(e=>e.data.duplicateNameCheck),s=async e=>(0,a.Z)().updateOrganization(e).then(e=>e.data.updateOrganization)},9972:(e,t,n)=>{"use strict";n.d(t,{default:()=>f});var a=n(95155),r=n(12115),l=n(20063),i=n(93442),s=n(36077),o=n(16090),d=n(33525),c=n(96068);function u(e){let t={text:null==e?void 0:e.text,button:null==e?void 0:e.button,dismissButtonVisible:null==e?void 0:e.dismissButtonVisible,enabled:null==e?void 0:e.enabled},n=JSON.stringify(t,Object.keys(t).sort()),a=0;for(let e=0;e<n.length;e++)a=(a<<5)-a+n.charCodeAt(e),a&=a;return a.toString(36)}function m(e,t){return t?"".concat(e,"_user_").concat(t):e}function p(){try{let e="__localStorage_test__";return localStorage.setItem(e,"test"),localStorage.removeItem(e),!0}catch(e){return!1}}function h(e){if(!p())return null;try{return localStorage.getItem(e)}catch(e){return console.warn("Failed to read from localStorage:",e),null}}function x(e,t){if(!p())return!1;try{return localStorage.setItem(e,t),!0}catch(e){return console.warn("Failed to write to localStorage:",e),!1}}function v(e){let t=Date.now(),n={};for(let[a,r]of Object.entries(e))r&&"object"==typeof r&&r.timestamp?t-r.timestamp<7776e6&&(n[a]=r):"boolean"==typeof r&&(n[a]=r);return n}var g=n(62137);let f=()=>{let[e,t]=(0,r.useState)({}),n=(0,l.usePathname)(),{activeUser:p,configs:f}=(0,o.A)(),{activeCtx:b}=(0,s.j)(),y=!!p,j=null==p?void 0:p.id,w=(0,d.aM)(f),{isSubscribedToProd:N,hasPendingBillingRequest:k,isLoading:A}=(0,i.pl)(),C=(0,r.useMemo)(()=>{var e,t;let n=(null==b?void 0:b.type)==="Team"?null==b||null==(e=b.organization)?void 0:e.id:null==b?void 0:b.entityId,a=(0,g.wA)(null!=(t=null==p?void 0:p.id)?t:"",null!=n?n:"");return(null==b?void 0:b.type)!=="User"?{enabled:!0,dismissButtonVisible:!0,text:a?"You're in Simulator mode. To connect live networks, complete onboarding, [start by creating a billing account.](".concat("/console/".concat(n,"/billing/information?prodSetup=true"),")"):"You're in Simulator mode. To connect live networks, an Organization admin needs to complete the onboarding.",button:{text:"Unlock Live Networks",link:void 0,target:"_self",visible:!0}}:null},[b,null==p?void 0:p.id]),S=w&&!k&&!N,I=m("rapidapi_app_registration_banner_state",j),P=m("rapidapi_banner_dismissal_state",j),E=(0,r.useCallback)(()=>{let e=h(I),n={};if(e)try{let t=JSON.parse(e);n=v(t),Object.keys(n).length!==Object.keys(t).length&&x(I,JSON.stringify(n))}catch(e){n={}}let a=h(P),r={};if(a)try{let e=JSON.parse(a);r=v(e),Object.keys(r).length!==Object.keys(e).length&&x(P,JSON.stringify(r))}catch(e){r={}}t({...n,...r})},[I,P]),T=(0,r.useCallback)((e,n)=>{x(n,JSON.stringify(e))?t(t=>({...t,...e})):t(t=>({...t,...e}))},[]);(0,r.useEffect)(()=>{E()},[E]),(0,r.useEffect)(()=>{j&&E()},[j,E]);let z=(0,r.useMemo)(()=>{if(!S)return!0;let t=e[u(null!=C?C:void 0)];return(null==t?void 0:t.dismissed)&&(t.userId===j||!t.userId)},[S,C,e,j]),O=S&&!z,_=O?I:P,D=(0,r.useMemo)(()=>O?C:(e=>{try{let t=e.notification_bar;if(!t||!t.enabled)return null;return t}catch(e){return console.warn("Failed to parse notification banner configuration:",e),null}})(f),[C,f,O]),B=(0,r.useCallback)(()=>{if(!D)return;let e=u(D);T({[e]:{dismissed:!0,timestamp:Date.now(),userId:j||void 0}},_)},[D,j,T,_]),R=(0,r.useMemo)(()=>{let t=e[u(null!=D?D:void 0)];return(null==t?void 0:t.dismissed)&&(t.userId===j||!t.userId)},[e,D,j]);if(!D||A||!function(e,t,n,a){return!(!e||!e.enabled||t||!a||"/"===n||["/pricing","/about","/contact","/terms","/privacy","/docs/","/blog/","/api/","/page/"].some(e=>n.startsWith(e)))&&!!(n.startsWith("/hub")||n.startsWith("/console")||n.includes("/playground")||n.includes("/api")||["/workspace/","/organizations/","/org/","/developer/","/admin/","/studio/","/my-saved-apis/","/categories/","/collection/","/collections/","/search/"].some(e=>n.startsWith(e)))&&!!e.text&&!!e.text.trim()}(D,R,n,y))return null;let L={description:D.text,button:D.button.visible?{text:D.button.text,href:D.button.link,inNewTab:"_blank"===D.button.target}
1:void 0,dismissButtonVisible:D.dismissButtonVisible,onDismiss:B,enableMarkdown:!0};return(0,a.jsx)(c.A,{...L})}},19179:(e,t,n)=>{"use strict";n.d(t,{SideBar:()=>d});var a=n(95155),r=n(20063);let l=["hub","workspace","collections","categories","my-saved-apis","collection"];var i=n(50716),s=n(37783),o=n(64690);let d=()=>{let e=(0,o.L0)();return(e=>{let t=null==e?void 0:e.split("/");return!e||!l.some(e=>e===(null==t?void 0:t[1]))})((0,r.usePathname)())||e?null:(0,a.jsx)(s.Af,{children:(0,a.jsx)(i.y,{})})}},26712:(e,t,n)=>{"use strict";n.d(t,{SearchProvider:()=>h,Z:()=>p});var a=n(95155),r=n(91732),l=n(19251),i=n(36077),s=n(16090),o=n(12115),d=n(20063),c=n(62176),u=n(22402);let m=(0,o.createContext)({}),p=()=>(0,o.useContext)(m),h=e=>{let{children:t,initialContextId:n,mode:p}=e,{activeCtx:h}=(0,i.j)(),{activeUser:x}=(0,s.A)(),{entityId:v,entityName:g,type:f,organization:b}=null!=h?h:{},y=(0,l.Mu)(x,n),j=decodeURIComponent((0,d.useSearchParams)().toString()).match(/term=([^&]*)/),w=(0,c.get)(j,"[1]","").replace(/\+/g," "),[N,k,A]=(0,u.W)(700,null!=w?w:""),C=(0,r.G2)(w,y),[S,I]=(0,o.useState)(null!=C?C:""),P=(0,r.$D)(S,w,y),[E,T]=(0,o.useState)(null!=P?P:""),[z,O]=(0,o.useState)(()=>y?{name:y.entityName,id:y.entityId}:(0,r._H)(f,b,v,g,p)),[_,D]=(0,o.useState)(y?(0,r.IW)(y.type):void 0);return(0,o.useEffect)(()=>{let e=(0,l.Mu)(x,n);if(w&&w!==N){A(w);let t=(0,r.G2)(w,e);I(null!=t?t:"");let n=(0,r.$D)(S,w,e);T(null!=n?n:"")}e&&e.entityId!==(null==z?void 0:z.id)&&(O({name:e.entityName,id:e.entityId}),D((0,r.IW)(e.type)))},[A,x,n]),(0,a.jsx)(m.Provider,{value:{searchTermState:[N,k,A],fullInputTextState:[S,I],termWithoutContextTypeState:[E,T],searchContextTypeState:[_,D],searchContextState:[z,O],clearSearch:()=>{I(""),O(null),D(void 0),A("")}},children:t})}},27542:(e,t,n)=>{"use strict";n.d(t,{HeaderWrapper:()=>eC});var a=n(95155),r=n(51472),l=n(52619),i=n.n(l),s=n(20063),o=n(26712),d=n(16090),c=n(65073),u=n(22446),m=n(37582),p=n(28397),h=n(20250),x=n(6753),v=n(76049),g=n(64690),f=n(33525),b=n(15560),y=n(56462),j=n(93324),w=n(12115),N=n(10378),k=n(89333),A=n(68887),C=n(63909),S=n(6956),I=n(75550),P=n(36077),E=n(31095),T=n(69915),z=n(55441),O=n(90851),_=n(52422),D=n(15249),B=n(51128),R=n(16403);let L=e=>{var t,n,r;let{disabled:l}=e,{activeCtx:o,setActiveCtxEntity:c}=(0,P.j)(),{activeUser:u,configs:m}=(0,d.A)(),h=(0,s.usePathname)(),x=(0,D.D0)(),{openDialog:v}=(0,p.W)(),b=(0,z.K)("createOrganization"),y=(0,z.K)("createTeam"),j=(null==u?void 0:u.id)&&(0,_.YE)(u.id),{entityId:N,entityName:L,organization:M}=null!=o?o:{},F=M?null==(t=M.teams)?void 0:t.find(e=>e.id===N):null,W=(0,f.Pm)(m),K=null!=(r=null==x?void 0:x.consoleInNavbar)&&r,{api:q}=(0,O.gk)(),U=(0,g.L0)(),H=(0,w.useMemo)(()=>u?(0,R.Yh)({activeUser:u,pathname:h,api:q,isSingleApiTenant:W}):[],[u,h,q,W]),V=(0,g.cn)("flex h-8 cursor-pointer items-center justify-between rounded-md border border-header-border py-1.5 pl-4 pr-3.5 transition-all duration-150 hover:bg-header-hover data-[disabled]:cursor-not-allowed data-[disabled]:bg-accent",U?"mx-auto mt-4 w-[95vw]":"w-52");return u?(0,a.jsxs)(B.rI,{modal:!1,children:[(0,a.jsx)(B.ty,{asChild:!0,disabled:l||!o,children:(0,a.jsxs)("div",{className:V,children:[(0,a.jsx)(k.Bc,{children:(0,a.jsxs)(k.m_,{children:[(0,a.jsx)(k.k$,{asChild:!0,className:"flex","aria-label":"Selected context thumbnail",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(E.A,{className:"mr-2 h-6 w-6 rounded-full",thumbnail:null==o?void 0:o.entityThumbnail,entityName:null==o?void 0:o.entityName}),(0,a.jsx)("div",{className:"flex max-w-[124px]",children:(0,a.jsx)("span",{className:"org text-header-primary max-w-prose truncate text-xs",children:"".concat(L||(null==(n=(0,R.ye)(u))?void 0:n.name)).concat((null==o?void 0:o.type)==="Org"?" (Org)":"")})})]})}),(0,a.jsx)(k.ZI,{children:"".concat(L).concat((null==o?void 0:o.type)==="Org"?" (Org)":"")})]})}),(0,a.jsx)(I.A,{className:"text-header-primary h-3 w-3"})]})}),(0,a.jsxs)(B.SQ,{className:(0,g.cn)("z-[5000]",U?"w-[90vw]":"w-72"),children:[(0,a.jsx)(B.I,{className:"max-h-[260px] overflow-x-hidden overflow-y-auto",children:H.map((e,t)=>{var n;let r,l,s;return(0,a.jsxs)(B.I,{children:[(0,a.jsxs)(B._2,{onClick:()=>!e.isDisabled&&c(e.id),className:(0,g.cn)("group/item cursor-pointer",e.isDisabled&&"pointer-events-none"),children:[(0,a.jsx)("div",{className:"mr-2 h-6 w-6 rounded-full bg-transparent",children:(0,a.jsx)(E.A,{className:"mr-2 h-6 w-6 rounded-full",thumbnail:null==e?void 0:e.thumbnail,entityName:null==e?void 0:e.name})}),(0,a.jsxs)("div",{className:"flex flex-1 items-center justify-between truncate",children:[(0,a.jsxs)("span",{title:e.name,className:(0,g.cn)("w-11/12 truncate",e.isDisabled&&"text-dropdown-secondary"),children:[e.name," ","Org"===e.type?"(Org)":""]}),e.canAccessOrgDash&&!K&&(0,a.jsx)(i(),{href:"/console/".concat(e.id,"/teammates"),children:(0,a.jsx)(A.A,{className:"invisible h-4 w-4 cursor-pointer group-hover/item:visible","aria-label":"Manage organization"})})]}),e.isDisabled&&(0,a.jsx)(C.A,{className:"w-4"})]}),null==(n=e.children)?void 0:n.map(e=>(0,a.jsxs)(B._2,{className:"flex cursor-pointer justify-between",onClick:()=>(null==e?void 0:e.id)&&c(null==e?void 0:e.id),children:[(0,a.jsxs)("span",{title:null==e?void 0:e.name,className:(0,g.cn)("w-11/12 truncate pl-8"),children:[null==e?void 0:e.name," (Team)"]}),(null==F?void 0:F.id)===(null==e?void 0:e.id)?(0,a.jsx)(S.A,{className:"w-4"}):null]},e.id)),(r=e.id,l=!!((null==u?void 0:u.id)&&(0,_.v1)({orgId:r,userId:null==u?void 0:u.id})),s=e.id,l&&(0,a.jsx)(B._2,{onClick:()=>{var e;return e=s,void(y&&v({...y,onSave:async(t,n)=>{let a={...t,organizationId:Number(e)};return y.onSave(a,n)}}))},className:"cursor-pointer pl-4",children:(0,a.jsx)("div",{className:"text-link-color hover:opacity-80",children:"+ Create Team"})})),t<H.length-1?(0,a.jsx)(B.mB,{}):null]},e.id)})}),j&&(0,a.jsxs)(B.I,{children:[(0,a.jsx)(B.mB,{}),(0,a.jsx)(B._2,{onClick:()=>{v(b)},className:"cursor-pointer pl-4",children:(0,a.jsx)("div",{className:"text-link-color hover:opacity-80",children:"+ Create Organization"})})]})]}),(0,a.jsx)(T.W,{})]}):null};var M=n(94117),F=n(30597),W=n(62137),K=n(83225),q=n(59938),U=n(97122),H=n(71202);let V=(e,t,n)=>{let a=(0,K.useIsApiPlanCheckOutView)(),r=(0,U.H6)(e),l=a||r||/^\/studio\/[^\/]+\/[^\/]/.test(e)&&!e.startsWith("/studio/communication/messages"),i=!e.startsWith("/admin")&&!(n&&t);return{disableContextSelect:l,showContextSelect:i,showSearchMenu:!(0,U.ks)(e)&&!a&&!e.startsWith("/docs")&&(!n||!(0,U.pY)(e)),showRightSection:!a}},Q=(e,t)=>{let n=(0,w.useMemo)(()=>e&&(0,W.eb)(e),[t,e]);return{hasPermissionToMyApps:n,hasPermissionToStudio:(0,w.useMemo)(()=>e&&(0,W.Kv)(e),[t,e]),hasPermissionToOrgDashboard:(0,w.useMemo)(()=>e&&(0,W.QK)(e),[t,e])}},Z=(e,t,n)=>
1{let a=(0,m.h7)(),{accessControl:r}=(0,d.A)(),{activeCtx:l}=(0,P.j)(),i=(0,D.D0)(),s=i.consoleInNavbar,o=t&&i.pubHubNavigateToNacDocs,c=n.filter(e=>!F.a.includes(e.href)),u=(0,H.keyBy)(n,"href"),p=$(e),{hasPermissionToMyApps:h,hasPermissionToStudio:x,hasPermissionToOrgDashboard:v}=Q(e,null!=r?r:null);return(0,w.useMemo)(()=>{var e,n,r,i,d,m,g,f,b,y,j,w;return[{name:null!=(g=null==(e=u["/hub"])?void 0:e.name)?g:"API Marketplace",href:"/hub",disabled:!1},...s?[{name:null!=(f=null==(n=u["/console"])?void 0:n.name)?f:"Console",href:"/console/".concat(null==l?void 0:l.entityId,"/applications"),disabled:t&&p}]:[],...v&&!s?[{name:null!=(b=null==(r=u["/org"])?void 0:r.name)?b:"Orgs",href:"/org",disabled:!1,onclick:()=>(0,W.SP)("org-iframe","/org")}]:[],...x?[{name:null!=(y=null==(i=u["/studio"])?void 0:i.name)?y:"Studio",href:"/studio",disabled:!1,onclick:()=>(0,W.SP)("studio-iframe","/studio")}]:[],...h&&!s?[{name:null!=(j=null==(d=u["/developer"])?void 0:d.name)?j:"Apps",href:"/developer",disabled:!1,onclick:()=>(0,W.SP)("developer-iframe","/developer")}]:[],...a?[{name:null!=(w=null==(m=u["/admin"])?void 0:m.name)?w:"Admin",href:"/admin",disabled:!1,onclick:()=>(0,W.SP)("admin-iframe","/admin")}]:[],...o?[{name:"Docs",href:"/docs/getting-started",disabled:!1}]:[],...(0,W.So)(c)]},[t,u,s,o,p,v,x,h,a,c])},$=e=>{var t;let n=null==e||null==(t=e.organizations)?void 0:t.length,a=(0,q.O)(null==e?void 0:e.id),r=!!e&&(0,_.YE)(e.id);return!a&&r&&0===n};var Y=n(27357),G=n(80671),J=n(65608),X=n(98583),ee=n(65596),et=n(45920),en=n(91732),ea=n(35413),er=n(58553),el=n(41715);let ei=()=>(0,a.jsxs)("div",{className:"flex flex-col items-center",children:[(0,a.jsx)("span",{className:"text-foreground pb-2 text-xs font-medium",children:"No results found for your search"}),(0,a.jsx)("span",{className:"text-secondary pb-[10px] text-xs font-medium",children:"Consider trying a different keyword or exploring our categories for related information"})]});var es=n(71402),eo=n(79706),ed=n(60754),ec=n(27279),eu=n(36117),em=n.n(eu),ep=n(46980),eh=n.n(ep);let ex=e=>{let{id:t,thumbnail:n,name:r,username:l,updatedAt:s,popularityScore:o,isActive:c,slugifiedName:u,ownerName:m,index:p,onApiClick:h}=e,{configs:x}=(0,d.A)(),{hub_api_landing_page:g}=x,f="".concat((0,U.vI)(l,u)).concat("playground"===g?"/playground":""),{trackAlgoliaEvent:b}=(0,et._)();return(0,a.jsx)("li",{className:"api-result-item cursor-pointer items-center",children:(0,a.jsx)(i(),{href:f,onClick:()=>{b(v.oI.ALGOLIA_AFTER_SEARCH_CLICK,{product_id:t,position:p+1}),h()},className:"hover:no-underline",children:(0,a.jsxs)("div",{className:"hover:bg-accent flex items-start justify-start gap-2 rounded-lg px-2 py-1.5 ".concat(c?"bg-accent/80":""),children:[(0,a.jsx)("div",{className:"icon h-8 w-8 overflow-hidden rounded-3xl bg-neutral-100 p-0",children:n?(0,a.jsx)(ec._,{width:32,height:32,src:n,alt:null!=r?r:""}):null}),(0,a.jsxs)("div",{className:"flex flex-1 items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex h-9 flex-col justify-between",children:[(0,a.jsx)("div",{className:"inline-flex gap-2",children:(0,a.jsx)("span",{className:"text-xs [&>em]:bg-blue-100 [&>em]:font-semibold",dangerouslySetInnerHTML:{__html:eh().sanitize(null!=r?r:"")}})}),(0,a.jsxs)("div",{className:"flex items-center",children:[m?(0,a.jsxs)("span",{className:"text-secondary max-w-[260px] truncate text-xs",children:["By ",m]}):null,s?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"bg-secondary mx-1 h-1 w-1 rounded-full"}),(0,a.jsxs)("span",{className:"text-secondary text-xs",children:["Updated ",em()(s).fromNow()]})]}):null]})]}),(0,a.jsx)(ed.A,{children:o})]})]})})},t)},ev=e=>{let{data:t,total:n,onApiClick:r}=e,{trackAlgoliaEvent:l}=(0,et._)(),i=(0,s.useRouter)(),{activeIndex:o}=(0,ea.Xp)({dataLength:n>6?6:n,onSelect:e=>{if(t){let n=t[e],{owner:a,slugifiedName:s}=n;l(v.oI.ALGOLIA_AFTER_SEARCH_CLICK,{product_id:n.id,position:e+1}),i.push((0,U.vI)(null==a?void 0:a.slugifiedName,s)),r()}}});return(0,a.jsx)("div",{className:"flex w-full flex-col",children:(0,a.jsxs)("div",{className:"flex flex-col items-start gap-[9px] pb-4",children:[(0,a.jsxs)("span",{className:"text-secondary text-xs font-semibold",children:["APIs ",t?"(".concat(n,")"):null]}),(0,a.jsx)("ul",{className:"api-result-list flex w-full flex-col gap-2 self
1-start",children:null==t?void 0:t.slice(0,6).map((e,t)=>{var n,a,l;return e?(0,w.createElement)(ex,{...e,key:e.id,index:t,username:null==(n=e.owner)?void 0:n.slugifiedName,ownerName:null==(a=e.owner)?void 0:a.name,popularityScore:null==(l=e.score)?void 0:l.popularityScore,isActive:o===t,onApiClick:r}):null})})]})})},eg=e=>{let{apis:t,total:n,searchTerm:r,contextId:l,onSeeAllClick:s}=e;return(0,a.jsxs)("div",{className:"w-full",children:[(0,a.jsx)(ev,{onApiClick:s,data:t,total:n}),(0,a.jsxs)("div",{className:"flex justify-between py-[7px]",children:[(0,a.jsxs)("div",{className:"flex gap-3",children:[(0,a.jsx)(el.A,{className:"text-primary h-4 w-4"}),(0,a.jsxs)("span",{className:"text-xs leading-tight font-normal",children:[(0,a.jsxs)("span",{children:["See all ",t?"".concat(n):null," results for â"]}),(0,a.jsx)("span",{className:"truncate",children:r}),"â"]})]}),(0,a.jsx)(i(),{onClick:s,href:{pathname:"/search",query:eo.A.stringify({term:r,contextId:l,sortBy:"ByRelevance"},{skipNull:!0,skipEmptyString:!0,sort:(e,t)=>en.ho.indexOf(e)-en.ho.indexOf(t)})},children:"See all"})]})]})},ef=()=>{let{privateApisJwt:e}=(0,d.A)(),[t,n]=(0,w.useState)(!1),{activeCtx:r}=(0,P.j)(),l=(0,s.usePathname)(),{entityId:i,entityName:c,type:u}=null!=r?r:{},m=(0,g.bO)(),p=(0,w.useMemo)(()=>(0,U.Xq)(l),[l]),h=(0,g.L0)(),{searchContextState:x,searchContextTypeState:v,searchTermState:f,fullInputTextState:b,clearSearch:y}=(0,o.Z)(),[j,N]=f,[k,A]=x,[C,S]=v,[,I]=b,{data:E,isFetching:T,isFetched:z}=(0,ea.e4)(N,6,null==k?void 0:k.id,C,e);(0,et.n)({disableUpdate:!E,queryId:null==E?void 0:E.pages[0].queryID,replicaIndex:null==E?void 0:E.pages[0].replicaIndex,offset:0});let O=(0,ea.jz)(()=>{n(!1)}),_=(0,w.useCallback)(e=>{(e.metaKey||e.ctrlKey)&&"KeyK"===e.code&&!p?n(!0):"Escape"===e.key&&n(!1)},[p]);(0,w.useEffect)(()=>(document.addEventListener("keydown",_),()=>{document.removeEventListener("keydown",_)}),[_]),(0,w.useEffect)(()=>{u&&c&&c!==(null==k?void 0:k.name)&&(I("".concat(u.toLowerCase(),":").concat(c," ")),S(en.v1[u.toLowerCase()]),A({id:i,name:c}))},[u,c,i,I,S,A]);let D=(0,w.useCallback)(()=>{n(!1),y()},[n,y]),B=(0,w.useMemo)(()=>{var e,t;let n=null==E?void 0:E.pages[0],r=null!=(e=null==n?void 0:n.nodes)?e:[],l=null!=(t=null==n?void 0:n.total)?t:0;return T&&j||j&&j!==N?(0,a.jsx)(es.A,{}):!T&&!r.length&&z&&j?(0,a.jsx)(ei,{}):r.length&&j?(0,a.jsx)(eg,{onSeeAllClick:D,apis:r,total:l,searchTerm:j,contextId:null==k?void 0:k.id}):void 0},[T,j,N,E,z,D,null==k?void 0:k.id]),R=(0,g.cn)("group flex items-center justify-center transition-all ease-in-out",t&&"fixed inset-0 z-30 bg-neutral-700/20 dark:bg-black/70"),L=(0,g.cn)("absolute top-2 inline-flex flex-col items-start rounded-md bg-background shadow-md dark:bg-neutral-800",h?"w-[90vw]":"w-[582px]");return(0,a.jsxs)("div",{className:R,children:[!t&&h&&(0,a.jsx)("div",{onClick:()=>n(!0),children:(0,a.jsx)(el.A,{className:"icon text-header-primary cursor-pointer"})}),!t&&!h&&(0,a.jsxs)("div",{className:"group border-header-border bg-header-search-background hover:bg-header-hover flex h-8 w-64 cursor-pointer items-center justify-between rounded-md border p-1.5 px-2 shadow-xs transition-all ease-in-out",onClick:()=>n(!0),children:[(0,a.jsxs)("div",{className:"group-hover:dark:text-foreground flex gap-1 text-gray-500",children:[(0,a.jsx)(el.A,{className:"text-header-primary h-4 w-4"}),(0,a.jsx)("span",{className:"text-header-primary max-w-[180px] truncate text-xs leading-tight font-normal",children:j||"Search APIs"})]}),!p&&(0,a.jsx)("div",{className:"group-hover:dark:text-foreground flex h-5 w-auto items-center justify-center rounded-sm border bg-gray-100 px-1 py-px text-slate-500 dark:border-gray-700 dark:bg-gray-700 dark:text-gray-400 group-hover:dark:bg-zinc-500",children:(0,a.jsx)("span",{className:"text-xs",children:m?"âK":"Ctrl+K"})})]}),t&&(0,a.jsxs)("div",{ref:O,className:L,children:[(0,a.jsx)(ee.O,{onClose:D,mode:"Header"}),(0,a.jsxs)("div",{className:"w-full px-4",children:[j||C&&!k?(0,a.jsx)(er.w,{className:"mt-[3px] mb-3"}):null,B?(0,a.jsx)("div",{className:"pb-[9px]",children:B}):null]})]})]})};var eb=n(64376),ey=n(27084);function ej(e){var t,n,l;let{notifications:A,userSubscribedTenant:C,workflowsCount:S}=e,{activeUser:I,isJITProvisioningDisabled:P,configs:E,accessControl:T}=(0,d.A)(),{trackEvent:z}=(0,v.kx)(),O=(0,s.useRouter)(),_=(0,s.usePathname)(),{editMode:B,setEditMode:R,setIsLoading:K,setLocalChangesExists:q,pages:{tenantStaticWidgets:U}}=(0,h.h)(),{handleCancel:H,handleSave:ee,updatedLocalStorageValue:et}=(0,y.E)("header"),[en,ea]=(0,w.useState)((0,y.r)("header",et,U)),[er,el]=(0,w.useState)(!1),ei=(0,m._8)(),es=(0,D.D0)(),{hasPermissionToStudio:eo}=Q(I,null!=T?T:null),ed=$(I),ec=(0,f.aM)(E),eu=ec&&es.pubHubNavigateToNacDocs;(0,w.useEffect)(()=>{try{JSON.parse(null!=et?et:"{}").header&&el(!0)}catch(e){return}},[]);let em=(e,t)=>
1{var n;z(v.oI.MASTHEAD_ITEM_CLICKED,{clickedItem:e}),null==t||null==(n=t.onclick)||n.call(t)},ep=Z(I,ec,null!=(l=en.navigationItems)?l:[]),eh=(null==(n=en.meta)||null==(t=n.style)?void 0:t.alignment)||"justify-start",{disableContextSelect:ex,showContextSelect:ev,showSearchMenu:eg,showRightSection:ej}=V(_,ed,ec),ew=(0,W.u6)(ep,_),eN=async()=>{try{K(!0),await (0,u.L)({...U,header:en}),H(),x.m.success("Header changes were saved successfully")}catch(e){x.m.error("Error updating Header data"),j.v.error("Error updating Header data",{error:e})}finally{R(!1),q(!1),el(!1),K(!1)}},ek=(0,ey.c)(E);return(0,a.jsxs)("header",{className:"bg-header-background flex h-[52px] w-full items-center border-b",children:[er?(0,a.jsx)(c.q,{onCancel:()=>{H(),ea(U.header),el(!1)},onSave:eN,message:"You are now viewing on edit mode, please save in order to apply the header changes."}):null,(0,a.jsxs)("div",{className:"group flex w-full items-center justify-between px-6 py-1",children:[(0,a.jsxs)("div",{className:"flex flex-1 items-center",children:[(0,a.jsx)(J.A,{onNavItemClicked:em}),ev&&(0,a.jsx)(p.CreateEntityDialogProvider,{children:(0,a.jsx)(L,{disabled:ex})})]}),eg&&(0,a.jsx)(o.SearchProvider,{mode:"Header",children:(0,a.jsx)(ef,{})}),ej&&(0,a.jsx)(a.Fragment,{children:I?(0,a.jsxs)("div",{className:"flex flex-1 items-center justify-end",children:[(0,a.jsxs)("div",{className:"flex items-center",children:[B&&(0,a.jsx)("div",{className:"hidden group-hover:flex",children:(0,a.jsx)(b.B,{onSave:e=>{el(!0),ea(e),ee(e)},staticHeaderData:en})}),(0,a.jsxs)("div",{className:"".concat(eh," flex w-full items-center gap-1"),children:[ep.map(e=>{var t;return(0,a.jsx)(k.Bc,{children:(0,a.jsx)(k.m_,{children:(0,a.jsx)(k.k$,{"aria-label":e.name,children:(0,a.jsx)(i(),{onClick:()=>em(e.name.toLocaleUpperCase(),e),"aria-disabled":e.disabled&&"true",tabIndex:e.disabled?-1:void 0,className:(0,g.cn)("text-header-primary hover:bg-header-hover rounded p-2 font-medium hover:no-underline",(null==ew?void 0:ew.name)===e.name&&"bg-header-selected-background text-header-selected-text hover:bg-header-selected-background/75",e.disabled&&"pointer-events-none",e.disabled&&"hover:cursor-not-allowed"),href:null!=(t=e.href)?t:"",target:e.target,children:e.name},e.name)})})},e.name)}),!ec&&(0,a.jsx)(k.Bc,{children:(0,a.jsxs)(k.m_,{children:[(0,a.jsx)(k.k$,{asChild:!0,"aria-label":"Favorites",children:(0,a.jsx)(i(),{href:"/my-saved-apis","aria-label":"Favorites link",children:(0,a.jsx)(r.A,{className:F.h})})}),(0,a.jsx)(k.ZI,{children:"Favorites"})]})})]})]}),(0,a.jsx)("span",{className:"divider bg-header-border mx-3.5 h-5 w-[1px]"}),(0,a.jsxs)("div",{className:"icons flex items-center",children:[(0,a.jsx)(X.A,{notifications:A}),(0,a.jsxs)(a.Fragment,{children:[!ec&&(0,a.jsx)(M.A,{workflowsCount:S}),!ei&&(0,a.jsx)(G.A,{}),!ec&&(0,a.jsx)(Y.A,{})]})]}),(0,a.jsx)(eb.A,{activeUser:I,userSubscribedTenant:C})]}):(0,a.jsxs)("div",{className:"flex flex-1 justify-end gap-1.5",children:[eu&&(0,a.jsx)(i(),{className:"text-header-primary hover:bg-header-hover rounded p-2 font-medium hover:no-underline",href:"/docs/getting-started",children:"Docs"}),(0,a.jsx)(Y.A,{}),(0,a.jsx)(N.$,{onClick:()=>O.push("/auth/login"),size:"md",children:"Sign In"}),P?null:(0,a.jsx)(N.$,{onClick:()=>O.push(ek),variant:"secondary",size:"md",children:"Sign Up"})]})})]})]})}var ew=n(96059),eN=n(61085),ek=n(17826);function eA(e){var t,n,r;let{workflowsCount:l,userSubscribedTenant:c}=e,{activeUser:u,isJITProvisioningDisabled:m,configs:x}=(0,d.A)(),{trackEvent:b}=(0,v.kx)(),[y,j]=(0,w.useState)(!1),[k,A]=(0,w.useState)(!1),C=(0,s.useRouter)(),S=(0,s.usePathname)(),I=$(u),P=(0,f.Pm)(x),{pages:{tenantStaticWidgets:E}}=(0,h.h)(),T=(0,w.useMemo)(()=>{var e,t,n;return null!=(n=null==(t=E.footer)||null==(e=t.siteMap)?void 0:e.filter(e=>e.showInMobileHeader))?n:[]},[E]);(0,ek.A)(()=>{j(!0)});let z=(e,t)=>{var n;b(v.oI.MASTHEAD_ITEM_CLICKED,{clickedItem:e}),null==t||null==(n=t.onclick)||n.call(t)},O=Z(u,P,null!=(n=null==(t=E.header)?void 0:t.navigationItems)?n:[]),{disableContextSelect:_,showContextSelect:D,showSearchMenu:R}=V(S,I,P),F=(0,W.u6)(O,S),K="flex h-8 justify-center rounded border font-medium text-header-primary hover:bg-primary-foreground hover:no-underline",q=(0,ey.c)(x);if(y)return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("header",{className:"bg-header-background flex h-[52px] w-full items-center border-b border-b-1",children:(0,a.jsxs)("div",{className:"flex w-full items-center justify-between px-4 py-2.5",children:[u?(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(i(),{onClick:()=>{var e;return z(null!=(e=null==F?void 0:F.name.toLocaleUpperCase())?e:"",F)},className:"rounded border-none bg-link-background p-2 font-medium text-link-foreground hover:bg-link-background/75 hover:no-underline dark:bg-link-foreground dark:text-link-background dark:hover:bg-zinc-700 hover:dark:bg-link-foreground
1/75",href:null!=(r=null==F?void 0:F.href)?r:"",children:null==F?void 0:F.name}),(0,a.jsxs)(B.rI,{children:[(0,a.jsxs)(B.ty,{className:"flex items-center gap-2 rounded p-2 text-xs hover:bg-gray-100 dark:hover:bg-zinc-700",children:[(0,a.jsx)("span",{children:"More"}),(0,a.jsx)(ew.A,{className:"h-3 w-3"})]}),(0,a.jsx)(B.SQ,{align:"start",children:O.filter(e=>e.name!==(null==F?void 0:F.name)).map(e=>{var t;return(0,a.jsx)(B._2,{className:"rounded font-medium hover:cursor-pointer hover:bg-gray-100 dark:hover:bg-zinc-700",children:(0,a.jsx)(i(),{className:"text-header-primary hover:no-underline",onClick:()=>z(e.name.toLocaleUpperCase(),e),href:null!=(t=e.href)?t:"",children:e.name})},e.name)})})]})]}):(0,a.jsx)("div",{className:"flex items-center",children:(0,a.jsx)(J.A,{onNavItemClicked:z})}),(0,a.jsxs)("div",{className:"flex h-min gap-2",children:[R&&(0,a.jsx)(o.SearchProvider,{mode:"Header",children:(0,a.jsx)(ef,{})}),u?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(M.A,{workflowsCount:l}),(0,a.jsx)(G.A,{}),(0,a.jsx)(eb.A,{activeUser:u,userSubscribedTenant:c})]}):(0,a.jsx)("div",{onClick:()=>A(e=>!e),className:"icon relative ".concat(k&&"bg-gray-100 dark:bg-zinc-700"," hover:cursor-pointer"),children:(0,a.jsx)(eN.a,{size:12,toggled:k})})]})]})}),k&&(0,a.jsxs)("div",{className:"absolute top-[52px] z-20 h-[calc(100vh_-_52px)] w-full bg-white px-6 py-8 dark:bg-zinc-800",children:[(0,a.jsx)("span",{className:"text-header-primary font-semibold",children:"Learn More"}),T.map(e=>(0,a.jsxs)("ul",{className:"flex flex-col gap-2.5 pt-2",children:[e.items.map((e,t)=>(0,a.jsx)("li",{children:(0,a.jsx)(i(),{target:"_blank",href:e.link,className:"text-footer-secondary text-xs",children:e.title})},t)),(0,a.jsxs)("div",{className:"flex flex-col gap-2 pt-4",children:[(0,a.jsxs)("div",{className:"flex w-full gap-3",children:[(0,a.jsx)(i(),{className:(0,g.cn)(K,"grow px-4 py-2"),href:"https://rapidapi.com/contact/",target:"_blank",children:"Contact Us"}),(0,a.jsx)(N.$,{className:"flex grow border px-4",onClick:()=>C.push("/auth/login"),variant:"ghost",size:"md",children:"Sign In"}),m?null:(0,a.jsx)(N.$,{className:"flex grow px-4",onClick:()=>C.push(q),size:"md",children:"Sign Up"})]}),(0,a.jsx)(i(),{className:(0,g.cn)(K,"w-full p-2"),href:"/auth?referral=/studio",children:"Add Your API"})]})]},e.title))]}),D&&(0,a.jsx)(p.CreateEntityDialogProvider,{children:(0,a.jsx)(L,{disabled:_})})]})}let eC=e=>{let{notifications:t,userSubscribedTenant:n,workflowsCount:r}=e;return(0,g.L0)()?(0,a.jsx)(eA,{notifications:t,userSubscribedTenant:n}):(0,a.jsx)(ej,{notifications:t,userSubscribedTenant:n,workflowsCount:r})}},35413:(e,t,n)=>{"use strict";n.d(t,{Gs:()=>d,Xp:()=>i,e4:()=>o,jz:()=>s});var a=n(20441);n(88661);var r=n(25979),l=n(12115);let i=e=>{let{dataLength:t,onSelect:n}=e,[a,r]=(0,l.useState)(-1),i=(0,l.useRef)(a);(0,l.useEffect)(()=>{i.current=a},[a]);let s=(0,l.useCallback)(e=>{if(!t)return;let{key:a}=e,l=t-1;"ArrowUp"===a?(e.preventDefault(),r(e=>e-1>=0?e-1:l)):"ArrowDown"===a?(e.preventDefault(),r(e=>e+1<=l?e+1:0)):"Enter"===a&&i.current>-1&&(e.preventDefault(),n(i.current))},[n,t]);return(0,l.useEffect)(()=>(document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s)}),[s]),{activeIndex:a}},s=e=>{let t=(0,l.useRef)(null),n=(0,l.useRef)(e);return(0,l.useEffect)(()=>{n.current=e},[e]),(0,l.useEffect)(()=>{let e=e=>{if(t.current&&!t.current.contains(e.target)){var a;null==(a=n.current)||a.call(n)}};return document.addEventListener("mousedown",e),()=>{n.current=null,document.removeEventListener("mousedown",e)}},[]),t},o=(e,t,n,l,i)=>(0,r.useInfiniteQuery)({queryKey:["searchApis",e,i,n,l,t],queryFn:()=>(0,a.GW)({paginationInput:{first:t},searchApiWhereInput:{privateApisJwt:i,term:e,contextId:n,contextType:l},searchApiOrderByInput:void 0}),enabled:!!e,getNextPageParam:()=>void 0,initialPageParam:null}),d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ByRelevance",n=arguments.length>2?arguments[2]:void 0,l=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0,d=arguments.length>7?arguments[7]:void 0;return(0,r.useInfiniteQuery)({queryKey:["searchApis",e,d,l,t,i,n,s,o],queryFn:r=>{let{pageParam:c}=r;return(0,a.GW)({paginationInput:{first:l,after:null!=c?c:""},searchApiWhereInput:{privateApisJwt:d,term:e,categoryNames:i?[i]:void 0,tags:n||void 0,contextId:s,contextType:o},searchApiOrderByInput:{sortingFields:[{fieldName:t,by:"ASC"}
1]}})},getNextPageParam:e=>{var t,n;return(null==(t=e.pageInfo)?void 0:t.hasNextPage)?null==e||null==(n=e.pageInfo)?void 0:n.endCursor:void 0},initialPageParam:null,staleTime:0})}},55441:(e,t,n)=>{"use strict";n.d(t,{K:()=>m});var a=n(16090),r=n(14449),l=n(749),i=n(99776),s=n(80549),o=n(59411),d=n(29304);let c=/^(?!-)(?!.*--)[a-zA-Z0-9- ]+[a-zA-Z0-9]$/,u=e=>c.test(e||""),m=e=>{let{mutateAsync:t}=(()=>{let e=(0,i.useQueryClient)();return(0,s.useMutation)({mutationKey:["createOrganization"],mutationFn:e=>(0,l.EC)({input:e}),onSuccess:async(t,n,a)=>{await e.invalidateQueries({queryKey:["getActiveUser"]}),await e.invalidateQueries({queryKey:["getAccessControl"]})}})})(),{mutateAsync:n}=(()=>{let e=(0,i.useQueryClient)();return(0,s.useMutation)({mutationKey:["createTeam"],mutationFn:e=>(0,o.g)({input:e}),onSuccess:async(t,n,a)=>{await e.invalidateQueries({queryKey:["getActiveUser"]}),await e.invalidateQueries({queryKey:["getAccessControl"]})}})})(),c=(0,r.B1)(),{activeUser:m,refetchAccessControl:p}=(0,a.A)(),h=(0,i.useQueryClient)(),{executeRecaptcha:x}=(0,d.A)(),v=async e=>{try{return await (0,l.b2)({input:{term:e}})}catch(e){return!0}};switch(e){case"createTeam":return{type:"createTeam",title:"Create Your Team",description:"Teams allow collaboration within your organization.",fields:[{id:"name",label:"Team Name",type:"text",placeholder:"Enter team name",value:"",isRequired:!0,validations:[{predicate:u,errorDescription:"The name may only contain alphanumeric characters or single hyphens, cannot begin or end with a hyphen, and has to be at least 2 letters."}]},{id:"description",label:"Description",type:"textarea",placeholder:"Write here...",value:""}],onSave:async(e,t)=>{c.start("Creating new team...");try{if(!await v(e.name)){t("The team name '".concat(e.name,"' is already in use. Please choose another name.")),c.error("Failed to create team");return}}catch(e){t("Failed to create team"),c.error("Failed to create team");return}try{e.thumbnail="/static-assets/default/teamContext.svg";let t=await n(e);if(!t)throw c.error("Failed to create team"),Error();return c.finish("Team created!"),t}catch(e){t("This team name is invalid, Please choose another name."),c.error("Failed to create team")}}};case"createOrganization":return{type:"createOrganization",title:"Create Your Organization",description:"Organizations allow your team to manage API usage both internally and externally.",fields:[{id:"name",label:"Organization Name",type:"text",placeholder:"Enter organization name",value:"",isRequired:!0,validations:[{predicate:u,errorDescription:"The name may only contain alphanumeric characters or single hyphens, cannot begin or end with a hyphen, and has to be at least 2 letters."}]},{id:"description",label:"Description",type:"textarea",placeholder:"Write here...",value:""}],onSave:async(e,n)=>{c.start("Creating new organization...");try{if(!await v(e.name)){n("The organization name '".concat(e.name,"' is already in use. Please choose another name.")),c.error("Failed to create organization");return}}catch(e){n("Failed to create organization"),c.error("Failed to create organization");return}try{let n=await (null==x?void 0:x("create_organization"));e.email=m.email,e.seats=5,e.recaptcha=n,e.thumbnail="/static-assets/default/teamContext.svg";let a=await t(e);if(!a)throw c.error("Failed to create organization"),Error();return await h.refetchQueries({queryKey:["getActiveUser"]}),await p(),c.finish("Organization created!"),a}catch(e){var a,r,l;n((null==e||null==(l=e.response)||null==(r=l.errors)||null==(a=r[0])?void 0:a.message)||"This organization name is invalid, Please choose another name."),c.error("Failed to create organization")}}};default:return null}}},59411:(e,t,n)=>{"use strict";n.d(t,{T:()=>r,g:()=>l});var a=n(96944);let r=async e=>{let{id:t}=e;return(0,a.Z)().DeleteTeam({id:t}).then(e=>e.data.deleteTeam)},l=async e=>(0,a.Z)().createTeam(e).then(e=>{var t;return null==(t=e.data.createTeam)?void 0:t.id})},59938:(e,t,n)=>{"use strict";n.d(t,{O:()=>l,o:()=>r});var a=n(80174);let r=(e,t)=>{var n,r,i,s;if(!t||!e)return{canEdit:!1,canViewKeys:!1};switch(t.type){case"Org":let o=null==(r=t.organization)||null==(n=r.teams)?void 0:n.filter(e=>!!e).map(e=>null==e?void 0:e.id);return{canEdit:(null!=o?o:[]).some(n=>a.ng.getPermission({orgId:t.entityId,teamId:n,userId:e}
1,["CREATE_APP"]).granted),canViewKeys:(null!=o?o:[]).some(n=>a.ng.getPermission({orgId:t.entityId,teamId:n,userId:e},["VIEW_APP_KEY"]).granted)};case"Team":return{canEdit:a.ng.getPermission({orgId:null==(i=t.organization)?void 0:i.id,teamId:t.entityId,userId:e},["CREATE_APP"]).granted,canViewKeys:a.ng.getPermission({orgId:null==(s=t.organization)?void 0:s.id,teamId:t.entityId,userId:e},["VIEW_APP_KEY"]).granted};case"User":let d=l(e);return{canEdit:d,canViewKeys:d};default:return{canEdit:!1,canViewKeys:!1}}},l=e=>!!e&&a.ng.getPermission({userId:e},["PERSONAL_CONTEXT"]).granted},62254:(e,t,n)=>{Promise.resolve().then(n.bind(n,9972)),Promise.resolve().then(n.bind(n,27542)),Promise.resolve().then(n.bind(n,19179)),Promise.resolve().then(n.bind(n,81981)),Promise.resolve().then(n.bind(n,25804)),Promise.resolve().then(n.bind(n,5742)),Promise.resolve().then(n.bind(n,55923)),Promise.resolve().then(n.bind(n,75144)),Promise.resolve().then(n.bind(n,59713)),Promise.resolve().then(n.bind(n,72773)),Promise.resolve().then(n.bind(n,18298)),Promise.resolve().then(n.bind(n,33742)),Promise.resolve().then(n.bind(n,99776)),Promise.resolve().then(n.bind(n,47785)),Promise.resolve().then(n.bind(n,25979)),Promise.resolve().then(n.bind(n,59441)),Promise.resolve().then(n.bind(n,80549)),Promise.resolve().then(n.bind(n,1043)),Promise.resolve().then(n.bind(n,11515)),Promise.resolve().then(n.bind(n,53455)),Promise.resolve().then(n.bind(n,45339)),Promise.resolve().then(n.bind(n,5947)),Promise.resolve().then(n.bind(n,86639))},65596:(e,t,n)=>{"use strict";n.d(t,{O:()=>f});var a=n(95155),r=n(26712),l=n(16090),i=n(76049),s=n(64690),o=n(41715),d=n(43569),c=n(20063),u=n(79706),m=n(12115),p=n(4465),h=n(35413);let x=e=>{let{list:t,termWithoutContextType:n,setSelectedSearchContext:r,type:l,title:i}=e,s=t.filter(e=>{var t;return n?null==e||null==(t=e.name)?void 0:t.startsWith(n):e}),{activeIndex:o}=(0,h.Xp)({dataLength:s.length,onSelect:e=>r(s[e],l)});return(0,a.jsxs)("div",{className:"flex flex-col items-start gap-[9px]",children:[(0,a.jsxs)("span",{className:"text-secondary text-xs font-semibold",children:[i," (",null==s?void 0:s.length,")"]}),(0,a.jsx)("ul",{className:"w-full",children:s.slice(0,8).map((e,t)=>(0,a.jsxs)("li",{className:"hover:bg-accent flex h-6 cursor-pointer flex-row items-center gap-2 rounded px-1 py-1 ".concat(o===t?"bg-accent/80":""),onClick:()=>r(e,l),children:[(0,a.jsx)(p.A,{className:"text-secondary h-4 w-4"}),(0,a.jsx)("span",{className:"text-foreground text-xs",children:e.name})]},e.id))})]})};var v=n(91732),g=n(51496);let f=e=>{var t;let{onClose:n,mode:p}=e,f=(0,s.r9)(),b=(0,c.useRouter)(),y=(0,g.A)(),{trackEvent:j}=(0,i.kx)(),w=(0,m.useRef)(null),N=(0,m.useRef)(null),{activeUser:k}=(0,l.A)(),A=null==k?void 0:k.organizations,C=(0,m.useMemo)(()=>null==A?void 0:A.map(e=>e.teams).flat(),[A]),{fullInputTextState:S,searchContextState:I,searchContextTypeState:P,searchTermState:E,termWithoutContextTypeState:T,clearSearch:z}=(0,r.Z)(),[O,_]=S,[D,B]=P,[R,L]=I,[M,,F]=E,[W,K]=T,q=(0,h.jz)(()=>{"Org"!==D&&"Team"!=D||R||H()}),U=(0,s.L0)(),H=()=>{var e;f("/search?sortBy=ByRelevance"),F(""),_(""),L(null),K(""),null==(e=w.current)||e.focus()};(0,m.useEffect)(()=>{O||(F(""),L(null),K(""))},[O,F,L,K]),(0,m.useEffect)(()=>{let e=y(),t=w.current,a=t=>{var a,r;if(e)if(("ArrowUp"===t.key||"ArrowDown"===t.key)&&(null==(a=w.current)||a.blur()),"Page"!==p||"Enter"!==t.key||["org:","team:","user:"].includes(O)){if("Enter"===t.key){let e=u.A.stringify({term:M,contextId:null==R?void 0:R.id,sortBy:"ByRelevance"},{skipNull:!0,skipEmptyString:!0,sort:(e,t)=>v.ho.indexOf(e)-v.ho.indexOf(t)});z(),j(i.oI.SEARCH,{term:e,filtersApplied:!0,component:"SearchNav"}),b.push("/search?".concat(e),{scroll:!0}),n&&n(!1)}}else{let e=R?W.split(null!=(r=null==R?void 0:R.name)?r:"")[1].trim():O;F(e.trim());let t=u.A.stringify({term:e,sortBy:"ByRelevance",contextId:null==R?void 0:R.id},{skipNull:!0,skipEmptyString:!0,sort:(e,t)=>v.ho.indexOf(e)-v.ho.indexOf(t)});return j(i.oI.SEARCH,{term:e,filtersApplied:!0,component:"SearchNav"}),f("/search?".concat(t))}};return null==t||t.addEventListener("keydown",a),()=>{null==t||t.removeEventListener("keydown",a)}},[F,O,p,W,null==R?void 0:R.name,null==R?void 0:R.id,M,b,n,y,R,j,f,z]);let V=(0,m.useCallback)(()=>{L({id:null==k?void 0:k.id,name:"Personal Account"}),_("user:Personal Account ")},[null==k?void 0:k.id,L,_]),Q=(0,m.useMemo)(()=>{var e;let[t]=null!=(e=O.match(/team:|org:|user:/))?e:[];if(t){t=t.slice(0,-1);let e=(0,v.vA)(O,t),n="org"===t?A:C;if(!n)return F(O),O;let{containedItem:r,exactItem:l}=(0,v.kk)(n,e);if(B(v.v1[t]),K(e),"user"===t?e&&!e.trim().includes("Personal Account")?(L(null),F(""),_(""),K(""),B(void 0)):(null==R?void 0:R.id)!==(null==k?void 0:k.id)&&V():("team"===t||"org"===t)&&(l?R&&R.id===(null==l?void 0:l.id)||L({id:null==r?void 0:r.id,name:null==r?void 0:r.name}):(L(null),F(""))),R&&"Header"===p){let t=e.split(R.name)[1];void 0!==t&&F(t.trim())}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{children:[t,":"]}),r&&!R?(0,a.jsx)("span",{className:"h-4 bg-blue-100 text-xs text-blue-500 dark:opacity-10",children:e}):null,R?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"h-4 bg-blue-100 text-xs text-blue-500 dark:opacity-10",children:null==R?void 0:R.name}),(0,a.jsx)("span",{children:e.split("".concat(e,":").concat(R.name))[1]})]}):null,(0,a.jsx)("span",{children:R||r?e.split(null==R?void 0:R.name)[1]:e})]})}return(["org:","team:"].every(e=>!e.startsWith(O))||!O)&&"Header"===p&&F(O),L(null),B(void 0),O},[O,A,F,C,null==k?void 0:k.id,V,L,B,K,p]),Z=(0,m.useCallback)((e,t)=>{if(e){var n;_("".concat(t,":").concat(e.name," ")),L(e),null==(n=w.current)||n.focus()}},[_,L]),$=(0,m.useMemo)(()=>"Org"!==D||R?"Team"!==D||R?null:(0,a.jsx)(x,{list:C,termWithoutContextType:W,setSelectedSearchContext:Z,type:"team",title:"Teams"}):(0,a.jsx)(x,{list:A,termWithoutContextType:W,setSelectedSearchContext:Z,type:"org",title:"Organizations"}),[Z,A,C,R,W,D]);return(0,m.useEffect)(()=>
1{if(w.current&&N.current){let e=N.current.offsetWidth>300?N.current.offsetWidth:300;w.current.style.width="".concat(e,"px")}},[null==(t=N.current)?void 0:t.offsetWidth]),(0,a.jsxs)("div",{ref:q,className:"relative flex w-full items-center rounded-md px-4 py-[9px] ".concat("Page"===p?"bg-background h-8 border dark:bg-neutral-800":"bg-header-search-background"),children:[(0,a.jsx)("div",{className:"relative w-full",children:(0,a.jsxs)("div",{className:"flex w-[inherit] flex-1 items-center gap-1",children:[(0,a.jsx)(o.A,{className:"h-4 w-4 text-neutral-400"}),(0,a.jsxs)("div",{className:"query-builder-input-container hide-scroll absolute left-[21px] flex h-full ".concat("Page"===p?"w-[calc(100%-106px)]":"w-[calc(100%-126px)]"," flex-1 overflow-x-auto overflow-y-hidden"),children:[(0,a.jsx)("div",{ref:N,className:"query-builder-content relative inline-flex flex-1 text-xs break-words whitespace-pre select-none dark:text-white",children:Q}),(0,a.jsx)("div",{className:"query-builder-input-wrapper absolute w-full self-stretch",children:(0,a.jsx)("input",{autoFocus:!0,ref:w,value:O,autoComplete:"off",spellCheck:"false",onChange:e=>_(e.target.value),type:"text",placeholder:k?"Search (example: org:, team:, user:)":"Search...",className:"placeholder:text-primary! relative flex min-w-full bg-none text-xs text-transparent outline-none focus:caret-gray-900 dark:focus:caret-white"})})]}),(0,a.jsxs)("div",{className:"absolute right-0 flex items-center gap-2",children:[O&&(0,a.jsx)("span",{className:"cursor-pointer text-xs text-gray-400 opacity-90 hover:opacity-80",onClick:H,children:"Clear"}),!U&&(0,a.jsx)("div",{className:"group-hover:dark:text-foreground flex h-5 w-auto cursor-default justify-center rounded-sm border bg-gray-100 px-1 py-px text-slate-500 hover:cursor-pointer dark:border-gray-700 dark:bg-gray-700 dark:text-gray-400 group-hover:dark:bg-zinc-500",children:(0,a.jsx)("span",{onClick:()=>{if(null==w?void 0:w.current){let e=new KeyboardEvent("keydown",{key:"Enter"});w.current.dispatchEvent(e)}},className:"text-xs",children:"Enter"})}),n?(0,a.jsx)(d.A,{onClick:()=>n(!1),className:"h-3.5 w-3.5 cursor-pointer text-gray-500 hover:opacity-80"}):null]})]})}),$?(0,a.jsx)("div",{className:"bg-background absolute top-[40px] right-0 left-0 z-10 rounded-md px-4 py-2 shadow dark:bg-neutral-800",children:$}):null]})}},71402:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var a=n(95155),r=n(19019);let l=(e,t)=>Math.floor(Math.random()*(t-e)+e),i=()=>(0,a.jsx)("div",{className:"flex w-full",children:(0,a.jsxs)("div",{className:"flex w-full flex-col gap-[9px]",children:[(0,a.jsx)(r.E,{className:"mb-1 h-3 w-24 bg-neutral-100 dark:bg-zinc-600"}),(0,a.jsx)("ul",{className:"api-result-list flex w-full flex-col gap-2 self-start",children:[...Array(6).keys()].map(e=>(0,a.jsx)("li",{className:"api-result-item",children:(0,a.jsxs)("div",{className:"flex items-start justify-start gap-2 px-2 py-1.5",children:[(0,a.jsx)(r.E,{className:"h-8 w-8 rounded-3xl bg-neutral-100 dark:bg-zinc-600"}),(0,a.jsxs)("div",{className:"flex h-9 flex-1 flex-col justify-between",children:[(0,a.jsx)(r.E,{className:"h-3 bg-neutral-100 dark:bg-zinc-600",style:{width:"".concat(l(40,70),"%")}}),(0,a.jsx)(r.E,{className:"h-3 bg-neutral-100 dark:bg-zinc-600",style:{width:"".concat(l(10,40),"%")}})]})]})},e))})]})})},91732:(e,t,n)=>{"use strict";n.d(t,{$5:()=>a,$D:()=>u,G2:()=>c,IW:()=>m,QB:()=>s,_H:()=>i,ho:()=>o,kk:()=>l,v1:()=>d,vA:()=>r}),n(19251),n(48522);let a=21,r=(e,t)=>e.split("".concat(t,":"))[1],l=(e,t)=>({containedItem:e.find(e=>{var n;return null==e||null==(n=e.name)?void 0:n.startsWith(t)}),exactItem:e.find(e=>t.startsWith(null==e?void 0:e.name))}),i=(e,t,n,a,r)=>{if("Page"===r)return null;if("Org"===e)return t;if("Team"===e){var l;return null==t||null==(l=t.teams)?void 0:l.find(e=>e.id===n)}return"User"===e?{id:n,name:a}:null},s={ByAlphabetical:"Alphabetical",ByRelevance:"Relevance",ByUpdatedAt:"Last Updated",ByTrending:"Trending"},o=["term, contextId","sortBy"],d={org:"Org",team:"Team",user:"User"},c=(e,t)=>t?"".concat(t.type.toLocaleLowerCase(),":").concat(t.entityName," ").concat(e):e,u=(e,t,n
1)=>n?r(e,null==n?void 0:n.type):t,m=e=>d[e.toLowerCase()]},93442:(e,t,n)=>{"use strict";n.d(t,{nE:()=>N,pl:()=>w});var a=n(95155),r=n(28924),l=n(89333),i=n(36077),s=n(16090),o=n(33525),d=n(20441),c=n(92302),u=n(53455),m=n(15249),p=n(20063),h=n(94821),x=n(63464),v=n(43074),g=n(6699),f=n(78980),b=n(47944),y=n(617);let j=e=>{let{text:t,tooltipText:n}=e;return n?(0,a.jsx)(l.Bc,{children:(0,a.jsxs)(l.m_,{children:[(0,a.jsxs)(l.k$,{"aria-label":"Live Network stepper",className:"inline-flex cursor-help items-center gap-2",children:[t,(0,a.jsx)(c.A,{width:16,height:16,className:"text-secondary opacity-60"})]}),(0,a.jsx)(l.ZI,{side:"bottom",children:(0,a.jsx)("div",{style:{maxWidth:"400px"},children:n})})]})}):t},w=()=>{let{configs:e,activeUser:t}=(0,s.A)(),{activeCtx:n}=(0,i.j)(),a=(0,o.Pm)(e),l=(0,g.PQ)(e),c=null==l?void 0:l.apiId,{data:m,isLoading:p}=(0,u.useQuery)({queryKey:["apiBillingPlans",c,null==n?void 0:n.entityId],queryFn:()=>{var e;return(0,d.I2)(c,null!=(e=null==n?void 0:n.entityId)?e:"")},enabled:a&&!!t}),{data:h}=(0,r.cN)({enabled:a&&!!t}),x=(null==m?void 0:m.api)&&(null==m?void 0:m.entityById)?(0,b.Hv)(m.api,e,m.entityById,n):void 0,v=(0,b.yW)(x,null==l?void 0:l.hiddenPlan),f=(null==h?void 0:h.customerStatus)==="PENDING"||(null==h?void 0:h.customerStatus)==="APPROVED"&&!v;return{isSubscribedToProd:v,hasPendingBillingRequest:f,isLoading:p}},N=()=>{var e,t,n,r,l,d,c,u;let g,{activeCtx:b}=(0,i.j)(),{configs:w,activeUser:N}=(0,s.A)(),k=(0,m.D0)(),A=(0,p.useParams)(),C=(0,f.$D)(null==N?void 0:N.id,b),S=(0,f.vZ)(null==N?void 0:N.id,b),I=null==k?void 0:k.ffShowNaccTmf931Registration,P=(0,o.Pm)(w),E=(0,o.aM)(w),T=(0,o.ic)(w),z="string"==typeof(null==A?void 0:A.id)&&/^\d+$/.test(A.id)?Number(A.id):void 0,O=!!z&&E&&I&&(null==b?void 0:b.type)!=="User",_=null!=(t=(null==b?void 0:b.type)==="Org"?b.entityId:null==b||null==(e=b.organization)?void 0:e.id)?t:"",D=(0,y.y)({enabled:P&&E&&I}),B=D.customer,R=null!=(n=D.businessProfile.id)?n:void 0,L=D.businessProfile.status,{data:M,isLoading:F}=(0,x.Wz)(_,{enabled:E&&I&&(null==b?void 0:b.type)!=="User"}),{data:W,isLoading:K}=(0,x.VH)(O?z:void 0),q=D.isSubscribedToProd,U=D.isLoading||F||O&&K,H=!!B,V=!!R;if(U)return{steps:[],primaryActionStep:null,hasBillingProfile:H,hasBusinessProfile:V,isLoading:U,isError:D.isError};let Q=null!=(r=null==M?void 0:M.count)?r:0,Z=O&&Array.isArray(W)&&W.some(e=>{var t,n;return(null!=(n=null==(t=e.products)?void 0:t.length)?n:0)>0}),$=Q>0||Z;if($){let e=null!=(l=null==M?void 0:M.nodes)?l:[];g=O&&null!=W?(0,v.BA)(W):Q>0?(0,v.br)(e):h.S.PENDING}let Y=((e,t,n)=>{let{text:r,status:l,tooltipText:i,action:s}=function(){var a;return(null==n?void 0:n.customerStatus)==="PENDING"?{text:"Billing account pending approval",tooltipText:"",status:"pending",action:null}:(null==n?void 0:n.customerStatus)==="DENIED"?{text:"Billing account rejected",tooltipText:"Billing account request rejected, please contact support for further assistance.",status:"rejected",action:()=>{var e,n;let a=(null==t?void 0:t.type)==="Team"?null==(e=t.organization)?void 0:e.id:null==t?void 0:t.entityId;null==(n=window)||n.open("/console/".concat(a,"/billing/information"),"_self")}}:(null==n?void 0:n.customerStatus)!=="APPROVED"||"STRIPE"!==n.type||(null==(a=n.paymentMethods)?void 0:a.length)?(null==n?void 0:n.customerStatus)!=="APPROVED"||e?(null==n?void 0:n.customerStatus)==="APPROVED"&&e?{text:"Create billing account",tooltipText:"",status:"complete",action:null}:{text:"Create billing account",tooltipText:"",status:"initial",action:()=>{var e,n;let a=(null==t?void 0:t.type)==="Team"?null==(e=t.organization)?void 0:e.id:null==t?void 0:t.entityId;null==(n=window)||n.open("/console/".concat(a,"/billing/information?prodSetup=true"),"_self")}}:{text:"Choose pricing plan",tooltipText:"Billing account request approved, review price plan and activate it to proceed.",status:"pending",action:()=>{var e,n;let a=(null==t?void 0:t.type)==="Team"?null==(e=t.organization)?void 0:e.id:null==t?void 0:t.entityId;null==(n=window)||n.open("/console/".concat(a,"/billing/price-plan"),"_self")}}:{text:"Add payment method",tooltipText:"Please provide payment method to complete your setup.",status:"pending",action:()=>{var e,n;let a=(null==t?void 0:t.type)==="Team"?null==(e=t.organization)?void 0:e.id:null==t?void 0:t.entityId;null==(n=window)||n.open("/console/".concat(a,"/billing/information"),"_self")}}}();return{id:"billing",order:0,label:(0,a.jsx)(j,{text:r,tooltipText:i}),status:l,isDisabled:!1,actionText:r,actionRequired:!!s,action:s}})(q,b,B),G=[Y,((e,t,n,r,l)=>{let i=!!t,s="pendingApproval"===l||"pendingApproval"===e,o="rejected"===e;return{id:"business",order:1,label:s?(0,a.jsx)(a.Fragment,{children:"Business profile pending approval"}):o?(0,a.jsx)(j,{text:"Business profile rejected",tooltipText:"Business profile request rejected. Please update and resubmit your details."}):(0,a.jsx)(a.Fragment,{children:"Create business profile"}),status:s?"pending":o?"rejected":"approved"===e||"active"===e?i?"complete":"pending":i?"pen
1ding":"initial",isDisabled:!r,actionText:s?"Business profile pending approval":o?"Update business profile":"Create business profile",actionRequired:!!r&&(!i||o),action:r&&(!i||o)?()=>{var e,t;let a=(null==n?void 0:n.type)==="Team"?null==(e=n.organization)?void 0:e.id:null==n?void 0:n.entityId;null==(t=window)||t.open("/console/".concat(a,"/business?businessSetup=true"),"_self")}:null}})(L,R,b,C,D.businessProfileState),((e,t,n,r,l,i,s,o,d,c)=>{let u,m,p,x=c?!d:(null==i?void 0:i.customerStatus)!=="APPROVED"||!e||!n||"approved"!==r&&"active"!==r||!d;if(!o)return{id:"application",order:2,label:(0,a.jsx)(a.Fragment,{children:"Create application profile"}),status:"initial",isDisabled:x,actionText:"Create application profile",actionRequired:!x&&!!d,action:d?()=>{var e;let n=(null==t?void 0:t.type)==="Team"?null==(e=t.organization)?void 0:e.id:null==t?void 0:t.entityId;window.open("/console/".concat(n,"/applications?selectApplication=true"),"_self")}:null};switch(c&&o&&(s=h.S.APPROVED),null!=s?s:h.S.PENDING){case h.S.ACTIVE:case h.S.APPROVED:u="complete",m=(0,a.jsx)(a.Fragment,{children:"Create application profile"}),p="Create application profile";break;case h.S.PENDING:u="pending",m=(0,a.jsx)(j,{text:"Application profile pending approval",tooltipText:"Your application profile is with network providers for approval. Track status on the application profile page."}),p="Application profile pending approval";break;case h.S.REJECTED:u="rejected",m=(0,a.jsx)(j,{text:"Application profile rejected",tooltipText:"Your application was rejected by network providers. Review details on the application profile page."}),p="Application profile rejected";break;case h.S.DEACTIVATED:u="rejected",m=(0,a.jsx)(j,{text:"Application deactivated",tooltipText:"Live network access is not available while the application is deactivated."}),p="Application deactivated";break;default:u="pending",m=(0,a.jsx)(a.Fragment,{children:"Create application profile"}),p="Create application profile"}return{id:"application",order:2,label:m,status:u,isDisabled:x,actionText:p,actionRequired:!1,action:null}})(q,b,R,L,0,B,g,$,S,T)],J=null!=(u=null!=(c=null!=(d=G.find(e=>"billing"===e.id&&!!e.action&&!e.isDisabled))?d:G.find(e=>"business"===e.id&&!!e.action&&!e.isDisabled))?c:G.find(e=>"application"===e.id&&!!e.action&&!e.isDisabled))?u:null;return{steps:G,primaryActionStep:J,hasBillingProfile:H,hasBusinessProfile:V,isLoading:U,isError:D.isError}}}},e=>{e.O(0,[634,4512,4935,2084,8371,2580,3455,6341,7017,74,8577,2619,181,5826,7150,7520,7308,3796,2221,2544,6969,7102,5249,1820,7971,5197,2280,4301,1029,7408,7892,9100,1011,6698,2397,6204,1048,2464,5812,6944,5170,1715,250,3464,5783,617,8359,3099,6693,1744,8441,1255,7358],()=>e(e.s=62254)),_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.