(self.webpackChunk=self.webpackChunk||[]).push([[773],{96099:(t,e,n)=>{"use strict";var i=n(27144),s=n.n(i),a=n(42863),r=(n(3187),n(17751)),o=n(30913);window.APP={LOADER:n(71173),TOOLS:n(62039),STATE:n(78892).Z,STORAGE:n(88405)},window.APP.TOOLS.copy=n(20640),window.APP.TOOLS.setUsersTimezoneCookie(),n(28961),n(30441),n(63132),Vue.use(n(42513)),Vue.component("DateRangePicker",s()),Vue.use(a.Z),Vue.use(r.Z),Vue.component("multiselect",o.Z),n(5530),n(7495),n(30653),n(85434),$(document).on("show.bs.modal",".modal",(function(){var t=1040+10*$(".modal:visible").length;$(this).css("z-index",t),setTimeout((function(){$(".modal-backdrop").not(".modal-stack").css("z-index",t-1).addClass("modal-stack")}),0),$(".crisp-client").hide()})),$(document).on("hide.bs.modal",".modal",(function(){$(".crisp-client").show()})),n(5499)(!1,{callback:function(){$("#before-you-go").modal("show")},aggressive:!1});new Vue({mixins:[n(19647)]})},7495:(t,e,n)=>{n(61824)},30653:(t,e,n)=>{"use strict";n.r(e);var i=n(64335);Vue.directive("focus",{inserted:function(t){t.focus()}}),Vue.use(i.ZP)},85434:()=>{Vue.filter("truncate",(function(t,e,n){return e=e||30,!t||null===t||t.length<=e?t:(void 0===n&&(n="..."),n=""+n,(t=t.slice(0,e))+n)})),Vue.filter("dateRange",(function(t){return moment.utc(t).local().format("M/D/Y")})),Vue.filter("comma",(function(t){return t?t<1?t:t?parseInt(t).toLocaleString():0:0})),Vue.filter("pixelType",(function(t){return"".concat(APP.TOOLS.capitalize(t))})),Vue.filter("yesNo",(function(t){return t?"Yes":"No"})),Vue.filter("toLocalTime",(function(t,e){return t?moment.utc(t).local().format(e):null})),Vue.filter("json",(function(t){return JSON.stringify(t,null,4)})),Vue.filter("cleanUrl",(function(t){return null!=t&&"string"==typeof t?t.replace("https://","").replace("/",""):""})),Vue.filter("round",(function(t,e){return t*=Math.pow(10,e),t=Math.round(t),t/=Math.pow(10,e)})),Vue.filter("timeAgo",(function(t){return moment.utc(t).local().fromNow()})),Vue.filter("removeHttps",(function(t){return t?t.replace("https://",""):t})),Vue.filter("getDomain",(function(t){try{return new URL(t).hostname.replace("www.","")}catch(e){return t}}))},30441:function(){(function(){"use strict";var t,e,n,i=function(t,e){return function(){return t.apply(e,arguments)}};t=jQuery,e=function(){function t(){}return t.transitions={webkitTransition:"webkitTransitionEnd",mozTransition:"mozTransitionEnd",oTransition:"oTransitionEnd",transition:"transitionend"},t.transition=function(t){var e,n,i,s;for(s in e=t[0],n=this.transitions)if(i=n[s],null!=e.style[s])return i},t}(),n=function(){function n(e){null==e&&(e={}),this.container=i(this.container,this),this.content=i(this.content,this),this.html=i(this.html,this),this.$growl=i(this.$growl,this),this.$growls=i(this.$growls,this),this.animate=i(this.animate,this),this.remove=i(this.remove,this),this.dismiss=i(this.dismiss,this),this.present=i(this.present,this),this.waitAndDismiss=i(this.waitAndDismiss,this),this.cycle=i(this.cycle,this),this.close=i(this.close,this),this.click=i(this.click,this),this.mouseLeave=i(this.mouseLeave,this),this.mouseEnter=i(this.mouseEnter,this),this.unbind=i(this.unbind,this),this.bind=i(this.bind,this),this.render=i(this.render,this),this.settings=t.extend({},n.settings,e),this.$growls().attr("class",this.settings.location),this.render()}return n.settings={namespace:"growl",duration:2e3,close:"×",location:"default",style:"default",size:"medium",delayOnHover:!0},n.growl=function(t){return null==t&&(t={}),this.initialize(),new n(t)},n.initialize=function(){return t("body:not(:has(#growls))").append('
')},n.prototype.render=function(){var t;t=this.$growl(),this.$growls().append(t),this.settings.fixed?this.present():this.cycle()},n.prototype.bind=function(t){return null==t&&(t=this.$growl()),t.on("click",this.click),this.settings.delayOnHover&&(t.on("mouseenter",this.mouseEnter),t.on("mouseleave",this.mouseLeave)),t.on("contextmenu",this.close).find("."+this.settings.namespace+"-close").on("click",this.close)},n.prototype.unbind=function(t){return null==t&&(t=this.$growl()),t.off("click",this.click),this.settings.delayOnHover&&(t.off("mouseenter",this.mouseEnter),t.off("mouseleave",this.mouseLeave)),t.off("contextmenu",this.close).find("."+this.settings.namespace+"-close").off("click",this.close)},n.prototype.mouseEnter=function(t){return this.$growl().stop(!0,!0)},n.prototype.mouseLeave=function(t){return this.waitAndDismiss()},n.prototype.click=function(t){if(null!=this.settings.url)return t.preventDefault(),t.stopPropagation(),helpers.tools.openLink(this.settings.url)},n.prototype.close=function(t){return t.preventDefault(),t.stopPropagation(),this.$growl().stop().queue(this.dismiss).queue(this.remove)},n.prototype.cycle=function(){return this.$growl().queue(this.present).queue(this.waitAndDismiss())},n.prototype.waitAndDismiss=function(){return this.$growl().delay(this.settings.duration).queue(this.dismiss).queue(this.remove)},n.prototype.present=function(t){var e;return e=this.$growl(),this.bind(e),this.animate(e,this.settings.namespace+"-incoming","out",t)},n.prototype.dismiss=function(t){var e;return e=this.$growl(),this.unbind(e),this.animate(e,this.settings.namespace+"-outgoing","in",t)},n.prototype.remove=function(t){return this.$growl().remove(),"function"==typeof t?t():void 0},n.prototype.animate=function(t,n,i,s){var a;null==i&&(i="in"),a=e.transition(t),t["in"===i?"removeClass":"addClass"](n),t.offset().position,t["in"===i?"addClass":"removeClass"](n),null!=s&&(null!=a?t.one(a,s):s())},n.prototype.$growls=function(){return null!=this.$_growls?this.$_growls:this.$_growls=t("#growls")},n.prototype.$growl=function(){return null!=this.$_growl?this.$_growl:this.$_growl=t(this.html())},n.prototype.html=function(){return this.container(this.content())},n.prototype.content=function(){return""+this.settings.close+"
\n"+this.settings.title+"
\n"+(null!=this.settings.message?this.settings.message.replace(//g,">"):"")+"
"},n.prototype.container=function(t){return"\n "+t+"\n
"},n}(),this.Growl=n,t.growl=function(t){return null==t&&(t={}),n.growl(t)},t.growl.error=function(e){var n;return null==e&&(e={}),n={title:"Error!",style:"error"},t.growl(t.extend(n,e))},t.growl.notice=function(e){var n;return null==e&&(e={}),n={title:"Notice!",style:"notice"},t.growl(t.extend(n,e))},t.growl.warning=function(e){var n;return null==e&&(e={}),n={title:"Warning!",style:"warning"},t.growl(t.extend(n,e))}}).call(this)},71173:(t,e,n)=>{"use strict";function i(){document.getElementById("full-page-loader").className="hidden"}function s(){document.getElementById("full-page-loader")&&document.getElementById("full-page-loader").classList&&document.getElementById("full-page-loader").classList.length>0&&(document.getElementById("full-page-loader").classList="loading")}n.r(e),n.d(e,{hide:()=>i,show:()=>s})},88405:(t,e,n)=>{"use strict";n.r(e),n.d(e,{getValue:()=>s,setValue:()=>a});var i=function(t){return t.startsWith("ls-")?t:"ls-"+t};function s(t){if(!localStorage)return null;var e=localStorage.getItem(i(t));try{return e&&JSON.parse(e)}catch(t){return e}}function a(t,e){if(!localStorage)return null;try{var n=i(t);null!=e&&""!==e?(localStorage.setItem(n,JSON.stringify(e)),helpers.storageLocal.setValue(n,e)):localStorage.removeItem(n)}catch(t){}}},63132:()=>{!function(t){var e={position:APP.TOOLS.isMobile()?"bottom-right":"top-right",dismissible:!0,stackable:!0,pauseDelayOnHover:!0,delay:APP.TOOLS.isMobile()?8e3:5e3,style:{toast:"",info:"",success:"",warning:"",error:""}};t("body").on("hidden.bs.toast",".toast",(function(){t(this).remove()}));var n=1;function i(i){if(!t("#toast-container").length){var s=["top-right","top-left","top-center","bottom-right","bottom-left","bottom-center"].includes(e.position)?e.position:"top-right";t("body").prepend(''),t("#toast-container").addClass(s)}var a=t("#toast-container"),r="",o={header:{fg:"",bg:""},subtitle:"text-white",dismiss:"text-white"},u=i.id||"toast-".concat(n),l=i.style,c=i.title,h=i.subtitle,d=i.message,m=i.img,p=i.delay?'data-delay="'.concat(i.delay,'"'):'data-delay="'.concat(e.delay,'"'),f="",g=e.dismissible,b=e.style.toast,v=!1;switch(void 0!==i.dismissible&&(g=i.dismissible),l){case"info":o.header.bg=e.style.info||"bg-info",o.header.fg=e.style.info||"text-white";break;case"success":o.header.bg=e.style.success||"bg-success",o.header.fg=e.style.info||"text-white";break;case"warning":o.header.bg=e.style.warning||"bg-warning",o.header.fg=e.style.warning||"text-white";break;case"error":o.header.bg=e.style.error||"bg-danger",o.header.fg=e.style.error||"text-white"}e.pauseDelayOnHover&&i.delay&&(p='data-autohide="false"',f='data-hide-after="'.concat(Math.floor(Date.now()/1e3)+i.delay/1e3,'"')),r='"),r+='",d&&(r+='
\n '.concat(d,"\n
")),r+="
",e.stackable?(a.append(r),a.find(".toast:last").toast("show")):(a.find(".toast").each((function(){t(this).remove()})),a.append(r),a.find(".toast:last").toast("show")),e.pauseDelayOnHover&&(setTimeout((function(){v||t("#".concat(u)).toast("hide")}),i.delay),t("body").on("mouseover","#".concat(u),(function(){v=!0})),t(document).on("mouseleave","#"+u,(function(){var e=Math.floor(Date.now()/1e3),n=parseInt(t(this).data("hideAfter"));v=!1,e>=n&&t(this).toast("hide")}))),n++}t.snack=function(t,e,n){return i({style:t,title:e,delay:n})},t.toast=function(t){return i(t)}}(jQuery)},62039:(t,e,n)=>{"use strict";n.r(e),n.d(e,{parseUrl:()=>s,fixUrl:()=>a,capitalize:()=>r,hasAlphabetCharacter:()=>o,formatPhoneNumber:()=>u,isPhoneNumber:()=>l,getValueFromQueryString:()=>c,deleteValueFromQueryString:()=>h,buildMomentDateWithCurrentTime:()=>d,buildArrayQueryString:()=>m,validateUrl:()=>p,readableUrlPath:()=>f,dateFilterRanges:()=>g,setUsersTimezoneCookie:()=>b,getCssVar:()=>v,isMobile:()=>y,buildQrCodeURL:()=>k,getDefaultQrCodeOptions:()=>w});var i=n(51019);function s(t){try{var e=document.createElement("a");return e.href=t,{host:e.host,hostname:e.hostname,pathname:e.pathname,port:e.port,protocol:e.protocol,search:e.search,hash:e.hash}}catch(t){}return null}function a(t){return t=t?t.trim():t,APP.TOOLS.isPhoneNumber(t)?APP.TOOLS.formatPhoneNumber(t):(/^(?:f|ht)tps?\:\/\//.test(t)||(t="http://"+t),t)}function r(t){return t||0===t?t.toString().charAt(0).toUpperCase()+t.slice(1):""}function o(t){return/[a-zA-Z]/.test(t)}function u(t){var e=t.replace(/\D/g,""),n=e.length>10?e.slice(0,e.length-10):"+1",i=e.slice(-10),s=i.slice(0,3),a=i.slice(3,6),r=i.slice(6);return"tel:+".concat(n," (").concat(s,") ").concat(a,"-").concat(r)}function l(t){if(o(t=t?t.replace("tel:",""):t))return!1;var e=t.replace(/\D/g,"");return/^(\+?\d{1,3}[-\s]?)?\d{3}[-\s]?\d{3}[-\s]?\d{4}$/.test(e)}function c(t){return new URLSearchParams(window.location.search).get(t)}function h(t){var e=new URLSearchParams(window.location.search);e.delete(t);var n=window.location.pathname+(e.toString().length>0?"?"+e.toString():"");history.pushState(null,"",n)}function d(t){return t=moment(t).format("M/D/Y"),moment(t+" "+moment().format("hh:mm:ss")).utc().format("M/D/Y")}function m(t,e){return e.map((function(e){return"".concat(t,"[]=").concat(e)})).join("&")}function p(t){if(APP.TOOLS.isPhoneNumber(t))return!0;t=a(t);try{var e=i(t,{allowUnknownTLD:!0})}catch(t){return!1}return e.domain&&e.tld}function f(t){return t?t.replace(" ","-"):t}function g(){var t=new Date;return t.setHours(0,0,0,0),{"Last 7 Days":[moment().subtract(7,"days").toDate(),moment().add(1,"days").toDate()],"Last 30 Days":[moment().subtract(30,"days").add(1,"days").toDate(),moment().toDate()],"This Month":[new Date(t.getFullYear(),t.getMonth(),1),new Date(t.getFullYear(),t.getMonth()+1,0)],"Last Month":[new Date(t.getFullYear(),t.getMonth()-1,1),new Date(t.getFullYear(),t.getMonth(),0)],"This Year":[new Date(t.getFullYear(),0,1),new Date(t.getFullYear(),11,31)],"All Time":[moment("1/1/2018").toDate(),moment().toDate()]}}function b(){!function(t,e,n){var i="";if(n){var s=new Date;s.setTime(s.getTime()+24*n*60*60*1e3),i="; expires="+s.toUTCString()}document.cookie=t+"="+(e||"")+i+"; path=/; Secure; SameSite=Lax"}("userTimezone",Intl.DateTimeFormat().resolvedOptions().timeZone,7)}function v(t){return getComputedStyle(document.body).getPropertyValue("--"+t)}function y(){var t=navigator.userAgent||navigator.vendor||window.opera;return/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(t)}function k(t){return""!=t?t+"?r=qr":_baseUrl}function w(t){var e=APP.STORAGE.getValue("defaultQrCode");return{width:300,height:300,type:"canvas",data:k(t),image:e?e.image:"",margin:0,qrOptions:{typeNumber:0,mode:"Byte",errorCorrectionLevel:"Q"},imageOptions:{hideBackgroundDots:!0,imageSize:.4,margin:5,crossOrigin:"anonymous"},dotsOptions:{color:e?e.dotsOptions.color:"#000000",type:"square"},backgroundOptions:{color:e?e.backgroundOptions.color:"#ffffff"},cornersSquareOptions:{color:e?e.cornersSquareOptions.color:"#000000",type:"square"},cornersDotOptions:{color:e?e.cornersDotOptions.color:"#000000",type:"square"}}}},5530:(t,e,n)=>{n(5134),n(90947),n(43355),n(91091),Vue.component("home-page",(function(){return Promise.all([n.e(898),n.e(950)]).then(n.bind(n,19950))})),Vue.component("expired-page",(function(){return n.e(483).then(n.bind(n,82483))})),Vue.component("rate-limit-page",(function(){return n.e(133).then(n.bind(n,87133))})),Vue.component("enter-password",(function(){return n.e(637).then(n.bind(n,27637))})),Vue.component("qr-code",(function(){return Promise.all([n.e(898),n.e(522)]).then(n.bind(n,86773))})),Vue.component("stats-not-viewable",(function(){return n.e(971).then(n.bind(n,26971))})),Vue.component("url-decoder-page",(function(){return n.e(712).then(n.bind(n,2712))})),Vue.component("one-link-render-page",(function(){return n.e(714).then(n.bind(n,52714))})),Vue.component("warning-redirect-page",(function(){return n.e(518).then(n.bind(n,97518))})),Vue.component("utm-url-builder-page",(function(){return n.e(731).then(n.bind(n,28731))})),Vue.component("extension-install-pin-widget",(function(){return n.e(632).then(n.bind(n,74632))})),Vue.component("link-expander-page",(function(){return n.e(727).then(n.bind(n,18727))})),Vue.component("md5-hash-page",(function(){return n.e(580).then(n.bind(n,51580))})),Vue.component("screenshot-website-page",(function(){return n.e(662).then(n.bind(n,4662))})),Vue.component("sidebar-post-sections",(function(){return n.e(779).then(n.bind(n,17779))})),Vue.component("topic-shortener-page",(function(){return n.e(974).then(n.bind(n,72974))})),Vue.component("create-update-link",(function(){return Promise.all([n.e(898),n.e(436)]).then(n.bind(n,20436))})),Vue.component("add-pixel",(function(){return n.e(651).then(n.bind(n,67651))})),Vue.component("favicon-preview",(function(){return n.e(402).then(n.bind(n,48402))}))},5134:(t,e,n)=>{n(5499);Vue.component("links",{data:function(){return{state:APP.STATE,teamTotalClicks:null,teamTotalLinks:null,currentMonth:moment().utc().format("MMMM")}},components:{"link-input":function(){return n.e(821).then(n.bind(n,52821))},"link-table":function(){return n.e(913).then(n.bind(n,69913))},"link-filter-panel":function(){return n.e(988).then(n.bind(n,63988))},"search-links":function(){return n.e(488).then(n.bind(n,39488))},"bulk-import-modal":function(){return n.e(279).then(n.bind(n,93279))}},props:["user"],computed:{monthlyLinksPercentage:function(){return Math.round(this.state.user.teamApi.used/this.state.user.teamApi.limit*100)}},created:function(){var t=this;axios.get(_apiUrl+"v1/account/api_count").then((function(e){t.state.user.teamApi=e.data})),axios.get(_apiUrl+"v1/account/team_total_links").then((function(e){t.teamTotalLinks=e.data})),axios.get(_apiUrl+"v1/account/team_total_clicks").then((function(e){t.teamTotalClicks=e.data.total}))},mounted:function(){$("#trial-ends-today").length&&$("#trial-ends-today").modal("show")}})},90947:(t,e,n)=>{Vue.component("one-link",{data:function(){return{state:APP.STATE}},components:{"one-link-table":function(){return n.e(893).then(n.bind(n,43893))}},props:["user"],created:function(){}})},43355:(t,e,n)=>{"use strict";n.r(e);var i=n(88289),s=n(19767),a=n(17007),r=n(57806),o=n(69574),u=n(30381),l=n.n(u),c=n(97660),h=(c.overwrite,c.getName);Vue.component("stats",{components:{HorizontalBarChart:i.Z,DoughnutChart:a.Z,LineChart:s.Z,WorldMapChart:r.Z,"stats-table":function(){return n.e(222).then(n.bind(n,7222))},QrcodeVue:o.Z,"smart-urls-tooltip":function(){return n.e(90).then(n.bind(n,61090))}},props:["shortUrl"],data:function(){return{stats:{},statsToggle:"all",dateHasBeenFiltered:!1,dateRange:{startDate:l()().subtract(90,"days").toDate(),endDate:l()().add(1,"days").toDate()},isMobile:APP.TOOLS.isMobile()}},mounted:function(){$('[data-toggle="tooltip"]').tooltip()},created:function(){this.getStats()},computed:{ranges:function(){return APP.TOOLS.dateFilterRanges()},avgDailyClicks:function(){var t=l()(this.stats.data.created_at),e=l()().startOf("day"),n=l().duration(e-t).asDays();return n=n<1?1:n,"unique"===this.statsToggle?this.stats.unique_clicks/n:"qr"===this.statsToggle?this.stats.total_qr_scans/n:this.stats.clicks/n},avgWeeklyClicks:function(){var t=l()(this.stats.data.created_at),e=l()().startOf("day"),n=l().duration(e-t).asWeeks();return n=n<1?1:n,"unique"===this.statsToggle?this.stats.unique_clicks/n:"qr"===this.statsToggle?this.stats.total_qr_scans/n:this.stats.clicks/n},avgMonthlyClicks:function(){var t=l()(this.stats.data.created_at),e=l()().startOf("day"),n=l().duration(e-t).asMonths();return n=n<1?1:n,"unique"===this.statsToggle?this.stats.unique_clicks/n:"qr"===this.statsToggle?this.stats.qr_total/n:this.stats.clicks/n},browserLabels:function(){return this.stats.browsers?this.stats.browsers.map((function(t){return t.browser})):null},browserData:function(){return"unique"===this.statsToggle?this.stats.browsers?this.stats.browsers.map((function(t){return t.unique_total})):null:"qr"===this.statsToggle?this.stats.browsers?this.stats.browsers.map((function(t){return t.qr_total})):null:this.stats.browsers?this.stats.browsers.map((function(t){return t.total})):null},countryLabels:function(){return this.stats.countries?this.stats.countries.map((function(t){return h(t.country_code)||"Unknown"})):null},countriesMapData:function(){var t=this,e=new Map;return this.stats.countries&&this.stats.countries.forEach((function(n){var i=h(n.country_code)||"Unknown",s=n.total;"unique"===t.statsToggle?s=n.unique_total:"qr"===t.statsToggle&&(s=n.total_qr_scans),e.set(i,s)})),e},countryData:function(){return"unique"===this.statsToggle?this.stats.countries?this.stats.countries.map((function(t){return t.unique_total})):null:"qr"===this.statsToggle?this.stats.countries?this.stats.countries.map((function(t){return t.qr_total})):null:this.stats.countries?this.stats.countries.map((function(t){return t.total})):null},referrerLabels:function(){return this.stats.referrers?this.stats.referrers.map((function(t){return t.referrer})):null},referrerData:function(){return"unique"===this.statsToggle?this.stats.referrers?this.stats.referrers.map((function(t){return t.unique_total})):null:"qr"===this.statsToggle?this.stats.referrers?this.stats.referrers.map((function(t){return t.qr_total})):null:this.stats.referrers?this.stats.referrers.map((function(t){return t.total})):null},platformLabels:function(){return this.stats.platforms?this.stats.platforms.map((function(t){return t.platform})):null},platformData:function(){return"unique"===this.statsToggle?this.stats.platforms?this.stats.platforms.map((function(t){return t.unique_total})):null:"qr"===this.statsToggle?this.stats.platforms?this.stats.platforms.map((function(t){return t.qr_total})):null:this.stats.platforms?this.stats.platforms.map((function(t){return t.total})):null},dailyClicksData:function(){return[{label:"Clicks",borderColor:"#284243",backgroundColor:"rgb(40, 66, 67, .3)",data:this.stats.daily_clicks?this.stats.daily_clicks.map((function(t){return t.total})):null,fill:!0},{label:"Unique Clicks",data:this.stats.daily_clicks?this.stats.daily_clicks.map((function(t){return t.unique_total})):null,borderColor:"#e95420",backgroundColor:"rgb(233, 84, 32, .3)",fill:!0},{label:"QR Scans",data:this.stats.daily_clicks?this.stats.daily_clicks.map((function(t){return t.qr_total})):null,borderColor:"#007bff",backgroundColor:"rgb(0, 123, 255, .3)",fill:!0}]},dailyClicksLabel:function(){return this.stats.daily_clicks?this.stats.daily_clicks.map((function(t){return l()(t.label).format("M/D/YY")})):null}},methods:{dateFilterUpdated:function(){this.dateHasBeenFiltered=!0,this.getStats()},copyLink:function(t){APP.TOOLS.copy(t),$.toast({title:"Link Copied",message:"".concat(t," has been copied to your clipboard"),style:"success"})},toggleShowStats:function(t){this.statsToggle=t},showUniqueStats:function(t){return l()(t).isAfter("2022-03-07")},getStats:function(){var t=this;APP.LOADER.show();var e=APP.TOOLS.buildMomentDateWithCurrentTime(this.dateRange.startDate),n=APP.TOOLS.buildMomentDateWithCurrentTime(this.dateRange.endDate);axios.get(_apiUrl+"v1/link/stats?short_url="+t.shortUrl+"&start_date="+e+"&end_date="+n).then((function(e){t.stats=e.data,APP.LOADER.hide()}))},deleteLink:function(t){Swal.fire({title:"Are you sure?",text:"You will not be able to recover this link!",type:"warning",showCancelButton:!0,confirmButtonColor:APP.TOOLS.getCssVar("primary"),confirmButtonText:"Yes, delete it!",html:!1}).then((function(e){e.value&&axios.delete(_apiUrl+"v1/link",{data:{short_url:t}}).then((function(t){$.toast({title:"Link Deleted",message:"Short link has been deleted",style:"success"})}))}))},blockLink:function(t){axios.put(_apiUrl+"v1/link/block",{short_url:t}).then((function(t){$.toast({title:"Link Blocked",message:"",style:"success"})}))},unBlockLink:function(t){Swal.fire({title:"Are you sure?",text:"Link will be Unblocked!",type:"warning",showCancelButton:!0,confirmButtonColor:APP.TOOLS.getCssVar("primary"),confirmButtonText:"Yes",html:!1}).then((function(e){e.value&&axios.put(_apiUrl+"v1/link/unblock",{short_url:t}).then((function(t){$.toast({title:"Link UnBlocked",message:"",style:"success"})}))}))},blockDomain:function(t){axios.post(_apiUrl+"v1/blockeddomain/add",{long_url:t}).then((function(t){$.toast({title:"Domain Blocked",message:"",style:"success"})}))},unBlockDomain:function(t){Swal.fire({title:"Are you sure?",text:"Domain will be unblocked!",type:"warning",showCancelButton:!0,confirmButtonColor:APP.TOOLS.getCssVar("primary"),confirmButtonText:"Yes",html:!1}).then((function(e){e.value&&axios.delete(_apiUrl+"v1/blockeddomain/delete",{data:{long_url:t}}).then((function(t){$.toast({title:"Domain UnBlocked",message:"",style:"success"})}))}))},banTeam:function(t){axios.put(_apiUrl+"v1/team/ban",{team_id:t}).then((function(t){$.toast({title:"Team Banned",message:"",style:"success"})}))},unBanTeam:function(t){Swal.fire({title:"Are you sure?",text:"Team will be UnBanned!",type:"warning",showCancelButton:!0,confirmButtonColor:APP.TOOLS.getCssVar("primary"),confirmButtonText:"Yes",html:!1}).then((function(e){e.value&&axios.put(_apiUrl+"v1/team/unban",{team_id:t}).then((function(t){$.toast({title:"Team UnBanned",message:"",style:"success"})}))}))},flagLink:function(t){Swal.fire({title:"Are you sure?",text:"Link will be flagged!",type:"warning",showCancelButton:!0,confirmButtonColor:APP.TOOLS.getCssVar("primary"),confirmButtonText:"Yes",html:!1}).then((function(e){e.value&&axios.put(_apiUrl+"v1/link/flag",{short_url:t}).then((function(t){$.toast({title:"Link Blocked",message:"",style:"success"})}))}))}}})},91091:(t,e,n)=>{"use strict";n.r(e);var i=n(88289),s=n(19767),a=n(17007),r=n(57806),o=n(30381),u=n.n(o),l=n(97660),c=(l.overwrite,l.getName);Vue.component("team-dashboard",{components:{HorizontalBarChart:i.Z,DoughnutChart:a.Z,LineChart:s.Z,WorldMapChart:r.Z,"smart-urls-tooltip":function(){return n.e(90).then(n.bind(n,61090))}},data:function(){return{stats:{visits:null,dailyVisits:null,countries:null,browsers:null,referrers:null,platforms:null,topShortLinks:null},statsToggle:"all",dateHasBeenFiltered:!1,dateRange:{startDate:u()().subtract(7,"days").toDate(),endDate:u()().add(1,"days").toDate()},isMobile:APP.TOOLS.isMobile()}},mounted:function(){},created:function(){this.getStats()},computed:{ranges:function(){return APP.TOOLS.dateFilterRanges()},browserLabels:function(){return this.stats.browsers?this.stats.browsers.map((function(t){return t.browser})):null},browserData:function(){return"unique"===this.statsToggle?this.stats.browsers?this.stats.browsers.map((function(t){return t.unique_total})):null:"qr"===this.statsToggle?this.stats.browsers?this.stats.browsers.map((function(t){return t.qr_total})):null:this.stats.browsers?this.stats.browsers.map((function(t){return t.total})):null},countryLabels:function(){return this.stats.countries?this.stats.countries.map((function(t){return c(t.country_code)||"Unknown"})):null},countriesMapData:function(){var t=this,e=new Map;return this.stats.countries&&this.stats.countries.forEach((function(n){var i=c(n.country_code)||"Unknown",s=n.total;"unique"===t.statsToggle?s=n.unique_total:"qr"===t.statsToggle&&(s=n.total_qr_scans),e.set(i,s)})),e},countryData:function(){return"unique"===this.statsToggle?this.stats.countries?this.stats.countries.map((function(t){return t.unique_total})):null:"qr"===this.statsToggle?this.stats.countries?this.stats.countries.map((function(t){return t.qr_total})):null:this.stats.countries?this.stats.countries.map((function(t){return t.total})):null},referrerLabels:function(){return this.stats.referrers?this.stats.referrers.map((function(t){return t.referrer})):null},referrerData:function(){return"unique"===this.statsToggle?this.stats.referrers?this.stats.referrers.map((function(t){return t.unique_total})):null:"qr"===this.statsToggle?this.stats.referrers?this.stats.referrers.map((function(t){return t.qr_total})):null:this.stats.referrers?this.stats.referrers.map((function(t){return t.total})):null},platformLabels:function(){return this.stats.platforms?this.stats.platforms.map((function(t){return t.platform})):null},platformData:function(){return"unique"===this.statsToggle?this.stats.platforms?this.stats.platforms.map((function(t){return t.unique_total})):null:"qr"===this.statsToggle?this.stats.platforms?this.stats.platforms.map((function(t){return t.qr_total})):null:(console.log(this.stats.platforms),this.stats.platforms?this.stats.platforms.map((function(t){return t.total})):null)},dailyVisitsData:function(){return[{label:"Clicks",borderColor:"#284243",backgroundColor:"rgb(40, 66, 67, .3)",data:this.stats.dailyVisits?this.stats.dailyVisits.map((function(t){return t.total})):null,fill:!0},{label:"Unique Clicks",data:this.stats.dailyVisits?this.stats.dailyVisits.map((function(t){return t.unique_total})):null,borderColor:"#e95420",backgroundColor:"rgb(233, 84, 32, .3)",fill:!0},{label:"QR Scans",data:this.stats.dailyVisits?this.stats.dailyVisits.map((function(t){return t.qr_total})):null,borderColor:"#007bff",backgroundColor:"rgb(0, 123, 255, .3)",fill:!0}]},dailyVisitsLabel:function(){return this.stats.dailyVisits?this.stats.dailyVisits.map((function(t){return u()(t.label).format("M/D/YY")})):null}},methods:{dateFilterUpdated:function(){this.dateHasBeenFiltered=!0,this.getStats()},toggleShowStats:function(t){this.statsToggle=t},copyLink:function(t){APP.TOOLS.copy(t),$.toast({title:"Link Copied",message:"".concat(t," has been copied to your clipboard"),style:"success"})},getStats:function(){var t=this,e=APP.TOOLS.buildMomentDateWithCurrentTime(this.dateRange.startDate),n=APP.TOOLS.buildMomentDateWithCurrentTime(this.dateRange.endDate);axios.get(_apiUrl+"v1/team/stats/top-short-links?start_date="+e+"&end_date="+n).then((function(e){t.stats.topShortLinks=e.data})),axios.get(_apiUrl+"v1/team/stats/countries?start_date="+e+"&end_date="+n).then((function(e){t.stats.countries=e.data})),axios.get(_apiUrl+"v1/team/stats/visits?start_date="+e+"&end_date="+n).then((function(e){t.stats.visits=e.data})),axios.get(_apiUrl+"v1/team/stats/referrers?start_date="+e+"&end_date="+n).then((function(e){t.stats.referrers=e.data})),axios.get(_apiUrl+"v1/team/stats/platforms?start_date="+e+"&end_date="+n).then((function(e){t.stats.platforms=e.data})),axios.get(_apiUrl+"v1/team/stats/browsers?start_date="+e+"&end_date="+n).then((function(e){t.stats.browsers=e.data})),axios.get(_apiUrl+"v1/team/stats/daily-visits?start_date="+e+"&end_date="+n).then((function(e){t.stats.dailyVisits=e.data}))}}})},9244:t=>{t.exports={mounted:function(){var t=this;"undefined"!=typeof Rewardful&&""!==Rewardful.referral&&this.setReferral(),addEventListener("Rewardful.tracked",(function(){t.setReferral()}))},methods:{setReferral:function(){"spark-register-stripe"===this.$options.name&&(this.registerForm.referral=Rewardful.referral),"spark-subscribe-stripe"===this.$options.name&&(this.form.referral=Rewardful.referral)}}}},72441:(t,e,n)=>{var i=n(59562);Vue.component("spark-register-stripe",{mixins:[i]})},61824:(t,e,n)=>{n(56066),n(2172),n(72441),n(35030),n(46212),n(23997),n(17392),n(72099),n(15194),n(43299),n(56322),n(35804),n(69793),n(90627),n(8761),n(99731),n(31178),n(63325),n(16499),n(6117),n(9442),n(82292),n(23704),n(90264),n(87211),n(22607),n(61605),n(19994),n(81471),n(95072),n(23578),n(164),n(98440),n(49090),n(75921),n(98e3),n(87807),n(87541),n(19334),n(66303),n(53976),n(76097),n(52767),n(63931),n(19451),n(57587),n(9629),n(91242),n(84539),n(13079),n(58147),n(58691),n(99800),n(91656),n(18224)},18224:(t,e,n)=>{var i=n(68186);Vue.component("spark-kiosk-add-discount",{mixins:[i]})},13079:(t,e,n)=>{var i=n(74009);Vue.component("spark-kiosk-announcements",{mixins:[i]})},84539:(t,e,n)=>{var i=n(70606);Vue.component("spark-kiosk",{mixins:[i]})},58147:(t,e,n)=>{var i=n(39977);Vue.component("spark-kiosk-metrics",{mixins:[i]})},91656:(t,e,n)=>{var i=n(91303);Vue.component("spark-kiosk-profile",{mixins:[i]})},99800:(t,e,n)=>{var i=n(18176);Vue.component("spark-kiosk-subscribers",{mixins:[i]})},58691:(t,e,n)=>{var i=n(84491);Vue.component("spark-kiosk-users",{mixins:[i]})},56066:(t,e,n)=>{var i=n(32233);Vue.component("spark-navbar",{mixins:[i]})},2172:(t,e,n)=>{var i=n(83103);Vue.component("spark-notifications",{mixins:[i]})},90264:(t,e,n)=>{var i=n(90143);Vue.component("spark-api",{mixins:[i]})},87211:(t,e,n)=>{var i=n(33607);Vue.component("spark-create-token",{mixins:[i]})},22607:(t,e,n)=>{var i=n(20915);Vue.component("spark-tokens",{mixins:[i]})},61605:(t,e,n)=>{var i=n(32002);Vue.component("spark-domains",{mixins:[i]})},19994:(t,e,n)=>{var i=n(52234);Vue.component("spark-add-domain",{mixins:[i]})},81471:(t,e,n)=>{var i=n(27466);Vue.component("spark-domains-list",{mixins:[i]})},57587:(t,e,n)=>{var i=n(2350);Vue.component("spark-invoices",{mixins:[i]})},91242:(t,e,n)=>{var i=n(3450);Vue.component("spark-invoice-list",{mixins:[i]})},9629:(t,e,n)=>{var i=n(38258);Vue.component("spark-update-extra-billing-information",{mixins:[i]})},76097:(t,e,n)=>{var i=n(60291);Vue.component("spark-payment-method-stripe",{mixins:[i]})},19451:(t,e,n)=>{var i=n(10904);Vue.component("spark-redeem-coupon",{mixins:[i]})},63931:(t,e,n)=>{var i=n(59578);Vue.component("spark-update-payment-method-stripe",{mixins:[i]})},52767:(t,e,n)=>{var i=n(50799);Vue.component("spark-update-vat-id",{mixins:[i]})},98440:(t,e,n)=>{var i=n(20544);Vue.component("spark-pixels",{mixins:[i]})},49090:(t,e,n)=>{var i=n(78154);Vue.component("spark-add-pixel",{mixins:[i]})},75921:(t,e,n)=>{var i=n(78162);Vue.component("spark-pixels-list",{mixins:[i]})},46212:(t,e,n)=>{var i=n(20506);Vue.component("spark-profile",{mixins:[i]})},17392:(t,e,n)=>{var i=n(68638);Vue.component("spark-update-contact-information",{mixins:[i]})},23997:(t,e,n)=>{var i=n(96909);Vue.component("spark-update-profile-photo",{mixins:[i]})},6117:(t,e,n)=>{var i=n(78913);Vue.component("spark-security",{mixins:[i]})},23704:(t,e,n)=>{var i=n(22732);Vue.component("spark-disable-two-factor-auth",{mixins:[i]})},82292:()=>{Vue.component("spark-enable-two-factor-auth",{props:["user"],data:function(){return{qrcode:"",secret:"",generating:!1,showSecret:!1,form:new SparkForm({code:""})}},mounted:function(){var t=this;$(this.$refs.modal).on("hidden.bs.modal",(function(){t.form.code="",t.form.resetStatus()}))},methods:{generate:function(){var t=this;this.generating=!0,axios.post("/settings/two-factor-auth-generate").then((function(e){var n=e.data;t.generating=!1,t.showVerification(n)}))},showVerification:function(t){var e=t.qrcode,n=t.secret;this.qrcode=e,this.secret=n,$(this.$refs.modal).modal("show")},enable:function(){var t=this;Spark.post("/settings/two-factor-auth-google",this.form).then((function(e){$(t.$refs.modal).modal("hide"),t.$parent.$emit("receivedTwoFactorResetCode",e),Bus.$emit("updateUser")}))}}})},9442:(t,e,n)=>{var i=n(29753);Vue.component("spark-update-password",{mixins:[i]})},35030:(t,e,n)=>{var i=n(49749);Vue.component("spark-settings",{mixins:[i]})},87807:(t,e,n)=>{var i=n(94562);Vue.component("spark-subscription",{mixins:[i]})},53976:(t,e,n)=>{var i=n(58680);Vue.component("spark-cancel-subscription",{mixins:[i]})},66303:(t,e,n)=>{var i=n(67937);Vue.component("spark-resume-subscription",{mixins:[i]})},87541:(t,e,n)=>{var i=n(96704),s=n(9244);Vue.component("spark-subscribe-stripe",{mixins:[i,s]})},19334:(t,e,n)=>{var i=n(5621);Vue.component("spark-update-subscription",{mixins:[i]})},95072:(t,e,n)=>{var i=n(14131);Vue.component("spark-tags",{mixins:[i]})},23578:(t,e,n)=>{var i=n(75941);Vue.component("spark-add-tag",{mixins:[i]})},164:(t,e,n)=>{var i=n(54924);Vue.component("spark-tags-list",{mixins:[i]})},72099:(t,e,n)=>{var i=n(23445);Vue.component("spark-teams",{mixins:[i]})},15194:(t,e,n)=>{var i=n(40759);Vue.component("spark-create-team",{mixins:[i]})},56322:(t,e,n)=>{var i=n(44302);Vue.component("spark-current-teams",{mixins:[i]})},63325:(t,e,n)=>{var i=n(42759);Vue.component("spark-mailed-invitations",{mixins:[i]})},43299:(t,e,n)=>{var i=n(17296);Vue.component("spark-pending-invitations",{mixins:[i]})},31178:(t,e,n)=>{var i=n(66308);Vue.component("spark-send-invitation",{mixins:[i]})},16499:(t,e,n)=>{var i=n(35274);Vue.component("spark-team-members",{mixins:[i]})},99731:(t,e,n)=>{var i=n(40831);Vue.component("spark-team-membership",{mixins:[i]})},69793:(t,e,n)=>{var i=n(3490);Vue.component("spark-team-profile",{mixins:[i]})},35804:(t,e,n)=>{var i=n(52361);Vue.component("spark-team-settings",{mixins:[i]})},8761:(t,e,n)=>{var i=n(49420);Vue.component("spark-update-team-name",{mixins:[i]})},90627:(t,e,n)=>{var i=n(21271);Vue.component("spark-update-team-photo",{mixins:[i]})},98e3:()=>{Vue.component("spark-zapier",{})},78892:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});const i={home:{shortenedLinks:[]},user:{teamPixels:[],shortenedLinks:[],oneLinks:[],teamApi:{},teamTags:[],updateOneLink:{data:{meta:{appearance:{}}}},updateLink:{data:{}},createLink:{data:{}}}}},59562:(t,e,n)=>{t.exports={mixins:[n(2496),n(62387),n(34792),n(39844)],data:function(){return{query:null,cardElement:null,coupon:null,invalidCoupon:!1,country:null,taxRate:0,registerForm:$.extend(!0,new SparkForm({stripe_payment_method:"",plan:"",team:"",team_slug:"",name:"",email:"",password:"",password_confirmation:"",address:"",address_line_2:"",city:"",state:"",zip:"",country:"US",vat_id:"",terms:!0,coupon:null,invitation:null}),Spark.forms.register),cardForm:new SparkForm({name:"",number:"",cvc:"",month:"",year:""})}},watch:{currentBillingAddress:function(t){Spark.collectsEuropeanVat&&this.refreshTaxRate(this.registerForm)},"registerForm.team":function(t,e){""!==this.registerForm.team_slug&&this.registerForm.team_slug!==e.toLowerCase().replace(/[\s\W-]+/g,"-")||(this.registerForm.team_slug=t.toLowerCase().replace(/[\s\W-]+/g,"-"))},selectedPlan:function(t){var e=this;t&&0!==t.price?e.cardElement||e.$nextTick((function(){e.createCardElement("#payment-element",(function(t){e.cardElement=t}))})):e.cardElement=null}},created:function(){this.getPlans(),this.query=URI(document.URL).query(!0),this.query.coupon&&(this.getCoupon(),this.registerForm.coupon=this.query.coupon),this.query.invitation&&(this.getInvitation(),this.registerForm.invitation=this.query.invitation)},methods:{getCoupon:function(){var t=this;axios.get("/coupon/"+this.query.coupon).then((function(e){t.coupon=e.data})).catch((function(e){t.invalidCoupon=!0}))},register:function(){var t=this;if(this.cardForm.errors.forget(),this.registerForm.busy=!0,this.registerForm.errors.forget(),!Spark.cardUpFront||this.registerForm.invitation||0===this.selectedPlan.price)return this.sendRegistration();var e={name:this.cardForm.name,address:{line1:this.registerForm.address||"",line2:this.registerForm.address_line_2||"",city:this.registerForm.city||"",state:this.registerForm.state||"",postal_code:this.registerForm.zip||"",country:this.registerForm.country||""}};this.generateToken((function(n){t.stripe.handleCardSetup(n,t.cardElement,{payment_method_data:{billing_details:e}}).then((function(e){e.error?(t.cardForm.errors.set({card:[e.error.message]}),t.registerForm.busy=!1):t.sendRegistration(e.setupIntent.payment_method)}))}))},sendRegistration:function(t){this.registerForm.stripe_payment_method=t,this.registerForm.team=this.registerForm.name+" Team",Spark.post("/register",this.registerForm).then((function(t){window.location=t.redirect}))}},computed:{countryCollectsVat:function(){return this.collectsVat(this.registerForm.country)},discount:function(){if(this.coupon)return this.coupon.percent_off?this.coupon.percent_off+"%":Vue.filter("currency")(this.coupon.amount_off/100)},currentBillingAddress:function(){return this.registerForm.address+this.registerForm.address_line_2+this.registerForm.city+this.registerForm.state+this.registerForm.zip+this.registerForm.country+this.registerForm.vat_id}}}},74518:(t,e,n)=>{Vue.filter("date",(function(t){return moment.utc(t).local().format("MMMM Do, YYYY")})),Vue.filter("datetime",(function(t){return moment.utc(t).local().format("MMMM Do, YYYY h:mm A")})),Vue.filter("relative",(function(t){return moment.utc(t).local().locale("en-short").fromNow()})),Vue.filter("capitalize",(function(t){return t||0===t?t.toString().charAt(0).toUpperCase()+t.slice(1):""})),Vue.filter("currency",(function(t){return(0,n(90711).Z)({amount:Math.round(100*t),currency:window.Spark.currency}).setLocale(window.Spark.currencyLocale).toFormat("$0,0.00")}))},68113:(t,e,n)=>{Spark.forms={register:{},updateContactInformation:{},updateTeamMember:{}},n(59980),n(90886),$.extend(Spark,n(55363))},90886:()=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}window.SparkFormErrors=function(){this.errors={},this.hasErrors=function(){return!_.isEmpty(this.errors)},this.has=function(t){return _.indexOf(_.keys(this.errors),t)>-1},this.all=function(){return this.errors},this.flatten=function(){return _.flatten(_.toArray(this.errors))},this.get=function(t){if(this.has(t))return this.errors[t][0]},this.set=function(e){"object"===t(e)?this.errors=e:this.errors={form:[__("Something went wrong. Please try again or contact customer support.")]}},this.forget=function(t){void 0===t?this.errors={}:Vue.delete(this.errors,t)}}},59980:()=>{window.SparkForm=function(t){var e=this,n=t;$.extend(this,t),this.errors=new SparkFormErrors,this.busy=!1,this.successful=!1,this.startProcessing=function(){e.errors.forget(),e.busy=!0,e.successful=!1},this.finishProcessing=function(){e.busy=!1,e.successful=!0},this.reset=function(){$.extend(e,n),e.resetStatus()},this.resetStatus=function(){e.errors.forget(),e.busy=!1,e.successful=!1},this.setErrors=function(t){e.busy=!1,e.errors.set(t)}}},55363:t=>{t.exports={post:function(t,e){return Spark.sendForm("post",t,e)},put:function(t,e){return Spark.sendForm("put",t,e)},patch:function(t,e){return Spark.sendForm("patch",t,e)},delete:function(t,e){return Spark.sendForm("delete",t,e)},sendForm:function(t,e,n){return new Promise((function(i,s){n.startProcessing(),axios[t](e,JSON.parse(JSON.stringify(n))).then((function(t){n.finishProcessing(),i(t.data)})).catch((function(t){n.setErrors(t.response.data.errors),s(t.response.data)}))}))}}},68186:(t,e,n)=>{t.exports={mixins:[n(48086)],data:function(){return{loadingCurrentDiscount:!1,currentDiscount:null,discountingUser:null,form:new SparkForm({type:"amount",value:null,duration:"once",months:null})}},created:function(){var t=this;Bus.$on("addDiscount",(function(e){t.form=new SparkForm({type:"amount",value:null,duration:"once",months:null}),t.setUser(e),$("#modal-add-discount").modal("show")}))},methods:{setUser:function(t){this.discountingUser=t,this.getCurrentDiscountForUser(t)},applyDiscount:function(){Spark.post("/spark/kiosk/users/discount/"+this.discountingUser.id,this.form).then((function(){$("#modal-add-discount").modal("hide")}))}}}},74009:t=>{t.exports={data:function(){return{announcements:[],updatingAnnouncement:null,deletingAnnouncement:null,createForm:new SparkForm({body:"",action_text:"",action_url:""}),updateForm:new SparkForm({body:"",action_text:"",action_url:""}),deleteForm:new SparkForm({})}},created:function(){var t=this;Bus.$on("sparkHashChanged",(function(e,n){"announcements"===e&&0===t.announcements.length&&t.getAnnouncements()}))},methods:{getAnnouncements:function(){var t=this;axios.get("/spark/kiosk/announcements").then((function(e){t.announcements=e.data}))},create:function(){var t=this;Spark.post("/spark/kiosk/announcements",this.createForm).then((function(){t.createForm=new SparkForm({body:"",action_text:"",action_url:""}),t.getAnnouncements()}))},editAnnouncement:function(t){this.updatingAnnouncement=t,this.updateForm.icon=t.icon,this.updateForm.body=t.body,this.updateForm.action_text=t.action_text,this.updateForm.action_url=t.action_url,$("#modal-update-announcement").modal("show")},update:function(){var t=this;Spark.put("/spark/kiosk/announcements/"+this.updatingAnnouncement.id,this.updateForm).then((function(){t.getAnnouncements(),$("#modal-update-announcement").modal("hide")}))},approveAnnouncementDelete:function(t){this.deletingAnnouncement=t,$("#modal-delete-announcement").modal("show")},deleteAnnouncement:function(){var t=this;Spark.delete("/spark/kiosk/announcements/"+this.deletingAnnouncement.id,this.deleteForm).then((function(){t.getAnnouncements(),$("#modal-delete-announcement").modal("hide")}))}}}},70606:(t,e,n)=>{t.exports={props:["user"],mixins:[n(9744)],mounted:function(){this.usePushStateForTabs(".spark-settings-tabs")},created:function(){Bus.$on("sparkHashChanged",(function(t,e){return"users"===t&&setTimeout((function(){$("#kiosk-users-search").select()}),150),!0}))}}},39977:t=>{t.exports={props:["user"],data:function(){return{monthlyRecurringRevenue:0,yearlyRecurringRevenue:0,totalVolume:0,genericTrialUsers:0,monthlyEstimates:{},indicators:[],lastMonthsIndicators:null,lastYearsIndicators:null,plans:[]}},created:function(){var t=this;Bus.$on("sparkHashChanged",(function(e,n){"metrics"===e&&0===t.yearlyRecurringRevenue&&(t.getRevenue(),t.getPlans(),t.getTrialUsers(),t.getMonthlyEstimates(),t.getPerformanceIndicators())}))},methods:{getRevenue:function(){var t=this;axios.get("/spark/kiosk/performance-indicators/revenue").then((function(e){t.yearlyRecurringRevenue=e.data.yearlyRecurringRevenue,t.monthlyRecurringRevenue=e.data.monthlyRecurringRevenue,t.totalVolume=e.data.totalVolume}))},getPlans:function(){var t=this;axios.get("/spark/kiosk/performance-indicators/plans").then((function(e){t.plans=e.data}))},getTrialUsers:function(){var t=this;axios.get("/spark/kiosk/performance-indicators/trialing").then((function(e){t.genericTrialUsers=parseInt(e.data)}))},getMonthlyEstimates:function(){var t=this;axios.get("/spark/kiosk/performance-indicators/monthly-estimate").then((function(e){t.monthlyEstimates=e.data}))},getPerformanceIndicators:function(){var t=this;axios.get("/spark/kiosk/performance-indicators").then((function(e){t.indicators=e.data.indicators,t.lastMonthsIndicators=e.data.last_month,t.lastYearsIndicators=e.data.last_year,Vue.nextTick((function(){t.drawCharts()}))}))},drawCharts:function(){this.drawMonthlyRecurringRevenueChart(),this.drawYearlyRecurringRevenueChart(),this.drawDailyVolumeChart(),this.drawNewUsersChart()},drawMonthlyRecurringRevenueChart:function(){return this.drawCurrencyChart("monthlyRecurringRevenueChart",30,(function(t){return t.monthly_recurring_revenue}))},drawYearlyRecurringRevenueChart:function(){return this.drawCurrencyChart("yearlyRecurringRevenueChart",30,(function(t){return t.yearly_recurring_revenue}))},drawDailyVolumeChart:function(){return this.drawCurrencyChart("dailyVolumeChart",14,(function(t){return t.daily_volume}))},drawNewUsersChart:function(){return this.drawChart("newUsersChart",14,(function(t){return t.new_users}))},drawCurrencyChart:function(t,e,n){return this.drawChart(t,e,n,(function(t){return Vue.filter("currency")(t.value)}))},drawChart:function(t,e,n,i){var s=JSON.parse(JSON.stringify(this.baseChartDataSet));s.data=_.map(_.takeRight(this.indicators,e),n);var a={labels:_.takeRight(this.availableChartDates,e),datasets:[s]},r={responsive:!0};4===arguments.length&&(r.scaleLabel=i);new Chart(document.getElementById(t).getContext("2d"),{type:"line",data:a,options:r})},percentChange:function(t,e){var n=Math.round((t-e)/e*100);return n>0?"+"+n.toFixed(0):n.toFixed(0)}},computed:{monthlyChangeInMonthlyRecurringRevenue:function(){return!(!this.lastMonthsIndicators||!this.indicators)&&this.percentChange(_.takeRight(this.indicators).monthly_recurring_revenue,this.lastMonthsIndicators.monthly_recurring_revenue)},yearlyChangeInMonthlyRecurringRevenue:function(){return!(!this.lastYearsIndicators||!this.indicators)&&this.percentChange(_.takeRight(this.indicators).monthly_recurring_revenue,this.lastYearsIndicators.monthly_recurring_revenue)},monthlyChangeInYearlyRecurringRevenue:function(){return!(!this.lastMonthsIndicators||!this.indicators)&&this.percentChange(_.takeRight(this.indicators).yearly_recurring_revenue,this.lastMonthsIndicators.yearly_recurring_revenue)},yearlyChangeInYearlyRecurringRevenue:function(){return!(!this.lastYearsIndicators||!this.indicators)&&this.percentChange(_.takeRight(this.indicators).yearly_recurring_revenue,this.lastYearsIndicators.yearly_recurring_revenue)},totalTrialUsers:function(){return this.genericTrialUsers+_.reduce(this.plans,(function(t,e){return t+e.trialing}),0)},availableChartDates:function(){return _.map(this.indicators,(function(t){return moment(t.created_at).format("M/D")}))},baseChartDataSet:function(){return{label:"Dataset",fillColor:"rgba(151,187,205,0.2)",strokeColor:"rgba(151,187,205,1)",pointColor:"rgba(151,187,205,1)",pointStrokeColor:"#fff",pointHighlightFill:"#fff",pointHighlightStroke:"rgba(151,187,205,1)"}}}}},91303:t=>{t.exports={props:["user","plans"],data:function(){return{loading:!1,profile:null,revenue:0,links:[],oneLinks:[],payments:[]}},created:function(){var t=this;this.$parent.$on("showUserProfile",(function(e){t.getUserProfile(e),t.getUserLinks(e),t.getUserPayments(e)}))},mounted:function(){var t=this;Mousetrap.bind("esc",(function(e){return t.showSearch()}))},methods:{getUserProfile:function(t){var e=this;this.loading=!0,axios.get("/spark/kiosk/users/"+t+"/profile").then((function(t){e.profile=t.data.user,e.revenue=t.data.revenue,e.loading=!1}))},copyLink:function(t){APP.TOOLS.copy(t),$.toast({title:"Link Copied",message:"".concat(t," has been copied to your clipboard"),style:"success"})},getUserLinks:function(t){var e=this;this.loading=!0,axios.get("/spark/kiosk/users/"+t+"/links").then((function(t){e.links=t.data.links,e.loading=!1})),axios.get("/spark/kiosk/users/"+t+"/one-links").then((function(t){e.oneLinks=t.data.oneLinks,e.loading=!1}))},getUserPayments:function(t){var e=this;this.loading=!0,axios.get("/spark/kiosk/users/"+t+"/payments").then((function(t){e.payments=t.data.payments,e.loading=!1}))},impersonate:function(t){window.location="/spark/kiosk/users/impersonate/"+t.id},addDiscount:function(t){Bus.$emit("addDiscount",t)},activePlan:function(t){if(this.activeSubscription(t)){var e=this.activeSubscription(t);return _.find(this.plans,(function(t){return t.id===e.provider_plan}))}},activeSubscription:function(t){var e=this.subscription(t);if(!(!e||e.ends_at&&moment.utc().isAfter(moment.utc(e.ends_at))))return e},subscription:function(t){if(t){var e=_.find(t.subscriptions,(function(t){return"default"===t.name}));return void 0!==e?e:void 0}},customerUrlOnBillingProvider:function(t){if(t)return"https://dashboard.stripe.com/customers/"+t.stripe_id},showSearch:function(){this.$parent.$emit("showSearch"),this.profile=null}}}},18176:t=>{t.exports={data:function(){return{subscribers:[]}},created:function(){var t=this;Bus.$on("sparkHashChanged",(function(e,n){"subscribers"===e&&t.getSubscribers()}))},methods:{getSubscribers:function(){var t=this;axios.get("/spark/kiosk/subscribers").then((function(e){t.subscribers=e.data.subscribers}))}}}},84491:t=>{t.exports={props:["user"],data:function(){return{plans:[],searchForm:new SparkForm({query:""}),searching:!1,noSearchResults:!1,searchResults:[],showingUserProfile:!1}},created:function(){var t=this;this.getPlans(),this.$on("showSearch",(function(){t.navigateToSearch()})),Bus.$on("sparkHashChanged",(function(e,n){return"users"!=e||(n&&n.length>0?t.loadProfile({id:n[0]}):t.showSearch()),!0}))},methods:{getPlans:function(){var t=this;axios.get("/spark/plans").then((function(e){t.plans=e.data}))},search:function(){var t=this;this.searching=!0,this.noSearchResults=!1,axios.post("/spark/kiosk/users/search",this.searchForm).then((function(e){t.searchResults=e.data,t.noSearchResults=0===t.searchResults.length,t.searching=!1}))},navigateToSearch:function(){history.pushState(null,null,"#/users"),this.showSearch()},showSearch:function(){this.showingUserProfile=!1,Vue.nextTick((function(){$("#kiosk-users-search").focus()}))},showUserProfile:function(t){history.pushState(null,null,"#/users/"+t.id),this.loadProfile(t)},loadProfile:function(t){this.$emit("showUserProfile",t.id),this.showingUserProfile=!0}}}},46209:t=>{t.exports={computed:{billable:function(){return this.billableType?"user"===this.billableType?this.user:this.team:this.user},billingUser:function(){return this.billableType&&"user"===this.billableType},spark:function(){return window.Spark}}}},48086:t=>{t.exports={methods:{getCurrentDiscountForBillable:function(t,e){return"user"===t?this.getCurrentDiscountForUser(e):this.getCurrentDiscountForTeam(e)},getCurrentDiscountForUser:function(t){var e=this;this.currentDiscount=null,this.loadingCurrentDiscount=!0,axios.get("/coupon/user/".concat(t.id)).then((function(t){200===t.status&&(e.currentDiscount=t.data),e.loadingCurrentDiscount=!1}))},getCurrentDiscountForTeam:function(t){var e=this;this.currentDiscount=null,this.loadingCurrentDiscount=!0,axios.get("/settings/".concat(Spark.teamsPrefix,"/coupon/").concat(t.id)).then((function(t){200===t.status&&(e.currentDiscount=t.data),e.loadingCurrentDiscount=!1}))},formattedDiscount:function(t){if(t)return t.percent_off?"".concat(t.percent_off,"%"):Vue.filter("currency")(this.calculateAmountOff(t.amount_off))},calculateAmountOff:function(t){return t/100}}}},62387:t=>{t.exports={data:function(){return{selectedPlan:null,detailingPlan:null,showingMonthlyPlans:!0,showingYearlyPlans:!1}},methods:{showMonthlyPlans:function(){this.showingMonthlyPlans=!0,this.showingYearlyPlans=!1},showYearlyPlans:function(){this.showingMonthlyPlans=!1,this.showingYearlyPlans=!0},showPlanDetails:function(t){this.detailingPlan=t,$("#modal-plan-details").modal("show")}},computed:{activeInterval:function(){return this.showingMonthlyPlans?"monthly":"yearly"},plansForActiveInterval:function(){var t=this;return _.filter(this.plans,(function(e){return e.active&&(0===e.price||e.interval===t.activeInterval)}))},paidPlans:function(){return _.filter(this.plans,(function(t){return t.active&&t.price>0}))},paidPlansForActiveInterval:function(){return _.filter(this.plansForActiveInterval,(function(t){return t.active&&t.price>0}))},hasMonthlyAndYearlyPlans:function(){return this.monthlyPlans.length>0&&this.yearlyPlans.length>0},hasMonthlyAndYearlyPaidPlans:function(){return _.filter(this.paidPlans,{interval:"monthly"}).length>0&&_.filter(this.paidPlans,{interval:"yearly"}).length>0},onlyHasYearlyPlans:function(){return 0===this.monthlyPlans.length&&this.yearlyPlans.length>0},onlyHasYearlyPaidPlans:function(){return 0===_.filter(this.paidPlans,{interval:"monthly"}).length&&_.filter(this.paidPlans,{interval:"yearly"}).length>0},monthlyPlans:function(){return _.filter(this.plans,(function(t){return t.active&&"monthly"===t.interval}))},yearlyPlans:function(){return _.filter(this.plans,(function(t){return t.active&&"yearly"===t.interval}))}}}},2496:t=>{t.exports={data:function(){return{plans:[],selectedPlan:null,invitation:null,invalidInvitation:!1}},methods:{getPlans:function(){var t=this;Spark.cardUpFront&&axios.get("/spark/plans").then((function(e){var n=e.data;t.plans=_.filter(n,{type:"user"}).length>0?_.filter(n,{type:"user"}):_.filter(n,{type:"team"}),t.selectAppropriateDefaultPlan()}))},getInvitation:function(){var t=this;axios.get("/invitations/".concat(this.query.invitation)).then((function(e){t.invitation=e.data})).catch((function(e){t.invalidInvitation=!0}))},selectAppropriateDefaultPlan:function(){this.query.plan?this.selectPlanById(this.query.plan)||this.selectPlanByName(this.query.plan):this.query.invitation?this.selectFreePlan():this.paidPlansForActiveInterval.length>0?this.selectPlan(this.paidPlansForActiveInterval[0]):this.selectFreePlan(),this.shouldShowYearlyPlans()&&this.showYearlyPlans()},selectFreePlan:function(){var t=_.find(this.plans,(function(t){return 0===t.price}));void 0!==t&&this.selectPlan(t)},selectPlanById:function(t){var e=this;return _.each(this.plans,(function(n){n.id===t&&e.selectPlan(n)})),this.selectedPlan},selectPlanByName:function(t){var e=this;return _.each(this.plans,(function(n){n.name===t&&e.selectPlan(n)})),this.selectedPlan},isSelected:function(t){return this.selectedPlan&&t.id===this.selectedPlan.id},selectPlan:function(t){this.selectedPlan=t,this.registerForm.plan=t.id},shouldShowYearlyPlans:function(){return 0===this.monthlyPlans.length&&this.yearlyPlans.length>0||"yearly"===this.selectedPlan.interval}}}},39844:t=>{t.exports={data:function(){return{stripe:Spark.stripeKey?Stripe(Spark.stripeKey,{apiVersion:Spark.stripeApiVersion,betas:["link_beta_3"]}):null}},methods:{createCardElement:function(t,e){var n=this;n.generateToken((function(i){if(!n.stripe)throw"Invalid Stripe Key/Secret";var s={clientSecret:i,appearance:{theme:"stripe",labels:"above",variables:{fontSizeBase:"18px",colorText:"#32325d",colorPrimary:"#495057",colorDanger:"#e95420",fontFamily:'Whitney, Lato, -apple-system, BlinkMacSystemFont,"Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji","Segoe UI Emoji", "Segoe UI Symbol"'}},loader:"auto"},a=n.stripe.elements(s),r=a.create("payment",{defaultValues:{billingDetails:{name:n.user.name}}});a.create("linkAuthentication",{defaultValues:{email:n.user.email}}).mount("#link-authentication-element"),r.mount(t),e(a)}))},generateToken:function(t){return axios.get("/stripe/token").then((function(e){return t(e.data.clientSecret)}))}}}},6227:t=>{t.exports={data:function(){return{selectingPlan:null,planForm:new SparkForm({})}},methods:{updateSubscription:function(t){var e=this;this.selectingPlan=t,this.planForm.errors.forget(),axios.put(this.urlForPlanUpdate,{plan:t.id}).then((function(){Bus.$emit("updateUser"),Bus.$emit("updateTeam")})).catch((function(t){400==t.response.status?($.toast({title:"Please Try Again",message:"Please try again and verify your payment information is correct",style:"error"}),setTimeout((function(){window.location.reload(!0)}),3e3)):422===t.response.status?e.planForm.errors.set(t.response.data.errors):e.planForm.errors.set({plan:[__("We were unable to update your subscription. Please contact customer support.")]})})).finally((function(){e.selectingPlan=null}))},isActivePlan:function(t){return this.activeSubscription&&this.activeSubscription.provider_plan===t.id}},computed:{activePlan:function(){var t=this;if(this.activeSubscription)return _.find(this.plans,(function(e){return e.id===t.activeSubscription.provider_plan}))},activePlanIsMonthly:function(){return this.activePlan&&"monthly"===this.activePlan.interval},activeSubscription:function(){if(this.billable){var t=_.find(this.billable.subscriptions,(function(t){return"default"===t.name&&!_.includes(["incomplete","incomplete_expired","past_due","unpaid"],t.stripe_status)}));return void 0!==t?t:void 0}},subscriptionIsActive:function(){return this.activeSubscription&&!this.activeSubscription.ends_at},onGenericTrial:function(){return this.billable.trial_ends_at&&moment.utc(this.billable.trial_ends_at).isAfter(moment.utc())},subscriptionIsOnTrial:function(){return!!this.onGenericTrial||this.activeSubscription&&this.activeSubscription.trial_ends_at&&moment.utc().isBefore(moment.utc(this.activeSubscription.trial_ends_at))},trialEndsAt:function(){if(this.subscriptionIsOnTrial)return this.onGenericTrial?moment.utc(this.billable.trial_ends_at).local().format("MMMM Do, YYYY"):moment.utc(this.activeSubscription.trial_ends_at).local().format("MMMM Do, YYYY")},subscriptionIsOnGracePeriod:function(){return this.activeSubscription&&this.activeSubscription.ends_at&&moment.utc().isBefore(moment.utc(this.activeSubscription.ends_at))},needsSubscription:function(){return!this.activeSubscription||this.activeSubscription.ends_at&&moment.utc().isAfter(moment.utc(this.activeSubscription.ends_at))},urlForPlanUpdate:function(){return this.billingUser?"/settings/subscription":"/settings/".concat(Spark.teamsPrefix,"/").concat(this.team.id,"/subscription")},urlForPlanRedirect:function(){return this.billingUser?"/settings%23/subscription":"/settings/".concat(Spark.teamsPrefix,"/").concat(this.team.id,"%23/subscription")}}}},9744:t=>{t.exports={pushStateSelector:null,methods:{usePushStateForTabs:function(t){var e=this;this.pushStateSelector=t,this.registerTabClickHandler(),window.addEventListener("popstate",(function(t){e.activateTabForCurrentHash()})),window.location.hash?this.activateTabForCurrentHash():this.activateFirstTab()},registerTabClickHandler:function(){var t=this;$("".concat(this.pushStateSelector,' a[data-toggle="tab"]')).on("click",(function(e){t.removeActiveClassFromTabs(),history.pushState(null,null,"#/"+$(this).attr("href").substring(1)),t.broadcastTabChange($(this).attr("href").substring(1))}))},activateTabForCurrentHash:function(){var t=window.location.hash.substring(2),e=t.split("/");t=e.shift(),this.removeActiveClassFromTabs();var n=$("".concat(this.pushStateSelector,' a[href="#').concat(t,'"][data-toggle="tab"]'));n.length>0?(n.tab("show"),this.broadcastTabChange(t,e)):this.activateFirstTab()},activateFirstTab:function(){var t=$("".concat(this.pushStateSelector,' a[data-toggle="tab"]')).first();t.length&&(t.tab("show"),this.broadcastTabChange(t.attr("href").substring(1)))},removeActiveClassFromTabs:function(){$("".concat(this.pushStateSelector," a")).removeClass("active")},broadcastTabChange:function(t,e){Bus.$emit("sparkHashChanged",t,e)}}}},34792:t=>{t.exports={methods:{collectsVat:function(t){return!!Spark.collectsEuropeanVat&&_.includes(["BE","BG","CZ","DK","DE","EE","IE","GR","ES","FR","HR","IT","CY","LV","LT","LU","HU","MT","NL","AT","PL","PT","RO","SI","SK","FI","SE","GB"],t)},refreshTaxRate:function(t){var e=this;axios.post("/tax-rate",JSON.parse(JSON.stringify(t))).then((function(t){e.taxRate=t.data.rate}))},taxAmount:function(t){return t.price*(this.taxRate/100)},priceWithTax:function(t){return t.price+this.taxAmount(t)}}}},32233:t=>{t.exports={props:["user","teams","currentTeam","unreadAnnouncementsCount","unreadNotificationsCount"],computed:{notificationsCount:function(){return this.unreadAnnouncementsCount+this.unreadNotificationsCount}},methods:{showNotifications:function(){Bus.$emit("showNotifications")},showSupportForm:function(){Bus.$emit("showSupportForm")},openCreateLinkModal:function(){Bus.$emit("open-create-update-link-modal",!0)}}}},83103:t=>{t.exports={props:["notifications","hasUnreadAnnouncements","loadingNotifications"],data:function(){return{showingNotifications:!0,showingAnnouncements:!1}},methods:{showNotifications:function(){this.showingNotifications=!0,this.showingAnnouncements=!1},showAnnouncements:function(){this.showingNotifications=!1,this.showingAnnouncements=!0,this.updateLastReadAnnouncementsTimestamp()},updateLastReadAnnouncementsTimestamp:function(){axios.put("/user/last-read-announcements-at").then((function(){Bus.$emit("updateUser")}))}},computed:{activeNotifications:function(){return this.notifications?this.showingNotifications?this.notifications.notifications:this.notifications.announcements:[]},hasNotifications:function(){return this.notifications&&this.notifications.notifications.length>0},hasAnnouncements:function(){return this.notifications&&this.notifications.announcements.length>0}}}},90143:t=>{t.exports={data:function(){return{tokens:[],availableAbilities:[]}},mounted:function(){this.getTokens(),this.getAvailableAbilities()},created:function(){var t=this;this.$on("updateTokens",(function(){t.getTokens()}))},methods:{getTokens:function(){var t=this;axios.get("/settings/api/tokens").then((function(e){return t.tokens=e.data}))},getAvailableAbilities:function(){var t=this;axios.get("/settings/api/token/abilities").then((function(e){return t.availableAbilities=e.data}))}}}},33607:t=>{t.exports={props:["availableAbilities"],data:function(){return{showingToken:null,allAbilitiesAssigned:!1,form:new SparkForm({name:"",abilities:[]})}},computed:{copyCommandSupported:function(){return document.queryCommandSupported("copy")}},watch:{availableAbilities:function(){this.availableAbilities.length>0&&this.assignDefaultAbilities()}},methods:{assignDefaultAbilities:function(){var t=_.filter(this.availableAbilities,(function(t){return t.default}));this.form.abilities=_.map(t,"value")},assignAllAbilities:function(){this.allAbilitiesAssigned=!0,this.form.abilities=_.map(this.availableAbilities,"value")},removeAllAbilities:function(){this.allAbilitiesAssigned=!1,this.form.abilities=[]},toggleAbility:function(t){this.abilityIsAssigned(t)?this.form.abilities=_.reject(this.form.abilities,(function(e){return e==t})):this.form.abilities.push(t)},abilityIsAssigned:function(t){return _.includes(this.form.abilities,t)},create:function(){var t=this;Spark.post("/settings/api/token",this.form).then((function(e){t.showToken(e.token),t.resetForm(),t.$parent.$emit("updateTokens")}))},showToken:function(t){this.showingToken=t,$("#modal-show-token").modal("show")},selectToken:function(){$("#api-token").select(),this.copyCommandSupported&&document.execCommand("copy")},resetForm:function(){this.form.name="",this.assignDefaultAbilities(),this.allAbilitiesAssigned=!1}}}},20915:t=>{t.exports={props:["tokens","availableAbilities"],data:function(){return{updatingToken:null,deletingToken:null,updateTokenForm:new SparkForm({name:"",abilities:[]}),deleteTokenForm:new SparkForm({})}},methods:{editToken:function(t){this.updatingToken=t,this.initializeUpdateFormWith(t),$("#modal-update-token").modal("show")},initializeUpdateFormWith:function(t){this.updateTokenForm.name=t.name,this.updateTokenForm.abilities=t.metadata.abilities},updateToken:function(){var t=this;Spark.put("/settings/api/token/".concat(this.updatingToken.id),this.updateTokenForm).then((function(e){t.$parent.$emit("updateTokens"),$("#modal-update-token").modal("hide")}))},toggleAbility:function(t){this.abilityIsAssigned(t)?this.updateTokenForm.abilities=_.reject(this.updateTokenForm.abilities,(function(e){return e==t})):this.updateTokenForm.abilities.push(t)},abilityIsAssigned:function(t){return _.includes(this.updateTokenForm.abilities,t)},approveTokenDelete:function(t){this.deletingToken=t,$("#modal-delete-token").modal("show")},deleteToken:function(){var t=this;Spark.delete("/settings/api/token/".concat(this.deletingToken.id),this.deleteTokenForm).then((function(){t.$parent.$emit("updateTokens"),$("#modal-delete-token").modal("hide")}))}}}},32002:t=>{t.exports={data:function(){return{domains:[]}},mounted:function(){this.getDomains()},created:function(){var t=this;this.$on("updateDomains",(function(){t.getDomains()}))},methods:{getDomains:function(){var t=this;axios.get("api/v1/domain/list?include_non_verified=true").then((function(e){t.domains=e.data})).catch((function(t){}))}}}},52234:t=>{t.exports={data:function(){return{form:new SparkForm({domain:null,fallback_url:"https://t.ly/",is_case_sensitive:!0})}},computed:{exampleDomain:function(){return this.form.domain?this.form.domain:"https://es.pn"}},methods:{create:function(){var t=this;Spark.post("/api/v1/domain/add",this.form).then((function(e){t.resetForm(),t.$parent.$emit("updateDomains"),$("#addDomainInfo").modal("show")}))},resetForm:function(){this.form.domain=null,this.form.fallback_url=null}}}},27466:t=>{t.exports={props:["domains"],data:function(){return{customDomainProxy:_customDomainProxy,customDomainCName:_customDomainCName,selectedDomain:null,form:new SparkForm({id:null,domain:null,fallback_url:null,is_case_sensitive:!0})}},mounted:function(){var t=this;$("#addDomainInfo").on("hidden.bs.modal",(function(){t.selectedDomain=null}))},methods:{setSelectedDomain:function(t){this.selectedDomain=t},showUpdateDomainModal:function(t){this.form.id=t.id,this.form.domain=t.domain,this.form.fallback_url=t.fallback_url,this.form.is_case_sensitive=t.is_case_sensitive,$("#updateDomainInfo").modal("show")},showDeleteDomainModal:function(t,e){var n=this;Swal.fire({title:"Are you sure?",text:"You will not be able to recover this domain! All short links using this domain will also be deleted.",showCancelButton:!0,confirmButtonColor:APP.TOOLS.getCssVar("warning"),confirmButtonText:"Yes, delete it!",html:!1}).then((function(i){i.value&&(APP.LOADER.show(),axios.delete(_apiUrl+"v1/domain/delete",{data:{id:e.id}}).then((function(e){n.domains.splice(t,1),$.toast({title:"Domain Deleted",message:"Your custom domain has been deleted",style:"success"}),APP.LOADER.hide()})))}))},updateDomain:function(){var t=this;Spark.put("/api/v1/domain/update",this.form).then((function(e){t.$parent.$emit("updateDomains"),$("#updateDomainInfo").modal("hide"),$.toast({title:"Domain Updated",message:"Your custom domain has been updated",style:"success"})}))}}}},2350:t=>{t.exports={props:["user","team","billableType"],data:function(){return{invoices:[]}},mounted:function(){this.getInvoices()},methods:{getInvoices:function(){var t=this;axios.get(this.urlForInvoices).then((function(e){t.invoices=_.filter(e.data,(function(t){return"$0.00"!=t.total}))}))}},computed:{urlForInvoices:function(){return this.billingUser?"/settings/invoices":"/settings/".concat(Spark.teamsPrefix,"/").concat(this.team.id,"/invoices")}}}},3450:t=>{t.exports={props:["user","team","invoices","billableType"],methods:{downloadUrlFor:function(t){return this.billingUser?"/settings/invoice/".concat(t.id):"/settings/".concat(Spark.teamsPrefix,"/").concat(this.team.id,"/invoice/").concat(t.id)}}}},38258:t=>{t.exports={props:["user","team","billableType"],data:function(){return{form:new SparkForm({information:""})}},mounted:function(){this.form.information=this.billable.extra_billing_information},methods:{update:function(){Spark.put(this.urlForUpdate,this.form)}},computed:{urlForUpdate:function(){return this.billingUser?"/settings/extra-billing-information":"/settings/".concat(Spark.teamsPrefix,"/").concat(this.team.id,"/extra-billing-information")}}}},60291:(t,e,n)=>{t.exports={props:["user","team","billableType"],mixins:[n(48086)],data:function(){return{currentDiscount:null,loadingCurrentDiscount:!1}},created:function(){var t=this;this.$on("updateDiscount",(function(){return t.getCurrentDiscountForBillable(t.billableType,t.billable),!0}))},mounted:function(){this.getCurrentDiscountForBillable(this.billableType,this.billable)}}},10904:t=>{t.exports={props:["user","team","billableType"],data:function(){return{form:new SparkForm({coupon:""})}},methods:{redeem:function(){var t=this;Spark.post(this.urlForRedemption,this.form).then((function(){t.form.coupon="",t.$parent.$emit("updateDiscount")}))}},computed:{urlForRedemption:function(){return this.billingUser?"/settings/payment-method/coupon":"/settings/".concat(Spark.teamsPrefix,"/").concat(this.team.id,"/payment-method/coupon")}}}},59578:(t,e,n)=>{t.exports={props:["user","team","billableType"],mixins:[n(39844)],data:function(){return{cardElement:null,form:new SparkForm({stripe_payment_method:"",address:"",address_line_2:"",city:"",state:"",zip:"",country:"US"}),cardForm:new SparkForm({name:""})}},mounted:function(){var t=this;t.createCardElement("#payment-card-element",(function(e){t.cardElement=e,t.initializeBillingAddress()}))},methods:{initializeBillingAddress:function(){Spark.collectsBillingAddress&&(this.form.address=this.billable.billing_address,this.form.address_line_2=this.billable.billing_address_line_2,this.form.city=this.billable.billing_city,this.form.state=this.billable.billing_state,this.form.zip=this.billable.billing_zip,this.form.country=this.billable.billing_country||"US")},update:function(t){var e=this;this.form.busy=!0,this.form.errors.forget(),this.form.successful=!1,this.cardForm.errors.forget();var n={name:this.cardForm.name,address:{line1:this.form.address||"",line2:this.form.address_line_2||"",city:this.form.city||"",state:this.form.state||"",postal_code:this.form.zip||"",country:this.form.country||""}};this.stripe.confirmSetup({elements:this.cardElement,redirect:"if_required",confirmParams:{return_url:window.location.href,payment_method_data:{billing_details:n}}}).then((function(t){t.error?(e.cardForm.errors.set({card:[t.error.message]}),e.form.busy=!1):e.sendUpdateToServer(t.setupIntent.payment_method)}))},sendUpdateToServer:function(t){var e=this;this.form.stripe_payment_method=t,Spark.put(this.urlForUpdate,this.form).then((function(t){Bus.$emit("updateUser"),Bus.$emit("updateTeam"),e.cardForm.name="",setTimeout((function(){location.reload()}),2e3)}))}},computed:{billableName:function(){return this.billingUser?this.user.name:this.team.owner.name},urlForUpdate:function(){return this.billingUser?"/settings/payment-method":"/settings/".concat(Spark.teamsPrefix,"/").concat(this.team.id,"/payment-method")},cardIcon:function(){if(!this.billable.card_brand)return"fa-cc-stripe";switch(this.billable.card_brand){case"amex":return"fa-cc-amex";case"diners":return"fa-cc-diners-club";case"discover":return"fa-cc-discover";case"jcb":return"fa-cc-jcb";case"mastercard":return"fa-cc-mastercard";case"visa":return"fa-cc-visa";default:return"fa-cc-stripe"}},placeholder:function(){return this.billable.pm_last_four?"************".concat(this.billable.pm_last_four):""}}}},50799:t=>{t.exports={props:["user","team","billableType"],data:function(){return{form:new SparkForm({vat_id:""})}},mounted:function(){this.form.vat_id=this.billable.vat_id},methods:{update:function(){Spark.put(this.urlForUpdate,this.form)}},computed:{urlForUpdate:function(){return this.billingUser?"/settings/payment-method/vat-id":"/settings/".concat(Spark.teamsPrefix,"/").concat(this.team.id,"/payment-method/vat-id")}}}},20544:t=>{t.exports={data:function(){return{pixels:[]}},mounted:function(){this.getPixels()},created:function(){var t=this;Bus.$on("updatePixels",(function(){t.getPixels()}))},methods:{getPixels:function(){var t=this;axios.get("api/v1/link/pixel").then((function(e){t.pixels=e.data})).catch((function(t){}))}}}},78154:t=>{t.exports={methods:{openAddPixel:function(){$("#addPixel").modal("show")}}}},78162:t=>{t.exports={props:["pixels"],data:function(){return{selectedPixel:null}},methods:{showUpdatePixelModal:function(t){Bus.$emit("setUpdatePixelModal",t),$("#addPixel").modal("show")},showDeletePixelModal:function(t,e){var n=this;Swal.fire({title:"Are you sure?",text:"You will not be able to recover this pixel! All short links using this pixel will be updated.",showCancelButton:!0,confirmButtonColor:APP.TOOLS.getCssVar("warning"),confirmButtonText:"Yes, delete it!",html:!1}).then((function(i){i.value&&axios.delete(_apiUrl+"v1/link/pixel/"+e.id).then((function(e){n.pixels.splice(t,1),$.toast({title:"Pixel Deleted",message:"Pixel has been deleted",style:"success"})}))}))}}}},20506:t=>{t.exports={props:["user"]}},68638:t=>{t.exports={props:["user"],data:function(){return{form:$.extend(!0,new SparkForm({name:"",email:""}),Spark.forms.updateContactInformation)}},mounted:function(){this.form.name=this.user.name,this.form.email=this.user.email},methods:{update:function(){Spark.put("/settings/contact",this.form).then((function(){Bus.$emit("updateUser")}))}}}},96909:t=>{t.exports={props:["user"],data:function(){return{form:new SparkForm({})}},methods:{update:function(t){if(t.preventDefault(),this.$refs.photo.files.length){var e=this;this.form.startProcessing(),axios.post("/settings/photo",this.gatherFormData()).then((function(){Bus.$emit("updateUser"),e.form.finishProcessing()}),(function(t){e.form.setErrors(t.response.data.errors)}))}},gatherFormData:function(){var t=new FormData;return t.append("photo",this.$refs.photo.files[0]),t}},computed:{previewStyle:function(){return"background-image: url(".concat(this.user.photo_url,")")}}}},78913:t=>{t.exports={props:["user"],data:function(){return{twoFactorResetCode:null}},created:function(){var t=this;this.$on("receivedTwoFactorResetCode",(function(e){t.twoFactorResetCode=e,$("#modal-show-two-factor-reset-code").modal("show")}))}}},22732:t=>{t.exports={props:["user"],data:function(){return{form:new SparkForm({})}},methods:{disable:function(){Spark.delete("/settings/two-factor-auth",this.form).then((function(){Bus.$emit("updateUser")}))}}}},29753:t=>{t.exports={data:function(){return{form:new SparkForm({current_password:"",password:"",password_confirmation:""})}},methods:{update:function(){Spark.put("/settings/password",this.form)}}}},49749:(t,e,n)=>{t.exports={props:["user","teams"],mixins:[n(9744)],data:function(){return{billableType:"user",team:null}},mounted:function(){this.usePushStateForTabs(".spark-settings-tabs")}}},94562:(t,e,n)=>{t.exports={props:["user","team","billableType"],mixins:[n(62387),n(6227)],data:function(){return{plans:[]}},mounted:function(){var t=this;this.getPlans(),this.$on("showPlanDetails",(function(e){t.showPlanDetails(e)}))},methods:{getPlans:function(){var t=this;axios.get("/spark/plans").then((function(e){t.plans=t.billingUser?_.filter(e.data,{type:"user"}):_.filter(e.data,{type:"team"})}))}}}},58680:t=>{t.exports={props:["user","team","billableType"],data:function(){return{form:new SparkForm({})}},methods:{confirmCancellation:function(){$("#modal-confirm-cancellation").modal("show")},cancel:function(){Spark.delete(this.urlForCancellation,this.form).then((function(){Bus.$emit("updateUser"),Bus.$emit("updateTeam"),$("#modal-confirm-cancellation").modal("hide")}))}},computed:{urlForCancellation:function(){return this.billingUser?"/settings/subscription":"/settings/".concat(Spark.teamsPrefix,"/").concat(this.team.id,"/subscription")}}}},67937:(t,e,n)=>{t.exports={props:["user","team","plans","billableType"],mixins:[n(62387),n(6227)],mounted:function(){this.selectActivePlanInterval()},methods:{showPlanDetails:function(t){this.$parent.$emit("showPlanDetails",t)},priceWithTax:function(t){return t.price+t.price*(this.billable.tax_rate/100)},selectActivePlanInterval:function(){this.activePlanIsMonthly||0===this.yearlyPlans.length?this.showMonthlyPlans():this.showYearlyPlans()}}}},96704:(t,e,n)=>{t.exports={props:["user","team","plans","billableType"],mixins:[n(62387),n(6227),n(34792),n(39844)],data:function(){return{taxRate:0,cardElement:null,form:new SparkForm({use_existing_payment_method:this.hasPaymentMethod()?"1":"0",stripe_payment_method:"",plan:"",coupon:null,address:"",address_line_2:"",city:"",state:"",zip:"",country:"US",vat_id:""}),cardForm:new SparkForm({name:""})}},watch:{currentBillingAddress:function(t){Spark.collectsEuropeanVat&&this.refreshTaxRate(this.form)}},mounted:function(){var t=this;t.setupCardElement();var e=t.plans.find((function(t){return"personal-2"===t.id&&t.active}));e&&!t.selectedPlan&&t.selectPlan(e)},methods:{setupCardElement:function(){var t=this;t.createCardElement("#subscription-card-element",(function(e){t.cardElement=e,t.initializeBillingAddress(),t.onlyHasYearlyPaidPlans&&t.showYearlyPlans()}))},initializeBillingAddress:function(){this.form.address=this.billable.billing_address,this.form.address_line_2=this.billable.billing_address_line_2,this.form.city=this.billable.billing_city,this.form.state=this.billable.billing_state,this.form.zip=this.billable.billing_zip,this.form.country=this.billable.billing_country||"US",this.form.vat_id=this.billable.vat_id},selectPlan:function(t){this.selectedPlan=t,this.form.plan=this.selectedPlan.id},subscribe:function(){var t=this;if(APP.LOADER.show(),this.cardForm.errors.forget(),this.form.startProcessing(),"1"==this.form.use_existing_payment_method)return this.createSubscription();var e={name:this.cardForm.name,address:{line1:this.form.address||"",line2:this.form.address_line_2||"",city:this.form.city||"",state:this.form.state||"",postal_code:this.form.zip||"",country:this.form.country||""}};this.stripe.confirmSetup({elements:this.cardElement,redirect:"if_required",confirmParams:{return_url:window.location.href,payment_method_data:{billing_details:e}}}).then((function(e){e.error?(t.cardForm.errors.set({card:[e.error.message]}),APP.LOADER.hide(),t.form.busy=!1):t.createSubscription(e.setupIntent.payment_method)}))},createSubscription:function(t){var e=this,n=this;this.form.stripe_payment_method=t,axios.post(this.urlForNewSubscription,this.form).then((function(t){Bus.$emit("updateUser"),Bus.$emit("updateTeam"),$.toast({title:"Thank You!",message:"Your subscription has been added.",style:"success"}),$("#trial-banner, #nav-upgrade-btn, .update-payment-method-alert").hide(),APP.LOADER.hide(),gtag_report_conversion(t.data.value)})).catch((function(t){APP.LOADER.hide(),400==t.response.status?$.toast({title:"Please Try Again",message:"Please verify your payment information. You may receive an email to complete this payment. Complete this email and try again.",style:"error",duration:1e4}):e.form.setErrors(t.response.data.errors),e.form.busy=!1,n.setupCardElement()}))},hasSubscribed:function(t){return!!_.filter(this.billable.subscriptions,{provider_plan:t.id}).length},showPlanDetails:function(t){this.$parent.$emit("showPlanDetails",t)},hasPaymentMethod:function(){return this.team?this.team.pm_last_four:this.user.pm_last_four}},computed:{billableName:function(){return this.billingUser?this.user.name:this.team.owner.name},countryCollectsVat:function(){return this.collectsVat(this.form.country)},urlForNewSubscription:function(){return this.billingUser?"/settings/subscription":"/settings/".concat(Spark.teamsPrefix,"/").concat(this.team.id,"/subscription")},urlForPlanRedirect:function(){return this.billingUser?"/settings%23/subscription":"/settings/".concat(Spark.teamsPrefix,"/").concat(this.team.id,"%23/subscription")},currentBillingAddress:function(){return this.form.address+this.form.address_line_2+this.form.city+this.form.state+this.form.zip+this.form.country+this.form.vat_id},pmPlaceholder:function(){return this.billable.pm_last_four?"***".concat(this.billable.pm_last_four):""}}}},5621:(t,e,n)=>{t.exports={props:["user","team","plans","billableType"],mixins:[n(62387),n(6227)],data:function(){return{confirmingPlan:null}},mounted:function(){var t=this;this.selectActivePlanInterval(),this.$watch("activePlan",(function(e){t.selectActivePlanInterval()})),this.onlyHasYearlyPlans&&this.showYearlyPlans()},methods:{confirmPlanUpdate:function(t){this.confirmingPlan=t,$("#modal-confirm-plan-update").modal("show")},approvePlanUpdate:function(){$("#modal-confirm-plan-update").modal("hide"),this.updateSubscription(this.confirmingPlan)},selectActivePlanInterval:function(){this.activePlanIsMonthly||0===this.yearlyPlans.length?this.showMonthlyPlans():this.showYearlyPlans()},showPlanDetails:function(t){this.$parent.$emit("showPlanDetails",t)},priceWithTax:function(t){return t.price+t.price*(this.billable.tax_rate/100)}}}},14131:t=>{t.exports={data:function(){return{tags:[]}},mounted:function(){this.getTags()},created:function(){var t=this;this.$on("updateTags",(function(){t.getTags()}))},methods:{getTags:function(){var t=this;axios.get("api/v1/link/tag").then((function(e){t.tags=e.data})).catch((function(t){}))}}}},75941:t=>{t.exports={data:function(){return{form:new SparkForm({tag:null})}},methods:{create:function(){var t=this;Spark.post("/api/v1/link/tag",this.form).then((function(e){t.resetForm(),t.$parent.$emit("updateTags"),$.toast({title:"Tag Added",message:"Your tag has been added",style:"success"})}))},resetForm:function(){this.form.tag=null}}}},54924:t=>{t.exports={props:["tags"],data:function(){return{selectedTag:null,form:new SparkForm({id:null,tag:null})}},mounted:function(){},methods:{setSelectedTag:function(t){this.selectedTag=t},showUpdateTagModal:function(t){this.form.id=t.id,this.form.tag=t.tag,$("#updateTag").modal("show"),setTimeout((function(){$("#update-tag-field").focus()}),500)},showDeleteTagModal:function(t,e){var n=this;Swal.fire({title:"Are you sure?",text:"You will not be able to recover this tag! All short links using this tag will be updated.",showCancelButton:!0,confirmButtonColor:APP.TOOLS.getCssVar("warning"),confirmButtonText:"Yes, delete it!",html:!1}).then((function(i){i.value&&axios.delete(_apiUrl+"v1/link/tag/"+e.id).then((function(e){n.tags.splice(t,1),$.toast({title:"Tag Deleted",message:"Tag has been deleted",style:"success"})}))}))},updateTag:function(){var t=this;Spark.put("/api/v1/link/tag/"+this.form.id,this.form).then((function(e){t.$parent.$emit("updateTags"),$("#updateTag").modal("hide"),$.toast({title:"Tag Updated",message:"Tag has been updated",style:"success"})}))}}}},23445:t=>{t.exports={props:["user","teams"]}},40759:t=>{t.exports={data:function(){return{plans:[],form:new SparkForm({name:"",slug:""})}},computed:{activeSubscription:function(){if(this.$parent.billable){var t=_.find(this.$parent.billable.subscriptions,(function(t){return"default"===t.name}));return void 0!==t?t:void 0}},activePlan:function(){var t=this;if(this.activeSubscription)return _.find(this.plans,(function(e){return e.id===t.activeSubscription.provider_plan}))},hasTeamLimit:function(){return!!this.activePlan&&!!this.activePlan.attributes.teams},remainingTeams:function(){var t=_.filter(this.$parent.teams,{owner_id:this.$parent.billable.id});return this.activePlan?this.activePlan.attributes.teams-t.length:0},canCreateMoreTeams:function(){return!this.hasTeamLimit||this.remainingTeams>0}},created:function(){this.getPlans()},watch:{"form.name":function(t,e){""!==this.form.slug&&this.form.slug!==e.toLowerCase().replace(/[\s\W-]+/g,"-")||(this.form.slug=t.toLowerCase().replace(/[\s\W-]+/g,"-"))}},methods:{create:function(){var t=this;Spark.post("/settings/"+Spark.teamsPrefix,this.form).then((function(e){t.form.name="",t.form.slug="",e.pendingPayment?window.location="/"+Spark.cashierPath+"/payment/"+e.pendingPayment+"?redirect=/settings%23/subscription":(Bus.$emit("updateUser"),Bus.$emit("updateTeams"))}))},getPlans:function(){var t=this;axios.get("/spark/plans").then((function(e){t.plans=e.data}))}}}},44302:t=>{t.exports={props:["user","teams"],data:function(){return{leavingTeam:null,deletingTeam:null,leaveTeamForm:new SparkForm({}),deleteTeamForm:new SparkForm({}),sparkState:Spark.state}},mounted:function(){$('[data-toggle="tooltip"]').tooltip()},computed:{urlForLeaving:function(){return"/settings/".concat(Spark.teamsPrefix,"/").concat(this.leavingTeam.id,"/members/").concat(this.user.id)}},methods:{approveLeavingTeam:function(t){this.leavingTeam=t,$("#modal-leave-team").modal("show")},leaveTeam:function(){Spark.delete(this.urlForLeaving,this.leaveTeamForm).then((function(){Bus.$emit("updateUser"),Bus.$emit("updateTeams"),$("#modal-leave-team").modal("hide")}))},approveTeamDelete:function(t){this.deletingTeam=t,$("#modal-delete-team").modal("show")},deleteTeam:function(){Spark.delete("/settings/".concat(Spark.teamsPrefix,"/").concat(this.deletingTeam.id),this.deleteTeamForm).then((function(){Bus.$emit("updateUser"),Bus.$emit("updateTeams"),$("#modal-delete-team").modal("hide")}))}}}},42759:t=>{t.exports={props:["team","invitations"],methods:{cancel:function(t){var e=this;axios.delete("/settings/invitations/".concat(t.id)).then((function(){e.$parent.$emit("updateInvitations")}))},copyLink:function(t){var e=_baseUrl+"register?invitation="+t.token;APP.TOOLS.copy(e),$.toast({title:"Invitation Link Copied",message:"URL has been copied to your clipboard",style:"success"})}}}},17296:t=>{t.exports={data:function(){return{invitations:[]}},created:function(){this.getPendingInvitations()},methods:{getPendingInvitations:function(){var t=this;axios.get("/settings/invitations/pending").then((function(e){t.invitations=e.data}))},accept:function(t){var e=this;axios.post("/settings/invitations/".concat(t.id,"/accept")).then((function(){Bus.$emit("updateTeams"),e.getPendingInvitations()})),this.removeInvitation(t)},reject:function(t){var e=this;axios.post("/settings/invitations/".concat(t.id,"/reject")).then((function(){e.getPendingInvitations()})),this.removeInvitation(t)},removeInvitation:function(t){this.invitations=_.reject(this.invitations,(function(e){return e.id===t.id}))}}}},66308:t=>{t.exports={props:["user","team","billableType","defaultRole"],data:function(){return{plans:[],roles:[],form:new SparkForm({email:"",role:this.defaultRole})}},computed:{activeSubscription:function(){if(this.billable){var t=_.find(this.billable.subscriptions,(function(t){return"default"===t.name}));return void 0!==t?t:void 0}},activePlan:function(){var t=this;if(this.activeSubscription)return _.find(this.plans,(function(e){return e.id===t.activeSubscription.provider_plan}))},hasTeamMembersLimit:function(){return!!this.activePlan&&!!this.activePlan.attributes.teamMembers},remainingTeamMembers:function(){return this.activePlan?this.activePlan.attributes.teamMembers-this.$parent.team.users.length:0},canInviteMoreTeamMembers:function(){return!this.hasTeamMembersLimit||this.remainingTeamMembers>0}},created:function(){this.getPlans(),this.getRoles()},methods:{send:function(){var t=this;Spark.post("/settings/".concat(Spark.teamsPrefix,"/").concat(this.team.id,"/invitations"),this.form).then((function(){t.form.email="",t.form.role=Spark.defaultRole,t.$parent.$emit("updateInvitations")}))},getPlans:function(){var t=this;axios.get("/spark/plans").then((function(e){t.plans=e.data}))},getRoles:function(){var t=this;axios.get("/settings/".concat(Spark.teamsPrefix,"/roles")).then((function(e){t.roles=e.data}))}}}},35274:t=>{t.exports={props:["user","team"],data:function(){return{roles:[],updatingTeamMember:null,deletingTeamMember:null,updateTeamMemberForm:$.extend(!0,new SparkForm({role:""}),Spark.forms.updateTeamMember),deleteTeamMemberForm:new SparkForm({})}},created:function(){this.getRoles()},computed:{urlForUpdating:function(){return"/settings/".concat(Spark.teamsPrefix,"/").concat(this.team.id,"/members/").concat(this.updatingTeamMember.id)},urlForDeleting:function(){return"/settings/".concat(Spark.teamsPrefix,"/").concat(this.team.id,"/members/").concat(this.deletingTeamMember.id)}},methods:{getRoles:function(){var t=this;axios.get("/settings/".concat(Spark.teamsPrefix,"/roles")).then((function(e){t.roles=e.data}))},editTeamMember:function(t){this.updatingTeamMember=t,this.updateTeamMemberForm.role=t.pivot.role,$("#modal-update-team-member").modal("show")},update:function(){Spark.put(this.urlForUpdating,this.updateTeamMemberForm).then((function(){Bus.$emit("updateTeam"),$("#modal-update-team-member").modal("hide")}))},approveTeamMemberDelete:function(t){this.deletingTeamMember=t,$("#modal-delete-member").modal("show")},deleteMember:function(){Spark.delete(this.urlForDeleting,this.deleteTeamMemberForm).then((function(){Bus.$emit("updateTeam"),$("#modal-delete-member").modal("hide")}))},canEditTeamMember:function(t){return this.user.id===this.team.owner_id&&this.user.id!==t.id},canDeleteTeamMember:function(t){return this.user.id===this.team.owner_id&&this.user.id!==t.id},teamMemberRole:function(t){if(0===this.roles.length)return"";if("owner"===t.pivot.role)return"Owner";var e=_.find(this.roles,(function(e){return e.value==t.pivot.role}));return void 0!==e?e.text:void 0}}}},40831:t=>{t.exports={props:["user","team","billableType"],data:function(){return{invitations:[]}},created:function(){var t=this;this.getInvitations(),this.$on("updateInvitations",(function(){t.getInvitations()}))},methods:{getInvitations:function(){var t=this;axios.get("/settings/".concat(Spark.teamsPrefix,"/").concat(this.team.id,"/invitations")).then((function(e){t.invitations=e.data}))}}}},3490:t=>{t.exports={props:["user","team"]}},52361:(t,e,n)=>{t.exports={props:["user","teamId"],mixins:[n(9744)],data:function(){return{billableType:"team",team:null}},created:function(){var t=this;this.getTeam(),Bus.$on("updateTeam",(function(){t.getTeam()}))},mounted:function(){this.usePushStateForTabs(".spark-settings-tabs")},methods:{getTeam:function(){var t=this;axios.get("/settings/".concat(Spark.teamsPrefix,"/json/").concat(this.teamId)).then((function(e){t.team=e.data}))}}}},49420:t=>{t.exports={props:["user","team"],data:function(){return{form:new SparkForm({name:""})}},mounted:function(){this.form.name=this.team.name},methods:{update:function(){Spark.put("/settings/".concat(Spark.teamsPrefix,"/").concat(this.team.id,"/name"),this.form).then((function(){Bus.$emit("updateTeam"),Bus.$emit("updateTeams")}))}}}},21271:t=>{t.exports={props:["user","team"],data:function(){return{form:new SparkForm({})}},methods:{update:function(t){if(t.preventDefault(),this.$refs.photo.files.length){var e=this;this.form.startProcessing(),axios.post(this.urlForUpdate,this.gatherFormData()).then((function(){Bus.$emit("updateTeam"),Bus.$emit("updateTeams"),e.form.finishProcessing()}),(function(t){e.form.setErrors(t.response.data.errors)}))}},gatherFormData:function(){var t=new FormData;return t.append("photo",this.$refs.photo.files[0]),t}},computed:{urlForUpdate:function(){return"/settings/".concat(Spark.teamsPrefix,"/").concat(this.team.id,"/photo")},previewStyle:function(){return"background-image: url(".concat(this.team.photo_url,")")}}}},28961:(t,e,n)=>{function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}window.URI=n(54998),window.axios=n(9669),window._=n(96486),window.moment=n(30381),window.Promise=n(58259),window.Popper=n(28981).default,window.__=function(t,e){var n=Spark.translations[t]?Spark.translations[t]:t;return _.forEach(e,(function(t,e){n=n.replace(":"+e,t)})),n},window.moment.defineLocale("en-short",{parentLocale:"en",relativeTime:{future:"in %s",past:"%s",s:"1s",m:"1m",mm:"%dm",h:"1h",hh:"%dh",d:"1d",dd:"%dd",M:"1 month ago",MM:"%d months ago",y:"1y",yy:"%dy"}}),window.moment.locale("en"),void 0!==window.$&&void 0!==window.jQuery||(window.$=window.jQuery=n(19755)),n(43734),$("#spark-app").length>0&&n(74223),window.axios.defaults.headers.common={"X-Requested-With":"XMLHttpRequest","X-CSRF-TOKEN":Spark.csrfToken},window.axios.interceptors.response.use((function(t){return t}),(function(t){if(void 0===t.response)return Promise.reject(t);if(t.response&&t.response.data&&"CSRF token mismatch."!==t.response.data.message&&"Account required to create additional short links."!==t.response.data.message&&"Your email address is not verified."!==t.response.data.message&&402!==t.response.status&&400!==t.response.status){var e="";if("object"===i(t.response.data.errors))$.each(t.response.data.errors,(function(t,n){e+=n+" "}));else if(t&&t.response&&t.response.data&&t.response.data.message)e=t.response.data.message;$.toast({title:"Something went wrong!",message:e,style:"error",duration:5e3})}if(401===t.response.status)window.axios.get("/logout"),$("#modal-session-expired").modal("show");return Promise.reject(t)}))},19647:t=>{t.exports={el:"#spark-app",lastRefreshedApiTokenAt:null,data:{user:Spark.state.user,teams:Spark.state.teams,currentTeam:Spark.state.currentTeam,loadingNotifications:!1,notifications:null,supportForm:new SparkForm({from:"",subject:"",message:""})},created:function(){var t=this;Spark.userId&&this.loadDataForAuthenticatedUser(),Spark.userId&&Spark.usesApi&&this.refreshApiTokenEveryFewMinutes(),Bus.$on("updateUser",(function(){t.getUser()})),Bus.$on("updateUserData",(function(){t.loadDataForAuthenticatedUser()})),Bus.$on("updateTeams",(function(){t.getTeams()})),Bus.$on("showNotifications",(function(){$("#modal-notifications").modal("show"),t.markNotificationsAsRead()})),Bus.$on("showSupportForm",(function(){t.user&&(t.supportForm.from=t.user.email),$("#modal-support").modal("show"),setTimeout((function(){$("#support-subject").focus()}),500)}))},mounted:function(){this.whenReady()},methods:{whenReady:function(){},loadDataForAuthenticatedUser:function(){this.getNotifications()},refreshApiTokenEveryFewMinutes:function(){var t=this;this.lastRefreshedApiTokenAt=moment(),setInterval((function(){t.refreshApiToken()}),174e4),setInterval((function(){moment().diff(t.lastRefreshedApiTokenAt,"minutes")>=30&&t.refreshApiToken()}),5e3)},refreshApiToken:function(){this.lastRefreshedApiTokenAt=moment(),axios.put("/spark/token")},getUser:function(){var t=this;axios.get("/user/current").then((function(e){t.$set(t,"user",e.data)}))},getTeams:function(){var t=this;axios.get("/settings/"+Spark.teamsPrefix).then((function(e){t.$set(t,"teams",e.data)}))},getCurrentTeam:function(){var t=this;axios.get("/settings/".concat(Spark.teamsPrefix,"/current")).then((function(e){t.$set(t,"currentTeam",e.data)})).catch((function(t){}))},getNotifications:function(){var t=this;this.loadingNotifications=!0,axios.get("/notifications/recent").then((function(e){t.$set(t,"notifications",e.data),t.loadingNotifications=!1}))},markNotificationsAsRead:function(){this.hasUnreadNotifications&&(axios.put("/notifications/read",{notifications:_.map(this.notifications.notifications,"id")}),_.each(this.notifications.notifications,(function(t){t.read=1})))},sendSupportRequest:function(){var t=this;Spark.post("/support/email",this.supportForm).then((function(){$("#modal-support").modal("hide"),t.showSupportRequestSuccessMessage(),t.supportForm.subject="",t.supportForm.message=""}))},showSupportRequestSuccessMessage:function(){Swal.fire({title:__("Got It!"),text:__("We have received your message and will respond soon!"),icon:"success",showConfirmButton:!1,timer:2e3})}},computed:{unreadAnnouncementsCount:function(){var t=this;return this.notifications&&this.user?this.notifications.announcements.length&&!this.user.last_read_announcements_at?this.notifications.announcements.length:_.filter(this.notifications.announcements,(function(e){return moment.utc(t.user.last_read_announcements_at).isBefore(moment.utc(e.created_at))})).length:0},unreadNotificationsCount:function(){return this.notifications?_.filter(this.notifications.notifications,(function(t){return!t.read})).length:0},hasUnreadAnnouncements:function(){return this.unreadAnnouncementsCount>0},hasUnreadNotifications:function(){return this.unreadNotificationsCount>0}}}},74223:(t,e,n)=>{void 0===window.Vue&&(window.Vue=n(2934),window.Bus=new Vue),Vue.mixin(n(46209)),n(74518),n(68113)},75067:()=>{},45807:()=>{},46700:(t,e,n)=>{var i={"./af":42786,"./af.js":42786,"./ar":30867,"./ar-dz":14130,"./ar-dz.js":14130,"./ar-kw":96135,"./ar-kw.js":96135,"./ar-ly":56440,"./ar-ly.js":56440,"./ar-ma":47702,"./ar-ma.js":47702,"./ar-sa":16040,"./ar-sa.js":16040,"./ar-tn":37100,"./ar-tn.js":37100,"./ar.js":30867,"./az":31083,"./az.js":31083,"./be":9808,"./be.js":9808,"./bg":68338,"./bg.js":68338,"./bm":67438,"./bm.js":67438,"./bn":8905,"./bn.js":8905,"./bo":11560,"./bo.js":11560,"./br":1278,"./br.js":1278,"./bs":80622,"./bs.js":80622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":50877,"./cv.js":50877,"./cy":47373,"./cy.js":47373,"./da":24780,"./da.js":24780,"./de":59740,"./de-at":60217,"./de-at.js":60217,"./de-ch":60894,"./de-ch.js":60894,"./de.js":59740,"./dv":5300,"./dv.js":5300,"./el":50837,"./el.js":50837,"./en-SG":85383,"./en-SG.js":85383,"./en-au":78348,"./en-au.js":78348,"./en-ca":77925,"./en-ca.js":77925,"./en-gb":22243,"./en-gb.js":22243,"./en-ie":46436,"./en-ie.js":46436,"./en-il":47207,"./en-il.js":47207,"./en-nz":76319,"./en-nz.js":76319,"./eo":92915,"./eo.js":92915,"./es":55655,"./es-do":55251,"./es-do.js":55251,"./es-us":71146,"./es-us.js":71146,"./es.js":55655,"./et":5603,"./et.js":5603,"./eu":77763,"./eu.js":77763,"./fa":76959,"./fa.js":76959,"./fi":11897,"./fi.js":11897,"./fo":94694,"./fo.js":94694,"./fr":94470,"./fr-ca":63049,"./fr-ca.js":63049,"./fr-ch":52330,"./fr-ch.js":52330,"./fr.js":94470,"./fy":5044,"./fy.js":5044,"./ga":29295,"./ga.js":29295,"./gd":2101,"./gd.js":2101,"./gl":38794,"./gl.js":38794,"./gom-latn":23168,"./gom-latn.js":23168,"./gu":95349,"./gu.js":95349,"./he":24206,"./he.js":24206,"./hi":30094,"./hi.js":30094,"./hr":30316,"./hr.js":30316,"./hu":22138,"./hu.js":22138,"./hy-am":11423,"./hy-am.js":11423,"./id":29218,"./id.js":29218,"./is":90135,"./is.js":90135,"./it":90626,"./it-ch":10150,"./it-ch.js":10150,"./it.js":90626,"./ja":39183,"./ja.js":39183,"./jv":24286,"./jv.js":24286,"./ka":12105,"./ka.js":12105,"./kk":47772,"./kk.js":47772,"./km":18758,"./km.js":18758,"./kn":79282,"./kn.js":79282,"./ko":33730,"./ko.js":33730,"./ku":1408,"./ku.js":1408,"./ky":33291,"./ky.js":33291,"./lb":36841,"./lb.js":36841,"./lo":55466,"./lo.js":55466,"./lt":57010,"./lt.js":57010,"./lv":37595,"./lv.js":37595,"./me":39861,"./me.js":39861,"./mi":35493,"./mi.js":35493,"./mk":95966,"./mk.js":95966,"./ml":87341,"./ml.js":87341,"./mn":5115,"./mn.js":5115,"./mr":10370,"./mr.js":10370,"./ms":9847,"./ms-my":41237,"./ms-my.js":41237,"./ms.js":9847,"./mt":72126,"./mt.js":72126,"./my":56165,"./my.js":56165,"./nb":64924,"./nb.js":64924,"./ne":16744,"./ne.js":16744,"./nl":93901,"./nl-be":59814,"./nl-be.js":59814,"./nl.js":93901,"./nn":83877,"./nn.js":83877,"./pa-in":15858,"./pa-in.js":15858,"./pl":64495,"./pl.js":64495,"./pt":89520,"./pt-br":57971,"./pt-br.js":57971,"./pt.js":89520,"./ro":96459,"./ro.js":96459,"./ru":21793,"./ru.js":21793,"./sd":40950,"./sd.js":40950,"./se":10490,"./se.js":10490,"./si":90124,"./si.js":90124,"./sk":64249,"./sk.js":64249,"./sl":14985,"./sl.js":14985,"./sq":51104,"./sq.js":51104,"./sr":49131,"./sr-cyrl":79915,"./sr-cyrl.js":79915,"./sr.js":49131,"./ss":85893,"./ss.js":85893,"./sv":98760,"./sv.js":98760,"./sw":91172,"./sw.js":91172,"./ta":27333,"./ta.js":27333,"./te":23110,"./te.js":23110,"./tet":52095,"./tet.js":52095,"./tg":27321,"./tg.js":27321,"./th":9041,"./th.js":9041,"./tl-ph":75768,"./tl-ph.js":75768,"./tlh":89444,"./tlh.js":89444,"./tr":72397,"./tr.js":72397,"./tzl":28254,"./tzl.js":28254,"./tzm":51106,"./tzm-latn":30699,"./tzm-latn.js":30699,"./tzm.js":51106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":67691,"./uk.js":67691,"./ur":13795,"./ur.js":13795,"./uz":6791,"./uz-latn":60588,"./uz-latn.js":60588,"./uz.js":6791,"./vi":65666,"./vi.js":65666,"./x-pseudo":14378,"./x-pseudo.js":14378,"./yo":75805,"./yo.js":75805,"./zh-cn":83839,"./zh-cn.js":83839,"./zh-hk":55726,"./zh-hk.js":55726,"./zh-tw":74152,"./zh-tw.js":74152};function s(t){var e=a(t);return n(e)}function a(t){if(!n.o(i,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return i[t]}s.keys=function(){return Object.keys(i)},s.resolve=a,t.exports=s,s.id=46700},17007:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var i,s=n(47297);function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const r={props:{labels:Array,data:Array},extends:s.$I,watch:(i={},a(i,"data",{deep:!0,handler:function(){this.buildChart()}}),a(i,"labels",{deep:!0,handler:function(){this.buildChart()}}),i),mounted:function(){this.buildChart()},methods:{dynamicColors:function(){for(var t=[],e=0;e{"use strict";n.d(e,{Z:()=>a});var i=n(47297);const s={props:{labels:Array,data:Array},extends:i.n4,methods:{dynamicColors:function(){for(var t=[],e=0;e{"use strict";n.d(e,{Z:()=>u});var i=n(47297);var s,a,r;const o={props:{labels:Array,datasets:Array},data:function(){return{options:{legend:{display:!1},responsive:!0,maintainAspectRatio:!1,tooltips:{callbacks:{label:function(t,e){console.log(t,e);var n=e.datasets[t.datasetIndex].label,i=e.datasets[t.datasetIndex].data[t.index];return n+": "+(i?parseInt(i).toLocaleString():0)}}},scales:{yAxes:[{ticks:{beginAtZero:!0,precision:0,userCallback:function(t,e,n){return t?parseInt(t).toLocaleString():0}}}]}}}},extends:i.x1,methods:{buildChart:function(){this.renderChart({labels:this.labels,datasets:this.datasets},this.options)}},watch:(s={},a="datasets",r={deep:!0,handler:function(){this.buildChart()}},a in s?Object.defineProperty(s,a,{value:r,enumerable:!0,configurable:!0,writable:!0}):s[a]=r,s),mounted:function(){this.buildChart()}};const u=(0,n(51900).Z)(o,undefined,undefined,!1,null,null,null).exports},57806:(t,e,n)=>{"use strict";n.d(e,{Z:()=>h});var i=n(33239),s=n(43698);var a=(0,n(47297).f1)("choropleth","choropleth"),r=i.t_.feature(s,s.objects.countries).features;var o,u,l;const c={name:"App",props:["data"],data:function(){return{chartData:{},options:{responsive:!0,maintainAspectRatio:!1,showOutline:!0,showGraticule:!0,legend:{display:!1},scale:{projection:"equalEarth"}},minTotal:0,maxTotal:0}},extends:a,watch:(o={},u="data",l={deep:!0,handler:function(){this.buildChart()}},u in o?Object.defineProperty(o,u,{value:l,enumerable:!0,configurable:!0,writable:!0}):o[u]=l,o),mounted:function(){this.buildChart()},methods:{buildChart:function(){this.calculateMinMax(),this.buildChartData(),this.renderChart(this.chartData,this.options)},getValue:function(t){return this.data.has(t.properties.name)?this.data.get(t.properties.name):0},getColor:function(t){return this.linearColorScale(t)},linearColorScale:function(t){console.log(this.maxTotal);var e=(t-this.minTotal)/(this.maxTotal-this.minTotal),n=this.hexToRgb("#e95420"),i=this.hexToRgb("#284243"),s=Math.round(n.r+e*(i.r-n.r)),a=Math.round(n.g+e*(i.g-n.g)),r=Math.round(n.b+e*(i.b-n.b));return"rgb(".concat(s,", ").concat(a,", ").concat(r,")")},buildChartData:function(){var t=this;this.chartData={labels:r.map((function(t){return t.properties.name})),datasets:[{label:"Countries",data:r.map((function(e){return{feature:e,value:parseInt(t.getValue(e,10)).toLocaleString()}})),backgroundColor:r.map((function(e){return t.getColor(t.getValue(e))}))}]}},calculateMinMax:function(){var t=0,e=0;this.data.forEach((function(n){var i=parseInt(n,10);ie&&(e=i)})),this.minTotal=t,this.maxTotal=e},hexToRgb:function(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,i){return e+e+n+n+i+i}));var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}}};const h=(0,n(51900).Z)(c,undefined,undefined,!1,null,null,null).exports}},t=>{var e=e=>t(t.s=e);t.O(0,[829,170,898],(()=>(e(96099),e(75067),e(45807))));t.O()}]);