PageSourceSearch

https://app.hightouch.com/assets/domain-list-0R5i0wsP.js

js hightouch.com collected 2026-10-01 07:47:40 UTC 7,179 bytes, 2 lines download raw bytes

1import{af as e,ao as I,aT as z,r as g,at as B,au as V,aC as P,b0 as $,aL as F,aN as U,ae as q}from"./vendor-BgWhiDrf.js";import{R as S,B as j,c4 as H,C as p,cr as E,cl as G,ej as Q,cn as X,co as Y,cp as J,T as w,sU as K,j4 as Z,sn as ee,MO as te,aX as _,dQ as ne,e3 as ae,b as oe,af as se,j as re,G as ie,ak as ce,y as me}from"./main-COyT_q74.js";import{u as le}from"./use-domains-6b95hjJp.js";import"./types-DyceCyeS.js";import{g as de}from"./eventSlugs-Ecn2EilC.js";import"./types-D1LGzhJp.js";import"./property-suggestions-B64YqAPy.js";import{E as ue}from"./event-volume-summary-display-CXBTTuJe.js";import{E as pe}from"./event-source-icon-stack-CfQ2yRBy.js";import{e as L}from"./utils-CqtH0mZs.js";import{L as xe}from"./last-updated-1y07vupx.js";import{a as he}from"./outlet-DH4kJCBK.js";import{W as ge}from"./wizard-drawer-oCH6MXGK.js";import{CREATE_DOMAIN_PERMISSION as je}from"./contracts-layout-D7QvgM5r.js";import"./bounded-range-fetch-CggGfMWc.js";import"./vendor-charts-34qQJjVh.js";import"./types-ypUuiJby.js";import"./slugify-DeybiAG_.js";import"./index-eYN535ij.js";import"./icon-stack-CO_vnZpk.js";import"./use-row-select-CvhHONfp.js";import"./add-component-button-DQOU2NYh.js";import"./add-to-domain-modal-BPtxMiCd.js";const ve=6,A=8,O=({count:t})=>e.jsx(j,{minW:A,textAlign:"right",display:"inline-block",children:e.jsx(w,{fontWeight:"medium",style:{fontVariantNumeric:"tabular-nums"},children:t})}),M=t=>{const n=t.type==="event"?t.eventSchemas??[]:t.eventComponents??[];if(t.count===0||n.length===0)return e.jsx(O,{count:t.count});const a=n.slice(0,ve);return e.jsxs(G,{isLazy:!0,trigger:"hover",placement:"bottom-start",children:[e.jsx(Q,{"aria-label":"View events",display:"inline-flex",minW:A,justifyContent:"flex-end",p:0,children:e.jsx(O,{count:t.count})}),e.jsx(X,{children:e.jsx(Y,{w:"xs",children:e.jsx(J,{p:2,children:e.jsxs(p,{gap:1,children:[e.jsx(j,{px:2,children:e.jsx(w,{color:"text.secondary",size:"sm",fontWeight:"medium",children:t.type==="event"?"Events":"Components"})}),a.map(o=>t.type==="event"?e.jsx(Ce,{eventName:o.event_name,eventType:o.event_type},`${o.event_type}:${o.event_name??""}:${o.event_version}`):e.jsx(ye,{componentName:o.name,componentVersion:o.version},`${o.name}:${o.version}`))]})})})})]})},Ce=({eventName:t,eventType:n})=>{const a=L[n]??L.track,o=t??I.capitalize(n);return e.jsxs(S,{align:"center",gap:3,px:2,py:2,children:[e.jsx(j,{flexShrink:0,children:e.jsx(a,{color:"text.secondary"})}),e.jsxs(p,{minW:0,children:[e.jsx(E,{fontWeight:"medium",children:o}),e.jsx(w,{color:"text.tertiary",size:"sm",children:I.capitalize(n)})]})]})},ye=({componentName:t,componentVersion:n})=>e.jsxs(S,{align:"center",gap:3,px:2,py:2,children:[e.jsx(j,{flexShrink:0,children:e.jsx(K,{color:"text.secondary"})}),e.jsxs(p,{minW:0,children:[e.jsx(E,{fontWeight:"medium",children:t}),e.jsx(w,{color:"text.tertiary",size:"sm",children:n})]})]}),fe=()=>[{name:"Name",cellSx:{minWidth:0,overflow:"hidden"},cell:({name:t,description:n})=>e.jsxs(S,{align:"center",gap:4,minWidth:0,w:"100%",children:[e.jsx(j,{flexShrink:0,children:e.jsx(H,{shape:"square",size:"lg",name:t})}),e.jsxs(p,{gap:1,minWidth:0,overflow:"hidden",children:[e.jsx(E,{fontWeight:"medium",children:t}),n?e.jsx(E,{color:"text.secondary",children:n}):null]})]})},{name:"Sources",max:"max-content",cell:({event_sources_plans:t})=>e.jsx(pe,{sources:t.map(({event_source:n})=>({id:n.id,name:n.name,type:n.type}))})},{name:"Events",max:"max-content",variant:"numeric",cell:({event_schemas:t,event_schemas_aggregate:n})=>{var a;return e.jsx(M,{type:"event",count:((a=n.aggregate)==null?void 0:a.count)??0,eventSchemas:t})}},{name:"Components",max:"max-content",variant:"numeric",cell:({event_components:t,event_components_aggregate:n})=>{var a;return e.jsx(M,{type:"component",count:((a=n.aggregate)==null?void 0:a.count)??0,eventComponents:t})}},{name:"24hr volume",max:"max-content",breakpoint:"sm",cell:({event_sources_plans:t})=>e.jsx(ue,{sourceIds:t.map(({event_source:n})=>n.id)})},{...xe,breakpoint:"md"}],Ee=async(t,n)=>{const a=de(n);return await t(Z.EventPlans,a)||z()},Se=()=>{const{getSlug:t}=ee(),n=te();return{createDomain:g.useCallback(async o=>{var m;const i=o.name.trim(),c=await Ee(t,{name:i}),l=(await n.mutateAsync({input:{name:i,slug:c,description:((m=o.description)==null?void 0:m.trim())||"",default_schema_version:"default"}})).createEventPlan;if(!l)throw new Error("You do not have permission to create a domain.");return l},[t,n]),isCreating:n.isLoading}},we=F().shape({name:U().required("This field is required")}),W="A domain with this name already exists",De=({isOpen:t,onClose:n,onSubmit:a,existingDomainNames:o})=>{const i=g.useMemo(()=>new Set(o.map(r=>r.trim().toLowerCase())),[o]),{control:c,watch:v,handleSubmit:l,formState:m,reset:D}=B({defaultValues:{name:"",description:""},resolver:V(we)}),x=v("name"),C=(x==null?void 0:x.trim())??"",y=C.length>0,d=y&&i.has(C.toLowerCase()),N=async r=>{i.has(r.name.trim().toLowerCase())||await a(r)};g.useEffect(()=>{t||D()},[t]);const b=[{label:"Name & description",continue:"Create domain",isDisabled:!y||d,tooltip:d?W:void 0,submit:l(N),render:()=>e.jsxs(p,{width:"100%",gap:4,children:[e.jsx(P,{name:"name",control:c,render:({field:r,fieldState:u})=>{var s;const f=d?W:(s=u.error)==null?void 0:s.message;return e.jsx(_,{label:"Name",error:f,children:e.jsx(ne,{...r,isInvalid:!!f,placeholder:"Enter a domain name",width:"100%"})})}}),e.jsx(P,{name:"description",control:c,render:({field:{ref:r,...u}})=>e.jsx(_,{label:"Description",isOptional:!0,children:e.jsx(ae,{...u,placeholder:"Enter a description…",width:"100%",value:u.value??""})})})]})}];return e.jsxs(e.Fragment,{children:[t&&e.jsx($,{children:e.jsx("title",{children:"New domain"})}),e.jsx(ge,{isOpen:!!t,title:"New domain",isDirty:m.isDirty,steps:b,size:"lg",onClose:n})]})},Ne=fe(),Ye=()=>{const{toast:t}=me(),n=oe(),{domains:a,isLoading:o,error:i}=le(),[c,v]=g.useState(""),[l,m]=q(),{selectedDomainIds:D,onDomainSelect:x}=he(),C=l.get("mode")==="create",y=()=>m({mode:"create"}),d=()=>m({}),{createDomain:N}=Se(),b=async s=>{try{await N(s),t({id:"create-domain",title:"Domain created",variant:"success"}),d()}catch(h){throw ce(h),t({id:"create-domain",title:"Failed to create domain",message:h.message,variant:"error"}),h}},r=c.trim(),u=g.useMemo(()=>{const s=r.toLowerCase();return s?a.filter(({name:h,description:R})=>[h,R].some(T=>T==null?void 0:T.toLowerCase().includes(s))):a},[a,r]),f=r?{...k,title:"No domains found",body:`No domains match "${r}".`}:{...k,button:e.jsx(ie,{permission:je,variant:"primary",onClick:y,children:"Add domain"})};return e.jsxs(e.Fragment,{children:[e.jsxs(p,{gap:4,children:[e.jsx(S,{px:6,pt:4,children:e.jsx(se,{placeholder:"Search",value:c,onChange:s=>v(s.target.value)})}),e.jsx(re,{columns:Ne,data:u,loading:o,error:!!i&&a.length===0,placeholder:f,selectedRows:D,onSelect:x,onRowClick:s=>{n(`/events/domains/${s.id}`)}})]}),e.jsx(De,{isOpen:C,onClose:d,onSubmit:b,existingDomainNames:a.map(({name:s})=>s)})]})},k={title:"No domains",body:"Create a domain to get started.",error:"Domains failed to load, please try again."};export{Ye as DomainList};
2//# sourceMappingURL=domain-list-0R5i0wsP.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.