diff --git a/index.js b/index.js
index 1b7eaab..1c7b21c 100644
--- a/index.js
+++ b/index.js
@@ -1 +1,38 @@
-(function () {function cb(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return I(e).getMonth()}function I(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn(new Error().stack)),new Date(NaN))}function sa(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=I(t),a=xa(e),$=r.getMonth()+a,n=new Date(0);n.setFullYear(r.getFullYear(),$,1),n.setHours(0,0,0,0);var o=Pa(n);return r.setMonth($,Math.min(o,r.getDate())),r}function xa(r){if(null===r||!0===r||!1===r)return NaN;var t=Number(r);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function Pa(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=I(e),r=t.getFullYear(),$=t.getMonth(),a=new Date(0);return a.setFullYear(r,$+1,0),a.setHours(0,0,0,0),a.getDate()}function Xa(e,r){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var t=xa(r);return sa(e,-t)}function M(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return I(e).getFullYear()}var t={data:function(){return{currentDate:new Date,currentMonthName:null,currentMonth:null,currentYear:null,headline:null,episodes:[],error:null,podcasterSlug:null}},created:function(){this.setNewDateVars()},mounted:function(){this.podcasterSlug=this.sanitizeTitle(this.pageValues.podcastertitle),this.getStats()},computed:{id:function(){return this.$store.state.form.current},pageValues:function(){return this.$store.getters["form/values"](this.id)}},watch:{currentDate:{immediate:!1,handler:function(t,e){this.getStats()}}},methods:{getStats:function(){var t=this;fetch("/api/podcaster/stats/"+this.podcasterSlug+"/year/"+this.currentYear+"/month/"+(this.currentMonth+1),{method:"GET",headers:{"X-CSRF":panel.csrf}}).then(function(t){if(200!==t.status)throw"You are tracking your downloads, using the file method. Stats are currently available only when using mysql";return t}).then(function(t){return t.json()}).then(function(e){t.episodes=t.computeStats(e.stats)}).catch(function(e){t.error=e,console.log(t.error)})},computeStats:function(t){return t.episodes.map(function(t){return{title:t.episode.replace(/-/g," "),downloads:t.downloaded}})},prevMonth:function(){var t=Xa(this.currentDate,1);this.currentDate=t,this.setNewDateVars()},nextMonth:function(){var t=sa(this.currentDate,1);this.currentDate=t,this.setNewDateVars()},setNewDateVars:function(){this.currentMonth=cb(this.currentDate),this.currentYear=M(this.currentDate),this.currentMonthName=this.currentDate.toLocaleString("en",{month:"long"}),this.headline="Stats for "+this.currentMonthName+" "+this.currentYear},sanitizeTitle:function(t){return t.toLowerCase().replace(/e|é|è|ẽ|ẻ|ẹ|ê|ế|ề|ễ|ể|ệ/gi,"e").replace(/a|á|à|ã|ả|ạ|ă|ắ|ằ|ẵ|ẳ|ặ|â|ấ|ầ|ẫ|ẩ|ậ/gi,"a").replace(/o|ó|ò|õ|ỏ|ọ|ô|ố|ồ|ỗ|ổ|ộ|ơ|ớ|ờ|ỡ|ở|ợ/gi,"o").replace(/u|ú|ù|ũ|ủ|ụ|ư|ứ|ừ|ữ|ử|ự/gi,"u").replace(/đ/gi,"d").replace(/\s*$/g,"").replace(/\s+/g,"-")}}};if(typeof t==="function"){t=t.options}Object.assign(t,function(){var render=function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c("section",{staticClass:"k-modified-section"},[_c("div",{staticClass:"podcaster-prev-next"},[_c("button",{staticClass:"k-link k-button",on:{"click":_vm.prevMonth}},[_c("k-icon",{attrs:{"type":"angle-left"}})],1),_vm._v(" "),_c("button",{staticClass:"k-link k-button",on:{"click":_vm.nextMonth}},[_c("k-icon",{attrs:{"type":"angle-right"}})],1)]),_vm._v(" "),_c("k-text",[_vm._v(_vm._s(_vm.error))]),_vm._v(" "),_c("k-headline",[_vm._v(_vm._s(_vm.headline))]),_vm._v(" "),_c("table",{attrs:{"id":"episodeStats"}},_vm._l(_vm.episodes,function(episode){return _c("tr",[_c("td",[_vm._v(_vm._s(episode.downloads))]),_vm._v(" "),_c("td",[_vm._v(_vm._s(episode.title))])])}),0)],1)};var staticRenderFns=[];return{render:render,staticRenderFns:staticRenderFns,_compiled:true,_scopeId:null,functional:undefined}}());function h(t,e){return"string"==typeof t?(e||document).querySelector(t):t||null}function A(t){let e=t.getBoundingClientRect();return{top:e.top+(document.documentElement.scrollTop||document.body.scrollTop),left:e.left+(document.documentElement.scrollLeft||document.body.scrollLeft)}}function fb(t){var e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}function Cb(t){var e=window.getComputedStyle(t),a=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight);return t.clientWidth-a}function Ha(t,e,a){var i=document.createEvent("HTMLEvents");for(var s in i.initEvent(e,!0,!0),a)i[s]=a[s];return t.dispatchEvent(i)}h.create=(t,e)=>{var a=document.createElement(t);for(var i in e){var s=e[i];if("inside"===i)h(s).appendChild(a);else if("around"===i){var r=h(s);r.parentNode.insertBefore(a,r),a.appendChild(r)}else"styles"===i?"object"==typeof s&&Object.keys(s).map(t=>{a.style[t]=s[t]}):i in a?a[i]=s:a.setAttribute(i,s)}return a};const Ma={margins:{top:10,bottom:10,left:20,right:20},paddings:{top:20,bottom:40,left:30,right:10},baseHeight:240,titleHeight:20,legendHeight:30,titleFontSize:12};function r(t){return t.titleHeight+t.margins.top+t.paddings.top}function E(t){return t.margins.left+t.paddings.left}function ua(t){return t.margins.top+t.margins.bottom+t.paddings.top+t.paddings.bottom+t.titleHeight+t.legendHeight}function F(t){return t.margins.left+t.margins.right+t.paddings.left+t.paddings.right}const lb=700,ob=400,wb=["line","bar"],ra=100,Ob=.5,Aa=.01,Ca=4,Ea=20,qa=2,O=5,n=10,Va=7,Wa=5,a=["light-blue","blue","violet","red","orange","yellow","green","light-green","purple","magenta","light-grey","dark-grey"],Ya=["#ebedf0","#c6e48b","#7bc96f","#239a3b","#196127"],Za={bar:a,line:a,pie:a,percentage:a,heatmap:Ya,donut:a},na=Math.PI/180,ma=360;class ib{constructor({parent:t=null,colors:e=[]}){this.parent=t,this.colors=e,this.titleName="",this.titleValue="",this.listValues=[],this.titleValueFirst=0,this.x=0,this.y=0,this.top=0,this.left=0,this.setup()}setup(){this.makeTooltip()}refresh(){this.fill(),this.calcPosition()}makeTooltip(){this.container=h.create("div",{inside:this.parent,className:"graph-svg-tip comparison",innerHTML:"\n\t\t\t\t
\n\t\t\t\t"}),this.hideTip(),this.title=this.container.querySelector(".title"),this.dataPointList=this.container.querySelector(".data-point-list"),this.parent.addEventListener("mouseleave",()=>{this.hideTip()})}fill(){let t;this.index&&this.container.setAttribute("data-point-index",this.index),t=this.titleValueFirst?`${this.titleValue}${this.titleName}`:`${this.titleName}${this.titleValue}`,this.title.innerHTML=t,this.dataPointList.innerHTML="",this.listValues.map((t,e)=>{const a=this.colors[e]||"black";let i=0===t.formatted||t.formatted?t.formatted:t.value,s=h.create("li",{styles:{"border-top":`3px solid ${a}`},innerHTML:`${0===i||i?i:""}\n\t\t\t\t\t${t.title?t.title:""}`});this.dataPointList.appendChild(s)})}calcPosition(){let t=this.container.offsetWidth;this.top=this.y-this.container.offsetHeight-Wa,this.left=this.x-t/2;let e=this.parent.offsetWidth-t,a=this.container.querySelector(".svg-pointer");if(this.left<0)a.style.left=`calc(50% - ${-1*this.left}px)`,this.left=0;else if(this.left>e){let t=`calc(50% + ${this.left-e}px)`;a.style.left=t,this.left=e}else a.style.left="50%"}setValues(t,e,a={},i=[],s=-1){this.titleName=a.name,this.titleValue=a.value,this.listValues=i,this.x=t,this.y=e,this.titleValueFirst=a.valueFirst||0,this.index=s,this.refresh()}hideTip(){this.container.style.top="0px",this.container.style.left="0px",this.container.style.opacity="0"}showTip(){this.container.style.top=this.top+"px",this.container.style.left=this.left+"px",this.container.style.opacity="1"}}function la(t){return parseFloat(t.toFixed(2))}function Q(t,e,a,i=!1){a||(a=i?t[0]:t[t.length-1]);let s=new Array(Math.abs(e)).fill(a);return t=i?s.concat(t):t.concat(s)}function ea(t,e){return(t+"").length*e}function q(t,e){return{x:Math.sin(t*na)*e,y:Math.cos(t*na)*e}}function aa(t,e){let a,i;return t<=e?(a=e-t,i=t):(a=t-e,i=e),[a,i]}function d(t,e,a=e.length-t.length){return a>0?t=Q(t,a):e=Q(e,a),[t,e]}const Ba={"light-blue":"#7cd6fd",blue:"#5e64ff",violet:"#743ee2",red:"#ff5858",orange:"#ffa00a",yellow:"#feef72",green:"#28a745","light-green":"#98d85b",purple:"#b554ff",magenta:"#ffa3ef",black:"#36114C",grey:"#bdd3e6","light-grey":"#f0f4f7","dark-grey":"#b8c2cc"};function W(t){return t>255?255:t<0?0:t}function U(t,e){let a=$(t),i=!1;"#"==a[0]&&(a=a.slice(1),i=!0);let s=parseInt(a,16),r=W((s>>16)+e),n=W((s>>8&255)+e);return(i?"#":"")+(W((255&s)+e)|n<<8|r<<16).toString(16)}function Fa(t){return /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)}const $=t=>Ba[t]||t,m=6,g=4,c=10,u="#dadada",S="#555b51";function ja(t,e){return"string"==typeof t?(e||document).querySelector(t):t||null}function b(t,e){var a=document.createElementNS("http://www.w3.org/2000/svg",t);for(var i in e){var s=e[i];if("inside"===i)ja(s).appendChild(a);else if("around"===i){var r=ja(s);r.parentNode.insertBefore(a,r),a.appendChild(r)}else"styles"===i?"object"==typeof s&&Object.keys(s).map(t=>{a.style[t]=s[t]}):("className"===i&&(i="class"),"innerHTML"===i?a.textContent=s:a.setAttribute(i,s))}return a}function $a(t,e){return b("linearGradient",{inside:t,id:e,x1:0,x2:0,y1:0,y2:1})}function P(t,e,a,i){return b("stop",{inside:t,style:`stop-color: ${a}`,offset:e,"stop-opacity":i})}function db(t,e,a,i){return b("svg",{className:e,inside:t,width:a,height:i})}function eb(t){return b("defs",{inside:t})}function L(t,e="",a){let i={className:t,transform:e};return a&&(i.inside=a),b("g",i)}function J(t,e="",a="none",i="none",s=0){return b("path",{className:e,d:t,styles:{stroke:a,fill:i,"stroke-width":s}})}function jb(t,e,a,i,s=1,r=0){let[n,o]=[a.x+t.x,a.y+t.y],[$,l]=[a.x+e.x,a.y+e.y];return`M${a.x} ${a.y}\n\t\tL${n} ${o}\n\t\tA ${i} ${i} 0 ${r} ${s?1:0}\n\t\t${$} ${l} z`}function kb(t,e,a,i,s=1){let[r,n]=[a.x+t.x,a.y+t.y],[o,$]=[a.x+e.x,a.y+e.y];return`M${r} ${n}\n\t\tA ${i} ${i} 0 0 ${s?1:0}\n\t\t${o} ${$}`}function da(t,e,a=!1){let i="path-fill-gradient-"+e+"-"+(a?"lighter":"default"),s=$a(t,i),r=[1,.6,.2];return a&&(r=[.4,.2,0]),P(s,"0%",e,r[0]),P(s,"50%",e,r[1]),P(s,"100%",e,r[2]),i}function nb(t,e,a,i,s=qa,r="none"){return b("rect",{className:"percentage-bar",x:t,y:e,width:a,height:i,fill:r,styles:{stroke:U(r,-25),"stroke-dasharray":`0, ${i+a}, ${a}, ${i}`,"stroke-width":s}})}function va(t,e,a,i,s="none",r={}){let n={className:t,x:e,y:a,width:i,height:i,fill:s};return Object.keys(r).map(t=>{n[t]=r[t]}),b("rect",n)}function rb(t,e,a,i="none",s){let r={className:"legend-bar",x:0,y:0,width:a,height:"2px",fill:i},n=b("text",{className:"legend-dataset-text",x:0,y:0,dy:2*c+"px","font-size":1.2*c+"px","text-anchor":"start",fill:S,innerHTML:s}),o=b("g",{transform:`translate(${t}, ${e})`});return o.appendChild(b("rect",r)),o.appendChild(n),o}function tb(t,e,a,i="none",s){let r={className:"legend-dot",cx:0,cy:0,r:a,fill:i},n=b("text",{className:"legend-dataset-text",x:0,y:0,dx:c+"px",dy:c/3+"px","font-size":1.2*c+"px","text-anchor":"start",fill:S,innerHTML:s}),o=b("g",{transform:`translate(${t}, ${e})`});return o.appendChild(b("circle",r)),o.appendChild(n),o}function C(t,e,a,i,s={}){let r=s.fontSize||c;return b("text",{className:t,x:e,y:a,dy:(void 0!==s.dy?s.dy:r/2)+"px","font-size":r+"px",fill:s.fill||S,"text-anchor":s.textAnchor||"start",innerHTML:i})}function yb(t,e,a,i,s={}){s.stroke||(s.stroke=u);let r=b("line",{className:"line-vertical "+s.className,x1:0,x2:0,y1:a,y2:i,styles:{stroke:s.stroke}}),n=b("text",{x:0,y:a>i?a+g:a-g-c,dy:c+"px","font-size":c+"px","text-anchor":"middle",innerHTML:e+""}),o=b("g",{transform:`translate(${t}, 0)`});return o.appendChild(r),o.appendChild(n),o}function pa(t,e,a,i,s={}){s.stroke||(s.stroke=u),s.lineType||(s.lineType="");let r=b("line",{className:"line-horizontal "+s.className+("dashed"===s.lineType?"dashed":""),x1:a,x2:i,y1:0,y2:0,styles:{stroke:s.stroke}}),n=b("text",{x:at[a]+","+e).join("L"),n=J("M"+r,"line-graph-path",a);if(i.heatline){let t=da(s.svgDefs,a);n.style.stroke=`url(#${t})`}let o={path:n};if(i.regionFill){let e=da(s.svgDefs,a,!0),i="M"+`${t[0]},${s.zeroLine}L`+r+`L${t.slice(-1)[0]},${s.zeroLine}`;o.region=J(i,"region-fill","none",`url(#${e})`)}return o}let Qb={bar:t=>{let e;"rect"!==t.nodeName&&(e=t.getAttribute("transform"),t=t.childNodes[0]);let a=t.cloneNode();return a.style.fill="#000000",a.style.opacity="0.4",e&&a.setAttribute("transform",e),a},dot:t=>{let e;"circle"!==t.nodeName&&(e=t.getAttribute("transform"),t=t.childNodes[0]);let a=t.cloneNode(),i=t.getAttribute("r"),s=t.getAttribute("fill");return a.setAttribute("r",parseInt(i)+4),a.setAttribute("fill",s),a.style.opacity="0.6",e&&a.setAttribute("transform",e),a},heat_square:t=>{let e;"circle"!==t.nodeName&&(e=t.getAttribute("transform"),t=t.childNodes[0]);let a=t.cloneNode(),i=t.getAttribute("r"),s=t.getAttribute("fill");return a.setAttribute("r",parseInt(i)+4),a.setAttribute("fill",s),a.style.opacity="0.6",e&&a.setAttribute("transform",e),a}},za={bar:(t,e)=>{let a;"rect"!==t.nodeName&&(a=t.getAttribute("transform"),t=t.childNodes[0]);let i=["x","y","width","height"];Object.values(t.attributes).filter(t=>i.includes(t.name)&&t.specified).map(t=>{e.setAttribute(t.name,t.nodeValue)}),a&&e.setAttribute("transform",a)},dot:(t,e)=>{let a;"circle"!==t.nodeName&&(a=t.getAttribute("transform"),t=t.childNodes[0]);let i=["cx","cy"];Object.values(t.attributes).filter(t=>i.includes(t.name)&&t.specified).map(t=>{e.setAttribute(t.name,t.nodeValue)}),a&&e.setAttribute("transform",a)},heat_square:(t,e)=>{let a;"circle"!==t.nodeName&&(a=t.getAttribute("transform"),t=t.childNodes[0]);let i=["cx","cy"];Object.values(t.attributes).filter(t=>i.includes(t.name)&&t.specified).map(t=>{e.setAttribute(t.name,t.nodeValue)}),a&&e.setAttribute("transform",a)}};const B=350,fa=350,v=B,Da=250,j="easein";function w(t,e,a,i){let s="string"==typeof e?e:e.join(", ");return[t,{transform:a.join(", ")},i,j,"translate",{transform:s}]}function Ga(t,e,a){return w(t,[a,0],[e,0],v)}function Z(t,e,a){return w(t,[0,a],[0,e],v)}function Ia(t,e,a,i){let s=e-a,r=t.childNodes[0],n=r.getAttribute("width");return[[r,{height:s,"stroke-dasharray":`${n}, ${s}`},v,j],w(t,[0,i],[0,a],v)]}function Ja(t,e,a,i,s=0,r={}){let[n,o]=aa(a,r.zeroLine);if(o-=s,"rect"!==t.nodeName){let a=[t.childNodes[0],{width:i,height:n},B,j],s=t.getAttribute("transform").split("(")[1].slice(0,-1);return[a,w(t,s,[e,o],v)]}return[[t,{width:i,height:n,x:e,y:o},B,j]]}function Ka(t,e,a){if("circle"!==t.nodeName){let i=t.getAttribute("transform").split("(")[1].slice(0,-1);return[w(t,i,[e,a],v)]}return[[t,{cx:e,cy:a},B,j]]}function La(t,e,a,i){let s=[],r=a.map((t,a)=>e[a]+","+t).join("L");const n=[t.path,{d:"M"+r},fa,j];if(s.push(n),t.region){let a=`${e[0]},${i}L`,n=`L${e.slice(-1)[0]}, ${i}`;const o=[t.region,{d:"M"+a+r+n},fa,j];s.push(o)}return s}function Y(t,e){return[t,{d:e},B,j]}const Na={ease:"0.25 0.1 0.25 1",linear:"0 0 1 1",easein:"0.1 0.8 0.2 1",easeout:"0 0 0.58 1",easeinout:"0.42 0 0.58 1"};function Oa(t,e,a,i="linear",s,r={}){let n=t.cloneNode(!0),o=t.cloneNode(!0);for(var $ in e){let u;u="transform"===$?document.createElementNS("http://www.w3.org/2000/svg","animateTransform"):document.createElementNS("http://www.w3.org/2000/svg","animate");let h=r[$]||t.getAttribute($),d=e[$],c={attributeName:$,from:h,to:d,begin:"0s",dur:a/1e3+"s",values:h+";"+d,keySplines:Na[i],keyTimes:"0;1",calcMode:"spline",fill:"freeze"};for(var l in s&&(c.type=s),c)u.setAttribute(l,c[l]);n.appendChild(u),s?o.setAttribute($,`translate(${d})`):o.setAttribute($,d)}return[n,o]}function D(t,e){t.style.transform=e,t.style.webkitTransform=e,t.style.msTransform=e,t.style.mozTransform=e,t.style.oTransform=e}function Qa(t,e){let a=[],i=[];e.map(t=>{let e,s,r=t[0],n=r.parentNode;t[0]=r,[e,s]=Oa(...t),a.push(s),i.push([e,n]),n.replaceChild(e,r)});let s=t.cloneNode(!0);return i.map((t,i)=>{t[1].replaceChild(a[i],t[0]),e[i][0]=a[i]}),s}function Ra(t,e,a){if(0===a.length)return;let i=Qa(e,a);e.parentNode==t&&(t.removeChild(e),t.appendChild(i)),setTimeout(()=>{i.parentNode==t&&(t.removeChild(i),t.appendChild(e))},Da)}const Sa=".chart-container{position:relative;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Roboto','Oxygen','Ubuntu','Cantarell','Fira Sans','Droid Sans','Helvetica Neue',sans-serif}.chart-container .axis,.chart-container .chart-label{fill:#555b51}.chart-container .axis line,.chart-container .chart-label line{stroke:#dadada}.chart-container .dataset-units circle{stroke:#fff;stroke-width:2}.chart-container .dataset-units path{fill:none;stroke-opacity:1;stroke-width:2px}.chart-container .dataset-path{stroke-width:2px}.chart-container .path-group path{fill:none;stroke-opacity:1;stroke-width:2px}.chart-container line.dashed{stroke-dasharray:5,3}.chart-container .axis-line .specific-value{text-anchor:start}.chart-container .axis-line .y-line{text-anchor:end}.chart-container .axis-line .x-line{text-anchor:middle}.chart-container .legend-dataset-text{fill:#6c7680;font-weight:600}.graph-svg-tip{position:absolute;z-index:99999;padding:10px;font-size:12px;color:#959da5;text-align:center;background:rgba(0,0,0,.8);border-radius:3px}.graph-svg-tip ul{padding-left:0;display:flex}.graph-svg-tip ol{padding-left:0;display:flex}.graph-svg-tip ul.data-point-list li{min-width:90px;flex:1;font-weight:600}.graph-svg-tip strong{color:#dfe2e5;font-weight:600}.graph-svg-tip .svg-pointer{position:absolute;height:5px;margin:0 0 0 -5px;content:' ';border:5px solid transparent;border-top-color:rgba(0,0,0,.8)}.graph-svg-tip.comparison{padding:0;text-align:left;pointer-events:none}.graph-svg-tip.comparison .title{display:block;padding:10px;margin:0;font-weight:600;line-height:1;pointer-events:none}.graph-svg-tip.comparison ul{margin:0;white-space:nowrap;list-style:none}.graph-svg-tip.comparison li{display:inline-block;padding:5px 10px}";function Ta(t,e){var a=document.createElement("a");a.style="display: none";var i=new Blob(e,{type:"image/svg+xml; charset=utf-8"}),s=window.URL.createObjectURL(i);a.href=s,a.download=t,document.body.appendChild(a),a.click(),setTimeout(function(){document.body.removeChild(a),window.URL.revokeObjectURL(s)},300)}function Ua(t){let e=t.cloneNode(!0);e.classList.add("chart-container"),e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink");let a=h.create("style",{innerHTML:Sa});e.insertBefore(a,e.firstChild);let i=h.create("div");return i.appendChild(e),i.innerHTML}let ka;class V{constructor(t,e){if(this.parent="string"==typeof t?document.querySelector(t):t,!(this.parent instanceof HTMLElement))throw new Error("No `parent` element to render on was provided.");this.rawChartArgs=e,this.title=e.title||"",this.type=e.type||"",this.realData=this.prepareData(e.data),this.data=this.prepareFirstData(this.realData),this.colors=this.validateColors(e.colors,this.type),this.config={showTooltip:1,showLegend:1,isNavigable:e.isNavigable||0,animate:1},this.measures=JSON.parse(JSON.stringify(Ma));let a=this.measures;this.setMeasures(e),this.title.length||(a.titleHeight=0),this.config.showLegend||(a.legendHeight=0),this.argHeight=e.height||a.baseHeight,this.state={},this.options={},this.initTimeout=lb,this.config.isNavigable&&(this.overlays=[]),this.configure(e)}prepareData(t){return t}prepareFirstData(t){return t}validateColors(t,e){const a=[];return(t=(t||[]).concat(Za[e])).forEach(t=>{const e=$(t);Fa(e)?a.push(e):console.warn("\""+t+"\" is not a valid color.")}),a}setMeasures(){}configure(){let t=this.argHeight;this.baseHeight=t,this.height=t-ua(this.measures),ka=this.boundDrawFn.bind(this),window.addEventListener("resize",ka),window.addEventListener("orientationchange",this.boundDrawFn.bind(this))}boundDrawFn(){this.draw(!0)}unbindWindowEvents(){window.removeEventListener("resize",ka),window.removeEventListener("orientationchange",this.boundDrawFn.bind(this))}setup(){this.makeContainer(),this.updateWidth(),this.makeTooltip(),this.draw(!1,!0)}makeContainer(){this.parent.innerHTML="";let t={inside:this.parent,className:"chart-container"};this.independentWidth&&(t.styles={width:this.independentWidth+"px"}),this.container=h.create("div",t)}makeTooltip(){this.tip=new ib({parent:this.container,colors:this.colors}),this.bindTooltip()}bindTooltip(){}draw(t=!1,e=!1){this.updateWidth(),this.calc(t),this.makeChartArea(),this.setupComponents(),this.components.forEach(t=>t.setup(this.drawArea)),this.render(this.components,!1),e&&(this.data=this.realData,setTimeout(()=>{this.update(this.data)},this.initTimeout)),this.renderLegend(),this.setupNavigation(e)}calc(){}updateWidth(){this.baseWidth=Cb(this.parent),this.width=this.baseWidth-F(this.measures)}makeChartArea(){this.svg&&this.container.removeChild(this.svg);let t=this.measures;this.svg=db(this.container,"frappe-chart chart",this.baseWidth,this.baseHeight),this.svgDefs=eb(this.svg),this.title.length&&(this.titleEL=C("title",t.margins.left,t.margins.top,this.title,{fontSize:t.titleFontSize,fill:"#666666",dy:t.titleFontSize}));let e=r(t);this.drawArea=L(this.type+"-chart chart-draw-area",`translate(${E(t)}, ${e})`),this.config.showLegend&&(e+=this.height+t.paddings.bottom,this.legendArea=L("chart-legend",`translate(${E(t)}, ${e})`)),this.title.length&&this.svg.appendChild(this.titleEL),this.svg.appendChild(this.drawArea),this.config.showLegend&&this.svg.appendChild(this.legendArea),this.updateTipOffset(E(t),r(t))}updateTipOffset(t,e){this.tip.offset={x:t,y:e}}setupComponents(){this.components=new Map}update(t){t||console.error("No data to update."),this.data=this.prepareData(t),this.calc(),this.render()}render(t=this.components,e=!0){this.config.isNavigable&&this.overlays.map(t=>t.parentNode.removeChild(t));let a=[];t.forEach(t=>{a=a.concat(t.update(e))}),a.length>0?(Ra(this.container,this.svg,a),setTimeout(()=>{t.forEach(t=>t.make()),this.updateNav()},ob)):(t.forEach(t=>t.make()),this.updateNav())}updateNav(){this.config.isNavigable&&(this.makeOverlay(),this.bindUnits())}renderLegend(){}setupNavigation(t=!1){this.config.isNavigable&&t&&(this.bindOverlay(),this.keyActions={13:this.onEnterKey.bind(this),37:this.onLeftArrow.bind(this),38:this.onUpArrow.bind(this),39:this.onRightArrow.bind(this),40:this.onDownArrow.bind(this)},document.addEventListener("keydown",t=>{fb(this.container)&&(t=t||window.event,this.keyActions[t.keyCode]&&this.keyActions[t.keyCode]())}))}makeOverlay(){}updateOverlay(){}bindOverlay(){}bindUnits(){}onLeftArrow(){}onRightArrow(){}onUpArrow(){}onDownArrow(){}onEnterKey(){}addDataPoint(){}removeDataPoint(){}getDataPoint(){}setCurrentDataPoint(){}updateDataset(){}export(){let t=Ua(this.svg);Ta(this.title||"Chart",[t])}}class T extends V{constructor(t,e){super(t,e)}configure(t){super.configure(t),this.config.maxSlices=t.maxSlices||20,this.config.maxLegendPoints=t.maxLegendPoints||20}calc(){let t=this.state,e=this.config.maxSlices;t.sliceTotals=[];let a=this.data.labels.map((t,e)=>{let a=0;return this.data.datasets.map(t=>{a+=t.values[e]}),[a,t]}).filter(t=>t[0]>=0),i=a;if(a.length>e){a.sort((t,e)=>e[0]-t[0]),i=a.slice(0,e-1);let t=a.slice(e-1),s=0;t.map(t=>{s+=t[0]}),i.push([s,"Rest"]),this.colors[e-1]="grey"}t.labels=[],i.map(e=>{t.sliceTotals.push(e[0]),t.labels.push(e[1])}),t.grandTotal=t.sliceTotals.reduce((t,e)=>t+e,0),this.center={x:this.width/2,y:this.height/2}}renderLegend(){let t=this.state;this.legendArea.textContent="",this.legendTotals=t.sliceTotals.slice(0,this.config.maxLegendPoints);let e=0,a=0;this.legendTotals.map((i,s)=>{let r=Math.floor((this.width-F(this.measures))/110);e>r&&(e=0,a+=20);let n=tb(110*e+5,a,5,this.colors[s],`${t.labels[s]}: ${i}`);this.legendArea.appendChild(n),e++})}}const _=12,x=7,ba=1e3,_a=86400,ab=["January","February","March","April","May","June","July","August","September","October","November","December"],bb=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function ca(t){let e=new Date(t);return e.setMinutes(e.getMinutes()-e.getTimezoneOffset()),e}function X(t){let e=t.getDate(),a=t.getMonth()+1;return[t.getFullYear(),(a>9?"":"0")+a,(e>9?"":"0")+e].join("-")}function k(t){return new Date(t.getTime())}function R(t,e){let a=ia(t);return Math.ceil(gb(a,e)/x)}function gb(t,e){let a=_a*ba;return(ca(e)-ca(t))/a}function hb(t,e){return t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear()}function ga(t,e=!1){let a=ab[t];return e?a.slice(0,3):a}function ha(t,e){return new Date(e,t+1,0)}function ia(t){let e=k(t);const a=e.getDay();return 0!==a&&p(e,-1*a),e}function p(t,e){t.setDate(t.getDate()+e)}class mb{constructor({layerClass:t="",layerTransform:e="",constants:a,getData:i,makeElements:s,animateElements:r}){this.layerTransform=e,this.constants=a,this.makeElements=s,this.getData=i,this.animateElements=r,this.store=[],this.labels=[],this.layerClass=t,this.layerClass="function"==typeof this.layerClass?this.layerClass():this.layerClass,this.refresh()}refresh(t){this.data=t||this.getData()}setup(t){this.layer=L(this.layerClass,this.layerTransform,t)}make(){this.render(this.data),this.oldData=this.data}render(t){this.store=this.makeElements(t),this.layer.textContent="",this.store.forEach(t=>{this.layer.appendChild(t)}),this.labels.forEach(t=>{this.layer.appendChild(t)})}update(t=!0){this.refresh();let e=[];return t&&(e=this.animateElements(this.data)||[]),e}}let ya={donutSlices:{layerClass:"donut-slices",makeElements:t=>t.sliceStrings.map((e,a)=>{let i=J(e,"donut-path",t.colors[a],"none",t.strokeWidth);return i.style.transition="transform .3s;",i}),animateElements(t){return this.store.map((e,a)=>Y(e,t.sliceStrings[a]))}},pieSlices:{layerClass:"pie-slices",makeElements:t=>t.sliceStrings.map((e,a)=>{let i=J(e,"pie-path","none",t.colors[a]);return i.style.transition="transform .3s;",i}),animateElements(t){return this.store.map((e,a)=>Y(e,t.sliceStrings[a]))}},percentageBars:{layerClass:"percentage-bars",makeElements(t){return t.xPositions.map((e,a)=>{return nb(e,0,t.widths[a],this.constants.barHeight,this.constants.barDepth,t.colors[a])})},animateElements(t){if(t)return[]}},yAxis:{layerClass:"y axis",makeElements(t){return t.positions.map((e,a)=>Db(e,t.labels[a],this.constants.width,{mode:this.constants.mode,pos:this.constants.pos}))},animateElements(t){let e=t.positions,a=t.labels,i=this.oldData.positions,s=this.oldData.labels;return[i,e]=d(i,e),[s,a]=d(s,a),this.render({positions:i,labels:a}),this.store.map((t,a)=>Z(t,e[a],i[a]))}},xAxis:{layerClass:"x axis",makeElements(t){return t.positions.map((e,a)=>Ib(e,t.calcLabels[a],this.constants.height,{mode:this.constants.mode,pos:this.constants.pos}))},animateElements(t){let e=t.positions,a=t.calcLabels,i=this.oldData.positions,s=this.oldData.calcLabels;return[i,e]=d(i,e),[s,a]=d(s,a),this.render({positions:i,calcLabels:a}),this.store.map((t,a)=>Ga(t,e[a],i[a]))}},yMarkers:{layerClass:"y-markers",makeElements(t){return t.map(t=>Kb(t.position,t.label,this.constants.width,{labelPos:t.options.labelPos,mode:"span",lineType:"dashed"}))},animateElements(t){[this.oldData,t]=d(this.oldData,t);let e=t.map(t=>t.position),a=t.map(t=>t.label),i=t.map(t=>t.options),s=this.oldData.map(t=>t.position);return this.render(s.map((t,e)=>({position:s[e],label:a[e],options:i[e]}))),this.store.map((t,a)=>Z(t,e[a],s[a]))}},yRegions:{layerClass:"y-regions",makeElements(t){return t.map(t=>Mb(t.startPos,t.endPos,this.constants.width,t.label,{labelPos:t.options.labelPos}))},animateElements(t){[this.oldData,t]=d(this.oldData,t);let e=t.map(t=>t.endPos),a=t.map(t=>t.label),i=t.map(t=>t.startPos),s=t.map(t=>t.options),r=this.oldData.map(t=>t.endPos),n=this.oldData.map(t=>t.startPos);this.render(r.map((t,e)=>({startPos:n[e],endPos:r[e],label:a[e],options:s[e]})));let o=[];return this.store.map((t,a)=>{o=o.concat(Ia(t,i[a],e[a],r[a]))}),o}},heatDomain:{layerClass:function(){return"heat-domain domain-"+this.constants.index},makeElements(t){let{index:e,colWidth:a,rowHeight:i,squareSize:s,xTranslate:r}=this.constants,n=r,o=0;return this.serializedSubDomains=[],t.cols.map((t,r)=>{1===r&&this.labels.push(C("domain-name",n,-12,ga(e,!0).toUpperCase(),{fontSize:9})),t.map((t,e)=>{if(t.fill){let a={"data-date":t.yyyyMmDd,"data-value":t.dataValue,"data-day":e},i=va("day",n,o,s,t.fill,a);this.serializedSubDomains.push(i)}o+=i}),o=0,n+=a}),this.serializedSubDomains},animateElements(t){if(t)return[]}},barGraph:{layerClass:function(){return"dataset-units dataset-bars dataset-"+this.constants.index},makeElements(t){let e=this.constants;return this.unitType="bar",this.units=t.yPositions.map((a,i)=>Nb(t.xPositions[i],a,t.barWidth,e.color,t.labels[i],i,t.offsets[i],{zeroLine:t.zeroLine,barsWidth:t.barsWidth,minHeight:e.minHeight})),this.units},animateElements(t){let e=t.xPositions,a=t.yPositions,i=t.offsets,s=t.labels,r=this.oldData.xPositions,n=this.oldData.yPositions,o=this.oldData.offsets,$=this.oldData.labels;[r,e]=d(r,e),[n,a]=d(n,a),[o,i]=d(o,i),[$,s]=d($,s),this.render({xPositions:r,yPositions:n,offsets:o,labels:s,zeroLine:this.oldData.zeroLine,barsWidth:this.oldData.barsWidth,barWidth:this.oldData.barWidth});let l=[];return this.store.map((s,r)=>{l=l.concat(Ja(s,e[r],a[r],t.barWidth,i[r],{zeroLine:t.zeroLine}))}),l}},lineGraph:{layerClass:function(){return"dataset-units dataset-line dataset-"+this.constants.index},makeElements(t){let e=this.constants;return this.unitType="dot",this.paths={},e.hideLine||(this.paths=Pb(t.xPositions,t.yPositions,e.color,{heatline:e.heatline,regionFill:e.regionFill},{svgDefs:e.svgDefs,zeroLine:t.zeroLine})),this.units=[],e.hideDots||(this.units=t.yPositions.map((a,i)=>Rb(t.xPositions[i],a,t.radius,e.color,e.valuesOverPoints?t.values[i]:"",i))),Object.values(this.paths).concat(this.units)},animateElements(t){let e=t.xPositions,a=t.yPositions,i=t.values,s=this.oldData.xPositions,r=this.oldData.yPositions,n=this.oldData.values;[s,e]=d(s,e),[r,a]=d(r,a),[n,i]=d(n,i),this.render({xPositions:s,yPositions:r,values:i,zeroLine:this.oldData.zeroLine,radius:this.oldData.radius});let o=[];return Object.keys(this.paths).length&&(o=o.concat(La(this.paths,e,a,t.zeroLine))),this.units.length&&this.units.map((t,i)=>{o=o.concat(Ka(t,e[i],a[i]))}),o}}};function o(t,e,a){let i=Object.keys(ya).filter(e=>t.includes(e)),s=ya[i[0]];return Object.assign(s,{constants:e,getData:a}),new mb(s)}class pb extends T{constructor(t,e){super(t,e),this.type="percentage",this.setup()}setMeasures(t){let e=this.measures;this.barOptions=t.barOptions||{};let a=this.barOptions;a.height=a.height||Ea,a.depth=a.depth||qa,e.paddings.right=30,e.legendHeight=80,e.baseHeight=8*(a.height+.5*a.depth)}setupComponents(){let t=this.state,e=[["percentageBars",{barHeight:this.barOptions.height,barDepth:this.barOptions.depth},function(){return{xPositions:t.xPositions,widths:t.widths,colors:this.colors}}.bind(this)]];this.components=new Map(e.map(t=>{let e=o(...t);return[t[0],e]}))}calc(){super.calc();let t=this.state;t.xPositions=[],t.widths=[];let e=0;t.sliceTotals.map(a=>{let i=this.width*a/t.grandTotal;t.widths.push(i),t.xPositions.push(e),e+=i})}makeDataByIndex(){}bindTooltip(){let t=this.state;this.container.addEventListener("mousemove",e=>{let a=this.components.get("percentageBars").store,i=e.target;if(a.includes(i)){let e=a.indexOf(i),s=A(this.container),r=A(i),n=r.left-s.left+parseInt(i.getAttribute("width"))/2,o=r.top-s.top,$=(this.formattedLabels&&this.formattedLabels.length>0?this.formattedLabels[e]:this.state.labels[e])+": ",l=t.sliceTotals[e]/t.grandTotal;this.tip.setValues(n,o,{name:$,value:(100*l).toFixed(1)+"%"}),this.tip.showTip()}})}}class qb extends T{constructor(t,e){super(t,e),this.type="pie",this.initTimeout=0,this.init=1,this.setup()}configure(t){super.configure(t),this.mouseMove=this.mouseMove.bind(this),this.mouseLeave=this.mouseLeave.bind(this),this.hoverRadio=t.hoverRadio||.1,this.config.startAngle=t.startAngle||0,this.clockWise=t.clockWise||!1}calc(){super.calc();let t=this.state;this.radius=this.height>this.width?this.center.x:this.center.y;const{radius:e,clockWise:a}=this,i=t.slicesProperties||[];t.sliceStrings=[],t.slicesProperties=[];let s=180-this.config.startAngle;t.sliceTotals.map((r,n)=>{const o=s,$=r/t.grandTotal*ma;let l=0;$>180&&(l=1);const u=a?-$:$,h=s+=u,d=q(o,e),c=q(h,e),p=this.init&&i[n];let S,v;this.init?(S=p?p.startPosition:d,v=p?p.endPosition:d):(S=d,v=c);const P=jb(S,v,this.center,this.radius,a,l);t.sliceStrings.push(P),t.slicesProperties.push({startPosition:d,endPosition:c,value:r,total:t.grandTotal,startAngle:o,endAngle:h,angle:u})}),this.init=0}setupComponents(){let t=this.state,e=[["pieSlices",{},function(){return{sliceStrings:t.sliceStrings,colors:this.colors}}.bind(this)]];this.components=new Map(e.map(t=>{let e=o(...t);return[t[0],e]}))}calTranslateByAngle(t){const{radius:e,hoverRadio:a}=this,i=q(t.startAngle+t.angle/2,e);return`translate3d(${i.x*a}px,${i.y*a}px,0)`}hoverSlice(t,e,a,i){if(!t)return;const s=this.colors[e];if(a){D(t,this.calTranslateByAngle(this.state.slicesProperties[e])),t.style.fill=U(s,50);let a=A(this.svg),r=i.pageX-a.left+10,n=i.pageY-a.top-10,o=(this.formatted_labels&&this.formatted_labels.length>0?this.formatted_labels[e]:this.state.labels[e])+": ",$=(100*this.state.sliceTotals[e]/this.state.grandTotal).toFixed(1);this.tip.setValues(r,n,{name:o,value:$+"%"}),this.tip.showTip()}else D(t,"translate3d(0,0,0)"),this.tip.hideTip(),t.style.fill=s}bindTooltip(){this.container.addEventListener("mousemove",this.mouseMove),this.container.addEventListener("mouseleave",this.mouseLeave)}mouseMove(t){const e=t.target;let a=this.components.get("pieSlices").store,i=this.curActiveSliceIndex,s=this.curActiveSlice;if(a.includes(e)){let r=a.indexOf(e);this.hoverSlice(s,i,!1),this.curActiveSlice=e,this.curActiveSliceIndex=r,this.hoverSlice(e,r,!0,t)}else this.mouseLeave()}mouseLeave(){this.hoverSlice(this.curActiveSlice,this.curActiveSliceIndex,!1)}}function y(t){if(0===t)return[0,0];if(isNaN(t))return{mantissa:-6755399441055744,exponent:972};var e=t>0?1:-1;if(!isFinite(t))return{mantissa:4503599627370496*e,exponent:972};t=Math.abs(t);var a=Math.floor(Math.log10(t));return[e*(t/Math.pow(10,a)),a]}function sb(t,e=0){let a=Math.ceil(t),i=Math.floor(e),s=a-i,r=s,n=1;s>5&&(s%2!=0&&(s=++a-i),r=s/2,n=2),s<=2&&(n=s/(r=4)),0===s&&(r=5,n=1);let o=[];for(var $=0;$<=r;$++)o.push(i+n*$);return o}function z(t,e=0){let[a,i]=y(t),s=e?e/Math.pow(10,i):0,r=sb(a=a.toFixed(6),s);return r=r.map(t=>t*Math.pow(10,i))}function ub(t,e=!1){let a=Math.max(...t),i=Math.min(...t),s=0,r=[];function n(t,e){let a=z(t),i=a[1]-a[0],s=0;for(var r=1;s=0&&i>=0)s=y(a)[1],r=e?z(a,i):z(a);else if(a>0&&i<0){let t=Math.abs(i);if(a>=t)s=y(a)[1],r=n(a,t);else{s=y(t)[1],r=n(t,a).map(t=>-1*t)}}else if(a<=0&&i<=0){let t=Math.abs(i),n=Math.abs(a);s=y(t)[1],r=(r=e?z(t,n):z(t)).reverse().map(t=>-1*t)}return r}function vb(t){let e,a=oa(t);if(t.indexOf(0)>=0)e=t.indexOf(0);else if(t[0]>0){e=-1*t[0]/a}else{e=-1*t[t.length-1]/a+(t.length-1)}return e}function oa(t){return t[1]-t[0]}function xb(t){return t[t.length-1]-t[0]}function G(t,e){return la(e.zeroLine-t*e.scaleMultiplier)}function zb(t,e,a=!1){let i=e.reduce(function(e,a){return Math.abs(a-t)et.end)throw new Error("Start date cannot be greater than end date.");if(t.start||(t.start=new Date,t.start.setFullYear(t.start.getFullYear()-1)),t.end||(t.end=new Date),t.dataPoints=t.dataPoints||{},parseInt(Object.keys(t.dataPoints)[0])>1e5){let e={};Object.keys(t.dataPoints).forEach(a=>{let i=new Date(a*ba);e[X(i)]=t.dataPoints[a]}),t.dataPoints=e}return t}calc(){let t=this.state;t.start=k(this.data.start),t.end=k(this.data.end),t.firstWeekStart=k(t.start),t.noOfWeeks=R(t.start,t.end),t.distribution=Ab(Object.values(this.data.dataPoints),O),t.domainConfigs=this.getDomains()}setupComponents(){let t=this.state,e=this.discreteDomains?0:1,a=t.domainConfigs.map((a,i)=>["heatDomain",{index:a.index,colWidth:f,rowHeight:l,squareSize:n,xTranslate:t.domainConfigs.filter((t,e)=>et.cols.length-e).reduce((t,e)=>t+e,0)*f},function(){return t.domainConfigs[i]}.bind(this)]);this.components=new Map(a.map((t,e)=>{let a=o(...t);return[t[0]+"-"+e,a]}));let i=0;bb.forEach((t,e)=>{if([1,3,5].includes(e)){let e=C("subdomain-name",-f/2,i,t,{fontSize:n,dy:8,textAnchor:"end"});this.drawArea.appendChild(e)}i+=l})}update(t){t||console.error("No data to update."),this.data=this.prepareData(t),this.draw(),this.bindTooltip()}bindTooltip(){this.container.addEventListener("mousemove",t=>{this.components.forEach(e=>{let a=e.store,i=t.target;if(a.includes(i)){let e=i.getAttribute("data-value"),a=i.getAttribute("data-date").split("-"),s=ga(parseInt(a[1])-1,!0),r=this.container.getBoundingClientRect(),n=i.getBoundingClientRect(),o=parseInt(t.target.getAttribute("width")),$=n.left-r.left+o/2,l=n.top-r.top,u=e+" "+this.countLabel,h=" on "+s+" "+a[0]+", "+a[2];this.tip.setValues($,l,{name:h,value:u,valueFirst:1},[]),this.tip.showTip()}})})}renderLegend(){this.legendArea.textContent="";let t=0,e=l,a=C("subdomain-name",t,e,"Less",{fontSize:n+1,dy:9});t=2*f+f/2,this.legendArea.appendChild(a),this.colors.slice(0,O).map((a,i)=>{const s=va("heatmap-legend-unit",t+(f+3)*i,e,n,a);this.legendArea.appendChild(s)});let i=C("subdomain-name",t+O*(f+3)+f/4,e,"More",{fontSize:n+1,dy:9});this.legendArea.appendChild(i)}getDomains(){let t=this.state;const[e,a]=[t.start.getMonth(),t.start.getFullYear()],[i,s]=[t.end.getMonth(),t.end.getFullYear()],r=i-e+1+12*(s-a);let n=[],o=k(t.start);for(var $=0;$=i.start&&s<=i.end;a||s.getMonth()!==e||!n?t.yyyyMmDd=X(s):t=this.getSubDomainConfig(s),r.push(t)}return r}getSubDomainConfig(t){let e=X(t),a=this.data.dataPoints[e];return{yyyyMmDd:e,dataValue:a||0,fill:this.colors[Bb(a,this.state.distribution)]}}}function Fb(t,e){t.labels=t.labels||[];let a=t.labels.length,i=t.datasets,s=new Array(a).fill(0);return i||(i=[{values:s}]),i.map(t=>{if(t.values){let e=t.values;e=(e=e.map(t=>isNaN(t)?0:t)).length>a?e.slice(0,a):Q(e,a-e.length,0)}else t.values=s;t.chartType||(wb.includes(e),t.chartType=e)}),t.yRegions&&t.yRegions.map(t=>{t.end({name:"",values:a.slice(0,-1),chartType:t.chartType}))};return t.yMarkers&&(i.yMarkers=[{value:0,label:""}]),t.yRegions&&(i.yRegions=[{start:0,end:0,label:""}]),i}function Hb(t,e=[],a=!0){let i=t/e.length;i<=0&&(i=1);let s=i/Va;return e.map((t,e)=>{if((t+="").length>s)if(a){e%Math.ceil(t.length/s)!=0&&(t="")}else t=s-3>0?t.slice(0,s-3)+" ...":t.slice(0,s)+"..";return t})}class N extends V{constructor(t,e){super(t,e),this.barOptions=e.barOptions||{},this.lineOptions=e.lineOptions||{},this.type=e.type||"line",this.init=1,this.setup()}setMeasures(){this.data.datasets.length<=1&&(this.config.showLegend=0,this.measures.paddings.bottom=30)}configure(t){super.configure(t),t.axisOptions=t.axisOptions||{},t.tooltipOptions=t.tooltipOptions||{},this.config.xAxisMode=t.axisOptions.xAxisMode||"span",this.config.yAxisMode=t.axisOptions.yAxisMode||"span",this.config.xIsSeries=t.axisOptions.xIsSeries||0,this.config.formatTooltipX=t.tooltipOptions.formatTooltipX,this.config.formatTooltipY=t.tooltipOptions.formatTooltipY,this.config.valuesOverPoints=t.valuesOverPoints}prepareData(t=this.data){return Fb(t,this.type)}prepareFirstData(t=this.data){return Gb(t)}calc(t=!1){this.calcXPositions(),t||this.calcYAxisParameters(this.getAllYValues(),"line"===this.type),this.makeDataByIndex()}calcXPositions(){let t=this.state,e=this.data.labels;t.datasetLength=e.length,t.unitWidth=this.width/t.datasetLength,t.xOffset=t.unitWidth/2,t.xAxis={labels:e,positions:e.map((e,a)=>la(t.xOffset+a*t.unitWidth))}}calcYAxisParameters(t,e="false"){const a=ub(t,e),i=this.height/xb(a),s=oa(a)*i,r=this.height-vb(a)*s;this.state.yAxis={labels:a,positions:a.map(t=>r-t*i),scaleMultiplier:i,zeroLine:r},this.calcDatasetPoints(),this.calcYExtremes(),this.calcYRegions()}calcDatasetPoints(){let t=this.state,e=e=>e.map(e=>G(e,t.yAxis));t.datasets=this.data.datasets.map((t,a)=>{let i=t.values,s=t.cumulativeYs||[];return{name:t.name,index:a,chartType:t.chartType,values:i,yPositions:e(i),cumulativeYs:s,cumulativeYPos:e(s)}})}calcYExtremes(){let t=this.state;this.barOptions.stacked?t.yExtremes=t.datasets[t.datasets.length-1].cumulativeYPos:(t.yExtremes=new Array(t.datasetLength).fill(9999),t.datasets.map(e=>{e.yPositions.map((e,a)=>{e(e.position=G(e.value,t.yAxis),e.options||(e.options={}),e))),this.data.yRegions&&(this.state.yRegions=this.data.yRegions.map(e=>(e.startPos=G(e.start,t.yAxis),e.endPos=G(e.end,t.yAxis),e.options||(e.options={}),e)))}getAllYValues(){let t="values";if(this.barOptions.stacked){t="cumulativeYs";let e=new Array(this.state.datasetLength).fill(0);this.data.datasets.map((a,i)=>{let s=this.data.datasets[i].values;a[t]=e=e.map((t,e)=>t+s[e])})}let e=this.data.datasets.map(e=>e[t]);return this.data.yMarkers&&e.push(this.data.yMarkers.map(t=>t.value)),this.data.yRegions&&this.data.yRegions.map(t=>{e.push([t.end,t.start])}),[].concat(...e)}setupComponents(){let t=[["yAxis",{mode:this.config.yAxisMode,width:this.width},function(){return this.state.yAxis}.bind(this)],["xAxis",{mode:this.config.xAxisMode,height:this.height},function(){let t=this.state;return t.xAxis.calcLabels=Hb(this.width,t.xAxis.labels,this.config.xIsSeries),t.xAxis}.bind(this)],["yRegions",{width:this.width,pos:"right"},function(){return this.state.yRegions}.bind(this)]],e=this.state.datasets.filter(t=>"bar"===t.chartType),a=this.state.datasets.filter(t=>"line"===t.chartType),i=e.map(t=>{let a=t.index;return["barGraph-"+t.index,{index:a,color:this.colors[a],stacked:this.barOptions.stacked,valuesOverPoints:this.config.valuesOverPoints,minHeight:this.height*Aa},function(){let t=this.state,i=t.datasets[a],s=this.barOptions.stacked,r=this.barOptions.spaceRatio||Ob,n=t.unitWidth*(1-r),o=n/(s?1:e.length),$=t.xAxis.positions.map(t=>t-n/2);s||($=$.map(t=>t+o*a));let l=new Array(t.datasetLength).fill("");this.config.valuesOverPoints&&(l=s&&i.index===t.datasets.length-1?i.cumulativeYs:i.values);let u=new Array(t.datasetLength).fill(0);return s&&(u=i.yPositions.map((t,e)=>t-i.cumulativeYPos[e])),{xPositions:$,yPositions:i.yPositions,offsets:u,labels:l,zeroLine:t.yAxis.zeroLine,barsWidth:n,barWidth:o}}.bind(this)]}),s=a.map(t=>{let e=t.index;return["lineGraph-"+t.index,{index:e,color:this.colors[e],svgDefs:this.svgDefs,heatline:this.lineOptions.heatline,regionFill:this.lineOptions.regionFill,hideDots:this.lineOptions.hideDots,hideLine:this.lineOptions.hideLine,valuesOverPoints:this.config.valuesOverPoints},function(){let t=this.state,a=t.datasets[e],i=t.yAxis.positions[0]!n.includes(t[0])||this.state[t[0]]).map(t=>{let e=o(...t);return(t[0].includes("lineGraph")||t[0].includes("barGraph"))&&this.dataUnitComponents.push(e),[t[0],e]}))}makeDataByIndex(){this.dataByIndex={};let t=this.state,e=this.config.formatTooltipX,a=this.config.formatTooltipY;t.xAxis.labels.map((i,s)=>{let r=this.state.datasets.map((t,e)=>{let i=t.values[s];return{title:t.name,value:i,yPos:t.yPositions[s],color:this.colors[e],formatted:a?a(i):i}});this.dataByIndex[s]={label:i,formattedLabel:e?e(i):i,xPos:t.xAxis.positions[s],values:r,yExtreme:t.yExtremes[s]}})}bindTooltip(){this.container.addEventListener("mousemove",t=>{let e=this.measures,a=A(this.container),i=t.pageX-a.left-E(e),s=t.pageY-a.top;sr(e)?this.mapTooltipXPosition(i):this.tip.hideTip()})}mapTooltipXPosition(t){let e=this.state;if(!e.yExtremes)return;let a=zb(t,e.xAxis.positions,!0),i=this.dataByIndex[a];this.tip.setValues(i.xPos+this.tip.offset.x,i.yExtreme+this.tip.offset.y,{name:i.formattedLabel,value:""},i.values,a),this.tip.showTip()}renderLegend(){let t=this.data;t.datasets.length>1&&(this.legendArea.textContent="",t.datasets.map((t,e)=>{let a=rb(ra*e,"0",ra,this.colors[e],t.name);this.legendArea.appendChild(a)}))}makeOverlay(){this.init?this.init=0:(this.overlayGuides&&this.overlayGuides.forEach(t=>{let e=t.overlay;e.parentNode.removeChild(e)}),this.overlayGuides=this.dataUnitComponents.map(t=>({type:t.unitType,overlay:void 0,units:t.units})),void 0===this.state.currentIndex&&(this.state.currentIndex=this.state.datasetLength-1),this.overlayGuides.map(t=>{let e=t.units[this.state.currentIndex];t.overlay=Qb[t.type](e),this.drawArea.appendChild(t.overlay)}))}updateOverlayGuides(){this.overlayGuides&&this.overlayGuides.forEach(t=>{let e=t.overlay;e.parentNode.removeChild(e)})}bindOverlay(){this.parent.addEventListener("data-select",()=>{this.updateOverlay()})}bindUnits(){this.dataUnitComponents.map(t=>{t.units.map(t=>{t.addEventListener("click",()=>{let e=t.getAttribute("data-point-index");this.setCurrentDataPoint(e)})})}),this.tip.container.addEventListener("click",()=>{let t=this.tip.container.getAttribute("data-point-index");this.setCurrentDataPoint(t)})}updateOverlay(){this.overlayGuides.map(t=>{let e=t.units[this.state.currentIndex];za[t.type](e,t.overlay)})}onLeftArrow(){this.setCurrentDataPoint(this.state.currentIndex-1)}onRightArrow(){this.setCurrentDataPoint(this.state.currentIndex+1)}getDataPoint(t=this.state.currentIndex){let e=this.state;return{index:t,label:e.xAxis.labels[t],values:e.datasets.map(e=>e.values[t])}}setCurrentDataPoint(t){let e=this.state;(t=parseInt(t))<0&&(t=0),t>=e.xAxis.labels.length&&(t=e.xAxis.labels.length-1),t!==e.currentIndex&&(e.currentIndex=t,Ha(this.parent,"data-select",this.getDataPoint()))}addDataPoint(t,e,a=this.state.datasetLength){super.addDataPoint(t,e,a),this.data.labels.splice(a,0,t),this.data.datasets.map((t,i)=>{t.values.splice(a,0,e[i])}),this.update(this.data)}removeDataPoint(t=this.state.datasetLength-1){this.data.labels.length<=1||(super.removeDataPoint(t),this.data.labels.splice(t,1),this.data.datasets.map(e=>{e.values.splice(t,1)}),this.update(this.data))}updateDataset(t,e=0){this.data.datasets[e].values=t,this.update(this.data)}updateDatasets(t){this.data.datasets.map((e,a)=>{t[a]&&(e.values=t[a])}),this.update(this.data)}}class Jb extends T{constructor(t,e){super(t,e),this.type="donut",this.initTimeout=0,this.init=1,this.setup()}configure(t){super.configure(t),this.mouseMove=this.mouseMove.bind(this),this.mouseLeave=this.mouseLeave.bind(this),this.hoverRadio=t.hoverRadio||.1,this.config.startAngle=t.startAngle||0,this.clockWise=t.clockWise||!1,this.strokeWidth=t.strokeWidth||30}calc(){super.calc();let t=this.state;this.radius=this.height>this.width?this.center.x-this.strokeWidth/2:this.center.y-this.strokeWidth/2;const{radius:e,clockWise:a}=this,i=t.slicesProperties||[];t.sliceStrings=[],t.slicesProperties=[];let s=180-this.config.startAngle;t.sliceTotals.map((r,n)=>{const o=s,$=r/t.grandTotal*ma,l=a?-$:$,u=s+=l,h=q(o,e),d=q(u,e),c=this.init&&i[n];let p,S;this.init?(p=c?c.startPosition:h,S=c?c.endPosition:h):(p=h,S=d);const v=kb(p,S,this.center,this.radius,this.clockWise);t.sliceStrings.push(v),t.slicesProperties.push({startPosition:h,endPosition:d,value:r,total:t.grandTotal,startAngle:o,endAngle:u,angle:l})}),this.init=0}setupComponents(){let t=this.state,e=[["donutSlices",{},function(){return{sliceStrings:t.sliceStrings,colors:this.colors,strokeWidth:this.strokeWidth}}.bind(this)]];this.components=new Map(e.map(t=>{let e=o(...t);return[t[0],e]}))}calTranslateByAngle(t){const{radius:e,hoverRadio:a}=this,i=q(t.startAngle+t.angle/2,e);return`translate3d(${i.x*a}px,${i.y*a}px,0)`}hoverSlice(t,e,a,i){if(!t)return;const s=this.colors[e];if(a){D(t,this.calTranslateByAngle(this.state.slicesProperties[e])),t.style.stroke=U(s,50);let a=A(this.svg),r=i.pageX-a.left+10,n=i.pageY-a.top-10,o=(this.formatted_labels&&this.formatted_labels.length>0?this.formatted_labels[e]:this.state.labels[e])+": ",$=(100*this.state.sliceTotals[e]/this.state.grandTotal).toFixed(1);this.tip.setValues(r,n,{name:o,value:$+"%"}),this.tip.showTip()}else D(t,"translate3d(0,0,0)"),this.tip.hideTip(),t.style.stroke=s}bindTooltip(){this.container.addEventListener("mousemove",this.mouseMove),this.container.addEventListener("mouseleave",this.mouseLeave)}mouseMove(t){const e=t.target;let a=this.components.get("donutSlices").store,i=this.curActiveSliceIndex,s=this.curActiveSlice;if(a.includes(e)){let r=a.indexOf(e);this.hoverSlice(s,i,!1),this.curActiveSlice=e,this.curActiveSliceIndex=r,this.hoverSlice(e,r,!0,t)}else this.mouseLeave()}mouseLeave(){this.hoverSlice(this.curActiveSlice,this.curActiveSliceIndex,!1)}}const ta={bar:N,line:N,percentage:pb,heatmap:Eb,pie:qb,donut:Jb};function Lb(t="line",e,a){return"axis-mixed"===t?(a.type="line",new N(e,a)):ta[t]?new ta[t](e,a):void console.error("Undefined chart type: "+t)}class i{constructor(t,e){return Lb(e.type,t,e)}}var s={components:{Chart:i},data:function(){return{podcasterSlug:null,currentDate:new Date,currentYear:null,yearlyStats:[0],data:{labels:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],datasets:[]}}},computed:{id:function(){return this.$store.state.form.current},pageValues:function(){return this.$store.getters["form/values"](this.id)}},mounted:function(){var t=M(this.currentDate);this.podcasterSlug=this.sanitizeTitle(this.pageValues.podcastertitle),this.getStats(t)},methods:{getStats:function(t){var e=this;fetch("/api/podcaster/stats/"+this.podcasterSlug+"/episodes/yearly-downloads/"+t+"+"+(t-1),{method:"GET",headers:{"X-CSRF":panel.csrf}}).then(function(t){if(200!==t.status)throw"You are tracking your downloads, using the file method. Stats are currently available only when using mysql";return t}).then(function(t){return t.json()}).then(function(a){e.addChartData(a.stats,t)}).catch(function(t){e.error=t})},addChartData:function(t,e){var a={current:{name:e,values:[0,0,0,0,0,0,0,0,0,0,0,0]},past:{name:e-1,values:[0,0,0,0,0,0,0,0,0,0,0,0]}};t.map(function(t){t.year===e?a.current.values[t.month-1]=t.downloaded:a.past.values[t.month-1]=t.downloaded}),this.data.datasets=[a.current,a.past],this.drawChart()},drawChart:function(){new i("#chart",{title:"Monthly Episode Downloads",data:this.data,type:"line",height:350,colors:["green","dark-grey"],lineOptions:{hideLine:0,regionFill:1,hideDots:0},barOptions:{spaceRatio:.25}})},sanitizeTitle:function(t){return t.toLowerCase().replace(/e|é|è|ẽ|ẻ|ẹ|ê|ế|ề|ễ|ể|ệ/gi,"e").replace(/a|á|à|ã|ả|ạ|ă|ắ|ằ|ẵ|ẳ|ặ|â|ấ|ầ|ẫ|ẩ|ậ/gi,"a").replace(/o|ó|ò|õ|ỏ|ọ|ô|ố|ồ|ỗ|ổ|ộ|ơ|ớ|ờ|ỡ|ở|ợ/gi,"o").replace(/u|ú|ù|ũ|ủ|ụ|ư|ứ|ừ|ữ|ử|ự/gi,"u").replace(/đ/gi,"d").replace(/\s*$/g,"").replace(/\s+/g,"-")}}};if(typeof s==="function"){s=s.options}Object.assign(s,function(){var render=function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c("div",[_vm._v(" "+_vm._s(_vm.error)+" "),_c("div",{attrs:{"id":"chart"}})])};var staticRenderFns=[];return{render:render,staticRenderFns:staticRenderFns,_compiled:true,_scopeId:null,functional:undefined}}());var wa=function(e){return e.toLowerCase().replace(/e|é|è|ẽ|ẻ|ẹ|ê|ế|ề|ễ|ể|ệ/gi,"e").replace(/a|á|à|ã|ả|ạ|ă|ắ|ằ|ẵ|ẳ|ặ|â|ấ|ầ|ẫ|ẩ|ậ/gi,"a").replace(/o|ó|ò|õ|ỏ|ọ|ô|ố|ồ|ỗ|ổ|ộ|ơ|ớ|ờ|ỡ|ở|ợ/gi,"o").replace(/u|ú|ù|ũ|ủ|ụ|ư|ứ|ừ|ữ|ử|ự/gi,"u").replace(/đ/gi,"d").replace(/\s*$/g,"").replace(/\s+/g,"-")};var e={data:function(){return{limit:10,headline:null,topEpisodes:[],error:null,podcasterSlug:null}},mounted:function(){this.podcasterSlug=wa(this.pageValues.podcastertitle),this.getStats()},created:function(){var t=this;this.load().then(function(e){t.headline=e.headline})},computed:{id:function(){return this.$store.state.form.current},pageValues:function(){return this.$store.getters["form/values"](this.id)}},methods:{getStats:function(){var t=this;fetch("/api/podcaster/stats/"+this.podcasterSlug+"/top/"+this.limit,{method:"GET",headers:{"X-CSRF":panel.csrf}}).then(function(t){if(200!==t.status)throw"You are tracking your downloads, using the file method. Stats are currently available only when using mysql";return t}).then(function(t){return t.json()}).then(function(e){t.topEpisodes=t.computeStats(e.stats)}).catch(function(e){t.error=e})},computeStats:function(t){return t.map(function(t){return{title:t.episode.replace(/-/g," "),downloads:t.downloaded}})}}};if(typeof e==="function"){e=e.options}Object.assign(e,function(){var render=function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c("section",{staticClass:"k-modified-section"},[_c("k-text",[_vm._v(_vm._s(_vm.error))]),_vm._v(" "),_c("k-headline",[_vm._v(_vm._s(_vm.headline))]),_vm._v(" "),_c("table",{attrs:{"id":"topTen"}},_vm._l(_vm.topEpisodes,function(episode){return _c("tr",[_c("td",[_vm._v(_vm._s(episode.downloads))]),_vm._v(" "),_c("td",[_vm._v(_vm._s(episode.title))])])}),0)],1)};var staticRenderFns=[];return{render:render,staticRenderFns:staticRenderFns,_compiled:true,_scopeId:null,functional:undefined}}());var K={components:{Chart:i},data:function(){return{podcasterSlug:null,currentDate:new Date,currentYear:null,yearlyStats:[0],data:{labels:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],datasets:[]}}},computed:{id:function(){return this.$store.state.form.current},pageValues:function(){return this.$store.getters["form/values"](this.id)}},mounted:function(){var t=M(this.currentDate);this.podcasterSlug=wa(this.pageValues.podcastertitle),this.getStats(t)},methods:{getStats:function(t){var e=this;fetch("/api/podcaster/stats/"+this.podcasterSlug+"/feed/yearly-downloads/"+t+"+"+(t-1),{method:"GET",headers:{"X-CSRF":panel.csrf}}).then(function(t){if(200!==t.status)throw"You are tracking your downloads, using the file method. Stats are currently available only when using mysql";return t}).then(function(t){return t.json()}).then(function(a){e.addChartData(a.stats,t)}).catch(function(t){e.error=t})},addChartData:function(t,e){var a={current:{name:e,values:[0,0,0,0,0,0,0,0,0,0,0,0]},past:{name:e-1,values:[0,0,0,0,0,0,0,0,0,0,0,0]}};t.map(function(t){t.year===e?a.current.values[t.month-1]=t.downloaded:a.past.values[t.month-1]=t.downloaded}),this.data.datasets=[a.current,a.past],this.drawChart()},drawChart:function(){new i("#feedChart",{title:"Monthly Feed Downloads",data:this.data,type:"line",height:350,colors:["blue","dark-grey"],lineOptions:{hideLine:0,regionFill:1,hideDots:0},barOptions:{spaceRatio:.25}})}}};if(typeof K==="function"){K=K.options}Object.assign(K,function(){var render=function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c("div",[_vm._v(" "+_vm._s(_vm.error)+" "),_c("div",{attrs:{"id":"feedChart"}})])};var staticRenderFns=[];return{render:render,staticRenderFns:staticRenderFns,_compiled:true,_scopeId:null,functional:undefined}}());var H={data:function(){return{headline:null,logs:[],feedItems:[],numItems:0,numRemain:0,numDownload:0,failed:0,feedName:"",currentEpisode:""}},created:function(){},mounted:function(){this.headline=this.pageValues.podcasterWizardSrcFeed},computed:{id:function(){return this.$store.state.form.current},pageValues:function(){return this.$store.getters["form/values"](this.id)}},methods:{startImport:function(e){var t=this.pageValues.podcasterwizardsrcfeed;this.feedName=t,e.target.style="display: none",document.querySelector(".log").style="display: block",this.getFeed(t)},startAudioDownload:function(){this.feedItems.length>0?this.downloadAudio():this.logs.push({id:3,msg:"done"})},getFeed:function(e){var t=this;fetch("/api/podcaster/wizard/checkfeed",{method:"GET",headers:{"X-CSRF":panel.csrf,"X-FEED-URI":e}}).then(function(e){return e.json()}).then(function(e){"error"===e.status&&t.failed++;var i=void 0!==e.channel.item.length?e.channel.item.length:1;t.feedName=e.channel.title,t.numItems=i,t.numRemain=i,t.numDownload=i,t.createFeed(e.channel),t.importEpisodes(e.channel.item)}).catch(function(e){t.error=e,t.failed++})},createFeed:function(e){var t={title:e.title,link:e.link,description:e.description,itunessubtitle:e.itunessubtitle,ituneskeywords:e.ituneskeywords,itunesseason:e.itunesseason,itunesexplicit:e.itunesexplicit,itunesblock:e.itunesblock,itunestype:e.itunestype,language:e.language,copyright:e.copyright};fetch("/api/podcaster/wizard/createFeed",{method:"POST",headers:{"X-CSRF":panel.csrf,"X-TARGET-PAGE":this.pageValues.podcasterwizarddestination[0].id},body:JSON.stringify(t)}).catch(function(e){console.log(e)})},importEpisodes:function(e){if(void 0===e.length){e.title,e.link,e.pubDate,e.description,e.itunessubtitle,e.itunessummary,e.itunesduration,e.itunesseason,e.itunesexplicit,e.itunesblock,e.enclosure["@attributes"].url;this.createEpisode(e)}else for(var t=e.length-1;t>=0;t--)this.createEpisode(e[t])},createEpisode:function(e){var t=this,i={title:e.title,link:e.link,pubDate:e.pubDate,description:e.description,itunessubtitle:e.itunessubtitle,itunessummary:e.itunessummary,itunesduration:e.itunesduration,itunesseason:e.itunesseason,itunesexplicit:e.itunesexplicit,itunesblock:e.itunesblock,file:e.enclosure["@attributes"].url};fetch("/api/podcaster/wizard/createEpisode",{method:"POST",headers:{"X-CSRF":panel.csrf,"X-TARGET-PAGE":this.pageValues.podcasterwizarddestination[0].id,"X-PAGE-TEMPLATE":this.pageValues.podcasterwizardtemplate,"X-PAGE-STATUS":this.pageValues.podcasterwizardpagestatus},body:JSON.stringify(i)}).then(function(e){return e.json()}).then(function(i){t.currentEpisode=e.title,void 0!==i.status?t.numFailed++:(t.feedItems.push({title:i.title,slug:i.slug,file:i.file}),t.numRemain--,0===t.numRemain&&t.startAudioDownload())}).catch(function(e){console.log(e),t.numFailed++})},downloadAudio:function(){var e=this,t=this.feedItems[0].slug,i=this.feedItems[0].file;this.feedItems.shift(),fetch("/api/podcaster/wizard/createFile",{method:"POST",headers:{"X-CSRF":panel.csrf,"X-TARGET-PAGE":t},body:JSON.stringify({file:i})}).then(function(e){return e.json()}).then(function(t){void 0!==t.status?e.failed++:e.numDownload=e.feedItems.length,e.startAudioDownload()}).catch(function(t){console.log(t),e.failed++})}}};if(typeof H==="function"){H=H.options}Object.assign(H,function(){var render=function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c("section",{staticClass:"k-modified-section podcaster-import-wizard"},[_c("k-headline",[_vm._v(_vm._s(_vm.headline))]),_vm._v(" "),_c("div",{staticClass:"log"},[_c("div",{staticClass:"important"},[_vm._v("Do not close this page until the import is finished!")]),_vm._v(" "),_c("div",{staticClass:"currentState"},[_vm._v("Processing \xBB"+_vm._s(_vm.currentEpisode)+"\xAB")]),_vm._v(" "),_c("div",[_vm._v("Trying to parse \xBB"+_vm._s(_vm.feedName)+"\xAB")]),_vm._v(" "),_c("div",[_vm._v("Found "+_vm._s(_vm.numItems)+" episodes in feed")]),_vm._v(" "),_c("div",[_vm._v("creating pages, "),_c("strong",[_vm._v(_vm._s(_vm.numRemain))]),_vm._v(" remaining")]),_vm._v(" "),_c("div",[_c("strong",[_vm._v(_vm._s(_vm.numDownload))]),_vm._v(" audio downloads remaining")]),_vm._v(" "),_c("div",[_vm._v(_vm._s(_vm.failed)+" failed attempts")])]),_vm._v(" "),_c("button",{staticClass:"k-button start-import",on:{"click":_vm.startImport}},[_vm._v("Start import")])],1)};var staticRenderFns=[];return{render:render,staticRenderFns:staticRenderFns,_compiled:true,_scopeId:null,functional:undefined}}());panel.plugin("mauricerenck/podcaster",{sections:{podcasterEpisodeStats:t,podcasterYearlyGraph:s,podcasterTopTen:e,podcasterFeedStats:K,podcasterWizard:H}});})();
\ No newline at end of file
+parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}function i(t){var e=window.getComputedStyle(t),s=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight);return t.clientWidth-s}function a(t,e,s){var i=document.createEvent("HTMLEvents");for(var a in i.initEvent(e,!0,!0),s)i[a]=s[a];return t.dispatchEvent(i)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.AxisChart=exports.Heatmap=exports.PieChart=exports.PercentageChart=exports.Chart=void 0,t.create=((e,s)=>{var i=document.createElement(e);for(var a in s){var n=s[a];if("inside"===a)t(n).appendChild(i);else if("around"===a){var r=t(n);r.parentNode.insertBefore(i,r),i.appendChild(r)}else"styles"===a?"object"==typeof n&&Object.keys(n).map(t=>{i.style[t]=n[t]}):a in i?i[a]=n:i.setAttribute(a,n)}return i});const n={margins:{top:10,bottom:10,left:20,right:20},paddings:{top:20,bottom:40,left:30,right:10},baseHeight:240,titleHeight:20,legendHeight:30,titleFontSize:12};function r(t){return t.titleHeight+t.margins.top+t.paddings.top}function o(t){return t.margins.left+t.paddings.left}function l(t){return t.margins.top+t.margins.bottom+t.paddings.top+t.paddings.bottom+t.titleHeight+t.legendHeight}function h(t){return t.margins.left+t.margins.right+t.paddings.left+t.paddings.right}const d=700,c=400,p="line",u=["line","bar"],m=100,g=.5,f=.01,y=4,x=4,b=20,v=2,w=5,A=10,k=2,L=7,P=5,T=["light-blue","blue","violet","red","orange","yellow","green","light-green","purple","magenta","light-grey","dark-grey"],C=["#ebedf0","#c6e48b","#7bc96f","#239a3b","#196127"],D={bar:T,line:T,pie:T,percentage:T,heatmap:C,donut:T},M=Math.PI/180,N=360;class S{constructor({parent:t=null,colors:e=[]}){this.parent=t,this.colors=e,this.titleName="",this.titleValue="",this.listValues=[],this.titleValueFirst=0,this.x=0,this.y=0,this.top=0,this.left=0,this.setup()}setup(){this.makeTooltip()}refresh(){this.fill(),this.calcPosition()}makeTooltip(){this.container=t.create("div",{inside:this.parent,className:"graph-svg-tip comparison",innerHTML:'\n\t\t\t\t\n\t\t\t\t'}),this.hideTip(),this.title=this.container.querySelector(".title"),this.dataPointList=this.container.querySelector(".data-point-list"),this.parent.addEventListener("mouseleave",()=>{this.hideTip()})}fill(){let e;this.index&&this.container.setAttribute("data-point-index",this.index),e=this.titleValueFirst?`${this.titleValue}${this.titleName}`:`${this.titleName}${this.titleValue}`,this.title.innerHTML=e,this.dataPointList.innerHTML="",this.listValues.map((e,s)=>{const i=this.colors[s]||"black";let a=0===e.formatted||e.formatted?e.formatted:e.value,n=t.create("li",{styles:{"border-top":`3px solid ${i}`},innerHTML:`${0===a||a?a:""}\n\t\t\t\t\t${e.title?e.title:""}`});this.dataPointList.appendChild(n)})}calcPosition(){let t=this.container.offsetWidth;this.top=this.y-this.container.offsetHeight-P,this.left=this.x-t/2;let e=this.parent.offsetWidth-t,s=this.container.querySelector(".svg-pointer");if(this.left<0)s.style.left=`calc(50% - ${-1*this.left}px)`,this.left=0;else if(this.left>e){let t=`calc(50% + ${this.left-e}px)`;s.style.left=t,this.left=e}else s.style.left="50%"}setValues(t,e,s={},i=[],a=-1){this.titleName=s.name,this.titleValue=s.value,this.listValues=i,this.x=t,this.y=e,this.titleValueFirst=s.valueFirst||0,this.index=a,this.refresh()}hideTip(){this.container.style.top="0px",this.container.style.left="0px",this.container.style.opacity="0"}showTip(){this.container.style.top=this.top+"px",this.container.style.left=this.left+"px",this.container.style.opacity="1"}}function E(t){return parseFloat(t.toFixed(2))}function O(t,e,s,i=!1){s||(s=i?t[0]:t[t.length-1]);let a=new Array(Math.abs(e)).fill(s);return t=i?a.concat(t):t.concat(a)}function $(t,e){return(t+"").length*e}function z(t,e){return{x:Math.sin(t*M)*e,y:Math.cos(t*M)*e}}function W(t,e){let s,i;return t<=e?(s=e-t,i=t):(s=t-e,i=e),[s,i]}function H(t,e,s=e.length-t.length){return s>0?t=O(t,s):e=O(e,s),[t,e]}const F={"light-blue":"#7cd6fd",blue:"#5e64ff",violet:"#743ee2",red:"#ff5858",orange:"#ffa00a",yellow:"#feef72",green:"#28a745","light-green":"#98d85b",purple:"#b554ff",magenta:"#ffa3ef",black:"#36114C",grey:"#bdd3e6","light-grey":"#f0f4f7","dark-grey":"#b8c2cc"};function R(t){return t>255?255:t<0?0:t}function I(t,e){let s=V(t),i=!1;"#"==s[0]&&(s=s.slice(1),i=!0);let a=parseInt(s,16),n=R((a>>16)+e),r=R((a>>8&255)+e);return(i?"#":"")+(R((255&a)+e)|r<<8|n<<16).toString(16)}function Y(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)}const V=t=>F[t]||t,j=6,B=4,U=10,G="#dadada",q="#555b51";function X(t,e){return"string"==typeof t?(e||document).querySelector(t):t||null}function _(t,e){var s=document.createElementNS("http://www.w3.org/2000/svg",t);for(var i in e){var a=e[i];if("inside"===i)X(a).appendChild(s);else if("around"===i){var n=X(a);n.parentNode.insertBefore(s,n),s.appendChild(n)}else"styles"===i?"object"==typeof a&&Object.keys(a).map(t=>{s.style[t]=a[t]}):("className"===i&&(i="class"),"innerHTML"===i?s.textContent=a:s.setAttribute(i,a))}return s}function J(t,e){return _("linearGradient",{inside:t,id:e,x1:0,x2:0,y1:0,y2:1})}function K(t,e,s,i){return _("stop",{inside:t,style:`stop-color: ${s}`,offset:e,"stop-opacity":i})}function Q(t,e,s,i){return _("svg",{className:e,inside:t,width:s,height:i})}function Z(t){return _("defs",{inside:t})}function tt(t,e="",s){let i={className:t,transform:e};return s&&(i.inside=s),_("g",i)}function et(t,e="",s="none",i="none",a=0){return _("path",{className:e,d:t,styles:{stroke:s,fill:i,"stroke-width":a}})}function st(t,e,s,i,a=1,n=0){let[r,o]=[s.x+t.x,s.y+t.y],[l,h]=[s.x+e.x,s.y+e.y];return`M${s.x} ${s.y}\n\t\tL${r} ${o}\n\t\tA ${i} ${i} 0 ${n} ${a?1:0}\n\t\t${l} ${h} z`}function it(t,e,s,i,a=1){let[n,r]=[s.x+t.x,s.y+t.y],[o,l]=[s.x+e.x,s.y+e.y];return`M${n} ${r}\n\t\tA ${i} ${i} 0 0 ${a?1:0}\n\t\t${o} ${l}`}function at(t,e,s=!1){let i="path-fill-gradient-"+e+"-"+(s?"lighter":"default"),a=J(t,i),n=[1,.6,.2];return s&&(n=[.4,.2,0]),K(a,"0%",e,n[0]),K(a,"50%",e,n[1]),K(a,"100%",e,n[2]),i}function nt(t,e,s,i,a=v,n="none"){return _("rect",{className:"percentage-bar",x:t,y:e,width:s,height:i,fill:n,styles:{stroke:I(n,-25),"stroke-dasharray":`0, ${i+s}, ${s}, ${i}`,"stroke-width":a}})}function rt(t,e,s,i,a="none",n={}){let r={className:t,x:e,y:s,width:i,height:i,fill:a};return Object.keys(n).map(t=>{r[t]=n[t]}),_("rect",r)}function ot(t,e,s,i="none",a){let n={className:"legend-bar",x:0,y:0,width:s,height:"2px",fill:i},r=_("text",{className:"legend-dataset-text",x:0,y:0,dy:2*U+"px","font-size":1.2*U+"px","text-anchor":"start",fill:q,innerHTML:a}),o=_("g",{transform:`translate(${t}, ${e})`});return o.appendChild(_("rect",n)),o.appendChild(r),o}function lt(t,e,s,i="none",a){let n={className:"legend-dot",cx:0,cy:0,r:s,fill:i},r=_("text",{className:"legend-dataset-text",x:0,y:0,dx:U+"px",dy:U/3+"px","font-size":1.2*U+"px","text-anchor":"start",fill:q,innerHTML:a}),o=_("g",{transform:`translate(${t}, ${e})`});return o.appendChild(_("circle",n)),o.appendChild(r),o}function ht(t,e,s,i,a={}){let n=a.fontSize||U;return _("text",{className:t,x:e,y:s,dy:(void 0!==a.dy?a.dy:n/2)+"px","font-size":n+"px",fill:a.fill||q,"text-anchor":a.textAnchor||"start",innerHTML:i})}function dt(t,e,s,i,a={}){a.stroke||(a.stroke=G);let n=_("line",{className:"line-vertical "+a.className,x1:0,x2:0,y1:s,y2:i,styles:{stroke:a.stroke}}),r=_("text",{x:0,y:s>i?s+B:s-B-U,dy:U+"px","font-size":U+"px","text-anchor":"middle",innerHTML:e+""}),o=_("g",{transform:`translate(${t}, 0)`});return o.appendChild(n),o.appendChild(r),o}function ct(t,e,s,i,a={}){a.stroke||(a.stroke=G),a.lineType||(a.lineType="");let n=_("line",{className:"line-horizontal "+a.className+("dashed"===a.lineType?"dashed":""),x1:s,x2:i,y1:0,y2:0,styles:{stroke:a.stroke}}),r=_("text",{x:st[s]+","+e).join("L"),r=et("M"+n,"line-graph-path",s);if(i.heatline){let t=at(a.svgDefs,s);r.style.stroke=`url(#${t})`}let o={path:r};if(i.regionFill){let e=at(a.svgDefs,s,!0),i="M"+`${t[0]},${a.zeroLine}L`+n+`L${t.slice(-1)[0]},${a.zeroLine}`;o.region=et(i,"region-fill","none",`url(#${e})`)}return o}let bt={bar:t=>{let e;"rect"!==t.nodeName&&(e=t.getAttribute("transform"),t=t.childNodes[0]);let s=t.cloneNode();return s.style.fill="#000000",s.style.opacity="0.4",e&&s.setAttribute("transform",e),s},dot:t=>{let e;"circle"!==t.nodeName&&(e=t.getAttribute("transform"),t=t.childNodes[0]);let s=t.cloneNode(),i=t.getAttribute("r"),a=t.getAttribute("fill");return s.setAttribute("r",parseInt(i)+4),s.setAttribute("fill",a),s.style.opacity="0.6",e&&s.setAttribute("transform",e),s},heat_square:t=>{let e;"circle"!==t.nodeName&&(e=t.getAttribute("transform"),t=t.childNodes[0]);let s=t.cloneNode(),i=t.getAttribute("r"),a=t.getAttribute("fill");return s.setAttribute("r",parseInt(i)+4),s.setAttribute("fill",a),s.style.opacity="0.6",e&&s.setAttribute("transform",e),s}},vt={bar:(t,e)=>{let s;"rect"!==t.nodeName&&(s=t.getAttribute("transform"),t=t.childNodes[0]);let i=["x","y","width","height"];Object.values(t.attributes).filter(t=>i.includes(t.name)&&t.specified).map(t=>{e.setAttribute(t.name,t.nodeValue)}),s&&e.setAttribute("transform",s)},dot:(t,e)=>{let s;"circle"!==t.nodeName&&(s=t.getAttribute("transform"),t=t.childNodes[0]);let i=["cx","cy"];Object.values(t.attributes).filter(t=>i.includes(t.name)&&t.specified).map(t=>{e.setAttribute(t.name,t.nodeValue)}),s&&e.setAttribute("transform",s)},heat_square:(t,e)=>{let s;"circle"!==t.nodeName&&(s=t.getAttribute("transform"),t=t.childNodes[0]);let i=["cx","cy"];Object.values(t.attributes).filter(t=>i.includes(t.name)&&t.specified).map(t=>{e.setAttribute(t.name,t.nodeValue)}),s&&e.setAttribute("transform",s)}};const wt=350,At=350,kt=wt,Lt=250,Pt="easein";function Tt(t,e,s,i){let a="string"==typeof e?e:e.join(", ");return[t,{transform:s.join(", ")},i,Pt,"translate",{transform:a}]}function Ct(t,e,s){return Tt(t,[s,0],[e,0],kt)}function Dt(t,e,s){return Tt(t,[0,s],[0,e],kt)}function Mt(t,e,s,i){let a=e-s,n=t.childNodes[0],r=n.getAttribute("width");return[[n,{height:a,"stroke-dasharray":`${r}, ${a}`},kt,Pt],Tt(t,[0,i],[0,s],kt)]}function Nt(t,e,s,i,a=0,n={}){let[r,o]=W(s,n.zeroLine);if(o-=a,"rect"!==t.nodeName){let s=[t.childNodes[0],{width:i,height:r},wt,Pt],a=t.getAttribute("transform").split("(")[1].slice(0,-1);return[s,Tt(t,a,[e,o],kt)]}return[[t,{width:i,height:r,x:e,y:o},wt,Pt]]}function St(t,e,s){if("circle"!==t.nodeName){let i=t.getAttribute("transform").split("(")[1].slice(0,-1);return[Tt(t,i,[e,s],kt)]}return[[t,{cx:e,cy:s},wt,Pt]]}function Et(t,e,s,i){let a=[],n=s.map((t,s)=>e[s]+","+t).join("L");const r=[t.path,{d:"M"+n},At,Pt];if(a.push(r),t.region){let s=`${e[0]},${i}L`,r=`L${e.slice(-1)[0]}, ${i}`;const o=[t.region,{d:"M"+s+n+r},At,Pt];a.push(o)}return a}function Ot(t,e){return[t,{d:e},wt,Pt]}const $t={ease:"0.25 0.1 0.25 1",linear:"0 0 1 1",easein:"0.1 0.8 0.2 1",easeout:"0 0 0.58 1",easeinout:"0.42 0 0.58 1"};function zt(t,e,s,i="linear",a,n={}){let r=t.cloneNode(!0),o=t.cloneNode(!0);for(var l in e){let d;d="transform"===l?document.createElementNS("http://www.w3.org/2000/svg","animateTransform"):document.createElementNS("http://www.w3.org/2000/svg","animate");let c=n[l]||t.getAttribute(l),p=e[l],u={attributeName:l,from:c,to:p,begin:"0s",dur:s/1e3+"s",values:c+";"+p,keySplines:$t[i],keyTimes:"0;1",calcMode:"spline",fill:"freeze"};for(var h in a&&(u.type=a),u)d.setAttribute(h,u[h]);r.appendChild(d),a?o.setAttribute(l,`translate(${p})`):o.setAttribute(l,p)}return[r,o]}function Wt(t,e){t.style.transform=e,t.style.webkitTransform=e,t.style.msTransform=e,t.style.mozTransform=e,t.style.oTransform=e}function Ht(t,e){let s=[],i=[];e.map(t=>{let e,a,n=t[0],r=n.parentNode;t[0]=n,[e,a]=zt(...t),s.push(a),i.push([e,r]),r.replaceChild(e,n)});let a=t.cloneNode(!0);return i.map((t,i)=>{t[1].replaceChild(s[i],t[0]),e[i][0]=s[i]}),a}function Ft(t,e,s){if(0===s.length)return;let i=Ht(e,s);e.parentNode==t&&(t.removeChild(e),t.appendChild(i)),setTimeout(()=>{i.parentNode==t&&(t.removeChild(i),t.appendChild(e))},Lt)}const Rt=".chart-container{position:relative;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Roboto','Oxygen','Ubuntu','Cantarell','Fira Sans','Droid Sans','Helvetica Neue',sans-serif}.chart-container .axis,.chart-container .chart-label{fill:#555b51}.chart-container .axis line,.chart-container .chart-label line{stroke:#dadada}.chart-container .dataset-units circle{stroke:#fff;stroke-width:2}.chart-container .dataset-units path{fill:none;stroke-opacity:1;stroke-width:2px}.chart-container .dataset-path{stroke-width:2px}.chart-container .path-group path{fill:none;stroke-opacity:1;stroke-width:2px}.chart-container line.dashed{stroke-dasharray:5,3}.chart-container .axis-line .specific-value{text-anchor:start}.chart-container .axis-line .y-line{text-anchor:end}.chart-container .axis-line .x-line{text-anchor:middle}.chart-container .legend-dataset-text{fill:#6c7680;font-weight:600}.graph-svg-tip{position:absolute;z-index:99999;padding:10px;font-size:12px;color:#959da5;text-align:center;background:rgba(0,0,0,.8);border-radius:3px}.graph-svg-tip ul{padding-left:0;display:flex}.graph-svg-tip ol{padding-left:0;display:flex}.graph-svg-tip ul.data-point-list li{min-width:90px;flex:1;font-weight:600}.graph-svg-tip strong{color:#dfe2e5;font-weight:600}.graph-svg-tip .svg-pointer{position:absolute;height:5px;margin:0 0 0 -5px;content:' ';border:5px solid transparent;border-top-color:rgba(0,0,0,.8)}.graph-svg-tip.comparison{padding:0;text-align:left;pointer-events:none}.graph-svg-tip.comparison .title{display:block;padding:10px;margin:0;font-weight:600;line-height:1;pointer-events:none}.graph-svg-tip.comparison ul{margin:0;white-space:nowrap;list-style:none}.graph-svg-tip.comparison li{display:inline-block;padding:5px 10px}";function It(t,e){var s=document.createElement("a");s.style="display: none";var i=new Blob(e,{type:"image/svg+xml; charset=utf-8"}),a=window.URL.createObjectURL(i);s.href=a,s.download=t,document.body.appendChild(s),s.click(),setTimeout(function(){document.body.removeChild(s),window.URL.revokeObjectURL(a)},300)}function Yt(e){let s=e.cloneNode(!0);s.classList.add("chart-container"),s.setAttribute("xmlns","http://www.w3.org/2000/svg"),s.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink");let i=t.create("style",{innerHTML:Rt});s.insertBefore(i,s.firstChild);let a=t.create("div");return a.appendChild(s),a.innerHTML}let Vt;class jt{constructor(t,e){if(this.parent="string"==typeof t?document.querySelector(t):t,!(this.parent instanceof HTMLElement))throw new Error("No `parent` element to render on was provided.");this.rawChartArgs=e,this.title=e.title||"",this.type=e.type||"",this.realData=this.prepareData(e.data),this.data=this.prepareFirstData(this.realData),this.colors=this.validateColors(e.colors,this.type),this.config={showTooltip:1,showLegend:1,isNavigable:e.isNavigable||0,animate:1},this.measures=JSON.parse(JSON.stringify(n));let s=this.measures;this.setMeasures(e),this.title.length||(s.titleHeight=0),this.config.showLegend||(s.legendHeight=0),this.argHeight=e.height||s.baseHeight,this.state={},this.options={},this.initTimeout=d,this.config.isNavigable&&(this.overlays=[]),this.configure(e)}prepareData(t){return t}prepareFirstData(t){return t}validateColors(t,e){const s=[];return(t=(t||[]).concat(D[e])).forEach(t=>{const e=V(t);Y(e)?s.push(e):console.warn('"'+t+'" is not a valid color.')}),s}setMeasures(){}configure(){let t=this.argHeight;this.baseHeight=t,this.height=t-l(this.measures),Vt=this.boundDrawFn.bind(this),window.addEventListener("resize",Vt),window.addEventListener("orientationchange",this.boundDrawFn.bind(this))}boundDrawFn(){this.draw(!0)}unbindWindowEvents(){window.removeEventListener("resize",Vt),window.removeEventListener("orientationchange",this.boundDrawFn.bind(this))}setup(){this.makeContainer(),this.updateWidth(),this.makeTooltip(),this.draw(!1,!0)}makeContainer(){this.parent.innerHTML="";let e={inside:this.parent,className:"chart-container"};this.independentWidth&&(e.styles={width:this.independentWidth+"px"}),this.container=t.create("div",e)}makeTooltip(){this.tip=new S({parent:this.container,colors:this.colors}),this.bindTooltip()}bindTooltip(){}draw(t=!1,e=!1){this.updateWidth(),this.calc(t),this.makeChartArea(),this.setupComponents(),this.components.forEach(t=>t.setup(this.drawArea)),this.render(this.components,!1),e&&(this.data=this.realData,setTimeout(()=>{this.update(this.data)},this.initTimeout)),this.renderLegend(),this.setupNavigation(e)}calc(){}updateWidth(){this.baseWidth=i(this.parent),this.width=this.baseWidth-h(this.measures)}makeChartArea(){this.svg&&this.container.removeChild(this.svg);let t=this.measures;this.svg=Q(this.container,"frappe-chart chart",this.baseWidth,this.baseHeight),this.svgDefs=Z(this.svg),this.title.length&&(this.titleEL=ht("title",t.margins.left,t.margins.top,this.title,{fontSize:t.titleFontSize,fill:"#666666",dy:t.titleFontSize}));let e=r(t);this.drawArea=tt(this.type+"-chart chart-draw-area",`translate(${o(t)}, ${e})`),this.config.showLegend&&(e+=this.height+t.paddings.bottom,this.legendArea=tt("chart-legend",`translate(${o(t)}, ${e})`)),this.title.length&&this.svg.appendChild(this.titleEL),this.svg.appendChild(this.drawArea),this.config.showLegend&&this.svg.appendChild(this.legendArea),this.updateTipOffset(o(t),r(t))}updateTipOffset(t,e){this.tip.offset={x:t,y:e}}setupComponents(){this.components=new Map}update(t){t||console.error("No data to update."),this.data=this.prepareData(t),this.calc(),this.render()}render(t=this.components,e=!0){this.config.isNavigable&&this.overlays.map(t=>t.parentNode.removeChild(t));let s=[];t.forEach(t=>{s=s.concat(t.update(e))}),s.length>0?(Ft(this.container,this.svg,s),setTimeout(()=>{t.forEach(t=>t.make()),this.updateNav()},c)):(t.forEach(t=>t.make()),this.updateNav())}updateNav(){this.config.isNavigable&&(this.makeOverlay(),this.bindUnits())}renderLegend(){}setupNavigation(t=!1){this.config.isNavigable&&t&&(this.bindOverlay(),this.keyActions={13:this.onEnterKey.bind(this),37:this.onLeftArrow.bind(this),38:this.onUpArrow.bind(this),39:this.onRightArrow.bind(this),40:this.onDownArrow.bind(this)},document.addEventListener("keydown",t=>{s(this.container)&&(t=t||window.event,this.keyActions[t.keyCode]&&this.keyActions[t.keyCode]())}))}makeOverlay(){}updateOverlay(){}bindOverlay(){}bindUnits(){}onLeftArrow(){}onRightArrow(){}onUpArrow(){}onDownArrow(){}onEnterKey(){}addDataPoint(){}removeDataPoint(){}getDataPoint(){}setCurrentDataPoint(){}updateDataset(){}export(){let t=Yt(this.svg);It(this.title||"Chart",[t])}}class Bt extends jt{constructor(t,e){super(t,e)}configure(t){super.configure(t),this.config.maxSlices=t.maxSlices||20,this.config.maxLegendPoints=t.maxLegendPoints||20}calc(){let t=this.state,e=this.config.maxSlices;t.sliceTotals=[];let s=this.data.labels.map((t,e)=>{let s=0;return this.data.datasets.map(t=>{s+=t.values[e]}),[s,t]}).filter(t=>t[0]>=0),i=s;if(s.length>e){s.sort((t,e)=>e[0]-t[0]),i=s.slice(0,e-1);let t=s.slice(e-1),a=0;t.map(t=>{a+=t[0]}),i.push([a,"Rest"]),this.colors[e-1]="grey"}t.labels=[],i.map(e=>{t.sliceTotals.push(e[0]),t.labels.push(e[1])}),t.grandTotal=t.sliceTotals.reduce((t,e)=>t+e,0),this.center={x:this.width/2,y:this.height/2}}renderLegend(){let t=this.state;this.legendArea.textContent="",this.legendTotals=t.sliceTotals.slice(0,this.config.maxLegendPoints);let e=0,s=0;this.legendTotals.map((i,a)=>{let n=Math.floor((this.width-h(this.measures))/110);e>n&&(e=0,s+=20);let r=lt(110*e+5,s,5,this.colors[a],`${t.labels[a]}: ${i}`);this.legendArea.appendChild(r),e++})}}const Ut=12,Gt=7,qt=1e3,Xt=86400,_t=["January","February","March","April","May","June","July","August","September","October","November","December"],Jt=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function Kt(t){let e=new Date(t);return e.setMinutes(e.getMinutes()-e.getTimezoneOffset()),e}function Qt(t){let e=t.getDate(),s=t.getMonth()+1;return[t.getFullYear(),(s>9?"":"0")+s,(e>9?"":"0")+e].join("-")}function Zt(t){return new Date(t.getTime())}function te(t,e){let s=ne(t);return Math.ceil(ee(s,e)/Gt)}function ee(t,e){let s=Xt*qt;return(Kt(e)-Kt(t))/s}function se(t,e){return t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear()}function ie(t,e=!1){let s=_t[t];return e?s.slice(0,3):s}function ae(t,e){return new Date(e,t+1,0)}function ne(t){let e=Zt(t);const s=e.getDay();return 0!==s&&re(e,-1*s),e}function re(t,e){t.setDate(t.getDate()+e)}class oe{constructor({layerClass:t="",layerTransform:e="",constants:s,getData:i,makeElements:a,animateElements:n}){this.layerTransform=e,this.constants=s,this.makeElements=a,this.getData=i,this.animateElements=n,this.store=[],this.labels=[],this.layerClass=t,this.layerClass="function"==typeof this.layerClass?this.layerClass():this.layerClass,this.refresh()}refresh(t){this.data=t||this.getData()}setup(t){this.layer=tt(this.layerClass,this.layerTransform,t)}make(){this.render(this.data),this.oldData=this.data}render(t){this.store=this.makeElements(t),this.layer.textContent="",this.store.forEach(t=>{this.layer.appendChild(t)}),this.labels.forEach(t=>{this.layer.appendChild(t)})}update(t=!0){this.refresh();let e=[];return t&&(e=this.animateElements(this.data)||[]),e}}let le={donutSlices:{layerClass:"donut-slices",makeElements:t=>t.sliceStrings.map((e,s)=>{let i=et(e,"donut-path",t.colors[s],"none",t.strokeWidth);return i.style.transition="transform .3s;",i}),animateElements(t){return this.store.map((e,s)=>Ot(e,t.sliceStrings[s]))}},pieSlices:{layerClass:"pie-slices",makeElements:t=>t.sliceStrings.map((e,s)=>{let i=et(e,"pie-path","none",t.colors[s]);return i.style.transition="transform .3s;",i}),animateElements(t){return this.store.map((e,s)=>Ot(e,t.sliceStrings[s]))}},percentageBars:{layerClass:"percentage-bars",makeElements(t){return t.xPositions.map((e,s)=>{return nt(e,0,t.widths[s],this.constants.barHeight,this.constants.barDepth,t.colors[s])})},animateElements(t){if(t)return[]}},yAxis:{layerClass:"y axis",makeElements(t){return t.positions.map((e,s)=>pt(e,t.labels[s],this.constants.width,{mode:this.constants.mode,pos:this.constants.pos}))},animateElements(t){let e=t.positions,s=t.labels,i=this.oldData.positions,a=this.oldData.labels;return[i,e]=H(i,e),[a,s]=H(a,s),this.render({positions:i,labels:s}),this.store.map((t,s)=>Dt(t,e[s],i[s]))}},xAxis:{layerClass:"x axis",makeElements(t){return t.positions.map((e,s)=>ut(e,t.calcLabels[s],this.constants.height,{mode:this.constants.mode,pos:this.constants.pos}))},animateElements(t){let e=t.positions,s=t.calcLabels,i=this.oldData.positions,a=this.oldData.calcLabels;return[i,e]=H(i,e),[a,s]=H(a,s),this.render({positions:i,calcLabels:s}),this.store.map((t,s)=>Ct(t,e[s],i[s]))}},yMarkers:{layerClass:"y-markers",makeElements(t){return t.map(t=>mt(t.position,t.label,this.constants.width,{labelPos:t.options.labelPos,mode:"span",lineType:"dashed"}))},animateElements(t){[this.oldData,t]=H(this.oldData,t);let e=t.map(t=>t.position),s=t.map(t=>t.label),i=t.map(t=>t.options),a=this.oldData.map(t=>t.position);return this.render(a.map((t,e)=>({position:a[e],label:s[e],options:i[e]}))),this.store.map((t,s)=>Dt(t,e[s],a[s]))}},yRegions:{layerClass:"y-regions",makeElements(t){return t.map(t=>gt(t.startPos,t.endPos,this.constants.width,t.label,{labelPos:t.options.labelPos}))},animateElements(t){[this.oldData,t]=H(this.oldData,t);let e=t.map(t=>t.endPos),s=t.map(t=>t.label),i=t.map(t=>t.startPos),a=t.map(t=>t.options),n=this.oldData.map(t=>t.endPos),r=this.oldData.map(t=>t.startPos);this.render(n.map((t,e)=>({startPos:r[e],endPos:n[e],label:s[e],options:a[e]})));let o=[];return this.store.map((t,s)=>{o=o.concat(Mt(t,i[s],e[s],n[s]))}),o}},heatDomain:{layerClass:function(){return"heat-domain domain-"+this.constants.index},makeElements(t){let{index:e,colWidth:s,rowHeight:i,squareSize:a,xTranslate:n}=this.constants,r=n,o=0;return this.serializedSubDomains=[],t.cols.map((t,n)=>{1===n&&this.labels.push(ht("domain-name",r,-12,ie(e,!0).toUpperCase(),{fontSize:9})),t.map((t,e)=>{if(t.fill){let s={"data-date":t.yyyyMmDd,"data-value":t.dataValue,"data-day":e},i=rt("day",r,o,a,t.fill,s);this.serializedSubDomains.push(i)}o+=i}),o=0,r+=s}),this.serializedSubDomains},animateElements(t){if(t)return[]}},barGraph:{layerClass:function(){return"dataset-units dataset-bars dataset-"+this.constants.index},makeElements(t){let e=this.constants;return this.unitType="bar",this.units=t.yPositions.map((s,i)=>ft(t.xPositions[i],s,t.barWidth,e.color,t.labels[i],i,t.offsets[i],{zeroLine:t.zeroLine,barsWidth:t.barsWidth,minHeight:e.minHeight})),this.units},animateElements(t){let e=t.xPositions,s=t.yPositions,i=t.offsets,a=t.labels,n=this.oldData.xPositions,r=this.oldData.yPositions,o=this.oldData.offsets,l=this.oldData.labels;[n,e]=H(n,e),[r,s]=H(r,s),[o,i]=H(o,i),[l,a]=H(l,a),this.render({xPositions:n,yPositions:r,offsets:o,labels:a,zeroLine:this.oldData.zeroLine,barsWidth:this.oldData.barsWidth,barWidth:this.oldData.barWidth});let h=[];return this.store.map((a,n)=>{h=h.concat(Nt(a,e[n],s[n],t.barWidth,i[n],{zeroLine:t.zeroLine}))}),h}},lineGraph:{layerClass:function(){return"dataset-units dataset-line dataset-"+this.constants.index},makeElements(t){let e=this.constants;return this.unitType="dot",this.paths={},e.hideLine||(this.paths=xt(t.xPositions,t.yPositions,e.color,{heatline:e.heatline,regionFill:e.regionFill},{svgDefs:e.svgDefs,zeroLine:t.zeroLine})),this.units=[],e.hideDots||(this.units=t.yPositions.map((s,i)=>yt(t.xPositions[i],s,t.radius,e.color,e.valuesOverPoints?t.values[i]:"",i))),Object.values(this.paths).concat(this.units)},animateElements(t){let e=t.xPositions,s=t.yPositions,i=t.values,a=this.oldData.xPositions,n=this.oldData.yPositions,r=this.oldData.values;[a,e]=H(a,e),[n,s]=H(n,s),[r,i]=H(r,i),this.render({xPositions:a,yPositions:n,values:i,zeroLine:this.oldData.zeroLine,radius:this.oldData.radius});let o=[];return Object.keys(this.paths).length&&(o=o.concat(Et(this.paths,e,s,t.zeroLine))),this.units.length&&this.units.map((t,i)=>{o=o.concat(St(t,e[i],s[i]))}),o}}};function he(t,e,s){let i=Object.keys(le).filter(e=>t.includes(e)),a=le[i[0]];return Object.assign(a,{constants:e,getData:s}),new oe(a)}class de extends Bt{constructor(t,e){super(t,e),this.type="percentage",this.setup()}setMeasures(t){let e=this.measures;this.barOptions=t.barOptions||{};let s=this.barOptions;s.height=s.height||b,s.depth=s.depth||v,e.paddings.right=30,e.legendHeight=80,e.baseHeight=8*(s.height+.5*s.depth)}setupComponents(){let t=this.state,e=[["percentageBars",{barHeight:this.barOptions.height,barDepth:this.barOptions.depth},function(){return{xPositions:t.xPositions,widths:t.widths,colors:this.colors}}.bind(this)]];this.components=new Map(e.map(t=>{let e=he(...t);return[t[0],e]}))}calc(){super.calc();let t=this.state;t.xPositions=[],t.widths=[];let e=0;t.sliceTotals.map(s=>{let i=this.width*s/t.grandTotal;t.widths.push(i),t.xPositions.push(e),e+=i})}makeDataByIndex(){}bindTooltip(){let t=this.state;this.container.addEventListener("mousemove",s=>{let i=this.components.get("percentageBars").store,a=s.target;if(i.includes(a)){let s=i.indexOf(a),n=e(this.container),r=e(a),o=r.left-n.left+parseInt(a.getAttribute("width"))/2,l=r.top-n.top,h=(this.formattedLabels&&this.formattedLabels.length>0?this.formattedLabels[s]:this.state.labels[s])+": ",d=t.sliceTotals[s]/t.grandTotal;this.tip.setValues(o,l,{name:h,value:(100*d).toFixed(1)+"%"}),this.tip.showTip()}})}}exports.PercentageChart=de;class ce extends Bt{constructor(t,e){super(t,e),this.type="pie",this.initTimeout=0,this.init=1,this.setup()}configure(t){super.configure(t),this.mouseMove=this.mouseMove.bind(this),this.mouseLeave=this.mouseLeave.bind(this),this.hoverRadio=t.hoverRadio||.1,this.config.startAngle=t.startAngle||0,this.clockWise=t.clockWise||!1}calc(){super.calc();let t=this.state;this.radius=this.height>this.width?this.center.x:this.center.y;const{radius:e,clockWise:s}=this,i=t.slicesProperties||[];t.sliceStrings=[],t.slicesProperties=[];let a=180-this.config.startAngle;t.sliceTotals.map((n,r)=>{const o=a,l=n/t.grandTotal*N;let h=0;l>180&&(h=1);const d=s?-l:l,c=a+=d,p=z(o,e),u=z(c,e),m=this.init&&i[r];let g,f;this.init?(g=m?m.startPosition:p,f=m?m.endPosition:p):(g=p,f=u);const y=st(g,f,this.center,this.radius,s,h);t.sliceStrings.push(y),t.slicesProperties.push({startPosition:p,endPosition:u,value:n,total:t.grandTotal,startAngle:o,endAngle:c,angle:d})}),this.init=0}setupComponents(){let t=this.state,e=[["pieSlices",{},function(){return{sliceStrings:t.sliceStrings,colors:this.colors}}.bind(this)]];this.components=new Map(e.map(t=>{let e=he(...t);return[t[0],e]}))}calTranslateByAngle(t){const{radius:e,hoverRadio:s}=this,i=z(t.startAngle+t.angle/2,e);return`translate3d(${i.x*s}px,${i.y*s}px,0)`}hoverSlice(t,s,i,a){if(!t)return;const n=this.colors[s];if(i){Wt(t,this.calTranslateByAngle(this.state.slicesProperties[s])),t.style.fill=I(n,50);let i=e(this.svg),r=a.pageX-i.left+10,o=a.pageY-i.top-10,l=(this.formatted_labels&&this.formatted_labels.length>0?this.formatted_labels[s]:this.state.labels[s])+": ",h=(100*this.state.sliceTotals[s]/this.state.grandTotal).toFixed(1);this.tip.setValues(r,o,{name:l,value:h+"%"}),this.tip.showTip()}else Wt(t,"translate3d(0,0,0)"),this.tip.hideTip(),t.style.fill=n}bindTooltip(){this.container.addEventListener("mousemove",this.mouseMove),this.container.addEventListener("mouseleave",this.mouseLeave)}mouseMove(t){const e=t.target;let s=this.components.get("pieSlices").store,i=this.curActiveSliceIndex,a=this.curActiveSlice;if(s.includes(e)){let n=s.indexOf(e);this.hoverSlice(a,i,!1),this.curActiveSlice=e,this.curActiveSliceIndex=n,this.hoverSlice(e,n,!0,t)}else this.mouseLeave()}mouseLeave(){this.hoverSlice(this.curActiveSlice,this.curActiveSliceIndex,!1)}}function pe(t){if(0===t)return[0,0];if(isNaN(t))return{mantissa:-6755399441055744,exponent:972};var e=t>0?1:-1;if(!isFinite(t))return{mantissa:4503599627370496*e,exponent:972};t=Math.abs(t);var s=Math.floor(Math.log10(t));return[e*(t/Math.pow(10,s)),s]}function ue(t,e=0){let s=Math.ceil(t),i=Math.floor(e),a=s-i,n=a,r=1;a>5&&(a%2!=0&&(a=++s-i),n=a/2,r=2),a<=2&&(r=a/(n=4)),0===a&&(n=5,r=1);let o=[];for(var l=0;l<=n;l++)o.push(i+r*l);return o}function me(t,e=0){let[s,i]=pe(t),a=e?e/Math.pow(10,i):0,n=ue(s=s.toFixed(6),a);return n=n.map(t=>t*Math.pow(10,i))}function ge(t,e=!1){let s=Math.max(...t),i=Math.min(...t),a=0,n=[];function r(t,e){let s=me(t),i=s[1]-s[0],a=0;for(var n=1;a=0&&i>=0)a=pe(s)[1],n=e?me(s,i):me(s);else if(s>0&&i<0){let t=Math.abs(i);if(s>=t)a=pe(s)[1],n=r(s,t);else{a=pe(t)[1],n=r(t,s).map(t=>-1*t)}}else if(s<=0&&i<=0){let t=Math.abs(i),r=Math.abs(s);a=pe(t)[1],n=(n=e?me(t,r):me(t)).reverse().map(t=>-1*t)}return n}function fe(t){let e,s=ye(t);if(t.indexOf(0)>=0)e=t.indexOf(0);else if(t[0]>0){e=-1*t[0]/s}else{e=-1*t[t.length-1]/s+(t.length-1)}return e}function ye(t){return t[1]-t[0]}function xe(t){return t[t.length-1]-t[0]}function be(t,e){return E(e.zeroLine-t*e.scaleMultiplier)}function ve(t,e,s=!1){let i=e.reduce(function(e,s){return Math.abs(s-t)et.end)throw new Error("Start date cannot be greater than end date.");if(t.start||(t.start=new Date,t.start.setFullYear(t.start.getFullYear()-1)),t.end||(t.end=new Date),t.dataPoints=t.dataPoints||{},parseInt(Object.keys(t.dataPoints)[0])>1e5){let e={};Object.keys(t.dataPoints).forEach(s=>{let i=new Date(s*qt);e[Qt(i)]=t.dataPoints[s]}),t.dataPoints=e}return t}calc(){let t=this.state;t.start=Zt(this.data.start),t.end=Zt(this.data.end),t.firstWeekStart=Zt(t.start),t.noOfWeeks=te(t.start,t.end),t.distribution=we(Object.values(this.data.dataPoints),w),t.domainConfigs=this.getDomains()}setupComponents(){let t=this.state,e=this.discreteDomains?0:1,s=t.domainConfigs.map((s,i)=>["heatDomain",{index:s.index,colWidth:ke,rowHeight:Le,squareSize:A,xTranslate:t.domainConfigs.filter((t,e)=>et.cols.length-e).reduce((t,e)=>t+e,0)*ke},function(){return t.domainConfigs[i]}.bind(this)]);this.components=new Map(s.map((t,e)=>{let s=he(...t);return[t[0]+"-"+e,s]}));let i=0;Jt.forEach((t,e)=>{if([1,3,5].includes(e)){let e=ht("subdomain-name",-ke/2,i,t,{fontSize:A,dy:8,textAnchor:"end"});this.drawArea.appendChild(e)}i+=Le})}update(t){t||console.error("No data to update."),this.data=this.prepareData(t),this.draw(),this.bindTooltip()}bindTooltip(){this.container.addEventListener("mousemove",t=>{this.components.forEach(e=>{let s=e.store,i=t.target;if(s.includes(i)){let e=i.getAttribute("data-value"),s=i.getAttribute("data-date").split("-"),a=ie(parseInt(s[1])-1,!0),n=this.container.getBoundingClientRect(),r=i.getBoundingClientRect(),o=parseInt(t.target.getAttribute("width")),l=r.left-n.left+o/2,h=r.top-n.top,d=e+" "+this.countLabel,c=" on "+a+" "+s[0]+", "+s[2];this.tip.setValues(l,h,{name:c,value:d,valueFirst:1},[]),this.tip.showTip()}})})}renderLegend(){this.legendArea.textContent="";let t=0,e=Le,s=ht("subdomain-name",t,e,"Less",{fontSize:A+1,dy:9});t=2*ke+ke/2,this.legendArea.appendChild(s),this.colors.slice(0,w).map((s,i)=>{const a=rt("heatmap-legend-unit",t+(ke+3)*i,e,A,s);this.legendArea.appendChild(a)});let i=ht("subdomain-name",t+w*(ke+3)+ke/4,e,"More",{fontSize:A+1,dy:9});this.legendArea.appendChild(i)}getDomains(){let t=this.state;const[e,s]=[t.start.getMonth(),t.start.getFullYear()],[i,a]=[t.end.getMonth(),t.end.getFullYear()],n=i-e+1+12*(a-s);let r=[],o=Zt(t.start);for(var l=0;l=i.start&&a<=i.end;s||a.getMonth()!==e||!r?t.yyyyMmDd=Qt(a):t=this.getSubDomainConfig(a),n.push(t)}return n}getSubDomainConfig(t){let e=Qt(t),s=this.data.dataPoints[e];return{yyyyMmDd:e,dataValue:s||0,fill:this.colors[Ae(s,this.state.distribution)]}}}function Te(t,e){t.labels=t.labels||[];let s=t.labels.length,i=t.datasets,a=new Array(s).fill(0);return i||(i=[{values:a}]),i.map(t=>{if(t.values){let e=t.values;e=(e=e.map(t=>isNaN(t)?0:t)).length>s?e.slice(0,s):O(e,s-e.length,0)}else t.values=a;t.chartType||(u.includes(e),t.chartType=e)}),t.yRegions&&t.yRegions.map(t=>{t.end({name:"",values:s.slice(0,-1),chartType:t.chartType}))};return t.yMarkers&&(i.yMarkers=[{value:0,label:""}]),t.yRegions&&(i.yRegions=[{start:0,end:0,label:""}]),i}function De(t,e=[],s=!0){let i=t/e.length;i<=0&&(i=1);let a=i/L;return e.map((t,e)=>{if((t+="").length>a)if(s){e%Math.ceil(t.length/a)!=0&&(t="")}else t=a-3>0?t.slice(0,a-3)+" ...":t.slice(0,a)+"..";return t})}exports.Heatmap=Pe;class Me extends jt{constructor(t,e){super(t,e),this.barOptions=e.barOptions||{},this.lineOptions=e.lineOptions||{},this.type=e.type||"line",this.init=1,this.setup()}setMeasures(){this.data.datasets.length<=1&&(this.config.showLegend=0,this.measures.paddings.bottom=30)}configure(t){super.configure(t),t.axisOptions=t.axisOptions||{},t.tooltipOptions=t.tooltipOptions||{},this.config.xAxisMode=t.axisOptions.xAxisMode||"span",this.config.yAxisMode=t.axisOptions.yAxisMode||"span",this.config.xIsSeries=t.axisOptions.xIsSeries||0,this.config.formatTooltipX=t.tooltipOptions.formatTooltipX,this.config.formatTooltipY=t.tooltipOptions.formatTooltipY,this.config.valuesOverPoints=t.valuesOverPoints}prepareData(t=this.data){return Te(t,this.type)}prepareFirstData(t=this.data){return Ce(t)}calc(t=!1){this.calcXPositions(),t||this.calcYAxisParameters(this.getAllYValues(),"line"===this.type),this.makeDataByIndex()}calcXPositions(){let t=this.state,e=this.data.labels;t.datasetLength=e.length,t.unitWidth=this.width/t.datasetLength,t.xOffset=t.unitWidth/2,t.xAxis={labels:e,positions:e.map((e,s)=>E(t.xOffset+s*t.unitWidth))}}calcYAxisParameters(t,e="false"){const s=ge(t,e),i=this.height/xe(s),a=ye(s)*i,n=this.height-fe(s)*a;this.state.yAxis={labels:s,positions:s.map(t=>n-t*i),scaleMultiplier:i,zeroLine:n},this.calcDatasetPoints(),this.calcYExtremes(),this.calcYRegions()}calcDatasetPoints(){let t=this.state,e=e=>e.map(e=>be(e,t.yAxis));t.datasets=this.data.datasets.map((t,s)=>{let i=t.values,a=t.cumulativeYs||[];return{name:t.name,index:s,chartType:t.chartType,values:i,yPositions:e(i),cumulativeYs:a,cumulativeYPos:e(a)}})}calcYExtremes(){let t=this.state;this.barOptions.stacked?t.yExtremes=t.datasets[t.datasets.length-1].cumulativeYPos:(t.yExtremes=new Array(t.datasetLength).fill(9999),t.datasets.map(e=>{e.yPositions.map((e,s)=>{e(e.position=be(e.value,t.yAxis),e.options||(e.options={}),e))),this.data.yRegions&&(this.state.yRegions=this.data.yRegions.map(e=>(e.startPos=be(e.start,t.yAxis),e.endPos=be(e.end,t.yAxis),e.options||(e.options={}),e)))}getAllYValues(){let t="values";if(this.barOptions.stacked){t="cumulativeYs";let e=new Array(this.state.datasetLength).fill(0);this.data.datasets.map((s,i)=>{let a=this.data.datasets[i].values;s[t]=e=e.map((t,e)=>t+a[e])})}let e=this.data.datasets.map(e=>e[t]);return this.data.yMarkers&&e.push(this.data.yMarkers.map(t=>t.value)),this.data.yRegions&&this.data.yRegions.map(t=>{e.push([t.end,t.start])}),[].concat(...e)}setupComponents(){let t=[["yAxis",{mode:this.config.yAxisMode,width:this.width},function(){return this.state.yAxis}.bind(this)],["xAxis",{mode:this.config.xAxisMode,height:this.height},function(){let t=this.state;return t.xAxis.calcLabels=De(this.width,t.xAxis.labels,this.config.xIsSeries),t.xAxis}.bind(this)],["yRegions",{width:this.width,pos:"right"},function(){return this.state.yRegions}.bind(this)]],e=this.state.datasets.filter(t=>"bar"===t.chartType),s=this.state.datasets.filter(t=>"line"===t.chartType),i=e.map(t=>{let s=t.index;return["barGraph-"+t.index,{index:s,color:this.colors[s],stacked:this.barOptions.stacked,valuesOverPoints:this.config.valuesOverPoints,minHeight:this.height*f},function(){let t=this.state,i=t.datasets[s],a=this.barOptions.stacked,n=this.barOptions.spaceRatio||g,r=t.unitWidth*(1-n),o=r/(a?1:e.length),l=t.xAxis.positions.map(t=>t-r/2);a||(l=l.map(t=>t+o*s));let h=new Array(t.datasetLength).fill("");this.config.valuesOverPoints&&(h=a&&i.index===t.datasets.length-1?i.cumulativeYs:i.values);let d=new Array(t.datasetLength).fill(0);return a&&(d=i.yPositions.map((t,e)=>t-i.cumulativeYPos[e])),{xPositions:l,yPositions:i.yPositions,offsets:d,labels:h,zeroLine:t.yAxis.zeroLine,barsWidth:r,barWidth:o}}.bind(this)]}),a=s.map(t=>{let e=t.index;return["lineGraph-"+t.index,{index:e,color:this.colors[e],svgDefs:this.svgDefs,heatline:this.lineOptions.heatline,regionFill:this.lineOptions.regionFill,hideDots:this.lineOptions.hideDots,hideLine:this.lineOptions.hideLine,valuesOverPoints:this.config.valuesOverPoints},function(){let t=this.state,s=t.datasets[e],i=t.yAxis.positions[0]!r.includes(t[0])||this.state[t[0]]).map(t=>{let e=he(...t);return(t[0].includes("lineGraph")||t[0].includes("barGraph"))&&this.dataUnitComponents.push(e),[t[0],e]}))}makeDataByIndex(){this.dataByIndex={};let t=this.state,e=this.config.formatTooltipX,s=this.config.formatTooltipY;t.xAxis.labels.map((i,a)=>{let n=this.state.datasets.map((t,e)=>{let i=t.values[a];return{title:t.name,value:i,yPos:t.yPositions[a],color:this.colors[e],formatted:s?s(i):i}});this.dataByIndex[a]={label:i,formattedLabel:e?e(i):i,xPos:t.xAxis.positions[a],values:n,yExtreme:t.yExtremes[a]}})}bindTooltip(){this.container.addEventListener("mousemove",t=>{let s=this.measures,i=e(this.container),a=t.pageX-i.left-o(s),n=t.pageY-i.top;nr(s)?this.mapTooltipXPosition(a):this.tip.hideTip()})}mapTooltipXPosition(t){let e=this.state;if(!e.yExtremes)return;let s=ve(t,e.xAxis.positions,!0),i=this.dataByIndex[s];this.tip.setValues(i.xPos+this.tip.offset.x,i.yExtreme+this.tip.offset.y,{name:i.formattedLabel,value:""},i.values,s),this.tip.showTip()}renderLegend(){let t=this.data;t.datasets.length>1&&(this.legendArea.textContent="",t.datasets.map((t,e)=>{let s=ot(m*e,"0",m,this.colors[e],t.name);this.legendArea.appendChild(s)}))}makeOverlay(){this.init?this.init=0:(this.overlayGuides&&this.overlayGuides.forEach(t=>{let e=t.overlay;e.parentNode.removeChild(e)}),this.overlayGuides=this.dataUnitComponents.map(t=>({type:t.unitType,overlay:void 0,units:t.units})),void 0===this.state.currentIndex&&(this.state.currentIndex=this.state.datasetLength-1),this.overlayGuides.map(t=>{let e=t.units[this.state.currentIndex];t.overlay=bt[t.type](e),this.drawArea.appendChild(t.overlay)}))}updateOverlayGuides(){this.overlayGuides&&this.overlayGuides.forEach(t=>{let e=t.overlay;e.parentNode.removeChild(e)})}bindOverlay(){this.parent.addEventListener("data-select",()=>{this.updateOverlay()})}bindUnits(){this.dataUnitComponents.map(t=>{t.units.map(t=>{t.addEventListener("click",()=>{let e=t.getAttribute("data-point-index");this.setCurrentDataPoint(e)})})}),this.tip.container.addEventListener("click",()=>{let t=this.tip.container.getAttribute("data-point-index");this.setCurrentDataPoint(t)})}updateOverlay(){this.overlayGuides.map(t=>{let e=t.units[this.state.currentIndex];vt[t.type](e,t.overlay)})}onLeftArrow(){this.setCurrentDataPoint(this.state.currentIndex-1)}onRightArrow(){this.setCurrentDataPoint(this.state.currentIndex+1)}getDataPoint(t=this.state.currentIndex){let e=this.state;return{index:t,label:e.xAxis.labels[t],values:e.datasets.map(e=>e.values[t])}}setCurrentDataPoint(t){let e=this.state;(t=parseInt(t))<0&&(t=0),t>=e.xAxis.labels.length&&(t=e.xAxis.labels.length-1),t!==e.currentIndex&&(e.currentIndex=t,a(this.parent,"data-select",this.getDataPoint()))}addDataPoint(t,e,s=this.state.datasetLength){super.addDataPoint(t,e,s),this.data.labels.splice(s,0,t),this.data.datasets.map((t,i)=>{t.values.splice(s,0,e[i])}),this.update(this.data)}removeDataPoint(t=this.state.datasetLength-1){this.data.labels.length<=1||(super.removeDataPoint(t),this.data.labels.splice(t,1),this.data.datasets.map(e=>{e.values.splice(t,1)}),this.update(this.data))}updateDataset(t,e=0){this.data.datasets[e].values=t,this.update(this.data)}updateDatasets(t){this.data.datasets.map((e,s)=>{t[s]&&(e.values=t[s])}),this.update(this.data)}}exports.AxisChart=Me;class Ne extends Bt{constructor(t,e){super(t,e),this.type="donut",this.initTimeout=0,this.init=1,this.setup()}configure(t){super.configure(t),this.mouseMove=this.mouseMove.bind(this),this.mouseLeave=this.mouseLeave.bind(this),this.hoverRadio=t.hoverRadio||.1,this.config.startAngle=t.startAngle||0,this.clockWise=t.clockWise||!1,this.strokeWidth=t.strokeWidth||30}calc(){super.calc();let t=this.state;this.radius=this.height>this.width?this.center.x-this.strokeWidth/2:this.center.y-this.strokeWidth/2;const{radius:e,clockWise:s}=this,i=t.slicesProperties||[];t.sliceStrings=[],t.slicesProperties=[];let a=180-this.config.startAngle;t.sliceTotals.map((n,r)=>{const o=a,l=n/t.grandTotal*N,h=s?-l:l,d=a+=h,c=z(o,e),p=z(d,e),u=this.init&&i[r];let m,g;this.init?(m=u?u.startPosition:c,g=u?u.endPosition:c):(m=c,g=p);const f=it(m,g,this.center,this.radius,this.clockWise);t.sliceStrings.push(f),t.slicesProperties.push({startPosition:c,endPosition:p,value:n,total:t.grandTotal,startAngle:o,endAngle:d,angle:h})}),this.init=0}setupComponents(){let t=this.state,e=[["donutSlices",{},function(){return{sliceStrings:t.sliceStrings,colors:this.colors,strokeWidth:this.strokeWidth}}.bind(this)]];this.components=new Map(e.map(t=>{let e=he(...t);return[t[0],e]}))}calTranslateByAngle(t){const{radius:e,hoverRadio:s}=this,i=z(t.startAngle+t.angle/2,e);return`translate3d(${i.x*s}px,${i.y*s}px,0)`}hoverSlice(t,s,i,a){if(!t)return;const n=this.colors[s];if(i){Wt(t,this.calTranslateByAngle(this.state.slicesProperties[s])),t.style.stroke=I(n,50);let i=e(this.svg),r=a.pageX-i.left+10,o=a.pageY-i.top-10,l=(this.formatted_labels&&this.formatted_labels.length>0?this.formatted_labels[s]:this.state.labels[s])+": ",h=(100*this.state.sliceTotals[s]/this.state.grandTotal).toFixed(1);this.tip.setValues(r,o,{name:l,value:h+"%"}),this.tip.showTip()}else Wt(t,"translate3d(0,0,0)"),this.tip.hideTip(),t.style.stroke=n}bindTooltip(){this.container.addEventListener("mousemove",this.mouseMove),this.container.addEventListener("mouseleave",this.mouseLeave)}mouseMove(t){const e=t.target;let s=this.components.get("donutSlices").store,i=this.curActiveSliceIndex,a=this.curActiveSlice;if(s.includes(e)){let n=s.indexOf(e);this.hoverSlice(a,i,!1),this.curActiveSlice=e,this.curActiveSliceIndex=n,this.hoverSlice(e,n,!0,t)}else this.mouseLeave()}mouseLeave(){this.hoverSlice(this.curActiveSlice,this.curActiveSliceIndex,!1)}}const Se={bar:Me,line:Me,percentage:de,heatmap:Pe,pie:ce,donut:Ne};function Ee(t="line",e,s){return"axis-mixed"===t?(s.type="line",new Me(e,s)):Se[t]?new Se[t](e,s):void console.error("Undefined chart type: "+t)}class Oe{constructor(t,e){return Ee(e.type,t,e)}}exports.Chart=Oe;
+},{}],"CWC6":[function(require,module,exports) {
+
+},{}],"oVQh":[function(require,module,exports) {
+"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=a(require("date-fns/getYear")),e=require("frappe-charts/dist/frappe-charts.esm.js");function a(t){return t&&t.__esModule?t:{default:t}}require("frappe-charts/dist/frappe-charts.min.css");var r={components:{Chart:e.Chart},data:function(){return{podcasterSlug:null,currentDate:new Date,currentYear:null,yearlyStats:[0],data:{labels:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],datasets:[]}}},computed:{id:function(){return this.$store.state.form.current},pageValues:function(){return this.$store.getters["form/values"](this.id)}},mounted:function(){var e=(0,t.default)(this.currentDate);this.podcasterSlug=this.sanitizeTitle(this.pageValues.podcastertitle),this.getStats(e)},methods:{getStats:function(t){var e=this;fetch("/api/podcaster/stats/"+this.podcasterSlug+"/episodes/yearly-downloads/"+t+"+"+(t-1),{method:"GET",headers:{"X-CSRF":panel.csrf}}).then(function(t){if(200!==t.status)throw"You are tracking your downloads, using the file method. Stats are currently available only when using mysql";return t}).then(function(t){return t.json()}).then(function(a){e.addChartData(a.stats,t)}).catch(function(t){e.error=t})},addChartData:function(t,e){var a={current:{name:e,values:[0,0,0,0,0,0,0,0,0,0,0,0]},past:{name:e-1,values:[0,0,0,0,0,0,0,0,0,0,0,0]}};t.map(function(t){t.year===e?a.current.values[t.month-1]=t.downloaded:a.past.values[t.month-1]=t.downloaded}),this.data.datasets=[a.current,a.past],this.drawChart()},drawChart:function(){new e.Chart("#chart",{title:"Monthly Episode Downloads",data:this.data,type:"line",height:350,colors:["green","dark-grey"],lineOptions:{hideLine:0,regionFill:1,hideDots:0},barOptions:{spaceRatio:.25}})},sanitizeTitle:function(t){return t.toLowerCase().replace(/e|é|è|ẽ|ẻ|ẹ|ê|ế|ề|ễ|ể|ệ/gi,"e").replace(/a|á|à|ã|ả|ạ|ă|ắ|ằ|ẵ|ẳ|ặ|â|ấ|ầ|ẫ|ẩ|ậ/gi,"a").replace(/o|ó|ò|õ|ỏ|ọ|ô|ố|ồ|ỗ|ổ|ộ|ơ|ớ|ờ|ỡ|ở|ợ/gi,"o").replace(/u|ú|ù|ũ|ủ|ụ|ư|ứ|ừ|ữ|ử|ự/gi,"u").replace(/đ/gi,"d").replace(/\s*$/g,"").replace(/\s+/g,"-")}}};exports.default=r;
+(function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",[this._v(" "+this._s(this.error)+" "),e("div",{attrs:{id:"chart"}})])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
+},{"date-fns/getYear":"y4KC","frappe-charts/dist/frappe-charts.esm.js":"PwSu","frappe-charts/dist/frappe-charts.min.css":"CWC6"}],"FO+Z":[function(require,module,exports) {
+"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=function(e){return e.toLowerCase().replace(/e|é|è|ẽ|ẻ|ẹ|ê|ế|ề|ễ|ể|ệ/gi,"e").replace(/a|á|à|ã|ả|ạ|ă|ắ|ằ|ẵ|ẳ|ặ|â|ấ|ầ|ẫ|ẩ|ậ/gi,"a").replace(/o|ó|ò|õ|ỏ|ọ|ô|ố|ồ|ỗ|ổ|ộ|ơ|ớ|ờ|ỡ|ở|ợ/gi,"o").replace(/u|ú|ù|ũ|ủ|ụ|ư|ứ|ừ|ữ|ử|ự/gi,"u").replace(/đ/gi,"d").replace(/\s*$/g,"").replace(/\s+/g,"-")},r=e;exports.default=r;
+},{}],"eRgp":[function(require,module,exports) {
+"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=e(require("../utils"));function e(t){return t&&t.__esModule?t:{default:t}}var n={data:function(){return{limit:10,headline:null,topEpisodes:[],error:null,podcasterSlug:null}},mounted:function(){this.podcasterSlug=(0,t.default)(this.pageValues.podcastertitle),this.getStats()},created:function(){var t=this;this.load().then(function(e){t.headline=e.headline})},computed:{id:function(){return this.$store.state.form.current},pageValues:function(){return this.$store.getters["form/values"](this.id)}},methods:{getStats:function(){var t=this;fetch("/api/podcaster/stats/"+this.podcasterSlug+"/top/"+this.limit,{method:"GET",headers:{"X-CSRF":panel.csrf}}).then(function(t){if(200!==t.status)throw"You are tracking your downloads, using the file method. Stats are currently available only when using mysql";return t}).then(function(t){return t.json()}).then(function(e){t.topEpisodes=t.computeStats(e.stats)}).catch(function(e){t.error=e})},computeStats:function(t){return t.map(function(t){return{title:t.episode.replace(/-/g," "),downloads:t.downloaded}})}}};exports.default=n;
+(function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("section",{staticClass:"k-modified-section"},[n("k-text",[t._v(t._s(t.error))]),t._v(" "),n("k-headline",[t._v(t._s(t.headline))]),t._v(" "),n("table",{attrs:{id:"topTen"}},t._l(t.topEpisodes,function(e){return n("tr",[n("td",[t._v(t._s(e.downloads))]),t._v(" "),n("td",[t._v(t._s(e.title))])])}),0)],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
+},{"../utils":"FO+Z"}],"ppPE":[function(require,module,exports) {
+"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=r(require("date-fns/getYear")),e=require("frappe-charts/dist/frappe-charts.esm.js");require("frappe-charts/dist/frappe-charts.min.css");var a=r(require("../utils"));function r(t){return t&&t.__esModule?t:{default:t}}var s={components:{Chart:e.Chart},data:function(){return{podcasterSlug:null,currentDate:new Date,currentYear:null,yearlyStats:[0],data:{labels:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],datasets:[]}}},computed:{id:function(){return this.$store.state.form.current},pageValues:function(){return this.$store.getters["form/values"](this.id)}},mounted:function(){var e=(0,t.default)(this.currentDate);this.podcasterSlug=(0,a.default)(this.pageValues.podcastertitle),this.getStats(e)},methods:{getStats:function(t){var e=this;fetch("/api/podcaster/stats/"+this.podcasterSlug+"/feed/yearly-downloads/"+t+"+"+(t-1),{method:"GET",headers:{"X-CSRF":panel.csrf}}).then(function(t){if(200!==t.status)throw"You are tracking your downloads, using the file method. Stats are currently available only when using mysql";return t}).then(function(t){return t.json()}).then(function(a){e.addChartData(a.stats,t)}).catch(function(t){e.error=t})},addChartData:function(t,e){var a={current:{name:e,values:[0,0,0,0,0,0,0,0,0,0,0,0]},past:{name:e-1,values:[0,0,0,0,0,0,0,0,0,0,0,0]}};t.map(function(t){t.year===e?a.current.values[t.month-1]=t.downloaded:a.past.values[t.month-1]=t.downloaded}),this.data.datasets=[a.current,a.past],this.drawChart()},drawChart:function(){new e.Chart("#feedChart",{title:"Monthly Feed Downloads",data:this.data,type:"line",height:350,colors:["blue","dark-grey"],lineOptions:{hideLine:0,regionFill:1,hideDots:0},barOptions:{spaceRatio:.25}})}}};exports.default=s;
+(function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",[this._v(" "+this._s(this.error)+" "),e("div",{attrs:{id:"feedChart"}})])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
+},{"date-fns/getYear":"y4KC","frappe-charts/dist/frappe-charts.esm.js":"PwSu","frappe-charts/dist/frappe-charts.min.css":"CWC6","../utils":"FO+Z"}],"LGl8":[function(require,module,exports) {
+"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={data:function(){return{headline:null,logs:[],feedItems:[],numItems:0,numRemain:0,numDownload:0,failed:0,feedName:"",currentEpisode:""}},created:function(){},mounted:function(){this.headline=this.pageValues.podcasterWizardSrcFeed},computed:{id:function(){return this.$store.state.form.current},pageValues:function(){return this.$store.getters["form/values"](this.id)}},methods:{startImport:function(e){var t=this.pageValues.podcasterwizardsrcfeed;this.feedName=t,e.target.style="display: none",document.querySelector(".log").style="display: block",this.getFeed(t)},startAudioDownload:function(){this.feedItems.length>0?this.downloadAudio():this.logs.push({id:3,msg:"done"})},getFeed:function(e){var t=this;fetch("/api/podcaster/wizard/checkfeed",{method:"GET",headers:{"X-CSRF":panel.csrf,"X-FEED-URI":e}}).then(function(e){return e.json()}).then(function(e){"error"===e.status&&t.failed++;var i=void 0!==e.channel.item.length?e.channel.item.length:1;t.feedName=e.channel.title,t.numItems=i,t.numRemain=i,t.numDownload=i,t.createFeed(e.channel),t.importEpisodes(e.channel.item)}).catch(function(e){t.error=e,t.failed++})},createFeed:function(e){var t={title:e.title,link:e.link,description:e.description,itunessubtitle:e.itunessubtitle,ituneskeywords:e.ituneskeywords,itunesseason:e.itunesseason,itunesexplicit:e.itunesexplicit,itunesblock:e.itunesblock,itunestype:e.itunestype,language:e.language,copyright:e.copyright};fetch("/api/podcaster/wizard/createFeed",{method:"POST",headers:{"X-CSRF":panel.csrf,"X-TARGET-PAGE":this.pageValues.podcasterwizarddestination[0].id},body:JSON.stringify(t)}).catch(function(e){console.log(e)})},importEpisodes:function(e){if(void 0===e.length){e.title,e.link,e.pubDate,e.description,e.itunessubtitle,e.itunessummary,e.itunesduration,e.itunesseason,e.itunesexplicit,e.itunesblock,e.enclosure["@attributes"].url;this.createEpisode(e)}else for(var t=e.length-1;t>=0;t--)this.createEpisode(e[t])},createEpisode:function(e){var t=this,i={title:e.title,link:e.link,pubDate:e.pubDate,description:e.description,itunessubtitle:e.itunessubtitle,itunessummary:e.itunessummary,itunesduration:e.itunesduration,itunesseason:e.itunesseason,itunesexplicit:e.itunesexplicit,itunesblock:e.itunesblock,file:e.enclosure["@attributes"].url};fetch("/api/podcaster/wizard/createEpisode",{method:"POST",headers:{"X-CSRF":panel.csrf,"X-TARGET-PAGE":this.pageValues.podcasterwizarddestination[0].id,"X-PAGE-TEMPLATE":this.pageValues.podcasterwizardtemplate,"X-PAGE-STATUS":this.pageValues.podcasterwizardpagestatus},body:JSON.stringify(i)}).then(function(e){return e.json()}).then(function(i){t.currentEpisode=e.title,void 0!==i.status?t.numFailed++:(t.feedItems.push({title:i.title,slug:i.slug,file:i.file}),t.numRemain--,0===t.numRemain&&t.startAudioDownload())}).catch(function(e){console.log(e),t.numFailed++})},downloadAudio:function(){var e=this,t=this.feedItems[0].slug,i=this.feedItems[0].file;this.feedItems.shift(),fetch("/api/podcaster/wizard/createFile",{method:"POST",headers:{"X-CSRF":panel.csrf,"X-TARGET-PAGE":t},body:JSON.stringify({file:i})}).then(function(e){return e.json()}).then(function(t){void 0!==t.status?e.failed++:e.numDownload=e.feedItems.length,e.startAudioDownload()}).catch(function(t){console.log(t),e.failed++})}}};exports.default=e;
+(function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this,i=t.$createElement,s=t._self._c||i;return s("section",{staticClass:"k-modified-section podcaster-import-wizard"},[s("k-headline",[t._v(t._s(t.headline))]),t._v(" "),s("div",{staticClass:"log"},[s("div",{staticClass:"important"},[t._v("Do not close this page until the import is finished!")]),t._v(" "),s("div",{staticClass:"currentState"},[t._v("Processing »"+t._s(t.currentEpisode)+"«")]),t._v(" "),s("div",[t._v("Trying to parse »"+t._s(t.feedName)+"«")]),t._v(" "),s("div",[t._v("Found "+t._s(t.numItems)+" episodes in feed")]),t._v(" "),s("div",[t._v("creating pages, "),s("strong",[t._v(t._s(t.numRemain))]),t._v(" remaining")]),t._v(" "),s("div",[s("strong",[t._v(t._s(t.numDownload))]),t._v(" audio downloads remaining")]),t._v(" "),s("div",[t._v(t._s(t.failed)+" failed attempts")])]),t._v(" "),s("button",{staticClass:"k-button start-import",on:{click:t.startImport}},[t._v("Start import")])],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
+},{}],"Focm":[function(require,module,exports) {
+"use strict";var e=u(require("./components/Episode.vue")),r=u(require("./components/YearGraph.vue")),t=u(require("./components/TopTen.vue")),a=u(require("./components/FeedStats.vue")),o=u(require("./components/Wizard.vue"));function u(e){return e&&e.__esModule?e:{default:e}}panel.plugin("mauricerenck/podcaster",{sections:{podcasterEpisodeStats:e.default,podcasterYearlyGraph:r.default,podcasterTopTen:t.default,podcasterFeedStats:a.default,podcasterWizard:o.default}});
+},{"./components/Episode.vue":"w+6L","./components/YearGraph.vue":"oVQh","./components/TopTen.vue":"eRgp","./components/FeedStats.vue":"ppPE","./components/Wizard.vue":"LGl8"}]},{},["Focm"], null)
\ No newline at end of file