PageSourceSearch

https://watchmesportsbar.com/campaign-editor.component-BBKPZZ6T.js

js watchmesportsbar.com collected 2026-09-29 09:12:38 UTC 9,068 bytes, 1 lines download raw bytes

1import{a as S}from"./chunk-JKJ6F42S.js";import{a as ue}from"./chunk-GWBM5YM6.js";import{a as fe}from"./chunk-DPDD7YM3.js";import"./chunk-FSSUE7SW.js";import{b as de,c as ce,d as se,i as pe}from"./chunk-I64IFZHN.js";import{c as me,d as le}from"./chunk-5MK2RRGX.js";import"./chunk-MD3MLPEX.js";import"./chunk-7PJUBOCC.js";import"./chunk-ZEE2P5RO.js";import"./chunk-MKOMQHQ6.js";import"./chunk-EJREXGO2.js";import"./chunk-2LD5NNRX.js";import"./chunk-TMBGVCK3.js";import"./chunk-777MRG75.js";import{g as ne,i as oe}from"./chunk-U6LSUPHK.js";import"./chunk-FFTP54S7.js";import"./chunk-MMANCIEO.js";import{a as $,c as J,f as K,h as z,o as H}from"./chunk-XU2X4U4I.js";import"./chunk-TQJ3XHXP.js";import{N as R}from"./chunk-PYFHHE4D.js";import"./chunk-TBBHCXBJ.js";import"./chunk-5PIHIAIC.js";import"./chunk-VGA6HNDO.js";import"./chunk-MI5TE6OK.js";import"./chunk-GAP2NSZX.js";import"./chunk-6I74GBYL.js";import"./chunk-VTMJG6SJ.js";import"./chunk-I226TH2W.js";import"./chunk-M5AD7MGW.js";import"./chunk-S43XRXZW.js";import"./chunk-LDLGO4W5.js";import"./chunk-E2KUFIHC.js";import"./chunk-GSH6XXBX.js";import"./chunk-WUCUQISP.js";import"./chunk-IMS6JWZF.js";import"./chunk-DGQJ5XO5.js";import"./chunk-XDVWKRHR.js";import"./chunk-BBLVROJE.js";import"./chunk-A5FBXSXW.js";import"./chunk-GPFKVCYC.js";import"./chunk-J3WIPPQT.js";import"./chunk-HDZZRM2M.js";import"./chunk-GRNUSPMA.js";import"./chunk-W7NY4XD2.js";import"./chunk-45OHFKVX.js";import{b as L}from"./chunk-PQE3IFTD.js";import"./chunk-SPZZA4PG.js";import"./chunk-TGRBT4WK.js";import"./chunk-HKESKKTN.js";import{e as Q}from"./chunk-DPTFIZSZ.js";import"./chunk-5WAWCZSB.js";import"./chunk-M3S4CSK3.js";import"./chunk-KYVT6CQT.js";import{B as ae,K as re,c as U,e as C,h as W,i as X,j as Y,n as v,q as Z,r as ee,t as te,w as ie}from"./chunk-GK5BG4TN.js";import"./chunk-4DDMSORZ.js";import"./chunk-YX4Y55I7.js";import"./chunk-44QRIZKO.js";import"./chunk-DQHBKRXK.js";import"./chunk-T75JYYQD.js";import"./chunk-AACFS5HX.js";import"./chunk-PLJXQ3BT.js";import"./chunk-DFETL2O3.js";import"./chunk-MHD32HZI.js";import"./chunk-55NYF5SW.js";import"./chunk-DZ5G6NA3.js";import"./chunk-HTKVYBC5.js";import"./chunk-ZUFF5WS4.js";import"./chunk-TTUUAPNE.js";import"./chunk-C7KJXFIB.js";import"./chunk-C666TAHH.js";import"./chunk-WCJSVNED.js";import"./chunk-ZODBMDVC.js";import{d as O,l as V}from"./chunk-IG3ISJ3K.js";import"./chunk-VRGLM7AA.js";import"./chunk-BB2V4BTJ.js";import"./chunk-AYO77LZ3.js";import"./chunk-IHTRZJY4.js";import"./chunk-PG3N3OH3.js";import"./chunk-OH3XPIE7.js";import"./chunk-QZN5NL52.js";import{l as A}from"./chunk-ZPNMFRAZ.js";import"./chunk-WACVXLIE.js";import"./chunk-S7NQLDAZ.js";import{X as G}from"./chunk-YS3TH637.js";import"./chunk-5PLCBYLO.js";import"./chunk-CPHHXPH6.js";import"./chunk-KQXUOJT7.js";import"./chunk-ZLUZXZQB.js";import"./chunk-WUHLWO3B.js";import"./chunk-ECWUJKI3.js";import"./chunk-2SLQ6OES.js";import"./chunk-FPPZ4BUR.js";import{Ad as r,Bd as k,Ea as B,Ja as u,Mc as f,Ob as n,Oc as g,Qa as y,Qc as T,Ra as _,Rc as h,Sc as D,Tc as c,Td as P,Uc as a,Vc as i,Wc as b,cd as F,fc as j,jd as x,ld as q,ne as I,vd as M}from"./chunk-JSU2ZVBV.js";import"./chunk-DAZ3MHQI.js";import"./chunk-JQE4WEKA.js";import"./chunk-QHBN7R45.js";import"./chunk-WYFIINDB.js";import{a as E}from"./chunk-XFB3PWAV.js";var ve=Object.keys(S);function be(e){return Math.round(e*1e6)}function Ee(e,t){return E({teamId:e,platform:t.platform,name:t.name,objective:t.objective,dailyBudgetMicros:be(t.dailyBudget),startDate:t.startDate}
1,t.endDate?{endDate:t.endDate}:{})}var N=(()=>{let t=class t{constructor(){this.teamControl=u(fe),this.cloudService=u(ue),this.team=this.teamControl.teamStore.team,this.teamId=I(()=>this.team()?.id??null),this.platforms=I(()=>ve)}async createCampaign(m){let l=this.team()?.id;if(!l)return null;try{let o=Ee(l,m),{campaignId:d}=await this.cloudService.createCampaign(o);return d}catch{return null}}};t.\u0275fac=function(l){return new(l||t)},t.\u0275prov=B({token:t,factory:t.\u0275fac});let e=t;return e})();var Se=(e,t)=>t.key;function ye(e,t){e&1&&(a(0,"mat-error"),r(1,"Name is required"),i())}function _e(e,t){if(e&1&&(a(0,"mat-option",8),r(1),i()),e&2){let s=t.$implicit,m=q();c("value",s),n(),k(m.platformDisplayNames[s])}}function he(e,t){e&1&&(a(0,"mat-error"),r(1,"Platform is required"),i())}function De(e,t){if(e&1&&(a(0,"mat-option",8),r(1),i()),e&2){let s=t.$implicit;c("value",s.key),n(),k(s.label)}}function xe(e,t){e&1&&(a(0,"mat-error"),r(1,"Objective is required"),i())}function Me(e,t){e&1&&(a(0,"mat-error"),r(1,"Daily budget is required"),i())}function ke(e,t){e&1&&(a(0,"mat-error"),r(1,"Budget must be at least $1"),i())}function Ie(e,t){e&1&&(a(0,"mat-error"),r(1,"Start date is required"),i())}var Ne={awareness:"Awareness",traffic:"Traffic",engagement:"Engagement",leads:"Leads",sales:"Sales"};function we(){return Object.entries(Ne).map(([e,t])=>({key:e,label:t}))}function Be(){let e={};for(let[t,s]of Object.entries(S))e[t]=s.displayName;return e}function ge(e){return e?R(e):""}var rt=(()=>{let t=class t{constructor(){this.facade=u(N),this.router=u(G),this.snackBar=u(L),this.objectiveEntries=we(),this.platformDisplayNames=Be(),this.form=new Y({name:new v("",{nonNullable:!0,validators:[C.required]}),platform:new v("",{nonNullable:!0,validators:[C.required]}),objective:new v("",{nonNullable:!0,validators:[C.required]}),dailyBudget:new v(null,{validators:[C.required,C.min(1)]}),startDate:new v(null,{validators:[C.required]}),endDate:new v(null)})}async onSubmit(){if(this.form.invalid)return;let m=this.buildPayload();if(!m)return;if(!await this.facade.createCampaign(m)){this.snackBar.open("Failed to create campaign.","Close",{duration:5e3});return}this.snackBar.open("Campaign created!","Close",{duration:3e3}),this.navigateBack()}onCancel(){this.navigateBack()}buildPayload(){let{name:m,platform:l,objective:o,dailyBudget:d,startDate:p,endDate:w}=this.form.getRawValue();return!l||!d||!p?null:E({name:m,platform:l,objective:o,dailyBudget:d,startDate:ge(p)},w?{endDate:ge(w)}:{})}navigateBack(){let m=this.facade.teamId();m&&this.router.navigate(["/teams-v3",m,"admin","ad-manager"])}};t.\u0275fac=function(l){return new(l||t)},t.\u0275cmp=j({type:t,selectors:[["app-campaign-editor"]],features:[P([N])],decls:52,vars:11,consts:[["startPicker",""],["endPicker",""],[1,"mx-auto","max-w-[600px]","p-6"],[1,"mb-6","text-xl","font-semibold"],[1,"flex","flex-col","gap-4",3,"ngSubmit","formGroup"],["appearance","outline"],["matInput","","formControlName","name","placeholder","e.g. Spring Awareness Push"],["formControlName","platform"],[3,"value"],["formControlName","objective"],["matPrefix","",1,"pl-3","pr-1","text-gray-500"],["matInput","","type","number","formControlName","dailyBudget","min","1","step","0.01","placeholder","25.00"],[1,"flex","gap-4"],["appearance","outline",1,"flex-1"],["matInput","","formControlName","startDate",3,"matDatepicker"],["matIconSuffix","",3,"for"],["matInput","","formControlName","endDate",3,"matDatepicker"],[1,"flex","justify-end","gap-3","pt-2"],["mat-stroked-button","","type","button",3,"click"],["mat-flat-button","","color","primary","type","submit"]],template:function(l,o){if(l&1){let d=F();a(0,"div",2)(1,"h2",3),r(2,"Create Campaign"),i(),a(3,"form",4),x("ngSubmit",function(){return y(d),_(o.onSubmit())}),a(4,"mat-form-field",5)(5,"mat-label"),r(6,"Campaign Name"),i(),b(7,"input",6),f(8,ye,2,0,"mat-error"),i(),a(9,"mat-form-field",5)(10,"mat-label"),r(11,"Platform"),i(),a(12,"mat-select",7),h(13,_e,2,2,"mat-option",8,T),i(),f(15,he,2,0,"mat-error"),i(),a(16,"mat-form-field",5)(17,"mat-label"),r(18,"Objective"),i(),a(19,"mat-select",9),h(20,De,2,2,"mat-option",8,Se),i(),f(22,xe,2,0,"mat-error"),i(),a(23,"mat-form-field",5)(24,"mat-label"),r(25,"Daily Budget"),i(),a(26,"span",10),r(27,"$"),i(),b(28,"input",11),f(29,Me,2,0,"mat-error"),f(30,ke,2,0,"mat-error"),i(),a(31,"div",12)(32,"mat-form-field",13)(33,"mat-label"),r(34,"Start Date"),i(),b(35,"input",14)(36,"mat-datepicker-toggle",15)(37,"mat-datepicker",null,0),f(39,Ie,2,0,"mat-error"),i(),a(40,"mat-form-field",13)(41,"mat-label"),r(42,"End Date"),i(),b(43,"input",16)(44,"mat-datepicker-toggle",15)(45,"mat-datepicker",null,1),i()(),a(47,"div",17)(48,"button",18),x("click",function(){return y(d),_(o.onCancel())}),r(49," Cancel "),i(),a(50,"button",19),r(51," Create Campaign "),i()()()()}if(l&2){let d=M(38),p=M(46);n(3),c("formGroup",o.form),n(5),g(o.form.controls.name.hasError("required")?8:-1),n(5),D(o.facade.platforms()),n(2),g(o.form.controls.platform.hasError("required")?15:-1),n(5),D(o.objectiveEntries),n(2),g(o.form.controls.objective.hasError("required")?22:-1),n(7),g(o.form.controls.dailyBudget.hasError("required")?29:-1),n(),g(o.form.controls.dailyBudget.hasError("min")?30:-1),n(5),c("matDatepicker",d),n(),c("for",d),n(3),g(o.form.controls.startDate.hasError("required")?39:-1),n(4),c("matDatepicker",p),n(),c("for",p)}},dependencies:[re,Z,U,ee,W,X,ae,te,ie,V,O,A,le,me,H,$,J,K,z,oe,ne,Q,pe,de,ce,se],styles:["[_nghost-%COMP%]{display:block}"]});let e=t;return e})();export{rt as CampaignEditorComponent};

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.