daddy.oh writes songs about the nights you remember and the ones you do not. Born in Puerto Rico, based in Orlando, he mixes reggaeton drums with trap melodies and a lot of voice notes.
He has played clubs, festivals and one very loud quinceañera.
1.2MStreams
85Shows played
Orlando, FLHome
A voice that sounds like the city at 2 a.m.Local Beat Magazine
'+REP('site.packages.items',[{p:'name',l:'Package name'},{p:'price',l:'Price',ph:'From $1,500'},{p:'desc',l:'Short description'},{p:'btn',l:'Button text'},{p:'url',l:'Button link (blank scrolls to contact)',t:'url'},{p:'feats',l:'What is included (one per line)',t:'area',rows:4}],{title:i=>i.name,sub:i=>i.price,add:'Add a package',blank:'pkg',empty:'No packages yet.'})+'
Controls how your site looks on Google and when someone shares the link. Applies to the full-site download.
'+F('site.seo',{p:'title',l:'Page title',ph:s.brand.name,h:'Under 60 characters works best.'})+F('site.seo',{p:'desc',l:'Description',t:'area',rows:3,h:'Under 160 characters works best.'})+F('site.seo',{p:'image',l:'Share image',t:'img',max:1200,h:'Shown when the link is shared. Hosted sites show it best if the file is also uploaded to your host.'})+'
'
+'
How it looks on Google
yourwebsite.com
'+esc(t.slice(0,60))+'
'+esc(d.slice(0,160)||'Add a description above.')+'
'
+'
Analytics and advanced
'+FS('site.seo',[{p:'lang',l:'Language code',ph:'en or es'},{p:'ga',l:'Google Analytics ID',ph:'G-XXXXXXXXXX',h:'Adds visitor tracking to the full-site download.'}])+F('site.seo',{p:'head',l:'Extra code for the page head (optional)',t:'area',rows:4,h:'For tools like Meta Pixel. Only paste code you trust. Not used in embeds or the preview.'})+'
'+n+' of '+RCHECK.length+' steps done'+(dt==null?'':dt>0?'. Out in '+dt+' days':dt===0?'. Out today':'. Released '+fmtD(r.date))+''}).join('')+'
':'
No releases planned. Add your next single or video.
')};
const newRel=()=>({id:uid(),title:'',type:'single',date:'',status:'planning',checks:RCHECK.map(()=>false),notes:''});
ACT.newrel=()=>entityModal('New release',RFIELDS(),newRel(),r=>{if(!r.title.trim()){toast('Add a title first');return false}CRM().releases.push(r);save();render()});
ACT.editrel=b=>{const r=CRM().releases.find(x=>x.id===b.dataset.id);if(!r)return;if(!r.checks)r.checks=RCHECK.map(()=>false);entityModal('Edit release',RFIELDS(),r,n=>{Object.assign(r,n);save();render()},()=>{CRM().releases=CRM().releases.filter(x=>x!==r);save();render()})};
/* ----- set lists ----- */
const SLF=[{p:'name',l:'Set list name',ph:'Club Aqua, Miami'},{p:'songs',l:'Songs (one per line, in order)',t:'area',rows:10},{p:'notes',l:'Notes for the set',t:'area',rows:3}];
LISTS.setlists=()=>{const l=CRM().setlists;return l.length?'
Plan the order of songs and print a big, readable copy for the stage.
'+LISTS.setlists()+'
';
function setlistPDF(x){const d=newPdf();if(!d)return;pdfHeader(d,x.name||'Set list',A().site.brand.name);let y=150;d.setTextColor(20);String(x.songs||'').split('\n').filter(s=>s.trim()).forEach((s,i)=>{y=pdfY(d,y,34);d.setFont('helvetica','bold');d.setFontSize(22);d.text((i+1)+'.',40,y);d.setFont('helvetica','normal');d.text(pdfSafe(s.trim()),88,y);y+=34});if(x.notes){y=pdfY(d,y+10,60);d.setFontSize(12);d.setTextColor(90);y=pdfPara(d,'Notes: '+x.notes,40,y,532,16)}pdfFoot(d);d.save(slug(x.name||'set-list')+'.pdf')}
const setExtras=()=>{modalExtra('Fill from my songs',()=>{TMP.e.songs=A().site.music.tracks.filter(t=>t.title).map(t=>t.title).join('\n');const ta=$('#modalBox textarea');if(ta)ta.value=TMP.e.songs},0);modalExtra('Download PDF',()=>setlistPDF(TMP.e),0)};
ACT.newset=()=>{entityModal('New set list',SLF,{id:uid(),name:'',songs:'',notes:''},x=>{CRM().setlists.push(x);save();render()},null,'');setExtras()};
ACT.editset=b=>{const x=CRM().setlists.find(y=>y.id===b.dataset.id);if(!x)return;entityModal('Edit set list',SLF,x,n=>{Object.assign(x,n);save();render()},()=>{CRM().setlists=CRM().setlists.filter(y=>y!==x);save();render()},'');setExtras()};
/* ----- email templates ----- */
const TPLS=[
{id:'b1',name:'Reply to a booking inquiry',subject:'Booking {{artist}} for {{venue}}',body:'Hi {{name}},\n\nThanks for reaching out about {{artist}} at {{venue}} on {{date}}. I would love to make it happen.\n\nCould you send me the set length, load-in time, sound setup and your budget? Once I have those I can confirm availability and send a short agreement.\n\nBest,\n{{artist}}\n{{myemail}}'},
{id:'b2',name:'Send the rider and tech needs',subject:'Rider and tech needs for {{date}}',body:'Hi {{name}},\n\nAttached is the rider for {{artist}} on {{date}} at {{venue}}. The essentials: 2 monitors, 1 vocal mic, a DJ booth or table, bottled water, and a green room that locks.\n\nPlease tell me if anything is a problem so we can solve it early.\n\nThanks,\n{{artist}}'},
{id:'f1',name:'Follow up (no reply yet)',subject:'Following up: {{venue}} on {{date}}',body:'Hi {{name}},\n\nJust checking in on {{date}} at {{venue}}. I am holding the date for now and can answer any questions.\n\nThanks,\n{{artist}}'},
{id:'p1',name:'Press and playlist pitch',subject:'New music from {{artist}}',body:'Hi {{name}},\n\nI am {{artist}}. My new release is out on {{date}} and I think it fits what you cover. Streaming links, artwork and a short bio are on my site.\n\nThank you for listening,\n{{artist}}\n{{myemail}}'},
{id:'i1',name:'Invoice reminder',subject:'Friendly reminder: invoice for {{venue}}',body:'Hi {{name}},\n\nA quick reminder that the invoice for {{venue}} on {{date}} is due. The PDF is attached with payment details.\n\nPlease let me know once it is sent.\n\nThank you,\n{{artist}}'},
{id:'t1',name:'Thank you after a show',subject:'Thank you for {{date}}',body:'Hi {{name}},\n\nThank you for having {{artist}} at {{venue}}. The crowd was great and I would love to come back.\n\nIf you have photos or a short testimonial, I would be grateful.\n\n{{artist}}'}
];
const allTpls=()=>TPLS.concat(CRM().templates.map(t=>Object.assign({mine:1},t)));
function tplFill(t){const c=CRM().contacts.find(x=>x.id===UIS['tpl.contact']),first=c?(c.name||'').split(' ')[0]:'there';const map={name:first||'there',artist:A().site.brand.name,venue:UIS['tplv.venue']||(c&&c.company)||'the venue',date:UIS['tplv.date']?fmtD(UIS['tplv.date']):'the date',myemail:A().site.contact.email||'',email:c?c.email:''};const f=s=>String(s).replace(/\{\{(\w+)\}\}/g,(m,k)=>k in map?map[k]:m);return{subject:f(t.subject),body:f(t.body),to:c?c.email:''}}
LISTS.tplv=()=>{const t=allTpls().find(x=>x.id===(UIS['tpl.id']||'b1'))||TPLS[0],o=tplFill(t);return '
Fill in the details and the message writes itself. Edit it freely before copying.
'+LISTS.tplv()+'
'};
VIEWS.templates=()=>'
'+LISTS.tpl()+'
';
ACT.tplcopy=()=>copyText('Subject: '+$('#tplSub').value+'\n\n'+$('#tplBody').value,'Message copied');
ACT.tplmail=()=>{const c=CRM().contacts.find(x=>x.id===UIS['tpl.contact']);location.href='mailto:'+(c?c.email:'')+'?subject='+encodeURIComponent($('#tplSub').value)+'&body='+encodeURIComponent($('#tplBody').value)};
ACT.tplsave=()=>entityModal('Save as my template',[{p:'name',l:'Template name'}],{name:''},n=>{if(!n.name.trim()){toast('Name it first');return false}const id=uid();CRM().templates.push({id,name:n.name.trim(),subject:$('#tplSub').value,body:$('#tplBody').value});UIS['tpl.id']=id;save();render();toast('Template saved')},null,'');
ACT.tpldel=()=>{const id=UIS['tpl.id'];CRM().templates=CRM().templates.filter(t=>t.id!==id);UIS['tpl.id']='b1';save();render()};
/* ----- contracts ----- */
const newContract=()=>({event:'',venue:'',city:'',date:'',time:'',fee:0,deposit:0,buyer:'',buyerEmail:'',terms:'Artist will perform for the agreed set length at the date, time and venue above.\nBuyer will provide sound, lighting, stage power and a secure green room.\nThe deposit is due to hold the date and is non-refundable. The balance is due before the performance.\nIf the Buyer cancels fewer than 14 days before the date, the full fee is due. If the Artist cancels, the deposit is returned in full.\nNeither party is liable for cancellation caused by weather, illness or events outside their control; the parties will try to reschedule.'});
VIEWS.contracts=()=>{const c=CRM();if(!c.contractDraft)c.contractDraft=newContract();const up=upcomingShows();
return '
Booking agreement
A plain one-page agreement with signature lines. It is a template, not legal advice. Have a lawyer review it for large engagements.
'+(up.length?'
Fill from a show:'+up.slice(0,4).map(x=>'').join('')+'
':'')
+FS('crm.contractDraft',[{p:'event',l:'Event name'},{p:'venue',l:'Venue'},{p:'city',l:'City'},{p:'date',l:'Date',t:'date'},{p:'time',l:'Start time',ph:'9:00 PM'},{p:'buyer',l:'Buyer or promoter'},{p:'buyerEmail',l:'Buyer email',t:'email'},{p:'fee',l:'Total fee ($)',t:'num'},{p:'deposit',l:'Deposit ($)',t:'num'}],'g3')+F('crm.contractDraft',{p:'terms',l:'Terms (one per line)',t:'area',rows:8})+'
'+esc(label)+''+fmt(cur)+' of '+fmt(tar)+' ('+p+'%)
'};
return '
Goals for '+y+'
Income and shows fill in on their own from Finance and Tour. Add anything else you want to track.
'+FS('crm.goals',[{p:'income',l:'Income goal ($)',t:'num',rc:1},{p:'shows',l:'Shows goal',t:'num',rc:1}])+(g.income>0?bar('Income this year',f.yi,g.income,money):'')+(g.shows>0?bar('Shows this year',shows,g.shows,v=>String(v)):'')+(!g.income&&!g.shows?'
Set an income or shows goal above to see progress.
':'')+'
'
+'
Other goals
Streams, followers, songs finished. Update the current number whenever you check.
'+REP('crm.goals.custom',[{p:'name',l:'Goal',ph:'Spotify monthly listeners'},{p:'target',l:'Target',t:'num',rc:1},{p:'current',l:'Current',t:'num',rc:1}],{cls:'g3',title:x=>x.name,sub:x=>x.target?Math.round((x.current||0)/x.target*100)+'%':'',add:'Add a goal',blank:'goal',sort:false,empty:'No custom goals yet.'})+'
'+REP('site.faq.items',[{p:'q',l:'Question'},{p:'a',l:'Answer',t:'area',rows:3}],{cls:'',title:i=>i.q,add:'Add a question',blank:'faq',empty:'No questions yet.'})+'
';
/* Content planner */
const PSTAT=[['idea','Idea'],['drafted','Drafted'],['scheduled','Scheduled'],['posted','Posted']];
const PF=()=>[{p:'date',l:'Post date',t:'date'},{p:'platform',l:'Platform',t:'select',o:['instagram','tiktok','youtube','facebook','x','threads','snapchat','twitch','soundcloud','spotify'].map(k=>[k,bName(k)])},{p:'status',l:'Status',t:'select',o:PSTAT},{p:'link',l:'Link when posted',t:'url'},{p:'caption',l:'Caption or idea',t:'area',rows:4}];
LISTS.posts=()=>{const f=UIS['posts.f']||'todo',l=CRM2().posts.filter(p=>f==='all'||(f==='todo')===(p.status!=='posted')).sort((a,b)=>(a.date||'9').localeCompare(b.date||'9'));
if(!l.length)return '
'+(f==='todo'?'Nothing planned. Add your next post.':'No posts here.')+'
'+(Math.abs(t-100)<.01?'Adds up to 100%':'Adds up to '+t+'%, needs 100%')+''}).join('')+'
':'
No split sheets yet. Make one before you release a song with collaborators.
')};
function splitPDF(s){const d=newPdf();if(!d)return;const rows=spParse(s),t=spTotal(s);pdfHeader(d,'Split sheet',s.song||'Untitled');let y=130;d.setTextColor(20);d.setFontSize(11);d.text('Song: '+pdfSafe(s.song||''),40,y);d.text('Date: '+(s.date?fmtD(s.date):''),360,y);y+=30;d.setFillColor(238,236,228);d.rect(40,y,532,22,'F');d.setFont('helvetica','bold');d.text('Name',48,y+15);d.text('Role',230,y+15);d.text('Share',380,y+15);d.text('Email',440,y+15);d.setFont('helvetica','normal');y+=40;
rows.forEach(r=>{y=pdfY(d,y,22);d.text(pdfSafe(r.name),48,y);d.text(pdfSafe(r.role),230,y);d.text(r.pct+'%',380,y);d.text(pdfSafe(r.email).slice(0,28),440,y);y+=22});d.setFont('helvetica','bold');d.text('Total: '+t+'%'+(Math.abs(t-100)<.01?'':' (must equal 100%)'),48,y+6);d.setFont('helvetica','normal');y+=34;
if(s.notes)y=pdfPara(d,'Notes: '+s.notes,40,y,532,14)+10;y=pdfY(d,y+20,rows.length*46+30);d.setFontSize(10);d.text('By signing, each person agrees to the shares above for this song.',40,y);y+=34;rows.forEach(r=>{y=pdfY(d,y,46);d.setDrawColor(60);d.line(40,y+20,300,y+20);d.line(330,y+20,480,y+20);d.text(pdfSafe(r.name),40,y+34);d.text('Date',330,y+34);y+=50});
pdfFoot(d);d.save(slug(s.song||'split-sheet')+'-split-sheet.pdf')}
const spExtra=()=>modalExtra('Download PDF',()=>splitPDF(TMP.e),0);
ACT.newsplit=()=>{entityModal('New split sheet',SPF,{id:uid(),song:'',date:isoD(),lines:A().site.brand.name+' | Artist and writer | 100 | '+(A().site.contact.email||''),notes:''},s=>{if(!s.song.trim()){toast('Add the song title first');return false}CRM2().splits.push(s);save();render()},null,'');spExtra()};
ACT.editsplit=b=>{const s=CRM2().splits.find(x=>x.id===b.dataset.id);if(!s)return;entityModal('Edit split sheet',SPF,s,n=>{Object.assign(s,n);save();render()},()=>{CRM2().splits=CRM2().splits.filter(x=>x!==s);save();render()},'');spExtra()};
/* Gigs and payouts */
const GF=[{p:'fee',l:'Fee ($)',t:'num'},{p:'deposit',l:'Deposit received ($)',t:'num'},{p:'costs',l:'Costs ($)',t:'num'},{p:'paid',l:'Fully paid',t:'check'},{p:'notes',l:'Private notes',t:'area',rows:3}];
function gigStats(){const sh=A().site.tour.shows.filter(s=>s.status!=='cancel');let fee=0,got=0,costs=0;sh.forEach(s=>{const f=+s.fee||0;fee+=f;got+=s.paid?f:Math.min(+s.deposit||0,f);costs+=+s.costs||0});return{fee,got,owed:fee-got,costs,net:fee-costs,n:sh.length}}
VIEWS.gigs=()=>{const sh=A().site.tour.shows.map((s,i)=>({s,i})).sort((a,b)=>(b.s.date||'').localeCompare(a.s.date||'')),g=gigStats();
return '
Booked fees'+money(g.fee)+'
Received'+money(g.got)+'
Still owed to you'+money(g.owed)+'
Profit after costs'+money(g.net)+'
'
+'
Every show
Click a row to edit fee, deposit, costs and payment. Add or remove shows in Tour and shows.
'+REP('crm.invDraft.items',[{p:'d',l:'Description'},{p:'q',l:'Qty',t:'num'},{p:'r',l:'Rate ($)',t:'num'}],{cls:'g3',title:x=>x.d,sub:x=>money((+x.q||0)*(+x.r||0)),add:'Add a line',blank:'line',sort:false,empty:'No lines.'})+'
'+FS('crm.invDraft',[{p:'pay',l:'How to pay',ph:'Zelle, PayPal, bank details'},{p:'notes',l:'Notes'}])+'
Total '+money(t.total)+'
'
+'
Monthly report
Summary, calendar view and every money entry for one month.
Press kit (EPK)
Bio, facts, music, shows, press and booking in one PDF, built from your website content.
'};
ACT.invpdf=()=>invoicePDF(CRM().invDraft);
ACT.invnew=()=>{CRM().invDraft=newInv();save();render()};
ACT.invsave=()=>{const c=CRM(),i=c.invDraft,t=invTotals(i);if(!i.client.trim()||t.total<=0){toast('Add a client name and at least one priced line');return}c.invoices.push(Object.assign(clone(i),{paid:true}));c.finance.push({id:uid(),date:i.issue,type:'income',cat:'Shows',amt:Math.round(t.total*100)/100,desc:'Invoice '+i.no+' - '+i.client});c.invDraft=newInv();save();render();toast('Saved and recorded as income')};
ACT.invredo=b=>invoicePDF(CRM().invoices[+b.dataset.n]);
ACT.invrm=b=>{CRM().invoices.splice(+b.dataset.n,1);save();render()};
ACT.reppdf=()=>reportPDF($('#repMonth').value);ACT.epkpdf=epkPDF;
/* ---------- publish ---------- */
function downloadSite(){const a=A();if(!activeSections(a.site).length){toast('Turn on at least one section first');return}download(slug(a.site.brand.name)+'-website.html',buildSite(a,{full:true}),'text/html');toast('Website downloaded')}
ACT.dlsite=downloadSite;
VIEWS.publish=()=>{const a=A(),s=a.site,act=activeSections(s);
const rows=SEC.filter(x=>x[0]!=='hero').map(x=>{const id=x[0],on=!s.layout.hidden[id],ok=has(id,s);return '
'+x[1]+''+(!on?'Hidden. Not included in any download.':ok?'Ready to embed':'On, but empty')+'
'}).join('');
return '
Download your website
One HTML file with every section you have switched on. Upload it to any host, or open it in a browser.
'+act.length+' section'+(act.length===1?'':'s')+' included
'
+'
Embed one section
Switch sections on or off here. Only the switched-on sections can be copied or downloaded. Paste the code into a custom HTML block in your site builder.
'+rows+'
'
+'
Hand off to a new artist
Download this studio as one file. The artist opens it in their browser and edits their own site and CRM. Nothing is shared with you.
'
+'
Back up this artist
Your data lives in this browser. Download a backup before you clear browser data or switch computers.
'};
ACT.embcopy=b=>{const a=A(),id=b.dataset.id;const code=id==='all'?buildSite(a,{}):buildSite(a,{only:[id]});copyText(code,'Embed code copied');};
ACT.embdl=b=>{const a=A(),id=b.dataset.id;download(slug(a.site.brand.name)+'-'+id+'-embed.html',buildSite(a,{only:[id]}),'text/html');toast('Section downloaded')};
function studioCopy(preset){const j=JSON.stringify(preset).replace(/'const PRESET='+j+';/*PRESET_END*/')}
ACT.studio=b=>{let pre;if(b.dataset.m==='site'){const x=clone(A());x.id=uid();x.crm=blankCrm();pre=[x]}else{pre=[newArtist('Your artist name')]}download('nexus-studio'+(b.dataset.m==='site'?'-'+slug(A().site.brand.name):'-new-artist')+'.html',studioCopy(pre),'text/html');toast('Studio downloaded')};
ACT.bkartist=()=>{download(slug(A().site.brand.name)+'-backup.json',JSON.stringify({nexus:'artist',artist:A()}),'application/json');toast('Backup downloaded')};
function importFile(f,kind){const rd=new FileReader();rd.onload=()=>{try{
if(kind==='finance'){const rows=parseCSV(String(rd.result));if(rows.length<2){toast('That CSV has no rows');return}const hd=rows[0].map(x=>x.trim().toLowerCase());let n=0;rows.slice(1).forEach(r=>{const o={id:uid(),date:isoD(),type:'income',cat:'Other income',desc:'',amt:0};hd.forEach((h,i)=>{if(h in o&&h!=='id')o[h]=r[i]||''});o.amt=parseFloat(String(o.amt).replace(/[^0-9.\-]/g,''))||0;o.type=/exp/i.test(o.type)?'expense':'income';if(o.amt){CRM().finance.push(o);n++}});save();render();toast(n+' entries imported');return}
if(kind==='contacts'){const rows=parseCSV(String(rd.result));if(rows.length<2){toast('That CSV has no rows');return}const hd=rows[0].map(x=>x.trim().toLowerCase());let n=0;rows.slice(1).forEach(r=>{const o={id:uid(),name:'',type:'other',company:'',email:'',phone:'',social:'',notes:'',last:''};hd.forEach((h,i)=>{if(h in o&&h!=='id')o[h]=r[i]||''});if(!CTYPES.some(t=>t[0]===o.type))o.type='other';if(o.name||o.email){CRM().contacts.push(o);n++}});save();render();toast(n+' contacts imported');return}
const o=JSON.parse(rd.result);
if(kind==='artist'&&o.artist){const x=migrate(o.artist);x.id=uid();DB.artists.push(x);DB.active=x.id;save();render();toast('Restored as '+(x.site.brand.name||'artist'));return}
if(kind==='all'&&o.db&&o.db.artists){o.db.artists.forEach(x=>{migrate(x);x.id=uid();DB.artists.push(x)});save();render();toast('Backup added');return}
toast('That file is not a Nexus Studio backup')}catch(e){toast('Could not read that file')}};rd.readAsText(f)}
/* ---------- artists ---------- */
VIEWS.artists=()=>{let sz=0;try{sz=(localStorage.getItem(KEY)||'').length}catch(e){}const pct=Math.min(100,Math.round(sz/50000));
return '
Browser storage used: about '+Math.round(sz/1024)+' KB of roughly 5,000 KB.
'};
ACT.swart=b=>{DB.active=b.dataset.id;save();render()};
ACT.dupart=b=>{const x=clone(DB.artists.find(y=>y.id===b.dataset.id));x.id=uid();x.site.brand.name+=' copy';x.name=x.site.brand.name;DB.artists.push(x);save();render();toast('Duplicated')};
ACT.delart=b=>{const x=DB.artists.find(y=>y.id===b.dataset.id);if(DB.artists.length<2){toast('Keep at least one artist');return}confirmModal('Delete '+x.site.brand.name+' and all of their data? This cannot be undone.','Delete artist',()=>{DB.artists=DB.artists.filter(y=>y!==x);if(DB.active===x.id)DB.active=DB.artists[0].id;save();render()})};
ACT.newart=()=>wizard();
ACT.bkall=()=>{download('nexus-studio-backup.json',JSON.stringify({nexus:'all',db:DB}),'application/json');toast('Backup downloaded')};
ACT.reset=()=>confirmModal('This erases every artist, website and CRM record stored in this browser.','Erase everything',()=>{try{localStorage.removeItem(KEY)}catch(e){}DB=load();tab='dash';save();render()});
/* ---------- batch 4: quick add, rider, mileage log, backup reminder ---------- */
Object.assign(IC,{
rider:'',
mileage:''
});
const CR=()=>A().crm;
/* ----- quick add button ----- */
(function(){const m=document.createElement('div');m.className='fabmenu';m.id='fabMenu';const f=document.createElement('button');f.className='fab';f.id='fab';f.setAttribute('aria-label','Quick add');f.dataset.act='fab';f.textContent='+';document.body.appendChild(m);document.body.appendChild(f)})();
const QUICK=[['Task','tasks','qtask'],['Contact','contacts','newcontact'],['Note','notes','newnote'],['Show','tour','qshow'],['Income or expense','finance','newfin'],['Social post','social','newpost'],['Deal','pipeline','newdeal'],['Mileage trip','mileage','newtrip']];
function fabClose(){$('#fabMenu').classList.remove('on');$('#fab').classList.remove('open')}
ACT.fab=()=>{const m=$('#fabMenu'),open=!m.classList.contains('on');if(open){m.innerHTML='
Add something quickly
'+QUICK.map((q,i)=>'').join('')}m.classList.toggle('on',open);$('#fab').classList.toggle('open',open)};
ACT.qgo=b=>{const q=QUICK[+b.dataset.i];fabClose();ACT[q[2]]()};
document.addEventListener('click',e=>{if(!e.target.closest('#fab,#fabMenu'))fabClose()});
ACT.qtask=()=>entityModal('New task',TFIELDS,{id:uid(),title:'',due:'',done:false,pri:'normal',notes:'',link:''},t=>{if(!t.title.trim()){toast('Describe the task first');return false}CR().tasks.push(t);save();render();toast('Task added')});
ACT.qshow=()=>entityModal('New show',[{p:'date',l:'Date',t:'date'},{p:'venue',l:'Venue'},{p:'city',l:'City'},{p:'status',l:'Status',t:'select',o:[['on','Tickets on sale'],['free','Free entry'],['sold','Sold out'],['tba','Details soon']]},{p:'fee',l:'Fee (private)',t:'num'},{p:'url',l:'Ticket link',t:'url'}],{date:isoD(),venue:'',city:'',status:'on',fee:0,url:''},s=>{if(!s.venue.trim()){toast('Add the venue first');return false}A().site.tour.shows.push(Object.assign(BLANKS.show(),s));save();render();toast('Show added')});
/* ----- rider ----- */
const defRider=()=>({title:'Technical rider',sound:'2 stage monitors\n1 wireless or wired vocal mic (SM58 or equal)\nHouse PA with engineer\nDJ booth or table, 6 ft wide, with power',stage:'Stage minimum 8 ft x 6 ft\nTwo power outlets within reach of the performer\nClear sight line to the sound engineer',hospitality:'Bottled water for 4 people\nSecure green room or private space\nParking for 2 vehicles\nMeal or buyout for 4 people',notes:'Load-in 2 hours before doors. Sound check 60 minutes before doors. Please contact us about any change at least 7 days before the show.',contact:A().site.contact.email||''});
VIEWS.rider=()=>{const c=CR();if(!c.rider)c.rider=defRider();return '
Technical rider
What the venue needs to provide. Download it as a PDF and send it with your booking reply.
'+FS('crm.rider',[{p:'title',l:'Document title'},{p:'contact',l:'Contact for the venue'}])+FS('crm.rider',[{p:'sound',l:'Sound and equipment (one per line)',t:'area',rows:6},{p:'stage',l:'Stage and power (one per line)',t:'area',rows:6},{p:'hospitality',l:'Hospitality (one per line)',t:'area',rows:5},{p:'notes',l:'Schedule and notes',t:'area',rows:5}])+'
'};
ACT.riderreset=()=>{CR().rider=defRider();save();render()};
ACT.riderpdf=()=>{const d=newPdf();if(!d)return;const r=CR().rider||defRider(),b=A().site.brand;pdfHeader(d,r.title||'Rider',b.name);let y=130;d.setTextColor(20);
[['Sound and equipment',r.sound],['Stage and power',r.stage],['Hospitality',r.hospitality]].forEach(([h,t])=>{y=pdfY(d,y,50);d.setFont('helvetica','bold');d.setFontSize(13);d.text(h,40,y);y+=20;d.setFont('helvetica','normal');d.setFontSize(11);String(t||'').split('\n').filter(x=>x.trim()).forEach(l=>{y=pdfPara(d,'- '+l.trim(),48,y,520,15)});y+=14});
if(r.notes){y=pdfY(d,y,50);d.setFont('helvetica','bold');d.setFontSize(13);d.text('Schedule and notes',40,y);y+=20;d.setFont('helvetica','normal');d.setFontSize(11);y=pdfPara(d,r.notes,40,y,532,15)+14}
if(r.contact){y=pdfY(d,y,40);d.setFont('helvetica','bold');d.text('Contact: '+pdfSafe(r.contact),40,y)}
pdfFoot(d);d.save(slug(b.name)+'-rider.pdf')};
/* ----- mileage ----- */
const MF=[{p:'date',l:'Date',t:'date'},{p:'purpose',l:'Purpose',ph:'Show at Club Aqua'},{p:'from',l:'From'},{p:'to',l:'To'},{p:'miles',l:'Miles driven (one way or round trip total)',t:'num'}];
VIEWS.mileage=()=>{const c=CR(),y=isoD().slice(0,4),yr=c.miles.filter(m=>(m.date||'').slice(0,4)===y),mi=yr.reduce((s,m)=>s+(+m.miles||0),0),rate=+c.mileRate||0;
return '
Miles this year'+mi.toLocaleString('en-US')+'
Trips'+yr.length+'
Estimated deduction'+money(mi*rate)+'
'
+'
Rate per mile
Check the current rate with your tax professional. Mileage rules vary by country and situation.
'+F('crm',{p:'mileRate',l:'Rate ($ per mile)',t:'num',rc:1,step:'0.01',raw:0})+'
Set once per artist. Mark an income entry "exclude from commission" in Finance when it does not apply.
'+FS('crm.mgmt',[{p:'bookPct',l:'Live booking commission (%)',t:'num',rc:1},{p:'pct',l:'Other income commission (%)',t:'num',rc:1},{p:'managerName',l:'Your name or agency'}],'g3')+'
No income in this period. Record income in Finance and it shows here.
')+'
'};
ACT.stmtpdf=()=>{const d=newPdf();if(!d)return;const a=A(),m=mgmtOf(a),v=UIS['comm.p']||isoD().slice(0,4),s=statement(a,v);pdfHeader(d,'Artist statement',a.site.brand.name+' - '+perLabel(v));let y=125;d.setTextColor(20);d.setFontSize(10);
[['Gross income',money(s.gross)],['Commission',money(s.comm)],['Reimbursed expenses',money(s.reimb)],['Net due to artist',money(s.net)]].forEach((k,i)=>{d.setTextColor(100);d.text(k[0],40+i*135,y);d.setTextColor(20);d.setFont('helvetica','bold');d.setFontSize(14);d.text(k[1],40+i*135,y+20);d.setFont('helvetica','normal');d.setFontSize(10)});
y+=60;d.setFillColor(238,236,228);d.rect(40,y,532,20,'F');d.setFont('helvetica','bold');d.text('Date',46,y+14);d.text('Description',120,y+14);d.text('Amount',420,y+14,{align:'right'});d.text('Rate',470,y+14,{align:'right'});d.text('Commission',566,y+14,{align:'right'});d.setFont('helvetica','normal');y+=34;
s.lines.forEach(l=>{y=pdfY(d,y,16);d.text(fmtD(l.d),46,y);d.text(pdfSafe(l.t).slice(0,44),120,y);d.text(money(l.a),420,y,{align:'right'});if(l.kind==='in'){d.text(pct(l.rate),470,y,{align:'right'});d.text(money(l.comm),566,y,{align:'right'})}y+=16});
y=pdfY(d,y+20,80);d.setDrawColor(200);d.line(40,y-8,572,y-8);d.setFont('helvetica','bold');d.setFontSize(12);d.text('Net due to artist',420,y+10,{align:'right'});d.text(money(s.net),566,y+10,{align:'right'});d.setFont('helvetica','normal');d.setFontSize(9);d.setTextColor(110);d.text(pdfSafe('Commission: '+pct(nz(m.bookPct))+' on live bookings, '+pct(nz(m.pct))+' on other income. Prepared by '+(m.managerName||'management')+'.'),40,y+36);
pdfFoot(d);d.save(slug(a.site.brand.name)+'-statement-'+v+'.pdf')};
ACT.sharepack=()=>{const a=A(),v=UIS['comm.p']||isoD().slice(0,4),s=statement(a,v),up=a.site.tour.shows.filter(x=>x.date>=isoD()&&x.status!=='cancel').sort((p,q)=>p.date.localeCompare(q.date)),T=tokens(a.site.brand).vars;
const html=''+esc(a.site.brand.name)+' update
';
download(slug(a.site.brand.name)+'-artist-update.html',html,'text/html');toast('Artist update page downloaded')};
/* ----- management agreement ----- */
function buildTerms(a){const m=mgmtOf(a);return ['Term: '+nz(m.term)+' months starting '+(m.from?fmtD(m.from):'the date signed')+'. It renews for the same length unless either party gives 30 days written notice.','Services: Manager advises on career strategy, bookings, partnerships, releases and business affairs, and acts as the Artist\'s main business contact.','Commission on live bookings: '+nz(m.bookPct)+'% of gross fees. Commission on all other income earned during the term: '+nz(m.pct)+'% of gross. Commission is due within 15 days of the Artist or Manager receiving payment.','Exclusivity: '+(m.exclusive?'Manager is the Artist\'s exclusive manager during the term.':'Manager is non-exclusive. The Artist may work with other advisors.'),'Expenses: Only pre-approved expenses are reimbursed, and only from income received.','Accounting: Manager provides a statement of income, commission and expenses at least monthly. The Artist may review supporting records on request.','Termination: After the term ends, Manager keeps commission for '+nz(m.tail)+' months on deals made during the term.','Governing law: '+(m.state||'the state where the Manager is based')+'.'].join('\n')}
VIEWS.mgmt=()=>{const a=A(),m=mgmtOf(a);if(!m.terms)m.terms=buildTerms(a);
return '
Management agreement
An agreement between you and '+esc(a.site.brand.name)+'. This is a plain template, not legal advice. Have a lawyer review it before anyone signs.
'+FS('crm.mgmt',[{p:'managerName',l:'Manager or agency name'},{p:'managerEmail',l:'Manager email',t:'email'},{p:'artistLegal',l:'Artist legal name'},{p:'from',l:'Start date',t:'date'},{p:'term',l:'Term (months)',t:'num'},{p:'bookPct',l:'Live booking commission (%)',t:'num'},{p:'pct',l:'Other income commission (%)',t:'num'},{p:'tail',l:'Post-term commission (months)',t:'num'},{p:'state',l:'Governing state or country'}],'g3')+F('crm.mgmt',{p:'exclusive',l:'Exclusive management',t:'check'})+F('crm.mgmt',{p:'terms',l:'Terms (one per line)',t:'area',rows:11})+'
'};
ACT.mgmtrebuild=()=>{mgmtOf(A()).terms=buildTerms(A());save();render();toast('Terms rebuilt')};
ACT.mgmtpdf=()=>{const d=newPdf();if(!d)return;const a=A(),m=mgmtOf(a);pdfHeader(d,'Management agreement',a.site.brand.name);let y=130;d.setTextColor(20);d.setFontSize(11);
y=pdfPara(d,'This agreement is made on '+fmtD(m.from||isoD())+' between '+(m.managerName||'[Manager]')+' ("Manager") and '+(m.artistLegal||a.site.brand.name)+' ("Artist").',40,y,532,15)+10;
String(m.terms||'').split('\n').filter(x=>x.trim()).forEach((t,i)=>{y=pdfPara(d,(i+1)+'. '+t.trim(),40,y,532,15)+7});
y=pdfY(d,y+40,110);d.setDrawColor(60);sigImg(d,'manager',40,y);sigImg(d,'artist',330,y);d.line(40,y+40,260,y+40);d.line(330,y+40,550,y+40);d.setFontSize(10);d.text(pdfSafe('Manager: '+(m.managerName||'')),40,y+56);d.text(pdfSafe('Artist: '+(m.artistLegal||a.site.brand.name)),330,y+56);d.text('Date',40,y+72);d.text('Date',330,y+72);
pdfFoot(d);d.save(slug(a.site.brand.name)+'-management-agreement.pdf')};
/* ----- day sheets ----- */
const DSF=[{p:'day.loadin',l:'Load-in time'},{p:'day.sound',l:'Sound check'},{p:'day.doors',l:'Doors'},{p:'day.set',l:'Set time and length'},{p:'day.onsite',l:'Contact on site (name and phone)'},{p:'day.hotel',l:'Hotel or lodging'},{p:'day.travel',l:'Travel (flights, drive, pickup)'},{p:'day.notes',l:'Notes for the artist',t:'area',rows:3}];
VIEWS.daysheet=()=>{const sh=A().site.tour.shows.map((s,i)=>({s,i})).filter(x=>x.s.date>=isoD()&&x.s.status!=='cancel').sort((p,q)=>p.s.date.localeCompare(q.s.date));
return '
A one-page schedule for each show, so the artist knows where to be and when.
Upcoming shows
'+(sh.length?'
'+sh.map(({s,i})=>'
'+esc(s.venue||'Venue TBA')+''+fmtD(s.date)+', '+esc(s.city||'')+(s.day&&s.day.set?' · set '+esc(s.day.set):'')+'
').join('')+'
':'
No upcoming shows. Add one in Tour and shows.
')+'
'};
ACT.editday=b=>{const s=A().site.tour.shows[+b.dataset.i];entityModal('Day sheet: '+(s.venue||'show'),DSF,s,n=>{s.day=n.day||{};save();render()},null,'g2')};
function daySheetPDF(s,d,first){const b=A().site.brand,dy=s.day||{};if(!first)d.addPage();pdfHeader(d,s.venue||'Show day',b.name+' - '+fmtD(s.date)+(s.city?' - '+s.city:''));let y=135;d.setTextColor(20);
[['Load-in',dy.loadin],['Sound check',dy.sound],['Doors',dy.doors],['Set',dy.set],['On-site contact',dy.onsite],['Lodging',dy.hotel],['Travel',dy.travel]].forEach(r=>{d.setFontSize(10);d.setTextColor(100);d.text(r[0],40,y);d.setFontSize(13);d.setTextColor(20);d.text(pdfSafe(r[1]||'To be confirmed'),170,y);y+=26});
if(dy.notes){y+=10;d.setFont('helvetica','bold');d.setFontSize(12);d.text('Notes',40,y);y+=18;d.setFont('helvetica','normal');d.setFontSize(11);y=pdfPara(d,dy.notes,40,y,532,15)}}
ACT.daypdf=b=>{const d=newPdf();if(!d)return;const s=A().site.tour.shows[+b.dataset.i];daySheetPDF(s,d,true);pdfFoot(d);d.save(slug(s.venue||'show')+'-day-sheet.pdf')};
ACT.itinpdf=()=>{const d=newPdf();if(!d)return;const sh=A().site.tour.shows.filter(x=>x.date>=isoD()&&x.status!=='cancel').sort((p,q)=>p.date.localeCompare(q.date));if(!sh.length){toast('No upcoming shows to print');return}sh.forEach((s,i)=>daySheetPDF(s,d,i===0));pdfFoot(d);d.save(slug(A().site.brand.name)+'-schedule.pdf')};
/* ----- artist file ----- */
const PDOCS=['Management agreement signed','W-9 or tax form received','Payout details confirmed','Registered with a performing rights organization','Split sheets filed for every song','Rider on file','Press kit on file','ISRC and UPC codes created'];
const defProfile=a=>({legal:'',stage:a.site.brand.name,email:'',phone:'',address:'',pro:'',ipi:'',distributor:'',label:'',payout:'',payoutNote:'',emName:'',emPhone:'',notes:'',docs:PDOCS.map(()=>false)});
VIEWS.profile=()=>{const a=A();if(!a.crm.profile)a.crm.profile=defProfile(a);const p=a.crm.profile;const n=p.docs.filter(Boolean).length;
return '
Keep the details you need in one place. Do not store bank numbers or ID numbers here. This stays in your browser only.
'+FS('crm.profile',[{p:'legal',l:'Legal name'},{p:'stage',l:'Stage name'},{p:'email',l:'Email',t:'email'},{p:'phone',l:'Phone'},{p:'pro',l:'Rights organization',t:'select',o:[['','None or unknown'],['ASCAP','ASCAP'],['BMI','BMI'],['SESAC','SESAC'],['GMR','GMR'],['SOCAN','SOCAN'],['PRS','PRS'],['SGAE','SGAE']]},{p:'ipi',l:'IPI or member number'},{p:'distributor',l:'Distributor',ph:'DistroKid, TuneCore'},{p:'label',l:'Label or publisher'},{p:'payout',l:'Payout method',t:'select',o:[['','Not set'],['Zelle','Zelle'],['ACH','Bank transfer'],['PayPal','PayPal'],['Check','Check']]},{p:'payoutNote',l:'Payout contact (email or phone only)'}],'g3')+F('crm.profile',{p:'address',l:'Mailing address',t:'area',rows:2})+FS('crm.profile',[{p:'emName',l:'Emergency contact'},{p:'emPhone',l:'Emergency phone'}])+F('crm.profile',{p:'notes',l:'Private notes',t:'area',rows:3})+'
'};
ACT.profpdf=()=>{const d=newPdf();if(!d)return;const a=A(),p=a.crm.profile||defProfile(a);pdfHeader(d,'Artist info sheet',a.site.brand.name);let y=130;d.setTextColor(20);
[['Legal name',p.legal],['Stage name',p.stage],['Email',p.email],['Phone',p.phone],['Address',p.address],['Rights organization',p.pro],['IPI or member no.',p.ipi],['Distributor',p.distributor],['Label or publisher',p.label],['Payout method',p.payout],['Payout contact',p.payoutNote],['Emergency contact',[p.emName,p.emPhone].filter(Boolean).join(' ')]].forEach(r=>{d.setFontSize(10);d.setTextColor(100);d.text(r[0],40,y);d.setFontSize(12);d.setTextColor(20);d.text(pdfSafe(String(r[1]||'-').replace(/\n/g,', ')).slice(0,60),190,y);y+=24});
y+=10;d.setFont('helvetica','bold');d.setFontSize(12);d.text('Checklist',40,y);y+=20;d.setFont('helvetica','normal');d.setFontSize(11);PDOCS.forEach((x,i)=>{d.text((p.docs[i]?'[x] ':'[ ] ')+x,48,y);y+=18});
pdfFoot(d);d.save(slug(a.site.brand.name)+'-artist-file.pdf')};
/* ----- calculators ----- */
const CALCS=[
{id:'quote',t:'Booking quote',s:'Build a fee to quote a venue, including travel and agent commission.',f:[['base','Artist fee ($)',1500],['travel','Travel ($)',200],['prod','Sound and production ($)',0],['nights','Hotel nights',1],['rate','Hotel rate per night ($)',120],['days','Per diem days',1],['pd','Per diem per day ($)',50],['agent','Agent commission (%)',10]],c:v=>{const exp=v.travel+v.prod+v.nights*v.rate+v.days*v.pd,sub=v.base+exp,comm=v.base*v.agent/100;return[['Expenses to add',money(exp)],['Total quote to venue',money(sub)],['Agent commission',money(comm)],['Artist receives',money(v.base-comm)],['Deposit at 50%',money(sub/2)]]}},
{id:'door',t:'Door deal',s:'Guarantee against a percentage of the door. The artist is paid whichever is higher.',f:[['tix','Tickets sold',150],['price','Ticket price ($)',20],['costs','Venue costs ($)',800],['pct','Artist share of net (%)',70],['guar','Guarantee ($)',1000]],c:v=>{const gross=v.tix*v.price,net=Math.max(0,gross-v.costs),share=net*v.pct/100,pay=Math.max(share,v.guar);return[['Gross ticket sales',money(gross)],['Net after costs',money(net)],['Percentage payout',money(share)],['Artist is paid',money(pay)],['Paid by',share>=v.guar?'Percentage':'Guarantee'],['Tickets to hit the guarantee',v.price>0&&v.pct>0?String(Math.ceil((v.guar/(v.pct/100)+v.costs)/v.price)):'-']]}},
{id:'stream',t:'Streaming royalties',s:'A rough estimate. Real rates vary by service, country and listener.',f:[['n','Streams',100000],['rate','Pay per stream ($)',0.004],['dist','Distributor cut (%)',0],['share','Your share of the song (%)',100]],c:v=>{const g=v.n*v.rate,a=g*(1-v.dist/100)*(v.share/100);return[['Gross from streams',money(g)],['After distributor and your share',money(a)],['Per 1,000 streams',money(a/(v.n/1000||1))],['Streams to earn $1,000',v.rate>0?Math.ceil(1000/(v.rate*(1-v.dist/100)*(v.share/100||1))).toLocaleString('en-US'):'-']]}},
{id:'merch',t:'Merch margin',s:'See your profit and how many pieces you need to sell to cover the first order.',f:[['units','Units sold',100],['price','Sell price ($)',35],['cost','Cost per unit ($)',12],['fee','Store and payment fees (%)',5],['fixed','One-time costs, such as design ($)',300]],c:v=>{const unitNet=v.price*(1-v.fee/100)-v.cost,profit=unitNet*v.units-v.fixed;return[['Revenue',money(v.price*v.units)],['Profit per unit',money(unitNet)],['Total profit',money(profit)],['Margin',pct(v.price*v.units?profit/(v.price*v.units)*100:0)],['Units to break even',unitNet>0?String(Math.ceil(v.fixed/unitNet)):'Never at this price']]}},
{id:'tour',t:'Tour budget',s:'Plan a run of shows and find the lowest fee that still makes money.',f:[['n','Number of shows',8],['fee','Average fee ($)',1800],['travel','Travel per show ($)',150],['lodging','Lodging per show ($)',110],['crew','Crew per show ($)',200],['other','Other costs for the whole tour ($)',400],['agent','Agent commission (%)',10]],c:v=>{const cost=v.n*(v.travel+v.lodging+v.crew)+v.other,gross=v.n*v.fee,comm=gross*v.agent/100,net=gross-cost-comm;return[['Total fees',money(gross)],['Total costs',money(cost)],['Agent commission',money(comm)],['Tour profit',money(net)],['Profit per show',money(v.n?net/v.n:0)],['Lowest fee to break even',money(v.n?(cost/v.n)/(1-v.agent/100):0)]]}}
];
UIS.calc=UIS.calc||{};
function calcVals(c){const st=UIS.calc[c.id]=UIS.calc[c.id]||{};const v={};c.f.forEach(f=>{v[f[0]]=st[f[0]]==null?f[2]:st[f[0]]});return v}
function calcOut(c){const rows=c.c(calcVals(c));return rows.map((r,i)=>'
'+esc(r[0])+'
'+esc(r[1])+'
').join('')}
VIEWS.calcs=()=>'
Type in any box and the answer updates. Nothing here is saved to your records.
'+CALCS.map(c=>{const v=calcVals(c);return '
'+c.t+'
'+c.s+'
'+c.f.map(f=>'').join('')+'
'+calcOut(c)+'
'}).join('')+'
';
document.addEventListener('input',e=>{const t=e.target;if(!t.dataset||!t.dataset.calc)return;const c=CALCS.find(x=>x.id===t.dataset.calc);(UIS.calc[c.id]=UIS.calc[c.id]||{})[t.dataset.f]=parseFloat(t.value)||0;$('#CR-'+c.id).innerHTML=calcOut(c)});
ACT.rosteropen=b=>{DB.active=b.dataset.id;save();go('dash')};
/* ---------- batch 6: jump search, signatures, unpaid invoices, settings and currency, roster calendar ---------- */
Object.assign(IC,{settings:''});
/* ----- signatures ----- */
const SIGW={artist:'Artist',manager:'Manager',buyer:'Buyer'};
const sigLabel=w=>((A().crm.sig||{})[w]?'Re-sign as ':'Sign as ')+SIGW[w].toLowerCase();
function sigImg(d,w,x,y){const s=(A().crm.sig||{})[w];if(s){try{d.addImage(s,'PNG',x,y+2,150,36)}catch(e){}}}
let sigState={who:'',drawing:false,dirty:false};
ACT.sign=b=>{sigState={who:b.dataset.who,drawing:false,dirty:false};const has=(A().crm.sig||{})[sigState.who];
$('#modalBox').innerHTML='
Sign as '+SIGW[sigState.who].toLowerCase()+'
Draw your signature with your finger or mouse. It is added above the signature line in the PDF.
'+(has?'':'')+'
';
$('#modal').classList.add('on');const c=$('#sigPad'),g=c.getContext('2d');g.lineWidth=3;g.lineCap='round';g.lineJoin='round';g.strokeStyle='#111';
const pos=e=>{const r=c.getBoundingClientRect();return[(e.clientX-r.left)*c.width/r.width,(e.clientY-r.top)*c.height/r.height]};
c.onpointerdown=e=>{c.setPointerCapture(e.pointerId);sigState.drawing=true;sigState.dirty=true;const[p,q]=pos(e);g.beginPath();g.moveTo(p,q);g.lineTo(p+.1,q+.1);g.stroke()};
c.onpointermove=e=>{if(!sigState.drawing)return;const[p,q]=pos(e);g.lineTo(p,q);g.stroke()};
c.onpointerup=c.onpointercancel=()=>{sigState.drawing=false}};
ACT.sigclear=()=>{const c=$('#sigPad');c.getContext('2d').clearRect(0,0,c.width,c.height);sigState.dirty=false};
ACT.sigsave=()=>{if(!sigState.dirty){toast('Draw your signature first');return}const c=$('#sigPad');A().crm.sig=A().crm.sig||{};A().crm.sig[sigState.who]=c.toDataURL('image/png');closeModal();save();render();toast('Signature saved')};
ACT.sigremove=()=>{delete A().crm.sig[sigState.who];closeModal();save();render()};
/* ----- invoices: unpaid tracking ----- */
const invDue=x=>x.paid===false&&x.due&&x.duex.paid===false?''+(invDue(x)?'Overdue':'Unpaid')+'':'Paid';
ACT.invunpaid=()=>{const c=CRM(),i=c.invDraft,t=invTotals(i);if(!i.client.trim()||t.total<=0){toast('Add a client name and at least one priced line');return}c.invoices.push(Object.assign(clone(i),{paid:false}));c.invDraft=newInv();save();render();toast('Saved as unpaid. Mark it paid when the money arrives.')};
ACT.invpaid=b=>{const c=CRM(),x=c.invoices[+b.dataset.n];if(!x)return;const t=invTotals(x);x.paid=true;c.finance.push({id:uid(),date:isoD(),type:'income',cat:'Shows',amt:r2(t.total),desc:'Invoice '+x.no+' - '+x.client});save();render();toast('Marked paid and recorded '+money(t.total)+' as income')};
const _dash5=VIEWS.dash;
VIEWS.dash=()=>{const un=A().crm.invoices.map((x,n)=>({x,n})).filter(o=>o.x.paid===false).sort((p,q)=>(p.x.due||'').localeCompare(q.x.due||''));
const card=un.length?'
Unpaid invoices
'+money(un.reduce((s,o)=>s+invTotals(o.x).total,0))+' waiting to be paid.
'+un.slice(0,5).map(o=>'
'+esc(o.x.no)+' - '+esc(o.x.client)+''+money(invTotals(o.x).total)+', due '+fmtD(o.x.due)+'
'+invTag(o.x)+'
').join('')+'
':'';
return _dash5()+card};
ACT.invremind=b=>{const x=CRM().invoices[+b.dataset.n];UIS['tpl.id']='i1';UIS['tplv.venue']=x.client;UIS['tplv.date']=x.issue;const c=CRM().contacts.find(k=>k.email&&k.email===x.email);UIS['tpl.contact']=c?c.id:'';go('templates')};
/* ----- settings ----- */
const CURS=[['$','US dollar ($)'],['C$','Canadian dollar (C$)'],['MX$','Mexican peso (MX$)'],['€','Euro (€)'],['£','British pound (£)'],['R$','Brazilian real (R$)'],['COP$','Colombian peso (COP$)'],['¥','Yen or yuan (¥)']];
VIEWS.settings=()=>'
Money
Applies to every total, invoice and statement in the studio. It changes the symbol only. It does not convert amounts.
'
+'
Appearance
'
+'
Shortcuts
Ctrl K, or Cmd KJump to any tab or action, or switch artists
Plus buttonAdd a task, contact, note, show, trip or money entry from anywhere
');
ACT.calscope=()=>{UIS.calScope=UIS.calScope==='all'?'one':'all';render()};
/* ----- quick jump palette ----- */
let CMD={items:[],i:0};
function cmdItems(q){const items=[];TABS.forEach(g=>g[1].forEach(t=>items.push({l:t[1],s:g[0],run:()=>go(t[0])})));
QUICK.forEach(x=>items.push({l:'Add: '+x[0],s:'Quick add',run:()=>{if(tab!==x[1]&&false)go(x[1]);ACT[x[2]]()}}));
items.push({l:'Download website',s:'Action',run:downloadSite},{l:'Switch dark or light mode',s:'Action',run:ACT.dark},{l:'New artist',s:'Action',run:ACT.newart});
DB.artists.forEach(a=>{if(a.id!==DB.active)items.push({l:'Switch to '+a.site.brand.name,s:'Artist',run:()=>{DB.active=a.id;save();render()}})});
const w=q.toLowerCase().split(/\s+/).filter(Boolean);return items.filter(x=>w.every(k=>(x.l+' '+x.s).toLowerCase().includes(k))).slice(0,12)}
function cmdDraw(){const l=$('#cmdList');if(!l)return;l.innerHTML=CMD.items.length?CMD.items.map((x,i)=>'').join(''):'
Nothing matches. Try a tab name like finance or music.
'}
ACT.cmd=()=>{$('#modalBox').innerHTML='
Jump to
';modalSave=null;modalDel=null;$('#modal').classList.add('on');CMD={items:cmdItems(''),i:0};cmdDraw();setTimeout(()=>{const i=$('#cmdIn');if(i)i.focus()},30)};
ACT.cmdrun=b=>{const x=CMD.items[+b.dataset.i];closeModal();if(x)setTimeout(x.run,0)};
document.addEventListener('input',e=>{if(e.target.id==='cmdIn'){CMD.items=cmdItems(e.target.value);CMD.i=0;cmdDraw()}});
document.addEventListener('keydown',e=>{
if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()==='k'){e.preventDefault();ACT.cmd();return}
if(e.target.id==='cmdIn'){if(e.key==='ArrowDown'){e.preventDefault();CMD.i=Math.min(CMD.items.length-1,CMD.i+1);cmdDraw()}else if(e.key==='ArrowUp'){e.preventDefault();CMD.i=Math.max(0,CMD.i-1);cmdDraw()}else if(e.key==='Enter'){e.preventDefault();ACT.cmdrun({dataset:{i:CMD.i}})}}
});
(function(){const b=$('#cmdBtn');if(b)b.innerHTML=ico('search',16)})();
/* ---------- profession types: musician, DJ, dancer, actor, model ---------- */
Object.assign(IC,{
credits:'',
skills:'',
classes:'',
auditions:''
});
Object.assign(BLANKS,{credit:()=>({year:String(new Date().getFullYear()),title:'',role:'',company:'',kind:'Film',url:''}),stat:()=>({k:'',v:''}),klass:()=>({name:'',level:'All levels',day:'',time:'',when:'',price:'',desc:'',url:'',btn:'Enroll'})});
const TYPES={
musician:{n:'Musician',d:'Songs, videos, shows and bookings',show:['hero','music','videos','about','tour','gallery','social','contact'],labels:{},titles:{},themes:['gold','neon','editorial','forest'],hero:n=>n+', *live*',sub:'',badge:'New single out now',cta:['Listen now','#music','Book a show','#contact']},
dj:{n:'DJ or producer',d:'Mixes, sets, gigs and packages',show:['hero','music','videos','about','tour','packages','social','contact'],labels:{music:'Mixes',tour:'Gigs',packages:'Book me'},titles:{music:'Mixes and sets',tour:'Gigs',packages:'Book a set',videos:'Sets on video'},themes:['street','neon','aurora','mono'],hero:n=>n+', *all night*',sub:'Sets built for the room.',badge:'Booking now',cta:['Hear a mix','#music','Book me','#contact']},
dancer:{n:'Dancer or choreographer',d:'Reel, credits, classes and bookings',show:['hero','videos','about','credits','skills','tour','classes','gallery','social','contact'],labels:{videos:'Reel',tour:'Shows',classes:'Classes',gallery:'Photos'},titles:{videos:'Performance reel',tour:'Upcoming performances',gallery:'Photos',credits:'Credits',skills:'Training and skills',classes:'Classes and workshops',about:'About'},themes:['blush','tango','aurora','mono'],hero:n=>n+', *in motion*',sub:'Dancer, choreographer and teacher.',badge:'Available for bookings',cta:['Watch the reel','#videos','Book or enroll','#contact'],stats:[['Height',''],['Styles',''],['Experience',''],['Languages',''],['Based in','']],tags:'Contemporary, Hip hop, Jazz, Ballet, Latin, Choreography',kinds:['Choreography','Tour','Music video','Theatre','Commercial','Film']},
actor:{n:'Actor',d:'Headshots, reel, resume and representation',show:['hero','videos','about','credits','skills','tour','gallery','social','contact'],labels:{videos:'Reel',gallery:'Headshots',tour:'Upcoming',credits:'Resume'},titles:{videos:'Demo reel',gallery:'Headshots',tour:'Upcoming work',credits:'Resume',skills:'Details and skills',about:'About'},themes:['noir','cinema','curtain','editorial'],hero:n=>n,sub:'Actor.',badge:'Represented. See contact.',cta:['Watch the reel','#videos','Contact my agent','#contact'],stats:[['Height',''],['Hair',''],['Eyes',''],['Voice range',''],['Languages',''],['Union','']],tags:'Stage combat, Accents, Improv, Singing',kinds:['Film','Television','Theatre','Commercial']},
model:{n:'Model or creator',d:'Portfolio, stats, campaigns and bookings',show:['hero','gallery','videos','about','credits','skills','social','contact'],labels:{gallery:'Portfolio',credits:'Campaigns',skills:'Stats',videos:'Showreel'},titles:{gallery:'Portfolio',videos:'Showreel',credits:'Selected campaigns',skills:'Measurements and stats',about:'About'},themes:['mono','blush','cinema','sunset'],hero:n=>n,sub:'Model and creator.',badge:'Available for bookings',cta:['View portfolio','#gallery','Book me','#contact'],stats:[['Height',''],['Chest or bust',''],['Waist',''],['Hips',''],['Shoes',''],['Hair',''],['Eyes','']],tags:'',kinds:['Campaign','Commercial','Film','Other']}
};
const typeOf=a=>TYPES[(a||A()).type]?(a||A()).type:'musician';
const TAB_ONLY={credits:['dancer','actor','model'],skills:['dancer','actor','model'],classes:['dancer','actor','dj','musician'],auditions:['dancer','actor','model']};
const TAB_HIDE={music:['dancer','actor','model'],setlists:['dancer','actor','model'],splits:['dancer','actor','model'],releases:['dancer','actor','model']};
const TAB_LBL={dj:{music:'Mixes',tour:'Gigs and shows',packages:'Booking packages'},dancer:{videos:'Performance reel',gallery:'Photos',tour:'Performances',credits:'Credits and resume',skills:'Training and skills',classes:'Classes and workshops'},actor:{videos:'Demo reel',gallery:'Headshots',tour:'Upcoming work',credits:'Resume and credits',skills:'Details and skills'},model:{gallery:'Portfolio',videos:'Showreel',credits:'Campaigns',skills:'Measurements and stats',tour:'Bookings'}};
const tv=(id,ty)=>(!TAB_ONLY[id]||TAB_ONLY[id].includes(ty))&&(!TAB_HIDE[id]||!TAB_HIDE[id].includes(ty));
function tabsFor(){const ty=DB&&DB.artists.length?typeOf():'musician';return TABS0.map(g=>[g[0],g[1].filter(t=>tv(t[0],ty)).map(t=>[t[0],(TAB_LBL[ty]&&TAB_LBL[ty][t[0]])||t[1]])])}
function applyType(a,type,fresh){const P=TYPES[type]||TYPES.musician,s=a.site;a.type=type;s.layout.labels=Object.assign({},P.labels);
Object.entries(P.titles).forEach(([id,t])=>{if(s[id])s[id].title=t});
const hid={};SEC.forEach(x=>{if(!P.show.includes(x[0]))hid[x[0]]=true});s.layout.hidden=hid;
s.layout.order=[...new Set([...P.show,...SEC.map(x=>x[0])])];
if(type==='model')s.layout.order=['hero','gallery','videos','about','credits','skills','tour','classes','music','merch','packages','faq','social','newsletter','contact'];
if(fresh){const n=s.brand.name;s.hero.title=P.hero(n);s.hero.sub=P.sub;s.hero.badge=P.badge;[s.hero.cta1t,s.hero.cta1u,s.hero.cta2t,s.hero.cta2u]=P.cta;s.brand.theme=P.themes[0];
if(P.stats&&!s.skills.stats.length)s.skills.stats=P.stats.map(x=>({k:x[0],v:x[1]}));if(P.tags&&!s.skills.tags)s.skills.tags=P.tags}}
function typeChecks(a,s){const ty=typeOf(a);if(['dancer','actor','model'].includes(ty))return[['Photos or headshots',s.gallery.images.some(i=>i.src),'gallery'],['Credits listed',s.credits.items.some(i=>i.title),'credits'],['Skills and stats filled in',s.skills.stats.some(x=>x.v),'skills']];
return[['At least one song or mix',s.music.tracks.some(t=>t.url),'music'],['A music platform link',s.music.platforms.some(p=>p.h),'music']]}
function typeCard(){const a=A();return '
Profession
Changes which tabs you see and how your website is organized. Your content is never deleted.
Website layout
'}
ACT.applytype=()=>{const a=A();applyType(a,typeOf(a),false);render();touch();toast('Sections and titles set for '+TYPES[typeOf(a)].n.toLowerCase())};
/* ----- website tabs for dancers, actors and models ----- */
const KINDS=['Film','Television','Theatre','Commercial','Music video','Choreography','Tour','Campaign','Other'];
VIEWS.credits=()=>secBar('credits')+'
They are grouped by type on your site, newest first.
'+REP('site.credits.items',[{p:'title',l:'Title of the project'},{p:'year',l:'Year'},{p:'kind',l:'Type',t:'select',o:KINDS.map(k=>[k,k])},{p:'role',l:'Role or position'},{p:'company',l:'Company, director or choreographer'},{p:'url',l:'Link (optional)',t:'url'}],{title:i=>i.title,sub:i=>[i.year,i.role].filter(Boolean).join(', '),add:'Add a credit',blank:'credit',sort:false,empty:'No credits yet.'})+'
Height, hair, eyes, union status, languages, anything a casting or booking contact checks first.
'+REP('site.skills.stats',[{p:'k',l:'Label'},{p:'v',l:'Value'}],{title:i=>i.k,sub:i=>i.v,add:'Add a stat',blank:'stat',empty:'No stats yet.'})+'
Skills
'+F('site.skills',{p:'tags',l:'Skills (separate with commas)',t:'area',rows:3,h:'Example: Stage combat, Accents, Ballet, Hip hop, Improv'})+'
';
VIEWS.classes=()=>secBar('classes','Shows classes or workshops with a price and an enroll button.')+secBar('schedule','Weekly timetable. Give a class a day and time and it appears here automatically.')+'
'+REP('site.classes.items',[{p:'name',l:'Class name'},{p:'level',l:'Level',ph:'Beginner, All levels'},{p:'day',l:'Day (adds it to the timetable)',t:'select',o:[['','No day']].concat(['Mon','Tue','Wed','Thu','Fri','Sat','Sun'].map(d=>[d,d]))},{p:'time',l:'Time',ph:'7:00 PM'},{p:'when',l:'When (free text shown on the card)',ph:'Tuesdays 7 PM'},{p:'price',l:'Price',ph:'$20 drop-in'},{p:'btn',l:'Button text'},{p:'url',l:'Sign-up link (blank scrolls to contact)',t:'url'},{p:'desc',l:'Description',t:'area',rows:3}],{title:i=>i.name,sub:i=>i.when,add:'Add a class',blank:'klass',empty:'No classes yet.'})+'
'+esc(x.role||'Untitled')+''+esc(x.project||'')+(x.date?' · '+fmtD(x.date):'')+(x.tape?' · tape due '+fmtD(x.tape):'')+'
'+(AST.find(s=>s[0]===x.status)||[])[1]+'
').join('')+'
':'
Nothing tracked yet. Add your next audition.
')+'
'};
ACT.newaud=()=>entityModal('New audition or booking',AUF,{id:uid(),role:'',project:'',kind:'Audition',status:'submitted',date:'',tape:'',casting:'',link:'',notes:''},x=>{if(!x.role.trim()){toast('Add the role or job first');return false}A().crm.auditions.push(x);save();render()},null,'g2');
ACT.editaud=b=>{const x=A().crm.auditions.find(y=>y.id===b.dataset.id);if(!x)return;entityModal('Edit audition',AUF,x,n=>{Object.assign(x,n);save();render()},()=>{A().crm.auditions=A().crm.auditions.filter(y=>y!==x);save();render()},'g2')};
const _ce=calEvents;calEvents=function(){const ev=_ce(),all=UIS.calScope==='all';(all?DB.artists:[A()]).forEach(a=>(a.crm.auditions||[]).forEach(x=>{[[x.date,'Audition: '],[x.tape,'Self-tape due: ']].forEach(([d,p])=>{if(d)(ev[d]=ev[d]||[]).push(all?{c:'k',t:a.site.brand.name+': '+p+x.role,a:'',id:''}:{c:'k',t:p+x.role,a:'editaud',id:x.id})})}));return ev};
const _dash6=VIEWS.dash;
VIEWS.dash=()=>{const up=(A().crm.auditions||[]).filter(x=>!['booked','passed'].includes(x.status)&&((x.date&&x.date>=isoD())||(x.tape&&x.tape>=isoD()))).sort((p,q)=>(p.date||p.tape).localeCompare(q.date||q.tape)).slice(0,4);
return _dash6()+(up.length?'
Coming up: auditions and bookings
'+up.map(x=>'
'+esc(x.role)+''+esc(x.project||'')+' '+(x.date?'on '+fmtD(x.date):'self-tape due '+fmtD(x.tape))+'
').join('')+'
':'')};
/* ----- extra email templates and calculators ----- */
TPLS.push({id:'a1',name:'Audition or casting follow-up',subject:'Thank you for seeing me: {{venue}}',body:'Hi {{name}},\n\nThank you for the opportunity to read for {{venue}}. I enjoyed it and would love to be part of the project.\n\nPlease let me know if you need anything else from me.\n\nBest,\n{{artist}}'},
{id:'c1',name:'Choreography or booking inquiry reply',subject:'Re: {{venue}} on {{date}}',body:'Hi {{name}},\n\nThank you for thinking of me for {{venue}}. I am interested. Could you share the dates, rehearsal schedule, number of dancers or performers, and your budget?\n\nOnce I have those I can confirm availability and send a quote.\n\nBest,\n{{artist}}\n{{myemail}}'},
{id:'s1',name:'Class or workshop confirmation',subject:'You are signed up: {{venue}}',body:'Hi {{name}},\n\nYou are confirmed for {{venue}} on {{date}}. Please arrive 10 minutes early with water and comfortable clothes.\n\nSee you there,\n{{artist}}'});
CALCS.push({id:'class',t:'Class income',s:'Estimate what a weekly class or workshop series earns after the studio takes its share.',f:[['stu','Students per class',12],['price','Price per student ($)',20],['cls','Classes per month',8],['rent','Studio share or rent (%)',30]],c:v=>{const g=v.stu*v.price*v.cls,net=g*(1-v.rent/100);return[['Gross per month',money(g)],['After studio share',money(net)],['Per class',money(v.cls?net/v.cls:0)],['Per year',money(net*12)]]}},
{id:'dayrate',t:'Day rate',s:'Quote a booking by the day, with overtime, usage and agent commission.',f:[['rate','Day rate ($)',800],['days','Days',3],['ot','Overtime hours',4],['otr','Overtime rate per hour ($)',120],['use','Usage or buyout fee ($)',500],['agent','Agent commission (%)',10]],c:v=>{const g=v.rate*v.days+v.ot*v.otr+v.use,comm=g*v.agent/100;return[['Total booking',money(g)],['Agent commission',money(comm)],['You receive',money(g-comm)],['Average per day',money(v.days?(g-comm)/v.days:0)]]}});
PALETTES.push(['Blush Studio','#FBEDEA','#3A1F26','#C2476B','#F2A7B8'],['Film Noir','#0D0D0F','#EDEDED','#F2F2F2','#B3202A'],['Stage Gold','#2B0A12','#FBEFE3','#E0B04A','#B5122F'],['Aurora','#08121F','#E9F3FF','#7CF0C8','#8B7CFF']);
/* ----- sample artists ----- */
function demoDancer(){const a=newArtist('Mara Quinn','dancer'),s=a.site;s.brand.tagline='Contemporary dancer, choreographer and teacher';s.hero.sub='Contemporary and Latin dance. Available for tours, videos, stage and commercial work.';
s.videos.items=[{title:'2026 performance reel',url:'https://www.youtube.com/watch?v=dQw4w9WgXcQ'},{title:'Choreography: Midnight Dance',url:'https://www.youtube.com/watch?v=9bZkp7q19f0'}];
s.about.body='Mara trained in ballet and contemporary before moving into commercial and Latin styles. She has danced on tours, in music videos and on stage, and teaches weekly classes in Orlando.\n\nShe loves building movement with artists who want something specific and a little unexpected.';
s.about.facts=[{k:'Years dancing',v:'17'},{k:'Tours',v:'4'},{k:'Students taught',v:'600+'}];
s.credits.items=[{year:'2026',title:'Midnight Tour',kind:'Tour',role:'Featured dancer',company:'Artist TBA',url:''},{year:'2025',title:'Calle Sola (music video)',kind:'Music video',role:'Lead dancer',company:'Dir. R. Soto',url:''},{year:'2025',title:'Winter Showcase',kind:'Choreography',role:'Choreographer',company:'Harbor Dance Co.',url:''},{year:'2024',title:'Carmen (stage)',kind:'Theatre',role:'Ensemble',company:'City Opera',url:''},{year:'2023',title:'Sunrise Sneakers',kind:'Commercial',role:'Dancer',company:'Agency North',url:''}];
const sv={Height:'5\'7"',Styles:'Contemporary, Latin, Hip hop',Experience:'17 years','Languages':'English, Spanish','Based in':'Orlando, FL'};s.skills.stats=Object.keys(sv).map(k=>({k,v:sv[k]}));
s.classes.items=[{name:'Contemporary technique',level:'Intermediate',when:'Tuesdays 7 PM',price:'$20 drop-in',desc:'Floor work, turns and phrases. Bring water and a towel.',url:'',btn:'Reserve a spot'},{name:'Latin rhythms workshop',level:'All levels',when:'First Saturday, 11 AM',price:'$35',desc:'Salsa and bachata basics in a relaxed room.',url:'',btn:'Reserve a spot'}];
s.tour.shows=[{date:dOff(14),venue:'Harbor Theatre',city:'Orlando, FL',status:'on',url:'https://example.com/tickets',pub:true,fee:900,deposit:300,costs:0,paid:false,notes:''},{date:dOff(45),venue:'Latin Dance Festival',city:'Miami, FL',status:'tba',url:'',pub:true,fee:1500,deposit:0,costs:150,paid:false,notes:''}];
s.social.links=[{k:'instagram',h:'mara.moves'},{k:'tiktok',h:'mara.moves'},{k:'youtube',h:'maramoves'}];s.contact={title:'Book or take a class',intro:'Choreography, performances, teaching and classes.',email:'[email protected]',phone:'',mgmt:'',btn:'Send message',endpoint:''};
a.crm.auditions=[{id:uid(),role:'Featured dancer',project:'Summer tour',kind:'Audition',status:'callback',date:dOff(6),tape:'',casting:'Pro Dance Casting',link:'',notes:'Bring heels and sneakers.'},{id:uid(),role:'Music video dancer',project:'Neon (video)',kind:'Self-tape',status:'submitted',date:'',tape:dOff(3),casting:'',link:'',notes:''}];
a.crm.tasks=[{id:uid(),title:'Update reel with 2026 footage',due:dOff(4),done:false,pri:'normal',notes:'',link:''}];
a.crm.contacts=[{id:uid(),name:'Rafael Soto',type:'collab',company:'Soto Films',email:'[email protected]',phone:'',social:'',notes:'Director, music videos.',last:dOff(-9)}];
a.crm.finance=[{id:uid(),date:dOff(-5),type:'income',cat:'Teaching',desc:'October classes',amt:960},{id:uid(),date:dOff(-12),type:'income',cat:'Shows',desc:'Tour week',amt:1400},{id:uid(),date:dOff(-8),type:'expense',cat:'Gear',desc:'Shoes and rehearsal wear',amt:110}];
return a}
function demoActor(){const a=newArtist('Julian Reyes','actor'),s=a.site;s.brand.tagline='Actor for film, television and stage';s.hero.sub='Film, television and stage. Bilingual in English and Spanish.';
s.videos.items=[{title:'Demo reel 2026',url:'https://www.youtube.com/watch?v=dQw4w9WgXcQ'},{title:'Scene: The Long Night',url:'https://www.youtube.com/watch?v=9bZkp7q19f0'}];
s.about.body='Julian is an actor based in Orlando. He trained at a conservatory and works across independent film, television guest roles and regional theatre.\n\nHe is comfortable in drama and comedy, and fully bilingual.';
s.about.press=[{name:'Stage Left Review',quote:'Quietly magnetic. You cannot look away.',url:''}];
s.credits.items=[{year:'2026',title:'The Long Night',kind:'Film',role:'Lead, Daniel',company:'Dir. A. Park',url:''},{year:'2025',title:'Harbor Lights',kind:'Television',role:'Guest star, Det. Moreno',company:'Network drama',url:''},{year:'2025',title:'Our Town',kind:'Theatre',role:'George Gibbs',company:'Regional Playhouse',url:''},{year:'2024',title:'Sunrise Coffee',kind:'Commercial',role:'Principal',company:'National spot',url:''},{year:'2023',title:'Paper Boats',kind:'Film',role:'Supporting, Mateo',company:'Dir. L. Cruz',url:''}];
const sv={Height:'5\'11"',Hair:'Dark brown',Eyes:'Brown','Voice range':'Baritone',Languages:'English, Spanish (native)',Union:'SAG-AFTRA eligible'};s.skills.stats=Object.keys(sv).map(k=>({k,v:sv[k]}));s.skills.tags='Stage combat, Accents, Improv, Guitar, Driving';
s.tour.shows=[{date:dOff(20),venue:'Regional Playhouse: Opening night',city:'Orlando, FL',status:'on',url:'https://example.com/tickets',pub:true,fee:0,deposit:0,costs:0,paid:false,notes:''}];
s.social.links=[{k:'instagram',h:'julianreyes.actor'},{k:'youtube',h:'julianreyes'},{k:'linkedin',h:'julianreyes'}];s.contact={title:'Representation and booking',intro:'For auditions, bookings and press, please contact my agent.',email:'[email protected]',phone:'',mgmt:'Represented by North Talent',btn:'Send message',endpoint:''};
a.crm.auditions=[{id:uid(),role:'Lead, Marcus',project:'Indie feature',kind:'Self-tape',status:'submitted',date:'',tape:dOff(2),casting:'Cruz Casting',link:'',notes:'Two scenes, slate first.'},{id:uid(),role:'Guest star',project:'Procedural drama',kind:'Callback',status:'callback',date:dOff(8),tape:'',casting:'Network casting',link:'',notes:'Bring a hard copy of the sides.'},{id:uid(),role:'Principal',project:'Soda commercial',kind:'Booking',status:'booked',date:dOff(15),tape:'',casting:'',link:'',notes:'Fitting at 8 AM.'}];
a.crm.contacts=[{id:uid(),name:'Dana Cruz',type:'collab',company:'Cruz Casting',email:'[email protected]',phone:'',social:'',notes:'Casting director.',last:dOff(-4)}];
a.crm.finance=[{id:uid(),date:dOff(-6),type:'income',cat:'Shows',desc:'Guest star residuals',amt:1250},{id:uid(),date:dOff(-14),type:'income',cat:'Other income',desc:'Commercial buyout',amt:2400},{id:uid(),date:dOff(-9),type:'expense',cat:'Marketing',desc:'Headshots session',amt:350}];
return a}
const SAMPLES={musician:()=>demoArtist(),dancer:demoDancer,actor:demoActor};
/* ----- add-artist wizard with profession ----- */
let WZ2={type:'musician',k:'gold'};
function wizard(){WZ2={type:'musician',k:TYPES.musician.themes[0]};wzDraw();$('#modal').classList.add('on');setTimeout(()=>{const n=$('#wzName');if(n)n.focus()},50)}
function wzDraw(){const nm=($('#wzName')||{}).value||'',chk=($('#wzSample')||{}).checked;const P=TYPES[WZ2.type],rec=P.themes,order=rec.concat(Object.keys(THEMES).filter(k=>!rec.includes(k)));
const tiles=order.map(k=>{const x=THEMES[k],F0=FONT_LIB[x.fd];return ''}).join('');
$('#modalBox').innerHTML='
Pick a website style. Suggested ones fit this profession. You can change it any time.
'+tiles+'
'+(SAMPLES[WZ2.type]?'':'')+''}
ACT.wzType=b=>{WZ2.type=b.dataset.t;WZ2.k=TYPES[WZ2.type].themes[0];wzDraw();const n=$('#wzName');if(n)n.focus()};
ACT.wzTheme=b=>{WZ2.k=b.dataset.k;$$('#modalBox .thm[data-act=wzTheme]').forEach(t=>t.classList.toggle('on',t===b))};
ACT.wzCreate=()=>{const name=($('#wzName').value||'').trim();if(!name){toast('Add a name first');$('#wzName').focus();return}
const sm=$('#wzSample');let x;if(sm&&sm.checked&&SAMPLES[WZ2.type]){x=SAMPLES[WZ2.type]();x.id=uid();x.name=name;x.site.brand.name=name;x.site.hero.title=TYPES[WZ2.type].hero(name)}else x=newArtist(name,WZ2.type);
x.site.brand.theme=WZ2.k;x.site.brand.colors={bg:'',ink:'',accent:'',accent2:''};DB.artists.push(x);DB.active=x.id;closeModal();tab='brand';save();render();toast(name+' created as '+TYPES[WZ2.type].n.toLowerCase()+'. Pick colors and fonts next.')};
/* ---------- dance instructor type, students tab, more styles ---------- */
Object.assign(THEMES,{
studio:{n:'Open Studio',d:'Sage and white, bright and welcoming',c:{bg:'#F4F8F3',bg2:'#E6EEE4',card:'#FFFFFF',ink:'#1F3326',muted:'#667A6C',accent:'#2F7D55',accent2:'#F2B544',line:'#DCE6DA',line2:'#C3D3C1'},fd:'Fraunces',fb:'DM Sans',r:18,hero:'split',card:'raised',btn:'pill'},
barre:{n:'Barre Brass',d:'Charcoal studio walls with a brass rail',c:{bg:'#1D1D1F',bg2:'#252528',card:'#2E2E32',ink:'#F4EFE6',muted:'#A9A398',accent:'#D1A24A',accent2:'#8FB8A8',line:'#38383D',line2:'#4C4C52'},fd:'Cormorant Garamond',fb:'Outfit',r:8,hero:'center',card:'outline',btn:'r'},
pop:{n:'Pop Class',d:'Sunny yellow and ink, great for kids and groups',c:{bg:'#FFF6D6',bg2:'#FFEBA6',card:'#FFFFFF',ink:'#1B1B2F',muted:'#66607A',accent:'#E4405F',accent2:'#3B5BDB',line:'#F2DE9A',line2:'#E0C86A'},fd:'Syne',fb:'Outfit',r:20,hero:'left',card:'raised',btn:'pill'}
});
Object.assign(IC,{students:''});
TYPES.instructor={n:'Dance instructor',d:'Classes, passes, students and studio bookings',show:['hero','classes','schedule','packages','about','credits','videos','gallery','faq','social','contact'],labels:{classes:'Classes',packages:'Class passes',credits:'Training',faq:'Questions'},titles:{classes:'Weekly classes',schedule:'Weekly timetable',packages:'Class passes and private lessons',credits:'Training and experience',skills:'About my teaching',about:'Meet your teacher',videos:'Watch a class',gallery:'In the studio',faq:'Before your first class'},themes:['studio','pop','barre','blush'],hero:n=>n+': dance classes',sub:'Friendly, clear teaching for every level. Your first class is a great place to start.',badge:'New students welcome',cta:['See classes','#classes','Book a trial','#contact'],stats:[['Years teaching',''],['Ages',''],['Styles',''],['Class size',''],['Studio','']],tags:'Beginners welcome, Kids, Teens, Adults, Private lessons, Choreography',kinds:['Teaching','Certification','Performance','Training']};
KINDS.push('Teaching','Certification','Training','Performance');
['credits','skills'].forEach(k=>TAB_ONLY[k].push('instructor'));TAB_ONLY.students=['instructor','dancer'];
['music','setlists','splits','releases'].forEach(k=>TAB_HIDE[k].push('instructor'));
TAB_LBL.instructor={credits:'Training and experience',skills:'Teaching details',classes:'Classes and schedule',packages:'Passes and privates',videos:'Class videos',gallery:'Studio photos',tour:'Events and recitals',faq:'FAQ'};
TAB_LBL.dancer.students='Students';
(()=>{const g=TABS0.find(x=>x[0]==='Business');if(g&&!g[1].some(t=>t[0]==='students'))g[1].splice(g[1].findIndex(t=>t[0]==='auditions')+1,0,['students','Students and passes'])})();
PV.students='';
const _tc2=typeChecks;typeChecks=function(a,s){if(typeOf(a)==='instructor')return[['At least one class listed',s.classes.items.some(i=>i.name),'classes'],['A class pass or private lesson price',s.packages.items.some(i=>i.name),'packages'],['Photos of the studio',s.gallery.images.some(i=>i.src),'gallery']];return _tc2(a,s)};
/* ----- students ----- */
const STF=[{p:'name',l:'Student name'},{p:'level',l:'Level',t:'select',o:['Beginner','Intermediate','Advanced','Kids','Teens','Adult','Private'].map(x=>[x,x])},{p:'email',l:'Email'},{p:'phone',l:'Phone'},{p:'guardian',l:'Parent or guardian (if under 18)'},{p:'bday',l:'Birthday',t:'date'},{p:'plan',l:'Plan',ph:'10 class pass'},{p:'pass',l:'Classes in a pass',t:'num'},{p:'price',l:'Pass price ($)',t:'num'},{p:'left',l:'Classes left',t:'num'},{p:'active',l:'Active student',t:'check'},{p:'notes',l:'Notes (injuries, goals, allergies)',t:'area',rows:3}];
const stNew=()=>({id:uid(),name:'',level:'Beginner',email:'',phone:'',guardian:'',bday:'',plan:'10 class pass',pass:10,price:150,left:10,active:true,notes:'',joined:isoD(),att:[]});
const stSave=(x,isNew)=>{if(!String(x.name).trim()){toast('Add a name first');return false}x.pass=+x.pass||0;x.price=+x.price||0;x.left=+x.left||0;if(isNew)A().crm.students.push(x);save();render()};
VIEWS.students=()=>{const l=A().crm.students,act=l.filter(x=>x.active!==false),low=act.filter(x=>x.left<=1),m=isoD().slice(0,7),att=l.reduce((n,x)=>n+(x.att||[]).filter(d=>d.slice(0,7)===m).length,0),bd=act.filter(x=>x.bday&&x.bday.slice(5,7)===m.slice(5,7));
return '
Active students'+act.length+'
Passes running low'+low.length+'
Check-ins this month'+att+'
Birthdays this month'+bd.length+'
Keep track of each student, how many classes are left on their pass, and when to remind them.
'};
const stGet=b=>A().crm.students.find(x=>x.id===b.dataset.id);
ACT.newst=()=>{const x=stNew();entityModal('New student',STF,x,n=>stSave(Object.assign(x,n),true),null,'g2')};
ACT.stedit=b=>{const x=stGet(b);if(!x)return;entityModal('Edit student',STF,x,n=>stSave(Object.assign(x,n)),()=>{A().crm.students=A().crm.students.filter(y=>y!==x);save();render()},'g2')};
ACT.stcheck=b=>{const x=stGet(b);if(!x)return;if(x.left<=0&&!confirm(x.name+' has no classes left. Check in anyway?'))return;x.left=Math.max(0,x.left-1);(x.att=x.att||[]).push(isoD());save();render();toast(x.name+' checked in. '+x.left+' left')};
ACT.strenew=b=>{const x=stGet(b);if(!x)return;x.left+=x.pass||0;if(x.price>0)A().crm.finance.push({id:uid(),date:isoD(),type:'income',cat:'Teaching',desc:'Class pass: '+x.name,amt:x.price});save();render();toast('Renewed. '+x.left+' classes left'+(x.price>0?' and the payment was added to Finance':''))};
ACT.stremind=b=>{const x=stGet(b);if(!x)return;const to=x.email,me=A().site.brand.name;if(!to){toast('Add an email for '+x.name+' first');return}location.href='mailto:'+encodeURIComponent(to)+'?subject='+encodeURIComponent('Your class pass')+'&body='+encodeURIComponent('Hi '+(x.guardian||x.name)+',\n\n'+(x.left>0?x.name+' has '+x.left+' class'+(x.left===1?'':'es')+' left on the current pass.':x.name+' has used all classes on the current pass.')+' Let me know if you would like to renew.\n\nThank you,\n'+me)};
CSVCOLS.students=['name','level','email','phone','guardian','bday','plan','left','price','joined','notes'];
const _dash7=VIEWS.dash;
VIEWS.dash=()=>{const l=(A().crm.students||[]).filter(x=>x.active!==false&&x.left<=1);return _dash7()+(l.length?'
Students who need a new pass
'+l.slice(0,5).map(x=>'
'+esc(x.name)+''+x.left+' class'+(x.left===1?'':'es')+' left
').join('')+'
':'')};
const _ce2=calEvents;calEvents=function(){const ev=_ce2();if(UIS.calScope!=='all'){const y=new Date().getFullYear();(A().crm.students||[]).filter(x=>x.bday&&x.active!==false).forEach(x=>{[y,y+1].forEach(yy=>{const d=yy+x.bday.slice(4);(ev[d]=ev[d]||[]).push({c:'k',t:'Birthday: '+x.name,a:'stedit',id:x.id})})})}return ev};
/* ----- templates, calculators, palettes ----- */
TPLS.push({id:'t1',name:'Trial class follow-up',subject:'Thank you for trying {{venue}}',body:'Hi {{name}},\n\nIt was lovely to have you in {{venue}}. I hope you enjoyed it. If you would like to keep going, I have class passes and a weekly schedule ready for you.\n\nHope to see you again soon,\n{{artist}}'},
{id:'t2',name:'Class pass running low',subject:'Your class pass',body:'Hi {{name}},\n\nJust a friendly note that your class pass is almost used up. Reply here and I will set up a renewal so your spot stays open.\n\nThank you,\n{{artist}}'},
{id:'t3',name:'Recital or showcase info',subject:'{{venue}} details for {{date}}',body:'Hi {{name}},\n\nHere are the details for {{venue}} on {{date}}: call time, costume and where to park will follow in a separate message. Please confirm attendance by reply.\n\nThank you,\n{{artist}}'});
CALCS.push({id:'pass',t:'Class pass pricing',s:'Work out the price per class and how much a discount costs you.',f:[['n','Classes in the pass',10],['price','Pass price ($)',150],['drop','Drop-in price ($)',20]],c:v=>{const per=v.n?v.price/v.n:0,full=v.n*v.drop;return[['Price per class',money(per)],['Value at drop-in',money(full)],['Discount given',money(Math.max(0,full-v.price))],['Discount percent',(full?Math.round((1-v.price/full)*100):0)+'%']]}},
{id:'studio',t:'Studio break-even',s:'How many students you need each month to cover rent and costs.',f:[['rent','Studio rent per month ($)',600],['other','Insurance, music and other ($)',150],['price','Average pay per student per month ($)',60]],c:v=>{const cost=v.rent+v.other,n=v.price?Math.ceil(cost/v.price):0;return[['Monthly costs',money(cost)],['Students needed to break even',String(n)],['Income with 25 students',money(25*v.price-cost)],['Income with 40 students',money(40*v.price-cost)]]}});
PALETTES.push(['Sage Studio','#F4F8F3','#1F3326','#2F7D55','#F2B544'],['Brass Barre','#1D1D1F','#F4EFE6','#D1A24A','#8FB8A8'],['Pop Class','#FFF6D6','#1B1B2F','#E4405F','#3B5BDB']);
/* ----- sample instructor ----- */
function demoInstructor(){const a=newArtist('Elena Park','instructor'),s=a.site;s.brand.tagline='Dance classes for every age and level';s.hero.sub='Contemporary, jazz and Latin classes in Orlando. Your first class is a great place to start.';
s.about.body='Elena has taught dance for 12 years to children, teens and adults. Her classes are warm, clear and built so beginners feel at home on day one.\n\nShe also coaches private lessons, wedding first dances and school showcases.';
s.about.facts=[{k:'Years teaching',v:'12'},{k:'Students taught',v:'900+'},{k:'Recitals',v:'18'}];
s.credits.items=[{year:'2014',title:'Dance education certificate',kind:'Certification',role:'Teacher',company:'National Dance Educators',url:''},{year:'2012',title:'BFA in Dance',kind:'Training',role:'Graduate',company:'State University',url:''},{year:'2018',title:'Harbor Dance Academy',kind:'Teaching',role:'Lead instructor',company:'Orlando, FL',url:''}];
s.skills.stats=[['Years teaching','12'],['Ages','5 to adult'],['Styles','Contemporary, Jazz, Latin'],['Class size','Up to 14'],['Studio','Downtown Orlando']].map(x=>({k:x[0],v:x[1]}));s.skills.tags='Beginners welcome, Kids, Teens, Adults, Private lessons, Wedding dances';
s.classes.items=[{name:'Kids creative movement',day:'Mon',time:'4:30 PM',level:'Ages 5 to 8',when:'Mon 4:30 PM',price:'$16 per class',desc:'Playful games and simple steps that build rhythm and confidence.',url:'',btn:'Reserve a spot'},{name:'Contemporary technique',day:'Wed',time:'7:00 PM',level:'Teens and adults',when:'Wed 7 PM',price:'$20 drop-in',desc:'Warm-up, floor work and a short combination.',url:'',btn:'Reserve a spot'},{name:'Latin social dance',day:'Fri',time:'6:30 PM',level:'All levels, no partner needed',when:'Fri 6:30 PM',price:'$18 per class',desc:'Salsa and bachata with a friendly crowd.',url:'',btn:'Reserve a spot'}];
s.packages.items=[{name:'10 class pass',price:'$150',desc:'Use any class, valid for 3 months.',feats:'Any class\nValid 3 months\nShareable with a friend',url:'',btn:'Buy a pass'},{name:'Private lesson',price:'$70 per hour',desc:'One-on-one or for a couple.',feats:'Wedding first dances\nAudition prep\nStudio or your venue',url:'',btn:'Book a lesson'}];delete s.layout.hidden.packages;
s.faq.items=[{q:'What should I wear?',a:'Comfortable clothes you can move in. Bare feet or socks are fine for the first class.'},{q:'Do I need experience?',a:'No. Beginners are always welcome, and I will help you find the right level.'},{q:'Can I try a class first?',a:'Yes. Your first class is a trial, and you can decide after.'}];
s.social.links=[{k:'instagram',h:'elena.teaches.dance'},{k:'youtube',h:'elenapark'},{k:'tiktok',h:'elena.teaches.dance'}];s.contact={title:'Book a trial or ask a question',intro:'Tell me your age, experience and which class you like.',email:'[email protected]',phone:'',mgmt:'',btn:'Send message',endpoint:''};
a.crm.students=[['Sofia Marin','Kids','Maria Marin',3,'2016-11-20'],['Jake Holt','Adult','',1,'1991-03-02'],['Priya Nair','Teens','Anil Nair',7,'2010-11-30'],['Lena Wu','Adult','',0,'1988-06-14']].map(r=>({id:uid(),name:r[0],level:r[1],email:r[0].split(' ')[0].toLowerCase()+'@example.com',phone:'',guardian:r[2],bday:r[4],plan:'10 class pass',pass:10,price:150,left:r[3],active:true,notes:'',joined:dOff(-60),att:[dOff(-3),dOff(-10)]}));
a.crm.finance=[{id:uid(),date:dOff(-4),type:'income',cat:'Teaching',desc:'Class passes',amt:450},{id:uid(),date:dOff(-9),type:'income',cat:'Teaching',desc:'Private lessons',amt:280},{id:uid(),date:dOff(-7),type:'expense',cat:'Studio',desc:'Studio rent',amt:600}];
a.crm.tasks=[{id:uid(),title:'Send recital info to parents',due:dOff(5),done:false,pri:'normal',notes:'',link:''}];
return a}
SAMPLES.instructor=demoInstructor;
/* ---------- more designs, fine tuning, announcement bar, duplicate artist ---------- */
Object.assign(THEMES,{
coral:{n:'Coral Reef',d:'Warm coral and deep teal, friendly and bright',c:{bg:'#FFF3EE',bg2:'#FFE4DA',card:'#FFFFFF',ink:'#16373A',muted:'#5F7B7D',accent:'#F2603E',accent2:'#1C8C8C',line:'#F6D5C8',line2:'#E9B8A6'},fd:'Bricolage Grotesque',fb:'DM Sans',r:18,hero:'split',card:'raised',btn:'pill'},
midnight:{n:'Midnight Blue',d:'Deep navy with an electric blue glow',c:{bg:'#0A1128',bg2:'#0F1A3A',card:'#142148',ink:'#E8EEFF',muted:'#92A0C8',accent:'#4D8DFF',accent2:'#7AF0FF',line:'#1D2C5C',line2:'#2C4080'},fd:'Unbounded',fb:'Outfit',r:12,hero:'center',card:'raised',btn:'r',g:1},
sand:{n:'Desert Sand',d:'Dusty neutrals and clay, calm and grounded',c:{bg:'#F3EBDD',bg2:'#E9DDC8',card:'#FBF6EC',ink:'#3B2F25',muted:'#8A7A68',accent:'#B5653A',accent2:'#7C8B5A',line:'#E0D2BA',line2:'#CDB99A'},fd:'Lora',fb:'DM Sans',r:10,hero:'left',card:'flat',btn:'r'},
lilac:{n:'Lilac Haze',d:'Soft violet and peach, dreamy and modern',c:{bg:'#F4F0FB',bg2:'#E8E0F6',card:'#FFFFFF',ink:'#2A1F45',muted:'#7A6E99',accent:'#7B4DEB',accent2:'#FF9E7A',line:'#DDD3F2',line2:'#C5B6E8'},fd:'Syne',fb:'Outfit',r:22,hero:'split',card:'raised',btn:'pill',g:1},
concrete:{n:'Concrete',d:'Industrial grey with a safety orange accent',c:{bg:'#E4E4E2',bg2:'#D5D5D2',card:'#F1F1EF',ink:'#1A1A1A',muted:'#666666',accent:'#FF5A1F',accent2:'#1A1A1A',line:'#C7C7C3',line2:'#ABABA6'},fd:'Anton',fb:'Barlow',r:0,hero:'left',card:'outline',btn:'sq'},
emerald:{n:'Emerald Lux',d:'Black with emerald and champagne, quiet luxury',c:{bg:'#07110D',bg2:'#0C1A14',card:'#11251C',ink:'#EFE8D6',muted:'#98A89C',accent:'#2ED38A',accent2:'#D8C089',line:'#1B3328',line2:'#2A4C3B'},fd:'DM Serif Display',fb:'DM Sans',r:6,hero:'center',card:'outline',btn:'r'},
candy:{n:'Candy Pop',d:'Bubblegum pink and sky blue, loud and playful',c:{bg:'#FFE9F3',bg2:'#FFD3E8',card:'#FFFFFF',ink:'#2B1647',muted:'#7C5E96',accent:'#FF3D9A',accent2:'#3DB8FF',line:'#FFC2DE',line2:'#F59BC6'},fd:'Bricolage Grotesque',fb:'Outfit',r:26,hero:'center',card:'raised',btn:'pill',g:1},
retro:{n:'Seventies',d:'Burnt orange, mustard and cocoa, warm and groovy',c:{bg:'#F6E7C8',bg2:'#EDD5A4',card:'#FBF1DA',ink:'#3A2214',muted:'#86644A',accent:'#D2561B',accent2:'#E4A11B',line:'#E2CB9C',line2:'#CDAE72'},fd:'Fraunces',fb:'Barlow',r:14,hero:'split',card:'raised',btn:'pill'}
});
PALETTES.push(['Coral Reef','#FFF3EE','#16373A','#F2603E','#1C8C8C'],['Midnight Blue','#0A1128','#E8EEFF','#4D8DFF','#7AF0FF'],['Desert Sand','#F3EBDD','#3B2F25','#B5653A','#7C8B5A'],['Emerald Lux','#07110D','#EFE8D6','#2ED38A','#D8C089'],['Candy Pop','#FFE9F3','#2B1647','#FF3D9A','#3DB8FF'],['Seventies','#F6E7C8','#3A2214','#D2561B','#E4A11B']);
const DOPT=(p,l,o)=>({p,l,t:'select',o,r:1});
const _vb=VIEWS.brand;
VIEWS.brand=()=>{let h=_vb();const n=Object.keys(THEMES).length;
h=h.replace(/Seven ready-made designs\./,n+' ready-made designs.');
const fine='
Surprise me tries a random style and palette. Undo by picking a style above.
'
+'
Announcement bar and floating button
A colored bar above the navigation, and a button that stays on screen. Leave the text empty to hide either one.
'+FS('site.brand',[{p:'ann',l:'Announcement text',ph:'New class starts Monday. Book now'},{p:'annu',l:'Announcement link',ph:'#contact or https://...'},{p:'fabt',l:'Floating button text',ph:'Book now'},{p:'fabu',l:'Floating button link',ph:'#contact'}],'g2')+'
';
return h.replace(/(
Customize<\/h3>)/,fine+'$1')};
const _th=ACT.theme;ACT.theme=function(b){const s=A().site.brand;s.space=s.hsize=s.btnst=s.bands='';_th(b)};
ACT.surprise=()=>{const s=A().site.brand,ks=Object.keys(THEMES),k=ks[Math.floor(Math.random()*ks.length)];s.theme=k;s.colors={bg:'',ink:'',accent:'',accent2:''};s.fd=s.fb=s.radius=s.hero=s.card='';
if(Math.random()<.5){const p=PALETTES[Math.floor(Math.random()*PALETTES.length)];s.colors={bg:p[1],ink:p[2],accent:p[3],accent2:p[4]}}
const hs=['split','left','center'];if(Math.random()<.5)s.hero=hs[Math.floor(Math.random()*3)];render();touch();toast('Tried '+THEMES[k].n)};
ACT.dupartist=()=>{const a=A(),c=JSON.parse(JSON.stringify(a));c.id=uid();c.name=(a.name||'Artist')+' (copy)';c.site.brand.name=c.name;c.crm=blankCrm();DB.artists.push(c);DB.active=c.id;tab='brand';save();render();toast('Duplicated the website. CRM data was not copied.')};
/* ---------- boot ---------- */
(function boot(){
const l=document.createElement('link');l.rel='stylesheet';l.href=fontsHref(Object.keys(FONT_LIB));document.head.appendChild(l);
DB=load();
document.addEventListener('click',e=>{const a=e.target.closest('a[data-act]');if(a)e.preventDefault()},true);
save();render();
})();