1"use strict";(self.uniqueWebpackInstance1790626159385=self.uniqueWebpackInstance1790626159385||[]).push([[7570],{13369:function(e,t,i){i.d(t,{f:function(){return r}});var n=i(96540);let r=function(e){return e.Medium="medium",e.Narrow="narrow",e}({});t.A=({children:e,type:t=r.Narrow})=>n.createElement("div",{className:"max-width-568 hui-border-radius-10 hui-background-white hui-margin-horizontal-auto hui-margin-bottom-72 hui-margin-bottom-56:md"},n.createElement("div",{"aria-live":t===r.Narrow?"assertive":void 0,className:"hui-padding-24 hui-padding-vertical-40:md "+(t===r.Narrow?"hui-padding-horizontal-72:md":"hui-padding-horizontal-40:md")},e))},18981:function(e,t,i){i.d(t,{o:function(){return u}}),i(26910),i(62953);var n=i(95195),r=i(36095),o=i(96540);const a=e=>{const t={};return[...e||[]].sort(((e,t)=>e.id.localeCompare(t.id))).forEach((e=>{var i,r,o,a,u,l;t[e.type]||(t[e.type]={all:{ids:[],options:[]},pending:{ids:[],options:[]},verified:{ids:[],options:[]}}),null===(i=t[e.type])||void 0===i||i.all.ids.push(e.id),null===(r=t[e.type])||void 0===r||r.all.options.push(e),e.status===n.Uv5.pending_verification?(null===(o=t[e.type])||void 0===o||o.pending.ids.push(e.id),null===(a=t[e.type])||void 0===a||a.pending.options.push(e)):(null===(u=t[e.type])||void 0===u||u.verified.ids.push(e.id),null===(l=t[e.type])||void 0===l||l.verified.options.push(e))})),t};function u(){const e=(0,r.F)(),[t,i]=(0,o.useState)(null),{data:u,loading:l}=(0,n.u2F)({context:{useFederatedGraph:!0},fetchPolicy:"cache-and-network",skip:!e,variables:{subjectId:e}});return(0,o.useEffect)((()=>{u&&i(a(u.subject.authenticationFactors))}),[u]),{factors:t,loading:l,subject:null==u?void 0:u.subject,subjectId:e}}},7570:function(e,t,i){i.r(t),i.d(t,{default:function(){return I},loginLinkProfileForAdmin:function(){return E}}),i(3362),i(62953);var n=i(91398),r=i(2843),o=i(13369),a=i(96540),u=i(71204),l=i(95420);function s(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function c(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?s(Object(i),!0).forEach((function(t){d(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):s(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function d(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}const m={},p=u.J1` 2 mutation loginLinkProfileForAdmin($input: LoginLinkProfileForAdminInput!) { 3 loginLinkProfileForAdmin(input: $input) { 4 planId 5 userId 6 } 7} 8 `;var h=i(21249),f=i(13739),v=i(58884),g=i(88836),b=i(18981),y=i(80856),w=i(21409);const E=u.J1` 9 mutation loginLinkProfileForAdmin($input: LoginLinkProfileForAdminInput!) { 10 loginLinkProfileForAdmin(input: $input) { 11 planId 12 userId 13 } 14 } 15`;var I=()=>{(0,h.A)();const[e]=(0,g.sq)(),{token:t,entityName:i}=e,{adminInvitationToken:u,entityName:s}=(0,a.useContext)(r.B).adminContext,{hideAppToast:d,showAppToast:E}=(0,f.useAppToast)(),I=(0,f.useErrorToast)({logPrefix:"Accept Invite"}),[k]=function(e){const t=c(c({},m),{context:{skipErrorHandling:!0}});return l.n(p,t)}(),{loading:A,subject:P}=(0,b.o)();if(A)return a.createElement(f.PageLoader,null);const N=null==P?void 0:P.login;return a.createElement("div",{className:"hui-padding-top-72"},a.createElement(o.A,{className:"hui-margin-top-16",type:o.f.Medium},a.createElement(n.HuiForm,{noValidate:!0,onSubmit:async()=>{d();try{var e;const i=await k({variables:{input:{token:u.current||t}}});window.location.href=`/admin/${null===(e=i.data)||void 0===e?void 0:e.loginLinkProfileForAdmin.planId}/dashboard`}catch(e){(0,w.RC)(e)?(0,g.oo)(y.Bo.Login,{query:{redirect:(0,v.buildRedirectOptions)({redirectUri:(0,v.getCurrentPathWithQueryParams)()})}}):(0,w.vc)(e)?E({level:"error",message:w.j1["USER HAS EXISTING ADMIN FOR THIS CUSTOMER ACCOUNT"]}):(0,w.dc)(e)?E({level:"error",message:w.j1.ADMIN_ALREADY_LINKED}):(0,w.q4)(e)?E({level:"error",message:w.j1.INVALID_INVITATION_CODE}):(0,w.e6)(e)?E({level:"error",message:w.j1["LINK HAS EXPIRED."]}):I({error:e,toastMessage:"Unable to accept the invitation. Please try again or c
15ontact support if the problem persists."})}}},a.createElement(n.HuiFormContext,null,(({formState:e})=>a.createElement(a.Fragment,null,a.createElement("h2",{className:"hui-subheader-sm hui-font-weight-700 hui-text-action-primary hui-margin-bottom-20 hui-word-break-break-all","data-testid":"link-header"},"Hi ",N,", you have been invited!"),a.createElement("div",{className:"hui-margin-top-12 hui-margin-top-24:md hui-text-compact"},a.createElement("p",{className:"hui-margin-bottom-24","data-testid":"link-p1"},a.createElement("span",{className:"hui-font-weight-bold"},s.current||i),a.createElement("span",null," has invited you to become an admin on their account.")),a.createElement("p",{className:"hui-margin-bottom-48"},"If you want to accept this invite, click the button below!"),a.createElement(n.HuiButton,{className:"hui-margin-bottom-24",isLoading:e.isSubmitting,size:"large",testId:"btn-link-admin",type:"submit",width:"full"},"Accept Invite"),a.createElement(n.HuiButton,{color:"primary",onClick:()=>{window.location.href="/"},size:"large",testId:"btn-cancel-link",variant:"outline",width:"full"},"Decline"))))))))}},21249:function(e,t,i){i(62953);var n=i(13739),r=i(2843),o=i(80856),a=i(88836),u=i(96540);t.A=()=>{const{showAppToast:e}=(0,n.useAppToast)(),{adminContext:t}=(0,u.useContext)(r.B),[i]=(0,a.sq)(),{invite:l,token:s}=i;(0,u.useEffect)((()=>{t.adminInvitationToken.current||s||l||(e({autoDismiss:!1,level:"warning",message:"Click the link in your invitation email to continue"}),(0,a.oo)(o.Bo.Login))}),[t])}}}]);
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.