PageSourceSearch

https://app.removify.com/assets/Select-DZk1q3z3.js

js removify.com collected 2026-10-06 03:47:53 UTC 5,925 bytes, 2 lines download raw bytes

1import{s as O}from"./sortBy-CoYfXQ6n.js";import{_ as x,q as m,b as n,o as s,F as d,m as r,f as h,g as y,v as b,h as p,D as z,t as g,e as c,i as D,E as w}from"./index-DXJP4K2g.js";import"./_baseOrderBy-C88zlNRI.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"50e60b9b5cae352c567880bcb17486a4d75e1c32"}}catch{}})();try{(function(){var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="a7dc982f-2ea8-4b51-9e3b-08297a247a2f",t._sentryDebugIdIdentifier="sentry-dbid-a7dc982f-2ea8-4b51-9e3b-08297a247a2f")})()}catch{}const S={name:"SubAccountSelect",props:{size:{type:String,default:""},fontColor:{type:String,default:"text-black"},organizationId:{type:String,default:""}},data(){return{search:"",isSearching:!1,loading:!1,adminOrganizations:[],timeout:null,alert:{enabled:!1,message:"",type:"warning"}}},computed:{organizations(){return this.$store.state.user&&this.$store.state.user.organizations?O(this.$store.state.user.organizations,"organization_name"):[]},selectedOrganization(){return this.$store.state.user&&this.$store.state.user.selectedOrganization},isAdmin(){return this.$store.getters["user/isAdmin"]},isDev(){return this.$store.getters["user/isDev"]},isDemoMode(){return this.$store.getters["user/isDemoMode"]}},watch:{organizationId:{immediate:!0,async handler(t){t&&(this.isAdmin||this.isDev)&&(await this.searchOrganization(t),this.adminOrganizations.length===1&&this.setOrganization(this.adminOrganizations[0]))}},search:{handler(t,e){t!==""&&e!==t&&(this.isSearching=!0,clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.searchOrganization(t.trim())},750))}}},methods:{async setOrganization(t){this.loading=!0,this.$store.dispatch("user/setupOrganization",t),this.loading=!1;const e=this.$route.query.redirect;let l="/";!Array.isArray(e)&&e!=null&&!e.startsWith("http")&&!e.startsWith("https")&&e.startsWith("/")&&(l=e),window.location.href=l},async exitDemoMode(){localStorage.removeItem("_demoname"),await this.$store.dispatch("user/updateDemoMode",{demo:this.$store.getters["user/getDemoOID"],demo_reset:!0})},async searchOrganization(t){this.alert.enabled=!1,this.loading=!0;try{const e=await w.rmvfy.searchOrganizations(t);if(e.status===200)this.adminOrganizations=e.data.data;else throw e}catch(e){this.alert.enabled=!0,e.response&&e.response.data&&e.response.status===400?this.alert.message=e.response.data:this.alert.message="We can not search for this organization at this time. Please try again later."}finally{this.isSearching=!1,this.loading=!1}},continueDemo(){window.location.href="/"}}},C={class:"relative"},A={key:1,class:"account-list"},I={class:"lh-1 mb-0 text-[0.875rem] font-bold"},E={key:2},T={class:"flex justify-end"},N={class:"lh-1 mb-0 text-[0.875rem] font-bold"},M={key:1,class:"flex items-center"};function B(t,e,l,V,i,o){const _=m("base-alert"),k=m("base-input"),v=m("badge"),u=m("base-button");return s(),n("div",{class:b({loading:i.loading})},[o.isAdmin||o.isDev?(s(),n(d,{key:0},[r("h2",{class:b(["h6 mb-4 font-bold",l.fontColor])}," Search Account Name ",2),i.alert.enabled?(s(),h(_,{key:0,type:i.alert.type,dismissible:""},{"dismiss-icon":p(()=>[r("button",{type:"button",class:"close","data-dismiss":"alert","aria-label":"Close",onClick:e[0]||(e[0]=a=>i.alert.enabled=!1)},[...e[2]||(e[2]=[r("span",{"aria-hidden":"true",class:"ri ri-close"},null,-1)])])]),default:p(()=>[(s(!0),n(d,null,z(i.alert.message,(a,f)=>(s(),n("span",{key:f,class:"alert-inner--text block"},g(a),1))),128))]),_:1},8,["type"])):y("",!0),r("div",C,[c(k,{modelValue:i.search,"onUpdate:modelValue":e[1]||(e[1]=a=>i.search=a),name:"search organizations",type:"text",placeholder:"e.g Removify",tag:"div"},null,8,["modelValue"]),i.adminOrganizations.length>0?(s(),h(v,{key:0,class:"results text-center text-[0.65rem] font-bold"},{default:p(()=>[D(g(i.adminOrganizations.length>=100?"100+":i.adminOrganizations.length)+" found ",1)]),_:1})):y("",!0)]),i.adminOrganizations.length>0?(s(),n("div",A,[(s(!0),n(d,null,z(i.adminOrganizations,a=>(s(),n("div",{key:a.id,class:"account admin mx-1 flex items-center justify-between py-2"},[r("p",I,g(a.organization_name),1),c(u,{type:"primary",outline:"",size:l.size,label:"Select",onClick:f=>o.setOrganization(a)},null,8,["size","onClick"])]))),128))])):i.search!==""&&!i.isSearching?(s(),n("div",E,[...e[3]||(e[3]=[r("p",{class:"my-2"}," No results founds. ",-1)])])):y("",!0)],64)):o.isDemoMode?(s(),n(d,{key:1},[e[4]||(e[4]=r("p",null," You are currently in demo mode. Please exit demo if you wish to 
1search accounts. ",-1)),r("div",T,[c(u,{type:"primary",outline:"",label:"Exit Demo",onClick:o.exitDemoMode},null,8,["onClick"]),c(u,{type:"primary",label:"Continue Demo",onClick:o.continueDemo},null,8,["onClick"])])],64)):o.organizations.length>0?(s(),n(d,{key:2},[r("h2",{class:b(["h6 font-bold",l.fontColor])}," Select Account ",2),(s(!0),n(d,null,z(o.organizations,a=>(s(),n("div",{key:a.id,class:"account mx-1 flex items-center justify-between py-2"},[r("p",N,g(a.organization_name),1),!o.selectedOrganization||o.selectedOrganization.organization_id!==a.organization_id?(s(),h(u,{key:0,type:"primary",outline:"",size:l.size,label:"Select",onClick:f=>o.setOrganization(a)},null,8,["size","onClick"])):(s(),n("div",M,[e[5]||(e[5]=r("i",{class:"ri ri-check mr-2"},null,-1)),c(u,{type:"primary",disabled:"",label:"Select"})]))]))),128))],64)):(s(),n(d,{key:3},[e[6]||(e[6]=r("p",null,"You currently do not have any accounts.",-1)),e[7]||(e[7]=r("p",null," Please contact support at [email protected] or try again later. We are sorry for any inconvenience. ",-1))],64))],2)}const R=x(S,[["render",B],["__scopeId","data-v-70a0f1c1"]]);export{R as default};
2//# sourceMappingURL=Select-DZk1q3z3.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.