PageSourceSearch

https://delivr.to/assets/QuickSendModal-fc8TmXFK.js

js delivr.to collected 2026-09-25 19:12:04 UTC 41,187 bytes, 2 lines download raw bytes

1import{c as W,_ as A,ap as Je,p as ye,aq as He,H as Z,a4 as Ae,ar as et,B as T,J as te,U as ae,u as tt,ae as at,D as st,d as rt,e as nt,f as it,Z as ge,g as lt,T as _e,m as Ce,n as De,o as Pe,b as We,h as ot,l as ct}from"./index-CT7kTiav.js";import{a as dt,b as ut,j as t}from"./query-DmstuUoN.js";import{h as pt,d as $,a as w}from"./vendor-CHI41uxr.js";import{B as Te}from"./badge-CIRiQWe_.js";import{C as ve}from"./checkbox-CcaDavml.js";import{S as pe,L as mt}from"./switch-Toae-IaB.js";import{L as J,T as ht,a as ft,b as Ee}from"./tabs-CLdUJLBs.js";import{T as Le}from"./trending-up-BJitD4Ir.js";import{e as xt,m as yt,B as gt,a4 as vt,h as me,f as ie,C as bt,q as jt,t as ee,u as wt,n as be,a5 as kt,w as Nt,o as Ge,x as St,y as At,a6 as Oe,W as _t,X as je,Y as we,_ as Ct,G as X,D as Dt,R as Pt,T as $e,L as Ie,A as Tt,a as Et}from"./AreaChart-BbjuXgQC.js";import{C as Lt,S as Ot,a as $t,b as It,c as Mt,d as Ft}from"./select-rx-Gp2-j.js";import{M as Ke}from"./mail-D42Ko5db.js";import{A as he}from"./alert-circle-Bk1rTHL-.js";import{L as zt}from"./loader-2-DBtHWqj4.js";const Da=W("Crosshair",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]);const Pa=W("FileCode",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["path",{d:"m10 13-2 2 2 2",key:"17smn8"}],["path",{d:"m14 17 2-2-2-2",key:"14mezr"}]]);const Ta=W("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const Rt=W("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);const Bt=W("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);const Ut=W("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);const Vt=W("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);const Ea=W("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);function La(e){const s=["groups","file_types","software","techniques"],a={groups:{},file_types:{},software:{},techniques:{}};for(const r of e){for(const i of s){const o=r[i];if(Array.isArray(o))for(const l of o)l&&(a[i][l]=(a[i][l]||0)+1)}r.extension&&!r.file_types?.includes(r.extension)&&(a.file_types[r.extension]=(a.file_types[r.extension]||0)+1)}return a}const Me=50,Oa={list:e=>{const s=e?{...e,metrics_history:e.metrics_history?"true":void 0}:void 0;return A.get("/payload",{params:s}).then(a=>a.data??[])},get:(e,s)=>{const a=s?.metrics_history?{metrics_history:"true"}:void 0;return A.get(`/payload/${e}`,{params:a}).then(r=>r.data)},getBatch:async(e,s)=>{if(e.length===0)return{};const a=[];for(let o=0;o<e.length;o+=Me)a.push(e.slice(o,o+Me));const r=await Promise.all(a.map(o=>{const l={recipe_ids:o.join(",")};return s?.metrics_history&&(l.metrics_history="true"),A.get("/payload",{params:l}).then(c=>c.data??[])})),i={};for(const o of r)for(const l of o)l.recipe_id&&(i[l.recipe_id]=l);return i},getLatest:async(e=5,s=!1)=>(await A.get("/payload",{params:{latest:"true",limit:String(e),custom:s?"true":"false"}})).data??[],getCustom:async()=>
1(await A.get("/payload",{params:{custom:"true"}})).data??[],download:async e=>{const s=await Je.get(`/downloads/${e}`,{responseType:"blob"});if(s.headers["content-type"]?.includes("application/json")){const o=await s.data.text(),l=JSON.parse(o);return{type:"redirect",url:l.download_url,filename:l.filename}}const i=s.headers["content-disposition"]?.split("filename=")[1]?.replace(/"/g,"")||"download.zip";return{type:"blob",blob:s.data,filename:i}},getTechniques:()=>A.get("/intel/technique").then(e=>e.data??[]),getGroups:()=>A.get("/intel/group").then(e=>e.data??[]),getSoftware:()=>A.get("/intel/software").then(e=>e.data??[]),getUploadUrl:(e,s)=>A.post("/payload/upload-url",{filename:e,filesize:s}).then(a=>a.data),uploadToS3:async(e,s,a)=>{const r=new FormData;Object.entries(s).forEach(([o,l])=>{r.append(o,l)}),r.append("file",a);const i=await fetch(e,{method:"POST",body:r});if(!i.ok)throw new Error(`S3 upload failed: ${i.status}`)},confirmUpload:e=>A.post("/payload/confirm-upload",e).then(s=>s.data),delete:e=>A.delete(`/payload/${e}`),addCustomPayload:e=>{const s=new FormData;return s.append("content",e.content),s.append("filename",e.filename),e.description&&s.append("description",e.description),e.tags&&s.append("tags",e.tags),e.references&&s.append("references",e.references),e.delivery&&s.append("delivery",e.delivery),A.post("/payload",s,{headers:{"Content-Type":"multipart/form-data"}}).then(a=>a.data)},update:(e,s)=>{const a=new FormData;return s.filename&&a.append("filename",s.filename),s.description&&a.append("description",s.description),s.tags&&a.append("tags",s.tags),s.references&&a.append("references",s.references),A.put(`/payload/${e}`,a,{headers:{"Content-Type":"multipart/form-data"}})}},$a={get:e=>ye.get(`/payloads/${e}`).then(s=>s.data),list:()=>ye.get("/payloads").then(e=>e.data??[])},le={list:()=>A.get("/templates").then(e=>e.data),get:e=>A.get(`/templates/${e}`).then(s=>s.data),getPayloads:e=>A.get(`/templates/${e}/payloads`).then(s=>s.data),create:e=>A.post("/templates",e).then(s=>s.data),update:(e,s)=>A.put(`/templates/${e}`,s).then(a=>a.data),delete:e=>A.delete(`/templates/${e}`)},Ia={list:()=>ye.get("/public/templates").then(e=>e.data)},Ye="Quick Send Payloads",Qt="/images/quicksend.png",Wt="All Payloads",Gt="A collection of all the payloads you've tested with Quick Send, in one place for analysis and review.";function Kt(e){return e.startsWith(Ye)}function ke(e){return`${Ye} - ${e}`}function Ma(e){return Kt(e.template_name)?Qt:e.image_url??void 0}function Yt(e,s){return e.find(a=>a.template_name.toLowerCase()===s.toLowerCase())}function qt(e,s){const a=ke(s).toLowerCase();return e.find(r=>r.template_name.toLowerCase()===a&&r.ownership==="user")}const Xt={send:async e=>{const s=`Quick Send - ${e.payload_name}`,a=await le.list();let r,i=!1,o;if(e.isEnterprise){const c=ke(e.userEmail);let u=qt(a,e.userEmail);if(!u)r=(await le.create({name:c,description:Gt,recipe_ids:[e.recipe_id]})).id,i=!0,o=e.payload_id;else{r=u.template_id;const d=await le.getPayloads(r),g=d.find(p=>p.recipe_id===e.recipe_id);if(!g){const p=d.map(x=>x.recipe_id);await le.update(r,{name:c,recipe_ids:[...p,e.recipe_id]})}o=g?.id??e.payload_id}}else{const c=Yt(a,Wt);if(!c)throw new Error('Could not find "All Payloads" template. Please contact support.');r=c.template_id,o=e.payload_id}return{campaign_id:(await He.scheduleCampaign({campaign_type:e.campaign_type,template_id:r,campaign_name:s,...e.recipient&&{recipient:e.recipient},selected_payloads:[{id:o,delivery:e.delivery}]})).campaign_id,createdTemplate:i,templateName:i?ke(e.userEmail):void 0,campaign_type:e.campaign_type}}};function Zt(){const e=dt(),s=pt();return ut({mutationFn:a=>Xt.send(a),onSuccess:a=>{e.invalidateQueries({queryKey:["campaigns"]}),e.invalidateQueries({queryKey:["templates"]}),e.invalidateQueries({queryKey:["template"]}),a.createdTemplate&&a.templateName&&Z.success(`Created your '${a.templateName}' template - all payloads you quick send will be collected here for easy review and analysis.`,{duration:6e3});const r=a.campaign_type==="web";Z.success(r?"Web campaign created!":"Payload sent!",{action:{label:"View Campaign",onClick:()=>{s(`/app/campaign-results?campaign=${a.campaign_id}`)}},duration:5e3})},onError:a=>{const r=a.message||"Failed to send payload";Z.error(`Quick send failed: ${r}`)}})}var Jt=["type","layout","connectNulls","ref"],Ht=["key"];function H(e){"@babel/helpers - typeof";return H=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},H(e)}function Fe(e,s){if(e==null)return{};var a=ea(e,s),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(s.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function ea(e,s){if(e==null)return{};var a={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(s.indexOf(r)>=0)continue;a[r]=e[r]}return a}function se(){return se=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var a=arguments[s];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},se.apply(this,arguments)}function ze(e,s){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);s&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),a.push.apply(a,r)}return a}function F(e){for(var s=1;s<arguments.length;s++){var a=arguments[s]!=null?arguments[s]:{};
vendor: 9,483 bytes, lines 1-2
1s%2?ze(Object(a),!0).forEach(function(r){B(e,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):ze(Object(a)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(a,r))})}return e}function q(e){return ra(e)||sa(e)||aa(e)||ta()}function ta(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aa(e,s){if(e){if(typeof e=="string")return Ne(e,s);var a=Object.prototype.toString.call(e).slice(8,-1);if(a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set")return Array.from(e);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return Ne(e,s)}}function sa(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ra(e){if(Array.isArray(e))return Ne(e)}function Ne(e,s){(s==null||s>e.length)&&(s=e.length);for(var a=0,r=new Array(s);a<s;a++)r[a]=e[a];return r}function na(e,s){if(!(e instanceof s))throw new TypeError("Cannot call a class as a function")}function Re(e,s){for(var a=0;a<s.length;a++){var r=s[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Xe(r.key),r)}}function ia(e,s,a){return s&&Re(e.prototype,s),a&&Re(e,a),Object.defineProperty(e,"prototype",{writable:!1}),e}function la(e,s,a){return s=ce(s),oa(e,qe()?Reflect.construct(s,a||[],ce(e).constructor):s.apply(e,a))}function oa(e,s){if(s&&(H(s)==="object"||typeof s=="function"))return s;if(s!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ca(e)}function ca(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qe=function(){return!!e})()}function ce(e){return ce=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},ce(e)}function da(e,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(s&&s.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),s&&Se(e,s)}function Se(e,s){return Se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Se(e,s)}function B(e,s,a){return s=Xe(s),s in e?Object.defineProperty(e,s,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[s]=a,e}function Xe(e){var s=ua(e,"string");return H(s)=="symbol"?s:s+""}function ua(e,s){if(H(e)!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var r=a.call(e,s);if(H(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var re=(function(e){function s(){var a;na(this,s);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return a=la(this,s,[].concat(i)),B(a,"state",{isAnimationFinished:!0,totalLength:0}),B(a,"generateSimpleStrokeDasharray",function(l,c){return"".concat(c,"px ").concat(l-c,"px")}),B(a,"getStrokeDasharray",function(l,c,u){var d=u.reduce(function(_,I){return _+I});if(!d)return a.generateSimpleStrokeDasharray(c,l);for(var g=Math.floor(l/d),p=l%d,x=c-l,y=[],f=0,v=0;f<u.length;v+=u[f],++f)if(v+u[f]>p){y=[].concat(q(u.slice(0,f)),[p-v]);break}var D=y.length%2===0?[0,x]:[x];return[].concat(q(s.repeat(u,g)),q(y),D).map(function(_){return"".concat(_,"px")}).join(", ")}),B(a,"id",St("recharts-line-")),B(a,"pathRef",function(l){a.mainCurve=l}),B(a,"handleAnimationEnd",function(){a.setState({isAnimationFinished:!0}),a.props.onAnimationEnd&&a.props.onAnimationEnd()}),B(a,"handleAnimationStart",function(){a.setState({isAnimationFinished:!1}),a.props.onAnimationStart&&a.props.onAnimationStart()}),a}return da(s,e),ia(s,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,l=o.points,c=o.xAxis,u=o.yAxis,d=o.layout,g=o.children,p=gt(g,vt);if(!p)return null;var x=function(v,D){return{x:v.x,y:v.y,value:v.value,errorVal:Ge(v.payload,D)}},y={clipPath:r?"url(#clipPath-".concat(i,")"):null};return $.createElement(me,y,p.map(function(f){return $.cloneElement(f,{key:"bar-".concat(f.props.dataKey),data:l,xAxis:c,yAxis:u,layout:d,dataPointFormatter:x})}))}},{key:"renderDots",value:function(r,i,o){var l=this.props.isAnimationActive;if(l&&!this.state.isAnimationFinished)return null;var c=this.props,u=c.dot,d=c.points,g=c.dataKey,p=ie(this.props,!1),x=ie(u,!0),y=d.map(function(v,D){var _=F(F(F({key:"dot-".concat(D),r:3},p),x),{},{index:D,cx:v.x,cy:v.y,value:v.value,dataKey:g,payload:v.payload,points:d});return s.renderDotItem(u,_)}),f={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return $.createElement(me,se({className:"recharts-line-dots",key:"dots"},f),y)}},{key:"renderCurveStatically",value:function(r,i,o,l){var c=this.props,u=c.type,d=c.layout,g=c.connectNulls;c.ref;var p=Fe(c,Jt),x=F(F(F({},ie(p,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(o,")"):null,points:r},l),{},{type:u,layout:d,connectNulls:g});return $.createElement(bt,se({},x,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var o=this,l=this.props,c=l.points,u=l.strokeDasharray,d=l.isAnimationActive,g=l.animationBegin,p=l.animationDuration,x=l.animationEasing,y=l.animationId,f=l.animateNewValues,v=l.width,D=l.height,_=this.state,I=_.prevPoints,z=_.totalLength;return $.createElement(jt,{begin:g,duration:p,isActive:d,easing:x,from:{t:0},to:{t:1},key:"line-".concat(y),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(U){var m=U.t;if(I){var N=I.length/c.length,S=c.map(function(P,L){var K=Math.floor(L*N);if(I[K]){var V=I[K],n=ee(V.x,P.x),j=ee(V.y,P.y);return F(F({},P),{},{x:n(m),y:j(m)})}if(f){var h=ee(v*2,P.x),O=ee(D/2,P.y);return F(F({},P),{},{x:h(m),y:O(m)})}return F(F({},P),{},{x:P.x,y:P.y})});return o.renderCurveStatically(S,r,i)}var b=ee(0,z),k=b(m),E;if(u){var G="".concat(u).split(/[,\s]+/gim).map(function(P){return parseFloat(P)});E=o.getStrokeDasharray(k,z,G)}else E=o.generateSimpleStrokeDasharray(z,k);return o.renderCurveStatically(c,r,i,{strokeDasharray:E})})}},{key:"renderCurve",value:function(r,i){var o=this.props,l=o.points,c=o.isAnimationActive,u=this.state,d=u.prevPoints,g=u.totalLength;return c&&l&&l.length&&(!d&&g>0||!wt(d,l))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(l,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,l=i.dot,c=i.points,u=i.className,d=i.xAxis,g=i.yAxis,p=i.top,x=i.left,y=i.width,f=i.height,v=i.isAnimationActive,D=i.id;if(o||!c||!c.length)return null;var _=this.state.isAnimationFinished,I=c.length===1,z=Ae("recharts-line",u),U=d&&d.allowDataOverflow,m=g&&g.allowDataOverflow,N=U||m,S=be(D)?this.id:D,b=(r=ie(l,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},k=b.r,E=k===void 0?3:k,G=b.strokeWidth,P=G===void 0?2:G,L=kt(l)?l:{},K=L.clipDot,V=K===void 0?!0:K,n=E*2+P;return $.createElement(me,{className:z},U||m?$.createElement("defs",null,$.createElement("clipPath",{id:"clipPath-".concat(S)},$.createElement("rect",{x:U?x:x-y/2,y:m?p:p-f/2,width:U?y:y*2,height:m?f:f*2})),!V&&$.createElement("clipPath",{id:"clipPath-dots-".concat(S)},$.createElement("rect",{x:x-n/2,y:p-n/2,width:y+n,height:f+n}))):null,!I&&this.renderCurve(N,S),this.renderErrorBar(N,S),(I||l)&&this.renderDots(N,V,S),(!v||_)&&Nt.renderCallByParent(this.props,c))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,i){for(var o=r.length%2!==0?[].concat(q(r),[0]):r,l=[],c=0;c<i;++c)l=[].concat(q(l),q(o));return l}},{key:"renderDotItem",value:function(r,i){var o;if($.isValidElement(r))o=$.cloneElement(r,i);else if(xt(r))o=r(i);else{var l=i.key,c=Fe(i,Ht),u=Ae("recharts-line-dot",typeof r!="boolean"?r.className:"");o=$.createElement(yt,se({key:l},c,{className:u}))}return o}}])})(w.PureComponent);B(re,"displayName","Line");B(re,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!At.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});B(re,"getComposedData",function(e){var s=e.props,a=e.xAxis,r=e.yAxis,i=e.xAxisTicks,o=e.yAxisTicks,l=e.dataKey,c=e.bandSize,u=e.displayedData,d=e.offset,g=s.layout,p=u.map(function(x,y){var f=Ge(x,l);return g==="horizontal"?{x:Oe({axis:a,ticks:i,bandSize:c,entry:x,index:y}),y:be(f)?null:r.scale(f),value:f,payload:x}:{x:be(f)?null:a.scale(f),y:Oe({axis:r,ticks:o,bandSize:c,entry:x,index:y}),value:f,payload:x}});return F({points:p,layout:g},d)});
2var pa=_t({chartName:"LineChart",GraphicalChild:re,axisComponents:[{axisType:"xAxis",AxisComp:je},{axisType:"yAxis",AxisComp:we}],formatAxisMap:Ct});const Be="hsl(var(--chart-purple))",Ue=["hsl(var(--primary))","#06b6d4","#3b82f6","#0ea5e9"],Ve=["hsl(var(--success))","#22c55e","#10b981","#14b8a6","#84cc16"];function oe(e){return"global"in e&&typeof e.global=="object"}function fe(e){return Array.isArray(e)&&e.length>0&&Array.isArray(e[0])&&e[0].length===2}function Ze(e){const s=e.getDate().toString().padStart(2,"0"),a=(e.getMonth()+1).toString().padStart(2,"0"),r=e.getFullYear();return`${s}/${a}/${r}`}function ma(e){return Ze(new Date(e*1e3))}function Qe(e){return e?Object.keys(e).filter(s=>s!=="average"):[]}function Fa({metricsHistory:e,userEmail:s,compact:a=!1,title:r,globalOnly:i=!1,expandable:o=!0,onExpandChange:l,isFullWidth:c=!1}){const u=w.useRef(null),[d,g]=w.useState("global"),[p,x]=w.useState(!1),[y,f]=w.useState(new Set(["global"])),[v,D]=w.useState(!0),[_,I]=w.useState(!0),[z,U]=w.useState(!0),m=w.useCallback(async()=>{if(u.current)try{const{downloadChartAsPng:n,getDateString:j}=await et(async()=>{const{downloadChartAsPng:de,getDateString:C}=await import("./download-Cy4RHPTg.js");return{downloadChartAsPng:de,getDateString:C}},[]),h=`deliverability-chart-${j()}.png`;await n(u,h)?Z.success("Chart saved as image"):Z.error("Could not find chart to export")}catch(n){console.error("Failed to save chart:",n),Z.error("Failed to save chart as image")}},[]),N=w.useMemo(()=>!e||!oe(e)?!1:!!e.user&&Object.keys(e.user).length>0,[e]),S=w.useMemo(()=>!e||!oe(e)?!1:!!e.team&&Object.keys(e.team).length>0,[e]),b=w.useMemo(()=>{if(!e||!oe(e))return[{key:"global",label:"Global Average",color:Be,enabled:!0,category:"global"}];const n=[{key:"global",label:"Global Average",color:Be,enabled:!0,category:"global"}];return e.user&&Qe(e.user).forEach((h,O)=>{n.push({key:`user:${h}`,label:h===s?`${h} (You)`:h,color:Ue[O%Ue.length],enabled:!1,category:"user"})}),e.team&&Qe(e.team).forEach((h,O)=>{n.push({key:`team:${h}`,label:h===s?`${h} (You)`:h,color:Ve[O%Ve.length],enabled:!1,category:"team"})}),n},[e,s]),k=w.useMemo(()=>d==="overlay"&&p?b.filter(n=>n.category==="global"&&v||n.category==="user"&&_||n.category==="team"&&z?y.has(n.key):!1):d==="global"||i?b.filter(n=>n.key==="global"):d==="user"?b.filter(n=>n.category==="user"&&y.has(n.key)):d==="team"?b.filter(n=>n.category==="team"&&y.has(n.key)):b.filter(n=>n.key==="global"),[d,b,y,i,p,v,_,z]),{chartData:E,latestDelivered:G}=w.useMemo(()=>{if(!e)return{chartData:[],latestDelivered:null};if(!oe(e)){if(!e.delivered||!Array.isArray(e.delivered))return{chartData:[],latestDelivered:null};const C=e.delivered,R=new Date;return{chartData:C.map((Y,Q)=>{const ue=C.length-1-Q,ne=new Date(R);return ne.setDate(ne.getDate()-ue),{date:Ze(ne),epoch:Math.floor(ne.getTime()/1e3),global:Y}}),latestDelivered:C[C.length-1]??null}}const n=new Set;for(const C of k){let R;if(C.key==="global")R=e.global.delivered;else if(C.key.startsWith("user:")){const M=C.key.replace("user:","");R=e.user?.[M]?.delivered}else if(C.key.startsWith("team:")){const M=C.key.replace("team:","");R=e.team?.[M]?.delivered}fe(R)&&R.forEach(([M])=>n.add(M))}const h=[...n].sort((C,R)=>C-R).map(C=>{const R={date:ma(C),epoch:C};for(const M of k){let Y;if(M.key==="global")Y=e.global.delivered;else if(M.key.startsWith("user:")){const Q=M.key.replace("user:","");Y=e.user?.[Q]?.delivered}else if(M.key.startsWith("team:")){const Q=M.key.replace("team:","");Y=e.team?.[Q]?.delivered}if(fe(Y)){const Q=Y.find(([ue])=>ue===C);Q&&(R[M.key]=Q[1])}}return R}),O=e.global.delivered,de=fe(O)?O[O.length-1]?.[1]:null;return{chartData:h,latestDelivered:de}},[e,k]),P=n=>{f(j=>{const h=new Set(j);return h.has(n)?h.delete(n):h.add(n),h.size===0&&h.add("global"),h})},L=n=>{if(n==="overlay"&&d!=="overlay")f(new Set(["global"]));else if(n==="user"&&d!=="user"){const j=b.filter(h=>h.category==="user");j.length>0&&f(new Set([j[0].key]))}else if(n==="team"&&d!=="team"){const j=b.filter(h=>h.category==="team");j.length>0&&f(new Set([j[0].key]))}g(n)};if(E.length===0)return t.jsxs("div",{className:`space-y-3 ${a?"p-2":"p-4"} bg-muted/10 rounded-lg border`,children:[t.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Le,{className:`${a?"h-3 w-3":"h-4 w-4"} text-chart-purple`}),t.jsx("span",{className:`${a?"text-xs":"text-sm"} font-medium`,children:r||"Deliverability"})]}),!i&&t.jsxs("div",{className:"flex items-center gap-1 bg-muted/50 rounded-md p-0.5",children:[t.jsxs(T,{variant:d==="global"?"secondary":"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>L("global"),children:[t.jsx(X,{className:"h-3 w-3 mr-1"}),"Global"]}),t.jsxs(T,{variant:d==="user"?"secondary":"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>L("user"),disabled:!N,title:N?"Your deliverability":"No personal data yet",children:[t.jsx(te,{className:"h-3 w-3 mr-1"}),"You"]}),t.jsxs(T,{variant:d==="team"?"secondary":"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>L("team"),disabled:!S,title:S?"Team deliverability":"No team data available",children:[t.jsx(ae,{className:"h-3 w-3 mr-1"}),"Team"]})]})]}),t.jsx("div",{className:"flex items-center justify-center h-20 bg-muted/20 rounded-lg border border-dashed",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No data for this view yet"})})]});const K=d==="global"?"Global":d==="user"?"Your":d==="team"?"Team":"Overlay",V=o&&!i&&!a;return t.jsxs("div",{ref:u,className:`relative space-y-3 ${a?"p-2":"p-4"} bg-muted/10 rounded-lg border`,children:[V&&!c&&l&&t.jsx(T,{variant:"ghost",size:"sm",className:"absolute top-2 right-2 h-6 w-6 p-0",onClick:()=>l(!0),title:"Expand chart",children:t.jsx(Rt,{className:"h-4 w-4"})}),t.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Le,{className:`${a?"h-3 w-3":"h-4 w-4"} text-chart-purple`}),t.jsx("span",{className:`${a?"text-xs":"text-sm"} font-medium`,children:r||`${K} Deliverability`})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[p&&t.jsx(T,{variant:"ghost",size:"sm",className:"h-6 px-2",onClick:m,title:"Save chart as image",children:t.jsx(Dt,{className:"h-4 w-4"})}),!p&&!i&&t.jsxs("div",{className:"flex items-center gap-1 bg-muted/50 rounded-md p-0.5",children:[t.jsxs(T,{variant:d==="global"?"secondary":"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>L("global"),children:[t.jsx(X,{className:"h-3 w-3 mr-1"}),"Global"]}),t.jsxs(T,{variant:d==="user"?"secondary":"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>L("user"),disabled:!N,title:N?"Your deliverability":"No personal data yet",children:[t.jsx(te,{className:"h-3 w-3 mr-1"}),"You"]}),t.jsxs(T,{variant:d==="team"?"secondary":"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>L("team"),disabled:!S,title:S?"Team deliverability":"No team data available",children:[t.jsx(ae,{className:"h-3 w-3 mr-1"}),"Team"]})]}),G!==null&&t.jsxs("span",{className:`${a?"text-sm":"text-lg"} font-bold text-chart-purple`,children:[G.toFixed(0),"%"]}),V&&(c||!l)&&t.jsx(T,{variant:"ghost",size:"sm",className:"h-6 px-2",onClick:()=>{x(!p)},title:p?"Hide options":"Customise chart",children:p?t.jsx(Lt,{className:"h-4 w-4"}):t.jsx(Vt,{className:"h-4 w-4"})}),c&&t.jsx(T,{variant:"ghost",size:"sm",className:"h-6 px-2",onClick:()=>{x(!1),l?.(!1)},title:"Collapse chart",children:t.jsx(Bt,{className:"h-4 w-4"})})]})]}),t.jsx("div",{className:`${a?"h-20":p?"h-48":"h-28"} w-full`,children:t.jsx(Pt,{width:"100%",height:"100%",children:d==="overlay"&&p?t.jsxs(pa,{data:E,children:[t.jsx(je,{dataKey:"date",tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"}
2,axisLine:!1,tickLine:!1}),t.jsx(we,{domain:[0,100],tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"},axisLine:!1,tickLine:!1,width:28,tickFormatter:n=>`${n}%`}),t.jsx($e,{contentStyle:{backgroundColor:"hsl(var(--popover))",border:"1px solid hsl(var(--border))",borderRadius:"8px",boxShadow:"0 4px 12px rgb(0 0 0 / 0.15)",fontSize:"12px"},labelStyle:{color:"hsl(var(--foreground))",fontWeight:500},formatter:(n,j)=>{const h=b.find(O=>O.key===j);return[`${n.toFixed(1)}%`,h?.label||j]}}),t.jsx(Ie,{wrapperStyle:{fontSize:"10px"},formatter:n=>b.find(h=>h.key===n)?.label||n}),k.map(n=>t.jsx(re,{type:"monotone",dataKey:n.key,stroke:n.color,strokeWidth:2,dot:E.length===1?{r:4,fill:n.color}:!1,connectNulls:!0},n.key))]}):t.jsxs(Tt,{data:E,children:[t.jsx("defs",{children:k.map(n=>t.jsxs("linearGradient",{id:`gradient-${n.key.replace(/[^a-zA-Z0-9]/g,"-")}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[t.jsx("stop",{offset:"5%",stopColor:n.color,stopOpacity:.4}),t.jsx("stop",{offset:"95%",stopColor:n.color,stopOpacity:.05})]},n.key))}),t.jsx(je,{dataKey:"date",tick:!1,axisLine:!1,tickLine:!1}),t.jsx(we,{domain:[0,100],tick:{fontSize:a?8:10,fill:"hsl(var(--muted-foreground))"},axisLine:!1,tickLine:!1,width:a?24:28,tickFormatter:n=>`${n}%`}),t.jsx($e,{contentStyle:{backgroundColor:"hsl(var(--popover))",border:"1px solid hsl(var(--border))",borderRadius:"8px",boxShadow:"0 4px 12px rgb(0 0 0 / 0.15)",fontSize:"12px"},labelStyle:{color:"hsl(var(--foreground))",fontWeight:500},formatter:(n,j)=>{const h=b.find(O=>O.key===j);return[`${n.toFixed(1)}%`,h?.label||j]}}),k.length>1&&!a&&t.jsx(Ie,{wrapperStyle:{fontSize:"10px"},formatter:n=>b.find(h=>h.key===n)?.label||n}),k.map(n=>t.jsx(Et,{type:"monotone",dataKey:n.key,stroke:n.color,strokeWidth:k.length>3?1.5:2,fill:`url(#gradient-${n.key.replace(/[^a-zA-Z0-9]/g,"-")})`,fillOpacity:k.length>1?.3:1,dot:E.length===1?{r:4,fill:n.color}:!1},n.key))]})})}),k.length>1&&a&&t.jsx("div",{className:"flex flex-wrap gap-1",children:k.map(n=>t.jsx(Te,{variant:"outline",className:"text-xs py-0",style:{borderColor:n.color,color:n.color},children:n.label.split("@")[0]},n.key))}),p&&V&&t.jsxs("div",{className:"border-t pt-3 space-y-4",children:[t.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"View:"}),t.jsxs("div",{className:"flex items-center gap-1 bg-muted/50 rounded-md p-0.5",children:[t.jsxs(T,{variant:d==="global"?"secondary":"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>L("global"),children:[t.jsx(X,{className:"h-3 w-3 mr-1"}),"Global"]}),t.jsxs(T,{variant:d==="user"?"secondary":"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>L("user"),disabled:!N,title:N?"Your deliverability":"No personal data yet",children:[t.jsx(te,{className:"h-3 w-3 mr-1"}),"You"]}),t.jsxs(T,{variant:d==="team"?"secondary":"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>L("team"),disabled:!S,title:S?"Team deliverability":"No team data available",children:[t.jsx(ae,{className:"h-3 w-3 mr-1"}),"Team"]}),t.jsx(T,{variant:d==="overlay"?"secondary":"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>L("overlay"),children:"Overlay"})]})]}),d==="overlay"&&t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(pe,{id:"show-global",checked:v,onCheckedChange:D}),t.jsxs(J,{htmlFor:"show-global",className:"text-xs flex items-center gap-1 cursor-pointer",children:[t.jsx(X,{className:"h-3 w-3"})," Global"]})]}),N&&t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(pe,{id:"show-user",checked:_,onCheckedChange:I}),t.jsxs(J,{htmlFor:"show-user",className:"text-xs flex items-center gap-1 cursor-pointer",children:[t.jsx(te,{className:"h-3 w-3"})," You"]})]}),S&&t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(pe,{id:"show-team",checked:z,onCheckedChange:U}),t.jsxs(J,{htmlFor:"show-team",className:"text-xs flex items-center gap-1 cursor-pointer",children:[t.jsx(ae,{className:"h-3 w-3"})," Team"]})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select addresses to display:"}),t.jsx("div",{className:"flex flex-col gap-1 max-h-40 overflow-y-auto",children:b.map(n=>n.category==="global"&&v||n.category==="user"&&_||n.category==="team"&&z?t.jsxs("div",{className:"flex items-center gap-2 py-1 px-2 cursor-pointer hover:bg-muted/50 rounded",onClick:()=>P(n.key),children:[t.jsx(ve,{checked:y.has(n.key)}),t.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:n.color}}),t.jsx("span",{className:"text-xs",children:n.category==="global"?"Global":n.label})]},n.key):null)})]})]}),(d==="user"||d==="team")&&t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select addresses to display:"}),t.jsx("div",{className:"flex flex-col gap-1 max-h-40 overflow-y-auto",children:b.filter(n=>n.category===d).map(n=>t.jsxs("div",{className:"flex items-center gap-2 py-1 px-2 cursor-pointer hover:bg-muted/50 rounded",onClick:()=>P(n.key),children:[t.jsx(ve,{checked:y.has(n.key)}),t.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:n.color}}),t.jsx("span",{className:"text-xs",children:n.label}),n.label.includes(s||"")&&t.jsx(Te,{variant:"secondary",className:"text-xs py-0 px-1",children:"You"})]},n.key))})]})]})]})}function xe(e){return e===void 0?"text-muted-foreground":e>=70?"text-destructive":e>=40?"text-status-blocked":"text-success"}function za({metrics:e,isInTeam:s=!1}){if(!e?.global)return t.jsx("span",{className:"text-xs text-muted-foreground",children:"—%"});const a=e.global.delivered,r=e.user?.average?.delivered,i=e.team?.average?.delivered,o=r!==void 0,l=s||e.team!==void 0,c=i!==void 0;return t.jsxs("div",{className:"flex items-center",children:[t.jsxs("div",{className:"flex items-center gap-0.5 w-[52px]",title:o?`Your average: ${r?.toFixed(0)}%`:"No campaigns sent",children:[t.jsx(te,{className:"h-3 w-3 text-primary flex-shrink-0"}),t.jsx("span",{className:`text-xs font-medium tabular-nums ${o?xe(r):"text-muted-foreground"}`,children:o?`${r?.toFixed(0)}%`:"—%"})]}),l&&t.jsxs("div",{className:"flex items-center gap-0.5 w-[52px]",title:c?`Team average: ${i?.toFixed(0)}%`:"No team campaigns",children:[t.jsx(ae,{className:"h-3 w-3 text-primary flex-shrink-0"}),t.jsx("span",{className:`text-xs font-medium tabular-nums ${c?xe(i):"text-muted-foreground"}`,children:c?`${i?.toFixed(0)}%`:"—%"})]}),t.jsxs("div",{className:"flex items-center gap-0.5 w-[52px]",title:`Global average: ${a.toFixed(0)}%`,children:[t.jsx(X,{className:"h-3 w-3 text-primary flex-shrink-0"}),t.jsxs("span",{className:`text-xs font-medium tabular-nums ${xe(a)}`,children:[a.toFixed(0),"%"]})]})]})}const ha=[{key:"attachment",label:"Attachment",icon:Ut,description:"Send as email attachment"},{key:"link",label:"Link",icon:mt,description:"Send as hosted link"},{key:"body",label:"Body",icon:Ke,description:"Embed in email body"}];function fa({isEnterprise:e,campaignType:s}){const[a,r]=w.useState(0),i=s==="web"?e?["Preparing payload...","Updating Quick Send template...","Creating web campaign..."]:["Preparing payload...","Creating web campaign..."]:e?["Preparing payload...","Updating Quick Send template...","Sending c
2ampaign..."]:["Preparing payload...","Sending campaign..."];return w.useEffect(()=>{const o=setInterval(()=>{r(l=>l<i.length-1?l+1:l)},3e3);return()=>clearInterval(o)},[i.length]),t.jsxs("div",{className:"flex flex-col items-center justify-center py-8 space-y-6",children:[t.jsxs("div",{className:"relative",children:[t.jsx(ge,{className:"h-12 w-12 text-yellow-500 animate-pulse"}),t.jsx("div",{className:"absolute inset-0 h-12 w-12 rounded-full bg-yellow-500/20 animate-ping"})]}),t.jsx("div",{className:"space-y-3 w-full max-w-xs",children:i.map((o,l)=>t.jsxs("div",{className:We("flex items-center gap-3 text-sm transition-all duration-300",l<a&&"text-muted-foreground",l===a&&"text-foreground font-medium",l>a&&"text-muted-foreground/50"),children:[t.jsx("div",{className:"flex-shrink-0 w-5 h-5 flex items-center justify-center",children:l<a?t.jsx(ct,{className:"h-4 w-4 text-success"}):l===a?t.jsx(zt,{className:"h-4 w-4 animate-spin text-yellow-500"}):t.jsx("div",{className:"h-2 w-2 rounded-full bg-muted-foreground/30"})}),t.jsx("span",{children:o})]},o))})]})}function Ra({open:e,onOpenChange:s,payload:a}){const{data:r,isLoading:i}=tt({enabled:e}),{data:o=[],isLoading:l}=at({enabled:e}),c=Zt(),[u,d]=w.useState("email"),[g,p]=w.useState(""),[x,y]=w.useState([]),f=r?.subscription_status==="Enterprise",v=a?.delivery||["attachment","link"],D=v.includes("link");w.useEffect(()=>{if(e&&a){const m=a.delivery||["attachment","link"];y(m)}},[e,a?.payload_id,a?.delivery]),w.useEffect(()=>{e&&o.length>0&&!g&&p(o[0].email)},[e,o,g]),w.useEffect(()=>{e||(d("email"),p(""),y([]))},[e]);const _=m=>{v.includes(m)&&y(N=>N.includes(m)?N.filter(S=>S!==m):[...N,m])},I=async()=>{!a||!r?.primary_email||u==="email"&&(!g||x.length===0)||(await c.mutateAsync({payload_id:a.payload_id,recipe_id:a.recipe_id,payload_name:a.name,recipient:u==="email"?g:void 0,delivery:u==="web"?["link"]:x,isEnterprise:f,userEmail:r.primary_email,campaign_type:u}),s(!1))},z=!r||r.emails_remaining>0,U=!i&&!!r?.primary_email&&z&&(u==="web"?D:!!g&&x.length>0)&&!c.isPending;return a?t.jsx(st,{open:e,onOpenChange:s,children:t.jsxs(rt,{className:"sm:max-w-xl [&>*]:min-w-0",children:[t.jsxs(nt,{children:[t.jsxs(it,{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"h-5 w-5 text-yellow-500"}),"Quick Send"]}),t.jsx(lt,{children:c.isPending?u==="web"?"Setting up your web campaign...":"Setting up your campaign...":u==="web"?"Generate a download link to test web security controls.":"Instantly send this payload to a validated email address."})]}),c.isPending?t.jsx(fa,{isEnterprise:f,campaignType:u}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-4 py-4 w-full",children:[t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border bg-muted/30 p-3 w-full overflow-hidden",children:[t.jsx("div",{className:"w-10 h-10 flex items-center justify-center flex-shrink-0",children:t.jsx("img",{src:`/images/${a.name.split(".").pop()?.toLowerCase()||"blank"}.png`,alt:"",className:"w-8 h-8",onError:m=>{m.target.src="/images/blank.png"}})}),t.jsxs("div",{className:"flex-1 min-w-0 overflow-hidden",children:[t.jsx("p",{className:"font-medium text-sm truncate max-w-full",children:a.name}),a.description&&t.jsx(_e,{children:t.jsxs(Ce,{children:[t.jsx(De,{asChild:!0,children:t.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2 cursor-default",children:a.description})}),t.jsx(Pe,{side:"bottom",className:"max-w-xs",children:a.description})]})})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(J,{children:"Campaign Type"}),t.jsx(ht,{value:u,onValueChange:m=>d(m),children:t.jsxs(ft,{className:"w-full",children:[t.jsxs(Ee,{value:"email",className:"flex-1 gap-2",children:[t.jsx(Ke,{className:"h-4 w-4"}),"Email"]}),t.jsxs(Ee,{value:"web",className:"flex-1 gap-2",children:[t.jsx(X,{className:"h-4 w-4"}),"Web"]})]})})]}),r&&r.emails_remaining<=0&&t.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-destructive/50 bg-destructive/10 p-3 text-sm",children:[t.jsx(he,{className:"h-4 w-4 text-destructive flex-shrink-0"}),t.jsxs("span",{children:["Daily quota exceeded (",r.quota,"/",r.quota," used)"]})]}),u==="web"&&!D&&t.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-destructive/50 bg-destructive/10 p-3 text-sm",children:[t.jsx(he,{className:"h-4 w-4 text-destructive flex-shrink-0"}),t.jsx("span",{children:"This payload does not support link delivery, which is required for web campaigns."})]}),u==="email"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(J,{htmlFor:"recipient",children:"Recipient"}),l?t.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:"Loading emails..."}):o.length===0?t.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-destructive/50 bg-destructive/10 p-3 text-sm",children:[t.jsx(he,{className:"h-4 w-4 text-destructive flex-shrink-0"}),t.jsxs("span",{children:["No validated emails. Add one in"," ",t.jsx("a",{href:"/app/sett
2ings",className:"text-primary hover:underline",children:"Settings"})," ","to use Quick Send."]})]}):t.jsxs(Ot,{value:g,onValueChange:p,children:[t.jsx($t,{id:"recipient",className:"w-full",children:t.jsx(It,{placeholder:"Select email address"})}),t.jsx(Mt,{children:o.map(m=>t.jsx(Ft,{value:m.email,children:t.jsx("span",{className:"truncate",children:m.email})},m.email))})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(J,{children:"Delivery Methods"}),t.jsx("div",{className:"flex flex-wrap gap-2",children:t.jsx(_e,{children:ha.map(({key:m,label:N,icon:S})=>{const b=v.includes(m),k=x.includes(m),E=t.jsxs("div",{className:We("flex items-center gap-2 rounded-lg border px-3 py-2 transition-colors",b?"cursor-pointer hover:bg-muted/50":"cursor-not-allowed opacity-50",k&&b&&"border-primary bg-primary/5"),onClick:()=>b&&_(m),children:[t.jsx(ve,{checked:k,disabled:!b,onCheckedChange:()=>_(m),className:"pointer-events-none"}),t.jsx(S,{className:"h-4 w-4 flex-shrink-0"}),t.jsx("span",{className:"text-sm",children:N})]},m);return b?E:t.jsxs(Ce,{children:[t.jsx(De,{asChild:!0,children:E}),t.jsx(Pe,{children:"Not available for this payload"})]},m)})})}),x.length===0&&t.jsx("p",{className:"text-xs text-destructive",children:"Select at least one delivery method"})]})]})]}),t.jsxs(ot,{children:[t.jsx(T,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),t.jsxs(T,{onClick:I,disabled:!U,className:"gap-2",children:[t.jsx(ge,{className:"h-4 w-4"}),u==="web"?"Generate Link":"Send Now"]})]})]})]})}):null}export{Da as C,za as D,Pa as F,Ta as H,Bt as M,Ut as P,Ra as Q,Ea as S,Rt as a,Fa as b,Vt as c,Ma as d,$a as e,Ia as f,La as g,Oa as p,le as 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.