PageSourceSearch

https://app.hightouch.com/assets/domain-Cg3SwR8w.js

js hightouch.com collected 2026-09-24 07:24:36 UTC 4,818 bytes, 2 lines download raw bytes

1import{af as e,bO as G,an as q,r}from"./vendor-B2oIjyY4.js";import{R as i,aI as K,BK as N,b as X,p as J,se as Q,BL as Y,BM as Z,_ as $,rO as ee,G as se,eH as te,w as ne,sc as ae,ca as ie,C as oe,c4 as D,f6 as re,l as ce,f8 as de,n as le,f9 as me,bR as ue,ob as pe,T as he,ad as xe,aj as P,b9 as ve,y as ge}from"./main-CJK8sxkW.js";import{u as je}from"./use-optimistic-value-ACNSQkFa.js";import{D as fe}from"./divider-jVHnrtnN.js";import{e as be}from"./types-WJ9Oe6Nf.js";import"./index-tMcD_ZuD.js";import{u as _e}from"./use-domain-eH8VJNuO.js";import"./types-3TI9bhGX.js";import"./property-suggestions-BI-lsJWT.js";import{A as Ce}from"./add-sources-dialog-DSHwzcdl.js";import{a as Ae,I as De}from"./icon-stack-Bc-6S09d.js";import{A as Pe}from"./add-component-button-Dto9SDJn.js";import"./bounded-range-fetch-CggGfMWc.js";import"./vendor-charts-BqgCVUWx.js";import"./types-ypUuiJby.js";import"./use-domain-attached-sources-DoE7VT40.js";import"./add-to-domain-modal-Bcu4Lke9.js";import"./use-domains-DiBI2RIt.js";const ye=3,Se=({sources:n})=>n.length===0?null:e.jsx(i,{as:K,to:{pathname:"sources"},display:"inline-flex","aria-label":"View sources",children:e.jsx(Ae,{items:n.map(o=>({id:o.id,renderIcon:()=>e.jsx(De,{size:"24px",children:e.jsx(N,{source:{definition:be[o.type]},sx:{}})})})),maxVisible:ye})}),y="/events/domains",c=n=>({v2:{resource:"event_plan",grant:"can_update",id:n}}),Ie=n=>n.endsWith("/sources")?"sources":n.endsWith("/permissions")?"permissions":n.endsWith("/components")?"components":"events",Ne=()=>{var g,j,f,b,_,C;const{toast:n}=ge(),o=G(),S=X(),{user:I}=J(),{eventsRbacEnabled:M}=q(),{contract:s}=Q(),E=Y(),O=Z(),B=$({v2:{resource:"event_plan",grant:"can_update",id:s.id}}),L=ee({eventsRbacEnabled:M,resource:s,user:I,permissions:B}),[k,m]=r.useState(!1),[w,u]=r.useState(!1),T=Ie(o.pathname),R={events:e.jsx(te,{permission:c(s.id),variant:"primary",href:"new_event",children:"Add event"}),sources:e.jsx(se,{permission:c(s.id),variant:"primary",onClick:()=>u(!0),children:"Add sources"}),permissions:null,components:e.jsx(Pe,{domainId:s.id})},{optimisticValue:d,setOptimisticValue:p,clearOptimisticValue:V}=je({name:s.name,description:s.description},s),{name:h,description:W}=d,z=r.useMemo(()=>({contract:s}),[s]),l=((g=s.updated_by_user)==null?void 0:g.name)??((j=s.created_by_user)==null?void 0:j.name),F=((f=s.event_schemas)==null?void 0:f.length)??0,{domain:a}=_e(s.id),U=((_=(b=a==null?void 0:a.event_components_aggregate)==null?void 0:b.aggregate)==null?void 0:_.count)??0,x=r.useMemo(()=>(a==null?void 0:a.event_sources_plans.map(({event_source:t})=>({id:t.id,type:t.type})))??[],[a==null?void 0:a.event_sources_plans]),v=async t=>
1{try{await E.mutateAsync({id:s.id,input:t}),ve("Event Plan Updated",{domain_id:s.id,domain_name:s.name}),n({id:"update-domain",title:"Domain updated",variant:"success"})}catch(A){P(A),V(),n({id:"update-domain",title:"Failed to update domain",message:A.message,variant:"error"})}},H=async()=>{try{await O.mutateAsync({id:s.id}),S(y)}catch(t){P(t),n({id:"delete-domain",title:"Failed to delete domain",message:t.message,variant:"error"})}};return e.jsxs(ne,{title:s.name,crumbs:[{label:"Contracts",link:y}],tabs:[{path:"",title:"Events",count:F,variant:"table"},{path:"components",title:"Components",count:U,variant:"table"},{path:"sources",title:"Sources",count:((C=s.event_sources_plans)==null?void 0:C.length)??0,variant:"table"},...L?[{path:"permissions",title:"Permissions",variant:"table"}]:[]],tabDepth:5,header:e.jsxs(oe,{flex:1,minWidth:0,gap:2,children:[e.jsxs(i,{flex:1,justify:"space-between",minWidth:0,pt:1,gap:4,children:[e.jsxs(i,{gap:2,align:"center",minWidth:0,children:[e.jsx(D,{name:h??void 0,shape:"square",size:"lg",hideTooltip:!0}),e.jsx(re,{permission:c(s.id),placeholder:"Add a name…",size:"lg",value:h??"",onChange:t=>{p({...d,name:t}),v({name:t})}})]}),e.jsxs(i,{align:"center",gap:2,flexShrink:0,children:[R[T],e.jsxs(ce,{children:[e.jsx(de,{variant:"secondary"}),e.jsx(le,{children:e.jsx(me,{permission:{v2:{resource:"event_plan",grant:"can_delete",id:s.id}},icon:ue,variant:"danger",onClick:()=>m(!0),children:"Delete"})})]})]})]}),e.jsx(i,{children:e.jsx(pe,{permission:c(s.id),value:W??"",onChange:t=>{p({...d,description:t}),v({description:t})}})}),e.jsxs(i,{align:"center",gap:3,children:[e.jsxs(i,{align:"center",gap:2,children:[e.jsxs(he,{color:"text.secondary",children:["Last updated:"," ",xe(s.updated_at??s.created_at)," ",l&&"by"]}),l&&e.jsx(D,{size:"sm",name:l})]}),x.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(fe,{direction:"vertical"}),e.jsx(Se,{sources:x})]})]})]}),children:[e.jsx(ae,{context:z}),e.jsx(Ce,{domainId:s.id,isOpen:w,onClose:()=>u(!1)}),e.jsx(ie,{isOpen:k,resourceLabel:"domain",onClose:()=>m(!1),onDelete:H})]})};export{Ne as DomainDetailLayout};
2//# sourceMappingURL=domain-Cg3SwR8w.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.