import{aw as m,j as e,az as s,ax as l,bi as i,bE as c}from"./app-BgLa5dit.js";import{g as p,u}from"./BddP3S5c.chunk.js";import{w as d,C as b,a as g}from"./GYlSv6lg.chunk.js";import{D as x}from"./nLtuAPO5.chunk.js";import{S as h}from"./C1m0yEk1.chunk.js";import"./DkDkjje4.chunk.js";import"./DJ0pq8J_.chunk.js";import"./Bs6fQ2wT.chunk.js";import"./BUT90D7O.chunk.js";import"./DyuQzTEw.chunk.js";import"./DDfKZ_ng.chunk.js";const v=[{name:"utmSource",label:"Source",placeholder:"Enter UTM source"},{name:"utmMedium",label:"Medium",placeholder:"Enter UTM medium"},{name:"utmCampaign",label:"Campaign",placeholder:"Enter campaign name"},{name:"utmContent",label:"Content (optional)",placeholder:"Enter UTM content"},{name:"utmTerm",label:"Term (optional)",placeholder:"Enter UTM term"}];function j(t){const{values:n}=m(),a=p(n.originType);return e.jsxs(s,{className:`d-flex flex-column gap-3 ${d.formContent}`,children:[a.originNameLabel&&e.jsx(l,{name:"originName",label:a.originNameLabel,as:"input",placeholder:`Enter ${a.originNameLabel.toLowerCase()} e.g. ${a.originNameExample}`,infoTooltip:`Enter the full name (e.g. ${a.originNameExample}).`}),a.event&&e.jsx(f,{nameLabel:a.event.nameLabel,dateLabel:a.event.dateLabel,nameExample:a.event.nameExample}),a.subscription&&t.canManageAll&&e.jsxs(l,{name:"brazeOptions.subscriptionGroup",label:"Subscription groups",as:"select",children:[e.jsx("option",{value:"",disabled:!0,children:"Select Subscription Groups"}),Object.entries(h).map(([r,o])=>e.jsx("option",{value:o,children:r},o))]}),a.utm&&e.jsx(M,{})]})}function M(){const{values:t,setFieldValue:n}=m(),a=!!t.utmEnabled;return e.jsxs("div",{className:"border border-2 border-gray-300 rounded",children:[e.jsxs("div",{className:"bg-gray-200 p-3 rounded-top-1 border-bottom border-2 border-gray-300 d-flex flex-row justify-content-between align-items-center",children:[e.jsx("p",{className:"mb-0",children:"UTM link"}),e.jsx(c,{on:a,onClick:()=>n("utmEnabled",!a),tooltipText:"Include UTM tracking parameters for this import"})]}),e.jsx("div",{className:"p-3 d-flex flex-column gap-3",children:v.map(r=>e.jsx(l,{name:r.name,label:r.label,as:"input",placeholder:r.placeholder,disabled:!a},r.name))})]})}function f(t){const{values:n,setFieldValue:a}=m();function r(o){if(!o.target.value||!i.formatIsValid(o.target.value,"YYYY-MM-DD",!0)){a("eventDate","");return}a("eventDate",i.getUtcISOString(i.parseDateString(o.target.value,"YYYY-MM-DD")))}return e.jsxs(e.Fragment,{children:[e.jsx(l,{name:"eventName",label:t.nameLabel,as:"input",placeholder:`Enter name e.g. ${t.nameExample}`}),e.jsx(l,{name:"eventDate",label:t.dateLabel,children:()=>e.jsx(x,{id:"event-date",required:!0,value:n.eventDate?i.formatUtc(new Date(n.eventDate).getTime(),"YYYY-MM-DD"):"",onChange:r})})]})}function O(t){const{canManageAll:n}=u();return e.jsx(b,{currentStepId:g.IMPORT_OPTIONS,queryParams:t.queryParams,title:"More options",children:e.jsx(j,{canManageAll:n})})}export{O as ContactImportOptionsView};
//# sourceMappingURL=DkusOMYs.chunk.js.map
