PageSourceSearch

https://convbox-testing.web.app/assets/add-new-tenant-f221a378.js

js convbox-testing.web.app collected 2026-10-03 12:21:34 UTC 4,759 bytes, 1 lines download raw bytes

1import{an as G,E as y,ao as Q,al as H,ap as K,aq as J,ar as X,as as g,i as N,at as Y,y as x,au as Z,e as v,av as M,aw as ee,ax as te,ay as se}from"./index-7bd8fc5a.js";import{C as ae}from"./convbox-guide-tween-btn-51c30b66.js";import{C as ne}from"./NetworkError-43d3e2e0.js";import{u as ie,a as oe,I as re}from"./AddTenant-4d854335.js";import{eC as z,eD as P,er as le,r as L,ed as _,em as f,ej as s}from"./vendor-ebbd0c14.js";import{F as l,I,d as ce,m as me}from"./antd-vendor-1ef10a0e.js";import{u as pe}from"./i18Next-5334b98f.js";import{s as ue}from"./lodash-f8e83f2f.js";import"./sentry-faa7788c.js";import"./reactQuery-7b96d7b3.js";import"./shopifyPolar-9d472cf6.js";import"./axios-14031435.js";import"./__commonjsHelpers__-042e6b4d.js";function Se(){const[c]=l.useForm(),O=l.useWatch("name",c),q=l.useWatch("url",c),m=z(),{confirmTenantInstallMutate:C}=ie(),a=P.parse(window.location.search,{ignoreQueryPrefix:!0}),S=a.newState,{tenantsResult:b,isLoading:de}=oe({state:S}),E=G(),o=P.parse(window.location.search,{ignoreQueryPrefix:!0})?.scene===y.independent,T=P.parse(window.location.search,{ignoreQueryPrefix:!0})?.userId,k=Q(a.shopName),R=a.shop?decodeURIComponent(a.shop):void 0,r=le(),p=z(!1),u=H()||b?.installPlatName===y.shopline||a.platform===y.shopline,{t}=pe(),A=L.useMemo(()=>K(b?.installShopName||a.shopName||void 0),[b?.installShopName,a.shopName]),$=_(async(n,e)=>{if(e)try{p[1].setTrue(),await Promise.all([g.dispatch(N.fetchLoginUserInfoSingle()),g.dispatch(N.getOperatorInfo())]);const[i,d]=await Promise.all([g.dispatch(N.changeWebsiteSilence(e)),Y(e)]),h=i.payload,W=a.installAppName,j=W===x().APP_NAME,D=W===x().TRACKING_APP_NAME,V=Z(h),w=!!h.billingCharge?.productCharges?.length;if(p[1].setFalse(),w&&!V&&j){r(`/website/${e}/beginning/choose-plan?product=${v.convboxAnalysis}`);return}if(!w&&D){r(`/website/${e}/beginning/choose-plan?product=${v.omnitrackTracking}`);return}if(!w&&j){r(`/website/${e}/beginning/choose-plan?product=${v.convboxAnalysis}`);return}r(n)}catch(i){p[1].setFalse(),console.log("error",i)}}),U=_(async n=>{const{token:e}=n;M.setToken(e);const i=await ee();if(m[1].setFalse(),!ue(i))r("/subscription/select-product"),M.removeToken();else{await g.dispatch(te.actions.setWebsites(i));const d=i.at(-1)?.websiteName,h=u?se(a.shopName||d):a.shopName||d;$(`/website/${d}/welcome`,h)}}),B=_(async()=>{try{await c.validateFields();const n=c.getFieldsValue();try{if(m[1].setTrue(),o){if(!T){me.error(t("please_login_first","Please login first")),r("/login");return}const i=await E.mutateAsync({rtoUserId:Number(T),shopDomain:n.url,createTenantName:n.name,appName:x().CUSTOM_WEB_APP_NAME});await U({token:i.token});return}const e=await C.mutateAsync({state:S,createTenantName:n.name});e.token?await U({token:e.token}):r("/login")}catch(e){console.log("e",e),m[1].setFalse()}}catch(n){console.log("submit error",n)}}),F=L.useMemo(()=>J.getBindShopUrl(),[]);return console.log("webSiteInitialName",F),f(ne.MainWithContainer,{width:1e3,children:[s(ce,{className:"mt-10 min-h-[400px]",styles:{body:{padding:"32px 22px 32px 32px"}},children:f("div",{className:"flex justify-between items-start gap-7",children:[f("div",{className:"flex-1",children:[s("div",{className:"text-xl font-bold mb-3",children:t("create_organization","Create Organization")}),s("div",{className:"mt-10",children:f(l,{form:c,layout:"vertical",children:[s(l.Item,{label:t("organization_name","Organization Name"),name:"name",initialValue:F,rules:[{required:!0,message:t("please_input_organization_name","Please input organization name")}],children:s(I,{placeholder:t("please_input_organization_name","Please Input Organization Name"),style:{width:300},allowClear:!0,maxLength:60,showCount:!0})}),s(l.Item,{label:t("website_url","Website URL"),style:{opacity:o?1:0},name:"url",initialValue:(o?R:k)||void 0,rules:[{required:!!o,message:t("website_url_is_required","Website URL is required")},{validator(n,e,i){return o?e?o?X.test(e)?Promise.resolve():Promise.reject(t("please_input_valid_website_url","Please input valid website url")):Promise.resolve():Promise.reject(t("please_input_website_url","Please input website url")):Promise.resolve()}}],children:o?s(I,{type:"url",placeholder:t("your_store_url","your store url")}):s(I,{type:"hidden",disabled:!!k,prefix:"https://",suffix:u?".myshopline.com":".mysh
1opify.com",placeholder:t("your_store_name","your store name")})})]})})]}),s("img",{className:"flex-shrink-0",style:{width:260},src:re,alt:""})]})}),s("div",{className:"mt-[30px] flex justify-start",children:s("div",{className:"inline-block",children:s(ae,{loading:C.isLoading||m[0]||p[0],forbitAnimate:!0,disabled:!O||!q&&o||u&&!A,onClick:B,text:u&&!A?t("not_supported","Not Supported"):t("confirm","Confirm")})})})]})}export{Se 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.