1(self.webpackChunkMyDough_Web_Deskflo=self.webpackChunkMyDough_Web_Deskflo||[]).push([[3913],{3913:(Pl,Wa,ee)=>{"use strict";ee.r(Wa),ee.d(Wa,{SalesModule:()=>sj});var q=ee(32881),sr=ee(25207),nt=ee(10467),lt=ee(7673),or=ee(27468),Wn=ee(99437),yn=ee(41245),J=ee(88297),Xt=ee(45312);const je="ThisWeek",Rn="ThisQuarter";class nn{static createStatsFilter(a,t,r){return{UserId:null,SourceIds:[],DateFilter:this.createDateFilter(a,t,r)}}static createDateFilter(a,t,r){if(a===J.i.Custom&&t&&r)return{Range:J.i.Custom,StartDate:this.toDateString(t),EndDate:this.toDateString(r)};const i=this.getRangeBounds(a);return i?{Range:J.i.Custom,StartDate:this.toDateString(i.start),EndDate:this.toDateString(i.end)}:{StartDate:null,EndDate:null,Range:a}}static createPreviousPeriodFilter(a,t,r){if(a===J.i.Custom&&t&&r){const s=new Date(t);s.setHours(0,0,0,0);const o=new Date(r);o.setHours(23,59,59,999);const l=o.getTime()-s.getTime(),c=new Date(s.getTime()-1),d=new Date(c.getTime()-l);return{UserId:null,SourceIds:[],DateFilter:{Range:J.i.Custom,StartDate:this.toDateString(d),EndDate:this.toDateString(c)}}}if(a===J.i.AllTime)return null;const i=this.getRangeBounds(a);return i?{UserId:null,SourceIds:[],DateFilter:{Range:J.i.Custom,StartDate:this.toDateString(i.previousStart),EndDate:this.toDateString(i.previousEnd)}}:null}static getRangeBounds(a){const t=new Date,r=new Date(t),i=new Date(t);switch(r.setHours(0,0,0,0),i.setHours(23,59,59,999),a){case je:{const s=r.getDay(),o=0===s?-6:1-s;r.setDate(r.getDate()+o);const l=new Date(r);l.setDate(r.getDate()+6),l.setHours(23,59,59,999);const c=new Date(r);c.setDate(r.getDate()-7);const d=new Date(r);return d.setDate(r.getDate()-1),d.setHours(23,59,59,999),{start:r,end:l,previousStart:c,previousEnd:d}}case J.i.ThisMonth:return r.setDate(1),{start:r,end:new Date(t.getFullYear(),t.getMonth()+1,0,23,59,59,999),previousStart:new Date(t.getFullYear(),t.getMonth()-1,1),previousEnd:new Date(t.getFullYear(),t.getMonth(),0,23,59,59,999)};case Rn:{const s=3*Math.floor(t.getMonth()/3),o=s+2;return{start:new Date(t.getFullYear(),s,1),end:new Date(t.getFullYear(),o+1,0,23,59,59,999),previousStart:new Date(t.getFullYear(),s-3,1),previousEnd:new Date(t.getFullYear(),s,0,23,59,59,999)}}case J.i.ThisYear:return{start:new Date(t.getFullYear(),0,1),end:new Date(t.getFullYear(),11,31,23,59,59,999),previousStart:new Date(t.getFullYear()-1,0,1),previousEnd:new Date(t.getFullYear()-1,11,31,23,59,59,999)};default:return null}}static getDateFilterBounds(a){if(a.StartDate&&a.EndDate){const r=new Date(a.StartDate),i=new Date(a.EndDate);return r.setHours(0,0,0,0),i.setHours(23,59,59,999),{start:r,end:i}}const t=new Date;switch(a.Range){case J.i.ThisMonth:return{start:new Date(t.getFullYear(),t.getMonth(),1),end:new Date(t.getFullYear(),t.getMonth()+1,0,23,59,59,999)};case J.i.ThisYear:return{start:new Date(t.getFullYear(),0,1),end:new Date(t.getFullYear(),11,31,23,59,59,999)};case J.i.LastMonth:return{start:new Date(t.getFullYear(),t.getMonth()-1,1),end:new Date(t.getFullYear(),t.getMonth(),0,23,59,59,999)};case J.i.LastYear:return{start:new Date(t.getFullYear()-1,0,1),end:new Date(t.getFullYear()-1,11,31,23,59,59,999)};default:return null}}static toDateString(a){return[a.getFullYear(),`${a.getMonth()+1}`.padStart(2,"0"),`${a.getDate()}`.padStart(2,"0")].join("-")}static getDateValue(a){if(!a)return null;const t=a instanceof Date?a.getTime():new Date(a).getTime();return Number.isNaN(t)?null:t}static getDueDayDifference(a){const t=new Date,r=new Date(a);return t.setHours(0,0,0,0),r.setHours(0,0,0,0),Math.round((r.getTime()-t.getTime())/864e5)}}class Lr{static formatCurrency(a,t){return new Intl.NumberFormat("en-ZA",{style:"currency",currency:t,minimumFractionDigits:0,maximumFractionDigits:1}).format(a||0)}static buildPipelineValueByStageChart(a,t){return{data:{labels:a.map(s=>s.name),datasets:[{data:a.map(s=>s.amount),backgroundColor:a.map(s=>s.color),borderRadius:8,borderSkipped:!1,barThickness:52}]},options:{responsive:!0,maintainAspectRatio:!1,layout:{padding:{top:6,right:10,bottom:44,left:6}},plugins:{legend:{display:!1},tooltip:{callbacks:{label:s=>this.formatCurrency(s.parsed.y||0,t)}}},scales:{x:{grid:{display:!1},ticks:{color:"#61708a",font:{size:11}
1,maxRotation:0,minRotation:0,padding:10,callback:(s,o)=>this.getCompactChartLabel(a[o]?.name||"")},border:{display:!0,color:"#d9e6f5"}},y:{beginAtZero:!0,grid:{color:"#e5edf8"},ticks:{color:"#61708a",callback:s=>this.formatAxisCurrency(Number(s))},border:{display:!1}}}}}}static buildPipelineVelocityChart(a,t,r){const i=a.pipelineValues.some(p=>p>0),s=a.wins.some(p=>p>0),o=i?a.pipelineValues:a.labels.map((p,u,f)=>u===f.length-1?t:0),l=s?a.wins:a.labels.map((p,u,f)=>u===f.length-1?r:0);return{data:{labels:a.labels,datasets:[{label:"Deals Won",data:l,yAxisID:"yWins",borderColor:"#22c55e",backgroundColor:"#22c55e",fill:!1,tension:.35,pointRadius:4,pointHoverRadius:6,pointBackgroundColor:"#22c55e",pointBorderColor:"#ffffff",pointBorderWidth:2},{label:"Pipeline Value",data:o,yAxisID:"y",borderColor:"#3f7ee8",backgroundColor:"rgba(63, 126, 232, 0.16)",fill:!0,tension:.35,pointRadius:3,pointHoverRadius:5,pointBackgroundColor:"#3f7ee8",pointBorderColor:"#ffffff",pointBorderWidth:2}]},options:{responsive:!0,maintainAspectRatio:!1,layout:{padding:{top:6,right:10,bottom:40,left:6}},plugins:{legend:{display:!0,position:"bottom",labels:{color:"#61708a",usePointStyle:!0,boxWidth:10,boxHeight:10,padding:14,font:{size:11}}},tooltip:{mode:"index",intersect:!1,callbacks:{label:p=>"yWins"===p.dataset.yAxisID?`Deals Won : ${p.parsed.y||0}`:`Pipeline Value : ${this.formatCurrency(p.parsed.y||0,"")}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#61708a",font:{size:11},maxRotation:0,minRotation:0,padding:10},border:{display:!0,color:"#d9e6f5"}},y:{beginAtZero:!0,grace:"12%",grid:{color:"#e5edf8"},ticks:{color:"#61708a",callback:p=>this.formatAxisCurrency(Number(p))},border:{display:!1}},yWins:{beginAtZero:!0,position:"right",grace:1,grid:{drawOnChartArea:!1},ticks:{color:"#61708a",precision:0,stepSize:1},border:{display:!1}}}},label:a.summaryLabel}}static buildLossAnalysisChart(a){return{data:{labels:a.map(i=>i.reason),datasets:[{data:a.map(i=>i.count),backgroundColor:a.map(i=>i.color),borderColor:"#ffffff",borderWidth:4,hoverOffset:4}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:"58%",layout:{padding:{top:0,right:8,bottom:8,left:8}},plugins:{legend:{display:!1},tooltip:{callbacks:{label:i=>`${i.label}: ${i.parsed} deals`}}}}}}static formatAxisCurrency(a){if(!a)return"R0";const t=Math.abs(a),r=i=>i.toFixed(1).replace(/\.0$/,"");return t>=1e9?`R${r(a/1e9)}B`:t>=1e6?`R${r(a/1e6)}M`:t>=1e3?`R${(a/1e3).toFixed(0)}K`:`R${a.toFixed(0)}`}static getCompactChartLabel(a){return a?a.length>18?`${a.slice(0,18)}\u2026`:a:""}}var e=ee(41360),_t=ee(59506),rt=ee(57522),be=ee(5779),rn=ee(72235),Ri=ee(96048),jn=ee(10822);let Ji=(()=>{class n{buildDashboardViewModel(t,r,i,s,o,l,c,d,p){const u=(t.Funnel??[]).filter(ae=>!this.isClosedTrack(ae.TrackName)),f=t.WonOpportunities??0,h=t.ClosedOpportunities??t.WonOpportunities+t.LostOpportunities,g=(t.Funnel??[]).reduce((ae,ye)=>ae+(ye.CardCount||0),0),m=u.reduce((ae,ye)=>ae+(ye.CardCount||0),0),_=h,v=u.reduce((ae,ye)=>ae+(ye.TotalAmount||0),0),k=t.WonAmount||0,b=h>0?f/h*100:t.ConversionRate||0,A=v*(b/100),G=v+k,j=m>0?v/m:0,w=this.buildHeroMetrics(v,A,k,b,m,_,t,r),O=this.buildStageRows(t.Funnel??[],d,p),M=this.buildLossReasons(t),H=this.buildTopOpenDeals(s),z=this.buildNeedsAttentionDeals(s),P=this.buildLeadSources(i),oe=`Sales Snapshot - ${c}`,ve=this.buildEmailMessage(c,v,A,k,b,l);return{totalDeals:g,openDeals:m,closedDeals:_,pipelineValue:v,wonRevenue:k,winRate:b,weightedForecast:A,bestCaseValue:G,avgDealSize:j,heroMetrics:w,stageRows:O,lossReasons:M,topOpenDeals:H,needsAttentionDeals:z.deals,needsAttentionTotal:z.total,leadSources:P,emailSubject:oe,emailBody:ve}}buildHeroMetrics(t,r,i,s,o,l,c,d){return[{title:"Pipeline Value",value:t,caption:`${o} open deals`,icon:"pi pi-chart-line",iconTone:"blue",delta:this.calculateDelta(t,this.calculatePreviousPipelineValue(d))},{title:"Weighted Forecast",value:r,caption:"Probability-adjusted",icon:"pi pi-bullseye",iconTone:"purple",delta:this.calculateDelta(r,this.calculatePreviousWeightedForecast(d))},{title:"Won Revenue",value:i,caption:`${c?.WonOpportunities||0} closed won`,icon:"pi pi-trophy",iconTone:"green",delta:this.calculateDelta(i,d?.WonAmount||0)},{title:"Win Rate",value:s,caption:`${c?.WonOpportunities||0} of ${l} closed`,icon:"pi pi-sparkles",iconTone:"amber",delta:this.calculateDelta(s,d?.ConversionRate||0)}]}buildStageRows(t,r,i){const s=t.reduce((o,l)=>o+(l.CardCount||0),0);return t.map((o,l)=>({trackId:this.findTrackId(o.TrackName,r,i),name:o.TrackName,count:o.CardCount||0,amount:o.TotalAmount||0,percentage:s>0?(o.CardCount||0)/s*100:0,color:this.getStageColor(o.TrackName,l,r,i),isClosedOutcome:this.isClosedTrack(o.TrackName)}))}buildLossReasons(t){const r=t.LostOpportunities||0,i=["#e91e63","#f44336","#9c4dcc","#6a7b94","#ff7a18","#3f7ee8"];return[...t.LossReasons??[]].sort((s,o)=>(o.Count||0)-(s.Count||0)).map((s,o)=>({reason:s.Reason,count:s.Count,percentage:r>0?s.Count/r*100:0,amount:r>0?(s.Count||0)/r*(t.LostAmount||0):0,color:i[o%i.length]}))}buildTopOpenDeals(t){return[...t].filter(r=>!this.isClosedCard(r)).sort((r,i)=>(i.Amount||0)-(r.Amount||0)).slice(0,5)}buildNeedsAttentionDeals(t){const r=[...t].filter(i=>!this.isClosedCard(i)).sort((i,s)=>{const o=this.getNeedsAttentionScore(s)-this.getNeedsAttentionScore(i);return 0!==o?o:(s.Amount||0)-(i.Amount||0)});return{deals:r.slice(0,5),total:r.length}}buildLeadSources(t){const r=new Map;let i=0;for(const o of t){let l=(o.OpportunitySource||"").trim();if(!l&&null!=o.OpportunitySourceId&&o.OpportunitySourceId>
10&&(l=this.getSourceNameFromId(o.OpportunitySourceId)),!l&&o.Tags&&Array.isArray(o.Tags))for(const c of o.Tags){const d=("string"==typeof c?c:c.Name||"").toLowerCase();if(d&&!["high","medium","low","priority","hot","warm","cold"].includes(d)){l=c.Name||c.toString();break}}l||(l=(o.AssociatePerson||"").trim()||(o.CompanyName||"").trim()),l?i++:l="Other",r.set(l,(r.get(l)||0)+1)}const s=i||t.length||1;return[...r.entries()].sort((o,l)=>l[1]-o[1]).slice(0,5).map(([o,l])=>({name:o,count:l,percentage:l/s*100}))}buildRecipients(t,r=[],i){const s=new Map;for(const o of t.BoardUsers??[])o.Email&&s.set(o.Email.toLowerCase(),{id:o.Id,name:o.Name,email:o.Email,role:this.resolveRole(o),initials:i(o.Name),selected:!1});for(const o of r??[]){const l=o.Email||"";if(!l)continue;const c=l.toLowerCase();s.has(c)||s.set(c,{id:o.UserId,name:o.Name,email:l,role:o.Role||"Team Member",initials:i(o.Name),selected:!1})}return[...s.values()].sort((o,l)=>o.name.localeCompare(l.name))}buildVelocitySeries(t,r,i,s,o){const l=t.length>0?[...t]:[...r],c=i.filter(u=>u.Status===J.t4.Won||"won"===(u.StatusString||"").toLowerCase()),d=new Date,p=[];if(s===J.i.Custom&&o)return this.mapCardsToVelocityBuckets(l,c,this.buildCustomBuckets(o.start,o.end),"Custom range");if(s===je){const u=new Date(d),f=u.getDay(),h=0===f?-6:1-f;u.setDate(u.getDate()+h),u.setHours(0,0,0,0);for(let g=0;g<7;g++){const m=new Date(u);m.setDate(u.getDate()+g);const _=new Date(m);_.setHours(23,59,59,999),p.push({label:m.toLocaleDateString("en-US",{weekday:"short"}),from:m,to:_})}return this.mapCardsToVelocityBuckets(l,c,p,"This week")}if(s===J.i.ThisMonth){const u=new Date(d.getFullYear(),d.getMonth(),1);for(let f=0;f<4;f++){const h=new Date(u);h.setDate(u.getDate()+7*f);const g=new Date(h);g.setDate(h.getDate()+6),g.setHours(23,59,59,999),p.push({label:`W${f+1}`,from:h,to:g})}return this.mapCardsToVelocityBuckets(l,c,p,"This month")}if(s===Rn){const u=3*Math.floor(d.getMonth()/3);for(let f=0;f<3;f++){const h=new Date(d.getFullYear(),u+f,1),g=new Date(d.getFullYear(),u+f+1,0,23,59,59,999);p.push({label:h.toLocaleDateString("en-US",{month:"short"}),from:h,to:g})}return this.mapCardsToVelocityBuckets(l,c,p,"This quarter")}if(s===J.i.ThisYear){for(let u=0;u<12;u++){const f=new Date(d.getFullYear(),u,1),h=new Date(d.getFullYear(),u+1,0,23,59,59,999);p.push({label:f.toLocaleDateString("en-US",{month:"short"}),from:f,to:h})}return this.mapCardsToVelocityBuckets(l,c,p,"This year")}for(let u=5;u>=0;u--){const f=new Date(d.getFullYear(),d.getMonth()-u,1),h=new Date(d.getFullYear(),d.getMonth()-u+1,0,23,59,59,999);p.push({label:f.toLocaleDateString("en-US",{month:"short"}),from:f,to:h})}return this.mapCardsToVelocityBuckets(l,c,p,"Last 6 months")}buildCustomBuckets(t,r){const i=new Date(t);i.setHours(0,0,0,0);const s=new Date(r);s.setHours(23,59,59,999);const o=Math.max(1,Math.round((s.getTime()-i.getTime())/864e5)),l=[];if(o<=14){for(let d=new Date(i);d<=s;d.setDate(d.getDate()+1)){const p=new Date(d),u=new Date(d);u.setHours(23,59,59,999),l.push({label:p.toLocaleDateString("en-US",{month:"short",day:"numeric"}),from:p,to:u})}return l}if(o<=92){for(let d=new Date(i);d<=s;d.setDate(d.getDate()+7)){const p=new Date(d),u=new Date(d);u.setDate(u.getDate()+6),u.setHours(23,59,59,999),u>s&&u.setTime(s.getTime()),l.push({label:p.toLocaleDateString("en-US",{month:"short",day:"numeric"}),from:p,to:u})}return l}let c=new Date(i.getFullYear(),i.getMonth(),1);for(;c<=s;){const d=new Date(Math.max(c.getTime(),i.getTime())),p=new Date(c.getFullYear(),c.getMonth()+1,0,23,59,59,999),u=new Date(Math.min(p.getTime(),s.getTime()));l.push({label:d.toLocaleDateString("en-US",{month:"short"}),from:d,to:u}),c=new Date(c.getFullYear(),c.getMonth()+1,1)}return l}mapCardsToVelocityBuckets(t,r,i,s){const o=i.map(c=>t.reduce((d,p)=>{const u=nn.getDateValue(p.DateCreatedUtc);if(null==u||u>c.to.getTime())return d;const f=nn.getDateValue(p.DateClosedUtc);return null!=f&&f<=c.to.getTime()||null==f&&this.isClosedCard(p)?d:d+(p.Amount||0)},0)),l=i.map(c=>r.reduce((d,p)=>{const u=nn.getDateValue(p.DateClosedUtc??p.DateCreatedUtc);return null==u?d:u>=c.from.getTime()&&u<=c.to.getTime()?d+1:d},0));return{labels:i.map(c=>
1c.label),pipelineValues:o,wins:l,summaryLabel:s}}buildEmailMessage(t,r,i,s,o,l){const c=d=>new Intl.NumberFormat("en-ZA",{style:"currency",currency:l,minimumFractionDigits:0,maximumFractionDigits:1}).format(d||0);return[`Sharing the latest sales snapshot for ${t.toLowerCase()}.`,"","Highlights:",`- Pipeline value: ${c(r)}`,`- Weighted forecast: ${c(i)}`,`- Won revenue: ${c(s)}`,`- Win rate: ${Math.round(o)}%`].join("<br>")}calculatePipelineValue(t){return t?.Funnel?.length?t.Funnel.filter(r=>!this.isClosedTrack(r.TrackName)).reduce((r,i)=>r+(i.TotalAmount||0),0):0}calculatePreviousPipelineValue(t){return this.calculatePipelineValue(t)}calculatePreviousWeightedForecast(t){return this.calculatePreviousPipelineValue(t)*((t?.ConversionRate||0)/100)}calculateDelta(t,r){return r?+((t-r)/r*100).toFixed(1):null}findTrackId(t,r,i){const s=r(t);return s?Number(s.Id):void 0}getStageColor(t,r,i,s){const o=i(t)?.Color?.trim();return o||({lead:"#f4b400",demo:"#3f7ee8","free trial":"#f54343",pause:"#6a7b94","client win":"#2cc35d","client loss":"#dd3535","client lost":"#dd3535"}[(t||"").trim().toLowerCase()]||["#3f7ee8","#8b5cf6","#10b981","#f59e0b","#ef4444"][r%5])}getSourceNameFromId(t){return{1:"Referral",2:"Website",3:"Social Media",4:"Email Campaign",5:"Cold Call",6:"Partner",7:"Event",8:"Direct",9:"LinkedIn",10:"Google Ads",11:"Facebook",12:"Trade Show",13:"Word of Mouth"}[t]||""}isClosedTrack(t){const r=(t||"").trim().toLowerCase();return"client win"===r||"client loss"===r||"client lost"===r}isClosedCard(t){const r=(t.StatusString||"").toLowerCase(),i=Number(t.Status);return"won"===r||"lost"===r||i===J.t4.Won||i===J.t4.Lost}isWonCard(t){return"won"===(t.StatusString||"").toLowerCase()||Number(t.Status)===J.t4.Won}isLostCard(t){return"lost"===(t.StatusString||"").toLowerCase()||Number(t.Status)===J.t4.Lost}getCardTagNames(t){return((t.Tags&&t.Tags.length?t.Tags:t.CardTags)??[]).map(i=>"string"==typeof i?i:i?.Name??"").filter(i=>!!i)}filterCards(t,r,i,s){const o=new Set(r),l=new Set(i.map(p=>(p||"").toLowerCase())),c=new Set(s.map(p=>p.toLowerCase())),d=o.size>0||l.size>0;return t.filter(p=>{const u=!d||(p.AssignedUserIds??[]).some(h=>o.has(h))||(p.AssignedUsers??[]).some(h=>l.has((h||"").toLowerCase())),f=0===c.size||this.getCardTagNames(p).some(h=>c.has(h.toLowerCase()));return u&&f})}buildStatsFromCards(t,r){const i=new Map;for(const g of r??[])i.set(Number(g.Id),g);const s=new Map,o=new Map;let l=0,c=0,d=0,p=0,u=0,f=0;for(const g of t){const m=g.Amount||0;if(this.isWonCard(g))l++,p+=m;else if(this.isLostCard(g)){c++,u+=m;const b=(g.OpportunityClosureLossReason||"").trim()||"Unspecified";o.set(b,(o.get(b)||0)+1)}else d++,f+=m;const _=Number(g.TrackId),v=i.get(_);if(!v)continue;const k=s.get(_);k?(k.CardCount+=1,k.TotalAmount+=m):s.set(_,{TrackName:v.Title,TrackOrder:Number(v.Order??0),CardCount:1,TotalAmount:m})}const h=l+c;return{ActiveOpportunities:d,ClosedOpportunities:h,WonOpportunities:l,LostOpportunities:c,ActiveAmount:f,WonAmount:p,LostAmount:u,MinCloseDays:0,MaxCloseDays:0,AvgCloseDays:0,ConversionRate:h>0?l/h*100:0,LossReasons:[...o.entries()].map(([g,m])=>({Reason:g,Count:m})),Funnel:[...s.values()].sort((g,m)=>g.TrackOrder-m.TrackOrder)}}buildAssigneeOptions(t,r,i){return(t?.BoardUsers??[]).filter(s=>!!s.Name).map(s=>({id:s.Id,name:s.Name,initials:s.Initials||i(s.Name),profilePictureId:s.PictureId})).sort((s,o)=>s.name.localeCompare(o.name))}buildTagOptions(t){const r=new Map;for(const i of t)for(const s of this.getCardTagNames(i)){const o=s.toLowerCase();r.has(o)||r.set(o,{name:s})}return[...r.values()].sort((i,s)=>i.name.localeCompare(s.name))}getNeedsAttentionScore(t){const r=nn.getDateValue(t.DueDateUtc);return null==r?0:this.getPriorityWeight(t.PriorityId)+this.getDueUrgencyWeight(nn.getDueDayDifference(r))+Math.min((t.Amount||0)/1e3,100)}getPriorityWeight(t){switch(t){case 2:return 300;case 1:return 180;default:return 80}}getDueUrgencyWeight(t){return t>=0&&t<=2?240:t<0&&t>=-2?210:t>=3&&t<=7?170:t<-2&&t>=-7?150:t>=8&&t<=14?120:90}resolveRole(t){return t.IsOwner?"Owner":t.IsAdmin?"Admin":t.IsCreator?"Creator":"Team Member"}static \u0275fac=function(r){return new(r||n)};static \u0275prov=e.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var mr=ee(93773),ct=ee(54843),N=ee(80555);let B=(()=>{class n{documentStoreService;boardService;constructor(t,r){this.documentStoreService=t,this.boardService=r}salesSnapshotFileName(){return`sales-snapshot-${this.toDateString(new Date)}.pdf`}toDateString(t){return[t.getFullYear(),`${t.getMonth()+1}`.padStart(2,"0"),`${t.getDate()}`.padStart(2,"0")].join("-")}buildSalesSnapshotPdf(t){return(0,nt.A)(function*(){const r=(yield ee.e(7239).then(ee.t.bind(ee,7239,23))).default,i=document.body.style.overflow;try{document.body.style.overflow="visible";const s=yield r(t,{scale:2,backgroundColor:"#f4f7fb",useCORS:!1,logging:!1,windowWidth:t.scrollWidth,windowHeight:t.scrollHeight,scrollX:0,scrollY:0,onclone:v=>{const k=v.querySelector(".report-shell");k&&(k.querySelectorAll('.p-avatar img[src*="/api/storage/image/"]').forEach(G=>{const j=v.createElement("div");j.setAttribute("style",["width:40px","height:40px","border-radius:9999px","background:#dbeafe","display:inline-flex","align-items:center","justify-content:center","color:#1d4ed8","font-weight:700","font-size:12px"].join(";")),j.textContent="SR",G.replaceWith(j)}),k.querySelectorAll('img[src*="/api/storage/image/"]').forEach(G=>{const j=v.createElement("div");j.textContent="signature"===G.alt?"Signature omitted in PDF preview":"Image unavailable in PDF",j.setAttribute("style",["display:flex","align-items:center","justify-content:center","min-height:48px","padding:8px 12px","border:1px dashed #cbd5e1","border-radius:12px","background:#f8fafc","color:#64748b","font-size:12px","text-align:center"].join(";")),G.replaceWith(j)}))}}),o=new mr.Ay("p","mm","a4"),l=o.internal.pageSize.getWidth(),c=o.internal.pageSize.getHeight(),d=8,u=c-2*d,f=l-2*d,h=s.height*f/s.width,g=s.toDataURL("image/png");let m=h,_=d;for(o.addImage(g,"PNG",d,_,f,h,void 0,"FAST"),m-=u;m>0;)_=m-h+d,o.addPage(),o.addImage(g,"PNG",d,_,f,h,void 0,"FAST"),m-=u;return o}finally{document.body.style.overflow=i}})()}
1arrayBufferToBase64(t){const r=new Uint8Array(t);let s="";for(let o=0;o<r.length;o+=32768){const l=r.subarray(o,o+32768);s+=String.fromCharCode(...l)}return btoa(s)}createSalesSnapshotPdfAttachment(t){var r=this;return(0,nt.A)(function*(){const s=(yield r.buildSalesSnapshotPdf(t)).output("arraybuffer");return{attachmentBase64:r.arrayBufferToBase64(s),attachmentFileName:r.salesSnapshotFileName(),attachmentContentType:"application/pdf"}})()}exportPdf(t,r){var i=this;return(0,nt.A)(function*(){try{const o=(yield i.buildSalesSnapshotPdf(t)).output("blob"),l=new File([o],i.salesSnapshotFileName(),{type:"application/pdf"}),d=(yield(0,ct._)(i.documentStoreService.postImage(l))).PublicId;yield(0,ct._)(i.boardService.sendSalesReportNotification(d))}catch(s){throw console.error(s),r&&r(s instanceof Error&&s.message?s.message:"Unable to generate and send the sales report."),s}})()}exportAndSavePdf(t,r){var i=this;return(0,nt.A)(function*(){try{(yield i.buildSalesSnapshotPdf(t)).save(i.salesSnapshotFileName())}catch(s){r&&r(s instanceof Error&&s.message?s.message:"Unable to generate the PDF for this report right now.")}})()}static \u0275fac=function(r){return new(r||n)(e.KVO(N.W),e.KVO(_t.a))};static \u0275prov=e.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),ie=(()=>{class n{boardService;authService;messageService;teamService;pdfService;deskfloSenderEmail="[email protected]";constructor(t,r,i,s,o){this.boardService=t,this.authService=r,this.messageService=i,this.teamService=s,this.pdfService=o}openEmailModal(t,r,i,s,o,l,c,d,p,u){const f=this.boardService.getGmailRefreshTokens(),h=this.boardService.getOutlookTokenCacheSubscription(),g=this.boardService.getEmailSignature();(0,or.p)([f,h,g]).subscribe({next:([m,_,v])=>{const k=this.buildEmailMessage(i,s,o,l,c,d);u.onDataReady({isGmailLinked:!!m?.Token,isOutlookLinked:!!_?.Token,emailSignature:v,previewUrl:v?.isSignatureSet?`${Xt.c.apiUrl}/api/storage/image/${v.signatureId}`:null,emailSubject:`Sales Snapshot - ${i}`,emailBody:k,recipients:r})},error:m=>{u.onError((0,yn.u)(m)||"Unable to prepare the email composer right now.")}})}sendEmailReport(t,r,i,s,o,l){var c=this;return(0,nt.A)(function*(){l.onStartSending();const d=s??(i?yield c.pdfService.createSalesSnapshotPdfAttachment(i):null);if(!d)return void l.onStopSending();const p={...t,attachments:[d,...o]};r?c.boardService.getEmailSignature().subscribe({next:u=>{u?.isSignatureSet?c.executeEmailSend(p,t.to.length,l):(l.onStopSending(),l.onSignRequired())},error:u=>{l.onStopSending(),l.onError((0,yn.u)(u)||"Unable to verify your email signature right now.")}}):c.executeEmailSend(p,t.to.length,l)})()}executeEmailSend(t,r,i){this.boardService.sendEmail(t).subscribe({next:()=>{i.onStopSending(),i.onSuccess(r)},error:s=>{i.onStopSending(),i.onError((0,yn.u)(s)||"Unable to send the sales snapshot right now.")}})}toggleRecipient(t,r){t.selected=!t.selected;const i=t.email?.trim();return i?t.selected?r.includes(i)?r:[...r,i]:r.filter(s=>s!==i):r}removeRecipient(t,r){return t.selected=!1,r.filter(i=>i!==t.email)}addCustomEmail(t,r,i,s){const o=t.trim().toLowerCase();if(!o||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o))return s.add({severity:"warn",summary:"Invalid email",detail:"Enter a valid email address before adding it."}),{recipients:r,selectedEmailContacts:i,customEmail:t};const c=r.find(p=>p.email.toLowerCase()===o);if(c)return c.selected=!0,i.includes(c.email)||(i=[...i,c.email]),{recipients:r,selectedEmailContacts:i,customEmail:""};const d=this.getInitials(o);return{recipients:r=[{id:o,name:o,email:o,role:"Custom",initials:d,selected:!0},...r],selectedEmailContacts:i=[...i,o],customEmail:""}}getEmailSignatureName(){const t=this.teamService.currentUserObj;return`${t.firstName||""} ${t.lastName||""}`.trim()||t.userName||"Deskflo Team"}getEmailSignatureTitle(){const t=this.teamService.currentUserObj;return t.workRole||t.role||"Deskflo"}buildSalesReportTemplateData(t,r,i,s,o,l,c,d,p){const u=f=>new Intl.NumberFormat("en-ZA",{style:"currency",currency:p,minimumFractionDigits:0,maximumFractionDigits:1}).format(f||0);return{subject:t.trim(),range_label:r,message_html:i,pipeline_value:u(s),weighted_forecast:u(o),won_revenue:u(l),win_rate:`${Math.round(c)}%`,report_name:d,signature_name:this.getEmailSignatureName(),signature_title:this.getEmailSignatureTitle()}}login(t){"outlook"!==t?this.authService.initiateGmailConnect():this.authService.initiateOutlookConnect().subscribe(r=>{window.location.href=r})}buildEmailMessage(t,r,i,s,o,l){const c=d=>new Intl.NumberFormat("en-ZA",{style:"currency",currency:l,minimumFractionDigits:0,maximumFractionDigits:1}).format(d||0);return[`Sharing the latest sales snapshot for ${t.toLowerCase()}.`,"","Highlights:",`- Pipeline value: ${c(r)}`,`- Weighted forecast: ${c(i)}`,`- Won revenue: ${c(s)}`,`- Win rate: ${Math.round(o)}%`].join("<br>")}
1getInitials(t){const r=(t||"").trim().split(/\s+/).filter(Boolean);return 0===r.length?"":1===r.length?r[0].slice(0,2).toUpperCase():`${r[0][0]}${r[1][0]}`.toUpperCase()}compressImage(t,r,i){return(0,nt.A)(function*(){return new Promise((s,o)=>{const l=new FileReader;l.readAsDataURL(t),l.onload=c=>{const d=new Image;d.src=c.target?.result,d.onload=()=>{const p=document.createElement("canvas");let u=d.width,f=d.height;u>r&&(f*=r/u,u=r),p.width=u,p.height=f,p.getContext("2d")?.drawImage(d,0,0,u,f),p.toBlob(g=>{g?s(g):o(new Error("Canvas is empty"))},"image/jpeg",i)}},l.onerror=c=>o(c)})})()}convertToBase64(t){return(0,nt.A)(function*(){return new Promise((r,i)=>{const s=new FileReader;s.readAsDataURL(t),s.onload=()=>{const o=s.result.split(",")[1];r({attachmentBase64:o,attachmentFileName:t.name,attachmentContentType:t.type})},s.onerror=o=>i(o)})})()}validateEmailInput(t,r,i){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)?!r.includes(t)||(i.add({severity:"warn",summary:"Email Already Added",detail:"The email address is already added to the list."}),!1):(i.add({severity:"warn",summary:"Invalid Email Address",detail:"Please enter a valid email address."}),!1)}static \u0275fac=function(r){return new(r||n)(e.KVO(_t.a),e.KVO(jn.u),e.KVO(be.bg),e.KVO(rt.n),e.KVO(B))};static \u0275prov=e.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Te=ee(69820),Ce=ee(55075),Ie=ee(97722),Qe=ee(22242),L=ee(89417),jt=ee(14059),xe=ee(81141),Ve=ee(48654),De=ee(56296),Zt=ee(41850),Oe=ee(7897),Ae=ee(62008),Se=ee(90544),It=ee(21579),vt=ee(80981),Bt=ee(74714),wt=ee(38542);let Ue=(()=>{class n{transform(t){if(null==t)return"";const r=t.toString().replace(/,/g,""),i=parseFloat(r.replace(/[^0-9.-]+/g,"")),s=r.replace(/[0-9.,-]+/g,"");if(isNaN(i))return t;let o="";return o=i>=1e9?(i/1e9).toFixed(1)+"B":i>=1e6?(i/1e6).toFixed(1)+"M":i>=1e3?(i/1e3).toFixed(1)+"K":i.toString(),`${s}${o}`}static \u0275fac=function(r){return new(r||n)};static \u0275pipe=e.EJ8({name:"shortNumber",type:n,pure:!0})}return n})();const et=()=>({height:"9px",width:"100%","background-color":"#e2e8f0"});function Et(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",25),e.bIt("click",function(i){e.eBV(t);const s=e.XpG(),o=e.sdS(10);return s.openTargetSettings(),e.Njj(o.toggle(i))}),e.k0s()}}function Xe(n,a){1&n&&(e.j41(0,"tr",30)(1,"th"),e.EFF(2,"Rank"),e.k0s(),e.j41(3,"th"),e.EFF(4,"Sales Rep"),e.k0s(),e.j41(5,"th"),e.EFF(6,"Opps"),e.k0s(),e.j41(7,"th"),e.EFF(8,"Wins"),e.k0s(),e.j41(9,"th"),e.EFF(10,"Value"),e.k0s(),e.j41(11,"th"),e.EFF(12,"Avg. Close"),e.k0s(),e.j41(13,"th"),e.EFF(14,"Win Rate"),e.k0s(),e.j41(15,"th"),e.EFF(16,"Target Progress"),e.k0s(),e.j41(17,"th"),e.EFF(18,"Action"),e.k0s()())}function bt(n,a){if(1&n&&(e.j41(0,"span",51),e.EFF(1),e.k0s()),2&n){const t=a.ngIf;e.R7$(),e.SpI(" ",t," ")}}function Yt(n,a){if(1&n&&(e.j41(0,"span",52),e.EFF(1),e.k0s()),2&n){const t=e.XpG().rowIndex;e.R7$(),e.SpI("#",t+1,"")}}function Ct(n,a){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"button",53),e.bIt("click",function(i){e.eBV(t);const s=e.XpG().$implicit,o=e.XpG(2),l=e.sdS(10);return o.openTargetModal(s),e.Njj(l.toggle(i))}),e.EFF(2),e.k0s(),e.bVm()}if(2&n){const t=e.XpG().$implicit;e.R7$(2),e.SpI(" ",t.SalesTargetAmount>0?"Edit":"Set"," ")}}function dt(n,a){if(1&n&&(e.j41(0,"span",54),e.EFF(1),e.nI1(2,"currency"),e.nI1(3,"shortNumber"),e.k0s()),2&n){const t=e.XpG().$implicit,r=e.XpG(2);e.R7$(),e.SpI(" ",t.SalesTargetAmount>0?e.bMT(3,6,e.ii3(2,1,t.SalesTargetAmount,r.currencyCode,"symbol-narrow","1.0-2")):"Target not set"," ")}}function Ye(n,a){if(1&n&&(e.j41(0,"tr",31)(1,"td"),e.DNE(2,bt,2,1,"span",32)(3,Yt,2,1,"ng-template",null,2,e.C5r),e.k0s(),e.j41(5,"td")(6,"div",33)(7,"div",34),e.EFF(8),e.k0s(),e.j41(9,"div",35)(10,"span",36),e.EFF(11),e.nI1(12,"slice"),e.k0s(),e.j41(13,"div",37)(14,"small",38),e.EFF(15,"Target:"),e.k0s(),e.j41(16,"small",39),e.EFF(17),e.nI1(18,"currency"),e.nI1(19,"shortNumber"),e.k0s()()()()(),e.j41(20,"td",40),e.EFF(21),e.k0s(),e.j41(22,"td")(23,"span",41),e.EFF(24),e.k0s()(),e.j41(25,"td",42),e.EFF(26),e.nI1(27,"currency"),e.nI1(28,"shortNumber"),e.k0s(),e.j41(29,"td",43),e.nrm(30,"i",44),e.EFF(31),e.nI1(32,"number"),e.k0s(),e.j41(33,"td")(34,"span",45),e.EFF(35),e.nI1(36,"number"),e.k0s()(),e.j41(37,"td",46)(38,"div",47)(39,"div",48)(40,"span"),e.EFF(41),e.nI1(42,"currency"),e.nI1(43,"
1shortNumber"),e.nI1(44,"currency"),e.nI1(45,"shortNumber"),e.k0s(),e.j41(46,"span"),e.EFF(47),e.nI1(48,"number"),e.k0s()(),e.nrm(49,"p-progressBar",49),e.k0s()(),e.j41(50,"td"),e.DNE(51,Ct,3,1,"ng-container",50)(52,dt,4,8,"ng-template",null,3,e.C5r),e.k0s()()),2&n){const t=a.$implicit,r=a.rowIndex,i=e.sdS(4),s=e.sdS(53),o=e.XpG(2);e.R7$(2),e.Y8G("ngIf",o.getRankIcon(r))("ngIfElse",i),e.R7$(5),e.Y8G("ngStyle",o.getRecipientAvatarStyle(t.UserName)),e.R7$(),e.SpI(" ",o.getInitials(t.UserName)," "),e.R7$(3),e.SpI(" ",t.UserName.length>14?e.brH(12,21,t.UserName,0,14)+"...":t.UserName," "),e.R7$(6),e.SpI(" ",e.bMT(19,30,e.ii3(18,25,o.getMonthlyTarget(t),o.currencyCode,"symbol-narrow","1.0-2")),"/monthly "),e.R7$(4),e.JRh(o.getTotalOpportunities(t)),e.R7$(3),e.JRh(t.WonOpportunities),e.R7$(2),e.JRh(e.bMT(28,37,e.ii3(27,32,t.WonAmount,o.currencyCode,"symbol-narrow","1.0-2"))),e.R7$(5),e.SpI("",e.i5U(32,39,t.AvgCloseDays,"1.0-0"),"d"),e.R7$(3),e.Y8G("ngClass",t.ConversionRate>50?"bg-green-100 text-green-400 border-round-2xl":"bg-orange-50 text-orange-600 border-round-2xl"),e.R7$(),e.SpI(" ",e.i5U(36,42,t.ConversionRate,"1.0-0"),"% "),e.R7$(6),e.Lme("",e.bMT(43,50,e.ii3(42,45,t.WonAmount,o.currencyCode,"symbol-narrow","1.0-2"))," / ",e.bMT(45,57,e.ii3(44,52,t.SalesTargetAmount,o.currencyCode,"symbol-narrow","1.0-2")),""),e.R7$(6),e.SpI("",e.i5U(48,59,t.PercentOfTargetAchieved,"1.0-0"),"%"),e.R7$(2),e.Aen(e.lJ4(62,et)),e.Y8G("value",t.PercentOfTargetAchieved)("showValue",!1),e.R7$(2),e.Y8G("ngIf",o.canManageSalesTargets)("ngIfElse",s)}}function an(n,a){1&n&&(e.j41(0,"tr")(1,"td",55),e.EFF(2," No sales data available "),e.k0s()())}function it(n,a){if(1&n&&(e.j41(0,"p-table",26),e.DNE(1,Xe,19,0,"ng-template",27)(2,Ye,54,63,"ng-template",28)(3,an,3,0,"ng-template",29),e.k0s()),2&n){const t=e.XpG();e.Y8G("value",t.data)("responsiveLayout","scroll")}}function kt(n,a){1&n&&(e.j41(0,"div",56),e.EFF(1,"No leaderboard data returned for the selected range."),e.k0s())}function Lt(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",15)(1,"label",19),e.EFF(2,"Select Sales Representative"),e.k0s(),e.j41(3,"p-select",57),e.mxI("ngModelChange",function(i){e.eBV(t);const s=e.XpG();return e.DH7(s.selectedUser,i)||(s.selectedUser=i),e.Njj(i)}),e.bIt("onChange",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onSelectedUserChange())}),e.k0s()()}if(2&n){const t=e.XpG();e.R7$(3),e.Y8G("options",t.data),e.R50("ngModel",t.selectedUser)}}function $r(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",15)(1,"label",19),e.EFF(2,"Select Sales Representatives"),e.k0s(),e.j41(3,"p-multiSelect",58),e.mxI("ngModelChange",function(i){e.eBV(t);const s=e.XpG();return e.DH7(s.selectedUsers,i)||(s.selectedUsers=i),e.Njj(i)}),e.k0s()()}if(2&n){const t=e.XpG();e.R7$(3),e.Y8G("options",t.data),e.R50("ngModel",t.selectedUsers),e.Y8G("filter",!0)}}let On=(()=>{class n{data=[];currencyCode="ZAR";currentUserId="";boardId=0;canManageSalesTargets=!1;isSavingTarget=!1;saveTarget=new e.bkB;saveTargetsBatch=new e.bkB;selectedUser=null;selectedUsers=[];targetValue=0;targetMode="individual";targetModeOptions=[{label:"Individual",value:"individual"},{label:"Selected",value:"selected"},{label:"Team",value:"all"}];getRankIcon(t){return 0===t?"\u{1f3c6}":1===t?"\u{1f948}":2===t?"\u{1f949}":null}getTotalOpportunities(t){return(t.ActiveOpportunities||0)+(t.ClosedOpportunities||0)}getMonthlyTarget(t){return(t.SalesTargetAmount||0)/12}get isEditMode(){return"all"===this.targetMode?this.data.some(t=>!!t.SalesTargetId):!!this.selectedUser?.SalesTargetId}get isTargetFormInvalid(){const t=Number(this.targetValue);return!this.canManageSalesTargets||Number.isNaN(t)||t<0||"individual"===this.targetMode&&!this.selectedUser||"selected"===this.targetMode&&!this.selectedUsers.length||"all"===this.targetMode&&!this.data.length||this.isSavingTarget}openTargetSettings(){this.canManageSalesTargets&&(this.targetMode="individual",this.selectedUser=this.data[0]??null,this.selectedUsers=[],this.targetValue=this.selectedUser?.SalesTargetAmount||0)}openTargetModal(t){this.canManageSalesTargets&&(this.targetMode="individual",this.selectedUser=t,this.selectedUsers=[],this.targetValue=t.SalesTargetAmount||0)}onTargetModeChange(){return"all"===this.targetMode?(this.selectedUser=null,void(this.selectedUsers=[])):"selected"===this.targetMode?(this.selectedUser=null,void(this.selectedUsers=this.selectedUsers.length?this.selectedUsers:[])):(this.selectedUser=this.selectedUser??this.data[0]??null,void(this.targetValue=this.selectedUser?.S
1alesTargetAmount||this.targetValue||0))}onSelectedUserChange(){this.targetValue=this.selectedUser?.SalesTargetAmount||0}getTargetActionLabel(){return"selected"===this.targetMode?"Apply to Selected":"all"===this.targetMode?"Apply to Team":this.isEditMode?"Update Target":"Save Target"}onSubmitTarget(){if(this.isTargetFormInvalid)return;const t=Number(this.targetValue);"selected"!==this.targetMode?"all"!==this.targetMode?this.selectedUser&&this.saveTarget.emit({rep:this.selectedUser,targetAmount:t}):this.saveTargetsBatch.emit({reps:this.data,targetAmount:t}):this.saveTargetsBatch.emit({reps:this.selectedUsers,targetAmount:t})}getInitials(t){const r=(t||"").trim().split(/\s+/).filter(Boolean);return 0===r.length?"":1===r.length?r[0].slice(0,2).toUpperCase():`${r[0][0]}${r[1][0]}`.toUpperCase()}getRecipientAvatarStyle(t){const r=["#3f7ee8","#22c55e","#9333ea","#f59e0b","#ef4444","#06b6d4"];return{background:r[(t||"").split("").reduce((s,o)=>s+o.charCodeAt(0),0)%r.length],color:"#ffffff"}}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-sales-performance-table"]],inputs:{data:"data",currencyCode:"currencyCode",currentUserId:"currentUserId",boardId:"boardId",canManageSalesTargets:"canManageSalesTargets",isSavingTarget:"isSavingTarget"},outputs:{saveTarget:"saveTarget",saveTargetsBatch:"saveTargetsBatch"},standalone:!1,decls:31,vars:18,consts:[["emptyTeam",""],["targetPopover",""],["normalRank",""],["readOnlyTarget",""],[1,"flex","align-items-center","justify-content-between","mb-4","p-2"],[1,"flex","align-items-center","gap-2"],[1,"pi","pi-chart-line","text-blue-600","font-bold"],[1,"font-bold","text-lg"],["pButton","","type","button","icon","pi pi-bullseye","label","Set Targets","class","p-button-text p-button-sm target-header-action","pTooltip","Manage sales targets","tooltipPosition","left",3,"click",4,"ngIf"],["class","custom-table",3,"value","responsiveLayout",4,"ngIf","ngIfElse"],[1,"target-popover","p-fluid"],[1,"target-popover-header"],[1,"target-popover-title"],[1,"target-popover-subtitle"],[1,"target-popover-body"],[1,"field","w-full","mb-3"],["optionLabel","label","optionValue","value","styleClass","target-mode-toggle w-full",3,"ngModelChange","onChange","options","ngModel"],["class","field w-full mb-3",4,"ngIf"],[1,"field","w-full","mb-0"],[1,"target-field-label"],["mode","currency","locale","en-ZA","inputStyleClass","border-blue-500 border-2 border-round-lg py-2 text-sm w-full bg-gray-50",3,"ngModelChange","ngModel","currency","minFractionDigits","min","placeholder"],[1,"target-help-text"],[1,"target-popover-footer"],["label","Cancel","severity","secondary","styleClass","target-popover-button",3,"click","outlined"],["styleClass","target-popover-button target-save-button",3,"click","label","disabled","loading"],["pButton","","type","button","icon","pi pi-bullseye","label","Set Targets","pTooltip","Manage sales targets","tooltipPosition","left",1,"p-button-text","p-button-sm","target-header-action",3,"click"],[1,"custom-table",3,"value","responsiveLayout"],["pTemplate","header"],["pTemplate","body"],["pTemplate","emptymessage"],[1,"text-muted","uppercase","text-xs"],[1,"border-none","border-round-bottom-lg"],["class","text-xl",4,"ngIf","ngIfElse"],[1,"flex","align-items-center","gap-3"],[1,"team-avatar",3,"ngStyle"],[1,"flex","flex-column"],[1,"font-bold","text-900"],[1,"flex","flex-column","mt-1"],[1,"text-gray-500","text-xs","line-height-1"],[1,"text-gray-500","text-xs"],[1,"font-semibold"],[1,"bg-green-100","text-green-400","px-2","py-1","border-round-2xl","font-normal","text-xs"],[1,"font-bold","text-blue-600"],[1,"text-muted"],[1,"pi","pi-clock","mr-1","text-xs"],[1,"px-2","py-1","border-round","text-xs","font-normal",3,"ngClass"],[2,"min-width","150px"],[1,"flex","flex-column","gap-1"],[1,"flex","justify-content-between","text-xs","text-muted"],[3,"value","showValue"],[4,"ngIf","ngIfElse"],[1,"text-xl"],[1,"text-muted","rounded-0"],["pButton","","type","button",1,"p-button-text","p-button-sm","text-secondary","text-xs",3,"click"],[1,"text-xs","font-medium"],["colspan","9",1,"text-center","text-gray-500","py-4"],[1,"empty-state"],["o
1ptionLabel","UserName","placeholder","Select sales rep","styleClass","w-full",3,"ngModelChange","onChange","options","ngModel"],["optionLabel","UserName","placeholder","Search or select representatives...","display","chip","styleClass","w-full target-rep-multiselect",3,"ngModelChange","options","ngModel","filter"]],template:function(r,i){if(1&r){const s=e.RV6();e.j41(0,"div",4)(1,"div",5),e.nrm(2,"i",6),e.j41(3,"span",7),e.EFF(4,"Sales Performance"),e.k0s()(),e.DNE(5,Et,1,0,"button",8),e.k0s(),e.DNE(6,it,4,2,"p-table",9)(7,kt,2,0,"ng-template",null,0,e.C5r),e.j41(9,"p-popover",null,1)(11,"div",10)(12,"div",11)(13,"span",12),e.EFF(14,"Set Sales Target"),e.k0s(),e.j41(15,"small",13),e.EFF(16," Configure target for a specific representative, selected reps, or the entire team. "),e.k0s()(),e.j41(17,"div",14)(18,"div",15)(19,"p-selectButton",16),e.mxI("ngModelChange",function(l){return e.eBV(s),e.DH7(i.targetMode,l)||(i.targetMode=l),e.Njj(l)}),e.bIt("onChange",function(){return e.eBV(s),e.Njj(i.onTargetModeChange())}),e.k0s()(),e.DNE(20,Lt,4,2,"div",17)(21,$r,4,3,"div",17),e.j41(22,"div",18)(23,"label",19),e.EFF(24),e.k0s(),e.j41(25,"p-inputNumber",20),e.mxI("ngModelChange",function(l){return e.eBV(s),e.DH7(i.targetValue,l)||(i.targetValue=l),e.Njj(l)}),e.k0s(),e.j41(26,"small",21),e.EFF(27,"Enter the yearly revenue target"),e.k0s()()(),e.j41(28,"div",22)(29,"p-button",23),e.bIt("click",function(){e.eBV(s);const l=e.sdS(10);return e.Njj(l.hide())}),e.k0s(),e.j41(30,"p-button",24),e.bIt("click",function(){return e.eBV(s),e.Njj(i.onSubmitTarget())}),e.k0s()()()()}if(2&r){const s=e.sdS(8);e.R7$(5),e.Y8G("ngIf",i.canManageSalesTargets),e.R7$(),e.Y8G("ngIf",i.data.length>0)("ngIfElse",s),e.R7$(13),e.Y8G("options",i.targetModeOptions),e.R50("ngModel",i.targetMode),e.R7$(),e.Y8G("ngIf","individual"===i.targetMode),e.R7$(),e.Y8G("ngIf","selected"===i.targetMode),e.R7$(3),e.SpI(" Yearly Target (",i.currencyCode,") "),e.R7$(),e.Mz_("placeholder","",i.currencyCode," 50,000"),e.R50("ngModel",i.targetValue),e.Y8G("currency",i.currencyCode)("minFractionDigits",0)("min",0),e.R7$(4),e.Y8G("outlined",!0),e.R7$(),e.Y8G("label",i.getTargetActionLabel())("disabled",i.isTargetFormInvalid)("loading",i.isSavingTarget)}},dependencies:[q.YU,q.bT,q.B3,Oe.l6,be.Ei,xe._f,xe.$n,L.BC,L.vS,Ae.AM,Se.XI,It.z2,vt.YI,Bt.JC,De.KF,wt.m_,q.P9,q.QX,q.oe,Ue],styles:["[_nghost-%COMP%] .p-progressbar{position:relative;overflow:hidden;height:var(--p-progressbar-height);background:var(--p-progressbar-background);border-radius:var(--p-progressbar-border-radius)}[_nghost-%COMP%] .p-datatable-wrapper{overflow-x:auto}[_nghost-%COMP%] .p-datatable-table{min-width:880px}[_nghost-%COMP%] .p-datatable-thead>tr>th{font-size:.72rem;text-transform:uppercase;letter-spacing:.05em;color:#7a879b;background:#fbfcfe;border-bottom:1px solid #edf2fb}[_nghost-%COMP%] .p-datatable-tbody>tr>td{border-bottom:1px solid #edf2fb;vertical-align:middle}.team-avatar[_ngcontent-%COMP%]{width:2.7rem;height:2.7rem;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;color:#fff;font-weight:800}.empty-state[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;min-height:8rem;border:1px dashed #d7e1ef;border-radius:1rem;color:#61708a;text-align:center;padding:1rem}.target-header-action[_ngcontent-%COMP%]{color:#10b981!important;font-size:.78rem!important;padding:.35rem .55rem!important}[_nghost-%COMP%] .target-header-action .p-button-icon, [_nghost-%COMP%] .target-header-action .p-button-label{color:#10b981!important}.target-popover[_ngcontent-%COMP%]{width:400px;max-width:calc(100vw - 2rem);padding:1.25rem;background:#fff;border-radius:16px;box-shadow:0 18px 44px #0f172a38}.target-popover-header[_ngcontent-%COMP%]{margin-bottom:.9rem}.target-popover-title[_ngcontent-%COMP%]{display:block;color:#111827;font-size:1.2rem;font-weight:800;line-height:1.25}.target-popover-subtitle[_ngcontent-%COMP%]{display:block;color:#111827;font-size:.86rem;line-height:1.35;margin-top:.45rem}.target-popover-body[_ngcontent-%COMP%]{border-bottom:none;padding-bottom:0}.target-field-label[_ngcontent-%COMP%]{display:block;color:#111827;font-size:.84rem;font-weight:800;margin-bottom:.45rem}.target-help-text[_ngcontent-%COMP%]{color:#6b7280;display:block;font-size:.74rem;line-height:1.2;margin-top:.4rem}.target-popover-footer[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;
1gap:.55rem;padding-top:1.1rem}[_nghost-%COMP%] .target-popover .p-selectbutton, [_nghost-%COMP%] .target-popover .p-select, [_nghost-%COMP%] .target-popover .p-multiselect, [_nghost-%COMP%] .target-popover .p-inputnumber{width:100%}[_nghost-%COMP%] .target-popover .p-selectbutton{display:flex;gap:.35rem;padding:.28rem;background:linear-gradient(180deg,#eef2f6,#e5eaf0);border:none;border-radius:999px}[_nghost-%COMP%] .target-mode-toggle .p-togglebutton{flex:1;min-height:2.25rem;padding:.42rem .3rem!important;background:transparent!important;border:none!important;border-radius:999px!important;color:#6b7280!important;box-shadow:none!important;transition:background .15s ease,box-shadow .15s ease,color .15s ease}[_nghost-%COMP%] .target-popover .target-mode-toggle .p-togglebutton.p-togglebutton-checked, [_nghost-%COMP%] .target-popover .target-mode-toggle .p-togglebutton.p-highlight, [_nghost-%COMP%] .target-popover .target-mode-toggle .p-togglebutton[aria-pressed=true], [_nghost-%COMP%] .target-popover .target-mode-toggle .p-button.p-highlight, [_nghost-%COMP%] .target-popover .target-mode-toggle .p-button[aria-pressed=true]{background:linear-gradient(180deg,#2588f3,#1773d4)!important;border-color:transparent!important;color:#fff!important;box-shadow:0 8px 16px #1773d452!important}[_nghost-%COMP%] .target-popover .target-mode-toggle .p-togglebutton.p-togglebutton-checked .p-togglebutton-content, [_nghost-%COMP%] .target-popover .target-mode-toggle .p-togglebutton.p-highlight .p-togglebutton-content, [_nghost-%COMP%] .target-popover .target-mode-toggle .p-togglebutton[aria-pressed=true] .p-togglebutton-content, [_nghost-%COMP%] .target-popover .target-mode-toggle .p-button.p-highlight .p-button-label, [_nghost-%COMP%] .target-popover .target-mode-toggle .p-button[aria-pressed=true] .p-button-label, [_nghost-%COMP%] .target-popover .target-mode-toggle .p-togglebutton.p-togglebutton-checked .p-togglebutton-label, [_nghost-%COMP%] .target-popover .target-mode-toggle .p-togglebutton.p-highlight .p-togglebutton-label, [_nghost-%COMP%] .target-popover .target-mode-toggle .p-togglebutton[aria-pressed=true] .p-togglebutton-label{background:transparent!important;color:#fff!important}[_nghost-%COMP%] .target-mode-toggle .p-togglebutton-label{font-size:.8rem;font-weight:700;line-height:1.1;white-space:nowrap}[_nghost-%COMP%] .target-popover .p-select, [_nghost-%COMP%] .target-popover .p-multiselect{border-radius:8px!important;border-color:#c7cdd5!important;min-height:2.65rem}[_nghost-%COMP%] .target-popover .p-select:not(.p-disabled).p-focus, [_nghost-%COMP%] .target-popover .p-multiselect:not(.p-disabled).p-focus{border-color:#2b7dcc!important;box-shadow:0 0 0 1px #2b7dcc!important}[_nghost-%COMP%] .target-popover .p-select-label, [_nghost-%COMP%] .target-popover .p-multiselect-label, [_nghost-%COMP%] .target-popover .p-inputnumber-input{font-size:.86rem!important}[_nghost-%COMP%] .target-popover .p-inputnumber-input{border-color:#c7cdd5!important;border-radius:8px!important;box-shadow:none!important;color:#111827!important;font-size:1.08rem!important;font-weight:500!important;min-height:2.9rem;padding:.55rem .8rem!important}[_nghost-%COMP%] .target-popover .p-inputnumber-input:focus{border-color:#2b7dcc!important;box-shadow:0 0 0 1px #2b7dcc!important}[_nghost-%COMP%] .target-popover-button{border-radius:8px!important;font-size:.82rem!important;font-weight:700!important;padding:.55rem .8rem!important}[_nghost-%COMP%] .target-save-button{background:linear-gradient(180deg,#2588f3,#1773d4)!important;border-color:#1773d4!important;color:#fff!important}@media (max-width: 640px){.target-popover[_ngcontent-%COMP%]{width:calc(100vw - 2rem);padding:1.1rem}.target-popover-title[_ngcontent-%COMP%]{font-size:1.2rem}.target-popover-subtitle[_ngcontent-%COMP%]{font-size:.88rem}[_nghost-%COMP%] .target-mode-toggle .p-togglebutton-label{font-size:.78rem}}"]})}return n})();var An=ee(9951),At=ee(20491),dn=ee(65716);const Wt=()=>[1,2,3,4,5,6],hn=()=>[1,2,3,4];function lr(n,a){1&n&&(e.j41(0,"div",16)(1,"div",17),e.nrm(2,"p-skeleton",18)(3,"p-skeleton",19),e.k0s(),e.nrm(4,"p-skeleton",20),e.k0s())}function Ki(n,a){1&n&&(e.j41(0,"div",21),e.nrm(1,"p-skeleton",22)(2,"p-skeleton",23),e.k0s())}function Ha(n,a){1&n&&(e.j41(0,"div",13)(1,"p-card",14),e.DNE(2,lr,5,0,"ng-template",5)(3,Ki,3,0,"ng-template",15),e.k0s()())}function Vr(n,a){1&n&&(e.j41(0,"div",24),e.nrm(1,"p-skeleton",25),e.k0s())}function Hn(n,a){1&n&&(e.j41(0,"div",27),e.nrm(1,"p-skeleton",28),e.k0s())}function si(n,a){1&n&&e.DNE(0,Hn,2,0,"div",26),2&n&&e.Y8G("ngForOf",e.lJ4(1,hn))}function za(n,a){1&n&&(e.j41(0,"div",24),e.nrm(1,"p-skeleton",25),e.k0s())}function ru(n,a){1&n&&e.nrm(0,"p-skeleton",29)}function iu(n,a){1&n&&(e.j41(0,"div",24),e.nrm(1,"p-skeleton",25),e.k0s())}function au(n,a){1&n&&(e.j41(0,"div",30),e.nrm(1,"p-skeleton",31),e.k0s())}let su=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-sales-report-skeleton"]],standalone:!1,decls:40,vars:2,consts:[[1,"grid","mb-3"],["class","col-6 sm:col-4 md:col-2",4,"ngFor","ngForOf"],[1,"col-12","md:col-6"],[1,"h-full","shadow-1","border-round-lg","dashboard-card"],["pTemplate","header"],["pTemplate","content"],[1,"grid","h-full"],[1,"col-12","md:col-6","flex","flex-column","h-full"],[1,"border-round-lg","mb-3","flex-1","dashboard-card"],[1,"mb-2","pb-2"],["
1width","70%","height","1rem"],["width","50%","height","2rem"],[1,"border-round-lg","flex-1","dashboard-card"],[1,"col-6","sm:col-4","md:col-2"],[1,"h-full","shadow-2","border-round-lg"],["pTemplate","footer"],[1,"flex","flex-column","justify-content-between","h-full"],[1,"flex","align-items-center","flex-wrap"],["width","8rem","height","1rem",1,"mr-2","flex-grow-1"],["shape","circle","size","2rem",1,"mt-2","sm:mt-0"],["width","6rem","height","1.5rem",1,"mt-2"],[1,"flex","justify-content-between","align-items-center","w-full",2,"background","#f6f8fb"],["width","4rem","height","1rem"],["width","3rem","height","1rem"],[1,"px-3","pt-3"],["width","40%","height","1.2rem"],["class","mb-2",4,"ngFor","ngForOf"],[1,"mb-2"],["width","80%","height","2rem"],["width","100%","height","200px"],[1,"flex","justify-content-center","align-items-center"],["shape","circle","size","200px"]],template:function(r,i){1&r&&(e.j41(0,"div",0),e.DNE(1,Ha,4,0,"div",1),e.k0s(),e.j41(2,"div",0)(3,"div",2)(4,"p-card",3),e.DNE(5,Vr,2,0,"ng-template",4)(6,si,1,2,"ng-template",5),e.k0s()(),e.j41(7,"div",2)(8,"div",6)(9,"div",7)(10,"p-card",8)(11,"div",9),e.nrm(12,"p-skeleton",10),e.k0s(),e.j41(13,"div"),e.nrm(14,"p-skeleton",11),e.k0s()(),e.j41(15,"p-card",12)(16,"div",9),e.nrm(17,"p-skeleton",10),e.k0s(),e.j41(18,"div"),e.nrm(19,"p-skeleton",11),e.k0s()()(),e.j41(20,"div",7)(21,"p-card",8)(22,"div",9),e.nrm(23,"p-skeleton",10),e.k0s(),e.j41(24,"div"),e.nrm(25,"p-skeleton",11),e.k0s()(),e.j41(26,"p-card",12)(27,"div",9),e.nrm(28,"p-skeleton",10),e.k0s(),e.j41(29,"div"),e.nrm(30,"p-skeleton",11),e.k0s()()()()()(),e.j41(31,"div",0)(32,"div",2)(33,"p-card",3),e.DNE(34,za,2,0,"ng-template",4)(35,ru,1,0,"ng-template",5),e.k0s()(),e.j41(36,"div",2)(37,"p-card",3),e.DNE(38,iu,2,0,"ng-template",4)(39,au,2,0,"ng-template",5),e.k0s()()()),2&r&&(e.R7$(),e.Y8G("ngForOf",e.lJ4(1,Wt)))},dependencies:[q.Sq,At.Zp,be.Ei,dn.EA],encapsulation:2})}return n})();const ou=["reportContent"],lu=["quillAttachmentInput"],cu=()=>({"min-height":"200px","max-height":"500px",width:"100%","background-color":"rgb(250,250,250)",border:"none","padding-bottom":"4rem"}),du=()=>({"min-height":"300px","max-height":"500px",width:"100%","background-color":"rgb(250,250,250)",border:"none"}),pu=()=>({width:"500px"});function uu(n,a){1&n&&e.nrm(0,"app-lockfeatures")}function fu(n,a){1&n&&(e.j41(0,"div",79),e.nrm(1,"app-sales-report-skeleton"),e.k0s())}function mu(n,a){1&n&&(e.j41(0,"div",151),e.EFF(1,"Sample Data"),e.k0s())}function hu(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",152),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG(3);return e.Njj(s.onDateRangeSelect(i.value))}),e.EFF(1),e.k0s()}if(2&n){const t=a.$implicit,r=e.XpG(3);e.AVh("active",r.selectedDateRange===t.value&&!r.isCustomRange),e.R7$(),e.SpI(" ",t.label," ")}}function gu(n,a){if(1&n&&(e.j41(0,"span",162),e.EFF(1),e.k0s()),2&n){const t=e.XpG(4);e.R7$(),e.JRh(t.activeFilterCount)}}function _u(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",163),e.bIt("click",function(){e.eBV(t);const i=e.XpG(4);return e.Njj(i.clearFilters())}),e.EFF(1," Clear all filters "),e.k0s()}}function xu(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",153)(1,"button",154),e.bIt("click",function(i){e.eBV(t);const s=e.sdS(7);return e.Njj(s.toggle(i))}),e.nrm(2,"i",155),e.j41(3,"span"),e.EFF(4,"Filters"),e.k0s(),e.DNE(5,gu,2,1,"span",156),e.k0s(),e.j41(6,"p-popover",null,11)(8,"div",157)(9,"div",158)(10,"label"),e.EFF(11,"Assignees"),e.k0s(),e.j41(12,"p-multiSelect",159),e.mxI("ngModelChange",function(i){e.eBV(t);const s=e.XpG(3);return e.DH7(s.selectedAssigneeIds,i)||(s.selectedAssigneeIds=i),e.Njj(i)}),e.bIt("onChange",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.applyFilters())}),e.k0s()(),e.j41(13,"div",158)(14,"label"),e.EFF(15,"Tags"),e.k0s(),e.j41(16,"p-multiSelect",160),e.mxI("ngModelChange",function(i){e.eBV(t);const s=e.XpG(3);return e.DH7(s.selectedTagNames,i)||(s.selectedTagNames=i),e.Njj(i)}),e.bIt("onChange",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.applyFilters())}),e.k0s()(),e.DNE(17,_u,2,0,"button",161),e.k0s()()()}if(2&n){const t=e.XpG(3);e.R7$(),e.AVh("active",t.hasActiveFilters),e.R7$(4),e.Y8G("ngIf",t.hasActiveFilters),e.R7$(7),e.Y8G("options",t.assigneeOptions),e.R50("ngModel",t.selectedAssigneeIds),e.Y8G("filter",!0)("showToggleAll",!1)("maxSelectedLabels",2),e.R7$(4),e.Y8G("options",t.tagOptions),e.R50("ngModel",t.selectedTagNames),e.Y8G("filter",!0)("showToggleAll",!1)("maxSelectedLabels",2),e.R7$(),e.Y8G("ngIf",t.hasActiveFilters)}}function vu(n,a){1&n&&e.nrm(0,"i",95)}function bu(n,a){if(1&n){const t=e.RV6();e.j41(0,"span",168),e.nrm(1,"i",169),e.EFF(2),e.j41(3,"button",170),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG(4);return e.Njj(s.removeAssigneeFilter(i))}),e.nrm(4,"i",27),e.k0s()()}if(2&n){const t=a.$implicit,r=e.XpG(4);e.R7$(2),e.SpI(" ",r.getAssigneeName(t)," ")}}function Cu(n,a){if(1&n){const t=e.RV6();e.j41(0,"span",171),e.nrm(1,"i",172),e.EFF(2),e.j41(3,"button",170),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG(4);return e.Njj(s.removeTagFilter(i))}),e.nrm(4,"i",27),e.k0s()()}if(2&n){const t=a.$implicit;e.R7$(2),e.SpI(" ",t," ")}}function ku(n,a){if(1&n){const t=e.RV6();e.j41(0,"section",164)(1,"div",165),e.DNE(2,bu,5,1,"span",166)(3,Cu,5,1,"span",167),e.j41(4,"button",163),e.bIt("click",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.clearFilters())}),e.EFF(5,"Clear all"),e.k0s()()()}if(2&n){const t=e.XpG(3);e.R7$(2),e.Y8G("ngForOf",t.selectedAssigneeIds),e.R7$(),e.Y8G("ngForOf",t.selectedTagNames)}}function Tu(n,a){if(1&n&&(e.qex(0),e.EFF(1),e.nI1(2,"currency"),e.nI1(3,"shortNumber"),e.bVm()),2&n){const t=e.XpG().$implicit,r=e.XpG(3);e.R7$(),e.SpI(" ",e.bMT(3,6,e.ii3(2,1,t.value,r.currencyCode,"symbol-narrow","1.0-1"))," ")}}function wu(n,a){if(1&n&&(e.EFF(0),e.nI1(1,"number")),2&n){const t=e.XpG().$implicit;e.SpI("",e.i5U(1,1,t.value,"1.0-0"),"%")}}function yu(n,a){if(1&n){const t=e.RV6();e.j41(0,"article",173),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG(3);return e.Njj("Pipeline Value"===i.title?s.openCardList("active"):"Won Revenue"===i.title?s.openCardList("won"):"Win Rate"===i.title?s.openCardList("closed"):null)}),e.j41(1,"div",174)(2,"div",175),e.nrm(3,"i"),e.k0s(),e.j41(4,"div",176),e.EFF(5),e.k0s()(),e.j41(6,"div",177),e.EFF(7),e.k0s(),e.j41(8,"div",178),e.DNE(9,Tu,4,8,"ng-container",179)(10,wu,2,4,"ng-template",null,12,e.C5r),e.k0s(),e.j41(12,"div",180),e.EFF(13),e.k0s()()}if(2&n){const t=a.$implicit,r=e.sdS(11),i=e.XpG(3);e.AVh("clickable","Pipeline Value"===t.title||"Won Revenue"===t.title||"Win Rate"===t.title),e.R7$(2),e.Y8G("ngClass","tone-"+t.iconTone),e.R7$(),e.HbH(t.icon),e.R7$(),e.Y8G("ngClass",i.getDeltaTone(t.delta)),e.R7$(),e.SpI(" ",i.getDeltaLabel(t.delta,"Win Rate"===t.title)," "),e.R7$(2),e.JRh(t.title),e.R7$(2),e.Y8G("ngIf","Win Rate"!==t.title)("ngIfElse",r),e.R7$(4),e.JRh(t.caption)}}function Fu(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",181),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG(3);return e.Njj(s.openStageList(i))}),e.j41(1,"div",182)(2,"div",183),e.nrm(3,"span",184),e.j41(4,"span",185),e.EFF(5),e.k0s(),e.j41(6,"span",186),e.EFF(7),e.k0s()(),e.j41(8,"div",187),e.EFF(9),e.nI1(10,"currency"),e.nI1(11,"shortNumber"),e.k0s()(),e.j41(12,"div",188)(13,"div",189)(14,"span",190),e.EFF(15),e.nI1(16,"number"),e.k0s()()()()}if(2&n){const t=a.$implicit,r=e.XpG(3);e.AVh("closed-outcome",t.isClosedOutcome),e.R7$(3),e.xc7("background",t.color),e.R7$(2),e.JRh(t.name),e.R7$(2),e.SpI("",t.count," deals"),e.R7$(2),e.JRh(e.bMT(11,17,e.ii3(10,12,t.amount,r.currencyCode,"symbol-narrow","1.0-1"))),e.R7$(4),e.xc7("background",t.color)("width",t.percentage,"%"),e.R7$(2),e.SpI("",e.i5U(16,19,t.percentage,"1.0-0"),"%")}}function Su(n,a){if(1&n&&e.nrm(0,"p-chart",191),2&n){const t=e.XpG(3);e.Y8G("data",t.pipelineValueChartData)("options",t.pipelineValueChartOptions)}}function Eu(n,a){if(1&n&&e.nrm(0,"p-chart",192),2&n){const t=e.XpG(3);e.Y8G("data",t.pipelineVelocityChartData)("options",t.pipelineVelocityChartOptions)}}function Iu(n,a){if(1&n&&e.nrm(0,"p-chart",202),2&n){const t=e.XpG(4);e.Y8G("data",t.lossAnalysisChartData)("options",t.lossAnalysisChartOptions)}}function Du(n,a){if(1&n&&(e.j41(0,"div",205),e.nrm(1,"span",206),e.j41(2,"span",207),e.EFF(3),e.k0s()()),2&n){const t=a.$implicit;e.R7$(),e.xc7("background",t.color),e.R7$(2),e.JRh(t.reason)}}function Ru(n,a){if(1&n&&(e.j41(0,"div",203),e.DNE(1,Du,4,3,"div",204),e.k0s()),2&n){const t=e.XpG(4);e.R7$(),e.Y8G("ngForOf",t.chartLossReasons)}}function ju(n,a){if(1&n&&(e.j41(0,"div",208)(1,"div",209)(2,"span",210),e.nrm(3,"span",184),e.EFF(4),e.k0s(),e.j41(5,"span"),e.EFF(6),e.nI1(7,"number"),e.k0s(),e.j41(8,"strong"),e.EFF(9),e.nI1(10,"currency"),e.nI1(11,"shortNumber"),e.k0s()(),e.j41(12,"div",211),e.nrm(13,"div",212),e.k0s()()),2&n){const t=a.$implicit,r=e.XpG(4);e.R7$(3),e.xc7("background",t.color),e.R7$(),e.SpI(" ",t.reason," "),e.R7$(2),e.Lme("",t.count," - ",e.i5U(7,10,t.percentage,"1.0-0"),"%"),e.R7$(3),e.JRh(e.bMT(11,18,e.ii3(10,13,t.amount,r.currencyCode,"symbol-narrow","1.0-1"))),e.R7$(4),e.xc7("background",t.color)("width",t.percentage,"%")}}function Au(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",213),e.bIt("click",function(){e.eBV(t);const i=e.XpG(4);return e.Njj(i.openLossReasonsList())}),e.EFF(1),e.nrm(2,"i",214),e.k0s()}if(2&n){const t=e.XpG(4);e.R7$(),e.SpI(" View all ",t.lossReasons.length," reasons ")}}function Mu(n,a){if(1&n&&(e.j41(0,"div",215),e.nrm(1,"i",216),e.EFF(2," Top loss driver: "),e.j41(3,"strong"),e.EFF(4),e.k0s(),e.EFF(5),e.nI1(6,"number"),e.k0s()),2&n){const t=e.XpG(4);e.R7$(4),e.JRh(t.lossReasons[0].reason),e.R7$(),e.E5c(" (",t.lossReasons[0].count," of ",(null==t.stats?null:t.stats.LostOpportunities)||0," - ",e.i5U(6,4,t.lossReasons[0].percentage,"1.0-0"),"%) ")}}function Pu(n,a){if(1&n&&(e.j41(0,"div",193)(1,"div",194)(2,"div",195),e.DNE(3,Iu,1,2,"p-chart",196),e.k0s(),e.DNE(4,Ru,2,1,"div",197),e.k0s(),e.j41(5,"div",198),e.DNE(6,ju,14,20,"div",199)(7,Au,3,1,"button",200)(8,Mu,7,7,"div",201),e.k0s()()),2&n){const t=e.XpG(3);e.R7$(3),e.Y8G("ngIf",t.lossAnalysisChartData&&t.lossAnalysisChartOptions),e.R7$(),e.Y8G("ngIf",t.chartLossReasons.length>0),e.R7$(2),e.Y8G("ngForOf",t.displayLossReasons),e.R7$(),e.Y8G("ngIf",t.hasMoreLossReasons),e.R7$(),e.Y8G("ngIf",t.lossReasons[0])}}function Ou(n,a){1&n&&(e.j41(0,"div",217),e.EFF(1,"No loss reasons captured in the selected period."),e.k0s())}function Nu(n,a){if(1&n&&(e.j41(0,"div",220)(1,"div",221),e.EFF(2),e.k0s(),e.j41(3,"div",222)(4,"div",223),e.EFF(5),e.k0s(),e.j41(6,"div",224),e.EFF(7),e.k0s()(),e.j41(8,"div",225),e.EFF(9),e.nI1(10,"currency"),e.nI1(11,"shortNumber"),e.k0s()()),2&n){const t=a.$implicit,r=a.index,i=e.XpG(4);e.R7$(2),e.JRh(r+1),e.R7$(3),e.JRh(t.Title),e.R7$(2),e.JRh((null==t.AssignedUsers?null:t.AssignedUsers[0])||"Unassigned"),e.R7$(2),e.JRh(e.bMT(11,9,e.ii3(10,4,t.Amount,i.currencyCode,"symbol-narrow","1.0-1")))}}function Gu(n,a){if(1&n&&(e.j41(0,"div",218),e.DNE(1,Nu,12,11,"div",219),e.k0s()),2&n){const t=e.XpG(3);e.R7$(),e.Y8G("ngForOf",t.topOpenDeals)}}function Bu(n,a){1&n&&(e.j41(0,"div",217),e.EFF(1,"No open deals found in this range."),e.k0s())}function Lu(n,a){1&n&&e.nrm(0,"span",232)}function $u(n,a){1&n&&(e.j41(0,"span",233),e.EFF(1,"\u26a0"),e.k0s())}function Vu(n,a){if(1&n&&(e.j41(0,"div",228)(1,"div",229)(2,"div",230),e.DNE(3,Lu,1,0,"span",231)(4,$u,2,0,"ng-template",null,13,e.C5r),e.j41(6,"div",223),e.EFF(7),e.k0s()(),e.j41(8,"div",224),e.EFF(9),e.k0s()(),e.j41(10,"div",225),e.EFF(11),e.nI1(12,"currency"),e.nI1(13,"shortNumber"),e.k0s()()),2&n){const t=a.$implicit,r=a.index,i=e.sdS(5),s=e.XpG(4);e.Y8G("ngClass",s.getNeedsAttentionTone(r)),e.R7$(3),e.Y8G("ngIf",s.isHotAttentionDeal(r))("ngIfElse",i),e.R7$(4),e.JRh(t.Title),e.R7$(2),e.JRh(s.getNeedsAttentionLabel(t)),e.R7$(2),e.JRh(e.bMT(13,11,e.ii3(12,6,t.Amount,s.currencyCode,"symbol-narrow","1.0-1")))}}function Uu(n,a){if(1&n&&(e.j41(0,"div",226),e.DNE(1,Vu,14,13,"div",227),e.k0s()),2&n){const t=e.XpG(3);e.R7$(),e.Y8G("ngForOf",t.needsAttentionDeals)}}function Xu(n,a){1&n&&(e.j41(0,"div",234),e.EFF(1," View all attention items "),e.k0s())}function Yu(n,a){1&n&&(e.j41(0,"div",217),e.EFF(1,"No overdue open deals for this period."),e.k0s())}function Wu(n,a){if(1&n&&(e.j41(0,"div",237)(1,"div",209)(2,"span"),e.EFF(3),e.k0s(),e.j41(4,"span"),e.EFF(5),e.nI1(6,"number"),e.k0s()(),e.j41(7,"div",211),e.nrm(8,"div",238),e.k0s()()),2&n){const t=a.$implicit;e.R7$(3),e.JRh(t.name),e.R7$(2),e.Lme("",t.count," (",e.i5U(6,5,t.percentage,"1.0-0"),"%)"),e.R7$(3),e.xc7("width",t.percentage,"%")}}function Hu(n,a){if(1&n&&(e.j41(0,"div",235),e.DNE(1,Wu,9,8,"div",236),e.k0s()),2&n){const t=e.XpG(3);e.R7$(),e.Y8G("ngForOf",t.leadSources)}}function zu(n,a){1&n&&(e.j41(0,"div",217),e.EFF(1,"No lead source data found in this range."),e.k0s())}function qu(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",80,4),e.DNE(2,mu,2,0,"div",81),e.j41(3,"section",82)(4,"div",83)(5,"div",84),e.DNE(6,hu,2,3,"button",85),e.k0s(),e.j41(7,"div",86)(8,"button",87),e.bIt("click",function(i){e.eBV(t);const s=e.sdS(13);return e.Njj(s.toggle(i))}),e.nrm(9,"i",88),e.j41(10,"span"),e.EFF(11),e.k0s()(),e.j41(12,"p-popover",null,5)(14,"p-datePicker",89),e.bIt("ngModelChange",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.onCustomStartDate(i))})("onSelect",function(){e.eBV(t);const i=e.sdS(13);return e.Njj(i.hide())}),e.k0s()(),e.j41(15,"span",90),e.EFF(16,"to"),e.k0s(),e.j41(17,"button",87),e.bIt("click",function(i){e.eBV(t);const s=e.sdS(22);return e.Njj(s.toggle(i))}),e.nrm(18,"i",88),e.j41(19,"span"),e.EFF(20),e.k0s()(),e.j41(21,"p-popover",null,6)(23,"p-datePicker",91),e.bIt("ngModelChange",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.onCustomEndDate(i))})("onSelect",function(){e.eBV(t);const i=e.sdS(22);return e.Njj(i.hide())}),e.k0s()()(),e.DNE(24,xu,18,14,"div",92),e.k0s(),e.j41(25,"div",93)(26,"button",94),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.exportPdf())}),e.nrm(27,"i",95),e.j41(28,"span"),e.EFF(29,"Export PDF"),e.k0s()(),e.j41(30,"button",96),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.sendviaWhatsAppPdf())}),e.DNE(31,vu,1,0,"i",97),e.j41(32,"span"),e.EFF(33),e.k0s()(),e.j41(34,"button",98),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.openEmailModal())}),e.nrm(35,"i",22),e.j41(36,"span"),e.EFF(37,"Send Report"),e.k0s()()()(),e.DNE(38,ku,6,2,"section",99),e.j41(39,"section",100),e.DNE(40,yu,14,11,"article",101),e.k0s(),e.j41(41,"section",102)(42,"article",103)(43,"div",104)(44,"div")(45,"h2"),e.EFF(46,"Pipeline by Stage"),e.k0s(),e.j41(47,"p"),e.EFF(48,"Conversion flow and stage value"),e.k0s()(),e.j41(49,"span",105),e.EFF(50),e.k0s()(),e.j41(51,"div",106),e.DNE(52,Fu,17,22,"button",107),e.k0s()(),e.j41(53,"article",108)(54,"div",104)(55,"div",109)(56,"div",110),e.nrm(57,"i",111),e.k0s(),e.j41(58,"div")(59,"h2"),e.EFF(60,"Forec
1ast"),e.k0s()()(),e.j41(61,"span",105),e.EFF(62),e.k0s()(),e.j41(63,"div",112)(64,"div",113)(65,"div",114),e.EFF(66,"Best Case"),e.k0s(),e.j41(67,"div",115),e.EFF(68),e.nI1(69,"currency"),e.nI1(70,"shortNumber"),e.k0s(),e.j41(71,"div",116),e.nrm(72,"div",117),e.k0s()(),e.j41(73,"div",113)(74,"div",114),e.EFF(75,"Expected (Weighted)"),e.k0s(),e.j41(76,"div",118),e.EFF(77),e.nI1(78,"currency"),e.nI1(79,"shortNumber"),e.k0s(),e.j41(80,"div",116),e.nrm(81,"div",119),e.k0s()(),e.j41(82,"div",113)(83,"div",114),e.EFF(84,"Closed Won"),e.k0s(),e.j41(85,"div",120),e.EFF(86),e.nI1(87,"currency"),e.nI1(88,"shortNumber"),e.k0s(),e.j41(89,"div",116),e.nrm(90,"div",121),e.k0s()(),e.j41(91,"div",122)(92,"span"),e.EFF(93,"Avg Deal Size"),e.k0s(),e.j41(94,"strong"),e.EFF(95),e.nI1(96,"currency"),e.nI1(97,"shortNumber"),e.k0s()()()()(),e.j41(98,"section",123)(99,"article",124)(100,"div",104)(101,"div")(102,"h2"),e.EFF(103,"Pipeline Value by Stage"),e.k0s(),e.j41(104,"p"),e.EFF(105,"Where the money sits"),e.k0s()()(),e.j41(106,"div",125),e.DNE(107,Su,1,2,"p-chart",126),e.k0s()(),e.j41(108,"article",124)(109,"div",104)(110,"div",127)(111,"span",128),e.nrm(112,"i",129),e.k0s(),e.j41(113,"div")(114,"h2"),e.EFF(115,"Pipeline Velocity"),e.k0s(),e.j41(116,"p"),e.EFF(117,"Value moving through funnel"),e.k0s()()(),e.j41(118,"span",105),e.EFF(119),e.k0s()(),e.j41(120,"div",125),e.DNE(121,Eu,1,2,"p-chart",130),e.k0s()()(),e.j41(122,"section",131)(123,"article",132)(124,"div",104)(125,"div",133)(126,"span",134),e.nrm(127,"i",135),e.k0s(),e.j41(128,"div")(129,"h2"),e.EFF(130,"Loss Analysis"),e.k0s(),e.j41(131,"p"),e.EFF(132,"Why deals do not convert"),e.k0s()()(),e.j41(133,"div",136)(134,"span"),e.EFF(135,"Total lost revenue"),e.k0s(),e.j41(136,"strong"),e.EFF(137),e.nI1(138,"currency"),e.nI1(139,"shortNumber"),e.k0s(),e.j41(140,"div",137),e.EFF(141),e.k0s()()(),e.DNE(142,Pu,9,5,"div",138)(143,Ou,2,0,"ng-template",null,7,e.C5r),e.k0s()(),e.j41(145,"section",139)(146,"article",140),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.openCardList("active"))}),e.j41(147,"div",104)(148,"div",127),e.nrm(149,"i",141),e.j41(150,"h2"),e.EFF(151,"Top Open Deals"),e.k0s()(),e.j41(152,"span",105),e.EFF(153),e.k0s()(),e.DNE(154,Gu,2,1,"div",142)(155,Bu,2,0,"ng-template",null,8,e.C5r),e.k0s(),e.j41(157,"article",140),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.openCardList("active"))}),e.j41(158,"div",104)(159,"div",127)(160,"span",143),e.EFF(161,"\u{1f525}"),e.k0s(),e.j41(162,"h2"),e.EFF(163,"Needs Attention"),e.k0s()(),e.j41(164,"span",105),e.EFF(165),e.k0s()(),e.DNE(166,Uu,2,1,"div",144)(167,Xu,2,0,"div",145)(168,Yu,2,0,"ng-template",null,9,e.C5r),e.k0s(),e.j41(170,"article",146)(171,"div",104)(172,"div",127),e.nrm(173,"i",147),e.j41(174,"h2"),e.EFF(175,"Lead Sources"),e.k0s()(),e.j41(176,"span",105),e.EFF(177),e.k0s()(),e.DNE(178,Hu,2,1,"div",148)(179,zu,2,0,"ng-template",null,10,e.C5r),e.k0s()(),e.j41(181,"section",149)(182,"app-sales-performance-table",150),e.bIt("saveTarget",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.saveSalesTarget(i))})("saveTargetsBatch",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.saveSalesTargetsBatch(i))}),e.k0s()()()}if(2&n){const t=e.sdS(144),r=e.sdS(156),i=e.sdS(169),s=e.sdS(180),o=e.XpG(2);e.AVh("dummy-data",o.isDummyData)("is-refreshing",o.isRefreshing),e.R7$(2),e.Y8G("ngIf",o.isDummyData),e.R7$(4),e.Y8G("ngForOf",o.salesDateRanges),e.R7$(2),e.AVh("has-value",o.customStartDate),e.R7$(3),e.JRh(o.customStartDate?o.formatShortDate(o.customStartDate):"Start"),e.R7$(3),e.Y8G("inline",!0)("ngModel",o.customStartDate)("maxDate",o.today),e.R7$(3),e.AVh("has-value",o.customEndDate),e.R7$(3),e.JRh(o.customEndDate?o.formatShortDate(o.customEndDate):"End"),e.R7$(3),e.Y8G("inline",!0)("ngModel",o.customEndDate)("minDate",o.customStartDate||void 0)("maxDate",o.today),e.R7$(),e.Y8G("ngIf",!o.isDummyData),e.R7$(2),e.Y8G("outlined",!0),e.R7$(4),e.Y8G("outlined",!0)("loading",o.isSendingWhatsAppPdf)("disabled",o.isSendingWhatsAppPdf),e.R7$(),e.Y8G("ngIf",!o.isSendingWhatsAppPdf),e.R7$(2),e.SpI(" ",o.isSendingWhatsAppPdf?"Sending...":"Send via WhatsApp"," "),e.R7$(5),e.Y8G("ngIf",o.hasActiveFilters),e.R7$(2),e.Y8G("ngForOf",o.heroMetrics),e.R7$(10),e.SpI("",o.totalDeals," deals"),e.R7$(2),e.Y8G("ngForOf",o.stageRows),e.R7$(10),e.JRh(o.selectedRangeLabel),e.R7$(6),e.JRh(e.bMT(70,69,e.ii3(69,64,o.bestCaseValue,o.currencyCode,"symbol-narrow","1.0-1"))),e.R7$(4),e.xc7("width",100,"%"),e.R7$(5),e.JRh(e.bMT(79,76,e.ii3(78,71,o.weightedForecast,o.currencyCode,"symbol-narrow","1.0-1"))),e.R7$(4),e.xc7("width",o.getProgressWidth(o.weightedForecast,o.bestCaseValue),"%"),e.R7$(5),e.JRh(e.bMT(88,83,e.ii3(87,78,o.wonRevenue,o.currencyCode,"symbol-narrow","1.0-1"))),e.R7$(4),e.xc7("width",o.getProgressWidth(o.wonRevenue,o.bestCaseValue),"%"),e.R7$(5),e.JRh(e.bMT(97,90,e.ii3(96,85,o.avgDealSize,o.currencyCode,"symbol-narrow","1.0-1"))),e.R7$(12),e.Y8G("ngIf",o.pipelineValueChartData&&o.pipelineValueChartOptions),e.R7$(12),e.JRh(o.pipelineVelocityLabel),e.R7$(2),e.Y8G("ngIf",o.pipelineVelocityChartData&&o.pipelineVelocityChartOptions),e.R7$(16),e.JRh(e.bMT(139,97,e.ii3(138,92,(null==o.stats?null:o.stats.LostAmount)||0,o.currencyCode,"symbol-narrow","1.0-1"))),e.R7$(4),e.SpI("",(null==o.stats?null:o.stats.LostOpportunities)||0," deals"),e.R7$(),e.Y8G("ngIf",o.lossReasons.length>0)("ngIfElse",t),e.R7$(11),e.JRh(o.topOpenDeals.length),e.R7$(),e.Y8G("ngIf",o.topOpenDeals.length>0)("ngIfElse",r),e.R7$(11),e.JRh(o.needsAttentionTotal),e.R7$(),e.Y8G("ngIf",o.needsAttentionDeals.length>0)("ngIfElse",i),e.R7$(),e.Y8G("ngIf",o.needsAttentionTotal>o.needsAttentionDeals.length),e.R7$(10),e.JRh(o.leadSources.length),e.R7$(),e.Y8G("ngIf",o.leadSources.length>0)("ngIfElse",s),e.R7$(4),e.Y8G("data",o.teamPerformance)("currencyCode",o.currencyCode)("currentUserId",o.currentUserId)("boardId",o.boardId)("canManageSalesTargets",o.canManageSalesTargets)("isSavingTarget",o.isSavingTarget)}}function Ju(n,a){if(1&n&&(e.qex(0),e.DNE(1,fu,2,0,"div",77)(2,qu,183,99,"div",78),e.bVm()),2&n){const t=e.XpG();e.R7$(),e.Y8G("ngIf",t.loadState===t.LOAD_STATE.LOADING),e.R7$(),e.Y8G("ngIf",t.loadState===t.LOAD_STATE.LOADED)}}function Ku(n,a){1&n&&(e.j41(0,"div",256),e.nrm(1,"span",257),e.k0s())}function Qu(n,a){if(1&n){const t=e.RV6();e.j41(0,"span",258),e.bIt("click",function(i){e.eBV(t);const s=e.XpG(2);return i.stopPropagation(),e.Njj(s.login("gmail"))}),e.EFF(1," Link Account "),e.k0s()}}function Zu(n,a){1&n&&(e.j41(0,"span",259),e.nrm(1,"i",260),e.EFF(2," Connected "),e.k0s())}function ef(n,a){1&n&&(e.j41(0,"div",256),e.nrm(1,"span",261),e.k0s())}function tf(n,a){if(1&n){const t=e.RV6();e.j41(0,"span",258),e.bIt("click",function(i){e.eBV(t);const s=e.XpG(2);return i.stopPropagation(),e.Njj(s.login("outlook"))}),e.EFF(1," Link Account "),e.k0s()}}function nf(n,a){1&n&&(e.j41(0,"span",259),e.nrm(1,"i",260),e.EFF(2," Connected "),e.k0s())}function rf(n,a){1&n&&(e.j41(0,"div",256),e.nrm(1,"span",262),e.k0s())}function af(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",239)(1,"div",240)(2,"div")(3,"div",241),e.EFF(4,"Send from your own email"),e.k0s(),e.j41(5,"div",242),e.EFF(6,"Choose a connected provider or link a new account."),e.k0s()(),e.j41(7,"button",26),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.closeProviderSheet())}),e.nrm(8,"i",27),e.k0s()(),e.j41(9,"div",243)(10,"button",244),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.selectProvider("deskflo",!0))}),e.j41(11,"div",245)(12,"div",246),e.nrm(13,"i",22),e.k0s(),e.j41(14,"div",247)(15,"span"),e.EFF(16,"Deskflo no-reply"),e.k0s(),e.j41(17,"div",248),e.EFF(18),e.k0s()()(),e.DNE(19,Ku,2,0,"div",249),e.k0s(),e.j41(20,"button",250),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.isGmailLinked?i.selectProvider("gmail",!0):null)}),e.j41(21,"div",245),e.nrm(22,"img",251),e.j41(23,"div",247)(24,"span"),e.EFF(25,"Gmail"),e.k0s(),e.j41(26,"div",252),e.DNE(27,Qu,2,0,"span",253)(28,Zu,3,0,"ng-template",null,14,e.C5r),e.k0s()()(),e.DNE(30,ef,2,0,"div",249),e.k0s(),e.j41(31,"button",254),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.isOutlookLinked?i.selectProvider("outlook",!0):null)}),e.j41(32,"div",245),e.nrm(33,"img",255),e.j41(34,"div",247)(35,"span"),e.EFF(36,"Outlook"),e.k0s(),e.j41(37,"div",252),e.DNE(38,tf,2,0,"span",253)(39,nf,3,0,"ng-template",null,15,e.C5r),e.k0s()()(),e.DNE(41,rf,2,0,"div",249),e.k0s()()()}if(2&n){const t=e.sdS(29),r=e.sdS(40),i=e.XpG();e.R7$(10),e.AVh("is-active","deskflo"===i.activeProvider),e.R7$(8),e.JRh(i.deskfloSenderEmail),e.R7$(),e.Y8G("ngIf","deskflo"===i.activeProvider),e.R7$(),e.AVh("is-active","gmail"===i.activeProvider),e.R7$(7),e.Y8G("ngIf",!i.isGmailLinked)("ngIfElse",t),e.R7$(3),e.Y8G("ngIf","gmail"===i.activeProvider),e.R7$(),e.AVh("is-active","outlook"===i.activeProvider),e.R7$(7),e.Y8G("ngIf",!i.isOutlookLinked)("ngIfElse",r),e.R7$(3),e.Y8G("ngIf","outlook"===i.activeProvider)}}function sf(n,a){if(1&n&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&n){const t=e.XpG();e.R7$(),e.SpI(" (",t.selectedRecipientCount,")")}}function of(n,a){if(1&n){const t=e.RV6();e.j41(0,"span",265),e.EFF(1),e.j41(2,"span",266),e.bIt("click",function(){const i=e.eBV(t).index,s=e.XpG(2);return e.Njj(s.removeEmailFromSelectedEmails(i))}),e.nrm(3,"i",267),e.k0s()()}if(2&n){const t=a.$implicit;e.R7$(),e.SpI(" ",t," ")}}function lf(n,a){if(1&n&&(e.j41(0,"div",263),e.DNE(1,of,4,1,"span",264),e.k0s()),2&n){const t=e.XpG();e.R7$(),e.Y8G("ngForOf",t.selectedEmailContacts)}}function cf(n,a){1&n&&(e.j41(0,"div",268),e.EFF(1," Loading team members... "),e.k0s())}function df(n,a){1&n&&e.nrm(0,"i",260)}function pf(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",269),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG();return e.Njj(s.toggleRecipient(i))}),e.j41(1,"div",270),e.EFF(2),e.k0s(),e.j41(3,"div",271)(4,"div",272),e.EFF(5),e.k0s(),e.j41(6,"div",273),e.EFF(7),e.k0s()(),e.j41(8,"div",274),e.DNE(9,df,1,0,"i",275),e.k0s()()}if(2&n){const t=a.$implicit,r=e.XpG();e.AVh("selected",t.selected),e.R7$(),e.Y8G("ngStyle",r.getRecipientAvatarStyle(t.name)),e.R7$(),e.JRh(t.initials),e.R7$(3),e.JRh(t.name),e.R7$(2),e.Lme("",t.email," \xb7 ",t.role,""),e.R7$(),e.AVh("active",t.selected),e.R7$(),e.Y8G("ngIf",t.selected)}}function uf(n,a){1&n&&(e.j41(0,"div",268),e.EFF(1," No team members found. "),e.k0s())}function ff(n,a){if(1&n){const t=e.RV6();e.j41(0,"tr",276)(1,"i",277),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.setSignaturePage=!0)}),e.k0s()()}}function mf(n,a){if(1&n&&(e.j41(0,"tr")(1,"td",278),e.nrm(2,"img",279),e.k0s()()),2&n){const t=e.XpG();e.R7$(2),e.Y8G("src",t.environment.apiUrl+"/api/storage/image/"+(null==t.emailSignature?null:t.emailSignature.signatureId),e.B4B)}}function hf(n,a){1&n&&(e.j41(0,"div",283),e.nrm(1,"i",284),e.j41(2,"span",285),e.EFF(3,"Preparing sales snapshot PDF..."),e.k0s()())}function gf(n,a){1&n&&(e.j41(0,"span"),e.EFF(1," (Sales report)"),e.k0s())}function _f(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",288),e.bIt("click",function(){e.eBV(t);const i=e.XpG().index,s=e.XpG(2);return e.Njj(s.removeAttachment(i-(s.generatedReportAttachment?1:0)))}),e.nrm(1,"i",27),e.k0s()}}function xf(n,a){if(1&n&&(e.j41(0,"div",283),e.nrm(1,"i",286),e.j41(2,"span",285),e.EFF(3),e.DNE(4,gf,2,0,"span",17),e.k0s(),e.DNE(5,_f,2,0,"button",287),e.k0s()),2&n){const t=a.$implicit,r=e.XpG(2);e.R7$(3),e.SpI(" ",t.attachmentFileName," "),e.R7$(),e.Y8G("ngIf",r.isGeneratedAttachment(t)),e.R7$(),e.Y8G("ngIf",!r.isGeneratedAttachment(t))}}function vf(n,a){if(1&n&&(e.j41(0,"div",280),e.DNE(1,hf,4,0,"div",281)(2,xf,6,3,"div",282),e.k0s()),2&n){const t=e.XpG();e.R7$(),e.Y8G("ngIf",t.reportPdfPreparing),e.R7$(),e.Y8G("ngForOf",t.displayedAttachments)}}function bf(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",289)(1,"input",290),e.mxI("ngModelChange",function(i){e.eBV(t);const s=e.XpG();return e.DH7(s.includeSignature,i)||(s.includeSignature=i),e.Njj(i)}),e.k0s(),e.j41(2,"label"),e.EFF(3,"Include signature"),e.k0s()()}if(2&n){const t=e.XpG();e.R7$(),e.R50("ngModel",t.includeSignature)}}function Cf(n,a){1&n&&(e.j41(0,"div",291)(1,"h3",292),e.EFF(2,"Email Signature"),e.k0s(),e.j41(3,"p",293),e.EFF(4,"Upload a high-quality PNG or JPG of your signature."),e.k0s()())}function kf(n,a){1&n&&(e.j41(0,"div",294)(1,"div",295),e.nrm(2,"i",296),e.k0s(),e.j41(3,"p",297)(4,"strong"),e.EFF(5,"Click to upload"),e.k0s(),e.EFF(6," or drag and drop"),e.k0s(),e.j41(7,"p",298),e.EFF(8,"PNG, JPG or SVG (max. 2MB)"),e.k0s()())}function Tf(n,a){if(1&n&&(e.j41(0,"div",299),e.nrm(1,"img",300),e.j41(2,"div",301),e.nrm(3,"i",302),e.j41(4,"span"),e.EFF(5,"Change Image"),e.k0s()()()),2&n){const t=e.XpG();e.R7$(),e.Y8G("src",t.previewUrl,e.B4B)}}function wf(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",303)(1,"p-button",304),e.bIt("onClick",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.setSignaturePage=!1)}),e.k0s(),e.j41(2,"p-button",305),e.bIt("onClick",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.setSignature())}),e.k0s()()}if(2&n){const t=e.XpG();e.R7$(2),e.Y8G("loading",t.emailSending)}}let yf=(()=>{class n{boardService;teamService;messageService;router;location;authService;viewmodelService;pdfService;emailService;reportContentRef;quillAttachmentInput;IMG_ROUTE=`${Xt.c.apiUrl}/api/storage/image/`;LOAD_STATE=J.nC;SALES_RANGE_WEEK=je;SALES_RANGE_QUARTER=Rn;salesDateRanges=[{label:"Week",value:je,summaryLabel:"This Week"},{label:"Month",value:J.i.ThisMonth,summaryLabel:"This Month"},{label:"Quarter",value:Rn,summaryLabel:"This Quarter"},{label:"Year",value:J.i.ThisYear,summaryLabel:"This Year"},{label:"All",value:J.i.AllTime,summaryLabel:"All Time"}];loadState=J.nC.LOADING;isRefreshing=!1;dashboardSub;upgradeRequired=!1;isDummyData=!1;isSendingWhatsAppPdf=!1;board=null;boardId;teamId;currencyCode="ZAR";selectedDateRange=J.i.ThisYear;customStartDate=null;customEndDate=null;today=new Date;stats=null;previousStats=null;allCards=[];pipelineCards=[];velocityPipelineCards=[];leaderboard=[];baseStats=null;basePreviousStats=null;baseAllCards=[];basePipelineCards=[];baseVelocityCards=[];baseLeaderboard=[];assigneeOptions=[];tagOptions=[];selectedAssigneeIds=[];selectedTagNames=[];pipelineValue=0;weightedForecast=0;wonRevenue=0;winRate=0;totalDeals=0;openDeals=0;closedDeals=0;avgDealSize=0;bestCaseValue=0;heroMetrics=[];stageRows=[];lossReasons=[];pipelineValueChartData=null;pipelineValueChartOptions=null;pipelineVelocityChartData=null;pipelineVelocityChartOptions=null;lossAnalysisChartData=null;lossAnalysisChartOptions=null;pipelineVelocityLabel="Recent periods";topOpenDeals=[];needsAttentionDeals=[];needsAttentionTotal=0;leadSources=[];teamPerformance=[];isSavingTarget=!1;currentUserId="";showEmailModal=!1;emailSending=!1;customEmail="";recipientSearch="";selectedEmailContacts=[];
1selectedContactEmail=null;selectedEmailConfig={};isGmailLinked=!1;isOutlookLinked=!1;activeProvider="deskflo";showProviderSheet=!1;deskfloSenderEmail="[email protected]";additionalRecipientPlaceholder="Add more...";initialRecipientPlaceholder="Enter recipient's email...";emailSubject="";emailBody="";includeSignature=!1;setSignaturePage=!1;previewUrl=null;emailSignature=null;dragOver=!1;selectedFiles=[];generatedReportAttachment=null;reportPdfPreparing=!1;quill=null;quillConfig;isSignatureSet;environment=Xt.c;signatureToUpload;signaturePubId=null;recipients=[];recipientsLoading=!1;recipientsLoaded=!1;constructor(t,r,i,s,o,l,c,d,p){this.boardService=t,this.teamService=r,this.messageService=i,this.router=s,this.location=o,this.authService=l,this.viewmodelService=c,this.pdfService=d,this.emailService=p,this.currencyCode=this.teamService.currencyCode,this.currentUserId=this.authService.getUserId(),this.quillConfig={toolbar:{container:[["bold","italic","underline","strike"],[{list:"ordered"},{list:"bullet"}],[{size:["small",!1,"large","huge"]}],[{color:[]},{background:[]}],[{align:[]}],["link"],["attachment","signature"]],handlers:{attachment:()=>this.triggerAttachment(),signature:()=>{this.setSignaturePage=!0}}}}}ngOnInit(){const t=this.teamService.getCurrentTeam;t?.Team?.Id?(this.teamId=t.Team.Id,this.boardService.initiateBoard(this.teamId.toString(),J.Qw.Sales).subscribe({next:r=>{this.board=r,this.boardId=Number(r.Id),this.boardService.setBoard(r),this.loadRecipients(r),this.loadDashboard(this.selectedDateRange)}})):this.loadState=J.nC.ERROR}get isCustomRange(){return this.selectedDateRange===J.i.Custom}get selectedRangeLabel(){return this.isCustomRange&&this.customStartDate&&this.customEndDate?`${this.formatShortDate(this.customStartDate)} \u2013 ${this.formatShortDate(this.customEndDate)}`:this.salesDateRanges.find(t=>t.value===this.selectedDateRange)?.summaryLabel??"This Year"}formatShortDate(t){return new Date(t).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}get selectedRecipients(){return this.recipients.filter(t=>t.selected)}get filteredRecipients(){const t=this.recipientSearch.trim().toLowerCase();return t?this.recipients.filter(r=>r.name.toLowerCase().includes(t)||r.email.toLowerCase().includes(t)||r.role.toLowerCase().includes(t)):this.recipients}get selectedRecipientCount(){return this.selectedEmailContacts.length}get displayedAttachments(){return this.generatedReportAttachment?[this.generatedReportAttachment,...this.selectedFiles]:this.selectedFiles}isGeneratedAttachment(t){return this.generatedReportAttachment===t}loadBoardAndDashboard(){this.loadState=J.nC.LOADING,this.boardService.loadBoardThenTracks(this.teamId).subscribe({next:([t,r])=>{this.upgradeRequired=this.boardService.upgradeSalesRequired,this.board=t,this.boardId=Number(t.Id),this.boardService.setBoard(t),this.boardService.setTracks(r),this.loadRecipients(t),this.loadDashboard(this.selectedDateRange,t)},error:t=>{402!==t.status?(this.loadState=J.nC.ERROR,this.messageService.add({severity:"error",summary:"Error",detail:(0,yn.u)(t)||"Failed to load the sales board."})):this.upgradeRequired=!0}})}onDateRangeSelect(t){this.boardId&&(this.selectedDateRange===t&&!this.isCustomRange||(this.customStartDate=null,this.customEndDate=null,this.selectedDateRange=t,this.loadDashboard(t)))}onCustomStartDate(t){this.customStartDate=t,this.customEndDate&&t&&this.customEndDate<t&&(this.customEndDate=null),this.applyCustomRange()}onCustomEndDate(t){this.customEndDate=t,this.applyCustomRange()}applyCustomRange(){!this.boardId||!this.customStartDate||!this.customEndDate||this.customEndDate<this.customStartDate||(this.selectedDateRange=J.i.Custom,setTimeout(()=>this.loadDashboard(J.i.Custom)))}get hasActiveFilters(){return this.selectedAssigneeIds.length>0||this.selectedTagNames.length>0}get activeFilterCount(){return this.selectedAssigneeIds.length+this.selectedTagNames.length}getAssigneeName(t){return this.assigneeOptions.find(r=>r.id===t)?.name??t}removeAssigneeFilter(t){this.selectedAssigneeIds=this.selectedAssigneeIds.filter(r=>r!==t),this.applyFilters()}removeTagFilter(t){this.selectedTagNames=this.selectedTagNames.filter(r=>r!==t),this.applyFilters()}clearFilters(){this.selectedAssigneeIds=[],this.selectedTagNames=[],this.applyFilters()}buildFilterOptions(){this.assigneeOptions=this.viewmodelService.buildAssigneeOptions(this.board,this.baseAllCards,i=>this.getInitials(i)),this.tagOptions=this.viewmodelService.buildTagOptions(this.baseAllCards);const t=new Set(this.assigneeOptions.map(i=>i.id)),r=new Set(this.tagOptions.map(i=>i.name.toLowerCase()));this.selectedAssigneeIds=this.selectedAssigneeIds.filter(i=>t.has(i)),this.selectedTagNames=this.selectedTagNames.filter(i=>r.has(i.toLowerCase()))}applyFilters(){if(!this.hasActiveFilters)return this.stats=this.baseStats,this.previousStats=this.basePreviousStats,this.allCards=this.baseAllCards,this.pipelineCards=this.basePipelineCards,this.velocityPipelineCards=this.baseVelocityCards,this.leaderboard=this.baseLeaderboard,void this.buildDashboardViewModel();const t=this.selectedAssigneeIds.map(i=>
1this.getAssigneeName(i)),r=this.viewmodelService.filterCards(this.baseAllCards,this.selectedAssigneeIds,t,this.selectedTagNames);this.allCards=r,this.pipelineCards=r.filter(i=>!this.isClosedCard(i)),this.velocityPipelineCards=this.viewmodelService.filterCards(this.baseVelocityCards,this.selectedAssigneeIds,t,this.selectedTagNames),this.stats=this.viewmodelService.buildStatsFromCards(r,this.boardService.getCurrentTracks),this.previousStats=null,this.leaderboard=this.filterLeaderboard(this.baseLeaderboard),this.buildDashboardViewModel()}filterLeaderboard(t){if(0===this.selectedAssigneeIds.length)return t;const r=new Set(this.selectedAssigneeIds);return t.filter(i=>r.has(i.UserId))}loadDashboard(t,r){if(!this.boardId||!this.teamId)return;this.loadState===J.nC.LOADED?this.isRefreshing=!0:this.loadState=J.nC.LOADING;const i=this.isCustomRange?this.customStartDate:null,s=this.isCustomRange?this.customEndDate:null,o=nn.createStatsFilter(t,i,s),l={DateFilter:o.DateFilter},c=nn.createPreviousPeriodFilter(t,i,s),d=this.boardService.getCurrentTracks.length?(0,lt.of)(this.boardService.getCurrentTracks):this.boardService.getTracks(this.boardId.toString()).pipe((0,Wn.W)(()=>(0,lt.of)([])));this.dashboardSub?.unsubscribe(),this.dashboardSub=(0,or.p)({cards:this.boardService.getSummaryCards(this.boardId,void 0,o.DateFilter),leaderboard:this.boardService.getSalesLeaderboard(this.boardId,this.teamId,l).pipe((0,Wn.W)(()=>(0,lt.of)([]))),tracks:d,previousCards:c?this.boardService.getSummaryCards(this.boardId,void 0,c.DateFilter).pipe((0,Wn.W)(()=>(0,lt.of)([]))):(0,lt.of)([])}).subscribe({next:p=>{r&&(this.board=r),p.tracks?.length&&!this.boardService.getCurrentTracks.length&&this.boardService.setTracks(p.tracks);const u=p.cards??[];this.baseAllCards=this.mergeUniqueCards(u),this.basePipelineCards=this.mergeUniqueCards(u.filter(g=>!this.isClosedCard(g))),this.baseVelocityCards=this.mergeUniqueCards(this.basePipelineCards);const f=this.boardService.getCurrentTracks;this.baseStats=this.viewmodelService.buildStatsFromCards(this.baseAllCards,f);const h=this.mergeUniqueCards(p.previousCards??[]);this.basePreviousStats=h.length?this.viewmodelService.buildStatsFromCards(h,f):null,this.baseLeaderboard=(p.leaderboard??[]).filter(g=>(g.ActiveOpportunities||0)>0||(g.WonOpportunities||0)>0||(g.LostOpportunities||0)>0||(g.ClosedOpportunities||0)>0).sort((g,m)=>(m.WonOpportunities||0)===(g.WonOpportunities||0)?this.getTotalOpportunities(m)-this.getTotalOpportunities(g):(m.WonOpportunities||0)-(g.WonOpportunities||0)),this.isDummyData=0===this.baseAllCards.length,this.buildFilterOptions(),this.isDummyData?this.applyDummyDashboard():this.applyFilters(),this.loadState=J.nC.LOADED,this.isRefreshing=!1,this.loadActivePipelineCardsForVelocity(t)},error:p=>{this.isRefreshing=!1,402!==p.status?(this.messageService.add({severity:"error",summary:"Request Failed",detail:(0,yn.u)(p)||"Unable to load the sales report right now.",life:5e3}),this.applyDummyDashboard(),this.loadState=J.nC.LOADED):this.upgradeRequired=!0}})}loadActivePipelineCardsForVelocity(t){this.boardService.getFilteredCards(this.boardId,void 0,{Range:J.i.AllTime,StartDate:null,EndDate:null}).pipe((0,Wn.W)(()=>(0,lt.of)([]))).subscribe(i=>{if(this.selectedDateRange!==t||this.loadState!==J.nC.LOADED||this.isDummyData)return;const o=this.mergeUniqueCards([...i??[],...this.basePipelineCards]).filter(c=>!this.isClosedCard(c));this.baseVelocityCards=o;const l=this.hasActiveFilters?this.viewmodelService.filterCards(o,this.selectedAssigneeIds,this.selectedAssigneeIds.map(c=>this.getAssigneeName(c)),this.selectedTagNames):o;this.velocityPipelineCards=l,this.needsAttentionDeals=this.buildNeedsAttentionDeals(l),this.buildPipelineVelocityChart()})}loadRecipients(t){this.recipientsLoading=!0,this.recipientsLoaded=!1,this.recipients=this.viewmodelService.buildRecipients(t,[],r=>this.getInitials(r)),this.syncRecipientSelection(),this.teamService.getTeamAccessMembers(this.teamId).pipe((0,Wn.W)(()=>(0,lt.of)([]))).subscribe(r=>{this.recipients=this.viewmodelService.buildRecipients(t,r,i=>this.getInitials(i)),this.syncRecipientSelection(),this.recipientsLoaded=!0,this.recipientsLoading=!1})}ensureRecipientsLoaded(){if(this.recipientsLoaded||this.recipientsLoading)return;const t=this.board??this.boardService.getCurrentBoard;t&&this.loadRecipients(t)}syncRecipientSelection(){const t=new Set(this.selectedEmailContacts.map(r=>r.toLowerCase()));
1this.recipients.forEach(r=>{r.selected=t.has(r.email.toLowerCase())})}buildDashboardViewModel(){const t=this.viewmodelService.buildDashboardViewModel(this.stats,this.previousStats,this.allCards,this.pipelineCards,this.leaderboard,this.currencyCode,this.selectedRangeLabel,r=>this.findTrackByName(r),this.boardService.getCurrentTracks);this.totalDeals=t.totalDeals,this.openDeals=t.openDeals,this.closedDeals=t.closedDeals,this.pipelineValue=t.pipelineValue,this.wonRevenue=t.wonRevenue,this.winRate=t.winRate,this.weightedForecast=t.weightedForecast,this.bestCaseValue=t.bestCaseValue,this.avgDealSize=t.avgDealSize,this.heroMetrics=t.heroMetrics,this.stageRows=t.stageRows,this.lossReasons=t.lossReasons,this.topOpenDeals=t.topOpenDeals,this.needsAttentionDeals=t.needsAttentionDeals,this.needsAttentionTotal=t.needsAttentionTotal,this.leadSources=t.leadSources,this.teamPerformance=[...this.leaderboard],this.emailSubject=t.emailSubject,this.emailBody=t.emailBody,this.buildCharts()}buildCharts(){this.buildPipelineValueByStageChart(),this.buildPipelineVelocityChart(),this.buildLossAnalysisChart()}buildPipelineValueByStageChart(){const t=Lr.buildPipelineValueByStageChart(this.stageRows,this.currencyCode);this.pipelineValueChartData=t.data,this.pipelineValueChartOptions=t.options}buildPipelineVelocityChart(){const r=this.viewmodelService.buildVelocitySeries(this.velocityPipelineCards,this.pipelineCards,this.allCards,this.selectedDateRange,this.isCustomRange&&this.customStartDate&&this.customEndDate?{start:this.customStartDate,end:this.customEndDate}:void 0);this.pipelineVelocityLabel=r.summaryLabel;const i=Lr.buildPipelineVelocityChart(r,this.pipelineValue,this.stats?.WonOpportunities||0);this.pipelineVelocityChartData=i.data,this.pipelineVelocityChartOptions=i.options}buildLossAnalysisChart(){const t=Lr.buildLossAnalysisChart(this.chartLossReasons);this.lossAnalysisChartData=t.data,this.lossAnalysisChartOptions=t.options}buildNeedsAttentionDeals(t=this.pipelineCards){const r=[...t].filter(i=>!this.isClosedCard(i)).sort((i,s)=>{const o=this.getNeedsAttentionScore(s)-this.getNeedsAttentionScore(i);return 0!==o?o:(s.Amount||0)-(i.Amount||0)});return this.needsAttentionTotal=r.length,r.slice(0,5)}exportPdf(){var t=this;return(0,nt.A)(function*(){t.reportContentRef?.nativeElement&&(yield t.pdfService.exportAndSavePdf(t.reportContentRef.nativeElement,r=>{t.messageService.add({severity:"error",summary:"Export failed",detail:r})}))})()}sendviaWhatsAppPdf(){var t=this;return(0,nt.A)(function*(){if(t.reportContentRef?.nativeElement&&!t.isSendingWhatsAppPdf){t.isSendingWhatsAppPdf=!0;try{yield t.pdfService.exportPdf(t.reportContentRef.nativeElement),t.messageService.add({severity:"success",summary:"Success",detail:"Sales report sent successfully via WhatsApp."})}catch(r){t.messageService.add({severity:"error",summary:"Send Failed",detail:r?.message||"Failed to send the sales report via WhatsApp."})}finally{t.isSendingWhatsAppPdf=!1}}})()}prepareGeneratedReportAttachment(){var t=this;return(0,nt.A)(function*(r=!1){t.reportPdfPreparing=!0;try{const i=t.reportContentRef?.nativeElement;if(!i)return null;const s=yield t.pdfService.createSalesSnapshotPdfAttachment(i);return t.generatedReportAttachment=s,s}catch(i){return t.generatedReportAttachment=null,r&&t.messageService.add({severity:"error",summary:"Attachment failed",detail:i instanceof Error&&i.message?i.message:"Unable to generate the sales snapshot PDF attachment right now."}),null}finally{t.reportPdfPreparing=!1}}).apply(this,arguments)}openEmailModal(){this.ensureRecipientsLoaded(),this.emailService.openEmailModal(this.teamId,this.recipients,this.selectedRangeLabel,this.pipelineValue,this.weightedForecast,this.wonRevenue,this.winRate,this.currencyCode,this.reportContentRef?.nativeElement,{onDataReady:t=>{this.isGmailLinked=t.isGmailLinked,this.isOutlookLinked=t.isOutlookLinked,this.emailSignature=t.emailSignature,this.previewUrl=t.previewUrl,this.selectedEmailConfig={},this.activeProvider="deskflo",this.showProviderSheet=!1,this.selectedEmailContacts=[],this.recipients.forEach(r=>{r.selected=!1}),this.customEmail="",this.recipientSearch="",this.emailSubject=t.emailSubject,this.emailBody=t.emailBody,this.includeSignature=!1,this.selectedFiles=[],this.generatedReportAttachment=null,this.showEmailModal=!0,this.prepareGeneratedReportAttachment()},onError:t=>{this.messageService.add({severity:"error",summary:"Email unavailable",detail:t})}})}toggleRecipient(t){this.selectedEmailContacts=this.emailService.toggleRecipient(t,this.selectedEmailContacts)}removeRecipient(t){this.selectedEmailContacts=this.emailService.removeRecipient(t,this.selectedEmailContacts)}addCustomEmail(){const t=this.emailService.addCustomEmail(this.customEmail,this.recipients,this.selectedEmailContacts,this.messageService);this.recipients=t.recipients,this.selectedEmailContacts=t.selectedEmailContacts,this.customEmail=t.customEmail}sendEmailReport(){var t=this;return(0,nt.A)(function*(){if(!t.activeProvider)return void t.messageService.add({severity:"error",summary:"Email Not Sent",detail:"Please select an email provider."});if("gmail"===t.activeProvider&&!t.isGmailLinked)return void t.messageService.add({severity:"error",summary:"Email Not Sent",detail:"The selected email provider is not linked to your Gmail account. Please link your Gmail account to continue."});if("outlook"===t.activeProvider&&!t.isOutlookLinked)return void t.messageService.add({severity:"error",summary:"Email Not Sent",detail:"The selected email provider is not linked to your Outlook account. Please link your Outlook account to continue."});
1const r=t.selectedEmailContacts.filter(Boolean);if(0===r.length)return void t.messageService.add({severity:"warn",summary:"No recipients",detail:"Select at least one recipient before sending the report."});if(!t.emailSubject.trim())return void t.messageService.add({severity:"warn",summary:"Missing Subject",detail:"Please enter a subject for the email."});if(!t.emailBody?.trim())return void t.messageService.add({severity:"warn",summary:"Missing Message",detail:"Please enter a message for the email."});const i=t.emailService.buildSalesReportTemplateData(t.emailSubject,t.selectedRangeLabel,t.emailBody,t.pipelineValue,t.weightedForecast,t.wonRevenue,t.winRate,t.generatedReportAttachment?.attachmentFileName||"report.pdf",t.currencyCode),s={provider:t.activeProvider,subject:t.emailSubject.trim(),body:t.emailBody,to:r,templateName:"Sales Report",templateData:i,includeSignature:t.includeSignature,attachments:[],reportContentHtml:t.reportContentRef?.nativeElement.outerHTML||""};yield t.emailService.sendEmailReport(s,t.includeSignature,t.reportContentRef?.nativeElement,t.generatedReportAttachment,t.selectedFiles,{onStartSending:()=>{t.emailSending=!0},onStopSending:()=>{t.emailSending=!1},onSuccess:o=>{t.closeEmailModal(),t.messageService.add({severity:"success",summary:"Report sent",detail:`Sales snapshot sent to ${o} recipient${1===o?"":"s"}.`})},onError:o=>{t.messageService.add({severity:"error",summary:"Send failed",detail:o})},onSignRequired:()=>{t.setSignaturePage=!0}})})()}openStageList(t){if(!t.trackId)return;const r=nn.createDateFilter(this.selectedDateRange,this.customStartDate,this.customEndDate);this.router.navigate(["dashboard/sales/list/funnel-stage"],{queryParams:{trackId:t.trackId,Range:r.Range,StartDate:r.StartDate,EndDate:r.EndDate}})}openCardList(t){const r=nn.createDateFilter(this.selectedDateRange,this.customStartDate,this.customEndDate);this.router.navigate([`dashboard/sales/list/${t}`],{queryParams:{boardId:this.boardId,Range:r.Range,StartDate:r.StartDate,EndDate:r.EndDate}})}lossReasonDisplayLimit=5;get displayLossReasons(){return this.lossReasons.slice(0,this.lossReasonDisplayLimit)}get hasMoreLossReasons(){return this.lossReasons.length>this.lossReasonDisplayLimit}get chartLossReasons(){const t=this.lossReasons.slice(0,this.lossReasonDisplayLimit),r=this.lossReasons.slice(this.lossReasonDisplayLimit);if(0===r.length)return t;const i={reason:`Other (${r.length})`,count:r.reduce((s,o)=>s+(o.count||0),0),percentage:r.reduce((s,o)=>s+(o.percentage||0),0),amount:r.reduce((s,o)=>s+(o.amount||0),0),color:"#c5ced9"};return[...t,i]}openLossReasonsList(){const t=nn.createDateFilter(this.selectedDateRange,this.customStartDate,this.customEndDate);this.router.navigate(["dashboard/sales/list/loss-reasons"],{queryParams:{boardId:this.boardId,Range:t.Range,StartDate:t.StartDate,EndDate:t.EndDate}})}goToSubscription(){this.router.navigate([`/dashboard/subscription-plans/${this.teamService.getCurrentTeam.Team.Id}`])}goBack(){this.location.back()}getDeltaTone(t){return null==t?"neutral":t>=0?"positive":"negative"}getDeltaLabel(t,r=!1){return null==t?"0.0"+(r?" pts":"%"):`${t>=0?"+":"-"}${Math.abs(t).toFixed(1)}${r?" pts":"%"}`}getProgressWidth(t,r){return r?Math.max(0,Math.min(100,t/r*100)):0}getInitials(t){const r=(t||"").trim().split(/\s+/).filter(Boolean);return 0===r.length?"":1===r.length?r[0].slice(0,2).toUpperCase():`${r[0][0]}${r[1][0]}`.toUpperCase()}getNeedsAttentionLabel(t){const r=nn.getDateValue(t.DueDateUtc);if(null==r)return"No due date";const i=new Date,o=new Date(r).getTime()-i.getTime(),l=Math.floor(o/864e5),c=this.getHeatLabel(t);return l>=0?`${c} \xb7 Due in ${l}d`:`${c} \xb7 Overdue by ${Math.abs(l)}d`}isHotAttentionDeal(t){return t<Math.min(2,this.needsAttentionDeals.length)}getNeedsAttentionTone(t){return this.isHotAttentionDeal(t)?"attention-hot":"attention-warning"}getRecipientAvatarStyle(t){const r=["#3f7ee8","#22c55e","#9333ea","#f59e0b","#ef4444","#06b6d4"];return{background:r[(t||"").split("").reduce((s,o)=>s+o.charCodeAt(0),0)%r.length],color:"#ffffff"}}getNeedsAttentionEmoji(t){const r=this.getNeedsAttentionScore(t);return r>=500?"\u{1f525}":r>=320?"\u26a0\ufe0f":"\u23f0"}getTotalOpportunities(t){return(t.ActiveOpportunities||0)+(t.ClosedOpportunities||0)}getMonthlyTarget(t){return(t.SalesTargetAmount||0)/12}get canManageSalesTargets(){return["Owner","Admin"].includes(this.teamService.getCurrentTeam?.Role)}getTargetMonth(){const t=(new Date).getUTCFullYear();return new Date(Date.UTC(t,0,1)).toISOString()}buildCreateTargetPayload(t,r){return{UserId:t.UserId,BoardId:Number(this.boardId),TargetAmount:r,TargetMonth:this.getTargetMonth(),Type:J.Jb.LeadTarget}}buildEditTargetPayload(t,r){return{...this.buildCreateTargetPayload(t,r),Id:t.SalesTargetId}}saveTargetForRep(t,r){return t.SalesTargetId?this.boardService.updateSalesTarget(this.buildEditTargetPayload(t,r)):this.boardService.createSalesTarget(this.buildCreateTargetPayload(t,r))}
1refreshDashboardAfterTargetSave(){this.loadDashboard(this.selectedDateRange)}showTargetPermissionError(){this.messageService.add({severity:"warn",summary:"Permission denied",detail:"Only workspace owners and admins can manage sales targets."})}saveSalesTarget(t){this.canManageSalesTargets?(this.isSavingTarget=!0,this.saveTargetForRep(t.rep,t.targetAmount).subscribe({next:()=>{this.messageService.add({severity:"success",summary:"Target saved",detail:`${t.rep.UserName}'s sales target has been updated.`}),this.isSavingTarget=!1,this.refreshDashboardAfterTargetSave()},error:r=>{this.isSavingTarget=!1,this.messageService.add({severity:"error",summary:"Target not saved",detail:(0,yn.u)(r)||"Failed to save sales target."})}})):this.showTargetPermissionError()}saveSalesTargetsBatch(t){this.canManageSalesTargets?t.reps.length&&(this.isSavingTarget=!0,(0,or.p)(t.reps.map(r=>this.saveTargetForRep(r,t.targetAmount))).subscribe({next:()=>{this.messageService.add({severity:"success",summary:"Targets saved",detail:`The yearly target has been applied to ${t.reps.length} rep${1===t.reps.length?"":"s"}.`}),this.isSavingTarget=!1,this.refreshDashboardAfterTargetSave()},error:r=>{this.isSavingTarget=!1,this.messageService.add({severity:"error",summary:"Targets not saved",detail:(0,yn.u)(r)||"Failed to save one or more sales targets."})}})):this.showTargetPermissionError()}onEditorCreated(t){this.quill=t;const i=t.getModule("toolbar").container,s=i.querySelector(".ql-attachment"),o=i.querySelector(".ql-signature");s&&(s.innerHTML='<span style="font-size: 10px; font-weight: bold;"><i class="pi pi-paperclip text-sm" title="Attach files"></i></span>'),o&&(o.innerHTML='<span style="font-size: 10px; font-weight: bold;"><i class="pi pi-pencil text-sm" title="upload a signature"></i></span>')}onAttachmentsFileSelected(t){var r=this;return(0,nt.A)(function*(){const i=t.target.files;if(i&&0!==i.length){for(const s of Array.from(i))try{const o=yield r.emailService.convertToBase64(s);r.selectedFiles.push(o)}catch{r.messageService.add({severity:"error",summary:"Error",detail:`Failed to process ${s.name}`})}t.target.value=""}})()}triggerAttachment(){this.quillAttachmentInput?.nativeElement.click()}updateSelectedContact(t){const r=t.target,i=r.value.trim().toLowerCase();if(!this.emailService.validateEmailInput(i,this.selectedEmailContacts,this.messageService))return void(r.value="");this.selectedEmailContacts.push(i);const s=this.recipients.find(o=>o.email.toLowerCase()===i);s&&(s.selected=!0),r.value=""}removeEmailFromSelectedEmails(t){const[r]=this.selectedEmailContacts.splice(t,1),i=this.recipients.find(s=>s.email.toLowerCase()===r?.toLowerCase());i&&(i.selected=!1)}selectProvider(t,r=!1){this.activeProvider=t,r&&(this.showProviderSheet=!1)}openProviderSheet(){this.showProviderSheet=!0}closeProviderSheet(){this.showProviderSheet=!1}login(t){this.emailService.login(t)}closeEmailModal(){this.showEmailModal=!1,this.showProviderSheet=!1,this.selectedEmailContacts=[],this.recipients.forEach(t=>{t.selected=!1}),this.emailSubject="",this.emailBody="",this.selectedContactEmail="",this.selectedFiles=[],this.generatedReportAttachment=null,this.reportPdfPreparing=!1}onFileSelected(t){const r=t.target.files[0];r&&this.emailService.compressImage(r,800,1).then(i=>{this.signatureToUpload=i,this.generatePreview(r)})}onFileDropped(t){t.preventDefault(),this.dragOver=!1;const r=t.dataTransfer?.files[0];!r||!r.type.startsWith("image/")||this.emailService.compressImage(r,800,1).then(i=>{this.signatureToUpload=i,this.generatePreview(r)})}setSignature(){!this.previewUrl||!this.signatureToUpload||(this.emailSending=!0,this.boardService.uploadSignature(this.signatureToUpload).subscribe({next:t=>{this.signaturePubId=t.PublicId,this.emailSignature=this.emailSignature??{},this.emailSignature.isSignatureSet=!0,this.emailSignature.signatureId=this.signaturePubId,this.boardService.setSignature(this.signaturePubId).subscribe(()=>{this.emailSending=!1,this.setSignaturePage=!1,this.messageService.add({severity:"success",summary:"Signature Set",detail:"Signature set successfully."})})},error:t=>{this.emailSending=!1,this.messageService.add({severity:"error",summary:"Signature not saved",detail
1:(0,yn.u)(t)||"Unable to save the signature right now."})}}))}removeAttachment(t){this.selectedFiles.splice(t,1)}generatePreview(t){const r=new FileReader;r.onload=()=>{this.previewUrl=r.result},r.readAsDataURL(t)}applyDummyDashboard(){this.stats={ActiveOpportunities:9,ClosedOpportunities:2,WonOpportunities:1,LostOpportunities:1,ActiveAmount:112700,WonAmount:5e3,LostAmount:0,MinCloseDays:4,MaxCloseDays:45,AvgCloseDays:18,ConversionRate:50,LossReasons:[],Funnel:[{TrackName:"Lead",TrackOrder:0,CardCount:4,TotalAmount:2500},{TrackName:"Demo",TrackOrder:1,CardCount:4,TotalAmount:105700},{TrackName:"Free Trial",TrackOrder:2,CardCount:1,TotalAmount:4500},{TrackName:"Pause",TrackOrder:3,CardCount:1,TotalAmount:1800},{TrackName:"Client Win",TrackOrder:4,CardCount:1,TotalAmount:5e3},{TrackName:"Client Loss",TrackOrder:5,CardCount:0,TotalAmount:0}]},this.previousStats=null,this.allCards=[],this.pipelineCards=[],this.velocityPipelineCards=[],this.leaderboard=[],this.buildDashboardViewModel()}mergeUniqueCards(t){const r=new Map;for(const i of t)null!=i?.Id&&r.set(i.Id,i);return[...r.values()]}isClosedCard(t){return this.viewmodelService.isClosedCard(t)}isClosedTrack(t){return this.viewmodelService.isClosedTrack(t)}findTrackByName(t){const r=(t||"").trim().toLowerCase();if(r)return this.boardService.getCurrentTracks.find(i=>i.Title?.trim().toLowerCase()===r)}getNeedsAttentionScore(t){const r=nn.getDateValue(t.DueDateUtc);return null==r?0:this.getPriorityWeight(t.PriorityId)+this.getDueUrgencyWeight(nn.getDueDayDifference(r))+Math.min((t.Amount||0)/1e3,100)}getPriorityWeight(t){switch(t){case 2:return 300;case 1:return 180;default:return 80}}getDueUrgencyWeight(t){return t>=0&&t<=2?240:t<0&&t>=-2?210:t>=3&&t<=7?170:t<-2&&t>=-7?150:t>=8&&t<=14?120:90}getHeatLabel(t){switch(t.PriorityId){case 2:return"Hot lead";case 1:return"Warm lead";default:return"Open deal"}}static \u0275fac=function(r){return new(r||n)(e.rXU(_t.a),e.rXU(rt.n),e.rXU(be.bg),e.rXU(rn.Ix),e.rXU(Ri.aZ),e.rXU(jn.u),e.rXU(Ji),e.rXU(B),e.rXU(ie))};static \u0275cmp=e.VBU({type:n,selectors:[["app-sales-report"]],viewQuery:function(r,i){if(1&r&&(e.GBs(ou,5),e.GBs(lu,5)),2&r){let s;e.mGM(s=e.lsd())&&(i.reportContentRef=s.first),e.mGM(s=e.lsd())&&(i.quillAttachmentInput=s.first)}},standalone:!1,decls:108,vars:51,consts:[["quillAttachmentInput",""],["header",""],["fileInput",""],["footer",""],["reportContent",""],["startPop",""],["endPop",""],["emptyLossState",""],["emptyOpenDeals",""],["emptyNeedsAttention",""],["emptyLeadSources",""],["filterPop",""],["percentMetric",""],["warningAttention",""],["gmailLinked",""],["outlookLinked",""],[1,"sales-report-page"],[4,"ngIf"],["position","right","styleClass","w-8 lg:w-28rem sales-email-drawer",3,"visibleChange","visible","modal","closable"],[1,"email-drawer"],[1,"email-drawer-header"],[1,"email-header-mark"],[1,"pi","pi-envelope"],[1,"email-header-copy"],[1,"email-header-title"],[1,"email-header-subtitle"],["type","button",1,"email-close-btn",3,"click"],[1,"pi","pi-times"],[1,"email-drawer-body"],[1,"modal-section"],[1,"sender-summary"],[1,"sender-mark"],[1,"sender-copy"],[1,"sender-name"],[1,"sender-email"],[1,"sender-badge",3,"ngClass"],["type","button",1,"own-email-link",3,"click"],["class","provider-sheet","role","dialog","aria-label","Choose email sender",4,"ngIf"],[1,"input-wrapper","max-h-17rem","flex-1",2,"background","rgb(250, 250, 250)"],["class","max-w-full max-h-12rem flex flex-row flex-wrap gap-1 overflow-y-scroll",4,"ngIf"],["type","text",1,"ghost-input",3,"change","placeholder"],[1,"input-shell","search-shell"],[1,"pi","pi-search"],["type","text","pInputText","","placeholder","Search team...",3,"ngModelChange","ngModel"],[1,"recipient-list","recipient-list-panel"],["class","recipient-list-empty",4,"ngIf"],["type","button","class","recipient-row recipient-row-panel",3,"selected","click",4,"ngFor","ngForOf"],[1,"custom-email-row"],["type","text","pInputText","","placeholder","[email protected]",3,"ngModelChange","ngModel"],["type","button","pButton","",3,"click","outlined"],[1,"pi","pi-user-plus"],[1,"input-wrapper","flex-1",2,"background","rgb(250, 250, 250)"],["type","text","placeholder","Enter subject line...",1,"ghost-input",3,"ngModelChange","ngModel"],["type","file","multiple","","hidden","",3,"change"],[1,"seamless-wrapper"],[1,"scroll-container"],["placeholder","Type your message here...",2,"width","100%","border-radius","15px","min-height","300px","max-height","500px",3,"ngModelChange","onEditorCreated","ngModel","modules","styles"],[1,"internal-footer"],[1,"footer-table"],["class","flex flex-row w-full justify-content-end px-3 py-1",4,"ngIf"],[1,"text-cell","
1w-full","flex","flex-row","align-items-center","justify-content-start"],["href","https://www.deskflo.io"],["alt","deskflo logo","width","50","height","20",3,"src"],[1,"mb-1"],["class","attachment-tray mt-2",4,"ngIf"],[1,"email-drawer-footer"],[1,"modal-actions"],["class","flex align-items-center gap-2",4,"ngIf"],["type","button","pButton","",3,"click","text"],["type","button","pButton","",1,"drawer-send-btn",3,"click","disabled"],[1,"pi","pi-send"],["styleClass","signature-dialog","appendTo","body",3,"visibleChange","visible","closable","modal","draggable","resizable"],[1,"signature-upload-wrapper"],[1,"upload-box",3,"click","dragover","dragleave","drop"],["type","file","hidden","","accept","image/*",3,"change"],["class","upload-placeholder",4,"ngIf"],["class","preview-container",4,"ngIf"],["class","relative",4,"ngIf"],["class","report-shell",3,"dummy-data","is-refreshing",4,"ngIf"],[1,"relative"],[1,"report-shell"],["class","sample-ribbon",4,"ngIf"],[1,"report-toolbar"],[1,"toolbar-left"],[1,"range-tabs"],["type","button","class","range-tab",3,"active","click",4,"ngFor","ngForOf"],[1,"range-date-cluster"],["type","button",1,"range-date-pill",3,"click"],[1,"pi","pi-calendar"],[3,"ngModelChange","onSelect","inline","ngModel","maxDate"],[1,"range-to-sep"],[3,"ngModelChange","onSelect","inline","ngModel","minDate","maxDate"],["class","filter-cluster",4,"ngIf"],[1,"toolbar-actions"],["type","button","pButton","",1,"action-btn",3,"click","outlined"],[1,"pi","pi-file-export"],["type","button","pButton","",1,"action-btn",3,"click","outlined","loading","disabled"],["class","pi pi-file-export",4,"ngIf"],["type","button","pButton","",1,"action-btn","primary",3,"click"],["class","report-filters",4,"ngIf"],[1,"metrics-grid"],["class","metric-card",3,"clickable","click",4,"ngFor","ngForOf"],[1,"primary-grid"],[1,"panel-card","panel-stage"],[1,"panel-header"],[1,"panel-chip"],[1,"stage-list"],["type","button","class","stage-row",3,"closed-outcome","click",4,"ngFor","ngForOf"],[1,"panel-card","forecast-card"],[1,"forecast-heading"],[1,"metric-icon","tone-purple"],[1,"pi","pi-bullseye"],[1,"forecast-stack"],[1,"forecast-row"],[1,"forecast-label"],[1,"forecast-value"],[1,"forecast-bar"],[1,"forecast-fill","fill-blue"],[1,"forecast-value","purple"],[1,"forecast-fill","fill-purple"],[1,"forecast-value","green"],[1,"forecast-fill","fill-green"],[1,"forecast-foot"],[1,"charts-grid"],[1,"panel-card","chart-card"],[1,"chart-body"],["type","bar",3,"data","options",4,"ngIf"],[1,"section-title","compact-title"],[1,"section-icon","tone-amber","velocity-icon"],[1,"pi","pi-bolt"],["type","line",3,"data","options",4,"ngIf"],[1,"loss-section"],[1,"panel-card","loss-card"],[1,"section-title"],[1,"section-icon","tone-red"],[1,"pi","pi-times-circle"],[1,"loss-summary"],[1,"loss-summary-meta"],["class","loss-layout",4,"ngIf","ngIfElse"],[1,"secondary-grid"],[1,"panel-card","mini-card","clickable-panel",3,"click"],[1,"pi","pi-trophy","title-icon","amber-icon"],["class","deal-list",4,"ngIf","ngIfElse"],["aria-hidden","true",1,"emoji-icon","fire-emoji"],["class","attention-list",4,"ngIf","ngIfElse"],["class","mini-card-footer",4,"ngIf"],[1,"panel-card","mini-card"],[1,"pi","pi-sparkles","title-icon","purple-icon"],["class","sources-list",4,"ngIf","ngIfElse"],[1,"panel-card"],[3,"saveTarget","saveTargetsBatch","data","currencyCode","currentUserId","boardId","canManageSalesTargets","isSavingTarget"],[1,"sample-ribbon"],["type","button",1,"range-tab",3,"click"],[1,"filter-cluster"],["type","button",1,"filter-toggle",3,"click"],[1,"pi","pi-filter"],["class","filter-count",4,"ngIf"],[1,"filter-panel"],[1,"filter-field"],["optionLabel","name","optionValue","id","placeholder","All assignees","selectedItemsLabel","{0} assignees","appendTo","body","styleClass","filter-multiselect",3,"ngModelChange","onChange","options","ngModel","filter","showToggleAll","maxSelectedLabels"],["optionLabel","name","optionValue","name","placeholder","All tags","selectedItemsLabel","{0} tags","appendTo","body","styleClass","filter-multiselect",3,"ngModelChange","onChange","options","ngModel","filter","showToggleAll","maxSelectedLabels"],["type","button","class","filter-clear",3,"click",4,"ngIf"],[1,"filter-count"],["type","button",1,"filter-clear",3,"click"],[1,"report-filters"],[1,"filter-chips"],["class","filter-chip assignee-chip",4,"ngFor","ngForOf"],["class","filter-chip tag-chip",4,"ngFor","ngForOf"],[1,"filter-chip","assignee-chip"],[1,"pi","pi-user"],["type","button",1,"chip-remove",3,"click"],[1,"filter-chip","tag-chip"],[1,"pi","pi-tag"],[1,"metric-card",3,"click"],[1,"metric-card-top"],[1,"metric-icon",3,"ngClass"],[1,"metric-delta",3,"ngClass"],[1,"metric-title"],[1,"metric-value"],[4,"ngIf","ngIfElse"],[1,"metric-caption"],["type","button",1,"stage-row",3,"click"],[1,"stage-row-head"],[1,"stage-row-label"],[1,"stage-dot"],[1,"stage-name"],[1,"stage-count"],[1,"stage-amount"],[1,"stage-track"],[1,"stage-fill"],[1,"stage-percent"],["type","bar",3,"data","options"],["type","line",3,"data","options"],[1,"loss-layout"],[1,"loss-chart-wrap"],[1,"loss-chart-body"],["type","doughnut",3,"data","options",4,"ngIf"],["class","loss-legend",4,"ngIf"],[1,"loss-list"],["class","loss-row",4,"ngFor","ngForOf"],["type","button","class","loss-view-all",3,"click",4,"ngIf"],["class","loss-driver",4,"ngIf"],["type","doughnut",3,"data","options"],[1,"loss-legend"],["class","loss-legend-item",4,"ngFor","ngForOf"],[1,"loss-legend-item"],[1,"loss-legend-marker"],[1,"loss-legend-text"],[1,"loss-row"],[1,"loss-row-top"],[1,"loss-row-label"],[1,"loss-track"],[1,"loss-fill"],["type","button",1,"loss-view-all",3,"click"],[1,"pi","pi-arrow-right"],[1,"loss-driver"],[1,"pi","pi-exclamation-triangle"],[1,"empty-state"],[1,"deal-list"],["class","deal-row",4,"ngFor","ngForOf"],[1,"deal-row"],[1,"deal-rank"],[1,"deal-copy"],[1,"deal-title"],[1,"deal-subtitle"],[1,"deal-value"],[1,"attention-list"],["class","attention-row",3,"ngClass",4,"ngFor","ngForOf"],[1,"attention-row",3,"ngClass"],[1,"attention-copy"],[1,"attention-title-row"],["class","attention-emoji fire fire-emoji","aria-hidden","true",4,"ngIf","ngIfElse"],["aria-hidden","true",1,"attention-emoji","fire","fire-emoji"],["aria-hidden","true",1,"attention-emoji","warning"],[1,"mini-card-footer"],[1,"sources-list"],["class","source-row",4,"ngFor","ngForOf"],[1,"source-row"],[1,"loss-fill","source-fill"],["role","dialog","aria-label","Choose email sender",1,"provider-sheet"],[1,"provider-sheet-header"],[1,"provider-sheet-title"],[1,"provider-sheet-subtitle"],[1,"provider-options","provider-options-sheet"],["type","button",1,"provider-pill","deskflo-active",3,"click"],[1,"provider-pill-content"],[1,"provider-icon","provider-icon-deskflo"],[1,"provider-copy"],[1,"provider-subtext"],["class","provider-dot-container",4,"ngIf"],["type","button",1,"provider-pill","gmail-active",3,"click"],["src","/assets/gmail-logo-1.svg","width","35","height","35","alt","gmail logo",1,"mr-1"],[1,"flex","flex-row","align-items-center"],["class","link-acccount-btn",3,"click",4,"ngIf","ngIfElse"],["type","button",1,"provider-pill","outlook-active",3,"click"],["src","/assets/Microsoft_Outlook.svg","width","34","height","34","alt","outlook logo",1,"mr-1"],[1,"provider-dot-container"],[1,"provider-dot","provider-dot-deskflo"],[1,"link-acccount-btn",3,"click"],[1,"account-linked-marker"],[1,"pi","pi-check"],[1,"provider-dot","provider-dot-gmail"],[1,"provider-dot","provider-dot-outlook"],[1,"max-w-full","max-h-12rem","flex","flex-row","flex-wrap","gap-1","overflow-y-scroll"],["class","text-pill",4,"ngFor","ngForOf"],[1,"text-pill"],["title","remove email from list",1,"remove-email",3,"click"],[1,"pi","pi-times","text-xs"],[1,"recipient-list-empty"],["type","button",1,"recipient-row","recipient-row-panel",3,"click"],[1,"recipient-avatar",3,"ngStyle"],[1,"recipient-copy"],[1,"recipient-name"],[1,"recipient-meta"],[1,"recipient-check"],["class","pi pi-check",4,"ngIf"],[1,"flex","flex-row","w-full","justify-content-end","px-3","py-1"],[1,"pi","pi-pencil","text-sm","cursor-pointer",3,"click"],[1,"img-cell"],["width","600","alt","signature",2,"max-width","100%","height","auto",3,"src"],[1,"attachment-tray","mt-2"],["class","attachment-pill",4,"ngIf"],["class","attachment-pill",4,"ngFor","ngForOf"],[1,"attachment-pill"],[1,"pi","pi-spin","pi-spinner","text-primary"],[1,"file-label"],[1,"pi","pi-file","text-primary"],["type","button","class","remove-pill-btn",3,"click",4,"ngIf"],["type","button",1,"remove-pill-btn",3,"click"],[1,"flex","align-items-center","gap-2"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"header-container"],[1,"m-0","text-900","font-semibold"],[1,"text-500","text-sm","m-0"],[1,"upload-placeholder"],[1,"icon-circle"],[1,"pi","pi-cloud-upload"],[1,"upload-text"],[1,"upload-subtext"],[1,"preview-container"],["alt","Signature Preview",1,"img-preview",3,"src"],[1,"overlay"],[1,"pi","pi-refresh","mr-2"],[1,"footer-actions"],["label","Cancel","styleClass","p-button-text p-button-secondary custom-btn",3,"onClick"],["label","Set Signature","icon","pi pi-check","styleClass","p-button-primary custom-btn px-4",3,"onClick","loading"]],template:function(r,i){if(1&r){const s=e.RV6();e.nrm(0,"p-toast"),e.j41(1,"div",16),e.DNE(2,uu,1,0,"app-lockfeatures",17)(3,Ju,3,2,"ng-container",17),e.k0s(),e.j41(4,"p-drawer",18),e.mxI("visibleChange",function(l){return e.eBV(s),e.DH7(i.showEmailModal,l)||(i.showEmailModal=l),e.Njj(l)}),e.j41(5,"div",19)(6,"div",20)(7,"div",21),e.nrm(8,"i",22),e.k0s(),e.j41(9,"div",23)(10,"div",24),e.EFF(11,"Email Sales Snapshot"),e.k0s(),e.j41(12,"div",25),e.EFF(13),e.k0s()(),e.j41(14,"button",26),e.bIt("click",function(){return e.eBV(s),e.Njj(i.closeEmailModal())}),e.nrm(15,"i",27),e.k0s()(),e.j41(16,"div",28)(17,"div",29)(18,"label"),e.EFF(19,"Send via"),e.k0s(),e.j41(20,"div",30)(21,"div",31),e.nrm(22,"i",22),e.k0s(),e.j41(23,"div",32)(24,"div",33),e.EFF(25),e.k0s(),e.j41(26,"div",34),e.EFF(27),e.k0s()(),e.j41(28,"span",35),e.EFF(29),e.k0s()(),e.j41(30,"button",36),e.bIt("click",function(){return e.eBV(s),e.Njj(i.openProviderSheet())}),e.EFF(31," Send from your own email "),e.k0s(),e.DNE(32,af,42,14,"div",37),e.k0s(),e.j41(33,"div",29)(34,"label"),e.EFF(35,"To:"),e.DNE(36,sf,2,1,"span",17),e.k0s(),e.j41(37,"div",38),e.DNE(38,lf,2,1,"div",39),e.j41(39,"input",40),e.bIt("change",function(l){return e.eBV(s),e.Njj(i.updateSelectedContact(l))}),e.k0s()()(),e.j41(40,"div",29)(41,"label"),e.EFF(42,"Team Members"),e.k0s(),e.j41(43,"div",41),e.nrm(44,"i",42),e.j41(45,"input",43),e.mxI("ngModelChange",function(l){return e.eBV(s),e.DH7(i.recipientSearch,l)||(i.recipientSearch=l),e.Njj(l)}),e.k0s()(),e.j41(46,"div",44),e.DNE(47,cf,2,0,"div",45)(48,pf,10,10,"button",46)(49,uf,2,0,"div",45),e.k0s()(),e.j41(50,"div",29)(51,"label"),e.EFF(52,"Add Custom Email"),e.k0s(),e.j41(53,"div",47)(54,"input",48),e.mxI("ngModelChange",function(l){return e.eBV(s),e.DH7(i.customEmail,l)||(i.customEmail=l),e.Njj(l)}),e.k0s(),e.j41(55,"button",49),e.bIt("click",function(){return e.eBV(s),e.Njj(i.addCustomEmail())}),e.nrm(56,"i",50),e.j41(57,"span"),e.EFF(58,"Add"),e.k0s()()()(),e.j41(59,"div",29)(60,"label"),e.EFF(61,"Subject"),e.k0s(),e.j41(62,"div",51)(63,"input",52),e.mxI("ngModelChange",function(l){return e.eBV(s),e.DH7(i.emailSubject,l)||(i.emailSubject=l),e.Njj(l)}),e.k0s()()(),e.j41(64,"div",29)(65,"label"),e.EFF(66,"Message"),e.k0s(),e.j41(67,"input",53,0),e.bIt("change",function(l){return e.eBV(s),e.Njj(i.onAttachmentsFileSelected(l))}),e.k0s(),e.j41(69,"div",54)(70,"div",55)(71,"quill-editor",56),e.mxI("ngModelChange",function(l){return e.eBV(s),e.DH7(i.emailBody,l)||(i.emailBody=l),e.Njj(l)}),e.bIt("onEditorCreated",function(l){return e.eBV(s),e.Njj(i.onEditorCreated(l))}),e.k0s(),e.j41(72,"div",57)(73,"table",58),e.DNE(74,ff,2,0,"tr",59)(75,mf,3,1,"tr",17),e.j41(76,"tr")(77,"td",60)(78,"a",61),e.nrm(79,"img",62),e.k0s(),e.j41(80,"small",63),e.EFF(81," Powered by "),e.j41(82,"strong")(83,"a",61),e.EFF(84,"Deskflo"),e.k0s()()()()()()()()(),e.DNE(85,vf,3,2,"div",64),e.k0s()(),e.j41(86,"div",65)(87,"span"),e.EFF(88),e.k0s(),e.j41(89,"div",66),e.DNE(90,bf,4,1,"div",67),e.j41(91,"button",68),e.bIt("click",function(){return e.eBV(s),e.Njj(i.closeEmailModal())}),e.EFF(92,"Cancel"),e.k0s(),e.j41(93,"button",69),e.bIt("click",function(){return e.eBV(s),e.Njj(i.sendEmailReport())}),e.nrm(94,"i",70),e.j41(95,"span"),e.EFF(96),e.k0s()()()()()(),e.j41(97,"p-dialog",71),e.mxI("visibleChange",function(l){return e.eBV(s),e.DH7(i.setSignaturePage,l)||(i.setSignaturePage=l),e.Njj(l)}),e.DNE(98,Cf,5,0,"ng-template",null,1,e.C5r),e.j41(100,"div",72)(101,"div",73),e.bIt("click",function(){e.eBV(s);const l=e.sdS(103);return e.Njj(l.click())})("dragover",function(l){return e.eBV(s),l.preventDefault(),e.Njj(i.dragOver=!0)})("dragleave",function(){return e.eBV(s),e.Njj(i.dragOver=!1)})("drop",function(l){return e.eBV(s),i.onFileDropped(l),e.Njj(i.dragOver=!1)}),e.j41(102,"input",74,2),e.bIt("change",function(l){return e.eBV(s),e.Njj(i.onFileSelected(l))}),e.k0s(),e.DNE(104,kf,9,0,"div",75)(105,Tf,6,1,"div",76),e.k0s()(),e.DNE(106,wf,3,1,"ng-template",null,3,e.C5r),e.k0s()}2&r&&(e.R7$(2),e.Y8G("ngIf",i.upgradeRequired),e.R7$(),e.Y8G("ngIf",!i.upgradeRequired),e.R7$(),e.R50("visible",i.showEmailModal),e.Y8G("modal",!0)("closable",!1),e.R7$(9),e.SpI("Share the ",i.selectedRangeLabel.toLowerCase()," report with your team"),e.R7$(12),e.SpI(" ","gmail"===i.activeProvider?"Gmail":"outlook"===i.activeProvider?"Outlook":"Deskflo no-reply"," "),e.R7$(2),e.SpI(" ","deskflo"===i.activeProvider?i.deskfloSenderEmail:"Your connected email account"," "),e.R7$(),e.Y8G("ngClass","provider-"+i.activeProvider),e.R7$(),e.SpI(" ","deskflo"===i.activeProvider?"Default":"Selected"," "),e.R7$(3),e.Y8G("ngIf",i.showProviderSheet),e.R7$(4),e.Y8G("ngIf",i.selectedRecipientCount),e.R7$(2),e.Y8G("ngIf",i.selectedEmailContacts.length>0),e.R7$(),e.Y8G("placeholder",i.selectedEmailContacts.length>0?i.additionalRecipientPlaceholder:i.initialRecipientPlaceholder),e.R7$(6),e.R50("ngModel",i.recipientSearch),e.R7$(2),e.Y8G("ngIf",i.recipientsLoading&&0===i.recipients.length),e.R7$(),e.Y8G("ngForOf",i.filteredRecipients),e.R7$(),e.Y8G("ngIf",!i.recipientsLoading&&i.recipientsLoaded&&0===i.filteredRecipients.length),e.R7$(5),e.R50("ngModel",i.customEmail),e.R7$(),e.Y8G("outlined",!0),e.R7$(8),e.R50("ngModel",i.emailSubject),e.R7$(8),e.R50("ngModel",i.emailBody),e.Y8G("modules",i.quillConfig)("styles",null!=i.emailSignature&&i.emailSignature.isSignatureSet?e.lJ4(48,cu):e.lJ4(49,du)),e.R7$(3),e.Y8G("ngIf",null==i.emailSignature?null:i.emailSignature.isSignatureSet),e.R7$(),e.Y8G("ngIf",null==i.emailSignature?null:i.emailSignature.isSignatureSet),e.R7$(4),e.Y8G("src",i.environment.apiUrl+"/api/storage/image/E07E3E31-F93B-40CD-A29F-E4444B54264C",e.B4B),e.R7$(6),e.Y8G("ngIf",i.reportPdfPreparing||i.displayedAttachments.length>0),e.R7$(3),e.SpI("",i.selectedRecipientCount," recipients"),e.R7$(2),e.Y8G("ngIf",!i.setSignaturePage),e.R7$(),e.Y8G("text",!0),e.R7$(2),e.AVh("ready",i.selectedEmailContacts.length>0&&!!i.emailBody&&!i.emailSending),e.Y8G("disabled",i.emailSending||0===i.selectedEmailContacts.length||!i.emailBody),e.R7$(3),e.JRh(i.emailSending?"Sending...":"Send Report"),e.R7$(),e.Aen(e.lJ4(50,pu)),e.R50("visible",i.setSignaturePage),e.Y8G("closable",!0)("modal",!0)("draggable",!1)("resizable",!1),e.R7$(4),e.AVh("has-preview",i.previewUrl)("drag-over",i.dragOver),e.R7$(3),e.Y8G("ngIf",!i.previewUrl),e.R7$(),e.Y8G("ngIf",i.previewUrl))},dependencies:[q.YU,q.Sq,q.bT,q.B3,Te.X9,Ce.K,Ie.y8,Qe.Sm,L.me,L.Zm,L.BC,L.vS,jt.lG,xe._f,xe.$n,Ve._s,De.KF,Zt.i9,On,Ae.AM,An.lr,su,q.QX,q.oe,Ue],styles:['[_nghost-%COMP%]{display:block;color:#071a33;font-family:Inter,Segoe UI,Roboto,Arial,sans-serif}.sales-report-page[_ngcontent-%COMP%]{background:#f6f8fb;min-height:100%;padding:0}.report-shell[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;gap:.85rem;padding:.25rem 1rem 1rem}.dummy-data[_ngcontent-%COMP%]{opacity:.72}.sample-ribbon[_ngcontent-%COMP%]{position:absolute;top:.75rem;right:1rem;z-index:2;border-radius:999px;background:#13294b;color:#fff;font-size:.75rem;font-weight:700;letter-spacing:.04em;padding:.4rem .75rem}.metric-card[_ngcontent-%COMP%], .panel-card[_ngcontent-%COMP%], .team-card[_ngcontent-%COMP%]{border:1px solid #e6ebf2;border-radius:.5rem;background:#fff;box-s
1hadow:0 1px 3px #0f172a0f}.report-shell.is-refreshing[_ngcontent-%COMP%] .metrics-grid[_ngcontent-%COMP%], .report-shell.is-refreshing[_ngcontent-%COMP%] .primary-grid[_ngcontent-%COMP%], .report-shell.is-refreshing[_ngcontent-%COMP%] .charts-grid[_ngcontent-%COMP%], .report-shell.is-refreshing[_ngcontent-%COMP%] .loss-section[_ngcontent-%COMP%], .report-shell.is-refreshing[_ngcontent-%COMP%] .secondary-grid[_ngcontent-%COMP%], .report-shell.is-refreshing[_ngcontent-%COMP%] > .panel-card[_ngcontent-%COMP%]{opacity:.55;transition:opacity .15s ease;pointer-events:none}.report-toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:0 0 .15rem;background:transparent;margin:0;flex-wrap:wrap}.toolbar-left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.55rem;flex-wrap:wrap}.toolbar-actions[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:.55rem;flex-wrap:wrap}.filter-cluster[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.45rem;flex-wrap:wrap}.range-date-cluster[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem}.range-date-pill[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem;border:1px solid #dce4ef;border-radius:.55rem;background:#eef3f9;color:#52647d;font-size:.8rem;font-weight:600;min-height:2.05rem;padding:.38rem .7rem;cursor:pointer}.range-date-pill[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.85rem}.range-date-pill.has-value[_ngcontent-%COMP%]{background:#fff;color:#071a33;border-color:#3f7ee8;box-shadow:0 1px 2px #0f172a14}.range-to-sep[_ngcontent-%COMP%]{color:#7286a0;font-size:.78rem;font-weight:600}.filter-panel[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.85rem;min-width:15rem;padding:.25rem}.filter-field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.filter-field[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-size:.75rem;font-weight:700;color:#52647d;text-transform:uppercase;letter-spacing:.02em}.toolbar-right[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:.55rem;flex-wrap:wrap;width:100%}.range-tabs[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.2rem;border:1px solid #dce4ef;border-radius:.55rem;padding:.14rem;background:#eef3f9}.range-tab[_ngcontent-%COMP%]{border:0;border-radius:.42rem;background:transparent;color:#52647d;font-size:.8rem;font-weight:600;padding:.38rem .68rem}.range-tab.active[_ngcontent-%COMP%]{background:#fff;color:#071a33;box-shadow:0 1px 2px #0f172a14}.action-btn[_ngcontent-%COMP%]{gap:.55rem;border-radius:.5rem;font-weight:600;min-height:2.05rem;padding-inline:.82rem;font-size:.82rem;box-shadow:none}.action-btn.primary[_ngcontent-%COMP%]{background:#3f7ee8;border-color:#3f7ee8}.report-filters[_ngcontent-%COMP%]{display:flex;align-items:center;flex-wrap:wrap;gap:.55rem;padding:.1rem 0 .15rem}.filter-toggle[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem;border:1px solid #dce4ef;border-radius:.5rem;background:#eef3f9;color:#52647d;font-size:.8rem;font-weight:600;min-height:2.05rem;padding:0 .7rem;cursor:pointer} .filter-multiselect.p-multiselect{width:100%;min-width:13rem;min-height:2.05rem;border-radius:.5rem;border-color:#dce4ef;align-items:center} .filter-multiselect .p-multiselect-label{padding:.4rem .6rem;font-size:.8rem;display:flex;align-items:center} .filter-multiselect .p-multiselect-label.p-placeholder{color:#7286a0}.filter-toggle.active[_ngcontent-%COMP%]{background:#fff;color:#071a33;border-color:#3f7ee8;box-shadow:0 1px 2px #0f172a14}.filter-count[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;min-width:1.15rem;height:1.15rem;padding:0 .3rem;border-radius:999px;background:#3f7ee8;color:#fff;font-size:.7rem;font-weight:700}.filter-multiselect[_ngcontent-%COMP%]{min-width:12rem}.filter-chips[_ngcontent-%COMP%]{display:inline-flex;align-items:center;flex-wrap:wrap;gap:.4rem}.filter-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.35rem;padding:.28rem .5rem;border-radius:999px;font-size:.76rem;font-weight:600;background:#eef3f9;color:#34435c;border:1px solid #dce4ef}.filter-chip.assignee-chip[_ngcontent-%COMP%]{background:#eaf1fd;border-color:#cfe0fb;
1color:#1d4ed8}.filter-chip.tag-chip[_ngcontent-%COMP%]{background:#f3eefb;border-color:#e3d6f7;color:#7c3aed}.filter-chip[_ngcontent-%COMP%] .chip-remove[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;border:0;background:transparent;color:inherit;cursor:pointer;padding:0;opacity:.7}.filter-chip[_ngcontent-%COMP%] .chip-remove[_ngcontent-%COMP%]:hover{opacity:1}.filter-chip[_ngcontent-%COMP%] .chip-remove[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.65rem}.filter-clear[_ngcontent-%COMP%]{border:0;background:transparent;color:#52647d;font-size:.78rem;font-weight:600;cursor:pointer;text-decoration:underline}.filter-clear[_ngcontent-%COMP%]:hover{color:#071a33}.metrics-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.8rem}.metric-card[_ngcontent-%COMP%]{padding:.95rem 1rem;min-height:9.3rem;display:flex;flex-direction:column;justify-content:space-between}.metric-card.clickable[_ngcontent-%COMP%]{cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}.metric-card.clickable[_ngcontent-%COMP%]:hover{transform:translateY(-2px);border-color:#bfd2f5;box-shadow:0 14px 28px #13294b14}.metric-card-top[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem}.metric-icon[_ngcontent-%COMP%]{width:2.45rem;height:2.45rem;display:inline-flex;align-items:center;justify-content:center;border-radius:.7rem;font-size:.94rem}.tone-blue[_ngcontent-%COMP%]{color:#2d6cdf;background:#eaf1ff}.tone-purple[_ngcontent-%COMP%]{color:#7a46ff;background:#f2ebff}.tone-green[_ngcontent-%COMP%]{color:#0c9b68;background:#e9f9f2}.tone-amber[_ngcontent-%COMP%]{color:#e07b00;background:#fff3e5}.metric-delta[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-width:4.35rem;border-radius:999px;font-size:.78rem;font-weight:700;padding:.25rem .5rem;white-space:nowrap}.metric-delta.positive[_ngcontent-%COMP%]{background:#e8f8ef;color:#109864}.metric-delta.negative[_ngcontent-%COMP%]{background:#fff0f0;color:#e14b4b}.metric-delta.neutral[_ngcontent-%COMP%]{background:#eef3f9;color:#6c7c95}.metric-title[_ngcontent-%COMP%]{color:#506681;font-size:.78rem;font-weight:600;text-transform:uppercase;letter-spacing:.02em}.metric-value[_ngcontent-%COMP%]{color:#071a33;font-size:1.42rem;font-weight:700;line-height:1.05}.metric-caption[_ngcontent-%COMP%]{color:#536986;font-size:.84rem}.primary-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(0,2fr) minmax(21rem,1fr);gap:.8rem}.secondary-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.8rem}.charts-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:.8rem;align-items:stretch;margin-bottom:.75rem}.loss-section[_ngcontent-%COMP%]{display:block}.panel-card[_ngcontent-%COMP%], .team-section[_ngcontent-%COMP%]{padding:.95rem 1rem}.panel-header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:.95rem}.panel-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;color:#071a33;font-size:1rem;font-weight:650}.section-title[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.7rem}.compact-title[_ngcontent-%COMP%]{align-items:center}.section-icon[_ngcontent-%COMP%]{width:1.8rem;height:1.8rem;display:inline-flex;align-items:center;justify-content:center;border-radius:.45rem;flex:0 0 auto}.title-icon[_ngcontent-%COMP%]{font-size:.9rem;flex:0 0 auto}.emoji-icon[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;line-height:1;flex:0 0 auto}.fire-emoji[_ngcontent-%COMP%]{font-size:0}.fire-emoji[_ngcontent-%COMP%]:before{content:"\\1f525";font-size:1rem}.tone-red[_ngcontent-%COMP%]{background:#ffe9ec;color:#ef4444}.amber-icon[_ngcontent-%COMP%]{color:#f59e0b}.red-icon[_ngcontent-%COMP%]{color:#ef4444}.purple-icon[_ngcontent-%COMP%]{color:#8b5cf6}.blue-icon[_ngcontent-%COMP%]{color:#3f7ee8}.panel-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .loss-summary[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin:.25rem 0 0;color:#536986;font-size:.82rem}.panel-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;border-radius:999px;background:#edf2fb;color:#28456a;font-size:.8rem;font-weight:700;padding:.3rem .62rem}.stage-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.65rem}.stage-row[_ngcontent-%COMP%]{border:0;border-radius:0;background:transparent;text-align:left;padding:.45rem 0;cursor:pointer;transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease}.stage-row[_ngcontent-%COMP%]:hover{box-shadow:none;transform:none}.stage-row-head[_ngcontent-%COMP%], .loss-row-top[_ngcontent-%COMP%], .team-head[_ngcontent-%COMP%], .deal-row[_ngcontent-%COMP%], .attention-row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.8rem}.stage-row-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.65rem;flex-wrap:wrap}
1.stage-dot[_ngcontent-%COMP%]{width:.55rem;height:.55rem;border-radius:999px}.stage-name[_ngcontent-%COMP%]{color:#071a33;font-size:.94rem;font-weight:650}.stage-count[_ngcontent-%COMP%], .deal-subtitle[_ngcontent-%COMP%], .recipient-meta[_ngcontent-%COMP%], .team-subtitle[_ngcontent-%COMP%]{color:#61708a;font-size:.82rem}.stage-amount[_ngcontent-%COMP%], .deal-value[_ngcontent-%COMP%]{color:#071a33;font-size:.88rem;font-weight:650}.stage-track[_ngcontent-%COMP%], .loss-track[_ngcontent-%COMP%], .forecast-bar[_ngcontent-%COMP%]{width:100%;height:1rem;border-radius:.38rem;overflow:hidden;background:#f3f5f8}.stage-fill[_ngcontent-%COMP%], .loss-fill[_ngcontent-%COMP%], .forecast-fill[_ngcontent-%COMP%]{height:100%;border-radius:.28rem}.stage-fill[_ngcontent-%COMP%]{min-width:2.6rem;display:flex;align-items:center;padding:0 .45rem}.stage-percent[_ngcontent-%COMP%]{color:#13294b;font-size:.76rem;font-weight:700;white-space:nowrap}.closed-outcome[_ngcontent-%COMP%] .stage-track[_ngcontent-%COMP%]{height:.9rem}.forecast-heading[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.8rem}.forecast-stack[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.95rem}.forecast-row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.48rem}.forecast-label[_ngcontent-%COMP%], .forecast-foot[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .team-stats[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#61708a;font-size:.84rem}.forecast-value[_ngcontent-%COMP%]{color:#13294b;font-size:1.24rem;font-weight:800}.forecast-value.purple[_ngcontent-%COMP%]{color:#7a46ff}.forecast-value.green[_ngcontent-%COMP%]{color:#0c9b68}.fill-blue[_ngcontent-%COMP%]{background:#3f7ee8}.fill-purple[_ngcontent-%COMP%]{background:#7a46ff}.fill-green[_ngcontent-%COMP%]{background:#0c9b68}.forecast-foot[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;border-top:1px solid #edf2fb;padding-top:.8rem}.forecast-foot[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .loss-summary[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .team-stats[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:#13294b;font-size:.95rem}.loss-card[_ngcontent-%COMP%]{width:100%}.loss-summary[_ngcontent-%COMP%]{text-align:right}.loss-summary[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block;margin-top:.25rem;font-size:1.25rem;color:#ef4444}.loss-summary-meta[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:#e3eaf3;color:#13294b;font-size:.82rem;font-weight:700;margin-top:.35rem;padding:.3rem .75rem}.loss-layout[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(14rem,.72fr) minmax(18rem,1.28fr);gap:1rem;align-items:start}.loss-chart-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;min-height:16.5rem;padding-top:.1rem;gap:1rem}.loss-chart-body[_ngcontent-%COMP%]{width:100%;max-width:16.5rem;height:16.5rem}.loss-row-label[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.6rem;min-width:0}.loss-legend[_ngcontent-%COMP%]{width:100%;display:flex;flex-wrap:wrap;justify-content:center;gap:.75rem 1rem}.loss-legend-item[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.45rem;min-width:0;color:#61708a;font-size:.84rem;line-height:1.2}.loss-legend-marker[_ngcontent-%COMP%]{width:.8rem;height:.8rem;border-radius:999px;flex:0 0 auto}.loss-legend-text[_ngcontent-%COMP%]{white-space:nowrap}.loss-list[_ngcontent-%COMP%] .loss-row-top[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:1rem}.loss-list[_ngcontent-%COMP%] .loss-row-top[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]:not(.loss-row-label), .loss-list[_ngcontent-%COMP%] .loss-row-top[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{white-space:nowrap}.loss-list[_ngcontent-%COMP%] .loss-row-top[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:#13294b;font-size:.9rem}.loss-view-all[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem;align-self:flex-start;background:none;border:none;padding:0;cursor:pointer;color:#3f7ee8;font-size:.85rem;font-weight:600}.loss-view-all[_ngcontent-%COMP%]:hover{text-decoration:underline}.loss-view-all[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.75rem}.loss-driver[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.45rem;color:#61708a;font-size:.88rem;border-top:1px solid #edf2fb;padding-top:.9rem}.loss-driver[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#f59e0b}.loss-list[_ngcontent-%COMP%], .sources-list[_ngcontent-%COMP%], .deal-list[_ngcontent-%COMP%], .attention-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.loss-fill[_ngcontent-%COMP%], .source-fill[_ngcontent-%COMP%]{background:linear-gradient(90deg,#f54343,#ed2f7a)}.source-fill[_ngcontent-%COMP%]{background:#3f7ee8}.chart-card[_ngcontent-%COMP%]{min-height:26rem;display:flex;flex-direction:column;overflow:visible}.chart-body[_ngcontent-%COMP%]{position:relative;height:22.5rem;min-height:22.5rem;padding:0 .35rem 2.6rem 0;overflow:visible}
1[_nghost-%COMP%] .chart-body .p-chart{width:100%;height:100%;position:relative;overflow:visible}[_nghost-%COMP%] .chart-body canvas, [_nghost-%COMP%] .loss-chart-body canvas{width:100%!important;height:100%!important;max-height:100%!important;max-width:100%!important;display:block}[_nghost-%COMP%] .chart-body>div, [_nghost-%COMP%] .loss-chart-body>div{width:100%;height:100%}[_nghost-%COMP%] .loss-chart-body .p-chart{width:100%;height:100%}.mini-card[_ngcontent-%COMP%]{min-height:15.5rem}.deal-row[_ngcontent-%COMP%], .attention-row[_ngcontent-%COMP%]{border:1px solid #edf2fb;border-radius:.88rem;padding:.62rem .72rem}.attention-row[_ngcontent-%COMP%]{transition:border-color .16s ease,box-shadow .16s ease,background .16s ease}.attention-row.attention-hot[_ngcontent-%COMP%]{border-color:#fecaca;background:linear-gradient(135deg,#fff7f7,#fff1f1);box-shadow:inset 0 1px #ffffffa6}.attention-row.attention-warning[_ngcontent-%COMP%]{border-color:#fde1a6;background:linear-gradient(135deg,#fffdf7,#fff9ec);box-shadow:inset 0 1px #fff9}.clickable-panel[_ngcontent-%COMP%]{cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}.clickable-panel[_ngcontent-%COMP%]:hover{transform:translateY(-2px);border-color:#bfd2f5;box-shadow:0 14px 28px #13294b14}.deal-rank[_ngcontent-%COMP%]{width:1.8rem;height:1.8rem;display:inline-flex;align-items:center;justify-content:center;border-radius:.62rem;background:#edf2fb;color:#435979;font-weight:800}.deal-copy[_ngcontent-%COMP%], .attention-copy[_ngcontent-%COMP%], .recipient-copy[_ngcontent-%COMP%]{min-width:0;flex:1}.deal-title[_ngcontent-%COMP%], .team-name[_ngcontent-%COMP%], .recipient-name[_ngcontent-%COMP%]{color:#13294b;font-size:.9rem;font-weight:700}.velocity-icon[_ngcontent-%COMP%]{color:#d97706;background:#fff3e0}.attention-title-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.45rem}.attention-emoji[_ngcontent-%COMP%]{width:1rem;text-align:center;flex:0 0 auto;line-height:1}.attention-emoji.fire[_ngcontent-%COMP%]{color:#ef4444;font-size:0}.attention-emoji.warning[_ngcontent-%COMP%]{color:#f59e0b}.attention-emoji.fire.fire-emoji[_ngcontent-%COMP%]:before{font-size:.95rem}.mini-card-footer[_ngcontent-%COMP%]{margin-top:auto;padding-top:.25rem;color:#3f7ee8;font-size:.84rem;font-weight:700}.team-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.85rem}.team-card[_ngcontent-%COMP%]{padding:.95rem}.team-avatar[_ngcontent-%COMP%], .recipient-avatar[_ngcontent-%COMP%]{width:2.7rem;height:2.7rem;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;color:#fff;font-weight:800}.team-avatar.small[_ngcontent-%COMP%]{width:2.35rem;height:2.35rem;font-size:.82rem}.team-stats[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.85rem;margin-top:.95rem}.team-stats[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}@media (max-width: 1200px){.metrics-grid[_ngcontent-%COMP%], .secondary-grid[_ngcontent-%COMP%], .charts-grid[_ngcontent-%COMP%], .team-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(2,minmax(0,1fr))}.loss-layout[_ngcontent-%COMP%]{grid-template-columns:1fr}}@media (max-width: 960px){.sales-report-page[_ngcontent-%COMP%]{padding:0}.report-toolbar[_ngcontent-%COMP%], .toolbar-right[_ngcontent-%COMP%], .primary-grid[_ngcontent-%COMP%], .charts-grid[_ngcontent-%COMP%], .metrics-grid[_ngcontent-%COMP%], .secondary-grid[_ngcontent-%COMP%], .team-grid[_ngcontent-%COMP%], .team-stats[_ngcontent-%COMP%]{grid-template-columns:1fr;flex-direction:column}.loss-layout[_ngcontent-%COMP%]{grid-template-columns:1fr}.loss-chart-wrap[_ngcontent-%COMP%]{min-height:16rem}.report-toolbar[_ngcontent-%COMP%]{align-items:stretch;margin:0 -.85rem}.toolbar-right[_ngcontent-%COMP%]{align-items:stretch;justify-content:flex-start}.range-tabs[_ngcontent-%COMP%]{width:100%;overflow-x:auto}.range-tab[_ngcontent-%COMP%]{flex:1 0 auto}.provider-options[_ngcontent-%COMP%]{grid-template-columns:1fr}}','.email-modal[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.2rem}.email-drawer[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;height:100%;background:#fff;overflow:hidden}.email-drawer-header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.9rem;padding:1rem 1.1rem .95rem;border-bottom:1px solid #e8eef7}.email-header-mark[_ngcontent-%COMP%]{width:2.6rem;height:2.6rem;display:inline-flex;align-items:center;justify-content:center;border-radius:.75rem;background:#edf4ff;color:#3f7ee8;font-size:1rem;flex:0 0 auto}.email-header-copy[_ngcontent-%COMP%]{flex:1;min-width:0}.email-header-title[_ngcontent-%COMP%]{color:#1f2f4d;font-size:1.05rem;font-weight:800;line-height:1.2}.email-header-subtitle[_ngcontent-%COMP%]{color:#69809f;font-size:.82rem;margin-top:.15rem}.email-close-btn[_ngcontent-%COMP%]{width:2rem;height:2rem;border:0;background:transparent;color:#6e7f98;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto}.email-drawer-body[_ngcontent-%COMP%]{flex:1;overflow:auto;padding:1rem 1.1rem;display:flex;flex-direction:column;gap:1rem}.email-drawer-footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.8rem 1.1rem .95rem;border-top:1px solid #e8eef7;color:#64748b;background:#fff;font-size:.82rem}.modal-section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.45rem}.modal-section[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{color:#5a6d87;font-size:.78rem;font-weight:600;letter-spacing:.02em;text-transform:none}.sender-summary[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;border:1px solid #e4e9f1;border-radius:.75rem;background:#fbfcfe;padding:.72rem .8rem}.sender-mark[_ngcontent-%COMP%]{width:2.35rem;height:2.35rem;display:inline-flex;align-items:center;justify-content:center;border-radius:.62rem;background:#edf4ff;color:#3f7ee8;flex:0 0 auto}.sender-copy[_ngcontent-%COMP%]{min-width:0;flex:1}
1.sender-name[_ngcontent-%COMP%]{color:#071a33;font-size:.9rem;font-weight:650}.sender-email[_ngcontent-%COMP%]{margin-top:.12rem;color:#536986;font-size:.78rem}.sender-badge[_ngcontent-%COMP%]{border-radius:999px;background:#eef3f9;color:#52647d;font-size:.72rem;font-weight:650;padding:.25rem .55rem;white-space:nowrap}.sender-badge.provider-gmail[_ngcontent-%COMP%]{background:#fff1f1;color:#dc2626}.sender-badge.provider-outlook[_ngcontent-%COMP%]{background:#eef6ff;color:#1476d4}.own-email-link[_ngcontent-%COMP%]{align-self:flex-start;border:0;background:transparent;color:#3f7ee8;cursor:pointer;font-size:.82rem;font-weight:600;padding:.1rem 0;text-decoration:underline;text-underline-offset:.16rem}.provider-sheet[_ngcontent-%COMP%]{border:1px solid #e4e9f1;border-radius:.85rem;background:#fff;box-shadow:0 12px 26px #0f172a14;margin-top:.45rem;padding:.85rem}.provider-sheet-header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:.9rem}.provider-sheet-title[_ngcontent-%COMP%]{color:#071a33;font-size:1rem;font-weight:650}.provider-sheet-subtitle[_ngcontent-%COMP%]{margin-top:.18rem;color:#536986;font-size:.8rem}.recipient-pillbox[_ngcontent-%COMP%], .input-shell[_ngcontent-%COMP%], .attachment-row[_ngcontent-%COMP%], .recipient-row[_ngcontent-%COMP%]{border:1px solid #dce6f3;border-radius:.8rem;background:#fff}.recipient-pillbox[_ngcontent-%COMP%], .input-shell[_ngcontent-%COMP%], .attachment-row[_ngcontent-%COMP%]{padding:.7rem .85rem}.muted[_ngcontent-%COMP%]{color:#77859b}.recipient-pillbox[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem}.recipient-pillbox-large[_ngcontent-%COMP%]{min-height:3rem;align-items:flex-start}.recipient-pill[_ngcontent-%COMP%]{border-radius:999px;background:#edf2fb;color:#28456a;font-size:.86rem;font-weight:600;padding:.35rem .65rem}.recipient-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.55rem;border:1px solid #dce6f3;border-radius:999px;background:#fff;color:#233550;padding:.35rem .7rem .35rem .4rem;font-size:.92rem;font-weight:600}.recipient-chip-avatar[_ngcontent-%COMP%]{width:1.35rem;height:1.35rem;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:#3f7ee8;color:#fff;font-size:.68rem;font-weight:800}.recipient-chip-text[_ngcontent-%COMP%]{max-width:14rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.search-shell[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;min-height:2.65rem}.search-shell[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .custom-email-row[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .modal
1-section[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .modal-section[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{width:100%;border:0;outline:none;box-shadow:none}.recipient-list[_ngcontent-%COMP%]{max-height:18rem;overflow:auto;display:flex;flex-direction:column;gap:.65rem}.recipient-list-panel[_ngcontent-%COMP%]{max-height:15.5rem;gap:0;border:1px solid #dce6f3;border-radius:.8rem;background:#fff}.recipient-row[_ngcontent-%COMP%]{width:100%;display:flex;align-items:center;gap:.85rem;text-align:left;padding:.8rem .9rem}.recipient-row-panel[_ngcontent-%COMP%]{border:0;border-radius:0;border-bottom:1px solid #e8eef7;padding:.7rem .8rem}.recipient-row-panel[_ngcontent-%COMP%]:last-child{border-bottom:0}.recipient-list-empty[_ngcontent-%COMP%]{padding:.85rem;color:#77859b;font-size:.84rem}.recipient-row.selected[_ngcontent-%COMP%]{background:#f4f8ff;box-shadow:inset 0 0 0 1px #1f2937}.recipient-check[_ngcontent-%COMP%]{width:1.5rem;height:1.5rem;display:inline-flex;align-items:center;justify-content:center;border-radius:.45rem;border:1px solid #dce6f3;color:#3f7ee8}.recipient-check.active[_ngcontent-%COMP%]{background:#3f7ee8;border-color:#3f7ee8;color:#fff}
1.custom-email-row[_ngcontent-%COMP%], .modal-footer[_ngcontent-%COMP%], .modal-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem}.custom-email-row[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1}.custom-email-row[_ngcontent-%COMP%] .p-button[_ngcontent-%COMP%], .modal-actions[_ngcontent-%COMP%] .p-button[_ngcontent-%COMP%]{min-height:2.5rem;font-size:.9rem}.attachment-row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1rem}.attachment-row-drawer[_ngcontent-%COMP%]{border-style:dashed}.attachment-icon[_ngcontent-%COMP%]{width:2.35rem;height:2.35rem;display:inline-flex;align-items:center;justify-content:center;border-radius:.6rem;background:#fff1f2;color:#ef4444;font-size:.92rem}.attachment-name[_ngcontent-%COMP%]{color:#13294b;font-weight:700;font-size:.88rem}.attachment-meta[_ngcontent-%COMP%]{color:#61708a;font-size:.78rem}.modal-footer[_ngcontent-%COMP%]{justify-content:space-between;width:100%}.drawer-send-btn[_ngcontent-%COMP%]{background:#c8d8f4;border-color:#c8d8f4;color:#f8fbff;min-width:8.75rem}.drawer-send-btn.ready[_ngcontent-%COMP%]{background:#3f7ee8;border-color:#3f7ee8;color:#fff}[_nghost-%COMP%] .drawer-send-btn:not(:disabled):hover, [_nghost-%COMP%] .drawer-send-btn.ready:not(:disabled):hover, [_nghost-%COMP%] .drawer-send-btn:not(:disabled):focus{background:#3f7ee8!important;border-color:#3f7ee8!important;color:#fff!important;box-shadow:0 8px 18px #3f7ee82e}[_nghost-%COMP%] .drawer-send-btn:disabled{opacity:1!important;background:#c8d8f4!important;border-color:#c8d8f4!important;color:#f8fbff!important}[_nghost-%COMP%] quill-editor>.ql-toolbar.ql-snow{border:none!important}.seamless-wrapper[_ngcontent-%COMP%]{border:1px solid #dce6f3;display:flex;flex-direction:column;height:auto;background:#fff;border-radius:.8rem}:is() .ql-container.ql-snow[_ngcontent-%COMP%], :is() .ql-toolbar.ql-snow[_ngcontent-%COMP%]{border:none!important}:is() .ql-toolbar[_ngcontent-%COMP%]{border-bottom:1px solid #eee!important}.scroll-container[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;height:auto;overflow-y:auto;scrollbar-width:none}quill-editor[_ngcontent-%COMP%]{flex:1}.internal-footer[_ngcontent-%COMP%]{padding:0 20px;border-top:1px dotted #eee;background-color:#fafafa;position:sticky;bottom:0;width:100%}.footer-table[_ngcontent-%COMP%]{width:100%;color:#666;font-size:12px}.remove-email[_ngcontent-%COMP%]{cursor:pointer;margin-left:8px;display:inline-flex;align-items:center;vertical-align:middle}[_nghost-%COMP%] .remove-email>i{font-size:.45rem!important;color:#666;transition:color .2s}[_nghost-%COMP%] .remove-email:hover>.pi{color:#ff4d4d}.text-pill[_ngcontent-%COMP%]{background-color:#e8effa;color:#4487f2;padding:2px 10px;border-radius:16px;font-size:13px;font-weight:500;white-space:nowrap}.input-wrapper[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:4px;padding:4px;border:1px solid #dce6f3;border-radius:.8rem;align-items:center;width:100%;background-color:#fff;min-height:40px;transition:border-color .2s}.input-wrapper[_ngcontent-%COMP%]:focus-within{border-color:#3b82f6;box-shadow:0 0 0 2px #3b82f61a}.ghost-input[_ngcontent-%COMP%]{flex:1;border:none;outline:none;min-width:100px;padding:4px;font-size:14px;background:transparent}.provider-options[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.6rem}.provider-options-sheet[_ngcontent-%COMP%]{grid-template-columns:1fr}.provider-dot-container[_ngcontent-%COMP%]{width:1rem;height:100%;display:flex;flex-direction:column;justify-content:flex-start}.provider-dot[_ngcontent-%COMP%]{height:8px;width:8px;border-radius:50%;display:inline-block}.provider-pill[_ngcontent-%COMP%]{display:flex;flex-direction:row;color:#13294b;justify-content:space-between;align-items:flex-start;padding:.7rem .75rem;background-color:#fcfdff;width:100%;cursor:pointer;border-radius:.75rem;border:1px solid #e4e9f1;font:inherit;text-align:left;transition:border-color .16s ease,box-shadow .16s ease,background-color .16s ease}.provider-pill-content[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.55rem;width:100%}.provider-copy[_ngcontent-%COMP%]{display:flex;flex:1;flex-direction:column;min-width:0;padding:.1rem 0}.provider-copy[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{color:#071a33;font-size:.88rem;font-weight:650}.provider-icon[_ngcontent-%COMP%]{width:2.15rem;height:2.15rem;display:inline-flex;align-items:center;justify-content:center;border-radius:.72rem;font-size:.92rem;flex:0 0 auto}.provider-icon-deskflo[_ngcontent-%COMP%]{background:#edf4ff;color:#3f7ee8}.provider-subtext[_ngcontent-%COMP%]{color:#6b7b92;font-size:.72rem;margin-top:.12rem}.provider-pill[_ngcontent-%COMP%]:hover{border-color:#d0d8e5}.provider-pill.is-active[_ngcontent-%COMP%]{box-shadow:0 8px 18px #13294b0d}.deskflo-active.is-active[_ngcontent-%COMP%]{background-color:#f4f8ff;border-color:#3f7ee8}.gmail-active.is-active[_ngcontent-%COMP%]{background-color:#fff5f5;border-color:#ef4444}.outlook-active.is-active[_ngcontent-%COMP%]{background-color:#f3f8ff;border-color:#3399f2}.provider-dot-deskflo[_ngcontent-%COMP%]{background:#3f7ee8}.provider-dot-gmail[_ngcontent-%COMP%]{background:#ef4444}.provider-dot-outlook[_ngcontent-%COMP%]{background:#3399f2}.link-acccount-btn[_ngcontent-%COMP%]{text-decoration:underline;color:#3f7ee8;font-size:.74rem;font-weight:600;cursor:pointer;transition:all .1s ease-in-out}.account-linked-marker[_ngcontent-%COMP%]{display:inline-flex;flex-direction:row;align-items:center;gap:.3rem;color:#30bd53;font-size:.74rem;font-weight:600;cursor:pointer;transition:all .1s ease-in-out}[_nghost-%COMP%] .ql-attachment:before{content:"Attach";font-size:16px}[_nghost-%COMP%] .ql-signature:before{content:"Sign"!important;font-size:16px}.attachment-tray[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px;padding:10px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px}.attachment-pill[_ngcontent-%COMP%]{display:flex;align-items:center;background:#fff;border:1px solid #cbd5e1;padding:4px 10px;border-radius:20px;font-size:13px;box-shadow:0 1px 2px #0000000d}.file-label[_ngcontent-%COMP%]{margin:0 8px;max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.remove-pill-btn[_ngcontent-%COMP%]{border:none;background:transparent;color:#94a3b8;cursor:pointer;display:flex;align-items:center;transition:color .2s}.remove-pill-btn[_ngcontent-%COMP%]:hover{color:#ef4444}[_nghost-%COMP%] .sales-email-drawer{width:min(600px,100vw)!important}[_nghost-%COMP%] .sales-email-drawer .p-drawer-header{display:none!important}[_nghost-%COMP%] .sales-email-drawer .p-drawer-content{padding:0!important}[_nghost-%COMP%] .sales-email-drawer input, [_nghost-%COMP%] .sales-email-drawer textarea{font-size:.92rem!important}[_nghost-%COMP%] .sales-email-drawer .p-inputtext{padding:.7rem .8rem;border-radius:.8rem}']})}return n})();var Ol=ee(21413),Ur=ee(81391),Nl=ee(86603),at=ee(32651),Hs=ee(24518),zn=ee(9114),Qi=ee(21142),qa=ee(24827),Xr=ee(65430),ji=ee(80320);const Ff=()=>({width:"420px"}),Sf=()=>[1,2,3,4,5];function Ef(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",9)(1,"div",10),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.leadQualifier=!0)}),e.nrm(2,"i",11),e.j41(3,"span",12),e.EFF(4,"Qualify lead"),e.k0s()()()}}function If(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",13)(1,"div",14),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.leadQualifier=!0)}),e.nrm(2,"i",15),e.j41(3,"span"),e.EFF(4),e.k0s()()()}if(2&n){const t=e.XpG();e.R7$(),e.Y8G("ngClass","priority-"+(null==t.qualificationTier?null:t.qualificationTier.toLowerCase())),e.R7$(),e.HbH("HOT"===t.qualificationTier?"pi pi-check-circle":"WARM"===t.qualificationTier?"pi pi-exclamation-triangle":"pi pi-times-circle"),e.R7$(2),e.Lme("Qualified \xb7 ",t.qualificationTier," \xb7 ",t.qualificationScore,"/100")}}function Df(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",13)(1,"div",16),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.leadQualifier=!0)}),e.nrm(2,"i",15),e.j41(3,"span"),e.EFF(4),e.k0s()()()}if(2&n){const t=e.XpG();e.R7$(),e.Y8G("ngClass","priority-"+("Urgent"===t.selectedCard.Priority?"hot":"Medium"===t.selectedCard.Priority?"warm":"cold")),e.R7$(),e.HbH("Urgent"===t.selectedCard.Priority?"pi pi-check-circle":"Medium"===t.selectedCard.Priority?"pi pi-exclamation-triangle":"pi pi-times-circle"),e.R7$(2),e.SpI(" Qualified \xb7 ","Urgent"===t.selectedCard.Priority?"HOT":"Medium"===t.selectedCard.Priority?"WARM":"COLD"," ")}}function Rf(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",27)(1,"span",28),e.EFF(2),e.k0s(),e.j41(3,"span",29),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.destroyComponet())}),e.EFF(4," Skip for now "),e.k0s()()}if(2&n){const t=e.XpG(2);e.R7$(2),e.Lme(" Step ",t.currentStep," of 5 \u2022 ",t.currentStepLabel," ")}}function jf(n,a){if(1&n&&(e.j41(0,"div",30),e.nrm(1,"div",31),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.xc7("width",t.progressWidth)}}function Af(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",17)(1,"div",18)(2,"div",19)(3,"div",20),e.nrm(4,"i",21),e.k0s(),e.j41(5,"div",9)(6,"h3",22),e.EFF(7,"Qualify lead"),e.k0s(),e.j41(8,"span",23),e.EFF(9,"New deal"),e.k0s()()(),e.j41(10,"i",24),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.leadQualifier=!1)}),e.k0s()(),e.DNE(11,Rf,5,2,"div",25)(12,jf,2,2,"div",26),e.k0s()}if(2&n){const t=e.XpG();e.R7$(11),e.Y8G("ngIf",!t.isComplete),e.R7$(),e.Y8G("ngIf",!t.isComplete)}}function Mf(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",38)(1,"div",39)(2,"div",40),e.nrm(3,"i",41),e.k0s(),e.j41(4,"div",42)(5,"h4",43),e.EFF(6,"How urgent is the need?"),e.k0s(),e.j41(7,"span",23),e.EFF(8,"Are they actively trying to solve a real pain right now?"),e.k0s()()(),e.j41(9,"div",44)(10,"div",45),e.bIt("click",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.selectNeed("must-have"))}),e.j41(11,"div",9)(12,"span",46),e.EFF(13,"Must-have"),e.k0s(),e.j41(14,"span",23),e.EFF(15,"Solving an active pain"),e.k0s()()(),e.j41(16,"div",45),e.bIt("click",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.selectNeed("nice-to-have"))}),e.j41(17,"div",9)(18,"span",46),e.EFF(19,"Nice-to-have"),e.k0s(),e.j41(20,"span",23),e.EFF(21,"Open to improving things"),e.k0s()()(),e.j41(22,"div",45),e.bIt("click",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.selectNeed("exploring"))}),e.j41(23,"div",9)(24,"span",46),e.EFF(25,"Just exploring"),e.k0s(),e.j41(26,"span",23),e.EFF(27,"No clear pain yet"),e.k0s()()()()()}if(2&n){const t=e.XpG(3);e.R7$(10),e.Y8G("ngClass","must-have"===t.selectedOptions.need?"border-blue-500 bg-blue-50":"border-gray-200 bg-white"),e.R7$(2),e.AVh("text-blue-700","must-have"===t.selectedOptions.need),e.R7$(4),e.Y8G("ngClass","nice-to-have"===t.selectedOptions.need?"border-blue-500 bg-blue-50":"border-gray-200 bg-white"),e.R7$(2),e.AVh("text-blue-700","nice-to-have"===t.selectedOptions.need),e.R7$(4),e.Y8G("ngClass","exploring"===t.selectedOptions.need?"border-blue-500 bg-blue-50":"border-gray-200 bg-white"),e.R7$(2),e.AVh("text-blue-700","exploring"===t.selectedOptions.need)}}function Pf(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",47)(1,"div",48)(2,"div",40),e.nrm(3,"i",49),e.k0s(),e.j41(4,"div",42)(5,"h4",43),e.EFF(6,"What's their budget range?"),e.k0s(),e.j41(7,"span",23),e.EFF(8,"A rough monthly or one-off figure is fine."),e.k0s()()(),e.j41(9,"div",44)(10,"div",45),e.bIt("click",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.selectBudget("under-1k"))}),e.j41(11,"div",9)(12,"span",46),e.EFF(13,"Under R1,000"),e.k0s(),e.j41(14,"span",23),e.EFF(15,"Small / starter"),e.k0s()()(),e.j41(16,"div",45),e.bIt("click",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.selectBudget("1k-5k"))}),e.j41(17,"div",9)(18,"span",46),e.EFF(19,"R1k \u2013 R5k"),e.k0s(),e.j41(20,"span",23),e.EFF(21,"SMB"),e.k0s()()(),e.j41(22,"div",45),e.bIt("click",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.selectBudget("5k-25k"))}),e.j41(23,"div",9)(24,"span",46),e.EFF(25,"R5k \u2013 R25k"),e.k0s(),e.j41(26,"span",23),e.EFF(27,"Mid-market"),e.k0s()()(),e.j41(28,"div",45),e.bIt("click",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.selectBudget("25k-plus"))}),e.j41(29,"div",9)(30,"span",46),e.EFF(31,"R25k+"),e.k0s(),e.j41(32,"span",23),e.EFF(33,"Enterprise"),e.k0s()()(),e.j41(34,"div",45),e.bIt("click",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.selectBudget("unknown"))}),e.j41(35,"div",9)(36,"span",46),e.EFF(37,"Not sure yet"),e.k0s(),e.j41(38,"span",23),e.EFF(39,"Skip for now"),e.k0s()()()()()}if(2&n){const t=e.XpG(3);e.R7$(10),e.Y8G("ngClass","under-1k"===t.selectedOptions.budget?"border-blue-500 bg-blue-50":"border-gray-200 bg-white"),e.R7$(2),e.AVh("text-blue-700","under-1k"===t.selectedOptions.budget),e.R7$(4),e.Y8G("ngClass","1k-5k"===t.selectedOptions.budget?"border-blue-500 bg-blue-50":"border-gray-200 bg-white"),e.R7$(2),e.AVh("text-blue-700","1k-5k"===t.selectedOptions.budget),e.R7$(4),e.Y8G("ngClass","5k-25k"===t.selectedOptions.budget?"border-blue-500 bg-blue-50":"border-gray-200 bg-white"),e.R7$(2),e.AVh("text-blue-700","5k-25k"===t.selectedOptions.budget),e.R7$(4),e.Y8G("ngClass","25k-plus"===t.selectedOptions.budget?"border-blue-500 bg-blue-50":"border-gray-200 bg-white"),e.R7$(2),e.AVh("text-blue-700","25k-plus"===t.selectedOptions.budget),e.R7$(4),e.Y8G("ngClass","unknown"===t.selectedOptions.budget?"border-blue-500 bg-blue-50":"border-gray-200 bg-white"),e.R7$(2),e.AVh("text-blue-700","unknown"===t.selectedOptions.budget)}}function Of(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",50)(1,"div",48)(2,"div",40),e.nrm(3,"i",51),e.k0s(),e.j41(4,"div",42)(5,"h4",43),e.EFF(6,"Are you talking to the decision-maker?"),e.k0s(),e.j41(7,"span",23),e.EFF(8,"Who has the authority to say yes?"),e.k0s()()(),e.j41(9,"div",44)(10,"div",45),e.bIt("click",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.selectAuthority("decision-maker"))}),e.j41(11,"div",9)(12,"span",46),e.EFF(13,"Decision-maker"),e.k0s(),e.j41(14,"span",23),e.EFF(15,"Can sign off"),e.k0s()()(),e.j41(16,"div",45),e.bIt("click",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.selectAuthority("influencer"))}),e.j41(17,"div",9)(18,"span",46),e.EFF(19,"Influencer"),e.k0s(),e.j41(20,"span",23),e.EFF(21,"Has
1internal pull"),e.k0s()()(),e.j41(22,"div",45),e.bIt("click",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.selectAuthority("researcher"))}),e.j41(23,"div",9)(24,"span",46),e.EFF(25,"Researcher"),e.k0s(),e.j41(26,"span",23),e.EFF(27,"Gathering info"),e.k0s()()(),e.j41(28,"div",45),e.bIt("click",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.selectAuthority("unknown"))}),e.j41(29,"div",9)(30,"span",46),e.EFF(31,"Unknown"),e.k0s(),e.j41(32,"span",23),e.EFF(33,"Need to find out"),e.k0s()()()()()}if(2&n){const t=e.XpG(3);e.R7$(10),e.Y8G("ngClass","decision-maker"===t.selectedOptions.authority?"border-blue-500 bg-blue-50":"border-gray-200 bg-white"),e.R7$(2),e.AVh("text-blue-700","decision-maker"===t.selectedOptions.authority),e.R7$(4),e.Y8G("ngClass","influencer"===t.selectedOptions.authority?"border-blue-500 bg-blue-50":"border-gray-200 bg-white"),e.R7$(2),e.AVh("text-blue-700","influencer"===t.selectedOptions.authority),e.R7$(4),e.Y8G("ngClass","researcher"===t.selectedOptions.authority?"border-blue-500 bg-blue-50":"border-gray-200 bg-white"),e.R7$(2),e.AVh("text-blue-700","researcher"===t.selectedOptions.authority),e.R7$(4),e.Y8G("ngClass","unknown"===t.selectedOptions.authority?"border-blue-500 bg-blue-50":"border-gray-200 bg-white"),e.R7$(2),e.AVh("text-blue-700","unknown"===t.selectedOptions.authority)}}function Nf(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",50)(1,"div",48)(2,"div",40),e.nrm(3,"i",52),e.k0s(),e.j41(4,"div",42)(5,"h4",43),e.EFF(6,"When do they want to start?"),e.k0s(),e.j41(7,"span",23),e.EFF(8,"Their realistic timeline to a decision."),e.k0s()()(),e.j41(9,"div",44)(10,"div",45),e.bIt("click",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.selectTimeline("immediate"))}),e.j41(11,"div",9)(12,"span",46),e.EFF(13,"Immediately"),e.k0s(),e.j41(14,"span",23),e.EFF(15,"This week / next"),e.k0s()()(),e.j41(16,"div",45),e.bIt("click",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.selectTimeline("this-quarter"))}),e.j41(17,"div",9)(18,"span",46),e.EFF(19,"This quarter"),e.k0s(),e.j41(20,"span",23),e.EFF(21,"1\u20133 months"),e.k0s()()(),e.j41(22,"div",45),e.bIt("click",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.selectTimeline("later"))}),e.j41(23,"div",9)(24,"span",46),e.EFF(25,"Later this year"),e.k0s(),e.j41(26,"span",23),e.EFF(27,"3+ months"),e.k0s()()(),e.j41(28,"div",45),e.bIt("click",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.selectTimeline("unknown"))}),e.j41(29,"div",9)(30,"span",46),e.EFF(31,"No timeline"),e.k0s(),e.j41(32,"span",23),e.EFF(33,"Open-ended"),e.k0s()()()()()}if(2&n){const t=e.XpG(3);e.R7$(10),e.Y8G("ngClass","immediate"===t.selectedOptions.timeline?"border-blue-500 bg-blue-50":"border-gray-200 bg-white"),e.R7$(2),e.AVh("text-blue-700","immediate"===t.selectedOptions.timeline),e.R7$(4),e.Y8G("ngClass","this-quarter"===t.selectedOptions.timeline?"border-blue-500 bg-blue-50":"border-gray-200 bg-white"),e.R7$(2),e.AVh("text-blue-700","this-quarter"===t.selectedOptions.timeline),e.R7$(4),e.Y8G("ngClass","later"===t.selectedOptions.timeline?"border-blue-500 bg-blue-50":"border-gray-200 bg-white"),e.R7$(2),e.AVh("text-blue-700","later"===t.selectedOptions.timeline),e.R7$(4),e.Y8G("ngClass","unknown"===t.selectedOptions.timeline?"border-blue-500 bg-blue-50":"border-gray-200 bg-white"),e.R7$(2),e.AVh("text-blue-700","unknown"===t.selectedOptions.timeline)}}function Gf(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",59),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG(4);return e.Njj(s.selectFit(i))}),e.EFF(1),e.k0s()}if(2&n){const t=a.$implicit,r=e.XpG(4);e.Y8G("ngClass",r.selectedOptions.fit===t?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-200 bg-white text-900"),e.R7$(),e.SpI(" ",t," ")}}function Bf(n,a){1&n&&(e.j41(0,"div",53)(1,"div",48)(2,"div",40),e.nrm(3,"i",54),e.k0s(),e.j41(4,"div",42)(5,"h4",43),e.EFF(6,"Overall fit (your gut)"),e.k0s(),e.j41(7,"span",23),e.EFF(8,"How well does this lead match your ideal customer?"),e.k0s()()(),e.j41(9,"div",44)(10,"div",55),e.DNE(11,Gf,2,2,"div",56),e.k0s(),e.j41(12,"div",57)(13,"span",58),e.EFF(14,"Poor fit"),e.k0s(),e.j41(15,"span",58),e.EFF(16,"Perfect fit"),e.k0s()()()()),2&n&&(e.R7$(11),e.Y8G("ngForOf",e.lJ4(1,Sf)))}function Lf(n,a){if(1&n&&(e.qex(0),e.DNE(1,Mf,28,9,"div",34)(2,Pf,40,15,"div",35)(3,Of,34,12,"div",36)(4,Nf,34,12,"div",36)(5,Bf,17,2,"div",37),e.bVm()),2&n){const t=e.XpG(2);e.R7$(),e.Y8G("ngIf",1===t.currentStep),e.R7$(),e.Y8G("ngIf",2===t.currentStep),e.R7$(),e.Y8G("ngIf",3===t.currentStep),e.R7$(),e.Y8G("ngIf",4===t.currentStep),e.R7$(),e.Y8G("ngIf",5===t.currentStep)}}function $f(n,a){if(1&n&&(e.j41(0,"div",60)(1,"div",61)(2,"div",62)(3,"div",63),e.nrm(4,"i",64),e.j41(5,"div")(6,"div",65)(7,"span",66),e.EFF(8),e.k0s(),e.j41(9,"span",67),e.EFF(10,"/ 100"),e.k0s()(),e.j41(11,"div",68),e.EFF(12),e.k0s()()(),e.j41(13,"div",69),e.EFF(14),e.k0s()()(),e.j41(15,"div",70)(16,"div",71)(17,"small",72),e.EFF(18,"NEED"),e.k0s(),e.j41(19,"span",73),e.EFF(20),e.k0s()(),e.j41(21,"div",71)(22,"small",72),e.EFF(23,"BUDGET"),e.k0s(),e.j41(24,"span",73),e.EFF(25),e.k0s()(),e.j41(26,"div",71)(27,"small",72),e.EFF(28,"AUTHORITY"),e.k0s(),e.j41(29,"span",73),e.EFF(30),e.k0s()(),e.j41(31,"div",71)(32,"small",72),e.EFF(33,"TIMELINE"),e.k0s(),e.j41(34,"span",73),e.EFF(35),e.k0s()(),e.j41(36,"div",71)(37,"small",72),e.EFF(38,"FIT"),e.k0s(),e.j41(39,"span",73),e.EFF(40),e.k0s()()(),e.j41(41,"span",74),e.EFF(42," Answers are saved on the deal. The deal stays in its current stage \u2014 move it manually when you\u2019re ready. "),e.k0s()()),2&n){let t;const r=e.XpG(2);e.R7$(),e.Y8G("ngClass","priority-"+(null==r.qualificationTier?null:r.qualificationTier.toLowerCase())),e.R7$(3),e.HbH("HOT"===r.qualificationTier?"pi pi-check-circle":"WARM"===r.qualificationTier?"pi pi-exclamation-triangle":"pi pi-times-circle"),e.R7$(4),e.SpI(" ",r.qualificationScore," "),e.R7$(4),e.SpI(" ",r.getTierDescription()," "),e.R7$(),e.xc7("color","inherit")("border-color","inherit"),e.R7$(),e.SpI(" ",r.qualificationTier," "),e.R7$(6),e.SpI(" ",r.getDisplayValue("need")," "),e.R7$(5),e.SpI(" ",r.getDisplayValue("budget")," "),e.R7$(5),e.SpI(" ",r.getDisplayValue("authority")," "),e.R7$(5),e.SpI(" ",r.getDisplayValue("timeline")," "),e.R7$(5),e.SpI(" ",null!==(t=r.selectedOptions.fit)&&void 0!==t?t:"\u2014"," / 5 ")}}function Vf(n,a){if(1&n&&e.DNE(0,Lf,6,5,"ng-container",32)(1,$f,43,15,"div",33),2&n){const t=e.XpG();e.Y8G("ngIf",!t.isComplete),e.R7$(),e.Y8G("ngIf",t.isComplete)}}let Ja=(()=>{class n{onComplete=new e.bkB;leadQualifier=!1;isComplete=!1;selectedNeed;selectedPriority;selectedPrioryValue;qualificationScore=0;qualificationTier="";isQualified=!1;currentStep=1;totalScore=0;selectedCard;qualifierScores={need:0,budget:0,authority:0,timeline:0,fit:0};selectedOptions={need:"",budget:"",authority:"",timeline:"",fit:0};stepLabels=["Need","Budget","Authority","Timeline","Fit"];leadPriorities=[{label:"Hot Lead",value:1,color:"#e63946",emoji:"\u{1f525}"},{label:"Warm Lead",value:2,color:"#f4a261",emoji:"\u{1f324}\ufe0f"},{label:"Lead (Low)",value:0,color:"#6c757d",emoji:"\u2744\ufe0f"}];get progressWidth(){return this.currentStep/5*100+"%"}
1get currentStepLabel(){return this.stepLabels[this.currentStep-1]}selectNeed(t){this.selectedOptions.need=t,this.qualifierScores.need={"must-have":25,"nice-to-have":12,exploring:4}[t]}nextStep(){this.currentStep<5&&this.currentStep++}prevStep(){this.currentStep>1&&this.currentStep--}calculateTotal(){const t=this.qualifierScores;return this.totalScore=t.need+t.budget+t.authority+t.timeline+t.fit,this.totalScore}destroyComponet(){this.leadQualifier=!1}selectBudget(t){this.selectedOptions.budget=t,this.qualifierScores.budget={"25k-plus":25,"5k-25k":22,"1k-5k":14,"under-1k":6,unknown:5}[t]}selectAuthority(t){this.selectedOptions.authority=t,this.qualifierScores.authority={"decision-maker":20,influencer:12,researcher:5,unknown:3}[t]}selectTimeline(t){this.selectedOptions.timeline=t,this.qualifierScores.timeline={immediate:20,"this-quarter":14,later:6,unknown:3}[t]}selectFit(t){this.selectedOptions.fit=t,this.qualifierScores.fit=2*t}isNextDisabled(){switch(this.currentStep){case 1:return!this.selectedOptions.need;case 2:return!this.selectedOptions.budget;case 3:return!this.selectedOptions.authority;case 4:return!this.selectedOptions.timeline;case 5:return!this.selectedOptions.fit;default:return!0}}completeQualification(){if(this.qualificationScore=Math.min(100,Math.round((this.qualifierScores.need||0)+(this.qualifierScores.budget||0)+(this.qualifierScores.authority||0)+(this.qualifierScores.timeline||0)+(this.qualifierScores.fit||0))),this.qualificationScore>=75){this.qualificationTier="HOT";const r=this.leadPriorities.find(i=>"Hot Lead"===i.label);this.selectedPrioryValue=r?.value??1,this.selectedPriority=r?.label??"Hot Lead"}else if(this.qualificationScore>=45){this.qualificationTier="WARM";const r=this.leadPriorities.find(i=>"Warm Lead"===i.label);this.selectedPrioryValue=r?.value??2,this.selectedPriority=r?.label??"Warm Lead"}else{this.qualificationTier="COLD";const r=this.leadPriorities.find(i=>"Lead (Low)"===i.label);this.selectedPrioryValue=r?.value??0,this.selectedPriority=r?.label??"Lead (Low)"}this.isComplete=!0}handleBackClick(){this.isComplete?(this.isComplete=!1,this.currentStep=5):this.currentStep>1&&this.prevStep()}handleNextClick(){this.isComplete?this.saveAndEmit():5===this.currentStep?this.completeQualification():this.nextStep()}saveAndEmit(){this.onComplete.emit({score:this.qualificationScore,tier:this.qual
1ificationTier,priorityValue:this.selectedPrioryValue??0,label:this.selectedPriority}),this.isQualified=!0,this.leadQualifier=!1,console.log("Testing",this.selectedCard)}getTierDescription(){return"COLD"===this.qualificationTier?"Low signal \u2014 pause and revisit, or disqualify.":"WARM"===this.qualificationTier?"Medium signal \u2014 continue engaged, push for commitment.":"HOT"===this.qualificationTier?"Strong signal \u2014 close the deal!":""}getDisplayValue(t){const r=this.selectedOptions[t];return r?{need:{"must-have":"Must-have","nice-to-have":"Nice-to-have",exploring:"Just exploring"},budget:{"under-1k":"Under R1k","1k-5k":"R1k \u2013 R5k","5k-25k":"R5k \u2013 R25k","25k-plus":"R25k+",unknown:"Not sure yet"},authority:{"decision-maker":"Decision-maker",influencer:"Influencer",researcher:"Researcher",unknown:"Unknown"},timeline:{immediate:"Immediately","this-quarter":"This quarter",later:"Later",unknown:"No timeline"}}[t][r]||r:"\u2014"}getPriorityClass(t){return t?`priority-${t.toLowerCase()}`:"priority-cold"}getPriorityIcon(t){switch(t?.toUpperCase()){case"HOT":return"pi pi-exclamation-circle";case"WARM":return"pi pi-exclamation-triangle";default:return"pi pi-info-circle"}}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-lead-qualifier"]],inputs:{selectedCard:"selectedCard"},outputs:{onComplete:"onComplete"},standalone:!1,decls:10,vars:11,consts:[["class","flex flex-column ",4,"ngIf"],["class","mt-3",4,"ngIf"],["position","right","showCloseIcon","false","styleClass","p-sidebar-md custom-drawer",3,"visibleChange","onHide","visible","blockScroll"],["pTemplate","header"],["pTemplate","content"],[1,"fixed","bottom-0","left-0","w-full","bg-white","border-top-1","border-gray-200","p-3"],[1,"flex","justify-content-between","align-items-center","mx-auto",2,"width","380px"],["pButton","","type","button","icon","pi pi-arrow-left","label","Back",1,"p-button-text","text-gray-500",3,"click","disabled"],["pButton","","type","button",1,"p-button-rounded","px-6",3,"click","label","disabled"],[1,"flex","flex-column"],[1,"w-full","flex","align-items-center","justify-content-center","gap-2","py-2","border-1","border-blue-200","border-round-lg","cursor-pointer","hover:bg-blue-100","transition-colors",3,"click"],[1,"pi","pi-sparkles","text-blue-600","font-bold"],[1,"text-blue-600","text-sm"],[1,"mt-3"],[1,"flex","align-items-center","justify-content-center","gap-2","p-3","border-1","border-round-lg","font-medium","cursor-pointer","transition-all","duration-200",3,"click","ngClass"],[1,"text-base"],[1,"flex","align-items-center","justify-content-center","gap-2","p-2","border-1","border-round-lg","font-medium","cursor-pointer","transition-all","duration-200",3,"click","ngClass"],[1,"flex","flex-column","w-full","gap-3","p-2"],[1,"flex","justify-content-between","align-items-start"],[1,"flex","align-items-center","gap-2"],[1,"flex","align-items-center","justify-content-center","bg-blue-100","border-round-md",2,"width","32px","height","32px"],[1,"pi","pi-sparkles","text-blue-500","text-sm"],[1,"text-sm","font-bold","m-0","text-900"],[1,"text-xs","text-gray-500"],[1,"pi","pi-times","cursor-pointer","text-400","text-sm",3,"click"],["class","flex justify-content-between align-items-end mt-1",4,"ngIf"],["class","w-full bg-gray-100 border-round-sm overflow-hidden","style","height: 4px;",4,"ngIf"],[1,"flex","justify-content-between","align-items-end","mt-1"],[1,"text-xs","font-semibold","text-gray-400","uppercase","tracking-wider"],[1,"text-xs","font-medium","text-blue-400","cursor-pointer","hover:underline",3,"click"],[1,"w-full","bg-gray-100","border-round-sm","overflow-hidden",2,"height","4px"],[1,"bg-blue-500","h-full","transition-all","transition-duration-500"],[4,"ngIf"],["class","flex flex-column gap-3 px-1 py-1",4,"ngIf"],["class","flex flex-column gap-3",4,"ngIf"],["class","flex flex-column gap-2 mt-2",4,"ngIf"],["class","flex flex-column gap-2 mt-sm-3",4,"ngIf"],["class","flex flex-column gap-2 mt-3",4,"ngIf"],[1,"flex","flex-column","gap-3"],[1,"flex","align-items-start","gap-2","mt-3","mb-3"],[1,"flex","align-items-center","justify-content-center","bg-gray-50","border-1","border-gray-100","border-round-md",2,"min-width","36px","height","36px"],[1,"pi","pi-bullseye","text-gray-600","text-base"],[1,"flex","flex-column","gap-1"],[1,"text-base","font-bold","m-0","text-900"],[1,"flex","flex-column","gap-2"],[1,"p-2","px-3","border-1","border-round-lg","cursor-pointer","transition-all","shadow-sm",3,"click","ngClass"],[1,"font-bold","text-sm","text-900"],[1,"flex","flex-column","gap-2","mt-2"],[1,"flex","align-items-start","gap-2","mb-3"],[1,"pi","pi-wallet","text-gray-600","text-base"],[1,"flex","flex-column","gap-2","mt-sm-3"],[1,"pi","pi-user","text-gray-600","text-base"],[1,"pi","pi-calendar-plus","text-gray-600","text-base"],[1,"flex","flex-column","gap-2","mt-3"],[1,"pi","pi-sparkles","text-gray-600","text-base"],[1,"flex","justify-content-between","gap-2"],["class","flex-1 flex align-items-center justify-content-center py-3 border-1 border-round-lg cursor-pointer transition-all shadow-sm font-bold text-lg",3,"ngClass","click",4,"ngFor","ngForOf"],[1,"flex","justify-content-between","px-1"],[1,"text-xs","text-gray-400","font-medium"],[1,"flex-1","flex","align-items-center","justify-content-center","py-3","border-1","border-round-lg","cursor-pointer","transition-all","shadow-sm","font-bold","text-lg",3,"click","ngClass"],[1,"flex","flex-column","gap-3","px-1","py-1"],[1,"p-3","border-round-lg","border-1","shadow-sm",3,"ngClass"],[1,"flex","align-items-start","justify-content-between","mb-2"],[1,"flex","align-items-start","gap-3"],[1,"text-3xl"],[1,"flex","align-items-baseline"],[1,"text-3xl","font-bold","-mt-1",2,"color","inherit"],[1,"text-gray-500","ml-1","text-base"],[1,"text-xs","opacity-80","font-medium"],[1,"p-tag","border-round-3xl","bg-white","border-1","px-3","py-1","text-xs","font-semibold","uppercase","tracking-wide","w-max","roun"],[1,"flex","flex-wrap","gap-2","mt-2"],[1,"flex-grow-1","flex-basis-40","p-2","border-1","border-gray-100","border-round-md","bg-white","shadow-sm"],[1,"block","text-gray-400","font-bold","uppercase","text-xxs","mb-1"],[1,"font-semibold","text-sm","text-900"],[1,"block","text-xs","italic","text-gray-400","mt-3","max-w-100","leading-normal"]],template:function(r,i){1&r&&(e.DNE(0,Ef,5,0,"div",0)(1,If,5,5,"div",1)(2,Df,5,4,"div",1),e.j41(3,"p-drawer",2),e.mxI("visibleChange",function(o){return e.DH7(i.leadQualifier,o)||(i.leadQualifier=o),o}),e.bIt("onHide",function(){return i.destroyComponet()}),e.DNE(4,Af,13,2,"ng-template",3)(5,Vf,2,2,"ng-template",4),e.j41(6,"div",5)(7,"div",6)(8,"button",7),e.bIt("click",function(){return i.handleBackClick()}),e.k0s(),e.j41(9,"button",8),e.bIt("click",function(){return i.handleNextClick()}),e.k0s()()()()),2&r&&(e.Y8G("ngIf",!(null!=i.selectedCard&&i.selectedCard.PriorityId||i.isQualified)),e.R7$(),e.Y8G("ngIf",!(null!=i.selectedCard&&i.selectedCard.PriorityId)&&i.isQualified),e.R7$(),e.Y8G("ngIf",(null==i.selectedCard?null:i.selectedCard.PriorityId)&&!i.isQualified),e.R7$(),e.Aen(e.lJ4(10,Ff)),e.R50("visible",i.leadQualifier),e.Y8G("blockScroll",!0),e.R7$(5),e.Y8G("disabled",1===i.currentStep&&!i.isComplete),e.R7$(),e.Y8G("label",i.isComplete?"Save and Close"
1:5===i.currentStep?"Complete":"Next")("disabled",!i.isComplete&&i.isNextDisabled()))},dependencies:[q.YU,q.Sq,q.bT,be.Ei,xe._f,Ve._s],styles:[".custom-drawer .p-drawer-content{padding:8px!important} .custom-drawer .p-drawer-header{padding:8px!important;background-color:#f0f5fb!important;border-bottom:1px solid #cccc}.priority-hot[_ngcontent-%COMP%]{background-color:#ecfdf5!important;border-color:#a7f3d0!important;color:#059669!important}.priority-hot[_ngcontent-%COMP%] .border-top-1[_ngcontent-%COMP%]{border-color:#a7f3d0!important}.priority-hot[_ngcontent-%COMP%] .p-tag[_ngcontent-%COMP%]{color:#059669!important;border-color:#a7f3d0!important}.priority-warm[_ngcontent-%COMP%]{background-color:#fffbeb!important;border-color:#fde68a!important;color:#d97706!important}.priority-warm[_ngcontent-%COMP%] .border-top-1[_ngcontent-%COMP%]{border-color:#fde68a!important}.priority-warm[_ngcontent-%COMP%] .p-tag[_ngcontent-%COMP%]{color:#d97706!important;border-color:#fde68a!important}.priority-cold[_ngcontent-%COMP%]{background-color:#f8fafc!important;border-color:#e2e8f0!important;color:#475569!important}.priority-cold[_ngcontent-%COMP%] .border-top-1[_ngcontent-%COMP%]{border-color:#e2e8f0!important}.priority-cold[_ngcontent-%COMP%] .p-tag[_ngcontent-%COMP%]{color:#475569!important;border-color:#e2e8f0!important}.w-max[_ngcontent-%COMP%]{width:max-content}"]})}return n})();const Uf=()=>({width:"420px"}),Xf=()=>({width:"420px",height:"100vh"}),Gl=()=>({standalone:!0}),Yf=()=>({width:"32px",height:"32px"}),Wf=()=>({height:"200px"});function Hf(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",27)(1,"div",28)(2,"div",29)(3,"div",30),e.nrm(4,"i",31),e.k0s(),e.j41(5,"div",32)(6,"h2",33),e.EFF(7,"Create New Deal"),e.k0s(),e.j41(8,"span",34),e.EFF(9,"Add a new opportunity to your pipeline"),e.k0s()()(),e.j41(10,"i",35),e.bIt("click",function(){e.eBV(t);const i=e.XpG(),s=e.sdS(1);return i.destroyComponet(),e.Njj(s.fullScreen=!1)}),e.k0s()(),e.j41(11,"div",36)(12,"div",37),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.selectTab("info"))}),e.nrm(13,"i",38),e.j41(14,"span",39),e.EFF(15,"Deal Info"),e.k0s()(),e.j41(16,"div",37),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.selectTab("description"))}),e.nrm(17,"i",40),e.j41(18,"span",41),e.EFF(19,"Description"),e.k0s()(),e.j41(20,"div",37),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.selectTab("attachments"))}),e.nrm(21,"i",42),e.j41(22,"span",41),e.EFF(23,"Attachments"),e.k0s()()()()}if(2&n){const t=e.XpG();e.R7$(12),e.Y8G("ngClass","info"===t.activeTab?"bg-white text-gray-800":"text-gray-500 hover:bg-white-alpha-50"),e.R7$(),e.Y8G("ngClass","info"===t.activeTab?"text-gray-700":"text-gray-400"),e.R7$(3),e.Y8G("ngClass","description"===t.activeTab?"bg-white shadow-1 text-gray-800":"text-gray-500 hover:bg-white-alpha-50"),e.R7$(),e.Y8G("ngClass","description"===t.activeTab?"text-gray-700":"text-gray-400"),e.R7$(3),e.Y8G("ngClass","attachments"===t.activeTab?"bg-white shadow-1 text-gray-800":"text-gray-500 hover:bg-white-alpha-50"),e.R7$(),e.Y8G("ngClass","attachments"===t.activeTab?"text-gray-700":"text-gray-400")}}function zf(n,a){1&n&&(e.j41(0,"small",49),e.EFF(1," Title is required (min 2 characters). "),e.k0s())}function qf(n,a){if(1&n&&(e.qex(0),e.j41(1,"span",67),e.EFF(2),e.k0s(),e.bVm()),2&n){const t=a.$implicit;e.R7$(2),e.SpI("",t.Name,",")}}function Jf(n,a){if(1&n&&(e.j41(0,"div",65),e.DNE(1,qf,3,1,"ng-container",66),e.k0s()),2&n){const t=a.$implicit;e.R7$(),e.Y8G("ngForOf",t)}}function Kf(n,a){if(1&n&&(e.j41(0,"div",23),e.nrm(1,"p-avatar",68),e.j41(2,"span"),e.EFF(3),e.k0s()()),2&n){const t=a.$implicit,r=e.XpG(3);e.R7$(),e.Aen(e.lJ4(5,Yf)),e.Y8G("image",t.PictureId?r.IMG_ROUTE+t.PictureId:null)("icon",t.PictureId?null:"pi pi-user"),e.R7$(2),e.JRh(t.Name)}}function Qf(n,a){1&n&&(e.j41(0,"small",49),e.EFF(1," Assignee is required. "),e.k0s())}function Zf(n,a){if(1&n&&(e.nrm(0,"input",75),e.nI1(1,"lowercase")),2&n){let t;const r=e.XpG().$implicit;e.Y8G("placeholder","Enter "+e.bMT(1,1,null==(t=r.get("Title"))?null:t.value))}}function em(n,a){1&n&&e.nrm(0,"input",76)}function tm(n,a){1&n&&e.nrm(0,"input",77)}function nm(n,a){if(1&n&&(e.nrm(0,"p-inputnumber",78),e.nI1(1,"lowercase")),2&n){let t;const r=e.XpG().$implicit;e.Y8G("placeholder","Enter "+e.bMT(1,1,null==(t=r.get("Title"))?null:t.value))}}function rm(n,a){1&n&&e.nrm(0,"p-datepicker",79)}function im(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",61)(1,"div",69)(2,"div",70),e.EFF(3),e.k0s(),e.j41(4,"div",71),e.nrm(5,"p-select",72),e.k0s(),e.j41(6,"button",73),e.bIt("click",function(){const i=e.eBV(t).$index,s=e.XpG(3);return e.Njj(s.removeField(i))}),e.nrm(7,"i",74),e.k0s()(),e.j41(8,"div"),e.DNE(9,Zf,2,3,"input",75)(10,em,1,0,"input",76)(11,tm,1,0,"input",77)(12,nm,2,3,"p-inputnumber",78)(13,rm,1,0,"p-datepicker",79),e.k0s()()}if(2&n){let t,r,i,s,o,l;const c=a.$implicit,d=e.XpG(3);e.Y8G("formGroup",c),e.R7$(3),e.SpI(" ",null==(t=c.get("Title"))?null:t.value," "),e.R7$(2),e.Y8G("options",d.fieldTypeOptions),e.R7$(4),e.vxM(1===(null==(r=c.get("Type"))?null:r.value)||5===(null==(r=c.get("Type"))?null:r.value)?9:-1),e.R7$(),e.vxM(6===(null==(i=c.get("Type"))?null:i.value)?10:-1),e.R7$(),e.vxM(4===(null==(s=c.get("Type"))?null:s.value)?11:-1),e.R7$(),e.vxM(2===(null==(o=c.get("Type"))?null:o.value)?12:-1),e.R7$(),e.vxM(3===(null==(l=c.get("Type"))?null:l.value)?13:-1)}}function am(n,a){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"div",45)(2,"div",46)(3,"div",47)(4,"label",48),e.
1EFF(5,"Title "),e.j41(6,"span",49),e.EFF(7,"*"),e.k0s()(),e.nrm(8,"input",50),e.DNE(9,zf,2,0,"small",51),e.k0s(),e.j41(10,"div",47)(11,"label",48),e.EFF(12,"Amount "),e.nrm(13,"span",49),e.k0s(),e.nrm(14,"input",52),e.k0s()(),e.j41(15,"div",46)(16,"div",47)(17,"label",48),e.EFF(18,"Inbound / Outbound"),e.k0s(),e.nrm(19,"p-select",53),e.k0s(),e.j41(20,"div",47)(21,"label",48),e.EFF(22,"Source"),e.k0s(),e.nrm(23,"p-select",54),e.k0s()(),e.j41(24,"div",46)(25,"div",47)(26,"label",48),e.EFF(27,"Assignee "),e.j41(28,"span",49),e.EFF(29,"*"),e.k0s()(),e.j41(30,"p-multiSelect",55),e.bIt("onChange",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.onItemCheckboxIcon(i))}),e.DNE(31,Jf,2,1,"ng-template",56)(32,Kf,4,6,"ng-template",57),e.k0s(),e.DNE(33,Qf,2,0,"small",51),e.k0s(),e.j41(34,"div",47)(35,"label",48),e.EFF(36,"Due Date"),e.k0s(),e.nrm(37,"input",58),e.k0s()()(),e.nrm(38,"hr",59),e.j41(39,"div",60),e.Z7z(40,im,14,8,"div",61,e.fX1),e.k0s(),e.j41(42,"button",62),e.bIt("click",function(i){e.eBV(t),e.XpG(2);const s=e.sdS(17);return e.Njj(s.toggle(i))}),e.nrm(43,"i",63),e.EFF(44," Add custom field "),e.k0s(),e.j41(45,"app-lead-qualifier",64),e.bIt("onComplete",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.handleQualification(i))}),e.k0s(),e.bVm()}if(2&n){let t,r;const i=e.XpG(2);e.R7$(9),e.Y8G("ngIf",(null==(t=i.TicketForm.get("title"))?null:t.touched)&&(null==(t=i.TicketForm.get("title"))?null:t.invalid)),e.R7$(10),e.Y8G("options",i.opportunityTypes),e.R7$(4),e.Y8G("options",i.sources),e.R7$(7),e.Y8G("options",i.boardTeamMembers)("panelStyleClass","w-full rounded-lg shadow")("styleClass","flex gap-2"),e.R7$(3),e.Y8G("ngIf",(null==(r=i.TicketForm.get("assignee"))?null:r.touched)&&(null==(r=i.TicketForm.get("assignee"))?null:r.invalid)),e.R7$(7),e.Dyx(i.customFieldsArray.controls)}}function sm(n,a){1&n&&(e.j41(0,"span",90),e.nrm(1,"button",91)(2,"button",92),e.k0s(),e.j41(3,"span",90),e.nrm(4,"button",93)(5,"button",94),e.k0s())}function om(n,a){if(1&n){const t=e.RV6();e.j41(0,"p-chip",95),e.bIt("onRemove",function(){const i=e.eBV(t).$implicit,s=e.XpG(3);return e.Njj(s.removeTagFromChip(i))}),e.k0s()}2&n&&e.Y8G("label",a.$implicit.Name)("removable",!0)}function lm(n,a){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"div",80)(2,"div",81)(3,"label",82),e.EFF(4,"Description"),e.k0s(),e.j41(5,"p-editor",83),e.DNE(6,sm,6,0,"ng-template",4),e.k0s()(),e.j41(7,"div",84)(8,"label",85),e.EFF(9,"Tags"),e.k0s(),e.j41(10,"div",86),e.DNE(11,om,1,2,"p-chip",87),e.j41(12,"button",88),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.showTagDialog=!0)}),e.k0s()(),e.j41(13,"small",89),e.EFF(14,"Help others find your deal by adding relevant categories."),e.k0s()()(),e.bVm()}if(2&n){const t=e.XpG(2);e.R7$(5),e.Aen(e.lJ4(3,Wf)),e.R7$(6),e.Y8G("ngForOf",t.selectedTags)}}function cm(n,a){}function dm(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",101),e.bIt("click",function(){e.eBV(t),e.XpG();const i=e.sdS(4);return e.Njj(i.choose())}),e.j41(1,"div",102),e.nrm(2,"i",103),e.k0s(),e.j41(3,"span",104),e.EFF(4,"Upload Files"),e.k0s(),e.j41(5,"span",105),e.EFF(6,"Drag and drop or click to upload PDF, JPG, or PNG files"),e.k0s(),e.j41(7,"button",106),e.bIt("click",function(i){e.eBV(t),e.XpG();const s=e.sdS(4);return i.stopPropagation(),e.Njj(s.choose())}),e.k0s()()}}function pm(n,a){}function um(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",110)(1,"div",29)(2,"div"),e.nrm(3,"i"),e.k0s(),e.j41(4,"div",32)(5,"span",111),e.EFF(6),e.k0s(),e.j41(7,"small",89),e.EFF(8),e.nI1(9,"number"),e.k0s()()(),e.j41(10,"button",112),e.bIt("click",function(){const i=e.eBV(t).index,s=e.XpG(4);return e.Njj(s.removeFile(i))}),e.k0s()()}if(2&n){const t=a.$implicit,r=e.XpG(4);e.R7$(2),e.HbH(r.getFileIconContainerClass(t.name)),e.R7$(),e.HbH(r.getFileIcon(t.name)),e.R7$(3),e.JRh(t.name),e.R7$(2),e.SpI("",e.i5U(9,6,t.size/1024/1024,"1.1-2")," MB \u2022 Uploaded recently")}}function fm(n,a){if(1&n&&(e.j41(0,"div",107)(1,"span",108),e.EFF(2,"Uploaded Files"),e.k0s(),e.DNE(3,um,11,9,"div",109),e.k0s()),2&n){const t=e.XpG(3);e.R7$(3),e.Y8G("ngForOf",t.uploadedFiles)}}function mm(n,a){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"div",96)(2,"div",97)(3,"p-fileUpload",98,2),e.bIt("onSelect",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.uploadFile(i))}),e.DNE(5,cm,0,0,"ng-template",4)(6,dm,8,0,"ng-template",5)(7,pm,0,0,"ng-template",99),e.k0s()(),e.DNE(8,fm,4,1,"div",100),e.k0s(),e.bVm()}if(2&n){const t=e.XpG(2);e.R7$(3),e.Y8G("multiple",!0)("customUpload",!0)("showUploadButton",!1)("showCancelButton",!1),e.R7$(5),e.Y8G("ngIf",t.uploadedFiles.length>0)}}function hm(n,a){if(1&n&&(e.j41(0,"form",43),e.DNE(1,am,46,7,"ng-container",44)(2,lm,15,4,"ng-container",44)(3,mm,9,5,"ng-container",44),e.k0s()),2&n){const t=e.XpG();e.Y8G("formGroup",t.TicketForm),e.R7$(),e.Y8G("ngIf","info"===t.activeTab),e.R7$(),e.Y8G("ngIf","description"===t.activeTab),e.R7$(),e.Y8G("ngIf","attachments"===t.activeTab)}}function gm(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",113)(1,"button",114),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.destroyComponet())}),e.k0s(),e.j41(2,"p-button",115),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onSubmit())}),e.k0s()()}if(2&n){const t=e.XpG();e.R7$(2),e.Y8G("loading",t.loading)("disabled",t.TicketForm.invali
1d)}}function _m(n,a){1&n&&(e.j41(0,"div",116)(1,"span",117),e.EFF(2,"Select Tags"),e.k0s()())}function xm(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",118),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.createTagFromInput())}),e.k0s()}}function vm(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",119)(1,"div",29),e.nrm(2,"i",120),e.j41(3,"span",121),e.EFF(4),e.k0s()(),e.j41(5,"p-checkbox",122),e.mxI("ngModelChange",function(i){const s=e.eBV(t).$implicit;return e.DH7(s.selected,i)||(s.selected=i),e.Njj(i)}),e.bIt("onChange",function(i){const s=e.eBV(t).$implicit,o=e.XpG();return e.Njj(o.toggleTagSelection(s,i))}),e.k0s()()}if(2&n){const t=a.$implicit;e.R7$(4),e.JRh(t.Name),e.R7$(),e.Y8G("binary",!0),e.R50("ngModel",t.selected),e.Y8G("ngModelOptions",e.lJ4(4,Gl))}}function bm(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",21)(1,"div",116)(2,"span",123),e.EFF(3),e.k0s(),e.j41(4,"p-button",124),e.bIt("onClick",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.clearAll())}),e.k0s()(),e.j41(5,"p-button",125),e.bIt("onClick",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.showTagDialog=!1)}),e.k0s()()}if(2&n){const t=e.XpG();e.R7$(3),e.SpI("",t.selectedTags.length," tags selected")}}function Cm(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",126),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG(),o=e.sdS(17);return e.Njj(s.addSuggestedField(i,o))}),e.EFF(1),e.k0s()}if(2&n){const t=a.$implicit;e.R7$(),e.SpI(" + ",t," ")}}let km=(()=>{class n{formBuilder;route;store;_boardService;messageService;teamService;edit=!1;selectedCard=null;cardId=0;loading=!1;closeSlider=new e.bkB;createDeal=new e.bkB;IMG_ROUTE=`${Xt.c.apiUrl}/api/storage/image/`;showDialog=!1;TicketForm;boardUsers$;boardTeamMembers=[];selectedBoardTeamMembers=[];destroyed=new Ol.B;currentScreenSize="";showFollowUpFields=!1;tags=[];tagStates={};tagModel=new J.W8;tagInputValue="";seletedTags=[];beTracks=[];taskFollowUp=[];selectedDate="";inputInvalid=!1;LOAD_STATE=J.nC;loadState=J.nC.NOT_LOADING;trackIdList=[];attachedFiles=[];selectedTrackId;newFileId=null;moveCardToTrack=new e.bkB;selectedFileId;showDocIcon=!1;richTextValue="";showTagDropdown=!1;showAddInput=!1;memberIds=[];creatingNewTag=!1;tagInputControl=new L.MJ("");board=null;sources=[];featureKey="sales_tracker";uploadedFiles=[];fileIds=[];leadPriorities=[{label:"Hot Lead",value:1,color:"#e63946",emoji:"\u{1f525}"},{label:"Warm Lead",value:2,color:"#f4a261",emoji:"\u{1f324}\ufe0f"},{label:"Lead (Low)",value:0,color:"#6c757d",emoji:"\u2744\ufe0f"}];opportunityTypes=[{label:"Inbound",value:!0},{label:"Outbound",value:!1}];showTagDialog=!1;searchText="";isFormChanged=!1;activeTab="info";CardType=J.bU;customFields=[];newFieldName="";newFieldType=1;suggestedFields=["Address","Start Date","Contract End Date","Company Website","LinkedIn","Phone","Industry","Region","Contract Length","Decision Maker","Budget Confirmed","Next Steps","Renewal Date","Deal Reference"];fieldTypeOptions=[{label:"Text",value:1},{label:"Number",value:2},{label:"Date",value:3},{label:"URL",value:4},{label:"Address",value:5},{label:"Email",value:6}];constructor(t,r,i,s,o,l){this.formBuilder=t,this.route=r,this.store=i,this._boardService=s,this.messageService=o,this.teamService=l,this._boardService.board$.subscribe(c=>{c&&(this.board=c,this.store.dispatch((0,Nl.R)({board:c})),this.boardUsers$=this.store.select("board"),this.boardUsers$.subscribe({next:d=>{this.boardTeamMembers=d.BoardUsers}}))}),this._boardService.tracks$.subscribe(c=>{this.beTracks=c}),this._boardService.getOpportunitySources().subscribe(c=>{this.sources=c})}generateTicketCode(t){return t+"-"+String(Math.ceil(1e3*Math.random()))}ngOnInit(){this.showDialog=!0,this.TicketForm=this.formBuilder.group({title:new L.MJ("",[L.k0.required,L.k0.minLength(2)]),amount:new L.MJ(null),opportunityType:new L.MJ(null),opportunitySourceId:new L.MJ(null),startDateUtc:new L.MJ(this.getTodayDateUtc(),[L.k0.required]),dueDateUtc:new L.MJ(null),assignee:new L.MJ(null,[L.k0.required]),createdAt:Date.now(),taskFollowUps:this.formBuilder.array([]),selectedDate:new L.MJ,cardTags:new L.MJ([]),tagInputValue:new L.MJ,companyName:new L.MJ,attachmentFile:new L.MJ,associatePerson:new L.MJ,associateEmail:new L.MJ,associateNumber:new L.MJ,companyWebsite:new L.MJ,selectedTrackId:new L.MJ,cardComments:new L.MJ,description:new L.MJ(""),color:new L.MJ,priority:new L.MJ,tagIds:new L.MJ,cardTypeId:J.bU.Manual,customFields:this.formBuilder.array([])}),this.richTextValue="",this.TicketForm.get("description")?.setValue(this.richTextValue),this.loadUserTagsDropDown()}get taskFollowUps(){return this.TicketForm.get("taskFollowUps")}onItemCheckboxIcon(t){this.memberIds=t.value.map(i=>i.Id)}getTodayDateUtc(){const t=new Date;return new Date(t.getTime()+6e4*t.getTimezoneOffset()).toISOString().split("T")[0]}newTaskFollowUp(){return this.taskFollowUp=this.formBuilder.group({name:[""],phoneNumber:[""],email:[""],followUpDateUtc:""})}addTaskFollowUp(){this.taskFollowUps.push(this.newTaskFollowUp())}
1toggleFollowUpFields(){this.showFollowUpFields=!this.showFollowUpFields}getUserNameFromId(t){return(0,at.YK)(t,this.boardTeamMembers)}onSubmit(){this.TicketForm.valid?(this.TicketForm.patchValue({assignee:this.memberIds}),this.createDeal.emit(this.TicketForm.value),setTimeout(()=>{this.close()},2e3)):this.TicketForm.markAllAsTouched()}removeFollowUp(t){this.TicketForm.get("taskFollowUps").removeAt(t)}close(){this.destroyComponet()}updateFollowUpDates(){const t=this.TicketForm.get("taskFollowUps"),r=this.selectedDate;t.controls.forEach(i=>{const s=i.get("followUpDateUtc");s&&s.setValue(r)})}loadUserTagsDropDown(){this._boardService.userTagsDropDown().subscribe({next:t=>{this.tags=t.map(r=>({Name:r.label,Id:r.value,selected:!1}))},error:t=>{}})}toggleTagSelection(t,r){const i=this.TicketForm.get("cardTags")?.value||[],s=this.TicketForm.get("tagIds")?.value||[];if(r.checked)i.some(o=>o.Id===t.Id)||(i.push(t),s.push(t.Id));else{const o=i.findIndex(c=>c.Id===t.Id);-1!==o&&i.splice(o,1);const l=s.indexOf(t.Id);-1!==l&&s.splice(l,1)}this.TicketForm.get("cardTags")?.setValue(i),this.TicketForm.get("tagIds")?.setValue(s)}get selectedTags(){return this.TicketForm.get("cardTags")?.value||[]}get filteredTags(){if(!this.searchText)return this.tags;const t=this.searchText.toLowerCase();return this.tags.filter(r=>r.Name.toLowerCase().includes(t))}removeTagFromChip(t){const r=this.tags.find(i=>i.Id===t.Id);r&&(r.selected=!1),this.toggleTagSelection(t,{checked:!1})}
1clearAll(){this.tags.forEach(t=>t.selected=!1),this.TicketForm.get("cardTags")?.setValue([]),this.TicketForm.get("tagIds")?.setValue([])}logTypedName(t){this.tagInputValue=t.target.value.trim()}onFileSelected(t){const r=t.target.files;this.attachedFiles=[];for(let i=0;i<r.length;i++)this.attachedFiles.push(r[i])}uploadFile(t){const r=t.currentFiles||t.files;r&&r.filter(s=>!this.uploadedFiles.some(o=>o.name===s.name&&o.size===s.size)).forEach(s=>{const o={name:s.name,size:s.size,id:"",loading:!0};this.uploadedFiles.push(o),this._boardService.postImage(s,this.featureKey,this.teamService.getCurrentTeam.Team.Id).subscribe({next:l=>{o.id=l.PublicId,o.loading=!1,this.fileIds.push(l.PublicId),this.updateFormControl()},error:l=>{console.error("Upload failed",l),o.loading=!1,this.uploadedFiles=this.uploadedFiles.filter(c=>c!==o)}})})}removeFile(t){this.fileIds.splice(t,1),this.uploadedFiles.splice(t,1),this.updateFormControl()}updateFormControl(){const t=this.fileIds.join(",");this.TicketForm.get("attachmentFile")?.setValue(t)}getFileIcon(t){const r=t.split(".").pop()?.toLowerCase();return"pdf"===r?"pi pi-file-pdf text-red-500":"xlsx"===r||"xls"===r?"pi pi-file-excel text-green-500":["jpg","jpeg","png"].includes(r)?"pi pi-image text-blue-500":"pi pi-file text-gray-500"}getFileIconContainerClass(t){const r=t.split(".").pop()?.toLowerCase();let i="p-3 border-round-md ";return"pdf"===r?i+"bg-red-50":"xlsx"===r||"xls"===r?i+"bg-green-50":["jpg","jpeg","png"].includes(r)?i+"bg-blue-50":i+"bg-gray-50"}openFile(t){window.open(URL.createObjectURL(t))}moveToTrack(t){this.moveCardToTrack.emit(t)}onTrackSelectionChange(t){this._boardService.setSelectedTrackId(t.value)}removeDocument(){this.TicketForm.patchValue({attachmentFile:null}),this.selectedFileId=null,this.showDocIcon=!1}destroyComponet(){(!this.isFormChanged||confirm("You have unsaved changes. Are you sure you want to close without saving?"))&&(this.showDialog=!1,this.isFormChanged=!1,this.closeSlider.emit())}startCreatingTag(){this.creatingNewTag=!0,this.tagInputControl.setValue("")}cancelCreatingTag(){this.creatingNewTag=!1,this.tagInputControl.setValue("")}createTagFromInput(){const t=this.searchText?.trim();t&&(this.tags.some(i=>i.Name.toLowerCase()===t.toLowerCase())?this.messageService.add({severity:"warn",summary:"Duplicate Tag",detail:`"${t}" already exists.`}):(this.tagModel.Name=t,this._boardService.createTag(this.tagModel).subscribe({next:i=>{const s={Id:i?.value,Name:i?.label??t,selected:!0};this.tags.push(s);const o=this.TicketForm.get("CardTags")?.value||[];this.TicketForm.get("CardTags")?.setValue([...o,s.Id]),this.searchText="",this.messageService.add({severity:"success",summary:"Tag Created",detail:`The tag "${s.Name}" was added successfully.`})},error:()=>{this.messageService.add({severity:"error",summary:"Creation Failed",detail:"Could not create the tag. Please try again."})}})))}get isExactMatch(){return this.tags.some(t=>t.Name.toLowerCase()===this.searchText.toLowerCase().trim())}selectTab(t){this.activeTab=t}handleQualification(t){this.TicketForm.patchValue({priority:t.priorityValue})}addSuggestedField(t,r){const i=this.formBuilder.group({Title:new L.MJ(t),Type:new L.MJ(1),Value:new L.MJ(null)});this.customFieldsArray.push(i),r.hide()}createCustomField(t){if(!this.newFieldName)return;const r=this.formBuilder.group({Title:new L.MJ(this.newFieldName),Type:new L.MJ(this.newFieldType),Value:new L.MJ(null)});this.customFieldsArray.push(r),this.newFieldName="",this.newFieldType=1,t.hide()}removeField(t){this.customFieldsArray.removeAt(t)}get customFieldsArray(){return this.TicketForm.get("customFields")}static \u0275fac=function(r){return new(r||n)(e.rXU(L.ok),e.rXU(rn.nX),e.rXU(Hs.il),e.rXU(_t.a),e.rXU(be.bg),e.rXU(rt.n))};static \u0275cmp=e.VBU({type:n,selectors:[["app-create-deal"]],inputs:{edit:"edit",selectedCard:"selectedCard",cardId:"cardId",loading:"loading"},outputs:{closeSlider:"closeSlider",createDeal:"createDeal",moveCardToTrack:"moveCardToTrack"},standalone:!1,decls:33,vars:19,consts:[["eventSideBar",""],["op",""],["fileInput",""],["position","right","showCloseIcon","false","styleClass","custom-no-padding-drawer",3,"visibleChange","onHide","visible","blockScroll"],["pTemplate","header"],["pTemplate","content"],["pTemplate","footer"],["position","right","styleClass","custom-tag-drawer",3,"visibleChange","visible","modal"],[1,"flex","flex-column","h-full","gap-2"],[1,"flex","gap-2","mb-1","p-2","bg-gray-50","border-bottom-1"],[1,"p-input-icon-left","w-full"],["type","text","pInputText","","placeholder","Search or type to create a new tag (e.g. Priority)...",1,"w-full","surface-50","border-1","border-round-md","surface-border","p-2","text-xs",3,"ngModelChange","ngModel","ngModelOptions"],["pButton","","type","button","icon","pi pi-plus","class","p-button-success w-full",3,"click",4,"ngIf"],[1,"flex","flex-column","overflow-y-auto",2,"flex","1 1 auto"],["class","flex align-items-center justify-content-between p-2 hover:surface-100 border-round transition-duration-150",4,"ngFor","ngForOf"],[1,"w-20rem","p-1"],[1,"text-xs","font-semibold","text-500","mb-2","tracking-wider"],[1,"flex","flex-wrap","gap-2","mb-3"],["type","button",1,"bg-slate-50","border-1","border-round","border-300","px-2","py-1","text-xs","text-600","cursor-pointer","hover:bg-100","transition-colors"],[1,"border-none","border-top-1","surface-border","my-3"],[1,"text-xs","font-semibold","text-500","mb-3","tracking-wider"],[1,"flex","flex-column","gap-2"],["type","text","pInputText","","placeholder","Field name (e.g. Referral Source)",1,"w-full","bg-slate-50",3,"ngModelChange","ngModel"],[1,"flex","gap-2","align-items-center"],[1,"flex-1"],["optionLabel","label","optionValue","value","styleClass","w-full bg-slate-50",3,"ngModelChange","ngModel","options"],["type","button","pButton","","label","Add",3,"click","disabled"],[1,"flex","flex-column","w-full","p-2"],[1,"flex","justify-content-between","align-items-start","mb-2"],[1,"flex","align-items-center","gap-3"],[1,"flex","align-items-center","justify-content-center","bg-blue-100","border-round-xl",2,"width","40px","height","40px"],[1,"pi","pi-chart-line","text-blue-500","text-xl"],[1,"flex","flex-column"],[1,"text-xl","font-bold","m-0","text-900",2,"line-height","1.2"],[1,"text-xs","font-normal","text-400"],[1,"pi","pi-times","cursor-pointer","text-400","hover:text-900","transition-colors",2,"font-size","0.9rem",3,"click"],[1,"flex","align-items-center","bg-gray-50","border-1","border-gray-200","border-round-lg","p-1","gap-0","w-full","overflow-x-auto"],[1,"flex","align-items-center","gap-2","p-2","border-round-md","cursor-pointer","flex-grow-1","justify-content-center","transition-all",3,"click","ngClass"],[1,"pi","pi-info-circle","text-xs",3,"ngClass"],[1,"text-xs","font-semibold"],[1,"pi","pi-comment","text-xs",3,"ngClass"],[1,"text-xs","font-medium"],[1,"pi","pi-paperclip","text-xs",3,"ngClass"],["
1id","create-card-form",3,"formGroup"],[4,"ngIf"],[1,"flex","flex-column","mt-3"],[1,"flex","w-full"],[1,"flex","flex-column","col-6"],[1,"mb-1"],[1,"text-red-600"],["type","text","pInputText","","formControlName","title","placeholder","Enter deal name",1,"w-full"],["class","text-red-600",4,"ngIf"],["type","number","pInputText","","formControlName","amount","placeholder","Enter deal amount",1,"w-full"],["optionLabel","label","optionValue","value","formControlName","opportunityType","placeholder","Select type",1,"w-full",3,"options"],["optionLabel","label","optionValue","value","formControlName","opportunitySourceId","placeholder","Select source",1,"w-full",3,"options"],["formControlName","assignee","optionLabel","Name","placeholder","Select deal owner","filter","",3,"onChange","options","panelStyleClass","styleClass"],["pTemplate","selectedItems"],["pTemplate","item"],["type","date","pInputText","","formControlName","dueDateUtc",1,"w-full"],[1,"my-3"],[1,"flex","flex-column","gap-3","mb-3"],[1,"p-3","border-1","border-round-xl","border-200","bg-white","flex","flex-column","gap-3",3,"formGroup"],["type","button",1,"w-full","p-2","bg-white","border-1","border-dashed","border-round-md","border-300","text-color-secondary","font-semibold","cursor-pointer","flex","align-items-center","justify-content-center","gap-2","hover:bg-gray-50","transition-colors","mb-2",3,"click"],[1,"pi","pi-plus","text-xs","font-bold"],[3,"onComplete"],[1,"flex","flex-wrap","gap-1"],[4,"ngFor","ngForOf"],[1,"text-sm"],["shape","circle",3,"image","icon"],[1,"flex","align-items-center","gap-2"],[1,"flex-grow-1","p-2","border-1","border-round-md","border-100","bg-white","text-900","font-semibold","text-base"],[2,"width","110px"],["formControlName","Type","optionLabel","label","optionValue","value","styleClass","w-full bg-white border-1 border-100 text-sm",3,"options"],["type","button",1,"p-link","p-2","text-400","hover:text-600","border-none","bg-transparent","shadow-none","transition-colors","flex","align-items-center","justify-content-center",2,"background","transparent","border","none","box-shadow","none",3,"click"],[1,"pi","pi-times","text-xs"],["type","text","pInputText","","formControlName","Value",1,"w-full","p-2","border-1","border-100","bg-white","text-sm","font-normal","text-color-secondary",3,"placeholder"],["type","email","pInputText","","placeholder","Enter email address","formControlName","Value",1,"w-full","p-2","border-1","border-100","bg-white","text-sm","font-normal","text-color-secondary"],["type","url","pInputText","","placeholder","https://example.com","formControlName","Value",1,"w-full","p-2","border-1","border-100","bg-white","text-sm","font-normal","text-color-secondary"],["formControlName","Value","styleClass","w-full","inputStyleClass","w-full p-2 border-1 border-100 bg-white text-sm font-normal text-color-secondary",3,"placeholder"],["placeholder","yyyy/mm/dd","formControlName","Value","styleClass","w-full","inputStyleClass","w-full p-2 border-1 border-100 bg-white text-sm font-normal text-color-secondary"],[1,"flex","flex-column","gap-3","mt-3"],[1,"flex","flex-column","p-1"],[1,"font-medium","mb-2"],["formControlName","description","placeholder","Write your notes here...",1,"w-full"],[1,"flex","flex-column","gap-2","mt-3"],[1,"font-medium","text-sm","text-900"],[1,"flex","align-items-center","flex-wrap","gap-2","p-2","border-1","border-round","surface-border","surface-50","min-h-8rem"],["styleClass","bg-blue-50 text-blue-600 border-1 border-blue-100 text-xs font-medium custom-chip",3,"label","removable","onRemove",4,"ngFor","ngForOf"],["pButton","","type","button","icon","pi pi-plus","label","Select Tags",1,"p-button-text","p-button-sm","dotted-btn","text-500","px-3","py-1",3,"click"],[1,"text-500"],[1,"ql-formats"],[1,"ql-bold"],[1,"ql-italic"],["value","ordered",1,"ql-list"],["value","bullet",1,"ql-list"],["styleClass","bg-blue-50 text-blue-600 border-1 border-blue-100 text-xs font-medium custom-chip",3,"onRemove","label","removable"],[1,"flex","flex-column","gap-4","mt-3"],[1,"upload-container"],["name","files[]","accept","image/*,.pdf,.xlsx,.docx","maxFileSize","10000000","mode","advanced",3,"onSelect","multiple","customUpload","showUploadButton","showCancelButton"],["pTemplate","file"],["class","flex flex-column gap-3",4,"ngIf"],[1,"flex","flex-column","align-items-center","justify-content-center","py-5","border-2","border-dashed","border-300","border-round-xl","surface-50","cursor-pointer","hover:surface-100","transition-duration-200",3,"click"],[1,"bg-blue-50","border-circle","p-3","mb-3"],[1,"pi","pi-upload","text-blue-500","text-2xl"],[1,"font-bold","text-900","mb-1"],[1,"text-600","text-sm"],["pButton","","type","button","label","Select Files",1,"p-button-primary","mt-3","px-4","shadow-2",3,"click"],[1,"flex","flex-column","gap-3"],[1,"text-xs","font-bold","text-500","uppercase","tracking-wider"],["class","flex align-items-center justify-content-between p-3 border-1 border-100 border-round-lg shadow-sm bg-white",4,"ngFor","ngForOf"],[1,"flex","align-items-center","justify-content-between","p-3","border-1","border-100","border-round-lg","shadow-sm","bg-white"],[1,"font-semibold","text-900"],["pButton","","icon","pi pi-trash",1,"p-button-text","p-button-danger","p-button-rounded",3,"click"],[1,"flex","justify-content-end","gap-2"],["pButton","","type","button","label","Cancel","icon","pi pi-times-circle",1,"p-button-outlined","rounded-pill",3,"click"],["type","button","label","Submit",1,"p-button-rounded",3,"click","loading","disabled"],[1,"flex","align-items-center","justify-content-between"],[1,"font-bold","text-lg"],["pButton","","type","button","icon","pi pi-plus",1,"p-button-success","w-full",3,"click"],[1,"flex","align-items-center","justify-content-between","p-2","hover:surface-100","border-round","transition-duration-150"],[1,"pi","pi-tag","text-400"],[1,"text-800"],[3,"ngModelChange","onChange","binary","ngModel","ngModelOptions"],[1,"text-xs","text-500"],["label","Clear all","styleClass","p-button-text p-button-sm text-blue-600 p-0",3,"onClick"],["label","Done","styleClass","w-full p-1 font-bold shadow-2",1,"w-full",3,"onClick"],["type","button",1,"bg-slate-50","border-1","border-round","border-300","px-2","py-1","text-xs","text-600","cursor-pointer","hover:bg-100","transition-colors",3,"click"]],template:function(r,i){if(1&r){const s=e.RV6();e.j41(0,"p-drawer",3,0),e.mxI("visibleChange",function(l){return e.eBV(s),e.DH7(i.showDialog,l)||(i.showDialog=l),e.Njj(l)}),e.bIt("onHide",function(){return e.eBV(s),e.Njj(i.destroyComponet())}),e.DNE(2,Hf,24,6,"ng-template",4)(3,hm,4,4,"ng-template",5)(4,gm,3,2,"ng-template",6),e.nrm(5,"p-toast"),e.k0s(),e.j41(6,"p-drawer",7),e.mxI("visibleChange",function(l){return e.eBV(s),e.DH7(i.showTagDialog,l)||(i.showTagDialog=l),e.Njj(l)}),e.DNE(7,_m,3,0,"ng-template",4),e.j41(8,"div",8)(9,"div",9)(10,"span",10)(11,"input",11),e.mxI("ngModelChange",function(l){return e.eBV(s),e.DH7(i.searchText,l)||(i.searchText=l),e.Njj(l)}),e.k0s()(),e.DNE(12,xm,1,0,"button",12),e.k0s(),e.j41(13,"div",13),e.DNE(14,vm,6,5,"div",14),e.k0s()(),e.DNE(15,bm,6,1,"ng-template",6),e.k0s(),e.j41(16,"p-popover",null,1)(18,"div",15)(19,"div",16),e.EFF(20,"SUGGESTED"),e.k0s(),e.j41(21,"div",17),e.Z7z(22,Cm,2,1,"button",18,e.fX1),e.k0s(),e.nrm(24,"hr",19),e.j41(25,"div",20),e.EFF(26,"CREATE YOUR OWN"),e.k0s(),e.j41(27,"div",21)(28,"input",22),e.mxI("ngModelChange",function(l){return e.eBV(s),e.DH7(i.newFieldName,l)||(i.newFieldName=l),e.Njj(l)}),e.k0s(),e.j41(29,"div",23)(30,"div",24)(31,"p-select",25),e.mxI("ngModelChange",function(l){return e.eBV(s),e.DH7(i.newFieldType,l)||(i.newFieldType=l),e.Njj(l)}),e.k0s()(),e.j41(32,"button",26),e.bIt("click",function(){e.eBV(s);const l=e.sdS(17);return e.Njj(i.createCustomField(l))}),e.k0s()()()()()}2&r&&(e.Aen(e.lJ4(16,Uf)),e.R50("visible",i.showDialog),e.Y8G("blockScroll",!0),e.R7$(6),e.Aen(e.lJ4(17,Xf)),e.R50("visible",i.showTagDialog),e.Y8G("modal",!0),e.R7$(5),e.R50("ngModel",i.searchText),e.Y8G("ngModelOptions",e.lJ4(18,Gl)),e.R7$(),e.Y8G("ngIf",i.searchText&&!i.isExactMatch),e.R7$(2),e.Y8G("ngForOf",i.filteredTags),e.R7$(8),e.Dyx(i.suggestedFields),e.R7$(6),e.R50("ngModel",i.newFieldName),e.R7$(3),e.R50("ngModel",i.newFieldType),e.Y8G("options",i.fieldTypeOptions),e.R7$(),e.Y8G("disabled",!i.newFieldName))}
1,dependencies:[q.YU,q.Sq,q.bT,be.Ei,zn.eu,Ie.y8,Qe.Sm,L.qT,L.me,L.Q0,L.BC,L.cb,L.vS,xe._f,xe.$n,Qi.KE,Ve._s,De.KF,qa.vu,L.j4,L.JD,Oe.l6,Ae.AM,An.lr,Xr.Sc,ji.ef,vt.YI,Ja,q.GH,q.QX],styles:["label[_ngcontent-%COMP%]{color:#8390a2;font-weight:400;font-size:14px}input[pInputText][_ngcontent-%COMP%], input[type=date][_ngcontent-%COMP%], .p-inputtext[_ngcontent-%COMP%], .p-dropdown[_ngcontent-%COMP%], .p-multiselect[_ngcontent-%COMP%]{height:2.5rem;padding:0 .75rem;box-sizing:border-box}.p-dropdown[_ngcontent-%COMP%] .p-dropdown-label[_ngcontent-%COMP%]{line-height:2.5rem} .p-button-outlined{background:transparent!important;border-color:#39f!important;color:#39f!important} .p-button-outlined:hover{background:#e0f2ff!important;border-color:#39f!important;color:#007acc!important} .p-button-text{color:#39f!important} .p-button-outlined:active, .p-button-outlined:focus{background:#a3d5ff!important;border-color:#007acc!important;color:#036!important}.emoji-circle[_ngcontent-%COMP%]{display:inline-flex;justify-content:center;align-items:center;width:1.5rem;height:1.5rem;border-radius:50%;color:#fff;font-size:.9rem}.popover-content[_ngcontent-%COMP%]{max-height:250px;overflow-y:auto}.popover-tag-row[_ngcontent-%COMP%]{width:100%;overflow:hidden;text-overflow:ellipsis}.custom-tabs[_ngcontent-%COMP%] .p-tab[_ngcontent-%COMP%]{font-size:.9rem!important;font-weight:600!important;font-family:Inter,sans-serif!important}.custom-tabs[_ngcontent-%COMP%] .p-tablist[_ngcontent-%COMP%]{border-top:1px solid #efebebcc} .p-tabpanels{padding:0!important} .p-drawer-footer{border-top:1px solid #cccc!important} .custom-tag-drawer .p-drawer-content{padding:0!important} .custom-tag-drawer .p-drawer-header{border-bottom:1px solid #cccc!important}.dotted-btn[_ngcontent-%COMP%]{border:1px dashed #cbd5e1!important;border-radius:20px!important;background:transparent!important;font-size:.8rem!important}.dotted-btn[_ngcontent-%COMP%]:hover{background:#f8fafc!important;border-color:#94a3b8!important} .custom-chip{border-radius:16px!important;padding:2px 4px}[_nghost-%COMP%] [_ngcontent-%COMP%]::v-deep .p-fileupload-content[_ngcontent-%COMP%]{border:none!important;padding:0!important}[_nghost-%COMP%] [_ngcontent-%COMP%]::v-deep .p-fileupload-buttonbar[_ngcontent-%COMP%]{display:none!important} .custom-no-padding-drawer .p-drawer-content{padding:4px!important} .custom-no-padding-drawer .p-drawer-header{padding:4px!important;background-color:#f0f5fb!important;border-bottom:1px solid #cccc}"]})}return n})();var Tm=ee(47070),Ka=ee(71486),Zi=ee(80820),wm=ee(62205),Ai=ee(7515);const ym=()=>({width:"420px"});function Fm(n,a){if(1&n&&(e.j41(0,"div",11)(1,"div",12),e.nrm(2,"i",13),e.k0s(),e.j41(3,"div",14)(4,"div",15)(5,"span",16),e.EFF(6,"Deal Activity"),e.k0s(),e.j41(7,"span",17),e.EFF(8),e.k0s()(),e.j41(9,"div",18),e.EFF(10),e.k0s()()()),2&n){const t=e.XpG();e.R7$(7),e.xc7("background-color",null!=t.track&&t.track.Color?null==t.track?null:t.track.Color:"#3b82f6"),e.R7$(),e.SpI(" ",null==t.track?null:t.track.Title," "),e.R7$(2),e.SpI(" ",null==t.card?null:t.card.Title," ")}}function Sm(n,a){if(1&n&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&n){const t=e.XpG();e.R7$(),e.SpI("(",null==t.followUpTasks?null:t.followUpTasks.length,")")}}function Em(n,a){1&n&&(e.j41(0,"div",21),e.nrm(1,"p-progressSpinner",22),e.k0s())}function Im(n,a){1&n&&(e.j41(0,"div",25),e.EFF(1," No notes found for this deal. "),e.k0s())}function Dm(n,a){if(1&n&&(e.j41(0,"span",33),e.nrm(1,"i",34),e.EFF(2),e.k0s()),2&n){const t=e.XpG().$implicit,r=e.XpG(3);e.Y8G("ngStyle",r.getBadgeStyles(t.ContactMethod)),e.R7$(),e.HbH(r.FollowUpTypeIcons[t.ContactMethod]),e.R7$(),e.SpI(" ",t.ContactMethodString," ")}}function Rm(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",26)(1,"div",27)(2,"div",15)(3,"span",28),e.EFF(4),e.k0s(),e.DNE(5,Dm,3,4,"span",29),e.k0s(),e.j41(6,"i",30),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG(3);return e.Njj(s.deleteNote(i.Id))}),e.k0s()(),e.j41(7,"div",31),e.EFF(8),e.k0s(),e.j41(9,"div",32),e.EFF(10),e.nI1(11,"date"),e.k0s()()}if(2&n){const t=a.$implicit,r=e.XpG(3);e.R7$(4),e.SpI(" ",t.CreatedByUserId===r.currentUserId?"You":t.FullName," "),e.R7$(),e.Y8G("ngIf",t.ContactMethod),e.R7$(3),e.SpI(" ",t.NoteContent," "),e.R7$(2),e.SpI(" ",e.i5U(11,4,t.DateCreatedUtc,"M/d/yyyy, h:mm:ss a")," ")}}function jm(n,a){if(1&n&&(e.qex(0),e.DNE(1,Im,2,0,"div",23)(2,Rm,12,7,"div",24),e.bVm()),2&n){const t=e.XpG(2);e.R7$(),e.Y8G("ngIf",0===(null==t.notes?null:t.notes.length)),e.R7$(),e.Y8G("ngForOf",t.n
1otes)}}function Am(n,a){if(1&n&&(e.j41(0,"div",19),e.DNE(1,Em,2,0,"div",20)(2,jm,3,2,"ng-container",7),e.k0s()),2&n){const t=e.XpG();e.R7$(),e.Y8G("ngIf",t.loadingNotes),e.R7$(),e.Y8G("ngIf",!t.loadingNotes)}}function Mm(n,a){1&n&&(e.j41(0,"div",21),e.nrm(1,"p-progressSpinner",22),e.k0s())}function Pm(n,a){1&n&&(e.j41(0,"div",25),e.EFF(1," No follow-up tasks assigned to this deal. "),e.k0s())}function Om(n,a){if(1&n&&(e.qex(0),e.j41(1,"span",46),e.nrm(2,"i",34),e.EFF(3),e.k0s(),e.bVm()),2&n){const t=e.XpG().$implicit,r=e.XpG(3);e.R7$(),e.Y8G("ngStyle",r.getBadgeStyles(t.TaskFollowUpDetails[0].Type)),e.R7$(),e.HbH(r.FollowUpTypeIcons[t.TaskFollowUpDetails[0].Type]),e.R7$(),e.SpI(" ",r.FollowUpTypeLabels[t.TaskFollowUpDetails[0].Type]," ")}}function Nm(n,a){1&n&&(e.j41(0,"span",47),e.EFF(1," Overdue "),e.k0s())}function Gm(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",37)(1,"div",38)(2,"p-checkbox",39),e.bIt("onChange",function(){const i=e.eBV(t).$implicit,s=e.XpG(3);return e.Njj(s.completeTask(i))}),e.mxI("ngModelChange",function(i){const s=e.eBV(t).$implicit;return e.DH7(s.Done,i)||(s.Done=i),e.Njj(i)}),e.k0s(),e.j41(3,"div",40)(4,"div",27)(5,"div",15),e.DNE(6,Om,4,4,"ng-container",7)(7,Nm,2,0,"span",41),e.k0s(),e.j41(8,"i",30),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG(3);return e.Njj(s.onDeleteFollowUp(i.Id))}),e.k0s()(),e.j41(9,"div",42)(10,"div",43),e.EFF(11),e.k0s()(),e.j41(12,"div",44),e.nrm(13,"i",45),e.EFF(14),e.nI1(15,"date"),e.k0s()()()()}if(2&n){const t=a.$implicit,r=e.XpG(3);e.Y8G("ngClass",r.isOverdue(t.FollowUpDateUtc)?"bg-red-50 border-red-200":"border-200"),e.R7$(2),e.Y8G("binary",!0),e.R50("ngModel",t.Done),e.R7$(4),e.Y8G("ngIf",null==t.TaskFollowUpDetails?null:t.TaskFollowUpDetails.length),e.R7$(),e.Y8G("ngIf",r.isOverdue(t.FollowUpDateUtc)),e.R7$(4),e.JRh(t.Name),e.R7$(3),e.SpI(" ",e.i5U(15,7,t.FollowUpDateUtc,"MMM d, yyyy")," ")}}function Bm(n,a){if(1&n&&(e.qex(0),e.DNE(1,Pm,2,0,"div",23)(2,Gm,16,10,"div",36),e.bVm()),2&n){const t=e.XpG(2);e.R7$(),e.Y8G("ngIf",0===(null==t.followUpTasks?null:t.followUpTasks.length)),e.R7$(),e.Y8G("ngForOf",t.followUpTasks)}}function Lm(n,a){if(1&n&&(e.j41(0,"div",35),e.DNE(1,Mm,2,0,"div",20)(2,Bm,3,2,"ng-container",7),e.k0s()),2&n){const t=e.XpG();e.R7$(),e.Y8G("ngIf",t.loadingFollowUps),e.R7$(),e.Y8G("ngIf",!t.loadingFollowUps)}}function $m(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",55),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG(2);return e.Njj(s.contactMethod=i)}),e.nrm(1,"i",56),e.k0s()}if(2&n){const t=a.$implicit,r=e.XpG(2);e.Y8G("title",r.FollowUpTypeLabels[t])("ngClass",r.contactMethod===t?"border-blue-500 bg-blue-50 text-blue-600":"border-200 text-600"),e.R7$(),e.HbH(r.FollowUpTypeIcons[t])}}function Vm(n,a){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"div",49),e.EFF(2,"Follow-up details"),e.k0s(),e.j41(3,"div",57)(4,"p-datepicker",58),e.mxI("ngModelChange",function(i){e.eBV(t);const s=e.XpG(2);return e.DH7(s.FollowUpDateUtc,i)||(s.FollowUpDateUtc=i),e.Njj(i)}),e.k0s()(),e.bVm()}if(2&n){const t=e.XpG(2);e.R7$(4),e.R50("ngModel",t.FollowUpDateUtc)}}function Um(n,a){if(1&n){const t=e.RV6();e.j41(0,"textarea",59),e.mxI("ngModelChange",function(i){e.eBV(t);const s=e.XpG(2);return e.DH7(s.noteText,i)||(s.noteText=i),e.Njj(i)}),e.EFF(1," "),e.k0s()}if(2&n){const t=e.XpG(2);e.R50("ngModel",t.noteText)}}function Xm(n,a){if(1&n){const t=e.RV6();e.j41(0,"textarea",60),e.mxI("ngModelChange",function(i){e.eBV(t);const s=e.XpG(2);return e.DH7(s.taskName,i)||(s.taskName=i),e.Njj(i)}),e.EFF(1," "),e.k0s()}if(2&n){const t=e.XpG(2);e.R50("ngModel",t.taskName),e.Y8G("placeholder","Description")}}function Ym(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",48)(1,"div",49),e.EFF(2),e.k0s(),e.j41(3,"div",50),e.DNE(4,$m,2,4,"button",51),e.k0s(),e.DNE(5,Vm,5,1,"ng-container",7)(6,Um,2,1,"textarea",52)(7,Xm,2,2,"textarea",53),e.j41(8,"button",54),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj("notes"===i.activeTab?i.createNote():i.createFollowUp())}),e.k0s()()}if(2&n){const t=e.XpG();e.R7$(2),e.SpI(" ","notes"===t.activeTab?"Contact method (optional)":"Action type"," "),e.R7$(2),e.Y8G("ngForOf",t.followUpTypeKeys),e.R7$(),e.Y8G("ngIf","followups"===t.activeTab),e.R7$(),e.Y8G("ngIf","notes"===t.activeTab),e.R7$(),e.Y8G("ngIf","followups"===t.activeTab),e.R7$(),e.Y8G("label","notes"===t.activeTab?"Add Note":"Add Follow Up")("disabled",t.isButtonDisabled())("icon","pi pi-plus")}}let zs=(()=>{class n{_boardService;auth;messageService;cdr;notes=[];noteText="";contactMethod=null;visible=!1;visibleChange=new e.bkB;card;track;initialTab=null;activeTab="notes";loading=!1;currentUserId=null;loadingNotes=!1;loadingFollowUps=!1;FollowUpTypeIcons={[J.VO.CellPhone]:"pi pi-phone",[J.VO.Email]:"pi pi-envelope",[J.VO.WhatsApp]:"pi pi-w
1hatsapp",[J.VO.InPerson]:"pi pi-users",[J.VO.Online]:"pi pi-video"};FollowUpType=J.VO;followUpTypeKeys=Object.values(J.VO).filter(t=>"number"==typeof t);FollowUpTypeLabels={[J.VO.CellPhone]:"Call",[J.VO.Email]:"Email",[J.VO.WhatsApp]:"WhatsApp",[J.VO.InPerson]:"In Person",[J.VO.Online]:"Online"};followUpTasks;FollowUpDateUtc;valueInput;taskName;constructor(t,r,i,s){this._boardService=t,this.auth=r,this.messageService=i,this.cdr=s,this.currentUserId=this.auth.getUserId()}ngOnInit(){this.card&&(this.loadNotes(),this.getTrack(this.card.TrackId),this.initialTab&&(this.activeTab=this.initialTab))}createNote(){this._boardService.createNote({noteContent:this.noteText,contactMethod:this.contactMethod,cardId:this.card.Id}).subscribe({next:r=>{this.notes.unshift(r),this.card.NotesCount=(this.card.NotesCount||0)+1,this._boardService.updateCardNotesCount(this.card.Id,this.card.NotesCount),this.resetFollowUpForm(),this.messageService.add({severity:"success",summary:"Note Created"})},error:r=>{console.error("Error creating note",r),this.messageService.add({severity:"error",summary:"Error"})}})}loadNotes(){this.loadingNotes=!0,this._boardService.getNotes(this.card.Id).subscribe({next:t=>{this.notes=t,this.loadingNotes=!1,this.cdr.detectChanges()},error:t=>{console.error("Error loading notes:",t),this.loadingNotes=!1,this.cdr.detectChanges()}})}deleteNote(t){this._boardService.deleteNote(t).subscribe({next:()=>{this.notes=this.notes.filter(r=>r.Id!==t),this.card.NotesCount=Math.max((this.card.NotesCount||1)-1,0),this._boardService.updateCardNotesCount(this.card.Id,this.card.NotesCount),this.messageService.add({severity:"info",summary:"Deleted",detail:"Note deleted successfully",life:3e3})},error:r=>{console.error("Error deleting note",r),this.messageService.add({severity:"error",summary:"Error",detail:"Failed to delete note",life:3e3})}})}getTrack(t){this.loading=!0,this._boardService.getTrack(t.toString()).subscribe({next:r=>{this.track=r,this.loading=!1},error:r=>{console.error("Error loading track:",r),this.loading=!1}})}getBadgeStyles(t){const r={"font-weight":"500",border:"1px solid"};switch(t){case 1:r["background-color"]="#eff6ff",r.color="#3b82f6",r["border-color"]="#dbeafe";break;case 2:r["background-color"]="#f0fdf4",r.color="#16a34a",r["border-color"]="#dcfce7";break;case 3:r["background-color"]="#f0fdf4",r.color="#22c55e",r["border-color"]="#dcfce7";break;case 4:r["background-color"]="#fff7ed",r.color="#f97316",r["border-color"]="#ffedd5";break;case 5:r["background-color"]="#faf5ff",r.color="#a855f7",r["border-color"]="#f3e8ff";break;default:r["background-color"]="#f1f5f9",r.color="#64748b",r["border-color"]="#e2e8f0"}return r}closeDrawer(){this.visible=!1,this.visibleChange.emit(!1)}loadFollowUps(){this.loadingFollowUps=!0,this.cdr.detectChanges(),this._boardService.getTaskFollowUps(this.card.Id).subscribe({next:t=>{this.followUpTasks=t,this.loadingFollowUps=!1,this.cdr.detectChanges()},error:t=>{console.error("API Error:",t),this.loadingFollowUps=!1,this.cdr.detectChanges()},complete:()=>{this.loadingFollowUps=!1,this.cdr.detectChanges()}})}switchTab(t){this.activeTab=t,"notes"!==t?"followups"===t&&((!this.followUpTasks||0===this.followUpTasks.length)&&this.loadFollowUps(),this.followUpTypeKeys&&this.followUpTypeKeys.length>0&&(this.contactMethod=this.followUpTypeKeys[0])):this.contactMethod=null}isOverdue(t){if(!t)return!1;const r=new Date;return r.setHours(0,0,0,0),new Date(t)<r}createFollowUp(){if(this.isButtonDisabled())return;const t={Name:this.taskName,CreatedByUserId:this.currentUserId,DateCreatedUtc:new Date,FollowUpDateUtc:this.FollowUpDateUtc,CardId:this.card.Id,TaskFollowUpDetails:[{Type:Number(this.contactMethod),ValueInput:"No ValueInput"}]};this._boardService.createFollowUpTask(t).subscribe({next:r=>{this.followUpTasks=this.followUpTasks??[],this.followUpTasks.unshift(r),this.resetFollowUpForm(),this.messageService.add({severity:"success",summary:"Follow-Up Created",detail:"Task follow-up added successfully"})},error:r=>{this.messageService.add({severity:"error",summary:"Error",detail:"Failed to create follow-up"})}})}resetFollowUpForm(){this.noteText="",this.taskName="",this.valueInput="",this.FollowUpDateUtc=null,"followups"===this.activeTab&&this.followUpTypeKeys.length>0&&(this.contactMethod=this.followUpTypeKeys[0])}isButtonDisabled(){return"notes"===this.activeTab?!this.noteText||!this.noteText.trim():!this.taskName||!this.taskName.trim()||!this.FollowUpDateUtc||null==this.contactMethod}completeTask(t){this._boardService.convertFollowUp({FollowUpId:t.Id,TaskFollowDetailId:t.TaskFollowUpDetails[0]?.Id,NoteContent:t.Name}).subscribe({next:i=>{this.notes&&this.notes.unshift(i),this.followUpTasks=this.followUpTasks.filter(s=>s.Id!==t.Id),this.card.NotesCount=(this.card.NotesCount||0)+1,this._boardService.updateCardNotesCount(this.card.Id,this.card.NotesCount),this.messageService.add({severity:"secondary",summary:"Task Completed",detail
1:"Moved to notes"})},error:i=>{this.messageService.add({severity:"error",summary:"Error",detail:"Failed to move task"})}})}onDeleteFollowUp(t){this._boardService.deleteFollowUp(t).subscribe({next:()=>{this.followUpTasks=this.followUpTasks.filter(r=>r.Id!==t),this.messageService.add({severity:"info",summary:"Deleted",detail:"Card deleted successfully",life:3e3})},error:r=>{this.messageService.add({severity:"error",summary:"Error",detail:"Failed to delete card",life:3e3})}})}static \u0275fac=function(r){return new(r||n)(e.rXU(_t.a),e.rXU(jn.u),e.rXU(be.bg),e.rXU(e.gRc))};static \u0275cmp=e.VBU({type:n,selectors:[["app-deal-notes"]],inputs:{visible:"visible",card:"card",track:"track",initialTab:"initialTab"},outputs:{visibleChange:"visibleChange"},standalone:!1,decls:16,vars:11,consts:[["position","right",3,"visibleChange","onHide","visible","blockScroll"],["pTemplate","header"],[1,"flex","gap-2","mb-1","p-2","bg-gray-50","border-bottom-1","surface-border"],[1,"flex-1","p-2","border-none","border-round-lg","cursor-pointer","flex","align-items-center","justify-content-center","gap-2","transition-duration-200",3,"click","ngClass"],[1,"pi","pi-book"],[1,"font-bold"],[1,"pi","pi-calendar"],[4,"ngIf"],["class","flex flex-column gap-3 overflow-y-auto","style","max-height: calc(100vh - 400px); padding: 10px;",4,"ngIf"],["class","flex flex-column gap-2 overflow-y-auto","style","max-height: calc(100vh - 400px); padding: 10px;",4,"ngIf"],["pTemplate","footer"],[1,"flex","align-items-center","w-full","gap-3"],[1,"surface-100","border-round-lg","p-2","flex","align-items-center","justify-content-center","border-1","border-200"],[1,"pi","pi-file","text-blue-500","text-lg"],[1,"flex","flex-column","gap-1"],[1,"flex","align-items-center","gap-2"],[1,"text-md","text-900"],[1,"text-white","text-xs","font-semibold","border-round-2xl","px-1"],[1,"text-500","text-xs","font-medium","uppercase","line-height-2"],[1,"flex","flex-column","gap-3","overflow-y-auto",2,"max-height","calc(100vh - 400px)","padding","10px"],["class","flex justify-content-center align-items-center py-5 w-full",4,"ngIf"],[1,"flex","justify-content-center","align-items-center","py-5","w-full"],["styleClass","w-3rem h-3rem","strokeWidth","4"],["class","text-center text-500 text-sm py-4",4,"ngIf"],["class","note-card p-2 border-round-xl border-1 flex flex-column gap-1 relative",4,"ngFor","ngForOf"],[1,"text-center","text-500","text-sm","py-4"],[1,"note-card","p-2","border-round-xl","border-1","flex","flex-column","gap-1","relative"],[1,"flex","align-items-center","justify-content-between"],[1,"font-semibold","text-blue-500","text-sm"],["class"," px-2 py-1 flex align-items-center gap-1 text-xs border-round-2xl",3,"ngStyle",4,"ngIf"],[1,"pi","pi-trash","delete-icon","text-red-500","cursor-pointer","transition-all","transition-duration-200",2,"font-size","0.9rem",3,"click"],[1,"text-700","text-sm","line-height-3","py-1"],[1,"text-xs","text-500"],[1,"px-2","py-1","flex","align-items-center","gap-1","text-xs","border-round-2xl",3,"ngStyle"],[2,"font-size","10px"],[1,"flex","flex-column","gap-2","overflow-y-auto",2,"max-height","calc(100vh - 400px)","padding","10px"],["class","note-card p-2 border-round-xl border-1 relative transition-all bg-white",3,"ngClass",4,"ngFor","ngForOf"],[1,"note-card","p-2","border-round-xl","border-1","relative","transition-all","bg-white",3,"ngClass"],[1,"flex","align-items-start","gap-2"],[1,"mt-1",3,"onChange","ngModelChange","binary","ngModel"],[1,"flex-grow-1","flex","flex-column","gap-1"],["class","text-red-500 font-bold text-xs uppercase",4,"ngIf"],[1,"flex","flex-column"],[1,"text-800","font-semibold","text-sm"],[1,"flex","align-items-center","gap-2","text-500","text-xs","mt-1"],[1,"pi","pi-calendar",2,"font-size","10px"],[1,"px-2","py-1","flex","align-items-center","gap-1","text-xs","border-round-2xl","font-medium",3,"ngStyle"],[1,"text-red-500","font-bold","text-xs","uppercase"],[1,"bg-white"],[1,"text-xs","text-500","mb-2"],[1,"flex","flex-wrap","gap-2","mb-3"],["class","method-btn p-2 border-1 border-round-lg bg-transparent cursor-pointer transition-colors hover:bg-gray-100",3,"title","ngClass","click",4,"ngFor","ngForOf"],["pInputTextarea","","rows","3","placeholder","Write a note...","class","w-full border-1 border-200 border-round-lg p-3 text-800 focus:border-blue-500 shadow-none mb-2 bg-gray-100","style","resize: none",3,"ngModel","ngModelChange",4,"ngIf"],["pInputTextarea","","rows","1","class","w-full border-1 border-200 border-round-lg p-2 text-800 focus:border-blue-500 shadow-none mb-2 ","style","resize: none; ",3,"ngModel","placeholder","ngModelChange",4,"ngIf"],["pButton","",1,"w-full","p-2","font-bold","border-round-lg",3,"click","label","disabled","icon"],[1,"method-btn","p-2","border-1","border-round-lg","bg-transparent","cursor-pointer","transition-colors","hover:bg-gray-100",3,"click","title","ngClass"],[1,"text-sm"],[1,"flex","flex-row","gap-2","mb-3"],["placeholder","Pick a date","appendTo","body","styleClass","w-full custom-bg",1,"flex-1","text-xs","bg-gray-100",3,"ngModelChange","ngModel"],["pInputTextarea","","rows","3","placeholder","Write a note...",1,"w-full","border-1","border-200","border-round-lg","p-3","text-800","focus:border-blue-500","shadow-none","mb-2","bg-gray-100",2,"resize","none",3,"ngModelChange","ngModel"],["pInputTextarea","","rows","1",1,"w-full","border-1","border-200","border-round-lg","p-2","text-800","focus:border-blue-500","shadow-none","mb-2",2,"resize","none",3,"ngModelChange","ngModel","placeholder"]],template:function(r,i){1&r&&(e.j41(0,"p-drawer",0),e.mxI("visibleChange",function(o){return e.DH7(i.visible,o)||(i.visible=o),o}),e.bIt("onHide",function(){return i.closeDrawer()}),e.DNE(1,Fm,11,4,"ng-template",1),e.j41(2,"div",2)(3,"button",3),e.bIt("click",function(){return i.switchTab("notes")}),e.nrm(4,"i",4),e.j41(5,"span",5),e.EFF(6),e.k0s()(),e.j41(7,"button",3),e.bIt("click",function(){return i.switchTab("followups")}),e.nrm(8,"i",6),e.j41(9,"span",5),e.EFF(10,"Follow Ups "),e.DNE(11,Sm,2,1,"span",7),e.k0s()()(),e.DNE(12,Am,3,2,"div",8)(13,Lm,3,2,"div",9)(14,Ym,9,8,"ng-template",10),e.nrm(15,"p-toast"),e.k0s()),2&r&&(e.Aen(e.lJ4(10,ym)),e.R50("visible",i.visible),e.Y8G("blockScroll",!0),e.R7$(3),e.Y8G("ngClass","notes"===i.activeTab?"bg-blue-600 text-white shadow-2":"surface-0 text-700"),e.R7$(3),e.SpI("Notes (",null==i.notes?null:i.notes.length,")"),e.R7$(),e.Y8G("ngClass","followups"===i.activeTab?"bg-blue-600 text-white shadow-2":"surface-0 text-700"),e.R7$(4),e.Y8G("ngIf",i.followUpTasks),e.R7$(),e.Y8G("ngIf","notes"===i.activeTab),e.R7$(),e.Y8G("ngIf","followups"===i.activeTab))},dependencies:[q.YU,q.Sq,q.bT,q.B3,be.Ei,xe._f,L.me,L.BC,L.vS,Ve._s,Ai.pT,Xr.Sc,An.lr,Ie.y8,q.vh],styles:[".p-drawer-header{padding:1.5rem 1.25rem .5rem!important;border-bottom:1px solid #ccc} .p-drawer-content{padding:0!important} .p-drawer-footer{padding:.5rem 1.25rem 1.5rem!important;border-top:1px solid #ccc}.delete-icon[_ngcontent-%COMP%]{opacity:0;transform:translate(5px);transition:all .2s ease-in-out}.note-card[_ngcontent-%COMP%]:hover .delete-icon[_ngcontent-%COMP%]{opacity:1;transform:translate(0)}.note-card[_ngcontent-%COMP%]{background-color:#f8f9fa!important;border-color:#f1f3f5!important}.note-card[_ngcontent-%COMP%]:hover{background-color:#fff!important;border-color:#e2e8f0!important}.method-btn[_ngcontent-%COMP%]{width:30px;height:30px;display:flex;align-items:center;justify-content:center}textarea[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 2px #3b82f61a!important}.custom-bg[_ngcontent-%COMP%]{background-color:#f9fafb!important;border-color:#e5e7eb!important}.p-toast[_ngcontent-%COMP%]{z-index:9999!important}"]})}return n})();const Wm=()=>({width:"420px",height:"100vh"}),Qa=()=>({standalone:!0});function Hm(n,a){if(1&n){const t=e.RV6();e.j41(0,"p-chip",17),e.bIt("onRemove",function(){const i=e.eBV(t).$implicit,s=e.XpG();return e.Njj(s.removeTagFromCard(i))}),e.k0s()}2&n&&e.Y8G("label",a.$implicit.Name)("removable",!0)}function zm(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",22),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.switchToManageMode())}),e.k0s()}}function qm(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",23),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.switchToSelectMode())}),e.k0s()}}function Jm(n,a){if(1&n&&(e.j41(0,"div",18)(1,"span",19),e.EFF(2),e.k0s(),e.DNE(3,zm,1,0,"button",20)(4,qm,1,0,"button",21),e.k0s()),2&n){const t=e.XpG();e.R7$(2),e.SpI(" ",t.isManageMode?"Manage Tags":"Select Tags"," "),e.R7$(),e.Y8G("ngIf",!t.isManageMode),e.R7$(),e.Y8G("ngIf",t.isManageMode)}}function Km(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",24),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.createTagFromInput())}),e.k0s()}}function Qm(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",25)(1,"p-checkbox",26),e.mxI("ngModelChange",function(i){e.eBV(t);const s=e.XpG();return e.DH7(s.isAllSelectedForDelete,i)||(s.isAllSelectedForDelete=i),e.Njj(i)}),e.bIt("onChange",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.toggleSelectAllForDelete(i.checked))}),e.k0s(),e.j41(2,"span",27),e.EFF(3,"Select all"),e.k0s()()}if(2&n){const t=e.XpG();e.R7$(),e.Y8G("binary",!0),e.R50("ngModel",t.isAllSelectedForDelete),e.Y8G("ngModelOptions",e.lJ4(3,Qa))}}function Zm(n,a){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"div",30),e.nrm(2,"i",31),e.j41(3,"span",32),e.EFF(4),e.k0s()(),e.j41(5,"p-checkbox",33),e.mxI("ngModelChange",function(i){e.eBV(t);const s=e.XpG().$implicit;return e.DH7(s.selected,i)||(s.selected=i),e.Njj(i)}),e.bIt("onChange",function(i){e.eBV(t);const s=e.XpG().$implicit,o=e.XpG();return e.Njj(o.toggleTagSelection(s,i))})("click",function(i){return e.eBV(t),e.Njj(i.stopPropagation())}),e.k0s(),e.bVm()}if(2&n){const t=e.XpG().$implicit;e.R7$(4),e.JRh(t.Name),e.R7$(),e.Y8G("binary",!0),e.R50("ngModel",t.selected),e.Y8G("ngModelOptions",e.lJ4(4,Qa))}}function e1(n,a){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"div",30)(2,"p-checkbox",33),e.mxI("ngModelChange",function(i){e.eBV(t);const s=e.XpG().$implicit;return e.DH7(s.markedForDelete,i)||(s.markedForDelete=i),e.Njj(i)}),e.bIt("onChange",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.updateBatchSelectionCount())})("click",function(i){return e.eBV(t),e.Njj(i.stopPropagation())}),e.k0s(),e.j41(3,"span",32),e.EFF(4),e.k0s()(),e.bVm()}if(2&n){const t=e.XpG().$implicit;e.R7$(2),e.Y8G("binary",!0),e.R50("ngModel",t.markedForDelete),e.Y8G("ngModelOptions",e.lJ4(4,Qa)),e.R7$(2),e.JRh(t.Name)}
1}function t1(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",28),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG();return e.Njj(s.handleRowClick(i))}),e.DNE(1,Zm,6,5,"ng-container",29)(2,e1,5,5,"ng-container",29),e.k0s()}if(2&n){const t=e.XpG();e.R7$(),e.Y8G("ngIf",!t.isManageMode),e.R7$(),e.Y8G("ngIf",t.isManageMode)}}function n1(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",36)(1,"div",37)(2,"span",38),e.EFF(3),e.k0s(),e.j41(4,"p-button",39),e.bIt("onClick",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.clearAll())}),e.k0s()(),e.j41(5,"p-button",40),e.bIt("onClick",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.showTagDialog=!1)}),e.k0s()()}if(2&n){const t=e.XpG(2);e.R7$(3),e.SpI("",(null==t.selectedTags?null:t.selectedTags.length)||0," tags selected")}}function r1(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",36)(1,"div",41)(2,"span",38),e.EFF(3),e.k0s()(),e.j41(4,"button",42),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.deleteSelectedBatch())}),e.k0s()()}if(2&n){const t=e.XpG(2);e.R7$(3),e.SpI("",t.itemsMarkedForDeleteCount," marked for deletion"),e.R7$(),e.Y8G("disabled",0===t.itemsMarkedForDeleteCount)}}function i1(n,a){if(1&n&&(e.j41(0,"div",34),e.DNE(1,n1,6,1,"div",35)(2,r1,5,2,"div",35),e.k0s()),2&n){const t=e.XpG();e.R7$(),e.Y8G("ngIf",!t.isManageMode),e.R7$(),e.Y8G("ngIf",t.isManageMode)}}let Za=(()=>{class n{_boardService;messageService;tags=[];tagModel=new J.W8;formGroup;selectedCard;showTagDialog=!1;searchText="";isManageMode=!1;isAllSelectedForDelete=!1;itemsMarkedForDeleteCount=0;constructor(t,r){this._boardService=t,this.messageService=r}ngOnInit(){this.loadUserTagsDropDown()}open(){this.showTagDialog=!0}get filteredTags(){if(!this.searchText)return this.tags;const t=this.searchText.toLowerCase();return this.tags.filter(r=>r.Name.toLowerCase().includes(t))}createTagFromInput(){const t=this.searchText?.trim();t&&(this.tags.some(i=>i.Name.toLowerCase()===t.toLowerCase())?this.messageService.add({severity:"warn",summary:"Duplicate Tag",detail:`"${t}" already exists.`}):(this.tagModel.Name=t,this._boardService.createTag(this.tagModel).subscribe({next:i=>{const o={Id:i?.value??i?.Id??i?.id,Name:i?.label??t,selected:!0};this.tags.push(o),this._boardService.addTag(this.selectedCard.Id,o.Id).subscribe({next:()=>{const l=this.formGroup.get("CardTags");if(l){const c=Array.isArray(l.value)?l.value:[];c.includes(o.Id)||(l.setValue([...c,o.Id]),l.markAsDirty(),l.updateValueAndValidity())}this.searchText="",this.messageService.add({severity:"success",summary:"Tag Created & Linked",detail:`The tag "${o.Name}" was created and attached to this card.`})},error:l=>{console.error("Tag created, but failed to link to card:",l),this.messageService.add({severity:"error",summary:"Linking Failed",detail:`Created "${o.Name}", but could not attach it to the card.`})}})},error:()=>{this.messageService.add({severity:"error",summary:"Creation Failed",detail:"Could not create the tag. Please try again."})}})))}toggleTagSelection(t,r){r.checked?this._boardService.addTag(this.selectedCard.Id,t.Id).subscribe({next:()=>{const s=this.formGroup.get("CardTags")?.value||[];s.includes(t.Id)||this.formGroup.get("CardTags")?.setValue([...s,t.Id])},error:s=>{t.selected=!1,console.error("Failed to add tag:",s)}}):this.removeTagFromCard(t)}removeTagFromCard(t){this._boardService.removeTag(this.selectedCard.Id,t.Id).subscribe({next:()=>{this.selectedCard?.CardTags&&(this.selectedCard.CardTags=this.selectedCard.CardTags.filter(s=>s.Id!==t.Id));const r=this.formGroup.get("CardTags")?.value||[];this.formGroup.get("CardTags")?.setValue(r.filter(s=>s!==t.Id));const i=this.tags.find(s=>s.Id===t.Id);i&&(i.selected=!1)},error:r=>console.log("Failed to remove tag: ",r)})}
1clearAll(){this.tags.forEach(t=>t.selected=!1),this.formGroup.get("cardTags")?.setValue([]),this.formGroup.get("tagIds")?.setValue([])}get isExactMatch(){return this.tags.some(t=>t.Name.toLowerCase()===this.searchText.toLowerCase().trim())}get selectedTags(){return this.tags.filter(t=>t.selected)}loadUserTagsDropDown(){this._boardService.userTagsDropDown().subscribe({next:t=>{const r=this.formGroup.get("CardTags")?.value||[];this.tags=t.map(i=>{const s=Number(i.value),o=r.some(l=>Number(l)===s);return{Name:i.label,Id:s,selected:o}})},error:t=>{console.error(t)}})}deleteTag(t){this._boardService.deleteTagById(t).subscribe({next:()=>{this.tags=this.tags.filter(r=>r.Id!==t),console.log("Tag removed successfully from source array.")},error:r=>{console.error("Could not delete tag from server",r)}})}switchToManageMode(){this.isManageMode=!0,this.searchText="",this.isAllSelectedForDelete=!1,this.tags.forEach(t=>t.markedForDelete=!1),this.updateBatchSelectionCount()}switchToSelectMode(){this.isManageMode=!1,this.searchText=""}toggleSelectAllForDelete(t){this.filteredTags.forEach(r=>{r.markedForDelete=t}),this.updateBatchSelectionCount()}updateBatchSelectionCount(){this.itemsMarkedForDeleteCount=this.tags.filter(t=>t.markedForDelete).length,this.isAllSelectedForDelete=0!==this.filteredTags.length&&this.filteredTags.every(t=>t.markedForDelete)}handleRowClick(t){this.isManageMode?(t.markedForDelete=!t.markedForDelete,this.updateBatchSelectionCount()):(t.selected=!t.selected,this.toggleTagSelection(t,{checked:t.selected}))}deleteSelectedBatch(){const t=this.tags.filter(r=>r.markedForDelete).map(r=>r.Id);0!==t.length&&this._boardService.deleteTagsBatch(t).subscribe({next:()=>{this.tags=this.tags.filter(r=>!t.includes(r.Id)),this.itemsMarkedForDeleteCount=0,this.isAllSelectedForDelete=!1,this.isManageMode=!1},error:r=>console.error("Batch deletion failed",r)})}static \u0275fac=function(r){return new(r||n)(e.rXU(_t.a),e.rXU(be.bg))};static \u0275cmp=e.VBU({type:n,selectors:[["app-tags-drawer"]],inputs:{formGroup:"formGroup",selectedCard:"selectedCard"},standalone:!1,decls:19,vars:13,consts:[[1,"flex","flex-column","gap-2","mt-3"],[1,"font-medium","text-sm","text-900"],[1,"flex","align-items-center","flex-wrap","gap-2","p-2","border-1","border-round","surface-border","surface-50","min-h-8rem"],["styleClass","bg-blue-50 text-blue-600 border-1 border-blue-100 text-xs font-medium custom-chip",3,"label","removable","onRemove",4,"ngFor","ngForOf"],["pButton","","type","button","icon","pi pi-plus","label","Select Tags",1,"p-button-text","p-button-sm","dotted-btn","text-500","px-3","py-1",3,"click"],[1,"text-500"],["position","right","styleClass","custom-tag-drawer",3,"visibleChange","visible","modal"],["pTemplate","header"],[1,"flex","flex-column","h-full"],[1,"p-1","border-bottom-1","surface-300","surface-border"],[1,"p-input-icon-left","w-full"],["type","text","pInputText","",1,"w-full","surface-50","border-1","border-300","border-round-md","p-2","pl-5","text-sm",3,"ngModelChange","placeholder","ngModel","ngModelOptions"],["pButton","","type","button","icon","pi pi-plus","class","p-button-success w-full mt-2",3,"click",4,"ngIf"],["class","flex align-items-center gap-2 px-2 pb-2 border-bottom-1 surface-border",4,"ngIf"],[1,"flex","flex-column","overflow-y-auto","px-1",2,"flex","1 1 auto"],["class","flex align-items-center justify-content-between py-3 px-3 hover:surface-100 border-bottom-1 surface-border transition-duration-150 cursor-pointer",3,"click",4,"ngFor","ngForOf"],["pTemplate","footer"],["styleClass","bg-blue-50 text-blue-600 border-1 border-blue-100 text-xs font-medium custom-chip",3,"onRemove","label","removable"],[1,"flex","align-items-center","justify-content-between","w-full","p-2"],[1,"font-bold","text-xl","text-900"],["pButton","","type","button","label","Manage","class","p-button-text p-button-secondary font-bold text-base text-800 p-0 hover:surface-100 px-2 py-1 border-round",3,"click",4,"ngIf"],["pButton","","type","button","label","Cancel","class","p-button-text p-button-secondary font-bold text-base text-800 p-0 hover:surface-100 px-2 py-1 border-round",3,"click",4,"ngIf"],["pButton","","type","button","label","Manage",1,"p-button-text","p-button-secondary","font-bold","text-base","text-800","p-0","hover:surface-100","px-2","py-1","border-round",3,"click"],["pButton","","type","button","label","Cancel",1,"p-button-text","p-button-secondary","font-bold","text-base","text-800","p-0","hover:surface-100","px-2","py-1","border-round",3,"click"],["pButton","","type","button","icon","pi pi-plus",1,"p-button-success","w-full","mt-2",3,"click"],[1,"flex","align-items-center","gap-2","px-2","pb-2","border-bottom-1","surface-border"],[3,"ngModelChange","onChange","binary","ngModel","ngModelOptions"],[1,"text-sm","text-600","font-medium","select-none"],[1,"flex","align-items-center","justify-content-between","py-3","px-3","hover:surface-100","border-bottom-1","surface-border","transition-duration-150","cursor-pointer",3,"click"],[4,"ngIf"],[1,"flex","align-items-center","gap-3"],[1,"pi","pi-tag","text-500","text-lg"],[1,"text-700","font-medium"],[3,"ngModelChange","onChange","click","binary","ngModel","ngModelOptions"],[1,"flex","flex-column","gap-3","p-2"],["class","flex flex-column gap-3",4,"ngIf"],[1,"flex","flex-column","gap-3"],[1,"flex","align-items-center","justify-content-between","px-1"],[1,"text-sm","text-500","font-medium"],["label","Clear all","styleClass","p-button-text p-button-sm text-blue-600 font-bold p-0 hover:underline",3,"onClick"],["label","Done","styleClass","w-full py-2.5 font-bold bg-gray-900 border-gray-900 hover:bg-gray-800 text-white border-round-md",1,"w-full",3,"onClick"],[1,"px-1"],["pButton","","type","button","label","Delete","icon","pi pi-trash",1,"w-full","p-button-danger","border-round-md","py-2.5","font-bold","flex","justify-content-center","gap-2",3,"click","disabled"]],template:function(r,i){1&r&&(e.j41(0,"div",0)(1,"label",1),e.EFF(2,"Tags"),e.k0s(),e.j41(3,"div",2),e.DNE(4,Hm,1,2,"p-chip",3),e.j41(5,"button",4),e.bIt("click",function(){return i.showTagDialog=!0}),e.k0s()(),e.j41(6,"small",5),e.EFF(7,"Help others find your deal by adding relevant categories."),e.k0s()(),e.j41(8,"p-drawer",6),e.mxI("visibleChange",function(o){return e.DH7(i.showTagDialog,o)||(i.showTagDialog=o),o}),e.DNE(9,Jm,5,3,"ng-template",7),e.j41(10,"div",8)(11,"div",9)(12,"span",10)(13,"input",11),e.mxI("ngModelChange",function(o){return e.DH7(i.searchText,o)||(i.searchText=o),o}),e.k0s()(),e.DNE(14,Km,1,0,"button",12),e.k0s(),e.DNE(15,Qm,4,4,"div",13),e.j41(16,"div",14),e.DNE(17,t1,3,2,"div",15),e.k0s()(),e.DNE(18,i1,3,2,"ng-template",16),e.k0s()),2&r&&(e.R7$(4),e.Y8G("ngForOf",i.selectedTags),e.R7$(4),e.Aen(e.lJ4(11,Wm)),e.R50("visible",i.showTagDialog),e.Y8G("modal",!0),e.R7$(5),e.Y8G("placeholder",i.isManageMode?"Search tags to delete...":"Search or create a new tag..."),e.R50("ngModel",i.searchText),e.Y8G("ngModelOptions",e.lJ4(12,Qa)),e.R7$(),e.Y8G("ngIf",!i.isManageMode&&i.searchText&&!i.isExactMatch),e.R7$(),e.Y8G("ngIf",i.isManageMode),e.R7$(2),e.Y8G("ngForOf",i.filteredTags))},dependencies:[q.Sq,q.bT,be.Ei,xe._f,xe.$n,L.me,L.BC,L.vS,Ve._s,Qe.Sm,qa.vu,Xr.Sc],styles:[".custom-tag-drawer .p-drawer-content{padding:0!important} .custom-tag-drawer .p-drawer-footer{padding:6px!important;border-bottom:1px solid #ccc} .custom-tag-drawer .p-drawer-header{padding:0!important;border-bottom:1px solid #ccc}.dotted-btn[_ngcontent-%COMP%]{border:1px dashed #cbd5e1!important;border-radius:20px!important;background:transparent!important;font-size:.8rem!important}.dotted-btn[_ngcontent-%COMP%]:hover{background:#f8fafc!important;border-color:#94a3b8!important}.tag-row[_ngcontent-%COMP%] .delete-btn[_ngcontent-%COMP%]{opacity:0;visibility:hidden;transition:opacity .15s ease-in-out,visibility .15s ease-in-out}.tag-row[_ngcontent-%COMP%]:hover .delete-btn[_ngcontent-%COMP%]{opacity:1;visibility:visible} .p-checkbox .p-checkbox-box{border-radius:6px!important;border-color:#cbd5e1!important}"]})}return n})();var a1=ee(43088),ea=ee(58398),oi=ee(77334),Bl=ee(45114);const s1=()=>({width:"420px"});function o1(n,a){1&n&&(e.j41(0,"div",15),e.nrm(1,"i",16),e.j41(2,"span",17),e.EFF(3,"Add Contact"),e.k0s()())}function l1(n,a){1&n&&(e.j41(0,"div",18),e.nrm(1,"p-message",19),e.k0s())}function c1(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",20)(1,"p-button",21),e.bIt("onClick",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.displayAddDialog=!1)}),e.k0s(),e.j41(2,"p-button",22),e.bIt("onClick",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.saveContact())}),e.k0s()()}if(2&n){const t=e.XpG();e.R7$(),e.Y8G("text",!0)("disabled",t.isSaving),e.R7$(),e.Y8G("disabled",t.contactForm.invali
1d)("loading",t.isSaving)}}let qs=(()=>{class n{fb;messageService;contactService;teamService;contactForm;titleOptions=[];isSaving=!1;displayAddDialog=!1;selectedContact=null;contactSaved=new e.bkB;cardId;currentTeamId;showContactMethodError=!1;constructor(t,r,i,s){this.fb=t,this.messageService=r,this.contactService=i,this.teamService=s}ngOnInit(){const t=this.teamService.getCurrentTeam;this.currentTeamId=t?.Team?.Id,this.contactForm=this.fb.group({firstName:["",L.k0.required],lastName:["",L.k0.required],company:[""],role:[""],email:[""],website:[""],phoneNumber:[""],companyName:[""],teamId:[""]}),this.loadDropdowns()}ngOnChanges(){if(this.selectedContact){const t=this.mapContactToForm(this.selectedContact);this.contactForm.patchValue(t)}}mapContactToForm(t){return{firstName:t.firstName||"",lastName:t.lastName||"",company:t.company||"",role:t.role||"",email:t.email||"",website:t.website||"",phoneNumber:t.phoneNumber||"",companyName:t.companyName||"",teamId:this.currentTeamId}}loadDropdowns(){this.contactService.getTitleDropdown().subscribe({next:t=>{this.titleOptions=t},error:t=>{console.error("Error loading titles:",t)}})}saveContact(){if(!this.contactForm.value.email&&!this.contactForm.value.phoneNumber)return void(this.showContactMethodError=!0);if(this.showContactMethodError=!1,this.contactForm.invalid)return;this.isSaving=!0;const t=this.contactForm.value;if(this.selectedContact?.id){const r={...t,id:this.selectedContact.id,source:3,teamId:this.currentTeamId||0};this.contactService.update(r).subscribe({next:i=>{this.contactSaved.emit(i),this.resetForm()},error:i=>{console.error("Update failed:",i),this.isSaving=!1}})}else if(this.cardId){const r={...t,teamId:this.currentTeamId||0,source:3};this.contactService.createAndLinkContact(this.cardId,r).subscribe({next:i=>{this.contactSaved.emit(i),this.resetForm()}})}else{const r={...t,teamId:this.currentTeamId||0,source:3};this.contactService.create(r).subscribe({next:i=>{this.contactSaved.emit(i),this.resetForm()},error:i=>{console.error("Creation failed:",i),this.isSaving=!1}})}}resetForm(){this.contactForm.reset(),this.displayAddDialog=!1,this.isSaving=!1}formatDate(t){return t?new Date(t).toISOString().split("T")[0]:""}open(){this.displayAddDialog=!0}close(){this.displayAddDialog=!1}static \u0275fac=function(r){return new(r||n)(e.rXU(L.ok),e.rXU(be.bg),e.rXU(Ka.u),e.rXU(rt.n))};static \u0275cmp=e.VBU({type:n,selectors:[["app-create-contacts"]],inputs:{selectedContact:"selectedContact",cardId:"cardId"},outputs:{contactSaved:"contactSaved"},standalone:!1,features:[e.OA$],decls:35,vars:7,consts:[["position","right","styleClass","p-sidebar-md",3,"visibleChange","onHide","visible","modal"],["pTemplate","header"],[1,"py-2"],[3,"formGroup"],[1,"flex","flex-column","gap-3"],[1,"block","mb-1","font-medium","text-xs","uppercase","text-600"],["pInputText","","formControlName","firstName","placeholder","First name",1,"custom-input","w-full"],["pInputText","","formControlName","lastName","placeholder","Last name",1,"custom-input","w-full"],["pInputText","","formControlName","email","placeholder","[email protected]",1,"custom-input","w-full"],["pInputText","","formControlName","phoneNumber","placeholder","Phone number",1,"custom-input","w-full"],["class","mt-2",4,"ngIf"],["pInputText","","formControlName","companyName","placeholder","Company name",1,"custom-input","w-full"],["pInputText","","formControlName","role","placeholder","e.g. CEO",1,"custom-input","w-full"],["pInputText","","formControlName","website","placeholder","company.com",1,"custom-input","w-full"],["pTemplate","footer"],[1,"flex","align-items-center","gap-2"],[1,"pi","pi-user","text-primary","text-xl"],[1,"text-xl","font-bold"],[1,"mt-2"],["severity","error","text","Please provide either an email or a phone number."],[1,"flex","justify-content-end","gap-2"],["label","Cancel","severity","secondary",3,"onClick","text","disabled"],["label","Add Contact","icon","pi pi-plus",3,"onClick","disabled","loading"]],template:function(r,i){1&r&&(e.j41(0,"p-drawer",0),e.mxI("visibleChange",function(o){return e.DH7(i.displayAddDialog,o)||(i.displayAddDialog=o),o}),e.bIt("onHide",function(){return i.contactForm.reset()}),e.DNE(1,o1,4,0,"ng-template",1),e.j41(2,"div",2)(3,"form",3)(4,"div",4)(5,"div")(6,"label",5),e.EFF(7,"First Name *"),e.k0s(),e.nrm(8,"input",6),e.k0s(),e.j41(9,"div")(10,"label",5),e.EFF(11,"Surname *"),e.k0s(),e.nrm(12,"input",7),e.k0s(),e.j41(13,"div")(14,"label",5),e.EFF(15,"Email"),e.k0s(),e.nrm(16,"input",8),e.k0s(),e.j41(17,"div")(18,"label",5),e.EFF(19,"Phone Number"),e.k0s(),e.nrm(20,"input",9),e.k0s(),e.DNE(21,l1,2,0,"div",10),e.j41(22,"div")(23,"label",5),e.EFF(24,"Company"),e.k0s(),e.nrm(25,"input",11),e.k0s(),e.j41(26,"div")(27,"label",5),e.EFF(28,"Role"),e.k0s(),e.nrm(29,"input",12),e.k0s(),e.j41(30,"div")(31,"label",5),e.EFF(32,"Website"),e.k0s(),e.nrm(33,"input",13),e.k0s()()()(),e.DNE(34,c1,3,4,"ng-template",14),e.k0s()),2&r&&(e.Aen(e.lJ4(6,s1)),e.R50("visible",i.displayAddDialog),e.Y8G("modal",!0),e.R7$(3),e.Y8G("formGroup",i.contactForm),e.R7$(18),e.Y8G("ngIf",i.showContactMethodError))},dependencies:[q.bT,be.Ei,xe.$n,L.qT,L.me,L.BC,L.cb,Ve._s,Qe.Sm,L.j4,L.JD,Bl.QB],styles:[".p-drawer-footer{border-top:1px solid #cccc!important} .p-drawer-header{border-bottom:1px solid #cccc!important} .custom-input.p-dropdown{height:42px;display:flex;align-items:center}.custom-input.p-inputtext[_ngcontent-%COMP%]{height:42px} .custom-input .p-dropdown-label{line-height:normal;padding:.5rem .75rem}"]})}return n})();var es=ee(86627);const d1=["contactDrawer"],p1=()=>({width:"420px"});function u1(n,a){if(1&n&&(e.j41(0,"span",39),e.EFF(1),e.k0s()),2&n){const t=e.XpG().$implicit;e.R7$(),e.SpI(" ID: ",t.OrganizationId," ")}}function f1(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",27)(1,"div",28),e.nrm(2,"i",29),e.k0s(),e.j41(3,"div",30)(4,"div",31)(5,"div",32)(6,"span",33),e.EFF(7),e.k0s(),e.j41(8,"span",34),e.EFF(9),e.k0s()(),e.DNE(10,u1,2,1,"span",35),e.k0s()(),e.j41(11,"div",36)(12,"i",37),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG(2);return e.Njj(s.editContact(i.Id))}),e.k0s(),e.j41(13,"i",38),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG(2);return e.Njj(s.deleteContactLink(i.Id))}),e.k0s()()()}if(2&n){const t=a.$implicit;e.R7$(7),e.E5c(" ",t.TitleString&&"None"!==t.TitleString?t.TitleString+" ":""," ",t.FirstName," ",t.LastName," "),e.R7$(2),e.JRh(t.Role||"No Role Assigned"),e.R7$(),e.Y8G("ngIf",t.OrganizationId)}}function m1(n,a){if(1&n&&(e.j41(0,"div",25),e.DNE(1,f1,14,5,"div",26),e.k0s()),2&n){const t=e.XpG();e.R7$(),e.Y8G("ngForOf",t.Cardcontacts)}}function h1(n,a){1&n&&(e.j41(0,"div",40),e.EFF(1,"Select Contact"),e.k0s())}function g1(n,a){if(1&n&&(e.j41(0,"div",41),e.EFF(1),e.k0s()),2&n){const t=e.XpG();e.R7$(),e.E5c(" Showing ",t.currentFirst+1," - ",t.currentFirst+t.contacts.length," of ",t.totalRecords," contacts\n")}
1}function _1(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",42),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG();return s.onContactSelect(i.id),e.Njj(s.showSelectContactDrawer=!1)}),e.nrm(1,"i",43),e.j41(2,"span",44),e.EFF(3),e.k0s()()}if(2&n){const t=a.$implicit;e.R7$(3),e.Lme(" ",t.firstName," ",t.lastName," ")}}function x1(n,a){1&n&&(e.j41(0,"div",45),e.EFF(1," No contacts found\n"),e.k0s())}function v1(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",46)(1,"button",47),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.sdS(16).open(),e.Njj(i.showSelectContactDrawer=!1)}),e.k0s()()}}let Js=(()=>{class n{messageService;teamService;contactService;_boardService;contactDrawer;teamId=null;selectedCard;Cardcontacts=[];contacts=[];selectedContactId=null;showSelectContactDrawer=!1;searchTerm="";searchTimeout;currentFirst=0;rows=12;loading=!1;hasMore=!0;totalRecords;editingContact=null;activeTab="My Contacts";constructor(t,r,i,s){this.messageService=t,this.teamService=r,this.contactService=i,this._boardService=s,this.teamId=this.teamService.getCurrentTeam.Team.Id}ngOnInit(){this.selectedCard&&this.loadLinkedContacts()}loadContacts(t){this.loading=!0,t&&(this.currentFirst=t.first,this.rows=t.rows),this.contactService.searchContacts({First:this.currentFirst,Rows:this.rows,GlobalFilter:this.searchTerm||"",Filters:{},SortField:"FirstName",SortOrder:1,TeamId:this.teamId,Types:"Deskflo Contacts"===this.activeTab?[3]:[1,2]}).subscribe({next:s=>{this.contacts=s.Data||[],this.totalRecords=s.FilteredRecords||0,this.loading=!1},error:()=>{this.loading=!1}})}onFilterChange(){this.currentFirst=0,this.loadContacts()}onSearchChange(){clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.currentFirst=0,this.hasMore=!0,this.contacts=[],this.loadContacts()},400)}onContactSelect(t){t&&this._boardService.linkContactsToCard(this.selectedCard?.Id,[t]).subscribe({next:()=>{if(this.selectedContactId=null,!this.Cardcontacts.find(i=>i.Id===t)){const i=this.contacts.find(s=>s.id===t);i&&this.Cardcontacts.push({Id:i.id,FirstName:i.firstName,LastName:i.lastName,Title:i.title??0,TitleString:i.titleString??"",Role:i.role??"",Website:i.website,OrganizationId:i.organizationId,Email:i.email,Description:i.description,DateCreatedUtc:i.dateCreatedUtc,CreatedByUserId:i.createdByUserId,PhoneNumber:i.phoneNumber,TeamId:i.teamId,TrackName:i.trackName,TrackColor:i.trackColor})}},error:r=>console.error("Error linking contact",r)})}loadLinkedContacts(){this._boardService.getLinkedContacts(this.selectedCard?.Id).subscribe({next:t=>this.Cardcontacts=t,error:t=>console.error("Error fetching contacts",t)})}deleteContactLink(t){this._boardService.removeLinkedContacts(this.selectedCard?.Id,[t]).subscribe({next:()=>{this.Cardcontacts=this.Cardcontacts.filter(r=>r.Id!==t)},error:r=>console.error("Error removing contact link",r)})}openSelectContact(){this.showSelectContactDrawer=!0,this.loadContacts()}onContactSaved(t){this.contacts=[...this.contacts,t],this.messageService.add({severity:"success",summary:"Success",detail:`${t.firstName} added successfully`}),this.loadLinkedContacts()}switchTab(t){this.activeTab=t,this.loadContacts()}editContact(t){t&&(this.selectedContactId=t,this.loading=!0,this.contactService.get(t).subscribe({next:r=>{r.title?.toString(),this.editingContact=r,this.loading=!1},error:()=>this.loading=!1})),this.contactDrawer.open()}static \u0275fac=function(r){return new(r||n)(e.rXU(be.bg),e.rXU(rt.n),e.rXU(Ka.u),e.rXU(_t.a))};static \u0275cmp=e.VBU({type:n,selectors:[["app-card-contacts"]],viewQuery:function(r,i){if(1&r&&e.GBs(d1,5),2&r){let s;e.mGM(s=e.lsd())&&(i.contactDrawer=s.first)}},inputs:{selectedCard:"selectedCard"},standalone:!1,decls:35,vars:19,consts:[["contactDrawer",""],[1,"flex","flex-column","gap-3","mt-4","px-2"],[1,"text-xs","font-normal","text-500","uppercase","tracking-wider","flex","align-items-center","gap-2","px-1","text-slate-500"],[1,"pi","pi-user","text-xs"],[1,"flex","border-1","border-300","border-round-lg","overflow-hidden"],[1,"flex-1","flex","align-items-center","justify-content-center","gap-2","py-2","cursor-pointer","bg-white","hover:bg-gray-50","border-right-1","border-300","transition-colors",3,"click"],[1,"pi","pi-user-plus","text-blue-500"],[1,"text-blue-500","font-medium","text-sm"],[1,"flex-1","flex","align-items-center","justify-content-center","gap-2","py-2","cursor-pointer","bg-white","hover:bg-gray-50","transition-colors",3,"click"],[1,"pi","pi-users","text-blue-500"],["class","flex flex-column gap-3 mt-2 px-2",4,"ngIf"],[3,"contactSaved","cardId","selectedContact"],["position","right","styleClass","contact-drawer",3,"visibleChange","visible","modal"],["pTemplate","header"],[1,"flex","gap-2","mb-1","p-2","bg-gray-50","border-bottom-1","surface-border"],[1,"p-input-icon-left","w-full"],["type","text","pInputText","","placeholder","Search contacts...",1,"w-full","border-none","surface-100","font-light","p-2",3,"ngModelChange","input","ngModel"],[1,"flex-1","p-2","border-none","border-round-lg","cursor-pointer","flex","align-items-center","justify-content-center","gap-2","transition-duration-200",3,"click","ngClass"],[1,"font-bold"],["class","px-3 py-1 text-sm text-gray-500",4,"ngIf"],[1,"contact-list-container"],["class","flex align-items-center gap-2 px-3 py-2 cursor-pointer hover:surface-100 border-round",3,"click",4,"ngFor","ngForOf"],["class","text-center text-sm text-gray-400 p-5",4,"ngIf"],["styleClass","p-paginator-sm",3,"onPageChange","first","rows","totalRecords"],["pTemplate","footer"],[1,"flex","flex-column","gap-3","mt-2","px-2"],["class","surface-overlay border-1 border-200 border-round-lg p-3 flex align-items-start shadow-1",4,"ngFor","ngForOf"],[1,"surface-overlay","border-1","border-200","border-round-lg","p-3","flex","align-items-start","shadow-1"],[1,"bg-blue-50","border-round-md","flex","align-items-center","justify-content-center","mr-3",2,"min-width","40px","height","40px"],[1,"pi","pi-user","text-blue-600","text-lg"],[1,"flex-grow-1"],[1,"flex","align-items-center","justify-content-between","mb-2"],[1,"flex","flex-column"],[1,"text-sm","font-bold","text-900"],[1,"text-xs","text-600","font-medium"],["class","text-xs bg-gray-100 text-600 px-2 py-1 border-round",4,"ngIf"],[1,"flex","flex-row","gap-1","ml-2"],[1,"pi","pi-pencil","cursor-pointer",3,"click"],[1,"pi","pi-trash","cursor-pointer",3,"click"],[1,"text-xs","bg-gray-100","text-600","px-2","py-1","border-round"],[1,"text-lg","font-semibold"],[1,"px-3","py-1","text-sm","text-gray-500"],[1,"flex","align-items-center","gap-2","px-3","py-2","cursor-pointer","hover:surface-100","border-round",3,"click"],[1,"pi","pi-user","text-blue-500"],[1,"text-sm"],[1,"text-center","text-sm","text-gray-400","p-5"],[1,"p-2"],["pButton","","type","button","label","Create Contact","icon","pi pi-plus",1,"w-full","p-button-sm",3,"click"]],template:function(r,i){if(1&r){const s=e.RV6();e.j41(0,"div",1)(1,"div",2),e.nrm(2,"i",3),e.j41(3,"span"),e.EFF(4,"Contact Details"),e.k0s()(),e.j41(5,"div",4)(6,"div",5),e.bIt("click",function(){e.eBV(s);const l=e.sdS(16);return e.Njj(l.open())}),e.nrm(7,"i",6),e.j41(8,"span",7),e.EFF(9,"Add contact"),e.k0s()(),e.j41(10,"div",8),e.bIt("click",function(){return e.eBV(s),e.Njj(i.openSelectContact())}),e.nrm(11,"i",9),e.j41(12,"span",7),e.EFF(13,"Select contact"),e.k0s()()()(),e.DNE(14,m1,2,1,"div",10),e.j41(15,"app-create-contacts",11,0),e.bIt("contactSaved",function(l){return e.eBV(s),e.Njj(i.onContactSaved(l))}),e.k0s(),e.j41(17,"p-drawer",12),e.mxI("visibleChange",function(l){return e.eBV(s),e.DH7(i.showSelectContactDrawer,l)||(i.showSelectContactDrawer=l),e.Njj(l)}),e.DNE(18,h1,2,0,"ng-template",13),e.j41(19,"div",14)(20,"span",15)(21,"input",16),e.mxI("ngModelChange",function(l){return e.eBV(s),e.DH7(i.searchTerm,l)||(i.searchTerm=l),e.Njj(l)}),e.bIt("input",function(){return e.eBV(s),e.Njj(i.onSearchChange())}),e.k0s()()(),e.j41(22,"div",14)(23,"button",17),e.bIt("click",function(){return e.eBV(s),e.Njj(i.switchTab("My Contacts"))}),e.j41(24,"span",18),e.EFF(25,"My Contacts "),e.k0s()(),e.j41(26,"button",17),e.bIt("click",function(){return e.eBV(s),e.Njj(i.switchTab("Deskflo Contacts"))}),e.j41(27,"span",18),e.EFF(28,"Deskflo Contacts"),e.k0s()()(),e.DNE(29,g1,2,3,"div",19),e.j41(30,"div",20),e.DNE(31,_1,4,2,"div",21),e.k0s(),e.DNE(32,x1,2,0,"div",22),e.j41(33,"p-paginator",23),e.bIt("onPageChange",function(l){return e.eBV(s),e.Njj(i.loadContacts(l))}),e.k0s(),e.DNE(34,v1,2,0,"ng-template",24),e.k0s()}2&r&&(e.R7$(14),e.Y8G("ngIf",(null==i.Cardcontacts?null:i.Cardcontacts.length)>=0),e.R7$(),e.Y8G("cardId",null==i.selectedCard?null:i.selectedCard.Id)("selectedContact",i.editingContact),e.R7$(2),e.Aen(e.lJ4(18,p1)),e.R50("visible",i.showSelectContactDrawer),e.Y8G("modal",!0),e.R7$(4),e.R50("ngModel",i.searchTerm),e.R7$(2),e.Y8G("ngClass","My Contacts"===i.activeTab?"bg-blue-600 text-white shadow-2":"surface-0 text-700"),e.R7$(3),e.Y8G("ngClass","Deskflo Contacts"===i.activeTab?"bg-blue-600 text-white shadow-2":"surface-0 text-700"),e.R7$(3),e.Y8G("ngIf",i.contacts.length),e.R7$(),e.xc7("opacity",i.loading?"0.5":"1"),e.R7$(),e.Y8G("ngForOf",i.contacts),e.R7$(),e.Y8G("ngIf",!i.contacts.length&&!i.loading),e.R7$(),e.Y8G("first",i.currentFirst)("rows",i.rows)("totalRecords",i.totalRecords))}
1,dependencies:[q.YU,q.Sq,q.bT,be.Ei,Qe.Sm,L.me,L.BC,L.vS,xe._f,Ve._s,qs,es.mg],styles:[".contact-drawer .p-drawer-content{padding:0!important}"]})}return n})();const b1=()=>({width:"420px"}),C1=()=>({standalone:!0}),k1=()=>({width:"28px",height:"28px"}),T1=(n,a)=>({"align-self-end flex-row-reverse":n,"align-self-start":a}),Ll=n=>({"text-right":n}),w1=()=>({height:"150px"});function y1(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",10)(1,"div",11)(2,"div",12)(3,"p",13),e.EFF(4," Lead automatically generated from Messenger conversation "),e.k0s()(),e.j41(5,"div",14)(6,"i",15),e.bIt("click",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.handleConfirmation(i,s.ConfirmationActionType.Delete))}),e.k0s(),e.j41(7,"i",16),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.destroyComponent())}),e.k0s()()(),e.j41(8,"div",17)(9,"div",18),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.selectTab("Chat"))}),e.nrm(10,"i",19),e.j41(11,"span",20),e.EFF(12,"Thread Messages"),e.k0s()(),e.j41(13,"div",18),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.selectTab("description"))}),e.nrm(14,"i",21),e.j41(15,"span",22),e.EFF(16,"Description"),e.k0s()(),e.j41(17,"div",18),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.selectTab("attachments"))}),e.nrm(18,"i",23),e.j41(19,"span",22),e.EFF(20,"Attachments"),e.k0s()()()()}if(2&n){const t=e.XpG();e.R7$(9),e.Y8G("ngClass","Chat"===t.activeTab?"bg-white text-gray-800":"text-gray-500 hover:bg-white-alpha-50"),e.R7$(),e.Y8G("ngClass","Chat"===t.activeTab?"text-gray-700":"text-gray-400"),e.R7$(3),e.Y8G("ngClass","description"===t.activeTab?"bg-white shadow-1 text-gray-800":"text-gray-500 hover:bg-white-alpha-50"),e.R7$(),e.Y8G("ngClass","description"===t.activeTab?"text-gray-700":"text-gray-400"),e.R7$(3),e.Y8G("ngClass","attachments"===t.activeTab?"bg-white shadow-1 text-gray-800":"text-gray-500 hover:bg-white-alpha-50"),e.R7$(),e.Y8G("ngClass","attachments"===t.activeTab?"text-gray-700":"text-gray-400")}}function F1(n,a){if(1&n&&(e.j41(0,"span",46),e.EFF(1),e.k0s()),2&n){const t=e.XpG(2).$implicit;e.R7$(),e.SpI(" +",t.length-1," ")}}function S1(n,a){if(1&n&&(e.qex(0),e.j41(1,"span"),e.EFF(2),e.k0s(),e.DNE(3,F1,2,1,"span",45),e.bVm()),2&n){const t=e.XpG().$implicit;e.R7$(2),e.JRh(t[0].Name?t[0].Name:t[0]),e.R7$(),e.Y8G("ngIf",t.length>1)}}function E1(n,a){if(1&n&&(e.j41(0,"div",44),e.DNE(1,S1,4,2,"ng-container",8),e.k0s()),2&n){const t=a.$implicit;e.R7$(),e.Y8G("ngIf",t&&t.length>0)}}function I1(n,a){if(1&n&&(e.j41(0,"div",47),e.nrm(1,"p-avatar",48),e.j41(2,"span"),e.EFF(3),e.k0s()()),2&n){const t=a.$implicit,r=e.XpG(2);e.R7$(),e.Aen(e.lJ4(5,k1)),e.Y8G("image",t.PictureId?r.IMG_ROUTE+t.PictureId:null)("icon",t.PictureId?null:"pi pi-user"),e.R7$(2),e.JRh(t.Name)}}function D1(n,a){1&n&&(e.j41(0,"div",49),e.nrm(1,"p-progressSpinner",50),e.k0s())}function R1(n,a){if(1&n&&(e.j41(0,"div",53)(1,"div",54),e.nrm(2,"i",55),e.k0s(),e.j41(3,"span",56),e.EFF(4),e.k0s()()),2&n){const t=e.XpG(3);e.R7$(4),e.SpI(" ",t.getRemainingTimeText()," ")}}function j1(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",59)(1,"div",60)(2,"img",61,3),e.bIt("error",function(){e.eBV(t);const i=e.sdS(3),s=e.sdS(5);return i.style.display="none",e.Njj(s.style.display="block")}),e.k0s(),e.j41(4,"div",62,4),e.nrm(6,"p-avatar",63),e.k0s()(),e.j41(7,"div",64)(8,"span",65),e.EFF(9),e.k0s(),e.j41(10,"div",66),e.EFF(11),e.k0s(),e.j41(12,"span",67),e.EFF(13),e.nI1(14,"date"),e.k0s()()()}if(2&n){const t=a.$implicit,r=e.XpG(4);e.Y8G("ngClass",e.l_i(12,T1,r.isMe(t),r.isMe(t))),e.R7$(2),e.Y8G("src",null!=t.from&&t.from.id?"https://graph.facebook.com/"+t.from.id+"/picture?type=square&access_token="+r.activePageToken:"",e.B4B),e.R7$(4),e.Y8G("label",null!=t.from&&t.from.name?t.from.name[0].toUpperCase():"?"),e.R7$(2),e.Y8G("ngClass",e.eq3(15,Ll,r.isMe(t))),e.R7$(),e.SpI(" ",null==t.from?null:t.from.name," "),e.R7$(),e.Y8G("ngClass",r.isMe(t)?"bg-blue-600 text-white border-round-2xl":"bg-white text-900 border-round-2xl border-1 border-gray-100"),e.R7$(),e.SpI(" ",t.message," "),e.R7$(),e.Y8G("ngClass",e.eq3(17,Ll,r.isMe(t))),e.R7$(),e.SpI(" ",e.i5U(14,9,t.created_time,"shortTime")," ")}}function A1(n,a){if(1&n&&(e.qex(0),e.j41(1,"div",57),e.DNE(2,j1,15,19,"div",58),e.k0s(),e.bVm()),2&n){const t=e.XpG(3);e.R7$(2),e.Y8G("ngForOf",t.messages)}}function M1(n,a){1&n&&(e.j41(0,"div",68)(1,"div",69),e.nrm(2,"i",70),e.k0s(),e.j41(3,"h3",71),e.EFF(4,"Facebook Chat Unavailable"),e.k0s(),e.j41(5,"p",72),e.EFF(6," Conversations are only available when your Facebook page is connected. Please ensure your account is linked to view and send messages. "),e.k0s()())}function P1(n,a){if(1&n&&(e.qex(0),e.DNE(1,R1,5,1,"div",51)(2,A1,3,1,"ng-container",52)(3,M1,7,0,"ng-template",null,2,e.C5r),e.bVm()),2&n){const t=e.sdS(4),r=e.XpG(2);e.R7$(),e.Y8G("ngIf",r.messages&&r.messages.length>0),e.R7$(),e.Y8G("ngIf",r.messages&&r.messages.length>0)("ngIfElse",t)}}function O1(n,a){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"div",24)(2,"div",25)(3,"div",26)(4,"label",27),e.EFF(5," Assignee "),e.j41(6,"span",28),e.EFF(7,"*"),e.k0s()(),e.j41(8,"p-multiSelect",29),e.bIt("onChange",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.onAssigneeChange(i))}
1),e.DNE(9,E1,2,1,"ng-template",30)(10,I1,4,6,"ng-template",31),e.k0s()(),e.j41(11,"div",26)(12,"label",27),e.EFF(13," Amount "),e.k0s(),e.nrm(14,"input",32),e.k0s()(),e.j41(15,"div",25)(16,"div",26)(17,"label",27),e.EFF(18," Due Date"),e.k0s(),e.nrm(19,"p-datepicker",33),e.k0s(),e.j41(20,"div",26)(21,"label",27),e.EFF(22," Qualify"),e.k0s(),e.j41(23,"app-lead-qualifier",34),e.bIt("onComplete",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.handleQualification(i))}),e.k0s()()()(),e.nrm(24,"div",35),e.j41(25,"div",36)(26,"div",37,1),e.DNE(28,D1,2,0,"div",38)(29,P1,5,3,"ng-container",8),e.k0s(),e.j41(30,"div",39)(31,"div",40)(32,"input",41),e.mxI("ngModelChange",function(i){e.eBV(t);const s=e.XpG();return e.DH7(s.messageText,i)||(s.messageText=i),e.Njj(i)}),e.bIt("keyup.enter",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.sendMessage())}),e.k0s(),e.j41(33,"button",42),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.sendMessage())}),e.nrm(34,"i",43),e.k0s()()()(),e.bVm()}if(2&n){const t=e.XpG();e.R7$(8),e.Y8G("options",t.boardTeamMembers)("styleClass","w-full border-200 border-round-lg min-h-3rem flex align-items-center text-xs")("appendTo","body"),e.R7$(11),e.Y8G("showIcon",!0)("appendTo","body"),e.R7$(9),e.Y8G("ngIf",t.loadingMessages),e.R7$(),e.Y8G("ngIf",!t.loadingMessages),e.R7$(2),e.AVh("opacity-60",!t.messages||0===t.messages.length),e.R7$(),e.Y8G("disabled",!t.messages||0===t.messages.length||t.sendingMessage)("placeholder",t.messages&&t.messages.length>0?"Type your message...":"Chat disabled..."),e.R50("ngModel",t.messageText),e.Y8G("ngModelOptions",e.lJ4(14,C1)),e.R7$(),e.Y8G("disabled",!t.messages||0===t.messages.length||!t.messageText||t.sendingMessage)}}function N1(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",79),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.onEditDescription())}),e.nrm(1,"div",80)(2,"i",81),e.k0s()}if(2&n){let t;const r=e.XpG(2);e.R7$(),e.Y8G("innerHTML",(null==(t=r.formGroup.get("Description"))?null:t.value)||"<span class='text-400'>Click to add description</span>",e.npT)}}function G1(n,a){1&n&&(e.j41(0,"span",84),e.nrm(1,"button",85)(2,"button",86),e.k0s(),e.j41(3,"span",84),e.nrm(4,"button",87)(5,"button",88),e.k0s())}function B1(n,a){1&n&&(e.j41(0,"div",82)(1,"p-editor",83),e.DNE(2,G1,6,0,"ng-template",6),e.k0s()()),2&n&&(e.R7$(),e.Aen(e.lJ4(2,w1)))}function L1(n,a){if(1&n&&(e.qex(0),e.j41(1,"div",73)(2,"div",74),e.EFF(3,"Description"),e.k0s(),e.DNE(4,N1,3,1,"div",75)(5,B1,3,3,"div",76),e.nrm(6,"app-tags-drawer",77),e.k0s(),e.nrm(7,"app-card-contacts",78),e.bVm()),2&n){const t=e.XpG();e.R7$(4),e.Y8G("ngIf",!t.showDescriptionEditor),e.R7$(),e.Y8G("ngIf",t.showDescriptionEditor),e.R7$(),e.Y8G("selectedCard",t.selectedCard)("formGroup",t.formGroup),e.R7$(),e.Y8G("selectedCard",t.selectedCard)}}function $1(n,a){1&n&&(e.j41(0,"div",108),e.nrm(1,"i",109),e.k0s())}function V1(n,a){if(1&n&&(e.j41(0,"div"),e.nrm(1,"i"),e.k0s()),2&n){const t=e.XpG().$implicit,r=e.XpG(3);e.HbH(r.getFileIconContainerClass(t.contentType)),e.R7$(),e.HbH(r.getFileIcon(t.contentType))}}function U1(n,a){1&n&&(e.j41(0,"span"),e.EFF(1,"\u2022 Uploading..."),e.k0s())}function X1(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",98)(1,"div",99),e.DNE(2,$1,2,0,"div",100)(3,V1,2,4,"div",101),e.j41(4,"div",102)(5,"span",103),e.EFF(6),e.k0s(),e.j41(7,"small",104),e.EFF(8),e.DNE(9,U1,2,0,"span",8),e.k0s()()(),e.j41(10,"div",105)(11,"button",106),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG(3);return e.Njj(s.downloadFile(i))}),e.k0s(),e.j41(12,"button",107),e.bIt("click",function(){const i=e.eBV(t).index,s=e.XpG(3);return e.Njj(s.removeFile(i))}),e.k0s()()()}if(2&n){const t=a.$implicit;e.R7$(2),e.Y8G("ngIf",t.loading),e.R7$(),e.Y8G("ngIf",!t.loading),e.R7$(3),e.Lme("",t.name,".",t.contentType,""),e.R7$(2),e.SpI(" ",t.size," "),e.R7$(),e.Y8G("ngIf",t.loading),e.R7$(2),e.Y8G("loading",t.loading),e.R7$(),e.Y8G("disabled",t.loading)}}function Y1(n,a){if(1&n&&(e.j41(0,"div",95)(1,"span",96),e.EFF(2),e.k0s(),e.DNE(3,X1,13,8,"div",97),e.k0s()),2&n){const t=e.XpG(2);e.R7$(2),e.SpI(" ",t.uploadedFiles.length," File(s) attached "),e.R7$(),e.Y8G("ngForOf",t.uploadedFiles)}}function W1(n,a){1&n&&(e.j41(0,"div",110),e.nrm(1,"i",111),e.j41(2,"p",112),e.EFF(3,"No files attached to this deal yet."),e.k0s()())}function H1(n,a){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"div",89)(2,"div",90)(3,"span",91),e.EFF(4,"Attachments"),e.k0s(),e.j41(5,"p-fileUpload",92),e.bIt("uploadHandler",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.uploadFile(i))}),e.k0s()(),e.DNE(6,Y1,4,2,"div",93)(7,W1,4,0,"div",94),e.k0s(),e.bVm()}if(2&n){const t=e.XpG();e.R7$(5),e.Y8G("customUpload",!0)("auto",!0),e.R7$(),e.Y8G("ngIf",t.uploadedFiles.length>0),e.R7$(),e.Y8G("ngIf",0===t.uploadedFiles.length)}}function z1(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",113)(1,"button",114),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.destroyComponent())}),e.k0s(),e.j41(2,"button",115),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.submitData())}),e.k0s()()}}let q1=(()=>{class n{fbService;integrationService;teamService;teamsService;messageService;_boardService;content;selectedCard;showDialog=!1;close=new e.bkB;handleConfirmation;submitClicked=new e.bkB;formGroup;boardTeamMembers;IMG_ROUTE=`${Xt.c.apiUrl}/api/storage/image/`;ConfirmationActionType=J.ON;activePageToken;activePageId;messageText="";messages=[];loadingMessages=!1;loadingThreads=!1;threads=[];teamId;isEditingNotes=!1;uploadedFiles=[];featureKey="sales_tracker";fileIds=[];activeTab="Chat";showDescriptionEditor=!1;sendingMessage=!1;constructor(t,r,i,s,o,l,c){this.fbService=t,this.integrationService=r,this.teamService=i,this.teamsService=s,this.messageService=o,this._boardService=l,this.content=c}ngOnInit(){var t=this;return(0,nt.A)(function*(){const r=t.teamsService.getCurrentTeam;if(!r||!r.Team)return;t.teamId=r.Team.Id;const i=t.integrationService.getSelectedPage();i&&(t.activePageId=i.PageId,t.activePageToken=i.Token,t.selectedCard?.MessengerThreadId&&t.selectThread()),t.formGroup.patchValue({Title:t.selectedCard?.Title,DueDateUtc:t.formatDate(t.selectedCard.DueDateUtc)});const s=t.formGroup.get("AttachmentFile")?.value??"";t.fileIds=s?s.split(","):[],t.fileIds&&t.fileIds.forEach(o=>{t.loadFileById(o)})})()}getTagTextColor(t){return(0,at.Lr)(t)}isMe(t){return t.from?.id===this.activePageId||"You"===t.from?.name}selectThread(){var t=this;return(0,nt.A)(function*(){t.loadingMessages=!0;try{const r=yield t.fbService.getThreadMessages(t.selectedCard.MessengerThreadId,t.activePageToken);t.messages=r?r.slice(-20):[]}catch(r){console.error("Failed to load messages:",r),t.messages=[],t.messageService.add({severity:"error",summary:"Error",detail:"Could not load chat history.",life:3e3})}finally{t.loadingMessages=!1}})()}sendMessage(){var t=this;return(0,nt.A)(function*(){if(!t.messageText.trim()||t.sendingMessage)return;if(!t.isWithin24Hours())return void t.messageService.add({severity:"warn",summary:"Messaging Window Closed",detail
1:"The 24-hour reply window has expired. You cannot respond to this user.",life:4e3});const r=t.getRecipientId();if(r){t.sendingMessage=!0;try{yield t.fbService.sendMessage(r,t.messageText,t.activePageToken),t.messages.push({message:t.messageText,from:{id:t.activePageId,name:"Nkhensani Faith MTileni"},created_time:(new Date).toISOString()}),t.messageText=""}catch(i){t.messageService.add({severity:"error",summary:"Message Failed",detail:"Something went wrong while sending the message.",life:4e3}),console.error(i)}finally{t.sendingMessage=!1}}else t.messageService.add({severity:"error",summary:"Error",detail:"Could not find a valid recipient for this conversation.",life:4e3})})()}getRecipientId(){if(!this.messages||0===this.messages.length)return null;const t=this.messages.find(r=>r.from?.id!==this.activePageId);return t?t.from.id:null}isWithin24Hours(){if(!this.messages||0===this.messages.length)return!1;const t=this.messages.filter(l=>l.from?.id!==this.activePageId&&l.created_time);if(0===t.length)return!1;const i=new Date(t[t.length-1].created_time).getTime();return((new Date).getTime()-i)/36e5<=24}selectTab(t){this.activeTab=t}destroyComponent(){this.close.emit()}getTagColor(t){return(0,at.yC)(t)}submitData(){this.submitClicked.emit()}formatDate(t){return t?new Date(t).toISOString().substring(0,10):null}openLeadDetails(t){this.selectedCard=t,this.showDialog=!0,this.isEditingNotes=!1,this.formGroup.patchValue({Description:t.Description})}onAssigneeChange(t){const i=(t.value||[]).map(s=>{const o=this.boardTeamMembers.find(l=>l.Name===s);return o?o.Id:null}).filter(s=>null!==s);this.formGroup.get("AssignedUserIds")?.setValue(i)}uploadFile(t){const r=t.currentFiles||t.files;r&&r.filter(s=>!this.uploadedFiles.some(o=>o.name===s.name&&o.size===s.size)).forEach(s=>{const o={name:s.name,size:s.size,id:"",loading:!0};this.uploadedFiles.push(o),this._boardService.postImage(s,this.featureKey,this.teamService.getCurrentTeam.Team.Id).subscribe({next:l=>{o.id=l.PublicId,o.loading=!1,this.fileIds.push(l.PublicId),this.updateFormControl()},error:l=>{console.error("Upload failed",l),o.loading=!1,this.uploadedFiles=this.uploadedFiles.filter(c=>c!==o)}})})}updateFormControl(){const t=this.fileIds.join(",");this.formGroup.get("AttachmentFile")?.setValue(t)}getFileIcon(t){return"pdf"===t?"pi pi-file-pdf text-red-500":"xlsx"===t||"xls"===t?"pi pi-file-excel text-green-500":["jpg","jpeg","png"].includes(t)?"pi pi-image text-blue-500":"pi pi-file text-gray-500"}getFileIconContainerClass(t){let r="p-2 border-round-md ";return"pdf"===t?r+"bg-red-50":"xlsx"===t||"xls"===t||"csv"===t?r+"bg-green-50":["jpg","jpeg","png"].includes(t)?r+"bg-blue-50":r+"bg-gray-50"}removeFile(t){this.fileIds.splice(t,1),this.uploadedFiles.splice(t,1),this.updateFormControl()}downloadFile(t){t.loading=!0,this.content.downloadFile(t.id).subscribe({next:r=>{at.Wp.saveFile(r,t.name),t.loading=!1},error:r=>{t.loading=!1,402!==r.status&&this.messageService.add({severity:"error",summary:"Download Failed",detail:"Unable to retrieve file."})}})}onEditDescription(){this.showDescriptionEditor=!0}saveDescription(){this.showDescriptionEditor=!1}loadFileById(t){this.content.getFileByPublicId(t).subscribe({next:r=>{console.log(r),this.uploadedFiles.push({name:r.name,contentType:r.contentType}),this.formGroup.get("AttachmentFile")?.setValue(r.publicId)},error:r=>console.error(r)})}handleQualification(t){this.formGroup.patchValue({priority:t.priorityValue})}getRemainingTimeText(){if(!this.messages||0===this.messages.length)return"Window closed";const t=this.messages.filter(u=>u.from?.id!==this.activePageId&&u.created_time);if(0===t.length)return"Window closed";const i=new Date(t[t.length-1].created_time).getTime(),c=864e5-((new Date).getTime()-i);return c<=0?"Messenger 24-hour window: Expired. You cannot reply until the customer writes back.":`Messenger 24-hour window: You have ${Math.floor(c/36e5)}h ${Math.floor(c%36e5/6e4)}m left to reply. After that, messages cannot be sent until the customer writes back.`}static \u0275fac=function(r){return new(r||n)(e.rXU(ea.o),e.rXU(oi.a),e.rXU(rt.n),e.rXU(rt.n),e.rXU(be.bg),e.rXU(_t.a),e.rXU(Zi.f))};static \u0275cmp=e.VBU({type:n,selectors:[["app-edit-messenger-deal"]],inputs:{selectedCard:"selectedCard",showDialog:"showDialog",handleConfirmation:"handleConfirmation",formGroup:"formGroup",boardTeamMembers:"boardTeamMembers"},outputs:{close:"close",submitClicked:"submitClicked"},standalone:!1,decls:8,vars:10,consts:[["eventSideBar",""],["chatContainer",""],["disconnectedState",""],["avatarImg",""],["fallbackContainer",""],["position","right","styleClass","custom-edit-messenger",3,"visibleChange","onHide","visible","baseZIndex","showCloseIcon"],["pTemplate","header"],[1,"h-full","flex","flex-column",3,"formGroup"],[4,"ngIf"],["pTemplate","footer"],[1,"flex","flex-column","w-full"],[1,"flex","justify-content-between","align-items-center","mb-1"],[1,"flex","align-items-center","gap-2"],[1,"m-0","text-xs","text-500","font-medium"],[1,"flex","gap-3","text-400"],[1,"pi","pi-trash","cursor-pointer","hover:text-red-500",3,"click"],[1,"pi","pi-times","cursor-pointer","hover:text-900",3,"click"],[1,"flex","align-items-center","bg-gray-50","border-1","border-gray-200","border-round-lg","p-1","gap-0","w-full","overflow-x-auto"],[1,"flex","align-items-center","gap-2","p-2","border-round-md","cursor-pointer","flex-grow-1","justify-content-center","transition-all",3,"click","ngClass"],[1,"pi","pi-envelope","text-xs",3,"ngClass"],[1,"text-xs","font-semibold"],[1,"pi","pi-comment","text-xs",3,"ngClass"],[1,"text-xs","font-medium"],[1,"pi","pi-paperclip","text-xs",3,"ngClass"],[1,"flex","flex-column","mt-2"],[1,"flex","w-full"],[1,"flex","flex-column","col-6","pb-0"],[1,"mb-1","text-500",2,"font-size","0.75rem"],[1,"text-red-500"],["formControlName","AssignedUsers","optionLabel","Name","optionValue","Name","placeholder","deal owner","filter","",3,"onChange","options","styleClass","appendTo"],["pTemplate","selectedItems"],["pTemplate","item"],["type","number","pInputText","","formControlName","Amount","placeholder","4500",1,"w-full","border-200","border-round-lg","p-2","text-xs"],["formControlName","DueDateUtc","dateFormat","yy/mm/dd","iconDisplay","input","placeholder","yy/mm/dd","styleClass","w-full","inputStyleClass","border-200 border-round-lg p-2 text-xs",3,"showIcon","appendTo"],[3,"onComplete"],[1,"border-top-1","border-200","my-2"],[1,"flex","flex-column","flex-grow-1","overflow-hidden","pt-2"],[1,"flex-grow-1","overflow-y-auto","p-2","flex","flex-column","gap-3",2,"background-color","#f6f6f8","position","relative"],["class","flex justify-content-center align-items-center h-full",4,"ngIf"],[1,"py-2","px-3","border-top-1","border-gray-100","bg-white"],[1,"flex","align-items-center","gap-2","px-3","py-2","bg-gray-50","border-1","border-gray-200","border-round-lg"],["type","text","pInputText","",1,"flex-grow-1","border-none","bg-transparent","shadow-none","focus:outline-none",3,"ngModelChange","keyup.enter","disabled","placeholder","ngModel","ngModelOptions"],["type","button",1,"p-button","p-button-rounded","p-button-sm","bg-blue-600","border-none",3,"click","disabled"],[1,"pi","pi-send"],[1,"flex","align-items-center","text-sm","truncate","w-full"],["class","ml-1 text-blue-500 font-bold",4,"ngIf"],[1,"ml-1","text-blue-500","font-bold"],[1,"flex","gap-2","align-items-center"],["shape","circle",3,"image","icon"],[1,"flex","justify-content-center","align-items-center","h-full"],["strokeWidth","4","styleClass","w-3rem h-3rem"],["class","sticky-banner flex align-items-center gap-3 p-2 border-round-xl \n bg-blue-50 border-1 border-blue-100",4,"ngIf"],[4,"ngIf","ngIfElse"],[1,"sticky-banner","flex","align-items-center","gap-3","p-2","border-round-xl","bg-blue-50","border-1","border-blue-100"],[1,"bg-blue-600","border-circle","w-1rem","h-1rem","flex","align-items-center","justify-content-center","flex-shrink-0"],[1,"pi","pi-info","text-white",2,"font-size","12px"],[1,"text-gray-800","font-medium",2,"font-size","0.75rem"],[1,"flex","flex-column","gap-3",2,"max-height","500px","overflow-y","auto"],["class","flex gap-2 max-w-70",3,"ngClass",4,"ngFor","ngForOf"],[1,"flex","gap-2","max-w-70",3,"ngClass"],[1,"flex","align-items-end","mb-1"],["alt","Profile Avatar",1,"w-2rem","h-2rem","border-circle","shadow-1",3,"error","src"],[2,"display","none"],["shape","circle","styleClass","w-2rem h-2rem bg-blue-100 text-blue-700 font-bold shadow-1 flex align-items-center justify-content-center",3,"label"],[1,"flex","flex-column","gap-1"],[1,"text-xs","text-600","font-semibold",3,"ngClass"],[1,"p-2","px-3","m-0","shadow-1","max-w-25rem","font-medium","line-height-3",2,"font-size","0.75rem",3,"ngClass"],[1,"text-400","mt-1",2,"font-size","0.6rem",3,"ngClass"],[1,"flex","flex-column","align-items-center","justify-content-center","h-full","text-center","p-4"],[1,"surface-0","border-circle","shadow-1","flex","align-items-center","justify-content-center","mb-3",2,"width","70px","height","70px"],[1,"pi","pi-facebook","text-blue-600",2,"font-size","2rem"],[1,"text-900","font-bold","mb-2"],[1,"text-600","line-height-3","m-0",2,"max-width","280px","font-size","0.9rem"],[1,"p-2"],[1,"font-bold","text-sm","mb-1"],["class","px-3 py-2 border-round border-1 border-gray-200 cursor-pointer flex justify-content-between align-items-start description-preview",3,"click",4,"ngIf"],["class","border-1 border-gray-300 border-round overflow-hidden",4,"ngIf"],[3,"selectedCard","formGroup"],[3,"selectedCard"],[1,"px-3","py-2","border-round","border-1","border-gray-200","cursor-pointer","flex","justify-content-between","align-items-start","description-preview",3,"click"],[1,"text-xs","text-600","flex-1",2,"min-height","50px","max-height","200px","overflow-y","auto","overflow-x","hidden","word-break","break-word",3,"innerHTML"],[1,"pi","pi-pencil","text-400","text-xs","ml-2"],[1,"border-1","border-gray-300","border-round","overflow-hidden"],["formControlName","Description","placeholder","Write your notes here...",1,"w-full"],[1,"ql-formats"],[1,"ql-bold"],[1,"ql-italic"],["value","ordered",1,"ql-list"],["value","bullet",1,"ql-list"],[1,"flex","flex-column","gap-4","mt-3","p-2"],[1,"flex","align-items-center","justify-content-between"],[1,"font-medium","text-sm","text-900"],["mode","basic","name","demo[]","chooseLabel","Add Files","chooseIcon","pi pi-plus","styleClass","p-button-sm p-button-outlined",3,"uploadHandler","customUpload","auto"],["class","flex flex-column gap-3",4,"ngIf"],["class","text-center p-4 border-2 border-dashed border-300 border-round-lg bg-gray-50",4,"ngIf"],[1,"flex","flex-column","gap-3"],[1,"text-xs","font-bold","text-500","uppercase","tracking-wider"],["class","flex align-items-center justify-content-between p-2 border-1 border-100 border-round-lg shadow-sm bg-white",4,"ngFor","ngForOf"],[1,"flex","align-items-center","justify-content-between","p-2","border-1","border-100","border-round-lg","shadow-sm","bg-white"],[1,"flex","align-items-center","gap-3"],["class","flex align-items-center justify-content-center bg-gray-100 border-round","style","width: 40px; height: 40px",4,"ngIf"],[3,"class",4,"ngIf"],[1,"flex","flex-column"],[1,"font-semibold","text-sm","text-900","line-height-2"],[1,"text-500"],[1,"flex","gap-2"],["pButton","","type","button","icon","pi pi-download","pTooltip","Download file","tooltipPosition","top",1,"p-button-text","p-button-secondary","p-button-rounded",3,"click","loading"],["pButton","","type","button","icon","pi pi-trash",1,"p-button-text","p-button-danger","p-button-rounded",3,"click","disabled"],[1,"flex","align-items-center","justify-content-center","bg-gray-100","border-round",2,"width","40px","height","40px"],[1,"pi","pi-spin","pi-spinner","text-blue-500"],[1,"text-center","p-4","border-2","border-dashed","border-300","border-round-lg","bg-gray-50"],[1,"pi","pi-cloud-upload","text-400","text-2xl","mb-2"],[1,"text-500","text-sm","m-0"],[1,"flex","justify-content-end","gap-2","w-full"],["pButton","","label","Cancel","icon","pi pi-times-circle",1,"p-button-text","p-button-secondary","text-700","font-bold",3,"click"],["pButton","","label","Update Lead","icon","pi pi-check-circle",1,"p-button-rounded","bg-blue-600","px-4","font-bold",3,"click"]],template:function(r,i){if(1&r){const s=e.RV6();e.j41(0,"p-drawer",5,0),e.mxI("visibleChange",function(l){return e.eBV(s),e.DH7(i.showDialog,l)||(i.showDialog=l),e.Njj(l)}),e.bIt("onHide",function(){return e.eBV(s),e.Njj(i.destroyComponent())}),e.DNE(2,y1,21,6,"ng-template",6),e.j41(3,"form",7),e.DNE(4,O1,35,15,"ng-container",8)(5,L1,8,5,"ng-container",8)(6,H1,8,4,"ng-container",8),e.k0s(),e.DNE(7,z1,3,0,"ng-template",9),e.k0s()}2&r&&(e.Aen(e.lJ4(9,b1)),e.R50("visible",i.showDialog),e.Y8G("baseZIndex",1200)("showCloseIcon",!1),e.R7$(3),e.Y8G("formGroup",i.formGroup),e.R7$(),e.Y8G("ngIf","Chat"===i.activeTab),e.R7$(),e.Y8G("ngIf","description"===i.activeTab),e.R7$(),e.Y8G("ngIf","attachments"===i.activeTab))},dependencies:[q.YU,q.Sq,q.bT,be.Ei,wt.m_,zn.eu,Qe.Sm,L.qT,L.me,L.Q0,L.BC,L.cb,L.vS,xe._f,Qi.KE,Ve._s,De.KF,L.j4,
1L.JD,Za,An.lr,ji.ef,Ai.pT,Js,Ja,q.vh],styles:[".info-card[_ngcontent-%COMP%]{display:flex;gap:12px;padding:16px;border:1px solid #e5e7eb;border-radius:10px;height:100%}.info-card[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:20px;color:#64748b}.label[_ngcontent-%COMP%]{font-size:11px;color:#6b7280}.value[_ngcontent-%COMP%]{font-weight:600}.status-pill[_ngcontent-%COMP%]{padding:4px 12px;border-radius:999px;font-size:12px}.status-active[_ngcontent-%COMP%]{background-color:#e6f7f2;color:#1abc9c} .custom-select-ui{padding:0!important;height:auto!important} .custom-select-ui .p-select-label{padding:0!important} .custom-select-ui.p-focus{box-shadow:none!important} .p-multiselect-display-chip .p-multiselect-label{padding:0!important}.custom-tabs[_ngcontent-%COMP%] .p-tab[_ngcontent-%COMP%]{font-size:.8rem!important;font-weight:400!important;font-family:Inter,sans-serif!important}.custom-tabs[_ngcontent-%COMP%] .p-tablist[_ngcontent-%COMP%]{border-top:1px solid #efebebcc;background:#f8fafc} .custom-edit-messenger .p-drawer-content{padding:4px!important} .custom-edit-messenger .p-drawer-footer{padding:12px!important;border-top:1px solid #cccc} .custom-edit-messenger .p-drawer-header{padding:12px!important;background-color:#f0f5fb!important;border-bottom:1px solid #cccc}"]})}return n})();var J1=ee(84909),K1=ee(15083),$l=ee(13864),Q1=ee(2578);class ts{static isApp="web"!==K1.Ii.getPlatform();static saveFile(a,t){return(0,nt.A)(function*(){try{ts.isApp?ts.writeAndOpenFile(a,t):(0,Q1.saveAs)(a,t)}catch(r){console.error(r)}})()}static writeAndOpenFile(a,t){return(0,nt.A)(function*(){var r=new FileReader;
1r.readAsDataURL(a),r.onloadend=(0,nt.A)(function*(){var i=r.result;try{const s=yield $l.YA.writeFile({path:t,data:i,directory:$l.__.Data,recursive:!0});(new J1.M).open(s.uri,a.type).then(()=>console.log("File is opened")).catch(l=>console.log("Error opening file",l)),console.log("Wrote file",s.uri)}catch(s){console.error("Unable to write file",s)}})})()}}const Z1=()=>({width:"420px"}),eh=()=>({width:"28px",height:"28px"}),th=()=>({height:"150px"});function nh(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",9)(1,"div",10)(2,"div",11)(3,"div",12)(4,"h2",13),e.EFF(5),e.k0s(),e.j41(6,"span",14),e.EFF(7,"Email-to-CRM lead"),e.k0s()()(),e.j41(8,"div",15)(9,"i",16),e.bIt("click",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.handleConfirmation(i,s.ConfirmationActionType.Delete))}),e.k0s(),e.j41(10,"i",17),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.destroyComponent())}),e.k0s()()(),e.j41(11,"div",18)(12,"div",19),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.selectTab("Email"))}),e.nrm(13,"i",20),e.j41(14,"span",21),e.EFF(15,"Email thread"),e.k0s()(),e.j41(16,"div",19),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.selectTab("description"))}),e.nrm(17,"i",22),e.j41(18,"span",23),e.EFF(19,"Description"),e.k0s()(),e.j41(20,"div",19),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.selectTab("attachments"))}),e.nrm(21,"i",24),e.j41(22,"span",23),e.EFF(23,"Attachments"),e.k0s()()()()}if(2&n){const t=e.XpG();e.R7$(5),e.JRh(t.selectedCard.Title),e.R7$(7),e.Y8G("ngClass","Email"===t.activeTab?"bg-white text-gray-800":"text-gray-500 hover:bg-white-alpha-50"),e.R7$(),e.Y8G("ngClass","Email"===t.activeTab?"text-gray-700":"text-gray-400"),e.R7$(3),e.Y8G("ngClass","description"===t.activeTab?"bg-white shadow-1 text-gray-800":"text-gray-500 hover:bg-white-alpha-50"),e.R7$(),e.Y8G("ngClass","description"===t.activeTab?"text-gray-700":"text-gray-400"),e.R7$(3),e.Y8G("ngClass","attachments"===t.activeTab?"bg-white shadow-1 text-gray-800":"text-gray-500 hover:bg-white-alpha-50"),e.R7$(),e.Y8G("ngClass","attachments"===t.activeTab?"text-gray-700":"text-gray-400")}}function rh(n,a){if(1&n&&(e.j41(0,"span",43),e.EFF(1),e.k0s()),2&n){const t=e.XpG(2).$implicit;e.R7$(),e.SpI(" +",t.length-1," ")}}function ih(n,a){if(1&n&&(e.qex(0),e.j41(1,"span"),e.EFF(2),e.k0s(),e.DNE(3,rh,2,1,"span",42),e.bVm()),2&n){const t=e.XpG().$implicit;e.R7$(2),e.JRh(t[0].Name?t[0].Name:t[0]),e.R7$(),e.Y8G("ngIf",t.length>1)}}function ah(n,a){if(1&n&&(e.j41(0,"div",41),e.DNE(1,ih,4,2,"ng-container",26),e.k0s()),2&n){const t=a.$implicit;e.R7$(),e.Y8G("ngIf",t&&t.length>0)}}function sh(n,a){if(1&n&&(e.j41(0,"div",44),e.nrm(1,"p-avatar",45),e.j41(2,"span"),e.EFF(3),e.k0s()()),2&n){const t=a.$implicit,r=e.XpG(3);e.R7$(),e.Aen(e.lJ4(5,eh)),e.Y8G("image",t.PictureId?r.IMG_ROUTE+t.PictureId:null)("icon",t.PictureId?null:"pi pi-user"),e.R7$(2),e.JRh(t.Name)}}function oh(n,a){if(1&n&&(e.j41(0,"span",50),e.EFF(1),e.k0s()),2&n){const t=e.XpG().$implicit;e.R7$(),e.SpI("Cc: ",t.cc,"")}}function lh(n,a){if(1&n&&(e.j41(0,"div",47)(1,"div",48)(2,"div",12)(3,"span",49),e.EFF(4),e.k0s(),e.j41(5,"span",50),e.EFF(6),e.k0s(),e.DNE(7,oh,2,1,"span",51),e.nrm(8,"br"),e.k0s(),e.j41(9,"span",50),e.EFF(10),e.k0s()(),e.j41(11,"div",52),e.EFF(12),e.k0s(),e.nrm(13,"iframe",53),e.k0s()),2&n){const t=a.$implicit,r=e.XpG(4);e.R7$(4),e.JRh(t.from),e.R7$(2),e.SpI("To: ",t.to,""),e.R7$(),e.Y8G("ngIf",t.cc),e.R7$(3),e.JRh(t.date),e.R7$(2),e.SpI(" Subject: ",t.subject," "),e.R7$(),e.Y8G("srcdoc",r.formatEmailBody(t.body),e.npT)}}function ch(n,a){if(1&n&&(e.qex(0),e.DNE(1,lh,14,6,"div",46),e.bVm()),2&n){const t=e.XpG(3);e.R7$(),e.Y8G("ngForOf",t.emailThreads)}}function dh(n,a){1&n&&(e.j41(0,"div",54),e.nrm(1,"i",55),e.j41(2,"span",56),e.EFF(3,"No email history found"),e.k0s(),e.j41(4,"p",57),e.EFF(5,"All communications for this deal will appear here."),e.k0s()())}function ph(n,a){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"div",27)(2,"div",28)(3,"div",29)(4,"label",30),e.EFF(5," Assignee "),e.j41(6,"span",31),e.EFF(7,"*"),e.k0s()(),e.j41(8,"p-multiSelect",32),e.bIt("onChange",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.onAssigneeChange(i))}),e.DNE(9,ah,2,1,"ng-template",33)(10,sh,4,6,"ng-template",34),e.k0s()(),e.j41(11,"div",29)(12,"label",30),e.EFF(13," Amount "),e.k0s(),e.nrm(14,"input",35),e.k0s()(),e.j41(15,"div",28)(16,"div",29)(17,"label",30),e.EFF(18," Due Date"),e.k0s(),e.nrm(19,"p-datepicker",36),e.k0s(),e.j41(20,"div",29)(21,"label",30),e.EFF(22," Qualify"),e.k0s(),e.j41(23,"app-lead-qualifier",37),e.bIt("onComplete",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.handleQualification(i))}),e.k0s()()()(),e.nrm(24,"div",38),e.j41(25,"div",39),e.DNE(26,ch,2,1,"ng-container",40)(27,dh,6,0,"ng-template",null,2,e.C5r),e.k0s(),e.bVm()}if(2&n){const t=e.sdS(28),r=e.XpG(2);e.R7$(8),e.Y8G("options",r.boardTeamMembers)("styleClass","w-full border-200 border-round-lg min-h-3rem flex align-items-center text-xs")("appendTo","body"),e.R7$(11),e.Y8G("showIcon",!0)("appendTo","body"),e.R7$(7),e.Y8G("ngIf",r.emailThreads&&r.emailThreads.length>0)("ngIfElse",t)}}function uh(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",65),e.bIt("click",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.onEditDescription())}),e.nrm(1,"div",66)(2,"i",67),e.k0s()}if(2&n){let t;const r=e.XpG(3);e.R7$(),e.Y8G("innerHTML",(null==(t=r.formGroup.get("Description"))?null:t.value)||"<span class='text-400'>Click to add description</span>",e.npT)}}function fh(n,a){1&n&&(e.j41(0,"span",70),e.nrm(1,"button",71)(2,"button",72),e.k0s(),e.j41(3,"span",70),e.nrm(4,"button",73)(5,"button",74),e.k0s())}function mh(n,a){1&n&&(e.j41(0,"div",68)(1,"p-editor",69),e.DNE(2,fh,6,0,"ng-template",4),e.k0s()()),2&n&&(e.R7$(),e.Aen(e.lJ4(2,th)))}function hh(n,a){if(1&n&&(e.qex(0),e.j41(1,"div",58)(2,"div",59)(3,"div",60),e.EFF(4,"Description"),e.k0s(),e.DNE(5,uh,3,1,"div",61)(6,mh,3,3,"div",62),e.k0s(),e.nrm(7,"app-tags-drawer",63)(8,"app-card-contacts",64),e.k0s(),e.bVm()),2&n){const t=e.XpG(2);e.R7$(5),e.Y8G("ngIf",!t.showDescriptionEditor),e.R7$(),e.Y8G("ngIf",t.showDescriptionEditor),e.R7$(),e.Y8G("selectedCard",t.selectedCard)("formGroup",t.formGroup),e.R7$(),e.Y8G("selectedCard",t.selectedCard)}}function gh(n,a){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"div",75)(2,"button",76),e.bIt("click",function(i){e.eBV(t);const s=e.XpG(2);return i.stopPropagation(),e.Njj(s.openNotes("notes"))}),e.nrm(3,"i",77),e.j41(4,"span",78),e.EFF(5),e.k0s()(),e.j41(6,"button",76),e.bIt("click",function(i){e.eBV(t);const s=e.XpG(2);return i.stopPropagation(),e.Njj(s.openNotes("followups"))}),e.nrm(7,"i",79),e.j41(8,"span",78),e.EFF(9,"Follow Ups "),e.k0s()()(),e.j41(10,"div",80)(11,"p",81),e.EFF(12," Capture all information for the deal and follow-ups. Use this space to log conversations, reminders, and next steps. "),e.k0s()(),e.bVm()}if(2&n){const t=e.XpG(2);e.R7$(2),e.Y8G("ngClass","notes"===t.notesTab?"bg-white shadow-1 text-900":"bg-transparent text-500 hover:surface-100"),e.R7$(3),e.SpI("Notes (",null==t.selectedCard||null==t.selectedCard.CardComments?null:t.selectedCard.CardComments.length,")"),e.R7$(),e.Y8G("ngClass","followups"===t.notesTab?"bg-white shadow-1 text-900":"bg-transparent text-500 hover:surface-100")}}function _h(n,a){1&n&&(e.j41(0,"div",99),e.nrm(1,"i",100),e.k0s())}function xh(n,a){if(1&n&&(e.j41(0,"div"),e.nrm(1,"i"),e.k0s()),2&n){const t=e.XpG().$implicit,r=e.XpG(4);e.HbH(r.getFileIconContainerClass(t.contentType)),e.R7$(),e.HbH(r.getFileIcon(t.contentType))}}function vh(n,a){1&n&&(e.j41(0,"span"),e.EFF(1,"\u2022 Uploading..."),e.k0s())}function bh(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",91)(1,"div",11),e.DNE(2,_h,2,0,"div",92)(3,xh,2,4,"div",93),e.j41(4,"div",12)(5,"span",94),e.EFF(6),e.k0s(),e.j41(7,"small",95),e.EFF(8),e.DNE(9,vh,2,0,"span",26),e.k0s()()(),e.j41(10,"div",96)(11,"button",97),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG(4);return e.Njj(s.downloadFile(i))}),e.k0s(),e.j41(12,"button",98),e.bIt("click",function(){const i=e.eBV(t).index,s=e.XpG(4);return e.Njj(s.removeFile(i))}),e.k0s()()()}if(2&n){const t=a.$implicit;e.R7$(2),e.Y8G("ngIf",t.loading),e.R7$(),e.Y8G("ngIf",!t.loading),e.R7$(3),e.JRh(t.name),e.R7$(2),e.SpI(" ",t.size," "),e.R7$(),e.Y8G("ngIf",t.loading),e.R7$(2),e.Y8G("loading",t.loading),e.R7$(),e.Y8G("disabled",t.loading)}}function Ch(n,a){if(1&n&&(e.j41(0,"div",88)(1,"span",89),e.EFF(2),e.k0s(),e.DNE(3,bh,13,7,"div",90),e.k0s()),2&n){const t=e.XpG(3);e.R7$(2),e.SpI(" ",t.uploadedFiles.length," File(s) attached "),e.R7$(),e.Y8G("ngForOf",t.uploadedFiles)}}function kh(n,a){1&n&&(e.j41(0,"div",101),e.nrm(1,"i",102),e.j41(2,"p",103),e.EFF(3,"No files attached to this deal yet."),e.k0s()())}function Th(n,a){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"div",82)(2,"div",83)(3,"span",84),e.EFF(4,"Attachments"),e.k0s(),e.j41(5,"p-fileUpload",85),e.bIt("uploadHandler",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.uploadFile(i))}),e.k0s()(),e.DNE(6,Ch,4,2,"div",86)(7,kh,4,0,"div",87),e.k0s(),e.bVm()}if(2&n){const t=e.XpG(2);e.R7$(5),e.Y8G("customUpload",!0)("auto",!0),e.R7$(),e.Y8G("ngIf",t.uploadedFiles.length>0),e.R7$(),e.Y8G("ngIf",0===t.uploadedFiles.length)}}function wh(n,a){if(1&n&&(e.j41(0,"form",25),e.DNE(1,ph,29,7,"ng-container",26)(2,hh,9,5,"ng-container",26)(3,gh,13,3,"ng-container",26)(4,Th,8,4,"ng-container",26),e.k0s()),2&n){const t=e.XpG();e.Y8G("formGroup",t.formGroup),e.R7$(),e.Y8G("ngIf","Email"===t.activeTab),e.R7$(),e.Y8G("ngIf","description"===t.activeTab),e.R7$(),e.Y8G("ngIf","notes"===t.activeTab),e.R7$(),e.Y8G("ngIf","attachments"===t.activeTab)}}function yh(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",104)(1,"button",105),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.destroyComponent())}),e.k0s(),e.j41(2,"button",106),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.submitData())}),e.k0s()()}}function Fh(n,a){if(1&n){const t=e.RV6();e.j41(0,"app-deal-notes",107),e.mxI("visibleChange",function(i){e.eBV(t);const s=e.XpG();return e.DH7(s.showNotesDrawer,i)||(s.showNotesDrawer=i),e.Njj(i)}),e.bIt("onClose",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.closeNotesDrawer())}),e.k0s()}if(2&n){const t=e.XpG();e.R50("visible",t.showNotesDrawer),e.Y8G("card",t.selectedCard)("initialTab",t.notesTab)}}let Sh=(()=>{class n{content;messageService;_boardService;teamService;selectedCard;showDialog=!1;close=new e.bkB;handleConfirmation;submitClicked=new e.bkB;formGroup;boardTeamMembers;contacts;sources=[];
1onDownloadFile=new e.bkB;IMG_ROUTE=`${Xt.c.apiUrl}/api/storage/image/`;getFileIcon=at.I3;getFileIconContainerClass=at.Tp;Cardcontacts=[];colors=at.Tj;selectedAssignees=[];selectedFileIds=[];selectedFileId;selectedFileItem=null;attachments=[];isUploading=!1;featureKey="sales_tracker";activeTab="Email";ConfirmationActionType=J.ON;opportunityTypes=[{label:"Inbound",value:!0},{label:"Outbound",value:!1}];uploadedFiles=[];fileIds=[];emailThreads=[];isEditingCompany=!1;showFollowUpForm=!1;hoveredIndex=null;selectedContactId=null;notesTab="notes";showNotesDrawer=!1;showDescriptionEditor=!1;constructor(t,r,i,s){this.content=t,this.messageService=r,this._boardService=i,this.teamService=s}ngOnInit(){if(this.selectedCard.DueDateUtc){const r=this.selectedCard?.DueDateUtc?new Date(this.selectedCard.DueDateUtc):null;this.formGroup.patchValue({DueDateUtc:r})}const t=this.selectedCard.AssignedUserIds||[];this.selectedAssignees=this.boardTeamMembers.filter(r=>t.includes(r.Id)),this.formGroup.patchValue({AssignedUserIds:t}),this.selectedCard?.Description&&(this.emailThreads=this.parseEmailThreads(this.selectedCard.Description)),this.loadLinkedContacts()}submitData(){this.submitClicked.emit()}destroyComponent(){this.close.emit()}downloadPdf(t){this.content.downloadFile(t).subscribe(r=>{ts.saveFile(r,"file.pdf")},r=>{console.error("Error downloading PDF:",r)})}toggleAssignee(t){const r=this.selectedAssignees.findIndex(i=>i.Id===t.Id);r>-1?this.selectedAssignees.splice(r,1):this.selectedAssignees.push(t),this.formGroup.patchValue({AssignedUserIds:this.selectedAssignees.map(i=>i.Id)})}getSelectedCount(){return this.selectedAssignees.length}isMemberSelected(t){return this.selectedAssignees.some(r=>r.Id===t)}getInitials(t){return t?t.trim().split(" ").filter(r=>r.length>0).map(r=>r[0]).join("").substring(0,2).toUpperCase():""}getAvatarColor(t){const r=this.hashUserId(t)%this.colors.length;return this.colors[r].color}hashUserId(t){let r=0;for(let i=0;i<t.length;i++)r=t.charCodeAt(i)+((r<<5)-r);return Math.abs(r)}parseEmailThreads(t){const s=(new DOMParser).parseFromString(t,"text/html").body.innerText.split("\n"),o=[];let l={},c=[];for(let d of s)if(d=d.trim(),d){if(d.startsWith("From:")){l.from&&(l.body=c.join("<br>"),o.push(l),c=[]),l={},l.from=d.replace("From:","").trim();continue}if(d.startsWith("Date:")||d.startsWith("Sent:")){l.date=d.replace(/Date:|Sent:/,"").trim();continue}if(d.startsWith("To:")){l.to=d.replace("To:","").trim();continue}if(d.startsWith("Cc:")){l.cc=d.replace("Cc:","").trim();continue}if(d.startsWith("Subject:")){l.subject=d.replace("Subject:","").trim();continue}c.push(d)}return l.from&&(l.body=c.join("<br>"),o.push(l)),o.reverse()}formatEmailBody(t){return t.split("<br>").map(r=>`<p style="margin: 0 0 .8em 0;">${r.trim()}</p>`).join("")}deleteContactLink(t){this._boardService.removeLinkedContacts(this.selectedCard.Id,[t]).subscribe({next:()=>{this.Cardcontacts=this.Cardcontacts.filter(r=>r.Id!==t)},error:r=>console.error("Error removing contact link",r)})}onContactSelect(t){t&&this._boardService.linkContactsToCard(this.selectedCard.Id,[t]).subscribe({next:()=>{if(this.selectedContactId=null,!this.Cardcontacts.find(i=>i.Id===t)){const i=this.contacts.find(s=>s.id===t);i&&this.Cardcontacts.push({Id:i.id,FirstName:i.firstName,LastName:i.lastName,Title:i.title??0,TitleString:i.titleString??"",Role:i.role??"",Website:i.website,OrganizationId:i.organizationId,Email:i.email,Description:i.description,DateCreatedUtc:i.dateCreatedUtc,CreatedByUserId:i.createdByUserId,PhoneNumber:i.phoneNumber,TeamId:i.teamId,TrackName:i.trackName,TrackColor:i.TrackColor})}},error:r=>console.error("Error linking contact",r)})}onContactSaved(t){this.contacts=[...this.contacts,t],this.messageService.add({severity:"success",summary:"Success",detail:`${t.firstName} added successfully`})}loadLinkedContacts(){this._boardService.getLinkedContacts(this.selectedCard.Id).subscribe({next:t=>this.Cardcontacts=t,error:t=>console.error("Error fetching contacts",t)})}selectTab(t){this.activeTab=t}onAssigneeChange(t){const i=(t.value||[]).map(s=>{const o=this.boardTeamMembers.find(l=>l.Name===s);return o?o.Id:null}).filter(s=>null!==s);this.formGroup.get("AssignedUserIds")?.setValue(i)}openNotes(t){this.notesTab=t,setTimeout(()=>{this.showNotesDrawer=!0})}closeNotesDrawer(){this.showNotesDrawer=!1}handleQualification(t){this.formGroup.patchValue({priority:t.priorityValue})}onEditDescription(){this.showDescriptionEditor=!0}downloadFile(t){this.onDownloadFile.emit(t)}updateFormControl(){const t=this.fileIds.join(",");this.formGroup.get("AttachmentFile")?.setValue(t)}uploadFile(t){const r=t.currentFiles||t.files;r&&r.filter(s=>!this.uploadedFiles.some(o=>
1o.name===s.name&&o.size===s.size)).forEach(s=>{const o={name:s.name,size:s.size,id:"",loading:!0};this.uploadedFiles.push(o),this._boardService.postImage(s,this.featureKey,this.teamService.getCurrentTeam.Team.Id).subscribe({next:l=>{o.id=l.PublicId,o.loading=!1,this.fileIds.push(l.PublicId),this.updateFormControl()},error:l=>{console.error("Upload failed",l),o.loading=!1,this.uploadedFiles=this.uploadedFiles.filter(c=>c!==o)}})})}initializeFiles(){const t=this.formGroup.get("AttachmentFile")?.value;t&&"string"==typeof t&&(this.fileIds=t.split(",").filter(r=>""!==r.trim()),this.fileIds.forEach(r=>{this.loadExistingFileDetails(r)}))}loadExistingFileDetails(t){this.content.getFileByPublicId(t).subscribe({next:r=>{this.uploadedFiles.push({name:r.name,id:r.publicId,size:r.size,contentType:r.contentType,loading:!1})},error:r=>console.error(`Failed to load file ${t}`,r)})}removeFile(t){this.fileIds.splice(t,1),this.uploadedFiles.splice(t,1),this.updateFormControl()}static \u0275fac=function(r){return new(r||n)(e.rXU(Zi.f),e.rXU(be.bg),e.rXU(_t.a),e.rXU(rt.n))};static \u0275cmp=e.VBU({type:n,selectors:[["app-edit-email-deal"]],inputs:{selectedCard:"selectedCard",showDialog:"showDialog",handleConfirmation:"handleConfirmation",formGroup:"formGroup",boardTeamMembers:"boardTeamMembers",contacts:"contacts",sources:"sources"},outputs:{close:"close",submitClicked:"submitClicked",onDownloadFile:"onDownloadFile"},standalone:!1,decls:9,vars:7,consts:[["eventSideBar",""],["contactDrawer",""],["emptyState",""],["position","right","styleClass","custom-edit-email",3,"visibleChange","onHide","visible","baseZIndex","showCloseIcon"],["pTemplate","header"],["pTemplate","content"],["pTemplate","footer"],[3,"contactSaved"],[3,"visible","card","initialTab","visibleChange","onClose",4,"ngIf"],[1,"flex","flex-column","w-full"],[1,"flex","justify-content-between","align-items-center","mb-2"],[1,"flex","align-items-center","gap-3"],[1,"flex","flex-column"],[1,"text-sm","font-bold","m-0","text-900",2,"line-height","1.2"],[1,"text-xs","font-normal","text-400"],[1,"flex","gap-3","text-400"],[1,"pi","pi-trash","cursor-pointer","hover:text-red-500",3,"click"],[1,"pi","pi-times","cursor-pointer","hover:text-900",3,"click"],[1,"flex","align-items-center","bg-gray-50","border-1","border-gray-200","border-round-lg","p-1","gap-0","w-full","overflow-x-auto"],[1,"flex","align-items-center","gap-2","p-2","border-round-md","cursor-pointer","flex-grow-1","justify-content-center","transition-all",3,"click","ngClass"],[1,"pi","pi-envelope","text-xs",3,"ngClass"],[1,"text-xs","font-semibold"],[1,"pi","pi-comment","text-xs",3,"ngClass"],[1,"text-xs","font-medium"],[1,"pi","pi-paperclip","text-xs",3,"ngClass"],[1,"h-full","flex","flex-column",3,"formGroup"],[4,"ngIf"],[1,"flex","flex-column","mt-2"],[1,"flex","w-full"],[1,"flex","flex-column","col-6","pb-0"],[1,"mb-1","text-500",2,"font-size","0.75rem"],[1,"text-red-500"],["formControlName","AssignedUsers","optionLabel","Name","optionValue","Name","placeholder","deal owner","filter","",3,"onChange","options","styleClass","appendTo"],["pTemplate","selectedItems"],["pTemplate","item"],["type","number","pInputText","","formControlName","Amount","placeholder","4500",1,"w-full","border-200","border-round-lg","p-2","text-xs"],["formControlName","DueDateUtc","dateFormat","yy/mm/dd","iconDisplay","input","placeholder","yy/mm/dd","styleClass","w-full","inputStyleClass","border-200 border-round-lg p-2 text-xs",3,"showIcon","appendTo"],[3,"onComplete"],[1,"border-top-1","border-200","my-2"],[1,"p-2","flex","flex-column","gap-3","email-scroll-container","mb-3"],[4,"ngIf","ngIfElse"],[1,"flex","align-items-center","text-sm","truncate","w-full"],["class","ml-1 text-blue-500 font-bold",4,"ngIf"],[1,"ml-1","text-blue-500","font-bold"],[1,"flex","gap-2","align-items-center"],["shape","circle",3,"image","icon"],["class","border-1 border-gray-200 border-round-lg p-1 bg-gray-50 font-inter",4,"ngFor","ngForOf"],[1,"border-1","border-gray-200","border-round-lg","p-1","bg-gray-50","font-inter"],[1,"flex","justify-content-between","align-items-start","mb-2"],[1,"font-bold","text-800","text-sm"],[1,"text-xs","text-500"],["class","text-xs text-500",4,"ngIf"],[1,"text-xs","text-600","mb-2","font-semibold"],[1,"w-full","flex-grow-1","border-none","bg-transparent",2,"min-height","400px",3,"srcdoc"],[1,"flex","flex-column","align-items-center","justify-content-center","py-8","border-2","border-dashed","border-200","border-round-xl","bg-white"],[1,"pi","pi-envelope","text-400","mb-3",2,"font-size","3rem"],[1,"text-700","font-bold"],[1,"text-500","text-sm","mt-2","m-0"],[1,"p-2"],[1,"mb-3","mt-3"],[1,"font-semibold","text-sm","mb-1"],["class","px-3 py-2 border-round border-1 border-gray-200 cursor-pointer flex justify-content-between align-items-start description-preview",3,"click",4,"ngIf"],["class","border-1 border-gray-300 border-round overflow-hidden",4,"ngIf"],[3,"selectedCard","formGroup"],[3,"selectedCard"],[1,"px-3","py-2","border-round","border-1","border-gray-200","cursor-pointer","flex","justify-content-between","align-items-start","description-preview",3,"click"],[1,"text-xs","text-600","flex-1",2,"min-height","50px","max-height","200px","overflow-y","auto","overflow-x","hidden","word-break","break-word",3,"innerHTML"],[1,"pi","pi-pencil","text-400","text-xs","ml-2"],[1,"border-1","border-gray-300","border-round","overflow-hidden"],["formControlName","Description","placeholder","Write your notes here...",1,"w-full"],[1,"ql-formats"],[1,"ql-bold"],[1,"ql-italic"],["value","ordered",1,"ql-list"],["value","bullet",1,"ql-list"],[1,"flex","surface-50","border-1","border-200","border-round-xl","p-1","mb-3"],["pButton","","type","button",1,"flex-1","border-none","py-2","border-round-lg","cursor-pointer","flex","align-items-center","justify-content-center","gap-2","transition-all","duration-200",3,"click","ngClass"],[1,"pi","pi-file"],[1,"font-normal"],[1,"pi","pi-calendar"],[1,"surface-50","border-1","border-100","border-round-lg","p-3","mb-3"],[1,"m-0","text-500","text-xs","line-height-3"],[1,"flex","flex-column","gap-4","mt-3","p-2"],[1,"flex","align-items-center","justify-content-between"],[1,"font-medium","text-sm","text-900"],["mode","basic","name","demo[]","chooseLabel","Add Files","chooseIcon","pi pi-plus","styleClass","p-button-sm p-button-outlined",3,"uploadHandler","customUpload","auto"],["class","flex flex-column gap-3",4,"ngIf"],["class","text-center p-4 border-2 border-dashed border-300 border-round-lg bg-gray-50",4,"ngIf"],[1,"flex","flex-column","gap-3"],[1,"text-xs","font-bold","text-500","uppercase","tracking-wider"],["class","flex align-items-center justify-content-between p-2 border-1 border-100 border-round-lg shadow-sm bg-white",4,"ngFor","ngForOf"],[1,"flex","align-items-center","justify-content-between","p-2","border-1","border-100","border-round-lg","shadow-sm","bg-white"],["class","flex align-items-center justify-content-center bg-gray-100 border-round","style","width: 40px; height: 40px",4,"ngIf"],[3,"class",4,"ngIf"],[1,"font-semibold","text-sm","text-900","line-height-2"],[1,"text-500"],[1,"flex","gap-2"],["pButton","","type","button","icon","pi pi-download","pTooltip","Download file","tooltipPosition","top",1,"p-button-text","p-button-secondary","p-button-rounded",3,"click","loading"],["pButton","","type","button","icon","pi pi-trash","pTooltip","Delete file",1,"p-button-text","p-button-danger","p-button-rounded",3,"click","disabled"],[1,"flex","align-items-center","justify-content-center","bg-gray-100","border-round",2,"width","40px","height","40px"],[1,"pi","pi-spin","pi-spinner","text-blue-500"],[1,"text-center","p-4","border-2","border-dashed","border-300","border-round-lg","bg-gray-50"],[1,"pi","pi-cloud-upload","text-400","text-2xl","mb-2"],[1,"text-500","text-sm","m-0"],[1,"flex","justify-content-end","gap-2","py-4","px-2","border-top-1","surface-border","w-full","-m-4",2,"margin","-1.25rem !important","
1width","calc(100% + 2.5rem) !important"],["pButton","","label","Cancel","icon","pi pi-times-circle",1,"p-button-text","p-button-secondary","text-700","font-bold",3,"click"],["pButton","","label","Update Lead","icon","pi pi-check-circle",1,"p-button-rounded","bg-blue-600","px-4","font-bold",3,"click"],[3,"visibleChange","onClose","visible","card","initialTab"]],template:function(r,i){if(1&r){const s=e.RV6();e.j41(0,"p-drawer",3,0),e.mxI("visibleChange",function(l){return e.eBV(s),e.DH7(i.showDialog,l)||(i.showDialog=l),e.Njj(l)}),e.bIt("onHide",function(){return e.eBV(s),e.Njj(i.destroyComponent())}),e.DNE(2,nh,24,7,"ng-template",4)(3,wh,5,5,"ng-template",5)(4,yh,3,0,"ng-template",6),e.nrm(5,"p-toast"),e.k0s(),e.j41(6,"app-create-contacts",7,1),e.bIt("contactSaved",function(l){return e.eBV(s),e.Njj(i.onContactSaved(l))}),e.k0s(),e.DNE(8,Fh,1,3,"app-deal-notes",8)}2&r&&(e.Aen(e.lJ4(6,Z1)),e.R50("visible",i.showDialog),e.Y8G("baseZIndex",1200)("showCloseIcon",!1),e.R7$(8),e.Y8G("ngIf",i.showNotesDrawer))},dependencies:[q.YU,q.Sq,q.bT,be.Ei,wt.m_,zn.eu,Ie.y8,Qe.Sm,L.qT,L.me,L.Q0,L.BC,L.cb,xe._f,Qi.KE,Ve._s,De.KF,L.j4,L.JD,zs,qs,Za,An.lr,ji.ef,Js,Ja],styles:[".email-scroll-container[_ngcontent-%COMP%]{max-height:calc(100vh - 400px);overflow-y:auto}.custom-tabs[_ngcontent-%COMP%] .p-tab[_ngcontent-%COMP%]{font-size:.8rem!important;font-weight:400!important;font-family:Inter,sans-serif!important}.custom-tabs[_ngcontent-%COMP%] .p-tablist[_ngcontent-%COMP%]{border-top:1px solid #efebebcc;background:#f8fafc} .custom-edit-email .p-drawer-content{padding:4px!important} .custom-edit-email .p-drawer-header{padding:12px!important;background-color:#f0f5fb!important;border-bottom:1px solid #cccc}input[pInputText][_ngcontent-%COMP%], input[type=date][_ngcontent-%COMP%], .p-inputtext[_ngcontent-%COMP%], .p-dropdown[_ngcontent-%COMP%], .p-multiselect[_ngcontent-%COMP%]{height:2.5rem;box-sizing:border-box}"]})}return n})();var Vl=ee(84412),Ks=ee(77643);let Qs=(()=>{class n{http;industriesSubject=new Vl.t([]);industries$=this.industriesSubject.asObservable();tenderLeadSubject=new Vl.t(null);originalIndustriesSnapshot=[];constructor(t){this.http=t}searchTenders(t){return this.http.post(`${Xt.c.apiUrl}/api/tenders/search`,t)}downloadTender(t){return this.http.get(`${Xt.c.apiUrl}/api/tenders/download/${t}`,{responseType:"blob",observe:"response"})}loadIndustries(){return this.http.get(`${Xt.c.apiUrl}/api/users/tender/categories/list`)}addUserBusinessCategory(t){return this.http.post(`${Xt.c.apiUrl}/api/users/business/category/add`,{id:t})}removeUserBusinessCategory(t){return this.http.post(`${Xt.c.apiUrl}/api/users/business/category/remove`,{id:t})}emitTenderLead(t){this.tenderLeadSubject.next(t)}onTenderLead(){return this.tenderLeadSubject.asObservable()}clear(){this.tenderLeadSubject.next(null)}setIndustries(t){this.industriesSubject.next([...t])}snapshotIndustries(){this.originalIndustriesSnapshot=this.industriesSubject.getValue().map(t=>({...t}))}get industries(){return this.industriesSubject.value}get selectedIndustryIds(){return this.industries.filter(t=>t.BelongsToUser).map(t=>t.Id)}get hasChanges(){const t=this.industriesSubject.getValue(),r=this.originalIndustriesSnapshot.filter(s=>s.BelongsToUser).map(s=>s.Id).sort(),i=t.filter(s=>s.BelongsToUser).map(s=>s.Id).sort();return r.length!==i.length||r.some((s,o)=>s!==i[o])}static \u0275fac=function(r){return new(r||n)(e.KVO(Ks.Qq))};static \u0275prov=e.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var pn=ee(60665);const Eh=["fu"],Ih=()=>({width:"420px"}),Dh=()=>({height:"6px"}),Rh=()=>({width:"32px",height:"32px"});function jh(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",10)(1,"div",11)(2,"div",12)(3,"span",13),e.EFF(4),e.k0s(),e.j41(5,"span",14),e.nrm(6,"i",15),e.EFF(7),e.k0s(),e.j41(8,"div",16)(9,"span",17),e.EFF(10,"Assigned To"),e.k0s(),e.j41(11,"button",18),e.bIt("click",function(i){e.eBV(t),e.XpG();const s=e.sdS(7);return e.Njj(s.toggle(i))}),e.nrm(12,"i",19),e.j41(13,"span",20),e.EFF(14,"Assign team member"),e.k0s()()()()(),e.j41(15,"div",21)(16,"i",22),e.bIt("click",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.handleConfirmation(i,s.ConfirmationActionType.Delete))}),e.k0s(),e.j41(17,"i",23),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.destroyComponent())}),e.k0s()()()}if(2&n){const t=e.XpG();e.R7$(4),e.SpI(" ",null==t.selectedCard||null==t.selectedCard.Tender?null:t.selectedCard.Tender.De
1scription," "),e.R7$(3),e.SpI(" ",null==t.selectedCard||null==t.selectedCard.Tender?null:t.selectedCard.Tender.TenderIssuer," ")}}function Ah(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",73)(1,"p-checkbox",74),e.mxI("ngModelChange",function(i){const s=e.eBV(t).$implicit;return e.DH7(s.Completed,i)||(s.Completed=i),e.Njj(i)}),e.bIt("click",function(i){const s=e.eBV(t).$implicit,o=e.XpG(2);return i.stopPropagation(),e.Njj(o.toggleChecklist(s))}),e.k0s(),e.j41(2,"span",75),e.EFF(3),e.k0s()()}if(2&n){const t=a.$implicit;e.R7$(),e.R50("ngModel",t.Completed),e.Y8G("binary",!0),e.R7$(),e.AVh("completed-text",t.Completed),e.R7$(),e.SpI(" ",t.Name," ")}}function Mh(n,a){1&n&&(e.j41(0,"div",89),e.nrm(1,"i",90),e.k0s())}function Ph(n,a){if(1&n&&(e.j41(0,"div"),e.nrm(1,"i"),e.k0s()),2&n){const t=e.XpG().$implicit,r=e.XpG(3);e.HbH(r.getFileIconContainerClass(t.contentType)),e.R7$(),e.HbH(r.getFileIcon(t.contentType))}}function Oh(n,a){1&n&&(e.j41(0,"span"),e.EFF(1,"\u2022 Uploading..."),e.k0s())}function Nh(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",79)(1,"div",80),e.DNE(2,Mh,2,0,"div",81)(3,Ph,2,4,"div",82),e.j41(4,"div",56)(5,"span",83),e.EFF(6),e.k0s(),e.j41(7,"small",84),e.EFF(8),e.DNE(9,Oh,2,0,"span",85),e.k0s()()(),e.j41(10,"div",86)(11,"button",87),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG(3);return e.Njj(s.downloadFile(i))}),e.k0s(),e.j41(12,"button",88),e.bIt("click",function(){const i=e.eBV(t).index,s=e.XpG(3);return e.Njj(s.removeFile(i))}),e.k0s()()()}if(2&n){const t=a.$implicit;e.R7$(2),e.Y8G("ngIf",t.loading),e.R7$(),e.Y8G("ngIf",!t.loading),e.R7$(3),e.JRh(t.name),e.R7$(2),e.SpI(" ",t.size," "),e.R7$(),e.Y8G("ngIf",t.loading),e.R7$(2),e.Y8G("loading",t.loading),e.R7$(),e.Y8G("disabled",t.loading)}}function Gh(n,a){if(1&n&&(e.j41(0,"div",76)(1,"span",77),e.EFF(2),e.k0s(),e.DNE(3,Nh,13,7,"div",78),e.k0s()),2&n){const t=e.XpG(2);e.R7$(2),e.SpI(" ",t.uploadedFiles.length," File(s) attached "),e.R7$(),e.Y8G("ngForOf",t.uploadedFiles)}}function Bh(n,a){1&n&&(e.j41(0,"div",91),e.nrm(1,"i",92),e.j41(2,"p",93),e.EFF(3,"No files attached to this deal yet."),e.k0s()())}function Lh(n,a){if(1&n&&(e.j41(0,"div",94),e.nrm(1,"i",95),e.j41(2,"div")(3,"div",96),e.EFF(4,"Special Conditions"),e.k0s(),e.j41(5,"p",97),e.EFF(6),e.k0s()()()),2&n){const t=e.XpG(2);e.R7$(6),e.SpI(" ",null==t.selectedCard||null==t.selectedCard.Tender?null:t.selectedCard.Tender.SpecialConditions," ")}}function $h(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",98),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.downloadTenderDocument(null==i.selectedCard?null:i.selectedCard.Tender))}),e.k0s()}if(2&n){const t=e.XpG(2);e.Y8G("loading",t.isDownloading)("disabled",t.isDownloading)}}function Vh(n,a){if(1&n){const t=e.RV6();e.j41(0,"p-tabs",24)(1,"p-tablist")(2,"p-tab",25),e.EFF(3,"Checklist"),e.k0s(),e.j41(4,"p-tab",26),e.EFF(5,"Attachments & Tags"),e.k0s(),e.j41(6,"p-tab",27),e.EFF(7,"Tender Details"),e.k0s()(),e.j41(8,"p-tabpanels")(9,"p-tabpanel",25)(10,"div",28)(11,"span",29),e.EFF(12,"Progress"),e.k0s(),e.j41(13,"span",30),e.EFF(14),e.k0s()(),e.nrm(15,"p-progressBar",31),e.j41(16,"div",32),e.DNE(17,Ah,4,5,"div",33),e.k0s()(),e.j41(18,"p-tabpanel",26)(19,"div",34)(20,"span",35),e.EFF(21,"Attachments"),e.k0s(),e.j41(22,"p-fileUpload",36),e.bIt("uploadHandler",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.uploadFile(i))}),e.k0s()(),e.DNE(23,Gh,4,2,"div",37)(24,Bh,4,0,"div",38),e.nrm(25,"app-tags-drawer",39),e.k0s(),e.j41(26,"p-tabpanel",27),e.DNE(27,Lh,7,1,"div",40),e.j41(28,"div",41)(29,"div",42)(30,"div")(31,"div",43),e.nrm(32,"i",44),e.j41(33,"span",45),e.EFF(34,"CLOSING"),e.k0s()(),e.j41(35,"div",46),e.EFF(36),e.nI1(37,"date"),e.k0s(),e.j41(38,"div",47),e.EFF(39),e.k0s()()()(),e.j41(40,"div",41)(41,"div",42)(42,"div")(43,"div",43),e.nrm(44,"i",48),e.j41(45,"span",45),e.EFF(46,"LOCATION"),e.k0s()(),e.j41(47,"div",46),e.EFF(48),e.k0s(),e.j41(49,"div",46),e.EFF(50),e.k0s()()()(),e.j41(51,"div",41)(52,"div",42)(53,"div")(54,"div",43),e.nrm(55,"i",49),e.j41(56,"span",45),e.EFF(57,"CATEGORY"),e.k0s()(),e.j41(58,"div",46),e.EFF(59),e.k0s()()()(),e.j41(60,"div",41)(61,"div",42)(62,"div")(63,"div",43),e.nrm(64,"i",50),e.j41(65,"span",45),e.EFF(66,"ADVERTISED"),e.k0s()(),e.j41(67,"div",46),e.EFF(68),e.nI1(69,"date"),e.k0s()()()(),e.j41(70,"div",51),e.DNE(71,$h,1,2,"button",52),e.k0s(),e.j41(72,"div",53)(73,"div",54),e.nrm(74,"i",55),e.j41(75,"div",56)(76,"span",57),e.EFF(77,"Title"),e.k0s(),e.j41(78,"span",58),e.EFF(79),e.k0s()()(),e.j41(80,"div",54),e.nrm(81,"i",59),e.j41(82,"div",56)(83,"span",57),e.EFF(84,"Organization"),e.k0s(),e.j41(85,"span",60),e.EFF(86),e.k0s()()(),e.j41(87,"div",54),e.nrm(88,"i",61),e.j41(89,"div",56)(90,"span",57),e.EFF(91,"Type"),e.k0s(),e.j41(92,"span",62),e.EFF(93),e.k0s()()(),e.j41(94,"div",54),e.nrm(95,"i",63),e.j41(96,"div",56)(97,"span",57),e.EFF(98,"Category"),e.k0s(),e.j41(99,"span",62),e.EFF(100),e.k0s()()(),e.j41(101,"div",54),e.nrm(102,"i",64),e.j41(103,"div",56)(104,"span",57),e.EFF(105,"Address"),e.k0s(),e.j41(106,"span",62),e.EFF(107),e.k0s()()(),e.j41(108,"div",65),e.nrm(109,"i",66),e.j41(110,"div",56)(111,"span",57),e.EFF(112,"Province"),e.k0s(),e.j41(113,"span",62),e.EFF(114),e.k0s()()(),e.j41(115,"div",65),e.nrm(116,"i",67),e.j41(117,"div",56)(118,"span",57),e.EFF(119,"Contact Person"),e.k0s(),e.j41(120,"span",62),e.EFF(121),e.k0s()()(),e.j41(122,"div",65),e.nrm(123,"i",68),e.j41(124,"div",56)(125,"span",57),e.EFF(126,"Email"),e.k0s(),e.j41(127,"a",69),e.EFF(128),e.k0s()()(),e.j41(129,"div",65),e.nrm(130,"i",70),e.j41(131,"div",56)(132,"span",57),e.EFF(133,"Phone"),e.k0s(),e.j41(134,"span",62),e.EFF(135),e.k0s()()(),e.j41(136,"div",71),e.nrm(137,"i",72),e.j41(138,"div",56)(139,"span",57),e.EFF(140,"Closing Date"),e.k0s(),e.j41(141,"span",62),e.EFF(142),e.nI1(143,"date"),e.k0s()()()()()()()}if(2&n){const t=e.XpG();e.R7$(14),e.Lme(" ",t.completedCount,"/",t.selectedCard.Checklist.length," completed "),e.R7$(),e.Aen(e.lJ4(41,Dh)),e.Y8G("value",t.progressPercentage)("showValue",!1),e.R7$(2),e.Y8G("ngForOf",t.selectedCard.Checklist),e.R7$(5),e.Y8G("customUpload",!0)("auto",!0),e.R7$(),e.Y8G("ngIf",t.uploadedFiles.length>0),e.R7$(),e.Y8G("ngIf",0===t.uploadedFiles.length),e.R7$(),e.Y8G("selectedCard",t.selectedCard)("formGroup",t.formGroup),e.R7$(2),e.Y8G("ngIf",null==t.selectedCard||null==t.selectedCard.Tender?null:t.selectedCard.Tender.SpecialConditions),e.R7$(9),e.SpI(" ",e.i5U(37,32,null==t.selectedCard||null==t.selectedCard.Tender?null:t.selectedCard.Tender.DateClosingUtc,"dd MMM yyyy")," "),e.R7$(3),e.SpI(" ",0===t.daysLeft?"Expired":t.daysLeft+" days left"," "),e.R7$(9),e.SpI(" ",(null==t.selectedCard||null==t.selectedCard.Tender||null==t.selectedCard.Tender.PlaceOfService?null:t.selectedCard.Tender.PlaceOfService.slice(0,20))||"-"," "),e.R7$(2),e.JRh(null==t.selectedCard||null==t.selectedCard.Tender?null:t.selectedCard.Tender.Province),e.R7$(9),e.JRh(null==t.selectedCard||null==t.selectedCard.Tender?null:t.selectedCard.Tender.BusinessCategory),e.R7$(9),e.SpI(" ",e.i5U(69,35,null==t.selectedCard||null==t.selectedCard.Tender?null:t.selectedCard.Tender.DateAdvertisedUtc,"dd MMM yyyy")," "),e.R7$(3),e.Y8G("ngIf",null==t.selectedCard||null==t.selectedCard.Tender?null:t.selectedCard.Tender.HasTenderDocument),e.R7$(8),e.SpI(" ",null==t.selectedCard||null==t.selectedCard.Tender?null:t.selectedCard.Tender.De
1scription," "),e.R7$(7),e.SpI(" ",null==t.selectedCard||null==t.selectedCard.Tender?null:t.selectedCard.Tender.TenderIssuer," "),e.R7$(7),e.SpI(" ",t.getTenderTypeLabel(null==t.selectedCard||null==t.selectedCard.Tender?null:t.selectedCard.Tender.TenderType)," "),e.R7$(7),e.SpI(" ",null==t.selectedCard||null==t.selectedCard.Tender?null:t.selectedCard.Tender.BusinessCategory," "),e.R7$(7),e.SpI(" ",(null==t.selectedCard||null==t.selectedCard.Tender?null:t.selectedCard.Tender.PlaceOfService)||"Address not specified"," "),e.R7$(7),e.SpI(" ",null==t.selectedCard||null==t.selectedCard.Tender?null:t.selectedCard.Tender.Province," "),e.R7$(7),e.SpI(" ",(null==t.selectedCard||null==t.selectedCard.Tender?null:t.selectedCard.Tender.ContactPerson)||"-"," "),e.R7$(6),e.Y8G("href","mailto:"+(null==t.selectedCard||null==t.selectedCard.Tender?null:t.selectedCard.Tender.ContactEmail),e.B4B),e.R7$(),e.SpI(" ",(null==t.selectedCard||null==t.selectedCard.Tender?null:t.selectedCard.Tender.ContactEmail)||"-"," "),e.R7$(7),e.SpI(" ",(null==t.selectedCard||null==t.selectedCard.Tender?null:t.selectedCard.Tender.ContactNumber)||"-"," "),e.R7$(7),e.SpI(" ",e.i5U(143,38,null==t.selectedCard||null==t.selectedCard.Tender?null:t.selectedCard.Tender.DateClosingUtc,"dd MMM yyyy")," ")}}function Uh(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",99)(1,"button",100),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.destroyComponent())}),e.k0s(),e.j41(2,"button",101),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onSubmit())}),e.k0s()()}}function Xh(n,a){1&n&&e.nrm(0,"i",106)}function Yh(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",102),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG();return e.Njj(s.selectUser(i))}),e.j41(1,"div",80),e.nrm(2,"p-avatar",103),e.j41(3,"span",104),e.EFF(4),e.k0s()(),e.DNE(5,Xh,1,0,"i",105),e.k0s()}if(2&n){const t=a.$implicit,r=e.XpG();e.R7$(2),e.Aen(e.lJ4(9,Rh)),e.Y8G("image",t.PictureId?r.IMG_ROUTE+t.PictureId:null)("label",t.PictureId?null:r.getInitials(t.Name))("styleClass",r.isUserSelected(t.Id)?"bg-blue-500 text-white":"bg-orange-500 text-white"),e.R7$(),e.AVh("font-bold",r.isUserSelected(t.Id)),e.R7$(),e.SpI(" ",t.Name," "),e.R7$(),e.Y8G("ngIf",r.isUserSelected(t.Id))}}let Wh=(()=>{class n{_boardService;teamService;messageService;tenderService;content;handleConfirmation;fileUpload;submitClicked=new e.bkB;close=new e.bkB;selectedCard;showDialog=!1;formGroup;boardTeamMembers;onDownloadFile=new e.bkB;isLoading=!0;ConfirmationActionType=J.ON;IMG_ROUTE=`${Xt.c.apiUrl}/api/storage/image/`;activeTab="checklist";getFileIcon=at.I3;getFileIconContainerClass=at.Tp;tags=[];isUploading=!1;featureKey="sales_tracker";isDownloading=!1;progressPercentage=0;completedCount=0;showTagDialog=!1;uploadedFiles=[];fileIds=[];constructor(t,r,i,s,o){this._boardService=t,this.teamService=r,this.messageService=i,this.tenderService=s,this.content=o}ngOnInit(){this.initializeFiles(),this.updateProgress()}onSubmit(){this.submitClicked.emit()}destroyComponent(){this.close.emit()}setTab(t){this.activeTab=t}updateFormControl(){const t=this.fileIds.join(",");this.formGroup.get("AttachmentFile")?.setValue(t)}uploadFile(t){const r=t.currentFiles||t.files;r&&r.filter(s=>!this.uploadedFiles.some(o=>o.name===s.name&&o.size===s.size)).forEach(s=>{const o={name:s.name,size:s.size,id:"",loading:!0};this.uploadedFiles.push(o),this._boardService.postImage(s,this.featureKey,this.teamService.getCurrentTeam.Team.Id).subscribe({next:l=>{o.id=l.PublicId,o.loading=!1,this.fileIds.push(l.PublicId),this.updateFormControl()},error:l=>{console.error("Upload failed",l),o.loading=!1,this.uploadedFiles=this.uploadedFiles.filter(c=>c!==o)}})})}initializeFiles(){const t=this.formGroup.get("AttachmentFile")?.value;t&&"string"==typeof t&&(this.fileIds=t.split(",").filter(r=>""!==r.trim()),this.fileIds.forEach(r=>{this.loadExistingFileDetails(r)}))}loadExistingFileDetails(t){this.content.getFileByPublicId(t).subscribe({next:r=>{this.uploadedFiles.push({name:r.name,id:r.publicId,size:r.size,contentType:r.contentType,loading:!1})},error:r=>console.error(`Failed to load file ${t}`,r)})}removeFile(t){this.fileIds.splice(t,1),this.uploadedFiles.splice(t,1),this.updateFormControl()}downloadTenderDocument(t){this.isDownloading=!0,this.tenderService.downloadTender(t.Id).subscribe({next:r=>{const s=r.headers.get("content-disposition").split('filename="')[1]?.replace('"',""),o=document.createElement("a"),l=URL.createObjectURL(r.body);o.href=l,o.download=s,o.click(),URL.revokeObjectURL(l),this.messageService.add({severity:"success",summary:"Download Complete",detail:"file downloaded successfully"}),this.isDownloading=!1},error:r=>{console.error("Download failed",r),this.messageService.add({severity:"error",summary:"Download Failed",detail
1:"Failed to download file"}),this.isDownloading=!1}})}toggleChecklist(t){const r=!t.Completed;t.Completed=r,this._boardService.setCompledSetting(t.Id,r).subscribe({next:()=>this.updateProgress(),error:i=>{t.Completed=!r,this.updateProgress()}})}updateProgress(){if(!this.selectedCard||!this.selectedCard.Checklist)return this.completedCount=0,void(this.progressPercentage=0);this.completedCount=this.selectedCard.Checklist.filter(t=>t.Completed).length,this.progressPercentage=this.completedCount/this.selectedCard.Checklist.length*100}get daysLeft(){const t=new Date(this.selectedCard?.Tender?.DateClosingUtc),r=new Date,i=t.getTime()-r.getTime();return Math.max(Math.ceil(i/864e5),0)}selectUser(t){const r=this.formGroup.get("AssignedUserIds")?.value||[];let i;i=r.includes(t.Id)?r.filter(s=>s!==t.Id):[...r,t.Id],this.formGroup.get("AssignedUserIds")?.setValue(i)}syncAssignedIds(t){const r=t.map(i=>{const s=this.boardTeamMembers.find(o=>o.Name===i);return s?s.Id:null}).filter(i=>null!==i);this.formGroup.get("AssignedUserIds")?.setValue(r)}isUserSelected(t){return(this.formGroup.get("AssignedUserIds")?.value||[]).includes(t)}getInitials(t){return t?t.split(" ").map(r=>r[0]).join("").toUpperCase().substring(0,2):""}getTenderTypeLabel(t){return 4===t||"4"===t?"RFB":String(t??"")}downloadFile(t){this.onDownloadFile.emit(t)}static \u0275fac=function(r){return new(r||n)(e.rXU(_t.a),e.rXU(rt.n),e.rXU(be.bg),e.rXU(Qs),e.rXU(Zi.f))};static \u0275cmp=e.VBU({type:n,selectors:[["app-tender-deal-view"]],viewQuery:function(r,i){if(1&r&&e.GBs(Eh,5),2&r){let s;e.mGM(s=e.lsd())&&(i.fileUpload=s.first)}},inputs:{handleConfirmation:"handleConfirmation",selectedCard:"selectedCard",showDialog:"showDialog",formGroup:"formGroup",boardTeamMembers:"boardTeamMembers",isLoading:"isLoading"},outputs:{submitClicked:"submitClicked",close:"close",onDownloadFile:"onDownloadFile"},standalone:!1,decls:13,vars:6,consts:[["eventSideBar",""],["op",""],["position","right","showCloseIcon","false","styleClass","custom-edit-tender",3,"visibleChange","onHide","visible","baseZIndex"],["pTemplate","header"],["pTemplate","Content"],["pTemplate","footer"],[1,"flex","flex-column","w-15rem"],[1,"text-xs","font-bold","text-500","mb-3","px-2","uppercase"],[1,"flex","flex-column","gap-1"],["class","flex align-items-center justify-content-between p-2 hover:surface-100 border-round cursor-pointer",3,"click",4,"ngFor","ngForOf"],[1,"w-full","flex","flex-row","justify-content-between","align-items-start"],[1,"flex","align-items-center","gap-2"],[1,"div1","flex","flex-column"],[1,"font-bold","text-sm","mt-1","description-clamp"],[1,"text-sm","text-500","mt-1"],[1,"pi","pi-building","mr-1"],[1,"flex","align-items-center","gap-2","mb-3"],[1,"text-xs","text-500","uppercase","tracking-wider"],["type","button",1,"assign-btn","flex","align-items-center","gap-2","px-3","py-1","bg-white","cursor-pointer",3,"click"],[1,"pi","pi-user-plus","text-blue-500"],[1,"text-blue-500","font-medium"],[1,"flex","gap-3","z-1","flex","justify-content-start","align-content-center"],["pTooltip","Delete",1,"pi","pi-trash","cursor-pointer",3,"click"],["pTooltip","Close",1,"pi","pi-times","cursor-pointer",3,"click"],["value","0",1,"h-full","p-0","custom-tabs"],["value","0"],["value","1"],["value","2"],[1,"flex","justify-content-between","align-items-center","mb-2"],[1,"text-900","font-medium"],[1,"text-600","text-sm"],["styleClass","mb-4",3,"value","showValue"],[1,"flex","flex-column","gap-2"],["class","flex align-items-center p-3 border-1 border-300 border-round-md bg-white hover:surface-100 transition-duration-150 cursor-pointer",4,"ngFor","ngForOf"],[1,"flex","align-items-center","justify-content-between"],[1,"font-medium","text-sm","text-900"],["mode","basic","name","demo[]","chooseLabel","Add Files","chooseIcon","pi pi-plus","styleClass","p-button-sm p-button-outlined",3,"uploadHandler","customUpload","auto"],["class","flex flex-column gap-3",4,"ngIf"],["class","text-center p-4 border-2 border-dashed border-300 border-round-lg bg-gray-50",4,"ngIf"],[3,"selectedCard","formGroup"],["class","special-box mb-4",4,"ngIf"],[1,"col-12"],[1,"flex-1","border-1","border-200","border-round-lg","p-2","hover:surface-100","cursor-pointer",2,"background","#f8fafc"],[1,"flex","flex-row"],[1,"pi","pi-calendar","text-xs","mr-1"],[1,"block","uppercase","text-500","font-bold","mb-1",2,"font-size","0.65rem"],[1,"catergory-clamp"],[1,"catergory-clamp","text-orange-500"],[1,"pi","pi-map-marker","text-xs","mr-1"],[1,"pi","pi-tag","text-xs","mr-1"],[1,"pi","pi-clock","text-xs","mr-1"],[1,"flex","justify-content-end","col-12","mb-2"],["pButton","","label","Tender Documents","icon","pi pi-download","class","p-button-sm p-button-outlined ",3,"loading","disabled","click",4,"ngIf"],[1,"flex","flex-column","p-2"],[1,"flex","gap-3","align-items-start","border-bottom-1","border-200","pt-3"],[1,"pi","pi-file-edit","text-500","mt-1"],[1,"flex","flex-column"],[1,"text-xs","text-500","uppercase","tracking-wider","mb-1"],[1,"text-900","font-semibold","text-sm","line-height-3"],[1,"pi","pi-building","text-500","mt-1"],[1,"text-800","text-xs"],[1,"pi","pi-tag","text-500","mt-1"],[1,"text-800","text-sm"],[1,"pi","pi-tags","text-500","mt-1"],[1,"pi","pi-map-marker","text-500","mt-1"],[1,"flex","gap-3","align-items-start","border-bottom-1","border-100","pt-3"],[1,"pi","pi-map","text-500","mt-1"],[1,"pi","pi-user","text-500","mt-1"],[1,"pi","pi-envelope","text-500","mt-1"],[1,"text-blue-600","no-underline","hover:underline",3,"href"],[1,"pi","pi-phone","text-500","mt-1"],[1,"flex","gap-3","align-items-start","pt-2","pb-2"],[1,"pi","pi-calendar-times","text-500","mt-1"],[1,"flex","align-items-center","p-3","border-1","border-300","border-round-md","bg-white","hover:surface-100","transition-duration-150","cursor-pointer"],[1,"mr-3",3,"ngModelChange","click","ngModel","binary"],[1,"text-700","font-normal","text-sm"],[1,"flex","flex-column","gap-3"],[1,"text-xs","font-bold","text-500","uppercase","tracking-wider"],["class","flex align-items-center justify-content-between p-2 border-1 border-100 border-round-lg shadow-sm bg-white",4,"ngFor","ngForOf"],[1,"flex","align-items-center","justify-content-between","p-2","border-1","border-100","border-round-lg","shadow-sm","bg-white"],[1,"flex","align-items-center","gap-3"],["class","flex align-items-center justify-content-center bg-gray-100 border-round","style","width: 40px; height: 40px",4,"ngIf"],[3,"class",4,"ngIf"],[1,"font-semibold","text-sm","text-900","line-height-2"],[1,"text-500"],[4,"ngIf"],[1,"flex","gap-2"],["pButton","","type","button","icon","pi pi-download","pTooltip","Download file","tooltipPosition","top",1,"p-button-text","p-button-secondary","p-button-rounded",3,"click","loading"],["pButton","","type","button","icon","pi pi-trash","pTooltip","Delete file",1,"p-button-text","p-button-danger","p-button-rounded",3,"click","disabled"],[1,"flex","align-items-center","justify-content-center","bg-gray-100","border-round",2,"width","40px","height","40px"],[1,"pi","pi-spin","pi-spinner","text-blue-500"],[1,"text-center","p-4","border-2","border-dashed","border-300","border-round-lg","bg-gray-50"],[1,"pi","pi-cloud-upload","text-400","text-2xl","mb-2"],[1,"text-500","text-sm","m-0"],[1,"special-box","mb-4"],[1,"pi","pi-exclamation-circle"],[1,"font-semibold"],[1,"mt-1","mb-0"],["pButton","","label","Tender Documents","icon","pi pi-download",1,"p-button-sm","p-button-outlined",3,"click","loading","disabled"],[1,"flex","justify-content-end","gap-2"],["pButton","","type","button","label","Cancel","icon","pi pi-times-circle",1,"p-button-outlined","rounded-pill","px-4",3,"click"],["pButton","","type","button","label","Update","icon","pi pi-check-circle",1,"p-button-rounded","px-4",3,"click"],[1,"flex","align-items-center","justify-content-between","p-2","hover:surface-100","border-round","cursor-pointer",3,"click"],["shape","circle",3,"image","label","styleClass"],[1,"text-900","text-sm"],["class","pi pi-check text-blue-500 text-xs mr-2",4,"ngIf"],[1,"pi","pi-check","text-blue-500","text-xs","mr-2"]],template:function(r,i){if(1&r){const s=e.RV6();e.j41(0,"p-drawer",2,0),e.mxI("visibleChange",function(l){return e.eBV(s),e.DH7(i.showDialog,l)||(i.showDialog=l),e.Njj(l)}),e.bIt("onHide",function(){return e.eBV(s),e.Njj(i.destroyComponent())}),e.DNE(2,jh,18,2,"ng-template",3)(3,Vh,144,42,"ng-template",4)(4,Uh,3,0,"ng-template",5),e.nrm(5,"p-toast"),e.k0s(),e.j41(6,"p-popover",null,1)(8,"div",6)(9,"span",7),e.EFF(10,"Assign To"),e.k0s(),e.j41(11,"div",8),e.DNE(12,Yh,6,10,"div",9),e.k0s()()()}2&r&&(e.Aen(e.lJ4(5,Ih)),e.R50("visible",i.showDialog),e.Y8G("baseZIndex",1200),e.R7$(12),e.Y8G("ngForOf",i.boardTeamMembers))}
1,dependencies:[q.Sq,q.bT,be.Ei,wt.m_,It.z2,zn.eu,Ie.y8,L.BC,L.cb,L.vS,xe._f,Ve._s,L.j4,Za,Ae.AM,pn.oz,pn.tU,pn.wb,Xr.Sc,ji.ef,pn.T2,pn.Kp,q.vh],styles:[".catergory-clamp[_ngcontent-%COMP%]{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word;font-size:.75rem}.custom-tabs[_ngcontent-%COMP%] .p-tab[_ngcontent-%COMP%]{font-size:.8rem!important;font-weight:400!important;font-family:Inter,sans-serif!important}.custom-tabs[_ngcontent-%COMP%] .p-tablist[_ngcontent-%COMP%]{background:#f8fafc} .custom-tabs .p-tabpanels{padding:.75rem!important} .custom-edit-tender .p-drawer-content{padding:4px!important} .custom-edit-tender .p-drawer-footer{border-top:1px solid #cccc!important} .custom-edit-tender .p-drawer-header{padding:12px!important;background-color:#f0f5fb!important;border-bottom:1px solid #cccc}.description-clamp[_ngcontent-%COMP%]{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;word-break:break-word}.assign-btn[_ngcontent-%COMP%]{border:1px dashed #3b82f6;border-radius:20px;transition:background-color .2s}.assign-btn[_ngcontent-%COMP%]:hover{background-color:#eff6ff!important}.tracking-wider[_ngcontent-%COMP%]{letter-spacing:.05em}"]})}return n})();var Ul=ee(61003);const Hh=()=>({width:"420px"}),zh=()=>({width:"32px",height:"32px"});function qh(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",14)(1,"div",15)(2,"div",16)(3,"div",17)(4,"div",11)(5,"span",18),e.EFF(6),e.k0s(),e.j41(7,"h5",19),e.EFF(8),e.k0s(),e.j41(9,"span",20),e.EFF(10),e.k0s()()()(),e.j41(11,"div",21)(12,"i",22),e.bIt("click",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.handleConfirmation(i,s.ConfirmationActionType.Delete))}),e.k0s(),e.j41(13,"i",23),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.destroyComponent())}),e.k0s()()(),e.j41(14,"div")(15,"div",24)(16,"a",25)(17,"div",26)(18,"div",27)(19,"span",28),e.EFF(20),e.k0s()(),e.j41(21,"div",29)(22,"span",30),e.EFF(23),e.k0s(),e.j41(24,"span",31),e.EFF(25),e.k0s()()(),e.nrm(26,"i",32),e.k0s()(),e.j41(27,"div",33),e.nrm(28,"i",34),e.j41(29,"span"),e.EFF(30),e.nI1(31,"date"),e.k0s()()()()}if(2&n){const t=e.XpG();e.R7$(6),e.SpI(" Captured via ",null==t.selectedCard.CardTags[0]?null:t.selectedCard.CardTags[0].Name," "),e.R7$(2),e.JRh(t.selectedCard.CompanyName),e.R7$(2),e.SpI(" ",t.selectedCard.Title," "),e.R7$(6),e.Y8G("href",t.selectedCard.CompanyWebsite,e.B4B),e.R7$(4),e.SpI(" ",(null==t.selectedCard.CompanyName?null:t.selectedCard.CompanyName[0])||"-"," "),e.R7$(3),e.SpI(" ",t.selectedCard.CompanyName," "),e.R7$(2),e.SpI(" ",t.selectedCard.CompanyWebsite," "),e.R7$(5),e.SpI("Captured ",e.i5U(31,8,t.selectedCard.DateCreatedUtc,"medium"),"")}}function Jh(n,a){if(1&n&&e.nrm(0,"p-avatar",60),2&n){const t=a.$implicit,r=e.XpG(3);e.Y8G("image",t.PictureId?r.IMG_ROUTE+t.PictureId:null)("label",t.PictureId?null:r.getInitials(t.Name))}}function Kh(n,a){if(1&n&&e.nrm(0,"p-avatar",61),2&n){const t=e.XpG(3);e.Y8G("label","+"+(t.getSelectedMembers().length-2))}}function Qh(n,a){if(1&n&&(e.qex(0),e.DNE(1,Jh,1,2,"p-avatar",58),e.nI1(2,"slice"),e.DNE(3,Kh,1,1,"p-avatar",59),e.bVm()),2&n){const t=e.XpG(2);e.R7$(),e.Y8G("ngForOf",e.brH(2,2,t.getSelectedMembers(),0,2)),e.R7$(2),e.Y8G("ngIf",t.getSelectedMembers().length>2)}}function Zh(n,a){1&n&&(e.j41(0,"span",62),e.EFF(1,"\u2014"),e.k0s())}function eg(n,a){1&n&&(e.j41(0,"div",49)(1,"div",63)(2,"div",64),e.nrm(3,"i",65),e.j41(4,"span",66),e.EFF(5,"Loading contacts..."),e.k0s()()()())}function tg(n,a){if(1&n&&(e.j41(0,"div",74)(1,"div",75),e.nrm(2,"i",81),e.k0s(),e.j41(3,"div",77)(4,"span",78),e.EFF(5,"Company"),e.k0s(),e.j41(6,"span",79),e.EFF(7),e.k0s()()()),2&n){const t=e.XpG().$implicit;e.R7$(7),e.JRh(t.CompanyName||t.Company)}}function ng(n,a){if(1&n&&(e.j41(0,"div",69)(1,"div",64)(2,"div",70)(3,"span",71),e.EFF(4),e.k0s()()(),e.j41(5,"div",72),e.DNE(6,tg,8,1,"div",73),e.j41(7,"div",74)(8,"div",75),e.nrm(9,"i",76),e.k0s(),e.j41(10,"div",77)(11,"span",78),e.EFF(12,"Email"),e.k0s(),e.j41(13,"span",79),e.EFF(14),e.k0s()()(),e.j41(15,"div",74)(16,"div",75),e.nrm(17,"i",80),e.k0s(),e.j41(18,"div",77)(19,"span",78),e.EFF(20,"Phone"),e.k0s(),e.j41(21,"span",79),e.EFF(22),e.k0s()()()()()),2&n){const t=a.$implicit,r=e.XpG(4);e.R7$(4),e.SpI(" ",(null==r.getDisplayName?null:r.getDisplayName(t))||t.FirstName," "),e.R7$(2),e.Y8G("ngIf",t.CompanyName||t.Company),e.R7$(8),e.JRh(t.Email||"\u2014"),e.R7$(8),e.JRh(t.PhoneNumber||t.Phone||"\u2014")}}function rg(n,a){if(1&n&&(e.j41(0,"div",49),e.DNE(1,ng,23,4,"div",68),e.k0s()),2&n){const t=e.XpG(3);e.R7$(),e.Y8G("ngForOf",t.Cardcontacts)}}function ig(n,a){if(1&n&&(e.qex(0),e.DNE(1,rg,2,1,"div",67),e.bVm()),2&n){e.XpG();const t=e.sdS(35),r=e.XpG();e.R7$(),e.Y8G("ngIf",r.Cardcontacts&&r.Cardcontacts.length>0)("ngIfElse",t)}}function ag(n,a){1&n&&(e.j41(0,"div",82),e.EFF(1," No linked contacts found for this card. "),e.k0s())}function sg(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",35)(1,"div",36)(2,"div",37),e.nrm(3,"i",38),e.j41(4,"span"),e.EFF(5,"Deal Details"),e.k0s()(),e.j41(6,"div",39)(7,"div",40),e.bIt("click",function(i){e.eBV(t),e.XpG();const s=e.sdS(6);return e.Njj(s.toggle(i))}),e.j41(8,"span",41),e.EFF(9,"Assignee"),e.k0s(),e.j41(10,"div",42),e.DNE(11,Qh,4,6,"ng-container",43)(12,Zh,2,0,"ng-template",null,2,e.C5r),e.k0s()(),e.j41(14,"div",44)(15,"span",41),e.EFF(16,"Value"),e.k0s(),e.nrm(17,"p-inputNumber",45),e.k0s(),e.j41(18,"div",40),e.bIt("click",function(){e.eBV(t);const i=e.sdS(26);return e.Njj(i.toggle())}),e.j41(19,"span",41),e.EFF(20,"Due Date"),e.k0s(),e.j41(21,"div",46)(22,"span",47),e.EFF(23),e.nI1(24,"date"),e.k0s(),e.nrm(25,"p-calendar",48,3),e.k0s()()()(),e.j41(27,"div",49)(28,"div",37),e.nrm(29,"i",50),e.j41(30,"span"),e.EFF(31,"Contact Details"),e.k0s()(),e.DNE(32,eg,6,0,"div",51)(33,
1ig,2,2,"ng-container",52)(34,ag,2,0,"ng-template",null,4,e.C5r),e.k0s(),e.j41(36,"div",53)(37,"div",37),e.nrm(38,"i",54),e.j41(39,"span"),e.EFF(40,"TAGS"),e.k0s()(),e.j41(41,"div",55),e.nrm(42,"p-chip",56)(43,"p-chip",57),e.k0s()()()}if(2&n){let t;const r=e.sdS(13),i=e.XpG();e.R7$(),e.Y8G("formGroup",i.formGroup),e.R7$(10),e.Y8G("ngIf",i.getSelectedMembers().length>0)("ngIfElse",r),e.R7$(6),e.Y8G("currency",i.currencyCode),e.R7$(6),e.SpI(" ",null!=(t=i.formGroup.get("DueDateUtc"))&&t.value?e.i5U(24,8,null==(t=i.formGroup.get("DueDateUtc"))?null:t.value,"shortDate"):"\u2014"," "),e.R7$(2),e.Y8G("appendTo","body"),e.R7$(7),e.Y8G("ngIf",i.isLoadingContacts),e.R7$(),e.Y8G("ngIf",!i.isLoadingContacts)}}function og(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",83)(1,"button",84),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.destroyComponent())}),e.k0s(),e.j41(2,"button",85),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onSubmit())}),e.k0s()()}}function lg(n,a){1&n&&e.nrm(0,"i",90)}function cg(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",86),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG();return e.Njj(s.selectUser(i))}),e.j41(1,"div",74),e.nrm(2,"p-avatar",87),e.j41(3,"span",88),e.EFF(4),e.k0s()(),e.DNE(5,lg,1,0,"i",89),e.k0s()}if(2&n){const t=a.$implicit,r=e.XpG();e.R7$(2),e.Aen(e.lJ4(9,zh)),e.Y8G("image",t.PictureId?r.IMG_ROUTE+t.PictureId:null)("label",t.PictureId?null:r.getInitials(t.Name))("styleClass",r.isUserSelected(t.Id)?"bg-blue-500 text-white":"bg-orange-500 text-white"),e.R7$(),e.AVh("font-bold",r.isUserSelected(t.Id)),e.R7$(),e.SpI(" ",t.Name," "),e.R7$(),e.Y8G("ngIf",r.isUserSelected(t.Id))}}let dg=(()=>{class n{teamsService;_boardService;selectedCard;showDialog=!1;formGroup;boardTeamMembers;submitClicked=new e.bkB;close=new e.bkB;IMG_ROUTE=`${Xt.c.apiUrl}/api/storage/image/`;handleConfirmation;ConfirmationActionType=J.ON;currencyCode="ZAR";Cardcontacts=[];activeContact=null;isLoadingContacts=!1;constructor(t,r){this.teamsService=t,this._boardService=r,this.currencyCode=this.teamsService.currencyCode}ngOnInit(){this.loadLinkedContacts()}onSubmit(){this.submitClicked.emit()}destroyComponent(){this.close.emit()}selectUser(t){const r=this.formGroup.get("AssignedUserIds")?.value||[];let i;i=r.includes(t.Id)?r.filter(s=>s!==t.Id):[...r,t.Id],this.formGroup.get("AssignedUserIds")?.setValue(i)}syncAssignedIds(t){const r=t.map(i=>{const s=this.boardTeamMembers.find(o=>o.Name===i);return s?s.Id:null}).filter(i=>null!==i);this.formGroup.get("AssignedUserIds")?.setValue(r)}isUserSelected(t){return(this.formGroup.get("AssignedUserIds")?.value||[]).includes(t)}getInitials(t){return t?t.split(" ").map(r=>r[0]).join("").toUpperCase().substring(0,2):""}getSelectedMembers(){const t=this.formGroup.get("AssignedUserIds")?.value||[];return this.boardTeamMembers.filter(r=>t.includes(r.Id))}loadLinkedContacts(){this.isLoadingContacts=!0,this._boardService.getLinkedContacts(this.selectedCard?.Id).subscribe({next:t=>{this.Cardcontacts=t,this.activeContact=t&&t.length>0?t[0]:null,this.isLoadingContacts=!1},error:t=>{console.error("Error fetching contacts",t),this.isLoadingContacts=!1}})}getInitialss(t){const r=t.FirstName?.trim()||"",i=t.LastName?.trim()||"";return r||i?`${r.charAt(0)}${i.charAt(0)}`.toUpperCase():t.Email?t.Email.charAt(0).toUpperCase():"?"}getDisplayName(t){return`${t.FirstName||""} ${t.LastName||""}`.trim()||t.Email||"Unnamed Contact"}static \u0275fac=function(r){return new(r||n)(e.rXU(rt.n),e.rXU(_t.a))};static \u0275cmp=e.VBU({type:n,selectors:[["app-edit-chrome-extension-card"]],inputs:{selectedCard:"selectedCard",showDialog:"showDialog",formGroup:"formGroup",boardTeamMembers:"boardTeamMembers",handleConfirmation:"handleConfirmation"},outputs:{submitClicked:"submitClicked",close:"close"},standalone:!1,decls:13,vars:7,consts:[["eventSideBar",""],["op",""],["noAssignee",""],["datePicker",""],["emptyState",""],["position","right","styleClass","custom-chromeExtension-card p-0 h-full border-none flex flex-column",3,"visibleChange","onHide","visible","baseZIndex","showCloseIcon"],["pTemplate","header"],["pTemplate","Content"],["pTemplate","footer"],[1,"flex","flex-column","w-15rem"],[1,"text-xs","font-bold","text-500","mb-3","px-2","uppercase"],[1,"flex","flex-column","gap-1"],["class","flex align-items-center justify-content-between p-2 hover:surface-100 border-round cursor-pointer",3,"click",4,"ngFor","ngForOf"],["position","top-right","styleClass","on-top-toast"],[1,"w-full"],[1,"w-full","flex","flex-row","justify-content-between","align-items-start","mb-2"],[1,"flex","align-items-center","gap-2"],[1,"div1","flex","flex-column"],[1,"text-xs","text-blue-500","tracking-wide","uppercase"],[1,"m-0","text-lg","font-bold","text-800","line-height-1"],[1,"text-xs","text-500","font-normal"],[1,"flex","gap-3","z-1","flex","justify-content-start","align-content-center"],["pTooltip","Delete",1,"pi","pi-trash","cursor-pointer",3,"click"],["pTooltip","Close",1,"pi","pi-times","cursor-pointer",3,"click"],[1,"py-2"],["target","_blank",1,"relative","flex","items-center","justify-between","p-2","border-1","border-200","border-round","bg-white","no-underline","hover:bg-gray-50","transition-colors",3,"href"],[1,"flex","items-center","gap-3","overflow-hidden","pr-4"],[1,"w-2rem","h-2rem","border-round-md","bg-red-700","text-white","font-bold","text-sm","flex-shrink-0","uppercase",2,"display","flex !important","align-items","center !important","justify-content","center !important","overflow","hidden","padding","0 !important","margin","0 !important"],[2,"display","block !important","line-height","1 !important","padding","0 !important","margin","0 !important"],[1,"flex","flex-column","overflow-hidden"],[1,"font-semibold","text-xs","text-800","line-height-1"],[1,"text-xs","text-500","font-normal","text-overflow-ellipsis","overflow-hidden","white-space-nowrap","max-w-18rem","mt-1"],[1,"pi","pi-external-link","text-400","text-xs",2,"position","absolute","top","8px","right","8px"],[1,"text-xs","text-500","font-normal","flex","align-items-center","gap-2","px-1","mt-2"],[1,"pi","pi-clock","text-400","text-xs"],[1,"flex-1","overflow-y-auto","flex","flex-column","gap-4"],[1,"flex","flex-column","gap-2",3,"formGroup"],[1,"text-xs","font-normal","text-500","uppercase","tracking-wider","flex","align-items-center","gap-2","px-1","text-slate-500"],[1,"pi","pi-dollar","text-xs"],[1,"flex","gap-2","w-full"],[1,"flex-1","border-1","border-200","border-round","bg-white","p-2","flex","flex-column","justify-between","min-h-5rem","cursor-pointer","hover:border-blue-500","transition-colors",3,"click"],[1,"text-xs","text-500","uppercase","tracking-tight"],[1,"flex","items-center","gap-1","flex-wrap"],[4,"ngIf","ngIfElse"],[1,"flex-1","border-1","border-200","border-round","bg-white","p-2","flex","flex-column","justify-between","min-h-5rem"],["formControlName","Amount","mode","currency","locale","en-US","placeholder","\u2014","styleClass","w-full","inputStyleClass","w-full text-xl font-normal text-700 border-none p-0 focus:shadow-none bg-transparent raw-input",3,"currency"],[1,"flex","items-center","gap-2","text-400","relative"],[1,"text-sm","font-normal","text-700","line-height-1","mt-2"],["formControlName","DueDateUtc","styleClass","absolute opacity-0 text-xs pointer-events-none w-0 h-0",3,"appendTo"],[1,"flex","flex-column","gap-3"],[1,"pi","pi-user","text-xs"],["class","flex flex-column gap-3",4,"ngIf"],[4,"ngIf"],[1,"flex","flex-column","gap-2"],[1,"pi","pi-tag","text-xs"],[1,"flex","flex-wrap","gap-2"],["label","Chrome Extension","styleClass","bg-blue-50 text-blue-600 font-medium px-3 py-1 text-sm border-round-3xl"],["label","Auto-Created","styleClass","bg-gray-100 text-slate-600 font-medium px-3 py-1 text-sm border-round-3xl"],["shape","circle","styleClass","bg-blue-500 text-white text-xs font-bold w-2rem h-2rem",3,"image","label",4,"ngFor","ngForOf"],["shape","circle","styleClass","bg-slate-200 text-slate-700 text-xs font-bold w-2rem h-2rem",3,"label",4,"ngIf"],["shape","circle","styleClass","bg-blue-500 text-white text-xs font-bold w-2rem h-2rem",3,"image","label"],["shape","circle","styleClass","bg-slate-200 text-slate-700 text-xs font-bold w-2rem h-2rem",3,"label"],[1,"text-xl","font-normal","text-400"],[1,"p-3","border-1","border-200","border-round-xl","bg-gray-50/30","flex","flex-column","gap-3"],[1,"flex","justify-content-between","align-items-center"],[1,"pi","pi-spin","pi-spinner","text-400","text-sm","mr-2"],[1,"text-sm","text-400","flex-grow-1"],["class","flex flex-column gap-3",4,"ngIf","ngIfElse"],["class","p-3 border-1 border-200 border-round bg-white border-round-xl bg-gray-50/30 flex flex-column gap-3",4,"ngFor","ngForOf"],[1,"p-3","border-1","border-200","border-round","bg-white","border-round-xl","bg-gray-50/30","flex","flex-column","gap-3"],[1,"flex","align-items-center","gap-2","flex-wrap"],[1,"text-sm","text-800"],[1,"flex","flex-column","gap-3","pl-1"],["class","flex align-items-center gap-3",4,"ngIf"],[1,"flex","align-items-center","gap-3"],[1,"flex","align-items-center","justify-content-center","border-round",2,"width","32px","height","32px","background-color","#f1f3f5","border-radius","6px"],[1,"pi","pi-envelope","text-400","text-sm"],[1,"flex","flex-column"],[1,"text-xxs","text-400","uppercase","tracking-wider",2,"font-size","0.6rem","color","#8c8c8c"],[1,"text-sm","font-medium","text-700","mt-0.5"],[1,"pi","pi-phone","text-400","text-sm"],[1,"pi","pi-building","text-400","text-sm"],[1,"text-center","py-5","text-500","text-sm"],[1,"flex","justify-content-end","gap-2"],["pButton","","type","button","label","Cancel","icon","pi pi-times-circle",1,"p-button-outlined","rounded-pill","px-4",3,"click"],["pButton","","type","button","label","Update","icon","pi pi-check-circle",1,"p-button-rounded","px-4",3,"click"],[1,"flex","align-items-center","justify-content-between","p-2","hover:surface-100","border-round","cursor-pointer",3,"click"],["shape","circle",3,"image","label","styleClass"],[1,"text-900","text-sm"],["class","pi pi-check text-blue-500 text-xs mr-2",4,"ngIf"],[1,"pi","pi-check","text-blue-500","text-xs","mr-2"]],template:function(r,i){if(1&r){const s=e.RV6();e.j41(0,"p-drawer",5,0),e.mxI("visibleChange",function(l){return e.eBV(s),e.DH7(i.showDialog,l)||(i.showDialog=l),e.Njj(l)}),e.bIt("onHide",function(){return e.eBV(s),e.Njj(i.destroyComponent())}),e.DNE(2,qh,32,11,"ng-template",6)(3,sg,44,11,"ng-template",7)(4,og,3,0,"ng-template",8),e.k0s(),e.j41(5,"p-popover",null,1)(7,"div",9)(8,"span",10),e.EFF(9,"Assign To"),e.k0s(),e.j41(10,"div",11),e.DNE(11,cg,6,10,"div",12),e.k0s()()(),e.nrm(12,"p-toast",13)}2&r&&(e.Aen(e.lJ4(6,Hh)),e.R50("visible",i.showDialog),e.Y8G("baseZIndex",1200)("showCloseIcon",!1),e.R7$(11),e.Y8G("ngForOf",i.boardTeamMembers))}
1,dependencies:[q.Sq,q.bT,be.Ei,wt.m_,zn.eu,Ie.y8,L.BC,L.cb,xe._f,Ve._s,qa.vu,L.j4,L.JD,Ul.Vv,Ae.AM,vt.YI,q.P9,q.vh],styles:[".custom-chromeExtension-card .p-drawer-content{padding:14px!important;background-color:#f8fafc!important} .custom-chromeExtension-card .p-drawer-footer{border-top:1px solid #cccc!important} .custom-chromeExtension-card .p-drawer-header{padding:14px!important;border-bottom:1px solid #cccc}"]})}return n})();const pg=["fu"],ug=()=>({width:"420px"}),fg=()=>({width:"28px",height:"28px"}),mg=()=>({height:"150px"});function hg(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",24)(1,"div",25)(2,"div",26)(3,"div",27),e.nrm(4,"i",28),e.j41(5,"span"),e.EFF(6),e.nI1(7,"date"),e.k0s()()(),e.j41(8,"div",29)(9,"i",30),e.bIt("click",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.handleConfirmation(i,s.ConfirmationActionType.Delete))}),e.k0s(),e.j41(10,"i",31),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.destroyComponet())}),e.k0s()()(),e.j41(11,"div",32)(12,"div",33),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.selectTab("info"))}),e.nrm(13,"i",34),e.j41(14,"span",35),e.EFF(15,"Deal Info"),e.k0s()(),e.j41(16,"div",33),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.selectTab("description"))}),e.nrm(17,"i",36),e.j41(18,"span",37),e.EFF(19,"Description"),e.k0s()(),e.j41(20,"div",33),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.selectTab("notes"))}),e.nrm(21,"i",38),e.j41(22,"span",37),e.EFF(23,"Notes"),e.k0s()(),e.j41(24,"div",33),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.selectTab("attachments"))}),e.nrm(25,"i",39),e.j41(26,"span",37),e.EFF(27,"Attachments"),e.k0s()()()()}if(2&n){const t=e.XpG(2);e.R7$(6),e.SpI("Created on: ",e.i5U(7,9,t.selectedCard.DateCreatedUtc,"mediumDate"),""),e.R7$(6),e.Y8G("ngClass","info"===t.activeTab?"bg-white text-gray-800":"text-gray-500 hover:bg-white-alpha-50"),e.R7$(),e.Y8G("ngClass","info"===t.activeTab?"text-gray-700":"text-gray-400"),e.R7$(3),e.Y8G("ngClass","description"===t.activeTab?"bg-white shadow-1 text-gray-800":"text-gray-500 hover:bg-white-alpha-50"),e.R7$(),e.Y8G("ngClass","description"===t.activeTab?"text-gray-700":"text-gray-400"),e.R7$(3),e.Y8G("ngClass","notes"===t.activeTab?"bg-white shadow-1 text-gray-800":"text-gray-500 hover:bg-white-alpha-50"),e.R7$(),e.Y8G("ngClass","notes"===t.activeTab?"text-gray-700":"text-gray-400"),e.R7$(3),e.Y8G("ngClass","attachments"===t.activeTab?"bg-white shadow-1 text-gray-800":"text-gray-500 hover:bg-white-alpha-50"),e.R7$(),e.Y8G("ngClass","attachments"===t.activeTab?"text-gray-700":"text-gray-400")}}function gg(n,a){if(1&n&&(e.j41(0,"span",67),e.EFF(1),e.k0s()),2&n){const t=e.XpG(2).$implicit;e.R7$(),e.SpI(" +",t.length-1," ")}}function _g(n,a){if(1&n&&(e.qex(0),e.j41(1,"span"),e.EFF(2),e.k0s(),e.DNE(3,gg,2,1,"span",66),e.bVm()),2&n){const t=e.XpG().$implicit,r=e.XpG(4);e.R7$(2),e.JRh(r.getMemberName(t[0])),e.R7$(),e.Y8G("ngIf",t.length>1)}}function xg(n,a){if(1&n&&(e.j41(0,"div",65),e.DNE(1,_g,4,2,"ng-container",41),e.k0s()),2&n){const t=a.$implicit;e.R7$(),e.Y8G("ngIf",t&&t.length>0)}}function vg(n,a){if(1&n&&(e.j41(0,"div",16),e.nrm(1,"p-avatar",68),e.j41(2,"span"),e.EFF(3),e.k0s()()),2&n){const t=a.$implicit,r=e.XpG(4);e.R7$(),e.Aen(e.lJ4(5,fg)),e.Y8G("image",t.PictureId?r.IMG_ROUTE+t.PictureId:null)("icon",t.PictureId?null:"pi pi-user"),e.R7$(2),e.JRh(t.Name)}}function bg(n,a){if(1&n&&(e.nrm(0,"input",75),e.nI1(1,"lowercase")),2&n){let t;const r=e.XpG().$implicit;e.Y8G("placeholder","Enter "+e.bMT(1,1,null==(t=r.get("Title"))?null:t.value))}}function Cg(n,a){1&n&&e.nrm(0,"input",76)}function kg(n,a){1&n&&e.nrm(0,"input",77)}function Tg(n,a){if(1&n&&(e.nrm(0,"p-inputnumber",78),e.nI1(1,"lowercase")),2&n){let t;const r=e.XpG().$implicit;e.Y8G("placeholder","Enter "+e.bMT(1,1,null==(t=r.get("Title"))?null:t.value))}}function wg(n,a){1&n&&e.nrm(0,"p-datepicker",79)}function yg(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",57)(1,"div",69)(2,"div",70),e.EFF(3),e.k0s(),e.j41(4,"div",71),e.nrm(5,"p-select",72),e.k0s(),e.j41(6,"button",73),e.bIt("click",function(){const i=e.eBV(t).$index,s=e.XpG(4);return e.Njj(s.removeField(i))}),e.nrm(7,"i",74),e.k0s()(),e.j41(8,"div"),e.DNE(9,bg,2,3,"input",75)(10,Cg,1,0,"input",76)(11,kg,1,0,"input",77)(12,Tg,2,3,"p-inputnumber",78)(13,wg,1,0,"p-datepicker",79),e.k0s()()}if(2&n){let t,r,i,s,o,l;const c=a.$implicit,d=e.XpG(4);e.Y8G("formGroup",c),e.R7$(3),e.SpI(" ",null==(t=c.get("Title"))?null:t.value," "),e.R7$(2),e.Y8G("options",d.fieldTypeOptions),e.R7$(4),e.vxM(1===(null==(r=c.get("Type"))?null:r.value)||5===(null==(r=c.get("Type"))?null:r.value)?9:-1),e.R7$(),e.vxM(6===(null==(i=c.get("Type"))?null:i.value)?10:-1),e.R7$(),e.vxM(4===(null==(s=c.get("Type"))?null:s.value)?11:-1),e.R7$(),e.vxM(2===(null==(o=c.get("Type"))?null:o.value)?12:-1),e.R7$(),e.vxM(3===(null==(l=c.get("Type"))?null:l.value)?13:-1)}}function Fg(n,a){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"div",42)(2,"div",43)(3,"div",44)(4,"label",45),e.EFF(5," Title "),e.j41(6,"span",46),e.EFF(7,"*"),e.k0s()(),e.nrm(8,"input",47),e.k0s(),e.j41(9,"div",44)(10,"label",45),e.EFF(11," Amount "),e.k0s(),e.nrm(12,"input",48),e.k0s()(),e.j41(13,"div",43)(14,"div",44)(15,"label",45),e.EFF(16," Type "),e.k0s(),e.nrm(17,"p-select",49),e.k0s(),e.j41(18,"div",44)(19,"label",45),e.EFF(20," Source "),e.k0s(),e.nrm(21,"p-select",50),e.k0s()(),e.j41(22,"div",43)(23,"div",44)(24,"label",45),e.EFF(25," Assignee "),e.j41(26,"span",46),e.EFF(27,"*"),e.k0s()(),e.j41(28,"p-multiSelect",51),e.DNE(29,xg,2,1,"ng-template",52)(30,vg,4,6,"ng-template",53),e.k0s()(),e.j41(31,"div",44)(32,"label",45),e.EFF(33," Due Date"),e.k0s(),e.nrm(34,"p-datepicker",54),e.k0s()()(),e.j41(35,"div",55)(36,"div",56)(37,"span"),e.EFF(38,"Custom Fields"),e.k0s()(),e.Z7z(39,yg,14,8,"div",57,e.fX1),e.k0s(),e.j41(41,"div",58)(42,"button",59),e.bIt("click",function(i){e.eBV(t),e.XpG(3);const s=e.sdS(8);return e.Njj(s.toggle(i))}),e.nrm(43,"i",60),e.EFF(44," Add custom field "),e.k0s()(),e.nrm(45,"hr",61)(46,"app-card-contacts",62),e.j41(47,"div",63)(48,"app-lead-qualifier",64),e.bIt("onComplete",function(i){e.eBV(t);const s=e.XpG(3);return e.Njj(s.handleQualification(i))}),e.k0s()(),e.bVm()}if(2&n){const t=e.XpG(3);e.R7$(17),e.Y8G("options",t.opportunityTypes)("appendTo","body"),e.R7$(4),e.Y8G("options",t.sources)("appendTo","body"),e.R7$(7),e.Y8G("options",t.boardTeamMembers)("styleClass","w-full border-200 border-round-lg min-h-3rem flex align-items-center")("appendTo","body"),e.R7$(6),e.Y8G("showIcon",!0)("appendTo","body"),e.R7$(5),e.Dyx(t.customFieldsArray.controls),e.R7$(7),e.Y8G("selectedCard",t.selectedCard),e.R7$(2),e.Y8G("selectedCard",t.selectedCard)}}function Sg(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",85),e.bIt("click",function(){e.eBV(t);const i=e.XpG(4);return e.Njj(i.onEditDescription())}),e.nrm(1,"div",86)(2,"i",87),e.k0s()}if(2&n){let t;const r=e.XpG(4);e.R7$(),e.Y8G("innerHTML",(null==(t=r.formGroup.get("Description"))?null:t.value)||"<span class='text-400'>Click to add description</span>",e.npT)}}function Eg(n,a){1&n&&(e.j41(0,"span",90),e.nrm(1,"button",91)(2,"button",92),e.k0s(),e.j41(3,"span",90),e.nrm(4,"button",93)(5,"button",94),e.k0s())}function Ig(n,a){1&n&&(e.j41(0,"div",88)(1,"p-editor",89),e.DNE(2,Eg,6,0,"ng-template",21),e.k0s()()),2&n&&(e.R7$(),e.Aen(e.lJ4(2,mg)))}function Dg(n,a){if(1&n&&(e.qex(0),e.j41(1,"div",58)(2,"div",80)(3,"div",81),e.EFF(4,"Description"),e.k0s(),e.DNE(5,Sg,3,1,"div",82)(6,Ig,3,3,"div",83),e.k0s(),e.nrm(7,"app-tags-drawer",84),e.k0s(),e.bVm()),2&n){const t=e.XpG(3);e.R7$(5),e.Y8G("ngIf",!t.showDescriptionEditor),e.R7$(),e.Y8G("ngIf",t.showDescriptionEditor),e.R7$(),e.Y8G("selectedCard",t.selectedCard)("formGroup",t.formGroup)}}function Rg(n,a){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"div",95)(2,"button",96),e.bIt("click",function(i){e.eBV(t);const s=e.XpG(3);return i.stopPropagation(),e.Njj(s.openNotes("notes"))}),e.nrm(3,"i",97),e.j41(4,"span",98),e.EFF(5),e.k0s()(),e.j41(6,"button",96),e.bIt("click",function(i){e.eBV(t);const s=e.XpG(3);return i.stopPropagation(),e.Njj(s.openNotes("followups"))}),e.nrm(7,"i",99),e.j41(8,"span",98),e.EFF(9,"Follow Ups"),e.k0s()()(),e.j41(10,"div",100)(11,"p",101),e.EFF(12," Capture all information for the deal and follow-ups. Use this space to log conversations, reminders, and next steps. "),e.k0s()(),e.bVm()}if(2&n){const t=e.XpG(3);e.R7$(2),e.Y8G("ngClass","notes"===t.notesTab?"bg-white shadow-1 text-900":"bg-transparent text-500 hover:surface-100"),e.R7$(3),e.SpI("Notes (",null==t.selectedCard?null:t.selectedCard.NotesCount,")"),e.R7$(),e.Y8G("ngClass","followups"===t.notesTab?"bg-white shadow-1 text-900":"bg-transparent text-500 hover:surface-100")}}function jg(n,a){1&n&&(e.j41(0,"div",121),e.nrm(1,"i",122),e.k0s())}function Ag(n,a){if(1&n&&(e.j41(0,"div"),e.nrm(1,"i"),e.k0s()),2&n){const t=e.XpG().$implicit,r=e.XpG(5);e.HbH(r.getFileIconContainerClass(t.contentType)),e.R7$(),e.HbH(r.getFileIcon(t.contentType))}}function Mg(n,a){1&n&&(e.j41(0,"span"),e.EFF(1,"\u2022 Uploading..."),e.k0s())}function Pg(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",111)(1,"div",112),e.DNE(2,jg,2,0,"div",113)(3,Ag,2,4,"div",114),e.j41(4,"div",115)(5,"span",116),e.EFF(6),e.k0s(),e.j41(7,"small",117),e.EFF(8),e.DNE(9,Mg,2,0,"span",41),e.k0s()()(),e.j41(10,"div",118)(11,"button",119),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG(5);return e.Njj(s.downloadFile(i))}),e.k0s(),e.j41(12,"button",120),e.bIt("click",function(){const i=e.eBV(t).index,s=e.XpG(5);return e.Njj(s.removeFile(i))}),e.k0s()()()}if(2&n){const t=a.$implicit;e.R7$(2),e.Y8G("ngIf",t.loading),e.R7$(),e.Y8G("ngIf",!t.loading),e.R7$(3),e.JRh(t.name),e.R7$(2),e.SpI(" ",t.size," "),e.R7$(),e.Y8G("ngIf",t.loading),e.R7$(2),e.Y8G("loading",t.loading),e.R7$(),e.Y8G("disabled",t.loading)}}function Og(n,a){if(1&n&&(e.j41(0,"div",108)(1,"span",109),e.EFF(2),e.k0s(),e.DNE(3,Pg,13,7,"div",110),e.k0s()),2&n){const t=e.XpG(4);e.R7$(2),e.SpI(" ",t.uploadedFiles.length," File(s) attached "),e.R7$(),e.Y8G("ngForOf",t.uploadedFiles)}}function Ng(n,a){1&n&&(e.j41(0,"div",123),e.nrm(1,"i",124),e.j41(2,"p",125),e.EFF(3,"No files attached to this deal yet."),e.k0s()())}function Gg(n,a){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"div",102)(2,"div",103)(3,"span",104),e.EFF(4,"Attachments"),e.k0s(),e.j41(5,"p-fileUpload",105),e.bIt("uploadHandler",function(i){e.eBV(t);const s=e.XpG(3);return e.Njj(s.uploadFile(i))}),e.k0s()(),e.DNE(6,Og,4,2,"div",106)(7,Ng,4,0,"div",107),e.k0s(),e.bVm()}if(2&n){const t=e.XpG(3);e.R7$(5),e.Y8G("customUpload",!0)("auto",!0),e.R7$(),e.Y8G("ngIf",t.uploadedFiles.length>0),e.R7$(),e.Y8G("ngIf",0===t.uploadedFiles.length)}}function Bg(n,a){if(1&n){const t=e.RV6();e.j41(0,"form",40),e.bIt("ngSubmit",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.onSubmit())}),e.DNE(1,Fg,49,11,"ng-container",41)(2,Dg,8,4,"ng-container",41)(3,Rg,13,3,"ng-container",41)(4,Gg,8,4,"ng-container",41),e.k0s()}if(2&n){const t=e.XpG(2);e.Y8G("formGroup",t.formGroup),e.R7$(),e.Y8G("ngIf","info"===t.activeTab),e.R7$(),e.Y8G("ngIf","description"===t.activeTab),e.R7$(),e.Y8G("ngIf","notes"===t.activeTab),e.R7$(),e.Y8G("ngIf","attachments"===t.activeTab)}}function Lg(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",126)(1,"button",127),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.destroyComponet())}),e.k0s(),e.j41(2,"button",128),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.onSubmit())}),e.k0s()()}}function $g(n,a){if(1&n){const t=e.RV6();e.j41(0,"p-drawer",20,1),e.mxI("visibleChange",function(i){e.eBV(t);const s=e.XpG();return e.DH7(s.showDialog,i)||(s.showDialog=i),e.Njj(i)}),e.bIt("onHide",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.destroyComponet())}),e.DNE(2,hg,28,12,"ng-template",21)(3,Bg,5,5,"ng-template",22)(4,Lg,3,0,"ng-template",23),e.nrm(5,"p-toast"),e.k0s()}if(2&n){const t=e.XpG();e.Aen(e.lJ4(4,ug)),e.R50("visible",t.showDialog),e.Y8G("baseZIndex",1200)}}function Vg(n,a){if(1&n){const t=e.RV6();e.j41(0,"app-form-response-card",129),e.bIt("close",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.showDialog=!1)}
1)("deleteCardEvent",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.archiveCard())})("submitClicked",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onSubmit())}),e.k0s()}if(2&n){const t=e.XpG();e.Y8G("selectedCard",t.selectedCard)("cardResponse",t.cardResponse)("source","sales")("formGroup",t.formGroup)("boardTeamMembers",t.boardTeamMembers)}}function Ug(n,a){if(1&n){const t=e.RV6();e.j41(0,"app-tender-deal-view",130),e.bIt("submitClicked",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onSubmit())})("close",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.showDialog=!1)})("onDownloadFile",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.downloadFile(i))}),e.k0s()}if(2&n){const t=e.XpG();e.Y8G("selectedCard",t.selectedCard)("showDialog",t.showDialog)("formGroup",t.formGroup)("boardTeamMembers",t.boardTeamMembers)("handleConfirmation",t.handleConfirmation.bind(t))}}function Xg(n,a){if(1&n){const t=e.RV6();e.j41(0,"app-edit-messenger-deal",131),e.bIt("close",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.showDialog=!1)})("submitClicked",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onSubmit())}),e.k0s()}if(2&n){const t=e.XpG();e.Y8G("selectedCard",t.selectedCard)("showDialog",t.showDialog)("handleConfirmation",t.handleConfirmation.bind(t))("boardTeamMembers",t.boardTeamMembers)("formGroup",t.formGroup)}}function Yg(n,a){if(1&n){const t=e.RV6();e.j41(0,"app-edit-chrome-extension-card",131),e.bIt("close",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.showDialog=!1)})("submitClicked",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onSubmit())}),e.k0s()}if(2&n){const t=e.XpG();e.Y8G("selectedCard",t.selectedCard)("showDialog",t.showDialog)("handleConfirmation",t.handleConfirmation.bind(t))("boardTeamMembers",t.boardTeamMembers)("formGroup",t.formGroup)}}function Wg(n,a){if(1&n){const t=e.RV6();e.j41(0,"app-edit-email-deal",132),e.bIt("close",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.showDialog=!1)})("submitClicked",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onSubmit())}),e.k0s()}if(2&n){const t=e.XpG();e.Y8G("selectedCard",t.selectedCard)("showDialog",t.showDialog)("boardTeamMembers",t.boardTeamMembers)("handleConfirmation",t.handleConfirmation.bind(t))("formGroup",t.formGroup)("contacts",t.contacts)("sources",t.sources)}}function Hg(n,a){if(1&n){const t=e.RV6();e.j41(0,"app-deal-notes",133),e.mxI("visibleChange",function(i){e.eBV(t);const s=e.XpG();return e.DH7(s.showNotesDrawer,i)||(s.showNotesDrawer=i),e.Njj(i)}),e.bIt("onClose",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.closeNotesDrawer())}),e.k0s()}if(2&n){const t=e.XpG();e.R50("visible",t.showNotesDrawer),e.Y8G("card",t.selectedCard)("initialTab",t.notesTab)}}function zg(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",134),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG(),o=e.sdS(8);return e.Njj(s.addSuggestedField(i,o))}),e.EFF(1),e.k0s()}if(2&n){const t=a.$implicit;e.R7$(),e.SpI(" + ",t," ")}}let qg=(()=>{class n{_boardService;confirmationService;teamService;contactService;formBuilder;messageService;content;store;formApiService;formGroup;followUpForm;edit=!1;selectedCard;isLoading=!0;fileUpload;closeSlider=new e.bkB;userAssignedEvent=new e.bkB;cardArchived=new e.bkB;cardClosed=new e.bkB;moveCard=new e.bkB;getFileIcon=at.I3;getFileIconContainerClass=at.Tp;IMG_ROUTE=`${Xt.c.apiUrl}/api/storage/image/`;ConfirmationActionType=J.ON;showDialog=!1;showFormResponseDialog=!1;showDescriptionEditor=!1;richTextValue;selectedFileId;showFollowUpForm=!1;boardUsers$;OpportunityStatusEnum=J.t4;sources=[];showColors=!1;cardResponse;boardTeamMembers;isFormChanged=!1;pendingStage=null;selectedColor=null;LOAD_STATE=J.nC;displayCloseOpportunity=!1;stageTitle="";currencyCode="ZAR";isDownloading=!1;contacts=[];selectedTagIds;featureKey="sales_tracker";uploadedFiles=[];fileIds=[];activeTab="info";notesTab="notes";showNotesDrawer=!1;opportunityTypes=[{label:"Inbound",value:!0},{label:"Outbound",value:!1}];CardType=J.bU;newFieldName="";newFieldType=1;suggestedFields=["Address","Start Date","Contract End Date","Company Website","LinkedIn","Phone","Industry","Region","Contract Length","Decision Maker","Budget Confirmed","Next Steps","Renewal Date","Deal Reference"];fieldTypeOptions=[{label:"Text",value:1},{label:"Number",value:2},{label:"Date",value:3},{label:"URL",value:4},{label:"Address",value:5},{label:"Email",value:6}];constructor(t,r,i,s,o,l,c,d,p){this._boardService=t,this.confirmationService=r,this.teamService=i,this.contactService=s,this.formBuilder=o,this.messageService=l,this.content=c,this.store=d,this.formApiService=p,this._boardService.board$.subscribe(u=>{u&&(this.store.dispatch((0,Nl.R)({board:u})),this.boardUsers$=this.store.select("board"),this.boardUsers$.subscribe({next:f=>{this.boardTeamMembers=f.BoardUsers}}))}),this.currencyCode=this.teamService.currencyCode}ngOnInit(){const t=this.selectedCard??null;
1this.selectedCard.FormResponseId?this.showFormResponseDialog=!0:this.showDialog=!0,this.selectedCard&&this.selectedCard.FormResponseId&&this.formApiService.getFormResponseById(this.selectedCard?.FormResponseId).subscribe(s=>{this.cardResponse=s.Data[0]});const i=this.formBuilder.array((t?.CardCustomFields||[]).map(s=>this.formBuilder.group({Id:[s.Id],CardId:[s.CardId],Title:[s.Title],Type:[s.Type],Value:[s.Value]})));this.formGroup=this.formBuilder.group({Title:t&&t.Title?t.Title:"",AssignedUserIds:[t&&void 0!==t.AssignedUserIds&&t.AssignedUserIds,[L.k0.required,L.k0.minLength(1)]],Amount:t&&t.Amount?t.Amount:0,DealLossId:t&&t.DealLossId?t.DealLossId:null,CardTags:[t?.CardTags?.map(s=>s.Id)??[]],OpportunitySource:t&&t.OpportunitySource,OpportunitySourceId:t&&t.OpportunitySourceId,StartDateUtc:[t?.StartDateUtc?new Date(t.StartDateUtc):null],DueDateUtc:[t?.DueDateUtc?new Date(t.DueDateUtc):null],AssignedUsers:[t&&t.AssignedUsers],Description:t&&t.Description,Priority:[t.Priority],PriorityId:[t.PriorityId],OpportunityType:[t&&t.OpportunityType],AttachmentFile:[t&&t.AttachmentFile],CardCustomFields:i}),this._boardService.getOpportunitySources().subscribe(s=>{this.sources=s.map((o,l)=>({...o,value:o.sourceId??l+1,label:o.label}))}),this.initializeFiles(),this.formGroup.valueChanges.subscribe(()=>{this.isFormChanged=!0})}destroyComponet(){(!this.isFormChanged||confirm("You have unsaved changes. Are you sure you want to close without saving?"))&&(this.showDialog=!1,this.showFormResponseDialog=!1,this.isFormChanged=!1,this.closeSlider.emit())}confirmationDialog(t,r,i,s,o,l){this.confirmationService.confirm({target:t.target,message:r,header:i,acceptLabel:s,icon:"pi pi-exclamation-triangle",acceptIcon:"none",rejectIcon:"none",rejectButtonStyleClass:"p-button-text",accept:()=>o(),reject:()=>{l&&l()}})}handleConfirmation(t,r){let i="",s="",o="",l=()=>{},c=()=>{};switch(r){case J.ON.Delete:i="Are you sure you want to Delete?",s="Delete Confirmation",o="Delete",l=()=>this.archiveCard(),c=()=>this.messageService.add({severity:"warn",summary:"Cancelled",detail:"Delete cancelled"});break;case J.ON.Confirmation:i="This card is in a final stage. Do you want to reopen it?",s="Confirm Action",o="Confirm",l=()=>this.reopenOpportunity(),c=()=>this.messageService.add({severity:"warn",summary:"Cancelled",detail:"Failed to move card"})}this.confirmationDialog(t,i,s,o,l,c)}archiveCard(){this._boardService.archiveCard(this.selectedCard.Id).subscribe({next:()=>{const t=this.selectedCard.Id,r=this.selectedCard.TrackId,i=this._boardService.getCurrentTracks.map(s=>s.Id===r.toString()?{...s,Cards:s.Cards.filter(o=>o.Id!==t)}:{...s});this._boardService.setTracks(i),this.cardArchived.emit({cardId:t,trackId:r}),this.destroyComponet(),this.messageService.add({severity:"info",summary:"Confirmed",detail:"Deal deleted"})},error:()=>{this.messageService.add({severity:"error",summary:"Rejected",detail:"You have rejected"})}})}onEditDescription(){this.richTextValue=this.formGroup.get("Description")?.value||"",this.showDescriptionEditor=!0}saveDescription(){this.formGroup.get("Description")?.setValue(this.richTextValue),this.showDescriptionEditor=!1}uploadFile(t){const r=t.currentFiles||t.files;r&&r.filter(s=>!this.uploadedFiles.some(o=>o.name===s.name&&o.size===s.size)).forEach(s=>{const o={name:s.name,size:s.size,id:"",loading:!0};this.uploadedFiles.push(o),this._boardService.postImage(s,this.featureKey,this.teamService.getCurrentTeam.Team.Id).subscribe({next:l=>{o.id=l.PublicId,o.loading=!1,this.fileIds.push(l.PublicId),this.updateFormControl()},error:l=>{console.error("Upload failed",l),o.loading=!1,this.uploadedFiles=this.uploadedFiles.filter(c=>c!==o)}})})}downloadFile(t){t.loading=!0,this.content.downloadFile(t.id).subscribe({next:r=>{at.Wp.saveFile(r,t.name),t.loading=!1},error:r=>{t.loading=!1,402!==r.status&&this.messageService.add({severity:"error",summary:"Download Failed",detail:"Unable to retrieve file."})}})}removeDocument(){this.formGroup.patchValue({AttachmentFile:null}),this.selectedFileId=""}onSubmit(){this.closeSlider.emit(this.formGroup.value)}onTrackSelectionChange(t,r){this._boardService.setSelectedTrackId(t)}openCloseOpportunityModal(t){this.stageTitle=t,this.displayCloseOpportunity=!0}
1onCardClosed(t){this.cardClosed.emit(t),this.displayCloseOpportunity=!1}reopenOpportunity(){this.pendingStage&&this._boardService.reopenOpportunity(this.selectedCard.Id).subscribe({next:t=>{this.moveCard.emit({cardId:this.selectedCard.Id,stageId:this.pendingStage?.Id??"",stageTitle:this.pendingStage?.Title??""}),this.destroyComponet(),this.messageService.add({severity:"success",summary:"Success",detail:"Opportunity reopened!"}),this.pendingStage=null},error:t=>{this.messageService.add({severity:"error",summary:"Error",detail:"Failed to reopen opportunity."}),this.pendingStage=null}})}getTagColor(t){return(0,at.yC)(t)}initializeFiles(){const t=this.formGroup.get("AttachmentFile")?.value;t&&"string"==typeof t&&(this.fileIds=t.split(",").filter(r=>""!==r.trim()),this.fileIds.forEach(r=>{this.loadExistingFileDetails(r)}))}loadExistingFileDetails(t){this.content.getFileByPublicId(t).subscribe({next:r=>{this.uploadedFiles.push({name:r.name,id:r.publicId,size:r.size,contentType:r.contentType,loading:!1})},error:r=>console.error(`Failed to load file ${t}`,r)})}updateFormControl(){const t=this.fileIds.join(",");this.formGroup.get("AttachmentFile")?.setValue(t)}removeFile(t){this.fileIds.splice(t,1),this.uploadedFiles.splice(t,1),this.updateFormControl()}onAssigneeChange(t){const i=(t.value||[]).map(s=>{const o=this.boardTeamMembers.find(l=>l.Name===s);return o?o.Id:null}).filter(s=>null!==s);this.formGroup.get("AssignedUserIds")?.setValue(i)}getMemberName(t){const r=this.boardTeamMembers?.find(i=>i.Id===t.Id);return r?r.Name:""}selectTab(t){this.activeTab=t}handleQualification(t){this.formGroup.patchValue({Priority:t.priorityValue})}openNotes(t){this.notesTab=t,setTimeout(()=>{this.showNotesDrawer=!0})}closeNotesDrawer(){this.showNotesDrawer=!1}hasChromeExtensionTag(t){return t?.CardTags?.some(r=>"chrome-extension"===r.Name)??!1}getTagTextColor=at.Lr;QuestionType=Tm.xi;addSuggestedField(t,r){const i=this.formBuilder.group({Title:new L.MJ(t),Type:new L.MJ(1),Value:new L.MJ(null)});this.customFieldsArray.push(i),r.hide()}createCustomField(t){if(!this.newFieldName)return;const r=this.formBuilder.group({Title:new L.MJ(this.newFieldName),Type:new L.MJ(this.newFieldType),Value:new L.MJ(null)});this.customFieldsArray.push(r),this.newFieldName="",this.newFieldType=1,t.hide()}removeField(t){const i=this.customFieldsArray.at(t).get("Id")?.value;i?this._boardService.deleteCustomField(i).subscribe({next:()=>{this.customFieldsArray.removeAt(t),console.log("Field deleted successfully from database")},error:s=>{console.error("Failed to delete custom field:",s)}}):this.customFieldsArray.removeAt(t)}get customFieldsArray(){return this.formGroup.get("CardCustomFields")}static \u0275fac=function(r){return new(r||n)(e.rXU(_t.a),e.rXU(be.td),e.rXU(rt.n),e.rXU(Ka.u),e.rXU(L.ok),e.rXU(be.bg),e.rXU(Zi.f),e.rXU(Hs.il),e.rXU(wm._))};static \u0275cmp=e.VBU({type:n,selectors:[["app-edit-deal-card"]],viewQuery:function(r,i){if(1&r&&e.GBs(pg,5),2&r){let s;e.mGM(s=e.lsd())&&(i.fileUpload=s.first)}},inputs:{edit:"edit",selectedCard:"selectedCard",isLoading:"isLoading"},outputs:{closeSlider:"closeSlider",userAssignedEvent:"userAssignedEvent",cardArchived:"cardArchived",cardClosed:"cardClosed",moveCard:"moveCard"},standalone:!1,decls:24,vars:11,consts:[["op",""],["eventSideBar",""],["position","right","showCloseIcon","false","styleClass","custom-edit-drawer",3,"visible","baseZIndex","style"],[3,"selectedCard","cardResponse","source","formGroup","boardTeamMembers"],[3,"selectedCard","showDialog","formGroup","boardTeamMembers","handleConfirmation"],[3,"selectedCard","showDialog","handleConfirmation","boardTeamMembers","formGroup"],[3,"selectedCard","showDialog","boardTeamMembers","handleConfirmation","formGroup","contacts","sources"],[3,"visible","card","initialTab","visibleChange","onClose",4,"ngIf"],[1,"w-20rem","p-1"],[1,"text-xs","font-semibold","text-500","mb-2","tracking-wider"],[1,"flex","flex-wrap","gap-2","mb-3"],["type","button",1,"bg-slate-50","border-1","border-round","border-300","px-2","py-1","text-xs","text-600","cursor-pointer","hover:bg-100","transition-colors"],[1,"border-none","border-top-1","surface-border","my-3"],[1,"text-xs","font-semibold","text-500","mb-3","tracking-wider"],[1,"flex","flex-column","gap-2"],["type","text","pInputText","","placeholder","Field name (e.g. Referral Source)",1,"w-full","bg-slate-50",3,"ngModelChange","ngModel"],[1,"flex","gap-2","align-items-center"],[1,"flex-1"],["optionLabel","label","optionValue","value","styleClass","w-full bg-slate-50",3,"ngModelChange","ngModel","options"],["type","button","pButton","","label","Add",3,"click","disabled"],["position","right","showCloseIcon","false","styleClass","custom-edit-drawer",3,"visibleChange","onHide","visible","baseZIndex"],["pTemplate","header"],["pTemplate","content"],["pTemplate","footer"],[1,"flex","flex-column","w-full"],[1,"flex","justify-content-between","align-items-center","mb-1","p-1"],[1,"flex","flex-column","gap-1"],[1,"flex","align-items-center","gap-2","text-xs","text-500","p-0"],[1,"pi","pi-calendar",2,"font-size","0.85rem"],[1,"flex","gap-3","text-400"],[1,"pi","pi-trash","cursor-pointer","hover:text-red-500",3,"click"],[1,"pi","pi-times","cursor-pointer","hover:text-900",3,"click"],[1,"flex","align-items-center","bg-gray-50","border-1","border-gray-200","border-round-lg","p-1","gap-0","w-full","overflow-x-auto"],[1,"flex","align-items-center","gap-2","p-2","border-round-md","cursor-pointer","flex-grow-1","justify-content-center","transition-all",3,"click","ngClass"],[1,"pi","pi-info-circle","text-xs",3,"ngClass"],[1,"text-xs","font-semibold"],[1,"pi","pi-comment","text-xs",3,"ngClass"],[1,"text-xs","font-medium"],[1,"pi","pi-file","text-xs",3,"ngClass"],[1,"pi","pi-paperclip","text-xs",3,"ngClass"],["
1id","edit-card-form",1,"container","mt-2",3,"ngSubmit","formGroup"],[4,"ngIf"],[1,"flex","flex-column","mt-2"],[1,"flex","w-full"],[1,"flex","flex-column","col-6","pb-0"],[1,"mb-1","text-500",2,"font-size","0.75rem"],[1,"text-red-500"],["pInputText","","formControlName","Title","placeholder","Enter deal name",1,"w-full","border-200","border-round-lg","p-2","text-xs"],["type","number","pInputText","","formControlName","Amount","placeholder","4500",1,"w-full","border-200","border-round-lg","p-2","text-xs"],["optionLabel","label","optionValue","value","formControlName","OpportunityType","placeholder","Inbound / Outbound","styleClass","w-full border-200 border-round-lg flex align-items-center text-xs",3,"options","appendTo"],["optionLabel","label","optionValue","value","formControlName","OpportunitySourceId","placeholder","Select source","styleClass","w-full border-200 border-round-lg flex align-items-center text-xs",3,"options","appendTo"],["formControlName","AssignedUserIds","optionLabel","Name","optionValue","Id","dataKey","Id","placeholder","deal owner","filter","",3,"options","styleClass","appendTo"],["pTemplate","selectedItems"],["pTemplate","item"],["formControlName","DueDateUtc","dateFormat","yy/mm/dd","iconDisplay","input","placeholder","yy/mm/dd","styleClass","w-full text-xs","inputStyleClass","border-200 border-round-lg p-2 ",3,"showIcon","appendTo"],[1,"flex","flex-column","gap-3","my-2","p-2"],[1,"text-xs","font-normal","text-500","uppercase","tracking-wider","flex","align-items-center","gap-2","px-1","text-slate-500"],[1,"p-1","border-1","border-round-lg","border-200","bg-white","flex","flex-column","gap-3",3,"formGroup"],[1,"p-2"],["type","button",1,"w-full","p-2","bg-white","border-1","border-dashed","border-round-md","border-300","text-color-secondary","font-semibold","cursor-pointer","flex","align-items-center","justify-content-center","gap-2","hover:bg-gray-50","transition-colors","mb-2",3,"click"],[1,"pi","pi-plus","text-xs","font-bold"],[1,"my-2"],[3,"selectedCard"],[1,"px-2","mt-3"],[3,"onComplete","selectedCard"],[1,"flex","align-items-center","text-xs","text-900","truncate","w-full"],["class","ml-1 text-blue-500 font-bold",4,"ngIf"],[1,"ml-1","text-blue-500","font-bold"],["shape","circle",3,"image","icon"],[1,"flex","align-items-center","gap-2"],[1,"flex-grow-1","p-2","border-1","border-round-md","border-200","bg-white","text-700","font-semibold","text-sm"],[2,"width","110px"],["formControlName","Type","optionLabel","label","optionValue","value","styleClass","w-full bg-white border-1 border-100 text-sm",3,"options"],["type","button",1,"p-link","p-2","text-400","hover:text-600","border-none","bg-transparent","shadow-none","transition-colors","flex","align-items-center","justify-content-center",2,"background","transparent","border","none","box-shadow","none",3,"click"],[1,"pi","pi-times","text-xs"],["type","text","pInputText","","formControlName","Value",1,"w-full","p-2","border-1","border-200","bg-white","text-sm","font-normal","text-color-secondary",3,"placeholder"],["type","email","pInputText","","placeholder","Enter email address","formControlName","Value",1,"w-full","p-2","border-1","border-200","bg-white","text-sm","font-normal","text-color-secondary"],["type","url","pInputText","","placeholder","https://example.com","formControlName","Value",1,"w-full","p-2","border-1","border-200","bg-white","text-sm","font-normal","text-color-secondary"],["formControlName","Value","styleClass","w-full","inputStyleClass","w-full p-2 border-1 border-100 bg-white text-sm font-normal text-color-secondary",3,"placeholder"],["placeholder","yyyy/mm/dd","formControlName","Value","styleClass","w-full","inputStyleClass","w-full p-2 border-1 border-200 bg-white text-sm font-normal text-color-secondary"],[1,"mb-3","mt-3"],[1,"font-semibold","text-sm","mb-1"],["class","px-3 py-2 border-round border-1 border-gray-200 cursor-pointer flex justify-content-between align-items-start description-preview",3,"click",4,"ngIf"],["class","border-1 border-gray-300 border-round overflow-hidden",4,"ngIf"],[3,"selectedCard","formGroup"],[1,"px-3","py-2","border-round","border-1","border-gray-200","cursor-pointer","flex","justify-content-between","align-items-start","description-preview",3,"click"],[1,"text-xs","text-600","flex-1",2,"min-height","50px","max-height","200px","overflow-y","auto","overflow-x","hidden","word-break","break-word",3,"innerHTML"],[1,"pi","pi-pencil","text-400","text-xs","ml-2"],[1,"border-1","border-gray-300","border-round","overflow-hidden"],["formControlName","Description","placeholder","Write your notes here...",1,"w-full"],[1,"ql-formats"],[1,"ql-bold"],[1,"ql-italic"],["value","ordered",1,"ql-list"],["value","bullet",1,"ql-list"],[1,"flex","surface-50","border-1","border-200","border-round-xl","p-1","mb-3"],["pButton","","type","button",1,"flex-1","border-none","py-2","border-round-lg","cursor-pointer","flex","align-items-center","justify-content-center","gap-2","transition-all","duration-200",3,"click","ngClass"],[1,"pi","pi-file"],[1,"font-bold"],[1,"pi","pi-calendar"],[1,"surface-50","border-1","border-100","border-round-lg","p-3","mb-3"],[1,"m-0","text-500","text-sm","line-height-3"],[1,"flex","flex-column","gap-4","mt-3","p-2"],[1,"flex","align-items-center","justify-content-between"],[1,"font-medium","text-sm","text-900"],["mode","basic","name","demo[]","chooseLabel","Add Files","chooseIcon","pi pi-plus","styleClass","p-button-sm p-button-outlined",3,"uploadHandler","customUpload","auto"],["class","flex flex-column gap-3",4,"ngIf"],["class","text-center p-4 border-2 border-dashed border-300 border-round-lg bg-gray-50",4,"ngIf"],[1,"flex","flex-column","gap-3"],[1,"text-xs","font-bold","text-500","uppercase","tracking-wider"],["class","flex align-items-center justify-content-between p-2 border-1 border-100 border-round-lg shadow-sm bg-white",4,"ngFor","ngForOf"],[1,"flex","align-items-center","justify-content-between","p-2","border-1","border-100","border-round-lg","shadow-sm","bg-white"],[1,"flex","align-items-center","gap-3"],["class","flex align-items-center justify-content-center bg-gray-100 border-round","style","width: 40px; height: 40px",4,"ngIf"],[3,"class",4,"ngIf"],[1,"flex","flex-column"],[1,"font-semibold","text-sm","text-900","line-height-2"],[1,"text-500"],[1,"flex","gap-2"],["pButton","","type","button","icon","pi pi-download","pTooltip","Download file","tooltipPosition","top",1,"p-button-text","p-button-secondary","p-button-rounded",3,"click","loading"],["pButton","","type","button","icon","pi pi-trash","pTooltip","Delete file",1,"p-button-text","p-button-danger","p-button-rounded",3,"click","disabled"],[1,"flex","align-items-center","justify-content-center","bg-gray-100","border-round",2,"width","40px","height","40px"],[1,"pi","pi-spin","pi-spinner","text-blue-500"],[1,"text-center","p-4","border-2","border-dashed","border-300","border-round-lg","bg-gray-50"],[1,"pi","pi-cloud-upload","text-400","text-2xl","mb-2"],[1,"text-500","text-sm","m-0"],[1,"flex","justify-content-end","gap-2","mt-4"],["pButton","","type","button","label","Cancel","icon","pi pi-times-circle",1,"p-button-outlined","rounded-pill","px-4",3,"click"],["pButton","","type","button","label","Update","icon","pi pi-check-circle",1,"p-button-rounded","px-4",3,"click"],[3,"close","deleteCardEvent","submitClicked","selectedCard","cardResponse","source","formGroup","boardTeamMembers"],[3,"submitClicked","close","onDownloadFile","selectedCard","showDialog","formGroup","boardTeamMembers","handleConfirmation"],[3,"close","submitClicked","selectedCard","showDialog","handleConfirmation","boardTeamMembers","formGroup"],[3,"close","submitClicked","selectedCard","showDialog","boardTeamMembers","handleConfirmation","formGroup","contacts","sources"],[3,"visibleChange","onClose","visible","card","initialTab"],["type","button",1,"bg-slate-50","border-1","border-round","border-300","px-2","py-1","text-xs","text-600","cursor-pointer","hover:bg-100","transition-colors",3,"click"]],template:function(r,i){if(1&r){const s=e.RV6();e.DNE(0,$g,6,5,"p-drawer",2)(1,Vg,1,5,"app-form-response-card",3)(2,Ug,1,5,"app-tender-deal-view",4)(3,Xg,1,5,"app-edit-messenger-deal",5)(4,Yg,1,5,"app-edit-chrome-extension-card",5)(5,Wg,1,7,"app-edit-email-deal",6)(6,Hg,1,3,"app-deal-notes",7),e.j41(7,"p-popover",null,0)(9,"div",8)(10,"div",9),e.EFF(11,"SUGGESTED"),e.k0s(),e.j41(12,"div",10),e.Z7z(13,zg,2,1,"button",11,e.fX1),e.k0s(),e.nrm(15,"hr",12),e.j41(16,"div",13),e.EFF(17,"CREATE YOUR OWN"),e.k0s(),e.j41(18,"div",14)(19,"input",15),e.mxI("ngModelChange",function(l){return e.eBV(s),e.DH7(i.newFieldName,l)||(i.newFieldName=l),e.Njj(l)}),e.k0s(),e.j41(20,"div",16)(21,"div",17)(22,"p-select",18),e.mxI("ngModelChange",function(l){return e.eBV(s),e.DH7(i.newFieldType,l)||(i.newFieldType=l),e.Njj(l)}),e.k0s()(),e.j41(23,"button",19),e.bIt("click",function(){e.eBV(s);const l=e.sdS(8);return e.Njj(i.createCustomField(l))}),e.k0s()()()()()}2&r&&(e.vxM(null!=i.selectedCard.TenderId||null!=i.selectedCard.MessengerThreadId||14==i.selectedCard.OpportunitySourceId||null!=i.selectedCard.FormResponseId||i.selectedCard.CardTypeId==i.CardType.ChromExtension&&i.hasChromeExtensionTag(i.selectedCard)?-1:0),e.R7$(),e.vxM(null==i.selectedCard.TenderId&&null==i.selectedCard.MessengerThreadId&&14!=i.selectedCard.OpportunitySourceId&&i.selectedCard.FormResponseId?1:-1),e.R7$(),e.vxM(null!=i.selectedCard.TenderId?2:-1),e.R7$(),e.vxM(null!=i.selectedCard.MessengerThreadId?3:-1),e.R7$(),e.vxM(i.selectedCard.CardTypeId===i.CardType.ChromExtension||i.hasChromeExtensionTag(i.selectedCard)?4:-1),e.R7$(),e.vxM(14===i.selectedCard.OpportunitySourceId?5:-1),e.R7$(),e.Y8G("ngIf",i.showNotesDrawer),e.R7$(7),e.Dyx(i.suggestedFields),e.R7$(6),e.R50("ngModel",i.newFieldName),e.R7$(3),e.R50("ngModel",i.newFieldType),e.Y8G("options",i.fieldTypeOptions),e.R7$(),e.Y8G("disabled",!i.newFieldName))}
1,dependencies:[q.YU,q.Sq,q.bT,be.Ei,wt.m_,zn.eu,Ie.y8,Qe.Sm,L.qT,L.me,L.Q0,L.BC,L.cb,L.vS,xe._f,Qi.KE,Ve._s,De.KF,L.j4,L.JD,Oe.l6,zs,Za,a1.n,Ae.AM,An.lr,ji.ef,vt.YI,q1,Sh,Js,Wh,Ja,dg,q.GH,q.vh],styles:[".scrollbar-none[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.scrollbar-none[_ngcontent-%COMP%]{-ms-overflow-style:none;scrollbar-width:none}input[pInputText][_ngcontent-%COMP%], input[type=date][_ngcontent-%COMP%], .p-inputtext[_ngcontent-%COMP%], .p-dropdown[_ngcontent-%COMP%], .p-multiselect[_ngcontent-%COMP%]{height:2.5rem;box-sizing:border-box}.p-dropdown[_ngcontent-%COMP%] .p-dropdown-label[_ngcontent-%COMP%]{line-height:2.5rem}[_nghost-%COMP%] .p-checkbox .p-checkbox-box{border-color:#5bc0be!important;border-radius:6px;width:22px;height:22px}[_nghost-%COMP%] .p-checkbox .p-checkbox-box.p-highlight{background:#5bc0be!important;border-color:#5bc0be!important}.bg-teal-50[_ngcontent-%COMP%]{background-color:#e6fffa!important}.description-preview[_ngcontent-%COMP%]:hover{background:#f8fafc;border-color:#cbd5f5} .p-editor .ql-editor{max-height:150px;overflow-y:auto} .p-select{background:transparent!important} .p-select-dropdown{width:1.5rem!important}[_nghost-%COMP%] .p-multiselect-panel .p-multiselect-items .p-multiselect-item{padding:.5rem;font-size:.85rem} .custom-edit-drawer .p-drawer-content{padding:4px!important} .custom-edit-drawer .p-drawer-footer{border-top:1px solid #cccc!important} .custom-edit-drawer .p-drawer-header{padding:12px!important;background-color:#f0f5fb!important;border-bottom:1px solid #cccc} .form-response-drawer .p-drawer-header{padding:12px!important;background-color:#f9fafb!important;border-bottom:1px solid #E0E5EB} .form-response-drawer .p-drawer-content{background-color:#f9fafb!important;padding:30px 15px 0!important} .form-response-drawer .p-drawer-footer{background-color:#f9fafb!important} .p-toast.on-top-toast{z-index:9999!important}.respondent-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:5px;padding:24px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;background-color:#f8fafc;border:1px solid #e2e8f0;border-radius:12px}.card-label[_ngcontent-%COMP%]{font-size:11px;font-weight:600;color:#64748b;letter-spacing:.05em;margin-bottom:2px}.card-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px}.card-icon[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;color:#475569}.card-icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:18px;height:18px}.card-text[_ngcontent-%COMP%]{font-size:14px}.card-text.name[_ngcontent-%COMP%]{color:#1e293b;font-weight:500}.card-text.email[_ngcontent-%COMP%]{color:#2563eb;text-decoration:none}.card-text.email[_ngcontent-%COMP%]:hover{text-decoration:underline}"]})}return n})();var Xl=ee(65137),ns=ee(46535),Yl=ee(94799),Wl=ee(45144),Hl=ee(76938);let Jg=(()=>{class n{constructor(){}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-email-card"]],decls:11,vars:0,consts:[[1,"container"],[1,"header"],[1,"provider-strip"],[1,"email-strip"],[1,"bcc-container"],[1,"cc-container"],[1,"subject-container"],[1,"attachments-btn"],[1,"message-container"],[1,"signature-container"],[1,"footer"]],template:function(r,i){1&r&&(e.j41(0,"div",0),e.nrm(1,"div",1)(2,"div",2),e.j41(3,"div",3),e.nrm(4,"div",4)(5,"div",5)(6,"div",6)(7,"div",7)(8,"div",8),e.k0s(),e.nrm(9,"div",9)(10,"div",10),e.k0s())},encapsulation:2})}return n})();var li={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function zl(n){li=n}var ta={exec:()=>null};function pt(n,a=""){let t="string"==typeof n?n:n.source;const r={replace:(i,s)=>{let o="string"==typeof s?s:s.source;return o=o.replace(Fn.caret,"$1"),t=t.replace(i,o),r},getRegex:()=>new RegExp(t,a)};return r}var Fn={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine
vendor: 9,102 bytes, line 1
1:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},na=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,eo=/(?:[*+-]|\d{1,9}[.)])/,ql=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Jl=pt(ql).replace(/bull/g,eo).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),t_=pt(ql).replace(/bull/g,eo).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),to=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,no=/(?!\s*\])(?:\\.|[^\[\]\\])+/,r_=pt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",no).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),i_=pt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,eo).getRegex(),rs="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ro=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,a_=pt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",ro).replace("tag",rs).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Kl=pt(to).replace("hr",na).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rs).getRegex(),io={blockquote:pt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Kl).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:r_,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:na,html:a_,lheading:Jl,list:i_,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:Kl,table:ta,text:/^[^\n]+/},Ql=pt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",na).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rs).getRegex(),o_={...io,lheading:t_,table:Ql,paragraph:pt(to).replace("hr",na).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ql).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rs).getRegex()},l_={...io,html:pt("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",ro).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ta,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:pt(to).replace("hr",na).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Jl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Zl=/^( {2,}|\\)\n(?!\s*$)/,is=/[\p{P}\p{S}]/u,ao=/[\s\p{P}\p{S}]/u,ec=/[^\s\p{P}\p{S}]/u,u_=pt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ao).getRegex(),tc=/(?!~)[\p{P}\p{S}]/u,nc=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,g_=pt(nc,"u").replace(/punct/g,is).getRegex(),__=pt(nc,"u").replace(/punct/g,tc).getRegex(),rc="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",x_=pt(rc,"gu").replace(/notPunctSpace/g,ec).replace(/punctSpace/g,ao).replace(/punct/g,is).getRegex(),v_=pt(rc,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,tc).getRegex(),b_=pt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ec).replace(/punctSpace/g,ao).replace(/punct/g,is).getRegex(),C_=pt(/\\(punct)/,"gu").replace(/punct/g,is).getRegex(),k_=pt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),T_=pt(ro).replace("(?:--\x3e|$)","--\x3e").getRegex(),w_=pt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",T_).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),as=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,y_=pt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",as).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ic=pt(/^!?\[(label)\]\[(ref)\]/).replace("label",as).replace("ref",no).getRegex(),ac=pt(/^!?\[(ref)\](?:\[\])?/).replace("ref",no).getRegex(),so={_backpedal:ta,anyPunctuation:C_,autolink:k_,blockSkip:/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,br:Zl,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:ta,emStrongLDelim:g_,emStrongRDelimAst:x_,emStrongRDelimUnd:b_,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:y_,nolink:ac,punctuation:u_,reflink:ic,reflinkSearch:pt("reflink|nolink(?!\\()","g").replace("reflink",ic).replace("nolink",ac).getRegex(),tag:w_,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:ta},S_={...so,link:pt(/^!?\[(label)\]\((.*?)\)/).replace("label",as).getRegex(),reflink:pt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",as).getRegex()}
1,oo={...so,emStrongRDelimAst:v_,emStrongLDelim:__,url:pt(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},E_={...oo,br:pt(Zl).replace("{2,}","*").getRegex(),text:pt(oo.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ss={normal:io,gfm:o_,pedantic:l_},ra={normal:so,gfm:oo,breaks:E_,pedantic:S_},I_={"&":"&","<":"<",">":">",'"':""","'":"'"},sc=n=>I_[n];function hr(n,a){if(a){if(Fn.escapeTest.test(n))return n.replace(Fn.escapeReplace,sc)}else if(Fn.escapeTestNoEncode.test(n))return n.replace(Fn.escapeReplaceNoEncode,sc);return n}function oc(n){try{n=encodeURI(n).replace(Fn.percentDecode,"%")}catch{return null}return n}function lc(n,a){const r=n.replace(Fn.findPipe,(s,o,l)=>{let c=!1,d=o;for(;--d>=0&&"\\"===l[d];)c=!c;return c?"|":" |"}).split(Fn.splitPipe);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),a)if(r.length>a)r.splice(a);else for(;r.length<a;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(Fn.slashPipe,"|");return r}function ia(n,a,t){const r=n.length;if(0===r)return"";let i=0;for(;i<r;){const s=n.charAt(r-i-1);if(s!==a||t){if(s===a||!t)break;i++}else i++}return n.slice(0,r-i)}function cc(n,a,t,r,i){const s=a.href,o=a.title||null,l=n[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;const c={type:"!"===n[0].charAt(0)?"image":"link",raw:t,href:s,title:o,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,c}var os=class{options;rules;lexer;constructor(n){this.options=n||li}space(n){const a=this.rules.block.newline.exec(n);if(a&&a[0].length>0)return{type:"space",raw:a[0]}}code(n){const a=this.rules.block.code.exec(n);if(a){const t=a[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:a[0],codeBlockStyle:"indented",text:this.options.pedantic?t:ia(t,"\n")}}}fences(n){const a=this.rules.block.fences.exec(n);if(a){const t=a[0],r=function R_(n,a,t){const r=n.match(t.other.indentCodeCompensation);if(null===r)return a;const i=r[1];return a.split("\n").map(s=>{const o=s.match(t.other.beginningSpace);if(null===o)return s;const[l]=o;return l.length>=i.length?s.slice(i.length):s}).join("\n")}(t,a[3]||"",this.rules);return{type:"code",raw:t,lang:a[2]?a[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):a[2],text:r}}}heading(n){const a=this.rules.block.heading.exec(n);if(a){let t=a[2].trim();if(this.rules.other.endingHash.test(t)){const r=ia(t,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(t=r.trim())}return{type:"heading",raw:a[0],depth:a[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){const a=this.rules.block.hr.exec(n);if(a)return{type:"hr",raw:ia(a[0],"\n")}}blockquote(n){const a=this.rules.block.blockquote.exec(n);if(a){let t=ia(a[0],"\n").split("\n"),r="",i="";const s=[];for(;t.length>0;){let o=!1;const l=[];let c;for(c=0;c<t.length;c++)if(this.rules.other.blockquoteStart.test(t[c]))l.push(t[c]),o=!0;else{if(o)break;l.push(t[c])}t=t.slice(c);const d=l.join("\n"),p=d.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}\n${d}`:d,i=i?`${i}\n${p}`:p;const u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,s,!0),this.lexer.state.top=u,0===t.length)break;const f=s.at(-1);if("code"===f?.type)break;if("blockquote"===f?.type){const h=f,g=h.raw+"\n"+t.join("\n"),m=this.blockquote(g);s[s.length-1]=m,r=r.substring(0,r.length-h.raw.length)+m.raw,i=i.substring(0,i.length-h.text.length)+m.text;break}if("list"!==f?.type);else{const h=f,g=h.raw+"\n"+t.join("\n"),m=this.list(g);s[s.length-1]=m,r=r.substring(0,r.length-f.raw.length)+m.raw,i=i.substring(0,i.length-h.raw.length)+m.raw,t=g.substring(s.at(-1).raw.length).split("\n")}}return{type:"blockquote",raw:r,tokens:s,text:i}}}list(n){let a=this.rules.block.list.exec(n);if(a){let t=a[1].trim();const r=t.length>1,i={type:"list",raw:"",ordered:r,start:r?+t.slice(0,-1):"",loose:!1,items:[]};t=r?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=r?t:"[*+-]");const s=this.rules.other.listItemRegex(t);let o=!1;for(;n;){let c=!1,d="",p="";if(!(a=s.exec(n))||this.rules.block.hr.test(n))break;d=a[0],n=n.substring(d.length);let u=a[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,v=>" ".repeat(3*v.length)),f=n.split("\n",1)[0],h=!u.trim(),g=0;if(this.options.pedantic?(g=2,p=u.trimStart()):h?g=a[1].length+1:(g=a[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,p=u.slice(g),g+=a[1].length),h&&this.rules.other.blankLine.test(f)&&(d+=f+"\n",n=n.substring(f.length+1),c=!0),!c){const v=this.rules.other.nextBulletRegex(g),k=this.rules.other.hrRegex(g),b=this.rules.other.fencesBeginRegex(g),A=this.rules.other.headingBeginRegex(g),G=this.rules.other.htmlBeginRegex(g);for(;n;){const j=n.split("\n",1)[0];let w;if(f=j,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),w=f):w=f.replace(this.rules.other.tabCharGlobal," "),b.test(f)||A.test(f)||G.test(f)||v.test(f)||k.test(f))break;if(w.search(this.rules.other.nonSpaceChar)>=g||!f.trim())p+="\n"+w.slice(g);else{if(h||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||b.test(u)||A.test(u)||k.test(u))break;p+="\n"+f}!h&&!f.trim()&&(h=!0),d+=j+"\n",n=n.substring(j.length+1),u=w.slice(g)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(o=!0));let _,m=null;this.options.gfm&&(m=this.rules.other.listIsTask.exec(p),m&&(_="[ ] "!==m[0],p=p.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:d,task:!!m,checked:_,loose:!1,text:p,tokens:[]}),i.raw+=d}const l=i.items.at(-1);if(!l)return;l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd(),i.raw=i.raw.trimEnd();for(let c=0;c<i.items.length;c++)if(this.lexer.state.top=!1,i.items[c].tokens=this.lexer.blockTokens(i.items[c].text,[]),!i.loose){const d=i.items[c].tokens.filter(u=>
vendor: 15,500 bytes, line 1
1"space"===u.type),p=d.length>0&&d.some(u=>this.rules.other.anyLine.test(u.raw));i.loose=p}if(i.loose)for(let c=0;c<i.items.length;c++)i.items[c].loose=!0;return i}}html(n){const a=this.rules.block.html.exec(n);if(a)return{type:"html",block:!0,raw:a[0],pre:"pre"===a[1]||"script"===a[1]||"style"===a[1],text:a[0]}}def(n){const a=this.rules.block.def.exec(n);if(a){const t=a[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=a[2]?a[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=a[3]?a[3].substring(1,a[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):a[3];return{type:"def",tag:t,raw:a[0],href:r,title:i}}}table(n){const a=this.rules.block.table.exec(n);if(!a||!this.rules.other.tableDelimiter.test(a[2]))return;const t=lc(a[1]),r=a[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=a[3]?.trim()?a[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],s={type:"table",raw:a[0],header:[],align:[],rows:[]};if(t.length===r.length){for(const o of r)this.rules.other.tableAlignRight.test(o)?s.align.push("right"):this.rules.other.tableAlignCenter.test(o)?s.align.push("center"):this.rules.other.tableAlignLeft.test(o)?s.align.push("left"):s.align.push(null);for(let o=0;o<t.length;o++)s.header.push({text:t[o],tokens:this.lexer.inline(t[o]),header:!0,align:s.align[o]});for(const o of i)s.rows.push(lc(o,s.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:s.align[c]})));return s}}lheading(n){const a=this.rules.block.lheading.exec(n);if(a)return{type:"heading",raw:a[0],depth:"="===a[2].charAt(0)?1:2,text:a[1],tokens:this.lexer.inline(a[1])}}paragraph(n){const a=this.rules.block.paragraph.exec(n);if(a){const t="\n"===a[1].charAt(a[1].length-1)?a[1].slice(0,-1):a[1];return{type:"paragraph",raw:a[0],text:t,tokens:this.lexer.inline(t)}}}text(n){const a=this.rules.block.text.exec(n);if(a)return{type:"text",raw:a[0],text:a[0],tokens:this.lexer.inline(a[0])}}escape(n){const a=this.rules.inline.escape.exec(n);if(a)return{type:"escape",raw:a[0],text:a[1]}}tag(n){const a=this.rules.inline.tag.exec(n);if(a)return!this.lexer.state.inLink&&this.rules.other.startATag.test(a[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(a[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(a[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(a[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:a[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:a[0]}}link(n){const a=this.rules.inline.link.exec(n);if(a){const t=a[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;const s=ia(t.slice(0,-1),"\\");if((t.length-s.length)%2==0)return}else{const s=function D_(n,a){if(-1===n.indexOf(a[1]))return-1;let t=0;for(let r=0;r<n.length;r++)if("\\"===n[r])r++;else if(n[r]===a[0])t++;else if(n[r]===a[1]&&(t--,t<0))return r;return t>0?-2:-1}(a[2],"()");if(-2===s)return;if(s>-1){const l=(0===a[0].indexOf("!")?5:4)+a[1].length+s;a[2]=a[2].substring(0,s),a[0]=a[0].substring(0,l).trim(),a[3]=""}}let r=a[2],i="";if(this.options.pedantic){const s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],i=s[3])}else i=a[3]?a[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(r=this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?r.slice(1):r.slice(1,-1)),cc(a,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},a[0],this.lexer,this.rules)}}reflink(n,a){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){const i=a[(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!i){const s=t[0].charAt(0);return{type:"text",raw:s,text:s}}return cc(t,i,t[0],this.lexer,this.rules)}}emStrong(n,a,t=""){let r=this.rules.inline.emStrongLDelim.exec(n);if(!(!r||r[3]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!r[1]&&!r[2]||!t||this.rules.inline.punctuation.exec(t))){const s=[...r[0]].length-1;let o,l,c=s,d=0;const p="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,a=a.slice(-1*n.length+s);null!=(r=p.exec(a));){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(l=[...o].length,r[3]||r[4]){c+=l;continue}if((r[5]||r[6])&&s%3&&!((s+l)%3)){d+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+d);const u=[...r[0]][0].length,f=n.slice(0,s+r.index+u+l);if(Math.min(s,l)%2){const g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}const h=f.slice(2,-2);return{type:"strong",raw:f,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(n){const a=this.rules.inline.code.exec(n);if(a){let t=a[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(t),i=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return r&&i&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:a[0],text:t}}}br(n){const a=this.rules.inline.br.exec(n);if(a)return{type:"br",raw:a[0]}}del(n){const a=this.rules.inline.del.exec(n);if(a)return{type:"del",raw:a[0],text:a[2],tokens:this.lexer.inlineTokens(a[2])}}autolink(n){const a=this.rules.inline.autolink.exec(n);if(a){let t,r;return"@"===a[2]?(t=a[1],r="mailto:"+t):(t=a[1],r=t),{type:"link",raw:a[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}url(n){let a;if(a=this.rules.inline.url.exec(n)){let t,r;if("@"===a[2])t=a[0],r="mailto:"+t;else{let i;do{i=a[0],a[0]=this.rules.inline._backpedal.exec(a[0])?.[0]??""}while(i!==a[0]);t=a[0],r="www."===a[1]?"http://"+a[0]:a[0]}return{type:"link",raw:a[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(n){const a=this.rules.inline.text.exec(n);if(a)return{type:"text",raw:a[0],text:a[0],escaped:this.lexer.state.inRawBlock}}},Sr=class Al{tokens;options;state;tokenizer;inlineQueue;constructor(a){this.tokens=[],this.tokens.links=Object.create(null),this.options=a||li,this.options.tokenizer=this.options.tokenizer||new os,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={other:Fn,block:ss.normal,inline:ra.normal};this.options.pedantic?(t.block=ss.pedantic,t.inline=ra.pedantic):this.options.gfm&&(t.block=ss.gfm,t.inline=this.options.breaks?ra.breaks:ra.gfm),this.tokenizer.rules=t}static get rules(){return{block:ss,inline:ra}}static lex(a,t){return new Al(t).lex(a)}static lexInline(a,t){return new Al(t).inlineTokens(a)}lex(a){a=a.replace(Fn.carriageReturn,"\n"),this.blockTokens(a,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const r=this.inlineQueue[t];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(a,t=[],r=!1){for(this.options.pedantic&&(a=a.replace(Fn.tabCharGlobal," ").replace(Fn.spaceLine,""));a;){let i;if(this.options.extensions?.block?.some(o=>!!(i=o.call({lexer:this},a,t))&&(a=a.substring(i.raw.length),t.push(i),!0)))continue;if(i=this.tokenizer.space(a)){a=a.substring(i.raw.length);const o=t.at(-1);1===i.raw.length&&void 0!==o?o.raw+="\n":t.push(i);continue}if(i=this.tokenizer.code(a)){a=a.substring(i.raw.length);const o=t.at(-1);"paragraph"===o?.type||"text"===o?.type?(o.raw+="\n"+i.raw,o.text+="\n"+i.text,this.inlineQueue.at(-1).src=o.text):t.push(i);continue}if(i=this.tokenizer.fences(a)){a=a.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(a)){a=a.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(a)){a=a.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(a)){a=a.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(a)){a=a.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(a)){a=a.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(a)){a=a.substring(i.raw.length);const o=t.at(-1);"paragraph"===o?.type||"text"===o?.type?(o.raw+="\n"+i.raw,o.text+="\n"+i.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});continue}if(i=this.tokenizer.table(a)){a=a.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(a)){a=a.substring(i.raw.length),t.push(i);continue}let s=a;if(this.options.extensions?.startBlock){let o=1/0;const l=a.slice(1);let c;this.options.extensions.startBlock.forEach(d=>{c=d.call({lexer:this},l),"number"==typeof c&&c>=0&&(o=Math.min(o,c))}),o<1/0&&o>=0&&(s=a.substring(0,o+1))}if(this.state.top&&(i=this.tokenizer.paragraph(s))){const o=t.at(-1);r&&"paragraph"===o?.type?(o.raw+="\n"+i.raw,o.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(i),r=s.length!==a.length,a=a.substring(i.raw.length)}else if(i=this.tokenizer.text(a)){a=a.substring(i.raw.length);const o=t.at(-1);"text"===o?.type?(o.raw+="\n"+i.raw,o.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(i)}else if(a){const o="Infinite loop on byte: "+a.charCodeAt(0);if(this.options.silent){console.error(o);break}throw new Error(o)}}return this.state.top=!0,t}inline(a,t=[]){return this.inlineQueue.push({src:a,tokens:t}),t}inlineTokens(a,t=[]){let r=a,i=null;if(this.tokens.links){const l=Object.keys(this.tokens.links);if(l.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(r));)l.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.anyPunctuation.exec(r));)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(r));)r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let s=!1,o="";for(;a;){let l;if(s||(o=""),s=!1,this.options.extensions?.inline?.some(d=>!!(l=d.call({lexer:this},a,t))&&(a=a.substring(l.raw.length),t.push(l),!0)))continue;if(l=this.tokenizer.escape(a)){a=a.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.tag(a)){a=a.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.link(a)){a=a.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.reflink(a,this.tokens.links)){a=a.substring(l.raw.length);const d=t.at(-1);"text"===l.type&&"text"===d?.type?(d.raw+=l.raw,d.text+=l.text):t.push(l);continue}if(l=this.tokenizer.emStrong(a,r,o)){a=a.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.codespan(a)){a=a.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.br(a)){a=a.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.del(a)){a=a.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.autolink(a)){a=a.substring(l.raw.length),t.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(a))){a=a.substring(l.raw.length),t.push(l);continue}let c=a;if(this.options.extensions?.startInline){let d=1/0;const p=a.slice(1);let u;this.options.extensions.startInline.forEach(f=>{u=f.call({lexer:this},p),"number"==typeof u&&u>=0&&(d=Math.min(d,u))}),d<1/0&&d>=0&&(c=a.substring(0,d+1))}if(l=this.tokenizer.inlineText(c)){a=a.substring(l.raw.length),"_"!==l.raw.slice(-1)&&(o=l.raw.slice(-1)),s=!0;const d=t.at(-1);"text"===d?.type?(d.raw+=l.raw,d.text+=l.text):t.push(l)}else if(a){const d="Infinite loop on byte: "+a.charCodeAt(0);if(this.options.silent){console.error(d);break}throw new Error(d)}}return t}},ls=class{options;parser;constructor(n){this.options=n||li}space(n){return""}code({text:n,lang:a,escaped:t}){const r=(a||"").match(Fn.notSpaceStart)?.[0],i=n.replace(Fn.endingNewline,"")+"\n";return r?'<pre><code class="language-'+hr(r)+'">'+(t?i:hr(i,!0))+"</code></pre>\n":"<pre><code>"+(t?i:hr(i,!0))+"</code></pre>\n"}blockquote({tokens:n}){return`<blockquote>\n${this.parser.parse(n)}</blockquote>\n`}html({text:n}){return n}heading({tokens:n,depth:a}){return`<h${a}>${this.parser.parseInline(n)}</h${a}>\n`}hr(n){return"<hr>\n"}list(n){const a=n.ordered,t=n.start;let r="";for(let o=0;o<n.items.length;o++)r+=this.listitem(n.items[o]);const i=a?"ol":"ul";return"<"+i+(a&&1!==t?' start="'+t+'"':"")+">\n"+r+"</"+i+">\n"}listitem(n){let a="";if(n.task){const t=this.checkbox({checked:!!n.checked});n.loose?"paragraph"===n.tokens[0]?.type?(n.tokens[0].text=t+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&"text"===n.tokens[0].tokens[0].type&&(n.tokens[0].tokens[0].text=t+" "+hr(n.tokens[0].tokens[0].text),n.tokens[0].tokens[0].escaped=!0)):n.tokens.unshift({type:"text",raw:t+" ",text:t+" ",escaped:!0}):a+=t+" "}return a+=this.parser.parse(n.tokens,!!n.loose),`<li>${a}</li>\n`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>\n`}table(n){let a="",t="";for(let i=0;i<n.header.length;i++)t+=this.tablecell(n.header[i]);a+=this.tablerow({text:t});let r="";for(let i=0;i<n.rows.length;i++){const s=n.rows[i];t="";for(let o=0;o<s.length;o++)t+=this.tablecell(s[o]);r+=this.tablerow({text:t})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+a+"</thead>\n"+r+"</table>\n"}tablerow({text:n}){return`<tr>\n${n}</tr>\n`}tablecell(n){const a=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+a+`</${t}>\n`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${hr(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:a,tokens:t}){const r=this.parser.parseInline(t),i=oc(n);if(null===i)return r;let s='<a href="'+(n=i)+'"';return a&&(s+=' title="'+hr(a)+'"'),s+=">"+r+"</a>",s}image({href:n,title:a,text:t,tokens:r}){r&&(t=this.parser.parseInline(r,this.parser.textRenderer));const i=oc(n);if(null===i)return hr(t);let s=`<img src="${n=i}" alt="${t}"`;return a&&(s+=` title="${hr(a)}"`),s+=">",s}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:hr(n.text)}},lo=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}},Er=class Ml{options;renderer;textRenderer;constructor(a){this.options=a||li,this.options.renderer=this.options.renderer||new ls,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new lo}static parse(a,t){return new Ml(t).parse(a)}static parseInline(a,t){return new Ml(t).parseInline(a)}parse(a,t=!0){let r="";for(let i=0;i<a.length;i++){const s=a[i];if(this.options.extensions?.renderers?.[s.type]){const l=s,c=this.options.extensions.renderers[l.type].call({parser:this},l);if(!1!==c||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(l.type)){r+=c||"";continue}}const o=s;switch(o.type){case"space":r+=this.renderer.space(o);continue;case"hr":r+=this.renderer.hr(o);continue;case"heading":r+=this.renderer.heading(o);continue;case"code":r+=this.renderer.code(o);continue;case"table":r+=this.renderer.table(o);continue;
1case"blockquote":r+=this.renderer.blockquote(o);continue;case"list":r+=this.renderer.list(o);continue;case"html":r+=this.renderer.html(o);continue;case"paragraph":r+=this.renderer.paragraph(o);continue;case"text":{let l=o,c=this.renderer.text(l);for(;i+1<a.length&&"text"===a[i+1].type;)l=a[++i],c+="\n"+this.renderer.text(l);r+=t?this.renderer.paragraph({type:"paragraph",raw:c,text:c,tokens:[{type:"text",raw:c,text:c,escaped:!0}]}):c;continue}default:{const l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}parseInline(a,t=this.renderer){let r="";for(let i=0;i<a.length;i++){const s=a[i];if(this.options.extensions?.renderers?.[s.type]){const l=this.options.extensions.renderers[s.type].call({parser:this},s);if(!1!==l||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){r+=l||"";continue}}const o=s;switch(o.type){case"escape":case"text":r+=t.text(o);break;case"html":r+=t.html(o);break;case"link":r+=t.link(o);break;case"image":r+=t.image(o);break;case"strong":r+=t.strong(o);break;case"em":r+=t.em(o);break;case"codespan":r+=t.codespan(o);break;case"br":r+=t.br(o);break;case"del":r+=t.del(o);break;default:{const l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}},cs=class{options;block;constructor(a){this.options=a||li}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(a){return a}postprocess(a){return a}processAllTokens(a){return a}provideLexer(){return this.block?Sr.lex:Sr.lexInline}provideParser(){return this.block?Er.parse:Er.parseInline}},ci=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Er;Renderer=ls;TextRenderer=lo;Lexer=Sr;Tokenizer=os;Hooks=cs;constructor(...n){this.use(...n)}walkTokens(n,a){let t=[];for(const r of n)switch(t=t.concat(a.call(this,r)),r.type){case"table":{const i=r;for(const s of i.header)t=t.concat(this.walkTokens(s.tokens,a));for(const s of i.rows)for(const o of s)t=t.concat(this.walkTokens(o.tokens,a));break}case"list":t=t.concat(this.walkTokens(r.items,a));break;default:{const i=r;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(s=>{const o=i[s].flat(1/0);t=t.concat(this.walkTokens(o,a))}):i.tokens&&(t=t.concat(this.walkTokens(i.tokens,a)))}}return t}use(...n){const a=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{const r={...t};if(r.async=this.defaults.async||r.async||!1,t.extensions&&(t.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const s=a.renderers[i.name];a.renderers[i.name]=s?function(...o){let l=i.renderer.apply(this,o);return!1===l&&(l=s.apply(this,o)),l}:i.renderer}if("tokenizer"in i){if(!i.level||"block"!==i.level&&"inline"!==i.level)throw new Error("extension level must be 'block' or 'inline'");const s=a[i.level];s?s.unshift(i.tokenizer):a[i.level]=[i.tokenizer],i.start&&("block"===i.level?a.startBlock?a.startBlock.push(i.start):a.startBlock=[i.start]:"inline"===i.level&&(a.startInline?a.startInline.push(i.start):a.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(a.childTokens[i.name]=i.childTokens)}),r.extensions=a),t.renderer){const i=this.defaults.renderer||new ls(this.defaults);for(const s in t.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;const l=t.renderer[s],c=i[s];i[s]=(...d)=>{let p=l.apply(i,d);return!1===p&&(p=c.apply(i,d)),p||""}}r.renderer=i}if(t.tokenizer){const i=this.defaults.tokenizer||new os(this.defaults);for(const s in t.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;const l=t.tokenizer[s],c=i[s];i[s]=(...d)=>{let p=l.apply(i,d);return!1===p&&(p=c.apply(i,d)),p}}r.tokenizer=i}if(t.hooks){const i=this.defaults.hooks||new cs;for(const s in t.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;const l=t.hooks[s],c=i[s];i[s]=cs.passThroughHooks.has(s)?d=>{if(this.defaults.async)return Promise.resolve(l.call(i,d)).then(u=>c.call(i,u));const p=l.call(i,d);return c.call(i,p)}:(...d)=>{let p=l.apply(i,d);return!1===p&&(p=c.apply(i,d)),p}}r.hooks=i}if(t.walkTokens){const i=this.defaults.walkTokens,s=t.walkTokens;r.walkTokens=function(o){let l=[];return l.push(s.call(this,o)),i&&(l=l.concat(i.call(this,o))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,a){return Sr.lex(n,a??this.defaults)}parser(n,a){return Er.parse(n,a??this.defaults)}parseMarkdown(n){return(t,r)=>{const i={...r},s={...this.defaults,...i},o=this.onError(!!s.silent,!!s.async);if(!0===this.defaults.async&&!1===i.async)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return o(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));s.hooks&&(s.hooks.options=s,s.hooks.block=n);const l=s.hooks?s.hooks.provideLexer():n?Sr.lex:Sr.lexInline,c=s.hooks?s.hooks.provideParser():n?Er.parse:Er.parseInline;if(s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(t):t).then(d=>l(d,s)).then(d=>s.hooks?s.hooks.processAllTokens(d):d).then(d=>s.walkTokens?Promise.all(this.walkTokens(d,s.walkTokens)).then(()=>d):d).then(d=>c(d,s)).then(d=>s.hooks?s.hooks.postprocess(d):d).catch(o);try{s.hooks&&(t=s.hooks.preprocess(t));let d=l(t,s);s.hooks&&(d=s.hooks.processAllTokens(d)),s.walkTokens&&this.walkTokens(d,s.walkTokens);let p=c(d,s);return s.hooks&&(p=s.hooks.postprocess(p)),p}catch(d){return o(d)}}}onError(n,a){return t=>{if(t.message+="\nPlease report this to https://github.com/markedjs/marked.",n){const r="<p>An error occurred:</p><pre>"+hr(t.message+"",!0)+"</pre>";return a?Promise.resolve(r):r}if(a)return Promise.reject(t);throw t}}};function st(n,a){return ci.parse(n,a)}st.options=st.setOptions=function(n){return ci.setOptions(n),zl(st.defaults=ci.defaults),st},st.getDefaults=function Zs(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},st.defaults=li,st.use=function(...n){return ci.use(...n),zl(st.defaults=ci.defaults),st},st.walkTokens=function(n,a){return ci.walkTokens(n,a)},st.parseInline=ci.parseInline,st.Parser=Er,st.parser=Er.parse,st.Renderer=ls,st.TextRenderer=lo,st.Lexer=Sr,st.lexer=Sr.lex,st.Tokenizer=os,st.Hooks=cs,st.parse=st;const A_=()=>({width:"450px"});function M_(n,a){if(1&n&&(e.j41(0,"div",4)(1,"div",5)(2,"div",6),e.nrm(3,"i",7),e.k0s(),e.j41(4,"div",8)(5,"span",9),e.EFF(6,"AI Deal Intelligence"),e.k0s(),e.j41(7,"span",10),e.EFF(8),e.k0s()()()()),2&n){const t=e.XpG();e.R7$(8),e.JRh(null==t.card?null:t.card.Title)}}
1function P_(n,a){1&n&&(e.j41(0,"div",3)(1,"div",11)(2,"span",12),e.EFF(3,"\u2726"),e.k0s(),e.j41(4,"span",13),e.EFF(5,"\u2726"),e.k0s(),e.j41(6,"span",14),e.EFF(7,"\u2726"),e.k0s(),e.j41(8,"span",15),e.EFF(9,"\u2726"),e.k0s()(),e.j41(10,"div",16),e.EFF(11,"\u{1f984}"),e.k0s(),e.j41(12,"div",17),e.nrm(13,"span",18)(14,"span",18)(15,"span",18),e.k0s(),e.j41(16,"p",19),e.EFF(17,"Analyzing deal data..."),e.k0s()())}function O_(n,a){if(1&n&&(e.j41(0,"span",37),e.nrm(1,"i",38),e.EFF(2),e.k0s()),2&n){const t=e.XpG(2);e.R7$(2),e.SpI(" ",t.aiInsight.Score,"/100 ")}}function N_(n,a){if(1&n&&(e.j41(0,"span",39),e.nrm(1,"i",40),e.EFF(2),e.k0s()),2&n){const t=e.XpG(2);e.R7$(2),e.SpI(" ",null==t.track?null:t.track.Title," ")}}function G_(n,a){if(1&n&&(e.j41(0,"span",41),e.EFF(1),e.nI1(2,"currency"),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.SpI(" ",e.ii3(2,1,t.card.Amount,"ZAR","symbol-narrow","1.0-0")," ")}}function B_(n,a){if(1&n&&(e.j41(0,"span",39),e.nrm(1,"i",42),e.EFF(2),e.nI1(3,"date"),e.k0s()),2&n){const t=e.XpG(2);e.R7$(2),e.SpI(" ",e.i5U(3,1,t.card.DueDateUtc,"dd.MM.yyyy")," ")}}function L_(n,a){if(1&n&&(e.j41(0,"span",43),e.EFF(1),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.SpI(" ",t.getInitials(t.card.AssignedUsers)," ")}}function $_(n,a){if(1&n&&(e.j41(0,"div",20),e.DNE(1,O_,3,1,"span",21)(2,N_,3,1,"span",22)(3,G_,3,6,"span",23)(4,B_,4,4,"span",22)(5,L_,2,1,"span",24),e.k0s(),e.j41(6,"div",25)(7,"p-tabs",26)(8,"p-tablist")(9,"p-tab",27),e.nrm(10,"i",28),e.j41(11,"span"),e.EFF(12,"Overview"),e.k0s()(),e.j41(13,"p-tab",29),e.nrm(14,"i",30),e.j41(15,"span"),e.EFF(16,"Risk"),e.k0s()(),e.j41(17,"p-tab",31),e.nrm(18,"i",32),e.j41(19,"span"),e.EFF(20,"Next Steps"),e.k0s()(),e.j41(21,"p-tab",33),e.nrm(22,"i",34),e.j41(23,"span"),e.EFF(24,"Timeline"),e.k0s()()(),e.j41(25,"p-tabpanels",35)(26,"p-tabpanel",27),e.nrm(27,"div",36),e.k0s(),e.j41(28,"p-tabpanel",29),e.nrm(29,"div",36),e.k0s(),e.j41(30,"p-tabpanel",31),e.nrm(31,"div",36),e.k0s(),e.j41(32,"p-tabpanel",33),e.nrm(33,"div",36),e.k0s()()()()),2&n){const t=e.XpG();e.R7$(),e.Y8G("ngIf",null==t.aiInsight?null:t.aiInsight.Score),e.R7$(),e.Y8G("ngIf",null==t.track?null:t.track.Title),e.R7$(),e.Y8G("ngIf",null==t.card?null:t.card.Amount),e.R7$(),e.Y8G("ngIf",null==t.card?null:t.card.DueDateUtc),e.R7$(),e.Y8G("ngIf",null==t.card?null:t.card.AssignedUsers),e.R7$(22),e.Y8G("innerHTML",null==t.aiInsight?null:t.aiInsight.Overview,e.npT),e.R7$(2),e.Y8G("innerHTML",null==t.aiInsight?null:t.aiInsight.Risk,e.npT),e.R7$(2),e.Y8G("innerHTML",null==t.aiInsight?null:t.aiInsight.NextSteps,e.npT),e.R7$(2),e.Y8G("innerHTML",null==t.aiInsight?null:t.aiInsight.Timeline,e.npT)}}function V_(n,a){1&n&&(e.j41(0,"div",44)(1,"span",45),e.EFF(2," AI-generated insights \u2022 Data sourced from deal activity "),e.k0s()())}let U_=(()=>{class n{_boardService;messageService;cdr;card;visible=!1;visibleChange=new e.bkB;loadAiInsight=!1;aiInsight;track;constructor(t,r,i){this._boardService=t,this.messageService=r,this.cdr=i}ngOnInit(){this.card&&(this.openAiInsights(this.card.Id),this.getTrack(this.card.TrackId))}openAiInsights(t){this.loadAiInsight=!0,this._boardService.getAiInsights(t).subscribe({next:r=>{this.aiInsight=r,this.aiInsight.Overview=st.parse(this.aiInsight.Overview,{async:!1}),this.aiInsight.Risk=st.parse(this.aiInsight.Risk,{async:!1}),this.aiInsight.NextSteps=st.parse(this.aiInsight.NextSteps,{async:!1}),this.aiInsight.Timeline=st.parse(this.aiInsight.Timeline,{async:!1}),this.loadAiInsight=!1,this.cdr.detectChanges()},error:()=>{this.messageService.add({severity:"error",summary:"Error",detail:"There was an error getting your insights"})}})}closeAiInsights(){this.visible=!1}getInitials(t){return t?(Array.isArray(t)?t:t.split(",")).map(i=>i.trim().split(" ").filter(s=>s.length>0).map(s=>s[0]).join("").substring(0,2).toUpperCase()).join(", "):""}getTrack(t){this._boardService.getTrack(t.toString()).subscribe({next:r=>{this.track=r},error:r=>{console.error("Error loading track:",r)}})}static \u0275fac=function(r){return new(r||n)(e.rXU(_t.a),e.rXU(be.bg),e.rXU(e.gRc))};static \u0275cmp=e.VBU({type:n,selectors:[["app-deal-ai"]],inputs:{card:"card",visible:"visible",track:"track"},outputs:{visibleChange:"visibleChange"},standalone:!1,decls:7,vars:6,consts:[["header",""],["footer",""],["position","right","styleClass","ai-intelligence-drawer",3,"visibleChange","onHide","visible","blockScroll"],[1,"loader-container"],[1,"flex","flex-column","w-full","gap-3"],[1,"flex","align-items-center","gap-3"],[1,"icon-container","bg-blue-50","border-circle","flex","align-items-center","justify-content-center",2,"min-width","42px","height","42px"],[1,"pi","pi-sparkles","text-blue-500",2,"font-size","1.2rem"],[1,"flex","flex-column"],[1,"font-bold","text-xl","text-900","line-height-2"],[1,"text-sm","text-500"],[1,"sparkles"],[1,"sparkle","s1"],[1,"sparkle","s2"],[1,"sparkle","s3"],[1,"sparkle","s4"],[1,"unicorn"],[1,"dots"],[1,"dot"],[1,"label"],[1,"flex","flex-wrap","gap-2","align-items-center",2,"padding","10px !important"],["class","flex align-items-center gap-1 px-2 py-1 border-round-3xl text-xs font-semibold pill-score",4,"ngIf"],["class","flex align-items-center gap-1 px-2 py-1 border-round-3xl text-xs pill-gray",4,"ngIf"],["class","flex align-items-center px-2 py-1 border-round-3xl text-xs pill-gray",4,"ngIf"],["class","flex align-items-center justify-content-center px-2 py-1 border-round-3xl text-xs font-semibold pill-gray uppercase",4,"ngIf"],[1,"flex","flex-column","mt-2"],["value","0",1,"custom-tabs","p-2"],["value","0"],[1,"pi","pi-briefcase","-mr-1","text-xs"],["value","1"],[1,"pi","pi-exclamation-triangle","mr-1","text-xs"],["value","2"],[1,"pi","pi-check-circle","-mr-1","text-xs"],["value","3"],[1,"pi","pi-clock","mr-1","text-xs"],[1,"px-3","py-2",2,"overflow-y","auto"],[1,"insight-content",3,"innerHTML"],[1,"flex","align-items-center","gap-1","px-2","py-1","border-round-3xl","text-xs","font-semibold","pill-score"],[1,"pi","pi-bullseye","text-xs"],[1,"flex","align-items-center","gap-1","px-2","py-1","border-round-3xl","text-xs","pill-gray"],[1,"pi","pi-gift","text-xs"],[1,"flex","align-items-center","px-2","py-1","border-round-3xl","text-xs","pill-gray"],[1,"pi","pi-calendar","text-xs"],[1,"flex","align-items-center","justify-content-center","px-2","py-1","border-round-3xl","text-xs","font-semibold","pill-gray","uppercase"],[1,"text-center"],[1,"text-xs","text-500","font-light"]],template:function(r,i){if(1&r){const s=e.RV6();e.j41(0,"p-drawer",2),e.mxI("visibleChange",function(l){return e.eBV(s),e.DH7(i.visible,l)||(i.visible=l),e.Njj(l)}),e.bIt("onHide",function(){return e.eBV(s),e.Njj(i.closeAiInsights())}),e.DNE(1,M_,9,1,"ng-template",null,0,e.C5r)(3,P_,18,0,"div",3)(4,$_,34,9)(5,V_,3,0,"ng-template",null,1,e.C5r),e.k0s()}2&r&&(e.Aen(e.lJ4(5,A_)),e.R50("visible",i.visible),e.Y8G("blockScroll",!0),e.R7$(3),e.vxM(i.loadAiInsight?3:4))},dependencies:[q.bT,Ve._s,pn.oz,pn.tU,pn.wb,pn.T2,pn.Kp,q.oe,q.vh],styles:[".loader-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;padding:2.5rem 0;gap:1rem}.sparkles[_ngcontent-%COMP%]{position:relative;width:70px;height:70px}
1.sparkle[_ngcontent-%COMP%]{position:absolute;animation:_ngcontent-%COMP%_ping 1.5s cubic-bezier(0,0,.2,1) infinite}.s1[_ngcontent-%COMP%]{top:-8px;left:-8px;color:#facc15;animation-duration:1.5s}.s2[_ngcontent-%COMP%]{top:-4px;right:0;color:#f472b6;animation-duration:2s;animation-delay:.3s}.s3[_ngcontent-%COMP%]{bottom:0;left:-12px;color:#c084fc;animation-duration:1.8s;animation-delay:.7s}.s4[_ngcontent-%COMP%]{bottom:-4px;right:4px;color:#60a5fa;animation-duration:2.2s;animation-delay:.5s}.unicorn[_ngcontent-%COMP%]{font-size:3.75rem;animation:_ngcontent-%COMP%_unicornDance 1s ease-in-out infinite;-webkit-user-select:none;user-select:none}.dots[_ngcontent-%COMP%]{display:flex;gap:6px}.dot[_ngcontent-%COMP%]{width:6px;height:6px;border-radius:50%;background:#3b82f6;animation:_ngcontent-%COMP%_bounce 1s infinite}.dot[_ngcontent-%COMP%]:nth-child(2){animation-delay:.15s}.dot[_ngcontent-%COMP%]:nth-child(3){animation-delay:.3s}.label[_ngcontent-%COMP%]{font-size:.75rem;color:#6b7280;font-weight:500}@keyframes _ngcontent-%COMP%_unicornDance{0%,to{transform:translateY(0) rotate(0)}15%{transform:translateY(-12px) rotate(-8deg)}30%{transform:translateY(0) rotate(0) scaleX(-1)}45%{transform:translateY(-10px) rotate(6deg) scaleX(-1)}60%{transform:translateY(0) rotate(0)}75%{transform:translateY(-14px) rotate(-5deg)}90%{transform:translateY(-2px) rotate(3deg)}}@keyframes _ngcontent-%COMP%_ping{75%,to{transform:scale(2);opacity:0}}@keyframes _ngcontent-%COMP%_bounce{0%,to{transform:translateY(0)}50%{transform:translateY(-8px)}}.pill-score[_ngcontent-%COMP%]{background:#fff3e6;color:#f59e0b;border:1px solid #fde6c7}.pill-gray[_ngcontent-%COMP%]{background:#f3f4f6;color:#6b7280}.custom-tabs[_ngcontent-%COMP%] .p-tab[_ngcontent-%COMP%]{font-size:.9rem!important;font-weight:600!important;padding:10px!important;font-family:Inter,sans-serif!important}.custom-tabs[_ngcontent-%COMP%] .p-tablist[_ngcontent-%COMP%]{border-top:1px solid #efebebcc;background:#f8fafc} .ai-intelligence-drawer .p-drawer-content{padding:0!important} .ai-intelligence-drawer .p-drawer-header{padding:10px!important} .ai-intelligence-drawer .p-drawer-footer{border-top:1px solid #cccc!important}.insight-content[_ngcontent-%COMP%]{font-size:14px}.custom-tabs[_ngcontent-%COMP%] p-tabpanels[_ngcontent-%COMP%]{max-height:38rem;overflow-y:auto;scrollbar-width:thin}"]})}return n})();var dc=ee(1514);const X_=()=>({width:"550px"}),Y_=(n,a)=>({"bg-blue-50 border-blue-500 shadow-1":n,"bg-white border-200 text-600 hover:surface-100":a}),W_=(n,a)=>({"bg-blue-50 border-blue-500 shadow-1":n,"bg-white border-200":a});function H_(n,a){if(1&n&&(e.j41(0,"div")(1,"h1",12),e.EFF(2,"Update loss reason"),e.k0s(),e.j41(3,"p",13),e.EFF(4," Refine why "),e.j41(5,"span",14),e.EFF(6),e.k0s(),e.EFF(7," was marked as lost. "),e.k0s()()),2&n){const t=e.XpG(3);e.R7$(6),e.JRh(t.Card.Title)}}function z_(n,a){1&n&&e.nrm(0,"div",15)}function q_(n,a){if(1&n&&(e.qex(0),e.DNE(1,H_,8,1,"div",5)(2,z_,1,0,"div",11),e.bVm()),2&n){let t,r;const i=e.XpG(2);e.R7$(),e.Y8G("ngIf",(null==(t=i.closeForm.get("Status"))?null:t.value)===i.OpportunityStatusEnum.Lost),e.R7$(),e.Y8G("ngIf",(null==(r=i.closeForm.get("Status"))?null:r.value)!==i.OpportunityStatusEnum.Lost)}}function J_(n,a){if(1&n&&(e.j41(0,"div")(1,"h1",12),e.EFF(2,"Close as Won"),e.k0s(),e.j41(3,"p",13),e.EFF(4," Celebrate! Confirm the details for closing "),e.j41(5,"span",14),e.EFF(6),e.k0s(),e.EFF(7,". "),e.k0s()()),2&n){const t=e.XpG(2);e.R7$(6),e.JRh(t.Card.Title)}}function K_(n,a){if(1&n){const t=e.RV6();e.j41(0,"div")(1,"div",16)(2,"button",17),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.isManageMode=!1)}),e.k0s(),e.j41(3,"h1",12),e.EFF(4,"Manage loss reasons"),e.k0s()(),e.j41(5,"div")(6,"p",18),e.EFF(7,"Add your own reasons or rename the defaults. Hidden defaults can be restored anytime."),e.k0s()()()}}function Q_(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",19),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.isManageMode=!0)}),e.k0s()}}function Z_(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",6)(1,"div",7),e.DNE(2,q_,3,2,"ng-container",5)(3,J_,8,1,"div",5)(4,K_,8,0,"div",5),e.k0s(),e.j41(5,"div",8),e.DNE(6,Q_,1,0,"button",9),e.j41(7,"button",10),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.showCloseOpportunityDialog=!1)}),e.k0s()()()}if(2&n){let t,r;const i=e.XpG();e.R7$(2),e.Y8G("ngIf",!i.isManageMode),e.R7$(),e.Y8G("ngIf",(null==(t=i.closeForm.get("Status"))?null:t.value)===i.OpportunityStatusEnum.Won),e.R7$(),e.Y8G("ngIf",i.isManageMode),e.R7$(2),e.Y8G("ngIf",!i.isManageMode&&(null==(r=i.closeForm.get("Status"))?null:r.value)===i.OpportunityStatusEnum.Lost)}}function ex(n,a){1&n&&(e.j41(0,"div",31),e.nrm(1,"i",32),e.j41(2,"span",33),e.EFF(3,"Loading reasons..."),e.k0s()())}function tx(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",37)(1,"div",38),e.bIt("click",function(){let i;const s=e.eBV(t).$implicit,o=e.XpG(4);return e.Njj(null==(i=o.closeForm.get("DealLossTeamOverrideId"))?null:i.setValue(s.value))}),e.j41(2,"div",39),e.nrm(3,"i",40),e.j41(4,"span",41),e.EFF(5),e.k0s()()()()}if(2&n){let t,r,i;const s=a.$implicit,o=e.XpG(4);e.R7$(),e.Y8G("ngClass",e.l_i(6,Y_,(null==(t=o.closeForm.get("DealLossTeamOverrideId"))?null:t.value)===s.value,(null==(t=o.closeForm.get("DealLossTeamOverrideId"))?null:t.value)!==s.value)),e.R7$(2),e.HbH("pi mr-3 "+o.getIconForReason(s.label)),e.Y8G("ngClass",(null==(r=o.closeForm.get("DealLossTeamOverrideId"))?null:r.value)===s.value?"text-blue-500":"text-500"),e.R7$(),e.Y8G("ngClass",(null==(i=o.closeForm.get("DealLossTeamOverrideId"))?null:i.value)===s.value?"text-blue-900":"text-700"),e.R7$(),e.SpI(" ",s.label," ")}}function nx(n,a){1&n&&(e.j41(0,"div",42),e.EFF(1," No loss reasons available for this team. "),e.k0s())}function rx(n,a){if(1&n&&(e.j41(0,"div",34),e.DNE(1,tx,6,9,"div",35)(2,nx,2,0,"div",36),e.k0s()),2&n){const t=e.XpG(3);e.R7$(),e.Y8G("ngForOf",t.dealLossReasons),e.R7$(),e.Y8G("ngIf",0===(null==t.dealLossReasons?null:t.deal
1LossReasons.length))}}function ix(n,a){if(1&n&&(e.j41(0,"div",28),e.DNE(1,ex,4,0,"div",29)(2,rx,3,2,"div",30),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.Y8G("ngIf",t.loadingReasons),e.R7$(),e.Y8G("ngIf",!t.loadingReasons)}}function ax(n,a){if(1&n){const t=e.RV6();e.j41(0,"form",20),e.DNE(1,ix,3,2,"div",21),e.j41(2,"div",22)(3,"label",23),e.EFF(4),e.k0s(),e.nrm(5,"textarea",24),e.k0s(),e.j41(6,"div",25)(7,"button",26),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.cancelForm())}),e.k0s(),e.j41(8,"button",27),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.submitClosure())}),e.k0s()()()}if(2&n){let t,r,i;const s=e.XpG();e.Y8G("formGroup",s.closeForm),e.R7$(),e.Y8G("ngIf",(null==(t=s.closeForm.get("Status"))?null:t.value)===s.OpportunityStatusEnum.Lost),e.R7$(3),e.SpI(" ",(null==(r=s.closeForm.get("Status"))?null:r.value)===s.OpportunityStatusEnum.Lost?"Additional Context (Optional)":"Description"," "),e.R7$(4),e.xc7("background-color","#3B82F6"),e.Y8G("label",(null==(i=s.closeForm.get("Status"))?null:i.value)===s.OpportunityStatusEnum.Lost?"Save changes":"Submit")}}function sx(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",52)(1,"div",39),e.nrm(2,"i",53),e.j41(3,"span",41),e.EFF(4),e.k0s()(),e.j41(5,"div",54)(6,"button",55),e.bIt("click",function(i){const s=e.eBV(t).$implicit,o=e.XpG(2);return i.stopPropagation(),e.Njj(o.deleteReason(i,s.value))}),e.k0s()()()}if(2&n){const t=a.$implicit,r=e.XpG(2);e.Y8G("ngClass",e.l_i(6,W_,t.value==r.Card.DealLossTeamOverrideId,t.value!=r.Card.DealLossTeamOverrideId)),e.R7$(2),e.HbH("pi mr-3 "+r.getIconForReason(t.label)),e.Y8G("ngClass",t.value==r.Card.DealLossTeamOverrideId?"text-blue-500":"text-400"),e.R7$(),e.Y8G("ngClass",t.value==r.Card.DealLossTeamOverrideId?"text-blue-700":"text-700"),e.R7$(),e.SpI(" ",t.label," ")}}function ox(n,a){if(1&n){const t=e.RV6();e.j41(0,"div")(1,"label",23),e.EFF(2,"Add a new reason"),e.k0s(),e.j41(3,"div",43)(4,"div",44),e.nrm(5,"i",45),e.k0s(),e.j41(6,"input",46,0),e.bIt("keydown.enter",function(){e.eBV(t);const i=e.sdS(7),s=e.XpG();return e.Njj(s.saveNewReason(i.value,i))}),e.k0s(),e.j41(8,"button",47),e.bIt("click",function(){e.eBV(t);const i=e.sdS(7),s=e.XpG();return e.Njj(s.saveNewReason(i.value,i))}),e.k0s()(),e.j41(9,"div",48),e.DNE(10,sx,7,9,"div",49),e.k0s(),e.j41(11,"div",50)(12,"button",51),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.isManageMode=!1)}),e.k0s()()()}if(2&n){const t=e.sdS(7),r=e.XpG();e.R7$(6),e.Y8G("disabled",r.isSaving),e.R7$(2),e.Y8G("icon",r.isSaving?"pi pi-spin pi-spinner":"pi pi-plus")("label",r.isSaving?"Saving...":"Add")("disabled",r.isSaving||!t.value.trim()),e.R7$(2),e.Y8G("ngForOf",r.dealLossReasons)}}let pc=(()=>{class n{_boardService;confirmationService;formBuilder;messageService;teamsService;cardClosed=new e.bkB;destroyParent=new e.bkB;closeModal=new e.bkB;Card;ClosureType;teamId;closeForm;OpportunityStatusEnum=J.t4;selectedDealLossId=null;showCloseOpportunityDialog=!1;isManageMode=!1;dealLossReasons=[];loadingReasons=!1;isSaving=!1;constructor(t,r,i,s,o){this._boardService=t,this.confirmationService=r,this.formBuilder=i,this.messageService=s,this.teamsService=o}ngOnInit(){this.teamId=this.teamsService.getCurrentTeam.Team.Id,this.closeForm=this.formBuilder.group({CardId:[null],Status:[null,L.k0.required],DateClosedUtc:[null],Description:[""],DealLossTeamOverrideId:[null]});const i={"Client Win":J.t4.Won,"Client Lost":J.t4.Lost,Paused:J.t4.Paused}[this.ClosureType];this.closeForm.patchValue({CardId:this.Card?.Id??null,Status:i,DateClosedUtc:this.getTodayDateUtc()}),this.loadLossReasons(),this.Card&&this.closeForm.patchValue({DealLossTeamOverrideId:this.Card.DealLossTeamOverrideId?String(this.Card.DealLossTeamOverrideId):null,Description:this.Card.OpportunityClosureDescription||""})}
1submitClosure(){if(this.closeForm.invalid)return;const t=this.closeForm.value;this._boardService.closeOpportunity(t).subscribe({next:()=>{if(this.Card.Status=t.Status,t.Status===this.OpportunityStatusEnum.Lost){this.Card.OpportunityClosureDescription=t.Description;const r=this.dealLossReasons.find(i=>i.value===t.DealLossTeamOverrideId.toString());this.Card.OpportunityClosureLossReason=r?r.label:""}else this.Card.OpportunityClosureLossReason=null,this.Card.OpportunityClosureDescription=null;this.cardClosed.emit({cardId:t.CardId,status:t.Status}),this.destroyParent.emit(),this.messageService.add({severity:"success",summary:"Opportunity Closed",detail:"The opportunity was successfully closed.",life:3e3})},error:r=>{console.error("Error closing opportunity",r),this.messageService.add({severity:"error",summary:"Error",detail:"Failed to close the opportunity. Please try again.",life:5e3})}})}getTodayDateUtc(){const t=new Date;return new Date(t.getTime()+6e4*t.getTimezoneOffset()).toISOString().split("T")[0]}cancel(){this.destroyParent.emit()}get statusIconClass(){switch(this.closeForm.get("Status")?.value){case J.t4.Won:return"pi pi-check-circle text-green-600";case J.t4.Lost:return"pi pi-times-circle text-red-600";case J.t4.Paused:return"pi pi-pause-circle text-blue-600";default:return""}}destroyComponent(){this.closeModal.emit()}loadLossReasons(){this.loadingReasons=!0,this._boardService.getLossReasons(Number(this.teamId)).subscribe({next:t=>{this.dealLossReasons=t,this.loadingReasons=!1},error:t=>{console.error("Failed to load loss reasons",t),this.loadingReasons=!1}})}getIconForReason(t){if(!t)return"pi-tag";const r=t.toLowerCase();return r.includes("interested")?"pi-thumbs-down":r.includes("responsive")?"pi-times-circle":r.includes("budget")||r.includes("overpaid")?"pi-wallet":r.includes("provider")||r.includes("competitor")?"pi-users":r.includes("proposal")||r.includes("quote")?"pi-file-excel":r.includes("timing")?"pi-clock":r.includes("pricing")?"pi-dollar":r.includes("unqualified")?"pi-exclamation-circle":"pi-question-circle"}saveNewReason(t,r){if(!t||""===t.trim())return;this.isSaving=!0;const i={teamId:Number(this.teamId),title:t.trim(),description:"",defaultId:null};this._boardService.createLossReason(i).subscribe({next:s=>{this.messageService.add({severity:"success",summary:"Success",detail:"New loss reason added"}),r.value="",this.loadLossReasons(),this.isSaving=!1},error:s=>{this.isSaving=!1,this.messageService.add({severity:"error",summary:"Error",detail:s.error||"Failed to save the new reason"}),console.error("Error creating reason:",s)}})}deleteReason(t,r){this.confirmationService.confirm({target:t.target,message:"Are you sure you want to delete this reason?",icon:"pi pi-exclamation-triangle",acceptLabel:"Yes, delete",rejectLabel:"Cancel",acceptButtonStyleClass:"p-button-danger p-button-sm",rejectButtonStyleClass:"p-button-text p-button-sm",accept:()=>{this._boardService.deleteLossReason(r).subscribe({next:()=>{this.dealLossReasons=this.dealLossReasons.filter(i=>i.value!==r.toString()),this.Card.DealLossTeamOverrideId==r&&(this.Card.DealLossTeamOverrideId=null),this.messageService.add({severity:"success",summary:"Deleted",detail:"Loss reason removed successfully"})},error:i=>{this.messageService.add({severity:"error",summary:"Action Denied",detail:"string"==typeof i.error?i.error:"This reason is in use and cannot be deleted.",life:5e3})}})}})}cancelForm(){this.closeForm.reset(),this.Card&&this.closeForm.patchValue({Status:this.OpportunityStatusEnum.Lost,DealLossTeamOverrideId:this.Card.DealLossTeamOverrideId?String(this.Card.DealLossTeamOverrideId):null,Description:this.Card.OpportunityClosureDescription||""}),this.showCloseOpportunityDialog=!1}static \u0275fac=function(r){return new(r||n)(e.rXU(_t.a),e.rXU(be.td),e.rXU(L.ok),e.rXU(be.bg),e.rXU(rt.n))};static \u0275cmp=e.VBU({type:n,selectors:[["app-close-opportunity"]],inputs:{Card:"Card",ClosureType:"ClosureType",showCloseOpportunityDialog:"showCloseOpportunityDialog"},outputs:{cardClosed:"cardClosed",destroyParent:"destroyParent",closeModal:"closeModal"},standalone:!1,decls:6,vars:11,consts:[["newReasonInput",""],["appendTo","body","styleClass","bg-white closeOpportunityModal border-round-xl shadow-4",3,"visibleChange","onHide","visible","modal","closable","draggable","resizable","baseZIndex"],["pTemplate","header"],[1,"p-2"],["class","p-fluid",3,"formGroup",4,"ngIf"],[4,"ngIf"],[1,"flex","justify-content-between","align-items-start","w-full","pt-2"],[1,"flex-grow-1"],[1,"flex","align-items-center","gap-2","ml-3"],["pButton","","type","button","icon","pi pi-sliders-h","label","Manage","class","p-button-text p-button-plain p-button-sm text-600 font-medium py-1 px-2",3,"click",4,"ngIf"],["pButton","","type","button","icon","pi pi-times",1,"p-button-rounded","p-button-text","p-button-plain","p-0","text-500",2,"width","2rem","height","2rem",3,"click"],["class","flex align-items-center gap-3",4,"ngIf"],[1,"text-xl","font-bold","text-900","m-0"],[1,"text-sm","text-500","m-0","mt-2"],[1,"font-bold","text-700"],[1,"flex","align-items-center","gap-3"],[1,"flex","align-items-center","mb-1"],["pButton","","type","button","icon","pi pi-arrow-left",1,"p-button-text","p-button-plain","p-0","mr-2","text-900",3,"click"],[1,"text-xs","text-500","m-0","mt-2"],["pButton","","type","button","icon","pi pi-sliders-h","label","Manage",1,"p-button-text","p-button-plain","p-button-sm","text-600","font-medium","py-1","px-2",3,"click"],[1,"p-fluid",3,"formGroup"],["class","mb-4",4,"ngIf"],[1,"field","mb-5"],[1,"block","mb-2","font-bold","text-xs","text-500","uppercase","tracking-wider"],["pInputTextarea","","rows","4","formControlName","Description","placeholder","Any extra detail that c
1ould help the team next time...",1,"w-full","p-3","border-1","border-200","border-round-lg","shadow-none","focus:border-blue-500",2,"resize","none"],[1,"flex","justify-content-end","align-items-center","gap-3","pt-3","border-top-1","border-100"],["pButton","","type","button","label","Cancel",1,"p-button-text","p-button-plain","font-bold","text-800",3,"click"],["pButton","","type","button",1,"p-button-raised","border-none","px-5","py-2","font-bold",3,"click","label"],[1,"mb-4"],["class","flex justify-content-center align-items-center py-5",4,"ngIf"],["class","grid mt-2 overflow-y-auto pr-1","style","max-height: 190px;",4,"ngIf"],[1,"flex","justify-content-center","align-items-center","py-5"],[1,"pi","pi-spin","pi-spinner","text-blue-500",2,"font-size","2rem"],[1,"ml-2","text-500","font-medium"],[1,"grid","mt-2","overflow-y-auto","pr-1",2,"max-height","190px"],["class","col-6 p-2",4,"ngFor","ngForOf"],["class","col-12 text-center text-500 py-3",4,"ngIf"],[1,"col-6","p-2"],[1,"flex","align-items-center","p-2","border-1","border-round-lg","cursor-pointer","transition-all","transition-duration-150",3,"click","ngClass"],[1,"flex","align-items-center"],[2,"font-size","0.75rem",3,"ngClass"],[1,"text-xs","font-medium",3,"ngClass"],[1,"col-12","text-center","text-500","py-3"],[1,"flex","gap-2","mb-4"],[1,"flex","align-items-center","justify-content-center","border-1","border-200","border-round-md","bg-gray-50","px-3"],[1,"pi","pi-ellipsis-h","text-400"],["type","text","pInputText","","placeholder","e.g. Wrong fit",1,"flex-grow-1","border-200",3,"keydown.enter","disabled"],["pButton","","type","button",1,"bg-blue-500","border-none","px-4",3,"click","icon","label","disabled"],[1,"overflow-y-auto","pr-1",2,"max-height","265px"],["class","flex align-items-center justify-content-between p-3 border-1 border-round-md mb-2 cursor-pointer transition-colors transition-duration-200",3,"ngClass",4,"ngFor","ngForOf"],[1,"flex","justify-content-end","mt-3"],["pButton","","type","button","label","Done",1,"p-button-text","font-bold","text-700",3,"click"],[1,"flex","align-items-center","justify-content-between","p-3","border-1","border-round-md","mb-2","cursor-pointer","transition-colors","transition-duration-200",3,"ngClass"],[2,"font-size","0.9rem",3,"ngClass"],[1,"flex","gap-3"],["pButton","","type","button","icon","pi pi-trash",1,"p-button-text","p-button-plain","p-0","text-500",3,"click"]],template:function(r,i){1&r&&(e.j41(0,"p-dialog",1),e.mxI("visibleChange",function(o){return e.DH7(i.showCloseOpportunityDialog,o)||(i.showCloseOpportunityDialog=o),o}),e.bIt("onHide",function(){return i.destroyComponent()}),e.DNE(1,Z_,8,4,"ng-template",2),e.j41(2,"div",3),e.DNE(3,ax,9,6,"form",4)(4,ox,13,5,"div",5),e.k0s()(),e.nrm(5,"p-toast")),2&r&&(e.Aen(e.lJ4(10,X_)),e.R50("visible",i.showCloseOpportunityDialog),e.Y8G("modal",!0)("closable",!1)("draggable",!1)("resizable",!1)("baseZIndex",1201),e.R7$(3),e.Y8G("ngIf",!i.isManageMode),e.R7$(),e.Y8G("ngIf",i.isManageMode))},dependencies:[q.YU,q.Sq,q.bT,be.Ei,Ie.y8,Qe.Sm,L.qT,L.me,L.BC,L.cb,jt.lG,xe._f,L.j4,L.JD],encapsulation:2})}return n})();var lx=ee(29791);const cx=["quillAttachmentInput"],dx=["sigFilePicker"],gr=n=>({card:n}),Ir=(n,a)=>({priority:n,tooltip:a}),px=(n,a)=>({"status-open":n,"status-closing":a});function ux(n,a){if(1&n&&(e.j41(0,"span",23),e.EFF(1),e.nI1(2,"currency"),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.SpI(" ",e.ii3(2,1,t.card.Amount,t.currencyCode,"symbol-narrow","0.0-2")," ")}}function fx(n,a){if(1&n&&(e.j41(0,"div",29),e.EFF(1),e.k0s()),2&n){const t=e.XpG(3);e.R7$(),e.SpI(" ",t.card.OpportunityClosureDescription," ")}}function mx(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",24),e.bIt("click",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.openCloseOpportunityModal(i,s.card))}),e.j41(1,"div",25),e.nrm(2,"i",26),e.j41(3,"span",27),e.EFF(4),e.k0s()(),e.DNE(5,fx,2,1,"div",28),e.k0s()}if(2&n){const t=e.XpG(2);e.R7$(4),e.SpI(" ",t.card.OpportunityClosureLossReason||"No Reason Captured"," "),e.R7$(),e.Y8G("ngIf",t.card.OpportunityClosureDescription)}}function hx(n,a){1&n&&e.eu8(0)}function gx(n,a){if(1&n&&(e.j41(0,"span",33),e.EFF(1),e.k0s()),2&n){const t=a.$implicit,r=e.XpG(4);e.xc7("background",r.getTagColor(t.Name))("color",r.getTagTextColor(r.getTagColor(t.Name)))("border-radius","12px")("font-size","10px")("padding","4px 8px"),e.R7$(),e.SpI(" ",t.Name," ")}}function _x(n,a){if(1&n&&(e.j41(0,"div",31),e.DNE(1,gx,2,11,"span",32),e.k0s()),2&n){const t=e.XpG(3);e.R7$(),e.Y8G("ngForOf",null==t.card||null==t.card.CardTags?null:t.card.CardTags.slice(0,3))}}function xx(n,a){if(1&n&&e.DNE(0,hx,1,0,"ng-container",22)(1,_x,2,1,"div",30),2&n){const t=e.XpG(2),r=e.sdS(16);e.Y8G("ngTemplateOutlet",r)("ngTemplateOutletContext",e.l_i(3,Ir,t.card.Priority,t.getCardPriorityTooltip(t.card))),e.R7$(),e.Y8G("ngIf",(null==t.card||null==t.card.CardTags?null:t.card.CardTags.length)>0)}}function vx(n,a){if(1&n&&(e.j41(0,"div",34)(1,"span",35),e.EFF(2),e.nI1(3,"date"),e.k0s()()),2&n){const t=e.XpG(2);e.R7$(2),e.SpI("Due Date: ",e.i5U(3,1,t.card.DueDateUtc,"dd.MM.yyyy"),"")}}function bx(n,a){1&n&&e.eu8(0)}function Cx(n,a){if(1&n){const t=e.RV6();e.j41(0,"p-card",13),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.edit.next())})("cdkDragStarted",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onDragStart())})("cdkDragEnded",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onDragEnd())}),e.j41(1,"div",14)(2,"div",15)(3,"div",16)(4,"span",17),e.EFF(5),e.k0s(),e.DNE(6,ux,3,6,"span",18),e.k0s()(),e.DNE(7,mx,6,2,"div",19)(8,xx,2,6),e.j41(9,"div",20),e.DNE(10,vx,4,4,"div",21),e.k0s(),e.DNE(11,bx,1,0,"ng-container",22),e.k0s()()}if(2&n){const t=e.XpG(),r=e.sdS(14);e.xc7("min-height","6rem"),e.Y8G("cdkDragData",t.card),e.R7$(5),e.SpI(" ",null==t.card?null:t.card.Title," "),e.R7$(),e.Y8G("ngIf",null==t.card?null:t.card.Amount),e.R7$(),e.Y8G("ngIf",t.card.Status===t.OpportunityStatusEnum.Lost),e.R7$(),e.vxM(t.card.Status!==t.OpportunityStatusEnum.Lost?8:-1),e.R7$(2),e.Y8G("ngIf",null==t.card?null:t.card.DueDateUtc),e.R7$(),e.Y8G("ngTemplateOutlet",r)("ngTemplateOutletContext",e.eq3(10,gr,t.card))}}function kx(n,a){if(1&n&&(e.j41(0,"span",23),e.EFF(1),e.nI1(2,"currency"),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.SpI(" ",e.ii3(2,1,t.card.Amount,t.currencyCode,"symbol-narrow","0.0-2")," ")}}function Tx(n,a){if(1&n&&(e.j41(0,"div",29),e.EFF(1),e.k0s()),2&n){const t=e.XpG(3);e.R7$(),e.SpI(" ",t.card.OpportunityClosureDescription," ")}}function wx(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",24),e.bIt("click",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.openCloseOpportunityModal(i,s.card))}),e.j41(1,"div",25),e.nrm(2,"i",26),e.j41(3,"span",27),e.EFF(4),e.k0s()(),e.DNE(5,Tx,2,1,"div",28),e.k0s()}if(2&n){const t=e.XpG(2);e.R7$(4),e.SpI(" ",t.card.OpportunityClosureLossReason||"No Reason Captured"," "),e.R7$(),e.Y8G("ngIf",t.card.OpportunityClosureDescription)}}function yx(n,a){1&n&&e.eu8(0)}function Fx(n,a){if(1&n&&(e.j41(0,"span",33),e.EFF(1),e.k0s()),2&n){const t=a.$implicit,r=e.XpG(4);e.xc7("background",r.getTagColor(t.Name))("color",r.getTagTextColor(r.getTagColor(t.Name)))("border-radius","12px")("font-size","10px")("padding","4px 8px"),e.R7$(),e.SpI(" ",t.Name," ")}}function Sx(n,a){if(1&n&&(e.j41(0,"div",31),e.DNE(1,Fx,2,11,"span",32),e.j41(2,"span",40),e.EFF(3," Email-to-board "),e.k0s()()),2&n){const t=e.XpG(3);e.R7$(),e.Y8G("ngForOf",null==t.card||null==t.card.CardTags?null:t.card.CardTags.slice(0,3)),e.R7$(),e.xc7("background",t.getTagColor("Email"))}}function Ex(n,a){if(1&n&&e.DNE(0,yx,1,0,"ng-container",22)(1,Sx,4,3,"div",30),2&n){const t=e.XpG(2),r=e.sdS(16);e.Y8G("ngTemplateOutlet",r)("ngTemplateOutletContext",e.l_i(3,Ir,t.card.Priority,t.getCardPriorityTooltip(t.card))),e.R7$(),e.Y8G("ngIf",(null==t.card||null==t.card.CardTags?null:t.card.CardTags.length)>0)}}function Ix(n,a){if(1&n&&(e.j41(0,"div",34)(1,"span",35),e.EFF(2),e.nI1(3,"date"),e.k0s()()),2&n){const t=e.XpG(2);e.R7$(2),e.SpI("Due Date: ",e.i5U(3,1,t.card.DueDateUtc,"dd.MM.yyyy"),"")}}function Dx(n,a){1&n&&e.eu8(0)}function Rx(n,a){if(1&n){const t=e.RV6();e.j41(0,"p-card",36),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.edit.next())})("cdkDragStarted",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onDragStart())})("cdkDragEnded",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onDragEnd())}),e.j41(1,"div",14)(2,"div",15)(3,"div",37)(4,"span",17),e.EFF(5),e.k0s(),e.DNE(6,kx,3,6,"span",18),e.k0s(),e.j41(7,"span",38),e.nrm(8,"i",39),e.EFF(9," Email "),e.k0s()(),e.DNE(10,wx,6,2,"div",19)(11,Ex,2,6),e.j41(12,"div",20),e.DNE(13,Ix,4,4,"div",21),e.k0s(),e.DNE(14,Dx,1,0,"ng-container",22),e.k0s()()}if(2&n){const t=e.XpG(),r=e.sdS(14);e.xc7("min-height","6rem"),e.Y8G("cdkDragData",t.card),e.R7$(5),e.SpI(" ",null==t.card?null:t.card.Title," "),e.R7$(),e.Y8G("ngIf",null==t.card?null:t.card.Amount),e.R7$(4),e.Y8G("ngIf",t.card.Status===t.OpportunityStatusEnum.Lost),e.R7$(),e.vxM(t.card.Status!==t.OpportunityStatusEnum.Lost?11:-1),e.R7$(2),e.Y8G("ngIf",null==t.card?null:t.card.DueDateUtc),e.R7$(),e.Y8G("ngTemplateOutlet",r)("ngTemplateOutletContext",e.eq3(10,gr,t.card))}}function jx(n,a){if(1&n&&(e.j41(0,"div",50)(1,"span",40),e.EFF(2),e.k0s(),e.j41(3,"span",40),e.EFF(4),e.k0s(),e.j41(5,"span",40),e.EFF(6),e.k0s(),e.j41(7,"span",51),e.EFF(8),e.k0s()()),2&n){const t=e.XpG(2);e.R7$(),e.xc7("background",t.getTagColor(null==t.tender?null:t.tender.Province)),e.R7$(),e.SpI(" ",null==t.card.Tender?null:t.card.Tender.Province," "),e.R7$(),e.xc7("background",t.getTagColor(null==t.card.Tender?null:t.card.Tender.BusinessCategory)),e.R7$(),e.SpI(" ",null==t.card.Tender?null:t.card.Tender.BusinessCategory," "),e.R7$(),e.xc7("background",t.getTagColor(null==t.card.Tender?null:t.card.Tender.TenderType)),e.R7$(),e.SpI(" ",t.getTenderTypeLabel(null==t.card.Tender?null:t.card.Tender.TenderType)," "),e.R7$(),e.Y8G("ngClass",e.l_i(11,px,"Open"===t.getTenderStatus(null==t.card?null:t.card.DueDateUtc),"Closing Soon"===t.getTenderStatus(null==t.card?null:t.card.DueDateUtc))),e.R7$(),e.SpI(" ",t.getTenderStatus(null==t.card?null:t.card.DueDateUtc)," ")}}function Ax(n,a){if(1&n&&(e.j41(0,"div",29),e.EFF(1),e.k0s()),2&n){const t=e.XpG(3);e.R7$(),e.SpI(" ",t.card.OpportunityClosureDescription," ")}}function Mx(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",24),e.bIt("click",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.openCloseOpportunityModal(i,s.card))}),e.j41(1,"div",25),e.nrm(2,"i",26),e.j41(3,"span",27),e.EFF(4),e.k0s()(),e.DNE(5,Ax,2,1,"div",28),e.k0s()}if(2&n){const t=e.XpG(2);e.R7$(4),e.SpI(" ",t.card.OpportunityClosureLossReason||"No Reason Captured"," "),e.R7$(),e.Y8G("ngIf",t.card.OpportunityClosureDescription)}}function Px(n,a){1&n&&e.eu8(0)}function Ox(n,a){if(1&n){const t=e.RV6();e.j41(0,"p-card",41),e.bIt("cdkDragStarted",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onDragStart())})("cdkDragEnded",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onDragEnd())})("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.edit.next())}),e.j41(1,"div",15)(2,"div",42)(3,"span",43),e.EFF(4),e.k0s(),e.j41(5,"span",44),e.EFF(6),e.k0s()(),e.j41(7,"span",45),e.nrm(8,"i",46),e.EFF(9," TENDER "),e.k0s()(),e.j41(10,"div",47)(11,"span"),e.EFF(12),e.nI1(13,"date"),e.k0s()(),e.nrm(14,"div",48),e.DNE(15,jx,9,14,"div",49)(16,Mx,6,2,"div",19)(17,Px,1,0,"ng-container",22),e.k0s()}if(2&n){const t=e.XpG(),r=e.sdS(14);e.Y8G("cdkDragData",t.card),e.R7$(4),e.SpI(" ",t.card.Title," "),e.R7$(2),e.SpI(" ",null==t.card.Tender?null:t.card.Tender.TenderIssuer," "),e.R7$(6),e.SpI(" Due Date: ",e.i5U(13,8,null==t.card.Tender?null:t.card.Tender.DateClosingUtc,"dd.MM.yyyy")," "),e.R7$(3),e.Y8G("ngIf",t.card.Status!==t.OpportunityStatusEnum.Lost),e.R7$(),e.Y8G("ngIf",t.card.Status===t.OpportunityStatusEnum.Lost),e.R7$(),e.Y8G("ngTemplateOutlet",r)("ngTemplateOutletContext",e.eq3(11,gr,t.card))}}function Nx(n,a){if(1&n&&(e.j41(0,"span",23),e.EFF(1),e.nI1(2,"currency"),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.SpI(" ",e.ii3(2,1,t.card.Amount,t.currencyCode,"symbol-narrow","0.0-2")," ")}}function Gx(n,a){if(1&n&&(e.j41(0,"div",34)(1,"span",35),e.EFF(2),e.nI1(3,"date"),e.k0s()()),2&n){const t=e.XpG(2);e.R7$(2),e.SpI("Due Date: ",e.i5U(3,1,t.card.DueDateUtc,"dd.MM.yyyy"),"")}}function Bx(n,a){if(1&n&&(e.j41(0,"div",29),e.EFF(1),e.k0s()),2&n){const t=e.XpG(3);e.R7$(),e.SpI(" ",t.card.OpportunityClosureDescription," ")}}function Lx(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",24),e.bIt("click",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.openCloseOpportunityModal(i,s.card))}),e.j41(1,"div",25),e.nrm(2,"i",26),e.j41(3,"span",27),e.EFF(4),e.k0s()(),e.DNE(5,Bx,2,1,"div",28),e.k0s()}if(2&n){const t=e.XpG(2);e.R7$(4),e.SpI(" ",t.card.OpportunityClosureLossReason||"No Reason Captured"," "),e.R7$(),e.Y8G("ngIf",t.card.OpportunityClosureDescription)}}function $x(n,a){1&n&&e.eu8(0)}function Vx(n,a){if(1&n&&(e.j41(0,"span",33),e.EFF(1),e.k0s()),2&n){const t=a.$implicit,r=e.XpG(4);e.xc7("background",r.getTagColor(t.Name))("color",r.getTagTextColor(r.getTagColor(t.Name)))("border-radius","12px")("font-size","10px")("padding","4px 8px")("font-weight","500"),e.R7$(),e.SpI(" ",t.Name," ")}}function Ux(n,a){if(1&n&&(e.j41(0,"div",58),e.DNE(1,Vx,2,13,"span",59),e.k0s()),2&n){const t=e.XpG(3);e.R7$(),e.Y8G("ngForOf",null==t.card||null==t.card.CardTags?null:t.card.CardTags.slice(0,3))}}function Xx(n,a){if(1&n&&e.DNE(0,$x,1,0,"ng-container",22)(1,Ux,2,1,"div",57),2&n){const t=e.XpG(2),r=e.sdS(16);e.Y8G("ngTemplateOutlet",r)("ngTemplateOutletContext",e.l_i(3,Ir,t.card.Priority,t.getCardPriorityTooltip(t.card))),e.R7$(),e.Y8G("ngIf",(null==t.card||null==t.card.CardTags?null:t.card.CardTags.length)>0)}}function Yx(n,a){1&n&&e.eu8(0)}function Wx(n,a){if(1&n){const t=e.RV6();e.j41(0,"p-card",52),e.bIt("cdkDragStarted",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onDragStart())})("cdkDragEnded",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onDragEnd())})("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.edit.next())}),e.j41(1,"div",15)(2,"div",16)(3,"span",53),e.EFF(4),e.k0s(),e.j41(5,"span",54),e.
1EFF(6),e.k0s(),e.DNE(7,Nx,3,6,"span",18),e.k0s(),e.j41(8,"span",55),e.nrm(9,"i",56),e.EFF(10," Messenger "),e.k0s()(),e.j41(11,"div",20),e.DNE(12,Gx,4,4,"div",21),e.k0s(),e.DNE(13,Lx,6,2,"div",19)(14,Xx,2,6)(15,Yx,1,0,"ng-container",22),e.k0s()}if(2&n){const t=e.XpG(),r=e.sdS(14);e.Y8G("cdkDragData",t.card),e.R7$(4),e.JRh(null==t.card?null:t.card.Title),e.R7$(2),e.JRh(null==t.card?null:t.card.AssociatePerson),e.R7$(),e.Y8G("ngIf",null==t.card?null:t.card.Amount),e.R7$(5),e.Y8G("ngIf",null==t.card?null:t.card.DueDateUtc),e.R7$(),e.Y8G("ngIf",t.card.Status===t.OpportunityStatusEnum.Lost),e.R7$(),e.vxM(t.card.Status!==t.OpportunityStatusEnum.Lost?14:-1),e.R7$(),e.Y8G("ngTemplateOutlet",r)("ngTemplateOutletContext",e.eq3(9,gr,t.card))}}function Hx(n,a){if(1&n&&(e.j41(0,"span",23),e.EFF(1),e.nI1(2,"currency"),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.SpI(" ",e.ii3(2,1,t.card.Amount,t.currencyCode,"symbol-narrow","0.0-2")," ")}}function zx(n,a){if(1&n&&(e.j41(0,"div",34)(1,"span",35),e.EFF(2),e.nI1(3,"date"),e.k0s()()),2&n){const t=e.XpG(2);e.R7$(2),e.SpI("Due Date: ",e.i5U(3,1,t.card.DueDateUtc,"dd.MM.yyyy"),"")}}function qx(n,a){if(1&n&&(e.j41(0,"div",29),e.EFF(1),e.k0s()),2&n){const t=e.XpG(3);e.R7$(),e.SpI(" ",t.card.OpportunityClosureDescription," ")}}function Jx(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",24),e.bIt("click",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.openCloseOpportunityModal(i,s.card))}),e.j41(1,"div",25),e.nrm(2,"i",26),e.j41(3,"span",27),e.EFF(4),e.k0s()(),e.DNE(5,qx,2,1,"div",28),e.k0s()}if(2&n){const t=e.XpG(2);e.R7$(4),e.SpI(" ",t.card.OpportunityClosureLossReason||"No Reason Captured"," "),e.R7$(),e.Y8G("ngIf",t.card.OpportunityClosureDescription)}}function Kx(n,a){1&n&&e.eu8(0)}function Qx(n,a){if(1&n&&(e.j41(0,"span",33),e.EFF(1),e.k0s()),2&n){const t=a.$implicit,r=e.XpG(4);e.xc7("background",r.getTagColor(t.Name))("color",r.getTagTextColor(r.getTagColor(t.Name)))("border-radius","12px")("font-size","10px")("padding","4px 8px")("font-weight","500"),e.R7$(),e.SpI(" ",t.Name," ")}}function Zx(n,a){if(1&n&&(e.j41(0,"div",58),e.DNE(1,Qx,2,13,"span",59),e.k0s()),2&n){const t=e.XpG(3);e.R7$(),e.Y8G("ngForOf",null==t.card||null==t.card.CardTags?null:t.card.CardTags.slice(0,3))}}function e2(n,a){if(1&n&&(e.DNE(0,Kx,1,0,"ng-container",22),e.j41(1,"span",63),e.EFF(2," WhatsApp\n"),e.k0s(),e.DNE(3,Zx,2,1,"div",57)),2&n){const t=e.XpG(2),r=e.sdS(16);e.Y8G("ngTemplateOutlet",r)("ngTemplateOutletContext",e.l_i(3,Ir,t.card.Priority,t.getCardPriorityTooltip(t.card))),e.R7$(3),e.Y8G("ngIf",(null==t.card||null==t.card.CardTags?null:t.card.CardTags.length)>0)}}function t2(n,a){1&n&&e.eu8(0)}function n2(n,a){if(1&n){const t=e.RV6();e.j41(0,"p-card",60),e.bIt("cdkDragStarted",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onDragStart())})("cdkDragEnded",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onDragEnd())})("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.edit.next())}),e.j41(1,"div",15)(2,"div",16)(3,"span",53),e.EFF(4),e.k0s(),e.j41(5,"span",54),e.EFF(6),e.k0s(),e.DNE(7,Hx,3,6,"span",18),e.k0s(),e.j41(8,"span",61),e.nrm(9,"i",62),e.EFF(10," WhatsApp "),e.k0s()(),e.j41(11,"div",20),e.DNE(12,zx,4,4,"div",21),e.k0s(),e.DNE(13,Jx,6,2,"div",19)(14,e2,4,6)(15,t2,1,0,"ng-container",22),e.k0s()}if(2&n){const t=e.XpG(),r=e.sdS(14);e.Y8G("cdkDragData",t.card),e.R7$(4),e.JRh(null==t.card?null:t.card.Title),e.R7$(2),e.JRh(null==t.card?null:t.card.AssociatePerson),e.R7$(),e.Y8G("ngIf",null==t.card?null:t.card.Amount),e.R7$(5),e.Y8G("ngIf",null==t.card?null:t.card.DueDateUtc),e.R7$(),e.Y8G("ngIf",t.card.Status===t.OpportunityStatusEnum.Lost),e.R7$(),e.vxM(t.card.Status!==t.OpportunityStatusEnum.Lost?14:-1),e.R7$(),e.Y8G("ngTemplateOutlet",r)("ngTemplateOutletContext",e.eq3(9,gr,t.card))}}function r2(n,a){if(1&n&&(e.j41(0,"span",23),e.EFF(1),e.nI1(2,"currency"),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.SpI(" ",e.ii3(2,1,t.card.Amount,t.currencyCode,"symbol-narrow","0.0-2")," ")}}function i2(n,a){if(1&n&&(e.j41(0,"div",34)(1,"span",35),e.EFF(2),e.nI1(3,"date"),e.k0s()()),2&n){const t=e.XpG(2);e.R7$(2),e.SpI("Due Date: ",e.i5U(3,1,t.card.DueDateUtc,"dd.MM.yyyy"),"")}}function a2(n,a){if(1&n&&(e.j41(0,"div",29),e.EFF(1),e.k0s()),2&n){const t=e.XpG(3);e.R7$(),e.SpI(" ",t.card.OpportunityClosureDescription," ")}}function s2(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",24),e.bIt("click",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.openCloseOpportunityModal(i,s.card))}),e.j41(1,"div",25),e.nrm(2,"i",26),e.j41(3,"span",27),e.EFF(4),e.k0s()(),e.DNE(5,a2,2,1,"div",28),e.k0s()}if(2&n){const t=e.XpG(2);e.R7$(4),e.SpI(" ",t.card.OpportunityClosureLossReason||"No Reason Captured"," "),e.R7$(),e.Y8G("ngIf",t.card.OpportunityClosureDescription)}}function o2(n,a){1&n&&e.eu8(0)}function l2(n,a){if(1&n&&(e.j41(0,"span",33),e.EFF(1),e.k0s()),2&n){const t=a.$implicit,r=e.XpG(4);e.xc7("background",r.getTagColor(t.Name))("color",r.getTagTextColor(r.getTagColor(t.Name)))("border-radius","12px")("font-size","10px")("padding","4px 8px")("font-weight","500"),e.R7$(),e.SpI(" ",t.Name," ")}}function c2(n,a){if(1&n&&(e.j41(0,"div",58),e.DNE(1,l2,2,13,"span",59),e.k0s()),2&n){const t=e.XpG(3);e.R7$(),e.Y8G("ngForOf",null==t.card||null==t.card.CardTags?null:t.card.CardTags.slice(0,3))}}function d2(n,a){if(1&n&&(e.DNE(0,o2,1,0,"ng-container",22),e.j41(1,"span",67),e.EFF(2," Instagram "),e.k0s(),e.DNE(3,c2,2,1,"div",57)),2&n){const t=e.XpG(2),r=e.sdS(16);e.Y8G("ngTemplateOutlet",r)("ngTemplateOutletContext",e.l_i(3,Ir,t.card.Priority,t.getCardPriorityTooltip(t.card))),e.R7$(3),e.Y8G("ngIf",(null==t.card||null==t.card.CardTags?null:t.card.CardTags.length)>0)}}function p2(n,a){1&n&&e.eu8(0)}function u2(n,a){if(1&n){const t=e.RV6();e.j41(0,"p-card",64),e.bIt("cdkDragStarted",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onDragStart())})("cdkDragEnded",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onDragEnd())})("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.edit.next())}),e.j41(1,"div",15)(2,"div",16)(3,"span",53),e.EFF(4),e.k0s(),e.j41(5,"span",54),e.
1EFF(6),e.k0s(),e.DNE(7,r2,3,6,"span",18),e.k0s(),e.j41(8,"span",65),e.nrm(9,"i",66),e.EFF(10," Instagram "),e.k0s()(),e.j41(11,"div",20),e.DNE(12,i2,4,4,"div",21),e.k0s(),e.DNE(13,s2,6,2,"div",19)(14,d2,4,6)(15,p2,1,0,"ng-container",22),e.k0s()}if(2&n){const t=e.XpG(),r=e.sdS(14);e.Y8G("cdkDragData",t.card),e.R7$(4),e.JRh(null==t.card?null:t.card.Title),e.R7$(2),e.JRh(null==t.card?null:t.card.AssociatePerson),e.R7$(),e.Y8G("ngIf",null==t.card?null:t.card.Amount),e.R7$(5),e.Y8G("ngIf",null==t.card?null:t.card.DueDateUtc),e.R7$(),e.Y8G("ngIf",t.card.Status===t.OpportunityStatusEnum.Lost),e.R7$(),e.vxM(t.card.Status!==t.OpportunityStatusEnum.Lost?14:-1),e.R7$(),e.Y8G("ngTemplateOutlet",r)("ngTemplateOutletContext",e.eq3(9,gr,t.card))}}function f2(n,a){if(1&n&&(e.j41(0,"span",23),e.EFF(1),e.nI1(2,"currency"),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.SpI(" ",e.ii3(2,1,t.card.Amount,t.currencyCode,"symbol-narrow","0.0-2")," ")}}function m2(n,a){if(1&n&&(e.j41(0,"div",29),e.EFF(1),e.k0s()),2&n){const t=e.XpG(3);e.R7$(),e.SpI(" ",t.card.OpportunityClosureDescription," ")}}function h2(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",24),e.bIt("click",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.openCloseOpportunityModal(i,s.card))}),e.j41(1,"div",25),e.nrm(2,"i",26),e.j41(3,"span",27),e.EFF(4),e.k0s()(),e.DNE(5,m2,2,1,"div",28),e.k0s()}if(2&n){const t=e.XpG(2);e.R7$(4),e.SpI(" ",t.card.OpportunityClosureLossReason||"No Reason Captured"," "),e.R7$(),e.Y8G("ngIf",t.card.OpportunityClosureDescription)}}function g2(n,a){1&n&&e.eu8(0)}function _2(n,a){if(1&n&&(e.j41(0,"span",33),e.EFF(1),e.k0s()),2&n){const t=a.$implicit,r=e.XpG(4);e.xc7("background",r.getTagColor(t.Name))("color",r.getTagTextColor(r.getTagColor(t.Name)))("border-radius","12px")("font-size","10px")("padding","4px 8px"),e.R7$(),e.SpI(" ",t.Name," ")}}function x2(n,a){if(1&n&&(e.j41(0,"div",31),e.DNE(1,_2,2,11,"span",32),e.k0s()),2&n){const t=e.XpG(3);e.R7$(),e.Y8G("ngForOf",null==t.card||null==t.card.CardTags?null:t.card.CardTags.slice(0,3))}}function v2(n,a){if(1&n&&e.DNE(0,g2,1,0,"ng-container",22)(1,x2,2,1,"div",30),2&n){const t=e.XpG(2),r=e.sdS(16);e.Y8G("ngTemplateOutlet",r)("ngTemplateOutletContext",e.l_i(3,Ir,t.card.Priority,t.getCardPriorityTooltip(t.card))),e.R7$(),e.Y8G("ngIf",(null==t.card||null==t.card.CardTags?null:t.card.CardTags.length)>0)}}function b2(n,a){if(1&n&&(e.j41(0,"div",34)(1,"span",35),e.EFF(2),e.nI1(3,"date"),e.k0s()()),2&n){const t=e.XpG(2);e.R7$(2),e.SpI("Due Date: ",e.i5U(3,1,t.card.DueDateUtc,"dd.MM.yyyy"),"")}}function C2(n,a){1&n&&e.eu8(0)}function k2(n,a){if(1&n){const t=e.RV6();e.j41(0,"p-card",68),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.edit.next())})("cdkDragStarted",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onDragStart())})("cdkDragEnded",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onDragEnd())}),e.j41(1,"div",14)(2,"div",15)(3,"div",16)(4,"span",17),e.EFF(5),e.k0s(),e.DNE(6,f2,3,6,"span",18),e.k0s(),e.j41(7,"span",69),e.nrm(8,"i",70),e.EFF(9," Contact "),e.k0s()(),e.DNE(10,h2,6,2,"div",19)(11,v2,2,6),e.j41(12,"div",20),e.DNE(13,b2,4,4,"div",21),e.k0s(),e.DNE(14,C2,1,0,"ng-container",22),e.k0s()()}if(2&n){const t=e.XpG(),r=e.sdS(14);e.xc7("min-height","6rem"),e.Y8G("cdkDragData",t.card),e.R7$(5),e.SpI(" ",null==t.card?null:t.card.Title," "),e.R7$(),e.Y8G("ngIf",null==t.card?null:t.card.Amount),e.R7$(4),e.Y8G("ngIf",t.card.Status===t.OpportunityStatusEnum.Lost),e.R7$(),e.vxM(t.card.Status!==t.OpportunityStatusEnum.Lost?11:-1),e.R7$(2),e.Y8G("ngIf",null==t.card?null:t.card.DueDateUtc),e.R7$(),e.Y8G("ngTemplateOutlet",r)("ngTemplateOutletContext",e.eq3(10,gr,t.card))}}function T2(n,a){if(1&n&&(e.j41(0,"div",43),e.EFF(1),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.SpI(" ",t.card.CompanyName," ")}}function w2(n,a){if(1&n&&(e.j41(0,"div",44),e.EFF(1),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.SpI(" ",t.card.Title," ")}}function y2(n,a){if(1&n&&(e.j41(0,"div",79),e.nrm(1,"i",80),e.j41(2,"span"),e.EFF(3),e.k0s()()),2&n){const t=e.XpG(2);e.R7$(3),e.JRh(t.card.AssociateEmail)}}function F2(n,a){if(1&n&&(e.j41(0,"div",79),e.nrm(1,"i",81),e.j41(2,"span"),e.EFF(3),e.k0s()()),2&n){const t=e.XpG(2);e.R7$(3),e.JRh(t.card.AssociateNumber)}}function S2(n,a){if(1&n&&(e.j41(0,"div",82)(1,"a",83),e.EFF(2),e.k0s()()),2&n){const t=e.XpG(2);e.R7$(2),e.SpI(" ",t.card.CompanyWebsite," ")}}function E2(n,a){if(1&n&&(e.j41(0,"div",29),e.EFF(1),e.k0s()),2&n){const t=e.XpG(3);e.R7$(),e.SpI(" ",t.card.OpportunityClosureDescription," ")}}function I2(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",24),e.bIt("click",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.openCloseOpportunityModal(i,s.card))}),e.j41(1,"div",25),e.nrm(2,"i",26),e.j41(3,"span",27),e.EFF(4),e.k0s()(),e.DNE(5,E2,2,1,"div",28),e.k0s()}if(2&n){const t=e.XpG(2);e.R7$(4),e.SpI(" ",t.card.OpportunityClosureLossReason||"No Reason Captured"," "),e.R7$(),e.Y8G("ngIf",t.card.OpportunityClosureDescription)}}function D2(n,a){1&n&&e.eu8(0)}function R2(n,a){if(1&n&&(e.j41(0,"span",33),e.EFF(1),e.k0s()),2&n){const t=a.$implicit,r=e.XpG(4);e.xc7("background",r.getTagColor(t.Name))("color",r.getTagTextColor(r.getTagColor(t.Name)))("border-radius","12px")("font-size","10px")("padding","4px 8px"),e.R7$(),e.SpI(" ",t.Name," ")}}function j2(n,a){if(1&n&&(e.j41(0,"div",31),e.DNE(1,R2,2,11,"span",32),e.k0s()),2&n){const t=e.XpG(3);e.R7$(),e.Y8G("ngForOf",null==t.card||null==t.card.CardTags?null:t.card.CardTags.slice(0,3))}}function A2(n,a){if(1&n&&e.DNE(0,D2,1,0,"ng-container",22)(1,j2,2,1,"div",30),2&n){const t=e.XpG(2),r=e.sdS(16);e.Y8G("ngTemplateOutlet",r)("ngTemplateOutletContext",e.l_i(3,Ir,t.card.Priority,t.getCardPriorityTooltip(t.card))),e.R7$(),e.Y8G("ngIf",(null==t.card||null==t.card.CardTags?null:t.card.CardTags.length)>0)}}function M2(n,a){if(1&n&&(e.j41(0,"div",34)(1,"span",35),e.EFF(2),e.nI1(3,"date"),e.k0s()()),2&n){const t=e.XpG(2);e.R7$(2),e.SpI("Due Date: ",e.i5U(3,1,t.card.DueDateUtc,"dd.MM.yyyy"),"")}}function P2(n,a){1&n&&e.eu8(0)}function O2(n,a){if(1&n){const t=e.RV6();e.j41(0,"p-card",71),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.edit.next())})("cdkDragStarted",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onDragStart())})("cdkDragEnded",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onDragEnd())}),e.j41(1,"div",14)(2,"div",72)(3,"div",42),e.DNE(4,T2,2,1,"div",73),e.k0s(),e.j41(5,"span",74),e.nrm(6,"i",75),e.EFF(7," Chrome "),e.k0s()(),e.DNE(8,w2,2,1,"div",76)(9,y2,4,1,"div",77)(10,F2,4,1,"div",77)(11,S2,3,1,"div",78)(12,I2,6,2,"div",19)(13,A2,2,6),e.j41(14,"div",20),e.DNE(15,M2,4,4,"div",21),e.k0s(),e.DNE(16,P2,1,0,"ng-container",22),e.k0s()()}if(2&n){const t=e.XpG(),r=e.sdS(14);e.xc7("min-height","6rem"),e.Y8G("cdkDragData",t.card),e.R7$(4),e.Y8G("ngIf",null==t.card?null:t.card.CompanyName),e.R7$(4),e.Y8G("ngIf",null==t.card?null:t.card.Title),e.R7$(),e.Y8G("ngIf",null==t.card?null:t.card.AssociateEmail),e.R7$(),e.Y8G("ngIf",null==t.card?null:t.card.AssociateNumber),e.R7$(),e.Y8G("ngIf",null==t.card?null:t.card.CompanyWebsite),e.R7$(),e.Y8G("ngIf",t.card.Status===t.OpportunityStatusEnum.Lost),e.R7$(),e.vxM(t.card.Status!==t.OpportunityStatusEnum.Lost?13:-1),e.R7$(2),e.Y8G("ngIf",null==t.card?null:t.card.DueDateUtc),e.R7$(),e.Y8G("ngTemplateOutlet",r)("ngTemplateOutletContext",e.eq3(13,gr,t.card))}}function N2(n,a){if(1&n&&(e.j41(0,"span",23),e.EFF(1),e.nI1(2,"currency"),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.SpI(" ",e.ii3(2,1,t.card.Amount,t.currencyCode,"symbol-narrow","0.0-2")," ")}}function G2(n,a){if(1&n&&(e.j41(0,"div",29),e.EFF(1),e.k0s()),2&n){const t=e.XpG(3);e.R7$(),e.SpI(" ",t.card.OpportunityClosureDescription," ")}}function B2(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",24),e.bIt("click",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.openCloseOpportunityModal(i,s.card))}),e.j41(1,"div",25),e.nrm(2,"i",26),e.j41(3,"span",27),e.EFF(4),e.k0s()(),e.DNE(5,G2,2,1,"div",28),e.k0s()}if(2&n){const t=e.XpG(2);e.R7$(4),e.SpI(" ",t.card.OpportunityClosureLossReason||"No Reason Captured"," "),e.R7$(),e.Y8G("ngIf",t.card.OpportunityClosureDescription)}}function L2(n,a){1&n&&e.eu8(0)}function $2(n,a){if(1&n&&(e.j41(0,"span",33),e.EFF(1),e.k0s()),2&n){const t=a.$implicit,r=e.XpG(4);e.xc7("background",r.getTagColor(t.Name))("color",r.getTagTextColor(r.getTagColor(t.Name)))("border-radius","12px")("font-size","10px")("padding","4px 8px"),e.R7$(),e.SpI(" ",t.Name," ")}}function V2(n,a){if(1&n&&(e.j41(0,"div",31),e.DNE(1,$2,2,11,"span",32),e.k0s()),2&n){const t=e.XpG(3);e.R7$(),e.Y8G("ngForOf",null==t.card||null==t.card.CardTags?null:t.card.CardTags.slice(0,3))}}function U2(n,a){if(1&n&&e.DNE(0,L2,1,0,"ng-container",22)(1,V2,2,1,"div",30),2&n){const t=e.XpG(2),r=e.sdS(16);e.Y8G("ngTemplateOutlet",r)("ngTemplateOutletContext",e.l_i(3,Ir,t.card.Priority,t.getCardPriorityTooltip(t.card))),e.R7$(),e.Y8G("ngIf",(null==t.card||null==t.card.CardTags?null:t.card.CardTags.length)>0)}}function X2(n,a){if(1&n&&(e.j41(0,"div",34)(1,"span",35),e.EFF(2),e.nI1(3,"date"),e.k0s()()),2&n){const t=e.XpG(2);e.R7$(2),e.SpI("Due Date: ",e.i5U(3,1,t.card.DueDateUtc,"dd.MM.yyyy"),"")}}function Y2(n,a){1&n&&e.eu8(0)}function W2(n,a){if(1&n){const t=e.RV6();e.j41(0,"p-card",13),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.edit.next())})("cdkDragStarted",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onDragStart())})("cdkDragEnded",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onDragEnd())}),e.j41(1,"div",14)(2,"div",15)(3,"div",16)(4,"span",17),e.EFF(5),e.k0s(),e.DNE(6,N2,3,6,"span",18),e.k0s()(),e.DNE(7,B2,6,2,"div",19)(8,U2,2,6),e.j41(9,"div",20),e.DNE(10,X2,4,4,"div",21),e.k0s(),e.DNE(11,Y2,1,0,"ng-container",22),e.k0s()()}if(2&n){const t=e.XpG(),r=e.sdS(14);e.xc7("min-height","6rem"),e.Y8G("cdkDragData",t.card),e.R7$(5),e.SpI(" ",null==t.card?null:t.card.Title," "),e.R7$(),e.Y8G("ngIf",null==t.card?null:t.card.Amount),e.R7$(),e.Y8G("ngIf",t.card.Status===t.OpportunityStatusEnum.Lost),e.R7$(),e.vxM(t.card.Status!==t.OpportunityStatusEnum.Lost?8:-1),e.R7$(2),e.Y8G("ngIf",null==t.card?null:t.card.DueDateUtc),e.R7$(),e.Y8G("ngTemplateOutlet",r)("ngTemplateOutletContext",e.eq3(10,gr,t.card))}}function H2(n,a){if(1&n&&(e.j41(0,"span",23),e.EFF(1),e.nI1(2,"currency"),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.SpI(" ",e.ii3(2,1,t.card.Amount,t.currencyCode,"symbol-narrow","0.0-2")," ")}}function z2(n,a){if(1&n&&(e.j41(0,"div",29),e.EFF(1),e.k0s()),2&n){const t=e.XpG(3);e.R7$(),e.SpI(" ",t.card.OpportunityClosureDescription," ")}}function q2(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",24),e.bIt("click",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.openCloseOpportunityModal(i,s.card))}),e.j41(1,"div",25),e.nrm(2,"i",26),e.j41(3,"span",27),e.EFF(4),e.k0s()(),e.DNE(5,z2,2,1,"div",28),e.k0s()}if(2&n){const t=e.XpG(2);e.R7$(4),e.SpI(" ",t.card.OpportunityClosureLossReason||"No Reason Captured"," "),e.R7$(),e.Y8G("ngIf",t.card.OpportunityClosureDescription)}}function J2(n,a){1&n&&e.eu8(0)}function K2(n,a){if(1&n&&(e.j41(0,"span",33),e.EFF(1),e.k0s()),2&n){const t=a.$implicit,r=e.XpG(4);e.xc7("background",r.getTagColor(t.Name))("color",r.getTagTextColor(r.getTagColor(t.Name)))("border-radius","12px")("font-size","10px")("padding","4px 8px"),e.R7$(),e.SpI(" ",t.Name," ")}}function Q2(n,a){if(1&n&&(e.j41(0,"div",31),e.DNE(1,K2,2,11,"span",32),e.k0s()),2&n){const t=e.XpG(3);e.R7$(),e.Y8G("ngForOf",null==t.card||null==t.card.CardTags?null:t.card.CardTags.slice(0,3))}}function Z2(n,a){if(1&n&&e.DNE(0,J2,1,0,"ng-container",22)(1,Q2,2,1,"div",30),2&n){const t=e.XpG(2),r=e.sdS(16);e.Y8G("ngTemplateOutlet",r)("ngTemplateOutletContext",e.l_i(3,Ir,t.card.Priority,t.getCardPriorityTooltip(t.card))),e.R7$(),e.Y8G("ngIf",(null==t.card||null==t.card.CardTags?null:t.card.CardTags.length)>0)}}function ev(n,a){if(1&n&&(e.j41(0,"div",34)(1,"span",35),e.EFF(2),e.nI1(3,"date"),e.k0s()()),2&n){const t=e.XpG(2);e.R7$(2),e.SpI("Due Date: ",e.i5U(3,1,t.card.DueDateUtc,"dd.MM.yyyy"),"")}}function tv(n,a){1&n&&e.eu8(0)}function nv(n,a){if(1&n){const t=e.RV6();e.j41(0,"p-card",68),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.edit.next())})("cdkDragStarted",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onDragStart())})("cdkDragEnded",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onDragEnd())}),e.j41(1,"div",14)(2,"div",15)(3,"div",16)(4,"span",17),e.EFF(5),e.k0s(),e.DNE(6,H2,3,6,"span",18),e.k0s(),e.j41(7,"span",84),e.nrm(8,"i",85),e.EFF(9," Form "),e.k0s()(),e.DNE(10,q2,6,2,"div",19)(11,Z2,2,6),e.j41(12,"div",20),e.DNE(13,ev,4,4,"div",21),e.k0s(),e.DNE(14,tv,1,0,"ng-container",22),e.k0s()()}if(2&n){const t=e.XpG(),r=e.sdS(14);e.xc7("min-height","6rem"),e.Y8G("cdkDragData",t.card),e.R7$(5),e.SpI(" ",null==t.card?null:t.card.Title," "),e.R7$(),e.Y8G("ngIf",null==t.card?null:t.card.Amount),e.R7$(4),e.Y8G("ngIf",t.card.Status===t.OpportunityStatusEnum.Lost),e.R7$(),e.vxM(t.card.Status!==t.OpportunityStatusEnum.Lost?11:-1),e.R7$(2),e.Y8G("ngIf",null==t.card?null:t.card.DueDateUtc),e.R7$(),e.Y8G("ngTemplateOutlet",r)("ngTemplateOutletContext",e.eq3(10,gr,t.card))}}function rv(n,a){if(1&n){const t=e.RV6();
1e.j41(0,"div")(1,"app-send-email",86),e.bIt("isEmailPopUpVisibleChange",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.isEmailPopUpVisible=i)}),e.k0s()()}if(2&n){const t=e.XpG();e.R7$(),e.Y8G("isEmailPopUpVisible",t.isEmailPopUpVisible)("email",null==t.card?null:t.card.AssociateEmail)("source","sales")}}function iv(n,a){if(1&n){const t=e.RV6();e.j41(0,"app-deal-ai",87),e.mxI("visibleChange",function(i){e.eBV(t);const s=e.XpG();return e.DH7(s.aiInsightVisible,i)||(s.aiInsightVisible=i),e.Njj(i)}),e.bIt("onClose",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.closeAiInsights())}),e.k0s()}if(2&n){const t=e.XpG();e.R50("visible",t.aiInsightVisible),e.Y8G("card",t.selectedCard)}}function av(n,a){if(1&n){const t=e.RV6();e.j41(0,"app-deal-notes",87),e.mxI("visibleChange",function(i){e.eBV(t);const s=e.XpG();return e.DH7(s.showNotesDrawer,i)||(s.showNotesDrawer=i),e.Njj(i)}),e.bIt("onClose",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.closeNotesDrawer())}),e.k0s()}if(2&n){const t=e.XpG();e.R50("visible",t.showNotesDrawer),e.Y8G("card",t.selectedCard)}}function sv(n,a){if(1&n&&(e.j41(0,"span",103),e.EFF(1),e.k0s()),2&n){const t=e.XpG(3);e.R7$(),e.SpI(" +",t.assignedUsersList.length-1," ")}}function ov(n,a){if(1&n&&(e.qex(0),e.j41(1,"div",101),e.EFF(2),e.k0s(),e.DNE(3,sv,2,1,"span",102),e.bVm()),2&n){const t=e.XpG(2);e.R7$(),e.FS9("pTooltip",t.assignedUsersList[0].fullName),e.R7$(),e.SpI(" ",t.assignedUsersList[0].initial," "),e.R7$(),e.Y8G("ngIf",t.assignedUsersList.length>1)}}function lv(n,a){if(1&n&&(e.j41(0,"span",104),e.EFF(1),e.k0s()),2&n){const t=e.XpG().card;e.R7$(),e.SpI(" ",t.NotesCount," ")}}function cv(n,a){1&n&&(e.j41(0,"span",105),e.nrm(1,"i",106),e.k0s())}function dv(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",88),e.bIt("click",function(i){return e.eBV(t),e.Njj(i.stopPropagation())}),e.j41(1,"div",89),e.nI1(2,"date"),e.j41(3,"span",90),e.EFF(4),e.nI1(5,"relativeLocalDate"),e.k0s()(),e.j41(6,"div",91)(7,"i",92),e.bIt("click",function(i){const s=e.eBV(t).card,o=e.XpG();return i.stopPropagation(),e.Njj(o.openAiInsights(s))}),e.k0s(),e.j41(8,"div",93),e.DNE(9,ov,4,3,"ng-container",10),e.k0s(),e.j41(10,"div",94)(11,"i",95),e.bIt("click",function(i){const s=e.eBV(t).card,o=e.XpG();return i.stopPropagation(),e.Njj(o.archiveCard(s))}),e.k0s(),e.j41(12,"i",96),e.bIt("click",function(i){const s=e.eBV(t).card,o=e.XpG();return i.stopPropagation(),e.Njj(o.openEmailPopUp(s))}),e.k0s(),e.j41(13,"div",97)(14,"i",98),e.bIt("click",function(i){const s=e.eBV(t).card,o=e.XpG();return i.stopPropagation(),e.Njj(o.openNotesDrawer(s))}),e.k0s(),e.DNE(15,lv,2,1,"span",99)(16,cv,2,0,"span",100),e.k0s()()()()}if(2&n){const t=a.card,r=e.XpG();e.R7$(),e.FS9("pTooltip",e.i5U(2,5,null==t?null:t.DateCreatedUtc,"dd.MM.yyyy HH:mm")),e.R7$(3),e.JRh(e.bMT(5,8,null==t?null:t.DateCreatedUtc)),e.R7$(5),e.Y8G("ngIf",r.assignedUsersList.length>0),e.R7$(6),e.Y8G("ngIf",(null==t?null:t.NotesCount)>0&&!(null!=t&&t.HasDueFollowUps)),e.R7$(),e.Y8G("ngIf",null==t?null:t.HasDueFollowUps)}}function pv(n,a){if(1&n&&(e.j41(0,"div",108),e.nrm(1,"i",109),e.j41(2,"span",110),e.EFF(3),e.k0s()()),2&n){const t=e.XpG(),r=t.priority,i=t.tooltip,s=e.XpG();e.Y8G("ngClass",s.getPriorityClass(r)),e.R7$(),e.Y8G("ngClass",s.getPriorityIcon(r)),e.R7$(2),e.SpI(" ",i," ")}}function uv(n,a){1&n&&e.DNE(0,pv,4,3,"div",107),2&n&&e.Y8G("ngIf","None"!==a.priority)}function fv(n,a){if(1&n){const t=e.RV6();e.j41(0,"app-close-opportunity",111),e.bIt("cardClosed",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.onCardClosed(i))})("closeModal",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.showCloseOpportunityDialog=!1)}),e.k0s()}if(2&n){const t=e.XpG();e.Y8G("Card",t.selectedCard)("ClosureType",t.closureType)("showCloseOpportunityDialog",t.showCloseOpportunityDialog)}}let mv=(()=>{class n{messageService;router;confirmationService;_boardService;teamsService;auth;cdr;IMG_ROUTE=`${Xt.c.apiUrl}/api/storage/image/`;edit=new e.bkB;cdkDragStarted=new e.bkB;cdkDragEnded=new e.bkB;card=null;boardId;boardTeamMembers=[];trackTitle="";teamId;quillAttachmentInput;sigFilePicker;cardArchived=new e.bkB;assignedUsersList=[];ConfirmationActionType=J.ON;deskfloPublicId="E07E3E31-F93B-40CD-A29F-E4444B54264C";initials=[];signatureHovered=!1;quill=null;selectedEmailConfig={};LOAD_STATE=J.nC;tagsArr=null;currencyCode="ZAR";
1isEmailPopUpVisible=!1;selectedContactEmail=null;selectedEmailContacts=[];tender=null;isGmailLinked;isOutlookLinked;activeProvider;quillConfig;emailSubject;emailBody;isSending=!1;isSignatureSet;setSignaturePage=!1;includeSignature=!0;previewUrl=null;emailSignature=null;dragOver=!1;selectedFiles=[];signatureToUpload;signaturePubId=null;environment=Xt.c;aiInsightVisible;selectedCard;showNotesDrawer;OpportunityStatusEnum=J.t4;closureType="";showCloseOpportunityDialog=!1;CardType=J.bU;constructor(t,r,i,s,o,l,c){this.messageService=t,this.router=r,this.confirmationService=i,this._boardService=s,this.teamsService=o,this.auth=l,this.cdr=c,this.currencyCode=this.teamsService.currencyCode,this.activeProvider="gmail",this.quillConfig={toolbar:{container:[["bold","italic","underline","strike"],[{list:"ordered"},{list:"bullet"}],[{size:["small",!1,"large","huge"]}],[{color:[]},{background:[]}],[{align:[]}],["link"],["attachment","signature"]],handlers:{attachment:()=>{this.triggerAttachment()},signature:()=>{this.setSignaturePage=!0}}}}}ngOnInit(){this.card&&(this.tagsArr=this.card.CardTags,this._boardService.updateCardTags(this.card.CardTags),this._boardService.cardUpdatesObservable$.subscribe(t=>{t&&this.card.Id===t.cardId&&(this.card.NotesCount=t.notesCount)}))}ngAfterViewInit(){this.card&&null!=this.card.TenderId&&(this.tender=this.card.Tender)}ngOnChanges(t){(t.card||t.boardTeamMembers)&&this.syncCardAssignees()}triggerAttachment(){this.quillAttachmentInput&&this.quillAttachmentInput.nativeElement.click()}syncCardAssignees(){if(!this.card||!this.boardTeamMembers||!this.card.AssignedUserIds)return void(this.assignedUsersList=[]);const t=[];this.card.AssignedUserIds.forEach(r=>{const i=this.boardTeamMembers.find(s=>s.Id==r);if(i){const s=(0,at.rU)(i.Name);t.some(l=>l.initial===s)||t.push({initial:s,fullName:i.Name,pictureId:i.PictureId})}}),this.assignedUsersList=t}getTagColor(t){const r=["#efeff1","#e9e3d4","#f6e2dd","#d3bfdb","#aeccdc","#d4e4ed","#b4ddd3","#e2f6d3","#fff8b8","#faafa8"];let i=0;for(let o=0;o<t?.length;o++)i=t.charCodeAt(o)+((i<<5)-i);return r[Math.abs(i)%r.length]}onDragStart(){this.cdkDragStarted.emit()}login(t){"outlook"===t?this.auth.initiateOutlookConnect().subscribe(r=>{window.location.href=r}):"gmail"===t&&this.auth.initiateGmailConnect()}onDragEnd(){this.cdkDragEnded.emit()}getTagTextColor(t){const r=parseInt(t.substring(1,3),16),i=parseInt(t.substring(3,5),16),s=parseInt(t.substring(5,7),16);return`rgb(${Math.floor(.5*r)}, ${Math.floor(.5*i)}, ${Math.floor(.5*s)})`}getInitials(t){if(!t)return"";const r=t.trim().split(" ");return 1===r.length?r[0][0].toUpperCase():(r[0][0]+r[r.length-1][0]).toUpperCase()}getCardPriorityTooltip(t){switch(t.Priority){case"Urgent":return"Hot ";case"Medium":return"Warm";case"Low":return"Cold";default:return""}}getCardPriorityColor(t){switch(t.Priority){case"Urgent":return"#e63946";case"Medium":return"#f1c232";case"Low":return"#6c757d";default:return"transparent"}}
1openEmailPopUp(t){this.isEmailPopUpVisible=!0}getStatusColor(t){switch(t){case"Open":return"#27ae60";case"Closing Soon":return"#f1c40f";case"Closed":return"#7f8c8d";default:return"#cccccc"}}getTenderStatus(t){if(!t)return"Unknown";const r=t instanceof Date?t:new Date(t),i=new Date,s=r.getTime()-i.getTime(),o=Math.ceil(s/864e5);return o<0?"Closed":o<=5?"Closing Soon":"Open"}getTenderTypeLabel(t){return 4===t||"4"===t?"RFB":String(t??"")}openAiInsights(t){this.isEmailPopUpVisible=!1,this.showNotesDrawer=!1,this.selectedCard=t,this.aiInsightVisible=!0,this.cdr.detectChanges()}openNotesDrawer(t){this.isEmailPopUpVisible=!1,this.aiInsightVisible=!1,this.selectedCard=t,this.showNotesDrawer=!0,this.cdr.detectChanges()}closeAiInsights(){this.aiInsightVisible=!1,this.selectedCard=null}closeNotesDrawer(){this.showNotesDrawer=!1,this.selectedCard=null}archiveCard(t){const r=t.Id,i=t.TrackId,s=this._boardService.getCurrentTracks,o=s.map(l=>String(l.Id)===String(i)?{...l,Cards:l.Cards.filter(c=>c.Id!==r)}:l);this._boardService.setTracks(o),this._boardService.archiveCard(t.Id).subscribe({next:()=>{this.messageService.add({severity:"info",summary:"Success",detail:"Deal deleted"})},error:()=>{this._boardService.setTracks(s),this.messageService.add({severity:"error",summary:"Error",detail:"Could not delete deal"})}})}handleConfirmation(t,r,i){let s="",o="",l="",c=()=>{},d=()=>{};r===J.ON.Delete&&(s="Are you sure you want to Delete?",o="Delete Confirmation",l="Delete",c=()=>this.archiveCard(i),d=()=>this.messageService.add({severity:"warn",summary:"Cancelled",detail:"Delete cancelled"})),this.confirmationDialog(t,s,o,l,c,d)}confirmationDialog(t,r,i,s,o,l){this.confirmationService.confirm({target:t.target,message:r,header:i,acceptLabel:s,icon:"pi pi-exclamation-triangle",acceptIcon:"none",rejectIcon:"none",rejectButtonStyleClass:"p-button-text",accept:()=>o(),reject:()=>{l&&l()}})}onCardClosed({}){this.showCloseOpportunityDialog=!1,this.selectedCard=null}openCloseOpportunityModal(t,r){t.stopPropagation(),this.closureType="Client Lost",this.selectedCard=r,this.showCloseOpportunityDialog=!0}getPriorityIcon(t){switch(t){case"Urgent":return"pi pi-check-circle";case"Medium":return"pi pi-exclamation-triangle";case"Low":return"pi pi-times-circle";default:return""}}getPriorityClass(t){switch(t){case"Urgent":return"priority-hot";case"Medium":return"priority-warm";case"Low":return"priority-cold";default:return""}}hasChromeExtensionTag(t){return t?.CardTags?.some(r=>"chrome-extension"===r.Name)??!1}static \u0275fac=function(r){return new(r||n)(e.rXU(be.bg),e.rXU(rn.Ix),e.rXU(be.td),e.rXU(_t.a),e.rXU(rt.n),e.rXU(jn.u),e.rXU(e.gRc))};static \u0275cmp=e.VBU({type:n,selectors:[["app-deal-card"]],viewQuery:function(r,i){if(1&r&&(e.GBs(cx,5),e.GBs(dx,5)),2&r){let s;e.mGM(s=e.lsd())&&(i.quillAttachmentInput=s.first),e.mGM(s=e.lsd())&&(i.sigFilePicker=s.first)}},inputs:{card:"card",boardId:"boardId",boardTeamMembers:"boardTeamMembers",trackTitle:"trackTitle",teamId:"teamId"},outputs:{edit:"edit",cdkDragStarted:"cdkDragStarted",cdkDragEnded:"cdkDragEnded",cardArchived:"cardArchived"},standalone:!1,features:[e.OA$],decls:18,vars:14,consts:[["cardFooter",""],["priorityBadge",""],["class","p-shadow-2 p-mb-1 cursor-pointer deal-card ","cdkDrag","",3,"minHeight","cdkDragData","click","cdkDragStarted","cdkDragEnded",4,"ngIf"],["class","email-card p-shadow-2 cursor-pointer ","cdkDrag","",3,"minHeight","cdkDragData","click","cdkDragStarted","cdkDragEnded",4,"ngIf"],["class","tender-card p-shadow-2 cursor-pointer","cdkDrag","",3,"cdkDragData","cdkDragStarted","cdkDragEnded","click",4,"ngIf"],["class","messenger-card p-shadow-2 cursor-pointer","cdkDrag","",3,"cdkDragData","cdkDragStarted","cdkDragEnded","click",4,"ngIf"],["class","whatsapp-card p-shadow-2 cursor-pointer","cdkDrag","",3,"cdkDragData","cdkDragStarted","cdkDragEnded","click",4,"ngIf"],["class","Instagram-card p-shadow-2 cursor-pointer","cdkDrag","",3,"cdkDragData","cdkDragStarted","cdkDragEnded","click",4,"ngIf"],["class","p-shadow-2 p-mb-1 cursor-pointer contact-card ","cdkDrag","",3,"minHeight","cdkDragData","click","cdkDragStarted","cdkDragEnded",4,"ngIf"],["class","p-shadow-2 p-mb-1 cursor-pointer chromExtension-card","cdkDrag","",3,"minHeight","cdkDragData","click","cdkDragStarted","cdkDragEnded",4,"ngIf"],[4,"ngIf"],[3,"visible","card","visibleChange","onClose",4,"ngIf"],[3,"Card","ClosureType","showCloseOpportunityDialog","cardClosed","closeModal",4,"ngIf"],["cdkDrag","",1,"p-shadow-2","p-mb-1","cursor-pointer","deal-card",3,"click","cdkDragStarted","cdkDragEnded","cdkDragData"],[1,"card-container"],[1,"flex","justify-content-between","align-items-start","mb-2"],[1,"flex","flex-column"],[1,"mt-1","font-semibold","title-clamp"],["class"," mt-1 font-bold",4,"ngIf"],["class","bg-red-50 border-1 border-red-100 border-round-md p-1 mb-3",3,"click",4,"ngIf"],[1,"flex","justify-content-between","align-items-center","mt-2","w-full","text-500"],["class","flex flex-column align-items-start",4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"mt-1","font-bold"],[1,"bg-red-50","border-1","border-red-100","border-round-md","p-1","mb-3",3,"click"],[1,"flex","align-items-center","mb-1"],[1,"pi","pi-times-circle","text-red-400","mr-2",2,"font-size","0.75rem"],[1,"text-red-500","font-bold","uppercase","tracking-tight",2,"font-size","0.65rem"],["class","text-600 line-height-2 title-clamp","style","font-size: 0.6rem;",4,"ngIf"],[1,"text-600","line-height-2","title-clamp",2,"font-size","0.6rem"],["class","flex mt-2 w-full",4,"ngIf"],[1,"flex","mt-2","w-full"],["class","mr-2",3,"background","color","borderRadius","fontSize","padding",4,"ngFor","ngForOf"],[1,"mr-2"],[1,"flex","flex-column","align-items-start"],[1,"text-xs"],["cdkDrag","",1,"email-card","p-shadow-2","cursor-pointer",3,"click","cdkDragStarted","cdkDragEnded","cdkDragData"],[1,"flex","flex-column","flex-1",2,"min-width","0"],[1,"email-badge"],[1,"pi","pi-envelope","mr-1","text-xs"],[2,"border-radius","12px","font-size","10px","padding","4px 8px","font-weight","500"],["cdkDrag","",1,"tender-card","p-shadow-2","cursor-pointer",3,"cdkDragStarted","cdkDragEnded","click","cdkDragData"],[1,"flex","flex-column","gap-1","pt-1"],[1,"font-semibold","text-sm","tender-title"],[1,"text-xs","text-500","tender-title"],[1,"tender-badge"],[1,"pi","pi-briefcase","mr-1","text-xs"],[1,"flex","align-items-center","gap-2","text-xs","text-500","mb-3"],[1,"my-2","border-top-1","surface-border"],["class","flex gap-2 mb-2 flex-wrap pr-1",4,"ngIf"],[1,"flex","gap-2","mb-2","flex-wrap","pr-1"],[1,"status-pill",3,"ngClass"],["cdkDrag","",1,"messenger-card","p-shadow-2","cursor-pointer",3,"cdkDragStarted","cdkDragEnded","click","cdkDragData"],[1,"font-semibold","text-sm"],[1,"text-xs","text-500"],[1,"messenger-badge"],[1,"pi","pi-facebook","mr-1","text-xs"],["class","flex mt-2 w-full mb-2",4,"ngIf"],[1,"flex","mt-2","w-full","mb-2"],["class","mr-2",3,"background","color","borderRadius","fontSize","padding","fontWeight",4,"ngFor","ngForOf"],["cdkDrag","",1,"whatsapp-card","p-shadow-2","cursor-pointer",3,"cdkDragStarted","cdkDragEnded","click","cdkDragData"],[1,"whatsapp-badge"],[1,"pi","pi-w
1hatsapp","mr-1","text-xs"],[1,"mr-2",2,"background","#e8f5e9","color","rgb(116, 113, 106)","border-radius","12px","font-size","10px","padding","4px 8px"],["cdkDrag","",1,"Instagram-card","p-shadow-2","cursor-pointer",3,"cdkDragStarted","cdkDragEnded","click","cdkDragData"],[1,"instagram-badge"],[1,"pi","pi-instagram","mr-1","text-xs"],[1,"mr-2",2,"background","#f1e5e1","color","rgb(116, 113, 106)","border-radius","12px","font-size","10px","padding","4px 8px"],["cdkDrag","",1,"p-shadow-2","p-mb-1","cursor-pointer","contact-card",3,"click","cdkDragStarted","cdkDragEnded","cdkDragData"],[1,"contact-badge"],[1,"pi","pi-address-book","mr-1","text-xs"],["cdkDrag","",1,"p-shadow-2","p-mb-1","cursor-pointer","chromExtension-card",3,"click","cdkDragStarted","cdkDragEnded","cdkDragData"],[1,"flex","justify-content-between","align-items-start"],["class","font-semibold text-sm tender-title",4,"ngIf"],[1,"chromExtension-badge"],[1,"pi","pi-globe","mr-1","text-xs"],["class","text-xs text-500 tender-title",4,"ngIf"],["class","flex align-items-center text-600 text-xs gap-2",4,"ngIf"],["class","surface-ground border-1 surface-border border-round-xl p-2 flex align-items-center mb-2 w-full overflow-hidden","style","background-color: #f8fafc;",4,"ngIf"],[1,"flex","align-items-center","text-600","text-xs","gap-2"],[1,"pi","pi-envelope","text-500","text-xs"],[1,"pi","pi-phone","text-500","text-xs"],[1,"surface-ground","border-1","surface-border","border-round-xl","p-2","flex","align-items-center","mb-2","w-full","overflow-hidden",2,"background-color","#f8fafc"],["target","_blank",1,"text-600","text-xs","no-underline","truncate","block",2,"flex-grow","1","min-width","0","max-width","calc(100% - 28px)"],[1,"form-badge"],[1,"pi","pi-file","mr-1","text-xs"],[3,"isEmailPopUpVisibleChange","isEmailPopUpVisible","email","source"],[3,"visibleChange","onClose","visible","card"],[1,"flex","justify-content-between","align-items-center","mt-2","w-full",2,"border-top","1px solid #cccc",3,"click"],["tooltipPosition","top",1,"flex","align-items-start","text-xs","mt-1","font-normal",3,"pTooltip"],[1,"text-gray-600","ml-1"],[1,"flex","flex-row","justify-content-between","gap-1","mr-2","p-2"],["title","View AI Insights",1,"pi","pi-sparkles","cursor-pointer","text-500","hover:text-blue-500","mt-1",3,"click"],[1,"flex","align-items-center","gap-2","mt-1"],[1,"flex","align-items-center","gap-2","mt-1","ml-1"],["pTooltip","Delete Deal","tooltipPosition","top",1,"pi","pi-trash","cursor-pointer","text-500","hover:text-red-500",3,"click"],["pTooltip","Send an email","tooltipPosition","top",1,"pi","pi-envelope","cursor-pointer","text-500","hover:text-blue-500",3,"click"],[1,"relative-icon"],["pTooltip","View Notes","tooltipPosition","top",1,"pi","pi-file-o","hover:text-blue-500",2,"cursor","pointer","font-size","1rem","color","#6b7280",3,"click"],["class","badge","style","width:15px; height:15px; background-color:#3b82f6; color:white; font-size:10px;",4,"ngIf"],["class","badge","style","width:auto; height:auto;",4,"ngIf"],["tooltipPosition","top",1,"avatar-initial",3,"pTooltip"],["class","text-sm text-500",4,"ngIf"],[1,"text-sm","text-500"],[1,"badge",2,"width","15px","height","15px","background-color","#3b82f6","color","white","font-size","10px"],[1,"badge",2,"width","auto","height","auto"],[1,"pi","pi-bell",2,"color","#ef4444","font-size","0.8rem"],["class","flex align-items-center justify-content-center gap-1 py-1 border-round-3xl border-1 shadow-sm w-5rem",3,"ngClass",4,"ngIf"],[1,"flex","align-items-center","justify-content-center","gap-1","py-1","border-round-3xl","border-1","shadow-sm","w-5rem",3,"ngClass"],[2,"font-size","10px !important",3,"ngClass"],[1,"font-semibold","uppercase","text-center",2,"font-size","9px"],[3,"cardClosed","closeModal","Card","ClosureType","showCloseOpportunityDialog"]],template:function(r,i){1&r&&e.DNE(0,Cx,12,12,"p-card",2)(1,Rx,15,12,"p-card",3)(2,Ox,18,13,"p-card",4)(3,Wx,16,11,"p-card",5)(4,n2,16,11,"p-card",6)(5,u2,16,11,"p-card",7)(6,k2,15,12,"p-card",8)(7,O2,17,15,"p-card",9)(8,W2,12,12,"p-card",2)(9,nv,15,12,"p-card",8)(10,rv,2,3,"div",10)(11,iv,1,2,"app-deal-ai",11)(12,av,1,2,"app-deal-notes",11)(13,dv,17,10,"ng-template",null,0,e.C5r)(15,uv,1,1,"ng-template",null,1,e.C5r)(17,fv,1,3,"app-close-opportunity",12),2&r&&(e.Y8G("ngIf",i.card.CardTypeId===i.CardType.Manual),e.R7$(),e.Y8G("ngIf",i.card.CardTypeId===i.CardType.Email),e.R7$(),e.Y8G("ngIf",i.card.CardTypeId===i.CardType.Tender),e.R7$(),e.Y8G("ngIf",i.card.CardTypeId===i.CardType.Messenger),e.R7$(),e.Y8G("ngIf",i.card.CardTypeId===i.CardType.WhatsApp),e.R7$(),e.Y8G("ngIf",i.card.CardTypeId===i.CardType.Instagram),e.R7$(),e.Y8G("ngIf",i.card.CardTypeId===i.CardType.Contacts&&!i.hasChromeExtensionTag(i.card)),e.R7$(),e.Y8G("ngIf",i.card.CardTypeId===i.CardType.ChromExtension||i.hasChromeExtensionTag(i.card)),e.R7$(),e.Y8G("ngIf",i.card.CardTypeId!==i.CardType.Contacts&&i.card.CardTypeId!==i.CardType.Manual&&i.card.CardTypeId!==i.CardType.Instagram&&i.card.CardTypeId!==i.CardType.Email&&i.card.CardTypeId!==i.CardType.Tender&&i.card.CardTypeId!==i.CardType.Messenger&&i.card.CardTypeId!==i.CardType.Form&&i.card.CardTypeId!==i.CardType.WhatsApp&&(i.card.CardTypeId!==i.CardType.ChromExtension||!i.hasChromeExtensionTag(i.card))),e.R7$(),e.Y8G("ngIf",i.card.CardTypeId===i.CardType.Form),e.R7$(),e.Y8G("ngIf",i.isEmailPo
1pUpVisible),e.R7$(),e.Y8G("ngIf",i.aiInsightVisible),e.R7$(),e.Y8G("ngIf",i.showNotesDrawer),e.R7$(5),e.Y8G("ngIf",i.selectedCard))},dependencies:[q.YU,q.Sq,q.bT,q.T3,At.Zp,wt.m_,Ur.T1,zs,U_,dc.Z,pc,q.oe,q.vh,lx.O],styles:['[_nghost-%COMP%] .p-card{font-size:.85rem;display:flex;flex-direction:column;gap:.5rem;margin-bottom:.5rem;border:1px solid #cccc;width:269px;overflow:hidden}[_nghost-%COMP%] quill-editor>.ql-toolbar.ql-snow{border:none!important}.seamless-wrapper[_ngcontent-%COMP%]{border:1px solid #ccc;display:flex;flex-direction:column;height:auto;background:#fff}:is() .ql-container.ql-snow[_ngcontent-%COMP%], :is() .ql-toolbar.ql-snow[_ngcontent-%COMP%]{border:none!important}:is() .ql-toolbar[_ngcontent-%COMP%]{border-bottom:1px solid #eee!important}.scroll-container[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;height:auto;overflow-y:auto;scrollbar-width:none}quill-editor[_ngcontent-%COMP%]{flex:1}.internal-footer[_ngcontent-%COMP%]{padding:0 20px;border-top:1px dotted #eee;background-color:#fafafa;position:sticky;bottom:0;width:100%}.footer-table[_ngcontent-%COMP%]{width:100%;color:#666;font-size:12px;align-items:center;justify-content:center}.send-email-icon[_ngcontent-%COMP%]:hover{color:#2584ec}.send-email-icon[_ngcontent-%COMP%]{font-size:1rem;border-radius:5px;padding:.25rem .45rem}[_nghost-%COMP%] .p-card-body{padding:8px}[_nghost-%COMP%] .tender-card .p-card-body{padding:0!important}[_nghost-%COMP%] .messenger-card .p-card-body{padding:0!important}[_nghost-%COMP%] .whatsapp-card .p-card-body{padding:0!important}[_nghost-%COMP%] .Instagram-card .p-card-body{padding:0!important}[_nghost-%COMP%] .email-card .p-card-body{padding:0!important}[_nghost-%COMP%] .contact-card .p-card-body{padding:0!important}[_nghost-%COMP%] .chromExtension-card .p-card-body{padding:0!important}.avatar-initial[_ngcontent-%COMP%]{width:18px;height:18px;border-radius:50%;background-color:#2584ec;color:#fff;display:flex;align-items:center;justify-content:center;text-transform:uppercase;font-size:.6rem}.deal-card[_ngcontent-%COMP%] .priority-emoji[_ngcontent-%COMP%]{position:absolute;top:0rem;right:0rem;width:1rem;height:1.5rem;display:flex;justify-content:center;align-items:center;border-radius:50%;color:#fff;font-size:1.1rem;z-index:10}.deal-card[_ngcontent-%COMP%] .card-container[_ngcontent-%COMP%]{position:relative}[_nghost-%COMP%] .tender-card .p-card, [_nghost-%COMP%] .email-card .p-card, [_nghost-%COMP%] .contact-card .p-card, [_nghost-%COMP%] .messenger-card .p-card, [_nghost-%COMP%] .whatsapp-card .p-card, [_nghost-%COMP%] .chromExtension-card .p-card, [_nghost-%COMP%] .Instagram-card .p-card{padding:0 0 .5rem .5rem;font-size:.85rem;display:flex;flex-direction:column;gap:.5rem;margin-bottom:.5rem;border-right:1px solid #ccc;border-top:1px solid #ccc;border-bottom:1px solid #ccc}[_nghost-%COMP%] .tender-card .p-card{border-left:3px solid #28af60}[_nghost-%COMP%] .email-card .p-card{border-left:3px solid #2662d9}[_nghost-%COMP%] .contact-card .p-card{border-left:3px solid #3362a9}[_nghost-%COMP%] .messenger-card .p-card{border-left:3px solid #7648d1}[_nghost-%COMP%] .whatsapp-card .p-card{border-left:3px solid #48d14f}[_nghost-%COMP%] .chromExtension-card .p-card{border-left:3px solid #488fd1}[_nghost-%COMP%] .Instagram-card .p-card{border-left:3px solid #e15930}.tender-badge[_ngcontent-%COMP%], .email-badge[_ngcontent-%COMP%], .contact-badge[_ngcontent-%COMP%], .form-badge[_ngcontent-%COMP%], .whatsapp-badge[_ngcontent-%COMP%], .messenger-badge[_ngcontent-%COMP%], .chromExtension-badge[_ngcontent-%COMP%], .instagram-badge[_ngcontent-%COMP%]{color:#fff;font-size:.65rem;padding:.25rem .6rem;border-radius:0 10px;font-weight:600;display:flex;align-items:center;justify-content:center;width:100px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex-shrink:0}.contact-badge[_ngcontent-%COMP%]{background:#3362a9}.tender-badge[_ngcontent-%COMP%]{background:#28af60}.email-badge[_ngcontent-%COMP%]{background:#2662d9}.messenger-badge[_ngcontent-%COMP%]{background:#7648d1}.whatsapp-badge[_ngcontent-%COMP%]{background:#48d14f}.instagram-badge[_ngcontent-%COMP%]{background:linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888)}.form-badge[_ngcontent-%COMP%]{background:#1dc4b3}.chromExtension-badge[_ngcontent-%COMP%]{background:#488fd1}.category-pill[_ngcontent-%COMP%]{font-size:.7rem;padding:.25rem .6rem;border-radius:999px;background:#f1f5f9;color:#475569;font-weight:500}.status-pill[_ngcontent-%COMP%]{font-size:.7rem;padding:.25rem .7rem;border-radius:999px;font-weight:600}.status-open[_ngcontent-%COMP%]{background:#dcfce7;color:#15803d}.status-closing[_ngcontent-%COMP%]{background:#fef3c7;color:#b45309}
1.avatar-circle[_ngcontent-%COMP%]{width:32px;height:32px;border-radius:50%;background:#22c55e;color:#fff;font-size:.75rem;font-weight:600;display:flex;align-items:center;justify-content:center}.tender-title[_ngcontent-%COMP%]{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;line-height:1.3rem;max-height:2.6rem}.remove-email[_ngcontent-%COMP%]{cursor:pointer;margin-left:8px;display:inline-flex;align-items:center;vertical-align:middle}[_nghost-%COMP%] .remove-email>i{font-size:.45rem!important;color:#666;transition:color .2s}[_nghost-%COMP%] .remove-email:hover>.pi{color:#ff4d4d}.text-pill[_ngcontent-%COMP%]{background-color:#e8effa;color:#4487f2;padding:2px 10px;border-radius:16px;font-size:13px;font-weight:500;white-space:nowrap}.input-wrapper[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:4px;padding:4px;border:1px solid #ccc;border-radius:4px;align-items:center;width:100%;background-color:#fff;min-height:40px;transition:border-color .2s}.input-wrapper[_ngcontent-%COMP%]:focus-within{border-color:#3b82f6;box-shadow:0 0 0 2px #3b82f61a}.ghost-input[_ngcontent-%COMP%]{flex:1;border:none;outline:none;min-width:100px;padding:4px;font-size:14px;background:transparent}.dot[_ngcontent-%COMP%]{height:8px;width:8px;border-radius:50%;display:inline-block}.provider-dot-container[_ngcontent-%COMP%]{width:1.3rem;height:3rem;display:flex;flex-direction:column;justify-content:start}.provider-dot[_ngcontent-%COMP%]{height:10px;width:10px;border-radius:50%;display:inline-block}.unselected[_ngcontent-%COMP%]{color:#49739c!important}.provider-pill[_ngcontent-%COMP%]{display:flex;flex-direction:row;color:#000;justify-content:space-between;align-items:center;padding:0 0 0 1rem;background-color:#fcfcfc;width:50%;cursor:pointer;border-radius:15px;border:2px solid rgb(228,230,235);transition:all .1s ease-in-out}.gmail-active[_ngcontent-%COMP%]{background-color:#fdeeee;border-color:#f33}.outlook-active[_ngcontent-%COMP%]{background-color:#f5faff;border-color:#3399f2}.provider-pill.gmail-active[_ngcontent-%COMP%]:hover{border-color:#f33}.provider-pill.outlook-active[_ngcontent-%COMP%]:hover{border-color:#3399f2}.provider-pill[_ngcontent-%COMP%]:hover{border:2px solid rgb(199,200,206)}.provider-pill-active[_ngcontent-%COMP%]{background-color:#f3f4f6;color:#000;border-color:transparent;border-radius:5px;box-shadow:none}.link-acccount-btn[_ngcontent-%COMP%]{text-decoration:underline;font-size:.65rem;cursor:pointer;transition:all .1s ease-in-out}.account-linked-marker[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:.3rem;color:#30bd53;font-size:.65rem;cursor:pointer;transition:all .1s ease-in-out} .ql-insert .ql-picker-label:before{content:"Insert"!important;padding-right:8px} .ql-insert .ql-picker-item[data-value=signature]:before{content:"\\270d\\fe0f Signature"!important} .ql-insert .ql-picker-item[data-value=attachment]:before{content:"\\1f4ce Attachment"!important} .ql-insert.ql-picker{width:80px!important}[_nghost-%COMP%] .signature-dialog .p-dialog-header{border-bottom:1px solid #f1f5f9;padding:1.5rem}[_nghost-%COMP%] .signature-dialog .p-dialog-content{padding:2rem 1.5rem}[_nghost-%COMP%] .signature-dialog .p-dialog-footer{border-top:1px solid #f1f5f9;padding:1rem 1.5rem}.header-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.upload-box[_ngcontent-%COMP%]{border:2px dashed #cbd5e1;border-radius:12px;background:#f8fafc;transition:all .2s ease-in-out;cursor:pointer;position:relative;overflow:hidden;min-height:200px;display:flex;align-items:center;justify-content:center}.upload-box[_ngcontent-%COMP%]:hover{border-color:#3b82f6;border-color:var(--primary-color, #3b82f6);background:#eff6ff}.upload-box.drag-over[_ngcontent-%COMP%]{background:#dbeafe;border-color:#3b82f6;border-color:var(--primary-color, #3b82f6);transform:scale(1.02)}.upload-placeholder[_ngcontent-%COMP%]{text-align:center;padding:2rem}.upload-placeholder[_ngcontent-%COMP%] .icon-circle[_ngcontent-%COMP%]{width:48px;height:48px;background:#fff;border-radius:50%;display:flex;align-items:center;justify-content:center;margin:0 auto 1rem;box-shadow:0 2px 4px #0000000d}
1.upload-placeholder[_ngcontent-%COMP%] .icon-circle[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:1.5rem;color:#64748b}.upload-placeholder[_ngcontent-%COMP%] .upload-text[_ngcontent-%COMP%]{margin:0;color:#334155;font-size:1rem}.upload-placeholder[_ngcontent-%COMP%] .upload-subtext[_ngcontent-%COMP%]{margin:.25rem 0 0;color:#64748b;font-size:.875rem}.preview-container[_ngcontent-%COMP%]:hover .overlay[_ngcontent-%COMP%]{opacity:1}.footer-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:.75rem;width:100%}.attachment-tray[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px;padding:10px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px}.attachment-pill[_ngcontent-%COMP%]{display:flex;align-items:center;background:#fff;border:1px solid #cbd5e1;padding:4px 10px;border-radius:20px;font-size:13px;box-shadow:0 1px 2px #0000000d}.file-label[_ngcontent-%COMP%]{margin:0 8px;max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.remove-pill-btn[_ngcontent-%COMP%]{border:none;background:transparent;color:#94a3b8;cursor:pointer;display:flex;align-items:center;transition:color .2s}.remove-pill-btn[_ngcontent-%COMP%]:hover{color:#ef4444}[_nghost-%COMP%] .ql-attachment:before{content:"Attach";font-size:16px}[_nghost-%COMP%] .ql-signature:before{content:"Sign"!important;font-size:16px}[_nghost-%COMP%] .ql-attachment:hover:after{content:" Attach";font-size:10px;vertical-align:middle}.relative-icon[_ngcontent-%COMP%]{position:relative;display:inline-block;margin-bottom:-5px}.badge[_ngcontent-%COMP%]{position:absolute;top:0;right:0;transform:translate(50%,-50%);border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700;line-height:1;font-family:Arial,sans-serif}.title-clamp[_ngcontent-%COMP%]{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word;width:100%}.priority-hot[_ngcontent-%COMP%], .priority-warm[_ngcontent-%COMP%], .priority-cold[_ngcontent-%COMP%]{width:60px;text-align:center;display:inline-block;justify-content:center;font-size:9px!important;border:1px solid;border-radius:4px;padding:2px 0}.priority-hot[_ngcontent-%COMP%]{background-color:#ecfdf5;border-color:#a7f3d0;color:#059669}.priority-warm[_ngcontent-%COMP%]{background-color:#fffbeb;border-color:#fde68a;color:#d97706}.priority-cold[_ngcontent-%COMP%]{background-color:#f8fafc;border-color:#e2e8f0;color:#475569}'],changeDetection:0})}return n})();const hv=()=>({width:"300px"}),gv=()=>({width:"420px"}),_v=n=>({restricted:n});function xv(n,a){if(1&n){const t=e.RV6();e.j41(0,"div")(1,"input",26),e.mxI("ngModelChange",function(i){e.eBV(t);const s=e.XpG().$implicit;return e.DH7(s.Title,i)||(s.Title=i),e.Njj(i)}),e.bIt("blur",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.stopEditingTrackName())})("keydown.enter",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.stopEditingTrackName())}),e.k0s()()}if(2&n){const t=e.XpG().$implicit;e.R7$(),e.R50("ngModel",t.Title)}}function vv(n,a){if(1&n&&(e.j41(0,"h5",27),e.EFF(1),e.k0s()),2&n){const t=e.XpG().$implicit;e.R7$(),e.SpI(" ",t.Title," ")}}function bv(n,a){if(1&n&&(e.j41(0,"div",28)(1,"small",29),e.EFF(2),e.nI1(3,"currency"),e.k0s()()),2&n){const t=e.XpG().$implicit,r=e.XpG();e.R7$(2),e.SpI(" ",e.ii3(3,1,r.getTotalCardAmount(t.Cards),r.currencyCode,"symbol-narrow","0.0-2")," ")}}function Cv(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",30),e.nrm(1,"p-menu",31,2),e.j41(3,"i",32),e.bIt("click",function(){e.eBV(t);const i=e.XpG().index,s=e.XpG();return e.Njj(s.onCreateTrack(i))}),e.k0s(),e.j41(4,"i",33),e.bIt("click",function(i){e.eBV(t);const s=e.sdS(2),o=e.XpG(2);return s.toggle(i),e.Njj(o.intialiseMenuItems())}),e.k0s()()}if(2&n){const t=e.XpG().$implicit;e.R7$(),e.Y8G("popup",!0)("model",t.menuItems)}}function kv(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",34),e.bIt("click",function(){e.eBV(t);const i=e.XpG().$implicit,s=e.XpG();return e.Njj(s.createTicketModal(i))}),e.k0s()}}function Tv(n,a){if(1&n&&(e.j41(0,"div",35),e.EFF(1),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.SpI(" No cards for ",t.currentYear," ")}}function wv(n,a){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"app-deal-card",36),e.bIt("cdkDragStarted",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.onCardDragStarted())})("cdkDragEnded",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.onCardDragEnded())})("edit",function(){const i=e.eBV(t).$implicit,s=e.XpG().$implicit,o=e.XpG();return e.Njj(o.addEditTalk(i,s,!0))}),e.k0s(),e.bVm()}if(2&n){const t=a.$implicit,r=e.XpG().$implicit,i=e.XpG();e.R7$(),e.Y8G("cdkDragData",t)("card",t)("trackTitle",r.Title)("id",t.Id)("boardId",i.boardId)("boardTeamMembers",
1i.boardTeamMembers)("teamId",i.teamId)}}function yv(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",14)(1,"div",15),e.bIt("mouseenter",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.hoverTrack=!0)})("mouseleave",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.hoverTrack=!1)}),e.j41(2,"div",16),e.DNE(3,xv,2,1,"div",17)(4,vv,2,1,"ng-template",null,1,e.C5r)(6,bv,4,6,"div",18),e.k0s(),e.j41(7,"div",19)(8,"div",20),e.EFF(9),e.k0s(),e.DNE(10,Cv,5,2,"div",21),e.k0s(),e.DNE(11,kv,1,0,"button",22),e.k0s(),e.j41(12,"cdk-virtual-scroll-viewport",23),e.bIt("cdkDropListDropped",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.onTalkDrop(i))}),e.DNE(13,Tv,2,1,"div",24)(14,wv,2,7,"ng-container",25),e.k0s()()}if(2&n){const t=a.$implicit,r=a.index,i=e.sdS(5),s=e.XpG();e.R7$(),e.xc7("background",s.getTrackColor(t.Title,t.Color)),e.Y8G("ngClass",e.eq3(17,_v,s.isRestrictedTrack(t.Title))),e.R7$(2),e.Y8G("ngIf",s.editingTrackId===t.Id)("ngIfElse",i),e.R7$(3),e.Y8G("ngIf",!t.HideAmount),e.R7$(3),e.SpI(" ",s.getActiveCardCount(t.Cards)," "),e.R7$(),e.Y8G("ngIf",!s.isRestrictedTrack(t.Title)),e.R7$(),e.Y8G("ngIf",0===r),e.R7$(),e.Y8G("itemSize",200)("id",t.Id.toString())("cdkDropListConnectedTo",s.connectedDropLists)("cdkDropListData",t.Cards)("cdkDropListAutoScrollStep",50),e.R7$(),e.Y8G("ngIf",!t.Cards.length),e.R7$(),e.Y8G("ngForOf",t.Cards)("ngForTrackBy",s.trackByCardId)}}function Fv(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",37),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG();return e.Njj(s.updateTrackColor(i.color))}),e.k0s()}if(2&n){const t=a.$implicit;e.xc7("background",t.color),e.Y8G("title",t.name)}}function Sv(n,a){if(1&n){const t=e.RV6();e.j41(0,"app-close-opportunity",38),e.bIt("cardClosed",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.onCardClosed(i))})("closeModal",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.showCloseOpportunityDialog=!1)}),e.k0s()}if(2&n){const t=e.XpG();e.Y8G("Card",t.selectedCard)("ClosureType",t.closureType)("showCloseOpportunityDialog",t.showCloseOpportunityDialog)}}function Ev(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",39)(1,"div",40),e.nrm(2,"i",41),e.k0s(),e.j41(3,"span",42),e.EFF(4),e.k0s(),e.j41(5,"p",43),e.EFF(6),e.k0s(),e.j41(7,"div",44)(8,"button",45),e.bIt("click",function(){e.eBV(t),e.XpG();const i=e.sdS(8);return e.Njj(i.onAccept())}),e.k0s(),e.j41(9,"button",46),e.bIt("click",function(){e.eBV(t),e.XpG();const i=e.sdS(8);return e.Njj(i.onReject())}),e.k0s()()()}if(2&n){const t=a.$implicit;e.R7$(4),e.SpI(" ",t.header," "),e.R7$(2),e.JRh(t.message),e.R7$(2),e.Y8G("label",t.acceptLabel)}}let uc=(()=>{class n{boardService;viewContainerRef;cdRef;confirmationService;messageService;teamsService;Tracks=[];boardId;board;teamId;currentYear;createTicket=new e.bkB;cardDragStarted=new e.bkB;cardDragEnded=new e.bkB;ConfirmationActionType=J.ON;viewport;editingTrackId=null;activeMenuTrackId=null;showColorPicker;isDragging;isTemplateEmailsOpen=!1;selectedTrack=null;boardInputSearch="";movedCard=null;dragDelay=0;showCloseOpportunityDialog=!1;closureType="";selectedCard=null;openedCard=null;colors=at.Tj;currencyCode="ZAR";hoverTrack=!1;boardTeamMembers=[];isCardLoading=!1;titleToColorName={Lead:"Ocean Blue","Meeting/Cold call-email":"Sky Cyan","Quote Sent":"Rose Pink","Client Win":"Forest Green","Client Lost":"Cherry Red",Paused:"Golden Yellow"};restrictedTracks=["Client Win","Client Lost"];constructor(t,r,i,s,o,l){this.boardService=t,this.viewContainerRef=r,this.cdRef=i,this.confirmationService=s,this.messageService=o,this.teamsService=l,this.currencyCode=this.teamsService.currencyCode}ngOnInit(){console.log("Tracks",this.Tracks),this.boardTeamMembers=this.board.BoardUsers}ngOnChanges(t){t.Tracks&&t.Tracks.currentValue&&(this.intialiseMenuItems(),this.Tracks=this.sortTracks(t.Tracks.currentValue))}intialiseMenuItems(){this.Tracks.forEach(t=>{t.menuItems=[{label:"Edit",icon:"pi pi-pencil",command:()=>this.startEditingTrackName(t)},{label:"Delete",icon:"pi pi-trash",command:r=>this.handleConfirmation(r.originalEvent,J.ON.Delete,t.Id)},{label:"Change Color",icon:"pi pi-palette",command:()=>this.openColorPicker(t)},{label:t.HideAmount?"Show Amount":"Hide Amount",icon:t.HideAmount?"pi pi-eye":"pi pi-eye-slash",command:()=>this.toggleAmount(t)}]})}getTrackColor(t,r){if(r&&""!==r.trim())return r;const i=this.titleToColorName[t],s=at.Tj.find(o=>o.name===i);return s?s.color:"#4a90e2"}getActiveCardCount(t){return Array.isArray(t)?t.length:0}getTotalCardAmount(t){return Array.isArray(t)?t.reduce((r,i)=>r+(i.Amount||0),0):0}onCardDragStarted(){this.cardDragStarted.emit()}onCardDragEnded(){this.cardDragEnded.emit()}onTrackDrop(t){const r=this.Tracks[t.previousIndex],i=["Client Win","Client Lost"];if(i.includes(r.Title))return void this.messageService.add({severity:"warn",summary:"Action not allowed",detail
1:`"${r.Title}" track cannot be moved.`});const s=this.Tracks.findIndex(l=>i.includes(l.Title));t.currentIndex>=s?this.messageService.add({severity:"warn",summary:"Action not allowed",detail:`Cannot place a track beyond "${this.Tracks[s].Title}".`}):t.previousIndex!==t.currentIndex&&((0,Ur.HD)(this.Tracks,t.previousIndex,t.currentIndex),this.Tracks=[...this.Tracks],this.Tracks.forEach((l,c)=>{this.boardService.updateTrack(l.Id,l.Title,l.BoardId,c,l.Color,l.HideAmount).subscribe()}))}trackById(t,r){return r.Id}onToggleMenu(t){this.activeMenuTrackId=this.activeMenuTrackId===t?null:t}onEditTrack(t){this.activeMenuTrackId=null}startEditingTrackName(t){this.editingTrackId=t.Id}stopEditingTrackName(){if(!this.editingTrackId)return;const t=this.Tracks.find(r=>r.Id===this.editingTrackId);t&&(this.boardService.updateTrack(t.Id,t.Title,t.BoardId,t.Order,t.Color,t.HideAmount).subscribe({next:r=>{const i=this.Tracks.findIndex(s=>s.Id===r.Id);-1!==i&&(r.Cards&&r.Cards.sort((s,o)=>{const l=s.DateCreatedUtc?new Date(s.DateCreatedUtc).getTime():0;return(o.DateCreatedUtc?new Date(o.DateCreatedUtc).getTime():0)-l}),this.Tracks[i]=r)},error:r=>{console.error("Failed to update track title:",r)}}),this.editingTrackId=null)}onCreateTrack(t){this.boardService.createTrack("New Stage "+this.Tracks.length,this.boardId,t+1).subscribe({next:s=>{s.Cards||(s.Cards=[]),this.Tracks.splice(t+1,0,s),this.Tracks=this.sortTracks(this.Tracks)},error:s=>{}})}deleteTrackById(t){t&&this.boardService.deleteTrack(t).subscribe({next:()=>{this.Tracks=this.Tracks.filter(r=>r.Id!==t),this.messageService.add({severity:"success",summary:"Track Deleted",detail:"The track was deleted successfully."})},error:()=>{this.messageService.add({severity:"error",summary:"Deletion Failed",detail:"Could not delete the track. Please try again."})}})}handleConfirmation(t,r,i){let s="",o="",l="",c=()=>{},d=()=>{};switch(r){case J.ON.Delete:s="Are you sure you want to Delete?",o="Delete Confirmation",l="Delete",c=()=>this.deleteTrackById(i),d=()=>this.messageService.add({severity:"warn",summary:"Cancelled",detail:"Delete cancelled"});break;case J.ON.Confirmation:s="Are you sure you want to move this card?",o="Move Card Confirmation",l="Comfirm",c=()=>{const{cardId:p,stageId:u,stageTitle:f}=i;this.moveCardConfirmed(p,u,f)},d=()=>this.messageService.add({severity:"warn",summary:"Cancelled",detail:"Move card cancelled"})}this.confirmationDialog(t,s,o,l,c,d)}moveCardConfirmed(t,r,i){const s=this.Tracks.find(c=>c.Cards.some(d=>d.Id===t)),o=this.Tracks.find(c=>c.Id===r),l=s?.Cards.find(c=>c.Id===t);s&&o&&l?(this.moveCardBetweenTracks(s,o,l,l.Status),this.messageService.add({severity:"success",summary:"Moved",detail:`Card moved to ${i}`})):this.messageService.add({severity:"error",summary:"Error",detail:"Failed to move card"})}confirmationDialog(t,r,i,s,o,l){this.confirmationService.confirm({target:t.target,message:r,header:i,acceptLabel:s,icon:"pi pi-exclamation-triangle",acceptIcon:"none",rejectIcon:"none",rejectButtonStyleClass:"p-button-text",accept:()=>o(),reject:()=>{l&&l()}})}toggleColorPicker(){this.showColorPicker=!this.showColorPicker}updateTrackColor(t){this.selectedTrack&&(this.showColorPicker=!1,this.updateTrackHighLevel(this.selectedTrack.Id,this.selectedTrack.Title,this.selectedTrack.BoardId,this.selectedTrack.Order,t,this.selectedTrack.HideAmount))}updateTrackHighLevel(t,r,i,s,o,l){this.boardService.updateTrack(t,r,i,s,o,l).subscribe({next:c=>{const d=this.Tracks.findIndex(p=>p.Id===t);-1!==d&&(c.Cards&&c.Cards.length>0&&c.Cards.sort((p,u)=>new Date(u.DateCreatedUtc).getTime()-new Date(p.DateCreatedUtc).getTime()),this.Tracks[d]=c)},error:c=>{console.error("Failed to update color:",c)}})}addEditTalk(t,r,i=!1){this.isCardLoading=!0,this.boardService.getCard(t.Id).subscribe({next:s=>{const o=this.viewContainerRef.createComponent(qg);o.instance.selectedCard=s,this.openedCard=s,o.instance.edit=i,this.isCardLoading=!1,o.instance.closeSlider.subscribe(l=>{this.updatedCard(l,t,r,i),this.editCard(o)}),o.instance.userAssignedEvent.subscribe(l=>{Object.assign(t,{...t,AssignedUserId:l})}),o.instance.cardArchived.subscribe(({cardId:l,trackId:c})=>{const d=this.Tracks.map(p=>Number(p.Id)===c?{...p,Cards:p.Cards.filter(u=>u.Id!==l)}:{...p});this.Tracks=d,this.boardService.setTracks(d),this.boardService.addOrUpdateCard(+this.boardId,l)}),o.instance.cardClosed.subscribe(({cardId:l,status:c})=>{this.moveCardToCorrectTrack(l,c)}),o.instance.moveCard.subscribe(({cardId:l,stageId:c,stageTitle:d})=>{const p=new MouseEvent("click");this.handleConfirmation(p,J.ON.Confirmation,{cardId:l,stageId:c,stageTitle:d})})},error:s=>{this.isCardLoading=!1,console.error("Error fetching card details:",s)}})}openColorPicker(t){this.selectedTrack=t,this.showColorPicker=!0}batchUpdatePositionInTrack(t){const r=t.Cards.slice();this.boardService.changeTicketPositionInTrack(r,()=>{})}onTalkDrop(t){const r=t.item.data;if(r){if(t.previousContainer===t.container){(0,Ur.HD)(t.container.data,t.previousIndex,t.currentIndex);const i=this.Tracks.find(s=>s.Id.toString()===t.container.id);i&&(i.Cards=[...t.container.data],i.Cards.forEach((s,o)=>s.Order=o+1),this.batchUpdatePositionInTrack(i))}else{const i=this.Tracks.find(l=>l.Id.toString()===t.previousContainer.id),s=this.Tracks.find(l=>l.Id.toString()===t.container.id);this.movedCard=r;let o=null;if(!s)return;switch(s.Title){case"Client Win":o="Client Win";break;case"Client Lost":o="Client Lost";break;case"Paused":o="Paused"}if((this.movedCard.Status===J.t4.Won||this.movedCard.Status===J.t4.Lost||this.movedCard.Status===J.t4.Paused)&&this.boardService.reopenOpportunity(this.movedCard.Id).subscribe({next:()=>{this.messageService.add({severity:"success",summary:"Success",detail
1:"Opportunity reopened!"})},error:l=>{this.messageService.add({severity:"error",summary:"Error",detail:"Failed to reopen opportunity."})}}),o)return void this.openCloseOpportunityModal(o);{const l=t.previousContainer.data.findIndex(c=>c.Id===r.Id);l>-1&&t.previousContainer.data.splice(l,1),t.container.data.splice(t.currentIndex,0,r),s&&i&&(i.Cards=[...t.previousContainer.data],s.Cards=[...t.container.data],r.TrackId=Number(s.Id),s.Cards.forEach((c,d)=>c.Order=d+1),this.batchUpdatePositionInTrack(s),this.boardService.moveTicketBetweenTracks(s.Id.toString(),i.Id.toString(),r.Id.toString()).subscribe())}}this.boardService.moveCard(+this.boardId,r.Id,+t.previousContainer.id,+t.container.id,t.currentIndex),this.viewport.checkViewportSize()}}openCloseOpportunityModal(t){this.selectedCard=this.movedCard,this.closureType=t,this.showCloseOpportunityDialog=!0}closeCloseOpportunityDialog(){this.showCloseOpportunityDialog=!1,this.selectedCard=null}onCardClosed({cardId:t,status:r}){this.moveCardToCorrectTrack(t,r),this.showCloseOpportunityDialog=!1,this.selectedCard=null}onCancelDialog(){this.showCloseOpportunityDialog=!1}get connectedDropLists(){return this.Tracks.map(t=>String(t.Id))}moveCardToCorrectTrack(t,r){const i=this.Tracks.find(c=>c.Cards.some(d=>d.Id===t)),s=i?.Cards.find(c=>c.Id===t);if(!s||!i)return;let o="";switch(r){case J.t4.Won:o="Client Win";break;case J.t4.Lost:o="Client Lost";break;case J.t4.Paused:o="Paused"}const l=this.Tracks.find(c=>c.Title===o);l&&this.moveCardBetweenTracks(i,l,s,r)}moveCardBetweenTracks(t,r,i,s){this.boardService.moveTicketBetweenTracks(String(r.Id),String(t.Id),String(i.Id)).subscribe({next:()=>{t.Cards=t.Cards.filter(o=>o.Id!==i.Id),i.Status=s,i.TrackId=Number(r.Id),r.Cards.unshift(i),r.Cards=r.Cards.map((o,l)=>({...o,Order:l+1})),this.batchUpdatePositionInTrack(r)},error:o=>{console.error("Failed to move card between tracks:",o)}})}updatedCard(t,r,i,s=!1){if(null!=t){if(s){const o=i.Cards.findIndex(l=>l.Id===r.Id);if(-1!==o){const l=i.Cards[o].DateCreatedUtc;Object.assign(i.Cards[o],t),i.Cards[o].DateCreatedUtc=l}}else t.Order=1,i.Cards.unshift(t),i.Cards.forEach((o,l)=>o.Order=l+1);i.Cards.sort((o,l)=>new Date(l.DateCreatedUtc).getTime()-new Date(o.DateCreatedUtc).getTime()),this.boardService.updateCard(r).subscribe({next:o=>{const l=i.Cards.findIndex(d=>d.Id===o.Id);i.Cards[l]=o,this.teamsService.createActivityLog("Deal card updated",Xl.zp.CardUpdated,o.Id.toString()).subscribe(),this.messageService.add({severity:"success",summary:"Success",detail:"Card updated successfully"})},error:()=>{this.messageService.add({severity:"error",summary:"Error",detail:"Failed to update the card. Please try again."})}})}}editCard(t){t.destroy()}trackByCardId(t,r){return r.Id}createTicketModal(t){this.createTicket.emit(t)}isRestrictedTrack(t){return["Client Win","Client Lost","Pause"].includes(t)}canEnterTrackDrop=(t,r)=>{const i=t.data,s=this.Tracks.find(c=>c.Id.toString()===r.id);if(this.restrictedTracks.includes(i.Title))return!1;const o=this.Tracks.findIndex(c=>this.restrictedTracks.includes(c.Title));return this.Tracks.findIndex(c=>c.Id===s.Id)<o};toggleAmount(t){t.HideAmount=!t.HideAmount,this.boardService.updateTrack(t.Id,t.Title,t.BoardId,t.Order,t.Color,t.HideAmount).subscribe()}openTemplatedEmails(){this.isTemplateEmailsOpen=!0}sortTracks(t){return[...t].sort((r,i)=>{const s=this.isRestrictedTrack(r.Title),o=this.isRestrictedTrack(i.Title);return s&&o?this.restrictedTracks.indexOf(r.Title)-this.restrictedTracks.indexOf(i.Title):s?1:o?-1:r.Order-i.Order})}static \u0275fac=function(r){return new(r||n)(e.rXU(_t.a),e.rXU(e.c1b),e.rXU(e.gRc),e.rXU(be.td),e.rXU(be.bg),e.rXU(rt.n))};static \u0275cmp=e.VBU({type:n,selectors:[["app-sales-pipeline"]],viewQuery:function(r,i){if(1&r&&e.GBs(ns.d6,5),2&r){let s;e.mGM(s=e.lsd())&&(i.viewport=s.first)}},inputs:{Tracks:"Tracks",boardId:"boardId",board:"board",teamId:"teamId",currentYear:"currentYear"},outputs:{createTicket:"createTicket",cardDragStarted:"cardDragStarted",cardDragEnded:"cardDragEnded"},standalone:!1,features:[e.OA$],decls:15,vars:18,consts:[["cd",""],["viewTitle",""],["trackMenu",""],["cdkDropList","",1,"flex","flex-row","w-full",2,"gap","0.4rem","scroll-snap-type","x mandatory",3,"cdkDropListDropped","cdkDropListData","cdkDropListOrientation","cdkDropListEnterPredicate"],["cdkDrag","","class","flex flex-column","style","width: 280px; min-width: 280px; scroll-snap-align: start;",4,"ngFor","ngForOf","ngForTrackBy"],["header","Select Track Color",3,"visibleChange","visible","modal","dismissableMask"],[1,"flex","flex-wrap","justify-content-center","gap-2"],["class","border-round border-1
1surface-border","style","width: 30px; height: 30px; cursor: pointer;",3,"background","title","click",4,"ngFor","ngForOf"],[3,"Card","ClosureType","showCloseOpportunityDialog","cardClosed","closeModal",4,"ngIf"],["pTemplate","headless"],["position","right","styleClass","email-drawer",3,"visibleChange","visible"],[3,"blocked"],[1,"fixed","top-0","left-0","w-screen","h-screen","flex","justify-content-center","align-items-center",2,"z-index","9999"],["styleClass","w-4rem h-4rem","strokeWidth","4"],["cdkDrag","",1,"flex","flex-column",2,"width","280px","min-width","280px","scroll-snap-align","start"],[1,"track-header","p-2","mb-1","border-round-lg","shadow-sm","flex","justify-content-between","align-items-center","relative",2,"color","white","width","270px",3,"mouseenter","mouseleave","ngClass"],[1,"flex","flex-column","w-full"],[4,"ngIf","ngIfElse"],["class","text-start",4,"ngIf"],[1,"track-right","relative","flex","align-items-center","w-3rem"],[1,"count-badge","font-bold","text-xxs","px-3","py-1","border-round-xl"],["class","action-badge flex gap-1 align-items-center border-round-xl px-3 py-1",4,"ngIf"],["pButton","","type","button","icon","pi pi-plus","class","p-button-rounded p-button-sm create-card-btn",3,"click",4,"ngIf"],["cdkDropList","",1,"py-1","invisible-scrollbar",2,"background","#f4f6f8","border-bottom-left-radius","1rem","border-bottom-right-radius","1rem","height","calc(100vh - 274px)","overflow-y","auto",3,"cdkDropListDropped","itemSize","id","cdkDropListConnectedTo","cdkDropListData","cdkDropListAutoScrollStep"],["class","text-muted text-sm text-center py-2",4,"ngIf"],[4,"ngFor","ngForOf","ngForTrackBy"],["type","text","pInputText","","autofocus","",1,"form-control","form-control-sm","text-uppercase","font-medium","border-0","shadow-none",3,"ngModelChange","blur","keydown.enter","ngModel"],[1,"m-0","text-uppercase","font-bold","pointer","text-xs"],[1,"text-start"],[1,"text-muted","font-bold","text-base"],[1,"action-badge","flex","gap-1","align-items-center","border-round-xl","px-3","py-1"],["appendTo","body",3,"popup","model"],[1,"pi","pi-plus","cursor-pointer",2,"font-size","10px !important",3,"click"],[1,"pi","pi-ellipsis-v","cursor-pointer",2,"font-size","10px !important",3,"click"],["pButton","","type","button","icon","pi pi-plus",1,"p-button-rounded","p-button-sm","create-card-btn",3,"click"],[1,"text-muted","text-sm","text-center","py-2"],["cdkDrag","",3,"cdkDragStarted","cdkDragEnded","edit","cdkDragData","card","trackTitle","id","boardId","boardTeamMembers","teamId"],[1,"border-round","border-1","surface-border",2,"width","30px","height","30px","cursor","pointer",3,"click","title"],[3,"cardClosed","closeModal","Card","ClosureType","showCloseOpportunityDialog"],[1,"flex","flex-column","align-items-center","p-5","surface-overlay","border-round"],[1,"border-circle","bg-primary","inline-flex","justify-content-center","align-items-center","h-6rem","w-6rem"],[1,"pi","pi-question","text-5xl"],[1,"font-bold","text-2xl","block","mb-2","mt-4"],[1,"mb-0"],[1,"flex","align-items-center","gap-2","mt-4"],["pButton","",1,"w-8rem",3,"click","label"],["pButton","","label","Cancel",1,"p-button-outlined","w-8rem",3,"click"]],template:function(r,i){if(1&r){const s=e.RV6();e.j41(0,"div",3),e.bIt("cdkDropListDropped",function(l){return e.eBV(s),e.Njj(i.onTrackDrop(l))}),e.DNE(1,yv,15,19,"div",4),e.k0s(),e.j41(2,"p-dialog",5),e.mxI("visibleChange",function(l){return e.eBV(s),e.DH7(i.showColorPicker,l)||(i.showColorPicker=l),e.Njj(l)}),e.j41(3,"div",6),e.DNE(4,Fv,1,3,"div",7),e.k0s()(),e.DNE(5,Sv,1,3,"app-close-opportunity",8),e.nrm(6,"p-toast"),e.j41(7,"p-confirmDialog",null,0),e.DNE(9,Ev,10,3,"ng-template",9),e.k0s(),e.j41(10,"p-drawer",10),e.mxI("visibleChange",function(l){return e.eBV(s),e.DH7(i.isTemplateEmailsOpen,l)||(i.isTemplateEmailsOpen=l),e.Njj(l)}),e.nrm(11,"app-email-card"),e.k0s(),e.j41(12,"p-blockUI",11)(13,"div",12),e.nrm(14,"p-progressSpinner",13),e.k0s()()}2&r&&(e.Y8G("cdkDropListData",i.Tracks)("cdkDropListOrientation","horizontal")("cdkDropListEnterPredicate",i.canEnterTrackDrop),e.R7$(),e.Y8G("ngForOf",i.Tracks)("ngForTrackBy",i.trackById),e.R7$(),e.Aen(e.lJ4(16,hv)),e.R50("visible",i.showColorPicker),e.Y8G("modal",!0)("dismissableMask",!0),e.R7$(2),e.Y8G("ngForOf",i.colors),e.R7$(),e.Y8G("ngIf",i.selectedCard),e.R7$(5),e.Aen(e.lJ4(17,gv)),e.R50("visible",i.isTemplateEmailsOpen),e.R7$(2),e.Y8G("blocked",i.isCardLoading))},dependencies:[q.YU,q.Sq,q.bT,be.Ei,Ur.O7,Ur.T1,Ie.y8,Yl.TM,Wl.W1,Qe.Sm,L.me,L.BC,L.vS,jt.lG,xe._f,Ve._s,Ai.pT,Hl.KC,ns.yg,ns.d6,Jg,mv,pc,q.oe],styles:[".plus-icon-btn[_ngcontent-%COMP%]{opacity:0;transition:opacity .2s ease-in-out;position:absolute;top:0;right:0}.group[_ngcontent-%COMP%]:hover .plus-icon-btn[_ngcontent-%COMP%]{opacity:1}.colors-cont[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(6,1fr);gap:.5rem}.color-modal[_ngcontent-%COMP%]{width:240px;max-width:90vw;box-shadow:0 2px 8px #00000026;border-radius:.5rem}.cdk-drag-preview[_ngcontent-%COMP%]{box-shadow:0 5px 15px #0003;border-radius:4px;background:#fff}.new-scrollbar[_ngcontent-%COMP%]{scrollbar-color:red orange;scrollbar-width:thin}.cdk-drag-animating[_ngcontent-%COMP%], .cdk-drop-list-dragging[_ngcontent-%COMP%] .cdk-drag[_ngcontent-%COMP%]{transition:transform .25s cubic-bezier(0,0,.2,1)}.invisible-scrollbar[_ngcontent-%COMP%]{scrollbar-width:thin;scrollbar-color:transparent transparent}.invisible-scrollbar[_ngcontent-%COMP%]::-webkit-scrollbar{width:4px}.invisible-scrollbar[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.invisible-scrollbar[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:transparent;border-radius:10px}.invisible-scrollbar[_ngcontent-%COMP%]:hover{scrollbar-color:#c1c1c1 transparent}.invisible-scrollbar[_ngcontent-%COMP%]:hover::-webkit-scrollbar-thumb{background:#c1c1c1}[_ngcontent-%COMP%]::-webkit-scrollbar-button:end{display:block}[_ngcontent-%COMP%]::-webkit-scrollbar-button:start{display:block}.track-header[_ngcontent-%COMP%]{position:relative}.create-card-btn[_ngcontent-%COMP%]{position:absolute;bottom:-10px;left:50%;transform:translate(-50%);opacity:0;background-color:#495057e6!important;color:#fff!important;border:none;transition:opacity .25s ease-in-out,bottom .25s ease-in-out;z-index:10;pointer-events:none}.track-header[_ngcontent-%COMP%]:hover .create-card-btn[_ngcontent-%COMP%]{opacity:1;bottom:5px;pointer-events:auto}.track-right[_ngcontent-%COMP%]{position:relative;width:fit-content}.count-badge[_ngcontent-%COMP%]{background:#00000026;border-radius:.5rem;padding:.25rem .5rem;display:flex;align-items:center;justify-content:center;transition:opacity .25s ease;z-index:10}.action-badge[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;align-items:center;padding:.25rem .5rem;justify-content:center;gap:.5rem;background:#00000040;border-radius:.5rem;opacity:0;pointer-events:none;transition:opacity .25s ease;z-index:20}.action-badge[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fff;font-size:.8rem;cursor:pointer}.track-header[_ngcontent-%COMP%]:not(.restricted):hover .track-right[_ngcontent-%COMP%] .count-badge[_ngcontent-%COMP%]{opacity:0}
1.track-header[_ngcontent-%COMP%]:not(.restricted):hover .track-right[_ngcontent-%COMP%] .action-badge[_ngcontent-%COMP%]{opacity:1;pointer-events:auto} .p-toast.on-top-toast{z-index:9999!important}cdk-virtual-scroll-viewport[_ngcontent-%COMP%]{width:100%;outline:none}"]})}return n})();var Iv=ee(5596);const ds=()=>[0,1,2,3,4],Dv=()=>[1,2,3,4],Rv=()=>[1,2,3,4,5],jv=()=>[0,1],fc=()=>[1,2];function Av(n,a){1&n&&(e.j41(0,"div",24),e.nrm(1,"p-skeleton",3),e.k0s()),2&n&&(e.R7$(),e.Y8G("width","100%")("height","2.5rem"))}function Mv(n,a){1&n&&(e.j41(0,"div",25),e.nrm(1,"p-skeleton",26),e.k0s())}function Pv(n,a){1&n&&e.nrm(0,"p-skeleton",36)}function Ov(n,a){1&n&&(e.j41(0,"div",29),e.nrm(1,"p-skeleton",30)(2,"p-skeleton",31),e.j41(3,"div",32),e.DNE(4,Pv,1,0,"p-skeleton",33),e.k0s(),e.j41(5,"div",34),e.nrm(6,"p-skeleton",35),e.k0s()()),2&n&&(e.R7$(4),e.Y8G("ngForOf",e.lJ4(1,fc)))}function Nv(n,a){1&n&&(e.j41(0,"div",27),e.DNE(1,Ov,7,2,"div",28),e.k0s()),2&n&&(e.R7$(),e.Y8G("ngForOf",e.lJ4(1,jv)))}function Gv(n,a){1&n&&(e.j41(0,"div",25),e.nrm(1,"p-skeleton",26),e.k0s())}function Bv(n,a){1&n&&e.nrm(0,"p-skeleton",37)}function Lv(n,a){1&n&&e.nrm(0,"p-skeleton",44)}function $v(n,a){1&n&&(e.j41(0,"div",13)(1,"div",38),e.nrm(2,"p-skeleton",39),e.j41(3,"div",17),e.nrm(4,"p-skeleton",40)(5,"p-skeleton",19),e.k0s(),e.j41(6,"div",17)(7,"div",41),e.DNE(8,Lv,1,0,"p-skeleton",42),e.k0s(),e.nrm(9,"p-skeleton",43),e.k0s()()()),2&n&&(e.R7$(8),e.Y8G("ngForOf",e.lJ4(1,fc)))}let Vv=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-sales-tracker-skeleton"]],standalone:!1,decls:32,vars:16,consts:[[1,"hidden","md:block","mt-2"],[1,"grid","mx-2"],[1,"mr-2","border-round-2xl",2,"width","69%","height","3rem"],["styleClass","border-round-2xl border-1 surface-border mt-3",3,"width","height"],[1,"mr-2","border-round-2xl",2,"width","28%","height","3rem"],[1,"grid","mx-2","mt-1"],["class","mr-2 border-round-2xl","style","width: 19%; height: 3rem;",4,"ngFor","ngForOf"],[1,"grid","mt-4","mx-2"],["class","col surface-0 border-1 surface-border","style","height: 2.5rem;",4,"ngFor","ngForOf"],["class","col surface-0 border-1 surface-border","style","height: 25rem;",4,"ngFor","ngForOf"],[1,"md:hidden"],[1,"mt-1","h-screen"],[1,"grid","mx-1","surface-0","border-round-lg"],[1,"col"],[1,"flex","justify-content-start"],["width","5rem","height","2rem","styleClass","mr-2","borderRadius","16px",4,"ngFor","ngForOf"],[1,"grid","mx-1","mt-1","surface-0","border-round-lg"],[1,"flex","justify-content-between"],["width","6rem","height","2rem","styleClass","mr-2","borderRadius","16px"],["shape","circle","size","2rem","styleClass","mr-2"],[1,"grid","mx-1","mt-1","border-round-lg"],["size","2rem","styleClass","mr-2"],[1,"grid","mx-1","mt-1"],["class","col",4,"ngFor","ngForOf"],[1,"mr-2","border-round-2xl",2,"width","19%","height","3rem"],[1,"col","surface-0","border-1","surface-border",2,"height","2.5rem"],["width","10rem","styleClass","mb-2"],[1,"col","surface-0","border-1","surface-border",2,"height","25rem"],["class","border-round-lg border-1 surface-border mt-3",4,"ngFor","ngForOf"],[1,"border-round-lg","border-1","surface-border","mt-3"],["width","5rem","height","1rem","styleClass","mb-1 mt-1 ml-2"],["width","6rem","height","1rem","styleClass","mb-1 mt-1 ml-2"],[1,"flex","mb-1"],["shape","circle","size","1.2rem","styleClass","mr-2 ml-2",4,"ngFor","ngForOf"],[1,"flex","justify-content-end","mr-2","mb-2"],["width","3rem","height","1rem"],["shape","circle","size","1.2rem","styleClass","mr-2 ml-2"],["width","5rem","height","2rem","styleClass","mr-2","borderRadius","16px"],[1,"card","border-2","surface-border","border-round-2xl",2,"height","5.5rem"],["width","3rem","height","0.5rem","styleClass","ml-2 mt-2"],["width","7rem","height","1rem","styleClass","ml-2 mt-2"],[1,"flex"],["width","3rem","height","1rem","borderRadius","16px","styleClass","ml-2 mt-2",4,"ngFor","ngForOf"],["width","4rem","height","1rem","styleClass","mr-2 mt-2"],["width","3rem","height","1rem","borderRadius","16px","styleClass","ml-2 mt-2"]],template:function(r,i){1&r&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2),e.nrm(3,"p-skeleton",3),e.k0s(),e.j41(4,"div",4),e.nrm(5,"p-skeleton",3),e.k0s()(),e.j41(6,"div",5),e.DNE(7,Av,2,2,"div",6),e.k0s(),e.j41(8,"div",7),e.DNE(9,Mv,2,0,"div",8),e.k0s(),e.j41(10,"div",1),e.DNE(11,Nv,2,2,"div",9),e.k0s(),e.j41(12,"div",1),e.DNE(13,Gv,2,0,"div",8),e.k0s()(),e.j41(14,"div",10)(15,"div",11)(16,"div",12)(17,"div",13)(18,"div",14),e.DNE(19,Bv,1,0,"p-skeleton",15),e.k0s()()(),e.j41(20,"div",16)(21,"div",13)(22,"div",17),e.nrm(23,"p-skeleton",18)(24,"p-skeleton",19),e.k0s()()(),e.j41(25,"div",20)(26,"div",13)(27,"div",17),e.nrm(28,"p-skeleton",18)(29,"p-skeleton",21),e.k0s()()(),e.j41(30,"div",22),e.DNE(31,$v,10,2,"div",23),e.k0s()()()),2&r&&(e.R7$(3),e.Y8G("width","100%")("height","2.5rem"),e.R7$(2),e.Y8G("width","100%")("height","2.5rem"),e.R7$(2),e.Y8G("ngForOf",e.lJ4(10,ds)),e.R7$(2),e.Y8G("ngForOf",e.lJ4(11,ds)),e.R7$(2),e.Y8G("ngForOf",e.lJ4(12,ds)),e.R7$(2),e.Y8G("ngForOf",e.lJ4(13,ds)),e.R7$(6),e.Y8G("ngForOf",e.lJ4(14,Dv)),e.R7$(12),e.Y8G("ngForOf",e.lJ4(15,Rv)))},dependencies:[q.Sq,dn.EA],encapsulation:2})}return n})();const Uv=["scrollableDiv"],Xv=["collageContainer"],Yv=()=>["Title","AssignedUsers"],Wv=()=>[];function Hv(n,a){1&n&&e.nrm(0,"app-lockfeatures")}function zv(n,a){1&n&&e.nrm(0,"app-sales-tracker-skeleton")}function qv(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",11),e.bIt("click",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.scrollLeft())}),e.nrm(1,"i",12),e.k0s()}}function Jv(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",13),e.bIt("click",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.scrollRight())}),e.nrm(1,"i",14),e.k0s()}}function Kv(n,a){if(1&n){const t=e.RV6();e.j41(0,"div")(1,"div",3)(2,"div",4)(3,"app-drawer",5),e.nI1(4,"async"),e.bIt("openM
1odalClicked",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.createTicketModal(i))})("searchResult",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.beTracks=i)})("yearChanged",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.onYearFilterChanged(i))}),e.k0s(),e.j41(5,"div",6),e.DNE(6,qv,2,0,"button",7)(7,Jv,2,0,"button",8),e.j41(8,"div",9,0),e.bIt("scroll",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.checkScrollableContent())})("pointerdown",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.onPointerDown())})("pointerup",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.onPointerUp())})("pointermove",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.onPointerMoveDuringDrag(i))})("mousemove",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.onMouseMove(i))}),e.j41(10,"app-sales-pipeline",10),e.bIt("cardDragStarted",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.onDragStart())})("cardDragEnded",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.onDragEnd())})("createTicket",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.createTicketModal(i))}),e.k0s()()()()()()}if(2&n){const t=e.XpG(2);e.R7$(3),e.Y8G("openSlider",t.openSlider)("boardName",t.board.Name||"")("board",t.board)("typeId",t.board.TypeId)("teamId",t.teamId)("searchList",t.beTracks)("searchField",e.lJ4(17,Yv))("updatedTracks",e.bMT(4,15,t.tracksUpdated)||e.lJ4(18,Wv))("placeholderText","Search for title, amount, etc..."),e.R7$(3),e.Y8G("ngIf",t.showLeftButton),e.R7$(),e.Y8G("ngIf",t.showRightButton),e.R7$(3),e.Y8G("Tracks",t.beTracks)("boardId",t.board.Id)("board",t.board)("currentYear",t.currentYearFilter)}}function Qv(n,a){if(1&n&&(e.j41(0,"div"),e.DNE(1,zv,1,0,"app-sales-tracker-skeleton",2)(2,Kv,11,19,"div",2),e.k0s()),2&n){const t=e.XpG();e.R7$(),e.Y8G("ngIf",!t.board||!(null!=t.beTracks&&t.beTracks.length)),e.R7$(),e.Y8G("ngIf",t.board&&(null==t.beTracks?null:t.beTracks.length))}}let Zv=(()=>{class n{cdref;_boardService;formBuilder;store;cdRef;locationService;viewContainerRef;teamsService;messageService;auth;router;route;scrollableDiv;collageContainer;childComponentRef;tracksUpdated=new e.bkB;searchList=[];LOAD_STATE=J.nC;loadState=J.nC.NOT_LOADING;board$;tracks$;board=null;beBoard=null;beTracks=[];newListName;boardId;teamId=0;boardUsers$;destroyed=new Ol.B;currentYearFilter;movedCard=null;selectedTrack;showLeftButton=!1;showRightButton=!1;scrollIndex=0;boardInputSearch="";chosenTrackId;trackId="0";updateTrackId;searchQuery="";originalSearchList;selectedYear="All";contentId=null;openSlider=!1;isDragging=!1;isPointerDown=!1;scrollSpeed=4;isDraggingCard=!1;scrollDirection=0;animationFrameId=null;upgradeRequired=!1;tenderLeadSub;incomingBoardId=0;incomingCardId=0;incomingTeamId=0;tracksLoaded=!1;incomingTrackId=0;constructor(t,r,i,s,o,l,c,d,p,u,f,h){this.cdref=t,this._boardService=r,this.formBuilder=i,this.store=s,this.cdRef=o,this.locationService=l,this.viewContainerRef=c,this.teamsService=d,this.messageService=p,this.auth=u,this.router=f,this.route=h,this.boardUsers$=this.store.select("board"),this.newListName="",this.originalSearchList=this.searchList,this.contentId=localStorage.getItem("contentId"),setTimeout(()=>{localStorage.removeItem("contentId")},15e3)}ngOnInit(){this._boardService.tracks$.subscribe(r=>{r.forEach(i=>{const s=this.beTracks.find(o=>o.Id===i.Id);s?s.Cards=i.Cards?[...i.Cards].sort((o,l)=>new Date(l.DateCreatedUtc).getTime()-new Date(o.DateCreatedUtc).getTime()):[]:this.beTracks.push({...i,Cards:i.Cards?[...i.Cards].sort((o,l)=>new Date(l.DateCreatedUtc).getTime()-new Date(o.DateCreatedUtc).getTime()):[]})}),this.tracksLoaded=!0,this.cdRef.detectChanges(),this.openIncomingCard()});const t=this.teamsService.getCurrentTeam;t?.Team?.Id&&this._boardService.loadBoardThenTracks(t.Team.Id).subscribe({next:([r,i])=>{this.upgradeRequired=!1,this.beTracks=i.map(s=>({...s,Cards:s.Cards?[...s.Cards].sort((o,l)=>new Date(l.DateCreatedUtc).getTime()-new Date(o.DateCreatedUtc).getTime()):[]})),this.board=r,this.teamId=t.Team.Id,this._boardService.setTracks(this.beTracks),this._boardService.setBoard(this.board),this._boardService.connect(Number(this.board.Id),(s,o,l,c,d)=>this.handleCardMove(s,o,l,c,d),s=>this.handleCardAddOrUpdate(s),s=>this.handleTrackAddOrUpdate(s))},error:r=>{402===r.status?this.upgradeRequired=!0:this.messageService.add({severity:"error",summary:"Error",detail:`${r.error}`})}}),this.boardUsers$.subscribe(r=>{this.beBoard=r})}ngOnDestroy(){this.tenderLeadSub?.unsubscribe(),this._boardService.disConnect(+this.boardId)}
1openIncomingCard(){if(this.incomingTrackId=Number(this.route.snapshot.queryParams.trackId),this.incomingCardId=Number(this.route.snapshot.queryParams.cardId),!this.incomingCardId||!this.incomingTrackId||!this.tracksLoaded)return;const t=this.beTracks.find(i=>i.Id.toString()===this.incomingTrackId.toString());if(!t)return;const r=t.Cards?.find(i=>i.Id===this.incomingCardId);r&&this.childComponentRef.addEditTalk(r,t,!0)}trackIds(){return this.beTracks.map(t=>t.Id)}arrayMove(t,r,i){const s=t[r];t.splice(r,1),t.splice(i,0,s)}batchUpdatePositionInTrack(t){const r=t.Cards.slice();this._boardService.changeTicketPositionInTrack(r,()=>{})}updateTracks(){this.beTracks.forEach(t=>{this._boardService.getTrack(t.Id).subscribe({next:r=>{t.Total=r.Total}})})}onTrackDrop(t){(0,Ur.HD)(t.container.data,t.previousIndex,t.currentIndex),this._boardService.changeTrackPosition(t.container.data)}createTicketModal(t){this._boardService.selectedTrackId$.subscribe(i=>{this.chosenTrackId=i});const r=this.viewContainerRef.createComponent(km);r.instance.loading=!1,r.instance.createDeal.subscribe(i=>{!i||!i.title||i.title.length<2?this.messageService.add({severity:"warn",summary:"Invalid Ticket",detail:"Ticket title must be at least 2 characters long.",life:3e3}):(this.trackId=this.chosenTrackId||t.Id,r.instance.loading=!0,this._boardService.createCard(i,this.trackId,t.Cards?.length).subscribe({next:s=>{this.beTracks.forEach(d=>{Number(d.Id)===s.TrackId&&(Array.isArray(d.Cards)||(d.Cards=[]),d.Cards.some(p=>p.Id===s.Id)||d.Cards.unshift(s),this.updateTracks(),this.batchUpdatePositionInTrack(d),this.cdRef.detectChanges())});const l=this._boardService.sendTempTagStorage().map(d=>(d.cardId=s.Id,this._boardService.addCardTag(s.Id,d.value).toPromise()));Promise.all(l).then(d=>{d.forEach(p=>{const u=new J.ze;p?.CardTags?.forEach(f=>{u.Id=f.Id,u.Name=f.Name,s.CardTags?.unshift(u)})})}),this.messageService.add({severity:"success",summary:"Ticket Created",detail:`Ticket "${s.Title}" has been successfully created.`,life:3e3}),r.instance.loading=!1,this.teamsService.createActivityLog("Created new deal card",Xl.zp.CardCreated,s.Id.toString()).subscribe(),r.destroy()},error:s=>{this.messageService.add({severity:"error",summary:"Error",detail:"Failed to create the ticket. Please try again.",life:3e3}),r.instance.loading=!1}}))})}ngOnChanges(t){this.cdRef.detectChanges()}onSearchResult(t){this.beTracks=t}ngAfterContentChecked(){this.cdref.detectChanges()}checkScrollableContent(){const t=this.collageContainer.nativeElement;this.showLeftButton=t.scrollLeft>0,this.showRightButton=t.scrollWidth>t.clientWidth+t.scrollLeft}scrollLeft(){const t=this.collageContainer.nativeElement;t.scrollTo({left:t.scrollLeft-200,behavior:"smooth"}),this.checkScrollableContent()}scrollRight(){const t=this.collageContainer.nativeElement;t.scrollTo({left:t.scrollLeft+200,behavior:"smooth"}),this.checkScrollableContent()}onPointerDown(){this.isPointerDown=!0}onPointerUp(){this.isPointerDown=!1}onDragStart(){this.isDraggingCard=!0}onDragEnd(){this.isDraggingCard=!1}onPointerMoveDuringDrag(t){if(!this.isDraggingCard)return void(this.scrollDirection=0);const r=this.collageContainer.nativeElement,i=r.getBoundingClientRect(),o=t.clientX;o<i.left+120?(this.scrollDirection=-1,r.scrollTo({left:r.scrollLeft-35,behavior:"smooth"})):o>i.right-120?(this.scrollDirection=1,r.scrollTo({left:r.scrollLeft+35,behavior:"smooth"})):this.scrollDirection=0,this.animationFrameId||this.startAutoScroll()}onMouseMove(t){if(!this.isDraggingCard)return void(this.scrollDirection=0);const i=this.collageContainer.nativeElement.getBoundingClientRect();this.scrollDirection=t.clientX<i.left+35?-1:t.clientX>i.right-35?1:0,this.animationFrameId||this.startAutoScroll()}startAutoScroll(){const t=this.collageContainer.nativeElement,r=()=>{0!==this.scrollDirection&&this.isDraggingCard?(t.scrollLeft+=this.scrollDirection*this.scrollSpeed,this.animationFrameId=requestAnimationFrame(r)):this.animationFrameId=null};this.animationFrameId=requestAnimationFrame(r)}closeEditCard(t){t.destroy()}editCard(t){t.destroy()}onYearFilterChanged(t){this.currentYearFilter=t}goToSubscription(){this.router.navigate([`/dashboard/subscription-plans/${this.teamsService.getCurrentTeam.Team.Id}`])}handleCardMove(t,r,i,s,o){let l=this.beTracks.find(p=>p.Id===i);if(!l)return;let c=l.Cards.find(p=>p.Id===r);if(!c)return;l.Cards=l.Cards.filter(p=>p.Id!==r);let d=this.beTracks.find(p=>p.Id===s);d&&(d.Cards=[...d.Cards.slice(0,o),c,...d.Cards.slice(o)])}handleCardAddOrUpdate(t){let r=this.beTracks.find(i=>+i.Id===t.TrackId);r&&(r.Cards=r.Cards.filter(i=>i.Id!==t.Id),t.Archived?this.messageService.add({severity:"success",summary:"Card Archived",detail
1:"The card was archived successfully."}):(r.Cards.push(t),r.Cards.sort((i,s)=>new Date(s.DateCreatedUtc).getTime()-new Date(i.DateCreatedUtc).getTime())))}handleTrackAddOrUpdate(t){this.beTracks=this.beTracks.filter(r=>r.Id!==t.Id),t.Archived||(this.beTracks=[...this.beTracks.slice(0,t.Order),t,...this.beTracks.slice(t.Order)])}static \u0275fac=function(r){return new(r||n)(e.rXU(e.gRc),e.rXU(_t.a),e.rXU(L.ok),e.rXU(Hs.il),e.rXU(e.gRc),e.rXU(Ri.aZ),e.rXU(e.c1b),e.rXU(rt.n),e.rXU(be.bg),e.rXU(jn.u),e.rXU(rn.Ix),e.rXU(rn.nX))};static \u0275cmp=e.VBU({type:n,selectors:[["app-sales-tracker"]],viewQuery:function(r,i){if(1&r&&(e.GBs(Uv,7),e.GBs(Xv,5),e.GBs(uc,5)),2&r){let s;e.mGM(s=e.lsd())&&(i.scrollableDiv=s.first),e.mGM(s=e.lsd())&&(i.collageContainer=s.first),e.mGM(s=e.lsd())&&(i.childComponentRef=s.first)}},inputs:{searchList:"searchList"},outputs:{tracksUpdated:"tracksUpdated"},standalone:!1,features:[e.OA$],decls:4,vars:2,consts:[["collageContainer",""],[1,"container-fluid"],[4,"ngIf"],[1,"px-0"],["cdkDropListGroup","",1,"flex","flex-column","h-full"],[3,"openModalClicked","searchResult","yearChanged","openSlider","boardName","board","typeId","teamId","searchList","searchField","updatedTracks","placeholderText"],[1,"relative"],["class","scroll-btn left-btn",3,"click",4,"ngIf"],["class","scroll-btn right-btn",3,"click",4,"ngIf"],[1,"flex","flex-1","overflow-x-auto","invisible-scrollbar-x",3,"scroll","pointerdown","pointerup","pointermove","mousemove"],[3,"cardDragStarted","cardDragEnded","createTicket","Tracks","boardId","board","currentYear"],[1,"scroll-btn","left-btn",3,"click"],[1,"pi","pi-chevron-left"],[1,"scroll-btn","right-btn",3,"click"],[1,"pi","pi-chevron-right"]],template:function(r,i){1&r&&(e.j41(0,"div",1),e.DNE(1,Hv,1,0,"app-lockfeatures")(2,Qv,3,2,"div",2),e.k0s(),e.nrm(3,"p-toast")),2&r&&(e.R7$(),e.vxM(i.upgradeRequired?1:-1),e.R7$(),e.Y8G("ngIf",!i.upgradeRequired))},dependencies:[q.bT,Ce.K,Ur.RK,Ie.y8,Iv.D,uc,Vv,q.Jj],styles:[".invisible-scrollbar-x[_ngcontent-%COMP%]{scrollbar-width:thin;scrollbar-color:transparent transparent}.invisible-scrollbar-x[_ngcontent-%COMP%]::-webkit-scrollbar{height:6px}.invisible-scrollbar-x[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.invisible-scrollbar-x[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:transparent;border-radius:10px}.invisible-scrollbar-x[_ngcontent-%COMP%]:hover{scrollbar-color:#c1c1c1 transparent}.invisible-scrollbar-x[_ngcontent-%COMP%]:hover::-webkit-scrollbar-thumb{background:#c1c1c1}.scroll-btn[_ngcontent-%COMP%]{position:absolute;top:50%;transform:translateY(-50%);z-index:20;background:#fff;border-radius:50%;border:1px solid #d0d0d0;width:34px;height:34px;display:flex;justify-content:center;align-items:center;cursor:pointer;box-shadow:0 2px 5px #00000026}.left-btn[_ngcontent-%COMP%]{left:5px}.right-btn[_ngcontent-%COMP%]{right:5px}"]})}return n})();var eb=ee(96697),mc=ee(25558),tb=ee(88141);const nb=["teamTargetChart"],rb=(n,a)=>[n,a],ib=()=>[1,2,3,4,5,6,7,8,9,10,11];function ab(n,a){1&n&&e.nrm(0,"app-lockfeatures")}function sb(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",13)(1,"div",14)(2,"div")(3,"label",15),e.EFF(4,"Start Date"),e.k0s(),e.j41(5,"p-datepicker",16,1),e.mxI("ngModelChange",function(i){e.eBV(t);const s=e.XpG(3);return e.DH7(s.customStartDate,i)||(s.customStartDate=i),e.Njj(i)}),e.bIt("onSelect",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.onDateSelect())}),e.k0s()(),e.j41(7,"div")(8,"label",15),e.EFF(9,"End Date"),e.k0s(),e.j41(10,"p-datepicker",16,2),e.mxI("ngModelChange",function(i){e.eBV(t);const s=e.XpG(3);return e.DH7(s.customEndDate,i)||(s.customEndDate=i),e.Njj(i)}),e.bIt("onSelect",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.onDateSelect())}),e.k0s()()(),e.j41(12,"div",17)(13,"button",18),e.bIt("click",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.applyCustomDateLeaderboard())}),e.k0s(),e.j41(14,"button",19),e.bIt("click",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.showCustomCalendarLeaderboard=!1)}),e.k0s()()()}if(2&n){const t=e.XpG(3);e.R7$(5),e.R50("ngModel",t.customStartDate),e.R7$(5),e.R50("ngModel",t.customEndDate),e.R7$(3),e.Y8G("disabled",!t.customStartDate||!t.customEndDate)}}function ob(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",10)(1,"p-select",11,0),e.mxI("ngModelChange",function(i){e.eBV(t);const s=e.XpG(2);return e.DH7(s.selectedDateRangeLabel,i)||(s.selectedDateRangeLabel=i),e.Njj(i)}),e.bIt("onChange",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.onDateRangeSelect(i.value))}),e.k0s(),e.DNE(3,sb,15,3,"div",12),e.k0s()}if(2&n){const t=e.XpG(2);e.R7$(),e.Y8G("options",t.salesDateRanges),e.R50("ngModel",t.selectedDateRangeLabel),e.R7$(2),e.Y8G("ngIf",t.showCustomCalendarLeaderboard)}}function lb(n,a){1&n&&e.nrm(0,"p-avatar",61)}function cb(n,a){if(1&n&&e.nrm(0,"p-avatar",62),2&n){const t=e.XpG(4);e.Y8G("image",t.IMG_ROUTE+t.topAchiever.ProfilePictureId)}}function db(n,a){if(1&n&&(e.j41(0,"p-card",54)(1,"div",25)(2,"div")(3,"div",26),e.EFF(4," Top Achiever \u{1f3c6}"),e.k0s(),e.j41(5,"div",55),e.DNE(6,lb,1,0,"p-avatar",56)(7,cb,1,1,"p-avatar",57),e.j41(8,"span",58),e.EFF(9),e.k0s()()(),e.j41(10,"div",59)(11,"span",60),e.EFF(12),e.k0s(),e.j41(13,"span"),e.EFF(14,"Wins"),e.k0s()()()()),2&n){const t=e.XpG(3);e.R7$(6),e.Y8G("ngIf",!t.topAchiever.ProfilePictureId),e.R7$(),e.Y8G("ngIf",t.topAchiever.ProfilePictureId),e.R7$(2),e.SpI(" ",t.topAchiever.UserName," "),e.R7$(3),e.SpI(" ",t.topAchiever.WonOpportunities," ")}}function pb(n,a){if(1&n&&(e.j41(0,"span",63),e.EFF(1),e.nI1(2,"currency"),e.nI1(3,"shortNumber"),e.k0s()),2&n){const t=e.XpG(3);e.HbH(t.remainingTarget>0?"bg-orange-50 text-orange-700":"bg-green-50 text-green-700"),e.R7$(),e.SpI(" ",e.bMT(3,8,e.ii3(2,3,t.remainingTarget,t.currencyCode,"symbol-narrow","1.0-0"))," ")}}function ub(n,a){1&n&&(e.j41(0,"span",64),e.EFF(1,"\u2014"),e.k0s())}function fb(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",20)(1,"div",21)(2,"div",22)(3,"div",23)(4,"p-card",24)(5,"div",25)(6,"div")(7,"div",26),e.EFF(8,"Total Value"),e.k0s(),e.j41(9,"div",27),e.EFF(10),e.nI1(11,"currency"),e.nI1(12,"shortNumber"),e.k0s()(),e.j41(13,"div",28),e.nrm(14,"i",29),e.k0s()()()(),e.j41(15,"div",23)(16,"p-card",24)(17,"div",25)(18,"div")(19,"div",26),e.EFF(20,"Opportunities"),e.k0s(),e.j41(21,"div",27),e.EFF(22),e.nI1(23,"shortNumber"),e.k0s()(),e.j41(24,"div",28),e.nrm(25,"i",30),e.k0s()()()(),e.j41(26,"div",23)(27,"p-card",24)(28,"div",25)(29,"div")(30,"div",26),e.EFF(31,"Total Wins"),e.k0s(),e.j41(32,"div",31),e.EFF(33),e.nI1(34,"shortNumber"),e.k0s()(),e.j41(35,"div",28),e.nrm(36,"i",32),e.k0s()()()(),e.j41(37,"div",23)(38,"p-card",24)(39,"div",25)(40,"div")(41,"div",26),e.EFF(42,"Avg. Close Time"),e.k0s(),e.j41(43,"div",31),e.EFF(44),e.nI1(45,"shortNumber"),e.k0s()(),e.j41(46,"div",28),e.nrm(47,"i",33),e.k0s()()()()(),e.j41(48,"p-card",34)(49,"app-sales-performance-table",35),e.bIt("saveTarget",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.saveSalesTarget(i))})("saveTargetsBatch",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.saveSalesTargetsBatch(i))}),e.k0s()()(),e.j41(50,"div",36),e.DNE(51,db,15,4,"p-card",37),e.j41(52,"p-card",38)(53,"div",39)(54,"span",40),e.EFF(55,"Team Target"),e.k0s()(),e.j41(56,"div",41)(57,"div",42),e.nrm(58,"p-chart",43,3),e.k0s(),e.j41(60,"div",44)(61,"div",45),e.EFF(62),e.nI1(63,"currency"),e.nI1(64,"shortNumber"),e.k0s(),e.j41(65,"div",46),e.EFF(66),e.nI1(67,"currency"),e.nI1(68,"shortNumber"),e.k0s()()(),e.j41(69,"div",47)(70,"span",48),e.EFF(71,"Remaining Target"),e.k0s(),e.DNE(72,pb,4,10,"span",49)(73,ub,2,0,"ng-template",null,4,e.C5r),e.k0s()(),e.j41(75,"p-card",38)(76,"div",50)(77,"span",40),e.EFF(78,"Conversion Rate"),e.k0s()(),e.j41(79,"div",51),e.EFF(80),e.k0s(),e.j41(81,"div",52)(82,"span",53),e.EFF(83),e.k0s()()()()()}if(2&n){const t=e.sdS(74),r=e.XpG(2);e.R7$(10),e.JRh(e.bMT(12,26,e.ii3(11,21,r.totalValue,r.currencyCode,"symbol-narrow","1.0-2"))),e.R7$(12),e.JRh(e.bMT(23,28,r.totalOpps)),e.R7$(11),e.JRh(e.bMT(34,30,r.totalWins)),e.R7$(11),e.SpI("",e.bMT(45,32,r.averageDays)," days"),e.R7$(5),e.Y8G("data",r.leaderboard)("currencyCode",r.currencyCode)("currentUserId",r.currentUserId)("boardId",r.boardIdAsNumber)("canManageSalesTargets",r.canManageSalesTargets)("isSavingTarget",r.isSavingTarget),e.R7$(2),e.Y8G("ngIf",r.topAchiever),e.R7$(7),e.Y8G("data",r.teamTargetData)("options",r.teamTargetOptions)("plugins",e.l_i(48,rb,r.centerTextPlugin,r.doughnutShadowPlugin)),e.R7$(4),e.SpI(" ",e.bMT(64,39,e.ii3(63,34,r.totalValue,r.currencyCode,"symbol-narrow","1.0-2"))," "),e.R7$(4),e.SpI(" of ",e.bMT(68,46,e.ii3(67,41,r.totalTarget,r.currencyCode,"symbol-narrow","1.0-2"))," target "),e.R7$(6),e.Y8G("ngIf",null!==r.remainingTarget)("ngIfElse",t),e.R7$(8),e.SpI("",r.averageRate,"%"),e.R7$(3),e.Lme(" ",r.totalWins," wins from ",r.totalOpps," opportunities\n")}}function mb(n,a){1&n&&e.nrm(0,"p-skeleton",92)}function hb(n,a){1&n&&(e.j41(0,"tr")(1,"td",55),e.nrm(2,"p-skeleton",93)(3,"p-skeleton",94),e.k0s(),e.j41(4,"td"),e.nrm(5,"p-skeleton",74),e.k0s(),e.j41(6,"td"),e.nrm(7,"p-skeleton",74),e.k0s(),e.j41(8,"td"),e.nrm(9,"p-skeleton",73),e.k0s(),e.j41(10,"td"),e.nrm(11,"p-skeleton",79),e.k0s(),e.j41(12,"td",55),e.nrm(13,"p-skeleton",80)(14,"p-skeleton",81),e.k0s()())}function gb(n,a){1&n&&(e.j41(0,"div",65)(1,"div",66)(2,"p-card",67),e.DNE(3,mb,1,0,"ng-template",68),e.j41(4,"div",69)(5,"div",70)(6,"table",71)(7,"thead",72)(8,"tr")(9,"th"),e.nrm(10,"p-skeleton",73),e.k0s(),e.j41(11,"th"),e.nrm(12,"p-skeleton",74),e.k0s(),e.j41(13,"th"),e.nrm(14,"p-skeleton",74),e.k0s(),e.j41(15,"th"),e.nrm(16,"p-skeleton",75),e.k0s(),e.j41(17,"th"),e.nrm(18,"p-skeleton",76),e.k0s(),e.j41(19,"th"),e.nrm(20,"p-skeleton",73),e.k0s()()(),e.j41(21,"tbody"),e.DNE(22,hb,15,0,"tr",77),e.k0s(),e.j41(23,"tfoot",78)(24,"tr")(25,"td"),e.nrm(26,"p-skeleton",73),e.k0s(),e.j41(27,"td"),e.nrm(28,"p-skeleton",74),e.k0s(),e.j41(29,"td"),e.nrm(30,"p-skeleton",74),e.k0s(),e.j41(31,"td"),e.nrm(32,"p-skeleton",73),e.k0s(),e.j41(33,"td"),e.nrm(34,"p-skeleton",79),e.k0s(),e.j41(35,"td",55),e.nrm(36,"p-skeleton",80)(37,"p-skeleton",81),e.k0s()()()()()()()(),e.j41(38,"div",82)(39,"p-card",83),e.nrm(40,"p-skeleton",84)(41,"p-skeleton",85),e.k0s(),e.j41(42,"p-card",83),e.nrm(43,"p-skeleton",86),e.j41(44,"div",87),e.nrm(45,"p-skeleton",88),e.j41(46,"div",89),e.nrm(47,"p-skeleton",90),e.k0s()()(),e.j41(48,"p-card",67),e.nrm(49,"p-skeleton",84)(50,"p-skeleton",91),e.k0s()()()),2&n&&(e.R7$(22),e.Y8G("ngForOf",e.lJ4(1,ib)))}function _b(n,a){if(1&n&&(e.j41(0,"div"),e.DNE(1,ob,4,3,"div",7)(2,fb,84,51,"div",8)(3,gb,51,2,"div",9),e.k0s()),2&n){const t=e.XpG();e.R7$(),e.Y8G("ngIf",t.loadState===t.LOAD_STATE.LOADED),e.R7$(),e.Y8G("ngIf",t.loadState===t.LOAD_STATE.LOADED),e.R7$(),e.Y8G("ngIf",t.loadState===t.LOAD_STATE.LOADING)}}let xb=(()=>{class n{_boardService;teamsService;router;messageService;authService;IMG_ROUTE=`${Xt.c.apiUrl}/api/storage/image/`;teamTargetChartRef;LOAD_STATE=J.nC;loadState=J.nC.LOADING;leaderboard=[];boardId;teamId;dateRange=J.i.ThisYear;startDate;endDate;board=null;activeTab="Leaderboard";selectedDateRangeLabel="ThisYear";selectedDateRange=J.i.ThisYear;customStartDate=null;customEndDate=null;showCustomCalendarLeaderboard=!1;SalesDateRange=J.i;upgradeRequired=!1;isSavingTarget=!1;selectedPeriodValue;currentUserId;currencyCode="ZAR";get boardIdAsNumber(){return Number(this.boardId)}salesDateRanges=[{label:"All Time",value:J.i.AllTime},{label:"This Month",value:J.i.ThisMonth},{label:"Last Month",value:J.i.LastMonth},{label:"Custom",value:J.i.Custom},{label:"This Year",value:J.i.ThisYear},{label:"Last Year",value:J.i.LastYear}];salesTarget=[{label:"This Year",value:J.i.ThisYear}];constructor(t,r,i,s,o){this._boardService=t,this.teamsService=r,this.router=i,this.messageService=s,this.authService=o,this.currentUserId=this.authService.getUserId(),this.currencyCode=this.teamsService.currencyCode,console.log("currencyCode",this.currencyCode)}ngOnInit(){const t=this.teamsService.getCurrentTeam;t?.Team?.Id&&(this.teamId=t.Team.Id,this._boardService.board$.pipe((0,eb.s)(1),(0,mc.n)(r=>r?(0,lt.of)(r):this._boardService.loadBoard(this.teamId).pipe((0,tb.M)(i=>{this.upgradeRequired=this._boardService.upgradeSalesRequired,this._boardService.setBoard(i)})))).subscribe({next:r=>{this.board=r,this.boardId=r.Id,this.loadLeaderboard(this.dateRange,this.startDate??null,this.endDate??null)},error:r=>{402!==r.status?this.messageService.add({severity:"error",summary:"Error",detail:`${r.error}`}):this.upgradeRequired=!0}}))}ngAfterViewInit(){this.updateChart()}centerTextPlugin={id:"centerText",afterDraw:t=>{const r=t.ctx,i=t.getDatasetMeta(0);if(!i||!i.data||!i.data.length)return;const{x:s,y:o}=i.data[0],l=`${this.teamTargetPercentage}%`;r.save(),r.font="bold 28px Inter, sans-serif",r.fillStyle="#2563eb",r.textAlign="center",r.textBaseline="middle",r.fillText(l,s,o),r.restore(
1)}};teamTargetOptions={responsive:!0,maintainAspectRatio:!1,aspectRatio:1.8,animation:{animateRotate:!0,animateScale:!0,duration:1e3,easing:"easeOutCubic"},plugins:{legend:{display:!1},tooltip:{enabled:!1}}};teamTargetData={labels:["Achieved","Remaining"],datasets:[{data:[Number(this.teamTargetPercentage)||0,100-(Number(this.teamTargetPercentage)||0)],backgroundColor:["#2563eb","#f1f3f5"],borderWidth:10,borderRadius:20,cutout:"85%"}]};doughnutShadowPlugin={id:"doughnutShadow",beforeDatasetsDraw:t=>{const{ctx:r}=t;r.save(),r.shadowColor="rgba(37, 99, 235, 0.2)",r.shadowBlur=10,r.shadowOffsetX=0,r.shadowOffsetY=4},afterDatasetsDraw:t=>{t.ctx.restore()}};updateChart(){if(!this.teamTargetChartRef)return;const t=this.teamTargetChartRef.chart,r=this.teamTargetPercentage;t.data.datasets[0].data=[r,100-r],t.update()}get totalOpps(){return this.leaderboard.reduce((t,r)=>t+(r.ActiveOpportunities+r.ClosedOpportunities),0)}get totalWins(){return this.leaderboard.reduce((t,r)=>t+r.WonOpportunities,0)}get totalValue(){return this.leaderboard.reduce((t,r)=>t+r.WonAmount,0)}get averageRate(){if(!this.leaderboard||0===this.leaderboard.length)return 0;const t=this.leaderboard.reduce((r,i)=>r+i.ConversionRate,0);return Math.round(t/this.leaderboard.length)}get totalTarget(){return this.leaderboard?.length?this.leaderboard.reduce((t,r)=>t+(r.SalesTargetAmount||0),0):0}get remainingTarget(){if(!this.totalTarget||this.totalTarget<=0)return null;const t=this.totalTarget-this.totalValue;return t>0?t:0}get teamTargetPercentage(){return this.totalTarget?Math.round(this.totalValue/this.totalTarget*100):0}get averageDays(){if(!this.leaderboard||0===this.leaderboard.length)return 0;const t=this.leaderboard.reduce((r,i)=>r+i.AvgCloseDays,0);return Math.round(t/this.leaderboard.length)}get canManageSalesTargets(){return["Owner","Admin"].includes(this.teamsService.getCurrentTeam?.Role)}loadLeaderboard(t=J.i.ThisYear,r,i){const s={RankBy:"WonAmount",SourceIds:[],DateFilter:{StartDate:r?r.toISOString():null,EndDate:i?i.toISOString():null,Range:t}};this._boardService.getSalesLeaderboard(Number(this.boardId),this.teamId,s).subscribe({next:o=>{this.leaderboard=o.filter(l=>l.ActiveOpportunities>0||l.WonOpportunities>0||l.LostOpportunities>0||l.ClosedOpportunities>0).sort((l,c)=>c.WonOpportunities===l.WonOpportunities?c.ActiveOpportunities+c.ClosedOpportunities-(l.ActiveOpportunities+l.ClosedOpportunities):c.WonOpportunities-l.WonOpportunities),this.updateChart(),this.loadState=J.nC.LOADED},error:o=>{const l=(0,yn.u)(o)||"Please try again later.";402===o.status?this.upgradeRequired=!0:(this.messageService.add({severity:"error",summary:"Request Failed",detail:l,life:5e3}),this.loadState=J.nC.ERROR)}})}onDateRangeSelect(t){this.selectedDateRangeLabel=t,t===J.i.Custom?this.showCustomCalendarLeaderboard=!0:(this.selectedDateRange=t,this.customStartDate=null,this.customEndDate=null,this.loadLeaderboard(t,this.customStartDate,this.customEndDate))}onDateSelect(){if(this.customStartDate&&this.customEndDate){let t=new Date(this.customStartDate),r=new Date(this.customEndDate);t>r&&(this.customStartDate=t,this.customEndDate=r)}}applyCustomDateLeaderboard(){!this.customStartDate||!this.customEndDate||(this.selectedDateRange=J.i.Custom,this.selectedDateRangeLabel=`${this.formatDate(this.customStartDate)} to ${this.formatDate(this.customEndDate)}`,this.loadLeaderboard(this.selectedDateRange,this.customStartDate,this.customEndDate),this.showCustomCalendarLeaderboard=!1)}formatDate(t){return t.toISOString().split("T")[0]}goToSubscription(){this.router.navigate([`/dashboard/subscription-plans/${this.teamsService.getCurrentTeam.Team.Id}`])}get topAchiever(){return this.leaderboard?.length?[...this.leaderboard].sort((t,r)=>r.WonAmount-t.WonAmount)[0]:null}getTargetMonth(){const t=(new Date).getUTCFullYear();return new Date(Date.UTC(t,0,1)).toISOString()}buildCreateTargetPayload(t,r){return{UserId:t.UserId,BoardId:Number(this.boardId),TargetAmount:r,TargetMonth:this.getTargetMonth(),Type:J.Jb.LeadTarget}}buildEditTargetPayload(t,r){return{...this.buildCreateTargetPayload(t,r),Id:t.SalesTargetId}}saveTargetForRep(t,r){return t.SalesTargetId?this._boardService.updateSalesTarget(this.buildEditTargetPayload(t,r)):this._boardService.createSalesTarget(this.buildCreateTargetPayload(t,r))}refreshCurrentLeaderboard(){this.loadLeaderboard(this.selectedDateRange,this.customStartDate,this.customEndDate)}showTargetPermissionError(){this.messageService.add({severity:"warn",summary:"Permission denied",detail
1:"Only workspace owners and admins can manage sales targets."})}saveSalesTarget(t){this.canManageSalesTargets?(this.isSavingTarget=!0,this.saveTargetForRep(t.rep,t.targetAmount).subscribe({next:()=>{this.messageService.add({severity:"success",summary:"Target saved",detail:`${t.rep.UserName}'s sales target has been updated.`}),this.isSavingTarget=!1,this.refreshCurrentLeaderboard()},error:r=>{this.isSavingTarget=!1,this.messageService.add({severity:"error",summary:"Target not saved",detail:(0,yn.u)(r)||"Failed to save sales target."})}})):this.showTargetPermissionError()}saveSalesTargetsBatch(t){this.canManageSalesTargets?t.reps.length&&(this.isSavingTarget=!0,(0,or.p)(t.reps.map(r=>this.saveTargetForRep(r,t.targetAmount))).subscribe({next:()=>{this.messageService.add({severity:"success",summary:"Targets saved",detail:`The yearly target has been applied to ${t.reps.length} rep${1===t.reps.length?"":"s"}.`}),this.isSavingTarget=!1,this.refreshCurrentLeaderboard()},error:r=>{this.isSavingTarget=!1,this.messageService.add({severity:"error",summary:"Targets not saved",detail:(0,yn.u)(r)||"Failed to save one or more sales targets."})}})):this.showTargetPermissionError()}static \u0275fac=function(r){return new(r||n)(e.rXU(_t.a),e.rXU(rt.n),e.rXU(rn.Ix),e.rXU(be.bg),e.rXU(jn.u))};static \u0275cmp=e.VBU({type:n,selectors:[["app-sales-leaderboard"]],viewQuery:function(r,i){if(1&r&&e.GBs(nb,5),2&r){let s;e.mGM(s=e.lsd())&&(i.teamTargetChartRef=s.first)}},standalone:!1,decls:3,vars:2,consts:[["dateSelect",""],["startPicker",""],["endPicker",""],["teamTargetChart",""],["noTarget",""],[1,""],[4,"ngIf"],["class","flex mb-2 relative",4,"ngIf"],["class","grid ",4,"ngIf"],["class","grid align-items-stretch",4,"ngIf"],[1,"flex","mb-2","relative"],["optionLabel","label","optionValue","value","placeholder","Select Date Range","styleClass","custom-select flex align-items-center border-1 h-2rem bg-white pl-2 pr-2 w-full",3,"ngModelChange","onChange","options","ngModel"],["class","calendar-popover shadow-2 border-round p-3",4,"ngIf"],[1,"calendar-popover","shadow-2","border-round","p-3"],[1,"flex","justify-content-center","gap-5"],[1,"block","font-semibold","text-sm","mb-2"],["dateFormat","yy-mm-dd",3,"ngModelChange","onSelect","ngModel"],[1,"flex","justify-content-end","gap-2","mt-3"],["pButton","","type","button","label","Apply","icon","pi pi-check",1,"p-button-rounded","px-4",3,"click","disabled"],["pButton","","type","button","label","Cancel",1,"p-button-outlined","p-button-rounded","px-4",3,"click"],[1,"grid"],[1,"col-12","md:col-9"],[1,"grid","mb-2"],[1,"col-12","md:col-3"],[1,"stat-card","border-round-xl"],[1,"flex","justify-content-between","align-items-center"],[1,"text-muted","text-sm","mb-1"],[1,"text-lg","font-bold","mb-1"],[1,"p-3","border-round-lg","bg-blue-50","text-blue-500"],[1,"pi","pi-dollar","text-xl"],[1,"pi","pi-users","text-xl"],[1,"text-2xl","font-bold","mb-1"],[1,"pi","pi-check-circle","text-xl"],[1,"pi","pi-clock","text-xl"],[1,"table-card","shadow-1","border-round-xl","overflow-hidden"],[3,"saveTarget","saveTargetsBatch","data","currencyCode","currentUserId","boardId","canManageSalesTargets","isSavingTarget"],[1,"col-12","md:col-3","flex","flex-column","gap-3"],["class","stat-card border-round-xl mb-1",4,"ngIf"],[1,"border-round-xl","shadow-1"],[1,"flex","align-items-center","gap-2","mb-1"],[1,"font-bold","text-lg"],[1,"flex","flex-column","align-items-center"],[1,"relative","flex","justify-content-center","align-items-center",2,"width","160px","height","160px"],["type","doughnut",1,"w-full","h-full",3,"data","options","plugins"],[1,"text-center","mt-1"],[1,"text-2xl","font-bold"],[1,"text-muted","text-sm"],[1,"border-top-1","border-100","pt-3","mt-3","flex","align-items-center","justify-content-between"],[1,"text-500","font-medium","text-xs","uppercase","tracking-wider"],["class","px-2 py-1 border-round-sm font-bold text-sm",3,"class",4,"ngIf","ngIfElse"],[1,"flex","align-items-center","gap-2","mb-3"],[1,"text-3xl","font-bold","text-blue-600","my-2","text-center"],[1,"border-top-1","border-gray-200","pt-1flex","justify-content-between","text-sm"],[1,"text-muted"],[1,"stat-card","border-round-xl","mb-1"],[1,"flex","align-items-center","gap-2"],["icon","pi pi-user","shape","circle","size","normal",4,"ngIf"],["shape","circle","size","normal",3,"image",4,"ngIf"],[1,"font-semibold","text-sm"],[1,"p-2","border-round-lg","bg-blue-50","text-blue-500","flex","flex-column"],[1,"text-md","font-bold","text-center"],["icon","pi pi-user","shape","circle","size","normal"],["shape","circle","size","normal",3,"image"],[1,"px-2","py-1","border-round-sm","font-bold","text-sm"],[1,"text-400","font-bold"],[1,"grid","align-items-stretch"],[1,"col-12","md:col-8","flex","flex-column","h-full"],[1,"flex","flex-column","flex-grow-1","h-full","shadow-none","border-none","p-0"],["pTemplate","header"],[1,"flex","flex-column","flex-grow-1","h-full"],[1,"flex-grow-1","overflow-y-auto",2,"max-height","78vh"],[1,"w-full","border-collapse"],[1,"bg-primary-50","sticky","top-0","z-2"],["width","60px"],["width","40px"],["width","50px"],["width","80px"],[4,"ngFor","ngForOf"],[1,"bg-primary-50","font-bold","sticky","bottom-0","z-2"],["width","70px"],["width","100%","height","6px"],["width","30px"],[1,"col-12","md:col-4","flex","flex-column","h-full"],[1,"flex","flex-column","flex-grow-1","h-full","shadow-none","border-none","p-0","mb-3"],["width","80%","height","1rem",1,"mb-2"],["width","60%","height","2rem"],["width","40%","height","1.2rem",1,"mb-2"],[1,"flex","flex-column","flex-grow-1"],["width","60%","height","1rem",1,"mb-3"],[1,"flex","justify-content-center","flex-grow-1"],["shape","circle","size","250px"],["width","50%","height","2rem"],["width","30%","height","1.2rem",1,"p-3"],["shape","circle","size","30px"],["width","100px"]],template:function(r,i){1&r&&(e.j41(0,"div",5),e.DNE(1,ab,1,0,"app-lockfeatures")(2,_b,4,3,"div",6),e.k0s()),2&r&&(e.R7$(),e.vxM(i.upgradeRequired?1:-1),e.R7$(),e.Y8G("ngIf",!i.upgradeRequired))},dependencies:[q.Sq,q.bT,At.Zp,be.Ei,Te.X9,dn.EA,Ce.K,zn.eu,L.BC,L.vS,xe._f,Oe.l6,On,An.lr,q.oe,Ue],styles:[".progress-dynamic.success .p-progressbar-value{background-color:#28a745!important} .progress-dynamic.warning .p-progressbar-value{background-color:#ffc107!important} .progress-dynamic.danger .p-progressbar-value{background-color:#dc3545!important}[_nghost-%COMP%] .p-select.custom-select{width:100%}[_nghost-%COMP%] .p-select.custom-select{border:1px solid #cccc!important;font-size:12px!important}[_nghost-%COMP%] .p-select-label.p-placeholder{font-size:12px!important}.calendar-popover[_ngcontent-%COMP%]{position:absolute;top:2rem;left:7px;background:#fff;border:1px solid #dcdcdc;border-radius:.5rem;box-shadow:0 2px 10px #0003;z-index:1000;width:22rem;padding:1rem}.team-target-card[_ngcontent-%COMP%], .conversion-card[_ngcontent-%COMP%]{background:transparent;border-radius:0;box-shadow:none}.top-achiever-card[_ngcontent-%COMP%] .trophy[_ngcontent-%COMP%]{font-size:1.6rem}.stat-card[_ngcontent-%COMP%]{box-shadow:none;border-radius:10px}[_nghost-%COMP%] .table-card .p-card-body{padding:.1rem .1rem 1rem!important}[_nghost-%COMP%] .table-card .p-progressbar{position:relative;overflow:hidden;height:var(--p-progressbar-height);background:var(--p-progressbar-background);border-radius:var(--p-progressbar-border-radius)}[_nghost-%COMP%] .custom-input .p-inputNumber{width:100%!important} .save-btn{background:#93c5fd!important;border:none!important;border-radius:10px!important;padding:.75rem 1.5rem!important} .p-button-secondary.p-button-text{color:#4b5563!important;border:1px solid #e5e7eb!important;border-radius:10px!important}"]})}return n})();var vb=ee(73912);const bb=n=>({"active-archive-btn":n}),Cb=(n,a)=>({"hover:bg-gray-100 cursor-pointer":n,"opacity-60 cursor-default":a}),kb=n=>({opacity:n}
1);function Tb(n,a){if(1&n&&(e.j41(0,"p-tab",14),e.nrm(1,"i"),e.j41(2,"span"),e.EFF(3),e.k0s()()),2&n){const t=e.XpG().$implicit;e.Y8G("value",t.value)("routerLink",t.route),e.R7$(),e.HbH("pi "+t.icon),e.R7$(2),e.JRh(t.label)}}function wb(n,a){if(1&n&&(e.qex(0),e.DNE(1,Tb,4,5,"p-tab",13),e.bVm()),2&n){const t=a.$implicit;e.R7$(),e.Y8G("ngIf",t.visible)}}function yb(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",7)(1,"button",15),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.openArchivedList())}),e.nrm(2,"i",16),e.k0s()()}if(2&n){const t=e.XpG();e.R7$(),e.Y8G("ngClass",e.eq3(1,bb,"archived"===t.activeTab))}}function Fb(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",17),e.bIt("click",function(i){e.eBV(t),e.XpG();const s=e.sdS(10);return e.Njj(s.toggle(i))}),e.k0s()}}function Sb(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",18),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG();return e.Njj(s.toggleTab(i))}),e.j41(1,"i",19),e.bIt("click",function(i){const s=e.eBV(t).$implicit,o=e.XpG();return i.stopPropagation(),e.Njj(o.toggleTab(s))}),e.k0s(),e.j41(2,"div",20),e.nrm(3,"i",21),e.j41(4,"span",22),e.EFF(5),e.k0s()()()}if(2&n){const t=a.$implicit;e.Y8G("ngClass",e.l_i(11,Cb,!t.disabled,t.disabled)),e.R7$(),e.Aen(t.disabled?"color: #cbd5e1 !important;":""),e.HbH(t.visible?"pi pi-eye text-blue-500 cursor-pointer":"pi pi-eye-slash text-500 cursor-pointer"),e.R7$(),e.AVh("disabled-tab-list",t.disabled),e.Y8G("ngStyle",e.eq3(14,kb,t.disabled?"0.4":"1")),e.R7$(),e.HbH("pi "+t.icon),e.R7$(2),e.SpI(" ",t.label," ")}}let Eb=(()=>{class n{router;_boardService;teamsService;featureServices;messageService;integrationService;activeTab="sales-tracker";boardId="";showPreference=!1;showMetaModal=!1;selectedProduct=null;isFacebookIntegrated=!1;teamId;modalView="integrations";permissionDeniedMessage="";missingPermissions=[];showPagePicker=!1;availablePages=[];tempUserToken=null;isAdmin;navTabs=[];constructor(t,r,i,s,o,l){this.router=t,this._boardService=r,this.teamsService=i,this.featureServices=s,this.messageService=o,this.integrationService=l}ngOnInit(){const t=this.teamsService.getCurrentTeam;this.teamId=t.Team.Id,this.isAdmin=["Owner","Admin"].includes(t.Role),this._boardService.board$.subscribe(r=>{r&&(this.boardId=r.Id)}),this.setActiveTab(this.router.url),this.router.events.subscribe(r=>{r instanceof rn.wF&&this.setActiveTab(r.urlAfterRedirects)}),this.loadState(),this.loadTabs(),this.integrationService.initialize(this.teamId)}loadState(){const t=localStorage.getItem("user_nav_tabs");if(t){const r=JSON.parse(t);this.navTabs.forEach(i=>{const s=r.find(o=>o.id===i.id);s&&(i.visible=s.visible)})}}setActiveTab(t){this.activeTab=t.includes("leaderboard")?"leaderboard":t.includes("sales-tracker")?"sales-tracker":t.includes("archived")?"archived":t.includes("tenders")?"tenders":t.includes("chats")?"connection":t.includes("contacts")?"contacts":"dashboard"}openArchivedList(){this.router.navigate(["/dashboard/sales/list/archived"],{queryParams:{boardId:this.boardId}})}get isArchivedPage(){return this.router.url.includes("/sales-tracker")||this.router.url.includes("archived")}get istenderspage(){return this.router.url.includes("/tenders")}closeTender(){this.showPreference=!1}openIntegrationModal(){this.modalView="integrations",this.showMetaModal=!0}openPagePicker(t){this.availablePages=t.pages,this.tempUserToken=t.token,this.showMetaModal=!1,this.showPagePicker=!0}onPermissionDenied(t){this.permissionDeniedMessage=t.message,this.missingPermissions=t.permissions,this.modalView="permissionDenied"}formatPermission(t){return{pages_show_list:"Access your Pages",pages_messaging:"Send and receive messages"}[t]||t}loadTabs(){this.featureServices.getTabs("sales_tracker",this.teamId).subscribe(t=>{this.navTabs=t.map(r=>{let i=this.getTabUiSettings(r.Key);return{id:r.Id,label:r.Name,icon:i.icon,value:r.Key,route:i.route,visible:r.Visible,disabled:i.disabled}})})}getTabUiSettings(t){return{"sales-tracker":{icon:"pi pi-chart-bar",route:"sales-tracker",disabled:!0},tenders:{icon:"pi pi-briefcase",route:"tenders",disabled:!1},connection:{icon:"pi pi-sitemap",route:"chats",disabled:!1},contacts:{icon:"pi pi-users",route:"contacts",disabled:!1},leaderboard:{icon:"pi pi-trophy",route:"leaderboard",disabled:!1},dashboard:{icon:"pi pi-th-large",route:"dashboard",disabled:!1}}[t]||{icon:"pi pi-tag",route:"/",disabled:!1}}toggleTab(t){t.disabled||this.featureServices.toggleTabVisibility(t.id,this.teamId).subscribe({next:r=>{t.visible=r.Visible,this.messageService.add({severity:"success",summary:"Success",detail
1:`${t.label} visibility updated`})},error:r=>{console.error("Failed to toggle tab",r)}})}static \u0275fac=function(r){return new(r||n)(e.rXU(rn.Ix),e.rXU(_t.a),e.rXU(rt.n),e.rXU(vb.w),e.rXU(be.bg),e.rXU(oi.a))};static \u0275cmp=e.VBU({type:n,selectors:[["app-sales"]],standalone:!1,decls:17,vars:5,consts:[["op",""],[1,"p-2","sticky","top-0","pb-0",2,"background","#f1f5f9","z-index","100"],[1,"flex","justify-content-between","align-items-center","bg-white","px-3","mb-2"],[3,"value"],[4,"ngFor","ngForOf"],[1,"ml-auto","flex","align-items-center","gap-3"],["class","flex align-items-center ",4,"ngIf"],[1,"flex","align-items-center"],["pButton","","type","button","label","Manage","icon","pi pi-sliders-h","class","p-button-outlined p-button-secondary p-button-sm custom-manage-btn",3,"click",4,"ngIf"],[1,"flex","flex-column","gap-3","p-2","border-round-md",2,"min-width","200px"],[1,"font-bold","text-xs","text-secondary","uppercase","px-1",2,"letter-spacing","0.5px","color","#64748b"],["class","flex align-items-center gap-2 py-1 transition-colors transition-duration-150 border-round",3,"ngClass","click",4,"ngFor","ngForOf"],[1,"contaner-flud","p-2","pt-0","pb-0"],["class","flex items-center !gap-2 text-sm",3,"value","routerLink",4,"ngIf"],[1,"flex","items-center","!gap-2","text-sm",3,"value","routerLink"],["pButton","","type","button","label","Archived",1,"p-button-text","archive-text-btn",3,"click","ngClass"],[1,"pi","pi-inbox","ml-2"],["pButton","","type","button","label","Manage","icon","pi pi-sliders-h",1,"p-button-outlined","p-button-secondary","p-button-sm","custom-manage-btn",3,"click"],[1,"flex","align-items-center","gap-2","py-1","transition-colors","transition-duration-150","border-round",3,"click","ngClass"],[1,"text-sm",3,"click"],[1,"flex","align-items-center","gap-2","text-sm","w-full","transition-opacity","transition-duration-150",3,"ngStyle"],[1,"text-600","text-sm"],[1,"text-sm",2,"color","#495057"]],template:function(r,i){1&r&&(e.j41(0,"div",1)(1,"div",2)(2,"p-tabs",3)(3,"p-tablist"),e.DNE(4,wb,2,1,"ng-container",4),e.k0s()(),e.j41(5,"div",5),e.DNE(6,yb,3,3,"div",6),e.j41(7,"div",7),e.DNE(8,Fb,1,0,"button",8),e.j41(9,"p-popover",null,0)(11,"div",9)(12,"div",10),e.EFF(13," Show / Hide Tabs "),e.k0s(),e.DNE(14,Sb,6,16,"div",11),e.k0s()()()()()(),e.j41(15,"div",12),e.nrm(16,"router-outlet"),e.k0s()),2&r&&(e.R7$(2),e.Y8G("value",i.activeTab),e.R7$(2),e.Y8G("ngForOf",i.navTabs),e.R7$(2),e.Y8G("ngIf",i.isArchivedPage),e.R7$(2),e.Y8G("ngIf",i.isAdmin),e.R7$(6),e.Y8G("ngForOf",i.navTabs))},dependencies:[q.YU,q.Sq,q.bT,q.B3,rn.n3,sr.Wk,xe._f,Ae.AM,pn.oz,pn.tU,pn.wb],styles:[".archive-text-btn[_ngcontent-%COMP%]{color:#6b7280;padding:.5rem .75rem}.archive-text-btn[_ngcontent-%COMP%]:hover, .archive-text-btn[_ngcontent-%COMP%]:focus{background:transparent!important;color:#2563eb!important}.active-archive-btn[_ngcontent-%COMP%]{color:#2563eb!important}[_nghost-%COMP%] .meta-modal .p-dialog-header{border-bottom:1px solid #ccc;padding-bottom:1.5rem}[_nghost-%COMP%] .meta-modal .p-dialog-footer{display:flex;border-top:1px solid #ccc;justify-content:start!important} .tender-preferece .p-drawer-footer{border-top:1px solid #ccc!important} .tender-preferece .p-drawer-content{padding:0!important}.emoji-container[_ngcontent-%COMP%]{text-align:center;padding:24px 0}.emoji[_ngcontent-%COMP%]{font-size:48px;display:inline-block;animation:_ngcontent-%COMP%_bounce 1s infinite}@keyframes _ngcontent-%COMP%_bounce{0%,to{transform:translateY(0)}50%{transform:translateY(-10px)}}"]})}return n})();var hc=ee(84572);const Ib=n=>({"background-color":n,color:"White",width:"50px","text-align":"center"}),Db=(n,a)=>({"status-won":n,"status-lost":a});function Rb(n,a){if(1&n){const t=e.RV6();e.j41(0,"div")(1,"button",14),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.toggleSelectMode())}),e.k0s()()}}function jb(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",15)(1,"button",16),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.closeSelectMode())}),e.k0s(),e.j41(2,"span",17),e.EFF(3),e.k0s(),e.j41(4,"button",18),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onBulkUnarchive())}),e.k0s(),e.j41(5,"button",19),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onBulkDelete())}),e.k0s()()}if(2&n){const t=e.XpG();e.R7$(3),e.SpI(" ",t.selectedRows.length," selected "),e.R7$(),e.Y8G("disabled",!t.selectedRows.length),e.R7$(),e.Y8G("disabled",!t.selectedRows.length)}}function Ab(n,a){1&n&&(e.qex(0),e.EFF(1," # "),e.bVm())}function Mb(n,a){1&n&&e.nrm(0,"p-tableHeaderCheckbox")}
1function Pb(n,a){if(1&n&&(e.j41(0,"th"),e.EFF(1),e.k0s()),2&n){const t=a.$implicit;e.R7$(),e.SpI(" ",t.header," ")}}function Ob(n,a){if(1&n&&(e.j41(0,"tr")(1,"th",20),e.DNE(2,Ab,2,0,"ng-container",21)(3,Mb,1,0,"ng-template",null,0,e.C5r),e.k0s(),e.DNE(5,Pb,2,1,"th",22),e.k0s()),2&n){const t=e.sdS(4),r=e.XpG();e.R7$(2),e.Y8G("ngIf",!r.selectMode)("ngIfElse",t),e.R7$(3),e.Y8G("ngForOf",r.columns)}}function Nb(n,a){if(1&n&&(e.qex(0),e.EFF(1),e.bVm()),2&n){const t=e.XpG().rowIndex;e.R7$(),e.SpI(" ",t+1," ")}}function Gb(n,a){if(1&n&&e.nrm(0,"p-tableCheckbox",25),2&n){const t=e.XpG().$implicit;e.Y8G("value",t)}}function Bb(n,a){if(1&n&&(e.qex(0),e.j41(1,"div",29)(2,"span",30),e.EFF(3),e.k0s(),e.j41(4,"span",31),e.EFF(5),e.k0s()(),e.bVm()),2&n){const t=e.XpG(2).$implicit,r=e.XpG();e.R7$(3),e.JRh(t.Title),e.R7$(),e.Y8G("ngStyle",e.eq3(3,Ib,r.getCardPriorityColor(t))),e.R7$(),e.SpI(" ",r.getPriorityLabel(t.Priority)," ")}}function Lb(n,a){if(1&n&&(e.qex(0),e.j41(1,"strong"),e.EFF(2),e.nI1(3,"currency"),e.k0s(),e.bVm()),2&n){const t=e.XpG(2).$implicit,r=e.XpG();e.R7$(2),e.JRh(e.ii3(3,1,t.Amount,r.currencyCode,"symbol-narrow","1.2-2"))}}function $b(n,a){if(1&n&&(e.qex(0),e.EFF(1),e.nI1(2,"number"),e.bVm()),2&n){const t=e.XpG(2).$implicit;e.R7$(),e.SpI(" ",e.i5U(2,1,t.Percentage,"1.0-0"),"% ")}}function Vb(n,a){if(1&n&&(e.qex(0),e.nrm(1,"p-avatar",32),e.j41(2,"span",33),e.EFF(3),e.k0s(),e.bVm()),2&n){const t=a.$implicit,r=e.XpG(4);e.R7$(),e.Y8G("label",r.getInitials(t)),e.R7$(2),e.JRh(t)}}function Ub(n,a){if(1&n&&(e.qex(0),e.j41(1,"div",4),e.DNE(2,Vb,4,2,"ng-container",22),e.k0s(),e.bVm()),2&n){const t=e.XpG(2).$implicit;e.R7$(2),e.Y8G("ngForOf",t.AssignedUsers)}}function Xb(n,a){if(1&n&&(e.qex(0),e.j41(1,"span",33),e.EFF(2),e.nI1(3,"date"),e.k0s(),e.bVm()),2&n){const t=e.XpG(2).$implicit;e.R7$(2),e.JRh(e.i5U(3,1,t.DueDateUtc,"MMM d, yyyy"))}}function Yb(n,a){if(1&n&&(e.qex(0),e.j41(1,"span",33),e.EFF(2),e.nI1(3,"date"),e.k0s(),e.bVm()),2&n){const t=e.XpG(2).$implicit;e.R7$(2),e.JRh(e.i5U(3,1,t.DueDateUtc,"MMM d, yyyy"))}}function Wb(n,a){if(1&n&&(e.qex(0),e.j41(1,"span",34),e.EFF(2),e.k0s(),e.bVm()),2&n){const t=e.XpG(2).$implicit;e.R7$(),e.Y8G("ngClass",e.l_i(2,Db,2===t.Status,3===t.Status)),e.R7$(),e.SpI(" ",t.StatusString," ")}}function Hb(n,a){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"div",35)(2,"button",36),e.bIt("click",function(i){e.eBV(t);const s=e.XpG(2).$implicit;return e.XpG().unArchive(s.Id),e.Njj(i.stopPropagation())}),e.k0s(),e.j41(3,"button",37),e.bIt("click",function(i){e.eBV(t);const s=e.XpG(2).$implicit;return e.XpG().deletePermanently(s.Id),e.Njj(i.stopPropagation())}),e.k0s()(),e.bVm()}}function zb(n,a){if(1&n&&(e.qex(0),e.EFF(1),e.bVm()),2&n){const t=e.XpG().$implicit,r=e.XpG().$implicit;e.R7$(),e.SpI(" ",r[t.field]," ")}}function qb(n,a){if(1&n&&(e.j41(0,"td"),e.qex(1,26),e.DNE(2,Bb,6,5,"ng-container",27)(3,Lb,4,6,"ng-container",27)(4,$b,3,4,"ng-container",27)(5,Ub,3,1,"ng-container",27)(6,Xb,4,4,"ng-container",27)(7,Yb,4,4,"ng-container",27)(8,Wb,3,5,"ng-container",27)(9,Hb,4,0,"ng-container",27)(10,zb,2,1,"ng-container",28),e.bVm(),e.k0s()),2&n){const t=a.$implicit;e.R7$(),e.Y8G("ngSwitch",t.field),e.R7$(),e.Y8G("ngSwitchCase","Title"),e.R7$(),e.Y8G("ngSwitchCase","Amount"),e.R7$(),e.Y8G("ngSwitchCase","Percentage"),e.R7$(),e.Y8G("ngSwitchCase","AssignedUsers"),e.R7$(),e.Y8G("ngSwitchCase","DueDateUtc"),e.R7$(),e.Y8G("ngSwitchCase","DateArchivedUtc"),e.R7$(),e.Y8G("ngSwitchCase","StatusString"),e.R7$(),e.Y8G("ngSwitchCase","actions")}}function Jb(n,a){if(1&n&&(e.j41(0,"tr",23)(1,"td",24),e.DNE(2,Nb,2,1,"ng-container",21)(3,Gb,1,1,"ng-template",null,1,e.C5r),e.k0s(),e.DNE(5,qb,11,9,"td",22),e.k0s()),2&n){const t=e.sdS(4),r=e.XpG();e.R7$(2),e.Y8G("ngIf",!r.selectMode)("ngIfElse",t),e.R7$(3),e.Y8G("ngForOf",r.columns)}}function Kb(n,a){if(1&n&&(e.j41(0,"tr")(1,"td",38),e.EFF(2," No records found "),e.k0s()()),2&n){const t=e.XpG();e.R7$(),e.BMQ("colspan",t.columns.length)}}let Qb=(()=>{class n{route;_boardService;location;messageService;loadState=J.nC.LOADING;IMG_ROUTE=`${Xt.c.apiUrl}/api/storage/image/`;LOAD_STATE=J.nC;tasks=[];trackId=null;OpportunityStatusEnum=J.t4;currencyCode="ZAR";viewType;columns=[];rows=[];isLoading;track;selectMode=!1;selectedRows=[];constructor(t,r,i,s){this.route=t,this._boardService=r,this.location=i,this.messageService=s}ngOnInit(){(0,hc.z)([this.route.paramMap,this.route.queryParamMap]).subscribe(([t,r])=>
1{this.viewType=t.get("view"),this.setupView();const i={Range:r.get("Range")??J.i.AllTime,StartDate:r.get("StartDate"),EndDate:r.get("EndDate")};this.fetchData(r.get("boardId"),r.get("trackId"),i)})}buildLossReasonRows(t){const r=new Map;for(const s of t){const o=(s.OpportunityClosureLossReason||"").trim()||"Unspecified",l=r.get(o)??{Count:0,Amount:0};l.Count+=1,l.Amount+=s.Amount||0,r.set(o,l)}const i=t.length||1;return[...r.entries()].map(([s,o],l)=>({Id:l,Reason:s,Count:o.Count,Percentage:o.Count/i*100,Amount:o.Amount})).sort((s,o)=>o.Count-s.Count)}setupView(){switch(this.viewType){case"funnel-stage":this.columns=[{field:"Title",header:"Deal Name"},{field:"Amount",header:"Amount"},{field:"AssignedUsers",header:"Assignees"},{field:"DueDateUtc",header:"Closing Date"}];break;case"active":this.columns=[{field:"Title",header:"Opportunity"},{field:"Amount",header:"Amount"},{field:"DueDateUtc",header:"Due Date"}];break;case"loss-reasons":this.columns=[{field:"Reason",header:"Loss Reason"},{field:"Count",header:"Deals"},{field:"Percentage",header:"Share"},{field:"Amount",header:"Value"}];break;case"closed":this.columns=[{field:"Title",header:"Opportunity"},{field:"Amount",header:"Amount"},{field:"StatusString",header:"Status"},{field:"AssignedUsers",header:"Deal Owner"}];break;case"won":this.columns=[{field:"Title",header:"Opportunity"},{field:"Amount",header:"Amount"},{field:"AssignedUsers",header:"Deal Owner"}];break;case"archived":this.columns=[{field:"Title",header:"Opportunity"},{field:"Amount",header:"Amount"},{field:"DateArchivedUtc",header:"Date Archived on"},{field:"AssignedUsers",header:"Assignees"},{field:"actions",header:"Actions"}]}}
1fetchData(t,r,i){switch(this.isLoading=!0,this.viewType){case"funnel-stage":if(!r)return void(this.isLoading=!1);this._boardService.getTrackCards(Number(r),i).subscribe({next:s=>{this.track=s,this.rows=s?.Cards??[],this.isLoading=!1},error:()=>this.isLoading=!1});break;case"active":if(!t)return void(this.isLoading=!1);this._boardService.getFilteredCards(Number(t),J.t4.Active,i).subscribe({next:s=>{this.rows=s,this.isLoading=!1},error:()=>this.isLoading=!1});break;case"loss-reasons":if(!t)return void(this.isLoading=!1);this._boardService.getFilteredCards(Number(t),J.t4.Lost,i).subscribe({next:s=>{this.rows=this.buildLossReasonRows(s??[]),this.isLoading=!1},error:()=>this.isLoading=!1});break;case"won":if(!t)return void(this.isLoading=!1);this._boardService.getFilteredCards(Number(t),J.t4.Won,i).subscribe({next:s=>{this.rows=s,this.isLoading=!1},error:()=>this.isLoading=!1});break;case"closed":if(!t)return void(this.isLoading=!1);this._boardService.getFilteredCards(Number(t),null,i).subscribe({next:s=>{this.rows=s,this.isLoading=!1},error:()=>this.isLoading=!1});break;case"archived":if(!t)return void(this.isLoading=!1);this._boardService.getBoardTracksWithArchivedCards(Number(t)).subscribe({next:s=>{this.rows=(s??[]).flatMap(o=>o.Cards??[])},error:s=>{console.error("Error loading archived tracks",s)}})}}getInitials(t){if(!t)return"";const r=t.split(" ");return 1===r.length?r[0].charAt(0).toUpperCase():(r[0].charAt(0)+r[1].charAt(0)).toUpperCase()}getCardPriorityColor(t){switch(t.Priority){case"Urgent":return"#e63946";case"Medium":return"#f1c232";case"None":return"#19a2e6";default:return"transparent"}}getPriorityLabel(t){switch(t){case"Urgent":return"HOT";case"Medium":return"WARM";case"None":return"COLD";default:return""}}goBack(){this.location.back()}unArchive(t){this.isLoading=!0,this._boardService.unArchiveCard(t).subscribe({next:()=>{this.isLoading=!1,this.messageService.add({severity:"success",summary:"Unarchived",detail:"Card successfully unarchived"})},error:()=>{this.isLoading=!1,this.messageService.add({severity:"error",summary:"Error",detail:"Failed to unarchive card"})}})}deletePermanently(t){this.isLoading=!0,this._boardService.bulkDelete([t]).subscribe({next:()=>{this.isLoading=!1,this.rows=this.rows.filter(r=>r.Id!==t),this.messageService.add({severity:"success",summary:"Deleted",detail:"Card permanently deleted"})},error:()=>{this.isLoading=!1,this.messageService.add({severity:"error",summary:"Error",detail:"Failed to delete card"})}})}onBulkUnarchive(){const t=this.selectedRows.filter(r=>null!=r.Id).map(r=>r.Id);t.length?this._boardService.bulkUnarchive(t).subscribe({next:()=>{this.rows=this.rows.filter(r=>!t.includes(r.Id)),this.selectedRows=[],this.messageService.add({severity:"success",summary:"Restored",detail:"Cards were successfully restored."})},error:()=>{this.messageService.add({severity:"error",summary:"Failed",detail:"Failed to restore cards."})}}):this.messageService.add({severity:"warn",summary:"No Selection",detail:"Please select cards to unarchive."})}onBulkDelete(){const t=this.selectedRows.filter(r=>null!=r.Id).map(r=>r.Id);t.length?this._boardService.bulkDelete(t).subscribe({next:()=>{this.rows=this.rows.filter(r=>!t.includes(r.Id)),this.selectedRows=[],this.messageService.add({severity:"success",summary:"Deleted",detail:"Cards were successfully deleted."})},error:()=>{this.messageService.add({severity:"error",summary:"Failed",detail:"Failed to delete cards."})}}):this.messageService.add({severity:"warn",summary:"No Selection",detail:"Please select cards to delete."})}closeSelectMode(){this.selectMode=!1,this.selectedRows=[]}toggleSelectMode(){this.selectMode=!this.selectMode,this.selectMode||(this.selectedRows=[])}static \u0275fac=function(r){return new(r||n)(e.rXU(rn.nX),e.rXU(_t.a),e.rXU(Ri.aZ),e.rXU(be.bg))};static \u0275cmp=e.VBU({type:n,selectors:[["app-list-view"]],standalone:!1,decls:13,vars:7,consts:[["selectAllCheckbox",""],["selectCheckbox",""],[1,"flex","flex-column","flex-grow-1","shadow-none","border-none","h-full"],[1,"flex","align-items-center","justify-content-between","gap-2","mb-3","p-2"],[1,"flex","align-items-center","gap-2"],[1,"flex","align-items-center","justify-content-center","border-round-2xl","bg-primary-50","hover:bg-primary-100","cursor-pointer","w-2rem","h-2rem",3,"click"],[1,"pi","pi-arrow-left","text-primary"],[1,"m-0","capitalize"],[4,"ngIf"],["class","flex align-items-center gap-3\n border-1
1surface-border border-round-lg\n px-3 py-2 mb-3",4,"ngIf"],["dataKey","Id","responsiveLayout","scroll",1,"p-datatable-sm",3,"selectionChange","value","paginator","selection","rows"],["pTemplate","header"],["pTemplate","body"],["pTemplate","emptymessage"],["pButton","","pRipple","","icon","pi pi-check-square","label","Select",1,"p-button-sm","p-button-outlined","p-button-secondary",3,"click"],[1,"flex","align-items-center","gap-3","border-1","surface-border","border-round-lg","px-3","py-2","mb-3"],["pButton","","pRipple","","icon","pi pi-times",1,"p-button-text","p-button-plain","p-button-sm",3,"click"],[1,"font-medium"],["pButton","","pRipple","","icon","pi pi-undo","label","Restore",1,"p-button-outlined","p-button-sm",3,"click","disabled"],["pButton","","pRipple","","icon","pi pi-trash","label","Delete",1,"p-button-danger","p-button-outlined","p-button-sm",3,"click","disabled"],[1,"text-center",2,"width","60px"],[4,"ngIf","ngIfElse"],[4,"ngFor","ngForOf"],[1,"cursor-pointer"],[1,"text-center","font-medium",2,"width","60px"],[3,"value"],[3,"ngSwitch"],[4,"ngSwitchCase"],[4,"ngSwitchDefault"],[1,"flex","flex-column","gap-1"],[1,"deal-name"],[1,"p-tag","p-tag-sm","priority-badge",3,"ngStyle"],["styleClass","p-avatar-sm","shape","circle",3,"label"],[1,"assigned-user-name"],[1,"status-badge",3,"ngClass"],[1,"flex","gap-2"],["pButton","","pRipple","","icon","pi pi-undo","pTooltip","Restore to active deals","tooltipPosition","top",1,"p-button-rounded","p-button-text","p-button-secondary",3,"click"],["pButton","","pRipple","","icon","pi pi-trash","pTooltip","Delete permanently","tooltipPosition","top",1,"p-button-rounded","p-button-text","p-button-danger",3,"click"],[1,"text-center","p-4"]],template:function(r,i){1&r&&(e.j41(0,"p-card",2)(1,"div",3)(2,"div",4)(3,"div",5),e.bIt("click",function(){return i.goBack()}),e.nrm(4,"i",6),e.k0s(),e.j41(5,"h3",7),e.EFF(6),e.k0s()(),e.DNE(7,Rb,2,0,"div",8),e.k0s(),e.DNE(8,jb,6,3,"div",9),e.j41(9,"p-table",10),e.mxI("selectionChange",function(o){return e.DH7(i.selectedRows,o)||(i.selectedRows=o),o}),e.DNE(10,Ob,6,3,"ng-template",11)(11,Jb,6,3,"ng-template",12)(12,Kb,3,1,"ng-template",13),e.k0s()()),2&r&&(e.R7$(6),e.SpI(" ","funnel-stage"===i.viewType?(null==i.track?null:i.track.Title)||"Funnel Deals":"active"===i.viewType?"Active Opportunities":"loss-reasons"===i.viewType?"Loss Reasons":"won"===i.viewType?"Won Deals":"lost"===i.viewType?"Lost Deals":"archived"===i.viewType?"Archived Deals":"Closed Opportunities"," "),e.R7$(),e.Y8G("ngIf","archived"===i.viewType&&!i.selectMode),e.R7$(),e.Y8G("ngIf",i.selectMode),e.R7$(),e.Y8G("value",i.rows)("paginator",!0),e.R50("selection",i.selectedRows),e.Y8G("rows",10))},dependencies:[q.YU,q.Sq,q.bT,q.B3,q.ux,q.e1,q.fG,At.Zp,be.Ei,wt.m_,Se.XI,Se.S9,Se.nA,zn.eu,xe._f,q.QX,q.oe,q.vh],styles:[".p-avatar-sm[_ngcontent-%COMP%]{width:25px;height:25px;font-size:.75rem;color:#5a96f7;background-color:#e6effd}.assigned-user-name[_ngcontent-%COMP%]{font-size:.875rem;color:#6f7a8d}.deal-name[_ngcontent-%COMP%]{color:#2b2e36;font-size:.95rem}.priority-badge[_ngcontent-%COMP%]{border-radius:12px;padding:.1rem .5rem;font-size:.75rem;font-weight:500;display:inline-block}[_nghost-%COMP%] .p-card-body{padding:3px}.status-badge[_ngcontent-%COMP%]{padding:.25rem .6rem;border-radius:12px;font-weight:600;font-size:.75rem;text-transform:uppercase}.status-won[_ngcontent-%COMP%]{background-color:#e6f4ea;color:#2e7d32}.status-lost[_ngcontent-%COMP%]{background-color:#fdecea;color:#c62828}.back-btn[_ngcontent-%COMP%]{background-color:#e3f2fd!important;color:#1e88e5!important;border-radius:50%;width:2.4rem;height:2.4rem;padding:0;border:none}.back-btn[_ngcontent-%COMP%]:hover{background-color:#1e88e5!important;color:#fff!important}"]})}return n})();var aa=ee(8812),Zb=ee(22806),eC=ee(70274),tC=ee(64058),nC=ee(96354);const rC=n=>({"bg-blue-50":n}),iC=(n,a)=>({"bg-blue-600 border-blue-600":n,"bg-white":a});function aC(n,a){1&n&&e.nrm(0,"i",7)}function sC(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",2),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG();return e.Njj(s.onCategoryToggle(i))}),e.j41(1,"div",3),e.DNE(2,aC,1,0,"i",4),e.k0s(),e.j41(3,"div",0)(4,"span",5),e.EFF(5),e.k0s(),e.j41(6,"span",6),e.EFF(7),e.k0s()()()}if(2&n){const t=a.$implicit,r=e.XpG();e.Y8G("ngClass",e.eq3(5,rC,r.isSelected(t))),e.R7$(),e.Y8G("ngClass",e.l_i(7,iC,r.isSelected(t),!r.isSelected(t))),e.R7$(),e.Y8G("ngIf",r.isSelected(t)),e.R7$(3),e.SpI(" ",t.Name," "),e.R7$(2),e.SpI(" ",t.Description," ")}}let oC=(()=>{class n{teamsService;tenderService;industries=[];selectedIndustryIds=[];loadingIds=new Set;constructor(t,r){this.teamsService=t,this.tenderService=r}ngOnInit(){this.tenderService.industries$.subscribe(t=>{this.industries=t.map(r=>({Id:r.Id,Name:r.Name,GroupId:r.GroupId,CategoryGroup:r.CategoryGroup,Description:r.Description,BelongsToUser:r.BelongsToUser})).sort((r,i)=>
1r.Name.localeCompare(i.Name))})}onCategoryToggle(t){this.loadingIds.has(t.Id)||(this.loadingIds.add(t.Id),(t.BelongsToUser?this.tenderService.removeUserBusinessCategory(t.Id):this.tenderService.addUserBusinessCategory(t.Id)).subscribe({next:()=>{const i=this.tenderService.industriesSubject.getValue().map(s=>s.Id===t.Id?{...s,BelongsToUser:!s.BelongsToUser}:s);this.tenderService.setIndustries(i)},error:i=>console.error(i),complete:()=>this.loadingIds.delete(t.Id)}))}isSelected(t){return t.BelongsToUser}getIcon(t){const r=t.toLowerCase();return r.includes("engineering")||r.includes("chemical")?"pi-cog":r.includes("construction")?"pi-building":r.includes("health")?"pi-heart":r.includes("finance")||r.includes("bank")?"pi-wallet":r.includes("legal")?"pi-briefcase":r.includes("transport")||r.includes("logistics")?"pi-truck":r.includes("it")||r.includes("technology")?"pi-desktop":r.includes("agriculture")?"pi-globe":r.includes("education")||r.includes("training")?"pi-book":r.includes("manufacturing")?"pi-industry":r.includes("mining")?"pi-chart-bar":r.includes("medical")?"pi-heart-fill":r.includes("call")||r.includes("Consultancy")?"pi-phone":r.includes("admin")?"pi-folder-open":"pi-sitemap"}static \u0275fac=function(r){return new(r||n)(e.rXU(rt.n),e.rXU(Qs))};static \u0275cmp=e.VBU({type:n,selectors:[["app-tender-preferences"]],standalone:!1,decls:2,vars:1,consts:[[1,"flex","flex-column"],["class","flex align-items-start gap-3 px-3 py-2 cursor-pointer transition-colors transition-duration-150","style","border-bottom: 1px solid #efefef;",3,"ngClass","click",4,"ngFor","ngForOf"],[1,"flex","align-items-start","gap-3","px-3","py-2","cursor-pointer","transition-colors","transition-duration-150",2,"border-bottom","1px solid #efefef",3,"click","ngClass"],[1,"flex-none","flex","align-items-center","justify-content-center","border-1","border-300","border-round","mt-1",2,"width","20px","height","20px",3,"ngClass"],["class","pi pi-check text-white","style","font-size: 0.7rem",4,"ngIf"],[1,"text-800","font-bold","text-sm","line-height-2"],[1,"text-500","text-xs","line-height-2"],[1,"pi","pi-check","text-white",2,"font-size","0.7rem"]],template:function(r,i){1&r&&(e.j41(0,"div",0),e.DNE(1,sC,8,10,"div",1),e.k0s()),2&r&&(e.R7$(),e.Y8G("ngForOf",i.industries))},dependencies:[q.YU,q.Sq,q.bT],styles:[".cursor-pointer[_ngcontent-%COMP%]:hover{background-color:var(--surface-100)}.bg-blue-50[_ngcontent-%COMP%]:hover{background-color:#eff6ff!important}"]})}return n})();var gc=ee(37164),co=ee(20935);const lC=()=>({width:"720px"}),cC=()=>({width:"28rem"}),dC=()=>[1,2,3,4,5,6];function pC(n,a){1&n&&e.nrm(0,"app-lockfeatures")}function uC(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",29),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.clearSearch())}),e.k0s()}}function fC(n,a){if(1&n&&(e.qex(0),e.j41(1,"span",30),e.EFF(2),e.k0s(),e.EFF(3," tenders filtered based on your selected industries. "),e.bVm()),2&n){const t=e.XpG(2);e.R7$(2),e.JRh(t.filteredRecords)}}function mC(n,a){1&n&&e.EFF(0," Select your industry preferences to see tenders tailored for you. ")}function hC(n,a){if(1&n&&(e.j41(0,"div",47),e.nrm(1,"i",48),e.EFF(2),e.k0s()),2&n){const t=e.XpG().$implicit;e.R7$(2),e.SpI(" ",null==t?null:t.TenderIssuer," ")}}function gC(n,a){if(1&n&&(e.j41(0,"div",47),e.nrm(1,"i",49),e.EFF(2),e.k0s()),2&n){const t=e.XpG().$implicit,r=e.XpG(2);e.R7$(2),e.SpI(" ",r.getTenderTypeLabel(null==t?null:t.TenderType)," ")}}function _C(n,a){if(1&n&&(e.j41(0,"div",50),e.nrm(1,"i",51),e.EFF(2),e.k0s()),2&n){const t=e.XpG().$implicit;e.R7$(2),e.SpI(" ",null==t?null:t.PlaceOfService," ")}}function xC(n,a){1&n&&(e.j41(0,"span",52),e.EFF(1," Expired "),e.k0s())}function vC(n,a){if(1&n&&(e.j41(0,"span",52),e.EFF(1),e.k0s()),2&n){const t=e.XpG().$implicit,r=e.XpG(2);e.R7$(),e.SpI(" ",r.daysLeft(null==t?null:t.DateClosingUtc),"d left ")}}function bC(n,a){if(1&n&&(e.j41(0,"span",53),e.EFF(1),e.nI1(2,"date"),e.k0s()),2&n){const t=e.XpG().$implicit;e.R7$(),e.SpI(" ",e.i5U(2,1,null==t?null:t.DateClosingUtc,"dd MMM yyyy")," ")}}function CC(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",54),e.bIt("click",function(){e.eBV(t);const i=e.XpG().$implicit,s=e.XpG(2);return e.Njj(s.downloadTenderDocument(i))}),e.k0s()}if(2&n){const t=e.XpG(3);e.Y8G("loading",t.isDownloading)("disabled",t.isDownloading)}}function kC(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",12)(1,"div",31)(2,"div",32)(3,"div",33)(4,"span",34),e.EFF(5),e.k0s(),e.j41(6,"span",34),e.EFF(7),e.k0s(),e.j41(8,"span",34),e.EFF(9),e.k0s()(),e.j41(10,"div",35),e.EFF(11),e.nI1(12,"slice"),e.k0s(),e.DNE(13,hC,3,1,"div",36)(14,gC,3,1,"div",36)(15,_C,3,1,"div",37),e.j41(16,"div",38)(17,"span",39),e.nrm(18,"i",40),e.EFF(19," Closes: "),e.k0s(),e.DNE(20,xC,2,0,"span",41)(21,vC,2,1,"span",41)(22,bC,3,4,"span",42),e.k0s()(),e.j41(23,"div",43)(24,"button",44),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG(2);return e.Njj(s.openTender(i))}),e.k0s(),e.DNE(25,CC,1,2,"button",45),e.j41(26,"button",46),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG(2);return e.Njj(s.createNewLead(i))}),e.k0s()()()()}if(2&n){const t=a.$implicit,r=e.XpG(2);e.R7$(4),e.xc7("background",r.getTagColor(null==t?null:t.Province))("color",r.getTagTextColor(null==t?null:t.Province)),e.R7$(),e.SpI(" ",null==t?null:t.Province," "),e.R7$(),e.xc7("background",r.getTagColor(null==t?null:t.BusinessCategory))("color",r.getTagTextColor(null==t?null:t.BusinessCategory)),e.R7$(),e.SpI(" ",null==t?null:t.BusinessCategory," "),e.R7$(),e.xc7("background",r.getTagColor(null==t?null:t.TenderType))("color",r.getTagTextColor(null==t?null:t.TenderType)),e.R7$(),e.SpI(" ",r.getTenderTypeLabel(null==t?null:t.TenderType)," "),e.R7$(2),e.SpI(" ",(null==t||null==t.Description?null:t.Description.length)>
1200?e.brH(12,23,null==t?null:t.Description,0,200)+"...":null==t?null:t.Description," "),e.R7$(2),e.Y8G("ngIf",null==t?null:t.TenderIssuer),e.R7$(),e.Y8G("ngIf",null!=(null==t?null:t.TenderType)),e.R7$(),e.Y8G("ngIf",null==t?null:t.PlaceOfService),e.R7$(5),e.Y8G("ngIf",null==t?null:t.Expired),e.R7$(),e.Y8G("ngIf",!(null!=t&&t.Expired)&&r.daysLeft(null==t?null:t.DateClosingUtc)<=3),e.R7$(),e.Y8G("ngIf",!(null!=t&&t.Expired)&&r.daysLeft(null==t?null:t.DateClosingUtc)>3),e.R7$(3),e.Y8G("ngIf",null==t?null:t.HasTenderDocument)}}function TC(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",10)(1,"div",11)(2,"div",12)(3,"div",13)(4,"div",14),e.DNE(5,uC,1,0,"button",15),e.j41(6,"input",16),e.mxI("ngModelChange",function(i){e.eBV(t);const s=e.XpG();return e.DH7(s.search,i)||(s.search=i),e.Njj(i)}),e.bIt("keydown.enter",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onSearchChange())}),e.k0s(),e.j41(7,"span",17),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onSearchChange())}),e.nrm(8,"i",18),e.k0s()()()(),e.j41(9,"div",19),e.DNE(10,fC,4,1,"ng-container",20)(11,mC,1,0,"ng-template",null,0,e.C5r),e.j41(13,"button",21),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.showPreference=!0)}),e.nrm(14,"i",22),e.k0s()(),e.j41(15,"div",23),e.nrm(16,"p-tag",24),e.k0s()(),e.j41(17,"div",25),e.DNE(18,kC,27,27,"div",26),e.k0s(),e.j41(19,"div",27)(20,"p-paginator",28),e.bIt("onPageChange",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.onPageChange(i))}),e.k0s()()()}if(2&n){const t=e.sdS(12),r=e.XpG();e.R7$(5),e.Y8G("ngIf",r.search),e.R7$(),e.R50("ngModel",r.search),e.R7$(4),e.Y8G("ngIf",(null==r.selectedIndustryIds?null:r.selectedIndustryIds.length)>0)("ngIfElse",t),e.R7$(6),e.Y8G("value",r.totalRecords+" Available")("rounded",!0),e.R7$(2),e.Y8G("ngForOf",r.tenders),e.R7$(2),e.Y8G("rows",r.rows)("totalRecords",r.filteredRecords)("first",r.first)}}function wC(n,a){1&n&&(e.j41(0,"div",12)(1,"div",31)(2,"div",32)(3,"div",33),e.nrm(4,"p-skeleton",55)(5,"p-skeleton",56)(6,"p-skeleton",57),e.k0s(),e.j41(7,"div",58),e.nrm(8,"p-skeleton",59)(9,"p-skeleton",60)(10,"p-skeleton",61),e.k0s(),e.j41(11,"div",47),e.nrm(12,"i",48)(13,"p-skeleton",62),e.k0s(),e.j41(14,"div",47),e.nrm(15,"i",49)(16,"p-skeleton",63),e.k0s(),e.j41(17,"div",50),e.nrm(18,"i",51)(19,"p-skeleton",64),e.k0s(),e.j41(20,"div",38)(21,"span",39),e.nrm(22,"i",40)(23,"p-skeleton",65),e.k0s()()(),e.j41(24,"div",66),e.nrm(25,"p-skeleton",67)(26,"p-skeleton",67)(27,"p-skeleton",67),e.k0s()()())}function yC(n,a){1&n&&(e.j41(0,"div",25),e.DNE(1,wC,28,0,"div",26),e.k0s()),2&n&&(e.R7$(),e.Y8G("ngForOf",e.lJ4(1,dC)))}function FC(n,a){1&n&&(e.j41(0,"div")(1,"div",93),e.nrm(2,"i",94),e.j41(3,"span",81),e.EFF(4,"No Tender Documents Provided"),e.k0s()(),e.j41(5,"div",82),e.EFF(6," This tender has no Tender Documents or pdfs to download "),e.k0s()())}function SC(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",95),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.downloadTenderDocument(i.selectedTender))}),e.k0s()}}function EC(n,a){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"div",33)(2,"span",68),e.EFF(3),e.k0s(),e.j41(4,"span",68),e.EFF(5),e.k0s(),e.j41(6,"span",68),e.EFF(7),e.k0s()(),e.j41(8,"div",69),e.EFF(9),e.nI1(10,"slice"),e.k0s(),e.j41(11,"div",25)(12,"div",70),e.nrm(13,"i",71),e.j41(14,"div")(15,"div",72),e.EFF(16,"Issuer"),e.k0s(),e.j41(17,"div",73),e.EFF(18),e.k0s()()(),e.j41(19,"div",70),e.nrm(20,"i",74),e.j41(21,"div")(22,"div",72),e.EFF(23,"Closing Date"),e.k0s(),e.j41(24,"div",75),e.EFF(25),e.nI1(26,"date"),e.k0s()()(),e.j41(27,"div",76),e.nrm(28,"i",77),e.j41(29,"div")(30,"div",72),e.EFF(31,"Place of Service"),e.k0s(),e.j41(32,"div",73),e.EFF(33),e.k0s()()(),e.j41(34,"div",76),e.nrm(35,"i",78),e.j41(36,"div")(37,"div",72),e.EFF(38,"Date Advertised"),e.k0s(),e.j41(39,"div",73),e.EFF(40),e.nI1(41,"date"),e.k0s()()()(),e.nrm(42,"p-divider"),e.j41(43,"div")(44,"div",79),e.nrm(45,"i",80),e.j41(46,"span",81),e.EFF(47,"Special Conditions"),e.k0s()(),e.j41(48,"div",82),e.EFF(49),e.k0s()(),e.DNE(50,FC,7,0,"div",4),e.nrm(51,"p-divider"),e.j41(52,"div")(53,"div",83),e.EFF(54,"Contact Information"),e.k0s(),e.j41(55,"div",84)(56,"div",85),e.nrm(57,"i",86),e.j41(58,"span"),e.EFF(59),e.k0s()(),e.j41(60,"div",85),e.nrm(61,"i",87),e.j41(62,"a",88),e.EFF(63),e.k0s()(),e.j41(64,"div",85),e.nrm(65,"i",89),e.j41(66,"span"),e.EFF(67),e.k0s()()(),e.j41(68,"div",90),e.DNE(69,SC,1,0,"button",91),e.j41(70,"button",92),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.createNewLead(i.selectedTender))}),e.k0s()()(),e.bVm()}if(2&n){const t=e.XpG();e.R7$(2),e.xc7("background",t.getTagColor(t.selectedTender.Province))("color",t.getTagTextColor(t.selectedTender.Province)),e.R7$(),e.SpI(" ",t.selectedTender.Province," "),e.R7$(),e.xc7("background",t.getTagColor(t.selectedTender.BusinessCategory))("color",t.getTagTextColor(t.selectedTender.BusinessCategory)),e.R7$(),e.SpI(" ",t.selectedTender.BusinessCategory," "),e.R7$(),e.xc7("background",t.getTagColor(t.selectedTender.TenderType))("color",t.getTagTextColor(t.selectedTender.TenderType)),e.R7$(),e.SpI(" ",t.getTenderTypeLabel(t.selectedTender.TenderType)," "),e.R7$(2),e.SpI(" ",(null==t.selectedTender||null==t.selectedTender.De
1scription?null:t.selectedTender.Description.length)>400?e.brH(10,26,t.selectedTender.Description,0,400)+"...":null==t.selectedTender?null:t.selectedTender.Description," "),e.R7$(9),e.JRh(t.selectedTender.TenderIssuer),e.R7$(7),e.SpI(" ",e.i5U(26,30,t.selectedTender.DateClosingUtc,"dd MMMM yyyy")," "),e.R7$(8),e.SpI(" ",t.selectedTender.PlaceOfService," "),e.R7$(7),e.SpI(" ",e.i5U(41,33,t.selectedTender.DateAdvertisedUtc,"dd MMMM yyyy")," "),e.R7$(9),e.SpI(" ",t.selectedTender.SpecialConditions?t.selectedTender.SpecialConditions:"None"," "),e.R7$(),e.Y8G("ngIf",!(null!=t.selectedTender&&t.selectedTender.HasTenderDocument)),e.R7$(9),e.JRh(t.selectedTender.ContactPerson),e.R7$(4),e.SpI(" ",t.selectedTender.ContactEmail," "),e.R7$(4),e.JRh(t.selectedTender.ContactNumber),e.R7$(2),e.Y8G("ngIf",null==t.selectedTender?null:t.selectedTender.HasTenderDocument)}}function IC(n,a){1&n&&(e.j41(0,"div",96)(1,"h2",97),e.EFF(2,"Tender Preferences"),e.k0s(),e.j41(3,"p",98),e.EFF(4," Select the categories you're interested in receiving tender notifications for "),e.k0s()())}function DC(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",85)(1,"button",99),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.savePreferences())}),e.k0s()()}}let RC=(()=>{class n{teamsService;auth;tenderService;messageService;_boardService;router;tenders=[];filteredTenders=[];colors=at.Tj;selectedTender;showTenderModal=!1;industries=[];currentUserId="";loadState=aa.n.LOADING;LOAD_STATE=aa.n;page=0;rows=20;first=0;globalFilter="";totalRecords=0;filteredRecords=0;totalTendersAvailable=0;search="";searchTimeout;upgradeRequired=!1;selectedIndustryIds=[];selectedProvince=null;selectedCategory=null;selectedType=null;showPreference=!1;hasTenderDocument;expiredFilter=!1;isDownloading=!1;tenderTypes=[];selectedTenderType=null;categories=[];createDeal=new e.bkB;constructor(t,r,i,s,o,l){this.teamsService=t,this.auth=r,this.tenderService=i,this.messageService=s,this._boardService=o,this.router=l}ngOnInit(){this.loadIndustries()}loadTenders(){this.loadState=aa.n.LOADING;const t={First:this.page*this.rows,Rows:this.rows,GlobalFilter:this.search||null,Filters:{},SortField:"",SortOrder:1};this.search&&(t.GlobalFilter=this.search),this.selectedProvince&&(t.Filters.Province={Value:this.selectedProvince,MatchMode:"contains"}),this.selectedTenderType&&(t.Filters.TenderType={Value:this.selectedTenderType,MatchMode:"contains"}),this.selectedIndustryIds?.length>0&&(t.Filters.BusinessCategories={Value:this.selectedIndustryIds.join(","),MatchMode:"in"}),null!==this.hasTenderDocument&&(t.Filters.HasTenderDocument={Value:String(!this.hasTenderDocument),MatchMode:"equals"}),null!==this.expiredFilter&&(t.Filters.Expired={Value:String(this.expiredFilter),MatchMode:"equals"}),this.tenderService.searchTenders(t).subscribe({next:r=>{this.tenders=r.Data,this.filteredRecords=r.FilteredRecords,this.totalRecords=r.TotalRecords,this.loadState=aa.n.LOADED},error:r=>{402===r.status?this.upgradeRequired=!0:this.messageService.add({severity:"error",summary:"Error",detail:r.error}),this.loadState=aa.n.ERROR}})}loadIndustries(){this.tenderService.loadIndustries().subscribe({next:t=>{const r=t.map(i=>({Id:i.Id,Name:i.Name,GroupId:i.GroupId,CategoryGroup:i.CategoryGroup,Description:i.Description,BelongsToUser:i.BelongsToUser})).sort((i,s)=>i.Name.localeCompare(s.Name));this.tenderService.setIndustries(r),this.selectedIndustryIds=this.tenderService.selectedIndustryIds,this.loadTenders()},error:t=>console.error("Failed to load industries",t)})}onPageChange(t){this.first=t.first,this.page=t.page,this.rows=t.rows,this.loadTenders(),window.scrollTo({top:0,behavior:"smooth"})}daysLeft(t){const i=new Date(t).getTime()-(new Date).getTime();return Math.ceil(i/864e5)}getTagColor(t){const r=Math.abs(this.hashString(t))%at.Tj.length;return at.Tj[r].light}getTagTextColor(t){const r=Math.abs(this.hashString(t))%at.Tj.length;return at.Tj[r].dark}hashString(t){let r=0;for(let i=0;i<t.length;i++)r=t.charCodeAt(i)+((r<<5)-r);return r}openTender(t){this.selectedTender=t,this.showTenderModal=!0}closeTender(){this.showTenderModal=!1,this.selectedTender=null}downloadTenderDocument(t){this.isDownloading=!0,this.tenderService.downloadTender(t.Id).subscribe({next:r=>{const s=r.headers.get("content-disposition").split('filename="')[1]?.replace('"',""),o=document.createElement("a"),l=URL.createObjectURL(r.body);o.href=l,o.download=s,o.click(),URL.revokeObjectURL(l),this.messageService.add({severity:"success",summary:"Download Complete",detail:"file downloaded successfully"}),this.isDownloading=!1},error:r=>{console.error("Download failed",r),this.messageService.add({severity:"error",summary:"Download Failed",detail
1:"Failed to download file"}),this.isDownloading=!1}})}getTenderTypeLabel(t){return 4===t||"4"===t?"RFB":String(t??"")}onSearchChange(){clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.page=0,this.loadTenders()},400)}clearSearch(){this.search="",this.search=null,this.page=0,this.loadTenders()}get hasChanges(){return this.tenderService.hasChanges}openPreferences(){this.tenderService.snapshotIndustries(),this.showPreference=!0}savePreferences(){this.showPreference=!1,this.tenderService.hasChanges&&(this.selectedIndustryIds=this.tenderService.selectedIndustryIds,this.loadTenders(),this.tenderService.snapshotIndustries())}createNewLead(t){const r=this.buildTenderTicket(t),i=this.getFirstTrack();i&&(this.createDealFromTender(r,i),this.batchUpdatePositionInTrack(i))}buildTenderTicket(t){return{title:t.Description?.length>25?t.Description.slice(0,25)+"...":t.Description,tenderId:t.Id,dueDateUtc:t.DateClosingUtc,assignee:[this.auth.getUserId()],cardTypeId:J.bU.Tender,order:1}}getFirstTrack(){const t=this._boardService.getCurrentTracks;return t&&0!==t.length?t[0]:(this.messageService.add({severity:"warn",summary:"No Tracks Found",detail:"There are no tracks to add this tender to",life:3e3}),null)}createDealFromTender(t,r){r.Cards?.some(o=>o.TenderId===t.tenderId)?this.messageService.add({severity:"warn",summary:"Already Exists",detail:"A lead for this tender already exists",life:3e3}):this._boardService.createCard(t,r.Id,r.Cards?.length||0).pipe((0,mc.n)(o=>{const l=this.getDefaultTenderChecklist(o.Id);return(0,Zb.H)(l).pipe((0,eC.H)(c=>this._boardService.createChecklistItem(c)),(0,tC.$)(),(0,nC.T)(()=>o))})).subscribe({next:o=>{this.messageService.add({severity:"success",summary:"Lead Created",detail:`Lead created from tender "${o.Title}"`,life:3e3}),this.router.navigate(["/dashboard/sales/sales-tracker"])},error:()=>{this.messageService.add({severity:"error",summary:"Error",detail:"Failed to create lead from tender",life:3e3})}})}batchUpdatePositionInTrack(t){const r=[...t.Cards];this._boardService.changeTicketPositionInTrack(r,()=>{})}getDefaultTenderChecklist(t){const r=this.auth.getUserId();return[{Name:"Download tender documents",Completed:!1,CompletedByUserId:r,cardId:t},{Name:"Review eligibility & requirements",Completed:!1,CompletedByUserId:r,cardId:t},{Name:"Attend briefing session (if required)",Completed:!1,CompletedByUserId:r,cardId:t},{Name:"Prepare compliance documents (CSD, Tax, BBBEE)",Completed:!1,CompletedByUserId:r,cardId:t},{Name:"Prepare technical proposal",Completed:!1,CompletedByUserId:r,cardId:t},{Name:"Prepare pricing / BOQ",Completed:!1,CompletedByUserId:r,cardId:t},{Name:"Internal approval & sign-off",Completed:!1,CompletedByUserId:r,cardId:t},{Name:"Submit tender before closing date",Completed:!1,CompletedByUserId:r,cardId:t}]}static \u0275fac=function(r){return new(r||n)(e.rXU(rt.n),e.rXU(jn.u),e.rXU(Qs),e.rXU(be.bg),e.rXU(_t.a),e.rXU(rn.Ix))};static \u0275cmp=e.VBU({type:n,selectors:[["app-tenders"]],outputs:{createDeal:"createDeal"},standalone:!1,decls:11,vars:16,consts:[["noPrefs",""],["class","container-fluid",4,"ngIf"],["class","grid",4,"ngIf"],[3,"visibleChange","onHide","visible","modal","dismissableMask","draggable"],[4,"ngIf"],["position","right","styleClass","tender-preferece",3,"visibleChange","onHide","visible","modal"],["pTemplate","header"],[1,"mt-4"],["pTemplate","footer"],["position","top-right"],[1,"container-fluid"],[1,"grid","mb-2","mt-1"],[1,"col-12","md:col-4"],[1,"flex","justify-content-center"],[1,"p-inputgroup","w-full","md:w-30rem"],["type","button","pButton","","icon","pi pi-times","class","p-button-secondary p-button-text",3,"click",4,"ngIf"],["type","text","pInputText","","placeholder","Search for title, tender Number, etc...",2,"font-size","0.75rem !important",3,"ngModelChange","keydown.enter","ngModel"],[1,"p-inputgroup-addon",3,"click"],[1,"pi","pi-search"],[1,"col-12","md:col-6","text-sm","text-500","flex","justify-content-end","align-items-center"],[4,"ngIf","ngIfElse"],["pButton","","type","button","label","Set Preferences",1,"p-button-text","archive-text-btn","active-archive-btn",3,"click"],[1,"pi","pi-sliders-h","ml-2"],[1,"col-12","md:col-2","flex","justify-content-end"],["icon","pi pi-info-circle","severity","info","styleClass"," text-sm p-tag-lg",3,"value","rounded"],[1,"grid"],["class","col-12 md:col-4",4,"ngFor","ngForOf"],[1,"flex","justify-content-center","mt-4"],[3,"onPageChange","rows","totalRecords","first"],["type","button","pButton","","icon","pi pi-times",1,"p-button-secondary","p-button-text",3,"click"],[1,"font-bold","mr-1"],[1,"card","tender-card","h-full","flex","flex-column","justify-content-between"],[1,"p-4"],[1,"flex","gap-2","mb-2","flex-wrap"],[2,"border-radius","12px","font-size","10px","padding","4px 8px","font-weight","500"],[1,"text-sm","mb-2","line-height-3"],["class","text-xs font-light text-600 mb-1 flex align-items-center",4,"ngIf"],["class","text-xs font-light text-600 mb-3 flex align-items-center",4,"ngIf"],[1,"flex","align-items-center","justify-content-between","mb-1"],[1,"text-sm","font-medium","flex","align-items-center","gap-1"],[1,"pi","pi-calendar"],["class","urgency danger",4,"ngIf"],["class","urgency normal",4,"ngIf"],[1,"flex","gap-2","mt-auto","p-2",2,"border-top","1px solid #ccc"],["pButton","","label","View","icon","pi pi-eye",1,"p-button-sm","w-full",3,"click"],["pButton","","label","Download","icon","pi pi-download","class","p-button-sm p-button-outlined w-full",3,"loading","disabled","click",4,"ngIf"],["pButton","","label","Lead","icon","pi pi-user-plus",1,"p-button-sm","w-full",3,"click"],[1,"text-xs","font-light","text-600","mb-1","flex","align-items-center"],[1,"pi","pi-building","mr-2"],[1,"pi","pi-file","mr-2"],[1,"text-xs","font-light","text-600","mb-3","flex","align-items-center"],[1,"pi","pi-map-marker","mr-2"],[1,"urgency","danger"],[1,"urgency","normal"],["pButton","","label","Download","icon","pi pi-download",1,"p-button-sm","p-button-outlined","w-full",3,"click","loading","disabled"],["width","60px","height","20px","styleClass","rounded-pill"],["
1width","80px","height","20px","styleClass","rounded-pill"],["width","70px","height","20px","styleClass","rounded-pill"],[1,"text-sm","mb-2"],["width","100%","height","1rem"],["width","90%","height","1rem",1,"mt-1"],["width","95%","height","1rem",1,"mt-1"],["width","120px","height","0.8rem"],["width","50px","height","0.8rem"],["width","100px","height","0.8rem"],["width","80px","height","0.8rem"],[1,"flex","gap-2","mb-2","flex-wrap","gap-2","mt-auto","p-2",2,"border-top","1px solid #ccc"],["width","100px","height","20px","styleClass","rounded-pill"],[1,"border-round-xl","text-xs","px-2","py-1","font-medium"],[1,"text-xl","font-semibold","mb-4"],[1,"col-6","flex","gap-3"],[1,"pi","pi-building","text-primary"],[1,"text-500","text-sm"],[1,"font-medium"],[1,"pi","pi-clock","text-red-500"],[1,"font-medium","text-red-500"],[1,"col-6","flex","gap-3","mt-3"],[1,"pi","pi-map-marker","text-primary"],[1,"pi","pi-calendar","text-primary"],[1,"flex","align-items-center","gap-2","mb-2"],[1,"pi","pi-exclamation-triangle","text-orange-500"],[1,"font-semibold"],[1,"surface-100","border-round","p-3","text-700"],[1,"font-semibold","mb-2"],[1,"flex","flex-wrap","align-items-center","gap-4"],[1,"flex","align-items-center","gap-2"],[1,"pi","pi-user","text-primary"],[1,"pi","pi-envelope","text-primary"],["href","mailto:[email protected]",1,"text-primary"],[1,"pi","pi-phone","text-primary"],[1,"flex","gap-3","py-2","mt-2"],["pButton","","label","Download","icon","pi pi-external-link","class","p-button-success w-full",3,"click",4,"ngIf"],["pButton","","label","Create Lead","icon","pi pi-user-plus",1,"p-button-success","w-full",3,"click"],[1,"flex","align-items-center","gap-2","mb-2","mt-1"],[1,"pi","pi-info-circle","text-orange-500"],["pButton","","label","Download","icon","pi pi-external-link",1,"p-button-success","w-full",3,"click"],[1,"flex","flex-column","text-start","w-full"],[1,"text-xl","font-bold","mb-1","mt-1"],[1,"text-sm","text-gray-600","m-0"],["pButton","","type","button","label","Save","icon","pi pi-save",1,"p-button-outlined","p-button-sm",3,"click"]],template:function(r,i){1&r&&(e.DNE(0,pC,1,0,"app-lockfeatures")(1,TC,21,10,"div",1)(2,yC,2,2,"div",2),e.j41(3,"p-dialog",3),e.mxI("visibleChange",function(o){return e.DH7(i.showTenderModal,o)||(i.showTenderModal=o),o}),e.bIt("onHide",function(){return i.closeTender()}),e.DNE(4,EC,71,36,"ng-container",4),e.k0s(),e.j41(5,"p-drawer",5),e.mxI("visibleChange",function(o){return e.DH7(i.showPreference,o)||(i.showPreference=o),o}),e.bIt("onHide",function(){return i.showPreference=!1}),e.DNE(6,IC,5,0,"ng-template",6),e.j41(7,"div",7),e.nrm(8,"app-tender-preferences"),e.k0s(),e.DNE(9,DC,2,0,"ng-template",8),e.k0s(),e.nrm(10,"p-toast",9)),2&r&&(e.vxM(i.upgradeRequired?0:-1),e.R7$(),e.Y8G("ngIf",i.loadState===i.LOAD_STATE.LOADED),e.R7$(),e.Y8G("ngIf",i.loadState===i.LOAD_STATE.LOADING),e.R7$(),e.Aen(e.lJ4(14,lC)),e.R50("visible",i.showTenderModal),e.Y8G("modal",!0)("dismissableMask",!0)("draggable",!0),e.R7$(),e.Y8G("ngIf",i.selectedTender),e.R7$(),e.Aen(e.lJ4(15,cC)),e.R50("visible",i.showPreference),e.Y8G("modal",!0))},dependencies:[q.Sq,q.bT,be.Ei,dn.EA,Ce.K,Ie.y8,Qe.Sm,L.me,L.BC,L.vS,jt.lG,xe._f,Ve._s,oC,gc.cG,es.mg,co.vw,q.P9,q.vh],styles:[".tender-card[_ngcontent-%COMP%]{background:#fff;border:1px solid #ccc;border-radius:10px}.tender-card[_ngcontent-%COMP%]:hover{box-shadow:0 8px 22px #00000014;transform:translateY(-2px)}[_nghost-%COMP%] .p-select.custom-select{width:100%}[_nghost-%COMP%] .p-select.custom-select{border:1px solid #cccc!important;font-size:12px!important}[_nghost-%COMP%] .p-select-label.p-placeholder{font-size:12px!important}[_nghost-%COMP%] .p-inputtext{font-size:12px!important;width:100%;height:2rem!important}[_nghost-%COMP%] .p-dialog-header{align-items:flex-start}[_nghost-%COMP%] .p-dialog-header{overflow:visible}[_nghost-%COMP%] .p-inputgroup-addon[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;background:#f8f9fa;color:#6c757d;border:1px solid #ced4da;border-left:0;border-top-right-radius:6px;border-bottom-right-radius:6px;min-width:2.5rem}[_nghost-%COMP%] .p-inputgroup[_ngcontent-%COMP%]{display:flex;align-items:stretch;width:100%}[_nghost-%COMP%] .p-inputgroup[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1 1 auto;border-radius:0;margin:0}.urgency[_ngcontent-%COMP%]{font-size:12px;padding:4px 10px;border-radius:999px;font-weight:600}.urgency.danger[_ngcontent-%COMP%]{background:#fee2e2;color:#b91c1c}.urgency.normal[_ngcontent-%COMP%]{background:#e7f5ee;color:#047857} .tender-preferece .p-drawer-footer{border-top:1px solid #ccc!important} .tender-preferece .p-drawer-content{padding:0!important}.archive-text-btn[_ngcontent-%COMP%]:hover, .archive-text-btn[_ngcontent-%COMP%]:focus{background:transparent!important;color:#2563eb!important}.active-archive-btn[_ngcontent-%COMP%]{color:#2563eb!important;padding:0}"]})}return n})();const jC=(n,a)=>({"text-green-500":n,"text-red-500":a});function AC(n,a){if(1&n&&(e.j41(0,"div",3),e.nrm(1,"i",4),e.j41(2,"span",5),e.EFF(3),e.k0s()()),2&n){const t=e.XpG();e.R7$(3),e.JRh(t.successMessage)}}function MC(n,a){if(1&n){const t=e.RV6();e.j41(0,"p-button",17),e.bIt("onClick",function(){e.eBV(t);const i=e.XpG().$implicit,s=e.XpG(2);return e.Njj(s.handleIntegration(i))}),e.k0s()}if(2&n){const t=e.XpG().$implicit;e.Y8G("label","loading"===t.status?"Connecting...":"Connect")("icon","loading"===t.status?"pi pi-spin pi-spinner":"")("disabled","loading"===t.status)}}function PC(n,a){if(1&n){const t=e.RV6();e.j41(0,"p-button",18),e.bIt("onClick",function(){e.eBV(t);const i=e.XpG().$implicit,s=e.XpG(2);return e.Njj(s.disconnectFacebook(i))}),e.k0s()}}function OC(n,a){if(1&n&&(e.j41(0,"div",2)(1,"div",7)(2,"div",8),e.nrm(3,"img",9),e.k0s(),e.j41(4,"div",10)(5,"div",11)(6,"span",12),e.EFF(7),e.k0s(),e.j41(8,"small",13),e.EFF(9),e.k0s()(),e.j41(10,"small",14),e.EFF(11),e.k0s()()(),e.DNE(12,MC,1,3,"p-button",15)(13,PC,1,0,"p-button",16),e.k0s()),2&n){const t=a.$implicit;e.R7$(3),e.Y8G("src",t.logo,e.B4B)("alt",t.name),e.R7$(4),e.JRh(t.name),e.R7$(),e.Y8G("ngClass",e.l_i(8,jC,t.integrated,!t.integrated)),e.R7$(),e.SpI(" ",t.integrated?"Connected":"Not Connected"," "),e.R7$(2),e.JRh(t.desc),e.R7$(),e.Y8G("ngIf",!t.integrated),e.R7$(),e.Y8G("ngIf",t.integrated)}}function NC(n,a){if(1&n&&e.DNE(0,OC,14,11,"div",6),2&n){const t=e.XpG();e.Y8G("ngForOf",t.integrations)}}let GC=(()=>{class n{router;_boardService;teamsService;messageService;fbService;auth;integrationService;isConnected=!1;teamId;showMetaModal;closeModal=new e.bkB;openPagePicker=new e.bkB;showPermissionDenied=!1;permissionDeniedMessage="";successMessage=null;permissionDenied=new e.bkB;integrations=[{name:"Messenger",type:"messenger",desc:"Connect your Facebook Page to re
1ceive and send messages via Messenger.",logo:"https://upload.wikimedia.org/wikipedia/commons/b/be/Facebook_Messenger_logo_2020.svg",integrated:!1,status:"idle"},{name:"Instagram",type:"instagram",desc:"Link your Instagram Business account to manage DMs from your CRM.",logo:"https://upload.wikimedia.org/wikipedia/commons/e/e7/Instagram_logo_2016.svg",integrated:!1,status:"idle"},{name:"WhatsApp",type:"whatsapp",desc:"Connect your WhatsApp Business number to handle customer chats.",logo:"https://upload.wikimedia.org/wikipedia/commons/6/6b/WhatsApp.svg",integrated:!1,status:"idle"}];constructor(t,r,i,s,o,l,c){this.router=t,this._boardService=r,this.teamsService=i,this.messageService=s,this.fbService=o,this.auth=l,this.integrationService=c}ngOnInit(){this.teamId=this.teamsService.getCurrentTeam.Team.Id,this.integrationService.facebookIntegrations$.subscribe(r=>{const i=r.length>0;this.integrations=this.integrations.map(s=>"messenger"===s.type?{...s,integrated:i}:s)}),this.integrationService.whatsappIntegrations$.subscribe(r=>{const i=r.length>0;this.integrations=this.integrations.map(s=>"whatsapp"===s.type?{...s,integrated:i}:s)}),this.integrationService.instagramIntegrations$.subscribe(r=>{const i=r.length>0;this.integrations=this.integrations.map(s=>"instagram"===s.type?{...s,integrated:i}:s)})}disconnectFacebook(t){const i=this.integrationService.getSelectedPage()?.provider?.toLowerCase();"Messenger"===t.name&&this.auth.disconnectFacebookIntegration(this.teamId).subscribe({next:()=>{this.integrationService.clearFacebookIntegration(),"messenger"===i&&this.integrationService.setSelectedPage(null),this.messageService.add({severity:"success",summary:"Disconnected",detail:"Facebook integration removed successfully"})},error:s=>{console.error("Disconnect failed",s),this.messageService.add({severity:"error",summary:"Error",detail:"Failed to disconnect Facebook integration"})}}),"WhatsApp"===t.name&&this.auth.disconnectWhatsApp(this.teamId).subscribe({next:()=>{this.integrationService.clearwhatsAppIntegration(),"whatsapp"===i&&this.integrationService.setSelectedPage(null),this.messageService.add({severity:"success",summary:"Disconnected",detail:"WhatsApp Business integration removed successfully."})},error:s=>{console.error("WhatsApp disconnect failed:",s),this.messageService.add({severity:"error",summary:"Error",detail:"Deskflo couldn't remove WhatsApp integration. Please try again."})}}),"Instagram"===t.name&&this.auth.disconnectInstagram(this.teamId).subscribe({next:()=>{this.integrationService.clearInstagramIntegration(),"instagram"===i&&this.integrationService.setSelectedPage(null),this.messageService.add({severity:"success",summary:"Disconnected",detail:"Instagram integration removed successfully"})},error:s=>{console.error("Disconnect failed",s),this.messageService.add({severity:"error",summary:"Error",detail:"Failed to disconnect Instagram integration"})}})}handleIntegration(t){var r=this;return(0,nt.A)(function*(){if(["Messenger","WhatsApp","Instagram"].includes(t.name)){t.status="loading",r.successMessage=null;try{switch(t.name){case"WhatsApp":yield r.handleWhatsAppOnboarding(t);break;case"Messenger":yield r.handleMessengerOnboarding(t);break;case"Instagram":yield r.handleInstagramOnboarding(t)}}catch(s){r.handleIntegrationError(t,s)}}})()}handleInstagramOnboarding(t){var r=this;return(0,nt.A)(function*(){const i=yield r.fbService.loginWithFacebook();if(!i||!i.accessToken)return t.status="idle",void r.permissionDenied.emit({message:"Instagram login setup was cancelled."});const s=yield r.fbService.getGrantedPermissions(i.accessToken),l=["pages_show_list","instagram_basic","instagram_manage_messages","business_management"].filter(p=>!s.includes(p));if(l.length)return t.status="idle",void r.permissionDenied.emit({message:"We can't proceed with Instagram integration. You denied required permissions.",permissions:l});const d=((yield r.fbService.getPages(i.accessToken))?.filter(p=>p.instagram_business_account)||[]).map(p=>({...p,displayName:p.instagram_business_account.username,displayAvatar:p.instagram_business_account.profile_picture_url,displayId:p.instagram_business_account.id,linkedPageName:p.name}));if(!d.length)return t.status="idle",void r.permissionDenied.emit
1({message:"No linked Instagram Business Accounts found. Please ensure your Instagram Professional account is linked to your Facebook Page inside the Meta Business Suite.",helpLink:"https://www.facebook.com/settings?tab=business_tools"});t.status="success",t.integrated=!0,r.openPagePicker.emit({pages:d,channel:"instagram",userToken:i.accessToken})})()}handleWhatsAppOnboarding(t){var r=this;return(0,nt.A)(function*(){const i=yield r.fbService.loginWithWhatsApp();if(!i||!i.authorizationCode)return t.status="idle",void r.permissionDenied.emit({message:"WhatsApp onboarding setup was cancelled."});const s=r.teamId;r.fbService.getWhatsAppLongLivedToken(i.authorizationCode).subscribe({next:o=>{i.authorizationCode=o.AccessToken,r.auth.connectWhatsAppChannel(s,{AuthorizationCode:o.AccessToken,PhoneNumberId:i.phoneNumberId,WabaId:i.wabaId}).subscribe({next:c=>{t.status="success",t.integrated=!0,r.successMessage="WhatsApp Business Account successfully linked!",r.integrationService.whatsappIntegrations.next([...r.integrationService.whatsappIntegrations.value||[],{PhoneNumberId:i.phoneNumberId,Token:o.AccessToken,provider:"whatsapp"}])},error:c=>{console.error("C# API error during channel onboarding:",c),t.status="idle",r.permissionDenied.emit({message:"Deskflo couldn't register the WhatsApp channel."})}})},error:o=>{console.error("Failed to exchange short-lived code:",o),t.status="idle",r.permissionDenied.emit({message:"Failed to generate Meta secure credentials."})}})})()}handleMessengerOnboarding(t){var r=this;return(0,nt.A)(function*(){const i=yield r.fbService.loginWithFacebook();if(!i||!i.accessToken)return t.status="idle",void r.permissionDenied.emit({message:"Facebook login was cancelled."});const s=yield r.fbService.getGrantedPermissions(i.accessToken),l=["pages_show_list","pages_messaging","business_management"].filter(d=>!s.includes(d));if(l.length)return t.status="idle",void r.permissionDenied.emit({message:"We can't proceed with Messenger integration. You denied required permissions.",permissions:l});const c=yield r.fbService.getPages(i.accessToken);if(c?.length)t.status="success",t.integrated=!0,r.openPagePicker.emit({pages:c,token:i.accessToken,channel:"messenger"});else{t.status="idle";const p=s.includes("business_management")?'No Pages found. Please ensure you have "Full Control" of the Page in Meta Business Suite.':'It looks like your Page is managed by a Business Portfolio. You need to allow "Business Management" permissions.';r.permissionDenied.emit({message:p,helpLink:"https://www.facebook.com/settings?tab=business_tools",steps:["Open Facebook Settings.","Find Deskflo.","Ensure all Page permissions are checked.","Refresh and try again."]})}})()}handleIntegrationError(t,r){console.error(`${t.name} integration workflow failed`,r),t.status="idle";const i=r?.message?.toLowerCase().includes("cancel")||r?.toString().toLowerCase().includes("cancel");this.permissionDenied.emit({message:i?`${t.name} integration setup was cancelled.`:`We couldn't complete the ${t.name} integration. Please try again.`})}static \u0275fac=function(r){return new(r||n)(e.rXU(rn.Ix),e.rXU(_t.a),e.rXU(rt.n),e.rXU(be.bg),e.rXU(ea.o),e.rXU(jn.u),e.rXU(oi.a))};static \u0275cmp=e.VBU({type:n,selectors:[["app-integartion-modal"]],inputs:{showMetaModal:"showMetaModal"},outputs:{closeModal:"closeModal",openPagePicker:"openPagePicker",permissionDenied:"permissionDenied"},standalone:!1,decls:3,vars:2,consts:[[1,"flex","flex-column","gap-3","py-3"],["class","text-xs flex align-items-center p-3 mb-3 border-round-lg bg-green-50 text-green-700 border-1 border-green-200 shadow-1 animate-fadein",4,"ngIf"],[1,"flex","align-items-center","justify-content-between","p-3","border-1","surface-border","border-round-xl","hover:surface-50","transition-colors","transition-duration-150"],[1,"text-xs","flex","align-items-center","p-3","mb-3","border-round-lg","bg-green-50","text-green-700","border-1","border-green-200","shadow-1","animate-fadein"],[1,"pi","pi-check-circle","mr-2"],[1,"font-medium"],["class","flex align-items-center justify-content-between p-3 border-1 surface-border border-round-xl hover:surface-50 transition-colors transition-duration-150",4,"ngFor","ngForOf"],[1,"flex","align-items-center","gap-3"],[1,"flex","align-items-center","justify-content-center","border-round-lg","surface-100",2,"width","48px","height","48px"],["width","30",3,"src","alt"],[1,"flex","flex-column"],[1,"flex","align-items-center","gap-2"],[1,"font-bold","text-900"],[2,"font-size","0.75rem",3,"ngClass"],[1,"text-600","line-height-3",2,"max-width","280px"],["styleClass","p-button-rounded px-4 font-semibold",3,"label","icon","disabled","onClick",4,"ngIf"],["label","Disconnect","styleClass","p-button-rounded p-button-danger px-3 font-semibold",3,"onClick",4,"ngIf"],["styleClass","p-button-rounded px-4 font-semibold",3,"onClick","label","icon","disabled"],["label","Disconnect","styleClass","p-button-rounded p-button-danger px-3 font-semibold",3,"onClick"]],template:function(r,i){1&r&&(e.j41(0,"div",0),e.DNE(1,AC,4,1,"div",1)(2,NC,1,1,"div",2),e.k0s()),2&r&&(e.R7$(),e.Y8G("ngIf",i.successMessage),e.R7$(),e.vxM(i.successMessage?-1:2))},dependencies:[q.YU,q.Sq,q.bT,xe.$n],encapsulation:2})}return n})();var BC=ee(70980);const LC=n=>({"bg-blue-50":n});function $C(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",7),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG();return e.Njj(s.togglePage(i))}),e.j41(1,"div",8)(2,"div",9),e.nrm(3,"img",10),e.k0s(),e.j41(4,"div",11)(5,"span",2),e.EFF(6),e.k0s(),e.j41(7,"span",12),e.EFF(8),e.k0s()()(),e.j41(9,"p-checkbox",13),e.bIt("onChange",function(){const i=e.eBV(t).$implicit,s=e.XpG();return e.Njj(s.togglePage(i))})("click",function(i){return e.eBV(t),e.Njj(i.stopPropagation())}),e.k0s()()}if(2&n){const t=a.$implicit,r=e.XpG();e.Y8G("ngClass",e.eq3(6,LC,r.isPageSelected(t))),e.R7$(3),e.Y8G("src",t.displayAvatar||(null==t.picture||null==t.picture.data?null:t.picture.data.url),e.B4B),e.R7$(3),e.JRh(t.displayName||t.name),e.R7$(2),e.SpI(" ","instagram"===r.currentChannel?"@"+(t.displayName||t.name):"ID: "+t.id," "),e.R7$(),e.Y8G("binary",!0)("ngModel",r.isPageSelected(t))}}let VC=(()=>{class n{router;integrationService;messageService;constructor(t,r,i){this.router=t,this.integrationService=r,this.messageService=i}selectedPages=[];isAllSelected=!1;isSaving=!1;availablePages=[];userToken;teamId;currentChannel;pagesConnected=new e.bkB;close=new e.bkB;isPageSelected(t){return this.selectedPages.some(r=>r.id===t.id)}togglePage(t){const r=this.selectedPages.findIndex(i=>i.id===t.id);r>-1?this.selectedPages.splice(r,1):this.selectedPages.push(t),this.isAllSelected=this.selectedPages.length===this.availablePages.length}toggleSelectAll(){this.selectedPages=this.isAllSelected?[...this.availablePages]:[]}saveSelectedPages(){if(!this.selectedPages.length)return;this.isSaving=!0;const t=this.selectedPages.map(r=>this.integrationService.connectMetaPage(r,this.teamId,this.currentChannel).pipe((0,Wn.W)(i=>(console.error(`Error processing page ${r.name}:`,i),this.integrationService.clearFacebookIntegration(),this.integrationService.clearInstagramIntegration(),this.messageService.add({severity:"error",summary:"Connection Failed",detail
1:i?.error?.message||`Failed to retrieve token for "${r.name}". Integration cancelled.`,life:5e3}),(0,lt.of)(null)))));(0,or.p)(t).pipe((0,BC.j)(()=>{this.isSaving=!1})).subscribe(r=>{const i=r.filter(s=>null!==s).length;i>0&&(this.messageService.add({severity:"success",summary:"Success",detail:`Successfully connected ${i} channel(s).`,life:3e3}),this.close.emit())})}static \u0275fac=function(r){return new(r||n)(e.rXU(rn.Ix),e.rXU(oi.a),e.rXU(be.bg))};static \u0275cmp=e.VBU({type:n,selectors:[["app-page-picker"]],inputs:{availablePages:"availablePages",userToken:"userToken",teamId:"teamId",currentChannel:"currentChannel"},outputs:{pagesConnected:"pagesConnected",close:"close"},standalone:!1,decls:8,vars:3,consts:[[1,"flex","flex-column","gap-4","pt-2"],[1,"flex","align-items-center","justify-content-between","pb-2"],[1,"font-bold","text-900"],[1,"flex","flex-column","gap-2","overflow-y-auto",2,"max-height","300px"],["class","flex align-items-center justify-content-between p-3 border-round-xl transition-colors select-item",3,"ngClass","click",4,"ngFor","ngForOf"],[1,"flex","align-items-center","justify-content-end","mt-2"],["label","Next","severity","primary","styleClass","px-5",3,"click","loading"],[1,"flex","align-items-center","justify-content-between","p-3","border-round-xl","transition-colors","select-item",3,"click","ngClass"],[1,"flex","align-items-center","gap-3"],[1,"w-3rem","h-3rem","border-round-md","overflow-hidden","bg-gray-200"],["alt","logo",1,"w-full","h-full","object-cover",3,"src"],[1,"flex","flex-column"],[1,"text-xs","text-500"],[3,"onChange","click","binary","ngModel"]],template:function(r,i){1&r&&(e.j41(0,"div",0)(1,"div",1)(2,"span",2),e.EFF(3),e.k0s()(),e.j41(4,"div",3),e.DNE(5,$C,10,8,"div",4),e.k0s(),e.j41(6,"div",5)(7,"p-button",6),e.bIt("click",function(){return i.saveSelectedPages()}),e.k0s()()()),2&r&&(e.R7$(3),e.SpI("All Pages (",i.availablePages.length,")"),e.R7$(2),e.Y8G("ngForOf",i.availablePages),e.R7$(2),e.Y8G("loading",i.isSaving))},dependencies:[q.YU,q.Sq,L.BC,L.vS,xe.$n,Xr.Sc],encapsulation:2})}return n})();const UC=["pagesPopover"],_c=()=>({width:"550px"}),XC=()=>({width:"400px"}),YC=(n,a)=>({"background-color":n,color:a}),WC=n=>({color:n}),HC=()=>({"background-color":"var(--channel-bg-light)","border-color":"var(--channel-bg-light)"}),zC=()=>({color:"var(--channel-primary)"});function qC(n,a){1&n&&(e.j41(0,"div",46)(1,"div",47),e.qSk(),e.j41(2,"svg",48),e.nrm(3,"path",49),e.k0s()(),e.joV(),e.j41(4,"div",50)(5,"span",51),e.EFF(6,"Meta Connection"),e.k0s(),e.j41(7,"span",52),e.EFF(8,"Hub Manager"),e.k0s()()())}function JC(n,a){1&n&&(e.j41(0,"span",53),e.EFF(1,"Channels"),e.k0s())}function KC(n,a){if(1&n&&(e.j41(0,"span",59),e.EFF(1),e.k0s()),2&n){const t=e.XpG().$implicit;e.R7$(),e.JRh(t.name)}}function QC(n,a){1&n&&(e.j41(0,"span",62),e.EFF(1,"Not connected"),e.k0s())}function ZC(n,a){if(1&n&&(e.j41(0,"div",63),e.EFF(1," Connected "),e.k0s()),2&n){const t=e.XpG(2).$implicit,r=e.XpG();e.Y8G("ngStyle",e.eq3(1,WC,r.activeChannelColor===t.type?"var(--channel-primary)":"#16a34a"))}}function e4(n,a){if(1&n&&(e.j41(0,"div"),e.DNE(1,QC,2,0,"span",60)(2,ZC,2,3,"div",61),e.k0s()),2&n){const t=e.XpG().$implicit;e.R7$(),e.Y8G("ngIf",!t.integrated),e.R7$(),e.Y8G("ngIf",t.integrated)}}function t4(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",54),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG();return e.Njj(s.selectChannel(i))}),e.j41(1,"div",55),e.nrm(2,"img",56),e.DNE(3,KC,2,1,"span",57),e.k0s(),e.DNE(4,e4,3,2,"div",58),e.k0s()}if(2&n){const t=a.$implicit,r=e.XpG();e.Y8G("ngClass",r.activeChannelColor===t.type?"font-bold":"text-600 hover:bg-gray-100")("ngStyle",e.l_i(5,YC,r.activeChannelColor===t.type?"var(--channel-bg-light)":"transparent",r.activeChannelColor===t.type?"var(--channel-primary)":"")),e.R7$(2),e.Y8G("src",t.logo,e.B4B),e.R7$(),e.Y8G("ngIf",!r.collapsed),e.R7$(),e.Y8G("ngIf",!r.collapsed)}}function n4(n,a){1&n&&(e.j41(0,"div",64),e.EFF(1," Connected Pages\n"),e.k0s())}function r4(n,a){if(1&n&&e.nrm(0,"img",72),2&n){const t=e.XpG(2);e.Y8G("src",t.activeChannelPages[0].PageLogo,e.B4B)}}function i4(n,a){if(1&n&&(e.j41(0,"div",73),e.EFF(1),e.k0s()),2&n){const t=e.XpG(2);e.xc7("background",t.getMetaBgColor(t.activeChannelPages[0].PageName)),e.R7$(),e.SpI(" ",t.getInitials(t.activeChannelPages[0].PageName)," ")}}function a4(n,a){if(1&n&&(e.j41(0,"div",74)(1,"span",75),e.EFF(2),e.k0s(),e.j41(3,"div",76)(4,"span",77),e.EFF(5),e.j41(6,"span",78),e.EFF(7," \u2022 Connected"),e.k0s()()()()),2&n){const t=e.XpG(2);e.R7$(2),e.SpI(" ",t.activeChannelPages[0].PageName," "),e.R7$(3),e.SpI(" ",t.activeChannelPages[0].PageId," "),e.R7$(),e.Y8G("ngStyle",e.lJ4(3,zC))}}function s4(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",65),e.bIt("click",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.showPagesPopover(i,s.activeChannel.type))}),e.j41(1,"div",66)(2,"div",67),e.DNE(3,r4,1,1,"img",68)(4,i4,2,3,"ng-template",null,2,e.C5r),e.k0s(),e.j41(6,"div",69),e.nrm(7,"img",70),e.k0s()(),e.DNE(8,a4,8,4,"div",71),e.k0s()}if(2&n){const t=e.sdS(5),r=e.XpG();e.Y8G("ngStyle",e.lJ4(5,HC)),e.R7$(3),e.Y8G("ngIf",r.activeChannelPages[0].PageLogo)("ngIfElse",t),e.R7$(4),e.Y8G("src",r.activeChannel.logo,e.B4B),e.R7$(),e.Y8G("ngIf",!r.collapsed)}}function o4(n,a){if(1&n&&e.nrm(0,"img",72),2&n){const t=e.XpG().$implicit;e.Y8G("src",t.PageLogo,e.B4B)}}function l4(n,a){if(1&n&&(e.j41(0,"div",86),e.EFF(1),e.k0s()),2&n){const t=e.XpG().$implicit,r=e.XpG(2);e.xc7("background",r.getMetaBgColor(t.PageName)),e.R7$(),e.SpI(" ",r.getInitials(t.PageName)," ")}}function c4(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",80),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG(2),o=e.sdS(18);return s.switchPage(i),e.Njj(o.hide())}),e.j41(1,"div",81)(2,"div",82),e.DNE(3,o4,1,1,"img",68)(4,l4,2,3,"ng-template",null,2,e.C5r),e.k0s(),e.j41(6,"div",74)(7,"span",75),e.EFF(8),e.k0s(),e.j41(9,"span",83),e.EFF(10),e.j41(11,"span",84),e.EFF(12," \u2022 Connected"),e.k0s()()()(),e.j41(13,"i",85),e.bIt("click",function(i){const s=e.eBV(t).$implicit;return e.XpG(2).disconnectChannel(s),e.Njj(i.stopPropagation())}),e.k0s()()}if(2&n){const t=a.$implicit,r=e.sdS(5);e.R7$(3),e.Y8G("ngIf",t.PageLogo)("ngIfElse",r),e.R7$(5),e.JRh(t.PageName),e.R7$(2),e.SpI(" ",t.PageId," ")}}function d4(n,a){if(1&n&&e.DNE(0,c4,14,4,"div",79),2&n){const t=e.XpG();e.Y8G("ngForOf",t.popoverPages)}}function p4(n,a){1&n&&(e.j41(0,"span",87),e.EFF(1,"Integrations"),e.k0s())}function u4(n,a){if(1&n){const t=e.RV6();e.j41(0,"span",88),e.bIt("click",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.viewTermsOfUse(i))}),e.EFF(1," Terms of Use\n"),e.k0s()}}function f4(n,a){1&n&&(e.j41(0,"div",16)(1,"span",91),e.EFF(2,"Integrations"),e.k0s(),e.j41(3,"span",92),e.EFF(4," Connect your Meta products to manage all conversations in one inbox. "),e.k0s()())}function m4(n,a){if(1&n&&(e.j41(0,"div",93)(1,"div",94),e.nrm(2,"i",95),e.k0s(),e.j41(3,"div",50)(4,"span",96
1),e.EFF(5,"Permission Required"),e.k0s(),e.j41(6,"span",97),e.EFF(7),e.k0s()()()),2&n){const t=e.XpG(2);e.R7$(7),e.SpI(" ",t.permissionDeniedMessage," ")}}function h4(n,a){if(1&n&&e.DNE(0,f4,5,0,"div",89)(1,m4,8,1,"div",90),2&n){const t=e.XpG();e.Y8G("ngIf","integrations"===t.modalView),e.R7$(),e.Y8G("ngIf","permissionDenied"===t.modalView)}}function g4(n,a){if(1&n){const t=e.RV6();e.j41(0,"app-integartion-modal",98),e.bIt("closeModal",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.closeMetaModal())})("openPagePicker",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.openPagePicker(i))})("permissionDenied",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.onPermissionDenied(i))}),e.k0s()}}function _4(n,a){if(1&n&&(e.j41(0,"div",108)(1,"span",109),e.EFF(2),e.k0s()()),2&n){const t=a.$implicit;e.R7$(2),e.SpI(" \u2022 ",t," ")}}function x4(n,a){if(1&n&&(e.j41(0,"div",105)(1,"p",106),e.EFF(2,"Required Permissions Missing:"),e.k0s(),e.DNE(3,_4,3,1,"div",107),e.k0s()),2&n){const t=e.XpG(2);e.R7$(3),e.Y8G("ngForOf",t.missingPermissions)}}function v4(n,a){1&n&&(e.j41(0,"div",110)(1,"span",111),e.EFF(2,"\u{1f61e}"),e.k0s()())}function b4(n,a){if(1&n&&(e.j41(0,"li",117)(1,"span",118),e.EFF(2),e.k0s(),e.j41(3,"span",119),e.EFF(4),e.k0s()()),2&n){const t=a.$implicit,r=a.index;e.R7$(2),e.SpI("",r+1,"."),e.R7$(2),e.JRh(t)}}function C4(n,a){if(1&n&&(e.j41(0,"div",112)(1,"p",113),e.nrm(2,"i",114),e.EFF(3," How to fix this: "),e.k0s(),e.j41(4,"ul",115),e.DNE(5,b4,5,2,"li",116),e.k0s()()),2&n){const t=e.XpG(2);e.R7$(5),e.Y8G("ngForOf",t.troubleshootingSteps)}}function k4(n,a){if(1&n&&(e.j41(0,"div",120)(1,"a",121),e.nrm(2,"i",122),e.EFF(3," Open Facebook Settings "),e.k0s()()),2&n){const t=e.XpG(2);e.R7$(),e.Y8G("href",t.helpLink,e.B4B)}}function T4(n,a){if(1&n&&(e.j41(0,"div",99)(1,"h3",100),e.EFF(2),e.k0s(),e.DNE(3,x4,4,1,"div",101)(4,v4,3,0,"div",102)(5,C4,6,1,"div",103)(6,k4,4,1,"div",104),e.k0s()),2&n){const t=e.XpG();e.R7$(2),e.JRh(t.permissionDeniedMessage),e.R7$(),e.Y8G("ngIf",null==t.missingPermissions?null:t.missingPermissions.length),e.R7$(),e.Y8G("ngIf",0===(null==t.missingPermissions?null:t.missingPermissions.length)),e.R7$(),e.Y8G("ngIf",null==t.troubleshootingSteps?null:t.troubleshootingSteps.length),e.R7$(),e.Y8G("ngIf",t.helpLink)}}function w4(n,a){1&n&&(e.j41(0,"div")(1,"a",124),e.nrm(2,"i",125),e.j41(3,"span"),e.EFF(4,"Learn more about Meta integrations in our privacy policy"),e.k0s()()())}function y4(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",126)(1,"button",127),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.modalView="integrations")}),e.k0s(),e.j41(2,"button",128),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.closeMetaModal())}),e.k0s()()}}function F4(n,a){if(1&n&&e.DNE(0,w4,5,0,"div",58)(1,y4,3,0,"div",123),2&n){const t=e.XpG();e.Y8G("ngIf","integrations"===t.modalView),e.R7$(),e.Y8G("ngIf","permissionDenied"===t.modalView)}}function S4(n,a){1&n&&(e.qex(0),e.EFF(1," Connect your Instagram Business account to sync DMs and manage customer messages. This allows you to view conversations, respond to customers, and create leads directly from Instagram. "),e.bVm())}function E4(n,a){1&n&&e.EFF(0," Connect your Facebook Page to sync Messenger conversations and manage customer messages. This allows you to view chats, respond to customers, and create leads directly from Messenger. ")}function I4(n,a){if(1&n&&(e.j41(0,"div",16)(1,"span",129),e.EFF(2),e.k0s(),e.j41(3,"span",92),e.DNE(4,S4,2,0,"ng-container",130)(5,E4,1,0,"ng-template",null,3,e.C5r),e.k0s()()),2&n){const t=e.sdS(6),r=e.XpG();e.R7$(2),e.SpI(" ","instagram"===r.currentChannel?"Select Instagram Account":"Select Facebook Pages"," "),e.R7$(2),e.Y8G("ngIf","instagram"===r.currentChannel)("ngIfElse",t)}}function D4(n,a){1&n&&(e.j41(0,"a",124),e.nrm(1,"i",125),e.j41(2,"span"),e.EFF(3,"Learn more about Meta integrations in our privacy policy"),e.k0s()())}let xc=(()=>{class n{auth;integrationService;teamsService;messageService;channelChange=new e.bkB;pageSelected=new e.bkB;pageDisconnected=new e.bkB;channelsChange=new e.bkB;threads=[];showMetaModal=!1;collapsed=!1;toggleCollapse=new e.bkB;fbPagesTrack=[];waNumbersTrack=[];igPagesTrack=[];showPagePicker=!1;availablePages=[];tempUserToken=null;selectedPages=[];isAllSelected=!1;connectedPages=[];popoverPages=[];connectedInstagram=[];connectedWhatsApp=[];teamId;modalView="integrations";permissionDeniedMessage="";missingPermissions=[];helpLink;troubleshootingSteps;activeChannel;activeChannelColor;displayDenialModal;currentChannel;pagesPopover;termsClick=new e.bkB;channels=[{name:"Messenger",type:"messenger",active:!0,logo:"https://upload.wikimedia.org/wikipedia/commons/b/be/Facebook_Messenger_logo_2020.svg",integrated:!1,desc:"Connect your Facebook Page to re
1ceive and send messages via Messenger."},{name:"Instagram",type:"instagram",active:!1,logo:"https://upload.wikimedia.org/wikipedia/commons/e/e7/Instagram_logo_2016.svg",integrated:!1,desc:"Link your Instagram Business account to manage DMs from your CRM."},{name:"WhatsApp",type:"whatsapp",active:!1,logo:"https://upload.wikimedia.org/wikipedia/commons/6/6b/WhatsApp.svg",integrated:!1,desc:"Connect your WhatsApp Business number to handle customer chats."}];constructor(t,r,i,s){this.auth=t,this.integrationService=r,this.teamsService=i,this.messageService=s}ngOnInit(){this.teamId=this.teamsService.getCurrentTeam.Team.Id,(0,hc.z)([this.integrationService.facebookIntegrations$,this.integrationService.whatsappIntegrations$,this.integrationService.instagramIntegrations$]).subscribe(([r,i,s])=>{this.updateChannelIntegrationStatuses(r.length>0,i.length>0,s.length>0),this.mapTrackingArrays(r,i,s),this.connectedPages=[...this.fbPagesTrack,...this.waNumbersTrack,...this.igPagesTrack],0!==this.connectedPages.length&&this.handleActivePageSelection()})}updateChannelIntegrationStatuses(t,r,i){this.channels=this.channels.map(s=>"messenger"===s.type?{...s,integrated:t}:"whatsapp"===s.type?{...s,integrated:r}:"instagram"===s.type?{...s,integrated:i}:s),this.channelsChange.emit(this.channels)}mapTrackingArrays(t,r,i){const s=this.channels.find(c=>"messenger"===c.type)?.logo||"",o=this.channels.find(c=>"whatsapp"===c.type)?.logo||"",l=this.channels.find(c=>"instagram"===c.type)?.logo||"";this.fbPagesTrack=t.map(c=>({...c,channelLogo:s,provider:"messenger"})),this.waNumbersTrack=r.map(c=>({...c,PageId:c.PhoneNumberId,PageName:c.VerifiedName||"WhatsApp Business Channel",channelLogo:o,provider:"whatsapp"})),this.igPagesTrack=i.map(c=>({...c,channelLogo:l,provider:"instagram"}))}handleActivePageSelection(){const t=this.integrationService.getSelectedPage(),r=t&&t.PageId,i=r&&this.connectedPages.some(s=>s.PageId===t.PageId);r&&i?this.switchPage(t):this.fbPagesTrack.length>0?this.switchPage(this.fbPagesTrack[0]):this.waNumbersTrack.length>0?this.switchPage(this.waNumbersTrack[0]):this.igPagesTrack.length>0&&this.switchPage(this.igPagesTrack[0])}trackByKey(t,r){return r.key}setPopoverPages(t){this.popoverPages=this.getPagesForChannel(t)}switchPage(t){if(!t)return;this.integrationService.setSelectedPage(t),this.pageSelected.emit(t);const r=this.channels.find(i=>i.type?.toLowerCase()===t.provider?.toLowerCase());r&&(this.channels.forEach(i=>i.active=!1),r.active=!0,this.channelChange.emit(r.type),this.activeChannel=r)}selectChannel(t){this.channels.forEach(i=>i.active=!1),t.active=!0,this.channelChange.emit(t.type);const r=this.connectedPages.filter(i=>i.provider?.toLowerCase()===t.type?.toLowerCase());r.length>0&&(this.integrationService.setSelectedPage(r[0]),this.pageSelected.emit(r[0])),this.activeChannel=t}showPagesPopover(t,r){this.popoverPages=this.getPagesForChannel(r),this.pagesPopover.toggle(t)}openPagePicker(t){this.availablePages=t.pages,this.tempUserToken=t.userToken,this.currentChannel=t.channel,this.showMetaModal=!1,this.showPagePicker=!0}disconnectFacebook(t){this.auth.disconnectFacebookIntegration(this.teamId,t.PageId).subscribe({next:()=>{this.integrationService.clearFacebookIntegration(),this.pageDisconnected.emit(t.PageId),this.integrationService.setSelectedPage(null),this.pagesPopover.hide(),this.messageService.add({severity:"success",summary:"Disconnected",detail:"Facebook integration removed successfully"})},error:r=>{console.error("Disconnect failed",r),this.messageService.add({severity:"error",summary:"Error",detail:"Failed to disconnect Facebook integration"})}})}disconnectwhatsApp(t){this.auth.disconnectWhatsApp(this.teamId,t.PageId).subscribe({next:()=>{this.integrationService.clearwhatsAppIntegration(),this.pageDisconnected.emit(t.PageId),this.integrationService.setSelectedPage(null),this.pagesPopover.hide(),this.messageService.add({severity:"success",summary:"Disconnected",detail:"WhatsApp integration removed successfully"})},error:r=>{console.error("Disconnect failed",r),this.messageService.add({severity:"error",summary:"Error",detail:"Failed to disconnect WhatsApp integration"})}})}disconnectInstagram(t){this.auth.disconnectInstagram(this.teamId,t.PageId).subscribe({next:()=>{this.integrationService.clearInstagramIntegration(),this.pageDisconnected.emit(t.PageId),this.integrationService.setSelectedPage(null),this.pagesPopover.hide(),this.messageService.add({severity:"success",summary:"Disconnected",detail
1:"Instagram integration removed successfully"})},error:r=>{console.error("Disconnect failed",r),this.messageService.add({severity:"error",summary:"Error",detail:"Failed to disconnect Instagram integration"})}})}hasConnectedPages(){return this.channels.some(t=>t.integrated&&this.getPagesForChannel(t.type).length>0)}openMetaModal(t){this.modalView="integrations",this.showMetaModal=!0}closeMetaModal(){this.modalView="integrations",this.showMetaModal=!1}onPermissionDenied(t){this.permissionDeniedMessage=t.message,this.missingPermissions=t.permissions,this.helpLink=t.helpLink,this.troubleshootingSteps=t.steps,this.modalView="permissionDenied"}formatPermission(t){return{pages_show_list:"pages_show_list",pages_messaging:"Send and receive messages"}[t]||t}onPagesConnected(t){this.connectedPages=t}getInitials(t){if(!t)return"??";const r=t.trim().split(/\s+/);return r.length>1?(r[0].charAt(0)+r[1].charAt(0)).toUpperCase():r[0].substring(0,2).toUpperCase()}getMetaBgColor(t){if(!t||!at.Tj||0===at.Tj.length)return"#95a5a6";let r=0;for(let s=0;s<t.length;s++)r=t.charCodeAt(s)+((r<<5)-r);const i=Math.abs(r)%at.Tj.length;return at.Tj[i].color}get activeChannelPages(){return this.activeChannel?this.getPagesForChannel(this.activeChannel.type||this.activeChannel):[]}getPagesForChannel(t){return this.connectedPages?this.connectedPages.filter(r=>r.provider?.toLowerCase()===t?.toLowerCase()):[]}get adminAndOnwer(){return["Owner","Admin"].includes(this.teamsService.getCurrentTeam?.Role)}openDenielModal(){this.displayDenialModal=!0}viewTermsOfUse(t){t.stopPropagation(),this.termsClick.emit()}disconnectChannel(t){"whatsapp"===t.provider?this.disconnectwhatsApp(t):"instagram"===t.provider?this.disconnectInstagram(t):this.disconnectFacebook(t)}static \u0275fac=function(r){return new(r||n)(e.rXU(jn.u),e.rXU(oi.a),e.rXU(rt.n),e.rXU(be.bg))};static \u0275cmp=e.VBU({type:n,selectors:[["app-channel-sidebar"]],viewQuery:function(r,i){if(1&r&&e.GBs(UC,5),2&r){let s;e.mGM(s=e.lsd())&&(i.pagesPopover=s.first)}},inputs:{collapsed:"collapsed",activeChannelColor:"activeChannelColor"},outputs:{channelChange:"channelChange",pageSelected:"pageSelected",pageDisconnected:"pageDisconnected",channelsChange:"channelsChange",toggleCollapse:"toggleCollapse",termsClick:"termsClick"},standalone:!1,decls:56,vars:35,consts:[["pagesPopover",""],["content",""],["initialFallback",""],["fbCopy",""],[1,"flex","flex-column","h-full","bg-white","transition-all","transition-duration-300","border-right-1","surface-border",3,"ngClass"],[1,"flex","align-items-center","justify-content-between","p-3","mb-2","border-bottom-1","surface-border"],["class","flex align-items-center gap-2",4,"ngIf"],[1,"cursor-pointer","text-400","hover:text-600","transition-colors","p-1",3,"click"],["width","18","height","18","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["x1","21","y1","10","x2","14","y2","10"],["x1","21","y1","6","x2","10","y2","6"],["x1","21","y1","14","x2","14","y2","14"],["x1","21","y1","18","x2","10","y2","18"],["points","7 8 3 12 7 16"],[1,"flex","flex-column","px-2"],["class","px-2 text-xs text-900 uppercase font-bold mb-3 tracking-widest","style","font-size: 0.7rem;",4,"ngIf"],[1,"flex","flex-column","gap-1"],["class","flex align-items-center justify-content-between px-3 py-2 cursor-pointer border-round-lg transition-colors",3,"ngClass","ngStyle","click",4,"ngFor","ngForOf"],[1,"flex","flex-column","gap-2","mt-auto","mb-2","p-2"],["class","text-sm font-bold text-900 mb-2",4,"ngIf"],["class","flex align-items-center gap-3 p-2 border-1 border-round-xl cursor-pointer transition-all shadow-sm",3,"ngStyle","click",4,"ngIf"],["position","right"],[1,"px-1","pb-1","flex","flex-column","border-top-1","surface-border"],[1,"flex","align-items-center","justify-content-between","w-full","pr-3"],[1,"flex","align-items-center","gap-2","p-2","cursor-pointer","border-round-lg","text-600","hover:bg-gray-100","transition-colors","flex-grow-1",3,"click"],["width","18","height","18","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"flex-shrink-0"],["d","M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"],["d","M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"],["class","text-xs font-semibold whitespace-nowrap",4,"ngIf"],["class","text-xs text-500 hover:text-primary transition-colors cursor-pointer ml-2 font-medium underline select-none",3,"click",4,"ngIf"],["styleClass","meta-modal",3,"visibleChange","visible","modal","draggable","resizable"],["pTemplate","header"],[1,"py-2"],[3,"closeModal","openPagePicker","permissionDenied",4,"ngIf"],["class","fadein",4,"ngIf"],["pTemplate","footer"],[3,"close","pagesConnected","availablePages","userToken","teamId","currentChannel"],["appendTo","body","header","Access Restricted",3,"visibleChange","visible","modal","draggable","resizable"],[1,"flex","flex-column","align-items-center","text-center","px-2","pt-2"],[1,"flex","align-items-center","justify-content-center","bg-orange-100","border-circle","mb-3",2,"width","56px","height","56px"],[1,"pi","pi-lock","text-orange-600","text-2xl"],[1,"m-0","text-xl","font-semibold","text-900"],[1,"text-600","text-sm","line-height-3","mt-2","mb-4"],[1,"w-full","border-top-1","surface-border","pt-3","flex","justify-content-end"],["label","Got it","styleClass","p-button-sm p-button-secondary border-round-md",3,"onClick"],["position","top-right"],[1,"flex","align-items-center","gap-2"],[1,"bg-blue-600","border-round","p-1","flex","align-items-center","justify-content-center","shadow-1",2,"width","28px","height","28px"],["width","16","height","16","viewBox","0 0 24 24","fill","white"],["d","M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"],[1,"flex","flex-column"],[1,"text-900","font-bold",2,"font-size","0.8rem","line-height","1.1"],[1,"text-500","font-semibold","uppercase","tracking-tight",2,"font-size","0.6rem"],[1,"px-2","text-xs","text-900","uppercase","font-bold","mb-3","tracking-widest",2,"font-size","0.7rem"],[1,"flex","align-items-center","justify-content-between","px-3","py-2","cursor-pointer","border-round-lg","transition-colors",3,"click","ngClass","ngStyle"],[1,"flex","align-items-center","gap-3"],["width","18","height","18",1,"flex-shrink-0",3,"src"],["class","text-sm font-semibold",4,"ngIf"],[4,"ngIf"],[1,"text-sm","font-semibold"],["class","text-xs text-400",4,"ngIf"],["class","text-xs ",3,"ngStyle",4,"ngIf"],[1,"text-xs","text-400"],[1,"text-xs",3,"ngStyle"],[1,"text-sm","font-bold","text-900","mb-2"],[1,"flex","align-items-center","gap-3","p-2","border-1","border-round-xl","cursor-pointer","transition-all","shadow-sm",3,"click","ngStyle"],[1,"relative","flex","align-items-center","justify-content-center"],[1,"w-3rem","h-3rem","border-circle","flex","align-items-center","justify-content-center","overflow-hidden","border-1","surface-border"],["class","w-full h-full object-cover",3,"src",4,"ngIf","ngIfElse"],[1,"absolute","bg-white","border-circle","flex","align-items-center","justify-content-center","border-1","surface-border","shadow-1",2,"bottom","-2px","right","-2px","width","18px","height","18px"],[2,"width","12px","height","12px",3,"src"],["class","flex flex-column overflow-hidden",4,"ngIf"],[1,"w-full","h-full","object-cover",3,"src"],[1,"w-full","h-full","flex","align-items-center","justify-content-center","font-bold","text-sm","text-white","select-none"],[1,"flex","flex-column","overflow-hidden"],[1,"text-sm","font-bold","text-900","truncate"],[1,"flex","align-items-center","gap-1","text-xs","mt-1"],[1,"text-400","text-xs"],[1,"text-xs","font-semibold",3,"ngStyle"],["class","flex align-items-center justify-content-between gap-3 p-2 cursor-pointer hover:bg-gray-100 rounded",3,"click",4,"ngFor","ngForOf"],[1,"flex","align-items-center","justify-content-between","gap-3","p-2","cursor-pointer","hover:bg-gray-100","rounded",3,"click"],[1,"flex","align-items-center","gap-3","overflow-hidden"],[1,"w-2.5rem","h-2.5rem","border-circle","overflow-hidden","bg-gray-100","flex","items-center","justify-content-center"],[1,"text-xs"],[1,"text-green-600","text-xs"],[1,"pi","pi-trash","text-red-500","cursor-pointer","hover:text-red-700",3,"click"],[1,"w-full","h-full","flex","align-items-center","justify-content-center","font-bold","text-xs","text-white","select-none"],[1,"text-xs","font-semibold","whitespace-nowrap"],[1,"text-xs","text-500","hover:text-primary","transition-colors","cursor-pointer","ml-2","font-medium","underline","select-none",3,"click"],["class","flex flex-column gap-1",4,"ngIf"],["class","flex align-items-start gap-3",4,"ngIf"],[1,"text-xl","font-bold","text-900"],[1,"text-xs","text-600"],[1,"flex","align-items-start","gap-3"],[1,"flex","align-items-center","justify-content-center","border-circle","bg-red-100","text-danger",2,"width","50px","height","50px"],[1,"pi","pi-shield","text-lg"],[1,"font-semibold","text-lg"],[1,"text-600","text-xs","mt-1"],[3,"closeModal","openPagePicker","permissionDenied"],[1,"fadein"],[1,"text-xl","font-bold","mb-2","text-900"],["class","mt-3 p-3 border-round-lg bg-gray-100",4,"ngIf"],["class","emoji-container text-center py-3",4,"ngIf"],["class","mt-3 p-3 border-round-lg bg-blue-50 border-1 border-blue-100",4,"ngIf"],["class","mt-4",4,"ngIf"],[1,"mt-3","p-3","border-round-lg","bg-gray-100"],[1,"text-xs","font-bold","uppercase","text-500","mb-2"],["class","flex align-items-center gap-2 mb-2",4,"ngFor","ngForOf"],[1,"flex","align-items-center","gap-2","mb-2"],[1,"bg-white","px-2","py-1","border-round","text-sm","border-1","border-200"],[1,"emoji-container","text-center","py-3"],[1,"emoji",2,"font-size","3rem"],[1,"mt-3","p-3","border-round-lg","bg-blue-50","border-1","border-blue-100"],[1,"text-sm","font-bold","text-blue-900","mb-2"],[1,"pi","pi-list","mr-1"],[1,"list-none","p-0","m-0"],["class","text-sm mb-2 flex align-items-start",4,"ngFor","ngForOf"],[1,"text-sm","mb-2","flex","align-items-start"],[1,"text-blue-600","font-bold","mr-2"],[1,"text-blue-800","line-height-3"],[1,"mt-4"],["target","_blank",1,"p-button","p-button-primary","w-full","no-underline","flex","justify-content-center","p-3","font-bold","border-round-lg",3,"href"],[1,"pi","pi-external-link","mr-2"],["class","flex justify-content-end gap-2 p-2",4,"ngIf"],["routerLink","/privacy-policy",1,"flex","align-items-center","gap-2","text-sm","text-600","cursor-pointer","hover:underline","py-2"],[1,"pi","pi-external-link","text-xs"],[1,"flex","justify-content-end","gap-2","p-2"],["pButton","","label","Back",1,"p-button-text",3,"click"],["pButton","","label","Close",1,"p-button-primary","px-4",3,"click"],[1,"font-bold","text-lg"],[4,"ngIf","ngIfElse"]],template:function(r,i){if(1&r){const s=e.RV6();e.j41(0,"div",4)(1,"div",5),e.DNE(2,qC,9,0,"div",6),e.j41(3,"div",7),e.bIt("click",function(){return e.eBV(s),e.Njj(i.toggleCollapse.emit(!i.collapsed))}),e.qSk(),e.j41(4,"svg",8),e.nrm(5,"line",9)(6,"line",10)(7,"line",11)(8,"line",12)(9,"polyline",13),e.k0s()()(),e.joV(),e.j41(10,"div",14),e.DNE(11,JC,2,0,"span",15),e.j41(12,"div",16),e.DNE(13,t4,5,8,"div",17),e.k0s()(),e.j41(14,"div",18),e.DNE(15,n4,2,0,"div",19)(16,s4,9,6,"div",20),e.j41(17,"p-popover",21,0),e.DNE(19,d4,1,1,"ng-template",null,1,e.C5r),e.k0s()(),e.j41(21,"div",22)(22,"div",23)(23,"div",24),e.bIt("click",function(){return e.eBV(s),e.Njj(i.adminAndOnwer?i.openMetaModal():i.openDenielModal())}),e.qSk(),e.j41(24,"svg",25),e.nrm(25,"path",26)(26,"path",27),e.k0s(),e.DNE(27,p4,2,0,"span",28),e.k0s(),e.DNE(28,u4,2,0,"span",29),e.k0s()()(),e.joV(),e.j41(29,"p-dialog",3
10),e.mxI("visibleChange",function(l){return e.eBV(s),e.DH7(i.showMetaModal,l)||(i.showMetaModal=l),e.Njj(l)}),e.DNE(30,h4,2,2,"ng-template",31),e.j41(31,"div",32),e.DNE(32,g4,1,0,"app-integartion-modal",33)(33,T4,7,5,"div",34),e.k0s(),e.DNE(34,F4,2,2,"ng-template",35),e.k0s(),e.j41(35,"p-dialog",30),e.mxI("visibleChange",function(l){return e.eBV(s),e.DH7(i.showPagePicker,l)||(i.showPagePicker=l),e.Njj(l)}),e.DNE(36,I4,7,3,"ng-template",31),e.j41(37,"app-page-picker",36),e.bIt("close",function(){return e.eBV(s),e.Njj(i.showPagePicker=!1)})("pagesConnected",function(l){return e.eBV(s),e.Njj(i.onPagesConnected(l))}),e.k0s(),e.DNE(38,D4,4,0,"ng-template",35),e.k0s(),e.j41(39,"p-dialog",37),e.mxI("visibleChange",function(l){return e.eBV(s),e.DH7(i.displayDenialModal,l)||(i.displayDenialModal=l),e.Njj(l)}),e.j41(40,"div",38)(41,"div",39),e.nrm(42,"i",40),e.k0s(),e.j41(43,"h3",41),e.EFF(44,"Admin Permissions Required"),e.k0s(),e.j41(45,"p",42),e.EFF(46," Integrations can only be configured by a team "),e.j41(47,"strong"),e.EFF(48,"Admin"),e.k0s(),e.EFF(49," or "),e.j41(50,"strong"),e.EFF(51,"Owner"),e.k0s(),e.EFF(52,". Please contact your administrator to set up this connection. "),e.k0s(),e.j41(53,"div",43)(54,"p-button",44),e.bIt("onClick",function(){return e.eBV(s),e.Njj(i.displayDenialModal=!1)}),e.k0s()()()(),e.nrm(55,"p-toast",45)}2&r&&(e.Y8G("ngClass",i.collapsed?"w-5rem":"w-16rem"),e.R7$(2),e.Y8G("ngIf",!i.collapsed),e.R7$(9),e.Y8G("ngIf",!i.collapsed),e.R7$(2),e.Y8G("ngForOf",i.channels),e.R7$(2),e.Y8G("ngIf",i.activeChannel&&i.activeChannelPages.length>0&&!i.collapsed),e.R7$(),e.Y8G("ngIf",i.activeChannel&&i.activeChannelPages.length>0),e.R7$(11),e.Y8G("ngIf",!i.collapsed),e.R7$(),e.Y8G("ngIf",!i.collapsed),e.R7$(),e.Aen(e.lJ4(32,_c)),e.R50("visible",i.showMetaModal),e.Y8G("modal",!0)("draggable",!1)("resizable",!1),e.R7$(3),e.Y8G("ngIf","integrations"===i.modalView),e.R7$(),e.Y8G("ngIf","permissionDenied"===i.modalView),e.R7$(2),e.Aen(e.lJ4(33,_c)),e.R50("visible",i.showPagePicker),e.Y8G("modal",!0)("draggable",!1)("resizable",!1),e.R7$(2),e.Y8G("availablePages",i.availablePages)("userToken",i.tempUserToken)("teamId",i.teamId)("currentChannel",i.currentChannel),e.R7$(2),e.Aen(e.lJ4(34,XC)),e.R50("visible",i.displayDenialModal),e.Y8G("modal",!0)("draggable",!1)("resizable",!1))},dependencies:[q.YU,q.Sq,q.bT,q.B3,sr.Wk,be.Ei,Ie.y8,jt.lG,xe._f,xe.$n,Ae.AM,GC,VC],styles:[".channel-item[_ngcontent-%COMP%]{display:flex;align-items:center;padding:.75rem 1rem;cursor:pointer;transition:background .2s ease}.channel-item[_ngcontent-%COMP%]:hover{background:#f5f5f5}.channel-item.active[_ngcontent-%COMP%]{background:#e3f2fd;font-weight:600}.bg-sidebar[_ngcontent-%COMP%]{background-color:#0f172a}.w-3rem[_ngcontent-%COMP%]{width:3rem}.h-3rem[_ngcontent-%COMP%]{height:3rem}.truncate[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.shadow-1[_ngcontent-%COMP%]{box-shadow:0 1px 3px #0000001a,0 1px 2px #0000000f}:is() .p-dialog-header[_ngcontent-%COMP%]{padding:1.5rem 1.5rem .5rem}:is() .p-dialog-header[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:1.25rem;font-weight:700;color:#1a1a1a}:is() .p-dialog-content[_ngcontent-%COMP%]{padding:0 1.5rem 1.5rem;border-bottom-left-radius:12px;border-bottom-right-radius:12px}:is() .select-item[_ngcontent-%COMP%]{border:1px solid transparent;cursor:pointer}:is() .select-item[_ngcontent-%COMP%]:hover{background-color:var(--surface-100)}.emoji-container[_ngcontent-%COMP%]{text-align:center;padding:24px 0}.emoji[_ngcontent-%COMP%]{font-size:48px;display:inline-block;animation:_ngcontent-%COMP%_bounce 1s infinite}@keyframes _ngcontent-%COMP%_bounce{0%,to{transform:translateY(0)}50%{transform:translateY(-10px)}}[_nghost-%COMP%] .p-message-text{font-size:.75rem}"]})}return n})();const R4=()=>({"background-color":"var(--channel-bg-light)"}),vc=()=>({color:"var(--channel-primary)"}),bc=(n,a)=>({"border-bottom":n,color:a}),j4=n=>({"background-color":n}),A4=(n,a)=>({"font-size":"0.85rem","font-weight":"700","background-color":n,color:a}),M4=()=>({background:"var(--active-indicator)",width:"4px"}),P4=()=>({background:"var(--channel-primary)","min-width":"18px",height:"18px",padding:"2px"});function O4(n,a){1&n&&(e.j41(0,"div",20),e.nrm(1,"p-progressSpinner",21),e.k0s())}function N4(n,a){1&n&&e.nrm(0,"div",37),2&n&&e.Y8G("ngStyle",e.lJ4(1,M4))}function G4(n,a){if(1&n&&(e.j41(0,"div",38),e.EFF(1),e.k0s()),2&n){const t=e.XpG().$implicit;e.Y8G("ngStyle",e.lJ4(2,P4)),e.R7$(),e.SpI(" ",t.unread_count," ")}}function B4(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",24),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG(4);return e.Njj(s.selectThread(i))}),e.DNE(1,N4,1,2,"div",25),e.j41(2,"div",26),e.nrm(3,"p-avatar",27),e.j41(4,"div",28),e.nrm(5,"img",29),e.k0s()(),e.j41(6,"div",30)(7,"div",31)(8,"span",32),e.EFF(9),e.k0s(),e.j41(10,"span",33),e.EFF(11),e.k0s()(),e.j41(12,"div",34)(13,"span",35),e.EFF(14),e.k0s(),e.DNE(15,G4,2,3,"div",36),e.k0s()()()}if(2&n){let t;const r=a.$implicit,i=e.XpG(4);e.Y8G("ngClass",i.isThreadActive(r)?"font-semibold shadow-1":"hover:bg-white-alpha-40")("ngStyle",e.eq3(11,j4,i.isThreadActive(r)?"var(--channel-bg-light)":"transparent")),e.R7$(),e.Y8G("ngIf",i.isThreadActive(r)),e.R7$(2),e.Aen(e.l_i(13,A4,i.getAvatarColor(r.id||r.key).light,i.getAvatarColor(r.id||r.key).dark)),e.Y8G("label",null==(t=i.getThreadParticipant(r).name)?null:t.charAt(0)),e.R7$(2),e.Y8G("src",i.getActiveChannelLogo(),e.B4B),e.R7$(4),e.SpI(" ",i.getThreadParticipant(r).name," "),e.R7$(2),e.SpI(" ",i.timeAgo(r.updated_time)," "),e.R7$(3),e.SpI(" ",r.snippet||"No message snippet available"," "),e.R7$(),e.Y8G("ngIf",r.unread_count>0)}}function L4(n,a){if(1&n&&(e.qex(0),e.DNE(1,B4,16,16,"div",23),e.bVm()),2&n){const t=e.XpG(3);e.R7$(),e.Y8G("ngForOf",t.filteredThreads)("ngForTrackBy",t.trackByThread)}}function $4(n,a){1&n&&(e.qex(0),e.j41(1,"div",42),e.EFF(2,"Waiting for Your First Message"),e.k0s(),e.j41(3,"p",43),e.EFF(4," WhatsApp doesn't let us pull in past conversations. As soon as a customer sends you a message on this number, their message will show up here automatically \u2014 no refresh needed. "),e.k0s(),e.bVm())}function V4(n,a){if(1&n&&(e.j41(0,"div",42),e.EFF(1,"No Conversations Yet"),e.k0s(),e.j41(2,"p",44),e.EFF(3),e.nI1(4,"titlecase"),e.k0s()),2&n){const t=e.XpG(4);e.R7$(3),e.SpI(" There are currently no active messages on your ",e.bMT(4,1,t.activeChannel)," channel. ")}}function U4(n,a){if(1&n&&(e.j41(0,"div",39)(1,"div",40),e.nrm(2,"i",41),e.k0s(),e.DNE(3,$4,5,0,"ng-container",22)(4,V4,5,3,"ng-template",null,1,e.C5r),e.k0s()),2&n){const t=e.sdS(5),r=e.XpG(3);e.R7$(3),e.Y8G("ngIf","whatsapp"===r.activeChannel)("ngIfElse",t)}}function X4(n,a){if(1&n&&(e.j41(0,"div"),e.DNE(1,L4,2,2,"ng-container",22)(2,U4,6,2,"ng-template",null,0,e.C5r),e.k0s()),2&n){const t=e.sdS(3),r=e.XpG(2);e.R7$(),e.Y8G("ngIf",r.filteredThreads&&r.filteredThreads.length>0)("ngIfElse",t)}}function Y4(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",3)(1,"div",4)(2,"div",5)(3,"div",6),e.nrm(4,"img",7),e.k0s(),e.j41(5,"h2",8),e.EFF(6),e.nI1(7,"titlecase"),e.k0s()(),e.j41(8,"button",9),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.reloadThreads())}),e.k0s()(),e.j41(9,"div",10)(10,"div",11),e.nrm(11,"i",12),e.j41(12,"input",13),e.mxI("ngModelChange",function(i){e.eBV(t);const s=e.XpG();return e.DH7(s.searchTerm,i)||(s.searchTerm=i),e.Njj(i)}),e.k0s()(),e.j41(13,"div",14)(14,"div",15)(15,"div",16),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.setTab("all"))}),e.EFF(16," All Messages "),e.k0s(),e.j41(17,"div",16),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.setTab("unread"))}),e.EFF(18," Unread "),e.k0s()()()(),e.j41(19,"div",17),e.DNE(20,O4,2,0,"div",18)(21,X4,4,2,"div",19),e.k0s()()}if(2&n){const t=e.XpG();e.Y8G("ngClass","theme-"+t.activeChannel)("ngStyle",e.lJ4(15,R4)),e.R7$(4),e.Y8G("src",t.getActiveChannelLogo(),e.B4B),e.R7$(),e.Y8G("ngStyle",e.lJ4(16,vc)),e.R7$(),e.SpI(" ",e.bMT(7,13,t.activeChannel)," "),e.R7$(2),e.Y8G("ngStyle",e.lJ4(17,vc)),e.R7$(4),e.R50("ngModel",t.searchTerm),e.R7$(3),e.Y8G("ngClass","all"===t.activeTab?"":"text-500")("ngStyle",e.l_i(18,bc,"all"===t.activeTab?"2px solid var(--channel-primary)":"2px solid transparent","all"===t.activeTab?"var(--channel-primary)":"")),e.R7$(2),e.Y8G("ngClass","unread"===t.activeTab?"":"text-500")("ngStyle",e.l_i(21,bc,"unread"===t.activeTab?"2px solid var(--channel-primary)":"2px solid transparent","unread"===t.activeTab?"var(--channel-primary)":"")),e.R7$(3),e.Y8G("ngIf",t.loadingThreads),e.R7$(),e.Y8G("ngIf",!t.loadingThreads)}}let W4=(()=>{class n{fbService;auth;integrationService;teamsService;conversationSelect=new e.bkB;activeChannel;selectedPage;incomingNewThread=null;profileSub;cachedProfile=null;threads=[];display=!1;loadingThreads=!1;activeThread=null;activeTab="all";searchTerm="";pageId=null;pageToken=null;channels=[...at.vj];isChannelPageActive=!1;instagramBusinessAccountId=null;teamId;constructor(t,r,i,s){this.fbService=t,this.auth=r,this.integrationService=i,this.teamsService=s}ngOnInit(){this.teamId=this.teamsService.getCurrentTeam.Team.Id,this.profileSub=this.integrationService.selectedPageSubject.subscribe(r=>{if(!r||Array.isArray(r)&&0===r.length)return this.cachedProfile=null,void this.clearActiveSelection();this.cachedProfile=r,this.evaluateAndLoadThreads()})}ngOnChanges(t){t.activeChannel&&(this.threads=[],this.evaluateAndLoadThreads()),t.incomingNewThread&&this.incomingNewThread&&this.applyIncomingMessage(this.incomingNewThread)}evaluateAndLoadThreads(){if(!this.cachedProfile||!this.activeChannel)return void this.clearActiveSelection();const t=this.cachedProfile.provider?.toLowerCase(),r=this.activeChannel?.toLowerCase();if(t!==r)return this.selectedPage=null,this.isChannelPageActive=!1,this.threads=[],this.pageId=null,void(this.pageToken=null);if(this.selectedPage=this.cachedProfile,this.isChannelPageActive=!0,"whatsapp"===r)this.pageId=this.cachedProfile.PhoneNumberId,this.pageToken=this.cachedProfile.Token;else if("instagram"===r)this.pageId=this.cachedProfile.PageId,this.pageToken=this.cachedProfile.Token,this.instagramBusinessAccountId=this.cachedProfile.InstagramBusinessAccountId;else{if("messenger"!==r)return;this.pageId=this.cachedProfile.PageId,this.pageToken=this.cachedProfile.Token}this.loadThreads(this.pageId,this.pageToken)}applyIncomingMessage(t){if("whatsapp"!==this.activeChannel?.toLowerCase())return;const r=String(t.threadId),i=this.threads?.findIndex(s=>String(s.id)===r);if(i>-1){const s=this.threads[i],o=String(this.activeThread?.id)===r,l={...s,snippet:t.snippet,updated_time:t.updated_time,hasNewMessage:!o,unread_count:o?s.unread_count:(s.unread_count||0)+1},c=this.threads.filter(d=>String(d.id)!==r);this.threads=[l,...c]}else t.isNewThread&&(this.threads=[{id:r,name:t.name,to_phone_number:t.to_phone_number,snippet:t.snippet,updated_time:t.updated_time,hasNewMessage:!0,unread_count:1},...this.threads||[]])}clearActiveSelection(){this.selectedPage=null,this.isChannelPageActive=!1,this.threads=[],this.pageId=null,this.pageToken=null}ngOnDestroy(){this.profileSub&&this.profileSub.unsubscribe()}trackByKey(t,r){return r.key}loadThreads(t,r){var i=this;return(0,nt.A)(function*(){if(!t||!r)return i.loadingThreads=!1,void(i.threads=[]);i.loadingThreads=!0;try{if("whatsapp"===i.activeChannel)i.threads=yield i.fbService.getWhatsAppChatsFromDb(i.teamId,t).toProm
1ise();else if("instagram"===i.activeChannel){const s=yield i.fbService.getInstagramConversations(t,r);i.threads=(s?.data??[]).map(o=>({...o,snippet:o.messages?.data?.[0]?.message??"\u{1f4f7} Attachment"}))}else{if("messenger"!==i.activeChannel)return;i.threads=yield i.fbService.getConversationThreads(t,r)}i.threads?.length&&i.selectThread(i.threads[0])}catch(s){console.error(`Failed to load ${i.activeChannel} threads:`,s),i.threads=[]}finally{i.loadingThreads=!1}})()}selectThread(t){t.hasNewMessage=!1,t.unread_count=0,this.conversationSelect.emit(t)}timeAgo(t){if(!t)return"";const r=new Date,i=new Date(t),s=Math.floor((r.getTime()-i.getTime())/1e3),o=Math.floor(s/60),l=Math.floor(s/3600),c=Math.floor(s/86400),d=Math.floor(c/7),p=Math.floor(c/30),u=Math.floor(c/365);return s<60?"just now":o<60?`${o}m ago`:l<24?`${l}h ago`:c<7?`${c}d ago`:d<4?`${d}w ago`:p<12?`${p}mo ago`:`${u}y ago`}get filteredThreads(){let t=this.threads??[];if("unread"===this.activeTab&&(t=t.filter(r=>(r.unread_count??0)>0)),this.searchTerm.trim()){const r=this.searchTerm.toLowerCase();t=t.filter(i=>this.getThreadParticipant(i)?.name?.toLowerCase().includes(r)||i.snippet?.toLowerCase().includes(r))}return t}setTab(t){this.activeTab=t}reloadThreads(){this.loadThreads(this.pageId,this.pageToken)}getActiveChannelLogo(){const t=this.channels.find(r=>r.type===this.activeChannel);return t?t.logo:""}getAvatarColor(t){if(!t)return{light:"#e3f2fd",dark:"#1976d2"};const r=t.toString();let i=0;for(let o=0;o<r.length;o++)i=r.charCodeAt(o)+((i<<5)-i);const s=Math.abs(i)%at.Tj.length;return"white"===at.Tj[s].theme?{light:"#e3f2fd",dark:"#1976d2"}:{light:at.Tj[s].light,dark:at.Tj[s].dark}}getThreadParticipant(t){if(!t)return{name:"Unknown",id:""};switch(this.activeChannel){case"whatsapp":return{name:t.name??"WhatsApp User",id:t.key??""};case"instagram":{const r=t.participants?.data??[],i=r.find(s=>s.id!==this.instagramBusinessAccountId)??r[0];return i?{name:i.username??"Instagram User",id:i.id}:{name:"Instagram User",id:""}}case"messenger":{const r=t.senders?.data??[],i=r.find(s=>s.id!==this.pageId)??r[0];return i?{name:i.name??"Facebook User",id:i.id}:{name:"Facebook User",id:""}}default:return{name:"Unknown",id:""}}}isThreadActive(t){return!(!t||!this.activeThread)&&("whatsapp"===this.activeChannel?t.key===this.activeThread.key:this.getThreadParticipant(t).id===this.getThreadParticipant(this.activeThread).id)}trackByThread(t,r){return r.id||r.key||t.toString()}static \u0275fac=function(r){return new(r||n)(e.rXU(ea.o),e.rXU(jn.u),e.rXU(oi.a),e.rXU(rt.n))};static \u0275cmp=e.VBU({type:n,selectors:[["app-threads-list"]],inputs:{activeChannel:"activeChannel",selectedPage:"selectedPage",incomingNewThread:"incomingNewThread"},outputs:{conversationSelect:"conversationSelect"},standalone:!1,features:[e.OA$],decls:1,vars:1,consts:[["noThreads",""],["genericEmptyState",""],["class","flex flex-column w-24rem h-screen border-right-1 surface-border transition-colors",3,"ngClass","ngStyle",4,"ngIf"],[1,"flex","flex-column","w-24rem","h-screen","border-right-1","surface-border","transition-colors",3,"ngClass","ngStyle"],[1,"flex","align-items-center","justify-content-between","p-3","mb-2"],[1,"flex","align-items-center","gap-2"],[1,"w-2rem","h-2rem","border-circle","flex","align-items-center","justify-content-center","overflow-hidden"],[1,"w-full","h-full","object-cover",3,"src"],[1,"font-bold","m-0",2,"font-size","1.1rem",3,"ngStyle"],["pButton","","type","button","icon","pi pi-refresh","title","Reload Threads",1,"p-button-text","p-button-sm",3,"click","ngStyle"],[1,"flex","flex-column","gap-3"],[1,"flex","align-items-center","border-round-xl","px-3","py-2","mx-2","border-1",2,"background-color","rgba(255, 255, 255, 0.6)","border-color","rgba(0, 0, 0, 0.05)"],[1,"pi","pi-search","text-400","mr-2",2,"font-size","0.75rem"],["type","text","pInputText","","placeholder","Search messages...",1,"w-full","border-none","bg-transparent","p-0","shadow-none","focus:shadow-none","text-sm","text-900",2,"outline","none",3,"ngModelChange","ngModel"],[1,"mt-1","px-3","border-bottom-1","surface-border"],[1,"flex","gap-4"],[1,"pb-2","font-bold","cursor-pointer","transition-all","text-xs",3,"click","ngClass","ngStyle"],[1,"flex-grow-1","overflow-y-auto","position-relative","mt-2"],["class","flex justify-content-center align-items-center w-full h-full",4,"ngIf"],[4,"ngIf"],[1,"flex","justify-content-center","align-items-center","w-full","h-full"],["styleClass","w-3rem h-3rem"],[4,"ngIf","ngIfElse"],["class","flex gap-3 p-3 cursor-pointer transition-all relative mx-2 mb-1 border-round-xl",3,"ngClass","ngStyle","click",4,"ngFor","ngForOf","ngForTrackBy"],[1,"flex","gap-3","p-3","cursor-pointer","transition-all","relative","mx-2","mb-1","border-round-xl",3,"click","ngClass","ngStyle"],["class","absolute left-0 top-0 h-full border-round-left-xl",3,"ngStyle",4,"ngIf"],[1,"relative","flex-shrink-0","flex","align-items-center","justify-content-center"],["shape","circle","styleClass","w-2.5rem h-2.5rem",3,"label"],[1,"absolute","flex","align-items-center","justify-content-center","border-circle","bg-white","shadow-1",2,"bottom","-2px","right","-2px","width","16px","height","16px"],[2,"width","11px","height","11px","display","block",3,"src"],[1,"flex","flex-column","flex-grow-1","gap-1","overflow-hidden"],[1,"flex","justify-content-between","align-items-center"],[1,"text-900","font-medium","text-xs","truncate","pr-2"],[1,"text-500","font-medium","whitespace-nowrap",2,"font-size","0.65rem"],[1,"flex","justify-content-between","align-items-center","gap-2"],[1,"text-500","line-height-2","overflow-hidden","text-overflow-ellipsis","flex-grow-1",2,"font-size","0.7rem","display","-webkit-box","-webkit-line-clamp","1","-webkit-box-orient","vertical"],["class","border-circle flex align-items-center justify-content-center text-white font-bold text-xs animate-scalein",3,"ngStyle",4,"ngIf"],[1,"absolute","left-0","top-0","h-full","border-round-left-xl",3,"ngStyle"],[1,"border-circle","flex","align-items-center","justify-content-center","text-white","font-bold","text-xs","animate-scalein",3,"ngStyle"],[1,"flex","flex-column","align-items-center","justify-content-center","py-6","px-3","text-center"],[1,"surface-100","border-circle","flex","align-items-center","justify-content-center","mb-3",2,"width","54px","height","54px"],[1,"pi","pi-inbox","text-500",2,"font-size","1.5rem"],[1,"text-sm","font-semibold","text-800","mb-1"],[1,"text-500","text-xs","m-0","px-2","line-height-3",2,"max-width","260px"],[1,"text-500","text-xs","m-0","px-2","line-height-3",2,"max-width","240px"]],template:function(r,i){1&r&&e.DNE(0,Y4,22,24,"div",2),2&r&&e.Y8G("ngIf",i.activeChannel&&i.isChannelPageActive)},dependencies:[q.YU,q.Sq,q.bT,q.B3,zn.eu,Qe.Sm,L.me,L.BC,L.vS,xe._f,Ai.pT,q.PV],styles:[".thread-panel[_ngcontent-%COMP%]{width:320px;border-right:1px solid #e4e6eb;display:flex;flex-direction:column}.thread-header[_ngcontent-%COMP%]{padding:16px;font-weight:600;border-bottom:1px solid #e4e6eb}.thread-list[_ngcontent-%COMP%]{flex:1;overflow-y:auto}.thread-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;padding:10px 16px;cursor:pointer}.thread-item[_ngcontent-%COMP%]:hover{background:#f5f6f7}.thread-item.active[_ngcontent-%COMP%]{background:#e7f3ff}.thread-text[_ngcontent-%COMP%]{flex:1;overflow:hidden}
1.thread-name[_ngcontent-%COMP%]{font-weight:600}.thread-snippet[_ngcontent-%COMP%]{font-size:13px;color:#65676b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.text-2-lines[_ngcontent-%COMP%]{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;line-height:1.2rem;max-height:2.4rem}"]})}return n})();var Cc=ee(18865);const H4=["chatScroller"],z4=["emojiPanel"],q4=["fileInput"],J4=()=>({width:"400px"}),kc=()=>({background:"var(--channel-primary)"}),K4=()=>({background:"var(--channel-bg-chat)"}),Q4=()=>({padding:"0"}),Z4=()=>({width:"320px"}),sa=()=>({"background-color":"var(--avatar-bg)",color:"var(--avatar-text)","font-weight":"700"}),ek=n=>({"background-color":n,"border-color":"var(--avatar-bg)"}),tk=()=>({"background-color":"var(--channel-primary)"}),nk=()=>({color:"var(--avatar-text)"}),rk=(n,a)=>({"align-self-end flex-row-reverse":n,"align-self-start":a}),ik=(n,a,t)=>({background:n,color:a,"border-radius":t}),ak=n=>({"text-right":n}),sk=n=>({"mt-2":n}),ok=(n,a)=>({"border-color":n,color:a}),Tc=()=>({color:"var(--channel-primary)"});function lk(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",36)(1,"div",37),e.nrm(2,"img",38),e.k0s(),e.j41(3,"div",39)(4,"div",40),e.EFF(5),e.k0s(),e.j41(6,"div",29),e.EFF(7),e.k0s()(),e.j41(8,"a",41),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG(2);return e.Njj(s.adminAndOnwer?s.openIntegration(i):s.openDenielModal())}),e.EFF(9),e.nrm(10,"i",42),e.k0s()()}if(2&n){const t=a.$implicit;e.R7$(2),e.Y8G("src",t.logo,e.B4B)("alt",t.name),e.R7$(3),e.JRh(t.name),e.R7$(2),e.JRh(t.desc),e.R7$(),e.AVh("text-blue-600",!t.integrated)("cursor-pointer",!t.integrated)("hover\\:underline",!t.integrated),e.R7$(),e.SpI(" ",t.integrated?"Manage":"Connect"," ")}}function ck(n,a){if(1&n&&(e.qex(0),e.j41(1,"div",19)(2,"div",20)(3,"div",21)(4,"h1",22),e.EFF(5,"Welcome to Connections"),e.k0s(),e.j41(6,"p",23),e.EFF(7," Your omni-channel inbox that turns every conversation into a sales opportunity. Connect your social platforms and start capturing leads automatically. "),e.k0s()(),e.j41(8,"div",24)(9,"div",25)(10,"div",26),e.nrm(11,"i",27),e.k0s(),e.j41(12,"div")(13,"div",28),e.EFF(14,"Instant Lead Capture"),e.k0s(),e.j41(15,"div",29),e.EFF(16,"Every message from any platform automatically becomes a trackable lead."),e.k0s()()(),e.j41(17,"div",25)(18,"div",26),e.nrm(19,"i",30),e.k0s(),e.j41(20,"div")(21,"div",28),e.EFF(22,"Unified Inbox"),e.k0s(),e.j41(23,"div",29),e.EFF(24,"Reply to WhatsApp, Messenger, and Instagram without leaving DeskFlo."),e.k0s()()(),e.j41(25,"div",25)(26,"div",26),e.nrm(27,"i",31),e.k0s(),e.j41(28,"div")(29,"div",28),e.EFF(30,"One-Click Qualification"),e.k0s(),e.j41(31,"div",29),e.EFF(32,"Qualify prospects and push them to your Sales Funnel with a single click."),e.k0s()()(),e.j41(33,"div",25)(34,"div",26),e.nrm(35,"i",32),e.k0s(),e.j41(36,"div")(37,"div",28),e.EFF(38,"Never Miss a Lead"),e.k0s(),e.j41(39,"div",29),e.EFF(40,"All conversations are centralized \u2014 no more switching between apps or losing track of prospects."),e.k0s()()()(),e.j41(41,"div",33),e.EFF(42,"Connect a platform to get started"),e.k0s(),e.j41(43,"div",34),e.DNE(44,lk,11,11,"div",35),e.k0s()()(),e.bVm()),2&n){const t=e.XpG();e.R7$(44),e.Y8G("ngForOf",t.integrations)}}function dk(n,a){if(1&n&&(e.j41(0,"div",62),e.nrm(1,"p-avatar",63),e.j41(2,"div",64)(3,"span",65),e.EFF(4),e.k0s(),e.j41(5,"span",66),e.EFF(6,"Active on Messenger"),e.k0s()()()),2&n){const t=e.XpG(3);e.R7$(),e.Aen(e.lJ4(4,sa)),e.Y8G("label",null==t.activeThread.senders||null==t.activeThread.senders.data||null==t.activeThread.senders.data[0]||null==t.activeThread.senders.data[0].name?null:t.activeThread.senders.data[0].name[0]),e.R7$(3),e.JRh(null==t.activeThread.senders||null==t.activeThread.senders.data||null==t.activeThread.senders.data[0]?null:t.activeThread.senders.data[0].name)}}function pk(n,a){if(1&n&&(e.j41(0,"div",62),e.nrm(1,"p-avatar",63),e.j41(2,"div",64)(3,"span",65),e.EFF(4),e.k0s(),e.j41(5,"span",66),e.EFF(6,"Active on WhatsApp"),e.k0s()()()),2&n){const t=e.XpG(3);e.R7$(),e.Aen(e.lJ4(4,sa)),e.Y8G("label",null==t.activeThread.name?null:t.activeThread.name[0]),e.R7$(3),e.JRh(t.activeThread.name)}}function uk(n,a){if(1&n&&(e.j41(0,"div",62),e.nrm(1,"p-avatar",63),e.j41(2,"div",64)(3,"span",65),e.EFF(4),e.k0s(),e.j41(5,"span",66),e.EFF(6,"Active on Instagram"),e.k0s()()()),2&n){let t;const r=e.XpG(3);e.R7$(),e.Aen(e.lJ4(4,sa)),e.Y8G("label",null==(t=r.getThreadParticipant(r.activeThread).name)?null:t[0]),e.R7$(3),e.JRh(r.getThreadParticipant(r.activeThread).name)}}function fk(n,a){1&n&&(e.j41(0,"div",67),e.nrm(1,"p-progressSpinner",68),e.k0s())}function mk(n,a){if(1&n&&(e.j41(0,"div",72)(1,"div",73),e.nrm(2,"i",74),e.k0s(),e.j41(3,"span",75),e.EFF(4),e.k0s()()),2&n){const t=e.XpG(4);e.Y8G("ngStyle",e.eq3(4,ek,"instagram"===t.activeChannel?"#fff0f3":"whatsapp"===t.activeChannel?"#e2f7f2":"#f0f7ff")),e.R7$(),e.Y8G("ngStyle",e.lJ4(6,tk)),e.R7$(2),e.Y8G("ngStyle",e.lJ4(7,nk)),e.R7$(),e.SpI(" ",t.getRemainingTimeText()," ")}}function hk(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",83)(1,"img",84,4),e.bIt("error",function(){e.eBV(t);const i=e.sdS(2),s=e.sdS(4);return i.style.display="none",e.Njj(s.style.display="block")}),e.k0s(),e.j41(3,"div",85,5),e.nrm(5,"p-avatar",86),e.k0s()()}if(2&n){let t;const r=e.XpG().$implicit,i=e.XpG(4);e.R7$(),e.Y8G("src",null!=r.from&&r.from.id?"https://graph.facebook.com/"+r.from.id+"/picture?type=square&access_token="+i.activePageToken:"",e.B4B),e.R7$(4),e.Aen(e.lJ4(4,sa)),e.Y8G("label",null==(t=i.getThreadParticipant(i.activeThread).name)?null:t[0])}}function gk(n,a){if(1&n){const t=e.RV6();e.j41(0,"img",88,7),e.bIt("error",function(){e.eBV(t);const i=e.sdS(1);
1e.XpG();const s=e.sdS(3);return i.style.display="none",e.Njj(s.style.display="block")}),e.k0s()}if(2&n){const t=e.XpG(2).$implicit;e.Y8G("src",t.from.picture.url,e.B4B)}}function _k(n,a){if(1&n&&(e.j41(0,"div",83),e.DNE(1,gk,2,1,"img",87),e.j41(2,"div",null,6),e.nrm(4,"p-avatar",86),e.k0s()()),2&n){let t;const r=e.XpG().$implicit,i=e.XpG(4);e.R7$(),e.Y8G("ngIf",null==r.from||null==r.from.picture?null:r.from.picture.url),e.R7$(),e.xc7("display",null!=r.from&&null!=r.from.picture&&r.from.picture.url?"none":"block"),e.R7$(2),e.Aen(e.lJ4(6,sa)),e.Y8G("label",null==(t=i.getThreadParticipant(i.activeThread).name)?null:t[0])}}function xk(n,a){if(1&n&&(e.j41(0,"div"),e.EFF(1),e.k0s()),2&n){const t=e.XpG().$implicit;e.R7$(),e.JRh(t.message)}}function vk(n,a){if(1&n&&(e.j41(0,"a",95),e.nrm(1,"img",96),e.k0s()),2&n){const t=e.XpG().$implicit;e.Y8G("href",(null==t.image_data?null:t.image_data.url)||t.file_url,e.B4B),e.R7$(),e.Y8G("src",(null==t.image_data?null:t.image_data.url)||t.file_url,e.B4B)("alt",t.name)}}function bk(n,a){if(1&n&&e.nrm(0,"video",97),2&n){const t=e.XpG().$implicit;e.Y8G("src",(null==t.video_data?null:t.video_data.url)||t.file_url,e.B4B)}}function Ck(n,a){if(1&n&&e.nrm(0,"audio",98),2&n){const t=e.XpG().$implicit;e.Y8G("src",(null==t.audio_data?null:t.audio_data.url)||t.file_url,e.B4B)}}function kk(n,a){if(1&n&&(e.j41(0,"a",99)(1,"span",64)(2,"span",100),e.EFF(3),e.k0s(),e.j41(4,"span",101),e.EFF(5),e.nI1(6,"number"),e.k0s()()()),2&n){const t=e.XpG().$implicit,r=e.XpG(2).$implicit,i=e.XpG(4);e.Y8G("href",t.file_url,e.B4B)("ngStyle",e.l_i(7,ok,i.isMe(r)?"var(--my-message-text)":"#dcdcdc",i.isMe(r)?"var(--my-message-text)":"#111b21")),e.R7$(3),e.JRh(t.name),e.R7$(2),e.SpI("",e.i5U(6,4,t.size/1024,"1.0-0")," KB")}}function Tk(n,a){if(1&n&&(e.j41(0,"div"),e.DNE(1,vk,2,3,"a",91)(2,bk,1,1,"video",92)(3,Ck,1,1,"audio",93)(4,kk,7,10,"a",94),e.k0s()),2&n){const t=a.$implicit,r=e.XpG(6);e.R7$(),e.Y8G("ngIf",r.isImageAttachment(t)),e.R7$(),e.Y8G("ngIf",r.isVideoAttachment(t)),e.R7$(),e.Y8G("ngIf",r.isAudioAttachment(t)),e.R7$(),e.Y8G("ngIf",!r.isImageAttachment(t)&&!r.isVideoAttachment(t)&&!r.isAudioAttachment(t))}}function wk(n,a){if(1&n&&(e.j41(0,"div",89),e.DNE(1,Tk,5,4,"div",90),e.k0s()),2&n){const t=e.XpG().$implicit;e.Y8G("ngClass",e.eq3(2,sk,t.message)),e.R7$(),e.Y8G("ngForOf",t.attachments.data)}}function yk(n,a){1&n&&(e.j41(0,"span",102),e.nrm(1,"i",103)(2,"i",104),e.k0s()),2&n&&(e.R7$(),e.Y8G("ngStyle",e.lJ4(2,Tc)),e.R7$(),e.Y8G("ngStyle",e.lJ4(3,Tc)))}function Fk(n,a){if(1&n&&(e.j41(0,"div",76),e.DNE(1,hk,6,5,"div",77)(2,_k,5,7,"div",77),e.j41(3,"div",78)(4,"div",79),e.DNE(5,xk,2,1,"div",9)(6,wk,2,4,"div",80),e.k0s(),e.j41(7,"span",81),e.EFF(8),e.nI1(9,"date"),e.DNE(10,yk,3,4,"span",82),e.k0s()()()),2&n){const t=a.$implicit,r=e.XpG(4);e.Y8G("ngClass",e.l_i(13,rk,r.isMe(t),!r.isMe(t))),e.R7$(),e.Y8G("ngIf","messenger"===r.activeChannel&&!r.isMe(t)),e.R7$(),e.Y8G("ngIf","instagram"===r.activeChannel&&!r.isMe(t)),e.R7$(2),e.Y8G("ngClass",r.isMe(t)?"":"bg-white text-900 border-1 surface-border")("ngStyle",e.sMw(16,ik,r.isMe(t)?"var(--my-message-bg)":"#ffffff",r.isMe(t)?"var(--my-message-text)":"#111b21",r.isMe(t)?"12px 12px 0px 12px":"12px 12px 12px 0px")),e.R7$(),e.Y8G("ngIf",t.message),e.R7$(),e.Y8G("ngIf",null==t.attachments||null==t.attachments.data?null:t.attachments.data.length),e.R7$(),e.Y8G("ngClass",e.eq3(20,ak,r.isMe(t))),e.R7$(),e.SpI(" ",e.i5U(9,10,t.created_time,"shortTime")," "),e.R7$(2),e.Y8G("ngIf",r.isMe(t))}}function Sk(n,a){if(1&n&&(e.qex(0),e.DNE(1,mk,5,8,"div",69),e.j41(2,"div",70,3),e.DNE(4,Fk,11,22,"div",71),e.k0s(),e.bVm()),2&n){const t=e.XpG(3);e.R7$(),e.Y8G("ngIf",t.messages&&t.messages.length>0),e.R7$(3),e.Y8G("ngForOf",t.messages)}}function Ek(n,a){if(1&n&&e.nrm(0,"img",112),2&n){const t=e.XpG(4);e.Y8G("src",t.selectedFilePreviewUrl,e.B4B)}}function Ik(n,a){1&n&&e.nrm(0,"i",113)}function Dk(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",105),e.DNE(1,Ek,1,1,"img",106)(2,Ik,1,0,"i",107),e.j41(3,"div",108)(4,"span",109),e.EFF(5),e.k0s(),e.j41(6,"span",110),e.EFF(7),e.k0s()(),e.j41(8,"i",111),e.bIt("click",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.clearSelectedFile())}),e.k0s()()}if(2&n){const t=e.XpG(3);e.R7$(),e.Y8G("ngIf",t.selectedFilePreviewUrl),e.R7$(),e.Y8G("ngIf",!t.selectedFilePreviewUrl),e.R7$(3),e.SpI(" ",t.selectedFile.name," "),e.R7$(2),e.JRh(t.formatFileSize(t.selectedFile.size))}}function Rk(n,a){if(1&n){const t=e.RV6();e.j41(0,"input",114),e.mxI("ngModelChange",function(i){e.eBV(t);const s=e.XpG(3);return e.DH7(s.messageText,i)||(s.messageText=i),e.Njj(i)}),e.bIt("keyup.enter",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.handleSend())}),e.k0s()}if(2&n){const t=e.XpG(3);e.R50("ngModel",t.messageText),e.Y8G("disabled",t.isSending)}}function jk(n,a){1&n&&(e.j41(0,"span",115),e.EFF(1," Ready to send attachment "),e.k0s())}function Ak(n,a){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"div",44),e.DNE(2,dk,7,5,"div",45)(3,pk,7,5,"div",45)(4,uk,7,5,"div",45),e.j41(5,"div",46)(6,"button",47),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.createLeadFromChannel(i.activeThread))}),e.k0s()()(),e.j41(7,"div",48),e.DNE(8,fk,2,0,"div",49)(9,Sk,5,2,"ng-container",9),e.k0s(),e.j41(10,"div",50),e.DNE(11,Dk,9,4,"div",51),e.j41(12,"div",52)(13,"input",53,1),e.bIt("change",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.onFileSelected(i))}),e.k0s(),e.j41(15,"i",54),e.bIt("click",function(){e.eBV(t);const i=e.sdS(14);return e.Njj(i.click())}),e.k0s(),e.j41(16,"i",55),e.bIt("click",function(i){e.eBV(t);const s=e.sdS(18);return e.Njj(s.toggle(i))}),e.k0s(),e.j41(17,"p-popover",56,2)(19,"emoji-mart",57),e.bIt("emojiClick",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.addEmoji(i))}),e.k0s()(),e.j41(20,"div",58),e.DNE(21,Rk,1,2,"input",59)(22,jk,2,0,"span",60),e.k0s(),e.j41(23,"button",61),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.handleSend())}),e.k0s()()(),e.bVm()}if(2&n){const t=e.XpG(2);e.R7$(2),e.Y8G("ngIf","messenger"===t.activeChannel),e.R7$(),e.Y8G("ngIf","whatsapp"===t.activeChannel),e.R7$(),e.Y8G("ngIf","instagram"===t.activeChannel),e.R7$(2),e.Y8G("loading",t.creatingLead)("disabled",t.creatingLead)("ngStyle",e.lJ4(22,kc)),e.R7$(),e.Y8G("ngStyle",e.lJ4(23,K4)),e.R7$(),e.Y8G("ngIf",t.loadingMessages),e.R7$(),e.Y8G("ngIf",!t.loadingMessages),e.R7$(2),e.Y8G("ngIf",t.selectedFile),e.R7$(6),e.Aen(e.lJ4(24,Q4)),e.R7$(2),e.Aen(e.lJ4(25,Z4)),e.Y8G("showPreview",!1)("emojiSize",20)("perLine",8),e.R7$(2),e.Y8G("ngIf",!t.selectedFile),e.R7$(),e.Y8G("ngIf",t.selectedFile),e.R7$(),e.Y8G("icon",t.isSending||t.uploadingAttachment?"pi pi-spin pi-spinner":"pi pi-send")("disabled",t.uploadingAttachment||t.isSending)("ngStyle",e.lJ4(26,kc))}}function Mk(n,a){1&n&&(e.j41(0,"div",116)(1,"div",117),e.nrm(2,"i",118),e.k0s(),e.j41(3,"h3",119),e.EFF(4,"No Conversation Selected"),e.k0s(),e.j41(5,"p",120),e.EFF(6," Select a customer thread from the left pane sidebar to view connection history and engage with prospects. "),e.k0s()())}function Pk(n,a){if(1&n&&(e.qex(0),e.DNE(1,Ak,24,27,"ng-container",43)(2,Mk,7,0,"ng-template",null,0,e.C5r),e.bVm()),2&n){const t=e.sdS(3),r=e.XpG();e.R7$(),e.Y8G("ngIf",r.activeThread)("ngIfElse",t)}}let Ok=(()=>{class n{fbService;auth;integrationService;messageService;_boardService;router;teamsService;messageText="";activePageId;activePageToken;activeThread;collapsed=!1;chatScroller;selectedPage;activeChannel;connectIntegration=new e.bkB;emojiPanel;fileInput;messages=[];loadingMessages=!1;tags=[];isConnected=!1;showMetaModal=!1;teamId;creatingLead=!1;hasConnectedChannels;integrations=[];hasActiveChannelPage;displayDenialModal;instagramBusinessAccountId;selectedFile=null;selectedFilePreviewUrl=null;uploadingAttachment=!1;isSending=!1;constructor(t,r,i,s,o,l,c){this.fbService=t,this.auth=r,this.integrationService=i,this.messageService=s,this._boardService=o,this.router=l,this.teamsService=c}ngOnChanges(t){const r=this.selectedPage||this.integrationService.getSelectedPage();if(r){if("whatsapp"===this.activeChannel){if(!r.PhoneNumberId)return void this.clearActiveChannelState();this.activePageId=r.PhoneNumberId,this.activePageToken=r.Token,this.hasActiveChannelPage=!0}else if("messenger"===this.activeChannel){if(!r.PageId)return void this.clearActiveChannelState();this.activePageId=r.PageId,this.activePageToken=r.Token,this.hasActiveChannelPage=!0}else if("instagram"===this.activeChannel){if(!r.PageId)return void this.clearActiveChannelState();this.activePageId=r.PageId,this.activePageToken=r.Token,this.instagramBusinessAccountId=r.InstagramBusinessAccountId,this.hasActiveChannelPage=!0}if(t.activeThread&&this.activeThread){const i=t.activeThread.previousValue?.id,s=t.activeThread.currentValue?.id;if(i!==s)this.loadMessages();else{const o=t.activeThread.currentValue;if(o.Messages&&o.Messages.length>0){const l=o.Messages[o.Messages.length-1];this.messages.some(d=>d.id===l.id)||(this.messages.push({id:l.id,message:l.Text,attachments:this.normalizeAttachments(l.Attachments),created_time:l.Timestamp||(new Date).toISOString(),is_from_me:!l.IsIncoming,from:l.IsIncoming?{id:l.SenderId,name:""}:{id:"me",name:"You"}}),setTimeout(()=>{this.scrollToBottom()},0))}}}}else this.clearActiveChannelState()}clearActiveChannelState(){this.activePageId=null,this.activePageToken=null,this.activeThread=null,this.messages=[],this.hasActiveChannelPage=!1,this.instagramBusinessAccountId=null}ngOnInit(){this.teamId=this.teamsService.getCurrentTeam.Team.Id,this.integrationService.facebookIntegrations$.subscribe(r=>{if(!r.length)return this.selectedPage=null,this.activePageId=null,this.activePageToken=null,this.activeThread=null,this.messages=[],this.loadingMessages=!1,void(this.hasConnectedChannels=!1);const i=this.integrationService.getSelectedPage();i&&(this.activePageId=i.PageId,this.activePageToken=i.Token)}),this.integrationService.instagramIntegrations$.subscribe(r=>{if(!r.length)return this.instagramBusinessAccountId=null,this.activePageId=null,this.activePageToken=null,this.activeThread=null,this.messages=[],this.loadingMessages=!1,void(this.hasConnectedChannels=!1);const i=this.integrationService.getSelectedPage();i&&(this.activePageId=i.PageId,this.activePageToken=i.Token,this.instagramBusinessAccountId=i.InstagramBusinessAccountId)}),this.integrationService.whatsappIntegrations$.subscribe(r=>{if(!r.length)return this.selectedPage=null,this.activePageId=null,this.activePageToken=null,this.activeThread=null,this.messages=[],this.loadingMessages=!1,void(this.hasConnectedChannels=!1);const i=this.integrationService.getSelectedPage();i&&(this.activePageId=i.PhoneNumberId,this.activePageToken=i.Token)})}loadMessages(){var t=this;return(0,nt.A)(function*(){if(!t.activeThread)return t.messages=[],void(t.loadingMessages=!1);if("messenger"===t.activeChannel&&!t.activePageToken)return t.messages=[],void(t.loadingMessages=!1);t.loadingMessages=!0;try{t.messages="whatsapp"===t.activeChannel?yield t.fbService.getWhatsAppMessagesFromDb(t.activeThread.id).toPromise():"instagram"===t.activeChannel?yield t.fbService.getInstagramThreadMessages(t.activeThread.id,t.activePageToken):yield t.fbService.getThreadMessages(t.activeThread.id,t.activePageToken),setTimeout(()=>{t.scrollToBottom()},0)}catch(r){console.error(`Failed to load messages for ${t.activeChannel}`,r),t.messages=[]}finally{t.loadingMessages=!1}})()}sendMessage(){var t=this;return(0,nt.A)(function*(){if(t.messageText.trim()&&t.activeThread&&!t.isSending){if(("messenger"===t.activeChannel||"instagram"===t.activeChannel)&&!t.isWithin24Hours())return void t.messageService.add({severity:"warn",summary:"Messaging Window Closed",detail
1:"The 24-hour reply window has expired. You cannot respond to this user.",life:4e3});t.isSending=!0;try{if("whatsapp"===t.activeChannel){const r=t.activeThread.to_phone_number;if(!r)return void console.error("No phone number assigned to this WhatsApp thread.");yield t.fbService.sendWhatsAppMessage(t.teamId,r,t.messageText).toPromise(),t.messages.push({id:"msg_temp_"+Date.now(),message:t.messageText,created_time:(new Date).toISOString(),is_from_me:!0})}else if("instagram"===t.activeChannel){const r=t.activeThread.participants?.data??[],i=r.find(s=>s.id!==t.instagramBusinessAccountId)??r[1];if(!i)return void console.error("Could not determine recipient ID for Instagram message.");yield t.fbService.sendMessage(i.id,t.messageText,t.activePageToken)}else if("messenger"===t.activeChannel){const r=t.activeThread.senders?.data?.find(i=>i.id!==t.activePageId)?.id;if(!r)return void console.error("Could not determine recipient ID for Messenger message.");yield t.fbService.sendMessage(r,t.messageText,t.activePageToken),t.messages.push({id:"msg_temp_"+Date.now(),message:t.messageText,from:{id:t.activePageId,name:"You"},created_time:(new Date).toISOString()})}else console.warn(`Unmanaged channel platform detected: ${t.activeChannel}`);t.messageText="",setTimeout(()=>{t.scrollToBottom()},0)}catch(r){t.messageService.add({severity:"error",summary:"Message Failed",detail:`Something went wrong while sending the ${t.activeChannel} message.`,life:4e3}),console.error(r)}finally{t.isSending=!1}}})()}isWithin24Hours(){if(!this.activeThread?.updated_time)return!1;const t=new Date(this.activeThread.updated_time).getTime();return((new Date).getTime()-t)/36e5<=24}isMe(t){return"messenger"===this.activeChannel?!(!t.is_from_me&&t.from?.id!==this.activePageId):"whatsapp"===this.activeChannel?!0===t.is_from_me:"instagram"===this.activeChannel&&!(!t.is_from_me&&t.from?.id!==this.instagramBusinessAccountId)}createLeadFromChannel(t){var r=this;return(0,nt.A)(function*(){if(console.log("testing ",t),t&&t.id){r.creatingLead=!0;try{let i={dueDateUtc:null,assignee:[r.auth.getUserId()],tagIds:[]};if("messenger"===r.activeChannel){const o=t.senders?.data?.find(l=>!l.email?.endsWith("@facebook.com")||l.id!==t.senders?.data[1]?.id)||t.senders?.data?.[0];i.title="Messenger Inbound Lead",i.messengerThreadId=t.id,i.associatePerson=o?.name,i.cardTypeId=J.bU.Messenger}else if("whatsapp"===r.activeChannel)i.title="WhatsApp Inbound Lead",i.whatsappThreadId=t.id,i.associatePerson=t.name||t.to_phone_number,i.cardTypeId=J.bU.WhatsApp;else{if("instagram"!==r.activeChannel)return;{const o=t.participants?.data?.find(l=>l.id!==r.instagramBusinessAccountId);i.title="Instagram Inbound Lead",i.instagramThreadId=t.id,i.associatePerson=o?.username,i.cardTypeId=J.bU.Instagram}}const s=r.getFirstTrack();if(!s)return;yield r.createDealFromLead(i,s)}finally{r.creatingLead=!1}}})()}createDealFromLead(t,r){var i=this;return(0,nt.A)(function*(){if(r.Cards?.some(l=>"messenger"===i.activeChannel&&l.MessengerThreadId===t.messengerThreadId||"whatsapp"===i.activeChannel&&l.WhatsAppThreadId===t.whatsappThreadId||"instagram"===i.activeChannel&&l.InstagramThreadId===t.instagramThreadId))return void i.messageService.add({severity:"warn",summary:"Already Exists",detail:`A lead for this ${i.activeChannel} conversation already exists`,life:3e3});const o=r.Cards?.length||0;try{const l=yield(0,ct._)(i._boardService.createCard(t,r.Id,o));i.messageService.add({severity:"success",summary:"Lead Created",detail:`Lead created from ${i.activeChannel} conversation "${l.Title}"`,life:3e3}),i.router.navigate(["/dashboard/sales/sales-tracker"])}catch(l){i.messageService.add({severity:"error",summary:"Error",detail:`Failed to create lead from ${i.activeChannel} conversation`,life:3e3}),console.error(l)}})()}getFirstTrack(){const t=this._boardService.getCurrentTracks;return t&&0!==t.length?t[0]:(this.messageService.add({severity:"warn",summary:"No Tracks Found",detail:"There are no tracks to add this tender to",life:3e3}),null)}scrollToBottom(){try{this.chatScroller&&this.chatScroller.nativeElement&&(this.chatScroller.nativeElement.scrollTop=this.chatScroller.nativeElement.scrollHeight)}catch(t){console.warn("Scroll execution step skipped:",t)}}openIntegration(t){t.integrated||this.connectIntegration.emit(t)}get adminAndOnwer(){return["Owner","Admin"].includes(this.teamsService.getCurrentTeam?.Role)}openDenielModal(){this.displayDenialModal=!0}getRemainingTimeText(){if(!this.messages||0===this.messages.length)return"Window closed";const t=this.messages.filter(u=>u.from?.id!==this.activePageId&&u.created_time);if(0===t.length)return"Window closed";const i=new Date(t[t.length-1].created_time).getTime(),c=864e5-((new Date).getTime()-i);return c<=0?"Messenger 24-hour window: Expired. You cannot reply until the customer writes back.":`Messenger 24-hour window: You have ${Math.floor(c/36e5)}h ${Math.floor(c%36e5/6e4)}m left to reply. After that, messages cannot be sent until the customer writes back.`}addEmoji(t){this.messageText=(this.messageText||"")+t.emoji.native,this.emojiPanel.hide()}onFileSelected(t){const r=t.target,i=r.files?.[0];i&&(this.selectedFile=i,this.selectedFilePreviewUrl=i.type.startsWith("image/")?URL.createObjectURL(i):null,r.value="")}handleSend(){var t=this;return(0,nt.A)(function*(){if(t.selectedFile){const r=t.selectedFile;t.clearSelectedFile(),yield t.sendAttachment(r)}else yield t.sendMessage()})()}clearSelectedFile(){this.selectedFilePreviewUrl&&URL.revokeObjectURL(this.selectedFilePreviewUrl),this.selectedFile=null,this.selectedFilePreviewUrl=null}formatFileSize(t){return t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1048576).toFixed(1)} MB`}sendAttachment(t){var r=this;return(0,nt.A)(function*(){if("messenger"!==r.activeChannel||r.isWithin24Hours()){r.uploadingAttachment=!0;try{if("whatsapp"===r.activeChannel){if(!r.activeThread.to_phone_number)return void console.error("No phone number assigned to this mock thread.")}else{const i=r.activeThread.senders.data.find(l=>l.id!==r.activePageId)?.id,s=t.type.startsWith("image/"),o=URL.createObjectURL(t);yield r.fbService.sendMessengerAttachment(i,t,r.activePageToken),r.messages.push({message:"",attachments:{data:[{name:t.name,size:t.size,mime_type:t.type,image_data:s?{url:o}:void 0,file_url:o}]},from:{id:r.activePageId,name:"You"},created_time:new Date})}setTimeout(()=>r.scrollToBottom(),0)}catch(i){r.messageService.add({severity:"error",summary:"Attachment Failed",detail
1:`Something went wrong while sending the ${r.activeChannel} attachment.`,life:4e3}),console.error(i)}finally{r.uploadingAttachment=!1}}else r.messageService.add({severity:"warn",summary:"Messaging Window Closed",detail:"The 24-hour reply window has expired. You cannot respond to this user.",life:4e3})})()}getThreadParticipant(t){if(!t)return{name:"Unknown",id:""};switch(this.activeChannel){case"whatsapp":return{name:t.name??"WhatsApp User",id:t.key??""};case"instagram":{const r=t.participants?.data??[],i=r.find(s=>s.id!==this.instagramBusinessAccountId)??r[0];return i?{name:i.username??"Instagram User",id:i.id}:{name:"Instagram User",id:""}}case"messenger":{const r=t.senders?.data??[],i=r.find(s=>s.id!==this.activePageId)??r[0];return i?{name:i.name??"Facebook User",id:i.id}:{name:"Facebook User",id:""}}default:return{name:"Unknown",id:""}}}normalizeAttachments(t){return t&&t.length?{data:t.map(r=>{const i=(r.Type||"").toLowerCase(),s=r.Url;return{name:s?decodeURIComponent(s.split("/").pop().split("?")[0]):"attachment",size:0,mime_type:"image"===i?"image/*":"video"===i?"video/*":"audio"===i?"audio/*":"application/*",image_data:"image"===i?{url:s}:void 0,video_data:"video"===i?{url:s}:void 0,audio_data:"audio"===i?{url:s}:void 0,file_url:s}})}:null}isImageAttachment(t){return!!t.image_data||t.mime_type?.startsWith("image/")}isVideoAttachment(t){return!!t.video_data||t.mime_type?.startsWith("video/")}isAudioAttachment(t){return!!t.audio_data||t.mime_type?.startsWith("audio/")}static \u0275fac=function(r){return new(r||n)(e.rXU(ea.o),e.rXU(jn.u),e.rXU(oi.a),e.rXU(be.bg),e.rXU(_t.a),e.rXU(rn.Ix),e.rXU(rt.n))};static \u0275cmp=e.VBU({type:n,selectors:[["app-chat-window"]],viewQuery:function(r,i){if(1&r&&(e.GBs(H4,5),e.GBs(z4,5),e.GBs(q4,5)),2&r){let s;e.mGM(s=e.lsd())&&(i.chatScroller=s.first),e.mGM(s=e.lsd())&&(i.emojiPanel=s.first),e.mGM(s=e.lsd())&&(i.fileInput=s.first)}},inputs:{activeThread:"activeThread",collapsed:"collapsed",selectedPage:"selectedPage",activeChannel:"activeChannel",integrations:"integrations"},outputs:{connectIntegration:"connectIntegration"},standalone:!1,features:[e.OA$],decls:20,vars:9,consts:[["noThreadSelected",""],["fileInput",""],["emojiPanel",""],["chatScroller",""],["avatarImg",""],["fallbackContainer",""],["igFallback",""],["igAvatarImg",""],[1,"flex","flex-column","h-full","overflow-hidden","bg-gray-50","flex-grow-1","transition-all","transition-duration-300"],[4,"ngIf"],["appendTo","body","header","Access Restricted",3,"visibleChange","visible","modal","draggable","resizable"],[1,"flex","flex-column","align-items-center","text-center","px-2","pt-2"],[1,"flex","align-items-center","justify-content-center","bg-orange-100","border-circle","mb-3",2,"width","56px","height","56px"],[1,"pi","pi-lock","text-orange-600","text-2xl"],[1,"m-0","text-xl","font-semibold","text-900"],[1,"text-600","text-sm","line-height-3","mt-2","mb-4"],[1,"w-full","border-top-1","surface-border","pt-3","flex","justify-content-end"],["label","Got it","styleClass","p-button-sm p-button-secondary border-round-md",3,"onClick"],["position","top-right"],[1,"p-5","bg-transparent","deskflo-container","flex","justify-content-center",2,"max-height","90vh"],[1,"w-full","flex","flex-column",2,"max-width","500px"],[1,"mb-4","flex","flex-column","align-items-center"],[1,"text-900","font-bold","text-lg","mb-2"],[1,"text-600","line-height-3","text-xs","m-0"],[1,"flex","flex-column","gap-3","mb-4"],[1,"flex","align-items-center","p-3","border-1","border-round-xl","surface-border","bg-white","shadow-sm"],[1,"flex","align-items-center","justify-content-center","bg-blue-50","border-round","mr-3",2,"width","40px","height","40px","flex-shrink","0"],[1,"pi","pi-bolt","text-blue-600","text-xl"],[1,"text-sm","text-900","font-semibold"],[1,"text-500","text-xs"],[1,"pi","pi-users","text-blue-600","text-xl"],[1,"pi","pi-chart-line","text-blue-600","text-xl"],[1,"pi","pi-shield","text-blue-600","text-xl"],[1,"text-500","font-semibold","text-xs","uppercase","mb-3","letter-spacing-1","text-start"],[1,"flex","flex-column","gap-2"],["class","channel-row flex align-items-center p-3 border-1
1surface-border border-transparent border-round-xl transition-all transition-duration-200 hover:surface-100",4,"ngFor","ngForOf"],[1,"channel-row","flex","align-items-center","p-3","border-1","surface-border","border-transparent","border-round-xl","transition-all","transition-duration-200","hover:surface-100"],[1,"flex","align-items-center","justify-content-center","mr-3",2,"width","32px","height","32px","flex-shrink","0"],[2,"width","100%","height","100%","object-fit","contain",3,"src","alt"],[1,"flex-1"],[1,"text-sm","text-900","font-medium"],[1,"connect-link","font-bold","text-sm","ml-2",3,"click"],[1,"pi","pi-angle-right","text-xs"],[4,"ngIf","ngIfElse"],[1,"flex","align-items-center","justify-content-between","p-3","bg-white","border-bottom-1","surface-border","flex-shrink-0"],["class","flex align-items-center gap-2",4,"ngIf"],[1,"flex","align-items-center","gap-3","border-left-1","surface-border"],["pButton","","label","Create Lead","icon","pi pi-user-plus",1,"p-button-sm","border-none","ml-3","px-3","font-bold","border-round-lg","shadow-1",2,"font-size","0.75rem",3,"click","loading","disabled","ngStyle"],[1,"flex-grow-1","px-4","py-2","flex","flex-column","overflow-y-auto","transition-colors",2,"position","relative",3,"ngStyle"],["class","flex justify-content-center align-items-center","style","height: 200px; width: 35rem;",4,"ngIf"],[1,"p-3","bg-white","border-top-1","surface-border","flex-shrink-0"],["class","flex align-items-center gap-2 mb-2 p-2 surface-100 border-round-lg border-1 surface-border relative","style","max-width: 260px;",4,"ngIf"],[1,"flex","align-items-center","gap-3","surface-100","border-1","surface-border","border-round-3xl","px-3","py-1"],["type","file","hidden","","accept","image/*,.pdf,.doc,.docx",3,"change"],[1,"pi","pi-plus-circle","text-400","cursor-pointer",2,"font-size","1.2rem",3,"click"],[1,"pi","pi-face-smile","text-400","cursor-pointer",2,"font-size","1.2rem",3,"click"],["appendTo","body"],[3,"emojiClick","showPreview","emojiSize","perLine"],[1,"flex-grow-1","flex","align-items-center"],["type","text","pInputText","","placeholder","Type a message...","class","w-full border-none bg-transparent py-2 shadow-none focus:outline-none","style","font-size: 0.8rem; height: 38px;",3,"ngModel","disabled","ngModelChange","keyup.enter",4,"ngIf"],["class","text-500 text-sm",4,"ngIf"],["pButton","",1,"p-button-rounded","border-none","shadow-2",2,"width","32px","height","32px",3,"click","icon","disabled","ngStyle"],[1,"flex","align-items-center","gap-2"],["shape","circle",3,"label"],[1,"flex","flex-column"],[1,"font-bold","text-900",2,"font-size","0.85rem"],[1,"text-xs","text-500","flex","align-items-center","gap-1"],[1,"flex","justify-content-center","align-items-center",2,"height","200px","width","35rem"],["styleClass","w-3rem h-3rem","strokeWidth","4","animationDuration",".8s"],["class","sticky-banner flex align-items-center gap-3 p-3 border-round-xl border-1 mb-3",3,"ngStyle",4,"ngIf"],[1,"flex","flex-column","gap-3",2,"max-height","500px","overflow-y","auto"],["class","flex gap-1 max-w-70",3,"ngClass",4,"ngFor","ngForOf"],[1,"sticky-banner","flex","align-items-center","gap-3","p-3","border-round-xl","border-1","mb-3",3,"ngStyle"],[1,"border-circle","w-1rem","h-1rem","flex","align-items-center","justify-content-center","flex-shrink-0",3,"ngStyle"],[1,"pi","pi-info","text-white",2,"font-size","10px"],[1,"font-medium","text-xs",3,"ngStyle"],[1,"flex","gap-1","max-w-70",3,"ngClass"],["class","flex align-items-end mb-1",4,"ngIf"],[1,"flex","flex-column","gap-1"],[1,"p-2","px-3","m-0","shadow-1","max-w-25rem","font-medium","line-height-3",2,"font-size","0.75rem",3,"ngClass","ngStyle"],["class","flex flex-column gap-2",3,"ngClass",4,"ngIf"],[1,"text-400","mt-1","flex","align-items-center","gap-1","justify-content-end","select-none",2,"font-size","0.6rem",3,"ngClass"],["class","flex align-items-center justify-content-center","style","height: 10px;",4,"ngIf"],[1,"flex","align-items-end","mb-1"],["alt","Profile Avatar",1,"w-2rem","h-2rem","border-circle","shadow-1",3,"error","src"],[2,"display","none"],["shape","circle","styleClass","w-2rem h-2rem font-bold shadow-1 flex align-items-center justify-content-center",3,"label"],["alt","IG Profile Avatar","class","w-2rem h-2rem border-circle shadow-1",3,"src","error",4,"ngIf"],["alt","IG Profile Avatar",1,"w-2rem","h-2rem","border-circle","shadow-1",3,"error","src"],[1,"flex","flex-column","gap-2",3,"ngClass"],[4,"ngFor","ngForOf"],["target","_blank","rel","noopener noreferrer",3,"href",4,"ngIf"],["controls","","class","border-round-md","style","max-width: 260px; max-height: 260px; display:block;",3,"src",4,"ngIf"],["controls","","style","max-width: 260px; display:block;",3,"src",4,"ngIf"],["target","_blank","rel","noopener noreferrer","class","flex align-items-center gap-2 p-2 border-1 border-round-md no-underline",3,"href","ngStyle",4,"ngIf"],["target","_blank","rel","noopener noreferrer",3,"href"],[1,"border-round-md",2,"max-width","220px","max-height","220px","display","block",3,"src","alt"],["controls","",1,"border-round-md",2,"max-width","260px","max-height","260px","display","block",3,"src"],["controls","",2,"max-width","260px","display","block",3,"src"],["target","_blank","rel","noopener noreferrer",1,"flex","align-items-center","gap-2","p-2","border-1","border-round-md","
1no-underline",3,"href","ngStyle"],[1,"font-medium",2,"font-size","0.7rem","word-break","break-word"],[1,"text-500",2,"font-size","0.6rem"],[1,"flex","align-items-center","justify-content-center",2,"height","10px"],[1,"pi","pi-check","font-bold",2,"font-size","8px",3,"ngStyle"],[1,"pi","pi-check","font-bold",2,"font-size","8px","margin-left","-4px",3,"ngStyle"],[1,"flex","align-items-center","gap-2","mb-2","p-2","surface-100","border-round-lg","border-1","surface-border","relative",2,"max-width","260px"],["class","border-round-md flex-shrink-0","style","width: 40px; height: 40px; object-fit: cover;",3,"src",4,"ngIf"],["class","pi pi-file text-500 flex-shrink-0","style","font-size: 1.5rem;",4,"ngIf"],[1,"flex","flex-column","overflow-hidden"],[1,"text-xs","font-semibold","text-700","white-space-nowrap","overflow-hidden","text-overflow-ellipsis",2,"max-width","160px"],[1,"text-xs","text-500"],[1,"pi","pi-times-circle","cursor-pointer","text-500","hover:text-red-500","ml-2",2,"font-size","1rem",3,"click"],[1,"border-round-md","flex-shrink-0",2,"width","40px","height","40px","object-fit","cover",3,"src"],[1,"pi","pi-file","text-500","flex-shrink-0",2,"font-size","1.5rem"],["type","text","pInputText","","placeholder","Type a message...",1,"w-full","border-none","bg-transparent","py-2","shadow-none","focus:outline-none",2,"font-size","0.8rem","height","38px",3,"ngModelChange","keyup.enter","ngModel","disabled"],[1,"text-500","text-sm"],[1,"flex","flex-column","align-items-center","justify-content-center","h-full","text-center","p-5","flex-grow-1","bg-surface-50"],[1,"surface-100","border-circle","flex","align-items-center","justify-content-center","mb-3",2,"width","80px","height","80px"],[1,"pi","pi-comments","text-400",2,"font-size","2.5rem"],[1,"text-900","font-bold","mb-2"],[1,"text-500","text-xs","m-0",2,"max-width","320px"]],template:function(r,i){1&r&&(e.j41(0,"div",8),e.DNE(1,ck,45,1,"ng-container",9)(2,Pk,4,2,"ng-container",9),e.k0s(),e.j41(3,"p-dialog",10),e.mxI("visibleChange",function(o){return e.DH7(i.displayDenialModal,o)||(i.displayDenialModal=o),o}),e.j41(4,"div",11)(5,"div",12),e.nrm(6,"i",13),e.k0s(),e.j41(7,"h3",14),e.EFF(8,"Admin Permissions Required"),e.k0s(),e.j41(9,"p",15),e.EFF(10," Integrations can only be configured by a team "),e.j41(11,"strong"),e.EFF(12,"Admin"),e.k0s(),e.EFF(13," or "),e.j41(14,"strong"),e.EFF(15,"Owner"),e.k0s(),e.EFF(16,". Please contact your administrator to set up this connection. "),e.k0s(),e.j41(17,"div",16)(18,"p-button",17),e.bIt("onClick",function(){return i.displayDenialModal=!1}),e.k0s()()()(),e.nrm(19,"p-toast",18)),2&r&&(e.R7$(),e.Y8G("ngIf",!i.hasActiveChannelPage),e.R7$(),e.Y8G("ngIf",i.hasActiveChannelPage),e.R7$(),e.Aen(e.lJ4(8,J4)),e.R50("visible",i.displayDenialModal),e.Y8G("modal",!0)("draggable",!1)("resizable",!1))},dependencies:[q.YU,q.Sq,q.bT,q.B3,zn.eu,Ie.y8,Qe.Sm,L.me,L.BC,L.vS,jt.lG,xe._f,xe.$n,Ae.AM,Ai.pT,Cc.Ic,q.QX,q.vh],styles:[".sticky-banner[_ngcontent-%COMP%]{position:sticky;top:0;z-index:10;background-color:#eff6ff}.overflow-y-auto[_ngcontent-%COMP%]::-webkit-scrollbar{width:4px}.overflow-y-auto[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#e5e7eb;border-radius:10px}.deskflo-container[_ngcontent-%COMP%]{overflow-y:hidden;scrollbar-gutter:stable}.deskflo-container[_ngcontent-%COMP%]:hover{overflow-y:auto}.connect-link[_ngcontent-%COMP%]{opacity:0;transition:opacity .2s ease-in-out;white-space:nowrap;cursor:pointer}.channel-row[_ngcontent-%COMP%]:hover .connect-link[_ngcontent-%COMP%]{opacity:1}.channel-row[_ngcontent-%COMP%]:hover{border-color:#e2e8f0!important;background-color:#fff;box-shadow:0 1px 3px #0000001a}.letter-spacing-1[_ngcontent-%COMP%]{letter-spacing:.5px}.deskflo-container[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px}.deskflo-container[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#e2e8f0;border-radius:10px}"]})}return n})();const Nk=()=>({width:"600px"}),Gk=()=>({padding:"0"});function Bk(n,a){1&n&&(e.j41(0,"span"),e.EFF(1,"Facebook Page DMs"),e.k0s())}function Lk(n,a){1&n&&(e.j41(0,"span"),e.EFF(1,"Business Account DMs"),e.k0s())}function $k(n,a){1&n&&(e.j41(0,"span"),e.EFF(1,"Business API messages"),e.k0s())}function Vk(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",12)(1,"div",13),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG();return e.Njj(s.openModal(i))}),e.j41(2,"div",14),e.nrm(3,"img",15),e.k0s(),e.j41(4,"div",16)(5,"span",17),e.EFF(6),e.k0s(),e.j41(7,"span",18),e.qex(8,19),e.DNE(9,Bk,2,0,"span",20)(10,Lk,2,0,"span",20)(11,$k,2,0,"span",20),e.bVm(),e.k0s()()()()}if(2&n){const t=a.$implicit;e.R7$(3),e.Y8G("src",t.logo,e.B4B)("alt",t.name),e.R7$(3),e.JRh(t.name),e.R7$(2),e.Y8G("ngSwitch",t.type),e.R7$(),e.Y8G("ngSwitchCase","messenger"),e.R7$(),e.Y8G("ngSwitchCase","instagram"),e.R7$(),e.Y8G("ngSwitchCase","whatsapp")}}function Uk(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",12)(1,"button",21),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG();return e.Njj(s.openModal(i))}),e.k0s()()}if(2&n){const t=a.$implicit;e.R7$(),e.Y8G("label","Preview "+t.name+" terms")}}function Xk(n,a){if(1&n&&e.nrm(0,"img",75),2&n){const t=e.XpG(2);e.Y8G("src",t.selectedChannel.logo,e.B4B)}}function Yk(n,a){1&n&&e.nrm(0,"i",76)}function Wk(n,a){1&n&&(e.j41(0,"span"),e.EFF(1,"Facebook Page DMs"),e.k0s())}function Hk(n,a){1&n&&(e.j41(0,"span"),e.EFF(1,"Business Account DMs"),e.k0s())}function zk(n,a){1&n&&(e.j41(0,"span"),e.EFF(1,"Business API messages"),e.k0s())}function qk(n,a){1&n&&(e.j41(0,"div",51)(1,"div",52),e.nrm(2,"i",77),e.k0s(),e.j41(3,"div")(4,"h4",55),e.EFF(5,"Your responsibilities as Admin"),e.k0s(),e.j41(6,"p",60),e.EFF(7," You are responsible for keeping team access lists accurate, and for ensuring your team's use of these conversations complies with Meta's platform policies and applicable privacy law (GDPR, POPIA, etc.). "),e.k0s()()())}function Jk(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",64)(1,"p-checkbox",78),e.mxI("ngModelChange",function(i){e.eBV(t);const s=e.XpG(2);return e.DH7(s.ack3,i)||(s.ack3=i),e.Njj(i)}),e.k0s(),e.j41(2,"label",79),e.EFF(3," I have "),e.j41(4,"strong",40),e.EFF(5,"authority to bind my organization"),e.k0s(),e.EFF(6," and to grant Deskflo access to these business messaging channels. "),e.k0s()()}if(2&n){const t=e.XpG(2);e.R7$(),e.R50("ngModel",t.ack3),e.Y8G("binary",!0)}}function Kk(n,a){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"div",22)(2,"button",23),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.displayMessengerModal=!1)}),e.nrm(3,"i",24),e.k0s(),e.j41(4,"div",25)(5,"div",26),e.DNE(6,
1Xk,1,1,"img",27)(7,Yk,1,0,"i",28),e.k0s(),e.j41(8,"div")(9,"div",29),e.nrm(10,"i",30),e.EFF(11),e.k0s(),e.j41(12,"h3",31),e.EFF(13),e.k0s(),e.j41(14,"p",32),e.EFF(15),e.j41(16,"span",19),e.DNE(17,Wk,2,0,"span",20)(18,Hk,2,0,"span",20)(19,zk,2,0,"span",20),e.k0s(),e.EFF(20,") will be used across your team before continuing. "),e.k0s()()()(),e.j41(21,"div",33)(22,"div",34)(23,"div",35)(24,"div",36),e.nrm(25,"i",37),e.k0s(),e.j41(26,"div")(27,"h4",38),e.EFF(28,"This is a team-wide connection"),e.k0s(),e.j41(29,"p",39),e.EFF(30," Once connected, "),e.j41(31,"strong",40),e.EFF(32,"every team member"),e.k0s(),e.EFF(33," in this workspace (current and future) will be able to "),e.j41(34,"strong",40),e.EFF(35,"read and reply"),e.k0s(),e.EFF(36," to messages from this account through Deskflo's Unified Inbox. New teammates added later inherit the same access automatically. "),e.k0s()()(),e.j41(37,"div",41)(38,"div",42),e.nrm(39,"i",43),e.k0s(),e.j41(40,"div")(41,"h4",44),e.EFF(42,"Business accounts only"),e.k0s(),e.j41(43,"p",45),e.EFF(44," Deskflo only supports "),e.j41(45,"strong",40),e.EFF(46,"Meta Business Accounts"),e.k0s(),e.EFF(47," linked to a "),e.j41(48,"strong",40),e.EFF(49,"Meta Business Portfolio"),e.k0s(),e.EFF(50,". Personal accounts are not supported and may be disconnected without notice. "),e.k0s(),e.j41(51,"div",46)(52,"span",47),e.nrm(53,"i",48),e.EFF(54," Business Pages"),e.k0s(),e.j41(55,"span",47),e.nrm(56,"i",48),e.EFF(57," Instagram Business / Creator"),e.k0s(),e.j41(58,"span",47),e.nrm(59,"i",48),e.EFF(60," WhatsApp Business API"),e.k0s(),e.j41(61,"span",49),e.nrm(62,"i",50),e.EFF(63," Personal profiles"),e.k0s()()()(),e.j41(64,"div",51)(65,"div",52),e.nrm(66,"i",53),e.k0s(),e.j41(67,"div",54)(68,"h4",55),e.EFF(69,"What Deskflo will access"),e.k0s(),e.j41(70,"ul",56)(71,"li"),e.EFF(72),e.k0s(),e.j41(73,"li"),e.EFF(74,"Contact profile info (name, handle, profile photo)"),e.k0s(),e.j41(75,"li"),e.EFF(76,"Page & Portfolio metadata needed to route conversations"),e.k0s()(),e.j41(77,"p",57),e.EFF(78,"We never post to your feed, story, or public timeline."),e.k0s()()(),e.DNE(79,qk,8,0,"div",58),e.j41(80,"div",51)(81,"div",52),e.nrm(82,"i",59),e.k0s(),e.j41(83,"div")(84,"h4",55),e.EFF(85,"You can revoke access anytime"),e.k0s(),e.j41(86,"p",60),e.EFF(87," Disconnect from "),e.j41(88,"em",61),e.EFF(89,"Connections \u2192 Meta Connection"),e.k0s(),e.EFF(90,", or revoke Deskflo from your Meta Business Portfolio. Historical messages remain in Deskflo unless deleted from Settings \u2192 Data. "),e.k0s()()(),e.j41(91,"div",62)(92,"span",63),e.EFF(93,"CONFIRM BEFORE YOU CONNECT"),e.k0s(),e.j41(94,"div",34)(95,"div",64)(96,"p-checkbox",65),e.mxI("ngModelChange",function(i){e.eBV(t);const s=e.XpG();return e.DH7(s.ack1,i)||(s.ack1=i),e.Njj(i)}),e.k0s(),e.j41(97,"label",66),e.EFF(98," I understand that all conversations from this "),e.j41(99,"strong",40),e.EFF(100),e.k0s(),e.EFF(101," account will be visible to "),e.j41(102,"strong",40),e.EFF(103,"every current and future team member"),e.k0s(),e.EFF(104," of this workspace. "),e.k0s()(),e.j41(105,"div",64)(106,"p-checkbox",67),e.mxI("ngModelChange",function(i){e.eBV(t);const s=e.XpG();return e.DH7(s.ack2,i)||(s.ack2=i),e.Njj(i)}),e.k0s(),e.j41(107,"label",68),e.EFF(108," I confirm this is a "),e.j41(109,"strong",40),e.EFF(110,"Meta Business Account"),e.k0s(),e.EFF(111," connected to a Meta Business Portfolio \u2014 "),e.j41(112,"strong",40),e.EFF(113,"not"),e.k0s(),e.EFF(114," a personal profile. "),e.k0s()(),e.DNE(115,Jk,7,2,"div",69),e.k0s()()()(),e.j41(116,"div",70)(117,"div",71),e.nrm(118,"i",72),e.EFF(119," Secured by Deskflo \u2022 Revocable at any time "),e.k0s(),e.j41(120,"div",73),e.nrm(121,"button",74),e.k0s()(),e.bVm()}if(2&n){const t=e.XpG();e.R7$(6),e.Y8G("ngIf",t.selectedChannel.logo),e.R7$(),e.Y8G("ngIf",!t.selectedChannel.logo),e.R7$(4),e.SpI(" ",t.adminAndOnwer?"Admin / Owner":"Team Member"," "),e.R7$(2),e.SpI("Connect ",t.selectedChannel.name," to your workspace"),e.R7$(2),e.SpI(" Please review how ",t.selectedChannel.name," ("),e.R7$(),e.Y8G("ngSwitch",t.selectedChannel.type),e.R7$(),e.Y8G("ngSwitchCase","messenger"),e.R7$(),e.Y8G("ngSwitchCase","instagram"),e.R7$(),e.Y8G("ngSwitchCase","whatsapp"),e.R7$(53),e.SpI("Incoming and outgoing DMs on the connected ",t.selectedChannel.name," channel"),e.R7$(7),e.Y8G("ngIf",t.adminAndOnwer),e.R7$(17),e.R50("ngModel",t.ack1),e.Y8G("binary",!0),e.R7$(4),e.JRh(t.selectedChannel.name),e.R7$(6),e.R50("ngModel",t.ack2),e.Y8G("binary",!0),e.R7$(9),e.Y8G("ngIf",t.adminAndOnwer),e.R7$(6),e.Y8G("label","Agree & Connect "+t.selectedChannel.name)("disabled",!t.is
1FormValid())}}let Qk=(()=>{class n{teamsService;channels=at.vj;selectedChannel=null;displayMessengerModal=!1;ack1=!1;ack2=!1;ack3=!1;constructor(t){this.teamsService=t}openModal(t){this.selectedChannel=t,this.ack1=!1,this.ack2=!1,this.ack3=!1,this.displayMessengerModal=!0}isFormValid(){return this.adminAndOnwer?this.ack1&&this.ack2&&this.ack3:this.ack1&&this.ack2}get adminAndOnwer(){return["Owner","Admin"].includes(this.teamsService.getCurrentTeam?.Role)}static \u0275fac=function(r){return new(r||n)(e.rXU(rt.n))};static \u0275cmp=e.VBU({type:n,selectors:[["app-terms-of-use"]],standalone:!1,decls:19,vars:13,consts:[[1,"w-full","h-full","px-3","py-4","mx-auto","bg-gray-50","flex-grow-1","transition-all","transition-duration-300"],[1,"mb-4"],[1,"text-3xl","font-bold","m-0","text-900","tracking-tight"],[1,"text-sm","text-600","m-0","mt-2","line-height-3"],[1,"surface-card","border-1","surface-border","border-round-2xl","p-4","shadow-1"],[1,"block","text-xs","font-semibold","text-600","tracking-wide","mb-3"],[1,"grid","g-3","mb-3"],["class","col-12 md:col-4",4,"ngFor","ngForOf"],[1,"grid","g-3"],[1,"text-xs","text-600","mt-3","line-height-3"],["styleClass","custom-terms-dialog",3,"visibleChange","visible","modal","draggable","resizable","showHeader","contentStyle"],[4,"ngIf"],[1,"col-12","md:col-4"],[1,"flex","align-items-center","gap-3","p-3","border-1","surface-border","border-round-xl","cursor-pointer","hover:border-400","transition-colors","transition-duration-150",3,"click"],[1,"flex","align-items-center","justify-content-center","flex-shrink-0",2,"width","36px","height","36px"],[1,"w-full","h-full","object-contain",3,"src","alt"],[1,"flex","flex-column"],[1,"text-sm","font-semibold","text-900"],[1,"text-xs","text-600","mt-1"],[3,"ngSwitch"],[4,"ngSwitchCase"],["pButton","","type","button",1,"p-button-outlined","p-button-secondary","p-button-sm","w-full","border-round-3xl","text-xs","py-2","font-medium",3,"click","label"],[1,"bg-blue-50","p-4","border-bottom-1","border-round-top-lg","surface-border","relative"],["type","button","aria-label","Close dialog",1,"p-link","absolute","top-0","right-0","p-2","text-500","hover:text-700","hover:bg-blue-100","border-circle","transition-colors","mt-3","mr-3",3,"click"],[1,"pi","pi-times","text-sm"],[1,"flex","gap-3","align-items-start","pt-2"],[1,"flex","align-items-center","justify-content-center","bg-blue-500","border-circle","text-white","shadow-1","flex-shrink-0",2,"width","44px","height","44px"],["class","w-6 h-6 object-contain","style","width:24px; height:24px; filter: brightness(0) invert(1);",3,"src",4,"ngIf"],["class","pi pi-comments text-xl",4,"ngIf"],[1,"inline-flex","align-items-center","bg-blue-100","text-blue-800","font-semibold","px-2","py-1","border-round","text-xs","tracking-wide","uppercase","mb-2","gap-1","scale-90","origin-left"],[1,"pi","pi-shield","text-xs"],[1,"text-xl","font-bold","m-0","text-900","line-height-2"],[1,"text-xs","text-600","m-0","mt-1","line-height-3"],[1,"p-4","overflow-y-auto",2,"max-height","420px"],[1,"flex","flex-column","gap-3"],[1,"flex","gap-3","p-3","border-round-xl",2,"background-color","#f0f7ff"],[1,"flex","align-items-center","justify-content-center","bg-blue-100","text-blue-700","border-circle","flex-shrink-0",2,"width","28px","height","28px"],[1,"pi","pi-users","text-xs"],[1,"text-xs","font-bold","text-blue-900","m-0","mb-1"],[1,"text-xs","text-800","m-0","line-height-3"],[1,"text-900"],[1,"flex","gap-3","p-3","border-round-xl",2,"background-color","#fffbf0"],[1,"flex","align-items-center","justify-content-center","bg-amber-100","text-amber-700","border-round-md","flex-shrink-0",2,"width","28px","height","28px"],[1,"pi","pi-building","text-xs"],[1,"text-xs","font-bold","text-amber-950","m-0","mb-1"],[1,"text-xs","text-800","m-0","line-height-3","mb-2"],[1,"flex","flex-wrap","gap-1","mt-1"],[1,"inline-flex","align-items-center","gap-1","text-xs","font-medium","px-2","py-1","border-round-3xl","bg-green-100","text-green-800"],[1,"pi","pi-check-circle","text-xs"],[1,"inline-flex","align-items-center","gap-1","text-xs","font-medium","px-2","py-1","border-round-3xl","bg-red-100","text-red-800"],[1,"pi","pi-times-circle","text-xs"],[1,"flex","gap-3","p-3","border-1","surface-border","border-round-xl","bg-50"],[1,"flex","align-items-center","justify-content-center","bg-200","text-600","border-circle","flex-shrink-0",2,"width","28px","height","28px"],[1,"pi","pi-eye","text-xs"],[1,"w-full"],[1,"text-xs","font-bold","text-900","m-0","mb-1"],[1,"m-0","p-0","pl-3","text-xs","text-700","line-height-3","flex","flex-column","gap-1","mt-2"],[1,"text-xs","text-500","m-0","mt-2"],["class","flex gap-3 p-3 border-1
1surface-border border-round-xl bg-50",4,"ngIf"],[1,"pi","pi-exclamation-triangle","text-xs"],[1,"text-xs","text-700","m-0","line-height-3"],[1,"font-medium"],[1,"p-3","border-1","surface-border","border-round-xl","bg-50","mt-1"],[1,"block","font-semibold","text-600","tracking-wide","text-xs","mb-3"],[1,"flex","align-items-start","gap-3"],["inputId","ack1",3,"ngModelChange","ngModel","binary"],["for","ack1",1,"text-xs","text-700","line-height-3","cursor-pointer","select-none"],["inputId","ack2",3,"ngModelChange","ngModel","binary"],["for","ack2",1,"text-xs","text-700","line-height-3","cursor-pointer","select-none"],["class","flex align-items-start gap-3",4,"ngIf"],[1,"p-3","border-top-1","surface-border","border-round-bottom-lg","flex","align-items-center","justify-content-between","bg-white"],[1,"text-xs","text-500","flex","align-items-center","gap-1"],[1,"pi","pi-lock","text-xs"],[1,"flex","gap-2"],["pButton","","type","button",1,"p-button-sm","font-semibold","border-none","px-3","text-xs",2,"background-color","#818cf8",3,"label","disabled"],[1,"w-6","h-6","object-contain",2,"width","24px","height","24px","filter","brightness(0) invert(1)",3,"src"],[1,"pi","pi-comments","text-xl"],[1,"pi","pi-verified","text-xs"],["inputId","ack3",3,"ngModelChange","ngModel","binary"],["for","ack3",1,"text-xs","text-700","line-height-3","cursor-pointer","select-none"]],template:function(r,i){1&r&&(e.j41(0,"div",0)(1,"div",1)(2,"h2",2),e.EFF(3,"Integration Terms of Use"),e.k0s(),e.j41(4,"p",3),e.EFF(5," Review the workspace compliance rules and data-sharing agreements required to connect Meta communication channels. Select an authorized platform below to manage or initiate your integration workflow. "),e.k0s()(),e.j41(6,"div",4)(7,"span",5),e.EFF(8,"CONNECT A PLATFORM TO GET STARTED"),e.k0s(),e.j41(9,"div",6),e.DNE(10,Vk,12,7,"div",7),e.k0s(),e.j41(11,"div",8),e.DNE(12,Uk,2,1,"div",7),e.k0s()(),e.j41(13,"p",9)(14,"strong"),e.EFF(15,"Tip:"),e.k0s(),e.EFF(16," as an Admin, three acknowledgements are required (including authority to bind the org). Members only see the two informational acknowledgements. "),e.k0s()(),e.j41(17,"p-dialog",10),e.mxI("visibleChange",function(o){return e.DH7(i.displayMessengerModal,o)||(i.displayMessengerModal=o),o}),e.DNE(18,Kk,122,19,"ng-container",11),e.k0s()),2&r&&(e.R7$(10),e.Y8G("ngForOf",i.channels),e.R7$(2),e.Y8G("ngForOf",i.channels),e.R7$(5),e.Aen(e.lJ4(11,Nk)),e.R50("visible",i.displayMessengerModal),e.Y8G("modal",!0)("draggable",!1)("resizable",!1)("showHeader",!1)("contentStyle",e.lJ4(12,Gk)),e.R7$(),e.Y8G("ngIf",i.selectedChannel))},dependencies:[q.Sq,q.bT,q.ux,q.e1,L.BC,L.vS,jt.lG,xe._f,Xr.Sc],styles:["[_nghost-%COMP%]{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif}"]})}return n})();function Zk(n,a){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"app-threads-list",3),e.bIt("conversationSelect",function(i){e.eBV(t);const s=e.XpG();return s.onConversationSelect(i),e.Njj(s.showTermsView=!1)}),e.k0s(),e.bVm()}if(2&n){const t=e.XpG();e.R7$(),e.Y8G("activeChannel",t.activeChannel)("selectedPage",t.selectedPage)("incomingNewThread",t.incomingNewThread)}}function e3(n,a){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"app-chat-window",4),e.bIt("connectIntegration",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.openIntegrationModal(i))}),e.k0s(),e.bVm()}if(2&n){const t=e.XpG();e.R7$(),e.Y8G("activeThread",t.selectedConversation)("activeChannel",t.activeChannel)("selectedPage",t.selectedPage)("integrations",t.channels)}}function t3(n,a){1&n&&(e.qex(0),e.nrm(1,"app-terms-of-use"),e.bVm())}let n3=(()=>{class n{teamsService;fbService;channelChange=new e.bkB;sidebar;activeChannel;selectedConversation=null;teamId;collapsed=!1;selectedPage;channels=[];showTermsView=!1;incomingNewThread=null;constructor(t,r){this.teamsService=t,this.fbService=r}ngOnInit(){this.teamId=this.teamsService.getCurrentTeam.Team.Id}onChannelChange(t){if(this.activeChannel!==t){if(this.selectedPage){const r=this.selectedPage.PageId;r&&this.fbService.disConnect(r)}this.activeChannel=t,this.selectedConversation=null,this.selectedPage=null,this.showTermsView=!1}}onConversationSelect(t){this.selectedConversation=t}onPageSelected(t){if(!t)return;if(this.selectedPage){const i="instagram"===this.selectedPage.provider?this.selectedPage.InstagramBusinessAccountId:this.selectedPage.PageId;i&&this.fbService.disConnect(i)}this.selectedPage=t,this.activeChannel=t.provider;const r="instagram"===t.provider?t.InstagramBusinessAccountId:t.PageId;r&&this.fbService.connectToChat(r,i=>{this.handleLiveIncomingWebhook(i)})}onPageDisconnected(t){this.selectedPage?.PageId===t&&(this.selectedPage=null,this.selectedConversation=null)}openIntegrationModal(t){this.sidebar.openMetaModal(t)}handleLiveIncomingWebhook(t){const r=t.Platform?.toLowerCase();if("whatsapp"===r&&(this.incomingNewThread={threadId:t.ThreadId,isNewThread:!!t.IsNewThread,name:t.SenderName,to_phone_number:t.SenderId,snippet:t.Text,updated_time:(new Date).toISOString(),_receivedAt:Date.now()}),!this.selectedConversation)return;let i=!1;"whatsapp"===r?i=String(this.selectedConversation.id)===String(t.ThreadId):"instagram"===r?i=this.selectedConversation.participants?.data?.some(s=>s.id===t.SenderId):"messenger"===r&&(i=this.selectedConversation.senders?.data?.some(s=>s.id===t.SenderId)),i&&(this.selectedConversation.Messages||(this.selectedConversation.Messages=[]),this.selectedConversation={...this.selectedConversation,Messages:[...this.selectedConversation.Messages,{id:"msg_live_"+Date.now(),Text:t.Text,Attachments:t.Attachments||[],Platform:t.Platform,SenderId:t.SenderId,IsIncoming:!0,Timestamp:(new Date).toISOString()}]})}ngOnDestroy(){if(this.selectedPage){const t=this.selectedPage.PageId;t&&this.fbService.disConnect(t)}}static \u0275fac=function(r){return new(r||n)(e.rXU(rt.n),e.rXU(ea.o))};static \u0275cmp=e.VBU({type:n,selectors:[["app-connection-hub"]],viewQuery:function(r,i){if(1&r&&e.GBs(xc,5),2&r){let s;e.mGM(s=e.lsd())&&(i.sidebar=s.first)}},outputs:{channelChange:"channelChange"},standalone:!1,decls:5,vars:6,consts:[[1,"flex","overflow-hidden","bg-white","messenger-container",3,"ngClass"],[3,"toggleCollapse","channelChange","pageSelected","pageDisconnected","channelsC
1hange","termsClick","collapsed","activeChannelColor"],[4,"ngIf"],[3,"conversationSelect","activeChannel","selectedPage","incomingNewThread"],[1,"flex-grow-1",3,"connectIntegration","activeThread","activeChannel","selectedPage","integrations"]],template:function(r,i){1&r&&(e.j41(0,"div",0)(1,"app-channel-sidebar",1),e.bIt("toggleCollapse",function(o){return i.collapsed=o})("channelChange",function(o){return i.onChannelChange(o)})("pageSelected",function(o){return i.onPageSelected(o)})("pageDisconnected",function(o){return i.onPageDisconnected(o)})("channelsChange",function(o){return i.channels=o})("termsClick",function(){return i.showTermsView=!i.showTermsView}),e.k0s(),e.DNE(2,Zk,2,3,"ng-container",2)(3,e3,2,4,"ng-container",2)(4,t3,2,0,"ng-container",2),e.k0s()),2&r&&(e.Y8G("ngClass","theme-"+i.activeChannel),e.R7$(),e.Y8G("collapsed",i.collapsed)("activeChannelColor",i.activeChannel),e.R7$(),e.Y8G("ngIf",!i.showTermsView),e.R7$(),e.Y8G("ngIf",!i.showTermsView),e.R7$(),e.Y8G("ngIf",i.showTermsView))},dependencies:[q.YU,q.bT,xc,W4,Ok,Qk],styles:[".messenger-page[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center}.messenger-container[_ngcontent-%COMP%]{height:81vh;display:flex;border-radius:10px;box-shadow:0 8px 24px #00000014;overflow:hidden;width:100%}.theme-messenger[_ngcontent-%COMP%]{--channel-primary: #0084ff;--channel-bg-light: #f0f7ff;--channel-bg-chat: #f4f7fa;--my-message-bg: #0084ff;--my-message-text: #ffffff;--active-indicator: #0084ff;--avatar-bg: #e0f0ff;--avatar-text: #0066cc}.theme-whatsapp[_ngcontent-%COMP%]{--channel-primary: #09a884;--channel-bg-light: #f2faf7;--channel-bg-chat: #efeae2;--my-message-bg: #d9fdd3;--my-message-text: #111b21;--active-indicator: #09a884;--avatar-bg: #e1f7f1;--avatar-text: #05614c}.theme-instagram[_ngcontent-%COMP%]{--channel-primary: #e1306c;--channel-bg-light: #fff0f5;--channel-bg-chat: #fff5f8;--my-message-bg: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);--my-message-text: #ffffff;--active-indicator: #e1306c;--avatar-bg: #ffe4e1;--avatar-text: #b11b4c}"]})}return n})();var r3=ee(12097),i3=ee(90262),Nn=1200,di=1252,a3=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],po={0:1252,1:65001,2:65001,77:1e4,128:932,129:949,130:1361,134:936,136:950,161:1253,162:1254,163:1258,177:1255,178:1256,186:1257,204:1251,222:874,238:1250,255:1252,69:6969},ps=function(n){-1!=a3.indexOf(n)&&(di=po[0]=n)},qn=function(n){Nn=n,ps(n)};function us(){qn(1200),function s3(){ps(1252)}()}function fs(n){for(var a=[],t=0,r=n.length;t<r;++t)a[t]=n.charCodeAt(t);return a}function wc(n){for(var a=[],t=0;t<n.length>>1;++t)a[t]=String.fromCharCode(n.charCodeAt(2*t+1)+(n.charCodeAt(2*t)<<8));return a.join("")}var Ze,Mi=function(n){var a=n.charCodeAt(0),t=n.charCodeAt(1);return 255==a&&254==t?function o3(n){for(var a=[],t=0;t<n.length>>1;++t)a[t]=String.fromCharCode(n.charCodeAt(2*t)+(n.charCodeAt(2*t+1)<<8));return a.join("")}(n.slice(2)):254==a&&255==t?wc(n.slice(2)):65279==a?n.slice(1):n},la=function(a){return String.fromCharCode(a)},uo=function(a){return String.fromCharCode(a)},Yr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function da(n){for(var a="",t=0,r=0,i=0,s=0,o=0,l=0,c=0,d=0;d<n.length;)s=(t=n.charCodeAt(d++))>>2,o=(3&t)<<4|(r=n.charCodeAt(d++))>>4,l=(15&r)<<2|(i=n.charCodeAt(d++))>>6,c=63&i,isNaN(r)?l=c=64:isNaN(i)&&(c=64),a+=Yr.charAt(s)+Yr.charAt(o)+Yr.charAt(l)+Yr.charAt(c);return a}function Gn(n){var a="",s=0,o=0,l=0,c=0;n=n.replace(/[^\w\+\/\=]/g,"");for(var d=0;d<n.length;)s=Yr.indexOf(n.charAt(d++)),o=Yr.indexOf(n.charAt(d++)),a+=String.fromCharCode(s<<2|o>>4),64!==(l=Yr.indexOf(n.charAt(d++)))&&(a+=String.fromCharCode((15&o)<<4|l>>2)),64!==(c=Yr.indexOf(n.charAt(d++)))&&(a+=String.fromCharCode((3&l)<<6|c));return a}var We=function(){return typeof Buffer<"u"&&typeof process<"u"&&typeof process.versions<"u"&&!!process.versions.node}(),Dr=function(){if(typeof Buffer<"u"){var n=!Buffer.from;if(!n)try{Buffer.from("foo","utf8")}catch{n=!0}return n?function(a,t){return t?new Buffer(a,t):new Buffer(a)}:Buffer.from.bind(Buffer)}return function(){}}();function Wr(n){return We?Buffer.alloc?Buffer.alloc(n):new Buffer(n):typeof Uint8Array<"u"?new Uint8Array(n):new Array(n)}function yc(n){return We?Buffer.allocUnsafe?Buffer.allocUnsafe(n):new Buffer(n):typeof Uint8Array<"u"?new Uint8Array(n):new Array(n)}var Bn=function(a){return We?Dr(a,"binary"):a.split("").map(function(t){return 255&t.charCodeAt(0)})};function Hr(n){if(Array.isArray(n))return n.map(function(r){return String.fromCharCode(r)}).join("");for(var a=[],t=0;t<n.length;++t)a[t]=String.fromCharCode(n[t]);return a.join("")}function fo(n){if(typeof ArrayBuffer>"u")throw new Error("Unsupported");if(n instanceof ArrayBuffer)return fo(new Uint8Array(n));for(var a=new Array(n.length),t=0;t<n.length;++t)a[t]=n[t];return a}var sn=We?function(n){return Buffer.concat(n.map(function(a){return Buffer.isBuffer(a)?a:Dr(a)}))}:function(n){if(typeof Uint8Array<"u"){var a=0,t=0;for(a=0;a<n.length;++a)t+=n[a].length;
1var r=new Uint8Array(t),i=0;for(a=0,t=0;a<n.length;t+=i,++a)if(i=n[a].length,n[a]instanceof Uint8Array)r.set(n[a],t);else{if("string"==typeof n[a])throw"wtf";r.set(new Uint8Array(n[a]),t)}return r}return[].concat.apply([],n.map(function(s){return Array.isArray(s)?s:[].slice.call(s)}))},gn=/\u0000/g,ua=/[\u0001-\u0006]/g;function Pi(n){for(var a="",t=n.length-1;t>=0;)a+=n.charAt(t--);return a}function cr(n,a){var t=""+n;return t.length>=a?t:Ot("0",a-t.length)+t}function mo(n,a){var t=""+n;return t.length>=a?t:Ot(" ",a-t.length)+t}function ms(n,a){var t=""+n;return t.length>=a?t:t+Ot(" ",a-t.length)}var Fc=Math.pow(2,32);function Oi(n,a){return n>Fc||n<-Fc?function d3(n,a){var t=""+Math.round(n);return t.length>=a?t:Ot("0",a-t.length)+t}(n,a):function p3(n,a){var t=""+n;return t.length>=a?t:Ot("0",a-t.length)+t}(Math.round(n),a)}function hs(n,a){return n.length>=7+(a=a||0)&&103==(32|n.charCodeAt(a))&&101==(32|n.charCodeAt(a+1))&&110==(32|n.charCodeAt(a+2))&&101==(32|n.charCodeAt(a+3))&&114==(32|n.charCodeAt(a+4))&&97==(32|n.charCodeAt(a+5))&&108==(32|n.charCodeAt(a+6))}var Sc=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],ho=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]],Re={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@",56:'"\u4e0a\u5348/\u4e0b\u5348 "hh"\u6642"mm"\u5206"ss"\u79d2 "'},Ec={5:37,6:38,7:39,8:40,23:0,24:0,25:0,26:0,27:14,28:14,29:14,30:14,31:14,50:14,51:14,52:14,53:14,54:14,55:14,56:14,57:14,58:14,59:1,60:2,61:3,62:4,67:9,68:10,69:12,70:13,71:14,72:14,73:15,74:16,75:17,76:20,77:21,78:22,79:45,80:46,81:47,82:0},f3={5:'"$"#,##0_);\\("$"#,##0\\)',63:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',41:'_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)'};function gs(n,a,t){for(var r=n<0?-1:1,i=n*r,s=0,o=1,l=0,c=1,d=0,p=0,u=Math.floor(i);d<a&&(l=(u=Math.floor(i))*o+s,p=u*d+c,!(i-u<5e-8));)i=1/(i-u),s=o,o=l,c=d,d=p;if(p>a&&(d>a?(p=c,l=s):(p=d,l=o)),!t)return[0,r*l,p];var f=Math.floor(r*l/p);return[f,r*l-f*p,p]}function zr(n,a,t){if(n>2958465||n<0)return null;var r=0|n,i=Math.floor(86400*(n-r)),s=0,o=[],l={D:r,T:i,u:86400*(n-r)-i,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(l.u)<1e-6&&(l.u=0),a&&a.date1904&&(r+=1462),l.u>.9999&&(l.u=0,86400==++i&&(l.T=i=0,++r,++l.D)),60===r)o=t?[1317,10,29]:[1900,2,29],s=3;else if(0===r)o=t?[1317,8,29]:[1900,1,0],s=6;else{r>60&&--r;var c=new Date(1900,0,1);c.setDate(c.getDate()+r-1),o=[c.getFullYear(),c.getMonth()+1,c.getDate()],s=c.getDay(),r<60&&(s=(s+6)%7),t&&(s=function v3(n,a){a[0]-=581;var t=n.getDay();return n<60&&(t=(t+6)%7),t}(c,o))}return l.y=o[0],l.m=o[1],l.d=o[2],l.S=i%60,i=Math.floor(i/60),l.M=i%60,i=Math.floor(i/60),l.H=i,l.q=s,l}var Ic=new Date(1899,11,31,0,0,0),m3=Ic.getTime(),h3=new Date(1900,2,1,0,0,0);function Dc(n,a){var t=n.getTime();return a?t-=1262304e5:n>=h3&&(t+=864e5),(t-(m3+6e4*(n.getTimezoneOffset()-Ic.getTimezoneOffset())))/864e5}function go(n){return-1==n.indexOf(".")?n:n.replace(/(?:\.0*|(\.\d*[1-9])0+)$/,"$1")}function fa(n){var t,a=Math.floor(Math.log(Math.abs(n))*Math.LOG10E);return t=a>=-4&&a<=-1?n.toPrecision(10+a):Math.abs(a)<=9?function _3(n){var a=n<0?12:11,t=go(n.toFixed(12));return t.length<=a||(t=n.toPrecision(10)).length<=a?t:n.toExponential(5)}(n):10===a?n.toFixed(10).substr(0,12):function x3(n){var a=go(n.toFixed(11));return a.length>(n<0?12:11)||"0"===a||"-0"===a?n.toPrecision(6):a}(n),go(function g3(n){return-1==n.indexOf("E")?n:n.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\d)$/,"$10$2")}(t.toUpperCase()))}function pi(n,a){switch(typeof n){case"string":return n;case"boolean":return n?"TRUE":"FALSE";case"number":return(0|n)===n?n.toString(10):fa(n);case"undefined":return"";case"object":if(null==n)return"";if(n instanceof Date)return Ln(14,Dc(n,a&&a.date1904),a)}throw new Error("unsupported value in General format: "+n)}function b3(n,a,t,r){var c,i="",s=0,o=0,l=t.y,d=0;switch(n){case 98:l=t.y+543;case 121:switch(a.length){case 1:case 2:c=l%100,d=2;break;default:c=l%1e4,d=4}break;case 109:switch(a.length){case 1:case 2:c=t.m,d=a.length;break;case 3:return ho[t.m-1][1];case 5:return ho[t.m-1][0];default:return ho[t.m-1][2]}break;case 100:switch(a.length){case 1:case 2:c=t.d,d=a.length;break;case 3:return Sc[t.q][0];default:return Sc[t.q][1]}break;case 104:switch(a.length){case 1:case 2:c=1+(t.H+11)%12,d=a.length;break;default:throw"bad hour format: "+a}break;case 72:switch(a.length){case 1:case 2:c=t.H,d=a.length;break;default:throw"bad hour format: "+a}break;case 77:switch(a.length){case 1:case 2:c=t.M,d=a.length;break;default:throw"bad minute format: "+a}break;case 115:if("s"!=a&&"ss"!=a&&".0"!=a&&".00"!=a&&".000"!=a)throw"bad second format: "+a;return 0!==t.u||"s"!=a&&"ss"!=a?(o=r>=2?3===r?1e3:100:1===r?10:1,(s=Math.round(o*(t.S+t.u)))>=60*o&&(s=0),"s"===a?0===s?"0":""+s/o:(i=cr(s,2+r),"ss"===a?i.substr(0,2):"."+i.substr(2,a.length-1))):cr(t.S,a.length);case 90:switch(a){case"[h]":case"[hh]":c=24*t.D+t.H;break;case"[m]":case"[mm]":c=60*(24*t.D+t.H)+t.M;break;case"[s]":case"[ss]":c=60*(60*(24*t.D+t.H)+t.M)+Math.round(t.S+t.u);break;default:throw"bad abstime format: "+a}d=3===a.length?1:2;break;case 101:c=l,d=1}return d>0?cr(c,d):""}function qr(n){if(n.length<=3)return n;for(var t=n.length%3,r=n.substr(0,t);t!=n.length;t+=3)r+=(r.length>0?",":"")+n.substr(t,3);return r}var Rc=/%/g;function jc(n,a){var t,r=n.indexOf("E")-n.indexOf(".")-1;if(n.match(/^#+0.0E\+0$/)){if(0==a)return"0.0E+0";if(a<0)return"-"+jc(n,-a);var i=n.indexOf(".");-1===i&&(i=n.indexOf("E"));var s=Math.floor(Math.log(a)*Math.LOG10E)%i;if(s<0&&(s+=i),-1===(t=(a/Math.pow(10,s)).toPrecision(r+1+(i+s)%i)).indexOf("e")){var o=Math.floor(Math.log(a)*Math.LOG10E);for(-1===t.indexOf(".")?t=t.charAt(0)+"."+t.substr(1)+"E+"+(o-t.length+s):t+="E+"+(o-s);"0."===t.substr(0,2);)t=(t=t.charAt(0)+t.substr(2,i)+"."+t.substr(2+i)).replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");t=t.replace(/\+-/,"-")}t=t.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(l,c,d,p){return c+d+p.substr(0,(i+s)%i)+"."+p.substr(s)+"E"})}else t=a.toExponential(r);return n.match(/E\+00$/)&&t.match(/e[+-]\d$/)&&(t=t.substr(0,t.length-1)+"0"+t.charAt(t.length-1)),n.match(/E\-/)&&t.match(/e\+/)&&(t=t.replace(/e\+/,"e")),t.replace("e","E")}var Ac=/# (\?+)( ?)\/( ?)(\d+)/,Mc=/^#*0*\.([0#]+)/,Pc=/\).*[0#]/,Oc=/\(###\) ###\\?-####/;function Sn(n){for(var t,a="",r=0;r!=n.length;++r)switch(t=n.charCodeAt(r)){case 35:break;case 63:a+=" ";break;case 48:a+="0";break;default:a+=String.fromCharCode(t)}return a}function Nc(n,a){var t=Math.pow(10,a);return""+Math.round(n*t)/t}function Gc(n,a){var t=n-Math.floor(n),r=Math.pow(10,a);return a<(""+Math.round(t*r)).length?0:Math.round(t*r)}function Jn(n,a,t){if(40===n.charCodeAt(0)&&!a.match(Pc)){var r=a.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return t>=0?Jn("n",r,t):"("+Jn("n",r,-t)+")"}
vendor: 15,811 bytes, line 1
1if(44===a.charCodeAt(a.length-1))return function k3(n,a,t){for(var r=a.length-1;44===a.charCodeAt(r-1);)--r;return Rr(n,a.substr(0,r),t/Math.pow(10,3*(a.length-r)))}(n,a,t);if(-1!==a.indexOf("%"))return function C3(n,a,t){var r=a.replace(Rc,""),i=a.length-r.length;return Rr(n,r,t*Math.pow(10,2*i))+Ot("%",i)}(n,a,t);if(-1!==a.indexOf("E"))return jc(a,t);if(36===a.charCodeAt(0))return"$"+Jn(n,a.substr(" "==a.charAt(1)?2:1),t);var i,s,o,l,c=Math.abs(t),d=t<0?"-":"";if(a.match(/^00+$/))return d+Oi(c,a.length);if(a.match(/^[#?]+$/))return"0"===(i=Oi(t,0))&&(i=""),i.length>a.length?i:Sn(a.substr(0,a.length-i.length))+i;if(s=a.match(Ac))return function T3(n,a,t){var r=parseInt(n[4],10),i=Math.round(a*r),s=Math.floor(i/r),o=i-s*r,l=r;return t+(0===s?"":""+s)+" "+(0===o?Ot(" ",n[1].length+1+n[4].length):mo(o,n[1].length)+n[2]+"/"+n[3]+cr(l,n[4].length))}(s,c,d);if(a.match(/^#+0+$/))return d+Oi(c,a.length-a.indexOf("0"));if(s=a.match(Mc))return i=Nc(t,s[1].length).replace(/^([^\.]+)$/,"$1."+Sn(s[1])).replace(/\.$/,"."+Sn(s[1])).replace(/\.(\d*)$/,function(g,m){return"."+m+Ot("0",Sn(s[1]).length-m.length)}),-1!==a.indexOf("0.")?i:i.replace(/^0\./,".");if(a=a.replace(/^#+([0.])/,"$1"),s=a.match(/^(0*)\.(#*)$/))return d+Nc(c,s[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,s[1].length?"0.":".");if(s=a.match(/^#{1,3},##0(\.?)$/))return d+qr(Oi(c,0));if(s=a.match(/^#,##0\.([#0]*0)$/))return t<0?"-"+Jn(n,a,-t):qr(""+(Math.floor(t)+function y3(n,a){return a<(""+Math.round((n-Math.floor(n))*Math.pow(10,a))).length?1:0}(t,s[1].length)))+"."+cr(Gc(t,s[1].length),s[1].length);if(s=a.match(/^#,#*,#0/))return Jn(n,a.replace(/^#,#*,/,""),t);if(s=a.match(/^([0#]+)(\\?-([0#]+))+$/))return i=Pi(Jn(n,a.replace(/[\\-]/g,""),t)),o=0,Pi(Pi(a.replace(/\\/g,"")).replace(/[0#]/g,function(g){return o<i.length?i.charAt(o++):"0"===g?"0":""}));if(a.match(Oc))return"("+(i=Jn(n,"##########",t)).substr(0,3)+") "+i.substr(3,3)+"-"+i.substr(6);var p="";if(s=a.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return o=Math.min(s[4].length,7),l=gs(c,Math.pow(10,o)-1,!1),i=""+d," "==(p=Rr("n",s[1],l[1])).charAt(p.length-1)&&(p=p.substr(0,p.length-1)+"0"),i+=p+s[2]+"/"+s[3],(p=ms(l[2],o)).length<s[4].length&&(p=Sn(s[4].substr(s[4].length-p.length))+p),i+=p;if(s=a.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return o=Math.min(Math.max(s[1].length,s[4].length),7),d+((l=gs(c,Math.pow(10,o)-1,!0))[0]||(l[1]?"":"0"))+" "+(l[1]?mo(l[1],o)+s[2]+"/"+s[3]+ms(l[2],o):Ot(" ",2*o+1+s[2].length+s[3].length));if(s=a.match(/^[#0?]+$/))return i=Oi(t,0),a.length<=i.length?i:Sn(a.substr(0,a.length-i.length))+i;if(s=a.match(/^([#0?]+)\.([#0]+)$/)){i=""+t.toFixed(Math.min(s[2].length,10)).replace(/([^0])0+$/,"$1"),o=i.indexOf(".");var u=a.indexOf(".")-o,f=a.length-i.length-u;return Sn(a.substr(0,u)+i+a.substr(a.length-f))}if(s=a.match(/^00,000\.([#0]*0)$/))return o=Gc(t,s[1].length),t<0?"-"+Jn(n,a,-t):qr(function F3(n){return n<2147483647&&n>-2147483648?""+(n>=0?0|n:n-1|0):""+Math.floor(n)}(t)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(g){return"00,"+(g.length<3?cr(0,3-g.length):"")+g})+"."+cr(o,s[1].length);switch(a){case"###,##0.00":return Jn(n,"#,##0.00",t);case"###,###":case"##,###":case"#,###":var h=qr(Oi(c,0));return"0"!==h?d+h:"";case"###,###.00":return Jn(n,"###,##0.00",t).replace(/^0\./,".");case"#,###.00":return Jn(n,"#,##0.00",t).replace(/^0\./,".")}throw new Error("unsupported format |"+a+"|")}function Bc(n,a){var t,r=n.indexOf("E")-n.indexOf(".")-1;if(n.match(/^#+0.0E\+0$/)){if(0==a)return"0.0E+0";if(a<0)return"-"+Bc(n,-a);var i=n.indexOf(".");-1===i&&(i=n.indexOf("E"));var s=Math.floor(Math.log(a)*Math.LOG10E)%i;if(s<0&&(s+=i),!(t=(a/Math.pow(10,s)).toPrecision(r+1+(i+s)%i)).match(/[Ee]/)){var o=Math.floor(Math.log(a)*Math.LOG10E);-1===t.indexOf(".")?t=t.charAt(0)+"."+t.substr(1)+"E+"+(o-t.length+s):t+="E+"+(o-s),t=t.replace(/\+-/,"-")}t=t.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(l,c,d,p){return c+d+p.substr(0,(i+s)%i)+"."+p.substr(s)+"E"})}else t=a.toExponential(r);return n.match(/E\+00$/)&&t.match(/e[+-]\d$/)&&(t=t.substr(0,t.length-1)+"0"+t.charAt(t.length-1)),n.match(/E\-/)&&t.match(/e\+/)&&(t=t.replace(/e\+/,"e")),t.replace("e","E")}function _r(n,a,t){if(40===n.charCodeAt(0)&&!a.match(Pc)){var r=a.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return t>=0?_r("n",r,t):"("+_r("n",r,-t)+")"}if(44===a.charCodeAt(a.length-1))return function S3(n,a,t){for(var r=a.length-1;44===a.charCodeAt(r-1);)--r;return Rr(n,a.substr(0,r),t/Math.pow(10,3*(a.length-r)))}(n,a,t);if(-1!==a.indexOf("%"))return function E3(n,a,t){var r=a.replace(Rc,""),i=a.length-r.length;return Rr(n,r,t*Math.pow(10,2*i))+Ot("%",i)}(n,a,t);if(-1!==a.indexOf("E"))return Bc(a,t);if(36===a.charCodeAt(0))return"$"+_r(n,a.substr(" "==a.charAt(1)?2:1),t);var i,s,o,l,c=Math.abs(t),d=t<0?"-":"";if(a.match(/^00+$/))return d+cr(c,a.length);if(a.match(/^[#?]+$/))return i=""+t,0===t&&(i=""),i.length>a.length?i:Sn(a.substr(0,a.length-i.length))+i;if(s=a.match(Ac))return function w3(n,a,t){return t+(0===a?"":""+a)+Ot(" ",n[1].length+2+n[4].length)}(s,c,d);if(a.match(/^#+0+$/))return d+cr(c,a.length-a.indexOf("0"));if(s=a.match(Mc))return i=(i=(""+t).replace(/^([^\.]+)$/,"$1."+Sn(s[1])).replace(/\.$/,"."+Sn(s[1]))).replace(/\.(\d*)$/,function(g,m){return"."+m+Ot("0",Sn(s[1]).length-m.length)}),-1!==a.indexOf("0.")?i:i.replace(/^0\./,".");if(a=a.replace(/^#+([0.])/,"$1"),s=a.match(/^(0*)\.(#*)$/))return d+(""+c).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,s[1].length?"0.":".");if(s=a.match(/^#{1,3},##0(\.?)$/))return d+qr(""+c);if(s=a.match(/^#,##0\.([#0]*0)$/))return t<0?"-"+_r(n,a,-t):qr(""+t)+"."+Ot("0",s[1].length);if(s=a.match(/^#,#*,#0/))return _r(n,a.replace(/^#,#*,/,""),t);if(s=a.match(/^([0#]+)(\\?-([0#]+))+$/))return i=Pi(_r(n,a.replace(/[\\-]/g,""),t)),o=0,Pi(Pi(a.replace(/\\/g,"")).replace(/[0#]/g,function(g){return o<i.length?i.charAt(o++):"0"===g?"0":""}));if(a.match(Oc))return"("+(i=_r(n,"##########",t)).substr(0,3)+") "+i.substr(3,3)+"-"+i.substr(6);var p="";if(s=a.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return o=Math.min(s[4].length,7),l=gs(c,Math.pow(10,o)-1,!1),i=""+d," "==(p=Rr("n",s[1],l[1])).charAt(p.length-1)&&(p=p.substr(0,p.length-1)+"0"),i+=p+s[2]+"/"+s[3],(p=ms(l[2],o)).length<s[4].length&&(p=Sn(s[4].substr(s[4].length-p.length))+p),i+=p;if(s=a.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return o=Math.min(Math.max(s[1].length,s[4].length),7),d+((l=gs(c,Math.pow(10,o)-1,!0))[0]||(l[1]?"":"0"))+" "+(l[1]?mo(l[1],o)+s[2]+"/"+s[3]+ms(l[2],o):Ot(" ",2*o+1+s[2].length+s[3].length));if(s=a.match(/^[#0?]+$/))return a.length<=(i=""+t).length?i:Sn(a.substr(0,a.length-i.length))+i;if(s=a.match(/^([#0]+)\.([#0]+)$/)){i=""+t.toFixed(Math.min(s[2].length,10)).replace(/([^0])0+$/,"$1"),o=i.indexOf(".");var u=a.indexOf(".")-o,f=a.length-i.length-u;return Sn(a.substr(0,u)+i+a.substr(a.length-f))}if(s=a.match(/^00,000\.([#0]*0)$/))return t<0?"-"+_r(n,a,-t):qr(""+t).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(g){return"00,"+(g.length<3?cr(0,3-g.length):"")+g})+"."+cr(0,s[1].length);switch(a){case"###,###":case"##,###":case"#,###":var h=qr(""+c);return"0"!==h?d+h:"";default:if(a.match(/\.[0#?]*$/))return _r(n,a.slice(0,a.lastIndexOf(".")),t)+Sn(a.slice(a.lastIndexOf(".")))}throw new Error("unsupported format |"+a+"|")}function Rr(n,a,t){return(0|t)===t?_r(n,a,t):Jn(n,a,t)}var Lc=/\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;function ui(n){for(var a=0,t="",r="";a<n.length;)switch(t=n.charAt(a)){case"G":hs(n,a)&&(a+=6),a++;break;case'"':for(;34!==n.charCodeAt(++a)&&a<n.length;);++a;break;case"\\":case"_":a+=2;break;case"@":++a;break;case"B":case"b":if("1"===n.charAt(a+1)||"2"===n.charAt(a+1))return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":case"\u4e0a":if("A/P"===n.substr(a,3).toUpperCase()||"AM/PM"===n.substr(a,5).toUpperCase()||"\u4e0a\u5348/\u4e0b\u5348"===n.substr(a,5).toUpperCase())return!0;++a;break;case"[":for(r=t;"]"!==n.charAt(a++)&&a<n.length;)r+=n.charAt(a);if(r.match(Lc))return!0;break;case".":case"0":case"#":for(;a<n.length&&("0#?.,E+-%".indexOf(t=n.charAt(++a))>-1||"\\"==t&&"-"==n.charAt(a+1)&&"0#".indexOf(n.charAt(a+2))>-1););break;case"?":for(;n.charAt(++a)===t;);break;case"*":++a,(" "==n.charAt(a)||"*"==n.charAt(a))&&++a;break;case"(":case")":++a;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;a<n.length&&"0123456789".indexOf(n.charAt(++a))>-1;);break;default:++a}return!1}var $c=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function Vc(n,a){if(null==a)return!1;var t=parseFloat(a[2]);switch(a[1]){case"=":if(n==t)return!0;break;case">":if(n>t)return!0;break;case"<":if(n<t)return!0;break;case"<>":if(n!=t)return!0;break;case">=":if(n>=t)return!0;break;case"<=":if(n<=t)return!0}return!1}function Ln(n,a,t){null==t&&(t={});var r="";switch(typeof n){case"string":r="m/d/yy"==n&&t.dateNF?t.dateNF:n;break;case"number":null==(r=14==n&&t.dateNF?t.dateNF:(null!=t.table?t.table:Re)[n])&&(r=t.table&&t.table[Ec[n]]||Re[Ec[n]]),null==r&&(r=f3[n]||"General")}if(hs(r,0))return pi(a,t);a instanceof Date&&(a=Dc(a,t.date1904));var i=function R3(n,a){var t=function I3(n){for(var a=[],t=!1,r=0,i=0;r<n.length;++r)switch(n.charCodeAt(r)){case 34:t=!t;break;case 95:case 42:case 92:++r;break;case 59:a[a.length]=n.substr(i,r-i),i=r+1}if(a[a.length]=n.substr(i),!0===t)throw new Error("Format |"+n+"| unterminated string ");return a}(n),r=t.length,i=t[r-1].indexOf("@");if(r<4&&i>-1&&--r,t.length>4)throw new Error("cannot find right format for |"+t.join("|")+"|");if("number"!=typeof a)return[4,4===t.length||i>-1?t[t.length-1]:"@"];switch(t.length){case 1:t=i>-1?["General","General","General",t[0]]:[t[0],t[0],t[0],"@"];break;case 2:t=i>-1?[t[0],t[0],t[0],t[1]]:[t[0],t[1],t[0],"@"];break;case 3:t=i>-1?[t[0],t[1],t[0],t[2]]:[t[0],t[1],t[2],"@"]}var s=a>0?t[0]:a<0?t[1]:t[2];if(-1===t[0].indexOf("[")&&-1===t[1].indexOf("["))return[r,s];if(null!=t[0].match(/\[[=<>]/)||null!=t[1].match(/\[[=<>]/)){var o=t[0].match($c),l=t[1].match($c);return Vc(a,o)?[r,t[0]]:Vc(a,l)?[r,t[1]]:[r,t[null!=o&&null!=l?2:1]]}return[r,s]}(r,a);if(hs(i[1]))return pi(a,t);if(!0===a)a="TRUE";else if(!1===a)a="FALSE";else if(""===a||null==a)return"";return function D3(n,a,t,r){for(var d,p,u,i=[],s="",o=0,l="",c="t",f="H";o<n.length;)switch(l=n.charAt(o)){case"G":if(!hs(n,o))throw new Error("unrecognized character "+l+" in "+n);i[i.length]={t:"G",v:"General"},o+=7;break;case'"':for(s="";34!==(u=n.charCodeAt(++o))&&o<n.length;)s+=String.fromCharCode(u);i[i.length]={t:"t",v:s},++o;break;case"\\":var h=n.charAt(++o);i[i.length]={t:"("===h||")"===h?h:"t",v:h},++o;break;case"_":i[i.length]={t:"t",v:" "},o+=2;break;case"@":i[i.length]={t:"T",v:a},++o;break;case"B":case"b":if("1"===n.charAt(o+1)||"2"===n.charAt(o+1)){if(null==d&&null==(d=zr(a,t,"2"===n.charAt(o+1))))return"";i[i.length]={t:"X",v:n.substr(o,2)},c=l,o+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":l=l.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(a<0||null==d&&null==(d=zr(a,t)))return"";for(s=l;++o<n.length&&n.charAt(o).toLowerCase()===l;)s+=l;"m"===l&&"h"===c.toLowerCase()&&(l="M"),"h"===l&&(l=f),i[i.length]={t:l,v:s},c=l;break;case"A":case"a":case"\u4e0a":var m={t:l,v:l};if(null==d&&(d=zr(a,t)),"A/P"===n.substr(o,3).toUpperCase()?(null!=d&&(m.v=d.H>=12?"P":"A"),m.t="T",f="h",o+=3):"AM/PM"===n.substr(o,5).toUpperCase()?(null!=d&&(m.v=d.H>=12?"PM":"AM"),m.t="T",o+=5,f="h"):"\u4e0a\u5348/\u4e0b\u5348"===n.substr(o,5).toUpperCase()?(null!=d&&(m.v=d.H>=12?"\u4e0b\u5348":"\u4e0a\u5348"),m.t="T",o+=5,f="h"):(m.t="t",++o),null==d&&"T"===m.t)return"";i[i.length]=m,c=l;break;case"[":for(s=l;"]"!==n.charAt(o++)&&o<n.length;)s+=n.charAt(o);if("]"!==s.slice(-1))throw'unterminated "[" block: |'+s+"|";if(s.match(Lc)){if(null==d&&null==(d=zr(a,t)))return"";i[i.length]={t:"Z",v:s.toLowerCase()},c=s.charAt(1)}else s.indexOf("$")>-1&&(s=(s.match(/\$([^-\[\]]*)/)||[])[1]||"$",ui(n)||(i[i.length]={t:"t",v:s}));break;case".":if(null!=d){for(s=l;++o<n.length&&"0"===(l=n.charAt(o));)s+=l;i[i.length]={t:"s",v:s};break}case"0":case"#":for(s=l;++o<n.length&&"0#?.,E+-%".indexOf(l=n.charAt(o))>-1;)s+=l;i[i.length]={t:"n",v:s};break;case"?":for(s=l;n.charAt(++o)===l;)s+=l;i[i.length]={t:l,v:s},c=l;break;case"*":++o,(" "==n.charAt(o)||"*"==n.charAt(o))&&++o;break;case"(":case")":i[i.length]={t:1===r?"t":l,v:l},++o;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(s=l;o<n.length&&"0123456789".indexOf(n.charAt(++o))>-1;)s+=n.charAt(o);i[i.length]={t:"D",v:s};break;case" ":i[i.length]={t:l,v:l},++o;break;case"$":i[i.length]={t:"t",v:"$"},++o;break;default:if(-1===",$-+/():!^&'~{}<>=\u20acacfijklopqrtuvwxzP".indexOf(l))throw new Error("unrecognized character "+l+" in "+n);i[i.length]={t:"t",v:l},++o}var k,_=0,v=0;for(o=i.length-1,c="t";o>=0;--o)switch(i[o].t){case"h":case"H":i[o].t=f,c="h",_<1&&(_=1);break;case"s":(k=i[o].v.match(/\.0+$/))&&(v=Math.max(v,k[0].length-1)),_<3&&(_=3);case"d":case"y":case"M":case"e":c=i[o].t;break;case"m":"s"===c&&(i[o].t="M",_<2&&(_=2));break;case"X":break;case"Z":_<1&&i[o].v.match(/[Hh]/)&&(_=1),_<2&&i[o].v.match(/[Mm]/)&&(_=2),_<3&&i[o].v.match(/[Ss]/)&&(_=3)}switch(_){case 0:break;case 1:d.u>=.5&&(d.u=0,++d.S),d.S>=60&&(d.S=0,++d.M),d.M>=60&&(d.M=0,++d.H);break;case 2:d.u>=.5&&(d.u=0,++d.S),d.S>=60&&(d.S=0,++d.M)}var A,b="";for(o=0;o<i.length;++o)switch(i[o].t){case"t":case"T":case" ":case"D":break;case"X":i[o].v="",i[o].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":i[o].v=b3(i[o].t.charCodeAt(0),i[o].v,d,v),i[o].t="t";break;case"n":case"?":for(A=o+1;null!=i[A]&&("?"===(l=i[A].t)||"D"===l||(" "===l||"t"===l)&&null!=i[A+1]&&("?"===i[A+1].t||"t"===i[A+1].t&&"/"===i[A+1].v)||"("===i[o].t&&(" "===l||"n"===l||")"===l)||"t"===l&&("/"===i[A].v||" "===i[A].v&&null!=i[A+1]&&"?"==i[A+1].t));)i[o].v+=i[A].v,i[A]={v:"",t:";"},++A;b+=i[o].v,o=A-1;break;case"G":i[o].t="t",i[o].v=pi(a,t)}var j,w,G="";if(b.length>0){40==b.charCodeAt(0)?(j=a<0&&45===b.charCodeAt(0)?-a:a,w=Rr("n",b,j)):(w=Rr("n",b,j=a<0&&r>1?-a:a),j<0&&i[0]&&"t"==i[0].t&&(w=w.substr(1),i[0].v="-"+i[0].v)),A=w.length-1;var O=i.length;for(o=0;o<i.length;++o)if(null!=i[o]&&"t"!=i[o].t&&i[o].v.indexOf(".")>-1){O=o;break}var M=i.length;if(O===i.length&&-1===w.indexOf("E")){for(o=i.length-1;o>=0;--o)null==i[o]||-1==="n?".indexOf(i[o].t)||(A>=i[o].v.length-1?i[o].v=w.substr(1+(A-=i[o].v.length),i[o].v.length):A<0?i[o].v="":(i[o].v=w.substr(0,A+1),A=-1),i[o].t="t",M=o);A>=0&&M<i.length&&(i[M].v=w.substr(0,A+1)+i[M].v)}else if(O!==i.length&&-1===w.indexOf("E")){for(A=w.indexOf(".")-1,o=O;o>=0;--o)if(null!=i[o]&&-1!=="n?".indexOf(i[o].t)){for(p=i[o].v.indexOf(".")>-1&&o===O?i[o].v.indexOf(".")-1:i[o].v.length-1,G=i[o].v.substr(p+1);p>=0;--p)A>=0&&("0"===i[o].v.charAt(p)||"#"===i[o].v.charAt(p))&&(G=w.charAt(A--)+G);i[o].v=G,i[o].t="t",M=o}for(A>=0&&M<i.length&&(i[M].v=w.substr(0,A+1)+i[M].v),A=w.indexOf(".")+1,o=O;o<i.length;++o)if(null!=i[o]&&(-1!=="n?(".indexOf(i[o].t)||o===O)){for(p=i[o].v.indexOf(".")>-1&&o===O?i[o].v.indexOf(".")+1:0,G=i[o].v.substr(0,p);p<i[o].v.length;++p)A<w.length&&(G+=w.charAt(A++));i[o].v=G,i[o].t="t",M=o}}}for(o=0;o<i.length;++o)null!=i[o]&&"n?".indexOf(i[o].t)>-1&&(i[o].v=Rr(i[o].t,i[o].v,j=r>1&&a<0&&o>0&&"-"===i[o-1].v?-a:a),i[o].t="t");var H="";for(o=0;o!==i.length;++o)null!=i[o]&&(H+=i[o].v);return H}(i[1],a,t,i[0])}function xr(n,a){if("number"!=typeof a){a=+a||-1;for(var t=0;t<392;++t)if(null!=Re[t]){if(Re[t]==n){a=t;break}}else a<0&&(a=t);a<0&&(a=391)}return Re[a]=n,a}function Ni(){Re=function u3(n){return n||(n={}),n[0]="General",n[1]="0",n[2]="0.00",n[3]="#,##0",n[4]="#,##0.00",n[9]="0%",n[10]="0.00%",n[11]="0.00E+00",n[12]="# ?/?",n[
113]="# ??/??",n[14]="m/d/yy",n[15]="d-mmm-yy",n[16]="d-mmm",n[17]="mmm-yy",n[18]="h:mm AM/PM",n[19]="h:mm:ss AM/PM",n[20]="h:mm",n[21]="h:mm:ss",n[22]="m/d/yy h:mm",n[37]="#,##0 ;(#,##0)",n[38]="#,##0 ;[Red](#,##0)",n[39]="#,##0.00;(#,##0.00)",n[40]="#,##0.00;[Red](#,##0.00)",n[45]="mm:ss",n[46]="[h]:mm:ss",n[47]="mmss.0",n[48]="##0.0E+0",n[49]="@",n[56]='"\u4e0a\u5348/\u4e0b\u5348 "hh"\u6642"mm"\u5206"ss"\u79d2 "',n}()}var A3={5:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',23:"General",24:"General",25:"General",26:"General",27:"m/d/yy",28:"m/d/yy",29:"m/d/yy",30:"m/d/yy",31:"m/d/yy",32:"h:mm:ss",33:"h:mm:ss",34:"h:mm:ss",35:"h:mm:ss",36:"m/d/yy",41:'_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* (#,##0);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',50:"m/d/yy",51:"m/d/yy",52:"m/d/yy",53:"m/d/yy",54:"m/d/yy",55:"m/d/yy",56:"m/d/yy",57:"m/d/yy",58:"m/d/yy",59:"0",60:"0.00",61:"#,##0",62:"#,##0.00",63:'"$"#,##0_);\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',67:"0%",68:"0.00%",69:"# ?/?",70:"# ??/??",71:"m/d/yy",72:"m/d/yy",73:"d-mmm-yy",74:"d-mmm",75:"mmm-yy",76:"h:mm",77:"h:mm:ss",78:"m/d/yy h:mm",79:"mm:ss",80:"[h]:mm:ss",81:"mmss.0"},Uc=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g,O3=function(){var n={version:"1.2.0"},t=function a(){for(var w=0,O=new Array(256),M=0;256!=M;++M)O[M]=w=1&(w=1&(w=1&(w=1&(w=1&(w=1&(w=1&(w=1&(w=M)?-306674912^w>>>1:w>>>1)?-306674912^w>>>1:w>>>1)?-306674912^w>>>1:w>>>1)?-306674912^w>>>1:w>>>1)?-306674912^w>>>1:w>>>1)?-306674912^w>>>1:w>>>1)?-306674912^w>>>1:w>>>1)?-306674912^w>>>1:w>>>1;return typeof Int32Array<"u"?new Int32Array(O):O}(),i=function r(w){var O=0,M=0,H=0,z=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(H=0;256!=H;++H)z[H]=w[H];for(H=0;256!=H;++H)for(M=w[H],O=256+H;O<4096;O+=256)M=z[O]=M>>>8^w[255&M];var P=[];for(H=1;16!=H;++H)P[H-1]=typeof Int32Array<"u"?z.subarray(256*H,256*H+256):z.slice(256*H,256*H+256);return P}(t),s=i[0],o=i[1],l=i[2],c=i[3],d=i[4],p=i[5],u=i[6],f=i[7],h=i[8],g=i[9],m=i[10],_=i[11],v=i[12],k=i[13],b=i[14];return n.table=t,n.bstr=function A(w,O){for(var M=~O,H=0,z=w.length;H<z;)M=M>>>
18^t[255&(M^w.charCodeAt(H++))];return~M},n.buf=function G(w,O){for(var M=~O,H=w.length-15,z=0;z<H;)M=b[w[z++]^255&M]^k[w[z++]^M>>8&255]^v[w[z++]^M>>16&255]^_[w[z++]^M>>>24]^m[w[z++]]^g[w[z++]]^h[w[z++]]^f[w[z++]]^u[w[z++]]^p[w[z++]]^d[w[z++]]^c[w[z++]]^l[w[z++]]^o[w[z++]]^s[w[z++]]^t[w[z++]];for(H+=15;z<H;)M=M>>>8^t[255&(M^w[z++])];return~M},n.str=function j(w,O){for(var M=~O,H=0,z=w.length,P=0,oe=0;H<z;)(P=w.charCodeAt(H++))<128?M=M>>>8^t[255&(M^P)]:P<2048?M=(M=M>>>8^t[255&(M^(192|P>>6&31))])>>>8^t[255&(M^(128|63&P))]:P>=55296&&P<57344?(P=64+(1023&P),oe=1023&w.charCodeAt(H++),M=(M=(M=(M=M>>>8^t[255&(M^(240|P>>8&7))])>>>8^t[255&(M^(128|P>>2&63))])>>>8^t[255&(M^(128|oe>>6&15|(3&P)<<4))])>>>8^t[255&(M^(128|63&oe))]):M=(M=(M=M>>>8^t[255&(M^(224|P>>12&15))])>>>8^t[255&(M^(128|P>>6&63))])>>>8^t[255&(M^(128|63&P))];return~M},n}(),Ee=function(){var c,a={};function r(x){if("/"==x.charAt(x.length-1))return-1===x.slice(0,-1).indexOf("/")?x:r(x.slice(0,-1));var y=x.lastIndexOf("/");return-1===y?x:x.slice(0,y+1)}function i(x){if("/"==x.charAt(x.length-1))return i(x.slice(0,-1));var y=x.lastIndexOf("/");return-1===y?x:x.slice(y+1)}function s(x,y){"string"==typeof y&&(y=new Date(y));var C=y.getHours();C=(C=C<<6|y.getMinutes())<<5|y.getSeconds()>>>1,x.write_shift(2,C);var T=y.getFullYear()-1980;T=(T=T<<4|y.getMonth()+1)<<5|y.getDate(),x.write_shift(2,T)}function l(x){fn(x,0);for(var y={},C=0;x.l<=x.length-4;){var T=x.read_shift(2),F=x.read_shift(2),S=x.l+F,V={};21589===T&&(1&(C=x.read_shift(1))&&(V.mtime=x.read_shift(4)),F>5&&(2&C&&(V.atime=x.read_shift(4)),4&C&&(V.ctime=x.read_shift(4))),V.mtime&&(V.mt=new Date(1e3*V.mtime))),x.l=S,y[T]=V}return y}function d(){return c||(c={})}function p(x,y){if(80==x[0]&&75==x[1])return nu(x,y);if(109==(32|x[0])&&105==(32|x[1]))return function gj(x,y){if("mime-version:"!=ge(x.slice(0,13)).toLowerCase())throw new Error("Unsupported MAD header");var C=y&&y.root||"",T=(We&&Buffer.isBuffer(x)?x.toString("binary"):ge(x)).split("\r\n"),F=0,S="";for(F=0;F<T.length;++F)if(/^Content-Location:/i.test(S=T[F])&&(S=S.slice(S.indexOf("file")),C||(C=S.slice(0,S.lastIndexOf("/")+1)),S.slice(0,C.length)!=C))for(;C.length>0&&(C=(C=C.slice(0,C.length-1)).slice(0,C.lastIndexOf("/")+1),S.slice(0,C.length)!=C););var V=(T[1]||"").match(/boundary="(.*?)"/);if(!V)throw new Error("MAD cannot find boundary");var Q="--"+(V[1]||""),W={FileIndex:[],FullPaths:[]};w(W);var se,ue=0;for(F=0;F<T.length;++F){var we=T[F];we!==Q&&we!==Q+"--"||(ue++&&hj(W,T.slice(se,F),C),se=F)}return W}(x,y);if(x.length<512)throw new Error("CFB file size "+x.length+" < 512");var C,F,S,V,Q,Y,T=512,U=[],W=x.slice(0,512);fn(W,0);var se=function u(x){if(80==x[x.l]&&75==x[x.l+1])return[0,0];x.chk(ve,"Header Signature: "),x.l+=16;var y=x.read_shift(2,"u");return[x.read_shift(2,"u"),y]}(W);switch(C=se[0]){case 3:T=512;break;case 4:T=4096;break;case 0:if(0==se[1])return nu(x,y);default:throw new Error("Major Version: Expected 3 or 4 saw "+C)}512!==T&&fn(W=x.slice(0,T),28);var ue=x.slice(0,T);!function f(x,y){var C;switch(x.l+=2,C=x.read_shift(2)){case 9:if(3!=y)throw new Error("Sector Shift: Expected 9 saw "+C);break;case 12:if(4!=y)throw new Error("Sector Shift: Expected 12 saw "+C);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+C)}x.chk("0600","Mini Sector Shift: "),x.chk("000000000000","Reserved: ")}(W,C);var we=W.read_shift(4,"i");if(3===C&&0!==we)throw new Error("# Directory Sectors: Expected 0 saw "+we);W.l+=4,V=W.read_shift(4,"i"),W.l+=4,W.chk("00100000","Mini Stream Cutoff Size: "),Q=W.read_shift(4,"i"),F=W.read_shift(4,"i"),Y=W.read_shift(4,"i"),S=W.read_shift(4,"i");for(var fe=-1,he=0;he<109&&!((fe=W.read_shift(4,"i"))<0);++he)U[he]=fe;var Ne=function h(x,y){for(var C=Math.ceil(x.length/y)-1,T=[],F=1;F<C;++F)T[F-1]=x.slice(F*y,(F+1)*y);return T[C-1]=x.slice(C*y),T}(x,T);_(Y,S,Ne,T,U);var St=function k(x,y,C,T){var F=x.length,S=[],V=[],Q=[],Y=[],U=T-1,W=0,se=0,ue=0,we=0;for(W=0;W<F;++W)if(Q=[],(ue=W+y)>=F&&(ue-=F),!V[ue]){Y=[];var fe=[];for(se=ue;se>=0;){fe[se]=!0,V[se]=!0,Q[Q.length]=se,Y.push(x[se]);var he=C[Math.floor(4*se/T)];if(T<4+(we=4*se&U))throw new Error("FAT boundary crossed: "+se+" 4 "+T);
1if(!x[he]||fe[se=mi(x[he],we)])break}S[ue]={nodes:Q,data:ud([Y])}}return S}(Ne,V,U,T);St[V].name="!Directory",F>0&&Q!==oe&&(St[Q].name="!MiniFAT"),St[U[0]].name="!FAT",St.fat_addrs=U,St.ssz=T;var Qt=[],Yn=[],Xa=[];(function b(x,y,C,T,F,S,V,Q){for(var we,Y=0,U=T.length?2:0,W=y[x].data,se=0,ue=0;se<W.length;se+=128){var fe=W.slice(se,se+128);fn(fe,64),ue=fe.read_shift(2),we=ks(fe,0,ue-U),T.push(we);var he={name:we,type:fe.read_shift(1),color:fe.read_shift(1),L:fe.read_shift(4,"i"),R:fe.read_shift(4,"i"),C:fe.read_shift(4,"i"),clsid:fe.read_shift(16),state:fe.read_shift(4,"i"),start:0,size:0};0!==fe.read_shift(2)+fe.read_shift(2)+fe.read_shift(2)+fe.read_shift(2)&&(he.ct=A(fe,fe.l-8)),0!==fe.read_shift(2)+fe.read_shift(2)+fe.read_shift(2)+fe.read_shift(2)&&(he.mt=A(fe,fe.l-8)),he.start=fe.read_shift(4,"i"),he.size=fe.read_shift(4,"i"),he.size<0&&he.start<0&&(he.size=he.type=0,he.start=oe,he.name=""),5===he.type?(Y=he.start,F>0&&Y!==oe&&(y[Y].name="!StreamData")):he.size>=4096?(he.storage="fat",void 0===y[he.start]&&(y[he.start]=v(C,he.start,y.fat_addrs,y.ssz)),y[he.start].name=he.name,he.content=y[he.start].data.slice(0,he.size)):(he.storage="minifat",he.size<0?he.size=0:Y!==oe&&he.start!==oe&&y[Y]&&(he.content=m(he,y[Y].data,(y[Q]||{}).data))),he.content&&fn(he.content,0),S[we]=he,V.push(he)}})(V,St,Ne,Qt,F,{},Yn,Q),function g(x,y,C){for(var T=0,F=0,S=0,V=0,Q=0,Y=C.length,U=[],W=[];T<Y;++T)U[T]=W[T]=T,y[T]=C[T];for(;Q<W.length;++Q)F=x[T=W[Q]].L,S=x[T].R,V=x[T].C,U[T]===T&&(-1!==F&&U[F]!==F&&(U[T]=U[F]),-1!==S&&U[S]!==S&&(U[T]=U[S])),-1!==V&&(U[V]=T),-1!==F&&T!=U[T]&&(U[F]=U[T],W.lastIndexOf(F)<Q&&W.push(F)),-1!==S&&T!=U[T]&&(U[S]=U[T],W.lastIndexOf(S)<Q&&W.push(S));for(T=1;T<Y;++T)U[T]===T&&(-1!==S&&U[S]!==S?U[T]=U[S]:-1!==F&&U[F]!==F&&(U[T]=U[F]));for(T=1;T<Y;++T)if(0!==x[T].type){if((Q=T)!=U[Q])do{y[T]=y[Q=U[Q]]+"/"+y[T]}while(0!==Q&&-1!==U[Q]&&Q!=U[Q]);U[T]=-1}for(y[0]+="/",T=1;T<Y;++T)2!==x[T].type&&(y[T]+="/")}(Yn,Xa,Qt),Qt.shift();var Ya={FileIndex:Yn,FullPaths:Xa};return y&&y.raw&&(Ya.raw={header:ue,sectors:Ne}),Ya}function m(x,y,C){for(var F=x.size,S=[],V=x.start;C&&F>0&&V>=0;)S.push(y.slice(V*P,V*P+P)),F-=P,V=mi(C,4*V);return 0===S.length?K(0):sn(S).slice(0,x.size)}function _(x,y,C,T,F){var S=oe;if(x===oe){if(0!==y)throw new Error("DIFAT chain shorter than expected")}else if(-1!==x){var V=C[x],Q=(T>>>2)-1;if(!V)return;for(var Y=0;Y<Q&&(S=mi(V,4*Y))!==oe;++Y)F.push(S);_(mi(V,T-4),y-1,C,T,F)}}function v(x,y,C,T,F){var S=[],V=[];F||(F=[]);var Q=T-1,Y=0,U=0;for(Y=y;Y>=0;){F[Y]=!0,S[S.length]=Y,V.push(x[Y]);var W=C[Math.floor(4*Y/T)];if(T<4+(U=4*Y&Q))throw new Error("FAT boundary crossed: "+Y+" 4 "+T);if(!x[W])break;Y=mi(x[W],U)}return{nodes:S,data:ud([V])}}function A(x,y){return new Date(1e3*(on(x,y+4)/1e7*Math.pow(2,32)+on(x,y)/1e7-11644473600))}function w(x,y){var C=y||{},T=C.root||"Root Entry";if(x.FullPaths||(x.FullPaths=[]),x.FileIndex||(x.FileIndex=[]),x.FullPaths.length!==x.FileIndex.length)throw new Error("inconsistent CFB structure");0===x.FullPaths.length&&(x.FullPaths[0]=T+"/",x.FileIndex[0]={name:T,type:5}),C.CLSID&&(x.FileIndex[0].clsid=C.CLSID),function O(x){var y="\x01Sh33tJ5";if(!Ee.find(x,"/"+y)){var C=K(4);C[0]=55,C[1]=C[3]=50,C[2]=54,x.FileIndex.push({name:y,type:2,content:C,size:4,L:69,R:69,C:69}),x.FullPaths.push(x.FullPaths[0]+y),M(x)}}(x)}function M(x,y){w(x);for(var C=!1,T=!1,F=x.FullPaths.length-1;F>=0;--F){var S=x.FileIndex[F];switch(S.type){case 0:T?C=!0:(x.FileIndex.pop(),x.FullPaths.pop());break;case 1:case 2:case 5:T=!0,isNaN(S.R*S.L*S.C)&&(C=!0),S.R>-1&&S.L>-1&&S.R==S.L&&(C=!0);break;default:C=!0}}if(C||y){var V=new Date(1987,1,19),Q=0,Y=Object.create?Object.create(null):{},U=[];for(F=0;F<x.FullPaths.length;++F)Y[x.FullPaths[F]]=!0,0!==x.FileIndex[F].type&&U.push([x.FullPaths[F],x.FileIndex[F]]);for(F=0;F<U.length;++F){var W=r(U[F][0]);(T=Y[W])||(U.push([W,{name:i(W).replace("/",""),type:1,clsid:ye,ct:V,mt:V,content:null}]),Y[W]=!0)}for(U.sort(function(we,fe){return function t(x,y){for(var C=x.split("/"),T=y.split("/"),F=0,S=0,V=Math.min(C.length,T.length);F<V;++F){if(S=C[F].length-T[F].length)return S;if(C[F]!=T[F])return C[F]<T[F]?-1:1}return C.length-T.length}(we[0],fe[0])}),x.FullPaths=[],x.FileIndex=[],F=0;F<U.length;++F)x.FullPaths[F]=U[F][0],x.FileIndex[F]=U[F][1];for(F=0;F<U.length;++F){var se=x.FileIndex[F],ue=x.FullPaths[F];if(se.name=i(ue).replace("/",""),se.L=se.R=se.C=-(se.color=1),se.size=se.content?se.content.length:0,se.start=0,se.clsid=se.clsid||ye,0===F)se.C=U.length>1?1:-1,se.size=0,se.type=5;else if("/"==ue.slice(-1)){for(Q=F+1;Q<U.length&&r(x.FullPaths[Q])!=ue;++Q);for(se.C=Q>=U.length?-1:Q,Q=F+1;Q<U.length&&r(x.FullPaths[Q])!=r(ue);++Q);se.R=Q>=U.length?-1:Q,se.type=1}else r(x.FullPaths[F+1]||"")==r(ue)&&(se.R=F+1),se.type=2}}}function H(x,y){var C=y||{};if("mad"==C.fileType)return function _j(x,y){for(var C=y||{},T=C.boundary||"SheetJS",F=["MIME-Version: 1.0",'Content-Type: multipart/related; boundary="'+(T="------="+T).slice(2)+'"',"","",""],S=x.FullPaths[0],V=S,Q=x.FileIndex[0],Y=1;Y<x.FullPaths.length;++Y)if(V=x.FullPaths[Y].slice(S.length),(Q=x.FileIndex[Y]).size&&Q.content&&"\x01Sh33tJ5"!=V){V=V.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF]/g,function(Ne){return"_x"+Ne.charCodeAt(0).toString(16)+"_"}).replace(/[\u0080-\uFFFF]/g,function(Ne){return"_u"+Ne.charCodeAt(0).toString(16)+"_"});for(var U=Q.content,W=We&&Buffer.isBuffer(U)?U.toString("binary"):ge(U),se=0,ue=Math.min(1024,W.length),we=0,fe=0;fe<=ue;++fe)(we=W.charCodeAt(fe))>=32&&we<128&&++se;var he=se>=4*ue/5;F.push(T),F.push("Content-Location: "+(C.root||"file:///C:/SheetJS/")+V),F.push("Content-Transfer-Encoding: "+(he?"quoted-printable":"base64")),F.push("Content-Type: "+pj(Q,V)),F.push(""),F.push(he?fj(W):uj(W))}return F.push(T+"--\r\n"),F.join("\r\n")}(x,C);if("zip"===(M(x),C.fileType))return function dj(x,y){var C=y||{},T=[],F=[],S=K(1),V=C.compression?8:0,Q=0,U=0,W=0,se=0,ue=0,we=x.FullPaths[0],fe=we,he=x.FileIndex[0],Ne=[],St=0;for(U=1;U<x.FullPaths.length;++U)if(fe=x.FullPaths[U].slice(we.length),(he=x.FileIndex[U]).size&&he.content&&"\x01Sh33tJ5"!=fe){var Pn=se,Qt=K(fe.length);for(W=0;W<fe.length;++W)Qt.write_shift(1,127&fe.charCodeAt(W));Qt=Qt.slice(0,Qt.l),Ne[ue]=O3.buf(he.content,0);var Yn=he.content;8==V&&(Yn=R(Yn)),(S=K(30)).write_shift(4,67324752),S.write_shift(2,20),S.write_shift(2,Q),S.write_shift(2,V),he.mt?s(S,he.mt):S.write_shift(4,0),S.write_shift(-4,8&Q?0:Ne[ue]),S.write_shift(4,8&Q?0:Yn.length),S.write_shift(4,8&Q?0:he.content.length),S.write_shift(2,Qt.length),S.write_shift(2,0),se+=S.length,T.push(S),se+=Qt.length,T.push(Qt),se+=Yn.length,T.push(Yn),8&Q&&((S=K(12)).write_shift(-4,Ne[ue]),S.write_shift(4,Yn.length),S.write_shift(4,he.content.length),se+=S.l,T.push(S)),(S=K(46)).write_shift(4,33639248),S.write_shift(2,0),S.write_shift(2,20),S.write_shift(2,Q),S.write_shift(2,V),S.write_shift(4,0),S.write_shift(-4,Ne[ue]),S.write_shift(4,Yn.length),S.write_shift(4,he.content.length),S.write_shift(2,Qt.length),S.write_shift(2,0),S.write_shift(2,0),S.write_shift(2,0),S.write_shift(2,0),S.write_shift(4,0),S.write_shift(4,Pn),St+=S.l,F.push(S),St+=Qt.length,F.push(Qt),++ue}return(S=K(22)).write_shift(4,101010256),S.write_shift(2,0),S.write_shift(2,0),S.write_shift(2,ue),S.write_shift(2,ue),S.write_shift(4,St),S.write_shift(4,se),S.write_shift(2,0),sn([sn(T),sn(F),S])}(x,C);var T=function(we){for(var fe=0,he=0,Ne=0;Ne<we.FileIndex.length;++Ne){var St=we.FileIndex[Ne];if(St.content){var Pn=St.content.length;Pn>0&&(Pn<4096?fe+=Pn+63>>6:he+=Pn+511>>9)}}for(var Qt=we.FullPaths.length+3>>2,Xa=fe+127>>7,Ya=(fe+7>>3)+he+Qt+Xa,Di=Ya+127>>7,jl=Di<=109?0:Math.ceil((Di-109)/127);Ya+Di+jl+127>>7>Di;)jl=++Di<=109?0:Math.ceil((Di-109)/127);var Br=[1,jl,Di,Xa,Qt,he,fe,0];return we.FileIndex[0].size=fe<<6,Br[7]=(we.FileIndex[0].start=Br[0]+Br[1]+Br[2]+Br[3]+Br[4]+Br[5])+(Br[6]+7>>3),Br}(x),F=K(T[7]<<9),S=0,V=0;for(S=0;S<8;++S)F.write_shift(1,ae[S]);for(S=0;S<8;++S)F.write_shift(2,0);for(F.write_shift(2,62),F.write_shift(2,3),F.write_shift(2,65534),F.write_shift(2,9),F.write_shift(2,6),S=0;S<3;++S)F.write_shift(2,0);for(F.write_shift(4,0),F.write_shift(4,T[2]),F.write_shift(4,T[0]+T[1]+T[2]+T[3]-1),F.write_shift(4,0),F.write_shift(4,4096),F.write_shift(4,T[3]?T[0]+T[1]+T[2]-1:oe),F.write_shift(4,T[3]),F.write_shift(-4,T[1]?T[0]-1:oe),F.write_shift(4,T[1]),S=0;S<109;++S)F.write_shift(-4,S<T[2]?T[1]+S:-1);if(T[1])for(V=0;V<T[1];++V){for(;S<236+127*V;++S)F.write_shift(-4,S<T[2]?T[1]+S:-1);F.write_shift(-4,V===T[1]-1?oe:V+1)}var Q=function(we){for(V+=we;S<V-1;++S)F.write_shift(-4,S+1);we&&(++S,F.write_shift(-4,oe))};for(V=S=0,V+=T[1];S<V;++S)F.write_shift(-4,ke.DIFSECT);for(V+=T[2];S<V;++S)F.write_shift(-4,ke.FATSECT);Q(T[3]),Q(T[4]);for(var Y=0,U=0,W=x.FileIndex[0];Y<x.FileIndex.length;++Y)(W=x.FileIndex[Y]).content&&!((U=W.content.length)<4096)&&(W.start=V,Q(U+511>>9));for(Q(T[6]+7>>3);511&F.l;)F.write_shift(-4,ke.ENDOFCHAIN);for(V=S=0,Y=0;Y<x.FileIndex.length;++Y)(W=x.FileIndex[Y]).content&&(U=W.content.length)&&!(U>=4096)&&(W.start=V,Q(U+63>>6));for(;511&F.l;)F.write_shift(-4,ke.ENDOFCHAIN);for(S=0;S<T[4]<<2;++S){var se=x.FullPaths[S];if(se&&0!==se.length){W=x.FileIndex[S],0===S&&(W.start=W.size?W.start-1:oe);var ue=0===S&&C.root||W.name;if(U=2*(ue.length+1),F.write_shift(64,ue,"utf16le"),F.write_shift(2,U),F.write_shift(1,W.type),F.write_shift(1,W.color),F.write_shift(-4,W.L),F.write_shift(-4,W.R),F.write_shift(-4,W.C),W.clsid)F.write_shift(16,W.clsid,"hex");else for(Y=0;Y<4;
1++Y)F.write_shift(4,0);F.write_shift(4,W.state||0),F.write_shift(4,0),F.write_shift(4,0),F.write_shift(4,0),F.write_shift(4,0),F.write_shift(4,W.start),F.write_shift(4,W.size),F.write_shift(4,0)}else{for(Y=0;Y<17;++Y)F.write_shift(4,0);for(Y=0;Y<3;++Y)F.write_shift(4,-1);for(Y=0;Y<12;++Y)F.write_shift(4,0)}}for(S=1;S<x.FileIndex.length;++S)if((W=x.FileIndex[S]).size>=4096)if(F.l=W.start+1<<9,We&&Buffer.isBuffer(W.content))W.content.copy(F,F.l,0,W.size),F.l+=W.size+511&-512;else{for(Y=0;Y<W.size;++Y)F.write_shift(1,W.content[Y]);for(;511&Y;++Y)F.write_shift(1,0)}for(S=1;S<x.FileIndex.length;++S)if((W=x.FileIndex[S]).size>0&&W.size<4096)if(We&&Buffer.isBuffer(W.content))W.content.copy(F,F.l,0,W.size),F.l+=W.size+63&-64;else{for(Y=0;Y<W.size;++Y)F.write_shift(1,W.content[Y]);for(;63&Y;++Y)F.write_shift(1,0)}if(We)F.l=F.length;else for(;F.l<F.length;)F.write_shift(1,0);return F}a.version="1.2.1";var te,P=64,oe=-2,ve="d0cf11e0a1b11ae1",ae=[208,207,17,224,161,177,26,225],ye="00000000000000000000000000000000",ke={MAXREGSECT:-6,DIFSECT:-4,FATSECT:-3,ENDOFCHAIN:oe,FREESECT:-1,HEADER_SIGNATURE:ve,HEADER_MINOR_VERSION:"3e00",MAXREGSID:-6,NOSTREAM:-1,HEADER_CLSID:ye,EntryTypes:["unknown","storage","stream","lockbytes","property","root"]};function ge(x){for(var y=new Array(x.length),C=0;C<x.length;++C)y[C]=String.fromCharCode(x[C]);return y.join("")}function R(x){return te?te.deflateRawSync(x):ze(x)}for(var x,y,D=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Z=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],me=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],ce=typeof Uint8Array<"u",ne=ce?new Uint8Array(256):[],Le=0;Le<256;++Le)ne[Le]=(void 0,255&((y=139536&((x=Le)<<1|x<<11)|558144&(x<<5|x<<15))>>16|y>>8|y));function E(x,y){var C=ne[255&x];return y<=8?C>>>8-y:(C=C<<8|ne[x>>8&255],y<=16?C>>>16-y:(C=C<<8|ne[x>>16&255])>>>24-y)}function mt(x,y){var C=7&y,T=y>>>3;return(x[T]|(C<=6?0:x[T+1]<<8))>>>C&3}function qe(x,y){var C=7&y,T=y>>>3;return(x[T]|(C<=5?0:x[T+1]<<8))>>>C&7}function Je(x,y){var C=7&y,T=y>>>3;return(x[T]|(C<=3?0:x[T+1]<<8))>>>C&31}function _e(x,y){var C=7&y,T=y>>>3;return(x[T]|(C<=1?0:x[T+1]<<8))>>>C&127}function Vt(x,y,C){var T=7&y,F=y>>>3,V=x[F]>>>T;return C<8-T||(V|=x[F+1]<<8-T,C<16-T)||(V|=x[F+2]<<16-T,C<24-T)||(V|=x[F+3]<<24-T),V&(1<<C)-1}function ir(x,y,C){var T=7&y,F=y>>>3;return T<=5?x[F]|=(7&C)<<T:(x[F]|=C<<T&255,x[F+1]=(7&C)>>8-T),y+3}function yr(x,y,C){return x[y>>>3]|=C=(1&C)<<(7&y),y+1}function Nr(x,y,C){var F=y>>>3;return x[F]|=255&(C<<=7&y),x[F+1]=C>>>=8,y+8}function Va(x,y,C){var F=y>>>3;return x[F]|=255&(C<<=7&y),x[F+1]=255&(C>>>=8),x[F+2]=C>>>8,y+16}function ri(x,y){var C=x.length,T=2*C>y?2*C:y+5,F=0;if(C>=y)return x;if(We){var S=yc(T);if(x.copy)x.copy(S);else for(;F<x.length;++F)S[F]=x[F];return S}if(ce){var V=new Uint8Array(T);if(V.set)V.set(x);else for(;F<C;++F)V[F]=x[F];return V}return x.length=T,x}function Xn(x){for(var y=new Array(x),C=0;C<x;++C)y[C]=0;return y}function Gr(x,y,C){var T=1,F=0,S=0,V=0,Q=0,Y=x.length,U=ce?new Uint16Array(32):Xn(32);for(S=0;S<32;++S)U[S]=0;for(S=Y;S<C;++S)x[S]=0;Y=x.length;var W=ce?new Uint16Array(Y):Xn(Y);for(S=0;S<Y;++S)U[F=x[S]]++,T<F&&(T=F),W[S]=0;for(U[0]=0,S=1;S<=T;++S)U[S+16]=Q=Q+U[S-1]<<1;for(S=0;S<Y;++S)0!=(Q=x[S])&&(W[S]=U[Q+16]++);var se=0;for(S=0;S<Y;++S)if(0!=(se=x[S]))for(Q=E(W[S],T)>>T-se,V=(1<<T+4-se)-1;V>=0;--V)y[Q|V<<se]=15&se|S<<4;return T}var ii=ce?new Uint16Array(512):Xn(512),Ua=ce?new Uint16Array(32):Xn(32);if(!ce){for(var Dn=0;Dn<512;++Dn)ii[Dn]=0;for(Dn=0;Dn<32;++Dn)Ua[Dn]=0}!function(){for(var x=[],y=0;y<32;y++)x.push(5);Gr(x,Ua,32);var C=[];for(y=0;y<=143;y++)C.push(8);for(;y<=255;y++)C.push(9);for(;y<=279;y++)C.push(7);for(;y<=287;y++)C.push(8);Gr(C,ii,288)}();var Fr=function(){for(var y=ce?new Uint8Array(32768):[],C=0,T=0;C<me.length-1;++C)for(;T<me[C+1];++T)y[T]=C;for(;T<32768;++T)y[T]=29;var F=ce?new Uint8Array(259):[];for(C=0,T=0;C<Z.length-1;++C)for(;T<Z[C+1];++T)F[T]=C;return function(Y,U){return Y.length<8?function S(Q,Y){for(var U=0;U<Q.length;){var W=Math.min(65535,Q.length-U);for(Y.write_shift(1,+(U+W==Q.length)),Y.write_shift(2,W),Y.write_shift(2,65535&~W);W-- >0;)Y[Y.l++]=Q[U++]}return Y.l}(Y,U):function V(Q,Y){for(var U=0,W=0,se=ce?new Uint16Array(32768):[];W<Q.length;){var ue=Math.min(65535,Q.length-W);
1if(ue<10){for(7&(U=ir(Y,U,+(W+ue==Q.length)))&&(U+=8-(7&U)),Y.l=U/8|0,Y.write_shift(2,ue),Y.write_shift(2,65535&~ue);ue-- >0;)Y[Y.l++]=Q[W++];U=8*Y.l}else{U=ir(Y,U,+(W+ue==Q.length)+2);for(var we=0;ue-- >0;){var fe=Q[W],he=-1,Ne=0;if((he=se[we=32767&(we<<5^fe)])&&((he|=-32768&W)>W&&(he-=32768),he<W))for(;Q[he+Ne]==Q[W+Ne]&&Ne<250;)++Ne;if(Ne>2){(fe=F[Ne])<=22?U=Nr(Y,U,ne[fe+1]>>1)-1:(Nr(Y,U,3),Nr(Y,U+=5,ne[fe-23]>>5),U+=3);var St=fe<8?0:fe-4>>2;St>0&&(Va(Y,U,Ne-Z[fe]),U+=St),U=Nr(Y,U,ne[fe=y[W-he]]>>3),U-=3;var Pn=fe<4?0:fe-2>>1;Pn>0&&(Va(Y,U,W-he-me[fe]),U+=Pn);for(var Qt=0;Qt<Ne;++Qt)se[we]=32767&W,we=32767&(we<<5^Q[W]),++W;ue-=Ne-1}else fe<=143?fe+=48:U=yr(Y,U,1),U=Nr(Y,U,ne[fe]),se[we]=32767&W,++W}U=Nr(Y,U,0)-1}}return Y.l=(U+7)/8|0,Y.l}(Y,U)}}();function ze(x){var y=K(50+Math.floor(1.1*x.length)),C=Fr(x,y);return y.slice(0,C)}var Ut=ce?new Uint16Array(32768):Xn(32768),ar=ce?new Uint16Array(32768):Xn(32768),tn=ce?new Uint16Array(128):Xn(128),Ii=1,Z0=1;function oj(x,y){var C=Je(x,y)+257,T=Je(x,y+=5)+1,F=function ht(x,y){var C=7&y,T=y>>>3;return(x[T]|(C<=4?0:x[T+1]<<8))>>>C&15}(x,y+=5)+4;y+=4;for(var S=0,V=ce?new Uint8Array(19):Xn(19),Q=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],Y=1,U=ce?new Uint8Array(8):Xn(8),W=ce?new Uint8Array(8):Xn(8),se=V.length,ue=0;ue<F;++ue)V[D[ue]]=S=qe(x,y),Y<S&&(Y=S),U[S]++,y+=3;var we=0;for(U[0]=0,ue=1;ue<=Y;++ue)W[ue]=we=we+U[ue-1]<<1;for(ue=0;ue<se;++ue)0!=(we=V[ue])&&(Q[ue]=W[we]++);var fe=0;for(ue=0;ue<se;++ue)if(0!=(fe=V[ue])){we=ne[Q[ue]]>>8-fe;for(var he=(1<<7-fe)-1;he>=0;--he)tn[we|he<<fe]=7&fe|ue<<3}var Ne=[];for(Y=1;Ne.length<C+T;)switch(we=tn[_e(x,y)],y+=7&we,we>>>=3){case 16:for(S=3+mt(x,y),y+=2,we=Ne[Ne.length-1];S-- >0;)Ne.push(we);break;case 17:for(S=3+qe(x,y),y+=3;S-- >0;)Ne.push(0);break;case 18:for(S=11+_e(x,y),y+=7;S-- >0;)Ne.push(0);break;default:Ne.push(we),Y<we&&(Y=we)}var St=Ne.slice(0,C),Pn=Ne.slice(C);for(ue=C;ue<286;++ue)St[ue]=0;for(ue=T;ue<30;++ue)Pn[ue]=0;return Ii=Gr(St,Ut,286),Z0=Gr(Pn,ar,30),y}function eu(x,y){var T=function lj(x,y){if(3==x[0]&&!(3&x[1]))return[Wr(y),2];for(var C=0,T=0,F=yc(y||1<<18),S=0,V=F.length>>>0,Q=0,Y=0;!(1&T);)if(T=qe(x,C),C+=3,T>>>1)for(T>>1==1?(Q=9,Y=5):(C=oj(x,C),Q=Ii,Y=Z0);;){!y&&V<S+32767&&(V=(F=ri(F,S+32767)).length);var W=Vt(x,C,Q),se=T>>>1==1?ii[W]:Ut[W];if(C+=15&se,(se>>>=4)>>>8&255){if(256==se)break;var ue=(se-=257)<8?0:se-4>>2;ue>5&&(ue=0);var we=S+Z[se];ue>0&&(we+=Vt(x,C,ue),C+=ue),W=Vt(x,C,Y),C+=15&(se=T>>>1==1?Ua[W]:ar[W]);var fe=(se>>>=4)<4?0:se-2>>1,he=me[se];for(fe>0&&(he+=Vt(x,C,fe),C+=fe),!y&&V<we&&(V=(F=ri(F,we+100)).length);S<we;)F[S]=F[S-he],++S}else F[S++]=se}else{7&C&&(C+=8-(7&C));var U=x[C>>>3]|x[1+(C>>>3)]<<8;if(C+=32,U>0)for(!y&&V<S+U&&(V=(F=ri(F,S+U)).length);U-- >0;)F[S++]=x[C>>>3],C+=8}return y?[F,C+7>>>3]:[F.slice(0,S),C+7>>>3]}(x.slice(x.l||0),y);return x.l+=T[1],T[0]}function tu(x,y){if(!x)throw new Error(y);typeof console<"u"&&console.error(y)}function nu(x,y){var C=x;fn(C,0);var S={FileIndex:[],FullPaths:[]};w(S,{root:y.root});for(var V=C.length-4;(80!=C[V]||75!=C[V+1]||5!=C[V+2]||6!=C[V+3])&&V>=0;)--V;C.l=V+4,C.l+=4;var Q=C.read_shift(2);C.l+=6;var Y=C.read_shift(4);for(C.l=Y,V=0;V<Q;++V){C.l+=20;var U=C.read_shift(4),W=C.read_shift(4),se=C.read_shift(2),ue=C.read_shift(2),we=C.read_shift(2);C.l+=8;var fe=C.read_shift(4),he=l(C.slice(C.l+se,C.l+se+ue));C.l+=se+ue+we;var Ne=C.l;C.l=fe+4,cj(C,U,W,S,he),C.l=Ne}return S}function cj(x,y,C,T,F){x.l+=2;var S=x.read_shift(2),V=x.read_shift(2),Q=function o(x){var y=65535&x.read_shift(2),C=65535&x.read_shift(2),T=new Date,F=31&C,S=15&(C>>>=5);C>>>=4,T.setMilliseconds(0),T.setFullYear(C+1980),T.setMonth(S-1),T.setDate(F);var V=31&y,Q=63&(y>>>=5);return T.setHours(y>>>=6),T.setMinutes(Q),T.setSeconds(V<<1),T}(x);if(8257&S)throw new Error("Unsupported ZIP encryption");x.read_shift(4);for(var U=x.read_shift(4),W=x.read_shift(4),se=x.read_shift(2),ue=x.read_shift(2),we="",fe=0;fe<se;++fe)we+=String.fromCharCode(x[x.l++]);
1if(ue){var he=l(x.slice(x.l,x.l+ue));(he[21589]||{}).mt&&(Q=he[21589].mt),((F||{})[21589]||{}).mt&&(Q=F[21589].mt)}x.l+=ue;var Ne=x.slice(x.l,x.l+U);switch(V){case 8:Ne=function X(x,y){if(!te)return eu(x,y);var T=new(0,te.InflateRaw),F=T._processChunk(x.slice(x.l),T._finishFlushFlag);return x.l+=T.bytesRead,F}(x,W);break;case 0:break;default:throw new Error("Unsupported ZIP Compression method "+V)}var St=!1;8&S&&(134695760==x.read_shift(4)&&(x.read_shift(4),St=!0),U=x.read_shift(4),W=x.read_shift(4)),U!=y&&tu(St,"Bad compressed size: "+y+" != "+U),W!=C&&tu(St,"Bad uncompressed size: "+C+" != "+W),Rl(T,we,Ne,{unsafe:!0,mt:Q})}var Ws={htm:"text/html",xml:"text/xml",gif:"image/gif",jpg:"image/jpeg",png:"image/png",mso:"application/x-mso",thmx:"application/vnd.ms-officetheme",sh33tj5:"application/octet-stream"};function pj(x,y){if(x.ctype)return x.ctype;var C=x.name||"",T=C.match(/\.([^\.]+)$/);return T&&Ws[T[1]]||y&&(T=(C=y).match(/[\.\\]([^\.\\])+$/))&&Ws[T[1]]?Ws[T[1]]:"application/octet-stream"}function uj(x){for(var y=da(x),C=[],T=0;T<y.length;T+=76)C.push(y.slice(T,T+76));return C.join("\r\n")+"\r\n"}function fj(x){var y=x.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF=]/g,function(U){var W=U.charCodeAt(0).toString(16).toUpperCase();return"="+(1==W.length?"0"+W:W)});"\n"==(y=y.replace(/ $/gm,"=20").replace(/\t$/gm,"=09")).charAt(0)&&(y="=0D"+y.slice(1));for(var C=[],T=(y=y.replace(/\r(?!\n)/gm,"=0D").replace(/\n\n/gm,"\n=0A").replace(/([^\r\n])\n/gm,"$1=0A")).split("\r\n"),F=0;F<T.length;++F){var S=T[F];if(0!=S.length)for(var V=0;V<S.length;){var Q=76,Y=S.slice(V,V+Q);"="==Y.charAt(Q-1)?Q--:"="==Y.charAt(Q-2)?Q-=2:"="==Y.charAt(Q-3)&&(Q-=3),Y=S.slice(V,V+Q),(V+=Q)<S.length&&(Y+="="),C.push(Y)}else C.push("")}return C.join("\r\n")}function hj(x,y,C){for(var V,T="",F="",S="",Q=0;Q<10;++Q){var Y=y[Q];if(!Y||Y.match(/^\s*$/))break;var U=Y.match(/^(.*?):\s*([^\s].*)$/);if(U)switch(U[1].toLowerCase()){case"content-location":T=U[2].trim();break;case"content-type":S=U[2].trim();break;case"content-transfer-encoding":F=U[2].trim()}}switch(++Q,F.toLowerCase()){case"base64":V=Bn(Gn(y.slice(Q).join("")));break;case"quoted-printable":V=function mj(x){for(var y=[],C=0;C<x.length;++C){for(var T=x[C];C<=x.length&&"="==T.charAt(T.length-1);)T=T.slice(0,T.length-1)+x[++C];y.push(T)}for(var F=0;F<y.length;++F)y[F]=y[F].replace(/[=][0-9A-Fa-f]{2}/g,function(S){return String.fromCharCode(parseInt(S.slice(1),16))});return Bn(y.join("\r\n"))}(y.slice(Q));break;default:throw new Error("Unsupported Content-Transfer-Encoding "+F)}var W=Rl(x,T.slice(C.length),V,{unsafe:!0});S&&(W.ctype=S)}function Rl(x,y,C,T){var F=T&&T.unsafe;F||w(x);var S=!F&&Ee.find(x,y);if(!S){var V=x.FullPaths[0];y.slice(0,V.length)==V?V=y:("/"!=V.slice(-1)&&(V+="/"),V=(V+y).replace("//","/")),S={name:i(y),type:2},x.FileIndex.push(S),x.FullPaths.push(V),F||Ee.utils.cfb_gc(x)}return S.content=C,S.size=C?C.length:0,T&&(T.CLSID&&(S.clsid=T.CLSID),T.mt&&(S.mt=T.mt),T.ct&&(S.ct=T.ct)),S}return a.find=function z(x,y){var C=x.FullPaths.map(function(Y){return Y.toUpperCase()}),T=C.map(function(Y){var U=Y.split("/");return U[U.length-("/"==Y.slice(-1)?2:1)]}),F=!1;47===y.charCodeAt(0)?(F=!0,y=C[0].slice(0,-1)+y):F=-1!==y.indexOf("/");var S=y.toUpperCase(),V=!0===F?C.indexOf(S):T.indexOf(S);if(-1!==V)return x.FileIndex[V];var Q=!S.match(ua);for(S=S.replace(gn,""),Q&&(S=S.replace(ua,"!")),V=0;V<C.length;++V)if((Q?C[V].replace(ua,"!"):C[V]).replace(gn,"")==S||(Q?T[V].replace(ua,"!"):T[V]).replace(gn,"")==S)return x.FileIndex[V];return null},a.read=function j(x,y){var C=y&&y.type;switch(C||We&&Buffer.isBuffer(x)&&(C="buffer"),C||"base64"){case"file":return function G(x,y){return d(),p(c.readFileSync(x),y)}(x,y);case"base64":return p(Bn(Gn(x)),y);case"binary":return p(Bn(x),y)}return p(x,y)},a.parse=p,a.write=function Fe(x,y){var C=H(x,y);switch(y&&y.type||"buffer"){case"file":return d(),c.writeFileSync(y.filename,C),C;case"binary":return"string"==typeof C?C:ge(C);case"base64":return da("string"==typeof C?C:ge(C));case"buffer":if(We)return Buffer.isBuffer(C)?C:Dr(C);case"array":return"string"==typeof C?Bn(C):C}return C},a.writeFile=function He(x,y,C){d();var T=H(x,C);c.writeFileSync(y,T)},a.utils={cfb_new:function xj(x){var y={};return w(y,x),y},cfb_add:Rl,cfb_del:function vj(x,y){w(x);var C=Ee.find(x,y);if(C)for(var T=0;T<x.FileIndex.length;++T)if(x.FileIndex[T]==C)return x.FileIndex.splice(T,1),x.FullPaths.splice(T,1),!0;return!1},cfb_mov:function bj(x,y,C){w(x);var T=Ee.find(x,y);if(T)for(var F=0;F<x.FileIndex.length;++F)if(x.FileIndex[F]==T)return x.FileIndex[F].name=i(C),x.FullPaths[F]=C,!0;return!1},cfb_gc:function Cj(x){M(x,!0)},ReadShift:va,CheckField:wd,prep_blob:fn,bconcat:sn,use_zlib:function I(x){try{var C=new(0,x.InflateRaw);if(C._processChunk(new Uint8Array([3,0]),C._finishFlushFlag),!C.bytesRead)throw new Error("zlib does not expose bytesRead");te=x}catch(T){console.error("cannot use native zlib: "+(T.message||T))}},_deflateRaw:ze,_inflateRaw:eu,consts:ke},a}();function Pt(n){for(var a=Object.keys(n),t=[],r=0;r<a.length;++r)Object.prototype.hasOwnProperty.call(n,a[r])&&t.push(a[r]);return t}function _s(n){for(var a=[],t=Pt(n),r=0;r!==t.length;++r)a[n[t[r]]]=t[r];return a}var vs=new Date(1899,11,30,0,0,0);function en(n,a){var t=n.getTime();return a&&(t-=1263168e5),(t-(vs.getTime()+6e4*(n.getTimezoneOffset()-vs.getTimezoneOffset())))/864e5}var Yc=new Date,L3=vs.getTime()+6e4*(Yc.getTimezoneOffset()-vs.getTimezoneOffset()),Wc=Yc.getTimezoneOffset();function bs(n){var a=new Date;return a.setTime(24*n*60*60*1e3+L3),a.getTimezoneOffset()!==Wc&&a.setTime(a.getTime()+6e4*(a.getTimezoneOffset()-Wc)),a}function $3(n){var a=0,t=0,r=!1,i=n.match(/P([0-9\.]+Y)?([0-9\.]+M)?([0-9\.]+D)?T([0-9\.]+H)?([0-9\.]+M)?([0-9\.]+S)?/);if(!i)throw new Error("|"+n+"| is not an ISO8601 Duration");for(var s=1;s!=i.length;++s)if(i[s]){switch(t=1,s>3&&(r=!0),i[s].slice(i[s].length-1)){case"Y":throw new Error("Unsupported ISO Duration Field: "+i[s].slice(i[s].length-1));case"D":t*=24;case"H":t*=60;case"M":if(!r)throw new Error("Unsupported ISO Duration Field: M");t*=60}a+=t*parseInt(i[s],10)}return a}var Hc=new Date("2017-02-19T19:06:09.000Z"),zc=isNaN(Hc.getFullYear())?new Date("2/19/17"):Hc,V3=2017==zc.getFullYear();function Dt(n,a){var t=new Date(n);if(V3)return a>0?t.setTime(t.getTime()+60*t.getTimezoneOffset()*1e3):a<0&&t.setTime(t.getTime()-60*t.getTimezoneOffset()*1e3),t;if(n instanceof Date)return n;if(1917==zc.getFullYear()&&!isNaN(t.getFullYear())){var r=t.getFullYear();return n.indexOf(""+r)>-1||t.setFullYear(t.getFullYear()+100),t}var i=n.match(/\d+/g)||["2017","2","19","0","0","0"],s=new Date(+i[0],+i[1]-1,+i[2],+i[3]||0,+i[4]||0,+i[5]||0);return n.indexOf("Z")>-1&&(s=new Date(s.getTime()-60*s.getTimezoneOffset()*1e3)),s}function fi(n,a){if(We&&Buffer.isBuffer(n)){if(a){if(255==n[0]&&254==n[1])return br(n.slice(2).toString("utf16le"));if(254==n[1]&&255==n[2])return br(wc(n.slice(2).toString("binary")))}return n.toString("binary")}if(typeof TextDecoder<"u")try{if(a){if(255==n[0]&&254==n[1])return br(new TextDecoder("utf-16le").decode(n.slice(2)));if(254==n[0]&&255==n[1])return br(new TextDecoder("utf-16be").decode(n.slice(2)))}var t={"\u20ac":"\x80","\u201a":"\x82",\u0192:"\x83","\u201e":"\x84","\u2026":"\x85","\u2020":"\x86","\u2021":"\x87",\u02c6:"\x88","\u2030":"\x89",\u0160:"\x8a","\u2039":"\x8b",\u0152:"\x8c",\u017d:"\x8e","\u2018":"\x91","\u2019":"\x92","\u201c":"\x93","\u201d":"\x94","\u2022":"\x95","\u2013":"\x96","\u2014":"\x97","\u02dc":"\x98","\u2122":"\x99",\u0161:"\x9a","\u203a":"\x9b",\u0153:"\x9c",\u017e:"\x9e",\u0178:"\x9f"};return Array.isArray(n)&&(n=new Uint8Array(n)),new TextDecoder("latin1").decode(n).replace(/[\u20ac\u201a\u0192\u201e\u2026\u2020\u2021\u02c6\u2030\u0160\u2039\u0152\u017d\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u02dc\u2122\u0161\u203a\u0153\u017e\u0178]/g,function(s){return t[s]||s})}catch{}for(var r=[],i=0;i!=n.length;++i)r.push(String.fromCharCode(n[i]));return r.join("")}function xt(n){if(typeof JSON<"u"&&!Array.isArray(n))return JSON.parse(JSON.stringify(n));if("object"!=typeof n||null==n)return n;if(n instanceof Date)return new Date(n.getTime());var a={};for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(a[t]=xt(n[t]));return a}function Ot(n,a){for(var t="";t.length<a;)t+=n;return t}function dr(n){var a=Number(n);if(!isNaN(a))return isFinite(a)?a:NaN;if(!/\d/.test(n))return a;var t=1,r=n.replace(/([\d]),([\d])/g,"$1$2").replace(/[$]/g,"").replace(/[%]/g,function(){return t*=100,""});return isNaN(a=Number(r))&&(r=r.replace(/[(](.*)[)]/,function(i,s){return t=-t,s}),isNaN(a=Number(r)))?a:a/t}var U3=["january","february","march","april","may","june","july","august","september","october","november","december"];function Gi(n){var a=new Date(n),t=new Date(NaN),r=a.getYear(),i=a.getMonth(),s=a.getDate();if(isNaN(s))return t;var o=n.toLowerCase();if(o.match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)){if((o=o.replace(/[^a-z]/g,"").replace(/([^a-z]|^)[ap]m?([^a-z]|$)/,"")).length>3&&-1==U3.indexOf(o))return t}else if(o.match(/[a-z]/))return t;return r<0||r>8099?t:(i>0||s>1)&&101!=r?a:n.match(/[^-0-9:,\/\\]/)?t:a}var X3=function(){var n=5=="abacaba".split(/(:?b)/i).length;return function(t,r,i){if(n||"string"==typeof r)return t.split(r);for(var s=t.split(r),o=[s[0]],l=1;l<s.length;++l)o.push(i),o.push(s[l]);return o}}();function qc(n){return n?n.content&&n.type?fi(n.content,!0):n.data?Mi(n.data):n.asNodeBuffer&&We?Mi(n.asNodeBuffer().toString("binary")):n.asBinary?Mi(n.asBinary()):n._data&&n._data.getContent?Mi(fi(Array.prototype.slice.call(n._data.getContent(),0))):null:null}
1function Jc(n){if(!n)return null;if(n.data)return fs(n.data);if(n.asNodeBuffer&&We)return n.asNodeBuffer();if(n._data&&n._data.getContent){var a=n._data.getContent();return"string"==typeof a?fs(a):Array.prototype.slice.call(a)}return n.content&&n.type?n.content:null}function Kn(n,a){for(var t=n.FullPaths||Pt(n.files),r=a.toLowerCase().replace(/[\/]/g,"\\"),i=r.replace(/\\/g,"/"),s=0;s<t.length;++s){var o=t[s].replace(/^Root Entry[\/]/,"").toLowerCase();if(r==o||i==o)return n.files?n.files[t[s]]:n.FileIndex[s]}return null}function _o(n,a){var t=Kn(n,a);if(null==t)throw new Error("Cannot find file "+a+" in zip");return t}function Ht(n,a,t){if(!t)return function Y3(n){return n&&".bin"===n.name.slice(-4)?Jc(n):qc(n)}(_o(n,a));if(!a)return null;try{return Ht(n,a)}catch{return null}}function $n(n,a,t){if(!t)return qc(_o(n,a));if(!a)return null;try{return $n(n,a)}catch{return null}}function Kc(n,a,t){if(!t)return Jc(_o(n,a));if(!a)return null;try{return Kc(n,a)}catch{return null}}function Qc(n){for(var a=n.FullPaths||Pt(n.files),t=[],r=0;r<a.length;++r)"/"!=a[r].slice(-1)&&t.push(a[r].replace(/^Root Entry[\/]/,""));return t.sort()}function Zc(n,a){switch(a.type){case"base64":return Ee.read(n,{type:"base64"});case"binary":return Ee.read(n,{type:"binary"});case"buffer":case"array":return Ee.read(n,{type:"buffer"})}throw new Error("Unrecognized type "+a.type)}function ga(n,a){if("/"==n.charAt(0))return n.slice(1);var t=a.split("/");"/"!=a.slice(-1)&&t.pop();for(var r=n.split("/");0!==r.length;){var i=r.shift();".."===i?t.pop():"."!==i&&t.push(i)}return t.join("/")}var zt='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n',W3=/([^"\s?>\/]+)\s*=\s*((?:")([^"]*)(?:")|(?:')([^']*)(?:')|([^'">\s]+))/g,ed=/<[\/\?]?[a-zA-Z0-9:_-]+(?:\s+[^"\s?>\/]+\s*=\s*(?:"[^"]*"|'[^']*'|[^'">\s=]+))*\s*[\/\?]?>/gm,_n=zt.match(ed)?ed:/<[^>]*>/g,z3=/<\w*:/,q3=/<(\/?)\w+:/;function Me(n,a,t){for(var r={},i=0,s=0;i!==n.length&&32!==(s=n.charCodeAt(i))&&10!==s&&13!==s;++i);if(a||(r[0]=n.slice(0,i)),i===n.length)return r;var o=n.match(W3),l=0,c="",d=0,p="",u="",f=1;if(o)for(d=0;d!=o.length;++d){for(u=o[d],s=0;s!=u.length&&61!==u.charCodeAt(s);++s);for(p=u.slice(0,s).trim();32==u.charCodeAt(s+1);)++s;for(f=34==(i=u.charCodeAt(s+1))||39==i?1:0,c=u.slice(s+1+f,u.length-f),l=0;l!=p.length&&58!==p.charCodeAt(l);++l);if(l===p.length)p.indexOf("_")>0&&(p=p.slice(0,p.indexOf("_"))),r[p]=c,t||(r[p.toLowerCase()]=c);else{var h=(5===l&&"xmlns"===p.slice(0,5)?"xmlns":"")+p.slice(l+1);if(r[h]&&"ext"==p.slice(l-3,l))continue;r[h]=c,t||(r[h.toLowerCase()]=c)}}return r}function vr(n){return n.replace(q3,"<$1")}var td={""":'"',"'":"'",">":">","<":"<","&":"&"},vo=_s(td),tt=function(){var n=/&(?:quot|apos|gt|lt|amp|#x?([\da-fA-F]+));/gi,a=/_x([\da-fA-F]{4})_/gi;return function t(r){var i=r+"",s=i.indexOf("<![CDATA[");if(-1==s)return i.replace(n,function(l,c){return td[l]||String.fromCharCode(parseInt(c,l.indexOf("x")>-1?16:10))||l}).replace(a,function(l,c){return String.fromCharCode(parseInt(c,16))});var o=i.indexOf("]]>");return t(i.slice(0,s))+i.slice(s+9,o)+t(i.slice(o+3))}}(),bo=/[&<>'"]/g,rd=/[\u0000-\u001f]/g;function Co(n){return(n+"").replace(bo,function(t){return vo[t]}).replace(/\n/g,"<br/>").replace(rd,function(t){return"&#x"+("000"+t.charCodeAt(0).toString(16)).slice(-4)+";"})}var id=function(){var n=/&#(\d+);/g;function a(t,r){return String.fromCharCode(parseInt(r,10))}return function(r){return r.replace(n,a)}}();function yt(n){switch(n){case 1:case!0:case"1":case"true":case"TRUE":return!0;default:return!1}}function ko(n){for(var a="",t=0,r=0,i=0,s=0,o=0,l=0;t<n.length;)(r=n.charCodeAt(t++))<128?a+=String.fromCharCode(r):(i=n.charCodeAt(t++),r>191&&r<224?(o=(31&r)<<6,o|=63&i,a+=String.fromCharCode(o)):(s=n.charCodeAt(t++),r<240?a+=String.fromCharCode((15&r)<<12|(63&i)<<6|63&s):(l=((7&r)<<18|(63&i)<<12|(63&s)<<6|63&(o=n.charCodeAt(t++)))-65536,a+=String.fromCharCode(55296+(l>>>10&1023)),a+=String.fromCharCode(56320+(1023&l)))));return a}function ad(n){var t,r,l,a=Wr(2*n.length),i=1,s=0,o=0;for(r=0;r<n.length;r+=i)i=1,(l=n.charCodeAt(r))<128?t=l:l<224?(t=64*(31&l)+(63&n.charCo
1deAt(r+1)),i=2):l<240?(t=4096*(15&l)+64*(63&n.charCodeAt(r+1))+(63&n.charCodeAt(r+2)),i=3):(i=4,t=262144*(7&l)+4096*(63&n.charCodeAt(r+1))+64*(63&n.charCodeAt(r+2))+(63&n.charCodeAt(r+3)),o=55296+((t-=65536)>>>10&1023),t=56320+(1023&t)),0!==o&&(a[s++]=255&o,a[s++]=o>>>8,o=0),a[s++]=t%256,a[s++]=t>>>8;return a.slice(0,s).toString("ucs2")}function sd(n){return Dr(n,"binary").toString("utf8")}var Cs="foo bar baz\xe2\x98\x83\xf0\x9f\x8d\xa3",gt=We&&(sd(Cs)==ko(Cs)&&sd||ad(Cs)==ko(Cs)&&ad)||ko,br=We?function(n){return Dr(n,"utf8").toString("binary")}:function(n){for(var a=[],t=0,r=0,i=0;t<n.length;)switch(r=n.charCodeAt(t++),!0){case r<128:a.push(String.fromCharCode(r));break;case r<2048:a.push(String.fromCharCode(192+(r>>6))),a.push(String.fromCharCode(128+(63&r)));break;case r>=55296&&r<57344:r-=55296,i=n.charCodeAt(t++)-56320+(r<<10),a.push(String.fromCharCode(240+(i>>18&7))),a.push(String.fromCharCode(144+(i>>12&63))),a.push(String.fromCharCode(128+(i>>6&63))),a.push(String.fromCharCode(128+(63&i)));break;default:a.push(String.fromCharCode(224+(r>>12))),a.push(String.fromCharCode(128+(r>>6&63))),a.push(String.fromCharCode(128+(63&r)))}return a.join("")},_a=function(){var n={};return function(t,r){var i=t+"|"+(r||"");return n[i]?n[i]:n[i]=new RegExp("<(?:\\w+:)?"+t+'(?: xml:space="preserve")?(?:[^>]*)>([\\s\\S]*?)</(?:\\w+:)?'+t+">",r||"")}}(),od=function(){var n=[["nbsp"," "],["middot","\xb7"],["quot",'"'],["apos","'"],["gt",">"],["lt","<"],["amp","&"]].map(function(a){return[new RegExp("&"+a[0]+";","ig"),a[1]]});return function(t){for(var r=t.replace(/^[\t\n\r ]+/,"").replace(/[\t\n\r ]+$/,"").replace(/>\s+/g,">").replace(/\s+</g,"<").replace(/[\t\n\r ]+/g," ").replace(/<\s*[bB][rR]\s*\/?>/g,"\n").replace(/<[^>]*>/g,""),i=0;i<n.length;++i)r=r.replace(n[i][0],n[i][1]);return r}}(),Z3=function(){var n={};return function(t){return void 0!==n[t]?n[t]:n[t]=new RegExp("<(?:vt:)?"+t+">([\\s\\S]*?)</(?:vt:)?"+t+">","g")}}(),eT=/<\/?(?:vt:)?variant>/g,tT=/<(?:vt:)([^>]*)>([\s\S]*)</;function ld(n,a){var t=Me(n),r=n.match(Z3(t.baseType))||[],i=[];if(r.length!=t.size){if(a.WTF)throw new Error("unexpected vector length "+r.length+" != "+t.size);return i}return r.forEach(function(s){var o=s.replace(eT,"").match(tT);o&&i.push({v:gt(o[2]),t:o[1]})}),i}var cd=/(^\s|\s$|\n)/;function de(n,a,t){return"<"+n+(null!=t?function dd(n){return Pt(n).map(function(a){return" "+a+'="'+n[a]+'"'}).join("")}(t):"")+(null!=a?(a.match(cd)?' xml:space="preserve"':"")+">"+a+"</"+n:"/")+">"}function wo(n){if(We&&Buffer.isBuffer(n))return n.toString("utf8");if("string"==typeof n)return n;if(typeof Uint8Array<"u"&&n instanceof Uint8Array)return gt(Hr(fo(n)));throw new Error("Bad input format: expected Buffer or string")}var xa=/<(\/?)([^\s?><!\/:]*:|)([^\s?<>:\/]+)(?:[\s?:\/][^>]*)?>/gm,Kr=["http://schemas.openxmlformats.org/spreadsheetml/2006/main","http://purl.oclc.org/ooxml/spreadsheetml/main","http://schemas.microsoft.com/office/excel/2006/main","http://schemas.microsoft.com/office/excel/2006/2"],pd=function(n){for(var a=[],r=0;r<n[0].length;++r)if(n[0][r])for(var i=0,s=n[0][r].length;i<s;i+=10240)a.push.apply(a,n[0][r].slice(i,i+10240));return a},ud=We?function(n){return n[0].length>0&&Buffer.isBuffer(n[0][0])?Buffer.concat(n[0].map(function(a){return Buffer.isBuffer(a)?a:Dr(a)})):pd(n)}:pd,fd=function(n,a,t){for(var r=[],i=a;i<t;i+=2)r.push(String.fromCharCode(jr(n,i)));return r.join("").replace(gn,"")},ks=We?function(n,a,t){return Buffer.isBuffer(n)?n.toString("utf16le",a,t).replace(gn,""):fd(n,a,t)}:fd,md=function(n,a,t){for(var r=[],i=a;i<a+t;++i)r.push(("0"+n[i].toString(16)).slice(-2));return r.join("")},hd=We?function(n,a,t){return Buffer.isBuffer(n)?n.toString("hex",a,a+t):md(n,a,t)}:md,gd=function(n,a,t){for(var r=[],i=a;i<t;i++)r.push(String.fromCharCode(Li(n,i)));return r.join("")},Bi=We?function(a,t,r){return Buffer.isBuffer(a)?a.toString("utf8",t,r):gd(a,t,r)}:gd,_d=function(n,a){var t=on(n,a);return t>0?Bi(n,a+4,a+4+t-1):""},yo=_d,xd=function(n,a){var t=on(n,a);return t>0?Bi(n,a+4,a+4+t-1):""},Fo=xd,vd=function(n,a){var t=2*on(n,a);return t>0?Bi(n,a+4,a+4+t-1):""},So=vd,bd=function(a,t){var r=on(a,t);return r>0?ks(a,t+4,t+4+r):""},Eo=bd,Cd=function(n,a){var t=on(n,a);return t>0?Bi(n,a+4,a+4+t):""},Io=Cd,kd=function(n,a){return function rT(n,a){for(var t=1-2*(n[a+7]>>>7),r=((127&n[a+7])<<4)+(n[a+6]>>>4&15),i=15&n[a+6],s=5;s>=0;--s)i=256*i+n[a+s];return 2047==r?0==i?t*(1/0):NaN:(0==r?r=-1022:(r-=1023,i+=Math.pow(2,52)),t*Math.pow(2,r-52)*i)}(n,a)},Ts=kd,Do=function(a){return Array.isArray(a)||typeof Uint8Array<"u"&&a instanceof Uint8Array};We&&(yo=function(a,t){if(!Buffer.isBuffer(a))return _d(a,t);var r=a.readUInt32LE(t);return r>0?a.toString("utf8",t+4,t+4+r-1):""},Fo=function(a,t){if(!Buffer.isBuffer(a))return xd(a,t);var r=a.readUInt32LE(t);return r>0?a.toString("utf8",t+4,t+4+r-1):""},So=function(a,t){if(!Buffer.isBuffer(a))return vd(a,t);var r=2*a.readUInt32LE(t);return a.toString("utf16le",t+4,t+4+r-1)},Eo=function(a,t){if(!Buffer.isBuffer(a))return bd(a,t);var r=a.readUInt32LE(t);return a.toString("utf16le",t+4,t+4+r)},Io=function(a,t){if(!Buffer.isBuffer(a))return Cd(a,t);var r=a.readUInt32LE(t);return a.toString("utf8",t+4,t+4+r)},Ts=function(a,t){return Buffer.isBuffer(a)?a.readDoubleLE(t):kd(a,t)},Do=function(a){return Buffer.isBuffer(a)||Array.isArray(a)||typeof Uint8Array<"u"&&a instanceof Uint8Array});var Li=function(n,a){return n[a]},jr=function(n,a){return 256*n[a+1]+n[a]},aT=function(n,a){var t=256*n[a+1]+n[a];return t<32768?t:-1*(65535-t+1)},on=function(n,a){return n[a+3]*(1<<24)+(n[a+2]<<16)+(n[a+1]<<8)+n[a]},mi=function(n,a){return n[a+3]<<24|n[a+2]<<16|n[a+1]<<8|n[a]},sT=function(n,a){return n[a]<<24|n[a+1]<<16|n[a+2]<<8|n[a+3]};function va(n,a){var r,i,o,l,c,d,t="",s=[];switch(a){case"dbcs":if(d=this.l,We&&Buffer.isBuffer(this))t=this.slice(this.l,this.l+2*n).toString("utf16le");else for(c=0;c<n;++c)t+=String.fromCharCode(jr(this,d)),d+=2;n*=2;break;case"utf8":t=Bi(this,this.l,this.l+n);break;case"utf16le":t=ks(this,this.l,this.l+(n*=2));break;case"wstr":return va.call(this,n,"dbcs");case"lpstr-ansi":t=yo(this,this.l),n=4+on(this,this.l);break;case"lpstr-cp":t=Fo(this,this.l),n=4+on(this,this.l);break;case"lpwstr":t=So(this,this.l),n=4+2*on(this,this.l);break;
1case"lpp4":n=4+on(this,this.l),t=Eo(this,this.l),2&n&&(n+=2);break;case"8lpp4":n=4+on(this,this.l),t=Io(this,this.l),3&n&&(n+=4-(3&n));break;case"cstr":for(n=0,t="";0!==(o=Li(this,this.l+n++));)s.push(la(o));t=s.join("");break;case"_wstr":for(n=0,t="";0!==(o=jr(this,this.l+n));)s.push(la(o)),n+=2;n+=2,t=s.join("");break;case"dbcs-cont":for(t="",d=this.l,c=0;c<n;++c){if(this.lens&&-1!==this.lens.indexOf(d))return o=Li(this,d),this.l=d+1,l=va.call(this,n-c,o?"dbcs-cont":"sbcs-cont"),s.join("")+l;s.push(la(jr(this,d))),d+=2}t=s.join(""),n*=2;break;case"cpstr":0;case"sbcs-cont":for(t="",d=this.l,c=0;c!=n;++c){if(this.lens&&-1!==this.lens.indexOf(d))return o=Li(this,d),this.l=d+1,l=va.call(this,n-c,o?"dbcs-cont":"sbcs-cont"),s.join("")+l;s.push(la(Li(this,d))),d+=1}t=s.join("");break;default:switch(n){case 1:return r=Li(this,this.l),this.l++,r;case 2:return r=("i"===a?aT:jr)(this,this.l),this.l+=2,r;case 4:case-4:return"i"!==a&&128&this[this.l+3]?(i=on(this,this.l),this.l+=4,i):(r=(n>0?mi:sT)(this,this.l),this.l+=4,r);case 8:case-8:if("f"===a)return i=8==n?Ts(this,this.l):Ts([this[this.l+7],this[this.l+6],this[this.l+5],this[this.l+4],this[this.l+3],this[this.l+2],this[this.l+1],this[this.l+0]],0),this.l+=8,i;n=8;case 16:t=hd(this,this.l,n)}}return this.l+=n,t}var oT=function(n,a,t){n[t]=255&a,n[t+1]=a>>>8&255,n[t+2]=a>>>16&255,n[t+3]=a>>>24&255},lT=function(n,a,t){n[t]=255&a,n[t+1]=a>>8&255,n[t+2]=a>>16&255,n[t+3]=a>>24&255},cT=function(n,a,t){n[t]=255&a,n[t+1]=a>>>8&255};function dT(n,a,t){var r=0,i=0;if("dbcs"===t){for(i=0;i!=a.length;++i)cT(this,a.charCodeAt(i),this.l+2*i);r=2*a.length}else if("sbcs"===t){for(a=a.replace(/[^\x00-\x7F]/g,"_"),i=0;i!=a.length;++i)this[this.l+i]=255&a.charCodeAt(i);r=a.length}else{if("hex"===t){for(;i<n;++i)this[this.l++]=parseInt(a.slice(2*i,2*i+2),16)||0;return this}if("utf16le"===t){var o=Math.min(this.l+n,this.length);for(i=0;i<Math.min(a.length,n);++i){var l=a.charCodeAt(i);this[this.l++]=255&l,this[this.l++]=l>>8}for(;this.l<o;)this[this.l++]=0;return this}switch(n){case 1:r=1,this[this.l]=255&a;break;case 2:r=2,this[this.l]=255&a,this[this.l+1]=255&(a>>>=8);break;case 3:r=3,this[this.l]=255&a,this[this.l+1]=255&(a>>>=8),this[this.l+2]=255&(a>>>=8);break;case 4:r=4,oT(this,a,this.l);break;case 8:if(r=8,"f"===t){!function iT(n,a,t){var r=(a<0||1/a==-1/0?1:0)<<7,i=0,s=0,o=r?-a:a;isFinite(o)?0==o?i=s=0:(i=Math.floor(Math.log(o)/Math.LN2),s=o*Math.pow(2,52-i),i<=-1023&&(!isFinite(s)||s<Math.pow(2,52))?i=-1022:(s-=Math.pow(2,52),i+=1023)):(i=2047,s=isNaN(a)?26985:0);for(var l=0;l<=5;++l,s/=256)n[t+l]=255&s;n[t+6]=(15&i)<<4|15&s,n[t+7]=i>>4|r}(this,a,this.l);break}case 16:break;case-4:r=4,lT(this,a,this.l)}}return this.l+=r,this}function wd(n,a){var t=hd(this,this.l,n.length>>1);if(t!==n)throw new Error(a+"Expected "+n+" saw "+t);this.l+=n.length>>1}function fn(n,a){n.l=a,n.read_shift=va,n.chk=wd,n.write_shift=dT}function xn(n,a){n.l+=a}function K(n){var a=Wr(n);return fn(a,0),a}function Ar(n,a,t){if(n){var r,i,s;fn(n,n.l||0);for(var o=n.length,l=0,c=0;n.l<o;){128&(l=n.read_shift(1))&&(l=(127&l)+((127&n.read_shift(1))<<7));var d=Ga[l]||Ga[65535];for(s=127&(r=n.read_shift(1)),i=1;i<4&&128&r;++i)s+=(127&(r=n.read_shift(1)))<<7*i;c=n.l+s;var p=d.f&&d.f(n,s,t);if(n.l=c,a(p,d,l))return}}}function En(){var n=[],a=We?256:2048,t=function(d){var p=K(d);return fn(p,0),p},r=t(a),i=function(){r&&(r.length>r.l&&((r=r.slice(0,r.l)).l=r.length),r.length>0&&n.push(r),r=null)},s=function(d){return r&&d<r.length-r.l?r:(i(),r=t(Math.max(d+1,a)))};return{next:s,push:function(d){i(),null==(r=d).l&&(r.l=r.length),s(a)},end:function(){return i(),sn(n)},_bufs:n}}function ba(n,a,t){var r=xt(n);if(a.s?(r.cRel&&(r.c+=a.s.c),r.rRel&&(r.r+=a.s.r)):(r.cRel&&(r.c+=a.c),r.rRel&&(r.r+=a.r)),!t||t.biff<12){for(;r.c>=256;)r.c-=256;for(;r.r>=65536;)r.r-=65536}return r}function yd(n,a,t){var r=xt(n);return r.s=ba(r.s,a.s,t),r.e=ba(r.e,a.s,t),r}function Ca(n,a){if(n.cRel&&n.c<0)for(n=xt(n);n.c<0;)n.c+=a>8?16384:256;if(n.rRel&&n.r<0)for(n=xt(n);n.r<0;)n.r+=a>8?1048576:a>5?65536:16384;var t=Pe(n);return!n.cRel&&null!=n.cRel&&(t=function fT(n){return n.replace(/^([A-Z])/,"$$$1")}
1(t)),!n.rRel&&null!=n.rRel&&(t=function pT(n){return n.replace(/([A-Z]|^)(\d+)$/,"$1$$$2")}(t)),t}function Ro(n,a){return 0!=n.s.r||n.s.rRel||n.e.r!=(a.biff>=12?1048575:a.biff>=8?65536:16384)||n.e.rRel?0!=n.s.c||n.s.cRel||n.e.c!=(a.biff>=12?16383:255)||n.e.cRel?Ca(n.s,a.biff)+":"+Ca(n.e,a.biff):(n.s.rRel?"":"$")+Nt(n.s.r)+":"+(n.e.rRel?"":"$")+Nt(n.e.r):(n.s.cRel?"":"$")+Ft(n.s.c)+":"+(n.e.cRel?"":"$")+Ft(n.e.c)}function jo(n){return parseInt(function uT(n){return n.replace(/\$(\d+)$/,"$1")}(n),10)-1}function Nt(n){return""+(n+1)}function Ao(n){for(var a=function mT(n){return n.replace(/^\$([A-Z])/,"$1")}(n),t=0,r=0;r!==a.length;++r)t=26*t+a.charCodeAt(r)-64;return t-1}function Ft(n){if(n<0)throw new Error("invalid column "+n);var a="";for(++n;n;n=Math.floor((n-1)/26))a=String.fromCharCode((n-1)%26+65)+a;return a}function Rt(n){for(var a=0,t=0,r=0;r<n.length;++r){var i=n.charCodeAt(r);i>=48&&i<=57?a=10*a+(i-48):i>=65&&i<=90&&(t=26*t+(i-64))}return{c:t-1,r:a-1}}function Pe(n){for(var a=n.c+1,t="";a;a=(a-1)/26|0)t=String.fromCharCode((a-1)%26+65)+t;return t+(n.r+1)}function Un(n){var a=n.indexOf(":");return-1==a?{s:Rt(n),e:Rt(n)}:{s:Rt(n.slice(0,a)),e:Rt(n.slice(a+1))}}function Ge(n,a){return typeof a>"u"||"number"==typeof a?Ge(n.s,n.e):("string"!=typeof n&&(n=Pe(n)),"string"!=typeof a&&(a=Pe(a)),n==a?n:n+":"+a)}function Ke(n){var a={s:{c:0,r:0},e:{c:0,r:0}},t=0,r=0,i=0,s=n.length;for(t=0;r<s&&!((i=n.charCodeAt(r)-64)<1||i>26);++r)t=26*t+i;for(a.s.c=--t,t=0;r<s&&!((i=n.charCodeAt(r)-48)<0||i>9);++r)t=10*t+i;if(a.s.r=--t,r===s||10!=i)return a.e.c=a.s.c,a.e.r=a.s.r,a;for(++r,t=0;r!=s&&!((i=n.charCodeAt(r)-64)<1||i>26);++r)t=26*t+i;for(a.e.c=--t,t=0;r!=s&&!((i=n.charCodeAt(r)-48)<0||i>9);++r)t=10*t+i;return a.e.r=--t,a}function Cr(n,a,t){return null==n||null==n.t||"z"==n.t?"":void 0!==n.w?n.w:("d"==n.t&&!n.z&&t&&t.dateNF&&(n.z=t.dateNF),"e"==n.t?Mr[n.v]||n.v:function Fd(n,a){var t="d"==n.t&&a instanceof Date;if(null!=n.z)try{return n.w=Ln(n.z,t?en(a):a)}catch{}try{return n.w=Ln((n.XF||{}).numFmtId||(t?14:0),t?en(a):a)}catch{return""+a}}(n,null==a?n.v:a))}function Qr(n,a){var t=a&&a.sheet?a.sheet:"Sheet1",r={};return r[t]=n,{SheetNames:[t],Sheets:r}}function Sd(n,a,t){var r=t||{},i=n?Array.isArray(n):r.dense,s=n||(i?[]:{}),o=0,l=0;if(s&&null!=r.origin){if("number"==typeof r.origin)o=r.origin;else{var c="string"==typeof r.origin?Rt(r.origin):r.origin;o=c.r,l=c.c}s["!ref"]||(s["!ref"]="A1:A1")}var d={s:{c:1e7,r:1e7},e:{c:0,r:0}};if(s["!ref"]){var p=Ke(s["!ref"]);d.s.c=p.s.c,d.s.r=p.s.r,d.e.c=Math.max(d.e.c,p.e.c),d.e.r=Math.max(d.e.r,p.e.r),-1==o&&(d.e.r=o=p.e.r+1)}for(var u=0;u!=a.length;++u)if(a[u]){if(!Array.isArray(a[u]))throw new Error("aoa_to_sheet expects an array of arrays");for(var f=0;f!=a[u].length;++f)if(!(typeof a[u][f]>"u")){var h={v:a[u][f]},g=o+u,m=l+f;if(d.s.r>g&&(d.s.r=g),d.s.c>m&&(d.s.c=m),d.e.r<g&&(d.e.r=g),d.e.c<m&&(d.e.c=m),!a[u][f]||"object"!=typeof a[u][f]||Array.isArray(a[u][f])||a[u][f]instanceof Date)if(Array.isArray(h.v)&&(h.f=a[u][f][1],h.v=h.v[0]),null===h.v)if(h.f)h.t="n";else if(r.nullError)h.t="e",h.v=0;else{if(!r.sheetStubs)continue;h.t="z"}else"number"==typeof h.v?h.t="n":"boolean"==typeof h.v?h.t="b":h.v instanceof Date?(h.z=r.dateNF||Re[14],r.cellDates?(h.t="d",h.w=Ln(h.z,en(h.v))):(h.t="n",h.v=en(h.v),h.w=Ln(h.z,h.v))):h.t="s";else h=a[u][f];if(i)s[g]||(s[g]=[]),s[g][m]&&s[g][m].z&&(h.z=s[g][m].z),s[g][m]=h;else{var _=Pe({c:m,r:g});s[_]&&s[_].z&&(h.z=s[_].z),s[_]=h}}}return d.s.c<1e7&&(s["!ref"]=Ge(d)),s}function $i(n,a){return Sd(null,n,a)}function vn(n){var a=n.read_shift(4);return 0===a?"":n.read_shift(a,"dbcs")}function _T(n){return{ich:n.read_shift(2),ifnt:n.read_shift(2)}}function Mo(n,a){var t=n.l,r=n.read_shift(1),i=vn(n),s=[],o={t:i,h:i};if(1&r){for(var l=n.read_shift(4),c=0;c!=l;++c)s.push(_T(n));o.r=s}else o.r=[{ich:0,ifnt:0}];return n.l=t+a,o}var vT=Mo;function Qn(n){var a=n.read_shift(4),t=n.read_shift(2);return t+=n.read_shift(1)<<16,n.l++,{c:a,iStyleRef:t}}function gi(n){var a=n.read_shift(2);return a+=n.read_shift(1)<<16,n.l++,{c:-1,iStyleRef:a}}var CT=vn;function Po(n){var a=n.read_shift(4);return 0===a||4294967295===a?"":n.read_shift(a,"dbcs")}var kT=vn,No=Po;function Bo(n){var a=n.slice(n.l,n.l+4),t=1&a[0],r=2&a[0];n.l+=4;var i=0===r?Ts([0,0,0,0,252&a[0],a[1],a[2],a[3]],0):mi(a,0)>>2;return t?i/100:i}function Dd(n){var a={s:{},e:{}};return a.s.r=n.read_shift(4),a.e.r=n.read_shift(4),a.s.c=n.read_shift(4),a.e.c=n.read_shift(4),a}var xi=Dd;function bn(n){if(n.length-n.l<8)throw"XLS Xnum Buffer underflow";return n.read_shift(8,"f")}function Rd(n,a){var r=n.read_shift(4);switch(r){case 0:return"";case 4294967295:case 4294967294:return{2:"BITMAP",3:"METAFILEPICT",8:"DIB",14:"ENHMETAFILE"}[n.read_shift(4)]||""}if(r>400)throw new Error("Unsupported Clipboard: "+r.toString(16));return n.l-=4,n.read_shift(0,1==a?"lpstr":"lpwstr")}var jT=[80,81],$o={1:{n:"CodePage",t:2},2:{n:"Category",t:80},3:{n:"PresentationFormat",t:80},4:{n:"ByteCount",t:3},5:{n:"LineCount",t:3},6:{n:"ParagraphCount",t:3},7:{n:"SlideCount",t:3},8:{n:"NoteCount",t:3},9:{n:"HiddenCount",t:3},10:{n:"MultimediaClipCount",t:3},11:{n:"ScaleCrop",t:11},12:{n:"HeadingPairs",t:4108},13:{n:"TitlesOfParts",t:4126},14:{n:"Manager",t:80},15:{n:"Company",t:80},16:{n:"LinksUpToDate",t:11},17:{n:"CharacterCount",t:3},19:{n:"SharedDoc",t:11},22:{n:"HyperlinksChanged",t:11},23:{n:"AppVersion",t:3,p:"version"},24:{n:"DigSig",t:65},26:{n:"ContentType",t:80},27:{n:"ContentStatus",t:80},28:{n:"Language",t:80},29:{n:"Version",t:80},255:{},2147483648:{n:"Locale",t:19},2147483651:{n:"Behavior",t:19},1919054434:{}},Vo={1:{n:"CodePage",t:2},2:{n:"Title",t:80},3:{n:"Subject",t:80},4:{n:"Author",t:80},5:{n:"Keywords",t:80},6:{n:"Comments",t:80},7:{n:"Template",t:80},8:{n:"LastAuthor",t:80},9:{n:"RevNumber",t:80}
1,10:{n:"EditTime",t:64},11:{n:"LastPrinted",t:64},12:{n:"CreatedDate",t:64},13:{n:"ModifiedDate",t:64},14:{n:"PageCount",t:3},15:{n:"WordCount",t:3},16:{n:"CharCount",t:3},17:{n:"Thumbnail",t:71},18:{n:"Application",t:80},19:{n:"DocSecurity",t:3},255:{},2147483648:{n:"Locale",t:19},2147483651:{n:"Behavior",t:19},1919054434:{}},Md={1:"US",2:"CA",3:"",7:"RU",20:"EG",30:"GR",31:"NL",32:"BE",33:"FR",34:"ES",36:"HU",39:"IT",41:"CH",43:"AT",44:"GB",45:"DK",46:"SE",47:"NO",48:"PL",49:"DE",52:"MX",55:"BR",61:"AU",64:"NZ",66:"TH",81:"JP",82:"KR",84:"VN",86:"CN",90:"TR",105:"JS",213:"DZ",216:"MA",218:"LY",351:"PT",354:"IS",358:"FI",420:"CZ",886:"TW",961:"LB",962:"JO",963:"SY",964:"IQ",965:"KW",966:"SA",971:"AE",972:"IL",974:"QA",981:"IR",65535:"US"},AT=[null,"solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"];function MT(n){return n.map(function(a){return[a>>16&255,a>>8&255,255&a]})}var bi=xt(MT([0,16777215,16711680,65280,255,16776960,16711935,65535,0,16777215,16711680,65280,255,16776960,16711935,65535,8388608,32768,128,8421376,8388736,32896,12632256,8421504,10066431,10040166,16777164,13434879,6684774,16744576,26316,13421823,128,16711935,16776960,65535,8388736,8388608,32896,255,52479,13434879,13434828,16777113,10079487,16751052,13408767,16764057,3368703,3394764,10079232,16763904,16750848,16737792,6710937,9868950,13158,3381606,13056,3355392,10040064,10040166,3355545,3355443,16777215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),Mr={0:"#NULL!",7:"#DIV/0!",15:"#VALUE!",23:"#REF!",29:"#NAME?",36:"#NUM!",42:"#N/A",43:"#GETTING_DATA",255:"#WTF?"},Pd={"#NULL!":0,"#DIV/0!":7,"#VALUE!":15,"#REF!":23,"#NAME?":29,"#NUM!":36,"#N/A":42,"#GETTING_DATA":43,"#WTF?":255},Uo={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":"workbooks","application/vnd.ms-excel.sheet.macroEnabled.main+xml":"workbooks","application/vnd.ms-excel.sheet.binary.macroEnabled.main":"workbooks","application/vnd.ms-excel.addin.macroEnabled.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":"sheets","application/vnd.ms-excel.worksheet":"sheets","application/vnd.ms-excel.binIndexWs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":"charts","application/vnd.ms-excel.chartsheet":"charts","application/vnd.ms-excel.macrosheet+xml":"macros","application/vnd.ms-excel.macrosheet":"macros","application/vnd.ms-excel.intlmacrosheet":"TODO","application/vnd.ms-excel.binIndexMs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":"dialogs","application/vnd.ms-excel.dialogsheet":"dialogs","application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml":"strs","application/vnd.ms-excel.sharedStrings":"strs","application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":"styles","application/vnd.ms-excel.styles":"styles","application/vnd.openxmlformats-package.core-properties+xml":"coreprops","application/vnd.openxmlformats-officedocument.custom-properties+xml":"custprops","application/vnd.openxmlformats-officedocument.extended-properties+xml":"extprops","application/vnd.openxmlformats-officedocument.customXmlProperties+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":"comments","application/vnd.ms-excel.comments":"comments","application/vnd.ms-excel.threadedcomments+xml":"threadedcomments","application/vnd.ms-excel.person+xml":"people","application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml":"metadata","application/vnd.ms-excel.sheetMetadata":"metadata","application/vnd.ms-excel.pivotTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.chart+xml":"TODO","application/vnd.ms-office.chartcolorstyle+xml":"TODO","application/vnd.ms-office.chartstyle+xml":"TODO","application/vnd.ms-office.chartex+xml":"TODO","application/vnd.ms-excel.calcChain":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings":"TODO","application/vnd.ms-office.activeX":"TODO","application/vnd.ms-office.activeX+xml":"TODO","application/vnd.ms-excel.attachedToolbars":"TODO","application/vnd.ms-excel.connections":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":"TODO","application/vnd.ms-excel.externalLink":"links","application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml":"links","application/vnd.ms-excel.pivotCacheDefinition":"TODO","application/vnd.ms-excel.pivotCacheRecords":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml":"TODO","application/vnd.ms-excel.queryTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml":"TODO","application/vnd.ms-excel.userNames":"TODO","application/vnd.ms-excel.revisionHeaders":"TODO","application/vnd.ms-excel.revisionLog":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml":"TODO","application/vnd.ms-excel.tableSingleCells":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml":"TODO","application/vnd.ms-excel.slicer":"TODO","application/vnd.ms-excel.slicerCache":"TODO","application/vnd.ms-excel.slicer+xml":"TODO","application/vnd.ms-excel.slicerCache+xml":"TODO","application/vnd.ms-excel.wsSortMap":"TODO","application/vnd.ms-excel.table":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":"TODO","application/vnd.openxmlformats-officedocument.theme+xml":"themes","application/vnd.openxmlformats-officedocument.themeOverride+xml":"TODO","application/vnd.ms-excel.Timeline+xml":"TODO","application/vnd.ms-excel.TimelineCache+xml":"TODO","application/vnd.ms-office.vbaProject":"vba","application/vnd.ms-office.vbaProjectSignature":"TODO","application/vnd.ms-office.volatileDependencies":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml":"TODO","application/vnd.ms-excel.controlproperties+xml":"TODO","application/vnd.openxmlformats-officedocument.model+data":"TODO","application/vnd.ms-excel.Survey+xml":"TODO","application/vnd.openxmlformats-officedocument.drawing+xml":"drawings","application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml":"TODO","application/vnd.openxmlformats-officedocument.vmlDrawing":"TODO","application/vnd.openxmlformats-package.relationships+xml":"rels","application/vnd.openxmlformats-officedocument.oleObject":"TODO","image/png":"TODO",sheet:"js"},Be={WB:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",SHEET:"http://sheetjs.openxmlformats.org/officeDocument/2006/relationships/officeDocument",HLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",VML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",XPATH:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath",XMISS:"http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/
1xlPathMissing",XLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",CXML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml",CXMLP:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps",CMNT:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",SST:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",STY:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",THEME:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",CHART:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",CHARTEX:"http://schemas.microsoft.com/office/2014/relationships/chartEx",CS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet",WS:["http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet","http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"],DS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet",MS:"http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet",IMG:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",DRAW:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",XLMETA:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",TCMNT
1:"http://schemas.microsoft.com/office/2017/10/relationships/threadedComment",PEOPLE:"http://schemas.microsoft.com/office/2017/10/relationships/person",VBA:"http://schemas.microsoft.com/office/2006/relationships/vbaProject"};function ka(n){var a=n.lastIndexOf("/");return n.slice(0,a+1)+"_rels/"+n.slice(a+1)+".rels"}function Ta(n,a){var t={"!id":{}};if(!n)return t;"/"!==a.charAt(0)&&(a="/"+a);var r={};return(n.match(_n)||[]).forEach(function(i){var s=Me(i);if("<Relationship"===s[0]){var o={};o.Type=s.Type,o.Target=s.Target,o.Id=s.Id,s.TargetMode&&(o.TargetMode=s.TargetMode);var l="External"===s.TargetMode?s.Target:ga(s.Target,a);t[l]=o,r[s.Id]=o}}),t["!id"]=r,t}var Zn=[["cp:category","Category"],["cp:contentStatus","ContentStatus"],["cp:keywords","Keywords"],["cp:lastModifiedBy","LastAuthor"],["cp:lastPrinted","LastPrinted"],["cp:revision","RevNumber"],["cp:version","Version"],["dc:creator","Author"],["dc:description","Comments"],["dc:identifier","Identifier"],["dc:language","Language"],["dc:subject","Subject"],["dc:title","Title"],["dcterms:created","CreatedDate","date"],["dcterms:modified","ModifiedDate","date"]],UT=function(){for(var n=new Array(Zn.length),a=0;a<Zn.length;++a){var t=Zn[a],r="(?:"+t[0].slice(0,t[0].indexOf(":"))+":)"+t[0].slice(t[0].indexOf(":")+1);n[a]=new RegExp("<"+r+"[^>]*>([\\s\\S]*?)</"+r+">")}return n}();function Gd(n){var a={};n=gt(n);for(var t=0;t<Zn.length;++t){var r=Zn[t],i=n.match(UT[t]);null!=i&&i.length>0&&(a[r[1]]=tt(i[1])),"date"===r[2]&&a[r[1]]&&(a[r[1]]=Dt(a[r[1]]))}return a}var Ci=[["Application","Application","string"],["AppVersion","AppVersion","string"],["Company","Company","string"],["DocSecurity","DocSecurity","string"],["Manager","Manager","string"],["HyperlinksChanged","HyperlinksChanged","bool"],["SharedDoc","SharedDoc","bool"],["LinksUpToDate","LinksUpToDate","bool"],["ScaleCrop","ScaleCrop","bool"],["HeadingPairs","HeadingPairs","raw"],["TitlesOfParts","TitlesOfParts","raw"]];function $d(n,a,t,r){var i=[];if("string"==typeof n)i=ld(n,r);else for(var s=0;s<n.length;++s)i=i.concat(n[s].map(function(p){return{v:p}}));var o="string"==typeof a?ld(a,r).map(function(p){return p.v}):a,l=0,c=0;if(o.length>0)for(var d=0;d!==i.length;d+=2){switch(c=+i[d+1].v,i[d].v){case"Worksheets":case"\u5de5\u4f5c\u8868":case"\u041b\u0438\u0441\u0442\u044b":case"\u0623\u0648\u0631\u0627\u0642 \u0627\u0644\u0639\u0645\u0644":case"\u30ef\u30fc\u30af\u30b7\u30fc\u30c8":case"\u05d2\u05dc\u05d9\u05d5\u05e0\u05d5\u05ea \u05e2\u05d1\u05d5\u05d3\u05d4":case"Arbeitsbl\xe4tter":case"\xc7al\u0131\u015fma Sayfalar\u0131":case"Feuilles de calcul":case"Fogli di lavoro":case"Folhas de c\xe1lculo":case"Planilhas":case"Regneark":case"Hojas de c\xe1lculo":case"Werkbladen":t.Worksheets=c,t.SheetNames=o.slice(l,l+c);break;case"Named Ranges":case"Rangos con nombre":case"\u540d\u524d\u4ed8\u304d\u4e00\u89a7":case"Benannte Bereiche":case"Navngivne omr\xe5der":t.NamedRanges=c,t.DefinedNames=o.slice(l,l+c);break;case"Charts":case"Diagramme":t.Chartsheets=c,t.ChartNames=o.slice(l,l+c)}l+=c}}var Ho,YT=/<[^>]+>[^<]*/g,Wo={Title:"Title",Subject:"Subject",Author:"Author",Keywords:"Keywords",Comments:"Description",LastAuthor:"LastAuthor",RevNumber:"Revision",Application:"AppName",LastPrinted:"LastPrinted",CreatedDate:"Created",ModifiedDate:"LastSaved",Category:"Category",Manager:"Manager",Company:"Company",AppVersion:"Version",ContentStatus:"ContentStatus",Identifier:"Identifier",Language:"Language"};function HT(n,a,t){Ho||(Ho=_s(Wo)),n[a=Ho[a]||a]=t}function zo(n){var a=n.read_shift(4),t=n.read_shift(4);return new Date(1e3*(t/1e7*Math.pow(2,32)+a/1e7-11644473600)).toISOString().replace(/\.000/,"")}function Xd(n,a,t){var r=n.l,i=n.read_shift(0,"lpstr-cp");if(t)for(;n.l-r&3;)++n.l;return i}function Yd(n,a,t){var r=n.read_shift(0,"lpwstr");return t&&(n.l+=4-(r.length+1&3)&3),r}function Wd(n,a,t){return 31===a?Yd(n):Xd(n,0,t)}function qo(n,a,t){return Wd(n,a,!1===t?0:4)}function ew(n){var a=n.l,t=Ds(n,81);return 0==n[n.l]&&0==n[n.l+1]&&n.l-a&2&&(n.l+=2),[t,Ds(n,3)]}function Hd(n,a){for(var t=n.read_shift(4),r={},i=0;i!=t;++i){var s=n.read_shift(4),o=n.read_shift(4);r[s]=n.read_shift(o,1200===a?"utf16le":"utf8").replace(gn,"").replace(ua,"!"),1200===a&&o%2&&(n.l+=2)}return 3&n.l&&(n.l=n.l>>3<<2),r}function zd(n){var a=n.read_shift(4),t=n.slice(n.l,n.l+a);return n.l+=a,(3&a)>0&&(n.l+=4-(3&a)&3),t}function Ds(n,a,t){var i,r=n.read_shift(2),s=t||{};if(n.l+=2,12!==a&&r!==a&&-1===jT.indexOf(a)&&(4126!=(65534&a)||4126!=(65534&r)))throw new Error("Expected type "+a+" saw "+r);switch(12===a?r:a){case 2:return i=n.read_shift(2,"i"),s.raw||(n.l+=2),i;case 3:return n.read_shift(4,"i");case 11:return 0!==n.read_shift(4);case 19:return n.read_shift(4);case 30:return Xd(n,0,4).replace(gn,"");case 31:return Yd(n);case 64:return zo(n);case 65:return zd(n);case 71:return function nw(n){var a={};return a.Size=n.read_shift(4),n.l+=a.Size+3-(a.Size-1)%4,a}(n);case 80:return qo(n,r,!s.raw).replace(gn,"");case 81:return function KT(n,a){if(!a)throw new Error("VtUnalignedString must have positive length");return Wd(n,a,0)}(n,r).replace(gn,"");case 4108:return function tw(n){for(var a=n.read_shift(4),t=[],r=0;r<a/2;++r)t.push(ew(n));return t}(n);case 4126:case 4127:return 4127==r?function QT(n){for(var a=n.read_shift(4),t=[],r=0;r!=a;++r){var i=n.l;t[r]=n.read_shift(0,"lpwstr").replace(gn,""),n.l-i&2&&(n.l+=2)}return t}(n):function ZT(n){for(var a=n.read_shift(4),t=[],r=0;r!=a;++r)t[r]=n.read_shift(0,"lpstr-cp").replace(gn,"");return t}(n);default:throw new Error("TypedPropertyValue unrecognized type "+a+" "+r)}}function Jd(n,a){var t=n.l,r=n.read_shift(4),i=n.read_shift(4),s=[],o=0,l=0,c=-1,d={};for(o=0;o!=i;++o){var p=n.read_shift(4),u=n.read_shift(4);s[o]=[p,u+t]}s.sort(function(k,b){return k[1]-b[1]});var f={};for(o=0;o!=i;++o){if(n.l!==s[o][1]){var h=!0;if(o>0&&a)switch(a[s[o-1][0]].t){case 2:n.l+2===s[o][1]&&(n.l+=2,h=!1);break;case 80:case 4108:n.l<=s[o][1]&&(n.l=s[o][1],h=!1)}if((!a||0==o)&&n.l<=s[o][1]&&(h=!1,n.l=s[o][1]),h)throw new Error("Read Error: Expected address "+s[o][
11]+" at "+n.l+" :"+o)}if(a){var g=a[s[o][0]];if(f[g.n]=Ds(n,g.t,{raw:!0}),"version"===g.p&&(f[g.n]=String(f[g.n]>>16)+"."+("0000"+String(65535&f[g.n])).slice(-4)),"CodePage"==g.n)switch(f[g.n]){case 0:f[g.n]=1252;case 874:case 932:case 936:case 949:case 950:case 1250:case 1251:case 1253:case 1254:case 1255:case 1256:case 1257:case 1258:case 1e4:case 1200:case 1201:case 1252:case 65e3:case-536:case 65001:case-535:qn(l=f[g.n]>>>0&65535);break;default:throw new Error("Unsupported CodePage: "+f[g.n])}}else if(1===s[o][0]){if(l=f.CodePage=Ds(n,2),qn(l),-1!==c){var m=n.l;n.l=s[c][1],d=Hd(n,l),n.l=m}}else if(0===s[o][0]){if(0===l){c=o,n.l=s[o+1][1];continue}d=Hd(n,l)}else{var v,_=d[s[o][0]];switch(n[n.l]){case 65:n.l+=4,v=zd(n);break;case 30:case 31:n.l+=4,v=qo(n,n[n.l-4]).replace(/\u0000+$/,"");break;case 3:n.l+=4,v=n.read_shift(4,"i");break;case 19:n.l+=4,v=n.read_shift(4);break;case 5:n.l+=4,v=n.read_shift(8,"f");break;case 11:n.l+=4,v=$t(n,4);break;case 64:n.l+=4,v=Dt(zo(n));break;default:throw new Error("unparsed value: "+n[n.l])}f[_]=v}}return n.l=t+r,f}function Zd(n,a,t){var r=n.content;if(!r)return{};fn(r,0);var i,s,o,l,c=0;r.chk("feff","Byte Order: "),r.read_shift(2);var d=r.read_shift(4),p=r.read_shift(16);if(p!==Ee.utils.consts.HEADER_CLSID&&p!==t)throw new Error("Bad PropertySet CLSID "+p);if(1!==(i=r.read_shift(4))&&2!==i)throw new Error("Unrecognized #Sets: "+i);if(s=r.read_shift(16),l=r.read_shift(4),1===i&&l!==r.l)throw new Error("Length mismatch: "+l+" !== "+r.l);2===i&&(o=r.read_shift(16),c=r.read_shift(4));var g,u=Jd(r,a),f={SystemIdentifier:d};for(var h in u)f[h]=u[h];if(f.FMTID=s,1===i)return f;if(c-r.l==2&&(r.l+=2),r.l!==c)throw new Error("Length mismatch 2: "+r.l+" !== "+c);try{g=Jd(r,null)}catch{}for(h in g)f[h]=g[h];return f.FMTID=[s,o],f}function Zr(n,a){return n.read_shift(a),null}function $t(n,a){return 1===n.read_shift(a)}function Jt(n){return n.read_shift(2,"u")}function tp(n,a){return function aw(n,a,t){for(var r=[],i=n.l+a;n.l<i;)r.push(t(n,i-n.l));if(i!==n.l)throw new Error("Slurp error");return r}(n,a,Jt)}function wa(n,a,t){var r=n.read_shift(t&&t.biff>=12?2:1),i="sbcs-cont",s=Nn;t&&t.biff>=8&&(Nn=1200),t&&8!=t.biff?12==t.biff&&(i="wstr"):n.read_shift(1)&&(i="dbcs-cont"),t.biff>=2&&t.biff<=5&&(i="cpstr");var l=r?n.read_shift(r,i):"";return Nn=s,l}function ow(n){var a=Nn;Nn=1200;var c,t=n.read_shift(2),r=n.read_shift(1),i=4&r,s=8&r,o=1+(1&r),l=0,d={};s&&(l=n.read_shift(2)),i&&(c=n.read_shift(4));var u=0===t?"":n.read_shift(t,2==o?"dbcs-cont":"sbcs-cont");return s&&(n.l+=4*l),i&&(n.l+=c),d.t=u,s||(d.raw="<t>"+d.t+"</t>",d.r=d.t),Nn=a,d}function ki(n,a,t){if(t){if(t.biff>=2&&t.biff<=5)return n.read_shift(a,"cpstr");if(t.biff>=12)return n.read_shift(a,"dbcs-cont")}var i=n.read_shift(1);return n.read_shift(a,0===i?"sbcs-cont":"dbcs-cont")}function ya(n,a,t){var r=n.read_shift(t&&2==t.biff?1:2);return 0===r?(n.l++,""):ki(n,r,t)}function Ti(n,a,t){if(t.biff>5)return ya(n,0,t);var r=n.read_shift(1);return 0===r?(n.l++,""):n.read_shift(r,t.biff<=4||!n.lens?"cpstr":"sbcs-cont")}function Rs(n){var a=n.read_shift(4);return a>0?n.read_shift(a,"utf16le").replace(gn,""):""}function ap(n){return[n.read_shift(1),n.read_shift(1),n.read_shift(1),n.read_shift(1)]}function sp(n,a){var t=ap(n);return t[3]=0,t}function kr(n){return{r:n.read_shift(2),c:n.read_shift(2),ixfe:n.read_shift(2)}}function _w(n,a,t){var r=t.biff>8?4:2;return[n.read_shift(r),n.read_shift(r,"i"),n.read_shift(r,"i")]}function op(n){return[n.read_shift(2),Bo(n)]}function js(n){var a=n.read_shift(2),t=n.read_shift(2);return{s:{c:n.read_shift(2),r:a},e:{c:n.read_shift(2),r:t}}}function cp(n){var a=n.read_shift(2),t=n.read_shift(2);return{s:{c:n.read_shift(1),r:a},e:{c:n.read_shift(1),r:t}}}var vw=cp;function dp(n){n.l+=4;var a=n.read_shift(2),t=n.read_shift(2),r=n.read_shift(2);return n.l+=12,[t,a,r]}function Cn(n){n.l+=2,n.l+=n.read_shift(2)}var kw={0:Cn,4:Cn,5:Cn,6:Cn,7:function Cw(n){return n.l+=4,n.cf=n.read_shift(2),{}},8:Cn,9:Cn,10:Cn,11:Cn,12:Cn,13:function bw(n){var a={};return n.l+=4,n.l+=16,a.fSharedNote=n.read_shift(2),n.l+=4,a},14:Cn,15:Cn,16:Cn,17:Cn,18:Cn,19:Cn,20:Cn,21:dp};function As(n,a){var t={BIFFVer:0,dt:0};switch(t.BIFFVer=n.read_shift(2),(a-=2)>=2&&(t.dt=n.read_shift(2),n.l-=2),t.BIFFVer){case 1536:case 1280:case 1024:case 768:case 512:case 2:case 7:break;default:if(a>6)throw new Error("Unexpected BIFF Ver "+t.BIFFVer)}return n.read_shift(a),t}function pp(n,a,t){var r=0;t&&2==t.biff||(r=n.read_shift(2));var i=n.read_shift(2);return t&&2==t.biff&&(r=1-(i>>15),i&=32767),[{Unsynced:1&r,DyZero:(2&r)>>1,ExAsc:(4&r)>>2,ExDsc:(8&r)>>3},i]}var qw=Ti;function up(n,a,t){var r=n.l+a,i=8!=t.biff&&t.biff?2:4,s=n.read_shift(i),o=n.read_shift(i),l=n.read_shift(2),c=n.read_shift(2);return n.l=r,{s:{r:s,c:l},e:{r:o,c}}}function mp(n,a,t){var r=kr(n);(2==t.biff||9==a)&&++n.l;var i=function sw(n){var a=n.read_shift(1);return 1===n.read_shift(1)?a:1===a}(n);return r.val=i,r.t=!0===i||!1===i?"b":"e",r}var hp=function gw(n,a,t){return 0===a?"":Ti(n,0,t)};function gp(n,a,t){var i,r=n.read_shift(2),s={fBuiltIn:1&r,fWantAdvise:r>>>1&1,fWantPict:r>>>2&1,fOle:r>>>3&1,fOleLink:r>>>4&1,cf:r>>>5&1023,fIcon:r>>>15&1};return 14849===t.sbcch&&(i=function xw(n,a,t){n.l+=4;var r=n.l+(a-=4),i=wa(n,0,t),s=n.read_shift(2);if(s!==(r-=n.l))throw new Error("Malformed AddinUdf: padding = "+r+" != "+s);return n.l+=s,i}(n,a-2,t)),s.body=i||n.read_shift(a-2),"string"==typeof i&&(s.Name=i),s}var ly=["_xlnm.Consolidate_Area","_xlnm.Auto_Open","_xlnm.Auto_Close","_xlnm.Extract","_xlnm.Database","_xlnm.Criteria","_xlnm.Print_Area","_xlnm.Print_Titles","_xlnm.Recorder","_xlnm.Data_Form","_xlnm.Auto_Activate","_xlnm.Auto_Deactivate","_xlnm.Sheet_Title","_xlnm._FilterDatabase"];function _p(n,a,t){var r=n.l+a,i=n.read_shift(2),s=n.read_shift(1),o=n.read_shift(1),l=n.read_shift(t&&2==t.biff?1:2),c=0;(!t||t.biff>=5)&&(5!=t.biff&&(n.l+=2),c=n.read_shift(2),5==t.biff&&(n.l+=2),n.l+=4);var d=ki(n,o,t);32&i&&(d=ly[d.charCodeAt(0)]);var p=r-n.l;t&&2==t.biff&&--p;var u=r!=n.l&&0!==l&&p>0?function TI(n,a,t,r){var o,i=n.l+a,s=Aa(n,r,t);return i!==n.l&&(o=ja(n,i-n.l,s,t)),[s,o]}(n,p,t,l):[];return{chKey:s,Name:d,itab:c,rgce:u}}function xp(n,a,t){if(t.biff<8)return function cy(n,a,t){3==n[n.l+1]&&n[n.l]++;var r=wa(n,0,t);return 3==r.charCodeAt(0)?r.slice(1):r}(n,0,t);for(var r=[],i=n.l+a,s=n.read_shift(t.biff>8?4:2);0!=s--;)r.push(_w(n,0,t));if(n.l!=i)throw new Error("Bad ExternSheet: "+n.l+" != "+i);return r}function vp(n,a,t){var r=vw(n,6);switch(t.biff){case 2:n.l++,a-=7;break;case 3:case 4:n.l+=2,a-=8;break;default:n.l+=6,a-=12}return[r,CI(n,a,t)]}var xy={8:function(n,a){var t=n.l+a;n.l+=10;var r=n.read_shift(2);
1n.l+=4,n.l+=2,n.l+=2,n.l+=2,n.l+=4;var i=n.read_shift(1);return n.l+=i,n.l=t,{fmt:r}}};function bp(n,a,t){if(!t.cellStyles)return xn(n,a);var r=t&&t.biff>=12?4:2,i=n.read_shift(r),s=n.read_shift(r),o=n.read_shift(r),l=n.read_shift(r),c=n.read_shift(2);2==r&&(n.l+=2);var d={s:i,e:s,w:o,ixfe:l,flags:c};return(t.biff>=5||!t.biff)&&(d.level=c>>8&7),d}var My=kr,Py=tp,Oy=ya,Wy=[2,3,48,49,131,139,140,245],Ko=function(){var n={1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127,8:865,9:437,10:850,11:437,13:437,14:850,15:437,16:850,17:437,18:850,19:932,20:850,21:437,22:850,23:865,24:437,25:437,26:850,27:437,28:863,29:850,31:852,34:852,35:852,36:860,37:850,38:866,55:850,64:852,77:936,78:949,79:950,80:874,87:1252,88:1252,89:1252,108:863,134:737,135:852,136:857,204:1257,255:16969},a=_s({1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127});function r(l,c){var d=c||{};d.dateNF||(d.dateNF="yyyymmdd");var p=$i(function t(l,c){var d=[],p=Wr(1);switch(c.type){case"base64":p=Bn(Gn(l));break;case"binary":p=Bn(l);break;case"buffer":case"array":p=l}fn(p,0);var u=p.read_shift(1),f=!!(136&u),h=!1,g=!1;switch(u){case 2:case 3:case 131:case 139:case 245:break;case 48:case 49:h=!0,f=!0;break;case 140:g=!0;break;default:throw new Error("DBF Unsupported Version: "+u.toString(16))}var m=0,_=521;2==u&&(m=p.read_shift(2)),p.l+=3,2!=u&&(m=p.read_shift(4)),m>1048576&&(m=1e6),2!=u&&(_=p.read_shift(2));var v=p.read_shift(2),k=c.codepage||1252;2!=u&&(p.l+=16,p.read_shift(1),0!==p[p.l]&&(k=n[p[p.l]]),p.l+=1,p.l+=2),g&&(p.l+=36);for(var b=[],A={},G=Math.min(p.length,2==u?521:_-10-(h?264:0)),j=g?32:11;p.l<G&&13!=p[p.l];)switch(A={},A.name=Ze.utils.decode(k,p.slice(p.l,p.l+j)).replace(/[\u0000\r\n].*$/g,""),p.l+=j,A.type=String.fromCharCode(p.read_shift(1)),2!=u&&!g&&(A.offset=p.read_shift(4)),A.len=p.read_shift(1),2==u&&(A.offset=p.read_shift(2)),A.dec=p.read_shift(1),A.name.length&&b.push(A),2!=u&&(p.l+=g?13:14),A.type){case"B":(!h||8!=A.len)&&c.WTF&&console.log("Skipping "+A.name+":"+A.type);break;case"G":case"P":c.WTF&&console.log("Skipping "+A.name+":"+A.type);break;case"+":case"0":case"@":case"C":case"D":case"F":case"I":case"L":case"M":case"N":case"O":case"T":case"Y":break;default:throw new Error("Unknown Field Type: "+A.type)}if(13!==p[p.l]&&(p.l=_-1),13!==p.read_shift(1))throw new Error("DBF Terminator not found "+p.l+" "+p[p.l]);p.l=_;var w=0,O=0;for(d[0]=[],O=0;O!=b.length;++O)d[0][O]=b[O].name;for(;m-- >0;)if(42!==p[p.l])for(++p.l,d[++w]=[],O=0,O=0;O!=b.length;++O){var M=p.slice(p.l,p.l+b[O].len);p.l+=b[O].len,fn(M,0);var H=Ze.utils.decode(k,M);switch(b[O].type){case"C":H.trim().length&&(d[w][O]=H.replace(/\s+$/,""));break;case"D":d[w][O]=8===H.length?new Date(+H.slice(0,4),+H.slice(4,6)-1,+H.slice(6,8)):H;break;case"F":d[w][O]=parseFloat(H.trim());break;case"+":case"I":d[w][O]=g?2147483648^M.read_shift(-4,"i"):M.read_shift(4,"i");break;case"L":switch(H.trim().toUpperCase()){case"Y":case"T":d[w][O]=!0;break;case"N":case"F":d[w][O]=!1;break;case"":case"?":break;default:throw new Error("DBF Unrecognized L:|"+H+"|")}break;case"M":if(!f)throw new Error("DBF Unexpected MEMO for type "+u.toString(16));d[w][O]="##MEMO##"+(g?parseInt(H.trim(),10):M.read_shift(4));break;case"N":(H=H.replace(/\u0000/g,"").trim())&&"."!=H&&(d[w][O]=+H||0);break;case"@":d[w][O]=new Date(M.read_shift(-8,"f")-621356832e5);break;case"T":d[w][O]=new Date(864e5*(M.read_shift(4)-2440588)+M.read_shift(4));break;case"Y":d[w][O]=M.read_shift(4,"i")/1e4+M.read_shift(4,"i")/1e4*Math.pow(2,32);break;case"O":d[w][O]=-M.read_shift(-8,"f");break;case"B":if(h&&8==b[O].len){d[w][O]=M.read_shift(8,"f");break}case"G":case"P":M.l+=b[O].len;break;case"0":if("_NullFlags"===b[O].name)break;default:throw new Error("DBF Unsupported data type "+b[O].type)}}else p.l+=v;if(2!=u&&p.l<p.length&&26!=p[p.l++])throw new Error("DBF EOF Marker missing "+(p.l-1)+" of "+p.length+" "+p[p.l-1].toString(16));return c&&c.sheetRows&&(d=d.slice(0,c.sheetRows)),c.DBF=b,d}(l,d),d);return p["!cols"]=d.DBF.map(function(u){return{wch:u.len,DBF:u}}),delete d.DBF,p}var s={B:8,C:250,L:1,D:8,"?":0,"":0};return{to_workbook:function i(l,c){try{return Qr(r(l,c),c)}catch(d){if(c&&c.WTF)throw d}return{SheetNames:[],Sheets:{}}},to_sheet:r,from_sheet:function o(l,c){var d=c||{};if(+d.codepage>=0&&qn(+d.codepage),"string"==d.type)throw new Error("Cannot write DBF to JS string");var p=En(),u=Xs(l,{header:1,raw:!0,cellDates:!0}),f=u[0],h=u.slice(1),g=l["!cols"]||[],m=0,_=0,v=0,k=1;for(m=0;m<f.length;++m)if(((g[m]||{}).DBF||{}).name)f[m]=g[m].DBF.name,++v;else if(null!=f[m]){if(++v,"number"==typeof f[m]&&(f[m]=f[m].toString(10)),"string"!=typeof f[m])throw new Error("DBF Invalid column name "+f[m]+" |"+typeof f[m]+"|");if(f.indexOf(f[m])!==m)for(_=0;_<1024;++_)if(-1==f.indexOf(f[m]+"_"+_)){f[m]+="_"+_;break}}var b=Ke(l["!ref"]),A=[],G=[],j=[];for(m=0;m<=b.e.c-b.s.c;++m){var w="",O="",M=0,H=[];for(_=0;_<h.length;++_)null!=h[_][m]&&H.push(h[_][m]);if(0!=H.length&&null!=f[m]){for(_=0;_<H.length;++_){switch(typeof H[_]){case"number":O="B";break;case"string":default:O="C";break;case"boolean":O="L";break;case"object":O=H[_]instanceof Date?"D":"C"}M=Math.max(M,String(H[_]).length),w=w&&w!=O?"C":O}M>250&&(M=250),"C"==(O=((g[m]||{}).DBF||{}).type)&&g[m].DBF.len>M&&(M=g[m].DBF.len),"B"==w&&"N"==O&&(w="N",j[m]=g[m].DBF.dec,M=g[m].DBF.len),G[m]="C"==w||"N"==O?M:s[w]||0,k+=G[m],A[m]=w}else A[m]="?"}var z=p.next(32);for(z.write_shift(4,318902576),z.write_shift(4,h.length),z.write_shift(2,296+32*v),z.write_shift(2,k),m=0;m<4;++m)z.write_shift(4,0);for(z.write_shift(4,(+a[di]||3)<<8),m=0,_=0;m<f.length;++m)if(null!=f[m]){var P=p.next(32),oe=(f[m].slice(-10)+"\0\0\0\0\0\0\0\0\0\0\0").slice(0,11);P.write_shift(1,oe,"sbcs"),P.write_shift(1,"?"==A[m]?"C":A[m],"sbcs"),P.write_shift(4,_),P.write_shift(1,G[m]||s[A[m]]||0),P.write_shift(1,j[m]||0),P.write_shift(1,2),P.write_shift(4,0),P.write_shift(1,0),P.write_shift(4,0),P.write_shift(4,0),_+=G[m]||s[A[m]]||0}var ve=p.next(264);for(ve.write_shift(4,13),m=0;m<65;++m)ve.write_shift(4,0);for(m=0;m<h.length;++m){var ae=p.next(k);for(ae.write_shift(1,0),_=0;_<f.length;++_)if(null!=f[_])switch(A[_]){case"L":ae.write_shift(1,null==h[m][_]?63:h[m][_]?84:70);break;case"B":ae.write_shift(8,h[m][_]||0,"f");break;case"N":var ye="0";for("number"==typeof h[m][_]&&(ye=h[m][_].toFixed(j[_]||0)),v=0;v<G[_]-ye.length;++v)ae.write_shift(1,32);ae.write_shift(1,ye,"sbcs");break;case"D":h[m][_]?(ae.write_shift(4,("0000"+h[m][_].getFullYear()).slice(-4),"sbcs"),ae.write_shift(2,("00"+(h[m][_].getMonth()+1)).slice(-2),"sbcs"),ae.write_shift(2,("00"+h[m][_].getDate()).slice(-2),"sbcs")):ae.write_shift(8,"00000000","sbcs");break;case"C":var ke=String(null!=h[m][_]?h[m][_]:"").slice(0,G[_]);for(ae.write_shift(1,ke,"sbcs"),v=0;v<G[_]-ke.length;++v)ae.write_shift(1,32)}}return p.next(1).write_shift(1,26),p.end()}}}(),Cp=function(){var n={AA:"\xc0",BA:"\xc1",CA:"\xc2",DA:195,HA:"\xc4",JA:197,AE:"\xc8",BE:"\xc9",CE:"\xca",HE:"\xcb",AI:"\xcc",BI:"\xcd",CI:"\xce",HI:"\xcf",AO:"\xd2",BO:"\xd3",CO:"\xd4",DO:213,HO:"\xd6",AU:"\xd9",BU:"\xda",CU:"\xdb",HU:"\xdc",Aa:"\xe0",Ba:"\xe1",Ca:"\xe2",Da:227,Ha:"\xe4",Ja:229,Ae:"\xe8",Be:"\xe9",Ce:"\xea",He:"\xeb",Ai:"\xec",Bi:"\xed",Ci:"\xee",Hi:"\xef",Ao:"\xf2",Bo:"\xf3",Co:"\xf4",Do:245,Ho:"\xf6",Au:"\xf9",Bu:"\xfa",Cu:"\xfb",Hu:"\xfc",KC:"\xc7",Kc:"\xe7",q:"\xe6",z:"\u0153",a:"\xc6",j:"\u0152",DN:209,Dn:241,Hy:255,S:169,c:170,R:174,"B ":180,0:176,1:177,2:178,3:179,5:181,6:182,7:183,Q:185,k:186,b:208,i:216,l:222,s:240,y:248,"!":161,'"':162,"#":163,"(":164,"%":165,"'":167,"H ":168,"+":171,";":187,"<":188,"=":189,">":190,"?":191,"{":223},a=new RegExp("\x1bN("+Pt(n).join("|").replace(/\|\|\|/,"|\\||").replace(/([?()+])/g,"\\$1")+"|\\|)","gm"),t=function(f,h){var g=n[h];return"number"==typeof g?uo(g):g}
1,r=function(f,h,g){var m=h.charCodeAt(0)-32<<4|g.charCodeAt(0)-48;return 59==m?f:uo(m)};function s(f,h){var z,g=f.split(/[\n\r]+/),m=-1,_=-1,v=0,k=0,b=[],A=[],G=null,j={},w=[],O=[],M=[],H=0;for(+h.codepage>=0&&qn(+h.codepage);v!==g.length;++v){H=0;var ae,P=g[v].trim().replace(/\x1B([\x20-\x2F])([\x30-\x3F])/g,r).replace(a,t),oe=P.replace(/;;/g,"\0").split(";").map(function(D){return D.replace(/\u0000/g,";")});if(P.length>0)switch(oe[0]){case"ID":case"E":case"B":case"O":case"W":break;case"P":"P"==oe[1].charAt(0)&&A.push(P.slice(3).replace(/;;/g,";"));break;case"C":var ye=!1,ke=!1,He=!1,ge=!1,Fe=-1,te=-1;for(k=1;k<oe.length;++k)switch(oe[k].charAt(0)){case"A":case"G":break;case"X":_=parseInt(oe[k].slice(1))-1,ke=!0;break;case"Y":for(m=parseInt(oe[k].slice(1))-1,ke||(_=0),z=b.length;z<=m;++z)b[z]=[];break;case"K":'"'===(ae=oe[k].slice(1)).charAt(0)?ae=ae.slice(1,ae.length-1):"TRUE"===ae?ae=!0:"FALSE"===ae?ae=!1:isNaN(dr(ae))?isNaN(Gi(ae).getDate())||(ae=Dt(ae)):(ae=dr(ae),null!==G&&ui(G)&&(ae=bs(ae))),ye=!0;break;case"E":ge=!0;var I=Wi(oe[k].slice(1),{r:m,c:_});b[m][_]=[b[m][_],I];break;case"S":He=!0,b[m][_]=[b[m][_],"S5S"];break;case"R":Fe=parseInt(oe[k].slice(1))-1;break;case"C":te=parseInt(oe[k].slice(1))-1;break;default:if(h&&h.WTF)throw new Error("SYLK bad record "+P)}if(ye&&(b[m][_]&&2==b[m][_].length?b[m][_][0]=ae:b[m][_]=ae,G=null),He){if(ge)throw new Error("SYLK shared formula cannot have own formula");var X=Fe>-1&&b[Fe][te];if(!X||!X[1])throw new Error("SYLK shared formula cannot find base");b[m][_][1]=$p(X[1],{r:m-Fe,c:_-te})}break;case"F":var R=0;for(k=1;k<oe.length;++k)switch(oe[k].charAt(0)){case"X":_=parseInt(oe[k].slice(1))-1,++R;break;case"Y":for(m=parseInt(oe[k].slice(1))-1,z=b.length;z<=m;++z)b[z]=[];break;case"M":H=parseInt(oe[k].slice(1))/20;break;case"F":case"G":case"S":case"D":case"N":break;case"P":G=A[parseInt(oe[k].slice(1))];break;case"W":for(M=oe[k].slice(1).split(" "),z=parseInt(M[0],10);z<=parseInt(M[1],10);++z)H=parseInt(M[2],10),O[z-1]=0===H?{hidden:!0}:{wch:H},Fi(O[z-1]);break;case"C":O[_=parseInt(oe[k].slice(1))-1]||(O[_]={});break;case"R":w[m=parseInt(oe[k].slice(1))-1]||(w[m]={}),H>0?(w[m].hpt=H,w[m].hpx=Xi(H)):0===H&&(w[m].hidden=!0);break;default:if(h&&h.WTF)throw new Error("SYLK bad record "+P)}R<1&&(G=null);break;default:if(h&&h.WTF)throw new Error("SYLK bad record "+P)}}return w.length>0&&(j["!rows"]=w),O.length>0&&(j["!cols"]=O),h&&h.sheetRows&&(b=b.slice(0,h.sheetRows)),[b,j]}function o(f,h){var g=function i(f,h){switch(h.type){case"base64":return s(Gn(f),h);case"binary":return s(f,h);case"buffer":return s(We&&Buffer.isBuffer(f)?f.toString("binary"):Hr(f),h);case"array":return s(fi(f),h)}throw new Error("Unrecognized type "+h.type)}(f,h),_=g[1],v=$i(g[0],h);return Pt(_).forEach(function(k){v[k]=_[k]}),v}function c(f,h,g,m){var _="C;Y"+(g+1)+";X"+(m+1)+";K";switch(f.t){case"n":_+=f.v||0,f.f&&!f.F&&(_+=";E"+al(f.f,{r:g,c:m}));break;case"b":_+=f.v?"TRUE":"FALSE";break;case"e":_+=f.w||f.v;break;case"d":_+='"'+(f.w||f.v)+'"';break;case"s":_+='"'+f.v.replace(/"/g,"").replace(/;/g,";;")+'"'}return _}return n["|"]=254,{to_workbook:function l(f,h){return Qr(o(f,h),h)},to_sheet:o,from_sheet:function u(f,h){var v,g=["ID;PWXL;N;E"],m=[],_=Ke(f["!ref"]),k=Array.isArray(f),b="\r\n";g.push("P;PGeneral"),g.push("F;P0;DG0G8;M255"),f["!cols"]&&function d(f,h){h.forEach(function(g,m){var _="F;W"+(m+1)+" "+(m+1)+" ";g.hidden?_+="0":("number"==typeof g.width&&!g.wpx&&(g.wpx=Sa(g.width)),"number"==typeof g.wpx&&!g.wch&&(g.wch=Ea(g.wpx)),"number"==typeof g.wch&&(_+=Math.round(g.wch)))," "!=_.charAt(_.length-1)&&f.push(_)})}(g,f["!cols"]),f["!rows"]&&function p(f,h){h.forEach(function(g,m){var _="F;";g.hidden?_+="M0;":g.hpt?_+="M"+20*g.hpt+";":g.hpx&&(_+="M"+20*Ia(g.hpx)+";"),_.length>2&&f.push(_+"R"+(m+1))})}(g,f["!rows"]),g.push("B;Y"+(_.e.r-_.s.r+1)+";X"+(_.e.c-_.s.c+1)+";D"+[_.s.c,_.s.r,_.e.c,_.e.r].join(" "));for(var A=_.s.r;A<=_.e.r;++A)for(var G=_.s.c;G<=_.e.c;++G){var j=Pe({r:A,c:G});(v=k?(f[A]||[])[G]:f[j])&&(null!=v.v||v.f&&!v.F)&&m.push(c(v,0,A,G))}return g.join(b)+b+m.join(b)+b+"E"+b}}}(),kp=function(){function a(s,o){for(var l=s.split("\n"),c=-1,d=-1,p=0,u=[];p!==l.length;++p)if("BOT"!==l[p].trim()){if(!(c<0)){for(var f=l[p].trim().split(","),h=f[0],g=f[1],m=l[++p]||"";1&(m.match(/["]/g)||[]).length&&p<l.length-1;)m+="\n"+l[++p];switch(m=m.trim(),+h){case-1:if("BOT"===m){u[++c]=[],d=0;continue}if("EOD"!==m)throw new Error("Unrecognized DIF special command "+m);break;case 0:u[c][d]="TRUE"===m||"FALSE"!==m&&(isNaN(dr(g))?isNaN(Gi(g).getDate())?g:Dt(g):dr(g)),++d;break;case 1:(m=(m=m.slice(1,m.length-1)).replace(/""/g,'"'))&&m.match(/^=".*"$/)&&(m=m.slice(2,-1)),u[c][d++]=""!==m?m:null}if("EOD"===m)break}}else u[++c]=[],d=0;return o&&o.sheetRows&&(u=u.slice(0,o.sheetRows)),u}function t(s,o){return $i(function n(s,o){switch(o.type){case"base64":return a(Gn(s),o);case"binary":return a(s,o);case"buffer":return a(We&&Buffer.isBuffer(s)?s.toString("binary"):Hr(s),o);case"array":return a(fi(s),o)}throw new Error("Unrecognized type "+o.type)}(s,o),o)}return{to_workbook:function r(s,o){return Qr(t(s,o),o)},to_sheet:t,from_sheet:function(){var s=function(c,d,p,u,f){c.push(d),c.push(p+","+u),c.push('"'+f.replace(/"/g,'""')+'"')},o=function(c,d,p,u){c.push(d+","+p),c.push(1==d?'"'+u.replace(/"/g,'""')+'"':u)};return function(c){var u,d=[],p=Ke(c["!ref"]),f=Array.isArray(c);s(d,"TABLE",0,1,"sheetjs"),s(d,"VECTORS",0,p.e.r-p.s.r+1,""),s(d,"TUPLES",0,p.e.c-p.s.c+1,""),s(d,"DATA",0,0,"");for(var h=p.s.r;h<=p.e.r;++h){o(d,-1,0,"BOT");for(var g=p.s.c;g<=p.e.c;++g){var m=Pe({r:h,c:g});if(u=f?(c[h]||[])[g]:c[m])switch(u.t){case"n":var _=u.w;!_&&null!=u.v&&(_=u.v),null==_?o(d,1,0,u.f&&!u.F?"="+u.f:""):o(d,0,_,"V");break;case"b":o(d,0,u.v?1:0,u.v?"TRUE":"FALSE");break;case"s":o(d,1,0,isNaN(u.v)?u.v:'="'+u.v+'"');break;
1case"d":u.w||(u.w=Ln(u.z||Re[14],en(Dt(u.v)))),o(d,0,u.w,"V");break;default:o(d,1,0,"")}else o(d,1,0,"")}}return o(d,-1,0,"EOD"),d.join("\r\n")}}()}}(),Tp=function(){function n(u){return u.replace(/\\b/g,"\\").replace(/\\c/g,":").replace(/\\n/g,"\n")}function a(u){return u.replace(/\\/g,"\\b").replace(/:/g,"\\c").replace(/\n/g,"\\n")}function r(u,f){return $i(function t(u,f){for(var h=u.split("\n"),g=-1,m=-1,_=0,v=[];_!==h.length;++_){var k=h[_].trim().split(":");if("cell"===k[0]){var b=Rt(k[1]);if(v.length<=b.r)for(g=v.length;g<=b.r;++g)v[g]||(v[g]=[]);switch(g=b.r,m=b.c,k[2]){case"t":v[g][m]=n(k[3]);break;case"v":v[g][m]=+k[3];break;case"vtf":var A=k[k.length-1];case"vtc":v[g][m]="nl"===k[3]?!!+k[4]:+k[4],"vtf"==k[2]&&(v[g][m]=[v[g][m],A])}}}return f&&f.sheetRows&&(v=v.slice(0,f.sheetRows)),v}(u,f),f)}var s=["socialcalc:version:1.5","MIME-Version: 1.0","Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave"].join("\n"),o=["--SocialCalcSpreadsheetControlSave","Content-type: text/plain; charset=UTF-8"].join("\n")+"\n",l=["# SocialCalc Spreadsheet Control Save","part:sheet"].join("\n"),c="--SocialCalcSpreadsheetControlSave--";function d(u){if(!u||!u["!ref"])return"";for(var g,f=[],h=[],m="",_=Un(u["!ref"]),v=Array.isArray(u),k=_.s.r;k<=_.e.r;++k)for(var b=_.s.c;b<=_.e.c;++b)if(m=Pe({r:k,c:b}),(g=v?(u[k]||[])[b]:u[m])&&null!=g.v&&"z"!==g.t){switch(h=["cell",m,"t"],g.t){case"s":case"str":h.push(a(g.v));break;case"n":g.f?(h[2]="vtf",h[3]="n",h[4]=g.v,h[5]=a(g.f)):(h[2]="v",h[3]=g.v);break;case"b":h[2]="vt"+(g.f?"f":"c"),h[3]="nl",h[4]=g.v?"1":"0",h[5]=a(g.f||(g.v?"TRUE":"FALSE"));break;case"d":var A=en(Dt(g.v));h[2]="vtc",h[3]="nd",h[4]=""+A,h[5]=g.w||Ln(g.z||Re[14],A);break;case"e":continue}f.push(h.join(":"))}return f.push("sheet:c:"+(_.e.c-_.s.c+1)+":r:"+(_.e.r-_.s.r+1)+":tvf:1"),f.push("valueformat:1:text-wiki"),f.join("\n")}return{to_workbook:function i(u,f){return Qr(r(u,f),f)},to_sheet:r,from_sheet:function p(u){return[s,o,l,o,d(u),c].join("\n")}}}(),Ui=function(){function n(p,u,f,h,g){g.raw?u[f][h]=p:""===p||(u[f][h]="TRUE"===p||"FALSE"!==p&&(isNaN(dr(p))?isNaN(Gi(p).getDate())?p:Dt(p):dr(p)))}var t={44:",",9:"\t",59:";",124:"|"},r={44:3,9:2,59:1,124:0};function i(p){for(var u={},f=!1,h=0,g=0;h<p.length;++h)34==(g=p.charCodeAt(h))?f=!f:!f&&g in t&&(u[g]=(u[g]||0)+1);for(h in g=[],u)Object.prototype.hasOwnProperty.call(u,h)&&g.push([u[h],h]);if(!g.length)for(h in u=r)Object.prototype.hasOwnProperty.call(u,h)&&g.push([u[h],h]);return g.sort(function(m,_){return m[0]-_[0]||r[m[1]]-r[_[1]]}),t[g.pop()[1]]||44}function o(p,u){return!u||!u.PRN||u.FS||"sep="==p.slice(0,4)||p.indexOf("\t")>=0||p.indexOf(",")>=0||p.indexOf(";")>=0?function s(p,u){var f=u||{},h="",g=f.dense?[]:{},m={s:{c:0,r:0},e:{c:0,r:0}};"sep="==p.slice(0,4)?13==p.charCodeAt(5)&&10==p.charCodeAt(6)?(h=p.charAt(4),p=p.slice(7)):13==p.charCodeAt(5)||10==p.charCodeAt(5)?(h=p.charAt(4),p=p.slice(6)):h=i(p.slice(0,1024)):h=f&&f.FS?f.FS:i(p.slice(0,1024));var _=0,v=0,k=0,b=0,A=0,G=h.charCodeAt(0),j=!1,w=0,O=p.charCodeAt(0);p=p.replace(/\r\n/gm,"\n");var M=null!=f.dateNF?function M3(n){var a="number"==typeof n?Re[n]:n;return a=a.replace(Uc,"(\\d+)"),new RegExp("^"+a+"$")}(f.dateNF):null;function H(){var z=p.slice(b,A),P={};if('"'==z.charAt(0)&&'"'==z.charAt(z.length-1)&&(z=z.slice(1,-1).replace(/""/g,'"')),0===z.length)P.t="z";else if(f.raw)P.t="s",P.v=z;else if(0===z.trim().length)P.t="s",P.v=z;else if(61==z.charCodeAt(0))34==z.charCodeAt(1)&&34==z.charCodeAt(z.length-1)?(P.t="s",P.v=z.slice(2,-1).replace(/""/g,'"')):function oE(n){return 1!=n.length}(z)?(P.t="n",P.f=z.slice(1)):(P.t="s",P.v=z);else if("TRUE"==z)P.t="b",P.v=!0;else if("FALSE"==z)P.t="b",P.v=!1;else if(isNaN(k=dr(z)))if(!isNaN(Gi(z).getDate())||M&&z.match(M)){P.z=f.dateNF||Re[14];var oe=0;M&&z.match(M)&&(z=function P3(n,a,t){var r=-1,i=-1,s=-1,o=-1,l=-1,c=-1;(a.match(Uc)||[]).forEach(function(u,f){var h=parseInt(t[f+1],10);switch(u.toLowerCase().charAt(0)){case"y":r=h;break;case"d":s=h;break;case"h":o=h;break;case"s":c=h;break;case"m":o>=0?l=h:i=h}}),c>=0&&-1==l&&i>=0&&(l=i,i=-1);var d=(""+(r>=0?r:(new Date).getFullYear())).slice(-4)+"-"+("00"+(i>=1?i:1)).slice(-2)+"-"+("00"+(s>=1?s:1)).slice(-2);7==d.length&&(d="0"+d),8==d.length&&(d="20"+d);var p=("00"+(o>=0?o:0)).slice(-2)+":"+("00"+(l>=0?l:0)).slice(-2)+":"+("00"+(c>=0?c:0)).slice(-2);return-1==o&&-1==l&&-1==c?d:-1==r&&-1==i&&-1==s?p:d+"T"+p}(0,f.dateNF,z.match(M)||[]),oe=1),f.cellDates?(P.t="d",P.v=Dt(z,oe)):(P.t="n",P.v=en(Dt(z,oe))),!1!==f.cellText&&(P.w=Ln(P.z,P.v instanceof Date?en(P.v):P.v)),f.cellNF||delete P.z}else P.t="s",P.v=z;else P.t="n",!1!==f.cellText&&(P.w=z),P.v=k;if("z"==P.t||(f.dense?(g[_]||(g[_]=[]),g[_][v]=P):g[Pe({c:v,r:_}
1)]=P),O=p.charCodeAt(b=A+1),m.e.c<v&&(m.e.c=v),m.e.r<_&&(m.e.r=_),w==G)++v;else if(v=0,++_,f.sheetRows&&f.sheetRows<=_)return!0}e:for(;A<p.length;++A)switch(w=p.charCodeAt(A)){case 34:34===O&&(j=!j);break;case G:case 10:case 13:if(!j&&H())break e}return A-b>0&&H(),g["!ref"]=Ge(m),g}(p,u):$i(function a(p,u){var f=u||{},h=[];if(!p||0===p.length)return h;for(var g=p.split(/[\r\n]/),m=g.length-1;m>=0&&0===g[m].length;)--m;for(var _=10,v=0,k=0;k<=m;++k)-1==(v=g[k].indexOf(" "))?v=g[k].length:v++,_=Math.max(_,v);for(k=0;k<=m;++k){h[k]=[];var b=0;for(n(g[k].slice(0,_).trim(),h,k,b,f),b=1;b<=(g[k].length-_)/10+1;++b)n(g[k].slice(_+10*(b-1),_+10*b).trim(),h,k,b,f)}return f.sheetRows&&(h=h.slice(0,f.sheetRows)),h}(p,u),u)}function l(p,u){var f="",h="string"==u.type?[0,0,0,0]:kl(p,u);switch(u.type){case"base64":f=Gn(p);break;case"binary":case"string":f=p;break;case"buffer":f=65001==u.codepage?p.toString("utf8"):We&&Buffer.isBuffer(p)?p.toString("binary"):Hr(p);break;case"array":f=fi(p);break;default:throw new Error("Unrecognized type "+u.type)}return 239==h[0]&&187==h[1]&&191==h[2]?f=gt(f.slice(3)):"string"!=u.type&&"buffer"!=u.type&&65001==u.codepage&&(f=gt(f)),"socialcalc:version:"==f.slice(0,19)?Tp.to_sheet("string"==u.type?f:gt(f),u):o(f,u)}return{to_workbook:function c(p,u){return Qr(l(p,u),u)},to_sheet:l,from_sheet:function d(p){for(var h,u=[],f=Ke(p["!ref"]),g=Array.isArray(p),m=f.s.r;m<=f.e.r;++m){for(var _=[],v=f.s.c;v<=f.e.c;++v){var k=Pe({r:m,c:v});if((h=g?(p[m]||[])[v]:p[k])&&null!=h.v){for(var b=(h.w||(Cr(h),h.w)||"").slice(0,10);b.length<10;)b+=" ";_.push(b+(0===v?" ":""))}else _.push(" ")}u.push(_.join(""))}return u.join("\n")}}}(),yi=function(){function n(I,X,R){if(I){fn(I,I.l||0);for(var D=R.Enum||Fe;I.l<I.length;){var Z=I.read_shift(2),me=D[Z]||D[65535],le=I.read_shift(2),ce=I.l+le,ne=me.f&&me.f(I,le,R);if(I.l=ce,X(ne,me,Z))return}}}function t(I,X){if(!I)return I;var R=X||{},D=R.dense?[]:{},Z="Sheet1",me="",le=0,ce={},ne=[],Le=[],E={s:{r:0,c:0},e:{r:0,c:0}},mt=R.sheetRows||0;if(0==I[2]&&(8==I[3]||9==I[3])&&I.length>=16&&5==I[14]&&108===I[15])throw new Error("Unsupported Works 3 for Mac file");if(2==I[2])R.Enum=Fe,n(I,function(_e,Vt,ir){switch(ir){case 0:R.vers=_e,_e>=4096&&(R.qpro=!0);break;case 6:E=_e;break;case 204:_e&&(me=_e);break;case 222:me=_e;break;case 15:case 51:R.qpro||(_e[1].v=_e[1].v.slice(1));case 13:case 14:case 16:14==ir&&!(112&~_e[2])&&(15&_e[2])>1&&(15&_e[2])<15&&(_e[1].z=R.dateNF||Re[14],R.cellDates&&(_e[1].t="d",_e[1].v=bs(_e[1].v))),R.qpro&&_e[3]>le&&(D["!ref"]=Ge(E),ce[Z]=D,ne.push(Z),D=R.dense?[]:{},E={s:{r:0,c:0},e:{r:0,c:0}},le=_e[3],Z=me||"Sheet"+(le+1),me="");var yr=R.dense?(D[_e[0].r]||[])[_e[0].c]:D[Pe(_e[0])];if(yr){yr.t=_e[1].t,yr.v=_e[1].v,null!=_e[1].z&&(yr.z=_e[1].z),null!=_e[1].f&&(yr.f=_e[1].f);break}R.dense?(D[_e[0].r]||(D[_e[0].r]=[]),D[_e[0].r][_e[0].c]=_e[1]):D[Pe(_e[0])]=_e[1]}},R);else{if(26!=I[2]&&14!=I[2])throw new Error("Unrecognized LOTUS BOF "+I[2]);R.Enum=te,14==I[2]&&(R.qpro=!0,I.l=0),n(I,function(_e,Vt,ir){switch(ir){case 204:Z=_e;break;case 22:_e[1].v=_e[1].v.slice(1);case 23:case 24:case 25:case 37:case 39:case 40:if(_e[3]>le&&(D["!ref"]=Ge(E),ce[Z]=D,ne.push(Z),D=R.dense?[]:{},E={s:{r:0,c:0},e:{r:0,c:0}},Z="Sheet"+((le=_e[3])+1)),mt>0&&_e[0].r>=mt)break;R.dense?(D[_e[0].r]||(D[_e[0].r]=[]),D[_e[0].r][_e[0].c]=_e[1]):D[Pe(_e[0])]=_e[1],E.e.c<_e[0].c&&(E.e.c=_e[0].c),E.e.r<_e[0].r&&(E.e.r=_e[0].r);break;case 27:_e[14e3]&&(Le[_e[14e3][0]]=_e[14e3][1]);break;case 1537:Le[_e[0]]=_e[1],_e[0]==le&&(Z=_e[1])}},R)}if(D["!ref"]=Ge(E),ce[me||Z]=D,ne.push(me||Z),!Le.length)return{SheetNames:ne,Sheets:ce};for(var qe={},ht=[],Je=0;Je<Le.length;++Je)ce[ne[Je]]?(ht.push(Le[Je]||ne[Je]),qe[Le[Je]]=ce[Le[Je]]||ce[ne[Je]]):(ht.push(Le[Je]),qe[Le[Je]]={"!ref":"A1"});return{SheetNames:ht,Sheets:qe}}function d(I,X,R){var D=[{c:0,r:0},{t:"n",v:0},0,0];return R.qpro&&20768!=R.vers?(D[0].c=I.read_shift(1),D[3]=I.read_shift(1),D[0].r=I.read_shift(2),I.l+=2):(D[2]=I.read_shift(1),D[0].c=I.read_shift(2),D[0].r=I.read_shift(2)),D}function p(I,X,R){var D=I.l+X,Z=d(I,0,R);if(Z[1].t="s",20768==R.vers){I.l++;var me=I.read_shift(1);return Z[1].v=I.read_shift(me,"utf8"),Z}return R.qpro&&I.l++,Z[1].v=I.read_shift(D-I.l,"cstr"),Z}function u(I,X,R){var D=K(7+R.length);D.write_shift(1,255),D.write_shift(2,X),D.write_shift(2,I),D.write_shift(1,39);for(var Z=0;Z<D.length;
1++Z){var me=R.charCodeAt(Z);D.write_shift(1,me>=128?95:me)}return D.write_shift(1,0),D}function h(I,X,R){var D=K(7);return D.write_shift(1,255),D.write_shift(2,X),D.write_shift(2,I),D.write_shift(2,R,"i"),D}function m(I,X,R){var D=K(13);return D.write_shift(1,255),D.write_shift(2,X),D.write_shift(2,I),D.write_shift(8,R,"f"),D}function v(I,X,R){var D=32768&X;return X=(D?I:0)+((X&=-32769)>=8192?X-16384:X),(D?"":"$")+(R?Ft(X):Nt(X))}var k={51:["FALSE",0],52:["TRUE",0],70:["LEN",1],80:["SUM",69],81:["AVERAGEA",69],82:["COUNTA",69],83:["MINA",69],84:["MAXA",69],111:["T",1]},b=["","","","","","","","","","+","-","*","/","^","=","<>","<=",">=","<",">","","","","","&","","","","","","",""];function G(I){var X=[{c:0,r:0},{t:"n",v:0},0];return X[0].r=I.read_shift(2),X[3]=I[I.l++],X[0].c=I[I.l++],X}function w(I,X,R,D){var Z=K(6+D.length);Z.write_shift(2,I),Z.write_shift(1,R),Z.write_shift(1,X),Z.write_shift(1,39);for(var me=0;me<D.length;++me){var le=D.charCodeAt(me);Z.write_shift(1,le>=128?95:le)}return Z.write_shift(1,0),Z}function M(I,X){var R=G(I),D=I.read_shift(4),Z=I.read_shift(4),me=I.read_shift(2);if(65535==me)return 0===D&&3221225472===Z?(R[1].t="e",R[1].v=15):0===D&&3489660928===Z?(R[1].t="e",R[1].v=42):R[1].v=0,R;var le=32768&me;return me=(32767&me)-16446,R[1].v=(1-2*le)*(Z*Math.pow(2,me+32)+D*Math.pow(2,me)),R}function H(I,X,R,D){var Z=K(14);if(Z.write_shift(2,I),Z.write_shift(1,R),Z.write_shift(1,X),0==D)return Z.write_shift(4,0),Z.write_shift(4,0),Z.write_shift(2,65535),Z;var me=0,le=0,ne=0;return D<0&&(me=1,D=-D),le=0|Math.log2(D),!(2147483648&(ne=(D/=Math.pow(2,le-31))>>>0))&&(++le,ne=(D/=2)>>>0),D-=ne,ne|=2147483648,ne>>>=0,D*=Math.pow(2,32),Z.write_shift(4,D>>>0),Z.write_shift(4,ne),Z.write_shift(2,le+=16383+(me?32768:0)),Z}function oe(I,X){var R=G(I),D=I.read_shift(8,"f");return R[1].v=D,R}function ae(I,X){return 0==I[I.l+X-1]?I.read_shift(X,"cstr"):""}function ge(I,X){var R=K(5+I.length);R.write_shift(2,14e3),R.write_shift(2,X);for(var D=0;D<I.length;++D){var Z=I.charCodeAt(D);R[R.l++]=Z>127?95:Z}return R[R.l++]=0,R}var Fe={0:{n:"BOF",f:Jt},1:{n:"EOF"},2:{n:"CALCMODE"},3:{n:"CALCORDER"},4:{n:"SPLIT"},5:{n:"SYNC"},6:{n:"RANGE",f:function l(I,X,R){var D={s:{c:0,r:0},e:{c:0,r:0}};return 8==X&&R.qpro?(D.s.c=I.read_shift(1),I.l++,D.s.r=I.read_shift(2),D.e.c=I.read_shift(1),I.l++,D.e.r=I.read_shift(2),D):(D.s.c=I.read_shift(2),D.s.r=I.read_shift(2),12==X&&R.qpro&&(I.l+=2),D.e.c=I.read_shift(2),D.e.r=I.read_shift(2),12==X&&R.qpro&&(I.l+=2),65535==D.s.c&&(D.s.c=D.e.c=D.s.r=D.e.r=0),D)}},7:{n:"WINDOW1"},8:{n:"COLW1"},9:{n:"WINTWO"},10:{n:"COLW2"},11:{n:"NAME"},12:{n:"BLANK"},13:{n:"INTEGER",f:function f(I,X,R){var D=d(I,0,R);return D[1].v=I.read_shift(2,"i"),D}},14:{n:"NUMBER",f:function g(I,X,R){var D=d(I,0,R);return D[1].v=I.read_shift(8,"f"),D}},15:{n:"LABEL",f:p},16:{n:"FORMULA",f:function _(I,X,R){var D=I.l+X,Z=d(I,0,R);if(Z[1].v=I.read_shift(8,"f"),R.qpro)I.l=D;else{var me=I.read_shift(2);(function A(I,X){fn(I,0);for(var R=[],D=0,Z="",me="",le="",ce="";I.l<I.length;){var ne=I[I.l++];switch(ne){case 0:R.push(I.read_shift(8,"f"));break;case 1:me=v(X[0].c,I.read_shift(2),!0),Z=v(X[0].r,I.read_shift(2),!1),R.push(me+Z);break;case 2:var Le=v(X[0].c,I.read_shift(2),!0),E=v(X[0].r,I.read_shift(2),!1);me=v(X[0].c,I.read_shift(2),!0),Z=v(X[0].r,I.read_shift(2),!1),R.push(Le+E+":"+me+Z);break;case 3:if(I.l<I.length)return void console.error("WK1 premature formula end");break;case 4:R.push("("+R.pop()+")");break;case 5:R.push(I.read_shift(2));break;case 6:for(var mt="";ne=I[I.l++];)mt+=String.fromCharCode(ne);R.push('"'+mt.replace(/"/g,'""')+'"');break;case 8:R.push("-"+R.pop());break;case 23:R.push("+"+R.pop());break;case 22:R.push("NOT("+R.pop()+")");break;case 20:case 21:ce=R.pop(),le=R.pop(),R.push(["AND","OR"][ne-20]+"("+le+","+ce+")");break;default:if(ne<32&&b[ne])ce=R.pop(),le=R.pop(),R.push(le+b[ne]+ce);else{if(!k[ne])return ne<=7?console.error("WK1 invalid opcode "+ne.toString(16)):ne<=24?console.error("WK1 unsupported op "+ne.toString(16)):ne<=30?console.error("WK1 invalid opcode "+ne.toString(16)):ne<=115?console.error("WK1 unsupported function opcode "+ne.toString(16)):console.error("WK1 unrecognized opcode "+ne.toString(16));if(69==(D=k[ne][1])&&(D=I[I.l++]),D>R.length)return void console.error("WK1 bad formula parse 0x"+ne.toString(16)+":|"+R.join("|")+"|");var qe=R.slice(-D);R.length-=D,R.push(k[ne][0]+"("+qe.join(",")+")")}}}1==R.length?X[1].f=""+R[0]:console.error("WK1 bad formula parse |"+R.join("|")+"|")})(I.slice(I.l,I.l+me),Z),I.l+=me}return Z}},24:{n:"TABLE"},25:{n:"ORANGE"},26:{n:"PRANGE"},27:{n:"SRANGE"},28:{n:"FRANGE"},29:{n:"KRANGE1"},32:{n:"HRANGE"},35:{n:"KRANGE2"},36:{n:"PROTEC"},37:{n:"FOOTER"},38:{n:"HEADER"},39:{n:"SETUP"},40:{n:"MARGINS"},41:{n:"LABELFMT"},42:{n:"TITLES"},43:{n:"SHEETJS"},45:{n:"GRAPH"},46:{n:"NGRAPH"},47:{n:"CALCCOUNT"},48:{n:"UNFORMATTED"},49:{n:"CURSORW12"},50:{n:"WINDOW"},51:{n:"STRING",f:p},55:{n:"PASSWORD"},56:{n:"LOCKED"},60:{n:"QUERY"},61:{n:"QUERYNAME"},62:{n:"PRINT"},63:{n:"PRINTNAME"},64:{n:"GRAPH2"},65:{n:"GRAPHNAME"},66:{n:"ZOOM"},67:{n:"SYMSPLIT"},68:{n:"NSROWS"},69:{n:"NSCOLS"},70:{n:"RULER"},71:{n:"NNAME"},72:{n:"ACOMM"},73:{n:"AMACRO"},74:{n:"PARSE"},102:{n:"PRANGES??"}
1,103:{n:"RRANGES??"},104:{n:"FNAME??"},105:{n:"MRANGES??"},204:{n:"SHEETNAMECS",f:ae},222:{n:"SHEETNAMELP",f:function ye(I,X){var R=I[I.l++];R>X-1&&(R=X-1);for(var D="";D.length<R;)D+=String.fromCharCode(I[I.l++]);return D}},65535:{n:""}},te={0:{n:"BOF"},1:{n:"EOF"},2:{n:"PASSWORD"},3:{n:"CALCSET"},4:{n:"WINDOWSET"},5:{n:"SHEETCELLPTR"},6:{n:"SHEETLAYOUT"},7:{n:"COLUMNWIDTH"},8:{n:"HIDDENCOLUMN"},9:{n:"USERRANGE"},10:{n:"SYSTEMRANGE"},11:{n:"ZEROFORCE"},12:{n:"SORTKEYDIR"},13:{n:"FILESEAL"},14:{n:"DATAFILLNUMS"},15:{n:"PRINTMAIN"},16:{n:"PRINTSTRING"},17:{n:"GRAPHMAIN"},18:{n:"GRAPHSTRING"},19:{n:"??"},20:{n:"ERRCELL"},21:{n:"NACELL"},22:{n:"LABEL16",f:function j(I,X){var R=G(I);return R[1].t="s",R[1].v=I.read_shift(X-4,"cstr"),R}},23:{n:"NUMBER17",f:M},24:{n:"NUMBER18",f:function O(I,X){var R=G(I);R[1].v=I.read_shift(2);var D=R[1].v>>1;if(1&R[1].v)switch(7&D){case 0:D=5e3*(D>>3);break;case 1:D=500*(D>>3);break;case 2:D=(D>>3)/20;break;case 3:D=(D>>3)/200;break;case 4:D=(D>>3)/2e3;break;case 5:D=(D>>3)/2e4;break;case 6:D=(D>>3)/16;break;case 7:D=(D>>3)/64}return R[1].v=D,R}},25:{n:"FORMULA19",f:function z(I,X){var R=M(I);return I.l+=X-14,R}},26:{n:"FORMULA1A"},27:{n:"XFORMAT",f:function He(I,X){for(var R={},D=I.l+X;I.l<D;){var Z=I.read_shift(2);if(14e3==Z){for(R[Z]=[0,""],R[Z][0]=I.read_shift(2);I[I.l];)R[Z][1]+=String.fromCharCode(I[I.l]),I.l++;I.l++}}return R}},28:{n:"DTLABELMISC"},29:{n:"DTLABELCELL"},30:{n:"GRAPHWINDOW"},31:{n:"CPA"},32:{n:"LPLAUTO"},33:{n:"QUERY"},34:{n:"HIDDENSHEET"},35:{n:"??"},37:{n:"NUMBER25",f:function P(I,X){var R=G(I),D=I.read_shift(4);return R[1].v=D>>6,R}},38:{n:"??"},39:{n:"NUMBER27",f:oe},40:{n:"FORMULA28",f:function ve(I,X){var R=oe(I);return I.l+=X-10,R}},142:{n:"??"},147:{n:"??"},150:{n:"??"},151:{n:"??"},152:{n:"??"},153:{n:"??"},154:{n:"??"},155:{n:"??"},156:{n:"??"},163:{n:"??"},174:{n:"??"},175:{n:"??"},176:{n:"??"},177:{n:"??"},184:{n:"??"},185:{n:"??"},186:{n:"??"},187:{n:"??"},188:{n:"??"},195:{n:"??"},201:{n:"??"},204:{n:"SHEETNAMECS",f:ae},205:{n:"??"},206:{n:"??"},207:{n:"??"},208:{n:"??"},256:{n:"??"},259:{n:"??"},260:{n:"??"},261:{n:"??"},262:{n:"??"},263:{n:"??"},265:{n:"??"},266:{n:"??"},267:{n:"??"},268:{n:"??"},270:{n:"??"},271:{n:"??"},384:{n:"??"},389:{n:"??"},390:{n:"??"},393:{n:"??"},396:{n:"??"},512:{n:"??"},514:{n:"??"},513:{n:"??"},516:{n:"??"},517:{n:"??"},640:{n:"??"},641:{n:"??"},642:{n:"??"},643:{n:"??"},644:{n:"??"},645:{n:"??"},646:{n:"??"},647:{n:"??"},648:{n:"??"},658:{n:"??"},659:{n:"??"},660:{n:"??"},661:{n:"??"},662:{n:"??"},665:{n:"??"},666:{n:"??"},768:{n:"??"},772:{n:"??"},1537:{n:"SHEETINFOQP",f:function ke(I,X,R){if(R.qpro&&!(X<21)){var D=I.read_shift(1);return I.l+=17,I.l+=1,I.l+=2,[D,I.read_shift(X-21,"cstr")]}}},1600:{n:"??"},1602:{n:"??"},1793:{n:"??"},1794:{n:"??"},1795:{n:"??"},1796:{n:"??"},1920:{n:"??"},2048:{n:"??"},2049:{n:"??"},2052:{n:"??"},2688:{n:"??"},10998:{n:"??"},12849:{n:"??"},28233:{n:"??"},28484:{n:"??"},65535:{n:""}};return{sheet_to_wk1:function r(I,X){var R=X||{};if(+R.codepage>=0&&qn(+R.codepage),"string"==R.type)throw new Error("Cannot write WK1 to JS string");var D=En(),Z=Ke(I["!ref"]),me=Array.isArray(I),le=[];pe(D,0,function s(I){var X=K(2);return X.write_shift(2,I),X}(1030)),pe(D,6,function c(I){var X=K(8);return X.write_shift(2,I.s.c),X.write_shift(2,I.s.r),X.write_shift(2,I.e.c),X.write_shift(2,I.e.r),X}(Z));for(var ce=Math.min(Z.e.r,8191),ne=Z.s.r;ne<=ce;++ne)for(var Le=Nt(ne),E=Z.s.c;E<=Z.e.c;++E){ne===Z.s.r&&(le[E]=Ft(E));var qe=me?(I[ne]||[])[E]:I[le[E]+Le];qe&&"z"!=qe.t&&("n"==qe.t?(0|qe.v)==qe.v&&qe.v>=-32768&&qe.v<=32767?pe(D,13,h(ne,E,qe.v)):pe(D,14,m(ne,E,qe.v)):pe(D,15,u(ne,E,Cr(qe).slice(0,239))))}return pe(D,1),D.end()},book_to_wk3:function i(I,X){var R=X||{};if(+R.codepage>=0&&qn(+R.codepage),"string"==R.type)throw new Error("Cannot write WK3 to JS string");var D=En();pe(D,0,function o(I){var X=K(26);X.write_shift(2,4096),X.write_shift(2,4),X.write_shift(4,0);for(var R=0,D=0,Z=0,me=0;me<I.SheetNames.length;++me){var ce=I.Sheets[I.SheetNames[me]];if(ce&&ce["!ref"]){++Z;var ne=Un(ce["!ref"]);R<ne.e.r&&(R=ne.e.r),D<ne.e.c&&(D=ne.e.c)}}return R>8191&&(R=8191),X.write_shift(2,R),X.write_shift(1,Z),X.write_shift(1,D),X.write_shift(2,0),X.write_shift(2,0),X.write_shift(1,1),X.write_shift(1,2),X.write_shift(4,0),X.write_shift(4,0),X}(I));for(var Z=0,me=0;Z<I.SheetNames.length;++Z)(I.Sheets[I.SheetNames[Z]]||{})["!ref"]&&pe(D,27,ge(I.SheetNames[Z],me++));var le=0;for(Z=0;Z<I.SheetNames.length;++Z){var ce=I.Sheets[I.SheetNames[Z]];if(ce&&ce["!ref"]){for(var ne=Ke(ce["!ref"]),Le=Array.isArray(ce),E=[],mt=Math.min(ne.e.r,8191),qe=ne.s.r;qe<=mt;++qe)for(var ht=Nt(qe),Je=ne.s.c;Je<=ne.e.c;++Je){qe===ne.s.r&&(E[Je]=Ft(Je));var Vt=Le?(ce[qe]||[])[Je]:ce[E[Je]+ht];Vt&&"z"!=Vt.t&&("n"==Vt.t?pe(D,23,H(qe,Je,le,Vt.v)):pe(D,22,w(qe,Je,le,Cr(Vt).slice(0,239))))}++le}}return pe(D,1),D.end()},to_workbook:function a(I,X){switch(X.type){case"base64":return t(Bn(Gn(I)),X);case"binary":return t(Bn(I),X);case"buffer":case"array":return t(I,X)}throw"Unsupported type "+X.type}}}(),qy=function(){var n=_a("t"),a=_a("rPr");function t(s){var o=s.match(n);if(!o)return{t:"s",v:""};var l={t:"s",v:tt(o[1])},c=s.match(a);return c&&(l.s=function zy(n){var a={},t=n.match(_n),r=0,i=!1;if(t)for(;r!=t.length;++r){var s=Me(t[r]);switch(s[0].replace(/\w*:/g,"")){case"<condense":case"<extend":break;case"<shadow":if(!s.val)break;case"<shadow>":case"<shadow/>":a.shadow=1;break;case"</shadow>":break;case"<charset":if("1"==s.val)break;a.cp=po[parseInt(s.val,10)];break;case"<outline":if(!s.val)break;case"<outline>":case"<outline/>":a.outline=1;break;case"</outline>":break;case"<rFont":a.name=s.val;break;case"<sz":a.sz=s.val;break;case"<strike":if(!s.val)break;case"<strike>":case"<strike/>":a.strike=1;break;case"</strike>":break;case"<u":if(!s.val)break;switch(s.val){case"double":a.uval="double";break;case"singleAccounting":a.uval="single-accounting";break;case"doubleAccounting":a.uval="double-accounting"}case"<u>":case"<u/>":a.u=1;break;case"</u>":break;case"<b":if("0"==s.val)break;case"<b>":case"<b/>":a.b=1;break;case"</b>":break;case"<i":if("0"==s.val)break;case"<i>":case"<i/>":a.i=1;break;case"</i>":break;case"<color":s.rgb&&(a.color=s.rgb.slice(2,8));break;case"<color>":case"<color/>":case"</color>":break;case"<family":a.family=s.val;break;case"<family>":case"<family/>":case"</family>":break;case"<vertAlign":a.valign=s.val;break;case"<vertAlign>":case"<vertAlign/>":case"</vertAlign>":case"<scheme":case"<scheme>":case"<scheme/>":case"</scheme>":case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":i=!0;break;case"</ext>":i=!1;break;
1default:if(47!==s[0].charCodeAt(1)&&!i)throw new Error("Unrecognized rich format "+s[0])}}return a}(c[1])),l}var r=/<(?:\w+:)?r>/g,i=/<\/(?:\w+:)?r>/;return function(o){return o.replace(r,"").split(i).map(t).filter(function(l){return l.v})}}(),Jy=function(){var a=/(\r\n|\n)/g;function r(i){var s=[[],i.v,[]];return i.v?(i.s&&function t(i,s,o){var l=[];i.u&&l.push("text-decoration: underline;"),i.uval&&l.push("text-underline-style:"+i.uval+";"),i.sz&&l.push("font-size:"+i.sz+"pt;"),i.outline&&l.push("text-effect: outline;"),i.shadow&&l.push("text-shadow: auto;"),s.push('<span style="'+l.join("")+'">'),i.b&&(s.push("<b>"),o.push("</b>")),i.i&&(s.push("<i>"),o.push("</i>")),i.strike&&(s.push("<s>"),o.push("</s>"));var c=i.valign||"";"superscript"==c||"super"==c?c="sup":"subscript"==c&&(c="sub"),""!=c&&(s.push("<"+c+">"),o.push("</"+c+">")),o.push("</span>")}(i.s,s[0],s[2]),s[0].join("")+s[1].replace(a,"<br/>")+s[2].join("")):""}return function(s){return s.map(r).join("")}}(),Ky=/<(?:\w+:)?t[^>]*>([^<]*)<\/(?:\w+:)?t>/g,Qy=/<(?:\w+:)?r>/,Zy=/<(?:\w+:)?rPh.*?>([\s\S]*?)<\/(?:\w+:)?rPh>/g;function Qo(n,a){var t=!a||a.cellHTML,r={};return n?(n.match(/^\s*<(?:\w+:)?t[^>]*>/)?(r.t=tt(gt(n.slice(n.indexOf(">")+1).split(/<\/(?:\w+:)?t>/)[0]||"")),r.r=gt(n),t&&(r.h=Co(r.t))):n.match(Qy)&&(r.r=gt(n),r.t=tt(gt((n.replace(Zy,"").match(Ky)||[]).join("").replace(_n,""))),t&&(r.h=Jy(qy(r.r)))),r):{t:""}}var eF=/<(?:\w+:)?sst([^>]*)>([\s\S]*)<\/(?:\w+:)?sst>/,tF=/<(?:\w+:)?(?:si|sstItem)>/g,nF=/<\/(?:\w+:)?(?:si|sstItem)>/;function yp(n){for(var a=[],t=n.split(""),r=0;r<t.length;++r)a[r]=t[r].charCodeAt(0);return a}function Pr(n,a){var t={};return t.Major=n.read_shift(2),t.Minor=n.read_shift(2),a>=4&&(n.l+=a-4),t}function pF(n){for(var a=n.read_shift(4),t=n.l+a-4,r={},i=n.read_shift(4),s=[];i-- >0;)s.push({t:n.read_shift(4),v:n.read_shift(0,"lpp4")});if(r.name=n.read_shift(0,"lpp4"),r.comps=s,n.l!=t)throw new Error("Bad DataSpaceMapEntry: "+n.l+" != "+t);return r}function Fp(n,a){var t=n.l+a,r={};r.Flags=63&n.read_shift(4),n.l+=4,r.AlgID=n.read_shift(4);var i=!1;switch(r.AlgID){case 26126:case 26127:case 26128:i=36==r.Flags;break;case 26625:i=4==r.Flags;break;case 0:i=16==r.Flags||4==r.Flags||36==r.Flags;break;default:throw"Unrecognized encryption algorithm: "+r.AlgID}if(!i)throw new Error("Encryption Flags/AlgID mismatch");return r.AlgIDHash=n.read_shift(4),r.KeySize=n.read_shift(4),r.ProviderType=n.read_shift(4),n.l+=8,r.CSPName=n.read_shift(t-n.l>>1,"utf16le"),n.l=t,r}function Sp(n,a){var t={},r=n.l+a;return n.l+=4,t.Salt=n.slice(n.l,n.l+16),n.l+=16,t.Verifier=n.slice(n.l,n.l+16),n.l+=16,n.read_shift(4),t.VerifierHash=n.slice(n.l,r),n.l=r,t}function _F(n){if(36!=(63&n.read_shift(4)))throw new Error("EncryptionInfo mismatch");var t=n.read_shift(4);return{t:"Std",h:Fp(n,t),v:Sp(n,n.length-n.l)}}function xF(){throw new Error("File is password-protected: ECMA-376 Extensible")}function vF(n){var a=["saltSize","blockSize","keyBits","hashSize","cipherAlgorithm","cipherChaining","hashAlgorithm","saltValue"];n.l+=4;var t=n.read_shift(n.length-n.l,"utf8"),r={};return t.replace(_n,function(s){var o=Me(s);switch(vr(o[0])){case"<?xml":case"<encryption":case"</encryption>":case"</keyEncryptors>":case"</keyEncryptor>":break;case"<keyData":a.forEach(function(l){r[l]=o[l]});break;case"<dataIntegrity":r.encryptedHmacKey=o.encryptedHmacKey,r.encryptedHmacValue=o.encryptedHmacValue;break;case"<keyEncryptors>":case"<keyEncryptors":r.encs=[];break;case"<keyEncryptor":r.uri=o.uri;break;case"<encryptedKey":r.encs.push(o);break;default:throw o[0]}}),r}var Ep=function(){var n=[187,255,255,186,255,255,185,128,0,190,15,0,191,15,0],a=[57840,7439,52380,33984,4364,3600,61902,12606,6258,57657,54287,34041,10252,43370,20163],t=[44796,19929,39858,10053,20106,40212,10761,31585,63170,64933,60267,50935,40399,11199,17763,35526,1453,2906,5812,11624,23248,885,1770,3540,7080,14160,28320,56640,55369,41139,20807,41614,21821,43642,17621,28485,56970,44341,19019,38038,14605,29210,60195,50791,40175,10751,21502,43004,24537,18387,36774,3949,7898,15796,31592,63184,47201,24803,49606,37805,14203,28406,56812,17824,35648,1697,3394,6788,13576,27152,43601,17539,35078,557,1114,2228,4456,30388,60776,51953,34243,7079,14158,28316,14128,28256,56512,43425,17251,34502,7597,13105,26210,52420,35241,883,1766,3532,4129,8258,16516,33032,4657,9314,18628],i=function(o,l){return function(o){return 255&(o/2|128*o)}(o^l)};return function(o){for(var l=yp(o),c=function(o){for(var l=a[o.length-1],c=104,d=o.length-1;d>=0;--d)for(var p=o[d],u=0;7!=u;++u)64&p&&(l^=t[c]),p*=2,--c;return l}(l),d=l.length,p=Wr(16),u=0;16!=u;++u)p[u]=0;var g;for(!(1&~d)&&(p[d]=i(n[0],c>>8),p[--d]=i(l[l.length-1],255&c));d>0;)p[--d]=i(l[d],c>>8),p[--d]=i(l[d],255&c);for(d=15,g=15-l.length;g>0;
1)p[d]=i(n[g],c>>8),--g,p[--d]=i(l[d],255&c),--d,--g;return p}}();var Ip=function(){function n(i,s){switch(s.type){case"base64":return a(Gn(i),s);case"binary":return a(i,s);case"buffer":return a(We&&Buffer.isBuffer(i)?i.toString("binary"):Hr(i),s);case"array":return a(fi(i),s)}throw new Error("Unrecognized type "+s.type)}function a(i,s){var l=(s||{}).dense?[]:{},c=i.match(/\\trowd.*?\\row\b/g);if(!c.length)throw new Error("RTF missing table");var d={s:{c:0,r:0},e:{c:0,r:c.length-1}};return c.forEach(function(p,u){Array.isArray(l)&&(l[u]=[]);for(var g,f=/\\\w+\b/g,h=0,m=-1;g=f.exec(p);){if("\\cell"===g[0]){var _=p.slice(h,f.lastIndex-g[0].length);if(" "==_[0]&&(_=_.slice(1)),++m,_.length){var v={v:_,t:"s"};Array.isArray(l)?l[u][m]=v:l[Pe({r:u,c:m})]=v}}h=f.lastIndex}m>d.e.c&&(d.e.c=m)}),l["!ref"]=Ge(d),l}return{to_workbook:function t(i,s){return Qr(n(i,s),s)},to_sheet:n,from_sheet:function r(i){for(var l,s=["{\\rtf1\\ansi"],o=Ke(i["!ref"]),c=Array.isArray(i),d=o.s.r;d<=o.e.r;++d){s.push("\\trowd\\trautofit1");for(var p=o.s.c;p<=o.e.c;++p)s.push("\\cellx"+(p+1));for(s.push("\\pard\\intbl"),p=o.s.c;p<=o.e.c;++p){var u=Pe({r:d,c:p});(l=c?(i[d]||[])[p]:i[u])&&(null!=l.v||l.f&&!l.F)&&(s.push(" "+(l.w||(Cr(l),l.w))),s.push("\\cell"))}s.push("\\pard\\intbl\\row")}return s.join("")+"}"}}}();function Fa(n){for(var a=0,t=1;3!=a;++a)t=256*t+(n[a]>255?255:n[a]<0?0:n[a]);return t.toString(16).toUpperCase().slice(1)}function Ms(n,a){if(0===a)return n;var t=function EF(n){var a=n[0]/255,t=n[1]/255,r=n[2]/255,i=Math.max(a,t,r),s=Math.min(a,t,r),o=i-s;if(0===o)return[0,0,a];var c,l=0,d=i+s;switch(c=o/(d>1?2-d:d),i){case a:l=((t-r)/o+6)%6;break;case t:l=(r-a)/o+2;break;case r:l=(a-t)/o+4}return[l/6,c,d/2]}(function SF(n){var a=n.slice("#"===n[0]?1:0).slice(0,6);return[parseInt(a.slice(0,2),16),parseInt(a.slice(2,4),16),parseInt(a.slice(4,6),16)]}(n));return t[2]=a<0?t[2]*(1+a):1-(1-t[2])*(1-a),Fa(function IF(n){var c,t=n[1],r=n[2],i=2*t*(r<.5?r:1-r),s=r-i/2,o=[s,s,s],l=6*n[0];if(0!==t)switch(0|l){case 0:case 6:c=i*l,o[0]+=i,o[1]+=c;break;case 1:o[0]+=c=i*(2-l),o[1]+=i;break;case 2:c=i*(l-2),o[1]+=i,o[2]+=c;break;case 3:o[1]+=c=i*(4-l),o[2]+=i;break;case 4:c=i*(l-4),o[2]+=i,o[0]+=c;break;case 5:o[2]+=c=i*(6-l),o[0]+=i}for(var d=0;3!=d;++d)o[d]=Math.round(255*o[d]);return o}(t))}var kn=6;function Sa(n){return Math.floor((n+Math.round(128/kn)/256)*kn)}function Ea(n){return Math.floor((n-5)/kn*100+.5)/100}function Ps(n){return Math.round((n*kn+5)/kn*256)/256}function el(n){return Ps(Ea(Sa(n)))}function tl(n){var a=Math.abs(n-el(n)),t=kn;if(a>.005)for(kn=1;kn<15;++kn)Math.abs(n-el(n))<=a&&(a=Math.abs(n-el(n)),t=kn);kn=t}function Fi(n){n.width?(n.wpx=Sa(n.width),n.wch=Ea(n.wpx),n.MDW=kn):n.wpx?(n.wch=Ea(n.wpx),n.width=Ps(n.wch),n.MDW=kn):"number"==typeof n.wch&&(n.width=Ps(n.wch),n.wpx=Sa(n.width),n.MDW=kn),n.customWidth&&delete n.customWidth}var Rp=96;function Ia(n){return 96*n/Rp}function Xi(n){return n*Rp/96}var AF={None:"none",Solid:"solid",Gray50:"mediumGray",Gray75:"darkGray",Gray25:"lightGray",HorzStripe:"darkHorizontal",VertStripe:"darkVertical",ReverseDiagStripe:"darkDown",DiagStripe:"darkUp",DiagCross:"darkGrid",ThickDiagCross:"darkTrellis",ThinHorzStripe:"lightHorizontal",ThinVertStripe:"lightVertical",ThinReverseDiagStripe:"lightDown",ThinHorzCross:"lightGrid"},Os=["numFmtId","fillId","fontId","borderId","xfId"],Ns=["applyAlignment","applyBorder","applyFill","applyFont","applyNumberFormat","applyProtection","pivotButton","quotePrefix"],$F=function(){var a=/<(?:\w+:)?numFmts([^>]*)>[\S\s]*?<\/(?:\w+:)?numFmts>/,t=/<(?:\w+:)?cellXfs([^>]*)>[\S\s]*?<\/(?:\w+:)?cellXfs>/,r=/<(?:\w+:)?fills([^>]*)>[\S\s]*?<\/(?:\w+:)?fills>/,i=/<(?:\w+:)?fonts([^>]*)>[\S\s]*?<\/(?:\w+:)?fonts>/,s=/<(?:\w+:)?borders([^>]*)>[\S\s]*?<\/(?:\w+:)?borders>/;return function(l,c,d){var u,p={};return l?((u=(l=l.replace(/<!--([\s\S]*?)-->/gm,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"")).match(a))&&function NF(n,a,t){a.NumberFmt=[];for(var r=Pt(Re),i=0;i<r.length;++i)a.NumberFmt[r[i]]=Re[r[i]];var s=n[0].match(_n);if(s)for(i=0;i<s.length;++i){var o=Me(s[i]);switch(vr(o[0])){case"<numFmts":case"</numFmts>":case"<numFmts/>":case"<numFmts>":case"</numFmt>":break;case"<numFmt":var l=tt(gt(o.formatCode)),c=parseInt(o.numFmtId,10);if(a.NumberFmt[c]=l,c>0){if(c>392){for(c=392;c>60&&null!=a.NumberFmt[c];--c);a.NumberFmt[c]=l}xr(l,c)}break;default:if(t.WTF)throw new Error("unrecognized "+o[0]+" in numFmts")}}}(u,p,d),(u=l.match(i))&&function OF(n,a,t,r){a.Fonts=[];var i={},s=!1;
1(n[0].match(_n)||[]).forEach(function(o){var l=Me(o);switch(vr(l[0])){case"<fonts":case"<fonts>":case"</fonts>":case"<font":case"<font>":case"<name/>":case"</name>":case"<sz/>":case"</sz>":case"<vertAlign/>":case"</vertAlign>":case"<family/>":case"</family>":case"<scheme/>":case"</scheme>":case"<color/>":case"</color>":case"<extLst":case"<extLst>":case"</extLst>":break;case"</font>":case"<font/>":a.Fonts.push(i),i={};break;case"<name":l.val&&(i.name=gt(l.val));break;case"<b":i.bold=l.val?yt(l.val):1;break;case"<b/>":i.bold=1;break;case"<i":i.italic=l.val?yt(l.val):1;break;case"<i/>":i.italic=1;break;case"<u":switch(l.val){case"none":i.underline=0;break;case"single":i.underline=1;break;case"double":i.underline=2;break;case"singleAccounting":i.underline=33;break;case"doubleAccounting":i.underline=34}break;case"<u/>":i.underline=1;break;case"<strike":i.strike=l.val?yt(l.val):1;break;case"<strike/>":i.strike=1;break;case"<outline":i.outline=l.val?yt(l.val):1;break;case"<outline/>":i.outline=1;break;case"<shadow":i.shadow=l.val?yt(l.val):1;break;case"<shadow/>":i.shadow=1;break;case"<condense":i.condense=l.val?yt(l.val):1;break;case"<condense/>":i.condense=1;break;case"<extend":i.extend=l.val?yt(l.val):1;break;case"<extend/>":i.extend=1;break;case"<sz":l.val&&(i.sz=+l.val);break;case"<vertAlign":l.val&&(i.vertAlign=l.val);break;case"<family":l.val&&(i.family=parseInt(l.val,10));break;case"<scheme":l.val&&(i.scheme=l.val);break;case"<charset":if("1"==l.val)break;l.codepage=po[parseInt(l.val,10)];break;case"<color":if(i.color||(i.color={}),l.auto&&(i.color.auto=yt(l.auto)),l.rgb)i.color.rgb=l.rgb.slice(-6);else if(l.indexed){i.color.index=parseInt(l.indexed,10);var c=bi[i.color.index];81==i.color.index&&(c=bi[1]),c||(c=bi[1]),i.color.rgb=c[0].toString(16)+c[1].toString(16)+c[2].toString(16)}else l.theme&&(i.color.theme=parseInt(l.theme,10),l.tint&&(i.color.tint=parseFloat(l.tint)),l.theme&&t.themeElements&&t.themeElements.clrScheme&&(i.color.rgb=Ms(t.themeElements.clrScheme[i.color.theme].rgb,i.color.tint||0)));break;case"<AlternateContent":case"<ext":s=!0;break;case"</AlternateContent>":case"</ext>":s=!1;break;default:if(r&&r.WTF&&!s)throw new Error("unrecognized "+l[0]+" in fonts")}})}(u,p,c,d),(u=l.match(r))&&function PF(n,a,t,r){a.Fills=[];var i={},s=!1;(n[0].match(_n)||[]).forEach(function(o){var l=Me(o);switch(vr(l[0])){case"<fills":case"<fills>":case"</fills>":case"</fill>":case"<gradientFill>":case"<patternFill/>":case"</patternFill>":case"<bgColor/>":case"</bgColor>":case"<fgColor/>":case"</fgColor>":case"<stop":case"<stop/>":case"</stop>":case"<color":case"<color/>":case"</color>":case"<extLst":case"<extLst>":case"</extLst>":break;case"<fill>":case"<fill":case"<fill/>":a.Fills.push(i={});break;case"<gradientFill":case"</gradientFill>":a.Fills.push(i),i={};break;case"<patternFill":case"<patternFill>":l.patternType&&(i.patternType=l.patternType);break;case"<bgColor":i.bgColor||(i.bgColor={}),l.indexed&&(i.bgColor.indexed=parseInt(l.indexed,10)),l.theme&&(i.bgColor.theme=parseInt(l.theme,10)),l.tint&&(i.bgColor.tint=parseFloat(l.tint)),l.rgb&&(i.bgColor.rgb=l.rgb.slice(-6));break;case"<fgColor":i.fgColor||(i.fgColor={}),l.theme&&(i.fgColor.theme=parseInt(l.theme,10)),l.tint&&(i.fgColor.tint=parseFloat(l.tint)),null!=l.rgb&&(i.fgColor.rgb=l.rgb.slice(-6));break;case"<ext":s=!0;break;case"</ext>":s=!1;break;default:if(r&&r.WTF&&!s)throw new Error("unrecognized "+l[0]+" in fills")}})}(u,p,0,d),(u=l.match(s))&&function MF(n,a,t,r){a.Borders=[];var i={},s=!1;(n[0].match(_n)||[]).forEach(function(o){var l=Me(o);switch(vr(l[0])){case"<borders":case"<borders>":case"</borders>":case"</border>":case"<left/>":case"<left":case"<left>":case"</left>":case"<right/>":case"<right":case"<right>":case"</right>":case"<top/>":case"<top":case"<top>":case"</top>":case"<bottom/>":case"<bottom":case"<bottom>":case"</bottom>":case"<diagonal":case"<diagonal>":case"<diagonal/>":case"</diagonal>":case"<horizontal":case"<horizontal>":case"<horizontal/>":case"</horizontal>":case"<vertical":case"<vertical>":case"<vertical/>":case"</vertical>":case"<start":case"<start>":case"<start/>":case"</start>":case"<end":case"<end>":case"<end/>":case"</end>":case"<color":case"<color>":case"<color/>":case"</color>":case"<extLst":case"<extLst>":case"</extLst>":break;case"<border":case"<border>":case"<border/>":i={},l.diagonalUp&&(i.diagonalUp=yt(l.diagonalUp)),l.diagonalDown&&(i.diagonalDown=yt(l.diagonalDown)),a.Borders.push(i);break;case"<ext":s=!0;break;case"</ext>":s=!1;break;default:if(r&&r.WTF&&!s)throw new Error("unrecognized "+l[0]+" in borders")}})}(u,p,0,d),(u=l.match(t))&&function BF(n,a,t){a.CellXf=[];var r,i=!1;
1(n[0].match(_n)||[]).forEach(function(s){var o=Me(s),l=0;switch(vr(o[0])){case"<cellXfs":case"<cellXfs>":case"<cellXfs/>":case"</cellXfs>":case"</xf>":case"</alignment>":case"<protection":case"</protection>":case"<protection/>":case"<extLst":case"<extLst>":case"</extLst>":break;case"<xf":case"<xf/>":for(delete(r=o)[0],l=0;l<Os.length;++l)r[Os[l]]&&(r[Os[l]]=parseInt(r[Os[l]],10));for(l=0;l<Ns.length;++l)r[Ns[l]]&&(r[Ns[l]]=yt(r[Ns[l]]));if(a.NumberFmt&&r.numFmtId>392)for(l=392;l>60;--l)if(a.NumberFmt[r.numFmtId]==a.NumberFmt[l]){r.numFmtId=l;break}a.CellXf.push(r);break;case"<alignment":case"<alignment/>":var c={};o.vertical&&(c.vertical=o.vertical),o.horizontal&&(c.horizontal=o.horizontal),null!=o.textRotation&&(c.textRotation=o.textRotation),o.indent&&(c.indent=o.indent),o.wrapText&&(c.wrapText=yt(o.wrapText)),r.alignment=c;break;case"<AlternateContent":case"<ext":i=!0;break;case"</AlternateContent>":case"</ext>":i=!1;break;default:if(t&&t.WTF&&!i)throw new Error("unrecognized "+o[0]+" in cellXfs")}})}(u,p,d),p):p}}(),HF=xn,qF=xn,dS=["</a:lt1>","</a:dk1>","</a:lt2>","</a:dk2>","</a:accent1>","</a:accent2>","</a:accent3>","</a:accent4>","</a:accent5>","</a:accent6>","</a:hlink>","</a:folHlink>"];function pS(n,a,t){a.themeElements.clrScheme=[];var r={};(n[0].match(_n)||[]).forEach(function(i){var s=Me(i);switch(s[0]){case"<a:clrScheme":case"</a:clrScheme>":break;case"<a:srgbClr":r.rgb=s.val;break;case"<a:sysClr":r.rgb=s.lastClr;break;case"<a:dk1>":case"</a:dk1>":case"<a:lt1>":case"</a:lt1>":case"<a:dk2>":case"</a:dk2>":case"<a:lt2>":case"</a:lt2>":case"<a:accent1>":case"</a:accent1>":case"<a:accent2>":case"</a:accent2>":case"<a:accent3>":case"</a:accent3>":case"<a:accent4>":case"</a:accent4>":case"<a:accent5>":case"</a:accent5>":case"<a:accent6>":case"</a:accent6>":case"<a:hlink>":case"</a:hlink>":case"<a:folHlink>":case"</a:folHlink>":"/"===s[0].charAt(1)?(a.themeElements.clrScheme[dS.indexOf(s[0])]=r,r={}):r.name=s[0].slice(3,s[0].length-1);break;default:if(t&&t.WTF)throw new Error("Unrecognized "+s[0]+" in clrScheme")}})}function uS(){}function fS(){}var mS=/<a:clrScheme([^>]*)>[\s\S]*<\/a:clrScheme>/,hS=/<a:fontScheme([^>]*)>[\s\S]*<\/a:fontScheme>/,gS=/<a:fmtScheme([^>]*)>[\s\S]*<\/a:fmtScheme>/,xS=/<a:themeElements([^>]*)>[\s\S]*<\/a:themeElements>/;function Pp(n,a){(!n||0===n.length)&&(n=function rl(n,a){if(a&&a.themeXLSX)return a.themeXLSX;if(n&&"string"==typeof n.raw)return n.raw;var t=[zt];return t[t.length]='<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">',t[t.length]="<a:themeElements>",t[t.length]='<a:clrScheme name="Office">',t[t.length]='<a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1>',t[t.length]='<a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1>',t[t.length]='<a:dk2><a:srgbClr val="1F497D"/></a:dk2>',t[t.length]='<a:lt2><a:srgbClr val="EEECE1"/></a:lt2>',t[t.length]='<a:accent1><a:srgbClr val="4F81BD"/></a:accent1>',t[t.length]='<a:accent2><a:srgbClr val="C0504D"/></a:accent2>',t[t.length]='<a:accent3><a:srgbClr val="9BBB59"/></a:accent3>',t[t.length]='<a:accent4><a:srgbClr val="8064A2"/></a:accent4>',t[t.length]='<a:accent5><a:srgbClr val="4BACC6"/></a:accent5>',t[t.length]='<a:accent6><a:srgbClr val="F79646"/></a:accent6>',t[t.length]='<a:hlink><a:srgbClr val="0000FF"/></a:hlink>',t[t.length]='<a:folHlink><a:srgbClr val="800080"/></a:folHlink>',t[t.length]="</a:clrScheme>",t[t.length]='<a:fontScheme name="Office">',t[t.length]="<a:majorFont>",t[t.length]='<a:latin typeface="Cambria"/>',t[t.length]='<a:ea typeface=""/>',t[t.length]='<a:cs typeface=""/>',t[t.length]='<a:font script="Jpan" typeface="\uff2d\uff33 \uff30\u30b4\u30b7\u30c3\u30af"/>',t[t.length]='<a:font script="Hang" typeface="\ub9d1\uc740 \uace0\ub515"/>',t[t.length]='<a:font script="Hans" typeface="\u5b8b\u4f53"/>',t[t.length]='<a:font script="Hant" typeface="\u65b0\u7d30\u660e\u9ad4"/>',t[t.length]='<a:font script="Arab" typeface="Times New Roman"/>',t[t.length]='<a:font script="Hebr" typeface="Times New Roman"/>',t[t.length]='<a:font script="Thai" typeface="Tahoma"/>
1',t[t.length]='<a:font script="Ethi" typeface="Nyala"/>',t[t.length]='<a:font script="Beng" typeface="Vrinda"/>',t[t.length]='<a:font script="Gujr" typeface="Shruti"/>',t[t.length]='<a:font script="Khmr" typeface="MoolBoran"/>',t[t.length]='<a:font script="Knda" typeface="Tunga"/>',t[t.length]='<a:font script="Guru" typeface="Raavi"/>',t[t.length]='<a:font script="Cans" typeface="Euphemia"/>',t[t.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',t[t.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',t[t.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',t[t.length]='<a:font script="Thaa" typeface="MV Boli"/>',t[t.length]='<a:font script="Deva" typeface="Mangal"/>',t[t.length]='<a:font script="Telu" typeface="Gautami"/>',t[t.length]='<a:font script="Taml" typeface="Latha"/>',t[t.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',t[t.length]='<a:font script="Orya" typeface="Kalinga"/>',t[t.length]='<a:font script="Mlym" typeface="Kartika"/>',t[t.length]='<a:font script="Laoo" typeface="DokChampa"/>',t[t.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',t[t.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',t[t.length]='<a:font script="Viet" typeface="Times New Roman"/>',t[t.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',t[t.length]='<a:font script="Geor" typeface="Sylfaen"/>',t[t.length]="</a:majorFont>",t[t.length]="<a:minorFont>",t[t.length]='<a:latin typeface="Calibri"/>',t[t.length]='<a:ea typeface=""/>',t[t.length]='<a:cs typeface=""/>',t[t.length]='<a:font script="Jpan" typeface="\uff2d\uff33 \uff30\u30b4\u30b7\u30c3\u30af"/>',t[t.length]='<a:font script="Hang" typeface="\ub9d1\uc740 \uace0\ub515"/>',t[t.length]='<a:font script="Hans" typeface="\u5b8b\u4f53"/>',t[t.length]='<a:font script="Hant" typeface="\u65b0\u7d30\u660e\u9ad4"/>',t[t.length]='<a:font script="Arab" typeface="Arial"/>',t[t.length]='<a:font script="Hebr" typeface="Arial"/>',t[t.length]='<a:font script="Thai" typeface="Tahoma"/>',t[t.length]='<a:font script="Ethi" typeface="Nyala"/>',t[t.length]='<a:font script="Beng" typeface="Vrinda"/>',t[t.length]='<a:font script="Gujr" typeface="Shruti"/>',t[t.length]='<a:font script="Khmr" typeface="DaunPenh"/>',t[t.length]='<a:font script="Knda" typeface="Tunga"/>',t[t.length]='<a:font script="Guru" typeface="Raavi"/>',t[t.length]='<a:font script="Cans" typeface="Euphemia"/>',t[t.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',t[t.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',t[t.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',t[t.length]='<a:font script="Thaa" typeface="MV Boli"/>',t[t.length]='<a:font script="Deva" typeface="Mangal"/>',t[t.length]='<a:font script="Telu" typeface="Gautami"/>',t[t.length]='<a:font script="Taml" typeface="Latha"/>',t[t.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',t[t.length]='<a:font script="Orya" typeface="Kalinga"/>',t[t.length]='<a:font script="Mlym" typeface="Kartika"/>',t[t.length]='<a:font script="Laoo" typeface="DokChampa"/>',t[t.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',t[t.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',t[t.length]='<a:font script="Viet" typeface="Arial"/>',t[t.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',t[t.length]='<a:font script="Geor" typeface="Sylfaen"/>',t[t.length]="</a:minorFont>",t[t.length]="</a:fontScheme>",t[t.length]='<a:fmtScheme name="Office">',t[t.length]="<a:fillStyleLst>",t[t.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',t[t.length]='<a:gradFill rotWithShape="1">',t[t.length]="<a:gsLst>",t[t.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',t[t.length]="</a:gsLst>",t[t.length]='<a:lin ang="16200000" scaled="1"/>',t[t.length]="</a:gradFill>
1",t[t.length]='<a:gradFill rotWithShape="1">',t[t.length]="<a:gsLst>",t[t.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000"/><a:shade val="100000"/><a:satMod val="130000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000"/><a:shade val="100000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',t[t.length]="</a:gsLst>",t[t.length]='<a:lin ang="16200000" scaled="0"/>',t[t.length]="</a:gradFill>",t[t.length]="</a:fillStyleLst>",t[t.length]="<a:lnStyleLst>",t[t.length]='<a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln>',t[t.length]='<a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',t[t.length]='<a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',t[t.length]="</a:lnStyleLst>",t[t.length]="<a:effectStyleLst>",t[t.length]="<a:effectStyle>",t[t.length]="<a:effectLst>",t[t.length]='<a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw>',t[t.length]="</a:effectLst>",t[t.length]="</a:effectStyle>",t[t.length]="<a:effectStyle>",t[t.length]="<a:effectLst>",t[t.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',t[t.length]="</a:effectLst>",t[t.length]="</a:effectStyle>",t[t.length]="<a:effectStyle>",t[t.length]="<a:effectLst>",t[t.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',t[t.length]="</a:effectLst>",t[t.length]='<a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0"/></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000"/></a:lightRig></a:scene3d>',t[t.length]='<a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d>',t[t.length]="</a:effectStyle>",t[t.length]="</a:effectStyleLst>",t[t.length]="<a:bgFillStyleLst>",t[t.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',t[t.length]='<a:gradFill rotWithShape="1">',t[t.length]="<a:gsLst>",t[t.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs>',t[t.length]="</a:gsLst>",t[t.length]='<a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path>',t[t.length]="</a:gradFill>",t[t.length]='<a:gradFill rotWithShape="1">',t[t.length]="<a:gsLst>",t[t.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs>',t[t.length]="</a:gsLst>",t[t.length]='<a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>',t[t.length]="</a:gradFill>",t[t.length]="</a:bgFillStyleLst>",t[t.length]="</a:fmtScheme>",t[t.length]="</a:themeElements>",t[t.length]="<a:objectDefaults>",t[t.length]="<a:spDef>",t[t.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="1"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="3"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="2"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef></a:style>',t[t.length]="</a:spDef>",t[t.length]="<a:lnDef>",t[t.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style>',t[t.length]="</a:lnDef>",t[t.length]="</a:objectDefaults>",t[t.length]="<a:extraClrSchemeLst/>",t[t.length]="</a:theme>",t.join("")}());var t,r={};if(!(t=n.match(xS)))throw new Error("themeElements not found in theme");return function _S(n,a,t){var r;a.themeElements={},[["clrScheme",mS,pS],["fontScheme",hS,uS],["fmtScheme",gS,fS]].forEac
1h(function(i){if(!(r=n.match(i[1])))throw new Error(i[0]+" not found in themeElements");i[2](r,a,t)})}(t[0],r,a),r.raw=n,r}function wS(n){var a=n.read_shift(2),t=n.read_shift(2)-4,r=[a];switch(a){case 4:case 5:case 7:case 8:case 9:case 10:case 11:case 13:r[1]=function CS(n){var a={};switch(a.xclrType=n.read_shift(2),a.nTintShade=n.read_shift(2),a.xclrType){case 0:case 4:n.l+=4;break;case 1:a.xclrValue=function kS(n,a){return xn(n,a)}(n,4);break;case 2:a.xclrValue=ap(n);break;case 3:a.xclrValue=function bS(n){return n.read_shift(4)}(n)}return n.l+=8,a}(n);break;case 6:r[1]=function TS(n,a){return xn(n,a)}(n,t);break;case 14:case 15:r[1]=n.read_shift(1===t?1:2);break;default:throw new Error("Unrecognized ExtProp type: "+a+" "+t)}return r}function FS(n,a){a.forEach(function(t){})}function Gp(n,a,t,r){var s,i=Array.isArray(n);a.forEach(function(o){var l=Rt(o.ref);if(i?(n[l.r]||(n[l.r]=[]),s=n[l.r][l.c]):s=n[o.ref],!s){s={t:"z"},i?n[l.r][l.c]=s:n[o.ref]=s;var c=Ke(n["!ref"]||"BDWGO1000001:A1");c.s.r>l.r&&(c.s.r=l.r),c.e.r<l.r&&(c.e.r=l.r),c.s.c>l.c&&(c.s.c=l.c),c.e.c<l.c&&(c.e.c=l.c);var d=Ge(c);d!==n["!ref"]&&(n["!ref"]=d)}s.c||(s.c=[]);var p={a:o.author,t:o.t,r:o.r,T:t};o.h&&(p.h=o.h);for(var u=s.c.length-1;u>=0;--u){if(!t&&s.c[u].T)return;t&&!s.c[u].T&&s.c.splice(u,1)}if(t&&r)for(u=0;u<r.length;++u)if(p.a==r[u].id){p.a=r[u].name||p.a;break}s.c.push(p)})}var qS=vn,Wi=function(){var n=/(^|[^A-Za-z_])R(\[?-?\d+\]|[1-9]\d*|)C(\[?-?\d+\]|[1-9]\d*|)(?![A-Za-z0-9_])/g,a={r:0,c:0};function t(r,i,s,o){var l=!1,c=!1;0==s.length?c=!0:"["==s.charAt(0)&&(c=!0,s=s.slice(1,-1)),0==o.length?l=!0:"["==o.charAt(0)&&(l=!0,o=o.slice(1,-1));var d=s.length>0?0|parseInt(s,10):0,p=o.length>0?0|parseInt(o,10):0;return l?p+=a.c:--p,c?d+=a.r:--d,i+(l?"":"$")+Ft(p)+(c?"":"$")+Nt(d)}return function(i,s){return a=s,i.replace(n,t)}}(),il=/(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})(?![_.\(A-Za-z0-9])/g,al=function(){return function(a,t){return a.replace(il,function(r,i,s,o,l,c){var d=Ao(o)-(s?0:t.c),p=jo(c)-(l?0:t.r);return i+"R"+(0==p?"":l?p+1:"["+p+"]")+"C"+(0==d?"":s?d+1:"["+d+"]")})}}();function $p(n,a){return n.replace(il,function(t,r,i,s,o,l){return r+("$"==i?i+s:Ft(Ao(s)+a.c))+("$"==o?o+l:Nt(jo(l)+a.r))})}function sE(n,a,t){var i=Un(a).s,s=Rt(t);return $p(n,{r:s.r-i.r,c:s.c-i.c})}function Vp(n){return n.replace(/_xlfn\./g,"")}function Kt(n){n.l+=1}function ei(n,a){var t=n.read_shift(1==a?1:2);return[16383&t,t>>14&1,t>>15&1]}function Up(n,a,t){var r=2;if(t){if(t.biff>=2&&t.biff<=5)return Xp(n);12==t.biff&&(r=4)}var i=n.read_shift(r),s=n.read_shift(r),o=ei(n,2),l=ei(n,2);return{s:{r:i,c:o[0],cRel:o[1],rRel:o[2]},e:{r:s,c:l[0],cRel:l[1],rRel:l[2]}}}function Xp(n){var a=ei(n,2),t=ei(n,2),r=n.read_shift(1),i=n.read_shift(1);return{s:{r:a[0],c:r,cRel:a[1],rRel:a[2]},e:{r:t[0],c:i,cRel:t[1],rRel:t[2]}}}function Yp(n,a,t){if(t&&t.biff>=2&&t.biff<=5)return function cE(n){var a=ei(n,2),t=n.read_shift(1);return{r:a[0],c:t,cRel:a[1],rRel:a[2]}}(n);var r=n.read_shift(t&&12==t.biff?4:2),i=ei(n,2);return{r,c:i[0],cRel:i[1],rRel:i[2]}}function dE(n){var a=n.read_shift(2),t=n.read_shift(2);return{r:a,c:255&t,fQuoted:!!(16384&t),cRel:t>>15,rRel:t>>15}}function Wp(n){var a=1&n[n.l+1];return n.l+=4,[a,1]}function Hp(n){return[n.read_shift(1),n.read_shift(1)]}function BE(n,a){var t=[n.read_shift(1)];if(12==a)switch(t[0]){case 2:t[0]=4;break;case 4:t[0]=16;break;case 0:t[0]=1;break;case 1:t[0]=2}switch(t[0]){case 4:t[1]=$t(n,1)?"TRUE":"FALSE",12!=a&&(n.l+=7);break;case 37:case 16:t[1]=Mr[n[n.l]],n.l+=12==a?4:8;break;case 0:n.l+=8;break;case 1:t[1]=bn(n);break;case 2:t[1]=Ti(n,0,{biff:a>0&&a<8?2:a});break;default:throw new Error("Bad SerAr: "+t[0])}return t}function LE(n,a,t){for(var r=n.read_shift(12==t.biff?4:2),i=[],s=0;s!=r;++s)i.push((12==t.biff?xi:js)(n,8));return i}function $E(n,a,t){var r=0,i=0;12==t.biff?(r=n.read_shift(4),i=n.read_shift(4)):(i=1+n.read_shift(1),r=1+n.read_shift(2)),t.biff>=2&&t.biff<8&&(--r,0==--i&&(i=256));for(var s=0,o=[];s!=r&&(o[s]=[]);++s)for(var l=0;l!=i;++l)o[s][l]=BE(n,t.biff);return o}function Ra(n,a,t){return n.l+=2,[dE(n)]}function sl(n){return n.l+=6,[]}function zp(n){return n.l+=2,[Jt(n),1&n.read_shift(2)]}var oI=["Data","All","Headers","??","?Data2","??","?DataHeaders","??","Totals","??","??","??","?DataTotals","??","??","??","?Current"],qp={1:{n:"PtgExp",f:function AE(n,a,t){return n.l++,t&&12==t.biff?[n.read_shift(4,"i"),0]:[n.read_shift(2),n.read_shift(t&&2==t.biff?1:2)]}},2:{n:"PtgTbl",f:xn},3:{n:"PtgAdd",f:Kt},4:{n:"PtgSub",f:Kt},5:{n:"PtgMul",f:Kt},6:{n:"PtgDiv",f:Kt},7:{n:"PtgPower",f:Kt},8:{n:"PtgConcat",f:Kt},9:{n:"PtgLt",f:Kt},10:{n:"PtgLe",f:Kt},11:{n:"PtgEq",f:Kt},12:{n:"PtgGe",f:Kt},13:{n:"PtgGt",f:Kt},14:{n:"PtgNe",f:Kt},15:{n:"PtgIsect",f:Kt},16:{n:"PtgUnion",f:Kt},17:{n:"PtgRange",f:Kt},18:{n:"PtgUplus",f:Kt},19:{n:"PtgUminus",f:Kt},20:{n:"PtgPercent",f:Kt},21:{n:"PtgParen",f:Kt},22:{n:"PtgMissArg",f:Kt},23:{n:"PtgStr",f:function GE(n,a,t){return n.l++,wa(n,0,t)}}
1,26:{n:"PtgSheet",f:function dI(n,a,t){return n.l+=5,n.l+=2,n.l+=2==t.biff?1:4,["PTGSHEET"]}},27:{n:"PtgEndSheet",f:function pI(n,a,t){return n.l+=2==t.biff?4:5,["PTGENDSHEET"]}},28:{n:"PtgErr",f:function ME(n){return n.l++,Mr[n.read_shift(1)]}},29:{n:"PtgBool",f:function OE(n){return n.l++,0!==n.read_shift(1)}},30:{n:"PtgInt",f:function PE(n){return n.l++,n.read_shift(2)}},31:{n:"PtgNum",f:function NE(n){return n.l++,bn(n)}},32:{n:"PtgArray",f:function xE(n,a,t){var r=(96&n[n.l++])>>5;return n.l+=2==t.biff?6:12==t.biff?14:7,[r]}},33:{n:"PtgFunc",f:function IE(n,a,t){var r=(96&n[n.l])>>5;n.l+=1;var i=n.read_shift(t&&t.biff<=3?1:2);return[jI[i],Qp[i],r]}},34:{n:"PtgFuncVar",f:function DE(n,a,t){var r=n[n.l++],i=n.read_shift(1),s=t&&t.biff<=3?[88==r?-1:0,n.read_shift(1)]:function RE(n){return[n[n.l+1]>>7,32767&n.read_shift(2)]}(n);return[i,(0===s[0]?Qp:RI)[s[1]]]}},35:{n:"PtgName",f:function VE(n,a,t){var r=n.read_shift(1)>>>5&3,s=n.read_shift(!t||t.biff>=8?4:2);switch(t.biff){case 2:n.l+=5;break;case 3:case 4:n.l+=8;break;case 5:n.l+=12}return[r,0,s]}},36:{n:"PtgRef",f:function FE(n,a,t){var r=(96&n[n.l])>>5;return n.l+=1,[r,Yp(n,0,t)]}},37:{n:"PtgArea",f:function fE(n,a,t){return[(96&n[n.l++])>>5,Up(n,0,t)]}},38:{n:"PtgMemArea",f:function YE(n,a,t){var r=n.read_shift(1)>>>5&3;return n.l+=t&&2==t.biff?3:4,[r,n.read_shift(t&&2==t.biff?1:2)]}},39:{n:"PtgMemErr",f:xn},40:{n:"PtgMemNoMem",f:xn},41:{n:"PtgMemFunc",f:function WE(n,a,t){return[n.read_shift(1)>>>5&3,n.read_shift(t&&2==t.biff?1:2)]}},42:{n:"PtgRefErr",f:function HE(n,a,t){var r=n.read_shift(1)>>>5&3;return n.l+=4,t.biff<8&&n.l--,12==t.biff&&(n.l+=2),[r]}},43:{n:"PtgAreaErr",f:function hE(n,a,t){var r=(96&n[n.l++])>>5;return n.l+=t&&t.biff>8?12:t.biff<8?6:8,[r]}},44:{n:"PtgRefN",f:function SE(n,a,t){var r=(96&n[n.l])>>5;n.l+=1;var i=function pE(n,a,t){var r=t&&t.biff?t.biff:8;if(r>=2&&r<=5)return function uE(n){var a=n.read_shift(2),t=n.read_shift(1),r=(32768&a)>>15,i=(16384&a)>>14;return a&=16383,1==r&&a>=8192&&(a-=16384),1==i&&t>=128&&(t-=256),{r:a,c:t,cRel:i,rRel:r}}(n);var i=n.read_shift(r>=12?4:2),s=n.read_shift(2),o=(16384&s)>>14,l=(32768&s)>>15;if(s&=16383,1==l)for(;i>524287;)i-=1048576;if(1==o)for(;s>8191;)s-=16384;return{r:i,c:s,cRel:o,rRel:l}}(n,0,t);return[r,i]}},45:{n:"PtgAreaN",f:function _E(n,a,t){var r=(96&n[n.l++])>>5,i=function lE(n,a,t){if(t.biff<8)return Xp(n);var r=n.read_shift(12==t.biff?4:2),i=n.read_shift(12==t.biff?4:2),s=ei(n,2),o=ei(n,2);return{s:{r,c:s[0],cRel:s[1],rRel:s[2]},e:{r:i,c:o[0],cRel:o[1],rRel:o[2]}}}(n,0,t);return[r,i]}},46:{n:"PtgMemAreaN",f:function uI(n){return[n.read_shift(1)>>>5&3,n.read_shift(2)]}},47:{n:"PtgMemNoMemN",f:function fI(n){return[n.read_shift(1)>>>5&3,n.read_shift(2)]}},57:{n:"PtgNameX",f:function UE(n,a,t){return 5==t.biff?function XE(n){var a=n.read_shift(1)>>>5&3,t=n.read_shift(2,"i");n.l+=8;var r=n.read_shift(2);return n.l+=12,[a,t,r]}(n):[n.read_shift(1)>>>5&3,n.read_shift(2),n.read_shift(4)]}},58:{n:"PtgRef3d",f:function EE(n,a,t){var r=(96&n[n.l])>>5;n.l+=1;var i=n.read_shift(2);return t&&5==t.biff&&(n.l+=12),[r,i,Yp(n,0,t)]}},59:{n:"PtgArea3d",f:function mE(n,a,t){var r=(96&n[n.l++])>>5,i=n.read_shift(2,"i");if(t&&5===t.biff)n.l+=12;return[r,i,Up(n,0,t)]}},60:{n:"PtgRefErr3d",f:function zE(n,a,t){var r=(96&n[n.l++])>>5,i=n.read_shift(2),s=4;if(t)switch(t.biff){case 5:s=15;break;case 12:s=6}return n.l+=s,[r,i]}},61:{n:"PtgAreaErr3d",f:function gE(n,a,t){var r=(96&n[n.l++])>>5,i=n.read_shift(2),s=8;if(t)switch(t.biff){case 5:n.l+=12,s=6;break;case 12:s=12}return n.l+=s,[r,i]}},255:{}},hI={64:32,96:32,65:33,97:33,66:34,98:34,67:35,99:35,68:36,100:36,69:37,101:37,70:38,102:38,71:39,103:39,72:40,104:40,73:41,105:41,74:42,106:42,75:43,107:43,76:44,108:44,77:45,109:45,78:46,110:46,79:47,111:47,88:34,120:34,89:57,121:57,90:58,122:58,91:59,123:59,92:60,124:60,93:61,125:61},gI={1:{n:"PtgElfLel",f:zp},2:{n:"PtgElfRw",f:Ra},3:{n:"PtgElfCol",f:Ra},6:{n:"PtgElfRwV",f:Ra},7:{n:"PtgElfColV",f:Ra},10:{n:"PtgElfRadical",f:Ra},11:{n:"PtgElfRadicalS",f:sl},13:{n:"PtgElfColS",f:sl},15:{n:"PtgElfColSV",f:sl},16:{n:"PtgElfRadicalLel",f:zp},25:{n:"PtgList",f:function lI(n){n.l+=2;var a=n.read_shift(2),t=n.read_shift(2),r=n.read_shift(4),i=n.read_shift(2),s=n.read_shift(2);return{ixti:a,coltype:3&t,rt:oI[t>>2&31],idx:r,c:i,C:s}}},29:{n:"PtgSxName",f:function cI(n){return n.l+=2,[n.read_shift(4)]}},255:{}},_I={0:{n:"PtgAttrNoop",f:function mI(n){return n.l+=4,[0,0]}},1:{n:"PtgAttrSemi",f:function TE(n,a,t){var r=255&n[n.l+1]?1:0;return n.l+=t&&2==t.biff?3:4,[r]}},2:{n:"PtgAttrIf",f:function CE(n,a,t){var r=255&n[n.l+1]?1:0;return n.l+=2,[r,n.read_shift(t&&2==t.biff?1:2)]}},4:{n:"PtgAttrChoose",f:function vE(n,a,t){n.l+=2;for(var r=n.read_shift(t&&2==t.biff?1:2),i=[],s=0;s<=r;++s)i.push(n.read_shift(t&&2==t.biff?1:2));return i}},8:{n:"PtgAttrGoto",f:function bE(n,a,t){var r=255&n[n.l+1]?1:0;return n.l+=2,[r,n.read_shift(t&&2==t.biff?1:2)]}},16:{n:"PtgAttrSum",f:function jE(n,a,t){n.l+=t&&2==t.biff?3:4}},32:{n:"PtgAttrBaxcel",f:Wp},33:{n:"PtgAttrBaxcel",f:Wp},64:{n:"PtgAttrSpace",f:function wE(n){return n.read_shift(2),Hp(n)}},65:{n:"PtgAttrSpaceSemi",f:function yE(n){return n.read_shift(2),Hp(n)}},128:{n:"PtgAttrIfError",f:function kE(n){var a=255&n[n.l+1]?1:0;return n.l+=2,[a,n.read_shift(2)]}},255:{}};function ja(n,a,t,r){if(r.biff<8)return xn(n,a);for(var i=n.l+a,s=[],o=0;o!==t.length;++o)switch(t[o][0]){case"PtgArray":t[o][1]=$E(n,0,r),s.push(t[o][1]);break;case"PtgMemArea":t[o][2]=LE(n,0,r),s.push(t[o][2]);break;case"PtgExp":r&&12==r.biff&&(t[o][1][1]=n.read_shift(4),s.push(t[o][1]));break;case"PtgList":case"PtgElfRadicalS":case"PtgElfColS":case"PtgElfColSV":throw"Unsupported "+t[o][0]}return 0!=(a=i-n.l)&&s.push(xn(n,a)),s}function Aa(n,a,t){for(var i,s,r=n.l+a,o=[];r!=n.l;)a=r-n.l,i=qp[s=n[n.l]]||qp[hI[s]],(24===s||25===s)&&(i=(24===s?gI:_I)[n[n.l+1]]),i&&i.f?o.push([i.n,i.f(n,a,t)]):xn(n,a);return o}function xI(n){for(var a=[],t=0;t<n.length;++t){for(var r=n[t],i=[],s=0;s<r.length;++s){var o=r[s];i.push(o?2===o[0]?'"'+o[1].replace(/"/g,'""')+'"':o[1]:"")}a.push(i.join(","))}return a.join(";")}var vI={PtgAdd:"+",PtgConcat:"&",PtgDiv:"/",PtgEq:"=",PtgGe:">=",PtgGt:">",PtgLe:"<=",PtgLt:"<",PtgMul:"*",PtgNe:"<>",PtgPower:"^",PtgSub:"-"};function Jp(n,a,t){if(!n)return"SH33TJSERR0";if(t.biff>8&&(!n.XTI||!n.XTI[a]))return n.SheetNames[a];if(!n.XTI)return"SH33TJSERR6";var r=n.XTI[a];if(t.biff<8)return a>1e4&&(a-=65536),a<0&&(a=-a),0==a?"":n.XTI[a-1];if(!r)return"SH33TJSERR1";var i="";if(t.biff>8)switch(n[r[0]][0]){case 357:return i=-1==r[1]?"#REF":n.SheetNames[r[1]],r[1]==r[2]?i:i+":"+n.SheetNames[r[2]];case 358:return null!=t.SID?n.SheetNames[t.SID]:"SH33TJSSAME"+n[r[0]][0];default:return"SH33TJSSRC"+n[r[0]][0]}switch(n[r[0]][0][0]){case 1025:return i=-1==r[1]?"#REF":n.SheetNames[r[1]]||"SH33TJSERR3",r[1]==r[2]?i:i+":"+n.SheetNames[r[2]];case 14849:return n[r[0]].slice(1).map(function(s){return s.Name}).join(";;");default:return n[r[0]][0][3]?(i=-1==r[1]?"#REF":n[r[0]][0][3][r[1]]||"SH33TJSERR4",r[1]==r[2]?i:i+":"+n[r[0]][0][3][r[2]]):"SH33TJSERR2"}}function Kp(n,a,t){var r=Jp(n,a,t);return"#REF"==r?r:function bI(n,a){if(!(n||a&&a.biff<=5&&a.biff>=2))throw new Error("empty sheet name");return/[^\w\u4E00-\u9FFF\u3040-\u30FF]/.test(n)?"'"+n+"'":n}(r,t)}function Tn(n,a,t,r,i){var c,d,p,h,s=i&&i.biff||8,o={s:{c:0,r:0},e:{c:0,r:0}},l=[],u=0,f=0,g="";if(!n[0]||!n[0][0])return"";for(var m=-1,_="",v=0,k=n[0].length;v<k;++v){var b=n[0][v];switch(b[0]){case"PtgUminus":l.push("-"+l.pop());break;
1case"PtgUplus":l.push("+"+l.pop());break;case"PtgPercent":l.push(l.pop()+"%");break;case"PtgAdd":case"PtgConcat":case"PtgDiv":case"PtgEq":case"PtgGe":case"PtgGt":case"PtgLe":case"PtgLt":case"PtgMul":case"PtgNe":case"PtgPower":case"PtgSub":if(c=l.pop(),d=l.pop(),m>=0){switch(n[0][m][1][0]){case 0:_=Ot(" ",n[0][m][1][1]);break;case 1:_=Ot("\r",n[0][m][1][1]);break;default:if(_="",i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+n[0][m][1][0])}d+=_,m=-1}l.push(d+vI[b[0]]+c);break;case"PtgIsect":c=l.pop(),d=l.pop(),l.push(d+" "+c);break;case"PtgUnion":c=l.pop(),d=l.pop(),l.push(d+","+c);break;case"PtgRange":c=l.pop(),d=l.pop(),l.push(d+":"+c);break;case"PtgAttrChoose":case"PtgAttrGoto":case"PtgAttrIf":case"PtgAttrIfError":case"PtgAttrBaxcel":case"PtgAttrSemi":case"PtgMemArea":case"PtgTbl":case"PtgMemErr":case"PtgMemAreaN":case"PtgMemNoMemN":case"PtgAttrNoop":case"PtgSheet":case"PtgEndSheet":case"PtgMemFunc":case"PtgMemNoMem":break;case"PtgRef":p=ba(b[1][1],o,i),l.push(Ca(p,s));break;case"PtgRefN":p=t?ba(b[1][1],t,i):b[1][1],l.push(Ca(p,s));break;case"PtgRef3d":u=b[1][1],p=ba(b[1][2],o,i),g=Kp(r,u,i),l.push(g+"!"+Ca(p,s));break;case"PtgFunc":case"PtgFuncVar":var G=b[1][0],j=b[1][1];G||(G=0);var w=0==(G&=127)?[]:l.slice(-G);l.length-=G,"User"===j&&(j=w.shift()),l.push(j+"("+w.join(",")+")");break;case"PtgBool":l.push(b[1]?"TRUE":"FALSE");break;case"PtgInt":case"PtgErr":l.push(b[1]);break;case"PtgNum":l.push(String(b[1]));break;case"PtgStr":l.push('"'+b[1].replace(/"/g,'""')+'"');break;case"PtgAreaN":h=yd(b[1][1],t?{s:t}:o,i),l.push(Ro(h,i));break;case"PtgArea":h=yd(b[1][1],o,i),l.push(Ro(h,i));break;case"PtgArea3d":h=b[1][2],g=Kp(r,u=b[1][1],i),l.push(g+"!"+Ro(h,i));break;case"PtgAttrSum":l.push("SUM("+l.pop()+")");break;case"PtgName":var O=(r.names||[])[(f=b[1][2])-1]||(r[0]||[])[f],M=O?O.Name:"SH33TJSNAME"+String(f);M&&"_xlfn."==M.slice(0,6)&&!i.xlfn&&(M=M.slice(6)),l.push(M);break;case"PtgNameX":var z,H=b[1][1];if(f=b[1][2],!(i.biff<=5)){var P="";if(14849==((r[H]||[])[0]||[])[0]||(1025==((r[H]||[])[0]||[])[0]?r[H][f]&&r[H][f].itab>0&&(P=r.SheetNames[r[H][f].itab-1]+"!"):P=r.SheetNames[f-1]+"!"),r[H]&&r[H][f])P+=r[H][f].Name;else if(r[0]&&r[0][f])P+=r[0][f].Name;else{var oe=(Jp(r,H,i)||"").split(";;");oe[f-1]?P=oe[f-1]:P+="SH33TJSERRX"}l.push(P);break}H<0&&(H=-H),r[H]&&(z=r[H][f]),z||(z={Name:"SH33TJSERRY"}),l.push(z.Name);break;case"PtgParen":var ve="(",ae=")";if(m>=0){switch(_="",n[0][m][1][0]){case 2:ve=Ot(" ",n[0][m][1][1])+ve;break;case 3:ve=Ot("\r",n[0][m][1][1])+ve;break;case 4:ae=Ot(" ",n[0][m][1][1])+ae;break;case 5:ae=Ot("\r",n[0][m][1][1])+ae;break;default:if(i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+n[0][m][1][0])}m=-1}l.push(ve+l.pop()+ae);break;case"PtgRefErr":case"PtgRefErr3d":case"PtgAreaErr":case"PtgAreaErr3d":l.push("#REF!");break;case"PtgExp":var ye={c:t.c,r:t.r};if(r.sharedf[Pe(p={c:b[1][1],r:b[1][0]})]){var ke=r.sharedf[Pe(p)];l.push(Tn(ke,0,ye,r,i))}else{var He=!1;for(c=0;c!=r.arrayf.length;++c)if(!(p.c<(d=r.arrayf[c])[0].s.c||p.c>d[0].e.c||p.r<d[0].s.r||p.r>d[0].e.r)){l.push(Tn(d[1],0,ye,r,i)),He=!0;break}He||l.push(b[1])}break;case"PtgArray":l.push("{"+xI(b[1])+"}");break;case"PtgAttrSpace":case"PtgAttrSpaceSemi":m=v;break;case"PtgMissArg":l.push("");break;case"PtgList":l.push("Table"+b[1].idx+"[#"+b[1].rt+"]");break;case"PtgElfCol":case"PtgElfColS":case"PtgElfColSV":case"PtgElfColV":case"PtgElfLel":case"PtgElfRadical":case"PtgElfRadicalLel":case"PtgElfRadicalS":case"PtgElfRw":case"PtgElfRwV":throw new Error("Unsupported ELFs");default:throw new Error("Unrecognized Formula Token: "+String(b))}if(3!=i.biff&&m>=0&&-1==["PtgAttrSpace","PtgAttrSpaceSemi","PtgAttrGoto"].indexOf(n[0][v][0])){var Fe=!0;switch((b=n[0][m])[1][0]){case 4:Fe=!1;case 0:_=Ot(" ",b[1][1]);break;case 5:Fe=!1;case 1:_=Ot("\r",b[1][1]);break;default:if(_="",i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+b[1][0])}l.push((Fe?_:"")+l.pop()+(Fe?"":_)),m=-1}}if(l.length>1&&i.WTF)throw new Error("bad formula stack");return l[0]}function CI(n,a,t){var s,r=n.l+a,i=2==t.biff?1:2,o=n.read_shift(i);if(65535==o)return[[],xn(n,a-2)];var l=Aa(n,o,t);return a!==o+i&&(s=ja(n,a-o-i,l,t)),n.l=r,[l,s]}function wI(n,a,t){var i,r=n.l+a,s=n.read_shift(2),o=Aa(n,s,t);return 65535==s?[[],xn(n,a-2)]:(a!==s+2&&(i=ja(n,r-s-2,o,t)),[o,i])}function ol(n,a,t){var r=n.l+a,i=kr(n);2==t.biff&&++n.l;var s=function yI(n){var a;if(65535!==jr(n,n.l+6))return[bn(n),"n"];switch(n[n.l]){case 0:return n.l+=8,["String","s"];case 1:return a=1===n[n.l+2],n.l+=8,[a,"b"];case 2:return a=n[n.l+2],n.l+=8,[a,"e"];case 3:return n.l+=8,["","s"]}return[]}(n),o=n.read_shift(1);2!=t.biff&&(n.read_shift(1),t.biff>=5&&n.read_shift(4));var l=function kI(n,a,t){var s,r=n.l+a,i=2==t.biff?1:2,o=n.read_shift(i);if(65535==o)return[[],xn(n,a-2)];var l=Aa(n,o,t);return a!==o+i&&(s=ja(n,a-o-i,l,t)),n.l=r,[l,s]}(n,r-n.l,t);return{cell:i,val:s[0],formula:l,shared:o>>3&1,tt:s[1]}}function Gs(n,a,t){var r=n.read_shift(4),i=Aa(n,r,t),s=n.read_shift(4);return[i,s>0?ja(n,s,i,t):null]}var EI=Gs,Bs=Gs,II=Gs,DI=Gs,RI
vendor: 7,370 bytes, line 1
1={0:"BEEP",1:"OPEN",2:"OPEN.LINKS",3:"CLOSE.ALL",4:"SAVE",5:"SAVE.AS",6:"FILE.DELETE",7:"PAGE.SETUP",8:"PRINT",9:"PRINTER.SETUP",10:"QUIT",11:"NEW.WINDOW",12:"ARRANGE.ALL",13:"WINDOW.SIZE",14:"WINDOW.MOVE",15:"FULL",16:"CLOSE",17:"RUN",22:"SET.PRINT.AREA",23:"SET.PRINT.TITLES",24:"SET.PAGE.BREAK",25:"REMOVE.PAGE.BREAK",26:"FONT",27:"DISPLAY",28:"PROTECT.DOCUMENT",29:"PRECISION",30:"A1.R1C1",31:"CALCULATE.NOW",32:"CALCULATION",34:"DATA.FIND",35:"EXTRACT",36:"DATA.DELETE",37:"SET.DATABASE",38:"SET.CRITERIA",39:"SORT",40:"DATA.SERIES",41:"TABLE",42:"FORMAT.NUMBER",43:"ALIGNMENT",44:"STYLE",45:"BORDER",46:"CELL.PROTECTION",47:"COLUMN.WIDTH",48:"UNDO",49:"CUT",50:"COPY",51:"PASTE",52:"CLEAR",53:"PASTE.SPECIAL",54:"EDIT.DELETE",55:"INSERT",56:"FILL.RIGHT",57:"FILL.DOWN",61:"DEFINE.NAME",62:"CREATE.NAMES",63:"FORMULA.GOTO",64:"FORMULA.FIND",65:"SELECT.LAST.CELL",66:"SHOW.ACTIVE.CELL",67:"GALLERY.AREA",68:"GALLERY.BAR",69:"GALLERY.COLUMN",70:"GALLERY.LINE",71:"GALLERY.PIE",72:"GALLERY.SCATTER",73:"COMBINATION",74:"PREFERRED",75:"ADD.OVERLAY",76:"GRIDLINES",77:"SET.PREFERRED",78:"AXES",79:"LEGEND",80:"ATTACH.TEXT",81:"ADD.ARROW",82:"SELECT.CHART",83:"SELECT.PLOT.AREA",84:"PATTERNS",85:"MAIN.CHART",86:"OVERLAY",87:"SCALE",88:"FORMAT.LEGEND",89:"FORMAT.TEXT",90:"EDIT.REPEAT",91:"PARSE",92:"JUSTIFY",93:"HIDE",94:"UNHIDE",95:"WORKSPACE",96:"FORMULA",97:"FORMULA.FILL",98:"FORMULA.ARRAY",99:"DATA.FIND.NEXT",100:"DATA.FIND.PREV",101:"FORMULA.FIND.NEXT",102:"FORMULA.FIND.PREV",103:"ACTIVATE",104:"ACTIVATE.NEXT",105:"ACTIVATE.PREV",106:"UNLOCKED.NEXT",107:"UNLOCKED.PREV",108:"COPY.PICTURE",109:"SELECT",110:"DELETE.NAME",111:"DELETE.FORMAT",112:"VLINE",113:"HLINE",114:"VPAGE",115:"HPAGE",116:"VSCROLL",117:"HSCROLL",118:"ALERT",119:"NEW",120:"CANCEL.COPY",121:"SHOW.CLIPBOARD",122:"MESSAGE",124:"PASTE.LINK",125:"APP.ACTIVATE",126:"DELETE.ARROW",127:"ROW.HEIGHT",128:"FORMAT.MOVE",129:"FORMAT.SIZE",130:"FORMULA.REPLACE",131:"SEND.KEYS",132:"SELECT.SPECIAL",133:"APPLY.NAMES",134:"REPLACE.FONT",135:"FREEZE.PANES",136:"SHOW.INFO",137:"SPLIT",138:"ON.WINDOW",139:"ON.DATA",140:"DISABLE.INPUT",142:"OUTLINE",143:"LIST.NAMES",144:"FILE.CLOSE",145:"SAVE.WORKBOOK",146:"DATA.FORM",147:"COPY.CHART",148:"ON.TIME",149:"WAIT",150:"FORMAT.FONT",151:"FILL.UP",152:"FILL.LEFT",153:"DELETE.OVERLAY",155:"SHORT.MENUS",159:"SET.UPDATE.STATUS",161:"COLOR.PALETTE",162:"DELETE.STYLE",163:"WINDOW.RESTORE",164:"WINDOW.MAXIMIZE",166:"CHANGE.LINK",167:"CALCULATE.DOCUMENT",168:"ON.KEY",169:"APP.RESTORE",170:"APP.MOVE",171:"APP.SIZE",172:"APP.MINIMIZE",173:"APP.MAXIMIZE",174:"BRING.TO.FRONT",175:"SEND.TO.BACK",185:"MAIN.CHART.TYPE",186:"OVERLAY.CHART.TYPE",187:"SELECT.END",188:"OPEN.MAIL",189:"SEND.MAIL",190:"STANDARD.FONT",191:"CONSOLIDATE",192:"SORT.SPECIAL",193:"GALLERY.3D.AREA",194:"GALLERY.3D.COLUMN",195:"GALLERY.3D.LINE",196:"GALLERY.3D.PIE",197:"VIEW.3D",198:"GOAL.SEEK",199:"WORKGROUP",200:"FILL.GROUP",201:"UPDATE.LINK",202:"PROMOTE",203:"DEMOTE",204:"SHOW.DETAIL",206:"UNGROUP",207:"OBJECT.PROPERTIES",208:"SAVE.NEW.OBJECT",209:"SHARE",210:"SHARE.NAME",211:"DUPLICATE",212:"APPLY.STYLE",213:"ASSIGN.TO.OBJECT",214:"OBJECT.PROTECTION",215:"HIDE.OBJECT",216:"SET.EXTRACT",217:"CREATE.PUBLISHER",218:"SUBSCRIBE.TO",219:"ATTRIBUTES",220:"SHOW.TOOLBAR",222:"PRINT.PREVIEW",223:"EDIT.COLOR",224:"SHOW.LEVELS",225:"FORMAT.MAIN",226:"FORMAT.OVERLAY",227:"ON.RECALC",228:"EDIT.SERIES",229:"DEFINE.STYLE",240:"LINE.PRINT",243:"ENTER.DATA",249:"GALLERY.RADAR",250:"MERGE.STYLES",251:"EDITION.OPTIONS",252:"PASTE.PICTURE",253:"PASTE.PICTURE.LINK",254:"SPELLING",256:"ZOOM",259:"INSERT.OBJECT",260:"WINDOW.MINIMIZE",265:"SOUND.NOTE",266:"SOUND.PLAY",267:"FORMAT.SHAPE",268:"EXTEND.POLYGON",269:"FORMAT.AUTO",272:"GALLERY.3D.BAR",273:"GALLERY.3D.SURFACE",274:"FILL.AUTO",276:"CUSTOMIZE.TOOLBAR",277:"ADD.TOOL",278:"EDIT.OBJECT",279:"ON.DOUBLECLICK",280:"ON.ENTRY",281:"WORKBOOK.ADD",282:"WORKBOOK.MOVE",283:"WORKBOOK.COPY",284:"WORKBOOK.OPTIONS",285:"SAVE.WORKSPACE",288:"CHART.WIZARD",289:"DELETE.TOOL",290:"MOVE.TOOL",291:"WORKBOOK.SELECT",292:"WORKBOOK.ACTIVATE",293:"ASSIGN.TO.TOOL",295:"COPY.TOOL",296:"RESET.TOOL",297:"CONSTRAIN.NUMERIC",298:"PASTE.TOOL",302:"WORKBOOK.NEW",305:"SCENARIO.CELLS",306:"SCENARIO.DELETE",307:"SCENARIO.ADD",308:"SCENARIO.EDIT",309:"SCENARIO.SHOW",310:"SCENARIO.SHOW.NEXT",311:"SCENARIO.SUMMARY",312:"PIVOT.TABLE.WIZARD",313:"PIVOT.FIELD.PROPERTIES",314:"PIVOT.FIELD",315:"PIVOT.ITEM",316:"PIVOT.ADD.FIELDS",318:"OPTIONS.CALCULATION",319:"OPTIONS.EDIT",320:"OPTIONS.VIEW",321:"ADDIN.MANAGER",322:"MENU.EDITOR",323:"ATTACH.TOOLBARS",324:"VBAActivate",325:"OPTIONS.CHART",328:"VBA.INSERT.FILE",330:"VBA.PROCEDURE.DEFINITION",336:"ROUTING.SLIP",338:"ROUTE.DOCUMENT",339:"MAIL.LOGON",342:"INSERT.PICTURE",343:"EDIT.TOOL",344:"GALLERY.DOUGHNUT",350:"CHART.TREND",352:"PIVOT.ITEM.PROPERTIES",354:"WORKBOOK.INSERT",355:"OPTIONS.TRANSITION",356:"OPTIONS.GENERAL",370:"FILTER.ADVANCED",373:"MAIL.ADD.MAILER",374:"MAIL.DELETE.MAILER",375:"MAIL.REPLY",376:"MAIL.REPLY.ALL",377:"MAIL.FORWARD",378:"MAIL.NEXT.LETTER",379:"DATA.LABEL",380:"INSERT.TITLE",381:"FONT.PROPERTIES",382:"MACRO.OPTIONS",383:"WORKBOOK.HIDE",384:"WORKBOOK.UNHIDE",385:"WORKBOOK.DELETE",386:"WORKBOOK.NAME",388:"GALLERY.CUSTOM",390:"ADD.CHART.AUTOFORMAT",391:"DELETE.CHART.AUTOFORMAT",392:"CHART.ADD.DATA",393:"AUTO.OUTLINE",394:"TAB.ORDER",395:"SHOW.DIALOG",396:"SELECT.ALL",397:"UNGROUP.SHEETS",398:"SUBTOTAL.CREATE",399:"SUBTOTAL.REMOVE",400:"RENAME.OBJECT",412:"WORKBOOK.SCROLL",413:"WORKBOOK.NEXT",414:"WORKBOOK.PREV",415:"WORKBOOK.TAB.SPLIT",416:"FULL.SCREEN",417:"WORKBOOK.PROTECT",420:"SCROLLBAR.PROPERTIES",421:"PIVOT.SHOW.PAGES",422:"TEXT.TO.COLUMNS",423:"FORMAT.CHARTTYPE",424:"LINK.FORMAT",425:"TRACER.DISPLAY",430:"TRACER.NAVIGATE",431:"TRACER.CLEAR",432:"TRACER.ERROR",433:"PIVOT.FIELD.GROUP",434:"PIVOT.FIELD.UNGROUP",435:"CHECKBOX.PROPERTIES",436:"LABEL.PROPERTIES",437:"LISTBOX.PROPERTIES",438:"EDITBOX.PROPERTIES",439:"PIVOT.REFRESH",440:"LINK.COMBO",441:"OPEN.TEXT",442:"HIDE.DIALOG",443:"SET.DIALOG.FOCUS",444:"ENABLE.OBJECT",445:"PUSHBUTTON.PROPERTIES",446:"SET.DIALOG.DEFAULT",447:"FILTER",448:"FILTER.SHOW.ALL",449:"CLEAR.OUTLINE",450:"FUNCTION.WIZARD",451:"ADD.LIST.ITEM",452:"SET.LIST.ITEM",453:"REMOVE.LIST.ITEM",454:"SELECT.LIST.ITEM",455:"SET.CONTROL.VALUE",456:"SAVE.COPY.AS",458:"OPTIONS.LISTS.ADD",459:"OPTIONS.LISTS.DELETE",460:"SERIES.AXES",461:"SERIES.X",462:"SERIES.Y",463:"ERRORBAR.X",464:"ERRORBAR.Y",465:"FORMAT.CHART",466:"SERIES.ORDER",467:"MAIL.LOGOFF",468:"CLEAR.ROUTING.SLIP",469:"APP.ACTIVATE.MICROSOFT",470:"MAIL.EDIT.MAILER",471:"ON.SHEET",472:"STANDARD.WIDTH",473:"SCENARIO.MERGE",474:"SUMMARY.INFO",475:"FIND.FILE",476:"ACTIVE.CELL.FONT",477:"ENABLE.TIPWIZARD",478:"VBA.MAKE.ADDIN",480:"INSERTDATATABLE",481:"WORKGROUP.OPTIONS",482:"MAIL.SEND.MAILER",485:"AUTOCORRECT",489:"POST.DOCUMENT",491:"PICKLIST",493:"VIEW.SHOW",494:"VIEW.DEFINE",495:"VIEW.DELETE",509:"SHEET.BACKGROUND",510:"INSERT.MAP.OBJECT",511:"OPTIONS.MENONO",517:"MSOCHECKS",518:"NORMAL",519:"LAYOUT",520:"RM.PRINT.AREA",521:"CLEAR.PRINT.AREA",522:"ADD.PRINT.AREA",523:"MOVE.BRK",545:"HIDECURR.NOTE",546:"HIDEALL.NOTES",547:"DELETE.NOTE",548:"TRAVERSE.NOTES",549:"ACTIVATE.NOTES",620:"PROTECT.REVISIONS",621:"UNPROTECT.REVISIONS",647:"OPTIONS.ME",653:"WEB.PUBLISH",667:"NEWWEBQUERY",673:"PIVOT.TABLE.CHART",753:"OPTIONS.SAVE",755:"OPTIONS.SPELL",808:"HIDEALL.INKANNOTS"},
1Qp={0:"COUNT",1:"IF",2:"ISNA",3:"ISERROR",4:"SUM",5:"AVERAGE",6:"MIN",7:"MAX",8:"ROW",9:"COLUMN",10:"NA",11:"NPV",12:"STDEV",13:"DOLLAR",14:"FIXED",15:"SIN",16:"COS",17:"TAN",18:"ATAN",19:"PI",20:"SQRT",21:"EXP",22:"LN",23:"LOG10",24:"ABS",25:"INT",26:"SIGN",27:"ROUND",28:"LOOKUP",29:"INDEX",30:"REPT",31:"MID",32:"LEN",33:"VALUE",34:"TRUE",35:"FALSE",36:"AND",37:"OR",38:"NOT",39:"MOD",40:"DCOUNT",41:"DSUM",42:"DAVERAGE",43:"DMIN",44:"DMAX",45:"DSTDEV",46:"VAR",47:"DVAR",48:"TEXT",49:"LINEST",50:"TREND",51:"LOGEST",52:"GROWTH",53:"GOTO",54:"HALT",55:"RETURN",56:"PV",57:"FV",58:"NPER",59:"PMT",60:"RATE",61:"MIRR",62:"IRR",63:"RAND",64:"MATCH",65:"DATE",66:"TIME",67:"DAY",68:"MONTH",69:"YEAR",70:"WEEKDAY",71:"HOUR",72:"MINUTE",73:"SECOND",74:"NOW",75:"AREAS",76:"ROWS",77:"COLUMNS",78:"OFFSET",79:"ABSREF",80:"RELREF",81:"ARGUMENT",82:"SEARCH",83:"TRANSPOSE",84:"ERROR",85:"STEP",86:"TYPE",87:"ECHO",88:"SET.NAME",89:"CALLER",90:"DEREF",91:"WINDOWS",92:"SERIES",93:"DOCUMENTS",94:"ACTIVE.CELL",95:"SELECTION",96:"RESULT",97:"ATAN2",98:"ASIN",99:"ACOS",100:"CHOOSE",101:"HLOOKUP",102:"VLOOKUP",103:"LINKS",104:"INPUT",105:"ISREF",106:"GET.FORMULA",107:"GET.NAME",108:"SET.VALUE",109:"LOG",110:"EXEC",111:"CHAR",112:"LOWER",113:"UPPER",114:"PROPER",115:"LEFT",116:"RIGHT",117:"EXACT",118:"TRIM",119:"REPLACE",120:"SUBSTITUTE",121:"CODE",122:"NAMES",123:"DIRECTORY",124:"FIND",125:"CELL",126:"ISERR",127:"ISTEXT",128:"ISNUMBER",129:"ISBLANK",130:"T",131:"N",132:"FOPEN",133:"FCLOSE",134:"FSIZE",135:"FREADLN",136:"FREAD",137:"FWRITELN",138:"FWRITE",139:"FPOS",140:"DATEVALUE",141:"TIMEVALUE",142:"SLN",143:"SYD",144:"DDB",145:"GET.DEF",146:"REFTEXT",147:"TEXTREF",148:"INDIRECT",149:"REGISTER",150:"CALL",151:"ADD.BAR",152:"ADD.MENU",153:"ADD.COMMAND",154:"ENABLE.COMMAND",155:"CHECK.COMMAND",156:"RENAME.COMMAND",157:"SHOW.BAR",158:"DELETE.MENU",159:"DELETE.COMMAND",160:"GET.CHART.ITEM",161:"DIALOG.BOX",162:"CLEAN",163:"MDETERM",164:"MINVERSE",165:"MMULT",166:"FILES",167:"IPMT",168:"PPMT",169:"COUNTA",170:"CANCEL.KEY",171:"FOR",172:"WHILE",173:"BREAK",174:"NEXT",175:"INITIATE",176:"REQUEST",177:"POKE",178:"EXECUTE",179:"TERMINATE",180:"RESTART",181:"HELP",182:"GET.BAR",183:"PRODUCT",184:"FACT",185:"GET.CELL",186:"GET.WORKSPACE",187:"GET.WINDOW",188:"GET.DOCUMENT",189:"DPRODUCT",190:"ISNONTEXT",191:"GET.NOTE",192:"NOTE",193:"STDEVP",194:"VARP",195:"DSTDEVP",196:"DVARP",197:"TRUNC",198:"ISLOGICAL",199:"DCOUNTA",200:"DELETE.BAR",201:"UNREGISTER",204:"USDOLLAR",205:"FINDB",206:"SEARCHB",207:"REPLACEB",208:"LEFTB",209:"RIGHTB",210:"MIDB",211:"LENB",212:"ROUNDUP",213:"ROUNDDOWN",214:"ASC",215:"DBCS",216:"RANK",219:"ADDRESS",220:"DAYS360",221:"TODAY",222:"VDB",223:"ELSE",224:"ELSE.IF",225:"END.IF",226:"FOR.CELL",227:"MEDIAN",228:"SUMPRODUCT",229:"SINH",230:"COSH",231:"TANH",232:"ASINH",233:"ACOSH",234:"ATANH",235:"DGET",236:"CREATE.OBJECT",237:"VOLATILE",238:"LAST.ERROR",239:"CUSTOM.UNDO",240:"CUSTOM.REPEAT",241:"FORMULA.CONVERT",242:"GET.LINK.INFO",243:"TEXT.BOX",244:"INFO",245:"GROUP",246:"GET.OBJECT",247:"DB",248:"PAUSE",251:"RESUME",252:"FREQUENCY",253:"ADD.TOOLBAR",254:"DELETE.TOOLBAR",255:"User",256:"RESET.TOOLBAR",257:"EVALUATE",258:"GET.TOOLBAR",259:"GET.TOOL",260:"SPELLING.CHECK",261:"ERROR.TYPE",262:"APP.TITLE",263:"WINDOW.TITLE",264:"SAVE.TOOLBAR",265:"ENABLE.TOOL",266:"PRESS.TOOL",267:"REGISTER.ID",268:"GET.WORKBOOK",269:"AVEDEV",270:"BETADIST",271:"GAMMALN",272:"BETAINV",273:"BINOMDIST",274:"CHIDIST",275:"CHIINV",276:"COMBIN",277:"CONFIDENCE",278:"CRITBINOM",279:"EVEN",280:"EXPONDIST",281:"FDIST",282:"FINV",283:"FISHER",284:"FISHERINV",285:"FLOOR",286:"GAMMADIST",287:"GAMMAINV",288:"CEILING",289:"HYPGEOMDIST",290:"LOGNORMDIST",291:"LOGINV",292:"NEGBINOMDIST",293:"NORMDIST",294:"NORMSDIST",295:"NORMINV",296:"NORMSINV",297:"STANDARDIZE",298:"ODD",299:"PERMUT",300:"POISSON",301:"TDIST",302:"WEIBULL",303:"SUMXMY2",304:"SUMX2MY2",305:"SUMX2PY2",306:"CHITEST",307:"CORREL",308:"COVAR",309:"FORECAST",310:"FTEST",311:"INTERCEPT",312:"PEARSON",313:"RSQ",314:"STEYX",315:"SLOPE",316:"TTEST",317:"PROB",318:"DEVSQ",319:"GEOMEAN",320:"HARMEAN",321:"SUMSQ",322:"KURT",323:"SKEW",324:"ZTEST",325:"LARGE",326:"SMALL",327:"QUARTILE",328:"PERCENTILE",329:"PERCENTRANK",330:"MODE",331:"TRIMMEAN",332:"TINV",334:"MOVIE.COMMAND",335:"GET.MOVIE",336:"CONCATENATE",337:"POWER",338:"PIVOT.ADD.DATA",339:"GET.PIVOT.TABLE",340:"GET.PIVOT.FIELD",341:"GET.PIVOT.ITEM",342:"RADIANS",343:"DEGREES",344:"SUBTOTAL",345:"SUMIF",346:"COUNTIF",347:"COUNTBLANK",348:"SCENARIO.GET",349:"OPTIONS.LISTS.GET",350:"ISPMT",351:"DATEDIF",352:"DATESTRING",353:"NUMBERSTRING",354:"ROMAN",355:"OPEN.DIALOG",356:"SAVE.DIALOG",357:"VIEW.GET",358:"GETPIVOTDATA",359:"HYPERLINK",360:"PHONETIC",361:"AVERAGEA",362:"MAXA",363:"MINA",364:"STDEVPA",365:"VARPA",366:"STDEVA",367:"VARA",368:"BAHTTEXT",369:"THAIDAYOFWEEK",370:"THAIDIGIT",371:"THAIMONTHOFYEAR",372:"THAINUMSOUND",373:"THAINUMSTRING",374:"THAISTRINGLENGTH",375:"ISTHAIDIGIT",376:"ROUNDBAHTDOWN",377:"ROUNDBAHTUP",378:"THAIYEAR",379:"RTD",380:"CUBEVALUE",381:"CUBEMEMBER",382:"CUBEMEMBERPROPERTY",383:"CUBERA
1NKEDMEMBER",384:"HEX2BIN",385:"HEX2DEC",386:"HEX2OCT",387:"DEC2BIN",388:"DEC2HEX",389:"DEC2OCT",390:"OCT2BIN",391:"OCT2HEX",392:"OCT2DEC",393:"BIN2DEC",394:"BIN2OCT",395:"BIN2HEX",396:"IMSUB",397:"IMDIV",398:"IMPOWER",399:"IMABS",400:"IMSQRT",401:"IMLN",402:"IMLOG2",403:"IMLOG10",404:"IMSIN",405:"IMCOS",406:"IMEXP",407:"IMARGUMENT",408:"IMCONJUGATE",409:"IMAGINARY",410:"IMREAL",411:"COMPLEX",412:"IMSUM",413:"IMPRODUCT",414:"SERIESSUM",415:"FACTDOUBLE",416:"SQRTPI",417:"QUOTIENT",418:"DELTA",419:"GESTEP",420:"ISEVEN",421:"ISODD",422:"MROUND",423:"ERF",424:"ERFC",425:"BESSELJ",426:"BESSELK",427:"BESSELY",428:"BESSELI",429:"XIRR",430:"XNPV",431:"PRICEMAT",432:"YIELDMAT",433:"INTRATE",434:"RECEIVED",435:"DISC",436:"PRICEDISC",437:"YIELDDISC",438:"TBILLEQ",439:"TBILLPRICE",440:"TBILLYIELD",441:"PRICE",442:"YIELD",443:"DOLLARDE",444:"DOLLARFR",445:"NOMINAL",446:"EFFECT",447:"CUMPRINC",448:"CUMIPMT",449:"EDATE",450:"EOMONTH",451:"YEARFRAC",452:"COUPDAYBS",453:"COUPDAYS",454:"COUPDAYSNC",455:"COUPNCD",456:"COUPNUM",457:"COUPPCD",458:"DURATION",459:"MDURATION",460:"ODDLPRICE",461:"ODDLYIELD",462:"ODDFPRICE",463:"ODDFYIELD",464:"RANDBETWEEN",465:"WEEKNUM",466:"AMORDEGRC",467:"AMORLINC",468:"CONVERT",724:"SHEETJS",469:"ACCRINT",470:"ACCRINTM",471:"WORKDAY",472:"NETWORKDAYS",473:"GCD",474:"MULTINOMIAL",475:"LCM",476:"FVSCHEDULE",477:"CUBEKPIMEMBER",478:"CUBESET",479:"CUBESETCOUNT",480:"IFERROR",481:"COUNTIFS",482:"SUMIFS",483:"AVERAGEIF",484:"AVERAGEIFS"},jI={2:1,3:1,10:0,15:1,16:1,17:1,18:1,19:0,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:2,30:2,31:3,32:1,33:1,34:0,35:0,38:1,39:2,40:3,41:3,42:3,43:3,44:3,45:3,47:3,48:2,53:1,61:3,63:0,65:3,66:3,67:1,68:1,69:1,70:1,71:1,72:1,73:1,74:0,75:1,76:1,77:1,79:2,80:2,83:1,85:0,86:1,89:0,90:1,94:0,95:0,97:2,98:1,99:1,101:3,102:3,105:1,106:1,108:2,111:1,112:1,113:1,114:1,117:2,118:1,119:4,121:1,126:1,127:1,128:1,129:1,130:1,131:1,133:1,134:1,135:1,136:2,137:2,138:2,140:1,141:1,142:3,143:4,144:4,161:1,162:1,163:1,164:1,165:2,172:1,175:2,176:2,177:3,178:2,179:1,184:1,186:1,189:3,190:1,195:3,196:3,197:1,198:1,199:3,201:1,207:4,210:3,211:1,212:2,213:2,214:1,215:1,225:0,229:1,230:1,231:1,232:1,233:1,234:1,235:3,244:1,247:4,252:2,257:1,261:1,271:1,273:4,274:2,275:2,276:2,277:3,278:3,279:1,280:3,281:3,282:3,283:1,284:1,285:2,286:4,287:3,288:2,289:4,290:3,291:3,292:3,293:4,294:1,295:3,296:1,297:3,298:1,299:2,300:3,301:3,302:4,303:2,304:2,305:2,306:2,307:2,308:2,309:3,310:2,311:2,312:2,313:2,314:2,315:2,316:4,325:2,326:2,327:2,328:2,331:2,332:2,337:2,342:1,343:1,346:2,347:1,350:4,351:3,352:1,353:2,360:1,368:1,369:1,370:1,371:1,372:1,373:1,374:1,375:1,376:1,377:1,378:1,382:3,385:1,392:1,393:1,396:2,397:2,398:2,399:1,400:1,401:1,402:1,403:1,404:1,405:1,406:1,407:1,408:1,409:1,410:1,414:4,415:1,416:1,417:2,420:1,421:1,422:2,424:1,425:2,426:2,427:2,428:2,430:3,438:3,439:3,440:3,443:2,444:2,445:2,446:2,447:6,448:6,449:2,450:2,464:2,468:3,476:2,479:1,480:2,65535:0};function Zp(n){return"of:"==n.slice(0,3)&&(n=n.slice(3)),61==n.charCodeAt(0)&&61==(n=n.slice(1)).charCo
1deAt(0)&&(n=n.slice(1)),(n=(n=(n=n.replace(/COM\.MICROSOFT\./g,"")).replace(/\[((?:\.[A-Z]+[0-9]+)(?::\.[A-Z]+[0-9]+)?)\]/g,function(a,t){return t.replace(/\./g,"")})).replace(/\[.(#[A-Z]*[?!])\]/g,"$1")).replace(/[;~]/g,",").replace(/\|/g,";")}function ll(n){var a=n.split(":");return[a[0].split(".")[0],a[0].split(".")[1]+(a.length>1?":"+(a[1].split(".")[1]||a[1].split(".")[0]):"")]}var Ma={},Hi={};function Si(n,a){if(n){var t=[.7,.7,.75,.75,.3,.3];"xlml"==a&&(t=[1,1,1,1,.5,.5]),null==n.left&&(n.left=t[0]),null==n.right&&(n.right=t[1]),null==n.top&&(n.top=t[2]),null==n.bottom&&(n.bottom=t[3]),null==n.header&&(n.header=t[4]),null==n.footer&&(n.footer=t[5])}}function e0(n,a,t,r,i,s){try{r.cellNF&&(n.z=Re[a])}catch(l){if(r.WTF)throw l}if("z"!==n.t||r.cellStyles){if("d"===n.t&&"string"==typeof n.v&&(n.v=Dt(n.v)),(!r||!1!==r.cellText)&&"z"!==n.t)try{if(null==Re[a]&&xr(A3[a]||"General",a),"e"===n.t)n.w=n.w||Mr[n.v];else if(0===a)if("n"===n.t)n.w=(0|n.v)===n.v?n.v.toString(10):fa(n.v);else if("d"===n.t){var o=en(n.v);n.w=(0|o)===o?o.toString(10):fa(o)}else{if(void 0===n.v)return"";n.w=pi(n.v,Hi)}else n.w=Ln(a,"d"===n.t?en(n.v):n.v,Hi)}catch(l){if(r.WTF)throw l}if(r.cellStyles&&null!=t)try{n.s=s.Fills[t],n.s.fgColor&&n.s.fgColor.theme&&!n.s.fgColor.rgb&&(n.s.fgColor.rgb=Ms(i.themeElements.clrScheme[n.s.fgColor.theme].rgb,n.s.fgColor.tint||0),r.WTF&&(n.s.fgColor.raw_rgb=i.themeElements.clrScheme[n.s.fgColor.theme].rgb)),n.s.bgColor&&n.s.bgColor.theme&&(n.s.bgColor.rgb=Ms(i.themeElements.clrScheme[n.s.bgColor.theme].rgb,n.s.bgColor.tint||0),r.WTF&&(n.s.bgColor.raw_rgb=i.themeElements.clrScheme[n.s.bgColor.theme].rgb))}catch(l){if(r.WTF&&s.Fills)throw l}}}var PI=/<(?:\w:)?mergeCell ref="[A-Z0-9:]+"\s*[\/]?>/g,OI=/<(?:\w+:)?sheetData[^>]*>([\s\S]*)<\/(?:\w+:)?sheetData>/,NI=/<(?:\w:)?hyperlink [^>]*>/gm,GI=/"(\w*:\w*)"/,BI=/<(?:\w:)?col\b[^>]*[\/]?>/g,LI=/<(?:\w:)?autoFilter[^>]*([\/]|>([\s\S]*)<\/(?:\w:)?autoFilter)>/g,$I=/<(?:\w:)?pageMargins[^>]*\/>/g,t0=/<(?:\w:)?sheetPr\b(?:[^>a-z][^>]*)?\/>/,VI=/<(?:\w:)?sheetPr[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetPr)>/,UI=/<(?:\w:)?sheetViews[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetViews)>/;function dl(n,a,t,r){var i=Me(n);t.Sheets[r]||(t.Sheets[r]={}),i.codeName&&(t.Sheets[r].CodeName=tt(gt(i.codeName)))}var i5=/<(?:\w:)?sheetView(?:[^>a-z][^>]*)?\/?>/,l5=function(){var n=/<(?:\w+:)?c[ \/>]/,a=/<\/(?:\w+:)?row>/,t=/r=["']([^"']*)["']/,r=/<(?:\w+:)?is>([\S\s]*?)<\/(?:\w+:)?is>/,i=/ref=["']([^"']*)["']/,s=_a("v"),o=_a("f");return function(c,d,p,u,f,h){for(var j,w,H,z,ae,g=0,m="",_=[],v=[],k=0,b=0,A=0,G="",O=0,M=0,P=0,oe=0,ve=Array.isArray(h.CellXf),ye=[],ke=[],He=Array.isArray(d),ge=[],Fe={},te=!1,I=!!p.sheetStubs,X=c.split(a),R=0,D=X.length;R!=D;++R){var Z=(m=X[R].trim()).length;if(0!==Z){var me=0;e:for(g=0;g<Z;++g)switch(m[g]){case">":if("/"!=m[g-1]){++g;break e}if(p&&p.cellStyles){if(O=null!=(w=Me(m.slice(me,g),!0)).r?parseInt(w.r,10):O+1,M=-1,p.sheetRows&&p.sheetRows<O)continue;Fe={},te=!1,w.ht&&(te=!0,Fe.hpt=parseFloat(w.ht),Fe.hpx=Xi(Fe.hpt)),"1"==w.hidden&&(te=!0,Fe.hidden=!0),null!=w.outlineLevel&&(te=!0,Fe.level=+w.outlineLevel),te&&(ge[O-1]=Fe)}break;case"<":me=g}if(me>=g)break;if(O=null!=(w=Me(m.slice(me,g),!0)).r?parseInt(w.r,10):O+1,M=-1,!(p.sheetRows&&p.sheetRows<O)){u.s.r>O-1&&(u.s.r=O-1),u.e.r<O-1&&(u.e.r=O-1),p&&p.cellStyles&&(Fe={},te=!1,w.ht&&(te=!0,Fe.hpt=parseFloat(w.ht),Fe.hpx=Xi(Fe.hpt)),"1"==w.hidden&&(te=!0,Fe.hidden=!0),null!=w.outlineLevel&&(te=!0,Fe.level=+w.outlineLevel),te&&(ge[O-1]=Fe)),_=m.slice(g).split(n);for(var le=0;le!=_.length&&"<"==_[le].trim().charAt(0);++le);for(_=_.slice(le),g=0;g!=_.length;++g)if(0!==(m=_[g].trim()).length){if(v=m.match(t),k=g,b=0,A=0,m="<c "+("<"==m.slice(0,1)?">":"")+m,null!=v&&2===v.length){for(k=0,G=v[1],b=0;b!=G.length&&!((A=G.charCodeAt(b)-64)<1||A>26);++b)k=26*k+A;M=--k}else++M;for(b=0;b!=m.length&&62!==m.charCodeAt(b);++b);if(++b,(w=Me(m.slice(0,b),!0)).r||(w.r=Pe({r:O-1,c:M})),j={t:""},null!=(v=(G=m.slice(b)).match(s))&&""!==v[1]&&(j.v=tt(v[1])),p.cellFormula){if(null!=(v=G.match(o))&&""!==v[1]){if(j.f=tt(gt(v[1])).replace(/\r\n/g,"\n"),p.xlfn||(j.f=Vp(j.f)),v[0].indexOf('t="array"')>-1)j.F=(G.match(i)||[])[1],j.F.indexOf(":")>-1&&ye.push([Ke(j.F),j.F]);else if(v[0].indexOf('t="shared"')>-1){z=Me(v[0]);var ce=tt(gt(v[1]));p.xlfn||(ce=Vp(ce)),ke[parseInt(z.si,10)]=[z,ce,w.r]}}else(v=G.match(/<f[^>]*\/>/))&&ke[(z=Me(v[0])).si]&&(j.f=sE(ke[z.si][1],ke[z.si][2],w.r));var ne=Rt(w.r);for(b=0;b<ye.length;++b)ne.r>=ye[b][0].s.r&&ne.r<=ye[b][0].e.r&&ne.c>=ye[b][0].s.c&&ne.c<=ye[b][0].e.c&&(j.F=ye[b][1])}if(null==w.t&&void 0===j.v)if(j.f||j.F)j.v=0,j.t="n";else{if(!I)continue;j.t="z"}else j.t=w.t||"n";switch(u.s.c>M&&(u.s.c=M),u.e.c<M&&(u.e.c=M),j.t){case"n":if(""==j.v||null==j.v){if(!I)continue;j.t="z"}else j.v=parseFloat(j.v);break;case"s":if(typeof j.v>"u"){if(!I)continue;j.t="z"}else H=Ma[parseInt(j.v,10)],j.v=H.t,j.r=H.r,p.cellHTML&&(j.h=H.h);break;case"str":j.t="s",j.v=null!=j.v?gt(j.v):"",p.cellHTML&&(j.h=Co(j.v));break;case"inlineStr":v=G.match(r),j.t="s",null!=v&&(H=Qo(v[1]))?(j.v=H.t,p.cellHTML&&(j.h=H.h)):j.v="";break;case"b":j.v=yt(j.v);break;case"d":p.cellDates?j.v=Dt(j.v,1):(j.v=en(Dt(j.v,1)),j.t="n");break;case"e":(!p||!1!==p.cellText)&&(j.w=j.v),j.v=Pd[j.v]}if(P=oe=0,ae=null,ve&&void 0!==w.s&&null!=(ae=h.CellXf[w.s])&&(null!=ae.numFmtId&&(P=ae.numFmtId),p.cellStyles&&null!=ae.fillId&&(oe=ae.fillId)),e0(j,P,oe,p,f,h),p.cellDates&&ve&&"n"==j.t&&ui(Re[P])&&(j.t="d",j.v=bs(j.v)),w.cm&&p.xlmeta){var Le=(p.xlmeta.Cell||[])[+w.cm-1];Le&&"XLDAPR"==Le.type&&(j.D=!0)}if(He){var E=Rt(w.r);d[E.r]||(d[E.r]=[]),d[E.r][E.c]=j}else d[w.r]=j}}}}ge.length>0&&(d["!rows"]=ge)}}(),f5=xi;function r0(n){return[gi(n),bn(n),"n"]}var J5=xi,i0=["left","right","top","bottom","header","footer"];var pl=[["allowRefreshQuery",!1,"bool"],["autoCompressPictures",!0,"bool"],["backupFile",!1,"bool"],["checkCompatibility",!1,"bool"],["CodeName",""],["date1904",!1,"bool"],["defaultThemeVersion",0,"int"],["filterPrivacy",!1,"bool"],["hidePivotFieldList",!1,"bool"],["promptedSolutions",!1,"bool"],["publishItems",!1,"bool"],["refreshAllConnections",!1,"bool"],["saveExternalLinkValues",!0,"bool"],["showBorder
1UnselectedTables",!0,"bool"],["showInkAnnotation",!0,"bool"],["showObjects","all"],["showPivotChartFilter",!1,"bool"],["updateLinks","userSet"]],j8=[["activeTab",0,"int"],["autoFilterDateGrouping",!0,"bool"],["firstSheet",0,"int"],["minimized",!1,"bool"],["showHorizontalScroll",!0,"bool"],["showSheetTabs",!0,"bool"],["showVerticalScroll",!0,"bool"],["tabRatio",600,"int"],["visibility","visible"]],A8=[],M8=[["calcCompleted","true"],["calcMode","auto"],["calcOnSave","true"],["concurrentCalc","true"],["fullCalcOnLoad","false"],["fullPrecision","true"],["iterate","false"],["iterateCount","100"],["iterateDelta","0.001"],["refMode","A1"]];function a0(n,a){for(var t=0;t!=n.length;++t)for(var r=n[t],i=0;i!=a.length;++i){var s=a[i];if(null==r[s[0]])r[s[0]]=s[1];else switch(s[2]){case"bool":"string"==typeof r[s[0]]&&(r[s[0]]=yt(r[s[0]]));break;case"int":"string"==typeof r[s[0]]&&(r[s[0]]=parseInt(r[s[0]],10))}}}function s0(n,a){for(var t=0;t!=a.length;++t){var r=a[t];if(null==n[r[0]])n[r[0]]=r[1];else switch(r[2]){case"bool":"string"==typeof n[r[0]]&&(n[r[0]]=yt(n[r[0]]));break;case"int":"string"==typeof n[r[0]]&&(n[r[0]]=parseInt(n[r[0]],10))}}}function o0(n){s0(n.WBProps,pl),s0(n.CalcPr,M8),a0(n.WBView,j8),a0(n.Sheets,A8),Hi.date1904=yt(n.WBProps.date1904)}var O8="][*?/\\".split("");var G8=/<\w+:workbook/;function X8(n,a){var t={};return n.read_shift(4),t.ArchID=n.read_shift(4),n.l+=a-8,t}function Z8(n,a,t,r,i,s,o,l){return".bin"===a.slice(-4)?function f8(n,a,t,r,i,s,o){if(!n)return n;var l=a||{};r||(r={"!id":{}});var d,g,m,_,v,k,b,A,G,j,c=l.dense?[]:{},p={s:{r:2e6,c:2e6},e:{r:0,c:0}},u=[],f=!1,h=!1,w=[];l.biff=12,l["!row"]=0;var O=0,M=!1,H=[],z={},P=l.supbooks||i.supbooks||[[]];if(P.sharedf=z,P.arrayf=H,P.SheetNames=i.SheetNames||i.Sheets.map(function(Fe){return Fe.name}),!l.supbooks&&(l.supbooks=P,i.Names))for(var oe=0;oe<i.Names.length;++oe)P[0][oe+1]=i.Names[oe];var ke,He,ve=[],ae=[],ye=!1;if(Ga[16]={n:"BrtShortReal",f:r0},Ar(n,function(te,I,X){if(!h)switch(X){case 148:d=te;break;case 0:g=te,l.sheetRows&&l.sheetRows<=g.r&&(h=!0),G=Nt(v=g.r),l["!row"]=g.r,(te.hidden||te.hpt||null!=te.level)&&(te.hpt&&(te.hpx=Xi(te.hpt)),ae[te.r]=te);break;case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 13:case 14:case 15:case 16:case 17:case 18:case 62:switch(m={t:te[2]},te[2]){case"n":m.v=te[1];break;case"s":m.v=(A=Ma[te[1]]).t,m.r=A.r;break;case"b":m.v=!!te[1];break;case"e":m.v=te[1],!1!==l.cellText&&(m.w=Mr[m.v]);break;case"str":m.t="s",m.v=te[1];break;case"is":m.t="s",m.v=te[1].t}if((_=o.CellXf[te[0].iStyleRef])&&e0(m,_.numFmtId,null,l,s,o),k=-1==te[0].c?k+1:te[0].c,l.dense?(c[v]||(c[v]=[]),c[v][k]=m):c[Ft(k)+G]=m,l.cellFormula){for(M=!1,O=0;O<H.length;++O){var R=H[O];g.r>=R[0].s.r&&g.r<=R[0].e.r&&k>=R[0].s.c&&k<=R[0].e.c&&(m.F=Ge(R[0]),M=!0)}!M&&te.length>3&&(m.f=te[3])}if(p.s.r>g.r&&(p.s.r=g.r),p.s.c>k&&(p.s.c=k),p.e.r<g.r&&(p.e.r=g.r),p.e.c<k&&(p.e.c=k),l.cellDates&&_&&"n"==m.t&&ui(Re[_.numFmtId])){var D=zr(m.v);D&&(m.t="d",m.v=new Date(D.y,D.m-1,D.d,D.H,D.M,D.S,D.u))}ke&&("XLDAPR"==ke.type&&(m.D=!0),ke=void 0),He&&(He=void 0);break;case 1:case 12:if(!l.sheetStubs||f)break;m={t:"z",v:void 0},k=-1==te[0].c?k+1:te[0].c,l.dense?(c[v]||(c[v]=[]),c[v][k]=m):c[Ft(k)+G]=m,p.s.r>g.r&&(p.s.r=g.r),p.s.c>k&&(p.s.c=k),p.e.r<g.r&&(p.e.r=g.r),p.e.c<k&&(p.e.c=k),ke&&("XLDAPR"==ke.type&&(m.D=!0),ke=void 0),He&&(He=void 0);break;case 176:w.push(te);break;case 49:ke=((l.xlmeta||{}).Cell||[])[te-1];break;case 494:var Z=r["!id"][te.relId];for(Z?(te.Target=Z.Target,te.loc&&(te.Target+="#"+te.loc),te.Rel=Z):""==te.relId&&(te.Target="#"+te.loc),v=te.rfx.s.r;v<=te.rfx.e.r;++v)for(k=te.rfx.s.c;k<=te.rfx.e.c;++k)l.dense?(c[v]||(c[v]=[]),c[v][k]||(c[v][k]={t:"z",v:void 0}),c[v][k].l=te):(b=Pe({c:k,r:v}),c[b]||(c[b]={t:"z",v:void 0}),c[b].l=te);break;case 426:if(!l.cellFormula)break;H.push(te),(j=l.dense?c[v][k]:c[Ft(k)+G]).f=Tn(te[1],0,{r:g.r,c:k},P,l),j.F=Ge(te[0]);break;case 427:if(!l.cellFormula)break;z[Pe(te[0].s)]=te[1],(j=l.dense?c[v][k]:c[Ft(k)+G]).f=Tn(te[1],0,{r:g.r,c:k},P,l);break;case 60:if(!l.cellStyles)break;for(;te.e>=te.s;)ve[te.e--]={width:te.w/256,hidden:!!(1&te.flags),level:te.level},ye||(ye=!0,tl(te.w/256)),Fi(ve[te.e+1]);break;case 161:c["!autofilter"]={ref:Ge(te)};break;case 476:c["!margins"]=te;break;case 147:i.Sheets[t]||(i.Sheets[t]={}
1),te.name&&(i.Sheets[t].CodeName=te.name),(te.above||te.left)&&(c["!outline"]={above:te.above,left:te.left});break;case 137:i.Views||(i.Views=[{}]),i.Views[0]||(i.Views[0]={}),te.RTL&&(i.Views[0].RTL=!0);break;case 485:case 64:case 1053:case 151:case 152:case 175:case 644:case 625:case 562:case 396:case 1112:case 1146:case 471:case 1050:case 649:case 1105:case 589:case 607:case 564:case 1055:case 168:case 174:case 1180:case 499:case 507:case 550:case 171:case 167:case 1177:case 169:case 1181:case 551:case 552:case 661:case 639:case 478:case 537:case 477:case 536:case 1103:case 680:case 1104:case 1024:case 663:case 535:case 678:case 504:case 1043:case 428:case 170:case 3072:case 50:case 2070:case 1045:break;case 35:f=!0;break;case 36:f=!1;break;case 37:u.push(X),f=!0;break;case 38:u.pop(),f=!1;break;default:if(!I.T&&(!f||l.WTF))throw new Error("Unexpected record 0x"+X.toString(16))}},l),delete l.supbooks,delete l["!row"],!c["!ref"]&&(p.s.r<2e6||d&&(d.e.r>0||d.e.c>0||d.s.r>0||d.s.c>0))&&(c["!ref"]=Ge(d||p)),l.sheetRows&&c["!ref"]){var ge=Ke(c["!ref"]);l.sheetRows<=+ge.e.r&&(ge.e.r=l.sheetRows-1,ge.e.r>p.e.r&&(ge.e.r=p.e.r),ge.e.r<ge.s.r&&(ge.s.r=ge.e.r),ge.e.c>p.e.c&&(ge.e.c=p.e.c),ge.e.c<ge.s.c&&(ge.s.c=ge.e.c),c["!fullref"]=c["!ref"],c["!ref"]=Ge(ge))}return w.length>0&&(c["!merges"]=w),ve.length>0&&(c["!cols"]=ve),ae.length>0&&(c["!rows"]=ae),c}(n,r,t,i,s,o,l):function XI(n,a,t,r,i,s,o){if(!n)return n;r||(r={"!id":{}});var l=a.dense?[]:{},c={s:{r:2e6,c:2e6},e:{r:0,c:0}},d="",p="",u=n.match(OI);u?(d=n.slice(0,u.index),p=n.slice(u.index+u[0].length)):d=p=n;var f=d.match(t0);f?dl(f[0],0,i,t):(f=d.match(VI))&&function WI(n,a,t,r,i){dl(n.slice(0,n.indexOf(">")),0,r,i)}(f[0],0,0,i,t);var h=(d.match(/<(?:\w*:)?dimension/)||{index:-1}).index;if(h>0){var g=d.slice(h,h+50).match(GI);g&&function MI(n,a){var t=Ke(a);t.s.r<=t.e.r&&t.s.c<=t.e.c&&t.s.r>=0&&t.s.c>=0&&(n["!ref"]=Ge(t))}(l,g[1])}var m=d.match(UI);m&&m[1]&&function a5(n,a){a.Views||(a.Views=[{}]),(n.match(i5)||[]).forEach(function(t,r){var i=Me(t);a.Views[r]||(a.Views[r]={}),+i.zoomScale&&(a.Views[r].zoom=+i.zoomScale),yt(i.rightToLeft)&&(a.Views[r].RTL=!0)})}(m[1],i);var _=[];if(a.cellStyles){var v=d.match(BI);v&&function e5(n,a){for(var t=!1,r=0;r!=a.length;++r){var i=Me(a[r],!0);i.hidden&&(i.hidden=yt(i.hidden));var s=parseInt(i.min,10)-1,o=parseInt(i.max,10)-1;for(i.outlineLevel&&(i.level=+i.outlineLevel||0),delete i.min,delete i.max,i.width=+i.width,!t&&i.width&&(t=!0,tl(i.width)),Fi(i);s<=o;)n[s++]=xt(i)}}(_,v)}u&&l5(u[1],l,a,c,s,o);var k=p.match(LI);k&&(l["!autofilter"]=function n5(n){return{ref:(n.match(/ref="([^"]*)"/)||[])[1]}}(k[0]));var b=[],A=p.match(PI);if(A)for(h=0;h!=A.length;++h)b[h]=Ke(A[h].slice(A[h].indexOf('"')+1));var G=p.match(NI);G&&function KI(n,a,t){for(var r=Array.isArray(n),i=0;i!=a.length;++i){var s=Me(gt(a[i]),!0);if(!s.ref)return;var o=((t||{})["!id"]||[])[s.id];o?(s.Target=o.Target,s.location&&(s.Target+="#"+tt(s.location))):(s.Target="#"+tt(s.location),o={Target:s.Target,TargetMode:"Internal"}),s.Rel=o,s.tooltip&&(s.Tooltip=s.tooltip,delete s.tooltip);for(var l=Ke(s.ref),c=l.s.r;c<=l.e.r;++c)for(var d=l.s.c;d<=l.e.c;++d){var p=Pe({c:d,r:c});r?(n[c]||(n[c]=[]),n[c][d]||(n[c][d]={t:"z",v:void 0}),n[c][d].l=s):(n[p]||(n[p]={t:"z",v:void 0}),n[p].l=s)}}}(l,G,r);var j=p.match($I);if(j&&(l["!margins"]=function QI(n){var a={};return["left","right","top","bottom","header","footer"].forEach(function(t){n[t]&&(a[t]=parseFloat(n[t]))}),a}(Me(j[0]))),!l["!ref"]&&c.e.c>=c.s.c&&c.e.r>=c.s.r&&(l["!ref"]=Ge(c)),a.sheetRows>0&&l["!ref"]){var w=Ke(l["!ref"]);a.sheetRows<=+w.e.r&&(w.e.r=a.sheetRows-1,w.e.r>c.e.r&&(w.e.r=c.e.r),w.e.r<w.s.r&&(w.s.r=w.e.r),w.e.c>c.e.c&&(w.e.c=c.e.c),w.e.c<w.s.c&&(w.s.c=w.e.c),l["!fullref"]=l["!ref"],l["!ref"]=Ge(w))}return _.length>0&&(l["!cols"]=_),b.length>0&&(l["!merges"]=b),l}(n,r,t,i,s,o,l)}var Oa,p0=/([\w:]+)=((?:")([^"]*)(?:")|(?:')([^']*)(?:'))/g,u0=/([\w:]+)=((?:")(?:[^"]*)(?:")|(?:')(?:[^']*)(?:'))/;function ur(n,a){var t=n.split(/\s+/),r=[];if(a||(r[0]=t[0]),1===t.length)return r;var s,o,c,i=n.match(p0);if(i)for(c=0;c!=i.length;++c)-1===(o=(s=i[c].match(u0))[1].indexOf(":"))?r[s[1]]=s[2].slice(1,s[2].length-1):r["xmlns:"===s[1].slice(0,6)?"xmlns"+s[1].slice(6):s[1].slice(o+1)]=s[2].slice(1,s[2].length-1);return r}function g7(n){var t={};if(1===n.split(/\s+/).length)return t;var i,s,l,r=n.match(p0);if(r)for(l=0;l!=r.length;++l)-1===(s=(i=r[l].match(u0))[1].indexOf(":"))?t[i[1]]=i[2].slice(1,i[2].length-1):t["xmlns:"===i[1].slice(0,6)?"xmlns"+i[1].slice(6):i[1].slice(s+1)]=i[2].slice(1,i[2].length-1);return t}function x7(n,a,t,r){var i=r;switch((t[0].match(/dt:dt="([\w.]+)"/)||["",""])[1]){case"boolean":i=yt(r);break;case"i2":case"int":i=parseInt(r,10);break;case"r4":case"float":i=parseFloat(r);break;case"date":case"dateTime.tz":i=Dt(r);break;case"i8":case"string":case"fixed":case"uuid":case"bin.base64":break;default:throw new Error("bad custprop:"+t[0])}
1n[tt(a)]=i}function b7(n,a,t){if(t.cellStyles&&a.Interior){var r=a.Interior;r.Pattern&&(r.patternType=AF[r.Pattern]||r.Pattern)}n[a.ID]=a}function C7(n,a,t,r,i,s,o,l,c,d){var p="General",u=r.StyleID,f={};d=d||{};var h=[],g=0;for(void 0===u&&l&&(u=l.StyleID),void 0===u&&o&&(u=o.StyleID);void 0!==s[u]&&(s[u].nf&&(p=s[u].nf),s[u].Interior&&h.push(s[u].Interior),s[u].Parent);)u=s[u].Parent;switch(t.Type){case"Boolean":r.t="b",r.v=yt(n);break;case"String":r.t="s",r.r=id(tt(n)),r.v=n.indexOf("<")>-1?tt(a||n).replace(/<.*?>/g,""):r.r;break;case"DateTime":"Z"!=n.slice(-1)&&(n+="Z"),r.v=(Dt(n)-new Date(Date.UTC(1899,11,30)))/864e5,r.v!=r.v?r.v=tt(n):r.v<60&&(r.v=r.v-1),(!p||"General"==p)&&(p="yyyy-mm-dd");case"Number":void 0===r.v&&(r.v=+n),r.t||(r.t="n");break;case"Error":r.t="e",r.v=Pd[n],!1!==d.cellText&&(r.w=n);break;default:""==n&&""==a?r.t="z":(r.t="s",r.v=id(a||n))}if(function v7(n,a,t){if("z"!==n.t){if(!t||!1!==t.cellText)try{n.w="e"===n.t?n.w||Mr[n.v]:"General"===a?"n"===n.t?(0|n.v)===n.v?n.v.toString(10):fa(n.v):pi(n.v):function _7(n,a){var t=Oa[n]||tt(n);return"General"===t?pi(a):Ln(t,a)}(a||"General",n.v)}catch(s){if(t.WTF)throw s}try{var r=Oa[a]||a||"General";if(t.cellNF&&(n.z=r),t.cellDates&&"n"==n.t&&ui(r)){var i=zr(n.v);i&&(n.t="d",n.v=new Date(i.y,i.m-1,i.d,i.H,i.M,i.S,i.u))}}catch(s){if(t.WTF)throw s}}}(r,p,d),!1!==d.cellFormula)if(r.Formula){var m=tt(r.Formula);61==m.charCodeAt(0)&&(m=m.slice(1)),r.f=Wi(m,i),delete r.Formula,"RC"==r.ArrayRange?r.F=Wi("RC:RC",i):r.ArrayRange&&(r.F=Wi(r.ArrayRange,i),c.push([Ke(r.F),r.F]))}else for(g=0;g<c.length;++g)i.r>=c[g][0].s.r&&i.r<=c[g][0].e.r&&i.c>=c[g][0].s.c&&i.c<=c[g][0].e.c&&(r.F=c[g][1]);d.cellStyles&&(h.forEach(function(_){!f.patternType&&_.patternType&&(f.patternType=_.patternType)}),r.s=f),void 0!==r.StyleID&&(r.ixfe=r.StyleID)}function k7(n){n.t=n.v||"",n.t=n.t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),n.v=n.w=n.ixfe=void 0}function ul(n,a){var t=a||{};Ni();var r=Mi(wo(n));("binary"==t.type||"array"==t.type||"base64"==t.type)&&(r=gt(r));var i=r.slice(0,1024).toLowerCase(),s=!1;if((1023&(i=i.replace(/".*?"/g,"")).indexOf(">"))>Math.min(1023&i.indexOf(","),1023&i.indexOf(";"))){var o=xt(t);return o.type="string",Ui.to_workbook(r,o)}if(-1==i.indexOf("<?xml")&&["html","table","head","meta","script","style","div"].forEach(function(Vt){i.indexOf("<"+Vt)>=0&&(s=!0)}),s)return function iD(n,a){var t=n.match(/<table[\s\S]*?>[\s\S]*?<\/table>/gi);if(!t||0==t.length)throw new Error("Invalid HTML: could not find <table>");if(1==t.length)return Qr(g0(t[0],a),a);var r={SheetNames:[],Sheets:{}};return t.forEach(function(i,s){El(r,g0(i,a),"Sheet"+(s+1))}),r}(r,t);Oa={"General Number":"General","General Date":Re[22],"Long Date":"dddd, mmmm dd, yyyy","Medium Date":Re[15],"Short Date":Re[14],"Long Time":Re[19],"Medium Time":Re[18],"Short Time":Re[20],Currency:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',Fixed:Re[2],Standard:Re[4],Percent:Re[10],Scientific:Re[11],"Yes/No":'"Yes";"Yes";"No";@',"True/False":'"True";"True";"False";@',"On/Off":'"Yes";"Yes";"No";@'};var l,d,ke,c=[],p={},u=[],f=t.dense?[]:{},h="",g={},m={},_=ur('<Data ss:Type="String">'),v=0,k=0,b=0,A={s:{r:2e6,c:2e6},e:{r:0,c:0}},G={},j={},w="",O=0,M=[],H={},z={},P=0,oe=[],ve=[],ae={},ye=[],He=!1,ge=[],Fe=[],te={},I=0,X=0,R={Sheets:[],WBProps:{date1904:!1}},D={};xa.lastIndex=0,r=r.replace(/<!--([\s\S]*?)-->/gm,"");for(var Z="";l=xa.exec(r);)switch(l[3]=(Z=l[3]).toLowerCase()){case"data":if("data"==Z){if("/"===l[1]){if((d=c.pop())[0]!==l[3])throw new Error("Bad state: "+d.join("|"))}else"/"!==l[0].charAt(l[0].length-2)&&c.push([l[3],!0]);break}if(c[c.length-1][1])break;"/"===l[1]?C7(r.slice(v,l.index),w,_,"comment"==c[c.length-1][0]?ae:g,{c:k,r:b},G,ye[k],m,ge,t):(w="",_=ur(l[0]),v=l.index+l[0].length);break;case"cell":if("/"===l[1])if(ve.length>0&&(g.c=ve),(!t.sheetRows||t.sheetRows>b)&&void 0!==g.v&&(t.dense?(f[b]||(f[b]=[]),f[b][k]=g):f[Ft(k)+Nt(b)]=g),g.HRef&&(g.l={Target:tt(g.HRef)},g.HRefScreenTip&&(g.l.Tooltip=g.HRefScreenTip),delete g.HRef,delete g.HRefScreenTip),(g.MergeAcross||g.MergeDown)&&(I=k+(0|parseInt(g.MergeAcross,10)),X=b+(0|parseInt(g.MergeDown,10)),M.push({s:{c:k,r:b},e:{c:I,r:X}})),t.sheetStubs)if(g.MergeAcross||g.MergeDown){for(var me=k;me<=I;++me)for(var le=b;le<=X;++le)(me>k||le>
1b)&&(t.dense?(f[le]||(f[le]=[]),f[le][me]={t:"z"}):f[Ft(me)+Nt(le)]={t:"z"});k=I+1}else++k;else g.MergeAcross?k=I+1:++k;else(g=g7(l[0])).Index&&(k=+g.Index-1),k<A.s.c&&(A.s.c=k),k>A.e.c&&(A.e.c=k),"/>"===l[0].slice(-2)&&++k,ve=[];break;case"row":"/"===l[1]||"/>"===l[0].slice(-2)?(b<A.s.r&&(A.s.r=b),b>A.e.r&&(A.e.r=b),"/>"===l[0].slice(-2)&&(m=ur(l[0])).Index&&(b=+m.Index-1),k=0,++b):((m=ur(l[0])).Index&&(b=+m.Index-1),te={},("0"==m.AutoFitHeight||m.Height)&&(te.hpx=parseInt(m.Height,10),te.hpt=Ia(te.hpx),Fe[b]=te),"1"==m.Hidden&&(te.hidden=!0,Fe[b]=te));break;case"worksheet":if("/"===l[1]){if((d=c.pop())[0]!==l[3])throw new Error("Bad state: "+d.join("|"));u.push(h),A.s.r<=A.e.r&&A.s.c<=A.e.c&&(f["!ref"]=Ge(A),t.sheetRows&&t.sheetRows<=A.e.r&&(f["!fullref"]=f["!ref"],A.e.r=t.sheetRows-1,f["!ref"]=Ge(A))),M.length&&(f["!merges"]=M),ye.length>0&&(f["!cols"]=ye),Fe.length>0&&(f["!rows"]=Fe),p[h]=f}else A={s:{r:2e6,c:2e6},e:{r:0,c:0}},b=k=0,c.push([l[3],!1]),d=ur(l[0]),h=tt(d.Name),f=t.dense?[]:{},M=[],ge=[],Fe=[],R.Sheets.push(D={name:h,Hidden:0});break;case"table":if("/"===l[1]){if((d=c.pop())[0]!==l[3])throw new Error("Bad state: "+d.join("|"))}else{if("/>"==l[0].slice(-2))break;c.push([l[3],!1]),ye=[],He=!1}break;case"style":"/"===l[1]?b7(G,j,t):j=ur(l[0]);break;case"numberformat":j.nf=tt(ur(l[0]).Format||"General"),Oa[j.nf]&&(j.nf=Oa[j.nf]);for(var ce=0;392!=ce&&Re[ce]!=j.nf;++ce);if(392==ce)for(ce=57;392!=ce;++ce)if(null==Re[ce]){xr(j.nf,ce);break}break;case"column":if("table"!==c[c.length-1][0])break;if((ke=ur(l[0])).Hidden&&(ke.hidden=!0,delete ke.Hidden),ke.Width&&(ke.wpx=parseInt(ke.Width,10)),!He&&ke.wpx>10){He=!0,kn=6;for(var ne=0;ne<ye.length;++ne)ye[ne]&&Fi(ye[ne])}He&&Fi(ke),ye[ke.Index-1||ye.length]=ke;for(var Le=0;Le<+ke.Span;++Le)ye[ye.length]=xt(ke);break;case"namedrange":if("/"===l[1])break;R.Names||(R.Names=[]);var E=Me(l[0]),mt={Name:E.Name,Ref:Wi(E.RefersTo.slice(1),{r:0,c:0})};R.Sheets.length>0&&(mt.Sheet=R.Sheets.length-1),R.Names.push(mt);break;case"namedcell":case"b":case"i":case"u":case"s":case"em":case"h2":case"h3":case"sub":case"sup":case"span":case"alignment":case"borders":case"border":case"protection":case"paragraphs":case"name":case"pixelsperinch":case"null":break;case"font":if("/>"===l[0].slice(-2))break;"/"===l[1]?w+=r.slice(O,l.index):O=l.index+l[0].length;break;case"interior":if(!t.cellStyles)break;j.Interior=ur(l[0]);break;case"author":case"title":case"description":case"created":case"keywords":case"subject":case"category":case"company":case"lastauthor":case"lastsaved":case"lastprinted":case"version":case"revision":case"totaltime":case"hyperlinkbase":case"manager":case"contentstatus":case"identifier":case"language":case"appname":if("/>"===l[0].slice(-2))break;"/"===l[1]?HT(H,Z,r.slice(P,l.index)):P=l.index+l[0].length;break;case"styles":case"workbook":if("/"===l[1]){if((d=c.pop())[0]!==l[3])throw new Error("Bad state: "+d.join("|"))}else c.push([l[3],!1]);break;case"comment":if("/"===l[1]){if((d=c.pop())[0]!==l[3])throw new Error("Bad state: "+d.join("|"));k7(ae),ve.push(ae)}else c.push([l[3],!1]),ae={a:(d=ur(l[0])).Author};break;case"autofilter":if("/"===l[1]){if((d=c.pop())[0]!==l[3])throw new Error("Bad state: "+d.join("|"))}else if("/"!==l[0].charAt(l[0].length-2)){var qe=ur(l[0]);f["!autofilter"]={ref:Wi(qe.Range).replace(/\$/g,"")},c.push([l[3],!0])}break;case"datavalidation":if("/"===l[1]){if((d=c.pop())[0]!==l[3])throw new Error("Bad state: "+d.join("|"))}else"/"!==l[0].charAt(l[0].length-2)&&c.push([l[3],!0]);break;case"componentoptions":case"documentproperties":case"customdocumentproperties":case"officedocumentsettings":case"pivottable":case"pivotcache":case"names":case"mapinfo":case"pagebreaks":case"querytable":case"sorting":case"schema":case"conditionalformatting":case"smarttagtype":case"smarttags":case"excelworkbook":case"workbookoptions":case"worksheetoptions":if("/"===l[1]){if((d=c.pop())[0]!==l[3])throw new Error("Bad state: "+d.join("|"))}else"/"!==l[0].charAt(l[0].length-2)&&c.push([l[3],!0]);break;default:if(0==c.length&&"document"==l[3]||0==c.length&&"uof"==l[3])return E0(r,t);var ht=!0;switch(c[c.length-1][0]){case"officedocumentsettings":switch(l[3]){case"allowpng":case"removepersonalinformation":case"downloadcomponents":case"locationofcomponents":case"colors":case"color":case"index":case"rgb":case"targetscreensize":case"readonlyrecommended":break;default:ht=!1}break;case"componentoptions":switch(l[3]){case"toolbar":case"hideofficelogo":case"spreadsheetautofit":case"label":case"caption":case"maxheight":case"maxwidth":case"nextsheetnumber":break;default:ht=!1}break;case"excelworkbook":switch(l[3]){case"date1904":R.WBProps.date1904=!0;break;case"windowheight":case"windowwidth":case"windowtopx":case"windowtopy":case"tabratio":case"protectstructure":case"protectwindow":case"protectwindows":case"activesheet":case"displayinknotes":case"firstvisiblesheet":case"supbook":case"sheetname":case"sheetindex":case"sheetindexfirst":case"sheetindexlast":case"dll":case"acceptlabelsinformulas":case"donotsavelinkvalues":case"iteration":case"maxiterations":case"maxchange":case"path":case"xct":case"count":case"selectedsheets":case"calculation":case"uncalced":case"startupprompt":case"crn":case"externname":case"formula":case"colfirst":case"collast":case"wantadvise":case"boolean":case"error":case"text":case"ole":case"noautorecover":case"publishobjects":case"donotcalculatebeforesave":case"number":case"refmoder1c1":case"embedsavesmarttags":break;default:ht=!1}break;case"workbookoptions":switch(l[3]){case"owcversion":case"height":case"width":break;default:ht=!1}break;case"worksheetoptions":switch(l[3]){case"visible":if("/>"!==l[0].slice(-2))if("/"===l[1])switch(r.slice(P,l.index)){case"SheetHidden":D.Hidden=1;break;case"SheetVeryHidden":D.Hidden=2}else P=l.index+l[0].length;break;case"header":f["!margins"]||Si(f["!margins"]={},"xlml"),isNaN(+Me(l[0]).Margin)||(f["!margins"].header=+Me(l[0]).Margin);break;case"footer":f["!margins"]||Si(f["!margins"]={},"xlml"),isNaN(+Me(l[0]).Margin)||(f["!margins"].footer=+Me(l[0]).Margin);break;case"pagemargins":var Je=Me(l[0]);f["!margins"]||Si(f["!margins"]={},"xlml"),isNaN(+Je.Top)||(f["!margins"].top=+Je.Top),isNaN(+Je.Left)||(f["!margins"].left=+Je.Left),isNaN(+Je.Right)||(f["!margins"].right=+Je.Right),isNaN(+Je.Bottom)||(f["!margins"].bottom=+Je.Bottom);break;case"displayrighttoleft":R.Views||(R.Views=[]),R.Views[0]||(R.Views[0]={}),R.Views[0].RTL=!0;break;case"freezepanes":case"frozennosplit":case"splithorizontal":case"splitvertical":case"donotdisplaygridlines":case"activerow":case"activecol":case"toprowbottompane":case"leftcolumnrightpane":case"unsynced":case"print":case"printerrors":case"panes":case"scale":case"pane":case"number":case"layout":case"pagesetup":case"selected":case"protectobjects":case"enableselection":case"protectscenarios":case"validprinterinfo":case"horizontalresolution":case"verticalresolution":case"numberofcopies":case"activepane":case"toprowvisible":case"leftcolumnvisible":case"fittopage":case"rangeselection":case"papersizeindex":case"pagelayoutzoom":case"pagebreakzoom":case"filteron":case"fitwidth":case"fitheight":case"commentslayout":case"zoom":case"lefttoright":case"gridlines":case"allowsort":case"allowfilter":case"allowinsertrows":case"allowdeleterows":case"allowinsertcols":case"allowdeletecols":case"allowinserthyperlinks":case"allowformatcells":case"allowsizecols":case"allowsizerows":case"tabcolorindex":case"donotdisplayheadings":case"showpagelayoutzoom":case"blackandwhite":case"donotdisplayzeros":case"displaypagebreak":case"rowcolheadings":case"donotdisplayoutline":case"noorientation":case"allowusepivottables":case"zeroheight":case"view
1ablerange":case"selection":case"protectcontents":break;case"nosummaryrowsbelowdetail":f["!outline"]||(f["!outline"]={}),f["!outline"].above=!0;break;case"nosummarycolumnsrightdetail":f["!outline"]||(f["!outline"]={}),f["!outline"].left=!0;break;default:ht=!1}break;case"pivottable":case"pivotcache":switch(l[3]){case"immediateitemsondrop":case"showpagemultipleitemlabel":case"compactrowindent":case"location":case"pivotfield":case"orientation":case"layoutform":case"layoutsubtotallocation":case"layoutcompactrow":case"position":case"pivotitem":case"datatype":case"datafield":case"sourcename":case"parentfield":case"ptlineitems":case"ptlineitem":case"countofsameitems":case"item":case"itemtype":case"ptsource":case"cacheindex":case"consolidationreference":case"filename":case"reference":case"nocolumngrand":case"norowgrand":case"blanklineafteritems":case"hidden":case"subtotal":case"basefield":case"mapchilditems":case"function":case"refreshonfileopen":case"printsettitles":case"mergelabels":case"defaultversion":case"refreshname":case"refreshdate":case"refreshdatecopy":case"versionlastrefresh":case"versionlastupdate":case"versionupdateablemin":case"versionrefreshablemin":case"calculation":break;default:ht=!1}break;case"pagebreaks":switch(l[3]){case"colbreaks":case"colbreak":case"rowbreaks":case"rowbreak":case"colstart":case"colend":case"rowend":break;default:ht=!1}break;case"autofilter":switch(l[3]){case"autofiltercolumn":case"autofiltercondition":case"autofilterand":case"autofilteror":break;default:ht=!1}break;case"querytable":switch(l[3]){case"id":case"autoformatfont":case"autoformatpattern":case"querysource":case"querytype":case"enableredirections":case"refreshedinxl9":case"urlstring":case"htmltables":case"connection":case"commandtext":case"refreshinfo":case"notitles":case"nextid":case"columninfo":case"overwritecells":case"donotpromptforfile":case"textwizardsettings":case"source":case"number":case"decimal":case"thousandseparator":case"trailingminusnumbers":case"formatsettings":case"fieldtype":case"delimiters":case"tab":case"comma":case"autoformatname":case"versionlastedit":case"versionlastrefresh":break;default:ht=!1}break;case"datavalidation":switch(l[3]){case"range":case"type":case"min":case"max":case"sort":case"descending":case"order":case"casesensitive":case"value":case"errorstyle":case"errormessage":case"errortitle":case"inputmessage":case"inputtitle":case"combohide":case"inputhide":case"condition":case"qualifier":case"useblank":case"value1":case"value2":case"format":case"cellrangelist":break;default:ht=!1}break;case"sorting":case"conditionalformatting":switch(l[3]){case"range":case"type":case"min":case"max":case"sort":case"descending":case"order":case"casesensitive":case"value":case"errorstyle":case"errormessage":case"errortitle":case"cellrangelist":case"inputmessage":case"inputtitle":case"combohide":case"inputhide":case"condition":case"qualifier":case"useblank":case"value1":case"value2":case"format":break;default:ht=!1}break;case"mapinfo":case"schema":case"data":switch(l[3]){case"map":case"entry":case"range":case"xpath":case"field":case"xsdtype":case"filteron":case"aggregate":case"elementtype":case"attributetype":case"schema":case"element":case"complextype":case"datatype":case"all":case"attribute":case"extends":case"row":break;default:ht=!1}break;case"smarttags":break;default:ht=!1}if(ht||l[3].match(/!\[CDATA/))break;if(!c[c.length-1][1])throw"Unrecognized tag: "+l[3]+"|"+c.join("|");if("customdocumentproperties"===c[c.length-1][0]){if("/>"===l[0].slice(-2))break;"/"===l[1]?x7(z,Z,oe,r.slice(P,l.index)):(oe=l,P=l.index+l[0].length);break}if(t.WTF)throw"Unrecognized tag: "+l[3]+"|"+c.join("|")}var _e={};return!t.bookSheets&&!t.bookProps&&(_e.Sheets=p),_e.SheetNames=u,_e.Workbook=R,_e.SSF=xt(Re),_e.Props=H,_e.Custprops=z,_e}function fl(n,a){switch(bl(a=a||{}),a.type||"base64"){case"base64":return ul(Gn(n),a);case"binary":case"buffer":case"file":return ul(n,a);case"array":return ul(Hr(n),a)}}var O7=[60,1084,2066,2165,2175];function N7(n,a,t,r,i){var s=r,o=[],l=t.slice(t.l,t.l+s);if(i&&i.enc&&i.enc.insitu&&l.length>0)switch(n){case 9:case 521:case 1033:case 2057:case 47:case 405:case 225:case 406:case 312:case 404:case 10:case 133:break;default:i.enc.insitu(l)}o.push(l),t.l+=s;for(var c=jr(t,t.l),d=ml[c],p=0;null!=d&&O7.indexOf(c)>-1;)s=jr(t,t.l+2),p=t.l+4,2066==c?p+=4:(2165==c||2175==c)&&(p+=12),l=t.slice(p,t.l+4+s),o.push(l),t.l+=4+s,d=ml[c=jr(t,t.l)];var u=sn(o);fn(u,0);var f=0;u.lens=[];for(var h=0;h<o.length;++h)u.lens.push(f),f+=o[h].length;if(u.length<r)throw"XLS Record 0x"+n.toString(16)+" Truncated: "+u.length+" < "+r;return a.f(u,u.length,i)}function Tr(n,a,t){if("z"!==n.t&&n.XF){var r=0;try{r=n.z||n.XF.numFmtId||0,a.cellNF&&(n.z=Re[r])}catch(s){if(a.WTF)throw s}if(!a||!1!==a.cellText)try{n.w="e"===n.t?n.w||Mr[n.v]:0===r||"General"==r?"n"===n.t?(0|n.v)===n.v?n.v.toString(10):fa(n.v):pi(n.v):Ln(r,n.v,{date1904:!!t,dateNF:a&&a.dateNF})}catch(s){if(a.WTF)throw s}if(a.cellDates&&r&&"n"==n.t&&ui(Re[r]||String(r))){var i=zr(n.v);i&&(n.t="d",n.v=new Date(i.y,i.m-1,i.d,i.H,i.M,i.S,i.u))}}}function $s(n,a,t){return{v:n,ixfe:a,t}}function m0(n,a){var t,r,i,s;if(a||(a={}),bl(a),us(),a.codepage&&ps(a.codepage),n.FullPaths){if(Ee.find(n,"/encryption"))throw new Error("File is password-protected");
1t=Ee.find(n,"!CompObj"),r=Ee.find(n,"/Workbook")||Ee.find(n,"/Book")}else{switch(a.type){case"base64":n=Bn(Gn(n));break;case"binary":n=Bn(n);break;case"buffer":break;case"array":Array.isArray(n)||(n=Array.prototype.slice.call(n))}fn(n,0),r={content:n}}if(t&&function P7(n){var a={},t=n.content;if(t.l=28,a.AnsiUserType=t.read_shift(0,"lpstr-ansi"),a.AnsiClipboardFormat=function FT(n){return Rd(n,1)}(t),t.length-t.l<=4)return a;var r=t.read_shift(4);if(0==r||r>40||(t.l-=4,a.Reserved1=t.read_shift(0,"lpstr-ansi"),t.length-t.l<=4)||1907505652!==(r=t.read_shift(4))||(a.UnicodeClipboardFormat=function ST(n){return Rd(n,2)}(t),0==(r=t.read_shift(4))||r>40))return a;t.l-=4,a.Reserved2=t.read_shift(0,"lpwstr")}(t),a.bookProps&&!a.bookSheets)i={};else{var o=We?"buffer":"array";if(r&&r.content)i=function G7(n,a){var u,h,m,_,b,A,t={opts:{}},r={},i=a.dense?[]:{},s={},o={},l=null,c=[],d="",p={},f="",v={},k=[],G=[],j=[],w={Sheets:[],WBProps:{date1904:!1},Views:[{}]},O={},M=function(ze){return ze<8?bi[ze]:ze<64&&j[ze-8]||bi[ze]},z=function(ze,Ut,ar){if(!(te>1||ar.sheetRows&&ze.r>=ar.sheetRows)){if(ar.cellStyles&&Ut.XF&&Ut.XF.data&&function(ze,Ut,ar){var Ii,tn=Ut.XF.data;tn&&tn.patternType&&ar&&ar.cellStyles&&(Ut.s={},Ut.s.patternType=tn.patternType,(Ii=Fa(M(tn.icvFore)))&&(Ut.s.fgColor={rgb:Ii}),(Ii=Fa(M(tn.icvBack)))&&(Ut.s.bgColor={rgb:Ii}))}(0,Ut,ar),delete Ut.ixfe,delete Ut.XF,u=ze,f=Pe(ze),(!o||!o.s||!o.e)&&(o={s:{r:0,c:0},e:{r:0,c:0}}),ze.r<o.s.r&&(o.s.r=ze.r),ze.c<o.s.c&&(o.s.c=ze.c),ze.r+1>o.e.r&&(o.e.r=ze.r+1),ze.c+1>o.e.c&&(o.e.c=ze.c+1),ar.cellFormula&&Ut.f)for(var tn=0;tn<k.length;++tn)if(!(k[tn][0].s.c>ze.c||k[tn][0].s.r>ze.r||k[tn][0].e.c<ze.c||k[tn][0].e.r<ze.r)){Ut.F=Ge(k[tn][0]),(k[tn][0].s.c!=ze.c||k[tn][0].s.r!=ze.r)&&delete Ut.f,Ut.f&&(Ut.f=""+Tn(k[tn][1],0,ze,ge,P));break}ar.dense?(i[ze.r]||(i[ze.r]=[]),i[ze.r][ze.c]=Ut):i[f]=Ut}},P={enc:!1,sbcch:0,snames:[],sharedf:v,arrayf:k,rrtabid:[],lastuser:"",biff:8,codepage:0,winlocked:0,cellStyles:!!a&&!!a.cellStyles,WTF:!!a&&!!a.wtf};a.password&&(P.password=a.password);var oe,ve=[],ae=[],ye=[],ke=[],He=!1,ge=[];ge.SheetNames=P.snames,ge.sharedf=P.sharedf,ge.arrayf=P.arrayf,ge.names=[],ge.XTI=[];var D,Fe=0,te=0,I=0,X=[],R=[];P.codepage=1200,qn(1200);for(var Z=!1;n.l<n.length-1;){var me=n.l,le=n.read_shift(2);if(0===le&&10===Fe)break;var ce=n.l===n.length?0:n.read_shift(2),ne=ml[le];if(ne&&ne.f){if(a.bookSheets&&133===Fe&&133!==le)break;
1if(Fe=le,2===ne.r||12==ne.r){var Le=n.read_shift(2);if(ce-=2,!P.enc&&Le!==le&&((255&Le)<<8|Le>>8)!==le)throw new Error("rt mismatch: "+Le+"!="+le);12==ne.r&&(n.l+=10,ce-=10)}var E={};if(E=10===le?ne.f(n,ce,P):N7(le,ne,n,ce,P),0==te&&-1===[9,521,1033,2057].indexOf(Fe))continue;switch(le){case 34:t.opts.Date1904=w.WBProps.date1904=E;break;case 134:t.opts.WriteProtect=!0;break;case 47:if(P.enc||(n.l=0),P.enc=E,!a.password)throw new Error("File is password-protected");if(null==E.valid)throw new Error("Encryption scheme unsupported");if(!E.valid)throw new Error("Password is incorrect");break;case 92:P.lastuser=E;break;case 66:var mt=Number(E);switch(mt){case 21010:mt=1200;break;case 32768:mt=1e4;break;case 32769:mt=1252}qn(P.codepage=mt),Z=!0;break;case 317:P.rrtabid=E;break;case 25:P.winlocked=E;break;case 439:t.opts.RefreshAll=E;break;case 12:t.opts.CalcCount=E;break;case 16:t.opts.CalcDelta=E;break;case 17:t.opts.CalcIter=E;break;case 13:t.opts.CalcMode=E;break;case 14:t.opts.CalcPrecision=E;break;case 95:t.opts.CalcSaveRecalc=E;break;case 15:P.CalcRefMode=E;break;case 2211:t.opts.FullCalc=E;break;case 129:E.fDialog&&(i["!type"]="dialog"),E.fBelow||((i["!outline"]||(i["!outline"]={})).above=!0),E.fRight||((i["!outline"]||(i["!outline"]={})).left=!0);break;case 224:G.push(E);break;case 430:ge.push([E]),ge[ge.length-1].XTI=[];break;case 35:case 547:ge[ge.length-1].push(E);break;case 24:case 536:D={Name:E.Name,Ref:Tn(E.rgce,0,null,ge,P)},E.itab>0&&(D.Sheet=E.itab-1),ge.names.push(D),ge[0]||(ge[0]=[],ge[0].XTI=[]),ge[ge.length-1].push(E),"_xlnm._FilterDatabase"==E.Name&&E.itab>0&&E.rgce&&E.rgce[0]&&E.rgce[0][0]&&"PtgArea3d"==E.rgce[0][0][0]&&(R[E.itab-1]={ref:Ge(E.rgce[0][0][1][2])});break;case 22:P.ExternCount=E;break;case 23:0==ge.length&&(ge[0]=[],ge[0].XTI=[]),ge[ge.length-1].XTI=ge[ge.length-1].XTI.concat(E),ge.XTI=ge.XTI.concat(E);break;case 2196:if(P.biff<8)break;null!=D&&(D.Comment=E[1]);break;case 18:i["!protect"]=E;break;case 19:0!==E&&P.WTF&&console.error("Password verifier: "+E);break;case 133:s[E.pos]=E,P.snames.push(E.name);break;case 10:if(--te)break;if(o.e){if(o.e.r>0&&o.e.c>0){if(o.e.r--,o.e.c--,i["!ref"]=Ge(o),a.sheetRows&&a.sheetRows<=o.e.r){var qe=o.e.r;o.e.r=a.sheetRows-1,i["!fullref"]=i["!ref"],i["!ref"]=Ge(o),o.e.r=qe}o.e.r++,o.e.c++}ve.length>0&&(i["!merges"]=ve),ae.length>0&&(i["!objects"]=ae),ye.length>0&&(i["!cols"]=ye),ke.length>0&&(i["!rows"]=ke),w.Sheets.push(O)}""===d?p=i:r[d]=i,i=a.dense?[]:{};break;case 9:case 521:case 1033:case 2057:if(8===P.biff&&(P.biff={9:2,521:3,1033:4}[le]||{512:2,768:3,1024:4,1280:5,1536:8,2:2,7:2}[E.BIFFVer]||8),P.biffguess=0==E.BIFFVer,0==E.BIFFVer&&4096==E.dt&&(P.biff=5,Z=!0,qn(P.codepage=28591)),8==P.biff&&0==E.BIFFVer&&16==E.dt&&(P.biff=2),te++)break;if(i=a.dense?[]:{},P.biff<8&&!Z&&(Z=!0,qn(P.codepage=a.codepage||1252)),P.biff<5||0==E.BIFFVer&&4096==E.dt){""===d&&(d="Sheet1"),o={s:{r:0,c:0},e:{r:0,c:0}};var ht={pos:n.l-ce,name:d};s[ht.pos]=ht,P.snames.push(d)}else d=(s[me]||{name:""}).name;32==E.dt&&(i["!type"]="chart"),64==E.dt&&(i["!type"]="macro"),ve=[],ae=[],P.arrayf=k=[],ye=[],ke=[],He=!1,O={Hidden:(s[me]||{hs:0}).hs,name:d};break;case 515:case 3:case 2:"chart"==i["!type"]&&(a.dense?(i[E.r]||[])[E.c]:i[Pe({c:E.c,r:E.r})])&&++E.c,b={ixfe:E.ixfe,XF:G[E.ixfe]||{},v:E.val,t:"n"},I>0&&(b.z=X[b.ixfe>>8&63]),Tr(b,a,t.opts.Date1904),z({c:E.c,r:E.r},b,a);break;case 5:case 517:b={ixfe:E.ixfe,XF:G[E.ixfe],v:E.val,t:E.t},I>0&&(b.z=X[b.ixfe>>8&63]),Tr(b,a,t.opts.Date1904),z({c:E.c,r:E.r},b,a);break;case 638:b={ixfe:E.ixfe,XF:G[E.ixfe],v:E.rknum,t:"n"},I>0&&(b.z=X[b.ixfe>>8&63]),Tr(b,a,t.opts.Date1904),z({c:E.c,r:E.r},b,a);break;case 189:for(var Je=E.c;Je<=E.C;++Je){var _e=E.rkrec[Je-E.c][0];b={ixfe:_e,XF:G[_e],v:E.rkrec[Je-E.c][1],t:"n"},I>0&&(b.z=X[b.ixfe>>8&63]),Tr(b,a,t.opts.Date1904),z({c:Je,r:E.r},b,a)}break;case 6:case 518:case 1030:if("String"==E.val){l=E;break}if((b=$s(E.val,E.cell.ixfe,E.tt)).XF=G[b.ixfe],a.cellFormula){var Vt=E.formula;if(Vt&&Vt[0]&&Vt[0][0]&&"PtgExp"==Vt[0][0][0]){var ir=Vt[0][0][1][0],yr=Vt[0][0][1][1],Nr=Pe({r:ir,c:yr});v[Nr]?b.f=""+Tn(E.formula,0,E.cell,ge,P):b.F=((a.dense?(i[ir]||[])[yr]:i[Nr])||{}).F}else b.f=""+Tn(E.formula,0,E.cell,ge,P)}I>0&&(b.z=X[b.ixfe>>8&63]),Tr(b,a,t.opts.Date1904),z(E.cell,b,a),l=E;break;case 7:case 519:if(!l)throw new Error("String record expects Formula");l.val=E,(b=$s(E,l.cell.ixfe,"s")).XF=G[b.ixfe],a.cellFormula&&(b.f=""+Tn(l.formula,0,l.cell,ge,P)),I>0&&(b.z=X[b.ixfe>>8&63]),Tr(b,a,t.opts.Date1904),z(l.cell,b,a),l=null;break;case 33:case 545:k.push(E);var Va=Pe(E[0].s);if(h=a.dense?(i[E[0].s.r]||[])[E[0].s.c]:i[Va],a.cellFormula&&h){if(!l||!Va||!h)break;h.f=""+Tn(E[1],0,E[0],ge,P),h.F=Ge(E[0])}break;case 1212:if(!a.cellFormula)break;if(f){if(!l)break;v[Pe(l.cell)]=E[0],((h=a.dense?(i[l.cell.r]||[])[l.cell.c]:i[Pe(l.cell)])||{}).f=""+Tn(E[0],0,u,ge,P)}break;
1case 253:b=$s(c[E.isst].t,E.ixfe,"s"),c[E.isst].h&&(b.h=c[E.isst].h),b.XF=G[b.ixfe],I>0&&(b.z=X[b.ixfe>>8&63]),Tr(b,a,t.opts.Date1904),z({c:E.c,r:E.r},b,a);break;case 513:a.sheetStubs&&(b={ixfe:E.ixfe,XF:G[E.ixfe],t:"z"},I>0&&(b.z=X[b.ixfe>>8&63]),Tr(b,a,t.opts.Date1904),z({c:E.c,r:E.r},b,a));break;case 190:if(a.sheetStubs)for(var ri=E.c;ri<=E.C;++ri){var Xn=E.ixfe[ri-E.c];b={ixfe:Xn,XF:G[Xn],t:"z"},I>0&&(b.z=X[b.ixfe>>8&63]),Tr(b,a,t.opts.Date1904),z({c:ri,r:E.r},b,a)}break;case 214:case 516:case 4:(b=$s(E.val,E.ixfe,"s")).XF=G[b.ixfe],I>0&&(b.z=X[b.ixfe>>8&63]),Tr(b,a,t.opts.Date1904),z({c:E.c,r:E.r},b,a);break;case 0:case 512:1===te&&(o=E);break;case 252:c=E;break;case 1054:if(4==P.biff){X[I++]=E[1];for(var Gr=0;Gr<I+163&&Re[Gr]!=E[1];++Gr);Gr>=163&&xr(E[1],I+163)}else xr(E[1],E[0]);break;case 30:X[I++]=E;for(var ii=0;ii<I+163&&Re[ii]!=E;++ii);ii>=163&&xr(E,I+163);break;case 229:ve=ve.concat(E);break;case 93:ae[E.cmo[0]]=P.lastobj=E;break;case 438:P.lastobj.TxO=E;break;case 127:P.lastobj.ImData=E;break;case 440:for(_=E[0].s.r;_<=E[0].e.r;++_)for(m=E[0].s.c;m<=E[0].e.c;++m)(h=a.dense?(i[_]||[])[m]:i[Pe({c:m,r:_})])&&(h.l=E[1]);break;case 2048:for(_=E[0].s.r;_<=E[0].e.r;++_)for(m=E[0].s.c;m<=E[0].e.c;++m)(h=a.dense?(i[_]||[])[m]:i[Pe({c:m,r:_})])&&h.l&&(h.l.Tooltip=E[1]);break;case 28:if(P.biff<=5&&P.biff>=2)break;h=a.dense?(i[E[0].r]||[])[E[0].c]:i[Pe(E[0])];var Ua=ae[E[2]];h||(a.dense?(i[E[0].r]||(i[E[0].r]=[]),h=i[E[0].r][E[0].c]={t:"z"}):h=i[Pe(E[0])]={t:"z"},o.e.r=Math.max(o.e.r,E[0].r),o.s.r=Math.min(o.s.r,E[0].r),o.e.c=Math.max(o.e.c,E[0].c),o.s.c=Math.min(o.s.c,E[0].c)),h.c||(h.c=[]),h.c.push({a:E[1],t:Ua.TxO.t});break;case 2173:FS(0,E.ext);break;case 125:if(!P.cellStyles)break;for(;E.e>=E.s;)ye[E.e--]={width:E.w/256,level:E.level||0,hidden:!!(1&E.flags)},He||(He=!0,tl(E.w/256)),Fi(ye[E.e+1]);break;case 520:var Dn={};null!=E.level&&(ke[E.r]=Dn,Dn.level=E.level),E.hidden&&(ke[E.r]=Dn,Dn.hidden=!0),E.hpt&&(ke[E.r]=Dn,Dn.hpt=E.hpt,Dn.hpx=Xi(E.hpt));break;case 38:case 39:case 40:case 41:i["!margins"]||Si(i["!margins"]={}),i["!margins"][{38:"left",39:"right",40:"top",41:"bottom"}[le]]=E;break;case 161:i["!margins"]||Si(i["!margins"]={}),i["!margins"].header=E.header,i["!margins"].footer=E.footer;break;case 574:E.RTL&&(w.Views[0].RTL=!0);break;case 146:j=E;break;case 2198:oe=E;break;case 140:A=E;break;case 442:d?O.CodeName=E||O.name:w.WBProps.CodeName=E||"ThisWorkbook"}}else ne||console.error("Missing Info for XLS Record 0x"+le.toString(16)),n.l+=ce}return t.SheetNames=Pt(s).sort(function(Fr,ze){return Number(Fr)-Number(ze)}).map(function(Fr){return s[Fr].name}),a.bookSheets||(t.Sheets=r),!t.SheetNames.length&&p["!ref"]?(t.SheetNames.push("Sheet1"),t.Sheets&&(t.Sheets.Sheet1=p)):t.Preamble=p,t.Sheets&&R.forEach(function(Fr,ze){t.Sheets[t.SheetNames[ze]]["!autofilter"]=Fr}),t.Strings=c,t.SSF=xt(Re),P.enc&&(t.Encryption=P.enc),oe&&(t.Themes=oe),t.Metadata={},void 0!==A&&(t.Metadata.Country=A),ge.names.length>0&&(w.Names=ge.names),t.Workbook=w,t}(r.content,a);else if((s=Ee.find(n,"PerfectOffice_MAIN"))&&s.content)i=yi.to_workbook(s.content,(a.type=o,a));else{if(!(s=Ee.find(n,"NativeContent_MAIN"))||!s.content)throw(s=Ee.find(n,"MN0"))&&s.content?new Error("Unsupported Works 4 for Mac file"):new Error("Cannot find Workbook stream");i=yi.to_workbook(s.content,(a.type=o,a))}a.bookVBA&&n.FullPaths&&Ee.find(n,"/_VBA_PROJECT_CUR/VBA/dir")&&(i.vbaraw=function eE(n){var a=Ee.utils.cfb_new({root:"R"});return n.FullPaths.forEach(function(t,r){if("/"!==t.slice(-1)&&t.match(/_VBA_PROJECT_CUR/)){var i=t.replace(/^[^\/]*/,"R").replace(/\/_VBA_PROJECT_CUR\u0000*/,"");Ee.utils.cfb_add(a,i,n.FileIndex[r].content)}}),Ee.write(a)}(n))}var l={};return n.FullPaths&&function B7(n,a,t){var r=Ee.find(n,"/!DocumentSummaryInformation");if(r&&r.size>0)try{var i=Zd(r,$o,"02d5cdd59c2e1b10939708002b2cf9ae");for(var s in i)a[s]=i[s]}catch(d){if(t.WTF)throw d}var o=Ee.find(n,"/!SummaryInformation");if(o&&o.size>0)try{var l=Zd(o,Vo,"e0859ff2f94f6810ab9108002b27b3d9");for(var c in l)null==a[c]&&(a[c]=l[c])}catch(d){if(t.WTF)throw d}a.HeadingPairs&&a.TitlesOfParts&&($d(a.HeadingPairs,a.TitlesOfParts,a,t),delete a.HeadingPairs,delete a.TitlesOfParts)}(n,l,a),i.Props=i.Custprops=l,a.bookFiles&&(i.cfb=n),i}var Ga={0:{f:function d5(n,a){var t={},r=n.l+a;t.r=n.read_shift(4),n.l+=4;var i=n.read_shift(2);n.l+=1;var s=n.read_shift(1);return n.l=r,7&s&&(t.level=7&s),16&s&&(t.hidden=!0),32&s&&(t.hpt=i/20),t}},1:{f:function x5(n){return[Qn(n)]}},2:{f:function N5(n){return[Qn(n),Bo(n),"n"]}},3:{f:function F5(n){return[Qn(n),n.read_shift(1),"e"]}},4:{f:function k5(n){return[Qn(n),n.read_shift(1),"b"]}},5:{f:function M5(n){return[Qn(n),bn(n),"n"]}},6:{f:function V5(n){return[Qn(n),vn(n),"str"]}},7:{f:function D5(n){return[Qn(n),n.read_shift(4),"s"]}},8:{f:function q5(n,a,t){var r=n.l+a,i=Qn(n);i.r=t["!row"];var o=[i,vn(n),"str"];if(t.cellFormula){n.l+=2;var l=Bs(n,r-n.l,t);o[3]=Tn(l,0,i,t.supbooks,t)}else n.l=r;return o}},9:{f:function z5(n,a,t){var r=n.l+a,i=Qn(n);i.r=t["!row"];var o=[i,bn(n),"n"];
1if(t.cellFormula){n.l+=2;var l=Bs(n,r-n.l,t);o[3]=Tn(l,0,i,t.supbooks,t)}else n.l=r;return o}},10:{f:function W5(n,a,t){var r=n.l+a,i=Qn(n);i.r=t["!row"];var o=[i,n.read_shift(1),"b"];if(t.cellFormula){n.l+=2;var l=Bs(n,r-n.l,t);o[3]=Tn(l,0,i,t.supbooks,t)}else n.l=r;return o}},11:{f:function H5(n,a,t){var r=n.l+a,i=Qn(n);i.r=t["!row"];var o=[i,n.read_shift(1),"e"];if(t.cellFormula){n.l+=2;var l=Bs(n,r-n.l,t);o[3]=Tn(l,0,i,t.supbooks,t)}else n.l=r;return o}},12:{f:function b5(n){return[gi(n)]}},13:{f:function B5(n){return[gi(n),Bo(n),"n"]}},14:{f:function E5(n){return[gi(n),n.read_shift(1),"e"]}},15:{f:function w5(n){return[gi(n),n.read_shift(1),"b"]}},16:{f:r0},17:{f:function X5(n){return[gi(n),vn(n),"str"]}},18:{f:function j5(n){return[gi(n),n.read_shift(4),"s"]}},19:{f:Mo},20:{},21:{},22:{},23:{},24:{},25:{},26:{},27:{},28:{},29:{},30:{},31:{},32:{},33:{},34:{},35:{T:1},36:{T:-1},37:{T:1},38:{T:-1},39:{f:function Y8(n,a,t){var r=n.l+a;n.l+=4,n.l+=1;var i=n.read_shift(4),s=kT(n),o=II(n,0,t),l=Po(n);n.l=r;var c={Name:s,Ptg:o};return i<268435455&&(c.Sheet=i),l&&(c.Comment=l),c}},40:{},42:{},43:{f:function XF(n,a,t){var r={};r.sz=n.read_shift(2)/20;var i=function wT(n){var a=n.read_shift(1);return n.l++,{fBold:1&a,fItalic:2&a,fUnderline:4&a,fStrikeout:8&a,fOutline:16&a,fShadow:32&a,fCondense:64&a,fExtend:128&a}}(n);switch(i.fItalic&&(r.italic=1),i.fCondense&&(r.condense=1),i.fExtend&&(r.extend=1),i.fShadow&&(r.shadow=1),i.fOutline&&(r.outline=1),i.fStrikeout&&(r.strike=1),700===n.read_shift(2)&&(r.bold=1),n.read_shift(2)){case 1:r.vertAlign="superscript";break;case 2:r.vertAlign="subscript"}var o=n.read_shift(1);0!=o&&(r.underline=o);var l=n.read_shift(1);l>0&&(r.family=l);var c=n.read_shift(1);switch(c>0&&(r.charset=c),n.l++,r.color=function TT(n){var a={},r=n.read_shift(1)>>>1,i=n.read_shift(1),s=n.read_shift(2,"i"),o=n.read_shift(1),l=n.read_shift(1),c=n.read_shift(1);switch(n.l++,r){case 0:a.auto=1;break;case 1:a.index=i;var d=bi[i];d&&(a.rgb=Fa(d));break;case 2:a.rgb=Fa([o,l,c]);break;case 3:a.theme=i}return 0!=s&&(a.tint=s>0?s/32767:s/32768),a}(n),n.read_shift(1)){case 1:r.scheme="major";break;case 2:r.scheme="minor"}return r.name=vn(n),r}},44:{f:function VF(n,a){return[n.read_shift(2),vn(n)]}},45:{f:HF},46:{f:qF},47:{f:function zF(n,a){var t=n.l+a,r=n.read_shift(2),i=n.read_shift(2);return n.l=t,{ixfe:r,numFmtId:i}}},48:{},49:{f:function gT(n){return n.read_shift(4,"i")}},50:{},51:{f:function IS(n){for(var a=[],t=n.read_shift(4);t-- >0;)a.push([n.read_shift(4),n.read_shift(4)]);return a}},52:{T:1},53:{T:-1},54:{T:1},55:{T:-1},56:{T:1},57:{T:-1},58:{},59:{},60:{f:bp},62:{f:function $5(n){return[Qn(n),Mo(n),"is"]}}
1,63:{f:function GS(n){var a={};a.i=n.read_shift(4);var t={};t.r=n.read_shift(4),t.c=n.read_shift(4),a.r=Pe(t);var r=n.read_shift(1);return 2&r&&(a.l="1"),8&r&&(a.a="1"),a}},64:{f:function p8(){}},65:{},66:{},67:{},68:{},69:{},70:{},128:{},129:{T:1},130:{T:-1},131:{T:1,f:xn,p:0},132:{T:-1},133:{T:1},134:{T:-1},135:{T:1},136:{T:-1},137:{T:1,f:function o8(n){var a=n.read_shift(2);return n.l+=28,{RTL:32&a}}},138:{T:-1},139:{T:1},140:{T:-1},141:{T:1},142:{T:-1},143:{T:1},144:{T:-1},145:{T:1},146:{T:-1},147:{f:function g5(n,a){var t={},r=n[n.l];return++n.l,t.above=!(64&r),t.left=!(128&r),n.l+=18,t.name=CT(n,a-19),t}},148:{f:f5,p:16},151:{f:function t8(){}},152:{},153:{f:function V8(n,a){var t={},r=n.read_shift(4);t.defaultThemeVersion=n.read_shift(4);var i=a>8?vn(n):"";return i.length>0&&(t.CodeName=i),t.autoCompressPictures=!!(65536&r),t.backupFile=!!(64&r),t.checkCompatibility=!!(4096&r),t.date1904=!!(1&r),t.filterPrivacy=!!(8&r),t.hidePivotFieldList=!!(1024&r),t.promptedSolutions=!!(16&r),t.publishItems=!!(2048&r),t.refreshAllConnections=!!(262144&r),t.saveExternalLinkValues=!!(128&r),t.showBorderUnselectedTables=!!(4&r),t.showInkAnnotation=!!(32&r),t.showObjects=["all","placeholders","none"][r>>13&3],t.showPivotChartFilter=!!(32768&r),t.updateLinks=["userSet","never","always"][r>>8&3],t}},154:{},155:{},156:{f:function L8(n,a){var t={};return t.Hidden=n.read_shift(4),t.iTabID=n.read_shift(4),t.strRelID=No(n,a-8),t.name=vn(n),t}},157:{},158:{},159:{T:1,f:function aF(n){return[n.read_shift(4),n.read_shift(4)]}},160:{T:-1},161:{T:1,f:xi},162:{T:-1},163:{T:1},164:{T:-1},165:{T:1},166:{T:-1},167:{},168:{},169:{},170:{},171:{},172:{T:1},173:{T:-1},174:{},175:{},176:{f:J5},177:{T:1},178:{T:-1},179:{T:1},180:{T:-1},181:{T:1},182:{T:-1},183:{T:1},184:{T:-1},185:{T:1},186:{T:-1},187:{T:1},188:{T:-1},189:{T:1},190:{T:-1},191:{T:1},192:{T:-1},193:{T:1},194:{T:-1},195:{T:1},196:{T:-1},197:{T:1},198:{T:-1},199:{T:1},200:{T:-1},201:{T:1},202:{T:-1},203:{T:1},204:{T:-1},205:{T:1},206:{T:-1},207:{T:1},208:{T:-1},209:{T:1},210:{T:-1},211:{T:1},212:{T:-1},213:{T:1},214:{T:-1},215:{T:1},216:{T:-1},217:{T:1},218:{T:-1},219:{T:1},220:{T:-1},221:{T:1},222:{T:-1},223:{T:1},224:{T:-1},225:{T:1},226:{T:-1},227:{T:1},228:{T:-1},229:{T:1},230:{T:-1},231:{T:1},232:{T:-1},233:{T:1},234:{T:-1},235:{T:1},236:{T:-1},237:{T:1},238:{T:-1},239:{T:1},240:{T:-1},241:{T:1},242:{T:-1},243:{T:1},244:{T:-1},245:{T:1},246:{T:-1},247:{T:1},248:{T:-1},249:{T:1},250:{T:-1},251:{T:1},252:{T:-1},253:{T:1},254:{T:-1},255:{T:1},256:{T:-1},257:{T:1},258:{T:-1},259:{T:1},260:{T:-1},261:{T:1},262:{T:-1},263:{T:1},264:{T:-1},265:{T:1},266:{T:-1},267:{T:1},268:{T:-1},269:{T:1},270:{T:-1},271:{T:1},272:{T:-1},273:{T:1},274:{T:-1},275:{T:1},276:{T:-1},277:{},278:{T:1},279:{T:-1},280:{T:1},281:{T:-1},282:{T:1},283:{T:1},284:{T:-1},285:{T:1},286:{T:-1},287:{T:1},288:{T:-1},289:{T:1},290:{T:-1},291:{T:1},292:{T:-1},293:{T:1},294:{T:-1},295:{T:1},296:{T:-1},297:{T:1},298:{T:-1},299:{T:1},300:{T:-1},301:{T:1},302:{T:-1},303:{T:1},304:{T:-1},305:{T:1},306:{T:-1},307:{T:1},308:{T:-1},309:{T:1},310:{T:-1},311:{T:1},312:{T:-1},313:{T:-1},314:{T:1},315:{T:-1},316:{T:1},317:{T:-1},318:{T:1},319:{T:-1},320:{T:1},321:{T:-1},322:{T:1},323:{T:-1},324:{T:1},325:{T:-1},326:{T:1},327:{T:-1},328:{T:1},329:{T:-1},330:{T:1},331:{T:-1},332:{T:1},333:{T:-1},334:{T:1},335:{f:function SS(n,a){return{flags:n.read_shift(4),version:n.read_shift(4),name:vn(n)}}},336:{T:-1},337:{f:function jS(n){return n.l+=4,0!=n.read_shift(4)},T:1},338:{T:-1},339:{T:1},340:{T:-1},341:{T:1},342:{T:-1},343:{T:1},344:{T:-1},345:{T:1},346:{T:-1},347:{T:1},348:{T:-1},349:{T:1},350:{T:-1},351:{},352:{},353:{T:1},354:{T:-1},355:{f:No},357:{},358:{},359:{},360:{T:1},361:{},362:{f:xp},363:{},364:{},366:{},367:{},368:{},369:{},370:{},371:{},372:{T:1},373:{T:-1},374:{T:1},375:{T:-1},376:{T:1},377:{T:-1},378:{T:1},379:{T:-1},380:{T:1},381:{T:-1},382:{T:1},383:{T:-1},384:{T:1},385:{T:-1},386:{T:1},387:{T:-1},388:{T:1},389:{T:-1},390:{T:1},391:{T:-1},392:{T:1},393:{T:-1},394:{T:1},395:{T:-1},396:{},397:{},398:{},399:{},400:{},401:{T:1},403:{},404:{},405:{},406:{},407:{},408:{},409:{},410:{},411:{},412:{},413:{},414:{},415:{},416:{},417:{},418:{},419:{},420:{},421:{},422:{T:1},423:{T:1},424:{T:-1},425:{T:-1},426:{f:function n8(n,a,t){var r=n.l+a,i=Dd(n),s=n.read_shift(1),o=[i];if(o[2]=s,t.cellFormula){var l=EI(n,r-n.l,t);o[1]=l}else n.l=r;return o}},427:{f:function r8(n,a,t){var r=n.l+a,s=[xi(n,16)];if(t.cellFormula){var o=DI(n,r-n.l,t);s[1]=o,n.l=r}else n.l=r;return s}},428:{},429:{T:1},430:{T:-1},431:{T:1},432:{T:-1},433:{T:1},434:{T:-1},435:{T:1},436:{T:-1},437:{T:1},438:{T:-1},439:{T:1},440:{T:-1},441:{T:1},442:{T:-1},443:{T:1},444:{T:-1},445:{T:1},446:{T:-1},447:{T:1},448:{T:-1},449:{T:1},450:{T:-1},451:{T:1},452:{T:-1},453:{T:1},454:{T:-1},455:{T:1},456:{T:-1},457:{T:1},458:{T:-1},459:{T:1},460:{T:-1},461:{T:1},462:{T:-1},463:{T:1},464:{T:-1},465:{T:1},466:{T:-1},467:{T:1},468:{T:-1},469:{T:1},470:{T:-1},471:{},472:{},473:{T:1},474:{T:-1},475:{},476:{f:function a8(n){var a={};return i0.forEach(function(t){a[t]=bn(n)}),a}},477:{},478:{},479:{T:1},480:{T:-1},481:{T:1},482:{T:-1},483:{T:1},484:{T:-1},485:{f:function h5(){}},486:{T:1},487:{T:-1},488:{T:1},489:{T:-1},490:{T:1},491:{T:-1},492:{T:1},493:{T:-1},494:{f:function Z5(n,a){var t=n.l+a,r=xi(n,16),i=Po(n),s=vn(n),o=vn(n),l=vn(n);n.l=t;var c={rfx:r,relId:i,loc:s,display:l};return o&&(c.Tooltip=o),c}},495:{T:1},496:{T:-1},497:{T:1},498:{T:-1},499:{},500:{T:1},501:{T:-1},502:{T:1},503:{T:-1},504:{},505:{T:1},506:{T:-1},507:{},508:{T:1},509:{T:-1},510:{T:1},511:{T:-1},512:{},513:{},514:{T:1},515:{T:-1},516:{T:1},517:{T:-1},518:{T:1},519:{T:-1},520:{T:1},521:{T:-1},522:{},523:{},524:{},525:{},526:{},527:{},528:{T:1},529:{T:-1},530:{T:1},531:{T:-1},532:{T:1},533:{T:-1},534:{},535:{},536:{},537:{},538:{T:1},539:{T:-1},540:{T:1},541:{T:-1},542:{T:1},548:{},549:{},550:{f:No},551:{},552:{},553:{},554:{T:1},555:{T:-1},556:{T:1},557:{T:-1},558:{T:1},559:{T:-1},560:{T:1},561:{T:-1},562:{},564:{},565:{T:1},566:{T:-1},569:{T:1},570:{T:-1},572:{},573:{T:1},574:{T:-1},577:{},578:{},579:{},580:{},581:{},582:{},583:{},584:{},585:{},586:{},587:{},588:{T:-1},589:{},590:{T:1},591:{T:-1},592:{T:1},593:{T:-1},594:{T:1},595:{T:-1},596:{},597:{T:1},598:{T:-1},599:{T:1},600:{T:-1},601:{T:1},602:{T:-1},603:{T:1},604:{T:-1},605:{T:1},606:{T:-1},607:{},608:{T:1},609:{T:-1},610:{},611:{T:1},612:{T:-1},613:{T:1},614:{T:-1},615:{T:1},616:{T:-1},617:{T:1},618:{T:-1},619:{T:1},620:{T:-1},625:{},626:{T:1},627:{T:-1},628:{T:1},629:{T:-1},630:{T:1},631:{T:-1},632:{f:qS},633:{T:1},634:{T:-1},635:{T:1,f:function HS(n){var a={};a.iauthor=n.read_shift(4);var t=xi(n,16);return a.rfx=t.s,a.ref=Pe(t.s),n.l+=16,a}},636:{T:-1},637:{f:vT},638:{T:1},639:{},640:{T:-1},641:{T:1},642:{T:-1},643:{T:1},644:{},645:{T:-1},646:{T:1},648:{T:1},649:{},650:{T:-1},651:{f:function I8(n,a){return n.l+=10,{name:vn(n)}}},652:{},653:{T:1},654:{T:-1},655:{T:1},656:{T:-1},657:{T:1},658:{T:-1},659:{},660:{T:1},661:{},662:{T:-1},663:{},664:{T:1},665:{},666:{T:-1},667:{},668:{},669:{},671:{T:1},672:{T:-1},673:{T:1},674:{T:-1},675:{},676:{},677:{},678:{},679:{},680:{},681:{},1024:{},1025:{},1026:{T:1},1027:{T:-1},1028:{T:1},1029:{T:-1},1030:{},1031:{T:1},1032:{T:-1},1033:{T:1},1034:{T:-1},1035:{},1036:{},1037:{},1038:{T:1},1039:{T:-1},1040:{},1041:{T:1},1042:{T:-1},1043:{},1044:{},1045:{},1046:{T:1},1047:{T:-1},1048:{T:1},1049:{T:-1},1050:{},1051:{T:1},1052:{T:1},1053:{f:function u8(){}},1054:{T:1},1055:{},1056:{T:1},1057:{T:-1},1058:{T:1},1059:{T:-1},1061:{},1062:{T:1},1063:{T:-1},1064:{T:1},1065:{T:-1},1066:{T:1},1067:{T:-1},1068:{T:1},1069:{T:-1},1070:{T:1},1071:{T:-1},1072:{T:1},1073:{T:-1},1075:{T:1},1076:{T:-1},1077:{T:1},1078:{T:-1},1079:{T:1},1080:{T:-1},1081:{T:1},1082:{T:-1},1083:{T:1},1084:{T:-1},1085:{},1086:{T:1},1087:{T:-1},1088:{T:1},1089:{T:-1},1090:{T:1},1091:{T:-1},1092:{T:1},1093:{T:-1},1094:{T:1},1095:{T:-1},1096:{},1097:{T:1},1098:{},1099:{T:-1},1100:{T:1},1101:{T:-1},1102:{},1103:{},1104:{},1105:{},1111:{},1112:{},1113:{T:1},1114:{T:-1},1115:{T:1},1116:{T:-1},1117:{},1118:{T:1},1119:{T:-1},1120:{T:1},1121:{T:-1},1122:{T:1},1123:{T:-1},1124:{T:1},1125:{T:-1},1126:{},1128:{T:1},1129:{T:-1},1130:{},1131:{T:1},1132:{T:-1},1133:{T:1},1134:{T:-1},1135:{T:1},1136:{T:-1},1137:{T:1},1138:{T:-1},1139:{T:1},1140:{T:-1},1141:{},1142:{T:1},1143:{T:-1},1144:{T:1},1145:{T:-1},1146:{},1147:{T:1},1148:{T:-1},1149:{T:1},1150:{T:-1},1152:{T:1},1153:{T:-1},1154:{T:-1},1155:{T:-1},1156:{T:-1},1157:{T:1},1158:{T:-1},1159:{T:1},1160:{T:-1},1161:{T:1},1162:{T:-1},1163:{T:1},1164:{T:-1},1165:{T:1},1166:{T:-1},1167:{T:1},1168:{T:-1},1169:{T:1},1170:{T:-1},1171:{},1172:{T:1},1173:{T:-1},1177:{},1178:{T:1},1180:{},1181:{},1182:{},2048:{T:1},2049:{T:-1},2050:{},2051:{T:1},2052:{T:-1},2053:{},2054:{},2055:{T:1},2056:{T:-1},2057:{T:1},2058:{T:-1},2060:{},2067:{},2068:{T:1},2069:{T:-1},2070:{},2071:{},2072:{T:1},2073:{T:-1},2075:{},2076:{},2077:{T:1},2078:{T:-1},2079:{},2080:{T:1},2081:{T:-1},2082:{},2083:{T:1},2084:{T:-1},2085:{T:1},2086:{T:-1},2087:{T:1},2088:{T:-1},2089:{T:1},2090:{T:-1},2091:{},2092:{},2093:{T:1},2094:{T:-1},2095:{},2096:{T:1},2097:{T:-1},2098:{T:1},2099:{T:-1},2100:{T:1},2101:{T:-1},2102:{},2103:{T:1},2104:{T:-1},2105:{},2106:{T:1},2107:{T:-1},2108:{},2109:{T:1},2110:{T:-1},2111:{T:1},2112:{T:-1},2113:{T:1},2114:{T:-1},2115:{},2116:{},2117:{},2118:{T:1},2119:{T:-1},2120:{},2121:{T:1},2122:{T:-1},2123:{T:1},2124:{T:-1},2125:{},2126:{T:1},2127:{T:-1},2128:{},2129:{T:1},2130:{T:-1},2131:{T:1},2132:{T:-1},2133:{T:1},2134:{},2135:{},2136:{},2137:{T:1},2138:{T:-1},2139:{T:1},2140:{T:-1},2141:{},3072:{},3073:{},4096:{T:1},4097:{T:-1},5002:{T:1},5003:{T:-1},5081:{T:1},5082:{T:-1},5083:{},5084:{T:1},5085:{T:-1},5086:{T:1},5087:{T:-1},5088:{},5089:{},5090:{},5092:{T:1},5093:{T:-1},5094:{},5095:{T:1},5096:{T:-1},5097:{},5099:{},65535:{n:""}},ml={6:{f:ol},10:{f:Zr},12:{f:Jt},13:{f:Jt},14:{f:$t},15:{f:$t},16:{f:bn},17:{f:$t},18:{f:$t},19:{f:Jt},20:{f:hp},21:{f:hp},23:{f:xp},24:{f:_p},25:{f:$t},26:{},27:{},28:{f:function my(n,a,t){return function fy(n,a,t){if(!(t.biff<8)){var r=n.read_shift(2),i=n.read_shift(2),s=n.read_shift(2),o=n.read_shift(2),l=Ti(n,0,t);return t.biff<8&&n.read_shift(1),[{r,c:i},l,o,s]}}(n,0,t)}},29:{},34:{f:$t},35:{f:gp},38:{f:bn},39:{f:bn},40:{f:bn},41:{f:bn},42:{f:$t},43:{f:$t},47:{f:function FF(n,a,t){var r={Type:t.biff>=8?n.read_shift(2):0};return r.Type?function yF(n,a,t){var r=t||{};return r.Info=n.read_shift(2),n.l-=2,r.Data=1===r.Info?function CF(n){var a={},t=a.EncryptionVersionInfo=Pr(n,4);
1if(1!=t.Major||1!=t.Minor)throw"unrecognized version code "+t.Major+" : "+t.Minor;return a.Salt=n.read_shift(16),a.EncryptedVerifier=n.read_shift(16),a.EncryptedVerifierHash=n.read_shift(16),a}(n):function bF(n,a){var t={},r=t.EncryptionVersionInfo=Pr(n,4);if(a-=4,2!=r.Minor)throw new Error("unrecognized minor version code: "+r.Minor);if(r.Major>4||r.Major<2)throw new Error("unrecognized major version code: "+r.Major);t.Flags=n.read_shift(4),a-=4;var i=n.read_shift(4);return a-=4,t.EncryptionHeader=Fp(n,i),t.EncryptionVerifier=Sp(n,a-=i),t}(n,a),r}(n,a-2,r):function wF(n,a,t,r){var i={key:Jt(n),verificationBytes:Jt(n)};t.password&&(i.verifier=function Zo(n){var t,s,a=0,r=yp(n),i=r.length+1;for((t=Wr(i))[0]=r.length,s=1;s!=i;++s)t[s]=r[s-1];for(s=i-1;s>=0;--s)a=((16384&a?1:0)|a<<1&32767)^t[s];return 52811^a}(t.password)),r.valid=i.verificationBytes===i.verifier,r.valid&&(r.insitu=function(n){var a=0,t=Ep(n);return function(r){var i=function(n,a,t,r,i){var s,o;for(i||(i=a),r||(r=Ep("")),s=0;s!=a.length;++s)o=a[s],i[s]=o=255&((o^=r[t])>>5|o<<3),++t;return[i,t,r]}(0,r,a,t);return a=i[1],i[0]}}(t.password))}(n,0,t,r),r}},49:{f:function $w(n,a,t){var r={dyHeight:n.read_shift(2),fl:n.read_shift(2)};switch(t&&t.biff||8){case 2:break;case 3:case 4:n.l+=2;break;default:n.l+=10}return r.name=wa(n,0,t),r}},51:{f:Jt},60:{},61:{f:function Ow(n){return{Pos:[n.read_shift(2),n.read_shift(2)],Dim:[n.read_shift(2),n.read_shift(2)],Flags:n.read_shift(2),CurTab:n.read_shift(2),FirstTab:n.read_shift(2),Selected:n.read_shift(2),TabRatio:n.read_shift(2)}}},64:{f:$t},65:{f:function Lw(){}},66:{f:Jt},77:{},80:{},81:{},82:{},85:{f:Jt},89:{},90:{},91:{},92:{f:function yw(n,a,t){if(t.enc)return n.l+=a,"";var r=n.l,i=Ti(n,0,t);return n.read_shift(a+r-n.l),i}},93:{f:function _y(n,a,t){if(t&&t.biff<8)return function vy(n,a,t){n.l+=4;var r=n.read_shift(2),i=n.read_shift(2),s=n.read_shift(2);n.l+=2,n.l+=2,n.l+=2,n.l+=2,n.l+=2,n.l+=2,n.l+=2,n.l+=2,n.l+=2,n.l+=6;var o=[];return o.push((xy[r]||xn)(n,a-=36,t)),{cmo:[i,r,s],ft:o}}(n,a,t);var r=dp(n),i=function Tw(n,a){for(var t=n.l+a,r=[];n.l<t;){var i=n.read_shift(2);n.l-=2;try{r.push(kw[i](n,t-n.l))}catch{return n.l=t,r}}return n.l!=t&&(n.l=t),r}(n,a-22);return{cmo:r,ft:i}}},94:{},95:{f:$t},96:{},97:{},99:{f:$t},125:{f:bp},128:{f:function ny(n){n.l+=4;var a=[n.read_shift(2),n.read_shift(2)];if(0!==a[0]&&a[0]--,0!==a[1]&&a[1]--,a[0]>7||a[1]>7)throw new Error("Bad Gutters: "+a.join("|"));return a}},129:{f:function Sw(n,a,t){var r=t&&8==t.biff||2==a?n.read_shift(2):(n.l+=a,0);return{fDialog:16&r,fBelow:64&r,fRight:128&r}}},130:{f:Jt},131:{f:$t},132:{f:$t},133:{f:function Ew(n,a,t){var r=n.read_shift(4),i=3&n.read_shift(1),s=n.read_shift(1);switch(s){case 0:s="Worksheet";break;case 1:s="Macrosheet";break;case 2:s="Chartsheet";break;case 6:s="VBAModule"}var o=wa(n,0,t);return 0===o.length&&(o="Sheet1"),{pos:r,hs:i,dt:s,name:o}}},134:{},140:{f:function yy(n){var t,a=[0,0];return t=n.read_shift(2),a[0]=Md[t]||t,t=n.read_shift(2),a[1]=Md[t]||t,a}},141:{f:Jt},144:{},146:{f:function Ey(n){for(var a=n.read_shift(2),t=[];a-- >0;)t.push(sp(n));return t}},151:{},152:{},153:{},154:{},155:{},156:{f:Jt},157:{},158:{},160:{f:Py},161:{f:function Ry(n,a){var t={};return a<32||(n.l+=16,t.header=bn(n),t.footer=bn(n),n.l+=2),t}},174:{},175:{},176:{},177:{},178:{},180:{},181:{},182:{},184:{},185:{},189:{f:function Qw(n,a){for(var t=n.l+a-2,r=n.read_shift(2),i=n.read_shift(2),s=[];n.l<t;)s.push(op(n));if(n.l!==t)throw new Error("MulRK read error");var o=n.read_shift(2);if(s.length!=o-i+1)throw new Error("MulRK length mismatch");return{r,c:i,C:o,rkrec:s}}},190:{f:function Zw(n,a){for(var t=n.l+a-2,r=n.read_shift(2),i=n.read_shift(2),s=[];n.l<t;)s.push(n.read_shift(2));if(n.l!==t)throw new Error("MulBlank read error");var o=n.read_shift(2);if(s.length!=o-i+1)throw new Error("MulBlank length mismatch");return{r,c:i,C:o,ixfe:s}}},193:{f:Zr},197:{},198:{},199:{},200:{},201:{},202:{f:$t},203:{},204:{},205:{},206:{},207:{},208:{},209:{},210:{},211:{},213:{},215:{},216:{},217:{},218:{f:Jt},220:{},221:{f:$t},222:{},224:{f:function ty(n,a,t){var r={};return r.ifnt=n.read_shift(2),r.numFmtId=n.read_shift(2),r.flags=n.read_shift(2),r.fStyle=r.flags>>2&1,r.data=function ey(n,a,t,r){var i={},s=n.read_shift(4),o=n.read_shift(4),l=n.read_shift(4),c=n.read_shift(2);return i.patternType=AT[l>>26],r.cellStyles&&(i.alc=7&s,i.fWrap=s>>3&1,i.alcV=s>>4&7,i.fJustLast=s>>7&1,i.trot=s>>8&255,i.cIndent=s>>16&15,i.fShrinkToFit=s>>20&1,i.iReadOrder=s>>22&2,i.fAtrNum=s>>26&1,i.fAtrFnt=s>>27&1,i.fAtrAlc=s>>28&1,i.fAtrBdr=s>>29&1,i.fAtrPat=s>>30&1,i.fAtrProt=s>>31&1,i.dgLeft=15&o,i.dgRight=o>>4&15,i.dgTop=o>>8&15,i.dgBottom=o>>12&15,i.icvLeft=o>>16&127,i.icvRight=o>>23&127,i.grbitDiag=o>>30&3,i.icvTop=127&l,i.icvBottom=l>>7&127,i.icvDiag=l>>14&127,i.dgDiag=l>>21&15,i.icvFore=127&c,i.icvBack=c>>7&127,i.fsxButton=c>>14&1),i}(n,0,0,t),r}},225:{f:function ww(n,a){return 0===a||n.read_shift(2),1200}},226:{f:Zr},227:{},229:{f:function hy(n,a){for(var t=[],r=n.read_shift(2);r--;)t.push(js(n));return t}},233:{},235:{},236:{},237:{},239:{},240:{},241:{},242:{},244:{},245:{},246:{},247:{},248:{},249:{},251:{},252:{f:function Dw(n,a){for(var t=n.l+a,r=n.read_shift(4),i=n.read_shift(4),s=[],o=0;o!=i&&n.l<t;++o)s.push(ow(n));return s.Count=r,s.Unique=i,s}},253:{f:function Uw(n){var a=kr(n);return a.isst=n.read_shift(4),a}},255:{f:function jw(n,a){var t={};return t.dsst=n.read_shift(2),n.l+=a-2,t}},256:{},259:{},290:{},311:{},312:{},315:{},317:{f:tp},318:{},319:{},320:{},330:{},331:{},333:{},334:{},335:{},336:{},337:{},338:{},339:{},340:{},351:{},352:{f:$t},353:{f:Zr},401:{},402:{},403:{},404:{},405:{},406:{},407:{},408:{},425:{},426:{},427:{},428:{},429:{},430:{f:function oy(n,a,t){var r=n.l+a,i=n.read_shift(2),s=n.read_shift(2);if(t.sbcch=s,1025==s||14849==s)return[s,i];if(s<1||s>255)throw new Error("Unexpected SupBook type: "+s);for(var o=ki(n,s),l=[];r>n.l;)l.push(ya(n));return[s,i,o,l]}},431:{f:$t},432:{},433:{},434:{},437:{},438:{f:function by(n,a,t){var r=n.l,i="";try{n.l+=4,-1==[0,5,7,11,12,14].indexOf((t.lastobj||{cmo:[0,0]}).cmo[1])?n.l+=6:function cw(n){var a=n.read_shift(1);n.l++;var t=n.read_shift(2);n.l+=2}(n);var l=n.read_shift(2);n.read_shift(2),Jt(n);var c=n.read_shift(2);n.l+=c;for(var d=1;d<n.lens.length-1;++d){if(n.l-r!=n.lens[d])throw new Error("TxO: bad continue record");var p=n[n.l];if((i+=ki(n,n.lens[d+1]-n.lens[d]-1)).length>=(p?l:2*l))break}if(i.length!==l&&i.length!==2*l)throw new Error("cchText: "+l+" != "+i.length);return n.l=r+a,{t:i}}catch{return n.l=r+a,{t:i}}}},439:{f:$t},440:{f:function Cy(n,a){var t=js(n);n.l+=16;var r=function fw(n,a){var t=n.l+a,r=n.read_shift(4);if(2!==r)throw new Error("Unrecognized streamVersion: "+r);var i=n.read_shift(2);n.l+=2;var s,o,l,c,p,u,d="";16&i&&(s=Rs(n)),128&i&&(o=Rs(n)),!(257&~i)&&(l=Rs(n)),1==(257&i)&&(c=function uw(n,a){var t=n.read_shift(16);switch(t){case"e0c9ea79f9bace118c8200aa004ba90b":return function dw(n){var a=n.read_shift(4),t=n.l,r=!1;a>
124&&(n.l+=a-24,"795881f43b1d7f48af2c825dc4852763"===n.read_shift(16)&&(r=!0),n.l=t);var i=n.read_shift((r?a-24:a)>>1,"utf16le").replace(gn,"");return r&&(n.l+=24),i}(n);case"0303000000000000c000000000000046":return function pw(n){for(var a=n.read_shift(2),t="";a-- >0;)t+="../";var r=n.read_shift(0,"lpstr-ansi");if(n.l+=2,57005!=n.read_shift(2))throw new Error("Bad FileMoniker");if(0===n.read_shift(4))return t+r.replace(/\\/g,"/");var s=n.read_shift(4);if(3!=n.read_shift(2))throw new Error("Bad FileMoniker");return t+n.read_shift(s>>1,"utf16le").replace(gn,"")}(n);default:throw new Error("Unsupported Moniker "+t)}}(n)),8&i&&(d=Rs(n)),32&i&&(p=n.read_shift(16)),64&i&&(u=zo(n)),n.l=t;var f=o||l||c||"";f&&d&&(f+="#"+d),f||(f="#"+d),2&i&&"/"==f.charAt(0)&&"/"!=f.charAt(1)&&(f="file://"+f);var h={Target:f};return p&&(h.guid=p),u&&(h.time=u),s&&(h.Tooltip=s),h}(n,a-24);return[t,r]}},441:{},442:{f:ya},443:{},444:{f:Jt},445:{},446:{},448:{f:Zr},449:{f:function Pw(n){return n.read_shift(2),n.read_shift(4)},r:2},450:{f:Zr},512:{f:up},513:{f:My},515:{f:function ay(n,a,t){t.biffguess&&2==t.biff&&(t.biff=5);var r=kr(n),i=bn(n);return r.val=i,r}},516:{f:function Yw(n,a,t){t.biffguess&&2==t.biff&&(t.biff=5);var i=kr(n);2==t.biff&&n.l++;var s=ya(n,0,t);return i.val=s,i}},517:{f:mp},519:{f:Oy},520:{f:function Aw(n){var a={};a.r=n.read_shift(2),a.c=n.read_shift(2),a.cnt=n.read_shift(2)-a.c;var t=n.read_shift(2);n.l+=4;var r=n.read_shift(1);return n.l+=3,7&r&&(a.level=7&r),32&r&&(a.hidden=!0),64&r&&(a.hpt=t/20),a}},523:{},545:{f:vp},549:{f:pp},566:{},574:{f:function Gw(n,a,t){return t&&t.biff>=2&&t.biff<5?{}:{RTL:64&n.read_shift(2)}}},638:{f:function Kw(n){var a=n.read_shift(2),t=n.read_shift(2),r=op(n);return{r:a,c:t,ixfe:r[0],rknum:r[1]}}},659:{},1048:{},1054:{f:function Hw(n,a,t){return[n.read_shift(2),Ti(n,0,t)]}},1084:{},1212:{f:function py(n,a,t){var r=cp(n);n.l++;var i=n.read_shift(1);return[wI(n,a-=8,t),i,r]}},2048:{f:function Ty(n,a){n.read_shift(2);var t=js(n),r=n.read_shift((a-10)/2,"dbcs-cont");return[t,r=r.replace(gn,"")]}},2049:{},2050:{},2051:{},2052:{},2053:{},2054:{},2055:{},2056:{},2057:{f:As},2058:{},2059:{},2060:{},2061:{},2062:{},2063:{},2064:{},2066:{},2067:{},2128:{},2129:{},2130:{},2131:{},2132:{},2133:{},2134:{},2135:{},2136:{},2137:{},2138:{},2146:{},2147:{r:12},2148:{},2149:{},2150:{},2151:{f:Zr},2152:{},2154:{},2155:{},2156:{},2161:{},2162:{},2164:{},2165:{},2166:{},2167:{},2168:{},2169:{},2170:{},2171:{},2172:{f:function Iy(n){n.l+=2;var a={cxfs:0,crc:0};return a.cxfs=n.read_shift(2),a.crc=n.read_shift(4),a},r:12},2173:{f:function yS(n,a){n.l+=2;var r=n.read_shift(2);n.l+=2;for(var i=n.read_shift(2),s=[];i-- >0;)s.push(wS(n));return{ixfe:r,ext:s}},r:12},2174:{},2175:{},2180:{},2181:{},2182:{},2183:{},2184:{},2185:{},2186:{},2187:{},2188:{f:$t,r:12},2189:{},2190:{r:12},2191:{},2192:{},2194:{},2195:{},2196:{f:function dy(n,a,t){if(!(t.biff<8)){var r=n.read_shift(2),i=n.read_shift(2);return[ki(n,r,t),ki(n,i,t)]}n.l+=a},r:12},2197:{},2198:{f:function vS(n,a,t){var r=n.l+a;if(124226!==n.read_shift(4)){if(!t.cellStyles)return void(n.l=r);var o,s=n.slice(n.l);n.l=r;try{o=Zc(s,{type:"array"})}catch{return}var l=$n(o,"theme/theme/theme1.xml",!0);if(l)return Pp(l,t)}},r:12},2199:{},2200:{},2201:{},2202:{f:function uy(n){return[0!==n.read_shift(4),0!==n.read_shift(4),n.read_shift(4)]},r:12},2203:{f:Zr},2204:{},2205:{},2206:{},2207:{},2211:{f:function Mw(n){var a=function hw(n){var a=n.read_shift(2),t=n.read_shift(2);return n.l+=8,{type:a,flags:t}}(n);if(2211!=a.type)throw new Error("Invalid Future Record "+a.type);return 0!==n.read_shift(4)}},2212:{},2213:{},2214:{},2215:{},4097:{},4098:{},4099:{},4102:{},4103:{},4105:{},4106:{},4107:{},4108:{},4109:{},4116:{},4117:{},4118:{},4119:{},4120:{},4121:{},4122:{},4123:{},4124:{},4125:{},4126:{},4127:{},4128:{},4129:{},4130:{},4132:{},4133:{},4134:{f:Jt},4135:{},4146:{},4147:{},4148:{},4149:{},4154:{},4156:{},4157:{},4158:{},4159:{},4160:{},4161:{},4163:{},4164:{f:function jy(n,a,t){var r={area:!1};if(5!=t.biff)return n.l+=a,r;var i=n.read_shift(1);return n.l+=3,16&i&&(r.area=!0),r}},4165:{},4166:{},4168:{},4170:{},4171:{},4174:{},4175:{},4176:{},4177:{},4187:{},4188:{f:function Sy(n){for(var a=n.read_shift(2),t=[];a-- >0;)t.push(sp(n));return t}},4189:{},4191:{},4192:{},4193:{},4194:{},4195:{},4196:{},4197:{},4198:{},4199:{},4200:{}
1,0:{f:up},1:{},2:{f:function $y(n){var a=kr(n);++n.l;var t=n.read_shift(2);return a.t="n",a.val=t,a}},3:{f:function By(n){var a=kr(n);++n.l;var t=bn(n);return a.t="n",a.val=t,a}},4:{f:function Gy(n,a,t){t.biffguess&&5==t.biff&&(t.biff=2);var r=kr(n);++n.l;var i=Ti(n,0,t);return r.t="str",r.val=i,r}},5:{f:mp},7:{f:function Uy(n){var a=n.read_shift(1);return 0===a?(n.l++,""):n.read_shift(a,"sbcs-cont")}},8:{},9:{f:As},11:{},22:{f:Jt},30:{f:qw},31:{},32:{},33:{f:vp},36:{},37:{f:pp},50:{f:function Xy(n,a){n.l+=6,n.l+=2,n.l+=1,n.l+=3,n.l+=1,n.l+=a-13}},62:{},52:{},67:{},68:{f:Jt},69:{},86:{},126:{},127:{f:function Ny(n){var a=n.read_shift(2),t=n.read_shift(2),r=n.read_shift(4),i={fmt:a,env:t,len:r,data:n.slice(n.l,n.l+r)};return n.l+=r,i}},135:{},136:{},137:{},145:{},148:{},149:{},150:{},169:{},171:{},188:{},191:{},192:{},194:{},195:{},214:{f:function Yy(n,a,t){var r=n.l+a,i=kr(n),s=n.read_shift(2),o=ki(n,s,t);return n.l=r,i.t="str",i.val=o,i}},223:{},234:{},354:{},421:{},518:{f:ol},521:{f:As},536:{f:_p},547:{f:gp},561:{},579:{},1030:{f:ol},1033:{f:As},1091:{},2157:{},2163:{},2177:{},2240:{},2241:{},2242:{},2243:{},2244:{},2245:{},2246:{},2247:{},2248:{},2249:{},2250:{},2251:{},2262:{r:12},29282:{}};function pe(n,a,t,r){var i=a;if(!isNaN(i)){var s=r||(t||[]).length||0,o=n.next(4);o.write_shift(2,i),o.write_shift(2,s),s>0&&Do(t)&&n.push(t)}}function g0(n,a){var t=a||{},r=t.dense?[]:{},i=(n=n.replace(/<!--.*?-->/g,"")).match(/<table/i);if(!i)throw new Error("Invalid HTML: could not find <table>");var s=n.match(/<\/table/i),o=i.index,l=s&&s.index||n.length,c=X3(n.slice(o,l),/(:?<tr[^>]*>)/i,"<tr>"),d=-1,p=0,u=0,f=0,h={s:{r:1e7,c:1e7},e:{r:0,c:0}},g=[];for(o=0;o<c.length;++o){var m=c[o].trim(),_=m.slice(0,3).toLowerCase();if("<tr"!=_){if("<td"==_||"<th"==_){var v=m.split(/<\/t[dh]>/i);for(l=0;l<v.length;++l){var k=v[l].trim();if(k.match(/<t[dh]/i)){for(var b=k,A=0;"<"==b.charAt(0)&&(A=b.indexOf(">"))>-1;)b=b.slice(A+1);for(var G=0;G<g.length;++G){var j=g[G];j.s.c==p&&j.s.r<d&&d<=j.e.r&&(p=j.e.c+1,G=-1)}var w=Me(k.slice(0,k.indexOf(">")));f=w.colspan?+w.colspan:1,((u=+w.rowspan)>1||f>1)&&g.push({s:{r:d,c:p},e:{r:d+(u||1)-1,c:p+f-1}});var O=w.t||w["data-t"]||"";if(!b.length){p+=f;continue}if(b=od(b),h.s.r>d&&(h.s.r=d),h.e.r<d&&(h.e.r=d),h.s.c>p&&(h.s.c=p),h.e.c<p&&(h.e.c=p),!b.length){p+=f;continue}var M={t:"s",v:b};t.raw||!b.trim().length||"s"==O||("TRUE"===b?M={t:"b",v:!0}:"FALSE"===b?M={t:"b",v:!1}:isNaN(dr(b))?isNaN(Gi(b).getDate())||(M={t:"d",v:Dt(b)},t.cellDates||(M={t:"n",v:en(M.v)}),M.z=t.dateNF||Re[14]):M={t:"n",v:dr(b)}),t.dense?(r[d]||(r[d]=[]),r[d][p]=M):r[Pe({r:d,c:p})]=M,p+=f}}}}else{if(++d,t.sheetRows&&t.sheetRows<=d){--d;break}p=0}}return r["!ref"]=Ge(h),g.length&&(r["!merges"]=g),r}function _0(n,a,t,r){for(var i=n["!merges"]||[],s=[],o=a.s.c;o<=a.e.c;++o){for(var l=0,c=0,d=0;d<i.length;++d)if(!(i[d].s.r>t||i[d].s.c>o||i[d].e.r<t||i[d].e.c<o)){if(i[d].s.r<t||i[d].s.c<o){l=-1;break}l=i[d].e.r-i[d].s.r+1,c=i[d].e.c-i[d].s.c+1;break}if(!(l<0)){var p=Pe({r:t,c:o}),u=r.dense?(n[t]||[])[o]:n[p],f=u&&null!=u.v&&(u.h||Co(u.w||(Cr(u),u.w)||""))||"",h={};l>1&&(h.rowspan=l),c>1&&(h.colspan=c),r.editable?f='<span contenteditable="true">'+f+"</span>":u&&(h["data-t"]=u&&u.t||"z",null!=u.v&&(h["data-v"]=u.v),null!=u.z&&(h["data-z"]=u.z),u.l&&"#"!=(u.l.Target||"#").charAt(0)&&(f='<a href="'+u.l.Target+'">'+f+"</a>")),h.id=(r.id||"sjs")+"-"+p,s.push(de("td",f,h))}}return"<tr>"+s.join("")+"</tr>"}function k0(n,a,t){var r=t||{},i=0,s=0;if(null!=r.origin)if("number"==typeof r.origin)i=r.origin;else{var o="string"==typeof r.origin?Rt(r.origin):r.origin;i=o.r,s=o.c}var l=a.getElementsByTagName("tr"),c=Math.min(r.sheetRows||1e7,l.length),d={s:{r:0,c:0},e:{r:i,c:s}};if(n["!ref"]){var p=Un(n["!ref"]);d.s.r=Math.min(d.s.r,p.s.r),d.s.c=Math.min(d.s.c,p.s.c),d.e.r=Math.max(d.e.r,p.e.r),d.e.c=Math.max(d.e.c,p.e.c),-1==i&&(d.e.r=i=p.e.r+1)}var u=[],f=0,h=n["!rows"]||(n["!rows"]=[]),g=0,m=0,_=0,v=0,k=0,b=0;for(n["!cols"]||(n["!cols"]=[]);g<l.length&&m<c;++g){var A=l[g];if(w0(A)){if(r.display)continue;h[m]={hidden:!0}}var G=A.children;for(_=v=0;_<G.length;++_){var j=G[_];if(!r.display||!w0(j)){var w=j.hasAttribute("data-v")?j.getAttribute("data-v"):j.hasAttribute("v")?j.getAttribute("v"):od(j.innerHTML),O=j.getAttribute("data-z")||j.getAttribute("z");for(f=0;f<u.length;++f){var M=u[f];M.s.c==v+s&&M.s.r<m+i&&m+i<=M.e.r&&(v=M.e.c+1-s,f=-1)}b=+j.getAttribute("colspan")||1,((k=+j.getAttribute("rowspan")||1)>1||b>1)&&u.push({s:{r:m+i,c:v+s},e:{r:m+i+(k||1)-1,c:v+s+(b||1)-1}});var H={t:"s",v:w},z=j.getAttribute("data-t")||j.getAttribute("t")||"";null!=w&&(0==w.length?H.t=z||"z":r.raw||0==w.trim().length||"s"==z||("TRUE"===w?H={t:"b",v:!0}:"FALSE"===w?H={t:"b",v:!1}:isNaN(dr(w))?isNaN(Gi(w).getDate())||(H={t:"d",v:Dt(w)},r.cellDates||(H={t:"n",v:en(H.v)}),H.z=r.dateNF||Re[14]):H={t:"n",v:dr(w)})),void 0===H.z&&null!=O&&(H.z=O);var P="",oe=j.getElementsByTagName("A");if(oe&&oe.length)for(var ve=0;
1ve<oe.length&&(!oe[ve].hasAttribute("href")||"#"==(P=oe[ve].getAttribute("href")).charAt(0));++ve);P&&"#"!=P.charAt(0)&&(H.l={Target:P}),r.dense?(n[m+i]||(n[m+i]=[]),n[m+i][v+s]=H):n[Pe({c:v+s,r:m+i})]=H,d.e.c<v+s&&(d.e.c=v+s),v+=b}}++m}return u.length&&(n["!merges"]=(n["!merges"]||[]).concat(u)),d.e.r=Math.max(d.e.r,m-1+i),n["!ref"]=Ge(d),m>=c&&(n["!fullref"]=Ge((d.e.r=l.length-g+m-1+i,d))),n}function T0(n,a){return k0((a||{}).dense?[]:{},n,a)}function w0(n){var a="",t=function sD(n){return n.ownerDocument.defaultView&&"function"==typeof n.ownerDocument.defaultView.getComputedStyle?n.ownerDocument.defaultView.getComputedStyle:"function"==typeof getComputedStyle?getComputedStyle:null}(n);return t&&(a=t(n).getPropertyValue("display")),a||(a=n.style&&n.style.display),"none"===a}function oD(n){var a=n.replace(/[\t\r\n]/g," ").trim().replace(/ +/g," ").replace(/<text:s\/>/g," ").replace(/<text:s text:c="(\d+)"\/>/g,function(r,i){return Array(parseInt(i,10)+1).join(" ")}).replace(/<text:tab[^>]*\/>/g,"\t").replace(/<text:line-break\/>/g,"\n");return[tt(a.replace(/<[^>]*>/g,""))]}var y0={day:["d","dd"],month:["m","mm"],year:["y","yy"],hours:["h","hh"],minutes:["m","mm"],seconds:["s","ss"],"am-pm":["A/P","AM/PM"],"day-of-week":["ddd","dddd"],era:["e","ee"],quarter:["\\Qm",'m\\"th quarter"']};function F0(n,a){var s,o,p,u,m,_,t=a||{},r=wo(n),i=[],l={name:""},c="",d=0,f={},h=[],g=t.dense?[]:{},v={value:""},k="",b=0,G=[],j=-1,w=-1,O={s:{r:1e6,c:1e7},e:{r:0,c:0}},M=0,H={},z=[],P={},oe=0,ve=0,ae=[],ye=1,ke=1,He=[],ge={Names:[]},Fe={},te=["",""],I=[],X={},R="",D=0,Z=!1,me=!1,le=0;for(xa.lastIndex=0,r=r.replace(/<!--([\s\S]*?)-->/gm,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");m=xa.exec(r);)switch(m[3]=m[3].replace(/_.*$/,"")){case"table":case"\u5de5\u4f5c\u8868":"/"===m[1]?(g["!ref"]=O.e.c>=O.s.c&&O.e.r>=O.s.r?Ge(O):"A1:A1",t.sheetRows>0&&t.sheetRows<=O.e.r&&(g["!fullref"]=g["!ref"],O.e.r=t.sheetRows-1,g["!ref"]=Ge(O)),z.length&&(g["!merges"]=z),ae.length&&(g["!rows"]=ae),p.name=p.\u540d\u79f0||p.name,typeof JSON<"u"&&JSON.stringify(p),h.push(p.name),f[p.name]=g,me=!1):"/"!==m[0].charAt(m[0].length-2)&&(p=Me(m[0],!1),j=w=-1,O.s.r=O.s.c=1e7,O.e.r=O.e.c=0,g=t.dense?[]:{},z=[],ae=[],me=!0);break;case"table-row-group":"/"===m[1]?--M:++M;break;case"table-row":case"\u884c":if("/"===m[1]){j+=ye,ye=1;break}if((u=Me(m[0],!1)).\u884c\u53f7?j=u.\u884c\u53f7-1:-1==j&&(j=0),(ye=+u["number-rows-repeated"]||1)<10)for(le=0;le<ye;++le)M>0&&(ae[j+le]={level:M});w=-1;break;case"covered-table-cell":"/"!==m[1]&&++w,t.sheetStubs&&(t.dense?(g[j]||(g[j]=[]),g[j][w]={t:"z"}):g[Pe({r:j,c:w})]={t:"z"}),k="",G=[];break;case"table-cell":case"\u6570\u636e":if("/"===m[0].charAt(m[0].length-2))++w,v=Me(m[0],!1),ke=parseInt(v["number-columns-repeated"]||"1",10),_={t:"z",v:null},v.formula&&0!=t.cellFormula&&(_.f=Zp(tt(v.formula))),"string"==(v.\u6570\u636e\u7c7b\u578b||v["value-type"])&&(_.t="s",_.v=tt(v["string-value"]||""),t.dense?(g[j]||(g[j]=[]),g[j][w]=_):g[Pe({r:j,c:w})]=_),w+=ke-1;else if("/"!==m[1]){k="",b=0,G=[],ke=1;var ce=ye?j+ye-1:j;if(++w>O.e.c&&(O.e.c=w),w<O.s.c&&(O.s.c=w),j<O.s.r&&(O.s.r=j),ce>O.e.r&&(O.e.r=ce),I=[],X={},_={t:(v=Me(m[0],!1)).\u6570\u636e\u7c7b\u578b||v["value-type"],v:null},t.cellFormula)if(v.formula&&(v.formula=tt(v.formula)),v["number-matrix-columns-spanned"]&&v["number-matrix-rows-spanned"]&&(oe=parseInt(v["number-matrix-rows-spanned"],10)||0,ve=parseInt(v["number-matrix-columns-spanned"],10)||0,_.F=Ge(P={s:{r:j,c:w},e:{r:j+oe-1,c:w+ve-1}}),He.push([P,_.F])),v.formula)_.f=Zp(v.formula);else for(le=0;le<He.length;++le)j>=He[le][0].s.r&&j<=He[le][0].e.r&&w>=He[le][0].s.c&&w<=He[le][0].e.c&&(_.F=He[le][1]);switch((v["number-columns-spanned"]||v["number-rows-spanned"])&&(oe=parseInt(v["number-rows-spanned"],10)||0,ve=parseInt(v["number-columns-spanned"],10)||0,z.pu
1sh(P={s:{r:j,c:w},e:{r:j+oe-1,c:w+ve-1}})),v["number-columns-repeated"]&&(ke=parseInt(v["number-columns-repeated"],10)),_.t){case"boolean":_.t="b",_.v=yt(v["boolean-value"]);break;case"float":case"percentage":case"currency":_.t="n",_.v=parseFloat(v.value);break;case"date":_.t="d",_.v=Dt(v["date-value"]),t.cellDates||(_.t="n",_.v=en(_.v)),_.z="m/d/yy";break;case"time":_.t="n",_.v=$3(v["time-value"])/86400,t.cellDates&&(_.t="d",_.v=bs(_.v)),_.z="HH:MM:SS";break;case"number":_.t="n",_.v=parseFloat(v.\u6570\u636e\u6570\u503c);break;default:if("string"!==_.t&&"text"!==_.t&&_.t)throw new Error("Unsupported value type "+_.t);_.t="s",null!=v["string-value"]&&(k=tt(v["string-value"]),G=[])}}else{if(Z=!1,"s"===_.t&&(_.v=k||"",G.length&&(_.R=G),Z=0==b),Fe.Target&&(_.l=Fe),I.length>0&&(_.c=I,I=[]),k&&!1!==t.cellText&&(_.w=k),Z&&(_.t="z",delete _.v),(!Z||t.sheetStubs)&&!(t.sheetRows&&t.sheetRows<=j))for(var ne=0;ne<ye;++ne){if(ke=parseInt(v["number-columns-repeated"]||"1",10),t.dense)for(g[j+ne]||(g[j+ne]=[]),g[j+ne][w]=0==ne?_:xt(_);--ke>0;)g[j+ne][w+ke]=xt(_);else for(g[Pe({r:j+ne,c:w})]=_;--ke>0;)g[Pe({r:j+ne,c:w+ke})]=xt(_);O.e.c<=w&&(O.e.c=w)}w+=(ke=parseInt(v["number-columns-repeated"]||"1",10))-1,ke=0,_={},k="",G=[]}Fe={};break;case"document":case"document-content":case"\u7535\u5b50\u8868\u683c\u6587\u6863":case"spreadsheet":case"\u4e3b\u4f53":case"scripts":case"styles":case"font-face-decls":case"master-styles":if("/"===m[1]){if((s=i.pop())[0]!==m[3])throw"Bad state: "+s}else"/"!==m[0].charAt(m[0].length-2)&&i.push([m[3],!0]);break;case"annotation":if("/"===m[1]){if((s=i.pop())[0]!==m[3])throw"Bad state: "+s;X.t=k,G.length&&(X.R=G),X.a=R,I.push(X)}else"/"!==m[0].charAt(m[0].length-2)&&i.push([m[3],!1]);R="",D=0,k="",b=0,G=[];break;case"creator":"/"===m[1]?R=r.slice(D,m.index):D=m.index+m[0].length;break;case"meta":case"\u5143\u6570\u636e":case"settings":case"config-item-set":case"config-item-map-indexed":case"config-item-map-entry":case"config-item-map-named":case"shapes":case"frame":case"text-box":case"image":case"data-pilot-tables":case"list-style":case"form":case"dde-links":case"event-listeners":case"chart":if("/"===m[1]){if((s=i.pop())[0]!==m[3])throw"Bad state: "+s}else"/"!==m[0].charAt(m[0].length-2)&&i.push([m[3],!1]);k="",b=0,G=[];break;case"scientific-number":case"currency-symbol":case"currency-style":case"script":case"libraries":case"automatic-styles":case"default-style":case"page-layout":case"style":case"map":case"font-face":case"paragraph-properties":case"table-properties":case"table-column-properties":case"table-row-properties":case"table-cell-properties":case"fraction":case"boolean-style":case"boolean":case"text-style":case"text-content":case"text-properties":case"embedded-text":case"body":case"\u7535\u5b50\u8868\u683c":case"forms":case"table-column":case"table-header-rows":case"table-rows":case"table-column-group":case"table-header-columns":case"table-columns":case"null-date":case"graphic-properties":case"calculation-settings":case"named-expressions":case"label-range":case"label-ranges":case"named-expression":case"sort":case"sort-by":case"sort-groups":case"tab":case"line-break":case"span":case"s":case"date":case"object":case"title":case"\u6807\u9898":case"desc":case"binary-data":case"table-source":case"scenario":case"iteration":case"content-validations":case"content-validation":case"help-message":case"error-message":case"database-ranges":case"filter":case"filter-and":case"filter-or":case"filter-condition":case"list-level-style-bullet":case"list-level-style-number":case"list-level-properties":case"sender-firstname":case"sender-lastname":case"sender-initials":case"sender-title":case"sender-position":case"sender-email":case"sender-phone-private":case"sender-fax":case"sender-company":case"sender-phone-work":case"sender-street":case"sender-city":case"sender-postal-code":case"sender-country":case"sender-state-or-province":case"author-name":case"author-initials":case"chapter":case"file-name":case"template-name":case"sheet-name":case"event-listener":case"initial-creator":case"creation-date":case"print-date":case"generator":case"document-statistic":case"user-defined":case"editing-duration":case"editing-cycles":case"config-item":case"page-number":case"page-count":case"time":case"cell-range-source":case"detective":case"operation":case"highlighted-range":case"data-
1pilot-table":case"source-cell-range":case"source-service":case"data-pilot-field":case"data-pilot-level":case"data-pilot-subtotals":case"data-pilot-subtotal":case"data-pilot-members":case"data-pilot-member":case"data-pilot-display-info":case"data-pilot-sort-info":case"data-pilot-layout-info":case"data-pilot-field-reference":case"data-pilot-groups":case"data-pilot-group":case"data-pilot-group-member":case"rect":case"dde-connection-decls":case"dde-connection-decl":case"dde-link":case"dde-source":case"properties":case"property":case"table-protection":case"data-pilot-grand-total":case"office-document-common-attrs":break;case"number-style":case"percentage-style":case"date-style":case"time-style":if("/"===m[1]){if(H[l.name]=c,(s=i.pop())[0]!==m[3])throw"Bad state: "+s}else"/"!==m[0].charAt(m[0].length-2)&&(c="",l=Me(m[0],!1),i.push([m[3],!0]));break;case"number":case"day":case"month":case"year":case"era":case"day-of-week":case"week-of-year":case"quarter":case"hours":case"minutes":case"seconds":case"am-pm":switch(i[i.length-1][0]){case"time-style":case"date-style":o=Me(m[0],!1),c+=y0[m[3]]["long"===o.style?1:0]}break;case"text":if("/>"===m[0].slice(-2))break;if("/"===m[1])switch(i[i.length-1][0]){case"number-style":case"date-style":case"time-style":c+=r.slice(d,m.index)}else d=m.index+m[0].length;break;case"named-range":te=ll((o=Me(m[0],!1))["cell-range-address"]);var Le={Name:o.name,Ref:te[0]+"!"+te[1]};me&&(Le.Sheet=h.length),ge.Names.push(Le);break;case"p":case"\u6587\u672c\u4e32":if(["master-styles"].indexOf(i[i.length-1][0])>-1)break;if("/"!==m[1]||v&&v["string-value"])Me(m[0],!1),b=m.index+m[0].length;else{var E=oD(r.slice(b,m.index));k=(k.length>0?k+"\n":"")+E[0]}break;case"database-range":if("/"===m[1])break;try{f[(te=ll(Me(m[0])["target-range-address"]))[0]]["!autofilter"]={ref:te[1]}}catch{}break;case"a":if("/"!==m[1]){if(!(Fe=Me(m[0],!1)).href)break;Fe.Target=tt(Fe.href),delete Fe.href,"#"==Fe.Target.charAt(0)&&Fe.Target.indexOf(".")>-1?(te=ll(Fe.Target.slice(1)),Fe.Target="#"+te[0]+"!"+te[1]):Fe.Target.match(/^\.\.[\\\/]/)&&(Fe.Target=Fe.Target.slice(3))}break;default:switch(m[2]){case"dc:":case"calcext:":case"loext:":case"ooo:":case"chartooo:":case"draw:":case"style:":case"chart:":case"form:":case"uof:":case"\u8868:":case"\u5b57:":break;default:if(t.WTF)throw new Error(m)}}var mt={Sheets:f,SheetNames:h,Workbook:ge};return t.bookSheets&&delete mt.Sheets,mt}function E0(n,a){return F0(n,a)}function Ei(n){return new DataView(n.buffer,n.byteOffset,n.byteLength)}function hl(n){return typeof TextDecoder<"u"?(new TextDecoder).decode(n):gt(Hr(n))}function ni(n){var a=n.reduce(function(i,s){return i+s.length},0),t=new Uint8Array(a),r=0;return n.forEach(function(i){t.set(i,r),r+=i.length}),t}function R0(n){return 16843009*((n=(858993459&(n-=n>>1&1431655765))+(n>>2&858993459))+(n>>4)&252645135)>>>24}function La(n,a){var t=a?a[0]:0,r=127&n[t];e:if(n[t++]>=128&&(r|=(127&n[t])<<7,n[t++]<128||(r|=(127&n[t])<<14,n[t++]<128)||(r|=(127&n[t])<<21,n[t++]<128)||(r+=(127&n[t])*Math.pow(2,28),++t,n[t++]<128)||(r+=(127&n[t])*Math.pow(2,35),++t,n[t++]<128)||(r+=(127&n[t])*Math.pow(2,42),++t,n[t++]<128)))break e;return a&&(a[0]=t),r}function Gt(n){var a=0,t=127&n[a];e:if(n[a++]>=128){if(t|=(127&n[a])<<7,n[a++]<128||(t|=(127&n[a])<<14,n[a++]<128)||(t|=(127&n[a])<<21,n[a++]<128))break e;t|=(127&n[a])<<28}return t}function ot(n){for(var a=[],t=[0];t[0]<n.length;){var l,r=t[0],i=La(n,t),s=7&i,o=0;if(0==(i=Math.floor(i/8)))break;switch(s){case 0:for(var c=t[0];n[t[0]++]>=128;);l=n.slice(c,t[0]);break;case 5:l=n.slice(t[0],t[0]+(o=4)),t[0]+=o;break;case 1:l=n.slice(t[0],t[0]+(o=8)),t[0]+=o;break;case 2:o=La(n,t),l=n.slice(t[0],t[0]+o),t[0]+=o;break;default:throw new Error("PB Type ".concat(s," for Field ").concat(i," at offset ").concat(r))}var d={data:l,type:s};null==a[i]?a[i]=[d]:a[i].push(d)}return a}function gl(n,a){return n?.map(function(t){return a(t.data)})||[]}function fD(n,a){if(0!=n)throw new Error("Unexpected Snappy chunk type ".concat(n));for(var t=[0],r=La(a,t),i=[];t[0]<a.length;){var s=3&a[t[0]];if(0!=s){var c=0,d=0;if(1==s?(d=4+(a[t[0]]>>2&7),c=(224&a[t[0]++])<<3,c|=a[t[0]++]):(d=1+(a[t[0]++]>>2),2==s?(c=a[t[0]]|a[t[0]+1]<<8,t[0]+=2):(c=(a[t[0]]|a[t[0]+1]<<8|a[t[0]+2]<<16|a[t[0]+3]<<24)>>>0,t[0]+=4)),i=[ni(i)],0==c)throw new Error("Invalid offset 0");if(c>i[0].length)throw new Error("Invalid offset beyond length");if(d>=c)for(i.push(i[0].slice(-c)),d-=c;d>=i[i.length-1].length;)i.push(i[i.length-1]),d-=i[i.length-1].length;i.push(i[0].slice(-c,-c+d))}else{var o=a[t[0]++]>>2;if(o<60)++o;else{var l=o-59;o=a[t[0]],l>1&&(o|=a[t[0]+1]<<8),l>2&&(o|=a[t[0]+2]<<16),l>3&&(o|=a[t[0]+3]<<24),o>>>=0,o++,t[0]+=l}i.push(a.slice(t[0],t[0]+o)),t[0]+=o}}var p=ni(i);if(p.length!=r)throw new Error("Unexpected length: ".concat(p.length," != ").concat(r));return p}function gD(n,a,t){switch(n[0]){case 0:case 1:case 2:case 3:return function mD(n,a,t,r){var u,i=Ei(n),s=i.getUint32(4,!0),o=(r>1?12:8)+4*R0(s&(r>1?3470:398)),l=-1,c=-1,d=NaN,p=new Date(2001,0,1);switch(512&s&&(l=i.getUint32(o,!0),o+=4),o+=4*R0(s&(r>1?12288:4096)),16&s&&(c=i.getUint32(o,!0),o+=4),32&s&&(d=i.getFloat64(o,!0),o+=8),64&s&&(p.setTime(p.getTime()+1e3*i.getFloat64(o,!0)),o+=8),n[2]){case 0:break;case 2:u={t:"n",v:d};break;
1case 3:u={t:"s",v:a[c]};break;case 5:u={t:"d",v:p};break;case 6:u={t:"b",v:d>0};break;case 7:u={t:"n",v:d/86400};break;case 8:u={t:"e",v:0};break;case 9:if(l>-1)u={t:"s",v:t[l]};else if(c>-1)u={t:"s",v:a[c]};else{if(isNaN(d))throw new Error("Unsupported cell type ".concat(n.slice(0,4)));u={t:"n",v:d}}break;default:throw new Error("Unsupported cell type ".concat(n.slice(0,4)))}return u}(n,a,t,n[0]);case 5:return function hD(n,a,t){var u,r=Ei(n),i=r.getUint32(8,!0),s=12,o=-1,l=-1,c=NaN,d=NaN,p=new Date(2001,0,1);switch(1&i&&(c=function pD(n,a){for(var t=(127&n[a+15])<<7|n[a+14]>>1,r=1&n[a+14],i=a+13;i>=a;--i)r=256*r+n[i];return(128&n[a+15]?-r:r)*Math.pow(10,t-6176)}(n,s),s+=16),2&i&&(d=r.getFloat64(s,!0),s+=8),4&i&&(p.setTime(p.getTime()+1e3*r.getFloat64(s,!0)),s+=8),8&i&&(l=r.getUint32(s,!0),s+=4),16&i&&(o=r.getUint32(s,!0),s+=4),n[1]){case 0:break;case 2:case 10:u={t:"n",v:c};break;case 3:u={t:"s",v:a[l]};break;case 5:u={t:"d",v:p};break;case 6:u={t:"b",v:d>0};break;case 7:u={t:"n",v:d/86400};break;case 8:u={t:"e",v:0};break;case 9:if(!(o>-1))throw new Error("Unsupported cell type ".concat(n[1]," : ").concat(31&i," : ").concat(n.slice(0,4)));u={t:"s",v:t[o]};break;default:throw new Error("Unsupported cell type ".concat(n[1]," : ").concat(31&i," : ").concat(n.slice(0,4)))}return u}(n,a,t);default:throw new Error("Unsupported payload version ".concat(n[0]))}}function wn(n){return La(ot(n)[1][0].data)}function j0(n,a){var t=ot(a.data),r=Gt(t[1][0].data),s=[];return(t[3]||[]).forEach(function(o){var l=ot(o.data),c=Gt(l[1][0].data)>>>0;switch(r){case 1:s[c]=hl(l[3][0].data);break;case 8:var p=ot(n[wn(l[9][0].data)][0].data),u=n[wn(p[1][0].data)][0],f=Gt(u.meta[1][0].data);if(2001!=f)throw new Error("2000 unexpected reference to ".concat(f));var h=ot(u.data);s[c]=h[3].map(function(g){return hl(g.data)}).join("")}}),s}function bD(n,a){var r={"!ref":"A1"},i=n[wn(ot(a.data)[2][0].data)],s=Gt(i[0].meta[1][0].data);if(6001!=s)throw new Error("6000 unexpected reference to ".concat(s));return function vD(n,a,t){var r,i=ot(a.data),s={s:{r:0,c:0},e:{r:0,c:0}};if(s.e.r=(Gt(i[6][0].data)>>>0)-1,s.e.r<0)throw new Error("Invalid row varint ".concat(i[6][0].data));if(s.e.c=(Gt(i[7][0].data)>>>0)-1,s.e.c<0)throw new Error("Invalid col varint ".concat(i[7][0].data));t["!ref"]=Ge(s);var o=ot(i[4][0].data),l=j0(n,n[wn(o[4][0].data)][0]),c=null!=(r=o[17])&&r[0]?j0(n,n[wn(o[17][0].data)][0]):[],d=ot(o[3][0].data),p=0;d[1].forEach(function(u){var f=ot(u.data),h=n[wn(f[2][0].data)][0],g=Gt(h.meta[1][0].data);if(6002!=g)throw new Error("6001 unexpected reference to ".concat(g));var m=function xD(n,a){var t,r=ot(a.data),i=null!=(t=r?.[7])&&t[0]?Gt(r[7][0].data)>>>0>0?1:0:-1,s=gl(r[5],function(o){return function _D(n,a){var t,r,i,s,o,l,c,d,p,u,f,h,g,m,A,G,_=ot(n),v=Gt(_[1][0].data)>>>0,k=Gt(_[2][0].data)>>>0,b=(null==(r=null==(t=_[8])?void 0:t[0])?void 0:r.data)&&Gt(_[8][0].data)>0||!1;if(null!=(s=null==(i=_[7])?void 0:i[0])&&s.data&&0!=a)A=null==(l=null==(o=_[7])?void 0:o[0])?void 0:l.data,G=null==(d=null==(c=_[6])?void 0:c[0])?void 0:d.data;else{if(null==(u=null==(p=_[4])?void 0:p[0])||!u.data||1==a)throw"NUMBERS Tile missing ".concat(a," cell storage");A=null==(h=null==(f=_[4])?void 0:f[0])?void 0:h.data,G=null==(m=null==(g=_[3])?void 0:g[0])?void 0:m.data}for(var j=b?4:1,w=Ei(A),O=[],M=0;M<A.length/2;++M){var H=w.getUint16(2*M,!0);H<65535&&O.push([M,H])}if(O.length!=k)throw"Expected ".concat(k," cells, found ").concat(O.length);var z=[];for(M=0;M<O.length-1;++M)z[O[M][0]]=G.subarray(O[M][1]*j,O[M+1][1]*j);return O.length>=1&&(z[O[O.length-1][0]]=G.subarray(O[O.length-1][1]*j)),{R:v,cells:z}}(o,i)});return{nrows:Gt(r[4][0].data)>>>0,data:s.reduce(function(o,l){return o[l.R]||(o[l.R]=[]),l.cells.forEach(function(c,d){if(o[l.R][d])throw new Error("Duplicate cell r=".concat(l.R," c=").concat(d));o[l.R][d]=c}),o},[])}}(0,h);m.data.forEach(function(_,v){_.forEach(function(k,b){var A=Pe({r:p+v,c:b}),G=gD(k,l,c);G&&(t[A]=G)})}),p+=m.nrows})}(n,i[0],r),r}function vl(n){var a,t,r,i,s={},o=[];if(n.FullPaths.forEach(function(c){if(c.match(/\.iwpv2/))throw new Error("Unsupported password protection")}
1),n.FileIndex.forEach(function(c){if(c.name.match(/\.iwa$/)){var d,p;try{d=function nr(n){for(var a=[],t=0;t<n.length;){var r=n[t++],i=n[t]|n[t+1]<<8|n[t+2]<<16;a.push(fD(r,n.slice(t+=3,t+i))),t+=i}if(t!==n.length)throw new Error("data is not a valid framed stream!");return ni(a)}(c.content)}catch(u){return console.log("?? "+c.content.length+" "+(u.message||u))}try{p=function tr(n){for(var a,t=[],r=[0];r[0]<n.length;){var i=La(n,r),s=ot(n.slice(r[0],r[0]+i));r[0]+=i;var o={id:Gt(s[1][0].data),messages:[]};s[2].forEach(function(l){var c=ot(l.data),d=Gt(c[3][0].data);o.messages.push({meta:c,data:n.slice(r[0],r[0]+d)}),r[0]+=d}),null!=(a=s[3])&&a[0]&&(o.merge=Gt(s[3][0].data)>>>0>0),t.push(o)}return t}(d)}catch(u){return console.log("## "+(u.message||u))}p.forEach(function(u){s[u.id]=u.messages,o.push(u.id)})}}),!o.length)throw new Error("File has no messages");var l=(null==(i=null==(r=null==(t=null==(a=s?.[1])?void 0:a[0])?void 0:t.meta)?void 0:r[1])?void 0:i[0].data)&&1==Gt(s[1][0].meta[1][0].data)&&s[1][0];if(l||o.forEach(function(c){s[c].forEach(function(d){if(1==Gt(d.meta[1][0].data)>>>0){if(l)throw new Error("Document has multiple roots");l=d}})}),!l)throw new Error("Cannot find Document root");return function kD(n,a){var t={SheetNames:[],Sheets:{}};if(gl(ot(a.data)[1],wn).forEach(function(s){n[s].forEach(function(o){if(2==Gt(o.meta[1][0].data)){var c=function CD(n,a){var t,r=ot(a.data),i={name:null!=(t=r[1])&&t[0]?hl(r[1][0].data):"",sheets:[]};return gl(r[2],wn).forEach(function(o){n[o].forEach(function(l){6e3==Gt(l.meta[1][0].data)&&i.sheets.push(bD(n,l))})}),i}(n,o);c.sheets.forEach(function(d,p){El(t,d,0==p?c.name:c.name+"_"+p,!0)})}})}),0==t.SheetNames.length)throw new Error("Empty NUMBERS file");return t}(s,l)}function bl(n){!function A0(n){return function(t){for(var r=0;r!=n.length;++r){var i=n[r];void 0===t[i[0]]&&(t[i[0]]=i[1]),"n"===i[2]&&(t[i[0]]=Number(t[i[0]]))}}}([["cellNF",!1],["cellHTML",!0],["cellFormula",!0],["cellStyles",!1],["cellText",!0],["cellDates",!1],["sheetStubs",!1],["sheetRows",0,"n"],["bookDeps",!1],["bookSheets",!1],["bookProps",!1],["bookFiles",!1],["bookVBA",!1],["password",""],["WTF",!1]])(n)}function yD(n){return Be.WS.indexOf(n)>-1?"sheet":Be.CS&&n==Be.CS?"chart":Be.DS&&n==Be.DS?"dialog":Be.MS&&n==Be.MS?"macro":n&&n.length?n:"sheet"}function SD(n,a,t,r,i,s,o,l,c,d,p,u){try{s[r]=Ta($n(n,t,!0),a);var h,f=Ht(n,a);switch(l){case"sheet":h=Z8(f,a,i,c,s[r],d,p,u);break;case"chart":if(!(h=function e7(n,a,t,r,i,s,o,l){return".bin"===a.slice(-4)?function D8(n,a,t,r,i){if(!n)return n;r||(r={"!id":{}});var s={"!type":"chart","!drawel":null,"!rel":""},o=[],l=!1;return Ar(n,function(d,p,u){switch(u){case 550:s["!rel"]=d;break;case 651:i.Sheets[t]||(i.Sheets[t]={}),d.name&&(i.Sheets[t].CodeName=d.name);break;case 562:case 652:case 669:case 679:case 551:case 552:case 476:case 3072:break;case 35:l=!0;break;case 36:l=!1;break;case 37:o.push(u);break;case 38:o.pop();break;default:if(p.T>0)o.push(u);else if(p.T<0)o.pop();else if(!l||a.WTF)throw new Error("Unexpected record 0x"+u.toString(16))}},a),r["!id"][s["!rel"]]&&(s["!drawel"]=r["!id"][s["!rel"]]),s}(n,r,t,i,s):function S8(n,a,t,r,i){if(!n)return n;r||(r={"!id":{}});var o,s={"!type":"chart","!drawel":null,"!rel":""},l=n.match(t0);return l&&dl(l[0],0,i,t),(o=n.match(/drawing r:id="(.*?)"/))&&(s["!rel"]=o[1]),r["!id"][s["!rel"]]&&(s["!drawel"]=r["!id"][s["!rel"]]),s}(n,0,t,i,s)}(f,a,i,c,s[r],d))||!h["!drawel"])break;var g=ga(h["!drawel"].Target,a),m=ka(g),_=function $S(n,a){if(!n)return"??";var t=(n.match(/<c:chart [^>]*r:id="([^"]*)"/)||["",""])[1];return a["!id"][t].Target}($n(n,g,!0),Ta($n(n,m,!0),g)),v=ga(_,g),k=ka(v);h=function F8(n,a,t,r,i,s){var o=s||{"!type":"chart"};if(!n)return s;var l=0,c=0,d="A",p={s:{r:2e6,c:2e6},e:{r:0,c:0}};return(n.match(/<c:numCache>[\s\S]*?<\/c:numCache>/gm)||[]).forEach(function(u){var f=function y8(n){var r,a=[],t=n.match(/^<c:numCache>/);(n.match(/<c:pt idx="(\d*)">(.*?)<\/c:pt>/gm)||[]).forEach(function(s){var o=s.match(/<c:pt idx="(\d*?)"><c:v>(.*)<\/c:v><\/c:pt>/);o&&(a[+o[1]]=t?+o[2]:o[2])});var i=tt((n.match(/<c:formatCode>([\s\S]*?)<\/c:formatCode>/)||["","General"])[1]);return(n.match(/<c:f>(.*?)<\/c:f>
1/gm)||[]).forEach(function(s){r=s.replace(/<.*?>/g,"")}),[a,i,r]}(u);p.s.r=p.s.c=0,p.e.c=l,d=Ft(l),f[0].forEach(function(h,g){o[d+Nt(g)]={t:"n",v:h,z:f[1]},c=g}),p.e.r<c&&(p.e.r=c),++l}),l>0&&(o["!ref"]=Ge(p)),o}($n(n,v,!0),0,0,Ta($n(n,k,!0),v),0,h);break;case"macro":h=function t7(n,a){return a.slice(-4),{"!type":"macro"}}(0,a);break;case"dialog":h=function n7(n,a){return a.slice(-4),{"!type":"dialog"}}(0,a);break;default:throw new Error("Unrecognized sheet type "+l)}o[r]=h;var b=[];s&&s[r]&&Pt(s[r]).forEach(function(A){var G="";if(s[r][A].Type==Be.CMNT){G=ga(s[r][A].Target,a);var j=function s7(n,a,t){return".bin"===a.slice(-4)?function KS(n,a){var t=[],r=[],i={},s=!1;return Ar(n,function(l,c,d){switch(d){case 632:r.push(l);break;case 635:i=l;break;case 637:i.t=l.t,i.h=l.h,i.r=l.r;break;case 636:if(i.author=r[i.iauthor],delete i.iauthor,a.sheetRows&&i.rfx&&a.sheetRows<=i.rfx.r)break;i.t||(i.t=""),delete i.rfx,t.push(i);break;case 3072:case 37:case 38:break;case 35:s=!0;break;case 36:s=!1;break;default:if(!c.T&&(!s||a.WTF))throw new Error("Unexpected record 0x"+d.toString(16))}}),t}(n,t):function VS(n,a){if(n.match(/<(?:\w+:)?comments *\/>/))return[];var t=[],r=[],i=n.match(/<(?:\w+:)?authors>([\s\S]*)<\/(?:\w+:)?authors>/);i&&i[1]&&i[1].split(/<\/\w*:?author>/).forEach(function(o){if(""!==o&&""!==o.trim()){var l=o.match(/<(?:\w+:)?author[^>]*>(.*)/);l&&t.push(l[1])}});var s=n.match(/<(?:\w+:)?commentList>([\s\S]*)<\/(?:\w+:)?commentList>/);return s&&s[1]&&s[1].split(/<\/\w*:?comment>/).forEach(function(o){if(""!==o&&""!==o.trim()){var l=o.match(/<(?:\w+:)?comment[^>]*>/);if(l){var c=Me(l[0]),d={author:c.authorId&&t[c.authorId]||"sheetjsghost",ref:c.ref,guid:c.guid},p=Rt(c.ref);if(!(a.sheetRows&&a.sheetRows<=p.r)){var u=o.match(/<(?:\w+:)?text>([\s\S]*)<\/(?:\w+:)?text>/),f=!!u&&!!u[1]&&Qo(u[1])||{r:"",t:"",h:""};d.r=f.r,"<t></t>"==f.r&&(f.t=f.h=""),d.t=(f.t||"").replace(/\r\n/g,"\n").replace(/\r/g,"\n"),a.cellHTML&&(d.h=f.h),r.push(d)}}}}),r}(n,t)}(Ht(n,G,!0),G,c);if(!j||!j.length)return;Gp(h,j,!1)}s[r][A].Type==Be.TCMNT&&(G=ga(s[r][A].Target,a),b=b.concat(function US(n,a){var t=[],r=!1,i={},s=0;return n.replace(_n,function(l,c){var d=Me(l);switch(vr(d[0])){case"<?xml":case"<ThreadedComments":case"</ThreadedComments>":case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<threadedComment":i={author:d.personId,guid:d.id,ref:d.ref,T:1};break;case"</threadedComment>":null!=i.t&&t.push(i);break;case"<text>":case"<text":s=c+l.length;break;case"</text>":i.t=n.slice(s,c).replace(/\r\n/g,"\n").replace(/\r/g,"\n");break;case"<mentions":case"<mentions>":case"<ext":r=!0;break;case"</mentions>":case"</ext>":r=!1;break;default:if(!r&&a.WTF)throw new Error("unrecognized "+d[0]+" in threaded comments")}return l}),t}(Ht(n,G,!0),c)))}),b&&b.length&&Gp(h,b,!0,c.people||[])}catch(A){if(c.WTF)throw A}}function rr(n){return"/"==n.charAt(0)?n.slice(1):n}function ED(n,a){if(Ni(),bl(a=a||{}),Kn(n,"META-INF/manifest.xml")||Kn(n,"objectdata.xml"))return function S0(n,a){a=a||{},Kn(n,"META-INF/manifest.xml")&&function GT(n,a){for(var r,i,t=wo(n);r=xa.exec(t);)switch(r[3]){case"manifest":break;case"file-entry":if("/"==(i=Me(r[0],!1)).path&&"application/vnd.oasis.opendocument.spreadsheet"!==i.type)throw new Error("This OpenDocument is not a spreadsheet");break;case"encryption-data":case"algorithm":case"start-key-generation":case"key-derivation":throw new Error("Unsupported ODS Encryption");default:if(a&&a.WTF)throw r}}(Ht(n,"META-INF/manifest.xml"),a);var t=$n(n,"content.xml");if(!t)throw new Error("Missing content.xml in ODS / UOF file");var r=F0(gt(t),a);return Kn(n,"meta.xml")&&(r.Props=Gd(Ht(n,"meta.xml"))),r}(n,a);if(Kn(n,"Index/Document.iwa")){if(typeof Uint8Array>"u")throw new Error("NUMBERS file parsing requires Uint8Array support");if(n.FileIndex)return vl(n);var t=Ee.utils.cfb_new();return Qc(n).forEach(function(ve){!function $e(n,a,t){if(n.FullPaths){var r;if("string"==typeof t)return r=We?Dr(t):function c3(n){for(var a=[],t=0,r=n.length+250,i=Wr(n.length+255),s=0;s<n.length;++s){var o=n.charCodeAt(s);if(o<128)i[t++]=o;else if(o<2048)i[t++]=192|o>>6&31,i[t++]=128|63&o;else if(o>=55296&&o<57344){o=64+(1023&o);
1var l=1023&n.charCodeAt(++s);i[t++]=240|o>>8&7,i[t++]=128|o>>2&63,i[t++]=128|l>>6&15|(3&o)<<4,i[t++]=128|63&l}else i[t++]=224|o>>12&15,i[t++]=128|o>>6&63,i[t++]=128|63&o;t>r&&(a.push(i.slice(0,t)),t=0,i=Wr(65535),r=65530)}return a.push(i.slice(0,t)),sn(a)}(t),Ee.utils.cfb_add(n,a,r);Ee.utils.cfb_add(n,a,t)}else n.file(a,t)}(t,ve,Kc(n,ve))}),vl(t)}if(!Kn(n,"[Content_Types].xml"))throw Kn(n,"index.xml.gz")?new Error("Unsupported NUMBERS 08 file"):Kn(n,"index.xml")?new Error("Unsupported NUMBERS 09 file"):new Error("Unsupported ZIP file");var o,l,r=Qc(n),i=function OT(n){var a={workbooks:[],sheets:[],charts:[],dialogs:[],macros:[],rels:[],strs:[],comments:[],threadedcomments:[],links:[],coreprops:[],extprops:[],custprops:[],themes:[],styles:[],calcchains:[],vba:[],drawings:[],metadata:[],people:[],TODO:[],xmlns:""};if(!n||!n.match)return a;var t={};if((n.match(_n)||[]).forEach(function(r){var i=Me(r);switch(i[0].replace(z3,"<")){case"<?xml":break;case"<Types":a.xmlns=i["xmlns"+(i[0].match(/<(\w+):/)||["",""])[1]];break;case"<Default":t[i.Extension]=i.ContentType;break;case"<Override":void 0!==a[Uo[i.ContentType]]&&a[Uo[i.ContentType]].push(i.PartName)}}),"http://schemas.openxmlformats.org/package/2006/content-types"!==a.xmlns)throw new Error("Unknown Namespace: "+a.xmlns);return a.calcchain=a.calcchains.length>0?a.calcchains[0]:"",a.sst=a.strs.length>0?a.strs[0]:"",a.style=a.styles.length>0?a.styles[0]:"",a.defaults=t,delete a.calcchains,a}($n(n,"[Content_Types].xml")),s=!1;if(0===i.workbooks.length&&Ht(n,l="xl/workbook.xml",!0)&&i.workbooks.push(l),0===i.workbooks.length){if(!Ht(n,l="xl/workbook.bin",!0))throw new Error("Could not find workbook");i.workbooks.push(l),s=!0}"bin"==i.workbooks[0].slice(-3)&&(s=!0);var c={},d={};if(!a.bookSheets&&!a.bookProps){if(Ma=[],i.sst)try{Ma=function a7(n,a,t){return".bin"===a.slice(-4)?function sF(n,a){var t=[],r=!1;return Ar(n,function(s,o,l){switch(l){case 159:t.Count=s[0],t.Unique=s[1];break;case 19:t.push(s);break;case 160:return!0;case 35:r=!0;break;case 36:r=!1;break;default:if(!r||a.WTF)throw new Error("Unexpected record 0x"+l.toString(16))}}),t}(n,t):function rF(n,a){var t=[],r="";if(!n)return t;var i=n.match(eF);if(i){r=i[2].replace(tF,"").split(nF);for(var s=0;s!=r.length;++s){var o=Qo(r[s].trim(),a);null!=o&&(t[t.length]=o)}i=Me(i[1]),t.Count=i.count,t.Unique=i.uniqueCount}return t}(n,t)}(Ht(n,rr(i.sst)),i.sst,a)}catch(ve){if(a.WTF)throw ve}a.cellStyles&&i.themes.length&&(c=function i7(n,a,t){return Pp(n,t)}($n(n,i.themes[0].replace(/^\//,""),!0)||"",0,a)),i.style&&(d=function r7(n,a,t,r){return".bin"===a.slice(-4)?function ZF(n,a,t){var r={NumberFmt:[]};for(var i in Re)r.NumberFmt[i]=Re[i];r.CellXf=[],r.Fonts=[];var s=[],o=!1;return Ar(n,function(c,d,p){switch(p){case 44:r.NumberFmt[c[0]]=c[1],xr(c[1],c[0]);break;case 43:r.Fonts.push(c),null!=c.color.theme&&a&&a.themeElements&&a.themeElements.clrScheme&&(c.color.rgb=Ms(a.themeElements.clrScheme[c.color.theme].rgb,c.color.tint||0));break;case 1025:case 45:case 46:case 48:case 507:case 572:case 475:case 1171:case 2102:case 1130:case 512:case 2095:case 3072:break;case 47:617==s[s.length-1]&&r.CellXf.push(c);break;case 35:o=!0;break;case 36:o=!1;break;case 37:s.push(p),o=!0;break;case 38:s.pop(),o=!1;break;default:if(d.T>0)s.push(p);else if(d.T<0)s.pop();else if(!o||t.WTF&&37!=s[s.length-1])throw new Error("Unexpected record 0x"+p.toString(16))}}),r}(n,t,r):$F(n,t,r)}(Ht(n,rr(i.style)),i.style,c,a))}i.links.map(function(ve){try{return Ta($n(n,ka(rr(ve))),ve),function l7(n,a,t,r){return".bin"===t.slice(-4)?function LS(n,a,t,r){if(!n)return n;var i=r||{},s=!1;Ar(n,function(c,d,p){switch(p){case 359:case 363:case 364:case 366:case 367:case 368:case 369:case 370:case 371:case 472:case 577:case 578:case 579:case 580:case 581:case 582:case 583:case 584:case 585:case 586:case 587:break;case 35:s=!0;break;case 36:s=!1;break;default:if(!d.T&&(!s||i.WTF))throw new Error("Unexpected record 0x"+p.toString(16))}},i)}(n,0,0,r):void 0}(Ht(n,rr(ve)),0,ve,a)}catch{}});var p=function Q8(n,a,t){return".bin"===a.slice(-4)?function W8(n,a){var t={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},xmlns:""},r=[],i=!1;a||(a={}),a.biff=12;var s=[],o=[[]];return o.SheetNames=[],o.XTI=[],Ga[16]={n:"BrtFRTArchID$",f:X8},Ar(n,function(c,d,p){switch(p){case 156:o.SheetNames.push(c.name),t.Sheets.push(c);break;case 153:t.WBProps=c;break;case 39:null!=c.Sheet&&(a.SID=c.Sheet),c.Ref=Tn(c.Ptg,0,null,o,a),delete a.SID,delete c.Ptg,s.push(c);break;case 1036:case 361:case 2071:case 158:case 143:case 664:case 353:case 3072:case 3073:case 534:case 677:case 157:case 610:case 2050:case 155:case 548:case 676:case 128:case 665:case 2128:case 2125:case 549:case 2053:case 596:case 2076:case 2075:case 2082:case 397:case 154:case 1117:case 553:case 2091:case 16:break;case 357:case 358:case 355:case 667:o[0].length?o.push([p,c]):o[0]=[p,c],o[o.length-1].XTI=[];break;case 362:0===o.length&&(o[0]=[],o[0].XTI=[]),o[o.length-1].XTI=o[o.length-1].XTI.concat(c),o.XTI=o.XTI.concat(c);break;case 35:case 37:r.push(p),i=!0;break;case 36:case 38:r.pop(),i=!1;break;default:if(!d.T&&(!i||a.WTF&&37!=r[r.length-1]&&35!=r[r.length-1]))throw new Error("Unexpected record 0x"+p.toString(16))}},a),o0(t),t.Names=s,t.supbooks=o,t}(n,t):function B8(n,a){if(!n)throw new Error("Could not find file");var t={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},Names:[],xmlns:""},r=!1,i="xmlns",s={},o=0;if(n.replace(_n,function(c,d){var p=Me(c);switch(vr(p[0])){case"<?xml":case"</workbook>":case"<fileVersion/>":case"</fileVersion>":case"<fileSharing":case"<fileSharing/>":case"</workbookPr>":case"<workbookProtection":case"<workbookProtection/>":case"<bookViews":case"<bookViews>":case"</bookViews>":case"</workbookView>":case"<sheets":case"<sheets>":case"</sheets>":case"</sheet>":case"<functionGroups":case"<functionGroups/>":case"<functionGroup":case"<externalReferences":case"</externalReferences>":case"<externalReferences>":case"<externalReference":case"<definedNames/>":case"<definedName/>":case"</calcPr>":case"<oleSize":case"<customWorkbookViews>":case"</customWorkbookViews>":case"<customWorkbookViews":case"<customWorkbookView":case"</customWorkbookView>":case"<pivotCaches>":case"</pivotCaches>":case"<pivotCaches":case"<pivotCache":case"<smartTagPr":case"<smartTagPr/>":case"<smartTagTypes":case"<smartTagTypes>":case"</smartTagTypes>":case"<smartTagType":case"<webPublishing":case"<webPublishing/>":case"<fileRecoveryPr":case"<fileRecoveryPr/>":case"<webPublishObjects>":case"<webPublishObjects":case"</webPublishObjects>":case"<webPublishObject":case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":case"<ArchID":case"<revisionPtr":break;case"<workbook":c.match(G8)&&(i="xmlns"+c.match(/<(\w+):/)[1]),t.xmlns=p[i];break;case"<fileVersion":delete p[0],t.AppVersion=p;break;
1case"<workbookPr":case"<workbookPr/>":pl.forEach(function(u){if(null!=p[u[0]])switch(u[2]){case"bool":t.WBProps[u[0]]=yt(p[u[0]]);break;case"int":t.WBProps[u[0]]=parseInt(p[u[0]],10);break;default:t.WBProps[u[0]]=p[u[0]]}}),p.codeName&&(t.WBProps.CodeName=gt(p.codeName));break;case"<workbookView":case"<workbookView/>":delete p[0],t.WBView.push(p);break;case"<sheet":switch(p.state){case"hidden":p.Hidden=1;break;case"veryHidden":p.Hidden=2;break;default:p.Hidden=0}delete p.state,p.name=tt(gt(p.name)),delete p[0],t.Sheets.push(p);break;case"<definedNames>":case"<definedNames":case"<ext":case"<AlternateContent":case"<AlternateContent>":r=!0;break;case"</definedNames>":case"</ext>":case"</AlternateContent>":r=!1;break;case"<definedName":(s={}).Name=gt(p.name),p.comment&&(s.Comment=p.comment),p.localSheetId&&(s.Sheet=+p.localSheetId),yt(p.hidden||"0")&&(s.Hidden=!0),o=d+c.length;break;case"</definedName>":s.Ref=tt(gt(n.slice(o,d))),t.Names.push(s);break;case"<calcPr":case"<calcPr/>":delete p[0],t.CalcPr=p;break;default:if(!r&&a.WTF)throw new Error("unrecognized "+p[0]+" in workbook")}return c}),-1===Kr.indexOf(t.xmlns))throw new Error("Unknown Namespace: "+t.xmlns);return o0(t),t}(n,t)}(Ht(n,rr(i.workbooks[0])),i.workbooks[0],a),u={},f="";i.coreprops.length&&((f=Ht(n,rr(i.coreprops[0]),!0))&&(u=Gd(f)),0!==i.extprops.length&&(f=Ht(n,rr(i.extprops[0]),!0))&&function XT(n,a,t){var r={};a||(a={}),n=gt(n),Ci.forEach(function(i){var s=(n.match(_a(i[0]))||[])[1];switch(i[2]){case"string":s&&(a[i[1]]=tt(s));break;case"bool":a[i[1]]="true"===s;break;case"raw":var o=n.match(new RegExp("<"+i[0]+"[^>]*>([\\s\\S]*?)</"+i[0]+">"));o&&o.length>0&&(r[i[1]]=o[1])}}),r.HeadingPairs&&r.TitlesOfParts&&$d(r.HeadingPairs,r.TitlesOfParts,a,t)}(f,u,a));var h={};(!a.bookSheets||a.bookProps)&&0!==i.custprops.length&&(f=$n(n,rr(i.custprops[0]),!0))&&(h=function WT(n,a){var t={},r="",i=n.match(YT);if(i)for(var s=0;s!=i.length;++s){var o=i[s],l=Me(o);switch(l[0]){case"<?xml":case"<Properties":break;case"<property":r=tt(l.name);break;case"</property>":r=null;break;default:if(0===o.indexOf("<vt:")){var c=o.split(">"),d=c[0].slice(4),p=c[1];switch(d){case"lpstr":case"bstr":case"lpwstr":case"cy":case"error":t[r]=tt(p);break;case"bool":t[r]=yt(p);break;case"i1":case"i2":case"i4":case"i8":case"int":case"uint":t[r]=parseInt(p,10);break;case"r4":case"r8":case"decimal":t[r]=parseFloat(p);break;case"filetime":case"date":t[r]=Dt(p);break;default:if("/"==d.slice(-1))break;a.WTF&&typeof console<"u"&&console.warn("Unexpected",o,d,c)}}else if("</"!==o.slice(0,2)&&a.WTF)throw new Error(o)}}return t}(f,a));var g={};if((a.bookSheets||a.bookProps)&&(p.Sheets?o=p.Sheets.map(function(ae){return ae.name}):u.Worksheets&&u.SheetNames.length>0&&(o=u.SheetNames),a.bookProps&&(g.Props=u,g.Custprops=h),a.bookSheets&&typeof o<"u"&&(g.SheetNames=o),a.bookSheets?g.SheetNames:a.bookProps))return g;o={};var m={};a.bookDeps&&i.calcchain&&(m=function o7(n,a,t){return".bin"===a.slice(-4)?function BS(n){var r=[];return Ar(n,function(o,l,c){if(63===c)r.push(o);else if(!l.T)throw new Error("Unexpected record 0x"+c.toString(16))}),r}(n):function NS(n){var a=[];if(!n)return a;var t=1;return(n.match(_n)||[]).forEach(function(r){var i=Me(r);switch(i[0]){case"<?xml":case"<calcChain":case"<calcChain>":case"</calcChain>":break;case"<c":delete i[0],i.i?t=i.i:i.i=t,a.push(i)}}),a}(n)}(Ht(n,rr(i.calcchain)),i.calcchain));var k,b,_=0,v={},A=p.Sheets;u.Worksheets=A.length,u.SheetNames=[];for(var G=0;G!=A.length;++G)u.SheetNames[G]=A[G].name;var j=s?"bin":"xml",w=i.workbooks[0].lastIndexOf("/"),O=(i.workbooks[0].slice(0,w+1)+"_rels/"+i.workbooks[0].slice(w+1)+".rels").replace(/^\//,"");Kn(n,O)||(O="xl/_rels/workbook."+j+".rels");var M=Ta($n(n,O,!0),O.replace(/_rels.*/,"s5s"));(i.metadata||[]).length>=1&&(a.xlmeta=function c7(n,a,t){return".bin"===a.slice(-4)?function MS(n,a,t){var r={Types:[],Cell:[],Value:[]},i=t||{},s=[],o=!1,l=2;return Ar(n,function(c,d,p){switch(p){case 335:r.Types.push({name:c.name});break;case 51:c.forEach(function(u){1==l?r.Cell.push({type:r.Types[u[0]-1].name,index:u[1]}):0==l&&r.Value.push({type:r.Types[u[0]-1].name,index:u[1]})});break;case 337:l=c?1:0;break;case 338:l=2;break;case 35:s.push(p),o=!0;break;case 36:s.pop(),o=!1;break;default:if(!d.T&&(!o||i.WTF&&35!=s[s.length-1]))throw new Error("Unexpected record 0x"+p.toString(16))}}),r}(n,0,t):function OS(n,a,t){var r={Types:[],Cell:[],Value:[]};if(!n)return r;var o,i=!1,s=2;return n.replace(_n,function(l){var c=Me(l);switch(vr(c[0])){case"<?xml":case"<metadata":case"</metadata>":case"<metadataTypes":case"</metadataTypes>":case"</metadataType>":case"</futureMetadata>":case"<bk>":case"</bk>":case"</rc>":case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<metadataType":r.Types.push({name:c.name});break;case"<futureMetadata":for(var d=0;d<r.Types.length;++d)r.Types[d].name==c.name&&(o=r.Types[d]);break;case"<rc":1==s?r.Cell.push({type:r.Types[c.t-1].name,index:+c.v}):0==s&&r.Value.push({type:r.Types[c.t-1].name,index:+c.v});break;case"<cellMetadata":s=1;break;case"</cellMetadata>":case"</valueMetadata>":s=2;break;case"<valueMetadata":s=0;break;case"<ext":i=!0;break;case"</ext>":i=!1;break;case"<rvb":if(!o)break;o.offsets||(o.offsets=[]),o.offsets.push(+c.i);break;default:if(!i&&t.WTF)throw new Error("unrecognized "+c[0]+" in metadata")}return l}),r}(n,0,t)}(Ht(n,rr(i.metadata[0])),i.metadata[0],a)),(i.people||[]).length>=1&&(a.people=function YS(n,a){var t=[],r=!1;return n.replace(_n,function(s){var o=Me(s);switch(vr(o[0])){case"<?xml":case"<personList":case"</personList>":case"</person>":case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<person":t.push({name:o.displayname,id:o.id});break;case"<ext":r=!0;break;case"</ext>":r=!1;break;default:if(!r&&a.WTF)throw new Error("unrecognized "+o[0]+" in threaded comments")}return s}),t}(Ht(n,rr(i.people[0])),a)),M&&(M=function FD(n,a){if(!n)return 0;try{n=a.map(function(r){return r.id||(r.id=r.strRelID),[r.name,n["!id"][r.id].Target,yD(n["!id"][r.id].Type)]})}catch{return null}return n&&0!==n.length?n:null}(M,p.Sheets));var H=Ht(n,"xl/worksheets/sheet.xml",!0)?1:0;e:for(_=0;_!=u.Worksheets;++_){var z="sheet";
1if(M&&M[_]?(k="xl/"+M[_][1].replace(/[\/]?xl\//,""),Kn(n,k)||(k=M[_][1]),Kn(n,k)||(k=O.replace(/_rels\/.*$/,"")+M[_][1]),z=M[_][2]):k=(k="xl/worksheets/sheet"+(_+1-H)+"."+j).replace(/sheet0\./,"sheet."),b=k.replace(/^(.*)(\/)([^\/]*)$/,"$1/_rels/$3.rels"),a&&null!=a.sheets)switch(typeof a.sheets){case"number":if(_!=a.sheets)continue e;break;case"string":if(u.SheetNames[_].toLowerCase()!=a.sheets.toLowerCase())continue e;break;default:if(Array.isArray&&Array.isArray(a.sheets)){for(var P=!1,oe=0;oe!=a.sheets.length;++oe)"number"==typeof a.sheets[oe]&&a.sheets[oe]==_&&(P=1),"string"==typeof a.sheets[oe]&&a.sheets[oe].toLowerCase()==u.SheetNames[_].toLowerCase()&&(P=1);if(!P)continue e}}SD(n,k,b,u.SheetNames[_],_,v,o,z,a,p,c,d)}return g={Directory:i,Workbook:p,Props:u,Custprops:h,Deps:m,Sheets:o,SheetNames:u.SheetNames,Strings:Ma,Styles:d,Themes:c,SSF:xt(Re)},a&&a.bookFiles&&(n.files?(g.keys=r,g.files=n.files):(g.keys=[],g.files={},n.FullPaths.forEach(function(ve,ae){ve=ve.replace(/^Root Entry[\/]/,""),g.keys.push(ve),g.files[ve]=n.FileIndex[ae]}))),a&&a.bookVBA&&(i.vba.length>0?g.vbaraw=Ht(n,rr(i.vba[0]),!0):i.defaults&&"application/vnd.ms-office.vbaProject"===i.defaults.bin&&(g.vbaraw=Ht(n,"xl/vbaProject.bin",!0))),g}function ID(n,a){var t=a||{},r="Workbook",i=Ee.find(n,r);try{if(!(i=Ee.find(n,r="/!DataSpaces/Version"))||!i.content)throw new Error("ECMA-376 Encrypted file missing "+r);if(function dF(n){var a={};a.id=n.read_shift(0,"lpp4"),a.R=Pr(n,4),a.U=Pr(n,4),a.W=Pr(n,4)}(i.content),!(i=Ee.find(n,r="/!DataSpaces/DataSpaceMap"))||!i.content)throw new Error("ECMA-376 Encrypted file missing "+r);var s=function uF(n){var a=[];n.l+=4;for(var t=n.read_shift(4);t-- >0;)a.push(pF(n));return a}(i.content);if(1!==s.length||1!==s[0].comps.length||0!==s[0].comps[0].t||"StrongEncryptionDataSpace"!==s[0].name||"EncryptedPackage"!==s[0].comps[0].v)throw new Error("ECMA-376 Encrypted file bad "+r);if(!(i=Ee.find(n,r="/!DataSpaces/DataSpaceInfo/StrongEncryptionDataSpace"))||!i.content)throw new Error("ECMA-376 Encrypted file missing "+r);var o=function fF(n){var a=[];n.l+=4;for(var t=n.read_shift(4);t-- >0;)a.push(n.read_shift(0,"lpp4"));return a}(i.content);if(1!=o.length||"StrongEncryptionTransform"!=o[0])throw new Error("ECMA-376 Encrypted file bad "+r);if(!(i=Ee.find(n,r="/!DataSpaces/TransformInfo/StrongEncryptionTransform/!Primary"))||!i.content)throw new Error("ECMA-376 Encrypted file missing "+r);!function hF(n){var a=function mF(n){var a={};return n.read_shift(4),n.l+=4,a.id=n.read_shift(0,"lpp4"),a.name=n.read_shift(0,"lpp4"),a.R=Pr(n,4),a.U=Pr(n,4),a.W=Pr(n,4),a}(n);if(a.ename=n.read_shift(0,"8lpp4"),a.blksz=n.read_shift(4),a.cmode=n.read_shift(4),4!=n.read_shift(4))throw new Error("Bad !Primary record");return a}(i.content)}catch{}if(!(i=Ee.find(n,r="/EncryptionInfo"))||!i.content)throw new Error("ECMA-376 Encrypted file missing "+r);var l=function gF(n){var a=Pr(n);switch(a.Minor){case 2:return[a.Minor,_F(n)];case 3:return[a.Minor,xF()];case 4:return[a.Minor,vF(n)]}throw new Error("ECMA-376 Encrypted file unrecognized Version: "+a.Minor)}(i.content);if(!(i=Ee.find(n,r="/EncryptedPackage"))||!i.content)throw new Error("ECMA-376 Encrypted file missing "+r);if(4==l[0]&&typeof decrypt_agile<"u")return decrypt_agile(l[1],i.content,t.password||"",t);if(2==l[0]&&typeof decrypt_std76<"u")return decrypt_std76(l[1],i.content,t.password||"",t);throw new Error("File is password-protected")}function kl(n,a){var t="";switch((a||{}).type||"base64"){case"buffer":case"array":return[n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]];case"base64":t=Gn(n.slice(0,12));break;case"binary":t=n;break;default:throw new Error("Unrecognized type "+(a&&a.type||"undefined"))}return[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3),t.charCodeAt(4),t.charCodeAt(5),t.charCodeAt(6),t.charCodeAt(7)]}function P0(n,a){var t=0;e:for(;t<n.length;)switch(n.charCodeAt(t)){case 10:case 13:case 32:++t;break;case 60:return fl(n.slice(t),a);default:break e}return Ui.to_workbook(n,a)}function Tl(n,a,t,r){return r?(t.type="string",Ui.to_workbook(n,t)):Ui.to_workbook(a,t)}function Vs(n,a){us();var t=a||{};if(typeof ArrayBuffer<"u"&&n instanceof ArrayBuffer)return Vs(new Uint8Array(n),((t=xt(t)).type="array",t));typeof Uint8Array<"u"&&n instanceof Uint8Array&&!t.type&&(t.type=typeof Deno<"u"?"buffer":"array");var i,r=n,s=!1;if(t.cellStyles&&(t.cellNF=!0,t.sheetStubs=!0),Hi={},t.dateNF&&(Hi.dateNF=t.dateNF),t.type||(t.type=We&&Buffer.isBuffer(n)?"buffer":"base64"),"file"==t.type&&(t.type=We?"buffer":"binary",r=function G3(n){if(typeof Deno<"u")return Deno.readFileSync(n);if(typeof $<"u"&&typeof File<"u"&&typeof Folder<"u")try{var a=File(n);a.open("r"),a.encoding="binary";var t=a.read();return a.close(),t}catch(r){if(!r.message||!r.message.match(/onstruct/))throw r}throw new Error("Cannot access file "+n)}(n),typeof Uint8Array<"u"&&!We&&(t.type="array")),"string"==t.type&&(s=!0,t.type="binary",t.codepage=65001,r=function OD(n){return n.match(/[^\x00-\x7F]/)?br(n):n}(n)),"array"==t.type&&typeof Uint8Array<"u"&&n instanceof Uint8Array&&typeof ArrayBuffer<"u"){var o=new ArrayBuffer(3),l=new Uint8Array(o);if(l.foo="bar",!l.foo)return(t=xt(t)).type="array",Vs(fo(r),t)}switch((i=kl(r,t))[0]){case 208:if(207===i[1]&&17===i[2]&&224===i[3]&&161===i[4]&&
1177===i[5]&&26===i[6]&&225===i[7])return function jD(n,a){return Ee.find(n,"EncryptedPackage")?ID(n,a):m0(n,a)}(Ee.read(r,t),t);break;case 9:if(i[1]<=8)return m0(r,t);break;case 60:return fl(r,t);case 73:if(73===i[1]&&42===i[2]&&0===i[3])throw new Error("TIFF Image File is not a spreadsheet");if(68===i[1])return function Hy(n,a){var t=a||{},r=!!t.WTF;t.WTF=!0;try{var i=Cp.to_workbook(n,t);return t.WTF=r,i}catch(s){if(t.WTF=r,!s.message.match(/SYLK bad record ID/)&&r)throw s;return Ui.to_workbook(n,a)}}(r,t);break;case 84:if(65===i[1]&&66===i[2]&&76===i[3])return kp.to_workbook(r,t);break;case 80:return 75===i[1]&&i[2]<9&&i[3]<9?function AD(n,a){var r=n,i=a||{};return i.type||(i.type=We&&Buffer.isBuffer(n)?"buffer":"base64"),ED(Zc(r,i),i)}(r,t):Tl(n,r,t,s);case 239:return 60===i[3]?fl(r,t):Tl(n,r,t,s);case 255:if(254===i[1])return function PD(n,a){var t=n;return"base64"==a.type&&(t=Gn(t)),t=Ze.utils.decode(1200,t.slice(2),"str"),a.type="binary",P0(t,a)}(r,t);if(0===i[1]&&2===i[2]&&0===i[3])return yi.to_workbook(r,t);break;case 0:if(0===i[1]&&(i[2]>=2&&0===i[3]||0===i[2]&&(8===i[3]||9===i[3])))return yi.to_workbook(r,t);break;case 3:case 131:case 139:case 140:return Ko.to_workbook(r,t);case 123:if(92===i[1]&&114===i[2]&&116===i[3])return Ip.to_workbook(r,t);break;case 10:case 13:case 32:return function MD(n,a){var t="",r=kl(n,a);switch(a.type){case"base64":t=Gn(n);break;case"binary":t=n;break;case"buffer":t=n.toString("binary");break;case"array":t=fi(n);break;default:throw new Error("Unrecognized type "+a.type)}return 239==r[0]&&187==r[1]&&191==r[2]&&(t=gt(t)),a.type="binary",P0(t,a)}(r,t);case 137:if(80===i[1]&&78===i[2]&&71===i[3])throw new Error("PNG Image File is not a spreadsheet")}return Wy.indexOf(i[0])>-1&&i[2]<=12&&i[3]<=31?Ko.to_workbook(r,t):Tl(n,r,t,s)}function B0(n,a,t,r,i,s,o,l){var c=Nt(t),d=l.defval,p=l.raw||!Object.prototype.hasOwnProperty.call(l,"raw"),u=!0,f=1===i?[]:{};if(1!==i)if(Object.defineProperty)try{Object.defineProperty(f,"__rowNum__",{value:t,enumerable:!1})}catch{f.__rowNum__=t}else f.__rowNum__=t;if(!o||n[t])for(var h=a.s.c;h<=a.e.c;++h){var g=o?n[t][h]:n[r[h]+c];if(void 0!==g&&void 0!==g.t){var m=g.v;switch(g.t){case"z":if(null==m)break;continue;case"e":m=0==m?null:void 0;break;case"s":case"d":case"b":case"n":break;default:throw new Error("unrecognized type "+g.t)}if(null!=s[h]){if(null==m)if("e"==g.t&&null===m)f[s[h]]=null;else if(void 0!==d)f[s[h]]=d;else{if(!p||null!==m)continue;f[s[h]]=null}else f[s[h]]=p&&("n"!==g.t||"n"===g.t&&!1!==l.rawNumbers)?m:Cr(g,m,l);null!=m&&(u=!1)}}else{if(void 0===d)continue;null!=s[h]&&(f[s[h]]=d)}}return{row:f,isempty:u}}function Xs(n,a){if(null==n||null==n["!ref"])return[];var t={t:"n",v:0},r=0,i=1,s=[],o=0,l="",c={s:{r:0,c:0},e:{r:0,c:0}},d=a||{},p=null!=d.range?d.range:n["!ref"];switch(1===d.header?r=1:"A"===d.header?r=2:Array.isArray(d.header)?r=3:null==d.header&&(r=0),typeof p){case"string":c=Ke(p);break;case"number":(c=Ke(n["!ref"])).s.r=p;break;default:c=p}r>0&&(i=0);var u=Nt(c.s.r),f=[],h=[],g=0,m=0,_=Array.isArray(n),v=c.s.r,k=0,b={};_&&!n[v]&&(n[v]=[]);var A=d.skipHidden&&n["!cols"]||[],G=d.skipHidden&&n["!rows"]||[];for(k=c.s.c;k<=c.e.c;++k)if(!(A[k]||{}).hidden)switch(f[k]=Ft(k),t=_?n[v][k]:n[f[k]+u],r){case 1:s[k]=k-c.s.c;break;case 2:s[k]=f[k];break;case 3:s[k]=d.header[k-c.s.c];break;default:if(null==t&&(t={w:"__EMPTY",t:"s"}),l=o=Cr(t,null,d),m=b[o]||0){do{l=o+"_"+m++}while(b[l]);b[o]=m,b[l]=1}else b[o]=1;s[k]=l}for(v=c.s.r+i;v<=c.e.r;++v)if(!(G[v]||{}).hidden){var j=B0(n,c,v,f,r,s,_,d);(!1===j.isempty||(1===r?!1!==d.blankrows:d.blankrows))&&(h[g++]=j.row)}return h.length=g,h}var L0=/"/g;function $0(n,a,t,r,i,s,o,l){for(var c=!0,d=[],p="",u=Nt(t),f=a.s.c;f<=a.e.c;++f)if(r[f]){var h=l.dense?(n[t]||[])[f]:n[r[f]+u];if(null==h)p="";else if(null!=h.v){c=!1,p=""+(l.rawNumbers&&"n"==h.t?h.v:Cr(h,null,l));for(var g=0,m=0;g!==p.length;++g)if((m=p.charCodeAt(g))===i||m===s||34===m||l.forceQuotes){p='"'+p.replace(L0,'""')+'"';break}"ID"==p&&(p='"ID"')}else null==h.f||h.F?p="":(c=!1,(p="="+h.f).indexOf(",")>=0&&(p='"'+p.replace(L0,'""')+'"'));d.push(p)}return!1===l.blankrows&&c?null:d.join(o)}function Fl(n,a){var t=[],r=a??{};if(null==n||null==n["!ref"])return"";var i=Ke(n["!ref"]),s=void 0!==r.FS?r.FS:",",o=s.charCodeAt(0),l=void 0!==r.RS?r.RS:"\n",c=l.charCodeAt(0),d=new RegExp(("|"==s?"\\|":s)+"
1+$"),p="",u=[];r.dense=Array.isArray(n);for(var f=r.skipHidden&&n["!cols"]||[],h=r.skipHidden&&n["!rows"]||[],g=i.s.c;g<=i.e.c;++g)(f[g]||{}).hidden||(u[g]=Ft(g));for(var m=0,_=i.s.r;_<=i.e.r;++_)(h[_]||{}).hidden||null!=(p=$0(n,i,_,u,o,c,s,r))&&(r.strip&&(p=p.replace(d,"")),(p||!1!==r.blankrows)&&t.push((m++?l:"")+p));return delete r.dense,t.join("")}function U0(n,a,t){var r=t||{},i=+!r.skipHeader,s=n||{},o=0,l=0;if(s&&null!=r.origin)if("number"==typeof r.origin)o=r.origin;else{var c="string"==typeof r.origin?Rt(r.origin):r.origin;o=c.r,l=c.c}var d,p={s:{c:0,r:0},e:{c:l,r:o+a.length-1+i}};if(s["!ref"]){var u=Ke(s["!ref"]);p.e.c=Math.max(p.e.c,u.e.c),p.e.r=Math.max(p.e.r,u.e.r),-1==o&&(p.e.r=(o=u.e.r+1)+a.length-1+i)}else-1==o&&(o=0,p.e.r=a.length-1+i);var f=r.header||[],h=0;a.forEach(function(m,_){Pt(m).forEach(function(v){-1==(h=f.indexOf(v))&&(f[h=f.length]=v);var k=m[v],b="z",A="",G=Pe({c:l+h,r:o+_+i});d=$a(s,G),!k||"object"!=typeof k||k instanceof Date?("number"==typeof k?b="n":"boolean"==typeof k?b="b":"string"==typeof k?b="s":k instanceof Date?(b="d",r.cellDates||(b="n",k=en(k)),A=r.dateNF||Re[14]):null===k&&r.nullError&&(b="e",k=0),d?(d.t=b,d.v=k,delete d.w,delete d.R,A&&(d.z=A)):s[G]=d={t:b,v:k},A&&(d.z=A)):s[G]=k})}),p.e.c=Math.max(p.e.c,l+f.length-1);var g=Nt(o);if(i)for(h=0;h<f.length;++h)s[Ft(h+l)+g]={t:"s",v:f[h]};return s["!ref"]=Ge(p),s}function $a(n,a,t){if("string"==typeof a){if(Array.isArray(n)){var r=Rt(a);return n[r.r]||(n[r.r]=[]),n[r.r][r.c]||(n[r.r][r.c]={t:"z"})}return n[a]||(n[a]={t:"z"})}return $a(n,Pe("number"!=typeof a?a:{r:a,c:t||0}))}function El(n,a,t,r){var i=1;if(!t)for(;i<=65535&&-1!=n.SheetNames.indexOf(t="Sheet"+i);++i,t=void 0);if(!t||n.SheetNames.length>=65535)throw new Error("Too many worksheets");if(r&&n.SheetNames.indexOf(t)>=0){var s=t.match(/(^.*?)(\d+)$/);i=s&&+s[2]||0;var o=s&&s[1]||t;for(++i;i<=65535&&-1!=n.SheetNames.indexOf(t=o+i);++i);}if(function l0(n,a){if(n.length>31){if(a)return!1;throw new Error("Sheet names cannot exceed 31 chars")}var t=!0;return O8.forEach(function(r){if(-1!=n.indexOf(r)){if(!a)throw new Error("Sheet name cannot contain : \\ / ? * [ ]");t=!1}}),t}(t),n.SheetNames.indexOf(t)>=0)throw new Error("Worksheet with name |"+t+"| already exists!");return n.SheetNames.push(t),n.Sheets[t]=a,t}function X0(n,a,t){return a?(n.l={Target:a},t&&(n.l.Tooltip=t)):delete n.l,n}var qD={encode_col:Ft,encode_row:Nt,encode_cell:Pe,encode_range:Ge,decode_col:Ao,decode_row:jo,split_cell:function hT(n){return n.replace(/(\$?[A-Z]*)(\$?\d*)/,"$1,$2").split(",")},decode_cell:Rt,decode_range:Un,format_cell:Cr,sheet_add_aoa:Sd,sheet_add_json:U0,sheet_add_dom:k0,aoa_to_sheet:$i,json_to_sheet:function VD(n,a){return U0(null,n,a)},table_to_sheet:T0,table_to_book:function aD(n,a){return Qr(T0(n,a),a)},sheet_to_csv:Fl,sheet_to_txt:function V0(n,a){a||(a={}),a.FS="\t",a.RS="\n";var t=Fl(n,a);return t},sheet_to_json:Xs,sheet_to_html:function C0(n,a){var t=a||{},i=null!=t.footer?t.footer:"</body></html>",s=[null!=t.header?t.header:'<html><head><meta charset="utf-8"/><title>SheetJS Table Export</title></head><body>'],o=Un(n["!ref"]);t.dense=Array.isArray(n),s.push(function b0(n,a,t){return[].join("")+"<table"+(t&&t.id?' id="'+t.id+'"':"")+">"}(0,0,t));for(var l=o.s.r;l<=o.e.r;++l)s.push(_0(n,o,l,t));return s.push("</table>"+i),s.join("")},sheet_to_formulae:function $D(n){var t,a="",r="";if(null==n||null==n["!ref"])return[];var l,i=Ke(n["!ref"]),s="",o=[],c=[],d=Array.isArray(n);for(l=i.s.c;l<=i.e.c;++l)o[l]=Ft(l);for(var p=i.s.r;p<=i.e.r;++p)for(s=Nt(p),l=i.s.c;l<=i.e.c;++l)if(a=o[l]+s,r="",void 0!==(t=d?(n[p]||[])[l]:n[a])){if(null!=t.F){if(a=t.F,!t.f)continue;r=t.f,-1==a.indexOf(":")&&(a=a+":"+a)}if(null!=t.f)r=t.f;else{if("z"==t.t)continue;if("n"==t.t&&null!=t.v)r=""+t.v;else if("b"==t.t)r=t.v?"TRUE":"FALSE";else if(void 0!==t.w)r="'"+t.w;else{if(void 0===t.v)continue;r="s"==t.t?"'"+t.v:""+t.v}}c[c.length]=a+"="+r}return c},sheet_to_row_object_array:Xs,sheet_get_cell:$a,book_new:function Sl(){return{SheetNames:[],Sheets:{}}},book_append_sheet:El,book_set_sheet_visibility:function XD(n,a,t){n.Workbook||(n.Workbook={}),n.Workbook.Sheets||(n.Workbook.Sheets=[]);var r=function UD(n,a){if("number"==typeof a){if(a>=0&&n.SheetNames.length>a)return a;throw new Error("Cannot find sheet # "+a)}if("string"==typeof a){var t=n.SheetNames.indexOf(a);if(t>-1)return t;throw new Error("Cannot find sheet name |"+a+"|")}throw new Error("Cannot find sheet |"+a+"|")}(n,a);switch(n.Workbook.Sheets[r]||(n.Workbook.Sheets[r]={}),t){case 0:case 1:case 2:break;default:throw new Error("Bad sheet visibility setting "+t)}n.Workbook.Sheets[r].Hidden=t},cell_set_number_format:function YD(n,a){return n.z=a,n},cell_set_hyperlink:X0,cell_set_internal_link:function WD(n,a,t){return X0(n,"#"+a,t)},cell_add_comment:function HD(n,a,t){n.c||(n.c=[]),n.c.push({t:a,a:t||"SheetJS"})},sheet_set_array_formula:function zD(n,a,t,r){for(var i="string"!=typeof a?a:Ke(a),s="string"==typeof a?a:Ge(a),o=i.s.r;o<=i.e.r;++o)for(var l=i.s.c;l<=i.e.c;++l){var c=$a(n,o,l);c.t="n",c.F=s,delete c.v,o==i.s.r&&l==i.s.c&&(c.f=t,r&&(c.D=!0))}return n},consts:{SHEET_VISIBLE:0,SHEET_HIDDEN:1,SHEET_VERY_HIDDEN:2}},Or=ee(60969),e6=ee(59361),fr=ee(69744),Il=ee(13491),t6=ee(81455),Y0=ee(54420),Dl=ee(56263);const n6=["content"],r6=["accepticon"],i6=["rejecticon"],a6=["headless"],s6=(n,a)=>({showTransitionParams:n,hideTransitionParams:a}),o6=n=>
1({value:"open",params:n}),W0=n=>({$implicit:n});function l6(n,a){1&n&&e.eu8(0)}function c6(n,a){if(1&n&&(e.qex(0),e.DNE(1,l6,1,0,"ng-container",8),e.bVm()),2&n){const t=e.XpG(2);e.R7$(),e.Y8G("ngTemplateOutlet",t.headlessTemplate||t._headlessTemplate)("ngTemplateOutletContext",e.eq3(2,W0,t.confirmation))}}function d6(n,a){1&n&&e.eu8(0)}function p6(n,a){if(1&n&&(e.qex(0),e.DNE(1,d6,1,0,"ng-container",8),e.bVm()),2&n){const t=e.XpG(3);e.R7$(),e.Y8G("ngTemplateOutlet",t.contentTemplate||t._contentTemplate)("ngTemplateOutletContext",e.eq3(2,W0,t.confirmation))}}function u6(n,a){if(1&n&&e.nrm(0,"i",15),2&n){const t=e.XpG(4);e.HbH(null==t.confirmation?null:t.confirmation.icon),e.Y8G("ngClass","p-confirmpopup-icon")}}function f6(n,a){if(1&n&&(e.DNE(0,u6,1,3,"i",13),e.j41(1,"span",14),e.EFF(2),e.k0s()),2&n){const t=e.XpG(3);e.Y8G("ngIf",null==t.confirmation?null:t.confirmation.icon),e.R7$(2),e.JRh(null==t.confirmation?null:t.confirmation.message)}}function m6(n,a){if(1&n&&e.nrm(0,"i"),2&n){const t=e.XpG(4);e.HbH(null==t.confirmation?null:t.confirmation.rejectIcon)}}function h6(n,a){}function g6(n,a){1&n&&e.DNE(0,h6,0,0,"ng-template",null,3,e.C5r)}function _6(n,a){if(1&n){const t=e.RV6();e.j41(0,"p-button",16),e.bIt("onClick",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.onReject())}),e.DNE(1,m6,1,2,"i",17)(2,g6,2,0,null,18),e.k0s()}if(2&n){const t=e.XpG(3);e.Y8G("label",t.rejectButtonLabel)("ngClass","p-confirmpopup-reject-button")("styleClass",null==t.confirmation?null:t.confirmation.rejectButtonStyleClass)("size",(null==t.confirmation.rejectButtonProps?null:t.confirmation.rejectButtonProps.size)||"small")("text",(null==t.confirmation.rejectButtonProps?null:t.confirmation.rejectButtonProps.text)||!1)("buttonProps",t.getRejectButtonProps()),e.BMQ("aria-label",t.rejectButtonLabel),e.R7$(),e.Y8G("ngIf",null==t.confirmation?null:t.confirmation.rejectIcon)("ngIfElse",t.rejecticon),e.R7$(),e.Y8G("ngTemplateOutlet",t.rejectIconTemplate||t._rejectIconTemplate)}}function x6(n,a){if(1&n&&e.nrm(0,"i"),2&n){const t=e.XpG(4);e.HbH(null==t.confirmation?null:t.confirmation.acceptIcon)}}function v6(n,a){}function b6(n,a){1&n&&e.DNE(0,v6,0,0,"ng-template",null,4,e.C5r)}function C6(n,a){if(1&n){const t=e.RV6();e.j41(0,"p-button",19),e.bIt("onClick",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.onAccept())}),e.DNE(1,x6,1,2,"i",17)(2,b6,2,0,null,18),e.k0s()}if(2&n){const t=e.XpG(3);e.Y8G("label",t.acceptButtonLabel)("ngClass","p-confirmpopup-accept-button")("styleClass",null==t.confirmation?null:t.confirmation.acceptButtonStyleClass)("size",(null==t.confirmation.acceptButtonProps?null:t.confirmation.acceptButtonProps.size)||"small")("buttonProps",t.getAcceptButtonProps()),e.BMQ("aria-label",t.acceptButtonLabel),e.R7$(),e.Y8G("ngIf",null==t.confirmation?null:t.confirmation.acceptIcon)("ngIfElse",t.accepticontemplate),e.R7$(),e.Y8G("ngTemplateOutlet",t.acceptIconTemplate||t._acceptIconTemplate)}}function k6(n,a){if(1&n&&(e.j41(0,"div",9,1),e.DNE(2,p6,2,4,"ng-container",7)(3,f6,3,2,"ng-template",null,2,e.C5r),e.k0s(),e.j41(5,"div",10),e.DNE(6,_6,3,10,"p-button",11)(7,C6,3,9,"p-button",12),e.k0s()),2&n){const t=e.sdS(4),r=e.XpG(2);e.R7$(2),e.Y8G("ngIf",r.contentTemplate||r._contentTemplate)("ngIfElse",t),e.R7$(4),e.Y8G("ngIf",!1!==(null==r.confirmation?null:r.confirmation.rejectVisible)),e.R7$(),e.Y8G("ngIf",!1!==(null==r.confirmation?null:r.confirmation.acceptVisible))}}function T6(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",6),e.bIt("click",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.onOverlayClick(i))})("@animation.start",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.onAnimationStart(i))})("@animation.done",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.onAnimationEnd(i))}),e.DNE(1,c6,2,4,"ng-container",7)(2,k6,8,4,"ng-template",null,0,e.C5r),e.k0s()}if(2&n){const t=e.sdS(3),r=e.XpG();e.HbH(r.styleClass),e.Y8G("ngClass","p-confirmpopup p-component")("ngStyle",r.style)("@animation",e.eq3(10,o6,e.l_i(7,s6,r.showTransitionOptions,r.hideTransitionOptions))),e.R7$(),e.Y8G("ngIf",r.headlessTemplate||r._headlessTemplate)("ngIfElse",t)}}const w6=({dt:n})=>`\n.p-confirmpopup {\n position: absolute;\n margin-top: ${n("confirmpopup.gutter")};\n top: 0;\n left: 0;\n background: ${n("confirmpopup.background")};\n color: ${n("confirmpopup.color")};\n border: 1px solid ${n("confirmpopup.border.color")};
1\n border-radius: ${n("confirmpopup.border.radius")};\n box-shadow: ${n("confirmpopup.shadow")};\n}\n\n.p-confirmpopup-content {\n display: flex;\n align-items: center;\n padding: ${n("confirmpopup.content.padding")};\n gap: ${n("confirmpopup.content.gap")};\n}\n\n.p-confirmpopup-icon {\n font-size: ${n("confirmpopup.icon.size")};\n width: ${n("confirmpopup.icon.size")};\n height: ${n("confirmpopup.icon.size")};\n color: ${n("confirmpopup.icon.color")};\n}\n\n.p-confirmpopup-footer {\n display: flex;\n justify-content: flex-end;\n gap: ${n("confirmpopup.footer.gap")};\n padding: ${n("confirmpopup.footer.padding")};\n}\n\n.p-confirmpopup-footer button {\n width: auto;\n}\n\n.p-confirmpopup-footer button:last-child {\n margin: 0;\n}\n\n.p-confirmpopup-flipped {\n margin-top: calc(${n("confirmpopup.gutter")} * -1);\n margin-bottom: ${n("confirmpopup.gutter")};\n}\n\n.p-confirmpopup-enter-from {\n opacity: 0;\n transform: scaleY(0.8);\n}\n\n.p-confirmpopup-leave-to {\n opacity: 0;\n}
1\n\n.p-confirmpopup-enter-active {\n transition: transform 0.12s cubic-bezier(0, 0, 0.2, 1), opacity 0.12s cubic-bezier(0, 0, 0.2, 1);\n}\n\n.p-confirmpopup-leave-active {\n transition: opacity 0.1s linear;\n}\n\n.p-confirmpopup:after,\n.p-confirmpopup:before {\n bottom: 100%;\n left: ${n("confirmpopup.arrow.offset")};\n content: " ";\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n}\n\n.p-confirmpopup:after {\n border-width: calc(${n("confirmpopup.gutter")} - 2px);\n margin-left: calc(-1 * (${n("confirmpopup.gutter")} - 2px));\n border-style: solid;\n border-color: transparent;\n border-bottom-color: ${n("confirmpopup.background")};\n}\n\n.p-confirmpopup:before {\n border-width: ${n("confirmpopup.gutter")};\n margin-left: calc(-1 * ${n("confirmpopup.gutter")});\n border-style: solid;\n border-color: transparent;\n border-bottom-color: ${n("confirmpopup.border.color")};\n}\n\n.p-confirmpopup-flipped:after,\n.p-confirmpopup-flipped:before {\n bottom: auto;\n top: 100%;\n}\n\n.p-confirmpopup-flipped:after {\n border-bottom-color: transparent;\n border-top-color: ${n("confirmpopup.background")};\n}\n\n.p-confirmpopup-flipped:before {\n border-bottom-color: transparent;\n border-top-color: ${n("confirmpopup.border.color")};\n}\n`,y6={root:"p-confirmpopup p-component",content:"p-confirmpopup-content",icon:"p-confirmpopup-icon",message:"p-confirmpopup-message",footer:"p-confirmpopup-footer",pcRejectButton:"p-confirmpopup-reject-button",pcAcceptButton:"p-confirmpopup-accept-button"};let H0=(()=>{class n extends Dl.j{name="confirmpopup";theme=w6;classes=y6;static \u0275fac=(()=>{let t;return function(i){return(t||(t=e.xGo(n)))(i||n)}})();static \u0275prov=e.jDH({token:n,factory:n.\u0275fac})}return n})(),z0=(()=>{class n extends Il.${el;confirmationService;renderer;cd;overlayService;document;key;defaultFocus="accept";showTransitionOptions=".12s cubic-bezier(0, 0, 0.2, 1)";hideTransitionOptions=".1s linear";autoZIndex=!0;baseZIndex=0;style;styleClass;get visible(){return this._visible}set visible(t){this._visible=t,this.cd.markForCheck()}container;subscription;confirmation;contentTemplate;acceptIconTemplate;rejectIconTemplate;headlessTemplate;_contentTemplate;_acceptIconTemplate;_rejectIconTemplate;_headlessTemplate;_visible;documentClickListener;documentResizeListener;scrollHandler;window;_componentStyle=(0,e.WQX)(H0);constructor(t,r,i,s,o,l){super(),this.el=t,this.confirmationService=r,this.renderer=i,this.cd=s,this.overlayService=o,this.document=l,this.window=this.document.defaultView,this.subscription=this.confirmationService.requireConfirmation$.subscribe(c=>{c?c.key===this.key&&(this.confirmation=c,Object.keys(c).forEach(p=>{this[p]=c[p]}
1),this.confirmation.accept&&(this.confirmation.acceptEvent=new e.bkB,this.confirmation.acceptEvent.subscribe(this.confirmation.accept)),this.confirmation.reject&&(this.confirmation.rejectEvent=new e.bkB,this.confirmation.rejectEvent.subscribe(this.confirmation.reject)),this.visible=!0):this.hide()})}templates;ngAfterContentInit(){this.templates?.forEach(t=>{switch(t.getType()){case"content":this._contentTemplate=t.template;break;case"rejecticon":this._rejectIconTemplate=t.template;break;case"accepticon":this._acceptIconTemplate=t.template;break;case"headless":this._headlessTemplate=t.template}})}option(t,r){const i=this;if(i.hasOwnProperty(t))return r?i[r]:i[t]}onEscapeKeydown(t){this.confirmation&&this.confirmation.closeOnEscape&&this.onReject()}onAnimationStart(t){if("open"===t.toState){this.container=t.element,this.renderer.appendChild(this.document.body,this.container),this.align(),this.bindListeners();const r=this.getElementToFocus();r&&r.focus()}}onAnimationEnd(t){"void"===t.toState&&this.onContainerDestroy()}getAcceptButtonProps(){return this.option("acceptButtonProps")}getRejectButtonProps(){return this.option("rejectButtonProps")}getElementToFocus(){switch(this.defaultFocus){case"accept":return(0,fr.kc)(this.container,".p-confirm-popup-accept");case"reject":return(0,fr.kc)(this.container,".p-confirm-popup-reject");case"none":return null}}align(){if(this.autoZIndex&&Y0.Q$.set("overlay",this.container,this.config.zIndex.overlay),!this.confirmation)return;(0,fr.Nb)(this.container,this.confirmation?.target,!1);const t=(0,fr.A3)(this.container),r=(0,fr.A3)(this.confirmation?.target);let i=0;t.left<r.left&&(i=r.left-t.left),this.container.style.setProperty("--overlayArrowLeft",`${i}px`),t.top<r.top&&(0,fr.iQ)(this.container,"p-confirm-popup-flipped")}hide(){this.visible=!1}onAccept(){this.confirmation?.acceptEvent&&this.confirmation.acceptEvent.emit(),this.hide()}onReject(){this.confirmation?.rejectEvent&&this.confirmation.rejectEvent.emit(),this.hide()}onOverlayClick(t){this.overlayService.add({originalEvent:t,target:this.el.nativeElement})}bindListeners(){setTimeout(()=>{this.bindDocumentClickListener(),this.bindDocumentResizeListener(),this.bindScrollListener()})}unbindListeners(){this.unbindDocumentClickListener(),this.unbindDocumentResizeListener(),this.unbindScrollListener()}bindDocumentClickListener(){if(!this.documentClickListener){let t=(0,fr.un)()?"touchstart":"click";this.documentClickListener=this.renderer.listen(this.el?this.el.nativeElement.ownerDocument:this.document,t,i=>{if(this.confirmation&&!1!==this.confirmation.dismissableMask){let s=this.confirmation.target;this.container!==i.target&&!this.container?.contains(i.target)&&s!==i.target&&!s.contains(i.target)&&this.hide()}})}}unbindDocumentClickListener(){this.documentClickListener&&(this.documentClickListener(),this.documentClickListener=null)}onWindowResize(){this.visible&&!(0,fr.CN)()&&this.hide()}bindDocumentResizeListener(){this.documentResizeListener||(this.documentResizeListener=this.renderer.listen(this.window,"resize",this.onWindowResize.bind(this)))}unbindDocumentResizeListener(){this.documentResizeListener&&(this.documentResizeListener(),this.documentResizeListener=null)}bindScrollListener(){this.scrollHandler||(this.scrollHandler=new t6.b(this.confirmation?.target,()=>{this.visible&&this.hide()})),this.scrollHandler.bindScrollListener()}unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}unsubscribeConfirmationSubscriptions(){this.confirmation&&(this.confirmation.acceptEvent&&this.confirmation.acceptEvent.unsubscribe(),this.confirmation.rejectEvent&&this.confirmation.rejectEvent.unsubscribe())}onContainerDestroy(){this.unbindListeners(),this.unsubscribeConfirmationSubscriptions(),this.autoZIndex&&Y0.Q$.clear(this.container),this.confirmation=null,this.container=null}restoreAppend(){this.container&&this.renderer.removeChild(this.document.body,this.container),this.onContainerDestroy()}get acceptButtonLabel(){return this.confirmation?.acceptLabel||this.config.getTranslation(be.Yj.ACCEPT)}get rejectButtonLabel(){return this.confirmation?.rejectLabel||this.config.getTranslation(be.Yj.REJECT)}ngOnDestroy(){this.restoreAppend(),this.subscription&&this.subscription.unsubscribe()}static \u0275fac=function(r){return new(r||n)(e.rXU(e.aKT),e.rXU(be.td),e.rXU(e.sFG),e.rXU(e.gRc),e.rXU(be.si),e.rXU(e6.q))};static \u0275cmp=e.VBU({type:n,selectors:[["p-confirmPopup"],["p-confirmpopup"],["p-confirm-popup"]],contentQueries:function(r,i,s){if(1&r&&(e.wni(s,n6,4),e.wni(s,r6,4),e.wni(s,i6,4),e.wni(s,a6,4),e.wni(s,be.Ei,4)),2&r){let o;e.mGM(o=e.lsd())&&(i.contentTemplate=o.first),e.mGM(o=e.lsd())&&(i.acceptIconTemplate=o.first),e.mGM(o=e.lsd())&&(i.rejectIconTemplate=o.first),e.mGM(o=e.lsd())&&(i.headlessTemplate=o.first),e.mGM(o=e.lsd())&&(i.templates=o)}},hostBindings:function(r,i){1&r&&e.bIt("keydown.escape",function(o){return i.onEscapeKey
1down(o)},!1,e.EBC)},inputs:{key:"key",defaultFocus:"defaultFocus",showTransitionOptions:"showTransitionOptions",hideTransitionOptions:"hideTransitionOptions",autoZIndex:[2,"autoZIndex","autoZIndex",e.L39],baseZIndex:[2,"baseZIndex","baseZIndex",e.Udg],style:"style",styleClass:"styleClass",visible:"visible"},features:[e.Jv_([H0]),e.Vt3],decls:1,vars:1,consts:[["notHeadless",""],["content",""],["withoutContentTemplate",""],["rejecticon",""],["accepticontemplate",""],["role","alertdialog",3,"ngClass","ngStyle","class","click",4,"ngIf"],["role","alertdialog",3,"click","ngClass","ngStyle"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"p-confirmpopup-content"],[1,"p-confirmpopup-footer"],["type","button",3,"label","ngClass","styleClass","size","text","buttonProps","onClick",4,"ngIf"],["type","button",3,"label","ngClass","styleClass","size","buttonProps","onClick",4,"ngIf"],[3,"ngClass","class",4,"ngIf"],[1,"p-confirmpopup-message"],[3,"ngClass"],["type","button",3,"onClick","label","ngClass","styleClass","size","text","buttonProps"],[3,"class",4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["type","button",3,"onClick","label","ngClass","styleClass","size","buttonProps"]],template:function(r,i){1&r&&e.DNE(0,T6,4,12,"div",5),2&r&&e.Y8G("ngIf",i.visible)},dependencies:[q.MD,q.YU,q.bT,q.T3,q.B3,be.Gg,xe.tm,xe.$n],encapsulation:2,data:{animation:[(0,Or.hZ)("animation",[(0,Or.wk)("void",(0,Or.iF)({transform:"scaleY(0.8)",opacity:0}
1)),(0,Or.wk)("open",(0,Or.iF)({transform:"translateY(0)",opacity:1})),(0,Or.kY)("void => open",(0,Or.i0)("{{showTransitionParams}}")),(0,Or.kY)("open => void",(0,Or.i0)("{{hideTransitionParams}}"))])]},changeDetection:0})}return n})(),S6=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=e.$C({type:n});static \u0275inj=e.G2t({imports:[z0,be.Gg,be.Gg]})}return n})();const E6=["contactDrawer"],I6=(n,a)=>({"text-blue-600 font-medium":n,"text-500":a}),q0=()=>({width:"420px"}),J0=()=>({background:"#4285f4",border:"none"}),D6=()=>({width:"700px"}),R6=()=>({background:"#3b82f6",border:"none",height:"45px"}),j6=()=>({width:"480px"}),A6=(n,a)=>({"background-color":n,color:a}),M6=()=>[18,24,48],P6=()=>[],O6=(n,a)=>({"bg-white":n,"bg-gray-50":a});function N6(n,a){if(1&n){const t=e.RV6();e.j41(0,"p-button",135),e.bIt("onClick",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.displayIPhoneDrawer=!0)}),e.k0s()}}function G6(n,a){if(1&n){const t=e.RV6();e.j41(0,"p-button",136),e.bIt("onClick",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.displayAndroidDrawer=!0)}),e.k0s()}}function B6(n,a){if(1&n){const t=e.RV6();e.j41(0,"p-button",137),e.bIt("onClick",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.displayImportDrawer=!0)}),e.k0s()}}function L6(n,a){if(1&n){const t=e.RV6();e.j41(0,"p-button",138),e.bIt("onClick",function(){e.eBV(t),e.XpG();const i=e.sdS(45);return e.Njj(i.open())}),e.k0s()}}function $6(n,a){if(1&n&&(e.j41(0,"span",139),e.EFF(1),e.k0s()),2&n){const t=e.XpG();e.R7$(),e.SpI(" ",t.selectedCount," selected ")}}function V6(n,a){if(1&n&&(e.j41(0,"span",144),e.EFF(1),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.SpI(" ",t.getFilterCount()," ")}}function U6(n,a){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"div",140),e.bIt("click",function(i){e.eBV(t),e.XpG();const s=e.sdS(47);return e.Njj(s.toggle(i))}),e.nrm(2,"i",141),e.j41(3,"span"),e.EFF(4),e.k0s()(),e.j41(5,"div",140),e.bIt("click",function(i){e.eBV(t),e.XpG();const s=e.sdS(362);return e.Njj(s.toggle(i))}),e.nrm(6,"i",142),e.j41(7,"span"),e.EFF(8,"Filters"),e.k0s(),e.DNE(9,V6,2,1,"span",143),e.k0s(),e.bVm()}if(2&n){const t=e.XpG();e.R7$(),e.Y8G("ngClass","Name"!==t.currentSort?"bg-blue-50 text-blue-600":"hover:bg-blue-50 hover:text-blue-600"),e.R7$(3),e.SpI("",t.currentSort," \u2191"),e.R7$(),e.Y8G("ngClass",t.selectedLetter?"text-blue-600":"hover:bg-blue-50 hover:text-blue-600"),e.R7$(4),e.Y8G("ngIf",t.getFilterCount()>0)}}function X6(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",145),e.bIt("click",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.confirmAddAsLead(i))}),e.nrm(1,"i",146),e.j41(2,"span",147),e.EFF(3,"Add as Lead"),e.k0s()()}}function Y6(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",148),e.bIt("click",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.confirmDeleteSelected(i))}),e.nrm(1,"i",149),e.j41(2,"span",150),e.EFF(3,"Delete"),e.k0s()()}}function W6(n,a){if(1&n){const t=e.RV6();e.j41(0,"span",151),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG();return e.Njj(s.selectLetter(i))}),e.EFF(1),e.k0s()}if(2&n){const t=a.$implicit,r=e.XpG();e.Y8G("ngClass",t===r.selectedLetter?"bg-blue-500 text-white":"hover:surface-200"),e.R7$(),e.SpI(" ",t," ")}}function H6(n,a){if(1&n){const t=e.RV6();e.j41(0,"span",157),e.EFF(1," Letter: "),e.j41(2,"strong"),e.EFF(3),e.k0s(),e.j41(4,"i",158),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.clearLetter())}),e.k0s()()}if(2&n){const t=e.XpG(2);e.R7$(3),e.JRh(t.selectedLetter)}}function z6(n,a){if(1&n){const t=e.RV6();e.j41(0,"span",159),e.EFF(1," Has Email "),e.j41(2,"i",158),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.filters.hasEmail=!1)}),e.k0s()()}}function q6(n,a){if(1&n){const t=e.RV6();e.j41(0,"span",159),e.EFF(1," Missing Email "),e.j41(2,"i",158),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.filters.missingEmail=!1)}),e.k0s()()}}function J6(n,a){if(1&n){const t=e.RV6();e.j41(0,"span",159),e.EFF(1," Is Lead "),e.j41(2,"i",158),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.filters.isLead=!1)}),e.k0s()()}}function K6(n,a){if(1&n){const t=e.RV6();e.j41(0,"span",159),e.EFF(1," Not Lead "),e.j41(2,"i",158),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.filters.isNotLead=!1)}),e.k0s()()}}function Q6(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",152)(1,"span",153),e.EFF(2,"Active:"),e.k0s(),e.DNE(3,H6,5,1,"span",154)(4,z6,3,0,"span",155)(5,q6,3,0,"span",155)(6,J6,3,0,"span",155)(7,K6,3,0,"span",155),e.j41(8,"span",156),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.clearFilter())}),e.EFF(9," Clear all "),e.k0s()()}if(2&n){const t=e.XpG();e.R7$(3),e.Y8G("ngIf",t.selectedLetter&&""!==t.selectedLetter),e.R7$(),e.Y8G("ngIf",t.filters.hasEmail),e.R7$(),e.Y8G("ngIf",t.filters.missingEmail),e.R7$(),e.Y8G("ngIf",t.filters.isLead),e.R7$(),e.Y8G("ngIf",t.filters.isNotLead)}}function Z6(n,a){1&n&&e.nrm(0,"p-tag",186),2&n&&e.Y8G("rounded",!0)}function eR(n,a){if(1&n&&e.nrm(0,"p-tag",187),2&n){let t;const r=e.XpG().$implicit,i=e.XpG(2);e.Aen(e.l_i(4,A6,r.trackName?r.trackColor:"#f4f4f4",r.trackName?i.getTextColor(r.trackColor):"#666")),e.Y8G("value",null!==(t=r.trackName)&&void 0!==t?t:"No Lead")("roun
1ded",!0)}}function tR(n,a){if(1&n){const t=e.RV6();e.j41(0,"p-button",188),e.bIt("onClick",function(i){e.eBV(t);const s=e.XpG().$implicit,o=e.XpG(2);return i.stopPropagation(),e.Njj(o.toggleLead(s))}),e.k0s()}if(2&n){const t=e.XpG().$implicit;e.Y8G("label",t.isLead?"Remove Lead":"Add as Lead")("icon",t.isLead?"pi pi-times":"pi pi-chart-line")("outlined",!0)("severity",t.isLead?"danger":"secondary")("styleClass","py-1 px-2 text-xs font-medium border-300 shadow-none border-round-md "+(t.isLead?"bg-red-50 text-red-700":"bg-blue-50 text-blue-900"))}}function nR(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",162)(1,"div",163)(2,"div",164)(3,"div",165)(4,"div",166)(5,"div",167)(6,"p-checkbox",168),e.mxI("ngModelChange",function(i){const s=e.eBV(t).$implicit;return e.DH7(s.selected,i)||(s.selected=i),e.Njj(i)}),e.bIt("click",function(i){return e.eBV(t),e.Njj(i.stopPropagation())}),e.k0s(),e.j41(7,"div",169),e.nrm(8,"p-avatar",170),e.j41(9,"div",171)(10,"span",172),e.EFF(11),e.k0s(),e.j41(12,"span",173),e.EFF(13),e.k0s()()()(),e.j41(14,"div",174),e.DNE(15,Z6,1,1,"p-tag",175)(16,eR,1,7,"p-tag",176),e.k0s()(),e.j41(17,"div",177)(18,"div",102),e.nrm(19,"i",178),e.j41(20,"span"),e.EFF(21),e.k0s()(),e.j41(22,"div",102),e.nrm(23,"i",179),e.j41(24,"span"),e.EFF(25),e.k0s()(),e.j41(26,"div",102),e.nrm(27,"i",180),e.j41(28,"span"),e.EFF(29),e.k0s()()(),e.nrm(30,"div",181),e.j41(31,"div",182)(32,"span"),e.EFF(33),e.k0s(),e.j41(34,"div",102)(35,"i",183),e.bIt("click",function(){const i=e.eBV(t).$implicit,s=e.XpG(2);return e.Njj(s.editContact(i.id))}),e.k0s(),e.j41(36,"i",184),e.bIt("click",function(i){const s=e.eBV(t).$implicit,o=e.XpG(2);return e.Njj(o.confirmDelete(i,s))}),e.k0s(),e.DNE(37,tR,1,5,"p-button",185),e.k0s()()()()()()}if(2&n){const t=a.$implicit;e.R7$(6),e.R50("ngModel",t.selected),e.Y8G("binary",!0),e.R7$(2),e.Y8G("label",t.initials),e.R7$(3),e.SpI(" ",t.name," "),e.R7$(2),e.SpI(" ",t.role," "),e.R7$(2),e.Y8G("ngIf",1===t.source||2===t.source),e.R7$(),e.Y8G("ngIf",3===t.source||null==t.source),e.R7$(5),e.JRh(t.companyName),e.R7$(4),e.JRh(t.email),e.R7$(4),e.JRh(t.phoneNumber),e.R7$(4),e.SpI("Added ",t.addedDate,""),e.R7$(4),e.Y8G("ngIf",2===t.source||3===t.source)}}function rR(n,a){if(1&n&&(e.j41(0,"div",160),e.DNE(1,nR,38,12,"div",161),e.k0s()),2&n){const t=e.XpG();e.R7$(),e.Y8G("ngForOf",t.contacts)}}function iR(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",189)(1,"p-paginator",190),e.bIt("onPageChange",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.onPageChange(i))}),e.k0s(),e.j41(2,"div",191),e.EFF(3," Showing "),e.j41(4,"strong"),e.EFF(5),e.k0s(),e.EFF(6," to "),e.j41(7,"strong"),e.EFF(8),e.k0s(),e.EFF(9," of "),e.j41(10,"strong"),e.EFF(11),e.k0s(),e.EFF(12," contacts "),e.k0s()()}if(2&n){const t=e.XpG();e.R7$(),e.Y8G("first",t.currentFirst)("rows",t.pageSize)("totalRecords","Deskflo Contacts"===t.activeTab?t.deskfloContactsCount:t.myContactsCount)("rowsPerPageOptions",e.lJ4(7,M6)),e.R7$(4),e.JRh(t.currentFirst+1),e.R7$(3),e.JRh(t.getMathMin(t.currentFirst+t.pageSize,"Deskflo Contacts"===t.activeTab?t.deskfloContactsCount:t.myContactsCount)),e.R7$(3),e.JRh("Deskflo Contacts"===t.activeTab?t.deskfloContactsCount:t.myContactsCount)}}function aR(n,a){1&n&&(e.j41(0,"div",36),e.EFF(1," No contacts found.\n"),e.k0s())}function sR(n,a){if(1&n&&e.DNE(0,aR,2,0,"div",192),2&n){const t=e.XpG();e.Y8G("ngIf",!t.loading&&0===t.myContactsCount)}}function oR(n,a){1&n&&(e.j41(0,"div",36),e.EFF(1," No contacts found.\n"),e.k0s())}function lR(n,a){if(1&n&&e.DNE(0,oR,2,0,"div",192),2&n){const t=e.XpG();e.Y8G("ngIf",!t.loading&&0===t.deskfloContactsCount)}}function cR(n,a){1&n&&(e.j41(0,"div",162)(1,"div",193)(2,"div",194),e.nrm(3,"p-skeleton",195),e.j41(4,"div",196),e.nrm(5,"p-skeleton",197)(6,"p-skeleton",198),e.k0s()(),e.j41(7,"div",199),e.nrm(8,"p-skeleton",200)(9,"p-skeleton",201),e.k0s(),e.nrm(10,"div",202),e.j41(11,"div",203),e.nrm(12,"p-skeleton",204)(13,"p-skeleton",205),e.k0s()()())}function dR(n,a){1&n&&(e.j41(0,"div",160),e.DNE(1,cR,14,0,"div",161),e.k0s()),2&n&&(e.R7$(),e.Y8G("ngForOf",e.lJ4(1,P6).constructor(6)))}function pR(n,a){if(1&n&&(e.j41(0,"span",209),e.EFF(1),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.SpI(" ",1===t.sortOrder?"\u2191":"\u2193"," ")}}function uR(n,a){if(1&n&&(e.j41(0,"span",209),e.EFF(1),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.SpI(" ",1===t.sortOrder?"\u2191":"\u2193"," ")}}function fR(n,a){if(1&n&&(e.j41(0,"span",209),e.EFF(1),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.SpI(" ",1===t.sortOrder?"\u2191":"\u2193"," ")}}function mR(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",206)(1,"div",207),e.bIt("click",function(){e.eBV(t);const i=e.XpG(),s=e.sdS(47);return e.Njj(i.onSortChange("Name",s))}
1),e.j41(2,"span"),e.EFF(3,"Name"),e.k0s(),e.DNE(4,pR,2,1,"span",208),e.k0s(),e.j41(5,"div",207),e.bIt("click",function(){e.eBV(t);const i=e.XpG(),s=e.sdS(47);return e.Njj(i.onSortChange("Company",s))}),e.j41(6,"span"),e.EFF(7,"Company"),e.k0s(),e.DNE(8,uR,2,1,"span",208),e.k0s(),e.j41(9,"div",207),e.bIt("click",function(){e.eBV(t);const i=e.XpG(),s=e.sdS(47);return e.Njj(i.onSortChange("Date Added",s))}),e.j41(10,"span"),e.EFF(11,"Date Added"),e.k0s(),e.DNE(12,fR,2,1,"span",208),e.k0s()()}if(2&n){const t=e.XpG();e.R7$(),e.Y8G("ngClass","Name"===t.currentSort?"text-blue-600 bg-blue-50":"text-500 hover:bg-gray-50"),e.R7$(3),e.Y8G("ngIf","Name"===t.currentSort),e.R7$(),e.Y8G("ngClass","Company"===t.currentSort?"text-blue-600 bg-blue-50":"text-500 hover:bg-gray-50"),e.R7$(3),e.Y8G("ngIf","Company"===t.currentSort),e.R7$(),e.Y8G("ngClass","Date Added"===t.currentSort?"text-blue-600 bg-blue-50":"text-500 hover:bg-gray-50"),e.R7$(3),e.Y8G("ngIf","Date Added"===t.currentSort)}}function hR(n,a){1&n&&(e.j41(0,"div",102),e.nrm(1,"i",210),e.j41(2,"span",211),e.EFF(3,"Android \u2014 Export Contacts"),e.k0s()())}function gR(n,a){1&n&&(e.j41(0,"tr",212)(1,"th",213),e.EFF(2,"Full Name"),e.k0s(),e.j41(3,"th",213),e.EFF(4,"Email"),e.k0s(),e.j41(5,"th",213),e.EFF(6,"Phone Number"),e.k0s(),e.j41(7,"th",213),e.EFF(8,"Company (optional)"),e.k0s(),e.j41(9,"th",213),e.EFF(10,"Role (optional)"),e.k0s()())}function _R(n,a){if(1&n&&(e.j41(0,"tr",215)(1,"td",216),e.EFF(2),e.k0s(),e.j41(3,"td",217),e.EFF(4),e.k0s(),e.j41(5,"td",217),e.EFF(6),e.k0s(),e.j41(7,"td",217),e.EFF(8),e.k0s(),e.j41(9,"td",217),e.EFF(10),e.k0s()()),2&n){const t=e.XpG(),r=t.$implicit,i=t.rowIndex;e.Y8G("ngClass",e.l_i(6,O6,i%2==0,i%2!=0)),e.R7$(2),e.SpI(" ",r.Name||"-"," "),e.R7$(2),e.SpI(" ",r.Email||"-"," "),e.R7$(2),e.SpI(" ",r.PhoneNumber||"-"," "),e.R7$(2),e.SpI(" ",r.Company||"-"," "),e.R7$(2),e.SpI(" ",r.Role||"-"," ")}}function xR(n,a){if(1&n&&(e.j41(0,"tr")(1,"td",218)(2,"span",219),e.EFF(3),e.k0s()()()),2&n){const t=e.XpG().$implicit;e.R7$(3),e.SpI(" +",t.remaining," more rows not shown ")}}function vR(n,a){if(1&n&&e.DNE(0,_R,11,9,"tr",214)(1,xR,4,1,"tr",24),2&n){const t=a.$implicit;e.Y8G("ngIf",!t.isMoreRow),e.R7$(),e.Y8G("ngIf",t.isMoreRow)}}function bR(n,a){if(1&n&&(e.j41(0,"div",223),e.EFF(1),e.k0s()),2&n){const t=a.$implicit;e.R7$(),e.SpI("\u2022 ",t,"")}}function CR(n,a){if(1&n&&(e.j41(0,"div",220)(1,"div",221),e.EFF(2,"\u26a0\ufe0f File Import Notices:"),e.k0s(),e.DNE(3,bR,2,1,"div",222),e.k0s()),2&n){const t=e.XpG();e.R7$(3),e.Y8G("ngForOf",t.alertMessages)}}function kR(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",224),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.displayPreviewDialog=!1)}),e.k0s(),e.j41(1,"button",225),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.importContacts())}),e.k0s()}if(2&n){const t=e.XpG();e.R7$(),e.Y8G("label","Import "+t.contactsPreview.length+" Contacts")("loading",t.isImporting)("disabled",t.isImporting)}}function TR(n,a){1&n&&(e.j41(0,"div",102),e.nrm(1,"i",226),e.j41(2,"span",211),e.EFF(3,"iPhone (iOS) \u2014 Export Contacts"),e.k0s()())}function wR(n,a){1&n&&(e.j41(0,"div",102)(1,"div",227),e.nrm(2,"i",228),e.k0s(),e.j41(3,"div")(4,"h2",229),e.EFF(5,"Import Excel Guide"),e.k0s(),e.j41(6,"span",230),e.EFF(7," Follow these steps to sync your data effortlessly. "),e.k0s()()())}const FR=[{path:"",resolve:{activeCampaign:r3.a},component:Eb,children:[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"dashboard",component:yf},{path:"sales-tracker",component:Zv},{path:"leaderboard",component:xb},{path:"list/:view",component:Qb},{path:"tenders",component:RC},{path:"chats",component:n3},{path:"contacts",component:(()=>{class n{contactService;fb;confirmationService;messageService;teamService;displayAddDialog=!1;contactForm;contacts=[];loading=!1;titleOptions=[];isSaving=!1;selectedContactId=null;contactDrawer;displayAndroidDrawer=!1;contactsPreview=[];displayPreviewDialog=!1;fileName="";previewRows=[];totalRows=0;selectedFile;editingContact=null;isImporting=!1;totalRecords=0;filteredRecords=0;pageSize=18;currentFirst=0;displayIPhoneDrawer=!1;searchTerm="";searchTimeout;currentTeamId;letters="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");selectedLetter="";activeTab="My Contacts";currentSort="Name";selectedTypes=[];allContacts=[];filteredContacts=[];myContactsCount=0;deskfloContactsCount=0;isAddingLeads=!1;filters={hasEmail:!1,missingEmail:!1,isLead:!1,isNotLead:!1};sortOrder=1;displayImportDrawer=!1;excelData;alertMessages=[];hasWarnings=!1;constructor(t,r,i,s,o){this.contactService=t,this.fb=r,this.confirmationService=i,this.messageService=s,this.teamService=o}ngOnInit(){const t=this.teamService.getCurrentTeam;this.currentTeamId=t?.Team?.Id,this.initForm(),this.loadContacts(),this.loadDropdowns()}initForm(){this.contactForm=this.fb.group({title:[""],firstName:["",L.k0.required],lastName:["",L.k0.required],company:[""],role:[""],email:["",[L.k0.required,L.k0.email]],website:[""],phoneNumber:[""]})}loadDropdowns(){this.contactService.getTitleDropdown().subscribe({next:t=>{this.titleOptions=t},error:t=>{console.error("Error loading titles:",t)}})}get selectedCount(){return this.contacts?.filter(t=>t.selected).length||0}loadContacts(){this.loading=!0;const t=this.buildModel();this.contactService.searchContacts(t).subscribe({next:r=>{this.contacts=r.Data.map(i=>this.mapToCard(i)),this.totalRecords=r.TotalRecords,this.myContactsCount=r.Counts?.MyContacts??0,this.deskfloContactsCount=r.Counts?.Deskflo??0,this.loading=!1,window.scrollTo({top:0,behavior:"smooth"})},error:()=>{this.loading=!1}})}loadMore(){if(this.loading)return;this.loading=!0,this.currentFirst+=this.pageSize;const t=this.buildModel();this.contactService.searchContacts(t).subscribe({next:r=>{const i=r.Data.map(l=>
1this.mapToCard(l)),s=new Set(this.contacts.map(l=>l.id)),o=i.filter(l=>!s.has(l.id));this.contacts=[...this.contacts,...o],this.sortContacts(),this.totalRecords=r.TotalRecords,this.filteredRecords=r.FilteredRecords,this.loading=!1},error:()=>{this.loading=!1}})}buildModel(){return{First:this.currentFirst,Rows:this.pageSize,GlobalFilter:this.searchTerm,Filters:{FirstNameStartsWith:{Value:this.selectedLetter},HasEmail:{Value:this.filters.hasEmail},MissingEmail:{Value:this.filters.missingEmail},IsLead:{Value:this.filters.isLead},IsNotLead:{Value:this.filters.isNotLead}},SortField:"FirstName",SortOrder:1,Types:"Deskflo Contacts"===this.activeTab?[3]:[1,2],TeamId:this.currentTeamId}}mapToCard(t){return{id:t.id,name:t.fullName||`${t.firstName} ${t.lastName}`,role:t.role,phoneNumber:t.phoneNumber,email:t.email,initials:t.initials,addedDate:this.formatDate(t.dateCreatedUtc),addedDateRaw:t.dateCreatedUtc,status:"Lead",source:t.source,sourceString:t.sourceString,isLead:t.isLead,companyName:t.companyName?t.companyName:"\u2014",trackName:t.trackName,trackColor:t.trackColor,teamId:this.currentTeamId}}formatDate(t){return t?new Date(t).toISOString().split("T")[0]:""}editContact(t){this.contactForm.reset(),t&&(this.selectedContactId=t,this.loading=!0,this.contactService.get(t).subscribe({next:r=>{const i={...r,title:r.title?.toString()};this.editingContact=r,this.contactForm.patchValue(i),this.loading=!1},error:()=>this.loading=!1})),this.contactDrawer.open()}saveContact(){if(this.contactForm.invalid)return;this.isSaving=!0;const t=this.contactForm.value;if(this.selectedContactId){const r={...t,id:this.selectedContactId};this.contactService.update(r).subscribe({next:i=>{const s=this.contacts.findIndex(o=>o.id===this.selectedContactId);-1!==s&&(this.contacts[s]=this.mapToCard(i)),this.handleSuccess("Contact updated successfully")},error:i=>{console.error("Update failed:",i),this.isSaving=!1}})}else{const r={...t,source:3};this.contactService.create(r).subscribe({next:i=>{this.contacts.unshift(this.mapToCard(i)),this.handleSuccess("Contact added successfully")},error:i=>{console.error("Creation failed:",i),this.isSaving=!1}})}}handleSuccess(t){this.messageService.add({severity:"success",summary:"Success",detail:t}),this.displayAddDialog=!1,this.isSaving=!1,this.selectedContactId=null}confirmDelete(t,r){this.confirmationService.confirm({target:t.currentTarget,message:"Do you want to delete this record?",icon:"pi pi-info-circle",rejectButtonProps:{label:"Cancel",severity:"secondary",outlined:!0},acceptButtonProps:{label:"Delete",severity:"danger"},accept:()=>{this.contactService.delete(r.id).subscribe({next:()=>{this.loadContacts(),this.messageService.add({severity:"info",summary:"Confirmed",detail:"Record deleted",life:3e3})}})},reject:()=>{this.messageService.add({severity:"error",summary:"Rejected",detail:"You have rejected",life:3e3})}})}onContactSaved(t){const r=this.contacts.findIndex(i=>i.id===t.id);-1!==r?(this.contacts[r]=this.mapToCard(t),this.handleSuccess(`${t.firstName} updated successfully`)):(this.contacts=[this.mapToCard(t),...this.contacts],this.handleSuccess(`${t.firstName} added successfully`))}onFileSelected(t){const r=t.target.files[0];r&&(this.fileName=r.name,this.selectedFile=r,i3.parse(r,{header:!0,skipEmptyLines:!0,complete:i=>{const s=i.data.map(o=>({Name:this.buildName(o),FirstName:o["First Name"],LastName:o["Last Name"],Email:o["E-mail 1 - Value"]||o.Email||o["E-mail Address"]||o["Email Address"]||"",PhoneNumber:o["Phone 1 - Value"]||o["Mobile Phone"]||o.phones||o["Phone Number"]||"",Company:o.Company||o["Account Name"]||o.Organization||o["Company(optional)"]||"",Role:o.Title||o.Role||o.Position||o["Role(optional)"]||""}));this.totalRows=s.length,this.previewRows=s.slice(0,20),this.contactsPreview=s,this.totalRows>20&&this.previewRows.push({isMoreRow:!0,remaining:this.totalRows-20}),this.displayAndroidDrawer=!1,this.displayIPhoneDrawer=!1,this.displayImportDrawer=!1,this.displayPreviewDialog=!0}}))}onFileChange(t){const r=t.target.files[0];if(!r)return;this.fileName=r.name,this.selectedFile=r,this.alertMessages=[],this.hasWarnings=!1;const i=new FileReader;i.onload=s=>{const l=Vs(new Uint8Array(s.target.result),{type:"array"}),p=qD.sheet_to_json(l.Sheets[l.SheetNames[0]],{defval:""}),u=new Set,f=new Set;let h=0,g=0,m=!1;const _=p.map(v=>
1{const k=(v["E-mail 1 - Value"]||v.Email||v["E-mail Address"]||v["Email Address"]||"").trim().toLowerCase(),A=String(v["Phone 1 - Value"]||v["Mobile Phone"]||v.phones||v["Phone Number"]||"").trim(),G=v.Title||v.Role||v.Position||v["Role(optional)"]||"";return G&&G.length>50&&(m=!0),k&&(u.has(k)?h++:u.add(k)),A&&(f.has(A)?g++:f.add(A)),{Name:this.buildName(v),FirstName:v["First Name"],LastName:v["Last Name"],Email:k,PhoneNumber:A,Company:v.Company||v["Account Name"]||v.Organization||v["Company(optional)"]||"",Role:G}});m&&this.alertMessages.push("Some contacts have a Role longer than 50 characters and will be truncated when saved."),h>0&&this.alertMessages.push(`Found ${h} duplicate email address(es) within the file. The system will add them regardless.`),g>0&&this.alertMessages.push(`Found ${g} duplicate phone number(s) within the file. The system will add them regardless.`),this.hasWarnings=this.alertMessages.length>0,this.totalRows=_.length,this.previewRows=_.slice(0,20),this.contactsPreview=_,this.totalRows>20&&this.previewRows.push({isMoreRow:!0,remaining:this.totalRows-20}),this.displayAndroidDrawer=!1,this.displayIPhoneDrawer=!1,this.displayImportDrawer=!1,this.displayPreviewDialog=!0},i.readAsArrayBuffer(r)}buildName(t){return`${t["First Name"]||""} ${t["Middle Name"]||""} ${t["Last Name"]||""}`.trim()||t["File As"]||"Unknown"}importContacts(){const t=this.contactsPreview.map(r=>({firstName:r.FirstName,lastName:r.LastName,email:r.Email,phoneNumber:r.PhoneNumber,companyName:r.Company,role:r.Role,source:2}));this.isImporting=!0,this.contactService.importContacts(t).subscribe({next:()=>{this.displayPreviewDialog=!1,this.loadContacts()},error:r=>{console.error(r)},complete:()=>{this.isImporting=!1}})}onSearchChange(){clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.currentFirst=0,this.contacts=[],this.loadContacts()},400)}toggleLead(t){t.isProcessing||(t.isProcessing=!0,t.isLead?this.contactService.removeLead(t.id).subscribe({next:r=>{t.isLead=!1,t.isProcessing=!1,this.messageService.add({severity:"info",summary:"Lead Removed"})},error:()=>t.isProcessing=!1}):this.contactService.addAsLead(t.id,this.currentTeamId).subscribe({next:r=>{t.isLead=!0,t.isProcessing=!1,this.messageService.add({severity:"success",summary:"Lead Added"})},error:()=>t.isProcessing=!1}))}selectLetter(t){this.selectedLetter=t,this.loadContacts()}hasActiveFilters(){return""!==this.selectedLetter||this.filters.hasEmail||this.filters.missingEmail||this.filters.isLead||this.filters.isNotLead}getFilterCount(){let t=0;return this.selectedLetter&&t++,t+=Object.values(this.filters).filter(Boolean).length,t}onEmailFilterChange(t){"hasEmail"===t&&this.filters.hasEmail&&(this.filters.missingEmail=!1),"missingEmail"===t&&this.filters.missingEmail&&(this.filters.hasEmail=!1),this.reloadFilters()}onLeadFilterChange(t){"isLead"===t&&this.filters.isLead&&(this.filters.isNotLead=!1),"isNotLead"===t&&this.filters.isNotLead&&(this.filters.isLead=!1),this.reloadFilters()}reloadFilters(){this.currentFirst=0,this.contacts=[],this.loadContacts()}clearLetter(){this.selectedLetter="",this.currentFirst=0,this.loadContacts()}clearFilter(){this.filters={hasEmail:!1,missingEmail:!1,isLead:!1,isNotLead:!1},this.selectedLetter="",this.currentFirst=0,this.loadContacts()}onSortChange(t,r){this.currentSort===t?this.sortOrder=-1*this.sortOrder:(this.currentSort=t,this.sortOrder=1),this.sortContacts()}sortContacts(){if(this.contacts&&0!==this.contacts.length)switch(this.currentSort){case"Name":this.contacts.sort((t,r)=>this.sortOrder*(t.name||"").localeCompare(r.name||""));break;case"Company":this.contacts.sort((t,r)=>this.sortOrder*(t.companyName||"").localeCompare(r.companyName||""));break;case"Date Added":this.contacts.sort((t,r)=>this.sortOrder*(new Date(t.addedDateRaw).getTime()-new Date(r.addedDateRaw).getTime()))}}setActiveTab(t){this.activeTab=t,this.loadContacts()}applyFilter(){this.filteredContacts=this.contacts.filter(t=>this.selectedTypes.includes(t.type))}confirmDeleteSelected(t){const r=this.contacts.filter(i=>i.selected).map(i=>i.id);r.length?this.confirmationService.confirm({target:t.currentTarget,message:`Do you want to delete ${r.length} selected record(s)?`,icon:"pi pi-info-circle",rejectButtonProps:{label:"Cancel",severity:"secondary",outlined:!0},acceptButtonProps:{label:"Delete",severity:"danger"},accept:()=>{this.contactService.deleteMany(r).subscribe({next:i=>{this.loadContacts(),this.messageService.add({severity:"success",summary:"Deleted",detail
1:`${r.length} record(s) deleted successfully`,life:3e3})},error:i=>{this.messageService.add({severity:"error",summary:"Error",detail:"Failed to delete selected contacts",life:3e3}),console.error("Bulk delete failed",i)}})},reject:()=>{this.messageService.add({severity:"info",summary:"Cancelled",detail:"You have cancelled deletion",life:3e3})}}):this.messageService.add({severity:"warn",summary:"No Selection",detail:"Please select at least one contact to delete",life:3e3})}toggleAll(t){this.contacts.forEach(r=>r.selected=t)}clearSelection(){this.contacts.forEach(t=>t.selected=!1)}get allSelected(){return this.contacts?.length>0&&this.contacts.every(t=>t.selected)}get someSelected(){return this.contacts?.some(t=>t.selected)&&!this.allSelected}getTextColor(t){if(!t)return"#000";const r=t.substring(1),i=parseInt(r,16);return(299*(i>>16&255)+587*(i>>8&255)+114*(255&i))/1e3>125?"#000":"#fff"}confirmAddAsLead(t){const r=this.contacts.filter(o=>o.selected);if(!r.length)return void this.messageService.add({severity:"warn",summary:"No Selection",detail:"Please select at least one contact",life:3e3});const i=r.map(o=>o.id),s=i.length;this.confirmationService.confirm({target:t.currentTarget,message:`Are you sure you want to add ${s} contact(s) as leads?`,icon:"pi pi-info-circle",rejectButtonProps:{label:"Cancel",severity:"secondary",outlined:!0},acceptButtonProps:{label:"Yes, Add",severity:"success"},accept:()=>{this.isAddingLeads=!0,this.contactService.addManyAsLeads(i,this.currentTeamId).subscribe({next:()=>{r.forEach(o=>{o.isLead=!0,o.selected=!1}),this.messageService.add({severity:"success",summary:"Leads Added",detail:`${s} contact(s) added as leads`,life:3e3})},error:()=>{this.messageService.add({severity:"error",summary:"Error",detail:"Failed to add contacts as leads",life:3e3})},complete:()=>{this.isAddingLeads=!1}})},reject:()=>{this.messageService.add({severity:"info",summary:"Cancelled",detail:"You have cancelled adding leads",life:3e3})}})}getMathMin(t,r){return Math.min(t,r)}onPageChange(t){this.currentFirst=t.first,this.pageSize=t.rows,this.loadContacts()}static \u0275fac=function(r){return new(r||n)(e.rXU(Ka.u),e.rXU(L.ok),e.rXU(be.td),e.rXU(be.bg),e.rXU(rt.n))};static \u0275cmp=e.VBU({type:n,selectors:[["app-contacts"]],viewQuery:function(r,i){if(1&r&&e.GBs(E6,5),2&r){let s;e.mGM(s=e.lsd())&&(i.contactDrawer=s.first)}},standalone:!1,decls:453,vars:76,consts:[["contactDrawer",""],["op",""],["fileInput",""],["fileInputIos",""],["filterOp",""],["fileInputCsv",""],[1,"p-3","surface-ground"],[1,"flex","flex-column","bg-white","py-3","border-round","shadow-1","mb-2",2,"font-family","-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif"],[1,"flex","flex-column","md:flex-row","md:justify-content-between","md:align-items-center","gap-3","border-bottom-1","border-100","p-2"],[1,"p-input-icon-left","w-full","md:w-4"],["type","text","pInputText","","placeholder","Search contacts...",1,"w-full","border-none","surface-100","font-light","p-2",3,"ngModelChange","input","ngModel"],[1,"flex","flex-wrap","md:flex-nowrap","align-items-center","gap-2","justify-content-end"],["label","Apple Contacts","icon","pi pi-apple","pTooltip","Export Apple CSV","styleClass","p-button-text p-button-secondary p-button-sm font-normal text-600",3,"onClick",4,"ngIf"],["label","Android Contacts","tooltipPosition","left","icon","pi pi-android","pTooltip","Export Android CSV","styleClass","p-button-text p-button-secondary p-button-sm font-normal text-600",3,"onClick",4,"ngIf"],["label","Import CSV","icon","pi pi-upload","styleClass","p-button-outlined p-button-secondary p-button-sm ml-2",3,"onClick",4,"ngIf"],["label","Add Contact","icon","pi pi-plus","styleClass","p-button-sm px-3 ml-1",3,"onClick",4,"ngIf"],[1,"flex","align-items-center","justify-content-between","mb-2","border-bottom-1","border-100","p-2"],[1,"flex","gap-4","align-items-center"],[1,"cursor-pointer","py-1","px-3","border-round-lg","flex","align-items-center","gap-2","transition-colors","transition-duration-200",3,"click","ngClass"],[1,"font-medium","text-sm"],[1,"text-xs","border-round-xl","px-2","py-1","font-bold"],[1,"flex","align-items-center","justify-content-between","text-500","font-medium","text-xs"],[1,"flex","align-items-center","gap-4"],["class","text-900 font-semibold animate-fadein",4,"ngIf"],[4,"ngIf"],[1,"flex","align-items-center","gap-2","pl-3","border-left-1","border-200"],[3,"onChange","binary","ngModel","indeterminate"],[1,"curs
1or-pointer",3,"click","ngClass"],["class","flex align-items-center gap-2 cursor-pointer p-2 border-round hover:bg-green-50 transition-colors animate-fadein",3,"click",4,"ngIf"],["class","flex align-items-center gap-2 cursor-pointer p-2 border-round hover:bg-red-50 transition-colors animate-fadein",3,"click",4,"ngIf"],[1,"flex","flex-wrap","gap-1","text-sm","text-500","p-2"],[1,"cursor-pointer","px-2","py-1","border-round","transition-colors",3,"click","ngClass"],["class","cursor-pointer px-2 py-1 border-round transition-colors w-2rem text-center font-medium text-xs",3,"ngClass","click",4,"ngFor","ngForOf"],["class","flex align-items-center gap-2 text-sm animate-fadein p-2",4,"ngIf"],["class","grid",4,"ngIf"],["class","mt-4",4,"ngIf"],[1,"text-center","mt-5","text-600"],[3,"contactSaved","selectedContact"],["styleClass","p-0 border-round-xl shadow-4"],["pTemplate","content"],["position","right","styleClass","p-0 text-sm",3,"visibleChange","onHide","visible","modal"],["pTemplate","header"],[1,"p-3","flex","flex-column","h-full","text-sm"],[1,"text-600","line-height-3","mb-3","mt-0"],[1,"mb-4"],[1,"flex","align-items-center","gap-2","mb-2"],[1,"bg-green-500","border-round","flex","align-items-center","justify-content-center",2,"width","16px","height","16px"],[1,"pi","pi-check","text-white",2,"font-size","10px"],[1,"font-semibold","text-800","text-sm"],[1,"ml-4"],[1,"block","font-semibold","text-500","mb-1","uppercase",2,"font-size","0.65rem"],[1,"flex","flex-column","gap-1","text-700","mb-2"],[1,"flex"],[1,"text-blue-600","font-semibold","w-2rem","text-xs"],[1,"flex","flex-column","gap-1","text-700"],["href","https://contacts.google.com","target","_blank",1,"text-blue-600"],[1,"ml-4","mt-2","p-2","border-round","border","bg-gray-50","flex","align-items-center","gap-2"],[1,"pi","pi-info-circle","text-sm"],[1,"text-xs"],[1,"pi","pi-th-large","text-indigo-500","text-sm"],[1,"text-blue-600","w-2rem","text-xs"],[1,"flex","align-items-start","gap-2","mt-2","text-500","text-xs","italic"],[1,"pi","pi-arrow-right","text-xs","mt-1"],[1,"flex-grow-1"],[1,"mt-3"],[1,"surface-100","border-round","p-2","flex","gap-2","mb-2"],[1,"pi","pi-mobile","text-xs","text-600","line-height-3"],[1,"m-0","text-xs","text-600"],["type","file","accept",".csv","hidden","",3,"change"],["label","Import CSV File","icon","pi pi-upload","styleClass","w-full p-button-sm",3,"click"],["header","Import Preview",3,"visibleChange","visible","modal"],[1,"text-sm","mb-3","flex","align-items-center","gap-2","text-green-600"],[1,"pi","pi-check-circle"],["scrollHeight","260px","styleClass","p-datatable-sm p-datatable-gridlines border-round-xl overflow-hidden",3,"value","scrollable"],["pTemplate","body"],[1,"mt-3","p-2","border-round","bg-blue-50","text-xs","text-blue-700"],["class","alert alert-warning",4,"ngIf"],["pTemplate","footer"],[1,"bg-yellow-50","border-round","p-3","mb-4","flex","gap-3","border-1","border-yellow-100"],[1,"pi","pi-exclamation-circle","text-yellow-600","mt-1",2,"font-size","1.1rem"],[1,"text-xs","line-height-3","text-yellow-800"],[1,"block","mb-1"],[1,"bg-green-500","border-round","flex","align-items-center","justify-content-center",2,"width","18px","height","18px"],[1,"font-semibold","text-800"],[1,"flex","flex-column","gap-1","text-700","mb-3"],[1,"text-700","mb-3"],[1,"m-0","pl-3","list-disc","flex","flex-column","gap-1"],[1,"pi","pi-sync","text-blue-500","text-sm"],[1,"p-2","border-round","border-1","border-300","bg-gray-100","flex","align-items-center","gap-2"],[1,"pi","pi-check","text-white",2,"font-size","9px"],[1,"text-xs","font-medium"],[1,"pi","pi-bolt","text-orange-500","text-sm"],[1,"ml-4","text-xs","text-700","line-height-3"],[1,"m-0","pl-3","list-disc","mb-2"],[1,"block","text-600"],[1,"m-0","pl-3","list-disc","text-600"],[1,"surface-100","border-round","p-3","flex","gap-3","mb-3","border-1","border-200"],[1,"pi","pi-mobile","text-sm","text-700"],[1,"m-0","text-xs","text-700","line-height-2"],["label","Import CSV File","icon","pi pi-upload","styleClass","w-full p-button-md font-semibold",3,"click"],[1,"flex","flex-column","gap-3","p-2",2,"min-width","250px"],[1,"block","text-xs","font-bold","text-500","uppercase","mb-2"],[1,"flex","align-items-center","gap-2"],["inputId","hasEmail","binary","true",3,"ngModelChange","onChange","ngModel"],["for","hasEmail",1,"text-xs","text-500"],["inputId","missingEmail","binary","true",3,"ngModelChange","onChange","ngModel"],["for","missingEmail",1,"text-xs","text-500"],[1,"flex","flex-column","gap-2","overflow-y-auto",2,"max-height","150px"],["inputId","isLead","binary","true",3,"ngModelChange","onChange","ngModel"],["for","isLead",1,"text-xs","text-500"],["inputId","isNotLead","binary","true",3,"ngModelChange","onChange","ngModel"],["for","isNotLead",1,"text-xs","text-500"],["position","right","styleClass","p-0 text-sm",3,"visibleChange","onHide","visible","modal","baseZIndex"],[1,"flex","flex-column","h-full","surface-ground","text-sm"],[1,"flex-1","overflow-auto","p-4","flex","flex-column","gap-5"],[1,"surface-card","p-3","border-round-xl","shadow-1"],[1,"mb-2","text-sm","font-semibold"],[1,"text-xs","text-600","line-height-3"],["href","assets/contacts.xlsx","download","contacts_template.xlsx",1,"no-underline"],["pButton","","type","button","icon","pi pi-download","label","Download Template",1,"p-button-outlined","w-full","mt-3"],[1,"text-500","uppercase","text-xs","mb-3"],[1,"flex","flex-column","gap-4"],[1,"flex","gap-3"],[1,"flex","flex-column","align-items-center"],[1,"flex","align-items-center","justify-content-center","border-circle","bg-primary","text-white",2,"width","32px","height","32px"],[1,"w-1","surface-border","flex-1"],[1,"font-medium"],[1,"text-600"],[1,"text-600","text-green-600"],[1,"p-3","border-round-lg","bg-green-50"],[1,"flex","gap-2","align-items-start"],[1,"pi","pi-shield","text-green-600"],[1,"font-medium","text-green-700"],[1,"p-4","border-top-1","surface-border"],["type","file","accept",".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel","hidden","",3,"change"],["label","Apple Contacts","icon","pi pi-apple","pTooltip","Export Apple CSV","styleClass","p-button-text p-button-secondary p-button-sm font-normal text-600",3,"onClick"],["label","Android Contacts","tooltipPosition","left","icon","pi pi-android","pTooltip","Export Android CSV","styleClass","p-button-text p-button-secondary p-button-sm font-normal text-600",3,"onClick"],["label","Import CSV","icon","pi pi-upload","styleClass","p-button-outlined p-button-secondary p-button-sm ml-2",3,"onClick"],["label","Add Contact","icon","pi pi-plus","styleClass","p-button-sm px-3 ml-1",3,"onClick"],[1,"text-900","font-semibold","animate-fadein"],[1,"flex","align-items-center","gap-2","cursor-pointer","p-2","border-round","transition-colors",3,"click","ngClass"],[1,"pi","pi-sort-alt"],[1,"pi","pi-filter"],["class","bg-blue-500 text-white border-circle flex align-items-center justify-content-center","style","font-size: 0.7rem; width: 1.2rem; height: 1.2rem;",4,"ngIf"],[1,"bg-blue-500","text-white","border-circle","flex","align-items-center","justify-content-center",2,"font-size","0.7rem","
1width","1.2rem","height","1.2rem"],[1,"flex","align-items-center","gap-2","cursor-pointer","p-2","border-round","hover:bg-green-50","transition-colors","animate-fadein",3,"click"],[1,"pi","pi-chart-line","text-green-500"],[1,"text-green-500","font-medium"],[1,"flex","align-items-center","gap-2","cursor-pointer","p-2","border-round","hover:bg-red-50","transition-colors","animate-fadein",3,"click"],[1,"pi","pi-trash","text-red-500"],[1,"text-red-500","font-medium"],[1,"cursor-pointer","px-2","py-1","border-round","transition-colors","w-2rem","text-center","font-medium","text-xs",3,"click","ngClass"],[1,"flex","align-items-center","gap-2","text-sm","animate-fadein","p-2"],[1,"text-600","font-medium","text-xs"],["class","flex align-items-center gap-2 bg-gray-200 px-3 py-1 border-round-2xl text-700 text-xs",4,"ngIf"],["class","flex align-items-center gap-2 bg-gray-200 px-3 py-1 border-round-2xl text-xs",4,"ngIf"],[1,"text-500","cursor-pointer","hover:underline","ml-2","text-xs",3,"click"],[1,"flex","align-items-center","gap-2","bg-gray-200","px-3","py-1","border-round-2xl","text-700","text-xs"],[1,"pi","pi-times","text-xs","cursor-pointer","hover:text-red-500",3,"click"],[1,"flex","align-items-center","gap-2","bg-gray-200","px-3","py-1","border-round-2xl","text-xs"],[1,"grid"],["class","col-12 md:col-6 lg:col-4",4,"ngFor","ngForOf"],[1,"col-12","md:col-6","lg:col-4"],[1,"p-3","border-round-xl","border","bg-white","shadow-1","hover:shadow-4","hover:-translate-y-1","transition-all","transition-duration-200","cursor-pointer"],[1,"flex","gap-2","mb-3"],[1,"flex","flex-column","w-full"],[1,"flex","justify-content-between","align-items-start","contact-row"],[1,"flex","align-items-center","relative","contact-left"],[1,"hover-checkbox",3,"ngModelChange","click","ngModel","binary"],[1,"flex","gap-2","align-items-center","contact-content"],["shape","circle","size","large","styleClass","bg-gray-200 text-blue-600 font-semibold text-sm",3,"label"],[1,"flex","flex-column"],[1,"font-semibold","text-900","text-sm"],[1,"text-500","text-xs"],[1,"flex","gap-2"],["severity","secondary","styleClass","custom-tag","value","Imported",3,"rounded",4,"ngIf"],["styleClass","custom-tag",3,"value","rounded","style",4,"ngIf"],[1,"flex","flex-column","gap-2","text-xs","text-600","mt-3"],[1,"pi","pi-building","text-xs"],[1,"pi","pi-envelope","text-xs"],[1,"pi","pi-phone","text-xs"],[1,"border-top-1","border-200","my-2"],[1,"flex","justify-content-between","align-items-center","text-xs","text-500"],[1,"pi","pi-pencil","cursor-pointer",3,"click"],[1,"pi","pi-trash","cursor-pointer",3,"click"],["class","custom-button",3,"label","icon","outlined","severity","styleClass","onClick",4,"ngIf"],["severity","secondary","styleClass","custom-tag","value","Imported",3,"rounded"],["styleClass","custom-tag",3,"value","rounded"],[1,"custom-button",3,"onClick","label","icon","outlined","severity","styleClass"],[1,"mt-4"],["styleClass","border-none bg-transparent",3,"onPageChange","first","rows","totalRecords","rowsPerPageOptions"],[1,"text-center","text-600","text-sm","mt-2"],["class","text-center mt-5 text-600",4,"ngIf"],[1,"p-3","border-round-xl","border","bg-white","shadow-1"],[1,"flex","align-items-center","gap-2","mb-3"],["shape","circle","size","3rem"],[1,"flex","flex-column","gap-2","w-full"],["width","60%","height","12px"],["width","40%","height","10px"],[1,"flex","flex-column","gap-2","mt-3"],["width","80%","height","10px"],["width","70%","height","10px"],[1,"border-top-1","border-200","my-3"],[1,"flex","justify-content-between","align-items-center"],["width","30%","height","10px"],["width","20%","height","10px"],[1,"flex","flex-column","w-10rem","bg-white","border-round-xl"],[1,"p-1","text-xs","font-light","border-round-md","cursor-pointer","flex","justify-content-between","align-items-center","transition-colors","transition-duration-200",3,"click","ngClass"],["class","text-xs","style","font-size: 0.65rem;",4,"ngIf"],[1,"text-xs",2,"font-size","0.65rem"],[1,"pi","pi-android","text-lg","text-green-600"],[1,"text-lg","font-semibold","text-900"],[1,"text-xs","bg-gray-100","text-gray-700"],[1,"py-2","px-3","font-semibold"],["class","text-xs text-gray-700",3,"ngClass",4,"ngIf"],[1,"text-xs","text-gray-700",3,"ngClass"],[1,"py-2","px-3","font-medium"],[1,"py-2","px-3","text-gray-600"],["colspan","3",1,"py-3","px-3","text-center","bg-gray-50"],[1,"text-xs","text-gray-500","font-medium"],[1,"alert","alert-warning"],[2,"font-weight","bold","margin-bottom","4px"],["class","mt-3 p-2 border-round bg-blue-50 text-xs text-yellow-700",4,"ngFor","ngForOf"],[1,"mt-3","p-2","border-round","bg-blue-50","text-xs","text-yellow-700"],["pButton","","label","Cancel",1,"p-button-text",3,"click"],["pButton","","icon","pi pi-upload",1,"p-button-primary",3,"click","label","loading","disabled"],[1,"pi","pi-apple","text-lg","text-900"],[1,"flex","align-items-center","justify-content-center","border-round-xl","text-primary"],[1,"pi","pi-cloud-upload","text-lg"],[1,"m-0","text-lg","font-semibold"],[1,"text-600","text-sm"]],template:function(r,i){if(1&r){const s=e.RV6();e.j41(0,"div",6),e.nrm(1,"p-toast")(2,"p-confirmpopup"),e.j41(3,"div",7)(4,"div",8)(5,"span",9)(6,"input",10),e.mxI("ngModelChange",function(l){return e.eBV(s),e.DH7(i.searchTerm,l)||(i.searchTerm=l),e.Njj(l)}),e.bIt("input",function(){return e.eBV(s),e.Njj(i.onSearchChange())}),e.k0s()(),e.j41(7,"div",11),e.DNE(8,N6,1,0,"p-button",12)(9,G6,1,0,"p-button",13)(10,B6,1,0,"p-button",14)(11,L6,1,0,"p-button",15),e.k0s()(),e.j41(12,"div",16)(13,"div",17)(14,"div",18),e.bIt("click",function(){return e.eBV(s),e.Njj(i.setActiveTab("My Contacts"))}),e.j41(15,"span",19),e.EFF(16,"My Contacts"),e.k0s(),e.j41(17,"span",20),e.EFF(18),e.k0s()(),e.j41(19,"div",18),e.bIt("click",function(){return e.eBV(s),e.Njj(i.setActiveTab("Deskflo Contacts"))}),e.j41(20,"span",19),e.EFF(21,"Deskflo Contacts"),e.k0s(),e.j41(22,"span",20),e.EFF(23),e.k0s()()(),e.j41(24,"div",21)(25,"div",22),e.DNE(26,$6,2,1,"span",23)(27,U6,10,4,"ng-container",24),e.j41(28,"div",25)(29,"p-checkbox",26),e.bIt("onChange",function(l){return e.eBV(s),e.Njj(i.toggleAll(l.checked))}),e.k0s(),e.j41(30,"span",27),e.bIt("click",function(){return e.eBV(s),e.Njj(i.toggleAll(!i.allSelected))}),e.EFF(31),e.k0s()()(),e.DNE(32,X6,4,0,"div",28)(33,Y6,4,0,"div",29),e.k0s()(),e.j41(34,"div",30)(35,"span",31),e.bIt("click",function(){return e.eBV(s),e.Njj(i.selectLetter(""))}),e.EFF(36," All "),e.k0s(),e.DNE(37,W6,2,2,"span",32),e.k0s(),e.DNE(38,Q6,10,5,"div",33),e.k0s(),e.DNE(39,rR,2,1,"div",34)(40,iR,13,8,"div",35)(41,sR,1,1,"div",36)(42,lR,1,1,"div",36)(43,dR,2,2,"div",34),e.k0s(),e.j41(44,"app-create-contacts",37,0),e.bIt("contactSaved",function(l){return e.eBV(s),e.Njj(i.onContactSaved(l))}),e.k0s(),e.j41(46,"p-popover",38,1),e.DNE(48,mR,13,6,"ng-template",39),e.k0s(),e.j41(49,"p-drawer",40),e.mxI("visibleChange",function(l){return e.eBV(s),e.DH7(i.displayAndroidDrawer,l)||(i.displayAndroidDrawer=l),e.Njj(l)}),e.bIt("onHide",function(){return e.eBV(s),e.Njj(i.contactForm.reset())}),e.DNE(50,hR,4,0,"ng-template",41),e.j41(51,"div",42)(52,"p",43),e.EFF(53," Android is easier \u{1f44d} Follow these steps to export and import your contacts. "),e.k0s(),e.j41(54,"section",44)(55,"div",45)(56,"div",46),e.nrm(57,"i",47),e.k0s(),e.j41(58,"span",48),e.EFF(59,"Method 1: Google Contacts"),e.k0s()(),e.j41(60,"div",49)(61,"small",50),e.EFF(62," Ensure sync: "),e.k0s(),e.j41(63,"div",51)(64,"div",52)(65,"span",53),e.EFF(66,"1"),e.k0s(),e.j41(67,"span"),e.EFF(68,"Settings \u2192 Accounts \u2192 Google"),e.k0s()(),e.j41(69,"div",52)(70,"span",53),e.EFF(71,"2"),e.k0s(),e.j41(72,"span"),e.EFF(73,"Enable "),e.j41(74,"strong"),e.EFF(75,"Contacts sync"),e.k0s()()()(),e.j41(76,"small",50),e.EFF(77," On Computer: "),e.k0s(),e.j41(78,"div",54)(79,"div",52)(80,"span",53),e.EFF(81,"3"),e.k0s(),e.j41(82,"span"),e.EFF(83," Go to "),e.j41(84,"a",55),e.EFF(85," contacts.google.com "),e.k0s()()(),e.j41(86,"div",52)(87,"span",53),e.EFF(88,"4"),e.k0s(),e.j41(89,"span"),e.EFF(90,"Click "),e.j41(91,"strong"),e.EFF(92,"Export"),e.k0s()()(),e.j41(93,"div",52)(94,"span",53),e.EFF(95,"5"),e.k0s(),e.j41(96,"span"),e.EFF(97,"Choose "),e.j41(98,"strong"),e.EFF(99,"Google CSV"),e.k0s()()()()(),e.j41(100,"div",56),e.nrm(101,"i",57),e.j41(102,"span",58),e.EFF(103,"Already CSV \u2014 no conversion needed"),e.k0s()()(),e.j41(104,"section",44)(105,"div",45),e.nrm(106,"i",59),e.j41(107,"span",48),e.EFF(108,"Method 2: From phone"),e.k0s()(),e.j41(109,"div",49)(110,"div",54)(111,"div",52)(112,"span",60),e.EFF(113,"1"),e.k0s(),e.EFF(114,"Open Contacts"),e.k0s(),e.j41(115,"div",52)(116,"span",60),e.EFF(117,"2"),e.k0s(),e.EFF(118,"Settings"),e.k0s(),e.j41(119,"div",52)(120,"span",60),e.EFF(121,"3"),e.k0s(),e.EFF(122,"Export"),e.k0s(),e.j41(123,"div",52)(124,"span",60),e.EFF(125,"4"),e.k0s(),e.EFF(126,".vcf file"),e.k0s()(),e.j41(127,"div",61),e.nrm(128,"i",62),e.j41(129,"span"),e.EFF(130,"Transfer to PC \u2192 convert to CSV"),e.k0s()()()(),e.nrm(131,"div",63),e.j41(132,"div",64)(133,"div",65),e.nrm(134,"i",66),e.j41(135,"p",67),e.EFF(136," Upload your CSV using the button below. "),e.k0s()(),e.j41(137,"input",68,2),e.bIt("change",function(l){return e.eBV(s),e.Njj(i.onFileSelected(l))}),e.k0s(),e.j41(139,"p-button",69),e.bIt("click",function(){e.eBV(s);const l=e.sdS(138);return e.Njj(l.click())}),e.k0s()()()(),e.j41(140,"p-dialog",70),e.mxI("visibleChange",function(l){return e.eBV(s),e.DH7(i.displayPreviewDialog,l)||(i.displayPreviewDialog=l),e.Njj(l)}),e.j41(141,"div",71),e.nrm(142,"i",72),e.j41(143,"span"),e.EFF(144," Found "),e.j41(145,"strong"),e.EFF(146),e.k0s(),e.EFF(147,"
1contacts in "),e.j41(148,"strong"),e.EFF(149),e.k0s()()(),e.j41(150,"p-table",73),e.DNE(151,gR,11,0,"ng-template",41)(152,vR,2,2,"ng-template",74),e.k0s(),e.j41(153,"div",75),e.EFF(154," Some contacts may be missing emails. They will still be imported. "),e.k0s(),e.DNE(155,CR,4,1,"div",76)(156,kR,2,3,"ng-template",77),e.k0s(),e.j41(157,"p-drawer",40),e.mxI("visibleChange",function(l){return e.eBV(s),e.DH7(i.displayIPhoneDrawer,l)||(i.displayIPhoneDrawer=l),e.Njj(l)}),e.bIt("onHide",function(){return e.eBV(s),e.Njj(i.contactForm.reset())}),e.DNE(158,TR,4,0,"ng-template",41),e.j41(159,"div",42)(160,"p",43),e.EFF(161," Follow these steps to export your iPhone contacts and import them into DeskFlo. "),e.k0s(),e.j41(162,"div",78),e.nrm(163,"i",79),e.j41(164,"div",80)(165,"strong",81),e.EFF(166,"Important:"),e.k0s(),e.EFF(167," iPhones don't natively export directly to CSV \u2014 you need to go via iCloud or an app. "),e.k0s()(),e.j41(168,"section",44)(169,"div",45)(170,"div",82),e.nrm(171,"i",47),e.k0s(),e.j41(172,"span",83),e.EFF(173,"Method 1: Using iCloud (Best & Cleanest)"),e.k0s()(),e.j41(174,"div",49)(175,"small",50),e.EFF(176,"On your iPhone:"),e.k0s(),e.j41(177,"div",84)(178,"div",52)(179,"span",53),e.EFF(180,"1"),e.k0s(),e.j41(181,"span"),e.EFF(182,"Go to "),e.j41(183,"strong"),e.EFF(184,"Settings"),e.k0s()()(),e.j41(185,"div",52)(186,"span",53),e.EFF(187,"2"),e.k0s(),e.j41(188,"span"),e.EFF(189,"Tap your name ("),e.j41(190,"strong"),e.EFF(191,"Apple ID"),e.k0s(),e.EFF(192,")"),e.k0s()(),e.j41(193,"div",52)(194,"span",53),e.EFF(195,"3"),e.k0s(),e.j41(196,"span"),e.EFF(197,"Tap "),e.j41(198,"strong"),e.EFF(199,"iCloud"),e.k0s()()(),e.j41(200,"div",52)(201,"span",53),e.EFF(202,"4"),e.k0s(),e.j41(203,"span"),e.EFF(204,"Turn on "),e.j41(205,"strong"),e.EFF(206,"Contacts sync"),e.k0s()()()(),e.j41(207,"small",50),e.EFF(208,"On a Computer:"),e.k0s(),e.j41(209,"div",84)(210,"div",52)(211,"span",53),e.EFF(212,"5"),e.k0s(),e.j41(213,"span"),e.EFF(214,"Go to "),e.j41(215,"strong"),e.EFF(216,"icloud.com"),e.k0s()()(),e.j41(217,"div",52)(218,"span",53),e.EFF(219,"6"),e.k0s(),e.j41(220,"span"),e.EFF(221,"Log in with your "),e.j41(222,"strong"),e.EFF(223,"Apple ID"),e.k0s()()(),e.j41(224,"div",52)(225,"span",53),e.EFF(226,"7"),e.k0s(),e.j41(227,"span"),e.EFF(228,"Click "),e.j41(229,"strong"),e.EFF(230,"Contacts"),e.k0s()()()(),e.j41(231,"small",50),e.EFF(232,"Export:"),e.k0s(),e.j41(233,"div",84)(234,"div",52)(235,"span",53),e.EFF(236,"8"),e.k0s(),e.j41(237,"span"),e.EFF(238,"Press "),e.j41(239,"strong"),e.EFF(240,"Cmd + A"),e.k0s(),e.EFF(241," (Mac) or "),e.j41(242,"strong"),e.EFF(243,"Ctrl + A"),e.k0s(),e.EFF(244," (Windows) to select all"),e.k0s()(),e.j41(245,"div",52)(246,"span",53),e.EFF(247,"9"),e.k0s(),e.j41(248,"span"),e.EFF(249,"Click the "),e.j41(250,"strong"),e.EFF(251,"gear icon"),e.k0s(),e.EFF(252," (bottom left)"),e.k0s()(),e.j41(253,"div",52)(254,"span",53),e.EFF(255,"10"),e.k0s(),e.j41(256,"span"),e.EFF(257,"Click "),e.j41(258,"strong"),e.EFF(259,"Export vCard (.vcf)"),e.k0s()()()(),e.j41(260,"small",50),e.EFF(261,"Convert to CSV:"),e.k0s(),e.j41(262,"div",85)(263,"span",81),e.EFF(264,"Use one of:"),e.k0s(),e.j41(265,"ul",86)(266,"li")(267,"strong"),e.EFF(268,"Google Contacts"),e.k0s(),e.EFF(269," (recommended)"),e.k0s(),e.j41(270,"li")(271,"strong"),e.EFF(272,"Excel"),e.k0s(),e.EFF(273," (import vCard)"),e.k0s(),e.j41(274,"li"),e.EFF(275,"Online converter"),e.k0s()()()()(),e.j41(276,"section",44)(277,"div",45),e.nrm(278,"i",87),e.j41(279,"span",48),e.EFF(280,"Convert VCF \u2014 CSV using Google Contacts (Best way)"),e.k0s()(),e.j41(281,"div",49)(282,"div",51)(283,"div",52)(284,"span",53),e.EFF(285,"1"),e.k0s(),e.j41(286,"span"),e.EFF(287,"Go to "),e.j41(288,"strong"),e.EFF(289,"contacts.google.com"),e.k0s()()(),e.j41(290,"div",52)(291,"span",53),e.EFF(292,"2"),e.k0s(),e.j41(293,"span"),e.EFF(294,"Click "),e.j41(295,"strong"),e.EFF(296,"Import"),e.k0s()()(),e.j41(297,"div",52)(298,"span",53),e.EFF(299,"3"),e.k0s(),e.j41(300,"span"),e.EFF(301,"Upload the "),e.j41(302,"strong"),e.EFF(303,".vcf"),e.k0s(),e.EFF(304," file"),e.k0s()(),e.j41(305,"div",52)(306,"span",53),e.EFF(307,"4"),e.k0s(),e.j41(308,"span"),e.EFF(309,"Click "),e.j41(310,"strong"),e.EFF(311,"Export"),e.k0s()()(),e.j41(312,"div",52)(313,"span",53),e.EFF(314,"5"),e.k0s(),e.j41(315,"span"),e.EFF(316,"Choose "),e.j41(317,"strong"),e.EFF(318,"Google CSV"),e.k0s(),e.EFF(319," or "),e.j41(320,"strong"),e.EFF(321,"Outlook CSV"),e.k0s()()()(),e.j41(322,"div",88)(323,"div",46),e.nrm(324,"i",89),e.k0s(),e.j41(325,"span",90),e.EFF(326,"Done \u2014 clean CSV file"),e.k0s()()()(),e.j41(327,"section",44)(328,"div",45),e.nrm(329,"i",91),e.j41(330,"span",48),e.EFF(331,"Alternative (App-based on iPhone)"),e.k0s()(),e.j41(332,"div",92)(333,"span",81),e.EFF(334,"Apps like:"),e.k0s(),e.j41(335,"ul",93)(336,"li")(337,"strong"),e.EFF(338,'"Contacts Backup"'),e.k0s()(),e.j41(339,"li")(340,"strong"),e.EFF(341,'"Easy Backup"'),e.k0s()()(),e.j41(342,"span",94),e.EFF(343,"Let you export directly to CSV, but:"),e.k0s(),e.j41(344,"ul",95)(345,"li"),e.EFF(346,"May include ads"),e.k0s(),e.j41(347,"li"),e.EFF(348,"Less clean formatting"),e.k0s()()()(),e.nrm(349,"div",63),e.j41(350,"div",64)(351,"div",96),e.nrm(352,"i",97),e.j41(353,"p",98),e.EFF(354," Once you have your CSV file, use the "),e.j41(355,"strong"),e.EFF(356,"Import CSV"),e.k0s(),e.EFF(357," button to upload your contacts into DeskFlo. "),e.k0s()(),e.j41(358,"input",68,3),e.bIt("change",function(l){return e.eBV(s),e.Njj(i.onFileSelected(l))}),e.k0s(),e.j41(360,"p-button",99),e.bIt("click",function(){e.eBV(s);const l=e.sdS(359);return e.Njj(l.click())}),e.k0s()()()(),e.j41(361,"p-popover",38,4)(363,"div",100)(364,"div")(365,"span",101),e.EFF(366,"Email"),e.k0s(),e.j41(367,"div",102)(368,"p-checkbox",103),e.mxI("ngModelChange",function(l){return e.eBV(s),e.DH7(i.filters.hasEmail,l)||(i.filters.hasEmail=l),e.Njj(l)}),e.bIt("onChange",function(){return e.eBV(s),e.Njj(i.onEmailFilterChange("hasEmail"))}),e.k0s(),e.j41(369,"label",104),e.EFF(370,"Has email address"),e.k0s()(),e.j41(371,"div",102)(372,"p-checkbox",105),e.mxI("ngModelChange",function(l){return e.eBV(s),e.DH7(i.filters.missingEmail,l)||(i.filters.missingEmail=l),e.Njj(l)}),e.bIt("onChange",function(){return e.eBV(s),e.Njj(i.onEmailFilterChange("missingEmail"))}),e.k0s(),e.j41(373,"label",106),e.EFF(374,"Missing email address"),e.k0s()()(),e.j41(375,"div")(376,"span",101),e.EFF(377,"Lead Status"),e.k0s(),e.j41(378,"div",107)(379,"div",102)(380,"p-checkbox",108),e.mxI("ngModelChange",function(l){return e.eBV(s),e.DH7(i.filters.isLead,l)||(i.filters.isLead=l),e.Njj(l)}),e.bIt("onChange",function(){return e.eBV(s),e.Njj(i.onLeadFilterChange("isLead"))}),e.k0s(),e.j41(381,"label",109),e.EFF(382,"Is a lead"),e.k0s()(),e.j41(383,"div",102)(384,"p-checkbox",110),e.mxI("ngModelChange",function(l){return e.eBV(s),e.DH7(i.filters.isNotLead,l)||(i.filters.isNotLead=l),e.Njj(l)}),e.bIt("onChange",function(){return e.eBV(s),e.Njj(i.onLeadFilterChange("isNotLead"))}),e.k0s(),e.j41(385,"label",111),e.EFF(386,"Not a lead"),e.k0s()()()()()(),e.j41(387,"p-drawer",112),e.mxI("visibleChange",function(l){return e.eBV(s),e.DH7(i.displayImportDrawer,l)||(i.displayImportDrawer=l),e.Njj(l)}),e.bIt("onHide",function(){return e.eBV(s),e.Njj(i.contactForm.reset())}),e.DNE(388,wR,8,0,"ng-template",41),e.j41(389,"div",113)(390,"div",114)(391,"div",115)(392,"h4",116),e.EFF(393,"Download Excel Template"),e.k0s(),e.j41(394,"p",117),e.EFF(395," Start with our pre-formatted template to ensure all fields are recognized. "),e.k0s(),e.j41(396,"a",118),e.nrm(397,"button",119),e.k0s()(),e.j41(398,"div")(399,"h5",120),e.EFF(400,"Step-by-Step Instru
1ctions"),e.k0s(),e.j41(401,"div",121)(402,"div",122)(403,"div",123)(404,"div",124),e.EFF(405,"1"),e.k0s(),e.nrm(406,"div",125),e.k0s(),e.j41(407,"div")(408,"div",19),e.EFF(409,"Download the template"),e.k0s(),e.j41(410,"small",117),e.EFF(411,' Avoid manual mapping of headers like "Full Name" or "Email". '),e.k0s()()(),e.j41(412,"div",122)(413,"div",123)(414,"div",124),e.EFF(415,"2"),e.k0s(),e.nrm(416,"div",125),e.k0s(),e.j41(417,"div")(418,"div",126),e.EFF(419,"Fill in your information"),e.k0s(),e.j41(420,"small",127),e.EFF(421," Paste your data. Ensure no empty rows. "),e.k0s()()(),e.j41(422,"div",122)(423,"div",123)(424,"div",124),e.EFF(425,"3"),e.k0s(),e.nrm(426,"div",125),e.k0s(),e.j41(427,"div")(428,"div",126),e.EFF(429,"Save as Excel"),e.k0s(),e.j41(430,"small",128),e.EFF(431,' Use "Excel Workbook (.xlsx)" '),e.k0s()()(),e.j41(432,"div",122)(433,"div",123)(434,"div",124),e.EFF(435,"4"),e.k0s()(),e.j41(436,"div")(437,"div",126),e.EFF(438,"Import your file"),e.k0s(),e.j41(439,"small",127),e.EFF(440," Click the button below to upload. "),e.k0s()()()()(),e.j41(441,"div",129)(442,"div",130),e.nrm(443,"i",131),e.j41(444,"div")(445,"div",132),e.EFF(446,"Data Security"),e.k0s(),e.j41(447,"small"),e.EFF(448," Your data is encrypted and never shared. "),e.k0s()()()()(),e.j41(449,"div",133)(450,"input",134,5),e.bIt("change",function(l){return e.eBV(s),e.Njj(i.onFileChange(l))}),e.k0s(),e.j41(452,"p-button",69),e.bIt("click",function(){e.eBV(s);const l=e.sdS(451);return e.Njj(l.click())}),e.k0s()()()()}2&r&&(e.R7$(6),e.R50("ngModel",i.searchTerm),e.R7$(2),e.Y8G("ngIf","Deskflo Contacts"!==i.activeTab),e.R7$(),e.Y8G("ngIf","Deskflo Contacts"!==i.activeTab),e.R7$(),e.Y8G("ngIf","Deskflo Contacts"!==i.activeTab),e.R7$(),e.Y8G("ngIf","Deskflo Contacts"===i.activeTab),e.R7$(3),e.Y8G("ngClass","My Contacts"===i.activeTab?"bg-blue-500 text-white":"text-600 hover:surface-100"),e.R7$(3),e.xc7("background","My Contacts"===i.activeTab?"rgba(255,255,255,0.3)":"#f1f5f9")("color","My Contacts"===i.activeTab?"black":"#64748b"),e.R7$(),e.SpI(" ",i.myContactsCount," "),e.R7$(),e.Y8G("ngClass","Deskflo Contacts"===i.activeTab?"bg-blue-500 text-white":"text-600 hover:surface-100"),e.R7$(3),e.xc7("background","Deskflo Contacts"===i.activeTab?"rgba(255,255,255,0.3)":"#f1f5f9")("color","Deskflo Contacts"===i.activeTab?"black":"#64748b"),e.R7$(),e.SpI(" ",i.deskfloContactsCount," "),e.R7$(3),e.Y8G("ngIf",i.selectedCount>0),e.R7$(),e.Y8G("ngIf",0===i.selectedCount),e.R7$(2),e.Y8G("binary",!0)("ngModel",i.allSelected)("indeterminate",i.someSelected),e.R7$(),e.Y8G("ngClass",e.l_i(66,I6,i.someSelected||i.allSelected,!i.someSelected&&!i.allSelected)),e.R7$(),e.SpI(" ",i.allSelected?"Deselect All":"Select All"," "),e.R7$(),e.Y8G("ngIf",i.selectedCount>0),e.R7$(),e.Y8G("ngIf",i.selectedCount>0),e.R7$(2),e.Y8G("ngClass",""===i.selectedLetter?"bg-blue-500 text-white":"hover:surface-200"),e.R7$(2),e.Y8G("ngForOf",i.letters),e.R7$(),e.Y8G("ngIf",i.hasActiveFilters()),e.R7$(),e.Y8G("ngIf",!i.loading),e.R7$(),e.Y8G("ngIf",!i.loading&&i.contacts.length>0),e.R7$(),e.vxM("My Contacts"===i.activeTab?41:42),e.R7$(2),e.Y8G("ngIf",i.loading),e.R7$(),e.Y8G("selectedContact",i.editingContact),e.R7$(5),e.Aen(e.lJ4(69,q0)),e.R50("visible",i.displayAndroidDrawer),e.Y8G("modal",!0),e.R7$(90),e.Aen(e.lJ4(70,J0)),e.R7$(),e.Aen(e.lJ4(71,D6)),e.R50("visible",i.displayPreviewDialog),e.Y8G("modal",!0),e.R7$(6),e.JRh(i.contactsPreview.length),e.R7$(3),e.JRh(i.fileName),e.R7$(),e.Y8G("value",i.previewRows)("scrollable",!0),e.R7$(5),e.Y8G("ngIf",i.hasWarnings),e.R7$(2),e.Aen(e.lJ4(72,q0)),e.R50("visible",i.displayIPhoneDrawer),e.Y8G("modal",!0),e.R7$(203),e.Aen(e.lJ4(73,R6)),e.R7$(8),e.R50("ngModel",i.filters.hasEmail),e.R7$(4),e.R50("ngModel",i.filters.missingEmail),e.R7$(8),e.R50("ngModel",i.filters.isLead),e.R7$(4),e.R50("ngModel",i.filters.isNotLead),e.R7$(3),e.Aen(e.lJ4(74,j6)),e.R50("visible",i.displayImportDrawer),e.Y8G("modal",!0)("baseZIndex",1e3),e.R7$(65),e.Aen(e.lJ4(75,J0)))},dependencies:[q.YU,q.Sq,q.bT,be.Ei,dn.EA,wt.m_,Se.XI,zn.eu,Ie.y8,Qe.Sm,L.me,L.BC,L.vS,jt.lG,xe._f,xe.$n,Ve._s,qs,Ae.AM,Xr.Sc,es.mg,co.vw,z0],styles:["[_nghost-%COMP%] .p-checkbox{transform:scale(.9)} .p-inputtext{box-shadow:none!important}[_nghost-%COMP%] .custom-input .p-inputtext, [_nghost-%COMP%] .custom-input.p-inputtext, [_nghost-%COMP%] .custom-input .p-dropdown, [_nghost-%COMP%] .custom-input.p-dropdown{height:42px;display:flex;align-items:center}.custom-tag[_ngcontent-%COMP%]{font-size:.7rem;padding:.2rem .5rem;border:1px solid #d1d5db;font-weight:400}[_nghost-%COMP%] .custom-button .p-button{font-size:10px!important}.contact-left[_ngcontent-%COMP%]{position:relative}.hover-checkbox[_ngcontent-%COMP%]{position:absolute;
1left:0;top:50%;transform:translateY(-50%);opacity:0;pointer-events:none;transition:opacity .2s ease}.contact-content[_ngcontent-%COMP%]{transition:margin-left .2s ease}.grid[_ngcontent-%COMP%] .p-3[_ngcontent-%COMP%]:hover .contact-content[_ngcontent-%COMP%]{margin-left:2rem}.contact-left[_ngcontent-%COMP%]:has(.hover-checkbox input:checked) .contact-content[_ngcontent-%COMP%]{margin-left:2rem}.grid[_ngcontent-%COMP%] .p-3[_ngcontent-%COMP%]:hover .hover-checkbox[_ngcontent-%COMP%]{opacity:1;pointer-events:auto}.hover-checkbox[_ngcontent-%COMP%]:has(input:checked){opacity:1;pointer-events:auto}.animate-fadein[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_fadeIn .2s ease}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}"]})}return n})()}]}];let SR=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=e.$C({type:n});static \u0275inj=e.G2t({imports:[sr.iI.forChild(FR),sr.iI]})}return n})();var ER=ee(88333);const IR=["*"],DR=({})=>"\n .p-fluid{\n width:100%\n }\n",RR={root:"p-fluid"};let K0=(()=>{class n extends Dl.j{name="fluid";classes=RR;theme=DR;static \u0275fac=(()=>{let t;return function(i){return(t||(t=e.xGo(n)))(i||n)}})();static \u0275prov=e.jDH({token:n,factory:n.\u0275fac})}return n})(),AR=(()=>{class n extends Il.${_componentStyle=(0,e.WQX)(K0);static \u0275fac=(()=>{let t;return function(i){return(t||(t=e.xGo(n)))(i||n)}})();static \u0275cmp=e.VBU({type:n,selectors:[["p-fluid"]],hostVars:2,hostBindings:function(r,i){2&r&&e.AVh("p-fluid",!0)},features:[e.Jv_([K0]),e.Vt3],ngContentSelectors:IR,decls:1,vars:0,template:function(r,i){1&r&&(e.NAR(),e.SdG(0))},dependencies:[q.MD],encapsulation:2,changeDetection:0})}return n})(),MR=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=e.$C({type:n});static \u0275inj=e.G2t({imports:[AR]})}return n})();var PR=ee(494),OR=ee(17060),NR=ee(19614),GR=ee(76150),BR=ee(19056),LR=ee(15473);const $R=["list"],VR=n=>({"p-steps p-component":!0,"p-readonly":n}),UR=(n,a)=>({"p-steps-item-active":n,"p-disabled":a}),XR=()=>({exact:!1}),YR=(n,a)=>a.label;function WR(n,a){if(1&n&&(e.j41(0,"span",14),e.EFF(1),e.k0s()),2&n){const t=e.XpG(3).$implicit;e.R7$(),e.JRh(t.label)}}function HR(n,a){if(1&n&&e.nrm(0,"span",15),2&n){const t=e.XpG(3).$implicit;e.Y8G("innerHTML",t.label,e.npT)}}function zR(n,a){if(1&n){const t=e.RV6();e.j41(0,"a",11),e.bIt("click",function(i){e.eBV(t);const s=e.XpG(2),o=s.$implicit,l=s.$index,c=e.XpG();return e.Njj(c.onItemClick(i,o,l))})("keydown",function(i){e.eBV(t);const s=e.XpG(2),o=s.$implicit,l=s.$index,c=e.XpG();return e.Njj(c.onItemKeydown(i,o,l))}),e.j41(1,"span",12),e.EFF(2),e.k0s(),e.DNE(3,WR,2,1,"span",13)(4,HR,1,1,"ng-template",null,3,e.C5r),e.k0s()}if(2&n){const t=e.sdS(5),r=e.XpG(2),i=r.$implicit,s=r.$index,o=e.XpG();e.Y8G("routerLink",i.routerLink)("queryParams",i.queryParams)("routerLinkActiveOptions",i.routerLinkActiveOptions||e.lJ4(17,XR))("target",i.target)("fragment",i.fragment)("queryParamsHandling",i.queryParamsHandling)("preserveFragment",i.preserveFragment)("skipLocationChange",i.skipLocationChange)("replaceUrl",i.replaceUrl)("state",i.state),e.BMQ("tabindex",o.getItemTabIndex(i,s))("aria-expanded",s===o.activeIndex)("aria-disabled",i.disabled||o.readonly&&s!==o.activeIndex)("ariaCurrentWhenActive",o.exact?"step":void 0),e.R7$(2),e.JRh(s+1),e.R7$(),e.Y8G("ngIf",!1!==i.escape)("ngIfElse",t)}}function qR(n,a){if(1&n&&(e.j41(0,"span",14),e.EFF(1),e.k0s()),2&n){const t=e.XpG(3).$implicit;e.R7$(),e.JRh(t.label)}}function JR(n,a){if(1&n&&e.nrm(0,"span",15),2&n){const t=e.XpG(3).$implicit;e.Y8G("innerHTML",t.label,e.npT)}}function KR(n,a){if(1&n){const t=e.RV6();e.j41(0,"a",16),e.bIt("click",function(i){e.eBV(t);const s=e.XpG(2),o=s.$implicit,l=s.$index,c=e.XpG();return e.Njj(c.onItemClick(i,o,l))})("keydown",function(i){e.eBV(t);const s=e.XpG(2),o=s.$implicit,l=s.$index,c=e.XpG();return e.Njj(c.onItemKeydown(i,o,l))}),e.j41(1,"span",12),e.EFF(2),e.k0s(),e.DNE(3,qR,2,1,"span",13)(4,JR,1,1,"ng-template",null,4,e.C5r),e.k0s()}if(2&n){const t=e.sdS(5),r=e.XpG(2),i=r.$implicit,s=r.$index,o=e.XpG();e.Y8G("target",i.target),e.BMQ("href",i.url,e.B4B)("tabindex",o.getItemTabIndex(i,s))("aria-expanded",s===o.activeIndex)("aria-disabled",i.disabled||o.readonly&&s!==o.activeIndex)("ariaCurrentWhenActive",!o.exact||i.disabled&&!o.readonly?void 0:"step"),e.R7$(2),e.JRh(s+1),e.R7$(),e.Y8G("ngIf",!1!==i.escape)("ngIfElse",t)}}function QR(n,a){if(1&n&&(e.j41(0,"li",9,1),e.DNE(2,zR,6,18,"a",10)(3,KR,6,9,"ng-template",null,2,e.C5r),e.k0s()),2&n){const t=e.sdS(4),r=e.XpG(),i=r.$implicit,s=r.$index,o=e.XpG();e.HbH(i.styleClass),e.Y8G("ngStyle",i.style)("tooltipOptions",i.tooltipOptions)("ngClass",e.l_i(10,UR,o.isActive(i,s),i.disabled||o.readonly&&!o.isActive(i,s))),e.BMQ("aria-current",o.isActive(i,s)?"step":void 0)("id",i.id)("data-pc-section","menuitem"),e.R7$(2),e.Y8G("ngIf",o.isClickableRouterLink(i))("ngIfElse",t)}}function ZR(n,a){1&n&&e.DNE(0,QR,5,13,"li",8),2&n&&e.Y8G("ngIf",!1!==a.$implicit.visible)}const ej=({dt:n})=>`\n.p-steps {\n position: relative;\n}\n\n.p-steps-list {\n padding: 0;\n margin: 0;\n list-style-type: none;\n display: flex;\n}\n\n.p-steps-item {\n position: relative;\n display: flex;\n justify-content: center;\n flex: 1 1 auto;\n}\n\n.p-steps-item.p-disabled,\n.p-steps-item.p-disabled * {\n opacity: 1;\n pointer-events: auto;\n user-select: auto;\n cursor: auto;\n}\n\n.p-steps-item:before {\n content: " ";\n border-top: 2px solid ${n("steps.separator.background")};\n width: 100%;\n top: 50%;\n left: 0;\n display: block;\n position: absolute;\n margin-top: -1rem;\n margin-top: calc(-1rem + 1px);\n}\n\n.p-steps-item:first-child::before {\n width: calc(50% + 1rem);\n transform: translateX(100%);\n}\n\n.p-steps-item:last-child::before {\n width: 50%;\n}\n\n.p-steps-item-link {\n display: inline-flex;\n flex-direction: column;
1\n align-items: center;\n overflow: hidden;\n text-decoration: none;\n transition: outline-color ${n("steps.transition.duration")}, box-shadow ${n("steps.transition.duration")};\n border-radius: ${n("steps.item.link.border.radius")};\n outline-color: transparent;\n gap: ${n("steps.item.link.gap")};\n}\n\n.p-steps-item-link:not(.p-disabled):focus-visible {\n box-shadow: ${n("steps.item.link.focus.ring.shadow")};\n outline: ${n("steps.item.link.focus.ring.width")} ${n("steps.item.link.focus.ring.style")} ${n("steps.item.link.focus.ring.color")};\n outline-offset: ${n("steps.item.link.focus.ring.offset")};\n}\n\n.p-steps-item-label {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n color: ${n("steps.item.label.color")};\n display: block;\n font-weight: ${n("steps.item.label.font.weight")};\n}\n\n.p-steps-item-number {\n display: flex;\n align-items: center;\n justify-content: center;\n color: ${n("steps.item.number.color")};\n border: 2px solid ${n("steps.item.number.border.color")};\n background: ${n("steps.item.number.background")};\n min-width: ${n("steps.item.number.size")};\n height: ${n("steps.item.number.size")};\n line-height: ${n("steps.item.number.size")};\n font-size: ${n("steps.item.number.font.size")};\n z-index: 1;\n border-radius: ${n("steps.item.number.border.radius")};\n position: relative;\n font-weight: ${n("steps.item.number.font.weight")};\n}\n\n.p-steps-item-number::after {\n content: " ";\n position: absolute;\n width: 100%;\n height: 100%;\n border-radius: ${n("steps.item.number.border.radius")};\n box-shadow: ${n("steps.item.number.shadow")};\n}\n\n.p-steps:not(.p-readonly) .p-steps-item {\n cursor: pointer;\n}\n\n.p-steps-item-active .p-steps-item-number {\n background: ${n("steps.item.number.active.background")};\n border-color: ${n("steps.item.number.active.border.color")};\n color: ${n("steps.item.number.active.color")};\n}\n\n.p-steps-item-active .p-steps-item-label {\n color: ${n("steps.item.label.active.color")};\n}\n`,tj={root:({props:n})=>["p-steps p-component",{"p-readonly":n.readonly}],list:"p-steps-list",item:({instance:n,item:a,index:t})=>["p-steps-item",{"p-steps-item-active":n.isActive(t),"p-disabled":n.isItemDisabled(a,t)}],itemLink:"p-steps-item-link",itemNumber:"p-steps-item-number",itemLabel:"p-steps-item-label"};let Q0=(()=>{class n extends Dl.j{name="steps";theme=ej;classes=tj;static \u0275fac=(()=>{let t;return function(i){return(t||(t=e.xGo(n)))(i||n)}})();static \u0275prov=e.jDH({token:n,factory:n.\u0275fac})}return n})(),rj=(()=>{class n extends Il.${activeIndex=0;model;readonly=!0;style;styleClass;exact=!0;activeIndexChange=new e.bkB;listViewChild;router=(0,e.WQX)(rn.Ix);route=(0,e.WQX)(rn.nX);_componentStyle=(0,e.WQX)(Q0);subscription;ngOnInit(){super.ngOnInit(),this.subscription=this.router.events.subscribe(()=>this.cd.markForCheck())}onItemClick(t,r,i){this.readonly||r.disabled?t.preventDefault():(this.activeIndexChange.emit(i),!r.url&&!r.routerLink&&t.preventDefault(),r.command&&r.command({originalEvent:t,item:r,index:i}))}onItemKeydown(t,r,i){switch(t.code){case"ArrowRight":this.navigateToNextItem(t.target),t.preventDefault();break;case"ArrowLeft":this.navigateToPrevItem(t.target),t.preventDefault();break;case"Home":this.navigateToFirstItem(t.target),t.preventDefault();break;case"End":this.navigateToLastItem(t.target),t.preventDefault();break;case"Tab":if(i!==this.activeIndex){const s=(0,fr.I6)(this.listViewChild.nativeElement,'[data-pc-section="menuitem"]');s[i].children[0].tabIndex="-1",s[this.activeIndex].children[0].tabIndex="0"}break;case"Enter":case"Space":this.onItemClick(t,r,i),t.preventDefault()}}navigateToNextItem(t){const r=this.findNextItem(t);r&&this.setFocusToMenuitem(t,r)}navigateToPrevItem(t){const r=this.findPrevItem(t);r&&this.setFocusToMenuitem(t,r)}navigateToFirstItem(t){const r=this.findFirstItem();r&&this.setFocusToMenuitem(t,r)}navigateToLastItem(t){const r=this.findLastItem();r&&this.setFocusToMenuitem(t,r)}findNextItem(t){const r=t.parentElement.nextElementSibling;return r?r.children[0]:null}findPrevItem(t){const r=t.parentElement.previousElementSibling;return r?r.children[0]:null}findFirstItem(){const t=(0,fr.kc)(this.listViewChild.nativeElement,'[data-pc-section="menuitem"]');return t?t.children[0]:null}findLastItem(){const t=(0,fr.I6)(this.listViewChild.nativeElement,'[data-pc-section="menuitem"]');return t?t[t.length-1].children[0]:null}setFocusToMenuitem(t,r){t.tabIndex="-1",r.tabIndex="0",r.focus()}isClickableRouterLink(t){return t.routerLink&&!this.readonly&&!t.disabled}isActive(t,r){if(t.routerLink){let i=Array.isArray(t.routerLink)?t.routerLink:[t.routerLink];return this.router.isActive(this.router.createUrlTree(i,{relativeTo:this.route}).toString(),!1)}return r===this.activeIndex}getItemTabIndex(t,r){return t.disabled?"-1":t.disabled||this.activeIndex!==r?t.tabindex??"-1":t.tabindex||"0"}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe(),super.ngOnDestroy()}static \u0275fac=(()=>{let t;return function(i){return(t||(t=e.xGo(n)))(i||n)}})();static \u0275cmp=e.VBU({type:n,selectors:[["p-steps"]],viewQuery:function(r,i){if(1&r&&e.GBs($R,5),2&r){let s;e.mGM(s=e.lsd())&&(i.listViewChild=s.first)}},inputs:{activeIndex:[2,"activeIndex","activeIndex",e.Udg],model:"model",readonly:[2,"readonly","readonly",e.L39],style:"style",styleClass:"styleClass",exact:[2,"exact","exact",e.L39]},outputs:{activeIndexChange:"activeIndexChange"}
1,features:[e.Jv_([Q0]),e.Vt3],decls:5,vars:8,consts:[["list",""],["menuitem",""],["elseBlock",""],["htmlLabel",""],["htmlRouteLabel",""],[3,"ngClass","ngStyle"],[1,"p-steps-list"],["pTooltip","",1,"p-steps-item",3,"ngStyle","class","tooltipOptions","ngClass"],["class","p-steps-item","pTooltip","",3,"ngStyle","class","tooltipOptions","ngClass",4,"ngIf"],["pTooltip","",1,"p-steps-item",3,"ngStyle","tooltipOptions","ngClass"],["role","link","class","p-steps-item-link",3,"routerLink","queryParams","routerLinkActiveOptions","target","fragment","queryParamsHandling","preserveFragment","skipLocationChange","replaceUrl","state","click","keydown",4,"ngIf","ngIfElse"],["role","link",1,"p-steps-item-link",3,"click","keydown","routerLink","queryParams","routerLinkActiveOptions","target","fragment","queryParamsHandling","preserveFragment","skipLocationChange","replaceUrl","state"],[1,"p-steps-item-number"],["class","p-steps-item-label",4,"ngIf","ngIfElse"],[1,"p-steps-item-label"],[1,"p-steps-item-label",3,"innerHTML"],["role","link",1,"p-steps-item-link",3,"click","keydown","target"]],template:function(r,i){1&r&&(e.j41(0,"nav",5)(1,"ul",6,0),e.Z7z(3,ZR,1,1,"li",7,YR),e.k0s()()),2&r&&(e.HbH(i.styleClass),e.Y8G("ngClass",e.eq3(6,VR,i.readonly))("ngStyle",i.style),e.BMQ("data-pc-name","steps"),e.R7$(),e.BMQ("data-pc-section","menu"),e.R7$(2),e.Dyx(i.model))},dependencies:[q.MD,q.YU,q.bT,q.B3,sr.iI,sr.Wk,wt.Ss,wt.m_,be.Gg],encapsulation:2,changeDetection:0})}return n})(),ij=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=e.$C({type:n});static \u0275inj=e.G2t({imports:[rj,be.Gg,be.Gg]})}return n})();var aj=ee(88150);let sj=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=e.$C({type:n});static \u0275inj=e.G2t({providers:[(0,Ks.$R)((0,Ks.b$)([OR.k])),_t.a,be.td,be.bg,Zi.f],imports:[q.MD,sr.iI,SR,At.Dw,Te.Fr,dn.k2,wt.Ss,ER.G,Se.bG,It.dD,zn.mC,Ur.ad,Ie.MB,Ie.y8,Yl.FP,Wl.Mk,Qe.um,L.YN,jt.lG,xe.tm,Qi.sv,Ve.Yj,De.iV,qa.P8,Zt.Qs.forRoot(),L.X1,Oe.py,MR,Ul.rO,PR.Ko,NR.D,Ae.k0,Ae.AM,An.tZ,pn.oz,pn.tU,pn.wb,Xr.q4,gc.mN,es.IP,GR.EJ,BR.WF,ji.eB,co.$C,vt.O3,Ai.df,Bl.uG,LR.bX,pn.jr,ij,aj.kr,S6,Bt.xs,Hl.Su,ns.E9,Bt.xs,dc.Z,Cc.Ic]})}return n})()},90262:function(Pl,Wa){var ee,sr;ee=function nt(){var or,lt=typeof self<"u"?self:typeof window<"u"?window:void 0!==lt?lt:{},Wn=!lt.document&&!!lt.postMessage,yn=lt.IS_PAPA_WORKER||!1,J={},Xt=0,je={};function Rn(N){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(B){var ie=Ji(B);ie.chunkSize=parseInt(ie.chunkSize),B.step||B.chunk||(ie.chunkSize=null),this._handle=new _t(ie),(this._handle.streamer=this)._config=ie}.call(this,N),this.parseChunk=function(B,ie){var Te=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<Te){let Ie=this._config.newline;Ie||(Ie=this._handle.guessLineEndings(B,Ce=this._config.quoteChar||'"')),B=[...B.split(Ie).slice(Te)].join(Ie)}this.isFirstChunk&&ct(this._config.beforeFirstChunk)&&void 0!==(Ce=this._config.beforeFirstChunk(B))&&(B=Ce),this.isFirstChunk=!1,this._halted=!1,Te=this._partialLine+B;var Ce=(this._partialLine="",this._handle.parse(Te,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(B=Ce.meta.cursor,this._finished||(this._partialLine=Te.substring(B-this._baseIndex),this._baseIndex=B),Ce&&Ce.data&&(this._rowCount+=Ce.data.length),Te=this._finished||this._config.preview&&this._rowCount>=this._config.preview,yn)lt.postMessage({results:Ce,workerId:je.WORKER_ID,finished:Te});else if(ct(this._config.chunk)&&!ie){if(this._config.chunk(Ce,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=Ce=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(Ce.data),this._completeResults.errors=this._completeResults.errors.concat(Ce.errors),this._completeResults.meta=Ce.meta),this._completed||!Te||!ct(this._config.complete)||Ce&&Ce.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),Te||Ce&&Ce.meta.paused||this._nextChunk(),Ce}this._halted=!0},this._sendError=function(B){ct(this._config.error)?this._config.error(B):yn&&this._config.error&<.postMessage({workerId:je.WORKER_ID,error:B,finished:!1})}}function nn(N){var B;(N=N||{}).chunkSize||(N.chunkSize=je.RemoteChunkSize),Rn.call(this,N),this._nextChunk=Wn?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(ie){this._input=ie,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(B=new XMLHttpRequest,this._config.withCredentials&&(B.withCredentials=this._config.withCredentials),Wn||(B.onload=mr(this._chunkLoaded,this),B.onerror=mr(this._chunkError,this)),B.open(this._config.downloadRequestBody?"POST":"GET",this._input,!Wn),this._config.downloadRequestHeaders){var ie,Te=this._config.downloadRequestHeaders;for(ie in Te)B.setRequestHeader(ie,Te[ie])}this._config.chunkSize&&B.setRequestHeader("Range","bytes="+this._start+"-"+(this._start+this._config.chunkSize-1));try{B.send(this._config.downloadRequestBody)}catch(Ie){this._chunkError(Ie.message)}Wn&&0===B.status&&this._chunkError()}},this._chunkLoaded=function(){var ie;4===B.readyState&&(B.status<200||400<=B.status?this._chunkError():(this._start+=this._config.chunkSize||B.responseText.length,this._finished=!this._config.chunkSize||this._start>=(null!==(ie=(ie=B).getResponseHeader("Content-Range"))?parseInt(ie.substring(ie.lastIndexOf("/")+1)):-1),this.parseChunk(B.responseText)))},this._chunkError=function(ie){ie=B.statusText||ie,this._sendError(new Error(ie))}}function Lr(N){(N=N||{}).chunkSize||(N.chunkSize=je.LocalChunkSize),Rn.call(this,N);var B,ie,Te=typeof FileReader<"u";this.stream=function(Ce){this._input=Ce,ie=Ce.slice||Ce.webkitSlice||Ce.mozSlice,Te?((B=new FileReader).onload=mr(this._chunkLoaded,this),B.onerror=mr(this._chunkError,this)):B=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var Ce=this._input,Ie=(this._config.chunkSize&&(Ie=Math.min(this._start+this._config.chunkSize,this._input.size),Ce=ie.call(Ce,this._start,Ie)),B.readAsText(Ce,this._config.encoding));Te||this._chunkLoaded({target:{result:Ie}})},this._chunkLoaded=function(Ce){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(Ce.target.result)},this._chunkError=function(){this._sendError(B.error)}}function ai(N){var B;Rn.call(this,N=N||{}),this.stream=function(ie){return B=ie,this._nextChunk()},this._nextChunk=function(){var ie,Te;if(!this._finished)return B=(ie=this._config.chunkSize)?(Te=B.substring(0,ie),B.substring(ie)):(Te=B,""),this._finished=!B,this.parseChunk(Te)}}function e(N){Rn.call(this,N=N||{});var B=[],ie=!0,Te=!1;this.pause=function(){Rn.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){Rn.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(Ce){this._input=Ce,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){Te&&1===B.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),B.length?this.parseChunk(B.shift()):ie=!0},this._streamData=mr(function(Ce){try{B.push("string"==typeof Ce?Ce:Ce.toString(this._config.encoding)),ie&&(ie=!1,this._checkIsFinished(),this.parseChunk(B.shift()))}catch(Ie){this._streamError(Ie)}},this),this._streamError=mr(function(Ce){this._streamCleanUp(),this._sendError(Ce)},this),this._streamEnd=mr(function(){this._streamCleanUp(),Te=!0,this._streamData("")},this),this._streamCleanUp=mr(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function _t(N){var B,ie,Te,Ce,Ie=Math.pow(2,53),Qe=-Ie,L=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,jt=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,xe=this,Ve=0,De=0,Zt=!1,Oe=!1,Ae=[],Se={data:[],errors:[],meta:{}};function It(Ue){return"greedy"===N.skipEmptyLines?""===Ue.join("").trim():1===Ue.length&&0===Ue[0].length}
1function vt(){if(Se&&Te&&(wt("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+je.DefaultDelimiter+"'"),Te=!1),N.skipEmptyLines&&(Se.data=Se.data.filter(function(bt){return!It(bt)})),Bt()){let bt=function(Yt,Ct){ct(N.transformHeader)&&(Yt=N.transformHeader(Yt,Ct)),Ae.push(Yt)};if(Se)if(Array.isArray(Se.data[0])){for(var Ue=0;Bt()&&Ue<Se.data.length;Ue++)Se.data[Ue].forEach(bt);Se.data.splice(0,1)}else Se.data.forEach(bt)}function et(bt,Yt){for(var Ct=N.header?{}:[],dt=0;dt<bt.length;dt++){var Ye=dt,an=bt[dt];it=Ye=N.header?dt>=Ae.length?"__parsed_extra":Ae[dt]:Ye,kt=an=N.transform?N.transform(an,Ye):an,void 0,Lt=it,N.dynamicTypingFunction&&void 0===N.dynamicTyping[Lt]&&(N.dynamicTyping[Lt]=N.dynamicTypingFunction(Lt)),an=!0===(N.dynamicTyping[Lt]||N.dynamicTyping)?"true"===kt||"TRUE"===kt||"false"!==kt&&"FALSE"!==kt&&((Lt=>{if(L.test(Lt)&&(Lt=parseFloat(Lt),Qe<Lt&&Lt<Ie))return 1})(kt)?parseFloat(kt):jt.test(kt)?new Date(kt):""===kt?null:kt):kt,"__parsed_extra"===Ye?(Ct[Ye]=Ct[Ye]||[],Ct[Ye].push(an)):Ct[Ye]=an}var it,kt,Lt;return N.header&&(dt>Ae.length?wt("FieldMismatch","TooManyFields","Too many fields: expected "+Ae.length+" fields but parsed "+dt,De+Yt):dt<Ae.length&&wt("FieldMismatch","TooFewFields","Too few fields: expected "+Ae.length+" fields but parsed "+dt,De+Yt)),Ct}var Et;Se&&(N.header||N.dynamicTyping||N.transform)&&(Et=1,!Se.data.length||Array.isArray(Se.data[0])?(Se.data=Se.data.map(et),Et=Se.data.length):Se.data=et(Se.data,0),N.header&&Se.meta&&(Se.meta.fields=Ae),De+=Et)}function Bt(){return N.header&&0===Ae.length}function wt(Ue,et,Et,Xe){Ue={type:Ue,code:et,message:Et},void 0!==Xe&&(Ue.row=Xe),Se.errors.push(Ue)}ct(N.step)&&(Ce=N.step,N.step=function(Ue){Se=Ue,Bt()?vt():(vt(),0!==Se.data.length&&(Ve+=Ue.data.length,N.preview&&Ve>N.preview?ie.abort():(Se.data=Se.data[0],Ce(Se,xe))))}),this.parse=function(Ue,et,Et){var Xe=N.quoteChar||'"';return N.newline||(N.newline=this.guessLineEndings(Ue,Xe)),Te=!1,N.delimiter?ct(N.delimiter)&&(N.delimiter=N.delimiter(Ue),Se.meta.delimiter=N.delimiter):((Xe=((bt,Yt,Ct,dt,Ye)=>{var an,it,kt,Lt;Ye=Ye||[",","\t","|",";",je.RECORD_SEP,je.UNIT_SEP];for(var $r=0;$r<Ye.length;$r++){for(var On,An=Ye[$r],At=0,dn=0,Wt=0,hn=(kt=void 0,new be({comments:dt,delimiter:An,newline:Yt,preview:10}).parse(bt)),lr=0;lr<hn.data.length;lr++)Ct&&It(hn.data[lr])?Wt++:(dn+=On=hn.data[lr].length,void 0===kt?kt=On:0<On&&(At+=Math.abs(On-kt),kt=On));0<hn.data.length&&(dn/=hn.data.length-Wt),(void 0===it||At<=it)&&(void 0===Lt||Lt<dn)&&1.99<dn&&(it=At,an=An,Lt=dn)}return{successful:!!(N.delimiter=an),bestDelimiter:an}})(Ue,N.newline,N.skipEmptyLines,N.comments,N.delimitersToGuess)).successful?N.delimiter=Xe.bestDelimiter:(Te=!0,N.delimiter=je.DefaultDelimiter),Se.meta.delimiter=N.delimiter),Xe=Ji(N),N.preview&&N.header&&Xe.preview++,B=Ue,ie=new be(Xe),Se=ie.parse(B,et,Et),vt(),Zt?{meta:{paused:!0}}:Se||{meta:{paused:!1}}},this.paused=function(){return Zt},this.pause=function(){Zt=!0,ie.abort(),B=ct(N.chunk)?"":B.substring(ie.getCharIndex())},this.resume=function(){xe.streamer._halted?(Zt=!1,xe.streamer.parseChunk(B,!0)):setTimeout(xe.resume,3)},this.aborted=function(){return Oe},this.abort=function(){Oe=!0,ie.abort(),Se.meta.aborted=!0,ct(N.complete)&&N.complete(Se),B=""},this.guessLineEndings=function(bt,Xe){bt=bt.substring(0,1048576),Xe=new RegExp(rt(Xe)+"([^]*?)"+rt(Xe),"gm");var Et=(bt=bt.replace(Xe,"")).split("\r");if(bt=1<(Xe=bt.split("\n")).length&&Xe[0].length<Et[0].length,1===Et.length||bt)return"\n";for(var Yt=0,Ct=0;Ct<Et.length;Ct++)"\n"===Et[Ct][0]&&Yt++;return Yt>=Et.length/2?"\r\n":"\r"}}function rt(N){return N.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function be(N){var B=(N=N||{}).delimiter,ie=N.newline,Te=N.comments,Ce=N.step,Ie=N.preview,Qe=N.fastMode,L=null,jt=!1,xe=null==N.quoteChar?'"':N.quoteChar,Ve=xe;if(void 0!==N.escapeChar&&(Ve=N.escapeChar),("string"!=typeof B||-1<je.BAD_DELIMITERS.indexOf(B))&&(B=","),Te===B)throw new Error("Comment character same as delimiter");!0===Te?Te="#":("string"!=typeof Te||-1<je.BAD_DELIMITERS.indexOf(Te))&&(Te=!1),"\n"!==ie&&"\r"!==ie&&"\r\n"!==ie&&(ie="\n");var De=0,Zt=!1;this.parse=function(Oe,Ae,Se){if("string"!=typeof Oe)throw new Error("Input must be a string");var It=Oe.length,vt=B.length,Bt=ie.length,wt=Te.length,Ue=ct(Ce),et=[],Et=[],Xe=[],bt=De=0;if(!Oe)return At();if(Qe||!1!==Qe&&-1===Oe.indexOf(xe)){for(var Yt=Oe.split(ie),Ct=0;Ct<Yt.length;Ct++){if(De+=(Xe=Yt[Ct]).length,Ct!==Yt.length-1)De+=ie.length;else if(Se)return At();if(!Te||Xe.substring(0,wt)!==Te){if(Ue){if(et=[],Lt(Xe.split(B)),dn(),Zt)return At()}else Lt(Xe.split(B));if(Ie&&Ie<=Ct)return et=et.slice(0,Ie),At(!0)}}return At()}for(var dt=Oe.indexOf(B,De),Ye=Oe.indexOf(ie,De),an=new RegExp(rt(Ve)+rt(xe),"g"),it=Oe.indexOf(xe,De);;)if(Oe[De]===xe)for(it=De,De++;;){if(-1===(it=Oe.indexOf(xe,it+1)))return Se||Et.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:et.length,index:De}),On();if(it===It-1)return On(Oe.substring(De,it).replace(an,xe));if(xe===Ve&&Oe[it+1]===Ve)it++;else if(xe===Ve||0===it||Oe[it-1]!==Ve){-1!==dt&&dt<it+1&&(dt=Oe.indexOf(B,it+1));
1var kt=$r(-1===(Ye=-1!==Ye&&Ye<it+1?Oe.indexOf(ie,it+1):Ye)?dt:Math.min(dt,Ye));if(Oe.substr(it+1+kt,vt)===B){Xe.push(Oe.substring(De,it).replace(an,xe)),Oe[De=it+1+kt+vt]!==xe&&(it=Oe.indexOf(xe,De)),dt=Oe.indexOf(B,De),Ye=Oe.indexOf(ie,De);break}if(kt=$r(Ye),Oe.substring(it+1+kt,it+1+kt+Bt)===ie){if(Xe.push(Oe.substring(De,it).replace(an,xe)),An(it+1+kt+Bt),dt=Oe.indexOf(B,De),it=Oe.indexOf(xe,De),Ue&&(dn(),Zt))return At();if(Ie&&et.length>=Ie)return At(!0);break}Et.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:et.length,index:De}),it++}}else if(Te&&0===Xe.length&&Oe.substring(De,De+wt)===Te){if(-1===Ye)return At();Ye=Oe.indexOf(ie,De=Ye+Bt),dt=Oe.indexOf(B,De)}else if(-1!==dt&&(dt<Ye||-1===Ye))Xe.push(Oe.substring(De,dt)),dt=Oe.indexOf(B,De=dt+vt);else{if(-1===Ye)break;if(Xe.push(Oe.substring(De,Ye)),An(Ye+Bt),Ue&&(dn(),Zt))return At();if(Ie&&et.length>=Ie)return At(!0)}return On();function Lt(Wt){et.push(Wt),bt=De}function $r(Wt){return-1!==Wt&&(Wt=Oe.substring(it+1,Wt))&&""===Wt.trim()?Wt.length:0}function On(Wt){return Se||(void 0===Wt&&(Wt=Oe.substring(De)),Xe.push(Wt),De=It,Lt(Xe),Ue&&dn()),At()}function An(Wt){De=Wt,Lt(Xe),Xe=[],Ye=Oe.indexOf(ie,De)}function At(Wt){if(N.header&&!Ae&&et.length&&!jt){var hn=et[0],lr=Object.create(null),Ki=new Set(hn);let Ha=!1;for(let Vr=0;Vr<hn.length;Vr++){let Hn=hn[Vr];if(lr[Hn=ct(N.transformHeader)?N.transformHeader(Hn,Vr):Hn]){let si,za=lr[Hn];for(;si=Hn+"_"+za,za++,Ki.has(si););Ki.add(si),hn[Vr]=si,lr[Hn]++,Ha=!0,(L=null===L?{}:L)[si]=Hn}else lr[Hn]=1,hn[Vr]=Hn;Ki.add(Hn)}Ha&&console.warn("Duplicate headers found and renamed."),jt=!0}return{data:et,errors:Et,meta:{delimiter:B,linebreak:ie,aborted:Zt,truncated:!!Wt,cursor:bt+(Ae||0),renamedHeaders:L}}}function dn(){Ce(At()),et=[],Et=[]}},this.abort=function(){Zt=!0},this.getCharIndex=function(){return De}}function rn(N){var B=N.data,ie=J[B.workerId],Te=!1;if(B.error)ie.userError(B.error,B.file);else if(B.results&&B.results.data){var Ce={abort:function(){Te=!0,Ri(B.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:jn,resume:jn};if(ct(ie.userStep)){for(var Ie=0;Ie<B.results.data.length&&(ie.userStep({data:B.results.data[Ie],errors:B.results.errors,meta:B.results.meta},Ce),!Te);Ie++);delete B.results}else ct(ie.userChunk)&&(ie.userChunk(B.results,Ce,B.file),delete B.results)}B.finished&&!Te&&Ri(B.workerId,B.results)}function Ri(N,B){var ie=J[N];ct(ie.userComplete)&&ie.userComplete(B),ie.terminate(),delete J[N]}function jn(){throw new Error("Not implemented.")}function Ji(N){if("object"!=typeof N||null===N)return N;var B,ie=Array.isArray(N)?[]:{};for(B in N)ie[B]=Ji(N[B]);return ie}function mr(N,B){return function(){N.apply(B,arguments)}}function ct(N){return"function"==typeof N}return je.parse=function(N,B){var Te,ie=(B=B||{}).dynamicTyping||!1;if(ct(ie)&&(B.dynamicTypingFunction=ie,ie={}),B.dynamicTyping=ie,B.transform=!!ct(B.transform)&&B.transform,!B.worker||!je.WORKERS_SUPPORTED)return ie=null,"string"==typeof N?(N=65279!==(Te=N).charCodeAt(0)?Te:Te.slice(1),ie=new(B.download?nn:ai)(B)):!0===N.readable&&ct(N.read)&&ct(N.on)?ie=new e(B):(lt.File&&N instanceof File||N instanceof Object)&&(ie=new Lr(B)),ie.stream(N);(ie=(()=>{var Te,Ce,Ie;return!!je.WORKERS_SUPPORTED&&(Ce=lt.URL||lt.webkitURL||null,Ie=nt.toString(),Te=je.BLOB_URL||(je.BLOB_URL=Ce.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",Ie,")();"],{type:"text/javascript"}))),(Te=new lt.Worker(Te)).onmessage=rn,Te.id=Xt++,J[Te.id]=Te)})()).userStep=B.step,ie.userChunk=B.chunk,ie.userComplete=B.complete,ie.userError=B.error,B.step=ct(B.step),B.chunk=ct(B.chunk),B.complete=ct(B.complete),B.error=ct(B.error),delete B.worker,ie.postMessage({input:N,config:B,workerId:ie.id})},je.unparse=function(N,B){var ie=!1,Te=!0,Ce=",",Ie="\r\n",Qe='"',L=Qe+Qe,jt=!1,xe=null,Ve=!1,De=((()=>
1{if("object"==typeof B){if("string"!=typeof B.delimiter||je.BAD_DELIMITERS.filter(function(Ae){return-1!==B.delimiter.indexOf(Ae)}).length||(Ce=B.delimiter),"boolean"!=typeof B.quotes&&"function"!=typeof B.quotes&&!Array.isArray(B.quotes)||(ie=B.quotes),"boolean"!=typeof B.skipEmptyLines&&"string"!=typeof B.skipEmptyLines||(jt=B.skipEmptyLines),"string"==typeof B.newline&&(Ie=B.newline),"string"==typeof B.quoteChar&&(Qe=B.quoteChar),"boolean"==typeof B.header&&(Te=B.header),Array.isArray(B.columns)){if(0===B.columns.length)throw new Error("Option columns is empty");xe=B.columns}void 0!==B.escapeChar&&(L=B.escapeChar+Qe),B.escapeFormulae instanceof RegExp?Ve=B.escapeFormulae:"boolean"==typeof B.escapeFormulae&&B.escapeFormulae&&(Ve=/^[=+\-@\t\r].*$/)}})(),new RegExp(rt(Qe),"g"));if("string"==typeof N&&(N=JSON.parse(N)),Array.isArray(N)){if(!N.length||Array.isArray(N[0]))return Zt(null,N,jt);if("object"==typeof N[0])return Zt(xe||Object.keys(N[0]),N,jt)}else if("object"==typeof N)return"string"==typeof N.data&&(N.data=JSON.parse(N.data)),Array.isArray(N.data)&&(N.fields||(N.fields=N.meta&&N.meta.fields||xe),N.fields||(N.fields=Array.isArray(N.data[0])?N.fields:"object"==typeof N.data[0]?Object.keys(N.data[0]):[]),Array.isArray(N.data[0])||"object"==typeof N.data[0]||(N.data=[N.data])),Zt(N.fields||[],N.data||[],jt);throw new Error("Unable to serialize unrecognized input");function Zt(Ae,Se,It){var vt="",Bt=("string"==typeof Ae&&(Ae=JSON.parse(Ae)),"string"==typeof Se&&(Se=JSON.parse(Se)),Array.isArray(Ae)&&0<Ae.length),wt=!Array.isArray(Se[0]);if(Bt&&Te){for(var Ue=0;Ue<Ae.length;Ue++)0<Ue&&(vt+=Ce),vt+=Oe(Ae[Ue],Ue);0<Se.length&&(vt+=Ie)}for(var et=0;et<Se.length;et++){var Et=(Bt?Ae:Se[et]).length,Xe=!1,bt=Bt?0===Object.keys(Se[et]).length:0===Se[et].length;if(It&&!Bt&&(Xe="greedy"===It?""===Se[et].join("").trim():1===Se[et].length&&0===Se[et][0].length),"greedy"===It&&Bt){for(var Yt=[],Ct=0;Ct<Et;Ct++)Yt.push(Se[et][wt?Ae[Ct]:Ct]);Xe=""===Yt.join("").trim()}if(!Xe){for(var Ye=0;Ye<Et;Ye++)0<Ye&&!bt&&(vt+=Ce),vt+=Oe(Se[et][Bt&&wt?Ae[Ye]:Ye],Ye);et<Se.length-1&&(!It||0<Et&&!bt)&&(vt+=Ie)}}return vt}function Oe(Ae,Se){var It,vt;return null==Ae?"":Ae.constructor===Date?JSON.stringify(Ae).slice(1,25):(vt=!1,Ve&&"string"==typeof Ae&&Ve.test(Ae)&&(Ae="'"+Ae,vt=!0),It=Ae.toString().replace(De,L),(vt=vt||!0===ie||"function"==typeof ie&&ie(Ae,Se)||Array.isArray(ie)&&ie[Se]||((Bt,wt)=>{for(var Ue=0;Ue<wt.length;Ue++)if(-1<Bt.indexOf(wt[Ue]))return!0;return!1})(It,je.BAD_DELIMITERS)||-1<It.indexOf(Ce)||" "===It.charAt(0)||" "===It.charAt(It.length-1))?Qe+It+Qe:It)}},je.RECORD_SEP="\x1e",je.UNIT_SEP="\x1f",je.BYTE_ORDER_MARK="\ufeff",je.BAD_DELIMITERS=["\r","\n",'"',je.BYTE_ORDER_MARK],je.WORKERS_SUPPORTED=!Wn&&!!lt.Worker,je.NODE_STREAM_INPUT=1,je.LocalChunkSize=10485760,je.RemoteChunkSize=5242880,je.DefaultDelimiter=",",je.Parser=be,je.ParserHandle=_t,je.NetworkStreamer=nn,je.FileStreamer=Lr,je.StringStreamer=ai,je.ReadableStreamStreamer=e,lt.jQuery&&((or=lt.jQuery).fn.parse=function(N){var B=N.config||{},ie=[];return this.each(function(Ie){if("INPUT"!==or(this).prop("tagName").toUpperCase()||"file"!==or(this).attr("type").toLowerCase()||!lt.FileReader||!this.files||0===this.files.length)return!0;for(var Qe=0;Qe<this.files.length;Qe++)ie.push({file:this.files[Qe],inputElem:this,instanceConfig:or.extend({},B)})}),Te(),this;function Te(){if(0===ie.length)ct(N.complete)&&N.complete();else{var Qe,L,jt,xe=ie[0];if(ct(N.before)){var Ve=N.before(xe.file,xe.inputElem);if("object"==typeof Ve){if("abort"===Ve.action)return Qe=xe.file,L=xe.inputElem,jt=Ve.reason,void(ct(N.error)&&N.error({name:"AbortError"},Qe,L,jt));if("skip"===Ve.action)return void Ce();"object"==typeof Ve.config&&(xe.instanceConfig=or.extend(xe.instanceConfig,Ve.config))}else if("skip"===Ve)return void Ce()}var De=xe.instanceConfig.complete;xe.instanceConfig.complete=function(Zt){ct(De)&&De(Zt,xe.file,xe.inputElem),Ce()},je.parse(xe.file,xe.instanceConfig)}}function Ce(){ie.splice(0,1),Te()}}),yn&&(lt.onmessage=function(N){N=N.data,void 0===je.WORKER_ID&&N&&(je.WORKER_ID=N.workerId),"string"==typeof N.input?lt.postMessage({workerId:je.WORKER_ID,results:je.parse(N.input,N.config),finished:!0}):(lt.File&&N.input instanceof File||N.input instanceof Object)&&(N=je.parse(N.input,N.config))&<.postMessage({workerId:je.WORKER_ID,results:N,finished:!0})}),(nn.prototype=Object.create(Rn.prototype)).constructor=nn,(Lr.prototype=Object.create(Rn.prototype)).constructor=Lr,(ai.prototype=Object.create(ai.prototype)).constructor=ai,(e.prototype=Object.create(Rn.prototype)).constructor=e,je},void 0!==(sr=ee.apply(Wa,[]))&&(Pl.exports=sr)}}]);
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.